|
@ -149,7 +149,7 @@ export const formSchema = [ |
|
|
component: 'NsInput', |
|
|
component: 'NsInput', |
|
|
componentProps: { |
|
|
componentProps: { |
|
|
placeholder: '请输入', |
|
|
placeholder: '请输入', |
|
|
maxLength: 32, |
|
|
maxLength: 20, |
|
|
}, |
|
|
}, |
|
|
rules: [ |
|
|
rules: [ |
|
|
{ |
|
|
{ |
|
@ -410,14 +410,16 @@ export const tableConfigCal = ( |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
isCarbon |
|
|
{ |
|
|
? { |
|
|
|
|
|
label: '关联因子值', |
|
|
label: '关联因子值', |
|
|
name: 'SetFactor', |
|
|
name: 'SetFactor', |
|
|
type: 'primary', |
|
|
type: 'primary', |
|
|
dynamicDisabled: (data: any) => { |
|
|
dynamicDisabled: (data: any) => { |
|
|
return data.list.length === 0; |
|
|
return data.list.length === 0; |
|
|
}, |
|
|
}, |
|
|
|
|
|
ifShow: (data: any) => { |
|
|
|
|
|
return isCarbon; |
|
|
|
|
|
}, |
|
|
handle: ({ list }) => { |
|
|
handle: ({ list }) => { |
|
|
// 过滤出 id 大于 0 的项
|
|
|
// 过滤出 id 大于 0 的项
|
|
|
const filteredList = list.filter(({ id }) => id > 0); |
|
|
const filteredList = list.filter(({ id }) => id > 0); |
|
@ -427,8 +429,7 @@ export const tableConfigCal = ( |
|
|
|
|
|
|
|
|
setFactorRef.value.toggle(ids); |
|
|
setFactorRef.value.toggle(ids); |
|
|
}, |
|
|
}, |
|
|
} |
|
|
}, |
|
|
: {}, |
|
|
|
|
|
{ |
|
|
{ |
|
|
label: '批量删除', |
|
|
label: '批量删除', |
|
|
name: 'GroupPointDelete', |
|
|
name: 'GroupPointDelete', |
|
@ -518,10 +519,29 @@ export const tableConfigCal = ( |
|
|
actions: [ |
|
|
actions: [ |
|
|
{ |
|
|
{ |
|
|
label: '关联因子', |
|
|
label: '关联因子', |
|
|
|
|
|
// label: (record) => {
|
|
|
|
|
|
// // 根据record的某个字段值判断显示'关联因子'或'修改因子'
|
|
|
|
|
|
// return record.emissionFactor ? '修改因子' : '关联因子';
|
|
|
|
|
|
// },
|
|
|
|
|
|
name: 'SetFactor', |
|
|
|
|
|
ifShow: (record) => { |
|
|
|
|
|
// 这里根据record的某个字段值判断是否禁用删除按钮
|
|
|
|
|
|
return isCarbon && record.id >= 0 && !record.emissionFactor; |
|
|
|
|
|
}, |
|
|
|
|
|
handle: (row) => { |
|
|
|
|
|
setFactorRef.value.toggle([row.id]); |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
label: '修改关联', |
|
|
|
|
|
// label: (record) => {
|
|
|
|
|
|
// // 根据record的某个字段值判断显示'关联因子'或'修改因子'
|
|
|
|
|
|
// return record.emissionFactor ? '修改因子' : '关联因子';
|
|
|
|
|
|
// },
|
|
|
name: 'SetFactor', |
|
|
name: 'SetFactor', |
|
|
dynamicDisabled: (record) => { |
|
|
ifShow: (record) => { |
|
|
// 这里根据record的某个字段值判断是否禁用删除按钮
|
|
|
// 这里根据record的某个字段值判断是否禁用删除按钮
|
|
|
return record.id < 0; |
|
|
return isCarbon && record.id >= 0 && record.emissionFactor; |
|
|
}, |
|
|
}, |
|
|
handle: (row) => { |
|
|
handle: (row) => { |
|
|
setFactorRef.value.toggle([row.id]); |
|
|
setFactorRef.value.toggle([row.id]); |
|
@ -530,9 +550,9 @@ export const tableConfigCal = ( |
|
|
{ |
|
|
{ |
|
|
label: '删除', |
|
|
label: '删除', |
|
|
name: 'GroupPointDelete', |
|
|
name: 'GroupPointDelete', |
|
|
dynamicDisabled: (record) => { |
|
|
ifShow: (record) => { |
|
|
// 这里根据record的某个字段值判断是否禁用删除按钮
|
|
|
// 这里根据record的某个字段值判断是否禁用删除按钮
|
|
|
return record.id < 0; |
|
|
return record.id >= 0; |
|
|
}, |
|
|
}, |
|
|
dynamicParams: isCarbon |
|
|
dynamicParams: isCarbon |
|
|
? { |
|
|
? { |
|
@ -797,7 +817,7 @@ export const editCarbonEquipmentConfig = (orgId) => { |
|
|
], |
|
|
], |
|
|
params: {}, |
|
|
params: {}, |
|
|
}, |
|
|
}, |
|
|
// pagination: { pageSizeOptions: false },
|
|
|
pagination: true, |
|
|
rowKey: 'deviceInfoCode', |
|
|
rowKey: 'deviceInfoCode', |
|
|
}); |
|
|
}); |
|
|
}; |
|
|
}; |
|
|