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
e90efdb08d
  1. 8
      hx-ai-intelligent/src/api/alarmSettings/energyAlarm.ts
  2. 3
      hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts
  3. 109
      hx-ai-intelligent/src/view/alarmManagement/alarmOverview/index.vue
  4. 165
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/configureEnergyAlarms.vue
  5. 136
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editConfigureEnergyAlarm.vue
  6. 12
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/configureDeviceAlarms.vue
  7. 2
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editConfigureDeviceAlarm.vue
  8. 10
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/index.vue
  9. 335
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/index.vue
  10. 45
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/linkPeople/index.vue
  11. 8
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/equipmentAlarmConfig.ts
  12. 170
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue
  13. 42
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/config.ts
  14. 401
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index copy.vue
  15. 601
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue
  16. 141
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/dialogStyle.less
  17. 1108
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/index.less
  18. 156
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/indexs.less
  19. 50
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/indexs.vue
  20. 15
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/indexs1.vue
  21. 457
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs1.vue
  22. 216
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs2.vue
  23. 255
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs3.vue

8
hx-ai-intelligent/src/api/alarmSettings/energyAlarm.ts

@ -2,8 +2,8 @@ export enum energyAlarms {
getTableList = '/carbon-smart/api/AlarmEnergyConsumption/selectAlarmEnergyConsumption', //能耗告警分页 getTableList = '/carbon-smart/api/AlarmEnergyConsumption/selectAlarmEnergyConsumption', //能耗告警分页
addOrUpNewData = '/carbon-smart/api/AlarmEnergyConsumption/creatOrUpdate', //能耗告警添加 修改 addOrUpNewData = '/carbon-smart/api/AlarmEnergyConsumption/creatOrUpdate', //能耗告警添加 修改
del = '/carbon-smart/api/AlarmEnergyConsumption/delete', //能耗删除 del = '/carbon-smart/api/AlarmEnergyConsumption/delete', //能耗删除
configGetTableList = '/carbon-smart/api/AlarmEquipmentRule/selectAlarmEquipmentRule', //配置设备告警分页 configGetTableList = '/carbon-smart/api/AlarmEnergyConsumptionRule/selectAlarmEnergyConsumptionRule', //配置设备告警分页
configAddOrUpNewData = '/carbon-smart/api/AlarmEquipmentRule/creatOrUpdate', //配置设备告警添加 修改 configAddOrUpNewData = '/carbon-smart/api/AlarmEnergyConsumptionRule/creatOrUpdate', //配置设备告警添加 修改
configFindById = '/carbon-smart/api/AlarmEquipmentRule/findById', //配置设备告警 查询详情 configFindById = '/carbon-smart/api/AlarmEnergyConsumptionRule/findById', //配置设备告警 查询详情
configDel = '/carbon-smart/api/AlarmEquipmentRule/delete', //配置设备告警删除 configDel = '/carbon-smart/api/AlarmEnergyConsumptionRule/delete', //配置设备告警删除
} }

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

