浏览代码

Merge branch 'work-newChannel'

朱鑫波 3 年之前
父节点
当前提交
2489d0fc44

+ 2 - 2
src/utils/request.js

@@ -21,9 +21,9 @@ else if (process.env.NODE_ENV === 'debug') {
 else if (process.env.NODE_ENV === 'production') {
 	// axios.defaults.baseURL = 'http://apipre.tjyourong.com.cn/jeecg-boot'; // 预生产
 	// axios.defaults.baseURL = 'http://gateway.tjyourong.com.cn/jeecg-boot';//测试
-	axios.defaults.baseURL = 'http://api.tjyourong.com.cn/jeecg-boot'; // 生产环境
+	// axios.defaults.baseURL = 'http://api.tjyourong.com.cn/jeecg-boot'; // 生产环境
 	// axios.defaults.baseURL = 'http://gateway.tjyourong.com.cn/jeecg-boot'; // 测试环境
-	// axios.defaults.baseURL = 'http://192.168.0.195:9999/jeecg-boot'; // 测试环境
+	axios.defaults.baseURL = 'http://192.168.0.195:9999/jeecg-boot'; // 测试环境
 
 }
 const service = axios.create({

文件差异内容过多而无法显示
+ 999 - 0
src/views/modules/autoLaunch/channelManage/channelAdmin/components/channelList.vue


+ 59 - 0
src/views/modules/autoLaunch/channelManage/channelAdmin/components/channelManage.less

@@ -0,0 +1,59 @@
+.channelManage {
+    .middle-button {
+        margin: 0 8px;
+    }
+    .divider {
+        height: 62px;
+    }
+    .showNumBox {
+        background: white;
+        overflow: hidden;
+        margin: 15px 0;
+        padding: 30px 0;
+        text-align: center;
+        .ant-card-body {
+            padding-top: 0;
+        }
+        .title {
+            font-size: 14px;
+            font-family: PingFangSC-Regular, PingFang SC;
+            font-weight: 400;
+            color: #999999;
+            line-height: 22px;
+            display: inline-block;
+        }
+    }
+    .tabbody {
+        background: white;
+        padding: 0 24px;
+        margin-bottom: 15px;
+        .ant-tabs-bar {
+            margin: 0;
+        }
+    }
+    .chartBox {
+        background: white;
+        padding: 20px 0;
+    }
+    .tableBody {
+        background: white;
+        padding: 20px;
+    }
+}
+.channel-modal-content {
+    width: 100%;
+    height: 300px;
+    display: flex;
+    flex-direction: column;
+    .channel-modal-content-button {
+        width: 100%;
+        height: 100%;
+        margin: 10px;
+        display: flex;
+        align-items: center;
+        .introduce{
+            margin-left: 10px;
+        }
+
+    }
+}

+ 333 - 0
src/views/modules/autoLaunch/channelManage/channelAdmin/components/checkCreat.vue

@@ -0,0 +1,333 @@
+<style scoped lang="scss">
+.flex-main {
+    display: flex;
+    margin-bottom: 10px;
+    p {
+        color: black;
+        font-weight: 600;
+        overflow: hidden; //超出的文本隐藏
+        text-overflow: ellipsis; //溢出用省略号显示
+        white-space: nowrap; //溢出不换行
+    }
+}
+.config-check {
+    width: 100%;
+    display: flex;
+    .config-check-one {
+        width: 250px;
+        height: 125px;
+        border: 1px solid #f2f2f2;
+        padding: 20px;
+        display: flex;
+        margin-right: 15px;
+        border-radius: 10px;
+        cursor: pointer;
+
+        .config-check-one-left {
+            width: 70%;
+            height: 100%;
+        }
+        .config-check-one-right {
+            width: 30%;
+            height: 100%;
+            position: relative;
+        }
+    }
+    .config-check-active {
+        border-color: rgb(38, 122, 251) !important;
+    }
+}
+::v-deep .check-else .vue-treeselect__control {
+    line-height: 20px !important;
+}
+::v-deep .check-else .ant-form-item-control {
+    height: auto !important;
+    line-height: 20px !important;
+}
+</style>
+<template>
+    <div ref="questionnaireBox" class="new-batch config-new-batch">
+        <div class="chartBox">
+            <a-row :gutter="20">
+                <a-col :sm="24" style="margin-bottom: 20px; z-index: 10" id="container">
+                    <a-card class="search-box step-jump">
+                        <a-form layout="horizontal" v-bind="formItemLayout" :form="formProject">
+                            <a-row :gutter="16">
+                                <a-col :span="16">
+                                    <a-form-item label="选择渠道号的创建方式">
+                                        <div class="config-check">
+                                            <div
+                                                class="config-check-one "
+                                                :class="{ 'config-check-active': mode == 1 }"
+                                                @click="checkMode(1)"
+                                            >
+                                                <div class="config-check-one-left">
+                                                    <h3 style="font-weight: bold;">系统生成</h3>
+                                                    <p style="line-height: 20px;border:0px;padding:0">适用于渠道号比较固定的客户和产品</p>
+                                                </div>
+                                                <div class="config-check-one-right">
+                                                    <img
+                                                        src="./images/system.png"
+                                                        style="width:100%;height:auto;position:absolute;top:20%"
+                                                        alt=""
+                                                    />
+                                                </div>
+                                            </div>
+                                            <div
+                                                class="config-check-one"
+                                                :class="{ 'config-check-active': mode == 2 }"
+                                                @click="checkMode(2)"
+                                            >
+                                                <div class="config-check-one-left">
+                                                    <h3 style="font-weight: bold;">文件上传</h3>
+                                                    <p style="line-height: 20px;border:0px;padding:0">适用于渠道号无明显规律的产品</p>
+                                                </div>
+                                                <div class="config-check-one-right">
+                                                    <img
+                                                        src="./images/upload.png"
+                                                        style="width:100%;height:auto;position:absolute;top:20%"
+                                                        alt=""
+                                                    />
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </a-form-item>
+                                </a-col>
+                            </a-row>
+                            <div v-if="mode == 1">
+                                <a-row :gutter="16">
+                                    <a-col :span="16">
+                                        <a-form-item label="使用范围">
+                                            <a-radio-group
+                                                button-style="solid"
+                                                v-decorator="[
+                                                    'usageRange',
+                                                    {
+                                                        rules: [{ required: true, message: '使用范围必选' }],
+                                                        initialValue: 2
+                                                    }
+                                                ]"
+                                            >
+                                                <a-radio-button :value="2">项目</a-radio-button>
+                                                <a-radio-button :value="1">账户</a-radio-button>
+                                            </a-radio-group>
+                                        </a-form-item>
+                                    </a-col>
+                                </a-row>
+                                <a-row
+                                    :gutter="16"
+                                    v-if="getFormData('usageRange') == 2 || getFormData('usageRange') == undefined"
+                                    class="check-else"
+                                >
+                                    <a-col :span="16">
+                                        <a-form-item label="选择项目">
+                                            <Treeselect
+                                                style="width:600px"
+                                                v-decorator="[
+                                                    'projectId',
+                                                    {
+                                                        rules: [{ required: true, message: '请选择项目' }]
+                                                    }
+                                                ]"
+                                            />
+                                        </a-form-item>
+                                    </a-col>
+                                </a-row>
+                                <a-row :gutter="16" v-else class="check-else">
+                                    <a-col :span="16">
+                                        <a-form-item label="选择账户">
+                                            <treeSelectAccount
+                                                style="width:600px"
+                                                :appId="getFormData('accountId')"
+                                                v-decorator="[
+                                                    'accountId',
+                                                    {
+                                                        rules: [{ required: true, message: '请选择账户' }]
+                                                    }
+                                                ]"
+                                            />
+                                        </a-form-item>
+                                    </a-col>
+                                </a-row>
+                            </div>
+                            <!-- <selectTable :projectId.sync="productIdDownLoad" ref="selectTableDownLoad"></selectTable>
+            <selectTableProject
+                :projectId.sync="projectIdDownLoad"
+                :productId="productIdDownLoad"
+                ref="selectTableProjectDownLoad"
+            ></selectTableProject> -->
+                            <div v-else-if="mode == 2">
+                                <a-row :gutter="16" class="check-else">
+                                    <a-col :span="16">
+                                        <!-- <a-form-item label="选择项目">
+                                            <Treeselect
+                                                style="width:600px"
+                                                v-decorator="[
+                                                    'projectId',
+                                                    {
+                                                        rules: [{ required: true, message: '项目必选' }]
+                                                    }
+                                                ]"
+                                            />
+                                        </a-form-item> -->
+                                        <selectTable
+                                            requireCheck
+                                            :projectId.sync="productId"
+                                            ref="selectTableDownLoad"
+                                            :labelCol="formItemLayout.labelCol"
+                                        ></selectTable>
+                                    </a-col>
+                                </a-row>
+                                <a-row :gutter="16" class="check-else">
+                                    <a-col :span="16">
+                                        <selectTableProject
+                                            requireCheck
+                                            :projectId.sync="projectId"
+                                            :productId="productId"
+                                            ref="selectTableProjectDownLoad"
+                                            :labelCol="formItemLayout.labelCol"
+                                        ></selectTableProject>
+                                    </a-col>
+                                </a-row>
+                            </div>
+                        </a-form>
+                    </a-card>
+                </a-col>
+            </a-row>
+        </div>
+        <div style="width:100%;display:flex;    justify-content: flex-end;">
+            <a-button type="default" style="margin-right: 15px" @click="goBack">取消</a-button>
+            <a-button type="primary" style="margin-right: 15px" @click="saveHandler" :loading="saveLoading"
+                >下一步</a-button
+            >
+        </div>
+    </div>
+</template>
+
+<script>
+// import EditableCell from './editablCell'
+// import lookPreviewVue from './lookPreview.vue'
+import Treeselect from '../../components/treeSelectProject.vue'
+import treeSelectAccount from '../../components/treeSelectAccount.vue'
+import selectTable from '@/views/modules/material/comment/selectTable.vue'
+import selectTableProject from '@/views/modules/Statistics/components/selectPagination.vue'
+function tqFun(qcArr1) {
+    var tempArr = []
+    function bbFun(qcArr) {
+        for (var i = 0; i < qcArr.length; i++) {
+            if (qcArr[i] instanceof Array) {
+                bbFun(qcArr[i])
+            } else {
+                tempArr.push(qcArr[i])
+            }
+        }
+        return tempArr
+    }
+    return bbFun(qcArr1)
+}
+
+export default {
+    name: 'GlobalHeader',
+    components: {
+        Treeselect,
+        treeSelectAccount,
+        selectTable,
+        selectTableProject
+    },
+    data() {
+        return {
+            formProject: this.$form.createForm(this), //选择项目表单
+            saveLoading: false,
+            mode: 1,
+            productId: '',
+            projectId: '',
+            formItemLayout: {
+                labelCol: { span: 6 },
+                wrapperCol: { span: 16 }
+            },
+            tailFormItemLayout: {
+                wrapperCol: {
+                    sm: {
+                        span: 18,
+                        offset: 6
+                    }
+                }
+            }
+        }
+    },
+    computed: {},
+    watch: {
+        productId: function(n, o) {
+            if (n != '') {
+                this.$refs.selectTableProjectDownLoad.keyValue = ''
+                this.$refs.selectTableProjectDownLoad.getData(n)
+            }
+        }
+    },
+    mounted() {
+        if (this.$route) {
+            let editRecordId = this.$route.query.accountId
+            if (editRecordId) {
+                this.$nextTick(() => {
+                    this.formProject.setFieldsValue({ usageRange: 1 })
+                    setTimeout(() => {
+                        this.formProject.setFieldsValue({ accountId: Number(editRecordId) })
+                        this.accountId = Number(editRecordId)
+                    }, 100)
+                })
+            }
+        }
+    },
+    filters: {},
+    methods: {
+        saveHandler() {
+            let params = {}
+
+            if (this.mode == 1) {
+                this.formProject.validateFields((err, values) => {
+                    if (!err) {
+                        params.usageRange = values.usageRange
+                        if (values.usageRange == 2) {
+                            params.projectId = values.projectId
+                        } else if (values.usageRange == 1) {
+                            params.accountId = values.accountId
+                        }
+                        params.createType = '1'
+                        localStorage.setItem('channelInfo', JSON.stringify(params))
+                        this.$emit('nextStep')
+                    } else {
+                        return
+                    }
+                })
+            } else if (this.mode == 2) {
+                if (!!this.productId && !!this.projectId) {
+                    params.projectId = this.projectId
+                    params.productId = this.productId
+                    params.projectName = this.$refs.selectTableProjectDownLoad.keyValue
+                    params.createType = '2'
+                    localStorage.setItem('channelInfo', JSON.stringify(params))
+                    this.$emit('nextStep')
+                } else {
+                    this.$message.error('创建方式为文件上传,请选择产品名称和项目名称')
+                    return
+                }
+            }
+        },
+        goBack() {
+            this.$router.replace('/autoLaunch/channelAdmin')
+            
+            this.$bus.$emit('remove', '/autoLaunch/createChannelIndex')
+            this.$bus.$emit('remove', '/autoLaunch/createChannelIndex?accountId='+this.$route.query.accountId)
+        },
+        checkMode(key) {
+            this.mode = key
+            this.productId = ''
+            this.projectId = ''
+        },
+        //获取表单的某一个属性值
+        getFormData(className) {
+            return this.formProject.getFieldValue(className)
+        }
+    }
+}
+</script>

