@wibetter/json-utils 5.0.8 → 5.0.9
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 +676 -5
- package/dist/index.esm.min.js +1241 -931
- package/dist/index.js +657 -339
- package/dist/index.js.LICENSE.txt +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
'use strict';
|
|
13
13
|
var e = {
|
|
14
14
|
d: function (t, r) {
|
|
15
|
-
for (var
|
|
16
|
-
e.o(r,
|
|
17
|
-
!e.o(t,
|
|
18
|
-
Object.defineProperty(t,
|
|
15
|
+
for (var a in r)
|
|
16
|
+
e.o(r, a) &&
|
|
17
|
+
!e.o(t, a) &&
|
|
18
|
+
Object.defineProperty(t, a, { enumerable: !0, get: r[a] });
|
|
19
19
|
},
|
|
20
20
|
o: function (e, t) {
|
|
21
21
|
return Object.prototype.hasOwnProperty.call(e, t);
|
|
@@ -31,260 +31,269 @@
|
|
|
31
31
|
e.r(t),
|
|
32
32
|
e.d(t, {
|
|
33
33
|
DataSourceTypeList: function () {
|
|
34
|
-
return
|
|
34
|
+
return O;
|
|
35
35
|
},
|
|
36
36
|
EventTypeDataList: function () {
|
|
37
|
-
return
|
|
37
|
+
return h;
|
|
38
38
|
},
|
|
39
39
|
KeyWordList: function () {
|
|
40
|
-
return
|
|
40
|
+
return de;
|
|
41
41
|
},
|
|
42
42
|
TypeDataList: function () {
|
|
43
|
-
return
|
|
43
|
+
return g;
|
|
44
44
|
},
|
|
45
45
|
dataRoute2dataPath: function () {
|
|
46
46
|
return oe;
|
|
47
47
|
},
|
|
48
48
|
dynamicDataAnalyzer: function () {
|
|
49
|
-
return
|
|
49
|
+
return ne;
|
|
50
|
+
},
|
|
51
|
+
expressionOn: function () {
|
|
52
|
+
return o;
|
|
50
53
|
},
|
|
51
54
|
getCurPosition: function () {
|
|
52
|
-
return
|
|
55
|
+
return W;
|
|
53
56
|
},
|
|
54
57
|
getDefaultOptionVal: function () {
|
|
55
|
-
return
|
|
58
|
+
return ee;
|
|
56
59
|
},
|
|
57
60
|
getExpectType: function () {
|
|
58
61
|
return L;
|
|
59
62
|
},
|
|
60
63
|
getJsonDataByKeyRoute: function () {
|
|
61
|
-
return
|
|
64
|
+
return p;
|
|
62
65
|
},
|
|
63
66
|
getNextIndexRoute: function () {
|
|
64
|
-
return
|
|
67
|
+
return z;
|
|
65
68
|
},
|
|
66
69
|
getParentIndexRoute: function () {
|
|
67
|
-
return
|
|
70
|
+
return Z;
|
|
68
71
|
},
|
|
69
72
|
getParentIndexRoute_CurIndex: function () {
|
|
70
|
-
return
|
|
73
|
+
return H;
|
|
71
74
|
},
|
|
72
75
|
getParentKeyRoute: function () {
|
|
73
|
-
return
|
|
76
|
+
return ce;
|
|
74
77
|
},
|
|
75
78
|
getParentKeyRoute_CurKey: function () {
|
|
76
|
-
return
|
|
79
|
+
return se;
|
|
77
80
|
},
|
|
78
81
|
getSchemaByIndexRoute: function () {
|
|
79
|
-
return
|
|
82
|
+
return u;
|
|
80
83
|
},
|
|
81
84
|
getSchemaByKeyRoute: function () {
|
|
82
|
-
return
|
|
85
|
+
return c;
|
|
83
86
|
},
|
|
84
87
|
hasProperties: function () {
|
|
85
|
-
return
|
|
88
|
+
return l;
|
|
86
89
|
},
|
|
87
90
|
indexRoute2keyRoute: function () {
|
|
88
|
-
return
|
|
91
|
+
return s;
|
|
89
92
|
},
|
|
90
93
|
isArray: function () {
|
|
91
|
-
return
|
|
94
|
+
return R;
|
|
92
95
|
},
|
|
93
96
|
isBoolean: function () {
|
|
94
|
-
return
|
|
97
|
+
return S;
|
|
95
98
|
},
|
|
96
99
|
isColor: function () {
|
|
97
100
|
return q;
|
|
98
101
|
},
|
|
99
102
|
isContainerSchema: function () {
|
|
100
|
-
return
|
|
103
|
+
return U;
|
|
101
104
|
},
|
|
102
105
|
isDateStr: function () {
|
|
103
106
|
return T;
|
|
104
107
|
},
|
|
105
108
|
isDateTimeStr: function () {
|
|
106
|
-
return
|
|
109
|
+
return D;
|
|
107
110
|
},
|
|
108
111
|
isEmptySchema: function () {
|
|
109
|
-
return
|
|
112
|
+
return J;
|
|
110
113
|
},
|
|
111
114
|
isEqual: function () {
|
|
112
|
-
return
|
|
115
|
+
return i;
|
|
113
116
|
},
|
|
114
117
|
isFunction: function () {
|
|
115
118
|
return F;
|
|
116
119
|
},
|
|
117
120
|
isNewSchemaData: function () {
|
|
118
|
-
return
|
|
121
|
+
return K;
|
|
119
122
|
},
|
|
120
123
|
isNumber: function () {
|
|
121
|
-
return
|
|
124
|
+
return x;
|
|
122
125
|
},
|
|
123
126
|
isObject: function () {
|
|
124
|
-
return
|
|
127
|
+
return E;
|
|
125
128
|
},
|
|
126
129
|
isQuantity: function () {
|
|
127
130
|
return k;
|
|
128
131
|
},
|
|
129
132
|
isSameParent: function () {
|
|
130
|
-
return
|
|
133
|
+
return Y;
|
|
131
134
|
},
|
|
132
135
|
isSelect: function () {
|
|
133
|
-
return
|
|
136
|
+
return w;
|
|
134
137
|
},
|
|
135
138
|
isString: function () {
|
|
136
|
-
return
|
|
139
|
+
return C;
|
|
137
140
|
},
|
|
138
141
|
isStructuredSchema: function () {
|
|
139
|
-
return
|
|
142
|
+
return X;
|
|
140
143
|
},
|
|
141
144
|
isTimeStr: function () {
|
|
142
|
-
return
|
|
145
|
+
return N;
|
|
143
146
|
},
|
|
144
147
|
isURL: function () {
|
|
145
|
-
return
|
|
148
|
+
return j;
|
|
146
149
|
},
|
|
147
150
|
json2schema: function () {
|
|
148
|
-
return
|
|
151
|
+
return I;
|
|
149
152
|
},
|
|
150
153
|
json2treeData: function () {
|
|
151
|
-
return
|
|
154
|
+
return pe;
|
|
152
155
|
},
|
|
153
156
|
keyRoute2indexRoute: function () {
|
|
154
|
-
return
|
|
157
|
+
return d;
|
|
155
158
|
},
|
|
156
159
|
metaElemAnalyzer: function () {
|
|
157
160
|
return M;
|
|
158
161
|
},
|
|
159
162
|
moveBackward: function () {
|
|
160
|
-
return
|
|
163
|
+
return G;
|
|
161
164
|
},
|
|
162
165
|
moveForward: function () {
|
|
163
|
-
return
|
|
166
|
+
return Q;
|
|
164
167
|
},
|
|
165
168
|
objClone: function () {
|
|
166
|
-
return
|
|
169
|
+
return a;
|
|
167
170
|
},
|
|
168
171
|
oldSchemaToNewSchema: function () {
|
|
169
|
-
return
|
|
172
|
+
return A;
|
|
170
173
|
},
|
|
171
174
|
oldSchemaToNewSchemaV1: function () {
|
|
172
|
-
return
|
|
175
|
+
return _;
|
|
173
176
|
},
|
|
174
177
|
registerExpectType: function () {
|
|
175
|
-
return
|
|
178
|
+
return V;
|
|
179
|
+
},
|
|
180
|
+
schema2conditionValue: function () {
|
|
181
|
+
return ue;
|
|
176
182
|
},
|
|
177
183
|
schema2json: function () {
|
|
178
184
|
return ie;
|
|
179
185
|
},
|
|
180
186
|
schemaMetaList: function () {
|
|
181
|
-
return
|
|
187
|
+
return le;
|
|
182
188
|
},
|
|
183
189
|
truncate: function () {
|
|
184
|
-
return
|
|
190
|
+
return n;
|
|
185
191
|
},
|
|
186
192
|
});
|
|
187
193
|
var r = require('lodash');
|
|
188
|
-
function
|
|
194
|
+
function a(e) {
|
|
189
195
|
return (0, r.cloneDeep)(e);
|
|
190
196
|
}
|
|
191
|
-
function
|
|
197
|
+
function i(e, t) {
|
|
192
198
|
return (0, r.isEqual)(e, t);
|
|
193
199
|
}
|
|
194
|
-
function
|
|
200
|
+
function l(e) {
|
|
195
201
|
var t = !1;
|
|
196
202
|
return null != e && (t = !0), t;
|
|
197
203
|
}
|
|
198
|
-
function
|
|
204
|
+
function n(e, t) {
|
|
199
205
|
return (0, r.truncate)(e, t);
|
|
200
206
|
}
|
|
201
|
-
function
|
|
202
|
-
|
|
203
|
-
if ((r && (n = i(t)), e))
|
|
204
|
-
for (var a = e.split('-'), o = 0, l = a.length; o < l; o++) {
|
|
205
|
-
var p = a[o];
|
|
206
|
-
p && (n = n && n[p]);
|
|
207
|
-
}
|
|
208
|
-
return n;
|
|
207
|
+
function o(e, t) {
|
|
208
|
+
return new Function('data', 'with(data) { return (' + e + ');}')(t);
|
|
209
209
|
}
|
|
210
210
|
function p(e, t, r) {
|
|
211
|
-
var
|
|
212
|
-
if ((r && (
|
|
213
|
-
for (var
|
|
214
|
-
var p =
|
|
211
|
+
var i = t;
|
|
212
|
+
if ((r && (i = a(t)), e))
|
|
213
|
+
for (var l = e.split('-'), n = 0, o = l.length; n < o; n++) {
|
|
214
|
+
var p = l[n];
|
|
215
|
+
p && (i = i && i[p]);
|
|
216
|
+
}
|
|
217
|
+
return i;
|
|
218
|
+
}
|
|
219
|
+
function u(e, t, r) {
|
|
220
|
+
var i = t;
|
|
221
|
+
if ((r && (i = a(t)), e))
|
|
222
|
+
for (var l = e.split('-'), n = 0, o = l.length; n < o; n++) {
|
|
223
|
+
var p = l[n];
|
|
215
224
|
if (
|
|
216
225
|
'0' !== p ||
|
|
217
|
-
('array' !==
|
|
218
|
-
'radio' !==
|
|
219
|
-
'select' !==
|
|
220
|
-
'checkboxes' !==
|
|
221
|
-
(!
|
|
226
|
+
('array' !== i.type &&
|
|
227
|
+
'radio' !== i.type &&
|
|
228
|
+
'select' !== i.type &&
|
|
229
|
+
'checkboxes' !== i.type) ||
|
|
230
|
+
(!i.options && !i.items)
|
|
222
231
|
) {
|
|
223
232
|
if (p) {
|
|
224
233
|
var u = '0';
|
|
225
|
-
|
|
226
|
-
? (u =
|
|
227
|
-
:
|
|
228
|
-
(
|
|
234
|
+
i.propertyOrder
|
|
235
|
+
? (u = i.propertyOrder[p])
|
|
236
|
+
: i.properties && (u = Object.keys(i.properties)[p]),
|
|
237
|
+
(i = i.properties[u]);
|
|
229
238
|
}
|
|
230
|
-
} else
|
|
239
|
+
} else i = i.options || i.items;
|
|
231
240
|
}
|
|
232
|
-
return
|
|
241
|
+
return i;
|
|
233
242
|
}
|
|
234
|
-
function
|
|
235
|
-
var
|
|
236
|
-
if ((r && (
|
|
237
|
-
for (var
|
|
238
|
-
var p =
|
|
239
|
-
p &&
|
|
243
|
+
function c(e, t, r) {
|
|
244
|
+
var i = t;
|
|
245
|
+
if ((r && (i = a(t)), e && i))
|
|
246
|
+
for (var l = e.split('-'), n = 0, o = l.length; n < o; n++) {
|
|
247
|
+
var p = l[n];
|
|
248
|
+
p && i.properties && (i = i.properties[p]);
|
|
240
249
|
}
|
|
241
|
-
return
|
|
250
|
+
return i;
|
|
242
251
|
}
|
|
243
|
-
function
|
|
252
|
+
function s(e, t) {
|
|
244
253
|
for (
|
|
245
|
-
var r = t,
|
|
246
|
-
|
|
247
|
-
|
|
254
|
+
var r = t, a = '', i = e.split('-'), l = 0, n = i.length;
|
|
255
|
+
l < n;
|
|
256
|
+
l++
|
|
248
257
|
) {
|
|
249
|
-
var
|
|
250
|
-
if ('0' ===
|
|
251
|
-
(r = r.items), (
|
|
252
|
-
else if ('0' ===
|
|
253
|
-
(r = r.options), (
|
|
254
|
-
else if (
|
|
258
|
+
var o = i[l];
|
|
259
|
+
if ('0' === o && r.items)
|
|
260
|
+
(r = r.items), (a = a ? a + '-items' : 'items');
|
|
261
|
+
else if ('0' === o && r.options)
|
|
262
|
+
(r = r.options), (a = a ? a + '-options' : 'options');
|
|
263
|
+
else if (o) {
|
|
255
264
|
var p = '0';
|
|
256
265
|
r.propertyOrder
|
|
257
|
-
? (p = r.propertyOrder[
|
|
258
|
-
: r.properties && (p = Object.keys(r.properties)[
|
|
266
|
+
? (p = r.propertyOrder[o])
|
|
267
|
+
: r.properties && (p = Object.keys(r.properties)[o]),
|
|
259
268
|
(r = r.properties[p]),
|
|
260
|
-
(
|
|
269
|
+
(a = a ? a + '-' + p : p);
|
|
261
270
|
}
|
|
262
271
|
}
|
|
263
|
-
return
|
|
272
|
+
return a;
|
|
264
273
|
}
|
|
265
|
-
function
|
|
274
|
+
function d(e, t) {
|
|
266
275
|
for (
|
|
267
|
-
var r = t,
|
|
268
|
-
|
|
269
|
-
|
|
276
|
+
var r = t, a = '', i = e.split('-'), l = 0, n = i.length;
|
|
277
|
+
l < n;
|
|
278
|
+
l++
|
|
270
279
|
) {
|
|
271
|
-
var
|
|
272
|
-
if (
|
|
280
|
+
var o = i[l];
|
|
281
|
+
if (o) {
|
|
273
282
|
var p = -1;
|
|
274
283
|
r.propertyOrder
|
|
275
|
-
? ((p = r.propertyOrder.indexOf(
|
|
284
|
+
? ((p = r.propertyOrder.indexOf(o)), (r = r.properties[o]))
|
|
276
285
|
: r.properties
|
|
277
|
-
? ((p = Object.keys(r.properties).indexOf(
|
|
278
|
-
(r = r.properties[
|
|
286
|
+
? ((p = Object.keys(r.properties).indexOf(o)),
|
|
287
|
+
(r = r.properties[o]))
|
|
279
288
|
: r.items
|
|
280
289
|
? ((p = 0), (r = r.items))
|
|
281
290
|
: r.options && ((p = 0), (r = r.options)),
|
|
282
|
-
(
|
|
291
|
+
(a = a ? a + '-' + p : p.toString());
|
|
283
292
|
}
|
|
284
293
|
}
|
|
285
|
-
return
|
|
294
|
+
return a;
|
|
286
295
|
}
|
|
287
|
-
var
|
|
296
|
+
var y,
|
|
288
297
|
f = {
|
|
289
298
|
type: 'event',
|
|
290
299
|
title: '事件',
|
|
@@ -315,7 +324,7 @@
|
|
|
315
324
|
},
|
|
316
325
|
propertyOrder: ['type', 'trigger', 'eventData'],
|
|
317
326
|
},
|
|
318
|
-
|
|
327
|
+
b = {
|
|
319
328
|
type: 'datasource',
|
|
320
329
|
title: '数据源',
|
|
321
330
|
isContainer: !1,
|
|
@@ -347,11 +356,11 @@
|
|
|
347
356
|
},
|
|
348
357
|
propertyOrder: ['type', 'data', 'filter'],
|
|
349
358
|
},
|
|
350
|
-
|
|
351
|
-
(((
|
|
352
|
-
(
|
|
353
|
-
(
|
|
354
|
-
(
|
|
359
|
+
v =
|
|
360
|
+
(((y = { type: 'object' }).type = 'datasource'),
|
|
361
|
+
(y.title = '数据源'),
|
|
362
|
+
(y.isContainer = !1),
|
|
363
|
+
(y.properties = {
|
|
355
364
|
type: {
|
|
356
365
|
type: 'select',
|
|
357
366
|
default: 'remote',
|
|
@@ -377,15 +386,15 @@
|
|
|
377
386
|
isRequired: !0,
|
|
378
387
|
},
|
|
379
388
|
}),
|
|
380
|
-
(
|
|
381
|
-
|
|
382
|
-
|
|
389
|
+
(y.propertyOrder = ['type', 'data', 'filter']),
|
|
390
|
+
y),
|
|
391
|
+
m = {
|
|
383
392
|
type: 'local',
|
|
384
393
|
config: { dataName: '', body: {}, filter: 'return data;' },
|
|
385
394
|
data: '{}',
|
|
386
395
|
localFilter: 'return data;',
|
|
387
396
|
},
|
|
388
|
-
|
|
397
|
+
g = {
|
|
389
398
|
jsonschema: {
|
|
390
399
|
type: 'object',
|
|
391
400
|
title: 'jsonSchemaObject',
|
|
@@ -472,7 +481,6 @@
|
|
|
472
481
|
type: 'array',
|
|
473
482
|
title: '数组Array',
|
|
474
483
|
description: '',
|
|
475
|
-
default: [],
|
|
476
484
|
items: {
|
|
477
485
|
type: 'object',
|
|
478
486
|
title: '数组项',
|
|
@@ -746,7 +754,7 @@
|
|
|
746
754
|
},
|
|
747
755
|
propertyOrder: ['type', 'config', 'data', 'localFilter'],
|
|
748
756
|
},
|
|
749
|
-
datasource:
|
|
757
|
+
datasource: b,
|
|
750
758
|
event: f,
|
|
751
759
|
'dynamic-config': {
|
|
752
760
|
type: 'dynamic-config',
|
|
@@ -775,6 +783,8 @@
|
|
|
775
783
|
default: '',
|
|
776
784
|
description: '',
|
|
777
785
|
placeholder: '',
|
|
786
|
+
onShow:
|
|
787
|
+
'type === "DevDefaults" || type === "Content" || type === "RuntimeConst"',
|
|
778
788
|
},
|
|
779
789
|
description: {
|
|
780
790
|
title: '属性名称',
|
|
@@ -782,6 +792,8 @@
|
|
|
782
792
|
default: '',
|
|
783
793
|
description: '',
|
|
784
794
|
placeholder: '',
|
|
795
|
+
onShow:
|
|
796
|
+
'type === "ContentStaticConfig" || type === "ResourceCenter"',
|
|
785
797
|
},
|
|
786
798
|
valueType: {
|
|
787
799
|
type: 'radio',
|
|
@@ -793,12 +805,16 @@
|
|
|
793
805
|
default: 'string',
|
|
794
806
|
isConditionProp: !0,
|
|
795
807
|
description: '',
|
|
808
|
+
onShow:
|
|
809
|
+
'type === "ContentStaticConfig" || type === "ResourceCenter"',
|
|
796
810
|
},
|
|
797
811
|
range: {
|
|
798
812
|
type: 'select',
|
|
799
813
|
title: '可选项',
|
|
800
814
|
multiple: !0,
|
|
801
815
|
options: [],
|
|
816
|
+
onShow:
|
|
817
|
+
'(type === "ContentStaticConfig" || type === "ResourceCenter") && valueType === "select"',
|
|
802
818
|
description: '这里会使用value中的配置选项作为options',
|
|
803
819
|
},
|
|
804
820
|
},
|
|
@@ -839,6 +855,7 @@
|
|
|
839
855
|
default: '',
|
|
840
856
|
description: '',
|
|
841
857
|
placeholder: '',
|
|
858
|
+
onShow: 'type === "ContentStaticConfig"',
|
|
842
859
|
},
|
|
843
860
|
dataType: {
|
|
844
861
|
type: 'radio',
|
|
@@ -856,6 +873,7 @@
|
|
|
856
873
|
default: '',
|
|
857
874
|
description: '',
|
|
858
875
|
placeholder: '',
|
|
876
|
+
onShow: 'type === "RuntimeDataSelfDefine"',
|
|
859
877
|
},
|
|
860
878
|
CONTENTTYPE: {
|
|
861
879
|
type: 'select',
|
|
@@ -866,6 +884,7 @@
|
|
|
866
884
|
{ label: 'block', value: 'block' },
|
|
867
885
|
],
|
|
868
886
|
description: '',
|
|
887
|
+
onShow: 'type === "RuntimeDataSelfDefine"',
|
|
869
888
|
},
|
|
870
889
|
},
|
|
871
890
|
propertyOrder: [
|
|
@@ -1088,8 +1107,285 @@
|
|
|
1088
1107
|
},
|
|
1089
1108
|
propertyOrder: ['globalEventMap', 'event'],
|
|
1090
1109
|
},
|
|
1110
|
+
'sohu-ad': {
|
|
1111
|
+
type: 'object',
|
|
1112
|
+
title: '广告配置',
|
|
1113
|
+
description: '',
|
|
1114
|
+
properties: {
|
|
1115
|
+
type: {
|
|
1116
|
+
type: 'select',
|
|
1117
|
+
title: '数据源类型',
|
|
1118
|
+
isConditionProp: !0,
|
|
1119
|
+
options: [
|
|
1120
|
+
{ label: '模板直接设置', value: 'DevDefaults' },
|
|
1121
|
+
{ label: '资源中心配置', value: 'ResourceCenter' },
|
|
1122
|
+
],
|
|
1123
|
+
description: '',
|
|
1124
|
+
},
|
|
1125
|
+
value: {
|
|
1126
|
+
type: 'object',
|
|
1127
|
+
title: '广告规则',
|
|
1128
|
+
description: '',
|
|
1129
|
+
onShow: 'type === "DevDefaults"',
|
|
1130
|
+
properties: {
|
|
1131
|
+
id: {
|
|
1132
|
+
title: '广告ID',
|
|
1133
|
+
type: 'input',
|
|
1134
|
+
default: '',
|
|
1135
|
+
description: '',
|
|
1136
|
+
placeholder: '',
|
|
1137
|
+
},
|
|
1138
|
+
rule: {
|
|
1139
|
+
type: 'radio',
|
|
1140
|
+
title: '规则类型',
|
|
1141
|
+
options: [
|
|
1142
|
+
{ label: '固定位置', value: 1 },
|
|
1143
|
+
{ label: '隔几出几', value: 2 },
|
|
1144
|
+
{ label: '固定位置隔几出几', value: 3 },
|
|
1145
|
+
],
|
|
1146
|
+
default: 1,
|
|
1147
|
+
description: '',
|
|
1148
|
+
},
|
|
1149
|
+
fixArray: {
|
|
1150
|
+
type: 'select',
|
|
1151
|
+
title: '固定位置',
|
|
1152
|
+
default: 1,
|
|
1153
|
+
description: '',
|
|
1154
|
+
options: [
|
|
1155
|
+
{ label: '1', value: 1 },
|
|
1156
|
+
{ label: '2', value: 2 },
|
|
1157
|
+
{ label: '3', value: 3 },
|
|
1158
|
+
{ label: '4', value: 4 },
|
|
1159
|
+
{ label: '5', value: 5 },
|
|
1160
|
+
{ label: '6', value: 6 },
|
|
1161
|
+
{ label: '7', value: 7 },
|
|
1162
|
+
{ label: '8', value: 8 },
|
|
1163
|
+
{ label: '9', value: 9 },
|
|
1164
|
+
{ label: '10', value: 10 },
|
|
1165
|
+
{ label: '11', value: 11 },
|
|
1166
|
+
{ label: '12', value: 12 },
|
|
1167
|
+
{ label: '13', value: 13 },
|
|
1168
|
+
{ label: '14', value: 14 },
|
|
1169
|
+
{ label: '15', value: 15 },
|
|
1170
|
+
{ label: '16', value: 16 },
|
|
1171
|
+
{ label: '17', value: 17 },
|
|
1172
|
+
{ label: '18', value: 18 },
|
|
1173
|
+
{ label: '19', value: 19 },
|
|
1174
|
+
{ label: '20', value: 20 },
|
|
1175
|
+
{ label: '21', value: 21 },
|
|
1176
|
+
{ label: '22', value: 22 },
|
|
1177
|
+
{ label: '23', value: 23 },
|
|
1178
|
+
{ label: '24', value: 24 },
|
|
1179
|
+
{ label: '25', value: 25 },
|
|
1180
|
+
{ label: '26', value: 26 },
|
|
1181
|
+
{ label: '27', value: 27 },
|
|
1182
|
+
{ label: '28', value: 28 },
|
|
1183
|
+
{ label: '29', value: 29 },
|
|
1184
|
+
{ label: '30', value: 30 },
|
|
1185
|
+
{ label: '31', value: 31 },
|
|
1186
|
+
{ label: '32', value: 32 },
|
|
1187
|
+
{ label: '33', value: 33 },
|
|
1188
|
+
{ label: '34', value: 34 },
|
|
1189
|
+
{ label: '35', value: 35 },
|
|
1190
|
+
{ label: '36', value: 36 },
|
|
1191
|
+
{ label: '37', value: 37 },
|
|
1192
|
+
{ label: '38', value: 38 },
|
|
1193
|
+
{ label: '39', value: 39 },
|
|
1194
|
+
{ label: '40', value: 40 },
|
|
1195
|
+
{ label: '41', value: 41 },
|
|
1196
|
+
{ label: '42', value: 42 },
|
|
1197
|
+
{ label: '43', value: 43 },
|
|
1198
|
+
{ label: '44', value: 44 },
|
|
1199
|
+
{ label: '45', value: 45 },
|
|
1200
|
+
{ label: '46', value: 46 },
|
|
1201
|
+
{ label: '47', value: 47 },
|
|
1202
|
+
{ label: '48', value: 48 },
|
|
1203
|
+
{ label: '49', value: 49 },
|
|
1204
|
+
{ label: '50', value: 50 },
|
|
1205
|
+
],
|
|
1206
|
+
},
|
|
1207
|
+
begin: {
|
|
1208
|
+
type: 'number',
|
|
1209
|
+
title: '开始位置',
|
|
1210
|
+
default: 1,
|
|
1211
|
+
minimum: '1',
|
|
1212
|
+
maximum: '50',
|
|
1213
|
+
description: '',
|
|
1214
|
+
},
|
|
1215
|
+
turn: {
|
|
1216
|
+
type: 'number',
|
|
1217
|
+
title: '间隔/隔',
|
|
1218
|
+
default: 1,
|
|
1219
|
+
minimum: '1',
|
|
1220
|
+
maximum: '50',
|
|
1221
|
+
description: '',
|
|
1222
|
+
},
|
|
1223
|
+
number: {
|
|
1224
|
+
type: 'number',
|
|
1225
|
+
title: '间隔/出',
|
|
1226
|
+
default: 1,
|
|
1227
|
+
minimum: '1',
|
|
1228
|
+
maximum: '50',
|
|
1229
|
+
description: '',
|
|
1230
|
+
},
|
|
1231
|
+
mergeType: {
|
|
1232
|
+
type: 'radio',
|
|
1233
|
+
title: '插入规则',
|
|
1234
|
+
options: [
|
|
1235
|
+
{ label: '覆盖', value: 0 },
|
|
1236
|
+
{ label: '插入', value: 1 },
|
|
1237
|
+
],
|
|
1238
|
+
default: 0,
|
|
1239
|
+
description: '',
|
|
1240
|
+
},
|
|
1241
|
+
},
|
|
1242
|
+
propertyOrder: [
|
|
1243
|
+
'id',
|
|
1244
|
+
'rule',
|
|
1245
|
+
'fixArray',
|
|
1246
|
+
'begin',
|
|
1247
|
+
'turn',
|
|
1248
|
+
'number',
|
|
1249
|
+
'mergeType',
|
|
1250
|
+
],
|
|
1251
|
+
},
|
|
1252
|
+
range: {
|
|
1253
|
+
type: 'array',
|
|
1254
|
+
title: '广告规则列表',
|
|
1255
|
+
description: '',
|
|
1256
|
+
onShow: 'type === "ResourceCenter"',
|
|
1257
|
+
items: {
|
|
1258
|
+
type: 'object',
|
|
1259
|
+
title: '数组项',
|
|
1260
|
+
description: '',
|
|
1261
|
+
properties: {
|
|
1262
|
+
id: {
|
|
1263
|
+
title: '广告ID',
|
|
1264
|
+
type: 'input',
|
|
1265
|
+
default: '',
|
|
1266
|
+
description: '',
|
|
1267
|
+
placeholder: '',
|
|
1268
|
+
},
|
|
1269
|
+
rule: {
|
|
1270
|
+
type: 'radio',
|
|
1271
|
+
title: '规则类型',
|
|
1272
|
+
options: [
|
|
1273
|
+
{ label: '固定位置', value: 1 },
|
|
1274
|
+
{ label: '隔几出几', value: 2 },
|
|
1275
|
+
{ label: '固定位置隔几出几', value: 3 },
|
|
1276
|
+
],
|
|
1277
|
+
default: 1,
|
|
1278
|
+
description: '',
|
|
1279
|
+
},
|
|
1280
|
+
fixArray: {
|
|
1281
|
+
type: 'select',
|
|
1282
|
+
title: '固定位置',
|
|
1283
|
+
default: 1,
|
|
1284
|
+
description: '',
|
|
1285
|
+
options: [
|
|
1286
|
+
{ label: '1', value: 1 },
|
|
1287
|
+
{ label: '2', value: 2 },
|
|
1288
|
+
{ label: '3', value: 3 },
|
|
1289
|
+
{ label: '4', value: 4 },
|
|
1290
|
+
{ label: '5', value: 5 },
|
|
1291
|
+
{ label: '6', value: 6 },
|
|
1292
|
+
{ label: '7', value: 7 },
|
|
1293
|
+
{ label: '8', value: 8 },
|
|
1294
|
+
{ label: '9', value: 9 },
|
|
1295
|
+
{ label: '10', value: 10 },
|
|
1296
|
+
{ label: '11', value: 11 },
|
|
1297
|
+
{ label: '12', value: 12 },
|
|
1298
|
+
{ label: '13', value: 13 },
|
|
1299
|
+
{ label: '14', value: 14 },
|
|
1300
|
+
{ label: '15', value: 15 },
|
|
1301
|
+
{ label: '16', value: 16 },
|
|
1302
|
+
{ label: '17', value: 17 },
|
|
1303
|
+
{ label: '18', value: 18 },
|
|
1304
|
+
{ label: '19', value: 19 },
|
|
1305
|
+
{ label: '20', value: 20 },
|
|
1306
|
+
{ label: '21', value: 21 },
|
|
1307
|
+
{ label: '22', value: 22 },
|
|
1308
|
+
{ label: '23', value: 23 },
|
|
1309
|
+
{ label: '24', value: 24 },
|
|
1310
|
+
{ label: '25', value: 25 },
|
|
1311
|
+
{ label: '26', value: 26 },
|
|
1312
|
+
{ label: '27', value: 27 },
|
|
1313
|
+
{ label: '28', value: 28 },
|
|
1314
|
+
{ label: '29', value: 29 },
|
|
1315
|
+
{ label: '30', value: 30 },
|
|
1316
|
+
{ label: '31', value: 31 },
|
|
1317
|
+
{ label: '32', value: 32 },
|
|
1318
|
+
{ label: '33', value: 33 },
|
|
1319
|
+
{ label: '34', value: 34 },
|
|
1320
|
+
{ label: '35', value: 35 },
|
|
1321
|
+
{ label: '36', value: 36 },
|
|
1322
|
+
{ label: '37', value: 37 },
|
|
1323
|
+
{ label: '38', value: 38 },
|
|
1324
|
+
{ label: '39', value: 39 },
|
|
1325
|
+
{ label: '40', value: 40 },
|
|
1326
|
+
{ label: '41', value: 41 },
|
|
1327
|
+
{ label: '42', value: 42 },
|
|
1328
|
+
{ label: '43', value: 43 },
|
|
1329
|
+
{ label: '44', value: 44 },
|
|
1330
|
+
{ label: '45', value: 45 },
|
|
1331
|
+
{ label: '46', value: 46 },
|
|
1332
|
+
{ label: '47', value: 47 },
|
|
1333
|
+
{ label: '48', value: 48 },
|
|
1334
|
+
{ label: '49', value: 49 },
|
|
1335
|
+
{ label: '50', value: 50 },
|
|
1336
|
+
],
|
|
1337
|
+
},
|
|
1338
|
+
begin: {
|
|
1339
|
+
type: 'number',
|
|
1340
|
+
title: '开始位置',
|
|
1341
|
+
default: 1,
|
|
1342
|
+
minimum: '1',
|
|
1343
|
+
maximum: '50',
|
|
1344
|
+
description: '',
|
|
1345
|
+
},
|
|
1346
|
+
turn: {
|
|
1347
|
+
type: 'number',
|
|
1348
|
+
title: '间隔/隔',
|
|
1349
|
+
default: 1,
|
|
1350
|
+
minimum: '1',
|
|
1351
|
+
maximum: '50',
|
|
1352
|
+
description: '',
|
|
1353
|
+
},
|
|
1354
|
+
number: {
|
|
1355
|
+
type: 'number',
|
|
1356
|
+
title: '间隔/出',
|
|
1357
|
+
default: 1,
|
|
1358
|
+
minimum: '1',
|
|
1359
|
+
maximum: '50',
|
|
1360
|
+
description: '',
|
|
1361
|
+
},
|
|
1362
|
+
mergeType: {
|
|
1363
|
+
type: 'radio',
|
|
1364
|
+
title: '插入规则',
|
|
1365
|
+
options: [
|
|
1366
|
+
{ label: '覆盖', value: 0 },
|
|
1367
|
+
{ label: '插入', value: 1 },
|
|
1368
|
+
],
|
|
1369
|
+
default: 0,
|
|
1370
|
+
description: '',
|
|
1371
|
+
},
|
|
1372
|
+
},
|
|
1373
|
+
propertyOrder: [
|
|
1374
|
+
'id',
|
|
1375
|
+
'rule',
|
|
1376
|
+
'fixArray',
|
|
1377
|
+
'begin',
|
|
1378
|
+
'turn',
|
|
1379
|
+
'number',
|
|
1380
|
+
'mergeType',
|
|
1381
|
+
],
|
|
1382
|
+
},
|
|
1383
|
+
},
|
|
1384
|
+
},
|
|
1385
|
+
propertyOrder: ['type', 'value', 'range'],
|
|
1386
|
+
},
|
|
1091
1387
|
},
|
|
1092
|
-
|
|
1388
|
+
h = {
|
|
1093
1389
|
on: {
|
|
1094
1390
|
type: 'event',
|
|
1095
1391
|
title: '事件',
|
|
@@ -1122,47 +1418,47 @@
|
|
|
1122
1418
|
},
|
|
1123
1419
|
emit: f,
|
|
1124
1420
|
},
|
|
1125
|
-
|
|
1126
|
-
function
|
|
1421
|
+
O = { local: b, remote: v };
|
|
1422
|
+
function j(e) {
|
|
1127
1423
|
return /^http[s]?:\/\/.*/.test(e);
|
|
1128
1424
|
}
|
|
1129
|
-
function
|
|
1425
|
+
function C(e) {
|
|
1130
1426
|
return 'String' === Object.prototype.toString.call(e).slice(8, -1);
|
|
1131
1427
|
}
|
|
1132
|
-
function
|
|
1428
|
+
function x(e) {
|
|
1133
1429
|
return (
|
|
1134
1430
|
'number' == typeof e ||
|
|
1135
1431
|
'[object Number]' === Object.prototype.toString.call(e)
|
|
1136
1432
|
);
|
|
1137
1433
|
}
|
|
1138
|
-
function
|
|
1434
|
+
function S(e) {
|
|
1139
1435
|
return 'Boolean' === Object.prototype.toString.call(e).slice(8, -1);
|
|
1140
1436
|
}
|
|
1141
1437
|
function T(e) {
|
|
1142
1438
|
return /^\d{4}-\d{2}-\d{2}$/.test(e);
|
|
1143
1439
|
}
|
|
1144
|
-
function
|
|
1440
|
+
function D(e) {
|
|
1145
1441
|
return (
|
|
1146
1442
|
/^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}$/.test(e) ||
|
|
1147
1443
|
/^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}$/.test(e)
|
|
1148
1444
|
);
|
|
1149
1445
|
}
|
|
1150
|
-
function
|
|
1446
|
+
function N(e) {
|
|
1151
1447
|
return /^\d{2}:\d{2}:\d{2}$/.test(e) || /^\d{2}:\d{2}$/.test(e);
|
|
1152
1448
|
}
|
|
1153
|
-
function
|
|
1449
|
+
function R(e) {
|
|
1154
1450
|
var t = !1;
|
|
1155
1451
|
return (
|
|
1156
1452
|
'Array' === Object.prototype.toString.call(e).slice(8, -1) && (t = !0),
|
|
1157
1453
|
t
|
|
1158
1454
|
);
|
|
1159
1455
|
}
|
|
1160
|
-
function
|
|
1161
|
-
if (!
|
|
1162
|
-
for (var t = 0, r = e.length; t < r; t++) if (!
|
|
1456
|
+
function w(e) {
|
|
1457
|
+
if (!R(e)) return !1;
|
|
1458
|
+
for (var t = 0, r = e.length; t < r; t++) if (!C(e[t])) return !1;
|
|
1163
1459
|
return !0;
|
|
1164
1460
|
}
|
|
1165
|
-
function
|
|
1461
|
+
function E(e) {
|
|
1166
1462
|
var t = !1;
|
|
1167
1463
|
return (
|
|
1168
1464
|
'Object' === Object.prototype.toString.call(e).slice(8, -1) && (t = !0),
|
|
@@ -1171,7 +1467,7 @@
|
|
|
1171
1467
|
}
|
|
1172
1468
|
function k(e) {
|
|
1173
1469
|
var t = !1;
|
|
1174
|
-
return
|
|
1470
|
+
return g.quantity.properties.quantity.enum.indexOf(e) >= 0 && (t = !0), t;
|
|
1175
1471
|
}
|
|
1176
1472
|
function q(e) {
|
|
1177
1473
|
return /^#[0-9a-f]{6}$/.test(e) || /^#[0-9a-f]{3}$/.test(e);
|
|
@@ -1184,79 +1480,79 @@
|
|
|
1184
1480
|
t
|
|
1185
1481
|
);
|
|
1186
1482
|
}
|
|
1187
|
-
function
|
|
1483
|
+
function I(e) {
|
|
1188
1484
|
var t;
|
|
1189
1485
|
return (
|
|
1190
1486
|
(t =
|
|
1191
|
-
e &&
|
|
1487
|
+
e && E(e)
|
|
1192
1488
|
? (function (e) {
|
|
1193
1489
|
var t;
|
|
1194
|
-
if (
|
|
1490
|
+
if (E(e)) {
|
|
1195
1491
|
var r = Object.keys(e);
|
|
1196
1492
|
e.data && e.filter && 2 === r.length
|
|
1197
|
-
? (t =
|
|
1493
|
+
? (t = R(e.data) || E(e.data) ? a(O.local) : a(O.remote))
|
|
1198
1494
|
: e.trigger && e.eventData && 2 === r.length
|
|
1199
|
-
? (t =
|
|
1495
|
+
? (t = a(h.emit))
|
|
1200
1496
|
: e.register && e.actionFunc && 2 === r.length
|
|
1201
|
-
? (t =
|
|
1497
|
+
? (t = a(h.on))
|
|
1202
1498
|
: e.quantity && k(e.quantity) && 2 === r.length
|
|
1203
|
-
? (t =
|
|
1204
|
-
: ((t =
|
|
1499
|
+
? (t = a(g.quantity))
|
|
1500
|
+
: ((t = a(g['empty-object'])),
|
|
1205
1501
|
Object.keys(e).map(function (r) {
|
|
1206
|
-
var
|
|
1207
|
-
t.properties[r] =
|
|
1502
|
+
var a = e[r];
|
|
1503
|
+
t.properties[r] = I(a);
|
|
1208
1504
|
}));
|
|
1209
1505
|
}
|
|
1210
1506
|
return t;
|
|
1211
1507
|
})(e)
|
|
1212
|
-
: e &&
|
|
1508
|
+
: e && R(e)
|
|
1213
1509
|
? (function (e) {
|
|
1214
1510
|
var t;
|
|
1215
|
-
if (e &&
|
|
1216
|
-
if (
|
|
1217
|
-
(t =
|
|
1511
|
+
if (e && R(e))
|
|
1512
|
+
if (w(e)) {
|
|
1513
|
+
(t = a(g.select)).items.enum = e;
|
|
1218
1514
|
var r = t.items.enumextra.length,
|
|
1219
|
-
|
|
1220
|
-
if (
|
|
1221
|
-
for (var
|
|
1222
|
-
t.items.enumextra.push('选项' + e(
|
|
1515
|
+
i = e.length;
|
|
1516
|
+
if (i > r)
|
|
1517
|
+
for (var l = r, n = i; l < n; l++)
|
|
1518
|
+
t.items.enumextra.push('选项' + e(l));
|
|
1223
1519
|
} else {
|
|
1224
|
-
t =
|
|
1225
|
-
var
|
|
1226
|
-
t.items.properties =
|
|
1520
|
+
t = a(g['empty-array']);
|
|
1521
|
+
var o = I(e[0]);
|
|
1522
|
+
t.items.properties = o.properties;
|
|
1227
1523
|
}
|
|
1228
1524
|
return t;
|
|
1229
1525
|
})(e)
|
|
1230
1526
|
: (function (e) {
|
|
1231
1527
|
var t = '';
|
|
1232
|
-
if (
|
|
1233
|
-
else if (
|
|
1234
|
-
else if (
|
|
1235
|
-
else if (T(e)) t =
|
|
1236
|
-
else if (
|
|
1237
|
-
else if (
|
|
1238
|
-
else if (q(e)) t =
|
|
1528
|
+
if (S(e)) t = a(g.boolean);
|
|
1529
|
+
else if (x(e)) t = a(g.number);
|
|
1530
|
+
else if (j(e)) t = a(g.url);
|
|
1531
|
+
else if (T(e)) t = a(g.date);
|
|
1532
|
+
else if (D(e)) t = a(g['date-time']);
|
|
1533
|
+
else if (N(e)) t = a(g.time);
|
|
1534
|
+
else if (q(e)) t = a(g.color);
|
|
1239
1535
|
else
|
|
1240
1536
|
try {
|
|
1241
|
-
t =
|
|
1537
|
+
t = x(JSON.parse(e)) ? a(g.input) : a(g.json);
|
|
1242
1538
|
} catch (r) {
|
|
1243
|
-
t = e && e.length > 30 ?
|
|
1539
|
+
t = e && e.length > 30 ? a(g.textarea) : a(g.input);
|
|
1244
1540
|
}
|
|
1245
1541
|
return t;
|
|
1246
1542
|
})(e)),
|
|
1247
1543
|
t
|
|
1248
1544
|
);
|
|
1249
1545
|
}
|
|
1250
|
-
function
|
|
1546
|
+
function P(e, t) {
|
|
1251
1547
|
var r = t || {};
|
|
1252
1548
|
return (
|
|
1253
|
-
|
|
1549
|
+
E(e) &&
|
|
1254
1550
|
'object' === getExpectType(e.type) &&
|
|
1255
1551
|
e.properties &&
|
|
1256
1552
|
(e.propertyOrder ? e.propertyOrder : Object.keys(e.properties)).map(
|
|
1257
1553
|
function (t) {
|
|
1258
|
-
var
|
|
1259
|
-
r = M(
|
|
1554
|
+
var a = e.properties[t];
|
|
1555
|
+
r = M(a, r);
|
|
1260
1556
|
},
|
|
1261
1557
|
),
|
|
1262
1558
|
r
|
|
@@ -1264,23 +1560,23 @@
|
|
|
1264
1560
|
}
|
|
1265
1561
|
function M(e, t) {
|
|
1266
1562
|
var r = !t,
|
|
1267
|
-
|
|
1563
|
+
a = t || {};
|
|
1268
1564
|
if (e && '{}' !== JSON.stringify(e)) {
|
|
1269
|
-
var
|
|
1270
|
-
'object' ===
|
|
1271
|
-
? (!r &&
|
|
1272
|
-
(
|
|
1273
|
-
: 'array' ===
|
|
1274
|
-
? (!r &&
|
|
1275
|
-
(
|
|
1276
|
-
: !r && i
|
|
1277
|
-
? (i
|
|
1278
|
-
: r || (i
|
|
1565
|
+
var i = e.type;
|
|
1566
|
+
'object' === i || 'func' === i || 'style' === i || 'data' === i
|
|
1567
|
+
? (!r && a.object ? (a.object += 1) : r || (a.object = 1),
|
|
1568
|
+
(a = P(e, a)))
|
|
1569
|
+
: 'array' === i
|
|
1570
|
+
? (!r && a.array ? (a.array += 1) : r || (a.array = 1),
|
|
1571
|
+
(a = P((e = e.items), a)))
|
|
1572
|
+
: !r && a[i]
|
|
1573
|
+
? (a[i] += 1)
|
|
1574
|
+
: r || (a[i] = 1);
|
|
1279
1575
|
}
|
|
1280
|
-
return
|
|
1576
|
+
return a;
|
|
1281
1577
|
}
|
|
1282
|
-
function
|
|
1283
|
-
var t =
|
|
1578
|
+
function _(e) {
|
|
1579
|
+
var t = a(e);
|
|
1284
1580
|
if (
|
|
1285
1581
|
(!t.title && t.description && (t.title = t.description),
|
|
1286
1582
|
t.type || (t.type = t.format),
|
|
@@ -1289,7 +1585,7 @@
|
|
|
1289
1585
|
'datasource' !== t.type &&
|
|
1290
1586
|
'event' !== t.type &&
|
|
1291
1587
|
'object' !== t.type) ||
|
|
1292
|
-
!
|
|
1588
|
+
!l(t.default) ||
|
|
1293
1589
|
delete t.default,
|
|
1294
1590
|
'radio' === t.type &&
|
|
1295
1591
|
((t.type = 'string'),
|
|
@@ -1297,62 +1593,62 @@
|
|
|
1297
1593
|
t.enumextra &&
|
|
1298
1594
|
((t.items = {
|
|
1299
1595
|
type: 'string',
|
|
1300
|
-
enum:
|
|
1301
|
-
enumextra:
|
|
1596
|
+
enum: a(t.enum),
|
|
1597
|
+
enumextra: a(t.enumextra),
|
|
1302
1598
|
}),
|
|
1303
1599
|
delete t.enum,
|
|
1304
1600
|
delete t.enumextra)),
|
|
1305
1601
|
'quantity' === t.type)
|
|
1306
1602
|
) {
|
|
1307
1603
|
var r = t.properties,
|
|
1308
|
-
|
|
1309
|
-
if (r.quantity &&
|
|
1310
|
-
var
|
|
1311
|
-
|
|
1604
|
+
i = a(g.quantity);
|
|
1605
|
+
if (r.quantity && E(r.quantity) && r.quantity.default) {
|
|
1606
|
+
var n = r.quantity.default;
|
|
1607
|
+
i.properties.quantity.default = 'percent' === n ? '%' : n;
|
|
1312
1608
|
}
|
|
1313
|
-
t =
|
|
1609
|
+
t = i;
|
|
1314
1610
|
}
|
|
1315
1611
|
if ('datasource' === t.type) {
|
|
1316
|
-
var
|
|
1317
|
-
p =
|
|
1318
|
-
u =
|
|
1319
|
-
c =
|
|
1612
|
+
var o = t.properties,
|
|
1613
|
+
p = o.type && o.type.default,
|
|
1614
|
+
u = o.data && o.data.default,
|
|
1615
|
+
c = o.filter && o.filter.default;
|
|
1320
1616
|
'local' === p
|
|
1321
|
-
? ((t =
|
|
1322
|
-
: ((t =
|
|
1323
|
-
?
|
|
1617
|
+
? ((t = a(O.local)).properties.data.default = u ? a(u) : '{}')
|
|
1618
|
+
: ((t = a(O.remote)).properties.data.default = u
|
|
1619
|
+
? a(u)
|
|
1324
1620
|
: 'http://xxx'),
|
|
1325
|
-
(t.properties.filter.default = c ?
|
|
1621
|
+
(t.properties.filter.default = c ? a(c) : '() => {}');
|
|
1326
1622
|
}
|
|
1327
1623
|
if ('event' === t.type) {
|
|
1328
1624
|
var s = t.properties,
|
|
1329
1625
|
d = s.type && s.type.default;
|
|
1330
1626
|
if ('in' === d || 'on' === d) {
|
|
1331
|
-
var
|
|
1332
|
-
(t =
|
|
1627
|
+
var y = (s.filter && s.filter.default) || '() => {}';
|
|
1628
|
+
(t = a(h.on)),
|
|
1333
1629
|
s.actionFunc &&
|
|
1334
|
-
|
|
1335
|
-
(t.properties.actionFunc.default = s.actionFunc.default ||
|
|
1630
|
+
E(s.actionFunc) &&
|
|
1631
|
+
(t.properties.actionFunc.default = s.actionFunc.default || a(y));
|
|
1336
1632
|
} else {
|
|
1337
|
-
var
|
|
1338
|
-
(t =
|
|
1633
|
+
var f = (s.filter && s.filter.default) || '{}';
|
|
1634
|
+
(t = a(h.emit)),
|
|
1339
1635
|
s.eventData &&
|
|
1340
|
-
|
|
1341
|
-
(t.properties.eventData.default = s.eventData.default ||
|
|
1636
|
+
E(s.eventData) &&
|
|
1637
|
+
(t.properties.eventData.default = s.eventData.default || a(f));
|
|
1342
1638
|
}
|
|
1343
1639
|
}
|
|
1344
1640
|
return (
|
|
1345
1641
|
t.properties &&
|
|
1346
1642
|
(t.propertyOrder || (t.propertyOrder = Object.keys(t.properties)),
|
|
1347
1643
|
t.propertyOrder.map(function (e) {
|
|
1348
|
-
t.properties[e] =
|
|
1644
|
+
t.properties[e] = A(t.properties[e]);
|
|
1349
1645
|
})),
|
|
1350
|
-
t.items && (t.items =
|
|
1646
|
+
t.items && (t.items = A(t.items)),
|
|
1351
1647
|
t
|
|
1352
1648
|
);
|
|
1353
1649
|
}
|
|
1354
|
-
function
|
|
1355
|
-
var t =
|
|
1650
|
+
function A(e) {
|
|
1651
|
+
var t = a(e);
|
|
1356
1652
|
return (
|
|
1357
1653
|
t.required || delete t.required,
|
|
1358
1654
|
t.type && t.type && (t.type = t.type),
|
|
@@ -1361,7 +1657,7 @@
|
|
|
1361
1657
|
'datasource' !== t.type &&
|
|
1362
1658
|
'event' !== t.type &&
|
|
1363
1659
|
'object' !== t.type) ||
|
|
1364
|
-
!
|
|
1660
|
+
!l(t.default) ||
|
|
1365
1661
|
delete t.default,
|
|
1366
1662
|
('radio' !== t.type &&
|
|
1367
1663
|
'checkboxes' !== t.type &&
|
|
@@ -1377,9 +1673,9 @@
|
|
|
1377
1673
|
t.properties &&
|
|
1378
1674
|
(t.propertyOrder || (t.propertyOrder = Object.keys(t.properties)),
|
|
1379
1675
|
t.propertyOrder.map(function (e) {
|
|
1380
|
-
t.properties[e] =
|
|
1676
|
+
t.properties[e] = A(t.properties[e]);
|
|
1381
1677
|
})),
|
|
1382
|
-
'array' === t.type && t.items && (t.items =
|
|
1678
|
+
'array' === t.type && t.items && (t.items = A(t.items)),
|
|
1383
1679
|
t
|
|
1384
1680
|
);
|
|
1385
1681
|
}
|
|
@@ -1420,12 +1716,12 @@
|
|
|
1420
1716
|
function L(e) {
|
|
1421
1717
|
return B[e] || e;
|
|
1422
1718
|
}
|
|
1423
|
-
function
|
|
1719
|
+
function V(e, t) {
|
|
1424
1720
|
B[e]
|
|
1425
1721
|
? console.warn('当前已经存在' + e + '(' + B[e] + '),暂时不支持覆盖。')
|
|
1426
1722
|
: (B[e] = t);
|
|
1427
1723
|
}
|
|
1428
|
-
function
|
|
1724
|
+
function J(e) {
|
|
1429
1725
|
var t = !0;
|
|
1430
1726
|
if (!e) return t;
|
|
1431
1727
|
var r = e.type;
|
|
@@ -1445,147 +1741,149 @@
|
|
|
1445
1741
|
t
|
|
1446
1742
|
);
|
|
1447
1743
|
}
|
|
1448
|
-
function
|
|
1744
|
+
function K(e) {
|
|
1449
1745
|
var t = !1,
|
|
1450
1746
|
r = e.lastUpdateTime,
|
|
1451
|
-
|
|
1452
|
-
return r && new Date(r).getTime() >=
|
|
1747
|
+
a = new Date('2024-10-05T00:01:00.691Z').getTime();
|
|
1748
|
+
return r && new Date(r).getTime() >= a && (t = !0), t;
|
|
1453
1749
|
}
|
|
1454
|
-
function
|
|
1750
|
+
function U(e) {
|
|
1455
1751
|
var t = !1,
|
|
1456
1752
|
r = L(e.type),
|
|
1457
|
-
|
|
1458
|
-
return 'object' === r &&
|
|
1753
|
+
a = void 0 === e.isContainer || e.isContainer;
|
|
1754
|
+
return 'object' === r && a && (t = !0), t;
|
|
1459
1755
|
}
|
|
1460
|
-
function
|
|
1756
|
+
function X(e) {
|
|
1461
1757
|
var t = !0;
|
|
1462
1758
|
return (
|
|
1463
1759
|
'object' === e.type && e.propertyOrder && e.properties
|
|
1464
1760
|
? e.propertyOrder.map(function (r) {
|
|
1465
|
-
var
|
|
1466
|
-
('object' === e.type &&
|
|
1761
|
+
var a = e.properties[r];
|
|
1762
|
+
('object' === e.type && a.propertyOrder && a.properties) ||
|
|
1467
1763
|
(t = !1);
|
|
1468
1764
|
})
|
|
1469
1765
|
: (t = !1),
|
|
1470
1766
|
t
|
|
1471
1767
|
);
|
|
1472
1768
|
}
|
|
1473
|
-
function
|
|
1769
|
+
function Y(e, t) {
|
|
1474
1770
|
var r = e.split('-'),
|
|
1475
|
-
|
|
1476
|
-
return r.pop(),
|
|
1771
|
+
a = t.split('-');
|
|
1772
|
+
return r.pop(), a.pop(), r.join('-') === a.join('-');
|
|
1477
1773
|
}
|
|
1478
|
-
function
|
|
1774
|
+
function W(e, t) {
|
|
1479
1775
|
for (
|
|
1480
1776
|
var r = e.split('-'),
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1777
|
+
a = t.split('-'),
|
|
1778
|
+
i = 'before',
|
|
1779
|
+
l = 0,
|
|
1780
|
+
n = (r.length > a.length ? a : r).length;
|
|
1781
|
+
l < n;
|
|
1782
|
+
l += 1
|
|
1487
1783
|
)
|
|
1488
|
-
Number(r[
|
|
1489
|
-
return
|
|
1784
|
+
Number(r[l]) > Number(a[l]) && (i = 'after');
|
|
1785
|
+
return i;
|
|
1490
1786
|
}
|
|
1491
|
-
function
|
|
1787
|
+
function Z(e) {
|
|
1492
1788
|
var t = e.split('-');
|
|
1493
1789
|
return t.pop(), t.join('-');
|
|
1494
1790
|
}
|
|
1495
|
-
function
|
|
1791
|
+
function z(e) {
|
|
1496
1792
|
var t = e.split('-'),
|
|
1497
1793
|
r = t.pop(),
|
|
1498
|
-
|
|
1499
|
-
return t.push('' +
|
|
1794
|
+
a = Number(r) + 1;
|
|
1795
|
+
return t.push('' + a), t.join('-');
|
|
1500
1796
|
}
|
|
1501
|
-
function
|
|
1797
|
+
function H(e) {
|
|
1502
1798
|
var t = e.split('-'),
|
|
1503
1799
|
r = t.pop();
|
|
1504
1800
|
return [t.join('-'), r];
|
|
1505
1801
|
}
|
|
1506
|
-
function
|
|
1802
|
+
function Q(e) {
|
|
1507
1803
|
var t = e.split('-'),
|
|
1508
1804
|
r = t.pop();
|
|
1509
1805
|
return t.push(Number(r) - 1), t.join('-');
|
|
1510
1806
|
}
|
|
1511
|
-
function
|
|
1807
|
+
function G(e) {
|
|
1512
1808
|
var t = e.split('-'),
|
|
1513
1809
|
r = t.pop();
|
|
1514
1810
|
return t.push(Number(r) + 1), t.join('-');
|
|
1515
1811
|
}
|
|
1516
|
-
function
|
|
1812
|
+
function ee(e, t) {
|
|
1517
1813
|
var r = '',
|
|
1518
|
-
|
|
1814
|
+
a = !1;
|
|
1519
1815
|
return (
|
|
1520
|
-
e.options && e.options[0] && ((r = e.options[0].value), (
|
|
1521
|
-
(t || e.multiple) && (r =
|
|
1816
|
+
e.options && e.options[0] && ((r = e.options[0].value), (a = !0)),
|
|
1817
|
+
(t || e.multiple) && (r = a ? [r] : []),
|
|
1522
1818
|
r
|
|
1523
1819
|
);
|
|
1524
1820
|
}
|
|
1525
|
-
function
|
|
1821
|
+
function te(e, t) {
|
|
1526
1822
|
var r = '',
|
|
1527
|
-
|
|
1528
|
-
a
|
|
1529
|
-
var
|
|
1823
|
+
a = t;
|
|
1824
|
+
l(a) && l(e.default) && typeof a != typeof e.default && (a = void 0);
|
|
1825
|
+
var i = l(a) ? a : e.default;
|
|
1530
1826
|
switch (e.type) {
|
|
1531
1827
|
case 'select':
|
|
1532
1828
|
case 'radio':
|
|
1533
|
-
r =
|
|
1829
|
+
r = i || ee(e);
|
|
1534
1830
|
break;
|
|
1535
1831
|
case 'checkboxes':
|
|
1536
|
-
r =
|
|
1832
|
+
r = i || ee(e, !0);
|
|
1537
1833
|
break;
|
|
1538
1834
|
case 'color':
|
|
1539
|
-
('#fff' !==
|
|
1540
|
-
(r =
|
|
1835
|
+
('#fff' !== i && '#FFF' !== i) || (i = '#ffffff'),
|
|
1836
|
+
(r = l(i) ? i : '#ffffff');
|
|
1541
1837
|
break;
|
|
1542
1838
|
case 'boolean':
|
|
1543
|
-
r = !!
|
|
1839
|
+
r = !!l(i) && i;
|
|
1544
1840
|
break;
|
|
1545
1841
|
case 'number':
|
|
1546
|
-
r =
|
|
1842
|
+
r = l(i) ? i : void 0;
|
|
1547
1843
|
break;
|
|
1548
1844
|
case 'json':
|
|
1549
|
-
var
|
|
1550
|
-
if (
|
|
1551
|
-
else if (F(
|
|
1845
|
+
var n = '';
|
|
1846
|
+
if (E(i) || R(i)) n = i;
|
|
1847
|
+
else if (F(i) || '' === i) n = {};
|
|
1552
1848
|
else
|
|
1553
1849
|
try {
|
|
1554
|
-
|
|
1850
|
+
n = JSON.parse(i);
|
|
1555
1851
|
} catch (e) {
|
|
1556
|
-
|
|
1852
|
+
n = {};
|
|
1557
1853
|
}
|
|
1558
|
-
r =
|
|
1854
|
+
r = n;
|
|
1559
1855
|
break;
|
|
1560
1856
|
default:
|
|
1561
1857
|
r =
|
|
1562
1858
|
'input' === e.type && '0' === e.default
|
|
1563
|
-
?
|
|
1564
|
-
:
|
|
1565
|
-
?
|
|
1859
|
+
? i || e.default
|
|
1860
|
+
: l(i)
|
|
1861
|
+
? i
|
|
1566
1862
|
: void 0;
|
|
1567
1863
|
}
|
|
1568
1864
|
return r;
|
|
1569
1865
|
}
|
|
1570
|
-
function
|
|
1866
|
+
function re(e, t) {
|
|
1571
1867
|
var r = {},
|
|
1572
|
-
|
|
1573
|
-
if (
|
|
1574
|
-
var
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1868
|
+
i = e.type;
|
|
1869
|
+
if (E(e) && 'object' === L(e.type)) {
|
|
1870
|
+
var n = e,
|
|
1871
|
+
o = t;
|
|
1872
|
+
l(o) &&
|
|
1873
|
+
((l(n.default) && typeof o != typeof e.default) || !E(o)) &&
|
|
1874
|
+
(o = void 0);
|
|
1875
|
+
var p = l(o) ? o : n.default;
|
|
1876
|
+
'dynamic-data' === i
|
|
1877
|
+
? ((r = a(m)),
|
|
1580
1878
|
p &&
|
|
1581
|
-
|
|
1879
|
+
E(p) &&
|
|
1582
1880
|
'{}' !== JSON.stringify(p) &&
|
|
1583
1881
|
(r = Object.assign(r, p)))
|
|
1584
|
-
: 'datasource' ===
|
|
1585
|
-
?
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
'local' ===
|
|
1882
|
+
: 'datasource' === i
|
|
1883
|
+
? n.properties &&
|
|
1884
|
+
n.properties.type &&
|
|
1885
|
+
n.properties.type.default &&
|
|
1886
|
+
'local' === n.properties.type.default
|
|
1589
1887
|
? ((r = { data: '{}', filter: '() => {}' }),
|
|
1590
1888
|
p && p.data && (r.data = p.data),
|
|
1591
1889
|
p && p.filter && (r.filter = p.filter),
|
|
@@ -1594,11 +1892,11 @@
|
|
|
1594
1892
|
p && p.data && (r.data = p.data),
|
|
1595
1893
|
p && p.filter && (r.filter = p.filter),
|
|
1596
1894
|
'{}' === r.data && (r.data = 'http://xxx'))
|
|
1597
|
-
: 'event' ===
|
|
1598
|
-
?
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
'emit' ===
|
|
1895
|
+
: 'event' === i
|
|
1896
|
+
? n.properties &&
|
|
1897
|
+
n.properties.type &&
|
|
1898
|
+
n.properties.type.default &&
|
|
1899
|
+
'emit' === n.properties.type.default
|
|
1602
1900
|
? p && 'out' === p.type
|
|
1603
1901
|
? (r = {
|
|
1604
1902
|
trigger: (p && p.filter) || 'eventName',
|
|
@@ -1615,86 +1913,88 @@
|
|
|
1615
1913
|
: ((r = { register: 'eventName', actionFunc: '() => {}' }),
|
|
1616
1914
|
p && p.register && (r.register = p.register),
|
|
1617
1915
|
p && p.actionFunc && (r.actionFunc = p.actionFunc))
|
|
1618
|
-
: !1 === e.isContainer && p &&
|
|
1916
|
+
: !1 === e.isContainer && p && E(p) && '{}' !== JSON.stringify(p)
|
|
1619
1917
|
? (r = Object.assign(r, p))
|
|
1620
1918
|
: e.properties &&
|
|
1621
1919
|
(e.propertyOrder
|
|
1622
1920
|
? e.propertyOrder
|
|
1623
1921
|
: Object.keys(e.properties)
|
|
1624
|
-
).map(function (
|
|
1625
|
-
var
|
|
1626
|
-
|
|
1627
|
-
switch (L(
|
|
1922
|
+
).map(function (a) {
|
|
1923
|
+
var i = e.properties[a],
|
|
1924
|
+
l = t && t[a];
|
|
1925
|
+
switch (L(i.type)) {
|
|
1628
1926
|
case 'array':
|
|
1629
|
-
r[
|
|
1927
|
+
r[a] = ae(i, l);
|
|
1630
1928
|
break;
|
|
1631
1929
|
case 'object':
|
|
1632
|
-
r[
|
|
1930
|
+
r[a] = re(i, l);
|
|
1633
1931
|
break;
|
|
1634
1932
|
default:
|
|
1635
|
-
r[
|
|
1933
|
+
r[a] = te(i, l);
|
|
1636
1934
|
}
|
|
1637
1935
|
});
|
|
1638
1936
|
}
|
|
1639
1937
|
return r;
|
|
1640
1938
|
}
|
|
1641
|
-
function
|
|
1939
|
+
function ae(e, t) {
|
|
1642
1940
|
var r = [];
|
|
1643
1941
|
if (e && 'array' === L(e.type)) {
|
|
1644
|
-
var
|
|
1645
|
-
|
|
1646
|
-
|
|
1942
|
+
var a = t;
|
|
1943
|
+
l(a) &&
|
|
1944
|
+
((l(e.default) && typeof a != typeof e.default) || !R(a)) &&
|
|
1945
|
+
(a = void 0);
|
|
1946
|
+
var i = l(a) ? a : e.default;
|
|
1647
1947
|
if ('array' === L(e.type))
|
|
1648
|
-
if (
|
|
1649
|
-
|
|
1650
|
-
r.push(
|
|
1948
|
+
if (R(i))
|
|
1949
|
+
i.map(function (t) {
|
|
1950
|
+
r.push(re(e.items, t));
|
|
1651
1951
|
});
|
|
1652
|
-
else if (
|
|
1952
|
+
else if (i) r = i;
|
|
1653
1953
|
else {
|
|
1654
|
-
var
|
|
1655
|
-
r.push(
|
|
1954
|
+
var n = re(e.items, i);
|
|
1955
|
+
r.push(n);
|
|
1656
1956
|
}
|
|
1657
|
-
else r =
|
|
1957
|
+
else r = l(i) ? i : [];
|
|
1658
1958
|
}
|
|
1659
1959
|
return r;
|
|
1660
1960
|
}
|
|
1661
1961
|
function ie(e, t) {
|
|
1662
1962
|
return 'object' === L(e.type)
|
|
1663
|
-
?
|
|
1963
|
+
? re(e, t)
|
|
1664
1964
|
: 'array' === L(e.type)
|
|
1665
|
-
?
|
|
1666
|
-
:
|
|
1965
|
+
? ae(e, t)
|
|
1966
|
+
: te(e, t);
|
|
1667
1967
|
}
|
|
1668
|
-
var
|
|
1669
|
-
function
|
|
1968
|
+
var le = g;
|
|
1969
|
+
function ne(e, t) {
|
|
1670
1970
|
var r = t || [];
|
|
1671
1971
|
if (e && '{}' !== JSON.stringify(e))
|
|
1672
|
-
if (
|
|
1972
|
+
if (E(e))
|
|
1673
1973
|
if (
|
|
1674
1974
|
e.type &&
|
|
1675
1975
|
'remote' === e.type &&
|
|
1676
1976
|
e.config &&
|
|
1677
|
-
|
|
1977
|
+
E(e.config) &&
|
|
1678
1978
|
e.config.dataName &&
|
|
1679
|
-
|
|
1680
|
-
|
|
1979
|
+
l(e.localFilter) &&
|
|
1980
|
+
l(e.data)
|
|
1681
1981
|
) {
|
|
1682
|
-
var
|
|
1683
|
-
if (
|
|
1982
|
+
var a = e.config.body;
|
|
1983
|
+
if (a && !E(a))
|
|
1684
1984
|
try {
|
|
1685
|
-
|
|
1985
|
+
a = JSON.parse(a);
|
|
1686
1986
|
} catch (e) {
|
|
1687
|
-
|
|
1987
|
+
a = {};
|
|
1688
1988
|
}
|
|
1689
|
-
r.push({ id: e.config.id, dataName: e.config.dataName, body:
|
|
1989
|
+
r.push({ id: e.config.id, dataName: e.config.dataName, body: a });
|
|
1690
1990
|
} else
|
|
1691
1991
|
Object.keys(e).map(function (t) {
|
|
1692
|
-
|
|
1992
|
+
ne(e[t], r);
|
|
1693
1993
|
});
|
|
1694
1994
|
else
|
|
1695
|
-
|
|
1995
|
+
R(e) &&
|
|
1696
1996
|
e.map(function (e) {
|
|
1697
|
-
|
|
1997
|
+
ne(e, r);
|
|
1698
1998
|
});
|
|
1699
1999
|
return r;
|
|
1700
2000
|
}
|
|
@@ -1707,38 +2007,56 @@
|
|
|
1707
2007
|
r
|
|
1708
2008
|
);
|
|
1709
2009
|
}
|
|
1710
|
-
function
|
|
2010
|
+
function pe(e, t) {
|
|
1711
2011
|
var r = [];
|
|
1712
2012
|
return (
|
|
1713
|
-
|
|
1714
|
-
? Object.keys(e).map(function (
|
|
1715
|
-
var
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
? r.push({ title:
|
|
1719
|
-
: r.push({ title:
|
|
2013
|
+
E(e)
|
|
2014
|
+
? Object.keys(e).map(function (a) {
|
|
2015
|
+
var i = e[a],
|
|
2016
|
+
l = t ? t + '-' + a : a;
|
|
2017
|
+
E(i) || R(i)
|
|
2018
|
+
? r.push({ title: a, value: l, key: l, children: pe(i, l) })
|
|
2019
|
+
: r.push({ title: a, value: l, key: l });
|
|
1720
2020
|
})
|
|
1721
|
-
:
|
|
1722
|
-
e.map(function (e,
|
|
1723
|
-
var
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
? r.push({ title:
|
|
1727
|
-
: r.push({ title:
|
|
2021
|
+
: R(e) &&
|
|
2022
|
+
e.map(function (e, a) {
|
|
2023
|
+
var i = a.toString(),
|
|
2024
|
+
l = t ? t + '-' + a : i;
|
|
2025
|
+
E(e) || R(e)
|
|
2026
|
+
? r.push({ title: i, value: l, key: l, children: pe(e, l) })
|
|
2027
|
+
: r.push({ title: i, value: l, key: l });
|
|
1728
2028
|
}),
|
|
1729
2029
|
r
|
|
1730
2030
|
);
|
|
1731
2031
|
}
|
|
1732
|
-
function
|
|
2032
|
+
function ue(e, t) {
|
|
2033
|
+
var r = '';
|
|
2034
|
+
return (
|
|
2035
|
+
'object' === L(e.type) &&
|
|
2036
|
+
e.properties &&
|
|
2037
|
+
(e.propertyOrder ? e.propertyOrder : Object.keys(e.properties)).map(
|
|
2038
|
+
function (a) {
|
|
2039
|
+
var i = e.properties[a],
|
|
2040
|
+
l = t[a];
|
|
2041
|
+
('array' === L(i.type) && 'object' === L(i.type)) ||
|
|
2042
|
+
(l &&
|
|
2043
|
+
i.isConditionProp &&
|
|
2044
|
+
(r.indexOf('-') > 0 ? (r += '-' + l) : (r = l)));
|
|
2045
|
+
},
|
|
2046
|
+
),
|
|
2047
|
+
r
|
|
2048
|
+
);
|
|
2049
|
+
}
|
|
2050
|
+
function ce(e) {
|
|
1733
2051
|
var t = e.split('-');
|
|
1734
2052
|
return t.pop(), t.join('-');
|
|
1735
2053
|
}
|
|
1736
|
-
function
|
|
2054
|
+
function se(e) {
|
|
1737
2055
|
var t = e.split('-'),
|
|
1738
2056
|
r = t.pop();
|
|
1739
2057
|
return [t.join('-'), r];
|
|
1740
2058
|
}
|
|
1741
|
-
var
|
|
2059
|
+
var de = [
|
|
1742
2060
|
'key',
|
|
1743
2061
|
'enum',
|
|
1744
2062
|
'enumextra',
|