@ -8,6 +8,9 @@ export enum carbonEmissionFactorLibrary {
getCarbonFactorTree = '/carbon-smart/api/carbon/emission/type/getCarbonFactorTree', getCarbonFactorTree = '/carbon-smart/api/carbon/emission/type/getCarbonFactorTree',
creat = '/carbon-smart/api/carbon/emission/type/creatOrUpdate', creat = '/carbon-smart/api/carbon/emission/type/creatOrUpdate',
delTreeNode = '/carbon-smart/api/carbon/emission/type/del', delTreeNode = '/carbon-smart/api/carbon/emission/type/del',
// 单位管理
dictionaryUnitManagement = '/carbon-smart/api/carbon/emission/factor/dictionaryUnitManagement',
findOutermost = '/carbon-smart/api/carbon/emission/factor/findOutermost',
} }
// 碳排管理-碳排统计接口 // 碳排管理-碳排统计接口
export enum energyConsumption { export enum energyConsumption {

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

@ -30,7 +30,9 @@
style="flex: 1; height: 100%; background-color: white; border-radius: 4px; padding: 12px"> style="flex: 1; height: 100%; background-color: white; border-radius: 4px; padding: 12px">
<div ref="echartPieOne" style="width: 100%; height: 100%"></div> <div ref="echartPieOne" style="width: 100%; height: 100%"></div>
</div> </div>
<div style="flex: 1; height: 100%; background-color: white; border-radius: 4px"> xxxx </div> <div style="flex: 1; height: 100%; background-color: white; border-radius: 4px">
<div ref="echartPieTow" style="width: 100%; height: 100%"></div>
</div>
</div> </div>
<!-- 告警矩形 echarts --> <!-- 告警矩形 echarts -->
<div style="flex: 4; width: 100%; background-color: white; border-radius: 4px; padding: 12px"> <div style="flex: 4; width: 100%; background-color: white; border-radius: 4px; padding: 12px">
@ -49,8 +51,10 @@
const info = ref({}); const info = ref({});
let chartInstance: echarts.ECharts | null = null; let chartInstance: echarts.ECharts | null = null;
let chartInstanceOne: echarts.ECharts | null = null; let chartInstanceOne: echarts.ECharts | null = null;
let chartInstanceTow: echarts.ECharts | null = null;
const graphChart = ref(null); const graphChart = ref(null);
const echartPieOne = ref(null); const echartPieOne = ref(null);
const echartPieTow = ref(null);
const getGraphChart = () => { const getGraphChart = () => {
let dayData = []; let dayData = [];
let energyAlarm = []; let energyAlarm = [];
@ -294,7 +298,7 @@
}, },
textAlign: 'center', textAlign: 'center',
x: '44.3%', x: '44.3%',
y: '46%', y: '43%',
}, },
], ],
tooltip: { tooltip: {
@ -327,9 +331,10 @@
clockwise: false, // clockwise: false, //
avoidLabelOverlap: false, avoidLabelOverlap: false,
label: { label: {
show: true,
normal: { normal: {
show: true, show: true,
position: 'outter', position: 'outside',
textStyle: { textStyle: {
fontSize: 14, fontSize: 14,
fontWeight: 'bold', fontWeight: 'bold',
@ -342,7 +347,7 @@
labelLine: { labelLine: {
show: true, // 线 show: true, // 线
length: 10, // 线 length: 10, // 线
length2: 20, // 线 length2: 0, // 线
// lineStyle // lineStyle
}, },
data: m2R2Data, data: m2R2Data,
@ -352,11 +357,107 @@
chartInstanceOne = echarts.init(echartPieOne.value); chartInstanceOne = echarts.init(echartPieOne.value);
chartInstanceOne.setOption(option); chartInstanceOne.setOption(option);
}; };
const getEchartPieTow = () => {
if (chartInstanceTow) {
chartInstanceTow.dispose();
}
chartInstanceTow = echarts.init(echartPieTow.value);
var m2R2Data = [
{ value: 335, name: '紧急', itemStyle: { color: '#F56E53' } },
{ value: 310, name: '重要', itemStyle: { color: '#F7C122' } },
{ value: 234, name: '一般', itemStyle: { color: '#3BC27F' } },
];
const option = {
title: [
{
text: '优先级 / 近30天',
textStyle: {
fontSize: 16,
fontWeight: 'normal',
color: '#aaaaaa',
},
left: '2%',
top: '2%',
},
{
text: '优先级',
subtext: 12312 + '个',
textStyle: {
fontSize: 24,
color: 'black',
},
subtextStyle: {
fontSize: 24,
fontWeight: '700',
color: 'black',
},
textAlign: 'center',
x: '44.3%',
y: '43%',
},
],
tooltip: {
trigger: 'item',
formatter: function (parms) {
var str = parms.marker + ' :' + parms.data.value;
return str;
},
},
legend: {
//
right: 50,
top: 'center',
orient: 'vertical',
//
icon: 'circle',
itemWidth: 12,
itemHeight: 12,
itemGap: 16,
textStyle: {
fontSize: 14,
},
},
series: [
{
name: '优先级',
type: 'pie',
center: ['45%', '50%'],
radius: ['50%', '70%'],
clockwise: false, //
avoidLabelOverlap: false,
label: {
show: true,
normal: {
show: true,
position: 'outside',
textStyle: {
fontSize: 14,
fontWeight: 'bold',
},
formatter: function (parms) {
return '[ ' + parms.data.name + ' ] : ' + parms.data.value;
},
},
},
labelLine: {
show: true, // 线
length: 10, // 线
length2: 0, // 线
// lineStyle
},
data: m2R2Data,
},
],
};
chartInstanceTow = echarts.init(echartPieTow.value);
chartInstanceTow.setOption(option);
};
onMounted(() => { onMounted(() => {
// //
getGraphChart(); getGraphChart();
// //
getEchartPieOne(); getEchartPieOne();
getEchartPieTow();
}); });
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>

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

@ -11,27 +11,23 @@
}" }"
@click="clickSwitch({ enableRules: record.enableRules, record: record })" /> @click="clickSwitch({ enableRules: record.enableRules, record: record })" />
</template> </template>
<template v-if="column.dataIndex === 'equipmentInfo'"> <template v-if="column.dataIndex === 'comparisonType'">
{{ {{ getcomparisonType(record) }}
record?.enableRules
? record.enableRules + '>' + record.deviceType + '>' + record.deviceName
: '-'
}}
</template> </template>
</template> </template>
</ns-view-list-table> </ns-view-list-table>
<!-- 新增or编辑界面 --> <!-- 新增or编辑界面 -->
<editConfigureEnergyAlarm ref="editConfigureEnergyAlarms" /> <editConfigureEnergyAlarm ref="editConfigureEnergyAlarms" @editObject="editObject" />
</template> </template>
<script lang="ts"> <script lang="ts">
import { ref, createVNode } from 'vue'; import { ref, createVNode } from 'vue';
import { http } from '/nerv-lib/util'; import { http } from '/nerv-lib/util';
import data from '../notificationManagementMock.json';
import { NsMessage, NsModal } from '/nerv-lib/component'; import { NsMessage, NsModal } from '/nerv-lib/component';
import editConfigureEnergyAlarm from './editConfigureEnergyAlarm.vue'; import editConfigureEnergyAlarm from './editConfigureEnergyAlarm.vue';
import { deviceAlarms } from '/@/api/alarmSettings/deviceAlarms'; import { energyAlarms } from '/@/api/alarmSettings/energyAlarm';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue'; import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { device } from '/@/api/deviceManage'; import { device } from '/@/api/deviceManage';
import { dict } from '/@/api';
export default { export default {
components: { editConfigureEnergyAlarm }, components: { editConfigureEnergyAlarm },
@ -43,11 +39,37 @@
const tableConfig = ref({}); const tableConfig = ref({});
const mainRef = ref({}); const mainRef = ref({});
const editConfigureEnergyAlarms = ref({}); const editConfigureEnergyAlarms = ref({});
const mockData = ref(data.listData);
// //
const orgId = ref(''); const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!); const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result; orgId.value = result;
//
const getcomparisonType = (data: any) => {
let datas = data.comparisonType.split(',');
if (datas[0] === '1') {
switch (datas[1]) {
case '1':
return '数值>输入数值';
case '2':
return '数值>同比';
case '3':
return '数值>环比';
case '4':
return '数值>对比基准';
}
} else {
switch (datas[1]) {
case '1':
return '比例>输入比例';
case '2':
return '比例>同比';
case '3':
return '比例>环比';
case '4':
return '比例>对比基准';
}
}
};
const clickSwitch = (data: any) => { const clickSwitch = (data: any) => {
NsModal.confirm({ NsModal.confirm({
title: '启用状态', title: '启用状态',
@ -55,7 +77,7 @@
content: '确定' + (data.record.enableRules === 1 ? '关闭' : '启用') + '规则吗?', content: '确定' + (data.record.enableRules === 1 ? '关闭' : '启用') + '规则吗?',
onOk: () => { onOk: () => {
http http
.post(deviceAlarms.addOrUpNewData, { .post(energyAlarms.configAddOrUpNewData, {
id: data.record.id, id: data.record.id,
enableRules: data.record.enableRules === 1 ? 0 : 1, enableRules: data.record.enableRules === 1 ? 0 : 1,
}) })
@ -80,8 +102,7 @@
show.value = true; show.value = true;
tableConfig.value = { tableConfig.value = {
title: '告警规则', title: '告警规则',
api: deviceAlarms.getTableList, api: energyAlarms.configGetTableList,
value: mockData.value,
headerActions: [ headerActions: [
{ {
label: '新增', label: '新增',
@ -120,14 +141,24 @@
label: '批量删除', label: '批量删除',
type: 'primary', type: 'primary',
name: 'userBatchDel', name: 'userBatchDel',
confirm: true,
dynamicDisabled: (data: any) => { dynamicDisabled: (data: any) => {
return data.list.length === 0; return data.list.length === 0;
}, },
confirm: true, handle: (data: any) => {
isReload: true, let ids = [];
isClearCheck: true, data.list.forEach((item) => {
// api: origanizemanage.batchDel, ids.push(item.id);
dynamicParams: { userIds: 'userId[]' }, });
data.list = [];
http.post(energyAlarms.configDel, { ids: ids.toString() }).then(() => {
NsMessage.success('告警规则删除成功');
//
mainRef.value.nsTableRef.clearCheck();
//
mainRef.value?.nsTableRef.reload();
});
},
}, },
], ],
columns: [ columns: [
@ -144,7 +175,7 @@
}, },
{ {
title: '设备信息/节点信息', title: '设备信息/节点信息',
dataIndex: 'equipmentInfo', dataIndex: 'deviceInfo',
}, },
{ {
title: '对比类型', title: '对比类型',
@ -152,11 +183,11 @@
}, },
{ {
title: '告警点位', title: '告警点位',
dataIndex: 'devicePoint', dataIndex: 'devicePointName',
}, },
{ {
title: '判断条件', title: '判断条件',
dataIndex: 'ruleType', dataIndex: 'conditionalJudgment',
}, },
{ {
title: '异常描述', title: '异常描述',
@ -185,8 +216,12 @@
name: 'FeedBackDetail', name: 'FeedBackDetail',
dynamicParams: ['uuid', 'appealType'], dynamicParams: ['uuid', 'appealType'],
confirm: true, confirm: true,
handle: () => { handle: (data: any) => {
// mockData.value.splice(0, 1); http.post(energyAlarms.configDel, { ids: data.id }).then(() => {
NsMessage.success('告警规则删除成功');
//
mainRef.value?.nsTableRef.reload();
});
}, },
}, },
], ],
@ -194,78 +229,106 @@
formConfig: { formConfig: {
title: value.errorCode, title: value.errorCode,
schemas: [ schemas: [
// {
// field: 'deviceNode',
// label: '',
// component: 'nsSelectApi',
// componentProps: {
// api: device.queryDevicePage,
// allowClear: true,
// params: {
// orgId: orgId.value,
// pageNum: 1,
// pageSize: 99,
// },
// placeholder: '',
// resultField: 'data.records',
// labelField: 'deviceName',
// valueField: 'id',
// showSearch: true,
// filterOption: (input: string, option: any) => {
// return option.deviceName.toLowerCase().indexOf(input.toLowerCase()) >= 0;
// },
// // autoAddLink: true, //
// },
// },
{ {
field: 'deviceName', field: 'deviceName',
label: '设备名称', label: '设备信息/节点信息',
component: 'nsSelectApi', component: 'NsInput',
componentProps: { componentProps: {
api: device.queryDevicePage, allowClear: true,
params: { placeholder: '请输入设备信息/节点信息关键字',
orgId: orgId.value,
pageNum: 1,
pageSize: 99,
},
placeholder: '请选择设备名称',
resultField: 'data.records',
labelField: 'deviceName',
valueField: 'id',
autoAddLink: true, //
}, },
}, },
{ {
field: 'devicePoint', field: 'dataSourcesType',
label: '设备点位', label: '告警点位',
component: 'nsSelectApi', component: 'nsSelectApi',
dynamicParams: { // dynamicParams: {
id: 'deviceName', // // id: 'deviceName', //
}, // },
componentProps: { componentProps: {
api: device.queryDevicePoint, api: () => dict({ params: { dicKey: 'ENERGY_TYPE' } }),
resultField: 'data', immediate: true,
placeholder: '请选择设备点位', allowClear: true,
labelField: 'code', labelField: 'cnValue',
valueField: 'id', valueField: 'id',
dependency: 'deviceName', placeholder: '请选择告警点位',
showSearch: true,
filterOption: (input: string, option: any) => {
return option.cnValue.toLowerCase().indexOf(input.toLowerCase()) >= 0;
},
// autoSelectFirst: true,
}, },
}, },
{ {
field: 'payWay', field: 'enableRules',
label: '启用状态', label: '启用状态',
component: 'NsSelect', component: 'NsSelect',
componentProps: { componentProps: {
allowClear: true,
placeholder: '请选择启用状态', placeholder: '请选择启用状态',
options: [ options: [
{ {
label: '启用', label: '启用',
value: '1', value: 1,
}, },
{ {
label: '关闭', label: '关闭',
value: '0', value: 0,
}, },
], ],
}, },
}, },
{ {
field: 'provider', field: 'abnormalDescription',
label: '异常描述', label: '异常描述',
component: 'NsInput', component: 'NsInput',
componentProps: { componentProps: {
allowClear: true,
placeholder: '请输入异常描述关键字', placeholder: '请输入异常描述关键字',
}, },
}, },
], ],
}, },
params: { id: value.id }, params: { equipmentAlarmId: value.id },
// pagination: { pageSizeOptions: false }, // pagination: { pageSizeOptions: false },
rowKey: 'id', rowKey: 'id',
}; };
}; };
//
const editObject = () => {
mainRef.value?.nsTableRef.reload();
};
return { return {
configureEnergyAlarmsData, configureEnergyAlarmsData,
show, show,
clickSwitch, clickSwitch,
doWnload, doWnload,
mainRef,
editObject,
getcomparisonType,
orgId, orgId,
tableConfig, tableConfig,
editConfigureEnergyAlarms, editConfigureEnergyAlarms,

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

@ -27,9 +27,9 @@
}" }"
tree-node-filter-prop="orgName" /> tree-node-filter-prop="orgName" />
</a-form-item> </a-form-item>
<a-form-item label="数据来源" name="sbtype"> <a-form-item label="数据来源" name="dataSources">
<a-cascader <a-cascader
v-model:value="infoObject.sbtype" v-model:value="infoObject.dataSources"
:options="deviceTypeTreeData" :options="deviceTypeTreeData"
:field-names="{ :field-names="{
children: 'children', children: 'children',
@ -45,16 +45,19 @@
v-model:value="infoObject.deviceNode" v-model:value="infoObject.deviceNode"
style="width: 100%" style="width: 100%"
placeholder="请选择设备节点" placeholder="请选择设备节点"
:disabled="!infoObject.sbtype" :disabled="!infoObject.dataSources"
:tree-line="true && { showLeafIcon: false }" :tree-line="true && { showLeafIcon: false }"
:tree-data="jdTreeData" :tree-data="jdTreeData"
:field-names="{ :field-names="{
children: 'children', children: 'children',
label: infoObject.sbtype && infoObject.sbtype[1] === 1 ? 'deviceName' : 'pointName', label:
infoObject.dataSources && infoObject.dataSources[1] === 1
? 'deviceName'
: 'pointName',
value: 'id', value: 'id',
}" /> }" />
</a-form-item> </a-form-item>
<a-form-item label="启用规则" name="enableRules"> <a-form-item label="启用规则">
<a-switch <a-switch
:checked="infoObject.enableRules === 1 ? true : false" :checked="infoObject.enableRules === 1 ? true : false"
:class="{ :class="{
@ -67,6 +70,7 @@
<a-textarea <a-textarea
v-model:value="infoObject.abnormalDescription" v-model:value="infoObject.abnormalDescription"
style="height: 32px" style="height: 32px"
placeholder="请输入异常描述"
:autoSize="{ minRows: 1, maxRows: 1 }" :autoSize="{ minRows: 1, maxRows: 1 }"
show-count show-count
:maxlength="30" /> :maxlength="30" />
@ -152,10 +156,11 @@
deviceNode: null, deviceNode: null,
ruleType: null, ruleType: null,
abnormalDescription: null, abnormalDescription: null,
sbtype: null, dataSources: null,
enableRules: 0, enableRules: 0,
alarmList: [{ id: null, logic: null, num: null, isDelete: 0 }], alarmList: [{ id: null, logic: null, num: null, isDelete: 0 }],
}); });
const emit = defineEmits(['editObject']);
// //
const delAlarmList = ref([]); const delAlarmList = ref([]);
// //
@ -271,19 +276,24 @@
const toggle = async (value: any, info: any) => { const toggle = async (value: any, info: any) => {
// //
let energyType = await dict({ params: { dicKey: 'ENERGY_TYPE' } }); let energyType = await dict({ params: { dicKey: 'ENERGY_TYPE' } });
energyType.data.data.forEach((item: any) => { if (energyType.data.data) {
item.children = [ energyType.data.data.forEach((item: any) => {
{ item.children = [
id: 1, {
cnValue: '设备', id: 1,
}, cnValue: '设备',
{ },
id: 2, {
cnValue: '节点', id: 2,
}, cnValue: '节点',
]; },
}); ];
deviceTypeTreeData.value = energyType.data.data; });
deviceTypeTreeData.value = energyType.data.data;
} else {
deviceTypeTreeData.value = [];
}
// //
energyAlarm.value = info; energyAlarm.value = info;
// //
@ -294,16 +304,29 @@
}); });
// //
if (value) { if (value) {
value.ruleType = value.ruleType + ''; await http.post(energyAlarms.configFindById, { id: value.id }).then((res) => {
value.comparisonType = value.comparisonType.split(','); if (res.msg === 'success') {
value.sbtype = [value.dataSourcesType, value.dataSourcesWay]; infoObject.value = res.data;
delete value.dataSourcesType; //
delete value.dataSourcesWay; infoObject.value.dataSources = [
infoObject.value = value; infoObject.value.dataSourcesType,
/// infoObject.value.dataSourcesWay,
deviceTypeTreeData.value.forEach((item: any) => { ];
if (item.id === infoObject.value.sbtype[0]) { delete infoObject.value.dataSourcesType;
selectDeviceType(infoObject.value.sbtype, [{ ...item }]); delete infoObject.value.dataSourcesWay;
infoObject.value.comparisonType = infoObject.value.comparisonType.split(',');
infoObject.value.ruleType = infoObject.value.ruleType + '';
infoObject.value.alarmList = infoObject.value.hxAlarmRuleLogicList || [];
delete infoObject.value.hxAlarmRuleLogicList;
///
if (deviceTypeTreeData && deviceTypeTreeData.value.length > 0) {
deviceTypeTreeData.value.forEach((item: any) => {
if (item.id === infoObject.value.dataSources[0]) {
selectDeviceType(infoObject.value.dataSources, [{ ...item }]);
}
});
}
} }
}); });
} else { } else {
@ -313,7 +336,7 @@
deviceNode: null, deviceNode: null,
ruleType: null, ruleType: null,
abnormalDescription: null, abnormalDescription: null,
sbtype: null, dataSources: null,
enableRules: 0, enableRules: 0,
alarmList: [{ id: null, logic: null, num: null, isDelete: 0 }], alarmList: [{ id: null, logic: null, num: null, isDelete: 0 }],
}; };
@ -324,8 +347,7 @@
// //
const rules = { const rules = {
site: [{ required: true, message: '请选择站点', trigger: 'change' }], site: [{ required: true, message: '请选择站点', trigger: 'change' }],
sbtype: [{ required: true, message: '请选择设备类型', trigger: 'change' }], dataSources: [{ required: true, message: '请选择设备类型', trigger: 'change' }],
enableRules: [{ required: true, message: '请选择启用规则', trigger: 'change' }],
deviceNode: [{ required: true, message: '请选择设备名称', trigger: 'change' }], deviceNode: [{ required: true, message: '请选择设备名称', trigger: 'change' }],
sbAdress: [{ required: true, message: '请选择设备点位', trigger: 'change' }], sbAdress: [{ required: true, message: '请选择设备点位', trigger: 'change' }],
comparisonType: [{ required: true, message: '请选择对比类型', trigger: 'change' }], comparisonType: [{ required: true, message: '请选择对比类型', trigger: 'change' }],
@ -344,12 +366,9 @@
}, },
}, },
], ],
logic: [{ required: true, message: '请选择逻辑', trigger: 'blur' }],
num: [{ required: true, message: '请输入数值', trigger: 'blur' }],
}; };
// //
const btnClick = () => { const btnClick = () => {
console.log(infoObject.value, '数据');
infoObject.value.alarmList.forEach((item) => { infoObject.value.alarmList.forEach((item) => {
if (item.logic === null || item.num === null) { if (item.logic === null || item.num === null) {
return; return;
@ -361,17 +380,16 @@
} }
// //
formRef.value.validate().then(() => { formRef.value.validate().then(() => {
console.log(energyAlarm.value, '数据');
// //
let data = { ...infoObject.value }; let data = { ...infoObject.value };
//id //id
data.equipmentAlarmId = energyAlarm.value.id; data.equipmentAlarmId = energyAlarm.value.id;
data.errorCode = energyAlarm.value.errorCode; data.errorCode = energyAlarm.value.errorCode;
data.dataSourcesType = data.sbtype[0]; data.dataSourcesType = data.dataSources[0];
data.dataSourcesWay = data.sbtype[1]; data.dataSourcesWay = data.dataSources[1];
delete data.dataSources;
data.hxAlarmRuleLogicList = [...infoObject.value.alarmList, ...delAlarmList.value]; data.hxAlarmRuleLogicList = [...infoObject.value.alarmList, ...delAlarmList.value];
data.comparisonType = data.comparisonType.toString; data.comparisonType = data.comparisonType.toString();
data.hxAlarmRuleLogicList.forEach((item) => { data.hxAlarmRuleLogicList.forEach((item) => {
const num = Number(item.num); const num = Number(item.num);
if (!isNaN(num)) { if (!isNaN(num)) {
@ -382,24 +400,24 @@
}); });
data.ruleType = Number(data.ruleType); data.ruleType = Number(data.ruleType);
delete data.alarmList; delete data.alarmList;
// http http
// .post(energyAlarms.configAddOrUpNewData, data) .post(energyAlarms.configAddOrUpNewData, data)
// .then((res) => { .then((res) => {
// if (res.msg === 'success') { if (res.msg === 'success') {
// // //
// if (data.id) { if (data.id) {
// NsMessage.success(''); NsMessage.success('告警规则编辑成功');
// } else { } else {
// NsMessage.success(''); NsMessage.success('告警规则新增成功');
// } }
// emit('editObject', null); emit('editObject', null);
// handleClose(); handleClose();
// } }
// }) })
// .catch((error) => { .catch((error) => {
// // //
// console.error('', error); console.error('请求失败:', error);
// }); });
}); });
}; };
// //
@ -413,7 +431,7 @@
ruleType: null, ruleType: null,
deviceNode: null, deviceNode: null,
abnormalDescription: null, abnormalDescription: null,
sbtype: null, dataSources: null,
enableRules: 0, enableRules: 0,
alarmList: [{ id: null, logic: null, num: null, isDelete: 0 }], alarmList: [{ id: null, logic: null, num: null, isDelete: 0 }],
}; };

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

@ -188,9 +188,9 @@
name: 'FeedBackDetail', name: 'FeedBackDetail',
dynamicParams: ['uuid', 'appealType'], dynamicParams: ['uuid', 'appealType'],
confirm: true, confirm: true,
handle: () => { handle: (data: any) => {
http.post(deviceAlarms.configDel, { ids: data.id }).then(() => { http.post(deviceAlarms.configDel, { ids: data.id }).then(() => {
NsMessage.success('规则删除成功'); NsMessage.success('告警规则删除成功');
mainRef.value?.nsTableRef.reload(); mainRef.value?.nsTableRef.reload();
}); });
}, },
@ -216,6 +216,10 @@
resultField: 'data.records', resultField: 'data.records',
labelField: 'deviceName', labelField: 'deviceName',
valueField: 'id', valueField: 'id',
showSearch: true,
filterOption: (input: string, option: any) => {
return option.deviceName.toLowerCase().indexOf(input.toLowerCase()) >= 0;
},
autoAddLink: true, // autoAddLink: true, //
}, },
}, },
@ -234,6 +238,10 @@
labelField: 'code', labelField: 'code',
valueField: 'id', valueField: 'id',
dependency: 'deviceName', dependency: 'deviceName',
showSearch: true,
filterOption: (input: string, option: any) => {
return option.code.toLowerCase().indexOf(input.toLowerCase()) >= 0;
},
}, },
}, },
{ {

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

@ -85,6 +85,7 @@
<a-textarea <a-textarea
v-model:value="infoObject.abnormalDescription" v-model:value="infoObject.abnormalDescription"
style="height: 32px" style="height: 32px"
placeholder="请输入异常描述"
:autoSize="{ minRows: 1, maxRows: 1 }" :autoSize="{ minRows: 1, maxRows: 1 }"
show-count show-count
:maxlength="30" /> :maxlength="30" />
@ -323,7 +324,6 @@
delete infoObject.value.hxAlarmRuleLogicList; delete infoObject.value.hxAlarmRuleLogicList;
infoObject.value.deviceType = selectDevice; infoObject.value.deviceType = selectDevice;
infoObject.value.ruleType = infoObject.value.ruleType + ''; infoObject.value.ruleType = infoObject.value.ruleType + '';
console.log(infoObject.value, '数据');
} }
}); });
} else { } else {

10
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/index.vue

@ -40,11 +40,17 @@
</template> </template>
<template v-if="column.dataIndex === 'monitor'"> <template v-if="column.dataIndex === 'monitor'">
{{ {{
record?.monitorTime && record?.monitorTimeUnit record.monitorTime && record.monitorTimeUnit
? record?.monitorTime + '' + record?.monitorTimeUnit ? record.monitorTime + '' + record.monitorTimeUnit.label
: '-' : '-'
}} }}
</template> </template>
<template v-if="column.dataIndex === 'repetition'">
{{ record.repetitions.label }}
</template>
<template v-if="column.dataIndex === 'prioritys'">
{{ record.priority.label }}
</template>
</template> </template>
</ns-view-list-table> </ns-view-list-table>
<a-button <a-button

335
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/index.vue

@ -1,15 +1,15 @@
<template> <template>
<ns-drawer <ns-drawer
v-model:visible="visible" v-model:visible="visible"
width="520" width="600"
:title="' '" :title="'设置通知联系人'"
:ok="btnClick" :ok="btnClick"
:cancel="handleClose" :cancel="handleClose"
placement="right" placement="right"
:footer-style="{ textAlign: 'right' }" :footer-style="{ textAlign: 'right' }"
@close="handleClose"> @close="handleClose">
<div style="padding: 18px; width: 100%; overflow: hidden"> <div style="width: 100%; overflow: hidden; overflow-y: hidden; height: 100%">
<a-form ref="formRef" :model="infoObject" :rules="rules"> <a-form ref="formRef" :model="infoObject" :rules="rules" style="width: 80%">
<a-form-item ref="notification" label="通知方式" name="notification"> <a-form-item ref="notification" label="通知方式" name="notification">
<a-select <a-select
ref="select" ref="select"
@ -22,7 +22,7 @@
placeholder="请选择通知方式" placeholder="请选择通知方式"
:filter-option="filterDevicePoint" /> :filter-option="filterDevicePoint" />
</a-form-item> </a-form-item>
<a-form-item label="启用规则" name="enableRules"> <a-form-item label="启用规则">
<a-switch <a-switch
:checked="infoObject.enableRules === 1 ? true : false" :checked="infoObject.enableRules === 1 ? true : false"
:class="{ :class="{
@ -31,28 +31,57 @@
}" }"
@click="clickSwitch" /> @click="clickSwitch" />
</a-form-item> </a-form-item>
<a-form-item label="通知用户" name="user">
<a-cascader
v-model:value="infoObject.user"
style="width: 100%"
multiple
:max-tag-count="1"
:options="options"
:load-data="loadData"
placeholder="请选择通知用户"
:show-checked-strategy="Cascader.SHOW_CHILD" />
</a-form-item>
</a-form> </a-form>
<a-table :dataSource="dataSource" :columns="columns" :pagination="false" /> <div style="width: 100%; height: 765px; overflow-y: auto">
<div style="margin-bottom: 8px">
<div style="width: 100%; display: flex; position: relative">
<div
style="
border-width: 0px;
position: absolute;
left: 0px;
top: 5px;
width: 5px;
height: 15px;
background: inherit;
background-color: rgba(251, 156, 67, 1);
border: none;
border-radius: 5px;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
"></div>
<span style="margin-left: 24px; color: #333333">联系人名单</span>
</div>
<img
style="width: 100%; margin-top: -10px"
src="https://files.axshare.com/gsc/4T0UQR/7e/5d/a2/7e5da2a277344db8af30521cefeb70cc/images/告警设置/u150.svg?pageId=1f58c1ba-b461-4fe8-a2b3-295f1e7b0aa0" />
</div>
<div style="margin-bottom: 16px">
<a-button type="primary" @click="chengUser">选择联系人 </a-button>
</div>
<a-table
:dataSource="dataSource"
:columns="columns"
:scroll="{ x: 800, y: 700 }"
:pagination="pagination">
<template #bodyCell="{ record, column }">
<template v-if="column.dataIndex === 'operation'">
<a style="color: rgb(210, 0, 5)" @click="remove(record)">移除</a>
</template>
</template>
</a-table>
</div>
</div> </div>
<linkPeople v-show="visibleModel" ref="linkPeoples" @handleCancel="handleCancel" />
</ns-drawer> </ns-drawer>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue'; import { ref } from 'vue';
import { Cascader } from 'ant-design-vue'; // import { NsMessage } from '/nerv-lib/component';
// import { http } from '/nerv-lib/util';
import { NsMessage } from '/nerv-lib/component'; // import { number } from 'vue-types';
import { http } from '/nerv-lib/util'; import linkPeople from './linkPeople/index.vue';
// import { deviceAlarms } from '/@/api/alarmSettings/deviceAlarms'; // import { deviceAlarms } from '/@/api/alarmSettings/deviceAlarms';
@ -61,25 +90,191 @@
{ {
title: '序号', title: '序号',
dataIndex: 'address', dataIndex: 'address',
width: 80,
fixed: 'left',
customRender: (text: any) => { customRender: (text: any) => {
return text.index + 1; return text.index + 1;
}, },
}, },
{ {
title: '通知名单', title: '姓名',
dataIndex: 'name', dataIndex: 'name',
width: 80,
fixed: 'left',
key: 'name', key: 'name',
}, },
];
const dataSource = [
{ {
name: '运维>运维1部>张三', title: '性别',
dataIndex: 'sex',
width: 80,
key: 'sex',
},
{
title: '组织关系',
dataIndex: 'site',
key: 'site',
},
{
title: '部门',
dataIndex: 'department',
key: 'department',
}, },
{ {
name: '运维>运维1部>李四', title: '操作',
width: 80,
dataIndex: 'operation',
fixed: 'right',
}, },
]; ];
const visibleModel = ref(false);
const dataSource = ref([
{
id: 1,
name: '张三1',
sex: '男',
site: '济阳站',
department: '济阳站/产品/产品经理',
},
{
id: 2,
name: '张三2',
sex: '男',
site: '济阳站',
department: '济阳站/产品/产品经理',
},
{
id: 3,
name: '张三3',
sex: '男',
site: '济阳站',
department: '济阳站/产品/产品经理',
},
{
id: 4,
name: '张三',
sex: '男',
site: '济阳站',
department: '济阳站/产品/产品经理',
},
{
id: 5,
name: '张三',
sex: '男',
site: '济阳站',
department: '济阳站/产品/产品经理',
},
{
id: 6,
name: '张三',
sex: '男',
site: '济阳站',
department: '济阳站/产品/产品经理',
},
{
id: 7,
name: '张三',
sex: '男',
site: '济阳站',
department: '济阳站/产品/产品经理',
},
{
id: 8,
name: '张三',
sex: '男',
site: '济阳站',
department: '济阳站/产品/产品经理',
},
{
id: 9,
name: '张三',
sex: '男',
site: '济阳站',
department: '济阳站/产品/产品经理',
},
{
id: 10,
name: '张三',
sex: '男',
site: '济阳站',
department: '济阳站/产品/产品经理',
},
{
id: 11,
name: '张三',
sex: '男',
site: '济阳站',
department: '济阳站/产品/产品经理',
},
{
id: 12,
name: '张三',
sex: '男',
site: '济阳站',
department: '济阳站/产品/产品经理',
},
{
id: 13,
name: '张三',
sex: '男',
site: '济阳站',
department: '济阳站/产品/产品经理',
},
{
id: 14,
name: '张三',
sex: '男',
site: '济阳站',
department: '济阳站/产品/产品经理',
},
{
id: 15,
name: '张三',
sex: '男',
site: '济阳站',
department: '济阳站/产品/产品经理',
},
{
id: 16,
name: '张三',
sex: '男',
site: '济阳站',
department: '济阳站/产品/产品经理',
},
{
id: 17,
name: '张三',
sex: '男',
site: '济阳站',
department: '济阳站/产品/产品经理',
},
]);
const visible = ref(false); const visible = ref(false);
const linkPeoples = ref(null);
const handleChangePage = (current: number, pageSize: number) => {
pagination.value.current = current;
pagination.value.pageSize = pageSize;
};
const pagination = ref({
total: 0,
size: 'small',
current: 1,
pageSize: 10,
showQuickJumper: true,
showLessItems: true,
// showSizeChanger: true,
showTotal: (total: number, range: any) =>
total && range ? `显示第${range[0]}${range[1]}条记录,共 ${total} 条记录` : '',
onChange: handleChangePage,
});
//
const chengUser = () => {
visibleModel.value = true;
linkPeoples.value.getData();
};
//
const handleCancel = () => {
visibleModel.value = false;
};
// //
const infoObject = ref({ const infoObject = ref({
enableRules: 0, enableRules: 0,
@ -101,63 +296,10 @@
{ label: '站内信息', value: 1 }, { label: '站内信息', value: 1 },
{ label: '邮件', value: 2 }, { label: '邮件', value: 2 },
]); ]);
//
const options = ref([
{
value: 1,
label: 'Zhejiang',
isLeaf: false,
},
{
value: 2,
label: 'Jiangsu',
isLeaf: false,
},
]);
//
const loadData = (selectedOptions: any) => {
const targetOption = selectedOptions[selectedOptions.length - 1];
targetOption.loading = true;
// load options lazily
setTimeout(() => {
targetOption.loading = false;
console.log(targetOption, '数据');
targetOption.children = [
{
label: `${targetOption.label} Dynamic 1`,
value: 3,
isLeaf: false,
},
{
label: `${targetOption.label} Dynamic 2`,
value: 4,
isLeaf: false,
},
];
options.value = [...options.value];
}, 1000);
};
const rules = { const rules = {
notification: [{ required: true, message: '请选择站点', trigger: 'change' }], notification: [{ required: true, message: '请选择通知方式', trigger: 'change' }],
enableRules: [{ required: true, message: '请选择启用规则', trigger: 'change' }],
user: [{ required: true, message: '请选择通知人', trigger: 'change' }], user: [{ required: true, message: '请选择通知人', trigger: 'change' }],
abnormalDescription: [
{
required: true,
message: '请输入异常描述',
trigger: 'blur',
validator: (rules: any, abnormalDescription: any, cbfn: any) => {
if (abnormalDescription.trim() !== '') {
cbfn();
} else {
cbfn('告警标题不能为空');
}
},
},
],
alarm: [{ required: true, message: '请选择逻辑', trigger: 'blur' }],
number: [{ required: true, message: '请输入数值', trigger: 'blur' }],
}; };
const formRef = ref(); const formRef = ref();
const emit = defineEmits(['editObject']); const emit = defineEmits(['editObject']);
@ -165,7 +307,9 @@
// //
if (value) { if (value) {
// infoObject.value = value; // infoObject.value = value;
infoObject.value = {}; infoObject.value = {
enableRules: 0,
};
} else { } else {
infoObject.value = { infoObject.value = {
enableRules: 0, enableRules: 0,
@ -173,7 +317,15 @@
} }
visible.value = !visible.value; visible.value = !visible.value;
}; };
//
const remove = (data: any) => {
dataSource.value.forEach((item, index) => {
if (item.id === data.id) {
dataSource.value.splice(index, 1);
}
});
dataSource.value = [...dataSource.value];
};
const btnClick = () => { const btnClick = () => {
console.log(infoObject.value); console.log(infoObject.value);
// //
@ -190,22 +342,13 @@
// //
formRef.value.resetFields(); formRef.value.resetFields();
visible.value = false; visible.value = false;
options.value = [ visibleModel.value = false;
{
value: 'zhejiang',
label: 'Zhejiang',
isLeaf: false,
},
{
value: 'jiangsu',
label: 'Jiangsu',
isLeaf: false,
},
];
}; };
defineExpose({ defineExpose({
toggle, toggle,
handleClose, handleClose,
handleCancel,
handleChangePage,
formRef, formRef,
}); });
</script> </script>
@ -240,7 +383,7 @@
} }
/deep/ .ant-form-item-label { /deep/ .ant-form-item-label {
z-index: 20; z-index: 20;
text-align: right; text-align: left;
width: 23%; width: 20%;
} }
</style> </style>

