zhaobao 2 anos atrás
pai
commit
14c347db59
30 arquivos alterados com 3238 adições e 811 exclusões
  1. 7 1
      src/api/goaf/check.js
  2. 37 6
      src/router/modules/aqpt.js
  3. 2 2
      src/styles/common.scss
  4. 389 0
      src/views/goaf/alert/accept.vue
  5. 270 0
      src/views/goaf/alert/activity/Accept.vue
  6. 0 211
      src/views/goaf/alert/activity/Handle.vue
  7. 298 0
      src/views/goaf/alert/activity/Rectify.vue
  8. 272 0
      src/views/goaf/alert/activity/Review.vue
  9. 211 180
      src/views/goaf/alert/activity/Submit.vue
  10. 210 0
      src/views/goaf/alert/checkList.vue
  11. 212 0
      src/views/goaf/alert/checkList_warning.vue
  12. 171 0
      src/views/goaf/alert/components/DangerInfo.vue
  13. 23 7
      src/views/goaf/alert/components/DangerList.vue
  14. 124 157
      src/views/goaf/alert/components/Details.vue
  15. 95 70
      src/views/goaf/alert/components/LeftCounter.vue
  16. 350 85
      src/views/goaf/alert/index.vue
  17. 389 0
      src/views/goaf/alert/rectify.vue
  18. 13 22
      src/views/goaf/checklist/components/ChecklistEdit.vue
  19. 5 7
      src/views/goaf/checklist/components/ChecklistItem.vue
  20. 1 2
      src/views/goaf/checklist/index.vue
  21. 12 1
      src/views/goaf/danger/activity/Accept.vue
  22. 10 2
      src/views/goaf/danger/activity/Rectify.vue
  23. 9 1
      src/views/goaf/danger/activity/Review.vue
  24. 10 1
      src/views/goaf/danger/activity/Submit.vue
  25. 12 11
      src/views/goaf/danger/components/DangerList.vue
  26. 1 1
      src/views/goaf/danger/components/LeftCounter.vue
  27. 48 10
      src/views/goaf/info/components/GoafInfo.vue
  28. 57 34
      src/views/goaf/map/components/VisualEditor.vue
  29. BIN
      src/views/goaf/map/components/goaf/fill.png
  30. BIN
      src/views/goaf/map/components/goaf/stone.png

+ 7 - 1
src/api/goaf/check.js

@@ -15,13 +15,19 @@ export function getChecklistByPage(params) {
     params
   })
 }
-
 // 获取指定的检查表及其内容
 export function getChecklistById(goafchecklistId) {
   return request({
     url: `/goaf/goafChecklist/${goafchecklistId}`
   })
 }
