Преглед на файлове

试验表单加载状态

duy преди 2 години
родител
ревизия
bcedaa44c6
променени са 2 файла, в които са добавени 12 реда и са изтрити 10 реда
  1. 10 8
      src/views/tentative/detect/test-form.vue
  2. 2 2
      src/views/tentative/detect/test.vue

+ 10 - 8
src/views/tentative/detect/test-form.vue

@@ -59,7 +59,7 @@
                 </div>
             </template>
             <!-- 清表列表 -->
-            <el-scrollbar v-if="listItemData.length > 0" ref="ListItemScrollRef" v-loading="isLoading">
+            <el-scrollbar v-if="listItemData.length > 0" ref="ListItemScrollRef" v-loading="isLoadList">
                 <ListItem
                     ref="ListItemRef" :node-status="NodeStatus" :alllist-data="alllistData"
                     :auth-btn-tab-key="authBtnTabKey"
@@ -78,7 +78,7 @@
                     @updeviceUseIds="updeviceUseIds"
                 />
             </el-scrollbar>
-            <HcStatus v-else text="暂无表单" />
+            <HcStatus v-else v-loading="isLoadList" text="暂无表单" />
             <template #action>
                 <div class="hc-table-form-action-tip">
                     <el-alert
@@ -389,16 +389,16 @@ const listItemBaseData = ref({
     detectionCategory: '', detectionResult: '', reportDate: '', trialUserName: '', id: dataId,
 })
 
-//获取数据
-const isLoading = ref(false)
+
 const listItemData = ref([])
+const isLoadList = ref(false)
 const listDeviceUseIds = ref('')
 const reportData = ref([])
 const testData = ref([])
 const alllistData = ref([])
 const orgAlllistData = ref([])
 const getSearchNodeTables = async (newaddId) => {
-    isLoading.value = true
+    isLoadList.value = true
     const isid = dataId.length > 0 ? dataId : nodeIdvalue.value || newaddId || ''
     if (isaddType) {
         const { error, code, data } = await dataApi.searchNodeTables({
@@ -412,7 +412,7 @@ const getSearchNodeTables = async (newaddId) => {
             isAdd: isid.length > 0 ? '' : 1,
         })
         //处理数据
-        isLoading.value = false
+       
         if (!error && code === 200) {
             listItemData.value = getArrValue(data)
             listItemData.value.forEach((item) => {
@@ -427,6 +427,7 @@ const getSearchNodeTables = async (newaddId) => {
         } else {
             listItemData.value = []
         }
+        isLoadList.value = false
     } else {
         queryNodeStatus()//查询按钮状态
         const { error, code, data } = await dataApi.searchNodeTables({
@@ -439,7 +440,7 @@ const getSearchNodeTables = async (newaddId) => {
 
         })
         //处理数据
-        isLoading.value = false
+    
         if (!error && code === 200) {
             listItemData.value = getArrValue(data)
             listItemData.value.forEach((item) => {
@@ -451,6 +452,7 @@ const getSearchNodeTables = async (newaddId) => {
         } else {
             listItemData.value = []
         }
+        isLoadList.value = false
     }
 
 
@@ -471,7 +473,7 @@ const getSearchNodeTablesall = async (type, newaddId) => {
 
     })
     //处理数据
-    isLoading.value = false
+ 
     if (!error && code === 200) {
         // listItemData.value = getArrValue(data)
         if (type === 1) {

+ 2 - 2
src/views/tentative/detect/test.vue

@@ -460,8 +460,8 @@ const getTableData = async () => {
     //处理数据
     tableLoading.value = false
     if (!error && code === 200) {
-        tableData.value = getArrValue(data['records'])
-        searchForm.value.total = data.total || 0
+        tableData.value = getArrValue(data?.records)
+        searchForm.value.total = data?.total || 0
     } else {
         tableData.value = []
         searchForm.value.total = 0