|
@ -4,10 +4,13 @@ import { http } from '/nerv-lib/util'; |
|
|
import { ref } from 'vue'; |
|
|
import { ref } from 'vue'; |
|
|
import { group } from '/@/api/deviceManage'; |
|
|
import { group } from '/@/api/deviceManage'; |
|
|
import { dict } from '/@/api'; |
|
|
import { dict } from '/@/api'; |
|
|
const tableKeyMap = [ |
|
|
import { origanizemanage } from '/@/api/origanizemanage'; |
|
|
|
|
|
const tableCalKeyMap = [ |
|
|
{ |
|
|
{ |
|
|
title: '来源企业', |
|
|
title: '来源企业', |
|
|
dataIndex: 'id', |
|
|
dataIndex: 'orgName', |
|
|
|
|
|
// textEllipsis: true,
|
|
|
|
|
|
// textNumber: 4,
|
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '设备id', |
|
|
title: '设备id', |
|
@ -32,20 +35,18 @@ const tableKeyMap = [ |
|
|
dataIndex: 'position', |
|
|
dataIndex: 'position', |
|
|
}, |
|
|
}, |
|
|
]; |
|
|
]; |
|
|
const tableCalKeyMap = [ |
|
|
const tableKeyMap = [ |
|
|
{ |
|
|
{ |
|
|
title: '来源企业', |
|
|
title: '来源企业', |
|
|
dataIndex: 'id', |
|
|
dataIndex: 'orgName', |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '节点编号', |
|
|
title: '节点编号', |
|
|
dataIndex: 'deviceName', |
|
|
dataIndex: 'pointNum', |
|
|
textNumber: 8, |
|
|
|
|
|
textEllipsis: true, |
|
|
|
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '节点路径', |
|
|
title: '节点路径', |
|
|
dataIndex: 'position', |
|
|
dataIndex: 'routeName', |
|
|
}, |
|
|
}, |
|
|
]; |
|
|
]; |
|
|
const doWnload = (url) => { |
|
|
const doWnload = (url) => { |
|
@ -125,6 +126,26 @@ export const formSchema = [ |
|
|
], |
|
|
], |
|
|
}, |
|
|
}, |
|
|
]; |
|
|
]; |
|
|
|
|
|
export const editTreeConfig = (orgId) => ({ |
|
|
|
|
|
selectedKeys: ['0-0'], |
|
|
|
|
|
defaultExpandAll: true, |
|
|
|
|
|
api: group.queryEditGroup, |
|
|
|
|
|
params: { orgId }, |
|
|
|
|
|
resultField: 'data.orgInfos', |
|
|
|
|
|
fieldNames: { title: 'orgName', key: 'orgId' }, |
|
|
|
|
|
formConfig: { |
|
|
|
|
|
schemas: [ |
|
|
|
|
|
{ |
|
|
|
|
|
field: 'orgName', |
|
|
|
|
|
component: 'NsInput', |
|
|
|
|
|
autoSubmit: true, |
|
|
|
|
|
componentProps: { |
|
|
|
|
|
placeholder: '请输入企业名称', |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
|
|
|
}, |
|
|
|
|
|
}); |
|
|
export const treeConfig = (orgId) => { |
|
|
export const treeConfig = (orgId) => { |
|
|
return { |
|
|
return { |
|
|
defaultExpandAll: true, |
|
|
defaultExpandAll: true, |
|
@ -133,15 +154,8 @@ export const treeConfig = (orgId) => { |
|
|
title: '能耗分组', |
|
|
title: '能耗分组', |
|
|
}, |
|
|
}, |
|
|
params: { orgId }, |
|
|
params: { orgId }, |
|
|
showLine: { showLeafIcon: false }, |
|
|
|
|
|
api: group.queryDeviceGroupTree, |
|
|
api: group.queryDeviceGroupTree, |
|
|
// api: () => {
|
|
|
|
|
|
// return new Promise((resolve) => {
|
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
|
// resolve({ data: [{ title: '全部', key: 'all', children: data.data }] });
|
|
|
|
|
|
// }, 100);
|
|
|
|
|
|
// });
|
|
|
|
|
|
// },
|
|
|
|
|
|
transform: (data) => { |
|
|
transform: (data) => { |
|
|
return [{ pointName: '全部', id: 'all', selectable: false, children: data }]; |
|
|
return [{ pointName: '全部', id: 'all', selectable: false, children: data }]; |
|
|
}, |
|
|
}, |
|
@ -176,12 +190,11 @@ export const treeConfig = (orgId) => { |
|
|
}, |
|
|
}, |
|
|
}; |
|
|
}; |
|
|
}; |
|
|
}; |
|
|
export const tableConfig = (el, elGroup, elFormula) => { |
|
|
export const tableConfig = (el, elGroup, elFormula, defaultParams) => { |
|
|
return { |
|
|
return { |
|
|
title: '点位信息', |
|
|
title: '点位信息', |
|
|
// api: '/carbon_emission/device/getDeviceList',
|
|
|
api: group.queryGroupPage, |
|
|
value: mockData.value, |
|
|
params: defaultParams.value, |
|
|
|
|
|
|
|
|
headerActions: [ |
|
|
headerActions: [ |
|
|
{ |
|
|
{ |
|
|
label: '编辑', |
|
|
label: '编辑', |
|
@ -193,7 +206,7 @@ export const tableConfig = (el, elGroup, elFormula) => { |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '批量删除', |
|
|
label: '批量删除', |
|
|
name: 'groupTemDownload', |
|
|
name: 'groupBatDelete', |
|
|
type: 'primary', |
|
|
type: 'primary', |
|
|
dynamicDisabled: (data: any) => { |
|
|
dynamicDisabled: (data: any) => { |
|
|
return data.list.length === 0; |
|
|
return data.list.length === 0; |
|
@ -244,7 +257,7 @@ export const tableConfig = (el, elGroup, elFormula) => { |
|
|
|
|
|
|
|
|
{ |
|
|
{ |
|
|
label: '批量分组', |
|
|
label: '批量分组', |
|
|
name: 'groupTemDownload', |
|
|
name: 'groupBatGroup', |
|
|
type: 'primary', |
|
|
type: 'primary', |
|
|
handle: () => { |
|
|
handle: () => { |
|
|
elGroup.value.toggle(); |
|
|
elGroup.value.toggle(); |
|
@ -252,7 +265,7 @@ export const tableConfig = (el, elGroup, elFormula) => { |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '公式编辑', |
|
|
label: '公式编辑', |
|
|
name: 'groupTemDownload', |
|
|
name: 'groupFormulaEdit', |
|
|
type: 'primary', |
|
|
type: 'primary', |
|
|
handle: () => { |
|
|
handle: () => { |
|
|
elFormula.value.toggle(); |
|
|
elFormula.value.toggle(); |
|
@ -265,7 +278,7 @@ export const tableConfig = (el, elGroup, elFormula) => { |
|
|
actions: [ |
|
|
actions: [ |
|
|
{ |
|
|
{ |
|
|
label: '删除', |
|
|
label: '删除', |
|
|
name: 'FeedBackDetail', |
|
|
name: 'groupDelete', |
|
|
dynamicParams: ['uuid', 'appealType'], |
|
|
dynamicParams: ['uuid', 'appealType'], |
|
|
confirm: true, |
|
|
confirm: true, |
|
|
handle: () => { |
|
|
handle: () => { |
|
@ -341,11 +354,13 @@ export const tableConfig = (el, elGroup, elFormula) => { |
|
|
}; |
|
|
}; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
export const tableConfigCal = (el, elGroup, elFormula) => { |
|
|
export const tableConfigCal = (el, elGroup, elFormula, defaultParams) => { |
|
|
|
|
|
// 分组节点
|
|
|
return { |
|
|
return { |
|
|
title: '点位信息', |
|
|
title: '点位信息', |
|
|
// api: '/carbon_emission/device/getDeviceList',
|
|
|
// api: '/carbon_emission/device/getDeviceList',
|
|
|
value: mockData.value, |
|
|
value: mockData.value, |
|
|
|
|
|
params: defaultParams, |
|
|
|
|
|
|
|
|
headerActions: [ |
|
|
headerActions: [ |
|
|
{ |
|
|
{ |
|
@ -413,12 +428,12 @@ export const tableConfigCal = (el, elGroup, elFormula) => { |
|
|
actions: [ |
|
|
actions: [ |
|
|
{ |
|
|
{ |
|
|
label: '删除', |
|
|
label: '删除', |
|
|
name: 'FeedBackDetail', |
|
|
name: 'groupDelete', |
|
|
dynamicParams: ['uuid', 'appealType'], |
|
|
dynamicParams: 'id', |
|
|
confirm: true, |
|
|
confirm: true, |
|
|
handle: () => { |
|
|
isReload: true, |
|
|
mockData.value.splice(0, 1); |
|
|
isClearCheck: true, |
|
|
}, |
|
|
api: group.delGroupList, |
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
|
}, |
|
|
}, |
|
|