xiuli.gao před 1 rokem
rodič
revize
caff6b5322

+ 24 - 3
src/components/businessMoudle/batchGdt/configArea/index.vue

@@ -6,6 +6,10 @@
6 6
     <div class="areaTitle">
7 7
       配置区
8 8
       <el-button class="lMar20" type="primary" @click="openStrategyGroups">选择策略组</el-button>
9
+      <div class="strategy-title" v-if="pageInfo.groupsConfig && pageInfo.groupsConfig?.id">
10
+        已选:{{ pageInfo.groupsConfig.name }} 
11
+        <el-icon class="lMar8 pointer" @click="closeSeletedGroup"><Close /></el-icon>
12
+      </div>
9 13
       <span class="smallTitle lMarauto">预览广告数 : <span class="c-theme">{{NumberHandle(pageInfo.num_total.adNum)||0}}</span></span>
10 14
     </div>
11 15
     <div class="areaCon">
@@ -154,7 +158,7 @@
154 158
   <!-- 复用配置 -->
155 159
   <ResuseConfig ref="ResuseConfigRef" @aNewConfig="aNewConfigEvent" @reuse="reuseEvent"></ResuseConfig>
156 160
   <!-- 策略组列表 -->
157
-  <StrategyGroupsList ref="StrategyGroupsListRef"></StrategyGroupsList>
161
+  <StrategyGroupsList ref="StrategyGroupsListRef" @close="strategyGroupsUse"></StrategyGroupsList>
158 162
   <!-- 保存策略组弹框 -->
159 163
   <StrategyGroupsDialog ref="StrategyGroupsDialogRef"></StrategyGroupsDialog>
160 164
 </template>
@@ -244,6 +248,7 @@ const pageInfo = reactive<reactiveTableAndAny>({
244 248
     loadPageRule: 0, //0 全部相同 //1 按账户分配 //2 分配到计划 // 3分配到广告
245 249
   },
246 250
   acc_plan_ad_count: {}, //各账户对应的计划数、广告数;用于微信视频号的配置
251
+  groupsConfig: {},//已选择的策略组
247 252
 })
248 253
 
249 254
 //创意基本信息
@@ -613,14 +618,22 @@ const {
613 618
   StrategyGroupsDialogRef,
614 619
   StrategyGroupsListRef,
615 620
   openStrategyGroups,
616
-  openSaveStrategyGroups
621
+  openSaveStrategyGroups,
622
+  closeSeletedGroup,
623
+  strategyGroupsUse
617 624
 } = strategyGroupsEvent({
625
+  targetRef,
626
+  accRef,
618 627
   cMaterial,
619 628
   basicInfoData,
620 629
   pageInfo,
621 630
   isMock,
622 631
   originalityBasicInfoData,
623
-  judgeEvent
632
+  judgeEvent,
633
+  aNewConfigEvent,
634
+  getAdPresetsInfo,
635
+  updateHaveContent,
636
+  clearOriginalityInfo
624 637
 })
625 638
 /**E 策略组 */
626 639
 
@@ -745,4 +758,12 @@ provide('accountIds',toRef(pageInfo,'accIdsList'))
745 758
   height: 60px;
746 759
   border-radius: 6px;
747 760
 }
761
+.strategy-title{
762
+  margin-left: 16px;
763
+  font-weight: 400;
764
+  color: #666;
765
+  display: flex;
766
+  align-items: center;
767
+  font-size: 14px;
768
+}
748 769
 </style>

+ 18 - 5
src/components/businessMoudle/batchGdt/configArea/originalityBasic/index.vue

@@ -149,6 +149,7 @@ const site_set = ref<string[]>([]); // 投放版位
149 149
 const loading = ref<boolean>(true)
150 150
 const conLoading = ref<boolean>(false)
151 151
 const fullscreenLoading = ref<boolean>(false)
