diff --git a/hx-ai-intelligent/src/App.vue b/hx-ai-intelligent/src/App.vue
index 4ac92d2..35a2db5 100644
--- a/hx-ai-intelligent/src/App.vue
+++ b/hx-ai-intelligent/src/App.vue
@@ -48,6 +48,15 @@
height: 100%;
}
}
+ // :deep(.ant-menu-item),
+ // :deep(.ant-menu-submenu-title) {
+ // &:not(.ant-menu-item-selected) {
+ // // &:not(.ant-menu-item-active) {
+ // .anticon {
+ // color: rgb(141, 150, 163);
+ // }
+ // }
+ // }
// :deep(.ns-content) {
// // padding-top: 80px !important;
// }
diff --git a/hx-ai-intelligent/src/api/deviceManage.ts b/hx-ai-intelligent/src/api/deviceManage.ts
index bac669b..53ab590 100644
--- a/hx-ai-intelligent/src/api/deviceManage.ts
+++ b/hx-ai-intelligent/src/api/deviceManage.ts
@@ -9,4 +9,5 @@ export enum device {
export enum group {
queryDeviceGroupTree = `${BASE_URL}/deviceGroup/queryDeviceGroupTree`, // 左侧树
creatOrUpdate = `${BASE_URL}/deviceGroup/creatOrUpdate`, // 左侧树节点新增编辑
+ del = `${BASE_URL}/deviceGroup/del`, // 左侧树节点新增编辑
}
diff --git a/hx-ai-intelligent/src/components/ns-modal-form.vue b/hx-ai-intelligent/src/components/ns-modal-form.vue
index 24af74c..d60757c 100644
--- a/hx-ai-intelligent/src/components/ns-modal-form.vue
+++ b/hx-ai-intelligent/src/components/ns-modal-form.vue
@@ -1,13 +1,14 @@
-
+
@@ -21,6 +22,7 @@
api: string | object | Function;
data?: object;
extraModalConfig?: object;
+ success?: Function;
};
const route = useRoute();
const { httpRequest } = useApi();
@@ -59,14 +61,15 @@
formRef.value
.triggerSubmit()
.then((data: any) => {
- const { api } = props;
+ const { api, success } = props;
const requestConfig: HttpRequestConfig = { method: 'POST' };
const { params } = route;
httpRequest({ api, params: data, pathParams: params, requestConfig })
- .then(() => {
+ .then((res) => {
NsMessage.success('操作成功', 1, () => {
toggle();
+ success && success(res);
});
})
.finally(() => {
diff --git a/hx-ai-intelligent/src/icon/fenzujiedian.svg b/hx-ai-intelligent/src/icon/fenzujiedian.svg
new file mode 100644
index 0000000..3a830e9
--- /dev/null
+++ b/hx-ai-intelligent/src/icon/fenzujiedian.svg
@@ -0,0 +1,10 @@
+
diff --git a/hx-ai-intelligent/src/icon/jisuanjiedian.svg b/hx-ai-intelligent/src/icon/jisuanjiedian.svg
new file mode 100644
index 0000000..a485030
--- /dev/null
+++ b/hx-ai-intelligent/src/icon/jisuanjiedian.svg
@@ -0,0 +1,10 @@
+
diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/config.ts b/hx-ai-intelligent/src/view/equipmentManage/group/config.ts
index 4dee03b..f9a9459 100644
--- a/hx-ai-intelligent/src/view/equipmentManage/group/config.ts
+++ b/hx-ai-intelligent/src/view/equipmentManage/group/config.ts
@@ -62,7 +62,12 @@ const mockData = ref(data.listData);
export const formSchema = [
{
field: 'isCreate',
- component: 'NsInput',
+ component: 'NsCheck',
+ show: false,
+ },
+ {
+ field: 'isCreatSon',
+ component: 'NsCheck',
show: false,
},
{
@@ -71,7 +76,12 @@ export const formSchema = [
show: false,
},
{
- field: 'isCreatSon',
+ field: 'id',
+ component: 'NsInput',
+ show: false,
+ },
+ {
+ field: 'pid',
component: 'NsInput',
show: false,
},
@@ -95,10 +105,10 @@ export const formSchema = [
component: 'NsSelectApi',
componentProps: {
placeholder: '请选择节点类型(必填)',
- api: dict,
- params: { dicKey: 'COUNT_POINT' },
+ api: () => dict({ params: { dicKey: 'COUNT_POINT' } }),
+ // params: { dicKey: 'COUNT_POINT' },
immediate: true,
- resultField: 'data.COUNT_POINT',
+ // resultField: 'data.COUNT_POINT',
labelField: 'cnValue',
valueField: 'cnValue',
},
@@ -118,6 +128,7 @@ export const treeConfig = (orgId) => {
title: '能耗分组',
},
params: { orgId },
+ showLine: { showLeafIcon: false },
api: group.queryDeviceGroupTree,
// api: () => {
// return new Promise((resolve) => {
@@ -127,7 +138,7 @@ export const treeConfig = (orgId) => {
// });
// },
transform: (data) => {
- return [{ title: '全部', key: 'all', selectable: false, children: data }];
+ return [{ pointName: '全部', id: 'all', selectable: false, children: data }];
},
formConfig: {
schemas: [
diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/index.vue b/hx-ai-intelligent/src/view/equipmentManage/group/index.vue
index 997394e..17b464c 100644
--- a/hx-ai-intelligent/src/view/equipmentManage/group/index.vue
+++ b/hx-ai-intelligent/src/view/equipmentManage/group/index.vue
@@ -10,20 +10,25 @@
-
+
-
{{ data.title }}
+
+
+ {{ data.pointName }}
+
-
- {{ item.title }}
-
+
+
+
+ {{ item.title }}
+
+
@@ -45,6 +50,7 @@
import { NsMessage, NsModal } from '/nerv-lib/component';
import NsModalFrom from '/@/components/ns-modal-form.vue';
import { group } from '/@/api/deviceManage';
+ import { http } from '/nerv-lib/util/http';
type opType = 'up' | 'down';
const { getParams } = useParams();
@@ -52,6 +58,7 @@
const editDrawerRef = ref();
const editGroupRef = ref();
const editFormulaRef = ref();
+ const treeRef = ref();
const defaultType = ref(true);
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
const config = tableConfig(editDrawerRef, editGroupRef, editFormulaRef);
@@ -65,6 +72,9 @@
extraModalConfig: {
bodyStyle: { paddingBottom: 0 },
},
+ success: () => {
+ treeRef.value?.treeReload();
+ },
});
nextTick(() => {
console.log(modalFormRef.value, 'modal');
@@ -74,30 +84,35 @@
console.log(data);
nsModalFormConfig.value.title = '新增';
nsModalFormConfig.value.data = {
- pointName: '新增',
isCreate: true,
- isCreatSon: false,
orgId: result,
};
+ if (data.id !== 'all') {
+ nsModalFormConfig.value.data.pid = data.id;
+ nsModalFormConfig.value.data.isCreatSon = true;
+ }
modalFormRef.value?.toggle();
};
const editNode = (data) => {
console.log(data);
nsModalFormConfig.value.title = '编辑';
- nsModalFormConfig.value.data = { pointName: 123 };
+ nsModalFormConfig.value.data = data;
modalFormRef.value?.toggle();
-
- data.value = { pointName: 'qwe' };
};
const moveNode = (data, type: opType) => {
console.log(data);
};
- const deleteNode = (a) => {
+ const deleteNode = (record) => {
NsModal.confirm({
+ centered: true,
+ title: '提示',
content: '确定删除吗?',
onOk: () => {
- console.log(a);
+ http.post(group.del, { id: record.id }).then(() => {
+ treeRef.value?.treeReload();
+ NsMessage.success('删除成功');
+ });
},
});
};
diff --git a/hx-ai-intelligent/src/view/organizationManage/usermanage/index.vue b/hx-ai-intelligent/src/view/organizationManage/usermanage/index.vue
index e93785d..e8d257a 100644
--- a/hx-ai-intelligent/src/view/organizationManage/usermanage/index.vue
+++ b/hx-ai-intelligent/src/view/organizationManage/usermanage/index.vue
@@ -26,6 +26,7 @@
{
addformvisible.value = true;
},
@@ -644,6 +646,9 @@
:deep(.ns-table-main) {
border-top: 0;
padding: 0;
+ .drawerTable {
+ margin-top: 16px;
+ }
}
}
diff --git a/lib/component/tree/tree-api.vue b/lib/component/tree/tree-api.vue
index 4226722..8866687 100644
--- a/lib/component/tree/tree-api.vue
+++ b/lib/component/tree/tree-api.vue
@@ -105,6 +105,11 @@
};
getData();
+ const treeReload = (params) => {
+ getData(params);
+ };
+
+ defineExpose({ treeReload });