完成批量上传

This commit is contained in:
2024-08-02 16:56:07 +08:00
parent d3e0002975
commit 3bee267219
17 changed files with 396 additions and 269 deletions

5
package-lock.json generated
View File

@ -11092,6 +11092,11 @@
"resolved": "https://registry.npmmirror.com/js-cookie/-/js-cookie-2.2.1.tgz", "resolved": "https://registry.npmmirror.com/js-cookie/-/js-cookie-2.2.1.tgz",
"integrity": "sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ==" "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": { "js-pinyin": {
"version": "0.1.9", "version": "0.1.9",
"resolved": "https://registry.npmmirror.com/js-pinyin/-/js-pinyin-0.1.9.tgz", "resolved": "https://registry.npmmirror.com/js-pinyin/-/js-pinyin-0.1.9.tgz",

View File

@ -21,6 +21,7 @@
"echarts-gl": "^1.1.0", "echarts-gl": "^1.1.0",
"element-ui": "^2.13.0", "element-ui": "^2.13.0",
"js-cookie": "^2.2.0", "js-cookie": "^2.2.0",
"js-md5": "^0.8.3",
"js-pinyin": "^0.1.9", "js-pinyin": "^0.1.9",
"leaflet": "^1.9.4", "leaflet": "^1.9.4",
"leaflet.wmts": "^1.0.2", "leaflet.wmts": "^1.0.2",

View File

@ -71,3 +71,12 @@ export function sampleStationList(query) {
params: query params: query
}) })
} }
// 获取航次详情
export function regInfo(query) {
return request({
url: '/voyage/reg/info.htm',
method: 'get',
params: query
})
}

View File

@ -204,3 +204,33 @@ export function trackMap(data) {
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
})
}

View File

