feat: 分组管理批量分组,公式编辑
This commit is contained in:
@@ -8,29 +8,32 @@ import { origanizemanage } from '/@/api/origanizemanage';
|
||||
const tableCalKeyMap = [
|
||||
{
|
||||
title: '来源企业',
|
||||
dataIndex: 'orgName',
|
||||
// textEllipsis: true,
|
||||
// textNumber: 4,
|
||||
dataIndex: 'linkOrgName',
|
||||
textEllipsis: true,
|
||||
textNumber: 10,
|
||||
},
|
||||
{
|
||||
title: '设备id',
|
||||
textNumber: 10,
|
||||
dataIndex: 'deviceCode',
|
||||
},
|
||||
{
|
||||
title: '设备编号',
|
||||
dataIndex: 'deviceName',
|
||||
textNumber: 8,
|
||||
textEllipsis: true,
|
||||
},
|
||||
{
|
||||
title: '设备编号',
|
||||
dataIndex: 'deviceNum',
|
||||
},
|
||||
{
|
||||
textNumber: 10,
|
||||
title: '分组名称',
|
||||
dataIndex: 'position',
|
||||
dataIndex: 'groupName',
|
||||
},
|
||||
{
|
||||
title: '设备品牌/型号',
|
||||
dataIndex: 'position',
|
||||
textNumber: 10,
|
||||
dataIndex: 'deviceNameType',
|
||||
},
|
||||
{
|
||||
textNumber: 10,
|
||||
title: '设备状态',
|
||||
dataIndex: 'position',
|
||||
},
|
||||
@@ -146,6 +149,26 @@ export const editTreeConfig = (orgId) => ({
|
||||
],
|
||||
},
|
||||
});
|
||||
export const editCalTreeConfig = (orgId) => ({
|
||||
selectedKeys: ['0-0'],
|
||||
defaultExpandAll: true,
|
||||
api: group.queryEditCompute,
|
||||
params: { orgId },
|
||||
resultField: 'data.orgInfos',
|
||||
fieldNames: { title: 'orgName', key: 'orgId' },
|
||||
formConfig: {
|
||||
schemas: [
|
||||
{
|
||||
field: 'orgName',
|
||||
component: 'NsInput',
|
||||
autoSubmit: true,
|
||||
componentProps: {
|
||||
placeholder: '请输入企业名称',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
export const treeConfig = (orgId) => {
|
||||
return {
|
||||
defaultExpandAll: true,
|
||||
@@ -211,9 +234,118 @@ export const tableConfig = (el, elGroup, elFormula, defaultParams) => {
|
||||
dynamicDisabled: (data: any) => {
|
||||
return data.list.length === 0;
|
||||
},
|
||||
handle: () => {
|
||||
mockData.value.splice(0, 2);
|
||||
dynamicParams: { linkIds: 'linkId[]' },
|
||||
confirm: true,
|
||||
isClearCheck: true,
|
||||
isReload: true,
|
||||
api: group.delGroupList,
|
||||
},
|
||||
{
|
||||
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: tableKeyMap,
|
||||
columnActions: {
|
||||
title: '操作',
|
||||
actions: [
|
||||
{
|
||||
label: '删除',
|
||||
name: 'groupDelete',
|
||||
dynamicParams: { linkIds: 'linkId[]' },
|
||||
confirm: true,
|
||||
isClearCheck: true,
|
||||
isReload: true,
|
||||
api: group.delGroupList,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
formConfig: {
|
||||
schemas: [
|
||||
{
|
||||
field: 'orgName',
|
||||
component: 'NsInput',
|
||||
componentProps: {
|
||||
placeholder: '请选择公司',
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'pointNum',
|
||||
component: 'NsInput',
|
||||
componentProps: {
|
||||
placeholder: '请输入节点编号',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
// pagination: { pageSizeOptions: false },
|
||||
rowKey: 'id',
|
||||
};
|
||||
};
|
||||
|
||||
export const tableConfigCal = (el, elGroup, elFormula, defaultParams) => {
|
||||
// 计算节点
|
||||
return {
|
||||
title: '点位信息',
|
||||
api: group.queryGroupInfoPage,
|
||||
params: defaultParams.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;
|
||||
},
|
||||
dynamicParams: { ids: 'id[]' },
|
||||
confirm: true,
|
||||
isReload: true,
|
||||
isClearCheck: true,
|
||||
api: group.delComputeList,
|
||||
},
|
||||
{
|
||||
label: '批量导出',
|
||||
@@ -259,7 +391,13 @@ export const tableConfig = (el, elGroup, elFormula, defaultParams) => {
|
||||
label: '批量分组',
|
||||
name: 'groupBatGroup',
|
||||
type: 'primary',
|
||||
handle: () => {
|
||||
dynamicDisabled: (data: any) => {
|
||||
return data.list.length === 0;
|
||||
},
|
||||
handle: ({ list }) => {
|
||||
const ids = list.map(({ id }) => id);
|
||||
|
||||
defaultParams.value['saveDeviceInfoIds'] = ids;
|
||||
elGroup.value.toggle();
|
||||
},
|
||||
},
|
||||
@@ -272,156 +410,7 @@ export const tableConfig = (el, elGroup, elFormula, defaultParams) => {
|
||||
},
|
||||
},
|
||||
],
|
||||
columns: tableKeyMap,
|
||||
columnActions: {
|
||||
title: '操作',
|
||||
actions: [
|
||||
{
|
||||
label: '删除',
|
||||
name: 'groupDelete',
|
||||
dynamicParams: ['uuid', 'appealType'],
|
||||
confirm: true,
|
||||
handle: () => {
|
||||
mockData.value.splice(0, 1);
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
formConfig: {
|
||||
schemas: [
|
||||
{
|
||||
field: 'name',
|
||||
label: '设备名称',
|
||||
component: 'NsInput',
|
||||
componentProps: {
|
||||
placeholder: '请输入',
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'provider',
|
||||
label: '设备厂商',
|
||||
component: 'NsInput',
|
||||
componentProps: {
|
||||
placeholder: '请输入',
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'payWay',
|
||||
label: '设备区域',
|
||||
component: 'NsSelect',
|
||||
componentProps: {
|
||||
placeholder: '请选择',
|
||||
options: [
|
||||
{
|
||||
label: '全部',
|
||||
value: '',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
label: '生产日期',
|
||||
component: 'NsRangePicker',
|
||||
fieldMap: ['queryStartDate', 'queryEndDate'],
|
||||
componentProps: {
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'createTime1',
|
||||
label: '采购日期',
|
||||
component: 'NsRangePicker',
|
||||
fieldMap: ['queryStartDate', 'queryEndDate'],
|
||||
componentProps: {
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'createTime2',
|
||||
label: '启用日期',
|
||||
component: 'NsRangePicker',
|
||||
fieldMap: ['queryStartDate', 'queryEndDate'],
|
||||
componentProps: {
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
// pagination: { pageSizeOptions: false },
|
||||
rowKey: 'id',
|
||||
};
|
||||
};
|
||||
|
||||
export const tableConfigCal = (el, elGroup, elFormula, defaultParams) => {
|
||||
// 分组节点
|
||||
return {
|
||||
title: '点位信息',
|
||||
// api: '/carbon_emission/device/getDeviceList',
|
||||
value: mockData.value,
|
||||
params: defaultParams,
|
||||
|
||||
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');
|
||||
},
|
||||
},
|
||||
],
|
||||
scroll: { x: 1400 },
|
||||
columns: tableCalKeyMap,
|
||||
columnActions: {
|
||||
title: '操作',
|
||||
@@ -429,11 +418,11 @@ export const tableConfigCal = (el, elGroup, elFormula, defaultParams) => {
|
||||
{
|
||||
label: '删除',
|
||||
name: 'groupDelete',
|
||||
dynamicParams: 'id',
|
||||
dynamicParams: { ids: 'id[]' },
|
||||
confirm: true,
|
||||
isReload: true,
|
||||
isClearCheck: true,
|
||||
api: group.delGroupList,
|
||||
api: group.delComputeList,
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -442,17 +431,45 @@ export const tableConfigCal = (el, elGroup, elFormula, defaultParams) => {
|
||||
schemas: [
|
||||
{
|
||||
field: 'name',
|
||||
label: '设备名称',
|
||||
label: '公司',
|
||||
component: 'NsInput',
|
||||
componentProps: {
|
||||
placeholder: '请选择公司',
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'deviceCode',
|
||||
component: 'NsInput',
|
||||
componentProps: {
|
||||
placeholder: '请输入设备id',
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'deviceNum',
|
||||
component: 'NsInput',
|
||||
componentProps: {
|
||||
placeholder: '请输入设备编号',
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'provider',
|
||||
component: 'NsInput',
|
||||
componentProps: {
|
||||
placeholder: '请输入节点编号',
|
||||
placeholder: '请输入设备状态',
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'deviceNameType',
|
||||
component: 'NsInput',
|
||||
componentProps: {
|
||||
placeholder: '请输入设备型号',
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'provider',
|
||||
component: 'NsInput',
|
||||
componentProps: {
|
||||
placeholder: '请输入分组名称',
|
||||
},
|
||||
},
|
||||
],
|
||||
|
Reference in New Issue
Block a user