Browse Source

数字环保 数据中心

wangzhe 2 years ago
parent
commit
770837e246
1 changed files with 10 additions and 7 deletions
  1. 10 7
      src/views/datacenter.vue

+ 10 - 7
src/views/datacenter.vue

@@ -14,11 +14,14 @@
               <div class="d-l-con-icon">
                 <div class="icon-con" :class="{on:iconCurrentIndex==item.resourceTable}"
                      v-for="(item,index) in resourcesList"
-                     v-on:click="indentleftSetMarkers(item.resourceTable)">
+                     v-on:click="indentleftSetMarkers(item.type)">
+                     <!--v-on:click="indentleftSetMarkers(item.resourceTable)">-->
                   <div class="iconfont icon icon-normal" :class="item.icon"></div>
                   <div class="icon-text">
-                    <h6>{{ item.count }}</h6>
-                    <h5>{{ item.resourceName }}</h5>
+                    <h6>{{ item.num }}</h6>
+                    <!--<h6>{{ item.count }}</h6>-->
+                    <h5>{{ item.name }}</h5>
+                    <!--<h5>{{ item.resourceName }}</h5>-->
                   </div>
                 </div>
               </div>
@@ -273,13 +276,13 @@ export default {
       //获取左侧菜单列表
       getResource().then(res => {
         that.resourcesList = res.data
+        console.log("that.resourcesList=", that.resourcesList)
         //截取data.resourceTable字段中“_”分隔符最后一个作为关键字,重新拼接成前端需要的图标:class,格式sj-icon-xxxx,将其set回原数组
         res.data.forEach(function(data, index) {
-          that.$set(that.resourcesList[index], 'icon', 'sj' + '-' + 'icon' + '-' + data
-            .resourceTable.split('_').slice(-1))
+          // that.$set(that.resourcesList[index], 'icon', 'sj' + '-' + 'icon' + '-' + data.resourceTable.split('_').slice(-1))
+          console.log("data.type.split('_').slice(-1)", data.type.split('_').slice(-1));
+          that.$set(that.resourcesList[index], 'icon', 'sj' + '-' + 'icon' + '-' + data.type.replaceAll("_", "-"));
         })
-        console.log(that.resourcesList)
-
       })
     },
     indentleftSetMarkers(resourceTable) {