From a930cbf3386f94022a70197aae527698639b9022 Mon Sep 17 00:00:00 2001 From: kongyeqing <2697454777@qq.com> Date: Tue, 27 Jun 2023 17:12:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=96=B0=E5=A2=9E=E9=A3=8E=E9=99=A9?= =?UTF-8?q?=E8=BE=A8=E8=AF=86=E6=B8=85=E5=8D=95=20=E9=A3=8E=E9=99=A9?= =?UTF-8?q?=E7=AE=A1=E6=8E=A7=E6=8E=AA=E6=96=BD=E6=B8=85=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/service/identify.service.ts | 4 +- src/service/measures.service.ts | 6 +- .../risk/identify/identify.component.html | 38 +- .../risk/identify/identify.component.vue | 501 ++++++++++++++---- .../risk/measures/measures.component.html | 48 +- .../risk/measures/measures.component.vue | 285 ++++++---- 6 files changed, 628 insertions(+), 254 deletions(-) diff --git a/src/service/identify.service.ts b/src/service/identify.service.ts index a526c26..d488467 100644 --- a/src/service/identify.service.ts +++ b/src/service/identify.service.ts @@ -6,11 +6,11 @@ export default class IdentifyService extends BaseService{ super() } public selectByPage(params: any):Promise>>{ - const url = this.prefix.system+'/user/list'; + const url = this.prefix.prevention+'/risk/identifyinventory/getList'; return this.get(url,params,true) } public deleteByIds(params):Promise>>{ - const url = this.prefix.system+'/user/list'; + const url = this.prefix.prevention+'/risk/identifyinventory'; return this.deleteBatch(url,params,{},true) } } \ No newline at end of file diff --git a/src/service/measures.service.ts b/src/service/measures.service.ts index dded49b..7adb9d2 100644 --- a/src/service/measures.service.ts +++ b/src/service/measures.service.ts @@ -6,11 +6,13 @@ export default class MeasuresService extends BaseService{ super() } public selectByPage(params: any):Promise>>{ - const url = this.prefix.system+'/user/list'; + const url = this.prefix.prevention+'/risk/inventory/list'; return this.get(url,params,true) } public deleteByIds(params):Promise>>{ - const url = this.prefix.system+'/user/list'; + const url = this.prefix.prevention+'/risk/inventory'; return this.deleteBatch(url,params,{},true) } + + } \ No newline at end of file diff --git a/src/views/risk/identify/identify.component.html b/src/views/risk/identify/identify.component.html index 6a715cf..8151220 100644 --- a/src/views/risk/identify/identify.component.html +++ b/src/views/risk/identify/identify.component.html @@ -1,7 +1,6 @@ -
-
- - +
+
+
- + @actionCallback="callback($event)" @pageNumberChange="callback($event)" + @pageSizeChange="callback($event)" :footerActions="footerActions" :actions="tableActions"> + + + + - +
- - +
风险辨识情况
+ +
风险评估情况
+ +
残余风险评估情况
+ + +
\ No newline at end of file diff --git a/src/views/risk/identify/identify.component.vue b/src/views/risk/identify/identify.component.vue index 15cd856..e357d0e 100644 --- a/src/views/risk/identify/identify.component.vue +++ b/src/views/risk/identify/identify.component.vue @@ -9,158 +9,433 @@ import IdentifyService from "@/service/identify.service" import FormOption from "hbt-common/models/formOptions" import BtnOption from "hbt-common/models/btnOptions" import DrawComponent from '@/components/draw.component.vue'; +import ButtonListComponent from "hbt-common/components/common/buttonList.component.vue"; +import UnitTreeComponent from '@/components/tree.component.vue'; + @Component({ template, - components:{ + components: { FormComponent, TableComponent, DrawComponent, + ButtonListComponent, + UnitTreeComponent, }, }) export default class IdentifyManagerComponent extends BaseRecordComponent { public tableService = new IdentifyService(); - public params = {} as any; - - public treeData = [{ - label: '一级 1', - children: [{ - label: '二级 1-1', - children: [{ - label: '三级 1-1-1' - }] - }] - }, { - label: '一级 2', - children: [{ - label: '二级 2-1', - children: [{ - label: '三级 2-1-1' - }] - }, { - label: '二级 2-2', - children: [{ - label: '三级 2-2-1' - }] - }] - }, { - label: '一级 3', - children: [{ - label: '二级 3-1', - children: [{ - label: '三级 3-1-1' - }] - }, { - label: '二级 3-2', - children: [{ - label: '三级 3-2-1' - }] - }] - }] + public params = { + areaId:null, + unitId:null, + } as any; 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:"delete", - plain:true, - icon:"el-icon-delete", - type:"danger" + 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:"areaId", - type:"text", - },{ - name:"单元名称", - key:"unitId", - type:"text", + public formOptions: FormOption[] = [{ + name: "管控对象", + key: "controlName", + type: "text", + }, { + name: "分析对象", + key: "analName", + type: "text", + }]; + + public subActions = [{ + name: "取消", + value: "cancel" }]; public showUpdate = false; - public updateParams = {} as any; + public updateParams = {} as any; public selectData = []; + //风险辨识情况 + public subUpdateParams = {} as any; + //风险评估情况 + public riskUpdateParams = {} as any; + //残余风险评估情况 + public remainUpdateParams = {} as any; - created(){ + public updateOptions: FormOption[] = [] as any; + //风险评估 + public subRiskOptions: FormOption[] = []; + //残余风险评估 + public subRemnantsOptions: FormOption[] = []; + public buildUpdateForm() { + this.updateOptions = [{ + name: "管控对象", + key: "controlName", + type: "textarea", + require: true, + width: "calc(50% - 20px)", + disable: true, + }, + { + name: "分析对象", + key: "analName", + type: "textarea", + require: true, + width: "calc(50% - 20px)", + disable: true, + }, + { + name: "风险源", + key: "riskSource", + type: "text", + require: true, + width: "calc(50% - 20px)" + }, + { + name: "最严重后果", + key: "seriousResult", + format: "seriousResultName", + type: "select", + require: true, + multiple: true, + width: "calc(50% - 20px)", + datas: this.$store.state.prevention_serious_result, + }, + { + name: "危害分析", + key: "hazardAnalysis", + type: "text", + require: true, + width: "calc(100% - 20px)" + }, + { + name: "安全警示标识", + key: "safetySign", + format: "safetySignName", + type: "select", + require: true, + multiple: true, + width: "calc(50% - 20px)", + datas: this.$store.state.prevention_security_identifier, + }, + { + name: "设置复评时间", + key: "reviewStartTime", + type: "date", + subType: "date", + width: "calc(50% - 20px)", + require: true, + showError: false, + format: "yyyy-MM-dd" + },]; + this.subRiskOptions = [ + { + name: "LS法:", + key: "riskLSValue", + type: "text", + // width: "20px", + }, { + name: "L值:", + key: "lslvalue", + type: "text", + width: "10%", + labelWidth: "40px", + }, { + name: "S值:", + key: "lssvalue", + type: "text", + width: "10%", + labelWidth: "40px", + }, { + name: "R值:", + key: "lsrvalue", + type: "text", + width: "20%", + labelWidth: "40px", + }, { + name: "风险等级:", + key: "lsgrade", + format: 'lsgradeName', + type: "text", + width: "20%", + labelWidth: "60px", + }, { + name: "LEC法:", + key: "riskLECValue", + type: "text", + // labelWidth: "30px", + }, { + name: "L值:", + key: "leclvalue", + type: "text", + width: "10%", + labelWidth: "40px", + }, { + name: "E值:", + key: "lecevalue", + type: "text", + width: "10%", + labelWidth: "40px", + }, { + name: "C值:", + key: "leccvalue", + type: "text", + width: "10%", + labelWidth: "40px", + }, { + name: "D值:", + key: "lecdvalue", + type: "text", + width: "15%", + labelWidth: "40px", + }, { + name: "风险等级:", + key: "lecgrade", + format: "lecgradeName", + type: "text", + width: "20%", + labelWidth: "60px", + }, { + name: "风险等级", + key: "riskLevel", + format: "riskLevelName", + type: "text", + require: true, + width: "100%", + }, { + name: "管控层级", + key: "riskControlLevel", + format: "riskControlLevelName", + type: "text", + require: true, + }]; + + this.subRemnantsOptions = [ + { + name: "LS法:", + key: "remainLSValue", + type: "text", + // width: "30px", + }, { + name: "L值:", + key: "lslvalue", + type: "text", + width: "10%", + labelWidth: "40px", + }, { + name: "S值:", + key: "lssvalue", + type: "text", + width: "10%", + labelWidth: "40px", + }, { + name: "R值:", + key: "lsrvalue", + type: "text", + width: "20%", + labelWidth: "40px", + }, { + name: "风险等级:", + key: "lsgrade", + format: "lsgradeName", + type: "text", + width: "20%", + labelWidth: "60px", + }, { + name: "LEC法:", + key: "remainLECValue", + type: "text", + // width: "30px", + }, { + name: "L值:", + key: "leclvalue", + type: "text", + width: "10%", + labelWidth: "40px", + }, { + name: "E值:", + key: "lecevalue", + type: "text", + width: "10%", + labelWidth: "40px", + }, { + name: "C值:", + key: "leccvalue", + type: "text", + width: "10%", + labelWidth: "40px", + }, { + name: "D值:", + key: "lecdvalue", + type: "text", + width: "15%", + labelWidth: "40px", + }, { + name: "风险等级:", + key: "lecgrade", + format: "lecgradeName", + type: "text", + width: "20%", + labelWidth: "60px", + }, { + name: "风险等级", + key: "remainLevel", + format: "remainLevelName", + type: "select", + require: true, + width: "calc(50% - 20px)", + },]; } + + created() { + this.buildUpdateForm() + } + // 树点击 - public handleNodeClick(data){ - console.log(data) + public handleNodeClick(data) { + this.params.unitId = ""; + this.params.areaId = ""; + if (data.areaId) { + this.params.unitId = data.id + } else { + this.params.areaId = data.id + } + this.getTableData() } - public buildTable(){ - this.tableColumn.push({name:'序号',key:"index"}); - this.tableColumn.push({name:'管控对象',key:"deptName",width:"200px"}); - this.tableColumn.push({name:'分析对象',key:"deptName",width:"200px"}); - this.tableColumn.push({name:'风险源',key:"person",width:"200px"}); - this.tableColumn.push({name:'事故后果',key:"person",width:"250px"}); - this.tableColumn.push({name:'风险等级',key:"status",render:(data)=>{ - if(data.status==0){ - return "未绘制" - }else{ - return "已绘制" + public buildTable() { + this.tableColumn.push({ name: '管控对象', key: "controlName", width: "200px" }); + this.tableColumn.push({ name: '分析对象', key: "analName", width: "200px" }); + this.tableColumn.push({ name: '风险源', key: "riskSource", width: "150px" }); + this.tableColumn.push({ + name: '事故后果', key: "seriousResult", width: "250px", render: (data) => { + if (data.seriousResult) { + return data.seriousResult.split(";").map(item => this.$store.getters.prevention_serious_result_map[item]).join(";") + } } - }}); - this.tableColumn.push({name:'残余风险等级', width:"110px",key:"status",render:(data)=>{ - if(data.status==0){ - return "未绘制" - }else{ - return "已绘制" + }); + this.tableColumn.push({ + name: '风险等级', key: "riskLevel", render: (data) => { + return "" + (data.riskLevel ? (this.$store.getters.prevention_risk_level_map[data.riskLevel]) : '') + "" } - }}); - this.tableColumn.push({name:'评估人',key:"person"}); - this.tableColumn.push({name:'评估时间',key:"person",width:"150px"}); + }); + this.tableColumn.push({ + name: '残余风险等级', width: "110px", key: "remainLevel", render: (data) => { + return "" + (data.remainLevel ? (this.$store.getters.prevention_risk_level_map[data.remainLevel]) : '') + "" + } + }); + this.tableColumn.push({ name: '评估人', key: "appraiser" }); + this.tableColumn.push({ name: '评估时间', key: "appraiseTime", width: "150px" }); } - public callback(data){ + public callback(data) { // 查询 - if(data.value==="search"){ + if (data.value === "search") { this.getTableData() - // 重置 - }else if(data.value === "reset"){ + // 重置 + } else if (data.value === "reset") { this.reset() - // 反选 - }else if(data.value === "reverse"){ + // 反选 + } else if (data.value === "reverse") { this.toggleAll() - // 全选 - }else if(data.value === "selectAll"){ + // 全选 + } else if (data.value === "selectAll") { this.selectAll() - }else if(data.value === "delete"){ - this.deleteData(this.selectData.map((item:any)=>item.id)) + } else if (data.value === "delete") { + this.deleteData(this.selectData.map((item: any) => item.id)) } } // 重置数据 - public reset(){ + public reset() { this.params = { - pageNum:1, - pageSize:20, + pageNum: 1, + pageSize: 20, } as any; } - public showUpdateModel(id){ + public showUpdateModel(row) { this.showUpdate = true + const tmprow = JSON.parse(JSON.stringify(row)) + this.subUpdateParams = tmprow + this.subUpdateParams.safetySignName = tmprow.safetySign.split(';').map(item => this.$store.getters.prevention_security_identifier_map[item]).join(";") + this.subUpdateParams.seriousResultName = tmprow.seriousResult.split(';').map(item => this.$store.getters.prevention_serious_result_map[item]).join(";") + + //风险评估 + this.riskUpdateParams.riskLevelName = this.$store.getters.prevention_risk_level_map[tmprow.riskLevel] + this.riskUpdateParams.riskControlLevelName = this.$store.getters.prevention_control_level_map[tmprow.riskControlLevel] + if (tmprow.riskLsValue) { + const riskLsValue = JSON.parse(tmprow.riskLsValue) + const tmpRiskLsValue = {} + for (let key in riskLsValue) { + if (key.indexOf('ls') !== -1) { + tmpRiskLsValue[key] = riskLsValue[key]; + } + } + this.riskUpdateParams = { ...this.riskUpdateParams, ...tmpRiskLsValue } + this.riskUpdateParams.lsgradeName = this.$store.getters.prevention_risk_level_map[this.riskUpdateParams.lsgrade] + } + if (tmprow.riskLecValue) { + const riskLecValue = JSON.parse(tmprow.riskLecValue) + const tmpRiskLecValue = {} + for (let key in riskLecValue) { + if (key.indexOf('lec') !== -1) { + tmpRiskLecValue[key] = riskLecValue[key]; + } + } + this.riskUpdateParams = { ...this.riskUpdateParams, ...tmpRiskLecValue } + this.riskUpdateParams.lecgradeName = this.$store.getters.prevention_risk_level_map[this.riskUpdateParams.lsgrade] + } + + //残余风险评估 + this.remainUpdateParams.remainLevelName = this.$store.getters.prevention_risk_level_map[tmprow.remainLevel] + if (tmprow.remainLsValue) { + const remainLsValue = JSON.parse(tmprow.remainLsValue) + const tmpRemainLsValue = {} + for (let key in remainLsValue) { + if (key.indexOf('ls') !== -1) { + tmpRemainLsValue[key] = remainLsValue[key]; + } + } + this.remainUpdateParams = { ...this.remainUpdateParams, ...tmpRemainLsValue } + this.remainUpdateParams.lsgradeName = this.$store.getters.prevention_risk_level_map[this.remainUpdateParams.lsgrade] + + } + if (tmprow.remainLecValue) { + const remainLecValue = JSON.parse(tmprow.remainLecValue) + const tmpRemainLecValue = {} + for (let key in remainLecValue) { + if (key.indexOf('lec') !== -1) { + tmpRemainLecValue[key] = remainLecValue[key]; + } + } + this.remainUpdateParams = { ...this.remainUpdateParams, ...tmpRemainLecValue } + this.remainUpdateParams.lecgradeName = this.$store.getters.prevention_risk_level_map[this.remainUpdateParams.lecgrade] + } + this.buildUpdateForm() } - public handleClose(){ + public handleClose() { this.showUpdate = false; } @@ -168,22 +443,26 @@ export default class IdentifyManagerComponent extends BaseRecordComponent { public toggleAll() { (this.$refs.multipleTable as any).toggleAllSelection(); } - 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.userId === item.userId); - if(!find){ + } else { + this.tableData.datas.forEach((item, index) => { + const find = this.selectData.find((data: any) => data.userId === item.userId); + if (!find) { (this.$refs.multipleTable as any).toggleRowSelection(item); } }) } } - public handleSelectionChange(data){ + public handleSelectionChange(data) { this.selectData = data; } + + public subCallback() { + this.showUpdate = false + } } diff --git a/src/views/risk/measures/measures.component.html b/src/views/risk/measures/measures.component.html index 53b5c3a..388710b 100644 --- a/src/views/risk/measures/measures.component.html +++ b/src/views/risk/measures/measures.component.html @@ -1,7 +1,6 @@ -
-
- - +
+
+
- + @actionCallback="callback($event)" @pageNumberChange="callback($event)" + @pageSizeChange="callback($event)" :footerActions="footerActions" :actions="tableActions"> + + + + - +
- - + + + + + + + + + +
\ No newline at end of file diff --git a/src/views/risk/measures/measures.component.vue b/src/views/risk/measures/measures.component.vue index 310b57b..3f473f8 100644 --- a/src/views/risk/measures/measures.component.vue +++ b/src/views/risk/measures/measures.component.vue @@ -9,158 +9,173 @@ import MeasuresService from "@/service/measures.service" import FormOption from "hbt-common/models/formOptions" import BtnOption from "hbt-common/models/btnOptions" import DrawComponent from '@/components/draw.component.vue'; +import ButtonListComponent from "hbt-common/components/common/buttonList.component.vue"; +import UnitTreeComponent from '@/components/tree.component.vue'; + @Component({ template, - components:{ + components: { FormComponent, TableComponent, DrawComponent, + ButtonListComponent, + UnitTreeComponent, }, }) export default class MeasuresManagerComponent extends BaseRecordComponent { public tableService = new MeasuresService(); - public params = {} as any; + public params = { + areaId: null, + unitId: null, + } as any; - public treeData = [{ - label: '一级 1', - children: [{ - label: '二级 1-1', - children: [{ - label: '三级 1-1-1' - }] - }] - }, { - label: '一级 2', - children: [{ - label: '二级 2-1', - children: [{ - label: '三级 2-1-1' - }] - }, { - label: '二级 2-2', - children: [{ - label: '三级 2-2-1' - }] - }] - }, { - label: '一级 3', - children: [{ - label: '二级 3-1', - children: [{ - label: '三级 3-1-1' - }] - }, { - label: '二级 3-2', - children: [{ - label: '三级 3-2-1' - }] - }] - }] + public showProtable = false; + + public currentProTableData = { + datas: [] + } as any; + + public proTableColumn = [] as any; + + //管控措施 + public measuresSelectData = {} as any; 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:"delete", - plain:true, - icon:"el-icon-delete", - type:"danger" + 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:"areaId", - type:"text", - },{ - name:"单元名称", - key:"unitId", - type:"text", + public formOptions: FormOption[] = [{ + name: "管控对象", + key: "controlName", + type: "text", + }, { + name: "分析对象", + key: "analName", + type: "text", + }]; + public subActions = [{ + name: "取消", + value: "cancel" }]; - public showUpdate = false; - public updateParams = {} as any; + public updateParams = {} as any; public selectData = []; - created(){ - + created() { + this.$store.state.prevention_measures_sort.map((item) => { + this.measuresSelectData[item.value] = this.treeSelectData(item.children) + }) } // 树点击 - public handleNodeClick(data){ - console.log(data) + public handleNodeClick(data) { + this.params.unitId = ""; + this.params.areaId = ""; + if (data.areaId) { + this.params.unitId = data.id + } else { + this.params.areaId = data.id + } + this.getTableData() } - public buildTable(){ - this.tableColumn.push({name:'序号',key:"index"}); - this.tableColumn.push({name:'管控对象',key:"deptName",width:"200px"}); - this.tableColumn.push({name:'分析对象',key:"deptName",width:"200px"}); - this.tableColumn.push({name:'风险源',key:"person",width:"200px"}); - this.tableColumn.push({name:'事故后果',key:"person",width:"250px"}); - this.tableColumn.push({name:'风险等级',key:"status",render:(data)=>{ - if(data.status==0){ - return "未绘制" - }else{ - return "已绘制" + public buildTable() { + this.tableColumn.push({ name: '管控对象', key: "controlName", width: "200px" }); + this.tableColumn.push({ name: '分析对象', key: "analName", width: "200px" }); + this.tableColumn.push({ name: '风险源', key: "riskSource", width: "150px" }); + this.tableColumn.push({ + name: '事故后果', key: "seriousResult", width: "200px", render: (data) => { + if (data.seriousResult) { + return data.seriousResult.split(";").map(item => this.$store.getters.prevention_serious_result_map[item]).join(";") + } } - }}); - this.tableColumn.push({name:'措施详情', width:"110px",key:"status",render:(data)=>{ - if(data.status==0){ - return "未绘制" - }else{ - return "已绘制" + }); + this.tableColumn.push({ + name: '风险等级', key: "riskLevel", width: "100px", render: (data) => { + return "" + (data.riskLevel ? (this.$store.getters.prevention_risk_level_map[data.riskLevel]) : '') + "" } - }}); - this.tableColumn.push({name:'涉及岗位',key:"person"}); + }); + this.tableColumn.push({ + name: '措施详情', width: "100px", key: "measureNum", render: (data) => { + return "" + (data.details ? data.details.length : 0) + "" + } + }); + this.tableColumn.push({ name: '涉及岗位', key: "postName" }); + + + //管控措施详情 + this.proTableColumn.push({ name: '序号', key: "index" }); + this.proTableColumn.push({ + name: '措施类型一', key: "firstTypeName", render: (data) => { + if (data.firstType) { + return this.$store.getters.prevention_measures_sort_map[data.firstType] + } + } + }); + this.proTableColumn.push({ + name: '措施类型二', key: "secondTypeName", + render: (data) => { + if (data.firstType) { + const secondTypeItem = this.measuresSelectData[data.firstType] + return this.selectName(secondTypeItem, data.secondType) + } + } + }); + this.proTableColumn.push({ name: '措施类型三', key: "thirdType" }); + this.proTableColumn.push({ name: '管控措施', key: "description" }); } - public callback(data){ + public callback(data) { // 查询 - if(data.value==="search"){ + if (data.value === "search") { this.getTableData() - // 重置 - }else if(data.value === "reset"){ + // 重置 + } else if (data.value === "reset") { this.reset() - // 反选 - }else if(data.value === "reverse"){ + // 反选 + } else if (data.value === "reverse") { this.toggleAll() - // 全选 - }else if(data.value === "selectAll"){ + // 全选 + } else if (data.value === "selectAll") { this.selectAll() - }else if(data.value === "delete"){ - this.deleteData(this.selectData.map((item:any)=>item.id)) + } else if (data.value === "delete") { + this.deleteData(this.selectData.map((item: any) => item.id)) } } // 重置数据 - public reset(){ + public reset() { this.params = { - pageNum:1, - pageSize:20, + pageNum: 1, + pageSize: 20, } as any; } - // 删除数据 - - - public showUpdateModel(id){ + public showUpdateModel(id) { this.showUpdate = true } - public handleClose(){ + public handleClose() { this.showUpdate = false; } @@ -168,22 +183,64 @@ export default class MeasuresManagerComponent extends BaseRecordComponent { public toggleAll() { (this.$refs.multipleTable as any).toggleAllSelection(); } - 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.userId === item.userId); - if(!find){ + } else { + this.tableData.datas.forEach((item, index) => { + const find = this.selectData.find((data: any) => data.userId === item.userId); + if (!find) { (this.$refs.multipleTable as any).toggleRowSelection(item); } }) } } - public handleSelectionChange(data){ + public handleSelectionChange(data) { this.selectData = data; } + + //管控措施 + public showPros(el, data) { + const isTarget = el.target.classList.contains("link"); + if (isTarget) { + this.showProtable = true; + this.currentProTableData.datas = data.details.map((item, index) => { + item.index = index + 1; + return item + }) + } + } + + //管控措施--关闭 + public subCallback() { + this.showProtable = false; + } + + public treeSelectData(data) { + return data.map((item) => { + return { + label: item.dictLabel, + id: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue, + } + }) + + } + + public selectName(selectGroup, data) { + if (selectGroup && selectGroup.length > 0) { + const map = {}; + selectGroup.forEach((item: any) => { + if (item.value) { + map[item.value] = item.name + } else if (item.id) { + map[item.id] = item.label + } + + }) + return map[data] + } + } }