朱鑫波 4 rokov pred
rodič
commit
66c4075a86

+ 11 - 9
src/views/modules/autoLaunch/application/application.vue

@@ -9,12 +9,19 @@
                         <!-- <a-form-item label="项目名称"> -->
                         <selectTable :projectId.sync="projectId" ref="selectTable" :requireCheck="false"></selectTable>
                     </a-col>
-
+                    <a-col :md="8" :sm="8" :xxl="6">
+                        <a-form-item label="应用名称">
+                            <a-input
+                                v-decorator="['appName']" type="text"
+                                placeholder="请输入应用名称"
+                            />
+                        </a-form-item>
+                    </a-col>
                     <a-col :md="8" :sm="8" :xxl="6">
                         <a-form-item label="应用标识">
                             <a-input
                                 v-decorator="['name']" type="text"
-                                placeholder="请输入应用名称或者应用标记"
+                                placeholder="请输入应用标记"
                             />
                         </a-form-item>
                     </a-col>
@@ -852,6 +859,7 @@ export default {
         handleGetTableList(data) {
             const paramsData = {
                 appVersion: data.name,
+                appName: data.appName,
                 projectId: this.projectId,
                 platform: data.status,
                 pageNo:  this.ipagination.current,
@@ -877,7 +885,7 @@ export default {
             let that = this
             this.$confirm({
                 title: '删除提示',
-                content: '是否删除该定向包?',
+                content: '是否删除该应用包?',
                 onOk() {
                     postAction('/kuaishouAppPackage/delete', {id: data.id}).then(result => {
                         if (result.code === 200) {
@@ -978,12 +986,6 @@ export default {
             this.finallyRightTree.push({
                 key: val.accountId,
                 title: val.authName,
-                incluedSelectedRowKeys: [],
-                incluedSelectedKeys: [],
-                excludeSelectedKeys: [],
-                excludeSelectedRowKeys: [],
-                people: '0',
-                tabKey: '1'
             });
             this.causeVisible = false;
             this.resultHistory = 2;

+ 18 - 15
src/views/modules/autoLaunch/application/components/creatApplication.vue

@@ -126,9 +126,7 @@
               @overUpload="overUpload"
               :size="100"
             ></uploadFile>
-             <p class="upload-txt-rules">
-              文件格式:支持上传png/jpg/jpeg图片,尺寸450*450,小于100kb
-            </p>
+            <p class="upload-txt-rules">文件格式:支持上传png/jpg/jpeg图片,尺寸450*450,小于100kb</p>
           </a-form-item>
           <a-form-item
             label="上传文件"
@@ -151,7 +149,7 @@
               @change="handleChange"
               style="margin-right: 20px"
             >
-              <a-button :disabled="fileUrl=='' && !projectId">
+              <a-button :disabled="fileUrl == '' && !projectId">
                 <a-icon type="upload" />
                 {{ loadDisabled ? '上传中,请稍后' : '文件上传' }}
               </a-button>
@@ -291,6 +289,7 @@ export default {
       imageToken: '',
       uploadAction: '/kuaishouAppPackage/importAppExcel',
       tokenHeader: { 'X-Access-Token': Vue.ls.get(ACCESS_TOKEN) },
+      okCreated: false,
     }
   },
   methods: {
@@ -360,8 +359,10 @@ export default {
         if (info.file.response.code == 200) {
           // this.application = true
           // this.$emit('getDataList')
+          this.okCreated = true
           this.$message.success(info.file.response.message)
         } else {
+          this.okCreated = false
           this.$message.error(info.file.response.message)
         }
       } else if (info.file.status === 'error') {
@@ -490,7 +491,10 @@ export default {
     },
     handleCancel() {
       this.form.resetFields()
-      this.imageUrl = ''
+      this.fileUrl = ''
+      this.projectId = undefined
+      this.$refs.selectTable.keyValue = ''
+      this.$refs.selectTable.getData()
       this.file = ''
       this.platform = '1'
       this.application = false
@@ -522,13 +526,7 @@ export default {
     },
     changeShowUpload() {
       this.form.resetFields()
-      if (this.uploadType == '1') {
-        this.showUploadFile = true
-        this.showDownLoad = false
-      } else {
-        this.showUploadFile = false
-        this.showDownLoad = true
-      }
+      this.fileUrl = ''
     },
     changeShowUploadType() {
       this.form.resetFields()
@@ -563,9 +561,14 @@ export default {
               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')
+              if (this.okCreated) {
+                this.$message.success('创建成功')
+                this.handleCancel()
+                this.$emit('getDataList')
+              } else {
+                this.$message.error('excel文件有误,请重新上传后点击')
+              }
+
               return
             } else {
               this.url.insertTemplateUrl = '/kuaishouAppPackage/fillInLink'

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

@@ -31,7 +31,7 @@
             :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
             :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
           >
-            <a-radio-group v-model="appType" @change="changePlatform">
+            <a-radio-group v-model="appType" @change="changePlatform" disabled>
               <a-radio-button value="android">安卓</a-radio-button>
               <a-radio-button value="ios">IOS</a-radio-button>
             </a-radio-group>
@@ -42,7 +42,7 @@
             :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
             :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
           >
-            <a-radio-group v-model="platform" @change="changeShowUploadType">
+            <a-radio-group v-model="platform">
               <a-radio value="1">应用下载</a-radio>
               <a-radio value="2">网页游戏</a-radio>
             </a-radio-group>
@@ -53,7 +53,7 @@
             :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
             :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
           >
-            <a-radio-group v-model="uploadType" @change="changeShowUpload">
+            <a-radio-group v-model="uploadType">
               <a-radio-button value="1" disabled>本地上传</a-radio-button>
               <a-radio-button value="2">填写链接</a-radio-button>
             </a-radio-group>

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

@@ -171,6 +171,7 @@ export default {
             }
             defaultCheckKey.splice(value, 1);
             this.checkedKeys = defaultCheckKey;
+            this.$emit('applyType', this.applyTypeOption);
         },
         onChange(e) {
             const value = e.target.value;

+ 45 - 15
src/views/modules/autoLaunch/application/components/uploadFile.vue

@@ -214,23 +214,53 @@ export default {
       this.percent = 0
       this.loadingElse = true
       const fileOvesize = file.size > this.size * oneKB
-      // console.log(fileOvesize)
-      if (fileOvesize && this.sizeCheck) {
-        this.onOversize()
-        this.loadingElse = false
-        return
-      } else {
-        this.checkFile(file)
-          .then((res) => {
-            this.cosUpload(file)
-          })
-          .catch(() => {
+      console.log(file)
+      var image = new Image()
+      var reader = new FileReader()
+      var height = 0
+      var width = 0
+      reader.readAsDataURL(file)
+      //文件读取结束时间
+      reader.onload = function (e) {
+        image.src = reader.result
+      }
+      var that = this
+      //图片读取事件
+      image.onload = function () {
+        height = image.naturalHeight
+        width = image.naturalWidth
+      }
+
+      setTimeout(() => {
+        if (height != 450 || width != 450) {
+          that.$message.error('请上传450*450大小的图片')
+          this.loadingElse = false
+          return
+        }
+        // console.log(fileOvesize)
+        if (fileOvesize && this.sizeCheck) {
+          this.onOversize()
+          this.loadingElse = false
+          return
+        } else {
+          if (file.type.includes('jpg') || file.type.includes('png') || file.type.includes('jpeg')) {
+            this.checkFile(file)
+              .then((res) => {
+                this.cosUpload(file)
+              })
+              .catch(() => {
+                this.loadingElse = false
+              })
+          } else {
+            this.$message.error('请上传正确格式')
             this.loadingElse = false
+          }
+
+          return new Promise(function (resolve, reject) {
+            reject()
           })
-        return new Promise(function (resolve, reject) {
-          reject()
-        })
-      }
+        }
+      }, 200)
     },
     clearAll() {
       this.fileList = []

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

@@ -171,6 +171,7 @@ export default {
             }
             defaultCheckKey.splice(value, 1);
             this.checkedKeys = defaultCheckKey;
+            this.$emit('applyType', this.applyTypeOption);
         },
         onChange(e) {
             const value = e.target.value;

+ 1 - 0
src/views/modules/autoLaunch/url/components/tree-select.vue

@@ -142,6 +142,7 @@ export default {
             }
             defaultCheckKey.splice(value, 1);
             this.checkedKeys = defaultCheckKey;
+            this.$emit('applyType', this.applyTypeOption);
         },
         onChange(e) {
             const value = e.target.value;

+ 1 - 0
src/views/modules/crowd-control/components/tree-select/tree-select.vue

@@ -142,6 +142,7 @@ export default {
             }
             defaultCheckKey.splice(value, 1);
             this.checkedKeys = defaultCheckKey;
+            this.$emit('applyType', this.applyTypeOption);
         },
         onChange(e) {
             const value = e.target.value;

+ 1 - 1
src/views/modules/crowd-control/crowd-control.vue

@@ -497,7 +497,7 @@ export default {
             let that = this
             this.$confirm({
                 title: '删除提示',
-                content: '确定要删除这一条吗?',
+                content: '确定要删除该人群包吗?',
                 onOk() {
                     getAction('/kuaishouPopulationPackage/delete', {id: data.id}).then(result => {
                         if (result.code === 200) {