forked from xxhjsb/hbt-prevention-ui
feat:新增风险辨识清单 风险管控措施清单
parent
748be50781
commit
a930cbf338
|
@ -6,11 +6,11 @@ export default class IdentifyService extends BaseService<any>{
|
||||||
super()
|
super()
|
||||||
}
|
}
|
||||||
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||||
const url = this.prefix.system+'/user/list';
|
const url = this.prefix.prevention+'/risk/identifyinventory/getList';
|
||||||
return this.get(url,params,true)
|
return this.get(url,params,true)
|
||||||
}
|
}
|
||||||
public deleteByIds(params):Promise<AxiosResponse<ActionResult<any>>>{
|
public deleteByIds(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||||
const url = this.prefix.system+'/user/list';
|
const url = this.prefix.prevention+'/risk/identifyinventory';
|
||||||
return this.deleteBatch(url,params,{},true)
|
return this.deleteBatch(url,params,{},true)
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -6,11 +6,13 @@ export default class MeasuresService extends BaseService<any>{
|
||||||
super()
|
super()
|
||||||
}
|
}
|
||||||
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||||
const url = this.prefix.system+'/user/list';
|
const url = this.prefix.prevention+'/risk/inventory/list';
|
||||||
return this.get(url,params,true)
|
return this.get(url,params,true)
|
||||||
}
|
}
|
||||||
public deleteByIds(params):Promise<AxiosResponse<ActionResult<any>>>{
|
public deleteByIds(params):Promise<AxiosResponse<ActionResult<any>>>{
|
||||||
const url = this.prefix.system+'/user/list';
|
const url = this.prefix.prevention+'/risk/inventory';
|
||||||
return this.deleteBatch(url,params,{},true)
|
return this.deleteBatch(url,params,{},true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,7 +1,6 @@
|
||||||
<div class="common-box dis-flex " >
|
<div class="common-box dis-flex ">
|
||||||
<div class="common-tree-box" v-if="treeData">
|
<div class="common-tree-box">
|
||||||
<el-tree :data="treeData" :expand-on-click-node="false" default-expand-all highlight-current @node-click="handleNodeClick">
|
<UnitTreeComponent @callback="handleNodeClick"></UnitTreeComponent>
|
||||||
</el-tree>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="common-content-box dis-flex flex-col flex-1">
|
<div class="common-content-box dis-flex flex-col flex-1">
|
||||||
<div class="search-box">
|
<div class="search-box">
|
||||||
|
@ -10,13 +9,18 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="table-box flex-1">
|
<div class="table-box flex-1">
|
||||||
<TableComponent :tableData="tableData" :tableColumn="tableColumn" @tabCallback="callback($event)"
|
<TableComponent :tableData="tableData" :tableColumn="tableColumn" @tabCallback="callback($event)"
|
||||||
@actionCallback="callback($event)" @pageNumberChange="callback($event)" @pageSizeChange="callback($event)"
|
@actionCallback="callback($event)" @pageNumberChange="callback($event)"
|
||||||
:footerActions="footerActions" :actions="tableActions">
|
@pageSizeChange="callback($event)" :footerActions="footerActions" :actions="tableActions">
|
||||||
|
|
||||||
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
|
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
|
||||||
@selection-change="handleSelectionChange" style="width: 100%">
|
@selection-change="handleSelectionChange" style="width: 100%">
|
||||||
<el-table-column type="selection" label="全选" width="60">
|
<el-table-column type="selection" label="全选" width="60">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="序号" width="60">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{scope.$index+1}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<template v-for="item in tableColumn">
|
<template v-for="item in tableColumn">
|
||||||
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key">
|
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key">
|
||||||
<div slot-scope="scope" v-html="item.render(scope.row)"></div>
|
<div slot-scope="scope" v-html="item.render(scope.row)"></div>
|
||||||
|
@ -26,18 +30,28 @@
|
||||||
</template>
|
</template>
|
||||||
<el-table-column label="操作" width="100">
|
<el-table-column label="操作" width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="text" @click="showUpdateModel(scope.row.userId)">查看</el-button>
|
<el-button type="text" @click="showUpdateModel(scope.row)">查看</el-button>
|
||||||
<el-button type="text" @click="deleteData([scope.row])">删除</el-button>
|
<el-button type="text" @click="deleteData([scope.row.id])">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
</TableComponent>
|
</TableComponent>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-dialog :close-on-click-modal="false" :title="currentId>0?'详情':currentId===-1?'新增':'编辑'" :visible.sync="showUpdate" width="952px"
|
<el-dialog :close-on-click-modal="false" :title="'详情'" :visible.sync="showUpdate" width="952px"
|
||||||
:before-close="handleClose">
|
:before-close="handleClose">
|
||||||
<FormComponent :options="updateOptions" :isReadonly="true" labelWidth="110px" labelAlign="right" :data.sync="updateParams"></FormComponent>
|
<div class="sub-title">风险辨识情况</div>
|
||||||
|
<FormComponent :options="updateOptions" :isReadonly="true" labelWidth="110px" labelAlign="right"
|
||||||
|
:data.sync="subUpdateParams"></FormComponent>
|
||||||
|
<div class="sub-title">风险评估情况</div>
|
||||||
|
<FormComponent :options="subRiskOptions" :isReadonly="true" labelWidth="110px" labelAlign="right"
|
||||||
|
:data.sync="riskUpdateParams"></FormComponent>
|
||||||
|
<div class="sub-title">残余风险评估情况</div>
|
||||||
|
<FormComponent :options="subRemnantsOptions" :isReadonly="true" labelWidth="110px" labelAlign="right"
|
||||||
|
:data.sync="remainUpdateParams"></FormComponent>
|
||||||
|
<ButtonListComponent :actions="subActions" @callback="subCallback" btn-position="center" :full-btn="true">
|
||||||
|
</ButtonListComponent>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
|
@ -9,158 +9,433 @@ import IdentifyService from "@/service/identify.service"
|
||||||
import FormOption from "hbt-common/models/formOptions"
|
import FormOption from "hbt-common/models/formOptions"
|
||||||
import BtnOption from "hbt-common/models/btnOptions"
|
import BtnOption from "hbt-common/models/btnOptions"
|
||||||
import DrawComponent from '@/components/draw.component.vue';
|
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({
|
@Component({
|
||||||
template,
|
template,
|
||||||
components:{
|
components: {
|
||||||
FormComponent,
|
FormComponent,
|
||||||
TableComponent,
|
TableComponent,
|
||||||
DrawComponent,
|
DrawComponent,
|
||||||
|
ButtonListComponent,
|
||||||
|
UnitTreeComponent,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
export default class IdentifyManagerComponent extends BaseRecordComponent<any> {
|
export default class IdentifyManagerComponent extends BaseRecordComponent<any> {
|
||||||
public tableService = new IdentifyService();
|
public tableService = new IdentifyService();
|
||||||
|
|
||||||
public params = {} as any;
|
public params = {
|
||||||
|
areaId:null,
|
||||||
public treeData = [{
|
unitId:null,
|
||||||
label: '一级 1',
|
} as any;
|
||||||
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 formActions = [{
|
public formActions = [{
|
||||||
name:"查询",
|
name: "查询",
|
||||||
value:"search",
|
value: "search",
|
||||||
icon:"el-icon-search",
|
icon: "el-icon-search",
|
||||||
type:"primary"
|
type: "primary"
|
||||||
},{
|
}, {
|
||||||
name:"清空",
|
name: "清空",
|
||||||
icon:"el-icon-tickets",
|
icon: "el-icon-tickets",
|
||||||
value:"reset"
|
value: "reset"
|
||||||
}];
|
}];
|
||||||
public tableActions = [{
|
public tableActions = [{
|
||||||
name:"批量删除",
|
name: "批量删除",
|
||||||
value:"delete",
|
value: "delete",
|
||||||
plain:true,
|
plain: true,
|
||||||
icon:"el-icon-delete",
|
icon: "el-icon-delete",
|
||||||
type:"danger"
|
type: "danger"
|
||||||
}];
|
}];
|
||||||
public footerActions = [{
|
public footerActions = [{
|
||||||
name:"选择全部",
|
name: "选择全部",
|
||||||
value:"selectAll",
|
value: "selectAll",
|
||||||
type:"primary"
|
type: "primary"
|
||||||
},{
|
}, {
|
||||||
name:"反向选择",
|
name: "反向选择",
|
||||||
value:"reverse"
|
value: "reverse"
|
||||||
}];
|
}];
|
||||||
public formOptions:FormOption<BtnOption>[] = [{
|
public formOptions: FormOption<BtnOption>[] = [{
|
||||||
name:"区域名称",
|
name: "管控对象",
|
||||||
key:"areaId",
|
key: "controlName",
|
||||||
type:"text",
|
type: "text",
|
||||||
},{
|
}, {
|
||||||
name:"单元名称",
|
name: "分析对象",
|
||||||
key:"unitId",
|
key: "analName",
|
||||||
type:"text",
|
type: "text",
|
||||||
|
}];
|
||||||
|
|
||||||
|
public subActions = [{
|
||||||
|
name: "取消",
|
||||||
|
value: "cancel"
|
||||||
}];
|
}];
|
||||||
|
|
||||||
public showUpdate = false;
|
public showUpdate = false;
|
||||||
public updateParams = {} as any;
|
public updateParams = {} as any;
|
||||||
public selectData = [];
|
public selectData = [];
|
||||||
|
//风险辨识情况
|
||||||
|
public subUpdateParams = {} as any;
|
||||||
|
//风险评估情况
|
||||||
|
public riskUpdateParams = {} as any;
|
||||||
|
//残余风险评估情况
|
||||||
|
public remainUpdateParams = {} as any;
|
||||||
|
|
||||||
created(){
|
public updateOptions: FormOption<BtnOption>[] = [] as any;
|
||||||
|
//风险评估
|
||||||
|
public subRiskOptions: FormOption<BtnOption>[] = [];
|
||||||
|
//残余风险评估
|
||||||
|
public subRemnantsOptions: FormOption<BtnOption>[] = [];
|
||||||
|
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){
|
public handleNodeClick(data) {
|
||||||
console.log(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(){
|
public buildTable() {
|
||||||
this.tableColumn.push({name:'序号',key:"index"});
|
this.tableColumn.push({ name: '管控对象', key: "controlName", width: "200px" });
|
||||||
this.tableColumn.push({name:'管控对象',key:"deptName",width:"200px"});
|
this.tableColumn.push({ name: '分析对象', key: "analName", width: "200px" });
|
||||||
this.tableColumn.push({name:'分析对象',key:"deptName",width:"200px"});
|
this.tableColumn.push({ name: '风险源', key: "riskSource", width: "150px" });
|
||||||
this.tableColumn.push({name:'风险源',key:"person",width:"200px"});
|
this.tableColumn.push({
|
||||||
this.tableColumn.push({name:'事故后果',key:"person",width:"250px"});
|
name: '事故后果', key: "seriousResult", width: "250px", render: (data) => {
|
||||||
this.tableColumn.push({name:'风险等级',key:"status",render:(data)=>{
|
if (data.seriousResult) {
|
||||||
if(data.status==0){
|
return data.seriousResult.split(";").map(item => this.$store.getters.prevention_serious_result_map[item]).join(";")
|
||||||
return "<span class='noDraw'>未绘制</span>"
|
}
|
||||||
}else{
|
|
||||||
return "<span>已绘制</span>"
|
|
||||||
}
|
}
|
||||||
}});
|
});
|
||||||
this.tableColumn.push({name:'残余风险等级', width:"110px",key:"status",render:(data)=>{
|
this.tableColumn.push({
|
||||||
if(data.status==0){
|
name: '风险等级', key: "riskLevel", render: (data) => {
|
||||||
return "<span class='noDraw'>未绘制</span>"
|
return "<span class='color_" + data.riskLevel + "'>" + (data.riskLevel ? (this.$store.getters.prevention_risk_level_map[data.riskLevel]) : '') + "</span>"
|
||||||
}else{
|
|
||||||
return "<span>已绘制</span>"
|
|
||||||
}
|
}
|
||||||
}});
|
});
|
||||||
this.tableColumn.push({name:'评估人',key:"person"});
|
this.tableColumn.push({
|
||||||
this.tableColumn.push({name:'评估时间',key:"person",width:"150px"});
|
name: '残余风险等级', width: "110px", key: "remainLevel", render: (data) => {
|
||||||
|
return "<span class='color_" + data.remainLevel + "'>" + (data.remainLevel ? (this.$store.getters.prevention_risk_level_map[data.remainLevel]) : '') + "</span>"
|
||||||
|
}
|
||||||
|
});
|
||||||
|
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()
|
this.getTableData()
|
||||||
// 重置
|
// 重置
|
||||||
}else if(data.value === "reset"){
|
} else if (data.value === "reset") {
|
||||||
this.reset()
|
this.reset()
|
||||||
// 反选
|
// 反选
|
||||||
}else if(data.value === "reverse"){
|
} else if (data.value === "reverse") {
|
||||||
this.toggleAll()
|
this.toggleAll()
|
||||||
// 全选
|
// 全选
|
||||||
}else if(data.value === "selectAll"){
|
} else if (data.value === "selectAll") {
|
||||||
this.selectAll()
|
this.selectAll()
|
||||||
}else if(data.value === "delete"){
|
} else if (data.value === "delete") {
|
||||||
this.deleteData(this.selectData.map((item:any)=>item.id))
|
this.deleteData(this.selectData.map((item: any) => item.id))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 重置数据
|
// 重置数据
|
||||||
public reset(){
|
public reset() {
|
||||||
this.params = {
|
this.params = {
|
||||||
pageNum:1,
|
pageNum: 1,
|
||||||
pageSize:20,
|
pageSize: 20,
|
||||||
} as any;
|
} as any;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public showUpdateModel(id){
|
public showUpdateModel(row) {
|
||||||
this.showUpdate = true
|
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;
|
this.showUpdate = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,22 +443,26 @@ export default class IdentifyManagerComponent extends BaseRecordComponent<any> {
|
||||||
public toggleAll() {
|
public toggleAll() {
|
||||||
(this.$refs.multipleTable as any).toggleAllSelection();
|
(this.$refs.multipleTable as any).toggleAllSelection();
|
||||||
}
|
}
|
||||||
public selectAll(){
|
public selectAll() {
|
||||||
if(!this.selectData.length){
|
if (!this.selectData.length) {
|
||||||
this.toggleAll()
|
this.toggleAll()
|
||||||
}else{
|
} else {
|
||||||
this.tableData.datas.forEach((item,index)=>{
|
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.userId === item.userId);
|
||||||
if(!find){
|
if (!find) {
|
||||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public handleSelectionChange(data){
|
public handleSelectionChange(data) {
|
||||||
this.selectData = data;
|
this.selectData = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public subCallback() {
|
||||||
|
this.showUpdate = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped src="../../common.component.scss"></style>
|
<style lang="scss" scoped src="../../common.component.scss"></style>
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<div class="common-box dis-flex " >
|
<div class="common-box dis-flex ">
|
||||||
<div class="common-tree-box" v-if="treeData">
|
<div class="common-tree-box">
|
||||||
<el-tree :data="treeData" :expand-on-click-node="false" default-expand-all highlight-current @node-click="handleNodeClick">
|
<UnitTreeComponent @callback="handleNodeClick"></UnitTreeComponent>
|
||||||
</el-tree>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="common-content-box dis-flex flex-col flex-1">
|
<div class="common-content-box dis-flex flex-col flex-1">
|
||||||
<div class="search-box">
|
<div class="search-box">
|
||||||
|
@ -10,33 +9,56 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="table-box flex-1">
|
<div class="table-box flex-1">
|
||||||
<TableComponent :tableData="tableData" :tableColumn="tableColumn" @tabCallback="callback($event)"
|
<TableComponent :tableData="tableData" :tableColumn="tableColumn" @tabCallback="callback($event)"
|
||||||
@actionCallback="callback($event)" @pageNumberChange="callback($event)" @pageSizeChange="callback($event)"
|
@actionCallback="callback($event)" @pageNumberChange="callback($event)"
|
||||||
:footerActions="footerActions" :actions="tableActions">
|
@pageSizeChange="callback($event)" :footerActions="footerActions" :actions="tableActions">
|
||||||
|
|
||||||
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
|
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
|
||||||
@selection-change="handleSelectionChange" style="width: 100%">
|
@selection-change="handleSelectionChange" style="width: 100%">
|
||||||
<el-table-column type="selection" label="全选" width="60">
|
<el-table-column type="selection" label="全选" width="60">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="序号" width="60">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{scope.$index+1}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<template v-for="item in tableColumn">
|
<template v-for="item in tableColumn">
|
||||||
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key">
|
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key">
|
||||||
<div slot-scope="scope" v-html="item.render(scope.row)"></div>
|
<div slot-scope="scope" v-html="item.render(scope.row)" @click="showPros($event,scope.row)">
|
||||||
|
</div>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key">
|
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</template>
|
</template>
|
||||||
<el-table-column label="操作" width="100">
|
<el-table-column label="操作" width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="text" @click="deleteData([scope.row])">删除</el-button>
|
<el-button type="text" @click="deleteData([scope.row.id])">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
</TableComponent>
|
</TableComponent>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-dialog :close-on-click-modal="false" :title="currentId>0?'详情':currentId===-1?'新增':'编辑'" :visible.sync="showUpdate" width="952px"
|
<!-- 管控措施详情 -->
|
||||||
:before-close="handleClose">
|
<el-dialog :close-on-click-modal="false" title="管控措施" :show-close="false" :visible.sync="showProtable"
|
||||||
<FormComponent :options="updateOptions" :isReadonly="true" labelWidth="110px" labelAlign="right" :data.sync="updateParams"></FormComponent>
|
width="940px">
|
||||||
|
<TableComponent :tableData="currentProTableData" :tableColumn="proTableColumn" :showFooter="false"
|
||||||
|
style="margin-bottom: 20px;">
|
||||||
|
<el-table ref="multipleTable" :data="currentProTableData.datas" tooltip-effect="dark" height="250" border
|
||||||
|
style="width: 100%">
|
||||||
|
<template v-for="item in proTableColumn">
|
||||||
|
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key">
|
||||||
|
<div slot-scope="scope" v-html="item.render(scope.row)" @click="showPros($event,scope.row)">
|
||||||
|
</div>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key">
|
||||||
|
</el-table-column>
|
||||||
|
</template>
|
||||||
|
</el-table>
|
||||||
|
</TableComponent>
|
||||||
|
<ButtonListComponent :actions="subActions" @callback="subCallback" btn-position="center" :full-btn="true">
|
||||||
|
</ButtonListComponent>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
</div>
|
</div>
|
|
@ -9,158 +9,173 @@ import MeasuresService from "@/service/measures.service"
|
||||||
import FormOption from "hbt-common/models/formOptions"
|
import FormOption from "hbt-common/models/formOptions"
|
||||||
import BtnOption from "hbt-common/models/btnOptions"
|
import BtnOption from "hbt-common/models/btnOptions"
|
||||||
import DrawComponent from '@/components/draw.component.vue';
|
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({
|
@Component({
|
||||||
template,
|
template,
|
||||||
components:{
|
components: {
|
||||||
FormComponent,
|
FormComponent,
|
||||||
TableComponent,
|
TableComponent,
|
||||||
DrawComponent,
|
DrawComponent,
|
||||||
|
ButtonListComponent,
|
||||||
|
UnitTreeComponent,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
export default class MeasuresManagerComponent extends BaseRecordComponent<any> {
|
export default class MeasuresManagerComponent extends BaseRecordComponent<any> {
|
||||||
public tableService = new MeasuresService();
|
public tableService = new MeasuresService();
|
||||||
|
|
||||||
public params = {} as any;
|
public params = {
|
||||||
|
areaId: null,
|
||||||
|
unitId: null,
|
||||||
|
} as any;
|
||||||
|
|
||||||
public treeData = [{
|
public showProtable = false;
|
||||||
label: '一级 1',
|
|
||||||
children: [{
|
public currentProTableData = {
|
||||||
label: '二级 1-1',
|
datas: []
|
||||||
children: [{
|
} as any;
|
||||||
label: '三级 1-1-1'
|
|
||||||
}]
|
public proTableColumn = [] as any;
|
||||||
}]
|
|
||||||
}, {
|
//管控措施
|
||||||
label: '一级 2',
|
public measuresSelectData = {} as any;
|
||||||
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 formActions = [{
|
public formActions = [{
|
||||||
name:"查询",
|
name: "查询",
|
||||||
value:"search",
|
value: "search",
|
||||||
icon:"el-icon-search",
|
icon: "el-icon-search",
|
||||||
type:"primary"
|
type: "primary"
|
||||||
},{
|
}, {
|
||||||
name:"清空",
|
name: "清空",
|
||||||
icon:"el-icon-tickets",
|
icon: "el-icon-tickets",
|
||||||
value:"reset"
|
value: "reset"
|
||||||
}];
|
}];
|
||||||
public tableActions = [{
|
public tableActions = [{
|
||||||
name:"批量删除",
|
name: "批量删除",
|
||||||
value:"delete",
|
value: "delete",
|
||||||
plain:true,
|
plain: true,
|
||||||
icon:"el-icon-delete",
|
icon: "el-icon-delete",
|
||||||
type:"danger"
|
type: "danger"
|
||||||
}];
|
}];
|
||||||
public footerActions = [{
|
public footerActions = [{
|
||||||
name:"选择全部",
|
name: "选择全部",
|
||||||
value:"selectAll",
|
value: "selectAll",
|
||||||
type:"primary"
|
type: "primary"
|
||||||
},{
|
}, {
|
||||||
name:"反向选择",
|
name: "反向选择",
|
||||||
value:"reverse"
|
value: "reverse"
|
||||||
}];
|
}];
|
||||||
public formOptions:FormOption<BtnOption>[] = [{
|
public formOptions: FormOption<BtnOption>[] = [{
|
||||||
name:"区域名称",
|
name: "管控对象",
|
||||||
key:"areaId",
|
key: "controlName",
|
||||||
type:"text",
|
type: "text",
|
||||||
},{
|
}, {
|
||||||
name:"单元名称",
|
name: "分析对象",
|
||||||
key:"unitId",
|
key: "analName",
|
||||||
type:"text",
|
type: "text",
|
||||||
|
}];
|
||||||
|
public subActions = [{
|
||||||
|
name: "取消",
|
||||||
|
value: "cancel"
|
||||||
}];
|
}];
|
||||||
|
|
||||||
public showUpdate = false;
|
public showUpdate = false;
|
||||||
public updateParams = {} as any;
|
public updateParams = {} as any;
|
||||||
public selectData = [];
|
public selectData = [];
|
||||||
|
|
||||||
created(){
|
created() {
|
||||||
|
this.$store.state.prevention_measures_sort.map((item) => {
|
||||||
|
this.measuresSelectData[item.value] = this.treeSelectData(item.children)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
// 树点击
|
// 树点击
|
||||||
public handleNodeClick(data){
|
public handleNodeClick(data) {
|
||||||
console.log(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(){
|
public buildTable() {
|
||||||
this.tableColumn.push({name:'序号',key:"index"});
|
this.tableColumn.push({ name: '管控对象', key: "controlName", width: "200px" });
|
||||||
this.tableColumn.push({name:'管控对象',key:"deptName",width:"200px"});
|
this.tableColumn.push({ name: '分析对象', key: "analName", width: "200px" });
|
||||||
this.tableColumn.push({name:'分析对象',key:"deptName",width:"200px"});
|
this.tableColumn.push({ name: '风险源', key: "riskSource", width: "150px" });
|
||||||
this.tableColumn.push({name:'风险源',key:"person",width:"200px"});
|
this.tableColumn.push({
|
||||||
this.tableColumn.push({name:'事故后果',key:"person",width:"250px"});
|
name: '事故后果', key: "seriousResult", width: "200px", render: (data) => {
|
||||||
this.tableColumn.push({name:'风险等级',key:"status",render:(data)=>{
|
if (data.seriousResult) {
|
||||||
if(data.status==0){
|
return data.seriousResult.split(";").map(item => this.$store.getters.prevention_serious_result_map[item]).join(";")
|
||||||
return "<span class='noDraw'>未绘制</span>"
|
}
|
||||||
}else{
|
|
||||||
return "<span>已绘制</span>"
|
|
||||||
}
|
}
|
||||||
}});
|
});
|
||||||
this.tableColumn.push({name:'措施详情', width:"110px",key:"status",render:(data)=>{
|
this.tableColumn.push({
|
||||||
if(data.status==0){
|
name: '风险等级', key: "riskLevel", width: "100px", render: (data) => {
|
||||||
return "<span class='noDraw'>未绘制</span>"
|
return "<span class='color_" + data.riskLevel + "'>" + (data.riskLevel ? (this.$store.getters.prevention_risk_level_map[data.riskLevel]) : '') + "</span>"
|
||||||
}else{
|
|
||||||
return "<span>已绘制</span>"
|
|
||||||
}
|
}
|
||||||
}});
|
});
|
||||||
this.tableColumn.push({name:'涉及岗位',key:"person"});
|
this.tableColumn.push({
|
||||||
|
name: '措施详情', width: "100px", key: "measureNum", render: (data) => {
|
||||||
|
return "<span class='link'>" + (data.details ? data.details.length : 0) + "</span>"
|
||||||
|
}
|
||||||
|
});
|
||||||
|
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()
|
this.getTableData()
|
||||||
// 重置
|
// 重置
|
||||||
}else if(data.value === "reset"){
|
} else if (data.value === "reset") {
|
||||||
this.reset()
|
this.reset()
|
||||||
// 反选
|
// 反选
|
||||||
}else if(data.value === "reverse"){
|
} else if (data.value === "reverse") {
|
||||||
this.toggleAll()
|
this.toggleAll()
|
||||||
// 全选
|
// 全选
|
||||||
}else if(data.value === "selectAll"){
|
} else if (data.value === "selectAll") {
|
||||||
this.selectAll()
|
this.selectAll()
|
||||||
}else if(data.value === "delete"){
|
} else if (data.value === "delete") {
|
||||||
this.deleteData(this.selectData.map((item:any)=>item.id))
|
this.deleteData(this.selectData.map((item: any) => item.id))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 重置数据
|
// 重置数据
|
||||||
public reset(){
|
public reset() {
|
||||||
this.params = {
|
this.params = {
|
||||||
pageNum:1,
|
pageNum: 1,
|
||||||
pageSize:20,
|
pageSize: 20,
|
||||||
} as any;
|
} as any;
|
||||||
}
|
}
|
||||||
// 删除数据
|
|
||||||
|
|
||||||
|
public showUpdateModel(id) {
|
||||||
|
|
||||||
public showUpdateModel(id){
|
|
||||||
this.showUpdate = true
|
this.showUpdate = true
|
||||||
}
|
}
|
||||||
|
|
||||||
public handleClose(){
|
public handleClose() {
|
||||||
this.showUpdate = false;
|
this.showUpdate = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,22 +183,64 @@ export default class MeasuresManagerComponent extends BaseRecordComponent<any> {
|
||||||
public toggleAll() {
|
public toggleAll() {
|
||||||
(this.$refs.multipleTable as any).toggleAllSelection();
|
(this.$refs.multipleTable as any).toggleAllSelection();
|
||||||
}
|
}
|
||||||
public selectAll(){
|
public selectAll() {
|
||||||
if(!this.selectData.length){
|
if (!this.selectData.length) {
|
||||||
this.toggleAll()
|
this.toggleAll()
|
||||||
}else{
|
} else {
|
||||||
this.tableData.datas.forEach((item,index)=>{
|
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.userId === item.userId);
|
||||||
if(!find){
|
if (!find) {
|
||||||
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
(this.$refs.multipleTable as any).toggleRowSelection(item);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public handleSelectionChange(data){
|
public handleSelectionChange(data) {
|
||||||
this.selectData = 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]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped src="../../common.component.scss"></style>
|
<style lang="scss" scoped src="../../common.component.scss"></style>
|
||||||
|
|
Loading…
Reference in New Issue