zhaobao před 2 roky
rodič
revize
774f21b5a1

+ 49 - 0
src/api/goaf/check.js

@@ -0,0 +1,49 @@
+
+import request from '@/utils/request'
+
+// 获取所有检查表及其内容
+export function getChecklist(params) {
+  return request({
+    url: '/goaf/goafChecklist/list',
+    params
+  })
+}
+// 分页获取所有检查表及其内容
+export function getChecklistByPage(params) {
+  return request({
+    url: '/goaf/goafChecklist/page',
+    params
+  })
+}
+
+// 获取指定的检查表及其内容
+export function getChecklistById(goafchecklistId) {
+  return request({
+    url: `/goaf/goafChecklist/${goafchecklistId}`
+  })
+}
+// 增加检查表及其内容
+export function createChecklist(data) {
+  return request({
+    url: '/goaf/goafChecklist/add',
+    method: 'POST',
+    data
+  })
+}
+// 更新
+export function updateChecklist(data) {
+  return request({
+    url: '/goaf/goafChecklist/update',
+    method: 'PUT',
+    data
+  })
+}
+
+// 删除指定检查表的某项内容
+export function deleteChecklistById(goafchecklistitemid) {
+  return request({
+    url: `/goaf/goafChecklist/deletecheckitemlist/${goafchecklistitemid}`,
+    method: 'DELETE'
+  })
+}
+

+ 0 - 0
src/api/goaf/index.js


+ 49 - 0
src/api/goaf/info.js

@@ -0,0 +1,49 @@
+
+import request from '@/utils/request'
+
+// 获取所有采空区信息
+export function getGoafBaseInfo(params) {
+  return request({
+    url: '/goaf/goafbaseinfo/list',
+    params
+  })
+}
+// 获取所有采空区信息分页
+export function getGoafBaseInfoByPage(params) {
+  return request({
+    url: '/goaf/goafbaseinfo/page',
+    params
+  })
+}
+
+// 根据采空区id获取信息
+export function getGoafInfoById(id) {
+  return request({
+    url: `/goaf/goafbaseinfo/${id}`
+  })
+}
+// 新增
+export function createGoaf(data) {
+  return request({
+    url: '/goaf/goafbaseinfo/add',
+    method: 'POST',
+    data
+  })
+}
+// 更新
+export function updateGoaf(data) {
+  return request({
+    url: '/goaf/goafbaseinfo/update',
+    method: 'PUT',
+    data
+  })
+}
+
+// 删除
+export function delGoaf(goafId) {
+  return request({
+    url: `/goaf/goafbaseinfo/delete/${goafId}`,
+    method: 'DELETE'
+  })
+}
+

+ 48 - 0
src/api/goaf/layer.js

@@ -0,0 +1,48 @@
+
+import request from '@/utils/request'
+
+// 获取指定地图上的所有采空区坐标信息
+export function getMapLayer(params) {
+  return request({
+    url: '/goaf/goafmapflayer/list',
+    params
+  })
+}
+// 分页获取指定地图上的所有采空区坐标信息
+export function getMapLayerByPage(params) {
+  return request({
+    url: '/goaf/goafmapflayer/page',
+    params
+  })
+}
+// 根据采空区id获取坐标信息
+export function getMapLayerById(goaflayerId) {
+  return request({
+    url: `/goaf/goafmapflayer/${goaflayerId}`
+  })
+}
+// 增加
+export function createMapLayer(data) {
+  return request({
+    url: '/goaf/goafmapflayer/data',
+    method: 'POST',
+    data
+  })
+}
+
+// 删除
+export function delMapLayer(goaflayerId, mapId, layerId) {
+  return request({
+    url: `/goaf/goafmapflayer/delete/${goaflayerId}/${mapId}/${layerId}`
+  })
+}
+
+// 修改
+export function updateMapLayer(data) {
+  return request({
+    url: '/goaf/goafmapflayer/update',
+    method: 'PUT',
+    data
+  })
+}
+

+ 40 - 0
src/api/goaf/sensor.js

@@ -0,0 +1,40 @@
+
+import request from '@/utils/request'
+// 获取所有传感器类型信息
+export function getSensor(params) {
+  return request({
+    url: '/goaf/sensortypecfg/list',
+    params
+  })
+}
+// 根据类型获取传感器类型信息
+export function getSensorByType(typeId) {
+  return request({
+    url: `/goaf/sensortypecfg/${typeId}`
+  })
+}
+// 增加
+export function createSensor(data) {
+  return request({
+    url: '/goaf/sensortypecfg/add',
+    method: 'POST',
+    data
+  })
+}
+
+// 删除
+export function delSensor(typeId) {
+  return request({
+    url: `/goaf/sensortypecfg/delete/${typeId}`
+  })
+}
+
+// 修改
+export function updateSensor(data) {
+  return request({
+    url: '/goaf/sensortypecfg/update',
+    method: 'PUT',
+    data
+  })
+}
+

