From e21e44f141542b65045a47ea4b24aae317220056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=BE=E8=82=83?= <15833576927@163.com> Date: Wed, 22 May 2024 14:02:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E5=9B=A0=E5=9E=8B=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Hamburger/index.vue | 2 +- src/router/index.js | 14 + src/utils/ruoyi.js | 22 +- src/views/genoTypeData/genoManage/index.vue | 345 ++++++++++++++++++ .../genoTypeData/genoManage/uploadGeno.vue | 31 ++ src/views/system/base/baseRightControl.vue | 17 +- src/views/system/base/mapMarkers.vue | 2 +- 7 files changed, 423 insertions(+), 10 deletions(-) create mode 100644 src/views/genoTypeData/genoManage/index.vue create mode 100644 src/views/genoTypeData/genoManage/uploadGeno.vue diff --git a/src/components/Hamburger/index.vue b/src/components/Hamburger/index.vue index ee7bbdb..c577983 100644 --- a/src/components/Hamburger/index.vue +++ b/src/components/Hamburger/index.vue @@ -95,7 +95,7 @@ const menuList = ref([ }, { label: '基因型数据',icon:'chart-pie', children: [ - {label: '基因型数据管理'}, + {label: '基因型数据管理',href:'/genoTypeData/genoManage'}, ] }, ]) diff --git a/src/router/index.js b/src/router/index.js index 2ef7323..7749e5b 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -210,6 +210,20 @@ export const constantRoutes = [ } ] }, + { + path: '/genoTypeData', + component: Layout, + hidden: true, + redirect: 'noredirect', + children: [ + { + path: 'genoManage', + component: () => import('@/views/genoTypeData/genoManage/index.vue'), + name: 'genoManage', + meta: { title: '作物品种管理' } + } + ] + }, ] // 动态路由,基于用户权限动态去加载 diff --git a/src/utils/ruoyi.js b/src/utils/ruoyi.js index 2e84caf..b25af51 100644 --- a/src/utils/ruoyi.js +++ b/src/utils/ruoyi.js @@ -382,4 +382,24 @@ export function drawGridLines(polygon, grid = 10) { } } return gridLines -} \ No newline at end of file +} +/** + * 将文件转为blob预览地址 + * @param file + */ +export function fileToBlobURL(file) { + return new Promise((resolve, reject) => { + let reader = new FileReader(); + reader.readAsArrayBuffer(file); + reader.onload = function (e) { + // The file reader gives us an ArrayBuffer: + let buffer = e.target.result; + // We have to convert the buffer to a blob: + //类型自动检测即可 + let blobTemp = new Blob([new Uint8Array(buffer)], {type: file.type}); + // The blob gives us a URL to the video file: + let url = window.URL.createObjectURL(blobTemp); + resolve(url); + } + }) +} diff --git a/src/views/genoTypeData/genoManage/index.vue b/src/views/genoTypeData/genoManage/index.vue new file mode 100644 index 0000000..6ca703d --- /dev/null +++ b/src/views/genoTypeData/genoManage/index.vue @@ -0,0 +1,345 @@ + + + + + diff --git a/src/views/genoTypeData/genoManage/uploadGeno.vue b/src/views/genoTypeData/genoManage/uploadGeno.vue new file mode 100644 index 0000000..508224f --- /dev/null +++ b/src/views/genoTypeData/genoManage/uploadGeno.vue @@ -0,0 +1,31 @@ + + + + + \ No newline at end of file diff --git a/src/views/system/base/baseRightControl.vue b/src/views/system/base/baseRightControl.vue index ea3225b..d40dbf2 100644 --- a/src/views/system/base/baseRightControl.vue +++ b/src/views/system/base/baseRightControl.vue @@ -11,6 +11,9 @@ const route = useRoute(); const toBaseTable = () => { router.push({path:'/system/base/baseTable',query:route.params}) } +const props = defineProps({ + isBaseMap:Boolean +}) const control = defineModel({ default: { // 地图类型 @@ -35,7 +38,7 @@ const control = defineModel({