朱鑫波 3 éve
szülő
commit
ae100aabf5

+ 24 - 14
src/views/modules/autoLaunch/channelManage/channelAdmin/components/channelList.vue

@@ -230,6 +230,7 @@
             @cancel="
                 visibleDownLoad = false
                 cancel()
+                formDownLoad.resetFields()
             "
             okText="提交"
             :confirmLoading="downLoading"
@@ -317,7 +318,7 @@
                     :wrapperCol="{ xs: { span: 24 }, sm: { span: 19 } }"
                     class="require-class"
                 >
-                    <a-select v-decorator="['isCycle']" placeholder="请选择" allow-clear>
+                    <a-select v-decorator="['isCycle']" placeholder="请选择" style="width:200px" allow-clear>
                         <a-select-option :value="0">否</a-select-option>
                         <a-select-option :value="1">是</a-select-option>
                     </a-select>
@@ -655,7 +656,11 @@ export default {
                 this.$router.push({ path: '/autoLaunch/channelDetailList' })
             } else {
                 localStorage.removeItem('channelInfoProjectId')
-                localStorage.setItem('channelInfoAccountId', item.accountId)
+                localStorage.setItem('channelInfoAccountId', JSON.stringify({
+                    accountId: item.accountId,
+                    accountName: item.authName,
+                    projectName: item.projectName
+                }))
                 this.$router.push({ path: '/autoLaunch/channelDetailList' })
             }
         },
@@ -722,18 +727,23 @@ export default {
         handleOkImport() {
             this.formDownLoad.validateFields((err, values) => {
                 if (!err) {
-                    this.downLoading = true
-                    var params = { ...values }
-                    params.accountId = this.editData.accountId
-                    params.userId = this.userInfo().id
-                    this.getAction('/channel/updateChannels', params).then(res => {
-                        this.downLoading = false
-                        if (res.success) {
-                            this.visibleDownLoad = false
-                            const paramsData = this.form.getFieldsValue()
-                            this.handleGetTableList(paramsData)
-                        }
-                    })
+                    if (!values.actionbarClickUrl && !values.clickTrackUrl && !values.isCycle && !values.schemaUri) {
+                        this.$message.error('至少修改一项')
+                        return
+                    } else {
+                        this.downLoading = true
+                        var params = { ...values }
+                        params.accountId = this.editData.accountId
+                        params.userId = this.userInfo().id
+                        this.getAction('/channel/updateChannels', params).then(res => {
+                            this.downLoading = false
+                            if (res.success) {
+                                this.visibleDownLoad = false
+                                const paramsData = this.form.getFieldsValue()
+                                this.handleGetTableList(paramsData)
+                            }
+                        })
+                    }
                 }
             })
         },

+ 7 - 5
src/views/modules/autoLaunch/channelManage/channelAdmin/components/checkCreat.vue

@@ -63,7 +63,7 @@
                                             >
                                                 <div class="config-check-one-left">
                                                     <h3 style="font-weight: bold;">系统生成</h3>
-                                                    <p style="line-height: 20px;">适用于渠道号比较固定客户和产品</p>
+                                                    <p style="line-height: 20px;border:0px;padding:0">适用于渠道号比较固定客户和产品</p>
                                                 </div>
                                                 <div class="config-check-one-right">
                                                     <img
@@ -80,7 +80,7 @@
                                             >
                                                 <div class="config-check-one-left">
                                                     <h3 style="font-weight: bold;">文件上传</h3>
-                                                    <p style="line-height: 20px;">适用于渠道号无明显规律的产品</p>
+                                                    <p style="line-height: 20px;border:0px;padding:0">适用于渠道号无明显规律的产品</p>
                                                 </div>
                                                 <div class="config-check-one-right">
                                                     <img
@@ -126,7 +126,7 @@
                                                 v-decorator="[
                                                     'projectId',
                                                     {
-                                                        rules: [{ required: true, message: '项目必选' }]
+                                                        rules: [{ required: true, message: '请选择项目' }]
                                                     }
                                                 ]"
                                             />
