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', setDisable = '/carbon-smart/IlluminationInfo/revisePanel',
// 控制面板tab页 ================================================
// 获取当前修改的内容对比数据
getChangeList = '/carbon-smart/IlluminationInfo/getLightSceneChangeInfo',
// 提交当前修改
submitChangeList = '/carbon-smart/IlluminationInfo/changeLightScene',
// 计划列表tab页 ================================================ // 计划列表tab页 ================================================
// 获得计划列表tab页的表格数据 // 获得计划列表tab页的表格数据

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

@ -55,4 +55,6 @@ export enum carbonInventoryCheck {
findUnitById = '/carbon-smartapi/carbon/inventory/findById', findUnitById = '/carbon-smartapi/carbon/inventory/findById',
getDetailsList = '/carbon-smart/api/carbon/inventory/details/getDetailsList', getDetailsList = '/carbon-smart/api/carbon/inventory/details/getDetailsList',
updateTable = '/carbon-smart/api/carbon/inventory/details/update', 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); return Promise.resolve(res);
}; };
/** /**
* ( enumType) * ( enumType)
*/ */
@ -58,6 +57,6 @@ export const getEnum = async ({
api = `${BASE_URL}/operation/enum/getEnum`, api = `${BASE_URL}/operation/enum/getEnum`,
params = {}, params = {},
}: dictHttpConfig) => { }: dictHttpConfig) => {
const res = await http.post(api, params); const res = await http.get(api, params);
return Promise.resolve(res); return Promise.resolve(res);
}; };

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

@ -9,7 +9,7 @@
<div class="card"> <div class="card">
<div class="card-title"> <div class="card-title">
<a-tag class="card-title-tag" :color="item.color">{{ item.stateName }}</a-tag> <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 class="time">{{ item.createTime }}</div>
</div> </div>
<div style="width: 100%; color: #3a3a3a; height: 25px; overflow: auto"> <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; export default equipment;

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

