diff --git a/hx-ai-intelligent/src/api/deviceManage.ts b/hx-ai-intelligent/src/api/deviceManage.ts
index b0b008d..0be7ca6 100644
--- a/hx-ai-intelligent/src/api/deviceManage.ts
+++ b/hx-ai-intelligent/src/api/deviceManage.ts
@@ -30,6 +30,8 @@ export enum group {
dropGroupInfoFilter = `${BASE_URL}/deviceGroup/dropGroupInfoFilter`, // 计算列表查询
queryDeviceToEnergy = `${BASE_URL}/deviceGroup/queryDeviceToEnergy`, // 能耗监测用查询设备(能耗监测设备树)
+ importGroup = `${BASE_URL}/deviceGroup/importGroup`, // 批量导入计算节点
+
getCarbonGroupList = `${BASE_URL}/deviceGroup/carbonEmissions/getGroupList`, // 分组管理-碳排放-分组查询设备
deleteCarbonDevice = `${BASE_URL}/deviceGroup/carbonEmissions/deleteDevice`, // 分组管理-碳排放-删除设备
addCarbonDevice = `${BASE_URL}/deviceGroup/carbonEmissions/addDevice`, // 分组管理-碳排放-添加设备
diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/config.ts b/hx-ai-intelligent/src/view/equipmentManage/group/config.ts
index eda0602..523aa0b 100644
--- a/hx-ai-intelligent/src/view/equipmentManage/group/config.ts
+++ b/hx-ai-intelligent/src/view/equipmentManage/group/config.ts
@@ -8,33 +8,39 @@ const tableCalKeyMap = [
title: '来源企业',
dataIndex: 'linkOrgName',
textEllipsis: true,
+ align: 'center',
textNumber: 10,
},
{
title: '设备id',
textNumber: 10,
dataIndex: 'deviceCode',
+ align: 'center',
textEllipsis: true,
},
{
title: '设备编号',
dataIndex: 'deviceNum',
+ align: 'center',
textNumber: 10,
},
{
textNumber: 10,
title: '分组名称',
dataIndex: 'groupName',
+ align: 'center',
},
{
title: '设备品牌/型号',
textNumber: 10,
dataIndex: 'deviceNameType',
+ align: 'center',
},
{
textNumber: 10,
title: '设备状态',
dataIndex: 'deviceStatus',
+ align: 'center',
customRender: ({ value }) => {
return value === '0' ? '启用' : '停用';
},
@@ -45,6 +51,7 @@ const tableCarbonKeyMap = [
{
title: '能源类型',
dataIndex: 'energyTypeName',
+ align: 'center',
// textEllipsis: true,
textNumber: 5,
},
@@ -52,38 +59,45 @@ const tableCarbonKeyMap = [
{
title: '设备id',
dataIndex: 'deviceInfoCode',
+ align: 'center',
textNumber: 10,
},
{
title: '设备编号',
textNumber: 10,
dataIndex: 'deviceName',
+ align: 'center',
// textEllipsis: true,
},
{
textNumber: 5,
title: '碳排因子值',
dataIndex: 'emissionFactor',
+ align: 'center',
},
{
title: '设备品牌/型号',
textNumber: 10,
dataIndex: 'deviceModel',
+ align: 'center',
},
{
title: '来源企业',
textNumber: 10,
dataIndex: 'manufacturer',
+ align: 'center',
},
{
title: '分组名称',
textNumber: 10,
dataIndex: 'groupName',
+ align: 'center',
},
{
textNumber: 5,
title: '设备状态',
dataIndex: 'status',
+ align: 'center',
customRender: ({ value }) => {
if (value) {
if (value === '0') {
@@ -101,14 +115,17 @@ const tableKeyMap = [
{
title: '来源企业',
dataIndex: 'orgName',
+ align: 'center',
},
{
title: '节点编号',
dataIndex: 'pointNum',
+ align: 'center',
},
{
title: '节点路径',
dataIndex: 'routeName',
+ align: 'center',
},
];
const doWnload = (url) => {
@@ -326,6 +343,9 @@ export const tableConfig = (el, elGroup, elFormula, defaultParams) => {
type: 'primary',
extra: {
// api: props.postImportApi, // 导入接口名
+ api: group.importGroup, // 导入接口名
+ // dynamicParams: { defaultParams: defaultParams },
+ params: defaultParams.value,
title: '设备信息', // 弹窗title
templateName: 'whiteListUser', // 所使用的文件名称
indexName: '设备id', // 匹配类型字段
@@ -514,7 +534,7 @@ export const tableConfigCal = (
return data.list.length === 0;
},
handle: ({ list }) => {
- const ids = list.map(({ id }) => id);
+ const ids = list.filter(({ id }) => id > 0).map(({ id }) => id);
defaultParams.value['saveDeviceInfoIds'] = ids;
elGroup.value.toggle();
@@ -709,20 +729,24 @@ export const editCarbonEquipmentConfig = (orgId, props) => {
{
title: '设备名称',
dataIndex: 'deviceName',
+ align: 'center',
},
{
title: '设备型号',
dataIndex: 'deviceModel',
+ align: 'center',
},
{
title: 'SN码',
dataIndex: 'snCode',
+ align: 'center',
textNumber: 5,
textEllipsis: true,
},
{
title: '设备一级区域',
dataIndex: 'device1Area',
+ align: 'center',
textWidth: 88,
// width: 130,
textEllipsis: true,
@@ -730,6 +754,7 @@ export const editCarbonEquipmentConfig = (orgId, props) => {
{
title: '设备二级区域',
dataIndex: 'device2Area',
+ align: 'center',
textWidth: 88,
// width: 130,
textEllipsis: true,
@@ -737,6 +762,7 @@ export const editCarbonEquipmentConfig = (orgId, props) => {
{
title: '设备详细位置',
dataIndex: 'deviceAddress',
+ align: 'center',
textNumber: 5,
textEllipsis: true,
},
@@ -883,6 +909,7 @@ export const setFactorConfig = (orgId) => {
title: '序号',
textNumber: 2,
dataIndex: 'address',
+ align: 'center',
customRender: (text: any) => {
return text.index + 1;
},
@@ -890,118 +917,50 @@ export const setFactorConfig = (orgId) => {
{
title: '因子值',
dataIndex: 'emissionFactors',
+ align: 'center',
textNumber: 3,
},
{
title: '计量单位',
dataIndex: 'carbonEmissionSuffix',
+ align: 'center',
textNumber: 4,
textEllipsis: true,
},
{
title: '更新时间',
dataIndex: 'updateTime',
+ align: 'center',
textWidth: 88,
// width: 130,
+ textNumber: 5,
textEllipsis: true,
},
{
title: '启用时间',
dataIndex: 'startTime',
+ align: 'center',
textWidth: 88,
// width: 130,
+ textNumber: 6,
textEllipsis: true,
},
{
title: '结束时间',
dataIndex: 'endTime',
- textNumber: 5,
+ align: 'center',
+ textNumber: 7,
textEllipsis: true,
},
{
title: '数据来源',
dataIndex: 'dataSources',
- textNumber: 5,
+ align: 'center',
+ textNumber: 8,
textEllipsis: true,
},
],
- // formConfig: {
- // schemas: [
- // {
- // field: 'areas',
- // label: '设备区域',
- // component: 'NsCascader',
- // format: (record) => {
- // console.log(record);
- // return record?.reduce(
- // (pre, cur) => {
- // const len = cur?.length - 1;
- // pre[len].push(cur[len]);
- // return pre;
- // },
- // [[], []],
- // );
- // },
- // fieldMap: ['area1', 'area2'],
- // componentProps: {
- // placeholder: '请选择设备区域',
- // multiple: true,
- // loadData: (selectedOptions, options) => {
- // const targetOption = selectedOptions[selectedOptions.length - 1];
- // if (!selectedOptions.length) {
- // http.post(device.dropArea, { orgId, filterField: 'DEVICE_AREA' }).then((res) => {
- // options.value = res.data?.map((item) => {
- // return { label: item, value: item, children: [], isLeaf: false };
- // });
- // });
- // }
- // const value = targetOption?.value;
- // if (targetOption) {
- // targetOption.loading = true;
- // http
- // .post(device.dropArea, { device1Area: value, orgId, filterField: 'DEVICE_AREA' })
- // .then((res) => {
- // targetOption.loading = false;
- // targetOption.children = res.data?.map((item) => {
- // return { label: item, value: item, children: [], isLeaf: true };
- // });
- // });
- // }
- // },
- // },
- // },
- // {
- // field: 'deviceName',
- // label: '设备名称',
- // component: 'NsSelectApi',
- // componentProps: {
- // placeholder: '请选择设备名称',
- // api: (params) => {
- // return http.post(device.dropArea, params).then((res) => {
- // const result = res.data?.reduce((pre, cur) => {
- // !pre.includes(cur.deviceName) && pre.push(cur.deviceName);
- // return pre;
- // }, []);
- // return { data: result };
- // });
- // },
- // resultField: 'data',
- // params: { orgId, filterField: 'DEVICE_NAME_FACTORY' },
- // // labelField: 'deviceName',
- // // valueField: 'deviceName',
- // filterOption: (input: string, option: any) => {
- // return option.deviceName?.toLowerCase().indexOf(input.toLowerCase()) >= 0;
- // },
- // showSearch: true,
- // immediate: true,
- // dropdownReload: true,
- // allowClear: true,
- // },
- // },
- // ],
- // params: {},
- // },
// pagination: { pageSizeOptions: false },
rowKey: 'id',
});
diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/setFactor.vue b/hx-ai-intelligent/src/view/equipmentManage/group/setFactor.vue
index 706bcba..8f23000 100644
--- a/hx-ai-intelligent/src/view/equipmentManage/group/setFactor.vue
+++ b/hx-ai-intelligent/src/view/equipmentManage/group/setFactor.vue
@@ -1,7 +1,7 @@