guoxiaohuan 5 rokov pred
rodič
commit
26c5d76790
1 zmenil súbory, kde vykonal 139 pridanie a 136 odobranie
  1. 139 136
      src/components/todayStrategy.vue

+ 139 - 136
src/components/todayStrategy.vue

@@ -1,156 +1,159 @@
 <template>
-  <div class="remarks">
-    <el-table :data="data" border style="width: 100%;height:400px;">
-      <el-table-column type="index" width="80" label="序号"></el-table-column>
-      <el-table-column prop="pushTime" label="策略推送时间">
-        <template
-          slot-scope="{row}"
-        >{{row.pushTime?timestamp2String(row.pushTime).slice(8,10)+":"+timestamp2String(row.pushTime).slice(10,12) : '--'}}</template>
-      </el-table-column>
-      <el-table-column prop="executeTime" label="策略执行时间">
-        <template
-          slot-scope="{row}"
-        >{{row.executeTime?row.executeTime.slice(8,10)+":"+row.executeTime.slice(10,12):"--"}}</template>
-      </el-table-column>
-      <el-table-column prop label="冷水机组开启台数" align="center">
-        <template slot-scope="{row}">{{row.chillerNumSetL+row.chillerNumSetS}}</template>
-      </el-table-column>
-      <el-table-column prop="chillWaterOutTempSet" label="出水温度设定值"></el-table-column>
-      <el-table-column prop label="冷冻泵开启台数" align="center">
-        <template slot-scope="{row}">{{row.coolPumpNumSetL+'大'+row.coolPumpNumSetS+'小'}}</template>
-      </el-table-column>
-      <el-table-column prop label="冷却泵开启台数" min-width="120" align="center">
-        <template slot-scope="{row}">{{row.chillPumpNumSetL+row.chillPumpNumSetS}}</template>
-      </el-table-column>
-      <el-table-column prop label="冷却塔开启组数" min-width="120" align="center">
-        <template slot-scope="{row}">{{row.coolTowerNumSetL+row.coolTowerNumSetS}}</template>
-      </el-table-column>
-      <el-table-column prop="zip" label="通风策略"></el-table-column>
-      <el-table-column label="执行情况">
-        <template slot-scope="{row}">{{row.isExecuted==0?'未执行':'已执行'}}</template>
-      </el-table-column>
-      <el-table-column label="操作" width="100">
-        <template slot-scope="scope">
-          <el-button @click="handleClick(scope.row)" type="text" size="small">备注</el-button>
-          <el-button
-            @click="dumpAduit(scope.row)"
-            v-if="isShow(scope.row)"
-            type="text"
-            size="small"
-          >申诉</el-button>
-        </template>
-      </el-table-column>
-    </el-table>
+    <div class='remarks'>
+        <el-table :data='data' border style='width: 100%;height:400px;'>
+            <el-table-column type='index' width='50' label='序号'></el-table-column>
+            <el-table-column prop='pushTime' label='策略推送时间' width='105'>
+                <template
+                    slot-scope='{row}'
+                >{{row.pushTime?timestamp2String(row.pushTime).slice(8,10)+":"+timestamp2String(row.pushTime).slice(10,12) : '--'}}</template>
+            </el-table-column>
+            <el-table-column prop='executeTime' label='策略执行时间' width='105'>
+                <template slot-scope='{row}'>{{row.executeTime?row.executeTime.slice(8,10)+":"+row.executeTime.slice(10,12):"--"}}</template>
+            </el-table-column>
+            <el-table-column prop label='冷水机组开启台数' min-width='85'>
+                <template slot-scope='{row}'>{{shutDown(row.chillerNumSetL,true,null)+shutDown(row.chillerNumSetS,true,null)}}</template>
+            </el-table-column>
+            <el-table-column prop='chillWaterOutTempSet' label='出水温度设定值' min-width='75'>
+                <template slot-scope='{row}'>{{shutDown(row.chillWaterOutTempSet,false,1)}}</template>
+            </el-table-column>
+            <el-table-column prop label='冷冻泵开启台数' min-width='75'>
+                <template slot-scope='{row}'>{{shutDown(row.coolPumpNumSetL,true,null)+shutDown(row.coolPumpNumSetS,true,null)}}</template>
+            </el-table-column>
+            <el-table-column prop label='冷却泵开启台数' min-width='75'>
+                <template slot-scope='{row}'>{{shutDown(row.chillPumpNumSetL,true,null)+shutDown(row.chillPumpNumSetS,true,null)}}</template>
+            </el-table-column>
+            <el-table-column prop label='冷却塔开启组数' min-width='75'>
+                <template slot-scope='{row}'>{{shutDown(row.coolTowerNumSetL,true,null)+shutDown(row.coolTowerNumSetS,true,null)}}</template>
+            </el-table-column>
+            <el-table-column prop='zip' label='通风策略' width='80'>
+                <template slot-scope='{row}'>无</template>
+            </el-table-column>
+            <el-table-column label='执行情况' width='80'>
+                <template slot-scope='{row}'>
+                    <div v-if='row.isExecuted==0' style='display: flex;align-items: center;'>
+                        <span style='display: inline-block;width:6px;height:6px;background:#F54E45;border-radius: 3px;margin-right: 5px;'></span>
+                        <span>未执行</span>
+                    </div>
+                    <div v-else style='display: flex;align-items: center;'>
+                        <span style='display: inline-block;width:6px;height:6px;background:#34C724;border-radius: 3px;margin-right: 5px;'></span>
+                        <span>已执行</span>
+                    </div>
+                </template>
+            </el-table-column>
+            <el-table-column label='操作' width='90'>
+                <template slot-scope='scope'>
+                    <el-button @click='handleClick(scope.row)' type='text' size='small'>备注</el-button>
+                    <el-button @click='dumpAduit(scope.row)' v-if='isShow(scope.row)' type='text' size='small'>申诉</el-button>
+                </template>
+            </el-table-column>
+        </el-table>
 