@@ -142,7 +142,7 @@
                                                 v-decorator="[
                                                     'accountId',
                                                     {
-                                                        rules: [{ required: true, message: '账户必选' }]
+                                                        rules: [{ required: true, message: '请选择账户' }]
                                                     }
                                                 ]"
                                             />
@@ -171,6 +171,7 @@
                                             />
                                         </a-form-item> -->
                                         <selectTable
+                                            requireCheck
                                             :projectId.sync="productId"
                                             ref="selectTableDownLoad"
                                             :labelCol="formItemLayout.labelCol"
@@ -180,6 +181,7 @@
                                 <a-row :gutter="16" class="check-else">
                                     <a-col :span="16">
                                         <selectTableProject
+                                            requireCheck
                                             :projectId.sync="projectId"
                                             :productId="productId"
                                             ref="selectTableProjectDownLoad"
@@ -298,7 +300,7 @@ export default {
                     }
                 })
             } else if (this.mode == 2) {
-                if (!!this.productId || !!this.projectId) {
+                if (!!this.productId && !!this.projectId) {
                     params.projectId = this.projectId
                     params.productId = this.productId
                     params.projectName = this.$refs.selectTableProjectDownLoad.keyValue

+ 7 - 1
src/views/modules/autoLaunch/channelManage/channelAdmin/components/uploadChannel.vue

@@ -66,7 +66,7 @@
                             <a-row :gutter="16">
                                 <a-col :span="16">
                                     <a-form-item v-bind="tailFormItemLayout">
-                                        <a-button type="primary" @click="handleOkDownLoad">导出渠道号模板</a-button>
+                                        <a-button type="primary" @click="handleOkDownLoad" :loading="downLoading">导出渠道号模板</a-button>
                                     </a-form-item>
                                 </a-col>
                             </a-row>
@@ -188,6 +188,7 @@ export default {
             mode: 1,
             productId: '',
             projectId: '',
+            downLoading:false,
             formItemLayout: {
                 labelCol: { span: 6 },
                 wrapperCol: { span: 16 }
@@ -242,10 +243,13 @@ export default {
                         }
                     })
                 } else {
+                    this.saveLoading = false
                     this.$message.error('请上传文件')
                 }
 
                 return
+            }else{
+                this.$message.error('请上传文件')
             }
         },
         goBack() {
@@ -259,6 +263,7 @@ export default {
             return this.formProject.getFieldValue(className)
         },
         handleOkDownLoad() {
+            this.downLoading = true
             let params = {}
             params.productId = this.createTypeData.productId
             params.projectId = this.createTypeData.projectId
@@ -275,6 +280,7 @@ export default {
                 downloadElement.click() //点击下载
                 document.body.removeChild(downloadElement) //下载完成移除元素
                 window.URL.revokeObjectURL(href) //释放掉blob对象
+                this.downLoading = false
             })
         },
         overUpload(file) {},

+ 97 - 39
src/views/modules/autoLaunch/channelManage/channelDetailList.vue

@@ -130,11 +130,18 @@
 
 <style lang="less" scoped>
 @import 'channelManage';
+::v-deep .ant-tag .anticon-close {
+    font-size: 16px;
+    color: red;
+}
 </style>
 <template>
     <div class="channelManage config-project">
         <a-card>
             <div class="table-page-search-wrapper">
+                <a-tag closable @close="closeLog" style="margin-bottom:15px;font-size: 16px;">
+                    {{ accountName }}
+                </a-tag>
                 <a-form layout="inline" :form="form" hide-required-mark :selfUpdate="true" @submit="handleQueryList">
                     <a-row :gutter="24">
                         <a-col :md="8" :sm="8" :xxl="6">
@@ -157,9 +164,7 @@
                         </a-col>
                     </a-row>
                 </a-form>
-                <a-tag closable @close="closeLog">
-                    {{accountId}}
-                </a-tag>
+
                 <!-- <a-row :gutter="24">
                     <a-col :md="8" :sm="8" :xxl="6">
                         <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
@@ -242,6 +247,10 @@
             :footer="null"
             @cancel="visibleChannel = false"
         >
