ZaiZai 6 months ago
parent
commit
aff5758a5d
2 changed files with 40 additions and 20 deletions
  1. 1 1
      public/version.json
  2. 39 19
      src/views/using/query.vue

+ 1 - 1
public/version.json

@@ -1,3 +1,3 @@
 {
-  "value": "20240822110617"
+  "value": "20240822173958"
 }

+ 39 - 19
src/views/using/query.vue

@@ -1,5 +1,5 @@
 <template>
-    <div id="carry-spot-checks-layout-target" class="hc-using-query-page">
+    <div id="carry-spot-checks-layout-target" v-loading="!isAppLoading" class="hc-using-query-page">
         <div v-show="!isCarrySpotChecksDrawer" class="hc-query-card-box">
             <div v-if="isShowheader" class="hc-tag-flex-box">
                 <div class="hc-arrow-icon">
@@ -52,7 +52,7 @@
                             <div class="hc-search-hot-key">
                                 <span>热门搜索词汇:</span>
                                 <span
-                                    v-for="item in hotInputlist" :key="item.name" class=" ml-4"
+                                    v-for="item in hotInputlist" :key="item.name" class="ml-4"
                                     @click="clickHottitle(item)"
                                 >{{ item.name }}</span>
                             </div>
@@ -233,7 +233,7 @@
         </div>
 
         <!-- 预加载视频 -->
-        <video autoplay class="hc-preloaded-video" muted>
+        <video class="hc-preloaded-video" muted autoplay>
             <source src="/gui.mp4" type="video/mp4">
         </video>
 
@@ -532,11 +532,11 @@
 </template>
 
 <script setup>
-import { onMounted, ref, watch } from 'vue'
+import { computed, onMounted, ref, watch } from 'vue'
 import { useAppStore } from '~src/store'
 import MetaTable from '../transfer/components/meta-table.vue'
 import HcMediaMic from './components/media-mic/index.vue'
-import { arrIndex, arrToId, downloadBlob, getArrValue, getObjValue, isArrIndex } from 'js-fast-way'
+import { arrIndex, arrToId, downloadBlob, getArrValue, getObjValue, isArrIndex, isNullES } from 'js-fast-way'
 import archiveQueryApi from '~api/using/query.js'
 import tuningApi from '~api/archiveConfig/tuning.js'
 import imageViewGui from '~src/assets/view/gui.png'
@@ -546,9 +546,6 @@ import { setTimeString } from '~src/utils/tools'
 
 //变量
 const useAppState = useAppStore()
-const projectId = ref(useAppState.getProjectId)
-const contractId = ref(useAppState.getContractId)
-const contractInfo = ref(useAppState.getContractInfo)
 const isBubble = ref(useAppState.getBubble)
 const isShowheader = ref(false)
 const tags = ref([])
@@ -558,24 +555,47 @@ const isMac = userAgent.indexOf('Mac') !== -1
 const AppTheme = ref(useAppState.getTheme)
 
 //监听
-watch(() => [
-    useAppState.getBubble, tags.value, useAppState.getTheme,
-], ([bubble, Tags, theme]) => {
+watch(() => [useAppState.getBubble, tags.value, useAppState.getTheme], ([bubble, Tags, theme]) => {
     isBubble.value = bubble
     AppTheme.value = theme
-    if (Tags.length === 0) {
-        isShowheader.value = false
-    } else {
-        isShowheader.value = true
+    isShowheader.value = Tags.length !== 0
+})
+
+//获取项目信息
+const projectId = ref(useAppState.getProjectId)
+const contractId = ref(useAppState.getContractId)
+const contractInfo = ref(useAppState.getContractInfo)
+
+//监听
+watch(() => [useAppState.getProjectId, useAppState.getContractId, useAppState.getContractInfo], ([pid, cid, info]) => {
+    projectId.value = pid
+    contractId.value = cid
+    contractInfo.value = info
+}, { deep: true })
+
+//加载中
+const isAppLoading = computed(() => {
+    return !isNullES(projectId.value) && !isNullES(contractId.value)
+})
+
+//监听变化
+watch(() => isAppLoading.value, (val) => {
+    if (val) {
+        getCarrierTypeByDictdata()
+        setAnnuals()
+        setMonths()
+        getTableData()
     }
 })
 
 //渲染完成
 onMounted(() => {
-    getCarrierTypeByDictdata()
-    setAnnuals()
-    setMonths()
-    getTableData()
+    if (isAppLoading.value) {
+        getCarrierTypeByDictdata()
+        setAnnuals()
+        setMonths()
+        getTableData()
+    }
 })
 
 //截取日期