zhaobao 2 жил өмнө
parent
commit
ab69e204d4

+ 2 - 4
src/views/goaf/checkTask/plan/components/CheckDef.vue

@@ -150,7 +150,7 @@ export default {
         'defEndDate': '',
         'checkCount': 0,
         'checkCycleUnit': 0,
-        'jobId': undefined,
+        'jobId': ' ',
         'checkDesc': '',
         'status': 0
       },
@@ -260,12 +260,10 @@ export default {
 
     // 编辑窗口
     showEditModel(data) {
-      this.resetFormData()
       this.title = '编辑任务计划'
       this.actionType = ACTION_UPDATE
       this.dialogVisible = true
       this.formData = data
-      console.log(data)
       this.formData.accountId = parseFloat(data.accountId)
     },
 
@@ -288,7 +286,7 @@ export default {
         'defEndDate': '',
         'checkCount': 0,
         'checkCycleUnit': 0,
-        'jobId': undefined,
+        'jobId': ' ',
         'checkDesc': '',
         'status': 0
       }

+ 16 - 10
src/views/goaf/checkTask/plan/components/CheckDefList.vue

@@ -23,10 +23,9 @@
             <span>{{ row.checkTitle }}</span>
           </template>
         </el-table-column>
-
-        <el-table-column prop="timeSpan" label="频率" header-align="center" align="center" width="120">
+        <el-table-column prop="timeSpan" label="检查频率" header-align="center" align="center" width="120">
           <template v-slot="{row}">
-            <span style="color: #20f704">{{ row.cycleTitle }}</span>
+            <span style="color: #20f704">{{ row.checkCount }}次/{{ row.checkCycleUnit|checkCycleUnit }}</span>
           </template>
         </el-table-column>
 
@@ -101,7 +100,11 @@ export default {
     Pagination,
     CheckDef
   },
-
+  filters: {
+    checkCycleUnit(val) {
+      return ['非周期', '每日', '每周', '每月', '每年'][val]
+    }
+  },
   data() {
     return {
       dataList: [],
@@ -110,7 +113,8 @@ export default {
       conditions: {
         page: 1,
         limit: 10,
-        checkTitle: ''
+        checkTitle: '',
+        goafName: ''
       }
     }
   },
@@ -118,6 +122,10 @@ export default {
     this.getData()
   },
   methods: {
+    loadData({ goafName }) {
+      this.conditions.goafName = goafName
+      this.getData()
+    },
     // Get Data From Server
     getData() {
       this.listLoading = true
@@ -143,13 +151,13 @@ export default {
 
     // 删除
     handleDelete(data) {
-      const { riskPointId, checkTitle, checkDefId } = data
-      this.$confirm(`此操作将删除该数据${checkTitle}, 是否继续?`, '提示', {
+      const { checkTitle, checkDefId } = data
+      this.$confirm(`此操作将删除该数据${checkTitle}, 是否继续?`, '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        deleteCheckDefById(riskPointId, checkDefId).then((resp) => {
+        deleteCheckDefById(checkDefId).then((resp) => {
           const { code, msg } = resp
           if (code === 0) {
             this.getData()
@@ -175,8 +183,6 @@ export default {
         } else {
           this.$message.error(msg)
         }
-      }).catch((error) => {
-        console.log(error)
       })
     }
   }

+ 213 - 0
src/views/goaf/checkTask/plan/components/GoafList.vue

@@ -0,0 +1,213 @@
+<template>
+  <div class="content-container">
+    <div class="list-group">
+      <el-row class="title-bar">
+        <p class="page-title"><i class="el-icon-place" /> 采空区</p>
+      </el-row>
+      <vuescroll :ops="ops" style="height: calc(100% - 40px);">
+        <el-tree
+          ref="RiskPointTree"
+          node-key="riskPointId"
+          :data="treeData"
+          :expand-on-click-node="false"
+          :default-expand-all="true"
+          :props="defaultProps"
+          :highlight-current="true"
+          :default-expanded-keys="expandDefault"
+          @node-click="handleNodeClick"
+        />
+      </vuescroll>
+    </div>
+  </div>
+</template>
+<script>
+
+import Vuescroll from 'vuescroll'
+import { getGoafBaseInfo } from '@/api/goaf/info'
+export default {
+  components: {
+    Vuescroll
+  },
+  data() {
+    return {
+      ops: {
+        bar: {
+          keepShow: false,
+          background: 'rgba(144, 147, 153, 0.4)',
+          onlyShowBarOnScroll: false
+        }
+      },
+      treeData: [],
+      defaultProps: {
+        children: 'children',
+        label: 'goafName'
+      },
+      expandDefault: [],
+      checkDefault: []
+    }
+  },
+  watch: {
+    checkDefault(val) {
+      this.$nextTick(() => {
+        document.querySelector('.el-tree-node__content').click()
+      })
+    }
+  },
+  mounted() {
+    this.getData()
+  },
+  methods: {
+    getData() {
+      getGoafBaseInfo().then((resp) => {
+        const { code, data } = resp
+        if (code === 0) {
+          this.treeData = data
+          if (data.length > 0) {
+            const node = data[0]
+            this.handleTreeInit(node)
+            this.checkDefault.push(node.riskPointId)
+          }
+        }
+      })
+    },
+    clickItem(event, data) {
+      this.$contextmenu({
+        items: [
+        ],
+        event,
+        customClass: 'class-a',
+        zIndex: 3,
+        minWidth: 230
+      })
+      return false
+    },
+
+    handleNodeClick(data) {
+      this.$emit('nodeClick', data)
+    },
+    handleTreeInit(data) {
+      this.$emit('treeInit', data)
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+
+.content-container {
+  margin: 10px;
+
+  .title-bar {
+    position: relative;
+    height: 40px;
+    line-height: 40px;
+    background: #113849;
+    margin-bottom: 10px;
+
+    .page-title {
+      font-size: 18px;
+      color: #FFF;
+      margin: 0;
+      font-weight: bold;
+    }
+
+    .right-icon {
+      position: absolute;
+      right: 15px;
+      top: 14px;
+      color: #5181A2;
+      width: 14px;
+      height: 14px;
+      line-height: 14px;
+      cursor: pointer;
+
+      .icon {
+        position: absolute;
+        right: 0px;
+        top: 0px;
+        font-size: 14px;
+        font-weight: bolder;
+      }
+    }
+  }
+
+  .btn-group {
+    width: 100%;
+    margin-bottom: 15px;
+
+    .send-menu {
+      width: 100%;
+      background: #3D5F76;
+      color: #FFF;
+      border-color: #3D5F76;
+
+      &:hover {
+        background: #283c4c;
+        color: #FFF;
+        border-color: #283c4c;
+      }
+    }
+  }
+
+  .list-group {
+    height: calc(100vh - 105px);
+    background: #193142;
+
+    .list-item {
+      height: 40px;
+      line-height: 40px;
+      color: #FFF;
+      padding: 0 30px;
+      font-size: 14px;
+
+      &.active {
+        color: #08A6DC;
+        position: relative;
+
+        &::after {
+          position: absolute;
+          content: "";
+          width: 0;
+          height: 0;
+          top: calc(50% - 3.5px);
+          right: -3px;
+          border-left: 7px solid transparent;
+          border-right: 7px solid transparent;
+          border-bottom: 7px solid #08A6DC;
+          transform: rotate(270deg);
+        }
+      }
+    }
+  }
+
+  .custom-tree-node {
+    position: relative;
+    width: 100%;
+
+    .right-icon {
+      position: absolute;
+      right: 10px;
+      top: 14px;
+      background: #5181A2;
+      color: #FFFFFF;
+      width: 14px;
+      height: 14px;
+      border: 1px solid #3D6F91;
+      line-height: 14px;
+      font-size: 10px;
+      display: none;
+      cursor: pointer;
+
+      .icon {
+        position: relative;
+        top: -2px;
+      }
+    }
+
+    &:hover {
+      .right-icon {
+        display: block;
+      }
+    }
+  }
+}
+</style>

+ 18 - 5
src/views/goaf/checkTask/plan/index.vue

@@ -1,20 +1,33 @@
 <template>
-  <div class="check-def-list-container">
-    <check-def-list ref="CheckDefList" />
+  <div class="page-container">
+    <el-row class="counter-wrap">
+      <el-col :span="4" class="left-counter-wrap">
+        <goaf-list @nodeClick="goafSelChange" @treeInit="goafSelChange" />
+      </el-col>
+      <el-col :span="20" class="right-counter-wrap">
+        <check-def-list ref="CheckDefList" />
+      </el-col>
+    </el-row>
   </div>
 </template>
 
 <script>
+import GoafList from './components/GoafList'
 import CheckDefList from './components/CheckDefList'
 export default {
   name: 'CheckDefIndex',
   components: {
+    GoafList,
     CheckDefList
+  },
+  methods: {
+    goafSelChange(data) {
+      this.$refs['CheckDefList'].loadData(data)
+    }
   }
 }
 </script>
 <style lang="scss">
-.check-def-list-container{
-  margin-left: 10px;
-}
+</style>
+<style lang="scss" scoped>
 </style>

+ 0 - 12
src/views/goaf/checklist/index.vue

@@ -80,18 +80,6 @@ export default {
   methods: {
     // fetch data
     getData() {
-      const items = []
-      for (let i = 0; i < 10; i++) {
-        items.push({
-          'checklistId': i + 1,
-          'ocId': 341,
-          'checklistTitle': '3gata5',
-          'checklistDesc': 'g3868q',
-          'checklistItemId': 784,
-          'checklistItemContent': 'mrxs6p'
-        })
-      }
-      this.dataList = items
       getChecklistByPage(this.conditions).then((resp) => {
         const { code, msg, data, total } = resp
         if (code === 0) {