Bladeren bron

定向包完成

朱鑫波 3 jaren geleden
bovenliggende
commit
48ed944bdd

+ 1 - 1
src/views/modules/autoLaunchRevision/components/targetedPopulation.vue

@@ -885,7 +885,6 @@ export default {
                     this.optionsAll = n.appIds ? (typeof n.appIds == 'string' ? JSON.parse(n.appIds) : n.appIds) : []
                     n.behavior = typeof n.behavior === 'string' ? JSON.parse(n.behavior) : n.behavior
                     n.interest = typeof n.interest === 'string' ? JSON.parse(n.interest) : n.interest
-                    this.retargetAccountId()
                     this.$nextTick(() => {
                         this.formAll.setFieldsValue(
                             pick(n, [
@@ -1511,6 +1510,7 @@ export default {
         this.getDataType('BUSINESS_INTEREST', 'businessOptions')
         this.getDataType('FANS_STAR', 'fansStarOptions')
         this.getDataType('INTEREST_VIDEO', 'interestVideoOptions')
+        this.retargetAccountId()
         // this.behaviorData
         this.getAction('/batch/kuaishouTemplate/getbehaviorInterest', { accountId: this.accountId }).then(res => {
             if (res.success) {

+ 21 - 15
src/views/modules/autoLaunchRevision/components/templateModal.vue

@@ -147,13 +147,13 @@ export default {
             this.type = type
             var params = {}
             params.id = item.id
+            this.accountId = item.accountId
             this.templateId = item.id
-            this.projectName = item.projectName
-            this.projectId = item.projectId
-            getAction('/kuaishouDirectionalPackage/queryById', params).then(res => {
+            getAction('/auto/aiKuaishouAccountAutoTarget/queryById', params).then(res => {
                 if (res.success) {
                     var dataJson = {
-                        ...res.result
+                        ...res.result,
+                        templateName: res.result.targetName
                     }
 
                     this.populationData = dataJson
@@ -189,6 +189,14 @@ export default {
                             : !dataJson.population && !dataJson.excludePopulation
                             ? '0'
                             : '0'
+                    this.populationData.allForm.tabKey =
+                        this.populationData.allForm.people == '0'
+                            ? '1'
+                            : this.populationData.allForm.people == '1'
+                            ? '1'
+                            : this.populationData.allForm.people == '2'
+                            ? '2'
+                            : '1'
                     this.populationData.allForm.incluedSelectedRowKeys =
                         dataJson.population && dataJson.population.length > 0 ? dataJson.population : []
                     this.populationData.allForm.incluedSelectedKeys =
@@ -278,18 +286,16 @@ export default {
                                 params.label = params.behavior ? JSON.stringify(params.behavior) : '[]'
                                 params.interestLabel = params.interest ? JSON.stringify(params.interest) : '[]'
                                 if (this.type == 'add') {
-                                    postAction('/auto/aiKuaishouAccountAutoTarget/addLocalTarget', params).then(
-                                        res => {
-                                            if (res.success) {
-                                                this.visible = false
-                                                this.loading = false
-                                                this.$emit('getData')
-                                            } else {
-                                                this.loading = false
-                                                this.$message.error(res.message)
-                                            }
+                                    postAction('/auto/aiKuaishouAccountAutoTarget/addLocalTarget', params).then(res => {
+                                        if (res.success) {
+                                            this.visible = false
+                                            this.loading = false
+                                            this.$emit('getData')
+                                        } else {
+                                            this.loading = false
+                                            this.$message.error(res.message)
                                         }
-                                    )
+                                    })
                                 } else if (this.type == 'edit') {
                                     params.id = this.templateId
                                     postAction('/auto/aiKuaishouAccountAutoTarget/updateLocalTarget', params).then(

+ 7 - 4
src/views/modules/autoLaunchRevision/createLaunch.vue

@@ -591,7 +591,6 @@ li.chouzhen.first:before {
                                                     <a-col :xl="24" :md="24" class="flex-main" v-if="item">
                                                         <span class="ant-descriptions-item-label"> 人群:</span>
                                                         <div v-if="item" style="word-break: break-all;">
-                                                            >
                                                             <span
                                                                 v-if="
                                                                     (!item.population && !item.excludePopulation) ||
@@ -1773,7 +1772,7 @@ li.chouzhen.first:before {
                             <a-checkbox :value="item.id" @change="setData(item.id)"></a-checkbox>
                         </div>
                         <template slot="actions" class="ant-card-actions">
-                            <a-icon key="edit" type="edit" @click="editNewTemplate(item.id)" />
+                            <a-icon key="edit" type="edit" @click="editNewTemplate(item)" />
                             <a-icon key="delete" type="delete" @click="deleteNewTemplate(item.id)" />
                         </template>
 
@@ -3830,7 +3829,7 @@ export default {
             this.checkPerson = dataAll
             this.personLoading = true
             if (this.checkPerson.length > 0) {
-                this.postDataAction('/kuaishouDirectionalPackage/getProjectTargetByIds', {
+                this.postDataAction('/auto/aiKuaishouAccountAutoTarget/getAutoTargetByIds', {
                     ids: this.checkPerson
                 }).then(res => {
                     this.personLoading = false
@@ -3887,7 +3886,11 @@ export default {
             }
             this.checkPerson = []
         },
-        editNewTemplate(id) {},
+        editNewTemplate(item) {
+            var params = {...item}
+            params.accountId = this.getFormData('formProject', 'accountId')
+            this.$refs.templateModal.handleOk(params, 'edit')
+        },
         deleteNewTemplate(id) {
             var params = {}
             params.ids = id