Browse Source

渠道号修改

朱鑫波 3 years ago
parent
commit
099b49dba7

+ 13 - 3
src/views/modules/autoLaunch/channelManage/channelDetailList.vue

@@ -263,6 +263,7 @@
                 <a-collapse accordion v-model="activeKey" ref="collapse">
                     <template v-for="(item, index) in itemForm.items">
                         <a-collapse-panel
+                            :forceRender="true"
                             :header="item.channelName + '(' + item.channelCode + ')'"
                             style="background: #f9f9fa;border-radius: 4px;margin-bottom:15px;overflow: hidden;border: 1px solid #d9d9d9;"
                         >
@@ -278,10 +279,10 @@
                             <a-form-model-item label="项目" ref="keyword">
                                 {{ item.projectName }}
                             </a-form-model-item>
-                            <a-form-model-item label="渠道号" ref="itemName">
+                            <a-form-model-item label="渠道号" ref="channelCode">
                                 {{ item.channelCode }}
                             </a-form-model-item>
-                            <a-form-model-item label="渠道号名称" ref="itemName">
+                            <a-form-model-item label="渠道号名称" ref="channelName">
                                 {{ item.channelName }}
                             </a-form-model-item>
                             <a-form-model-item
@@ -595,6 +596,13 @@ let detailColumns = [
         scopedSlots: { customRender: 'unitId' },
         align: 'center',
         key: 'unitId'
+    },
+    {
+        title: '创建时间',
+        dataIndex: 'createTime',
+        scopedSlots: { customRender: 'createTime' },
+        align: 'center',
+        key: 'createTime'
     }
 ]
 
