forked from xxhjsb/hbt-prevention-ui
feat:区域单元添加风险等级字段
parent
911b23e706
commit
cbad0f06cf
|
@ -6,6 +6,12 @@ export default class AreaService extends BaseService<any>{
|
|||
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>>>{
|
||||
const url = this.prefix.prevention+'/risk/area/list';
|
||||
return this.get(url,params,true)
|
||||
|
|
|
@ -5,6 +5,14 @@ export default class UnitService extends BaseService<any>{
|
|||
constructor(){
|
||||
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>>>{
|
||||
const url = this.prefix.prevention+'/risk/unit/listAll';
|
||||
return this.get(url,params,showLoading)
|
||||
|
|
|
@ -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() {
|
||||
this.updateOptions = [{
|
||||
name: "区域编号",
|
||||
|
@ -281,6 +290,19 @@ export default class AreaManagerComponent extends BaseRecordComponent<any> {
|
|||
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({
|
||||
name: '绘制情况', filters: this.filters, filterMethod: (data, row) => {
|
||||
if (data) {
|
||||
|
|
|
@ -123,6 +123,15 @@ export default class UnitManagerComponent extends BaseRecordComponent<any> {
|
|||
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() {
|
||||
this.turnOffForm = [{
|
||||
name: "停用/恢复",
|
||||
|
@ -355,6 +364,19 @@ export default class UnitManagerComponent extends BaseRecordComponent<any> {
|
|||
this.tableColumn.push({ name: '风险分析单元', key: "name" });
|
||||
this.tableColumn.push({ name: '责任部门', key: "chargeDeptName" });
|
||||
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({
|
||||
name: '绘制情况', filters: this.filters, filterMethod: (data, row) => {
|
||||
if (data) {
|
||||
|
@ -370,7 +392,6 @@ export default class UnitManagerComponent extends BaseRecordComponent<any> {
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.repairTableColumn.push({ name: "序号", key: "index" });
|
||||
this.repairTableColumn.push({ name: "停用开始时间", key: "startTime" });
|
||||
this.repairTableColumn.push({ name: "停用开始时间", key: "endTime" });
|
||||
|
|
Loading…
Reference in New Issue