朱鑫波 4 лет назад
Родитель
Сommit
ca62467a04

+ 1 - 0
src/views/modules/autoLaunch/application/components/creatApplication.vue

@@ -566,6 +566,7 @@ export default {
               params.platform = this.appType == 'ios' ? +this.platform + 2 : +this.platform
               params.imageUrl = this.fileUrl
               if (this.okCreated) {
+                this.okCreated = false
                 this.$message.success('创建成功')
                 this.handleCancel()
                 this.$emit('getDataList')

+ 29 - 56
src/views/modules/autoLaunch/application/components/editApplication.vue

@@ -525,9 +525,9 @@ export default {
               )
             })
           } else {
-            setTimeout(()=>{
+            setTimeout(() => {
               this.form.setFieldsValue(pick(res.result, 'url', 'appVersion', 'platform', 'appName', 'projectName'))
-            },100)
+            }, 100)
           }
         }
       })
@@ -590,63 +590,36 @@ export default {
       this.form.validateFields((err, values) => {
         console.log('Received values of form: ', values)
         if (!err) {
-          let params = {}
-          params.projectId = this.projectId
-          if (this.uploadType == '1') {
-            this.url.insertTemplateUrl = '/kuaishouAppPackage/importAppExcel'
-            params.platform = this.appType == 'ios' ? +this.platform + 2 : +this.platform
-            params.imageUrl = this.fileUrl
-          } else {
-            this.url.insertTemplateUrl = '/kuaishouAppPackage/fillInLink'
-            params = { ...values }
-            params.useSdk = params.useSdk?params.useSdk.length > 0 ? 1 : 0:null
-            params.id = this.appId
+          if (this.fileUrl && this.projectId) {
+            let params = {}
             params.projectId = this.projectId
-            params.appIconUrl = this.fileUrl
-            params.platform = this.appType == 'ios' ? +this.platform + 2 : +this.platform
-          }
-          // if (this.appType == 'android') {
-          //   if (this.imageUrl != '') {
-          //     params.imageUrl = this.imageUrl
-          //   }
-          //   if (this.platform == '2') {
-          //     params.url = values.downloadUrl
-          //   } else {
-          //     if (this.uploadType == '1') {
-          //       if (this.file != '') {
-          //         params.file = this.file
-          //       }
-          //     } else if (this.uploadType == '2') {
-          //       params.url = values.downloadUrl
-          //     }
-          //   }
-          //   params.platform = this.platform
-          //   params.uploadType = values.uploadType
-          //   params.appType = 'android'
-          //   params.packageName = values.packageName
-          //   params.appName = values.appName
-          //   params.appVersion = values.appVersion
-          //   params.loginId = this.userInfo().id
-          // } else {
-          //   params.appType = 'ios'
-          //   params.platform = this.platform
-          //   params.uploadType = '2'
-          //   params.url = values.downloadUrl
-          //   params.appName = values.appName
-          //   params.appVersion = values.appVersion
-          //   params.loginId = this.userInfo().id
-          // }
-
-          console.log(params)
-          postAction(this.url.insertTemplateUrl, params).then((res) => {
-            if (res.success) {
-              this.$message.success('修改成功')
-              this.handleCancel()
-              this.$emit('getDataList')
+            if (this.uploadType == '1') {
+              this.url.insertTemplateUrl = '/kuaishouAppPackage/importAppExcel'
+              params.platform = this.appType == 'ios' ? +this.platform + 2 : +this.platform
+              params.imageUrl = this.fileUrl
             } else {
-              this.$message.error(res.message)
+              this.url.insertTemplateUrl = '/kuaishouAppPackage/fillInLink'
+              params = { ...values }
+              params.useSdk = params.useSdk ? (params.useSdk.length > 0 ? 1 : 0) : null
+              params.id = this.appId
+              params.projectId = this.projectId
+              params.appIconUrl = this.fileUrl
+              params.platform = this.appType == 'ios' ? +this.platform + 2 : +this.platform
             }
-          })
+
+            console.log(params)
+            postAction(this.url.insertTemplateUrl, params).then((res) => {
+              if (res.success) {
+                this.$message.success('修改成功')
+                this.handleCancel()
+                this.$emit('getDataList')
+              } else {
+                this.$message.error(res.message)
+              }
+            })
+          } else {
+            this.$message.error('请填写必填项')
+          }
         }
       })
     },