45
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/linkPeople/index.vue

@ -0,0 +1,45 @@
<template>
<a-modal
v-model:visible="show"
width="1000px"
style="top: 50%; transform: translateY(-50%)"
title="添加联系人"
@ok="handleOk"
@cancel="handleCancel">
<div style="width: 100%; height: 100%">
<p>Some contents...</p>
<p>Some contents...</p>
<p>Some contents...</p>
</div>
</a-modal>
</template>
<script lang="ts">
import { ref } from 'vue';
import { defineComponent } from 'vue';
export default defineComponent({
setup(props, { emit }) {
const handleOk = () => {
//
console.log('点击了确定按钮');
};
const getData = () => {
show.value = true;
};
const show = ref(false);
const handleCancel = () => {
//
console.log('点击了取消按钮');
emit('handleCancel', null);
show.value = false;
};
return {
handleOk,
show,
getData,
handleCancel,
};
},
});
</script>

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

@ -14,7 +14,7 @@ const tableKeyMap = [
}, },
{ {
title: '优先级', title: '优先级',
dataIndex: 'priority', dataIndex: 'prioritys',
}, },
{ {
title: '告警标题', title: '告警标题',
@ -26,8 +26,7 @@ const tableKeyMap = [
}, },
{ {
title: '重复次数', title: '重复次数',
dataIndex: 'repetitions', dataIndex: 'repetition',
textEllipsis: true,
}, },
{ {
title: '监测时长', title: '监测时长',
@ -104,6 +103,9 @@ export const equipmentAlarmTableConfig = (
name: 'FeedBackDetail', name: 'FeedBackDetail',
dynamicParams: ['uuid', 'appealType'], dynamicParams: ['uuid', 'appealType'],
handle: (data: any) => { handle: (data: any) => {
data.priority = data.priority.value;
data.repetitions = data.repetitions.value;
data.monitorTimeUnit = data.monitorTimeUnit.value;
editEquipmentAlarm.value.toggle(data); editEquipmentAlarm.value.toggle(data);
}, },
}, },

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

@ -36,27 +36,31 @@
:expanded-keys="expandedKeys" :expanded-keys="expandedKeys"
:auto-expand-parent="autoExpandParent" :auto-expand-parent="autoExpandParent"
@expand="onExpand"> @expand="onExpand">
<template #title="{ emissionName }"> <template #title="data">
<span v-if="emissionName && selectTreeDataValue && emissionName.indexOf(selectTreeDataValue) > -1"> <div class="treeRow">
{{ emissionName.substring(0, emissionName.indexOf(selectTreeDataValue)) }} <div>
<span style="color: #f50">{{ selectTreeDataValue }}</span> <span v-if="data.emissionName && selectTreeDataValue && data.emissionName.indexOf(selectTreeDataValue) > -1">
{{ emissionName.substring(emissionName.indexOf(selectTreeDataValue) + selectTreeDataValue.length) }} {{ data.emissionName.substring(0, data.emissionName.indexOf(selectTreeDataValue)) }}
</span> <span style="color: #f50" >{{ selectTreeDataValue }}</span>
<span v-else>{{ emissionName }}</span> {{ data.emissionName.substring(data.emissionName.indexOf(selectTreeDataValue) + selectTreeDataValue.length) }}
</template> </span>
</a-tree> <span v-else>{{ data.emissionName }}</span>
<a-popover v-if="showOperation" placement="rightTop" trigger="focus"> </div>
<template #content> <a-popover placement="rightTop" trigger="focus">
<div style="display: flex;flex-direction: column;"> <template #content>
<a-button type="text" @click="editTreeNodeData">编辑</a-button> <div style="display: flex;flex-direction: column;">
<a-button type="text" @click="addTreeNodeData">新增子节点</a-button> <a-button type="text" @click="editTreeNodeData">编辑</a-button>
<a-button type="text">上移</a-button> <a-button type="text" @click="addTreeNodeData">新增子节点</a-button>
<a-button type="text">下移</a-button> <a-button type="text">上移</a-button>
<a-button type="text" @click="deleteTreeNode">删除</a-button> <a-button type="text">下移</a-button>
<a-button type="text" @click="deleteTreeNode">删除</a-button>
</div>
</template>
<MoreOutlined class="actionMore" />
</a-popover>
</div> </div>
</template> </template>
<MoreOutlined style="position: absolute;right: 0;top: 16%;font-size: 25px;cursor: pointer;" /> </a-tree>
</a-popover>
<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>
@ -92,6 +96,66 @@
<a-button type="primary" @click="onEdit">确定</a-button> <a-button type="primary" @click="onEdit">确定</a-button>
</template> </template>
</a-drawer> </a-drawer>
<!-- 单位管理 -->
<a-drawer
:width="500"
:visible="unitManagement"
v-if="unitManagement"
:body-style="{ paddingBottom: '80px' }"
:footer-style="{ textAlign: 'right' }"
destroyOnClose
title="单位管理"
@close="closeUnitManag">
<div class="addButton">
<a-button type="primary">新增分组</a-button>
<a-button type="primary">新增单位</a-button>
</div>
<div class="treePart">
<div style="width: 100%;height: 7%;display: flex;justify-content: center;align-items: center;">
<a-select
ref="select"
:value="unitTreeParams.cnValue"
style="width: 96%"
placeholder="选择分组"
@change="handleChange"
>
<a-select-option v-for="(item, index) in groupData" :key="index" :value="item.cnValue">
{{ item.cnValue }}
</a-select-option>
</a-select>
</div>
<a-tree
:expandedKeys="unitExpandedKeys"
:selectedKeys="unitSelectedKeys"
:tree-data="unitTreeData"
v-if="unitTreeData && unitTreeData.length > 0"
>
<template #title="data">
<div class="treeRow">
<div>
<span>{{ data.cnValue }}</span>
</div>
<a-popover placement="rightTop" trigger="focus">
<template #content>
<div style="display: flex;flex-direction: column;">
<a-button type="text" @click="editTreeNodeData">编辑</a-button>
<a-button type="text" @click="addTreeNodeData">新增子节点</a-button>
<a-button type="text">上移</a-button>
<a-button type="text">下移</a-button>
<a-button type="text" @click="deleteTreeNode">删除</a-button>
</div>
</template>
<MoreOutlined class="actionMore" />
</a-popover>
</div>
</template>
</a-tree>
</div>
<template #footer>
<a-button style="margin-right: 8px" @click="closeUnitManag">取消</a-button>
<a-button type="primary" @click="onEdit">确定</a-button>
</template>
</a-drawer>
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
@ -107,7 +171,7 @@
AntTreeNodeDropEvent, AntTreeNodeDropEvent,
TreeProps, TreeProps,
} from 'ant-design-vue/es/tree'; } from 'ant-design-vue/es/tree';
import { log } from 'node:console'; import { log } from 'node:console';
defineOptions({ name: 'OrderListIndex' }); defineOptions({ name: 'OrderListIndex' });
const selectTreeDataValue = ref<string>(''); const selectTreeDataValue = ref<string>('');
@ -116,6 +180,7 @@ import { log } from 'node:console';
let formData = ref({}); let formData = ref({});
const formRef = ref(); const formRef = ref();
const visible = ref(false); const visible = ref(false);
const unitManagement = ref(false);
const searchValue = ref<string>(''); const searchValue = ref<string>('');
const searchValue2 = ref<string>(''); const searchValue2 = ref<string>('');
const disabled = ref(false); const disabled = ref(false);
@ -428,7 +493,9 @@ import { log } from 'node:console';
formData.value = {}; formData.value = {};
userAuthList.value.splice(0); userAuthList.value.splice(0);
}; };
const closeUnitManag = () => {
unitManagement.value = false;
};
const onEdit = () => { const onEdit = () => {
formRef.value?.triggerSubmit().then(() => { formRef.value?.triggerSubmit().then(() => {
console.log(formData.value, 'formData.value'); console.log(formData.value, 'formData.value');
@ -497,6 +564,20 @@ import { log } from 'node:console';
api: carbonEmissionFactorLibrary.del, api: carbonEmissionFactorLibrary.del,
dynamicParams: { ids: 'id[]' }, dynamicParams: { ids: 'id[]' },
}, },
{
label: '单位管理',
type: 'primary',
name: 'userAdd',
handle: () => {
unitManagement.value = true,
fetch(carbonEmissionFactorLibrary.findOutermost).then((res) => {
groupData.value = res.data
});
fetch(carbonEmissionFactorLibrary.dictionaryUnitManagement, unitTreeParams.value).then((res) => {
unitTreeData.value = res.data
});
},
},
], ],
columns: [ columns: [
{ {
@ -679,6 +760,22 @@ import { log } from 'node:console';
// pagination: { defaultPageSize: 10 }, // pagination: { defaultPageSize: 10 },
rowKey: 'id', rowKey: 'id',
}); });
//
const unitExpandedKeys = ref<string[]>();
const unitSelectedKeys = ref<string[]>([]);
const unitTreeParams = ref({
grp: 'MEASUREMENT_UNIT'
})
const groupData = ref([])
const unitTreeData = ref<TreeProps['treeData']>(genData);
const handleChange = (value: string) => {
unitTreeParams.value.cnValue = value
fetch(carbonEmissionFactorLibrary.dictionaryUnitManagement, unitTreeParams.value).then((res) => {
unitTreeData.value = res.data
});
};
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.main { .main {
@ -696,7 +793,6 @@ import { log } from 'node:console';
// box-shadow: @ns-content-box-shadow; // box-shadow: @ns-content-box-shadow;
flex: 1; flex: 1;
} }
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.top{ .top{
@ -727,4 +823,34 @@ import { log } from 'node:console';
padding-bottom: 10px; padding-bottom: 10px;
border-bottom: 1px solid #e9e9e9; border-bottom: 1px solid #e9e9e9;
} }
.treeRow {
display: flex;
justify-content: space-between;
align-items: center;
}
.addButton{
width: 70%;
height: 5vh;
display: flex;
align-items: center;
justify-content: space-evenly;
}
.treePart{
width: 70%;
height: 100%;
display: flex;
border: 1px solid #bfbfbf;
margin-left: 10%;
flex-direction: column;
}
.actionMore {
display: none;
}
:deep(.ant-tree-node-content-wrapper) {
&:hover {
.actionMore {
display: block;
}
}
}
</style> </style>

42
hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/config.ts

@ -77,4 +77,46 @@ export const tableColumns = [
key: 'action', key: 'action',
width: 130 width: 130
}, },
];
export const columns = [
{
title: '序号',
customRender: (text: any) => {
return text.index + 1;
},
},
{
title: '因子值',
dataIndex: 'energyType',
},
{
title: '计量单位',
className: 'unit',
dataIndex: 'unit',
},
{
title: '更新时间',
className: 'unit',
dataIndex: 'unit',
},
{
title: '启用时间',
className: 'unit',
dataIndex: 'unit',
},
{
title: '结束时间',
className: 'unit',
dataIndex: 'unit',
},
{
title: '数据来源',
className: 'unit',
dataIndex: 'unit',
},
{
title: '操作',
key: 'action',
width: 130
},
]; ];

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