152
+const huxian_flag = ref(false)//解决 回显状态下 创意形式的问题
152 153
 const templateType = reactive<{ img: any[], video: any[] }>({
153 154
   img: [],
154 155
   video: []
@@ -192,10 +193,15 @@ const radioChange = (obj: object) => {
192 193
       'copywriting': copywriting
193 194
     }
194 195
     if (i == 'originalityForm' && obj['originalityForm'] && obj['originalityForm'] != '') {//创意形式
195
-      if (form_main['originalityForm'] != obj[i]) {
196
-        onClickTemplate(templateType[obj[i]][0])
196
+      if(huxian_flag.value){
197
+        huxian_flag.value = false
198
+      }else{
199
+        if (form_main['originalityForm'] != obj[i]) {
200
+          onClickTemplate(templateType[obj[i]][0])
201
+        }
197 202
       }
198 203
     }
204
+    
199 205
     form_main[i] = obj[i]
200 206
   }
201 207
 }
@@ -465,7 +471,6 @@ const initEvent = () => {
465 471
   } else {
466 472
     site_set.value = props.adBasicInfo.site_ids.split(',')
467 473
   }
468
-
469 474
   loading.value = true;
470 475
   getAdcreativeTemplateList({
471 476
     account_ids: props.accIdsList.map((v) => v.id),
@@ -526,11 +531,19 @@ const switchShow = async (val: boolean, obj: any) => {
526 531
   visible.value = val
527 532
   if (val) {
528 533
     if (obj.fillback && JSON.stringify(obj.fillback) != '{}') { //回显状态下
534
+      huxian_flag.value = true
529 535
       fillBackInfo.value = _.cloneDeep(obj.fillback)
530 536
       templateCurr.value = _.cloneDeep(obj?.apiResult?.templateCurr)
531 537
       adTemplateItem.value = _.cloneDeep(obj?.apiResult?.adTemplateItem)
532
-      form_main['originalityForm'] = obj.fillback.originalityForm.api_value.originalityForm
533
-      JsonInfo.originalityForm.data.defaultValue = obj.fillback.originalityForm.api_value.originalityForm
538
+      if(obj.fillback.originalityForm && obj.fillback.originalityForm.api_value){
539
+        form_main['originalityForm'] = obj.fillback.originalityForm.api_value.originalityForm
540
+        JsonInfo.originalityForm.data.defaultValue = obj.fillback.originalityForm.api_value.originalityForm
541
+      }
542
+      if(JsonInfo.originalityForm.data.defaultValue == '' || !JsonInfo.originalityForm.data.defaultValue){
543
+        JsonInfo.originalityForm.data.defaultValue = templateCurr.value?.adcreative_template_style == '图片' ? 'img' : 'video'
544
+      }
545
+    }else{
546
+      huxian_flag.value = false
534 547
     }
535 548
     initEvent()
536 549
   }

+ 147 - 45
src/components/businessMoudle/batchGdt/configArea/strategyGroups/list.vue

@@ -5,46 +5,51 @@
5 5
       <div class="flex tMar15 bMar15">
6 6
         <Select ref="targetRef" :clearFlag="true" title="推广目标" selectWidth="160px"
7 7
           :optObj="{ k: 'name', la: 'desc', val: 'name' }" @changeEvent="targetChange" :options="pageInfo.targetList" />
8
-        <el-input v-model="pageInfo.name" clearable @clear="handleCurrentChange(1)" @change="handleCurrentChange(1)" placeholder="搜索策略组名称" style="width: 230px;">
8
+        <el-input v-model="pageInfo.name" clearable @clear="handleCurrentChange(1)" @change="handleCurrentChange(1)"
9
+          placeholder="搜索策略组名称" style="width: 230px;">
9 10
           <template #append>
10
-            <el-button :icon="Search" @click="handleCurrentChange(1)"/>
11
+            <el-button :icon="Search" @click="handleCurrentChange(1)" />
11 12
           </template>
12 13
         </el-input>
13 14
       </div>
14 15
       <el-table ref="tableRef" :data="pageInfo?.list" :header-cell-style="tableHeaderStyle" border empty-text="暂无数据"
15 16
         height="60vh" style="width:100%">
16
-          <template v-for="item in pageInfo.descol">
17
-            <el-table-column :fixed="item.fixed" :prop="item.prop" :width="item.width ? item.width : 'auto'" :align="item.align || 'left'">
18
-              <template #header>
19
-                <div class="flex" :style="`justify-content:${item.align || 'left'}`">
20
-                  <span>{{ item.label }}</span>
21
-                </div>
22
-              </template>
23
-              <template #default="scope">
24
-                <div v-if="item.prop == 'radio'">
25
-                  <el-radio v-model="pageInfo.radioModel" :label="scope.row.id" size="large"><span></span></el-radio>
26
-                </div>
27
-                <!-- 操作 -->
28
-                <div v-else-if="item.prop == 'operate'">
29
-                  <span class="c-theme pointer">复制</span>
17
+        <template v-for="item in pageInfo.descol">
18
+          <el-table-column :fixed="item.fixed" :prop="item.prop" :width="item.width ? item.width : 'auto'"
19
+            :align="item.align || 'left'">
20
+            <template #header>
21
+              <div class="flex" :style="`justify-content:${item.align || 'left'}`">
22
+                <span>{{ item.label }}</span>
23
+              </div>
24
+            </template>
25
+            <template #default="scope">
26
+              <div v-if="item.prop == 'radio'">
27
+                <el-radio v-model="pageInfo.radioModel" @change="radioChange(scope.row)" :label="scope.row.id" size="large"><span></span></el-radio>
28
+              </div>
29
+              <!-- 操作 -->
30
+              <div v-else-if="item.prop == 'operate'">
31
+                <span class="c-theme pointer" @click="copyGroup(scope.row)">复制</span>
32
+                <span v-if="pageInfo.inUseGroup?.id != scope.row.id">
30 33
                   <Popconfirm key="dele" @confirm="deleteGroup(scope.row.id)" :slotFlag="true">
31
-                    <template #con>
32
-                      <span class="pointer lMar10 c-red">删除</span>
33
-                    </template>
34
-                  </Popconfirm>
35
-                </div>
36
-                <!-- 其他 -->
37
-                <div class="cellDiv" v-else>
38
-                  <el-tooltip :disabled="!(scope.row[item.prop] && scope.row[item.prop].length > 30)" effect="dark"
39
-                    :content="scope.row[item.prop] + ''">
40
-                    <div class="clampTwo line21" style="flex: 1">
41
-                      {{ scope.row[item.prop] || scope.row[item.prop] == 0 ? scope.row[item.prop] : '-' }}
42
-                    </div>
43
-                  </el-tooltip>
44
-                </div>
45
-              </template>
46
-            </el-table-column>
47
-          </template>
34
+                  <template #con>
35
+                    <span class="pointer lMar10 c-red">删除</span>
36
+                  </template>
37
+                </Popconfirm>
38
+                </span>
39
+                <span class="pointerDrop lMar10 c-666" v-else>删除</span>
40
+              </div>
41
+              <!-- 其他 -->
42
+              <div class="cellDiv" v-else>
43
+                <el-tooltip :disabled="!(scope.row[item.prop] && scope.row[item.prop].length > 30)" effect="dark"
44
+                  :content="scope.row[item.prop] + ''">
45
+                  <div class="clampTwo line21" style="flex: 1">
46
+                    {{ scope.row[item.prop] || scope.row[item.prop] == 0 ? scope.row[item.prop] : '-' }}
47
+                  </div>
48
+                </el-tooltip>
49
+              </div>
50
+            </template>
51
+          </el-table-column>
52
+        </template>
48 53
       </el-table>
49 54
       <el-pagination class="tMar10" v-model:current-page="pageInfo.pagination.page"
50 55
         v-model:page-size="pageInfo.pagination.page_size" :page-sizes="[20, 50, 100, 200]" :small="true"
@@ -66,8 +71,9 @@ import { getPromotedObjectType } from '@/components/businessMoudle/batchGdt/conf
66 71
 import { exportDefine } from '@/components/businessMoudle/adTask/ts/define';
67 72
 import { nextTick, onBeforeMount, reactive, ref, watch } from 'vue';
68 73
 import Popconfirm from '@/components/capsulationMoudle/_popconfirm.vue'
69
-import { getStrategyGroupsList } from './ts/api'
70
-import { ElMessage } from 'element-plus';
74
+import { getStrategyGroupsList, getStrategyDetail, addStrategyGroups, strategyGroupsDel, getAccountStatus } from './ts/api'
75
+import { ElMessage, ElMessageBox } from 'element-plus';
76
+import _ from 'lodash';
71 77
 
72 78
 const emit = defineEmits<{
73 79
   (event: "close", val?: any): void;
@@ -75,11 +81,13 @@ const emit = defineEmits<{
75 81
 const loading = ref(false)
76 82
 const visible = ref(false)
77 83
 const targetRef = ref()
78
-const pageInfo = reactive({
84
+const pageInfo = reactive<any>({
79 85
   targetList: [],
80 86
   radioModel: '',
87
+  radioModelInfo: {},
81 88
   targetValue: '',
82 89
   name: '',
90
+  inUseGroup: {},//正在使用的策略组
83 91
   pagination: {
84 92
     page: 1,
85 93
     total: 0,
@@ -87,11 +95,11 @@ const pageInfo = reactive({
87 95
     page_size: 20,
88 96
   },
89 97
   descol: [
90
-    { prop: 'radio', label: '',align: 'center',  fixed: '', width: '60' },
91
-    { prop: 'name', label: '策略组', fixed: ''},
98
+    { prop: 'radio', label: '', align: 'center', fixed: '', width: '60' },
99
+    { prop: 'name', label: '策略组', fixed: '' },
92 100
     { prop: 'promoted_object_type_desc', label: '推广目标', fixed: '', width: '180' },
93 101
     { prop: 'note', label: '描述', fixed: '' },
94
-    { prop: 'operate', label: '操作', align: 'center',fixed: '' ,width: '120'},
102
+    { prop: 'operate', label: '操作', align: 'center', fixed: '', width: '120' },
95 103
   ],
96 104
   list: []
97 105
 })
@@ -107,8 +115,18 @@ const targetChange = () => {
107 115
   getList()
108 116
 }
109 117
 /**点击确定 */
110
-const submitEvent = () => {
111
-
118
+const submitEvent = async () => {
119
+  if(pageInfo.radioModel=='' || !pageInfo.radioModel || !pageInfo.radioModelInfo.id){
120
+    ElMessage.error('请选择策略组')
121
+    return
122
+  }
123
+  await getAccountStatus({ account_ids: pageInfo.radioModelInfo.account_ids })
124
+  emit('close', pageInfo.radioModelInfo)
125
+  visible.value = false
126
+}
127
+/**radio change */
128
+const radioChange = (info)=>{
129
+  pageInfo.radioModelInfo = info
112 130
 }
113 131
 
114 132
 const {
@@ -144,19 +162,99 @@ const handleCurrentChange = (val) => {
144 162
 }
145 163
 /**删除策略组 */
146 164
 const deleteGroup = (id) => {
147
-
165
+  loading.value = true;
166
+  strategyGroupsDel({ id }).then((res) => {
167
+    loading.value = false;
168
+    ElMessage.success('操作成功!')
169
+    getList()
170
+  }).catch(() => { loading.value = false; })
171
+}
172
+/**复制策略组 */
173
+const copyGroup = (info) => {
174
+  let title = info.name + '_副本'
175
+  loading.value = true;
176
+  getStrategyGroupsList({
177
+    page: 1,
178
+    pageSize: Number(pageInfo.pagination.page_size),
179
+    name: title,
180
+    promoted_object_type: pageInfo.targetValue
181
+  }).then((res: any) => {
182
+    if (res.data && Array.isArray(res.data) && res.data.length > 0) {
183
+      loading.value = false;
184
+      ElMessage.error('策略组名称重复!')
185
+    } else {
186
+      getStrategyDetailEvent(info.id, title)
187
+    }
188
+  }).catch(() => { loading.value = false; })
148 189
 }
190
+/**获取策略组详情 */
191
+const getStrategyDetailEvent = (id, name?) => {
192
+  loading.value = true;
193
+  getStrategyDetail({ id }).then(async (res: any) => {
194
+    loading.value = false;
195
+    await getAccountStatus({ account_ids: res.account_ids })
196
+    addStrategyGroupsEvent(Object.assign(res, { name }))
197
+  }).catch(() => { loading.value = false; })
198
+}
199
+/**新增策略组 */
200
+const addStrategyGroupsEvent = (info) => {
201
+  loading.value = true;
202
+  addStrategyGroups({
203
+    name: info.name,
204
+    note: info.note,
205
+    promoted_object_type: info.promoted_object_type,
206
+    account_ids: info.account_ids,
207
+    rule_conf: info.rule_conf,
208
+    ad_base: info.ad_base,
209
+    targetings_info: info.targetings_info,
210
+    creative_base: info.creative_base,
211
+    creative_info: info.creative_info,
212
+    paperwork: info.paperwork,
213
+    landing_page: info.landing_page,
214
+    user_action_sets: info.user_action_sets,
215
+    start_audience: info.start_audience,
216
+    wechat_channels: info.wechat_channels,
217
+    union_position: info.union_position
218
+  }).then((res:any) => {
219
+    loading.value = false;
220
+    pageInfo.pagination.page = 1;
221
+    getList()
222
+    ElMessageBox.confirm(
223
+      `<div>
224
+          <p style="margin-bottom: 12px;font-size: 16px;font-weight: 700;">策略组:${info.name} 复制成功</p>
225
+          <p style="color:#666;">你可以使用该策略组并调整广告内容,调整后再保存为新的策略</p>
226
+      </div>`,
227
+      '操作成功',
228
+      {
229
+        type: 'success',
230
+        dangerouslyUseHTMLString: true,
231
+        confirmButtonText: '立即使用',
232
+        cancelButtonText: '跳过',
233
+      }
234
+    ).then(() => {
235
+      pageInfo.radioModel = res.id
236
+      pageInfo.radioModelInfo = res
237
+      emit('close', pageInfo.radioModelInfo)
238
+      visible.value = false
239
+    }).catch(() => { })
240
+  }).catch(() => { loading.value = false; })
241
+}
242
+
149 243
 /**初始化 */
150
-const initFun = async (flag) => {
244
+const initFun = async (flag, groupsConfig) => {
151 245
   visible.value = flag
152 246
   if (flag) {
153
-    getList()
247
+    if (groupsConfig && groupsConfig.id) {
248
+      pageInfo.radioModel = groupsConfig.id
249
+      pageInfo.inUseGroup = _.cloneDeep(groupsConfig)
250
+      pageInfo.radioModelInfo = _.cloneDeep(groupsConfig)
251
+    }
154 252
     if (pageInfo.targetList.length == 0) { //获取推广目标类型
155 253
       await getPromotedObjectType().then((res) => {
156 254
         pageInfo.targetList = res
157 255
       })
256
+      getList()
158 257
     }
159
-
160 258
   }
161 259
 }
162 260
 // 暴露自己的属性供父组件使用
@@ -170,4 +268,8 @@ defineExpose({
170 268
 :deep(.spanTitle) {
171 269
   font-size: 13px;
172 270
 }
271
+
272
+.box-hint {
273
+  color: #666;
274
+}
173 275
 </style>

+ 31 - 0
src/components/businessMoudle/batchGdt/configArea/strategyGroups/ts/api.ts

@@ -48,6 +48,21 @@ export function addStrategyGroups(params: IAddStrategyGroups) {
48 48
     }
49 49
   })
50 50
 }
51
+/**更新策略组 */
52
+interface IEditStrategyGroups extends IAddStrategyGroups {
53
+  id: string
54
+}
55
+export function editStrategyGroups(params: IEditStrategyGroups) {
56
+  return new Promise(async (resolve,reject)=>{
57
+    const res: any = await http.post('/api/ad/editStrategyGroups', params)
58
+    if (res.errNo == 0) {
59
+      resolve(res.rst)
60
+    } else {
61
+      ElMessage.error(res.errMsg)
62
+      reject()
63
+    }
64
+  })
65
+}
51 66
 
52 67
 /**策略组详情 */
53 68
 interface IGetStrategyDetail {
@@ -80,3 +95,19 @@ export function strategyGroupsDel(params: IStrategyGroupsDel) {
80 95
     }
81 96
   })
82 97
 }
98
+
99
+/**获取账户投放状态 */
100
+interface IGetAccountStatus {
101
+  account_ids: string,
102
+}
103
+export function getAccountStatus(params: IGetAccountStatus) {
104
+  return new Promise(async (resolve,reject)=>{
105
+    const res: any = await http.get('/api/ad/getAccountStatus', params)
106
+    if (res.errNo == 0) {
107
+      resolve(res.rst)
108
+    } else {
109
+      ElMessage.error(res.errMsg)
110
+      reject()
111
+    }
112
+  })
113
+}

+ 23 - 16
src/components/businessMoudle/batchGdt/configArea/ts/adBasic.ts

@@ -115,25 +115,32 @@ export function handleAdBasic({
115 115
     basicInfoData.visible = false
116 116
   }
117 117
   /**广告预存信息获取 */
118
-  const getAdPresetsInfo = () => {
119
-    getAdPresets({ 'promoted_object_type': targetRef.value?.value }).then((res) => {
120
-      getButtonBasicOuter(res)
121
-      FillBackData({
122
-        data: res,
123
-        type: 'api',
124
-        cb: (data: { params: any, copywriting: [] }) => {
125
-          if (data.copywriting && Array.isArray(data.copywriting) && data.copywriting.length > 0) {
126
-            basicInfoData.copywriting = data.copywriting
127
-            for(let key in data.params) {
128
-              if(data.params[key] === null) {
129
-                data.params[key] = ''
130
-              }
118
+  const getAdPresetsInfo = (type?, info?) => {
119
+    if(type == 'strategyGroups'){
120
+      getAdBasicInfo(info)
121
+    }else{
122
+      getAdPresets({ 'promoted_object_type': targetRef.value?.value }).then((res) => {
123
+        getAdBasicInfo(res)
124
+      })
125
+    }
126
+  }
127
+  const getAdBasicInfo = (res) => {
128
+    getButtonBasicOuter(res)
129
+    FillBackData({
130
+      data: res,
131
+      type: 'api',
132
+      cb: (data: { params: any, copywriting: [] }) => {
133
+        if (data.copywriting && Array.isArray(data.copywriting) && data.copywriting.length > 0) {
134
+          basicInfoData.copywriting = data.copywriting
135
+          for(let key in data.params) {
136
+            if(data.params[key] === null) {
137
+              data.params[key] = ''
131 138
             }
132
-            basicInfoData.fillBack = data.params
133
-            updateHaveContent(2, -1, false)
134 139
           }
140
+          basicInfoData.fillBack = data.params
141
+          updateHaveContent(2, -1, false)
135 142
         }
136
-      })
143
+      }
137 144
     })
138 145
   }
139 146
   /**广告信息外部配置获取 */

+ 87 - 4
src/components/businessMoudle/batchGdt/configArea/ts/strategyGroups.ts

@@ -1,7 +1,14 @@
1 1
 import { ref } from "vue"
2
+import { getStrategyDetail } from '../strategyGroups/ts/api'
3
+import { ElLoading, ElMessage, ElMessageBox } from 'element-plus';
4
+import _ from "lodash";
2 5
 
3 6
 interface IStrategyGroupsEvent {
4 7
   judgeEvent: (...args: any[]) => boolean,
8
+  aNewConfigEvent: (...args: any[]) => void,
9
+  getAdPresetsInfo: (...args: any[]) => void,
10
+  updateHaveContent: (...args: any[]) => void,
11
+  clearOriginalityInfo: (...args: any[]) => void,
5 12
   [propName: string]: any
6 13
 }
7 14
 
@@ -11,13 +18,19 @@ export const strategyGroupsEvent = ({
11 18
   basicInfoData,
12 19
   pageInfo,
13 20
   isMock,
14
-  judgeEvent
15
-}:IStrategyGroupsEvent) => {
21
+  accRef,
22
+  targetRef,
23
+  judgeEvent,
24
+  aNewConfigEvent,
25
+  getAdPresetsInfo,
26
+  updateHaveContent,
27
+  clearOriginalityInfo
28
+}: IStrategyGroupsEvent) => {
16 29
   const StrategyGroupsListRef = ref()
17 30
   const StrategyGroupsDialogRef = ref()
18 31
   /**打开策略组列表 */
19 32
   const openStrategyGroups = () => {
20
-    StrategyGroupsListRef.value?.initFun(true)
33
+    StrategyGroupsListRef.value?.initFun(true, pageInfo.groupsConfig)
21 34
   }
22 35
 
23 36
   /**打开保存策略组弹框 */
@@ -31,10 +44,80 @@ export const strategyGroupsEvent = ({
31 44
     })
32 45
   }
33 46
 
47
+  /**关闭选中的策略组 */
48
+  const closeSeletedGroup = () => {
49
+    accRef.value.value = []
50
+    pageInfo.accIdsList = []
51
+    pageInfo.accIdsList_copy_last = _.cloneDeep(pageInfo.accIdsList)
52
+    pageInfo.groupsConfig = {}
53
+    aNewConfigEvent()
54
+  }
55
+
56
+  /**策略组回调 */
57
+  const strategyGroupsUse = (info) => {
58
+    pageInfo.groupsConfig = info;
59
+    if (info.id == '' || !info.id) {
60
+      ElMessage.error('此策略组不存在')
61
+      return
62
+    }
63
+    const loading = ElLoading.service({
64
+      lock: true,
65
+      text: '策略组配置中',
66
+      background: 'rgba(255, 255, 255, 0.5)',
67
+    })
68
+    getStrategyDetail({
69
+      id: info.id
70
+    }).then((res: any) => {
71
+      loading.close()
72
+      console.log('111', res)
73
+      if (res.rule_conf) {//规则配置
74
+        pageInfo.RuleConfigObj = JSON.parse(res.rule_conf)
75
+      }
76
+      if (res.ad_base) {//广告基本信息
77
+        basicInfoData.fillBack = JSON.parse(res.ad_base)
78
+        getAdPresetsInfo('strategyGroups', basicInfoData.fillBack)
79
+      }
80
+      if (res?.account_ids && accRef.value) {//媒体账户
81
+        accRef.value.value = res?.account_ids.split(',')
82
+        pageInfo.accIdsList = res?.account_ids?.split(',')?.map((v) => {
83
+          return { 'name': v, 'id': v }
84
+        })
85
+        pageInfo.accIdsList_copy_last = _.cloneDeep(pageInfo.accIdsList)
86
+      }
87
+      if(res?.promoted_object_type && targetRef.value){//推广目标
88
+        pageInfo.targetValue = res?.promoted_object_type
89
+        targetRef.value.value = pageInfo.targetValue;
90
+      }
91
+      if(res?.creative_base){//创意基本信息
92
+        let creative_base = JSON.parse(res?.creative_base)
93
+        for(let key in originalityBasicInfoData){
94
+          originalityBasicInfoData[key] = creative_base[key]
95
+        }
96
+        updateHaveContent(5)
97
+      }else{
98
+        clearOriginalityInfo()
99
+      }
100
+      if(res?.targetings_info){//定向包
101
+        pageInfo.directObj = JSON.parse(res?.targetings_info)
102
+      }
103
+      if(res?.creative_info){//创意素材
104
+        let creative_info = JSON.parse(res?.creative_info)
105
+        for(let key in cMaterial){
106
+          cMaterial[key] = creative_info[key]
107
+        }
108
+      }
109
+    }).catch((err) => {
110
+      console.log(err)
111
+      ElMessage.error('策略组配置失败!')
112
+      loading.close()
113
+    })
114
+  }
34 115
   return {
35 116
     StrategyGroupsDialogRef,
36 117
     StrategyGroupsListRef,
37 118
     openStrategyGroups,
38
-    openSaveStrategyGroups
119
+    openSaveStrategyGroups,
120
+    closeSeletedGroup,
121
+    strategyGroupsUse
39 122
   }
40 123
 }