jufubao-base 1.0.88 → 1.0.89-beta1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,102 +5,1002 @@
5
5
  */
6
6
  export default {
7
7
  style: [],
8
- content: (data) => {
8
+ content: (params) => {
9
+ if(!params['isCarousel']) params['isCarousel'] = 1;
9
10
  return [
10
11
  {
11
- label: '背景颜色:', //label
12
- ele: 'xd-color', //package 名称
13
- valueKey: 'bgcolor', //form[valueKey]
14
- value: data.bgcolor || '', //v-model
15
- placeholder: '请输入占位框背景颜色',
16
- classNmae: 'input80', //样式名称 //input100,input80,input70,input60,input50,input40,input30,input20,
12
+ label: '广告位高度:',
13
+ ele: 'el-input',
14
+ type: 'number',
15
+ valueKey: 'height',
16
+ value: params.height || 500,
17
+ className: 'input40',
18
+ placeholder: '请广告位内容间距设置',
19
+ notice: '单位:像素(px)',
20
+ inline: false,
21
+ },
22
+ {
23
+ label: '样式:',
24
+ ele: 'xd-radio',
25
+ valueKey: 'position',
26
+ value: params['position'] || 1,
27
+ rules: [
28
+ {required: true, message: '请选择广告位显示方式', trigger: ['blur', 'change']}
29
+ ],
30
+ list: [
31
+ {"label": "大图靠左", "value": 1},
32
+ {"label": "大图靠右", "value": 2},
33
+ ]
34
+ },
35
+ {
36
+ label: '广告位边距设置:',
37
+ ele: 'xd-margin-padding',
38
+ valueKey: 'margin',
39
+ value: params.margin || null,
40
+ disabled: false,
41
+ setting: {
42
+ type: 'margin',
43
+ },
44
+ placeholder: '请设置广告位边距设置',
45
+
46
+ },
47
+ {
48
+ label: '图片间距:',
49
+ ele: 'el-input',
50
+ type: 'number',
51
+ valueKey: 'msMargin',
52
+ value: params.msMargin || 0,
53
+ className: 'input40',
54
+ placeholder: '请广告位内容间距设置',
55
+ notice: '单位:像素(px)',
56
+ inline: false,
57
+ },
58
+ {
59
+ ele: 'title',
60
+ label: '大图设置',
61
+ size: 'small', //default/mini/small
62
+ },
63
+ {
64
+ label: '大图广告位置配置:', //label
65
+ ele: 'xd-site-poster', //package 名称
66
+ valueKey: 'poster', //form[valueKey]
67
+ className: 'input80',
68
+ value: params.poster || {},
69
+ setting: {
70
+ count: 1,
71
+ scene: {label: '广告', value: 'normal'},
72
+ partDisabled: true
73
+ },
74
+ handleCustom({action, data}) {
75
+ if (data && data.params) {
76
+ //当一个插件中出现多个内容分类时候需要设置code值,在页面引用时候(容器id + code)进行拼接获取数据列表
77
+ data.params = Object.assign({}, data.params, {code: 'big'});
78
+ }
79
+ console.log(data.params,'data.paramsdata.paramsdata.params');
80
+ //设置场景参数
81
+ if(data) {
82
+ data.params = Object.assign({}, {scene: 'normal'}, data.params || {})
83
+ }
84
+ console.log(action,data,'hjhjhjhjhj');
85
+
86
+ //获取显示内容
87
+ if (action === 'screenList') {
88
+ XdBus.getParentApi('getOptionsSettingList')({setting_id: 'editx_base_ad_split_screen'})
89
+ .then(res => {
90
+ data.cb(res['list'])
91
+ })
92
+ .catch(error => {
93
+ console.error(error);
94
+ });
95
+ return
96
+ }
97
+
98
+ //获取返回参数(广告位高度必选项)
99
+ if (action === 'getPosterInfo') {
100
+ XdBus.getParentApi('cmsGetPublishEditxContent')(data.params)
101
+ .then(res => {
102
+ data.cb({list: res.list, selectId: res.selected})
103
+ })
104
+ .catch(error => {
105
+ console.error(error);
106
+ });
107
+ return
108
+ }
109
+
110
+ //使用内容分类
111
+ if (action === 'cmsPublishEditxContent') {
112
+ XdBus.getParentApi('cmsPublishEditxContent')(data.params)
113
+ .then(res => {
114
+ data.cb(res)
115
+ })
116
+ .catch(error => {
117
+ console.error(error);
118
+ });
119
+ return
120
+ }
121
+
122
+ let loading = XdBus.getParentApi('loading')({});
123
+ //位置列表
124
+ if (action === 'getListPostion') {
125
+ XdBus.getParentApi('getListPosterPosition')(data.params)
126
+ .then(res => {
127
+ loading.close();
128
+ data.cb(res)
129
+ })
130
+ .catch(error => {
131
+ loading.close();
132
+ console.error(error);
133
+ });
134
+ }
135
+
136
+ //位置创建
137
+ if (action === 'addPostion') {
138
+ XdBus.getParentApi('addPosterPosition')(data.params)
139
+ .then(res => {
140
+ loading.close();
141
+ data.cb(true)
142
+ })
143
+ .catch(error => {
144
+ console.error(error);
145
+ loading.close();
146
+ data.cb(false)
147
+ });
148
+ }
149
+
150
+ //位置编辑
151
+ if (action === 'editPostion') {
152
+ XdBus.getParentApi('updatePosterPosition')(data.params)
153
+ .then(res => {
154
+ loading.close();
155
+ data.cb(true)
156
+ })
157
+ .catch(error => {
158
+ console.error(error);
159
+ loading.close();
160
+ data.cb(false)
161
+ });
162
+ }
163
+
164
+ //位置删除
165
+ if (action === 'deleltePostion') {
166
+ XdBus.getParentApi('deletePosterPosition')(data.params)
167
+ .then(res => {
168
+ loading.close();
169
+ data.cb(true)
170
+ })
171
+ .catch(error => {
172
+ console.error(error);
173
+ loading.close();
174
+ data.cb(false)
175
+ });
176
+ }
177
+
178
+ //获取广告位内容列表
179
+ if (action === 'getListContent') {
180
+ XdBus.getParentApi('getListPosterContent')(data.params)
181
+ .then(res => {
182
+ loading.close();
183
+ data.cb(res)
184
+ })
185
+ .catch(error => {
186
+ loading.close();
187
+ console.error(error);
188
+ });
189
+ }
190
+
191
+ //广告内容创建
192
+ if (action === 'addContent') {
193
+ XdBus.getParentApi('addPosterContent')(data.params)
194
+ .then(res => {
195
+ loading.close();
196
+ data.cb(true)
197
+ })
198
+ .catch(error => {
199
+ console.error(error);
200
+ loading.close();
201
+ data.cb(false)
202
+ });
203
+ }
204
+
205
+ //广告内容编辑
206
+ if (action === 'editContent') {
207
+ XdBus.getParentApi('updatePosterContent')(data.params)
208
+ .then(res => {
209
+ loading.close();
210
+ data.cb(true)
211
+ })
212
+ .catch(error => {
213
+ console.error(error);
214
+ loading.close();
215
+ data.cb(false)
216
+ });
217
+ }
218
+
219
+ //广告内容删除
220
+ if (action === 'deleteContent') {
221
+ XdBus.getParentApi('deletePosterContent')(data.params)
222
+ .then(res => {
223
+ loading.close();
224
+ data.cb(true)
225
+ })
226
+ .catch(error => {
227
+ console.error(error);
228
+ loading.close();
229
+ data.cb(false)
230
+ });
231
+ }
232
+
233
+ //获取广告内容跳转地址类型
234
+ if (action === 'jumpPosterContentType') {
235
+ XdBus.getParentApi('getOptionsSettingList')({setting_id: "cms_setting"})
236
+ .then(res => {
237
+ loading.close();
238
+ data.cb(res['redirect_type'])
239
+ })
240
+ .catch(error => {
241
+ loading.close();
242
+ console.error(error);
243
+ });
244
+ }
245
+
246
+ //发布
247
+ if (action === 'publish') {
248
+ console.log('publish', data.params)
249
+ XdBus.getParentApi('cmsPublishContent')(data.params)
250
+ .then(res => {
251
+ loading.close();
252
+ data.cb(res)
253
+ })
254
+ .catch(error => {
255
+ loading.close();
256
+ console.error(error);
257
+ });
258
+ }
259
+
260
+ //获取站内页面地址
261
+ if (action === 'router') {
262
+ loading.close()
263
+ return XdBus.getParentApi('getPagesTree');
264
+
265
+ }
266
+
267
+ //通知页面进行刷新
268
+ if(action === 'update') {
269
+ XdBus.getParentApi('getXdBusUpdateView')('onUpdateView', {});
270
+ loading.close()
271
+ }
272
+ },
273
+ inline: false,
274
+ notice: '',
275
+ rules: [
276
+ {required: true, message: '请选择广告位置', trigger: 'change'},
277
+ ],
278
+ },
279
+ params.poster && params.poster['type']&& params.poster['type'] !== '1' && {
280
+ label: '大图广告背景图:',
281
+ ele: 'xd-upload',
282
+ valueKey: 'background',
283
+ value: params.background || {},
284
+ defaultValue: params.background || null,
285
+ slot: true,
286
+ oneWidth: 100,
287
+ oneHeight: 100,
288
+ elinputClassName: 'input40',
289
+ tipsformet: '上传文件格式:@imageType@,不超过@size@MB.',
290
+ type: ['jpg', 'png', 'jpeg'],
291
+ styleType: 'one',
292
+ uploadType: 'aliyun',
293
+ size: 5,
294
+ action: 'action',
295
+ sort: true,
296
+ maxlen: 100,
297
+ },
298
+ params.poster && params.poster['type']&& params.poster['type'] !== '1' && {
299
+ label: '广告位内容间距设置:',
300
+ ele: 'el-input',
301
+ type: 'number',
302
+ valueKey: 'padding',
303
+ value: params.padding || 0,
304
+ className: 'input40',
305
+ placeholder: '请广告位内容间距设置',
306
+ notice: '在使用通屏显示类型广告位之外的样式时,该属性生效,单位:像素(px)',
307
+ inline: false,
308
+ },
309
+ {
310
+ label: '大图广告圆角设置:',
311
+ ele: 'xd-site-select-list',
312
+ valueKey: 'radius',
313
+ value: params['radius'] || '20',
314
+ placeholder: '请选择广告圆角设置',
315
+ multiple: false,
316
+ className: 'input80',
317
+ handleCustom({action, data}) {
318
+ XdBus.getParentApi('getOptionsSettingList')({setting_id: 'edtix_style_radius'})
319
+ .then(res => {
320
+ data.cb(res.list)
321
+ })
322
+ .catch(error => {
323
+ console.error(error);
324
+ });
325
+ },
326
+ },
327
+ {
328
+ label: '大图广告位置使用张数:',
329
+ ele: 'el-input',
330
+ type: 'number',
331
+ valueKey: 'number',
332
+ value: params.number || 1,
333
+ placeholder: '请输入广告位置使用张数',
334
+ className: 'input40',
335
+ unit: '张',
336
+ rules: [
337
+ {
338
+ required: true,
339
+ message: '请输入广告位置使用张数',
340
+ trigger: 'blur'
341
+ },
342
+ ]
343
+ },
344
+ {
345
+ label: '大图广告位显示方式:',
346
+ ele: 'xd-radio',
347
+ valueKey: 'isCarousel',
348
+ value: params['isCarousel'] || 1,
349
+ rules: [
350
+ {required: true, message: '请选择广告位显示方式', trigger: ['blur', 'change']}
351
+ ],
352
+ list: [
353
+ {"label": "焦点图显示", "value": 1},
354
+ {"label": "轮播图显示", "value": 2},
355
+ ]
356
+ },
357
+ params['isCarousel'] === 2 && {
358
+ label: '大图广告位轮播周期:',
359
+ ele: 'el-input',
360
+ type: 'number',
361
+ isKey: true,
362
+ valueKey: 'carouselTime',
363
+ value: params.carouselTime || 5,
364
+ placeholder: '请输入广告位轮播周期,单位秒',
365
+ className: 'input40',
366
+ unit: '秒',
367
+ rules: [
368
+ {
369
+ required: true,
370
+ message: '请输入广告位置高度',
371
+ trigger: 'blur'
372
+ },
373
+ ]
374
+ },
375
+ params['isCarousel'] === 2 && {
376
+ label: '大图广告显示dot类型:', //label
377
+ ele: 'xd-select-list', //package 名称
378
+ valueKey: 'dot_type', //form[valueKey]
379
+ value: params['dot_type'] || 'dot', //v-model
380
+ placeholder: '请选择广告显示dot类型',
381
+ multiple: false,
382
+ className: 'input80',
383
+ list:[
384
+ {label: '显示圆点', value: 'dot'},
385
+ {label: '显示长方形', value: 'default'},
386
+ {label: '显示圆点+长条', value: 'round'},
387
+ {label: '显示索引+标题', value: 'nav'},
388
+ {label: '显示索引', value: 'indexes'},
389
+ ],
390
+ notice: '在使用非通屏显示类型广告位之外的样式时,<span style="color: red">(显示索引+标题|显示索引)</span>使用"<span style="color: red">显示圆点</span>"',
391
+ inline: false,
392
+ },
393
+
394
+ {
395
+ ele: 'title',
396
+ label: '小图上设置',
397
+ size: 'small', //default/mini/small
398
+ },
399
+ {
400
+ label: '小图上广告位置配置:', //label
401
+ ele: 'xd-site-poster', //package 名称
402
+ valueKey: 'topPoster', //form[valueKey]
403
+ className: 'input80',
404
+ value: params.topPoster || {},
405
+ setting: {
406
+ count: 1,
407
+ scene: {label: '广告', value: 'normal'},
408
+ partDisabled: true
409
+ },
410
+ handleCustom({action, data}) {
411
+ if (data && data.params) {
412
+ //当一个插件中出现多个内容分类时候需要设置code值,在页面引用时候(容器id + code)进行拼接获取数据列表
413
+ data.params = Object.assign({}, data.params, {code: 'top'});
414
+ }
415
+ //设置场景参数
416
+ if(data) {
417
+ data.params = Object.assign({}, {scene: 'normal'}, data.params || {})
418
+ }
419
+ console.log(action,data,'hjhjhjhjhj');
420
+
421
+ //获取显示内容
422
+ if (action === 'screenList') {
423
+ XdBus.getParentApi('getOptionsSettingList')({setting_id: 'editx_base_ad_split_screen'})
424
+ .then(res => {
425
+ data.cb(res['list'])
426
+ })
427
+ .catch(error => {
428
+ console.error(error);
429
+ });
430
+ return
431
+ }
432
+
433
+ //获取返回参数(广告位高度必选项)
434
+ if (action === 'getPosterInfo') {
435
+ XdBus.getParentApi('cmsGetPublishEditxContent')(data.params)
436
+ .then(res => {
437
+ data.cb({list: res.list, selectId: res.selected})
438
+ })
439
+ .catch(error => {
440
+ console.error(error);
441
+ });
442
+ return
443
+ }
444
+
445
+ //使用内容分类
446
+ if (action === 'cmsPublishEditxContent') {
447
+ XdBus.getParentApi('cmsPublishEditxContent')(data.params)
448
+ .then(res => {
449
+ data.cb(res)
450
+ })
451
+ .catch(error => {
452
+ console.error(error);
453
+ });
454
+ return
455
+ }
456
+
457
+ let loading = XdBus.getParentApi('loading')({});
458
+ //位置列表
459
+ if (action === 'getListPostion') {
460
+ XdBus.getParentApi('getListPosterPosition')(data.params)
461
+ .then(res => {
462
+ loading.close();
463
+ data.cb(res)
464
+ })
465
+ .catch(error => {
466
+ loading.close();
467
+ console.error(error);
468
+ });
469
+ }
470
+
471
+ //位置创建
472
+ if (action === 'addPostion') {
473
+ XdBus.getParentApi('addPosterPosition')(data.params)
474
+ .then(res => {
475
+ loading.close();
476
+ data.cb(true)
477
+ })
478
+ .catch(error => {
479
+ console.error(error);
480
+ loading.close();
481
+ data.cb(false)
482
+ });
483
+ }
484
+
485
+ //位置编辑
486
+ if (action === 'editPostion') {
487
+ XdBus.getParentApi('updatePosterPosition')(data.params)
488
+ .then(res => {
489
+ loading.close();
490
+ data.cb(true)
491
+ })
492
+ .catch(error => {
493
+ console.error(error);
494
+ loading.close();
495
+ data.cb(false)
496
+ });
497
+ }
498
+
499
+ //位置删除
500
+ if (action === 'deleltePostion') {
501
+ XdBus.getParentApi('deletePosterPosition')(data.params)
502
+ .then(res => {
503
+ loading.close();
504
+ data.cb(true)
505
+ })
506
+ .catch(error => {
507
+ console.error(error);
508
+ loading.close();
509
+ data.cb(false)
510
+ });
511
+ }
512
+
513
+ //获取广告位内容列表
514
+ if (action === 'getListContent') {
515
+ XdBus.getParentApi('getListPosterContent')(data.params)
516
+ .then(res => {
517
+ loading.close();
518
+ data.cb(res)
519
+ })
520
+ .catch(error => {
521
+ loading.close();
522
+ console.error(error);
523
+ });
524
+ }
525
+
526
+ //广告内容创建
527
+ if (action === 'addContent') {
528
+ XdBus.getParentApi('addPosterContent')(data.params)
529
+ .then(res => {
530
+ loading.close();
531
+ data.cb(true)
532
+ })
533
+ .catch(error => {
534
+ console.error(error);
535
+ loading.close();
536
+ data.cb(false)
537
+ });
538
+ }
539
+
540
+ //广告内容编辑
541
+ if (action === 'editContent') {
542
+ XdBus.getParentApi('updatePosterContent')(data.params)
543
+ .then(res => {
544
+ loading.close();
545
+ data.cb(true)
546
+ })
547
+ .catch(error => {
548
+ console.error(error);
549
+ loading.close();
550
+ data.cb(false)
551
+ });
552
+ }
553
+
554
+ //广告内容删除
555
+ if (action === 'deleteContent') {
556
+ XdBus.getParentApi('deletePosterContent')(data.params)
557
+ .then(res => {
558
+ loading.close();
559
+ data.cb(true)
560
+ })
561
+ .catch(error => {
562
+ console.error(error);
563
+ loading.close();
564
+ data.cb(false)
565
+ });
566
+ }
567
+
568
+ //获取广告内容跳转地址类型
569
+ if (action === 'jumpPosterContentType') {
570
+ XdBus.getParentApi('getOptionsSettingList')({setting_id: "cms_setting"})
571
+ .then(res => {
572
+ loading.close();
573
+ data.cb(res['redirect_type'])
574
+ })
575
+ .catch(error => {
576
+ loading.close();
577
+ console.error(error);
578
+ });
579
+ }
580
+
581
+ //发布
582
+ if (action === 'publish') {
583
+ console.log('publish', data.params)
584
+ XdBus.getParentApi('cmsPublishContent')(data.params)
585
+ .then(res => {
586
+ loading.close();
587
+ data.cb(res)
588
+ })
589
+ .catch(error => {
590
+ loading.close();
591
+ console.error(error);
592
+ });
593
+ }
594
+
595
+ //获取站内页面地址
596
+ if (action === 'router') {
597
+ loading.close()
598
+ return XdBus.getParentApi('getPagesTree');
599
+
600
+ }
601
+
602
+ //通知页面进行刷新
603
+ if(action === 'update') {
604
+ XdBus.getParentApi('getXdBusUpdateView')('onUpdateView', {});
605
+ loading.close()
606
+ }
607
+ },
608
+ inline: false,
609
+ notice: '',
610
+ rules: [
611
+ {required: true, message: '请选择广告位置', trigger: 'change'},
612
+ ],
613
+ },
614
+ {
615
+ label: '小图上广告圆角设置:',
616
+ ele: 'xd-site-select-list',
617
+ valueKey: 'topRadius',
618
+ value: params['topRadius'] || '20',
619
+ placeholder: '请选择广告圆角设置',
620
+ multiple: false,
621
+ className: 'input80',
622
+ handleCustom({action, data}) {
623
+ XdBus.getParentApi('getOptionsSettingList')({setting_id: 'edtix_style_radius'})
624
+ .then(res => {
625
+ data.cb(res.list)
626
+ })
627
+ .catch(error => {
628
+ console.error(error);
629
+ });
630
+ },
631
+ },
632
+ {
633
+ label: '小图上广告位置使用张数:',
634
+ ele: 'el-input',
635
+ type: 'topNumber',
636
+ valueKey: 'topNumber',
637
+ value: params.topNumber || 1,
638
+ placeholder: '请输入广告位置使用张数',
639
+ className: 'input40',
640
+ unit: '张',
17
641
  rules: [
18
642
  {
19
643
  required: true,
20
- message: '请输入占位框背景颜色',
644
+ message: '请输入广告位置使用张数',
21
645
  trigger: 'blur'
22
646
  },
23
647
  ]
24
648
  },
25
649
  {
26
- label: '选中路径:', //label
27
- ele: 'xd-select-pages-path', //package 名称
28
- valueKey: 'select-pages-path', //form[valueKey]
29
- value: data['select-pages-path'] || {},
650
+ label: '小图上广告位显示方式:',
651
+ ele: 'xd-radio',
652
+ valueKey: 'topIsCarousel',
653
+ value: params['topIsCarousel'] || 1,
654
+ rules: [
655
+ {required: true, message: '请选择广告位显示方式', trigger: ['blur', 'change']}
656
+ ],
657
+ list: [
658
+ {"label": "焦点图显示", "value": 1},
659
+ {"label": "轮播图显示", "value": 2},
660
+ ]
661
+ },
662
+ params['topIsCarousel'] === 2 && {
663
+ label: '小图上广告位轮播周期:',
664
+ ele: 'el-input',
665
+ type: 'number',
666
+ isKey: true,
667
+ valueKey: 'topCarouselTime',
668
+ value: params.topCarouselTime || 5,
669
+ placeholder: '请输入广告位轮播周期,单位秒',
670
+ className: 'input40',
671
+ unit: '秒',
672
+ rules: [
673
+ {
674
+ required: true,
675
+ message: '请输入广告位置高度',
676
+ trigger: 'blur'
677
+ },
678
+ ]
679
+ },
680
+ params['topIsCarousel'] === 2 && {
681
+ label: '小图上广告显示dot类型:', //label
682
+ ele: 'xd-select-list', //package 名称
683
+ valueKey: 'top_dot_type', //form[valueKey]
684
+ value: params['top_dot_type'] || 'dot', //v-model
685
+ placeholder: '请选择广告显示dot类型',
686
+ multiple: false,
687
+ className: 'input80',
688
+ list:[
689
+ {label: '显示圆点', value: 'dot'},
690
+ {label: '显示长方形', value: 'default'},
691
+ {label: '显示圆点+长条', value: 'round'},
692
+ {label: '显示索引+标题', value: 'nav'},
693
+ {label: '显示索引', value: 'indexes'},
694
+ ],
695
+ notice: '在使用非通屏显示类型广告位之外的样式时,<span style="color: red">(显示索引+标题|显示索引)</span>使用"<span style="color: red">显示圆点</span>"',
696
+ inline: false,
697
+ },
698
+
699
+ {
700
+ ele: 'title',
701
+ label: '小图下设置',
702
+ size: 'small', //default/mini/small
703
+ },
704
+ {
705
+ label: '小图下广告位置配置:', //label
706
+ ele: 'xd-site-poster', //package 名称
707
+ valueKey: 'bottomPoster', //form[valueKey]
708
+ className: 'input80',
709
+ value: params.bottomPoster || {},
30
710
  setting: {
31
- router: XdBus.getParentApi('getPagesTree')
711
+ count: 1,
712
+ scene: {label: '广告', value: 'normal'},
713
+ partDisabled: true
714
+ },
715
+ handleCustom({action, data}) {
716
+ if (data && data.params) {
717
+ //当一个插件中出现多个内容分类时候需要设置code值,在页面引用时候(容器id + code)进行拼接获取数据列表
718
+ data.params = Object.assign({}, data.params, {code: 'bottom'});
719
+ }
720
+ //设置场景参数
721
+ if(data) {
722
+ data.params = Object.assign({}, {scene: 'normal'}, data.params || {})
723
+ }
724
+ console.log(action,data,'hjhjhjhjhj');
725
+
726
+ //获取显示内容
727
+ if (action === 'screenList') {
728
+ XdBus.getParentApi('getOptionsSettingList')({setting_id: 'editx_base_ad_split_screen'})
729
+ .then(res => {
730
+ data.cb(res['list'])
731
+ })
732
+ .catch(error => {
733
+ console.error(error);
734
+ });
735
+ return
736
+ }
737
+
738
+ //获取返回参数(广告位高度必选项)
739
+ if (action === 'getPosterInfo') {
740
+ XdBus.getParentApi('cmsGetPublishEditxContent')(data.params)
741
+ .then(res => {
742
+ data.cb({list: res.list, selectId: res.selected})
743
+ })
744
+ .catch(error => {
745
+ console.error(error);
746
+ });
747
+ return
748
+ }
749
+
750
+ //使用内容分类
751
+ if (action === 'cmsPublishEditxContent') {
752
+ XdBus.getParentApi('cmsPublishEditxContent')(data.params)
753
+ .then(res => {
754
+ data.cb(res)
755
+ })
756
+ .catch(error => {
757
+ console.error(error);
758
+ });
759
+ return
760
+ }
761
+
762
+ let loading = XdBus.getParentApi('loading')({});
763
+ //位置列表
764
+ if (action === 'getListPostion') {
765
+ XdBus.getParentApi('getListPosterPosition')(data.params)
766
+ .then(res => {
767
+ loading.close();
768
+ data.cb(res)
769
+ })
770
+ .catch(error => {
771
+ loading.close();
772
+ console.error(error);
773
+ });
774
+ }
775
+
776
+ //位置创建
777
+ if (action === 'addPostion') {
778
+ XdBus.getParentApi('addPosterPosition')(data.params)
779
+ .then(res => {
780
+ loading.close();
781
+ data.cb(true)
782
+ })
783
+ .catch(error => {
784
+ console.error(error);
785
+ loading.close();
786
+ data.cb(false)
787
+ });
788
+ }
789
+
790
+ //位置编辑
791
+ if (action === 'editPostion') {
792
+ XdBus.getParentApi('updatePosterPosition')(data.params)
793
+ .then(res => {
794
+ loading.close();
795
+ data.cb(true)
796
+ })
797
+ .catch(error => {
798
+ console.error(error);
799
+ loading.close();
800
+ data.cb(false)
801
+ });
802
+ }
803
+
804
+ //位置删除
805
+ if (action === 'deleltePostion') {
806
+ XdBus.getParentApi('deletePosterPosition')(data.params)
807
+ .then(res => {
808
+ loading.close();
809
+ data.cb(true)
810
+ })
811
+ .catch(error => {
812
+ console.error(error);
813
+ loading.close();
814
+ data.cb(false)
815
+ });
816
+ }
817
+
818
+ //获取广告位内容列表
819
+ if (action === 'getListContent') {
820
+ XdBus.getParentApi('getListPosterContent')(data.params)
821
+ .then(res => {
822
+ loading.close();
823
+ data.cb(res)
824
+ })
825
+ .catch(error => {
826
+ loading.close();
827
+ console.error(error);
828
+ });
829
+ }
830
+
831
+ //广告内容创建
832
+ if (action === 'addContent') {
833
+ XdBus.getParentApi('addPosterContent')(data.params)
834
+ .then(res => {
835
+ loading.close();
836
+ data.cb(true)
837
+ })
838
+ .catch(error => {
839
+ console.error(error);
840
+ loading.close();
841
+ data.cb(false)
842
+ });
843
+ }
844
+
845
+ //广告内容编辑
846
+ if (action === 'editContent') {
847
+ XdBus.getParentApi('updatePosterContent')(data.params)
848
+ .then(res => {
849
+ loading.close();
850
+ data.cb(true)
851
+ })
852
+ .catch(error => {
853
+ console.error(error);
854
+ loading.close();
855
+ data.cb(false)
856
+ });
857
+ }
858
+
859
+ //广告内容删除
860
+ if (action === 'deleteContent') {
861
+ XdBus.getParentApi('deletePosterContent')(data.params)
862
+ .then(res => {
863
+ loading.close();
864
+ data.cb(true)
865
+ })
866
+ .catch(error => {
867
+ console.error(error);
868
+ loading.close();
869
+ data.cb(false)
870
+ });
871
+ }
872
+
873
+ //获取广告内容跳转地址类型
874
+ if (action === 'jumpPosterContentType') {
875
+ XdBus.getParentApi('getOptionsSettingList')({setting_id: "cms_setting"})
876
+ .then(res => {
877
+ loading.close();
878
+ data.cb(res['redirect_type'])
879
+ })
880
+ .catch(error => {
881
+ loading.close();
882
+ console.error(error);
883
+ });
884
+ }
885
+
886
+ //发布
887
+ if (action === 'publish') {
888
+ console.log('publish', data.params)
889
+ XdBus.getParentApi('cmsPublishContent')(data.params)
890
+ .then(res => {
891
+ loading.close();
892
+ data.cb(res)
893
+ })
894
+ .catch(error => {
895
+ loading.close();
896
+ console.error(error);
897
+ });
898
+ }
899
+
900
+ //获取站内页面地址
901
+ if (action === 'router') {
902
+ loading.close()
903
+ return XdBus.getParentApi('getPagesTree');
904
+
905
+ }
906
+
907
+ //通知页面进行刷新
908
+ if(action === 'update') {
909
+ XdBus.getParentApi('getXdBusUpdateView')('onUpdateView', {});
910
+ loading.close()
911
+ }
32
912
  },
33
913
  inline: false,
914
+ notice: '',
915
+ rules: [
916
+ {required: true, message: '请选择广告位置', trigger: 'change'},
917
+ ],
34
918
  },
35
- data.bgcolor && {
36
- label: '高度:', //label
37
- ele: 'el-input', //package 名称
919
+ {
920
+ label: '小图下广告圆角设置:',
921
+ ele: 'xd-site-select-list',
922
+ valueKey: 'bottomRadius',
923
+ value: params['bottomRadius'] || '20',
924
+ placeholder: '请选择广告圆角设置',
925
+ multiple: false,
926
+ className: 'input80',
927
+ handleCustom({action, data}) {
928
+ XdBus.getParentApi('getOptionsSettingList')({setting_id: 'edtix_style_radius'})
929
+ .then(res => {
930
+ data.cb(res.list)
931
+ })
932
+ .catch(error => {
933
+ console.error(error);
934
+ });
935
+ },
936
+ },
937
+ {
938
+ label: '小图下广告位置使用张数:',
939
+ ele: 'el-input',
38
940
  type: 'number',
39
- valueKey: 'height', //form[valueKey]
40
- value: data.height || 100, //v-model
41
- placeholder: '请输入占位框高度,单位像素,默认:10px',
42
- className: 'input80', //样式名称 //input100,input80,input70,input60,input50,input40,input30,input20,
941
+ valueKey: 'bottomNumber',
942
+ value: params.bottomNumber || 1,
943
+ placeholder: '请输入广告位置使用张数',
944
+ className: 'input40',
945
+ unit: '张',
43
946
  rules: [
44
947
  {
45
948
  required: true,
46
- message: '请输入占位框高度',
949
+ message: '请输入广告位置使用张数',
47
950
  trigger: 'blur'
48
951
  },
49
952
  ]
50
953
  },
51
954
  {
52
- label: '', //label
53
- ele: 'slot', //package 名称
54
- slot: 'is_reference',
955
+ label: '小图下广告位显示方式:',
956
+ ele: 'xd-radio',
957
+ valueKey: 'bottomIsCarousel',
958
+ value: params['bottomIsCarousel'] || 1,
959
+ rules: [
960
+ {required: true, message: '请选择广告位显示方式', trigger: ['blur', 'change']}
961
+ ],
962
+ list: [
963
+ {"label": "焦点图显示", "value": 1},
964
+ {"label": "轮播图显示", "value": 2},
965
+ ]
966
+ },
967
+ params['bottomIsCarousel'] === 2 && {
968
+ label: '小图下广告位轮播周期:',
969
+ ele: 'el-input',
970
+ type: 'number',
971
+ isKey: true,
972
+ valueKey: 'bottomCarouselTime',
973
+ value: params.bottomCarouselTime || 5,
974
+ placeholder: '请输入广告位轮播周期,单位秒',
975
+ className: 'input40',
976
+ unit: '秒',
977
+ rules: [
978
+ {
979
+ required: true,
980
+ message: '请输入广告位置高度',
981
+ trigger: 'blur'
982
+ },
983
+ ]
984
+ },
985
+ params['bottomIsCarousel'] === 2 && {
986
+ label: '小图下广告显示dot类型:', //label
987
+ ele: 'xd-select-list', //package 名称
988
+ valueKey: 'bottom_dot_type', //form[valueKey]
989
+ value: params['bottom_dot_type'] || 'dot', //v-model
990
+ placeholder: '请选择广告显示dot类型',
991
+ multiple: false,
992
+ className: 'input80',
993
+ list:[
994
+ {label: '显示圆点', value: 'dot'},
995
+ {label: '显示长方形', value: 'default'},
996
+ {label: '显示圆点+长条', value: 'round'},
997
+ {label: '显示索引+标题', value: 'nav'},
998
+ {label: '显示索引', value: 'indexes'},
999
+ ],
1000
+ notice: '在使用非通屏显示类型广告位之外的样式时,<span style="color: red">(显示索引+标题|显示索引)</span>使用"<span style="color: red">显示圆点</span>"',
1001
+ inline: false,
55
1002
  },
56
1003
  ].filter(i=>i)
57
1004
  },
58
- advanced: [
59
- {
60
- label: '背景颜色:', //label
61
- ele: 'xd-color', //package 名称
62
- valueKey: 'bgcolor', //form[valueKey]
63
- value: '', //v-model
64
- placeholder: '请输入占位框背景颜色',
65
- classNmae: 'input80', //样式名称 //input100,input80,input70,input60,input50,input40,input30,input20,
66
- rules: [
67
- {
68
- required: true,
69
- message: '请输入占位框背景颜色',
70
- trigger: 'blur'
71
- },
72
- ]
73
- },
74
- {
75
- label: '选中路径:', //label
76
- ele: 'xd-select-pages-path', //package 名称
77
- valueKey: 'select-pages-path', //form[valueKey]
78
- value: null,
79
- setting: {
80
- router: XdBus.getParentApi('getPagesTree')
81
- },
82
- inline: false,
83
- },
84
- {
85
- label: '高度:', //label
86
- ele: 'el-input', //package 名称
87
- type: 'number',
88
- valueKey: 'height', //form[valueKey]
89
- value: null, //v-model
90
- placeholder: '请输入占位框高度,单位像素,默认:10px',
91
- classNmae: 'input80', //样式名称 //input100,input80,input70,input60,input50,input40,input30,input20,
92
- rules: [
93
- {
94
- required: true,
95
- message: '请输入占位框高度',
96
- trigger: 'blur'
97
- },
98
- ]
99
- },
100
- {
101
- label: '', //label
102
- ele: 'slot', //package 名称
103
- slot: 'is_reference',
104
- },
105
- ],
1005
+ advanced: [],
106
1006
  };