diff --git a/src/api/archivesManage/archivesList.js b/src/api/archivesManage/archivesList.js index 5d95330..a3fb8d1 100644 --- a/src/api/archivesManage/archivesList.js +++ b/src/api/archivesManage/archivesList.js @@ -87,6 +87,15 @@ export function FetchInitArchiveFilesView(params) { }) } +// 上传档案附件 +export function FetchUploadFile(parameter) { + return request({ + url: 'api/archives/uploadFile', + method: 'post', + data: parameter + }) +} + // 编辑附件 export function FetchEditFile(parameter) { return request({ diff --git a/src/assets/styles/archives-manage.scss b/src/assets/styles/archives-manage.scss index bf44ada..509747d 100644 --- a/src/assets/styles/archives-manage.scss +++ b/src/assets/styles/archives-manage.scss @@ -539,4 +539,17 @@ $arcCyan: #0FBED9; max-height: calc(100vh - 410px); overflow: hidden; overflow-y: scroll; +} + +.upload-btn{ + position: relative; + margin-right: 10px; + overflow: hidden; + #upFile{ + position: absolute; + left: 0; + top: 0; + opacity: 0; + height: 34px; + } } \ No newline at end of file diff --git a/src/utils/index.js b/src/utils/index.js index f80cab8..8c5034e 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -390,8 +390,7 @@ export function downloadFile(obj, name, suffix) { // new - 导出 - TEST export function exportFile(StingParams, fileName) { - const baseURL = process.env.NODE_ENV === 'production' ? process.env.VUE_APP_BASE_API : 'http://192.168.99.84:7070/' - const url = baseURL + StingParams + const url = StingParams const link = document.createElement('a') link.style.display = 'none' link.href = url @@ -401,3 +400,15 @@ export function exportFile(StingParams, fileName) { link.click() document.body.removeChild(link) } + +// 获取当前日期时间 +export function getCurrentTime() { + const yy = new Date().getFullYear() + const mm = new Date().getMonth() + 1 + const dd = new Date().getDate() + const hh = new Date().getHours() + const mf = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes() : new Date().getMinutes() + const ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds() : new Date().getSeconds() + const time = yy + '-' + mm + '-' + dd + ' ' + hh + ':' + mf + ':' + ss + return time +} diff --git a/src/utils/upload.js b/src/utils/upload.js index 945414b..6ebd392 100644 --- a/src/utils/upload.js +++ b/src/utils/upload.js @@ -9,3 +9,13 @@ export function upload(api, file) { } return axios.post(api, data, config) } + +export function archivesUpload(api, file, categoryId) { + var data = new FormData() + data.append('file', file) + data.append('categoryId', categoryId) + const config = { + headers: { 'Authorization': getToken() } + } + return axios.post(api, data, config) +} diff --git a/src/views/archivesManage/archivesList/index.vue b/src/views/archivesManage/archivesList/index.vue index c173597..a482dc7 100644 --- a/src/views/archivesManage/archivesList/index.vue +++ b/src/views/archivesManage/archivesList/index.vue @@ -244,11 +244,34 @@ export default { this.$refs.anjuan.getTableList() }) }, - getSelections(data) { - this.anjuanSelection = data - this.$nextTick(() => { - this.$refs.file.getTableList() - }) + getSelections(data, selectData) { + if (selectData) { + if (selectData.length > 1 || selectData.length === 0) { + this.anjuanSelection = {} + this.$refs.file.junneiData = [] + } else if (selectData.length === 1) { + this.anjuanSelection = selectData[0] + this.$nextTick(() => { + if (this.$refs.file) { + this.$refs.file.getTableList() + } + }) + } else { + this.anjuanSelection = data + this.$nextTick(() => { + if (this.$refs.file) { + this.$refs.file.getTableList() + } + }) + } + } else { + this.anjuanSelection = data + this.$nextTick(() => { + if (this.$refs.file) { + this.$refs.file.getTableList() + } + }) + } }, // 智能分类 handleIntellNodeClick(val) { diff --git a/src/views/archivesManage/archivesList/module/archivesAnjuan/index.vue b/src/views/archivesManage/archivesList/module/archivesAnjuan/index.vue index a1d7518..9bf0a3c 100644 --- a/src/views/archivesManage/archivesList/module/archivesAnjuan/index.vue +++ b/src/views/archivesManage/archivesList/module/archivesAnjuan/index.vue @@ -36,7 +36,8 @@
- 装盒 + + 装盒 分卷装盒 @@ -179,6 +180,7 @@ import qs from 'qs' import { del, FetchTableDisplayFields, FetchInitArchivesView, FetchFormDisplayFields, FetchArchivesDetails, FetchArchivesMetadata } from '@/api/archivesManage/archivesList' import { header, form } from '@crud/crud' +import { mapGetters } from 'vuex' import { exportFile } from '@/utils/index' // import { initData } from '@/api/data' // import crudOperation from '@crud/CRUD.operation' @@ -271,6 +273,11 @@ export default { archivesDetailsMetadata: '' } }, + computed: { + ...mapGetters([ + 'baseApi' + ]) + }, watch: { selectedCategory: function(newValue, oldValue) { }, @@ -293,8 +300,9 @@ export default { methods: { doExport(fileName = '未知文件') { this.crud.downloadLoading = true + console.log(this.selectedCategory) if (this.selectedCategory.pid !== '0') { - this.parentsId = this.categoryId + this.parentsId = this.selectedCategory.pid } else { this.parentsId = null } @@ -302,7 +310,8 @@ export default { 'categoryId': this.selectedCategory.id, 'parentsId': this.parentsId } - exportFile('api/archives/exportArchives?' + qs.stringify(params)) + console.log(params) + exportFile(this.baseApi + '/api/archives/exportArchives?' + qs.stringify(params)) this.crud.downloadLoading = false }, // 搜索-select @@ -413,8 +422,12 @@ export default { }, // table - 当前选中得row clickRowHandler(row) { - // this.$refs.table.toggleRowSelection(row) - this.$emit('getSelections', row) + this.$refs.table.clearSelection() + this.$refs.table.toggleRowSelection(row) + this.selections = this.crud.selections + this.isAnjuan = this.crud.selections.length !== 1 + this.$emit('getJnInAjBtnState', this.isAnjuan) + this.$emit('getSelections', row, null) }, // 触发单选 handleCurrentChange(selection, row) { @@ -422,6 +435,7 @@ export default { // 判断案卷内的卷内-新增btn-状态 this.isAnjuan = selection.length !== 1 this.$emit('getJnInAjBtnState', this.isAnjuan) + this.$emit('getSelections', row, selection) }, // 选择删除 toDelete(data) { diff --git a/src/views/archivesManage/archivesList/module/archivesInfo/index.vue b/src/views/archivesManage/archivesList/module/archivesInfo/index.vue index b7ec3ee..3d279b1 100644 --- a/src/views/archivesManage/archivesList/module/archivesInfo/index.vue +++ b/src/views/archivesManage/archivesList/module/archivesInfo/index.vue @@ -20,7 +20,7 @@
- +
@@ -59,6 +59,12 @@ export default {
       default: function() {
         return ''
       }
+    },
+    doubleCurrentRow: {
+      type: Object,
+      default: function() {
+        return {}
+      }
     }
   },
   data() {
@@ -106,7 +112,7 @@ export default {
       }
       return output.join('')
     },
