|
|
@@ -1,31 +1,36 @@
|
|
|
<template>
|
|
|
- <div class="tools p-4">
|
|
|
- <BasicTable @register="registerTable">
|
|
|
- <template #toolbar>
|
|
|
- <Button type="primary" @click="openDialog(null)">
|
|
|
- 新增工具
|
|
|
- </Button>
|
|
|
- <Button type="primary" danger :disabled="hasSelected" @click="delAllData">
|
|
|
- 批量删除
|
|
|
- </Button>
|
|
|
- </template>
|
|
|
- <template #func="{ record }">
|
|
|
- <TableAction :actions="[
|
|
|
- {
|
|
|
- label: '',
|
|
|
- tooltip: '编辑',
|
|
|
- icon: 'ant-design:edit-outlined',
|
|
|
- onClick: openDialog.bind(null, record),
|
|
|
- },
|
|
|
- {
|
|
|
- label: '',
|
|
|
- tooltip: '删除',
|
|
|
- icon: 'ant-design:delete-outlined',
|
|
|
- onClick: onDelete.bind(null, record.id),
|
|
|
- },
|
|
|
- ]" />
|
|
|
- </template>
|
|
|
- </BasicTable>
|
|
|
+ <div class="layer3d p-4">
|
|
|
+ <div class="layer3d-body">
|
|
|
+ <BasicTable @register="registerTable">
|
|
|
+ <template #toolbar>
|
|
|
+ <Button type="primary" @click="openDialog(null)">
|
|
|
+ 新增工具
|
|
|
+ </Button>
|
|
|
+ <Button type="primary" danger :disabled="hasSelected" @click="delAllData">
|
|
|
+ 批量删除
|
|
|
+ </Button>
|
|
|
+ </template>
|
|
|
+ <template #flyTo="{ record }">
|
|
|
+ <div>{{ record.flyTo?'是':'否' }}</div>
|
|
|
+ </template>
|
|
|
+ <template #func="{ record }">
|
|
|
+ <TableAction :actions="[
|
|
|
+ {
|
|
|
+ label: '',
|
|
|
+ tooltip: '编辑',
|
|
|
+ icon: 'ant-design:edit-outlined',
|
|
|
+ onClick: openDialog.bind(null, record),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '',
|
|
|
+ tooltip: '删除',
|
|
|
+ icon: 'ant-design:delete-outlined',
|
|
|
+ onClick: onDelete.bind(null, record.id),
|
|
|
+ },
|
|
|
+ ]" />
|
|
|
+ </template>
|
|
|
+ </BasicTable>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -38,6 +43,7 @@ import { Button } from 'ant-design-vue';
|
|
|
import { message, Modal } from 'ant-design-vue';
|
|
|
import moment from 'moment'
|
|
|
import { session } from '/@/utils/Memory';
|
|
|
+import { get3dLayers } from '/@/api/sys/mapTools';
|
|
|
|
|
|
export default defineComponent({
|
|
|
components: { BasicTable, TableAction, Button },
|
|
|
@@ -329,9 +335,9 @@ export default defineComponent({
|
|
|
]
|
|
|
const columns = [
|
|
|
{
|
|
|
- title: '分组名称',
|
|
|
- dataIndex: 'group',
|
|
|
- key: 'group',
|
|
|
+ title: '图层',
|
|
|
+ dataIndex: 'title',
|
|
|
+ key: 'title',
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
@@ -341,28 +347,22 @@ export default defineComponent({
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
- title: '显示名称',
|
|
|
- dataIndex: 'label',
|
|
|
- key: 'label',
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- {
|
|
|
- title: '提示文字',
|
|
|
- dataIndex: 'tip',
|
|
|
- key: 'tip',
|
|
|
+ title: '类型',
|
|
|
+ dataIndex: 'type',
|
|
|
+ key: 'type',
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
- title: '图标',
|
|
|
- dataIndex: 'icon',
|
|
|
- key: 'icon',
|
|
|
+ title: '地址',
|
|
|
+ dataIndex: 'url',
|
|
|
+ key: 'url',
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
- title: '功能',
|
|
|
- dataIndex: 'action',
|
|
|
- key: 'action',
|
|
|
- align: 'center'
|
|
|
+ title: '快速定位',
|
|
|
+ dataIndex: 'flyTo',
|
|
|
+ align: 'center',
|
|
|
+ slots: { customRender: 'flyTo' },
|
|
|
}
|
|
|
]
|
|
|
const openDialog = () => {
|
|
|
@@ -370,6 +370,20 @@ export default defineComponent({
|
|
|
}
|
|
|
const onDelete = () => {
|
|
|
|
|
|
+ }
|
|
|
+ const delAllData = () => {
|
|
|
+
|
|
|
+ }
|
|
|
+ const getAllData = () => {
|
|
|
+ return new Promise((resolve) => {
|
|
|
+ get3dLayers().then(res => {
|
|
|
+ if (res.code === 200 && res.data.length) {
|
|
|
+ resolve(res.data)
|
|
|
+ } else {
|
|
|
+ message.error('暂无图层数据')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
}
|
|
|
//判断是否选中数据
|
|
|
const hasSelected = computed(() => {
|
|
|
@@ -381,9 +395,9 @@ export default defineComponent({
|
|
|
registerTable,
|
|
|
{ reload, getRowSelection, getSelectRowKeys, setSelectedRowKeys }
|
|
|
] = useTable({
|
|
|
- title: '工具列表', //'菜单列表'
|
|
|
- // api: getTagsData, //加载数据
|
|
|
- dataSource: toolsData,
|
|
|
+ title: '图层列表', //'菜单列表'
|
|
|
+ api: getAllData, //加载数据
|
|
|
+ // dataSource: toolsData,
|
|
|
columns: columns,
|
|
|
useSearchForm: false, //开启搜索区域
|
|
|
bordered: true,
|
|
|
@@ -413,8 +427,19 @@ export default defineComponent({
|
|
|
getSelectRowKeys,
|
|
|
setSelectedRowKeys,
|
|
|
openDialog,
|
|
|
- onDelete
|
|
|
+ onDelete,
|
|
|
+ delAllData
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
-</script>
|
|
|
+</script>
|
|
|
+<style lang="less" scoped>
|
|
|
+.layer3d {
|
|
|
+ .layer3d-body {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ padding: 0 20px;
|
|
|
+ background-color: #fff;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|