diff --git a/hx-ai-intelligent/src/api/ventilatingSystem.ts b/hx-ai-intelligent/src/api/ventilatingSystem.ts
index 153c0fb..1fee033 100644
--- a/hx-ai-intelligent/src/api/ventilatingSystem.ts
+++ b/hx-ai-intelligent/src/api/ventilatingSystem.ts
@@ -3,7 +3,7 @@ const prefix = '/carbon-smart/api';
// 通风系统相关接口
export enum ventilating {
//传感器获取数据
- getSensorData = prefix + '/multiFuncSensorCtrl/getDeviceState',
+ getSensorData = prefix + '/sensorCtrl/getMultiFuncSensorState',
// 排风扇相关 =============================================
// 获得排风扇系统的树形结构
getTree1 = prefix + '/ventilatingFanCtrl/getCtrlPanelTree',
diff --git a/hx-ai-intelligent/src/view/equipmentControl/planToAdd/index.vue b/hx-ai-intelligent/src/view/equipmentControl/planToAdd/index.vue
index df8920a..d26233a 100644
--- a/hx-ai-intelligent/src/view/equipmentControl/planToAdd/index.vue
+++ b/hx-ai-intelligent/src/view/equipmentControl/planToAdd/index.vue
@@ -107,6 +107,8 @@
children: 'childList',
},
formConfig: {
+ callList: true, // 刷新列表
+ defaultSelection: true, //树默认选择第一个
schemas: [
{
field: 'ctrlType',
@@ -220,9 +222,9 @@
rowKey: 'uuid',
};
//刷新列表
- setTimeout(() => {
- mainRef.value?.nsTableRef.reload();
- }, 1);
+ // setTimeout(() => {
+ // mainRef.value?.nsTableRef.reload();
+ // }, 1);
};
//创建页面调用方法
diff --git a/lib/component/table/table.vue b/lib/component/table/table.vue
index a9cc262..569c5a3 100644
--- a/lib/component/table/table.vue
+++ b/lib/component/table/table.vue
@@ -17,7 +17,7 @@
-
+
@@ -204,7 +204,7 @@
import { useTableSession } from '/nerv-lib/component/table/use-table-session';
import { useTableColumn } from '/nerv-lib/component/table/use-table-column';
import { useNavigate } from '/nerv-lib/use/use-navigate';
-import { object } from 'vue-types';
+ import { object } from 'vue-types';
export default defineComponent({
name: 'NsTable',
components: {
@@ -357,7 +357,6 @@ import { object } from 'vue-types';
}
const tableChangeEvent = (pagination: Props, filters: [], sorter: any) => {
-
if (sorter?.field) {
if (sorter.order) {
orderRef.value = {
@@ -482,12 +481,11 @@ import { object } from 'vue-types';
};
} else {
//判断是否是系统菜单页面过来,是的话修改分页总数dyfadd
- if(props.tableTitle=='系统菜单'){
+ if (props.tableTitle == '系统菜单') {
pageParams = {};
// [props.paramsPageField]: defaultPageRef.value, // 后端0 开始
// [props.paramsPageSizeField]:999,
-
- }else{
+ } else {
pageParams = {
[props.paramsPageField]: defaultPageRef.value, // 后端0 开始
[props.paramsPageSizeField]:
diff --git a/lib/component/tree/tree-api.vue b/lib/component/tree/tree-api.vue
index 7faf1ee..b9f86b7 100644
--- a/lib/component/tree/tree-api.vue
+++ b/lib/component/tree/tree-api.vue
@@ -35,7 +35,7 @@
defineOptions({
name: 'NsTreeApi',
});
- const emit = defineEmits(['update:treeData', 'select']);
+ const emit = defineEmits(['update:treeData', 'select', 'reload']);
// const model = defineModel('treeData');
const formElRef = ref();
@@ -73,6 +73,15 @@
const formFinish = debounce((data: object) => {
// selectedKeys.value = [];
getData(data);
+ // formConfig.value.schemas.forEach((item: any) => {
+ // if (item.callList) {
+ // emit('reload');
+ // }
+ // });
+ //只刷新列表
+ if (formConfig.value.callList && !formConfig.value.defaultSelection) {
+ emit('reload');
+ }
}, 200);
const handleSelect = (keys: any, selectedRows: any) => {
@@ -109,6 +118,20 @@
})
.then((res) => {
treeData.value = transform(get(res, resultField));
+ //默认选择第一个 并刷新列表
+ selectedKeys.value = [];
+ if (formConfig.value.callList && formConfig.value.defaultSelection) {
+ handleSelect([treeData.value[0].id], {
+ selected: true,
+ event: 'select',
+ selectedNodes: treeData.value,
+ node: {
+ ...treeData.value[0],
+ dataRef: { ...treeData.value[0] },
+ },
+ });
+ // 默认选择第一个
+ }
emit('update:treeData', treeData.value);
// model.value = treeData.value;
})