Browse Source

fix 项目迁移

scorpio 2 years ago
parent
commit
d5d918f921

+ 4 - 3
src/views/home/component/authorize.vue

@@ -161,7 +161,7 @@ export default {
       }
       this.startTime = this.authorizeDate[0]
       this.endTime = this.authorizeDate[1]
-      const fileTmps = list.filter(sub => sub.type === '1').map(sub => {
+      const fileTmps = list.map(sub => {
         const item = { fileId: sub.id, startTime: this.startTime, endTime: this.endTime, status: sub.check }
         return item
       })
@@ -171,13 +171,14 @@ export default {
         endTime: this.endTime,
         status: this.check
       }]
-      const folderTmp = list.filter(sub => sub.type === '2').map(sub => {
+
+      const folderTmp = list.map(sub => {
         const item = { folderId: sub.id, startTime: this.startTime, endTime: this.endTime, status: sub.check }
         return item
       })
       this.$api.project.initCode({
         files: fileTmps,
-        folders: folder.concat(folderTmp),
+        folders: type === 1 ? folderTmp : folder.concat(folderTmp),
         type: 1,
         projectId: this.projectId
       }).then(res => {

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

@@ -48,7 +48,7 @@
                center
                title="新增项目"
                width="35%">
-      <div>
+      <div v-loading='addLoading'>
         <el-form ref='form' :model="projectForm" class="lab mt-20" label-width="100px" :rules="rules">
           <div class="flex flex-center flex-col mr-20">
             <el-form-item class="full-width" label="项目名称" prop='name'>
@@ -158,6 +158,7 @@ export default {
       showImport: false,
       active: 0,
       loading: false,
+      addLoading: false,
       data: [],
       form: {},
       option: {
@@ -369,8 +370,10 @@ export default {
       this.$refs.form.validate((valid) => {
         if (valid) {
           this.disable = true
+          this.addLoading = true
           this.$api.project.projectAdd(this.projectForm).then(res => {
             this.disable = false
+            this.addLoading = false
             if (res.code === 200) {
               this.showAdd = false
               this.$message.success(res.msg)

+ 4 - 0
src/views/home/component/proinfo.vue

@@ -41,6 +41,7 @@
                  class="demo-ruleForm"
                  label-width="120px"
                  :rules='rules'
+                 :v-loaing='addLoaing'
                  status-icon>
           <el-form-item label="发行时间" prop='issueDate'>
             <el-date-picker
@@ -118,6 +119,7 @@ export default {
   },
   data () {
     return {
+      addLoaing: false,
       show: false,
       showAdd: false,
       keyWords: '',
@@ -180,7 +182,9 @@ export default {
     },
     issueAdd () {
       this.issueInfo.projectId = this.data.id
+      this.addLoaing = true
       this.$api.project.issueAdd(this.issueInfo).then(res => {
+        this.addLoaing = false
         if (res.code === 200) {
           this.showAdd = false
           this.$message.success(res.msg)