@wibetter/json-utils 5.1.2 → 5.1.8
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.
- package/dist/index.esm.js +1623 -2944
- package/dist/index.esm.min.js +2 -5110
- package/dist/index.js +1 -2200
- package/dist/index.js.LICENSE.txt +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,2201 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
!(function (e, t) {
|
|
3
|
-
'object' == typeof exports && 'object' == typeof module
|
|
4
|
-
? (module.exports = t())
|
|
5
|
-
: 'function' == typeof define && define.amd
|
|
6
|
-
? define([], t)
|
|
7
|
-
: 'object' == typeof exports
|
|
8
|
-
? (exports.JSONUtils = t())
|
|
9
|
-
: (e.JSONUtils = t());
|
|
10
|
-
})(this, function () {
|
|
11
|
-
return (function () {
|
|
12
|
-
'use strict';
|
|
13
|
-
var e = {
|
|
14
|
-
n: function (t) {
|
|
15
|
-
var r =
|
|
16
|
-
t && t.__esModule
|
|
17
|
-
? function () {
|
|
18
|
-
return t.default;
|
|
19
|
-
}
|
|
20
|
-
: function () {
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
return e.d(r, { a: r }), r;
|
|
24
|
-
},
|
|
25
|
-
d: function (t, r) {
|
|
26
|
-
for (var a in r)
|
|
27
|
-
e.o(r, a) &&
|
|
28
|
-
!e.o(t, a) &&
|
|
29
|
-
Object.defineProperty(t, a, { enumerable: !0, get: r[a] });
|
|
30
|
-
},
|
|
31
|
-
o: function (e, t) {
|
|
32
|
-
return Object.prototype.hasOwnProperty.call(e, t);
|
|
33
|
-
},
|
|
34
|
-
r: function (e) {
|
|
35
|
-
'undefined' != typeof Symbol &&
|
|
36
|
-
Symbol.toStringTag &&
|
|
37
|
-
Object.defineProperty(e, Symbol.toStringTag, { value: 'Module' }),
|
|
38
|
-
Object.defineProperty(e, '__esModule', { value: !0 });
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
t = {};
|
|
42
|
-
e.r(t),
|
|
43
|
-
e.d(t, {
|
|
44
|
-
DataSourceTypeList: function () {
|
|
45
|
-
return S;
|
|
46
|
-
},
|
|
47
|
-
EventTypeDataList: function () {
|
|
48
|
-
return x;
|
|
49
|
-
},
|
|
50
|
-
KeyWordList: function () {
|
|
51
|
-
return ve;
|
|
52
|
-
},
|
|
53
|
-
TypeDataList: function () {
|
|
54
|
-
return C;
|
|
55
|
-
},
|
|
56
|
-
dataRoute2dataPath: function () {
|
|
57
|
-
return se;
|
|
58
|
-
},
|
|
59
|
-
dynamicDataAnalyzer: function () {
|
|
60
|
-
return ce;
|
|
61
|
-
},
|
|
62
|
-
evalExpression: function () {
|
|
63
|
-
return s;
|
|
64
|
-
},
|
|
65
|
-
getCurPosition: function () {
|
|
66
|
-
return Q;
|
|
67
|
-
},
|
|
68
|
-
getDefaultOptionVal: function () {
|
|
69
|
-
return le;
|
|
70
|
-
},
|
|
71
|
-
getExpectType: function () {
|
|
72
|
-
return z;
|
|
73
|
-
},
|
|
74
|
-
getJsonDataByKeyRoute: function () {
|
|
75
|
-
return d;
|
|
76
|
-
},
|
|
77
|
-
getNextIndexRoute: function () {
|
|
78
|
-
return ee;
|
|
79
|
-
},
|
|
80
|
-
getParentIndexRoute: function () {
|
|
81
|
-
return G;
|
|
82
|
-
},
|
|
83
|
-
getParentIndexRoute_CurIndex: function () {
|
|
84
|
-
return te;
|
|
85
|
-
},
|
|
86
|
-
getParentKeyRoute: function () {
|
|
87
|
-
return fe;
|
|
88
|
-
},
|
|
89
|
-
getParentKeyRoute_CurKey: function () {
|
|
90
|
-
return be;
|
|
91
|
-
},
|
|
92
|
-
getSchemaByIndexRoute: function () {
|
|
93
|
-
return y;
|
|
94
|
-
},
|
|
95
|
-
getSchemaByKeyRoute: function () {
|
|
96
|
-
return f;
|
|
97
|
-
},
|
|
98
|
-
hasProperties: function () {
|
|
99
|
-
return p;
|
|
100
|
-
},
|
|
101
|
-
indexRoute2keyRoute: function () {
|
|
102
|
-
return b;
|
|
103
|
-
},
|
|
104
|
-
isArray: function () {
|
|
105
|
-
return k;
|
|
106
|
-
},
|
|
107
|
-
isBoolean: function () {
|
|
108
|
-
return w;
|
|
109
|
-
},
|
|
110
|
-
isColor: function () {
|
|
111
|
-
return M;
|
|
112
|
-
},
|
|
113
|
-
isContainerSchema: function () {
|
|
114
|
-
return Y;
|
|
115
|
-
},
|
|
116
|
-
isDateStr: function () {
|
|
117
|
-
return R;
|
|
118
|
-
},
|
|
119
|
-
isDateTimeStr: function () {
|
|
120
|
-
return q;
|
|
121
|
-
},
|
|
122
|
-
isEmptySchema: function () {
|
|
123
|
-
return W;
|
|
124
|
-
},
|
|
125
|
-
isEqual: function () {
|
|
126
|
-
return u;
|
|
127
|
-
},
|
|
128
|
-
isFunction: function () {
|
|
129
|
-
return _;
|
|
130
|
-
},
|
|
131
|
-
isNewSchemaData: function () {
|
|
132
|
-
return X;
|
|
133
|
-
},
|
|
134
|
-
isNumber: function () {
|
|
135
|
-
return N;
|
|
136
|
-
},
|
|
137
|
-
isObject: function () {
|
|
138
|
-
return P;
|
|
139
|
-
},
|
|
140
|
-
isQuantity: function () {
|
|
141
|
-
return I;
|
|
142
|
-
},
|
|
143
|
-
isSameParent: function () {
|
|
144
|
-
return H;
|
|
145
|
-
},
|
|
146
|
-
isSelect: function () {
|
|
147
|
-
return F;
|
|
148
|
-
},
|
|
149
|
-
isString: function () {
|
|
150
|
-
return D;
|
|
151
|
-
},
|
|
152
|
-
isStructuredSchema: function () {
|
|
153
|
-
return Z;
|
|
154
|
-
},
|
|
155
|
-
isTimeStr: function () {
|
|
156
|
-
return E;
|
|
157
|
-
},
|
|
158
|
-
isURL: function () {
|
|
159
|
-
return T;
|
|
160
|
-
},
|
|
161
|
-
json2schema: function () {
|
|
162
|
-
return A;
|
|
163
|
-
},
|
|
164
|
-
json2treeData: function () {
|
|
165
|
-
return de;
|
|
166
|
-
},
|
|
167
|
-
keyRoute2indexRoute: function () {
|
|
168
|
-
return v;
|
|
169
|
-
},
|
|
170
|
-
metaElemAnalyzer: function () {
|
|
171
|
-
return $;
|
|
172
|
-
},
|
|
173
|
-
moveBackward: function () {
|
|
174
|
-
return ae;
|
|
175
|
-
},
|
|
176
|
-
moveForward: function () {
|
|
177
|
-
return re;
|
|
178
|
-
},
|
|
179
|
-
objClone: function () {
|
|
180
|
-
return o;
|
|
181
|
-
},
|
|
182
|
-
oldSchemaToNewSchema: function () {
|
|
183
|
-
return V;
|
|
184
|
-
},
|
|
185
|
-
oldSchemaToNewSchemaV1: function () {
|
|
186
|
-
return B;
|
|
187
|
-
},
|
|
188
|
-
registerExpectType: function () {
|
|
189
|
-
return U;
|
|
190
|
-
},
|
|
191
|
-
schema2conditionValue: function () {
|
|
192
|
-
return ye;
|
|
193
|
-
},
|
|
194
|
-
schema2json: function () {
|
|
195
|
-
return ue;
|
|
196
|
-
},
|
|
197
|
-
schemaMetaList: function () {
|
|
198
|
-
return pe;
|
|
199
|
-
},
|
|
200
|
-
truncate: function () {
|
|
201
|
-
return c;
|
|
202
|
-
},
|
|
203
|
-
urlParse: function () {
|
|
204
|
-
return i;
|
|
205
|
-
},
|
|
206
|
-
urlStringify: function () {
|
|
207
|
-
return n;
|
|
208
|
-
},
|
|
209
|
-
});
|
|
210
|
-
var r = require('lodash'),
|
|
211
|
-
a = require('qs'),
|
|
212
|
-
l = e.n(a);
|
|
213
|
-
function i() {
|
|
214
|
-
var e = {};
|
|
215
|
-
return (
|
|
216
|
-
location.search && (e = l().parse(location.search.substring(1))), e
|
|
217
|
-
);
|
|
218
|
-
}
|
|
219
|
-
function n(e) {
|
|
220
|
-
var t = '';
|
|
221
|
-
return url && (t = l().stringify(e)), t;
|
|
222
|
-
}
|
|
223
|
-
function o(e) {
|
|
224
|
-
return (0, r.cloneDeep)(e);
|
|
225
|
-
}
|
|
226
|
-
function u(e, t) {
|
|
227
|
-
return (0, r.isEqual)(e, t);
|
|
228
|
-
}
|
|
229
|
-
function p(e) {
|
|
230
|
-
var t = !1;
|
|
231
|
-
return null != e && (t = !0), t;
|
|
232
|
-
}
|
|
233
|
-
function c(e, t) {
|
|
234
|
-
return (0, r.truncate)(e, t);
|
|
235
|
-
}
|
|
236
|
-
function s(e, t) {
|
|
237
|
-
var r = t || {};
|
|
238
|
-
if (!e) return !1;
|
|
239
|
-
var a = new Function('data', 'with(data) { return (' + e + ');}'),
|
|
240
|
-
l = '';
|
|
241
|
-
try {
|
|
242
|
-
l = a(r);
|
|
243
|
-
} catch (t) {
|
|
244
|
-
return console.warn('表达式运算出错: ' + e + ',报错信息:', t), l;
|
|
245
|
-
}
|
|
246
|
-
return l;
|
|
247
|
-
}
|
|
248
|
-
function d(e, t, r) {
|
|
249
|
-
var a = t;
|
|
250
|
-
if ((r && (a = o(t)), e))
|
|
251
|
-
for (var l = e.split('-'), i = 0, n = l.length; i < n; i++) {
|
|
252
|
-
var u = l[i];
|
|
253
|
-
u && (a = a && a[u]);
|
|
254
|
-
}
|
|
255
|
-
return a;
|
|
256
|
-
}
|
|
257
|
-
function y(e, t, r) {
|
|
258
|
-
var a = t;
|
|
259
|
-
if ((r && (a = o(t)), e))
|
|
260
|
-
for (var l = e.split('-'), i = 0, n = l.length; i < n; i++) {
|
|
261
|
-
var u = l[i];
|
|
262
|
-
if (
|
|
263
|
-
'0' !== u ||
|
|
264
|
-
('array' !== a.type &&
|
|
265
|
-
'radio' !== a.type &&
|
|
266
|
-
'select' !== a.type &&
|
|
267
|
-
'checkboxes' !== a.type) ||
|
|
268
|
-
(!a.options && !a.items)
|
|
269
|
-
) {
|
|
270
|
-
if (u) {
|
|
271
|
-
var p = '0';
|
|
272
|
-
a.propertyOrder
|
|
273
|
-
? (p = a.propertyOrder[u])
|
|
274
|
-
: a.properties && (p = Object.keys(a.properties)[u]),
|
|
275
|
-
(a = a.properties[p]);
|
|
276
|
-
}
|
|
277
|
-
} else a = a.options || a.items;
|
|
278
|
-
}
|
|
279
|
-
return a;
|
|
280
|
-
}
|
|
281
|
-
function f(e, t, r) {
|
|
282
|
-
var a = t;
|
|
283
|
-
if ((r && (a = o(t)), e && a))
|
|
284
|
-
for (var l = e.split('-'), i = 0, n = l.length; i < n; i++) {
|
|
285
|
-
var u = l[i];
|
|
286
|
-
u && a.properties && (a = a.properties[u]);
|
|
287
|
-
}
|
|
288
|
-
return a;
|
|
289
|
-
}
|
|
290
|
-
function b(e, t) {
|
|
291
|
-
for (
|
|
292
|
-
var r = t, a = '', l = e.split('-'), i = 0, n = l.length;
|
|
293
|
-
i < n;
|
|
294
|
-
i++
|
|
295
|
-
) {
|
|
296
|
-
var o = l[i];
|
|
297
|
-
if ('0' === o && r.items)
|
|
298
|
-
(r = r.items), (a = a ? a + '-items' : 'items');
|
|
299
|
-
else if ('0' === o && r.options)
|
|
300
|
-
(r = r.options), (a = a ? a + '-options' : 'options');
|
|
301
|
-
else if (o) {
|
|
302
|
-
var u = '0';
|
|
303
|
-
r.propertyOrder
|
|
304
|
-
? (u = r.propertyOrder[o])
|
|
305
|
-
: r.properties && (u = Object.keys(r.properties)[o]),
|
|
306
|
-
(r = r.properties[u]),
|
|
307
|
-
(a = a ? a + '-' + u : u);
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
return a;
|
|
311
|
-
}
|
|
312
|
-
function v(e, t) {
|
|
313
|
-
for (
|
|
314
|
-
var r = t, a = '', l = e.split('-'), i = 0, n = l.length;
|
|
315
|
-
i < n;
|
|
316
|
-
i++
|
|
317
|
-
) {
|
|
318
|
-
var o = l[i];
|
|
319
|
-
if (o) {
|
|
320
|
-
var u = -1;
|
|
321
|
-
r.propertyOrder
|
|
322
|
-
? ((u = r.propertyOrder.indexOf(o)), (r = r.properties[o]))
|
|
323
|
-
: r.properties
|
|
324
|
-
? ((u = Object.keys(r.properties).indexOf(o)),
|
|
325
|
-
(r = r.properties[o]))
|
|
326
|
-
: r.items
|
|
327
|
-
? ((u = 0), (r = r.items))
|
|
328
|
-
: r.options && ((u = 0), (r = r.options)),
|
|
329
|
-
(a = a ? a + '-' + u : u.toString());
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
return a;
|
|
333
|
-
}
|
|
334
|
-
var m,
|
|
335
|
-
g = {
|
|
336
|
-
type: 'event',
|
|
337
|
-
title: '事件',
|
|
338
|
-
isContainer: !1,
|
|
339
|
-
properties: {
|
|
340
|
-
type: {
|
|
341
|
-
default: 'emit',
|
|
342
|
-
type: 'select',
|
|
343
|
-
options: [
|
|
344
|
-
{ label: 'on', value: 'on' },
|
|
345
|
-
{ label: 'emit', value: 'emit' },
|
|
346
|
-
],
|
|
347
|
-
title: '事件类型',
|
|
348
|
-
},
|
|
349
|
-
trigger: {
|
|
350
|
-
type: 'input',
|
|
351
|
-
default: 'eventName',
|
|
352
|
-
title: '触发事件',
|
|
353
|
-
description: '用于输入触发事件的名称',
|
|
354
|
-
placeholder: '请输入触发事件的名称',
|
|
355
|
-
},
|
|
356
|
-
eventData: {
|
|
357
|
-
title: '事件数据',
|
|
358
|
-
type: 'json',
|
|
359
|
-
default: '{}',
|
|
360
|
-
description: '传递给触发事件的数据对象',
|
|
361
|
-
},
|
|
362
|
-
},
|
|
363
|
-
propertyOrder: ['type', 'trigger', 'eventData'],
|
|
364
|
-
},
|
|
365
|
-
h = {
|
|
366
|
-
type: 'datasource',
|
|
367
|
-
title: '数据源',
|
|
368
|
-
isContainer: !1,
|
|
369
|
-
properties: {
|
|
370
|
-
type: {
|
|
371
|
-
default: 'local',
|
|
372
|
-
type: 'select',
|
|
373
|
-
options: [
|
|
374
|
-
{ label: '本地数据', value: 'local' },
|
|
375
|
-
{ label: '接口数据', value: 'remote' },
|
|
376
|
-
],
|
|
377
|
-
title: '数据源类型',
|
|
378
|
-
},
|
|
379
|
-
data: {
|
|
380
|
-
title: '本地json数据',
|
|
381
|
-
placeholder: '请输入静态json数据',
|
|
382
|
-
type: 'json',
|
|
383
|
-
default: '{}',
|
|
384
|
-
description: '用于设置本地的静态json数据',
|
|
385
|
-
isRequired: !0,
|
|
386
|
-
},
|
|
387
|
-
filter: {
|
|
388
|
-
title: '过滤器',
|
|
389
|
-
type: 'codearea',
|
|
390
|
-
default: '() => {}',
|
|
391
|
-
description: '用于定义过滤当前数据的函数',
|
|
392
|
-
isRequired: !0,
|
|
393
|
-
},
|
|
394
|
-
},
|
|
395
|
-
propertyOrder: ['type', 'data', 'filter'],
|
|
396
|
-
},
|
|
397
|
-
j =
|
|
398
|
-
(((m = { type: 'object' }).type = 'datasource'),
|
|
399
|
-
(m.title = '数据源'),
|
|
400
|
-
(m.isContainer = !1),
|
|
401
|
-
(m.properties = {
|
|
402
|
-
type: {
|
|
403
|
-
type: 'select',
|
|
404
|
-
default: 'remote',
|
|
405
|
-
options: [
|
|
406
|
-
{ label: '本地数据', value: 'local' },
|
|
407
|
-
{ label: '接口数据', value: 'remote' },
|
|
408
|
-
],
|
|
409
|
-
title: '数据源类型',
|
|
410
|
-
},
|
|
411
|
-
data: {
|
|
412
|
-
type: 'url',
|
|
413
|
-
title: '远程json数据',
|
|
414
|
-
placeholder: '请输入远程json数据源地址',
|
|
415
|
-
default: 'http://xxx',
|
|
416
|
-
isRequired: !0,
|
|
417
|
-
description: '用于设置获取元素数据的请求地址',
|
|
418
|
-
},
|
|
419
|
-
filter: {
|
|
420
|
-
type: 'codearea',
|
|
421
|
-
title: '过滤器',
|
|
422
|
-
default: '() => {}',
|
|
423
|
-
description: '用于定义过滤当前数据的函数',
|
|
424
|
-
isRequired: !0,
|
|
425
|
-
},
|
|
426
|
-
}),
|
|
427
|
-
(m.propertyOrder = ['type', 'data', 'filter']),
|
|
428
|
-
m),
|
|
429
|
-
O = {
|
|
430
|
-
type: 'local',
|
|
431
|
-
config: { dataName: '', body: {}, filter: 'return data;' },
|
|
432
|
-
data: '{}',
|
|
433
|
-
localFilter: 'return data;',
|
|
434
|
-
},
|
|
435
|
-
C = {
|
|
436
|
-
jsonschema: {
|
|
437
|
-
type: 'object',
|
|
438
|
-
title: 'jsonSchemaObject',
|
|
439
|
-
properties: {
|
|
440
|
-
func: {
|
|
441
|
-
type: 'object',
|
|
442
|
-
title: '功能设置',
|
|
443
|
-
properties: {
|
|
444
|
-
a: {
|
|
445
|
-
title: '单文本框',
|
|
446
|
-
type: 'input',
|
|
447
|
-
default: '',
|
|
448
|
-
description: '',
|
|
449
|
-
placeholder: '',
|
|
450
|
-
isRequired: !1,
|
|
451
|
-
},
|
|
452
|
-
},
|
|
453
|
-
propertyOrder: ['a'],
|
|
454
|
-
},
|
|
455
|
-
style: {
|
|
456
|
-
type: 'object',
|
|
457
|
-
title: '样式设置',
|
|
458
|
-
properties: {
|
|
459
|
-
b: {
|
|
460
|
-
title: '单文本框',
|
|
461
|
-
type: 'input',
|
|
462
|
-
default: '',
|
|
463
|
-
description: '',
|
|
464
|
-
placeholder: '',
|
|
465
|
-
},
|
|
466
|
-
},
|
|
467
|
-
propertyOrder: ['b'],
|
|
468
|
-
},
|
|
469
|
-
data: {
|
|
470
|
-
type: 'data',
|
|
471
|
-
title: '数据设置',
|
|
472
|
-
properties: {
|
|
473
|
-
c: {
|
|
474
|
-
title: '单文本框',
|
|
475
|
-
type: 'input',
|
|
476
|
-
default: '',
|
|
477
|
-
description: '',
|
|
478
|
-
placeholder: '',
|
|
479
|
-
isRequired: !1,
|
|
480
|
-
},
|
|
481
|
-
},
|
|
482
|
-
propertyOrder: ['c'],
|
|
483
|
-
},
|
|
484
|
-
},
|
|
485
|
-
propertyOrder: ['func', 'style', 'data'],
|
|
486
|
-
},
|
|
487
|
-
input: {
|
|
488
|
-
title: '单文本框',
|
|
489
|
-
type: 'input',
|
|
490
|
-
default: '',
|
|
491
|
-
description: '',
|
|
492
|
-
placeholder: '',
|
|
493
|
-
},
|
|
494
|
-
boolean: {
|
|
495
|
-
type: 'boolean',
|
|
496
|
-
title: '布尔值',
|
|
497
|
-
default: !1,
|
|
498
|
-
description: '',
|
|
499
|
-
},
|
|
500
|
-
object: {
|
|
501
|
-
type: 'object',
|
|
502
|
-
title: '对象Object',
|
|
503
|
-
description: '',
|
|
504
|
-
properties: {
|
|
505
|
-
a: {
|
|
506
|
-
type: 'input',
|
|
507
|
-
title: '单文本框',
|
|
508
|
-
default: '',
|
|
509
|
-
description: '',
|
|
510
|
-
placeholder: '',
|
|
511
|
-
},
|
|
512
|
-
},
|
|
513
|
-
propertyOrder: ['a'],
|
|
514
|
-
},
|
|
515
|
-
array: {
|
|
516
|
-
type: 'array',
|
|
517
|
-
title: '数组Array',
|
|
518
|
-
description: '',
|
|
519
|
-
items: {
|
|
520
|
-
type: 'object',
|
|
521
|
-
title: '数组项',
|
|
522
|
-
description: '',
|
|
523
|
-
properties: {
|
|
524
|
-
name: {
|
|
525
|
-
type: 'input',
|
|
526
|
-
title: '名字',
|
|
527
|
-
default: '',
|
|
528
|
-
description: '',
|
|
529
|
-
placeholder: '',
|
|
530
|
-
},
|
|
531
|
-
},
|
|
532
|
-
propertyOrder: ['name'],
|
|
533
|
-
},
|
|
534
|
-
},
|
|
535
|
-
'empty-array': {
|
|
536
|
-
type: 'array',
|
|
537
|
-
title: '数组Array',
|
|
538
|
-
description: '',
|
|
539
|
-
default: [],
|
|
540
|
-
items: {
|
|
541
|
-
type: 'object',
|
|
542
|
-
title: '数组项',
|
|
543
|
-
description: '',
|
|
544
|
-
properties: {},
|
|
545
|
-
},
|
|
546
|
-
},
|
|
547
|
-
'empty-object': {
|
|
548
|
-
type: 'object',
|
|
549
|
-
title: '对象Object',
|
|
550
|
-
description: '',
|
|
551
|
-
properties: {},
|
|
552
|
-
},
|
|
553
|
-
url: {
|
|
554
|
-
type: 'url',
|
|
555
|
-
title: '链接地址url',
|
|
556
|
-
default: '',
|
|
557
|
-
description: '',
|
|
558
|
-
placeholder: '',
|
|
559
|
-
},
|
|
560
|
-
textarea: {
|
|
561
|
-
type: 'textarea',
|
|
562
|
-
title: '多行文本框',
|
|
563
|
-
default: '',
|
|
564
|
-
description: '',
|
|
565
|
-
placeholder: '',
|
|
566
|
-
},
|
|
567
|
-
color: {
|
|
568
|
-
type: 'color',
|
|
569
|
-
title: '颜色color',
|
|
570
|
-
default: '#ffffff',
|
|
571
|
-
description: '',
|
|
572
|
-
},
|
|
573
|
-
image: {
|
|
574
|
-
title: '图片',
|
|
575
|
-
type: 'image',
|
|
576
|
-
default: '',
|
|
577
|
-
description: '上传图片',
|
|
578
|
-
imgWidth: 200,
|
|
579
|
-
imgHeight: 200,
|
|
580
|
-
imgRatioReadOnly: !0,
|
|
581
|
-
},
|
|
582
|
-
number: {
|
|
583
|
-
type: 'number',
|
|
584
|
-
title: '数量number',
|
|
585
|
-
default: 1,
|
|
586
|
-
minimum: 0,
|
|
587
|
-
maximum: 1e3,
|
|
588
|
-
description: '',
|
|
589
|
-
},
|
|
590
|
-
'input-image': {
|
|
591
|
-
title: '图片地址',
|
|
592
|
-
type: 'input-image',
|
|
593
|
-
description: '',
|
|
594
|
-
accept: '.jpeg,.jpg,.png',
|
|
595
|
-
multiple: !0,
|
|
596
|
-
},
|
|
597
|
-
json: {
|
|
598
|
-
title: 'json数据',
|
|
599
|
-
type: 'json',
|
|
600
|
-
default: '{}',
|
|
601
|
-
description: '',
|
|
602
|
-
},
|
|
603
|
-
codearea: {
|
|
604
|
-
type: 'codearea',
|
|
605
|
-
title: '函数类型',
|
|
606
|
-
placeholder: '请输入函数方法',
|
|
607
|
-
default: 'function func() { console.log("hello, world!"); }',
|
|
608
|
-
description: '用于定义函数方法',
|
|
609
|
-
},
|
|
610
|
-
htmlarea: {
|
|
611
|
-
title: '富文本',
|
|
612
|
-
type: 'htmlarea',
|
|
613
|
-
placeholder: '请输入html代码片段',
|
|
614
|
-
default: '<p>hello,world!</p>',
|
|
615
|
-
description: '用于放置html代码片段',
|
|
616
|
-
},
|
|
617
|
-
'text-editor': {
|
|
618
|
-
type: 'text-editor',
|
|
619
|
-
title: '富文本',
|
|
620
|
-
default: '',
|
|
621
|
-
description: '',
|
|
622
|
-
placeholder: '',
|
|
623
|
-
},
|
|
624
|
-
date: {
|
|
625
|
-
type: 'date',
|
|
626
|
-
title: '日期Date',
|
|
627
|
-
default: '',
|
|
628
|
-
description: '',
|
|
629
|
-
placeholder: '',
|
|
630
|
-
},
|
|
631
|
-
'date-time': {
|
|
632
|
-
type: 'date-time',
|
|
633
|
-
title: '日期时间',
|
|
634
|
-
default: '',
|
|
635
|
-
description: '',
|
|
636
|
-
placeholder: '',
|
|
637
|
-
},
|
|
638
|
-
time: {
|
|
639
|
-
type: 'time',
|
|
640
|
-
title: '时间Time',
|
|
641
|
-
default: '',
|
|
642
|
-
description: '',
|
|
643
|
-
placeholder: '',
|
|
644
|
-
},
|
|
645
|
-
quantity: {
|
|
646
|
-
type: 'quantity',
|
|
647
|
-
title: '单位计量',
|
|
648
|
-
isContainer: !1,
|
|
649
|
-
properties: {
|
|
650
|
-
unit: {
|
|
651
|
-
type: 'number',
|
|
652
|
-
title: '单位数值',
|
|
653
|
-
default: 50,
|
|
654
|
-
minimum: 0,
|
|
655
|
-
maximum: 1e3,
|
|
656
|
-
description: '',
|
|
657
|
-
},
|
|
658
|
-
quantity: {
|
|
659
|
-
type: 'select',
|
|
660
|
-
default: 'px',
|
|
661
|
-
options: [
|
|
662
|
-
{ label: 'px', value: 'px' },
|
|
663
|
-
{ label: 'rem', value: 'rem' },
|
|
664
|
-
{ label: 'em', value: 'em' },
|
|
665
|
-
{ label: '%', value: '%' },
|
|
666
|
-
],
|
|
667
|
-
title: '单位类型',
|
|
668
|
-
},
|
|
669
|
-
},
|
|
670
|
-
propertyOrder: ['unit', 'quantity'],
|
|
671
|
-
},
|
|
672
|
-
'box-style': {
|
|
673
|
-
type: 'box-style',
|
|
674
|
-
title: '盒子模型',
|
|
675
|
-
isContainer: !1,
|
|
676
|
-
properties: {
|
|
677
|
-
unit: {
|
|
678
|
-
title: '单位数值',
|
|
679
|
-
type: 'input',
|
|
680
|
-
default: '0',
|
|
681
|
-
description: '',
|
|
682
|
-
},
|
|
683
|
-
quantity: {
|
|
684
|
-
type: 'select',
|
|
685
|
-
default: 'px',
|
|
686
|
-
options: [
|
|
687
|
-
{ label: 'px', value: 'px' },
|
|
688
|
-
{ label: 'rem', value: 'rem' },
|
|
689
|
-
{ label: 'em', value: 'em' },
|
|
690
|
-
{ label: '%', value: '%' },
|
|
691
|
-
],
|
|
692
|
-
title: '单位类型',
|
|
693
|
-
},
|
|
694
|
-
},
|
|
695
|
-
propertyOrder: ['unit', 'quantity'],
|
|
696
|
-
},
|
|
697
|
-
'padding-margin': {
|
|
698
|
-
type: 'padding-margin',
|
|
699
|
-
title: '边距设置',
|
|
700
|
-
isContainer: !1,
|
|
701
|
-
properties: {
|
|
702
|
-
margin: {
|
|
703
|
-
title: '外边距',
|
|
704
|
-
type: 'input',
|
|
705
|
-
default: '0',
|
|
706
|
-
description: '',
|
|
707
|
-
},
|
|
708
|
-
padding: {
|
|
709
|
-
title: '内边距',
|
|
710
|
-
type: 'input',
|
|
711
|
-
default: '0',
|
|
712
|
-
description: '',
|
|
713
|
-
},
|
|
714
|
-
quantity: {
|
|
715
|
-
type: 'select',
|
|
716
|
-
default: 'px',
|
|
717
|
-
options: [
|
|
718
|
-
{ label: 'px', value: 'px' },
|
|
719
|
-
{ label: 'rem', value: 'rem' },
|
|
720
|
-
{ label: 'em', value: 'em' },
|
|
721
|
-
{ label: '%', value: '%' },
|
|
722
|
-
],
|
|
723
|
-
title: '单位类型',
|
|
724
|
-
},
|
|
725
|
-
},
|
|
726
|
-
propertyOrder: ['margin', 'padding', 'quantity'],
|
|
727
|
-
},
|
|
728
|
-
radio: {
|
|
729
|
-
type: 'radio',
|
|
730
|
-
title: '单选',
|
|
731
|
-
options: [
|
|
732
|
-
{ label: '选项a', value: 'a' },
|
|
733
|
-
{ label: '选项b', value: 'b' },
|
|
734
|
-
{ label: '选项c', value: 'c' },
|
|
735
|
-
],
|
|
736
|
-
default: 'a',
|
|
737
|
-
description: '',
|
|
738
|
-
},
|
|
739
|
-
select: {
|
|
740
|
-
type: 'select',
|
|
741
|
-
title: '下拉选择',
|
|
742
|
-
options: [
|
|
743
|
-
{ label: '选项a', value: 'a' },
|
|
744
|
-
{ label: '选项b', value: 'b' },
|
|
745
|
-
{ label: '选项c', value: 'c' },
|
|
746
|
-
],
|
|
747
|
-
default: 'a',
|
|
748
|
-
description: '',
|
|
749
|
-
},
|
|
750
|
-
cascader: {
|
|
751
|
-
type: 'cascader',
|
|
752
|
-
title: '级联选择',
|
|
753
|
-
options: [
|
|
754
|
-
{
|
|
755
|
-
value: 'zhejiang',
|
|
756
|
-
label: 'Zhejiang',
|
|
757
|
-
children: [
|
|
758
|
-
{
|
|
759
|
-
value: 'hangzhou',
|
|
760
|
-
label: 'Hangzhou',
|
|
761
|
-
children: [{ value: 'xihu', label: 'West Lake' }],
|
|
762
|
-
},
|
|
763
|
-
],
|
|
764
|
-
},
|
|
765
|
-
{
|
|
766
|
-
value: 'jiangsu',
|
|
767
|
-
label: 'Jiangsu',
|
|
768
|
-
children: [
|
|
769
|
-
{
|
|
770
|
-
value: 'nanjing',
|
|
771
|
-
label: 'Nanjing',
|
|
772
|
-
children: [{ value: 'zhonghuamen', label: 'Zhong Hua Men' }],
|
|
773
|
-
},
|
|
774
|
-
],
|
|
775
|
-
},
|
|
776
|
-
],
|
|
777
|
-
default: 'a',
|
|
778
|
-
description: '',
|
|
779
|
-
showSearch: !0,
|
|
780
|
-
allowClear: !0,
|
|
781
|
-
},
|
|
782
|
-
checkboxes: {
|
|
783
|
-
type: 'checkboxes',
|
|
784
|
-
title: '多选',
|
|
785
|
-
options: [
|
|
786
|
-
{ label: '选项a', value: 'a' },
|
|
787
|
-
{ label: '选项b', value: 'b' },
|
|
788
|
-
{ label: '选项c', value: 'c' },
|
|
789
|
-
],
|
|
790
|
-
default: ['a'],
|
|
791
|
-
description: '',
|
|
792
|
-
},
|
|
793
|
-
'dynamic-data': {
|
|
794
|
-
type: 'dynamic-data',
|
|
795
|
-
title: '动态数据源',
|
|
796
|
-
isContainer: !1,
|
|
797
|
-
properties: {
|
|
798
|
-
type: {
|
|
799
|
-
default: 'local',
|
|
800
|
-
type: 'select',
|
|
801
|
-
options: [
|
|
802
|
-
{ label: '本地数据', value: 'local' },
|
|
803
|
-
{ label: '接口数据', value: 'remote' },
|
|
804
|
-
],
|
|
805
|
-
title: '数据类型',
|
|
806
|
-
},
|
|
807
|
-
config: {
|
|
808
|
-
title: '接口配置',
|
|
809
|
-
type: 'object',
|
|
810
|
-
description: '用于存放接口的配置数据(url、请求参数等)',
|
|
811
|
-
isRequired: !0,
|
|
812
|
-
properties: {
|
|
813
|
-
dataName: {
|
|
814
|
-
default: 'local',
|
|
815
|
-
type: 'select',
|
|
816
|
-
options: [
|
|
817
|
-
{ label: '本地数据', value: 'local' },
|
|
818
|
-
{ label: '接口数据', value: 'remote' },
|
|
819
|
-
],
|
|
820
|
-
title: '数据类型',
|
|
821
|
-
},
|
|
822
|
-
body: {
|
|
823
|
-
type: 'object',
|
|
824
|
-
title: '请求参数配置',
|
|
825
|
-
description: '用于配置当前接口的请求参数数值',
|
|
826
|
-
isRequired: !0,
|
|
827
|
-
},
|
|
828
|
-
filter: {
|
|
829
|
-
title: '过滤器函数体',
|
|
830
|
-
type: 'codearea',
|
|
831
|
-
default: 'return data;',
|
|
832
|
-
description: '用于定义过滤接口数据',
|
|
833
|
-
isRequired: !0,
|
|
834
|
-
},
|
|
835
|
-
},
|
|
836
|
-
propertyOrder: ['dataName', 'body', 'filter'],
|
|
837
|
-
},
|
|
838
|
-
data: {
|
|
839
|
-
title: '数据内容',
|
|
840
|
-
type: 'json',
|
|
841
|
-
default: '{}',
|
|
842
|
-
description: '用于存放DynamicData的数据内容',
|
|
843
|
-
isRequired: !0,
|
|
844
|
-
},
|
|
845
|
-
localFilter: {
|
|
846
|
-
title: '过滤器',
|
|
847
|
-
type: 'codearea',
|
|
848
|
-
default: 'return data;',
|
|
849
|
-
description: '用于定义过滤本地数据',
|
|
850
|
-
isRequired: !0,
|
|
851
|
-
},
|
|
852
|
-
},
|
|
853
|
-
propertyOrder: ['type', 'config', 'data', 'localFilter'],
|
|
854
|
-
},
|
|
855
|
-
datasource: h,
|
|
856
|
-
event: g,
|
|
857
|
-
'dynamic-config': {
|
|
858
|
-
type: 'dynamic-config',
|
|
859
|
-
title: '动态配置',
|
|
860
|
-
description: '',
|
|
861
|
-
isContainer: !1,
|
|
862
|
-
properties: {
|
|
863
|
-
type: {
|
|
864
|
-
type: 'select',
|
|
865
|
-
title: '数据来源',
|
|
866
|
-
options: [
|
|
867
|
-
{ label: '模板直接设置', value: 'DevDefaults' },
|
|
868
|
-
{ label: 'mp后台配置', value: 'ContentStaticConfig' },
|
|
869
|
-
{ label: '内容Meta数据', value: 'Content' },
|
|
870
|
-
{ label: '全局配置数据', value: 'RuntimeConst' },
|
|
871
|
-
{ label: '资源中心配置', value: 'ResourceCenter' },
|
|
872
|
-
],
|
|
873
|
-
default: 'DevDefaults',
|
|
874
|
-
isConditionProp: !0,
|
|
875
|
-
description:
|
|
876
|
-
'目前支持的数据来源包括: 1)模版直接设置:在模版配置直接生效,支持直接输入或图片上传。 2)mp后台配置:选择mp后台配置后,属性会出现在mp后台中,支持属性描述的输入。 3)内容meta数据:支持内容meta数据的获取,页面meta数据。 4)全局配置数据:目前支持的全局配置包括:全局Tab配置及主题包配置。相关属性会挂载至:window.globalConst',
|
|
877
|
-
},
|
|
878
|
-
value: {
|
|
879
|
-
title: '数据值',
|
|
880
|
-
type: 'input',
|
|
881
|
-
default: '',
|
|
882
|
-
description: '',
|
|
883
|
-
placeholder: '',
|
|
884
|
-
onShow:
|
|
885
|
-
'type === "DevDefaults" || type === "Content" || type === "RuntimeConst"',
|
|
886
|
-
},
|
|
887
|
-
description: {
|
|
888
|
-
title: '属性名称',
|
|
889
|
-
type: 'input',
|
|
890
|
-
default: '',
|
|
891
|
-
description: '',
|
|
892
|
-
placeholder: '',
|
|
893
|
-
onShow:
|
|
894
|
-
'type === "ContentStaticConfig" || type === "ResourceCenter"',
|
|
895
|
-
},
|
|
896
|
-
valueType: {
|
|
897
|
-
type: 'radio',
|
|
898
|
-
title: '配置方式',
|
|
899
|
-
options: [
|
|
900
|
-
{ label: '填写', value: 'string' },
|
|
901
|
-
{ label: '选择', value: 'select' },
|
|
902
|
-
],
|
|
903
|
-
default: 'string',
|
|
904
|
-
isConditionProp: !0,
|
|
905
|
-
description: '',
|
|
906
|
-
onShow:
|
|
907
|
-
'type === "ContentStaticConfig" || type === "ResourceCenter"',
|
|
908
|
-
},
|
|
909
|
-
range: {
|
|
910
|
-
type: 'select',
|
|
911
|
-
title: '可选项',
|
|
912
|
-
multiple: !0,
|
|
913
|
-
options: [],
|
|
914
|
-
onShow:
|
|
915
|
-
'(type === "ContentStaticConfig" || type === "ResourceCenter") && valueType === "select"',
|
|
916
|
-
description: '这里会使用value中的配置选项作为options',
|
|
917
|
-
},
|
|
918
|
-
},
|
|
919
|
-
propertyOrder: ['type', 'value', 'description', 'valueType', 'range'],
|
|
920
|
-
showCodeViewBtn: !1,
|
|
921
|
-
},
|
|
922
|
-
'sohu-source': {
|
|
923
|
-
type: 'sohu-source',
|
|
924
|
-
title: '组件动态数据',
|
|
925
|
-
description: '',
|
|
926
|
-
isContainer: !1,
|
|
927
|
-
properties: {
|
|
928
|
-
mainConfig: {
|
|
929
|
-
type: 'object',
|
|
930
|
-
title: '主要配置',
|
|
931
|
-
description: '',
|
|
932
|
-
isContainer: !1,
|
|
933
|
-
properties: {
|
|
934
|
-
type: {
|
|
935
|
-
type: 'select',
|
|
936
|
-
title: '数据来源',
|
|
937
|
-
isConditionProp: !0,
|
|
938
|
-
options: [
|
|
939
|
-
{ label: '模板直接配置', value: 'RuntimeDataSelfDefine' },
|
|
940
|
-
{ label: 'mp后台配置', value: 'ContentStaticConfig' },
|
|
941
|
-
{
|
|
942
|
-
label: '请求当前页面数据',
|
|
943
|
-
value: 'RuntimeDataSelfContent',
|
|
944
|
-
},
|
|
945
|
-
{ label: '资源中心配置', value: 'ResourceCenter' },
|
|
946
|
-
],
|
|
947
|
-
default: 'ContentStaticConfig',
|
|
948
|
-
description: '',
|
|
949
|
-
},
|
|
950
|
-
description: {
|
|
951
|
-
title: '数据源名称',
|
|
952
|
-
type: 'input',
|
|
953
|
-
default: '',
|
|
954
|
-
description: '',
|
|
955
|
-
placeholder: '',
|
|
956
|
-
onShow: 'type === "ContentStaticConfig"',
|
|
957
|
-
},
|
|
958
|
-
dataType: {
|
|
959
|
-
type: 'radio',
|
|
960
|
-
title: '请求方式',
|
|
961
|
-
options: [
|
|
962
|
-
{ label: '批量请求', value: 'FROMCIS' },
|
|
963
|
-
{ label: '组件内部请求', value: 'FROMCOMPCIS' },
|
|
964
|
-
{ label: '不请求', value: 'false' },
|
|
965
|
-
],
|
|
966
|
-
description: '',
|
|
967
|
-
},
|
|
968
|
-
CONTENTID: {
|
|
969
|
-
title: '数据源ID',
|
|
970
|
-
type: 'input',
|
|
971
|
-
default: '',
|
|
972
|
-
description: '',
|
|
973
|
-
placeholder: '',
|
|
974
|
-
onShow: 'type === "RuntimeDataSelfDefine"',
|
|
975
|
-
},
|
|
976
|
-
CONTENTTYPE: {
|
|
977
|
-
type: 'select',
|
|
978
|
-
title: '数据源类型',
|
|
979
|
-
options: [
|
|
980
|
-
{ label: 'channel', value: 'channel' },
|
|
981
|
-
{ label: 'topic', value: 'topic' },
|
|
982
|
-
{ label: 'block', value: 'block' },
|
|
983
|
-
],
|
|
984
|
-
description: '',
|
|
985
|
-
onShow: 'type === "RuntimeDataSelfDefine"',
|
|
986
|
-
},
|
|
987
|
-
},
|
|
988
|
-
propertyOrder: [
|
|
989
|
-
'type',
|
|
990
|
-
'description',
|
|
991
|
-
'dataType',
|
|
992
|
-
'CONTENTID',
|
|
993
|
-
'CONTENTTYPE',
|
|
994
|
-
],
|
|
995
|
-
showCodeViewBtn: !1,
|
|
996
|
-
},
|
|
997
|
-
outConfig: {
|
|
998
|
-
type: 'object',
|
|
999
|
-
title: '出流配置',
|
|
1000
|
-
description: '',
|
|
1001
|
-
isContainer: !1,
|
|
1002
|
-
properties: {
|
|
1003
|
-
PRO: {
|
|
1004
|
-
type: 'select',
|
|
1005
|
-
title: '内容类型',
|
|
1006
|
-
options: [
|
|
1007
|
-
{ label: '置顶+加精', value: '4' },
|
|
1008
|
-
{ label: '长效置顶', value: '5' },
|
|
1009
|
-
],
|
|
1010
|
-
description: '',
|
|
1011
|
-
},
|
|
1012
|
-
FEEDTYPE: {
|
|
1013
|
-
type: 'select',
|
|
1014
|
-
title: '排序类型',
|
|
1015
|
-
options: [
|
|
1016
|
-
{ label: '综合', value: 'XTOPIC_SYNTHETICAL' },
|
|
1017
|
-
{ label: '最新', value: 'XTOPIC_LATEST' },
|
|
1018
|
-
{ label: '相关', value: 'XTOPIC_RELATED' },
|
|
1019
|
-
],
|
|
1020
|
-
description: '',
|
|
1021
|
-
},
|
|
1022
|
-
VIEW: {
|
|
1023
|
-
type: 'select',
|
|
1024
|
-
title: '数据裁剪',
|
|
1025
|
-
options: [
|
|
1026
|
-
{ label: '相关推荐模式', value: 'articleFeedMode' },
|
|
1027
|
-
{ label: '文字链裁剪方式', value: 'textMode' },
|
|
1028
|
-
{ label: '短内容摘录方式', value: 'excerptMode' },
|
|
1029
|
-
{
|
|
1030
|
-
label: '互动(点赞/评论)裁剪方式',
|
|
1031
|
-
value: 'interactMode',
|
|
1032
|
-
},
|
|
1033
|
-
{ label: '评论文字链裁剪方式', value: 'commentTextMode' },
|
|
1034
|
-
{
|
|
1035
|
-
label: '摘录方式(无点赞)',
|
|
1036
|
-
value: 'excerptCommentMode',
|
|
1037
|
-
},
|
|
1038
|
-
{ label: '无限流卡片模式', value: 'dynamicFeedMode' },
|
|
1039
|
-
{ label: '时间线模式', value: 'timeLineMode' },
|
|
1040
|
-
{ label: '复合内容流模式', value: 'multiFeedMode' },
|
|
1041
|
-
{ label: '搜狐号推荐模式', value: 'recommendFeedMode' },
|
|
1042
|
-
{ label: '作者页内容流模式', value: 'operateFeedMode' },
|
|
1043
|
-
{ label: '标签内容流模式', value: 'tagsFeedMode' },
|
|
1044
|
-
{ label: '评论链裁剪方式', value: 'commentMode' },
|
|
1045
|
-
{ label: '标签摘录方式', value: 'excerptTagsMode' },
|
|
1046
|
-
{ label: '内容流模式', value: 'feedMode' },
|
|
1047
|
-
],
|
|
1048
|
-
description: '',
|
|
1049
|
-
},
|
|
1050
|
-
CONTENTCONTEXT: {
|
|
1051
|
-
type: 'select',
|
|
1052
|
-
title: 'mKey参数',
|
|
1053
|
-
options: [
|
|
1054
|
-
{
|
|
1055
|
-
label: '作者ID+栏目ID',
|
|
1056
|
-
value: 'authorColumnId_${#authorColumnId}',
|
|
1057
|
-
},
|
|
1058
|
-
{
|
|
1059
|
-
label: '账号ID',
|
|
1060
|
-
value: 'accountId_${#contentData_account_id}',
|
|
1061
|
-
},
|
|
1062
|
-
{ label: 'mkeyID', value: 'mid_${#mkeyConst_mid}' },
|
|
1063
|
-
{ label: 'mkey名称', value: 'mname_${#mkeyConst_mname}' },
|
|
1064
|
-
{
|
|
1065
|
-
label: '城市Code码',
|
|
1066
|
-
value: 'cityCode_${#cityInfo_cityCode}',
|
|
1067
|
-
},
|
|
1068
|
-
{
|
|
1069
|
-
label: '城市名称',
|
|
1070
|
-
value: 'cityName_${#cityInfo_cityName}',
|
|
1071
|
-
},
|
|
1072
|
-
{
|
|
1073
|
-
label: '焦点城市Code码',
|
|
1074
|
-
value: 'focusCityCode_${#focusCityInfo_cityCode}',
|
|
1075
|
-
},
|
|
1076
|
-
],
|
|
1077
|
-
description: '',
|
|
1078
|
-
},
|
|
1079
|
-
CONTENTPARAMS: {
|
|
1080
|
-
title: '动态参数',
|
|
1081
|
-
type: 'json',
|
|
1082
|
-
default: '{}',
|
|
1083
|
-
description: '请填写JSON格式的参数',
|
|
1084
|
-
placeholder: '',
|
|
1085
|
-
},
|
|
1086
|
-
},
|
|
1087
|
-
propertyOrder: [
|
|
1088
|
-
'PRO',
|
|
1089
|
-
'FEEDTYPE',
|
|
1090
|
-
'VIEW',
|
|
1091
|
-
'CONTENTCONTEXT',
|
|
1092
|
-
'CONTENTPARAMS',
|
|
1093
|
-
],
|
|
1094
|
-
showCodeViewBtn: !1,
|
|
1095
|
-
},
|
|
1096
|
-
otherConfig: {
|
|
1097
|
-
type: 'object',
|
|
1098
|
-
title: '选配内容',
|
|
1099
|
-
description: '',
|
|
1100
|
-
isContainer: !1,
|
|
1101
|
-
properties: {
|
|
1102
|
-
SIZE: {
|
|
1103
|
-
type: 'number',
|
|
1104
|
-
title: '容量',
|
|
1105
|
-
default: 1,
|
|
1106
|
-
minimum: 0,
|
|
1107
|
-
maximum: 1e3,
|
|
1108
|
-
description: '',
|
|
1109
|
-
},
|
|
1110
|
-
TITLE: {
|
|
1111
|
-
title: '标题',
|
|
1112
|
-
type: 'input',
|
|
1113
|
-
default: '',
|
|
1114
|
-
description: '',
|
|
1115
|
-
placeholder: '',
|
|
1116
|
-
},
|
|
1117
|
-
CODE: {
|
|
1118
|
-
title: 'Code参数',
|
|
1119
|
-
type: 'input',
|
|
1120
|
-
default: '',
|
|
1121
|
-
description: '',
|
|
1122
|
-
placeholder: '',
|
|
1123
|
-
},
|
|
1124
|
-
URL: {
|
|
1125
|
-
type: 'url',
|
|
1126
|
-
title: '跳转链接',
|
|
1127
|
-
default: '',
|
|
1128
|
-
description: '',
|
|
1129
|
-
placeholder: '',
|
|
1130
|
-
},
|
|
1131
|
-
},
|
|
1132
|
-
propertyOrder: ['SIZE', 'TITLE', 'URL', 'CODE'],
|
|
1133
|
-
showCodeViewBtn: !1,
|
|
1134
|
-
},
|
|
1135
|
-
},
|
|
1136
|
-
propertyOrder: ['mainConfig', 'otherConfig', 'outConfig'],
|
|
1137
|
-
showCodeViewBtn: !1,
|
|
1138
|
-
},
|
|
1139
|
-
'sohu-event': {
|
|
1140
|
-
type: 'sohu-event',
|
|
1141
|
-
title: 'sohu组件事件',
|
|
1142
|
-
showCodeViewBtn: !1,
|
|
1143
|
-
isContainer: !1,
|
|
1144
|
-
properties: {
|
|
1145
|
-
globalEventMap: {
|
|
1146
|
-
type: 'object',
|
|
1147
|
-
title: '全局事件Map',
|
|
1148
|
-
description: '',
|
|
1149
|
-
properties: {
|
|
1150
|
-
eventCode: {
|
|
1151
|
-
type: 'input',
|
|
1152
|
-
title: '事件名称',
|
|
1153
|
-
default: '',
|
|
1154
|
-
description: '',
|
|
1155
|
-
placeholder: '',
|
|
1156
|
-
readOnly: !0,
|
|
1157
|
-
},
|
|
1158
|
-
},
|
|
1159
|
-
propertyOrder: ['eventCode'],
|
|
1160
|
-
showCodeViewBtn: !1,
|
|
1161
|
-
},
|
|
1162
|
-
event: {
|
|
1163
|
-
type: 'array',
|
|
1164
|
-
title: '监听事件',
|
|
1165
|
-
description: '当前组件监听事件列表',
|
|
1166
|
-
default: [],
|
|
1167
|
-
items: {
|
|
1168
|
-
type: 'object',
|
|
1169
|
-
title: '数组项',
|
|
1170
|
-
description: '',
|
|
1171
|
-
properties: {
|
|
1172
|
-
name: {
|
|
1173
|
-
type: 'input',
|
|
1174
|
-
title: '事件',
|
|
1175
|
-
default: '',
|
|
1176
|
-
description: '',
|
|
1177
|
-
placeholder: '',
|
|
1178
|
-
},
|
|
1179
|
-
code: {
|
|
1180
|
-
title: '事件code',
|
|
1181
|
-
type: 'input',
|
|
1182
|
-
default: '',
|
|
1183
|
-
description: '',
|
|
1184
|
-
placeholder: '',
|
|
1185
|
-
},
|
|
1186
|
-
listenName: {
|
|
1187
|
-
title: '事件名称',
|
|
1188
|
-
type: 'input',
|
|
1189
|
-
default: '',
|
|
1190
|
-
description: '',
|
|
1191
|
-
placeholder: '',
|
|
1192
|
-
},
|
|
1193
|
-
desc: {
|
|
1194
|
-
title: '事件描述',
|
|
1195
|
-
type: 'input',
|
|
1196
|
-
default: '',
|
|
1197
|
-
description: '',
|
|
1198
|
-
placeholder: '',
|
|
1199
|
-
},
|
|
1200
|
-
},
|
|
1201
|
-
propertyOrder: ['name', 'code', 'listenName', 'desc'],
|
|
1202
|
-
},
|
|
1203
|
-
showCodeViewBtn: !1,
|
|
1204
|
-
},
|
|
1205
|
-
},
|
|
1206
|
-
propertyOrder: ['globalEventMap', 'event'],
|
|
1207
|
-
},
|
|
1208
|
-
'sohu-ad': {
|
|
1209
|
-
type: 'object',
|
|
1210
|
-
title: '广告配置',
|
|
1211
|
-
description: '',
|
|
1212
|
-
properties: {
|
|
1213
|
-
type: {
|
|
1214
|
-
type: 'select',
|
|
1215
|
-
title: '数据源类型',
|
|
1216
|
-
isConditionProp: !0,
|
|
1217
|
-
options: [
|
|
1218
|
-
{ label: '模板直接设置', value: 'DevDefaults' },
|
|
1219
|
-
{ label: '资源中心配置', value: 'ResourceCenter' },
|
|
1220
|
-
],
|
|
1221
|
-
description: '',
|
|
1222
|
-
},
|
|
1223
|
-
value: {
|
|
1224
|
-
type: 'object',
|
|
1225
|
-
title: '广告规则',
|
|
1226
|
-
description: '',
|
|
1227
|
-
onShow: 'type === "DevDefaults"',
|
|
1228
|
-
properties: {
|
|
1229
|
-
id: {
|
|
1230
|
-
title: '广告ID',
|
|
1231
|
-
type: 'number',
|
|
1232
|
-
default: '',
|
|
1233
|
-
description: '',
|
|
1234
|
-
placeholder: '',
|
|
1235
|
-
},
|
|
1236
|
-
rule: {
|
|
1237
|
-
type: 'radio',
|
|
1238
|
-
title: '规则类型',
|
|
1239
|
-
isConditionProp: !0,
|
|
1240
|
-
options: [
|
|
1241
|
-
{ label: '固定位置', value: 1 },
|
|
1242
|
-
{ label: '隔几出几', value: 2 },
|
|
1243
|
-
{ label: '固定位置隔几出几', value: 3 },
|
|
1244
|
-
],
|
|
1245
|
-
default: 1,
|
|
1246
|
-
description: '',
|
|
1247
|
-
},
|
|
1248
|
-
fixArray: {
|
|
1249
|
-
type: 'select',
|
|
1250
|
-
title: '固定位置',
|
|
1251
|
-
default: [1],
|
|
1252
|
-
description: '',
|
|
1253
|
-
multiple: !0,
|
|
1254
|
-
onShow: 'rule === 1 || rule === 3',
|
|
1255
|
-
options: [
|
|
1256
|
-
{ label: '1', value: 1 },
|
|
1257
|
-
{ label: '2', value: 2 },
|
|
1258
|
-
{ label: '3', value: 3 },
|
|
1259
|
-
{ label: '4', value: 4 },
|
|
1260
|
-
{ label: '5', value: 5 },
|
|
1261
|
-
{ label: '6', value: 6 },
|
|
1262
|
-
{ label: '7', value: 7 },
|
|
1263
|
-
{ label: '8', value: 8 },
|
|
1264
|
-
{ label: '9', value: 9 },
|
|
1265
|
-
{ label: '10', value: 10 },
|
|
1266
|
-
{ label: '11', value: 11 },
|
|
1267
|
-
{ label: '12', value: 12 },
|
|
1268
|
-
{ label: '13', value: 13 },
|
|
1269
|
-
{ label: '14', value: 14 },
|
|
1270
|
-
{ label: '15', value: 15 },
|
|
1271
|
-
{ label: '16', value: 16 },
|
|
1272
|
-
{ label: '17', value: 17 },
|
|
1273
|
-
{ label: '18', value: 18 },
|
|
1274
|
-
{ label: '19', value: 19 },
|
|
1275
|
-
{ label: '20', value: 20 },
|
|
1276
|
-
{ label: '21', value: 21 },
|
|
1277
|
-
{ label: '22', value: 22 },
|
|
1278
|
-
{ label: '23', value: 23 },
|
|
1279
|
-
{ label: '24', value: 24 },
|
|
1280
|
-
{ label: '25', value: 25 },
|
|
1281
|
-
{ label: '26', value: 26 },
|
|
1282
|
-
{ label: '27', value: 27 },
|
|
1283
|
-
{ label: '28', value: 28 },
|
|
1284
|
-
{ label: '29', value: 29 },
|
|
1285
|
-
{ label: '30', value: 30 },
|
|
1286
|
-
{ label: '31', value: 31 },
|
|
1287
|
-
{ label: '32', value: 32 },
|
|
1288
|
-
{ label: '33', value: 33 },
|
|
1289
|
-
{ label: '34', value: 34 },
|
|
1290
|
-
{ label: '35', value: 35 },
|
|
1291
|
-
{ label: '36', value: 36 },
|
|
1292
|
-
{ label: '37', value: 37 },
|
|
1293
|
-
{ label: '38', value: 38 },
|
|
1294
|
-
{ label: '39', value: 39 },
|
|
1295
|
-
{ label: '40', value: 40 },
|
|
1296
|
-
{ label: '41', value: 41 },
|
|
1297
|
-
{ label: '42', value: 42 },
|
|
1298
|
-
{ label: '43', value: 43 },
|
|
1299
|
-
{ label: '44', value: 44 },
|
|
1300
|
-
{ label: '45', value: 45 },
|
|
1301
|
-
{ label: '46', value: 46 },
|
|
1302
|
-
{ label: '47', value: 47 },
|
|
1303
|
-
{ label: '48', value: 48 },
|
|
1304
|
-
{ label: '49', value: 49 },
|
|
1305
|
-
{ label: '50', value: 50 },
|
|
1306
|
-
],
|
|
1307
|
-
},
|
|
1308
|
-
begin: {
|
|
1309
|
-
type: 'number',
|
|
1310
|
-
title: '开始位置',
|
|
1311
|
-
default: 1,
|
|
1312
|
-
minimum: '1',
|
|
1313
|
-
maximum: '50',
|
|
1314
|
-
description: '',
|
|
1315
|
-
onShow: 'rule === 2 || rule === 3',
|
|
1316
|
-
},
|
|
1317
|
-
turn: {
|
|
1318
|
-
type: 'number',
|
|
1319
|
-
title: '间隔/隔',
|
|
1320
|
-
default: 1,
|
|
1321
|
-
minimum: '1',
|
|
1322
|
-
maximum: '50',
|
|
1323
|
-
description: '',
|
|
1324
|
-
onShow: 'rule === 2 || rule === 3',
|
|
1325
|
-
},
|
|
1326
|
-
number: {
|
|
1327
|
-
type: 'number',
|
|
1328
|
-
title: '间隔/出',
|
|
1329
|
-
default: 1,
|
|
1330
|
-
minimum: '1',
|
|
1331
|
-
maximum: '50',
|
|
1332
|
-
description: '',
|
|
1333
|
-
onShow: 'rule === 2 || rule === 3',
|
|
1334
|
-
},
|
|
1335
|
-
mergeType: {
|
|
1336
|
-
type: 'radio',
|
|
1337
|
-
title: '插入规则',
|
|
1338
|
-
options: [
|
|
1339
|
-
{ label: '覆盖', value: 0 },
|
|
1340
|
-
{ label: '插入', value: 1 },
|
|
1341
|
-
],
|
|
1342
|
-
default: 0,
|
|
1343
|
-
description: '',
|
|
1344
|
-
},
|
|
1345
|
-
},
|
|
1346
|
-
propertyOrder: [
|
|
1347
|
-
'id',
|
|
1348
|
-
'rule',
|
|
1349
|
-
'fixArray',
|
|
1350
|
-
'begin',
|
|
1351
|
-
'turn',
|
|
1352
|
-
'number',
|
|
1353
|
-
'mergeType',
|
|
1354
|
-
],
|
|
1355
|
-
},
|
|
1356
|
-
range: {
|
|
1357
|
-
type: 'array',
|
|
1358
|
-
title: '广告规则列表',
|
|
1359
|
-
description: '',
|
|
1360
|
-
onShow: 'type === "ResourceCenter"',
|
|
1361
|
-
items: {
|
|
1362
|
-
type: 'object',
|
|
1363
|
-
title: '数组项',
|
|
1364
|
-
description: '',
|
|
1365
|
-
properties: {
|
|
1366
|
-
rule: {
|
|
1367
|
-
type: 'radio',
|
|
1368
|
-
title: '规则类型',
|
|
1369
|
-
isConditionProp: !0,
|
|
1370
|
-
options: [
|
|
1371
|
-
{ label: '固定位置', value: 1 },
|
|
1372
|
-
{ label: '隔几出几', value: 2 },
|
|
1373
|
-
{ label: '固定位置隔几出几', value: 3 },
|
|
1374
|
-
],
|
|
1375
|
-
default: 1,
|
|
1376
|
-
description: '',
|
|
1377
|
-
},
|
|
1378
|
-
fixArray: {
|
|
1379
|
-
type: 'select',
|
|
1380
|
-
title: '固定位置',
|
|
1381
|
-
default: [1],
|
|
1382
|
-
description: '',
|
|
1383
|
-
onShow: 'rule === 1 || rule === 3',
|
|
1384
|
-
multiple: !0,
|
|
1385
|
-
options: [
|
|
1386
|
-
{ label: '1', value: 1 },
|
|
1387
|
-
{ label: '2', value: 2 },
|
|
1388
|
-
{ label: '3', value: 3 },
|
|
1389
|
-
{ label: '4', value: 4 },
|
|
1390
|
-
{ label: '5', value: 5 },
|
|
1391
|
-
{ label: '6', value: 6 },
|
|
1392
|
-
{ label: '7', value: 7 },
|
|
1393
|
-
{ label: '8', value: 8 },
|
|
1394
|
-
{ label: '9', value: 9 },
|
|
1395
|
-
{ label: '10', value: 10 },
|
|
1396
|
-
{ label: '11', value: 11 },
|
|
1397
|
-
{ label: '12', value: 12 },
|
|
1398
|
-
{ label: '13', value: 13 },
|
|
1399
|
-
{ label: '14', value: 14 },
|
|
1400
|
-
{ label: '15', value: 15 },
|
|
1401
|
-
{ label: '16', value: 16 },
|
|
1402
|
-
{ label: '17', value: 17 },
|
|
1403
|
-
{ label: '18', value: 18 },
|
|
1404
|
-
{ label: '19', value: 19 },
|
|
1405
|
-
{ label: '20', value: 20 },
|
|
1406
|
-
{ label: '21', value: 21 },
|
|
1407
|
-
{ label: '22', value: 22 },
|
|
1408
|
-
{ label: '23', value: 23 },
|
|
1409
|
-
{ label: '24', value: 24 },
|
|
1410
|
-
{ label: '25', value: 25 },
|
|
1411
|
-
{ label: '26', value: 26 },
|
|
1412
|
-
{ label: '27', value: 27 },
|
|
1413
|
-
{ label: '28', value: 28 },
|
|
1414
|
-
{ label: '29', value: 29 },
|
|
1415
|
-
{ label: '30', value: 30 },
|
|
1416
|
-
{ label: '31', value: 31 },
|
|
1417
|
-
{ label: '32', value: 32 },
|
|
1418
|
-
{ label: '33', value: 33 },
|
|
1419
|
-
{ label: '34', value: 34 },
|
|
1420
|
-
{ label: '35', value: 35 },
|
|
1421
|
-
{ label: '36', value: 36 },
|
|
1422
|
-
{ label: '37', value: 37 },
|
|
1423
|
-
{ label: '38', value: 38 },
|
|
1424
|
-
{ label: '39', value: 39 },
|
|
1425
|
-
{ label: '40', value: 40 },
|
|
1426
|
-
{ label: '41', value: 41 },
|
|
1427
|
-
{ label: '42', value: 42 },
|
|
1428
|
-
{ label: '43', value: 43 },
|
|
1429
|
-
{ label: '44', value: 44 },
|
|
1430
|
-
{ label: '45', value: 45 },
|
|
1431
|
-
{ label: '46', value: 46 },
|
|
1432
|
-
{ label: '47', value: 47 },
|
|
1433
|
-
{ label: '48', value: 48 },
|
|
1434
|
-
{ label: '49', value: 49 },
|
|
1435
|
-
{ label: '50', value: 50 },
|
|
1436
|
-
],
|
|
1437
|
-
},
|
|
1438
|
-
begin: {
|
|
1439
|
-
type: 'number',
|
|
1440
|
-
title: '开始位置',
|
|
1441
|
-
default: 1,
|
|
1442
|
-
minimum: '1',
|
|
1443
|
-
maximum: '50',
|
|
1444
|
-
description: '',
|
|
1445
|
-
onShow: 'rule === 2 || rule === 3',
|
|
1446
|
-
},
|
|
1447
|
-
turn: {
|
|
1448
|
-
type: 'number',
|
|
1449
|
-
title: '间隔/隔',
|
|
1450
|
-
default: 1,
|
|
1451
|
-
minimum: '1',
|
|
1452
|
-
maximum: '50',
|
|
1453
|
-
description: '',
|
|
1454
|
-
onShow: 'rule === 2 || rule === 3',
|
|
1455
|
-
},
|
|
1456
|
-
number: {
|
|
1457
|
-
type: 'number',
|
|
1458
|
-
title: '间隔/出',
|
|
1459
|
-
default: 1,
|
|
1460
|
-
minimum: '1',
|
|
1461
|
-
maximum: '50',
|
|
1462
|
-
description: '',
|
|
1463
|
-
onShow: 'rule === 2 || rule === 3',
|
|
1464
|
-
},
|
|
1465
|
-
mergeType: {
|
|
1466
|
-
type: 'radio',
|
|
1467
|
-
title: '插入规则',
|
|
1468
|
-
options: [
|
|
1469
|
-
{ label: '覆盖', value: 0 },
|
|
1470
|
-
{ label: '插入', value: 1 },
|
|
1471
|
-
],
|
|
1472
|
-
default: 0,
|
|
1473
|
-
description: '',
|
|
1474
|
-
},
|
|
1475
|
-
},
|
|
1476
|
-
propertyOrder: [
|
|
1477
|
-
'rule',
|
|
1478
|
-
'fixArray',
|
|
1479
|
-
'begin',
|
|
1480
|
-
'turn',
|
|
1481
|
-
'number',
|
|
1482
|
-
'mergeType',
|
|
1483
|
-
],
|
|
1484
|
-
},
|
|
1485
|
-
},
|
|
1486
|
-
},
|
|
1487
|
-
propertyOrder: ['type', 'value', 'range'],
|
|
1488
|
-
},
|
|
1489
|
-
},
|
|
1490
|
-
x = {
|
|
1491
|
-
on: {
|
|
1492
|
-
type: 'event',
|
|
1493
|
-
title: '事件',
|
|
1494
|
-
isContainer: !1,
|
|
1495
|
-
properties: {
|
|
1496
|
-
type: {
|
|
1497
|
-
default: 'on',
|
|
1498
|
-
type: 'select',
|
|
1499
|
-
options: [
|
|
1500
|
-
{ label: 'on', value: 'on' },
|
|
1501
|
-
{ label: 'emit', value: 'emit' },
|
|
1502
|
-
],
|
|
1503
|
-
title: '事件类型',
|
|
1504
|
-
},
|
|
1505
|
-
register: {
|
|
1506
|
-
type: 'input',
|
|
1507
|
-
default: 'eventName',
|
|
1508
|
-
title: '注册事件',
|
|
1509
|
-
description: '用于输入注册事件的名称',
|
|
1510
|
-
placeholder: '请输入注册事件的名称',
|
|
1511
|
-
},
|
|
1512
|
-
actionFunc: {
|
|
1513
|
-
title: '执行函数',
|
|
1514
|
-
type: 'codearea',
|
|
1515
|
-
default: '() => {}',
|
|
1516
|
-
description: '',
|
|
1517
|
-
},
|
|
1518
|
-
},
|
|
1519
|
-
propertyOrder: ['type', 'register', 'actionFunc'],
|
|
1520
|
-
},
|
|
1521
|
-
emit: g,
|
|
1522
|
-
},
|
|
1523
|
-
S = { local: h, remote: j };
|
|
1524
|
-
function T(e) {
|
|
1525
|
-
return /^http[s]?:\/\/.*/.test(e);
|
|
1526
|
-
}
|
|
1527
|
-
function D(e) {
|
|
1528
|
-
return 'String' === Object.prototype.toString.call(e).slice(8, -1);
|
|
1529
|
-
}
|
|
1530
|
-
function N(e) {
|
|
1531
|
-
return (
|
|
1532
|
-
'number' == typeof e ||
|
|
1533
|
-
'[object Number]' === Object.prototype.toString.call(e)
|
|
1534
|
-
);
|
|
1535
|
-
}
|
|
1536
|
-
function w(e) {
|
|
1537
|
-
return 'Boolean' === Object.prototype.toString.call(e).slice(8, -1);
|
|
1538
|
-
}
|
|
1539
|
-
function R(e) {
|
|
1540
|
-
return /^\d{4}-\d{2}-\d{2}$/.test(e);
|
|
1541
|
-
}
|
|
1542
|
-
function q(e) {
|
|
1543
|
-
return (
|
|
1544
|
-
/^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}$/.test(e) ||
|
|
1545
|
-
/^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}$/.test(e)
|
|
1546
|
-
);
|
|
1547
|
-
}
|
|
1548
|
-
function E(e) {
|
|
1549
|
-
return /^\d{2}:\d{2}:\d{2}$/.test(e) || /^\d{2}:\d{2}$/.test(e);
|
|
1550
|
-
}
|
|
1551
|
-
function k(e) {
|
|
1552
|
-
var t = !1;
|
|
1553
|
-
return (
|
|
1554
|
-
'Array' === Object.prototype.toString.call(e).slice(8, -1) && (t = !0),
|
|
1555
|
-
t
|
|
1556
|
-
);
|
|
1557
|
-
}
|
|
1558
|
-
function F(e) {
|
|
1559
|
-
if (!k(e)) return !1;
|
|
1560
|
-
for (var t = 0, r = e.length; t < r; t++) if (!D(e[t])) return !1;
|
|
1561
|
-
return !0;
|
|
1562
|
-
}
|
|
1563
|
-
function P(e) {
|
|
1564
|
-
var t = !1;
|
|
1565
|
-
return (
|
|
1566
|
-
'Object' === Object.prototype.toString.call(e).slice(8, -1) && (t = !0),
|
|
1567
|
-
t
|
|
1568
|
-
);
|
|
1569
|
-
}
|
|
1570
|
-
function I(e) {
|
|
1571
|
-
var t = !1;
|
|
1572
|
-
return C.quantity.properties.quantity.enum.indexOf(e) >= 0 && (t = !0), t;
|
|
1573
|
-
}
|
|
1574
|
-
function M(e) {
|
|
1575
|
-
return /^#[0-9a-f]{6}$/.test(e) || /^#[0-9a-f]{3}$/.test(e);
|
|
1576
|
-
}
|
|
1577
|
-
function _(e) {
|
|
1578
|
-
var t = !1;
|
|
1579
|
-
return (
|
|
1580
|
-
'Function' === Object.prototype.toString.call(e).slice(8, -1) &&
|
|
1581
|
-
(t = !0),
|
|
1582
|
-
t
|
|
1583
|
-
);
|
|
1584
|
-
}
|
|
1585
|
-
function A(e) {
|
|
1586
|
-
var t;
|
|
1587
|
-
return (
|
|
1588
|
-
(t =
|
|
1589
|
-
e && P(e)
|
|
1590
|
-
? (function (e) {
|
|
1591
|
-
var t;
|
|
1592
|
-
if (P(e)) {
|
|
1593
|
-
var r = Object.keys(e);
|
|
1594
|
-
e.data && e.filter && 2 === r.length
|
|
1595
|
-
? (t = k(e.data) || P(e.data) ? o(S.local) : o(S.remote))
|
|
1596
|
-
: e.trigger && e.eventData && 2 === r.length
|
|
1597
|
-
? (t = o(x.emit))
|
|
1598
|
-
: e.register && e.actionFunc && 2 === r.length
|
|
1599
|
-
? (t = o(x.on))
|
|
1600
|
-
: e.quantity && I(e.quantity) && 2 === r.length
|
|
1601
|
-
? (t = o(C.quantity))
|
|
1602
|
-
: ((t = o(C['empty-object'])),
|
|
1603
|
-
Object.keys(e).map(function (r) {
|
|
1604
|
-
var a = e[r];
|
|
1605
|
-
t.properties[r] = A(a);
|
|
1606
|
-
}));
|
|
1607
|
-
}
|
|
1608
|
-
return t;
|
|
1609
|
-
})(e)
|
|
1610
|
-
: e && k(e)
|
|
1611
|
-
? (function (e) {
|
|
1612
|
-
var t;
|
|
1613
|
-
if (e && k(e))
|
|
1614
|
-
if (F(e)) {
|
|
1615
|
-
(t = o(C.select)).items.enum = e;
|
|
1616
|
-
var r = t.items.enumextra.length,
|
|
1617
|
-
a = e.length;
|
|
1618
|
-
if (a > r)
|
|
1619
|
-
for (var l = r, i = a; l < i; l++)
|
|
1620
|
-
t.items.enumextra.push('选项' + e(l));
|
|
1621
|
-
} else {
|
|
1622
|
-
t = o(C['empty-array']);
|
|
1623
|
-
var n = A(e[0]);
|
|
1624
|
-
t.items.properties = n.properties;
|
|
1625
|
-
}
|
|
1626
|
-
return t;
|
|
1627
|
-
})(e)
|
|
1628
|
-
: (function (e) {
|
|
1629
|
-
var t = '';
|
|
1630
|
-
if (w(e)) t = o(C.boolean);
|
|
1631
|
-
else if (N(e)) t = o(C.number);
|
|
1632
|
-
else if (T(e)) t = o(C.url);
|
|
1633
|
-
else if (R(e)) t = o(C.date);
|
|
1634
|
-
else if (q(e)) t = o(C['date-time']);
|
|
1635
|
-
else if (E(e)) t = o(C.time);
|
|
1636
|
-
else if (M(e)) t = o(C.color);
|
|
1637
|
-
else
|
|
1638
|
-
try {
|
|
1639
|
-
t = N(JSON.parse(e)) ? o(C.input) : o(C.json);
|
|
1640
|
-
} catch (r) {
|
|
1641
|
-
t = e && e.length > 30 ? o(C.textarea) : o(C.input);
|
|
1642
|
-
}
|
|
1643
|
-
return t;
|
|
1644
|
-
})(e)),
|
|
1645
|
-
t
|
|
1646
|
-
);
|
|
1647
|
-
}
|
|
1648
|
-
function L(e, t) {
|
|
1649
|
-
var r = t || {};
|
|
1650
|
-
return (
|
|
1651
|
-
P(e) &&
|
|
1652
|
-
'object' === getExpectType(e.type) &&
|
|
1653
|
-
e.properties &&
|
|
1654
|
-
(e.propertyOrder ? e.propertyOrder : Object.keys(e.properties)).map(
|
|
1655
|
-
function (t) {
|
|
1656
|
-
var a = e.properties[t];
|
|
1657
|
-
r = $(a, r);
|
|
1658
|
-
},
|
|
1659
|
-
),
|
|
1660
|
-
r
|
|
1661
|
-
);
|
|
1662
|
-
}
|
|
1663
|
-
function $(e, t) {
|
|
1664
|
-
var r = !t,
|
|
1665
|
-
a = t || {};
|
|
1666
|
-
if (e && '{}' !== JSON.stringify(e)) {
|
|
1667
|
-
var l = e.type;
|
|
1668
|
-
'object' === l || 'func' === l || 'style' === l || 'data' === l
|
|
1669
|
-
? (!r && a.object ? (a.object += 1) : r || (a.object = 1),
|
|
1670
|
-
(a = L(e, a)))
|
|
1671
|
-
: 'array' === l
|
|
1672
|
-
? (!r && a.array ? (a.array += 1) : r || (a.array = 1),
|
|
1673
|
-
(a = L((e = e.items), a)))
|
|
1674
|
-
: !r && a[l]
|
|
1675
|
-
? (a[l] += 1)
|
|
1676
|
-
: r || (a[l] = 1);
|
|
1677
|
-
}
|
|
1678
|
-
return a;
|
|
1679
|
-
}
|
|
1680
|
-
function B(e) {
|
|
1681
|
-
var t = o(e);
|
|
1682
|
-
if (
|
|
1683
|
-
(!t.title && t.description && (t.title = t.description),
|
|
1684
|
-
t.type || (t.type = t.format),
|
|
1685
|
-
('quantity' !== t.type &&
|
|
1686
|
-
'array' !== t.type &&
|
|
1687
|
-
'datasource' !== t.type &&
|
|
1688
|
-
'event' !== t.type &&
|
|
1689
|
-
'object' !== t.type) ||
|
|
1690
|
-
!p(t.default) ||
|
|
1691
|
-
delete t.default,
|
|
1692
|
-
'radio' === t.type &&
|
|
1693
|
-
((t.type = 'string'),
|
|
1694
|
-
t.enum &&
|
|
1695
|
-
t.enumextra &&
|
|
1696
|
-
((t.items = {
|
|
1697
|
-
type: 'string',
|
|
1698
|
-
enum: o(t.enum),
|
|
1699
|
-
enumextra: o(t.enumextra),
|
|
1700
|
-
}),
|
|
1701
|
-
delete t.enum,
|
|
1702
|
-
delete t.enumextra)),
|
|
1703
|
-
'quantity' === t.type)
|
|
1704
|
-
) {
|
|
1705
|
-
var r = t.properties,
|
|
1706
|
-
a = o(C.quantity);
|
|
1707
|
-
if (r.quantity && P(r.quantity) && r.quantity.default) {
|
|
1708
|
-
var l = r.quantity.default;
|
|
1709
|
-
a.properties.quantity.default = 'percent' === l ? '%' : l;
|
|
1710
|
-
}
|
|
1711
|
-
t = a;
|
|
1712
|
-
}
|
|
1713
|
-
if ('datasource' === t.type) {
|
|
1714
|
-
var i = t.properties,
|
|
1715
|
-
n = i.type && i.type.default,
|
|
1716
|
-
u = i.data && i.data.default,
|
|
1717
|
-
c = i.filter && i.filter.default;
|
|
1718
|
-
'local' === n
|
|
1719
|
-
? ((t = o(S.local)).properties.data.default = u ? o(u) : '{}')
|
|
1720
|
-
: ((t = o(S.remote)).properties.data.default = u
|
|
1721
|
-
? o(u)
|
|
1722
|
-
: 'http://xxx'),
|
|
1723
|
-
(t.properties.filter.default = c ? o(c) : '() => {}');
|
|
1724
|
-
}
|
|
1725
|
-
if ('event' === t.type) {
|
|
1726
|
-
var s = t.properties,
|
|
1727
|
-
d = s.type && s.type.default;
|
|
1728
|
-
if ('in' === d || 'on' === d) {
|
|
1729
|
-
var y = (s.filter && s.filter.default) || '() => {}';
|
|
1730
|
-
(t = o(x.on)),
|
|
1731
|
-
s.actionFunc &&
|
|
1732
|
-
P(s.actionFunc) &&
|
|
1733
|
-
(t.properties.actionFunc.default = s.actionFunc.default || o(y));
|
|
1734
|
-
} else {
|
|
1735
|
-
var f = (s.filter && s.filter.default) || '{}';
|
|
1736
|
-
(t = o(x.emit)),
|
|
1737
|
-
s.eventData &&
|
|
1738
|
-
P(s.eventData) &&
|
|
1739
|
-
(t.properties.eventData.default = s.eventData.default || o(f));
|
|
1740
|
-
}
|
|
1741
|
-
}
|
|
1742
|
-
return (
|
|
1743
|
-
t.properties &&
|
|
1744
|
-
(t.propertyOrder || (t.propertyOrder = Object.keys(t.properties)),
|
|
1745
|
-
t.propertyOrder.map(function (e) {
|
|
1746
|
-
t.properties[e] = V(t.properties[e]);
|
|
1747
|
-
})),
|
|
1748
|
-
t.items && (t.items = V(t.items)),
|
|
1749
|
-
t
|
|
1750
|
-
);
|
|
1751
|
-
}
|
|
1752
|
-
function V(e) {
|
|
1753
|
-
var t = o(e);
|
|
1754
|
-
return (
|
|
1755
|
-
t.required || delete t.required,
|
|
1756
|
-
t.type && t.type && (t.type = t.type),
|
|
1757
|
-
('quantity' !== t.type &&
|
|
1758
|
-
'array' !== t.type &&
|
|
1759
|
-
'datasource' !== t.type &&
|
|
1760
|
-
'event' !== t.type &&
|
|
1761
|
-
'object' !== t.type) ||
|
|
1762
|
-
!p(t.default) ||
|
|
1763
|
-
delete t.default,
|
|
1764
|
-
('radio' !== t.type &&
|
|
1765
|
-
'checkboxes' !== t.type &&
|
|
1766
|
-
'select' !== t.type) ||
|
|
1767
|
-
(t.items &&
|
|
1768
|
-
t.items.enum &&
|
|
1769
|
-
t.items.enumextra &&
|
|
1770
|
-
((t.options = []),
|
|
1771
|
-
t.items.enum.forEach(function (e, r) {
|
|
1772
|
-
t.options.push({ label: t.items.enumextra[r] || e, value: e });
|
|
1773
|
-
}),
|
|
1774
|
-
delete t.items)),
|
|
1775
|
-
t.properties &&
|
|
1776
|
-
(t.propertyOrder || (t.propertyOrder = Object.keys(t.properties)),
|
|
1777
|
-
t.propertyOrder.map(function (e) {
|
|
1778
|
-
t.properties[e] = V(t.properties[e]);
|
|
1779
|
-
})),
|
|
1780
|
-
'array' === t.type && t.items && (t.items = V(t.items)),
|
|
1781
|
-
t
|
|
1782
|
-
);
|
|
1783
|
-
}
|
|
1784
|
-
require('mobx');
|
|
1785
|
-
var J,
|
|
1786
|
-
K =
|
|
1787
|
-
(((J = {
|
|
1788
|
-
array: 'array',
|
|
1789
|
-
boolean: 'boolean',
|
|
1790
|
-
'box-style': 'object',
|
|
1791
|
-
'padding-margin': 'object',
|
|
1792
|
-
codearea: 'string',
|
|
1793
|
-
color: 'string',
|
|
1794
|
-
datasource: 'object',
|
|
1795
|
-
date: 'string',
|
|
1796
|
-
'date-time': 'string',
|
|
1797
|
-
'dynamic-data': 'object',
|
|
1798
|
-
event: 'object',
|
|
1799
|
-
'func-body': 'string',
|
|
1800
|
-
htmlarea: 'string',
|
|
1801
|
-
image: 'string',
|
|
1802
|
-
input: 'string',
|
|
1803
|
-
json: 'string',
|
|
1804
|
-
number: 'number',
|
|
1805
|
-
'input-image': 'string',
|
|
1806
|
-
object: 'object',
|
|
1807
|
-
quantity: 'object',
|
|
1808
|
-
radio: 'string',
|
|
1809
|
-
select: 'array',
|
|
1810
|
-
}).select = 'string'),
|
|
1811
|
-
(J.textarea = 'string'),
|
|
1812
|
-
(J['text-editor'] = 'string'),
|
|
1813
|
-
(J.time = 'string'),
|
|
1814
|
-
(J.url = 'string'),
|
|
1815
|
-
(J['dynamic-config'] = 'object'),
|
|
1816
|
-
(J['sohu-source'] = 'object'),
|
|
1817
|
-
(J['sohu-event'] = 'object'),
|
|
1818
|
-
J);
|
|
1819
|
-
function z(e) {
|
|
1820
|
-
return K[e] || e;
|
|
1821
|
-
}
|
|
1822
|
-
function U(e, t) {
|
|
1823
|
-
K[e]
|
|
1824
|
-
? console.warn('当前已经存在' + e + '(' + K[e] + '),暂时不支持覆盖。')
|
|
1825
|
-
: (K[e] = t);
|
|
1826
|
-
}
|
|
1827
|
-
function W(e) {
|
|
1828
|
-
var t = !0;
|
|
1829
|
-
if (!e) return t;
|
|
1830
|
-
var r = e.type;
|
|
1831
|
-
return (
|
|
1832
|
-
(('object' === r &&
|
|
1833
|
-
e.properties &&
|
|
1834
|
-
e.propertyOrder &&
|
|
1835
|
-
e.propertyOrder.length > 0) ||
|
|
1836
|
-
('array' === r &&
|
|
1837
|
-
e.items &&
|
|
1838
|
-
e.items.properties &&
|
|
1839
|
-
e.items.propertyOrder &&
|
|
1840
|
-
e.items.propertyOrder.length > 0) ||
|
|
1841
|
-
(e.type && 'array' !== e.type && 'object' !== e.type) ||
|
|
1842
|
-
e.type) &&
|
|
1843
|
-
(t = !1),
|
|
1844
|
-
t
|
|
1845
|
-
);
|
|
1846
|
-
}
|
|
1847
|
-
function X(e) {
|
|
1848
|
-
var t = !1,
|
|
1849
|
-
r = e.lastUpdateTime,
|
|
1850
|
-
a = new Date('2024-10-05T00:01:00.691Z').getTime();
|
|
1851
|
-
return r && new Date(r).getTime() >= a && (t = !0), t;
|
|
1852
|
-
}
|
|
1853
|
-
function Y(e) {
|
|
1854
|
-
var t = !1,
|
|
1855
|
-
r = z(e.type),
|
|
1856
|
-
a = void 0 === e.isContainer || e.isContainer;
|
|
1857
|
-
return 'object' === r && a && (t = !0), t;
|
|
1858
|
-
}
|
|
1859
|
-
function Z(e) {
|
|
1860
|
-
var t = !0;
|
|
1861
|
-
return (
|
|
1862
|
-
'object' === e.type && e.propertyOrder && e.properties
|
|
1863
|
-
? e.propertyOrder.map(function (r) {
|
|
1864
|
-
var a = e.properties[r];
|
|
1865
|
-
('object' === e.type && a.propertyOrder && a.properties) ||
|
|
1866
|
-
(t = !1);
|
|
1867
|
-
})
|
|
1868
|
-
: (t = !1),
|
|
1869
|
-
t
|
|
1870
|
-
);
|
|
1871
|
-
}
|
|
1872
|
-
function H(e, t) {
|
|
1873
|
-
var r = e.split('-'),
|
|
1874
|
-
a = t.split('-');
|
|
1875
|
-
return r.pop(), a.pop(), r.join('-') === a.join('-');
|
|
1876
|
-
}
|
|
1877
|
-
function Q(e, t) {
|
|
1878
|
-
for (
|
|
1879
|
-
var r = e.split('-'),
|
|
1880
|
-
a = t.split('-'),
|
|
1881
|
-
l = 'before',
|
|
1882
|
-
i = 0,
|
|
1883
|
-
n = (r.length > a.length ? a : r).length;
|
|
1884
|
-
i < n;
|
|
1885
|
-
i += 1
|
|
1886
|
-
)
|
|
1887
|
-
Number(r[i]) > Number(a[i]) && (l = 'after');
|
|
1888
|
-
return l;
|
|
1889
|
-
}
|
|
1890
|
-
function G(e) {
|
|
1891
|
-
var t = e.split('-');
|
|
1892
|
-
return t.pop(), t.join('-');
|
|
1893
|
-
}
|
|
1894
|
-
function ee(e) {
|
|
1895
|
-
var t = e.split('-'),
|
|
1896
|
-
r = t.pop(),
|
|
1897
|
-
a = Number(r) + 1;
|
|
1898
|
-
return t.push('' + a), t.join('-');
|
|
1899
|
-
}
|
|
1900
|
-
function te(e) {
|
|
1901
|
-
var t = e.split('-'),
|
|
1902
|
-
r = t.pop();
|
|
1903
|
-
return [t.join('-'), r];
|
|
1904
|
-
}
|
|
1905
|
-
function re(e) {
|
|
1906
|
-
var t = e.split('-'),
|
|
1907
|
-
r = t.pop();
|
|
1908
|
-
return t.push(Number(r) - 1), t.join('-');
|
|
1909
|
-
}
|
|
1910
|
-
function ae(e) {
|
|
1911
|
-
var t = e.split('-'),
|
|
1912
|
-
r = t.pop();
|
|
1913
|
-
return t.push(Number(r) + 1), t.join('-');
|
|
1914
|
-
}
|
|
1915
|
-
function le(e, t) {
|
|
1916
|
-
var r = '',
|
|
1917
|
-
a = !1;
|
|
1918
|
-
return (
|
|
1919
|
-
e.options && e.options[0] && ((r = e.options[0].value), (a = !0)),
|
|
1920
|
-
(t || e.multiple) && (r = a ? [r] : []),
|
|
1921
|
-
r
|
|
1922
|
-
);
|
|
1923
|
-
}
|
|
1924
|
-
function ie(e, t) {
|
|
1925
|
-
var r,
|
|
1926
|
-
a,
|
|
1927
|
-
l = '',
|
|
1928
|
-
i = t;
|
|
1929
|
-
p(i) &&
|
|
1930
|
-
p(e.default) &&
|
|
1931
|
-
(typeof i != typeof e.default ||
|
|
1932
|
-
((r = i), (a = e.default), P(r) + '-' + k(r) != P(a) + '-' + k(a))) &&
|
|
1933
|
-
(i = void 0);
|
|
1934
|
-
var n = p(i) ? i : e.default;
|
|
1935
|
-
switch (e.type) {
|
|
1936
|
-
case 'select':
|
|
1937
|
-
case 'radio':
|
|
1938
|
-
l = n || le(e);
|
|
1939
|
-
break;
|
|
1940
|
-
case 'checkboxes':
|
|
1941
|
-
l = n || le(e, !0);
|
|
1942
|
-
break;
|
|
1943
|
-
case 'color':
|
|
1944
|
-
('#fff' !== n && '#FFF' !== n) || (n = '#ffffff'),
|
|
1945
|
-
(l = p(n) ? n : '#ffffff');
|
|
1946
|
-
break;
|
|
1947
|
-
case 'boolean':
|
|
1948
|
-
l = !!p(n) && n;
|
|
1949
|
-
break;
|
|
1950
|
-
case 'number':
|
|
1951
|
-
l = p(n) ? n : void 0;
|
|
1952
|
-
break;
|
|
1953
|
-
case 'json':
|
|
1954
|
-
var o = '';
|
|
1955
|
-
if (P(n) || k(n)) o = n;
|
|
1956
|
-
else if (_(n) || '' === n) o = {};
|
|
1957
|
-
else
|
|
1958
|
-
try {
|
|
1959
|
-
o = JSON.parse(n);
|
|
1960
|
-
} catch (e) {
|
|
1961
|
-
o = {};
|
|
1962
|
-
}
|
|
1963
|
-
l = o;
|
|
1964
|
-
break;
|
|
1965
|
-
default:
|
|
1966
|
-
l =
|
|
1967
|
-
'input' === e.type && '0' === e.default
|
|
1968
|
-
? n || e.default
|
|
1969
|
-
: p(n)
|
|
1970
|
-
? n
|
|
1971
|
-
: void 0;
|
|
1972
|
-
}
|
|
1973
|
-
return l;
|
|
1974
|
-
}
|
|
1975
|
-
function ne(e, t) {
|
|
1976
|
-
var r = {},
|
|
1977
|
-
a = e.type;
|
|
1978
|
-
if (P(e) && 'object' === z(e.type)) {
|
|
1979
|
-
var l = e,
|
|
1980
|
-
i = t;
|
|
1981
|
-
p(i) &&
|
|
1982
|
-
((p(l.default) && typeof i != typeof e.default) || !P(i)) &&
|
|
1983
|
-
(i = void 0);
|
|
1984
|
-
var n = p(i) ? i : l.default;
|
|
1985
|
-
'dynamic-data' === a
|
|
1986
|
-
? ((r = o(O)),
|
|
1987
|
-
n &&
|
|
1988
|
-
P(n) &&
|
|
1989
|
-
'{}' !== JSON.stringify(n) &&
|
|
1990
|
-
(r = Object.assign(r, n)))
|
|
1991
|
-
: 'datasource' === a
|
|
1992
|
-
? l.properties &&
|
|
1993
|
-
l.properties.type &&
|
|
1994
|
-
l.properties.type.default &&
|
|
1995
|
-
'local' === l.properties.type.default
|
|
1996
|
-
? ((r = { data: '{}', filter: '() => {}' }),
|
|
1997
|
-
n && n.data && (r.data = n.data),
|
|
1998
|
-
n && n.filter && (r.filter = n.filter),
|
|
1999
|
-
'http://xxx' === r.data && (r.data = '{}'))
|
|
2000
|
-
: ((r = { data: 'http://xxx', filter: '() => {}' }),
|
|
2001
|
-
n && n.data && (r.data = n.data),
|
|
2002
|
-
n && n.filter && (r.filter = n.filter),
|
|
2003
|
-
'{}' === r.data && (r.data = 'http://xxx'))
|
|
2004
|
-
: 'event' === a
|
|
2005
|
-
? l.properties &&
|
|
2006
|
-
l.properties.type &&
|
|
2007
|
-
l.properties.type.default &&
|
|
2008
|
-
'emit' === l.properties.type.default
|
|
2009
|
-
? n && 'out' === n.type
|
|
2010
|
-
? (r = {
|
|
2011
|
-
trigger: (n && n.filter) || 'eventName',
|
|
2012
|
-
eventData: '{}',
|
|
2013
|
-
})
|
|
2014
|
-
: ((r = { trigger: 'eventName', eventData: '{}' }),
|
|
2015
|
-
n && n.trigger && (r.trigger = n.trigger),
|
|
2016
|
-
n && n.eventData && (r.eventData = n.eventData))
|
|
2017
|
-
: n && 'in' === n.type
|
|
2018
|
-
? (r = {
|
|
2019
|
-
register: 'eventName',
|
|
2020
|
-
actionFunc: (n && n.filter) || '() => {}',
|
|
2021
|
-
})
|
|
2022
|
-
: ((r = { register: 'eventName', actionFunc: '() => {}' }),
|
|
2023
|
-
n && n.register && (r.register = n.register),
|
|
2024
|
-
n && n.actionFunc && (r.actionFunc = n.actionFunc))
|
|
2025
|
-
: !1 === e.isContainer && n && P(n) && '{}' !== JSON.stringify(n)
|
|
2026
|
-
? (r = Object.assign(r, n))
|
|
2027
|
-
: void 0 === i && l.default && P(l.default)
|
|
2028
|
-
? (r = l.default)
|
|
2029
|
-
: e.properties &&
|
|
2030
|
-
(e.propertyOrder
|
|
2031
|
-
? e.propertyOrder
|
|
2032
|
-
: Object.keys(e.properties)
|
|
2033
|
-
).map(function (a) {
|
|
2034
|
-
var l = e.properties[a],
|
|
2035
|
-
i = t && t[a];
|
|
2036
|
-
switch (z(l.type)) {
|
|
2037
|
-
case 'array':
|
|
2038
|
-
r[a] = oe(l, i);
|
|
2039
|
-
break;
|
|
2040
|
-
case 'object':
|
|
2041
|
-
r[a] = ne(l, i);
|
|
2042
|
-
break;
|
|
2043
|
-
default:
|
|
2044
|
-
r[a] = ie(l, i);
|
|
2045
|
-
}
|
|
2046
|
-
});
|
|
2047
|
-
}
|
|
2048
|
-
return r;
|
|
2049
|
-
}
|
|
2050
|
-
function oe(e, t) {
|
|
2051
|
-
var r = [];
|
|
2052
|
-
if (e && 'array' === z(e.type)) {
|
|
2053
|
-
var a = t;
|
|
2054
|
-
p(a) &&
|
|
2055
|
-
((p(e.default) && typeof a != typeof e.default) || !k(a)) &&
|
|
2056
|
-
(a = void 0);
|
|
2057
|
-
var l = p(a) ? a : e.default;
|
|
2058
|
-
if ('array' === z(e.type))
|
|
2059
|
-
if (k(l))
|
|
2060
|
-
l.map(function (t) {
|
|
2061
|
-
r.push(ne(e.items, t));
|
|
2062
|
-
});
|
|
2063
|
-
else if (l) r = l;
|
|
2064
|
-
else {
|
|
2065
|
-
var i = ne(e.items, l);
|
|
2066
|
-
r.push(i);
|
|
2067
|
-
}
|
|
2068
|
-
else r = p(l) ? l : [];
|
|
2069
|
-
}
|
|
2070
|
-
return r;
|
|
2071
|
-
}
|
|
2072
|
-
function ue(e, t) {
|
|
2073
|
-
return 'object' === z(e.type)
|
|
2074
|
-
? ne(e, t)
|
|
2075
|
-
: 'array' === z(e.type)
|
|
2076
|
-
? oe(e, t)
|
|
2077
|
-
: ie(e, t);
|
|
2078
|
-
}
|
|
2079
|
-
var pe = C;
|
|
2080
|
-
function ce(e, t) {
|
|
2081
|
-
var r = t || [];
|
|
2082
|
-
if (e && '{}' !== JSON.stringify(e))
|
|
2083
|
-
if (P(e))
|
|
2084
|
-
if (
|
|
2085
|
-
e.type &&
|
|
2086
|
-
'remote' === e.type &&
|
|
2087
|
-
e.config &&
|
|
2088
|
-
P(e.config) &&
|
|
2089
|
-
e.config.dataName &&
|
|
2090
|
-
p(e.localFilter) &&
|
|
2091
|
-
p(e.data)
|
|
2092
|
-
) {
|
|
2093
|
-
var a = e.config.body;
|
|
2094
|
-
if (a && !P(a))
|
|
2095
|
-
try {
|
|
2096
|
-
a = JSON.parse(a);
|
|
2097
|
-
} catch (e) {
|
|
2098
|
-
a = {};
|
|
2099
|
-
}
|
|
2100
|
-
r.push({ id: e.config.id, dataName: e.config.dataName, body: a });
|
|
2101
|
-
} else
|
|
2102
|
-
Object.keys(e).map(function (t) {
|
|
2103
|
-
ce(e[t], r);
|
|
2104
|
-
});
|
|
2105
|
-
else
|
|
2106
|
-
k(e) &&
|
|
2107
|
-
e.map(function (e) {
|
|
2108
|
-
ce(e, r);
|
|
2109
|
-
});
|
|
2110
|
-
return r;
|
|
2111
|
-
}
|
|
2112
|
-
function se(e, t) {
|
|
2113
|
-
var r = t || 'data';
|
|
2114
|
-
return (
|
|
2115
|
-
e.split('-').map(function (e) {
|
|
2116
|
-
r = /^\d+$/.test(e) ? r + '[' + e + ']' : r + '.' + e;
|
|
2117
|
-
}),
|
|
2118
|
-
r
|
|
2119
|
-
);
|
|
2120
|
-
}
|
|
2121
|
-
function de(e, t) {
|
|
2122
|
-
var r = [];
|
|
2123
|
-
return (
|
|
2124
|
-
P(e)
|
|
2125
|
-
? Object.keys(e).map(function (a) {
|
|
2126
|
-
var l = e[a],
|
|
2127
|
-
i = t ? t + '-' + a : a;
|
|
2128
|
-
P(l) || k(l)
|
|
2129
|
-
? r.push({ title: a, value: i, key: i, children: de(l, i) })
|
|
2130
|
-
: r.push({ title: a, value: i, key: i });
|
|
2131
|
-
})
|
|
2132
|
-
: k(e) &&
|
|
2133
|
-
e.map(function (e, a) {
|
|
2134
|
-
var l = a.toString(),
|
|
2135
|
-
i = t ? t + '-' + a : l;
|
|
2136
|
-
P(e) || k(e)
|
|
2137
|
-
? r.push({ title: l, value: i, key: i, children: de(e, i) })
|
|
2138
|
-
: r.push({ title: l, value: i, key: i });
|
|
2139
|
-
}),
|
|
2140
|
-
r
|
|
2141
|
-
);
|
|
2142
|
-
}
|
|
2143
|
-
function ye(e, t) {
|
|
2144
|
-
var r = '';
|
|
2145
|
-
return (
|
|
2146
|
-
'object' === z(e.type) &&
|
|
2147
|
-
e.properties &&
|
|
2148
|
-
(e.propertyOrder ? e.propertyOrder : Object.keys(e.properties)).map(
|
|
2149
|
-
function (a) {
|
|
2150
|
-
var l = e.properties[a],
|
|
2151
|
-
i = t[a];
|
|
2152
|
-
('array' === z(l.type) && 'object' === z(l.type)) ||
|
|
2153
|
-
(i &&
|
|
2154
|
-
l.isConditionProp &&
|
|
2155
|
-
(r.indexOf('-') > 0 ? (r += '-' + i) : (r = i)));
|
|
2156
|
-
},
|
|
2157
|
-
),
|
|
2158
|
-
r
|
|
2159
|
-
);
|
|
2160
|
-
}
|
|
2161
|
-
function fe(e) {
|
|
2162
|
-
var t = e.split('-');
|
|
2163
|
-
return t.pop(), t.join('-');
|
|
2164
|
-
}
|
|
2165
|
-
function be(e) {
|
|
2166
|
-
var t = e.split('-'),
|
|
2167
|
-
r = t.pop();
|
|
2168
|
-
return [t.join('-'), r];
|
|
2169
|
-
}
|
|
2170
|
-
var ve = [
|
|
2171
|
-
'key',
|
|
2172
|
-
'enum',
|
|
2173
|
-
'enumextra',
|
|
2174
|
-
'items',
|
|
2175
|
-
'input',
|
|
2176
|
-
'boolean',
|
|
2177
|
-
'number',
|
|
2178
|
-
'color',
|
|
2179
|
-
'url',
|
|
2180
|
-
'textarea',
|
|
2181
|
-
'text-editor',
|
|
2182
|
-
'radio',
|
|
2183
|
-
'select',
|
|
2184
|
-
'checkboxes',
|
|
2185
|
-
'date',
|
|
2186
|
-
'date-time',
|
|
2187
|
-
'time',
|
|
2188
|
-
'json',
|
|
2189
|
-
'codearea',
|
|
2190
|
-
'htmlarea',
|
|
2191
|
-
'quantity',
|
|
2192
|
-
'box-style',
|
|
2193
|
-
'dynamic-data',
|
|
2194
|
-
'datasource',
|
|
2195
|
-
'event',
|
|
2196
|
-
'array',
|
|
2197
|
-
'object',
|
|
2198
|
-
];
|
|
2199
|
-
return t;
|
|
2200
|
-
})();
|
|
2201
|
-
});
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.JSONUtils=t():e.JSONUtils=t()}(this,(function(){return function(){"use strict";var e={n:function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,{a:r}),r},d:function(t,r){for(var a in r)e.o(r,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:r[a]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{DataSourceTypeList:function(){return S},EventTypeDataList:function(){return x},KeyWordList:function(){return ve},TypeDataList:function(){return C},dataRoute2dataPath:function(){return se},dynamicDataAnalyzer:function(){return ce},evalExpression:function(){return s},getCurPosition:function(){return Q},getDefaultOptionVal:function(){return le},getExpectType:function(){return z},getJsonDataByKeyRoute:function(){return d},getNextIndexRoute:function(){return ee},getParentIndexRoute:function(){return G},getParentIndexRoute_CurIndex:function(){return te},getParentKeyRoute:function(){return fe},getParentKeyRoute_CurKey:function(){return be},getSchemaByIndexRoute:function(){return y},getSchemaByKeyRoute:function(){return f},hasProperties:function(){return p},indexRoute2keyRoute:function(){return b},isArray:function(){return k},isBoolean:function(){return w},isColor:function(){return M},isContainerSchema:function(){return Y},isDateStr:function(){return R},isDateTimeStr:function(){return q},isEmptySchema:function(){return W},isEqual:function(){return u},isFunction:function(){return _},isNewSchemaData:function(){return X},isNumber:function(){return N},isObject:function(){return P},isQuantity:function(){return I},isSameParent:function(){return H},isSelect:function(){return F},isString:function(){return D},isStructuredSchema:function(){return Z},isTimeStr:function(){return E},isURL:function(){return T},json2schema:function(){return A},json2treeData:function(){return de},keyRoute2indexRoute:function(){return v},metaElemAnalyzer:function(){return $},moveBackward:function(){return ae},moveForward:function(){return re},objClone:function(){return o},oldSchemaToNewSchema:function(){return V},oldSchemaToNewSchemaV1:function(){return B},registerExpectType:function(){return U},schema2conditionValue:function(){return ye},schema2json:function(){return ue},schemaMetaList:function(){return pe},truncate:function(){return c},urlParse:function(){return i},urlStringify:function(){return n}});var r=require("lodash"),a=require("qs"),l=e.n(a);function i(){var e={};return location.search&&(e=l().parse(location.search.substring(1))),e}function n(e){var t="";return url&&(t=l().stringify(e)),t}function o(e){return(0,r.cloneDeep)(e)}function u(e,t){return(0,r.isEqual)(e,t)}function p(e){var t=!1;return null!=e&&(t=!0),t}function c(e,t){return(0,r.truncate)(e,t)}function s(e,t){var r=t||{};if(!e)return!1;var a=new Function("data","with(data) { return ("+e+");}"),l="";try{l=a(r)}catch(t){return console.warn("表达式运算出错: "+e+",报错信息:",t),l}return l}function d(e,t,r){var a=t;if(r&&(a=o(t)),e)for(var l=e.split("-"),i=0,n=l.length;i<n;i++){var u=l[i];u&&(a=a&&a[u])}return a}function y(e,t,r){var a=t;if(r&&(a=o(t)),e)for(var l=e.split("-"),i=0,n=l.length;i<n;i++){var u=l[i];if("0"!==u||"array"!==a.type&&"radio"!==a.type&&"select"!==a.type&&"checkboxes"!==a.type||!a.options&&!a.items){if(u){var p="0";a.propertyOrder?p=a.propertyOrder[u]:a.properties&&(p=Object.keys(a.properties)[u]),a=a.properties[p]}}else a=a.options||a.items}return a}function f(e,t,r){var a=t;if(r&&(a=o(t)),e&&a)for(var l=e.split("-"),i=0,n=l.length;i<n;i++){var u=l[i];u&&a.properties&&(a=a.properties[u])}return a}function b(e,t){for(var r=t,a="",l=e.split("-"),i=0,n=l.length;i<n;i++){var o=l[i];if("0"===o&&r.items)r=r.items,a=a?a+"-items":"items";else if("0"===o&&r.options)r=r.options,a=a?a+"-options":"options";else if(o){var u="0";r.propertyOrder?u=r.propertyOrder[o]:r.properties&&(u=Object.keys(r.properties)[o]),r=r.properties[u],a=a?a+"-"+u:u}}return a}function v(e,t){for(var r=t,a="",l=e.split("-"),i=0,n=l.length;i<n;i++){var o=l[i];if(o){var u=-1;r.propertyOrder?(u=r.propertyOrder.indexOf(o),r=r.properties[o]):r.properties?(u=Object.keys(r.properties).indexOf(o),r=r.properties[o]):r.items?(u=0,r=r.items):r.options&&(u=0,r=r.options),a=a?a+"-"+u:u.toString()}}return a}var m,g={type:"event",title:"事件",isContainer:!1,properties:{type:{default:"emit",type:"select",options:[{label:"on",value:"on"},{label:"emit",value:"emit"}],title:"事件类型"},trigger:{type:"input",default:"eventName",title:"触发事件",description:"用于输入触发事件的名称",placeholder:"请输入触发事件的名称"},eventData:{title:"事件数据",type:"json",default:"{}",description:"传递给触发事件的数据对象"}},propertyOrder:["type","trigger","eventData"]},h={type:"datasource",title:"数据源",isContainer:!1,properties:{type:{default:"local",type:"select",options:[{label:"本地数据",value:"local"},{label:"接口数据",value:"remote"}],title:"数据源类型"},data:{title:"本地json数据",placeholder:"请输入静态json数据",type:"json",default:"{}",description:"用于设置本地的静态json数据",isRequired:!0},filter:{title:"过滤器",type:"codearea",default:"() => {}",description:"用于定义过滤当前数据的函数",isRequired:!0}},propertyOrder:["type","data","filter"]},j=((m={type:"object"}).type="datasource",m.title="数据源",m.isContainer=!1,m.properties={type:{type:"select",default:"remote",options:[{label:"本地数据",value:"local"},{label:"接口数据",value:"remote"}],title:"数据源类型"},data:{type:"url",title:"远程json数据",placeholder:"请输入远程json数据源地址",default:"http://xxx",isRequired:!0,description:"用于设置获取元素数据的请求地址"},filter:{type:"codearea",title:"过滤器",default:"() => {}",description:"用于定义过滤当前数据的函数",isRequired:!0}},m.propertyOrder=["type","data","filter"],m),O={type:"local",config:{dataName:"",body:{},filter:"return data;"},data:"{}",localFilter:"return data;"},C={jsonschema:{type:"object",title:"jsonSchemaObject",properties:{func:{type:"object",title:"功能设置",properties:{a:{title:"单文本框",type:"input",default:"",description:"",placeholder:"",isRequired:!1}},propertyOrder:["a"]},style:{type:"object",title:"样式设置",properties:{b:{title:"单文本框",type:"input",default:"",description:"",placeholder:""}},propertyOrder:["b"]},data:{type:"data",title:"数据设置",properties:{c:{title:"单文本框",type:"input",default:"",description:"",placeholder:"",isRequired:!1}},propertyOrder:["c"]}},propertyOrder:["func","style","data"]},input:{title:"单文本框",type:"input",default:"",description:"",placeholder:""},boolean:{type:"boolean",title:"布尔值",default:!1,description:""},object:{type:"object",title:"对象Object",description:"",properties:{a:{type:"input",title:"单文本框",default:"",description:"",placeholder:""}},propertyOrder:["a"]},array:{type:"array",title:"数组Array",description:"",items:{type:"object",title:"数组项",description:"",properties:{name:{type:"input",title:"名字",default:"",description:"",placeholder:""}},propertyOrder:["name"]}},"empty-array":{type:"array",title:"数组Array",description:"",default:[],items:{type:"object",title:"数组项",description:"",properties:{}}},"empty-object":{type:"object",title:"对象Object",description:"",properties:{}},url:{type:"url",title:"链接地址url",default:"",description:"",placeholder:""},textarea:{type:"textarea",title:"多行文本框",default:"",description:"",placeholder:""},color:{type:"color",title:"颜色color",default:"#ffffff",description:""},image:{title:"图片",type:"image",default:"",description:"上传图片",imgWidth:200,imgHeight:200,imgRatioReadOnly:!0},number:{type:"number",title:"数量number",default:1,minimum:0,maximum:1e3,description:""},"input-image":{title:"图片地址",type:"input-image",description:"",accept:".jpeg,.jpg,.png",multiple:!0},json:{title:"json数据",type:"json",default:"{}",description:""},codearea:{type:"codearea",title:"函数类型",placeholder:"请输入函数方法",default:'function func() { console.log("hello, world!"); }',description:"用于定义函数方法"},htmlarea:{title:"富文本",type:"htmlarea",placeholder:"请输入html代码片段",default:"<p>hello,world!</p>",description:"用于放置html代码片段"},"text-editor":{type:"text-editor",title:"富文本",default:"",description:"",placeholder:""},date:{type:"date",title:"日期Date",default:"",description:"",placeholder:""},"date-time":{type:"date-time",title:"日期时间",default:"",description:"",placeholder:""},time:{type:"time",title:"时间Time",default:"",description:"",placeholder:""},quantity:{type:"quantity",title:"单位计量",isContainer:!1,properties:{unit:{type:"number",title:"单位数值",default:50,minimum:0,maximum:1e3,description:""},quantity:{type:"select",default:"px",options:[{label:"px",value:"px"},{label:"rem",value:"rem"},{label:"em",value:"em"},{label:"%",value:"%"}],title:"单位类型"}},propertyOrder:["unit","quantity"]},"box-style":{type:"box-style",title:"盒子模型",isContainer:!1,properties:{unit:{title:"单位数值",type:"input",default:"0",description:""},quantity:{type:"select",default:"px",options:[{label:"px",value:"px"},{label:"rem",value:"rem"},{label:"em",value:"em"},{label:"%",value:"%"}],title:"单位类型"}},propertyOrder:["unit","quantity"]},"padding-margin":{type:"padding-margin",title:"边距设置",isContainer:!1,properties:{margin:{title:"外边距",type:"input",default:"0",description:""},padding:{title:"内边距",type:"input",default:"0",description:""},quantity:{type:"select",default:"px",options:[{label:"px",value:"px"},{label:"rem",value:"rem"},{label:"em",value:"em"},{label:"%",value:"%"}],title:"单位类型"}},propertyOrder:["margin","padding","quantity"]},radio:{type:"radio",title:"单选",options:[{label:"选项a",value:"a"},{label:"选项b",value:"b"},{label:"选项c",value:"c"}],default:"a",description:""},select:{type:"select",title:"下拉选择",options:[{label:"选项a",value:"a"},{label:"选项b",value:"b"},{label:"选项c",value:"c"}],default:"a",description:""},cascader:{type:"cascader",title:"级联选择",options:[{value:"zhejiang",label:"Zhejiang",children:[{value:"hangzhou",label:"Hangzhou",children:[{value:"xihu",label:"West Lake"}]}]},{value:"jiangsu",label:"Jiangsu",children:[{value:"nanjing",label:"Nanjing",children:[{value:"zhonghuamen",label:"Zhong Hua Men"}]}]}],default:"a",description:"",showSearch:!0,allowClear:!0},checkboxes:{type:"checkboxes",title:"多选",options:[{label:"选项a",value:"a"},{label:"选项b",value:"b"},{label:"选项c",value:"c"}],default:["a"],description:""},"dynamic-data":{type:"dynamic-data",title:"动态数据源",isContainer:!1,properties:{type:{default:"local",type:"select",options:[{label:"本地数据",value:"local"},{label:"接口数据",value:"remote"}],title:"数据类型"},config:{title:"接口配置",type:"object",description:"用于存放接口的配置数据(url、请求参数等)",isRequired:!0,properties:{dataName:{default:"local",type:"select",options:[{label:"本地数据",value:"local"},{label:"接口数据",value:"remote"}],title:"数据类型"},body:{type:"object",title:"请求参数配置",description:"用于配置当前接口的请求参数数值",isRequired:!0},filter:{title:"过滤器函数体",type:"codearea",default:"return data;",description:"用于定义过滤接口数据",isRequired:!0}},propertyOrder:["dataName","body","filter"]},data:{title:"数据内容",type:"json",default:"{}",description:"用于存放DynamicData的数据内容",isRequired:!0},localFilter:{title:"过滤器",type:"codearea",default:"return data;",description:"用于定义过滤本地数据",isRequired:!0}},propertyOrder:["type","config","data","localFilter"]},datasource:h,event:g,"dynamic-config":{type:"dynamic-config",title:"动态配置",description:"",isContainer:!1,properties:{type:{type:"select",title:"数据来源",options:[{label:"模板直接设置",value:"DevDefaults"},{label:"mp后台配置",value:"ContentStaticConfig"},{label:"内容Meta数据",value:"Content"},{label:"全局配置数据",value:"RuntimeConst"},{label:"资源中心配置",value:"ResourceCenter"}],default:"DevDefaults",isConditionProp:!0,description:"目前支持的数据来源包括: 1)模版直接设置:在模版配置直接生效,支持直接输入或图片上传。 2)mp后台配置:选择mp后台配置后,属性会出现在mp后台中,支持属性描述的输入。 3)内容meta数据:支持内容meta数据的获取,页面meta数据。 4)全局配置数据:目前支持的全局配置包括:全局Tab配置及主题包配置。相关属性会挂载至:window.globalConst"},value:{title:"数据值",type:"input",default:"",description:"",placeholder:"",onShow:'type === "DevDefaults" || type === "Content" || type === "RuntimeConst"'},description:{title:"属性名称",type:"input",default:"",description:"",placeholder:"",onShow:'type === "ContentStaticConfig" || type === "ResourceCenter"'},valueType:{type:"radio",title:"配置方式",options:[{label:"填写",value:"string"},{label:"选择",value:"select"}],default:"string",isConditionProp:!0,description:'在MP后台或资源中心配置时的交互方式,推荐使用"选择"',onShow:'type === "ContentStaticConfig" || type === "ResourceCenter"'},range:{type:"select",title:"可选项",multiple:!0,options:[],onShow:'(type === "ContentStaticConfig" || type === "ResourceCenter") && valueType === "select"',description:"这里会使用value中的配置选项作为options"}},propertyOrder:["type","value","description","valueType","range"],showCodeViewBtn:!1},"sohu-source":{type:"sohu-source",title:"组件动态数据",description:"",isContainer:!1,properties:{mainConfig:{type:"object",title:"主要配置",description:"",isContainer:!1,properties:{type:{type:"select",title:"数据来源",isConditionProp:!0,options:[{label:"模板直接配置",value:"RuntimeDataSelfDefine"},{label:"mp后台配置",value:"ContentStaticConfig"},{label:"请求当前页面数据",value:"RuntimeDataSelfContent"},{label:"资源中心配置",value:"ResourceCenter"}],default:"ContentStaticConfig",description:""},description:{title:"数据源名称",type:"input",default:"",description:"",placeholder:"",onShow:'type === "ContentStaticConfig"'},dataType:{type:"radio",title:"请求方式",options:[{label:"批量请求",value:"FROMCIS"},{label:"组件内部请求",value:"FROMCOMPCIS"},{label:"不请求",value:"false"}],description:""},CONTENTID:{title:"数据源ID",type:"input",default:"",description:"",placeholder:"",onShow:'type === "RuntimeDataSelfDefine"'},CONTENTTYPE:{type:"select",title:"数据源类型",options:[{label:"channel",value:"channel"},{label:"topic",value:"topic"},{label:"block",value:"block"}],description:"",onShow:'type === "RuntimeDataSelfDefine"'}},propertyOrder:["type","description","dataType","CONTENTID","CONTENTTYPE"],showCodeViewBtn:!1},outConfig:{type:"object",title:"出流配置",description:"",isContainer:!1,properties:{PRO:{type:"select",title:"内容类型",options:[{label:"置顶+加精",value:"4"},{label:"长效置顶",value:"5"}],description:""},FEEDTYPE:{type:"select",title:"排序类型",options:[{label:"综合",value:"XTOPIC_SYNTHETICAL"},{label:"最新",value:"XTOPIC_LATEST"},{label:"相关",value:"XTOPIC_RELATED"}],description:""},VIEW:{type:"select",title:"数据裁剪",options:[{label:"相关推荐模式",value:"articleFeedMode"},{label:"文字链裁剪方式",value:"textMode"},{label:"短内容摘录方式",value:"excerptMode"},{label:"互动(点赞/评论)裁剪方式",value:"interactMode"},{label:"评论文字链裁剪方式",value:"commentTextMode"},{label:"摘录方式(无点赞)",value:"excerptCommentMode"},{label:"无限流卡片模式",value:"dynamicFeedMode"},{label:"时间线模式",value:"timeLineMode"},{label:"复合内容流模式",value:"multiFeedMode"},{label:"搜狐号推荐模式",value:"recommendFeedMode"},{label:"作者页内容流模式",value:"operateFeedMode"},{label:"标签内容流模式",value:"tagsFeedMode"},{label:"评论链裁剪方式",value:"commentMode"},{label:"标签摘录方式",value:"excerptTagsMode"},{label:"内容流模式",value:"feedMode"}],description:""},CONTENTCONTEXT:{type:"select",title:"mKey参数",options:[{label:"作者ID+栏目ID",value:"authorColumnId_${#authorColumnId}"},{label:"账号ID",value:"accountId_${#contentData_account_id}"},{label:"mkeyID",value:"mid_${#mkeyConst_mid}"},{label:"mkey名称",value:"mname_${#mkeyConst_mname}"},{label:"城市Code码",value:"cityCode_${#cityInfo_cityCode}"},{label:"城市名称",value:"cityName_${#cityInfo_cityName}"},{label:"焦点城市Code码",value:"focusCityCode_${#focusCityInfo_cityCode}"}],description:""},CONTENTPARAMS:{title:"动态参数",type:"json",default:"{}",description:"请填写JSON格式的参数",placeholder:""}},propertyOrder:["PRO","FEEDTYPE","VIEW","CONTENTCONTEXT","CONTENTPARAMS"],showCodeViewBtn:!1},otherConfig:{type:"object",title:"选配内容",description:"",isContainer:!1,properties:{SIZE:{type:"number",title:"容量",default:1,minimum:0,maximum:1e3,description:"该位置区块需要的内容条数"},TITLE:{title:"标题",type:"input",default:"",description:"",placeholder:""},CODE:{title:"Code参数",type:"input",default:"",description:"",placeholder:""},URL:{type:"url",title:"跳转链接",default:"",description:"",placeholder:""}},propertyOrder:["SIZE","TITLE","URL","CODE"],showCodeViewBtn:!1}},propertyOrder:["mainConfig","otherConfig","outConfig"],showCodeViewBtn:!1},"sohu-event":{type:"sohu-event",title:"sohu组件事件",showCodeViewBtn:!1,isContainer:!1,properties:{globalEventMap:{type:"object",title:"全局事件Map",description:"",properties:{eventCode:{type:"input",title:"事件名称",default:"",description:"",placeholder:"",readOnly:!0}},propertyOrder:["eventCode"],showCodeViewBtn:!1},event:{type:"array",title:"监听事件",description:"当前组件监听事件列表",default:[],items:{type:"object",title:"数组项",description:"",properties:{name:{type:"input",title:"事件",default:"",description:"",placeholder:""},code:{title:"事件code",type:"input",default:"",description:"",placeholder:""},listenName:{title:"事件名称",type:"input",default:"",description:"",placeholder:""},desc:{title:"事件描述",type:"input",default:"",description:"",placeholder:""}},propertyOrder:["name","code","listenName","desc"]},showCodeViewBtn:!1}},propertyOrder:["globalEventMap","event"]},"sohu-ad":{type:"object",title:"广告配置",description:"",properties:{type:{type:"select",title:"数据源类型",isConditionProp:!0,options:[{label:"模板直接设置",value:"DevDefaults"},{label:"资源中心配置",value:"ResourceCenter"}],description:""},value:{type:"object",title:"广告规则",description:"",onShow:'type === "DevDefaults"',properties:{id:{title:"广告ID",type:"number",default:"",description:"",placeholder:""},rule:{type:"radio",title:"规则类型",isConditionProp:!0,options:[{label:"固定位置",value:1},{label:"隔几出几",value:2},{label:"固定位置隔几出几",value:3}],default:1,description:""},fixArray:{type:"select",title:"固定位置",default:[1],description:"",multiple:!0,onShow:"rule === 1 || rule === 3",options:[{label:"1",value:1},{label:"2",value:2},{label:"3",value:3},{label:"4",value:4},{label:"5",value:5},{label:"6",value:6},{label:"7",value:7},{label:"8",value:8},{label:"9",value:9},{label:"10",value:10},{label:"11",value:11},{label:"12",value:12},{label:"13",value:13},{label:"14",value:14},{label:"15",value:15},{label:"16",value:16},{label:"17",value:17},{label:"18",value:18},{label:"19",value:19},{label:"20",value:20},{label:"21",value:21},{label:"22",value:22},{label:"23",value:23},{label:"24",value:24},{label:"25",value:25},{label:"26",value:26},{label:"27",value:27},{label:"28",value:28},{label:"29",value:29},{label:"30",value:30},{label:"31",value:31},{label:"32",value:32},{label:"33",value:33},{label:"34",value:34},{label:"35",value:35},{label:"36",value:36},{label:"37",value:37},{label:"38",value:38},{label:"39",value:39},{label:"40",value:40},{label:"41",value:41},{label:"42",value:42},{label:"43",value:43},{label:"44",value:44},{label:"45",value:45},{label:"46",value:46},{label:"47",value:47},{label:"48",value:48},{label:"49",value:49},{label:"50",value:50}]},begin:{type:"number",title:"开始位置",default:1,minimum:"1",maximum:"50",description:"",onShow:"rule === 2 || rule === 3"},turn:{type:"number",title:"间隔/隔",default:1,minimum:"1",maximum:"50",description:"",onShow:"rule === 2 || rule === 3"},number:{type:"number",title:"间隔/出",default:1,minimum:"1",maximum:"50",description:"",onShow:"rule === 2 || rule === 3"},mergeType:{type:"radio",title:"插入规则",options:[{label:"覆盖",value:0},{label:"插入",value:1}],default:0,description:""}},propertyOrder:["id","rule","fixArray","begin","turn","number","mergeType"]},range:{type:"array",title:"广告规则列表",description:"",onShow:'type === "ResourceCenter"',items:{type:"object",title:"数组项",description:"",properties:{rule:{type:"radio",title:"规则类型",isConditionProp:!0,options:[{label:"固定位置",value:1},{label:"隔几出几",value:2},{label:"固定位置隔几出几",value:3}],default:1,description:""},fixArray:{type:"select",title:"固定位置",default:[1],description:"",onShow:"rule === 1 || rule === 3",multiple:!0,options:[{label:"1",value:1},{label:"2",value:2},{label:"3",value:3},{label:"4",value:4},{label:"5",value:5},{label:"6",value:6},{label:"7",value:7},{label:"8",value:8},{label:"9",value:9},{label:"10",value:10},{label:"11",value:11},{label:"12",value:12},{label:"13",value:13},{label:"14",value:14},{label:"15",value:15},{label:"16",value:16},{label:"17",value:17},{label:"18",value:18},{label:"19",value:19},{label:"20",value:20},{label:"21",value:21},{label:"22",value:22},{label:"23",value:23},{label:"24",value:24},{label:"25",value:25},{label:"26",value:26},{label:"27",value:27},{label:"28",value:28},{label:"29",value:29},{label:"30",value:30},{label:"31",value:31},{label:"32",value:32},{label:"33",value:33},{label:"34",value:34},{label:"35",value:35},{label:"36",value:36},{label:"37",value:37},{label:"38",value:38},{label:"39",value:39},{label:"40",value:40},{label:"41",value:41},{label:"42",value:42},{label:"43",value:43},{label:"44",value:44},{label:"45",value:45},{label:"46",value:46},{label:"47",value:47},{label:"48",value:48},{label:"49",value:49},{label:"50",value:50}]},begin:{type:"number",title:"开始位置",default:1,minimum:"1",maximum:"50",description:"",onShow:"rule === 2 || rule === 3"},turn:{type:"number",title:"间隔/隔",default:1,minimum:"1",maximum:"50",description:"",onShow:"rule === 2 || rule === 3"},number:{type:"number",title:"间隔/出",default:1,minimum:"1",maximum:"50",description:"",onShow:"rule === 2 || rule === 3"},mergeType:{type:"radio",title:"插入规则",options:[{label:"覆盖",value:0},{label:"插入",value:1}],default:0,description:""}},propertyOrder:["rule","fixArray","begin","turn","number","mergeType"]}}},propertyOrder:["type","value","range"]}},x={on:{type:"event",title:"事件",isContainer:!1,properties:{type:{default:"on",type:"select",options:[{label:"on",value:"on"},{label:"emit",value:"emit"}],title:"事件类型"},register:{type:"input",default:"eventName",title:"注册事件",description:"用于输入注册事件的名称",placeholder:"请输入注册事件的名称"},actionFunc:{title:"执行函数",type:"codearea",default:"() => {}",description:""}},propertyOrder:["type","register","actionFunc"]},emit:g},S={local:h,remote:j};function T(e){return/^http[s]?:\/\/.*/.test(e)}function D(e){return"String"===Object.prototype.toString.call(e).slice(8,-1)}function N(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function w(e){return"Boolean"===Object.prototype.toString.call(e).slice(8,-1)}function R(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)}function q(e){return/^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}$/.test(e)||/^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}$/.test(e)}function E(e){return/^\d{2}:\d{2}:\d{2}$/.test(e)||/^\d{2}:\d{2}$/.test(e)}function k(e){var t=!1;return"Array"===Object.prototype.toString.call(e).slice(8,-1)&&(t=!0),t}function F(e){if(!k(e))return!1;for(var t=0,r=e.length;t<r;t++)if(!D(e[t]))return!1;return!0}function P(e){var t=!1;return"Object"===Object.prototype.toString.call(e).slice(8,-1)&&(t=!0),t}function I(e){var t=!1;return C.quantity.properties.quantity.enum.indexOf(e)>=0&&(t=!0),t}function M(e){return/^#[0-9a-f]{6}$/.test(e)||/^#[0-9a-f]{3}$/.test(e)}function _(e){var t=!1;return"Function"===Object.prototype.toString.call(e).slice(8,-1)&&(t=!0),t}function A(e){var t;return t=e&&P(e)?function(e){var t;if(P(e)){var r=Object.keys(e);e.data&&e.filter&&2===r.length?t=k(e.data)||P(e.data)?o(S.local):o(S.remote):e.trigger&&e.eventData&&2===r.length?t=o(x.emit):e.register&&e.actionFunc&&2===r.length?t=o(x.on):e.quantity&&I(e.quantity)&&2===r.length?t=o(C.quantity):(t=o(C["empty-object"]),Object.keys(e).map((function(r){var a=e[r];t.properties[r]=A(a)})))}return t}(e):e&&k(e)?function(e){var t;if(e&&k(e))if(F(e)){(t=o(C.select)).items.enum=e;var r=t.items.enumextra.length,a=e.length;if(a>r)for(var l=r,i=a;l<i;l++)t.items.enumextra.push("选项"+e(l))}else{t=o(C["empty-array"]);var n=A(e[0]);t.items.properties=n.properties}return t}(e):function(e){var t="";if(w(e))t=o(C.boolean);else if(N(e))t=o(C.number);else if(T(e))t=o(C.url);else if(R(e))t=o(C.date);else if(q(e))t=o(C["date-time"]);else if(E(e))t=o(C.time);else if(M(e))t=o(C.color);else try{t=N(JSON.parse(e))?o(C.input):o(C.json)}catch(r){t=e&&e.length>30?o(C.textarea):o(C.input)}return t}(e),t}function L(e,t){var r=t||{};return P(e)&&"object"===getExpectType(e.type)&&e.properties&&(e.propertyOrder?e.propertyOrder:Object.keys(e.properties)).map((function(t){var a=e.properties[t];r=$(a,r)})),r}function $(e,t){var r=!t,a=t||{};if(e&&"{}"!==JSON.stringify(e)){var l=e.type;"object"===l||"func"===l||"style"===l||"data"===l?(!r&&a.object?a.object+=1:r||(a.object=1),a=L(e,a)):"array"===l?(!r&&a.array?a.array+=1:r||(a.array=1),a=L(e=e.items,a)):!r&&a[l]?a[l]+=1:r||(a[l]=1)}return a}function B(e){var t=o(e);if(!t.title&&t.description&&(t.title=t.description),t.type||(t.type=t.format),"quantity"!==t.type&&"array"!==t.type&&"datasource"!==t.type&&"event"!==t.type&&"object"!==t.type||!p(t.default)||delete t.default,"radio"===t.type&&(t.type="string",t.enum&&t.enumextra&&(t.items={type:"string",enum:o(t.enum),enumextra:o(t.enumextra)},delete t.enum,delete t.enumextra)),"quantity"===t.type){var r=t.properties,a=o(C.quantity);if(r.quantity&&P(r.quantity)&&r.quantity.default){var l=r.quantity.default;a.properties.quantity.default="percent"===l?"%":l}t=a}if("datasource"===t.type){var i=t.properties,n=i.type&&i.type.default,u=i.data&&i.data.default,c=i.filter&&i.filter.default;"local"===n?(t=o(S.local)).properties.data.default=u?o(u):"{}":(t=o(S.remote)).properties.data.default=u?o(u):"http://xxx",t.properties.filter.default=c?o(c):"() => {}"}if("event"===t.type){var s=t.properties,d=s.type&&s.type.default;if("in"===d||"on"===d){var y=s.filter&&s.filter.default||"() => {}";t=o(x.on),s.actionFunc&&P(s.actionFunc)&&(t.properties.actionFunc.default=s.actionFunc.default||o(y))}else{var f=s.filter&&s.filter.default||"{}";t=o(x.emit),s.eventData&&P(s.eventData)&&(t.properties.eventData.default=s.eventData.default||o(f))}}return t.properties&&(t.propertyOrder||(t.propertyOrder=Object.keys(t.properties)),t.propertyOrder.map((function(e){t.properties[e]=V(t.properties[e])}))),t.items&&(t.items=V(t.items)),t}function V(e){var t=o(e);return t.required||delete t.required,t.type&&t.type&&(t.type=t.type),"quantity"!==t.type&&"array"!==t.type&&"datasource"!==t.type&&"event"!==t.type&&"object"!==t.type||!p(t.default)||delete t.default,"radio"!==t.type&&"checkboxes"!==t.type&&"select"!==t.type||t.items&&t.items.enum&&t.items.enumextra&&(t.options=[],t.items.enum.forEach((function(e,r){t.options.push({label:t.items.enumextra[r]||e,value:e})})),delete t.items),t.properties&&(t.propertyOrder||(t.propertyOrder=Object.keys(t.properties)),t.propertyOrder.map((function(e){t.properties[e]=V(t.properties[e])}))),"array"===t.type&&t.items&&(t.items=V(t.items)),t}require("mobx");var J,K=((J={array:"array",boolean:"boolean","box-style":"object","padding-margin":"object",codearea:"string",color:"string",datasource:"object",date:"string","date-time":"string","dynamic-data":"object",event:"object","func-body":"string",htmlarea:"string",image:"string",input:"string",json:"string",number:"number","input-image":"string",object:"object",quantity:"object",radio:"string",select:"array"}).select="string",J.textarea="string",J["text-editor"]="string",J.time="string",J.url="string",J["dynamic-config"]="object",J["sohu-source"]="object",J["sohu-event"]="object",J);function z(e){return K[e]||e}function U(e,t){K[e]?console.warn("当前已经存在"+e+"("+K[e]+"),暂时不支持覆盖。"):K[e]=t}function W(e){var t=!0;if(!e)return t;var r=e.type;return("object"===r&&e.properties&&e.propertyOrder&&e.propertyOrder.length>0||"array"===r&&e.items&&e.items.properties&&e.items.propertyOrder&&e.items.propertyOrder.length>0||e.type&&"array"!==e.type&&"object"!==e.type||e.type)&&(t=!1),t}function X(e){var t=!1,r=e.lastUpdateTime,a=new Date("2024-10-05T00:01:00.691Z").getTime();return r&&new Date(r).getTime()>=a&&(t=!0),t}function Y(e){var t=!1,r=z(e.type),a=void 0===e.isContainer||e.isContainer;return"object"===r&&a&&(t=!0),t}function Z(e){var t=!0;return"object"===e.type&&e.propertyOrder&&e.properties?e.propertyOrder.map((function(r){var a=e.properties[r];"object"===e.type&&a.propertyOrder&&a.properties||(t=!1)})):t=!1,t}function H(e,t){var r=e.split("-"),a=t.split("-");return r.pop(),a.pop(),r.join("-")===a.join("-")}function Q(e,t){for(var r=e.split("-"),a=t.split("-"),l="before",i=0,n=(r.length>a.length?a:r).length;i<n;i+=1)Number(r[i])>Number(a[i])&&(l="after");return l}function G(e){var t=e.split("-");return t.pop(),t.join("-")}function ee(e){var t=e.split("-"),r=t.pop(),a=Number(r)+1;return t.push(""+a),t.join("-")}function te(e){var t=e.split("-"),r=t.pop();return[t.join("-"),r]}function re(e){var t=e.split("-"),r=t.pop();return t.push(Number(r)-1),t.join("-")}function ae(e){var t=e.split("-"),r=t.pop();return t.push(Number(r)+1),t.join("-")}function le(e,t){var r="",a=!1;return e.options&&e.options[0]&&(r=e.options[0].value,a=!0),(t||e.multiple)&&(r=a?[r]:[]),r}function ie(e,t){var r,a,l="",i=t;p(i)&&p(e.default)&&(typeof i!=typeof e.default||(r=i,a=e.default,P(r)+"-"+k(r)!=P(a)+"-"+k(a)))&&(i=void 0);var n=p(i)?i:e.default;switch(e.type){case"select":case"radio":l=n||le(e);break;case"checkboxes":l=n||le(e,!0);break;case"color":"#fff"!==n&&"#FFF"!==n||(n="#ffffff"),l=p(n)?n:"#ffffff";break;case"boolean":l=!!p(n)&&n;break;case"number":l=p(n)?n:void 0;break;case"json":var o="";if(P(n)||k(n))o=n;else if(_(n)||""===n)o={};else try{o=JSON.parse(n)}catch(e){o={}}l=o;break;default:l="input"===e.type&&"0"===e.default?n||e.default:p(n)?n:void 0}return l}function ne(e,t){var r={},a=e.type;if(P(e)&&"object"===z(e.type)){var l=e,i=t;p(i)&&(p(l.default)&&typeof i!=typeof e.default||!P(i))&&(i=void 0);var n=p(i)?i:l.default;"dynamic-data"===a?(r=o(O),n&&P(n)&&"{}"!==JSON.stringify(n)&&(r=Object.assign(r,n))):"datasource"===a?l.properties&&l.properties.type&&l.properties.type.default&&"local"===l.properties.type.default?(r={data:"{}",filter:"() => {}"},n&&n.data&&(r.data=n.data),n&&n.filter&&(r.filter=n.filter),"http://xxx"===r.data&&(r.data="{}")):(r={data:"http://xxx",filter:"() => {}"},n&&n.data&&(r.data=n.data),n&&n.filter&&(r.filter=n.filter),"{}"===r.data&&(r.data="http://xxx")):"event"===a?l.properties&&l.properties.type&&l.properties.type.default&&"emit"===l.properties.type.default?n&&"out"===n.type?r={trigger:n&&n.filter||"eventName",eventData:"{}"}:(r={trigger:"eventName",eventData:"{}"},n&&n.trigger&&(r.trigger=n.trigger),n&&n.eventData&&(r.eventData=n.eventData)):n&&"in"===n.type?r={register:"eventName",actionFunc:n&&n.filter||"() => {}"}:(r={register:"eventName",actionFunc:"() => {}"},n&&n.register&&(r.register=n.register),n&&n.actionFunc&&(r.actionFunc=n.actionFunc)):!1===e.isContainer&&n&&P(n)&&"{}"!==JSON.stringify(n)?r=Object.assign(r,n):void 0===i&&l.default&&P(l.default)?r=l.default:e.properties&&(e.propertyOrder?e.propertyOrder:Object.keys(e.properties)).map((function(a){var l=e.properties[a],i=t&&t[a];switch(z(l.type)){case"array":r[a]=oe(l,i);break;case"object":r[a]=ne(l,i);break;default:r[a]=ie(l,i)}}))}return r}function oe(e,t){var r=[];if(e&&"array"===z(e.type)){var a=t;p(a)&&(p(e.default)&&typeof a!=typeof e.default||!k(a))&&(a=void 0);var l=p(a)?a:e.default;if("array"===z(e.type))if(k(l))l.map((function(t){r.push(ne(e.items,t))}));else if(l)r=l;else{var i=ne(e.items,l);r.push(i)}else r=p(l)?l:[]}return r}function ue(e,t){return"object"===z(e.type)?ne(e,t):"array"===z(e.type)?oe(e,t):ie(e,t)}var pe=C;function ce(e,t){var r=t||[];if(e&&"{}"!==JSON.stringify(e))if(P(e))if(e.type&&"remote"===e.type&&e.config&&P(e.config)&&e.config.dataName&&p(e.localFilter)&&p(e.data)){var a=e.config.body;if(a&&!P(a))try{a=JSON.parse(a)}catch(e){a={}}r.push({id:e.config.id,dataName:e.config.dataName,body:a})}else Object.keys(e).map((function(t){ce(e[t],r)}));else k(e)&&e.map((function(e){ce(e,r)}));return r}function se(e,t){var r=t||"data";return e.split("-").map((function(e){r=/^\d+$/.test(e)?r+"["+e+"]":r+"."+e})),r}function de(e,t){var r=[];return P(e)?Object.keys(e).map((function(a){var l=e[a],i=t?t+"-"+a:a;P(l)||k(l)?r.push({title:a,value:i,key:i,children:de(l,i)}):r.push({title:a,value:i,key:i})})):k(e)&&e.map((function(e,a){var l=a.toString(),i=t?t+"-"+a:l;P(e)||k(e)?r.push({title:l,value:i,key:i,children:de(e,i)}):r.push({title:l,value:i,key:i})})),r}function ye(e,t){var r="";return"object"===z(e.type)&&e.properties&&(e.propertyOrder?e.propertyOrder:Object.keys(e.properties)).map((function(a){var l=e.properties[a],i=t[a];"array"===z(l.type)&&"object"===z(l.type)||i&&l.isConditionProp&&(r.indexOf("-")>0?r+="-"+i:r=i)})),r}function fe(e){var t=e.split("-");return t.pop(),t.join("-")}function be(e){var t=e.split("-"),r=t.pop();return[t.join("-"),r]}var ve=["key","enum","enumextra","items","input","boolean","number","color","url","textarea","text-editor","radio","select","checkboxes","date","date-time","time","json","codearea","htmlarea","quantity","box-style","dynamic-data","datasource","event","array","object"];return t}()}));
|