Browse Source

Merge branch 'temp' of http://123.60.103.97:3000/xuziqiang/SaaS-lib into temp

deploy-dev
xuziqiang 4 months ago
parent
commit
82b0f4cf96
  1. 7
      hx-ai-intelligent/src/api/IlluminationInfo.ts
  2. 2
      hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts
  3. 3
      hx-ai-intelligent/src/api/index.ts
  4. 2
      hx-ai-intelligent/src/components/ns-steps.vue
  5. 20
      hx-ai-intelligent/src/router/carbonEmissionManage.ts
  6. 2
      hx-ai-intelligent/src/view/alarmManagement/alarmOverview/index.vue
  7. 2
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/configureEnergyAlarms.vue
  8. 17
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editConfigureEnergyAlarm.vue
  9. 102
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editeEnergyAlarm.vue
  10. 2
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/configureDeviceAlarms.vue
  11. 29
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editConfigureDeviceAlarm.vue
  12. 92
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editeEquipmentAlarm.vue
  13. 35
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/energyAlarmConfig.ts
  14. 36
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/equipmentAlarmConfig.ts
  15. 35
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/notificationManagementConfig.ts
  16. 4
      hx-ai-intelligent/src/view/alarmManagement/energyAlarm/look.vue
  17. 47
      hx-ai-intelligent/src/view/alarmManagement/energyAlarm/status.vue
  18. 74
      hx-ai-intelligent/src/view/alarmManagement/energyAlarm/ts/config.ts
  19. 27
      hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/status.vue
  20. 79
      hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/ts/config.ts
  21. 23
      hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/status.vue
  22. 44
      hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/ts/config.ts
  23. 2
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/config.ts
  24. 335
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue
  25. 28
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/carbonEmissions/index.vue
  26. 7
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue
  27. 1
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/index.vue
  28. 144
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue
  29. 709
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue
  30. 53
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue
  31. 24
      hx-ai-intelligent/src/view/equipmentControl/liftSystem/index.vue
  32. 13
      hx-ai-intelligent/src/view/equipmentControl/liftSystem/liftInfo.vue
  33. 177
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/indexs.vue
  34. 25
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/light.vue
  35. 424
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs1.vue
  36. 67
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs2.vue
  37. 38
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs3.vue

7
hx-ai-intelligent/src/api/IlluminationInfo.ts

@ -9,6 +9,13 @@ export enum lightingManage {
// 修改线路的可用/禁用状态
setDisable = '/carbon-smart/IlluminationInfo/revisePanel',
// 控制面板tab页 ================================================
// 获取当前修改的内容对比数据
getChangeList = '/carbon-smart/IlluminationInfo/getLightSceneChangeInfo',
// 提交当前修改
submitChangeList = '/carbon-smart/IlluminationInfo/changeLightScene',
// 计划列表tab页 ================================================
// 获得计划列表tab页的表格数据

2
hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts

@ -55,4 +55,6 @@ export enum carbonInventoryCheck {
findUnitById = '/carbon-smartapi/carbon/inventory/findById',
getDetailsList = '/carbon-smart/api/carbon/inventory/details/getDetailsList',
updateTable = '/carbon-smart/api/carbon/inventory/details/update',
// 排放统计接口
emissionStatistic = '/carbon-smart/api/carbon/inventory/emissionStatistic',
}

3
hx-ai-intelligent/src/api/index.ts

@ -50,7 +50,6 @@ export const getAllEnum = async ({
return Promise.resolve(res);
};
/**
* ( enumType)
*/
@ -58,6 +57,6 @@ export const getEnum = async ({
api = `${BASE_URL}/operation/enum/getEnum`,
params = {},
}: dictHttpConfig) => {
const res = await http.post(api, params);
const res = await http.get(api, params);
return Promise.resolve(res);
};

2
hx-ai-intelligent/src/components/ns-steps.vue

@ -9,7 +9,7 @@
<div class="card">
<div class="card-title">
<a-tag class="card-title-tag" :color="item.color">{{ item.stateName }}</a-tag>
<div class="name">{{ item.createName }}</div>
<div class="name">{{ item.realName }}</div>
<div class="time">{{ item.createTime }}</div>
</div>
<div style="width: 100%; color: #3a3a3a; height: 25px; overflow: auto">

20
hx-ai-intelligent/src/router/carbonEmissionManage.ts

@ -65,6 +65,26 @@ const equipment = {
},
],
},
{
path: 'carbonInventoryCheck',
name: 'CarbonInventoryCheck',
meta: { title: '碳资产', hideChildren: true, icon: 'tanpaiguanli' },
component: Base,
redirect: { name: 'CarbonInventoryCheckIndex' },
children: [
{
path: 'index',
name: 'CarbonInventoryCheckIndex',
// component: () => import('/nerv-lib/saas/view/menuManage/index.vue'),
component: () => import('/@/view/carbonEmissionManage/carbonInventoryCheck/index.vue'),
meta: {
title: '碳资产',
keepAlive: false,
// backApi: [],
},
},
],
},
],
};
export default equipment;

2
hx-ai-intelligent/src/view/alarmManagement/alarmOverview/index.vue

@ -20,7 +20,7 @@
</div>
</div>
<div class="item-box-right">
<img width="54px" height="54px" src="../../../../src/icon/gaojingtonglan.svg" />
<img width="48px" height="48px" src="../../../../src/icon/gaojingtonglan.svg" />
</div>
</div>
</div>

2
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/configureEnergyAlarms.vue

@ -288,7 +288,7 @@
},
],
},
params: { energyConsumptionAlarmId: value.id },
params: { energyConsumptionAlarmId: value.id, orgId: orgId.value },
// pagination: { pageSizeOptions: false },
rowKey: 'id',
};

17
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editConfigureEnergyAlarm.vue