+ 11 - 0
src/router/modules/aqpt.js

@@ -142,6 +142,17 @@ const aqptRouter = [
           // icon: 'icon-common_equipment',
           permit: 'aqpt_danger'
         }
+      },
+      {
+        path: 'checklist',
+        component: () => import('@/views/goaf/checklist'),
+        name: 'goaf-checklist',
+        meta: {
+          title: '检查表',
+          noCache: true,
+          // icon: 'icon-common_equipment',
+          permit: 'aqpt_danger'
+        }
       }
     ]
   },

+ 185 - 0
src/views/goaf/checklist/components/Checklist.vue

@@ -0,0 +1,185 @@
+<template>
+  <el-drawer
+    :title="title"
+    :modal-append-to-body="false"
+    :modal="false"
+    :wrapper-closable="false"
+    size="30%"
+    :visible.sync="dialogVisible"
+  >
+    <div class="content-container">
+      <vuescroll :ops="ops" style="height: 98%">
+        <el-form ref="ruleForm" :model="formData" :rules="rules" label-position="right" label-width="100px">
+          <el-form-item label="名称" prop="checklistTitle">
+            <el-input v-model="formData.checklistTitle" placeholder="输入清单名称" />
+          </el-form-item>
+
+          <!-- <el-form-item label="类别" prop="checklistCatId">
+            <checklist-cat-selector v-model="formData.checklistCatId" />
+          </el-form-item> -->
+          <el-form-item label="检查项目内容">
+            <el-input v-model="formData.checklistItemContent" type="textarea" rows="10" placeholder="输入描述" />
+          </el-form-item>
+          <el-form-item label="说明" prop="checklistDesc">
+            <el-input v-model="formData.checklistDesc" type="textarea" rows="10" placeholder="输入描述" />
+          </el-form-item>
+        </el-form>
+        <div class="btn-group">
+          <el-button type="primary" @click="submitForm('ruleForm')">下一步</el-button>
+          <el-button class="cancel-btn" @click="dialogVisible = false">取消</el-button>
+        </div>
+      </vuescroll>
+    </div>
+  </el-drawer>
+</template>
+
+<script>
+import { ACTION_ADD, ACTION_UPDATE } from '@/utils/actionType'
+import { getChecklistById, createChecklist, updateChecklist } from '@/api/goaf/check'
+// import ChecklistCatSelector from '@/components/ChecklistCatSelector'
+import Vuescroll from 'vuescroll'
+
+export default {
+  components: {
+    Vuescroll
+    // ChecklistCatSelector
+  },
+  props: {
+    title: {
+      type: String,
+      default: ''
+    }
+  },
+  data() {
+    return {
+      ops: {
+        bar: {
+          keepShow: false,
+          background: 'rgba(144, 147, 153, 0.4)',
+          onlyShowBarOnScroll: false
+        }
+      },
+      dialogVisible: false,
+      formData: {
+        'checklistId': undefined,
+        'ocId': '',
+        'checklistTitle': '',
+        'checklistDesc': '',
+        'checklistItemId': undefined,
+        'checklistItemContent': ''
+      },
+      checklistCatList: [],
+      rules: {
+        checklistTitle: [
+          { required: true, message: '请填写名称', trigger: 'blur' }
+        ],
+        checklistCatId: [
+          { required: true, message: '请填选择类别', trigger: 'blur' }
+        ]
+      }
+    }
+  },
+  mounted() {
+  },
+  methods: {
+
+    // Show Add Dialog
+    showAddModel() {
+      this.resetFormData()
+      this.actionType = ACTION_ADD
+      this.dialogVisible = true
+    },
+
+    // Show Edit Dialog
+    showEditModel(checklistId) {
+      this.resetFormData()
+      this.actionType = ACTION_UPDATE
+      this.dialogVisible = true
+      getChecklistById(checklistId).then((resp) => {
+        const { code, data, msg } = resp
+        if (code === 0) {
+          this.formData = data
+        } else {
+          this.$message.error(msg)
+        }
+      })
+    },
+
+    // Reset Form Data
+    resetFormData() {
+      this.formData = {
+        'checklistId': undefined,
+        'ocId': '',
+        'checklistTitle': '',
+        'checklistDesc': '',
+        'checklistItemId': undefined,
+        'checklistItemContent': ''
+      }
+    },
+
+    // Submit
+    submitForm(formName) {
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          switch (this.actionType) {
+            case ACTION_ADD:
+              createChecklist(this.formData).then((resp) => {
+                const { code, data, msg } = resp
+                if (code === 0) {
+                  this.dialogVisible = false
+                  this.$message.success(msg)
+                  this.$emit('formSuccess', data)
+                } else {
+                  this.$message.error(msg)
+                }
+              }).catch((error) => {
+                console.log(error)
+              })
+              break
+
+            case ACTION_UPDATE:
+              updateChecklist(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)
+              })
+              break
+          }
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    formSuccess() {
+      this.$emit('formSuccess')
+    },
+    resetForm(formName) {
+      this.$refs[formName].resetFields()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>  .btn-group {
+  margin-top: 20px;
+  .cancel-btn {
+    background: #004F7B;
+    border-color: #004F7B;
+    color: #FFF;
+    margin-left: 20px;
+    &:hover {
+      background: #026197;
+      border-color: #026197;
+    }
+  }
+}
+
+</style>

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

@@ -0,0 +1,160 @@
+<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="right">
+        <el-input v-model="conditions.keywords" class="search-input m-right-15" placeholder="请输入内容">
+          <el-button slot="append" icon="el-icon-search" @click="getData()" />
+        </el-input>
+        <el-button type="primary" @click="handleAdd">添加</el-button>
+      </el-col>
+    </el-row>
+
+    <el-row class="content-body">
+      <el-table v-loading="listLoading" class="page-table" border :data="dataList" height="calc(100vh - 220px)">
+        <el-table-column type="index" label="序号" header-align="center" align="center" width="80" />
+
+        <el-table-column prop="checklistTitle" label="名称" header-align="left" align="left" width="260">
+          <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>
+          </template>
+        </el-table-column>
+
+        <!-- <el-table-column prop="issuedAt" label="变更人" header-align="center" align="center" width="200">
+          <template v-slot="{row}">
+            <i class="el-icon-user" />
+            <span> {{ row.issuedAccountName }}</span>
+          </template>
+        </el-table-column> -->
+
+        <!-- <el-table-column prop="issuedAt" label="变更时间" header-align="center" align="center" width="200">
+          <template v-slot="{row}">
+            <i class="el-icon-time" />
+            <span> {{ row.issuedAt | parseTime('{y}-{m}-{d} {h}:{i}') }}</span>
+          </template>
+        </el-table-column> -->
+
+        <el-table-column label="操作" header-align="center" align="center" width="180">
+          <template v-slot="{row}">
+            <el-button size="mini" icon="el-icon-view" type="primary" @click="handleUpdate(row)">修改</el-button>
+            <el-button v-if="row.isFixed !== 1" size="mini" icon="el-icon-delete" type="danger" @click="handleDelete(row)">删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <div class="pagination-wrap">
+        <pagination v-show="total>0" :total="total" :page.sync="conditions.page" :limit.sync="conditions.limit" @pagination="getData" />
+      </div>
+    </el-row>
+
+    <checklist ref="checklist" @formSuccess="formSuccess" />
+  </div>
+</template>
+
+<script>
+import Checklist from './components/Checklist'
+import { deleteChecklistById, getChecklistByPage } from '@/api/goaf/check'
+import { Pagination } from '@/components'
+
+export default {
+  name: 'ChecklistIndex',
+  components: {
+    Pagination,
+    Checklist
+  },
+  data() {
+    return {
+      title: '清单管理',
+      listLoading: false,
+      total: 0,
+      dataList: [],
+      conditions: {
+        page: 1,
+        limit: 10,
+        checklistTypeId: 3, // 同story ID
+        keywords: ''
+      }
+    }
+  },
+
+  mounted() {
+    this.getData()
+  },
+
+  methods: {
+    // fetch data
+    getData() {
+      const items = []
+      for (let i = 0; i < 10; i++) {
+        items.push({
+          'checklistId': 109,
+          'ocId': 341,
+          'checklistTitle': '3gata5',
+          'checklistDesc': 'g3868q',
+          'checklistItemId': 784,
+          'checklistItemContent': 'mrxs6p'
+        })
+      }
+      this.dataList = items
+      getChecklistByPage(this.conditions).then((resp) => {
+        const { code, msg, data, total } = resp
+        if (code === 0) {
+          this.dataList = data
+          this.total = total
+        } else {
+          this.$message.error(msg)
+        }
+      })
+    },
+    formSuccess(data) {
+      this.getData()
+      this.handleDetails(data)
+    },
+    handleAdd() {
+      this.$refs['checklist'].showAddModel()
+    },
+    handleUpdate(data) {
+      this.$refs['checklist'].showEditModel(data.checklistId)
+    },
+    handleDelete(data) {
+      const { checklistId, checklistTitle } = data
+      this.$confirm(`此操作将删除该数据${checklistTitle}, 是否继续?`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        deleteChecklistById(checklistId).then((resp) => {
+          const { code, msg } = resp
+          if (code === 0) {
+            this.getData()
+            this.$message.success(msg)
+          } else {
+            this.$message.error(msg)
+          }
+        }).catch((error) => {
+          console.log(error)
+        })
+      }).catch(() => {
+        this.$message({ type: 'info', message: '已取消删除' })
+      })
+    }
+  }
+}
+</script>
+<style lang="scss">
+</style>
+<style lang="scss" scoped>
+
+</style>
+

+ 3 - 3
src/views/goaf/info/components/Goaf.vue

@@ -104,7 +104,7 @@
 </template>
 
 <script>
-import { createHazardRisk, updateHazardRisk } from '@/api/aqpt/hazardRiskApi'
+import { createGoaf, updateGoaf } from '@/api/goaf/info'
 import Vuescroll from 'vuescroll'
 
 export default {
@@ -213,7 +213,7 @@ export default {
         if (valid) {
           switch (this.actionType) {
             case 'ADD':
-              createHazardRisk(this.formData).then((resp) => {
+              createGoaf(this.formData).then((resp) => {
                 const { code, msg } = resp
                 if (code === 0) {
                   this.dialogVisible = false
@@ -228,7 +228,7 @@ export default {
               break
 
             case 'UPDATE':
-              updateHazardRisk(this.formData).then((resp) => {
+              updateGoaf(this.formData).then((resp) => {
                 const { code, msg } = resp
                 if (code === 0) {
                   this.dialogVisible = false

+ 3 - 3
src/views/goaf/info/components/GoafInfo.vue

@@ -86,7 +86,7 @@ import html2canvas from 'html2canvas'
 import JSZip from 'jszip'
 import saveAs from 'file-saver'
 import QRCode from 'qrcodejs2'
-import { getHazardRiskByPage, deleteHazardRiskById } from '@/api/aqpt/hazardRiskApi'
+import { getGoafBaseInfoByPage, delGoaf } from '@/api/goaf/info'
 import { Pagination } from '@/components'
 import Goaf from './Goaf'
 import { NumConvertLM } from '@/utils'
@@ -161,7 +161,7 @@ export default {
     // fetch data
     getData() {
       this.listLoading = true
-      getHazardRiskByPage(this.conditions).then((resp) => {
+      getGoafBaseInfoByPage(this.conditions).then((resp) => {
         this.listLoading = false
         const { code, msg, data, total } = resp
         if (code === 0) {
@@ -192,7 +192,7 @@ export default {
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        deleteHazardRiskById(hazardId, riskId).then((resp) => {
+        delGoaf(hazardId, riskId).then((resp) => {
           const { code, msg } = resp
           if (code === 0) {
             this.getData()

+ 3 - 3
src/views/goaf/sensor/Model.vue

@@ -22,7 +22,7 @@
 </template>
 
 <script>
-import { createHazardRisk, updateHazardRisk } from '@/api/aqpt/hazardRiskApi'
+import { createSensor, updateSensor } from '@/api/goaf/sensor'
 export default {
   data() {
     return {
@@ -93,7 +93,7 @@ export default {
           this.formData.sensorTypeName = this.sensors.filter(item => item.id === this.formData.sensorTypeId)[0].name
           switch (this.actionType) {
             case 'ADD':
-              createHazardRisk(this.formData).then((resp) => {
+              createSensor(this.formData).then((resp) => {
                 const { code, msg } = resp
                 if (code === 0) {
                   this.dialogVisible = false
@@ -108,7 +108,7 @@ export default {
               break
 
             case 'UPDATE':
-              updateHazardRisk(this.formData).then((resp) => {
+              updateSensor(this.formData).then((resp) => {
                 const { code, msg } = resp
                 if (code === 0) {
                   this.dialogVisible = false

+ 3 - 3
src/views/goaf/sensor/index.vue

@@ -34,7 +34,7 @@
 </template>
 
 <script>
-import { getHazardRiskByPage, deleteHazardRiskById } from '@/api/aqpt/hazardRiskApi'
+import { getSensor, delSensor } from '@/api/goaf/sensor'
 import { Pagination } from '@/components'
 import sensorModel from './Model'
 export default {
@@ -71,7 +71,7 @@ export default {
     // fetch data
     getData() {
       this.listLoading = true
-      getHazardRiskByPage(this.conditions).then((resp) => {
+      getSensor(this.conditions).then((resp) => {
         this.listLoading = false
         const { code, msg, data, total } = resp
         if (code === 0) {
@@ -102,7 +102,7 @@ export default {
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        deleteHazardRiskById(hazardId, riskId).then((resp) => {
+        delSensor(hazardId, riskId).then((resp) => {
           const { code, msg } = resp
           if (code === 0) {
             this.getData()