修改文件上传

This commit is contained in:
qq787203167
2022-03-07 15:18:31 +08:00
parent 3a07e28dcf
commit e22408e5e3
2 changed files with 8 additions and 6 deletions
+4 -2
View File
@@ -3,7 +3,7 @@
<a-upload name="file" :showUploadList="false" <a-upload name="file" :showUploadList="false"
class="upload-text" class="upload-text"
:multiple="false" :headers="tokenHeader" :multiple="false" :headers="tokenHeader"
:action="url.importZipUrl" :action="importUrl"
@change="handleImportZip" @change="handleImportZip"
accept=".zip"> accept=".zip">
<a-icon type="import" :rotate="270"/> <a-icon type="import" :rotate="270"/>
@@ -15,6 +15,7 @@
<script> <script>
import Vue from 'vue' import Vue from 'vue'
import { ACCESS_TOKEN } from "@/store/mutation-types" import { ACCESS_TOKEN } from "@/store/mutation-types"
import eventBUs from '../../common/event'
export default { export default {
name: 'index', name: 'index',
props:{ props:{
@@ -26,6 +27,7 @@
data(){ data(){
return{ return{
tokenHeader: {'X-Access-Token': Vue.ls.get(ACCESS_TOKEN)}, tokenHeader: {'X-Access-Token': Vue.ls.get(ACCESS_TOKEN)},
importUrl:window._CONFIG['domianURL']+this.url.importZipUrl,
} }
}, },
mounted() { mounted() {
@@ -59,7 +61,7 @@
} else { } else {
this.$message.success(info.file.response.message || `${info.file.name} 文件导入成功`) this.$message.success(info.file.response.message || `${info.file.name} 文件导入成功`)
} }
this.loadData() eventBUs.$emit('searchReset')
this.spinning = false this.spinning = false
} else { } else {
this.$message.error(`${info.file.name} ${info.file.response.message}`); this.$message.error(`${info.file.name} ${info.file.response.message}`);
@@ -120,7 +120,7 @@
getDocumentInfo: 'document/bussDocumentLibraryEO/getDocumentInfoById', //查看 getDocumentInfo: 'document/bussDocumentLibraryEO/getDocumentInfoById', //查看
deleteBatch: 'document/bussDocumentLibraryEO/deleteBatch', //删除 deleteBatch: 'document/bussDocumentLibraryEO/deleteBatch', //删除
pullMessage: 'document/bussDocumentLibraryEO/pullMessage',//推送 pullMessage: 'document/bussDocumentLibraryEO/pullMessage',//推送
importZipUrl: 'document/bussDocumentLibraryEO/importZip'//导入 importZipUrl: '/document/bussDocumentLibraryEO/importZip'//导入
}, },
idList: [] idList: []
} }
@@ -182,12 +182,12 @@
}, },
//推送 //推送
handleCompare() { handleCompare() {
if (this.idList.length > 0){ if (this.idList.length > 0) {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.libraryPushRef.visible = true this.$refs.libraryPushRef.visible = true
this.$refs.libraryPushRef.tableKey = this.idList this.$refs.libraryPushRef.tableKey = this.idList
}) })
}else{ } else {
this.$message.warning(this.$t('selectLeastOne')) this.$message.warning(this.$t('selectLeastOne'))
} }
}, },
@@ -272,7 +272,7 @@
path: '/docManage/library/detail', path: '/docManage/library/detail',
query: item query: item
}) })
window.open(newUrl.href, "_blank"); window.open(newUrl.href, '_blank')
} }
} }
} }