Quellcode durchsuchen

修改渠道号

朱鑫波 vor 3 Jahren
Ursprung
Commit
24876bb7a5

+ 18 - 5
src/views/modules/autoLaunch/channelManage/channelDetailList.vue

@@ -201,7 +201,9 @@
                                 text.length > 0
                                     ? text
                                           .map(i => {
-                                              return i.itemName
+                                              if (i) {
+                                                  return i.itemName
+                                              }
                                           })
                                           .join()
                                     : '-'
@@ -315,9 +317,10 @@
         >
             <a-button type="primary" @click="addOneItem" style="margin-bottom:10px">添加单品信息</a-button>
             <a-form-model ref="ruleForm" :model="addItemForm" :rules="rules" v-bind="formItemLayout">
-                <a-collapse accordion v-model="activeKey" ref="collapse">
+                <a-collapse accordion v-model="activeKey" ref="collapse" v-if="visibleAddItem">
                     <template v-for="(item, index) in addItemForm.items">
                         <a-collapse-panel
+                            :forceRender="true"
                             :header="item.itemName"
                             style="background: #f9f9fa;border-radius: 4px;margin-bottom:15px;overflow: hidden;border: 1px solid #d9d9d9;"
                         >
@@ -330,7 +333,7 @@
                                 label="项目"
                                 ref="projectId"
                                 :prop="'items.' + index + '.projectId'"
-                                :rules="[{ required: true, message: '请选择项目', trigger: 'blur' }]"
+                                :rules="[{ required: true, message: '请选择项目', trigger: 'change' }]"
                             >
                                 <!-- <a-input v-model="item.projectId" placeholder="请输入规则名称" /> -->
                                 <Treeselect v-model="item.projectId" style="width:100%" />
@@ -341,7 +344,7 @@
                                 :prop="'items.' + index + '.keyword'"
                                 :rules="[
                                     { required: true, message: '请填写素材关键字', trigger: 'blur' },
-                                    { min: 1, message: '长度不得小于1', trigger: 'blur' }
+                                    { min: 1, max: 15, message: '长度不得小于1,最大长度为15', trigger: 'blur' }
                                 ]"
                             >
                                 <a-input v-model="item.keyword" placeholder="请输入素材关键字" />
@@ -352,7 +355,7 @@
                                 :prop="'items.' + index + '.itemName'"
                                 :rules="[
                                     { required: true, message: '请填写单品名称', trigger: 'blur' },
-                                    { min: 1, message: '长度不得小于1', trigger: 'blur' }
+                                    { min: 1, max: 10, message: '长度不得小于1,最大长度为10', trigger: 'blur' }
                                 ]"
                             >
                                 <a-input v-model="item.itemName" placeholder="请输入单品名称" />