二进制
src/views/modules/autoLaunch/channelManage/channelAdmin/components/images/system.png


二进制
src/views/modules/autoLaunch/channelManage/channelAdmin/components/images/upload.png


+ 313 - 0
src/views/modules/autoLaunch/channelManage/channelAdmin/components/uploadChannel.vue

@@ -0,0 +1,313 @@
+<style scoped lang="scss">
+::v-deep.ant-form-item {
+    margin-bottom: 10px !important;
+}
+.flex-main {
+    display: flex;
+    margin-bottom: 10px;
+    p {
+        color: black;
+        font-weight: 600;
+        overflow: hidden; //超出的文本隐藏
+        text-overflow: ellipsis; //溢出用省略号显示
+        white-space: nowrap; //溢出不换行
+    }
+}
+.config-check {
+    width: 100%;
+    display: flex;
+    .config-check-one {
+        width: 250px;
+        height: 125px;
+        border: 1px solid #f2f2f2;
+        padding: 20px;
+        display: flex;
+        margin-right: 15px;
+        border-radius: 10px;
+        cursor: pointer;
+
+        .config-check-one-left {
+            width: 70%;
+            height: 100%;
+        }
+        .config-check-one-right {
+            width: 30%;
+            height: 100%;
+            position: relative;
+        }
+    }
+    .config-check-active {
+        border-color: rgb(38, 122, 251) !important;
+    }
+}
+::v-deep .check-else .vue-treeselect__control {
+    line-height: 20px !important;
+}
+::v-deep .check-else .ant-form-item-control {
+    height: auto !important;
+    line-height: 20px !important;
+}
+</style>
+<template>
+    <div ref="questionnaireBox" class="new-batch config-new-batch">
+        <div class="chartBox">
+            <a-row :gutter="20">
+                <a-col :sm="24" style="margin-bottom: 20px; z-index: 10" id="container">
+                    <a-card class="search-box step-jump">
+                        <a-form layout="horizontal" v-bind="formItemLayout" :form="formProject">
+                            <a-row :gutter="16">
+                                <a-col :span="16">
+                                    <a-form-item label="项目名称">
+                                        <span v-if="createTypeData.projectName">{{ createTypeData.projectName }}</span>
+                                        <span v-else>-</span>
+                                    </a-form-item>
+                                </a-col>
+                            </a-row>
+                            <a-row :gutter="16">
+                                <a-col :span="16">
+                                    <a-form-item v-bind="tailFormItemLayout">
+                                        <a-button type="primary" @click="handleOkDownLoad" :loading="downLoading">导出渠道号模板</a-button>
+                                    </a-form-item>
+                                </a-col>
+                            </a-row>
+                            <a-row :gutter="16">
+                                <a-col :span="16">
+                                    <a-form-item label="操作系统">
+                                        <a-radio-group
+                                            button-style="solid"
+                                            v-decorator="[
+                                                'plam_os',
+                                                {
+                                                    rules: [{ required: true, message: '是否关联单品必选' }],
+                                                    initialValue: 1
+                                                }
+                                            ]"
+                                        >
+                                            <a-radio-button :value="1">安卓</a-radio-button>
+                                            <a-radio-button :value="0" disabled>IOS</a-radio-button>
+                                        </a-radio-group>
+                                    </a-form-item>
+                                </a-col>
+                            </a-row>
+                            <a-row :gutter="16">
+                                <a-col :span="16">
+                                    <a-form-item label="上传图标">
+                                        <uploadFile
+                                            :value.sync="fileUrl"
+                                            :multiple="false"
+                                            :fileCount="1"
+                                            uploadType="image"
+                                            @overUpload="overUpload"
+                                            :size="100"
+                                        ></uploadFile>
+                                        <p class="upload-txt-rules">
+                                            文件格式:支持上传png/jpg/jpeg图片,尺寸450*450,小于100KB
+                                        </p>
+                                    </a-form-item>
+                                </a-col>
+                            </a-row>
+                            <a-row :gutter="16">
+                                <a-col :span="16">
+                                    <a-form-item label="上传文件" class="require-class fileUpload" id="fileUpload">
+                                        <a-upload
+                                            name="file"
+                                            :multiple="false"
+                                            :headers="tokenHeader"
+                                            :file-list="fileList"
+                                            :showUploadList="false"
+                                            :beforeUpload="beforeUpload"
+                                            @change="handleChange"
+                                            style="margin-right: 20px"
+                                        >
+                                            <a-button :disabled="fileUrl == ''">
+                                                <a-icon type="upload" />
+                                                {{ loadDisabled ? '上传中,请稍后' : '文件上传' }}
+                                            </a-button>
+                                        </a-upload>
+                                    </a-form-item>
+                                </a-col>
+                            </a-row>
+                        </a-form>
+                    </a-card>
+                </a-col>
+            </a-row>
+        </div>
+        <div style="width:100%;display:flex;    justify-content: flex-end;">
+            <a-button type="default" style="margin-right: 15px" @click="goBack">取消</a-button>
+            <a-button type="primary" style="margin-right: 15px" @click="saveHandler" :loading="saveLoading"
+                >确定</a-button
+            >
+        </div>
+    </div>
+</template>
+
+<script>
+// import EditableCell from './editablCell'
+// import lookPreviewVue from './lookPreview.vue'
+import Treeselect from '../../components/treeSelectProject.vue'
+import treeSelectAccount from '../../components/treeSelectAccount.vue'
+import selectTable from '@/views/modules/material/comment/selectTable.vue'
+import selectTableProject from '@/views/modules/Statistics/components/selectPagination.vue'
+
+import { getAction, postAction, downFile, downFilePost } from '@/api/manage'
+import { mapGetters } from 'vuex'
+import uploadFile from '../../components/uploadFile.vue'
+
+import Vue from 'vue'
+import { ACCESS_TOKEN } from '@/store/mutation-types'
+import $ from 'jquery'
+const fileSuffix = ['xlsx', 'xls', 'zip']
+function tqFun(qcArr1) {
+    var tempArr = []
+    function bbFun(qcArr) {
+        for (var i = 0; i < qcArr.length; i++) {
+            if (qcArr[i] instanceof Array) {
+                bbFun(qcArr[i])
+            } else {
+                tempArr.push(qcArr[i])
+            }
+        }
+        return tempArr
+    }
+    return bbFun(qcArr1)
+}
+
+export default {
+    name: 'GlobalHeader',
+    components: {
+        Treeselect,
+        treeSelectAccount,
+        selectTable,
+        selectTableProject,
+        uploadFile
+    },
+    data() {
+        return {
+            formProject: this.$form.createForm(this), //选择项目表单
+            saveLoading: false,
+            mode: 1,
+            productId: '',
+            projectId: '',
+            downLoading:false,
+            formItemLayout: {
+                labelCol: { span: 6 },
+                wrapperCol: { span: 16 }
+            },
+            tailFormItemLayout: {
+                wrapperCol: {
+                    sm: {
+                        span: 16,
+                        offset: 6
+                    }
+                }
+            },
+            createTypeData: { createType: '1', projectId: null, projectName: null },
+            loadDisabled: false,
+            fileUrl: '',
+            tokenHeader: { 'X-Access-Token': Vue.ls.get(ACCESS_TOKEN) },
+            fileList: [],
+            dataFile: null
+        }
+    },
+    computed: {},
+    watch: {},
+    mounted() {
+        this.$nextTick(() => {
+            this.createTypeData = JSON.parse(localStorage.getItem('channelInfo'))
+        })
+    },
+    filters: {},
+    methods: {
+        ...mapGetters(['userInfo']),
+        saveHandler() {
+            if (!!this.fileUrl) {
+                this.saveLoading = true
+                if (this.dataFile) {
+                    let formData = new FormData()
+                    formData.append('file', this.dataFile)
+                    formData.append('imageUrl', this.fileUrl)
+
+                    postAction('/channel/importChannelExcel', formData).then(res => {
+                        this.saveLoading = false
+                        if (res.code === 200) {
+                            this.$message.success(res.message)
+                            localStorage.removeItem('channelInfo')
+                            this.$router.replace('/autoLaunch/channelAdmin')
+                            this.$bus.$emit('remove', '/autoLaunch/createChannelIndex')
+                            this.$bus.$emit(
+                                'remove',
+                                '/autoLaunch/createChannelIndex?accountId=' + this.$route.query.accountId
+                            )
+                        } else {
+                            this.$message.error(res.message)
+                        }
+                    })
+                } else {
+                    this.saveLoading = false
+                    this.$message.error('请上传文件')
+                }
+
+                return
+            }else{
+                this.$message.error('请上传文件')
+            }
+        },
+        goBack() {
+            localStorage.removeItem('channelInfo')
+            this.$router.replace('/autoLaunch/channelAdmin')
+            this.$bus.$emit('remove', '/autoLaunch/createChannelIndex')
+            this.$bus.$emit('remove', '/autoLaunch/createChannelIndex?accountId=' + this.$route.query.accountId)
+        },
+        //获取表单的某一个属性值
+        getFormData(className) {
+            return this.formProject.getFieldValue(className)
+        },
+        handleOkDownLoad() {
+            this.downLoading = true
+            let params = {}
+            params.productId = this.createTypeData.productId
+            params.projectId = this.createTypeData.projectId
+            params.userId = this.userInfo().id
+            downFile('/channel/exportChannelTemplate', params).then(res => {
+                let blob = new Blob([res], {
+                    type: 'application/vnd.openxmlformats-officedocument.spre1adsheetml.sheet'
+                })
+                let downloadElement = document.createElement('a')
+                let href = window.URL.createObjectURL(blob) //创建下载的链接
+                downloadElement.href = href
+                downloadElement.download = '渠道号模板.xlsx' //下载后文件名
+                document.body.appendChild(downloadElement)
+                downloadElement.click() //点击下载
+                document.body.removeChild(downloadElement) //下载完成移除元素
+                window.URL.revokeObjectURL(href) //释放掉blob对象
+                this.downLoading = false
+            })
+        },
+        overUpload(file) {},
+        handleChange() {
+            this.loadDisabled = false
+            this.$message.success('文件导入成功')
+        },
+        beforeUpload(file) {
+            this.dataFile = $('.fileUpload')
+                .eq(0)
+                .find('input')[0].files[0]
+            this.loadDisabled = true
+            const size = (Number(file.size) / (1024 * 1024)).toFixed(2)
+            const fileName = file.name
+            const fileStrArr = fileName.split('.')
+            const suffix = fileStrArr[fileStrArr.length - 1]
+
+            let result = fileSuffix.some(item => {
+                return item === suffix
+            })
+
+            if (!result) {
+                this.$message.error('不支持该文件类型')
+                this.loadDisabled = false
+                return Promise.reject()
+            }
+        }
+    }
+}
+</script>