@ -96,7 +96,7 @@
<a-select
v-model:value="infoObject.alarmList[index - 1].logic"
style="width: 70px; margin-left: 12px"
:options="ljOptions" />
:options="logicEnum" />
<span style="line-height: 32px; margin-left: 32px">{{ `数值${index}:` }}</span>
<a-input
style="width: 65px; margin-left: 6px"
@ -139,7 +139,7 @@
import { device, group } from '/@/api/deviceManage';
import { energyAlarms } from '/@/api/alarmManagement/alarmSettings/energyAlarm';
import { http } from '/nerv-lib/util';
import { dict } from '/@/api';
import { dict, getEnum } from '/@/api';
const visible = ref(false);
//
@ -256,13 +256,7 @@
);
};
//
const ljOptions = ref<SelectProps['options']>([
{ value: 0, label: '≥' },
{ value: 1, label: '>' },
{ value: 2, label: '≤' },
{ value: 3, label: '<' },
{ value: 4, label: '=' },
]);
const logicEnum = ref<SelectProps['options']>([]);
//
const clickSwitch = () => {
if (infoObject.value.enableRules === 1) {
@ -273,6 +267,8 @@
};
//
const toggle = async (value: any, info: any) => {
let enumData = await getEnum({ params: { enumType: 'LogicEnum' } });
logicEnum.value = enumData.data;
//
let energyType = await dict({ params: { dicKey: 'ENERGY_TYPE' } });
if (energyType.data.data) {
@ -394,6 +390,9 @@
formRef.value.validate().then(() => {
//
let data = { ...infoObject.value };
if (!data.orgId) {
data.orgId = orgId.value;
}
//id
data.energyConsumptionAlarmId = energyAlarm.value.id;
data.errorCode = energyAlarm.value.errorCode;

102
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editeEnergyAlarm.vue

@ -18,7 +18,7 @@
placeholder="请选择告警频率"
style="width: 100%"
allowClear
:options="alarmFrequencyData"
:options="AlarmFrequencyEnum"
@change="handleChangeAlarmFrequency" />
</a-form-item>
<a-form-item v-if="infoObject.alarmFrequency === 2" name="repetitions" label="重复次数">
@ -45,7 +45,7 @@
placeholder="请选择优先级"
style="width: 100%"
allowClear
:options="priorityData" />
:options="PriorityEnum" />
</a-form-item>
<a-form-item label="监测频率" name="monitorFrequency">
<a-select
@ -53,7 +53,7 @@
placeholder="请选择监测频率"
style="width: 100%"
allowClear
:options="monitorFrequencyData" />
:options="MonitorFrequencyEnumm" />
</a-form-item>
<a-form-item label="启用规则">
<a-switch
@ -79,6 +79,7 @@
import { NsMessage } from '/nerv-lib/component';
import { http } from '/nerv-lib/util';
import { energyAlarms } from '/@/api/alarmManagement/alarmSettings/energyAlarm';
import { getAllEnum } from '/@/api';
const visible = ref(false);
//
@ -87,6 +88,11 @@
infoObject.value.intervalDurationUnit = 1;
}
};
//id
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
//
const infoObject = ref({
alarmTitle: null,
@ -94,74 +100,16 @@
priority: null,
monitorFrequency: null,
createWorkOrder: null,
orgId: null,
enableRules: 0,
});
const formRef = ref();
const emit = defineEmits(['editObject']);
const alarmFrequencyData = ref([
{
label: '单次',
value: 1,
},
{
label: '重复',
value: 2,
},
{
label: '累计',
value: 3,
},
]);
const priorityData = ref([
{
label: '紧急',
value: 1,
},
{
label: '重要',
value: 2,
},
{
label: '一般',
value: 3,
},
]);
const intervalDurationUnitData = ref([
{
label: '分',
value: 1,
},
{
label: '时',
value: 2,
},
{
label: '天',
value: 3,
},
]);
const monitorFrequencyData = ref([
{
label: '小时',
value: 1,
},
{
label: '每日',
value: 2,
},
{
label: '每周',
value: 3,
},
{
label: '月度',
value: 4,
},
{
label: '年度',
value: 5,
},
]);
//
const AlarmFrequencyEnum = ref([]);
const PriorityEnum = ref([]);
const intervalDurationUnitData = ref([]);
const MonitorFrequencyEnumm = ref([]);
const rules = {
alarmTitle: [
{
@ -214,12 +162,29 @@
priority: [{ required: true, message: '请选择优先级', trigger: 'change' }],
monitorTimeUnit: [{ required: true, message: '请选择监测时长单位', trigger: 'change' }],
};
const getMenu = async () => {
let enumData = await getAllEnum({
params: [
'PriorityEnum',
'MonitorFrequencyEnumm',
'AlarmFrequencyEnum',
'IntervalDurationUnitEnum',
],
});
PriorityEnum.value = enumData.data.PriorityEnum;
MonitorFrequencyEnumm.value = enumData.data.MonitorFrequencyEnumm;
AlarmFrequencyEnum.value = enumData.data.AlarmFrequencyEnum;
intervalDurationUnitData.value = enumData.data.IntervalDurationUnitEnum;
};
const toggle = (value: any) => {
//
getMenu();
//
if (value) {
infoObject.value = value;
} else {
infoObject.value = {
orgId: null,
alarmTitle: null,
alarmFrequency: null,
priority: null,
@ -245,6 +210,9 @@
//
formRef.value.validate().then(() => {
let data = { ...infoObject.value };
if (!data.orgId) {
data.orgId = orgId.value;
}
data.createWorkOrder = Number(data.createWorkOrder);
if (data.alarmFrequency !== 2) {
data.repetitions = null;

2
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/configureDeviceAlarms.vue

@ -279,7 +279,7 @@
},
],
},
params: { equipmentAlarmId: value.id },
params: { equipmentAlarmId: value.id, orgId: orgId.value },
// pagination: { pageSizeOptions: false },
rowKey: 'id',
};

29
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editConfigureDeviceAlarm.vue

@ -84,7 +84,7 @@
placeholder="请选择取值类型"
allow-clear
style="width: 100%"
:options="qzOptions" />
:options="valueTypeEnum" />
</a-form-item>
<a-form-item label="异常描述" name="abnormalDescription">
<a-textarea
@ -114,7 +114,7 @@
<a-select
v-model:value="infoObject.alarmList[index - 1].logic"
style="width: 70px; margin-left: 12px"
:options="ljOptions" />
:options="logicEnum" />
<span style="line-height: 32px; margin-left: 32px">{{ `数值${index}:` }}</span>
<a-input
style="width: 65px; margin-left: 6px"
@ -158,6 +158,7 @@
import { device } from '/@/api/deviceManage';
import { deviceAlarms } from '/@/api/alarmManagement/alarmSettings/deviceAlarms';
import { http } from '/nerv-lib/util';
import { getAllEnum } from '/@/api';
const visible = ref(false);
//
@ -241,18 +242,9 @@
);
};
//
const qzOptions = ref<SelectProps['options']>([
{ value: 1, label: '实时值' },
{ value: 2, label: '平均值' },
]);
const valueTypeEnum = ref<SelectProps['options']>();
//
const ljOptions = ref<SelectProps['options']>([
{ value: 0, label: '≥' },
{ value: 1, label: '>' },
{ value: 2, label: '≤' },
{ value: 3, label: '<' },
{ value: 4, label: '=' },
]);
const logicEnum = ref<SelectProps['options']>([]);
//
const clickSwitch = () => {
@ -299,10 +291,16 @@
}
return null; // null
};
const getMenu = async () => {
let enumData = await getAllEnum({ params: ['LogicEnum', 'ValueTypeEnum'] });
logicEnum.value = enumData.data.LogicEnum;
valueTypeEnum.value = enumData.data.ValueTypeEnum;
};
//
const toggle = async (value: any, info: any) => {
equipmentAlarm.value = info;
//
getMenu();
//
await http
.post(device.queryDeviceTree, { orgId: orgId.value, pageNum: 1, pageSize: 10 })
@ -412,6 +410,9 @@
//
formRef.value.validate().then(() => {
let data = { ...infoObject.value };
if (!data.orgId) {
data.orgId = orgId.value;
}
// id
data.equipmentAlarmId = equipmentAlarm.value.id;
//

92
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editeEquipmentAlarm.vue

@ -24,7 +24,7 @@
placeholder="请选择监测时长单位"
style="width: 100%"
allowClear
:options="monitorTimeUnitData" />
:options="MonitorTimeUnitEnum" />
</a-form-item>
<a-form-item label="告警频率" name="alarmFrequency">
<a-select
@ -32,7 +32,7 @@
placeholder="请选择告警频率"
style="width: 100%"
allowClear
:options="alarmFrequencyData"
:options="AlarmFrequencyEnum"
@change="handleChangeAlarmFrequency" />
</a-form-item>
<a-form-item v-if="infoObject.alarmFrequency === 2" name="repetitions" label="重复次数">
@ -49,7 +49,7 @@
placeholder="请选择间隔时长单位"
style="width: 80px"
allowClear
:options="intervalDurationUnitData" />
:options="IntervalDurationUnitEnum" />
</template>
</ns-input-number>
</a-form-item>
@ -59,7 +59,7 @@
placeholder="请选择优先级"
style="width: 100%"
allowClear
:options="priorityData" />
:options="PriorityEnum" />
</a-form-item>
<a-form-item label="启用规则">
<a-switch
@ -85,8 +85,13 @@
import { NsMessage } from '/nerv-lib/component';
import { http } from '/nerv-lib/util';
import { deviceAlarms } from '/@/api/alarmManagement/alarmSettings/deviceAlarms';
import { getAllEnum } from '/@/api';
const visible = ref(false);
//id
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
//
const infoObject = ref({
id: null,
@ -103,63 +108,27 @@
});
const formRef = ref();
const emit = defineEmits(['editObject']);
const alarmFrequencyData = ref([
{
label: '单次',
value: 1,
},
{
label: '重复',
value: 2,
},
{
label: '累计',
value: 3,
},
]);
const monitorTimeUnitData = ref([
{
label: '分',
value: 1,
},
{
label: '时',
value: 2,
},
{
label: '天',
value: 3,
},
]);
const intervalDurationUnitData = ref([
{
label: '分',
value: 1,
},
{
label: '时',
value: 2,
},
{
label: '天',
value: 3,
},
]);
const priorityData = ref([
{
label: '紧急',
value: 1,
},
{
label: '重要',
value: 2,
},
{
label: '一般',
value: 3,
},
]);
const AlarmFrequencyEnum = ref([]);
const MonitorTimeUnitEnum = ref([]);
const IntervalDurationUnitEnum = ref([]);
const PriorityEnum = ref([]);
const getMenu = async () => {
let enumData = await getAllEnum({
params: [
'PriorityEnum',
'MonitorTimeUnitEnum',
'AlarmFrequencyEnum',
'IntervalDurationUnitEnum',
],
});
PriorityEnum.value = enumData.data.PriorityEnum;
MonitorTimeUnitEnum.value = enumData.data.MonitorTimeUnitEnum;
AlarmFrequencyEnum.value = enumData.data.AlarmFrequencyEnum;
IntervalDurationUnitEnum.value = enumData.data.IntervalDurationUnitEnum;
};
const toggle = (value: any) => {
//
getMenu();
//
if (value) {
infoObject.value = value;
@ -316,6 +285,9 @@
data.intervalDuration = null;
data.intervalDurationUnit = null;
}
if (!data.orgId) {
data.orgId = orgId.value;
}
http.post(deviceAlarms.addOrUpNewData, data).then(() => {
if (infoObject.value.id) {
NsMessage.success('告警编辑成功');

35
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/energyAlarmConfig.ts

@ -1,7 +1,12 @@
import { http } from '/nerv-lib/util';
import { NsMessage } from '/nerv-lib/component';
import { energyAlarms } from '/@/api/alarmManagement/alarmSettings/energyAlarm';
import { ref } from 'vue';
import { getEnum } from '/@/api';
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
const tableKeyMap = [
{
title: '序号',
@ -155,24 +160,23 @@ export const energyAlarmConfigs = (
{
field: 'priority',
label: '告警优先级',
component: 'NsSelect',
component: 'nsSelectApi',
// dynamicParams: {
// id: 'deviceName', //帮定上级联动数据
// },
componentProps: {
placeholder: '请选择告警优先级',
api: () => getEnum({ params: { enumType: 'PriorityEnum' } }),
immediate: true,
allowClear: true,
options: [
{
label: '紧急',
value: 1,
},
{
label: '重要',
value: 2,
},
{
label: '一般',
value: 3,
resultField: 'data',
labelField: 'label',
valueField: 'value',
placeholder: '请选择告警优先级',
showSearch: true,
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
},
],
// autoSelectFirst: true,
},
},
{
@ -214,6 +218,7 @@ export const energyAlarmConfigs = (
},
],
},
params: { orgId: orgId.value },
// pagination: { pageSizeOptions: false },
rowKey: 'id',
};

36
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/equipmentAlarmConfig.ts

@ -1,6 +1,12 @@
import { http } from '/nerv-lib/util';
import { NsMessage } from '/nerv-lib/component';
import { deviceAlarms } from '/@/api/alarmManagement/alarmSettings/deviceAlarms';
import { ref } from 'vue';
import { getEnum } from '/@/api';
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
const tableKeyMap = [
{
title: '序号',
@ -153,24 +159,23 @@ export const equipmentAlarmTableConfig = (
{
field: 'priority',
label: '告警优先级',
component: 'NsSelect',
component: 'nsSelectApi',
// dynamicParams: {
// id: 'deviceName', //帮定上级联动数据
// },
componentProps: {
placeholder: '请选择告警优先级',
api: () => getEnum({ params: { enumType: 'PriorityEnum' } }),
immediate: true,
allowClear: true,
options: [
{
label: '紧急',
value: 1,
},
{
label: '重要',
value: 2,
},
{
label: '一般',
value: 3,
resultField: 'data',
labelField: 'label',
valueField: 'value',
placeholder: '请选择告警优先级',
showSearch: true,
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
},
],
// autoSelectFirst: true,
},
},
{
@ -212,6 +217,7 @@ export const equipmentAlarmTableConfig = (
},
],
},
params: { orgId: orgId.value },
// pagination: { pageSizeOptions: false },
rowKey: 'id',
};

35
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/notificationManagementConfig.ts

@ -1,5 +1,10 @@
import { notificationManagementApi } from '/@/api/alarmManagement/alarmSettings/notificationManagements';
import { ref } from 'vue';
import { getEnum } from '/@/api';
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
const tableKeyMap = [
{
title: '序号',
@ -87,24 +92,23 @@ export const notificationtableConfig = (notificationManagements: any) => {
{
field: 'priority',
label: '告警优先级',
component: 'NsSelect',
component: 'nsSelectApi',
// dynamicParams: {
// id: 'deviceName', //帮定上级联动数据
// },
componentProps: {
placeholder: '请选择告警优先级',
api: () => getEnum({ params: { enumType: 'PriorityEnum' } }),
immediate: true,
allowClear: true,
options: [
{
label: '紧急',
value: 1,
},
{
label: '重要',
value: 2,
},
{
label: '一般',
value: 3,
resultField: 'data',
labelField: 'label',
valueField: 'value',
placeholder: '请选择告警优先级',
showSearch: true,
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
},
],
// autoSelectFirst: true,
},
},
{
@ -146,6 +150,7 @@ export const notificationtableConfig = (notificationManagements: any) => {
},
],
},
params: { orgId: orgId.value },
// pagination: { pageSizeOptions: false },
rowKey: 'id',
};

4
hx-ai-intelligent/src/view/alarmManagement/energyAlarm/look.vue

@ -67,7 +67,7 @@
errorCode: null,
alarmTitle: null,
abnormalDescription: null,
deviceInfo: null,
monitoringPoints: null,
alarmRepetitions: null,
updateTime: null,
});
@ -84,7 +84,7 @@
errorCode: null,
alarmTitle: null,
abnormalDescription: null,
deviceInfo: null,
monitoringPoints: null,
alarmRepetitions: null,
updateTime: null,
};

47
hx-ai-intelligent/src/view/alarmManagement/energyAlarm/status.vue

@ -11,7 +11,7 @@
<a-tabs>
<a-tab-pane key="1" tab="更新状态">
<div style="width: 100%; padding: 24px">
<a-form ref="formRef" :model="infoObject">
<a-form ref="formRef" :model="infoObject" :rules="rules">
<a-form-item ref="state" label="当前状态" name="state">
<a-select
v-model:value="infoObject.state"
@ -56,6 +56,7 @@
import { NsMessage } from '/nerv-lib/component';
import { http } from '/nerv-lib/util';
import { energyAlarmApi } from '/@/api/alarmManagement/energyAlarm';
import { getEnum } from '/@/api';
export default defineComponent({
components: { NsSteps },
@ -67,17 +68,38 @@
const energyAlarm = ref({});
const stateOptions = ref();
const logList = ref([]);
const formRef = ref();
const config = ref({
size: logList.value.length,
dataSource: logList.value,
});
//
const rules = {
remarks: [
{
required: true,
message: '请输入备注',
trigger: 'change',
validator: (rules, remarks, cbfn) => {
if (remarks && remarks.trim() !== '') {
cbfn();
} else {
cbfn('备注不能为空');
}
},
},
],
state: [{ required: true, message: '请选择当前状态', trigger: 'change' }],
};
const handleClose = () => {
showEdit.value = true;
energyAlarm.value = {};
infoObject.value = {};
visible.value = false;
config.value.dataSource = [];
};
const btnClick = () => {
formRef.value.validate().then(() => {
delete infoObject.value.createTime;
infoObject.value.alarmEnergyConsumptionLogId = energyAlarm.value.id;
if (energyAlarm.value.createWorkOrder === 0) {
@ -92,6 +114,7 @@
}
});
}
});
};
//
const changeShowEdit = () => {
@ -103,23 +126,11 @@
const toggle = async (data) => {
energyAlarm.value = { ...data };
visible.value = true;
if (energyAlarm.value.createWorkOrder === 1) {
stateOptions.value = [
{ value: 1, label: '待处理' },
{ value: 2, label: '处理中' },
{ value: 3, label: '已完成' },
{ value: 4, label: '超时' },
{ value: 5, label: '已关闭' },
];
} else {
stateOptions.value = [
{ value: 1, label: '待处理' },
{ value: 2, label: '处理中' },
{ value: 3, label: '已完成' },
{ value: 5, label: '已关闭' },
];
let states = await getEnum({ params: { enumType: 'AlarmLogStateEnum' } });
stateOptions.value = states.data;
if (energyAlarm.value.createWorkOrder !== 1) {
stateOptions.value = stateOptions.value.filter((item) => item.value !== 4);
}
console.log(data, 'data');
await http
.post(energyAlarmApi.getSelectAlarmEnergyConsumptionLogStatusProcess, {
alarmEnergyConsumptionLogId: data.id,
@ -149,6 +160,8 @@
infoObject,
changeShowEdit,
showEdit,
rules,
formRef,
energyAlarm,
stateOptions,
btnClick,

74
hx-ai-intelligent/src/view/alarmManagement/energyAlarm/ts/config.ts

@ -1,6 +1,11 @@
import { energyAlarmApi } from '/@/api/alarmManagement/energyAlarm';
import { dict } from '/@/api';
import { ref } from 'vue';
import { getEnum } from '/@/api';
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
const tableKeyMap = [
{
title: '序号',
@ -20,7 +25,7 @@ const tableKeyMap = [
},
{
title: '类型',
dataIndex: 'priority',
dataIndex: 'dataSourcesTypeName',
},
{
title: '优先级',
@ -103,55 +108,45 @@ export const notificationtableConfig = (look: any, status: any) => {
{
field: 'priority',
label: '优先级',
component: 'NsSelect',
component: 'nsSelectApi',
// dynamicParams: {
// id: 'deviceName', //帮定上级联动数据
// },
componentProps: {
placeholder: '请选择告警优先级',
api: () => getEnum({ params: { enumType: 'PriorityEnum' } }),
immediate: true,
allowClear: true,
options: [
{
label: '紧急',
value: 1,
},
{
label: '重要',
value: 2,
},
{
label: '一般',
value: 3,
resultField: 'data',
labelField: 'label',
valueField: 'value',
placeholder: '请选择告警优先级',
showSearch: true,
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
},
],
// autoSelectFirst: true,
},
},
{
field: 'alarmLogState',
label: '状态',
component: 'NsSelect',
component: 'nsSelectApi',
// dynamicParams: {
// id: 'deviceName', //帮定上级联动数据
// },
componentProps: {
placeholder: '请选择状态',
api: () => getEnum({ params: { enumType: 'AlarmLogStateEnum' } }),
immediate: true,
allowClear: true,
options: [
{
label: '待处理',
value: 1,
},
{
label: '处理中',
value: 2,
},
{
label: '已完成',
value: 3,
},
{
label: '超时',
value: 4,
},
{
label: '关闭',
value: 5,
resultField: 'data',
labelField: 'label',
valueField: 'value',
placeholder: '请选择状态',
showSearch: true,
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
},
],
// autoSelectFirst: true,
},
},
{
@ -181,6 +176,7 @@ export const notificationtableConfig = (look: any, status: any) => {
},
],
},
params: { orgId: orgId.value },
// pagination: { pageSizeOptions: false },
rowKey: 'id',
};

27
hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/status.vue

@ -56,6 +56,7 @@
import { NsMessage } from '/nerv-lib/component';
import { http } from '/nerv-lib/util';
import { equipmentAlarmApi } from '/@/api/alarmManagement/equipmentAlarm';
import { getEnum } from '/@/api';
export default defineComponent({
components: { NsSteps },
@ -67,6 +68,7 @@
const equipmentAlarm = ref({});
const stateOptions = ref();
const logList = ref([]);
const formRef = ref();
const config = ref({
size: logList.value.length,
dataSource: logList.value,
@ -94,8 +96,11 @@
equipmentAlarm.value = {};
infoObject.value = {};
visible.value = false;
config.value.dataSource = [];
logList.value = [];
};
const btnClick = () => {
formRef.value.validate().then(() => {
delete infoObject.value.createTime;
infoObject.value.alarmEquipmentLogId = equipmentAlarm.value.id;
if (equipmentAlarm.value.createWorkOrder === 0) {
@ -110,6 +115,7 @@
}
});
}
});
};
//
const changeShowEdit = () => {
@ -121,23 +127,11 @@
const toggle = async (data) => {
equipmentAlarm.value = { ...data };
visible.value = true;
if (equipmentAlarm.value.createWorkOrder === 1) {
stateOptions.value = [
{ value: 1, label: '待处理' },
{ value: 2, label: '处理中' },
{ value: 3, label: '已完成' },
{ value: 4, label: '超时' },
{ value: 5, label: '已关闭' },
];
} else {
stateOptions.value = [
{ value: 1, label: '待处理' },
{ value: 2, label: '处理中' },
{ value: 3, label: '已完成' },
{ value: 5, label: '已关闭' },
];
let states = await getEnum({ params: { enumType: 'AlarmLogStateEnum' } });
stateOptions.value = states.data;
if (equipmentAlarm.value.createWorkOrder !== 1) {
stateOptions.value = stateOptions.value.filter((item) => item.value !== 4);
}
console.log(data, 'data');
await http
.post(equipmentAlarmApi.getSelectAlarmEquipmentLogStatusProcess, {
alarmEquipmentLogId: data.id,
@ -166,6 +160,7 @@
return {
infoObject,
rules,
formRef,
changeShowEdit,
showEdit,
equipmentAlarm,

79
hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/ts/config.ts

@ -1,4 +1,10 @@
import { equipmentAlarmApi } from '/@/api/alarmManagement/equipmentAlarm';
import { ref } from 'vue';
import { getEnum } from '/@/api';
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
const tableKeyMap = [
{
@ -20,18 +26,23 @@ const tableKeyMap = [
{
title: '优先级',
dataIndex: 'priority',
width: 80,
},
{
title: '状态',
dataIndex: 'alarmLogState',
width: 100,
},
{
title: '错误码',
dataIndex: 'errorCode',
width: 100,
},
{
title: '设备信息',
dataIndex: 'deviceInfo',
width: 400,
// textEllipsis: true,
},
{
title: '更新时间',
@ -40,6 +51,7 @@ const tableKeyMap = [
{
title: '重复次数',
dataIndex: 'alarmRepetitions',
width: 80,
},
];
export const notificationtableConfig = (look: any, status: any) => {
@ -77,55 +89,45 @@ export const notificationtableConfig = (look: any, status: any) => {
{
field: 'priority',
label: '优先级',
component: 'NsSelect',
component: 'nsSelectApi',
// dynamicParams: {
// id: 'deviceName', //帮定上级联动数据
// },
componentProps: {
placeholder: '请选择告警优先级',
api: () => getEnum({ params: { enumType: 'PriorityEnum' } }),
immediate: true,
allowClear: true,
options: [
{
label: '紧急',
value: 1,
},
{
label: '重要',
value: 2,
},
{
label: '一般',
value: 3,
resultField: 'data',
labelField: 'label',
valueField: 'value',
placeholder: '请选择告警优先级',
showSearch: true,
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
},
],
// autoSelectFirst: true,
},
},
{
field: 'alarmLogState',
label: '状态',
component: 'NsSelect',
component: 'nsSelectApi',
// dynamicParams: {
// id: 'deviceName', //帮定上级联动数据
// },
componentProps: {
placeholder: '请选择状态',
api: () => getEnum({ params: { enumType: 'AlarmLogStateEnum' } }),
immediate: true,
allowClear: true,
options: [
{
label: '待处理',
value: 1,
},
{
label: '处理中',
value: 2,
},
{
label: '已完成',
value: 3,
},
{
label: '超时',
value: 4,
},
{
label: '关闭',
value: 5,
resultField: 'data',
labelField: 'label',
valueField: 'value',
placeholder: '请选择状态',
showSearch: true,
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
},
],
// autoSelectFirst: true,
},
},
{
@ -155,6 +157,7 @@ export const notificationtableConfig = (look: any, status: any) => {
},
],
},
params: { orgId: orgId.value },
// pagination: { pageSizeOptions: false },
rowKey: 'id',
};

23
hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/status.vue

@ -47,6 +47,7 @@
import { defineComponent } from 'vue';
import { ref } from 'vue';
import NsSteps from '/@/components/ns-steps.vue';
import { getEnum } from '/@/api';
export default defineComponent({
components: { NsSteps },
@ -54,19 +55,13 @@
setup() {
const visible = ref(false);
const infoObject = ref({});
const stateOptions = ref([
{ value: 1, label: '待处理' },
{ value: 2, label: '处理中' },
{ value: 3, label: '已完成' },
{ value: 4, label: '超时' },
{ value: 5, label: '已关闭' },
]);
const stateOptions = ref();
const logList = ref([
{ createName: '李四', state: 3, time: '2024-03-10 10:00:00', desc: '完成' },
{ createName: '王五', state: 5, time: '2024-03-10 10:00:00' },
{ createName: '王五', state: 4, time: '2024-03-10 10:00:00' },
{ createName: '王五', state: 2, time: '2024-03-10 10:00:00', desc: '创建工单' },
{ createName: '赵六', state: 1, time: '2024-03-10 10:00:00' },
{ realName: '李四', state: 3, createTime: '2024-03-10 10:00:00', remarks: '完成' },
{ realName: '王五', state: 5, createTime: '2024-03-10 10:00:00' },
{ realName: '王五', state: 4, createTime: '2024-03-10 10:00:00' },
{ realName: '王五', state: 2, createTime: '2024-03-10 10:00:00', remarks: '创建工单' },
{ realName: '赵六', state: 1, createTime: '2024-03-10 10:00:00' },
]);
const config = ref({
size: logList.value.length,
@ -78,7 +73,9 @@
const btnClick = () => {
visible.value = false;
};
const toggle = (data) => {
const toggle = async (data) => {
let states = await getEnum({ params: { enumType: 'AlarmLogStateEnum' } });
stateOptions.value = states.data;
infoObject.value = { ...logList.value[0] };
let stateMap = {
1: '待处理',

44
hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/ts/config.ts

@ -1,4 +1,10 @@
import { gatewayAlarmApi } from '/@/api/alarmManagement/gatewayAlarm';
import { ref } from 'vue';
import { getEnum } from '/@/api';
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
const tableKeyMap = [
{
title: '序号',
@ -99,32 +105,23 @@ export const notificationtableConfig = (look: any, status: any) => {
{
field: 'alarmLogState',
label: '状态',
component: 'NsSelect',
component: 'nsSelectApi',
// dynamicParams: {
// id: 'deviceName', //帮定上级联动数据
// },
componentProps: {
placeholder: '请选择状态',
api: () => getEnum({ params: { enumType: 'AlarmLogStateEnum' } }),
immediate: true,
allowClear: true,
options: [
{
label: '待处理',
value: 1,
},
{
label: '处理中',
value: 2,
},
{
label: '已完成',
value: 3,
},
{
label: '超时',
value: 4,
},
{
label: '关闭',
value: 5,
resultField: 'data',
labelField: 'label',
valueField: 'value',
placeholder: '请选择状态',
showSearch: true,
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
},
],
// autoSelectFirst: true,
},
},
{
@ -139,6 +136,7 @@ export const notificationtableConfig = (look: any, status: any) => {
},
],
},
params: { orgId: orgId.value },
// pagination: { pageSizeOptions: false },
rowKey: 'id',
};

2
hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/config.ts

@ -196,7 +196,7 @@ export const formConfig = (disabled) => {
componentProps: {
placeholder: '请输入参考文献',
maxLength: 300,
showCount:true
showCount: true,
},
},
],

335
hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue

@ -4,16 +4,15 @@
<div class="main">
<div class="left">
<div class="top">
<a-form style="width: 100%;margin: 0 auto;">
<a-form style="width: 100%; margin: 0 auto">
<div class="ns-form-title"><div class="title">排放分类</div></div>
<div style="padding: 0 16px !important;width: 100%;">
<div style="padding: 0 16px !important; width: 100%">
<a-row>
<a-col :span="24" style="margin-bottom: 16px;">
<a-col :span="24" style="margin-bottom: 16px">
<a-input-search
v-model:value="selectTreeDataValue"
placeholder="请输入关键词"
@search="onSearchTreeData"
/>
@search="onSearchTreeData" />
</a-col>
</a-row>
</div>
@ -21,7 +20,7 @@
<a-tree
v-if="gData && gData.length > 0"
class="draggable-tree"
style="padding: 0 16px !important;"
style="padding: 0 16px !important"
draggable
show-line
checkable
@ -39,10 +38,21 @@
<template #title="data">
<div class="treeRow">
<div>
<span v-if="data.emissionName && selectTreeDataValue && data.emissionName.indexOf(selectTreeDataValue) > -1">
{{ data.emissionName.substring(0, data.emissionName.indexOf(selectTreeDataValue)) }}
<span
v-if="
data.emissionName &&
selectTreeDataValue &&
data.emissionName.indexOf(selectTreeDataValue) > -1
">
{{
data.emissionName.substring(0, data.emissionName.indexOf(selectTreeDataValue))
}}
<span style="color: #f50">{{ selectTreeDataValue }}</span>
{{ data.emissionName.substring(data.emissionName.indexOf(selectTreeDataValue) + selectTreeDataValue.length) }}
{{
data.emissionName.substring(
data.emissionName.indexOf(selectTreeDataValue) + selectTreeDataValue.length,
)
}}
</span>
<span v-else>{{ data.emissionName }}</span>
</div>
@ -62,7 +72,7 @@
</template>
</a-tree>
<div class="addTreeNode">
<a-button type="primary" style="width:100%;" @click="addTreeNodeData">新增</a-button>
<a-button type="primary" style="width: 100%" @click="addTreeNodeData">新增</a-button>
</div>
</div>
</div>
@ -77,10 +87,7 @@
</div>
<!-- 新增树节点 -->
<ns-modal :visible="treeNodeAdd" :title="operationTree" @ok="handleOk" @cancel="handleCancel">
<ns-input
v-model:value="addTreeNode"
class="input"
placeholder="请输入排放类型"/>
<ns-input v-model:value="addTreeNode" class="input" placeholder="请输入排放类型" />
</ns-modal>
<!-- 新增数据库数据 -->
<a-drawer
@ -117,15 +124,21 @@
<a-button type="primary" @click="addUnit">新增单位</a-button>
</div>
<div class="treePart">
<div style="width: 100%;height: 7%;display: flex;justify-content: center;align-items: center;">
<div
style="
width: 100%;
height: 7%;
display: flex;
justify-content: center;
align-items: center;
">
<a-select
ref="select"
:value="unitTreeParams.id"
allowClear
style="width: 96%"
placeholder="选择分组"
@change="handleChange"
>
@change="handleChange">
<a-select-option v-for="(item, index) in groupData" :key="index" :value="item.id">
{{ item.cnValue }}
</a-select-option>
@ -146,8 +159,11 @@
<div class="actionMore">
<EditOutlined v-if="!data.parentId" @click="editGroup(data)" />
<EditOutlined v-else @click="editUnit(data)" />
<MinusCircleOutlined style="margin-left: 6px;" @click="delUnit(data)" />
<PlusCircleOutlined v-if="!data.parentId" style="margin-left: 6px;" @click="addUnit(data)" />
<MinusCircleOutlined style="margin-left: 6px" @click="delUnit(data)" />
<PlusCircleOutlined
v-if="!data.parentId"
style="margin-left: 6px"
@click="addUnit(data)" />
</div>
</div>
</template>
@ -158,31 +174,32 @@
</template>
</a-drawer>
<!-- 新增分组管理 -->
<ns-modal :visible="addGroupManage" :title="addGroupTitle" @ok="unitOrGroupOk" @cancel="groupCancel">
<a-form
ref="unitFormRef"
:model="formState"
:label-col="labelCol"
:wrapper-col="wrapperCol"
>
<ns-modal
:visible="addGroupManage"
:title="addGroupTitle"
@ok="unitOrGroupOk"
@cancel="groupCancel">
<a-form ref="unitFormRef" :model="formState" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-form-item label="分组名称" name="cnValue" :required="true">
<a-input v-model:value="formState.cnValue" placeholder="请输入分组名称" />
</a-form-item>
</a-form>
</ns-modal>
<!-- 新增单位 -->
<ns-modal :visible="addUnitManage" :title="addUnitTitle" @ok="unitOrGroupOk" @cancel="unitCancel">
<a-form
ref="unitFormRef"
:model="formState"
:label-col="labelCol"
:wrapper-col="wrapperCol"
>
<ns-modal
:visible="addUnitManage"
:title="addUnitTitle"
@ok="unitOrGroupOk"
@cancel="unitCancel">
<a-form ref="unitFormRef" :model="formState" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-form-item label="单位名称" name="cnValue" :required="true">
<a-input v-model:value="formState.cnValue" placeholder="请输入单位名称" />
</a-form-item>
<a-form-item label="选择分组" name="parentId" :required="true">
<a-select v-model:value="formState.parentId" placeholder="请选择所属分组" :disabled="canSelect">
<a-select
v-model:value="formState.parentId"
placeholder="请选择所属分组"
:disabled="canSelect">
<a-select-option v-for="(item, index) in groupData" :key="index" :value="item.id">
{{ item.cnValue }}
</a-select-option>
@ -193,12 +210,17 @@
</div>
</template>
<script lang="ts" setup>
import { MoreOutlined,ExclamationCircleOutlined,EditOutlined,PlusCircleOutlined,MinusCircleOutlined } from '@ant-design/icons-vue';
import {
ExclamationCircleOutlined,
EditOutlined,
PlusCircleOutlined,
MinusCircleOutlined,
} from '@ant-design/icons-vue';
import { Modal } from 'ant-design-vue';
import { computed, createVNode, defineComponent, reactive, ref, watchEffect,watch,toRaw } from 'vue';
import { computed, createVNode, reactive, ref, watchEffect, watch, toRaw } from 'vue';
import { http } from '/nerv-lib/util/http';
import { NsMessage, NsModal } from '/nerv-lib/component';
import { formConfig, formConfig2 } from './config';
import { NsMessage } from '/nerv-lib/component';
import { formConfig } from './config';
import { carbonEmissionFactorLibrary } from '/@/api/carbonEmissionFactorLibrary';
import type {
AntTreeNodeDragEnterEvent,
@ -208,10 +230,21 @@
import { log } from 'node:console';
defineOptions({ name: 'OrderListIndex' });
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
const dynamicDisabled = computed(() => {
return formRef.value?.validateResult && userAuthList.value?.length;
});
const fetch = (api, params = { orgId }) => {
return http.post(api, params);
};
const selectTreeDataValue = ref<string>('');
const mainRef = ref();
const data = reactive({});
let formData = ref({});
let formData = ref({
orgId: orgId.value,
});
const formRef = ref();
const visible = ref(false);
const unitManagement = ref(false);
@ -220,7 +253,7 @@
const disabled = ref(false);
const treeNodeAdd = ref<boolean>(false);
const operationTree = ref<string>('新增');
const showOperation = ref(false)
const showOperation = ref(false);
const opMap: any = ref({
type: 'add',
@ -234,15 +267,6 @@
const casData = ref([]);
const treeData = ref([]);
const userAuthList = ref([]);
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
const dynamicDisabled = computed(() => {
return formRef.value?.validateResult && userAuthList.value?.length;
});
const fetch = (api, params = { orgId }) => {
return http.post(api, params);
};
//
const x = 3;
@ -358,7 +382,7 @@
for (let i = 0; i < tree.length; i++) {
const node = tree[i];
if (node.children) {
if (node.children.some(item => item.key === key)) {
if (node.children.some((item) => item.key === key)) {
parentKey = node.key;
} else if (getParentKey(key, node.children)) {
parentKey = getParentKey(key, node.children);
@ -374,7 +398,7 @@
expandedKeys.value = keys;
autoExpandParent.value = false;
};
watch(selectTreeDataValue, value => {
watch(selectTreeDataValue, (value) => {
const expanded = dataList
.map((item: TreeProps['treeData'][number]) => {
if (item.title.indexOf(value) > -1) {
@ -393,31 +417,31 @@
console.log('or use this.value', value.value);
};
//
const checkedIds = ref([])
const emissionType = ref()
const checkedIds = ref([]);
const emissionType = ref();
const checkTreeNode = (checkedKeys, info) => {
checkedTreeNodeKeys.value = checkedKeys
checkedIds.value = []
info.checkedNodes.forEach(item=>{
checkedIds.value.push(item.id)
})
checkedTreeNodeKeys.value = checkedKeys;
checkedIds.value = [];
info.checkedNodes.forEach((item) => {
checkedIds.value.push(item.id);
});
sessionStorage.setItem('checkedTreeNode', checkedIds.value);
emissionType.value = checkedIds.value.join(',')
emissionType.value = checkedIds.value.join(',');
mainRef.value?.nsTableRef.reload();
}
};
//
const addTreeNodeData = () => {
operationTree.value='新增'
operationTree.value = '新增';
treeNodeAdd.value = true;
editTreeNode.value.type = 'create'
editTreeNode.value.type = 'create';
};
//
const editTreeNodeData = (data) => {
operationTree.value='编辑'
operationTree.value = '编辑';
treeNodeAdd.value = true;
editTreeNode.value.type = 'update'
addTreeNode.value = data.emissionName
}
editTreeNode.value.type = 'update';
addTreeNode.value = data.emissionName;
};
//
const deleteTreeNode = () => {
Modal.confirm({
@ -429,7 +453,7 @@
cancelText: '取消',
onOk() {
http.post(carbonEmissionFactorLibrary.delTreeNode, editTreeNode.value).then(() => {
getOrgTree()
getOrgTree();
NsMessage.success('操作成功');
});
},
@ -437,26 +461,26 @@
console.log('Cancel');
},
});
}
};
// /
const addTreeNode =ref()
const addTreeNode = ref();
const handleOk = (e: MouseEvent) => {
editTreeNode.value.emissionName = addTreeNode.value
editTreeNode.value.emissionName = addTreeNode.value;
http.post(carbonEmissionFactorLibrary.creat, editTreeNode.value).then(() => {
getOrgTree()
getOrgTree();
NsMessage.success('操作成功');
addTreeNode.value = ''
addTreeNode.value = '';
treeNodeAdd.value = false;
});
};
const handleCancel = () => {
addTreeNode.value = ''
addTreeNode.value = '';
treeNodeAdd.value = false;
};
//
const getOrgTree = (params?) => {
fetch(carbonEmissionFactorLibrary.getCarbonFactorTree, params).then((res) => {
gData.value = res.data
const getOrgTree = () => {
fetch(carbonEmissionFactorLibrary.getCarbonFactorTree, { orgId: orgId.value }).then((res) => {
gData.value = res.data;
//
// const selectedNodes = [];
// checkedTreeNodeKeys.value.forEach(key => {
@ -469,31 +493,31 @@
// getDefaultIds(selectedNodes)
});
};
const defaultIds = ref([])
const defaultIds = ref([]);
const getDefaultIds = (selectedNodes) => {
selectedNodes.forEach(items => {
defaultIds.value.push(items.id)
selectedNodes.forEach((items) => {
defaultIds.value.push(items.id);
if (items.children) {
getDefaultIds(items.children)
getDefaultIds(items.children);
}
})
emissionType.value = defaultIds.value.join(',')
checkedIds.value = defaultIds.value
});
emissionType.value = defaultIds.value.join(',');
checkedIds.value = defaultIds.value;
sessionStorage.setItem('checkedTreeNode', checkedIds.value);
}
};
getOrgTree();
//
const editTreeNode = ref({})
const editTreeNode = ref({});
const onSelect = (selectedKeys: string[], info: any) => {
if (info.selected) {
showOperation.value = true
showOperation.value = true;
editTreeNode.value = {
id: info.selectedNodes[0].id,
level: info.selectedNodes[0].level,
dataNumber: info.selectedNodes[0].dataNumber,
sortNumber: info.selectedNodes[0].sortNumber,
parentEmissionId: info.selectedNodes[0].parentEmissionId,
}
};
}
};
@ -516,13 +540,14 @@
};
const handleSelect = (selectedKeys: any, info: any) => {
fetch(carbonEmissionFactorLibrary.queryDeptTree, { orgId: info.node?.orgInfo.orgId }).then((res) => {
fetch(carbonEmissionFactorLibrary.queryDeptTree, { orgId: info.node?.orgInfo.orgId }).then(
(res) => {
treeData2.value = res.data;
});
},
);
tableFetch({ orgId: info.node?.orgInfo.orgId });
};
const onClose = () => {
visible.value = false;
formData.value = {};
@ -530,8 +555,8 @@
};
const closeUnitManag = () => {
unitTreeParams.value = {
grp: 'MEASUREMENT_UNIT'
}
grp: 'MEASUREMENT_UNIT',
};
unitManagement.value = false;
};
const onEdit = () => {
@ -542,8 +567,7 @@
// return;
// }
opMap.value.fuc &&
opMap.value.fuc({ ...formData.value });
opMap.value.fuc && opMap.value.fuc({ ...formData.value });
});
};
const tableConfig = ref({
@ -551,7 +575,7 @@
api: carbonEmissionFactorLibrary.getTableList,
params: {
orgId,
emissionType
emissionType,
},
headerActions: [
{
@ -563,12 +587,12 @@
setTimeout(() => {
formData.value = {
carbonEmissionPrefix: 't',
numberOfReferences:'10'
numberOfReferences: '10',
};
userAuthList.value.splice(0);
});
opMap.value.fuc = (formData: any) => {
formData.emissionType = formData.emissionType[formData.emissionType.length - 1]
formData.emissionType = formData.emissionType[formData.emissionType.length - 1];
return http.post(carbonEmissionFactorLibrary.creatOrUpdate, formData).then(() => {
mainRef.value?.nsTableRef.reload();
visible.value = false;
@ -607,11 +631,13 @@
type: 'primary',
name: 'userAdd',
handle: () => {
unitManagement.value = true,
fetch(carbonEmissionFactorLibrary.findOutermost,{grp:'MEASUREMENT_UNIT'}).then((res) => {
groupData.value = res.data
});
getUnitTree()
(unitManagement.value = true),
fetch(carbonEmissionFactorLibrary.findOutermost, { grp: 'MEASUREMENT_UNIT' }).then(
(res) => {
groupData.value = res.data;
},
);
getUnitTree();
},
},
],
@ -672,14 +698,14 @@
handle: (record: any) => {
userAuthList.value.splice(0);
setTimeout(() => {
const measurementUnit = ref([])
const measurementUnit = ref([]);
http.post(carbonEmissionFactorLibrary.getCarbonFactorTree, {}).then((res) => {
measurementUnit.value = res.data
measurementUnit.value = res.data;
http.post(carbonEmissionFactorLibrary.findById, { id: record.id }).then((res) => {
if (res.data.emissionType) {
let selectDevice = ref([Number(res.data.emissionType)]);
findParentIds(measurementUnit.value, res.data.emissionType, selectDevice.value);
res.data.emissionType = selectDevice
res.data.emissionType = selectDevice;
}
formData.value = res.data;
});
@ -687,9 +713,9 @@
}, 10);
opMap.value.type = 'edit';
opMap.value.fuc = (formData: any) => {
formData.emissionType = formData.emissionType[formData.emissionType.length - 1]
formData.emissionType = formData.emissionType[formData.emissionType.length - 1];
if (formData.emissionGas.value) {
formData.emissionGas = formData.emissionGas.value
formData.emissionGas = formData.emissionGas.value;
}
return http.post(carbonEmissionFactorLibrary.creatOrUpdate, formData).then(() => {
mainRef.value?.nsTableRef.reload();
@ -834,19 +860,21 @@
const unitExpandedKeys = ref<string[]>();
const unitSelectedKeys = ref<string[]>([]);
const unitTreeParams = ref({
grp: 'MEASUREMENT_UNIT'
})
const groupData = ref([])
grp: 'MEASUREMENT_UNIT',
});
const groupData = ref([]);
const unitTreeData = ref<TreeProps['treeData']>(genData);
const handleChange = (value: string) => {
unitTreeParams.value.id = value
getUnitTree()
unitTreeParams.value.id = value;
getUnitTree();
};
const getUnitTree = () => {
fetch(carbonEmissionFactorLibrary.dictionaryUnitManagement, unitTreeParams.value).then((res) => {
unitTreeData.value = res.data
});
}
fetch(carbonEmissionFactorLibrary.dictionaryUnitManagement, unitTreeParams.value).then(
(res) => {
unitTreeData.value = res.data;
},
);
};
//
const labelCol = { span: 5 };
const wrapperCol = { span: 19 };
@ -857,55 +885,55 @@
const formState = ref({
grp: 'MEASUREMENT_UNIT',
grpDesc: '计量单位',
})
});
const addGroupTitle = ref<string>('新增分组');
const addUnitTitle = ref<string>('新增单位');
const addGroup = () => {
addGroupTitle.value = '新增分组'
addGroupManage.value = true
addGroupTitle.value = '新增分组';
addGroupManage.value = true;
};
const editGroup = (data) => {
addGroupTitle.value = '编辑分组'
addGroupManage.value = true
formState.value.id = data.id
formState.value.cnValue = data.cnValue
addGroupTitle.value = '编辑分组';
addGroupManage.value = true;
formState.value.id = data.id;
formState.value.cnValue = data.cnValue;
};
const groupCancel = () => {
addGroupManage.value = false
addGroupManage.value = false;
unitFormRef.value.resetFields();
formState.value = {
grp: 'MEASUREMENT_UNIT',
grpDesc: '计量单位',
}
};
};
const addUnit = (data) => {
if (data.id) {
canSelect.value = true
formState.value.parentId = data.id
canSelect.value = true;
formState.value.parentId = data.id;
} else {
canSelect.value = false
canSelect.value = false;
}
fetch(carbonEmissionFactorLibrary.findOutermost).then((res) => {
groupData.value = res.data
groupData.value = res.data;
});
addUnitTitle.value = '新增单位'
addUnitManage.value = true
addUnitTitle.value = '新增单位';
addUnitManage.value = true;
};
const editUnit = (data) => {
addUnitTitle.value = '编辑单位'
addUnitManage.value = true
canSelect.value = true
formState.value.parentId = data.parentId
formState.value.id = data.id
formState.value.cnValue = data.cnValue
addUnitTitle.value = '编辑单位';
addUnitManage.value = true;
canSelect.value = true;
formState.value.parentId = data.parentId;
formState.value.id = data.id;
formState.value.cnValue = data.cnValue;
};
const unitCancel = () => {
addUnitManage.value = false
addUnitManage.value = false;
unitFormRef.value.resetFields();
formState.value = {
grp: 'MEASUREMENT_UNIT',
grpDesc: '计量单位',
}
};
};
const unitOrGroupOk = () => {
unitFormRef.value
@ -914,43 +942,43 @@
console.log('values', formState, toRaw(formState));
if (formState.value.id) {
fetch(carbonEmissionFactorLibrary.updateDictionary, formState.value).then((res) => {
unitTreeData.value = res.data
unitTreeData.value = res.data;
if (formState.value.parentId) {
addUnitManage.value = false
addUnitManage.value = false;
} else {
addGroupManage.value = false
addGroupManage.value = false;
}
unitFormRef.value.resetFields();
formState.value = {
grp: 'MEASUREMENT_UNIT',
grpDesc: '计量单位',
}
getUnitTree()
};
getUnitTree();
});
} else {
fetch(carbonEmissionFactorLibrary.createDictionary, formState.value).then((res) => {
unitTreeData.value = res.data
unitTreeData.value = res.data;
if (formState.value.parentId) {
addUnitManage.value = false
addUnitManage.value = false;
} else {
addGroupManage.value = false
addGroupManage.value = false;
}
unitFormRef.value.resetFields();
formState.value = {
grp: 'MEASUREMENT_UNIT',
grpDesc: '计量单位',
}
getUnitTree()
};
getUnitTree();
});
}
})
.catch(error => {
.catch((error) => {
console.log('error', error);
});
};
//
const delUnit = (data) => {
formState.value.id = data.id
formState.value.id = data.id;
Modal.confirm({
title: '警告',
content: '确定要删除吗?',
@ -960,7 +988,7 @@
onOk() {
fetch(carbonEmissionFactorLibrary.delDictionary, formState.value).then((res) => {
message.success('操作成功!');
getUnitTree()
getUnitTree();
});
},
onCancel() {
@ -968,7 +996,6 @@
},
});
};
</script>
<style lang="less" scoped>
.main {
@ -1034,7 +1061,7 @@
height: 13px;
width: 3px;
border-radius: 1px;
background-color: #2778FF;
background-color: #2778ff;
}
.treeRow {
display: flex;

28
hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/carbonEmissions/index.vue

@ -7,14 +7,18 @@
:pagination="false"
:scroll="{ x: 2000, y: 480 }">
<template #title>
<a-date-picker v-model:value="selectYear" picker="year" @change="changeYearData" valueFormat="YYYY" />
<a-date-picker
v-model:value="selectYear"
picker="year"
@change="changeYearData"
valueFormat="YYYY" />
</template>
</a-table>
<a-pagination
:current="queryParams.pageNum"
:total="total"
:page-size="queryParams.pageSize"
style="display: flex;justify-content: center;margin-top: 16px;"
style="display: flex; justify-content: center; margin-top: 16px"
:show-size-changer="true"
:show-quick-jumper="true"
@change="onChange" />
@ -40,19 +44,19 @@
};
const data = ref([]);
const selectYear = ref<Dayjs>(dayjs(new Date().getFullYear().toString()));
const total = ref<number>()
const total = ref<number>();
const queryParams = ref({
pageNum: 1,
pageSize: 10,
year: selectYear.value.format('YYYY'),
orgId: orgId.value
})
orgId: orgId.value,
});
//
const changeYearData = () => {
queryParams.value.year = selectYear.value
getTableList()
}
queryParams.value.year = selectYear.value;
getTableList();
};
//
const column: TableColumnsType[] = [
{
@ -164,16 +168,16 @@
//
const getTableList = () => {
fetch(carbonEmission.carbonEmissionStatistics, queryParams.value).then((res) => {
data.value = res.data
total.value = res.data.length
data.value = res.data;
total.value = res.data.length;
});
};
getTableList()
getTableList();
//
const onChange = (pageNumber: number, size: number) => {
queryParams.value.pageNum = pageNumber;
queryParams.value.pageSize = size;
getTableList()
getTableList();
};
</script>
<style scoped lang="less">

7
hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue

@ -165,19 +165,16 @@
</div>
</template>
<script lang="ts" setup>
import { ref,reactive, toRaw } from 'vue';
import type { UnwrapRef } from 'vue';
import { ref, toRaw } from 'vue';
import type { Rule } from 'ant-design-vue/es/form';
import { Pagination,message,Modal } from 'ant-design-vue';
import { InboxOutlined } from '@ant-design/icons-vue';
import type { CascaderProps,TreeSelectProps,UploadChangeParam } from 'ant-design-vue';
import type { TreeSelectProps,UploadChangeParam } from 'ant-design-vue';
import { NsMessage } from '/nerv-lib/component';
import dayjs, { Dayjs } from 'dayjs';
import { http } from '/nerv-lib/util/http';
import { tableColumns } from '../config';
import { energyConsumption,carbonEmissionFactorLibrary } from '/@/api/carbonEmissionFactorLibrary';
import { group } from '/@/api/deviceManage';
import { dict } from '/@/api';
defineOptions({
energyType: 'EnergyConsumption', // name
components: {

1
hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/index.vue

@ -31,4 +31,3 @@
// }
};
</script>

144
hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue

@ -2,16 +2,15 @@
<div class="main">
<div class="left">
<div class="top">
<a-form style="width: 100%;margin: 0 auto;">
<a-form style="width: 100%; margin: 0 auto">
<div class="ns-form-title"><div class="title">因子分类</div></div>
<div style="padding: 0 16px !important;width: 100%;">
<div style="padding: 0 16px !important; width: 100%">
<a-row>
<a-col :span="24" style="margin-bottom: 16px;">
<a-col :span="24" style="margin-bottom: 16px">
<a-input-search
v-model:value="searchValue"
placeholder="请输入关键词"
@search="onSearchTreeData"
/>
@search="onSearchTreeData" />
</a-col>
</a-row>
</div>
@ -25,13 +24,15 @@
show-line
@expand="onExpand"
@select="onSelect"
style="padding: 0 16px !important;"
>
style="padding: 0 16px !important">
<template #title="data">
<span v-if="data.energyType && searchValue && data.energyType.indexOf(searchValue) > -1">
<span
v-if="data.energyType && searchValue && data.energyType.indexOf(searchValue) > -1">
{{ data.energyType.substring(0, data.energyType.indexOf(searchValue)) }}
<span style="color: #f50">{{ searchValue }}</span>
{{ data.energyType.substring(data.energyType.indexOf(searchValue) + searchValue.length) }}
{{
data.energyType.substring(data.energyType.indexOf(searchValue) + searchValue.length)
}}
</span>
<span v-else>{{ data.energyType }}</span>
</template>
@ -65,7 +66,7 @@
:current="queryParams.pageNum"
:total="total"
:page-size="queryParams.pageSize"
style="display: flex;justify-content: center;margin-top: 16px;"
style="display: flex; justify-content: center; margin-top: 16px"
:show-size-changer="true"
:show-quick-jumper="true"
@change="onChange" />
@ -82,12 +83,14 @@
:model="formState"
:rules="rules"
:label-col="labelCol"
:wrapper-col="wrapperCol"
>
:wrapper-col="wrapperCol">
<a-row>
<a-col :span="12">
<a-form-item ref="name" label="日期范围" name="dateRange">
<a-range-picker v-model:value="formState.dateRange" picker="month" valueFormat="YYYY-MM" />
<a-range-picker
v-model:value="formState.dateRange"
picker="month"
valueFormat="YYYY-MM" />
</a-form-item>
</a-col>
<a-col :span="12">
@ -109,7 +112,11 @@
:data-source="newTableData"
bordered
rowKey="id"
:rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectionChange, type: 'radio' }"
:rowSelection="{
selectedRowKeys: selectedRowKeys,
onChange: onSelectionChange,
type: 'radio',
}"
:pagination="false">
</a-table>
<template #footer>
@ -127,7 +134,11 @@
import { Pagination, Modal } from 'ant-design-vue';
import { columns, drawerColumns } from '../config';
import { http } from '/nerv-lib/util/http';
import { quickCalculation,carbonEmissionFactorLibrary } from '/@/api/carbonEmissionFactorLibrary';
import {
quickCalculation,
carbonEmissionFactorLibrary,
} from '/@/api/carbonEmissionFactorLibrary';
import { or } from '@vueuse/core';
defineOptions({
energyType: 'quickCalculation', // name
components: {
@ -191,7 +202,7 @@
for (let i = 0; i < tree.length; i++) {
const node = tree[i];
if (node.children) {
if (node.children.some(item => item.key === key)) {
if (node.children.some((item) => item.key === key)) {
parentKey = node.key;
} else if (getParentKey(key, node.children)) {
parentKey = getParentKey(key, node.children);
@ -211,17 +222,17 @@
autoExpandParent.value = false;
};
//
const energyType = ref()
const energyType = ref();
const onSelect = (selectedKey: string[], info: any) => {
selectedKeys.value = selectedKey;
if (info.selected) {
energyType.value = info.node.id
statsId.value = info.node.id
energyType.value = info.node.id;
statsId.value = info.node.id;
mainRef.value?.nsTableRef.reload();
}
};
watch(searchValue, value => {
watch(searchValue, (value) => {
const expanded = dataList
.map((item: TreeProps['treeData'][number]) => {
if (item.title.indexOf(value) > -1) {
@ -235,26 +246,25 @@
autoExpandParent.value = true;
});
//
const onSearchTreeData = () => {
};
const statsId = ref()
const onSearchTreeData = () => {};
const statsId = ref();
//
const getTreeData = () => {
fetch(quickCalculation.carbonQuickTree).then((res) => {
gData.value = res.data
energyType.value = gData.value[0].children[0].id
statsId.value = gData.value[0].children[0].id
fetch(quickCalculation.carbonQuickTree, { orgId: orgId.value }).then((res) => {
gData.value = res.data;
energyType.value = gData.value[0].children[0].id;
statsId.value = gData.value[0].children[0].id;
mainRef.value?.nsTableRef.reload();
});
};
getTreeData()
getTreeData();
//
const total = ref<number>()
const total = ref<number>();
const queryParams = ref({
pageNum: 1,
pageSize: 10,
orgId: orgId.value
})
orgId: orgId.value,
});
const tableData = ref([]);
const tableConfig = ref({
@ -262,7 +272,7 @@
api: quickCalculation.queryCarbonEmissionPage,
params: {
orgId,
energyType
energyType,
},
headerActions: [
{
@ -270,8 +280,8 @@
name: 'userAdd',
type: 'primary',
handle: () => {
visible.value = true
getNewTable()
visible.value = true;
getNewTable();
},
},
],
@ -320,12 +330,12 @@
name: 'userEdit',
handle: (record: any) => {
selectedRowKeys.value = [record.factorId];
formState.value.id = record.id
formState.value.emissionFactors = record.emissionFactors
formState.value.id = record.id;
formState.value.emissionFactors = record.emissionFactors;
formState.value.dateRange = [record.startTime, record.endTime];
formState.value.factorId = record.factorId
visible.value = true
getNewTable()
formState.value.factorId = record.factorId;
visible.value = true;
getNewTable();
},
},
{
@ -343,8 +353,8 @@
//
const getTableList = () => {
fetch(quickCalculation.queryCarbonEmissionPage, queryParams.value).then((res) => {
tableData.value = res.data.records
total.value = res.data.total
tableData.value = res.data.records;
total.value = res.data.total;
});
};
//
@ -357,7 +367,9 @@
const formRef = ref();
const labelCol = { span: 6 };
const wrapperCol = { span: 18 };
const formState = ref({})
const formState = ref({
orgId: orgId.value,
});
const visible = ref(false);
// form
@ -367,65 +379,65 @@
};
//
const addNewData = () => {
visible.value = true
getNewTable()
visible.value = true;
getNewTable();
};
//
const selectedRowKeys = ref([]);
const onSelectionChange = (selectedKeys, selectedRows) => {
selectedRowKeys.value = selectedKeys;
formState.value.emissionFactors = selectedRows[0].emissionFactors
formState.value.factorId = selectedRows[0].id
formState.value.emissionFactors = selectedRows[0].emissionFactors;
formState.value.factorId = selectedRows[0].id;
};
const queryData = ref({
orgId: orgId.value,
pageNum: 1,
pageSize: 999
})
const newTableData = ref([])
pageSize: 999,
});
const newTableData = ref([]);
const getNewTable = () => {
fetch(carbonEmissionFactorLibrary.getTableList, queryData.value).then((res) => {
newTableData.value = res.data.records
newTableData.value = res.data.records;
});
};
//
const editData = (record) => {
selectedRowKeys.value = [record.factorId];
formState.value.id = record.id
formState.value.emissionFactors = record.emissionFactors
formState.value.id = record.id;
formState.value.emissionFactors = record.emissionFactors;
formState.value.dateRange = [record.startTime, record.endTime];
formState.value.factorId = record.factorId
visible.value = true
getNewTable()
formState.value.factorId = record.factorId;
visible.value = true;
getNewTable();
};
//
const onSubmit = () => {
formRef.value
.validate()
.then(() => {
formState.value.statsId = statsId.value
formState.value.startTime = formState.value.dateRange[0]
formState.value.endTime = formState.value.dateRange[1]
formState.value.statsId = statsId.value;
formState.value.startTime = formState.value.dateRange[0];
formState.value.endTime = formState.value.dateRange[1];
console.log('values', formState, toRaw(formState));
if (formState.value.id) {
fetch(quickCalculation.update, formState.value).then((res) => {
visible.value = false
visible.value = false;
selectedRowKeys.value = [];
formState.value = {}
formState.value = {};
formRef.value.resetFields();
mainRef.value?.nsTableRef.reload();
});
} else {
fetch(quickCalculation.creat, formState.value).then((res) => {
visible.value = false
visible.value = false;
selectedRowKeys.value = [];
formState.value = {}
formState.value = {};
formRef.value.resetFields();
mainRef.value?.nsTableRef.reload();
});
}
})
.catch(error => {
.catch((error) => {
console.log('error', error);
});
};
@ -440,7 +452,7 @@
onOk() {
fetch(quickCalculation.del, { id: record.id }).then((res) => {
message.success('操作成功!');
getTableList()
getTableList();
});
},
onCancel() {
@ -452,7 +464,7 @@
const onClose = () => {
visible.value = false;
selectedRowKeys.value = [];
formState.value = {}
formState.value = {};
formRef.value.resetFields();
};
</script>
@ -525,7 +537,7 @@
height: 13px;
width: 3px;
border-radius: 1px;
background-color: #2778FF;
background-color: #2778ff;
}
:deep(.ant-table-title) {
display: flex;

709
hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue

File diff suppressed because it is too large

53
hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue

@ -20,8 +20,7 @@
:model="formState"
:rules="rules"
:label-col="labelCol"
:wrapper-col="wrapperCol"
>
:wrapper-col="wrapperCol">
<a-form-item ref="name" label="报告名称" name="reportName">
<a-input v-model:value="formState.reportName" placeholder="请输入报告名称" />
</a-form-item>
@ -38,7 +37,10 @@
</a-select>
</a-form-item>
<a-form-item ref="name" label="报告范围" name="reportScope">
<a-range-picker v-model:value="formState.reportScope" picker="month" valueFormat="YYYY-MM" />
<a-range-picker
v-model:value="formState.reportScope"
picker="month"
valueFormat="YYYY-MM" />
</a-form-item>
</a-form>
<template #footer>
@ -65,7 +67,7 @@
const fillInPage = ref(false);
//
const visible = ref(false);
const formState = ref({})
const formState = ref({});
const formRef = ref();
const labelCol = { span: 5 };
const wrapperCol = { span: 19 };
@ -80,7 +82,7 @@
//
const onClose = () => {
visible.value = false;
formState.value = {}
formState.value = {};
formRef.value.resetFields();
};
//
@ -89,15 +91,15 @@
.validate()
.then(() => {
console.log('values', formState, toRaw(formState));
formState.value.enterpriseOrgId = orgId.value
formState.value.startTime = formState.value.reportScope[0]
formState.value.endTime = formState.value.reportScope[1]
formState.value.enterpriseOrgId = orgId.value;
formState.value.startTime = formState.value.reportScope[0];
formState.value.endTime = formState.value.reportScope[1];
fetch(carbonInventoryCheck.createOrUpdate, formState.value).then((res) => {
visible.value = false
visible.value = false;
mainRef.value?.nsTableRef.reload();
});
})
.catch(error => {
.catch((error) => {
console.log('error', error);
});
};
@ -110,7 +112,7 @@
title: '数据库',
api: carbonInventoryCheck.carbonInventoryList,
params: {
orgId
orgId,
},
headerActions: [
{
@ -118,7 +120,7 @@
name: 'userAdd',
type: 'primary',
handle: () => {
visible.value = true
visible.value = true;
},
},
],
@ -161,10 +163,10 @@
label: '编辑',
name: 'userEdit',
handle: (record: any) => {
visible.value = true
visible.value = true;
fetch(carbonInventoryCheck.findById, { id: record.id }).then((res) => {
formState.value = res.data
formState.value.reportScope = [res.data.startTime,res.data.endTime]
formState.value = res.data;
formState.value.reportScope = [res.data.startTime, res.data.endTime];
});
},
},
@ -172,17 +174,16 @@
label: '填报',
name: 'fillIn',
handle: (record: any) => {
isMainPage.value = false
fillInPage.value = true
reportId.value = record.id
year.value = record.reportYear
isMainPage.value = false;
fillInPage.value = true;
reportId.value = record.id;
year.value = record.reportYear;
},
},
{
label: '下载',
name: 'download',
handle: (record: any) => {
},
handle: (record: any) => {},
},
{
label: '删除',
@ -213,7 +214,7 @@
componentProps: {
valueFormat: 'YYYY',
placeholder: ['报告年度', '报告年度'],
picker:"year"
picker: 'year',
},
},
],
@ -223,11 +224,9 @@
});
//
const updateData = (newDataOne, newDataTwo) => {
isMainPage.value = newDataOne
fillInPage.value = newDataTwo
isMainPage.value = newDataOne;
fillInPage.value = newDataTwo;
};
</script>
<style lang="less" scoped>
</style>
<style lang="less" scoped></style>

24
hx-ai-intelligent/src/view/equipmentControl/liftSystem/index.vue

@ -1,46 +1,41 @@
<template>
<div class="map-box">
<div class="map">
<liftInfo></liftInfo>
<liftInfo />
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import liftInfo from './liftInfo.vue'
import liftInfo from './liftInfo.vue';
//
import { message } from 'ant-design-vue';
// ===========================================================
onMounted(() => {
})
onMounted(() => {});
// tab ========================================================
//
const dataSource = ref([]);
</script>
<style lang="less" scoped>
.map-box {
//
// - - -
--on: #0DFFA4;
--on: #0dffa4;
//
--off: #BFCDE2;
--off: #bfcde2;
// -
--pause: #FFBC46;
--pause: #ffbc46;
// -
--stop: #F36163;
--stop: #f36163;
//
--fault: #FF7636;
--fault: #ff7636;
//
--unknown: #A742FF;
--unknown: #a742ff;
width: 100%;
height: 100%;
.map {
@ -49,5 +44,4 @@ const dataSource = ref([]);
background-image: url(../image/bg.jpg);
}
}
</style>

13
hx-ai-intelligent/src/view/equipmentControl/liftSystem/liftInfo.vue

@ -10,7 +10,7 @@
<div class="item-box">
<div class="icon">
<div class="icon-item">
<img src="../image/liftState/lift-normal.svg" alt="">
<img src="../image/liftState/lift-normal.svg" alt="" />
</div>
</div>
</div>
@ -21,7 +21,7 @@
<div class="item-box">
<div class="icon">
<div class="icon-item">
<img src="../image/liftState/lift-normal.svg" alt="">
<img src="../image/liftState/lift-normal.svg" alt="" />
</div>
</div>
</div>
@ -32,7 +32,7 @@
<div class="item-box">
<div class="icon">
<div class="icon-item">
<img src="../image/liftState/lift-normal.svg" alt="">
<img src="../image/liftState/lift-normal.svg" alt="" />
</div>
</div>
</div>
@ -49,9 +49,7 @@ import { ref, onMounted } from 'vue';
// ===========================================================
onMounted(() => {
})
onMounted(() => {});
// tab ========================================================
@ -59,8 +57,6 @@ onMounted(() => {
const runState = ref('1');
//
const liftState = ref('2');
</script>
<style lang="less" scoped>
//
@ -147,5 +143,4 @@ const liftState = ref('2');
}
}
}
</style>

177
hx-ai-intelligent/src/view/equipmentControl/lightingManage/indexs.vue

@ -3,7 +3,9 @@
<div class="lighting-img-box">
<!-- 左上角区域切换 -->
<div class="btn-box">
<button v-for="item in floorData" class="btn-item" @click=changeFloor(item.childList)>{{ item.name }}</button>
<button v-for="item in floorData" class="btn-item" @click="changeFloor(item.childList)">{{
item.name
}}</button>
</div>
<!-- 楼层区域 -->
<div class="area">
@ -21,12 +23,12 @@
</div>
<!-- 照明设备 -->
<div class="lights">
<light v-for="(item, index) in bulbs"
<light
v-for="(item, index) in bulbs"
:key="index"
:styleObject="item.styleText"
:type="item.type"
:visible="item.visible">
</light>
:visible="item.visible" />
</div>
</div>
<!-- 右侧抽屉的触发按钮 -->
@ -35,13 +37,14 @@
</div>
<!-- 左侧抽屉的关闭按钮 -->
<div class="drawer-box-out" v-if="visible" @click="toggleDrawer">
<double-right-outlined class="drawer-icon" style="color: white;" />
<double-right-outlined class="drawer-icon" style="color: white" />
</div>
<!-- 右侧抽屉 -->
<a-drawer
v-model:visible="visible"
class="drawer-item"
width="496"
:forceRender="preload"
placement="right"
:body-style="{ background: 'rgba(0, 0, 0)', opacity: 0.8 }"
:closable="false"
@ -49,19 +52,13 @@
:maskStyle="{ 'background-color': 'rgba(0, 0, 0, 0)' }">
<a-tabs v-model:activeKey="activeKey">
<a-tab-pane key="1" tab="控制面板">
<tabs1
ref="tabs1Ref"
@changeArea="changeArea"
@reset="reset"
:treeData="treeData"
:nowArea="nowArea"
></tabs1>
<tabs1 ref="tabs1Ref" @changeArea="changeArea" @reset="reset" :treeData="treeData" />
</a-tab-pane>
<a-tab-pane key="2" tab="计划列表" force-render>
<tabs2></tabs2>
<tabs2 />
</a-tab-pane>
<a-tab-pane key="3" tab="日志">
<tabs3></tabs3>
<tabs3 />
</a-tab-pane>
</a-tabs>
</a-drawer>
@ -69,161 +66,163 @@
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
//
import light from './light.vue';
import tabs1 from './tabs1.vue'
import tabs2 from './tabs2.vue'
import tabs3 from './tabs3.vue'
import tabs1 from './tabs1.vue';
import tabs2 from './tabs2.vue';
import tabs3 from './tabs3.vue';
//
import { http } from '/nerv-lib/util/http';
import { lightingManage } from '/@/api/IlluminationInfo';
// ICON
import {
DoubleLeftOutlined,
DoubleRightOutlined
} from '@ant-design/icons-vue';
import { DoubleLeftOutlined, DoubleRightOutlined } from '@ant-design/icons-vue';
// =======================================================
onMounted(() => {
// 线
getAllArea()
})
getAllArea();
});
// flagref
const preload = ref(false);
// =====================================================
//
const floorData = ref([])
const floorData = ref([]);
//
const changeFloor = (area: any) => {
//
reset()
reset();
//
changeArea(['1'])
changeArea(['1']);
//
treeData.value = area
treeData.value = area;
//
treeData.value[0].selected = true
}
treeData.value[0].selected = true;
};
// =====================================================
//
const treeData = ref([])
// id
const nowArea = ref('1')
// -
const area = ref(['1'])
const treeData = ref([]);
// -
const area = ref(['1']);
// 线 -
const bulbs = ref([
{
styleText: { left: '180px', bottom: '200px' },
area: 1,
type: 1,
visible: true
visible: true,
},
{
styleText: { left: '230px', bottom: '125px' },
area: 1,
type: 2,
visible: true
visible: true,
},
{
styleText: { left: '320px', bottom: '140px' },
area: 1,
type: 3,
visible: true
visible: true,
},
{
styleText: { left: '245px', bottom: '230px' },
area: 1,
type: 3,
visible: true
visible: true,
},
{
styleText: { left: '405px', bottom: '230px' },
area: 2,
type: 3,
visible: true
visible: true,
},
{
styleText: { left: '460px', bottom: '180px' },
area: 2,
type: 3,
visible: true
visible: true,
},
{
styleText: { left: '360px', bottom: '275px' },
area: 2,
type: 3,
visible: true
visible: true,
},
{
styleText: { left: '715px', bottom: '320px' },
area: 3,
type: 1,
visible: true
visible: true,
},
])
]);
// 线
const changeArea = (result: any) => {
console.log(result,'changeArea')
console.log(result, 'changeArea');
//
if (Array.isArray(result)) {
area.value = result
area.value = result;
//
} else {
area.value.length = 0
area.value[0] = String(result)
}
area.value.length = 0;
area.value[0] = String(result);
}
};
//
const changeThisArea = (result: any) => {
tabs1Ref.value.changeCancel()
console.log(result, 'changeThisArea')
console.log(result, 'changeThisArea');
//
reset()
reset();
let level1 = result[0];
area.value.length = 0
area.value.length = 0;
//
if (result.length === 1) {
result[0].selected = true
area.value.push(result[0].id)
result[0].selected = true;
area.value.push(result[0].id);
//
tabs1Ref.value.changeArea(result[0]);
// + 线
} else if (result.length === 2) {
//
if (!level1) {
level1 = treeData.value[0]
level1 = treeData.value[0];
}
// true
level1.selected = result[1].selected = true
area.value.splice(0, 0, level1.id, result[1].id)
}
nowArea.value = level1.id
level1.selected = result[1].selected = true;
area.value.splice(0, 0, level1.id, result[1].id);
//
tabs1Ref.value.changeArea(result[0]);
tabs1Ref.value.changeLine(result[1]);
}
};
//
const reset = () => {
treeData.value.forEach((item: any) => {
item.selected = false
item.selected = false;
item.childList.forEach((i: any) => {
i.selected = false
})
})
}
i.selected = false;
});
});
};
//
const computedClass = (string: string) => {
if (area.value.indexOf(string) != -1) {
return `isActive area-item area${string}`
return `isActive area-item area${string}`;
} else {
return `area-item area${string}`
}
return `area-item area${string}`;
}
};
//
const getAllArea = () => {
http.get(lightingManage.getArea, { projectId: 'HLlmTZp8' }).then(res => {
const data = res.data
floorData.value = data
http.get(lightingManage.getArea, { projectId: 'HLlmTZp8' }).then((res) => {
const data = res.data;
floorData.value = data;
/** 使
* @param id 用于判断样式和层级的前端属性
* @param selected 用于表示是否选中的前端属性
@ -231,20 +230,23 @@ const getAllArea = () => {
data.forEach((floor: any) => {
floor.childList.forEach((item: any, index: number) => {
if (index == 0) {
item.selected = true
item.selected = true;
} else {
item.selected = false
item.selected = false;
}
item.id = String(index + 1)
item.id = String(index + 1);
item.childList.forEach((v: any, i: number) => {
v.selected = false
v.id = (index + 1) + '-' + (i + 1)
})
})
})
treeData.value = data[0].childList
})
}
v.selected = false;
v.id = index + 1 + '-' + (i + 1);
});
});
});
// 线 1-1
treeData.value = data[0].childList;
//
preload.value = true;
});
};
// =====================================================
@ -256,18 +258,19 @@ let visible = ref(false);
const toggleDrawer = () => {
visible.value = !visible.value;
};
const tabs1Ref = ref()
// tab1
const tabs1Ref = ref();
</script>
<style lang="less" scoped>
@import "./index.less";
@import './index.less';
//
.isActive {
border: 3px solid white !important;
}
// tab
:deep(.ant-tabs-tab-btn) {
color: white;
}
</style>

25
hx-ai-intelligent/src/view/equipmentControl/lightingManage/light.vue

@ -34,9 +34,9 @@
</div>
</template>
<div class="icon-box" :style="styleObject" v-show="visible">
<img v-if="type == 1" class="icon-item" src="/asset/image/bulbLogo/22394.png" alt="">
<img v-if="type == 2" class="icon-item" src="/asset/image/bulbLogo/22396.png" alt="">
<img v-if="type == 3" class="icon-item" src="/asset/image/bulbLogo/22400.png" alt="">
<img v-if="type == 1" class="icon-item" src="/asset/image/bulbLogo/22394.png" alt="" />
<img v-if="type == 2" class="icon-item" src="/asset/image/bulbLogo/22396.png" alt="" />
<img v-if="type == 3" class="icon-item" src="/asset/image/bulbLogo/22400.png" alt="" />
</div>
</a-popover>
</template>
@ -49,8 +49,8 @@ defineProps({
type: Number,
visible: {
type: Boolean,
default: false
}
default: false,
},
});
const result = ref({
@ -65,39 +65,44 @@ const result = ref({
brightness3: '4000k',
brightness4: '3800k',
});
</script>
<style lang="less" scoped>
.icon-box {
width: 25px;
height: 25px;
position: absolute;
.icon-item {
width: 25px;
cursor: pointer;
transition: all ease 0.1s;
}
.icon-item:active {
transform: scale(1.2);
}
}
//
.light-tag {
display: flex;
flex-direction: column;
gap: 10px;
//
.light-tag-tit {
display: flex;
justify-content: space-between;
vertical-align: middle;
height: 30px;
.tag-text {
font-size: 16px;
font-weight: 700;
color: white;
padding-left: 10px;
}
.right-button {
width: 50px;
height: 26px;
@ -108,33 +113,37 @@ const result = ref({
}
}
}
// 4
.light-tag-box {
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: 1fr 1fr;
grid-gap: 10px;
.tag-box-item {
position: relative;
display: flex;
justify-content: space-between;
img {
width: 120px;
vertical-align: middle;
}
.title {
position: absolute;
left: 60px;
top: 13px;
color: rgba(64, 255, 252, 1);
}
.result {
line-height: 50px;
font-size: 16px;
font-weight: 700;
color: white;
};
}
}
}
</style>

424
hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs1.vue

@ -5,15 +5,21 @@
<div class="light-area">
<div class="light-area-tab"></div>
<span class="light-area-text"> 照明区域 </span>
<button class="plan" :class="{ enabled: isPlanEnabled, disabled: !isPlanEnabled }" @click="togglePlan">
<button
class="plan"
:class="{ enabled: isPlanEnabled, disabled: !isPlanEnabled }"
@click="togglePlan">
{{ isPlanEnabled ? '计划启用' : '计划禁用' }}
</button>
</div>
<!-- 照明区域按钮部分 -->
<div class="area">
<template v-if="!showAllButtonsArea">
<button v-for="(button, index) in limitedButtons1" :key="index"
:class="{ btn: true, selected: button.selected }" @click="selectButton(button)">
<button
v-for="(button, index) in limitedButtons1"
:key="index"
:class="{ btn: true, selected: button.selected }"
@click="changeArea(button)">
{{ button.name }}
</button>
<div style="margin-top: 10px">
@ -21,8 +27,11 @@
</div>
</template>
<template v-else>
<button v-for="(button, index) in props.treeData" :key="index" :class="{ btn: true, selected: button.selected }"
@click="selectButton(button)">
<button
v-for="(button, index) in props.treeData"
:key="index"
:class="{ btn: true, selected: button.selected }"
@click="changeArea(button)">
{{ button.name }}
</button>
<div style="margin-top: 10px">
@ -37,13 +46,20 @@
<div class="circuit-tab"></div>
<span class="circuit-text">照明回路</span>
<div class="btn2">
<button class="openPlan" :class="{ enabled2: isPlanEnabled2, disabled2: !isPlanEnabled2 }" @click="togglePlan2">
<button
class="openPlan"
:class="{ enabled2: isPlanEnabled2, disabled2: !isPlanEnabled2 }"
@click="togglePlan2">
{{ isPlanEnabled2 ? '启用面板' : '禁用面板' }}
</button>
<a-switch v-model:checked="selectAllCheckbox" :disabled="singleSelection" :class="{
<a-switch
v-model:checked="selectAllCheckbox"
:disabled="singleSelection"
:class="{
'blue-background': selectAllCheckbox,
'grey-background': !selectAllCheckbox,
}" @change="toggleAllSelection" />
}"
@change="toggleAllSelection" />
<button class="allBtn">全选</button>
<button class="both" @click="selectAll">
{{ singleSelection ? '多选' : '单选' }}
@ -52,8 +68,12 @@
</div>
<div class="btnArea">
<template v-if="!showAllButtons">
<button v-for="(button, index) in limitedButtons2" :key="index"
:class="{ btn: true, selected: button.selected }" class="zmhlbtn" @click="toggleSelection(button)">
<button
v-for="(button, index) in limitedButtons2"
:key="index"
:class="{ btn: true, selected: button.selected }"
class="zmhlbtn"
@click="changeLine(button)">
<stop-outlined v-if="button.ctrlStatus" />
{{ button.name }}
</button>
@ -62,8 +82,12 @@
</div>
</template>
<template v-else>
<button v-for="(button, index) in buttons2" :key="index"
:class="{ btn: true, selected: button.selected }" class="zmhlbtn" @click="toggleSelection(button)">
<button
v-for="(button, index) in buttons2"
:key="index"
:class="{ btn: true, selected: button.selected }"
class="zmhlbtn"
@click="changeLine(button)">
<stop-outlined v-if="button.ctrlStatus" />
{{ button.name }}
</button>
@ -81,24 +105,30 @@
</div>
<!-- 控制模式按钮部分 -->
<div class="control-mode-btn-area" v-show="thisButton2.code">
<button v-for="(button3, index) in controlMode" :key="index"
<button
v-for="(button3, index) in controlMode"
:key="index"
class="btn"
:disabled="button3.value != 3"
:class="{ selected: thisButton2.mode.value == button3.value }" @click="selectButton3(button3)">
:class="{ selected: thisButton2.mode.value == button3.value }"
@click="selectButton3(button3)">
{{ button3.label }}
</button>
</div>
</div>
<!-- 控制场景部分 -->
<div>
<div class="control-scene-area" v-show="thisButton2.mode.value == '3'">
<div class="control-scene-area" v-show="thisButton2.mode.value == 3">
<div class="control-scene-tab"></div>
<span class="control-scene-text"> 控制场景 </span>
</div>
<!-- 控制场景按钮部分 -->
<div class="control-scene-btn-area" v-show="thisButton2.mode.value == '3'">
<button v-for="(button4, index) in controlScene" :key="index"
:class="{ btn: true, selected: thisButton2.mode.value == button4.value }" @click="selectButton4(button4)">
<div class="control-scene-btn-area" v-show="thisButton2.mode.value == 3">
<button
v-for="(button4, index) in controlScene"
:key="index"
:class="{ btn: true, selected: thisButton2.scene.value == button4.value }"
@click="selectButton4(button4)">
{{ button4.label }}
</button>
</div>
@ -110,8 +140,7 @@
ok-text="确定"
cancel-text="取消"
@confirm="changeConfirm"
@cancel="changeCancel"
>
@cancel="changeCancel">
<button class="flushed">刷新</button>
</a-popconfirm>
<button class="execute" @click="showModal">执行</button>
@ -129,7 +158,11 @@
<div class="imgText">
<div class="zjzm">
<img class="title-img" src="/asset/image//bulbLogo/21961.png" alt="" />&nbsp;
<span class="title-text" style="font-size: 20px; font-weight: 500; color: rgba(255, 255, 255, 1)">{{ item.name }}</span>
<span
class="title-text"
style="font-size: 20px; font-weight: 500; color: rgba(255, 255, 255, 1)"
>{{ item.name }}</span
>
</div>
<button class="cxbtn" @click="delBtn(item.id)">撤销</button>
</div>
@ -143,9 +176,7 @@
</div>
</div>
<div class="btn-item">
<div class="left">
亮度
</div>
<div class="left"> 亮度 </div>
<div class="right">
<span>100lux</span>
<img src="/asset/image/bulbLogo/22406.png" alt="" />
@ -153,9 +184,7 @@
</div>
</div>
<div class="btn-item">
<div class="left">
控制场景
</div>
<div class="left"> 控制场景 </div>
<div class="right">
<span>手动</span>
<img src="/asset/image/bulbLogo/22406.png" alt="" />
@ -163,9 +192,7 @@
</div>
</div>
<div class="btn-item">
<div class="left">
色温
</div>
<div class="left"> 色温 </div>
<div class="right">
<span>4000k</span>
<img src="/asset/image/bulbLogo/22406.png" alt="" />
@ -176,7 +203,7 @@
</div>
</div>
</div>
<div style="width: 100%; height: 60px;"></div>
<div style="width: 100%; height: 60px"></div>
<div class="button-box">
<button class="cancel" @click="executeVisible = false">取消</button>
<button class="execute">执行</button>
@ -186,63 +213,37 @@
</template>
<script setup lang="ts">
import { ref, computed, onMounted, watch } from 'vue';
import {
DownOutlined,
UpOutlined,
StopOutlined,
} from '@ant-design/icons-vue';
import { ref, computed, onMounted } from 'vue';
import { DownOutlined, UpOutlined, StopOutlined } from '@ant-design/icons-vue';
import { message } from 'ant-design-vue';
//
import { http } from '/nerv-lib/util/http';
import { lightingManage } from '/@/api/IlluminationInfo';
import { getAllEnum } from '/@/api/index'
import { getAllEnum } from '/@/api/index';
// =========================================================================
onMounted(() => {
//
setArea(0)
//
setArea();
//
getEnum(['IlluminationMode', 'IlluminationScene']);
});
//
getEnum(['IlluminationMode', 'IlluminationScene'])
})
//
const getEnum = (arr: any) => {
getAllEnum({ params: arr }).then(res => {
const data = res.data
controlMode.value = data.IlluminationMode
controlScene.value = data.IlluminationScene
})
}
// 线
const setArea = (isHandle: number) => {
const data = props.treeData.find((item: any) => {
return item.id == props.nowArea
})
//
data.selected = true
//
selectedButton.value = props.nowArea
//
buttons2.value = data.childList
//
if (isHandle) {
// 线childrenselectedtrue
const button2 = data.childList.find((item: any) => {
return item.selected == true
})
// 线
if (button2) {
thisButton2.value = button2;
console.log(button2,'2222222222')
} else {
resetMode()
}
}
}
getAllEnum({ params: arr }).then((res) => {
const data = res.data;
//
controlMode.value = data.IlluminationMode;
//
controlScene.value = data.IlluminationScene;
});
};
// 1-1 线
const setArea = () => {
const data = props.treeData[0];
buttons2.value = data.childList;
};
// ===================================================================
@ -250,12 +251,8 @@ const props = defineProps({
// >
treeData: {
type: Array,
default: []
default: [],
},
// ID
nowArea: {
type: String,
}
});
//
/**
@ -263,12 +260,6 @@ const props = defineProps({
* @method reset 用于重置按钮区
*/
const emit = defineEmits(['changeArea', 'reset']);
//
watch(() => props.nowArea, () => {
setArea(1)
// 线
handleButton.value = ''
})
// =======================================================================
@ -283,16 +274,23 @@ const togglePlan = () => {
const showAllButtonsArea = ref(false);
// 1
const selectedButton = ref<string | undefined>('1');
// -
const selectButton = (button: any) => {
//
const changeArea = (button: any) => {
//
selectedButton.value = button.id;
initMenu(1)
button.selected = true
buttons2.value = button.childList
// 线
buttons2.value = button.childList;
//
emit('reset');
//
button.selected = true;
//
emit('changeArea', button.id);
resetMode()
handleButton.value = ''
// 线 -
resetMode();
// -
handleButton.value = '';
};
// 8
const limitedButtons1 = computed(() => props.treeData.slice(0, 8));
@ -311,95 +309,118 @@ const togglePlan2 = () => {
return message.info('请选择照明回路');
}
//
const btn: any = buttons2.value.find((button) => button.id === handleButton.value)
let panel = +(!btn.ctrlStatus)
isLoading.value = true
http.get(lightingManage.setDisable, { deviceGroup: btn.code, panel }).then(res => {
const btn: any = buttons2.value.find((button) => button.id === handleButton.value);
let panel = +!btn.ctrlStatus;
isLoading.value = true;
http
.get(lightingManage.setDisable, { deviceGroup: btn.code, panel })
.then((res) => {
if (res.msg === 'success') {
// - - - loading
isPlanEnabled2.value = !isPlanEnabled2.value;
btn.ctrlStatus = panel
isLoading.value = false
btn.ctrlStatus = panel;
isLoading.value = false;
} else {
isLoading.value = false
isLoading.value = false;
}
}).catch(() => { isLoading.value = false })
})
.catch(() => {
isLoading.value = false;
});
};
//
let singleSelection = ref(true);
//
const selectAll = () => {
selectAllCheckbox.value = false
selectAllCheckbox.value = false;
buttons2.value.forEach((button) => {
button.selected = false;
});
singleSelection.value = !singleSelection.value;
resetMode()
emit('changeArea', [selectedButton.value])
// 线 -
resetMode();
//
emit('changeArea', [selectedButton.value]);
};
//
const selectAllCheckbox = ref(false);
// switch
const toggleAllSelection = () => {
let arr = [selectedButton.value]
let arr = [selectedButton.value];
//
if (selectAllCheckbox.value) {
buttons2.value.forEach((item) => {
buttons2.value.forEach((item, index) => {
// 线-
if (index == 0) {
thisButton2.value = item;
}
item.selected = true;
arr.push(item.id)
arr.push(item.id);
});
//
} else {
buttons2.value.forEach((item) => {
item.selected = false;
});
// -
resetMode();
}
emit('changeArea', arr)
emit('changeArea', arr);
};
// 线
const thisButton2 = ref({
code: '',
mode: {
value: -1,
},
scene: {
value: -1,
},
});
//
const toggleSelection = (button: any) => {
const changeLine = (button: any) => {
// ID/
handleButton.value = button.id
handleButton.value = button.id;
// /
if (button.ctrlStatus) {
isPlanEnabled2.value = true
isPlanEnabled2.value = true;
} else {
isPlanEnabled2.value = false
isPlanEnabled2.value = false;
}
//
let level1 = selectedButton.value
let level2 = button.id
// false
let level1 = selectedButton.value;
let level2 = button.id;
// false
if (singleSelection.value) {
buttons2.value.forEach(item => {
buttons2.value.forEach((item) => {
item.selected = false;
});
emit('changeArea', [level1, level2])
button.selected = !button.selected;
emit('changeArea', [level1, level2]);
} else {
//
button.selected = !button.selected;
const arr = [level1]
buttons2.value.forEach(item => {
const arr = [level1];
buttons2.value.forEach((item) => {
if (item.selected) {
arr.push(item.id)
arr.push(item.id);
}
});
emit('changeArea', arr)
emit('changeArea', arr);
}
//
if (button.selected) {
//
thisButton2.value = button
thisButton2.value = button;
} else {
//
resetMode()
//
resetMode();
}
console.log(thisButton2,'button')
console.log(thisButton2, 'button');
};
//
@ -411,45 +432,84 @@ const limitedButtons2 = computed(() => buttons2.value.slice(0, 8));
// ====================================================================
const thisButton2 = ref({
code: '',
mode: {
value: '0'
}
})
// -
const selectButton3 = (button3) => {
let checked = thisButton2.value.mode
console.log(button3.value,'---', checked.value)
//
let checked = thisButton2.value.mode;
console.log(button3.value, '---', checked.value);
//
if (checked.value === button3.value) {
return
return;
}
checked.value = button3.value
selectedButton4.value = null; //
checked.value = button3.value;
};
const diff = () => {
console.log(thisButton2)
}
// =====================================================================
//
const controlMode = ref([])
const controlMode = ref([]);
//
const controlScene = ref([])
const controlScene = ref([]);
// -
const selectedButton4 = ref(null);
// -
const selectButton4 = (button4) => {
selectedButton4.value = button4.label;
// 线
const data = thisButton2.value;
//
let before = data.scene.value;
//
let after = button4.value;
//
if (before === after) {
return;
//
} else {
thisButton2.value.scene.value = after;
//
const result = changeList.value.find((item, index) => {
item.index = index;
return item.deviceGroup == data.code;
});
//
if (result) {
//
if (after == result.before) {
changeList.value.splice(result.index, 1);
// after
} else {
result.scene = after;
// flag
delete result.index;
}
//
} else {
changeList.value.push({
// 线
deviceGroup: data.code,
deviceGroupName: data.name,
//
region: data.pcode,
regionName: '',
//
before: before,
//
scene: after,
});
}
console.log(changeList.value, 'changeList');
}
thisButton2.value.scene.value = after;
console.log(thisButton2, '222222');
console.log(button4, '44444');
};
// ========================================================================
//
const changeList: any = ref([]);
//
const submitArray = ref([])
const submitList = ref([]);
const cxList = ref([
{
id: '1',
@ -489,7 +549,7 @@ const cxList = ref([
},
]);
//
const delBtn = (id: any) => {
const delBtn = () => {
cxList.value.pop();
console.log(cxList.value.length);
@ -500,66 +560,68 @@ const delBtn = (id: any) => {
// ========================================================================
const isLoading = ref(false)
// 5
const initMenu = (tier: number) => {
// 1 = -
if (tier == 1) {
emit('reset')
//
selectedButton4.value = null;
} else if (tier == 2) {
//
selectedButton4.value = null;
}
}
const isLoading = ref(false);
//
const refresh = () => {
//
executeVisible.value = false
executeVisible.value = false;
//
selectedButton.value = '1';
emit('changeArea', ['1']);
emit('reset')
let data = props.treeData[0]
emit('reset');
let data = props.treeData[0];
//
data.selected = true
buttons2.value = data.childList
data.selected = true;
buttons2.value = data.childList;
selectedButton4.value = null;
resetMode()
resetMode();
};
//
const executeVisible = ref<boolean>(false);
const showModal = () => {
http
.post(lightingManage.getChangeList, { infoList: changeList.value, projectId: 'HLlmTZp8' })
.then((res) => {
if (res.msg === 'success') {
isLoading.value = true;
console.log(res);
} else {
isLoading.value = false;
}
});
executeVisible.value = true;
};
//
const changeConfirm = () => {
refresh()
}
refresh();
};
//
const changeCancel = () => {
}
const changeCancel = () => {};
// 线
const resetMode = () => {
thisButton2.value = {
code: '',
mode: {
value: '0'
}
}
}
value: -1,
},
scene: {
value: -1,
},
};
};
//
defineExpose({
changeCancel
//
changeArea,
// 线
changeLine,
});
</script>
<style lang="less" scoped>
@import "./dialogStyle.less";
@import "./tabs1.less";
@import './dialogStyle.less';
@import './tabs1.less';
</style>

67
hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs2.vue

@ -45,8 +45,7 @@
title="此操作将永久删除该条数据"
ok-text="确定"
cancel-text="取消"
@confirm="deletePlan(row.id)"
>
@confirm="deletePlan(row.id)">
<div class="tabDelete">删除</div>
</a-popconfirm>
</td>
@ -70,7 +69,7 @@
@search="handleSearch"
:listStyle="{ border: '2px solid rgba(25,74,125,1)', height: 'calc(100vh - 200px)' }" />
</div>
<div style="width: 100%; height: 60px;"></div>
<div style="width: 100%; height: 60px"></div>
<div class="button-box">
<button class="cancel" @click="addVisible = false">取消</button>
<button class="execute" @click="sendPlan">确定</button>
@ -89,10 +88,10 @@ import { message } from 'ant-design-vue';
onMounted(() => {
//
getTable()
getTable();
// 穿
getLeftPlan()
})
getLeftPlan();
});
// tab ========================================================
@ -100,24 +99,24 @@ onMounted(() => {
const dataSource = ref([]);
//
const getTable = () => {
http.get(lightingManage.getPlanTable, {}).then(res => {
dataSource.value = res.data
})
}
http.get(lightingManage.getPlanTable, {}).then((res) => {
dataSource.value = res.data;
});
};
//
const deletePlan = (id: String) => {
http.delete(lightingManage.deletePlan, [id]).then(() => {
message.success('操作成功')
getTable()
})
}
message.success('操作成功');
getTable();
});
};
//
const restartPlan = (id: String) => {
http.post(lightingManage.restartPlan, { planId: id }).then(() => {
message.success('操作成功')
getTable()
})
}
message.success('操作成功');
getTable();
});
};
// tab ====================================================
@ -134,17 +133,17 @@ const addModal = () => {
const transferData = ref([]) as any;
// 穿
const getLeftPlan = () => {
http.get(lightingManage.getLeftPlan, {}).then(res => {
let arr = []
http.get(lightingManage.getLeftPlan, {}).then((res) => {
let arr = [];
res.data.forEach((item: any) => {
arr.push({
key: item.id,
title: item.planName
})
})
transferData.value = arr
})
}
title: item.planName,
});
});
transferData.value = arr;
});
};
const handleChange = (keys: string[], direction: string, moveKeys: string[]) => {
console.log(keys, direction, moveKeys);
@ -160,21 +159,19 @@ const sendPlan = () => {
return message.info('没有选择任何计划');
}
http.post(lightingManage.submitLeftPlan, targetKeys.value).then(() => {
message.success('添加成功')
message.success('添加成功');
//
getTable()
getLeftPlan()
})
}
getTable();
getLeftPlan();
});
};
const filterOption = (inputValue: string, option: any) => {
return option.description.indexOf(inputValue) > -1;
};
</script>
<style lang="less" scoped>
@import "./dialogStyle.less";
@import './dialogStyle.less';
//
.div-add {
@ -248,6 +245,4 @@ const filterOption = (inputValue: string, option: any) => {
background: black;
}
}
</style>

38
hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs3.vue

@ -9,7 +9,10 @@
</tr>
</thead>
<tbody>
<tr v-for="(row, index) in dataSource1" :key="index" @click="handleRowClick(row.key)"
<tr
v-for="(row, index) in dataSource1"
:key="index"
@click="handleRowClick(row.key)"
:class="row.key === trIndex ? 'isTrIndex' : ''">
<td>{{ row.key }}</td>
<td>{{ row.data }}</td>
@ -19,7 +22,7 @@
</tbody>
</table>
<div class="out-dialog" :class="{ 'showDialog' : logModalVisible }" v-if="logModalVisible">
<div class="out-dialog" :class="{ showDialog: logModalVisible }" v-if="logModalVisible">
<div class="content" v-if="logModalVisible">
<div>
<div class="div-operation"></div>
@ -30,7 +33,11 @@
<div class="imgText">
<div class="zjzm">
<img class="title-img" src="/asset/image//bulbLogo/21961.png" alt="" />&nbsp;
<span class="title-text" style="font-size: 20px; font-weight: 500; color: rgba(255, 255, 255, 1)">{{ item.name }}</span>
<span
class="title-text"
style="font-size: 20px; font-weight: 500; color: rgba(255, 255, 255, 1)"
>{{ item.name }}</span
>
</div>
</div>
<div class="btn-box">
@ -43,9 +50,7 @@
</div>
</div>
<div class="btn-item">
<div class="left">
亮度
</div>
<div class="left"> 亮度 </div>
<div class="right">
<span>100lux</span>
<img src="/asset/image/bulbLogo/22406.png" alt="" />
@ -53,9 +58,7 @@
</div>
</div>
<div class="btn-item">
<div class="left">
控制场景
</div>
<div class="left"> 控制场景 </div>
<div class="right">
<span>手动</span>
<img src="/asset/image/bulbLogo/22406.png" alt="" />
@ -63,9 +66,7 @@
</div>
</div>
<div class="btn-item">
<div class="left">
色温
</div>
<div class="left"> 色温 </div>
<div class="right">
<span>4000k</span>
<img src="/asset/image/bulbLogo/22406.png" alt="" />
@ -76,7 +77,7 @@
</div>
</div>
</div>
<div style="height: 60px;"></div>
<div style="height: 60px"></div>
<div class="button-box">
<button class="cancel" @click="logModalVisible = false">取消</button>
</div>
@ -90,15 +91,13 @@
import { ref, onMounted } from 'vue';
//
onMounted(() => {
})
onMounted(() => {});
// ===================================================================
const props = defineProps({
// >
treeData: {
type: Array
type: Array,
},
});
const emit = defineEmits(['changeArea']);
@ -172,11 +171,9 @@ const handleRowClick = (index: any) => {
//
logModalVisible.value = true;
};
</script>
<style lang="less" scoped>
@import "./dialogStyle.less";
@import './dialogStyle.less';
//
.div-add {
@ -246,7 +243,6 @@ const handleRowClick = (index: any) => {
}
::v-deep(.ant-transfer) {
// hover
.ant-transfer-list-content-item:hover {
background: black;

Loading…
Cancel
Save