wujingjing
2024-07-08 ae78b3b194d399e3ba7bd3922f9f83ca0d7c762c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<template>
    <LogicManageContainerV2
        type="select-list"
        :defaultSelectID="defaultSelectID"
        :selectFolderIcon="(_, data) => data.LogicType !== LOGIC_SITE_CODE"
        :select="{
            label: '泵站',
            requestApi: GetLogicTreeListByPolicyIDStd,
            code: LOGIC_SITE_CODE,
            treeProps,
        }"
        :list="{
            label: '测点组',
            requestApi: GetAllPointGroup,
            isFlatTree: true,
        }"
        :defaultExpandAll="true"
        :folderIcon="() => false"
        :contentRef="contentRef"
        :req="request"
        :expandOnClickNode="false"
        @listClick="listClick"
        @selectChange="selectChange"
    >
        <template #main="{ listNode, selectNode }">
            <slot name="main" :listNode="listNode" :selectNode="selectNode" :selectTreeProps="treeProps"> </slot>
        </template>
    </LogicManageContainerV2>
</template>
 
<script setup lang="ts">
import LogicManageContainerV2 from '/@/projectCom/components/manage/LogicManageContainerV2.vue';
import { GetLogicTreeListByPolicyIDStd } from '/@/api/phm/logicTreeStd';
import request from '/@/utils/request';
import { GetAllPointGroup } from '/@/api/point/monitor/monitor_point';
 
import { LOGIC_SITE_CODE } from '/@/constants';
import { nextTick, ref } from 'vue';
const props = defineProps({
    contentRef: {
        type: Object,
    },
});
const emits = defineEmits<{
    (event: 'selectChange', data): void;
    (event: 'listClick', data): void;
}>();
const defaultSelectID = ref(window.moduleConfig.comprehensive.logicSite.defaultSelectID);
 
const selectChange = (data) => {
    window.moduleConfig.comprehensive.logicSite.defaultSelectID = data[treeProps.id];
    defaultSelectID.value = data[treeProps.id];
    emits('selectChange', data);
};
 
const listClick = (data) => {
    nextTick(() => {
        props.contentRef?.getTableData?.(true);
    });
    emits('listClick', data);
};
const treeProps = {
    id: 'LogicID',
    label: 'Name',
    children: 'Children',
};
</script>
<style scoped lang="scss"></style>