+            <div style="width:100%;display:flex;margin-bottom:15px;font-weight:700;font-size:16px">
+                <span style="width:200px">项目:{{ projectName }}</span>
+                <span>使用层级:{{ usageLevel == 'account' ? '账户' : usageLevel == 'plan' ? '计划' : '组' }}</span>
+            </div>
             <a-table
                 :columns="detailColumns"
                 :dataSource="dataDetailSource"
@@ -432,7 +441,13 @@ let TTcolumns = [
     {
         title: '下载链接',
         dataIndex: 'url',
-        scopedSlots: { customRender: 'url' },
+        customRender: function(text) {
+            if (text) {
+                return text
+            } else {
+                return '-'
+            }
+        },
         align: 'center',
         key: 'url',
         width: 300
@@ -440,7 +455,13 @@ let TTcolumns = [
     {
         title: '调起链接',
         dataIndex: 'schemaUri',
-        scopedSlots: { customRender: 'schemaUri' },
+        customRender: function(text) {
+            if (text) {
+                return text
+            } else {
+                return '-'
+            }
+        },
         align: 'center',
         key: 'schemaUri',
         width: 300
@@ -448,7 +469,13 @@ let TTcolumns = [
     {
         title: '第三方点击监测链接',
         dataIndex: 'clickTrackUrl',
-        scopedSlots: { customRender: 'clickTrackUrl' },
+        customRender: function(text) {
+            if (text) {
+                return text
+            } else {
+                return '-'
+            }
+        },
         align: 'center',
         key: 'clickTrackUrl',
         width: 300
@@ -456,7 +483,13 @@ let TTcolumns = [
     {
         title: '第三方actionBar监测链接',
         dataIndex: 'actionbarClickUrl',
-        scopedSlots: { customRender: 'actionbarClickUrl' },
+        customRender: function(text) {
+            if (text) {
+                return text
+            } else {
+                return '-'
+            }
+        },
         align: 'center',
         key: 'actionbarClickUrl',
         width: 300
@@ -508,21 +541,21 @@ let TTcolumns = [
     //     align: 'center',
     //     key: 'usageTimes'
     // },
-    // {
-    //     title: '是否循环',
-    //     dataIndex: 'isCycle',
-    //     customRender: function(text) {
-    //         if (text == 1) {
-    //             return '是'
-    //         } else if (text == 0) {
-    //             return '否'
-    //         } else {
-    //             return text
-    //         }
-    //     },
-    //     align: 'center',
-    //     key: 'isCycle'
-    // },
+    {
+        title: '是否循环',
+        dataIndex: 'isCycle',
+        customRender: function(text) {
+            if (text == 1) {
+                return '是'
+            } else if (text == 0) {
+                return '否'
+            } else {
+                return text
+            }
+        },
+        align: 'center',
+        key: 'isCycle'
+    },
     // {
     //     title: '循环次数',
     //     dataIndex: 'cycleTimes',
@@ -547,12 +580,19 @@ let TTcolumns = [
 ]
 
 let detailColumns = [
+    // {
+    //     title: '渠道号',
+    //     dataIndex: 'channelCode',
+    //     scopedSlots: { customRender: 'channelCode' },
+    //     align: 'center',
+    //     key: 'channelCode'
+    // },
     {
-        title: '渠道号',
-        dataIndex: 'channelCode',
-        scopedSlots: { customRender: 'channelCode' },
+        title: '渠道号名称',
+        dataIndex: 'channelName',
+        scopedSlots: { customRender: 'channelName' },
         align: 'center',
-        key: 'channelCode'
+        key: 'channelName'
     },
     {
         title: '使用范围',
@@ -569,13 +609,13 @@ let detailColumns = [
         align: 'center',
         key: 'usageRange'
     },
-    {
-        title: '项目名称',
-        dataIndex: 'projectName',
-        scopedSlots: { customRender: 'projectName' },
-        align: 'center',
-        key: 'projectName'
-    },
+    // {
+    //     title: '项目名称',
+    //     dataIndex: 'projectName',
+    //     scopedSlots: { customRender: 'projectName' },
+    //     align: 'center',
+    //     key: 'projectName'
+    // },
     {
         title: '账户名称',
         dataIndex: 'authName',
@@ -626,11 +666,14 @@ export default {
             productId: '',
             projectId: '',
             accountId: '',
+            accountName: '',
+            projectName: '',
             selectedRowKeys: [],
             visibleChannel: false,
             visibleAddItem: false,
             visibleItem: false,
             channelCode: '',
+            usageLevel: '',
             channelType: 'a',
             createType: 1,
             indexAll: 0,
@@ -696,7 +739,7 @@ export default {
                     this.dataDetailLoading = true
                     var params = {}
                     params.accountId = localStorage.getItem('channelInfoAccountId')
-                        ? localStorage.getItem('channelInfoAccountId')
+                        ? JSON.parse(localStorage.getItem('channelInfoAccountId')).accountId
                         : null
                     params.projectId = localStorage.getItem('channelInfoProjectId')
                         ? localStorage.getItem('channelInfoProjectId')
@@ -764,7 +807,7 @@ export default {
     },
     methods: {
         moment,
-        closeLog(){
+        closeLog() {
             this.$router.replace('/autoLaunch/channelAdmin')
             this.$bus.$emit('remove', '/autoLaunch/channelDetailList')
         },
@@ -791,7 +834,7 @@ export default {
                 id: data.id,
                 state: checked ? 1 : 0
             }
-            getAction('/channel/updateChannel', paramsData)
+            getAction('/channel/updateChannelState', paramsData)
                 .then(result => {
                     if (result.code === 200) {
                         const paramsData = this.form.getFieldsValue()
@@ -893,8 +936,21 @@ export default {
             this.visibleChannel = true
             this.dataDetailLoading = true
             this.channelCode = item.channelCode
+            this.usageLevel = item.usageLevel
+            //      dataIndex: 'usageLevel',
+            // customRender: function(text) {
+            //     if (text == 'account') {
+            //         return '账户'
+            //     } else if (text == 'plan') {
+            //         return '计划'
+            //     } else if (text == 'group') {
+            //         return '组'
+            //     } else {
+            //         return text
+            //     }
+            // },
             var params = {}
-            params.accountId = localStorage.getItem('channelInfoAccountId')
+            params.accountId = JSON.parse(localStorage.getItem('channelInfoAccountId')).accountId
             params.channelCode = item.channelCode
             params.pageNo = this.ipaginationDetail.current
             params.pageSize = this.ipaginationDetail.pageSize
@@ -931,7 +987,7 @@ export default {
                 channelCode: data.channelCode,
                 channelName: data.channelName,
                 accountId: localStorage.getItem('channelInfoAccountId')
-                    ? localStorage.getItem('channelInfoAccountId')
+                    ? JSON.parse(localStorage.getItem('channelInfoAccountId')).accountId
                     : null,
                 projectId: localStorage.getItem('channelInfoProjectId')
                     ? localStorage.getItem('channelInfoProjectId')
@@ -1055,7 +1111,9 @@ export default {
         const paramsData = this.form.getFieldsValue()
         this.handleGetTableList(paramsData)
         if (localStorage.getItem('channelInfoAccountId')) {
-            this.accountId = localStorage.getItem('channelInfoAccountId')
+            this.accountId = JSON.parse(localStorage.getItem('channelInfoAccountId')).accountId
+            this.accountName = JSON.parse(localStorage.getItem('channelInfoAccountId')).accountName
+            this.projectName = JSON.parse(localStorage.getItem('channelInfoAccountId')).projectName
         } else {
             this.accountId = null
         }

+ 141 - 9
src/views/modules/autoLaunch/channelManage/components/creatApplication.vue

@@ -26,6 +26,53 @@
             <a-card :body-style="{ padding: '24px 32px' }" :bordered="false">
                 <a-form :form="form">
                     <a-form-item
+                        label="应用类型"
+                        :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
+                        :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
+                        class="require-class"
+                    >
+                        <a-radio-group
+                            button-style="solid"
+                            @change="clearData"
+                            v-decorator="[
+                                'appCreateType',
+                                {
+                                    rules: [{ required: true, message: '应用类型必选' }],
+                                    initialValue: 1
+                                }
+                            ]"
+                        >
+                            <a-radio-button :value="1">新建应用</a-radio-button>
+                            <a-radio-button :value="2" :disabled="createTypeData && !!!createTypeData.accountId"
+                                >选择应用</a-radio-button
+                            >
+                        </a-radio-group>
+                    </a-form-item>
+                    <a-form-item
+                        label="选择应用"
+                        :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
+                        :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
+                        v-if="getFormData('appCreateType') == 2"
+                        class="require-class"
+                    >
+                        <a-select
+                            v-decorator="['appId', { rules: [{ required: true, message: '请选择目标应用' }] }]"
+                            showSearch
+                            allowClear
+                            placeholder="选择应用目标"
+                            optionFilterProp="children"
+                            :filterOption="filterOption"
+                            @change="appIdChange"
+                        >
+                            <!-- <a-select-option value="0">请选择目标应用</a-select-option> -->
+                            <a-select-option v-for="appModel in appList" :key="appModel.appId" :value="appModel.appId">
+                                {{ appModel.appName }}&#12288;&nbsp;&#12288;
+                                {{ appModel.appVersion }}&#12288;&#12288;&#12288;{{ appModel.platform | platform }}
+                            </a-select-option>
+                        </a-select>
+                        <a-button type="primary" @click="addApplication" :loading="tongbuLoading">刷新应用</a-button>
+                    </a-form-item>
+                    <a-form-item
                         label="下载链接"
                         :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
                         :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
@@ -39,11 +86,12 @@
                                 }
                             ]"
                             id="url"
+                            :disabled="getFormData('appCreateType') == 2"
                         />
                         <a-tag
                             color="#2db7f5"
                             @click="getChangeAll('渠道号', 'form', 'url')"
-                            v-if="createTypeData && createTypeData.createType == '1'"
+                            v-if="getFormData('appCreateType') != 2"
                             >+渠道号</a-tag
                         >
                     </a-form-item>
@@ -61,6 +109,7 @@
                                     rules: [{ required: true, message: '请填写正确的应用包名称' }]
                                 }
                             ]"
+                            :disabled="getFormData('appCreateType') == 2"
                             placeholder="请填写包名称,如com.smile.gifmaker"
                         />
                     </a-form-item>
@@ -77,6 +126,7 @@
                                     rules: [{ required: true, message: '请填写应用名称' }]
                                 }
                             ]"
+                            :disabled="getFormData('appCreateType') == 2"
                             placeholder="请填写应用名称"
                         />
                     </a-form-item>
@@ -96,8 +146,9 @@
                             uploadType="image"
                             @overUpload="overUpload"
                             :size="100"
+                            :disabled="getFormData('appCreateType') == 2"
                         ></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="应用标记"
@@ -105,6 +156,7 @@
                         :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
                     >
                         <a-input
+                            :disabled="getFormData('appCreateType') == 2"
                             v-decorator="[
                                 'appVersion',
                                 {
@@ -117,7 +169,7 @@
                         <a-tag
                             color="#2db7f5"
                             @click="getChangeAll('渠道号', 'form', 'appVersion')"
-                            v-if="createTypeData && createTypeData.createType == '1'"
+                            v-if="getFormData('appCreateType') != 2"
                             >+渠道号</a-tag
                         >
                     </a-form-item>
@@ -127,6 +179,7 @@
                         :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
                     >
                         <a-input
+                            :disabled="getFormData('appCreateType') == 2"
                             v-decorator="[
                                 'appPrivacyUrl',
                                 {
@@ -163,6 +216,7 @@ export default {
     },
     data() {
         return {
+            appList: [],
             useSdk: [],
             loadDisabled: false,
             projectId: '',
@@ -202,16 +256,90 @@ export default {
             tokenHeader: { 'X-Access-Token': Vue.ls.get(ACCESS_TOKEN) },
             okCreated: false,
             dataFile: null,
-            createTypeData: null
+            createTypeData: null,
+            tongbuLoading: false
         }
     },
     methods: {
+        //获取表单的某一个属性值
+        getFormData(className) {
+            return this.form.getFieldValue(className)
+        },
+        filterOption(input, option) {
+            return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+        },
+        clearData() {
+            this.form.resetFields()
+            this.fileUrl = ''
+            this.$nextTick(() => {
+                this.getAppList()
+            })
+        },
+        addApplication() {
+            if (this.createTypeData.accountId) {
+                this.tongbuLoading = true
+                // this.$refs.application.showApplication()
+                getAction('/kuaishou/batch/syncAppList', {
+                    accountId: this.createTypeData.accountId
+                }).then(res => {
+                    if (res.success) {
+                        this.tongbuLoading = false
+                        this.$message.success(res.message)
+                        this.getAppList()
+                    } else {
+                        this.tongbuLoading = false
+                        this.$message.error(res.message)
+                    }
+                })
+            } else {
+                this.$message.error('请先选择账户')
+            }
+        },
+        appIdChange(val) {
+            if (val) {
+                getAction('/kuaishou/kuaiShouAppList/queryByAppId', { appId: val }).then(res => {
+                    if (res.success) {
+                        console.log(res)
+                        let resultData = res.result
+                        this.fileUrl = ''
+                        this.$nextTick(() => {
+                            this.form.setFieldsValue({
+                                appName: resultData.appName,
+                                appVersion: resultData.appVersion,
+                                packageName: resultData.packageName,
+                                url: resultData.url,
+                                appPrivacyUrl: resultData.appPrivacyUrl
+                            })
+                            this.fileUrl = resultData.appIconUrl
+                        })
+                    }
+                })
+            } else {
+                this.form.resetFields()
+                this.fileUrl = ''
+            }
+        },
+        // 获取applist
+        getAppList() {
+            let params = {}
+            params.accountId = this.createTypeData.accountId
+            getAction('/kuaishou/batch/getAppList', params).then(res => {
+                if (res.success) {
+                    this.appList = res.result.map((item, index) => {
+                        return {
+                            ...item,
+                            key: index
+                        }
+                    })
+                }
+            })
+        },
         getChangeAll(type, form, field) {
             var node = document.getElementById(field)
             var v = ''
             if (field == 'url') {
-                v = '{{' + type + '}}'
-            }else{
+                v = '-{{' + type + '}}-'
+            } else {
                 v = '-{{' + type + '}}-'
             }
             if (document.selection) {
@@ -479,21 +607,21 @@ export default {
                         this.confirmLoading = true
                         let params = {}
                         var reg = RegExp(/{{渠道号}}/)
-                        if(reg.test(values.url)&&reg.test(values.appVersion)){
+                        if (reg.test(values.url) && reg.test(values.appVersion)) {
                             this.url.insertTemplateUrl = '/kuaishouAppPackage/fillInLink'
                             params = { ...values }
                             params.appIconUrl = this.fileUrl
                             this.confirmLoading = false
                             this.$emit('getDataList', params)
                             this.handleCancel()
-                        }else if(!reg.test(values.url)&&!reg.test(values.appVersion)){
+                        } else if (!reg.test(values.url) && !reg.test(values.appVersion)) {
                             this.url.insertTemplateUrl = '/kuaishouAppPackage/fillInLink'
                             params = { ...values }
                             params.appIconUrl = this.fileUrl
                             this.confirmLoading = false
                             this.$emit('getDataList', params)
                             this.handleCancel()
-                        }else{
+                        } else {
                             this.confirmLoading = false
                             this.$message.error('下载链接必须和应用标记的通配符保持一致')
                         }
@@ -524,6 +652,10 @@ export default {
         params.pageSize = '1000'
         params.mediaId = '2'
         params.userId = this.userInfo().id
+        this.$nextTick(() => {
+            this.getAppList()
+        })
+
         getAction(this.url.userAllocationList, params).then(res => {
             if (res.success) {
                 this.accountList = res.result.records

+ 44 - 10
src/views/modules/autoLaunch/channelManage/createChannel.vue

@@ -303,11 +303,11 @@ li.chouzhen.first:before {
                                                     'channelName',
                                                     {
                                                         rules: [
-                                                            { required: true, message: '请填写渠道号' },
+                                                            { required: true, message: '请填写渠道号名称' },
                                                             {
                                                                 min: 1,
-                                                                max: 50,
-                                                                message: '渠道号名称不能超过50个字符',
+                                                                max: 40,
+                                                                message: '渠道号名称不能超过40个字符',
                                                                 trigger: 'blur'
                                                             }
                                                         ]
@@ -358,6 +358,11 @@ li.chouzhen.first:before {
                                                 @click="getChangeAll('渠道号', 'formProject', 'schemaUri')"
                                                 >+渠道号</a-tag
                                             >
+                                            <a-tag
+                                                color="#2db7f5"
+                                                @click="getChangeAll('编号', 'formProject', 'schemaUri')"
+                                                >+编号</a-tag
+                                            >
                                         </a-form-item>
                                     </a-col>
                                 </a-row>
@@ -387,6 +392,11 @@ li.chouzhen.first:before {
                                                 @click="getChangeAll('渠道号', 'formProject', 'clickTrackUrl')"
                                                 >+渠道号</a-tag
                                             >
+                                            <a-tag
+                                                color="#2db7f5"
+                                                @click="getChangeAll('编号', 'formProject', 'clickTrackUrl')"
+                                                >+编号</a-tag
+                                            >
                                         </a-form-item>
                                     </a-col>
                                 </a-row>
@@ -413,6 +423,11 @@ li.chouzhen.first:before {
                                                 @click="getChangeAll('渠道号', 'formProject', 'actionbarClickUrl')"
                                                 >+渠道号</a-tag
                                             >
+                                            <a-tag
+                                                color="#2db7f5"
+                                                @click="getChangeAll('编号', 'formProject', 'actionbarClickUrl')"
+                                                >+编号</a-tag
+                                            >
                                         </a-form-item>
                                     </a-col>
                                 </a-row>
@@ -440,13 +455,12 @@ li.chouzhen.first:before {
                                     <a-col :span="16">
                                         <a-form-item label="使用层级">
                                             <a-radio-group
-                                                
                                                 button-style="solid"
                                                 v-decorator="[
                                                     'usageLevel',
                                                     {
                                                         rules: [{ required: true, message: '使用层级必选' }],
-                                                        initialValue: 'account'
+                                                        initialValue: 'plan'
                                                     }
                                                 ]"
                                             >
@@ -461,7 +475,6 @@ li.chouzhen.first:before {
                                     <a-col :span="16">
                                         <a-form-item label="是否循环使用">
                                             <a-radio-group
-                                                
                                                 button-style="solid"
                                                 v-decorator="[
                                                     'isCycle',
@@ -649,11 +662,17 @@ export default {
         moment,
         ...mapGetters(['userInfo']),
         cpaBidValid(rule, value, callback) {
+            let length =
+                this.getFormData('numberLength') == 0 || this.getFormData('numberLength') == 5
+                    ? 5
+                    : this.getFormData('numberLength') == 3
+                    ? 3
+                    : 4
             let z = /-/g
             let a = /\//g
             let d = /\./g
-            if (value === '' || value === undefined || value === 0 || value === '0') {
-                callback('编号必须填写')
+            if (value === '' || value === undefined) {
+                callback('请填写编号')
             } else if (value.match(d)) {
                 callback('请填写正确编号')
             } else if (value.match(a)) {
@@ -664,8 +683,23 @@ export default {
                 callback('请填写正确编号')
             } else if (value.match(/[^0-9+-\/]/g)) {
                 callback('请填写正确编号')
+            } else if (value.match(z) && value.match(z).length == 1) {
+                console.log(value.split('-'))
+                if (Number(value.split('-')[0]) > Number(value.split('-')[1])) {
+                    callback('请填写正确编号')
+                } else {
+                    if (value.split('-')[0].length > length || value.split('-')[1].length > length) {
+                        callback('请填写正确编号')
+                    } else {
+                        callback()
+                    }
+                }
             } else if (/^[0-9]/g.test(value)) {
-                callback()
+                if (value.length > length) {
+                    callback('请填写正确编号')
+                } else {
+                    callback()
+                }
             } else {
                 callback()
             }
@@ -682,7 +716,7 @@ export default {
             if (field == 'channelName' || field == 'channelCode') {
                 v = '-{{' + type + '}}-'
             } else {
-                v = '{{' + type + '}}'
+                v = '-{{' + type + '}}-'
             }
 
             if (document.selection) {