jufubao-base 1.0.103-beta1 → 1.0.103

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