소스 검색

新增暂无数据状态展示

yuanmingze 3 일 전
부모
커밋
7af95515c4

BIN
dist.zip


+ 31 - 8
src/views/admin/taskManagement/missionCenter.vue

@@ -25,7 +25,7 @@
                 </el-tooltip>
               </template>
               <template v-else>
-                <el-button :type="exportPkgDisabled ? '' : 'primary'" v-if="pkgDetailShow" :disabled="exportPkgDisabled" size="small" @click="downInfo(2)">{{
+                <el-button class="down-btn" plain :type="exportPkgDisabled ? 'info' : 'primary'" :disabled="exportPkgDisabled" size="small" @click="downInfo(2)">{{
                   pkgBtnText
                 }}</el-button>
               </template>
@@ -38,7 +38,7 @@
                 </el-tooltip>
               </template>
               <template v-else>
-                <el-button :type="exportTaskDetailDisabled ? '' : 'primary'" v-if="taskDetailShow" :disabled="exportTaskDetailDisabled" size="small" @click="downInfo(1)">{{
+                <el-button class="down-btn" plain :type="exportTaskDetailDisabled ? 'info' : 'primary'" :disabled="exportTaskDetailDisabled" size="small" @click="downInfo(1)">{{
                   taskDetailBtnText
                 }}</el-button>
               </template>
@@ -247,17 +247,17 @@ export default {
   data() {
     return {
       taskDetailShow: false,
-      taskDetailBtnText: '',
-      exportTaskDetailDisabled: false,
+      taskDetailBtnText: '暂无数据',
+      exportTaskDetailDisabled: true,
       exportType: '',
       taskDetailUrl: '',
       exportDialogVisible: false,
       pkgBtnErrorMsg: '',
-      exportPkgDisabled: false,
+      exportPkgDisabled: true,
       pkgUrl: '',
       taskDetailErrorMsg: '',
       pkgDetailShow: false,
-      pkgBtnText: '',
+      pkgBtnText: '暂无数据',
       exportForm: {
         startDate: ''
       },
@@ -598,7 +598,11 @@ export default {
         if (res.data.code === 0) {
           this.taskDetailShow = true;
           const status = res.data.data.status;
-          if (status === 'GENERATING') {
+          if (status === 'NOT_GENERATE') {
+            this.taskDetailBtnText = '暂无数据';
+            this.exportTaskDetailDisabled = true;
+            return false;
+          } else if (status === 'GENERATING') {
             this.taskDetailBtnText = '数据生成中';
             this.exportTaskDetailDisabled = true;
             return false;
@@ -644,7 +648,11 @@ export default {
         if (res.data.code === 0) {
           this.pkgDetailShow = true;
           const status = res.data.data.status;
-          if (status === 'GENERATING') {
+          if (status === 'NOT_GENERATE') {
+            this.pkgBtnText = '暂无数据';
+            this.exportPkgDisabled = true;
+            return false;
+          } else if (status === 'GENERATING') {
             this.pkgBtnText = '数据生成中';
             this.exportPkgDisabled = true;
             return false;
@@ -759,4 +767,19 @@ export default {
     color: red !important;
   }
 }
+
+.down-btn {
+  background-color: #fff !important;
+  &:hover {
+    color: #6eb657 !important;
+  }
+}
+
+::v-deep .el-button--info {
+  background-color: #fff !important;
+
+  &:hover {
+    color: #bcbec2 !important;
+  }
+}
 </style>

+ 28 - 11
src/views/admin/user/index.vue

@@ -39,9 +39,9 @@
             </el-tooltip>
           </template>
           <template v-else>
-            <el-button :type="exportUserInfoDisabled ? '' : 'primary'" v-if="downShow" size="small" :disabled="exportUserInfoDisabled" type="primary" @click="downInfo">{{
-              exportUserInfoText
-            }}</el-button>
+            <el-button class="down-btn" :type="exportUserInfoDisabled ? 'info' : 'primary'" plain size="small" :disabled="exportUserInfoDisabled" @click="downInfo"
+              >{{ exportUserInfoText }}
+            </el-button>
           </template>
           <el-button v-if="userInfo?.roles?.includes(50)" size="small" type="primary" @click="exportUserInfo">导出人员数据</el-button>
         </template>
@@ -214,10 +214,9 @@ export default {
   },
   data() {
     return {
-      exportUserInfoText: '',
+      exportUserInfoText: '暂无数据',
       exportUrl: '',
-      downShow: false,
-      exportUserInfoDisabled: false,
+      exportUserInfoDisabled: true,
       exportUserInfoErrorMsg: '',
       hideCommunicationOfficer: true,
       dialogType: '',
@@ -356,7 +355,7 @@ export default {
   methods: {
     async exportUserInfo() {
       const res = await exportUserInfo({});
-      console.log(res);
+
       if (res.data.code === 0 && res.data.data) {
         this.getExportInfoStatus();
       }
@@ -368,9 +367,13 @@ export default {
         const res = await getExportResult({ type: 'USER' });
         this.exportUserInfoErrorMsg = '';
         if (res.data.code === 0) {
-          this.downShow = true;
           const status = res.data.data.status;
-          if (status === 'GENERATING') {
+
+          if (status === 'NOT_GENERATE') {
+            this.exportUserInfoText = '暂无数据';
+            this.exportUserInfoDisabled = true;
+            return false;
+          } else if (status === 'GENERATING') {
             this.exportUserInfoText = '数据生成中';
             this.exportUserInfoDisabled = true;
             return false;
@@ -384,7 +387,6 @@ export default {
             this.exportUserInfoDisabled = true;
             return true;
           } else {
-            this.downShow = false;
             return true;
           }
         } else {
@@ -402,7 +404,7 @@ export default {
         const timer = setInterval(async () => {
           const stopLoop = await checkStatus();
           if (stopLoop) clearInterval(timer);
-        }, 5000); // 每5秒轮询一次
+        }, 60000); // 每5秒轮询一次
       }
     },
 
@@ -821,4 +823,19 @@ export default {
     color: red !important;
   }
 }
+
+.down-btn {
+  background-color: #fff !important;
+  &:hover {
+    color: #6eb657 !important;
+  }
+}
+
+::v-deep .el-button--info {
+  background-color: #fff !important;
+
+  &:hover {
+    color: #bcbec2 !important;
+  }
+}
 </style>

+ 33 - 11
src/views/serviceManagement/serviceReviewed/index.vue

@@ -108,7 +108,7 @@
               </el-tooltip>
             </template>
             <template v-else>
-              <el-button :type="exportPkgDisabled ? '' : 'primary'" v-if="pkgDetailShow" :disabled="exportPkgDisabled" size="small" @click="downInfo(2)">{{
+              <el-button class="down-btn" plain :type="exportPkgDisabled ? 'info' : 'primary'" :disabled="exportPkgDisabled" size="small" @click="downInfo(2)">{{
                 pkgBtnText
               }}</el-button>
             </template>
@@ -121,7 +121,7 @@
               </el-tooltip>
             </template>
             <template v-else>
-              <el-button :type="exportTaskDetailDisabled ? '' : 'primary'" v-if="taskDetailShow" :disabled="exportTaskDetailDisabled" size="small" @click="downInfo(1)">{{
+              <el-button class="down-btn" plain :type="exportTaskDetailDisabled ? 'info' : 'primary'" :disabled="exportTaskDetailDisabled" size="small" @click="downInfo(1)">{{
                 taskDetailBtnText
               }}</el-button>
             </template>
@@ -255,17 +255,17 @@ export default {
   data() {
     return {
       taskDetailShow: false,
-      taskDetailBtnText: '',
+      taskDetailBtnText: '暂无数据',
       taskDetailErrorMsg: '',
-      exportTaskDetailDisabled: false,
+      exportTaskDetailDisabled: true,
       exportType: '',
       taskDetailUrl: '',
       exportDialogVisible: false,
-      exportPkgDisabled: false,
+      exportPkgDisabled: true,
       pkgUrl: '',
       pkgBtnErrorMsg: '',
       pkgDetailShow: false,
-      pkgBtnText: '',
+      pkgBtnText: '暂无数据',
       exportForm: {
         startDate: ''
       },
@@ -516,8 +516,11 @@ export default {
         if (res.data.code === 0) {
           this.taskDetailShow = true;
           let status = res.data.data.status;
-
-          if (status === 'GENERATING') {
+          if (status === 'NOT_GENERATE') {
+            this.taskDetailBtnText = '暂无数据';
+            this.exportTaskDetailDisabled = true;
+            return false;
+          } else if (status === 'GENERATING') {
             this.taskDetailBtnText = '数据生成中';
             this.exportTaskDetailDisabled = true;
             return false;
@@ -527,7 +530,7 @@ export default {
             this.exportTaskDetailDisabled = false;
             return true;
           } else if (status === 'ERROR') {
-            this.taskDetailErrorMsg = res.data.data.errorMsg || '生成失败,请联系管理员!';
+            this.taskDetailErrorMsg = res.data.data.errorMsg || '导出失败';
             this.exportTaskDetailDisabled = true;
             return true;
           } else {
@@ -563,7 +566,11 @@ export default {
         if (res.data.code === 0) {
           this.pkgDetailShow = true;
           const status = res.data.data.status;
-          if (status === 'GENERATING') {
+          if (status === 'NOT_GENERATE') {
+            this.pkgBtnText = '暂无数据';
+            this.exportPkgDisabled = true;
+            return false;
+          } else if (status === 'GENERATING') {
             this.pkgBtnText = '数据生成中';
             this.exportPkgDisabled = true;
             return false;
@@ -573,7 +580,7 @@ export default {
             this.exportPkgDisabled = false;
             return true;
           } else if (status === 'ERROR') {
-            this.pkgBtnErrorMsg = res.data.data.errorMsg || '生成失败,请联系管理员!';
+            this.pkgBtnErrorMsg = res.data.data.errorMsg || '生成失败';
             this.exportPkgDisabled = true;
             return true;
           } else {
@@ -694,4 +701,19 @@ export default {
     color: red !important;
   }
 }
+
+.down-btn {
+  background-color: #fff !important;
+  &:hover {
+    color: #6eb657 !important;
+  }
+}
+
+::v-deep .el-button--info {
+  background-color: #fff !important;
+
+  &:hover {
+    color: #bcbec2 !important;
+  }
+}
 </style>

+ 32 - 6
src/views/servicePackageMonitoring/riskEventAudit/index.vue

@@ -44,9 +44,16 @@
                 <el-button size="small" class="error-message" disabled>生成失败<i class="el-icon-warning-outline el-icon--right"></i></el-button>
               </el-tooltip>
             </template>
-            <el-button :type="exportDetailDisabled ? '' : 'primary'" v-if="exportDetailShow" :disabled="exportDetailDisabled" size="small" @click="downInfo">{{
-              exportBtnText
-            }}</el-button>
+            <el-button
+              class="down-btn"
+              plain
+              :type="exportDetailDisabled ? 'info' : 'primary'"
+              v-if="exportDetailShow"
+              :disabled="exportDetailDisabled"
+              size="small"
+              @click="downInfo"
+              >{{ exportBtnText }}</el-button
+            >
 
             <el-button type="primary" size="small" @click="exportTask">监督任务数据导出</el-button>
           </div>
@@ -137,9 +144,9 @@ export default {
         startDate: ''
       },
       exportDetailShow: false,
-      exportDetailDisabled: false,
+      exportDetailDisabled: true,
       exportDetailErrorMsg: '',
-      exportBtnText: '',
+      exportBtnText: '暂无数据',
       tableLoading: false,
       tableOption: tableOption,
       page: {
@@ -442,7 +449,11 @@ export default {
           this.exportDetailShow = true;
           const status = res.data.data.status;
           this.exportDetailErrorMsg = '';
-          if (status === 'GENERATING') {
+          if (status === 'NOT_GENERATE') {
+            this.exportBtnText = '暂无数据';
+            this.exportDetailDisabled = true;
+            return false;
+          } else if (status === 'GENERATING') {
             this.exportBtnText = '数据生成中';
             this.exportDetailDisabled = true;
             return false;
@@ -575,4 +586,19 @@ export default {
     color: red !important;
   }
 }
+
+.down-btn {
+  background-color: #fff !important;
+  &:hover {
+    color: #6eb657 !important;
+  }
+}
+
+::v-deep .el-button--info {
+  background-color: #fff !important;
+
+  &:hover {
+    color: #bcbec2 !important;
+  }
+}
 </style>

+ 6 - 6
src/views/servicePackageMonitoring/riskEventAudit/taskMonitor.vue

@@ -10,6 +10,12 @@
       <div class="search-content">
         <el-form :model="form" label-width="100px" ref="formRef">
           <el-row>
+            <el-col :span="6">
+              <el-form-item label="提交时间">
+                <!-- <ElQuarterPicker placeholder="请选择" v-model="monthrange" @change="monthrangeChange" class="w100" /> -->
+                <p>{{ currText }}</p>
+              </el-form-item>
+            </el-col>
             <el-col :span="6">
               <el-form-item label="任务ID" prop="taskId">
                 <el-input v-model="form.taskId" placeholder="执行任务" clearable></el-input>
@@ -27,12 +33,6 @@
                 </el-select>
               </el-form-item>
             </el-col>
-            <el-col :span="6">
-              <el-form-item label="提交时间">
-                <!-- <ElQuarterPicker placeholder="请选择" v-model="monthrange" @change="monthrangeChange" class="w100" /> -->
-                <p>{{ currText }}</p>
-              </el-form-item>
-            </el-col>
           </el-row>
           <el-row>
             <el-col :span="6">