@ -20,7 +20,7 @@
</div> </div>
</div> </div>
<div class="item-box-right"> <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> </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 }, // pagination: { pageSizeOptions: false },
rowKey: 'id', rowKey: 'id',
}; };

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -2,16 +2,15 @@
<div class="main"> <div class="main">
<div class="left"> <div class="left">
<div class="top"> <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 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-row>
<a-col :span="24" style="margin-bottom: 16px;"> <a-col :span="24" style="margin-bottom: 16px">
<a-input-search <a-input-search
v-model:value="searchValue" v-model:value="searchValue"
placeholder="请输入关键词" placeholder="请输入关键词"
@search="onSearchTreeData" @search="onSearchTreeData" />
/>
</a-col> </a-col>
</a-row> </a-row>
</div> </div>
@ -25,13 +24,15 @@
show-line show-line
@expand="onExpand" @expand="onExpand"
@select="onSelect" @select="onSelect"
style="padding: 0 16px !important;" style="padding: 0 16px !important">
>
<template #title="data"> <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)) }} {{ data.energyType.substring(0, data.energyType.indexOf(searchValue)) }}
<span style="color: #f50">{{ searchValue }}</span> <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>
<span v-else>{{ data.energyType }}</span> <span v-else>{{ data.energyType }}</span>
</template> </template>
@ -65,7 +66,7 @@
:current="queryParams.pageNum" :current="queryParams.pageNum"
:total="total" :total="total"
:page-size="queryParams.pageSize" :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-size-changer="true"
:show-quick-jumper="true" :show-quick-jumper="true"
@change="onChange" /> @change="onChange" />
@ -82,12 +83,14 @@
:model="formState" :model="formState"
:rules="rules" :rules="rules"
:label-col="labelCol" :label-col="labelCol"
:wrapper-col="wrapperCol" :wrapper-col="wrapperCol">
>
<a-row> <a-row>
<a-col :span="12"> <a-col :span="12">
<a-form-item ref="name" label="日期范围" name="dateRange"> <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-form-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
@ -109,7 +112,11 @@
:data-source="newTableData" :data-source="newTableData"
bordered bordered
rowKey="id" rowKey="id"
:rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectionChange, type: 'radio' }" :rowSelection="{
selectedRowKeys: selectedRowKeys,
onChange: onSelectionChange,
type: 'radio',
}"
:pagination="false"> :pagination="false">
</a-table> </a-table>
<template #footer> <template #footer>
@ -127,7 +134,11 @@
import { Pagination, Modal } from 'ant-design-vue'; import { Pagination, Modal } from 'ant-design-vue';
import { columns, drawerColumns } from '../config'; import { columns, drawerColumns } from '../config';
import { http } from '/nerv-lib/util/http'; 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({ defineOptions({
energyType: 'quickCalculation', // name energyType: 'quickCalculation', // name
components: { components: {
@ -191,7 +202,7 @@
for (let i = 0; i < tree.length; i++) { for (let i = 0; i < tree.length; i++) {
const node = tree[i]; const node = tree[i];
if (node.children) { if (node.children) {
if (node.children.some(item => item.key === key)) { if (node.children.some((item) => item.key === key)) {
parentKey = node.key; parentKey = node.key;
} else if (getParentKey(key, node.children)) { } else if (getParentKey(key, node.children)) {
parentKey = getParentKey(key, node.children); parentKey = getParentKey(key, node.children);
@ -211,17 +222,17 @@
autoExpandParent.value = false; autoExpandParent.value = false;
}; };
// //
const energyType = ref() const energyType = ref();
const onSelect = (selectedKey: string[], info: any) => { const onSelect = (selectedKey: string[], info: any) => {
selectedKeys.value = selectedKey; selectedKeys.value = selectedKey;
if (info.selected) { if (info.selected) {
energyType.value = info.node.id energyType.value = info.node.id;
statsId.value = info.node.id statsId.value = info.node.id;
mainRef.value?.nsTableRef.reload(); mainRef.value?.nsTableRef.reload();
} }
}; };
watch(searchValue, value => { watch(searchValue, (value) => {
const expanded = dataList const expanded = dataList
.map((item: TreeProps['treeData'][number]) => { .map((item: TreeProps['treeData'][number]) => {
if (item.title.indexOf(value) > -1) { if (item.title.indexOf(value) > -1) {
@ -235,26 +246,25 @@
autoExpandParent.value = true; autoExpandParent.value = true;
}); });
// //
const onSearchTreeData = () => { const onSearchTreeData = () => {};
}; const statsId = ref();
const statsId = ref()
// //
const getTreeData = () => { const getTreeData = () => {
fetch(quickCalculation.carbonQuickTree).then((res) => { fetch(quickCalculation.carbonQuickTree, { orgId: orgId.value }).then((res) => {
gData.value = res.data gData.value = res.data;
energyType.value = gData.value[0].children[0].id energyType.value = gData.value[0].children[0].id;
statsId.value = gData.value[0].children[0].id statsId.value = gData.value[0].children[0].id;
mainRef.value?.nsTableRef.reload(); mainRef.value?.nsTableRef.reload();
}); });
}; };
getTreeData() getTreeData();
// //
const total = ref<number>() const total = ref<number>();
const queryParams = ref({ const queryParams = ref({
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
orgId: orgId.value orgId: orgId.value,
}) });
const tableData = ref([]); const tableData = ref([]);
const tableConfig = ref({ const tableConfig = ref({
@ -262,7 +272,7 @@
api: quickCalculation.queryCarbonEmissionPage, api: quickCalculation.queryCarbonEmissionPage,
params: { params: {
orgId, orgId,
energyType energyType,
}, },
headerActions: [ headerActions: [
{ {
@ -270,8 +280,8 @@
name: 'userAdd', name: 'userAdd',
type: 'primary', type: 'primary',
handle: () => { handle: () => {
visible.value = true visible.value = true;
getNewTable() getNewTable();
}, },
}, },
], ],
@ -320,12 +330,12 @@
name: 'userEdit', name: 'userEdit',
handle: (record: any) => { handle: (record: any) => {
selectedRowKeys.value = [record.factorId]; selectedRowKeys.value = [record.factorId];
formState.value.id = record.id formState.value.id = record.id;
formState.value.emissionFactors = record.emissionFactors formState.value.emissionFactors = record.emissionFactors;
formState.value.dateRange = [record.startTime, record.endTime]; formState.value.dateRange = [record.startTime, record.endTime];
formState.value.factorId = record.factorId formState.value.factorId = record.factorId;
visible.value = true visible.value = true;
getNewTable() getNewTable();
}, },
}, },
{ {
@ -343,8 +353,8 @@
// //
const getTableList = () => { const getTableList = () => {
fetch(quickCalculation.queryCarbonEmissionPage, queryParams.value).then((res) => { fetch(quickCalculation.queryCarbonEmissionPage, queryParams.value).then((res) => {
tableData.value = res.data.records tableData.value = res.data.records;
total.value = res.data.total total.value = res.data.total;
}); });
}; };
// //
@ -357,7 +367,9 @@
const formRef = ref(); const formRef = ref();
const labelCol = { span: 6 }; const labelCol = { span: 6 };
const wrapperCol = { span: 18 }; const wrapperCol = { span: 18 };
const formState = ref({}) const formState = ref({
orgId: orgId.value,
});
const visible = ref(false); const visible = ref(false);
// form // form
@ -367,65 +379,65 @@
}; };
// //
const addNewData = () => { const addNewData = () => {
visible.value = true visible.value = true;
getNewTable() getNewTable();
}; };
// //
const selectedRowKeys = ref([]); const selectedRowKeys = ref([]);
const onSelectionChange = (selectedKeys, selectedRows) => { const onSelectionChange = (selectedKeys, selectedRows) => {
selectedRowKeys.value = selectedKeys; selectedRowKeys.value = selectedKeys;
formState.value.emissionFactors = selectedRows[0].emissionFactors formState.value.emissionFactors = selectedRows[0].emissionFactors;
formState.value.factorId = selectedRows[0].id formState.value.factorId = selectedRows[0].id;
}; };
const queryData = ref({ const queryData = ref({
orgId: orgId.value, orgId: orgId.value,
pageNum: 1, pageNum: 1,
pageSize: 999 pageSize: 999,
}) });
const newTableData = ref([]) const newTableData = ref([]);
const getNewTable = () => { const getNewTable = () => {
fetch(carbonEmissionFactorLibrary.getTableList, queryData.value).then((res) => { fetch(carbonEmissionFactorLibrary.getTableList, queryData.value).then((res) => {
newTableData.value = res.data.records newTableData.value = res.data.records;
}); });
}; };
// //
const editData = (record) => { const editData = (record) => {
selectedRowKeys.value = [record.factorId]; selectedRowKeys.value = [record.factorId];
formState.value.id = record.id formState.value.id = record.id;
formState.value.emissionFactors = record.emissionFactors formState.value.emissionFactors = record.emissionFactors;
formState.value.dateRange = [record.startTime, record.endTime]; formState.value.dateRange = [record.startTime, record.endTime];
formState.value.factorId = record.factorId formState.value.factorId = record.factorId;
visible.value = true visible.value = true;
getNewTable() getNewTable();
}; };
// //
const onSubmit = () => { const onSubmit = () => {
formRef.value formRef.value
.validate() .validate()
.then(() => { .then(() => {
formState.value.statsId = statsId.value formState.value.statsId = statsId.value;
formState.value.startTime = formState.value.dateRange[0] formState.value.startTime = formState.value.dateRange[0];
formState.value.endTime = formState.value.dateRange[1] formState.value.endTime = formState.value.dateRange[1];
console.log('values', formState, toRaw(formState)); console.log('values', formState, toRaw(formState));
if (formState.value.id) { if (formState.value.id) {
fetch(quickCalculation.update, formState.value).then((res) => { fetch(quickCalculation.update, formState.value).then((res) => {
visible.value = false visible.value = false;
selectedRowKeys.value = []; selectedRowKeys.value = [];
formState.value = {} formState.value = {};
formRef.value.resetFields(); formRef.value.resetFields();
mainRef.value?.nsTableRef.reload(); mainRef.value?.nsTableRef.reload();
}); });
} else { } else {
fetch(quickCalculation.creat, formState.value).then((res) => { fetch(quickCalculation.creat, formState.value).then((res) => {
visible.value = false visible.value = false;
selectedRowKeys.value = []; selectedRowKeys.value = [];
formState.value = {} formState.value = {};
formRef.value.resetFields(); formRef.value.resetFields();
mainRef.value?.nsTableRef.reload(); mainRef.value?.nsTableRef.reload();
}); });
} }
}) })
.catch(error => { .catch((error) => {
console.log('error', error); console.log('error', error);
}); });
}; };
@ -440,7 +452,7 @@
onOk() { onOk() {
fetch(quickCalculation.del, { id: record.id }).then((res) => { fetch(quickCalculation.del, { id: record.id }).then((res) => {
message.success('操作成功!'); message.success('操作成功!');
getTableList() getTableList();
}); });
}, },
onCancel() { onCancel() {
@ -452,7 +464,7 @@
const onClose = () => { const onClose = () => {
visible.value = false; visible.value = false;
selectedRowKeys.value = []; selectedRowKeys.value = [];
formState.value = {} formState.value = {};
formRef.value.resetFields(); formRef.value.resetFields();
}; };
</script> </script>
@ -525,7 +537,7 @@
height: 13px; height: 13px;
width: 3px; width: 3px;
border-radius: 1px; border-radius: 1px;
background-color: #2778FF; background-color: #2778ff;
} }
:deep(.ant-table-title) { :deep(.ant-table-title) {
display: flex; 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" :model="formState"
:rules="rules" :rules="rules"
:label-col="labelCol" :label-col="labelCol"
:wrapper-col="wrapperCol" :wrapper-col="wrapperCol">
>
<a-form-item ref="name" label="报告名称" name="reportName"> <a-form-item ref="name" label="报告名称" name="reportName">
<a-input v-model:value="formState.reportName" placeholder="请输入报告名称" /> <a-input v-model:value="formState.reportName" placeholder="请输入报告名称" />
</a-form-item> </a-form-item>
@ -38,7 +37,10 @@
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item ref="name" label="报告范围" name="reportScope"> <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-item>
</a-form> </a-form>
<template #footer> <template #footer>
@ -65,7 +67,7 @@
const fillInPage = ref(false); const fillInPage = ref(false);
// //
const visible = ref(false); const visible = ref(false);
const formState = ref({}) const formState = ref({});
const formRef = ref(); const formRef = ref();
const labelCol = { span: 5 }; const labelCol = { span: 5 };
const wrapperCol = { span: 19 }; const wrapperCol = { span: 19 };
@ -80,7 +82,7 @@
// //
const onClose = () => { const onClose = () => {
visible.value = false; visible.value = false;
formState.value = {} formState.value = {};
formRef.value.resetFields(); formRef.value.resetFields();
}; };
// //
@ -89,15 +91,15 @@
.validate() .validate()
.then(() => { .then(() => {
console.log('values', formState, toRaw(formState)); console.log('values', formState, toRaw(formState));
formState.value.enterpriseOrgId = orgId.value formState.value.enterpriseOrgId = orgId.value;
formState.value.startTime = formState.value.reportScope[0] formState.value.startTime = formState.value.reportScope[0];
formState.value.endTime = formState.value.reportScope[1] formState.value.endTime = formState.value.reportScope[1];
fetch(carbonInventoryCheck.createOrUpdate, formState.value).then((res) => { fetch(carbonInventoryCheck.createOrUpdate, formState.value).then((res) => {
visible.value = false visible.value = false;
mainRef.value?.nsTableRef.reload(); mainRef.value?.nsTableRef.reload();
}); });
}) })
.catch(error => { .catch((error) => {
console.log('error', error); console.log('error', error);
}); });
}; };
@ -110,7 +112,7 @@
title: '数据库', title: '数据库',
api: carbonInventoryCheck.carbonInventoryList, api: carbonInventoryCheck.carbonInventoryList,
params: { params: {
orgId orgId,
}, },
headerActions: [ headerActions: [
{ {
@ -118,7 +120,7 @@
name: 'userAdd', name: 'userAdd',
type: 'primary', type: 'primary',
handle: () => { handle: () => {
visible.value = true visible.value = true;
}, },
}, },
], ],
@ -161,10 +163,10 @@
label: '编辑', label: '编辑',
name: 'userEdit', name: 'userEdit',
handle: (record: any) => { handle: (record: any) => {
visible.value = true visible.value = true;
fetch(carbonInventoryCheck.findById, { id: record.id }).then((res) => { fetch(carbonInventoryCheck.findById, { id: record.id }).then((res) => {
formState.value = res.data formState.value = res.data;
formState.value.reportScope = [res.data.startTime,res.data.endTime] formState.value.reportScope = [res.data.startTime, res.data.endTime];
}); });
}, },
}, },
@ -172,17 +174,16 @@
label: '填报', label: '填报',
name: 'fillIn', name: 'fillIn',
handle: (record: any) => { handle: (record: any) => {
isMainPage.value = false isMainPage.value = false;
fillInPage.value = true fillInPage.value = true;
reportId.value = record.id reportId.value = record.id;
year.value = record.reportYear year.value = record.reportYear;
}, },
}, },
{ {
label: '下载', label: '下载',
name: 'download', name: 'download',
handle: (record: any) => { handle: (record: any) => {},
},
}, },
{ {
label: '删除', label: '删除',
@ -213,7 +214,7 @@
componentProps: { componentProps: {
valueFormat: 'YYYY', valueFormat: 'YYYY',
placeholder: ['报告年度', '报告年度'], placeholder: ['报告年度', '报告年度'],
picker:"year" picker: 'year',
}, },
}, },
], ],
@ -223,11 +224,9 @@
}); });
// //
const updateData = (newDataOne, newDataTwo) => { const updateData = (newDataOne, newDataTwo) => {
isMainPage.value = newDataOne isMainPage.value = newDataOne;
fillInPage.value = newDataTwo fillInPage.value = newDataTwo;
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped></style>
</style>

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

@ -1,46 +1,41 @@
<template> <template>
<div class="map-box"> <div class="map-box">
<div class="map"> <div class="map">
<liftInfo></liftInfo> <liftInfo />
</div> </div>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted } from 'vue'; import { ref, onMounted } from 'vue';
import liftInfo from './liftInfo.vue' import liftInfo from './liftInfo.vue';
// //
import { message } from 'ant-design-vue';
// =========================================================== // ===========================================================
onMounted(() => { onMounted(() => {});
})
// tab ======================================================== // tab ========================================================
// //
const dataSource = ref([]); const dataSource = ref([]);
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.map-box { .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%; width: 100%;
height: 100%; height: 100%;
.map { .map {
@ -49,5 +44,4 @@ const dataSource = ref([]);
background-image: url(../image/bg.jpg); background-image: url(../image/bg.jpg);
} }
} }
</style> </style>

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

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

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save