CzRger 6 months ago
parent
commit
da2ffe77e4

+ 6 - 0
src/api/modules/web/list.ts

@@ -21,3 +21,9 @@ export const searchLogsGetKeyWordByUserId = (params: any) => handle({
   method: 'get',
   params
 })
+
+// 档案主题
+export const frontGetThemeByThemeId = (id: any) => handle({
+  url: `/${suffix}/front/getThemeByThemeId/${id}`,
+  method: 'get',
+})

+ 1 - 0
src/stores/theme.ts

@@ -12,6 +12,7 @@ export const useThemeStore = defineStore('theme', {
     titleLogo: '',
     webBgImg: webBgImg,
     loginImg: loginImg,
+    loadingBg: 'rgba(0, 0, 0, 0.4)'
   }),
   getters: {
   },

+ 1 - 0
src/views/manage/index/text-detail.vue

@@ -194,6 +194,7 @@ const onSubmit = () => {
 watch(() => props.show, (n) => {
   if (n) {
     state.loading = false
+    state.textTable.data = []
     initDictionary()
     if (props.transfer.mode === 'add') {
       state.form = {

+ 1 - 0
src/views/manage/theme/detail.vue

@@ -160,6 +160,7 @@ const initDetail = () => {
 }
 watch(() => props.show, (n) => {
   if (n) {
+    state.loading = false
     initDictionary()
     if (props.transfer.mode === 'add') {
       state.form = {}

+ 13 - 2
src/views/manage/theme/relation-detail.vue

@@ -82,6 +82,10 @@
                 required
                 :span="24"
                 v-model:param="scope.row.indexParam"
+                link="select"
+                :options="state.textOptions"
+                label-key="fieldNameCn"
+                value-key="id"
               />
             </template>
             <template #condition-column-value="{scope}">
@@ -122,6 +126,10 @@
                 required
                 :span="24"
                 v-model:param="scope.row.sortParam"
+                link="select"
+                :options="state.textOptions"
+                label-key="fieldNameCn"
+                value-key="id"
               />
             </template>
             <template #sortType-column-value="{scope}">
@@ -174,7 +182,7 @@ const state: any = reactive({
     selectValue: '',
     data: [],
     tableHead: [
-      {value: "indexParam", label: "查询条件"},
+      {value: "indexParam", label: "查询字段"},
       {value: "condition", label: "条件类型"},
       {value: "themeParam", label: "主题参数"},
       {value: "do", label: "操作", width: 200, fixed: 'right'},
@@ -204,7 +212,7 @@ const onSubmit = () => {
       type: "warning",
     } as any).then(() => {
       state.loading = true
-      const params = JSON.parse(JSON.stringify(state.form))
+      const params = {...state.form}
       params.indexCondition = JSON.stringify(state.conditionTable.data)
       params.indexOrder = JSON.stringify(state.sortTable.data)
       if (props.transfer.mode === 'add') {
@@ -281,6 +289,9 @@ const handleChangeCondition = (val) => {
 }
 watch(() => props.show, (n) => {
   if (n) {
+    state.loading = false
+    state.conditionTable.data = []
+    state.sortTable.data = []
     initDictionary()
     if (props.transfer.mode === 'add') {
       state.form = {

+ 4 - 4
src/views/web/list/index.vue

@@ -224,7 +224,7 @@
 <script setup lang="ts">
 import {computed, getCurrentInstance, onBeforeMount, onMounted, reactive, ref, watch} from "vue";
 import {useRoute, useRouter} from "vue-router";
-import {useAppStore, useDictionaryStore, useWebStore} from "@/stores";
+import {useAppStore, useDictionaryStore, useThemeStore, useWebStore} from "@/stores";
 import {ElLoading, ElMessage} from "element-plus";
 import {frontGetIndexAndFieldInfo} from "@/api/modules/web/list";
 import DetailCom from './detail.vue'
@@ -232,6 +232,7 @@ import DetailCom from './detail.vue'
 const {proxy} = getCurrentInstance()
 const AppStore = useAppStore()
 const WebStore = useWebStore()
+const ThemeStore = useThemeStore()
 const DictionaryStore = useDictionaryStore()
 const route = useRoute()
 const router = useRouter()
@@ -281,7 +282,6 @@ const state: any = reactive({
     show: false
   }
 })
-const loadingBg = 'rgba(0, 0, 0, 0.4)'
 const ref_area = ref()
 const isSelectAllCpt = computed(() => {
   return WebStore.searchAreaIndexTotal === state.cascaderParams.value.length
@@ -549,7 +549,7 @@ const initWS = () => {
       state.ws.loading = ElLoading.service({
         lock: true,
         text: '详情信息获取中……',
-        background: loadingBg,
+        background: ThemeStore.loadingBg,
       })
       if (state.ws.loadingTimer) {
         clearTimeout(state.ws.loadingTimer)
@@ -659,7 +659,7 @@ const initWS = () => {
     state.ws.loading = ElLoading.service({
       lock: true,
       text: '智搜服务重新连接中……',
-      background: loadingBg,
+      background: ThemeStore.loadingBg,
     })
     setTimeout(initWS, 5000);
   }