|
@@ -0,0 +1,457 @@
|
|
1
|
+<template>
|
|
2
|
+
|
|
3
|
+ <Dialog ref="DialogRef_editType"
|
|
4
|
+ :dialogVisible="dialogShow"
|
|
5
|
+ @confirm="confirmEvent"
|
|
6
|
+ @close="dialogShow = false"
|
|
7
|
+ width="800px"
|
|
8
|
+ height="calc(100vh - 220px)"
|
|
9
|
+ top="20px"
|
|
10
|
+ :dialog-title="pageInfo.title">
|
|
11
|
+ <template v-slot:content>
|
|
12
|
+ <div class="dialogBox" v-loading="loading">
|
|
13
|
+ <Input ref="nameRef" spanTitleWidth="80px" inputWidth="80%" title="分组名称" :haveTag="true" :haverMar15="false"/>
|
|
14
|
+ <Select ref="promoterRef"
|
|
15
|
+ class="tMar20"
|
|
16
|
+ :clearFlag="true"
|
|
17
|
+ :haveTag="true"
|
|
18
|
+ title="所属投手"
|
|
19
|
+ selectWidth="190px"
|
|
20
|
+ :optObj="{k:'id',la:'username',val:'id'}"
|
|
21
|
+ :options="pageInfo.userList"/>
|
|
22
|
+ </div>
|
|
23
|
+ </template>
|
|
24
|
+ </Dialog>
|
|
25
|
+
|
|
26
|
+</template>
|
|
27
|
+<script setup lang="ts">
|
|
28
|
+import Select from '@/components/capsulationMoudle/_select.vue'
|
|
29
|
+import Dialog from '@/components/capsulationMoudle/_dialog.vue'
|
|
30
|
+import Input from '@/components/capsulationMoudle/_input.vue'
|
|
31
|
+import {getCurrentInstance, nextTick, onMounted, reactive, ref} from "vue";
|
|
32
|
+import {ElMessage} from "element-plus";
|
|
33
|
+import {adGroupParams, fileParam, reactiveTableAndAny} from "@/api/ApiModel";
|
|
34
|
+import {Api} from "@/api/api";
|
|
35
|
+
|
|
36
|
+const { proxy } = getCurrentInstance() as any;
|
|
37
|
+// 全局方法定义
|
|
38
|
+const NumberHandle = proxy.$NumberHandle
|
|
39
|
+
|
|
40
|
+const emit = defineEmits<{
|
|
41
|
+ (event: "init"): void;
|
|
42
|
+}>();
|
|
43
|
+
|
|
44
|
+//页面数据
|
|
45
|
+const pageInfo = reactive<reactiveTableAndAny>({
|
|
46
|
+ editId:'',
|
|
47
|
+ title:'新增账号分组',
|
|
48
|
+ userList:[]
|
|
49
|
+})
|
|
50
|
+
|
|
51
|
+const init_userList = async () => {
|
|
52
|
+ let res:any = await proxy.$http.get(Api.user_list)
|
|
53
|
+ if(res&&res.errNo=='0'){
|
|
54
|
+ let resNew:any = res.rst
|
|
55
|
+ pageInfo.userList = resNew
|
|
56
|
+ }else{
|
|
57
|
+ ElMessage.error(res.errMsg)
|
|
58
|
+ }
|
|
59
|
+}
|
|
60
|
+
|
|
61
|
+const nameRef=ref<{value:string}>()
|
|
62
|
+const promoterRef=ref<{value:any}>()
|
|
63
|
+const loading=ref<boolean>(false)
|
|
64
|
+const confirmEvent = async () => {
|
|
65
|
+ if(nameRef.value!.value==''){
|
|
66
|
+ ElMessage.error('分组名称为必填项')
|
|
67
|
+ return
|
|
68
|
+ }
|
|
69
|
+
|
|
70
|
+ if(promoterRef.value!.value==''){
|
|
71
|
+ ElMessage.error('所属投手为必选项')
|
|
72
|
+ return
|
|
73
|
+ }
|
|
74
|
+ loading.value = true
|
|
75
|
+ let api:string = Api.ad_account_group_edit
|
|
76
|
+ const paramsModel = reactive<adGroupParams>({
|
|
77
|
+ name:nameRef.value!.value,
|
|
78
|
+ promoter_id:promoterRef.value!.value,
|
|
79
|
+ })
|
|
80
|
+ if(pageInfo.editId){ // 编辑
|
|
81
|
+ paramsModel.group_id = pageInfo.editId
|
|
82
|
+ }
|
|
83
|
+ let res:any = await proxy.$http.post(api,paramsModel)
|
|
84
|
+ loading.value = false
|
|
85
|
+ if(res&&res.errNo=='0'){
|
|
86
|
+ let resNew:any = res.rst
|
|
87
|
+ dialogShow.value = false
|
|
88
|
+ emit('init')
|
|
89
|
+ }else{
|
|
90
|
+ ElMessage.error(res.errMsg)
|
|
91
|
+ }
|
|
92
|
+}
|
|
93
|
+
|
|
94
|
+/**项目详情 */
|
|
95
|
+const getDetail = async (group_id) => {
|
|
96
|
+ loading.value = true;
|
|
97
|
+ let res:any = await proxy.$http.get(Api.ad_account_group_detail, {group_id})
|
|
98
|
+ loading.value = false;
|
|
99
|
+ if(res&&res.errNo=='0'){
|
|
100
|
+ let info = res?.rst;
|
|
101
|
+ pageInfo.editId = info?.id
|
|
102
|
+ nameRef.value!.value = info.name
|
|
103
|
+ promoterRef.value!.value = info.promoter_id
|
|
104
|
+ pageInfo.title = '编辑账号组'
|
|
105
|
+ }else{
|
|
106
|
+ ElMessage.error(res.errMsg)
|
|
107
|
+ }
|
|
108
|
+}
|
|
109
|
+
|
|
110
|
+// 切换显隐
|
|
111
|
+const dialogShow = ref<boolean>(false)
|
|
112
|
+const switchShow = (val:boolean,info?:any)=>{
|
|
113
|
+ dialogShow.value = val
|
|
114
|
+ if(val){
|
|
115
|
+ nextTick(async ()=>{
|
|
116
|
+ nameRef.value!.value = ''
|
|
117
|
+ promoterRef.value!.value = ''
|
|
118
|
+ pageInfo.editId = ''
|
|
119
|
+ pageInfo.title = '新增账号组'
|
|
120
|
+ loading.value = true;
|
|
121
|
+ await init_userList()
|
|
122
|
+ loading.value = false;
|
|
123
|
+ if(info?.id){ // 编辑
|
|
124
|
+ getDetail(info?.id)
|
|
125
|
+ }
|
|
126
|
+ })
|
|
127
|
+ }
|
|
128
|
+}
|
|
129
|
+// 父组件共享值
|
|
130
|
+defineExpose({
|
|
131
|
+ switchShow,
|
|
132
|
+});
|
|
133
|
+onMounted(()=>{
|
|
134
|
+ nextTick(()=>{
|
|
135
|
+
|
|
136
|
+ })
|
|
137
|
+})
|
|
138
|
+</script>
|
|
139
|
+<style lang="scss" scoped>
|
|
140
|
+:deep(.spanTitle), .spanTitle{
|
|
141
|
+ font-size: 14px;
|
|
142
|
+ width: 80px !important;
|
|
143
|
+}
|
|
144
|
+.treeBox{
|
|
145
|
+ border-radius: 4px;
|
|
146
|
+ border: 1px solid #EDEDED;
|
|
147
|
+
|
|
148
|
+}
|
|
149
|
+
|
|
150
|
+ .search-box {
|
|
151
|
+ display: block!important;
|
|
152
|
+ width: 400px;
|
|
153
|
+ margin-bottom: 10px
|
|
154
|
+}
|
|
155
|
+
|
|
156
|
+ .search-box .el-input__inner, .search-box .el-input__inner:focus {
|
|
157
|
+ border-color: #dcdfe6
|
|
158
|
+}
|
|
159
|
+
|
|
160
|
+.cascader-container {
|
|
161
|
+ display: inline-block;
|
|
162
|
+ vertical-align: top;
|
|
163
|
+ background-color: #fff;
|
|
164
|
+ border: 1px solid #dee4f5
|
|
165
|
+}
|
|
166
|
+
|
|
167
|
+.cascader-container.left {
|
|
168
|
+ width: 400px;
|
|
169
|
+ margin-right: 16px
|
|
170
|
+}
|
|
171
|
+
|
|
172
|
+.cascader-container.right {
|
|
173
|
+ width: 200px
|
|
174
|
+}
|
|
175
|
+
|
|
176
|
+.cascader-title {
|
|
177
|
+ height: 40px;
|
|
178
|
+ padding: 0 12px;
|
|
179
|
+ font-size: 14px;
|
|
180
|
+ line-height: 40px;
|
|
181
|
+ color: #333;
|
|
182
|
+ background-color: #fafafa;
|
|
183
|
+ border-bottom: 1px solid #dee4f5
|
|
184
|
+}
|
|
185
|
+
|
|
186
|
+.cascader-title .tab-label {
|
|
187
|
+ cursor: pointer
|
|
188
|
+}
|
|
189
|
+
|
|
190
|
+.cascader-title .tab-label:first-child {
|
|
191
|
+ margin-right: 16px
|
|
192
|
+}
|
|
193
|
+
|
|
194
|
+.cascader-title .tab-label.active {
|
|
195
|
+ font-weight: 700;
|
|
196
|
+ color: #197afb;
|
|
197
|
+ border-bottom: 2px solid #197afb
|
|
198
|
+}
|
|
199
|
+
|
|
200
|
+.cascader-title .tab-label.is-hidden {
|
|
201
|
+ display: none
|
|
202
|
+}
|
|
203
|
+
|
|
204
|
+.clear {
|
|
205
|
+ float: right;
|
|
206
|
+ color: #598fe6;
|
|
207
|
+ text-decoration: none;
|
|
208
|
+ cursor: pointer
|
|
209
|
+}
|
|
210
|
+
|
|
211
|
+.cascader-list {
|
|
212
|
+ width: 100%;
|
|
213
|
+ height: 236px;
|
|
214
|
+ overflow: auto;
|
|
215
|
+ font-size: 14px
|
|
216
|
+}
|
|
217
|
+
|
|
218
|
+.depart-tree .el-tree-node {
|
|
219
|
+ padding: 0 10px;
|
|
220
|
+ margin-top: 10px
|
|
221
|
+}
|
|
222
|
+
|
|
223
|
+.depart-tree .el-tree-node__content,.depart-tree .el-upload-list__item {
|
|
224
|
+ background-color: transparent
|
|
225
|
+}
|
|
226
|
+
|
|
227
|
+.depart-tree .el-tree-node:focus>.el-tree-node__content {
|
|
228
|
+ width: 100%;
|
|
229
|
+ background-color: transparent
|
|
230
|
+}
|
|
231
|
+
|
|
232
|
+.choose-member {
|
|
233
|
+ padding: 3px 10px;
|
|
234
|
+ cursor: pointer
|
|
235
|
+}
|
|
236
|
+
|
|
237
|
+.choose-member .choose {
|
|
238
|
+ display: flex;
|
|
239
|
+ flex-direction: row;
|
|
240
|
+ align-items: center;
|
|
241
|
+ justify-content: space-between;
|
|
242
|
+ padding: 5px 10px;
|
|
243
|
+ color: #666;
|
|
244
|
+ background-color: #f2f3f6
|
|
245
|
+}
|
|
246
|
+
|
|
247
|
+.choose-member .choose .icon-right {
|
|
248
|
+ display: inline-block;
|
|
249
|
+ width: 15px;
|
|
250
|
+ height: 15px
|
|
251
|
+}
|
|
252
|
+
|
|
253
|
+.member-parent {
|
|
254
|
+ display: flex;
|
|
255
|
+ flex-direction: row
|
|
256
|
+}
|
|
257
|
+
|
|
258
|
+.member-parent .member-left {
|
|
259
|
+ box-sizing: border-box;
|
|
260
|
+ width: 200px;
|
|
261
|
+ height: 100%;
|
|
262
|
+ padding-top: 8px;
|
|
263
|
+ padding-right: 10px;
|
|
264
|
+ padding-left: 10px;
|
|
265
|
+ overflow: auto
|
|
266
|
+}
|
|
267
|
+
|
|
268
|
+.member-parent .member-right {
|
|
269
|
+ flex: 1;
|
|
270
|
+ height: 100%;
|
|
271
|
+ padding-top: 8px;
|
|
272
|
+ padding-right: 10px;
|
|
273
|
+ padding-left: 10px;
|
|
274
|
+ overflow: auto;
|
|
275
|
+ border-left: 1px solid #dee4f5
|
|
276
|
+}
|
|
277
|
+
|
|
278
|
+.member-parent .member-right .tipbox {
|
|
279
|
+ display: flex;
|
|
280
|
+ flex-direction: row;
|
|
281
|
+ align-items: center;
|
|
282
|
+ justify-content: center;
|
|
283
|
+ width: 100%;
|
|
284
|
+ height: 100%;
|
|
285
|
+ font-size: 12px;
|
|
286
|
+ color: #909399
|
|
287
|
+}
|
|
288
|
+
|
|
289
|
+.member-tree .custom-tree-node {
|
|
290
|
+ width: 100%;
|
|
291
|
+ font-size: 12px;
|
|
292
|
+ -webkit-user-select: none;
|
|
293
|
+ -moz-user-select: none;
|
|
294
|
+ -ms-user-select: none;
|
|
295
|
+ user-select: none
|
|
296
|
+}
|
|
297
|
+
|
|
298
|
+.member-tree .custom-tree-node.active {
|
|
299
|
+ color: #197afb;
|
|
300
|
+ background-color: #f3f9ff;
|
|
301
|
+ border-radius: 3px
|
|
302
|
+}
|
|
303
|
+
|
|
304
|
+.member-tree .custom-tree-node .mg-icon-department,.member-tree .custom-tree-node .mg-icon-line {
|
|
305
|
+ margin-right: 6px;
|
|
306
|
+ font-size: 12px
|
|
307
|
+}
|
|
308
|
+
|
|
309
|
+.member-tree .custom-tree-node,.member-tree .el-tree-node__label {
|
|
310
|
+ overflow: hidden;
|
|
311
|
+ font-size: 14px;
|
|
312
|
+ text-indent: 8px;
|
|
313
|
+ text-overflow: ellipsis;
|
|
314
|
+ white-space: nowrap
|
|
315
|
+}
|
|
316
|
+
|
|
317
|
+.member-tree .el-tree-node__content {
|
|
318
|
+ height: 32px;
|
|
319
|
+ font-size: 14px;
|
|
320
|
+ line-height: 32px
|
|
321
|
+}
|
|
322
|
+
|
|
323
|
+.member-tree .el-tree-node__content:hover,.member-tree .el-upload-list__item:hover {
|
|
324
|
+ background-color: transparent
|
|
325
|
+}
|
|
326
|
+
|
|
327
|
+.member-tree .el-tree-node:focus>.el-tree-node__content {
|
|
328
|
+ width: 100%;
|
|
329
|
+ background-color: transparent
|
|
330
|
+}
|
|
331
|
+
|
|
332
|
+.member-tree .el-tree-node__content>.el-tree-node__expand-icon {
|
|
333
|
+ padding: 4px
|
|
334
|
+}
|
|
335
|
+
|
|
336
|
+.self-check .el-checkbox__label {
|
|
337
|
+ width: 100%;
|
|
338
|
+ font-size: 14px;
|
|
339
|
+ line-height: 32px
|
|
340
|
+}
|
|
341
|
+
|
|
342
|
+.display[data-v-7272e714] {
|
|
343
|
+ display: flex;
|
|
344
|
+ align-items: center
|
|
345
|
+}
|
|
346
|
+
|
|
347
|
+.hold[data-v-7272e714] {
|
|
348
|
+ width: 100%;
|
|
349
|
+ padding: 16px 0;
|
|
350
|
+ font-size: 12px;
|
|
351
|
+ color: #999;
|
|
352
|
+ text-align: center
|
|
353
|
+}
|
|
354
|
+
|
|
355
|
+.pricelimit[data-v-7272e714] {
|
|
356
|
+ padding: 6px 12px;
|
|
357
|
+ border: 1px solid #dcdfe6;
|
|
358
|
+ border-radius: 3px
|
|
359
|
+}
|
|
360
|
+
|
|
361
|
+.pricelimit .pricelimit-list[data-v-7272e714] {
|
|
362
|
+ display: flex;
|
|
363
|
+ align-items: center;
|
|
364
|
+ margin: 16px 0;
|
|
365
|
+ font-size: 14px
|
|
366
|
+}
|
|
367
|
+
|
|
368
|
+.pricelimit .pricelimit-list .tab-select[data-v-7272e714] {
|
|
369
|
+ width: 170px;
|
|
370
|
+ margin: 0 8px
|
|
371
|
+}
|
|
372
|
+
|
|
373
|
+.pricelimit .pricelimit-list .delete-icon[data-v-7272e714] {
|
|
374
|
+ font-size: 20px;
|
|
375
|
+ color: #999;
|
|
376
|
+ cursor: pointer
|
|
377
|
+}
|
|
378
|
+
|
|
379
|
+.pricelimit .addnew[data-v-7272e714] {
|
|
380
|
+ width: 100px;
|
|
381
|
+ font-size: 12px;
|
|
382
|
+ color: #197afb;
|
|
383
|
+ cursor: pointer
|
|
384
|
+}
|
|
385
|
+
|
|
386
|
+.pricelimit[data-v-7272e714] .el-form .el-form-item {
|
|
387
|
+ margin-bottom: 0!important
|
|
388
|
+}
|
|
389
|
+
|
|
390
|
+[data-v-1eec231b] .el-select .el-input__inner {
|
|
391
|
+ width: auto;
|
|
392
|
+ margin-left: 0
|
|
393
|
+}
|
|
394
|
+
|
|
395
|
+[data-v-1eec231b] .el-select .el-select__tags {
|
|
396
|
+ flex-wrap: nowrap
|
|
397
|
+}
|
|
398
|
+
|
|
399
|
+[data-v-1eec231b] .el-select .el-select__tags>span {
|
|
400
|
+ display: contents;
|
|
401
|
+ width: 100%
|
|
402
|
+}
|
|
403
|
+
|
|
404
|
+[data-v-1eec231b] .el-select .el-select__tags .el-tag {
|
|
405
|
+ height: 32px;
|
|
406
|
+ overflow: hidden;
|
|
407
|
+ line-height: 32px;
|
|
408
|
+ background-color: transparent;
|
|
409
|
+ border: 0 none
|
|
410
|
+}
|
|
411
|
+
|
|
412
|
+[data-v-1eec231b] .el-select .el-select__tags .el-tag .el-select__tags-text {
|
|
413
|
+ display: inline-block;
|
|
414
|
+ overflow: hidden;
|
|
415
|
+ font-size: 14px;
|
|
416
|
+ color: #666;
|
|
417
|
+ text-overflow: ellipsis;
|
|
418
|
+ white-space: nowrap
|
|
419
|
+}
|
|
420
|
+
|
|
421
|
+[data-v-1eec231b] .el-select .el-select__tags .el-tag .el-tag__close {
|
|
422
|
+ display: none
|
|
423
|
+}
|
|
424
|
+
|
|
425
|
+[data-v-1eec231b] .el-select .el-select__tags .el-select__input {
|
|
426
|
+ height: 32px;
|
|
427
|
+ margin-left: 0;
|
|
428
|
+ line-height: 32px
|
|
429
|
+}
|
|
430
|
+
|
|
431
|
+[data-v-1eec231b] .el-select.all-filter.el-select--small .el-input .el-input__inner {
|
|
432
|
+ height: 32px!important
|
|
433
|
+}
|
|
434
|
+
|
|
435
|
+[data-v-1eec231b] .el-select.all-filter.el-select--small .el-select__tags .el-select__input {
|
|
436
|
+ margin-left: 15px
|
|
437
|
+}
|
|
438
|
+
|
|
439
|
+[data-v-1eec231b] .el-select.all-filter.el-select--small .el-input__suffix {
|
|
440
|
+ height: 32px
|
|
441
|
+}
|
|
442
|
+
|
|
443
|
+.disable-icon[data-v-1eec231b] {
|
|
444
|
+ float: right;
|
|
445
|
+ width: 45px;
|
|
446
|
+ height: 24px;
|
|
447
|
+ margin-top: 5px;
|
|
448
|
+ margin-right: 20px;
|
|
449
|
+ font-size: 12px;
|
|
450
|
+ line-height: 24px;
|
|
451
|
+ color: #999;
|
|
452
|
+ text-align: center;
|
|
453
|
+ background-color: #e8eaec;
|
|
454
|
+ border-radius: 8px
|
|
455
|
+}
|
|
456
|
+
|
|
457
|
+</style>
|