lizhuang 5 years ago
parent
commit
daa031f134

+ 1 - 1
src/api/doBusiness/business.js

@@ -4,5 +4,5 @@ export function queryHours({postParams}) {
     return httputils.postJson(`/duoduo-service/transfer/chiller/business/hours/query?projectId=${store.state.projectId}`, postParams)
 }
 export function updateHours({postParams}) {
-    return httputils.postJson(`/duoduo-service/transfer/chiller/business/hours/update?projectId=${store.state.projectId}`, postParams)
+    return httputils.postJson(`/duoduo-service/transfer/chiller/business/hours/save?projectId=${store.state.projectId}`, postParams)
 }

+ 1 - 1
src/views/audit/index.vue

@@ -367,7 +367,7 @@ export default {
           }
           .cont2 {
             margin-bottom: 24px;
-            height: 180px;
+            
           }
           .cont3 {
             margin-bottom: 24px;

+ 1 - 1
src/views/doBusiness/index.vue

@@ -9,7 +9,7 @@
       <template slot="dateCell" slot-scope="{date, data}">
         <div class="time-duration" v-for="(item,index) in content" :key="index">
           <el-time-picker
-            v-if="date.getFullYear()+''+(Number(date.getMonth()+1)>10?Number(date.getMonth()+1):'0'+(Number(date.getMonth()+1)))+''+(date.getDate()>10?date.getDate():'0'+date.getDate())==item.date"
+            v-if="date.getFullYear()+''+(parseInt(date.getMonth()+1)>10?parseInt(date.getMonth()+1):'0'+(parseInt(date.getMonth()+1)))+''+(date.getDate()>10?date.getDate():'0'+date.getDate())==item.date"
             is-range
             v-model="item.timeRange"
             size="mini"

+ 4 - 3
src/views/evaluate/evTwoLevelMenu.vue

@@ -27,10 +27,10 @@
               <el-switch v-model="value2"></el-switch>
             </div>
             <div class="count-bottom-content">
-              <ev-two-table v-if="dataList.length>=0" :switch="value2" :dataList="dataList"></ev-two-table>
+              <ev-two-table v-if="dataList.length>0" :switch="value2" :dataList="dataList"></ev-two-table>
             </div>
             <div class="count-bottom-foot">
-              <ev-stacked-line></ev-stacked-line>
+              <ev-stacked-line v-if="stackArr.length>0" :stackArr='stackArr'></ev-stacked-line>
             </div>
           </div>
           <div v-show="num == 2">
@@ -97,7 +97,8 @@ export default {
       tindoorFillRate: "", //室内温度满足率@
       energySavingRate: "", //节能率
       cardList: [], //执行率@
-      dateVal: "" //@
+      dateVal: "", //@
+      stackArr:[]
     };
   },
   components: {

+ 34 - 16
src/views/evaluate/evTwoTable.vue

@@ -1,14 +1,16 @@
 <template>
   <el-table
+    ref="multipleTable"
     class="expandTable"
     :data="dataList"
     style="width: 100%;z-index:1"
     :row-key="getRowKeys"
-     :expand-row-keys="expands"
+    :expand-row-keys="expands"
+    @selection-change="handleSelectionChange"
   >
     <el-table-column type="expand">
       <template slot-scope="props">
-        <el-table :data="props.row.children" style="width: 100%;">
+        <el-table :ref="`table${props.row.id}`" :data="props.row.children" style="width: 100%;">
           <el-table-column type="selection" width="50" align="right"></el-table-column>
           <el-table-column prop label align="right" width="150">
             <template slot-scope="{row}">
@@ -49,28 +51,44 @@
 export default {
   data() {
     return {
-      getRowKeys(row) {
-        return row.id;
-      },  
+      selected: [],
+      expands: []
     };
   },
   props: ["dataList"],
   computed: {
-    expands() {
-      return this.dataList.map(i => {
-          // 增加 isExpand 属性
-          i.isExpand = i.children.some(c => c.isSatisfy == false)
-          return i
-        }).filter(j => j.isExpand).map(i => i.id)
-    }
   },
-  methods: {
-   
+  watch: {
+    dataList(newVal, oldVal) {
+      if(newVal) {
+        this.$nextTick(() => this.doSelect())
+      }
+    }
   },
   mounted() {
-    
+    this.initExpand()
+  },
+  methods: {
+    initExpand() {
+      this.dataList.forEach(i => {
+        if(i.children.some(c => c.isSatisfy == false)) this.expands.push(i.id)
+      })
+    },
+    doSelect() {
+      this.dataList.forEach(i => {
+        i.children.forEach(row => {
+          this.$refs[`table${i.id}`].toggleRowSelection(row)
+        })
+      })
+    },
+    handleSelectionChange(val) {
+      this.selected = val
+    },
+    getRowKeys(row) {
+      return row.id;
+    },
   }
-};
+}
 </script>
 <style lang="scss" scoped>
 .expandTable {