@ -0,0 +1,401 @@
<!-- @format -->
<template>
<div class="main">
<div class="left">
<div class="top">
<a-form style="width: 100%;margin: 0 auto;">
<div class="ns-form-title"><span>排放分类</span></div>
<div style="padding: 0 16px !important;width: 100%;">
<a-row>
<a-col :span="24" style="margin-bottom: 16px;">
<a-input-search
v-model:value="selectTreeDataValue"
placeholder="请输入关键词"
@search="onSearchTreeData"
/>
</a-col>
</a-row>
</div>
</a-form>
<a-tree
v-if="gData && gData.length > 0"
class="draggable-tree"
style="padding: 0 16px !important;"
show-line
block-node
:tree-data="gData"
:checkedKeys="checkedTreeNodeKeys"
:selectedKeys="selectedKeys"
@check="checkTreeNode"
@select="onSelect"
:expanded-keys="expandedKeys"
:auto-expand-parent="autoExpandParent"
@expand="onExpand">
<template #title="{ emissionName }">
<span v-if="emissionName && selectTreeDataValue && emissionName.indexOf(selectTreeDataValue) > -1">
{{ emissionName.substring(0, emissionName.indexOf(selectTreeDataValue)) }}
<span style="color: #f50">{{ selectTreeDataValue }}</span>
{{ emissionName.substring(emissionName.indexOf(selectTreeDataValue) + selectTreeDataValue.length) }}
</span>
<span v-else>{{ emissionName }}</span>
</template>
</a-tree>
</div>
</div>
<div class="right">
<a-table :columns="columns" :data-source="tableData" bordered :pagination="false">
<template #bodyCell="{ column, text }">
<template v-if="column.dataIndex === 'name'">
<a>{{ text }}</a>
</template>
</template>
<template #title>Header</template>
</a-table>
</div>
<!-- 新增树节点 -->
<ns-modal :visible="treeNodeAdd" :title="operationTree" @ok="handleOk" @cancel="handleCancel">
<ns-input
v-model:value="addTreeNode"
class="input"
placeholder="请输入排放类型"/>
</ns-modal>
<!-- 新增数据库数据 -->
<a-drawer
:width="500"
:visible="visible"
:body-style="{ paddingBottom: '80px' }"
:footer-style="{ textAlign: 'right' }"
destroyOnClose
@close="onClose">
<ns-form
ref="formRef"
:model="formData"
class="form"
:wrapperCol="{ span: 20 }"
formLayout="vertical" />
<template #footer>
<a-button style="margin-right: 8px" @click="onClose">取消</a-button>
<a-button type="primary" @click="onEdit">确定</a-button>
</template>
</a-drawer>
</div>
</template>
<script lang="ts" setup>
import { Modal } from 'ant-design-vue';
import { computed, createVNode, defineComponent, reactive, ref, watchEffect,watch } from 'vue';
import { http } from '/nerv-lib/util/http';
import { NsMessage, NsModal } from '/nerv-lib/component';
import { carbonEmissionFactorLibrary } from '/@/api/carbonEmissionFactorLibrary';
import type {
AntTreeNodeDragEnterEvent,
AntTreeNodeDropEvent,
TreeProps,
} from 'ant-design-vue/es/tree';
import { log } from 'node:console';
defineOptions({ name: 'QuickCalculation' });
const selectTreeDataValue = ref<string>('');
const data = reactive({});
let formData = ref({});
const formRef = ref();
const visible = ref(false);
const searchValue = ref<string>('');
const searchValue2 = ref<string>('');
const disabled = ref(false);
const treeNodeAdd = ref<boolean>(false);
const operationTree = ref<string>('新增');
const opMap: any = ref({
type: 'add',
fuc: () => {},
record: {},
});
watchEffect(() => {
disabled.value = opMap.value.type === 'edit';
});
const casData = ref([]);
const treeData = ref([]);
const userAuthList = ref([]);
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
const dynamicDisabled = computed(() => {
return formRef.value?.validateResult && userAuthList.value?.length;
});
const fetch = (api, params = { orgId }) => {
return http.post(api, params);
};
//
const x = 3;
const y = 2;
const z = 1;
const genData: TreeProps['treeData'] = [];
const generateData = (_level: number, _preKey?: string, _tns?: TreeProps['treeData']) => {
const preKey = _preKey || '0';
const tns = _tns || genData;
const children = [];
for (let i = 0; i < x; i++) {
const key = `${preKey}-${i}`;
tns.push({ title: key, key });
if (i < y) {
children.push(key);
}
}
if (_level < 0) {
return tns;
}
const level = _level - 1;
children.forEach((key, index) => {
tns[index].children = [];
return generateData(level, key, tns[index].children);
});
};
generateData(z);
type TreeDataItem = TreeProps['treeData'][number];
const gData = ref<TreeProps['treeData']>(genData);
const dataList: TreeProps['treeData'] = [];
const generateList = (data: TreeProps['treeData']) => {
for (let i = 0; i < data.length; i++) {
const node = data[i];
const key = node.key;
dataList.push({ key, title: key });
if (node.children) {
generateList(node.children);
}
}
};
generateList(genData);
const getParentKey = (
key: string | number,
tree: TreeProps['treeData'],
): string | number | undefined => {
let parentKey;
for (let i = 0; i < tree.length; i++) {
const node = tree[i];
if (node.children) {
if (node.children.some(item => item.key === key)) {
parentKey = node.key;
} else if (getParentKey(key, node.children)) {
parentKey = getParentKey(key, node.children);
}
}
}
return parentKey;
};
const expandedKeys = ref<(string | number)[]>([]);
const autoExpandParent = ref<boolean>(true);
const onExpand = (keys: string[]) => {
expandedKeys.value = keys;
autoExpandParent.value = false;
};
watch(selectTreeDataValue, value => {
const expanded = dataList
.map((item: TreeProps['treeData'][number]) => {
if (item.title.indexOf(value) > -1) {
return getParentKey(item.key, gData.value);
}
return null;
})
.filter((item, i, self) => item && self.indexOf(item) === i);
expandedKeys.value = expanded;
selectTreeDataValue.value = value;
autoExpandParent.value = true;
});
//
const onSearchTreeData = (selectTreeDataValue: string) => {
console.log('use value', selectTreeDataValue);
console.log('or use this.value', value.value);
};
//
const checkedIds = ref([])
const emissionType = ref()
const checkTreeNode = (checkedKeys, info) => {
checkedIds.value = []
info.checkedNodes.forEach(item=>{
checkedIds.value.push(item.id)
})
sessionStorage.setItem('checkedTreeNode', checkedIds.value);
emissionType.value = checkedIds.value.join(',')
}
// /
const addTreeNode =ref()
const handleOk = (e: MouseEvent) => {
editTreeNode.value.emissionName = addTreeNode.value
http.post(carbonEmissionFactorLibrary.creat,editTreeNode.value).then(() => {
getOrgTree()
NsMessage.success('操作成功');
addTreeNode.value = ''
treeNodeAdd.value = false;
});
};
const handleCancel = () => {
addTreeNode.value = ''
treeNodeAdd.value = false;
};
//
const getOrgTree = (params?) => {
fetch(carbonEmissionFactorLibrary.getCarbonFactorTree, params).then((res) => {
gData.value = res.data
//
const selectedNodes = [];
checkedTreeNodeKeys.value.forEach(key => {
const [parentId, childId] = key.split('-').map(Number);
if (parentId >= 0 && childId >= 0 && gData.value[parentId]?.children?.[childId]) {
selectedNodes.push(gData.value[parentId]);
}
});
});
};
getOrgTree();
//
const editTreeNode = ref({})
const onSelect = (selectedKeys: string[], info: any) => {
if(info.selected){
editTreeNode.value = {
id:info.selectedNodes[0].id,
level:info.selectedNodes[0].level,
dataNumber:info.selectedNodes[0].dataNumber,
sortNumber:info.selectedNodes[0].sortNumber,
parentEmissionId:info.selectedNodes[0].parentEmissionId,
}
}
};
const onSearch = () => {
console.log(searchValue.value);
getOrgTree({ orgName: searchValue.value, orgId });
};
const tableFetch = (params) => {
console.log(params, 'sdfasfasdfasdfasdf');
setTimeout(() => {
mainRef.value?.nsTableRef.reload();
}, 100);
};
const handleSelect = (selectedKeys: any, info: any) => {
fetch(carbonEmissionFactorLibrary.queryDeptTree, { orgId: info.node?.orgInfo.orgId }).then((res) => {
treeData2.value = res.data;
});
tableFetch({ orgId: info.node?.orgInfo.orgId });
};
const columns = [
{
title: 'Name',
dataIndex: 'name',
},
{
title: 'Cash Assets',
className: 'column-money',
dataIndex: 'money',
},
{
title: 'Address',
dataIndex: 'address',
},
];
const tableData = [
{
key: '1',
name: 'John Brown',
money: '¥300,000.00',
address: 'New York No. 1 Lake Park',
},
{
key: '2',
name: 'Jim Green',
money: '¥1,256,000.00',
address: 'London No. 1 Lake Park',
},
{
key: '3',
name: 'Joe Black',
money: '¥120,000.00',
address: 'Sidney No. 1 Lake Park',
},
];
const onClose = () => {
visible.value = false;
formData.value = {};
userAuthList.value.splice(0);
};
const onEdit = () => {
formRef.value?.triggerSubmit().then(() => {
console.log(formData.value, 'formData.value');
// if (!userAuthList.value.length) {
// NsMessage.error('');
// return;
// }
opMap.value.fuc &&
opMap.value.fuc({ ...formData.value });
});
};
</script>
<style lang="less" scoped>
.main {
background-color: @ns-content-bg;
display: flex;
height: 100%;
}
.left {
width: 300px;
// max-height: calc(100vh - 96px);
margin-right: @ns-gap;
min-width: fit-content;
> div {
background-color: @white;
// box-shadow: @ns-content-box-shadow;
flex: 1;
}
display: flex;
flex-direction: column;
.top{
position: relative;
.addTreeNode{
width: 100%;
padding: 16px;
position: absolute;
bottom: 0;
}
}
}
.right {
flex: 1;
min-width: 0;
}
::v-deep .ant-table-container{
padding: 0px 16px;
}
.top {
overflow: auto;
// height: 50%;
// border-bottom: 5px solid rgb(229, 235, 240);
// overflow-y: auto;
}
.ns-form-title{
font-weight: bold;
user-select: text;
padding: 16px;
margin-bottom: 16px;
padding-bottom: 10px;
border-bottom: 1px solid #e9e9e9;
}
</style>
<style scoped>
th.column-money,
td.column-money {
text-align: right !important;
}
</style>

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

