ソースを参照

接口code码不同,不进行校验了

CzRger 1 年間 前
コミット
f223b89bfc
共有1 個のファイルを変更した9 個の追加6 個の削除を含む
  1. 9 6
      src/views/gis/business/enterprise/index.vue

+ 9 - 6
src/views/gis/business/enterprise/index.vue

@@ -63,7 +63,7 @@
           </div>
         </div>
       </div>
-      <div class="table">
+      <div class="table" v-loading="enterprise.table.loading">
         <div class="table-card">
           <template v-for="(item, index) in enterprise.table.data">
             <div class="table-card-item __hover" :class="{active: item.id === $store.state.gis.activeQyId}" @click="handleClick(item)">
@@ -140,7 +140,8 @@ export default defineComponent({
           data: <any>[],
           pageNum: 1,
           pageSize: 10,
-          total: 0
+          total: 0,
+          loading: false
         }
       },
       statistic: {
@@ -184,11 +185,13 @@ export default defineComponent({
       if (state.enterprise.form.type?.length > 0) {
         params.entType = state.enterprise.form.type.map(v => store.getters['dictionary/elementTypeMap'].get(v)).join(',')
       }
+      state.enterprise.table.loading = true
       that.$api.enterpriseQuery(params).then((res: any) => {
-        if (res.resp_code === 0 && res.datas?.length > 0) {
-          state.enterprise.table.data = res.datas
-          state.enterprise.table.total = res.recordCount
-        }
+        state.enterprise.table.data = res.datas || []
+        state.enterprise.table.total = res.recordCount || 0
+        state.enterprise.table.loading = false
+      }).catch(() => {
+        state.enterprise.table.loading = false
       })
     }
     const initStatistic = () => {