Browse Source

合并到测试分支

朱鑫波 3 years ago
parent
commit
4794908daa

+ 2 - 2
src/utils/request.js

@@ -20,8 +20,8 @@
  }
  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://gateway.tjyourong.com.cn/jeecg-boot';//测试
+	//  axios.defaults.baseURL = 'http://api.tjyourong.com.cn/jeecg-boot'; // 生产环境
  }
  const service = axios.create({
 	 // baseURL: '/jeecg-boot', // api base_url

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

@@ -195,11 +195,22 @@
                             onChange: onSelectChange
                         }"
                     >
+                        <span slot="items" slot-scope="text, record">
+                            {{
+                                text.length > 0
+                                    ? text
+                                          .map(i => {
+                                              return i.itemName
+                                          })
+                                          .join()
+                                    : '-'
+                            }}
+                        </span>
                         <span slot="state" slot-scope="text, record">
                             <a-switch :checked="text === 1" @change="handleSwitchChang($event, record)" />
                         </span>
                         <span slot="action" slot-scope="text, records">
-                            <a @click="addNewChannel(records)">查看详情</a>
+                            <a @click="addNewChannel(records)" :disabled="!accountId">查看详情</a>
                         </span>
                     </a-table>
                     <a-pagination
@@ -460,10 +471,10 @@ let TTcolumns = [
     },
     {
         title: '关联单品名称',
-        dataIndex: 'itemName',
-        scopedSlots: { customRender: 'itemName' },
+        dataIndex: 'items',
+        scopedSlots: { customRender: 'items' },
         align: 'center',
-        key: 'itemName'
+        key: 'items'
     },
     {
         title: '使用层级',
@@ -670,6 +681,11 @@ export default {
                     this.dataDetailLoading = true
                     var params = {}
                     params.accountId = localStorage.getItem('channelInfoAccountId')
+                        ? localStorage.getItem('channelInfoAccountId')
+                        : null
+                    params.projectId = localStorage.getItem('channelInfoProjectId')
+                        ? localStorage.getItem('channelInfoProjectId')
+                        : null
                     params.channelCode = this.channelCode
                     params.pageNo = this.ipaginationDetail.current
                     params.pageSize = this.ipaginationDetail.pageSize
@@ -892,7 +908,12 @@ export default {
             let paramsData = {
                 channelCode: data.channelCode,
                 channelName: data.channelName,
-                accountId: localStorage.getItem('channelInfoAccountId'),
+                accountId: localStorage.getItem('channelInfoAccountId')
+                    ? localStorage.getItem('channelInfoAccountId')
+                    : null,
+                projectId: localStorage.getItem('channelInfoProjectId')
+                    ? localStorage.getItem('channelInfoProjectId')
+                    : null,
                 pageNo: this.ipagination.current,
                 pageSize: this.ipagination.pageSize
             }
@@ -990,6 +1011,11 @@ export default {
     mounted() {
         const paramsData = this.form.getFieldsValue()
         this.handleGetTableList(paramsData)
+        if (localStorage.getItem('channelInfoAccountId')) {
+            this.accountId = localStorage.getItem('channelInfoAccountId')
+        } else {
+            this.accountId = null
+        }
         this.getAllOperator()
     },
     activated: function() {},

+ 27 - 5
src/views/modules/autoLaunch/channelManage/createChannel.vue

@@ -217,7 +217,10 @@ 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">
+                                <a-row
+                                    :gutter="16"
+                                    v-if="createTypeData && !!!createTypeData.accountId && !!!createTypeData.projectId"
+                                >
                                     <a-col :span="16">
                                         <a-form-item label="使用范围">
                                             <a-radio-group
@@ -243,7 +246,11 @@ li.chouzhen.first:before {
                                     <a-col :span="16">
                                         <a-form-item
                                             :label="
-                                                createTypeData && !!!createTypeData.accountId ? '选择项目' : '账户ID'
+                                                createTypeData && !!!createTypeData.accountId
+                                                    ? !!!createTypeData.projectId
+                                                        ? '选择项目'
+                                                        : '项目ID'
+                                                    : '账户ID'
                                             "
                                         >
                                             <Treeselect
@@ -254,9 +261,17 @@ li.chouzhen.first:before {
                                                         rules: [{ required: true, message: '项目必选' }]
                                                     }
                                                 ]"
-                                                v-if="createTypeData && !!!createTypeData.accountId"
+                                                v-if="
+                                                    createTypeData &&
+                                                        !!!createTypeData.accountId &&
+                                                        !!!createTypeData.projectId
+                                                "
                                             />
-                                            <span v-else>{{ createTypeData.accountId }}</span>
+                                            <span v-else>{{
+                                                createTypeData.accountId
+                                                    ? createTypeData.accountId
+                                                    : createTypeData.projectId
+                                            }}</span>
                                         </a-form-item>
                                     </a-col>
                                 </a-row>
@@ -791,7 +806,9 @@ export default {
             }
         },
         handleConfirmValueOkUndefind(rule, value, callback) {
-            if (/(http|https):\/\/([\w.]+\/?)\S*/.test(value) || value == '') {
+            if (value == '') {
+                callback()
+            } else if (/(http|https):\/\/([\w.]+\/?)\S*/.test(value)) {
                 callback()
             } else {
                 callback('链接开头为http://或https://')
@@ -819,8 +836,13 @@ export default {
                         params.userId = this.userInfo().id
                         params.createType = this.createTypeData.createType
                         if (this.createTypeData && !!this.createTypeData.accountId) {
+                            params.usageRange = 1
                             params.projectId = null
                             params.accountId = this.createTypeData.accountId
+                        } else if (this.createTypeData && !!this.createTypeData.projectId) {
+                            params.usageRange = 2
+                            params.projectId = this.createTypeData.projectId
+                            params.accountId = null
                         }
                         let url =
                             this.createTypeData.createType == '1'

+ 13 - 5
src/views/modules/autoLaunch/channelManage/index.vue

@@ -236,6 +236,7 @@
                 </div>
             </a-radio-group>
         </a-modal>
+        
 
         <a-modal
             title="下载模板"
@@ -516,8 +517,15 @@ export default {
         },
         ...mapGetters(['userInfo']),
         toDetailList(item) {
-            localStorage.setItem('channelInfoAccountId', item.accountId)
-            this.$router.push({ path: '/autoLaunch/channelDetailList' })
+            if (item.accountId == '') {
+                localStorage.removeItem('channelInfoAccountId')
+                localStorage.setItem('channelInfoProjectId', item.projectId)
+                this.$router.push({ path: '/autoLaunch/channelDetailList' })
+            } else {
+                localStorage.removeItem('channelInfoProjectId')
+                localStorage.setItem('channelInfoAccountId', item.accountId)
+                this.$router.push({ path: '/autoLaunch/channelDetailList' })
+            }
         },
 
         cpaBidValid(rule, value, callback) {
@@ -540,14 +548,14 @@ export default {
         },
         addNewChannelElse(item) {
             this.createType = item.createType
-            var createTypeData = { createType: this.createType, accountId: item.accountId }
+            var createTypeData = { createType: this.createType, accountId: item.accountId, projectId: item.projectId }
             localStorage.setItem('createTypeData', JSON.stringify(createTypeData))
             this.$router.push({ path: '/autoLaunch/createChannel' })
         },
         handleOk() {
             if (this.channelType == 'a') {
                 this.createType = '1'
-                var createTypeData = { createType: this.createType, accountId: null }
+                var createTypeData = { createType: this.createType, accountId: null, projectId: null }
                 localStorage.setItem('createTypeData', JSON.stringify(createTypeData))
                 this.$router.push({ path: '/autoLaunch/createChannel' })
             } else if (this.channelType == 'b') {
@@ -556,7 +564,7 @@ export default {
                 this.handleCancel()
             } else if (this.channelType == 'c') {
                 this.createType = '3'
-                var createTypeData = { createType: this.createType, accountId: null }
+                var createTypeData = { createType: this.createType, accountId: null, projectId: null }
                 localStorage.setItem('createTypeData', JSON.stringify(createTypeData))
                 this.$router.push({ path: '/autoLaunch/createChannel' })
             }