事故调查管理代码提交

hyx_2024-10-30_new
shanao 2024-09-06 19:38:37 +08:00
parent 2c930b42b2
commit 5aa6676248
5 changed files with 238 additions and 66 deletions

104
package-lock.json generated
View File

@ -11,11 +11,12 @@
"@jiaminghi/data-view": "^2.10.0",
"@riophae/vue-treeselect": "^0.4.0",
"axios": "^0.21.1",
"dayjs": "^1.11.8",
"dayjs": "^1.11.10",
"echarts": "^5.3.1",
"element-ui": "^2.15.8",
"ezuikit-js": "^0.6.3",
"js-cookie": "^2.2.1",
"jspdf": "^2.5.1",
"moment": "^2.29.3",
"normalize.css": "^8.0.1",
"nprogress": "^0.2.0",
@ -383,6 +384,12 @@
"integrity": "sha1-FZJUFOCtLNdlv+9YhC9+JqesyyQ=",
"dev": true
},
"node_modules/@types/raf": {
"version": "3.4.3",
"resolved": "https://registry.npmmirror.com/@types/raf/-/raf-3.4.3.tgz",
"integrity": "sha512-c4YAvMedbPZ5tEyxzQdMoOhhJ4RD3rngZIdwC2/qDN3d7JpEhB6fiBRKVY1lg5B7Wk+uPBjn5f39j1/2MY1oOw==",
"optional": true
},
"node_modules/@types/strip-bom": {
"version": "3.0.0",
"resolved": "https://registry.npm.taobao.org/@types/strip-bom/download/@types/strip-bom-3.0.0.tgz",
@ -19841,7 +19848,7 @@
},
"node_modules/v-viewer": {
"version": "1.6.3",
"resolved": "https://registry.nlark.com/v-viewer/download/v-viewer-1.6.3.tgz?cache=0&sync_timestamp=1622640158813&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fv-viewer%2Fdownload%2Fv-viewer-1.6.3.tgz",
"resolved": "https://registry.npmmirror.com/v-viewer/download/v-viewer-1.6.3.tgz?cache=0&sync_timestamp=1622640158813&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fv-viewer%2Fdownload%2Fv-viewer-1.6.3.tgz",
"integrity": "sha1-bjUOKjQvptfb/mmhKhpNZuOjzG4=",
"dev": true,
"dependencies": {
@ -20133,7 +20140,7 @@
},
"node_modules/viewerjs": {
"version": "1.9.2",
"resolved": "https://registry.nlark.com/viewerjs/download/viewerjs-1.9.2.tgz?cache=0&sync_timestamp=1622261114218&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fviewerjs%2Fdownload%2Fviewerjs-1.9.2.tgz",
"resolved": "https://registry.npmmirror.com/viewerjs/download/viewerjs-1.9.2.tgz?cache=0&sync_timestamp=1622261114218&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fviewerjs%2Fdownload%2Fviewerjs-1.9.2.tgz",
"integrity": "sha1-Qrnl9MTT8TZHjVPn1WTosrqbXH4=",
"dev": true
},
@ -20706,7 +20713,7 @@
},
"node_modules/vue-print-nb": {
"version": "1.7.4",
"resolved": "https://registry.nlark.com/vue-print-nb/download/vue-print-nb-1.7.4.tgz",
"resolved": "https://registry.npmmirror.com/vue-print-nb/download/vue-print-nb-1.7.4.tgz",
"integrity": "sha1-WpFisNlpcrQBNH5gc4WStaTkIQk=",
"dependencies": {
"vue": "^2.6.11"
@ -22870,6 +22877,12 @@
"integrity": "sha1-FZJUFOCtLNdlv+9YhC9+JqesyyQ=",
"dev": true
},
"@types/raf": {
"version": "3.4.3",
"resolved": "https://registry.npmmirror.com/@types/raf/-/raf-3.4.3.tgz",
"integrity": "sha512-c4YAvMedbPZ5tEyxzQdMoOhhJ4RD3rngZIdwC2/qDN3d7JpEhB6fiBRKVY1lg5B7Wk+uPBjn5f39j1/2MY1oOw==",
"optional": true
},
"@types/strip-bom": {
"version": "3.0.0",
"resolved": "https://registry.npm.taobao.org/@types/strip-bom/download/@types/strip-bom-3.0.0.tgz",
@ -23762,8 +23775,7 @@
"atob": {
"version": "2.1.2",
"resolved": "https://registry.npm.taobao.org/atob/download/atob-2.1.2.tgz",
"integrity": "sha1-bZUX654DDSQ2ZmZR6GvZ9vE1M8k=",
"devOptional": true
"integrity": "sha1-bZUX654DDSQ2ZmZR6GvZ9vE1M8k="
},
"autoprefixer": {
"version": "7.2.6",
@ -25148,6 +25160,11 @@
"node-int64": "^0.4.0"
}
},
"btoa": {
"version": "1.2.1",
"resolved": "https://registry.npmmirror.com/btoa/-/btoa-1.2.1.tgz",
"integrity": "sha512-SB4/MIGlsiVkMcHmT+pSmIPoNDoHg+7cMzmt3Uxt628MTz2487DKSqK/fuhFBrkuqrYv5UCEnACpF4dTFNKc/g=="
},
"buffer": {
"version": "4.9.2",
"resolved": "https://registry.npm.taobao.org/buffer/download/buffer-4.9.2.tgz?cache=0&sync_timestamp=1606098175437&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbuffer%2Fdownload%2Fbuffer-4.9.2.tgz",
@ -25331,6 +25348,36 @@
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001317.tgz",
"integrity": "sha512-xIZLh8gBm4dqNX0gkzrBeyI86J2eCjWzYAs40q88smG844YIrN4tVQl/RhquHvKEKImWWFIVh1Lxe5n1G/N+GQ=="
},
"canvg": {
"version": "3.0.10",
"resolved": "https://registry.npmmirror.com/canvg/-/canvg-3.0.10.tgz",
"integrity": "sha512-qwR2FRNO9NlzTeKIPIKpnTY6fqwuYSequ8Ru8c0YkYU7U0oW+hLUvWadLvAu1Rl72OMNiFhoLu4f8eUjQ7l/+Q==",
"optional": true,
"requires": {
"@babel/runtime": "^7.12.5",
"@types/raf": "^3.4.0",
"core-js": "^3.8.3",
"raf": "^3.4.1",
"regenerator-runtime": "^0.13.7",
"rgbcolor": "^1.0.1",
"stackblur-canvas": "^2.0.0",
"svg-pathdata": "^6.0.3"
},
"dependencies": {
"core-js": {
"version": "3.33.0",
"resolved": "https://registry.npmmirror.com/core-js/-/core-js-3.33.0.tgz",
"integrity": "sha512-HoZr92+ZjFEKar5HS6MC776gYslNOKHt75mEBKWKnPeFDpZ6nH5OeF3S6HFT1mUAUZKrzkez05VboaX8myjSuw==",
"optional": true
},
"regenerator-runtime": {
"version": "0.13.11",
"resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz",
"integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==",
"optional": true
}
}
},
"capture-exit": {
"version": "1.2.0",
"resolved": "https://registry.npm.taobao.org/capture-exit/download/capture-exit-1.2.0.tgz",
@ -27001,9 +27048,9 @@
}
},
"dayjs": {
"version": "1.11.8",
"resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.8.tgz",
"integrity": "sha512-LcgxzFoWMEPO7ggRv1Y2N31hUf2R0Vj7fuy/m+Bg1K8rr+KAs1AEy4y9jd5DXe8pbHgX+srkHNS7TH6Q6ZhYeQ=="
"version": "1.11.10",
"resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.10.tgz",
"integrity": "sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ=="
},
"de-indent": {
"version": "1.0.2",
@ -27344,6 +27391,12 @@
"domelementtype": "1"
}
},
"dompurify": {
"version": "2.4.7",
"resolved": "https://registry.npmmirror.com/dompurify/-/dompurify-2.4.7.tgz",
"integrity": "sha512-kxxKlPEDa6Nc5WJi+qRgPbOAbgTpSULL+vI3NUXsZMlkJxTqYI9wg5ZTay2sFrdZRWHPWNi+EdAhcJf81WtoMQ==",
"optional": true
},
"domready": {
"version": "1.0.8",
"resolved": "https://registry.npm.taobao.org/domready/download/domready-1.0.8.tgz",
@ -35964,6 +36017,15 @@
"fast-diff": "1.1.2"
}
},
"raf": {
"version": "3.4.1",
"resolved": "https://registry.npmmirror.com/raf/-/raf-3.4.1.tgz",
"integrity": "sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==",
"optional": true,
"requires": {
"performance-now": "^2.1.0"
}
},
"randomatic": {
"version": "3.1.1",
"resolved": "https://registry.npm.taobao.org/randomatic/download/randomatic-3.1.1.tgz",
@ -36510,6 +36572,12 @@
"integrity": "sha1-QzdOLiyglosO8VI0YLfXMP8i7rM=",
"dev": true
},
"rgbcolor": {
"version": "1.0.1",
"resolved": "https://registry.npmmirror.com/rgbcolor/-/rgbcolor-1.0.1.tgz",
"integrity": "sha512-9aZLIrhRaD97sgVhtJOW6ckOEh6/GnvQtdVNfdZ6s67+3/XwLS9lBcQYzEEhYVeUowN7pRzMLsyGhK2i/xvWbw==",
"optional": true
},
"right-align": {
"version": "0.1.3",
"resolved": "https://registry.npm.taobao.org/right-align/download/right-align-0.1.3.tgz",
@ -37552,6 +37620,12 @@
}
}
},
"stackblur-canvas": {
"version": "2.6.0",
"resolved": "https://registry.npmmirror.com/stackblur-canvas/-/stackblur-canvas-2.6.0.tgz",
"integrity": "sha512-8S1aIA+UoF6erJYnglGPug6MaHYGo1Ot7h5fuXx4fUPvcvQfcdw2o/ppCse63+eZf8PPidSu4v1JnmEVtEDnpg==",
"optional": true
},
"stackframe": {
"version": "1.2.0",
"resolved": "https://registry.npm.taobao.org/stackframe/download/stackframe-1.2.0.tgz",
@ -38141,6 +38215,12 @@
}
}
},
"svg-pathdata": {
"version": "6.0.3",
"resolved": "https://registry.npmmirror.com/svg-pathdata/-/svg-pathdata-6.0.3.tgz",
"integrity": "sha512-qsjeeq5YjBZ5eMdFuUa4ZosMLxgr5RZ+F+Y1OrDhuOCEInRMA3x74XdBtggJcj9kOeInz0WE+LgCPDkZFlBYJw==",
"optional": true
},
"svg-sprite-loader": {
"version": "4.3.0",
"resolved": "https://registry.npm.taobao.org/svg-sprite-loader/download/svg-sprite-loader-4.3.0.tgz?cache=0&sync_timestamp=1608019568614&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsvg-sprite-loader%2Fdownload%2Fsvg-sprite-loader-4.3.0.tgz",
@ -39192,7 +39272,7 @@
},
"v-viewer": {
"version": "1.6.3",
"resolved": "https://registry.nlark.com/v-viewer/download/v-viewer-1.6.3.tgz?cache=0&sync_timestamp=1622640158813&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fv-viewer%2Fdownload%2Fv-viewer-1.6.3.tgz",
"resolved": "https://registry.npmmirror.com/v-viewer/download/v-viewer-1.6.3.tgz?cache=0&sync_timestamp=1622640158813&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fv-viewer%2Fdownload%2Fv-viewer-1.6.3.tgz",
"integrity": "sha1-bjUOKjQvptfb/mmhKhpNZuOjzG4=",
"dev": true,
"requires": {
@ -39457,7 +39537,7 @@
},
"viewerjs": {
"version": "1.9.2",
"resolved": "https://registry.nlark.com/viewerjs/download/viewerjs-1.9.2.tgz?cache=0&sync_timestamp=1622261114218&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fviewerjs%2Fdownload%2Fviewerjs-1.9.2.tgz",
"resolved": "https://registry.npmmirror.com/viewerjs/download/viewerjs-1.9.2.tgz?cache=0&sync_timestamp=1622261114218&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fviewerjs%2Fdownload%2Fviewerjs-1.9.2.tgz",
"integrity": "sha1-Qrnl9MTT8TZHjVPn1WTosrqbXH4=",
"dev": true
},
@ -39880,7 +39960,7 @@
},
"vue-print-nb": {
"version": "1.7.4",
"resolved": "https://registry.nlark.com/vue-print-nb/download/vue-print-nb-1.7.4.tgz",
"resolved": "https://registry.npmmirror.com/vue-print-nb/download/vue-print-nb-1.7.4.tgz",
"integrity": "sha1-WpFisNlpcrQBNH5gc4WStaTkIQk=",
"requires": {
"vue": "^2.6.11"

View File

@ -5,7 +5,7 @@
"author": "",
"private": true,
"scripts": {
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js --host 192.168.0.125",
"start": "npm run dev",
"unit": "jest --config test/unit/jest.conf.js --coverage",
"e2e": "node test/e2e/runner.js",

View File

@ -94,6 +94,12 @@ export const constantRoutes = [
// meta: { name: 'tiao重大危险源' },
component: () => import('../views/bi_onecom/majorHazardSources/apiMajorHazardSources.vue')
}
// {
// path: '/accident/records',
// name: 'apiAccidentRecords',
// meta: { name: '事故调查' },
// component: () => import('@/views/accident/records/index.vue')
// }
]
const createRouter = () => new Router({
// mode: 'history', // require service support

View File

@ -1,14 +1,13 @@
<template>
<div class="app-container">
<el-form ref="searchForm" :model="searchForm" label-width="90px">
<!-- 搜索查询 start -->
<el-row :gutter="24">
<el-form ref="searchForm" :model="searchForm" label-width="100px">
<el-row :gutter="12">
<el-col :span="4">
<el-form-item label="事故名称" prop="incidentName">
<el-input v-model="searchForm.incidentName" placeholder="请输入事故名称" />
<el-input v-model="searchForm.incidentName" placeholder="请输入隐患描述" class="filter-item"/>
</el-form-item>
</el-col>
<el-col :span="5">
<el-col :span="8">
<el-form-item label="发生时间" prop="incidentDates">
<el-date-picker
v-model="searchForm.incidentDates"
@ -29,14 +28,14 @@
<el-col :span="4">
<el-form-item label="事故类型" prop="incidentType">
<el-select v-model="searchForm.incidentType" placeholder="请选择">
<el-option v-for="item in incidentTypes" :key="item.value" :label="item.label" :value="item.value" />
<el-option v-for="item in incidentTypes" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="事故等级" prop="incidentLevel">
<el-select v-model="searchForm.incidentLevel" placeholder="请选择">
<el-option v-for="item in incidentLevels" :key="item.value" :label="item.label" :value="item.value" />
<el-option v-for="item in incidentLevels" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
@ -73,25 +72,20 @@
<el-table-column type="selection" width="55"/>
<el-table-column label="事故名称" prop="incidentName"/>
<el-table-column label="所属公司" prop="companyName"/>
<el-table-column label="发生时间" prop="incidentDate">
<template v-slot="{row}">
{{ formatDate(row.incidentDate, 'YYYY-MM-DD HH:mm:ss') }}
</template>
</el-table-column>
<el-table-column label="发生时间" prop="incidentDate"/>
<el-table-column label="发生地点" prop="location"/>
<el-table-column label="操作" width="100">
<template v-slot="{row}">
<el-button v-show="edit" icon="el-icon-view" size="mini" @click="goView(row.id)"></el-button>
<el-button v-show="edit" icon="el-icon-view" size="mini" @click="changeDialog('修改',row.id)"></el-button>
<el-button v-show="del" icon="el-icon-view" size="mini" @click="deleteRow(row.id)"></el-button>
<el-button icon="el-icon-view" size="mini" @click="goView(row.id)"></el-button>
<el-button icon="el-icon-view" size="mini" @click="changeDialog('修改',row.id)"></el-button>
<el-button icon="el-icon-view" size="mini" @click="deleteRow(row.id)"></el-button>
</template>
</el-table-column>
</el-table>
</div>
<!-- table 表格 end -->
<div class="pagination-group">
<pagination :total="listQuery.total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
<pagination :total="listQuery.total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="searchList" />
</div>
</div>
</template>
@ -99,6 +93,7 @@
<script>
import Pagination from '@/components/Pagination'
import waves from '@/directive/waves'
import { requestFN } from '../../../../utils/request'
export default {
components: { Pagination },
@ -112,6 +107,10 @@ export default {
incidentName: '',
/** 发生时间 */
incidentDates: [],
/** 开始时间 */
startTime: null,
/** 结束时间 */
endTime: null,
/** 发生地点 */
location: '',
/** 事故类型 */
@ -124,31 +123,9 @@ export default {
/** 源列表数据项 */
varList: [],
/** 事故类型 */
incidentTypes: [
{
id: '01',
value: 'yiji',
label: '一级事故'
},
{
id: '02',
value: 'erji',
label: '二级事故'
}
],
incidentTypes: [],
/** 事故等级 */
incidentLevels: [
{
id: '01',
value: 'yiji',
label: '一级等级'
},
{
id: '02',
value: 'erji',
label: '二级等级'
}
],
incidentLevels: [],
//
listQuery: {
/** 当前页数 */
@ -161,26 +138,45 @@ export default {
}
},
created() {
this.getDict()
this.searchList()
},
methods: {
/**
* 查询搜索
*/
searchList() { },
searchList() {
this.listLoading = true
const dates = this.searchForm.incidentDates
if (dates != null && dates.length === 2) {
this.searchForm.startTime = dates[0]
this.searchForm.endTime = dates[1]
}
const url = '/accident/page?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page
requestFN(url, { ...this.searchForm }).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
}).catch((e) => {
this.listLoading = false
})
},
/**
* 重置搜索条件
*/
handleReset() {},
/**
* 获取分页列表
*/
getList() {},
handleReset() {
this.searchForm = this.$options.data().searchForm
},
/**
* 表格行选择器处理
*/
handleSelectionChange() {},
handleSelectionChange(val) {
this.multipleSelection.push(val)
},
/**
* 新增
@ -189,6 +185,37 @@ export default {
this.$parent.activeName = 'AddOrEdit'
},
//
deleteRow(id) {
if (id === null || id === '') {
this.$message.warning('请选择要删除的行')
return
}
//
this.$confirm('确定要删除这调记录吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
//
const url = '/accident/delete/' + '' + id
requestFN(url).then((response) => {
//
this.$message.success('删除成功')
// eslint-disable-next-line handle-callback-err
}).catch((error) => {
this.$message.error('删除失败')
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
this.searchList()
},
/**
* 导出
*/
@ -202,12 +229,71 @@ export default {
/**
* 刷新
*/
handleRefresh() {},
handleRefresh() {
this.searchForm = this.$options.data().searchForm
this.searchList()
this.toggleSelection()
},
/**
* 批量删除
*/
handleBatchDel() {}
handleBatchDel() {
//
const selectedRows = this.multipleSelection
//
if (selectedRows.length === 0) {
this.$message.warning('请选择要删除的行')
return
}
//
this.$confirm('确定要删除这些记录吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
// ID
const ids = selectedRows.map(row => row.id).join(',')
//
const url = '/accident/delete/' + '' + ids
requestFN(url).then((response) => {
//
this.$message.success('删除成功')
this.searchList() //
// eslint-disable-next-line handle-callback-err
}).catch((error) => {
this.$message.error('删除失败')
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
this.searchList()
},
/**
* 查询字典
*/
getDict() {
const url = '/dictionaries/listSelectTree'
requestFN(url,
{
DICTIONARIES_ID: '8d4140a900184b60836ad1a6490fd510'
}
).then((data) => {
this.incidentTypes = JSON.parse(data.zTreeNodes)
})
requestFN(url,
{
DICTIONARIES_ID: 'b61a1edc59c0430c8741c5f51aa26c3c'
}
).then((data) => {
this.incidentLevels = JSON.parse(data.zTreeNodes)
})
}
}
}
</script>

View File

@ -1,4 +1,4 @@
<template>
<0template>
<div class="app-container">
<el-form ref="searchForm" :model="searchForm" label-width="100px">
<el-row :gutter="12">
@ -193,7 +193,7 @@
</div>
</el-dialog>
</div>
</template>
</0template>
<script>
import Pagination from '@/components/Pagination'