From 165198ea9f6669b04b514b79f814a5e2b4e5d37e Mon Sep 17 00:00:00 2001 From: freshman-white <2514756131@qq.com> Date: Thu, 7 Sep 2023 17:48:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=A0=87=E6=B3=A8=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/assets/icons/import.svg | 1 + src/components/common/topbar.vue | 10 +- src/pages/page-web/projects/layer.vue | 157 +++++++++++++++++++++++++- src/types/enums.ts | 6 + 5 files changed, 167 insertions(+), 8 deletions(-) create mode 100644 src/assets/icons/import.svg diff --git a/package.json b/package.json index 01fa3fd..0b9d762 100644 --- a/package.json +++ b/package.json @@ -102,6 +102,7 @@ "ant-design-vue/es/tag/style/css", "ant-design-vue/es/time-picker/style/css", "ant-design-vue/es/tooltip/style/css", + "ant-design-vue/es/tree-select/style/css", "ant-design-vue/es/tree/style/css", "ant-design-vue/es/upload/style/css", "axios", diff --git a/src/assets/icons/import.svg b/src/assets/icons/import.svg new file mode 100644 index 0000000..ffee70b --- /dev/null +++ b/src/assets/icons/import.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/common/topbar.vue b/src/components/common/topbar.vue index 69e4462..ed22a27 100644 --- a/src/components/common/topbar.vue +++ b/src/components/common/topbar.vue @@ -41,7 +41,7 @@ import { message } from 'ant-design-vue' import { defineComponent, onMounted, ref } from 'vue' import { getRoot } from '/@/root' import { getPlatformInfo } from '/@/api/manage' -import { ELocalStorageKey, ERouterName } from '/@/types' +import { ELocalStorageKey, ERouterName, TabName } from '/@/types' import { UserOutlined, ExportOutlined } from '@ant-design/icons-vue' import cloudapi from '/@/assets/icons/cloudapi.png' @@ -61,10 +61,10 @@ interface IOptions { const username = ref(localStorage.getItem(ELocalStorageKey.Username)) const workspaceName = ref('') const options = [ - { key: 0, label: ERouterName.WORKSPACE.charAt(0).toUpperCase() + ERouterName.WORKSPACE.substr(1), path: '/' + ERouterName.WORKSPACE }, - { key: 1, label: ERouterName.MEMBERS.charAt(0).toUpperCase() + ERouterName.MEMBERS.substr(1), path: '/' + ERouterName.MEMBERS }, - { key: 2, label: ERouterName.DEVICES.charAt(0).toUpperCase() + ERouterName.DEVICES.substr(1), path: '/' + ERouterName.DEVICES }, - { key: 3, label: ERouterName.FIRMWARES.charAt(0).toUpperCase() + ERouterName.FIRMWARES.substr(1), path: '/' + ERouterName.FIRMWARES }, + { key: 0, label: TabName.WORKSPACE, path: '/' + ERouterName.WORKSPACE }, + { key: 1, label: TabName.MEMBERS, path: '/' + ERouterName.MEMBERS }, + { key: 2, label: TabName.DEVICES, path: '/' + ERouterName.DEVICES }, + { key: 3, label: TabName.FIRMWARES, path: '/' + ERouterName.FIRMWARES }, ] const selected = ref(root.$route.path) diff --git a/src/pages/page-web/projects/layer.vue b/src/pages/page-web/projects/layer.vue index 76fa96d..8110d5c 100644 --- a/src/pages/page-web/projects/layer.vue +++ b/src/pages/page-web/projects/layer.vue @@ -3,8 +3,12 @@
- 标注 - + 标注 + + + + +
@@ -102,6 +106,42 @@ 删除
+ + + + + + + + 上传文件 + + + + + + + + + @@ -121,12 +161,13 @@ import { GeojsonCoordinate, LayerResource } from '/@/types/map' import { Color, GeoType } from '/@/types/mapLayer' import { generatePoint } from '/@/utils/genjson' import { gcj02towgs84, wgs84togcj02 } from '/@/vendors/coordtransform' +import importImg from '/@/assets/icons/import.svg' const root = getRoot() const store = useMyStore() let useGMapCoverHook = useGMapCover(store) console.log('store', store) -const mapLayers = ref(store.state.Layers) +const mapLayers = ref(store?.state?.Layers) const checkedKeys = ref([]) const selectedKeys = ref([]) const selectedKey = ref('') @@ -441,12 +482,121 @@ function updateCoordinates (transformType: string, element: LayerResource) { } } } +/** 导入文件--------------start */ +const importVisible = ref(false) +const state = reactive({ name: '', file: '' }) +const fileList = ref() +const fileTree = [ + { + label: 'Node1', + value: '0-0', + children: [ + { + label: 'Child Node1', + value: '0-0-0', + }, + ], + }, + { + label: 'Node2', + value: '0-1', + + children: [ + { + label: 'Child Node3', + value: '0-1-0', + disabled: true, + }, + { + label: 'Child Node4', + value: '0-1-1', + }, + { + label: 'Child Node5', + value: '0-1-2', + }, + ], + }, +] + +// 打开文件导入弹框 +const openFileDialog = () => { + importVisible.value = true +} +// 确认导入操作 +const importSubmit = () => { + +} +// const beforeUpload = (file:any) => { +// // fileList.value = [file] +// // } +const handleChange = (info: any) => { + let resFileList = [...info.fileList] + resFileList = resFileList.slice(-1) + resFileList = resFileList.map(file => { + if (file.response) { + file.url = file.response.url + } + return file + }) + fileList.value = resFileList +} + +/** 导入文件--------------end */ diff --git a/src/types/enums.ts b/src/types/enums.ts index 43248fa..7aa4d47 100644 --- a/src/types/enums.ts +++ b/src/types/enums.ts @@ -136,3 +136,9 @@ export enum EHmsLevel { CAUTION, WARN, } +export enum TabName { + WORKSPACE = '工作区', + MEMBERS = '人员管理', + DEVICES = '设备管理', + FIRMWARES='固件管理' +}