|
@@ -0,0 +1,303 @@
|
|
1
|
+<template>
|
|
2
|
+ <el-dialog class="gdt-dialog" :close-on-click-modal="false" v-model="visible" title="保存策略组" width="1000px" top="40px"
|
|
3
|
+ :before-close="handleClose">
|
|
4
|
+ <div v-loading="loading" class="container">
|
|
5
|
+ <div class="block-title">保存方式</div>
|
|
6
|
+ <div class="lock-wrapper lock-bt-wrapper" style="border:none;padding-top:0">
|
|
7
|
+ <div :class="['lock-bt', 'lock-module']" >
|
|
8
|
+ <el-icon><RefreshRight /></el-icon>
|
|
9
|
+ <span class="rMar3">存为新的策略组</span>
|
|
10
|
+ </div>
|
|
11
|
+ <div :class="['lock-bt', 'lock-module']" >
|
|
12
|
+ <el-icon><RefreshRight /></el-icon>
|
|
13
|
+ <span class="rMar3">更新当前策略组</span>
|
|
14
|
+ </div>
|
|
15
|
+ </div>
|
|
16
|
+ <div class="block-title">选择需要锁定的内容信息</div>
|
|
17
|
+ <div class="part-wrapper">
|
|
18
|
+ <div class="filter-selectors">
|
|
19
|
+ <Select ref="accRef" :clearFlag="true" :isMultiple="true" title="媒体账户" selectWidth="160px"
|
|
20
|
+ :optObj="{ k: 'account_id', la: 'account_id', val: 'account_id' }" :options="groupsInfo.accountList" />
|
|
21
|
+ <Select ref="targetRef" :clearFlag="false" title="推广目标" selectWidth="160px"
|
|
22
|
+ :optObj="{ k: 'name', la: 'desc', val: 'name' }" @changeEvent="targetChange"
|
|
23
|
+ :options="groupsInfo.targetList" />
|
|
24
|
+ </div>
|
|
25
|
+ <div class="lock-wrapper">
|
|
26
|
+ <template v-for="(item, key) in groupsInfo.lockInfo">
|
|
27
|
+ <el-popover placement="top" :width="300" trigger="hover" :disabled="item.click" :content="item.msg">
|
|
28
|
+ <template #reference>
|
|
29
|
+ <div :class="['lock-module', item.lock && 'lock-module-active', !item.click && 'pointerDrop']"
|
|
30
|
+ @click="clockModlue(key, 'lockInfo')">
|
|
31
|
+ <div class="lock-module-info">
|
|
32
|
+ <el-icon class="icon">
|
|
33
|
+ <Tools />
|
|
34
|
+ </el-icon>
|
|
35
|
+ <p class="text-content">{{ item.content }}</p>
|
|
36
|
+ <p class="text-num">(2)</p>
|
|
37
|
+ </div>
|
|
38
|
+ <div class="lock-module-status" v-if="item.lock">
|
|
39
|
+ <el-icon>
|
|
40
|
+ <Lock />
|
|
41
|
+ </el-icon>
|
|
42
|
+ <span class="lMar3">固定变量</span>
|
|
43
|
+ </div>
|
|
44
|
+ </div>
|
|
45
|
+ </template>
|
|
46
|
+ </el-popover>
|
|
47
|
+ </template>
|
|
48
|
+ </div>
|
|
49
|
+ <div class="lock-wrapper lock-bt-wrapper">
|
|
50
|
+ <template v-for="(item, key) in groupsInfo.outerConfig">
|
|
51
|
+ <el-popover placement="top" :width="300" trigger="hover" :disabled="item.click" :content="item.msg">
|
|
52
|
+ <template #reference>
|
|
53
|
+ <div v-if="item.show" :class="['lock-bt', 'lock-module', !item.click && 'pointerDrop']" @click="clockModlue(key, 'outerConfig')">
|
|
54
|
+ <span class="rMar3">{{ item.content }}</span>
|
|
55
|
+ <el-icon v-if="item.lock">
|
|
56
|
+ <Lock />
|
|
57
|
+ </el-icon>
|
|
58
|
+ </div>
|
|
59
|
+ </template>
|
|
60
|
+ </el-popover>
|
|
61
|
+ </template>
|
|
62
|
+ </div>
|
|
63
|
+ <div class="block-title">制定策略组</div>
|
|
64
|
+ <div class="flex_start bMar15">
|
|
65
|
+ <span class="spanTitle spanTitle2">策略组名称</span>
|
|
66
|
+ <el-input
|
|
67
|
+ style="width: 300px"
|
|
68
|
+ v-model="groupsInfo.name"
|
|
69
|
+ maxlength="50"
|
|
70
|
+ placeholder="请输入策略组名称"
|
|
71
|
+ show-word-limit
|
|
72
|
+ type="textarea"
|
|
73
|
+ />
|
|
74
|
+ </div>
|
|
75
|
+ <div class="flex_start bMar15">
|
|
76
|
+ <span class="spanTitle spanTitle2">策略组描述(选填)</span>
|
|
77
|
+ <el-input
|
|
78
|
+ style="width: 300px"
|
|
79
|
+ v-model="groupsInfo.note"
|
|
80
|
+ maxlength="50"
|
|
81
|
+ placeholder="请输入策略组描述"
|
|
82
|
+ show-word-limit
|
|
83
|
+ type="textarea"
|
|
84
|
+ />
|
|
85
|
+ </div>
|
|
86
|
+ </div>
|
|
87
|
+ </div>
|
|
88
|
+ <template #footer>
|
|
89
|
+ <div class="dialog-footer" style="text-align: right;padding:10px">
|
|
90
|
+ <el-button size="default" @click="handleClose"> 取 消 </el-button>
|
|
91
|
+ <el-button size="default" type="primary" @click="submitEvent"> 确 认 </el-button>
|
|
92
|
+ </div>
|
|
93
|
+ </template>
|
|
94
|
+ </el-dialog>
|
|
95
|
+</template>
|
|
96
|
+<script setup lang="ts">
|
|
97
|
+import { Search } from '@element-plus/icons-vue'
|
|
98
|
+import Select from '@/components/capsulationMoudle/_select.vue'
|
|
99
|
+import { getPromotedObjectType } from '@/components/businessMoudle/batchGdt/configArea/basicInfo/ts/basicApi'
|
|
100
|
+import { exportDefine } from '@/components/businessMoudle/adTask/ts/define';
|
|
101
|
+import { nextTick, onBeforeMount, reactive, ref, watch } from 'vue';
|
|
102
|
+import { getStrategyGroupsList } from './ts/api'
|
|
103
|
+import { ElMessage } from 'element-plus';
|
|
104
|
+
|
|
105
|
+const emit = defineEmits<{
|
|
106
|
+ (event: "close", val?: any): void;
|
|
107
|
+}>();
|
|
108
|
+const loading = ref(false)
|
|
109
|
+const visible = ref(false)
|
|
110
|
+const targetRef = ref()
|
|
111
|
+const groupsInfo = reactive({
|
|
112
|
+ accountList: [],
|
|
113
|
+ targetList: [],
|
|
114
|
+ targetValue: '',
|
|
115
|
+ name: '',
|
|
116
|
+ note: '',
|
|
117
|
+ lockInfo: { // num定向包等个数,lock是否选中, click是否可点击,msg不可点击的原因,lock_confine点击此模块之前需要选中的模块
|
|
118
|
+ rule_conf: { content: '规则配置', icon: '', num: '', lock: true, click: true, msg: '' },
|
|
119
|
+ ad_base: { content: '广告基本信息', icon: '', num: '', lock: false, click: true, msg: '' },
|
|
120
|
+ targetings_info: { content: '定向包', icon: '', num: '', lock: false, click: true, msg: '' },
|
|
121
|
+ creative_base: { content: '创意基本信息', icon: '', num: '', lock_confine: ['ad_base'], lock: false, click: false, msg: '' },
|
|
122
|
+ creative_info: { content: '创意素材', icon: '', num: '', lock_confine: ['rule_conf', 'ad_base', 'creative_base'], lock: false, click: false, msg: '' },
|
|
123
|
+ paperwork: { content: '文案', icon: '', num: '', lock_confine: ['ad_base', 'targetings_info', 'creative_base', 'creative_info'], lock: false, click: false, msg: '' },
|
|
124
|
+ landing_page: { content: '落地页', icon: '', num: '', lock_confine: ['ad_base', 'targetings_info', 'creative_base', 'creative_info'], lock: false, click: false, msg: '' },
|
|
125
|
+ },
|
|
126
|
+ outerConfig: {//外部配置 show是否显示
|
|
127
|
+ user_action_sets: { content: '精准匹配归因', show: true, lock: false, lock_confine: ['ad_base'], click: true, msg: '' },
|
|
128
|
+ unionPosition: { content: '优量汇流量包', show: true, lock: false, lock_confine: ['ad_base'], click: true, msg: '' },
|
|
129
|
+ start_audience: { content: '一方助攻人群包', show: true, lock: false, lock_confine: ['ad_base'], click: true, msg: '' },
|
|
130
|
+ wechat_channels: { content: '视频号', show: true, lock: false, lock_confine: ['ad_base', 'creative_base'], click: true, msg: '' },
|
|
131
|
+ },
|
|
132
|
+})
|
|
133
|
+
|
|
134
|
+/**点击保存的模块 */
|
|
135
|
+const clockModlue = (key, type) => {
|
|
136
|
+ if (type == 'lockInfo') {
|
|
137
|
+ if(!groupsInfo.lockInfo[key].click) return
|
|
138
|
+ groupsInfo.lockInfo[key].lock = !groupsInfo.lockInfo[key].lock
|
|
139
|
+ changeMsgAddClick('lockInfo')
|
|
140
|
+ }
|
|
141
|
+ if(type == 'outerConfig'){
|
|
142
|
+ if(!groupsInfo.outerConfig[key].click) return
|
|
143
|
+ groupsInfo.outerConfig[key].lock = !groupsInfo.outerConfig[key].lock
|
|
144
|
+ changeMsgAddClick('outerConfig')
|
|
145
|
+ }
|
|
146
|
+}
|
|
147
|
+/** 更新msg及click */
|
|
148
|
+const changeMsgAddClick = (type) => {
|
|
149
|
+ //外部配置,lock_confine限制的是lockInfo里的,更新msg及click
|
|
150
|
+ for (let key in groupsInfo[type]) {//更新msg及click
|
|
151
|
+ let item = groupsInfo[type][key]
|
|
152
|
+ item.click = true;
|
|
153
|
+ item.msg = '';
|
|
154
|
+ if (item && !item.lock && item.lock_confine && Array.isArray(item.lock_confine)) {
|
|
155
|
+ for (let i = 0; i < item.lock_confine.length; i++) {
|
|
156
|
+ let v_item = groupsInfo.lockInfo[item.lock_confine[i]]
|
|
157
|
+ if (!v_item?.lock) {
|
|
158
|
+ item.msg = `锁定${v_item.content}后才能锁定该模块`
|
|
159
|
+ item.click = false
|
|
160
|
+ break;
|
|
161
|
+ }
|
|
162
|
+ }
|
|
163
|
+ }
|
|
164
|
+ }
|
|
165
|
+}
|
|
166
|
+
|
|
167
|
+/**点击关闭弹框 */
|
|
168
|
+const handleClose = () => {
|
|
169
|
+ visible.value = false
|
|
170
|
+}
|
|
171
|
+//推广目标
|
|
172
|
+const targetChange = () => {
|
|
173
|
+ // pageInfo.targetValue = targetRef.value?.value
|
|
174
|
+}
|
|
175
|
+/**点击确定 */
|
|
176
|
+const submitEvent = () => {
|
|
177
|
+
|
|
178
|
+}
|
|
179
|
+
|
|
180
|
+const {
|
|
181
|
+ tableHeaderStyle,
|
|
182
|
+} = exportDefine()
|
|
183
|
+
|
|
184
|
+/**获取策略组列表 */
|
|
185
|
+const getList = () => {
|
|
186
|
+
|
|
187
|
+}
|
|
188
|
+
|
|
189
|
+/**初始化 */
|
|
190
|
+const initFun = async (flag, obj) => {
|
|
191
|
+ visible.value = flag
|
|
192
|
+ if (flag) {
|
|
193
|
+ console.log(obj);//到这里了
|
|
194
|
+ changeMsgAddClick('lockInfo')
|
|
195
|
+ changeMsgAddClick('outerConfig')
|
|
196
|
+ }
|
|
197
|
+}
|
|
198
|
+// 暴露自己的属性供父组件使用
|
|
199
|
+defineExpose({
|
|
200
|
+ initFun
|
|
201
|
+});
|
|
202
|
+</script>
|
|
203
|
+<style lang="scss" scoped>
|
|
204
|
+@import "@/assets/style/batchDialogGdt.scss";
|
|
205
|
+
|
|
206
|
+:deep(.spanTitle) , .spanTitle{
|
|
207
|
+ font-size: 13px;
|
|
208
|
+ color: #666;
|
|
209
|
+}
|
|
210
|
+.container{
|
|
211
|
+ max-height: 73vh;
|
|
212
|
+ overflow-y: auto;
|
|
213
|
+ height: auto !important;
|
|
214
|
+ border-bottom: 1px solid #f2f2f2;
|
|
215
|
+}
|
|
216
|
+.spanTitle2{
|
|
217
|
+ display: inline-block;
|
|
218
|
+ width: 110px;
|
|
219
|
+ margin-top: 10px;
|
|
220
|
+}
|
|
221
|
+
|
|
222
|
+.block-title {
|
|
223
|
+ margin: 30px 0 16px;
|
|
224
|
+ font-size: 14px;
|
|
225
|
+ color: #333;
|
|
226
|
+}
|
|
227
|
+
|
|
228
|
+.filter-selectors {
|
|
229
|
+ display: flex;
|
|
230
|
+ align-items: center;
|
|
231
|
+}
|
|
232
|
+
|
|
233
|
+.lock-wrapper {
|
|
234
|
+ display: flex;
|
|
235
|
+ align-items: center;
|
|
236
|
+ justify-content: space-between;
|
|
237
|
+ // flex-direction: row;
|
|
238
|
+ // flex-wrap: wrap;
|
|
239
|
+ text-align: center;
|
|
240
|
+ margin-top: 20px;
|
|
241
|
+ padding-top: 20px;
|
|
242
|
+ border-top: 1px solid #f2f2f2;
|
|
243
|
+}
|
|
244
|
+
|
|
245
|
+.lock-module {
|
|
246
|
+ flex-shrink: 0;
|
|
247
|
+ width: 120px;
|
|
248
|
+ height: 160px;
|
|
249
|
+ cursor: pointer;
|
|
250
|
+ user-select: none;
|
|
251
|
+ border: 1px solid #d0d0d0;
|
|
252
|
+ border-radius: 6px;
|
|
253
|
+
|
|
254
|
+ &:hover {
|
|
255
|
+ box-shadow: 0 0 5px 1px #e8e8e8;
|
|
256
|
+ }
|
|
257
|
+
|
|
258
|
+ .lock-module-info {
|
|
259
|
+ height: 128px;
|
|
260
|
+ padding-top: 40px;
|
|
261
|
+ font-size: 14px;
|
|
262
|
+ line-height: 20px;
|
|
263
|
+
|
|
264
|
+ .icon {
|
|
265
|
+ font-size: 20px;
|
|
266
|
+ }
|
|
267
|
+
|
|
268
|
+ .text-content {
|
|
269
|
+ margin-top: 16px;
|
|
270
|
+ }
|
|
271
|
+
|
|
272
|
+ .text-num {}
|
|
273
|
+ }
|
|
274
|
+
|
|
275
|
+ .lock-module-status {
|
|
276
|
+ display: flex;
|
|
277
|
+ align-items: center;
|
|
278
|
+ font-size: 12px;
|
|
279
|
+ justify-content: center;
|
|
280
|
+ margin-top: 6px;
|
|
281
|
+ }
|
|
282
|
+
|
|
283
|
+ &.lock-module-active {
|
|
284
|
+ color: #197afb;
|
|
285
|
+ border-color: #197afb;
|
|
286
|
+
|
|
287
|
+ &:hover {
|
|
288
|
+ box-shadow: 0 0 5px 0 #197afb;
|
|
289
|
+ }
|
|
290
|
+ }
|
|
291
|
+}
|
|
292
|
+.lock-bt-wrapper{
|
|
293
|
+ justify-content: start;
|
|
294
|
+.lock-bt{
|
|
295
|
+ width: 160px;
|
|
296
|
+ height: 48px;
|
|
297
|
+ display: flex;
|
|
298
|
+ align-items: center;
|
|
299
|
+ justify-content: center;
|
|
300
|
+ margin-right: 15px;
|
|
301
|
+}
|
|
302
|
+}
|
|
303
|
+</style>
|