ZaiZai há 11 meses atrás
pai
commit
a1deca9d85
2 ficheiros alterados com 11 adições e 0 exclusões
  1. 9 0
      src/utils/tools.js
  2. 2 0
      src/views/tentative/material/sampling.vue

+ 9 - 0
src/utils/tools.js

@@ -1,6 +1,15 @@
 import { arrIndex, getArrValue } from 'js-fast-way'
 import { getDictionary, getDictionaryBiz } from '~api/other'
 
+//延迟
+export const setLatency = (time = 1000) => {
+    return new Promise((resolve) => {
+        setTimeout(() => {
+            resolve(true)
+        }, time)
+    })
+}
+
 //获取字典数据
 export const getDictionaryData = async (code, biz = false) => {
     let res = []

+ 2 - 0
src/views/tentative/material/sampling.vue

@@ -260,6 +260,7 @@
 <script setup>
 import { onActivated, ref, watch } from 'vue'
 import { useAppStore } from '~src/store'
+import { setLatency } from '~uti/tools'
 import TestTree from './components/TestTree.vue'
 import HcDragUpload from './components/HcDragUpload.vue'
 import { getStoreValue, setStoreValue } from '~src/utils/storage'
@@ -824,6 +825,7 @@ const entrustId = ref('')
 const delegateContractChange = async () => {
     delegateHtmlLoading.value = true
     await getDelegateDataInfo()
+    await setLatency(1000)
     await getDelegateExcelHtml()
     delegateHtmlLoading.value = false
 }