jufubao-base 1.0.203 → 1.0.204

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.
@@ -0,0 +1,510 @@
1
+ 'use strict';
2
+ import ICONS from "@/ICONS.js"
3
+
4
+ /**
5
+ * @description 当表单组件中有联动操作时候,使用方法进行返回
6
+ */
7
+ export default {
8
+ style: [],
9
+ content: (data) => {
10
+ return [
11
+ {
12
+ label: "logo设置",
13
+ ele: "xd-radio",
14
+ valueKey: "showLogoType",
15
+ value: data.showLogoType,
16
+ list: [
17
+ { label: "使用应用logo", value: 'default' },
18
+ { label: "自定义logo", value: 'self' },
19
+ ],
20
+ groupKey: "content"
21
+ },
22
+ {
23
+ label: '上传自定义logo:',
24
+ ele: 'xd-upload',
25
+ valueKey: 'selfLogo',
26
+ groupKey:'content',
27
+ value: data.selfLogo || {},
28
+ defaultValue: data.selfLogo || null,
29
+ slot: true,
30
+ oneWidth: 100,
31
+ oneHeight: 100,
32
+ elinputClassName: 'input40',
33
+ tipsformet: '上传文件格式:@imageType@,不超过@size@MB.建议高度为<span style="color:red">100px</span>,宽度自适应',
34
+ type: ['jpg', 'png', 'jpeg'],
35
+ styleType: 'one',
36
+ uploadType: 'aliyun',
37
+ size: 5,
38
+ action: 'action',
39
+ sort: true,
40
+ maxlen: 100,
41
+ hidden: data.showLogoType !== 'self'
42
+ },
43
+ {
44
+ label: "是否站点名称:",
45
+ ele: "xd-radio",
46
+ valueKey: "showSiteName",
47
+ value: data.showSiteName || "Y",
48
+ list: [
49
+ { label: "展示", value: "Y" },
50
+ { label: "隐藏", value: "N" },
51
+ ],
52
+ groupKey:'content',
53
+ },
54
+ {
55
+ label: '是否分类入口:',
56
+ ele: 'xd-radio',
57
+ valueKey: 'showCategory',
58
+ value: data.showCategory || "Y",
59
+ list: [
60
+ { label: "展示", value: "Y" },
61
+ { label: "隐藏", value: "N" },
62
+ ],
63
+ groupKey:'content'
64
+ },
65
+ {
66
+ label: "分类ICON:",
67
+ ele: "xd-select-list",
68
+ valueKey: "categoryIcon",
69
+ value: data.categoryIcon,
70
+ list: ICONS,
71
+ groupKey:'content',
72
+ className: "input80",
73
+ hidden: data.showCategory !== "Y"
74
+ },
75
+
76
+ {
77
+ label: "导航配置",
78
+ ele: "title",
79
+ groupKey:'content',
80
+ size: "small",
81
+ hidden: data.showCategory !== "Y"
82
+ },
83
+ {
84
+ label: "是否展开导航(预览调试):",
85
+ ele: "xd-radio",
86
+ valueKey: "navExpand",
87
+ value: data.navExpand || "Y",
88
+ list: [
89
+ { label: "展开", value: "Y" },
90
+ { label: "收起", value: "N" },
91
+ ],
92
+ groupKey:'content',
93
+ hidden: data.showCategory !== "Y"
94
+ },
95
+ {
96
+ label: '导航列表配置:',
97
+ ele: 'xd-site-poster',
98
+ valueKey: 'poster',
99
+ className: 'input80',
100
+ value: data.poster || {},
101
+ groupKey:'content',
102
+ setting: {
103
+ count: 1,
104
+ scene: {label: '广告', value: 'normal'}
105
+ },
106
+ handleCustom({action, data}) {
107
+ //设置场景参数
108
+ if(data) {
109
+ data.params = Object.assign({}, {scene: 'normal'}, data.params || {})
110
+ }
111
+
112
+ //获取显示内容
113
+ if (action === 'screenList') {
114
+ XdBus.getParentApi('getOptionsSettingList')({setting_id: 'editx_base_ad_split_screen'})
115
+ .then(res => {
116
+ data.cb(res['list'])
117
+ })
118
+ .catch(error => {
119
+ console.error(error);
120
+ });
121
+ return
122
+ }
123
+
124
+ //获取返回参数(广告位高度必选项)
125
+ if (action === 'getPosterInfo') {
126
+ XdBus.getParentApi('cmsGetPublishEditxContent')(data.params)
127
+ .then(res => {
128
+ data.cb({list: res.list, selectId: res.selected})
129
+ })
130
+ .catch(error => {
131
+ console.error(error);
132
+ });
133
+ return
134
+ }
135
+
136
+ //使用内容分类
137
+ if (action === 'cmsPublishEditxContent') {
138
+ XdBus.getParentApi('cmsPublishEditxContent')(data.params)
139
+ .then(res => {
140
+ data.cb(res)
141
+ })
142
+ .catch(error => {
143
+ console.error(error);
144
+ });
145
+ return
146
+ }
147
+
148
+ let loading = XdBus.getParentApi('loading')({});
149
+ //位置列表
150
+ if (action === 'getListPostion') {
151
+ XdBus.getParentApi('getListPosterPosition')(data.params)
152
+ .then(res => {
153
+ loading.close();
154
+ data.cb(res)
155
+ })
156
+ .catch(error => {
157
+ loading.close();
158
+ console.error(error);
159
+ });
160
+ }
161
+
162
+ //位置创建
163
+ if (action === 'addPostion') {
164
+ XdBus.getParentApi('addPosterPosition')(data.params)
165
+ .then(res => {
166
+ loading.close();
167
+ data.cb(true)
168
+ })
169
+ .catch(error => {
170
+ console.error(error);
171
+ loading.close();
172
+ data.cb(false)
173
+ });
174
+ }
175
+
176
+ //位置编辑
177
+ if (action === 'editPostion') {
178
+ XdBus.getParentApi('updatePosterPosition')(data.params)
179
+ .then(res => {
180
+ loading.close();
181
+ data.cb(true)
182
+ })
183
+ .catch(error => {
184
+ console.error(error);
185
+ loading.close();
186
+ data.cb(false)
187
+ });
188
+ }
189
+
190
+ //位置删除
191
+ if (action === 'deleltePostion') {
192
+ XdBus.getParentApi('deletePosterPosition')(data.params)
193
+ .then(res => {
194
+ loading.close();
195
+ data.cb(true)
196
+ })
197
+ .catch(error => {
198
+ console.error(error);
199
+ loading.close();
200
+ data.cb(false)
201
+ });
202
+ }
203
+
204
+ //获取广告位内容列表
205
+ if (action === 'getListContent') {
206
+ XdBus.getParentApi('getListPosterContent')(data.params)
207
+ .then(res => {
208
+ loading.close();
209
+ data.cb(res)
210
+ })
211
+ .catch(error => {
212
+ loading.close();
213
+ console.error(error);
214
+ });
215
+ }
216
+
217
+ //广告内容创建
218
+ if (action === 'addContent') {
219
+ XdBus.getParentApi('addPosterContent')(data.params)
220
+ .then(res => {
221
+ loading.close();
222
+ data.cb(true)
223
+ })
224
+ .catch(error => {
225
+ console.error(error);
226
+ loading.close();
227
+ data.cb(false)
228
+ });
229
+ }
230
+
231
+ //广告内容编辑
232
+ if (action === 'editContent') {
233
+ XdBus.getParentApi('updatePosterContent')(data.params)
234
+ .then(res => {
235
+ loading.close();
236
+ data.cb(true)
237
+ })
238
+ .catch(error => {
239
+ console.error(error);
240
+ loading.close();
241
+ data.cb(false)
242
+ });
243
+ }
244
+
245
+ //广告内容删除
246
+ if (action === 'deleteContent') {
247
+ XdBus.getParentApi('deletePosterContent')(data.params)
248
+ .then(res => {
249
+ loading.close();
250
+ data.cb(true)
251
+ })
252
+ .catch(error => {
253
+ console.error(error);
254
+ loading.close();
255
+ data.cb(false)
256
+ });
257
+ }
258
+
259
+ //获取广告内容跳转地址类型
260
+ if (action === 'jumpPosterContentType') {
261
+ XdBus.getParentApi('getOptionsSettingList')({setting_id: "cms_setting"})
262
+ .then(res => {
263
+ loading.close();
264
+ data.cb(res['redirect_type'])
265
+ })
266
+ .catch(error => {
267
+ loading.close();
268
+ console.error(error);
269
+ });
270
+ }
271
+
272
+ //发布
273
+ if (action === 'publish') {
274
+ console.log('publish', data.params)
275
+ XdBus.getParentApi('cmsPublishContent')(data.params)
276
+ .then(res => {
277
+ loading.close();
278
+ data.cb(res)
279
+ })
280
+ .catch(error => {
281
+ loading.close();
282
+ console.error(error);
283
+ });
284
+ }
285
+
286
+ //获取站内页面地址
287
+ if (action === 'router') {
288
+ loading.close()
289
+ return XdBus.getParentApi('getPagesTree');
290
+
291
+ }
292
+
293
+ //通知页面进行刷新
294
+ if(action === 'update') {
295
+ XdBus.getParentApi('getXdBusUpdateView')('onUpdateView', {});
296
+ loading.close()
297
+ }
298
+ },
299
+ rules: [{
300
+ required: true,
301
+ validator: (rule, value, callback) => {
302
+ let message = '请设置广告相关内容';
303
+ if(!value) {
304
+ callback(message);
305
+ return;
306
+ }
307
+ if(value.size && !value.size.height){
308
+ callback(message);
309
+ return
310
+ }
311
+
312
+ if(value.size && !value.size.width){
313
+ callback(message);
314
+ return
315
+ }
316
+ callback()
317
+ },trigger: ['blur', 'change']
318
+ }],
319
+ },
320
+ {
321
+ label: "导航内容显示列数:",
322
+ ele: "xd-select-list",
323
+ valueKey: "navColumn",
324
+ value: data.navColumn || 4,
325
+ list: [
326
+ { label: "3列", value: 3 },
327
+ { label: "4列", value: 4 },
328
+ { label: "5列", value: 5 },
329
+ { label: "6列", value: 6 },
330
+ ],
331
+ className: "input80",
332
+ groupKey:'content',
333
+ hidden: data.showCategory !== "Y" || data.navExpand !== "Y"
334
+ },
335
+ {
336
+ label: "导航内容置使用张数:",
337
+ ele: "el-input",
338
+ valueKey: "navCount",
339
+ value: data.navCount,
340
+ className: "input80",
341
+ groupKey:'content',
342
+ rules: [
343
+ { required: true, message: '请设置导航内容显示张数', trigger: 'blur' }
344
+ ],
345
+ inline: true,
346
+ notice: '张',
347
+ hidden: data.showCategory !== "Y" || data.navExpand !== "Y"
348
+ },
349
+ {
350
+ label: "导航内容显示行数:",
351
+ ele: "xd-select-list",
352
+ valueKey: "navRow",
353
+ value: data.navRow || 2,
354
+ list: [
355
+ { label: "1行", value: 1 },
356
+ { label: "2行", value: 2 },
357
+ { label: "3行", value: 3 },
358
+ { label: "4行", value: 4 },
359
+ ],
360
+ className: "input80",
361
+ groupKey:'content',
362
+ hidden: data.showCategory !== "Y" || data.navExpand !== "Y"
363
+ },
364
+ {
365
+ label: "导航内边距配置:",
366
+ ele: "xd-margin-padding",
367
+ valueKey: "navPadding",
368
+ value: data.navPadding,
369
+ groupKey:'content',
370
+ setting: {
371
+ type: "padding"
372
+ },
373
+ inline: false,
374
+ notice: '设置内填充,<span style="color: red">单位:像素</span>。默认值:<span style="color: red">20</span>像素',
375
+ hidden: data.showCategory !== "Y" || data.navExpand !== "Y"
376
+ },
377
+ {
378
+ label: '导航ICON宽度:',
379
+ ele: "el-input",
380
+ valueKey: "iconWidth",
381
+ value: data.iconWidth || 100,
382
+ className: "input80",
383
+ groupKey:'content',
384
+ hidden: data.showCategory !== "Y" || data.navExpand !== "Y"
385
+ },
386
+ {
387
+ label: "导航ICON高度:",
388
+ ele: "el-input",
389
+ valueKey: "iconHeight",
390
+ value: data.iconHeight || 100,
391
+ className: "input80",
392
+ groupKey:'content',
393
+ hidden: data.showCategory !== "Y" || data.navExpand !== "Y"
394
+ },
395
+ {
396
+ label: "导航ICON外边距:",
397
+ ele: "xd-margin-padding",
398
+ valueKey: "iconMargin",
399
+ value: data.iconMargin,
400
+ groupKey:'content',
401
+ setting: {
402
+ type: "margin"
403
+ },
404
+ hidden: data.showCategory !== "Y" || data.navExpand !== "Y"
405
+ },
406
+ {
407
+ label: "单个导航背景色:",
408
+ ele: "xd-color",
409
+ valueKey: "navBgColor",
410
+ value: data.navBgColor,
411
+ groupKey:'content',
412
+ hidden: data.showCategory !== "Y" || data.navExpand !== "Y"
413
+ },
414
+ {
415
+ label: '单个导航字体颜色:',
416
+ ele: "xd-color",
417
+ valueKey: "navFontColor",
418
+ value: data.navFontColor,
419
+ groupKey:'content',
420
+ hidden: data.showCategory !== "Y" || data.navExpand !== "Y"
421
+ },
422
+ {
423
+ label: "导航横向间距:",
424
+ ele: "el-input",
425
+ valueKey: "navColumnGap",
426
+ value: data.navColumnGap || 10,
427
+ className: "input80",
428
+ groupKey:'content',
429
+ hidden: data.showCategory !== "Y" || data.navExpand !== "Y"
430
+ },
431
+ {
432
+ label: "导航垂直间距:",
433
+ ele: "el-input",
434
+ valueKey: "navRowGap",
435
+ value: data.navRowGap || 10,
436
+ className: "input80",
437
+ groupKey:'content',
438
+ hidden: data.showCategory !== "Y" || data.navExpand !== "Y"
439
+ },
440
+ {
441
+ label: "导航ICON圆角:",
442
+ ele: 'xd-site-select-list',
443
+ valueKey: 'navRadius',
444
+ groupKey:'content',
445
+ value: data.navRadius || '20',
446
+ placeholder: '请选择导航圆角设置',
447
+ multiple: false,
448
+ className: 'input80',
449
+ handleCustom({action, data}) {
450
+ XdBus.getParentApi('getOptionsSettingList')({setting_id: 'edtix_style_radius'})
451
+ .then(res => {
452
+ data.cb(res.list)
453
+ })
454
+ .catch(error => {
455
+ console.error(error);
456
+ });
457
+ },
458
+ },
459
+ {
460
+ label: "导航ICON阴影:",
461
+ ele: "xd-shadow",
462
+ valueKey: "navShadow",
463
+ value: data.navShadow,
464
+ groupKey:'content',
465
+ handleCustom({action, data}) {
466
+ XdBus.getParentApi('getOptionsSettingList')({setting_id: 'edtix_style_radius'})
467
+ .then(res => {
468
+ data.cb(res.list)
469
+ })
470
+ .catch(error => {
471
+ console.error(error);
472
+ data.cb([])
473
+ });
474
+ },
475
+ hidden: data.showCategory !== "Y" || data.navExpand !== "Y"
476
+ },
477
+ {
478
+ label: "背景颜色:",
479
+ ele: "xd-color",
480
+ valueKey: "bgColor",
481
+ value: data.bgColor,
482
+ groupKey:'style'
483
+ },
484
+ {
485
+ label: "站点名称字体设置:",
486
+ ele: "xd-font",
487
+ valueKey: "siteNameFont",
488
+ value: data.siteNameFont,
489
+ groupKey:'style',
490
+ setting: {
491
+ align: false,
492
+ lineHeight: false,
493
+ },
494
+ handleCustom({action, data}) {
495
+ XdBus.getParentApi('getOptionsSettingList')({setting_id: 'edtix_style_font_size'})
496
+ .then(res => {
497
+ data.cb(res.list)
498
+ })
499
+ .catch(error => {
500
+ data.cb([])
501
+ console.error(error);
502
+ });
503
+ },
504
+ inline: false,
505
+ hidden: data.showSiteName !== "Y"
506
+ }
507
+ ].filter(i=>i)
508
+ },
509
+ advanced: [],
510
+ };