From 3bee267219fb3e38ac0f8b6e41a0748ac3f4c32c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=90=AA?= <727393967@qq.com>
Date: Fri, 2 Aug 2024 16:56:07 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=89=B9=E9=87=8F=E4=B8=8A?=
=?UTF-8?q?=E4=BC=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
package-lock.json | 5 +
package.json | 1 +
src/api/dataSearch.js | 9 +
src/api/dataTransfer.js | 30 +++
src/api/login.js | 12 +-
src/components/public/Header.vue | 131 ++++---------
src/router/index.js | 44 ++---
src/store/modules/sample.js | 7 +-
src/style/gloable.scss | 1 -
src/utils/request.js | 18 +-
src/views/dataDetail.vue | 182 ++++++++----------
src/views/dataSearch.vue | 9 +-
src/views/dataTransfer/sampleDataset.vue | 96 +++++++--
.../dataTransfer/sampleViews/DiveTrack.vue | 15 ++
.../sampleViews/formViews/TrackInfo.vue | 45 ++++-
src/views/login.vue | 58 ++++--
src/views/voyagedetail.vue | 2 +-
17 files changed, 396 insertions(+), 269 deletions(-)
create mode 100644 src/views/dataTransfer/sampleViews/DiveTrack.vue
diff --git a/package-lock.json b/package-lock.json
index 797c3c6..6a0b9a9 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -11092,6 +11092,11 @@
"resolved": "https://registry.npmmirror.com/js-cookie/-/js-cookie-2.2.1.tgz",
"integrity": "sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ=="
},
+ "js-md5": {
+ "version": "0.8.3",
+ "resolved": "https://registry.npmmirror.com/js-md5/-/js-md5-0.8.3.tgz",
+ "integrity": "sha512-qR0HB5uP6wCuRMrWPTrkMaev7MJZwJuuw4fnwAzRgP4J4/F8RwtodOKpGp4XpqsLBFzzgqIO42efFAyz2Et6KQ=="
+ },
"js-pinyin": {
"version": "0.1.9",
"resolved": "https://registry.npmmirror.com/js-pinyin/-/js-pinyin-0.1.9.tgz",
diff --git a/package.json b/package.json
index 3335f65..ddb284f 100644
--- a/package.json
+++ b/package.json
@@ -21,6 +21,7 @@
"echarts-gl": "^1.1.0",
"element-ui": "^2.13.0",
"js-cookie": "^2.2.0",
+ "js-md5": "^0.8.3",
"js-pinyin": "^0.1.9",
"leaflet": "^1.9.4",
"leaflet.wmts": "^1.0.2",
diff --git a/src/api/dataSearch.js b/src/api/dataSearch.js
index 408ba87..436c8cc 100644
--- a/src/api/dataSearch.js
+++ b/src/api/dataSearch.js
@@ -71,3 +71,12 @@ export function sampleStationList(query) {
params: query
})
}
+
+// 获取航次详情
+export function regInfo(query) {
+ return request({
+ url: '/voyage/reg/info.htm',
+ method: 'get',
+ params: query
+ })
+}
diff --git a/src/api/dataTransfer.js b/src/api/dataTransfer.js
index 3ff9975..9672b99 100644
--- a/src/api/dataTransfer.js
+++ b/src/api/dataTransfer.js
@@ -204,3 +204,33 @@ export function trackMap(data) {
data
})
}
+
+// 上传轨迹文件
+export function uploadTrack(data) {
+ return request({
+ url: '/sample/dataset/track/upload.htm',
+ method: 'post',
+ type: 'multipart/form-data',
+ data
+ })
+}
+
+// 批量导入下潜轨迹
+export function uploadDiving(data) {
+ return request({
+ url: '/sample/diving/upload.htm',
+ method: 'post',
+ type: 'multipart/form-data',
+ data
+ })
+}
+
+// 批量导入样品
+export function uploadDataset(data) {
+ return request({
+ url: '/sample/dataset/upload.htm',
+ method: 'post',
+ type: 'multipart/form-data',
+ data
+ })
+}
diff --git a/src/api/login.js b/src/api/login.js
index 9083569..c6b62d8 100644
--- a/src/api/login.js
+++ b/src/api/login.js
@@ -13,7 +13,17 @@ export function login(data) {
// 退出登录
export function loginOut(data) {
return request({
- url: '/frame/optr/logout.htm ',
+ url: '/frame/optr/logout.htm',
+ method: 'post',
+ type: 'application/x-www-form-urlencoded',
+ data
+ })
+}
+
+// 初始化登录信息
+export function initInfo(data) {
+ return request({
+ url: '/frame/optr/init.htm',
method: 'post',
type: 'application/x-www-form-urlencoded',
data
diff --git a/src/components/public/Header.vue b/src/components/public/Header.vue
index c6dd1c2..868ad0c 100644
--- a/src/components/public/Header.vue
+++ b/src/components/public/Header.vue
@@ -16,7 +16,7 @@
-
+
admin
@@ -24,60 +24,30 @@
个人中心
+
+ 退出登录
+
+
+
+ 登录
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/router/index.js b/src/router/index.js
index 09e204a..255e156 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -1,16 +1,16 @@
import Vue from 'vue'
import Router from 'vue-router'
import Layout from '@/layout'
-import store from '../store'
-import {
- getParameterValue
-} from '@/utils/auth' // get token from cookie
-import {
- setToken, getToken, setUser, setUserID, getUserID
-} from '@/utils/auth' // get token from cookie
-import {
- getByUname
-} from '@/api/getByUname'
+// import store from '../store'
+// import {
+// getParameterValue
+// } from '@/utils/auth' // get token from cookie
+// import {
+// setToken, getToken, setUser, setUserID, getUserID
+// } from '@/utils/auth' // get token from cookie
+// import {
+// getByUname
+// } from '@/api/getByUname'
Vue.use(Router)
const originalPush = Router.prototype.push
@@ -456,19 +456,19 @@ const router = createRouter()
router.beforeEach((to, from, next) => {
to.meta.title && (document.title = to.meta.title + ' | Deep-sea')
- const jsid = getParameterValue('jsessionid')
- const cu = getParameterValue('cu')
- const userID = getParameterValue('userId')
+ // const jsid = getParameterValue('jsessionid')
+ // const cu = getParameterValue('cu')
+ // const userID = getParameterValue('userId')
// 如果url上用户名 cu userId到本地
- if (!!jsid && !!cu) {
- setToken(jsid)
- setUser(cu)
- setUserID(userID)
- window.sessionStorage.setItem('cu', cu)
- }
- window.sessionStorage.setItem('userID', getUserID())
- store.dispatch('app/setUser')
- const hasToken = getToken()
+ // if (!!jsid && !!cu) {
+ // setToken(jsid)
+ // setUser(cu)
+ // setUserID(userID)
+ // window.sessionStorage.setItem('cu', cu)
+ // }
+ // window.sessionStorage.setItem('userID', getUserID())
+ // store.dispatch('app/setUser')
+ // const hasToken = getToken()
// 个人空间和后台系统需要登录 loginAuthority为true就是可以免登陆
// if (!to.meta.loginAuthority) {
// window.sessionStorage.setItem('sign', 'asos_service')
diff --git a/src/store/modules/sample.js b/src/store/modules/sample.js
index 2a33a05..f3a2ca9 100644
--- a/src/store/modules/sample.js
+++ b/src/store/modules/sample.js
@@ -5,7 +5,9 @@ const sample = {
// 当前数据样品集数据
datasetRow: new Object(),
// 当前数据样品集ID
- datasetId: null
+ datasetId: null,
+ // 轨迹文件名称
+ trackName: ''
},
mutations: {
SET_FORM_DATA: (state, data) => {
@@ -24,6 +26,9 @@ const sample = {
},
SET_ID: (state, id) => {
state.datasetId = id
+ },
+ SET_TRACK_NAME: (state, trackName) => {
+ state.trackName = trackName
}
}
}
diff --git a/src/style/gloable.scss b/src/style/gloable.scss
index 69cd005..0a2fc68 100644
--- a/src/style/gloable.scss
+++ b/src/style/gloable.scss
@@ -196,7 +196,6 @@ color:#0ba1e4;
.checkBtn{
float:right;
text-align: right;
-
}
.topic1{
padding:0px 16px;
diff --git a/src/utils/request.js b/src/utils/request.js
index 44d96d3..8f841de 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -1,5 +1,5 @@
import axios from 'axios'
-
+axios.defaults.withCredentials = true
import {
Message
} from 'element-ui'
@@ -47,6 +47,20 @@ service.interceptors.request.use(
service.interceptors.response.use(
response => {
const res = response.data
+ if (res.errorCode === 10301) {
+ // 当前未登录或已经过期
+ Message({
+ message: res.errorMsg,
+ type: 'warning'
+ })
+ } else if (res.errorCode === 0) {
+ return res
+ } else {
+ Message({
+ message: '系统错误',
+ type: 'warning'
+ })
+ }
// if the custom code is not 20000, it is judged as an error.
// if (res && res.code && res.code !== 20000) {
// if (res.code === 20001 || res.code === 401) {
@@ -62,7 +76,7 @@ service.interceptors.response.use(
// }
// }
// }
- return res
+ // return res
},
error => {
console.log('err' + error) // for debug
diff --git a/src/views/dataDetail.vue b/src/views/dataDetail.vue
index 91cf76f..55ddc58 100644
--- a/src/views/dataDetail.vue
+++ b/src/views/dataDetail.vue
@@ -10,102 +10,76 @@
数据检索
- 数据样品信息详情
+ 航次详细信息
-
+
-
{{ obj.name }}
-
- 数据样品信息简述:数据样品SY510-TXS-YS-01为2021年第23个航次,第1次载人潜器下潜中采集到的若干珊瑚礁石样品,样品数据包含原始数据、后处理数据、成果数据。
- 数据样品SY510-TXS-YS-01为2021年第23个航次,第1次载人潜器下潜中采集到的若干珊瑚礁石样品,样品数据包含原始数据、后处理数据、成果数据。
-
-
-
- 数据样品元数据信息:
-
+
{{ info.voyage_name }}
+
{{ info.voyage_remark }}
+
航次信息:
- TS-14
+ {{ info.ship_name }}
- 着陆器
+ {{ info.funding_org }}
- 机械手
+ {{ info.voyage_start_date }}
- 岩石
+ {{ info.voyage_end_date }}
- MERY
+ {{ info.voyage_officer }}
-
-

+
+

-
数据文件
-
-
-

-

-
文档报告
-
-
-

-

-
数据来源信息
-
-
-

-

-
数据引用信息
-
-
-

-

-
XML元数据文件
+
{{ item.label }}
-
-
- 全选
-
-
-
- 下载所选文件
-
-
-
-
-
-
-
-
-
{{ item.name }}
-
-
{{ item.size }}
-
{{ item.format }}
-
-
详情
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -117,12 +91,12 @@
-
+
+
diff --git a/src/views/dataTransfer/sampleViews/DiveTrack.vue b/src/views/dataTransfer/sampleViews/DiveTrack.vue
new file mode 100644
index 0000000..a04e6a4
--- /dev/null
+++ b/src/views/dataTransfer/sampleViews/DiveTrack.vue
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/views/dataTransfer/sampleViews/formViews/TrackInfo.vue b/src/views/dataTransfer/sampleViews/formViews/TrackInfo.vue
index 8a91fc7..5f8eadb 100644
--- a/src/views/dataTransfer/sampleViews/formViews/TrackInfo.vue
+++ b/src/views/dataTransfer/sampleViews/formViews/TrackInfo.vue
@@ -2,7 +2,16 @@
潜次 [{{ diving_sn }}]
- 上传轨迹文件
+
+ {{ btnText }}
+
@@ -61,7 +70,7 @@