@ -1,16 +1,14 @@
<!-- @format -->
<template> <template>
<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"><span>排放分类</span></div> <div class="ns-form-title"><span>因子分类</span></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="searchValue"
placeholder="请输入关键词" placeholder="请输入关键词"
@search="onSearchTreeData" @search="onSearchTreeData"
/> />
@ -19,118 +17,129 @@
</div> </div>
</a-form> </a-form>
<a-tree <a-tree
v-if="gData && gData.length > 0"
class="draggable-tree"
style="padding: 0 16px !important;"
draggable
show-line
checkable
block-node
:tree-data="gData"
:checkedKeys="checkedTreeNodeKeys"
:selectedKeys="selectedKeys"
@dragenter="onDragEnter"
@drop="onDrop"
@check="checkTreeNode"
@select="onSelect"
:expanded-keys="expandedKeys" :expanded-keys="expandedKeys"
:auto-expand-parent="autoExpandParent" :auto-expand-parent="autoExpandParent"
@expand="onExpand"> :tree-data="gData"
<template #title="{ emissionName }"> @expand="onExpand"
<span v-if="emissionName && selectTreeDataValue && emissionName.indexOf(selectTreeDataValue) > -1"> style="padding: 0 16px !important;"
{{ emissionName.substring(0, emissionName.indexOf(selectTreeDataValue)) }} >
<span style="color: #f50">{{ selectTreeDataValue }}</span> <template #title="{ title }">
{{ emissionName.substring(emissionName.indexOf(selectTreeDataValue) + selectTreeDataValue.length) }} <span v-if="title.indexOf(searchValue) > -1">
{{ title.substring(0, title.indexOf(searchValue)) }}
<span style="color: #f50">{{ searchValue }}</span>
{{ title.substring(title.indexOf(searchValue) + searchValue.length) }}
</span> </span>
<span v-else>{{ emissionName }}</span> <span v-else>{{ title }}</span>
</template> </template>
</a-tree> </a-tree>
</div> </div>
</div> </div>
<div class="right"> <div class="right">
<ns-view-list-table v-bind="tableConfig" :model="data" ref="mainRef" :scroll="{ x: 2000}"/> <a-table
:columns="columns"
:data-source="tableData"
bordered
:pagination="false">
<template #bodyCell="{ column, text, record }">
<template v-if="column.key === 'action'">
<span>
<a @click="editData(record)">编辑</a>
<a-divider type="vertical" />
<a @click="delData(record)">删除</a>
</span>
</template>
</template>
<template #title>
<div class="ns-table-title"><span>排放因子库</span></div>
<div class="buttonGroup">
<a-button type="primary" @click="addNewData">新增</a-button>
</div>
</template>
</a-table>
<a-pagination
:current="queryParams.pageNum"
:total="total"
:page-size="queryParams.pageSize"
style="display: flex;justify-content: center;margin-top: 16px;"
:show-size-changer="true"
:show-quick-jumper="true"
@change="onChange" />
<!-- 新增/编辑 -->
<a-drawer
:width="500"
:visible="visible"
:body-style="{ paddingBottom: '80px' }"
:footer-style="{ textAlign: 'right' }"
destroyOnClose
@close="onClose">
<a-form
ref="formRef"
:model="formState"
:rules="rules"
:label-col="labelCol"
:wrapper-col="wrapperCol"
>
<a-form-item ref="name" label="能源种类" name="energyType">
<a-input v-model:value="formState.energyType" placeholder="请输入能源种类" />
</a-form-item>
<a-form-item label="计量单位" name="unit">
<a-cascader v-model:value="formState.unit" :options="options" />
</a-form-item>
<a-form-item label="自动采集节点" name="collectionNode">
<a-tree-select
v-model:value="formState.collectionNode"
:tree-line="true"
:tree-data="treeData"
tree-node-filter-prop="title"
>
</a-tree-select>
</a-form-item>
<a-form-item label="计算碳排" name="isComputeCarbon">
<a-radio-group v-model:value="formState.isComputeCarbon" @change="changeRadio">
<a-radio :value="0"></a-radio>
<a-radio :value="1"></a-radio>
</a-radio-group>
</a-form-item>
<a-form-item label="排放类型" name="emissionType">
<a-select v-model:value="formState.emissionType" placeholder="请选择排放类型">
<a-select-option v-for="(item, index) in emissionTypeDic" :key="index" :value="item.cnValue">
{{ item.cnValue }}
</a-select-option>
</a-select>
</a-form-item>
</a-form>
<template #footer>
<a-button style="margin-right: 8px" @click="onClose">取消</a-button>
<a-button type="primary" @click="onSubmit">确定</a-button>
</template>
</a-drawer>
</div> </div>
<!-- 新增树节点 -->
<ns-modal :visible="treeNodeAdd" :title="operationTree" @ok="handleOk" @cancel="handleCancel">
<ns-input
v-model:value="addTreeNode"
class="input"
placeholder="请输入排放类型"/>
</ns-modal>
<!-- 新增数据库数据 -->
<a-drawer
:width="500"
:visible="visible"
:body-style="{ paddingBottom: '80px' }"
:footer-style="{ textAlign: 'right' }"
destroyOnClose
@close="onClose">
<ns-form
ref="formRef"
:model="formData"
class="form"
:wrapperCol="{ span: 20 }"
formLayout="vertical" />
<template #footer>
<a-button style="margin-right: 8px" @click="onClose">取消</a-button>
<a-button type="primary" @click="onEdit">确定</a-button>
</template>
</a-drawer>
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { Modal } from 'ant-design-vue'; import { ref, watch } from 'vue';
import { computed, createVNode, defineComponent, reactive, ref, watchEffect,watch } from 'vue'; import type { TreeProps } from 'ant-design-vue';
import { Pagination } from 'ant-design-vue';
import { columns } from '../config';
import { http } from '/nerv-lib/util/http'; import { http } from '/nerv-lib/util/http';
import { NsMessage, NsModal } from '/nerv-lib/component'; defineOptions({
import { carbonEmissionFactorLibrary } from '/@/api/carbonEmissionFactorLibrary'; energyType: 'quickCalculation', // name
import type { components: {
AntTreeNodeDragEnterEvent, 'a-pagination': Pagination,
AntTreeNodeDropEvent, },
TreeProps,
} from 'ant-design-vue/es/tree';
import { log } from 'node:console';
defineOptions({ name: 'QuickCalculation' });
const selectTreeDataValue = ref<string>('');
const mainRef = ref();
const data = reactive({});
let formData = ref({});
const formRef = ref();
const visible = ref(false);
const searchValue = ref<string>('');
const searchValue2 = ref<string>('');
const disabled = ref(false);
const treeNodeAdd = ref<boolean>(false);
const operationTree = ref<string>('新增');
const opMap: any = ref({
type: 'add',
fuc: () => {},
record: {},
});
watchEffect(() => {
disabled.value = opMap.value.type === 'edit';
}); });
const casData = ref([]);
const treeData = ref([]);
const userAuthList = ref([]);
const orgId = ref(''); const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!); const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result; orgId.value = result;
const dynamicDisabled = computed(() => { const fetch = (api, params = { orgId } ) => {
return formRef.value?.validateResult && userAuthList.value?.length;
});
const fetch = (api, params = { orgId }) => {
return http.post(api, params); return http.post(api, params);
}; };
//
//
const x = 3; const x = 3;
const y = 2; const y = 2;
const z = 1; const z = 1;
const genData: TreeProps['treeData'] = []; const genData: TreeProps['treeData'] = [];
const checkedTreeNodeKeys = ref<string[]>(['0-0']);
const generateData = (_level: number, _preKey?: string, _tns?: TreeProps['treeData']) => { const generateData = (_level: number, _preKey?: string, _tns?: TreeProps['treeData']) => {
const preKey = _preKey || '0'; const preKey = _preKey || '0';
@ -154,70 +163,7 @@ import { log } from 'node:console';
}); });
}; };
generateData(z); generateData(z);
type TreeDataItem = TreeProps['treeData'][number];
const gData = ref<TreeProps['treeData']>(genData);
const onDragEnter = (info: AntTreeNodeDragEnterEvent) => {
console.log(info);
// expandedKeys
// expandedKeys.value = info.expandedKeys;
};
const onDrop = (info: AntTreeNodeDropEvent) => {
console.log(info);
const dropKey = info.node.key;
const dragKey = info.dragNode.key;
const dropPos = info.node.pos.split('-');
const dropPosition = info.dropPosition - Number(dropPos[dropPos.length - 1]);
const loop = (data: TreeProps['treeData'], key: string | number, callback: any) => {
data.forEach((item, index) => {
if (item.key === key) {
return callback(item, index, data);
}
if (item.children) {
return loop(item.children, key, callback);
}
});
};
const data = [...gData.value];
// Find dragObject
let dragObj: TreeDataItem;
loop(data, dragKey, (item: TreeDataItem, index: number, arr: TreeProps['treeData']) => {
arr.splice(index, 1);
dragObj = item;
});
if (!info.dropToGap) {
// Drop on the content
loop(data, dropKey, (item: TreeDataItem) => {
item.children = item.children || [];
/// where to insert
item.children.unshift(dragObj);
});
} else if (
(info.node.children || []).length > 0 && // Has children
info.node.expanded && // Is expanded
dropPosition === 1 // On the bottom gap
) {
loop(data, dropKey, (item: TreeDataItem) => {
item.children = item.children || [];
// where to insert
item.children.unshift(dragObj);
});
} else {
let ar: TreeProps['treeData'] = [];
let i = 0;
loop(data, dropKey, (_item: TreeDataItem, index: number, arr: TreeProps['treeData']) => {
ar = arr;
i = index;
});
if (dropPosition === -1) {
ar.splice(i, 0, dragObj);
} else {
ar.splice(i + 1, 0, dragObj);
}
}
gData.value = data;
};
const dataList: TreeProps['treeData'] = []; const dataList: TreeProps['treeData'] = [];
const generateList = (data: TreeProps['treeData']) => { const generateList = (data: TreeProps['treeData']) => {
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
@ -249,13 +195,16 @@ import { log } from 'node:console';
return parentKey; return parentKey;
}; };
const expandedKeys = ref<(string | number)[]>([]); const expandedKeys = ref<(string | number)[]>([]);
const searchValue = ref<string>('');
const autoExpandParent = ref<boolean>(true); const autoExpandParent = ref<boolean>(true);
const gData = ref<TreeProps['treeData']>(genData);
const onExpand = (keys: string[]) => { const onExpand = (keys: string[]) => {
expandedKeys.value = keys; expandedKeys.value = keys;
autoExpandParent.value = false; autoExpandParent.value = false;
}; };
watch(selectTreeDataValue, 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) {
@ -265,273 +214,64 @@ import { log } from 'node:console';
}) })
.filter((item, i, self) => item && self.indexOf(item) === i); .filter((item, i, self) => item && self.indexOf(item) === i);
expandedKeys.value = expanded; expandedKeys.value = expanded;
selectTreeDataValue.value = value; searchValue.value = value;
autoExpandParent.value = true; autoExpandParent.value = true;
}); });
// //
const onSearchTreeData = (selectTreeDataValue: string) => { const total = ref<number>()
console.log('use value', selectTreeDataValue); const queryParams = ref({
console.log('or use this.value', value.value); pageNum: 1,
}; pageSize: 10,
// })
const checkedIds = ref([]) const tableData = [
const emissionType = ref() {
const checkTreeNode = (checkedKeys, info) => { key: '1',
checkedTreeNodeKeys.value = checkedKeys name: 'John Brown',
checkedIds.value = [] money: '¥300,000.00',
info.checkedNodes.forEach(item=>{ address: 'New York No. 1 Lake Park',
checkedIds.value.push(item.id) },
}) {
sessionStorage.setItem('checkedTreeNode', checkedIds.value); key: '2',
emissionType.value = checkedIds.value.join(',') name: 'Jim Green',
mainRef.value?.nsTableRef.reload(); money: '¥1,256,000.00',
} address: 'London No. 1 Lake Park',
// / },
const addTreeNode =ref() {
const handleOk = (e: MouseEvent) => { key: '3',
editTreeNode.value.emissionName = addTreeNode.value name: 'Joe Black',
http.post(carbonEmissionFactorLibrary.creat,editTreeNode.value).then(() => { money: '¥120,000.00',
getOrgTree() address: 'Sidney No. 1 Lake Park',
NsMessage.success('操作成功'); },
addTreeNode.value = '' ];
treeNodeAdd.value = false; //
}); const onChange = (pageNumber: number,size: number) => {
}; queryParams.value.pageNum = pageNumber;
const handleCancel = () => { queryParams.value.pageSize = size;
addTreeNode.value = '' // getTableList()
treeNodeAdd.value = false;
};
//
const getOrgTree = (params?) => {
fetch(carbonEmissionFactorLibrary.getCarbonFactorTree, params).then((res) => {
gData.value = res.data
//
const selectedNodes = [];
checkedTreeNodeKeys.value.forEach(key => {
const [parentId, childId] = key.split('-').map(Number);
if (parentId >= 0 && childId >= 0 && gData.value[parentId]?.children?.[childId]) {
selectedNodes.push(gData.value[parentId]);
}
});
// id
getDefaultIds(selectedNodes)
});
};
const defaultIds = ref([])
const getDefaultIds = (selectedNodes) => {
selectedNodes.forEach(items => {
defaultIds.value.push(items.id)
if(items.children){
getDefaultIds(items.children)
}
})
emissionType.value = defaultIds.value.join(',')
checkedIds.value = defaultIds.value
sessionStorage.setItem('checkedTreeNode', checkedIds.value);
}
getOrgTree();
//
const editTreeNode = ref({})
const onSelect = (selectedKeys: string[], info: any) => {
if(info.selected){
editTreeNode.value = {
id:info.selectedNodes[0].id,
level:info.selectedNodes[0].level,
dataNumber:info.selectedNodes[0].dataNumber,
sortNumber:info.selectedNodes[0].sortNumber,
parentEmissionId:info.selectedNodes[0].parentEmissionId,
}
}
};
const onSearch = () => {
console.log(searchValue.value);
getOrgTree({ orgName: searchValue.value, orgId });
}; };
// /
const tableFetch = (params) => { const formRef = ref();
console.log(params, 'sdfasfasdfasdfasdf'); const labelCol = { span: 5 };
const wrapperCol = { span: 19 };
tableConfig.value.params = { const formState = ref({})
...mainRef.value.params, const visible = ref(false);
...params,
}; // form
const rules: Record<string, Rule[]> = {
setTimeout(() => { energyType: [{ required: true, message: '请输入能源种类', trigger: 'change' }],
mainRef.value?.nsTableRef.reload(); isComputeCarbon: [{ required: true, message: '请选择是否计算碳排', trigger: 'change' }]
}, 100);
}; };
//
const handleSelect = (selectedKeys: any, info: any) => { const editData = (record) =>{
fetch(carbonEmissionFactorLibrary.queryDeptTree, { orgId: info.node?.orgInfo.orgId }).then((res) => { visible.value = true
treeData2.value = res.data;
});
tableFetch({ orgId: info.node?.orgInfo.orgId });
}; };
//
const onClose = () => { const onClose = () => {
visible.value = false; visible.value = false;
formData.value = {}; formRef.value.resetFields();
userAuthList.value.splice(0);
}; };
const onEdit = () => {
formRef.value?.triggerSubmit().then(() => {
console.log(formData.value, 'formData.value');
// if (!userAuthList.value.length) {
// NsMessage.error('');
// return;
// }
opMap.value.fuc &&
opMap.value.fuc({ ...formData.value });
});
};
const tableConfig = ref({
title: '数据库',
api: carbonEmissionFactorLibrary.getTableList,
params: {
orgId,
emissionType
},
headerActions: [
{
label: '新增',
name: 'userAdd',
type: 'primary',
handle: () => {
opMap.value.type = 'add';
setTimeout(() => {
formData.value = {
carbonEmissionPrefix:'t',
numberOfReferences:'10'
};
userAuthList.value.splice(0);
});
opMap.value.fuc = (formData: any) => {
formData.emissionType = formData.emissionType[formData.emissionType.length - 1]
return http.post(carbonEmissionFactorLibrary.creatOrUpdate, formData).then(() => {
mainRef.value?.nsTableRef.reload();
visible.value = false;
NsMessage.success('操作成功');
});
};
visible.value = true;
},
},
{
label: '导入',
type: 'primary',
name: 'userImport',
handle: () => {},
},
{
label: '导出',
type: 'primary',
name: 'userExports',
},
{
label: '批量删除',
type: 'primary',
name: 'userBatchDel',
dynamicDisabled: (data: any) => {
return data.list.length === 0;
},
confirm: true,
isReload: true,
isClearCheck: true,
api: carbonEmissionFactorLibrary.del,
dynamicParams: { ids: 'id[]' },
},
],
columns: [
{
title: 'id',
customRender: (text: any) => {
return text.index + 1;
},
},
{
title: '排放源',
dataIndex: 'emissionSources',
},
{
title: '排放类型',
dataIndex: 'emissionTypeColumn',
},
{
title: '排放气体',
dataIndex: 'emissionGas',
},
{
title: '排放环节',
dataIndex: 'emissionProcess',
},
{
title: '排放因子',
dataIndex: 'emissionFactors',
},
{
title: '排放因子单位',
dataIndex: 'emissionFactorUnits',
},
{
title: '数据来源',
dataIndex: 'dataSources',
},
{
title: '数据库',
dataIndex: 'carbonDatabase',
},
{
title: '参考文献',
dataIndex: 'reference',
},
{
title: '引用数量',
dataIndex: 'numberOfReferences',
},
],
columnActions: {
title: '操作',
actions: [
{
label: '编辑',
name: 'userEdit',
handle: (record: any) => {
userAuthList.value.splice(0);
setTimeout(() => {
console.log(record.id);
http.post(carbonEmissionFactorLibrary.findById,{ id: record.id } ).then((res) => {
formData.value = res.data;
});
}, 10);
opMap.value.type = 'edit';
opMap.value.fuc = (formData: any) => {
return http.post(carbonEmissionFactorLibrary.creatOrUpdate, formData).then(() => {
mainRef.value?.nsTableRef.reload();
visible.value = false;
NsMessage.success('操作成功');
});
};
visible.value = true;
},
},
{
label: '删除',
name: 'userDelete',
dynamicParams: { ids: 'id[]' },
confirm: true,
isReload: true,
api: carbonEmissionFactorLibrary.del,
},
],
},
rowKey: 'id',
});
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.main { .main {
background-color: @ns-content-bg; background-color: @ns-content-bg;
@ -540,13 +280,10 @@ import { log } from 'node:console';
} }
.left { .left {
width: 300px; width: 300px;
// max-height: calc(100vh - 96px);
margin-right: @ns-gap; margin-right: @ns-gap;
min-width: fit-content; min-width: fit-content;
> div { > div {
border-radius: @ns-border-radius;
background-color: @white; background-color: @white;
// box-shadow: @ns-content-box-shadow;
flex: 1; flex: 1;
} }
@ -565,12 +302,14 @@ import { log } from 'node:console';
.right { .right {
flex: 1; flex: 1;
min-width: 0; min-width: 0;
height: 100%;
background: #ffffff;
}
::v-deep .ant-table-container{
padding: 0px 16px;
} }
.top { .top {
overflow: auto; overflow: auto;
// height: 50%;
// border-bottom: 5px solid rgb(229, 235, 240);
// overflow-y: auto;
} }
.ns-form-title{ .ns-form-title{
font-weight: bold; font-weight: bold;
@ -580,4 +319,24 @@ import { log } from 'node:console';
padding-bottom: 10px; padding-bottom: 10px;
border-bottom: 1px solid #e9e9e9; border-bottom: 1px solid #e9e9e9;
} }
::v-deep .ant-table-title{
display: flex;
height: 100%;
align-items: center;
}
.ns-table-title{
font-weight: bold;
}
.buttonGroup{
margin-left: 1vw;
width: 5vw;
display: flex;
justify-content: space-around;
}
</style> </style>
<style scoped>
th.column-money,
td.column-money {
text-align: right !important;
}
</style>

141
hx-ai-intelligent/src/view/equipmentControl/lightingManage/dialogStyle.less

@ -0,0 +1,141 @@
.out-dialog {
position: fixed;
right: 496px;
width: 500px;
height: 100%;
top: 0;
bottom: 0;
margin: auto;
box-sizing: border-box;
color: rgb(255, 83, 0);
background: black;
display: flex;
padding: 25px;
flex-direction: column;
.content {
overflow-y: scroll;
.div-operation {
display: inline-block;
width: 3px;
height: 13px;
opacity: 1;
border-radius: 1px;
background: rgba(67, 136, 251, 1);
}
.text-operation {
display: inline-block;
color: rgba(255, 255, 255, 1);
font-size: 16px;
font-weight: 700;
margin-left: 5px;
}
.j-box {
background-color: #000;
opacity: 1;
z-index: 99999;
overflow-y: scroll;
.journal {
padding: 1% 3%;
width: 100%;
height: 150px;
background-color: rgba(0, 0, 0);
border-radius: 12px;
border: 2px solid transparent;
border-image: linear-gradient(to bottom, #0077ff, #00f6ff, #000000) 1;
}
.imgText {
display: flex;
align-items: center;
justify-content: space-between;
.ztzm {
display: flex;
align-items: center;
}
.cxbtn {
color: rgba(255, 255, 255, 1);
border: none;
border-radius: 6px;
width: 59.79px;
height: 32px;
opacity: 1;
background: linear-gradient(
180deg,
rgba(255, 187, 0, 1) 0%,
rgba(255, 112, 3, 1) 91.21%,
rgba(255, 129, 3, 1) 100%
);
}
}
.btn-box {
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: 1fr 1fr;
grid-row-gap: 15px;
.btn-item {
text-align: center;
display: flex;
align-content: space-between;
.left {
width: 70px;
height: 35px;
line-height: 35px;
border-radius: 4px;
background: linear-gradient(
180deg,
rgba(1, 206, 255, 1) 0%,
rgba(0, 150, 229, 1) 100%
);
color: rgba(255, 255, 255, 1);
font-size: 14px;
font-weight: 400;
}
.right {
width: 140px;
height: 35px;
line-height: 35px;
span {
vertical-align: middle;
}
img {
padding: 0 5px;
}
}
}
}
}
}
.button-box {
width: 100%;
box-sizing: border-box;
padding: 10px;
height: 60px;
position: absolute;
background-color: transparent;
bottom: 0;
left: 0;
right: 0;
.execute, .cancel {
margin-right: 10px;
width: 74px;
height: 40px;
opacity: 1;
cursor: pointer;
border-radius: 4px;
font-size: 14px;
font-weight: 400;
border: 0;
margin-left: 10px;
}
.execute {
background: rgb(67, 136, 251);
color: white;
}
.cancel {
background: white;
color: black;
}
}
}

1108
hx-ai-intelligent/src/view/equipmentControl/lightingManage/index.less

File diff suppressed because it is too large

156
hx-ai-intelligent/src/view/equipmentControl/lightingManage/indexs.less

@ -1,156 +0,0 @@
// 页面容器
.lighting-box {
// width: 100%;
// height: 100%;
position: relative;
// background: linear-gradient(#badaff, #8cabeb, #7095de);
// 照明设备功能总容器
.lighting-img-box {
position: relative;
width: 1280px;
height: 720px;
user-select: none;
background-image: url(../image/bg.jpg);
// 由于背景是俯视图,会产生有交点的透视效果,故使用透视属性
perspective: 1000px;
perspective-origin: 850px -160px;
// 左上角区域切换功能
.btn-box {
width: 120px;
position: sticky;
top: 10px;
left: 10px;
display: flex;
flex-direction: column;
gap: 8px;
.btn-item {
cursor: pointer;
width: 100%;
height: 40px;
border-radius: 4px;
background: rgba(39, 120, 255, 1);
border: 1px solid rgba(51, 199, 255, 1);
box-shadow: 0px 10px 15px rgba(0, 54, 136, 0.3);
font-size: 18px;
color: white;
}
.btn-item:hover {
color: black;
}
}
// 大区分区
.area{
position: absolute;
bottom: 170px;
left: 240px;
width: 780px;
height: 240px;
transform: rotateX(79deg) rotateZ(-22deg) skew(29deg);
display: flex;
gap: 8px;
.area1 {
width: 170px;
background: rgba(0, 251, 91, 0.3);
border: 2px solid rgb(0, 251, 91);
display: flex;
}
.area2 {
width: 240px;
background: rgba(255, 165, 0, 0.3);
border: 2px solid rgb(255, 165, 0);
display: flex;
}
.area3 {
width: 110px;
background: rgba(255, 0, 0, 0.3);
border: 2px solid rgb(255, 0, 0);
}
.area4 {
flex: 1;
background: rgba(80, 236, 244, 0.3);
border: 2px solid rgb(80, 236, 244);
}
// .area-item:hover {
// transform: scale(1.05);
// }
.area-item {
cursor: pointer;
transition: all ease 0.2s;
>.light-group {
height: 100%;
flex: 1;
display:flex;
justify-content: center;
align-items: center;
.group-shadow1 {
width: 35px;
height: 150px;
border-radius: 20px;
background: rgba(0, 0, 0, 0.1);
}
.group-shadow2 {
width: 35px;
height: 180px;
border-radius: 20px;
background: rgba(0, 0, 0, 0.1);
}
.group-shadow3 {
width: 40px;
height: 180px;
border-radius: 20px;
background: rgba(0, 0, 0, 0.1);
}
.group-shadow4 {
width: 40px;
height: 160px;
border-radius: 20px;
background: rgba(0, 0, 0, 0.1);
}
}
// .group-shadow {
// transition: all ease 0.2s;
// }
// .group-shadow:hover {
// transform: scale(1.05);
// }
}
}
}
}
// 总容器与抽屉按钮
.ns-content-main {
position: relative;
// 抽屉打开按钮
.drawer-box-in {
width: 30px;
height: 40px;
border-radius: 2px;
position: fixed;
right: 0;
top: 0;
bottom: 0;
margin: auto;
background: rgba(0, 0 ,0 ,0.5);
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
}
// 抽屉关闭按钮
.drawer-box-out {
width: 30px;
height: 40px;
border-radius: 2px;
position: fixed;
right: 496px;
top: 0;
bottom: 0;
margin: auto;
background: rgba(0, 0 ,0 ,0.5);
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
}
}

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

@ -3,19 +3,19 @@
<div class="lighting-img-box"> <div class="lighting-img-box">
<!-- 左上角区域切换 --> <!-- 左上角区域切换 -->
<div class="btn-box"> <div class="btn-box">
<button class="btn-item">1F</button> <button class="btn-item" @click=changeArea(1)>1F</button>
<button class="btn-item">2F</button> <button class="btn-item" @click=changeArea(2)>2F</button>
<button class="btn-item">站台</button> <button class="btn-item" @click=changeArea(3)>站台</button>
</div> </div>
<!-- 楼层区域 --> <!-- 楼层区域 -->
<div class="area"> <div class="area">
<div <div
v-for="(item, index) in treeData" v-for="(item, index) in treeData"
:class="computedClass(item.id)" :class="computedClass(String(item.id))"
@click="getArea(item.id)" @click="getArea(item)"
:key="index"> :key="index">
<div v-for="(v, i) in item.children" :key="i" class="light-group"> <div v-for="(v, i) in item.children" :key="i" class="light-group">
<div class="group-shadow group-shadow1" :class="computedClass(v.id)" @click.stop="getArea(v.id)"></div> <div class="group-shadow group-shadow1" :class="computedClass(v.id)" @click.stop="getArea(v)"></div>
</div> </div>
</div> </div>
</div> </div>
@ -40,16 +40,18 @@
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"
id="Odrawer" id="drawer"
: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 @changeArea="getArea" :treeData="treeData"></tabs1> <tabs1 @changeArea="getArea" :treeData="treeData"></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>
</a-tab-pane>
<a-tab-pane key="3" tab="日志">
<tabs3></tabs3>
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="3" tab="日志"></a-tab-pane>
</a-tabs> </a-tabs>
</a-drawer> </a-drawer>
</div> </div>
@ -61,15 +63,17 @@ import { ref } from 'vue';
import { treeData } from './treeData' import { treeData } from './treeData'
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 tabs3 from './tabs3.vue'
// ICON // ICON
import { import {
DoubleLeftOutlined, DoubleLeftOutlined,
DoubleRightOutlined DoubleRightOutlined
} from '@ant-design/icons-vue'; } from '@ant-design/icons-vue';
// - - // - -
let area = ref(['1']) const area = ref(['1'])
// - // - -
const bulbs = ref([ const bulbs = ref([
{ {
styleText: { left: '190px', bottom: '200px' }, styleText: { left: '190px', bottom: '200px' },
@ -121,6 +125,16 @@ const bulbs = ref([
}, },
]) ])
// -
const changeArea = (area: number) => {
if (area == 1) {
console.log('1F')
} else if (area == 2) {
console.log('2F')
} else if (area == 3) {
console.log('站台')
}
}
// - // -
const getArea = (result: any) => { const getArea = (result: any) => {
// //
@ -132,16 +146,14 @@ const getArea = (result: any) => {
area.value[0] = String(result) area.value[0] = String(result)
} }
} }
// -
// - // -
const computedClass = (number: number) => { const computedClass = (string: string) => {
if (area.value.indexOf(number) != -1) { if (area.value.indexOf(string) != -1) {
return `isActive area-item area${number}` return `isActive area-item area${string}`
} else { } else {
return `area-item area${number}` return `area-item area${string}`
} }
} }
// - tab // - tab
let activeKey = ref('1'); let activeKey = ref('1');
// - // -
@ -153,7 +165,7 @@ const toggleDrawer = () => {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@import "./indexs.less"; @import "./index.less";
.isActive { .isActive {
border: 3px solid white !important; border: 3px solid white !important;
} }

15
hx-ai-intelligent/src/view/equipmentControl/lightingManage/indexs1.vue

@ -1162,16 +1162,11 @@
selectedButton.value = null; selectedButton.value = null;
showControlMode.value = false; showControlMode.value = false;
showControlScene.value = false; showControlScene.value = false;
selectedButton3.value = null; selectedButton3.value = '';
selectedButton4.value = null; selectedButton4.value = '';
}; };
//
const logModalVisible = ref(false);
const handlerefClick1 = () => {
console.log(1111);
executevisible.value = true;
};
let trindex = ref('-1'); let trindex = ref('-1');
const handleRowClick = (index: any) => { const handleRowClick = (index: any) => {
@ -1192,9 +1187,7 @@
}; };
// //
const addvisible = ref<boolean>(false); const addvisible = ref<boolean>(false);
const addModal = () => {
addvisible.value = true;
};
// 穿 // 穿
interface MockData { interface MockData {
key: string; key: string;

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

@ -12,7 +12,7 @@
<div class="area"> <div class="area">
<template v-if="!showAllButtonsArea"> <template v-if="!showAllButtonsArea">
<button v-for="(button, index) in limitedButtons1" :key="index" <button v-for="(button, index) in limitedButtons1" :key="index"
:class="{ btn: true, selected: button.selected }" @click="selectButton(button, index)"> :class="{ btn: true, selected: button.selected }" @click="selectButton(button)">
{{ button.label }} {{ button.label }}
</button> </button>
<div style="margin-top: 10px"> <div style="margin-top: 10px">
@ -20,8 +20,8 @@
</div> </div>
</template> </template>
<template v-else> <template v-else>
<button v-for="(button, index) in props.treeData" :key="index" <button v-for="(button, index) in props.treeData" :key="index" :class="{ btn: true, selected: button.selected }"
:class="{ btn: true, selected: button.selected }" @click="selectButton(button)"> @click="selectButton(button)">
{{ button.label }} {{ button.label }}
</button> </button>
<div style="margin-top: 10px"> <div style="margin-top: 10px">
@ -36,7 +36,7 @@
<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="{
@ -49,7 +49,7 @@
</button> </button>
</div> </div>
</div> </div>
<div class="btnarea" v-if="selectedButton"> <div class="btnArea" v-if="selectedButton">
<template v-if="!showAllButtons"> <template v-if="!showAllButtons">
<button v-for="(button2, index) in limitedButtons2" :key="index" <button v-for="(button2, index) in limitedButtons2" :key="index"
:class="{ btn: true, selected: button2.selected }" class="zmhlbtn" @click="toggleSelection(button2)"> :class="{ btn: true, selected: button2.selected }" class="zmhlbtn" @click="toggleSelection(button2)">
@ -80,7 +80,7 @@
<!-- 控制模式按钮部分 --> <!-- 控制模式按钮部分 -->
<div class="control-mode-btn-area" v-show="showControlMode"> <div class="control-mode-btn-area" v-show="showControlMode">
<button v-for="(button3, index) in controlType" :key="index" <button v-for="(button3, index) in controlType" :key="index"
:class="{ btn: true, selected: button3.type === thisButtonType }" @click="selectButton3(button3)"> :class="{ btn: true, selected: button3.type == thisButton.type }" @click="selectButton3(button3)">
{{ button3.name }} {{ button3.name }}
</button> </button>
</div> </div>
@ -119,7 +119,7 @@
:style="{ height: '50px' }"> :style="{ height: '50px' }">
<td>{{ row.num }}</td> <td>{{ row.num }}</td>
<td>{{ row.light }}</td> <td>{{ row.light }}</td>
<td>{{ row.tempruter }}</td> <td>{{ row.temperature }}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -130,170 +130,71 @@
<button class="flushed" @click="refresh">刷新</button> <button class="flushed" @click="refresh">刷新</button>
<button class="execute" @click="showModal">执行</button> <button class="execute" @click="showModal">执行</button>
</div> </div>
<!-- <a-modal :v-if="cxlist.length === 0" v-model:visible="executevisible" width="500px" height="792px" okText="执行"
:closable="false" @ok="handleOk2" :mask="false" :bodyStyle="{ <div class="out-dialog" v-if="executeVisible">
opacity: 1, <div class="content" v-if="executeVisible">
background: ' rgba(0,0,0)',
color: 'rgba(255,83,0)',
boxSizing: 'borderBox',
display: 'flex',
flexDirection: 'column',
position: 'fixed',
right: '496px',
top: '0',
}">
<div :v-if="cxlist.length === 0" style="height: 792px">
<div> <div>
<div class="div-operation"></div> <div class="div-operation"></div>
<span class="text-operation">变更内容 </span> <span class="text-operation">变更内容 </span>
</div> </div>
<div class="jbox" v-for="item in cxlist" :key="item.id"> <div class="j-box" v-for="item in cxList" :key="item.id">
<div class="journal" style="margin-top: 20px"> <div class="journal" style="margin-top: 20px">
<div class="imgText"> <div class="imgText">
<div class="zjzm"> <div class="zjzm">
<img class="titleimg" src="/asset/image//bulbLogo/21961.png" alt="" />&nbsp; <img class="title-img" src="/asset/image//bulbLogo/21961.png" alt="" />&nbsp;
<span class="titletext" style="font-size: 20px; font-weight: 500; color: rgba(255, 255, 255, 1)">{{ <span class="title-text" style="font-size: 20px; font-weight: 500; color: rgba(255, 255, 255, 1)">{{ item.name }}</span>
item.name }}</span>
</div> </div>
<button class="cxbtn" @click="delbtn(item.id)">撤销</button> <button class="cxbtn" @click="delBtn(item.id)">撤销</button>
</div>
<div class="control-btn">
<button style="
width: 96px;
height: 40px;
border-radius: 4px;
background: linear-gradient(
180deg,
rgba(1, 206, 255, 1) 0%,
rgba(0, 150, 229, 1) 100%
);
border: 1px solid rgba(95, 154, 251, 1);
color: rgba(255, 255, 255, 1);
font-size: 14px;
font-weight: 400;
">
控制模式
</button>
<span style="
color: rgba(255, 255, 255, 1);
font-size: 14px;
font-weight: 400;
margin-left: 12px;
margin-right: 8px;
">手动</span>
<img src="/asset/image/bulbLogo/22406.png" alt="" />
<span style="
color: rgba(255, 255, 255, 1);
font-size: 14px;
font-weight: 400;
margin-left: 8px;
margin-right: 40px;
">自动</span>
</div>
<div class="light-btn">
<button style="
width: 68px;
height: 40px;
border-radius: 4px;
background: linear-gradient(
180deg,
rgba(1, 206, 255, 1) 0%,
rgba(0, 150, 229, 1) 100%
);
border: 1px solid rgba(95, 154, 251, 1);
color: rgba(255, 255, 255, 1);
font-size: 14px;
font-weight: 400;
">
亮度
</button>
<span style="
color: rgba(255, 255, 255, 1);
font-size: 14px;
font-weight: 400;
margin-left: 12px;
margin-right: 8px;
">100lux</span>
<img src="/asset/image/bulbLogo/22406.png" alt="" />
<span style="
color: rgba(243, 97, 99, 1);
font-size: 14px;
font-weight: 400;
margin-left: 8px;
">30lux</span>
</div>
<div class="control-area-btn">
<button style="
width: 96px;
height: 40px;
border-radius: 4px;
background: linear-gradient(
180deg,
rgba(1, 206, 255, 1) 0%,
rgba(0, 150, 229, 1) 100%
);
border: 1px solid rgba(95, 154, 251, 1);
color: rgba(255, 255, 255, 1);
font-size: 14px;
font-weight: 400;
">
控制场景
</button>
<span style="
color: rgba(255, 255, 255, 1);
font-size: 14px;
font-weight: 400;
margin-left: 12px;
margin-right: 8px;
">手动</span>
<img src="/asset/image/bulbLogo/22406.png" alt="" />
<span style="
color: rgba(255, 255, 255, 1);
font-size: 14px;
font-weight: 400;
margin-left: 8px;
margin-right: 40px;
">自动</span>
</div> </div>
<div class="temp-btn"> <div class="btn-box">
<button style=" <div class="btn-item">
width: 68px; <div class="left">控制模式</div>
height: 40px; <div class="right">
border-radius: 4px; <span>手动</span>
background: linear-gradient( <img src="/asset/image/bulbLogo/22406.png" alt="" />
180deg, <span>自动</span>
rgba(1, 206, 255, 1) 0%, </div>
rgba(0, 150, 229, 1) 100% </div>
); <div class="btn-item">
border: 1px solid rgba(95, 154, 251, 1); <div class="left">
color: rgba(255, 255, 255, 1); 亮度
font-size: 14px; </div>
font-weight: 400; <div class="right">
"> <span>100lux</span>
色温 <img src="/asset/image/bulbLogo/22406.png" alt="" />
</button> <span>30lux</span>
<span style=" </div>
color: rgba(255, 255, 255, 1); </div>
font-size: 14px; <div class="btn-item">
font-weight: 400; <div class="left">
margin-left: 12px; 控制场景
margin-right: 8px; </div>
">4000k</span> <div class="right">
<img src="/asset/image/bulbLogo/22406.png" alt="" /> <span>手动</span>
<span style=" <img src="/asset/image/bulbLogo/22406.png" alt="" />
color: rgba(255, 255, 255, 1); <span>自动</span>
font-size: 14px; </div>
font-weight: 400; </div>
margin-left: 8px; <div class="btn-item">
">3800k</span> <div class="left">
色温
</div>
<div class="right">
<span>4000k</span>
<img src="/asset/image/bulbLogo/22406.png" alt="" />
<span>3800k</span>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</a-modal> --> <div style="width: 100%; height: 60px;"></div>
<div class="button-box">
<button class="cancel" @click="executeVisible = false">取消</button>
<button class="execute">执行</button>
</div>
</div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -307,19 +208,23 @@ import {
// //
onMounted(() => { onMounted(() => {
const tree = props.treeData const data = props.treeData[0]
// //
tree[0].selected = true data.selected = true
// //
buttons2.value = tree[0].children buttons2.value = data.children
}) })
// =================================================================== // ===================================================================
const props = defineProps({ const props = defineProps({
// > // >
treeData: { treeData: {
type: Array type: Array,
default: []
}, },
line: {
type: Array
}
}); });
const emit = defineEmits(['changeArea']); const emit = defineEmits(['changeArea']);
@ -336,20 +241,13 @@ const togglePlan = () => {
const showAllButtonsArea = ref(false); const showAllButtonsArea = ref(false);
// - - 1 // - - 1
const selectedButton = ref('1'); const selectedButton = ref('1');
// - // - -
const selectButton = (button: any, index: number) => { const selectButton = (button: any) => {
// //
selectedButton.value = button; selectedButton.value = button;
// //
props.treeData.forEach(item => { initMenu(1)
item.selected = false
})
button.selected = true button.selected = true
// 1
buttons2.value.forEach(item => {
item.selected = false
})
showControlMode.value = false
buttons2.value = button.children buttons2.value = button.children
// area // area
emit('changeArea', []); emit('changeArea', []);
@ -375,17 +273,8 @@ const togglePlan2 = () => {
isPlanEnabled2.value = !isPlanEnabled2.value; isPlanEnabled2.value = !isPlanEnabled2.value;
// - // -
if (isPlanEnabled2.value) { if (isPlanEnabled2.value) {
item.selected = false;
item.stop = true item.stop = true
let level1 = String(selectedButton.value.id) // -
let arr = [level1]
buttons2.value.forEach(item => {
if (item.selected) {
arr.push(item.id)
}
})
emit('changeArea', arr)
// -
} else { } else {
item.stop = false item.stop = false
} }
@ -410,12 +299,10 @@ const toggleAllSelection = () => {
// //
if (selectAllCheckbox.value) { if (selectAllCheckbox.value) {
buttons2.value.forEach((item) => { buttons2.value.forEach((item) => {
if (!item.stop) { 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;
@ -431,7 +318,7 @@ const toggleSelection = (button: any) => {
zmhlid.value = button.id zmhlid.value = button.id
// / // /
if (button.stop) { if (button.stop) {
return isPlanEnabled2.value = true isPlanEnabled2.value = true
} else { } else {
isPlanEnabled2.value = false isPlanEnabled2.value = false
} }
@ -455,19 +342,24 @@ const toggleSelection = (button: any) => {
arr.push(item.id) arr.push(item.id)
} }
}); });
console.log(arr)
emit('changeArea', arr) emit('changeArea', arr)
} }
// //
if (button.selected) { if (button.selected) {
//
showControlMode.value = true showControlMode.value = true
thisButtonType.value = button.type
thisButton.value = button thisButton.value = button
if (button.type == 3) {
showControlScene.value = true
} else {
showControlScene.value = false
}
} else { } else {
//
showControlMode.value = false showControlMode.value = false
thisButton.value = null thisButton.value = { type: '0' }
} }
}; };
// - // -
const showAllButtons = ref(false); const showAllButtons = ref(false);
@ -479,16 +371,12 @@ const buttons2 = ref([]);
// ======================================================================= // =======================================================================
// - // -
const showControlMode = ref(false); const showControlMode = ref(false);
const thisButtonType = ref(null) const thisButton = ref({ type: '0' })
const thisButton = ref(null)
// -
const selectedButton3 = ref('');
// - // -
const selectButton3 = (button3) => { const selectButton3 = (button3) => {
thisButton.value.type = button3.type thisButton.value.type = button3.type
thisButtonType.value = button3.type
showControlScene.value = button3.name === '手动'; showControlScene.value = button3.name === '手动';
selectedButton4.value = ''; // selectedButton4.value = null; //
}; };
// ======================================================================= // =======================================================================
@ -502,7 +390,7 @@ const controlSceneButtons = ref([
{ label: '客流高峰', selected: false }, { label: '客流高峰', selected: false },
]); ]);
// - // -
const selectedButton4 = ref(''); const selectedButton4 = ref(null);
// - // -
const selectButton4 = (button4) => { const selectButton4 = (button4) => {
selectedButton4.value = button4.label; selectedButton4.value = button4.label;
@ -510,33 +398,112 @@ const selectButton4 = (button4) => {
// ======================================================================== // ========================================================================
// - // -
const lightSource = ref([{ num: '8/10', light: '100', tempruter: '4200' }]); const lightSource = ref([{ num: '8/10', light: '100', temperature: '4200' }]);
let trIndex = ref('-1');
const handleRowClick = (index: any) => { const handleRowClick = (index: any) => {
trindex.value = index; trIndex.value = index;
if (index === trindex.value) { if (index === trIndex.value) {
console.log('tri'); console.log('tri');
} }
// };
logModalVisible.value = true;
};
// ======================================================================== // ========================================================================
const cxList = ref([
{
id: '1',
name: '站厅照明 1区',
manual: '手动',
automatic: '自动',
brightness: '100lux',
brightness2: '30lux',
manual2: '手动',
automatic2: '自动',
brightness3: '4000k',
brightness4: '3800k',
},
{
id: '2',
name: '站厅照明 2区',
manual: '手动',
automatic: '自动',
brightness: '100lux',
brightness2: '30lux',
manual2: '手动',
automatic2: '自动',
brightness3: '4000k',
brightness4: '3800k',
},
{
id: '3',
name: '站厅照明 3区',
manual: '手动',
automatic: '自动',
brightness: '100lux',
brightness2: '30lux',
manual2: '手动',
automatic2: '自动',
brightness3: '4000k',
brightness4: '3800k',
},
]);
// const cxList = cxList.value.concat(cxList.value)
//
const delBtn = (id: any) => {
console.log(id);
cxList.value.pop(id);
console.log(cxList.value.length);
const refresh = () => { if (cxList.value.length === 0) {
selectedButton.value = {}; executeVisible.value = false;
}
};
// ========================================================================
// 5
const initMenu = (tier: number) => {
// 1 = -
if (tier == 1) {
//
buttons2.value.forEach(item => {
item.selected = false
})
//
props.treeData.forEach(item => {
item.selected = false
})
//
showControlMode.value = false; showControlMode.value = false;
//
showControlScene.value = false; showControlScene.value = false;
selectedButton3.value = null; //
selectedButton4.value = null; selectedButton4.value = null;
} else if (tier == 2) {
//
showControlScene.value = false;
//
selectedButton4.value = null;
}
}
//
const refresh = () => {
executeVisible.value = false
selectedButton.value = '1';
emit('changeArea', []);
emit('changeArea', [1]);
showControlMode.value = false;
showControlScene.value = false;
selectedButton4.value = null;
}; };
// //
const executevisible = ref<boolean>(false); const executeVisible = ref<boolean>(false);
const showModal = () => { const showModal = () => {
executevisible.value = true; executeVisible.value = true;
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@import "./dialogStyle.less";
// //
.drawer-item { .drawer-item {
@ -614,7 +581,7 @@ const executevisible = ref<boolean>(false);
cursor: not-allowed; cursor: not-allowed;
} }
.openplan.enabled2 { .openPlan.enabled2 {
border: none; border: none;
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
@ -627,7 +594,7 @@ const executevisible = ref<boolean>(false);
color: white; color: white;
} }
.openplan.disabled2 { .openPlan.disabled2 {
border: none; border: none;
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
@ -639,7 +606,7 @@ const executevisible = ref<boolean>(false);
background-color: red; background-color: red;
} }
.openplan:disabled { .openPlan:disabled {
cursor: not-allowed; cursor: not-allowed;
} }
@ -714,7 +681,7 @@ const executevisible = ref<boolean>(false);
} }
.area, .area,
.btnarea, .btnArea,
.control-mode-btn-area, .control-mode-btn-area,
.control-scene-btn-area { .control-scene-btn-area {
margin-left: -17px; margin-left: -17px;
@ -828,7 +795,6 @@ const executevisible = ref<boolean>(false);
position: fixed; position: fixed;
bottom: 0; bottom: 0;
right: 0; right: 0;
margin-bottom: 10px;
} }
.execute { .execute {
@ -836,6 +802,7 @@ const executevisible = ref<boolean>(false);
width: 74px; width: 74px;
height: 40px; height: 40px;
opacity: 1; opacity: 1;
cursor: pointer;
border-radius: 4px; border-radius: 4px;
background: rgba(67, 136, 251, 1); background: rgba(67, 136, 251, 1);
font-size: 14px; font-size: 14px;
@ -848,6 +815,7 @@ const executevisible = ref<boolean>(false);
.flushed { .flushed {
width: 74px; width: 74px;
height: 40px; height: 40px;
cursor: pointer;
opacity: 1; opacity: 1;
border-radius: 4px; border-radius: 4px;
font-size: 14px; font-size: 14px;
@ -857,50 +825,6 @@ const executevisible = ref<boolean>(false);
border: 1px solid rgba(193, 197, 204, 1); border: 1px solid rgba(193, 197, 204, 1);
} }
.tabreboot,
.tabdelete {
border: none;
background-color: rgba(0, 0, 0, 0);
font-size: 14px;
font-weight: 400;
letter-spacing: 0;
line-height: 20px;
color: rgba(67, 136, 251, 1);
}
.tabreboot {
margin-right: 8px;
}
.add {
width: 74px;
height: 40px;
opacity: 1;
border-radius: 4px;
background: rgba(67, 136, 251, 1);
border: rgba(67, 136, 251, 1);
font-size: 14px;
font-weight: 400;
color: white;
}
.divadd {
width: 100%;
height: 64px;
display: flex;
justify-content: flex-end;
align-items: center;
position: fixed;
bottom: 0;
right: 0;
margin-bottom: 10px;
margin-right: 20px;
}
.atable {
margin-top: 20px;
}
:deep(.ant-table-pagination) { :deep(.ant-table-pagination) {
visibility: hidden; visibility: hidden;
} }
@ -1006,9 +930,12 @@ const executevisible = ref<boolean>(false);
display: flex; display: flex;
align-items: center; align-items: center;
} }
.zmhlbtn { .zmhlbtn {
position: relative; position: relative;
} }
//
.anticon-stop { .anticon-stop {
position: absolute; position: absolute;
right: 3px; right: 3px;

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

@ -0,0 +1,216 @@
<template>
<div class="div-add">
<button class="add" @click="addModal">添加</button>
</div>
<table class="custom-table table1">
<thead>
<tr :style="{ background: 'rgba(35,45,69)' }">
<th>序号</th>
<th>执行时间</th>
<th>计划名称</th>
<th>状态</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr v-for="(row, index) in dataSource" :key="index">
<td>{{ row.key }}</td>
<td>{{ row.data }}</td>
<td>{{ row.planName }}</td>
<td v-if="row.status === '待执行'">
<button
style="
font-size: 12px;
background: rgba(57, 215, 187, 0.1);
color: rgb(57, 215, 187);
border: 1px solid rgb(57, 215, 187);
">
{{ row.status }}
</button>
</td>
<td v-if="row.status !== '待执行'">
<button
style="
font-size: 12px;
background: rgba(243, 97, 99, 0.1);
border: 1px solid rgba(243, 97, 99);
color: rgba(243, 97, 99);
">
{{ row.status }}
</button>
</td>
<td>
<button class="tabReboot" @click="handleRefClick1">重启</button>
<button class="tabDelete">删除</button>
</td>
</tr>
</tbody>
</table>
<div class="out-dialog" v-if="addVisible">
<div class="content" v-if="addVisible">
<div class="div-operation"></div>
<span class="text-operation">计划库</span>
</div>
<div style="margin-top: 20px">
<a-transfer
v-model:target-keys="targetKeys"
:data-source="mockData"
show-search
:filter-option="filterOption"
:render="(item) => item.title"
@change="handleChange"
:style="{ color: 'rgba(255,255,255,1)' }"
@search="handleSearch"
:listStyle="{ border: '2px solid rgba(25,74,125,1)', height: 'calc(100vh - 200px)' }" />
</div>
<div style="width: 100%; height: 60px;"></div>
<div class="button-box">
<button class="cancel" @click="addVisible = false">取消</button>
<button class="execute">确定</button>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
//
onMounted(() => {
})
//
const dataSource = ref([
{
key: '1',
data: '2024-05-01',
planName: '劳动节',
status: '暂停中',
},
{
key: '2',
data: '2024-05-01',
planName: '国庆节',
status: '待执行',
},
{
key: '3',
data: '2024-05-01',
planName: '元旦',
status: '待执行',
},
]);
const addVisible = ref<boolean>(false);
//
const handleRefClick1 = () => {
alert(111)
};
const addModal = () => {
addVisible.value = true;
};
const handleChange = (keys: string[], direction: string, moveKeys: string[]) => {
console.log(keys, direction, moveKeys);
};
const handleSearch = (dir: string, value: string) => {
console.log('search:', dir, value);
};
// 穿
interface MockData {
key: string;
title: string;
description: string;
chosen: boolean;
}
const mockData = ref([
{
key: '1',
title: '计划再开',
},
{
key: '2',
title: '检修模式',
},
{
key: '3',
title: '设备变更',
},
]);
const targetKeys = ref<string[]>([]);
const filterOption = (inputValue: string, option: MockData) => {
console.log(option.description);
return option.description.indexOf(inputValue) > -1;
};
</script>
<style lang="less" scoped>
@import "./dialogStyle.less";
//
.div-add {
height: 64px;
display: flex;
justify-content: flex-end;
align-items: center;
position: fixed;
bottom: 0;
right: 0;
margin-right: 20px;
.add {
width: 74px;
height: 40px;
opacity: 1;
border-radius: 4px;
background: rgba(67, 136, 251, 1);
border: rgba(67, 136, 251, 1);
font-size: 14px;
font-weight: 400;
color: rgba(255, 255, 255, 1);
}
}
//
.custom-table {
border-collapse: collapse;
width: 416px;
height: 60px;
color: rgba(255, 255, 255, 1);
}
.custom-table th,
.custom-table td {
border: 1px solid rgba(163, 192, 243, 1);
text-align: left;
padding: 8px;
text-align: center;
}
.table1 {
margin-top: 20px;
width: 100%;
border: 1px solid rgba(255, 255, 255);
border-radius: 5px;
background: rgba(255, 255, 255, 0.1);
//
.tabReboot,
.tabDelete {
border: none;
background-color: rgba(0, 0, 0, 0);
font-size: 14px;
font-weight: 400;
letter-spacing: 0;
line-height: 20px;
color: rgba(67, 136, 251, 1);
}
.tabReboot {
margin-right: 8px;
}
}
::v-deep(.ant-transfer) {
// hover
.ant-transfer-list-content-item:hover {
background: black;
}
}
</style>

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

@ -0,0 +1,255 @@
<template>
<table class="custom-table table1">
<thead>
<tr :style="{ background: 'rgba(35,45,69)' }">
<th>序号</th>
<th>执行时间</th>
<th>操作内容</th>
<th>操作人</th>
</tr>
</thead>
<tbody>
<tr v-for="(row, index) in dataSource1" :key="index" @click="handleRowClick(row.key)"
:class="row.key === trIndex ? 'isTrIndex' : ''">
<td>{{ row.key }}</td>
<td>{{ row.data }}</td>
<td>{{ row.planName }}</td>
<td>{{ row.status }}</td>
</tr>
</tbody>
</table>
<div class="out-dialog" v-if="logModalVisible">
<div class="content" v-if="logModalVisible">
<div>
<div class="div-operation"></div>
<span class="text-operation">变更内容 </span>
</div>
<div class="jbox" v-for="item in cxList" :key="item.id">
<div class="journal" style="margin-top: 20px">
<div class="imgText">
<div class="zjzm">
<img class="title-img" src="/asset/image//bulbLogo/21961.png" alt="" />&nbsp;
<span class="title-text" style="font-size: 20px; font-weight: 500; color: rgba(255, 255, 255, 1)">{{
item.name }}</span>
</div>
</div>
<div class="btn-box">
<div class="btn-item">
<div class="left">控制模式</div>
<div class="right">
<span>手动</span>
<img src="/asset/image/bulbLogo/22406.png" alt="" />
<span>自动</span>
</div>
</div>
<div class="btn-item">
<div class="left">
亮度
</div>
<div class="right">
<span>100lux</span>
<img src="/asset/image/bulbLogo/22406.png" alt="" />
<span>30lux</span>
</div>
</div>
<div class="btn-item">
<div class="left">
控制场景
</div>
<div class="right">
<span>手动</span>
<img src="/asset/image/bulbLogo/22406.png" alt="" />
<span>自动</span>
</div>
</div>
<div class="btn-item">
<div class="left">
色温
</div>
<div class="right">
<span>4000k</span>
<img src="/asset/image/bulbLogo/22406.png" alt="" />
<span>3800k</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div style="height: 60px;"></div>
<div class="button-box">
<button class="cancel" @click="logModalVisible = false">取消</button>
</div>
</div>
<div class="div-add">
<button class="add">刷新</button>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
//
onMounted(() => {
})
// ===================================================================
const props = defineProps({
// >
treeData: {
type: Array
},
});
const emit = defineEmits(['changeArea']);
//
const dataSource1 = ref([
{
key: '1',
data: '2024-05-01',
planName: '计划再开',
status: '张三111',
},
{
key: '2',
data: '2024-05-01',
planName: '检修模式',
status: '李四12',
},
{
key: '3',
data: '2024-05-01',
planName: '设备变更',
status: '王五33',
},
]);
const cxList = ref([
{
id: '1',
name: '站厅照明 1区',
manual: '手动',
automatic: '自动',
brightness: '100lux',
brightness2: '30lux',
manual2: '手动',
automatic2: '自动',
brightness3: '4000k',
brightness4: '3800k',
},
{
id: '2',
name: '站厅照明 2区',
manual: '手动',
automatic: '自动',
brightness: '100lux',
brightness2: '30lux',
manual2: '手动',
automatic2: '自动',
brightness3: '4000k',
brightness4: '3800k',
},
{
id: '3',
name: '站厅照明 3区',
manual: '手动',
automatic: '自动',
brightness: '100lux',
brightness2: '30lux',
manual2: '手动',
automatic2: '自动',
brightness3: '4000k',
brightness4: '3800k',
},
]);
let trIndex = ref('-1');
const logModalVisible = ref(false);
const handleRowClick = (index: any) => {
trIndex.value = index;
if (index === trIndex.value) {
console.log('tri');
}
//
logModalVisible.value = true;
};
</script>
<style lang="less" scoped>
@import "./dialogStyle.less";
//
.div-add {
height: 64px;
display: flex;
justify-content: flex-end;
align-items: center;
position: fixed;
bottom: 0;
right: 0;
margin-right: 20px;
.add {
width: 74px;
height: 40px;
opacity: 1;
border-radius: 4px;
background: rgba(67, 136, 251, 1);
border: rgba(67, 136, 251, 1);
font-size: 14px;
font-weight: 400;
color: rgba(255, 255, 255, 1);
}
}
//
.custom-table {
border-collapse: collapse;
width: 416px;
height: 60px;
color: rgba(255, 255, 255, 1);
}
.custom-table th,
.custom-table td {
border: 1px solid rgba(163, 192, 243, 1);
text-align: left;
padding: 8px;
text-align: center;
}
.table1 {
margin-top: 20px;
width: 100%;
border: 1px solid rgba(255, 255, 255);
border-radius: 5px;
background: rgba(255, 255, 255, 0.1);
.tabReboot,
.tabDelete {
border: none;
background-color: rgba(0, 0, 0, 0);
font-size: 14px;
font-weight: 400;
letter-spacing: 0;
line-height: 20px;
color: rgba(67, 136, 251, 1);
}
.tabReboot {
margin-right: 8px;
}
.isTrIndex {
background: rgba(67, 136, 251, 1);
}
}
::v-deep(.ant-transfer) {
// hover
.ant-transfer-list-content-item:hover {
background: black;
}
}
</style>
Loading…
Cancel
Save