|
|
@ -30,6 +30,22 @@ const tableKeyMap = [ |
|
|
|
dataIndex: 'position', |
|
|
|
}, |
|
|
|
]; |
|
|
|
const tableCalKeyMap = [ |
|
|
|
{ |
|
|
|
title: '来源企业', |
|
|
|
dataIndex: 'id', |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '节点编号', |
|
|
|
dataIndex: 'deviceName', |
|
|
|
textNumber: 8, |
|
|
|
textEllipsis: true, |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: '节点路径', |
|
|
|
dataIndex: 'position', |
|
|
|
}, |
|
|
|
]; |
|
|
|
const doWnload = (url) => { |
|
|
|
const a = document.createElement('a'); |
|
|
|
document.body.appendChild(a); |
|
|
@ -41,17 +57,13 @@ const doWnload = (url) => { |
|
|
|
}; |
|
|
|
|
|
|
|
const mockData = ref(data.listData); |
|
|
|
export const tableConfig = (el, elGroup, elFormula) => { |
|
|
|
return { |
|
|
|
title: '设备台账', |
|
|
|
// api: '/carbon_emission/device/getDeviceList',
|
|
|
|
value: mockData.value, |
|
|
|
treeConfig: { |
|
|
|
export const treeConfig = { |
|
|
|
defaultExpandAll: true, |
|
|
|
header: { |
|
|
|
icon: 'orgLink', |
|
|
|
title: '分组管理', |
|
|
|
title: '能耗分组', |
|
|
|
}, |
|
|
|
|
|
|
|
api: () => { |
|
|
|
return new Promise((resolve) => { |
|
|
|
setTimeout(() => { |
|
|
@ -64,7 +76,7 @@ export const tableConfig = (el, elGroup, elFormula) => { |
|
|
|
{ |
|
|
|
field: 'type', |
|
|
|
label: '', |
|
|
|
component: 'NsRadioGroup', |
|
|
|
component: 'NsSelect', |
|
|
|
autoSubmit: true, |
|
|
|
defaultValue: 1, |
|
|
|
componentProps: { |
|
|
@ -88,7 +100,12 @@ export const tableConfig = (el, elGroup, elFormula) => { |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
export const tableConfig = (el, elGroup, elFormula) => { |
|
|
|
return { |
|
|
|
title: '点位信息', |
|
|
|
// api: '/carbon_emission/device/getDeviceList',
|
|
|
|
value: mockData.value, |
|
|
|
|
|
|
|
headerActions: [ |
|
|
|
{ |
|
|
@ -249,11 +266,108 @@ export const tableConfig = (el, elGroup, elFormula) => { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
export const treeConfig = { |
|
|
|
defaultExpandAll: true, |
|
|
|
defaultSelectedKeys: ['A008'], |
|
|
|
resultField: 'insertData', |
|
|
|
api: () => { |
|
|
|
return Promise.resolve(data); |
|
|
|
export const tableConfigCal = (el, elGroup, elFormula) => { |
|
|
|
return { |
|
|
|
title: '点位信息', |
|
|
|
// api: '/carbon_emission/device/getDeviceList',
|
|
|
|
value: mockData.value, |
|
|
|
|
|
|
|
headerActions: [ |
|
|
|
{ |
|
|
|
label: '编辑', |
|
|
|
name: 'groupEdit', |
|
|
|
type: 'primary', |
|
|
|
handle: (a, b) => { |
|
|
|
el.value.toggle(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '批量删除', |
|
|
|
name: 'groupTemDownload', |
|
|
|
type: 'primary', |
|
|
|
dynamicDisabled: (data: any) => { |
|
|
|
return data.list.length === 0; |
|
|
|
}, |
|
|
|
handle: () => { |
|
|
|
mockData.value.splice(0, 2); |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '批量导出', |
|
|
|
name: 'groupExports', |
|
|
|
type: 'primary', |
|
|
|
dynamicDisabled: (data: any) => { |
|
|
|
return data.list.length === 0; |
|
|
|
}, |
|
|
|
extra: { |
|
|
|
xlsxMap: tableKeyMap, |
|
|
|
xlsxName: '分组信息YYYY-MM-DD', |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '批量导入', |
|
|
|
name: 'groupImport', |
|
|
|
type: 'primary', |
|
|
|
extra: { |
|
|
|
// api: props.postImportApi, // 导入接口名
|
|
|
|
title: '设备信息', // 弹窗title
|
|
|
|
templateName: 'whiteListUser', // 所使用的文件名称
|
|
|
|
indexName: '设备id', // 匹配类型字段
|
|
|
|
message: [ |
|
|
|
{ label: '1、若必填项未填写,则不能进行导入操作' }, |
|
|
|
{ label: `2、当重复时,则更新数据。` }, |
|
|
|
{ label: '3、数据将从模版的第五行进行导入。' }, |
|
|
|
{ label: '4、文件导入勿超过5MB。' }, |
|
|
|
], |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
label: '模板下载', |
|
|
|
name: 'groupTemDownload', |
|
|
|
type: 'primary', |
|
|
|
handle: () => { |
|
|
|
// http.get('/asset/file/whiteListUser.xlsx');
|
|
|
|
doWnload('/hx-ai-intelligent/asset/file/whiteListUser.xlsx'); |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
columns: tableCalKeyMap, |
|
|
|
columnActions: { |
|
|
|
title: '操作', |
|
|
|
actions: [ |
|
|
|
{ |
|
|
|
label: '删除', |
|
|
|
name: 'FeedBackDetail', |
|
|
|
dynamicParams: ['uuid', 'appealType'], |
|
|
|
confirm: true, |
|
|
|
handle: () => { |
|
|
|
mockData.value.splice(0, 1); |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
|
|
|
|
formConfig: { |
|
|
|
schemas: [ |
|
|
|
{ |
|
|
|
field: 'name', |
|
|
|
label: '设备名称', |
|
|
|
component: 'NsInput', |
|
|
|
componentProps: { |
|
|
|
placeholder: '请选择公司', |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
field: 'provider', |
|
|
|
component: 'NsInput', |
|
|
|
componentProps: { |
|
|
|
placeholder: '请输入节点编号', |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
// pagination: { pageSizeOptions: false },
|
|
|
|
rowKey: 'id', |
|
|
|
}; |
|
|
|
}; |
|
|
|