@@ -868,6 +871,7 @@ export default {
                         if (res.success) {
                             this.visibleAddItem = false
                             this.addItemForm.items = [{ projectId: '', keyWord: '', itemName: '默认名称-单品1' }]
+                            this.handleResetForm()
                         } else {
                             this.$message.error(res.message)
                         }
@@ -1006,6 +1010,14 @@ export default {
                 this.$refs.selectTableProject.keyValue = ''
                 this.$refs.selectTableProject.getData(n)
             }
+        },
+        visibleAddItem: function(n, o) {
+            if (!n) {
+                this.addItemForm = {
+                    items: [{ projectId: '', keyWord: '', itemName: '默认名称-单品1' }]
+                }
+                this.addItemForm.items[0].projectId = ''
+            }
         }
     },
     computed: {
@@ -1023,6 +1035,7 @@ export default {
                 onChange: (selectedRowKeys, selectedRows) => {
                     this.selectedRowKeys = selectedRowKeys
                 },
+                selectedRowKeys: this.selectedRowKeys,
                 getCheckboxProps: record => ({
                     props: {
                         disabled: record.isHaveItem === 0

+ 3 - 2
src/views/modules/autoLaunch/channelManage/index.vue

@@ -259,7 +259,7 @@
                 :productId="productIdDownLoad"
                 ref="selectTableProjectDownLoad"
             ></selectTableProject>
-            <a-button type="primary" icon="plus" @click="handleOkDownLoad" style="margin-left:85px;margin-bottom:15px"
+            <a-button type="primary" @click="handleOkDownLoad" style="margin-left:85px;margin-bottom:15px"
                 >导出渠道号模板</a-button
             >
             <a-form :form="formDownLoad">
@@ -671,7 +671,8 @@ export default {
                 projectId: this.projectId,
                 accountId: data.accountId,
                 pageNo: this.ipagination.current,
-                pageSize: this.ipagination.pageSize
+                pageSize: this.ipagination.pageSize,
+                userId: this.userInfo().id
             }
             this.dataSource = []
             this.dataLoading = true

+ 20 - 6
src/views/modules/autoLaunch/channelManage/itemList.vue

@@ -269,7 +269,7 @@
                 :projectId.sync="projectIdDownLoad"
                 ref="selectTableProjectDownLoad"
             ></selectTableProject>
-            <a-button type="primary" icon="plus" @click="handleOkDownLoad" style="margin-left:85px;margin-bottom:15px"
+            <a-button type="primary" @click="handleOkDownLoad" style="margin-left:85px;margin-bottom:15px"
                 >导出单品模板</a-button
             >
             <a-form :form="formDownLoad">
@@ -311,9 +311,10 @@
         >
             <a-button type="primary" @click="addOneItem" style="margin-bottom:10px">添加单品信息</a-button>
             <a-form-model ref="ruleForm" :model="addItemForm" v-bind="formItemLayout">
-                <a-collapse accordion v-model="activeKey" ref="collapse">
+                <a-collapse accordion v-model="activeKey" ref="collapse" v-if="visibleAddItem">
                     <template v-for="(item, index) in addItemForm.items">
                         <a-collapse-panel
+                            :forceRender="true"
                             :header="item.itemName"
                             style="background: #f9f9fa;border-radius: 4px;margin-bottom:15px;overflow: hidden;border: 1px solid #d9d9d9;"
                         >
@@ -326,7 +327,7 @@
                                 label="项目"
                                 ref="projectId"
                                 :prop="'items.' + index + '.projectId'"
-                                :rules="[{ required: true, message: '请选择项目', trigger: 'blur' }]"
+                                :rules="[{ required: true, message: '请选择项目', trigger: 'change' }]"
                             >
                                 <!-- <a-input v-model="item.projectId" placeholder="请输入规则名称" /> -->
                                 <Treeselect v-model="item.projectId" style="width:100%" />
@@ -337,7 +338,7 @@
                                 :prop="'items.' + index + '.keyword'"
                                 :rules="[
                                     { required: true, message: '请填写素材关键字', trigger: 'blur' },
-                                    { min: 1, message: '长度不得小于1', trigger: 'blur' }
+                                    { min: 1, max: 15, message: '长度不得小于1,最大长度为15', trigger: 'blur' }
                                 ]"
                             >
                                 <a-input v-model="item.keyword" placeholder="请输入素材关键字" />
@@ -348,7 +349,7 @@
                                 :prop="'items.' + index + '.itemName'"
                                 :rules="[
                                     { required: true, message: '请填写单品名称', trigger: 'blur' },
-                                    { min: 1, message: '长度不得小于1', trigger: 'blur' }
+                                    { min: 1, max: 10, message: '长度不得小于1,最大长度为10', trigger: 'blur' }
                                 ]"
                             >
                                 <a-input v-model="item.itemName" placeholder="请输入单品名称" />
@@ -547,6 +548,10 @@ export default {
             this.keyWord = undefined
         },
         bidChangeOk(record) {
+            if (this.keyWord.length > 15) {
+                this.$message.error('素材关键字最多15个字')
+                return
+            }
             record.visible = false
             const paramsData = {
                 id: record.id,
@@ -619,7 +624,7 @@ export default {
             if (!result) {
                 this.$message.error('不支持该文件类型')
                 this.loadDisabled = false
-                return false
+                return Promise.reject()
             }
         },
         ...mapGetters(['userInfo']),
@@ -659,6 +664,7 @@ export default {
                         if (res.success) {
                             this.visibleAddItem = false
                             this.addItemForm.items = [{ projectId: '', keyWord: '', itemName: '默认名称-单品1' }]
+                            this.handleResetForm()
                         } else {
                             this.$message.error(res.message)
                         }
@@ -832,6 +838,14 @@ export default {
                 this.$refs.selectTableProject.keyValue = ''
                 this.$refs.selectTableProject.getData(n)
             }
+        },
+        visibleAddItem: function(n, o) {
+            if (!n) {
+                this.addItemForm = {
+                    items: [{ projectId: '', keyWord: '', itemName: '默认名称-单品1' }]
+                }
+                this.addItemForm.items[0].projectId = ''
+            }
         }
     },
     computed: {

+ 2 - 2
vue.config.js

@@ -105,7 +105,7 @@ module.exports = {
         // target: 'http://192.168.1.43:8088', //请求本地 需要jeecg-boot后台项目  毕洁泉
         // target: 'http://192.168.1.43:8806', //请求本地 需要jeecg-boot后台项目  毕洁泉
         // target: 'http://192.168.0.252:8098', //请求本地 需要jeecg-boot后台项目  毕洁泉
-        // target: 'http://192.168.1.219:7701', //请求本地 需要jeecg-boot后台项目  赵西安
+        target: 'http://192.168.1.219:7701', //请求本地 需要jeecg-boot后台项目  赵西安
         // target: 'http://192.168.1.193:8080', //请求本地 需要jeecg-boot后台项目  李煜一
         // target: 'http://192.168.1.193:31012', //请求本地 需要jeecg-boot后台项目  李煜一
         // target: 'http://api.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
@@ -115,7 +115,7 @@ module.exports = {
         // target: 'http://192.168.1.251/', //请求本地 需要jeecg-boot后台项目
         // target:'http://118.24.244.213:8804',
         // target: 'http://192.168.1.43:9999', // 子安
-        target: 'http://192.168.1.8:9999', // 学超
+        // target: 'http://192.168.1.8:9999', // 学超
         // target:'http://gateway.tjyourong.com.cn', //测试
         // target:'http://apipre.tjyourong.com.cn', //预生产
         // target: 'http://192.168.1.134:7001', //请求本地 需要jeecg-boot后台项目  周泽宇