feat:区域单元添加风险等级字段

dev
zhushengzhe 2023-09-15 13:39:56 +08:00
parent 911b23e706
commit cbad0f06cf
4 changed files with 58 additions and 1 deletions

View File

@ -6,6 +6,12 @@ export default class AreaService extends BaseService<any>{
super() super()
} }
// 查询列表 // 查询列表
public selectByPageList(params: any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/risk/area/listLevel';
return this.get(url,params,true)
}
// 查询下拉列表
public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{ public selectByPage(params: any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/risk/area/list'; const url = this.prefix.prevention+'/risk/area/list';
return this.get(url,params,true) return this.get(url,params,true)

View File

@ -5,6 +5,14 @@ export default class UnitService extends BaseService<any>{
constructor(){ constructor(){
super() super()
} }
// 查询列表
public selectByPageList(params: any,showLoading?):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/risk/unit/listLevel';
return this.get(url,params,showLoading)
}
// 查询下拉列表
public selectByPage(params: any,showLoading?):Promise<AxiosResponse<ActionResult<any>>>{ public selectByPage(params: any,showLoading?):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/risk/unit/listAll'; const url = this.prefix.prevention+'/risk/unit/listAll';
return this.get(url,params,showLoading) return this.get(url,params,showLoading)

View File

@ -114,6 +114,15 @@ export default class AreaManagerComponent extends BaseRecordComponent<any> {
// //
} }
public getTableData(){
this.tableService.selectByPageList(this.params).then((res:any)=>{
this.tableData = res.data
if(this.getTableCallback){
this.getTableCallback(res.data)
}
})
}
public buildFormOptions() { public buildFormOptions() {
this.updateOptions = [{ this.updateOptions = [{
name: "区域编号", name: "区域编号",
@ -281,6 +290,19 @@ export default class AreaManagerComponent extends BaseRecordComponent<any> {
return this.$store.getters.common_yes_no_map[data.majorHazardFlag] return this.$store.getters.common_yes_no_map[data.majorHazardFlag]
} }
}); });
this.tableColumn.push({
name: '风险等级', key: "riskLevel", width: "150px", render: (data) => {
return "<span class='color_level_" + data.riskLevel + "'>" + (data.riskLevel ? (this.$store.getters.prevention_risk_level_map[data.riskLevel]) : '待评估') + "</span>"
},
filters: this.$store.state.prevention_risk_level.map(item => {
return {
text: item.name,
value: item.value,
}
}), filterMethod: (data, row) => {
return row.riskLevel === data;
}
});
this.tableColumn.push({ this.tableColumn.push({
name: '绘制情况', filters: this.filters, filterMethod: (data, row) => { name: '绘制情况', filters: this.filters, filterMethod: (data, row) => {
if (data) { if (data) {

View File

@ -123,6 +123,15 @@ export default class UnitManagerComponent extends BaseRecordComponent<any> {
this.getAreaList(); this.getAreaList();
} }
public getTableData(){
this.tableService.selectByPageList(this.params,true).then((res:any)=>{
this.tableData = res.data
if(this.getTableCallback){
this.getTableCallback(res.data)
}
})
}
public buildTurnOffForm() { public buildTurnOffForm() {
this.turnOffForm = [{ this.turnOffForm = [{
name: "停用/恢复", name: "停用/恢复",
@ -355,6 +364,19 @@ export default class UnitManagerComponent extends BaseRecordComponent<any> {
this.tableColumn.push({ name: '风险分析单元', key: "name" }); this.tableColumn.push({ name: '风险分析单元', key: "name" });
this.tableColumn.push({ name: '责任部门', key: "chargeDeptName" }); this.tableColumn.push({ name: '责任部门', key: "chargeDeptName" });
this.tableColumn.push({ name: '责任人', key: "chargeUserName" }); this.tableColumn.push({ name: '责任人', key: "chargeUserName" });
this.tableColumn.push({
name: '风险等级', key: "riskLevel", width: "150px", render: (data) => {
return "<span class='color_level_" + data.riskLevel + "'>" + (data.riskLevel ? (this.$store.getters.prevention_risk_level_map[data.riskLevel]) : '待评估') + "</span>"
},
filters: this.$store.state.prevention_risk_level.map(item => {
return {
text: item.name,
value: item.value,
}
}), filterMethod: (data, row) => {
return row.riskLevel === data;
}
});
this.tableColumn.push({ this.tableColumn.push({
name: '绘制情况', filters: this.filters, filterMethod: (data, row) => { name: '绘制情况', filters: this.filters, filterMethod: (data, row) => {
if (data) { if (data) {
@ -370,7 +392,6 @@ export default class UnitManagerComponent extends BaseRecordComponent<any> {
} }
} }
}); });
this.repairTableColumn.push({ name: "序号", key: "index" }); this.repairTableColumn.push({ name: "序号", key: "index" });
this.repairTableColumn.push({ name: "停用开始时间", key: "startTime" }); this.repairTableColumn.push({ name: "停用开始时间", key: "startTime" });
this.repairTableColumn.push({ name: "停用开始时间", key: "endTime" }); this.repairTableColumn.push({ name: "停用开始时间", key: "endTime" });