Browse Source

Merge branch 'temp' into deploy-dev

deploy-dev
wangyan 4 months ago
parent
commit
0585818abf
  1. 7
      hx-ai-intelligent/src/App.vue
  2. 20
      hx-ai-intelligent/src/api/IlluminationInfo.ts
  3. 5
      hx-ai-intelligent/src/api/alarmSettings/notificationManagements.ts
  4. 10
      hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts
  5. 6
      hx-ai-intelligent/src/router/alarmManagement.ts
  6. 24
      hx-ai-intelligent/src/router/carbonEmissionManage.ts
  7. 2
      hx-ai-intelligent/src/router/equipmentControl.ts
  8. 6
      hx-ai-intelligent/src/router/equipmentManage.ts
  9. 2
      hx-ai-intelligent/src/router/home.ts
  10. 8
      hx-ai-intelligent/src/router/monitor.ts
  11. 4
      hx-ai-intelligent/src/router/organizationManage.ts
  12. 19
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/energyAlarm/editeEnergyAlarm.vue
  13. 2
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/configureDeviceAlarms.vue
  14. 4
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editConfigureDeviceAlarm.vue
  15. 19
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editeEquipmentAlarm.vue
  16. 51
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/index.vue
  17. 133
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/index.vue
  18. 22
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/linkPeople/config.ts
  19. 56
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/linkPeople/index.vue
  20. 9
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/energyAlarmConfig.ts
  21. 13
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/equipmentAlarmConfig.ts
  22. 52
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/notificationManagementConfig.ts
  23. 8
      hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/look.vue
  24. 87
      hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/status.vue
  25. 2
      hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/ts/config.ts
  26. 17
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue
  27. 306
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/carbonEmissions/index copy.vue
  28. 2
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/carbonEmissions/index.vue
  29. 219
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue
  30. 116
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue
  31. 283
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/config.ts
  32. 10
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue
  33. 197
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue
  34. 45
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/mock.ts
  35. 9
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/dialogStyle.less
  36. 67
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/index.less
  37. 159
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/indexs.vue
  38. 439
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs1.less
  39. 611
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs1.vue
  40. 79
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs2.vue
  41. 12
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs3.vue
  42. 7
      hx-ai-intelligent/src/view/equipmentManage/group/index.vue
  43. 8
      hx-ai-intelligent/src/view/equipmentManage/ledger/index.vue
  44. 15
      hx-ai-intelligent/src/view/organizationManage/departmentManage/index.vue
  45. 9
      hx-ai-intelligent/src/view/organizationManage/usermanage/config.ts
  46. 23
      hx-ai-intelligent/src/view/organizationManage/usermanage/index.vue
  47. 2
      hx-op/src/router/home.ts
  48. 2
      hx-op/src/router/organizationManage.ts
  49. 2
      lib/saas/view/system/application.vue

7
hx-ai-intelligent/src/App.vue

@ -48,11 +48,18 @@
height: 100%; height: 100%;
} }
} }
//
:deep(.ant-tree-node-content-wrapper) { :deep(.ant-tree-node-content-wrapper) {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
text-wrap: nowrap; text-wrap: nowrap;
} }
:deep(.ant-tree-node-selected) {
color: @primary-color !important;
}
// ns-view-list-table
:deep(.ns-table-search) { :deep(.ns-table-search) {
.ns-flexv2-form { .ns-flexv2-form {
.ns-operate { .ns-operate {

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

@ -0,0 +1,20 @@
// 照明系统及相关接口
export enum lightingManage {
// 主页 ========================================================
// 获得分区与线路
getArea = '/carbon-smart/IlluminationInfo/region',
// 修改线路的可用/禁用状态
setDisable = '/carbon-smart/IlluminationInfo/revisePanel',
// 计划列表tab页 ================================================
// 获得计划列表tab页的表格数据
getPlanTable = '/carbon-smart/IlluminationPlan/selectPanelPlan',
// 获得计划列表tab页的穿梭框左侧数据
getLeftPlan = '/carbon-smart/IlluminationPlan/getPlan',
// 提交穿梭框被选择的数据
submitLeftPlan = '/carbon-smart/IlluminationPlan/joinPlan',
}

5
hx-ai-intelligent/src/api/alarmSettings/notificationManagements.ts

@ -0,0 +1,5 @@
export enum notificationManagementApi {
getTableList = '/carbon-smart/api/AlarmContactInformation/selectAlarmContactInformation', //通知管理分页
upData = '/carbon-smart/api/AlarmContactInformation/update', //通知管理 修改
findById = '/carbon-smart/api/AlarmContactInformation/findById', //通知管理 查询详情
}

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

@ -9,11 +9,11 @@ export enum carbonEmissionFactorLibrary {
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', dictionaryUnitManagement = '/carbon-smart/client/dict/dictionaryUnitManagement',
findOutermost = '/carbon-smart/api/carbon/emission/factor/findOutermost', findOutermost = '/carbon-smart/client/dict/findOutermost',
createDictionary = '/carbon-smart/api/carbon/emission/factor/createDictionary', createDictionary = '/carbon-smart/client/dict/createDictionary',
updateDictionary = '/carbon-smart/api/carbon/emission/factor/updateDictionary', updateDictionary = '/carbon-smart/client/dict/updateDictionary',
delDictionary = '/carbon-smart/api/carbon/emission/factor/delDictionary', delDictionary = '/carbon-smart/client/dict/delDictionary',
} }
// 碳排管理-碳排统计接口 // 碳排管理-碳排统计接口
export enum energyConsumption { export enum energyConsumption {

6
hx-ai-intelligent/src/router/alarmManagement.ts

@ -18,7 +18,7 @@ const alarmManagement = {
component: () => import('/@/view/alarmManagement/alarmOverview/index.vue'), component: () => import('/@/view/alarmManagement/alarmOverview/index.vue'),
meta: { meta: {
title: '告警总览', title: '告警总览',
keepAlive: true, keepAlive: false,
// backApi: [], // backApi: [],
}, },
}, },
@ -37,7 +37,7 @@ const alarmManagement = {
component: () => import('/@/view/alarmManagement/equipmentAlarm/index.vue'), component: () => import('/@/view/alarmManagement/equipmentAlarm/index.vue'),
meta: { meta: {
title: '设备告警', title: '设备告警',
keepAlive: true, keepAlive: false,
// backApi: [], // backApi: [],
}, },
}, },
@ -56,7 +56,7 @@ const alarmManagement = {
component: () => import('/@/view/alarmManagement/alarmSettings/index.vue'), component: () => import('/@/view/alarmManagement/alarmSettings/index.vue'),
meta: { meta: {
title: '告警设置', title: '告警设置',
keepAlive: true, keepAlive: false,
operates: [ operates: [
{ title: '设备告警新增', code: 'equipmentAlarmAdd' }, { title: '设备告警新增', code: 'equipmentAlarmAdd' },
{ title: '设备告警导入', code: 'equipmentAlarmImport' }, { title: '设备告警导入', code: 'equipmentAlarmImport' },

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

@ -19,7 +19,7 @@ const equipment = {
component: () => import('/@/view/carbonEmissionManage/carbonEmissionStatistics/index.vue'), component: () => import('/@/view/carbonEmissionManage/carbonEmissionStatistics/index.vue'),
meta: { meta: {
title: '碳排统计', title: '碳排统计',
keepAlive: true, keepAlive: false,
// backApi: [], // backApi: [],
}, },
}, },
@ -39,7 +39,27 @@ const equipment = {
component: () => import('/@/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue'), component: () => import('/@/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue'),
meta: { meta: {
title: '碳排因子库', title: '碳排因子库',
keepAlive: true, keepAlive: false,
// backApi: [],
},
},
],
},
{
path: 'carbonInventoryCheck',
name: 'CarbonInventoryCheck',
meta: { title: '碳盘查', hideChildren: true, icon: 'tanpaiguanli' },
component: Base,
redirect: { name: 'CarbonInventoryCheckIndex' },
children: [
{
path: 'index',
name: 'CarbonInventoryCheckIndex',
// component: () => import('/nerv-lib/saas/view/menuManage/index.vue'),
component: () => import('/@/view/carbonEmissionManage/carbonInventoryCheck/index.vue'),
meta: {
title: '碳盘查',
keepAlive: false,
// backApi: [], // backApi: [],
}, },
}, },

2
hx-ai-intelligent/src/router/equipmentControl.ts

@ -18,7 +18,7 @@ const equipmentControl = {
component: () => import('/@/view/equipmentControl/lightingManage/indexs.vue'), component: () => import('/@/view/equipmentControl/lightingManage/indexs.vue'),
meta: { meta: {
title: '智能照明', title: '智能照明',
keepAlive: true, keepAlive: false,
// backApi: [], // backApi: [],
}, },
}, },

6
hx-ai-intelligent/src/router/equipmentManage.ts

@ -19,7 +19,7 @@ const equipment = {
component: () => import('/@/view/equipmentManage/ledger/index.vue'), component: () => import('/@/view/equipmentManage/ledger/index.vue'),
meta: { meta: {
title: '设备台账', title: '设备台账',
keepAlive: true, keepAlive: false,
// backApi: [], // backApi: [],
}, },
}, },
@ -38,7 +38,7 @@ const equipment = {
component: () => import('/@/view/equipmentManage/group/index.vue'), component: () => import('/@/view/equipmentManage/group/index.vue'),
meta: { meta: {
title: '分组管理', title: '分组管理',
keepAlive: true, keepAlive: false,
// backApi: [], // backApi: [],
}, },
}, },
@ -57,7 +57,7 @@ const equipment = {
// component: () => import('/@/view/equipmentManage/energyMapping/index.vue'), // component: () => import('/@/view/equipmentManage/energyMapping/index.vue'),
// meta: { // meta: {
// title: '能耗映射', // title: '能耗映射',
// keepAlive: true, // keepAlive: false,
// // backApi: [], // // backApi: [],
// }, // },
// }, // },

2
hx-ai-intelligent/src/router/home.ts

@ -17,7 +17,7 @@ const home = {
// name: 'homeIndex', // name: 'homeIndex',
// meta: { // meta: {
// title: '首页', // title: '首页',
// keepAlive: true, // keepAlive: false,
// // backApi: [], // // backApi: [],
// }, // },
// }, // },

8
hx-ai-intelligent/src/router/monitor.ts

@ -18,7 +18,7 @@ const equipment = {
component: () => import('/@/view/monitor/environmentMonitor/index.vue'), component: () => import('/@/view/monitor/environmentMonitor/index.vue'),
meta: { meta: {
title: '环境监测', title: '环境监测',
keepAlive: true, keepAlive: false,
// backApi: [], // backApi: [],
}, },
}, },
@ -37,7 +37,7 @@ const equipment = {
component: () => import('/@/view/monitor/deviceMonitor/index.vue'), component: () => import('/@/view/monitor/deviceMonitor/index.vue'),
meta: { meta: {
title: '设备监测', title: '设备监测',
keepAlive: true, keepAlive: false,
// backApi: [], // backApi: [],
}, },
}, },
@ -56,7 +56,7 @@ const equipment = {
component: () => import('/@/view/monitor/energyMonitor/index.vue'), component: () => import('/@/view/monitor/energyMonitor/index.vue'),
meta: { meta: {
title: '能耗监测', title: '能耗监测',
keepAlive: true, keepAlive: false,
// backApi: [], // backApi: [],
}, },
}, },
@ -75,7 +75,7 @@ const equipment = {
// component: () => import('/@/view/monitor/group/index.vue'), // component: () => import('/@/view/monitor/group/index.vue'),
// meta: { // meta: {
// title: '分组管理', // title: '分组管理',
// keepAlive: true, // keepAlive: false,
// // backApi: [], // // backApi: [],
// }, // },
// }, // },

4
hx-ai-intelligent/src/router/organizationManage.ts

@ -18,7 +18,7 @@ const organizationManage = {
component: () => import('/@/view/organizationManage/usermanage/index.vue'), component: () => import('/@/view/organizationManage/usermanage/index.vue'),
meta: { meta: {
title: '用户管理', title: '用户管理',
keepAlive: true, keepAlive: false,
operates: [ operates: [
{ title: '新增', code: 'userAdd' }, { title: '新增', code: 'userAdd' },
{ title: '导入', code: 'userImport' }, { title: '导入', code: 'userImport' },
@ -48,7 +48,7 @@ const organizationManage = {
component: () => import('/@/view/organizationManage/departmentManage/index.vue'), component: () => import('/@/view/organizationManage/departmentManage/index.vue'),
meta: { meta: {
title: '部门/权限', title: '部门/权限',
keepAlive: true, keepAlive: false,
operates: [ operates: [
{ title: '新增部门', code: 'authorityDeptAdd' }, { title: '新增部门', code: 'authorityDeptAdd' },
{ title: '新增子部门', code: 'authorityDeptSonAdd' }, { title: '新增子部门', code: 'authorityDeptSonAdd' },

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

@ -177,6 +177,25 @@
], ],
}, },
}, },
{
label: '是否创建工单',
field: 'createWorkOrder',
component: 'NsRadioGroup',
rules: [
{
required: true,
message: '是否创建工单不能为空',
trigger: 'change',
},
],
componentProps: {
radioType: 'radio',
options: [
{ label: '是', value: 1 },
{ label: '否', value: 0 },
],
},
},
], ],
}, },
}, },

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

@ -215,7 +215,7 @@
pageNum: 1, pageNum: 1,
pageSize: 99, pageSize: 99,
}, },
placeholder: '请选择设备点位', placeholder: '请选择设备名称',
resultField: 'data.records', resultField: 'data.records',
labelField: 'deviceName', labelField: 'deviceName',
valueField: 'id', valueField: 'id',

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

@ -196,8 +196,8 @@
}); });
}; };
// //
const selectDevice = (value: string) => { const selectDevice = () => {
console.log(`selected ${value}`); getDevicePoint({ id: infoObject.value.deviceName });
}; };
// //
const getDevicePage = (value: any) => { const getDevicePage = (value: any) => {

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

@ -195,6 +195,25 @@
], ],
}, },
}, },
{
label: '是否创建工单',
field: 'createWorkOrder',
component: 'NsRadioGroup',
rules: [
{
required: true,
message: '是否创建工单不能为空',
trigger: 'change',
},
],
componentProps: {
radioType: 'radio',
options: [
{ label: '是', value: 1 },
{ label: '否', value: 0 },
],
},
},
], ],
}, },
}, },

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

