Browse Source

Merge remote-tracking branch 'origin/develop' into develop

scorpioyq 2 years ago
parent
commit
49c98bc4c8

+ 7 - 1
src/views/home/component/current.vue

@@ -130,6 +130,7 @@ export default {
   },
   data() {
     return {
+      dispatchParams: null,
       authorizeShow: false,
       addShow: false,
       show: false,
@@ -162,6 +163,7 @@ export default {
     return { permissions, user }
   },
   created() {
+    this.dispatchParams = this.$route.query
     this.folderName = this.$route.query.folderName
     this.folderNumber = this.$route.query.folderNumber
     this.isAccess = this.$route.query.isAccess
@@ -215,7 +217,11 @@ export default {
       })
     },
     addFile() {
-      this.$api.project.fileAdd(this.fileList).then(res => {
+      let data = { files: this.fileList }
+      if (this.dispatchParams) {
+        data = Object.assign(data, this.dispatchParams)
+      }
+      this.$api.project.fileAdd(data).then(res => {
         if (res.code === 200) {
           this.show = false
           this.$emit('reFiles')

+ 6 - 1
src/views/home/component/files_list.vue

@@ -220,6 +220,7 @@ export default {
   },
   data() {
     return {
+      dispatchParams: null,
       show: false,
       applyShow: false,
       files: [],
@@ -355,7 +356,11 @@ export default {
       })
     },
     addFile() {
-      this.$api.project.fileAdd(this.fileList).then(res => {
+      let data = { files: this.fileList }
+      if (this.query) {
+        data = Object.assign(data, this.query)
+      }
+      this.$api.project.fileAdd(data).then(res => {
         if (res.code === 200) {
           this.show = false
           this.$emit('reFiles')

+ 20 - 11
src/views/home/component/folder_list.vue

@@ -305,19 +305,28 @@ export default {
     },
     fileView(item) {
       if (this.type === 0) {
-        console.log(item)
+        const data = {
+          id: item.id,
+          projectId: item.projectId,
+          ownerId: this.ownerId,
+          dictKey: item.dictKey,
+          projectStageId: item.stageId,
+          isAccess: item.isAccess,
+          folderName: item.title,
+          folderNumber: item.fileAmount
+        }
+        let dispatchQuery = {}
+        if (this.dispatchParams) {
+          dispatchQuery = {
+            dispatchType: this.dispatchParams.dispatchType,
+            type: this.dispatchParams.type,
+            year: this.dispatchParams.year,
+            month: this.dispatchParams.month
+          }
+        }
         this.$router.push({
           path: '/home/files',
-          query: {
-            id: item.id,
-            projectId: item.projectId,
-            ownerId: this.ownerId,
-            dictKey: item.dictKey,
-            projectStageId: item.stageId,
-            isAccess: item.isAccess,
-            folderName: item.title,
-            folderNumber: item.fileAmount
-          }
+          query: Object.assign(data, dispatchQuery)
         })
       } else {
         this.$router.push({