scorpio 2 роки тому
батько
коміт
1445b209a6

+ 8 - 0
src/api/resource/index.js

@@ -176,5 +176,13 @@ export default {
       '/blade-project-manage-v2/folder/v2/getFileAmountByFolderId',
       params
     )
+  },
+  /**
+   * 服务商触发消息发送 文件上传通知
+   * @param params
+   * @returns {Promise | Promise<unknown>}
+   */
+  send(params) {
+    return fetch('/blade-project-manage-v2/frontMessage/v2/sendMessage', params)
   }
 }

+ 23 - 1
src/components/upload-file/index.vue

@@ -165,13 +165,15 @@ export default {
       })
       this.$api.resource.fileSave(this.params).then(res => {
         if (res.code === 200) {
-          console.log(typeof res.data)
           if (res.msg.indexOf('存在重名文件,是否覆盖') === -1) {
             this.saveLibrary()
             this.$message.success('文件上传完成')
             this.$emit('on-success', this.resultList)
+            this.sendNotice(this.params.map(ele => ele.fileId).join(','))
             setTimeout(() => {
               this.drawer = false
+              this.resultList.length = 0
+              this.fileList.length = 0
             }, 3000)
           } else {
             // 重名
@@ -188,13 +190,33 @@ export default {
           this.saveLibrary()
           this.$message.success('文件上传完成')
           this.$emit('on-success', this.resultList)
+          this.sendNotice(this.params.map(ele => ele.fileId).join(','))
           setTimeout(() => {
             this.drawer = false
+            this.resultList.length = 0
+            this.fileList.length = 0
           }, 3000)
         } else {
           this.$message.error(res.msg)
         }
       })
+    },
+    sendNotice(ids) {
+      this.$confirm('文件已经上传完成,是否向对方发送通知?', '', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消'
+      }).then(res => {
+        if (res === 'confirm') {
+          this.$api.resource
+            .send({ ids, projectId: this.projectId })
+            .then(res => {
+              if (res.code === 200) {
+                console.log(res)
+              } else {
+              }
+            })
+        }
+      })
     }
   }
 }

+ 8 - 0
src/page/login.vue

@@ -390,8 +390,16 @@ export default {
           const first = res.data[0]
           if (first.children.length > 0) {
             this.$router.replace(first.children[0].path)
+            localStorage.setItem(
+              'data-type',
+              first.children[0].remark ? first.children[0].remark : 'project'
+            )
           } else {
             this.$router.replace(first.path)
+            localStorage.setItem(
+              'data-type',
+              first.remark ? first.remark : 'project'
+            )
           }
         }
       })

+ 0 - 1
src/views/home/component/dash.vue

@@ -109,7 +109,6 @@
           text
           @click="report(row)"
         >
-          {{ row.is_report === 1 ? '项目已上报' : '项目上报' }}
         </el-button>
         <el-button
           v-if="