+
+// 获取指定的检查项
+export function getChecklistItemById(goafchecklistId) {
+  return request({
+    url: `/goaf/goafChecklist/checklistitem/${goafchecklistId}`
+  })
+}
 // 增加检查表及其内容
 export function createChecklist(data) {
   return request({

+ 37 - 6
src/router/modules/aqpt.js

@@ -6,7 +6,6 @@ const aqptRouter = [
     component: Layout,
     name: 'AqptPanorama',
     redirect: '/goaf/info',
-    // meta: { permit: 'aqpt_panorama' },
     groupId: [0],
     hidden: true
   },
@@ -15,19 +14,51 @@ const aqptRouter = [
     component: Layout,
     name: 'AlertCenter',
     redirect: '/goaf/alert/index',
-    meta: { permit: 'aqpt_alert_center' },
+    meta: { permit: 'aqpt_alert_center', title: '预警管理' },
     groupId: [1],
-    hidden: true,
     children: [
       {
         path: 'index',
         component: () => import('@/views/goaf/alert/index'),
-        name: 'aqpt_alert_center',
-        meta: { title: '预警中心', icon: 'icon-common_digitization', affix: true, permit: 'aqpt_alert_center' }
+        name: 'aqpt_alert_review',
+        meta: { title: '待评审', icon: 'icon-common_digitization', affix: true, permit: 'aqpt_alert_center' }
+      },
+      {
+        path: 'rectify',
+        component: () => import('@/views/goaf/alert/rectify'),
+        name: 'aqpt_alert_rectify',
+        meta: { title: '待整改', icon: 'icon-common_digitization', affix: true, permit: 'aqpt_alert_center' }
+      },
+      {
+        path: 'accept',
+        component: () => import('@/views/goaf/alert/accept'),
+        name: 'aqpt_alert_accept',
+        meta: { title: '待验收', icon: 'icon-common_digitization', affix: true, permit: 'aqpt_alert_center' }
+      }
+    ]
+  },
+  {
+    path: '/goaf/alert/checkList',
+    component: Layout,
+    name: 'AlertCheckList',
+    redirect: '/goaf/alert/checkList/index',
+    meta: { permit: 'aqpt_alert_center', title: '预警清单' },
+    groupId: [1],
+    children: [
+      {
+        path: 'index',
+        component: () => import('@/views/goaf/alert/checkList.vue'),
+        name: 'aqpt_alert_checkList_index',
+        meta: { title: '预警清单', icon: 'el-icon-document', affix: true, permit: 'aqpt_alert_center' }
+      },
+      {
+        path: 'rectify',
+        component: () => import('@/views/goaf/alert/checkList_warning.vue'),
+        name: 'aqpt_alert_checkList_rectify',
+        meta: { title: '严重预警整改清单', icon: 'el-icon-document', affix: true, permit: 'aqpt_alert_center' }
       }
     ]
   },
-
   {
     path: '/task',
     component: Layout,

+ 2 - 2
src/styles/common.scss

@@ -6,8 +6,8 @@
 // 滚动条
 /*滚动条宽度*/
 ::-webkit-scrollbar {
-  width: 4px;
-  height: 4px;
+  width: 10px;
+  height: 10px;
   background-color: #071A29;
 }
 

+ 389 - 0
src/views/goaf/alert/accept.vue

@@ -0,0 +1,389 @@
+<template>
+  <div class="content-container">
+    <el-row class="tool-bar">
+      <el-col :span="8" class="left">
+        <div class="content-title">
+          {{ title }}
+        </div>
+      </el-col>
+
+      <el-col :span="16" class="button-group">
+        <div class="select-search right">
+          <el-cascader
+            v-model="conditions.reviewGroupId"
+            :options="treeData"
+            :props="{ checkStrictly: true, emitPath: false }"
+            style="min-width: 160px"
+            filterable
+            clearable
+            placeholder="部门"
+            @change="handleChange"
+          >
+            <template slot-scope="{ node, data }">
+              <span>{{ data.label }}</span>
+              <span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
+            </template>
+          </el-cascader>
+          <el-select v-model="conditions.reviewAccountId" style="width:100px;margin:0 10px" filterable clearable placeholder="执行人">
+            <el-option v-for="item in userList" :key="item.accountId" :value="item.accountId" :label="item.accountName" />
+          </el-select>
+          <el-select v-model="conditions.hdangerLevel" style="width: 80px;" filterable placeholder="级别" clearable>
+            <el-option :value="0" label="较低" />
+            <el-option :value="1" label="一般" />
+            <el-option :value="2" label="较大" />
+            <el-option :value="3" label="重大" />
+          </el-select>
+          <el-select v-model="conditions.hdangerType" style="width: 110px;margin:0 10px" filterable placeholder="类型" clearable>
+            <el-option :value="0" label="人员巡检" />
+            <el-option :value="1" label="传感器" />
+          </el-select>
+          <div>
+            <el-select v-model="conditions.goafOrebelt" style="width: 110px;" filterable placeholder="矿带" clearable @change="changeArea(1)">
+              <el-option v-for="(item,index) in goafOrebelts" :key="index" :value="item" :label="item" />
+            </el-select>
+            <el-select v-model="conditions.goafOrebody" style="width: 110px;margin-left:10px" filterable placeholder="矿体" clearable @change="changeArea(2)">
+              <el-option v-for="(item,index) in goafOrebodys" :key="index" :value="item.goafOrebody" :label="item.goafOrebody" />
+            </el-select>
+            <el-select v-model="conditions.goafOreheight" style="width: 110px;margin:0 10px" filterable placeholder="中段" clearable @change="changeArea(3)">
+              <el-option v-for="(item,index) in goafOreheights" :key="index" :value="item.goafOreheight" :label="item.goafOreheight" />
+            </el-select>
+            <el-select v-model="conditions.goafId" style="width: 150px;" filterable placeholder="采空区编号" clearable @change="changeArea(4)">
+              <el-option v-for="item in goafNames" :key="item.goafId" :value="item.goafId" :label="item.goafName" />
+            </el-select>
+          </div>
+          <el-date-picker
+            v-model="conditions.startSubmitTime"
+            type="date"
+            placeholder="开始时间"
+            format="yyyy-MM-dd HH:mm:ss"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            clearable
+            style="width: 180px;margin:0 10px"
+          />
+          <el-date-picker
+            v-model="conditions.endSubmitTime"
+            type="date"
+            placeholder="结束时间"
+            format="yyyy-MM-dd HH:mm:ss"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            clearable
+            style="width: 180px;margin:0 10px"
+          />
+          <el-input v-model="conditions.hdangerTitle" class="search-input" placeholder="请输入内容">
+            <el-button slot="append" icon="el-icon-search" @click="getData()" />
+          </el-input>
+        </div>
+      </el-col>
+    </el-row>
+
+    <el-row class="content-body">
+      <el-table v-loading="listLoading" class="page-table" border :data="dataList" height="calc(100vh - 230px)">
+
+        <el-table-column type="index" label="序号" header-align="center" align="center" width="60" />>
+        <el-table-column prop="hdangerTitle" label="隐患名称" header-align="left" align="left">
+          <template v-slot="{row}">
+            <span>{{ row.hdangerTitle }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="hdangerLevel" label="级别" header-align="center" align="center" width="80">
+          <template v-slot="{row}">
+            <span><el-tag type="success" effect="plain" color="rgb(38 69 90)">{{ row.hdangerLevel | dangerLevelFilter }}</el-tag></span>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="status" label="状态" header-align="center" align="center" width="80">
+          <template v-slot="{row}">
+            <span><el-tag type="warning" effect="plain" color="rgb(38 69 90)">{{ row.status | dangerStatusFilter }}</el-tag></span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="curActivityTitle" label="当前关卡" header-align="center" align="center" width="80">
+          <template v-slot="{row}">
+            <span><el-tag type="danger" effect="plain" color="rgb(38 69 90)">{{ row.curActivityTitle }}</el-tag></span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="curAccountName" label="当前处理人" header-align="center" align="center" width="160">
+          <template v-slot="{row}">
+            <span><i class="el-icon-user-solid" />{{ row.curAccountName }}( {{ row.curPositionName }} )</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="dangerDeadline" label="整改期限" header-align="center" align="center" width="165">
+          <template v-slot="{row}">
+            <span><i class="el-icon-timer" />{{ row.dangerDeadline }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column label="操作" header-align="center" align="center" width="180">
+          <template v-slot="{row}">
+            <el-button v-if="row.curAccountId===userData.userId" type="primary" size="mini" @click="handleDanger(row)">处理</el-button>
+            <el-button size="mini" type="info" @click="handleDetail(row)">详情</el-button>
+            <el-button v-if="row.submitAccountId===userData.userId" size="mini" type="danger" @click="handleDelete(row)">删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <div class="pagination-container">
+        <pagination v-show="total>0" :total="total" :page.sync="conditions.page" :limit.sync="conditions.limit" @pagination="getData" />
+      </div>
+    </el-row>
+    <submit-activity ref="submit" title="登记隐患" @formSuccess="formSuccess" />
+    <review-activity ref="review" title="隐患评审" @formSuccess="formSuccess" />
+    <rectify-activity ref="rectify" title="隐患整改" @formSuccess="formSuccess" />
+    <accept-activity ref="accept" title="隐患验收" @formSuccess="formSuccess" />
+    <danger-details ref="DangerDetails" title="隐患详情" />
+  </div>
+</template>
+
+<script>
+import Pagination from '@/components/Pagination'
+
+import { getGoafBaseInfo } from '@/api/goaf/info'
+import { getGroupByList } from '@/api/system/groupApi'
+import { getUserByPage } from '@/api/system/userApi'
+import { toTree } from '@/utils/build-tree'
+
+import { deleteDangerById, getDangerByPage } from '@/api/goaf/dangerApi'
+import DangerDetails from '@/views/goaf/danger/components/Details.vue'
+import { mapGetters } from 'vuex'
+import SubmitActivity from './activity/Submit'
+import ReviewActivity from './activity/Review'
+import RectifyActivity from './activity/Rectify'
+import AcceptActivity from './activity/Accept'
+export default {
+  name: 'DangerList',
+  components: { Pagination, SubmitActivity, ReviewActivity, RectifyActivity, AcceptActivity, DangerDetails },
+  filters: {
+    dangerLevelFilter(val) {
+      const status = ['较低', '一般', '较大', '重大']
+      return status[val]
+    },
+    dangerStatusFilter(val) {
+      const status = ['待提交', '待评审', '待整改', '待验收', '完成']
+      return val === -1 ? '撤销' : status[val]
+    }
+  },
+  props: {
+    title: {
+      type: [String],
+      default: '预警中心'
+    }
+  },
+  data() {
+    return {
+      dataList: [],
+      total: 0,
+      listLoading: false,
+      conditions: {
+        page: 1,
+        limit: 10,
+        status: 3,
+        startSubmitTime: undefined,
+        endSubmitTime: undefined,
+        goafId: undefined,
+        goafOrebelt: undefined,
+        goafOrebody: undefined,
+        goafOreheight: undefined,
+        reviewGroupId: undefined,
+        reviewAccountId: undefined,
+        hdangerLevel: undefined
+      },
+      goafList: [],
+      goafOrebelts: [],
+      goafOrebodys: [],
+      goafOreheights: [],
+      goafNames: [],
+      treeData: [],
+      userList: []
+    }
+  },
+  computed: {
+    ...mapGetters([
+      'userData'
+    ])
+  },
+  created() {
+    this.getData()
+    getGoafBaseInfo().then((res) => {
+      const goafOrebelts = res.data.map(item => item.goafOrebelt)
+      this.goafOrebelts = [...new Set(goafOrebelts)]
+      this.goafList = res.data
+    })
+    getGroupByList().then((resp) => {
+      const { code, data } = resp
+      if (code === 0) {
+        const temp = toTree(
+          data,
+          {
+            value: 'value',
+            name: 'label',
+            pValue: 'parentId'
+          },
+          {
+            value: 'groupId',
+            name: 'groupName',
+            pValue: 'parentId'
+          }
+        )
+        this.treeData = temp
+      }
+    })
+    getUserByPage({
+      page: 1,
+      limit: 999999
+    }).then((resp) => {
+      const { data } = resp
+      this.userList = data
+    })
+  },
+  methods: {
+    changeArea(type) {
+      const goafs = this.deeepClone(this.goafList)
+      let goafOrebodys = this.deeepClone(this.goafOrebodys)
+      let goafOreheights = this.deeepClone(this.goafOreheights)
+      let goafNames = this.deeepClone(this.goafNames)
+      if (type === 1) {
+        goafOrebodys = goafs.filter(item => item.goafOrebelt === this.conditions.goafOrebelt)
+        this.goafOrebodys = goafOrebodys
+        this.goafOreheights = []
+        this.goafNames = []
+        this.conditions.goafOrebody = ''
+        this.conditions.goafOreheight = ''
+        this.conditions.goafName = ''
+      } else if (type === 2) {
+        goafOreheights = goafs.filter(item => (item.goafOrebody === this.conditions.goafOrebody) && (item.goafOrebelt === this.conditions.goafOrebelt))
+        this.goafOreheights = goafOreheights
+        this.goafNames = []
+        this.conditions.goafOreheight = ''
+        this.conditions.goafName = ''
+      } else if (type === 3) {
+        goafNames = goafs.filter(item => (item.goafOreheight === this.conditions.goafOreheight) && (item.goafOrebody === this.conditions.goafOrebody) && (item.goafOrebelt === this.conditions.goafOrebelt))
+        this.goafNames = goafNames
+        this.conditions.goafName = ''
+      } else {
+        for (let i = 0; i < goafNames.length; i++) {
+          if (this.conditions.goafId === goafNames[i].goafId) {
+            this.conditions.goafName = goafNames[i].goafName
+          }
+        }
+      }
+      this.$forceUpdate()
+    },
+    handleChange(groupId) {
+      getUserByPage({
+        page: 1,
+        limit: 999999,
+        groupId
+      }).then((resp) => {
+        const { data } = resp
+        this.userList = data
+      })
+    },
+    // 重置查询条件
+    resetConditions() {
+      this.conditions.keywords = ''
+      this.conditions.status = undefined
+      this.conditions.submitAccountId = undefined
+      this.conditions.handleAccountId = undefined
+      this.conditions.curAccountId = undefined
+      this.conditions.groupId = undefined
+    },
+
+    // 加载数据
+    loadData(action) {
+      this.conditions = { ...this.conditions, ...action }
+      this.getData()
+    },
+
+    // Fetch Data
+    getData() {
+      this.listLoading = true
+      for (const key in this.conditions) {
+        if (this.conditions[key] === '' || this.conditions[key] === undefined) {
+          delete this.conditions[key]
+        }
+      }
+      getDangerByPage(this.conditions).then((resp) => {
+        const { code, data, total, msg } = resp
+        this.listLoading = false
+        if (code === 0) {
+          this.total = total
+          this.dataList = data
+        } else {
+          this.$message.error(msg)
+        }
+      }).catch((error) => {
+        console.log(error)
+      })
+    },
+
+    // 流程处理
+    handleDanger(data) {
+      const { hdangerId, curActivityCode } = data
+      this.$refs[curActivityCode].showModel(hdangerId, data)
+    },
+
+    // Delete Handler
+    handleDelete(data) {
+      const { hdangerId, hdangerTitle } = data
+      this.$confirm(`此操作将删除该数据${hdangerTitle}, 是否继续?`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        deleteDangerById(hdangerId).then((resp) => {
+          const { code, msg } = resp
+          if (code === 0) {
+            this.$message.success(msg)
+            this.getData()
+          } else {
+            this.$message.error(msg)
+          }
+        }).catch((error) => {
+          console.log(error)
+        })
+      }).catch(() => {
+        this.$message({ type: 'info', message: '已取消删除' })
+      })
+    },
+
+    // Show Details
+    handleDetail(data) {
+      const { hdangerId } = data
+      this.$refs['DangerDetails'].showView(hdangerId, JSON.parse(JSON.stringify(data)))
+    },
+
+    // Update View
+    formSuccess() {
+      this.getData()
+      this.$emit('actionUpdate')
+    },
+
+    // Preview Photo
+    previewList(photos) {
+      if (Array.isArray(photos)) {
+        const list = photos.map((item) => {
+          return item
+        })
+        return list
+      }
+      return [photos]
+    },
+    deeepClone(params) {
+      return JSON.parse(JSON.stringify(params))
+    }
+  }
+}
+</script>
+  <style lang="scss" scoped>
+  .content-container {
+    margin: 10px;
+    height: calc(100vh - 95px);
+  }
+  .select-search {
+    display: flex;
+    flex-wrap: wrap;
+    justify-content: flex-end;
+  }
+  </style>
+

+ 270 - 0
src/views/goaf/alert/activity/Accept.vue

@@ -0,0 +1,270 @@
+<template>
+  <el-drawer
+    :title="title"
+    :modal-append-to-body="false"
+    :modal="false"
+    :wrapper-closable="false"
+    size="99%"
+    :visible.sync="dialogVisible"
+  >
+    <template slot="title">
+      <div class="el-drawer-title">
+        <span class="name">{{ title }}</span>
+        <el-tabs v-model="tabType">
+          <el-tab-pane label="基本信息" name="form" />
+          <el-tab-pane label="历史记录" name="history" />
+        </el-tabs>
+      </div>
+    </template>
+    <div class="content-container">
+      <el-row class="content-body">
+        <div v-show="tabType==='form'">
+          <VueScroll :ops="ops" style="height: calc(100vh - 400px)">
+            <DangerInfo :view-data="viewData" class="form" />
+            <work-flow ref="WFlow" />
+          </VueScroll>
+          <div class="btn-group">
+            <el-button type="primary" @click="submitForm('ruleForm')">提交</el-button>
+            <el-button @click="dialogVisible = false">取消</el-button>
+          </div>
+        </div>
+        <div v-show="tabType==='history'">
+          <ActivityHandleRecord ref="ActivityHandleRecord" />
+        </div>
+      </el-row>
+    </div>
+  </el-drawer>
+</template>
+
+<script>
+import VueScroll from 'vuescroll'
+import { getDangerById, updateDanger } from '@/api/goaf/dangerApi'
+import { WorkFlow, ActivityHandleRecord } from '@/components'
+import DangerInfo from '../components/DangerInfo'
+
+export default {
+  name: 'AcceptTask',
+  components: { VueScroll, DangerInfo, WorkFlow, ActivityHandleRecord },
+  props: {
+    title: {
+      type: [String],
+      default: '隐患验收'
+    }
+  },
+
+  data() {
+    return {
+      ops: {
+        bar: {
+          keepShow: false,
+          background: 'rgba(144, 147, 153, 0.4)',
+          onlyShowBarOnScroll: false
+        }
+      },
+      dialogVisible: false,
+      tabType: 'form',
+      viewData: {
+        groupId: undefined,
+        groupName: '',
+        hdangerId: undefined,
+        dangerSource: undefined,
+        dangerCode: '',
+        dangerTitle: '',
+        dangerDesc: '',
+        dangerLevel: undefined,
+        dangerCatId: undefined,
+        dangerCatTitle: '',
+        riskPointId: undefined,
+        riskPointTitle: '',
+
+        submitGroupId: undefined,
+        submitGroupName: '',
+        submitPositionId: undefined,
+        submitPositionName: '',
+        submitAccountId: undefined,
+        submitAccountName: '',
+        submitTime: '',
+        dangerDeadLine: '',
+
+        reviewGroupId: undefined,
+        reviewGroupName: '',
+        reviewPositionId: undefined,
+        reviewPositionName: '',
+        reviewAccountId: undefined,
+        reviewAccountName: '',
+        reviewTime: '',
+
+        rectifyGroupId: undefined,
+        rectifyGroupName: '',
+        rectifyPositionId: undefined,
+        rectifyPositionName: '',
+        rectifyAccountId: undefined,
+        rectifyAccountName: '',
+
+        dangerReason: '',
+        rectifyCat: 1,
+        rectifyMeasure: '',
+        rectifyRemark: '',
+        rectifyTime: '',
+
+        acceptGroupId: undefined,
+        acceptGroupName: '',
+        acceptPositionId: undefined,
+        acceptPositionName: '',
+        acceptAccountId: undefined,
+        acceptAccountName: '',
+        acceptTime: '',
+        status: 0,
+        attachList: []
+      },
+      formData: {
+        formCode: 'accept',
+        hdangerId: undefined,
+        acceptRemark: '',
+        status: 0,
+        attachList: []
+      },
+      rules: { }
+    }
+  },
+  methods: {
+    previewList(photos) {
+      if (!photos) return null
+      if (Array.isArray(photos)) {
+        return photos
+      }
+      return [photos.fileUrl]
+    },
+
+    // 显示窗口
+    showModel(hdangerId, info) {
+      this.resetFormData()
+      this.dialogVisible = true
+      getDangerById(hdangerId).then((resp) => {
+        const { code, data, msg } = resp
+        if (code === 0) {
+          this.viewData = info || data
+          this.$refs.WFlow.get(hdangerId)
+          this.$refs.ActivityHandleRecord.getData(hdangerId)
+        } else {
+          this.$message.error(msg)
+        }
+      }).catch((error) => {
+        console.log(error)
+      })
+    },
+
+    resetFormData() {
+      this.formData = {
+        formCode: 'accept',
+        hdangerId: undefined,
+        status: 0,
+        attachList: []
+      }
+    },
+
+    // 保存
+    submitForm(formName) {
+      this.$nextTick(() => {
+        this.$refs.WFlow.handle({}).then((res) => {
+          if (res === false) {
+            this.$message.error('请检查填写信息')
+            return false
+          }
+          this.handleCommand(res)
+        }).catch((error) => {
+          console.log(error)
+        })
+      })
+    },
+
+    // 处理
+    handleCommand(flow) {
+      this.formData.hdangerId = this.viewData.hdangerId
+      if (flow.curActivityCode === 'review') {
+        this.formData.status = 1
+      }
+      if (flow.curActivityCode === 'rectify') {
+        this.formData.status = 2
+      }
+      if (flow.curActivityCode === 'accept') {
+        this.formData.status = 3
+      }
+      if (flow.curActivityCode === '-') {
+        this.formData.status = 4
+      }
+      this.formData.acceptRemark = flow.data.actionRemark
+      this.formData.attachList = flow.data.attachList
+      updateDanger(this.formData).then((resp) => {
+        const { code, msg } = resp
+        if (code === 0) {
+          this.dialogVisible = false
+          this.$message.success(msg)
+          this.formSuccess()
+        } else {
+          this.$message.error(msg)
+        }
+      }).catch((error) => {
+        console.log(error)
+      })
+    },
+
+    formSuccess() {
+      this.$emit('formSuccess')
+    },
+
+    resetFormField(formName) {
+      this.$refs[formName].resetFields()
+    }
+  }
+}
+</script>
+
+<style lang="scss">
+
+</style>
+<style lang="scss" scoped>
+.hd-info-component {
+  margin: 15px;
+  position: relative;
+  height: calc(100% - 15px);
+
+  .btn-group {
+    position: absolute;
+    bottom: 0;
+    left: 0;
+    width: 100%;
+
+    .el-button {
+      width: 100%;
+      margin: 0 0 15px;
+    }
+
+    .cancel-btn {
+      background: #004F7B;
+      border-color: #004F7B;
+      color: #FFF;
+
+      &:hover {
+        background: #026197;
+        border-color: #026197;
+      }
+    }
+  }
+
+  .el-row {
+    margin-bottom: 20px;
+    margin-top: 20px;
+    text-align: center;
+
+    &:last-child {
+      margin-bottom: 0;
+    }
+
+    .el-button {
+      width: 10%;
+    }
+  }
+}
+
+</style>

+ 0 - 211
src/views/goaf/alert/activity/Handle.vue

@@ -1,211 +0,0 @@
-<template>
-  <el-drawer
-    :title="title"
-    :modal-append-to-body="false"
-    :modal="false"
-    :wrapper-closable="false"
-    size="60%"
-    :visible.sync="dialogVisible"
-  >
-    <template slot="title">
-      <div class="el-drawer-title">
-        <span class="name">{{ title }}</span>
-        <el-tabs v-model="tabType">
-          <el-tab-pane label="基本信息" name="form" />
-          <el-tab-pane label="历史记录" name="history" />
-        </el-tabs>
-      </div>
-    </template>
-    <div class="content-container">
-      <el-row class="content-body">
-        <div v-show="tabType==='form'">
-          <VueScroll :ops="ops" style="height: calc(100vh - 400px)">
-            <div class="text-block">
-              <div class="text-title">{{ viewData.alertTitle }}</div>
-              <div class="text-row">
-                <div class="text-item">
-                  <span class="text-label right">说明:</span>
-                  <span>{{ viewData.alertDesc }}</span>
-                </div>
-              </div>
-
-              <div class="text-row">
-                <div class="text-item">
-                  <span class="text-label right">状态:</span>
-                  <span>{{ viewData.status | alertStatusFilter }}</span>
-                </div>
-              </div>
-            </div>
-
-            <el-form ref="ruleForm" :model="formData" :rules="rules" label-width="130px">
-              <el-form-item label="原因分析" prop="alertReason">
-                <el-input v-model="formData.alertReason" type="textarea" :rows="10" placeholder="请填写原因分析" />
-              </el-form-item>
-              <el-form-item label="整改类型" prop="handleAct">
-                <el-select v-model="formData.handleAct" style="width: 100%" filterable placeholder="选择整改类型">
-                  <el-option label="自行整改" :value="1" />
-                  <el-option label="外协整改" :value="2" />
-                </el-select>
-              </el-form-item>
-            </el-form>
-            <work-flow ref="WFlow" />
-          </VueScroll>
-
-          <div class="btn-group">
-            <el-button type="primary" @click="submitForm('ruleForm')">提交</el-button>
-            <el-button @click="dialogVisible = false">取消</el-button>
-          </div>
-        </div>
-
-        <div v-show="tabType==='history'">
-          <ActivityHandleRecord ref="ActivityHandleRecord" :wf-def-id="viewData.todoId" :wf-ins-id="viewData.todoId" />
-        </div>
-      </el-row>
-    </div>
-
-  </el-drawer>
-</template>
-
-<script>
-import { getAlertById, handleAlert } from '@/api/aqpt/alertApi'
-import { WorkFlow, ActivityHandleRecord } from '@/components'
-import VueScroll from 'vuescroll'
-import { alertStatus } from '@/utils'
-
-export default {
-  name: 'TodoHandleTask',
-  components: { VueScroll, WorkFlow, ActivityHandleRecord },
-  filters: {
-    alertStatusFilter(val) {
-      return alertStatus(val)
-    }
-  },
-  props: {
-    title: {
-      type: [String],
-      default: ''
-    }
-  },
-  data() {
-    return {
-      ops: {
-        bar: {
-          keepShow: false,
-          background: 'rgba(144, 147, 153, 0.4)',
-          onlyShowBarOnScroll: false
-        }
-      },
-      dialogVisible: false,
-      tabType: 'form',
-      viewData: {
-        alertId: undefined,
-        alertIdTitle: '',
-        alertIdDesc: '',
-        alertLevel: 2,
-        alertSource: 1,
-        alertTypeId: 2,
-        status: 0,
-        alertTime: undefined,
-        riskPointId: undefined,
-        riskPointTitle: undefined
-      },
-      formData: {
-        formCode: 'handle',
-        alertId: undefined,
-        alertReason: '',
-        handleAct: 1,
-        handleMeasure: undefined
-      },
-      rules: {}
-    }
-  },
-  methods: {
-
-    // 显示窗口
-    showModel(alertId) {
-      this.resetFormData()
-      this.dialogVisible = true
-      getAlertById(alertId).then((resp) => {
-        const { code, data, msg } = resp
-        if (code === 0) {
-          this.viewData = data
-          this.$refs.WFlow.get(alertId)
-          this.$refs.ActivityHandleRecord.getData(alertId)
-        } else {
-          this.$message.error(msg)
-        }
-      }).catch((error) => {
-        console.log(error)
-      })
-    },
-
-    // 重置
-    resetFormData() {
-      this.formData = {
-        formCode: 'handle',
-        alertId: undefined,
-        alertReason: '',
-        handleAct: 1,
-        handleMeasure: undefined
-      }
-    },
-
-    // 保存
-    submitForm(formName) {
-      this.$nextTick(() => {
-        this.$refs.WFlow.handle({}).then((res) => {
-          if (res === false) {
-            this.$message.error('请检查填写信息')
-            return false
-          }
-          this.handleCommand(res)
-        }).catch((error) => {
-          console.log(error)
-        })
-      })
-    },
-
-    // 处理
-    handleCommand(flow) {
-      console.log(flow)
-      this.formData.todoId = this.viewData.todoId
-      this.formData.handleMeasure = flow.data.actionRemark
-      this.formData.status = flow.status
-      handleAlert(this.formData).then((resp) => {
-        const { code, msg } = resp
-        if (code === 0) {
-          this.dialogVisible = false
-          this.$message.success(msg)
-          this.$emit('formSuccess')
-        } else {
-          this.$message.error(msg)
-        }
-      }).catch((error) => {
-        console.log(error)
-      })
-    }
-  }
-}
-</script>
-<style lang="scss" scoped>
-.content-container {
-  margin: 0 10px;
-  position: relative;
-  height: calc(100% - 15px);
-}
-
-.el-form-item-desc{
-  background: #3A71A8;
-  color: #fff;
-  padding:10px;
-  p{
-    margin: 0;
-    line-height: 1.8;
-  }
-}
-.assess-attachList{
-  overflow: hidden;
-  text-overflow:ellipsis;
-  white-space: nowrap;
-}
-</style>

+ 298 - 0
src/views/goaf/alert/activity/Rectify.vue

@@ -0,0 +1,298 @@
+<template>
+  <el-drawer
+    :title="title"
+    :modal-append-to-body="false"
+    :modal="false"
+    :wrapper-closable="false"
+    size="99%"
+    :visible.sync="dialogVisible"
+  >
+    <template slot="title">
+      <div class="el-drawer-title">
+        <span class="name">{{ title }}</span>
+        <el-tabs v-model="tabType">
+          <el-tab-pane label="基本信息" name="form" />
+          <el-tab-pane label="历史记录" name="history" />
+        </el-tabs>
+      </div>
+    </template>
+    <div class="content-container">
+      <el-row class="content-body">
+        <div v-show="tabType==='form'">
+
+          <Vuescroll :ops="ops" style="height: calc(100vh - 300px)">
+            <DangerInfo :view-data="viewData" class="form" />
+            <el-form ref="ruleForm" :model="formData" :rules="rules" label-width="130px">
+              <el-form-item label="隐患描述" prop="s">
+                <el-input v-model="formData.hdangerDesc" type="textarea" :rows="10" placeholder="隐患描述" />
+              </el-form-item>
+              <!-- <el-form-item label="整改类型" prop="rectifyCat">
+                <el-select v-model="formData.rectifyCat" style="width: 100%" filterable placeholder="选择整改类型">
+                  <el-option label="自行整改" :value="1" />
+                  <el-option label="外协整改" :value="2" />
+                </el-select>
+              </el-form-item> -->
+
+              <el-form-item label="整改措施" prop="rectifyMeasure">
+                <el-input v-model="formData.rectifyMeasure" type="textarea" :rows="10" placeholder="请填写整改措施" />
+              </el-form-item>
+            </el-form>
+            <work-flow ref="WFlow" handle-user="验收人" />
+          </Vuescroll>
+          <div class="btn-group">
+            <el-button type="primary" @click="submitForm('ruleForm')">提交</el-button>
+            <el-button @click="dialogVisible = false">取消</el-button>
+          </div>
+        </div>
+
+        <div v-show="tabType==='history'">
+          <ActivityHandleRecord ref="ActivityHandleRecord" />
+        </div>
+      </el-row>
+    </div>
+  </el-drawer>
+</template>
+
+<script>
+import { getDangerById, updateDanger } from '@/api/goaf/dangerApi'
+import Vuescroll from 'vuescroll'
+import { WorkFlow, ActivityHandleRecord } from '@/components'
+import DangerInfo from '../components/DangerInfo'
+
+export default {
+  name: 'RectifyTask',
+  components: { Vuescroll, DangerInfo, WorkFlow, ActivityHandleRecord },
+  props: {
+    title: {
+      type: [String],
+      default: '隐患整改'
+    }
+  },
+
+  data() {
+    return {
+      transferVisible: false,
+      ops: {
+        bar: {
+          keepShow: false,
+          background: 'rgba(144, 147, 153, 0.4)',
+          onlyShowBarOnScroll: false
+        }
+      },
+      dialogVisible: false,
+      tabType: 'form',
+      viewData: {
+        groupId: undefined,
+        groupName: '',
+        dangerId: undefined,
+        dangerSource: undefined,
+        dangerCode: '',
+        dangerTitle: '',
+        dangerDesc: '',
+        dangerLevel: undefined,
+        dangerCatId: undefined,
+        dangerCatTitle: '',
+        riskPointId: undefined,
+        riskPointTitle: '',
+
+        submitGroupId: undefined,
+        submitGroupName: '',
+        submitPositionId: undefined,
+        submitPositionName: '',
+        submitAccountId: undefined,
+        submitAccountName: '',
+        submitTime: '',
+        dangerDeadLine: '',
+
+        reviewGroupId: undefined,
+        reviewGroupName: '',
+        reviewPositionId: undefined,
+        reviewPositionName: '',
+        reviewAccountId: undefined,
+        reviewAccountName: '',
+        reviewTime: '',
+
+        rectifyGroupId: undefined,
+        rectifyGroupName: '',
+        rectifyPositionId: undefined,
+        rectifyPositionName: '',
+        rectifyAccountId: undefined,
+        rectifyAccountName: '',
+
+        hdangerDesc: '',
+        rectifyCat: 1,
+        rectifyMeasure: '',
+        rectifyRemark: '',
+        rectifyTime: '',
+
+        acceptGroupId: undefined,
+        acceptGroupName: '',
+        acceptPositionId: undefined,
+        acceptPositionName: '',
+        acceptAccountId: undefined,
+        acceptAccountName: '',
+        acceptTime: '',
+        status: 0,
+        attachList: []
+      },
+      formData: {
+        formCode: 'rectify',
+        dangerId: undefined,
+        status: 0,
+        attachList: []
+      },
+      rules: {
+        hdangerDesc: [
+          { required: true, message: '请输入隐患发生原因', trigger: 'blur' }
+        ],
+        rectifyMeasure: [
+          { required: true, message: '请输入整改措施', trigger: 'blur' }
+        ]
+      },
+      attachList: []
+    }
+  },
+  methods: {
+    previewList(photos) {
+      if (!photos) return null
+      if (Array.isArray(photos)) {
+        return photos
+      }
+      return [photos.fileUrl]
+    },
+
+    // 显示窗口
+    showModel(dangerId) {
+      this.resetFormData()
+      this.dialogVisible = true
+      getDangerById(dangerId).then((resp) => {
+        const { code, data, msg } = resp
+        if (code === 0) {
+          this.viewData = data
+          this.$refs.WFlow.get(dangerId)
+          this.$refs.ActivityHandleRecord.getData(dangerId)
+        } else {
+          this.$message.error(msg)
+        }
+      }).catch((error) => {
+        console.log(error)
+      })
+    },
+
+    // 重置
+    resetFormData() {
+      this.formData = {
+        formCode: 'rectify',
+        dangerId: undefined,
+        hdangerDesc: '',
+        rectifyCat: 1,
+        rectifyMeasure: '',
+        rectifyRemark: '',
+        status: 0,
+        attachList: []
+      }
+    },
+
+    // 保存
+    submitForm(formName) {
+      this.$nextTick(() => {
+        this.$refs.WFlow.handle({}).then((res) => {
+          if (res === false) {
+            this.$message.error('请检查填写信息')
+            return false
+          }
+          this.handleCommand(res)
+        }).catch((error) => {
+          console.log(error)
+        })
+      })
+    },
+
+    // 处理
+    handleCommand(flow) {
+      this.formData.hdangerId = this.viewData.hdangerId
+      if (flow.curActivityCode === 'review') {
+        this.formData.status = 1
+      }
+      if (flow.curActivityCode === 'rectify') {
+        this.formData.status = 2
+      }
+      if (flow.curActivityCode === 'accept') {
+        this.formData.status = 3
+      }
+      this.formData.rectifyRemark = flow.data.actionRemark
+      this.formData.attachList = flow.data.attachList
+
+      updateDanger(this.formData).then((resp) => {
+        const { code, msg } = resp
+        if (code === 0) {
+          this.dialogVisible = false
+          this.$message.success(msg)
+          this.formSuccess()
+        } else {
+          this.$message.error(msg)
+        }
+      }).catch((error) => {
+        console.log(error)
+      })
+    },
+
+    formSuccess() {
+      this.$emit('formSuccess')
+    },
+
+    resetFormField(formName) {
+      this.$refs[formName].resetFields()
+    }
+  }
+}
+</script>
+
+<style lang="scss">
+
+</style>
+<style lang="scss" scoped>
+.hd-info-component {
+  margin: 15px;
+  position: relative;
+  height: calc(100% - 15px);
+
+  .btn-group {
+    position: absolute;
+    bottom: 0;
+    left: 0;
+    width: 100%;
+
+    .el-button {
+      width: 100%;
+      margin: 0 0 15px;
+    }
+
+    .cancel-btn {
+      background: #004F7B;
+      border-color: #004F7B;
+      color: #FFF;
+
+      &:hover {
+        background: #026197;
+        border-color: #026197;
+      }
+    }
+  }
+
+  .el-row {
+    margin-bottom: 20px;
+    margin-top: 20px;
+    text-align: center;
+
+    &:last-child {
+      margin-bottom: 0;
+    }
+
+    .el-button {
+      width: 10%;
+    }
+  }
+}
+
+</style>

+ 272 - 0
src/views/goaf/alert/activity/Review.vue

@@ -0,0 +1,272 @@
+<template>
+  <el-drawer
+    :title="title"
+    :modal-append-to-body="false"
+    :modal="false"
+    :wrapper-closable="false"
+    size="99%"
+    :visible.sync="dialogVisible"
+  >
+    <template slot="title">
+      <div class="el-drawer-title">
+        <span class="name">{{ title }}</span>
+        <el-tabs v-model="tabType">
+          <el-tab-pane label="基本信息" name="form" />
+          <el-tab-pane label="历史记录" name="history" />
+        </el-tabs>
+      </div>
+    </template>
+    <div class="content-container">
+      <el-row class="content-body">
+        <div v-show="tabType==='form'">
+          <Vuescroll :ops="ops" style="height: calc(100vh - 400px)">
+            <DangerInfo :view-data="viewData" class="form" />
+            <work-flow ref="WFlow" handle-user="整改人" />
+          </Vuescroll>
+
+          <div class="btn-group">
+            <el-button type="primary" @click="submitForm('ruleForm')">提交</el-button>
+            <el-button @click="dialogVisible = false">取消</el-button>
+          </div>
+        </div>
+
+        <div v-show="tabType==='history'">
+          <ActivityHandleRecord ref="ActivityHandleRecord" />
+        </div>
+      </el-row>
+    </div>
+  </el-drawer>
+</template>
+
+<script>
+import { updateDanger, getDangerById } from '@/api/goaf/dangerApi'
+import Vuescroll from 'vuescroll'
+import { WorkFlow, ActivityHandleRecord } from '@/components'
+import DangerInfo from '../components/DangerInfo'
+
+export default {
+  name: 'ReviewTask',
+  components: { Vuescroll, DangerInfo, WorkFlow, ActivityHandleRecord },
+  filters: {},
+  props: {
+    title: {
+      type: [String],
+      default: ''
+    }
+  },
+
+  data() {
+    return {
+      ops: {
+        bar: {
+          keepShow: false,
+          background: 'rgba(144, 147, 153, 0.4)',
+          onlyShowBarOnScroll: false
+        }
+      },
+      dialogVisible: false,
+      tabType: 'form',
+      rules: { },
+      viewData: {
+        hdangerId: undefined,
+        dangerCode: '',
+        dangerTitle: '',
+        dangerSource: undefined,
+        dangerDesc: '',
+        dangerLevel: undefined,
+        dangerCatId: undefined,
+        dangerCatTitle: '',
+        riskPointId: undefined,
+        riskPointTitle: '',
+
+        submitGroupId: undefined,
+        submitGroupName: '',
+        submitPositionId: undefined,
+        submitPositionName: '',
+        submitAccountId: undefined,
+        submitAccountName: '',
+        submitTime: '',
+        dangerDeadLine: '',
+
+        reviewGroupId: undefined,
+        reviewGroupName: '',
+        reviewPositionId: undefined,
+        reviewPositionName: '',
+        reviewAccountId: undefined,
+        reviewAccountName: '',
+        reviewTime: '',
+
+        rectifyGroupId: undefined,
+        rectifyGroupName: '',
+        rectifyPositionId: undefined,
+        rectifyPositionName: '',
+        rectifyAccountId: undefined,
+        rectifyAccountName: '',
+
+        dangerReason: '',
+        rectifyCat: 1,
+        rectifyMeasure: '',
+        rectifyRemark: '',
+        rectifyTime: '',
+
+        acceptGroupId: undefined,
+        acceptGroupName: '',
+        acceptPositionId: undefined,
+        acceptPositionName: '',
+        acceptAccountId: undefined,
+        acceptAccountName: '',
+        acceptTime: '',
+        status: 0,
+        attachList: []
+      },
+      formData: {
+        formCode: 'review',
+        hdangerId: undefined,
+        status: 0,
+        attachList: []
+      }
+    }
+  },
+  mounted() {
+  },
+  methods: {
+    previewList(photos) {
+      if (!photos) return null
+      if (Array.isArray(photos)) {
+        const list = photos.map((item) => {
+          return item.fileUrl
+        })
+        return list
+      }
+      return [photos.fileUrl]
+    },
+
+    // 显示窗口
+    showModel(hdangerId, info) {
+      this.resetFormData()
+      this.dialogVisible = true
+      getDangerById(hdangerId).then((resp) => {
+        const { code, data, msg } = resp
+        if (code === 0) {
+          this.viewData = info || data
+          this.$refs.WFlow.get(hdangerId)
+          this.$refs.ActivityHandleRecord.getData(hdangerId)
+        } else {
+          this.$message.error(msg)
+        }
+      }).catch((error) => {
+        console.log(error)
+      })
+    },
+
+    // 重置
+    resetFormData() {
+      this.formData = {
+        formCode: 'review',
+        hdangerId: undefined,
+        status: 0,
+        attachList: []
+      }
+    },
+
+    // 保存
+    submitForm(formName) {
+      this.$nextTick(() => {
+        this.$refs.WFlow.handle({}).then((res) => {
+          if (res === false) {
+            this.$message.error('请检查填写信息')
+            return false
+          }
+          this.handleCommand(res)
+        }).catch((error) => {
+          console.log(error)
+        })
+      })
+    },
+
+    // 处理
+    handleCommand(flow) {
+      this.formData.hdangerId = this.viewData.hdangerId
+      if (flow.curActivityCode === 'review') {
+        this.formData.status = 1
+      }
+      if (flow.curActivityCode === 'rectify') {
+        this.formData.status = 2
+      }
+      if (flow.curActivityCode === 'accept') {
+        this.formData.status = 3
+      }
+      this.formData.reviewRemark = flow.data.actionRemark
+      this.formData.attachList = flow.data.attachList
+      updateDanger(this.formData).then((resp) => {
+        const { code, msg } = resp
+        if (code === 0) {
+          this.dialogVisible = false
+          this.$message.success(msg)
+          this.$emit('formSuccess')
+        } else {
+          this.$message.error(msg)
+        }
+      }).catch((error) => {
+        console.log(error)
+      })
+    },
+
+    formSuccess() {
+      this.$emit('formSuccess')
+    },
+    resetFormField(formName) {
+      this.$refs[formName].resetFields()
+    }
+  }
+}
+</script>
+
+<style lang="scss">
+
+</style>
+<style lang="scss" scoped>
+.hd-info-component {
+  margin: 15px;
+  position: relative;
+  height: calc(100% - 15px);
+
+  .btn-group {
+    position: absolute;
+    bottom: 0;
+    left: 0;
+    width: 100%;
+
+    .el-button {
+      width: 100%;
+      margin: 0 0 15px;
+    }
+
+    .cancel-btn {
+      background: #004F7B;
+      border-color: #004F7B;
+      color: #FFF;
+
+      &:hover {
+        background: #026197;
+        border-color: #026197;
+      }
+    }
+  }
+
+  .el-row {
+    margin-bottom: 20px;
+    margin-top: 20px;
+    text-align: center;
+
+    &:last-child {
+      margin-bottom: 0;
+    }
+
+    .el-button {
+      width: 10%;
+    }
+  }
+}
+
+</style>

+ 211 - 180
src/views/goaf/alert/activity/Submit.vue

@@ -4,74 +4,97 @@
     :modal-append-to-body="false"
     :modal="false"
     :wrapper-closable="false"
-    size="30%"
+    size="99%"
     :visible.sync="dialogVisible"
   >
+    <template slot="title">
+      <div class="el-drawer-title">
+        <span class="name">{{ title }}</span>
+      </div>
+    </template>
     <div class="content-container">
-      <vuescroll :ops="ops" style="height: calc(100vh - 200px)">
-        <el-form ref="ruleForm" :model="formData" :rules="rules" label-width="120px">
-          <el-form-item label="告警位置" prop="riskPointId">
-            <risk-point-selector v-model="formData.riskPointId" />
-          </el-form-item>
-
-          <el-form-item label="告警标题" prop="alertTitle">
-            <el-input v-model="formData.alertTitle" />
-          </el-form-item>
-
-          <el-form-item label="等级" prop="alertLevel">
-            <el-select v-model="formData.alertLevel">
-              <el-option-group>
-                <el-option
-                  v-for="item in alertLevelList"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
+      <el-row class="content-body">
+        <div v-show="tabType==='form'">
+          <vuescroll :ops="ops" style="height: calc(100vh - 300px)">
+            <el-form ref="ruleForm" :model="formData" :rules="rules" label-width="130px">
+              <el-form-item label="隐患标题" prop="hdangerTitle">
+                <el-input v-model="formData.hdangerTitle" />
+              </el-form-item>
+              <el-form-item label="采空区" prop="goafId">
+                <el-select v-model="formData.goafId" filterable placeholder="采空区名称" style="width: 100%">
+                  <el-option value="" label="请选择采空区" disabled />
+                  <el-option v-for="item in goafs" :key="item.goafId" :value="item.goafId" :label="item.goafName" />
+                </el-select>
+              </el-form-item>
+              <el-form-item label="检查表" prop="checklistId">
+                <el-select v-model="formData.checklistId" style="width: 100%" filterable placeholder="检查表">
+                  <el-option
+                    v-for="item in checklist"
+                    :key="item.checklistId"
+                    :label="item.checklistTitle"
+                    :value="item.checklistId"
+                  />
+                </el-select>
+              </el-form-item>
+              <el-form-item label="隐患等级" prop="hdangerLevel">
+                <el-radio-group v-model="formData.hdangerLevel">
+                  <el-radio :label="0">较低</el-radio>
+                  <el-radio :label="1">一般</el-radio>
+                  <el-radio :label="2">较大</el-radio>
+                  <el-radio :label="3">重大</el-radio>
+                </el-radio-group>
+              </el-form-item>
+              <el-form-item label="发生时间" prop="submitTime">
+                <el-date-picker
+                  v-model="formData.submitTime"
+                  type="date"
+                  placeholder="设置发生时间"
+                  format="yyyy-MM-dd HH:mm:ss"
+                  value-format="yyyy-MM-dd HH:mm:ss"
+                  clearable
+                  style="width: 100%"
                 />
-              </el-option-group>
-            </el-select>
-          </el-form-item>
-
-          <el-form-item label="简要描述" prop="alertDesc">
-            <el-input v-model="formData.alertDesc" type="textarea" :rows="4" placeholder="描述" />
-          </el-form-item>
-
-          <el-form-item label="附件" prop="attachList">
-            <card-upload v-model="formData.attachList" />
-          </el-form-item>
-
-          <el-form-item label="处理人员" prop="accountIdTo">
-            <user-selector :default-val="formData.accountIdTo" @setUserInfo="handleSelectUser" />
-          </el-form-item>
-
-          <el-form-item label="说明" prop="actionRemark">
-            <el-input v-model="formData.actionRemark" type="textarea" :rows="5" placeholder="说明" />
-          </el-form-item>
-        </el-form>
-      </vuescroll>
-
-      <div class="btn-group">
-        <el-button
-          v-for="(item,index) in flowData.activityIns.actionList"
-          :key="index"
-          type="primary"
-          @click="submitForm('ruleForm', item.actionId, item.actionCode)"
-        >{{ item.actionTitle }} </el-button>
-        <el-button class="cancel-btn" @click="dialogVisible = false">取 消</el-button>
-      </div>
+              </el-form-item>
+              <el-form-item label="整改截止时间" prop="dangerDeadline">
+                <el-date-picker
+                  v-model="formData.dangerDeadline"
+                  type="date"
+                  placeholder="设置截止时间"
+                  format="yyyy-MM-dd HH:mm:ss"
+                  value-format="yyyy-MM-dd HH:mm:ss"
+                  clearable
+                  style="width: 100%"
+                />
+              </el-form-item>
+              <el-form-item label="描述" prop="hdangerDesc">
+                <el-input v-model="formData.hdangerDesc" type="textarea" :rows="5" placeholder="隐患描述" />
+              </el-form-item>
+            </el-form>
+            <work-flow ref="WFlow" handle-user="评审人" />
+            <div class="btn-group">
+              <el-button type="primary" @click="submitForm('ruleForm')">提交</el-button>
+              <el-button @click="dialogVisible = false">取消</el-button>
+            </div>
+          </vuescroll>
+        </div>
+      </el-row>
     </div>
-
   </el-drawer>
 </template>
 
 <script>
-import { startAlert, handleAlert, getAlertById } from '@/api/aqpt/alertApi'
-import { UserSelector, CardUpload } from '@/components'
-import { RiskPointSelector } from '@/views/aqpt/components'
+import { getChecklist } from '@/api/goaf/check'
+import { handleDanger, getDangerById } from '@/api/goaf/dangerApi'
+import { getGoafBaseInfo } from '@/api/goaf/info'
 import Vuescroll from 'vuescroll'
-
+import { mapGetters } from 'vuex'
+import { WorkFlow } from '@/components'
 export default {
   name: 'SubmitTask',
-  components: { Vuescroll, CardUpload, UserSelector, RiskPointSelector },
+  components: {
+    Vuescroll,
+    WorkFlow
+  },
   props: {
     title: {
       type: String,
@@ -88,55 +111,46 @@ export default {
         }
       },
       dialogVisible: false,
-
+      tabType: 'form',
       formData: {
-        alertId: undefined,
-        riskPointId: undefined,
-        alertLevel: 6,
-        alertTitle: '', // 预警标题
-        alertDesc: '', // 描述
-
-        wfDefId: undefined,
-        wfInsId: undefined,
-        activityDefId: undefined,
-        activityInsId: undefined,
-        activityCode: '',
-        actionId: undefined,
-        actionCode: '',
-
-        groupIdTo: undefined,
-        positionIdTo: undefined,
-        accountIdTo: undefined, // 执行人
-
-        actionRemark: '', // 说明
-        attachList: []
+        'formCode': 'submit',
+        'hdangerId': 1,
+        'dangerId': undefined,
+        'hdangerTitle': '', // 隐患标题
+        'dangerCatId': undefined, // 隐患类别ID
+        'hdangerLevel': 1, // 隐患等级
+        'hdangerDesc': '', // 描述
+        'submitTime': new Date(),
+        'dangerDeadline': '', // 截止时间
+        'goafId': undefined,
+        'submitGroupId': '',
+        'submitGroupName': '',
+        'submitPositionId': '',
+        'submitPositionName': '',
+        'submitAccountId': '',
+        'submitAccountName': '',
+        'checklistId': ''
       },
-
-      flowData: {
-        activityIns: {
-          actionList: []
-        }
-      },
-
-      alertLevelList: [
-        { value: 0, label: '未知' },
-        { value: 1, label: '1级' },
-        { value: 2, label: '2级' },
-        { value: 3, label: '3级' },
-        { value: 4, label: '4级' },
-        { value: 5, label: '5级' },
-        { value: 6, label: '6级' }
-      ],
-
+      goafs: [],
+      checklist: [],
       rules: {
-        riskPointId: [
-          { required: true, message: '请选择风险点', trigger: 'blur' }
+        hdangerTitle: [
+          { required: true, message: '请输入隐患标题', trigger: 'blur' }
         ],
-        alertTitle: [
-          { required: true, message: '请输入标题', trigger: 'blur' }
+        goafId: [
+          { required: true, message: '请选择采空区', trigger: 'change' }
         ],
-        alertLevel: [
-          { required: true, message: '请选择等级', trigger: 'blur' }
+        checklistId: [
+          { required: true, message: '请选择检查表', trigger: 'change' }
+        ],
+        hdangerLevel: [
+          { required: true, message: '请输选择隐患等级', trigger: 'blur' }
+        ],
+        submitTime: [
+          { required: true, message: '发生时间', trigger: 'blur' }
+        ],
+        dangerDeadline: [
+          { required: true, message: '截止时间', trigger: 'blur' }
         ],
         accountIdTo: [
           { required: true, message: '请选择执行人', trigger: 'blur' }
@@ -144,51 +158,46 @@ export default {
       }
     }
   },
-  mounted() {},
+  computed: {
+    ...mapGetters([
+      'userData'
+    ])
+  },
   methods: {
 
-    // 附件
-    attachListChange(dataList) {
-      this.formData.attachList = dataList
-    },
-
-    // Task Start View
+    // 启动
     start() {
-      this.resetFormData()
+      const wfDefId = 1
       this.dialogVisible = true
+      const userData = JSON.parse(JSON.stringify(this.userData))
+      this.formData.ocId = userData.ocId
 
-      startAlert().then((resp) => {
-        const { code, data, msg } = resp
-        if (code === 0) {
-          this.flowData = data
-          this.formData.wfDefId = data.wfDefId
-          this.formData.wfInsId = data.wfInsId
-          this.formData.activityDefId = data.activityIns.activityDefId
-          this.formData.activityInsId = data.activityIns.activityInsId
-          this.formData.activityCode = data.activityIns.activityCode
-        } else {
-          this.$message.error(msg)
-        }
-      }).catch((error) => {
-        console.log(error)
+      getChecklist().then((res) => {
+        this.checklist = res.data
+      })
+      getGoafBaseInfo().then((res) => {
+        this.goafs = res.data
+      })
+      this.$nextTick(() => {
+        this.$refs.WFlow.start(wfDefId).then((res) => {
+          if (res > 0) {
+            this.formData.hdangerId = res
+          } else {
+            this.$message.error('流程初始化失败')
+          }
+        })
       })
     },
 
-    // Task Handling View
-    handle(alertId) {
+    // 显示窗口
+    showModel(dangerId) {
       this.resetFormData()
       this.dialogVisible = true
-      getAlertById(alertId).then((resp) => {
+      getDangerById(dangerId).then((resp) => {
         const { code, data, msg } = resp
         if (code === 0) {
-          this.formData = data.data
-          const flow = data.flow
-          this.flowData = flow
-          this.formData.wfDefId = flow.wfDefId
-          this.formData.wfInsId = flow.wfInsId
-          this.formData.activityDefId = flow.activityIns.activityDefId
-          this.formData.activityInsId = flow.activityIns.activityInsId
-          this.formData.activityCode = flow.activityIns.activityCode
+          this.formData = data
+          this.$refs.WFlow.get(dangerId)
         } else {
           this.$message.error(msg)
         }
@@ -197,64 +206,82 @@ export default {
       })
     },
 
-    // Select User
-    handleSelectUser(item) {
-      this.formData.accountIdTo = item.accountId
-      this.formData.groupIdTo = item.groupId
-      this.formData.positionIdTo = item.positionId
-    },
-
-    // Reset Form Data
     resetFormData() {
       this.formData = {
-        alertId: undefined,
-        riskPointId: undefined,
-        alertLevel: 6,
-        alertTitle: '', // 预警标题
-        alertDesc: '', // 描述
-
-        wfDefId: undefined,
-        wfInsId: undefined,
-        activityDefId: undefined,
-        activityInsId: undefined,
-        activityCode: '',
-        actionId: undefined,
-        actionCode: '',
-
-        groupIdTo: undefined,
-        positionIdTo: undefined,
-        accountIdTo: undefined, // 执行人
-
-        actionRemark: '', // 说明
-        attachList: []
+        'formCode': 'submit',
+        'hdangerId': 1,
+        'dangerId': undefined,
+        'hdangerTitle': '', // 隐患标题
+        'dangerCatId': undefined, // 隐患类别ID
+        'hdangerLevel': 1, // 隐患等级
+        'hdangerDesc': '', // 描述
+        'submitTime': new Date(),
+        'dangerDeadline': '', // 截止时间
+        'goafId': undefined,
+        'submitGroupId': '',
+        'submitGroupName': '',
+        'submitPositionId': '',
+        'submitPositionName': '',
+        'submitAccountId': '',
+        'submitAccountName': '',
+        'checklistId': ''
       }
     },
-
-    // Submit Flow
-    submitForm(formName, actionId, actionCode) {
-      this.formData.actionId = actionId
-      this.formData.actionCode = actionCode
-      this.$refs[formName].validate((valid) => {
+    // 保存
+    submitForm() {
+      this.$refs['ruleForm'].validate((valid) => {
         if (valid) {
-          handleAlert(this.formData).then((resp) => {
-            const { code, msg } = resp
-            if (code === 0) {
-              this.dialogVisible = false
-              this.formSuccess()
-              this.$message.success(msg)
-            } else {
-              this.$message.error(msg)
-            }
-          }).catch((error) => {
-            console.log(error)
+          this.$nextTick(() => {
+            this.$refs.WFlow.handle({}).then((res) => {
+              this.handleCommand(res)
+            }).catch((error) => {
+              console.log(error)
+            })
           })
         } else {
-          console.log('error submit!!')
-          return false
+          this.$message.error('提交失败请检查')
         }
       })
     },
 
+    // 提交
+    handleCommand(flow) {
+      const attachList = flow.data.attachList
+      this.formData.submitRemark = flow.data.actionRemark
+      this.formData.attachList = attachList
+      if (Array.isArray(attachList) && attachList.length > 0) {
+        const attach = attachList[0]
+        this.formData.scenePhoto = attach.fileUrl
+        this.formData.sceneIcon = attach.fileIcon
+      }
+      this.formData.submitGroupId = this.userData.groupId
+      this.formData.submitGroupName = this.userData.groupName
+      this.formData.submitPositionId = this.userData.positionId
+      this.formData.submitPositionName = this.userData.positionName
+      this.formData.submitAccountId = this.userData.userId
+      this.formData.submitAccountName = this.userData.userName
+
+      if (flow.curActivityCode === 'review') {
+        this.formData.status = 1
+      }
+      if (flow.curActivityCode === 'rectify') {
+        this.formData.status = 2
+      }
+      if (flow.curActivityCode === 'accept') {
+        this.formData.status = 3
+      }
+
+      handleDanger(this.formData).then((resp) => {
+        const { code, msg } = resp
+        if (code === 0) {
+          this.$emit('formSuccess')
+          this.dialogVisible = false
+          this.$message.success(msg)
+        } else {
+          this.$message.error(msg)
+        }
+      })
+    },
     formSuccess() {
       this.$emit('formSuccess')
     },
@@ -273,6 +300,10 @@ export default {
 .content-container {
   position: relative;
   height: calc(100% - 15px);
+  .ruleForm {
+    margin: 0 100px;
+  }
+
   .btn-group {
     width: 100%;
     text-align: center;

+ 210 - 0
src/views/goaf/alert/checkList.vue

@@ -0,0 +1,210 @@
+<template>
+  <div class="content-container">
+    <el-row class="tool-bar">
+      <el-col :span="12" class="left">
+        <div class="content-title">
+          {{ title }}
+        </div>
+      </el-col>
+
+      <el-col :span="12" class="button-group">
+        <div class="select-search right">
+          <el-input v-model="conditions.hdangerTitle" class="search-input" placeholder="请输入内容">
+            <el-button slot="append" icon="el-icon-search" @click="getData()" />
+          </el-input>
+        </div>
+      </el-col>
+    </el-row>
+
+    <el-row class="content-body">
+      <el-table v-loading="listLoading" class="page-table" border :data="dataList" height="calc(100vh - 230px)">
+
+        <el-table-column type="index" label="序号" header-align="center" align="center" width="60" />>
+        <el-table-column prop="hdangerTitle" label="隐患名称" header-align="left" align="left">
+          <template v-slot="{row}">
+            <span>{{ row.hdangerTitle }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="hdangerLevel" label="级别" header-align="center" align="center">
+          <template v-slot="{row}">
+            <span><el-tag type="success" effect="plain" color="rgb(38 69 90)">{{ row.hdangerLevel | dangerLevelFilter }}</el-tag></span>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="status" label="状态" header-align="center" align="center">
+          <template v-slot="{row}">
+            <span><el-tag type="warning" effect="plain" color="rgb(38 69 90)">{{ row.status | dangerStatusFilter }}</el-tag></span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="dangerDeadline" label="整改期限" header-align="center" align="center" width="165">
+          <template v-slot="{row}">
+            <span><i class="el-icon-timer" />{{ row.dangerDeadline }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column label="操作" header-align="center" align="center">
+          <template v-slot="{row}">
+            <el-button size="mini" type="info" @click="handleDetail(row)">详情</el-button>
+            <el-button v-if="row.submitAccountId===userData.userId" size="mini" type="danger" @click="handleDelete(row)">删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <div class="pagination-container">
+        <pagination v-show="total>0" :total="total" :page.sync="conditions.page" :limit.sync="conditions.limit" @pagination="getData" />
+      </div>
+    </el-row>
+    <submit-activity ref="submit" title="登记隐患" @formSuccess="formSuccess" />
+    <review-activity ref="review" title="隐患评审" @formSuccess="formSuccess" />
+    <rectify-activity ref="rectify" title="隐患整改" @formSuccess="formSuccess" />
+    <accept-activity ref="accept" title="隐患验收" @formSuccess="formSuccess" />
+    <danger-details ref="DangerDetails" title="隐患详情" />
+  </div>
+</template>
+
+<script>
+import Pagination from '@/components/Pagination'
+import { deleteDangerById, getDangerByPage } from '@/api/goaf/dangerApi'
+import DangerDetails from '@/views/goaf/danger/components/Details.vue'
+import { mapGetters } from 'vuex'
+import SubmitActivity from './activity/Submit'
+import ReviewActivity from './activity/Review'
+import RectifyActivity from './activity/Rectify'
+import AcceptActivity from './activity/Accept'
+export default {
+  name: 'DangerList',
+  components: { Pagination, SubmitActivity, ReviewActivity, RectifyActivity, AcceptActivity, DangerDetails },
+  filters: {
+    dangerLevelFilter(val) {
+      const status = ['较低', '一般', '较大', '重大']
+      return status[val]
+    },
+    dangerStatusFilter(val) {
+      const status = ['待提交', '待评审', '待整改', '待验收', '完成']
+      return val === -1 ? '撤销' : status[val]
+    }
+  },
+  props: {
+    title: {
+      type: [String],
+      default: '预警中心'
+    }
+  },
+  data() {
+    return {
+      dataList: [],
+      total: 0,
+      listLoading: false,
+      conditions: {
+        page: 1,
+        limit: 10,
+        status: 4
+      }
+    }
+  },
+  computed: {
+    ...mapGetters([
+      'userData'
+    ])
+  },
+  created() {
+    this.getData()
+  },
+  methods: {
+
+    // 重置查询条件
+    resetConditions() {
+      this.conditions.keywords = ''
+      this.conditions.status = undefined
+      this.conditions.submitAccountId = undefined
+      this.conditions.handleAccountId = undefined
+      this.conditions.curAccountId = undefined
+      this.conditions.groupId = undefined
+    },
+
+    // 加载数据
+    loadData(action) {
+      this.conditions = { ...this.conditions, ...action }
+      this.getData()
+    },
+
+    // Fetch Data
+    getData() {
+      this.listLoading = true
+      getDangerByPage(this.conditions).then((resp) => {
+        const { code, data, total, msg } = resp
+        this.listLoading = false
+        if (code === 0) {
+          this.total = total
+          this.dataList = data
+        } else {
+          this.$message.error(msg)
+        }
+      }).catch((error) => {
+        console.log(error)
+      })
+    },
+
+    // 流程处理
+    handleDanger(data) {
+      const { hdangerId, curActivityCode } = data
+      this.$refs[curActivityCode].showModel(hdangerId, data)
+    },
+
+    // Delete Handler
+    handleDelete(data) {
+      const { hdangerId, hdangerTitle } = data
+      this.$confirm(`此操作将删除该数据${hdangerTitle}, 是否继续?`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        deleteDangerById(hdangerId).then((resp) => {
+          const { code, msg } = resp
+          if (code === 0) {
+            this.$message.success(msg)
+            this.getData()
+          } else {
+            this.$message.error(msg)
+          }
+        }).catch((error) => {
+          console.log(error)
+        })
+      }).catch(() => {
+        this.$message({ type: 'info', message: '已取消删除' })
+      })
+    },
+
+    // Show Details
+    handleDetail(data) {
+      const { hdangerId } = data
+      this.$refs['DangerDetails'].showView(hdangerId, JSON.parse(JSON.stringify(data)))
+    },
+
+    // Update View
+    formSuccess() {
+      this.getData()
+      this.$emit('actionUpdate')
+    },
+
+    // Preview Photo
+    previewList(photos) {
+      if (Array.isArray(photos)) {
+        const list = photos.map((item) => {
+          return item
+        })
+        return list
+      }
+      return [photos]
+    }
+  }
+}
+</script>
+  <style lang="scss" scoped>
+  .content-container {
+    margin: 10px;
+    height: calc(100vh - 95px);
+  }
+  </style>
+

+ 212 - 0
src/views/goaf/alert/checkList_warning.vue

@@ -0,0 +1,212 @@
+<template>
+  <div class="content-container">
+    <el-row class="tool-bar">
+      <el-col :span="12" class="left">
+        <div class="content-title">
+          {{ title }}
+        </div>
+      </el-col>
+
+      <el-col :span="12" class="button-group">
+        <div class="select-search right">
+          <el-input v-model="conditions.hdangerTitle" class="search-input" placeholder="请输入内容">
+            <el-button slot="append" icon="el-icon-search" @click="getData()" />
+          </el-input>
+        </div>
+      </el-col>
+    </el-row>
+
+    <el-row class="content-body">
+      <el-table v-loading="listLoading" class="page-table" border :data="dataList" height="calc(100vh - 230px)">
+
+        <el-table-column type="index" label="序号" header-align="center" align="center" width="60" />>
+        <el-table-column prop="hdangerTitle" label="隐患名称" header-align="left" align="left">
+          <template v-slot="{row}">
+            <span>{{ row.hdangerTitle }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="hdangerLevel" label="级别" header-align="center" align="center" width="80">
+          <template v-slot="{row}">
+            <span><el-tag type="success" effect="plain" color="rgb(38 69 90)">{{ row.hdangerLevel | dangerLevelFilter }}</el-tag></span>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="status" label="状态" header-align="center" align="center" width="80">
+          <template v-slot="{row}">
+            <span><el-tag type="warning" effect="plain" color="rgb(38 69 90)">{{ row.status | dangerStatusFilter }}</el-tag></span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="dangerDeadline" label="整改期限" header-align="center" align="center">
+          <template v-slot="{row}">
+            <span><i class="el-icon-timer" />{{ row.dangerDeadline }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column label="操作" header-align="center" align="center">
+          <template v-slot="{row}">
+            <!-- <el-button v-if="row.status !== 0 && row.curAccountId===userData.userId" type="primary" size="mini" @click="handleDanger(row)">处理</el-button> -->
+            <el-button size="mini" type="info" @click="handleDetail(row)">详情</el-button>
+            <el-button v-if="row.submitAccountId===userData.userId" size="mini" type="danger" @click="handleDelete(row)">删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <div class="pagination-container">
+        <pagination v-show="total>0" :total="total" :page.sync="conditions.page" :limit.sync="conditions.limit" @pagination="getData" />
+      </div>
+    </el-row>
+    <submit-activity ref="submit" title="登记隐患" @formSuccess="formSuccess" />
+    <review-activity ref="review" title="隐患评审" @formSuccess="formSuccess" />
+    <rectify-activity ref="rectify" title="隐患整改" @formSuccess="formSuccess" />
+    <accept-activity ref="accept" title="隐患验收" @formSuccess="formSuccess" />
+    <danger-details ref="DangerDetails" title="隐患详情" />
+  </div>
+</template>
+
+<script>
+import Pagination from '@/components/Pagination'
+import { deleteDangerById, getDangerByPage } from '@/api/goaf/dangerApi'
+import DangerDetails from '@/views/goaf/danger/components/Details.vue'
+import { mapGetters } from 'vuex'
+import SubmitActivity from './activity/Submit'
+import ReviewActivity from './activity/Review'
+import RectifyActivity from './activity/Rectify'
+import AcceptActivity from './activity/Accept'
+export default {
+  name: 'DangerList',
+  components: { Pagination, SubmitActivity, ReviewActivity, RectifyActivity, AcceptActivity, DangerDetails },
+  filters: {
+    dangerLevelFilter(val) {
+      const status = ['较低', '一般', '较大', '重大']
+      return status[val]
+    },
+    dangerStatusFilter(val) {
+      const status = ['待提交', '待评审', '待整改', '待验收', '完成']
+      return val === -1 ? '撤销' : status[val]
+    }
+  },
+  props: {
+    title: {
+      type: [String],
+      default: '预警中心'
+    }
+  },
+  data() {
+    return {
+      dataList: [],
+      total: 0,
+      listLoading: false,
+      conditions: {
+        page: 1,
+        limit: 10,
+        status: 4,
+        hdangerLevel: 3
+      }
+    }
+  },
+  computed: {
+    ...mapGetters([
+      'userData'
+    ])
+  },
+  created() {
+    this.getData()
+  },
+  methods: {
+
+    // 重置查询条件
+    resetConditions() {
+      this.conditions.keywords = ''
+      this.conditions.status = undefined
+      this.conditions.submitAccountId = undefined
+      this.conditions.handleAccountId = undefined
+      this.conditions.curAccountId = undefined
+      this.conditions.groupId = undefined
+    },
+
+    // 加载数据
+    loadData(action) {
+      this.conditions = { ...this.conditions, ...action }
+      this.getData()
+    },
+
+    // Fetch Data
+    getData() {
+      this.listLoading = true
+      getDangerByPage(this.conditions).then((resp) => {
+        const { code, data, total, msg } = resp
+        this.listLoading = false
+        if (code === 0) {
+          this.total = total
+          this.dataList = data
+        } else {
+          this.$message.error(msg)
+        }
+      }).catch((error) => {
+        console.log(error)
+      })
+    },
+
+    // 流程处理
+    handleDanger(data) {
+      const { hdangerId, curActivityCode } = data
+      this.$refs[curActivityCode].showModel(hdangerId, data)
+    },
+
+    // Delete Handler
+    handleDelete(data) {
+      const { hdangerId, hdangerTitle } = data
+      this.$confirm(`此操作将删除该数据${hdangerTitle}, 是否继续?`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        deleteDangerById(hdangerId).then((resp) => {
+          const { code, msg } = resp
+          if (code === 0) {
+            this.$message.success(msg)
+            this.getData()
+          } else {
+            this.$message.error(msg)
+          }
+        }).catch((error) => {
+          console.log(error)
+        })
+      }).catch(() => {
+        this.$message({ type: 'info', message: '已取消删除' })
+      })
+    },
+
+    // Show Details
+    handleDetail(data) {
+      const { hdangerId } = data
+      this.$refs['DangerDetails'].showView(hdangerId, JSON.parse(JSON.stringify(data)))
+    },
+
+    // Update View
+    formSuccess() {
+      this.getData()
+      this.$emit('actionUpdate')
+    },
+
+    // Preview Photo
+    previewList(photos) {
+      if (Array.isArray(photos)) {
+        const list = photos.map((item) => {
+          return item
+        })
+        return list
+      }
+      return [photos]
+    }
+  }
+}
+</script>
+    <style lang="scss" scoped>
+    .content-container {
+      margin: 10px;
+      height: calc(100vh - 95px);
+    }
+    </style>
+

+ 171 - 0
src/views/goaf/alert/components/DangerInfo.vue

@@ -0,0 +1,171 @@
+<template>
+  <div class="text-block" :style="styles">
+    <div class="activity-item danger">
+      <div v-if="viewData&&viewData.dangerCode" class="text-row">
+        <div v-if="viewData.dangerCode" class="text-item">
+          <span class="text-label right">隐患编码:</span>
+          <span> {{ viewData.dangerCode }} </span>
+        </div>
+        <div v-if="viewData.status" class="text-item">
+          <span class="text-label right">隐患状态:</span>
+          <span> {{ viewData.status | dangerStatusFilter }} </span>
+        </div>
+        <div v-if="viewData.dangerTitle" class="text-item">
+          <span class="text-label right">隐患名称:</span>
+          <span> {{ viewData.dangerTitle }} </span>
+        </div>
+        <div v-if="viewData.dangerTitle" class="text-item">
+          <span class="text-label right">隐患类别:</span>
+          <span> {{ viewData.dangerCatTitle }} </span>
+        </div>
+        <div v-if="viewData.dangerLevel" class="text-item">
+          <span class="text-label right">隐患等级:</span>
+          <span> {{ viewData.dangerLevel | dangerLevelFilter }} </span>
+        </div>
+        <div v-if="viewData.riskPointTitle" class="text-item">
+          <span class="text-label right">所在位置:</span>
+          <span> {{ viewData.riskPointTitle }}</span>
+        </div>
+        <div v-if="viewData.dangerDeadLine" class="text-item">
+          <span class="text-label right">整改期限:</span>
+          <span> {{ viewData.dangerDeadLine }}</span>
+        </div>
+        <div v-if="viewData.dangerDesc" class="text-item">
+          <span class="text-label right">描述:</span>
+          <span> {{ viewData.dangerDesc }} </span>
+        </div>
+      </div>
+    </div>
+    <div class="activity-item submit">
+      <div v-if="viewData.submitAccountName" class="text-row">
+        <div v-if="viewData.submitAccountName" class="text-item">
+          <span class="text-label right">提交人员:</span>
+          <span> {{ viewData.submitAccountName }}( {{ viewData.submitPositionName }} ) </span>
+        </div>
+        <div v-if="viewData.submitGroupName" class="text-item">
+          <span class="text-label right">所在部位:</span>
+          <span> {{ viewData.submitGroupName }} </span>
+        </div>
+      </div>
+    </div>
+    <div class="activity-item rectify">
+      <div v-if="viewData.rectifyAccountId" class="text-row">
+        <div v-if="viewData.rectifyAccountId" class="text-item">
+          <span class="text-label right">整改人员:</span>
+          <span> {{ viewData.rectifyAccountName }}</span>
+        </div>
+        <div v-if="viewData.rectifyGroupName" class="text-item">
+          <span class="text-label right">所在部门:</span>
+          <span> {{ viewData.rectifyGroupName }} </span>
+        </div>
+      </div>
+      <div v-if="viewData.rectifyMeasure" class="text-row">
+        <div v-if="viewData.rectifyMeasure" class="text-item">
+          <span class="text-label right">整改措施:</span>
+          <span> {{ viewData.rectifyMeasure }}</span>
+        </div>
+      </div>
+      <div v-if="viewData.rectifyRemark" class="text-row">
+        <div v-if="viewData.rectifyRemark" class="text-item">
+          <span class="text-label right">整改说明:</span>
+          <span> {{ viewData.rectifyRemark }}</span>
+        </div>
+      </div>
+    </div>
+    <div v-if="viewData.attachList&&viewData.attachList.length>0" class="activity-item attach">
+      <div v-for="(attach,index) in viewData.attachList" :key="index" class="attach-item">
+        <el-image
+          style="width: 100px; height: 100px"
+          :src="attach.fileUrl"
+          :preview-src-list="[attach.fileUrl]"
+          fit="fill"
+        />
+        <div class="tag">{{ attach.taskCode |taskCodeFilter }}</div>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+import { dangerLevel, dangerSource, dangerStatus, rectifyCat } from '@/utils'
+export default {
+  name: 'DangerInfo',
+  components: { },
+  filters: {
+    dangerSourceFilter(ival) {
+      return dangerSource(ival)
+    },
+    dangerLevelFilter(ival) {
+      return dangerLevel(ival)
+    },
+    dangerStatusFilter(ival) {
+      return dangerStatus(ival)
+    },
+    rectifyFilter(ival) {
+      return rectifyCat(ival)
+    },
+    taskCodeFilter(code) {
+      const enums = {
+        'submit': '提交',
+        'accept': '验收',
+        'review': '评审',
+        'rectify': '整改'
+      }
+      return enums[code]
+    }
+
+  },
+  props: {
+    viewData: {
+      type: Object,
+      default: undefined
+    },
+    styles: {
+      type: String,
+      default: ''
+    }
+
+  },
+  data() {
+    return {
+
+    }
+  }
+}
+
+</script>
+<style lang="scss" scoped>
+  .text-block{
+    margin-bottom: 20px;
+    &.form{
+      .activity-item{
+        padding-left: 50px;
+      }
+    }
+  }
+.activity-item{
+  margin-top:1px;
+  background-color: #28475c;
+  &.attach{
+    display: flex;
+    justify-content: flex-start;
+    flex-wrap: wrap;
+    align-items: center;
+    padding: 5px 0;
+    .attach-item{
+      position: relative;
+      height: 100px;
+      margin-left: 10px;
+      .tag{
+        width: 100%;
+        position: absolute;
+        bottom: 0;
+        padding: 3px 0;
+        line-height: 1;
+        background-color: rgba(0,0,0,0.6);
+        color: #fff;
+        text-align: center;
+      }
+    }
+  }
+}
+</style>

+ 23 - 7
src/views/goaf/alert/components/AlertList.vue → src/views/goaf/alert/components/DangerList.vue

@@ -3,7 +3,7 @@
     <el-row class="tool-bar">
       <el-col :span="12" class="left">
         <div class="content-title">
-          预警中心
+          {{ title }}
         </div>
       </el-col>
 
@@ -68,6 +68,10 @@
         <pagination v-show="total>0" :total="total" :page.sync="conditions.page" :limit.sync="conditions.limit" @pagination="getData" />
       </div>
     </el-row>
+    <submit-activity ref="submit" title="登记隐患" @formSuccess="formSuccess" />
+    <review-activity ref="review" title="隐患评审" @formSuccess="formSuccess" />
+    <rectify-activity ref="rectify" title="隐患整改" @formSuccess="formSuccess" />
+    <accept-activity ref="accept" title="隐患验收" @formSuccess="formSuccess" />
     <danger-details ref="DangerDetails" title="隐患详情" />
   </div>
 </template>
@@ -75,31 +79,43 @@
 <script>
 import Pagination from '@/components/Pagination'
 import { deleteDangerById, getDangerByPage } from '@/api/goaf/dangerApi'
-import DangerDetails from '@/views/goaf/danger/components/Details.vue'
+import SubmitActivity from '../activity/Submit'
+import ReviewActivity from '../activity/Review'
+import RectifyActivity from '../activity/Rectify'
+import AcceptActivity from '../activity/Accept'
+import DangerDetails from './Details'
 import { mapGetters } from 'vuex'
 
 export default {
   name: 'DangerList',
-  components: { Pagination, DangerDetails },
+  components: { Pagination, SubmitActivity, ReviewActivity, RectifyActivity, AcceptActivity, DangerDetails },
   filters: {
     dangerLevelFilter(val) {
       const status = ['较低', '一般', '较大', '重大']
       return status[val]
     },
     dangerStatusFilter(val) {
-      const status = ['未提交', '处理中', '完成']
+      const status = ['待提交', '待评审', '待整改', '待验收', '完成']
       return val === -1 ? '撤销' : status[val]
+    },
+    dangerDeadlineFilter(val) {
+
     }
   },
   data() {
     return {
+      title: '隐患',
       dataList: [],
       total: 0,
       listLoading: false,
       conditions: {
         page: 1,
-        limit: 10
-      }
+        limit: 10,
+        status: undefined,
+        day: undefined,
+        hdangerTitle: undefined
+      },
+      action: ''
     }
   },
   computed: {
@@ -124,7 +140,7 @@ export default {
 
     // 加载数据
     loadData(action) {
-      this.conditions = { ...this.conditions, ...action }
+      this.conditions.status = action
       this.getData()
     },
 

+ 124 - 157
src/views/goaf/alert/components/Details.vue

@@ -3,118 +3,57 @@
     :title="title"
     :modal-append-to-body="false"
     :modal="false"
-    size="70%"
+    size="65%"
     :visible.sync="dialogVisible"
   >
+    <template slot="title">
+      <div class="el-drawer-title">
+        <span class="name">{{ title }}</span>
+        <el-tabs v-model="tabType">
+          <el-tab-pane label="基本信息" name="form" />
+          <el-tab-pane label="历史记录" name="history" />
+        </el-tabs>
+      </div>
+    </template>
     <div class="content-container">
-      <vuescroll :ops="ops" style="height: calc(100vh - 400px)">
-
-        <div class="text-block">
-          <div class="text-title">{{ viewData.alertTitle }}</div>
-
-          <div v-if="viewData.alertDesc" class="text-row">
-            <div class="text-item">
-              <span>{{ viewData.alertDesc }}</span>
-            </div>
-          </div>
-
-          <div class="text-row">
-            <div class="text-item">
-              <span class="text-label right">等级:</span>
-              <span>{{ viewData.alertLevel | alertLevelFilter }}</span>
-            </div>
-            <div class="text-item">
-              <span class="text-label right">状态:</span>
-              <span>{{ viewData.status | alertStatusFilter }}</span>
-            </div>
-          </div>
-
-          <div v-if="viewData.riskPointTitle" class="text-row">
-            <div v-if="viewData.riskPointTitle" class="text-item">
-              <span class="text-label right">发生位置:</span>
-              <span><i class="el-icon-user-solid" /> {{ viewData.riskPointTitle }}</span>
-            </div>
-            <div v-if="viewData.alertTime" class="text-item">
-              <span class="text-label right">发生时间:</span>
-              <span><i class="el-icon-time" /> {{ viewData.alertTime }}</span>
-            </div>
-          </div>
-
-          <div v-if="viewData.handleAccountName" class="text-row">
-            <div v-if="viewData.handleAccountName" class="text-item">
-              <span class="text-label right">处理人员:</span>
-              <span><i class="el-icon-user-solid" /> {{ viewData.handleAccountName }}</span>
-            </div>
-            <div v-if="viewData.handleTime" class="text-item">
-              <span class="text-label right">处理时间:</span>
-              <span><i class="el-icon-time" /> {{ viewData.handleTime }}</span>
-            </div>
-          </div>
-
-          <div v-if="viewData.handleMeasure" class="text-row">
-            <div class="text-item">
-              <span class="text-label right">处理说明:</span>
-              <span>{{ viewData.handleMeasure }} </span>
-            </div>
-          </div>
-        </div>
-
-        <div v-if="viewData.attachList" class="explain">
-          <template>
-            <h4 class="hd-details">附件</h4>
-            <div class="demo-image__placeholder">
-              <div class="block">
-                <el-card :body-style="{ padding: '0px',border:0 }">
-                  <div class="card-box">
-                    <div v-for="(item,index) in viewData.attachList" :key="index">
-                      <el-link :href="item.fileUrl" target="_blank">{{ item.fileTitle }}</el-link>
-                      <p v-if="item.actionCode" class="desc" :class="item.actionCode"><span>{{ formatActionCode(item.actionCode) }}</span></p>
-                    </div>
-                  </div>
-                </el-card>
-              </div>
+      <el-row class="content-body">
+        <div v-show="tabType==='form'">
+          <Vuescroll :ops="ops" style="height: calc(100vh - 260px)">
+            <div class="handle-contanier" style="padding-bottom:3px">
+              <el-button type="primary" size="mini" @click="getPdf()">导出PDF</el-button>
             </div>
-          </template>
-        </div>
-
-        <div class="history">
-          <h3 class="hd-details">历史记录  <span style="font-size: 12px; font-weight: normal; color:#A9BDC9;">排序默认按时间由近到远</span></h3>
-          <ActivityHandleRecord ref="ActivityHandleRecord" />
+            <DangerInfo id="pdfDom" :view-data="viewData" />
+          </Vuescroll>
         </div>
-      </vuescroll>
+      </el-row>
+      <div v-show="tabType==='history'">
+        <ActivityHandleRecord ref="ActivityHandleRecord" :wf-ins-id="viewData.dangerId" />
+      </div>
       <div class="btn-group">
         <el-button class="cancel-btn" @click="dialogVisible = false">关闭</el-button>
       </div>
-      <div v-if="previewVisible" class="custom-dialog" @click="previewVisible=false">
-        <img :src="previewsrc" alt="预览图片" @click.stop="previewVisible=true">
-      </div>
     </div>
   </el-drawer>
 </template>
 
 <script>
-
-import { getAlertById } from '@/api/aqpt/alertApi'
-import { mapGetters } from 'vuex'
-import ActivityHandleRecord from '@/components/WorkFlow/ActivityHandleRecord'
-import { alertLevel, alertStatus } from '@/utils'
 import Vuescroll from 'vuescroll'
+import { getDangerById } from '@/api/goaf/dangerApi'
+import DangerInfo from '../components/DangerInfo'
+import { ActivityHandleRecord } from '@/components'
 
 export default {
-  name: 'AlertDetail',
-  components: { Vuescroll, ActivityHandleRecord },
-  filters: {
-    alertLevelFilter(val) {
-      return alertLevel(val)
-    },
-    alertStatusFilter(val) {
-      return alertStatus(val)
+  name: 'DangerDetails',
+  components: { Vuescroll, DangerInfo, ActivityHandleRecord },
+  filters: {},
+  props: {
+    title: {
+      type: String,
+      default: ''
     }
   },
-  props: {},
   data() {
     return {
-      title: '告警详情',
       previewVisible: false,
       previewsrc: '',
       ops: {
@@ -125,64 +64,91 @@ export default {
         }
       },
       dialogVisible: false,
+      tabType: 'form',
       viewData: {
-        alertId: undefined,
-        alertTitle: '',
-        alertLevel: 0,
-        alertDesc: '',
-        status: 1,
-        groupId: undefined, // 所属部门
-        positionId: undefined,
-        accountId: undefined
+        groupId: undefined,
+        groupName: '',
+        dangerId: undefined,
+        dangerSource: undefined,
+        dangerCode: '',
+        dangerTitle: '',
+        dangerDesc: '',
+        dangerLevel: undefined,
+        dangerCatId: undefined,
+        dangerCatTitle: '',
+        riskPointId: undefined,
+        riskPointTitle: '',
+
+        submitGroupId: undefined,
+        submitGroupName: '',
+        submitPositionId: undefined,
+        submitPositionName: '',
+        submitAccountId: undefined,
+        submitAccountName: '',
+        submitTime: '',
+        dangerDeadLine: '',
+
+        reviewGroupId: undefined,
+        reviewGroupName: '',
+        reviewPositionId: undefined,
+        reviewPositionName: '',
+        reviewAccountId: undefined,
+        reviewAccountName: '',
+        reviewTime: '',
+
+        rectifyGroupId: undefined,
+        rectifyGroupName: '',
+        rectifyPositionId: undefined,
+        rectifyPositionName: '',
+        rectifyAccountId: undefined,
+        rectifyAccountName: '',
+
+        dangerReason: '',
+        rectifyCat: 1,
+        rectifyMeasure: '',
+        rectifyRemark: '',
+        rectifyTime: '',
+
+        acceptGroupId: undefined,
+        acceptGroupName: '',
+        acceptPositionId: undefined,
+        acceptPositionName: '',
+        acceptAccountId: undefined,
+        acceptAccountName: '',
+        acceptTime: '',
+
+        status: 0,
+
+        wfDefId: 1,
+        wfInsId: undefined,
+        wfInsTitle: '',
+
+        curActivityInsId: undefined,
+        curActivityInsTitle: '',
+
+        curGroupId: undefined,
+        curGroupName: '',
+        curPositionId: undefined,
+        curPositionName: '',
+        curAccountId: undefined,
+        curAccountName: '',
+
+        attachList: []
       },
-      rules: {},
-      alertLevelList: [
-        { label: '未知', value: 0 },
-        { label: '1级', value: 1 },
-        { label: '2级', value: 2 },
-        { label: '3级', value: 3 },
-        { label: '4级', value: 4 },
-        { label: '5级', value: 5 },
-        { label: '6级', value: 6 }
-      ],
-      actionType: ''
+      rules: {}
     }
   },
-  computed: {
-    ...mapGetters([
-      'userData'
-    ])
-  },
-  mounted() {
-  },
+  computed: {},
+  mounted() {},
   methods: {
 
-    // Show View
-    showView(alertId) {
-      this.dialogVisible = true
-      this.getData(alertId)
-    },
-
-    // 预览图片
-    previewPic(targetSrc) {
-      if (!targetSrc) {
-        this.$message({
-          type: 'info',
-          message: '未获取到图片地址!'
-        })
-        return
-      }
-      this.previewVisible = true
-      this.previewsrc = targetSrc
-    },
-
-    // Show View Model
-    getData(alertId) {
-      this.resetFormData()
-      getAlertById(alertId).then((resp) => {
+    // Fetch Data
+    getData(dangerId) {
+      getDangerById(dangerId).then((resp) => {
         const { code, data, msg } = resp
         if (code === 0) {
           this.viewData = data
+          this.$refs.ActivityHandleRecord.getData(dangerId)
         } else {
           this.$message.error(msg)
         }
@@ -191,26 +157,28 @@ export default {
       })
     },
 
-    // Reset Form Data
-    resetFormData() {
-      this.viewData = {
-        alertId: undefined,
-        alertTitle: '',
-        alertLevel: 0,
-        alertDesc: '',
-        status: 1,
-        groupId: this.userData.groupId, // 所属部门
-        positionId: undefined,
-        accountId: undefined
-      }
+    // Show View Info
+    showView(dangerId) {
+      this.eventList = []
+      this.dialogVisible = true
+      this.getData(dangerId)
     },
 
-    formSuccess() {
-      this.$emit('formSuccess')
+    previewPic(targetSrc) {
+      if (!targetSrc) {
+        this.$message({
+          type: 'info',
+          message: '未获取到图片地址!'
+        })
+        return
+      }
+      this.previewVisible = true
+      this.previewsrc = targetSrc
     }
   }
 }
 </script>
+
 <style lang="scss">
 </style>
 <style lang="scss" scoped>
@@ -364,8 +332,7 @@ export default {
     position: fixed;
     top: 50%;
     left: 50%;
-    transform: translate(-50%,-50%)
+    transform: translate(-50%, -50%)
   }
 }
-
 </style>

+ 95 - 70
src/views/goaf/alert/components/LeftCounter.vue

@@ -1,99 +1,137 @@
 <template>
   <div class="content-container">
-    <el-row class="list-group">
-      <div>
-        <el-row class="sub-title-bar">
-          <p class="sub-title">按状态</p>
-        </el-row>
+    <el-row class="content-title">
+      <span>{{ title }}</span>
+    </el-row>
 
-        <div :class="curSel === 'status0' ? 'list-item active' : 'list-item'" @click="selectItem('status',0)">
-          <el-col :span="18">
-            <p class="title">未提交</p>
-          </el-col>
-        </div>
+    <el-row class="btn-group">
+      <el-button class="send-menu" @click="handleSubmitTask">登记隐患</el-button>
+    </el-row>
 
-        <div :class="curSel === 'status1' ? 'list-item active' : 'list-item'" @click="selectItem('status',1)">
+    <!-- <el-row class="list-group">
+      <div>
+        <div :class="curSel === 1 ? 'list-item active' : 'list-item'" @click="selectItem(1)">
           <el-col :span="18">
             <p class="title">处理中</p>
           </el-col>
         </div>
-
-        <div :class="curSel === 'status2' ? 'list-item active' : 'list-item'" @click="selectItem('status',2)">
+        <div :class="curSel === 2 ? 'list-item active' : 'list-item'" @click="selectItem(2)">
           <el-col :span="18">
             <p class="title">完成</p>
           </el-col>
         </div>
-        <div :class="curSel === 'status-1' ? 'list-item active' : 'list-item'" @click="selectItem('status',-1)">
+        <div :class="curSel === -1 ? 'list-item active' : 'list-item'" @click="selectItem(-1)">
           <el-col :span="18">
             <p class="title">撤销</p>
           </el-col>
         </div>
-      </div>
-
-      <div>
-        <el-row class="sub-title-bar">
-          <p class="sub-title">按等级</p>
-        </el-row>
-        <div :class="curSel === 'hdangerLevel0' ? 'list-item active' : 'list-item'" @click="selectItem('hdangerLevel',0)">
+        <div :class="curSel === 0 ? 'list-item active' : 'list-item'" @click="selectItem(0)">
           <el-col :span="18">
-            <p class="title">较低</p>
-          </el-col>
-        </div>
-        <div :class="curSel === 'hdangerLevel1' ? 'list-item active' : 'list-item'" @click="selectItem('hdangerLevel',1)">
-          <el-col :span="18">
-            <p class="title">一般</p>
-          </el-col>
-        </div>
-
-        <div :class="curSel === 'hdangerLevel2' ? 'list-item active' : 'list-item'" @click="selectItem('hdangerLevel',2)">
-          <el-col :span="18">
-            <p class="title">较大</p>
-          </el-col>
-        </div>
-
-        <div :class="curSel === 'hdangerLevel3' ? 'list-item active' : 'list-item'" @click="selectItem('hdangerLevel',3)">
-          <el-col :span="18">
-            <p class="title">重大</p>
+            <p class="title">未提交</p>
           </el-col>
         </div>
       </div>
-    </el-row>
+    </el-row> -->
+    <submit-task ref="SubmitTask" title="隐患登记" @formSuccess="selectItem(curSel)" />
   </div>
 </template>
 <script>
+
+import SubmitTask from '../activity/Submit'
+import { getDangerCounter } from '@/api/goaf/dangerStatisApi'
+
 export default {
-  name: 'AlertCounter',
-  components: { },
+  components: {
+    SubmitTask
+  },
+  props: {
+    value: {
+      type: String,
+      default: ''
+    }
+  },
   data() {
     return {
-      title: '预警中心',
-      listLoading: false,
-      curSel: ''
+      title: '隐患管理',
+      dangerCounter: {
+        myCreatedCount: 0,
+        myHandlingCount: 0,
+        myHandledCount: 0,
+        myCanceledCount: 0,
+        groupHandlingCount: 0,
+        groupSubmitCount: 0,
+        groupReviewCount: 0,
+        groupRectifyCount: 0,
+        groupAcceptCount: 0
+      },
+      curSel: 1
     }
   },
+
+  mounted() {
+    // this.loadData()
+    // this.selectItem(this.curSel)
+  },
   methods: {
-    // 选中事件
-    selectItem(type, val) {
-      this.curSel = `${type}${val}`
-      this.$emit('selectItem', {
-        type, val
+    // 加载数据
+    loadData() {
+      this.getData()
+    },
+
+    // 添加
+    handleSubmitTask() {
+      this.$refs['SubmitTask'].start()
+    },
+
+    // 初始化
+    getData() {
+      getDangerCounter().then((resp) => {
+        const { code, data, msg } = resp
+        if (code === 0) {
+          this.dangerCounter = data
+        } else {
+          this.$message.error(msg)
+        }
+      }).catch((error) => {
+        console.log(error)
       })
+    },
+
+    // “选择” 处理
+    selectItem(val) {
+      this.curSel = val
+      this.$emit('selectItem', val)
     }
   }
 }
 </script>
 <style lang="scss" scoped>
 .content-container {
-  height: calc(100vh - 145px);
-  padding-bottom: 0;
-  margin: 10px 10px 0 0;
+  margin: 10px;
+  padding: 10px;
+  height: calc(100vh - 95px);
+
+  .title-bar {
+    height: 40px;
+    line-height: 40px;
+    text-indent: 15px;
+    background: #113849;
+
+    .content-title {
+      font-size: 16px;
+      color: #FFF;
+      margin: 0;
+      font-weight: bold;
+    }
+  }
 
   .sub-title-bar {
     height: 40px;
     line-height: 40px;
     text-indent: 15px;
     background: #113849;
-    margin-bottom: 10px;
+    margin-top: 10px;
+    margin-bottom: 5px;
 
     .sub-title {
       font-size: 16px;
@@ -103,8 +141,8 @@ export default {
   }
 
   .btn-group {
-    margin-top: 25px;
-    margin-bottom: 10px;
+    margin-top: 20px;
+
     .send-menu {
       width: 90%;
       background: #3D5F76;
@@ -120,8 +158,6 @@ export default {
   }
 
   .list-group {
-    margin-top: 0;
-    padding-top: 0;
     background: #193142;
 
     p {
@@ -137,7 +173,7 @@ export default {
       height: 40px;
       line-height: 40px;
       color: #FFF;
-      padding: 0 10px;
+      padding: 0 30px;
       font-size: 14px;
 
       &.active {
@@ -161,14 +197,3 @@ export default {
   }
 }
 </style>
-<style lang="scss">
-  .vue-treeselect{
-    .vue-treeselect__control{
-      background-color: inherit;
-      border: 1px solid rgba(255, 255, 255, 0.1);
-      .vue-treeselect__single-value{
-        color: #fff;
-      }
-    }
-  }
-</style>

+ 350 - 85
src/views/goaf/alert/index.vue

@@ -1,123 +1,388 @@
 <template>
-  <div class="page-container">
-    <el-row class="content-body">
-      <el-col :span="4">
-        <left-counter ref="LeftCounter" @selectItem="selectItem" />
+  <div class="content-container">
+    <el-row class="tool-bar">
+      <el-col :span="8" class="left">
+        <div class="content-title">
+          {{ title }}
+        </div>
       </el-col>
-      <el-col :span="20">
-        <alert-list ref="AlertList" @actionUpdate="actionUpdate" />
+
+      <el-col :span="16" class="button-group">
+        <div class="select-search right">
+          <el-cascader
+            v-model="conditions.reviewGroupId"
+            :options="treeData"
+            :props="{ checkStrictly: true, emitPath: false }"
+            style="min-width: 160px"
+            filterable
+            clearable
+            placeholder="部门"
+            @change="handleChange"
+          >
+            <template slot-scope="{ node, data }">
+              <span>{{ data.label }}</span>
+              <span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
+            </template>
+          </el-cascader>
+          <el-select v-model="conditions.reviewAccountId" style="width:100px;margin:0 10px" filterable clearable placeholder="执行人">
+            <el-option v-for="item in userList" :key="item.accountId" :value="item.accountId" :label="item.accountName" />
+          </el-select>
+          <el-select v-model="conditions.hdangerLevel" style="width: 80px;" filterable placeholder="级别" clearable>
+            <el-option :value="0" label="较低" />
+            <el-option :value="1" label="一般" />
+            <el-option :value="2" label="较大" />
+            <el-option :value="3" label="重大" />
+          </el-select>
+          <el-select v-model="conditions.hdangerType" style="width: 110px;margin:0 10px" filterable placeholder="类型" clearable>
+            <el-option :value="0" label="人员巡检" />
+            <el-option :value="1" label="传感器" />
+          </el-select>
+          <div>
+            <el-select v-model="conditions.goafOrebelt" style="width: 110px;" filterable placeholder="矿带" clearable @change="changeArea(1)">
+              <el-option v-for="(item,index) in goafOrebelts" :key="index" :value="item" :label="item" />
+            </el-select>
+            <el-select v-model="conditions.goafOrebody" style="width: 110px;margin-left:10px" filterable placeholder="矿体" clearable @change="changeArea(2)">
+              <el-option v-for="(item,index) in goafOrebodys" :key="index" :value="item.goafOrebody" :label="item.goafOrebody" />
+            </el-select>
+            <el-select v-model="conditions.goafOreheight" style="width: 110px;margin:0 10px" filterable placeholder="中段" clearable @change="changeArea(3)">
+              <el-option v-for="(item,index) in goafOreheights" :key="index" :value="item.goafOreheight" :label="item.goafOreheight" />
+            </el-select>
+            <el-select v-model="conditions.goafId" style="width: 150px;" filterable placeholder="采空区编号" clearable @change="changeArea(4)">
+              <el-option v-for="item in goafNames" :key="item.goafId" :value="item.goafId" :label="item.goafName" />
+            </el-select>
+          </div>
+          <el-date-picker
+            v-model="conditions.startSubmitTime"
+            type="date"
+            placeholder="开始时间"
+            format="yyyy-MM-dd HH:mm:ss"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            clearable
+            style="width: 180px;margin:0 10px"
+          />
+          <el-date-picker
+            v-model="conditions.endSubmitTime"
+            type="date"
+            placeholder="结束时间"
+            format="yyyy-MM-dd HH:mm:ss"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            clearable
+            style="width: 180px;margin:0 10px"
+          />
+          <el-input v-model="conditions.hdangerTitle" class="search-input" placeholder="请输入内容">
+            <el-button slot="append" icon="el-icon-search" @click="getData()" />
+          </el-input>
+        </div>
       </el-col>
     </el-row>
+
+    <el-row class="content-body">
+      <el-table v-loading="listLoading" class="page-table" border :data="dataList" height="calc(100vh - 230px)">
+
+        <el-table-column type="index" label="序号" header-align="center" align="center" width="60" />>
+        <el-table-column prop="hdangerTitle" label="隐患名称" header-align="left" align="left">
+          <template v-slot="{row}">
+            <span>{{ row.hdangerTitle }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="hdangerLevel" label="级别" header-align="center" align="center" width="80">
+          <template v-slot="{row}">
+            <span><el-tag type="success" effect="plain" color="rgb(38 69 90)">{{ row.hdangerLevel | dangerLevelFilter }}</el-tag></span>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="status" label="状态" header-align="center" align="center" width="80">
+          <template v-slot="{row}">
+            <span><el-tag type="warning" effect="plain" color="rgb(38 69 90)">{{ row.status | dangerStatusFilter }}</el-tag></span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="curActivityTitle" label="当前关卡" header-align="center" align="center" width="80">
+          <template v-slot="{row}">
+            <span><el-tag type="danger" effect="plain" color="rgb(38 69 90)">{{ row.curActivityTitle }}</el-tag></span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="curAccountName" label="当前处理人" header-align="center" align="center" width="160">
+          <template v-slot="{row}">
+            <span><i class="el-icon-user-solid" />{{ row.curAccountName }}( {{ row.curPositionName }} )</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="dangerDeadline" label="整改期限" header-align="center" align="center" width="165">
+          <template v-slot="{row}">
+            <span><i class="el-icon-timer" />{{ row.dangerDeadline }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column label="操作" header-align="center" align="center" width="180">
+          <template v-slot="{row}">
+            <el-button v-if="row.curAccountId===userData.userId" type="primary" size="mini" @click="handleDanger(row)">处理</el-button>
+            <el-button size="mini" type="info" @click="handleDetail(row)">详情</el-button>
+            <el-button v-if="row.submitAccountId===userData.userId" size="mini" type="danger" @click="handleDelete(row)">删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <div class="pagination-container">
+        <pagination v-show="total>0" :total="total" :page.sync="conditions.page" :limit.sync="conditions.limit" @pagination="getData" />
+      </div>
+    </el-row>
+    <submit-activity ref="submit" title="登记隐患" @formSuccess="formSuccess" />
+    <review-activity ref="review" title="隐患评审" @formSuccess="formSuccess" />
+    <rectify-activity ref="rectify" title="隐患整改" @formSuccess="formSuccess" />
+    <accept-activity ref="accept" title="隐患验收" @formSuccess="formSuccess" />
+    <danger-details ref="DangerDetails" title="隐患详情" />
   </div>
 </template>
 
 <script>
-import LeftCounter from './components/LeftCounter'
-import AlertList from './components/AlertList'
+import Pagination from '@/components/Pagination'
+
+import { getGoafBaseInfo } from '@/api/goaf/info'
+import { getGroupByList } from '@/api/system/groupApi'
+import { getUserByPage } from '@/api/system/userApi'
+import { toTree } from '@/utils/build-tree'
 
+import { deleteDangerById, getDangerByPage } from '@/api/goaf/dangerApi'
+import DangerDetails from '@/views/goaf/danger/components/Details.vue'
+import { mapGetters } from 'vuex'
+import SubmitActivity from './activity/Submit'
+import ReviewActivity from './activity/Review'
+import RectifyActivity from './activity/Rectify'
+import AcceptActivity from './activity/Accept'
 export default {
-  name: 'AlertCenter',
-  components: { LeftCounter, AlertList },
+  name: 'DangerList',
+  components: { Pagination, SubmitActivity, ReviewActivity, RectifyActivity, AcceptActivity, DangerDetails },
+  filters: {
+    dangerLevelFilter(val) {
+      const status = ['较低', '一般', '较大', '重大']
+      return status[val]
+    },
+    dangerStatusFilter(val) {
+      const status = ['待提交', '待评审', '待整改', '待验收', '完成']
+      return val === -1 ? '撤销' : status[val]
+    }
+  },
+  props: {
+    title: {
+      type: [String],
+      default: '预警中心'
+    }
+  },
   data() {
     return {
-      title: '预警中心',
+      dataList: [],
+      total: 0,
+      listLoading: false,
       conditions: {
-        status: undefined,
+        page: 1,
+        limit: 10,
+        status: 1,
+        startSubmitTime: undefined,
+        endSubmitTime: undefined,
+        goafId: undefined,
+        goafOrebelt: undefined,
+        goafOrebody: undefined,
+        goafOreheight: undefined,
+        reviewGroupId: undefined,
+        reviewAccountId: undefined,
         hdangerLevel: undefined
-      }
+      },
+      goafList: [],
+      goafOrebelts: [],
+      goafOrebodys: [],
+      goafOreheights: [],
+      goafNames: [],
+      treeData: [],
+      userList: []
     }
   },
+  computed: {
+    ...mapGetters([
+      'userData'
+    ])
+  },
+  created() {
+    this.getData()
+    getGoafBaseInfo().then((res) => {
+      const goafOrebelts = res.data.map(item => item.goafOrebelt)
+      this.goafOrebelts = [...new Set(goafOrebelts)]
+      this.goafList = res.data
+    })
+    getGroupByList().then((resp) => {
+      const { code, data } = resp
+      if (code === 0) {
+        const temp = toTree(
+          data,
+          {
+            value: 'value',
+            name: 'label',
+            pValue: 'parentId'
+          },
+          {
+            value: 'groupId',
+            name: 'groupName',
+            pValue: 'parentId'
+          }
+        )
+        this.treeData = temp
+      }
+    })
+    getUserByPage({
+      page: 1,
+      limit: 999999
+    }).then((resp) => {
+      const { data } = resp
+      this.userList = data
+    })
+  },
   methods: {
-
-    // 加载数据
-    selectItem({ type, val }) {
-      this.resetConditions()
-      if (type) {
-        this.conditions[type] = val
+    changeArea(type) {
+      const goafs = this.deeepClone(this.goafList)
+      let goafOrebodys = this.deeepClone(this.goafOrebodys)
+      let goafOreheights = this.deeepClone(this.goafOreheights)
+      let goafNames = this.deeepClone(this.goafNames)
+      if (type === 1) {
+        goafOrebodys = goafs.filter(item => item.goafOrebelt === this.conditions.goafOrebelt)
+        this.goafOrebodys = goafOrebodys
+        this.goafOreheights = []
+        this.goafNames = []
+        this.conditions.goafOrebody = ''
+        this.conditions.goafOreheight = ''
+        this.conditions.goafName = ''
+      } else if (type === 2) {
+        goafOreheights = goafs.filter(item => (item.goafOrebody === this.conditions.goafOrebody) && (item.goafOrebelt === this.conditions.goafOrebelt))
+        this.goafOreheights = goafOreheights
+        this.goafNames = []
+        this.conditions.goafOreheight = ''
+        this.conditions.goafName = ''
+      } else if (type === 3) {
+        goafNames = goafs.filter(item => (item.goafOreheight === this.conditions.goafOreheight) && (item.goafOrebody === this.conditions.goafOrebody) && (item.goafOrebelt === this.conditions.goafOrebelt))
+        this.goafNames = goafNames
+        this.conditions.goafName = ''
+      } else {
+        for (let i = 0; i < goafNames.length; i++) {
+          if (this.conditions.goafId === goafNames[i].goafId) {
+            this.conditions.goafName = goafNames[i].goafName
+          }
+        }
       }
-      this.loadData()
+      this.$forceUpdate()
+    },
+    handleChange(groupId) {
+      getUserByPage({
+        page: 1,
+        limit: 999999,
+        groupId
+      }).then((resp) => {
+        const { data } = resp
+        this.userList = data
+      })
     },
-
     // 重置查询条件
     resetConditions() {
+      this.conditions.keywords = ''
       this.conditions.status = undefined
-      this.conditions.hdangerLevel = undefined
+      this.conditions.submitAccountId = undefined
+      this.conditions.handleAccountId = undefined
+      this.conditions.curAccountId = undefined
+      this.conditions.groupId = undefined
     },
 
-    // 操作更新
-    actionUpdate() {
-      this.$refs['LeftCounter'].loadData()
+    // 加载数据
+    loadData(action) {
+      this.conditions = { ...this.conditions, ...action }
+      this.getData()
     },
 
-    //
-    loadData() {
-      if (this.conditions.status === undefined) {
-        delete this.conditions.status
-      }
-      if (this.conditions.hdangerLevel === undefined) {
-        delete this.conditions.hdangerLevel
+    // Fetch Data
+    getData() {
+      this.listLoading = true
+      for (const key in this.conditions) {
+        if (this.conditions[key] === '' || this.conditions[key] === undefined) {
+          delete this.conditions[key]
+        }
       }
-      this.$refs['AlertList'].loadData(this.conditions)
+      getDangerByPage(this.conditions).then((resp) => {
+        const { code, data, total, msg } = resp
+        this.listLoading = false
+        if (code === 0) {
+          this.total = total
+          this.dataList = data
+        } else {
+          this.$message.error(msg)
+        }
+      }).catch((error) => {
+        console.log(error)
+      })
+    },
+
+    // 流程处理
+    handleDanger(data) {
+      const { hdangerId, curActivityCode } = data
+      this.$refs[curActivityCode].showModel(hdangerId, data)
+    },
+
+    // Delete Handler
+    handleDelete(data) {
+      const { hdangerId, hdangerTitle } = data
+      this.$confirm(`此操作将删除该数据${hdangerTitle}, 是否继续?`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        deleteDangerById(hdangerId).then((resp) => {
+          const { code, msg } = resp
+          if (code === 0) {
+            this.$message.success(msg)
+            this.getData()
+          } else {
+            this.$message.error(msg)
+          }
+        }).catch((error) => {
+          console.log(error)
+        })
+      }).catch(() => {
+        this.$message({ type: 'info', message: '已取消删除' })
+      })
     },
 
-    // 导出
-    handleExport() {
+    // Show Details
+    handleDetail(data) {
+      const { hdangerId } = data
+      this.$refs['DangerDetails'].showView(hdangerId, JSON.parse(JSON.stringify(data)))
+    },
+
+    // Update View
+    formSuccess() {
+      this.getData()
+      this.$emit('actionUpdate')
+    },
 
+    // Preview Photo
+    previewList(photos) {
+      if (Array.isArray(photos)) {
+        const list = photos.map((item) => {
+          return item
+        })
+        return list
+      }
+      return [photos]
+    },
+    deeepClone(params) {
+      return JSON.parse(JSON.stringify(params))
     }
   }
 }
 </script>
-
 <style lang="scss" scoped>
-.page-container {
+.content-container {
   margin: 10px;
-  height: calc(100vh - 145px);
-  p {
-    margin: 0;
-    line-height: 2em;
-    padding: 0;
-  }
-  .tool-bar {
-    .page-title {
-      margin-top: 10px;
-      margin-left: 10px;
-      font-weight: bold;
-      font-size: 18px;
-      color: #fff;
-    }
-  }
-  .tool-bar .button-group {
-    overflow: unset;
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-    flex-wrap: wrap;
-
-    .select-search{
-      margin-left: 20px;
-      display: flex;
-      justify-content: flex-start;
-      align-items: center;
-    }
-
-    .search-label {
-      text-align: right;
-      font-size: 12px;
-      font-weight: 400;
-      color: #FFFFFF;
-      line-height: 1;
-      span {
-        font-size: 20px;
-        font-weight: 400;
-        color: #FFFFFF;
-      }
-    }
-  }
-
-  .content-body {
-    padding-top: 0;
-    margin-top: 0;
-  }
+  height: calc(100vh - 95px);
+}
+.select-search {
+  display: flex;
+  flex-wrap: wrap;
+  justify-content: flex-end;
 }
-
 </style>

+ 389 - 0
src/views/goaf/alert/rectify.vue

@@ -0,0 +1,389 @@
+<template>
+  <div class="content-container">
+    <el-row class="tool-bar">
+      <el-col :span="8" class="left">
+        <div class="content-title">
+          {{ title }}
+        </div>
+      </el-col>
+
+      <el-col :span="16" class="button-group">
+        <div class="select-search right">
+          <el-cascader
+            v-model="conditions.reviewGroupId"
+            :options="treeData"
+            :props="{ checkStrictly: true, emitPath: false }"
+            style="min-width: 160px"
+            filterable
+            clearable
+            placeholder="部门"
+            @change="handleChange"
+          >
+            <template slot-scope="{ node, data }">
+              <span>{{ data.label }}</span>
+              <span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
+            </template>
+          </el-cascader>
+          <el-select v-model="conditions.reviewAccountId" style="width:100px;margin:0 10px" filterable clearable placeholder="执行人">
+            <el-option v-for="item in userList" :key="item.accountId" :value="item.accountId" :label="item.accountName" />
+          </el-select>
+          <el-select v-model="conditions.hdangerLevel" style="width: 80px;" filterable placeholder="级别" clearable>
+            <el-option :value="0" label="较低" />
+            <el-option :value="1" label="一般" />
+            <el-option :value="2" label="较大" />
+            <el-option :value="3" label="重大" />
+          </el-select>
+          <el-select v-model="conditions.hdangerType" style="width: 110px;margin:0 10px" filterable placeholder="类型" clearable>
+            <el-option :value="0" label="人员巡检" />
+            <el-option :value="1" label="传感器" />
+          </el-select>
+          <div>
+            <el-select v-model="conditions.goafOrebelt" style="width: 110px;" filterable placeholder="矿带" clearable @change="changeArea(1)">
+              <el-option v-for="(item,index) in goafOrebelts" :key="index" :value="item" :label="item" />
+            </el-select>
+            <el-select v-model="conditions.goafOrebody" style="width: 110px;margin-left:10px" filterable placeholder="矿体" clearable @change="changeArea(2)">
+              <el-option v-for="(item,index) in goafOrebodys" :key="index" :value="item.goafOrebody" :label="item.goafOrebody" />
+            </el-select>
+            <el-select v-model="conditions.goafOreheight" style="width: 110px;margin:0 10px" filterable placeholder="中段" clearable @change="changeArea(3)">
+              <el-option v-for="(item,index) in goafOreheights" :key="index" :value="item.goafOreheight" :label="item.goafOreheight" />
+            </el-select>
+            <el-select v-model="conditions.goafId" style="width: 150px;" filterable placeholder="采空区编号" clearable @change="changeArea(4)">
+              <el-option v-for="item in goafNames" :key="item.goafId" :value="item.goafId" :label="item.goafName" />
+            </el-select>
+          </div>
+          <el-date-picker
+            v-model="conditions.startSubmitTime"
+            type="date"
+            placeholder="开始时间"
+            format="yyyy-MM-dd HH:mm:ss"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            clearable
+            style="width: 180px;margin:0 10px"
+          />
+          <el-date-picker
+            v-model="conditions.endSubmitTime"
+            type="date"
+            placeholder="结束时间"
+            format="yyyy-MM-dd HH:mm:ss"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            clearable
+            style="width: 180px;margin:0 10px"
+          />
+          <el-input v-model="conditions.hdangerTitle" class="search-input" placeholder="请输入内容">
+            <el-button slot="append" icon="el-icon-search" @click="getData()" />
+          </el-input>
+        </div>
+      </el-col>
+    </el-row>
+
+    <el-row class="content-body">
+      <el-table v-loading="listLoading" class="page-table" border :data="dataList" height="calc(100vh - 230px)">
+
+        <el-table-column type="index" label="序号" header-align="center" align="center" width="60" />>
+        <el-table-column prop="hdangerTitle" label="隐患名称" header-align="left" align="left">
+          <template v-slot="{row}">
+            <span>{{ row.hdangerTitle }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="hdangerLevel" label="级别" header-align="center" align="center" width="80">
+          <template v-slot="{row}">
+            <span><el-tag type="success" effect="plain" color="rgb(38 69 90)">{{ row.hdangerLevel | dangerLevelFilter }}</el-tag></span>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="status" label="状态" header-align="center" align="center" width="80">
+          <template v-slot="{row}">
+            <span><el-tag type="warning" effect="plain" color="rgb(38 69 90)">{{ row.status | dangerStatusFilter }}</el-tag></span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="curActivityTitle" label="当前关卡" header-align="center" align="center" width="80">
+          <template v-slot="{row}">
+            <span><el-tag type="danger" effect="plain" color="rgb(38 69 90)">{{ row.curActivityTitle }}</el-tag></span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="curAccountName" label="当前处理人" header-align="center" align="center" width="160">
+          <template v-slot="{row}">
+            <span><i class="el-icon-user-solid" />{{ row.curAccountName }}( {{ row.curPositionName }} )</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="dangerDeadline" label="整改期限" header-align="center" align="center" width="165">
+          <template v-slot="{row}">
+            <span><i class="el-icon-timer" />{{ row.dangerDeadline }}</span>
+          </template>
+        </el-table-column>
+
+        <el-table-column label="操作" header-align="center" align="center" width="180">
+          <template v-slot="{row}">
+            <el-button v-if="row.curAccountId===userData.userId" type="primary" size="mini" @click="handleDanger(row)">处理</el-button>
+            <el-button size="mini" type="info" @click="handleDetail(row)">详情</el-button>
+            <el-button v-if="row.submitAccountId===userData.userId" size="mini" type="danger" @click="handleDelete(row)">删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <div class="pagination-container">
+        <pagination v-show="total>0" :total="total" :page.sync="conditions.page" :limit.sync="conditions.limit" @pagination="getData" />
+      </div>
+    </el-row>
+    <submit-activity ref="submit" title="登记隐患" @formSuccess="formSuccess" />
+    <review-activity ref="review" title="隐患评审" @formSuccess="formSuccess" />
+    <rectify-activity ref="rectify" title="隐患整改" @formSuccess="formSuccess" />
+    <accept-activity ref="accept" title="隐患验收" @formSuccess="formSuccess" />
+    <danger-details ref="DangerDetails" title="隐患详情" />
+  </div>
+</template>
+
+<script>
+import Pagination from '@/components/Pagination'
+
+import { getGoafBaseInfo } from '@/api/goaf/info'
+import { getGroupByList } from '@/api/system/groupApi'
+import { getUserByPage } from '@/api/system/userApi'
+import { toTree } from '@/utils/build-tree'
+
+import { deleteDangerById, getDangerByPage } from '@/api/goaf/dangerApi'
+import DangerDetails from '@/views/goaf/danger/components/Details.vue'
+import { mapGetters } from 'vuex'
+import SubmitActivity from './activity/Submit'
+import ReviewActivity from './activity/Review'
+import RectifyActivity from './activity/Rectify'
+import AcceptActivity from './activity/Accept'
+export default {
+  name: 'DangerList',
+  components: { Pagination, SubmitActivity, ReviewActivity, RectifyActivity, AcceptActivity, DangerDetails },
+  filters: {
+    dangerLevelFilter(val) {
+      const status = ['较低', '一般', '较大', '重大']
+      return status[val]
+    },
+    dangerStatusFilter(val) {
+      const status = ['待提交', '待评审', '待整改', '待验收', '完成']
+      return val === -1 ? '撤销' : status[val]
+    }
+  },
+  props: {
+    title: {
+      type: [String],
+      default: '预警中心'
+    }
+  },
+  data() {
+    return {
+      dataList: [],
+      total: 0,
+      listLoading: false,
+      conditions: {
+        page: 1,
+        limit: 10,
+        status: 2,
+        startSubmitTime: undefined,
+        endSubmitTime: undefined,
+        goafId: undefined,
+        goafOrebelt: undefined,
+        goafOrebody: undefined,
+        goafOreheight: undefined,
+        reviewGroupId: undefined,
+        reviewAccountId: undefined,
+        hdangerLevel: undefined
+      },
+      goafList: [],
+      goafOrebelts: [],
+      goafOrebodys: [],
+      goafOreheights: [],
+      goafNames: [],
+      treeData: [],
+      userList: []
+    }
+  },
+  computed: {
+    ...mapGetters([
+      'userData'
+    ])
+  },
+  created() {
+    this.getData()
+    getGoafBaseInfo().then((res) => {
+      const goafOrebelts = res.data.map(item => item.goafOrebelt)
+      this.goafOrebelts = [...new Set(goafOrebelts)]
+      this.goafList = res.data
+    })
+    getGroupByList().then((resp) => {
+      const { code, data } = resp
+      if (code === 0) {
+        const temp = toTree(
+          data,
+          {
+            value: 'value',
+            name: 'label',
+            pValue: 'parentId'
+          },
+          {
+            value: 'groupId',
+            name: 'groupName',
+            pValue: 'parentId'
+          }
+        )
+        this.treeData = temp
+      }
+    })
+    getUserByPage({
+      page: 1,
+      limit: 999999
+    }).then((resp) => {
+      const { data } = resp
+      this.userList = data
+    })
+  },
+  methods: {
+    changeArea(type) {
+      const goafs = this.deeepClone(this.goafList)
+      let goafOrebodys = this.deeepClone(this.goafOrebodys)
+      let goafOreheights = this.deeepClone(this.goafOreheights)
+      let goafNames = this.deeepClone(this.goafNames)
+      if (type === 1) {
+        goafOrebodys = goafs.filter(item => item.goafOrebelt === this.conditions.goafOrebelt)
+        this.goafOrebodys = goafOrebodys
+        this.goafOreheights = []
+        this.goafNames = []
+        this.conditions.goafOrebody = ''
+        this.conditions.goafOreheight = ''
+        this.conditions.goafName = ''
+      } else if (type === 2) {
+        goafOreheights = goafs.filter(item => (item.goafOrebody === this.conditions.goafOrebody) && (item.goafOrebelt === this.conditions.goafOrebelt))
+        this.goafOreheights = goafOreheights
+        this.goafNames = []
+        this.conditions.goafOreheight = ''
+        this.conditions.goafName = ''
+      } else if (type === 3) {
+        goafNames = goafs.filter(item => (item.goafOreheight === this.conditions.goafOreheight) && (item.goafOrebody === this.conditions.goafOrebody) && (item.goafOrebelt === this.conditions.goafOrebelt))
+        this.goafNames = goafNames
+        this.conditions.goafName = ''
+      } else {
+        for (let i = 0; i < goafNames.length; i++) {
+          if (this.conditions.goafId === goafNames[i].goafId) {
+            this.conditions.goafName = goafNames[i].goafName
+          }
+        }
+      }
+      this.$forceUpdate()
+    },
+    handleChange(groupId) {
+      getUserByPage({
+        page: 1,
+        limit: 999999,
+        groupId
+      }).then((resp) => {
+        const { data } = resp
+        this.userList = data
+      })
+    },
+    // 重置查询条件
+    resetConditions() {
+      this.conditions.keywords = ''
+      this.conditions.status = undefined
+      this.conditions.submitAccountId = undefined
+      this.conditions.handleAccountId = undefined
+      this.conditions.curAccountId = undefined
+      this.conditions.groupId = undefined
+    },
+
+    // 加载数据
+    loadData(action) {
+      this.conditions = { ...this.conditions, ...action }
+      this.getData()
+    },
+
+    // Fetch Data
+    getData() {
+      this.listLoading = true
+      for (const key in this.conditions) {
+        if (this.conditions[key] === '' || this.conditions[key] === undefined) {
+          delete this.conditions[key]
+        }
+      }
+      getDangerByPage(this.conditions).then((resp) => {
+        const { code, data, total, msg } = resp
+        this.listLoading = false
+        if (code === 0) {
+          this.total = total
+          this.dataList = data
+        } else {
+          this.$message.error(msg)
+        }
+      }).catch((error) => {
+        console.log(error)
+      })
+    },
+
+    // 流程处理
+    handleDanger(data) {
+      const { hdangerId, curActivityCode } = data
+      this.$refs[curActivityCode].showModel(hdangerId, data)
+    },
+
+    // Delete Handler
+    handleDelete(data) {
+      const { hdangerId, hdangerTitle } = data
+      this.$confirm(`此操作将删除该数据${hdangerTitle}, 是否继续?`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        deleteDangerById(hdangerId).then((resp) => {
+          const { code, msg } = resp
+          if (code === 0) {
+            this.$message.success(msg)
+            this.getData()
+          } else {
+            this.$message.error(msg)
+          }
+        }).catch((error) => {
+          console.log(error)
+        })
+      }).catch(() => {
+        this.$message({ type: 'info', message: '已取消删除' })
+      })
+    },
+
+    // Show Details
+    handleDetail(data) {
+      const { hdangerId } = data
+      this.$refs['DangerDetails'].showView(hdangerId, JSON.parse(JSON.stringify(data)))
+    },
+
+    // Update View
+    formSuccess() {
+      this.getData()
+      this.$emit('actionUpdate')
+    },
+
+    // Preview Photo
+    previewList(photos) {
+      if (Array.isArray(photos)) {
+        const list = photos.map((item) => {
+          return item
+        })
+        return list
+      }
+      return [photos]
+    },
+    deeepClone(params) {
+      return JSON.parse(JSON.stringify(params))
+    }
+  }
+}
+</script>
+  <style lang="scss" scoped>
+  .content-container {
+    margin: 10px;
+    height: calc(100vh - 95px);
+  }
+  .select-search {
+    display: flex;
+    flex-wrap: wrap;
+    justify-content: flex-end;
+  }
+  </style>
+

+ 13 - 22
src/views/goaf/checklist/components/ChecklistEdit.vue

@@ -17,14 +17,9 @@
         <vuescroll :ops="ops">
           <el-table border :data="dataList" height="60vh">
             <el-table-column type="index" label="检查项" header-align="center" align="center" width="80" />
-            <el-table-column prop="checklistTitle" label="检查项">
+            <el-table-column prop="checklistItemContent" label="检查项">
               <template v-slot="{row}">
-                <span><i class="el-icon-tickets" /> {{ row.checklistTitle }}</span>
-              </template>
-            </el-table-column>
-            <el-table-column prop="checklistDesc" label="说明" header-align="left" align="left">
-              <template v-slot="{row}">
-                <span>{{ row.checklistDesc }}</span>
+                <span><i class="el-icon-tickets" /> {{ row.checklistItemContent }}</span>
               </template>
             </el-table-column>
             <el-table-column label="操作" header-align="center" align="center" width="180">
@@ -44,7 +39,7 @@
   </el-drawer>
 </template>
 <script>
-import { deleteChecklistItemById } from '@/api/goaf/check'
+import { deleteChecklistItemById, getChecklistItemById } from '@/api/goaf/check'
 import Vuescroll from 'vuescroll'
 import ChecklistItem from './ChecklistItem.vue'
 export default {
@@ -95,23 +90,17 @@ export default {
   },
   methods: {
     getData() {
-
+      getChecklistItemById(this.viewData.checklistId).then((res) => {
+        this.dataList = res.data
+      })
     },
     // Show Edit Dialog
     showEditModel(data) {
       this.resetFormData()
       this.dialogVisible = true
       this.viewData = data
-      const items = []
-      for (let i = 0; i < 20; i++) {
-        items.push({
-          'checklistTitle': `检查项${i + 1}`,
-          'checklistDesc': `检查项${i + 1}描述`
-        })
-      }
-      this.dataList = items
+      this.getData()
     },
-
     // Reset Form Data
     resetFormData() {
       this.formData = {
@@ -127,16 +116,18 @@ export default {
       this.$refs['checklist-item'].showAddModel(JSON.parse(JSON.stringify(this.viewData)))
     },
     handleUpdate(data) {
-      this.$refs['checklist-item'].showEditModel(JSON.parse(JSON.stringify(data)))
+      const checkListItem = JSON.parse(JSON.stringify(data))
+      const checkList = JSON.parse(JSON.stringify(this.viewData))
+      this.$refs['checklist-item'].showEditModel({ ...checkListItem, ...checkList })
     },
     handleDelete(data) {
-      const { checklistId, checklistTitle } = data
-      this.$confirm(`此操作将删除该数据${checklistTitle}, 是否继续?`, '提示', {
+      const { checklistItemId, checklistItemContent } = data
+      this.$confirm(`此操作将删除该数据${checklistItemContent}, 是否继续?`, '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        deleteChecklistItemById(checklistId).then((resp) => {
+        deleteChecklistItemById(checklistItemId).then((resp) => {
           const { code, msg } = resp
           if (code === 0) {
             this.getData()

+ 5 - 7
src/views/goaf/checklist/components/ChecklistItem.vue

@@ -10,9 +10,6 @@
         <el-form-item label="检查项名称" prop="checklistItemContent">
           <el-input v-model="formData.checklistItemContent" placeholder="输入检查项名称" />
         </el-form-item>
-        <!-- <el-form-item label="说明">
-          <el-input v-model="formData.checklistItemContent" type="textarea" rows="5" placeholder="输入说明" />
-        </el-form-item> -->
       </el-form>
     </div>
     <span slot="footer" class="dialog-footer">
@@ -70,17 +67,18 @@ export default {
       this.actionType = ACTION_UPDATE
       this.title = '编辑检查项'
       this.dialogVisible = true
-      this.formData.checklistId = data.checklistId
-      this.formData.ocId = data.ocId
-      this.formData.checklistTitle = data.checklistTitle
+      this.formData = data
     },
     // Submit
     submitForm(formName) {
       this.$refs[formName].validate((valid) => {
         if (valid) {
           // this.handleActionCommand()
-          updateChecklist(this.formData).then(() => {
+          updateChecklist(this.formData).then((resp) => {
+            const { msg } = resp
             this.dialogVisible = false
+            this.$message.success(msg)
+            this.formSuccess()
           })
         } else {
           console.log('error submit!!')

+ 1 - 2
src/views/goaf/checklist/index.vue

@@ -51,7 +51,7 @@
 import Checklist from './components/Checklist'
 import ChecklistEdit from './components/ChecklistEdit'
 
-import { deleteChecklistById, getChecklistByPage, getChecklistById } from '@/api/goaf/check'
+import { deleteChecklistById, getChecklistByPage } from '@/api/goaf/check'
 import { Pagination } from '@/components'
 
 export default {
@@ -97,7 +97,6 @@ export default {
       this.$refs['checklist'].showAddModel()
     },
     handleUpdate(data) {
-      getChecklistById(data.checklistId)
       this.$refs['checklist-edit'].showEditModel(JSON.parse(JSON.stringify(data)))
     },
     handleDelete(data) {

+ 12 - 1
src/views/goaf/danger/activity/Accept.vue

@@ -181,7 +181,18 @@ export default {
     // 处理
     handleCommand(flow) {
       this.formData.hdangerId = this.viewData.hdangerId
-      this.formData.status = flow.status
+      if (flow.curActivityCode === 'review') {
+        this.formData.status = 1
+      }
+      if (flow.curActivityCode === 'rectify') {
+        this.formData.status = 2
+      }
+      if (flow.curActivityCode === 'accept') {
+        this.formData.status = 3
+      }
+      if (flow.curActivityCode === '-') {
+        this.formData.status = 4
+      }
       this.formData.acceptRemark = flow.data.actionRemark
       this.formData.attachList = flow.data.attachList
       updateDanger(this.formData).then((resp) => {

+ 10 - 2
src/views/goaf/danger/activity/Rectify.vue

@@ -211,10 +211,18 @@ export default {
     // 处理
     handleCommand(flow) {
       this.formData.hdangerId = this.viewData.hdangerId
-      this.formData.status = flow.status
+      if (flow.curActivityCode === 'review') {
+        this.formData.status = 1
+      }
+      if (flow.curActivityCode === 'rectify') {
+        this.formData.status = 2
+      }
+      if (flow.curActivityCode === 'accept') {
+        this.formData.status = 3
+      }
       this.formData.rectifyRemark = flow.data.actionRemark
       this.formData.attachList = flow.data.attachList
-      debugger
+
       updateDanger(this.formData).then((resp) => {
         const { code, msg } = resp
         if (code === 0) {

+ 9 - 1
src/views/goaf/danger/activity/Review.vue

@@ -187,7 +187,15 @@ export default {
     // 处理
     handleCommand(flow) {
       this.formData.hdangerId = this.viewData.hdangerId
-      this.formData.status = flow.status
+      if (flow.curActivityCode === 'review') {
+        this.formData.status = 1
+      }
+      if (flow.curActivityCode === 'rectify') {
+        this.formData.status = 2
+      }
+      if (flow.curActivityCode === 'accept') {
+        this.formData.status = 3
+      }
       this.formData.reviewRemark = flow.data.actionRemark
       this.formData.attachList = flow.data.attachList
       updateDanger(this.formData).then((resp) => {

+ 10 - 1
src/views/goaf/danger/activity/Submit.vue

@@ -247,7 +247,6 @@ export default {
     // 提交
     handleCommand(flow) {
       const attachList = flow.data.attachList
-      this.formData.status = flow.status
       this.formData.submitRemark = flow.data.actionRemark
       this.formData.attachList = attachList
       if (Array.isArray(attachList) && attachList.length > 0) {
@@ -262,6 +261,16 @@ export default {
       this.formData.submitAccountId = this.userData.userId
       this.formData.submitAccountName = this.userData.userName
 
+      if (flow.curActivityCode === 'review') {
+        this.formData.status = 1
+      }
+      if (flow.curActivityCode === 'rectify') {
+        this.formData.status = 2
+      }
+      if (flow.curActivityCode === 'accept') {
+        this.formData.status = 3
+      }
+
       handleDanger(this.formData).then((resp) => {
         const { code, msg } = resp
         if (code === 0) {

+ 12 - 11
src/views/goaf/danger/components/DangerList.vue

@@ -39,12 +39,13 @@
         </el-table-column>
         <el-table-column prop="curActivityTitle" label="当前关卡" header-align="center" align="center" width="80">
           <template v-slot="{row}">
-            <span><el-tag type="danger" effect="plain" color="rgb(38 69 90)">{{ row.status===2?'完成': row.curActivityTitle }}</el-tag></span>
+            <span v-if="!row.curActivityTitle">--</span>
+            <span v-else><el-tag type="danger" effect="plain" color="rgb(38 69 90)">{{ row.curActivityTitle }}</el-tag></span>
           </template>
         </el-table-column>
         <el-table-column prop="curAccountName" label="当前处理人" header-align="center" align="center" width="160">
           <template v-slot="{row}">
-            <span v-if="row.status===2">--</span>
+            <span v-if="!row.curAccountName">--</span>
             <span v-else><i class="el-icon-user-solid" />{{ row.curAccountName }}( {{ row.curPositionName }} )</span>
           </template>
         </el-table-column>
@@ -57,7 +58,7 @@
 
         <el-table-column label="操作" header-align="center" align="center" width="180">
           <template v-slot="{row}">
-            <el-button v-if="row.status !== 0 && row.curAccountId===userData.userId" type="primary" size="mini" @click="handleDanger(row)">处理</el-button>
+            <el-button v-if="row.curAccountId===userData.userId" type="primary" size="mini" @click="handleDanger(row)">处理</el-button>
             <el-button size="mini" type="info" @click="handleDetail(row)">详情</el-button>
             <el-button v-if="row.submitAccountId===userData.userId" size="mini" type="danger" @click="handleDelete(row)">删除</el-button>
           </template>
@@ -95,7 +96,7 @@ export default {
       return status[val]
     },
     dangerStatusFilter(val) {
-      const status = ['未提交', '处理中', '完成']
+      const status = ['待提交', '待评审', '待整改', '待验收', '完成']
       return val === -1 ? '撤销' : status[val]
     },
     dangerDeadlineFilter(val) {
@@ -130,12 +131,11 @@ export default {
 
     // 重置查询条件
     resetConditions() {
-      this.conditions.keywords = ''
-      this.conditions.status = undefined
-      this.conditions.submitAccountId = undefined
-      this.conditions.handleAccountId = undefined
-      this.conditions.curAccountId = undefined
-      this.conditions.groupId = undefined
+      this.conditions = {
+        page: 1,
+        limit: 10,
+        status: undefined
+      }
     },
 
     // 加载数据
@@ -199,8 +199,9 @@ export default {
 
     // Update View
     formSuccess() {
+      this.resetConditions()
       this.getData()
-      this.$emit('actionUpdate')
+      // this.$emit('actionUpdate')
     },
 
     // Preview Photo

+ 1 - 1
src/views/goaf/danger/components/LeftCounter.vue

@@ -32,7 +32,7 @@
         </div>
       </div>
     </el-row> -->
-    <submit-task ref="SubmitTask" title="隐患登记" @formSuccess="selectItem(curSel)" />
+    <submit-task ref="SubmitTask" title="隐患登记" @formSuccess="selectItem" />
   </div>
 </template>
 <script>

+ 48 - 10
src/views/goaf/info/components/GoafInfo.vue

@@ -7,18 +7,19 @@
         </div>
       </el-col>
       <el-col :span="21" class="right">
-        <el-select v-model="conditions.goafOrebelt" class="search-input m-right-15" filterable placeholder="矿带" clearable>
+        <el-select v-model="conditions.goafOrebelt" class="search-input m-right-15" filterable placeholder="矿带" clearable @change="changeArea(1)">
           <el-option v-for="(item,index) in goafOrebelts" :key="index" :value="item" :label="item" />
         </el-select>
-        <el-select v-model="conditions.goafOrebody" class="search-input m-right-15" filterable placeholder="矿体" clearable>
-          <el-option v-for="(item,index) in goafList" :key="index" :value="item.goafOrebody" :label="item.goafOrebody" />
+        <el-select v-model="conditions.goafOrebody" class="search-input m-right-15" filterable placeholder="矿体" clearable @change="changeArea(2)">
+          <el-option v-for="(item,index) in goafOrebodys" :key="index" :value="item.goafOrebody" :label="item.goafOrebody" />
         </el-select>
-        <el-select v-model="conditions.goafOreheight" class="search-input m-right-15" filterable placeholder="中段" clearable>
-          <el-option v-for="(item,index) in goafList" :key="index" :value="item.goafOreheight" :label="item.goafOreheight" />
+        <el-select v-model="conditions.goafOreheight" class="search-input m-right-15" filterable placeholder="中段" clearable @change="changeArea(3)">
+          <el-option v-for="(item,index) in goafOreheights" :key="index" :value="item.goafOreheight" :label="item.goafOreheight" />
         </el-select>
-        <el-input v-model="conditions.goafName" class="search-input m-right-15" placeholder="请输入采空区编号">
-          <el-button slot="append" icon="el-icon-search" @click="getData()" />
-        </el-input>
+        <el-select v-model="conditions.goafId" class="search-input m-right-15" filterable placeholder="采空区编号" clearable @change="changeArea(4)">
+          <el-option v-for="item in goafNames" :key="item.goafId" :value="item.goafId" :label="item.goafName" />
+        </el-select>
+        <el-button type="primary" style="margin-right: 10px;" @click="getData">查询</el-button>
         <el-button type="primary" style="margin-right: 10px;" @click="handleAdd">新增</el-button>
         <el-button type="primary" :disabled="downloadLoading" @click="handleExport">导出Excel</el-button>
       </el-col>
@@ -78,10 +79,13 @@ export default {
       downloadLoading: false,
       goafList: [],
       goafOrebelts: [],
+      goafOrebodys: [],
+      goafOreheights: [],
+      goafNames: [],
       conditions: {
         page: 1,
         limit: 10,
-        goafName: '',
+        goafId: '',
         goafOrebelt: '',
         goafOrebody: '',
         goafOreheight: ''
@@ -125,7 +129,38 @@ export default {
     handleAdd() {
       this.$refs['goaf'].showAddModel()
     },
-
+    changeArea(type) {
+      const goafs = this.deeepClone(this.goafList)
+      let goafOrebodys = this.deeepClone(this.goafOrebodys)
+      let goafOreheights = this.deeepClone(this.goafOreheights)
+      let goafNames = this.deeepClone(this.goafNames)
+      if (type === 1) {
+        goafOrebodys = goafs.filter(item => item.goafOrebelt === this.conditions.goafOrebelt)
+        this.goafOrebodys = goafOrebodys
+        this.goafOreheights = []
+        this.goafNames = []
+        this.conditions.goafOrebody = ''
+        this.conditions.goafOreheight = ''
+        this.conditions.goafName = ''
+      } else if (type === 2) {
+        goafOreheights = goafs.filter(item => (item.goafOrebody === this.conditions.goafOrebody) && (item.goafOrebelt === this.conditions.goafOrebelt))
+        this.goafOreheights = goafOreheights
+        this.goafNames = []
+        this.conditions.goafOreheight = ''
+        this.conditions.goafName = ''
+      } else if (type === 3) {
+        goafNames = goafs.filter(item => (item.goafOreheight === this.conditions.goafOreheight) && (item.goafOrebody === this.conditions.goafOrebody) && (item.goafOrebelt === this.conditions.goafOrebelt))
+        this.goafNames = goafNames
+        this.conditions.goafName = ''
+      } else {
+        for (let i = 0; i < goafNames.length; i++) {
+          if (this.conditions.goafId === goafNames[i].goafId) {
+            this.conditions.goafName = goafNames[i].goafName
+          }
+        }
+      }
+      this.$forceUpdate()
+    },
     // "Edit Risk" Model
     handleUpdate(data) {
       this.$refs['goaf'].showEditModel(JSON.parse(JSON.stringify(data)))
@@ -202,6 +237,9 @@ export default {
         goafRoofpillarThickness: '顶板矿柱厚度', goafIncoavThickness: '保安间柱平均厚度', goafExpLocation: '勘探位置',
         goafRockLithology: '围岩岩性', goafRockStability: '围岩稳定性', goafFormationTime: '形成时间'
       }
+    },
+    deeepClone(params) {
+      return JSON.parse(JSON.stringify(params))
     }
   }
 }

+ 57 - 34
src/views/goaf/map/components/VisualEditor.vue

@@ -284,13 +284,11 @@ export default {
     mapListener() {
       this.map.on('pm:drawstart', (e) => { // 绘制开始时事件
         if (e.shape === 'Marker') {
-          const iconUrl = this.saveForm.icon
           const layer = e.workingLayer
-          var icon = L.icon({
-            iconUrl,
-            shadowUrl: iconUrl,
-            shadowSize: [37.2, 57.6],
-            iconSize: [37.2, 57.6]
+          const html = `<div class="goaf-icon-box" style="width:100%;height:100%;position: relative;"></div>`
+          var icon = L.divIcon({
+            html,
+            iconSize: [50, 50]
           })
           layer.setIcon(icon)
         }
@@ -298,21 +296,14 @@ export default {
       this.map.on('pm:create', (e) => {
         const self = this
         if (e.shape === 'Marker') {
-          const iconUrl = this.saveForm.icon
-          const name = this.saveForm.name
-          const typeId = this.checkItemIndex + 1
           const layer = e.layer
-          var icon = L.icon({
-            iconUrl,
-            shadowUrl: iconUrl,
-            name,
-            typeId,
-            shadowSize: [37.2, 57.6],
-            iconSize: [37.2, 57.6]
+          const html = `<div class="goaf-icon-box" style="width:100%;height:100%;position: relative;"></div>`
+          var icon = L.divIcon({
+            html,
+            iconSize: [50, 50]
           })
           layer.setIcon(icon)
           self.layer = layer
-          console.log(this)
           layer.addTo(this.layerGroup)
           layer.on('click', (ev) => {
             if (self.type === 2) {
@@ -362,17 +353,20 @@ export default {
           }
         })
         L.geoJSON(feature, {
-          // pointToLayer: function(_feature, latlng) {
-          //   // var smallIcon = L.Icon({
-          //   //   options: {
-          //   //     iconSize: [27, 27],
-          //   //     iconAnchor: [13, 27],
-          //   //     popupAnchor: [1, -24],
-          //   //     iconUrl: 'icone/chapel-2.png'
-          //   //   }
-          //   // })
-          //   // return L.marker(latlng, { icon: smallIcon })
-          // },
+          pointToLayer: function(_feature, latlng) {
+            const goafInfo = _feature.properties.goafInfo
+            let Volume = 0
+            if (goafInfo) {
+              Volume = (goafInfo.goafCanfillVolume - goafInfo.goafRemainVolume) / goafInfo.goafCanfillVolume
+              Volume = (Volume * 100).toFixed(2)
+            }
+            const html = `<div class="goaf-icon-box" style="width:100%;height:100%;position: relative;"><div class="goaf-fill-v" style="height:${Volume}%;"></div></div>`
+            var icon = L.divIcon({
+              html,
+              iconSize: [50, 50]
+            })
+            return L.marker(latlng, { icon })
+          },
           onEachFeature: (_feature, layer) => {
             this.layerGroup.addLayer(layer)
             layer.on('click', (ev) => {
@@ -480,7 +474,7 @@ export default {
         // goafOreheights = this.unique(goafOreheights, 'goafOreheight')
         this.goafOreheights = goafOreheights
         this.goafNames = []
-        this.saveForm.goafOreheights = ''
+        this.saveForm.goafOreheight = ''
         this.saveForm.goafName = ''
       } else if (type === 3) {
         goafNames = goafs.filter(item => (item.goafOreheight === this.saveForm.goafOreheight) && (item.goafOrebody === this.saveForm.goafOrebody) && (item.goafOrebelt === this.saveForm.goafOrebelt))
@@ -490,7 +484,25 @@ export default {
       } else {
         for (let i = 0; i < goafNames.length; i++) {
           if (this.saveForm.goafName === goafNames[i].goafName) {
+            let layer = null
+            if (this.type === 2) {
+              layer = this.layer
+            } else {
+              layer = this.dragstartMarker.layer
+            }
+            let Volume = (goafNames[i].goafCanfillVolume - goafNames[i].goafRemainVolume) / goafNames[i].goafCanfillVolume
+            Volume = (Volume * 100).toFixed(2)
+            const html = `<div class="goaf-icon-box" style="width:100%;height:100%;position: relative;"><div class="goaf-fill-v" style="height:${Volume}%;"></div></div>`
+            var icon = L.divIcon({
+              html,
+              iconSize: [50, 50]
+            })
+            layer.setIcon(icon)
             this.saveForm.goafId = goafNames[i].goafId
+            this.saveForm.goafInfo = {
+              goafCanfillVolume: goafNames[i].goafCanfillVolume,
+              goafRemainVolume: goafNames[i].goafRemainVolume
+            }
           }
         }
       }
@@ -506,7 +518,8 @@ export default {
           'goafOrebelt': this.saveForm.goafOrebelt,
           'goafOrebody': this.saveForm.goafOrebody,
           'goafOreheight': this.saveForm.goafOreheight,
-          'goafName': this.saveForm.goafName
+          'goafName': this.saveForm.goafName,
+          'goafInfo': this.saveForm.goafInfo
         }
       }
       if (this.type === 3) {
@@ -518,12 +531,9 @@ export default {
           return
         }
         updateMapLayer({
-          // 'goaflayerId': '',
+          'goaflayerId': this.saveForm.goaflayerId,
           'ocId': this.userData.ocId,
           'goafId': this.saveForm.goafId,
-          'goafOrebelt': this.saveForm.goafOrebelt,
-          'goafOrebody': this.saveForm.goafOrebody,
-          'goafOreheight': this.saveForm.goafOreheight,
           'goafName': this.saveForm.goafName,
           'mapId': this.formData.mapId,
           'layerId': this.saveForm.layerId,
@@ -833,4 +843,17 @@ export default {
 
     }
     </style>
+  <style lang="scss">
+        .goaf-fill-v{
+            width:100%;
+            position: absolute;
+            bottom: 0;
+            left: 0;
+            background-image: url("./goaf/stone.png");
+            background-size: 7px;
+            &.fill{
+              background-image: url("./goaf/stone.png");
+            }
+        }
+  </style>
 

BIN
src/views/goaf/map/components/goaf/fill.png


BIN
src/views/goaf/map/components/goaf/stone.png