|
@@ -1,10 +1,20 @@
|
|
|
<template>
|
|
|
<Dialog loading="loading" v-model="dialogVisible" title="标本信息导入" width="600">
|
|
|
- <el-alert title="需确保图片命名规范,不与系统中旧图片命名重复,否则将会覆盖原图片。" type="warning" style="margin-bottom: 10px"/>
|
|
|
+ <el-alert title="需确保图片命名规范,上传图片时将覆盖原有的图片" type="warning" style="margin-bottom: 10px"/>
|
|
|
+ <el-form-item label="标本类型" prop="specimenType">
|
|
|
+ <el-select v-model="updateType" placeholder="请选择标本类型">
|
|
|
+ <el-option label="总表" :value="-1"/>
|
|
|
+ <el-option label="矿物" value="0"/>
|
|
|
+ <el-option label="岩石" value="1"/>
|
|
|
+ <el-option label="矿石" value="2"/>
|
|
|
+ <el-option label="化石" value="3"/>
|
|
|
+ <el-option label="陨石" value="4"/>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-upload
|
|
|
ref="uploadRef"
|
|
|
v-model:file-list="fileList"
|
|
|
- :action=" importUrl + '?updateSupport=' + updateSupport"
|
|
|
+ :action=" importUrl + '?updateSupport=' + updateSupport+ '&updateType=' + updateType"
|
|
|
:auto-upload="false"
|
|
|
:disabled="formLoading"
|
|
|
:headers="uploadHeaders"
|
|
@@ -39,7 +49,7 @@
|
|
|
ref="uploadimageRef"
|
|
|
v-model:file-list="imageList"
|
|
|
drag
|
|
|
- :action="importUrl + '?updateSupport=' + updateSupport + '&updateType=' + updateType"
|
|
|
+ :action="importUrl + '?updateSupport=' + updateSupport + '&updateType=' + updateType + '&updateType=' + updateType"
|
|
|
:on-success="submitImageSuccess"
|
|
|
:auto-upload="false"
|
|
|
:disabled="formLoading"
|
|
@@ -78,6 +88,7 @@ import {SpecimenInfoApi} from "@/api/museums/specimeninfo";
|
|
|
import {ref, nextTick} from 'vue';
|
|
|
import {UploadFilled} from "@element-plus/icons-vue";
|
|
|
import {useUpload} from "@/components/UploadFile/src/useUpload";
|
|
|
+import {getIntDictOptions, DICT_TYPE} from '@/utils/dict'
|
|
|
|
|
|
defineOptions({name: 'SpecimenImportForm'})
|
|
|
const loading = ref(true) // 列表的加载中
|
|
@@ -134,7 +145,7 @@ const submitForm = async () => {
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
- const response = await axios.post(importUrl + '?updateSupport=' + updateSupport.value
|
|
|
+ const response = await axios.post(importUrl + '?updateSupport=' + updateSupport.value + '&updateType=' + updateType.value
|
|
|
+ '&updateType=' + updateType.value, formData, {
|
|
|
headers: {
|
|
|
...uploadHeaders.value,
|
|
@@ -238,7 +249,19 @@ const handleExceed = (): void => {
|
|
|
/** 下载模板操作 */
|
|
|
const importTemplate = async () => {
|
|
|
const res = await SpecimenInfoApi.importSpecimenInfoTemplate(updateType.value)
|
|
|
- download.excel(res, '标本批量导入模版.xls')
|
|
|
+ if(updateType.value == -1){
|
|
|
+ download.excel(res, '标本批量导入模版.xls')
|
|
|
+ }else if(updateType.value == 0){
|
|
|
+ download.excel(res, '矿物批量导入模版.xls')
|
|
|
+ }else if(updateType.value == 1){
|
|
|
+ download.excel(res, '岩石-矿石批量导入模版.xls')
|
|
|
+ }else if(updateType.value == 2){
|
|
|
+ download.excel(res, '岩石-矿石批量导入模版.xls')
|
|
|
+ }else if(updateType.value == 3){
|
|
|
+ download.excel(res, '化石批量导入模版.xls')
|
|
|
+ }else if(updateType.value == 4){
|
|
|
+ download.excel(res, '陨石批量导入模版.xls')
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|