+ 80 - 0
src/views/modules/autoLaunch/channelManage/channelAdmin/createChannelIndex.vue

@@ -0,0 +1,80 @@
+<template>
+    <a-card :bordered="false">
+        <a-steps class="steps" :current="currentTab">
+            <a-step title="基础信息" />
+            <a-step title="渠道号" />
+        </a-steps>
+        <div class="content">
+            <step1 v-if="currentTab === 0" @nextStep="nextStep" ref="step" />
+            <step2 v-if="currentTab === 1" />
+            <step3 v-if="currentTab === 2" />
+        </div>
+    </a-card>
+</template>
+
+<script>
+import Step1 from './components/checkCreat'
+import Step2 from '../createChannel'
+import Step3 from './components/uploadChannel'
+export default {
+    name: 'StepForm',
+    components: {
+        Step1,
+        Step2,
+        Step3
+    },
+    data() {
+        return {
+            currentTab: 0,
+
+            // form
+            form: null,
+            campaignId: null,
+            formComponent: null
+        }
+    },
+    methods: {
+        // handler
+        nextStep() {
+            // if (this.currentTab < 2) {
+            //     this.currentTab += 1
+            // }
+            if (JSON.parse(localStorage.getItem('channelInfo')).createType == '1') {
+                this.currentTab = 1
+            } else {
+                this.currentTab = 2
+            }
+        },
+        prevStep() {
+            if (this.currentTab > 0) {
+                this.currentTab -= 1
+            }
+        },
+        finish() {
+            this.currentTab = 0
+        },
+        remove(key) {
+            this.$emit('removeTab', key)
+        }
+    },
+    watch: {},
+    mounted() {
+        if (localStorage.getItem('channelInfo')) {
+            if (JSON.parse(localStorage.getItem('channelInfo')).createType == '1') {
+                this.currentTab = 1
+            } else {
+                this.currentTab = 2
+            }
+        } else {
+            this.currentTab = 0
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.steps {
+    max-width: 750px;
+    margin: 16px auto;
+}
+</style>

+ 252 - 0
src/views/modules/autoLaunch/channelManage/channelAdmin/index.vue

@@ -0,0 +1,252 @@
+<style lang="scss" scoped>
+.search-bar {
+    display: flex;
+    align-items: center;
+}
+.search-box p {
+    display: inline-block;
+    border: 1px solid #f2f2f2;
+    border-radius: 5px;
+    margin-right: 10px;
+    padding: 5px 10px;
+    cursor: pointer;
+}
+.card-person-drawer {
+    width: 100%;
+    height: 90%;
+    overflow: hidden;
+    padding: 10px 0px;
+    display: flex;
+    flex-wrap: wrap;
+    margin-right: -10px;
+    justify-content: space-between;
+    ::v-deep .ant-card-body {
+        padding: 0;
+    }
+    ::v-deep .ant-card-head {
+        padding: 0 5px;
+    }
+    .card-item {
+        width: calc(25% - 10px);
+        margin-bottom: 10px;
+        float: left;
+    }
+    .card-item-else {
+        width: calc(20% - 10px);
+        margin-bottom: 10px;
+        float: left;
+    }
+}
+</style>
+<style scoped>
+.showNumBox {
+    margin: 10px 0;
+}
+.showNumBox .ant-card-body {
+    display: flex;
+    justify-content: center;
+}
+.showNumBox p,
+.showNumBox span {
+    text-align: center;
+    line-height: 40px;
+    font-size: 30px;
+    font-weight: 600;
+    color: red;
+    margin: 0;
+}
+.search-box .ant-card-body {
+    padding: 5px 15px;
+}
+.showNumBox .ant-card-body .styleElse {
+    line-height: 60px;
+    height: 40px;
+    font-size: 16px;
+    font-weight: 400;
+    margin-left: 10px;
+}
+.ant-modal-wrap .yincang .ant-modal-content .ant-modal-footer {
+    display: none !important;
+}
+.yincang .ant-col-6 p {
+    text-align: left;
+    color: red;
+    font-size: 16px;
+    font-weight: 500;
+}
+.ant-table-thead div {
+    font-weight: 700;
+}
+.tool-tip {
+    position: absolute;
+    top: 65px;
+    right: 10px;
+}
+</style>
+<style lang="less" scoped>
+.ant-card-head .ant-tabs-bar {
+    padding: 0;
+}
+.search-box .ant-card-body {
+    padding: 5px 15px;
+}
+.search-box {
+    padding: 15px 10px;
+}
+.search-box p {
+    display: inline-block;
+    border: 1px solid #f2f2f2;
+    border-radius: 5px;
+    margin-right: 10px;
+    padding: 5px 10px;
+    cursor: pointer;
+}
+.statistics .ant-col-6 .ant-card-body .styleElse {
+    line-height: 60px;
+    height: 40px;
+    font-size: 16px;
+    font-weight: 400;
+    margin-left: 10px;
+}
+.ant-modal-wrap .yincang .ant-modal-content .ant-modal-footer {
+    display: none !important;
+}
+.yincang .ant-col-6 p {
+    text-align: left;
+    color: red;
+    font-size: 16px;
+    font-weight: 500;
+}
+.ant-table-thead div {
+    font-weight: 700;
+}
+.tool-tip {
+    position: absolute;
+    top: 65px;
+    right: 10px;
+}
+.statistics {
+    .ant-card-bordered {
+        border: none;
+    }
+    .ant-card-head .ant-tabs {
+        clear: both;
+        margin-bottom: -13px;
+        color: rgba(0, 0, 0, 0.65);
+        font-weight: normal;
+        font-size: 14px;
+    }
+    .duibi {
+        position: absolute;
+        right: 24px;
+        top: 15px;
+    }
+    p {
+        margin-bottom: 0;
+    }
+}
+</style>
+
+<style lang="less" scoped>
+.middle-button {
+    margin: 0 8px;
+}
+.newPlanStatic {
+    .divider {
+        height: 62px;
+    }
+    .showNumBox {
+        background: white;
+        overflow: hidden;
+        margin: 15px 0;
+        padding: 30px 0;
+        text-align: center;
+        .ant-card-body {
+            padding-top: 0;
+        }
+        .title {
+            font-size: 14px;
+            font-family: PingFangSC-Regular, PingFang SC;
+            font-weight: 400;
+            color: #999999;
+            line-height: 22px;
+            display: inline-block;
+        }
+    }
+    .tabbody {
+        background: white;
+        padding: 0 24px;
+        margin-bottom: 15px;
+        .ant-tabs-bar {
+            margin: 0;
+        }
+    }
+    .chartBox {
+        background: white;
+        padding: 20px 0;
+    }
+    .tableBody {
+        background: white;
+        padding: 20px;
+    }
+}
+</style>
+<template>
+    <div class="newPlanStatic config-project">
+        <div class="tabbody">
+            <a-tabs v-model="tabKey" @change="tabChange">
+                <a-tab-pane key="channelList" tab="渠道号"> </a-tab-pane>
+                <a-tab-pane key="2" tab="单品" disabled> </a-tab-pane>
+                <!-- <a-button slot="tabBarExtraContent" type="primary" @click="newCreat(null)">
+                    创建渠道号
+                </a-button> -->
+            </a-tabs>
+        </div>
+        <component v-bind:is="currentTabComponent"></component>
+
+    </div>
+</template>
+
+<script>
+import moment from 'moment'
+
+let KScolumns = []
+
+export default {
+    components: {
+        channelList: () => import('./components/channelList'),
+    },
+
+    data() {
+        return {
+            currentTabComponent: 'channelList',
+  
+            tabKey: 'channelList',
+
+        }
+    },
+    methods: {
+        moment,
+
+        // 快手头条的切换
+        tabChange(key) {
+            this.currentTabComponent = key;
+        },
+
+    },
+    watch: {
+
+    },
+    computed: {
+      
+    },
+    mounted() {
+       
+    },
+    activated: function() {},
+
+    filters: {
+        
+    }
+}
+</script>

+ 113 - 48
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,7 +164,8 @@
                         </a-col>
                     </a-row>
                 </a-form>
-                <a-row :gutter="24">
+
+                <!-- <a-row :gutter="24">
                     <a-col :md="8" :sm="8" :xxl="6">
                         <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
                             <a-button type="primary" @click="visibleAddItem = true">添加单品</a-button>
@@ -170,7 +178,7 @@
                             >
                         </span>
                     </a-col>
-                </a-row>
+                </a-row> -->
             </div>
         </a-card>
 
@@ -209,7 +217,7 @@
                                     : '-'
                             }}
                         </span>
-                        <span slot="state" slot-scope="text, record">
+                        <span slot="channelState" slot-scope="text, record">
                             <a-switch :checked="text === 1" @change="handleSwitchChang($event, record)" />
                         </span>
                         <span slot="action" slot-scope="text, records">
@@ -239,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="min-width:250px;white-space:nowrap;">项目:{{ projectName }}</span>
+                <span>使用层级:{{ usageLevel == 'account' ? '账户' : usageLevel == 'plan' ? '计划' : '组' }}</span>
+            </div>
             <a-table
                 :columns="detailColumns"
                 :dataSource="dataDetailSource"
@@ -381,10 +393,10 @@ import Treeselect from './components/treeSelectProject.vue'
 let TTcolumns = [
     {
         title: '开关',
-        dataIndex: 'state',
-        scopedSlots: { customRender: 'state' },
+        dataIndex: 'channelState',
+        scopedSlots: { customRender: 'channelState' },
         align: 'center',
-        key: 'state'
+        key: 'channelState'
     },
     {
         title: '生成方式(来源)',
@@ -429,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
@@ -437,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
@@ -445,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
@@ -453,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
@@ -498,13 +534,13 @@ let TTcolumns = [
         align: 'center',
         key: 'usageLevel'
     },
-    {
-        title: '使用次数',
-        dataIndex: 'usageTimes',
-        scopedSlots: { customRender: 'usageTimes' },
-        align: 'center',
-        key: 'usageTimes'
-    },
+    // {
+    //     title: '使用次数',
+    //     dataIndex: 'usageTimes',
+    //     scopedSlots: { customRender: 'usageTimes' },
+    //     align: 'center',
+    //     key: 'usageTimes'
+    // },
     {
         title: '是否循环',
         dataIndex: 'isCycle',
@@ -520,20 +556,20 @@ let TTcolumns = [
         align: 'center',
         key: 'isCycle'
     },
-    {
-        title: '循环次数',
-        dataIndex: 'cycleTimes',
-        scopedSlots: { customRender: 'cycleTimes' },
-        align: 'center',
-        key: 'cycleTimes'
-    },
-    {
-        title: '当前已循环次数',
-        dataIndex: 'haveCycleTimes',
-        scopedSlots: { customRender: 'haveCycleTimes' },
-        align: 'center',
-        key: 'haveCycleTimes'
-    },
+    // {
+    //     title: '循环次数',
+    //     dataIndex: 'cycleTimes',
+    //     scopedSlots: { customRender: 'cycleTimes' },
+    //     align: 'center',
+    //     key: 'cycleTimes'
+    // },
+    // {
+    //     title: '当前已循环次数',
+    //     dataIndex: 'haveCycleTimes',
+    //     scopedSlots: { customRender: 'haveCycleTimes' },
+    //     align: 'center',
+    //     key: 'haveCycleTimes'
+    // },
     {
         title: '使用明细',
         dataIndex: 'action',
@@ -544,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: '使用范围',
@@ -566,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',
@@ -623,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,
@@ -693,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')
@@ -761,6 +807,10 @@ export default {
     },
     methods: {
         moment,
+        closeLog() {
+            this.$router.replace('/autoLaunch/channelAdmin')
+            this.$bus.$emit('remove', '/autoLaunch/channelDetailList')
+        },
         deleteIcon(event) {
             event.stopPropagation()
         },
@@ -782,9 +832,9 @@ export default {
         handleSwitchChang(checked, data) {
             const paramsData = {
                 id: data.id,
-                state: checked ? 1 : 0
+                channelState: checked ? 1 : 0
             }
-            getAction('/channel/updateChannel', paramsData)
+            getAction('/channel/updateChannelState', paramsData)
                 .then(result => {
                     if (result.code === 200) {
                         const paramsData = this.form.getFieldsValue()
@@ -886,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
@@ -924,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')
@@ -1048,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
         }

+ 142 - 10
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('下载链接必须和应用标记的通配符保持一致')
                         }
@@ -519,11 +647,15 @@ export default {
         onChange(value) {}
     },
     created: function() {
-        this.createTypeData = JSON.parse(localStorage.getItem('createTypeData'))
+        this.createTypeData = JSON.parse(localStorage.getItem('channelInfo'))
         let params = {}
         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

+ 3 - 5
src/views/modules/autoLaunch/channelManage/components/treeSelectAccount.vue

@@ -10,9 +10,9 @@
             :disable-branch-nodes="!multiple"
             :disable-fuzzy-matching="true"
             :options="options"
+            v-model="selectedVal"
             :load-options="loadOptions"
             placeholder="请选择项目以及账户"
-            v-model="selectedVal"
             :value-consists-of="valueConsistsOf"
             :auto-load-root-options="false"
             @select="update"
@@ -67,7 +67,7 @@ export default {
         },
         appId: {
             default() {
-                return ''
+                return undefined
             }
         },
         //判断媒体类型
@@ -104,10 +104,9 @@ export default {
     computed: {
         selectedVal: {
             get: function() {
-                return this.value
+                return this.appId
             },
             set: function(val) {
-                console.log(val)
                 this.$emit('input', val)
                 this.$emit('change', val)
             }
@@ -192,7 +191,6 @@ export default {
             params.userId = this.userInfo().id
             postAction(this.reqUrl, params).then(res => {
                 if (res.success) {
-                    console.log(res)
                     this.options = res.result.map(item => {
                         return {
                             id: item.productId + 'productId',

+ 0 - 1
src/views/modules/autoLaunch/channelManage/components/treeSelectProject.vue

@@ -193,7 +193,6 @@ export default {
             params.userId = this.userInfo().id
             postAction(this.reqUrl, params).then(res => {
                 if (res.success) {
-                    console.log(res)
                     this.options = res.result.map(item => {
                         return {
                             id: item.productId + 'productId',

+ 125 - 143
src/views/modules/autoLaunch/channelManage/createChannel.vue

@@ -1,4 +1,7 @@
 <style scoped lang="scss">
+::v-deep.ant-form-item {
+    margin-bottom: 10px !important;
+}
 ::v-deep.vue-treeselect__control {
     line-height: 36px !important;
 }
@@ -217,80 +220,7 @@ li.chouzhen.first:before {
                     <a-col :sm="24" style="margin-bottom: 20px; z-index: 10" id="container">
                         <a-card class="search-box step-jump">
                             <a-form layout="horizontal" v-bind="formItemLayout" :form="formProject">
-                                <a-row
-                                    :gutter="16"
-                                    v-if="createTypeData && !!!createTypeData.accountId && !!!createTypeData.projectId"
-                                >
-                                    <a-col :span="16">
-                                        <a-form-item label="使用范围">
-                                            <a-radio-group
-                                                button-style="solid"
-                                                v-decorator="[
-                                                    'usageRange',
-                                                    {
-                                                        rules: [{ required: true, message: '使用范围必选' }],
-                                                        initialValue: 2
-                                                    }
-                                                ]"
-                                            >
-                                                <a-radio-button :value="2">项目</a-radio-button>
-                                                <a-radio-button :value="1">账户</a-radio-button>
-                                            </a-radio-group>
-                                        </a-form-item>
-                                    </a-col>
-                                </a-row>
-                                <a-row
-                                    :gutter="16"
-                                    v-if="getFormData('usageRange') == 2 || getFormData('usageRange') == undefined"
-                                >
-                                    <a-col :span="16">
-                                        <a-form-item
-                                            :label="
-                                                createTypeData && !!!createTypeData.accountId
-                                                    ? !!!createTypeData.projectId
-                                                        ? '选择项目'
-                                                        : '项目ID'
-                                                    : '账户ID'
-                                            "
-                                        >
-                                            <Treeselect
-                                                style="width:600px"
-                                                v-decorator="[
-                                                    'projectId',
-                                                    {
-                                                        rules: [{ required: true, message: '项目必选' }]
-                                                    }
-                                                ]"
-                                                v-if="
-                                                    createTypeData &&
-                                                        !!!createTypeData.accountId &&
-                                                        !!!createTypeData.projectId
-                                                "
-                                            />
-                                            <span v-else>{{
-                                                createTypeData.accountId
-                                                    ? createTypeData.accountId
-                                                    : createTypeData.projectId
-                                            }}</span>
-                                        </a-form-item>
-                                    </a-col>
-                                </a-row>
-                                <a-row :gutter="16" v-else>
-                                    <a-col :span="16">
-                                        <a-form-item label="选择账户">
-                                            <treeSelectAccount
-                                                style="width:600px"
-                                                v-decorator="[
-                                                    'accountId',
-                                                    {
-                                                        rules: [{ required: true, message: '账户必选' }]
-                                                    }
-                                                ]"
-                                            />
-                                        </a-form-item>
-                                    </a-col>
-                                </a-row>
-                                <a-row :gutter="16" v-if="createTypeData && createTypeData.createType == '1'">
+                                <a-row :gutter="16">
                                     <a-col :span="16">
                                         <a-form-item label="编号位数">
                                             <a-select
@@ -315,62 +245,19 @@ li.chouzhen.first:before {
                                 <a-row :gutter="16" v-if="createTypeData && createTypeData.createType == '1'">
                                     <a-col :span="16">
                                         <a-form-item label="编号">
-                                            <a-input-number
-                                                v-decorator="[
-                                                    'numberMin',
-                                                    {
-                                                        rules: [
-                                                            {
-                                                                required: true,
-                                                                message: '请输入正确的编号',
-                                                                validator: numberMinCheck
-                                                            }
-                                                        ]
-                                                    }
-                                                ]"
-                                                :precision="0"
-                                                :min="1"
-                                                :max="
-                                                    getFormData('numberLength') == 0
-                                                        ? 999999
-                                                        : getFormData('numberLength') == 3
-                                                        ? 999
-                                                        : getFormData('numberLength') == 4
-                                                        ? 9999
-                                                        : getFormData('numberLength') == 5
-                                                        ? 99999
-                                                        : 999999
-                                                "
-                                            />
-                                            ~
-                                            <a-input-number
+                                            <a-input
+                                                style="width:300px"
                                                 v-decorator="[
-                                                    'numberMax',
+                                                    'numberValue',
                                                     {
                                                         rules: [
-                                                            {
-                                                                required: true,
-                                                                message: '编号位数限制12312'
-                                                            }
+                                                            { required: true, message: ' ' },
+                                                            { validator: cpaBidValid }
                                                         ]
                                                     }
                                                 ]"
-                                                @change="numberMaxCheck"
-                                                @blur="numberMaxCheck"
-                                                :precision="0"
-                                                :min="1"
-                                                :max="
-                                                    getFormData('numberLength') == 0
-                                                        ? 999999
-                                                        : getFormData('numberLength') == 3
-                                                        ? 999
-                                                        : getFormData('numberLength') == 4
-                                                        ? 9999
-                                                        : getFormData('numberLength') == 5
-                                                        ? 99999
-                                                        : 999999
-                                                "
-                                            />
+                                            >
+                                            </a-input>
                                         </a-form-item>
                                     </a-col>
                                 </a-row>
@@ -380,7 +267,17 @@ li.chouzhen.first:before {
                                             <a-input
                                                 v-decorator="[
                                                     'channelCode',
-                                                    { rules: [{ required: true, message: '请填写渠道号' }] }
+                                                    {
+                                                        rules: [
+                                                            { required: true, message: '请填写渠道号' },
+                                                            {
+                                                                min: 1,
+                                                                max: 20,
+                                                                message: '渠道号不能超过20个字符',
+                                                                trigger: 'blur'
+                                                            }
+                                                        ]
+                                                    }
                                                 ]"
                                                 allow-clear
                                                 id="channelCode"
@@ -404,7 +301,17 @@ li.chouzhen.first:before {
                                             <a-input
                                                 v-decorator="[
                                                     'channelName',
-                                                    { rules: [{ required: true, message: '请填写渠道号' }] }
+                                                    {
+                                                        rules: [
+                                                            { required: true, message: '请填写渠道号名称' },
+                                                            {
+                                                                min: 1,
+                                                                max: 40,
+                                                                message: '渠道号名称不能超过40个字符',
+                                                                trigger: 'blur'
+                                                            }
+                                                        ]
+                                                    }
                                                 ]"
                                                 allow-clear
                                                 id="channelName"
@@ -416,13 +323,13 @@ li.chouzhen.first:before {
                                         >
                                             <a-tag
                                                 color="#2db7f5"
-                                                @click="getChangeAll('渠道号', 'formProject', 'channelName')"
-                                                >+渠道号</a-tag
+                                                @click="getChangeAll('号', 'formProject', 'channelName')"
+                                                >+号</a-tag
                                             >
                                             <a-tag
                                                 color="#2db7f5"
-                                                @click="getChangeAll('号', 'formProject', 'channelName')"
-                                                >+号</a-tag
+                                                @click="getChangeAll('渠道号', 'formProject', 'channelName')"
+                                                >+渠道号</a-tag
                                             >
                                         </a-form-item>
                                     </a-col>
@@ -448,6 +355,11 @@ li.chouzhen.first:before {
                                         >
                                             <a-tag
                                                 color="#2db7f5"
+                                                @click="getChangeAll('编号', 'formProject', 'schemaUri')"
+                                                >+编号</a-tag
+                                            >
+                                            <a-tag
+                                                color="#2db7f5"
                                                 @click="getChangeAll('渠道号', 'formProject', 'schemaUri')"
                                                 >+渠道号</a-tag
                                             >
@@ -477,6 +389,11 @@ li.chouzhen.first:before {
                                         >
                                             <a-tag
                                                 color="#2db7f5"
+                                                @click="getChangeAll('编号', 'formProject', 'clickTrackUrl')"
+                                                >+编号</a-tag
+                                            >
+                                            <a-tag
+                                                color="#2db7f5"
                                                 @click="getChangeAll('渠道号', 'formProject', 'clickTrackUrl')"
                                                 >+渠道号</a-tag
                                             >
@@ -503,6 +420,11 @@ li.chouzhen.first:before {
                                         >
                                             <a-tag
                                                 color="#2db7f5"
+                                                @click="getChangeAll('编号', 'formProject', 'actionbarClickUrl')"
+                                                >+编号</a-tag
+                                            >
+                                            <a-tag
+                                                color="#2db7f5"
                                                 @click="getChangeAll('渠道号', 'formProject', 'actionbarClickUrl')"
                                                 >+渠道号</a-tag
                                             >
@@ -513,12 +435,13 @@ li.chouzhen.first:before {
                                     <a-col :span="16">
                                         <a-form-item label="是否关联单品">
                                             <a-radio-group
+                                                disabled
                                                 button-style="solid"
                                                 v-decorator="[
                                                     'isHaveItem',
                                                     {
                                                         rules: [{ required: true, message: '是否关联单品必选' }],
-                                                        initialValue: 1
+                                                        initialValue: 0
                                                     }
                                                 ]"
                                             >
@@ -537,7 +460,7 @@ li.chouzhen.first:before {
                                                     'usageLevel',
                                                     {
                                                         rules: [{ required: true, message: '使用层级必选' }],
-                                                        initialValue: 'account'
+                                                        initialValue: 'plan'
                                                     }
                                                 ]"
                                             >
@@ -567,7 +490,7 @@ li.chouzhen.first:before {
                                         </a-form-item>
                                     </a-col>
                                 </a-row>
-                                <a-row
+                                <!-- <a-row
                                     :gutter="16"
                                     v-if="getFormData('isCycle') == 1 || getFormData('isCycle') == undefined"
                                 >
@@ -591,14 +514,14 @@ li.chouzhen.first:before {
                                             />
                                         </a-form-item>
                                     </a-col>
-                                </a-row>
+                                </a-row> -->
                             </a-form>
                         </a-card>
                     </a-col>
                 </a-row>
             </div>
             <div style="width:100%;display:flex;    justify-content: flex-end;">
-                <a-button type="default" style="margin-right: 15px" @click="goBack">返回</a-button>
+                <a-button type="default" style="margin-right: 15px" @click="goBack">取消</a-button>
                 <a-button type="primary" style="margin-right: 15px" @click="saveHandler" :loading="saveLoading"
                     >确定</a-button
                 >
@@ -723,7 +646,7 @@ export default {
     watch: {},
     mounted() {
         this.$nextTick(function() {
-            this.createTypeData = JSON.parse(localStorage.getItem('createTypeData'))
+            this.createTypeData = JSON.parse(localStorage.getItem('channelInfo'))
             window.addEventListener('scroll', this.onScroll)
             const that = this
             window.onresize = () => {
@@ -738,6 +661,49 @@ export default {
     methods: {
         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) {
+                callback('请填写编号')
+            } else if (value.match(d)) {
+                callback('请填写正确编号')
+            } else if (value.match(a)) {
+                callback('请填写正确编号')
+            } else if (value.match(z) && value.match(z).length > 1) {
+                callback('请填写正确编号')
+            } else if (value.startsWith('-') || value.endsWith('-')) {
+                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)) {
+                if (value.length > length) {
+                    callback('请填写正确编号')
+                } else {
+                    callback()
+                }
+            } else {
+                callback()
+            }
+        },
         getDataAll(form) {
             this.newAppFormData = form
         },
@@ -750,7 +716,7 @@ export default {
             if (field == 'channelName' || field == 'channelCode') {
                 v = '-{{' + type + '}}-'
             } else {
-                v = '{{' + type + '}}'
+                v = '-{{' + type + '}}-'
             }
 
             if (document.selection) {
@@ -839,8 +805,11 @@ export default {
             }
         },
         goBack() {
-            this.$router.replace('/autoLaunch/channelManage')
-            this.$bus.$emit('remove', '/autoLaunch/createChannel')
+            localStorage.removeItem('channelInfo')
+            this.$router.replace('/autoLaunch/channelAdmin')
+            this.$bus.$emit('remove', '/autoLaunch/createChannelIndex')
+
+            this.$bus.$emit('remove', '/autoLaunch/createChannelIndex?accountId=' + this.$route.query.accountId)
         },
         saveHandler() {
             this.formProject.validateFields((err, values) => {
@@ -850,11 +819,19 @@ export default {
                         var params = { ...values, ...this.newAppFormData }
                         params.userId = this.userInfo().id
                         params.createType = this.createTypeData.createType
-                        if (this.createTypeData && !!this.createTypeData.accountId) {
+                        let numberValueArr = params.numberValue.split('-')
+                        if (numberValueArr.length > 1) {
+                            if (numberValueArr[0] > numberValueArr[1]) {
+                                this.$message.error('编号填写错误')
+                                return
+                            }
+                        }
+
+                        if (this.createTypeData && this.createTypeData.usageRange == '1') {
                             params.usageRange = 1
                             params.projectId = null
                             params.accountId = this.createTypeData.accountId
-                        } else if (this.createTypeData && !!this.createTypeData.projectId) {
+                        } else if (this.createTypeData && this.createTypeData.usageRange == '2') {
                             params.usageRange = 2
                             params.projectId = this.createTypeData.projectId
                             params.accountId = null
@@ -866,8 +843,13 @@ export default {
                         postAction(url, params).then(res => {
                             this.saveLoading = false
                             if (res.success) {
-                                this.$router.replace('/autoLaunch/channelManage')
-                                this.$bus.$emit('remove', '/autoLaunch/createChannel')
+                                localStorage.removeItem('channelInfo')
+                                this.$router.replace('/autoLaunch/channelAdmin')
+                                this.$bus.$emit('remove', '/autoLaunch/createChannelIndex')
+                                this.$bus.$emit(
+                                    'remove',
+                                    '/autoLaunch/createChannelIndex?accountId=' + this.$route.query.accountId
+                                )
                             } else {
                                 this.$message.error(res.message)
                             }

+ 0 - 1
src/views/modules/material/accountCheckBytedance.vue

@@ -310,7 +310,6 @@ export default {
         userId: this.userInfo().id
       }).then((res) => {
         if (res.code == 0) {
-          console.log(res)
           this.options = res.result.map((item) => {
             return {
               id: item.accountId+'@'+item.userId+'@'+item.userName,

+ 1 - 1
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.59:7001', //请求本地 需要jeecg-boot后台项目  赵西安
+        // target: 'http://192.168.1.59: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后台项目