@ -4,21 +4,27 @@
<a-tab-pane key="1" tab="通知管理"> <a-tab-pane key="1" tab="通知管理">
<ns-view-list-table v-bind="notificationConfig" ref="mainRef"> <ns-view-list-table v-bind="notificationConfig" ref="mainRef">
<template #bodyCell="{ record, column }"> <template #bodyCell="{ record, column }">
<template v-if="column.dataIndex === 'enableRules'"> <template v-if="column.dataIndex === 'enableNotifications'">
<a-switch <a-switch
:checked="record.enableRules === 1 ? true : false" :checked="record.enableNotifications === 1 ? true : false"
:class="{ :class="{
'blue-background': record.enableRules === 1 ? true : false, 'blue-background': record.enableNotifications === 1 ? true : false,
'grey-background': record.enableRules === 1 ? false : true, 'grey-background': record.enableNotifications === 1 ? false : true,
}" }"
@change=" @change="
clickSwitch({ type: 1, enableRules: record.enableRules, record: record }) clickSwitch({ type: 1, enableRules: record.enableRules, record: record })
" /> " />
</template> </template>
<template v-if="column.dataIndex === 'prioritys'">
{{ record.priority ? record.priority.label : '' }}
</template>
<template v-if="column.dataIndex === 'notificationMethod'">
{{ getNotificationMethod(record.notificationMethod) }}
</template>
</template> </template>
</ns-view-list-table> </ns-view-list-table>
<!-- 联系方式 --> <!-- 联系方式 -->
<notificationManagement ref="notificationManagements" @editObject="editObject" /> <notificationManagement ref="notificationManagements" @updNotification="updNotification" />
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="2" tab="设备告警" force-render> <a-tab-pane key="2" tab="设备告警" force-render>
<ns-view-list-table <ns-view-list-table
@ -49,7 +55,7 @@
{{ record.repetitions.label }} {{ record.repetitions.label }}
</template> </template>
<template v-if="column.dataIndex === 'prioritys'"> <template v-if="column.dataIndex === 'prioritys'">
{{ record.priority.label }} {{ record.priority ? record.priority.label : '-' }}
</template> </template>
</template> </template>
</ns-view-list-table> </ns-view-list-table>
@ -90,7 +96,7 @@
{{ record.repetitions.label }} {{ record.repetitions.label }}
</template> </template>
<template v-if="column.dataIndex === 'prioritys'"> <template v-if="column.dataIndex === 'prioritys'">
{{ record.priority.label }} {{ record.priority ? record.priority.label : '-' }}
</template> </template>
</template> </template>
</ns-view-list-table> </ns-view-list-table>
@ -124,6 +130,7 @@
import { deviceAlarms } from '/@/api/alarmSettings/deviceAlarms'; import { deviceAlarms } from '/@/api/alarmSettings/deviceAlarms';
import { energyAlarms } from '/@/api/alarmSettings/energyAlarm'; import { energyAlarms } from '/@/api/alarmSettings/energyAlarm';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue'; import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { notificationManagementApi } from '/@/api/alarmSettings/notificationManagements';
export default { export default {
name: 'AlarmSettingsIndex', name: 'AlarmSettingsIndex',
@ -146,6 +153,22 @@
const equipmentAlarm = ref(true); const equipmentAlarm = ref(true);
const energyAlarm = ref(true); const energyAlarm = ref(true);
const notificationConfig = notificationtableConfig(notificationManagements); const notificationConfig = notificationtableConfig(notificationManagements);
//
const getNotificationMethod = (data: any) => {
if (!data) return '';
const methods = [];
const notifications = data.split(',');
notifications.forEach((notification) => {
if (notification === '1') {
methods.push('站内信息');
} else if (notification === '2') {
methods.push('邮件');
}
});
return methods.join('/');
};
// //
const energyAlarmConfig = energyAlarmConfigs( const energyAlarmConfig = energyAlarmConfigs(
editeEnergyAlarm, editeEnergyAlarm,
@ -169,6 +192,10 @@
energyAlarm.value = !energyAlarm.value; energyAlarm.value = !energyAlarm.value;
configureEnergyAlarms.value.show = false; configureEnergyAlarms.value.show = false;
}; };
//
const updNotification = () => {
mainRef.value?.nsTableRef.reload();
};
const clickSwitch = (data: any) => { const clickSwitch = (data: any) => {
NsModal.confirm({ NsModal.confirm({
title: '启用状态', title: '启用状态',
@ -182,12 +209,14 @@
if (data.type === 1) { if (data.type === 1) {
// //
http http
.post(deviceAlarms.addOrUpNewData, { .post(notificationManagementApi.upData, {
id: data.record.id, id: data.record.id,
enableRules: data.record.enableRules === 1 ? 0 : 1, enableNotifications: data.record.enableNotifications === 1 ? 0 : 1,
}) })
.then(() => { .then(() => {
NsMessage.success(data.record.enableRules === 1 ? '通知已关闭' : '通知已启用'); NsMessage.success(
data.record.enableNotifications === 1 ? '通知已关闭' : '通知已启用',
);
mainRef.value?.nsTableRef.reload(); mainRef.value?.nsTableRef.reload();
}); });
} }
@ -232,6 +261,8 @@
equipmentAlarmConfig, equipmentAlarmConfig,
editObject, editObject,
editeEnergyAlarm, editeEnergyAlarm,
updNotification,
getNotificationMethod,
clickSwitch, clickSwitch,
editEquipmentAlarm, editEquipmentAlarm,
notificationManagements, notificationManagements,

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

@ -10,10 +10,10 @@
@close="handleClose"> @close="handleClose">
<div style="width: 100%; overflow: hidden; overflow-y: hidden; height: 100%"> <div style="width: 100%; overflow: hidden; overflow-y: hidden; height: 100%">
<a-form ref="formRef" :model="infoObject" :rules="rules" style="width: 80%"> <a-form ref="formRef" :model="infoObject" :rules="rules" style="width: 80%">
<a-form-item ref="notification" label="通知方式" name="notification"> <a-form-item ref="notificationMethod" label="通知方式" name="notificationMethod">
<a-select <a-select
ref="select" ref="select"
v-model:value="infoObject.notification" v-model:value="infoObject.notificationMethod"
style="width: 100%" style="width: 100%"
mode="multiple" mode="multiple"
:options="devicePointData" :options="devicePointData"
@ -24,34 +24,18 @@
</a-form-item> </a-form-item>
<a-form-item label="启用规则"> <a-form-item label="启用规则">
<a-switch <a-switch
:checked="infoObject.enableRules === 1 ? true : false" :checked="infoObject.enableNotifications === 1 ? true : false"
:class="{ :class="{
'blue-background': infoObject.enableRules === 1 ? true : false, 'blue-background': infoObject.enableNotifications === 1 ? true : false,
'grey-background': infoObject.enableRules === 1 ? false : true, 'grey-background': infoObject.enableNotifications === 1 ? false : true,
}" }"
@click="clickSwitch" /> @click="clickSwitch" />
</a-form-item> </a-form-item>
</a-form> </a-form>
<div style="width: 100%; height: 765px; overflow-y: auto"> <div style="width: 100%; height: 765px; overflow-y: auto">
<div style="margin-bottom: 8px"> <div style="margin-bottom: 8px">
<div style="width: 100%; display: flex; position: relative"> <div style="width: 100%; display: flex; position: relative" class="ns-title-extra-box">
<div <span style="margin-left: 12px; color: #333333">联系人名单</span>
style="
border-width: 0px;
position: absolute;
left: 0px;
top: 5px;
width: 5px;
height: 15px;
background: inherit;
background-color: #2778ff;
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> </div>
<img <img
style="width: 100%; margin-top: -10px" style="width: 100%; margin-top: -10px"
@ -67,10 +51,10 @@
:pagination="pagination"> :pagination="pagination">
<template #bodyCell="{ record, column }"> <template #bodyCell="{ record, column }">
<template v-if="column.dataIndex === 'address'"> <template v-if="column.dataIndex === 'address'">
{{ record.userRoleInfos?.[0].deptRoleInfoList }} {{ record?.deptRoleInfoList || record.userRoleInfos?.[0].deptRoleInfoList }}
</template> </template>
<template v-if="column.dataIndex === 'operation'"> <template v-if="column.dataIndex === 'operation'">
<a style="color: rgb(210, 0, 5)" @click="remove(record)">移除</a> <a style="color: #2778ff" @click="remove(record)">移除</a>
</template> </template>
</template> </template>
</a-table> </a-table>
@ -85,12 +69,11 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue'; import { ref } from 'vue';
// import { NsMessage } from '/nerv-lib/component'; import { NsMessage } from '/nerv-lib/component';
// import { http } from '/nerv-lib/util'; import { http } from '/nerv-lib/util';
// import { number } from 'vue-types';
import linkPeople from './linkPeople/index.vue'; import linkPeople from './linkPeople/index.vue';
import { notificationManagementApi } from '/@/api/alarmSettings/notificationManagements';
// import { deviceAlarms } from '/@/api/alarmSettings/deviceAlarms'; import { async } from '@antv/x6/lib/registry/marker/async';
//table //table
const columns = [ const columns = [
@ -125,6 +108,8 @@
title: '部门', title: '部门',
dataIndex: 'address', dataIndex: 'address',
key: 'address', key: 'address',
width: 200,
textEllipsis: true,
}, },
{ {
title: '操作', title: '操作',
@ -160,7 +145,7 @@
dataSource.value.forEach((item) => { dataSource.value.forEach((item) => {
ids.push(item.userId); ids.push(item.userId);
}); });
linkPeoples.value.getData({ id: ids, data: dataSource }); linkPeoples.value.getData({ id: ids, data: dataSource.value });
}; };
// //
const handleCancel = () => { const handleCancel = () => {
@ -173,7 +158,7 @@
}; };
// //
const infoObject = ref({ const infoObject = ref({
enableRules: 0, enableNotifications: 0,
}); });
// //
const filterDevicePoint = (input: string, option: any) => { const filterDevicePoint = (input: string, option: any) => {
@ -181,45 +166,47 @@
}; };
// //
const clickSwitch = () => { const clickSwitch = () => {
if (infoObject.value.enableRules === 1) { if (infoObject.value.enableNotifications === 1) {
infoObject.value.enableRules = 0; infoObject.value.enableNotifications = 0;
} else { } else {
infoObject.value.enableRules = 1; infoObject.value.enableNotifications = 1;
} }
}; };
// //
const devicePointData = ref([ const devicePointData = ref([
{ label: '站内信息', value: 1 }, { label: '站内信息', value: '1' },
{ label: '邮件', value: 2 }, { label: '邮件', value: '2' },
]); ]);
const rules = { const rules = {
notification: [{ required: true, message: '请选择通知方式', trigger: 'change' }], notificationMethod: [{ required: true, message: '请选择通知方式', trigger: 'change' }],
user: [{ required: true, message: '请选择通知人', trigger: 'change' }], user: [{ required: true, message: '请选择通知人', trigger: 'change' }],
}; };
const formRef = ref(); const formRef = ref();
const emit = defineEmits(['editObject']); const emit = defineEmits(['updNotification']);
const toggle = (value: any) => { const toggle = async (value: any) => {
// //
if (value) { if (value) {
// // //
infoObject.value = { await http
enableRules: 0, .post(notificationManagementApi.findById, {
}; id: value.id,
// await http })
// .post(group.queryDeviceGroupTree, { .then((res) => {
// pageNum: 1, infoObject.value = res.data;
// pageSize: 999, if (infoObject.value.notificationMethod) {
// energyType: selectedOptions[0].dicKey, infoObject.value.notificationMethod = infoObject.value.notificationMethod.split(',');
// orgId: orgId.value, } else {
// }) infoObject.value.notificationMethod = [];
// .then((res) => { }
// jdTreeData.value = res.data; dataSource.value = res.data.hxAlarmNotifyUserList;
// }); });
} else { } else {
infoObject.value = { infoObject.value = {
enableRules: 0, enableNotifications: 0,
notificationMethod: [],
}; };
dataSource.value = [];
} }
visible.value = !visible.value; visible.value = !visible.value;
}; };
@ -233,24 +220,36 @@
dataSource.value = [...dataSource.value]; dataSource.value = [...dataSource.value];
}; };
const btnClick = () => { const btnClick = () => {
console.log(infoObject.value); if (dataSource.value.length === 0) {
NsMessage.warn('请选择联系人');
return;
}
//
formRef.value.validate().then(() => {
// //
let obj = {}; let obj = {
obj.selectList = []; id: null,
notificationMethod: null,
hxAlarmNotifyUserList: [],
enableNotifications: 0,
};
obj.notificationMethod = infoObject.value.notificationMethod.toString();
obj.id = infoObject.value.id;
obj.enableNotifications = infoObject.value.enableNotifications;
dataSource.value.forEach((item) => { dataSource.value.forEach((item) => {
obj.selectList.push({ obj.hxAlarmNotifyUserList.push({
userId: item.userId, userId: item.userId,
contactInformationId: infoObject.value.id,
}); });
}); });
console.log(obj, '数据');
//
formRef.value.validate().then(() => {
// //
// http.post(deviceAlarms.addOrUpNewData, infoObject.value).then(() => { http.post(notificationManagementApi.upData, obj).then((res) => {
// NsMessage.success(''); if (res.msg === 'success') {
// visible.value = false; NsMessage.success('操作成功');
// emit('editObject', null); visible.value = false;
// }); emit('updNotification', null);
}
});
}); });
}; };
const handleClose = () => { const handleClose = () => {

22
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagement/linkPeople/config.ts

@ -1,22 +0,0 @@
import { department } from '/@/api/origanizemanage';
export const editTreeConfig = (orgId) => ({
selectedKeys: ['0-0'],
defaultExpandAll: true,
api: department.queryDeptTree,
params: { orgId },
resultField: 'data.orgInfos',
fieldNames: { title: 'orgName', key: 'orgId' },
formConfig: {
schemas: [
{
field: 'orgName',
component: 'NsInput',
autoSubmit: true,
componentProps: {
placeholder: '请输入企业名称',
},
},
],
},
});

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

@ -8,9 +8,8 @@
@cancel="handleCancel"> @cancel="handleCancel">
<div class="box"> <div class="box">
<div class="box-left"> <div class="box-left">
<div style="width: 100%; display: flex; position: relative"> <div style="width: 100%; display: flex; position: relative" class="ns-title-extra-box">
<div class="border-card"></div> <span style="margin-left: 12px; color: #333333">联系人名单</span>
<span style="margin-left: 24px; color: #333333">联系人名单</span>
</div> </div>
<img <img
style="width: 100%; height: 2px" style="width: 100%; height: 2px"
@ -31,9 +30,8 @@
/></div> /></div>
</div> </div>
<div class="box-right"> <div class="box-right">
<div style="width: 100%; display: flex; position: relative"> <div style="width: 100%; display: flex; position: relative" class="ns-title-extra-box">
<div class="border-card"></div> <span style="margin-left: 12px; color: #333333">人员列表 </span>
<span style="margin-left: 24px; color: #333333">人员列表 </span>
<a-input-search <a-input-search
v-model:value="realName" v-model:value="realName"
style="margin-bottom: 8px; width: 280px; position: absolute; right: 20px" style="margin-bottom: 8px; width: 280px; position: absolute; right: 20px"
@ -191,6 +189,7 @@
orgId: selectOrgId.value, orgId: selectOrgId.value,
deptId: selectDeptId.value, deptId: selectDeptId.value,
realName: realName.value, realName: realName.value,
userStatus: 0,
}) })
.then((res) => { .then((res) => {
dataSource.value = res.data.records; dataSource.value = res.data.records;
@ -206,7 +205,25 @@
const onSelectChange = (selectedRowKeys: any, selectedRows: any) => { const onSelectChange = (selectedRowKeys: any, selectedRows: any) => {
selectedRowKey.value = selectedRowKeys; selectedRowKey.value = selectedRowKeys;
selectedRow.value = selectedRows; // 使 forEach selectedRows
let newSelectRows = [];
selectedRows.forEach((item, index) => {
if (item) {
newSelectRows.push(item);
}
});
// userId selectedRow.value
selectedRow.value = [
...selectedRow.value,
...newSelectRows.filter(
(newRow: any) =>
!selectedRow.value.some((existingRow) => existingRow.userId === newRow.userId),
),
];
// userId
selectedRow.value = selectedRow.value.filter((existingRow: any) =>
selectedRowKeys.includes(existingRow.userId),
);
}; };
const pagination = ref({ const pagination = ref({
total: 0, total: 0,
@ -252,6 +269,8 @@
pagination.value.current = 1; pagination.value.current = 1;
realName.value = null; realName.value = null;
searchValue.value = ''; searchValue.value = '';
selectDeptId.value = '';
selectOrgId.value = orgId.value;
}; };
const getData = (data: any) => { const getData = (data: any) => {
selectedRow.value = data.data; selectedRow.value = data.data;
@ -265,16 +284,18 @@
const show = ref(false); const show = ref(false);
const handleCancel = () => { const handleCancel = () => {
// //
pagination.value.current = 1;
realName.value = null;
emit('handleCancel', null); emit('handleCancel', null);
show.value = false; show.value = false;
pagination.value.current = 1;
realName.value = null;
searchValue.value = '';
selectDeptId.value = '';
selectOrgId.value = orgId.value;
}; };
watch(searchValue, (value) => { watch(searchValue, (value) => {
const expanded = dataList const expanded = dataList
.map((item: TreeProps['treeData'][number]) => { .map((item: TreeProps['treeData'][number]) => {
if (item.title.indexOf(value) > -1) { if (item.title.indexOf(value) > -1) {
console.log(item.title.indexOf(value));
return getParentKey(item.key, deptTreeData.value); return getParentKey(item.key, deptTreeData.value);
} }
return null; return null;
@ -317,21 +338,6 @@
}); });
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.border-card {
border-width: 0px;
position: absolute;
left: 0px;
top: 5px;
width: 5px;
height: 15px;
background: inherit;
background-color: @primary-color;
border: none;
border-radius: 5px;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
.box { .box {
width: 100%; width: 100%;
height: 500px; height: 500px;

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

@ -98,10 +98,11 @@ export const energyAlarmConfigs = (
name: 'energyAlarmEdit', name: 'energyAlarmEdit',
dynamicParams: ['uuid', 'appealType'], dynamicParams: ['uuid', 'appealType'],
handle: (data: any) => { handle: (data: any) => {
data.monitorFrequency = data.monitorFrequency.value; const obj = { ...data };
data.priority = data.priority.value; obj.monitorFrequency = data.monitorFrequency.value;
data.repetitions = data.repetitions.value; obj.priority = data.priority.value;
editeEnergyAlarm.value.toggle(data); obj.repetitions = data.repetitions.value;
editeEnergyAlarm.value.toggle(obj);
}, },
}, },
{ {

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

@ -1,9 +1,7 @@
import data from '../notificationManagementMock.json';
import { http } from '/nerv-lib/util'; import { http } from '/nerv-lib/util';
import { NsMessage } from '/nerv-lib/component'; import { NsMessage } from '/nerv-lib/component';
import { deviceAlarms } from '/@/api/alarmSettings/deviceAlarms'; import { deviceAlarms } from '/@/api/alarmSettings/deviceAlarms';
import { ref } from 'vue';
const tableKeyMap = [ const tableKeyMap = [
{ {
title: '序号', title: '序号',
@ -37,7 +35,6 @@ const tableKeyMap = [
dataIndex: 'enableRules', dataIndex: 'enableRules',
}, },
]; ];
const mockData = ref(data.listData);
const doWnload = (url: any) => { const doWnload = (url: any) => {
const a = document.createElement('a'); const a = document.createElement('a');
document.body.appendChild(a); document.body.appendChild(a);
@ -57,7 +54,6 @@ export const equipmentAlarmTableConfig = (
return { return {
title: '告警规则', title: '告警规则',
api: deviceAlarms.getTableList, api: deviceAlarms.getTableList,
value: mockData.value,
headerActions: [ headerActions: [
{ {
label: '新增', label: '新增',
@ -103,10 +99,11 @@ export const equipmentAlarmTableConfig = (
name: 'equipmentAlarmEdit', name: 'equipmentAlarmEdit',
dynamicParams: ['uuid', 'appealType'], dynamicParams: ['uuid', 'appealType'],
handle: (data: any) => { handle: (data: any) => {
data.priority = data.priority.value; const obj = { ...data };
data.repetitions = data.repetitions.value; obj.priority = data.priority.value;
data.monitorTimeUnit = data.monitorTimeUnit.value; obj.repetitions = data.repetitions.value;
editEquipmentAlarm.value.toggle(data); obj.monitorTimeUnit = data.monitorTimeUnit.value;
editEquipmentAlarm.value.toggle(obj);
}, },
}, },
{ {

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

@ -1,7 +1,8 @@
import { dateUtil } from '/nerv-lib/util/date-util'; import { dateUtil } from '/nerv-lib/util/date-util';
import data from '../notificationManagementMock.json';
import { http } from '/nerv-lib/util'; import { http } from '/nerv-lib/util';
import { notificationManagementApi } from '/@/api/alarmSettings/notificationManagements';
import { ref } from 'vue'; import { ref } from 'vue';
const tableKeyMap = [ const tableKeyMap = [
{ {
title: '序号', title: '序号',
@ -12,43 +13,41 @@ const tableKeyMap = [
}, },
{ {
title: '优先级', title: '优先级',
dataIndex: 'id', dataIndex: 'prioritys',
}, },
{ {
title: '告警类型', title: '告警类型',
dataIndex: 'deviceCode', dataIndex: 'alarmTypeName',
}, },
{ {
title: '告警标题', title: '告警标题',
dataIndex: 'deviceName', dataIndex: 'alarmTitle',
}, },
{ {
title: '错误码', title: '错误码',
dataIndex: 'position', dataIndex: 'errorCode',
}, },
{ {
title: '通知名单', title: '通知名单',
dataIndex: 'position', dataIndex: 'notificationList',
width: 150,
textEllipsis: true, textEllipsis: true,
}, },
{ {
title: '通知方式', title: '通知方式',
dataIndex: 'position', dataIndex: 'notificationMethod',
}, },
{ {
title: '启用通知', title: '启用通知',
dataIndex: 'enableRules', dataIndex: 'enableNotifications',
}, },
]; ];
const mockData = ref(data.listData);
export const notificationtableConfig = (notificationManagements: any) => { export const notificationtableConfig = (notificationManagements: any) => {
return { return {
title: '告警规则', title: '告警规则',
// api: '/carbon_emission/device/getDeviceList', api: notificationManagementApi.getTableList,
value: mockData.value, headerActions: [],
headerActions: [{}],
columns: tableKeyMap, columns: tableKeyMap,
// rowSelection: null, 选择按钮
columnActions: { columnActions: {
title: '操作', title: '操作',
actions: [ actions: [
@ -66,70 +65,75 @@ export const notificationtableConfig = (notificationManagements: any) => {
formConfig: { formConfig: {
schemas: [ schemas: [
{ {
field: 'name', field: 'alarmType',
label: '告警类型', label: '告警类型',
component: 'NsSelect', component: 'NsSelect',
componentProps: { componentProps: {
placeholder: '请选告警类型', placeholder: '请选告警类型',
allowClear: true,
options: [ options: [
{ {
label: '设备告警', label: '设备告警',
value: '1', value: 1,
}, },
{ {
label: '网关告警', label: '网关告警',
value: '2', value: 2,
}, },
{ {
label: '能耗告警', label: '能耗告警',
value: '3', value: 3,
}, },
], ],
}, },
}, },
{ {
field: 'provider', field: 'priority',
label: '告警优先级', label: '告警优先级',
component: 'NsSelect', component: 'NsSelect',
componentProps: { componentProps: {
placeholder: '请选择告警优先级', placeholder: '请选择告警优先级',
allowClear: true,
options: [ options: [
{ {
label: '紧急', label: '紧急',
value: '1', value: 1,
}, },
{ {
label: '重要', label: '重要',
value: '1', value: 2,
}, },
{ {
label: '一般', label: '一般',
value: '2', value: 3,
}, },
], ],
}, },
}, },
{ {
field: 'provider', field: 'alarmTitle',
label: '告警标题', label: '告警标题',
component: 'NsInput', component: 'NsInput',
componentProps: { componentProps: {
allowClear: true,
placeholder: '请输入告警标题关键字', placeholder: '请输入告警标题关键字',
}, },
}, },
{ {
field: 'provider', field: 'errorCode',
label: '错误码', label: '错误码',
component: 'NsInput', component: 'NsInput',
componentProps: { componentProps: {
allowClear: true,
placeholder: '请输入告警错误码', placeholder: '请输入告警错误码',
}, },
}, },
{ {
field: 'payWay', field: 'enableNotifications',
label: '启用状态', label: '启用状态',
component: 'NsSelect', component: 'NsSelect',
componentProps: { componentProps: {
allowClear: true,
placeholder: '请选择启用状态', placeholder: '请选择启用状态',
options: [ options: [
{ {

8
hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/look.vue

@ -17,14 +17,14 @@
display: flex; display: flex;
position: relative; position: relative;
font-size: 16px; font-size: 16px;
border-bottom: 1px solid rgb(255, 118, 2); /* 设置底部边框为1像素实线,并指定颜色 */ border-bottom: 1px solid #2778ff; /* 设置底部边框为1像素实线,并指定颜色 */
"> ">
<div class="card"></div> <div class="card"></div>
<div style="left: 25px; position: absolute; height: 35px; line-height: 35px"> <div style="left: 25px; position: absolute; height: 35px; line-height: 35px">
告警编号20230310001 告警编号20230310001
</div> </div>
<div style="right: 20px; position: absolute; height: 35px; line-height: 35px"> <div style="right: 20px; position: absolute; height: 35px; line-height: 35px">
15点08分 2024-03-10 15:08:10
</div> </div>
</div> </div>
<!-- center --> <!-- center -->
@ -38,7 +38,7 @@
<a-descriptions-item label="状态">新告警</a-descriptions-item> <a-descriptions-item label="状态">新告警</a-descriptions-item>
<a-descriptions-item label="错误码">C003</a-descriptions-item> <a-descriptions-item label="错误码">C003</a-descriptions-item>
<a-descriptions-item label="告警描述" <a-descriptions-item label="告警描述"
><div style="color: #ff7602">用电量超标</div> 当日用电量超出预设值</a-descriptions-item ><div style="color: #2778ff">用电量超标</div> 当日用电量超出预设值</a-descriptions-item
> >
<a-descriptions-item label="设备信息"> 1栋10层低压柜 </a-descriptions-item> <a-descriptions-item label="设备信息"> 1栋10层低压柜 </a-descriptions-item>
<a-descriptions-item label="重复次数"> 0 </a-descriptions-item> <a-descriptions-item label="重复次数"> 0 </a-descriptions-item>
@ -233,7 +233,7 @@
top: 0px; top: 0px;
width: 5px; width: 5px;
height: 35px; height: 35px;
background-color: rgb(254, 118, 2); background-color: #2778ff;
} }
:deep(.ant-descriptions-item-label) { :deep(.ant-descriptions-item-label) {
width: 25%; width: 25%;

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

@ -1,7 +1,7 @@
<template> <template>
<ns-drawer <ns-drawer
v-model:visible="visible" v-model:visible="visible"
width="520" width="550"
:title="' '" :title="' '"
:footer-style="{ textAlign: 'right' }" :footer-style="{ textAlign: 'right' }"
:ok="btnClick" :ok="btnClick"
@ -9,53 +9,34 @@
placement="right" placement="right"
@close="handleClose"> @close="handleClose">
<a-tabs> <a-tabs>
<a-tab-pane key="1" tab="更新状态">Content of Tab Pane 1</a-tab-pane> <a-tab-pane key="1" tab="更新状态">
<a-tab-pane key="2" tab="状态流程"> <div style="width: 100%; padding: 24px">
<!-- <a-steps direction="vertical" :current="4"> <a-form ref="formRef" :model="infoObject" :rules="rules">
<template v-for="index in 4"> <a-form-item ref="status" label="当前状态" name="status">
<a-step> <a-select
<template #icon> v-model:value="infoObject.status"
<img src="../../../../src/icon/status-off.svg" /> show-search
</template> placeholder="请选择设备点位"
<template #description> style="width: 85%"
<div :options="statusOptions"
style=" :filter-option="filterDevicePoint" />
width: 400px; </a-form-item>
min-height: 40px; <a-form-item label="备注" name="desc">
background-color: #f8fafc; <a-textarea
margin-left: 20px; v-model:value="infoObject.desc"
border-radius: 4px; /* 设置圆角半径 */ placeholder="请输入异常描述"
padding: 12px; style="width: 85%"
"> :autoSize="{ minRows: 4, maxRows: 4 }" />
<div style="width: 100%; height: 40px; display: flex; position: relative"> </a-form-item>
<a-tag style="width: 60px; height: 20px; text-align: center" color="#04d919" </a-form>
>已完成</a-tag
>
<div
style="
position: absolute;
left: 30%;
top: -2px;
transform: translateX(-50%);
color: #3a3a3a;
"
>李四</div
>
<div style="position: absolute; right: 10px; top: -2px; color: #ff7602"
>2024-03-11 11:30:06</div
>
</div> </div>
<div style="width: 100%; color: #3a3a3a"> 工单已完成并通过验收 </div> </a-tab-pane>
</div> <a-tab-pane key="2" tab="状态流程">
</template>
</a-step>
</template>
</a-steps> -->
<NsSteps v-bind="config" /> <NsSteps v-bind="config" />
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
<template #footer> <template #footer>
<a-button style="margin-right: 8px" type="primary" @click="createOrder">创建工单</a-button> <!-- <a-button style="margin-right: 8px" type="primary" @click="createOrder">创建工单</a-button> -->
<a-button type="primary" @click="btnClick">确定</a-button> <a-button type="primary" @click="btnClick">确定</a-button>
</template> </template>
</ns-drawer> </ns-drawer>
@ -72,6 +53,14 @@
setup() { setup() {
const visible = ref(false); const visible = ref(false);
const infoObject = ref({});
const statusOptions = ref([
{ value: '0', label: '待处理' },
{ value: '1', label: '处理中' },
{ value: '2', label: '已完成' },
{ value: '3', label: '超时' },
{ value: '4', label: '已关闭' },
]);
const logList = ref([ const logList = ref([
{ name: '李四', status: '2' }, { name: '李四', status: '2' },
{ name: '王五', status: '4' }, { name: '王五', status: '4' },
@ -91,6 +80,8 @@
}; };
const toggle = (data) => { const toggle = (data) => {
console.log(data, 'data'); console.log(data, 'data');
infoObject.value = logList.value[0];
console.log(infoObject.value, 'infoObject.value');
visible.value = true; visible.value = true;
}; };
const createOrder = () => { const createOrder = () => {
@ -120,6 +111,8 @@
}); });
}; };
return { return {
infoObject,
statusOptions,
btnClick, btnClick,
createOrder, createOrder,
visible, visible,
@ -131,4 +124,10 @@
}, },
}); });
</script> </script>
<style scoped lang="less"></style> <style scoped lang="less">
:deep(.ant-form-item-label) {
z-index: 20;
text-align: right;
width: 17%;
}
</style>

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

@ -145,7 +145,7 @@ export const notificationtableConfig = (look: any, status: any) => {
fieldMap: ['manufactureBeginDate', 'manufactureEndDate'], fieldMap: ['manufactureBeginDate', 'manufactureEndDate'],
componentProps: { componentProps: {
valueFormat: 'YYYY-MM-DD', valueFormat: 'YYYY-MM-DD',
placeholder: ['设备生产开始日期', '设备生产结束日期'], placeholder: ['开始日期', '结束日期'],
}, },
}, },
], ],

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

@ -707,16 +707,17 @@
{ {
field: 'emissionProcess', field: 'emissionProcess',
label: '排放环节', label: '排放环节',
component: 'NsSelect', component: 'NsInput',
componentProps: { componentProps: {
allowClear: true, // allowClear: true,
placeholder: '请选择排放环节', placeholder: '请选择排放环节',
options: [ maxLength: 30,
{ // options: [
label: '消费环节', // {
value: 0, // label: '',
} // value: 0,
], // }
// ],
}, },
}, },
{ {

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

@ -0,0 +1,306 @@
<template>
<div>
<!-- <a-table
:columns="column"
:data-source="data"
bordered
:pagination="false"
:scroll="{ x: 2000 }">
<template #title>
<a-date-picker v-model:value="selectYear" picker="year" @change="changeYearData" valueFormat="YYYY" />
</template>
</a-table> -->
<ns-view-list-table v-bind="tableConfig" :model="data" ref="mainRef" />
<!-- <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" /> -->
</div>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import { http } from '/nerv-lib/util/http';
import { Pagination } from 'ant-design-vue';
import dayjs, { Dayjs } from 'dayjs';
import { carbonEmission } from '/@/api/carbonEmissionFactorLibrary';
defineOptions({
energyType: 'CarbonEmissions', // name
components: {
'a-pagination': Pagination,
},
});
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
const fetch = (api, params = { orgId } ) => {
return http.post(api, params);
};
const data = ref([]);
const selectYear = ref<Dayjs>(dayjs( new Date().getFullYear().toString()));
const total = ref<number>()
const queryParams = ref({
pageNum: 1,
pageSize: 10,
year: selectYear.value.format('YYYY'),
orgId: orgId.value
})
//
// const changeYearData = () => {
// queryParams.value.year = selectYear.value
// getTableList()
// }
//
const mainRef = ref();
const column: TableColumnsType [] = [
{
title: '排放类型',
dataIndex: 'cnValue',
customCell: (record, rowIndex) => {
if (rowIndex == undefined) {
return {
rowSpan: 0,
colSpan: 0,
};
}
const rowSpan = getRowSpan('cnValue', record, data.value);
if (rowIndex != 0 && data.value[rowIndex - 1].name == record.name) {
return {
rowSpan: 0,
colSpan: 0,
};
}
return {
rowSpan: rowSpan,
};
},
},
{
title: '能源种类',
dataIndex: 'energyType',
},
{
title: '计量单位',
dataIndex: 'unit',
},
{
title: '加权平均',
dataIndex: 'averageFactorValue',
},
{
title: '全年',
dataIndex: 'carbonYearly',
},
{
title: '1月',
dataIndex: 'jan',
},
{
title: '2月',
dataIndex: 'feb',
},
{
title: '3月',
dataIndex: 'mar',
},
{
title: '4月',
dataIndex: 'apr',
},
{
title: '5月',
dataIndex: 'may',
},
{
title: '6月',
dataIndex: 'jun',
},
{
title: '7月',
dataIndex: 'jul',
},
{
title: '8月',
dataIndex: 'aug',
},
{
title: '9月',
dataIndex: 'sep',
},
{
title: '10月',
dataIndex: 'oct',
},
{
title: '11月',
dataIndex: 'nov',
},
{
title: '12月',
dataIndex: 'dec',
},
];
const year = ref(selectYear.value.format('YYYY'))
const tableConfig = ref({
title: '碳排统计',
api: carbonEmission.carbonEmissionStatistics,
params: {
orgId,
year
},
columns: [
{
title: '排放类型',
dataIndex: 'cnValue',
customCell: (record, rowIndex) => {
if (rowIndex == undefined) {
return {
rowSpan: 0,
colSpan: 0,
};
}
const rowSpan = getRowSpan('cnValue', record, data.value);
if (rowIndex != 0 && data.value[rowIndex - 1].name == record.name) {
return {
rowSpan: 0,
colSpan: 0,
};
}
return {
rowSpan: rowSpan,
};
},
},
{
title: '能源种类',
dataIndex: 'energyType',
},
{
title: '计量单位',
dataIndex: 'unit',
},
{
title: '加权平均',
dataIndex: 'averageFactorValue',
},
{
title: '全年',
dataIndex: 'carbonYearly',
},
{
title: '1月',
dataIndex: 'jan',
},
{
title: '2月',
dataIndex: 'feb',
},
{
title: '3月',
dataIndex: 'mar',
},
{
title: '4月',
dataIndex: 'apr',
},
{
title: '5月',
dataIndex: 'may',
},
{
title: '6月',
dataIndex: 'jun',
},
{
title: '7月',
dataIndex: 'jul',
},
{
title: '8月',
dataIndex: 'aug',
},
{
title: '9月',
dataIndex: 'sep',
},
{
title: '10月',
dataIndex: 'oct',
},
{
title: '11月',
dataIndex: 'nov',
},
{
title: '12月',
dataIndex: 'dec',
},
],
formConfig: {
schemas: [
{
field: 'year',
label: '年份',
component: 'NsDatePicker',
componentProps: {
picker: 'year',
valueFormat: 'YYYY',
defaultValue: selectYear.value.format('YYYY'),
},
},
],
params: {},
},
rowKey: 'id',
});
//
const getRowSpan = (dataIndex: string, record: any, data: any, dependents: string[] = []) => {
let rowSpan = 1;
for (let i = data.indexOf(record) + 1; i < data.length; i++) {
let shouldMerge = true;
for (const dependent of dependents) {
if (data[i][dependent] !== record[dependent]) {
shouldMerge = false;
break;
}
}
if (shouldMerge && data[i][dataIndex] === record[dataIndex]) {
rowSpan++;
} else {
break;
}
}
return rowSpan;
};
//
// const getTableList = () => {
// fetch(carbonEmission.carbonEmissionStatistics , queryParams.value).then((res) => {
// data.value = res.data.records
// total.value = res.data.total
// });
// };
//
// const onChange = (pageNumber: number,size: number) => {
// queryParams.value.pageNum = pageNumber;
// queryParams.value.pageSize = size;
// getTableList()
// };
</script>
<style scoped lang="less">
::v-deep .ant-table-title{
display: flex;
}
::v-deep .ant-table-container{
padding: 0px 16px;
}
</style>
<style scoped>
th.column-money,
td.column-money {
text-align: right !important;
}
</style>

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

@ -83,7 +83,7 @@
}, },
{ {
title: '计量单位', title: '计量单位',
dataIndex: 'unit', dataIndex: 'unitName',
}, },
{ {
title: '加权平均', title: '加权平均',

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

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<a-table <!-- <a-table
:columns="tableColumns" :columns="tableColumns"
:data-source="data" :data-source="data"
bordered bordered
@ -26,15 +26,16 @@
<a-button type="primary">凭证下载</a-button> <a-button type="primary">凭证下载</a-button>
</div> </div>
</template> </template>
</a-table> </a-table> -->
<a-pagination <ns-view-list-table v-bind="tableConfig" :model="data" ref="mainRef" :scroll="{ x: 1500}" />
<!-- <a-pagination
:current="queryParams.pageNum" :current="queryParams.pageNum"
:total="total" :total="total"
:page-size="queryParams.pageSize" :page-size="queryParams.pageSize"
style="display: flex;justify-content: center;margin-top: 16px;" style="display: flex;justify-content: center;margin-top: 16px;"
:show-size-changer="true" :show-size-changer="true"
:show-quick-jumper="true" :show-quick-jumper="true"
@change="onChange" /> @change="onChange" /> -->
<!-- 新增数据库数据 --> <!-- 新增数据库数据 -->
<a-drawer <a-drawer
:width="500" :width="500"
@ -158,6 +159,7 @@
import { Pagination,message,Modal } from 'ant-design-vue'; import { Pagination,message,Modal } from 'ant-design-vue';
import { InboxOutlined } from '@ant-design/icons-vue'; import { InboxOutlined } from '@ant-design/icons-vue';
import type { CascaderProps,TreeSelectProps,UploadChangeParam } from 'ant-design-vue'; import type { CascaderProps,TreeSelectProps,UploadChangeParam } from 'ant-design-vue';
import { NsMessage } from '/nerv-lib/component';
import dayjs, { Dayjs } from 'dayjs'; import dayjs, { Dayjs } from 'dayjs';
import { http } from '/nerv-lib/util/http'; import { http } from '/nerv-lib/util/http';
import { tableColumns } from '../config'; import { tableColumns } from '../config';
@ -212,7 +214,9 @@
const wrapperCol = { span: 19 }; const wrapperCol = { span: 19 };
const switchLabelCol = { span: 10 }; const switchLabelCol = { span: 10 };
const switchWrapperCol = { span: 14 }; const switchWrapperCol = { span: 14 };
const formState = ref({}) const formState = ref({
orgId: orgId.value,
})
// form // form
const rules: Record<string, Rule[]> = { const rules: Record<string, Rule[]> = {
energyType: [{ required: true, message: '请输入能源种类', trigger: 'change' }], energyType: [{ required: true, message: '请输入能源种类', trigger: 'change' }],
@ -229,19 +233,182 @@
queryParams.value.year = selectYear.value queryParams.value.year = selectYear.value
getTableList() getTableList()
} }
const mainRef = ref();
const year = selectYear.value.format('YYYY')
const tableConfig = ref({
title: '能耗统计',
api: energyConsumption.pageList,
params: queryParams.value,
headerActions: [
{
label: '新增',
name: 'userAdd',
type: 'primary',
handle: () => {
getDictList()
visible.value = true
},
},
{
label: '导入',
type: 'primary',
name: 'userImport',
handle: () => {},
},
{
label: '导出',
type: 'primary',
name: 'userExports',
},
{
label: '模板下载',
type: 'primary',
name: 'userExports',
},
{
label: '上传凭证',
type: 'primary',
handle: () => {
openUpload.value = true;
},
},
{
label: '凭证下载',
type: 'primary',
name: 'userExports',
},
],
columns: [
{
title: '序号',
customRender: (text: any) => {
return text.index + 1;
},
},
{
title: '能源种类',
dataIndex: 'energyType',
},
{
title: '计量单位',
className: 'unitName',
dataIndex: 'unitName',
},
{
title: '全年',
dataIndex: 'yearly',
},
{
title: '1月',
dataIndex: 'jan',
// customRender: ({ text, record }) => ({
// children: text,
// attrs: {
// style: record.janFlag === 1 ? 'color: red' : 'color: blue'
// }
// })
},
{
title: '2月',
dataIndex: 'feb',
},
{
title: '3月',
dataIndex: 'mar',
},
{
title: '4月',
dataIndex: 'apr',
},
{
title: '5月',
dataIndex: 'may',
},
{
title: '6月',
dataIndex: 'jun',
},
{
title: '7月',
dataIndex: 'jul',
},
{
title: '8月',
dataIndex: 'aug',
},
{
title: '9月',
dataIndex: 'sep',
},
{
title: '10月',
dataIndex: 'oct',
},
{
title: '11月',
dataIndex: 'nov',
},
{
title: '12月',
dataIndex: 'dec',
},
],
columnActions: {
title: '操作',
actions: [
{
label: '编辑',
name: 'userEdit',
handle: (record: any) => {
getDictList()
visible.value = true
fetch(energyConsumption.findById , {id : record.id }).then((res) => {
// if(res.data.unit){
// res.data.unit = res.data.unit.split(',')
// }
formState.value = res.data
});
},
},
{
label: '删除',
name: 'userDelete',
dynamicParams: { id: 'id' },
confirm: true,
isReload: true,
api: energyConsumption.del,
},
],
},
formConfig: {
schemas: [
{
field: 'year',
label: '年份',
component: 'NsDatePicker',
componentProps: {
picker: 'year',
valueFormat: 'YYYY',
defaultValue: selectYear.value.format('YYYY'),
},
},
],
params: {},
},
rowKey: 'id',
});
// //
const getTableList = () => { const getTableList = () => {
fetch(energyConsumption.pageList , queryParams.value).then((res) => { fetch(energyConsumption.pageList , queryParams.value).then((res) => {
data.value = res.data.records data.value = res.data.records
total.value = res.data.total
}); });
}; };
getTableList()
// //
const onChange = (pageNumber: number,size: number) => { const onChange = (pageNumber: number,size: number) => {
queryParams.value.pageNum = pageNumber; queryParams.value.pageNum = pageNumber;
queryParams.value.pageSize = size; queryParams.value.pageSize = size;
getTableList() mainRef.value?.nsTableRef.reload();
}; };
// //
const changeRadio = (e) => { const changeRadio = (e) => {
@ -258,28 +425,29 @@
.then(() => { .then(() => {
console.log('values', formState, toRaw(formState)); console.log('values', formState, toRaw(formState));
if(formState.value.unit){ if(formState.value.unit){
formState.value.unit = formState.value.unit.join(',') formState.value.unit = formState.value.unit.join(',').split(',')[1]
} }
if(formState.value.id){ if(formState.value.id){
fetch(energyConsumption.update , formState.value).then((res) => { fetch(energyConsumption.update , formState.value).then((res) => {
visible.value = false visible.value = false
formState.value = {
orgId: orgId.value,
}
message.success('操作成功!'); message.success('操作成功!');
getTableList() mainRef.value?.nsTableRef.reload();
}); });
}else{ }else{
fetch(energyConsumption.creat , formState.value).then((res) => { fetch(energyConsumption.creat , formState.value).then((res) => {
if(res.data === '新增数据已存在'){ if(res.data === '新增数据已存在'){
visible.value = false visible.value = false
queryParams.value = formState.value NsMessage.warning(res.data);
queryParams.value.pageNum = 1,
queryParams.value.pageSize = 10,
queryParams.value.orgId = orgId.value,
queryParams.value.year = selectYear.value.format('YYYY')
getTableList()
}else{ }else{
visible.value = false visible.value = false
formState.value = {
orgId: orgId.value,
}
message.success('操作成功!'); message.success('操作成功!');
getTableList() mainRef.value?.nsTableRef.reload();
} }
}); });
} }
@ -298,10 +466,10 @@
fetch(carbonEmissionFactorLibrary.dictionaryUnitManagement, { grp: 'MEASUREMENT_UNIT'}).then((res) => { fetch(carbonEmissionFactorLibrary.dictionaryUnitManagement, { grp: 'MEASUREMENT_UNIT'}).then((res) => {
measurementUnit.value = res.data measurementUnit.value = res.data
measurementUnit.value = measurementUnit.value.map(item => ({ measurementUnit.value = measurementUnit.value.map(item => ({
value: item.cnValue, value: item.id,
label: item.cnValue, label: item.cnValue,
children: item.children ? item.children.map(child => ({ children: item.children ? item.children.map(child => ({
value: child.cnValue, value: child.id,
label: child.cnValue label: child.cnValue
})) : [] })) : []
})); }));
@ -310,10 +478,10 @@
fetch(group.queryDeviceGroupTree, { energyType: 'ELECTRICITY_USAGE',orgId: orgId.value }).then((res) => { fetch(group.queryDeviceGroupTree, { energyType: 'ELECTRICITY_USAGE',orgId: orgId.value }).then((res) => {
treeData.value = res.data treeData.value = res.data
treeData.value = treeData.value.map(item => ({ treeData.value = treeData.value.map(item => ({
value: item.pointName, value: item.id,
label: item.pointName, label: item.pointName,
children: item.children ? item.children.map(child => ({ children: item.children ? item.children.map(child => ({
value: child.pointName, value: child.id,
label: child.pointName label: child.pointName
})) : [] })) : []
})); }));
@ -329,8 +497,8 @@
getDictList() getDictList()
visible.value = true visible.value = true
fetch(energyConsumption.findById , {id : record.id }).then((res) => { fetch(energyConsumption.findById , {id : record.id }).then((res) => {
if(res.data.unit){ if(res.data.unitName){
res.data.unit = res.data.unit.split(',') res.data.unitName = res.data.unitName.split(',')
} }
formState.value = res.data formState.value = res.data
}); });
@ -346,7 +514,7 @@
onOk() { onOk() {
fetch(energyConsumption.del , {id : record.id }).then((res) => { fetch(energyConsumption.del , {id : record.id }).then((res) => {
message.success('操作成功!'); message.success('操作成功!');
getTableList() mainRef.value?.nsTableRef.reload();
}); });
}, },
onCancel() { onCancel() {
@ -357,6 +525,9 @@
// //
const onClose = () => { const onClose = () => {
visible.value = false; visible.value = false;
formState.value = {
orgId: orgId.value,
}
formRef.value.resetFields(); formRef.value.resetFields();
}; };
// //

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

@ -39,7 +39,7 @@
</div> </div>
</div> </div>
<div class="right"> <div class="right">
<a-table <!-- <a-table
:columns="columns" :columns="columns"
:data-source="tableData" :data-source="tableData"
bordered bordered
@ -59,7 +59,8 @@
<a-button type="primary" @click="addNewData">新增</a-button> <a-button type="primary" @click="addNewData">新增</a-button>
</div> </div>
</template> </template>
</a-table> </a-table> -->
<ns-view-list-table v-bind="tableConfig" :model="tableData" ref="mainRef" />
<a-pagination <a-pagination
:current="queryParams.pageNum" :current="queryParams.pageNum"
:total="total" :total="total"
@ -139,6 +140,7 @@
const fetch = (api, params = { orgId } ) => { const fetch = (api, params = { orgId } ) => {
return http.post(api, params); return http.post(api, params);
}; };
const mainRef = ref();
// //
const x = 3; const x = 3;
const y = 2; const y = 2;
@ -209,12 +211,13 @@
autoExpandParent.value = false; autoExpandParent.value = false;
}; };
// //
const energyType = ref()
const onSelect = (selectedKey: string[], info: any) => { const onSelect = (selectedKey: string[], info: any) => {
selectedKeys.value = selectedKey; selectedKeys.value = selectedKey;
if(info.selected){ if(info.selected){
queryParams.value.energyType = info.node.id energyType.value = info.node.id
statsId.value = info.node.id statsId.value = info.node.id
getTableList() mainRef.value?.nsTableRef.reload();
} }
}; };
@ -239,10 +242,9 @@
const getTreeData = () => { const getTreeData = () => {
fetch(quickCalculation.carbonQuickTree).then((res) => { fetch(quickCalculation.carbonQuickTree).then((res) => {
gData.value = res.data gData.value = res.data
debugger energyType.value = gData.value[0].children[0].id
queryParams.value.energyType = gData.value[0].children[0].id
statsId.value = gData.value[0].children[0].id statsId.value = gData.value[0].children[0].id
getTableList() mainRef.value?.nsTableRef.reload();
}); });
}; };
getTreeData() getTreeData()
@ -254,6 +256,90 @@
orgId: orgId.value orgId: orgId.value
}) })
const tableData = ref([]); const tableData = ref([]);
const tableConfig = ref({
title: '排放因子库',
api: quickCalculation.queryCarbonEmissionPage,
params: {
orgId,
energyType
},
headerActions: [
{
label: '新增',
name: 'userAdd',
type: 'primary',
handle: () => {
visible.value = true
getNewTable()
},
},
],
columns: [
{
title: '序号',
customRender: (text: any) => {
return text.index + 1;
},
},
{
title: '因子值',
dataIndex: 'emissionFactors',
},
{
title: '计量单位',
className: 'carbonEmissionSuffix',
dataIndex: 'carbonEmissionSuffix',
},
{
title: '更新时间',
className: 'updateTime',
dataIndex: 'updateTime',
},
{
title: '启用时间',
className: 'startTime',
dataIndex: 'startTime',
},
{
title: '结束时间',
className: 'endTime',
dataIndex: 'endTime',
},
{
title: '数据来源',
className: 'dataSources',
dataIndex: 'dataSources',
},
],
columnActions: {
title: '操作',
actions: [
{
label: '编辑',
name: 'userEdit',
handle: (record: any) => {
selectedRowKeys.value = [record.factorId];
formState.value.id = record.id
formState.value.emissionFactors = record.emissionFactors
formState.value.dateRange = [record.startTime, record.endTime];
formState.value.factorId = record.factorId
visible.value = true
getNewTable()
},
},
{
label: '删除',
name: 'userDelete',
dynamicParams: { id: 'id' },
confirm: true,
isReload: true,
api: quickCalculation.del,
},
],
},
rowKey: 'id',
});
// //
const getTableList = () => { const getTableList = () => {
fetch(quickCalculation.queryCarbonEmissionPage,queryParams.value).then((res) => { fetch(quickCalculation.queryCarbonEmissionPage,queryParams.value).then((res) => {
@ -265,7 +351,7 @@
const onChange = (pageNumber: number,size: number) => { const onChange = (pageNumber: number,size: number) => {
queryParams.value.pageNum = pageNumber; queryParams.value.pageNum = pageNumber;
queryParams.value.pageSize = size; queryParams.value.pageSize = size;
getTableList() mainRef.value?.nsTableRef.reload();
}; };
// / // /
const formRef = ref(); const formRef = ref();
@ -289,7 +375,7 @@
const onSelectionChange = (selectedKeys, selectedRows) => { const onSelectionChange = (selectedKeys, selectedRows) => {
selectedRowKeys.value = selectedKeys; selectedRowKeys.value = selectedKeys;
formState.value.emissionFactors = selectedRows[0].emissionFactors formState.value.emissionFactors = selectedRows[0].emissionFactors
formState.value.carbonId = selectedRows[0].id formState.value.factorId = selectedRows[0].id
}; };
const queryData = ref({ const queryData = ref({
orgId: orgId.value, orgId: orgId.value,
@ -304,11 +390,11 @@
}; };
// //
const editData = (record) =>{ const editData = (record) =>{
selectedRowKeys.value = [record.carbonId]; selectedRowKeys.value = [record.factorId];
formState.value.id = record.id formState.value.id = record.id
formState.value.emissionFactors = record.emissionFactors formState.value.emissionFactors = record.emissionFactors
formState.value.dateRange = [record.startTime, record.endTime]; formState.value.dateRange = [record.startTime, record.endTime];
formState.value.carbonId = record.carbonId formState.value.factorId = record.factorId
visible.value = true visible.value = true
getNewTable() getNewTable()
}; };
@ -321,14 +407,13 @@
formState.value.startTime = formState.value.dateRange[0] formState.value.startTime = formState.value.dateRange[0]
formState.value.endTime = formState.value.dateRange[1] formState.value.endTime = formState.value.dateRange[1]
console.log('values', formState, toRaw(formState)); console.log('values', formState, toRaw(formState));
debugger
if(formState.value.id){ if(formState.value.id){
fetch(quickCalculation.update,formState.value).then((res) => { fetch(quickCalculation.update,formState.value).then((res) => {
visible.value = false visible.value = false
selectedRowKeys.value = []; selectedRowKeys.value = [];
formState.value = {} formState.value = {}
formRef.value.resetFields(); formRef.value.resetFields();
getTableList() mainRef.value?.nsTableRef.reload();
}); });
}else{ }else{
fetch(quickCalculation.creat,formState.value).then((res) => { fetch(quickCalculation.creat,formState.value).then((res) => {
@ -336,7 +421,7 @@
selectedRowKeys.value = []; selectedRowKeys.value = [];
formState.value = {} formState.value = {}
formRef.value.resetFields(); formRef.value.resetFields();
getTableList() mainRef.value?.nsTableRef.reload();
}); });
} }
}) })
@ -408,6 +493,9 @@
::v-deep .ant-table-container{ ::v-deep .ant-table-container{
padding: 0px 16px; padding: 0px 16px;
} }
:deep(.ns-table-main) {
margin-top: unset !important;
}
.top { .top {
overflow: auto; overflow: auto;
} }

283
hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/config.ts

@ -0,0 +1,283 @@
import { ref } from 'vue';
import { http } from '/nerv-lib/util';
import { origanizemanage } from '/@/api/origanizemanage';
import { carbonEmissionFactorLibrary } from '/@/api/carbonEmissionFactorLibrary';
export const formConfig = (disabled) => {
return ref([
{
field: 'fields',
component: 'NsChildForm',
componentProps: {
schemas: [
{
label: '排放源',
field: 'emissionSources',
component: 'NsInput',
componentProps: {
placeholder: '请输入排放源',
maxLength: 20,
},
rules: [
{
required: true,
message: '请输入排放源',
},
],
},
{
field: 'emissionType',
label: '排放分类',
component: 'NsCascader',
fieldMap: ['emissionType'],
componentProps: {
placeholder: '请选择排放分类',
api: carbonEmissionFactorLibrary.getCarbonFactorTree,
fieldNames: { label: 'emissionName', value: 'id' },
showSearch: true,
},
rules: [
{
required: true,
message: '请选择排放分类',
},
],
},
{
field: 'emissionGas',
label: '排放气体',
component: 'NsSelect',
componentProps: {
allowClear: true,
placeholder: '请选择排放气体',
options: [
{
label: 'CO2',
value: 'CO2',
},
{
label: 'CO2e',
value: 'CO2e',
},
{
label: 'SF6',
value:'SF6',
},
{
label: 'CH4',
value: 'CH4',
},
{
label: 'PFCs',
value: 'PFCs',
},
{
label: 'HFCs',
value: 'HFCs',
},
],
},
rules: [
{
required: true,
message: '请选择排放气体',
},
],
},
// {
// field: 'emissionProcess',
// label: '排放环节',
// component: 'NsSelectApi',
// componentProps: {
// api: carbonEmissionFactorLibrary.getEmissionProcess,
// params: {
// emissionType: sessionStorage.getItem('checkedTreeNode'),
// },
// resultField: 'data',
// labelField: 'emissionProcess',
// valueField: 'emissionProcess',
// immediate: true,
// autoSelectFirst: false,
// filterOption:false,
// showSearch:true,
// autoClearSearchValue:false
// },
// },
{
label: '排放环节',
field: 'emissionProcess',
component: 'NsInput',
componentProps: {
placeholder: '请输入排放环节',
maxLength: 20,
},
rules: [
{
required: true,
message: '请输入排放环节',
},
],
},
{
label: '排放因子',
field: 'emissionFactors',
component: 'NsInputNumber',
componentProps: {
placeholder: '请输入排放因子值',
maxLength: 20,
},
rules: [
{
required: true,
message: '请输入排放因子值',
trigger: 'change',
},
],
},
{
field: 'carbonEmissionPrefix',
label: '碳排前缀',
component: 'NsSelect',
componentProps: {
disabled: true,
allowClear: true,
defaultValue: 't',
placeholder: '请选择碳排前缀',
options: [
{
label: 'g',
value: 'g',
},
{
label: 'kg',
value: 'kg',
},
{
label: 't',
value: 't',
},
],
},
rules: [
{
required: true,
message: '请选择碳排前缀',
},
],
},
{
label: '碳排后缀',
field: 'carbonEmissionSuffix',
component: 'NsInput',
componentProps: {
placeholder: '请输入碳排后缀',
maxLength: 20,
},
rules: [
{
required: true,
message: '请输入碳排后缀',
},
],
},
{
label: '已引用数',
field: 'numberOfReferences',
component: 'NsInput',
componentProps: {
defaultValue: 10,
disabled: true,
maxLength: 20,
},
},
{
label: '参考文献',
field: 'reference',
component: 'NsTextarea',
componentProps: {
placeholder: '请输入参考文献',
maxLength: 20,
},
},
],
},
},
]);
};
const options = ref([]);
const getUserPerList = (transform, params = {}) => {
return http.post(origanizemanage.queryUserPerList, { ...params }).then((res) => {
return res.data?.map((item) => {
item = { ...item, ...transform(item) };
return item;
});
});
};
export const formConfig2 = (casData: any) => {
return ref([
{
field: 'information',
component: 'NsCascader',
componentProps: {
placeholder: '请选择',
displayRender: ({ labels, selectedOptions }: any) => {
console.log(labels, selectedOptions);
casData.value = selectedOptions.map(({ label, value }) => {
return { label, value };
});
return labels.join('/');
},
loadData: (selectedOptions, options) => {
console.log(selectedOptions, options, 'selectedOptions, options');
const targetOption = selectedOptions[selectedOptions.length - 1];
let transForm, params;
// load options lazily
if (!selectedOptions.length) {
transForm = (data) => {
data['label'] = data.orgName;
data['value'] = data.orgId;
data['isLeaf'] = false;
data['level'] = 1;
return data;
};
getUserPerList(transForm).then((res) => {
options.value = [...res];
});
}
const id = targetOption?.value;
const level = targetOption?.level;
if (targetOption) {
targetOption.loading = true;
}
if (level === 1) {
transForm = (data) => {
data['label'] = data.deptName;
data['value'] = data.deptId;
data['isLeaf'] = false;
data['level'] = 2;
return data;
};
params = { orgId: id };
} else if (level === 2) {
transForm = (data) => {
data['label'] = data.roleName;
data['value'] = data.roleId;
data['level'] = 3;
return data;
};
params = { deptId: id };
}
if (targetOption) {
getUserPerList(transForm, { ...params }).then((res) => {
targetOption.loading = false;
targetOption.children = [...res];
});
}
},
},
},
]);
};

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

@ -0,0 +1,10 @@
<template>
</template>
<script lang="ts" setup>
</script>
<style lang="less" scoped>
</style>

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

@ -0,0 +1,197 @@
<template>
<!-- 首页 -->
<div v-if="isMainPage">
<ns-view-list-table v-bind="tableConfig" :model="data" ref="mainRef" />
</div>
<!-- 填报页 -->
<div v-if="fillInPage">
</div>
<!-- 新增报告弹窗 -->
<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 ref="name" label="报告年度" name="energyType">
<a-date-picker v-model:value="value5" picker="year" />
</a-form-item>
<a-form-item ref="name" label="适用标准" name="energyType">
<a-input v-model:value="formState.energyType" placeholder="请输入适用标准" />
</a-form-item>
<a-form-item label="报告周期" name="emissionType" :required="isRequired">
<a-select v-model:value="formState.emissionType" placeholder="请选择排放类型">
<a-select-option v-for="(item, index) in emissionTypeDic" :key="index" :value="item.id">
{{ item.cnValue }}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item ref="name" label="适用标准" name="energyType">
<a-range-picker v-model:value="value4" picker="month" />
</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>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import { http } from '/nerv-lib/util/http';
import { carbonEmissionFactorLibrary } from '/@/api/carbonEmissionFactorLibrary';
defineOptions({ name: 'CarbonInventoryCheck' });
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
const fetch = (api, params = { orgId }) => {
return http.post(api, params);
};
//
const isMainPage = ref(false);
const fillInPage = ref(true);
//
const visible = ref(false);
const formState = ref({})
const formRef = ref();
const labelCol = { span: 5 };
const wrapperCol = { span: 19 };
// form
const rules: Record<string, Rule[]> = {
energyType: [{ required: true, message: '请输入能源种类', trigger: 'change' }],
isComputeCarbon: [{ required: true, message: '请选择是否计算碳排', trigger: 'change' }]
};
//
const onClose = () => {
visible.value = false;
formState.value = {}
formRef.value.resetFields();
};
//
const tableConfig = ref({
title: '数据库',
api: carbonEmissionFactorLibrary.getTableList,
params: {
orgId
},
headerActions: [
{
label: '新增',
name: 'userAdd',
type: 'primary',
handle: () => {
visible.value = true
},
},
],
columns: [
{
title: '序号',
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',
},
],
columnActions: {
title: '操作',
actions: [
{
label: '编辑',
name: 'userEdit',
handle: (record: any) => {
visible.value = true
},
},
{
label: '填报',
name: 'fillIn',
handle: (record: any) => {
isMainPage.value = false
fillInPage.value = true
},
},
{
label: '下载',
name: 'download',
handle: (record: any) => {
},
},
{
label: '删除',
name: 'userDelete',
dynamicParams: { ids: 'id[]' },
confirm: true,
isReload: true,
api: carbonEmissionFactorLibrary.del,
},
],
},
formConfig: {
schemas: [
{
field: 'emissionSources',
label: '报告名称',
component: 'NsInput',
componentProps: {
placeholder: '请输入报告名称',
maxLength: 30,
},
},
{
field: 'createTime1',
label: '采购日期',
component: 'NsRangePicker',
fieldMap: ['purchaseBeginDate', 'purchaseEndDate'],
componentProps: {
valueFormat: 'YYYY-MM-DD',
placeholder: ['报告年度', '报告年度'],
},
},
],
params: {},
},
rowKey: 'id',
});
//
</script>
<style lang="less" scoped>
</style>

45
hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/mock.ts

@ -0,0 +1,45 @@
import { ref } from 'vue';
import { origanizemanage } from '/@/api/origanizemanage';
import { http } from '/nerv-lib/saas';
export const mockData = ref([
{
id: 3,
zhanghao: 'axb',
name: '张三',
sex: '男',
phone: '123456789',
email: '1234567889',
relation: '1',
role: '1',
status: '1',
},
]);
export const mockData2 = ref([
{
information: '铁路局1/产品部1/产品总监1',
},
]);
export const treeData = ref([
{
title: '铁路总局',
key: '0-0',
children: [
{ title: '济阳站', key: '0-0-0' },
{ title: '临沂站', key: '0-0-1' },
],
},
]);
export const treeData2 = [
{
title: '全部',
key: '0-0',
children: [
{ title: '产品部', key: '0-0-0' },
{ title: '运维部', key: '0-0-1' },
],
},
];

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

@ -3,6 +3,7 @@
right: 496px; right: 496px;
width: 500px; width: 500px;
height: 100%; height: 100%;
z-index: 99;
top: 0; top: 0;
bottom: 0; bottom: 0;
margin: auto; margin: auto;
@ -12,6 +13,7 @@
display: flex; display: flex;
padding: 25px; padding: 25px;
flex-direction: column; flex-direction: column;
transition: all ease 0.5s;
.content { .content {
overflow-y: scroll; overflow-y: scroll;
.div-operation { .div-operation {
@ -139,3 +141,10 @@
} }
} }
} }
.fade-enter-active, .fade-leave-active {
transform: translateX(0px);
}
.fade-enter-from, .fade-leave-to {
transform: translateX(496px);
}

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

@ -1,7 +1,5 @@
// 页面容器 // 页面容器
.lighting-box { .lighting-box {
// width: 100%;
// height: 100%;
position: relative; position: relative;
// background: linear-gradient(#badaff, #8cabeb, #7095de); // background: linear-gradient(#badaff, #8cabeb, #7095de);
// 照明设备功能总容器 // 照明设备功能总容器
@ -47,32 +45,46 @@
height: 240px; height: 240px;
transform: rotateX(79deg) rotateZ(-22deg) skew(29deg); transform: rotateX(79deg) rotateZ(-22deg) skew(29deg);
display: flex; display: flex;
gap: 8px; gap: 5px;
.area1 { .area1 {
width: 170px; width: 70px;
background: rgba(0, 251, 91, 0.3); background: rgba(0, 251, 91, 0.3);
border: 2px solid rgb(0, 251, 91); border: 2px solid rgb(0, 251, 91);
display: flex; display: flex;
} }
.area2 { .area2 {
width: 240px; width: 200px;
background: rgba(255, 165, 0, 0.3); background: rgba(255, 165, 0, 0.3);
border: 2px solid rgb(255, 165, 0); border: 2px solid rgb(255, 165, 0);
display: flex; display: flex;
} }
.area3 { .area3 {
width: 110px; width: 120px;
background: rgba(255, 0, 0, 0.3); background: rgba(255, 0, 0, 0.3);
border: 2px solid rgb(255, 0, 0); border: 2px solid rgb(255, 0, 0);
display: flex;
} }
.area4 { .area4 {
flex: 1; width: 70px;
background: rgba(80, 236, 244, 0.3); background: rgba(80, 236, 244, 0.3);
border: 2px solid rgb(80, 236, 244); border: 2px solid rgb(80, 236, 244);
display: flex;
}
.area5 {
flex: 1;
background: rgba(0, 251, 91, 0.3);
border: 2px solid rgb(0, 251, 91);
display: flex;
}
.area6 {
flex: 1;
background: rgba(255, 165, 0, 0.3);
border: 2px solid rgb(255, 165, 0);
display: flex;
}
.area-item:hover {
transform: scale(1.05);
} }
// .area-item:hover {
// transform: scale(1.05);
// }
.area-item { .area-item {
cursor: pointer; cursor: pointer;
transition: all ease 0.2s; transition: all ease 0.2s;
@ -82,37 +94,16 @@
display:flex; display:flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
.group-shadow1 { box-sizing: border-box;
width: 35px; padding: 10px;
height: 150px; // border: 2px solid red;
border-radius: 20px; .shadow-box {
background: rgba(0, 0, 0, 0.1); width: 30px;
} height: 200px;
.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; border-radius: 20px;
background: rgba(0, 0, 0, 0.1); background: rgba(0, 0, 0, 0.2);
} }
} }
// .group-shadow {
// transition: all ease 0.2s;
// }
// .group-shadow:hover {
// transform: scale(1.05);
// }
} }
} }
} }

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

@ -3,25 +3,31 @@
<div class="lighting-img-box"> <div class="lighting-img-box">
<!-- 左上角区域切换 --> <!-- 左上角区域切换 -->
<div class="btn-box"> <div class="btn-box">
<button class="btn-item" @click=changeArea(1)>1F</button> <button class="btn-item" @click=changeFloor(1)>1F</button>
<button class="btn-item" @click=changeArea(2)>2F</button> <button class="btn-item" @click=changeFloor(2)>2F</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(String(item.id))" :class="computedClass(item.id)"
@click="getArea(item)" @click="changeThisArea([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)"></div> <div class="group-shadow" @click.stop="changeThisArea([item, v])">
<div :class="computedClass(v.id)" class="shadow-box"></div>
</div>
</div> </div>
</div> </div>
</div> </div>
<!-- 照明设备 --> <!-- 照明设备 -->
<div class="lights"> <div class="lights">
<light v-for="(item, index) in bulbs" :key="index" :styleObject="item.styleText" :type="item.type" :visible="item.visible"></light> <light v-for="(item, index) in bulbs"
:key="index"
:styleObject="item.styleText"
:type="item.type"
:visible="item.visible">
</light>
</div> </div>
</div> </div>
<!-- 右侧抽屉的触发按钮 --> <!-- 右侧抽屉的触发按钮 -->
@ -44,7 +50,7 @@
: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="changeArea" :treeData="treeData" :nowArea="nowArea"></tabs1>
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="2" tab="计划列表" force-render> <a-tab-pane key="2" tab="计划列表" force-render>
<tabs2></tabs2> <tabs2></tabs2>
@ -59,94 +65,170 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue'; import { ref, onMounted } from 'vue';
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 tabs2 from './tabs2.vue'
import tabs3 from './tabs3.vue' import tabs3 from './tabs3.vue'
//
import { http } from '/nerv-lib/util/http';
import { lightingManage } from '/@/api/IlluminationInfo';
// ICON // ICON
import { import {
DoubleLeftOutlined, DoubleLeftOutlined,
DoubleRightOutlined DoubleRightOutlined
} from '@ant-design/icons-vue'; } from '@ant-design/icons-vue';
// - - // =======================================================
interface items {
id: string,
}
// =======================================================
onMounted(() => {
http.post(lightingManage.getArea, { floor: '1', siteId: '10000001' }).then(res => {
const data = res.data
/** 使
* @param id 用于判断样式和层级的前端属性
* @param selected 用于表示是否选中的前端属性
*/
data.forEach((item, index) => {
if (index == 0) {
item.selected = true
} else {
item.selected = false
}
item.id = String(index + 1)
item.children = []
// deviceGroup
let i = 1;
for (let obj in item.deviceGroup) {
item.deviceGroup[obj].selected = false
item.deviceGroup[obj].id = String((index + 1) + '-' + i++)
item.children.push(item.deviceGroup[obj])
}
})
treeData.value = data
})
})
// =====================================================
//
const changeFloor = (area: number) => {
if (area == 1) {
console.log('1F')
} else if (area == 2) {
console.log('2F')
}
}
// =====================================================
//
const treeData = ref([])
// id
const nowArea = ref('1')
// -
const area = ref(['1']) const area = ref(['1'])
// - - // 线 -
const bulbs = ref([ const bulbs = ref([
{ {
styleText: { left: '190px', bottom: '200px' }, styleText: { left: '180px', bottom: '200px' },
area: 1, area: 1,
type: 1, type: 1,
visible: true visible: true
}, },
{ {
styleText: { left: '245px', bottom: '125px' }, styleText: { left: '230px', bottom: '125px' },
area: 1, area: 1,
type: 2, type: 2,
visible: true visible: true
}, },
{ {
styleText: { left: '355px', bottom: '160px' }, styleText: { left: '320px', bottom: '140px' },
area: 1, area: 1,
type: 3, type: 3,
visible: true visible: true
}, },
{ {
styleText: { left: '295px', bottom: '230px' }, styleText: { left: '245px', bottom: '230px' },
area: 1, area: 1,
type: 3, type: 3,
visible: true visible: true
}, },
{ {
styleText: { left: '425px', bottom: '230px' }, styleText: { left: '405px', bottom: '230px' },
area: 2, area: 2,
type: 3, type: 3,
visible: true visible: true
}, },
{ {
styleText: { left: '470px', bottom: '190px' }, styleText: { left: '460px', bottom: '180px' },
area: 2, area: 2,
type: 3, type: 3,
visible: true visible: true
}, },
{ {
styleText: { left: '380px', bottom: '275px' }, styleText: { left: '360px', bottom: '275px' },
area: 2, area: 2,
type: 3, type: 3,
visible: true visible: true
}, },
{ {
styleText: { left: '700px', bottom: '320px' }, styleText: { left: '715px', bottom: '320px' },
area: 3, area: 3,
type: 1, type: 1,
visible: true visible: true
}, },
]) ])
// 线
// - const changeArea = (result: any) => {
const changeArea = (area: number) => { console.log(result,'changeArea')
if (area == 1) { //
console.log('1F')
} else if (area == 2) {
console.log('2F')
} else if (area == 3) {
console.log('站台')
}
}
// -
const getArea = (result: any) => {
//
if (Array.isArray(result)) { if (Array.isArray(result)) {
area.value = result area.value = result
// //
} else { } else {
area.value.length = 0 area.value.length = 0
area.value[0] = String(result) area.value[0] = String(result)
} }
} }
// - //
const changeThisArea = (result: any) => {
console.log(result, 'changeThisArea')
//
reset()
let level1 = result[0];
area.value.length = 0
if (result.length === 1) {
result[0].selected = true
area.value.push(result[0].id)
} else if (result.length === 2) {
//
if (!level1) {
level1 = treeData.value[0]
}
// true
level1.selected = result[1].selected = true
area.value.splice(0, 0, level1.id, result[1].id)
}
nowArea.value = level1.id
}
//
const reset = () => {
treeData.value.forEach(item => {
item.selected = false
item.children.forEach(i => {
i.selected = false
})
})
}
//
const computedClass = (string: string) => { const computedClass = (string: string) => {
if (area.value.indexOf(string) != -1) { if (area.value.indexOf(string) != -1) {
return `isActive area-item area${string}` return `isActive area-item area${string}`
@ -154,6 +236,9 @@ const computedClass = (string: string) => {
return `area-item area${string}` return `area-item area${string}`
} }
} }
// =====================================================
// - tab // - tab
let activeKey = ref('1'); let activeKey = ref('1');
// - // -
@ -166,9 +251,11 @@ const toggleDrawer = () => {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@import "./index.less"; @import "./index.less";
//
.isActive { .isActive {
border: 3px solid white !important; border: 3px solid white !important;
} }
// tab
:deep(.ant-tabs-tab-btn) { :deep(.ant-tabs-tab-btn) {
color: white; color: white;
} }

439
hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs1.less

@ -0,0 +1,439 @@
// 抽屉
.drawer-item {
.light-area,
.circuit-area,
.control-area,
.control-scene-area,
.light-parameters-area {
width: 100%;
margin-top: 20px;
display: flex;
align-items: center;
}
.light-area-tab,
.circuit-tab,
.control-tab,
.control-scene-tab,
.light-parameters-tab {
width: 5px;
height: 23px;
opacity: 1;
background: rgba(26, 174, 251, 1);
margin-right: 4px;
}
.light-area-text,
.circuit-text,
.control-text,
.control-scene-text,
.light-parameters-text {
font-size: 14px;
color: white;
padding-left: 5px;
line-height: 23px;
width: 110px;
height: 23px;
background: linear-gradient(270deg, rgba(86, 221, 253, 0) 0%, rgba(25, 176, 255, 1) 100%);
user-select: none;
}
.light-area-tab,
.light-area-text {
display: inline-block;
justify-content: center;
}
.plan.enabled {
border: none;
font-size: 14px;
font-weight: 400;
border-radius: 5px;
vertical-align: top;
margin-left: 235px;
width: 88px;
height: 32px;
background: linear-gradient(180deg, rgba(103, 222, 0, 1) 0%, rgba(0, 181, 6, 1) 100%);
color: white;
}
.plan.disabled {
border: none;
font-size: 14px;
font-weight: 400;
border-radius: 5px;
color: white;
vertical-align: top;
margin-left: 235px;
width: 88px;
height: 32px;
background-color: red;
}
.plan:disabled {
cursor: not-allowed;
}
.openPlan.enabled2 {
border: none;
font-size: 14px;
font-weight: 400;
border-radius: 5px;
color: white;
vertical-align: top;
width: 88px;
height: 32px;
background: linear-gradient(180deg, rgba(103, 222, 0, 1) 0%, rgba(0, 181, 6, 1) 100%);
color: white;
}
.openPlan.disabled2 {
border: none;
font-size: 14px;
font-weight: 400;
border-radius: 5px;
color: white;
vertical-align: top;
width: 88px;
height: 32px;
background-color: red;
}
.openPlan:disabled {
cursor: not-allowed;
}
.btn2 {
display: flex;
align-items: center;
margin-left: 80px;
}
.openzm {
cursor: pointer;
color: rgba(34, 183, 255, 1);
margin-left: 20px;
font-size: 14px;
}
.custom-checkbox {
width: 13px;
height: 13px;
}
.both {
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%);
margin-left: 8px;
font-size: 12px;
color: white;
border: none;
border-radius: 5px;
}
.btn2 {
button {
margin: 0 5px;
}
}
.allBtn {
border: 0;
width: 40px;
color: white;
background-color: transparent;
}
.blue-background.ant-switch-checked {
background-color: linear-gradient(180deg,
rgba(1, 206, 255, 1) 0%,
rgba(0, 150, 229, 1) 100%) !important;
}
.grey-background.ant-switch {
background-color: grey !important;
}
.blue-background.ant-switch-checked .ant-switch-handle {
background-color: linear-gradient(180deg,
rgba(1, 206, 255, 1) 0%,
rgba(0, 150, 229, 1) 100%) !important;
}
.grey-background.ant-switch .ant-switch-handle {
background-color: grey !important;
}
p {
color: white;
}
.area,
.btnArea,
.control-mode-btn-area,
.control-scene-btn-area {
margin-left: -17px;
button {
width: 21%;
padding: 0 2%;
}
}
.btn {
width: 92px;
height: 40px;
border-radius: 4px;
opacity: 1;
margin-top: 10px;
margin-left: 17px;
font-size: 14px;
font-weight: 400;
opacity: 1;
border: 1px solid rgba(207, 212, 219, 1);
line-height: 20.27px;
color: white;
text-align: center;
vertical-align: top;
background-color: rgba(255, 255, 255, 0.1);
}
.selected {
background: linear-gradient(180deg, rgba(201, 245, 255, 1) 0%, rgba(138, 215, 255, 1) 100%);
color: rgba(0, 61, 90, 1);
border: 1px solid white;
}
.btn:hover {
background-color: rgba(207, 212, 219, 1);
}
.btn:active {
background-color: rgba(102, 102, 102, 1);
color: white;
}
.circuit-area,
.control-scene-area,
.light-parameters-area {
left: 51px;
width: 100%;
margin-top: 20px;
}
.circuit-tab,
.circuit-text {
display: inline-block;
}
.batch {
width: 60px;
height: 32px;
opacity: 1;
border: 1px solid rgba(67, 136, 251, 1);
color: rgba(67, 136, 251, 1);
border-radius: 5px;
background-color: white;
margin-left: 11px;
}
.control-area {
left: 51px;
width: 100%;
margin-top: 20px;
}
.control-tab,
.control-text {
display: inline-block;
}
:deep(.cell) {
text-align: center;
}
:deep(#pane-first) {
height: 100%;
}
.control-scene-tab,
.control-scene-text {
display: inline-block;
}
.light-parameters-tab,
.light-parameters-text {
display: inline-block;
}
.light-parameters-textarea>p {
height: 100%;
display: flex;
border: 1px solid rgba(236, 239, 245, 1);
justify-content: center;
align-items: center;
}
.bottom {
width: 100%;
height: 64px;
display: flex;
justify-content: flex-end;
align-items: center;
position: fixed;
bottom: 0;
right: 0;
}
.execute {
margin-right: 20px;
width: 74px;
height: 40px;
opacity: 1;
cursor: pointer;
border-radius: 4px;
background: rgba(67, 136, 251, 1);
font-size: 14px;
font-weight: 400;
color: white;
border: 0;
margin: 0 10px;
}
.flushed {
width: 74px;
height: 40px;
cursor: pointer;
opacity: 1;
border-radius: 4px;
font-size: 14px;
font-weight: 400;
color: rgba(102, 102, 102, 1);
background: white;
border: 1px solid rgba(193, 197, 204, 1);
margin: 0 10px;
}
:deep(.ant-table-pagination) {
visibility: hidden;
}
.drawer-content {
margin-left: 20px;
}
.arrow-indicator {
position: absolute;
top: 50%;
left: 0;
transform: translateY(-50%);
z-index: 1;
}
.drawer-title1 {
position: fixed;
width: 33px;
height: 33px;
top: 0;
bottom: 0;
right: 20px;
margin: auto;
z-index: 99999;
}
.drawer-title2 {
position: fixed;
width: 33px;
height: 33px;
top: 0;
bottom: 0;
right: 495px;
margin: auto;
z-index: 99999;
}
.arrowbtn {
display: flex;
justify-content: center;
align-items: center;
width: 28px;
height: 28px;
background: rgba(0, 0, 0, 1);
opacity: 0.5;
border: none;
}
:deep(.ant-tabs-tab-btn) {
color: white;
}
:deep(.ant-table) {
background-color: transparent;
}
:deep(.ant-table-bordered) {
background-color: transparent;
}
:deep(.ant-table-thead) {
background-color: transparent;
}
:deep(.ant-table-cell) {
background-color: transparent;
color: #fff;
}
.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%;
cellspacing: 0;
cellpadding: 0;
border: 1px solid rgba(255, 255, 255);
border-radius: 5px;
background: rgba(255, 255, 255, 0.1);
}
.light-area,
.circuit-area,
.control-area,
.control-scene-area,
.light-parameters-area {
width: 100%;
margin-top: 20px;
display: flex;
align-items: center;
}
.zmhlbtn {
position: relative;
}
// 禁用图标
.anticon-stop {
position: absolute;
right: 3px;
bottom: 3px;
}
}

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

@ -1,4 +1,5 @@
<template> <template>
<a-spin :spinning="isLoading">
<!-- 照明区域 --> <!-- 照明区域 -->
<div> <div>
<div class="light-area"> <div class="light-area">
@ -13,7 +14,7 @@
<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)"> :class="{ btn: true, selected: button.selected }" @click="selectButton(button)">
{{ button.label }} {{ button.regionName }}
</button> </button>
<div style="margin-top: 10px"> <div style="margin-top: 10px">
<span @click="showAllButtonsArea = true" class="openzm"><down-outlined /> 展开</span> <span @click="showAllButtonsArea = true" class="openzm"><down-outlined /> 展开</span>
@ -22,7 +23,7 @@
<template v-else> <template v-else>
<button v-for="(button, index) in props.treeData" :key="index" :class="{ btn: true, selected: button.selected }" <button v-for="(button, index) in props.treeData" :key="index" :class="{ btn: true, selected: button.selected }"
@click="selectButton(button)"> @click="selectButton(button)">
{{ button.label }} {{ button.regionName }}
</button> </button>
<div style="margin-top: 10px"> <div style="margin-top: 10px">
<span @click="showAllButtonsArea = false" class="openzm"><up-outlined /> 回缩</span> <span @click="showAllButtonsArea = false" class="openzm"><up-outlined /> 回缩</span>
@ -51,19 +52,20 @@
</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="(button, index) in limitedButtons2" :key="index"
:class="{ btn: true, selected: button2.selected }" class="zmhlbtn" @click="toggleSelection(button2)"> :class="{ btn: true, selected: button.selected }" class="zmhlbtn" @click="toggleSelection(button)">
<stop-outlined v-if="button2.stop" /> <stop-outlined v-if="button.panel" />
{{ button2.label }} {{ button.deviceName }}
</button> </button>
<div style="margin-top: 10px"> <div style="margin-top: 10px">
<span @click="showAllButtons = true" class="openzm"><down-outlined /> 展开</span> <span @click="showAllButtons = true" class="openzm"><down-outlined /> 展开</span>
</div> </div>
</template> </template>
<template v-else> <template v-else>
<button v-for="(button2, index) in buttons2" :key="index" :class="{ btn: true, selected: button2.selected }" <button v-for="(button, index) in buttons2" :key="index"
@click="toggleSelection(button2)"> :class="{ btn: true, selected: button.selected }" class="zmhlbtn" @click="toggleSelection(button)">
{{ button2.label }} <stop-outlined v-if="button.panel" />
{{ button.deviceName }}
</button> </button>
<div style="margin-top: 10px"> <div style="margin-top: 10px">
<span @click="showAllButtons = false" class="openzm"><up-outlined /> 回缩</span> <span @click="showAllButtons = false" class="openzm"><up-outlined /> 回缩</span>
@ -71,7 +73,7 @@
</template> </template>
</div> </div>
</div> </div>
<!-- 控制模式 --> <!-- 控制模式部分 -->
<div> <div>
<div class="control-area" v-show="showControlMode"> <div class="control-area" v-show="showControlMode">
<div class="control-tab"></div> <div class="control-tab"></div>
@ -85,7 +87,7 @@
</button> </button>
</div> </div>
</div> </div>
<!-- 控制场景 --> <!-- 控制场景部分 -->
<div> <div>
<div class="control-scene-area" v-show="showControlScene"> <div class="control-scene-area" v-show="showControlScene">
<div class="control-scene-tab"></div> <div class="control-scene-tab"></div>
@ -99,7 +101,7 @@
</button> </button>
</div> </div>
</div> </div>
<!-- 灯具参数 --> <!-- 灯具参数部分表格 -->
<div> <div>
<div class="light-parameters-area" v-if="selectedButton4"> <div class="light-parameters-area" v-if="selectedButton4">
<div class="light-parameters-tab"></div> <div class="light-parameters-tab"></div>
@ -126,11 +128,21 @@
<div style="margin-bottom: 60px;"></div> <div style="margin-bottom: 60px;"></div>
</div> </div>
</div> </div>
<!-- 底部按钮区 -->
<div class="bottom"> <div class="bottom">
<button class="flushed" @click="refresh">刷新</button> <a-popconfirm
title="刷新将会取消已作出的修改"
ok-text="确定"
cancel-text="取消"
@confirm="changeConfirm"
@cancel="changeCancel"
>
<button class="flushed">刷新</button>
</a-popconfirm>
<button class="execute" @click="showModal">执行</button> <button class="execute" @click="showModal">执行</button>
</div> </div>
<!-- 点击执行时的弹出框 -->
<div class="out-dialog" v-if="executeVisible"> <div class="out-dialog" v-if="executeVisible">
<div class="content" v-if="executeVisible"> <div class="content" v-if="executeVisible">
<div> <div>
@ -195,94 +207,116 @@
<button class="execute">执行</button> <button class="execute">执行</button>
</div> </div>
</div> </div>
</a-spin>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed, onMounted } from 'vue'; import { ref, computed, onMounted, watch } from 'vue';
import { controlType } from './treeData' import { controlType } from './treeData'
import { import {
DownOutlined, DownOutlined,
UpOutlined, UpOutlined,
StopOutlined, StopOutlined,
} from '@ant-design/icons-vue'; } from '@ant-design/icons-vue';
//
import { http } from '/nerv-lib/util/http';
import { lightingManage } from '/@/api/IlluminationInfo';
// =========================================================================
//
onMounted(() => { onMounted(() => {
const data = props.treeData[0] setArea()
})
// 线
const setArea = () => {
const data = props.treeData.find(item => {
return item.id == props.nowArea
})
// //
data.selected = true data.selected = true
// //
selectedButton.value = props.nowArea
//
buttons2.value = data.children buttons2.value = data.children
}) }
// =================================================================== // ===================================================================
const props = defineProps({ const props = defineProps({
// > // >
treeData: { treeData: {
type: Array, type: Array,
default: [] default: []
}, },
line: { // ID
type: Array nowArea: {
type: String,
} }
}); });
//
const emit = defineEmits(['changeArea']); const emit = defineEmits(['changeArea']);
//
watch(() => props.nowArea, () => {
setArea()
})
// ========================================================================== // ==========================================================================
// - //
const isPlanEnabled = ref(false); const isPlanEnabled = ref(false);
// - //
const togglePlan = () => { const togglePlan = () => {
isPlanEnabled.value = !isPlanEnabled.value; isPlanEnabled.value = !isPlanEnabled.value;
}; };
// - //
const showAllButtonsArea = ref(false); const showAllButtonsArea = ref(false);
// - - 1 // 1
const selectedButton = ref('1'); const selectedButton = ref('1');
// - - // -
const selectButton = (button: any) => { const selectButton = (button: any) => {
console.log(button,'button')
// //
selectedButton.value = button; selectedButton.value = button.id;
// //
initMenu(1) initMenu(1)
button.selected = true button.selected = true
buttons2.value = button.children buttons2.value = button.children
// area // area
emit('changeArea', []);
emit('changeArea', button.id); emit('changeArea', button.id);
}; };
// - 8 // 8
const limitedButtons1 = computed(() => props.treeData.slice(0, 8)); const limitedButtons1 = computed(() => props.treeData.slice(0, 8));
// ========================================================================== // ==========================================================================
// - //
const zmhlid = ref(''); const handleButton = ref('');
// -
const selectAllCheckbox = ref(false);
// - / // /
const isPlanEnabled2 = ref(true); const isPlanEnabled2 = ref(true);
// - / // /
const togglePlan2 = () => { const togglePlan2 = () => {
// //
const item = buttons2.value.find((button) => button.id === zmhlid.value) const btn = buttons2.value.find((button) => button.id === handleButton.value)
let panel = +(!btn.panel)
isLoading.value = true
http.get(lightingManage.setDisable, { deviceGroup: btn.deviceGroup, panel }).then(res => {
if (res.msg === 'success') {
isPlanEnabled2.value = !isPlanEnabled2.value; isPlanEnabled2.value = !isPlanEnabled2.value;
// - btn.panel = panel
if (isPlanEnabled2.value) { isLoading.value = false
item.stop = true
// -
} else { } else {
item.stop = false isLoading.value = false
} }
}).catch(() => { isLoading.value = false })
}; };
// - //
let singleSelection = ref(true);
//
const selectAll = () => { const selectAll = () => {
emit('changeArea', [String(selectedButton.value.id)]) emit('changeArea', [selectedButton.value])
selectAllCheckbox.value = false selectAllCheckbox.value = false
buttons2.value.forEach((button) => { buttons2.value.forEach((button) => {
button.selected = false; button.selected = false;
@ -291,11 +325,11 @@ const selectAll = () => {
showControlMode.value = false showControlMode.value = false
}; };
// - //
let singleSelection = ref(true); const selectAllCheckbox = ref(false);
// - switch // switch
const toggleAllSelection = () => { const toggleAllSelection = () => {
let arr = [String(selectedButton.value.id)] let arr = [selectedButton.value]
// //
if (selectAllCheckbox.value) { if (selectAllCheckbox.value) {
buttons2.value.forEach((item) => { buttons2.value.forEach((item) => {
@ -312,19 +346,18 @@ const toggleAllSelection = () => {
emit('changeArea', arr) emit('changeArea', arr)
}; };
// - //
const toggleSelection = (button: any) => { const toggleSelection = (button: any) => {
// ID/ // ID/
zmhlid.value = button.id handleButton.value = button.id
// / // /
if (button.stop) { if (button.panel) {
isPlanEnabled2.value = true isPlanEnabled2.value = true
} else { } else {
isPlanEnabled2.value = false isPlanEnabled2.value = false
} }
// //
let level1 = String(selectedButton.value.id) let level1 = selectedButton.value
let level2 = button.id let level2 = button.id
// false // false
if (singleSelection.value) { if (singleSelection.value) {
@ -359,19 +392,20 @@ const toggleSelection = (button: any) => {
showControlMode.value = false showControlMode.value = false
thisButton.value = { type: '0' } thisButton.value = { type: '0' }
} }
}; };
// -
//
const buttons2 = ref([]);
//
const showAllButtons = ref(false); const showAllButtons = ref(false);
// - 8 // 8
const limitedButtons2 = computed(() => buttons2.value.slice(0, 8)); const limitedButtons2 = computed(() => buttons2.value.slice(0, 8));
// -
const buttons2 = ref([]);
// ======================================================================= // =======================================================================
// -
//
const showControlMode = ref(false); const showControlMode = ref(false);
const thisButton = ref({ type: '0' }) const thisButton = ref({ type: 0 })
// - // -
const selectButton3 = (button3) => { const selectButton3 = (button3) => {
thisButton.value.type = button3.type thisButton.value.type = button3.type
@ -380,7 +414,8 @@ const selectButton3 = (button3) => {
}; };
// ======================================================================= // =======================================================================
// -
//
const showControlScene = ref(false); const showControlScene = ref(false);
// - // -
const controlSceneButtons = ref([ const controlSceneButtons = ref([
@ -397,6 +432,7 @@ const selectButton4 = (button4) => {
}; };
// ======================================================================== // ========================================================================
// - // -
const lightSource = ref([{ num: '8/10', light: '100', temperature: '4200' }]); const lightSource = ref([{ num: '8/10', light: '100', temperature: '4200' }]);
@ -409,6 +445,7 @@ const handleRowClick = (index: any) => {
}; };
// ======================================================================== // ========================================================================
const cxList = ref([ const cxList = ref([
{ {
id: '1', id: '1',
@ -447,10 +484,8 @@ const cxList = ref([
brightness4: '3800k', brightness4: '3800k',
}, },
]); ]);
// const cxList = cxList.value.concat(cxList.value)
// //
const delBtn = (id: any) => { const delBtn = (id: any) => {
console.log(id);
cxList.value.pop(id); cxList.value.pop(id);
console.log(cxList.value.length); console.log(cxList.value.length);
@ -460,6 +495,8 @@ const delBtn = (id: any) => {
}; };
// ======================================================================== // ========================================================================
const isLoading = ref(false)
// 5 // 5
const initMenu = (tier: number) => { const initMenu = (tier: number) => {
// 1 = - // 1 = -
@ -489,8 +526,7 @@ const initMenu = (tier: number) => {
const refresh = () => { const refresh = () => {
executeVisible.value = false executeVisible.value = false
selectedButton.value = '1'; selectedButton.value = '1';
emit('changeArea', []); emit('changeArea', ['1']);
emit('changeArea', [1]);
showControlMode.value = false; showControlMode.value = false;
showControlScene.value = false; showControlScene.value = false;
selectedButton4.value = null; selectedButton4.value = null;
@ -500,446 +536,19 @@ const executeVisible = ref<boolean>(false);
const showModal = () => { const showModal = () => {
executeVisible.value = true; executeVisible.value = true;
}; };
</script>
<style lang="less" scoped>
@import "./dialogStyle.less";
//
.drawer-item {
.light-area,
.circuit-area,
.control-area,
.control-scene-area,
.light-parameters-area {
width: 100%;
margin-top: 20px;
display: flex;
align-items: center;
}
.light-area-tab,
.circuit-tab,
.control-tab,
.control-scene-tab,
.light-parameters-tab {
width: 5px;
height: 23px;
opacity: 1;
background: rgba(26, 174, 251, 1);
margin-right: 4px;
}
.light-area-text,
.circuit-text,
.control-text,
.control-scene-text,
.light-parameters-text {
font-size: 14px;
color: white;
padding-left: 5px;
line-height: 23px;
width: 110px;
height: 23px;
background: linear-gradient(270deg, rgba(86, 221, 253, 0) 0%, rgba(25, 176, 255, 1) 100%);
user-select: none;
}
.light-area-tab,
.light-area-text {
display: inline-block;
justify-content: center;
}
.plan.enabled {
border: none;
font-size: 14px;
font-weight: 400;
border-radius: 5px;
vertical-align: top;
margin-left: 235px;
width: 88px;
height: 32px;
background: linear-gradient(180deg, rgba(103, 222, 0, 1) 0%, rgba(0, 181, 6, 1) 100%);
color: white;
}
.plan.disabled {
border: none;
font-size: 14px;
font-weight: 400;
border-radius: 5px;
color: white;
vertical-align: top;
margin-left: 235px;
width: 88px;
height: 32px;
background-color: red;
}
.plan:disabled {
cursor: not-allowed;
}
.openPlan.enabled2 {
border: none;
font-size: 14px;
font-weight: 400;
border-radius: 5px;
color: white;
vertical-align: top;
width: 88px;
height: 32px;
background: linear-gradient(180deg, rgba(103, 222, 0, 1) 0%, rgba(0, 181, 6, 1) 100%);
color: white;
}
.openPlan.disabled2 {
border: none;
font-size: 14px;
font-weight: 400;
border-radius: 5px;
color: white;
vertical-align: top;
width: 88px;
height: 32px;
background-color: red;
}
.openPlan:disabled {
cursor: not-allowed;
}
.btn2 {
display: flex;
align-items: center;
margin-left: 80px;
}
.openzm {
cursor: pointer;
color: rgba(34, 183, 255, 1);
margin-left: 20px;
font-size: 14px;
}
.custom-checkbox {
width: 13px;
height: 13px;
}
.both {
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%);
margin-left: 8px;
font-size: 12px;
color: white;
border: none;
border-radius: 5px;
}
.btn2 {
button {
margin: 0 5px;
}
}
.allBtn {
border: 0;
width: 40px;
color: white;
background-color: transparent;
}
.blue-background.ant-switch-checked {
background-color: linear-gradient(180deg,
rgba(1, 206, 255, 1) 0%,
rgba(0, 150, 229, 1) 100%) !important;
}
.grey-background.ant-switch {
background-color: grey !important;
}
.blue-background.ant-switch-checked .ant-switch-handle {
background-color: linear-gradient(180deg,
rgba(1, 206, 255, 1) 0%,
rgba(0, 150, 229, 1) 100%) !important;
}
.grey-background.ant-switch .ant-switch-handle {
background-color: grey !important;
}
p {
color: white;
}
.area,
.btnArea,
.control-mode-btn-area,
.control-scene-btn-area {
margin-left: -17px;
button { //
width: 21%; const changeConfirm = () => {
padding: 0 2%; refresh()
}
}
.btn {
width: 92px;
height: 40px;
border-radius: 4px;
opacity: 1;
margin-top: 10px;
margin-left: 17px;
font-size: 14px;
font-weight: 400;
opacity: 1;
border: 1px solid rgba(207, 212, 219, 1);
line-height: 20.27px;
color: white;
text-align: center;
vertical-align: top;
background-color: rgba(255, 255, 255, 0.1);
}
.selected {
background: linear-gradient(180deg, rgba(201, 245, 255, 1) 0%, rgba(138, 215, 255, 1) 100%);
color: rgba(0, 61, 90, 1);
border: 1px solid white;
}
.btn:hover {
background-color: rgba(207, 212, 219, 1);
}
.btn:active {
background-color: rgba(102, 102, 102, 1);
color: white;
} }
.circuit-area, //
.control-scene-area, const changeCancel = () => {
.light-parameters-area {
left: 51px;
width: 100%;
margin-top: 20px;
}
.circuit-tab,
.circuit-text {
display: inline-block;
}
.batch {
width: 60px;
height: 32px;
opacity: 1;
border: 1px solid rgba(67, 136, 251, 1);
color: rgba(67, 136, 251, 1);
border-radius: 5px;
background-color: white;
margin-left: 11px;
}
.control-area {
left: 51px;
width: 100%;
margin-top: 20px;
}
.control-tab,
.control-text {
display: inline-block;
}
:deep(.cell) {
text-align: center;
} }
:deep(#pane-first) { </script>
height: 100%; <style lang="less" scoped>
} @import "./dialogStyle.less";
@import "./tabs1.less";
.control-scene-tab,
.control-scene-text {
display: inline-block;
}
.light-parameters-tab,
.light-parameters-text {
display: inline-block;
}
.light-parameters-textarea>p {
height: 100%;
display: flex;
border: 1px solid rgba(236, 239, 245, 1);
justify-content: center;
align-items: center;
}
.bottom {
width: 100%;
height: 64px;
display: flex;
justify-content: flex-end;
align-items: center;
position: fixed;
bottom: 0;
right: 0;
}
.execute {
margin-right: 20px;
width: 74px;
height: 40px;
opacity: 1;
cursor: pointer;
border-radius: 4px;
background: rgba(67, 136, 251, 1);
font-size: 14px;
font-weight: 400;
color: white;
border: 0;
margin-left: 10px;
}
.flushed {
width: 74px;
height: 40px;
cursor: pointer;
opacity: 1;
border-radius: 4px;
font-size: 14px;
font-weight: 400;
color: rgba(102, 102, 102, 1);
background: white;
border: 1px solid rgba(193, 197, 204, 1);
}
:deep(.ant-table-pagination) {
visibility: hidden;
}
.drawer-content {
margin-left: 20px;
}
.arrow-indicator {
position: absolute;
top: 50%;
left: 0;
transform: translateY(-50%);
z-index: 1;
}
.drawer-title1 {
position: fixed;
width: 33px;
height: 33px;
top: 0;
bottom: 0;
right: 20px;
margin: auto;
z-index: 99999;
}
.drawer-title2 {
position: fixed;
width: 33px;
height: 33px;
top: 0;
bottom: 0;
right: 495px;
margin: auto;
z-index: 99999;
}
.arrowbtn {
display: flex;
justify-content: center;
align-items: center;
width: 28px;
height: 28px;
background: rgba(0, 0, 0, 1);
opacity: 0.5;
border: none;
}
:deep(.ant-tabs-tab-btn) {
color: white;
}
:deep(.ant-table) {
background-color: transparent;
}
:deep(.ant-table-bordered) {
background-color: transparent;
}
:deep(.ant-table-thead) {
background-color: transparent;
}
:deep(.ant-table-cell) {
background-color: transparent;
color: #fff;
}
.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%;
cellspacing: 0;
cellpadding: 0;
border: 1px solid rgba(255, 255, 255);
border-radius: 5px;
background: rgba(255, 255, 255, 0.1);
}
.light-area,
.circuit-area,
.control-area,
.control-scene-area,
.light-parameters-area {
width: 100%;
margin-top: 20px;
display: flex;
align-items: center;
}
.zmhlbtn {
position: relative;
}
//
.anticon-stop {
position: absolute;
right: 3px;
bottom: 3px;
}
}
</style> </style>

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

@ -14,10 +14,10 @@
</thead> </thead>
<tbody> <tbody>
<tr v-for="(row, index) in dataSource" :key="index"> <tr v-for="(row, index) in dataSource" :key="index">
<td>{{ row.key }}</td> <td>{{ index + 1 }}</td>
<td>{{ row.data }}</td> <td>{{ row.startTime }}</td>
<td>{{ row.planName }}</td> <td>{{ row.planName }}</td>
<td v-if="row.status === '待执行'"> <td v-if="row.planStatus == '2'">
<button <button
style=" style="
font-size: 12px; font-size: 12px;
@ -25,10 +25,10 @@
color: rgb(57, 215, 187); color: rgb(57, 215, 187);
border: 1px solid rgb(57, 215, 187); border: 1px solid rgb(57, 215, 187);
"> ">
{{ row.status }} 已执行
</button> </button>
</td> </td>
<td v-if="row.status !== '待执行'"> <td v-if="row.planStatus == '1'">
<button <button
style=" style="
font-size: 12px; font-size: 12px;
@ -36,7 +36,7 @@
border: 1px solid rgba(243, 97, 99); border: 1px solid rgba(243, 97, 99);
color: rgba(243, 97, 99); color: rgba(243, 97, 99);
"> ">
{{ row.status }} 待执行
</button> </button>
</td> </td>
<td> <td>
@ -73,41 +73,53 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted } from 'vue'; import { ref, onMounted } from 'vue';
//
import { http } from '/nerv-lib/util/http';
import { lightingManage } from '/@/api/IlluminationInfo';
// // ===========================================================
onMounted(() => {
onMounted(() => {
getTable()
getLeftPlan()
}) })
// tab ========================================================
// //
const dataSource = ref([ const dataSource = ref([]);
{ //
key: '1', const getTable = () => {
data: '2024-05-01', http.get(lightingManage.getPlanTable, {}).then(res => {
planName: '劳动节', dataSource.value = res.data
status: '暂停中', })
}, }
{
key: '2', // tab ====================================================
data: '2024-05-01',
planName: '国庆节', //
status: '待执行', const addVisible = ref(false);
}, //
{ const addModal = () => {
key: '3', addVisible.value = true;
data: '2024-05-01', };
planName: '元旦',
status: '待执行', // 穿 =======================================================
},
]); // 穿
const addVisible = ref<boolean>(false); const transferData = ref([])
// 穿
const getLeftPlan = () => {
http.get(lightingManage.getLeftPlan, {}).then(res => {
console.log(res)
})
}
// //
const handleRefClick1 = () => { const handleRefClick1 = () => {
alert(111) alert(111)
}; };
const addModal = () => {
addVisible.value = true;
};
const handleChange = (keys: string[], direction: string, moveKeys: string[]) => { const handleChange = (keys: string[], direction: string, moveKeys: string[]) => {
console.log(keys, direction, moveKeys); console.log(keys, direction, moveKeys);
}; };
@ -138,8 +150,6 @@ const mockData = ref([
]); ]);
const targetKeys = ref<string[]>([]); const targetKeys = ref<string[]>([]);
const filterOption = (inputValue: string, option: MockData) => { const filterOption = (inputValue: string, option: MockData) => {
console.log(option.description);
return option.description.indexOf(inputValue) > -1; return option.description.indexOf(inputValue) > -1;
}; };
@ -200,6 +210,7 @@ const filterOption = (inputValue: string, option: MockData) => {
letter-spacing: 0; letter-spacing: 0;
line-height: 20px; line-height: 20px;
color: rgba(67, 136, 251, 1); color: rgba(67, 136, 251, 1);
cursor: pointer;
} }
.tabReboot { .tabReboot {
margin-right: 8px; margin-right: 8px;

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

@ -18,19 +18,19 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="out-dialog" v-if="logModalVisible">
<div class="out-dialog" :class="{ 'showDialog' : logModalVisible }" v-if="logModalVisible">
<div class="content" v-if="logModalVisible"> <div class="content" v-if="logModalVisible">
<div> <div>
<div class="div-operation"></div> <div class="div-operation"></div>
<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="title-img" src="/asset/image//bulbLogo/21961.png" alt="" />&nbsp; <img class="title-img" src="/asset/image//bulbLogo/21961.png" alt="" />&nbsp;
<span class="title-text" style="font-size: 20px; font-weight: 500; color: rgba(255, 255, 255, 1)">{{ <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>
</div> </div>
<div class="btn-box"> <div class="btn-box">
@ -180,7 +180,6 @@ const handleRowClick = (index: any) => {
// //
.div-add { .div-add {
height: 64px; height: 64px;
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
@ -199,6 +198,7 @@ const handleRowClick = (index: any) => {
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
color: rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 1);
cursor: pointer;
} }
} }

7
hx-ai-intelligent/src/view/equipmentManage/group/index.vue

@ -237,4 +237,11 @@
.common-style; .common-style;
} }
} }
.tree,
:deep(.ns-table-search),
// :deep(.ns-list-table),
:deep(.ns-table-main) {
box-shadow: @ns-content-box-shadow;
}
</style> </style>

8
hx-ai-intelligent/src/view/equipmentManage/ledger/index.vue

@ -13,4 +13,10 @@
name: 'LedgerIndex', // name name: 'LedgerIndex', // name
}); });
</script> </script>
<style lang="less" scoped></style> <style lang="less" scoped>
:deep(.ns-table-search),
:deep(.ns-part-tree),
:deep(.ns-table-main) {
box-shadow: @ns-content-box-shadow;
}
</style>

15
hx-ai-intelligent/src/view/organizationManage/departmentManage/index.vue

@ -145,7 +145,7 @@
<ns-button type="primary" @click="CancelUser">取消</ns-button> <ns-button type="primary" @click="CancelUser">取消</ns-button>
<ns-button <ns-button
v-if="roleDisabled" v-if="roleDisabled"
:disabled="!roleTreeData?.length" :disabled="!selectRoleRef || !roleTreeData?.length"
type="primary" type="primary"
@click="rolePipe(roleEdit, false, false)"> @click="rolePipe(roleEdit, false, false)">
编辑 编辑
@ -501,6 +501,7 @@
roleFormData.value = {}; roleFormData.value = {};
opMap.type = ''; opMap.type = '';
opMap.fuc = ''; opMap.fuc = '';
selectRoleRef.value = '';
roleDisabled.value = true; roleDisabled.value = true;
}; };
@ -627,6 +628,7 @@
roleActiveKey.value = 1; roleActiveKey.value = 1;
// //
clearDeptData(); clearDeptData();
clearRoleData();
const { selected } = info; const { selected } = info;
if (!selectedKeys?.length) return; if (!selectedKeys?.length) return;
@ -686,7 +688,7 @@
roleFormData.value = cloneDeep(info.node.dataRef); roleFormData.value = cloneDeep(info.node.dataRef);
roleCheckedKeys.value = []; roleCheckedKeys.value = [];
if (selectRoleRef.value?.proleId) { if (selectRoleRef.value?.proleId) {
// //
getRolesonPermissionTree({ roleId: selectRoleRef.value?.proleId }); getRolesonPermissionTree({ roleId: selectRoleRef.value?.proleId });
} else { } else {
getRolePermissionTree({ deptId: selectRef.value.deptInfo.deptId }); getRolePermissionTree({ deptId: selectRef.value.deptInfo.deptId });
@ -723,6 +725,13 @@
deptPermission().then(() => { deptPermission().then(() => {
clearDeptData(); clearDeptData();
disabled.value = true; disabled.value = true;
//
if (selectRoleRef.value?.proleId) {
//
getRolesonPermissionTree({ roleId: selectRoleRef.value?.proleId });
} else {
getRolePermissionTree({ deptId: selectRef.value.deptInfo.deptId });
}
}); });
} }
}; };
@ -816,7 +825,7 @@
padding: @ns-gap; padding: @ns-gap;
background-color: @white; background-color: @white;
border-radius: @ns-border-radius; border-radius: @ns-border-radius;
// box-shadow: @ns-content-box-shadow; box-shadow: @ns-content-box-shadow;
} }
.tree { .tree {

9
hx-ai-intelligent/src/view/organizationManage/usermanage/config.ts

@ -4,12 +4,6 @@ import { origanizemanage } from '/@/api/origanizemanage';
export const formConfig = (disabled) => { export const formConfig = (disabled) => {
return ref([ return ref([
{ {
field: 'field111',
component: 'NsChildForm',
componentProps: {
title: '用户信息',
schemas: [
{
label: '账号', label: '账号',
field: 'accountNo', field: 'accountNo',
component: 'NsInput', component: 'NsInput',
@ -95,9 +89,6 @@ export const formConfig = (disabled) => {
maxLength: 30, maxLength: 30,
}, },
}, },
],
},
},
]); ]);
}; };
const options = ref([]); const options = ref([]);

23
hx-ai-intelligent/src/view/organizationManage/usermanage/index.vue

@ -32,12 +32,14 @@
:footer-style="{ textAlign: 'right' }" :footer-style="{ textAlign: 'right' }"
destroyOnClose destroyOnClose
@close="onClose"> @close="onClose">
<span class="admin">用户信息</span>
<ns-form <ns-form
ref="formRef" ref="formRef"
:schemas="formSchema" :schemas="formSchema"
:model="formData" :model="formData"
class="form" class="form"
:wrapperCol="{ span: 20 }" :wrapperCol="{ span: 20 }"
:labelCol="{ span: 4 }"
formLayout="vertical" /> formLayout="vertical" />
<span class="admin">用户权限</span> <span class="admin">用户权限</span>
<ns-view-list-table <ns-view-list-table
@ -71,7 +73,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, createVNode, defineComponent, reactive, ref, watchEffect } from 'vue'; import { computed, createVNode, defineComponent, reactive, ref, watchEffect } from 'vue';
import { http } from '/nerv-lib/util/http'; import { http } from '/nerv-lib/util/http';
import { NsMessage, NsModal } from '/nerv-lib/component'; import { Badge, NsMessage, NsModal } from '/nerv-lib/component';
import { formConfig, formConfig2 } from './config'; import { formConfig, formConfig2 } from './config';
import { origanizemanage } from '/@/api/origanizemanage'; import { origanizemanage } from '/@/api/origanizemanage';
@ -265,6 +267,7 @@
deptRoleInfoList: str, deptRoleInfoList: str,
roleId: casData.value[2].value, roleId: casData.value[2].value,
roleName: casData.value[2].label, roleName: casData.value[2].label,
deptId: casData.value[1].value,
orgId: casData.value[0].value, orgId: casData.value[0].value,
} as never); } as never);
handleClose(); handleClose();
@ -386,9 +389,7 @@
return createVNode('div', {}, [ return createVNode('div', {}, [
createVNode('span', {}, value[0]?.deptRoleInfoList), createVNode('span', {}, value[0]?.deptRoleInfoList),
value.length > 1 && value.length > 1 &&
createVNode( createVNode(Badge, {
'a',
{
onClick: () => onClick: () =>
NsModal.info({ NsModal.info({
icon: null, icon: null,
@ -396,9 +397,13 @@
innerHTML: value.map((item) => item?.deptRoleInfoList).join('<br>'), innerHTML: value.map((item) => item?.deptRoleInfoList).join('<br>'),
}), }),
}), }),
size: 'small',
style: {
transform: 'translateY(-4px)',
cursor: 'pointer',
}, },
`+${value.length}`, count: value.length - 1,
), }),
]); ]);
}, },
}, },
@ -596,6 +601,12 @@
.main { .main {
background-color: @ns-content-bg; background-color: @ns-content-bg;
display: flex; display: flex;
.top,
:deep(.ns-table-search),
:deep(.ns-table-main) {
box-shadow: @ns-content-box-shadow;
}
} }
.left { .left {
width: 300px; width: 300px;

2
hx-op/src/router/home.ts

@ -11,7 +11,7 @@ const home = {
component: () => import('/@/view/developing.vue'), component: () => import('/@/view/developing.vue'),
meta: { meta: {
title: '首页', title: '首页',
keepAlive: true, keepAlive: false,
// backApi: [], // backApi: [],
}, },
}, },

2
hx-op/src/router/organizationManage.ts

@ -11,7 +11,7 @@ const organizationManage = {
component: () => import('/@/view/organizationManage/enterpriseManage/index.vue'), component: () => import('/@/view/organizationManage/enterpriseManage/index.vue'),
meta: { meta: {
title: '企业管理', title: '企业管理',
keepAlive: true, keepAlive: false,
// backApi: [], // backApi: [],
}, },
}, },

2
lib/saas/view/system/application.vue

@ -337,7 +337,7 @@
height: 100%; height: 100%;
background-color: @white; background-color: @white;
border-radius: @ns-border-radius; border-radius: @ns-border-radius;
overflow-y: auto; // overflow-y: auto;
// overflow-x: hidden; // overflow-x: hidden;
// margin: 0 16px 16px 16px; // margin: 0 16px 16px 16px;
} }

Loading…
Cancel
Save