Просмотр исходного кода

feat: 性能验证添加空白页展示

johnsen 9 месяцев назад
Родитель
Сommit
4c0fed5777
1 измененных файлов с 21 добавлено и 12 удалено
  1. 21 12
      src/views/business/performance/index.vue

+ 21 - 12
src/views/business/performance/index.vue

@@ -4,7 +4,7 @@
     <!-- <div class="page-toolbar">
             <el-button type="primary">配置 <i class="ibps-icon-cogs" /></el-button>
         </div> -->
-    <div class="page-container">
+    <div class="page-container" v-if="performanceList.length > 0">
       <el-card
         v-for="(item, index) in performanceList"
         :key="index"
@@ -32,6 +32,7 @@
         </div>
       </el-card>
     </div>
+    <el-empty class="empty" v-else :image-size="200"></el-empty>
     <config
       v-if="showConfig"
       :visible.sync="showConfig"
@@ -80,18 +81,20 @@ export default {
       const dataList = []
       getConfigList(params).then((res) => {
         const { dataResult = [] } = res.data || {}
-        dataResult.forEach((item) => {
-          const config = item.config ? JSON.parse(item.config) : []
-          dataList.push({
-            id: item.id,
-            sn: item.sn,
-            target: item.target,
-            targetKey: item.targetKey,
-            icon: item.icon,
-            methods: config.sort((a, b) => a.sn - b.sn)
+        if (dataResult.length > 0) {
+          dataResult.forEach((item) => {
+            const config = item.config ? JSON.parse(item.config) : []
+            dataList.push({
+              id: item.id,
+              sn: item.sn,
+              target: item.target,
+              targetKey: item.targetKey,
+              icon: item.icon,
+              methods: config.sort((a, b) => a.sn - b.sn)
+            })
           })
-        })
-        this.performanceList = dataList.sort((a, b) => a.sn - b.sn)
+          this.performanceList = dataList.sort((a, b) => a.sn - b.sn)
+        }
       })
     },
     handleConfig(id) {
@@ -113,7 +116,13 @@ export default {
 }
 </script>
 <style lang="scss" scoped>
+.empty {
+  flex: 1;
+}
 .performance-config {
+  height: 100%;
+  display: flex;
+  flex-direction: column;
   .page-title {
     font-size: 18px;
     font-weight: bold;