-    <el-dialog title="备注" :visible.sync="dialogVisible" width="30%">
-      <el-input
-        type="textarea"
-        :autosize="{ minRows: 2, maxRows: 4}"
-        placeholder="请填写备注内容"
-        v-model="remarks"
-      ></el-input>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="dialogVisible = false">关闭</el-button>
-        <el-button type="primary" @click="saveCommand">保存</el-button>
-      </span>
-    </el-dialog>
-  </div>
+        <el-dialog title='备注' :visible.sync='dialogVisible' width='30%'>
+            <el-input type='textarea' :autosize='{ minRows: 2, maxRows: 4}' placeholder='请填写备注内容' v-model='remarks'></el-input>
+            <span slot='footer' class='dialog-footer'>
+                <el-button @click='dialogVisible = false'>关闭</el-button>
+                <el-button type='primary' @click='saveCommand'>保存</el-button>
+            </span>
+        </el-dialog>
+    </div>
 </template>
 
 <script>
-import { updateCommand } from "@/api/strategy/strategy.js";
-import { timestamp2String } from "@/utils/helper.js";
-import { queryWorkflow } from "@/api/appeal/appeal.js";
+import { updateCommand } from '@/api/strategy/strategy.js'
+import { timestamp2String } from '@/utils/helper.js'
+import { queryWorkflow } from '@/api/appeal/appeal.js'
+import { shutDown } from '@/utils/query.js'
 
 export default {
-  data() {
-    return {
-      timestamp2String,
-      dialogVisible: false,
-      remarks: "",
-      row: "",
-      newData: []
-    };
-  },
-  props: ["data", "idArr"],
-  methods: {
-    isShow(data) {
-      let isShow = false
-      if (this.newData.length) {
-        this.newData.forEach(el => {
-          if (data.appealId == el.id) {
-            if(el.status == 301 || el.status == 305){
-              isShow = true
-            }
-          }
-        });
-      }
-      return isShow
-    },
-    appealsIng(id) {
-      let params = {
-        postParams: {
-          criteria: {
-            id: id
-          },
-          withColumns: ["customAttribute"]
+    data() {
+        return {
+            timestamp2String,
+            dialogVisible: false,
+            remarks: '',
+            row: '',
+            newData: [],
+            shutDown: shutDown
         }
-      };
-      queryWorkflow(params).then(res => {
-        this.newData = res.content ? res.content : [];
-        console.log(res);
-        // let arr = [];
-        // arr = res.content ? res.content : [];
-        // if (arr.length > 0) {
-        //   arr.forEach(item => {
-        //     arr.push(item.commandId);
-        //     this.newArr.push(item);
-        //   });
-        //   this.queryExecute(arr);
-        // }
-      });
-    },
-    handleClick(row) {
-      this.row = row;
-      this.dialogVisible = true;
     },
-    saveCommand(row) {
-      this.dialogVisible = false;
-      let postParams = {
-        id: this.row.id,
-        remarks: this.remarks
-      };
-      updateCommand({ postParams }).then(res => {
-        if (res.result == "success") {
-          this.$message.success("添加备注成功!");
+    props: ['data', 'idArr'],
+    methods: {
+        isShow(data) {
+            let isShow = false
+            if (this.newData.length) {
+                this.newData.forEach(el => {
+                    if (data.appealId == el.id) {
+                        if (el.status == 301 || el.status == 305) {
+                            isShow = true
+                        }
+                    }
+                })
+            }
+            return isShow
+        },
+        appealsIng(id) {
+            let params = {
+                postParams: {
+                    criteria: {
+                        id: id
+                    },
+                    withColumns: ['customAttribute']
+                }
+            }
+            queryWorkflow(params).then(res => {
+                this.newData = res.content ? res.content : []
+                console.log(res)
+                // let arr = [];
+                // arr = res.content ? res.content : [];
+                // if (arr.length > 0) {
+                //   arr.forEach(item => {
+                //     arr.push(item.commandId);
+                //     this.newArr.push(item);
+                //   });
+                //   this.queryExecute(arr);
+                // }
+            })
+        },
+        handleClick(row) {
+            this.row = row
+            this.dialogVisible = true
+        },
+        saveCommand(row) {
+            this.dialogVisible = false
+            let postParams = {
+                id: this.row.id,
+                remarks: this.remarks
+            }
+            updateCommand({ postParams }).then(res => {
+                if (res.result == 'success') {
+                    this.$message.success('添加备注成功!')
+                }
+            })
+        },
+        dumpAduit(row) {
+            console.log(row)
+            this.$router.push({
+                path: '/appeal/appealDetails',
+                query: { item: JSON.stringify(row) }
+            })
         }
-      });
     },
-    dumpAduit(row) {
-      console.log(row);
-      this.$router.push({
-        path: "/appeal/appealDetails",
-        query: { item: JSON.stringify(row) }
-      });
-    }
-  },
-  mounted() {
-    if (this.data && this.idArr) {
-      this.appealsIng(this.idArr);
+    mounted() {
+        if (this.data && this.idArr) {
+            this.appealsIng(this.idArr)
+        }
     }
-  }
-};
+}
 </script>
 
 <style lang='scss' >
 .remarks {
-  .el-dialog {
-    margin-top: 30vh !important;
-    z-index: 999999 !important;
-  }
+    .el-dialog {
+        margin-top: 30vh !important;
+        z-index: 999999 !important;
+    }
 }
 .v-modal {
-  z-index: 1 !important;
-  background: #fff !important;
+    z-index: 1 !important;
+    background: #fff !important;
 }
 </style>