WholeProcessPlatform/frontend/src/views/system/map/components/LegendStructure/index.vue

1845 lines
44 KiB
Vue
Raw Normal View History

<!-- d:\wordpack\WholeProcessPlatform\frontend\src\views\system\map\components\LegendStructure\index.vue -->
<template>
<div class="content">
<LegendStructureSearch
ref="legendStructureSearch"
:handle-add="handleAdd"
@reset="handleReset"
@search-finish="onSearchFinish"
/>
<BasicTable
:columns="columns"
:data="dataSource"
:list-url="fetchLegendStructureData"
:search-params="searchParams"
>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<a-space>
<a-button type="link" size="small" @click="handleEdit(record)">编辑</a-button>
<a-button type="link" size="small" danger @click="handleDelete(record)"
>删除</a-button
>
</a-space>
</template>
<template v-if="column.key === 'enable'">
<a-switch
:checked="record.enable === 1"
@change="(checked: boolean) => handleEnableChange(record, checked)"
/>
</template>
<template v-if="column.key === 'internal'">
<a-switch
:checked="record.internal === 1"
@change="(checked: boolean) => handleInternalChange(record, checked)"
/>
</template>
<template v-if="column.key === 'ifShow'">
<a-switch
:checked="record.ifShow === 1"
@change="(checked: boolean) => handleIfShowChange(record, checked)"
/>
</template>
</template>
</BasicTable>
<LegendStructureForm
ref="legendStructureForm"
v-model:visible="editModalVisible"
:initial-values="currentRecord"
@cancel="editModalCancel"
@ok="handleEditSubmit"
/>
</div>
</template>
<script setup lang="ts">
import { ref } from "vue";
import BasicTable from "@/components/BasicTable/index.vue";
import LegendStructureSearch from "./LegendStructureSearch.vue";
import LegendStructureForm from "./LegendStructureForm.vue";
import { message } from "ant-design-vue";
// 表格列配置
const columns = [
{
title: "序号",
key: "index",
width: 80,
customRender: ({ record, index }: any) => {
// 对于树形结构,计算当前记录在其父节点的 children 中的位置
// 如果没有 parentId说明是根节点需要计算在所有根节点中的序号
if (!record.parentId) {
// 根节点:计算在 dataSource 中是第几个根节点
let rootIndex = 0;
for (let i = 0; i < dataSource.value.length; i++) {
const item = dataSource.value[i];
// 只统计根节点(没有 parentId 的节点)
if (!item.parentId) {
rootIndex++;
// 找到当前记录,返回其序号
if (
item.id === record.id ||
(item.key === record.key && item.id === record.id)
) {
return rootIndex;
}
}
}
return rootIndex;
} else {
// 子节点:在其父节点的 children 中查找索引
const findParentAndIndex = (data: any[], parentId: string): number => {
for (const item of data) {
if (item.key === parentId || item.id === parentId) {
// 找到父节点,在其 children 中查找当前记录的位置
if (item.children && item.children.length > 0) {
const childIndex = item.children.findIndex(
(child: any) => child.key === record.key || child.id === record.id
);
return childIndex + 1;
}
}
// 递归查找更深层的父节点
if (item.children && item.children.length > 0) {
const result = findParentAndIndex(item.children, parentId);
if (result > 0) {
return result;
}
}
}
return 0;
};
return findParentAndIndex(dataSource.value, record.parentId);
}
},
},
{
title: "图例名称",
dataIndex: "name",
key: "name",
width: 150,
},
{
title: "图例编码",
dataIndex: "nameEn",
key: "nameEn",
width: 120,
},
{
title: "是否启用",
dataIndex: "enable",
key: "enable",
width: 80,
},
{
title: "系统内置项",
dataIndex: "internal",
key: "internal",
width: 100,
},
{
title: "是否显示",
dataIndex: "ifShow",
key: "ifShow",
width: 80,
},
{
title: "备注",
dataIndex: "description",
key: "description",
},
{
title: "创建人",
key: "recordUser",
dataIndex: "recordUser",
},
{
title: "创建时间",
key: "recordTime",
dataIndex: "recordTime",
width: 150,
},
{
title: "更新时间",
key: "modifyTime",
dataIndex: "modifyTime",
width: 150,
},
{
title: "操作",
key: "action",
width: 150,
fixed: "right",
},
];
// 搜索参数
const searchParams = ref({});
// 编辑弹窗数据
const currentRecord = ref<any | null>(null);
const editModalVisible = ref(false);
// 数据源
const dataSource = ref([
{
_tls: {},
id: "20aeca4aed5c4afebbffe211baaa6210",
recordUser: "2a84192b-68e0-43e1-9f9c-3d8dd38badbb",
recordTime: "2025-09-26 15:30:28",
modifyTime: "2025-09-26 15:31:27",
displayRecordUser: "2a84192b-68e0-43e1-9f9c-3d8dd38badbb",
childrenList: [],
multiSelect: null,
checked: null,
canBeChecked: null,
psort: null,
departmentId: null,
displayDepartment: null,
groupName: "鱼类调查装置",
parentName: "鱼类调查装置",
parentCode: null,
layerCode: null,
layerCodeName: null,
dataType: 1,
name: "鱼类调查装置",
nameEn: "FPRD",
code: "pointLayer",
codeName: "锚点",
icon: null,
orderIndex: 32,
enable: 1,
systemId: "10EC2E0B-AEA9-4757-83A2-201BA1BC54E9",
treeLevel: 1,
fullPath: "20aeca4aed5c4afebbffe211baaa6210,",
hasChildren: 1,
parentId: null,
minZoom: null,
maxZoom: null,
minHeightThd: null,
maxHeightThd: null,
internal: 0,
ifShow: 1,
isFilter: null,
expression: null,
ext: null,
description: "鱼类调查装置",
color: null,
shape: null,
minVal: null,
maxVal: null,
},
{
_tls: {},
id: "cfc8313399d64f0fb18b3a93113940f1",
recordUser: "061bd3e1-5264-42fa-9d24-87a09c6ce132",
recordTime: "2024-04-26 15:21:29",
modifyTime: "2024-04-26 15:34:35",
displayRecordUser: "061bd3e1-5264-42fa-9d24-87a09c6ce132",
childrenList: [],
multiSelect: null,
checked: null,
canBeChecked: null,
psort: null,
departmentId: null,
displayDepartment: null,
groupName: "自然保护区",
parentName: "自然保护区",
parentCode: null,
layerCode: "lcj_bhq",
layerCodeName: "自然保护区",
dataType: 1,
name: "自然保护区",
nameEn: "nature_reserve",
code: "colorLayer",
codeName: "色块图例",
icon: null,
orderIndex: 31,
enable: 1,
systemId: "10EC2E0B-AEA9-4757-83A2-201BA1BC54E9",
treeLevel: 1,
fullPath: "cfc8313399d64f0fb18b3a93113940f1,",
hasChildren: 1,
parentId: null,
minZoom: null,
maxZoom: null,
minHeightThd: null,
maxHeightThd: null,
internal: 0,
ifShow: 1,
isFilter: null,
expression: null,
ext: null,
description: null,
color: null,
shape: null,
minVal: null,
maxVal: null,
},
{
_tls: {},
id: "661ae7751517476d8bbae562861b81eb",
recordUser: "061bd3e1-5264-42fa-9d24-87a09c6ce132",
recordTime: "2024-02-23 10:51:44",
modifyTime: null,
displayRecordUser: "061bd3e1-5264-42fa-9d24-87a09c6ce132",
childrenList: [],
multiSelect: null,
checked: null,
canBeChecked: null,
psort: null,
departmentId: null,
displayDepartment: null,
groupName: "其他设施-在建",
parentName: "其他设施-在建",
parentCode: null,
layerCode: null,
layerCodeName: null,
dataType: 1,
name: "其他设施-在建",
nameEn: "EQST_BUILT",
code: "pointLayer",
codeName: "锚点",
icon: null,
orderIndex: 27,
enable: 1,
systemId: null,
treeLevel: 1,
fullPath: "661ae7751517476d8bbae562861b81eb,",
hasChildren: 1,
parentId: null,
minZoom: null,
maxZoom: null,
minHeightThd: null,
maxHeightThd: null,
internal: 0,
ifShow: null,
isFilter: null,
expression: null,
ext: null,
description: null,
color: null,
shape: null,
minVal: null,
maxVal: null,
},
{
_tls: {},
id: "607cf6bbd5e749b98b58f7b1188cdfb0",
recordUser: "20210408-1122-2456-4a46-281b742d0372",
recordTime: "2024-03-11 10:53:52",
modifyTime: "2025-07-08 20:26:02",
displayRecordUser: "20210408-1122-2456-4a46-281b742d0372",
childrenList: [],
multiSelect: null,
checked: null,
canBeChecked: null,
psort: null,
departmentId: null,
displayDepartment: null,
groupName: "野生动物监测",
parentName: "野生动物监测",
parentCode: null,
layerCode: null,
layerCodeName: null,
dataType: 1,
name: "野生动物监测",
nameEn: "WA_LEGEND",
code: "pointLayer",
codeName: "锚点",
icon: null,
orderIndex: 26,
enable: 1,
systemId: "10EC2E0B-AEA9-4757-83A2-201BA1BC54E9",
treeLevel: 1,
fullPath: "607cf6bbd5e749b98b58f7b1188cdfb0,",
hasChildren: 1,
parentId: null,
minZoom: null,
maxZoom: null,
minHeightThd: null,
maxHeightThd: null,
internal: 0,
ifShow: 1,
isFilter: null,
expression: null,
ext: null,
description: "野生动物监测",
color: null,
shape: null,
minVal: null,
maxVal: null,
},
{
_tls: {},
id: "42b6bdfb27e04a2689ece4309a8a21e0",
recordUser: "061bd3e1-5264-42fa-9d24-87a09c6ce132",
recordTime: "2024-02-23 10:51:33",
modifyTime: "2024-03-27 16:05:35",
displayRecordUser: "061bd3e1-5264-42fa-9d24-87a09c6ce132",
childrenList: [],
multiSelect: null,
checked: null,
canBeChecked: null,
psort: null,
departmentId: null,
displayDepartment: null,
groupName: "生态流量泄放设施-在建",
parentName: "生态流量泄放设施-在建",
parentCode: null,
layerCode: null,
layerCodeName: null,
dataType: 1,
name: "生态流量泄放设施-在建",
nameEn: "OTHERST_BUILT",
code: "pointLayer",
codeName: "锚点",
icon: null,
orderIndex: 26,
enable: 1,
systemId: null,
treeLevel: 1,
fullPath: "42b6bdfb27e04a2689ece4309a8a21e0,",
hasChildren: 1,
parentId: null,
minZoom: null,
maxZoom: null,
minHeightThd: null,
maxHeightThd: null,
internal: 0,
ifShow: null,
isFilter: null,
expression: null,
ext: null,
description: null,
color: null,
shape: null,
minVal: null,
maxVal: null,
},
{
_tls: {},
id: "e53e2a300031446ca168244fb30cc818",
recordUser: "061bd3e1-5264-42fa-9d24-87a09c6ce132",
recordTime: "2024-02-23 10:50:57",
modifyTime: null,
displayRecordUser: "061bd3e1-5264-42fa-9d24-87a09c6ce132",
childrenList: [],
multiSelect: null,
checked: null,
canBeChecked: null,
psort: null,
departmentId: null,
displayDepartment: null,
groupName: "过鱼设施-在建",
parentName: "过鱼设施-在建",
parentCode: null,
layerCode: null,
layerCodeName: null,
dataType: 1,
name: "过鱼设施-在建",
nameEn: "FPST_BUILT",
code: "pointLayer",
codeName: "锚点",
icon: null,
orderIndex: 25,
enable: 1,
systemId: null,
treeLevel: 1,
fullPath: "e53e2a300031446ca168244fb30cc818,",
hasChildren: 1,
parentId: null,
minZoom: null,
maxZoom: null,
minHeightThd: null,
maxHeightThd: null,
internal: 0,
ifShow: null,
isFilter: null,
expression: null,
ext: null,
description: null,
color: null,
shape: null,
minVal: null,
maxVal: null,
},
{
_tls: {},
id: "370b8520cb07453c81dd34c16055d095",
recordUser: "bc2ad787-72ba-4174-92ea-7e1601a1b512",
recordTime: "2023-08-10 06:02:43",
modifyTime: "2023-08-10 09:37:46",
displayRecordUser: "bc2ad787-72ba-4174-92ea-7e1601a1b512",
childrenList: [],
multiSelect: null,
checked: null,
canBeChecked: null,
psort: null,
departmentId: null,
displayDepartment: null,
groupName: "测试大型电站锚点图例",
parentName: "测试大型电站锚点图例",
parentCode: null,
layerCode: null,
layerCodeName: null,
dataType: 1,
name: "测试大型电站锚点图例",
nameEn: "ceshidxdztl",
code: "pointLayer",
codeName: "锚点",
icon: null,
orderIndex: 24,
enable: 1,
systemId: "10EC2E0B-AEA9-4757-83A2-201BA1BC54E9",
treeLevel: 1,
fullPath: "370b8520cb07453c81dd34c16055d095,",
hasChildren: 1,
parentId: null,
minZoom: null,
maxZoom: null,
minHeightThd: null,
maxHeightThd: null,
internal: 1,
ifShow: 0,
isFilter: null,
expression: null,
ext: null,
description: "测试电站锚点图例",
color: null,
shape: null,
minVal: null,
maxVal: null,
},
{
_tls: {},
id: "341bd34e3be14d1d99344b0a8c0a639c",
recordUser: "253d9bdf-0547-4f0d-88db-b7e8768e7c85",
recordTime: "2023-08-09 20:14:49",
modifyTime: "2024-01-10 17:36:44",
displayRecordUser: "253d9bdf-0547-4f0d-88db-b7e8768e7c85",
childrenList: [],
multiSelect: null,
checked: null,
canBeChecked: null,
psort: null,
departmentId: null,
displayDepartment: null,
groupName: "水生生态调查断面-A",
parentName: "水生生态调查断面-A",
parentCode: null,
layerCode: null,
layerCodeName: null,
dataType: 1,
name: "水生生态调查断面-A",
nameEn: "WEST-A",
code: "pointLayer",
codeName: "锚点",
icon: null,
orderIndex: 23,
enable: 0,
systemId: "10EC2E0B-AEA9-4757-83A2-201BA1BC54E9",
treeLevel: 1,
fullPath: "341bd34e3be14d1d99344b0a8c0a639c,",
hasChildren: 1,
parentId: null,
minZoom: null,
maxZoom: null,
minHeightThd: null,
maxHeightThd: null,
internal: 0,
ifShow: 0,
isFilter: null,
expression: null,
ext: null,
description: "WEST-A",
color: null,
shape: null,
minVal: null,
maxVal: null,
},
{
_tls: {},
id: "ABA198A1FEC445DD8BADEFB94D36A64C",
recordUser: "20210802-1454-3403-3753-a22ed7009522",
recordTime: "2023-08-04 09:37:42",
modifyTime: "2023-08-09 19:40:50",
displayRecordUser: "20210802-1454-3403-3753-a22ed7009522",
childrenList: [],
multiSelect: null,
checked: null,
canBeChecked: null,
psort: null,
departmentId: null,
displayDepartment: null,
groupName: "鱼类分布",
parentName: "鱼类分布",
parentCode: null,
layerCode: null,
layerCodeName: null,
dataType: 1,
name: "鱼类分布",
nameEn: "YLFB",
code: "pointLayer",
codeName: "锚点",
icon: null,
orderIndex: 22,
enable: 1,
systemId: null,
treeLevel: 1,
fullPath: "ABA198A1FEC445DD8BADEFB94D36A64C,",
hasChildren: 1,
parentId: null,
minZoom: null,
maxZoom: null,
minHeightThd: null,
maxHeightThd: null,
internal: 0,
ifShow: null,
isFilter: null,
expression: null,
ext: null,
description: null,
color: null,
shape: null,
minVal: null,
maxVal: null,
},
{
_tls: {},
id: "00FC1931E8DA4B898FF34517E55531BE",
recordUser: "20210802-1454-3403-3753-a22ed7009522",
recordTime: "2023-08-04 09:37:42",
modifyTime: null,
displayRecordUser: "20210802-1454-3403-3753-a22ed7009522",
childrenList: [],
multiSelect: null,
checked: null,
canBeChecked: null,
psort: null,
departmentId: null,
displayDepartment: null,
groupName: "水质站",
parentName: "水质站",
parentCode: null,
layerCode: null,
layerCodeName: null,
dataType: 1,
name: "水质站",
nameEn: "WQST",
code: "pointLayer",
codeName: "锚点",
icon: null,
orderIndex: 21,
enable: 1,
systemId: null,
treeLevel: 1,
fullPath: "00FC1931E8DA4B898FF34517E55531BE,",
hasChildren: 1,
parentId: null,
minZoom: null,
maxZoom: null,
minHeightThd: null,
maxHeightThd: null,
internal: 0,
ifShow: null,
isFilter: null,
expression: null,
ext: null,
description: null,
color: null,
shape: null,
minVal: null,
maxVal: null,
},
{
_tls: {},
id: "465688A775D34B8B8DED6E1FD3E4BCE4",
recordUser: "20210802-1454-3403-3753-a22ed7009522",
recordTime: "2023-08-04 09:37:42",
modifyTime: "2025-07-07 19:39:53",
displayRecordUser: "20210802-1454-3403-3753-a22ed7009522",
childrenList: [],
multiSelect: null,
checked: null,
canBeChecked: null,
psort: null,
departmentId: null,
displayDepartment: null,
groupName: "水温站",
parentName: "水温站",
parentCode: null,
layerCode: null,
layerCodeName: null,
dataType: 1,
name: "水温站",
nameEn: "WTST",
code: "pointLayer",
codeName: "锚点",
icon: null,
orderIndex: 20,
enable: 1,
systemId: null,
treeLevel: 1,
fullPath: "465688A775D34B8B8DED6E1FD3E4BCE4,",
hasChildren: 1,
parentId: null,
minZoom: null,
maxZoom: null,
minHeightThd: null,
maxHeightThd: null,
internal: 0,
ifShow: null,
isFilter: null,
expression: null,
ext: null,
description: null,
color: null,
shape: null,
minVal: null,
maxVal: null,
},
{
_tls: {},
id: "53F8CC31A0DA4CAFBD9A8927C680068B",
recordUser: "20210802-1454-3403-3753-a22ed7009522",
recordTime: "2023-08-04 09:37:42",
modifyTime: "2024-01-10 17:33:24",
displayRecordUser: "20210802-1454-3403-3753-a22ed7009522",
childrenList: [],
multiSelect: null,
checked: null,
canBeChecked: null,
psort: null,
departmentId: null,
displayDepartment: null,
groupName: "水生生态调查断面",
parentName: "水生生态调查断面",
parentCode: null,
layerCode: null,
layerCodeName: null,
dataType: 1,
name: "水生生态调查断面",
nameEn: "WEST",
code: "pointLayer",
codeName: "锚点",
icon: null,
orderIndex: 19,
enable: 1,
systemId: null,
treeLevel: 1,
fullPath: "53F8CC31A0DA4CAFBD9A8927C680068B,",
hasChildren: 1,
parentId: null,
minZoom: null,
maxZoom: null,
minHeightThd: null,
maxHeightThd: null,
internal: 0,
ifShow: 1,
isFilter: null,
expression: null,
ext: null,
description: null,
color: null,
shape: null,
minVal: null,
maxVal: null,
},
{
_tls: {},
id: "F0655D28BCFF4CCE9A8813AF63087BD5",
recordUser: "20210802-1454-3403-3753-a22ed7009522",
recordTime: "2023-08-04 09:37:42",
modifyTime: null,
displayRecordUser: "20210802-1454-3403-3753-a22ed7009522",
childrenList: [],
multiSelect: null,
checked: null,
canBeChecked: null,
psort: null,
departmentId: null,
displayDepartment: null,
groupName: "水电站生态流量达标率",
parentName: "水电站生态流量达标率",
parentCode: null,
layerCode: null,
layerCodeName: null,
dataType: 1,
name: "水电站生态流量达标率",
nameEn: "ENGEQ",
code: "pointLayer",
codeName: "锚点",
icon: null,
orderIndex: 16,
enable: 1,
systemId: null,
treeLevel: 1,
fullPath: "F0655D28BCFF4CCE9A8813AF63087BD5,",
hasChildren: 1,
parentId: null,
minZoom: null,
maxZoom: null,
minHeightThd: null,
maxHeightThd: null,
internal: 0,
ifShow: null,
isFilter: null,
expression: null,
ext: null,
description: null,
color: null,
shape: null,
minVal: null,
maxVal: null,
children: [
{
_tls: {},
id: "CE4E636860724C21A242598A4F73E341",
recordUser: "20210802-1454-3403-3753-a22ed7009522",
recordTime: "2023-08-04 09:37:42",
modifyTime: null,
displayRecordUser: "20210802-1454-3403-3753-a22ed7009522",
childrenList: [],
multiSelect: null,
checked: null,
canBeChecked: null,
psort: null,
departmentId: null,
displayDepartment: null,
groupName: "中型",
parentName: "水电站生态流量达标率",
parentCode: "ENGEQ",
layerCode: null,
layerCodeName: null,
dataType: 1,
name: "中型",
nameEn: "ZXENGEQ",
code: "pointLayer",
codeName: "锚点",
icon: null,
orderIndex: 18,
enable: 1,
systemId: null,
treeLevel: 1,
fullPath: "F0655D28BCFF4CCE9A8813AF63087BD5,CE4E636860724C21A242598A4F73E341,",
hasChildren: 1,
parentId: "F0655D28BCFF4CCE9A8813AF63087BD5",
minZoom: null,
maxZoom: null,
minHeightThd: null,
maxHeightThd: null,
internal: 0,
ifShow: null,
isFilter: null,
expression: null,
ext: null,
description: null,
color: null,
shape: null,
minVal: null,
maxVal: null,
},
{
_tls: {},
id: "22C29DA983114B958A0470A156B38665",
recordUser: "20210802-1454-3403-3753-a22ed7009522",
recordTime: "2023-08-04 09:37:42",
modifyTime: null,
displayRecordUser: "20210802-1454-3403-3753-a22ed7009522",
childrenList: [],
multiSelect: null,
checked: null,
canBeChecked: null,
psort: null,
departmentId: null,
displayDepartment: null,
groupName: "大型",
parentName: "水电站生态流量达标率",
parentCode: "ENGEQ",
layerCode: null,
layerCodeName: null,
dataType: 1,
name: "大型",
nameEn: "DXENGEQ",
code: "pointLayer",
codeName: "锚点",
icon: null,
orderIndex: 17,
enable: 1,
systemId: null,
treeLevel: 1,
fullPath: "F0655D28BCFF4CCE9A8813AF63087BD5,22C29DA983114B958A0470A156B38665,",
hasChildren: 1,
parentId: "F0655D28BCFF4CCE9A8813AF63087BD5",
minZoom: null,
maxZoom: null,
minHeightThd: null,
maxHeightThd: null,
internal: 0,
ifShow: null,
isFilter: null,
expression: null,
ext: null,
description: null,
color: null,
shape: null,
minVal: null,
maxVal: null,
},
],
},
{
_tls: {},
id: "2A28BB58AEF04D4E956E60EC1406E45B",
recordUser: "20210802-1454-3403-3753-a22ed7009522",
recordTime: "2023-08-04 09:37:42",
modifyTime: null,
displayRecordUser: "20210802-1454-3403-3753-a22ed7009522",
childrenList: [],
multiSelect: null,
checked: null,
canBeChecked: null,
psort: null,
departmentId: null,
displayDepartment: null,
groupName: "水电站告警情况",
parentName: "水电站告警情况",
parentCode: null,
layerCode: null,
layerCodeName: null,
dataType: 1,
name: "水电站告警情况",
nameEn: "ENGWARN",
code: "pointLayer",
codeName: "锚点",
icon: null,
orderIndex: 15,
enable: 1,
systemId: null,
treeLevel: 1,
fullPath: "2A28BB58AEF04D4E956E60EC1406E45B,",
hasChildren: 1,
parentId: null,
minZoom: null,
maxZoom: null,
minHeightThd: null,
maxHeightThd: null,
internal: 0,
ifShow: null,
isFilter: null,
expression: null,
ext: null,
description: null,
color: null,
shape: null,
minVal: null,
maxVal: null,
},
{
_tls: {},
id: "1E99B84F935C452F9577D47C60B8E73C",
recordUser: "20210802-1454-3403-3753-a22ed7009522",
recordTime: "2023-08-04 09:37:42",
modifyTime: null,
displayRecordUser: "20210802-1454-3403-3753-a22ed7009522",
childrenList: [],
multiSelect: null,
checked: null,
canBeChecked: null,
psort: null,
departmentId: null,
displayDepartment: null,
groupName: "水电站放流情况",
parentName: "水电站放流情况",
parentCode: null,
layerCode: null,
layerCodeName: null,
dataType: 1,
name: "水电站放流情况",
nameEn: "ENGFL",
code: "pointLayer",
codeName: "锚点",
icon: null,
orderIndex: 14,
enable: 1,
systemId: null,
treeLevel: 1,
fullPath: "1E99B84F935C452F9577D47C60B8E73C,",
hasChildren: 1,
parentId: null,
minZoom: null,
maxZoom: null,
minHeightThd: null,
maxHeightThd: null,
internal: 0,
ifShow: null,
isFilter: null,
expression: null,
ext: null,
description: null,
color: null,
shape: null,
minVal: null,
maxVal: null,
},
{
_tls: {},
id: "0B94FB1F7CB844B2A01BA197E2B44649",
recordUser: "20210802-1454-3403-3753-a22ed7009522",
recordTime: "2023-08-04 09:37:42",
modifyTime: null,
displayRecordUser: "20210802-1454-3403-3753-a22ed7009522",
childrenList: [],
multiSelect: null,
checked: null,
canBeChecked: null,
psort: null,
departmentId: null,
displayDepartment: null,
groupName: "实际水质",
parentName: "实际水质",
parentCode: null,
layerCode: null,
layerCodeName: null,
dataType: 1,
name: "实际水质",
nameEn: "RWQST",
code: "pointLayer",
codeName: "锚点",
icon: null,
orderIndex: 13,
enable: 1,
systemId: null,
treeLevel: 1,
fullPath: "0B94FB1F7CB844B2A01BA197E2B44649,",
hasChildren: 1,
parentId: null,
minZoom: null,
maxZoom: null,
minHeightThd: null,
maxHeightThd: null,
internal: 0,
ifShow: null,
isFilter: null,
expression: null,
ext: null,
description: null,
color: null,
shape: null,
minVal: null,
maxVal: null,
},
{
_tls: {},
id: "C3CF7A3673F94EC5A96F3D271C244834",
recordUser: "20210802-1454-3403-3753-a22ed7009522",
recordTime: "2023-08-04 09:37:42",
modifyTime: "2024-05-30 09:47:53",
displayRecordUser: "20210802-1454-3403-3753-a22ed7009522",
childrenList: [],
multiSelect: null,
checked: null,
canBeChecked: null,
psort: null,
departmentId: null,
displayDepartment: null,
groupName: "生态流量泄放设施",
parentName: "生态流量泄放设施",
parentCode: null,
layerCode: null,
layerCodeName: null,
dataType: 1,
name: "生态流量泄放设施",
nameEn: "EQST",
code: "pointLayer",
codeName: "锚点",
icon: null,
orderIndex: 12,
enable: 1,
systemId: null,
treeLevel: 1,
fullPath: "C3CF7A3673F94EC5A96F3D271C244834,",
hasChildren: 1,
parentId: null,
minZoom: null,
maxZoom: null,
minHeightThd: null,
maxHeightThd: null,
internal: 0,
ifShow: null,
isFilter: null,
expression: null,
ext: null,
description: null,
color: null,
shape: null,
minVal: null,
maxVal: null,
},
{
_tls: {},
id: "8EA437F6C36E4C55A4B69B15211DD631",
recordUser: "20210802-1454-3403-3753-a22ed7009522",
recordTime: "2023-08-04 09:37:42",
modifyTime: null,
displayRecordUser: "20210802-1454-3403-3753-a22ed7009522",
childrenList: [],
multiSelect: null,
checked: null,
canBeChecked: null,
psort: null,
departmentId: null,
displayDepartment: null,
groupName: "其他设施",
parentName: "其他设施",
parentCode: null,
layerCode: null,
layerCodeName: null,
dataType: 1,
name: "其他设施",
nameEn: "OTHERST",
code: "pointLayer",
codeName: "锚点",
icon: null,
orderIndex: 11,
enable: 1,
systemId: null,
treeLevel: 1,
fullPath: "8EA437F6C36E4C55A4B69B15211DD631,",
hasChildren: 1,
parentId: null,
minZoom: null,
maxZoom: null,
minHeightThd: null,
maxHeightThd: null,
internal: 0,
ifShow: null,
isFilter: null,
expression: null,
ext: null,
description: null,
color: null,
shape: null,
minVal: null,
maxVal: null,
},
{
_tls: {},
id: "2F42583B5AF543FF9F72008AADD6584F",
recordUser: "20210802-1454-3403-3753-a22ed7009522",
recordTime: "2023-08-04 09:37:42",
modifyTime: null,
displayRecordUser: "20210802-1454-3403-3753-a22ed7009522",
childrenList: [],
multiSelect: null,
checked: null,
canBeChecked: null,
psort: null,
departmentId: null,
displayDepartment: null,
groupName: "栖息地范围",
parentName: "栖息地范围",
parentCode: null,
layerCode: null,
layerCodeName: null,
dataType: 1,
name: "栖息地范围",
nameEn: "FHRD",
code: "baseLayer",
codeName: "地图GIS",
icon: null,
orderIndex: 10,
enable: 1,
systemId: null,
treeLevel: 1,
fullPath: "2F42583B5AF543FF9F72008AADD6584F,",
hasChildren: 1,
parentId: null,
minZoom: null,
maxZoom: null,
minHeightThd: null,
maxHeightThd: null,
internal: 0,
ifShow: null,
isFilter: null,
expression: null,
ext: null,
description: null,
color: null,
shape: null,
minVal: null,
maxVal: null,
},
{
_tls: {},
id: "13357665B04A42E2A504BAC3E113752B",
recordUser: "20210802-1454-3403-3753-a22ed7009522",
recordTime: "2023-08-04 09:37:42",
modifyTime: null,
displayRecordUser: "20210802-1454-3403-3753-a22ed7009522",
childrenList: [],
multiSelect: null,
checked: null,
canBeChecked: null,
psort: null,
departmentId: null,
displayDepartment: null,
groupName: "栖息地",
parentName: "栖息地",
parentCode: null,
layerCode: null,
layerCodeName: null,
dataType: 1,
name: "栖息地",
nameEn: "FHST",
code: "pointLayer",
codeName: "锚点",
icon: null,
orderIndex: 9,
enable: 1,
systemId: null,
treeLevel: 1,
fullPath: "13357665B04A42E2A504BAC3E113752B,",
hasChildren: 1,
parentId: null,
minZoom: null,
maxZoom: null,
minHeightThd: null,
maxHeightThd: null,
internal: 0,
ifShow: null,
isFilter: null,
expression: null,
ext: null,
description: null,
color: null,
shape: null,
minVal: null,
maxVal: null,
},
{
_tls: {},
id: "4DD8CDD17C1A46B4A32B2577BD44A431",
recordUser: "20210802-1454-3403-3753-a22ed7009522",
recordTime: "2023-08-04 09:37:42",
modifyTime: null,
displayRecordUser: "20210802-1454-3403-3753-a22ed7009522",
childrenList: [],
multiSelect: null,
checked: null,
canBeChecked: null,
psort: null,
departmentId: null,
displayDepartment: null,
groupName: "目标水质",
parentName: "目标水质",
parentCode: null,
layerCode: null,
layerCodeName: null,
dataType: 1,
name: "目标水质",
nameEn: "TWQST",
code: "pointLayer",
codeName: "锚点",
icon: null,
orderIndex: 8,
enable: 1,
systemId: null,
treeLevel: 1,
fullPath: "4DD8CDD17C1A46B4A32B2577BD44A431,",
hasChildren: 1,
parentId: null,
minZoom: null,
maxZoom: null,
minHeightThd: null,
maxHeightThd: null,
internal: 0,
ifShow: null,
isFilter: null,
expression: null,
ext: null,
description: null,
color: null,
shape: null,
minVal: null,
maxVal: null,
},
{
_tls: {},
id: "60592CEB61814BA2999DCB832A14EF89",
recordUser: "20210802-1454-3403-3753-a22ed7009522",
recordTime: "2023-08-04 09:37:42",
modifyTime: null,
displayRecordUser: "20210802-1454-3403-3753-a22ed7009522",
childrenList: [],
multiSelect: null,
checked: null,
canBeChecked: null,
psort: null,
departmentId: null,
displayDepartment: null,
groupName: "陆生生态调查断面",
parentName: "陆生生态调查断面",
parentCode: null,
layerCode: null,
layerCodeName: null,
dataType: 1,
name: "陆生生态调查断面",
nameEn: "TEST",
code: "pointLayer",
codeName: "锚点",
icon: null,
orderIndex: 7,
enable: 1,
systemId: null,
treeLevel: 1,
fullPath: "60592CEB61814BA2999DCB832A14EF89,",
hasChildren: 1,
parentId: null,
minZoom: null,
maxZoom: null,
minHeightThd: null,
maxHeightThd: null,
internal: 0,
ifShow: null,
isFilter: null,
expression: null,
ext: null,
description: null,
color: null,
shape: null,
minVal: null,
maxVal: null,
},
{
_tls: {},
id: "84C425E9271E4A90A5D30F6E94090C96",
recordUser: "20210802-1454-3403-3753-a22ed7009522",
recordTime: "2023-08-04 09:37:42",
modifyTime: "2024-04-12 14:12:03",
displayRecordUser: "20210802-1454-3403-3753-a22ed7009522",
childrenList: [],
multiSelect: null,
checked: null,
canBeChecked: null,
psort: null,
departmentId: null,
displayDepartment: null,
groupName: "环保设施",
parentName: "环保设施",
parentCode: null,
layerCode: null,
layerCodeName: null,
dataType: 1,
name: "环保设施",
nameEn: "ENVP",
code: "pointLayer",
codeName: "锚点",
icon: null,
orderIndex: 6,
enable: 1,
systemId: null,
treeLevel: 1,
fullPath: "84C425E9271E4A90A5D30F6E94090C96,",
hasChildren: 1,
parentId: null,
minZoom: null,
maxZoom: null,
minHeightThd: null,
maxHeightThd: null,
internal: 0,
ifShow: 0,
isFilter: null,
expression: null,
ext: null,
description: null,
color: null,
shape: null,
minVal: null,
maxVal: null,
},
{
_tls: {},
id: "A8E84FE0E07A48C8A3F6B9B9DD7E8B51",
recordUser: "20210802-1454-3403-3753-a22ed7009522",
recordTime: "2023-08-04 09:37:42",
modifyTime: "2024-01-15 10:50:18",
displayRecordUser: "20210802-1454-3403-3753-a22ed7009522",
childrenList: [],
multiSelect: null,
checked: null,
canBeChecked: null,
psort: null,
departmentId: null,
displayDepartment: null,
groupName: "低温水减缓设施",
parentName: "低温水减缓设施",
parentCode: null,
layerCode: null,
layerCodeName: null,
dataType: 1,
name: "低温水减缓设施",
nameEn: "DWST",
code: "pointLayer",
codeName: "锚点",
icon: null,
orderIndex: 4,
enable: 1,
systemId: null,
treeLevel: 1,
fullPath: "A8E84FE0E07A48C8A3F6B9B9DD7E8B51,",
hasChildren: 1,
parentId: null,
minZoom: null,
maxZoom: null,
minHeightThd: null,
maxHeightThd: null,
internal: 0,
ifShow: 1,
isFilter: null,
expression: null,
ext: null,
description: null,
color: null,
shape: null,
minVal: null,
maxVal: null,
},
{
_tls: {},
id: "004A71DA6605411C8E85CB3B264A0EAA",
recordUser: "20210802-1454-3403-3753-a22ed7009522",
recordTime: "2023-08-04 09:37:42",
modifyTime: "2024-04-12 14:12:04",
displayRecordUser: "20210802-1454-3403-3753-a22ed7009522",
childrenList: [],
multiSelect: null,
checked: null,
canBeChecked: null,
psort: null,
departmentId: null,
displayDepartment: null,
groupName: "过鱼设施",
parentName: "过鱼设施",
parentCode: null,
layerCode: null,
layerCodeName: null,
dataType: 1,
name: "过鱼设施",
nameEn: "FPST",
code: "pointLayer",
codeName: "锚点",
icon: null,
orderIndex: 4,
enable: 1,
systemId: null,
treeLevel: 1,
fullPath: "004A71DA6605411C8E85CB3B264A0EAA,",
hasChildren: 1,
parentId: null,
minZoom: null,
maxZoom: null,
minHeightThd: null,
maxHeightThd: null,
internal: 0,
ifShow: 0,
isFilter: null,
expression: null,
ext: null,
description: null,
color: null,
shape: null,
minVal: null,
maxVal: null,
},
{
_tls: {},
id: "98664FEDD5E1436A808181B680F2AE85",
recordUser: "20210802-1454-3403-3753-a22ed7009522",
recordTime: "2023-08-04 09:37:41",
modifyTime: "2024-01-10 17:50:53",
displayRecordUser: "20210802-1454-3403-3753-a22ed7009522",
childrenList: [],
multiSelect: null,
checked: null,
canBeChecked: null,
psort: null,
departmentId: null,
displayDepartment: null,
groupName: "测站站点",
parentName: "测站站点",
parentCode: null,
layerCode: null,
layerCodeName: null,
dataType: 1,
name: "测站站点",
nameEn: "ST2",
code: "pointLayer",
codeName: "锚点",
icon: null,
orderIndex: 3,
enable: 1,
systemId: null,
treeLevel: 1,
fullPath: "98664FEDD5E1436A808181B680F2AE85,",
hasChildren: 1,
parentId: null,
minZoom: null,
maxZoom: null,
minHeightThd: null,
maxHeightThd: null,
internal: 0,
ifShow: 0,
isFilter: null,
expression: null,
ext: null,
description: null,
color: null,
shape: null,
minVal: null,
maxVal: null,
},
{
_tls: {},
id: "DD52B150885A4905B167936009CE7BFC",
recordUser: "20210802-1454-3403-3753-a22ed7009522",
recordTime: "2023-08-04 09:37:42",
modifyTime: null,
displayRecordUser: "20210802-1454-3403-3753-a22ed7009522",
childrenList: [],
multiSelect: null,
checked: null,
canBeChecked: null,
psort: null,
departmentId: null,
displayDepartment: null,
groupName: "工程",
parentName: "工程",
parentCode: null,
layerCode: null,
layerCodeName: null,
dataType: 1,
name: "工程",
nameEn: "PJT",
code: "pointLayer",
codeName: "锚点",
icon: null,
orderIndex: 2,
enable: 1,
systemId: null,
treeLevel: 1,
fullPath: "DD52B150885A4905B167936009CE7BFC,",
hasChildren: 1,
parentId: null,
minZoom: null,
maxZoom: null,
minHeightThd: null,
maxHeightThd: null,
internal: 0,
ifShow: null,
isFilter: null,
expression: null,
ext: null,
description: null,
color: null,
shape: null,
minVal: null,
maxVal: null,
},
{
_tls: {},
id: "06E757DF27A247229B2E05F81000C131",
recordUser: "20210802-1454-3403-3753-a22ed7009522",
recordTime: "2023-08-04 09:37:42",
modifyTime: null,
displayRecordUser: "20210802-1454-3403-3753-a22ed7009522",
childrenList: [],
multiSelect: null,
checked: null,
canBeChecked: null,
psort: null,
departmentId: null,
displayDepartment: null,
groupName: "地图",
parentName: "地图",
parentCode: null,
layerCode: null,
layerCodeName: null,
dataType: 1,
name: "地图",
nameEn: "MAP",
code: "baseLayer",
codeName: "地图GIS",
icon: null,
orderIndex: 1,
enable: 1,
systemId: null,
treeLevel: 1,
fullPath: "06E757DF27A247229B2E05F81000C131,",
hasChildren: 1,
parentId: null,
minZoom: null,
maxZoom: null,
minHeightThd: null,
maxHeightThd: null,
internal: 0,
ifShow: 0,
isFilter: null,
expression: null,
ext: null,
description: null,
color: null,
shape: null,
minVal: null,
maxVal: null,
},
{
_tls: {},
id: "FE9BD72358A94E00AA363B0BF721F2EB",
recordUser: "wanglh",
recordTime: "2023-01-06 10:43:33",
modifyTime: "2024-01-23 11:13:51",
displayRecordUser: "wanglh",
childrenList: [],
multiSelect: null,
checked: null,
canBeChecked: null,
psort: null,
departmentId: null,
displayDepartment: null,
groupName: "环保设施告警",
parentName: "环保设施告警",
parentCode: null,
layerCode: "operat_alarm_point",
layerCodeName: "环保设施告警",
dataType: 1,
name: "环保设施告警",
nameEn: "OPERAT_WARN",
code: "pointLayer",
codeName: "锚点",
icon: null,
orderIndex: 0,
enable: 0,
systemId: "qgc",
treeLevel: 1,
fullPath: "FE9BD72358A94E00AA363B0BF721F2EB,",
hasChildren: 1,
parentId: null,
minZoom: null,
maxZoom: null,
minHeightThd: null,
maxHeightThd: null,
internal: 0,
ifShow: 0,
isFilter: null,
expression: null,
ext: null,
description: null,
color: null,
shape: null,
minVal: null,
maxVal: null,
},
{
_tls: {},
id: "EAA859F57D5AB2119EBE865F48E67C5F",
recordUser: "wanglh",
recordTime: "2023-01-06 10:43:33",
modifyTime: "2024-01-23 11:13:50",
displayRecordUser: "wanglh",
childrenList: [],
multiSelect: null,
checked: null,
canBeChecked: null,
psort: null,
departmentId: null,
displayDepartment: null,
groupName: "水质告警",
parentName: "水质告警",
parentCode: null,
layerCode: "wq_alarm_point",
layerCodeName: "水质告警",
dataType: 1,
name: "水质告警",
nameEn: "WQ_ALARM",
code: "pointLayer",
codeName: "锚点",
icon: null,
orderIndex: 0,
enable: 0,
systemId: "qgc",
treeLevel: 1,
fullPath: "EAA859F57D5AB2119EBE865F48E67C5F,",
hasChildren: 1,
parentId: null,
minZoom: null,
maxZoom: null,
minHeightThd: null,
maxHeightThd: null,
internal: 0,
ifShow: 0,
isFilter: null,
expression: null,
ext: null,
description: null,
color: null,
shape: null,
minVal: null,
maxVal: null,
},
{
_tls: {},
id: "F41E841E978747E1B3029E670B0478F8",
recordUser: "wanglh",
recordTime: "2023-01-06 10:43:33",
modifyTime: "2024-01-23 11:13:51",
displayRecordUser: "wanglh",
childrenList: [],
multiSelect: null,
checked: null,
canBeChecked: null,
psort: null,
departmentId: null,
displayDepartment: null,
groupName: "水温告警",
parentName: "水温告警",
parentCode: null,
layerCode: "wt_alarm_point",
layerCodeName: "水温告警",
dataType: 1,
name: "水温告警",
nameEn: "WT_WARN",
code: "pointLayer",
codeName: "锚点",
icon: null,
orderIndex: 0,
enable: 0,
systemId: "qgc",
treeLevel: 1,
fullPath: "F41E841E978747E1B3029E670B0478F8,",
hasChildren: 1,
parentId: null,
minZoom: null,
maxZoom: null,
minHeightThd: null,
maxHeightThd: null,
internal: 0,
ifShow: 0,
isFilter: null,
expression: null,
ext: null,
description: null,
color: null,
shape: null,
minVal: null,
maxVal: null,
},
{
_tls: {},
id: "76C87F687E5AB211E28142C369DDC7FE",
recordUser: "wanglh",
recordTime: "2023-01-06 10:43:33",
modifyTime: "2024-01-23 11:13:50",
displayRecordUser: "wanglh",
childrenList: [],
multiSelect: null,
checked: null,
canBeChecked: null,
psort: null,
departmentId: null,
displayDepartment: null,
groupName: "水位告警",
parentName: "水位告警",
parentCode: null,
layerCode: "rz_alarm_point",
layerCodeName: "水位告警",
dataType: 1,
name: "水位告警",
nameEn: "RZ_ALARM",
code: "pointLayer",
codeName: "锚点",
icon: null,
orderIndex: 0,
enable: 0,
systemId: "qgc",
treeLevel: 1,
fullPath: "76C87F687E5AB211E28142C369DDC7FE,",
hasChildren: 1,
parentId: null,
minZoom: null,
maxZoom: null,
minHeightThd: null,
maxHeightThd: null,
internal: 0,
ifShow: 0,
isFilter: null,
expression: null,
ext: null,
description: null,
color: null,
shape: null,
minVal: null,
maxVal: null,
},
]);
// 模拟数据获取函数
const fetchLegendStructureData = (params: any) => {
return new Promise((resolve) => {});
};
const handleAdd = () => {
currentRecord.value = null;
editModalVisible.value = true;
};
// 编辑处理
const handleEdit = (record: any) => {
currentRecord.value = { ...record };
editModalVisible.value = true;
};
// 删除处理
const handleDelete = (record: any) => {
message.warning(`删除图例: ${record.name}`);
};
// 搜索完成处理
const onSearchFinish = (values: any) => {
console.log(values);
};
// 重置
const handleReset = (params: any) => {};
// 是否启用切换处理
const handleEnableChange = (record: any, checked: boolean) => {
console.log("启用状态变更:", record.title, checked);
// TODO: 调用 API 更新启用状态
message.success(`${checked ? "启用" : "禁用"}图层: ${record.title}`);
};
// 是否内部切换处理
const handleInternalChange = (record: any, checked: boolean) => {
console.log("内部状态变更:", record.title, checked);
// TODO: 调用 API 更新内部状态
message.success(`${checked ? "启用" : "禁用"}图层: ${record.title}`);
};
// 是否显示处理
const handleIfShowChange = (record: any, checked: boolean) => {
console.log("显示状态变更:", record.name, checked);
// TODO: 调用 API 显示状态
message.success(`${checked ? "显示" : "隐藏"}图层: ${record.name}`);
};
// 表单取消
const editModalCancel = () => {
editModalVisible.value = false;
};
// 表单提交
const handleEditSubmit = (values: any) => {
console.log(values);
};
</script>
<style scoped lang="scss"></style>