@ -13,7 +13,17 @@ export function login(data) {
// 退出登录 // 退出登录
export function loginOut(data) { export function loginOut(data) {
return request({ 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', method: 'post',
type: 'application/x-www-form-urlencoded', type: 'application/x-www-form-urlencoded',
data data

View File

@ -16,7 +16,7 @@
</ul> </ul>
</li> </li>
<li class="dropdown"> <li class="dropdown">
<el-dropdown trigger="click"> <el-dropdown>
<span class="el-dropdown-link userClass"> <span class="el-dropdown-link userClass">
<a href="javascript:void(0);">admin<img src="../../../static/images/arrow-down.png" alt=""></a> <a href="javascript:void(0);">admin<img src="../../../static/images/arrow-down.png" alt=""></a>
</span> </span>
@ -24,60 +24,30 @@
<el-dropdown-item> <el-dropdown-item>
<a href="javascript:void(0);" @click="routerTurn('personalCenter')">个人中心</a> <a href="javascript:void(0);" @click="routerTurn('personalCenter')">个人中心</a>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item>
<a href="javascript:void(0);" @click="onLogout">退出登录</a>
</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
<el-dropdown trigger="click">
<span class="el-dropdown-link userClass">
<a href="javascript:void(0);" @click="routerTurn('login')">登录</a>
</span>
</el-dropdown>
</li> </li>
</ul> </ul>
</nav> </nav>
</div> </div>
<div class="menu2" > <div class="menu2" >
<i class="el-icon-menu" @click="handleMenu"></i> <i class="el-icon-menu" @click="handleMenu"></i>
</div> </div>
<div>
<el-tooltip class="tooltip" effect="dark" content="登录" placement="bottom">
<el-button type="primary" icon="el-icon-user" circle @click="onLogin"></el-button>
</el-tooltip>
</div>
</div> </div>
<!-- 登录弹窗-->
<el-dialog title="用户登录" :visible.sync="open" :before-close="cancel" width="500px" append-to-body>
<el-form ref="loginForm" :model="loginForm" :rules="loginRules">
<el-form-item prop="loginName">
<el-input
v-model="loginForm.loginName"
type="text"
auto-complete="off"
placeholder="请输入登录名称"
prefix-icon="el-icon-user"
/>
</el-form-item>
<el-form-item prop="loginPass">
<el-input
v-model="loginForm.loginPass"
type="loginPass"
auto-complete="off"
placeholder="请输入登录密码"
prefix-icon="el-icon-lock"
@keyup.enter.native="handleLogin"
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleLogin"> </el-button>
</div>
</el-dialog>
</header> </header>
</template> </template>
<script> <script>
import { import { initInfo, loginOut } from '@/api/login'
logoutCas
} from '@/utils/logoutCas' // get token from cookie
import {
removeToken
} from '@/utils/auth'
import { login } from '@/api/login' // get token from cookie
export default { export default {
name: 'headers', name: 'headers',
props: { props: {
@ -86,7 +56,6 @@ export default {
data(){ data(){
return { return {
collapse:true, collapse:true,
loginStatuss: '',
menu:[ menu:[
{ {
name:"首页", name:"首页",
@ -205,37 +174,24 @@ export default {
path:"", path:"",
children:[] children:[]
}, },
// { // {
// name:"", // name:"",
// path:"personalCenter", // path:"personalCenter",
// children:[] // children:[]
// }, // },
// { // {
// name:"", // name:"",
// path:"login", // path:"login",
// children:[] // children:[]
// }, // },
], ],
nowPathName: '', nowPathName: '',
navShow:false, navShow:false
open: false,
loginForm: {
loginName: '',
loginPass: '',
loginCode: '1234'
},
loginRules: {
loginName: [
{ required: true, trigger: "blur", message: "请输入登录名称" }
],
loginPass: [
{ required: true, trigger: "blur", message: "请输入登录密码" }
],
},
} }
}, },
created() { created() {
this.getLoginInfo()
}, },
mounted(){ mounted(){
$('.dropdown').hover( $('.dropdown').hover(
@ -276,34 +232,21 @@ export default {
this.collapse=true this.collapse=true
} }
}, },
// // 退
onLogin() { onLogout() {
this.open = true loginOut().then(res => {
}, this.$router.push({
// path: 'login'
handleLogin() { })
this.$refs['loginForm'].validate(valid => { this.getLoginInfo()
if (valid) {
login(this.loginForm).then(res => {
console.log(res)
})
}
}) })
}, },
// //
cancel() { getLoginInfo() {
this.open = false initInfo().then(res => {
this.reset() console.log(res)
}, })
// }
reset() {
this.form = {
loginName: '',
loginPass: '',
loginCode: '1234'
}
this.$refs['form'].resetFields()
},
} }
} }
</script> </script>

View File

@ -1,16 +1,16 @@
import Vue from 'vue' import Vue from 'vue'
import Router from 'vue-router' import Router from 'vue-router'
import Layout from '@/layout' import Layout from '@/layout'
import store from '../store' // import store from '../store'
import { // import {
getParameterValue // getParameterValue
} from '@/utils/auth' // get token from cookie // } from '@/utils/auth' // get token from cookie
import { // import {
setToken, getToken, setUser, setUserID, getUserID // setToken, getToken, setUser, setUserID, getUserID
} from '@/utils/auth' // get token from cookie // } from '@/utils/auth' // get token from cookie
import { // import {
getByUname // getByUname
} from '@/api/getByUname' // } from '@/api/getByUname'
Vue.use(Router) Vue.use(Router)
const originalPush = Router.prototype.push const originalPush = Router.prototype.push
@ -456,19 +456,19 @@ const router = createRouter()
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
to.meta.title && (document.title = to.meta.title + ' | Deep-sea') to.meta.title && (document.title = to.meta.title + ' | Deep-sea')
const jsid = getParameterValue('jsessionid') // const jsid = getParameterValue('jsessionid')
const cu = getParameterValue('cu') // const cu = getParameterValue('cu')
const userID = getParameterValue('userId') // const userID = getParameterValue('userId')
// 如果url上用户名 cu userId到本地 // 如果url上用户名 cu userId到本地
if (!!jsid && !!cu) { // if (!!jsid && !!cu) {
setToken(jsid) // setToken(jsid)
setUser(cu) // setUser(cu)
setUserID(userID) // setUserID(userID)
window.sessionStorage.setItem('cu', cu) // window.sessionStorage.setItem('cu', cu)
} // }
window.sessionStorage.setItem('userID', getUserID()) // window.sessionStorage.setItem('userID', getUserID())
store.dispatch('app/setUser') // store.dispatch('app/setUser')
const hasToken = getToken() // const hasToken = getToken()
// 个人空间和后台系统需要登录 loginAuthority为true就是可以免登陆 // 个人空间和后台系统需要登录 loginAuthority为true就是可以免登陆
// if (!to.meta.loginAuthority) { // if (!to.meta.loginAuthority) {
// window.sessionStorage.setItem('sign', 'asos_service') // window.sessionStorage.setItem('sign', 'asos_service')

View File

@ -5,7 +5,9 @@ const sample = {
// 当前数据样品集数据 // 当前数据样品集数据
datasetRow: new Object(), datasetRow: new Object(),
// 当前数据样品集ID // 当前数据样品集ID
datasetId: null datasetId: null,
// 轨迹文件名称
trackName: ''
}, },
mutations: { mutations: {
SET_FORM_DATA: (state, data) => { SET_FORM_DATA: (state, data) => {
@ -24,6 +26,9 @@ const sample = {
}, },
SET_ID: (state, id) => { SET_ID: (state, id) => {
state.datasetId = id state.datasetId = id
},
SET_TRACK_NAME: (state, trackName) => {
state.trackName = trackName
} }
} }
} }

View File

@ -196,7 +196,6 @@ color:#0ba1e4;
.checkBtn{ .checkBtn{
float:right; float:right;
text-align: right; text-align: right;
} }
.topic1{ .topic1{
padding:0px 16px; padding:0px 16px;

View File

@ -1,5 +1,5 @@
import axios from 'axios' import axios from 'axios'
axios.defaults.withCredentials = true
import { import {
Message Message
} from 'element-ui' } from 'element-ui'
@ -47,6 +47,20 @@ service.interceptors.request.use(
service.interceptors.response.use( service.interceptors.response.use(
response => { response => {
const res = response.data 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 the custom code is not 20000, it is judged as an error.
// if (res && res.code && res.code !== 20000) { // if (res && res.code && res.code !== 20000) {
// if (res.code === 20001 || res.code === 401) { // if (res.code === 20001 || res.code === 401) {
@ -62,7 +76,7 @@ service.interceptors.response.use(
// } // }
// } // }
// } // }
return res // return res
}, },
error => { error => {
console.log('err' + error) // for debug console.log('err' + error) // for debug

View File

@ -10,102 +10,76 @@
<el-breadcrumb-item <el-breadcrumb-item
:to="{ name: 'dataSearch' }" :to="{ name: 'dataSearch' }"
>数据检索</el-breadcrumb-item> >数据检索</el-breadcrumb-item>
<el-breadcrumb-item>数据样品信息详情</el-breadcrumb-item> <el-breadcrumb-item>航次详细信息</el-breadcrumb-item>
</el-breadcrumb> </el-breadcrumb>
</div> </div>
<div> <div>
<div class="detail_a"> <div class="detail_a">
<div class=""> <div style="width: 100%;">
<div class="detail_b"> <div class="detail_b">
<h3>{{ obj.name }}</h3> <h3>{{ info.voyage_name }}</h3>
<p class="tit_a"> <p class="tit_a">{{ info.voyage_remark }}</p>
数据样品信息简述数据样品SY510-TXS-YS-01为2021年第23个航次第1次载人潜器下潜中采集到的若干珊瑚礁石样品样品数据包含原始数据后处理数据成果数据 <h4>航次信息</h4>
数据样品SY510-TXS-YS-01为2021年第23个航次第1次载人潜器下潜中采集到的若干珊瑚礁石样品样品数据包含原始数据后处理数据成果数据
</p>
<h4>
数据样品元数据信息
</h4>
<div> <div>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="4"> <el-col :span="4">
<label>航次</label><span>TS-14 </span> <label>科考船舶</label><span>{{ info.ship_name }}</span>
</el-col> </el-col>
<el-col :span="5"> <el-col :span="5">
<label>平台</label><span>着陆器</span> <label>资助机构</label><span>{{ info.funding_org }}</span>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="4"> <el-col :span="4">
<label>设备</label><span>机械手</span> <label>离港日期</label><span>{{ info.voyage_start_date }}</span>
</el-col> </el-col>
<el-col :span="5"> <el-col :span="5">
<label>机械手</label><span>岩石</span> <label>返港日期</label><span>{{ info.voyage_end_date }}</span>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="4"> <el-col :span="4">
<label>航次首席</label><span>MERY</span> <label>航次首席</label><span>{{ info.voyage_officer }}</span>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
</div> </div>
<div class="zhuti"> <div class="zhuti">
<div class="left"> <div class="left">
<div class="left1" :class="show ? 'active' : ''"> <div
<img v-if="!show" src="../../static/images/arrow.png" alt=""> class="left1"
v-for="(item,index) in listTab"
:key="index"
:class="currentTab == item.label ? 'active' : ''"
@click="selectTab(item)"
>
<img v-if="currentTab == item.label" src="../../static/images/arrow.png" alt="">
<img v-else src="../../static/images/arrow_a.png" alt=""> <img v-else src="../../static/images/arrow_a.png" alt="">
<p>数据文件</p> <p>{{ item.label }}</p>
</div>
<div class="left1" :class="show1 ? 'active' : ''">
<img v-if="!show1" src="../../static/images/arrow.png" alt="">
<img v-else src="../../static/images/arrow_a.png" alt="">
<p>文档报告</p>
</div>
<div class="left1" :class="show2 ? 'active' : ''">
<img v-if="!show2" src="../../static/images/arrow.png" alt="">
<img v-else src="../../static/images/arrow_a.png" alt="">
<p>数据来源信息</p>
</div>
<div class="left1" :class="show2 ? 'active' : ''">
<img v-if="!show2" src="../../static/images/arrow.png" alt="">
<img v-else src="../../static/images/arrow_a.png" alt="">
<p>数据引用信息</p>
</div>
<div class="left1" :class="show2 ? 'active' : ''">
<img v-if="!show2" src="../../static/images/arrow.png" alt="">
<img v-else src="../../static/images/arrow_a.png" alt="">
<p>XML元数据文件</p>
</div> </div>
</div> </div>
<div class="list"> <div class="list">
<el-row type="flex" justify="space-between"> <!-- 数据样品类型-->
<el-col :span="20"> <el-table v-if="currentTab == '数据样品类型'" stripe :data="datasetArray" :header-cell-style="{ background: '#dddfe6',color: '#555960',textAlign: 'center' }" :cell-style="{ textAlign: 'center' }">
<el-checkbox v-model="checkAll" :indeterminate="isIndeterminate" @change="handleCheckAllChange">全选</el-checkbox> <el-table-column prop="dataset_name" label="数据集名称"/>
<el-table-column prop="platform_type" label="平台类型" />
</el-col> <el-table-column prop="equipment_type" label="设备类型" />
<el-col :span="4"> <el-table-column prop="data_type" label="数据样品类型" />
<el-button type="primary" @click="download">下载所选文件</el-button> <el-table-column prop="job_type" label="作业类型" />
</el-table>
</el-col> <!-- 设备类型-->
</el-row> <el-table v-if="currentTab == '设备类型'" stripe :data="equipmentArray" :header-cell-style="{ background: '#dddfe6',color: '#555960',textAlign: 'center' }" :cell-style="{ textAlign: 'center' }">
<div style="margin: 15px 0;" /> <el-table-column prop="equipment_type" label="设备类型" />
<el-checkbox-group v-model="checkedCities" @change="handleCheckedCitiesChange"> <el-table-column prop="equipment_alias" label="简称" />
<el-table-column prop="equipment_total" label="频次" />
<el-checkbox v-for="item in cities" :key="item.name" :label="item.name"> </el-table>
<div> <!-- 参航人员-->
<span>{{ item.name }}</span> <el-table v-if="currentTab == '参航人员'" stripe :data="memberArray" :header-cell-style="{ background: '#dddfe6',color: '#555960',textAlign: 'center' }" :cell-style="{ textAlign: 'center' }">
<div class="data_s"> <el-table-column prop="member_name" label="参航人员" />
<label for="">Size:</label><span>{{ item.size }}</span> <el-table-column prop="member_unit" label="单位" />
<label for="">Format:</label><span>{{ item.format }}</span> <el-table-column prop="member_birthday" label="出生日期" />
<el-table-column prop="member_dept" label="岗位" />
<a href="http://120.48.105.88:8081/dataDetails/296c1ff351224b3d8a4b856592c0fb67" target="_blank">详情</a> </el-table>
</div>
</div>
</el-checkbox>
</el-checkbox-group>
</div> </div>
</div> </div>
@ -117,12 +91,12 @@
</div> </div>
</div> </div>
</div> </div>
<!-- <div>
</div> -->
</template> </template>
<script> <script>
import { regInfo } from '@/api/dataSearch'
export default { export default {
name: 'DataDetail', name: 'DataDetail',
components: { components: {
@ -130,54 +104,48 @@ export default {
}, },
data() { data() {
return { return {
checkAll: false, title: 'SY510-TXS-YS-01',
checkedCities: [], listTab: [
cities: [
{ {
name: 'SY510-TXS-YS-01_clip1.grd', label: '数据样品类型',
size: '12', value: '1'
format: 'NetCDF'
}, },
{ {
name: 'SY510-TXS-YS-01_clip2.grd', label: '设备类型',
size: '12', value: '1'
format: 'NetCDF' },{
}, label: '参航人员',
{ value: '1'
name: 'SY510-TXS-YS-01_clip3.grd',
size: '12',
format: 'NetCDF'
},
{
name: 'SY510-TXS-YS-01_clip4.grd',
size: '12',
format: 'NetCDF'
} }
], ],
isIndeterminate: true, currentTab: '数据样品类型',
obj: { voyageName: '',
name: '数据样品SY510-TXS-YS-01' //
}, info: {},
show: false, datasetArray: [],
show1: true, equipmentArray: [],
show2: false memberArray: [],
platformArray: []
} }
}, },
created() {
this.voyageName = this.$route.query.voyage_name
this.getInfo()
},
methods: { methods: {
download() { selectTab(item) {
// this.currentTab = item.label
}, },
handleCheckAllChange(val) { //
debugger getInfo() {
const data = this.cities.map(item => item.name) regInfo({voyage_name: this.voyageName}).then(res => {
this.checkedCities = val ? data : [] console.log(res)
this.isIndeterminate = false this.info = res.map.voyage
}, this.datasetArray = res.map.DatasetArray
handleCheckedCitiesChange(value) { this.equipmentArray = res.map.EquipmentArray
const checkedCount = value.length this.memberArray = res.map.MemberArray
this.checkAll = checkedCount === this.cities.length this.platformArray = res.map.PlatformArray
this.isIndeterminate = checkedCount > 0 && checkedCount < this.cities.length })
} }
} }

View File

@ -589,8 +589,13 @@ export default {
autoZoom(){ autoZoom(){
this.viewer.zoomTo(this.viewer.entities) this.viewer.zoomTo(this.viewer.entities)
}, },
turnDeatilPage() { turnDeatilPage(item) {
this.$router.push({ name: 'dataDetail' }) this.$router.push({
name: 'dataDetail',
query: {
voyage_name: item.voyage_name
}
})
}, },
shousuo() { shousuo() {
this.show = true this.show = true

View File

@ -1,5 +1,5 @@
<template> <template>
<div id="" class="page-body"> <div class="page-body">
<div class="page-header"> <div class="page-header">
<h1 class="page-title">数据样品信息汇交</h1> <h1 class="page-title">数据样品信息汇交</h1>
<el-breadcrumb> <el-breadcrumb>
@ -9,7 +9,7 @@
</el-breadcrumb> </el-breadcrumb>
</div> </div>
<div class="filter-container"> <div class="filter-container">
<div class="checkBtn"> <div class="checkBtn flex">
<el-button <el-button
v-for="item in btnList" v-for="item in btnList"
:key="item.value" :key="item.value"
@ -17,6 +17,28 @@
size="medium" size="medium"
@click="handleBtn(item)" @click="handleBtn(item)"
>{{ item.label }}</el-button> >{{ item.label }}</el-button>
<el-upload
class="upload-btn"
ref="upload"
action="action"
:multiple="false"
:show-file-list="false"
:http-request="uploadDataset"
:before-upload="beforeUploadDataset"
>
<el-button :loading="loadingDataset">批量导入样品</el-button>
</el-upload>
<el-upload
class="upload-btn"
ref="upload"
action="action"
:multiple="false"
:show-file-list="false"
:http-request="uploadDiving"
:before-upload="beforeUploadDiving"
>
<el-button :loading="loadingDiving">批量导入下潜轨迹</el-button>
</el-upload>
</div> </div>
</div> </div>
<!--新增数据集--> <!--新增数据集-->
@ -37,6 +59,7 @@ import AddData from '@/views/dataTransfer/sampleViews/AddData'
import DataList from '@/views/dataTransfer/sampleViews/DataList' import DataList from '@/views/dataTransfer/sampleViews/DataList'
import LineList from '@/views/dataTransfer/sampleViews/LineList' import LineList from '@/views/dataTransfer/sampleViews/LineList'
import StationList from '@/views/dataTransfer/sampleViews/StationList' import StationList from '@/views/dataTransfer/sampleViews/StationList'
import { uploadDataset, uploadDiving } from '@/api/dataTransfer'
export default { export default {
name: 'SampleDataset', name: 'SampleDataset',
components: { AddData, DataList, LineList, StationList }, components: { AddData, DataList, LineList, StationList },
@ -58,19 +81,13 @@ export default {
{ {
label: '站位数据样品汇交', label: '站位数据样品汇交',
value: 'station' value: 'station'
},
{
label: '批量导入样品',
value: 'sample'
},
{
label: '批量导入下潜轨迹',
value: 'track'
} }
], ],
currentValue: 'add', currentValue: 'list',
row: {}, loadingDataset: false,
id: null textDataset: '批量导入样品',
loadingDiving: false,
textDiving: '批量导入样品'
} }
}, },
created() { created() {
@ -103,8 +120,59 @@ export default {
} }
this.$store.commit('SET_ROW', row) this.$store.commit('SET_ROW', row)
this.$store.commit('SET_ID', row.tsy_id) this.$store.commit('SET_ID', row.tsy_id)
} },
beforeUploadDataset(file) { //
const type = file.name.split('.')[1]
if (type !== 'xlsx') {
this.$message({ type: 'error', message: '只支持xlsx文件格式' })
return false
}
},
uploadDataset(param) {
this.loadingDataset = true
this.textDataset = '数据处理中'
const formData = new FormData()
formData.append('file', param.file)
uploadDataset(formData).then(res => {
if (res.errorCode === 0) {
this.loadingDataset = false
this.textDataset = '批量导入样品'
this.$message.success('导入成功!')
this.currentValue = 'list'
}
})
},
beforeUploadDiving(file) { //
const type = file.name.split('.')[1]
if (type !== 'txt') {
this.$message({ type: 'error', message: '只支持txt文件格式' })
return false
}
},
uploadDiving(param) {
this.loadingDiving = true
this.textDiving = '数据处理中'
const formData = new FormData()
formData.append('file', param.file)
uploadDiving(formData).then(res => {
if (res.errorCode === 0) {
this.loadingDiving = false
this.textDiving = '批量导入下潜轨迹'
this.$message.success('导入成功!')
this.currentValue = 'list'
}
})
},
} }
} }
</script> </script>
<style scoped lang="scss">
.flex {
display: flex;
.upload-btn {
margin-left: 10px;
}
}
</style>

View File

@ -0,0 +1,15 @@
<template>
<div>
</div>
</template>
<script>
export default {
name: 'DiveTrack'
}
</script>
<style scoped>
</style>

View File

@ -2,7 +2,16 @@
<div> <div>
<div class="bar"> <div class="bar">
<span class="track-name">潜次 [{{ diving_sn }}]</span> <span class="track-name">潜次 [{{ diving_sn }}]</span>
<el-button type="primary">上传轨迹文件</el-button> <el-upload
ref="upload"
action="action"
:multiple="false"
:show-file-list="false"
:http-request="uploadBpmn"
:before-upload="beforeUpload"
>
<el-button :loading="loading" type="primary">{{ btnText }}</el-button>
</el-upload>
</div> </div>
<el-form ref="form" :model="form" size="small" label-width="200px"> <el-form ref="form" :model="form" size="small" label-width="200px">
<el-row> <el-row>
@ -61,7 +70,7 @@
</template> </template>
<script> <script>
import { trackMap } from '@/api/dataTransfer' import { trackMap, uploadTrack } from '@/api/dataTransfer'
export default { export default {
name: 'TrackInfo', name: 'TrackInfo',
@ -79,7 +88,9 @@ export default {
track_lon: '', track_lon: '',
track_lat: '' track_lat: ''
} }
} },
loading: false,
btnText: '上传轨迹文件'
} }
}, },
computed: { computed: {
@ -93,7 +104,7 @@ export default {
return this.$store.state.sample.datasetRow.diving_sn return this.$store.state.sample.datasetRow.diving_sn
}, },
diving_track_file() { diving_track_file() {
return this.$store.state.sample.datasetRow.diving_track_file return this.$store.state.sample.trackName || this.$store.state.sample.datasetRow.diving_track_file
} }
}, },
created() { created() {
@ -107,6 +118,32 @@ export default {
this.form = map this.form = map
} }
}) })
},
beforeUpload(file) { //
const type = file.name.split('.')[1]
if (type !== 'txt') {
this.$message({ type: 'error', message: '只支持txt文件格式' })
return false
}
},
uploadBpmn(param) {
this.loading = true
this.btnText = '数据处理中'
const formData = new FormData()
formData.append('file', param.file)
formData.append('dataset_id', this.id)
uploadTrack(formData).then(res => {
if (res.errorCode === 0) {
this.loading = false
this.btnText = '上传轨迹文件'
this.$message.success('上传成功!')
this.$store.commit('SET_TRACK_NAME', res.entity)
this.getTrackInfo()
}
}).cache(() => {
this.loading = false
this.btnText = '上传轨迹文件'
})
} }
} }
} }

