diff --git a/src/store/index.ts b/src/store/index.ts index 1c41a99..c4fe200 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -10,6 +10,7 @@ export default new Vuex.Store({ userList:[], common_yes_no:[], prevention_dangrous_level:[], + prevention_risk_level:[], }, getters: { common_yes_no_map:(state)=>{ @@ -21,7 +22,14 @@ export default new Vuex.Store({ }, prevention_dangrous_level_map:(state)=>{ const map = {}; - state.common_yes_no.forEach((item:any)=>{ + state.prevention_dangrous_level.forEach((item:any)=>{ + map[item.value] = item.name + }) + return map + }, + prevention_risk_level_map:(state)=>{ + const map = {}; + state.prevention_risk_level.forEach((item:any)=>{ map[item.value] = item.name }) return map @@ -43,6 +51,9 @@ export default new Vuex.Store({ }, set_prevention_dangrous_level(state,data){ state.prevention_dangrous_level = data; + }, + set_prevention_risk_level(state,data){ + state.prevention_risk_level = data; } }, actions: { diff --git a/src/views/blank.component.vue b/src/views/blank.component.vue index 7492686..97c8423 100644 --- a/src/views/blank.component.vue +++ b/src/views/blank.component.vue @@ -14,7 +14,8 @@ export default class BlankComponent extends Vue { this.systemService.getDeptList(), this.systemService.getUserList({pageSize:0}), this.systemService.getDictData("common_yes_no"), - this.systemService.getDictData("prevention_dangrous_level") + this.systemService.getDictData("prevention_dangrous_level"), + this.systemService.getDictData("prevention_risk_level") ]).then(((results:any)=>{ this.$store.commit("setDeptTreeList",results[0].data); @@ -43,6 +44,12 @@ export default class BlankComponent extends Vue { value:isNaN(+item.dictValue)?item.dictValue:+item.dictValue } })) + this.$store.commit("set_prevention_risk_level",results[5].data.map(item=>{ + return { + name:item.dictLabel, + value:isNaN(+item.dictValue)?item.dictValue:+item.dictValue + } + })) })) } } diff --git a/src/views/common.component.scss b/src/views/common.component.scss index dbdd477..8a46f8e 100644 --- a/src/views/common.component.scss +++ b/src/views/common.component.scss @@ -51,7 +51,10 @@ &.active { &::before { position: absolute; - inset: 0; + left: 0; + top: 0; + right: 0; + bottom: 0; content: ""; background: #68C23A; z-index: 1; diff --git a/src/views/risk/assessment/areaAnal/areaAnal.component.html b/src/views/risk/assessment/areaAnal/areaAnal.component.html index 7badb41..1cd165f 100644 --- a/src/views/risk/assessment/areaAnal/areaAnal.component.html +++ b/src/views/risk/assessment/areaAnal/areaAnal.component.html @@ -1,4 +1,4 @@ -
+
- + - - + + - - -
+ + +
不涉及
-
{{scope.row.type1}}
+
{{scope.row.type1}}
-
{{scope.row.type2}}
+
{{scope.row.type2}}
-
{{scope.row.type3}}
+
{{scope.row.type3}}
-
{{scope.row.type4}}
+
{{scope.row.type4}}
@@ -64,6 +77,7 @@ - + +
\ No newline at end of file diff --git a/src/views/risk/assessment/areaAnal/areaAnal.component.vue b/src/views/risk/assessment/areaAnal/areaAnal.component.vue index 631862e..efc3084 100644 --- a/src/views/risk/assessment/areaAnal/areaAnal.component.vue +++ b/src/views/risk/assessment/areaAnal/areaAnal.component.vue @@ -44,7 +44,7 @@ export default class AreaAnalComponent extends BaseRecordComponent { }]; public formOptions:FormOption[] = [{ name:"区域名称", - key:"areaId", + key:"name", type:"text", }]; @@ -72,8 +72,7 @@ export default class AreaAnalComponent extends BaseRecordComponent { } public buildTable(){ - this.tableColumn.push({name:'序号',key:"areaName"}); - this.tableColumn.push({name:'区域名称',key:"areaName"}); + this.tableColumn.push({name:'区域名称',key:"name"}); this.tableColumn.push({name:'区域内发生事故的可能性/L',width:"195",render:(data)=>{ if(!data.analFlag|| data.edit){ return ""+(data.analLikelihoodValue || "选取L值")+"" @@ -91,7 +90,7 @@ export default class AreaAnalComponent extends BaseRecordComponent { }}); this.tableColumn.push({name:'区域固有风险',render:(data)=>{ - return ""+data.analRiskLevel+"" + return ""+(this.$store.getters.prevention_risk_level_map[data.analRiskLevel] || '')+"" }}); this.tableColumn.push({name:'评估完成情况',key:"status",render:(data)=>{ if(data.edit){ @@ -162,10 +161,13 @@ export default class AreaAnalComponent extends BaseRecordComponent { this.$message.error("请选取S值"); return } - row.edit = false; // 因为按索引取值 所以要-1 - row.analRiskLevel=riskLevel[row.analLikelihoodValue - 1][row.analSeverityValue - 1] - row.analFlag = 1; + row.analRiskLevel=riskLevel[row.analLikelihoodValue - 1][row.analSeverityValue - 1]; + row.analFlag = 1; + this.tableService.addOrUpdate(row,false,true).then((res)=>{ + this.$message.success("保存成功") + row.edit = false; + }) }