Browse Source

主题基本

CzRger 6 months ago
parent
commit
1bf115fc47
2 changed files with 40 additions and 54 deletions
  1. 1 1
      src/stores/theme.ts
  2. 39 53
      src/views/manage/theme/style.vue

+ 1 - 1
src/stores/theme.ts

@@ -9,7 +9,7 @@ export const useThemeStore = defineStore('theme', {
     title: '智慧搜索平台',
     subTitle: '',
     logo: '',
-    titleLogo: titleLogo,
+    titleLogo: '',
     webBgImg: webBgImg,
     loginImg: loginImg,
   }),

+ 39 - 53
src/views/manage/theme/style.vue

@@ -3,70 +3,56 @@
     :show="show"
     :title="titleCpt"
     @onClose="$emit('update:show', false)"
-    width="600px"
+    width="80%"
     height="auto"
     @onSubmit="onSubmit"
     :loading="state.loading"
   >
     <div class="__cus-dialog-form">
-      <CusForm ref="ref_form" label-width="80px">
+      <CusForm ref="ref_form" label-width="100px">
         <CusFormColumn
-          :span="24"
+          :span="8"
           required
-          label="名称"
-          v-model:param="state.form.themeName"
-        />
+          label="主题色"
+          v-model:param="state.form.mainColor"
+          :clearable="false"
+          :readonly="true"
+        >
+          <template #suffix>
+            <el-color-picker v-model="state.form.mainColor" size="small"/>
+          </template>
+        </CusFormColumn>
         <CusFormColumn
-          :span="24"
+          :span="8"
           required
-          label="类别"
-          v-model:param="state.form.themeType"
-          link="select"
-          :options="DictionaryStore.themeTypeList"
-          :disabled="transfer.mode !== 'add'"
+          label="标题"
+          v-model:param="state.form.title"
         />
         <CusFormColumn
-          :span="24"
-          required
-          label="状态"
-          v-model:param="state.form.themeState"
-          link="select"
-          :options="DictionaryStore.themeStatusList"
+          :span="8"
+          label="副标题"
+          v-model:param="state.form.subTitle"
+        />
+        <CusFormColumn
+          :span="8"
+          label="logo(图标)"
+          v-model:param="state.form.logo"
+        />
+        <CusFormColumn
+          :span="8"
+          label="logo(标题)"
+          v-model:param="state.form.titleLogo"
+        />
+        <CusFormColumn
+          :span="8"
+          label="搜索背景图"
+          v-model:param="state.form.webBgImg"
+        />
+        <CusFormColumn
+          :span="8"
+          label="登录图片"
+          v-model:param="state.form.loginImg"
         />
-        <template v-if="state.form.themeType && state.form.themeType != '1'">
-          <CusFormColumn
-            :span="24"
-            required
-            label="URL"
-            v-model:param="state.form.themeUrl"
-            :disabled="state.form.themeType == '2'"
-          />
-          <template v-if="state.form.themeType == '2'">
-            <CusFormColumn
-              :span="24"
-              required
-              label="参数"
-              v-model:param="state.form.themeParam"
-              link="select"
-              multiple
-              filterable
-              allow-create
-              default-first-option
-              :reserve-keyword="false"
-              :options="[]"
-              static
-              placeholder="请输入参数,按回车保存"
-            />
-          </template>
-          <template v-else-if="state.form.themeType == '3'">
-            <CusFormColumn
-              :span="24"
-              required
-              label="参数"
-              v-model:param="state.form.themeParam"
-            />
-          </template>
-        </template>
       </CusForm>
     </div>
   </CusDialog>
@@ -130,7 +116,7 @@ const initDetail = () => {
     if (res.code === 200) {
       state.detail = res.data
       state.form = state.detail.themeParam ? JSON.parse(state.detail.themeParam) : {
-
+        mainColor: '#2e81ff',
       }
       state.loading = false
     } else {