@@ -809,6 +817,7 @@ export default {
                     this.itemForm.items = res.result.map((item, index) => {
                         return {
                             ...item,
+                            channelId: item.id,
                             id: '',
                             itemList: this.getItemList(item.project_Id, item.itemList, index)
                         }
@@ -831,7 +840,7 @@ export default {
                     let params = this.itemForm.items.map(item => {
                         return {
                             id: item.id,
-                            channelCode: item.channelCode
+                            channelId: item.channelId
                         }
                     })
                     postAction('/channelItem/channelBindingItem', params).then(res => {
@@ -841,6 +850,7 @@ export default {
                             this.itemForm.items = []
                             this.handleResetForm()
                             this.selectedRowKeys = []
+                            this.activeKey = '0'
                         } else {
                             this.$message.error(res.message)
                         }

+ 14 - 17
src/views/modules/autoLaunch/channelManage/createChannel.vue

@@ -290,7 +290,7 @@ li.chouzhen.first:before {
                                         </a-form-item>
                                     </a-col>
                                 </a-row>
-                                <a-row :gutter="16">
+                                <a-row :gutter="16" v-if="createTypeData && createTypeData.createType == '1'">
                                     <a-col :span="16">
                                         <a-form-item label="编号位数">
                                             <a-select
@@ -312,7 +312,7 @@ li.chouzhen.first:before {
                                         </a-form-item>
                                     </a-col>
                                 </a-row>
-                                <a-row :gutter="16">
+                                <a-row :gutter="16" v-if="createTypeData && createTypeData.createType == '1'">
                                     <a-col :span="16">
                                         <a-form-item label="编号">
                                             <a-input-number
@@ -478,13 +478,7 @@ li.chouzhen.first:before {
                                                 v-decorator="[
                                                     'actionbarClickUrl',
                                                     {
-                                                        rules: [
-                                                            {
-                                                                required: true,
-                                                                message: '请填写第三方actionBar监测链接'
-                                                            },
-                                                            { validator: handleConfirmValue }
-                                                        ]
+                                                        rules: [{ validator: handleConfirmValueOkUndefind }]
                                                     }
                                                 ]"
                                                 allow-clear
@@ -561,7 +555,10 @@ li.chouzhen.first:before {
                                         </a-form-item>
                                     </a-col>
                                 </a-row>
-                                <a-row :gutter="16">
+                                <a-row
+                                    :gutter="16"
+                                    v-if="getFormData('isCycle') == 1 || getFormData('isCycle') == undefined"
+                                >
                                     <a-col :span="16">
                                         <a-form-item label="循环使用次数">
                                             <a-input-number
@@ -769,11 +766,11 @@ export default {
                 } else if (field == 'channelCode') {
                     this[form].setFieldsValue({ channelCode: node.value })
                 } else if (field == 'schemaUri') {
-                    this[form].setFieldsValue({ schemaUri: sel.text })
+                    this[form].setFieldsValue({ schemaUri: node.value })
                 } else if (field == 'clickTrackUrl') {
-                    this[form].setFieldsValue({ clickTrackUrl: sel.text })
+                    this[form].setFieldsValue({ clickTrackUrl: node.value })
                 } else if (field == 'actionbarClickUrl') {
-                    this[form].setFieldsValue({ actionbarClickUrl: sel.text })
+                    this[form].setFieldsValue({ actionbarClickUrl: node.value })
                 }
                 node.focus()
                 node.selectionStart = startPos + v.length
@@ -788,11 +785,11 @@ export default {
                 } else if (field == 'channelCode') {
                     this[form].setFieldsValue({ channelCode: node.value })
                 } else if (field == 'schemaUri') {
-                    this[form].setFieldsValue({ schemaUri: sel.text })
+                    this[form].setFieldsValue({ schemaUri: node.value })
                 } else if (field == 'clickTrackUrl') {
-                    this[form].setFieldsValue({ clickTrackUrl: sel.text })
+                    this[form].setFieldsValue({ clickTrackUrl: node.value })
                 } else if (field == 'actionbarClickUrl') {
-                    this[form].setFieldsValue({ actionbarClickUrl: sel.text })
+                    this[form].setFieldsValue({ actionbarClickUrl: node.value })
                 }
                 node.focus()
                 // this.channelName = node.value
@@ -806,7 +803,7 @@ export default {
             }
         },
         handleConfirmValueOkUndefind(rule, value, callback) {
-            if (value == '') {
+            if (!!!value) {
                 callback()
             } else if (/(http|https):\/\/([\w.]+\/?)\S*/.test(value)) {
                 callback()

+ 23 - 8
src/views/modules/autoLaunch/channelManage/index.vue

@@ -236,7 +236,6 @@
                 </div>
             </a-radio-group>
         </a-modal>
-        
 
         <a-modal
             title="下载模板"
@@ -397,7 +396,9 @@ export default {
             projectIdDownLoad: '',
             productIdDownLoad: '',
             channelType: 'a',
-            createType: 1,
+            createType: '1',
+            typeAccountId: null,
+            typeProjectId: null,
             indexAll: 0,
             spinning: false,
             form: this.$form.createForm(this),
@@ -548,26 +549,37 @@ export default {
         },
         addNewChannelElse(item) {
             this.createType = item.createType
-            var createTypeData = { createType: this.createType, accountId: item.accountId, projectId: item.projectId }
-            localStorage.setItem('createTypeData', JSON.stringify(createTypeData))
-            this.$router.push({ path: '/autoLaunch/createChannel' })
+            this.typeAccountId = item.accountId
+            this.typeProjectId = item.projectId
+            this.visibleChannel = true
+            // var createTypeData = { createType: this.createType, accountId: item.accountId, projectId: item.projectId }
+            // localStorage.setItem('createTypeData', JSON.stringify(createTypeData))
+            // this.$router.push({ path: '/autoLaunch/createChannel' })
         },
         handleOk() {
             if (this.channelType == 'a') {
                 this.createType = '1'
-                var createTypeData = { createType: this.createType, accountId: null, projectId: null }
+                var createTypeData = {
+                    createType: this.createType,
+                    accountId: this.typeAccountId,
+                    projectId: this.typeProjectId
+                }
                 localStorage.setItem('createTypeData', JSON.stringify(createTypeData))
                 this.$router.push({ path: '/autoLaunch/createChannel' })
             } else if (this.channelType == 'b') {
                 this.createType = '2'
                 this.visibleDownLoad = true
-                this.handleCancel()
             } else if (this.channelType == 'c') {
                 this.createType = '3'
-                var createTypeData = { createType: this.createType, accountId: null, projectId: null }
+                var createTypeData = {
+                    createType: this.createType,
+                    accountId: this.typeAccountId,
+                    projectId: this.typeProjectId
+                }
                 localStorage.setItem('createTypeData', JSON.stringify(createTypeData))
                 this.$router.push({ path: '/autoLaunch/createChannel' })
             }
+            this.handleCancel()
         },
         handleOkImport() {
             if (!!this.fileUrl) {
@@ -622,7 +634,10 @@ export default {
             }
         },
         handleCancel() {
+            this.channelType = 'a'
             this.visibleChannel = false
+            this.typeAccountId = null
+            this.typeProjectId = null
         },
         addNewChannel() {
             this.visibleChannel = true

+ 0 - 2
src/views/modules/autoLaunch/channelManage/itemList.vue

@@ -735,8 +735,6 @@ export default {
         handleResetForm() {
             this.ipagination.current = 1
             this.form.resetFields()
-            this.$refs.selectTable.keyValue = ''
-            this.$refs.selectTable.getData()
             this.$refs.selectTableProject.keyValue = ''
             this.$refs.selectTableProject.getData()
             const paramsData = this.form.getFieldsValue()