diff --git a/src/utils/upload.js b/src/utils/upload.js index 82f1619..8d31d10 100644 --- a/src/utils/upload.js +++ b/src/utils/upload.js @@ -47,7 +47,8 @@ export function archivesUpload(api, file, categoryId, archivesId, fileJsonString // 收集库 - 目录上传 export function catalogUpload(api, file, fondsId) { var data = new FormData() - data.append('file', file) + // data.append('file', file) + data.append('upfilePath', file) data.append('fondsId', fondsId) const config = { headers: { 'Authorization': getToken() } @@ -78,17 +79,19 @@ export function modelUpload(api, file, name) { } // 收集库 - 批量挂接 -export function batchMountUpload(api, file, params) { +// export function batchMountUpload(api, file, params) { +export function batchMountUpload(api, params) { var data = new FormData() - for (const item in file) { // 现在 - data.append('file', file[item]) - } + // for (const item in file) { // 现在 + // data.append('file', file[item]) + // } data.append('categoryId', params.categoryId) data.append('mountType', params.mountType) data.append('checkRepeatType', params.checkRepeatType) data.append('matchingMode', params.matchingMode) data.append('fields', params.fields) data.append('fondsId', params.fondsId) + data.append('upfilePath', params.upfilePath) const config = { headers: { 'Authorization': getToken() diff --git a/src/views/collectReorganizi/batchConnection/index.vue b/src/views/collectReorganizi/batchConnection/index.vue index 1485b1c..46a3947 100644 --- a/src/views/collectReorganizi/batchConnection/index.vue +++ b/src/views/collectReorganizi/batchConnection/index.vue @@ -2,9 +2,9 @@
-
+
-

{{ currentCategory && currentCategory.cnName }}

+

{{ selectedCategory && selectedCategory.cnName }}

- +
@@ -104,7 +104,7 @@ export default { }, data() { return { - currentCategory: null, + selectedCategory: null, blurryTime: null, formVisible: false } @@ -114,11 +114,11 @@ export default { 'baseApi' ]), collectLevel() { - if (this.currentCategory.arrangeType === 1) { + if (this.selectedCategory.arrangeType === 1) { return 3 - } else if (this.currentCategory.arrangeType === 2) { + } else if (this.selectedCategory.arrangeType === 2) { return 2 - } else if (this.currentCategory.arrangeType === 3) { + } else if (this.selectedCategory.arrangeType === 3) { return 1 } return null @@ -153,7 +153,7 @@ export default { this.crud.refresh() }, handleNodeClick(data) { - this.currentCategory = data + this.selectedCategory = data if (data) { this.crud.query.categoryId = data.id this.crud.query.fondsId = data.fondsId diff --git a/src/views/collectReorganizi/batchConnection/module/form.vue b/src/views/collectReorganizi/batchConnection/module/form.vue index 626d512..c2c8863 100644 --- a/src/views/collectReorganizi/batchConnection/module/form.vue +++ b/src/views/collectReorganizi/batchConnection/module/form.vue @@ -40,20 +40,22 @@ /> - -
+ +
- {{ item.name }} + {{ item.file_name }}
+ + +
@@ -107,12 +109,14 @@ import { FetchInitCategoryInputFieldByPid } from '@/api/system/category/category import { FetchFindDetailsByProtocol, FetchFileByRemoteConnection } from '@/api/system/remoteConnection' import { batchMountUpload, remoteConnectiontUpload } from '@/utils/upload' import { mapGetters } from 'vuex' +import PreUpload from '../../../components/category/preUpload.vue' + export default { name: 'LocalHitch', - components: { }, + components: { PreUpload }, mixins: [crud()], props: { - currentCategory: { + selectedCategory: { type: Object, default: function() { return {} @@ -136,6 +140,7 @@ export default { filePath: null, fileRemote: null }, + upfilePath: null, fileList: [], typeOptions: [ { @@ -213,11 +218,11 @@ export default { 'baseApi' ]), collectLevel() { - if (this.currentCategory.arrangeType === 1) { + if (this.selectedCategory.arrangeType === 1) { return 3 - } else if (this.currentCategory.arrangeType === 2) { + } else if (this.selectedCategory.arrangeType === 2) { return 2 - } else if (this.currentCategory.arrangeType === 3) { + } else if (this.selectedCategory.arrangeType === 3) { return 1 } return null @@ -231,6 +236,22 @@ export default { opened() { this.getFieldCommon() }, + handleSuccessResource(res, fileName, jsonArrayToSend) { + console.log('handleSuccessResource', res[0]) + console.log('handleSuccessResource', fileName) + console.log('handleSuccessResource', jsonArrayToSend) + console.log('handleSuccessResource', jsonArrayToSend[0].fileJsonString) + + const fileJson = JSON.parse(jsonArrayToSend[0].fileJsonString) + fileJson[0].file_path = res[0] + fileJson[0].is_quote = null + fileJson[0].last_modified = jsonArrayToSend[0].last_modified + this.fileList = fileJson + this.upfilePath = res[0] + }, + handleErrorResource(res) { + console.log('handleErrorResource', res) + }, handleFile(event) { const files = event.target.files for (let i = 0; i < files.length; i++) { @@ -253,23 +274,23 @@ export default { } this.btnLoading = true this.$refs['form'].validate((valid) => { - console.log('this.currentCategory', this.currentCategory) + console.log('this.selectedCategory', this.selectedCategory) if (valid) { let newhitchRemark = this.hitchRemarkArray.map(item => item.replace(/^\$|\$$|\*$/g, '')) newhitchRemark = newhitchRemark.filter(item => item !== '') if (!this.connectionType) { const params = { - 'categoryId': this.currentCategory.id, + 'categoryId': this.selectedCategory.id, 'mountType': 1, // 挂接方式 1.本地挂接 2.远程挂接 3.上传目录 (目前只有1) 'checkRepeatType': this.form.checkRepeatType, 'matchingMode': this.form.matchingMode, 'fields': newhitchRemark, - 'fondsId': this.currentCategory.fondsId + 'fondsId': this.selectedCategory.fondsId, + 'upfilePath': this.upfilePath } console.log(params) batchMountUpload(this.baseApi + '/api/collect/batchMount', - this.fileList, params ).then(res => { if (res.data.code === 200) { @@ -287,8 +308,8 @@ export default { 'cAddress': this.form.filePath.caddress, 'cPassword': this.form.filePath.cpassword, 'cPort': this.form.filePath.cport, - 'categoryId': this.currentCategory.id, - 'fondsId': this.currentCategory.fondsId, + 'categoryId': this.selectedCategory.id, + 'fondsId': this.selectedCategory.fondsId, 'checkRepeatType': this.form.checkRepeatType, 'matchingMode': this.form.matchingMode, 'fields': newhitchRemark, @@ -317,7 +338,7 @@ export default { }, getFieldCommon() { const params = { - 'categoryId': this.currentCategory.id, + 'categoryId': this.selectedCategory.id, 'categoryLevel': this.collectLevel } FetchInitCategoryInputFieldByPid(params).then(data => { @@ -461,5 +482,17 @@ export default { } } } +.upload-wm{ + height: 100px; +} +::v-deep .uploader-big{ + margin-left: 0 !important; +} +::v-deep .upload_process_box{ + right: 0 !important; + left: 120px !important; + top: 0 !important; + width: 300px !important; +} diff --git a/src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue b/src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue index 6e659de..85d8e52 100644 --- a/src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue +++ b/src/views/collectReorganizi/collectionLibrary/module/collectHeader.vue @@ -1017,10 +1017,13 @@ export default { this.$refs.uploadOriginalRef.uploadVisible = true } else if (uploadType === 1) { this.$refs.uploadBigRef.uploadBigVisible = true + this.isCatalogUpload = false this.$refs.uploadBigRef.fileList = [] } else if (uploadType === 2) { - this.$refs.uploadOriginalRef.uploadTitle = '原文目录上传' - this.$refs.uploadOriginalRef.uploadVisible = true + this.$refs.uploadBigRef.uploadTitle = '原文目录上传' + this.$refs.uploadBigRef.uploadBigVisible = true + this.isCatalogUpload = true + this.$refs.uploadBigRef.fileList = [] } if (this.$refs.uploadOriginalRef.uploadVisible) { this.$refs.uploadOriginalRef.uploadType = uploadType diff --git a/src/views/collectReorganizi/collectionLibrary/module/uploadOriginal/bigUpload.vue b/src/views/collectReorganizi/collectionLibrary/module/uploadOriginal/bigUpload.vue index ec21f62..a4a3c50 100644 --- a/src/views/collectReorganizi/collectionLibrary/module/uploadOriginal/bigUpload.vue +++ b/src/views/collectReorganizi/collectionLibrary/module/uploadOriginal/bigUpload.vue @@ -1,7 +1,7 @@