diff --git a/hx-ai-intelligent/src/api/deviceManage.ts b/hx-ai-intelligent/src/api/deviceManage.ts index 878ab00..29cfc9e 100644 --- a/hx-ai-intelligent/src/api/deviceManage.ts +++ b/hx-ai-intelligent/src/api/deviceManage.ts @@ -26,4 +26,6 @@ export enum group { computeGroupNum = `${BASE_URL}/deviceGroup/computeGroupNum`, // 分组删除 formula = `${BASE_URL}/deviceGroup/formula`, // 编辑公式 queryFormula = `${BASE_URL}/deviceGroup/queryFormula`, // 公式查询 + dropGroupFilter = `${BASE_URL}/deviceGroup/dropGroupFilter`, // 分组列表查询 + dropGroupInfoFilter = `${BASE_URL}/deviceGroup/dropGroupInfoFilter`, // 计算列表查询 } diff --git a/hx-ai-intelligent/src/config/app.config.ts b/hx-ai-intelligent/src/config/app.config.ts index a0db2b8..9f2881a 100644 --- a/hx-ai-intelligent/src/config/app.config.ts +++ b/hx-ai-intelligent/src/config/app.config.ts @@ -27,6 +27,7 @@ export const appConfig = { themeConfig: { bgImageUrl: `${import.meta.env.VITE_PUBLIC_PATH}/asset/image/login/background.png`, logoLessUrl: `${import.meta.env.VITE_PUBLIC_PATH}/asset/image/headerIcon.png`, + logoUrl: `${import.meta.env.VITE_PUBLIC_PATH}/asset/image/headerIcon.png`, }, // userCustomRouterGuard: (to, from, next, whiteNameList, authorizationStore, appConfig) => { // console.log({ to, from, next, whiteNameList, authorizationStore, appConfig }, 'routeConfig'); @@ -102,7 +103,7 @@ export const appConfig = { updatePassWordInfo: { title: '修改密码', subtitle: 'huaxing平台', - api: '/api/web/objs/User/changePassword', + api: '/carbon-smart/api/user/password', }, // headerBellInfo: { // isShow: true, diff --git a/hx-ai-intelligent/src/icon/common.svg b/hx-ai-intelligent/src/icon/common.svg new file mode 100644 index 0000000..6e5cb9e --- /dev/null +++ b/hx-ai-intelligent/src/icon/common.svg @@ -0,0 +1,4 @@ + + + + diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/config.ts b/hx-ai-intelligent/src/view/equipmentManage/group/config.ts index a009cd3..abd7710 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/group/config.ts +++ b/hx-ai-intelligent/src/view/equipmentManage/group/config.ts @@ -1,8 +1,9 @@ +import { NsSelect } from './../../../../../lib/component/form/select/index'; import { dateUtil } from '/nerv-lib/util/date-util'; import data from './mock.json'; import { http } from '/nerv-lib/util'; import { ref } from 'vue'; -import { group } from '/@/api/deviceManage'; +import { device, group } from '/@/api/deviceManage'; import { dict } from '/@/api'; import { origanizemanage } from '/@/api/origanizemanage'; const tableCalKeyMap = [ @@ -122,7 +123,7 @@ export const formSchema = [ immediate: true, // resultField: 'data.COUNT_POINT', labelField: 'cnValue', - valueField: 'cnValue', + valueField: 'dicKey', }, rules: [ { @@ -198,7 +199,7 @@ export const treeConfig = (orgId) => { immediate: true, // resultField: 'data.ENERGY_TYPE', labelField: 'cnValue', - valueField: 'cnValue', + valueField: 'dicKey', placeholder: '请选择能耗种类', autoSelectFirst: true, }, @@ -303,9 +304,22 @@ export const tableConfig = (el, elGroup, elFormula, defaultParams) => { schemas: [ { field: 'orgName', - component: 'NsInput', + component: 'NsSelectApi', + defaultParams: defaultParams.value, componentProps: { placeholder: '请选择公司', + mode: 'multiple', + api: group.dropGroupFilter, + resultField: 'data', + params: { filterField: 'ORG' }, + labelField: 'orgName', + valueField: 'orgId', + filterOption: (input: string, option: any) => { + return option.deviceName.toLowerCase().indexOf(input.toLowerCase()) >= 0; + }, + showSearch: true, + dropdownReload: true, + allowClear: true, }, }, { @@ -433,11 +447,23 @@ export const tableConfigCal = (el, elGroup, elFormula, defaultParams) => { formConfig: { schemas: [ { - field: 'name', - label: '公司', - component: 'NsInput', + field: 'orgIds', + component: 'NsSelectApi', + defaultParams: defaultParams.value, componentProps: { placeholder: '请选择公司', + mode: 'multiple', + api: group.dropGroupInfoFilter, + resultField: 'data', + params: { filterField: 'ORG' }, + labelField: 'orgName', + valueField: 'orgId', + filterOption: (input: string, option: any) => { + return option.deviceName.toLowerCase().indexOf(input.toLowerCase()) >= 0; + }, + showSearch: true, + dropdownReload: true, + allowClear: true, }, }, { @@ -455,17 +481,40 @@ export const tableConfigCal = (el, elGroup, elFormula, defaultParams) => { }, }, { - field: 'provider', - component: 'NsInput', + field: 'deviceStatus', + component: 'NsSelectApi', componentProps: { - placeholder: '请输入设备状态', + placeholder: '请选择设备状态', + api: () => dict({ params: { dicKey: 'DEVICE_STATUS' } }), + immediate: true, + labelField: 'cnValue', + valueField: 'dicKey', }, }, { field: 'deviceNameType', - component: 'NsInput', + component: 'NsSelectApi', + defaultParams: defaultParams.value, componentProps: { - placeholder: '请输入设备型号', + placeholder: '请选择设备型号', + mode: 'multiple', + api: (params: any) => { + return http.post(group.dropGroupInfoFilter, params).then((res: any) => { + const result = [...new Set(res.data)]; + return { data: result }; + }); + }, + resultField: 'data', + + params: { filterField: 'DEVICE_TYPE' }, + // labelField: 'orgName', + // valueField: 'orgId', + filterOption: (input: string, option: any) => { + return option.deviceName.toLowerCase().indexOf(input.toLowerCase()) >= 0; + }, + showSearch: true, + dropdownReload: true, + allowClear: true, }, }, { diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/editCal.vue b/hx-ai-intelligent/src/view/equipmentManage/group/editCal.vue index 9a3e31d..2f2ca8f 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/group/editCal.vue +++ b/hx-ai-intelligent/src/view/equipmentManage/group/editCal.vue @@ -104,7 +104,7 @@ item['key'] = item.id.toString(); return item; }); - targetKeys.value = res.data.linkGroups?.map((item) => { + targetKeys.value = res.data.linkDeviceInfos?.map((item) => { return item.id.toString(); }); }); diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/editGroup.vue b/hx-ai-intelligent/src/view/equipmentManage/group/editGroup.vue index 41be93e..176cfb0 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/group/editGroup.vue +++ b/hx-ai-intelligent/src/view/equipmentManage/group/editGroup.vue @@ -7,6 +7,7 @@ :cancel="() => (visible = false)" placement="right"> @@ -53,6 +54,7 @@ const emit = defineEmits(['sure']); const props = defineProps({ params: Object }); const visible = ref(false); + const editGroupRef = ref(); const model = ref({}); const inputDisabled = ref(true); const selectedRowKeys = ref([]); @@ -63,6 +65,7 @@ }; const startCararcter = 65; + // 点击新增按钮新增分组 const addGroup = () => { opType = true; getCode(); @@ -71,19 +74,30 @@ model.value = { groupName: '' }; // if(mockDataSource.value.length) }; + const op = () => { inputDisabled.value = !inputDisabled.value; add(); }; - //新增 + + const editGroup = () => { + if (!selectedRowKeys.value?.length) { + NsMessage.warn('请先选择需要编辑的分组'); + return; + } + inputDisabled.value = false; + }; + //点击对钩按钮处理保存逻辑 const add = () => { const finalParams = { ...props.params, ...model.value }; if (opType) { delete finalParams.id; } - http.post(group.saveComputeGroup, finalParams).then(() => { - getTableData(); - NsMessage.success('操作成功'); + editGroupRef.value.triggerSubmit().then(() => { + http.post(group.saveComputeGroup, finalParams).then(() => { + getTableData(); + NsMessage.success('操作成功'); + }); }); }; diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/index.vue b/hx-ai-intelligent/src/view/equipmentManage/group/index.vue index 389320f..8ddb9c9 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/group/index.vue +++ b/hx-ai-intelligent/src/view/equipmentManage/group/index.vue @@ -16,7 +16,14 @@