瀏覽代碼

提交物料池

朱鑫波 4 年之前
父節點
當前提交
816c698fbc

+ 7 - 1
src/views/modules/autoLaunch/directional/components/tree-select.vue

@@ -78,6 +78,12 @@ export default {
             default() {
                 return null
             },
+        },
+        httpSrc: {
+            type: String,
+            default() {
+                return '/kuaishouDirectionalPackage/getAccountByProjectId'
+            }
         }
     },
     data() {
@@ -112,7 +118,7 @@ export default {
             this.getAccountId();
         },
         getAccountId() {
-            getAction('/kuaishouDirectionalPackage/getAccountByProjectId', {
+            getAction(this.httpSrc, {
                 projectId: this.projectId,
                 id: this.templateId,
                 pageNo: this.tablePag.page,

+ 38 - 19
src/views/modules/autoLaunch/directional/directional.vue

@@ -184,6 +184,7 @@
                         placeholder="请选择"
                         allow-clear
                     >
+                        <a-select-option :value="2">不限</a-select-option>
                         <a-select-option :value="1">推送成功</a-select-option>
                         <a-select-option :value="0">推送失败</a-select-option>
                     </a-select>
@@ -238,7 +239,7 @@
             @ok="handleAddPopulation"
             dialog-class="relax-modal"
             @cancel="handleCancelPerson"
-            :loading="personLoading"
+            :confirm-loading="personLoading"
             rowKey="index">
             <a-form  
                 :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
@@ -280,6 +281,7 @@
                                 :scroll="{ y: 250 }"
                                 :row-selection="rowSelection"
                                 bordered
+                                v-if="people!='0'"
                             >
                                 <template slot="name" slot-scope="name"> {{ name }} </template>
                                 <template slot="populationType" slot-scope="populationType"> {{ populationType | customCrowdHandler}} </template>
@@ -297,6 +299,7 @@
                                 :scroll="{ y: 250 }"
                                 :row-selection="rowSelection2"
                                 bordered
+                                v-if="people!='1'"
                             >
                                 <template slot="name" slot-scope="name"> {{ name }} </template>
                                 <template slot="populationType" slot-scope="populationType"> {{ populationType | customCrowdHandler}} </template>
@@ -372,7 +375,7 @@ export default {
             excludeSelectedKeys: [],
             excludeSelectedRowKeys: [],
             //自定义人群参数结束
-            resultHistory: null,
+            resultHistory: 2,
             unitAccountId: "",
             activeKey: "",
             setPersonVisible: false,
@@ -430,7 +433,7 @@ export default {
                     // 当在页面定义change事件时,切记要把此处的事件清除,因为这两个事件重叠了,可能到时候会导致一些莫名的bug
                     this.ipagination.current = current;
                     this.ipagination.pageSize= pageSize;
-                    this.handleGetTableList()
+                    this.handleGetTableList({})
                 }
             },
             accountIpagination: {
@@ -545,11 +548,12 @@ export default {
                     this.incluedSelectedRowKeys = selectedRowKeys;
                     this.incluedSelectedKeys = selectedRows
                 },
+                selectedRowKeys: this.incluedSelectedRowKeys,
                 getCheckboxProps: record => ({
                     props: {
-                        disabled: this.excludeSelectedRowKeys.indexOf(record.key)>-1,  
+                        disabled: this.excludeSelectedRowKeys?this.excludeSelectedRowKeys.indexOf(record.key)>-1:undefined,  
                         name: record.name,
-                        defaultChecked:this.incluedSelectedRowKeys.indexOf(record.key)>-1
+                        defaultChecked:this.incluedSelectedRowKeys?this.incluedSelectedRowKeys.indexOf(record.key)>-1:undefined,
                     },
                 }),
             };
@@ -560,11 +564,12 @@ export default {
                     this.excludeSelectedRowKeys = selectedRowKeys;
                     this.excludeSelectedKeys = selectedRows;
                 },
+                selectedRowKeys: this.excludeSelectedRowKeys,
                 getCheckboxProps: record => ({
                     props: {
-                        disabled: this.incluedSelectedRowKeys.indexOf(record.key)>-1, 
+                        disabled: this.incluedSelectedRowKeys?this.incluedSelectedRowKeys.indexOf(record.key)>-1:undefined, 
                         name: record.name,
-                        defaultChecked:this.excludeSelectedRowKeys.indexOf(record.key)>-1
+                        defaultChecked:this.excludeSelectedRowKeys?this.excludeSelectedRowKeys.indexOf(record.key)>-1:undefined
                     },
                 }),
             };
@@ -576,6 +581,7 @@ export default {
                     this.finallyRightTree[index].incluedSelectedRowKeys = selectedRowKeys;
                     this.finallyRightTree[index].incluedSelectedKeys = selectedRows;
                 },
+                selectedRowKeys:this.finallyRightTree[this.finallyRightTree.findIndex(item => item.key === this.activeKey)].incluedSelectedRowKeys,
                 getCheckboxProps: record => ({
                     props: {
                         disabled: this.finallyRightTree[this.finallyRightTree.findIndex(item => item.key === this.activeKey)].excludeSelectedRowKeys.indexOf(record.key)>-1,  
@@ -592,6 +598,7 @@ export default {
                     this.finallyRightTree[index].excludeSelectedRowKeys = selectedRowKeys;
                     this.finallyRightTree[index].excludeSelectedKeys = selectedRows;
                 },
+                selectedRowKeys:this.finallyRightTree[this.finallyRightTree.findIndex(item => item.key === this.activeKey)].excludeSelectedRowKeys,
                 getCheckboxProps: record => ({
                     props: {
                         disabled: this.finallyRightTree[this.finallyRightTree.findIndex(item => item.key === this.activeKey)].incluedSelectedRowKeys.indexOf(record.key)>-1, 
@@ -667,28 +674,25 @@ export default {
         },
         customCrowdChange(e){
             //console.log(e);
-            
-           
+            this.incluedSelectedRowKeys = [];
+            this.incluedSelectedKeys = [];
+            this.excludeSelectedKeys = [];
+            this.excludeSelectedRowKeys = [];
             if(e.target.value=='1' || e.target.value=='2'){
                 this.retargetTabChange();
                 this.tabKey=e.target.value
             }else if(e.target.value=='3'){
                 this.retargetTabChange();
-                this.tabKey='1'
+                this.tabKey = '1';
             }
-            this.$nextTick(() => {
-                this.incluedSelectedRowKeys = [];
-                this.incluedSelectedKeys = [];
-                this.excludeSelectedKeys = [];
-                this.excludeSelectedRowKeys = [];
-            })
+            this.$forceUpdate()
         },
         // 自定义人群的--同时定向排除tab切换事件
         retargetTabChange(){
             //console.log()
             this.retargetDataAll=[];
             this.loading=true;
-            
+           
             getAction('/kuaishou/batch/getPopulationList',{
                 accountId:this.personDetail.accountId
             }).then((res)=>{
@@ -738,6 +742,7 @@ export default {
             let params = {};
             params.accountId = val.accountId;
             params.templateId = val.templateId;
+            this.retargetTabChange()
             getAction('/kuaishouDirectionalPackage/queryPopulationById' ,params).then(res => {
                 if(res.success) {
                     this.retargetAccountId(val.accountId);
@@ -756,23 +761,35 @@ export default {
                     }
                     this.incluedSelectedRowKeys = res.result.population ? res.result.population : [];
                     this.excludeSelectedRowKeys = res.result.excludePopulation ? res.result.excludePopulation : [];
+                    
                 }
             })
         },
         handleAddPopulation() {
             this.personLoading = true;
             let params = {};
+            params.id = this.personDetail.id;
             params.accountId = this.personDetail.accountId;
+            params.templateId = this.personDetail.templateId;
+            params.templateName = this.personDetail.templateName;
             if(this.people == '0') {
-
+                params.population = [];
+                params.excludePopulation = [];
             }
             else if(this.people == '1') {
                 params.population = this.incluedSelectedRowKeys;
+                params.excludePopulation = [];
             }
             else if(this.people == '2') {
                 params.excludePopulation = this.excludeSelectedRowKeys;
+                params.population = [];
             }
             else {
+                if(this.incluedSelectedRowKeys.length === 0 || this.excludeSelectedRowKeys.length === 0){
+                    this.$message.error("同时定向排除需要定向池与排除池都选择");
+                    this.personLoading = false;
+                    return
+                }
                 params.population = this.incluedSelectedRowKeys;
                 params.excludePopulation = this.excludeSelectedRowKeys;
             }
@@ -886,7 +903,7 @@ export default {
                 id: id,
                 pageNo: this.causePag.page,
                 pageSize: this.causePag.size,
-                status: this.resultHistory
+                status: this.resultHistory !== 2 ? this.resultHistory : null
             };
             postAction('/kuaishouDirectionalPackage/queryPushResults', paramsData).then(result => {
                 if (result.code === 200) {
@@ -928,6 +945,7 @@ export default {
             this.pushVisible = true;
         },
         handleCauseCancel() {
+            this.resultHistory = 2;
             this.causeVisible = false;
         },
         handleAgian(val) {
@@ -943,6 +961,7 @@ export default {
                 tabKey: '1'
             });
             this.causeVisible = false;
+            this.resultHistory = 2;
             this.handlePushSure();
         },
         handleSetPerson() {

+ 1 - 1
src/views/modules/crowd-control/crowd-control-service.js

@@ -40,7 +40,7 @@ class AppMarketService {
     setCauseColumns() {
         return [
             {
-                title: '项目名称',
+                title: '账户名称',
                 dataIndex: 'authName',
                 width: '25%',
                 align: 'center'

+ 25 - 19
src/views/modules/crowd-control/crowd-control.vue

@@ -36,11 +36,12 @@
                     </a-col>
                     <a-col :md="8" :sm="8" :xxl="6">
                         <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
-                            <a-button type="default" class="reset-class" @click="handleResetForm">重置</a-button>
-                            <a-button type="primary" html-type="submit" class="middle-button">查询</a-button>
-                            <a-button type="primary" @click="handleUploadPerson">
+                            <a-button type="primary" icon="search" @click="handleQueryList">查询</a-button>
+                            <a-button type="primary" @click="handleResetForm" icon="reload" class="middle-button">重置</a-button>
+                             <a-button type="primary" @click="handleUploadPerson">
                                 上传人群包
                             </a-button>
+                           
                         </span>
                         
                     </a-col>
@@ -58,7 +59,7 @@
                 :pagination="false"
             >
                 <span slot="action" slot-scope="text, record">
-                    <a @click="handleEdit(record)" :disabled="record.status !== 4">推送</a>
+                    <a @click="handleEdit(record)">推送</a>
                     <a-divider type="vertical" />
                     <a @click="handleDelete(record)">删除</a>
                 </span>
@@ -81,7 +82,6 @@
                 :total="totalAll"
                 :show-total="total => `共 ${totalAll} 条`"
                 size="small"
-                show-size-changer
                 show-quick-jumper
                 @change="onShowSizeChange"
                 @showSizeChange="onShowSizeChange"
@@ -104,28 +104,30 @@
                     :label-col="labelCol"
                     :wrapper-col="wrapperCol"
                 >
-                    <a-form-model-item label="匹配类型" prop="resource">
-                        <a-radio-group v-model="personForm.resource" :disabled="personResourceDisabled">
-                            <a-radio v-for="item in mateTypeTasks" :key="item.label" :value="item.label">{{ item.value }}</a-radio>
-                        </a-radio-group>
-                    </a-form-model-item>
-                    <a-form-model-item ref="name" label="人群包名称" prop="name">
+                    <selectTable
+                        :projectId.sync="uploadProjectId"
+                        :labelCol="labelCol"
+                        :disabled="disabled"
+                        :requireCheck="true"
+                        v-if="!disabled"
+                    ></selectTable>
+                     <a-form-model-item ref="name" label="人群包名称" prop="name">
                         <a-input
                             v-model="personForm.name"
                             placeholder="请输入人群包名称"
                             :disabled="personNameDisabled"
                         />
                     </a-form-model-item>
+                    <a-form-model-item label="匹配类型" prop="resource">
+                        <a-radio-group v-model="personForm.resource" :disabled="personResourceDisabled">
+                            <a-radio v-for="item in mateTypeTasks" :key="item.label" :value="item.label">{{ item.value }}</a-radio>
+                        </a-radio-group>
+                    </a-form-model-item>
+                   
                     <!-- <a-form-model-item label="选择账户" class="grid-form-item-account">
                         <acount-search class="acount-search-class" :appId.sync="uploadAcountIds" :multiple="false"></acount-search>
                     </a-form-model-item> -->
-                    <selectTable
-                        :projectId.sync="uploadProjectId"
-                        :labelCol="labelCol"
-                        :disabled="disabled"
-                        :requireCheck="true"
-                        v-if="!disabled"
-                    ></selectTable>
+
                     <a-form-model-item label="上传人群包">
                         <a-upload
                             name="file"
@@ -167,7 +169,7 @@
                         </a-radio-group>
                     </div>
                 </div>
-                <tree-select @applyType="handleApplyType" :projectId="tableSelectList.projectId" :templateId="tableSelectList.id"></tree-select>
+                <tree-select :httpSrc="src" @applyType="handleApplyType" :projectId="tableSelectList.projectId" :templateId="tableSelectList.id"></tree-select>
             </div>
         </a-modal>
         <a-modal
@@ -270,6 +272,7 @@ export default {
     data() {
         let that = this;
         return {
+            src: '/kuaishouPopulationPackage/getAccountByProjectId',
             unitAccountId: '',
             personResourceDisabled: false,
             personNameDisabled: false,
@@ -600,11 +603,13 @@ export default {
         },
         handlePushSure() {
             if(this.finallyRightTree.length > 0) {
+                this.pushConfirmLoading = true;
                 const paramsData = {
                     accountIds: this.finallyRightTree.map(item => item.key),
                     id: this.tableSelectList.id
                 };
                 postAction('/kuaishouPopulationPackage/push', paramsData).then(result => {
+                    this.pushConfirmLoading = false;
                     if (result.code === 200) {
                         this.pushVisible = false;
                         this.handleGetTableList({});
@@ -613,6 +618,7 @@ export default {
                         this.$message.error(result.message);
                     }
                 }).catch(error => {
+                    this.pushConfirmLoading = false;
                     console.log(error, 'eeeeeee');
                 });
             }