From 748be50781b3f9fefcf61ae15047fffbb967ddc6 Mon Sep 17 00:00:00 2001 From: kongyeqing <2697454777@qq.com> Date: Tue, 27 Jun 2023 17:11:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=96=B0=E5=A2=9E=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E8=AE=BE=E6=96=BD=E6=B8=85=E5=8D=95=20=20=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E8=A1=A8=E5=88=86=E6=9E=90=E8=AF=84=E4=BB=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/service/deviceAnal.service.ts | 39 + src/store/index.ts | 94 ++- src/views/blank.component.vue | 109 ++- .../assessment/device/device.component.html | 3 +- .../assessment/device/device.component.vue | 2 + .../device/deviceAnal.component.html | 90 ++- .../device/deviceAnal.component.vue | 761 ++++++++++++++++-- 7 files changed, 997 insertions(+), 101 deletions(-) create mode 100644 src/service/deviceAnal.service.ts diff --git a/src/service/deviceAnal.service.ts b/src/service/deviceAnal.service.ts new file mode 100644 index 0000000..5da4cac --- /dev/null +++ b/src/service/deviceAnal.service.ts @@ -0,0 +1,39 @@ +import BaseService from "hbt-common/service/base.service" +import type { AxiosResponse } from 'axios' +import { ActionResult } from "hbt-common/models/actionResult"; +export default class DeviceService extends BaseService{ + constructor(){ + super() + } + public selectByPage(params: any):Promise>>{ + const url = this.prefix.prevention+'/device/anal/getList'; + return this.get(url,params) + } + + public selectById(id):Promise>>{ + const url = this.prefix.prevention+'/device/anal/detail?id='+id; + return this.get(url,null,true) + } + // 新增或更新 + public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise>>{ + + if(add){ + const url = this.prefix.prevention+'/device/anal/add'; + return this.post(url,params,{},showLoading) + }else{ + const url = this.prefix.prevention+'/device/anal/update'; + return this.put(url,params,{},showLoading) + } + } + + public deleteByIds(params):Promise>>{ + const url = this.prefix.prevention +'/device/anal/delete'; + return this.deleteBatch(url,params,{},true) + } + + // 存草稿 + public addOrDraft(params: any, add: boolean,showLoading?:boolean): Promise>>{ + const url = this.prefix.prevention+'/device/anal/addDraft'; + return this.post(url,params,{},showLoading) + } +} \ No newline at end of file diff --git a/src/store/index.ts b/src/store/index.ts index b472ca7..1311bfe 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -20,7 +20,15 @@ export default new Vuex.Store({ prevention_danger_type:[], prevention_occur_step:[], prevention_major_type:[], - prevention_device_type:[] + prevention_device_type:[], + prevention_serious_result:[], + prevention_security_identifier:[], + prevention_majorsign:[], + prevention_control_level:[], + prevention_measure_type:[], + prevention_measures_sort:[], + prevention_task_type:[], + prevention_evaluate_status:[] }, getters: { dept_map:(state)=>{ @@ -127,7 +135,63 @@ export default new Vuex.Store({ map[item.value] = item.name }) return map - } + }, + prevention_serious_result_map:(state)=>{ + const map = {}; + state.prevention_serious_result.forEach((item:any)=>{ + map[item.value] = item.name + }) + return map + }, + prevention_security_identifier_map:(state)=>{ + const map = {}; + state.prevention_security_identifier.forEach((item:any)=>{ + map[item.value] = item.name + }) + return map + }, + prevention_majorsign_map:(state)=>{ + const map = {}; + state.prevention_majorsign.forEach((item:any)=>{ + map[item.value] = item.name + }) + return map + }, + prevention_control_level_map:(state)=>{ + const map = {}; + state.prevention_control_level.forEach((item:any)=>{ + map[item.value] = item.name + }) + return map + }, + prevention_measure_type_map:(state)=>{ + const map = {}; + state.prevention_measure_type.forEach((item:any)=>{ + map[item.value] = item.name + }) + return map + }, + prevention_measures_sort_map:(state)=>{ + const map = {}; + state.prevention_measures_sort.forEach((item:any)=>{ + map[item.value] = item.name + }) + return map + }, + prevention_task_type_map:(state)=>{ + const map = {}; + state.prevention_task_type.forEach((item:any)=>{ + map[item.value] = item.name + }) + return map + }, + prevention_evaluate_status_map:(state)=>{ + const map = {}; + state.prevention_evaluate_status.forEach((item:any)=>{ + map[item.value] = item.name + }) + return map + }, }, mutations: { @@ -179,7 +243,31 @@ export default new Vuex.Store({ }, set_prevention_device_type(state,data){ state.prevention_device_type = data; - } + }, + set_prevention_serious_result(state,data){ + state.prevention_serious_result = data; + }, + set_prevention_security_identifier(state,data){ + state.prevention_security_identifier = data; + }, + set_prevention_majorsign(state,data){ + state.prevention_majorsign = data; + }, + set_prevention_control_level(state,data){ + state.prevention_control_level = data; + }, + set_prevention_measure_type(state,data){ + state.prevention_measure_type = data; + }, + set_prevention_measures_sort(state,data){ + state.prevention_measures_sort = data; + }, + set_prevention_task_type(state,data){ + state.prevention_task_type = data + }, + set_prevention_evaluate_status(state,data){ + state.prevention_evaluate_status = data + }, }, actions: { }, diff --git a/src/views/blank.component.vue b/src/views/blank.component.vue index 2f7c0d3..3e86eb6 100644 --- a/src/views/blank.component.vue +++ b/src/views/blank.component.vue @@ -29,9 +29,19 @@ export default class BlankComponent extends Vue { this.systemService.getDictData("prevention_danger_type"), this.systemService.getDictData("prevention_major_type"), this.systemService.getDictData("prevention_occur_step"), - ]).then(((results:any)=>{ - this.$store.commit("setDeptTreeList",results[0].data); - this.$store.commit("setUserList",results[2].data.datas.map((item)=>{ + this.systemService.getDictData("prevention_device_type"), + + this.systemService.getDictData("prevention_serious_result"), + this.systemService.getDictData("prevention_security_identifier"), + this.systemService.getDictData("prevention_majorsign"), + this.systemService.getDictData("prevention_control_level"), + this.systemService.getDictData("prevention_measure_type"), + this.systemService.getDictData("prevention_measures_sort"), + this.systemService.getDictData("prevention_task_type"), + this.systemService.getDictData("prevention_evaluate_status"), + ]).then(((results: any) => { + this.$store.commit("setDeptTreeList", results[0].data); + this.$store.commit("setUserList", results[2].data.datas.map((item) => { return { name: item.nickName, value: item.userId @@ -83,40 +93,97 @@ export default class BlankComponent extends Vue { value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue } })) - this.$store.commit("set_prevention_cycle_unit",results[9].data.map(item=>{ + this.$store.commit("set_prevention_cycle_unit", results[9].data.map(item => { return { - name:item.dictLabel, - value:isNaN(+item.dictValue)?item.dictValue:+item.dictValue + name: item.dictLabel, + value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue } })) - this.$store.commit("set_prevention_danger_check_type",results[10].data.map(item=>{ + this.$store.commit("set_prevention_danger_check_type", results[10].data.map(item => { return { - name:item.dictLabel, - value:isNaN(+item.dictValue)?item.dictValue:+item.dictValue + name: item.dictLabel, + value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue } })) - this.$store.commit("set_prevention_danger_resource",results[11].data.map(item=>{ + this.$store.commit("set_prevention_danger_resource", results[11].data.map(item => { return { - name:item.dictLabel, - value:isNaN(+item.dictValue)?item.dictValue:+item.dictValue + name: item.dictLabel, + value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue } })) - this.$store.commit("set_prevention_danger_type",results[12].data.map(item=>{ + this.$store.commit("set_prevention_danger_type", results[12].data.map(item => { return { - name:item.dictLabel, - value:isNaN(+item.dictValue)?item.dictValue:+item.dictValue + name: item.dictLabel, + value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue } })) - this.$store.commit("set_prevention_major_type",results[13].data.map(item=>{ + this.$store.commit("set_prevention_major_type", results[13].data.map(item => { return { - name:item.dictLabel, - value:isNaN(+item.dictValue)?item.dictValue:+item.dictValue + name: item.dictLabel, + value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue } })) - this.$store.commit("set_prevention_occur_step",results[14].data.map(item=>{ + this.$store.commit("set_prevention_occur_step", results[14].data.map(item => { return { - name:item.dictLabel, - value:isNaN(+item.dictValue)?item.dictValue:+item.dictValue + name: item.dictLabel, + value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue + } + })) + this.$store.commit("set_prevention_device_type", results[15].data.map(item => { + return { + name: item.dictLabel, + value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue + } + })) + this.$store.commit("set_prevention_serious_result", results[16].data.map(item => { + return { + name: item.dictLabel, + value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue + } + })) + + this.$store.commit("set_prevention_security_identifier", results[17].data.map(item => { + return { + name: item.dictLabel, + value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue + } + })) + this.$store.commit("set_prevention_majorsign", results[18].data.map(item => { + return { + name: item.dictLabel, + value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue + } + })) + this.$store.commit("set_prevention_control_level", results[19].data.map(item => { + return { + name: item.dictLabel, + value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue + } + })) + this.$store.commit("set_prevention_measure_type", results[20].data.map(item => { + return { + name: item.dictLabel, + value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue + } + })) + this.$store.commit("set_prevention_measures_sort", results[21].data.map(item => { + return { + name: item.dictLabel, + value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue, + children: item.children + } + })) + this.$store.commit("set_prevention_task_type", results[22].data.map(item => { + return { + name: item.dictLabel, + value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue, + children: item.children + } + })) + this.$store.commit("set_prevention_evaluate_status", results[23].data.map(item => { + return { + name: item.dictLabel, + value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue, } })) diff --git a/src/views/risk/assessment/device/device.component.html b/src/views/risk/assessment/device/device.component.html index 858b473..98049a2 100644 --- a/src/views/risk/assessment/device/device.component.html +++ b/src/views/risk/assessment/device/device.component.html @@ -72,7 +72,6 @@ - @@ -97,8 +96,8 @@ - + \ No newline at end of file diff --git a/src/views/risk/assessment/device/device.component.vue b/src/views/risk/assessment/device/device.component.vue index 88c5acf..980e67c 100644 --- a/src/views/risk/assessment/device/device.component.vue +++ b/src/views/risk/assessment/device/device.component.vue @@ -149,6 +149,7 @@ export default class DeviceManagerComponent extends BaseRecordComponent { }, { name: "设备类型", key: "type", + format: "typeName", type: "select", require: true, width: "calc(50% - 20px)", @@ -374,6 +375,7 @@ export default class DeviceManagerComponent extends BaseRecordComponent { this.updateParams = Object.assign({ safetyFactorName: res.data.safetyFactor.split(";").map(item => this.$store.getters.prevention_safe_reason_map[item]).join(";"), identifyUserName: this.$store.getters.user_map[res.data.identifyUserId], + typeName: this.$store.getters.prevention_device_type_map[res.data.type], }, res.data) } else { this.isReadonly = false diff --git a/src/views/risk/assessment/device/deviceAnal.component.html b/src/views/risk/assessment/device/deviceAnal.component.html index 85e8fb9..0ecc072 100644 --- a/src/views/risk/assessment/device/deviceAnal.component.html +++ b/src/views/risk/assessment/device/deviceAnal.component.html @@ -1,7 +1,6 @@
-
- - +
+
- -
作业步骤
- - - - + :isReadonly="isReadonly" @actionCallback="callback" @change="changes"> +
安全检查表分析法
+ + - + - + +
+ + +
+ + + + + + + + + + + + + + + - - - - -
\ No newline at end of file diff --git a/src/views/risk/assessment/device/deviceAnal.component.vue b/src/views/risk/assessment/device/deviceAnal.component.vue index 697f322..33adb77 100644 --- a/src/views/risk/assessment/device/deviceAnal.component.vue +++ b/src/views/risk/assessment/device/deviceAnal.component.vue @@ -1,6 +1,6 @@