View File

@ -17,26 +17,26 @@
<div class="shuru"> <div class="shuru">
<div class="shuru1"> <div class="shuru1">
<img src="../../static/images/yonghu.png" alt=""> <img src="../../static/images/yonghu.png" alt="">
<input v-model="name" type="text" placeholder="请输入用户名"> <input v-model="loginName" type="text" placeholder="请输入用户名">
</div> </div>
<div class="shuru1"> <div class="shuru1">
<img src="../../static/images/mima.png" alt=""> <img src="../../static/images/mima.png" alt="">
<input v-model="password" type="text" placeholder="请输入面膜"> <input v-model="loginPass" type="password" placeholder="请输入密码">
</div>
<div class="shuru2">
<img class="tt" src="../../static/images/tucode.png" alt="">
<input v-model="code" type="text" placeholder="请输入验证码">
<img class="tt2" src="../../static/images/tucode1.png" alt="">
</div> </div>
<!-- <div class="shuru2">-->
<!-- <img class="tt" src="../../static/images/tucode.png" alt="">-->
<!-- <input v-model="loginCode" type="text" placeholder="请输入验证码">-->
<!-- <img class="tt2" src="../../static/images/tucode1.png" alt="">-->
<!-- </div>-->
</div> </div>
<div class="denglu"> <div class="denglu">
<el-button>重置</el-button> <el-button @click="onReset">重置</el-button>
<el-button type="primary" @click="denglu">登录</el-button> <el-button type="primary" @click="onLogin">登录</el-button>
</div>
<div class="dibu">
<p>没有账号</p>
<span>立即注册</span>
</div> </div>
<!-- <div class="dibu">-->
<!-- <p>没有账号</p>-->
<!-- <span>立即注册</span>-->
<!-- </div>-->
</div> </div>
</div> </div>
</div> </div>
@ -44,20 +44,38 @@
</template> </template>
<script> <script>
import { login } from '@/api/login'
export default { export default {
name: 'Login', name: 'Login',
data() { data() {
return { return {
name: '', loginName: '',
password: '', loginPass: '',
code: '' loginCode: '1234'
} }
}, },
methods: { methods: {
denglu() { onLogin() {
this.$router.push({ if (!this.loginName) return this.$message.warning('请输入用户名')
name: 'index' if (!this.loginPass) return this.$message.warning('请输入密码')
const psd = this.loginPass
login({
loginName: this.loginName,
loginPass: md5(psd),
loginCode: this.loginCode
}).then(res => {
if (res.success) {
this.$router.back()
} else {
this.$message.error(res.errorMsg)
}
}) })
},
onReset() {
this.loginName = ''
this.loginPass = ''
this.loginCode = '1234'
} }
} }
} }
@ -91,7 +109,7 @@ export default {
} }
.login { .login {
width: 540px; width: 540px;
height: 640px; //height: 640px;
background: #fff; background: #fff;
border-radius: 10px; border-radius: 10px;
box-sizing: border-box; box-sizing: border-box;

View File

@ -428,7 +428,7 @@ export default {
}, },
init() { init() {
this.currentPage = 1 this.currentPage = 1
this.getData() // this.getData()
}, },
async getData() { async getData() {
if (this.search.voyageName.length && !validateSpecialChart(this.search.voyageName)) { if (this.search.voyageName.length && !validateSpecialChart(this.search.voyageName)) {