diff --git a/hx-ai-intelligent/src/App.vue b/hx-ai-intelligent/src/App.vue index 1b31526..9d71885 100644 --- a/hx-ai-intelligent/src/App.vue +++ b/hx-ai-intelligent/src/App.vue @@ -48,11 +48,18 @@ height: 100%; } } + // 树组件 :deep(.ant-tree-node-content-wrapper) { overflow: hidden; text-overflow: ellipsis; text-wrap: nowrap; } + + :deep(.ant-tree-node-selected) { + color: @primary-color !important; + } + + // ns-view-list-table 搜索区域 :deep(.ns-table-search) { .ns-flexv2-form { .ns-operate { diff --git a/hx-ai-intelligent/src/api/IlluminationInfo.ts b/hx-ai-intelligent/src/api/IlluminationInfo.ts new file mode 100644 index 0000000..f6de125 --- /dev/null +++ b/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', +} diff --git a/hx-ai-intelligent/src/api/alarmSettings/notificationManagements.ts b/hx-ai-intelligent/src/api/alarmSettings/notificationManagements.ts new file mode 100644 index 0000000..3751491 --- /dev/null +++ b/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', //通知管理 查询详情 +} diff --git a/hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts b/hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts index 5d666ad..edae9fa 100644 --- a/hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts +++ b/hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts @@ -9,11 +9,11 @@ export enum carbonEmissionFactorLibrary { creat = '/carbon-smart/api/carbon/emission/type/creatOrUpdate', delTreeNode = '/carbon-smart/api/carbon/emission/type/del', // 单位管理 - dictionaryUnitManagement = '/carbon-smart/api/carbon/emission/factor/dictionaryUnitManagement', - findOutermost = '/carbon-smart/api/carbon/emission/factor/findOutermost', - createDictionary = '/carbon-smart/api/carbon/emission/factor/createDictionary', - updateDictionary = '/carbon-smart/api/carbon/emission/factor/updateDictionary', - delDictionary = '/carbon-smart/api/carbon/emission/factor/delDictionary', + dictionaryUnitManagement = '/carbon-smart/client/dict/dictionaryUnitManagement', + findOutermost = '/carbon-smart/client/dict/findOutermost', + createDictionary = '/carbon-smart/client/dict/createDictionary', + updateDictionary = '/carbon-smart/client/dict/updateDictionary', + delDictionary = '/carbon-smart/client/dict/delDictionary', } // 碳排管理-碳排统计接口 export enum energyConsumption { @@ -35,4 +35,11 @@ export enum quickCalculation { // 碳排管理-碳排统计接口 export enum carbonEmission { carbonEmissionStatistics = '/carbon-smart/api/carbon/energy/correlation/carbonEmissionStatistics', +} +// 碳盘查接口 +export enum carbonInventoryCheck { + carbonInventoryList = '/carbon-smart/api/carbon/report/carbonInventoryList', + createOrUpdate = '/carbon-smart/api/carbon/report/createOrUpdate', + findById = '/carbon-smart/api/carbon/report/findById', + delete = '/carbon-smart/api/carbon/report/delete', } \ No newline at end of file diff --git a/hx-ai-intelligent/src/components/ns-modal-form.vue b/hx-ai-intelligent/src/components/ns-modal-form.vue index d60757c..d35d625 100644 --- a/hx-ai-intelligent/src/components/ns-modal-form.vue +++ b/hx-ai-intelligent/src/components/ns-modal-form.vue @@ -1,7 +1,6 @@ + diff --git a/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/ts/config.ts b/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/ts/config.ts index 8d4092f..069127e 100644 --- a/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/ts/config.ts +++ b/hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/ts/config.ts @@ -145,7 +145,7 @@ export const notificationtableConfig = (look: any, status: any) => { fieldMap: ['manufactureBeginDate', 'manufactureEndDate'], componentProps: { valueFormat: 'YYYY-MM-DD', - placeholder: ['设备生产开始日期', '设备生产结束日期'], + placeholder: ['开始日期', '结束日期'], }, }, ], diff --git a/hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/index.vue b/hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/index.vue new file mode 100644 index 0000000..a8e00cc --- /dev/null +++ b/hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/index.vue @@ -0,0 +1,29 @@ + + diff --git a/hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/look.vue b/hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/look.vue new file mode 100644 index 0000000..1def5cc --- /dev/null +++ b/hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/look.vue @@ -0,0 +1,234 @@ + + + diff --git a/hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/notificationManagementMock.json b/hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/notificationManagementMock.json new file mode 100644 index 0000000..6f442ed --- /dev/null +++ b/hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/notificationManagementMock.json @@ -0,0 +1,108 @@ +{ + "listData":[ + { + "id": "d4", + "isDel": "0", + "officesId": "84", + "deviceCode": "37430200143", + "deviceName": "地听测试电表", + "category": "1", + "type": "1001", + "energyCount": "1", + "serialNumber": "69", + "pidCode": null, + "brand": "", + "types": "", + "manufacturer": "elit non in", + "contacts": "ad reprehenderit", + "phonenumber": "34", + "position": "in esse commodo1", + "activeState": "1", + "measurementDirection": "1", + "deviceMagnification": 62, + "deviceAccuracy": "89", + "frequency": "anim consequat irure", + "standardFrequency": "ut elit", + "deviceHead": "pariatur ex velit", + "constructor": "84566", + "voltageType": "cillum aliquip reprehenderit", + "pt": 61, + "ct": 64, + "communicationProtocol": "cupidatat nisi ea ad", + "ip": "", + "port": "", + "com": "", + "slaveAddress": "", + "dlt": "", + "conversionIdentifier": "48", + "multiplicationAdjustment": "1", + "accessMethod": "1", + "replacementFrequency": "0", + "dataDetail": "sit", + "insertTime": null, + "children": null, + "devicePointList": null, + "insertUser": null, + "priority": "1", + "alarmTitle": "电压异常告警", + "errorCode": "A001", + "monitorTime":"1", + "repetitions":"1", + "monitorTimeUnit": "分", + "enableRules": "1", + "isUse":true + } , { + "id": "d5", + "isDel": "0", + "officesId": "84", + "deviceCode": "37430200143", + "deviceName": "地听测试电表", + "category": "1", + "type": "1001", + "energyCount": "1", + "serialNumber": "69", + "pidCode": null, + "brand": "", + "types": "", + "manufacturer": "elit non in", + "contacts": "ad reprehenderit", + "phonenumber": "34", + "position": "in esse commodo2", + "activeState": "1", + "measurementDirection": "1", + "deviceMagnification": 62, + "deviceAccuracy": "89", + "frequency": "anim consequat irure", + "standardFrequency": "ut elit", + "deviceHead": "pariatur ex velit", + "constructor": "84566", + "voltageType": "cillum aliquip reprehenderit", + "pt": 61, + "ct": 64, + "communicationProtocol": "cupidatat nisi ea ad", + "ip": "", + "port": "", + "com": "", + "slaveAddress": "", + "dlt": "", + "conversionIdentifier": "48", + "multiplicationAdjustment": "1", + "accessMethod": "1", + "replacementFrequency": "0", + "dataDetail": "sit", + "insertTime": null, + "children": null, + "devicePointList": null, + "insertUser": null, + "priority": "1", + "alarmTitle": "电压异常告警", + "errorCode": "A001", + "monitorTime":"1", + "repetitions":"1", + "monitorTimeUnit": "分", + "enableRules": "0", + "isUse":true + } + ] + +} \ No newline at end of file diff --git a/hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/status.vue b/hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/status.vue new file mode 100644 index 0000000..c6e1687 --- /dev/null +++ b/hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/status.vue @@ -0,0 +1,124 @@ + + + diff --git a/hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/ts/config.ts b/hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/ts/config.ts new file mode 100644 index 0000000..03ca249 --- /dev/null +++ b/hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/ts/config.ts @@ -0,0 +1,158 @@ +import { dateUtil } from '/nerv-lib/util/date-util'; +import data from '../notificationManagementMock.json'; +import { http } from '/nerv-lib/util'; +import { ref } from 'vue'; +const tableKeyMap = [ + { + title: '序号', + dataIndex: 'address', + customRender: (text: any) => { + return text.index + 1; + }, + }, + { + title: '告警编号', + dataIndex: 'id', + }, + { + title: '告警描述', + dataIndex: 'deviceCode', + }, + { + title: '优先级', + dataIndex: 'deviceName', + }, + { + title: '状态', + dataIndex: 'position', + }, + { + title: '错误码', + dataIndex: 'position', + textEllipsis: true, + }, + { + title: '设备信息', + dataIndex: 'position', + }, + { + title: '更新时间', + dataIndex: 'enableRules', + }, + { + title: '断网时长', + dataIndex: 'enableRules', + }, +]; +const mockData = ref(data.listData); +export const notificationtableConfig = (look: any, status: any) => { + return { + title: '告警记录', + // api: '/carbon_emission/device/getDeviceList', + value: mockData.value, + headerActions: [{}], + columns: tableKeyMap, + // rowSelection: null, 选择按钮 + columnActions: { + title: '操作', + actions: [ + { + label: '详情', + name: 'FeedBackDetail', + dynamicParams: ['uuid', 'appealType'], + handle: (data: any) => { + console.log(look.value); + look.value.toggle(data); + }, + }, + { + label: '状态', + name: 'FeedBackDetail', + dynamicParams: ['uuid', 'appealType'], + handle: (data: any) => { + status.value.toggle(data); + }, + }, + ], + }, + + formConfig: { + schemas: [ + { + field: 'name', + label: '告警类型', + component: 'NsSelect', + defaultValue: '2', + componentProps: { + placeholder: '请选择告警优先级', + disabled: true, + options: [ + { + label: '紧急', + value: '1', + }, + { + label: '重要', + value: '2', + }, + { + label: '一般', + value: '3', + }, + ], + }, + }, + { + field: 'provider', + label: '状态', + component: 'NsSelect', + componentProps: { + placeholder: '请选择状态', + options: [ + { + label: '待处理', + value: '1', + }, + { + label: '处理中', + value: '2', + }, + { + label: '已完成', + value: '3', + }, + { + label: '超时', + value: '4', + }, + { + label: '关闭', + value: '5', + }, + ], + }, + }, + { + field: 'provider', + label: '错误码', + component: 'NsInput', + componentProps: { + placeholder: '请输入告警错误码', + }, + }, + { + field: 'createTime', + label: '生产日期', + component: 'NsRangePicker', + fieldMap: ['manufactureBeginDate', 'manufactureEndDate'], + componentProps: { + valueFormat: 'YYYY-MM-DD', + placeholder: ['开始日期', '结束日期'], + }, + }, + ], + }, + // pagination: { pageSizeOptions: false }, + rowKey: 'id', + }; +}; diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue index cf05dbf..8925bca 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue @@ -5,7 +5,7 @@
-
排放分类
+
排放分类
@@ -562,6 +562,7 @@ }); opMap.value.fuc = (formData: any) => { formData.emissionType = formData.emissionType[formData.emissionType.length - 1] + debugger return http.post(carbonEmissionFactorLibrary.creatOrUpdate, formData).then(() => { mainRef.value?.nsTableRef.reload(); visible.value = false; @@ -665,14 +666,22 @@ handle: (record: any) => { userAuthList.value.splice(0); setTimeout(() => { - console.log(record.id); - - http.post(carbonEmissionFactorLibrary.findById,{ id: record.id } ).then((res) => { - formData.value = res.data; + const measurementUnit = ref([]) + http.post(carbonEmissionFactorLibrary.getCarbonFactorTree,{}).then((res) => { + measurementUnit.value = res.data + http.post(carbonEmissionFactorLibrary.findById,{ id: record.id } ).then((res) => { + if (res.data.emissionType) { + let selectDevice = ref([Number(res.data.emissionType)]); + findParentIds(measurementUnit.value, res.data.emissionType, selectDevice.value); + res.data.emissionType = selectDevice + } + formData.value = res.data; + }); }); }, 10); opMap.value.type = 'edit'; opMap.value.fuc = (formData: any) => { + formData.emissionType = formData.emissionType[formData.emissionType.length - 1] return http.post(carbonEmissionFactorLibrary.creatOrUpdate, formData).then(() => { mainRef.value?.nsTableRef.reload(); visible.value = false; @@ -707,16 +716,17 @@ { field: 'emissionProcess', label: '排放环节', - component: 'NsSelect', + component: 'NsInput', componentProps: { - allowClear: true, + // allowClear: true, placeholder: '请选择排放环节', - options: [ - { - label: '消费环节', - value: 0, - } - ], + maxLength: 30, + // options: [ + // { + // label: '消费环节', + // value: 0, + // } + // ], }, }, { @@ -789,6 +799,27 @@ // pagination: { defaultPageSize: 10 }, rowKey: 'id', }); + function findParentIds(tree: any, targetId: number, result: any) { + for (let item of tree) { + if (item.children && item.children.length > 0) { + if (item.children.some((child: any) => child.id === Number(targetId))) { + result.unshift(item.id); // 将当前节点的id添加到结果数组的最前面 + findParentIds(tree, item.id, result); // 递归查找父级节点的id + break; // 找到后可以退出循环 + }else{ + for(let childsItem of item.children){ + if(childsItem.children && childsItem.children.length > 0){ + if (childsItem.children.some((child: any) => child.id === Number(targetId))) { + result.unshift(childsItem.id); // 将当前节点的id添加到结果数组的最前面 + findParentIds(tree, childsItem.id, result); // 递归查找父级节点的id + break; // 找到后可以退出循环 + } + } + } + } + } + } + } // 单位管理 const unitExpandedKeys = ref(); @@ -976,6 +1007,26 @@ padding-bottom: 10px; border-bottom: 1px solid #e9e9e9; } + .title{ + text-align: left; + height: 32px; + line-height: 32px; + font-weight: bold; + user-select: text; + position: relative; + padding-left: 9px; + } + .title::before { + content: ''; + position: absolute; + left: 0; + top: 50%; + transform: translateY(-50%); + height: 13px; + width: 3px; + border-radius: 1px; + background-color: #2778FF; + } .treeRow { display: flex; justify-content: space-between; diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/carbonEmissions/index copy.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/carbonEmissions/index copy.vue new file mode 100644 index 0000000..62c8b54 --- /dev/null +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/carbonEmissions/index copy.vue @@ -0,0 +1,306 @@ + + + + \ No newline at end of file diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/carbonEmissions/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/carbonEmissions/index.vue index 9298666..d792f11 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/carbonEmissions/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/carbonEmissions/index.vue @@ -83,7 +83,7 @@ }, { title: '计量单位', - dataIndex: 'unit', + dataIndex: 'unitName', }, { title: '加权平均', diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue index 78ff753..4978f78 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue @@ -1,6 +1,6 @@ - - --> + + = { energyType: [{ required: true, message: '请输入能源种类', trigger: 'change' }], @@ -229,19 +233,196 @@ queryParams.value.year = selectYear.value 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) { + let selectDevice = ref([Number(res.data.unit)]); + findParentIds(measurementUnit.value, res.data.unit, selectDevice.value); + res.data.unit = selectDevice + } + 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', + }); + // 定义一个递归函数来查找每一级的id 设备类型回显 层级方法 + function findParentIds(tree: any, targetId: number, result: any) { + for (let item of tree) { + if (item.children && item.children.length > 0) { + if (item.children.some((child: any) => child.value === targetId)) { + result.unshift(item.value); // 将当前节点的id添加到结果数组的最前面 + findParentIds(tree, item.value, result); // 递归查找父级节点的id + break; // 找到后可以退出循环 + } + } + } + } // 获取表格数据 const getTableList = () => { fetch(energyConsumption.pageList , queryParams.value).then((res) => { data.value = res.data.records - total.value = res.data.total }); }; - getTableList() // 分页器 const onChange = (pageNumber: number,size: number) => { queryParams.value.pageNum = pageNumber; queryParams.value.pageSize = size; - getTableList() + mainRef.value?.nsTableRef.reload(); }; // 计算碳排切换 const changeRadio = (e) => { @@ -258,28 +439,29 @@ .then(() => { console.log('values', formState, toRaw(formState)); if(formState.value.unit){ - formState.value.unit = formState.value.unit.join(',') + formState.value.unit = formState.value.unit.join(',').split(',')[1] } if(formState.value.id){ fetch(energyConsumption.update , formState.value).then((res) => { visible.value = false + formState.value = { + orgId: orgId.value, + } message.success('操作成功!'); - getTableList() + mainRef.value?.nsTableRef.reload(); }); }else{ fetch(energyConsumption.creat , formState.value).then((res) => { if(res.data === '新增数据已存在'){ visible.value = false - queryParams.value = formState.value - queryParams.value.pageNum = 1, - queryParams.value.pageSize = 10, - queryParams.value.orgId = orgId.value, - queryParams.value.year = selectYear.value.format('YYYY') - getTableList() + NsMessage.warning(res.data); }else{ visible.value = false + formState.value = { + orgId: orgId.value, + } message.success('操作成功!'); - getTableList() + mainRef.value?.nsTableRef.reload(); } }); } @@ -298,22 +480,23 @@ fetch(carbonEmissionFactorLibrary.dictionaryUnitManagement, { grp: 'MEASUREMENT_UNIT'}).then((res) => { measurementUnit.value = res.data measurementUnit.value = measurementUnit.value.map(item => ({ - value: item.cnValue, + value: item.id, label: item.cnValue, children: item.children ? item.children.map(child => ({ - value: child.cnValue, + value: child.id, label: child.cnValue })) : [] })); + debugger }); // 获取自动采集节点的数据 fetch(group.queryDeviceGroupTree, { energyType: 'ELECTRICITY_USAGE',orgId: orgId.value }).then((res) => { treeData.value = res.data treeData.value = treeData.value.map(item => ({ - value: item.pointName, + value: item.id, label: item.pointName, children: item.children ? item.children.map(child => ({ - value: child.pointName, + value: child.id, label: child.pointName })) : [] })); @@ -329,8 +512,8 @@ getDictList() visible.value = true fetch(energyConsumption.findById , {id : record.id }).then((res) => { - if(res.data.unit){ - res.data.unit = res.data.unit.split(',') + if(res.data.unitName){ + res.data.unitName = res.data.unitName.split(',') } formState.value = res.data }); @@ -346,7 +529,7 @@ onOk() { fetch(energyConsumption.del , {id : record.id }).then((res) => { message.success('操作成功!'); - getTableList() + mainRef.value?.nsTableRef.reload(); }); }, onCancel() { @@ -357,6 +540,9 @@ // 关闭新增抽屉 const onClose = () => { visible.value = false; + formState.value = { + orgId: orgId.value, + } formRef.value.resetFields(); }; // 点击上传凭证按钮 diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue index c45e65d..a43aa27 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue @@ -3,7 +3,7 @@
-
因子分类
+
因子分类
@@ -39,7 +39,7 @@
- 新增
- + --> + { return http.post(api, params); }; + const mainRef = ref(); // 数结构 const x = 3; const y = 2; @@ -209,12 +211,13 @@ autoExpandParent.value = false; }; // 被选中的树节点 + const energyType = ref() const onSelect = (selectedKey: string[], info: any) => { selectedKeys.value = selectedKey; if(info.selected){ - queryParams.value.energyType = info.node.id + energyType.value = info.node.id statsId.value = info.node.id - getTableList() + mainRef.value?.nsTableRef.reload(); } }; @@ -239,10 +242,9 @@ const getTreeData = () => { fetch(quickCalculation.carbonQuickTree).then((res) => { gData.value = res.data - debugger - queryParams.value.energyType = gData.value[0].children[0].id + energyType.value = gData.value[0].children[0].id statsId.value = gData.value[0].children[0].id - getTableList() + mainRef.value?.nsTableRef.reload(); }); }; getTreeData() @@ -254,6 +256,90 @@ orgId: orgId.value }) 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 = () => { fetch(quickCalculation.queryCarbonEmissionPage,queryParams.value).then((res) => { @@ -265,7 +351,7 @@ const onChange = (pageNumber: number,size: number) => { queryParams.value.pageNum = pageNumber; queryParams.value.pageSize = size; - getTableList() + mainRef.value?.nsTableRef.reload(); }; // 新增/编辑 const formRef = ref(); @@ -289,7 +375,7 @@ const onSelectionChange = (selectedKeys, selectedRows) => { selectedRowKeys.value = selectedKeys; formState.value.emissionFactors = selectedRows[0].emissionFactors - formState.value.carbonId = selectedRows[0].id + formState.value.factorId = selectedRows[0].id }; const queryData = ref({ orgId: orgId.value, @@ -304,11 +390,11 @@ }; // 点击编辑按钮 const editData = (record) =>{ - selectedRowKeys.value = [record.carbonId]; + selectedRowKeys.value = [record.factorId]; formState.value.id = record.id formState.value.emissionFactors = record.emissionFactors formState.value.dateRange = [record.startTime, record.endTime]; - formState.value.carbonId = record.carbonId + formState.value.factorId = record.factorId visible.value = true getNewTable() }; @@ -321,14 +407,13 @@ formState.value.startTime = formState.value.dateRange[0] formState.value.endTime = formState.value.dateRange[1] console.log('values', formState, toRaw(formState)); - debugger if(formState.value.id){ fetch(quickCalculation.update,formState.value).then((res) => { visible.value = false selectedRowKeys.value = []; formState.value = {} formRef.value.resetFields(); - getTableList() + mainRef.value?.nsTableRef.reload(); }); }else{ fetch(quickCalculation.creat,formState.value).then((res) => { @@ -336,7 +421,7 @@ selectedRowKeys.value = []; formState.value = {} formRef.value.resetFields(); - getTableList() + mainRef.value?.nsTableRef.reload(); }); } }) @@ -408,6 +493,9 @@ ::v-deep .ant-table-container{ padding: 0px 16px; } + :deep(.ns-table-main) { + margin-top: unset !important; + } .top { overflow: auto; } @@ -419,6 +507,26 @@ padding-bottom: 10px; border-bottom: 1px solid #e9e9e9; } + .title{ + text-align: left; + height: 32px; + line-height: 32px; + font-weight: bold; + user-select: text; + position: relative; + padding-left: 9px; + } + .title::before { + content: ''; + position: absolute; + left: 0; + top: 50%; + transform: translateY(-50%); + height: 13px; + width: 3px; + border-radius: 1px; + background-color: #2778FF; + } ::v-deep .ant-table-title{ display: flex; height: 100%; diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/config.ts b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/config.ts new file mode 100644 index 0000000..6c3642a --- /dev/null +++ b/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]; + }); + } + }, + }, + }, + ]); +}; diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue new file mode 100644 index 0000000..33f731f --- /dev/null +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue @@ -0,0 +1,406 @@ + + + + + \ No newline at end of file diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue new file mode 100644 index 0000000..807cb39 --- /dev/null +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue @@ -0,0 +1,225 @@ + + + + + \ No newline at end of file diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/mock.ts b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/mock.ts new file mode 100644 index 0000000..76ff687 --- /dev/null +++ b/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' }, + ], + }, +]; diff --git a/hx-ai-intelligent/src/view/equipmentControl/lightingManage/dialogStyle.less b/hx-ai-intelligent/src/view/equipmentControl/lightingManage/dialogStyle.less index 7dee3a5..b3bf2f3 100644 --- a/hx-ai-intelligent/src/view/equipmentControl/lightingManage/dialogStyle.less +++ b/hx-ai-intelligent/src/view/equipmentControl/lightingManage/dialogStyle.less @@ -3,6 +3,7 @@ right: 496px; width: 500px; height: 100%; + z-index: 99; top: 0; bottom: 0; margin: auto; @@ -12,6 +13,7 @@ display: flex; padding: 25px; flex-direction: column; + transition: all ease 0.5s; .content { overflow-y: scroll; .div-operation { @@ -138,4 +140,11 @@ color: black; } } +} + +.fade-enter-active, .fade-leave-active { + transform: translateX(0px); +} +.fade-enter-from, .fade-leave-to { + transform: translateX(496px); } \ No newline at end of file diff --git a/hx-ai-intelligent/src/view/equipmentControl/lightingManage/index.less b/hx-ai-intelligent/src/view/equipmentControl/lightingManage/index.less index dd02f25..4b4cf21 100644 --- a/hx-ai-intelligent/src/view/equipmentControl/lightingManage/index.less +++ b/hx-ai-intelligent/src/view/equipmentControl/lightingManage/index.less @@ -1,7 +1,5 @@ // 页面容器 .lighting-box { - // width: 100%; - // height: 100%; position: relative; // background: linear-gradient(#badaff, #8cabeb, #7095de); // 照明设备功能总容器 @@ -47,32 +45,46 @@ height: 240px; transform: rotateX(79deg) rotateZ(-22deg) skew(29deg); display: flex; - gap: 8px; + gap: 5px; .area1 { - width: 170px; + width: 70px; background: rgba(0, 251, 91, 0.3); border: 2px solid rgb(0, 251, 91); display: flex; } .area2 { - width: 240px; + width: 200px; background: rgba(255, 165, 0, 0.3); border: 2px solid rgb(255, 165, 0); display: flex; } .area3 { - width: 110px; + width: 120px; background: rgba(255, 0, 0, 0.3); border: 2px solid rgb(255, 0, 0); + display: flex; } .area4 { - flex: 1; + width: 70px; background: rgba(80, 236, 244, 0.3); 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 { cursor: pointer; transition: all ease 0.2s; @@ -82,37 +94,16 @@ display:flex; justify-content: center; align-items: center; - .group-shadow1 { - width: 35px; - height: 150px; - border-radius: 20px; - background: rgba(0, 0, 0, 0.1); - } - .group-shadow2 { - width: 35px; - height: 180px; - border-radius: 20px; - background: rgba(0, 0, 0, 0.1); - } - .group-shadow3 { - width: 40px; - height: 180px; - border-radius: 20px; - background: rgba(0, 0, 0, 0.1); - } - .group-shadow4 { - width: 40px; - height: 160px; + box-sizing: border-box; + padding: 10px; + // border: 2px solid red; + .shadow-box { + width: 30px; + height: 200px; 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); - // } } } } diff --git a/hx-ai-intelligent/src/view/equipmentControl/lightingManage/indexs.vue b/hx-ai-intelligent/src/view/equipmentControl/lightingManage/indexs.vue index a1c1006..dee6eb5 100644 --- a/hx-ai-intelligent/src/view/equipmentControl/lightingManage/indexs.vue +++ b/hx-ai-intelligent/src/view/equipmentControl/lightingManage/indexs.vue @@ -3,25 +3,31 @@
- - - + +
-
+
+
+
- + +
@@ -44,7 +50,7 @@ :maskStyle="{ 'background-color': 'rgba(0, 0, 0, 0)' }"> - + @@ -59,94 +65,170 @@ diff --git a/hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs2.vue b/hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs2.vue index d0db90a..d1a523d 100644 --- a/hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs2.vue +++ b/hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs2.vue @@ -14,29 +14,29 @@ - {{ row.key }} - {{ row.data }} + {{ index + 1 }} + {{ row.startTime }} {{ row.planName }} - + - + @@ -73,41 +73,53 @@ - + diff --git a/hx-ai-intelligent/src/view/organizationManage/departmentManage/index.vue b/hx-ai-intelligent/src/view/organizationManage/departmentManage/index.vue index e7be87b..94741d4 100644 --- a/hx-ai-intelligent/src/view/organizationManage/departmentManage/index.vue +++ b/hx-ai-intelligent/src/view/organizationManage/departmentManage/index.vue @@ -145,7 +145,7 @@ 取消 编辑 @@ -194,10 +194,10 @@ const selectRoleRef = ref(); const formSchema = formConfig(disabled as any); const formSchema2 = formConfig2(roleDisabled as any); - const { orgName, projectId, orgId } = JSON.parse( + const { orgName, projectId } = JSON.parse( sessionStorage.getItem(import.meta.env.VITE_PUBLIC_PATH), ); - // const orgId = JSON.parse(sessionStorage.getItem('ORGID')); + const orgId = JSON.parse(sessionStorage.getItem('ORGID')); const roleTreeData = ref([]); const rolePermissionTreeData = ref([]); const deptTreeData = ref([]); @@ -501,6 +501,7 @@ roleFormData.value = {}; opMap.type = ''; opMap.fuc = ''; + selectRoleRef.value = ''; roleDisabled.value = true; }; @@ -627,6 +628,7 @@ roleActiveKey.value = 1; // 需要重置数据 clearDeptData(); + clearRoleData(); const { selected } = info; if (!selectedKeys?.length) return; @@ -686,7 +688,7 @@ roleFormData.value = cloneDeep(info.node.dataRef); roleCheckedKeys.value = []; if (selectRoleRef.value?.proleId) { - // 查询子部门 + // 查询子角色 getRolesonPermissionTree({ roleId: selectRoleRef.value?.proleId }); } else { getRolePermissionTree({ deptId: selectRef.value.deptInfo.deptId }); @@ -723,6 +725,13 @@ deptPermission().then(() => { clearDeptData(); 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; background-color: @white; border-radius: @ns-border-radius; - // box-shadow: @ns-content-box-shadow; + box-shadow: @ns-content-box-shadow; } .tree { diff --git a/hx-ai-intelligent/src/view/organizationManage/usermanage/config.ts b/hx-ai-intelligent/src/view/organizationManage/usermanage/config.ts index 6b5e24c..dd3e275 100644 --- a/hx-ai-intelligent/src/view/organizationManage/usermanage/config.ts +++ b/hx-ai-intelligent/src/view/organizationManage/usermanage/config.ts @@ -4,100 +4,91 @@ import { origanizemanage } from '/@/api/origanizemanage'; export const formConfig = (disabled) => { return ref([ { - field: 'field111', - component: 'NsChildForm', + label: '账号', + field: 'accountNo', + component: 'NsInput', componentProps: { - title: '用户信息', - schemas: [ - { - label: '账号', - field: 'accountNo', - component: 'NsInput', - componentProps: { - placeholder: '请输入账号', - maxLength: 20, - disabled, - }, - rules: [ - { - required: true, - message: '请输入账号', - }, - ], - }, - { - label: '姓名', - field: 'realName', - component: 'NsInput', - componentProps: { - placeholder: '请输入姓名', - maxLength: 20, - }, - rules: [ - { - required: true, - message: '请输入姓名', - }, - ], - }, - { - label: '性别', - field: 'sex', - component: 'NsRadioGroup', - defaultValue: '男', - componentProps: { - radioType: 'radio', - options: [ - { label: '男', value: '男' }, - { label: '女', value: '女' }, - ], - }, - }, - { - label: '手机号', - field: 'telephone', - component: 'NsInput', - componentProps: { - placeholder: '请输入手机号', - maxLength: 11, - }, - rules: [ - { - required: true, - message: '请输入正确手机号格式', - pattern: /^[1][3-9][0-9]{9}$/, - }, - ], - }, - { - label: '邮箱', - field: 'email', - component: 'NsInput', - componentProps: { - placeholder: '请输入邮箱', - maxLength: 30, - }, - rules: [ - { - pattern: /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/, - message: '请输入正确的邮箱格式', - trigger: 'blur', - }, - ], - }, - { - label: '组织关系', - field: 'orgName', - component: 'NsInput', - defaultValue: JSON.parse(sessionStorage.getItem(import.meta.env.VITE_PUBLIC_PATH)).orgName, - componentProps: { - disabled: true, - maxLength: 30, - }, - }, + placeholder: '请输入账号', + maxLength: 20, + disabled, + }, + rules: [ + { + required: true, + message: '请输入账号', + }, + ], + }, + { + label: '姓名', + field: 'realName', + component: 'NsInput', + componentProps: { + placeholder: '请输入姓名', + maxLength: 20, + }, + rules: [ + { + required: true, + message: '请输入姓名', + }, + ], + }, + { + label: '性别', + field: 'sex', + component: 'NsRadioGroup', + defaultValue: '男', + componentProps: { + radioType: 'radio', + options: [ + { label: '男', value: '男' }, + { label: '女', value: '女' }, ], }, }, + { + label: '手机号', + field: 'telephone', + component: 'NsInput', + componentProps: { + placeholder: '请输入手机号', + maxLength: 11, + }, + rules: [ + { + required: true, + message: '请输入正确手机号格式', + pattern: /^[1][3-9][0-9]{9}$/, + }, + ], + }, + { + label: '邮箱', + field: 'email', + component: 'NsInput', + componentProps: { + placeholder: '请输入邮箱', + maxLength: 30, + }, + rules: [ + { + pattern: /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/, + message: '请输入正确的邮箱格式', + trigger: 'blur', + }, + ], + }, + { + label: '组织关系', + field: 'orgName', + component: 'NsInput', + defaultValue: JSON.parse(sessionStorage.getItem(import.meta.env.VITE_PUBLIC_PATH)).orgName, + componentProps: { + disabled: true, + maxLength: 30, + }, + }, ]); }; const options = ref([]); diff --git a/hx-ai-intelligent/src/view/organizationManage/usermanage/index.vue b/hx-ai-intelligent/src/view/organizationManage/usermanage/index.vue index 9528e9e..e290d2c 100644 --- a/hx-ai-intelligent/src/view/organizationManage/usermanage/index.vue +++ b/hx-ai-intelligent/src/view/organizationManage/usermanage/index.vue @@ -32,12 +32,14 @@ :footer-style="{ textAlign: 'right' }" destroyOnClose @close="onClose"> + 用户信息 用户权限 import { computed, createVNode, defineComponent, reactive, ref, watchEffect } from 'vue'; 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 { origanizemanage } from '/@/api/origanizemanage'; @@ -265,6 +267,7 @@ deptRoleInfoList: str, roleId: casData.value[2].value, roleName: casData.value[2].label, + deptId: casData.value[1].value, orgId: casData.value[0].value, } as never); handleClose(); @@ -386,19 +389,21 @@ return createVNode('div', {}, [ createVNode('span', {}, value[0]?.deptRoleInfoList), value.length > 1 && - createVNode( - 'a', - { - onClick: () => - NsModal.info({ - icon: null, - content: createVNode('div', { - innerHTML: value.map((item) => item?.deptRoleInfoList).join('
'), - }), + createVNode(Badge, { + onClick: () => + NsModal.info({ + icon: null, + content: createVNode('div', { + innerHTML: value.map((item) => item?.deptRoleInfoList).join('
'), }), + }), + size: 'small', + style: { + transform: 'translateY(-4px)', + cursor: 'pointer', }, - `+${value.length}`, - ), + count: value.length - 1, + }), ]); }, }, @@ -596,6 +601,12 @@ .main { background-color: @ns-content-bg; display: flex; + + .top, + :deep(.ns-table-search), + :deep(.ns-table-main) { + box-shadow: @ns-content-box-shadow; + } } .left { width: 300px; diff --git a/hx-op/src/router/home.ts b/hx-op/src/router/home.ts index b8ea9f4..171c853 100644 --- a/hx-op/src/router/home.ts +++ b/hx-op/src/router/home.ts @@ -11,7 +11,7 @@ const home = { component: () => import('/@/view/developing.vue'), meta: { title: '首页', - keepAlive: true, + keepAlive: false, // backApi: [], }, }, diff --git a/hx-op/src/router/organizationManage.ts b/hx-op/src/router/organizationManage.ts index f4ecc42..e0b11ad 100644 --- a/hx-op/src/router/organizationManage.ts +++ b/hx-op/src/router/organizationManage.ts @@ -11,7 +11,7 @@ const organizationManage = { component: () => import('/@/view/organizationManage/enterpriseManage/index.vue'), meta: { title: '企业管理', - keepAlive: true, + keepAlive: false, // backApi: [], }, }, diff --git a/lib/component/modal/modal.vue b/lib/component/modal/modal.vue index 2d0a113..186aa13 100644 --- a/lib/component/modal/modal.vue +++ b/lib/component/modal/modal.vue @@ -1,7 +1,7 @@