From 598c8b67fa044f165c5535d83c285613e9a7cd40 Mon Sep 17 00:00:00 2001 From: kongyeqing <2697454777@qq.com> Date: Tue, 5 Sep 2023 18:13:13 +0800 Subject: [PATCH] =?UTF-8?q?fit:=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/analEvaluation.component.vue | 2 +- src/components/draw.component.vue | 2 +- src/components/map.component.vue | 2 +- src/global.d.ts | 1 + src/router/index.ts | 6 + src/service/unit.service.ts | 6 + src/views/common.component.scss | 2 +- .../hiddenDanger/rules/rules.component.html | 109 +++---- .../hiddenDanger/rules/rules.component.vue | 289 +++++++++--------- .../hiddenDanger/safe/action.component.vue | 1 + src/views/risk/area/area.component.vue | 2 +- src/views/risk/areaUnit.component.html | 15 +- .../areaAnal/areaAnal.component.html | 4 - .../areaAnal/areaAnal.component.vue | 42 ++- .../risk/assessment/work/work.component.vue | 11 +- src/views/workprogress/leader.component.vue | 10 +- 16 files changed, 284 insertions(+), 220 deletions(-) diff --git a/src/components/analEvaluation.component.vue b/src/components/analEvaluation.component.vue index 0ff10d6..8635bb0 100644 --- a/src/components/analEvaluation.component.vue +++ b/src/components/analEvaluation.component.vue @@ -1153,7 +1153,7 @@ export default class AnalEvaluationComponent extends Vue { } } - //整理数据 + public collationAnalysisDataMethod() { this.analysisUpdateParams.measuresNum = this.analysisUpdateParams.measures.length; this.analysisUpdateParams.seriousResult = this.analysisUpdateParams.seriousResult.join(","); diff --git a/src/components/draw.component.vue b/src/components/draw.component.vue index ad3053e..bcdbecd 100644 --- a/src/components/draw.component.vue +++ b/src/components/draw.component.vue @@ -11,7 +11,7 @@
- +
{ - return [118.751353,31.969568] + return [119.592977,34.523847] } }) center:number[] diff --git a/src/global.d.ts b/src/global.d.ts index 105d56e..3f000bf 100644 --- a/src/global.d.ts +++ b/src/global.d.ts @@ -2,4 +2,5 @@ declare module 'common/notFound'; declare module 'common/index'; declare module 'common/layout'; +declare module 'common/login'; declare module 'file-saver' \ No newline at end of file diff --git a/src/router/index.ts b/src/router/index.ts index 5900e81..f2e508b 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -2,6 +2,7 @@ import Vue from 'vue' import VueRouter, { RouteConfig } from 'vue-router' import pageNoFoundComponent from 'common/notFound' import indexComponent from 'common/index' +import LoginComponent from 'common/login' import LayoutComponent from "common/layout" import HomeComponent from '@/views/home/home.component.vue' import BlankComponent from "@/views/blank.component.vue" @@ -316,6 +317,11 @@ const routes: Array = [ name: 'index', component:indexComponent }, + { + path: '/login', + name: 'login', + component:LoginComponent + }, { path: '*', name: '404', diff --git a/src/service/unit.service.ts b/src/service/unit.service.ts index 83884b6..c327016 100644 --- a/src/service/unit.service.ts +++ b/src/service/unit.service.ts @@ -36,6 +36,12 @@ export default class UnitService extends BaseService{ return this.post(url,params,{},showLoading) } + //获取单元详情 + public getUnitDetail(params):Promise>>{ + const url = this.prefix.prevention+'/risk/unit/repairList'; + return this.get(url,params) + } + // 新增或更新 public addOrUpdate(params: any, add: boolean,showLoading?:boolean): Promise>>{ diff --git a/src/views/common.component.scss b/src/views/common.component.scss index 0d1e05d..a1d2ca5 100644 --- a/src/views/common.component.scss +++ b/src/views/common.component.scss @@ -195,7 +195,7 @@ color: #F56C6C; margin-left: -43px; margin-bottom: 20px; - margin-top: -20px; + margin-top: -10px; font-size: 20px; scale:0.5; } \ No newline at end of file diff --git a/src/views/hiddenDanger/rules/rules.component.html b/src/views/hiddenDanger/rules/rules.component.html index 6f3f8ef..36fb548 100644 --- a/src/views/hiddenDanger/rules/rules.component.html +++ b/src/views/hiddenDanger/rules/rules.component.html @@ -1,15 +1,15 @@ -
+
- - - @@ -19,96 +19,99 @@ - +
- - + +
检查项目
- - - + - + - -
- - + + - + - - - - + + + + + + + + +
+ 取消 + 确定 +
\ No newline at end of file diff --git a/src/views/hiddenDanger/rules/rules.component.vue b/src/views/hiddenDanger/rules/rules.component.vue index 8a07cf3..51680dc 100644 --- a/src/views/hiddenDanger/rules/rules.component.vue +++ b/src/views/hiddenDanger/rules/rules.component.vue @@ -12,7 +12,7 @@ import RuleService from '@/service/rule.service'; import { number } from 'echarts'; @Component({ template, - components:{ + components: { FormComponent, TableComponent, DrawComponent, @@ -28,45 +28,45 @@ export default class RulesComponent extends BaseRecordComponent { public isManager = false; public formActions = [{ - name:"查询", - value:"search", - icon:"el-icon-search", - type:"primary" - },{ - name:"清空", - icon:"el-icon-tickets", - value:"reset" + name: "查询", + value: "search", + icon: "el-icon-search", + type: "primary" + }, { + name: "清空", + icon: "el-icon-tickets", + value: "reset" }]; public tableActions = [{ - name:"添加", - value:"add", - icon:"el-icon-plus", - type:"primary" - },{ - name:"批量删除", - value:"delete", - plain:true, - icon:"el-icon-delete", - type:"danger" + name: "添加", + value: "add", + icon: "el-icon-plus", + type: "primary" + }, { + name: "批量删除", + value: "delete", + plain: true, + icon: "el-icon-delete", + type: "danger" }]; public footerActions = [{ - name:"选择全部", - value:"selectAll", - type:"primary" - },{ - name:"反向选择", - value:"reverse" + name: "选择全部", + value: "selectAll", + type: "primary" + }, { + name: "反向选择", + value: "reverse" }]; - public formOptions:FormOption[] = [{ - name:"检查项目", - key:"name", - type:"text", + public formOptions: FormOption[] = [{ + name: "检查项目", + key: "name", + type: "text", }]; public showUpdate = false; public currentId = -1; - public updateParams = {} as any; - public updateOptions:FormOption[] = []; + public updateParams = {} as any; + public updateOptions: FormOption[] = []; public showDraw = false; @@ -74,184 +74,201 @@ export default class RulesComponent extends BaseRecordComponent { public drawModel = "list"; - public updateActions = [{ - name:"取消", - value:"cancel" - },{ - name:"保存并继续添加", - value:"saveAndContinue", - type:"primary" - },{ - name:"保存", - value:"save", - type:"primary" - }]; + public updateActions = [] as any; public selectData = []; - - created(){ + + created() { } - public getTableCallback(){ + public getTableCallback() { this.updateOptions = [{ - name:"检查标准编号", - key:"number", - type:"text", - width:"calc(50% - 20px)", - require:true, - showError:false, - disable:true, - },{ - name:"检查项目", - key:"name", - type:"text", - width:"calc(50% - 20px)", - require:true, - showError:false, - },{ - name:"检查内容", - key:"content", - type:"textarea", - width:"100%", - require:true, - showError:false, - },{ - name:"检查依据", - key:"reason", - type:"textarea", - width:"100%", - require:true, - showError:false, - },{ - name:"类型", - key:"type", - format:"typeName", - type:"select", - width:"100%", - require:true, - datas:this.$store.state.prevention_dangrous_type + name: "检查标准编号", + key: "number", + type: "text", + width: "calc(50% - 20px)", + require: true, + showError: false, + disable: true, + }, { + name: "检查项目", + key: "name", + type: "text", + width: "calc(50% - 20px)", + require: true, + showError: false, + }, { + name: "检查内容", + key: "content", + type: "textarea", + width: "100%", + require: true, + showError: false, + }, { + name: "检查依据", + key: "reason", + type: "textarea", + width: "100%", + require: true, + showError: false, + }, { + name: "类型", + key: "type", + format: "typeName", + type: "select", + width: "100%", + require: true, + multiple: true, + showError: false, + datas: this.$store.state.prevention_dangrous_type + }] + this.updateActions = [{ + name: "取消", + value: "cancel" + }, { + name: "保存并继续添加", + value: "saveAndContinue", + type: "primary", + hide: this.updateParams.id + }, { + name: "保存", + value: "save", + type: "primary" }] } - public buildTable(){ - this.tableColumn.push({name:'检查项目',key:"name"}); - this.tableColumn.push({name:'检查内容',key:"content",showTip:true}); - this.tableColumn.push({name:'检查依据',key:"reason",showTip:true}); - this.tableColumn.push({name:'分类',key:"type",render:(data)=>{ - return this.$store.getters.prevention_dangrous_type_map[data.type] - }}); + public buildTable() { + this.tableColumn.push({ name: '检查项目', key: "name" }); + this.tableColumn.push({ name: '检查内容', key: "content", showTip: true }); + this.tableColumn.push({ name: '检查依据', key: "reason", showTip: true }); + this.tableColumn.push({ + name: '分类', key: "type", render: (data) => { + return data.type.split(',').map(item => { + return this.$store.getters.prevention_dangrous_type_map[item] + }).join(",") + } + }); } - public change(data,item){ + public change(data, item) { // } - public callback(data,type?){ - if(type){ + public callback(data, type?) { + if (type) { this.params[type] = data; this.getTableData(); return } // 查询 - if(data && data.value==="search"){ + if (data && data.value === "search") { this.getTableData() - // 重置 - }else if(data && data.value === "reset"){ + // 重置 + } else if (data && data.value === "reset") { this.reset() - // 反选 - }else if(data && data.value === "reverse"){ + // 反选 + } else if (data && data.value === "reverse") { this.toggleAll() - // 全选 - }else if(data && data.value === "selectAll"){ + // 全选 + } else if (data && data.value === "selectAll") { this.selectAll() - }else if(data && data.value === "add"){ + } else if (data && data.value === "add") { this.showUpdateModel() - }else if(data && data.value === "delete"){ - this.deleteData(this.selectData.map((item:any)=>item.id)); + } else if (data && data.value === "delete") { + this.deleteData(this.selectData.map((item: any) => item.id)); this.clearSelect() - }else if(data && data.value.indexOf("save")>=0){ - this.doSave(data.value!=="save") - }else{ + } else if (data && data.value.indexOf("save") >= 0) { + this.doSave(data.value !== "save") + } else { this.handleClose(); } } // 重置数据 - public reset(){ + public reset() { this.params = { - name:"", - pageNum:1, - pageSize:20, + name: "", + pageNum: 1, + pageSize: 20, } as any; } - - public doSave(goOn?){ - this.tableService.addOrUpdate(this.updateParams,this.currentId===-1).then((res=>{ - this.$message.success(this.currentId===-1?"新增成功!":"编辑成功"); + /** + * 数据保存 + * @param goOn + */ + public doSave(goOn?) { + this.updateParams.type = this.updateParams.type.join(',') + this.tableService.addOrUpdate(this.updateParams, this.currentId === -1).then((res => { + this.$message.success(this.currentId === -1 ? "新增成功!" : "编辑成功"); this.showUpdate = !!goOn; - this.updateParams = {number:null} as any; - if(goOn){ - this.tableService.getNumber().then(res=>{ + this.updateParams = { number: null } as any; + if (goOn) { + this.tableService.getNumber().then(res => { this.updateParams.number = res.data }) } this.getTableData(); - })) } - public showUpdateModel(row?,isRead?){ - - this.updateParams = Object.assign({number:null}) + public showUpdateModel(row?, isRead?) { + this.updateParams = Object.assign({ number: null }) this.isReadonly = !!isRead; - if(!row){ + if (!row) { this.currentId = -1; - this.tableService.getNumber().then(res=>{ + this.tableService.getNumber().then(res => { this.updateParams.number = res.data }) - }else{ - this.updateParams = Object.assign({number:null,typeName:this.$store.getters.prevention_dangrous_type_map[row.type]},row) + } else { + this.updateParams = Object.assign({ + number: null, + typeName: row.type.split(',').map(item => { + return this.$store.getters.prevention_dangrous_type_map[item] + }).join(",") + }, row) + this.updateParams.type = row.type.split(',').map((item: any) => parseInt(item)) this.currentId = row.id; } this.clearSelect(); - this.showUpdate = true + this.getTableCallback() + this.showUpdate = true; } - public clearSelect(){ + public clearSelect() { (this.$refs.multipleTable as any).clearSelection(); this.selectData = []; } - public handleClose(){ + public handleClose() { this.showUpdate = false; this.clearSelect(); } public toggleAll() { - - this.tableData.datas.forEach((item,index)=>{ + + this.tableData.datas.forEach((item, index) => { (this.$refs.multipleTable as any).toggleRowSelection(item); }) } - public selectAll(){ - if(!this.selectData.length){ + public selectAll() { + if (!this.selectData.length) { this.toggleAll() - }else{ - this.tableData.datas.forEach((item,index)=>{ - const find = this.selectData.find((data:any)=>data.id === item.id); - if(!find){ + } else { + this.tableData.datas.forEach((item, index) => { + const find = this.selectData.find((data: any) => data.id === item.id); + if (!find) { (this.$refs.multipleTable as any).toggleRowSelection(item); } }) } } - public handleSelectionChange(data){ + public handleSelectionChange(data) { this.selectData = data; } } diff --git a/src/views/hiddenDanger/safe/action.component.vue b/src/views/hiddenDanger/safe/action.component.vue index e2cd102..db1e02a 100644 --- a/src/views/hiddenDanger/safe/action.component.vue +++ b/src/views/hiddenDanger/safe/action.component.vue @@ -544,6 +544,7 @@ export default class RulesManagerComponent extends BaseRecordComponent { pageNum: 1, pageSize: 20, } as any; + this.getTableData() } public getMap(map) { diff --git a/src/views/risk/area/area.component.vue b/src/views/risk/area/area.component.vue index 9b87721..ed6321f 100644 --- a/src/views/risk/area/area.component.vue +++ b/src/views/risk/area/area.component.vue @@ -111,7 +111,7 @@ export default class AreaManagerComponent extends BaseRecordComponent { created() { - +// } public buildFormOptions() { diff --git a/src/views/risk/areaUnit.component.html b/src/views/risk/areaUnit.component.html index d5b3cb7..cb7660c 100644 --- a/src/views/risk/areaUnit.component.html +++ b/src/views/risk/areaUnit.component.html @@ -1,13 +1,13 @@
- + @@ -54,12 +54,9 @@ :data.sync="updateParams" @actionCallback="callback" :actions="updateActions" :full-btn="true" @change="change" btn-position="center"> *注:安全风险分析对象编码即危险化学品登记综合服务系统中的危险源编码 - -
停用/检修记录
- + :showFooter="false" style="margin-bottom: 20px;height: 200px;"> diff --git a/src/views/risk/assessment/areaAnal/areaAnal.component.html b/src/views/risk/assessment/areaAnal/areaAnal.component.html index f91dc87..adc2826 100644 --- a/src/views/risk/assessment/areaAnal/areaAnal.component.html +++ b/src/views/risk/assessment/areaAnal/areaAnal.component.html @@ -91,11 +91,7 @@
{{scope.row.type4}}
- - - -
diff --git a/src/views/risk/assessment/areaAnal/areaAnal.component.vue b/src/views/risk/assessment/areaAnal/areaAnal.component.vue index 4a6ea32..1dcb7eb 100644 --- a/src/views/risk/assessment/areaAnal/areaAnal.component.vue +++ b/src/views/risk/assessment/areaAnal/areaAnal.component.vue @@ -144,11 +144,18 @@ export default class AreaAnalComponent extends BaseRecordComponent { this.showUpdate = true } - // 新增 添加L/S值 - public addVal(el, row) { + /** + * 新增 添加L/S值 + * @param el + * @param row 当前行数据 + */ + public addVal(el: any, row: any) { + this.riskLDatas = []; + this.riskSDatas = []; this.currentRow = row; this.cacheCurrentRow = JSON.parse(JSON.stringify(row)); - this.riskLDatas = riskLData; + this.riskLDatas = JSON.parse(JSON.stringify(riskLData)); + this.riskSDatas = JSON.parse(JSON.stringify(riskSData)); this.popTitle = 'L'; const lData = JSON.parse(row.analLikelihoodContent || "[]"); const sData = JSON.parse(row.analSeverityContent || "[]"); @@ -222,7 +229,30 @@ export default class AreaAnalComponent extends BaseRecordComponent { } if (row[column.property] !== '/') { row.value = column.index - 1 + this.countEstimateValue() } + + } + + public countEstimateValue() { + let value: number = 0; + let len: number = 0; + let tmpRiskDatas = [] + if (this.popTitle === 'L') { + tmpRiskDatas = this.riskLDatas + } + if (this.popTitle === 'S') { + tmpRiskDatas = this.riskSDatas + } + tmpRiskDatas.forEach((item: any) => { + if (item.value && typeof (item.value) === 'number') { + len = len + 1 + value = value + item.value + } + }) + tmpRiskDatas.forEach((item: any) => { + item.result = Math.round(value / len).toString() + }) } public startEdit(row) { @@ -274,7 +304,9 @@ export default class AreaAnalComponent extends BaseRecordComponent { this.popTitle = 'S'; this.stepsActive = 2; this.riskLDatas[0].value = value; - this.riskSDatas = JSON.parse(JSON.stringify(riskSData)); + if (this.riskSDatas.length === 0) { + this.riskSDatas = JSON.parse(JSON.stringify(riskSData)); + } this.updateBtn(); } else { this.currentRow.analSeverityContent = content; @@ -304,7 +336,7 @@ export default class AreaAnalComponent extends BaseRecordComponent { //单选 public selectRadioData(data) { - console.log('data', data); + // console.log('data', data); } //点击L 步骤 diff --git a/src/views/risk/assessment/work/work.component.vue b/src/views/risk/assessment/work/work.component.vue index 2d78b88..7cf91bf 100644 --- a/src/views/risk/assessment/work/work.component.vue +++ b/src/views/risk/assessment/work/work.component.vue @@ -120,7 +120,7 @@ export default class WorkManagerComponent extends BaseRecordComponent { name: "保存并继续添加", value: "saveAndContinue", type: "primary", - hide:this.updateParams.id + hide: this.updateParams.id }, { name: "保存", value: "save", @@ -137,7 +137,7 @@ export default class WorkManagerComponent extends BaseRecordComponent { name: "保存并继续添加", value: "saveAndContinue", type: "primary", - hide:this.stepUpdateParams.index + hide: this.stepUpdateParams.index }, { name: "保存", value: "save", @@ -470,6 +470,7 @@ export default class WorkManagerComponent extends BaseRecordComponent { } this.showSubUpdate = true; this.subUpdateActionsForm(); + this.buildUpdateForm(); } public doSubDelete(indexs) { @@ -486,6 +487,10 @@ export default class WorkManagerComponent extends BaseRecordComponent { public doSave(goOn?) { + if (this.updateParams.steps.length === 0) { + this.$message.warning("请您至少添加一条作业步骤!"); + return + } // 如果是新增步骤 if (this.showSubUpdate) { // 新增 @@ -598,7 +603,7 @@ export default class WorkManagerComponent extends BaseRecordComponent { this.toggleAll() } else { this.tableData.datas.forEach((item, index) => { - const find = this.selectData.find((data: any) => data.userId === item.userId); + const find = this.selectData.find((data: any) => data.id === item.id); if (!find) { (this.$refs.multipleTable as any).toggleRowSelection(item); } diff --git a/src/views/workprogress/leader.component.vue b/src/views/workprogress/leader.component.vue index 4a6f9e6..4d486d6 100644 --- a/src/views/workprogress/leader.component.vue +++ b/src/views/workprogress/leader.component.vue @@ -601,13 +601,13 @@ export default class LeadershipStructure extends BaseRecordComponent { //删除成员 public deleteSubData(indexs) { - if(indexs.length === 0){ + if (indexs.length === 0) { this.$message.warning("请选择要删除的数据!") - }else{ + } else { this.$confirm('确认删除所选数据', '确认数据', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' }).then(() => { for (let i = this.updateParams.members.length - 1; i >= 0; i--) { if (indexs.includes(i)) {