-    // ---xml格式化操作--
+    // xml格式化
     showXml(str) {
       var that = this
       var text = str
diff --git a/src/views/archivesManage/archivesList/module/archivesJuannei/index.vue b/src/views/archivesManage/archivesList/module/archivesJuannei/index.vue
index 2640344..3b819a0 100644
--- a/src/views/archivesManage/archivesList/module/archivesJuannei/index.vue
+++ b/src/views/archivesManage/archivesList/module/archivesJuannei/index.vue
@@ -10,7 +10,7 @@
         
         删除
         
-        导出
+        导出
         
         上传附件
       
@@ -122,17 +122,14 @@ - +
- - +
@@ -142,6 +139,7 @@ import qs from 'qs' import { del, FetchTableDisplayFields, FetchInitArchivesView, FetchFormDisplayFields, FetchArchivesDetails, FetchArchivesMetadata } from '@/api/archivesManage/archivesList' import { header, form } from '@crud/crud' +import { mapGetters } from 'vuex' import { exportFile } from '@/utils/index' // import { initData } from '@/api/data' // import crudOperation from '@crud/CRUD.operation' @@ -229,9 +227,15 @@ export default { totalSumAll: 0, yearGroup: [], archivesDetailsData: [], - archivesDetailsMetadata: '' + archivesDetailsMetadata: '', + doubleCurrentRow: null } }, + computed: { + ...mapGetters([ + 'baseApi' + ]) + }, watch: { selectedCategory: function(newValue, oldValue) { this.setCategory = newValue @@ -257,16 +261,16 @@ export default { methods: { doExport(fileName = '未知文件') { this.crud.downloadLoading = true - if (this.selectedCategory.pid !== '0') { - this.parentsId = this.selectedCategory.pid + if (this.selectedCategory.isType !== 4) { + this.parentsId = this.anjuanSelection.id } else { this.parentsId = null } const params = { - 'categoryId': this.selectedCategory.id, + 'categoryId': this.categoryId, 'parentsId': this.parentsId } - exportFile('api/archives/exportArchives?' + qs.stringify(params)) + exportFile(this.baseApi + '/api/archives/exportArchives?' + qs.stringify(params)) this.crud.downloadLoading = false }, // 搜索-select @@ -366,6 +370,8 @@ export default { tableDoubleClick(row) { this.$refs.archivesInfo.archivesInfoVisible = true this.$refs.archivesInfo.archivesTabIndex = 0 + this.doubleCurrentRow = row + console.log(this.selectedCategory) const params = { categoryId: this.categoryId, archivesId: row.id @@ -436,9 +442,10 @@ export default { // 上传附件 uploadFile() { this.uploadFileVisible = true - }, - uploadFileSave() { - this.uploadFileVisible = false + this.arcId = this.selections[0].id + this.$nextTick(() => { + this.$refs.uploadFile.getFileList() + }) } } } diff --git a/src/views/archivesManage/archivesList/module/uploadFile/index.vue b/src/views/archivesManage/archivesList/module/uploadFile/index.vue index 3034dbf..265b6e9 100644 --- a/src/views/archivesManage/archivesList/module/uploadFile/index.vue +++ b/src/views/archivesManage/archivesList/module/uploadFile/index.vue @@ -3,14 +3,18 @@
- 新增 - + --> +
+ 添加 + +
删除 排序
@@ -26,21 +30,22 @@ > - - - - - + + + + + - - -