朱鑫波 4 rokov pred
rodič
commit
8ac41e0685

+ 2 - 13
src/views/modules/autoLaunch/application/application.vue

@@ -471,33 +471,21 @@ export default {
                     title: '应用名称',
                     align: 'center',
                     width: 200,
-                    ellipsis: true,
                     dataIndex: 'appName'
                 },
                 {
                     title: '应用标记',
                     align: 'center',
-                    ellipsis: true,
                     dataIndex: 'appVersion'
                 },
                 {
                     title: '系统平台',
                     align: 'center',
-                    ellipsis: true,
-                    dataIndex: 'platform',
-                    customRender(t) {
-                        if(t===1||t===2) {
-                            return 'Android'
-                        }
-                        else {
-                            return 'IOS'
-                        }
-                    }
+                    dataIndex: 'platformStr',
                 },
                 {
                     title: '应用包名',
                     align: 'center',
-                    ellipsis: true,
                     dataIndex: 'packageName',
                 },
                  {
@@ -534,6 +522,7 @@ export default {
                     title: '操作',
                     dataIndex: 'action',
                     align: 'center',
+                    width: 150,
                     scopedSlots: {customRender: 'action'}
                 },
                 {

+ 76 - 85
src/views/modules/autoLaunch/application/components/creatApplication.vue

@@ -1,3 +1,18 @@
+<style lang="less" scoped>
+.require-class {
+  /deep/ .ant-form-item-label {
+    label::before {
+      display: inline-block;
+      margin-right: 4px;
+      color: #f5222d;
+      font-size: 14px;
+      font-family: SimSun, sans-serif;
+      line-height: 1;
+      content: '*';
+    }
+  }
+}
+</style>
 <template>
   <div>
     <a-modal
@@ -45,34 +60,6 @@
           </a-form-item>
 
           <a-form-item
-            label="上传文件"
-            v-if="uploadType == '1'"
-            :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
-            :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
-          >
-            <!-- <a-upload name="file" :file-list="fileList" :before-upload="beforeUpload" @change="handleChange">
-              <a-button><a-icon type="upload" />文件上传</a-button>
-            </a-upload> -->
-            <a-upload
-              name="file"
-              :multiple="false"
-              :action="uploadAction"
-              :headers="tokenHeader"
-              :file-list="fileList"
-              :showUploadList="false"
-              :beforeUpload="beforeUpload"
-              @change="handleChange"
-              style="margin-right: 20px"
-            >
-              <a-button :disabled="(!projectId && !fileUrl) || loadDisabled">
-                <a-icon type="upload" />
-                {{ loadDisabled ? '上传中,请稍后' : '文件上传' }}
-              </a-button>
-            </a-upload>
-            <a @click="downLoadFile">文件格式下载</a>
-          </a-form-item>
-
-          <a-form-item
             v-if="uploadType == '2'"
             label="下载链接"
             :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
@@ -128,6 +115,7 @@
             :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
             :wrapperCol="{ xs: { span: 24 }, sm: { span: 19 } }"
             v-if="application"
+            class="require-class"
           >
             <uploadFile
               v-if="application"
@@ -138,8 +126,38 @@
               @overUpload="overUpload"
               :size="100"
             ></uploadFile>
+             <p class="upload-txt-rules">
+              文件格式:支持上传png/jpg/jpeg图片,尺寸450*450,小于100kb
+            </p>
+          </a-form-item>
+          <a-form-item
+            label="上传文件"
+            v-if="uploadType == '1'"
+            :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
+            :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
+            class="require-class"
+          >
+            <!-- <a-upload name="file" :file-list="fileList" :before-upload="beforeUpload" @change="handleChange">
+              <a-button><a-icon type="upload" />文件上传</a-button>
+            </a-upload> -->
+            <a-upload
+              name="file"
+              :multiple="false"
+              :action="uploadAction"
+              :headers="tokenHeader"
+              :file-list="fileList"
+              :showUploadList="false"
+              :beforeUpload="beforeUpload"
+              @change="handleChange"
+              style="margin-right: 20px"
+            >
+              <a-button :disabled="fileUrl=='' && !projectId">
+                <a-icon type="upload" />
+                {{ loadDisabled ? '上传中,请稍后' : '文件上传' }}
+              </a-button>
+            </a-upload>
+            <a @click="downLoadFile">文件格式下载</a>
           </a-form-item>
-
           <a-form-item
             label="应用标记"
             :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
@@ -187,7 +205,7 @@
             :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
             v-if="uploadType == '2'"
           >
-           <a-input
+            <a-input
               v-decorator="[
                 'appPrivacyUrl',
                 {
@@ -197,7 +215,7 @@
               placeholder="请填写监测链接"
             />
           </a-form-item>
-          
+
           <a-form-item
             label="监测链接"
             :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
@@ -309,7 +327,6 @@ export default {
       })
     },
     handleChange(info) {
-      console.log(info)
       let fileList = [...info.fileList]
 
       // 1. Limit the number of uploaded files
@@ -341,8 +358,8 @@ export default {
       if (info.file.status === 'done') {
         this.loadDisabled = false
         if (info.file.response.code == 200) {
-          this.application = true
-          this.$emit('getDataList')
+          // this.application = true
+          // this.$emit('getDataList')
           this.$message.success(info.file.response.message)
         } else {
           this.$message.error(info.file.response.message)
@@ -538,64 +555,38 @@ export default {
       //   console.log('图片地址:' + this.imageUrl)
       //   e.preventDefault()
       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 }
+          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) {
-              
+            if (this.uploadType == '1') {
+              this.url.insertTemplateUrl = '/kuaishouAppPackage/importAppExcel'
+              params.platform = this.appType == 'ios' ? +this.platform + 2 : +this.platform
+              params.imageUrl = this.fileUrl
               this.$message.success('创建成功')
               this.handleCancel()
               this.$emit('getDataList')
+              return
             } else {
-              this.$message.error(res.message)
+              this.url.insertTemplateUrl = '/kuaishouAppPackage/fillInLink'
+              params = { ...values }
+              params.projectId = this.projectId
+              params.appIconUrl = this.fileUrl
+              params.platform = this.appType == 'ios' ? +this.platform + 2 : +this.platform
             }
-          })
+
+            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('请填写必填项')
+          }
         }
       })
     },

+ 1 - 0
src/views/modules/autoLaunch/directional/directional.vue

@@ -502,6 +502,7 @@ export default {
                     title: '操作',
                     dataIndex: 'action',
                     align: 'center',
+                    width: 150,
                     scopedSlots: {customRender: 'action'}
                 },
                 {