@wibetter/json-schema-editor 5.0.22 → 5.0.23
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/lib/index.css +2 -2
- package/lib/index.js +1 -3505
- package/lib/index.js.LICENSE.txt +2 -2
- package/package.json +1 -1
- package/sdk/index.css +2 -2
- package/sdk/index.js +2 -2
package/lib/index.js
CHANGED
|
@@ -1,3506 +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.JSONSchemaEditor = t())
|
|
9
|
-
: (e.JSONSchemaEditor = t());
|
|
10
|
-
})(this, function () {
|
|
11
|
-
return (function () {
|
|
12
|
-
var e = {
|
|
13
|
-
264: function () {},
|
|
14
|
-
286: function () {},
|
|
15
|
-
382: function () {},
|
|
16
|
-
80: function () {},
|
|
17
|
-
707: function () {},
|
|
18
|
-
975: function (e, t, n) {
|
|
19
|
-
var a = n(264);
|
|
20
|
-
a.__esModule && (a = a.default),
|
|
21
|
-
'string' == typeof a && (a = [[e.id, a, '']]),
|
|
22
|
-
a.locals && (e.exports = a.locals),
|
|
23
|
-
(0, n(611).A)('b8de86ae', a, !1, { sourceMap: !1 });
|
|
24
|
-
},
|
|
25
|
-
915: function (e, t, n) {
|
|
26
|
-
var a = n(286);
|
|
27
|
-
a.__esModule && (a = a.default),
|
|
28
|
-
'string' == typeof a && (a = [[e.id, a, '']]),
|
|
29
|
-
a.locals && (e.exports = a.locals),
|
|
30
|
-
(0, n(611).A)('5e9c0933', a, !1, { sourceMap: !1 });
|
|
31
|
-
},
|
|
32
|
-
23: function (e, t, n) {
|
|
33
|
-
var a = n(382);
|
|
34
|
-
a.__esModule && (a = a.default),
|
|
35
|
-
'string' == typeof a && (a = [[e.id, a, '']]),
|
|
36
|
-
a.locals && (e.exports = a.locals),
|
|
37
|
-
(0, n(611).A)('adbe60da', a, !1, { sourceMap: !1 });
|
|
38
|
-
},
|
|
39
|
-
617: function (e, t, n) {
|
|
40
|
-
var a = n(80);
|
|
41
|
-
a.__esModule && (a = a.default),
|
|
42
|
-
'string' == typeof a && (a = [[e.id, a, '']]),
|
|
43
|
-
a.locals && (e.exports = a.locals),
|
|
44
|
-
(0, n(611).A)('9c82b91a', a, !1, { sourceMap: !1 });
|
|
45
|
-
},
|
|
46
|
-
790: function (e, t, n) {
|
|
47
|
-
var a = n(707);
|
|
48
|
-
a.__esModule && (a = a.default),
|
|
49
|
-
'string' == typeof a && (a = [[e.id, a, '']]),
|
|
50
|
-
a.locals && (e.exports = a.locals),
|
|
51
|
-
(0, n(611).A)('2b121068', a, !1, { sourceMap: !1 });
|
|
52
|
-
},
|
|
53
|
-
611: function (e, t, n) {
|
|
54
|
-
'use strict';
|
|
55
|
-
function a(e, t) {
|
|
56
|
-
for (var n = [], a = {}, o = 0; o < t.length; o++) {
|
|
57
|
-
var r = t[o],
|
|
58
|
-
i = r[0],
|
|
59
|
-
s = {
|
|
60
|
-
id: e + ':' + o,
|
|
61
|
-
css: r[1],
|
|
62
|
-
media: r[2],
|
|
63
|
-
sourceMap: r[3],
|
|
64
|
-
};
|
|
65
|
-
a[i]
|
|
66
|
-
? a[i].parts.push(s)
|
|
67
|
-
: n.push((a[i] = { id: i, parts: [s] }));
|
|
68
|
-
}
|
|
69
|
-
return n;
|
|
70
|
-
}
|
|
71
|
-
n.d(t, {
|
|
72
|
-
A: function () {
|
|
73
|
-
return h;
|
|
74
|
-
},
|
|
75
|
-
});
|
|
76
|
-
var o = 'undefined' != typeof document;
|
|
77
|
-
if ('undefined' != typeof DEBUG && DEBUG && !o)
|
|
78
|
-
throw new Error(
|
|
79
|
-
"vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.",
|
|
80
|
-
);
|
|
81
|
-
var r = {},
|
|
82
|
-
i =
|
|
83
|
-
o && (document.head || document.getElementsByTagName('head')[0]),
|
|
84
|
-
s = null,
|
|
85
|
-
c = 0,
|
|
86
|
-
l = !1,
|
|
87
|
-
p = function () {},
|
|
88
|
-
d = null,
|
|
89
|
-
m = 'data-vue-ssr-id',
|
|
90
|
-
u =
|
|
91
|
-
'undefined' != typeof navigator &&
|
|
92
|
-
/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());
|
|
93
|
-
function h(e, t, n, o) {
|
|
94
|
-
(l = n), (d = o || {});
|
|
95
|
-
var i = a(e, t);
|
|
96
|
-
return (
|
|
97
|
-
y(i),
|
|
98
|
-
function (t) {
|
|
99
|
-
for (var n = [], o = 0; o < i.length; o++) {
|
|
100
|
-
var s = i[o];
|
|
101
|
-
(c = r[s.id]).refs--, n.push(c);
|
|
102
|
-
}
|
|
103
|
-
for (
|
|
104
|
-
t ? y((i = a(e, t))) : (i = []), o = 0;
|
|
105
|
-
o < n.length;
|
|
106
|
-
o++
|
|
107
|
-
) {
|
|
108
|
-
var c;
|
|
109
|
-
if (0 === (c = n[o]).refs) {
|
|
110
|
-
for (var l = 0; l < c.parts.length; l++) c.parts[l]();
|
|
111
|
-
delete r[c.id];
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
);
|
|
116
|
-
}
|
|
117
|
-
function y(e) {
|
|
118
|
-
for (var t = 0; t < e.length; t++) {
|
|
119
|
-
var n = e[t],
|
|
120
|
-
a = r[n.id];
|
|
121
|
-
if (a) {
|
|
122
|
-
a.refs++;
|
|
123
|
-
for (var o = 0; o < a.parts.length; o++) a.parts[o](n.parts[o]);
|
|
124
|
-
for (; o < n.parts.length; o++) a.parts.push(f(n.parts[o]));
|
|
125
|
-
a.parts.length > n.parts.length &&
|
|
126
|
-
(a.parts.length = n.parts.length);
|
|
127
|
-
} else {
|
|
128
|
-
var i = [];
|
|
129
|
-
for (o = 0; o < n.parts.length; o++) i.push(f(n.parts[o]));
|
|
130
|
-
r[n.id] = { id: n.id, refs: 1, parts: i };
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
function g() {
|
|
135
|
-
var e = document.createElement('style');
|
|
136
|
-
return (e.type = 'text/css'), i.appendChild(e), e;
|
|
137
|
-
}
|
|
138
|
-
function f(e) {
|
|
139
|
-
var t,
|
|
140
|
-
n,
|
|
141
|
-
a = document.querySelector('style[' + m + '~="' + e.id + '"]');
|
|
142
|
-
if (a) {
|
|
143
|
-
if (l) return p;
|
|
144
|
-
a.parentNode.removeChild(a);
|
|
145
|
-
}
|
|
146
|
-
if (u) {
|
|
147
|
-
var o = c++;
|
|
148
|
-
(a = s || (s = g())),
|
|
149
|
-
(t = b.bind(null, a, o, !1)),
|
|
150
|
-
(n = b.bind(null, a, o, !0));
|
|
151
|
-
} else
|
|
152
|
-
(a = g()),
|
|
153
|
-
(t = S.bind(null, a)),
|
|
154
|
-
(n = function () {
|
|
155
|
-
a.parentNode.removeChild(a);
|
|
156
|
-
});
|
|
157
|
-
return (
|
|
158
|
-
t(e),
|
|
159
|
-
function (a) {
|
|
160
|
-
if (a) {
|
|
161
|
-
if (
|
|
162
|
-
a.css === e.css &&
|
|
163
|
-
a.media === e.media &&
|
|
164
|
-
a.sourceMap === e.sourceMap
|
|
165
|
-
)
|
|
166
|
-
return;
|
|
167
|
-
t((e = a));
|
|
168
|
-
} else n();
|
|
169
|
-
}
|
|
170
|
-
);
|
|
171
|
-
}
|
|
172
|
-
var v,
|
|
173
|
-
x =
|
|
174
|
-
((v = []),
|
|
175
|
-
function (e, t) {
|
|
176
|
-
return (v[e] = t), v.filter(Boolean).join('\n');
|
|
177
|
-
});
|
|
178
|
-
function b(e, t, n, a) {
|
|
179
|
-
var o = n ? '' : a.css;
|
|
180
|
-
if (e.styleSheet) e.styleSheet.cssText = x(t, o);
|
|
181
|
-
else {
|
|
182
|
-
var r = document.createTextNode(o),
|
|
183
|
-
i = e.childNodes;
|
|
184
|
-
i[t] && e.removeChild(i[t]),
|
|
185
|
-
i.length ? e.insertBefore(r, i[t]) : e.appendChild(r);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
function S(e, t) {
|
|
189
|
-
var n = t.css,
|
|
190
|
-
a = t.media,
|
|
191
|
-
o = t.sourceMap;
|
|
192
|
-
if (
|
|
193
|
-
(a && e.setAttribute('media', a),
|
|
194
|
-
d.ssrId && e.setAttribute(m, t.id),
|
|
195
|
-
o &&
|
|
196
|
-
((n += '\n/*# sourceURL=' + o.sources[0] + ' */'),
|
|
197
|
-
(n +=
|
|
198
|
-
'\n/*# sourceMappingURL=data:application/json;base64,' +
|
|
199
|
-
btoa(unescape(encodeURIComponent(JSON.stringify(o)))) +
|
|
200
|
-
' */')),
|
|
201
|
-
e.styleSheet)
|
|
202
|
-
)
|
|
203
|
-
e.styleSheet.cssText = n;
|
|
204
|
-
else {
|
|
205
|
-
for (; e.firstChild; ) e.removeChild(e.firstChild);
|
|
206
|
-
e.appendChild(document.createTextNode(n));
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
},
|
|
210
|
-
},
|
|
211
|
-
t = {};
|
|
212
|
-
function n(a) {
|
|
213
|
-
var o = t[a];
|
|
214
|
-
if (void 0 !== o) return o.exports;
|
|
215
|
-
var r = (t[a] = { id: a, exports: {} });
|
|
216
|
-
return e[a](r, r.exports, n), r.exports;
|
|
217
|
-
}
|
|
218
|
-
(n.n = function (e) {
|
|
219
|
-
var t =
|
|
220
|
-
e && e.__esModule
|
|
221
|
-
? function () {
|
|
222
|
-
return e.default;
|
|
223
|
-
}
|
|
224
|
-
: function () {
|
|
225
|
-
return e;
|
|
226
|
-
};
|
|
227
|
-
return n.d(t, { a: t }), t;
|
|
228
|
-
}),
|
|
229
|
-
(n.d = function (e, t) {
|
|
230
|
-
for (var a in t)
|
|
231
|
-
n.o(t, a) &&
|
|
232
|
-
!n.o(e, a) &&
|
|
233
|
-
Object.defineProperty(e, a, { enumerable: !0, get: t[a] });
|
|
234
|
-
}),
|
|
235
|
-
(n.o = function (e, t) {
|
|
236
|
-
return Object.prototype.hasOwnProperty.call(e, t);
|
|
237
|
-
}),
|
|
238
|
-
(n.r = function (e) {
|
|
239
|
-
'undefined' != typeof Symbol &&
|
|
240
|
-
Symbol.toStringTag &&
|
|
241
|
-
Object.defineProperty(e, Symbol.toStringTag, { value: 'Module' }),
|
|
242
|
-
Object.defineProperty(e, '__esModule', { value: !0 });
|
|
243
|
-
});
|
|
244
|
-
var a = {};
|
|
245
|
-
return (
|
|
246
|
-
(function () {
|
|
247
|
-
'use strict';
|
|
248
|
-
n.r(a),
|
|
249
|
-
n.d(a, {
|
|
250
|
-
default: function () {
|
|
251
|
-
return pt;
|
|
252
|
-
},
|
|
253
|
-
});
|
|
254
|
-
var e,
|
|
255
|
-
t = require('@babel/runtime/helpers/inheritsLoose'),
|
|
256
|
-
o = n.n(t),
|
|
257
|
-
r = require('react'),
|
|
258
|
-
i = n.n(r),
|
|
259
|
-
s = require('react-dom'),
|
|
260
|
-
c = n.n(s),
|
|
261
|
-
l = require('mobx-react'),
|
|
262
|
-
p = require('prop-types'),
|
|
263
|
-
d = n.n(p),
|
|
264
|
-
m = require('@babel/runtime/helpers/extends'),
|
|
265
|
-
u = n.n(m),
|
|
266
|
-
h = require('@babel/runtime/helpers/initializerDefineProperty'),
|
|
267
|
-
y = n.n(h),
|
|
268
|
-
g = require('@babel/runtime/helpers/createClass'),
|
|
269
|
-
f = n.n(g),
|
|
270
|
-
v = require('@babel/runtime/helpers/applyDecoratedDescriptor'),
|
|
271
|
-
x = n.n(v),
|
|
272
|
-
b =
|
|
273
|
-
(require('@babel/runtime/helpers/initializerWarningHelper'),
|
|
274
|
-
require('mobx')),
|
|
275
|
-
S = require('antd');
|
|
276
|
-
function E(e) {
|
|
277
|
-
var t = JSON.stringify(e);
|
|
278
|
-
return JSON.parse(t);
|
|
279
|
-
}
|
|
280
|
-
function O(e, t) {
|
|
281
|
-
return JSON.stringify(e) === JSON.stringify(t);
|
|
282
|
-
}
|
|
283
|
-
function C(e, t) {
|
|
284
|
-
window.sessionStorage && window.sessionStorage.setItem(e, t);
|
|
285
|
-
}
|
|
286
|
-
var N,
|
|
287
|
-
j,
|
|
288
|
-
w,
|
|
289
|
-
I,
|
|
290
|
-
R,
|
|
291
|
-
K,
|
|
292
|
-
k,
|
|
293
|
-
T,
|
|
294
|
-
J,
|
|
295
|
-
D,
|
|
296
|
-
B,
|
|
297
|
-
P,
|
|
298
|
-
V,
|
|
299
|
-
L,
|
|
300
|
-
F,
|
|
301
|
-
q,
|
|
302
|
-
A,
|
|
303
|
-
_,
|
|
304
|
-
M,
|
|
305
|
-
W,
|
|
306
|
-
z,
|
|
307
|
-
G,
|
|
308
|
-
U,
|
|
309
|
-
H,
|
|
310
|
-
X,
|
|
311
|
-
Q,
|
|
312
|
-
Y,
|
|
313
|
-
Z,
|
|
314
|
-
$,
|
|
315
|
-
ee,
|
|
316
|
-
te,
|
|
317
|
-
ne,
|
|
318
|
-
ae,
|
|
319
|
-
oe,
|
|
320
|
-
re,
|
|
321
|
-
ie,
|
|
322
|
-
se,
|
|
323
|
-
ce,
|
|
324
|
-
le,
|
|
325
|
-
pe,
|
|
326
|
-
de,
|
|
327
|
-
me,
|
|
328
|
-
ue,
|
|
329
|
-
he,
|
|
330
|
-
ye,
|
|
331
|
-
ge,
|
|
332
|
-
fe = [
|
|
333
|
-
'input',
|
|
334
|
-
'boolean',
|
|
335
|
-
'number',
|
|
336
|
-
'color',
|
|
337
|
-
'url',
|
|
338
|
-
'textarea',
|
|
339
|
-
'radio',
|
|
340
|
-
'select',
|
|
341
|
-
'cascader',
|
|
342
|
-
'checkboxes',
|
|
343
|
-
'date',
|
|
344
|
-
'date-time',
|
|
345
|
-
'time',
|
|
346
|
-
'input-image',
|
|
347
|
-
],
|
|
348
|
-
ve = ['object'].concat([
|
|
349
|
-
'datasource',
|
|
350
|
-
'event',
|
|
351
|
-
'dynamic-data',
|
|
352
|
-
'dynamic-config',
|
|
353
|
-
'sohu-source',
|
|
354
|
-
'sohu-event',
|
|
355
|
-
]),
|
|
356
|
-
xe = [
|
|
357
|
-
'quantity',
|
|
358
|
-
'box-style',
|
|
359
|
-
'text-editor',
|
|
360
|
-
'json',
|
|
361
|
-
'codearea',
|
|
362
|
-
'htmlarea',
|
|
363
|
-
'array',
|
|
364
|
-
].concat(ve),
|
|
365
|
-
be = [].concat(fe, xe),
|
|
366
|
-
Se = ['string'],
|
|
367
|
-
Ee =
|
|
368
|
-
(((e = {
|
|
369
|
-
object: be,
|
|
370
|
-
array: [
|
|
371
|
-
'object',
|
|
372
|
-
'input',
|
|
373
|
-
'number',
|
|
374
|
-
'select',
|
|
375
|
-
'cascader',
|
|
376
|
-
'color',
|
|
377
|
-
'url',
|
|
378
|
-
'date',
|
|
379
|
-
'date-time',
|
|
380
|
-
'time',
|
|
381
|
-
'input-image',
|
|
382
|
-
],
|
|
383
|
-
radio: Se,
|
|
384
|
-
select: Se,
|
|
385
|
-
}).select = ['string']),
|
|
386
|
-
(e.all = be),
|
|
387
|
-
e),
|
|
388
|
-
Oe = require('@wibetter/json-utils'),
|
|
389
|
-
Ce = Oe.TypeDataList.jsonschema,
|
|
390
|
-
Ne = Oe.TypeDataList.input,
|
|
391
|
-
je = {
|
|
392
|
-
schemaStore:
|
|
393
|
-
((N = b.action.bound),
|
|
394
|
-
(j = b.action.bound),
|
|
395
|
-
(w = b.action.bound),
|
|
396
|
-
(I = b.action.bound),
|
|
397
|
-
(R = b.action.bound),
|
|
398
|
-
(K = b.action.bound),
|
|
399
|
-
(k = b.action.bound),
|
|
400
|
-
(T = b.action.bound),
|
|
401
|
-
(J = b.action.bound),
|
|
402
|
-
(D = b.action.bound),
|
|
403
|
-
(B = b.action.bound),
|
|
404
|
-
(P = b.action.bound),
|
|
405
|
-
(V = b.action.bound),
|
|
406
|
-
(L = b.action.bound),
|
|
407
|
-
(F = b.action.bound),
|
|
408
|
-
(q = b.action.bound),
|
|
409
|
-
(A = b.action.bound),
|
|
410
|
-
(_ = b.action.bound),
|
|
411
|
-
(M = b.action.bound),
|
|
412
|
-
(W = b.action.bound),
|
|
413
|
-
(z = b.action.bound),
|
|
414
|
-
(G = b.action.bound),
|
|
415
|
-
(U = b.action.bound),
|
|
416
|
-
(H = b.action.bound),
|
|
417
|
-
(X = b.action.bound),
|
|
418
|
-
(Q = b.action.bound),
|
|
419
|
-
(Y = b.action.bound),
|
|
420
|
-
(Z = b.action.bound),
|
|
421
|
-
($ = b.action.bound),
|
|
422
|
-
(ee = b.action.bound),
|
|
423
|
-
(te = b.action.bound),
|
|
424
|
-
(ne = b.action.bound),
|
|
425
|
-
(ae = b.action.bound),
|
|
426
|
-
(oe = b.action.bound),
|
|
427
|
-
(re = b.action.bound),
|
|
428
|
-
(ie = b.action.bound),
|
|
429
|
-
(se = b.action.bound),
|
|
430
|
-
(ce = b.action.bound),
|
|
431
|
-
(le = b.action.bound),
|
|
432
|
-
(pe = b.action.bound),
|
|
433
|
-
(de = (function () {
|
|
434
|
-
function e() {
|
|
435
|
-
(this.curJsonKeyIndex = 1),
|
|
436
|
-
y()(this, 'triggerChange', me, this),
|
|
437
|
-
y()(this, 'jsonSchema', ue, this),
|
|
438
|
-
y()(this, 'SchemaTypeList', he, this),
|
|
439
|
-
y()(this, 'onChange', ye, this),
|
|
440
|
-
y()(this, 'childElemSort', ge, this);
|
|
441
|
-
}
|
|
442
|
-
var t = e.prototype;
|
|
443
|
-
return (
|
|
444
|
-
(t.triggerChangeAction = function () {
|
|
445
|
-
this.triggerChange = !this.triggerChange;
|
|
446
|
-
}),
|
|
447
|
-
(t.initSchemaTypeList = function (e) {
|
|
448
|
-
var t = this;
|
|
449
|
-
e &&
|
|
450
|
-
'{}' !== JSON.stringify(e) &&
|
|
451
|
-
(O(e, this.SchemaTypeList) ||
|
|
452
|
-
(e &&
|
|
453
|
-
Object.keys(e).map(function (n) {
|
|
454
|
-
t.SchemaTypeList[n] = e[n];
|
|
455
|
-
})));
|
|
456
|
-
}),
|
|
457
|
-
(t.initJSONSchemaData = function (e) {
|
|
458
|
-
if (e && '{}' !== JSON.stringify(e)) {
|
|
459
|
-
if (!O(e, this.JSONSchemaObj))
|
|
460
|
-
if (e && (0, Oe.isNewSchemaData)(e))
|
|
461
|
-
this.jsonSchema = e;
|
|
462
|
-
else {
|
|
463
|
-
var t = (0, Oe.oldSchemaToNewSchema)(e);
|
|
464
|
-
this.jsonSchema = t;
|
|
465
|
-
}
|
|
466
|
-
} else this.jsonSchema = E(Ce);
|
|
467
|
-
}),
|
|
468
|
-
(t.initOnChange = function (e) {
|
|
469
|
-
var t, n;
|
|
470
|
-
(e ||
|
|
471
|
-
((t = e),
|
|
472
|
-
(n = !1),
|
|
473
|
-
'Function' ===
|
|
474
|
-
Object.prototype.toString.call(t).slice(8, -1) &&
|
|
475
|
-
(n = !0),
|
|
476
|
-
n)) &&
|
|
477
|
-
(this.onChange = e);
|
|
478
|
-
}),
|
|
479
|
-
(t.jsonSchemaChange = function (e) {
|
|
480
|
-
(this.jsonSchema.lastUpdateTime = new Date()),
|
|
481
|
-
e || this.onChange(this.JSONSchemaObj);
|
|
482
|
-
}),
|
|
483
|
-
(t.indexRoute2keyRoute = function (e) {
|
|
484
|
-
return (0, Oe.indexRoute2keyRoute)(e, this.jsonSchema);
|
|
485
|
-
}),
|
|
486
|
-
(t.keyRoute2indexRoute = function (e) {
|
|
487
|
-
return (0, Oe.keyRoute2indexRoute)(e, this.jsonSchema);
|
|
488
|
-
}),
|
|
489
|
-
(t.getSchemaByIndexRoute = function (e) {
|
|
490
|
-
return (0, Oe.getSchemaByIndexRoute)(
|
|
491
|
-
e,
|
|
492
|
-
this.jsonSchema,
|
|
493
|
-
!0,
|
|
494
|
-
);
|
|
495
|
-
}),
|
|
496
|
-
(t.getSchemaByKeyRoute = function (e) {
|
|
497
|
-
return (0, Oe.getSchemaByKeyRoute)(e, this.jsonSchema, !0);
|
|
498
|
-
}),
|
|
499
|
-
(t.getNewJsonKeyIndex = function (e, t) {
|
|
500
|
-
var n = (t || 'field') + '_' + this.curJsonKeyIndex;
|
|
501
|
-
return (
|
|
502
|
-
e.propertyOrder.indexOf(n) >= 0 &&
|
|
503
|
-
((this.curJsonKeyIndex += 1),
|
|
504
|
-
(n = this.getNewJsonKeyIndex(e))),
|
|
505
|
-
(this.curJsonKeyIndex += 1),
|
|
506
|
-
n
|
|
507
|
-
);
|
|
508
|
-
}),
|
|
509
|
-
(t.isExitJsonKey = function (e, t) {
|
|
510
|
-
var n = (0, Oe.getParentIndexRoute)(e),
|
|
511
|
-
a = this.getSchemaByIndexRoute(n);
|
|
512
|
-
return (
|
|
513
|
-
!!(a.propertyOrder && a.propertyOrder.indexOf(t) >= 0) ||
|
|
514
|
-
(Oe.KeyWordList &&
|
|
515
|
-
Oe.KeyWordList.indexOf(t) >= 0 &&
|
|
516
|
-
S.message.warning(
|
|
517
|
-
t +
|
|
518
|
-
'是JSONSchema的关键字,建议您换一个,避免后续出现数据异常。',
|
|
519
|
-
),
|
|
520
|
-
t &&
|
|
521
|
-
t.indexOf('-') > -1 &&
|
|
522
|
-
S.message.warning(
|
|
523
|
-
t +
|
|
524
|
-
'含特殊字符(‘-’),会影响后续数据获取和更新,建议您换一个数值。',
|
|
525
|
-
),
|
|
526
|
-
!1)
|
|
527
|
-
);
|
|
528
|
-
}),
|
|
529
|
-
(t.isSupportCurType = function (e, t) {
|
|
530
|
-
var n = (0, Oe.getParentIndexRoute)(e),
|
|
531
|
-
a = this.getSchemaByIndexRoute(n),
|
|
532
|
-
o = this.SchemaTypeList[a.type];
|
|
533
|
-
return !!(o && o.indexOf(t) >= 0);
|
|
534
|
-
}),
|
|
535
|
-
(t.addChildJson = function (e, t) {
|
|
536
|
-
var n = (0, Oe.getSchemaByIndexRoute)(e, this.jsonSchema);
|
|
537
|
-
if ((0, Oe.isContainerSchema)(n)) {
|
|
538
|
-
var a = this.getNewJsonKeyIndex(n);
|
|
539
|
-
n.propertyOrder.push(a),
|
|
540
|
-
(n.properties[a] = Ne),
|
|
541
|
-
this.jsonSchemaChange(t);
|
|
542
|
-
} else S.message.warning('非对象类型字段不允许插入子元素');
|
|
543
|
-
}),
|
|
544
|
-
(t.changeType = function (e, t, n, a) {
|
|
545
|
-
var o = (0, Oe.getParentIndexRoute)(e),
|
|
546
|
-
r = (0, Oe.getSchemaByIndexRoute)(o, this.jsonSchema);
|
|
547
|
-
r.properties && r.properties[t]
|
|
548
|
-
? (r.properties[t] = E(n))
|
|
549
|
-
: r[t] && (r[t] = E(n)),
|
|
550
|
-
this.jsonSchemaChange(a);
|
|
551
|
-
}),
|
|
552
|
-
(t.updateSchemaData = function (e, t, n) {
|
|
553
|
-
var a = (0, Oe.getSchemaByIndexRoute)(e, this.jsonSchema);
|
|
554
|
-
Object.assign(a, E(t)), this.jsonSchemaChange(n);
|
|
555
|
-
}),
|
|
556
|
-
(t.editSchemaData = function (e, t, n, a) {
|
|
557
|
-
var o = (0, Oe.getParentIndexRoute)(e),
|
|
558
|
-
r = (0, Oe.getSchemaByIndexRoute)(o, this.jsonSchema);
|
|
559
|
-
(r.properties[t] = u()({}, E(r.properties[t]), n)),
|
|
560
|
-
this.jsonSchemaChange(a);
|
|
561
|
-
}),
|
|
562
|
-
(t.editJsonKey = function (e, t, n) {
|
|
563
|
-
var a = (0, Oe.getSchemaByIndexRoute)(
|
|
564
|
-
e,
|
|
565
|
-
this.jsonSchema,
|
|
566
|
-
!0,
|
|
567
|
-
);
|
|
568
|
-
this.insertJsonData(e, t, a, '', !0),
|
|
569
|
-
this.deleteJsonByIndex(e, !0),
|
|
570
|
-
this.jsonSchemaChange(n);
|
|
571
|
-
}),
|
|
572
|
-
(t.addNextJsonData = function (e) {
|
|
573
|
-
var t = (0, Oe.getParentIndexRoute)(e),
|
|
574
|
-
n = (0, Oe.getSchemaByIndexRoute)(t, this.jsonSchema),
|
|
575
|
-
a = this.getNewJsonKeyIndex(n);
|
|
576
|
-
this.insertJsonData(e, a, Ne);
|
|
577
|
-
}),
|
|
578
|
-
(t.insertJsonData = function (e, t, n, a, o) {
|
|
579
|
-
var r = (0, Oe.getParentIndexRoute_CurIndex)(e),
|
|
580
|
-
i = r[0],
|
|
581
|
-
s = r[1],
|
|
582
|
-
c = (0, Oe.getSchemaByIndexRoute)(i, this.jsonSchema);
|
|
583
|
-
c.properties[t] = n;
|
|
584
|
-
var l = c.propertyOrder,
|
|
585
|
-
p = 'before' === a ? Number(s) : Number(s) + 1,
|
|
586
|
-
d = l.slice(0, p),
|
|
587
|
-
m = l.slice(p);
|
|
588
|
-
(c.propertyOrder = [].concat(d, [t], m)),
|
|
589
|
-
this.jsonSchemaChange(o);
|
|
590
|
-
}),
|
|
591
|
-
(t.deleteJsonByIndex_CurKey = function (e, t, n) {
|
|
592
|
-
var a = (0, Oe.getParentIndexRoute)(e),
|
|
593
|
-
o = (0, Oe.getSchemaByIndexRoute)(a, this.jsonSchema);
|
|
594
|
-
delete o.properties[t];
|
|
595
|
-
var r = o.propertyOrder.indexOf(t);
|
|
596
|
-
o.propertyOrder.splice(r, 1), this.jsonSchemaChange(n);
|
|
597
|
-
}),
|
|
598
|
-
(t.deleteJsonByIndex = function (e, t) {
|
|
599
|
-
var n = (0, Oe.getParentIndexRoute_CurIndex)(e),
|
|
600
|
-
a = n[0],
|
|
601
|
-
o = n[1],
|
|
602
|
-
r = (0, Oe.getSchemaByIndexRoute)(a, this.jsonSchema),
|
|
603
|
-
i = r.propertyOrder[o];
|
|
604
|
-
delete r.properties[i];
|
|
605
|
-
var s = r.propertyOrder.indexOf(i);
|
|
606
|
-
r.propertyOrder.splice(s, 1), this.jsonSchemaChange(t);
|
|
607
|
-
}),
|
|
608
|
-
(t.updateEnumItem = function (e, t, n, a, o) {
|
|
609
|
-
var r = (0, Oe.getSchemaByIndexRoute)(e, this.jsonSchema);
|
|
610
|
-
r.enum &&
|
|
611
|
-
r.enumextra &&
|
|
612
|
-
((r.enum[t] = n), (r.enumextra[t] = a)),
|
|
613
|
-
this.jsonSchemaChange(o);
|
|
614
|
-
}),
|
|
615
|
-
(t.isExitEnumKey = function (e, t, n) {
|
|
616
|
-
var a = !1,
|
|
617
|
-
o = (0, Oe.getSchemaByIndexRoute)(e, this.jsonSchema);
|
|
618
|
-
if (o.enum) {
|
|
619
|
-
var r = E(o.enum);
|
|
620
|
-
t >= 0 && r.splice(t, 1), r.indexOf(n) >= 0 && (a = !0);
|
|
621
|
-
}
|
|
622
|
-
return (
|
|
623
|
-
Oe.KeyWordList &&
|
|
624
|
-
Oe.KeyWordList.indexOf(n) >= 0 &&
|
|
625
|
-
S.message.warning(
|
|
626
|
-
n +
|
|
627
|
-
'是JSONSchema的关键字,建议您换一个,避免后续出现数据异常。',
|
|
628
|
-
),
|
|
629
|
-
a
|
|
630
|
-
);
|
|
631
|
-
}),
|
|
632
|
-
(t.updateEnumKey = function (e, t, n, a) {
|
|
633
|
-
var o = (0, Oe.getSchemaByIndexRoute)(e, this.jsonSchema);
|
|
634
|
-
o.enum && (o.enum[t] = n), this.jsonSchemaChange(a);
|
|
635
|
-
}),
|
|
636
|
-
(t.updateEnumText = function (e, t, n, a) {
|
|
637
|
-
var o = (0, Oe.getSchemaByIndexRoute)(e, this.jsonSchema);
|
|
638
|
-
o.enumextra && (o.enumextra[t] = n),
|
|
639
|
-
this.jsonSchemaChange(a);
|
|
640
|
-
}),
|
|
641
|
-
(t.deleteEnumItem = function (e, t, n) {
|
|
642
|
-
var a = (0, Oe.getSchemaByIndexRoute)(e, this.jsonSchema);
|
|
643
|
-
a.enum &&
|
|
644
|
-
a.enumextra &&
|
|
645
|
-
(a.enum.splice(t, 1), a.enumextra.splice(t, 1)),
|
|
646
|
-
this.jsonSchemaChange(n);
|
|
647
|
-
}),
|
|
648
|
-
(t.insertEnumItem = function (e, t, n, a, o, r) {
|
|
649
|
-
var i = (0, Oe.getSchemaByIndexRoute)(e, this.jsonSchema);
|
|
650
|
-
if (i.enum && i.enumextra) {
|
|
651
|
-
var s = 'before' === o ? Number(t) : Number(t) + 1,
|
|
652
|
-
c = i.enum.slice(0, s),
|
|
653
|
-
l = i.enum.slice(s);
|
|
654
|
-
i.enum = [].concat(c, [n], l);
|
|
655
|
-
var p = i.enumextra.slice(0, s),
|
|
656
|
-
d = i.enumextra.slice(s);
|
|
657
|
-
i.enumextra = [].concat(p, [a], d);
|
|
658
|
-
}
|
|
659
|
-
this.jsonSchemaChange(r);
|
|
660
|
-
}),
|
|
661
|
-
(t.getNewEnumIndex = function (e, t) {
|
|
662
|
-
var n = (t || 'enum') + '_' + this.curJsonKeyIndex;
|
|
663
|
-
return (
|
|
664
|
-
e.indexOf(n) >= 0 &&
|
|
665
|
-
((this.curJsonKeyIndex += 1),
|
|
666
|
-
(n = this.getNewEnumIndex(e, t))),
|
|
667
|
-
(this.curJsonKeyIndex += 1),
|
|
668
|
-
n
|
|
669
|
-
);
|
|
670
|
-
}),
|
|
671
|
-
(t.addEnumItem = function (e, t) {
|
|
672
|
-
var n = (0, Oe.getSchemaByIndexRoute)(e, this.jsonSchema);
|
|
673
|
-
if (n.enum) {
|
|
674
|
-
var a = this.getNewEnumIndex(n.enum),
|
|
675
|
-
o = '选项' + (this.curJsonKeyIndex - 1);
|
|
676
|
-
this.insertEnumItem(e, t, a, o);
|
|
677
|
-
}
|
|
678
|
-
}),
|
|
679
|
-
(t.copyEnumItem = function (e, t) {
|
|
680
|
-
var n = (0, Oe.getSchemaByIndexRoute)(e, this.jsonSchema);
|
|
681
|
-
if (n.enum) {
|
|
682
|
-
var a = n.enum[t],
|
|
683
|
-
o = n.enumextra[t],
|
|
684
|
-
r = this.getNewEnumIndex(n.enum, a),
|
|
685
|
-
i = o + '_' + (this.curJsonKeyIndex - 1);
|
|
686
|
-
this.insertEnumItem(e, t, r, i);
|
|
687
|
-
}
|
|
688
|
-
}),
|
|
689
|
-
(t.updateOptionItem = function (e, t, n, a, o) {
|
|
690
|
-
var r = (0, Oe.getSchemaByIndexRoute)(e, this.jsonSchema);
|
|
691
|
-
r.options &&
|
|
692
|
-
r.options[t] &&
|
|
693
|
-
((r.options[t].label = n), (r.options[t].value = a)),
|
|
694
|
-
this.jsonSchemaChange(o);
|
|
695
|
-
}),
|
|
696
|
-
(t.isExitOptionLabel = function (e, t) {
|
|
697
|
-
var n = !1,
|
|
698
|
-
a = (0, Oe.getSchemaByIndexRoute)(e, this.jsonSchema);
|
|
699
|
-
return (
|
|
700
|
-
a.options &&
|
|
701
|
-
a.options.find(function (e) {
|
|
702
|
-
return e.label === t || e.name === t;
|
|
703
|
-
}) &&
|
|
704
|
-
(n = !0),
|
|
705
|
-
Oe.KeyWordList &&
|
|
706
|
-
Oe.KeyWordList.indexOf(t) >= 0 &&
|
|
707
|
-
S.message.warning(
|
|
708
|
-
t + '是JSONSchema的保留关键字,建议您换一个名称。',
|
|
709
|
-
),
|
|
710
|
-
n
|
|
711
|
-
);
|
|
712
|
-
}),
|
|
713
|
-
(t.updateOptionLabel = function (e, t, n, a) {
|
|
714
|
-
var o = (0, Oe.getSchemaByIndexRoute)(e, this.jsonSchema);
|
|
715
|
-
o.options && o.options[t] && (o.options[t].label = n),
|
|
716
|
-
this.jsonSchemaChange(a);
|
|
717
|
-
}),
|
|
718
|
-
(t.updateOptionValue = function (e, t, n, a) {
|
|
719
|
-
var o = (0, Oe.getSchemaByIndexRoute)(e, this.jsonSchema);
|
|
720
|
-
o.options && o.options[t] && (o.options[t].value = n),
|
|
721
|
-
this.jsonSchemaChange(a);
|
|
722
|
-
}),
|
|
723
|
-
(t.deleteOptionItem = function (e, t, n) {
|
|
724
|
-
var a = (0, Oe.getSchemaByIndexRoute)(e, this.jsonSchema);
|
|
725
|
-
a.options && a.options[t] && a.options.splice(t, 1),
|
|
726
|
-
this.jsonSchemaChange(n);
|
|
727
|
-
}),
|
|
728
|
-
(t.insertOption = function (e, t, n, a, o, r) {
|
|
729
|
-
var i = (0, Oe.getSchemaByIndexRoute)(e, this.jsonSchema);
|
|
730
|
-
if (i.options) {
|
|
731
|
-
var s = 'before' === o ? Number(t) : Number(t) + 1,
|
|
732
|
-
c = i.options.slice(0, s),
|
|
733
|
-
l = i.options.slice(s),
|
|
734
|
-
p = { label: n, value: a };
|
|
735
|
-
i.options = [].concat(c, [p], l);
|
|
736
|
-
}
|
|
737
|
-
this.jsonSchemaChange(r);
|
|
738
|
-
}),
|
|
739
|
-
(t.getNewOptionValue = function (e) {
|
|
740
|
-
return e && e.length > 0
|
|
741
|
-
? e[e.length - 1].value + '_' + (e.length + 1)
|
|
742
|
-
: 'value1';
|
|
743
|
-
}),
|
|
744
|
-
(t.addOptionItem = function (e, t) {
|
|
745
|
-
var n = (0, Oe.getSchemaByIndexRoute)(e, this.jsonSchema);
|
|
746
|
-
if (n.options) {
|
|
747
|
-
var a = this.getNewOptionValue(n.options),
|
|
748
|
-
o = '选项' + (n.options.length + 1);
|
|
749
|
-
this.insertOption(e, t, o, a);
|
|
750
|
-
}
|
|
751
|
-
}),
|
|
752
|
-
(t.copyOptionItem = function (e, t) {
|
|
753
|
-
var n = (0, Oe.getSchemaByIndexRoute)(e, this.jsonSchema);
|
|
754
|
-
if (n.options) {
|
|
755
|
-
n.options[t];
|
|
756
|
-
var a = this.getNewOptionValue(n.options),
|
|
757
|
-
o = (label, name + '_copy');
|
|
758
|
-
this.insertOption(e, t, o, a);
|
|
759
|
-
}
|
|
760
|
-
}),
|
|
761
|
-
f()(e, [
|
|
762
|
-
{
|
|
763
|
-
key: 'JSONSchemaObj',
|
|
764
|
-
get: function () {
|
|
765
|
-
return (0, b.toJS)(this.jsonSchema);
|
|
766
|
-
},
|
|
767
|
-
},
|
|
768
|
-
])
|
|
769
|
-
);
|
|
770
|
-
})()),
|
|
771
|
-
(me = x()(de.prototype, 'triggerChange', [b.observable], {
|
|
772
|
-
configurable: !0,
|
|
773
|
-
enumerable: !0,
|
|
774
|
-
writable: !0,
|
|
775
|
-
initializer: function () {
|
|
776
|
-
return !1;
|
|
777
|
-
},
|
|
778
|
-
})),
|
|
779
|
-
(ue = x()(de.prototype, 'jsonSchema', [b.observable], {
|
|
780
|
-
configurable: !0,
|
|
781
|
-
enumerable: !0,
|
|
782
|
-
writable: !0,
|
|
783
|
-
initializer: function () {
|
|
784
|
-
return {};
|
|
785
|
-
},
|
|
786
|
-
})),
|
|
787
|
-
(he = x()(de.prototype, 'SchemaTypeList', [b.observable], {
|
|
788
|
-
configurable: !0,
|
|
789
|
-
enumerable: !0,
|
|
790
|
-
writable: !0,
|
|
791
|
-
initializer: function () {
|
|
792
|
-
return Ee;
|
|
793
|
-
},
|
|
794
|
-
})),
|
|
795
|
-
(ye = x()(de.prototype, 'onChange', [b.observable], {
|
|
796
|
-
configurable: !0,
|
|
797
|
-
enumerable: !0,
|
|
798
|
-
writable: !0,
|
|
799
|
-
initializer: function () {
|
|
800
|
-
return function () {};
|
|
801
|
-
},
|
|
802
|
-
})),
|
|
803
|
-
x()(
|
|
804
|
-
de.prototype,
|
|
805
|
-
'triggerChangeAction',
|
|
806
|
-
[N],
|
|
807
|
-
Object.getOwnPropertyDescriptor(
|
|
808
|
-
de.prototype,
|
|
809
|
-
'triggerChangeAction',
|
|
810
|
-
),
|
|
811
|
-
de.prototype,
|
|
812
|
-
),
|
|
813
|
-
x()(
|
|
814
|
-
de.prototype,
|
|
815
|
-
'initSchemaTypeList',
|
|
816
|
-
[j],
|
|
817
|
-
Object.getOwnPropertyDescriptor(
|
|
818
|
-
de.prototype,
|
|
819
|
-
'initSchemaTypeList',
|
|
820
|
-
),
|
|
821
|
-
de.prototype,
|
|
822
|
-
),
|
|
823
|
-
x()(
|
|
824
|
-
de.prototype,
|
|
825
|
-
'initJSONSchemaData',
|
|
826
|
-
[w],
|
|
827
|
-
Object.getOwnPropertyDescriptor(
|
|
828
|
-
de.prototype,
|
|
829
|
-
'initJSONSchemaData',
|
|
830
|
-
),
|
|
831
|
-
de.prototype,
|
|
832
|
-
),
|
|
833
|
-
x()(
|
|
834
|
-
de.prototype,
|
|
835
|
-
'JSONSchemaObj',
|
|
836
|
-
[b.computed],
|
|
837
|
-
Object.getOwnPropertyDescriptor(de.prototype, 'JSONSchemaObj'),
|
|
838
|
-
de.prototype,
|
|
839
|
-
),
|
|
840
|
-
x()(
|
|
841
|
-
de.prototype,
|
|
842
|
-
'initOnChange',
|
|
843
|
-
[I],
|
|
844
|
-
Object.getOwnPropertyDescriptor(de.prototype, 'initOnChange'),
|
|
845
|
-
de.prototype,
|
|
846
|
-
),
|
|
847
|
-
x()(
|
|
848
|
-
de.prototype,
|
|
849
|
-
'jsonSchemaChange',
|
|
850
|
-
[R],
|
|
851
|
-
Object.getOwnPropertyDescriptor(
|
|
852
|
-
de.prototype,
|
|
853
|
-
'jsonSchemaChange',
|
|
854
|
-
),
|
|
855
|
-
de.prototype,
|
|
856
|
-
),
|
|
857
|
-
x()(
|
|
858
|
-
de.prototype,
|
|
859
|
-
'indexRoute2keyRoute',
|
|
860
|
-
[K],
|
|
861
|
-
Object.getOwnPropertyDescriptor(
|
|
862
|
-
de.prototype,
|
|
863
|
-
'indexRoute2keyRoute',
|
|
864
|
-
),
|
|
865
|
-
de.prototype,
|
|
866
|
-
),
|
|
867
|
-
x()(
|
|
868
|
-
de.prototype,
|
|
869
|
-
'keyRoute2indexRoute',
|
|
870
|
-
[k],
|
|
871
|
-
Object.getOwnPropertyDescriptor(
|
|
872
|
-
de.prototype,
|
|
873
|
-
'keyRoute2indexRoute',
|
|
874
|
-
),
|
|
875
|
-
de.prototype,
|
|
876
|
-
),
|
|
877
|
-
x()(
|
|
878
|
-
de.prototype,
|
|
879
|
-
'getSchemaByIndexRoute',
|
|
880
|
-
[T],
|
|
881
|
-
Object.getOwnPropertyDescriptor(
|
|
882
|
-
de.prototype,
|
|
883
|
-
'getSchemaByIndexRoute',
|
|
884
|
-
),
|
|
885
|
-
de.prototype,
|
|
886
|
-
),
|
|
887
|
-
x()(
|
|
888
|
-
de.prototype,
|
|
889
|
-
'getSchemaByKeyRoute',
|
|
890
|
-
[J],
|
|
891
|
-
Object.getOwnPropertyDescriptor(
|
|
892
|
-
de.prototype,
|
|
893
|
-
'getSchemaByKeyRoute',
|
|
894
|
-
),
|
|
895
|
-
de.prototype,
|
|
896
|
-
),
|
|
897
|
-
x()(
|
|
898
|
-
de.prototype,
|
|
899
|
-
'getNewJsonKeyIndex',
|
|
900
|
-
[D],
|
|
901
|
-
Object.getOwnPropertyDescriptor(
|
|
902
|
-
de.prototype,
|
|
903
|
-
'getNewJsonKeyIndex',
|
|
904
|
-
),
|
|
905
|
-
de.prototype,
|
|
906
|
-
),
|
|
907
|
-
x()(
|
|
908
|
-
de.prototype,
|
|
909
|
-
'isExitJsonKey',
|
|
910
|
-
[B],
|
|
911
|
-
Object.getOwnPropertyDescriptor(de.prototype, 'isExitJsonKey'),
|
|
912
|
-
de.prototype,
|
|
913
|
-
),
|
|
914
|
-
x()(
|
|
915
|
-
de.prototype,
|
|
916
|
-
'isSupportCurType',
|
|
917
|
-
[P],
|
|
918
|
-
Object.getOwnPropertyDescriptor(
|
|
919
|
-
de.prototype,
|
|
920
|
-
'isSupportCurType',
|
|
921
|
-
),
|
|
922
|
-
de.prototype,
|
|
923
|
-
),
|
|
924
|
-
x()(
|
|
925
|
-
de.prototype,
|
|
926
|
-
'addChildJson',
|
|
927
|
-
[V],
|
|
928
|
-
Object.getOwnPropertyDescriptor(de.prototype, 'addChildJson'),
|
|
929
|
-
de.prototype,
|
|
930
|
-
),
|
|
931
|
-
x()(
|
|
932
|
-
de.prototype,
|
|
933
|
-
'changeType',
|
|
934
|
-
[L],
|
|
935
|
-
Object.getOwnPropertyDescriptor(de.prototype, 'changeType'),
|
|
936
|
-
de.prototype,
|
|
937
|
-
),
|
|
938
|
-
x()(
|
|
939
|
-
de.prototype,
|
|
940
|
-
'updateSchemaData',
|
|
941
|
-
[F],
|
|
942
|
-
Object.getOwnPropertyDescriptor(
|
|
943
|
-
de.prototype,
|
|
944
|
-
'updateSchemaData',
|
|
945
|
-
),
|
|
946
|
-
de.prototype,
|
|
947
|
-
),
|
|
948
|
-
x()(
|
|
949
|
-
de.prototype,
|
|
950
|
-
'editSchemaData',
|
|
951
|
-
[q],
|
|
952
|
-
Object.getOwnPropertyDescriptor(de.prototype, 'editSchemaData'),
|
|
953
|
-
de.prototype,
|
|
954
|
-
),
|
|
955
|
-
x()(
|
|
956
|
-
de.prototype,
|
|
957
|
-
'editJsonKey',
|
|
958
|
-
[A],
|
|
959
|
-
Object.getOwnPropertyDescriptor(de.prototype, 'editJsonKey'),
|
|
960
|
-
de.prototype,
|
|
961
|
-
),
|
|
962
|
-
x()(
|
|
963
|
-
de.prototype,
|
|
964
|
-
'addNextJsonData',
|
|
965
|
-
[_],
|
|
966
|
-
Object.getOwnPropertyDescriptor(
|
|
967
|
-
de.prototype,
|
|
968
|
-
'addNextJsonData',
|
|
969
|
-
),
|
|
970
|
-
de.prototype,
|
|
971
|
-
),
|
|
972
|
-
x()(
|
|
973
|
-
de.prototype,
|
|
974
|
-
'insertJsonData',
|
|
975
|
-
[M],
|
|
976
|
-
Object.getOwnPropertyDescriptor(de.prototype, 'insertJsonData'),
|
|
977
|
-
de.prototype,
|
|
978
|
-
),
|
|
979
|
-
x()(
|
|
980
|
-
de.prototype,
|
|
981
|
-
'deleteJsonByIndex_CurKey',
|
|
982
|
-
[W],
|
|
983
|
-
Object.getOwnPropertyDescriptor(
|
|
984
|
-
de.prototype,
|
|
985
|
-
'deleteJsonByIndex_CurKey',
|
|
986
|
-
),
|
|
987
|
-
de.prototype,
|
|
988
|
-
),
|
|
989
|
-
x()(
|
|
990
|
-
de.prototype,
|
|
991
|
-
'deleteJsonByIndex',
|
|
992
|
-
[z],
|
|
993
|
-
Object.getOwnPropertyDescriptor(
|
|
994
|
-
de.prototype,
|
|
995
|
-
'deleteJsonByIndex',
|
|
996
|
-
),
|
|
997
|
-
de.prototype,
|
|
998
|
-
),
|
|
999
|
-
x()(
|
|
1000
|
-
de.prototype,
|
|
1001
|
-
'updateEnumItem',
|
|
1002
|
-
[G],
|
|
1003
|
-
Object.getOwnPropertyDescriptor(de.prototype, 'updateEnumItem'),
|
|
1004
|
-
de.prototype,
|
|
1005
|
-
),
|
|
1006
|
-
x()(
|
|
1007
|
-
de.prototype,
|
|
1008
|
-
'isExitEnumKey',
|
|
1009
|
-
[U],
|
|
1010
|
-
Object.getOwnPropertyDescriptor(de.prototype, 'isExitEnumKey'),
|
|
1011
|
-
de.prototype,
|
|
1012
|
-
),
|
|
1013
|
-
x()(
|
|
1014
|
-
de.prototype,
|
|
1015
|
-
'updateEnumKey',
|
|
1016
|
-
[H],
|
|
1017
|
-
Object.getOwnPropertyDescriptor(de.prototype, 'updateEnumKey'),
|
|
1018
|
-
de.prototype,
|
|
1019
|
-
),
|
|
1020
|
-
x()(
|
|
1021
|
-
de.prototype,
|
|
1022
|
-
'updateEnumText',
|
|
1023
|
-
[X],
|
|
1024
|
-
Object.getOwnPropertyDescriptor(de.prototype, 'updateEnumText'),
|
|
1025
|
-
de.prototype,
|
|
1026
|
-
),
|
|
1027
|
-
x()(
|
|
1028
|
-
de.prototype,
|
|
1029
|
-
'deleteEnumItem',
|
|
1030
|
-
[Q],
|
|
1031
|
-
Object.getOwnPropertyDescriptor(de.prototype, 'deleteEnumItem'),
|
|
1032
|
-
de.prototype,
|
|
1033
|
-
),
|
|
1034
|
-
x()(
|
|
1035
|
-
de.prototype,
|
|
1036
|
-
'insertEnumItem',
|
|
1037
|
-
[Y],
|
|
1038
|
-
Object.getOwnPropertyDescriptor(de.prototype, 'insertEnumItem'),
|
|
1039
|
-
de.prototype,
|
|
1040
|
-
),
|
|
1041
|
-
x()(
|
|
1042
|
-
de.prototype,
|
|
1043
|
-
'getNewEnumIndex',
|
|
1044
|
-
[Z],
|
|
1045
|
-
Object.getOwnPropertyDescriptor(
|
|
1046
|
-
de.prototype,
|
|
1047
|
-
'getNewEnumIndex',
|
|
1048
|
-
),
|
|
1049
|
-
de.prototype,
|
|
1050
|
-
),
|
|
1051
|
-
x()(
|
|
1052
|
-
de.prototype,
|
|
1053
|
-
'addEnumItem',
|
|
1054
|
-
[$],
|
|
1055
|
-
Object.getOwnPropertyDescriptor(de.prototype, 'addEnumItem'),
|
|
1056
|
-
de.prototype,
|
|
1057
|
-
),
|
|
1058
|
-
x()(
|
|
1059
|
-
de.prototype,
|
|
1060
|
-
'copyEnumItem',
|
|
1061
|
-
[ee],
|
|
1062
|
-
Object.getOwnPropertyDescriptor(de.prototype, 'copyEnumItem'),
|
|
1063
|
-
de.prototype,
|
|
1064
|
-
),
|
|
1065
|
-
x()(
|
|
1066
|
-
de.prototype,
|
|
1067
|
-
'updateOptionItem',
|
|
1068
|
-
[te],
|
|
1069
|
-
Object.getOwnPropertyDescriptor(
|
|
1070
|
-
de.prototype,
|
|
1071
|
-
'updateOptionItem',
|
|
1072
|
-
),
|
|
1073
|
-
de.prototype,
|
|
1074
|
-
),
|
|
1075
|
-
x()(
|
|
1076
|
-
de.prototype,
|
|
1077
|
-
'isExitOptionLabel',
|
|
1078
|
-
[ne],
|
|
1079
|
-
Object.getOwnPropertyDescriptor(
|
|
1080
|
-
de.prototype,
|
|
1081
|
-
'isExitOptionLabel',
|
|
1082
|
-
),
|
|
1083
|
-
de.prototype,
|
|
1084
|
-
),
|
|
1085
|
-
x()(
|
|
1086
|
-
de.prototype,
|
|
1087
|
-
'updateOptionLabel',
|
|
1088
|
-
[ae],
|
|
1089
|
-
Object.getOwnPropertyDescriptor(
|
|
1090
|
-
de.prototype,
|
|
1091
|
-
'updateOptionLabel',
|
|
1092
|
-
),
|
|
1093
|
-
de.prototype,
|
|
1094
|
-
),
|
|
1095
|
-
x()(
|
|
1096
|
-
de.prototype,
|
|
1097
|
-
'updateOptionValue',
|
|
1098
|
-
[oe],
|
|
1099
|
-
Object.getOwnPropertyDescriptor(
|
|
1100
|
-
de.prototype,
|
|
1101
|
-
'updateOptionValue',
|
|
1102
|
-
),
|
|
1103
|
-
de.prototype,
|
|
1104
|
-
),
|
|
1105
|
-
x()(
|
|
1106
|
-
de.prototype,
|
|
1107
|
-
'deleteOptionItem',
|
|
1108
|
-
[re],
|
|
1109
|
-
Object.getOwnPropertyDescriptor(
|
|
1110
|
-
de.prototype,
|
|
1111
|
-
'deleteOptionItem',
|
|
1112
|
-
),
|
|
1113
|
-
de.prototype,
|
|
1114
|
-
),
|
|
1115
|
-
x()(
|
|
1116
|
-
de.prototype,
|
|
1117
|
-
'insertOption',
|
|
1118
|
-
[ie],
|
|
1119
|
-
Object.getOwnPropertyDescriptor(de.prototype, 'insertOption'),
|
|
1120
|
-
de.prototype,
|
|
1121
|
-
),
|
|
1122
|
-
x()(
|
|
1123
|
-
de.prototype,
|
|
1124
|
-
'getNewOptionValue',
|
|
1125
|
-
[se],
|
|
1126
|
-
Object.getOwnPropertyDescriptor(
|
|
1127
|
-
de.prototype,
|
|
1128
|
-
'getNewOptionValue',
|
|
1129
|
-
),
|
|
1130
|
-
de.prototype,
|
|
1131
|
-
),
|
|
1132
|
-
x()(
|
|
1133
|
-
de.prototype,
|
|
1134
|
-
'addOptionItem',
|
|
1135
|
-
[ce],
|
|
1136
|
-
Object.getOwnPropertyDescriptor(de.prototype, 'addOptionItem'),
|
|
1137
|
-
de.prototype,
|
|
1138
|
-
),
|
|
1139
|
-
x()(
|
|
1140
|
-
de.prototype,
|
|
1141
|
-
'copyOptionItem',
|
|
1142
|
-
[le],
|
|
1143
|
-
Object.getOwnPropertyDescriptor(de.prototype, 'copyOptionItem'),
|
|
1144
|
-
de.prototype,
|
|
1145
|
-
),
|
|
1146
|
-
(ge = x()(de.prototype, 'childElemSort', [pe], {
|
|
1147
|
-
configurable: !0,
|
|
1148
|
-
enumerable: !0,
|
|
1149
|
-
writable: !0,
|
|
1150
|
-
initializer: function () {
|
|
1151
|
-
var e = this;
|
|
1152
|
-
return function (t) {
|
|
1153
|
-
for (
|
|
1154
|
-
var n = (0, Oe.getSchemaByIndexRoute)(t, e.jsonSchema),
|
|
1155
|
-
a = n.propertyOrder,
|
|
1156
|
-
o = [],
|
|
1157
|
-
r = [],
|
|
1158
|
-
i = [],
|
|
1159
|
-
s = [],
|
|
1160
|
-
c = [],
|
|
1161
|
-
l = [],
|
|
1162
|
-
p = [],
|
|
1163
|
-
d = [],
|
|
1164
|
-
m = 0,
|
|
1165
|
-
u = a.length;
|
|
1166
|
-
m < u;
|
|
1167
|
-
m++
|
|
1168
|
-
) {
|
|
1169
|
-
var h = a[m];
|
|
1170
|
-
switch (n.properties[h].type) {
|
|
1171
|
-
case 'input':
|
|
1172
|
-
case 'url':
|
|
1173
|
-
o.push(h);
|
|
1174
|
-
break;
|
|
1175
|
-
case 'number':
|
|
1176
|
-
case 'quantity':
|
|
1177
|
-
r.push(h);
|
|
1178
|
-
break;
|
|
1179
|
-
case 'radio':
|
|
1180
|
-
case 'checkboxes':
|
|
1181
|
-
case 'boolean':
|
|
1182
|
-
case 'color':
|
|
1183
|
-
i.push(h);
|
|
1184
|
-
break;
|
|
1185
|
-
case 'date':
|
|
1186
|
-
case 'date-time':
|
|
1187
|
-
case 'time':
|
|
1188
|
-
s.push(h);
|
|
1189
|
-
break;
|
|
1190
|
-
case 'textarea':
|
|
1191
|
-
case 'json':
|
|
1192
|
-
case 'codearea':
|
|
1193
|
-
case 'htmlarea':
|
|
1194
|
-
c.push(h);
|
|
1195
|
-
break;
|
|
1196
|
-
case 'image':
|
|
1197
|
-
l.push(h);
|
|
1198
|
-
break;
|
|
1199
|
-
case 'object':
|
|
1200
|
-
case 'array':
|
|
1201
|
-
p.push(h);
|
|
1202
|
-
break;
|
|
1203
|
-
default:
|
|
1204
|
-
d.push(h);
|
|
1205
|
-
}
|
|
1206
|
-
}
|
|
1207
|
-
(n.propertyOrder = [].concat(o, r, i, s, l, c, p, d)),
|
|
1208
|
-
e.jsonSchemaChange();
|
|
1209
|
-
};
|
|
1210
|
-
},
|
|
1211
|
-
})),
|
|
1212
|
-
de),
|
|
1213
|
-
},
|
|
1214
|
-
we = require('@ant-design/icons'),
|
|
1215
|
-
Ie = require('react-ace'),
|
|
1216
|
-
Re = n.n(Ie),
|
|
1217
|
-
Ke =
|
|
1218
|
-
(require('ace-builds/src-noconflict/mode-json'),
|
|
1219
|
-
require('ace-builds/src-noconflict/theme-solarized_light'),
|
|
1220
|
-
n(975),
|
|
1221
|
-
S.Input.TextArea),
|
|
1222
|
-
ke =
|
|
1223
|
-
(S.Select.Option,
|
|
1224
|
-
(function (e) {
|
|
1225
|
-
function t(t) {
|
|
1226
|
-
var n;
|
|
1227
|
-
return (
|
|
1228
|
-
((n = e.call(this, t) || this).handleValueChange = function (
|
|
1229
|
-
e,
|
|
1230
|
-
t,
|
|
1231
|
-
) {
|
|
1232
|
-
var a = (n.props.schemaStore || {}).editSchemaData,
|
|
1233
|
-
o = n.props,
|
|
1234
|
-
r = o.indexRoute,
|
|
1235
|
-
i = o.jsonKey;
|
|
1236
|
-
if (o.targetJsonSchema[e] !== t) {
|
|
1237
|
-
var s = {};
|
|
1238
|
-
(s[e] = t), a(r, i, s);
|
|
1239
|
-
}
|
|
1240
|
-
}),
|
|
1241
|
-
(n.renderDefaultContent = function (e, t, a) {
|
|
1242
|
-
if ('boolean' === e)
|
|
1243
|
-
return r.createElement(S.Switch, {
|
|
1244
|
-
style: { display: 'inline-block' },
|
|
1245
|
-
defaultChecked: t.default,
|
|
1246
|
-
checkedChildren: 'true',
|
|
1247
|
-
unCheckedChildren: 'false',
|
|
1248
|
-
onChange: function (e) {
|
|
1249
|
-
n.handleValueChange('default', e);
|
|
1250
|
-
},
|
|
1251
|
-
});
|
|
1252
|
-
if ('checkboxes' === e || ('select' === e && t.multiple)) {
|
|
1253
|
-
var o = t.options;
|
|
1254
|
-
return r.createElement(
|
|
1255
|
-
S.Checkbox.Group,
|
|
1256
|
-
{
|
|
1257
|
-
style: { display: 'inline-block' },
|
|
1258
|
-
onChange: function (e) {
|
|
1259
|
-
n.handleValueChange('default', e);
|
|
1260
|
-
},
|
|
1261
|
-
defaultValue: t.default,
|
|
1262
|
-
},
|
|
1263
|
-
o &&
|
|
1264
|
-
o.length > 0 &&
|
|
1265
|
-
o.map(function (e, t) {
|
|
1266
|
-
var n = a + '-options-' + t;
|
|
1267
|
-
return r.createElement(
|
|
1268
|
-
S.Checkbox,
|
|
1269
|
-
{ value: e.value, key: n },
|
|
1270
|
-
e.label || e.name,
|
|
1271
|
-
);
|
|
1272
|
-
}),
|
|
1273
|
-
);
|
|
1274
|
-
}
|
|
1275
|
-
if ('radio' === e || 'select' === e) {
|
|
1276
|
-
var i = t.options;
|
|
1277
|
-
return r.createElement(
|
|
1278
|
-
S.Radio.Group,
|
|
1279
|
-
{
|
|
1280
|
-
style: { display: 'inline-block' },
|
|
1281
|
-
defaultValue: t.default,
|
|
1282
|
-
onChange: function (e) {
|
|
1283
|
-
var t = e.target.value;
|
|
1284
|
-
n.handleValueChange('default', t);
|
|
1285
|
-
},
|
|
1286
|
-
},
|
|
1287
|
-
i &&
|
|
1288
|
-
i.length > 0 &&
|
|
1289
|
-
i.map(function (e, t) {
|
|
1290
|
-
var n = a + '-options-' + t;
|
|
1291
|
-
return r.createElement(
|
|
1292
|
-
S.Radio,
|
|
1293
|
-
{ value: e.value, key: n },
|
|
1294
|
-
e.label || e.name,
|
|
1295
|
-
);
|
|
1296
|
-
}),
|
|
1297
|
-
);
|
|
1298
|
-
}
|
|
1299
|
-
return 'color' === e
|
|
1300
|
-
? r.createElement(S.Input, {
|
|
1301
|
-
style: { display: 'inline-block' },
|
|
1302
|
-
className: 'color-item-form',
|
|
1303
|
-
type: 'color',
|
|
1304
|
-
defaultValue: t.default,
|
|
1305
|
-
onChange: function (e) {
|
|
1306
|
-
var t = e.target.value;
|
|
1307
|
-
n.handleValueChange('default', t);
|
|
1308
|
-
},
|
|
1309
|
-
})
|
|
1310
|
-
: 'textarea' === e ||
|
|
1311
|
-
'codearea' === e ||
|
|
1312
|
-
'htmlarea' === e ||
|
|
1313
|
-
'json' === e
|
|
1314
|
-
? r.createElement(Ke, {
|
|
1315
|
-
style: { display: 'inline-block' },
|
|
1316
|
-
rows: 4,
|
|
1317
|
-
placeholder: '请输入' + t.title + '的默认值',
|
|
1318
|
-
defaultValue: t.default,
|
|
1319
|
-
onPressEnter: function (e) {
|
|
1320
|
-
var t = e.target.value;
|
|
1321
|
-
n.handleValueChange('default', t);
|
|
1322
|
-
},
|
|
1323
|
-
onBlur: function (e) {
|
|
1324
|
-
var t = e.target.value;
|
|
1325
|
-
n.handleValueChange('default', t);
|
|
1326
|
-
},
|
|
1327
|
-
})
|
|
1328
|
-
: 'number' === e
|
|
1329
|
-
? r.createElement(S.InputNumber, {
|
|
1330
|
-
style: { display: 'inline-block' },
|
|
1331
|
-
placeholder: '请输入' + t.title + '的默认值',
|
|
1332
|
-
defaultValue: t.default,
|
|
1333
|
-
onChange: function (e) {
|
|
1334
|
-
n.handleValueChange('default', e);
|
|
1335
|
-
},
|
|
1336
|
-
})
|
|
1337
|
-
: r.createElement(S.Input, {
|
|
1338
|
-
style: { display: 'inline-block' },
|
|
1339
|
-
placeholder: '请输入' + t.title + '的默认值',
|
|
1340
|
-
defaultValue: t.default,
|
|
1341
|
-
onPressEnter: function (e) {
|
|
1342
|
-
var t = e.target.value;
|
|
1343
|
-
n.handleValueChange('default', t);
|
|
1344
|
-
},
|
|
1345
|
-
onBlur: function (e) {
|
|
1346
|
-
var t = e.target.value;
|
|
1347
|
-
n.handleValueChange('default', t);
|
|
1348
|
-
},
|
|
1349
|
-
});
|
|
1350
|
-
}),
|
|
1351
|
-
(n.state = {
|
|
1352
|
-
isShowWarn: !1,
|
|
1353
|
-
warnText: '',
|
|
1354
|
-
curJSONDataTemp: void 0,
|
|
1355
|
-
}),
|
|
1356
|
-
(n.handleValueChange = n.handleValueChange.bind(n)),
|
|
1357
|
-
n
|
|
1358
|
-
);
|
|
1359
|
-
}
|
|
1360
|
-
return (
|
|
1361
|
-
o()(t, e),
|
|
1362
|
-
(t.prototype.render = function () {
|
|
1363
|
-
var e,
|
|
1364
|
-
t = this,
|
|
1365
|
-
n = (this.props.schemaStore || {}).indexRoute2keyRoute,
|
|
1366
|
-
a = this.props,
|
|
1367
|
-
o = a.nodeKey,
|
|
1368
|
-
i = a.indexRoute,
|
|
1369
|
-
s = a.targetJsonSchema,
|
|
1370
|
-
c = this.state,
|
|
1371
|
-
l = c.isShowWarn,
|
|
1372
|
-
p = c.warnText,
|
|
1373
|
-
d = c.curJSONDataTemp,
|
|
1374
|
-
m = s.type,
|
|
1375
|
-
u = (n(i), s.isConditionProp);
|
|
1376
|
-
return r.createElement(
|
|
1377
|
-
'div',
|
|
1378
|
-
{ className: 'advance-config-model' },
|
|
1379
|
-
(function (e) {
|
|
1380
|
-
return (
|
|
1381
|
-
[
|
|
1382
|
-
'boolean',
|
|
1383
|
-
'input',
|
|
1384
|
-
'number',
|
|
1385
|
-
'color',
|
|
1386
|
-
'url',
|
|
1387
|
-
'radio',
|
|
1388
|
-
'select',
|
|
1389
|
-
'date',
|
|
1390
|
-
'date-time',
|
|
1391
|
-
'time',
|
|
1392
|
-
'input-image',
|
|
1393
|
-
].indexOf(e) > -1
|
|
1394
|
-
);
|
|
1395
|
-
})(m) &&
|
|
1396
|
-
r.createElement(
|
|
1397
|
-
'div',
|
|
1398
|
-
{
|
|
1399
|
-
className: 'wide-screen-element-warp',
|
|
1400
|
-
key: o + '-isConditionProp',
|
|
1401
|
-
},
|
|
1402
|
-
r.createElement(
|
|
1403
|
-
'div',
|
|
1404
|
-
{ className: 'element-title' },
|
|
1405
|
-
r.createElement(
|
|
1406
|
-
S.Tooltip,
|
|
1407
|
-
{
|
|
1408
|
-
title:
|
|
1409
|
-
'设置为条件字段后,其他字段可根据其数值变化进行实时联动',
|
|
1410
|
-
placement: 'top',
|
|
1411
|
-
},
|
|
1412
|
-
r.createElement(
|
|
1413
|
-
'span',
|
|
1414
|
-
{ className: 'title-text' },
|
|
1415
|
-
'条件字段',
|
|
1416
|
-
),
|
|
1417
|
-
),
|
|
1418
|
-
),
|
|
1419
|
-
r.createElement(
|
|
1420
|
-
'div',
|
|
1421
|
-
{ className: 'content-item' },
|
|
1422
|
-
r.createElement(
|
|
1423
|
-
'div',
|
|
1424
|
-
{
|
|
1425
|
-
className: 'form-item-box',
|
|
1426
|
-
key: o + '-isConditionProp-switch',
|
|
1427
|
-
},
|
|
1428
|
-
r.createElement(S.Switch, {
|
|
1429
|
-
style: { display: 'inline-block' },
|
|
1430
|
-
defaultChecked: u,
|
|
1431
|
-
checkedChildren: '是',
|
|
1432
|
-
unCheckedChildren: '否',
|
|
1433
|
-
onChange: function (e) {
|
|
1434
|
-
t.handleValueChange('isConditionProp', e);
|
|
1435
|
-
},
|
|
1436
|
-
}),
|
|
1437
|
-
),
|
|
1438
|
-
),
|
|
1439
|
-
),
|
|
1440
|
-
('select' === m || 'cascader' === m) &&
|
|
1441
|
-
r.createElement(
|
|
1442
|
-
'div',
|
|
1443
|
-
{
|
|
1444
|
-
className: 'wide-screen-element-warp',
|
|
1445
|
-
key: o + '-selectConfig',
|
|
1446
|
-
},
|
|
1447
|
-
r.createElement(
|
|
1448
|
-
'div',
|
|
1449
|
-
{ className: 'element-title' },
|
|
1450
|
-
r.createElement(
|
|
1451
|
-
S.Tooltip,
|
|
1452
|
-
{
|
|
1453
|
-
title:
|
|
1454
|
-
'开启多选后,select下拉列表支持选择多个选项。',
|
|
1455
|
-
placement: 'top',
|
|
1456
|
-
},
|
|
1457
|
-
r.createElement(
|
|
1458
|
-
'span',
|
|
1459
|
-
{ className: 'title-text' },
|
|
1460
|
-
'支持多选',
|
|
1461
|
-
),
|
|
1462
|
-
),
|
|
1463
|
-
),
|
|
1464
|
-
r.createElement(
|
|
1465
|
-
'div',
|
|
1466
|
-
{ className: 'content-item' },
|
|
1467
|
-
r.createElement(
|
|
1468
|
-
'div',
|
|
1469
|
-
{
|
|
1470
|
-
className: 'form-item-box',
|
|
1471
|
-
key: o + '-selectConfig-multiple',
|
|
1472
|
-
},
|
|
1473
|
-
r.createElement(S.Switch, {
|
|
1474
|
-
style: { display: 'inline-block' },
|
|
1475
|
-
defaultChecked: s.multiple,
|
|
1476
|
-
checkedChildren: '多选',
|
|
1477
|
-
unCheckedChildren: '单选',
|
|
1478
|
-
onChange: function (e) {
|
|
1479
|
-
t.handleValueChange('multiple', e);
|
|
1480
|
-
},
|
|
1481
|
-
}),
|
|
1482
|
-
),
|
|
1483
|
-
),
|
|
1484
|
-
),
|
|
1485
|
-
(function (e) {
|
|
1486
|
-
return (
|
|
1487
|
-
[]
|
|
1488
|
-
.concat(fe, [
|
|
1489
|
-
'quantity',
|
|
1490
|
-
'text-editor',
|
|
1491
|
-
'json',
|
|
1492
|
-
'codearea',
|
|
1493
|
-
'htmlarea',
|
|
1494
|
-
])
|
|
1495
|
-
.indexOf(e) > -1
|
|
1496
|
-
);
|
|
1497
|
-
})(m) &&
|
|
1498
|
-
r.createElement(
|
|
1499
|
-
'div',
|
|
1500
|
-
{
|
|
1501
|
-
className: 'wide-screen-element-warp',
|
|
1502
|
-
key: o + '-readOnly-' + s.readOnly,
|
|
1503
|
-
},
|
|
1504
|
-
r.createElement(
|
|
1505
|
-
'div',
|
|
1506
|
-
{ className: 'element-title' },
|
|
1507
|
-
r.createElement(
|
|
1508
|
-
S.Tooltip,
|
|
1509
|
-
{
|
|
1510
|
-
title:
|
|
1511
|
-
'当前属性设置为只读后,用户不能对其进行任何编辑操作',
|
|
1512
|
-
placement: 'top',
|
|
1513
|
-
},
|
|
1514
|
-
r.createElement(
|
|
1515
|
-
'span',
|
|
1516
|
-
{ className: 'title-text' },
|
|
1517
|
-
'是否只读',
|
|
1518
|
-
),
|
|
1519
|
-
),
|
|
1520
|
-
),
|
|
1521
|
-
r.createElement(
|
|
1522
|
-
'div',
|
|
1523
|
-
{ className: 'content-item' },
|
|
1524
|
-
r.createElement(
|
|
1525
|
-
'div',
|
|
1526
|
-
{ className: 'form-item-box' },
|
|
1527
|
-
r.createElement(S.Switch, {
|
|
1528
|
-
style: { display: 'inline-block' },
|
|
1529
|
-
defaultChecked: s.readOnly,
|
|
1530
|
-
checkedChildren: 'true',
|
|
1531
|
-
unCheckedChildren: 'false',
|
|
1532
|
-
onChange: function (e) {
|
|
1533
|
-
t.handleValueChange('readOnly', e);
|
|
1534
|
-
},
|
|
1535
|
-
}),
|
|
1536
|
-
),
|
|
1537
|
-
),
|
|
1538
|
-
),
|
|
1539
|
-
(function (e) {
|
|
1540
|
-
return (
|
|
1541
|
-
[]
|
|
1542
|
-
.concat(fe, [
|
|
1543
|
-
'quantity',
|
|
1544
|
-
'text-editor',
|
|
1545
|
-
'json',
|
|
1546
|
-
'codearea',
|
|
1547
|
-
'htmlarea',
|
|
1548
|
-
])
|
|
1549
|
-
.indexOf(e) > -1
|
|
1550
|
-
);
|
|
1551
|
-
})(m) &&
|
|
1552
|
-
r.createElement(
|
|
1553
|
-
'div',
|
|
1554
|
-
{
|
|
1555
|
-
className: 'wide-screen-element-warp',
|
|
1556
|
-
key: o + '-isRequired-' + s.isRequired,
|
|
1557
|
-
},
|
|
1558
|
-
r.createElement(
|
|
1559
|
-
'div',
|
|
1560
|
-
{ className: 'element-title' },
|
|
1561
|
-
r.createElement(
|
|
1562
|
-
S.Tooltip,
|
|
1563
|
-
{
|
|
1564
|
-
title:
|
|
1565
|
-
'当前属性设置为必填项后,如果用户没有给其设置数值,则会进行标红提示。',
|
|
1566
|
-
placement: 'top',
|
|
1567
|
-
},
|
|
1568
|
-
r.createElement(
|
|
1569
|
-
'span',
|
|
1570
|
-
{ className: 'title-text' },
|
|
1571
|
-
'是否必填项',
|
|
1572
|
-
),
|
|
1573
|
-
),
|
|
1574
|
-
),
|
|
1575
|
-
r.createElement(
|
|
1576
|
-
'div',
|
|
1577
|
-
{ className: 'content-item' },
|
|
1578
|
-
r.createElement(
|
|
1579
|
-
'div',
|
|
1580
|
-
{ className: 'form-item-box' },
|
|
1581
|
-
r.createElement(S.Switch, {
|
|
1582
|
-
style: { display: 'inline-block' },
|
|
1583
|
-
defaultChecked: s.isRequired,
|
|
1584
|
-
checkedChildren: 'true',
|
|
1585
|
-
unCheckedChildren: 'false',
|
|
1586
|
-
onChange: function (e) {
|
|
1587
|
-
t.handleValueChange('isRequired', e);
|
|
1588
|
-
},
|
|
1589
|
-
}),
|
|
1590
|
-
),
|
|
1591
|
-
),
|
|
1592
|
-
),
|
|
1593
|
-
(function (e) {
|
|
1594
|
-
return (
|
|
1595
|
-
[]
|
|
1596
|
-
.concat(fe, ['json', 'codearea', 'htmlarea'])
|
|
1597
|
-
.indexOf(e) > -1
|
|
1598
|
-
);
|
|
1599
|
-
})(m) &&
|
|
1600
|
-
r.createElement(
|
|
1601
|
-
'div',
|
|
1602
|
-
{
|
|
1603
|
-
className: 'wide-screen-element-warp',
|
|
1604
|
-
key: o + '-default',
|
|
1605
|
-
},
|
|
1606
|
-
r.createElement(
|
|
1607
|
-
'div',
|
|
1608
|
-
{ className: 'element-title' },
|
|
1609
|
-
r.createElement(
|
|
1610
|
-
S.Tooltip,
|
|
1611
|
-
{ placement: 'top' },
|
|
1612
|
-
r.createElement(
|
|
1613
|
-
'span',
|
|
1614
|
-
{ className: 'title-text' },
|
|
1615
|
-
'默认值',
|
|
1616
|
-
),
|
|
1617
|
-
),
|
|
1618
|
-
),
|
|
1619
|
-
r.createElement(
|
|
1620
|
-
'div',
|
|
1621
|
-
{ className: 'content-item' },
|
|
1622
|
-
r.createElement(
|
|
1623
|
-
'div',
|
|
1624
|
-
{ className: 'form-item-box' },
|
|
1625
|
-
this.renderDefaultContent(m, s, o),
|
|
1626
|
-
),
|
|
1627
|
-
),
|
|
1628
|
-
),
|
|
1629
|
-
'cascader' === m &&
|
|
1630
|
-
r.createElement(
|
|
1631
|
-
'div',
|
|
1632
|
-
{
|
|
1633
|
-
className: 'wide-screen-element-warp',
|
|
1634
|
-
key: o + '-cascader-options',
|
|
1635
|
-
},
|
|
1636
|
-
r.createElement(
|
|
1637
|
-
'div',
|
|
1638
|
-
{ className: 'element-title' },
|
|
1639
|
-
r.createElement(
|
|
1640
|
-
S.Tooltip,
|
|
1641
|
-
{
|
|
1642
|
-
title: '用于添加 级联选择 组件的 options 数据。',
|
|
1643
|
-
placement: 'top',
|
|
1644
|
-
},
|
|
1645
|
-
r.createElement(
|
|
1646
|
-
'span',
|
|
1647
|
-
{ className: 'title-text' },
|
|
1648
|
-
'options 配置',
|
|
1649
|
-
),
|
|
1650
|
-
),
|
|
1651
|
-
),
|
|
1652
|
-
r.createElement(
|
|
1653
|
-
'div',
|
|
1654
|
-
{ className: 'content-item' },
|
|
1655
|
-
l &&
|
|
1656
|
-
r.createElement(
|
|
1657
|
-
'div',
|
|
1658
|
-
{ className: 'warning-box code-area-item' },
|
|
1659
|
-
r.createElement(
|
|
1660
|
-
'div',
|
|
1661
|
-
{ className: 'warning-img' },
|
|
1662
|
-
'X',
|
|
1663
|
-
),
|
|
1664
|
-
r.createElement(
|
|
1665
|
-
'div',
|
|
1666
|
-
{ className: 'warning-text' },
|
|
1667
|
-
p,
|
|
1668
|
-
),
|
|
1669
|
-
),
|
|
1670
|
-
r.createElement(Re(), {
|
|
1671
|
-
id: o + '-json_area_ace',
|
|
1672
|
-
value: (0, Oe.hasProperties)(d)
|
|
1673
|
-
? d
|
|
1674
|
-
: JSON.stringify(s.options, null, 2),
|
|
1675
|
-
className: 'json-view-ace',
|
|
1676
|
-
mode: 'json',
|
|
1677
|
-
theme: 'solarized_light',
|
|
1678
|
-
name: 'JSON_CODE_EDIT',
|
|
1679
|
-
fontSize: 14,
|
|
1680
|
-
showPrintMargin: !0,
|
|
1681
|
-
showGutter: !0,
|
|
1682
|
-
highlightActiveLine: !0,
|
|
1683
|
-
readOnly: !1,
|
|
1684
|
-
minLines: 3,
|
|
1685
|
-
maxLines: 6,
|
|
1686
|
-
width: '100%',
|
|
1687
|
-
onChange: function (e) {
|
|
1688
|
-
try {
|
|
1689
|
-
var n = JSON.parse(e);
|
|
1690
|
-
t.handleValueChange('options', n),
|
|
1691
|
-
t.setState({
|
|
1692
|
-
isShowWarn: !1,
|
|
1693
|
-
curJSONDataTemp: void 0,
|
|
1694
|
-
});
|
|
1695
|
-
} catch (n) {
|
|
1696
|
-
t.setState({
|
|
1697
|
-
curJSONDataTemp: e,
|
|
1698
|
-
warnText: n.message,
|
|
1699
|
-
isShowWarn: !0,
|
|
1700
|
-
});
|
|
1701
|
-
}
|
|
1702
|
-
},
|
|
1703
|
-
setOptions: {
|
|
1704
|
-
useWorker: !1,
|
|
1705
|
-
showLineNumbers: !0,
|
|
1706
|
-
tabSize: 2,
|
|
1707
|
-
},
|
|
1708
|
-
}),
|
|
1709
|
-
),
|
|
1710
|
-
),
|
|
1711
|
-
r.createElement(
|
|
1712
|
-
'div',
|
|
1713
|
-
{
|
|
1714
|
-
className: 'wide-screen-element-warp',
|
|
1715
|
-
key: o + '-description',
|
|
1716
|
-
},
|
|
1717
|
-
r.createElement(
|
|
1718
|
-
'div',
|
|
1719
|
-
{ className: 'element-title' },
|
|
1720
|
-
r.createElement(
|
|
1721
|
-
S.Tooltip,
|
|
1722
|
-
{
|
|
1723
|
-
title:
|
|
1724
|
-
'字段描述内容将作为Title的补充信息提供给用户',
|
|
1725
|
-
placement: 'top',
|
|
1726
|
-
},
|
|
1727
|
-
r.createElement(
|
|
1728
|
-
'span',
|
|
1729
|
-
{ className: 'title-text' },
|
|
1730
|
-
'字段描述',
|
|
1731
|
-
),
|
|
1732
|
-
),
|
|
1733
|
-
),
|
|
1734
|
-
r.createElement(
|
|
1735
|
-
'div',
|
|
1736
|
-
{ className: 'content-item' },
|
|
1737
|
-
r.createElement(
|
|
1738
|
-
'div',
|
|
1739
|
-
{ className: 'form-item-box' },
|
|
1740
|
-
r.createElement(S.Input, {
|
|
1741
|
-
style: { display: 'inline-block' },
|
|
1742
|
-
placeholder: '请输入' + s.title + '的字段描述',
|
|
1743
|
-
defaultValue: s.description,
|
|
1744
|
-
onPressEnter: function (e) {
|
|
1745
|
-
var n = e.target.value;
|
|
1746
|
-
t.handleValueChange('description', n);
|
|
1747
|
-
},
|
|
1748
|
-
onBlur: function (e) {
|
|
1749
|
-
var n = e.target.value;
|
|
1750
|
-
t.handleValueChange('description', n);
|
|
1751
|
-
},
|
|
1752
|
-
}),
|
|
1753
|
-
),
|
|
1754
|
-
),
|
|
1755
|
-
),
|
|
1756
|
-
r.createElement(
|
|
1757
|
-
'div',
|
|
1758
|
-
{
|
|
1759
|
-
className: 'wide-screen-element-warp',
|
|
1760
|
-
key: o + '-showKey',
|
|
1761
|
-
},
|
|
1762
|
-
r.createElement(
|
|
1763
|
-
'div',
|
|
1764
|
-
{ className: 'element-title' },
|
|
1765
|
-
r.createElement(
|
|
1766
|
-
S.Tooltip,
|
|
1767
|
-
{
|
|
1768
|
-
title:
|
|
1769
|
-
'开启后,在JSONEditor端会展示当前Key值,以便增加辨识度。',
|
|
1770
|
-
placement: 'top',
|
|
1771
|
-
},
|
|
1772
|
-
r.createElement(
|
|
1773
|
-
'span',
|
|
1774
|
-
{ className: 'title-text' },
|
|
1775
|
-
'展示Key值',
|
|
1776
|
-
),
|
|
1777
|
-
),
|
|
1778
|
-
),
|
|
1779
|
-
r.createElement(
|
|
1780
|
-
'div',
|
|
1781
|
-
{ className: 'content-item' },
|
|
1782
|
-
r.createElement(
|
|
1783
|
-
'div',
|
|
1784
|
-
{ className: 'form-item-box' },
|
|
1785
|
-
r.createElement(S.Switch, {
|
|
1786
|
-
style: { display: 'inline-block' },
|
|
1787
|
-
defaultChecked: s.showKey,
|
|
1788
|
-
checkedChildren: 'true',
|
|
1789
|
-
unCheckedChildren: 'false',
|
|
1790
|
-
onChange: function (e) {
|
|
1791
|
-
t.handleValueChange('showKey', e);
|
|
1792
|
-
},
|
|
1793
|
-
}),
|
|
1794
|
-
),
|
|
1795
|
-
),
|
|
1796
|
-
),
|
|
1797
|
-
(function (e) {
|
|
1798
|
-
return (
|
|
1799
|
-
[
|
|
1800
|
-
'input',
|
|
1801
|
-
'url',
|
|
1802
|
-
'textarea',
|
|
1803
|
-
'text-editor',
|
|
1804
|
-
'date',
|
|
1805
|
-
'date-time',
|
|
1806
|
-
'time',
|
|
1807
|
-
'json',
|
|
1808
|
-
'codearea',
|
|
1809
|
-
'htmlarea',
|
|
1810
|
-
].indexOf(e) > -1
|
|
1811
|
-
);
|
|
1812
|
-
})(m) &&
|
|
1813
|
-
r.createElement(
|
|
1814
|
-
'div',
|
|
1815
|
-
{
|
|
1816
|
-
className: 'wide-screen-element-warp',
|
|
1817
|
-
key: o + '-placeholder',
|
|
1818
|
-
},
|
|
1819
|
-
r.createElement(
|
|
1820
|
-
'div',
|
|
1821
|
-
{ className: 'element-title' },
|
|
1822
|
-
r.createElement(
|
|
1823
|
-
S.Tooltip,
|
|
1824
|
-
{
|
|
1825
|
-
title:
|
|
1826
|
-
'输入提示内容将作为输入区域的提示信息展示给用户',
|
|
1827
|
-
placement: 'top',
|
|
1828
|
-
},
|
|
1829
|
-
r.createElement(
|
|
1830
|
-
'span',
|
|
1831
|
-
{ className: 'title-text' },
|
|
1832
|
-
'输入提示',
|
|
1833
|
-
),
|
|
1834
|
-
),
|
|
1835
|
-
),
|
|
1836
|
-
r.createElement(
|
|
1837
|
-
'div',
|
|
1838
|
-
{ className: 'content-item' },
|
|
1839
|
-
r.createElement(
|
|
1840
|
-
'div',
|
|
1841
|
-
{ className: 'form-item-box' },
|
|
1842
|
-
r.createElement(S.Input, {
|
|
1843
|
-
style: { display: 'inline-block' },
|
|
1844
|
-
placeholder: '请输入' + s.title + '的输入提示',
|
|
1845
|
-
defaultValue: s.placeholder,
|
|
1846
|
-
onPressEnter: function (e) {
|
|
1847
|
-
var n = e.target.value;
|
|
1848
|
-
t.handleValueChange('placeholder', n);
|
|
1849
|
-
},
|
|
1850
|
-
onBlur: function (e) {
|
|
1851
|
-
var n = e.target.value;
|
|
1852
|
-
t.handleValueChange('placeholder', n);
|
|
1853
|
-
},
|
|
1854
|
-
}),
|
|
1855
|
-
),
|
|
1856
|
-
),
|
|
1857
|
-
),
|
|
1858
|
-
(function (e) {
|
|
1859
|
-
return [].concat(ve, ['array']).indexOf(e) > -1;
|
|
1860
|
-
})(m) &&
|
|
1861
|
-
r.createElement(
|
|
1862
|
-
'div',
|
|
1863
|
-
{
|
|
1864
|
-
className: 'wide-screen-element-warp',
|
|
1865
|
-
key: o + '-showCodeViewBtn-' + s.showCodeViewBtn,
|
|
1866
|
-
},
|
|
1867
|
-
r.createElement(
|
|
1868
|
-
'div',
|
|
1869
|
-
{ className: 'element-title' },
|
|
1870
|
-
r.createElement(
|
|
1871
|
-
S.Tooltip,
|
|
1872
|
-
{
|
|
1873
|
-
title:
|
|
1874
|
-
'用于控制是否显示源码模式切换按钮,默认显示',
|
|
1875
|
-
placement: 'top',
|
|
1876
|
-
},
|
|
1877
|
-
r.createElement(
|
|
1878
|
-
'span',
|
|
1879
|
-
{ className: 'title-text' },
|
|
1880
|
-
'源码模式',
|
|
1881
|
-
),
|
|
1882
|
-
),
|
|
1883
|
-
),
|
|
1884
|
-
r.createElement(
|
|
1885
|
-
'div',
|
|
1886
|
-
{ className: 'content-item' },
|
|
1887
|
-
r.createElement(
|
|
1888
|
-
'div',
|
|
1889
|
-
{ className: 'form-item-box' },
|
|
1890
|
-
r.createElement(S.Switch, {
|
|
1891
|
-
style: { display: 'inline-block' },
|
|
1892
|
-
defaultChecked:
|
|
1893
|
-
null == (e = s.showCodeViewBtn) || e,
|
|
1894
|
-
checkedChildren: 'true',
|
|
1895
|
-
unCheckedChildren: 'false',
|
|
1896
|
-
onChange: function (e) {
|
|
1897
|
-
t.handleValueChange('showCodeViewBtn', e);
|
|
1898
|
-
},
|
|
1899
|
-
}),
|
|
1900
|
-
),
|
|
1901
|
-
),
|
|
1902
|
-
),
|
|
1903
|
-
'number' === (0, Oe.getExpectType)(m) &&
|
|
1904
|
-
r.createElement(
|
|
1905
|
-
r.Fragment,
|
|
1906
|
-
null,
|
|
1907
|
-
r.createElement(
|
|
1908
|
-
'div',
|
|
1909
|
-
{
|
|
1910
|
-
className: 'wide-screen-element-warp',
|
|
1911
|
-
key: o + '-minimum-' + s.minimum,
|
|
1912
|
-
},
|
|
1913
|
-
r.createElement(
|
|
1914
|
-
'div',
|
|
1915
|
-
{ className: 'element-title' },
|
|
1916
|
-
r.createElement(
|
|
1917
|
-
S.Tooltip,
|
|
1918
|
-
{
|
|
1919
|
-
title:
|
|
1920
|
-
'设置最小值后,用户输入的数值必须大于当前最小值',
|
|
1921
|
-
placement: 'top',
|
|
1922
|
-
},
|
|
1923
|
-
r.createElement(
|
|
1924
|
-
'span',
|
|
1925
|
-
{ className: 'title-text' },
|
|
1926
|
-
'最小值',
|
|
1927
|
-
),
|
|
1928
|
-
),
|
|
1929
|
-
),
|
|
1930
|
-
r.createElement(
|
|
1931
|
-
'div',
|
|
1932
|
-
{ className: 'content-item' },
|
|
1933
|
-
r.createElement(
|
|
1934
|
-
'div',
|
|
1935
|
-
{ className: 'form-item-box' },
|
|
1936
|
-
r.createElement(S.InputNumber, {
|
|
1937
|
-
style: { display: 'inline-block' },
|
|
1938
|
-
defaultValue: s.minimum,
|
|
1939
|
-
onPressEnter: function (e) {
|
|
1940
|
-
var n = e.target.value;
|
|
1941
|
-
t.handleValueChange('minimum', n);
|
|
1942
|
-
},
|
|
1943
|
-
onBlur: function (e) {
|
|
1944
|
-
var n = e.target.value;
|
|
1945
|
-
t.handleValueChange('minimum', n);
|
|
1946
|
-
},
|
|
1947
|
-
}),
|
|
1948
|
-
),
|
|
1949
|
-
),
|
|
1950
|
-
),
|
|
1951
|
-
r.createElement(
|
|
1952
|
-
'div',
|
|
1953
|
-
{
|
|
1954
|
-
className: 'wide-screen-element-warp',
|
|
1955
|
-
key: o + '-maximum-' + s.maximum,
|
|
1956
|
-
},
|
|
1957
|
-
r.createElement(
|
|
1958
|
-
'div',
|
|
1959
|
-
{ className: 'element-title' },
|
|
1960
|
-
r.createElement(
|
|
1961
|
-
S.Tooltip,
|
|
1962
|
-
{
|
|
1963
|
-
title:
|
|
1964
|
-
'设置最大值后,用户输入的数值必须大于当前最大值',
|
|
1965
|
-
placement: 'top',
|
|
1966
|
-
},
|
|
1967
|
-
r.createElement(
|
|
1968
|
-
'span',
|
|
1969
|
-
{ className: 'title-text' },
|
|
1970
|
-
'最大值',
|
|
1971
|
-
),
|
|
1972
|
-
),
|
|
1973
|
-
),
|
|
1974
|
-
r.createElement(
|
|
1975
|
-
'div',
|
|
1976
|
-
{ className: 'content-item' },
|
|
1977
|
-
r.createElement(
|
|
1978
|
-
'div',
|
|
1979
|
-
{ className: 'form-item-box' },
|
|
1980
|
-
r.createElement(S.InputNumber, {
|
|
1981
|
-
style: { display: 'inline-block' },
|
|
1982
|
-
defaultValue: s.maximum,
|
|
1983
|
-
onPressEnter: function (e) {
|
|
1984
|
-
var n = e.target.value;
|
|
1985
|
-
t.handleValueChange('maximum', n);
|
|
1986
|
-
},
|
|
1987
|
-
onBlur: function (e) {
|
|
1988
|
-
var n = e.target.value;
|
|
1989
|
-
t.handleValueChange('maximum', n);
|
|
1990
|
-
},
|
|
1991
|
-
}),
|
|
1992
|
-
),
|
|
1993
|
-
),
|
|
1994
|
-
),
|
|
1995
|
-
),
|
|
1996
|
-
'array' === (0, Oe.getExpectType)(m) &&
|
|
1997
|
-
r.createElement(
|
|
1998
|
-
r.Fragment,
|
|
1999
|
-
null,
|
|
2000
|
-
r.createElement(
|
|
2001
|
-
'div',
|
|
2002
|
-
{
|
|
2003
|
-
className: 'wide-screen-element-warp',
|
|
2004
|
-
key: o + '-minimum-child',
|
|
2005
|
-
},
|
|
2006
|
-
r.createElement(
|
|
2007
|
-
'div',
|
|
2008
|
-
{ className: 'element-title' },
|
|
2009
|
-
r.createElement(
|
|
2010
|
-
S.Tooltip,
|
|
2011
|
-
{
|
|
2012
|
-
title: '用于限制数据项最小个数',
|
|
2013
|
-
placement: 'top',
|
|
2014
|
-
},
|
|
2015
|
-
r.createElement(
|
|
2016
|
-
'span',
|
|
2017
|
-
{ className: 'title-text' },
|
|
2018
|
-
'最小数据项',
|
|
2019
|
-
),
|
|
2020
|
-
),
|
|
2021
|
-
),
|
|
2022
|
-
r.createElement(
|
|
2023
|
-
'div',
|
|
2024
|
-
{ className: 'content-item' },
|
|
2025
|
-
r.createElement(
|
|
2026
|
-
'div',
|
|
2027
|
-
{ className: 'form-item-box' },
|
|
2028
|
-
r.createElement(S.InputNumber, {
|
|
2029
|
-
style: { display: 'inline-block' },
|
|
2030
|
-
defaultValue: s['minimum-child'],
|
|
2031
|
-
onChange: function (e) {
|
|
2032
|
-
t.handleValueChange('minimum-child', e);
|
|
2033
|
-
},
|
|
2034
|
-
}),
|
|
2035
|
-
),
|
|
2036
|
-
),
|
|
2037
|
-
),
|
|
2038
|
-
r.createElement(
|
|
2039
|
-
'div',
|
|
2040
|
-
{
|
|
2041
|
-
className: 'wide-screen-element-warp',
|
|
2042
|
-
key: o + '-maximum-child',
|
|
2043
|
-
},
|
|
2044
|
-
r.createElement(
|
|
2045
|
-
'div',
|
|
2046
|
-
{ className: 'element-title' },
|
|
2047
|
-
r.createElement(
|
|
2048
|
-
S.Tooltip,
|
|
2049
|
-
{
|
|
2050
|
-
title: '用于限制数据项最多个数',
|
|
2051
|
-
placement: 'top',
|
|
2052
|
-
},
|
|
2053
|
-
r.createElement(
|
|
2054
|
-
'span',
|
|
2055
|
-
{ className: 'title-text' },
|
|
2056
|
-
'最多数据项',
|
|
2057
|
-
),
|
|
2058
|
-
),
|
|
2059
|
-
),
|
|
2060
|
-
r.createElement(
|
|
2061
|
-
'div',
|
|
2062
|
-
{ className: 'content-item' },
|
|
2063
|
-
r.createElement(
|
|
2064
|
-
'div',
|
|
2065
|
-
{ className: 'form-item-box' },
|
|
2066
|
-
r.createElement(S.InputNumber, {
|
|
2067
|
-
style: { display: 'inline-block' },
|
|
2068
|
-
defaultValue: s['maximum-child'],
|
|
2069
|
-
onChange: function (e) {
|
|
2070
|
-
t.handleValueChange('maximum-child', e);
|
|
2071
|
-
},
|
|
2072
|
-
}),
|
|
2073
|
-
),
|
|
2074
|
-
),
|
|
2075
|
-
),
|
|
2076
|
-
),
|
|
2077
|
-
r.createElement(
|
|
2078
|
-
'div',
|
|
2079
|
-
{
|
|
2080
|
-
className: 'wide-screen-element-warp',
|
|
2081
|
-
key: o + '-onShow',
|
|
2082
|
-
},
|
|
2083
|
-
r.createElement(
|
|
2084
|
-
'div',
|
|
2085
|
-
{ className: 'element-title' },
|
|
2086
|
-
r.createElement(
|
|
2087
|
-
S.Tooltip,
|
|
2088
|
-
{
|
|
2089
|
-
title:
|
|
2090
|
-
'用于设置显隐表达式(onShow),比如设置 "dataType === 1",则表示当数据域中 dataType 为 1 时显示当前配置项。',
|
|
2091
|
-
placement: 'top',
|
|
2092
|
-
},
|
|
2093
|
-
r.createElement(
|
|
2094
|
-
'span',
|
|
2095
|
-
{ className: 'title-text' },
|
|
2096
|
-
'显隐表达式',
|
|
2097
|
-
),
|
|
2098
|
-
),
|
|
2099
|
-
),
|
|
2100
|
-
r.createElement(
|
|
2101
|
-
'div',
|
|
2102
|
-
{ className: 'content-item' },
|
|
2103
|
-
r.createElement(
|
|
2104
|
-
'div',
|
|
2105
|
-
{ className: 'form-item-box' },
|
|
2106
|
-
r.createElement(S.Input, {
|
|
2107
|
-
style: { display: 'inline-block' },
|
|
2108
|
-
placeholder: '请输入显隐表达式',
|
|
2109
|
-
defaultValue: s.onShow,
|
|
2110
|
-
onPressEnter: function (e) {
|
|
2111
|
-
var n = e.target.value;
|
|
2112
|
-
t.handleValueChange('onShow', n);
|
|
2113
|
-
},
|
|
2114
|
-
onBlur: function (e) {
|
|
2115
|
-
var n = e.target.value;
|
|
2116
|
-
t.handleValueChange('onShow', n);
|
|
2117
|
-
},
|
|
2118
|
-
}),
|
|
2119
|
-
),
|
|
2120
|
-
),
|
|
2121
|
-
),
|
|
2122
|
-
);
|
|
2123
|
-
}),
|
|
2124
|
-
t
|
|
2125
|
-
);
|
|
2126
|
-
})(r.PureComponent));
|
|
2127
|
-
ke.propTypes = {
|
|
2128
|
-
jsonKey: d().string,
|
|
2129
|
-
indexRoute: d().string,
|
|
2130
|
-
nodeKey: d().string,
|
|
2131
|
-
targetJsonSchema: d().any,
|
|
2132
|
-
};
|
|
2133
|
-
var Te = (0, l.inject)(function (e) {
|
|
2134
|
-
return { schemaStore: e.schemaStore };
|
|
2135
|
-
})((0, l.observer)(ke)),
|
|
2136
|
-
Je = (n(915), S.Select.Option),
|
|
2137
|
-
De = (function (e) {
|
|
2138
|
-
function t(t) {
|
|
2139
|
-
var n;
|
|
2140
|
-
return (
|
|
2141
|
-
((n = e.call(this, t) || this).selectHandleChange = function (
|
|
2142
|
-
e,
|
|
2143
|
-
) {
|
|
2144
|
-
var t = (n.props.schemaStore || {}).changeType,
|
|
2145
|
-
a = n.props,
|
|
2146
|
-
o = a.indexRoute,
|
|
2147
|
-
r = a.jsonKey;
|
|
2148
|
-
a.targetJsonSchema.type !== e && t(o, r, Oe.TypeDataList[e]);
|
|
2149
|
-
}),
|
|
2150
|
-
(n.handleJsonKeyChange = function (e) {
|
|
2151
|
-
var t = n.props.schemaStore || {},
|
|
2152
|
-
a = t.editJsonKey,
|
|
2153
|
-
o = t.isExitJsonKey,
|
|
2154
|
-
r = e.target.value,
|
|
2155
|
-
i = n.props,
|
|
2156
|
-
s = i.indexRoute;
|
|
2157
|
-
i.jsonKey !== r &&
|
|
2158
|
-
(o(s, r)
|
|
2159
|
-
? S.message.warning('当前key已存在,请换一个吧。')
|
|
2160
|
-
: a(s, r));
|
|
2161
|
-
}),
|
|
2162
|
-
(n.handleTitleChange = function (e) {
|
|
2163
|
-
var t = (n.props.schemaStore || {}).editSchemaData,
|
|
2164
|
-
a = e.target.value,
|
|
2165
|
-
o = n.props,
|
|
2166
|
-
r = o.indexRoute,
|
|
2167
|
-
i = o.jsonKey;
|
|
2168
|
-
o.targetJsonSchema.title !== a && t(r, i, { title: a });
|
|
2169
|
-
}),
|
|
2170
|
-
(n.getCurrentTypeList = function (e) {
|
|
2171
|
-
var t = (n.props.schemaStore || {}).SchemaTypeList,
|
|
2172
|
-
a = t[e || 'all'];
|
|
2173
|
-
return (a && 0 !== a.length) || (a = t.all), a;
|
|
2174
|
-
}),
|
|
2175
|
-
(n.onAddBtnEvent = function () {
|
|
2176
|
-
var e = n.props.schemaStore || {},
|
|
2177
|
-
t = e.addChildJson,
|
|
2178
|
-
a = e.addNextJsonData,
|
|
2179
|
-
o = n.props,
|
|
2180
|
-
r = o.indexRoute,
|
|
2181
|
-
i = o.targetJsonSchema;
|
|
2182
|
-
(0, Oe.isContainerSchema)(i) ? t(r) : a(r);
|
|
2183
|
-
}),
|
|
2184
|
-
(n.onCopyBtnEvent = function () {
|
|
2185
|
-
var e = n.props,
|
|
2186
|
-
t = e.indexRoute,
|
|
2187
|
-
a = e.targetJsonSchema,
|
|
2188
|
-
o = e.jsonKey,
|
|
2189
|
-
r = n.props.schemaStore || {},
|
|
2190
|
-
i = r.getSchemaByIndexRoute,
|
|
2191
|
-
s = r.indexRoute2keyRoute,
|
|
2192
|
-
c = r.insertJsonData,
|
|
2193
|
-
l = r.getNewJsonKeyIndex,
|
|
2194
|
-
p = E(a),
|
|
2195
|
-
d = (0, Oe.getParentIndexRoute)(t),
|
|
2196
|
-
m = l(i(d), o),
|
|
2197
|
-
u = a.type;
|
|
2198
|
-
C(s(d) + '-' + m + '-' + u, s(t)), c(t, m, p);
|
|
2199
|
-
}),
|
|
2200
|
-
(n.onDeleteBtnEvent = function () {
|
|
2201
|
-
var e = n.props,
|
|
2202
|
-
t = e.jsonKey,
|
|
2203
|
-
a = e.indexRoute;
|
|
2204
|
-
(0, (n.props.schemaStore || {}).deleteJsonByIndex_CurKey)(
|
|
2205
|
-
a,
|
|
2206
|
-
t,
|
|
2207
|
-
);
|
|
2208
|
-
}),
|
|
2209
|
-
(n.ignoreDragEvent = function (e) {
|
|
2210
|
-
e.preventDefault(), e.stopPropagation();
|
|
2211
|
-
}),
|
|
2212
|
-
(n.childElemSort = function () {
|
|
2213
|
-
var e = n.props.indexRoute;
|
|
2214
|
-
(0, (n.props.schemaStore || {}).childElemSort)(e);
|
|
2215
|
-
}),
|
|
2216
|
-
(n.state = { showAdvanceConfig: !1 }),
|
|
2217
|
-
(n.onAddBtnEvent = n.onAddBtnEvent.bind(n)),
|
|
2218
|
-
(n.onCopyBtnEvent = n.onCopyBtnEvent.bind(n)),
|
|
2219
|
-
(n.onDeleteBtnEvent = n.onDeleteBtnEvent.bind(n)),
|
|
2220
|
-
(n.handleJsonKeyChange = n.handleJsonKeyChange.bind(n)),
|
|
2221
|
-
(n.handleTitleChange = n.handleTitleChange.bind(n)),
|
|
2222
|
-
(n.selectHandleChange = n.selectHandleChange.bind(n)),
|
|
2223
|
-
(n.childElemSort = n.childElemSort.bind(n)),
|
|
2224
|
-
n
|
|
2225
|
-
);
|
|
2226
|
-
}
|
|
2227
|
-
return (
|
|
2228
|
-
o()(t, e),
|
|
2229
|
-
(t.prototype.render = function () {
|
|
2230
|
-
var e,
|
|
2231
|
-
t = this,
|
|
2232
|
-
n = (this.props.schemaStore || {}).getSchemaByIndexRoute,
|
|
2233
|
-
a = this.props,
|
|
2234
|
-
o = a.parentType,
|
|
2235
|
-
i = a.indexRoute,
|
|
2236
|
-
s = a.jsonKey,
|
|
2237
|
-
c = a.nodeKey,
|
|
2238
|
-
l = a.targetJsonSchema,
|
|
2239
|
-
p = this.state.showAdvanceConfig,
|
|
2240
|
-
d = i ? (0, Oe.getParentIndexRoute)(i) : '',
|
|
2241
|
-
m = d ? n(d) : {},
|
|
2242
|
-
u = null == (e = m && m.isContainer) || e,
|
|
2243
|
-
h = l.isFixed || this.props.isFixed || !1,
|
|
2244
|
-
y =
|
|
2245
|
-
(this.props.readOnly || l.readOnly,
|
|
2246
|
-
void 0 !== this.props.keyIsFixed
|
|
2247
|
-
? this.props.keyIsFixed
|
|
2248
|
-
: !u || h),
|
|
2249
|
-
g =
|
|
2250
|
-
void 0 !== this.props.typeIsFixed
|
|
2251
|
-
? this.props.typeIsFixed
|
|
2252
|
-
: h,
|
|
2253
|
-
f =
|
|
2254
|
-
void 0 !== this.props.titleIsFixed
|
|
2255
|
-
? this.props.titleIsFixed
|
|
2256
|
-
: h,
|
|
2257
|
-
v = this.props.hideOperaBtn || !u,
|
|
2258
|
-
x = !!v && this.props.showAdvanceBtn,
|
|
2259
|
-
b = this.getCurrentTypeList(o),
|
|
2260
|
-
E = l.type,
|
|
2261
|
-
O = (0, Oe.isContainerSchema)(l);
|
|
2262
|
-
return r.createElement(
|
|
2263
|
-
r.Fragment,
|
|
2264
|
-
null,
|
|
2265
|
-
l &&
|
|
2266
|
-
r.createElement(
|
|
2267
|
-
'div',
|
|
2268
|
-
{ className: 'base-schema-box', id: c },
|
|
2269
|
-
r.createElement(
|
|
2270
|
-
'div',
|
|
2271
|
-
{
|
|
2272
|
-
className: 'key-input-item',
|
|
2273
|
-
draggable: 'true',
|
|
2274
|
-
onDragStart: this.ignoreDragEvent,
|
|
2275
|
-
},
|
|
2276
|
-
r.createElement(S.Input, {
|
|
2277
|
-
defaultValue: s || 'key值不存在',
|
|
2278
|
-
disabled: y,
|
|
2279
|
-
onPressEnter: this.handleJsonKeyChange,
|
|
2280
|
-
onBlur: this.handleJsonKeyChange,
|
|
2281
|
-
}),
|
|
2282
|
-
),
|
|
2283
|
-
r.createElement(
|
|
2284
|
-
'div',
|
|
2285
|
-
{
|
|
2286
|
-
className: 'type-select-item',
|
|
2287
|
-
draggable: 'true',
|
|
2288
|
-
onDragStart: this.ignoreDragEvent,
|
|
2289
|
-
},
|
|
2290
|
-
r.createElement(
|
|
2291
|
-
S.Select,
|
|
2292
|
-
{
|
|
2293
|
-
showSearch: !0,
|
|
2294
|
-
defaultValue: E,
|
|
2295
|
-
style: { width: 150 },
|
|
2296
|
-
onChange: this.selectHandleChange,
|
|
2297
|
-
disabled: g,
|
|
2298
|
-
},
|
|
2299
|
-
b.map(function (e) {
|
|
2300
|
-
return r.createElement(Je, { key: e, value: e }, e);
|
|
2301
|
-
}),
|
|
2302
|
-
),
|
|
2303
|
-
),
|
|
2304
|
-
r.createElement(
|
|
2305
|
-
'div',
|
|
2306
|
-
{
|
|
2307
|
-
className: 'title-input-item',
|
|
2308
|
-
draggable: 'true',
|
|
2309
|
-
onDragStart: this.ignoreDragEvent,
|
|
2310
|
-
},
|
|
2311
|
-
r.createElement(S.Input, {
|
|
2312
|
-
defaultValue: l.title,
|
|
2313
|
-
disabled: f,
|
|
2314
|
-
onPressEnter: this.handleTitleChange,
|
|
2315
|
-
onBlur: this.handleTitleChange,
|
|
2316
|
-
}),
|
|
2317
|
-
),
|
|
2318
|
-
!v &&
|
|
2319
|
-
r.createElement(
|
|
2320
|
-
'div',
|
|
2321
|
-
{ className: 'operate-item' },
|
|
2322
|
-
!h &&
|
|
2323
|
-
r.createElement(
|
|
2324
|
-
S.Tooltip,
|
|
2325
|
-
{ title: '删除' },
|
|
2326
|
-
r.createElement(we.CloseOutlined, {
|
|
2327
|
-
className: 'operate-btn delete-operate',
|
|
2328
|
-
onClick: this.onDeleteBtnEvent,
|
|
2329
|
-
}),
|
|
2330
|
-
),
|
|
2331
|
-
r.createElement(
|
|
2332
|
-
S.Tooltip,
|
|
2333
|
-
{ title: O ? '新增子元素' : '新增同级元素' },
|
|
2334
|
-
r.createElement(we.PlusOutlined, {
|
|
2335
|
-
className: 'operate-btn',
|
|
2336
|
-
onClick: this.onAddBtnEvent,
|
|
2337
|
-
}),
|
|
2338
|
-
),
|
|
2339
|
-
O &&
|
|
2340
|
-
r.createElement(
|
|
2341
|
-
S.Tooltip,
|
|
2342
|
-
{ title: '数据项排序' },
|
|
2343
|
-
r.createElement(we.SortAscendingOutlined, {
|
|
2344
|
-
className: 'operate-btn',
|
|
2345
|
-
onClick: this.childElemSort,
|
|
2346
|
-
}),
|
|
2347
|
-
),
|
|
2348
|
-
!h &&
|
|
2349
|
-
r.createElement(
|
|
2350
|
-
r.Fragment,
|
|
2351
|
-
null,
|
|
2352
|
-
r.createElement(
|
|
2353
|
-
S.Tooltip,
|
|
2354
|
-
{ title: '复制' },
|
|
2355
|
-
r.createElement(we.CopyOutlined, {
|
|
2356
|
-
className: 'operate-btn',
|
|
2357
|
-
onClick: this.onCopyBtnEvent,
|
|
2358
|
-
}),
|
|
2359
|
-
),
|
|
2360
|
-
r.createElement(
|
|
2361
|
-
S.Tooltip,
|
|
2362
|
-
{ title: '高级设置' },
|
|
2363
|
-
r.createElement(we.SettingOutlined, {
|
|
2364
|
-
className: 'operate-btn',
|
|
2365
|
-
onClick: function () {
|
|
2366
|
-
t.setState({ showAdvanceConfig: !0 });
|
|
2367
|
-
},
|
|
2368
|
-
}),
|
|
2369
|
-
),
|
|
2370
|
-
r.createElement(
|
|
2371
|
-
S.Tooltip,
|
|
2372
|
-
{ title: '按住进行拖拽' },
|
|
2373
|
-
r.createElement(we.DragOutlined, {
|
|
2374
|
-
className: 'operate-btn drag-btn',
|
|
2375
|
-
}),
|
|
2376
|
-
),
|
|
2377
|
-
),
|
|
2378
|
-
),
|
|
2379
|
-
x &&
|
|
2380
|
-
r.createElement(
|
|
2381
|
-
'div',
|
|
2382
|
-
{ className: 'operate-item' },
|
|
2383
|
-
r.createElement(
|
|
2384
|
-
S.Tooltip,
|
|
2385
|
-
{ title: '高级设置' },
|
|
2386
|
-
r.createElement(we.SettingOutlined, {
|
|
2387
|
-
className: 'operate-btn',
|
|
2388
|
-
onClick: function () {
|
|
2389
|
-
t.setState({ showAdvanceConfig: !0 });
|
|
2390
|
-
},
|
|
2391
|
-
}),
|
|
2392
|
-
),
|
|
2393
|
-
),
|
|
2394
|
-
p &&
|
|
2395
|
-
r.createElement(
|
|
2396
|
-
S.Modal,
|
|
2397
|
-
{
|
|
2398
|
-
visible: !0,
|
|
2399
|
-
title:
|
|
2400
|
-
'高级设置 / 当前字段:' + l.title + '(' + s + ')',
|
|
2401
|
-
onCancel: function () {
|
|
2402
|
-
t.setState({ showAdvanceConfig: !1 });
|
|
2403
|
-
},
|
|
2404
|
-
footer: [
|
|
2405
|
-
r.createElement(
|
|
2406
|
-
S.Button,
|
|
2407
|
-
{
|
|
2408
|
-
key: 'submit',
|
|
2409
|
-
type: 'primary',
|
|
2410
|
-
onClick: function () {
|
|
2411
|
-
t.setState({ showAdvanceConfig: !1 });
|
|
2412
|
-
},
|
|
2413
|
-
},
|
|
2414
|
-
'保存并关闭',
|
|
2415
|
-
),
|
|
2416
|
-
],
|
|
2417
|
-
},
|
|
2418
|
-
r.createElement(Te, {
|
|
2419
|
-
indexRoute: i,
|
|
2420
|
-
jsonKey: s,
|
|
2421
|
-
targetJsonSchema: l,
|
|
2422
|
-
}),
|
|
2423
|
-
),
|
|
2424
|
-
),
|
|
2425
|
-
!l &&
|
|
2426
|
-
r.createElement(
|
|
2427
|
-
'div',
|
|
2428
|
-
{ className: 'base-schema-box' },
|
|
2429
|
-
r.createElement(
|
|
2430
|
-
'div',
|
|
2431
|
-
{ className: 'warn-text' },
|
|
2432
|
-
s,
|
|
2433
|
-
':数据元素为空',
|
|
2434
|
-
),
|
|
2435
|
-
),
|
|
2436
|
-
);
|
|
2437
|
-
}),
|
|
2438
|
-
t
|
|
2439
|
-
);
|
|
2440
|
-
})(r.PureComponent);
|
|
2441
|
-
De.propTypes = {
|
|
2442
|
-
parentType: d().string,
|
|
2443
|
-
jsonKey: d().string,
|
|
2444
|
-
indexRoute: d().string,
|
|
2445
|
-
nodeKey: d().string,
|
|
2446
|
-
targetJsonSchema: d().any,
|
|
2447
|
-
isFixed: d().bool,
|
|
2448
|
-
hideOperaBtn: d().bool,
|
|
2449
|
-
showAdvanceBtn: d().bool,
|
|
2450
|
-
keyIsFixed: d().bool,
|
|
2451
|
-
typeIsFixed: d().bool,
|
|
2452
|
-
titleIsFixed: d().bool,
|
|
2453
|
-
};
|
|
2454
|
-
var Be = (0, l.inject)(function (e) {
|
|
2455
|
-
return { schemaStore: e.schemaStore };
|
|
2456
|
-
})((0, l.observer)(De)),
|
|
2457
|
-
Pe = S.Tree.TreeNode,
|
|
2458
|
-
Ve = function (e) {
|
|
2459
|
-
return i().createElement(Be, e);
|
|
2460
|
-
},
|
|
2461
|
-
Le = function (e) {
|
|
2462
|
-
var t = e.jsonKey,
|
|
2463
|
-
n = e.indexRoute,
|
|
2464
|
-
a = e.nodeKey,
|
|
2465
|
-
o = e.targetJsonSchema,
|
|
2466
|
-
r = o.type,
|
|
2467
|
-
s = n ? n + '-0' : '0',
|
|
2468
|
-
c = 'items',
|
|
2469
|
-
l = a ? a + '-' + c : c,
|
|
2470
|
-
p = o[c] || {};
|
|
2471
|
-
return i().createElement(
|
|
2472
|
-
Pe,
|
|
2473
|
-
{
|
|
2474
|
-
className: r + '-schema schema-item-form',
|
|
2475
|
-
id: a,
|
|
2476
|
-
key: a,
|
|
2477
|
-
indexRoute: n,
|
|
2478
|
-
jsonKey: t,
|
|
2479
|
-
title: Ve(u()({}, e)),
|
|
2480
|
-
},
|
|
2481
|
-
(function (e) {
|
|
2482
|
-
var t = e.parentType,
|
|
2483
|
-
n = e.jsonKey,
|
|
2484
|
-
a = e.indexRoute,
|
|
2485
|
-
o = e.nodeKey,
|
|
2486
|
-
r = e.targetJsonSchema;
|
|
2487
|
-
return i().createElement(
|
|
2488
|
-
Pe,
|
|
2489
|
-
{
|
|
2490
|
-
className: 'array-item-schema schema-item-form',
|
|
2491
|
-
id: o,
|
|
2492
|
-
key: o,
|
|
2493
|
-
indexRoute: a,
|
|
2494
|
-
jsonKey: n,
|
|
2495
|
-
disabled: !0,
|
|
2496
|
-
title: Ve({
|
|
2497
|
-
indexRoute: a,
|
|
2498
|
-
jsonKey: n,
|
|
2499
|
-
targetJsonSchema: r,
|
|
2500
|
-
parentType: t,
|
|
2501
|
-
nodeKey: o,
|
|
2502
|
-
isFixed: !0,
|
|
2503
|
-
typeIsFixed: !1,
|
|
2504
|
-
}),
|
|
2505
|
-
},
|
|
2506
|
-
'object' === r.type &&
|
|
2507
|
-
(function (e) {
|
|
2508
|
-
var t = e.properties,
|
|
2509
|
-
n = e.parentIndexRoute,
|
|
2510
|
-
a = e.parentNodeKey,
|
|
2511
|
-
o = e.parentType;
|
|
2512
|
-
return e.propertyOrder.map(function (e, r) {
|
|
2513
|
-
var i = n ? n + '-' + r : '' + r,
|
|
2514
|
-
s = e,
|
|
2515
|
-
c = t[s],
|
|
2516
|
-
l = c.type,
|
|
2517
|
-
p = (a ? a + '-' : '') + l + '-' + s;
|
|
2518
|
-
return ot({
|
|
2519
|
-
parentType: o,
|
|
2520
|
-
jsonKey: s,
|
|
2521
|
-
indexRoute: i,
|
|
2522
|
-
key: p,
|
|
2523
|
-
nodeKey: p,
|
|
2524
|
-
targetJsonSchema: c,
|
|
2525
|
-
});
|
|
2526
|
-
});
|
|
2527
|
-
})({
|
|
2528
|
-
propertyOrder: r.propertyOrder,
|
|
2529
|
-
properties: r.properties,
|
|
2530
|
-
parentIndexRoute: a,
|
|
2531
|
-
parentNodeKey: o,
|
|
2532
|
-
parentType: t,
|
|
2533
|
-
}),
|
|
2534
|
-
);
|
|
2535
|
-
})({
|
|
2536
|
-
parentType: 'array',
|
|
2537
|
-
jsonKey: c,
|
|
2538
|
-
indexRoute: s,
|
|
2539
|
-
nodeKey: l,
|
|
2540
|
-
targetJsonSchema: p,
|
|
2541
|
-
}),
|
|
2542
|
-
);
|
|
2543
|
-
},
|
|
2544
|
-
Fe = (n(790), S.Select.Option),
|
|
2545
|
-
qe = (function (e) {
|
|
2546
|
-
function t(t) {
|
|
2547
|
-
var n;
|
|
2548
|
-
return (
|
|
2549
|
-
((n = e.call(this, t) || this).typeChange = function (e) {
|
|
2550
|
-
var t = n.props.schemaStore || {},
|
|
2551
|
-
a = t.editSchemaData,
|
|
2552
|
-
o = t.updateSchemaData,
|
|
2553
|
-
r = n.props,
|
|
2554
|
-
i = r.indexRoute,
|
|
2555
|
-
s = r.jsonKey,
|
|
2556
|
-
c = r.targetJsonSchema,
|
|
2557
|
-
l = r.typeSelectData;
|
|
2558
|
-
if (c.default !== e) {
|
|
2559
|
-
if ((a(i, s, { default: e }), l)) {
|
|
2560
|
-
var p = l[e];
|
|
2561
|
-
p &&
|
|
2562
|
-
'数据源类型' === c.title &&
|
|
2563
|
-
a((0, Oe.getNextIndexRoute)(i), 'data', p);
|
|
2564
|
-
}
|
|
2565
|
-
if (Oe.EventTypeDataList) {
|
|
2566
|
-
var d = Oe.EventTypeDataList[e];
|
|
2567
|
-
'事件类型' === c.title &&
|
|
2568
|
-
d &&
|
|
2569
|
-
o((0, Oe.getParentIndexRoute)(i), d);
|
|
2570
|
-
}
|
|
2571
|
-
}
|
|
2572
|
-
}),
|
|
2573
|
-
(n.typeChange = n.typeChange.bind(n)),
|
|
2574
|
-
n
|
|
2575
|
-
);
|
|
2576
|
-
}
|
|
2577
|
-
return (
|
|
2578
|
-
o()(t, e),
|
|
2579
|
-
(t.prototype.render = function () {
|
|
2580
|
-
var e = this.props,
|
|
2581
|
-
t = e.nodeKey,
|
|
2582
|
-
n = e.targetJsonSchema,
|
|
2583
|
-
a = n.type,
|
|
2584
|
-
o = n.options || [];
|
|
2585
|
-
return r.createElement(
|
|
2586
|
-
'div',
|
|
2587
|
-
{ className: 'typeSelect-schema-box', id: t },
|
|
2588
|
-
r.createElement(
|
|
2589
|
-
'div',
|
|
2590
|
-
{ className: 'key-input-item' },
|
|
2591
|
-
r.createElement(
|
|
2592
|
-
S.Select,
|
|
2593
|
-
{
|
|
2594
|
-
defaultValue: n.default || 'local',
|
|
2595
|
-
onChange: this.typeChange,
|
|
2596
|
-
},
|
|
2597
|
-
o.map(function (e, t) {
|
|
2598
|
-
return r.createElement(
|
|
2599
|
-
Fe,
|
|
2600
|
-
{ key: t, value: e.value },
|
|
2601
|
-
e.label || e.name,
|
|
2602
|
-
);
|
|
2603
|
-
}),
|
|
2604
|
-
),
|
|
2605
|
-
),
|
|
2606
|
-
r.createElement(
|
|
2607
|
-
'div',
|
|
2608
|
-
{ className: 'type-select-item' },
|
|
2609
|
-
r.createElement(
|
|
2610
|
-
S.Select,
|
|
2611
|
-
{ defaultValue: a, style: { width: 120 }, disabled: !0 },
|
|
2612
|
-
r.createElement(Fe, { key: a, value: a }, a),
|
|
2613
|
-
),
|
|
2614
|
-
),
|
|
2615
|
-
r.createElement(
|
|
2616
|
-
'div',
|
|
2617
|
-
{ className: 'title-input-item' },
|
|
2618
|
-
r.createElement(S.Input, {
|
|
2619
|
-
defaultValue: n.title,
|
|
2620
|
-
disabled: !0,
|
|
2621
|
-
}),
|
|
2622
|
-
),
|
|
2623
|
-
r.createElement('div', { className: 'operate-item' }, ' '),
|
|
2624
|
-
);
|
|
2625
|
-
}),
|
|
2626
|
-
t
|
|
2627
|
-
);
|
|
2628
|
-
})(r.PureComponent);
|
|
2629
|
-
qe.propTypes = {
|
|
2630
|
-
parentType: d().string,
|
|
2631
|
-
jsonKey: d().string,
|
|
2632
|
-
indexRoute: d().string,
|
|
2633
|
-
nodeKey: d().string,
|
|
2634
|
-
targetJsonSchema: d().any,
|
|
2635
|
-
typeSelectData: d().any,
|
|
2636
|
-
isFixed: d().any,
|
|
2637
|
-
};
|
|
2638
|
-
var Ae = (0, l.inject)(function (e) {
|
|
2639
|
-
return { schemaStore: e.schemaStore };
|
|
2640
|
-
})((0, l.observer)(qe)),
|
|
2641
|
-
_e = S.Tree.TreeNode,
|
|
2642
|
-
Me = function (e) {
|
|
2643
|
-
return i().createElement(Be, e);
|
|
2644
|
-
},
|
|
2645
|
-
We = {
|
|
2646
|
-
local: {
|
|
2647
|
-
type: 'json',
|
|
2648
|
-
title: '本地json数据',
|
|
2649
|
-
default: '{}',
|
|
2650
|
-
placeholder: '请输入静态json数据',
|
|
2651
|
-
isRequired: !0,
|
|
2652
|
-
description: '用于设置本地的静态json数据',
|
|
2653
|
-
},
|
|
2654
|
-
remote: {
|
|
2655
|
-
type: 'url',
|
|
2656
|
-
title: '远程json数据',
|
|
2657
|
-
default: 'http://xxx',
|
|
2658
|
-
placeholder: '请输入远程json数据源地址',
|
|
2659
|
-
isRequired: !0,
|
|
2660
|
-
description: '用于设置获取元素数据的请求地址',
|
|
2661
|
-
},
|
|
2662
|
-
},
|
|
2663
|
-
ze = S.Tree.TreeNode,
|
|
2664
|
-
Ge = function (e) {
|
|
2665
|
-
return i().createElement(Be, e);
|
|
2666
|
-
},
|
|
2667
|
-
Ue = S.Tree.TreeNode,
|
|
2668
|
-
He = function (e) {
|
|
2669
|
-
return i().createElement(Be, e);
|
|
2670
|
-
},
|
|
2671
|
-
Xe = S.Tree.TreeNode,
|
|
2672
|
-
Qe = function (e) {
|
|
2673
|
-
return i().createElement(Be, e);
|
|
2674
|
-
},
|
|
2675
|
-
Ye = (n(617), S.Select.Option),
|
|
2676
|
-
Ze = (function (e) {
|
|
2677
|
-
function t(t) {
|
|
2678
|
-
var n;
|
|
2679
|
-
return (
|
|
2680
|
-
((n = e.call(this, t) || this).handleLabelChange = function (
|
|
2681
|
-
e,
|
|
2682
|
-
) {
|
|
2683
|
-
var t = n.props.schemaStore || {},
|
|
2684
|
-
a = t.isExitOptionLabel,
|
|
2685
|
-
o = t.updateOptionLabel,
|
|
2686
|
-
r = e.target.value,
|
|
2687
|
-
i = n.props,
|
|
2688
|
-
s = i.indexRoute,
|
|
2689
|
-
c = i.optionIndex;
|
|
2690
|
-
r !== i.optionLabel &&
|
|
2691
|
-
(a(s, r)
|
|
2692
|
-
? S.message.warning(
|
|
2693
|
-
'对不起,存在相同的Label值,请重新设置。',
|
|
2694
|
-
)
|
|
2695
|
-
: o(s, c, r));
|
|
2696
|
-
}),
|
|
2697
|
-
(n.handleValueChange = function (e) {
|
|
2698
|
-
var t = (n.props.schemaStore || {}).updateOptionValue,
|
|
2699
|
-
a = e.target.value,
|
|
2700
|
-
o = n.props,
|
|
2701
|
-
r = o.indexRoute,
|
|
2702
|
-
i = o.optionIndex;
|
|
2703
|
-
a !== o.optionValue && t(r, i, a);
|
|
2704
|
-
}),
|
|
2705
|
-
(n.onAddBtnEvent = function () {
|
|
2706
|
-
var e = (n.props.schemaStore || {}).addOptionItem,
|
|
2707
|
-
t = n.props;
|
|
2708
|
-
e(t.indexRoute, t.optionIndex);
|
|
2709
|
-
}),
|
|
2710
|
-
(n.onCopyBtnEvent = function () {
|
|
2711
|
-
var e = (n.props.schemaStore || {}).copyOptionItem,
|
|
2712
|
-
t = n.props;
|
|
2713
|
-
e(t.indexRoute, t.optionIndex);
|
|
2714
|
-
}),
|
|
2715
|
-
(n.onDeleteBtnEvent = function () {
|
|
2716
|
-
var e = n.props.schemaStore || {},
|
|
2717
|
-
t = e.getSchemaByIndexRoute,
|
|
2718
|
-
a = e.deleteOptionItem,
|
|
2719
|
-
o = n.props,
|
|
2720
|
-
r = o.indexRoute,
|
|
2721
|
-
i = o.optionIndex,
|
|
2722
|
-
s = t(r);
|
|
2723
|
-
s.options && s.options.length > 1
|
|
2724
|
-
? a(r, i)
|
|
2725
|
-
: S.message.warning('删除失败,至少保留一个可选项。');
|
|
2726
|
-
}),
|
|
2727
|
-
(n.onAddBtnEvent = n.onAddBtnEvent.bind(n)),
|
|
2728
|
-
(n.onCopyBtnEvent = n.onCopyBtnEvent.bind(n)),
|
|
2729
|
-
(n.onDeleteBtnEvent = n.onDeleteBtnEvent.bind(n)),
|
|
2730
|
-
(n.handleLabelChange = n.handleLabelChange.bind(n)),
|
|
2731
|
-
(n.handleValueChange = n.handleValueChange.bind(n)),
|
|
2732
|
-
n
|
|
2733
|
-
);
|
|
2734
|
-
}
|
|
2735
|
-
return (
|
|
2736
|
-
o()(t, e),
|
|
2737
|
-
(t.prototype.render = function () {
|
|
2738
|
-
var e = this.props,
|
|
2739
|
-
t = e.optionLabel,
|
|
2740
|
-
n = e.optionValue;
|
|
2741
|
-
return (
|
|
2742
|
-
e.optionNodeKey,
|
|
2743
|
-
r.createElement(
|
|
2744
|
-
'div',
|
|
2745
|
-
{ className: 'option-schema-box', id: t },
|
|
2746
|
-
r.createElement(
|
|
2747
|
-
'div',
|
|
2748
|
-
{ className: 'key-input-item' },
|
|
2749
|
-
r.createElement(S.Input, {
|
|
2750
|
-
defaultValue: n,
|
|
2751
|
-
onPressEnter: this.handleValueChange,
|
|
2752
|
-
onBlur: this.handleValueChange,
|
|
2753
|
-
}),
|
|
2754
|
-
),
|
|
2755
|
-
r.createElement(
|
|
2756
|
-
'div',
|
|
2757
|
-
{ className: 'type-select-item' },
|
|
2758
|
-
r.createElement(
|
|
2759
|
-
S.Select,
|
|
2760
|
-
{ defaultValue: 'string', style: { width: 120 } },
|
|
2761
|
-
r.createElement(
|
|
2762
|
-
Ye,
|
|
2763
|
-
{ key: 'string', value: 'string' },
|
|
2764
|
-
'string',
|
|
2765
|
-
),
|
|
2766
|
-
),
|
|
2767
|
-
),
|
|
2768
|
-
r.createElement(
|
|
2769
|
-
'div',
|
|
2770
|
-
{ className: 'title-input-item' },
|
|
2771
|
-
r.createElement(S.Input, {
|
|
2772
|
-
defaultValue: t,
|
|
2773
|
-
onPressEnter: this.handleLabelChange,
|
|
2774
|
-
onBlur: this.handleLabelChange,
|
|
2775
|
-
}),
|
|
2776
|
-
),
|
|
2777
|
-
r.createElement(
|
|
2778
|
-
'div',
|
|
2779
|
-
{ className: 'operate-item' },
|
|
2780
|
-
r.createElement(
|
|
2781
|
-
S.Tooltip,
|
|
2782
|
-
{ title: '删除' },
|
|
2783
|
-
r.createElement(we.CloseOutlined, {
|
|
2784
|
-
className: 'operate-btn delete-operate',
|
|
2785
|
-
onClick: this.onDeleteBtnEvent,
|
|
2786
|
-
}),
|
|
2787
|
-
),
|
|
2788
|
-
r.createElement(
|
|
2789
|
-
S.Tooltip,
|
|
2790
|
-
{ title: '新增可选项' },
|
|
2791
|
-
r.createElement(we.PlusOutlined, {
|
|
2792
|
-
className: 'operate-btn',
|
|
2793
|
-
onClick: this.onAddBtnEvent,
|
|
2794
|
-
}),
|
|
2795
|
-
),
|
|
2796
|
-
r.createElement(
|
|
2797
|
-
S.Tooltip,
|
|
2798
|
-
{ title: '复制' },
|
|
2799
|
-
r.createElement(we.CopyOutlined, {
|
|
2800
|
-
className: 'operate-btn',
|
|
2801
|
-
onClick: this.onCopyBtnEvent,
|
|
2802
|
-
}),
|
|
2803
|
-
),
|
|
2804
|
-
),
|
|
2805
|
-
)
|
|
2806
|
-
);
|
|
2807
|
-
}),
|
|
2808
|
-
t
|
|
2809
|
-
);
|
|
2810
|
-
})(r.PureComponent);
|
|
2811
|
-
Ze.propTypes = {
|
|
2812
|
-
indexRoute: d().string,
|
|
2813
|
-
optionIndex: d().any,
|
|
2814
|
-
optionLabel: d().string,
|
|
2815
|
-
optionValue: d().string,
|
|
2816
|
-
optionNodeKey: d().string,
|
|
2817
|
-
};
|
|
2818
|
-
var $e = (0, l.inject)(function (e) {
|
|
2819
|
-
return { schemaStore: e.schemaStore };
|
|
2820
|
-
})((0, l.observer)(Ze)),
|
|
2821
|
-
et = S.Tree.TreeNode,
|
|
2822
|
-
tt = function (e) {
|
|
2823
|
-
return i().createElement($e, e);
|
|
2824
|
-
},
|
|
2825
|
-
nt = S.Tree.TreeNode,
|
|
2826
|
-
at = function (e) {
|
|
2827
|
-
return i().createElement(Be, e);
|
|
2828
|
-
},
|
|
2829
|
-
ot = function (e) {
|
|
2830
|
-
switch (e.targetJsonSchema.type) {
|
|
2831
|
-
case 'object':
|
|
2832
|
-
case 'func':
|
|
2833
|
-
case 'style':
|
|
2834
|
-
case 'data':
|
|
2835
|
-
case 'dynamic-config':
|
|
2836
|
-
case 'sohu-source':
|
|
2837
|
-
case 'sohu-event':
|
|
2838
|
-
return st(e);
|
|
2839
|
-
case 'array':
|
|
2840
|
-
return Le(e);
|
|
2841
|
-
case 'datasource':
|
|
2842
|
-
return (function (e) {
|
|
2843
|
-
var t,
|
|
2844
|
-
n = e.jsonKey,
|
|
2845
|
-
a = e.indexRoute,
|
|
2846
|
-
o = e.nodeKey,
|
|
2847
|
-
r = e.targetJsonSchema,
|
|
2848
|
-
s = r.type,
|
|
2849
|
-
c = r.properties.data || {};
|
|
2850
|
-
return i().createElement(
|
|
2851
|
-
_e,
|
|
2852
|
-
{
|
|
2853
|
-
className: s + '-schema schema-item-form',
|
|
2854
|
-
id: o,
|
|
2855
|
-
key: o,
|
|
2856
|
-
indexRoute: a,
|
|
2857
|
-
jsonKey: n,
|
|
2858
|
-
title: Me(u()({}, e)),
|
|
2859
|
-
},
|
|
2860
|
-
i().createElement(_e, {
|
|
2861
|
-
className: 'dataSource-type-item-schema schema-item-form',
|
|
2862
|
-
id: o + '-type',
|
|
2863
|
-
key: o + '-type',
|
|
2864
|
-
indexRoute: a ? a + '-0' : '0',
|
|
2865
|
-
jsonKey: 'type',
|
|
2866
|
-
disabled: !0,
|
|
2867
|
-
title:
|
|
2868
|
-
((t = {
|
|
2869
|
-
indexRoute: a ? a + '-0' : '0',
|
|
2870
|
-
jsonKey: 'type',
|
|
2871
|
-
targetJsonSchema: r.properties.type,
|
|
2872
|
-
parentType: s,
|
|
2873
|
-
nodeKey: o + '-type',
|
|
2874
|
-
typeSelectData: We,
|
|
2875
|
-
}),
|
|
2876
|
-
i().createElement(Ae, t)),
|
|
2877
|
-
}),
|
|
2878
|
-
i().createElement(_e, {
|
|
2879
|
-
className: 'dataSource-data-item-schema schema-item-form',
|
|
2880
|
-
id: o + '-data-' + c.type,
|
|
2881
|
-
key: o + '-data-' + c.type,
|
|
2882
|
-
indexRoute: a ? a + '-1' : '1',
|
|
2883
|
-
jsonKey: 'data',
|
|
2884
|
-
disabled: !0,
|
|
2885
|
-
title: Me({
|
|
2886
|
-
indexRoute: a ? a + '-1' : '1',
|
|
2887
|
-
jsonKey: 'data',
|
|
2888
|
-
targetJsonSchema: c,
|
|
2889
|
-
parentType: s,
|
|
2890
|
-
nodeKey: o + '-data-' + c.type,
|
|
2891
|
-
hideOperaBtn: !0,
|
|
2892
|
-
keyIsFixed: !0,
|
|
2893
|
-
typeIsFixed: !0,
|
|
2894
|
-
}),
|
|
2895
|
-
}),
|
|
2896
|
-
i().createElement(_e, {
|
|
2897
|
-
className:
|
|
2898
|
-
'dataSource-filter-item-schema schema-item-form',
|
|
2899
|
-
id: o + '-filter',
|
|
2900
|
-
key: o + '-filter',
|
|
2901
|
-
indexRoute: a ? a + '-2' : '2',
|
|
2902
|
-
jsonKey: 'filter',
|
|
2903
|
-
disabled: !0,
|
|
2904
|
-
title: Me({
|
|
2905
|
-
indexRoute: a ? a + '-2' : '2',
|
|
2906
|
-
jsonKey: 'filter',
|
|
2907
|
-
targetJsonSchema: r.properties.filter,
|
|
2908
|
-
parentType: s,
|
|
2909
|
-
nodeKey: o + '-filter',
|
|
2910
|
-
hideOperaBtn: !0,
|
|
2911
|
-
keyIsFixed: !0,
|
|
2912
|
-
typeIsFixed: !0,
|
|
2913
|
-
}),
|
|
2914
|
-
}),
|
|
2915
|
-
);
|
|
2916
|
-
})(e);
|
|
2917
|
-
case 'dynamic-data':
|
|
2918
|
-
return (function (e) {
|
|
2919
|
-
var t,
|
|
2920
|
-
n = e.jsonKey,
|
|
2921
|
-
a = e.indexRoute,
|
|
2922
|
-
o = e.nodeKey,
|
|
2923
|
-
r = e.targetJsonSchema,
|
|
2924
|
-
s = r.type,
|
|
2925
|
-
c = r.properties.config || {},
|
|
2926
|
-
l = r.properties.data || {};
|
|
2927
|
-
return i().createElement(
|
|
2928
|
-
ze,
|
|
2929
|
-
{
|
|
2930
|
-
className: s + '-schema schema-item-form',
|
|
2931
|
-
id: o,
|
|
2932
|
-
key: o,
|
|
2933
|
-
indexRoute: a,
|
|
2934
|
-
jsonKey: n,
|
|
2935
|
-
title: Ge(u()({}, e)),
|
|
2936
|
-
},
|
|
2937
|
-
i().createElement(ze, {
|
|
2938
|
-
className: 'dataSource-type-item-schema schema-item-form',
|
|
2939
|
-
id: o + '-type',
|
|
2940
|
-
key: o + '-type',
|
|
2941
|
-
indexRoute: a ? a + '-0' : '0',
|
|
2942
|
-
jsonKey: 'type',
|
|
2943
|
-
disabled: !0,
|
|
2944
|
-
title:
|
|
2945
|
-
((t = {
|
|
2946
|
-
indexRoute: a ? a + '-0' : '0',
|
|
2947
|
-
jsonKey: 'type',
|
|
2948
|
-
targetJsonSchema: r.properties.type,
|
|
2949
|
-
parentType: s,
|
|
2950
|
-
nodeKey: o + '-type',
|
|
2951
|
-
}),
|
|
2952
|
-
i().createElement(Ae, t)),
|
|
2953
|
-
}),
|
|
2954
|
-
i().createElement(ze, {
|
|
2955
|
-
className:
|
|
2956
|
-
'dataSource-config-item-schema schema-item-form',
|
|
2957
|
-
id: o + '-config-' + l.type,
|
|
2958
|
-
key: o + '-config-' + l.type,
|
|
2959
|
-
indexRoute: a ? a + '-1' : '1',
|
|
2960
|
-
jsonKey: 'config',
|
|
2961
|
-
disabled: !0,
|
|
2962
|
-
title: Ge({
|
|
2963
|
-
indexRoute: a ? a + '-1' : '1',
|
|
2964
|
-
jsonKey: 'config',
|
|
2965
|
-
targetJsonSchema: c,
|
|
2966
|
-
parentType: s,
|
|
2967
|
-
nodeKey: o + '-config-' + c.type,
|
|
2968
|
-
hideOperaBtn: !0,
|
|
2969
|
-
keyIsFixed: !0,
|
|
2970
|
-
typeIsFixed: !0,
|
|
2971
|
-
}),
|
|
2972
|
-
}),
|
|
2973
|
-
i().createElement(ze, {
|
|
2974
|
-
className: 'dataSource-data-item-schema schema-item-form',
|
|
2975
|
-
id: o + '-data-' + l.type,
|
|
2976
|
-
key: o + '-data-' + l.type,
|
|
2977
|
-
indexRoute: a ? a + '-2' : '2',
|
|
2978
|
-
jsonKey: 'data',
|
|
2979
|
-
disabled: !0,
|
|
2980
|
-
title: Ge({
|
|
2981
|
-
indexRoute: a ? a + '-2' : '2',
|
|
2982
|
-
jsonKey: 'data',
|
|
2983
|
-
targetJsonSchema: l,
|
|
2984
|
-
parentType: s,
|
|
2985
|
-
nodeKey: o + '-data-' + l.type,
|
|
2986
|
-
hideOperaBtn: !0,
|
|
2987
|
-
keyIsFixed: !0,
|
|
2988
|
-
typeIsFixed: !0,
|
|
2989
|
-
}),
|
|
2990
|
-
}),
|
|
2991
|
-
);
|
|
2992
|
-
})(e);
|
|
2993
|
-
case 'event':
|
|
2994
|
-
return (function (e) {
|
|
2995
|
-
var t,
|
|
2996
|
-
n = e.jsonKey,
|
|
2997
|
-
a = e.indexRoute,
|
|
2998
|
-
o = e.nodeKey,
|
|
2999
|
-
r = e.targetJsonSchema,
|
|
3000
|
-
s = r.type,
|
|
3001
|
-
c = r.properties.type || {},
|
|
3002
|
-
l = r.properties.register || {},
|
|
3003
|
-
p = r.properties.actionFunc || {},
|
|
3004
|
-
d = r.properties.trigger || {},
|
|
3005
|
-
m = r.properties.eventData || {};
|
|
3006
|
-
return i().createElement(
|
|
3007
|
-
Ue,
|
|
3008
|
-
{
|
|
3009
|
-
className: s + '-schema schema-item-form',
|
|
3010
|
-
id: o,
|
|
3011
|
-
key: o,
|
|
3012
|
-
indexRoute: a,
|
|
3013
|
-
jsonKey: n,
|
|
3014
|
-
title: He(u()({}, e)),
|
|
3015
|
-
},
|
|
3016
|
-
i().createElement(Ue, {
|
|
3017
|
-
className: 'event-type-item-schema schema-item-form',
|
|
3018
|
-
id: o + '-type',
|
|
3019
|
-
key: o + '-type',
|
|
3020
|
-
indexRoute: a ? a + '-0' : '0',
|
|
3021
|
-
jsonKey: 'type',
|
|
3022
|
-
disabled: !0,
|
|
3023
|
-
title:
|
|
3024
|
-
((t = {
|
|
3025
|
-
indexRoute: a ? a + '-0' : '0',
|
|
3026
|
-
jsonKey: 'type',
|
|
3027
|
-
targetJsonSchema: c,
|
|
3028
|
-
parentType: s,
|
|
3029
|
-
nodeKey: o + '-type',
|
|
3030
|
-
}),
|
|
3031
|
-
i().createElement(Ae, t)),
|
|
3032
|
-
}),
|
|
3033
|
-
'on' === c.default &&
|
|
3034
|
-
l &&
|
|
3035
|
-
i().createElement(Ue, {
|
|
3036
|
-
className:
|
|
3037
|
-
'event-register-item-schema schema-item-form',
|
|
3038
|
-
id: o + '-register-' + c.default,
|
|
3039
|
-
key: o + '-register-' + c.default,
|
|
3040
|
-
indexRoute: a ? a + '-1' : '1',
|
|
3041
|
-
jsonKey: 'register',
|
|
3042
|
-
disabled: !0,
|
|
3043
|
-
title: He({
|
|
3044
|
-
indexRoute: a ? a + '-1' : '1',
|
|
3045
|
-
jsonKey: 'register',
|
|
3046
|
-
targetJsonSchema: l,
|
|
3047
|
-
parentType: s,
|
|
3048
|
-
nodeKey: o + '-register-' + c.default,
|
|
3049
|
-
hideOperaBtn: !0,
|
|
3050
|
-
keyIsFixed: !0,
|
|
3051
|
-
typeIsFixed: !0,
|
|
3052
|
-
}),
|
|
3053
|
-
}),
|
|
3054
|
-
'on' === c.default &&
|
|
3055
|
-
p &&
|
|
3056
|
-
i().createElement(Ue, {
|
|
3057
|
-
className:
|
|
3058
|
-
'event-actionFunc-item-schema schema-item-form',
|
|
3059
|
-
id: o + '-actionFunc-' + c.default,
|
|
3060
|
-
key: o + '-actionFunc-' + c.default,
|
|
3061
|
-
indexRoute: a ? a + '-2' : '2',
|
|
3062
|
-
jsonKey: 'actionFunc',
|
|
3063
|
-
disabled: !0,
|
|
3064
|
-
title: He({
|
|
3065
|
-
indexRoute: a ? a + '-2' : '2',
|
|
3066
|
-
jsonKey: 'actionFunc',
|
|
3067
|
-
targetJsonSchema: p,
|
|
3068
|
-
parentType: s,
|
|
3069
|
-
nodeKey: o + '-actionFunc-' + c.default,
|
|
3070
|
-
hideOperaBtn: !0,
|
|
3071
|
-
keyIsFixed: !0,
|
|
3072
|
-
typeIsFixed: !0,
|
|
3073
|
-
}),
|
|
3074
|
-
}),
|
|
3075
|
-
'emit' === c.default &&
|
|
3076
|
-
d &&
|
|
3077
|
-
i().createElement(Ue, {
|
|
3078
|
-
className: 'event-trigger-item-schema schema-item-form',
|
|
3079
|
-
id: o + '-trigger-' + c.default,
|
|
3080
|
-
key: o + '-trigger-' + c.default,
|
|
3081
|
-
indexRoute: a ? a + '-1' : '1',
|
|
3082
|
-
jsonKey: 'trigger',
|
|
3083
|
-
disabled: !0,
|
|
3084
|
-
title: He({
|
|
3085
|
-
indexRoute: a ? a + '-1' : '1',
|
|
3086
|
-
jsonKey: 'trigger',
|
|
3087
|
-
targetJsonSchema: d,
|
|
3088
|
-
parentType: s,
|
|
3089
|
-
nodeKey: o + '-trigger-' + c.default,
|
|
3090
|
-
hideOperaBtn: !0,
|
|
3091
|
-
keyIsFixed: !0,
|
|
3092
|
-
typeIsFixed: !0,
|
|
3093
|
-
}),
|
|
3094
|
-
}),
|
|
3095
|
-
'emit' === c.default &&
|
|
3096
|
-
m &&
|
|
3097
|
-
i().createElement(Ue, {
|
|
3098
|
-
className:
|
|
3099
|
-
'event-eventData-item-schema schema-item-form',
|
|
3100
|
-
id: o + '-eventData-' + c.default,
|
|
3101
|
-
key: o + '-eventData-' + c.default,
|
|
3102
|
-
indexRoute: a ? a + '-2' : '2',
|
|
3103
|
-
jsonKey: 'eventData',
|
|
3104
|
-
disabled: !0,
|
|
3105
|
-
title: He({
|
|
3106
|
-
indexRoute: a ? a + '-2' : '2',
|
|
3107
|
-
jsonKey: 'eventData',
|
|
3108
|
-
targetJsonSchema: m,
|
|
3109
|
-
parentType: s,
|
|
3110
|
-
nodeKey: o + '-eventData-' + c.default,
|
|
3111
|
-
hideOperaBtn: !0,
|
|
3112
|
-
keyIsFixed: !0,
|
|
3113
|
-
typeIsFixed: !0,
|
|
3114
|
-
}),
|
|
3115
|
-
}),
|
|
3116
|
-
);
|
|
3117
|
-
})(e);
|
|
3118
|
-
case 'quantity':
|
|
3119
|
-
case 'box-style':
|
|
3120
|
-
return (function (e) {
|
|
3121
|
-
var t,
|
|
3122
|
-
n = e.jsonKey,
|
|
3123
|
-
a = e.indexRoute,
|
|
3124
|
-
o = e.nodeKey,
|
|
3125
|
-
r = e.targetJsonSchema,
|
|
3126
|
-
s = r.type,
|
|
3127
|
-
c = r.propertyOrder[0],
|
|
3128
|
-
l = r.properties[c];
|
|
3129
|
-
return i().createElement(
|
|
3130
|
-
Xe,
|
|
3131
|
-
{
|
|
3132
|
-
className: s + '-schema schema-item-form',
|
|
3133
|
-
id: o,
|
|
3134
|
-
key: o,
|
|
3135
|
-
indexRoute: a,
|
|
3136
|
-
jsonKey: n,
|
|
3137
|
-
title: Qe(u()({}, e)),
|
|
3138
|
-
},
|
|
3139
|
-
i().createElement(Xe, {
|
|
3140
|
-
className: 'quantity-unit-item-schema schema-item-form',
|
|
3141
|
-
id: o + '-' + c,
|
|
3142
|
-
key: o + '-' + c,
|
|
3143
|
-
indexRoute: a ? a + '-0' : '0',
|
|
3144
|
-
jsonKey: c,
|
|
3145
|
-
disabled: !0,
|
|
3146
|
-
title: Qe({
|
|
3147
|
-
indexRoute: a ? a + '-0' : '0',
|
|
3148
|
-
jsonKey: c,
|
|
3149
|
-
targetJsonSchema: l,
|
|
3150
|
-
parentType: s,
|
|
3151
|
-
nodeKey: o + '-' + c,
|
|
3152
|
-
hideOperaBtn: !0,
|
|
3153
|
-
showAdvanceBtn: !0,
|
|
3154
|
-
typeIsFixed: !0,
|
|
3155
|
-
}),
|
|
3156
|
-
}),
|
|
3157
|
-
i().createElement(Xe, {
|
|
3158
|
-
className:
|
|
3159
|
-
'quantity-typeSelect-item-schema schema-item-form',
|
|
3160
|
-
id: o + '-quantity',
|
|
3161
|
-
key: o + '-quantity',
|
|
3162
|
-
indexRoute: a ? a + '-1' : '1',
|
|
3163
|
-
jsonKey: 'quantity',
|
|
3164
|
-
disabled: !0,
|
|
3165
|
-
title:
|
|
3166
|
-
((t = {
|
|
3167
|
-
indexRoute: a ? a + '-1' : '1',
|
|
3168
|
-
jsonKey: 'quantity',
|
|
3169
|
-
targetJsonSchema: r.properties.quantity,
|
|
3170
|
-
parentType: s,
|
|
3171
|
-
nodeKey: o + '-quantity',
|
|
3172
|
-
}),
|
|
3173
|
-
i().createElement(Ae, t)),
|
|
3174
|
-
}),
|
|
3175
|
-
);
|
|
3176
|
-
})(e);
|
|
3177
|
-
case 'radio':
|
|
3178
|
-
case 'checkboxes':
|
|
3179
|
-
case 'select':
|
|
3180
|
-
return (function (e) {
|
|
3181
|
-
var t,
|
|
3182
|
-
n = e.jsonKey,
|
|
3183
|
-
a = e.indexRoute,
|
|
3184
|
-
o = e.nodeKey,
|
|
3185
|
-
r = e.targetJsonSchema,
|
|
3186
|
-
s = r.type,
|
|
3187
|
-
c = r.options,
|
|
3188
|
-
l = a || '0';
|
|
3189
|
-
return i().createElement(
|
|
3190
|
-
et,
|
|
3191
|
-
{
|
|
3192
|
-
className: s + '-schema schema-item-form',
|
|
3193
|
-
id: o,
|
|
3194
|
-
key: o,
|
|
3195
|
-
indexRoute: a,
|
|
3196
|
-
jsonKey: n,
|
|
3197
|
-
title: ((t = u()({}, e)), i().createElement(Be, t)),
|
|
3198
|
-
},
|
|
3199
|
-
c &&
|
|
3200
|
-
c.length > 0 &&
|
|
3201
|
-
c.map(function (e, t) {
|
|
3202
|
-
var n = e.label || e.name,
|
|
3203
|
-
a = e.value,
|
|
3204
|
-
r = '' + o + s + '-' + n;
|
|
3205
|
-
return i().createElement(et, {
|
|
3206
|
-
className: 'enum-item-schema schema-item-form',
|
|
3207
|
-
id: r,
|
|
3208
|
-
key: r,
|
|
3209
|
-
indexRoute: l,
|
|
3210
|
-
disabled: !0,
|
|
3211
|
-
title: tt({
|
|
3212
|
-
indexRoute: l,
|
|
3213
|
-
optionIndex: t,
|
|
3214
|
-
optionLabel: n,
|
|
3215
|
-
optionValue: a,
|
|
3216
|
-
optionNodeKey: r,
|
|
3217
|
-
}),
|
|
3218
|
-
});
|
|
3219
|
-
}),
|
|
3220
|
-
);
|
|
3221
|
-
})(e);
|
|
3222
|
-
default:
|
|
3223
|
-
return (function (e) {
|
|
3224
|
-
var t = e.jsonKey,
|
|
3225
|
-
n = e.indexRoute,
|
|
3226
|
-
a = e.nodeKey,
|
|
3227
|
-
o = e.targetJsonSchema.type;
|
|
3228
|
-
return i().createElement(nt, {
|
|
3229
|
-
className: o + '-schema schema-item-form',
|
|
3230
|
-
id: a,
|
|
3231
|
-
key: a,
|
|
3232
|
-
indexRoute: n,
|
|
3233
|
-
jsonKey: t,
|
|
3234
|
-
title: at(e),
|
|
3235
|
-
});
|
|
3236
|
-
})(e);
|
|
3237
|
-
}
|
|
3238
|
-
},
|
|
3239
|
-
rt = S.Tree.TreeNode,
|
|
3240
|
-
it = function (e) {
|
|
3241
|
-
return i().createElement(Be, e);
|
|
3242
|
-
},
|
|
3243
|
-
st = function (e) {
|
|
3244
|
-
var t,
|
|
3245
|
-
n,
|
|
3246
|
-
a,
|
|
3247
|
-
o,
|
|
3248
|
-
r,
|
|
3249
|
-
s = e.jsonKey,
|
|
3250
|
-
c = e.indexRoute,
|
|
3251
|
-
l = e.nodeKey,
|
|
3252
|
-
p = e.targetJsonSchema,
|
|
3253
|
-
d = e.isOnlyShowChild,
|
|
3254
|
-
m = p.type,
|
|
3255
|
-
h = p.isFixed,
|
|
3256
|
-
y =
|
|
3257
|
-
((t = {
|
|
3258
|
-
propertyOrder: p.propertyOrder,
|
|
3259
|
-
properties: p.properties,
|
|
3260
|
-
parentIndexRoute: c,
|
|
3261
|
-
parentNodeKey: l,
|
|
3262
|
-
parentType: m,
|
|
3263
|
-
isOnlyShowChild: d,
|
|
3264
|
-
}),
|
|
3265
|
-
(n = t.properties),
|
|
3266
|
-
(a = t.parentIndexRoute),
|
|
3267
|
-
(o = t.parentNodeKey),
|
|
3268
|
-
(r = t.parentType),
|
|
3269
|
-
t.propertyOrder.map(function (e, t) {
|
|
3270
|
-
var i = a ? a + '-' + t : '' + t,
|
|
3271
|
-
s = e,
|
|
3272
|
-
c = n[s],
|
|
3273
|
-
l = c.type,
|
|
3274
|
-
p = (o ? o + '-' : '') + l + '-' + s;
|
|
3275
|
-
return ot({
|
|
3276
|
-
parentType: r,
|
|
3277
|
-
jsonKey: s,
|
|
3278
|
-
indexRoute: i,
|
|
3279
|
-
key: p,
|
|
3280
|
-
nodeKey: p,
|
|
3281
|
-
targetJsonSchema: c,
|
|
3282
|
-
});
|
|
3283
|
-
})),
|
|
3284
|
-
g = i().createElement(
|
|
3285
|
-
rt,
|
|
3286
|
-
{
|
|
3287
|
-
className: m + '-schema schema-item-form',
|
|
3288
|
-
id: l,
|
|
3289
|
-
key: l,
|
|
3290
|
-
indexRoute: c,
|
|
3291
|
-
jsonKey: s,
|
|
3292
|
-
disabled: h,
|
|
3293
|
-
title: it(u()({}, e)),
|
|
3294
|
-
},
|
|
3295
|
-
y,
|
|
3296
|
-
);
|
|
3297
|
-
return d ? y : g;
|
|
3298
|
-
},
|
|
3299
|
-
ct =
|
|
3300
|
-
(n(23),
|
|
3301
|
-
(function (e) {
|
|
3302
|
-
function t(t) {
|
|
3303
|
-
var n;
|
|
3304
|
-
((n = e.call(this, t) || this).onDragStart = function (e) {
|
|
3305
|
-
(0, (n.props.schemaStore || {}).getSchemaByIndexRoute)(
|
|
3306
|
-
e.node.indexRoute,
|
|
3307
|
-
).isFixed && S.message.warning('当前元素不支持拖拽哦。');
|
|
3308
|
-
}),
|
|
3309
|
-
(n.onDrop = function (e) {
|
|
3310
|
-
var t = e.dragNode,
|
|
3311
|
-
a = e.node,
|
|
3312
|
-
o = n.props.schemaStore || {},
|
|
3313
|
-
r = o.getSchemaByIndexRoute,
|
|
3314
|
-
i = o.indexRoute2keyRoute,
|
|
3315
|
-
s = o.insertJsonData,
|
|
3316
|
-
c = o.deleteJsonByIndex,
|
|
3317
|
-
l = o.isExitJsonKey,
|
|
3318
|
-
p = o.isSupportCurType,
|
|
3319
|
-
d = t.indexRoute,
|
|
3320
|
-
m = t.jsonKey,
|
|
3321
|
-
u = r(d);
|
|
3322
|
-
if (!u.isFixed) {
|
|
3323
|
-
var h = a.indexRoute,
|
|
3324
|
-
y = (0, Oe.isSameParent)(d, h),
|
|
3325
|
-
g = (0, Oe.getCurPosition)(d, h);
|
|
3326
|
-
if (y)
|
|
3327
|
-
c(d, !0),
|
|
3328
|
-
'before' === g && (h = (0, Oe.moveForward)(h)),
|
|
3329
|
-
a.dragOverGapTop
|
|
3330
|
-
? s(h, m, u, 'before')
|
|
3331
|
-
: (a.dragOver || a.dragOverGapBottom) && s(h, m, u);
|
|
3332
|
-
else {
|
|
3333
|
-
if (l(h, m))
|
|
3334
|
-
return void S.message.warning(
|
|
3335
|
-
'目标位置中有重名的元素',
|
|
3336
|
-
);
|
|
3337
|
-
var f = u.type;
|
|
3338
|
-
if (!p(h, f))
|
|
3339
|
-
return void S.message.warning(
|
|
3340
|
-
'目标位置不支持' + f + '类型元素',
|
|
3341
|
-
);
|
|
3342
|
-
var v = i(d),
|
|
3343
|
-
x = (0, Oe.getParentIndexRoute)(h),
|
|
3344
|
-
b = (function (e) {
|
|
3345
|
-
if (window.sessionStorage)
|
|
3346
|
-
return window.sessionStorage.getItem(e);
|
|
3347
|
-
})(v + '-' + f);
|
|
3348
|
-
C(i(x) + '-' + m + '-' + f, b || v),
|
|
3349
|
-
a.dragOverGapTop
|
|
3350
|
-
? 'after' === g
|
|
3351
|
-
? (c(d, !0), s(h, m, u, 'before'))
|
|
3352
|
-
: (s(h, m, u, 'before', !0), c(d))
|
|
3353
|
-
: (a.dragOver || a.dragOverGapBottom) &&
|
|
3354
|
-
('after' === g
|
|
3355
|
-
? (c(d, !0), s(h, m, u))
|
|
3356
|
-
: (s(h, m, u, '', !0), c(d)));
|
|
3357
|
-
}
|
|
3358
|
-
}
|
|
3359
|
-
}),
|
|
3360
|
-
(n.catchExpandedKeys = function (e) {
|
|
3361
|
-
var t = [];
|
|
3362
|
-
return (
|
|
3363
|
-
e &&
|
|
3364
|
-
e.propertyOrder &&
|
|
3365
|
-
e.properties &&
|
|
3366
|
-
e.propertyOrder.map(function (n, a) {
|
|
3367
|
-
var o = n,
|
|
3368
|
-
r = e.properties[o].type + '-' + o;
|
|
3369
|
-
t.push(r);
|
|
3370
|
-
}),
|
|
3371
|
-
t
|
|
3372
|
-
);
|
|
3373
|
-
});
|
|
3374
|
-
var a = n.props.schemaStore || {},
|
|
3375
|
-
o = a.initJSONSchemaData,
|
|
3376
|
-
r = a.initOnChange,
|
|
3377
|
-
i = a.initSchemaTypeList;
|
|
3378
|
-
return (
|
|
3379
|
-
t.data && o(t.data),
|
|
3380
|
-
t.onChange && r(t.onChange),
|
|
3381
|
-
t.typeList && i(t.typeList),
|
|
3382
|
-
n
|
|
3383
|
-
);
|
|
3384
|
-
}
|
|
3385
|
-
o()(t, e);
|
|
3386
|
-
var n = t.prototype;
|
|
3387
|
-
return (
|
|
3388
|
-
(n.componentWillReceiveProps = function (e) {
|
|
3389
|
-
var t = this.props.schemaStore || {},
|
|
3390
|
-
n = t.initJSONSchemaData,
|
|
3391
|
-
a = t.initOnChange,
|
|
3392
|
-
o = t.initSchemaTypeList;
|
|
3393
|
-
O(e.data, this.props.data) || n(e.data),
|
|
3394
|
-
O(e.onChange, this.props.onChange) || a(e.onChange),
|
|
3395
|
-
O(e.typeList, this.props.typeList) || o(e.typeList);
|
|
3396
|
-
}),
|
|
3397
|
-
(n.render = function () {
|
|
3398
|
-
var e = (this.props.schemaStore || {}).jsonSchema,
|
|
3399
|
-
t = (0, Oe.isEmptySchema)(e),
|
|
3400
|
-
n = e.type;
|
|
3401
|
-
return r.createElement(
|
|
3402
|
-
'div',
|
|
3403
|
-
{ className: 'json-schema-container' },
|
|
3404
|
-
!t &&
|
|
3405
|
-
r.createElement(
|
|
3406
|
-
r.Fragment,
|
|
3407
|
-
null,
|
|
3408
|
-
r.createElement(
|
|
3409
|
-
S.Tree,
|
|
3410
|
-
{
|
|
3411
|
-
draggable: !0,
|
|
3412
|
-
selectable: !1,
|
|
3413
|
-
onDragStart: this.onDragStart,
|
|
3414
|
-
onDrop: this.onDrop,
|
|
3415
|
-
defaultExpandedKeys:
|
|
3416
|
-
'object' !== n || t
|
|
3417
|
-
? []
|
|
3418
|
-
: this.catchExpandedKeys(e),
|
|
3419
|
-
},
|
|
3420
|
-
'object' === n &&
|
|
3421
|
-
st({
|
|
3422
|
-
parentType: '',
|
|
3423
|
-
jsonKey: '',
|
|
3424
|
-
indexRoute: '',
|
|
3425
|
-
nodeKey: '',
|
|
3426
|
-
targetJsonSchema: e,
|
|
3427
|
-
isOnlyShowChild: !0,
|
|
3428
|
-
}),
|
|
3429
|
-
'object' !== n &&
|
|
3430
|
-
ot({
|
|
3431
|
-
parentType: '',
|
|
3432
|
-
jsonKey: '',
|
|
3433
|
-
indexRoute: '',
|
|
3434
|
-
nodeKey: 'first-schema',
|
|
3435
|
-
targetJsonSchema: e,
|
|
3436
|
-
key: 'schema',
|
|
3437
|
-
isFirstSchema: !0,
|
|
3438
|
-
}),
|
|
3439
|
-
),
|
|
3440
|
-
),
|
|
3441
|
-
t &&
|
|
3442
|
-
r.createElement(
|
|
3443
|
-
'p',
|
|
3444
|
-
{ className: 'json-schema-empty' },
|
|
3445
|
-
'当前jsonSchema没有数据内容',
|
|
3446
|
-
),
|
|
3447
|
-
);
|
|
3448
|
-
}),
|
|
3449
|
-
t
|
|
3450
|
-
);
|
|
3451
|
-
})(r.PureComponent));
|
|
3452
|
-
ct.propTypes = {
|
|
3453
|
-
onChange: d().func,
|
|
3454
|
-
data: d().object,
|
|
3455
|
-
typeList: d().object,
|
|
3456
|
-
};
|
|
3457
|
-
var lt = (0, l.inject)(function (e) {
|
|
3458
|
-
return { schemaStore: e.schemaStore };
|
|
3459
|
-
})((0, l.observer)(ct)),
|
|
3460
|
-
pt = (function (e) {
|
|
3461
|
-
function t(t) {
|
|
3462
|
-
var n;
|
|
3463
|
-
return (
|
|
3464
|
-
((n = e.call(this, t) || this).state = {
|
|
3465
|
-
schemaStore: new je.schemaStore(),
|
|
3466
|
-
}),
|
|
3467
|
-
n
|
|
3468
|
-
);
|
|
3469
|
-
}
|
|
3470
|
-
return (
|
|
3471
|
-
o()(t, e),
|
|
3472
|
-
(t.prototype.render = function () {
|
|
3473
|
-
var e = this.props,
|
|
3474
|
-
t = e.data,
|
|
3475
|
-
n = e.typeList,
|
|
3476
|
-
a = e.onChange,
|
|
3477
|
-
o = e.element,
|
|
3478
|
-
i = e.wideScreen,
|
|
3479
|
-
s = this.state.schemaStore,
|
|
3480
|
-
p = r.createElement(
|
|
3481
|
-
l.Provider,
|
|
3482
|
-
{ schemaStore: s },
|
|
3483
|
-
r.createElement(lt, {
|
|
3484
|
-
data: t,
|
|
3485
|
-
typeList: n,
|
|
3486
|
-
onChange: a,
|
|
3487
|
-
wideScreen: i,
|
|
3488
|
-
}),
|
|
3489
|
-
);
|
|
3490
|
-
return o ? (c().render(p, o), '') : p;
|
|
3491
|
-
}),
|
|
3492
|
-
t
|
|
3493
|
-
);
|
|
3494
|
-
})(r.PureComponent);
|
|
3495
|
-
pt.propTypes = {
|
|
3496
|
-
wideScreen: d().any,
|
|
3497
|
-
onChange: d().func,
|
|
3498
|
-
data: d().any,
|
|
3499
|
-
typeList: d().any,
|
|
3500
|
-
element: d().any,
|
|
3501
|
-
};
|
|
3502
|
-
})(),
|
|
3503
|
-
a
|
|
3504
|
-
);
|
|
3505
|
-
})();
|
|
3506
|
-
});
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.JSONSchemaEditor=t():e.JSONSchemaEditor=t()}(this,(function(){return function(){var e={264:function(){},286:function(){},382:function(){},80:function(){},707:function(){},975:function(e,t,n){var a=n(264);a.__esModule&&(a=a.default),"string"==typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals),(0,n(611).A)("b8de86ae",a,!1,{sourceMap:!1})},915:function(e,t,n){var a=n(286);a.__esModule&&(a=a.default),"string"==typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals),(0,n(611).A)("5e9c0933",a,!1,{sourceMap:!1})},23:function(e,t,n){var a=n(382);a.__esModule&&(a=a.default),"string"==typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals),(0,n(611).A)("adbe60da",a,!1,{sourceMap:!1})},617:function(e,t,n){var a=n(80);a.__esModule&&(a=a.default),"string"==typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals),(0,n(611).A)("9c82b91a",a,!1,{sourceMap:!1})},790:function(e,t,n){var a=n(707);a.__esModule&&(a=a.default),"string"==typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals),(0,n(611).A)("2b121068",a,!1,{sourceMap:!1})},611:function(e,t,n){"use strict";function a(e,t){for(var n=[],a={},o=0;o<t.length;o++){var r=t[o],i=r[0],s={id:e+":"+o,css:r[1],media:r[2],sourceMap:r[3]};a[i]?a[i].parts.push(s):n.push(a[i]={id:i,parts:[s]})}return n}n.d(t,{A:function(){return h}});var o="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!o)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var r={},i=o&&(document.head||document.getElementsByTagName("head")[0]),s=null,c=0,l=!1,p=function(){},d=null,m="data-vue-ssr-id",u="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function h(e,t,n,o){l=n,d=o||{};var i=a(e,t);return y(i),function(t){for(var n=[],o=0;o<i.length;o++){var s=i[o];(c=r[s.id]).refs--,n.push(c)}for(t?y(i=a(e,t)):i=[],o=0;o<n.length;o++){var c;if(0===(c=n[o]).refs){for(var l=0;l<c.parts.length;l++)c.parts[l]();delete r[c.id]}}}}function y(e){for(var t=0;t<e.length;t++){var n=e[t],a=r[n.id];if(a){a.refs++;for(var o=0;o<a.parts.length;o++)a.parts[o](n.parts[o]);for(;o<n.parts.length;o++)a.parts.push(f(n.parts[o]));a.parts.length>n.parts.length&&(a.parts.length=n.parts.length)}else{var i=[];for(o=0;o<n.parts.length;o++)i.push(f(n.parts[o]));r[n.id]={id:n.id,refs:1,parts:i}}}}function g(){var e=document.createElement("style");return e.type="text/css",i.appendChild(e),e}function f(e){var t,n,a=document.querySelector("style["+m+'~="'+e.id+'"]');if(a){if(l)return p;a.parentNode.removeChild(a)}if(u){var o=c++;a=s||(s=g()),t=b.bind(null,a,o,!1),n=b.bind(null,a,o,!0)}else a=g(),t=S.bind(null,a),n=function(){a.parentNode.removeChild(a)};return t(e),function(a){if(a){if(a.css===e.css&&a.media===e.media&&a.sourceMap===e.sourceMap)return;t(e=a)}else n()}}var v,x=(v=[],function(e,t){return v[e]=t,v.filter(Boolean).join("\n")});function b(e,t,n,a){var o=n?"":a.css;if(e.styleSheet)e.styleSheet.cssText=x(t,o);else{var r=document.createTextNode(o),i=e.childNodes;i[t]&&e.removeChild(i[t]),i.length?e.insertBefore(r,i[t]):e.appendChild(r)}}function S(e,t){var n=t.css,a=t.media,o=t.sourceMap;if(a&&e.setAttribute("media",a),d.ssrId&&e.setAttribute(m,t.id),o&&(n+="\n/*# sourceURL="+o.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */"),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}}},t={};function n(a){var o=t[a];if(void 0!==o)return o.exports;var r=t[a]={id:a,exports:{}};return e[a](r,r.exports,n),r.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return function(){"use strict";n.r(a),n.d(a,{default:function(){return pt}});var e,t=require("@babel/runtime/helpers/inheritsLoose"),o=n.n(t),r=require("react"),i=n.n(r),s=require("react-dom"),c=n.n(s),l=require("mobx-react"),p=require("prop-types"),d=n.n(p),m=require("@babel/runtime/helpers/extends"),u=n.n(m),h=require("@babel/runtime/helpers/initializerDefineProperty"),y=n.n(h),g=require("@babel/runtime/helpers/createClass"),f=n.n(g),v=require("@babel/runtime/helpers/applyDecoratedDescriptor"),x=n.n(v),b=(require("@babel/runtime/helpers/initializerWarningHelper"),require("mobx")),S=require("antd");function E(e){var t=JSON.stringify(e);return JSON.parse(t)}function O(e,t){return JSON.stringify(e)===JSON.stringify(t)}function C(e,t){window.sessionStorage&&window.sessionStorage.setItem(e,t)}var N,j,w,I,R,K,k,T,J,D,B,P,V,L,F,q,A,_,M,W,z,G,U,H,X,Q,Y,Z,$,ee,te,ne,ae,oe,re,ie,se,ce,le,pe,de,me,ue,he,ye,ge,fe=["input","boolean","number","color","url","textarea","radio","select","cascader","checkboxes","date","date-time","time","input-image"],ve=["object"].concat(["datasource","event","dynamic-data","dynamic-config","sohu-source","sohu-event"]),xe=["quantity","box-style","text-editor","json","codearea","htmlarea","array"].concat(ve),be=[].concat(fe,xe),Se=["string"],Ee=((e={object:be,array:["object","input","number","select","cascader","color","url","date","date-time","time","input-image"],radio:Se,select:Se}).select=["string"],e.all=be,e),Oe=require("@wibetter/json-utils"),Ce=Oe.TypeDataList.jsonschema,Ne=Oe.TypeDataList.input,je={schemaStore:(N=b.action.bound,j=b.action.bound,w=b.action.bound,I=b.action.bound,R=b.action.bound,K=b.action.bound,k=b.action.bound,T=b.action.bound,J=b.action.bound,D=b.action.bound,B=b.action.bound,P=b.action.bound,V=b.action.bound,L=b.action.bound,F=b.action.bound,q=b.action.bound,A=b.action.bound,_=b.action.bound,M=b.action.bound,W=b.action.bound,z=b.action.bound,G=b.action.bound,U=b.action.bound,H=b.action.bound,X=b.action.bound,Q=b.action.bound,Y=b.action.bound,Z=b.action.bound,$=b.action.bound,ee=b.action.bound,te=b.action.bound,ne=b.action.bound,ae=b.action.bound,oe=b.action.bound,re=b.action.bound,ie=b.action.bound,se=b.action.bound,ce=b.action.bound,le=b.action.bound,pe=b.action.bound,de=function(){function e(){this.curJsonKeyIndex=1,y()(this,"triggerChange",me,this),y()(this,"jsonSchema",ue,this),y()(this,"SchemaTypeList",he,this),y()(this,"onChange",ye,this),y()(this,"childElemSort",ge,this)}var t=e.prototype;return t.triggerChangeAction=function(){this.triggerChange=!this.triggerChange},t.initSchemaTypeList=function(e){var t=this;e&&"{}"!==JSON.stringify(e)&&(O(e,this.SchemaTypeList)||e&&Object.keys(e).map((function(n){t.SchemaTypeList[n]=e[n]})))},t.initJSONSchemaData=function(e){if(e&&"{}"!==JSON.stringify(e)){if(!O(e,this.JSONSchemaObj))if(e&&(0,Oe.isNewSchemaData)(e))this.jsonSchema=e;else{var t=(0,Oe.oldSchemaToNewSchema)(e);this.jsonSchema=t}}else this.jsonSchema=E(Ce)},t.initOnChange=function(e){var t,n;(e||(t=e,n=!1,"Function"===Object.prototype.toString.call(t).slice(8,-1)&&(n=!0),n))&&(this.onChange=e)},t.jsonSchemaChange=function(e){this.jsonSchema.lastUpdateTime=new Date,e||this.onChange(this.JSONSchemaObj)},t.indexRoute2keyRoute=function(e){return(0,Oe.indexRoute2keyRoute)(e,this.jsonSchema)},t.keyRoute2indexRoute=function(e){return(0,Oe.keyRoute2indexRoute)(e,this.jsonSchema)},t.getSchemaByIndexRoute=function(e){return(0,Oe.getSchemaByIndexRoute)(e,this.jsonSchema,!0)},t.getSchemaByKeyRoute=function(e){return(0,Oe.getSchemaByKeyRoute)(e,this.jsonSchema,!0)},t.getNewJsonKeyIndex=function(e,t){var n=(t||"field")+"_"+this.curJsonKeyIndex;return e.propertyOrder.indexOf(n)>=0&&(this.curJsonKeyIndex+=1,n=this.getNewJsonKeyIndex(e)),this.curJsonKeyIndex+=1,n},t.isExitJsonKey=function(e,t){var n=(0,Oe.getParentIndexRoute)(e),a=this.getSchemaByIndexRoute(n);return!!(a.propertyOrder&&a.propertyOrder.indexOf(t)>=0)||(Oe.KeyWordList&&Oe.KeyWordList.indexOf(t)>=0&&S.message.warning(t+"是JSONSchema的关键字,建议您换一个,避免后续出现数据异常。"),t&&t.indexOf("-")>-1&&S.message.warning(t+"含特殊字符(‘-’),会影响后续数据获取和更新,建议您换一个数值。"),!1)},t.isSupportCurType=function(e,t){var n=(0,Oe.getParentIndexRoute)(e),a=this.getSchemaByIndexRoute(n),o=this.SchemaTypeList[a.type];return!!(o&&o.indexOf(t)>=0)},t.addChildJson=function(e,t){var n=(0,Oe.getSchemaByIndexRoute)(e,this.jsonSchema);if((0,Oe.isContainerSchema)(n)){var a=this.getNewJsonKeyIndex(n);n.propertyOrder.push(a),n.properties[a]=Ne,this.jsonSchemaChange(t)}else S.message.warning("非对象类型字段不允许插入子元素")},t.changeType=function(e,t,n,a){var o=(0,Oe.getParentIndexRoute)(e),r=(0,Oe.getSchemaByIndexRoute)(o,this.jsonSchema);r.properties&&r.properties[t]?r.properties[t]=E(n):r[t]&&(r[t]=E(n)),this.jsonSchemaChange(a)},t.updateSchemaData=function(e,t,n){var a=(0,Oe.getSchemaByIndexRoute)(e,this.jsonSchema);Object.assign(a,E(t)),this.jsonSchemaChange(n)},t.editSchemaData=function(e,t,n,a){var o=(0,Oe.getParentIndexRoute)(e),r=(0,Oe.getSchemaByIndexRoute)(o,this.jsonSchema);r.properties[t]=u()({},E(r.properties[t]),n),this.jsonSchemaChange(a)},t.editJsonKey=function(e,t,n){var a=(0,Oe.getSchemaByIndexRoute)(e,this.jsonSchema,!0);this.insertJsonData(e,t,a,"",!0),this.deleteJsonByIndex(e,!0),this.jsonSchemaChange(n)},t.addNextJsonData=function(e){var t=(0,Oe.getParentIndexRoute)(e),n=(0,Oe.getSchemaByIndexRoute)(t,this.jsonSchema),a=this.getNewJsonKeyIndex(n);this.insertJsonData(e,a,Ne)},t.insertJsonData=function(e,t,n,a,o){var r=(0,Oe.getParentIndexRoute_CurIndex)(e),i=r[0],s=r[1],c=(0,Oe.getSchemaByIndexRoute)(i,this.jsonSchema);c.properties[t]=n;var l=c.propertyOrder,p="before"===a?Number(s):Number(s)+1,d=l.slice(0,p),m=l.slice(p);c.propertyOrder=[].concat(d,[t],m),this.jsonSchemaChange(o)},t.deleteJsonByIndex_CurKey=function(e,t,n){var a=(0,Oe.getParentIndexRoute)(e),o=(0,Oe.getSchemaByIndexRoute)(a,this.jsonSchema);delete o.properties[t];var r=o.propertyOrder.indexOf(t);o.propertyOrder.splice(r,1),this.jsonSchemaChange(n)},t.deleteJsonByIndex=function(e,t){var n=(0,Oe.getParentIndexRoute_CurIndex)(e),a=n[0],o=n[1],r=(0,Oe.getSchemaByIndexRoute)(a,this.jsonSchema),i=r.propertyOrder[o];delete r.properties[i];var s=r.propertyOrder.indexOf(i);r.propertyOrder.splice(s,1),this.jsonSchemaChange(t)},t.updateEnumItem=function(e,t,n,a,o){var r=(0,Oe.getSchemaByIndexRoute)(e,this.jsonSchema);r.enum&&r.enumextra&&(r.enum[t]=n,r.enumextra[t]=a),this.jsonSchemaChange(o)},t.isExitEnumKey=function(e,t,n){var a=!1,o=(0,Oe.getSchemaByIndexRoute)(e,this.jsonSchema);if(o.enum){var r=E(o.enum);t>=0&&r.splice(t,1),r.indexOf(n)>=0&&(a=!0)}return Oe.KeyWordList&&Oe.KeyWordList.indexOf(n)>=0&&S.message.warning(n+"是JSONSchema的关键字,建议您换一个,避免后续出现数据异常。"),a},t.updateEnumKey=function(e,t,n,a){var o=(0,Oe.getSchemaByIndexRoute)(e,this.jsonSchema);o.enum&&(o.enum[t]=n),this.jsonSchemaChange(a)},t.updateEnumText=function(e,t,n,a){var o=(0,Oe.getSchemaByIndexRoute)(e,this.jsonSchema);o.enumextra&&(o.enumextra[t]=n),this.jsonSchemaChange(a)},t.deleteEnumItem=function(e,t,n){var a=(0,Oe.getSchemaByIndexRoute)(e,this.jsonSchema);a.enum&&a.enumextra&&(a.enum.splice(t,1),a.enumextra.splice(t,1)),this.jsonSchemaChange(n)},t.insertEnumItem=function(e,t,n,a,o,r){var i=(0,Oe.getSchemaByIndexRoute)(e,this.jsonSchema);if(i.enum&&i.enumextra){var s="before"===o?Number(t):Number(t)+1,c=i.enum.slice(0,s),l=i.enum.slice(s);i.enum=[].concat(c,[n],l);var p=i.enumextra.slice(0,s),d=i.enumextra.slice(s);i.enumextra=[].concat(p,[a],d)}this.jsonSchemaChange(r)},t.getNewEnumIndex=function(e,t){var n=(t||"enum")+"_"+this.curJsonKeyIndex;return e.indexOf(n)>=0&&(this.curJsonKeyIndex+=1,n=this.getNewEnumIndex(e,t)),this.curJsonKeyIndex+=1,n},t.addEnumItem=function(e,t){var n=(0,Oe.getSchemaByIndexRoute)(e,this.jsonSchema);if(n.enum){var a=this.getNewEnumIndex(n.enum),o="选项"+(this.curJsonKeyIndex-1);this.insertEnumItem(e,t,a,o)}},t.copyEnumItem=function(e,t){var n=(0,Oe.getSchemaByIndexRoute)(e,this.jsonSchema);if(n.enum){var a=n.enum[t],o=n.enumextra[t],r=this.getNewEnumIndex(n.enum,a),i=o+"_"+(this.curJsonKeyIndex-1);this.insertEnumItem(e,t,r,i)}},t.updateOptionItem=function(e,t,n,a,o){var r=(0,Oe.getSchemaByIndexRoute)(e,this.jsonSchema);r.options&&r.options[t]&&(r.options[t].label=n,r.options[t].value=a),this.jsonSchemaChange(o)},t.isExitOptionLabel=function(e,t){var n=!1,a=(0,Oe.getSchemaByIndexRoute)(e,this.jsonSchema);return a.options&&a.options.find((function(e){return e.label===t||e.name===t}))&&(n=!0),Oe.KeyWordList&&Oe.KeyWordList.indexOf(t)>=0&&S.message.warning(t+"是JSONSchema的保留关键字,建议您换一个名称。"),n},t.updateOptionLabel=function(e,t,n,a){var o=(0,Oe.getSchemaByIndexRoute)(e,this.jsonSchema);o.options&&o.options[t]&&(o.options[t].label=n),this.jsonSchemaChange(a)},t.updateOptionValue=function(e,t,n,a){var o=(0,Oe.getSchemaByIndexRoute)(e,this.jsonSchema);o.options&&o.options[t]&&(o.options[t].value=n),this.jsonSchemaChange(a)},t.deleteOptionItem=function(e,t,n){var a=(0,Oe.getSchemaByIndexRoute)(e,this.jsonSchema);a.options&&a.options[t]&&a.options.splice(t,1),this.jsonSchemaChange(n)},t.insertOption=function(e,t,n,a,o,r){var i=(0,Oe.getSchemaByIndexRoute)(e,this.jsonSchema);if(i.options){var s="before"===o?Number(t):Number(t)+1,c=i.options.slice(0,s),l=i.options.slice(s),p={label:n,value:a};i.options=[].concat(c,[p],l)}this.jsonSchemaChange(r)},t.getNewOptionValue=function(e){return e&&e.length>0?e[e.length-1].value+"_"+(e.length+1):"value1"},t.addOptionItem=function(e,t){var n=(0,Oe.getSchemaByIndexRoute)(e,this.jsonSchema);if(n.options){var a=this.getNewOptionValue(n.options),o="选项"+(n.options.length+1);this.insertOption(e,t,o,a)}},t.copyOptionItem=function(e,t){var n=(0,Oe.getSchemaByIndexRoute)(e,this.jsonSchema);if(n.options){n.options[t];var a=this.getNewOptionValue(n.options),o=(label,name+"_copy");this.insertOption(e,t,o,a)}},f()(e,[{key:"JSONSchemaObj",get:function(){return(0,b.toJS)(this.jsonSchema)}}])}(),me=x()(de.prototype,"triggerChange",[b.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),ue=x()(de.prototype,"jsonSchema",[b.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return{}}}),he=x()(de.prototype,"SchemaTypeList",[b.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return Ee}}),ye=x()(de.prototype,"onChange",[b.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return function(){}}}),x()(de.prototype,"triggerChangeAction",[N],Object.getOwnPropertyDescriptor(de.prototype,"triggerChangeAction"),de.prototype),x()(de.prototype,"initSchemaTypeList",[j],Object.getOwnPropertyDescriptor(de.prototype,"initSchemaTypeList"),de.prototype),x()(de.prototype,"initJSONSchemaData",[w],Object.getOwnPropertyDescriptor(de.prototype,"initJSONSchemaData"),de.prototype),x()(de.prototype,"JSONSchemaObj",[b.computed],Object.getOwnPropertyDescriptor(de.prototype,"JSONSchemaObj"),de.prototype),x()(de.prototype,"initOnChange",[I],Object.getOwnPropertyDescriptor(de.prototype,"initOnChange"),de.prototype),x()(de.prototype,"jsonSchemaChange",[R],Object.getOwnPropertyDescriptor(de.prototype,"jsonSchemaChange"),de.prototype),x()(de.prototype,"indexRoute2keyRoute",[K],Object.getOwnPropertyDescriptor(de.prototype,"indexRoute2keyRoute"),de.prototype),x()(de.prototype,"keyRoute2indexRoute",[k],Object.getOwnPropertyDescriptor(de.prototype,"keyRoute2indexRoute"),de.prototype),x()(de.prototype,"getSchemaByIndexRoute",[T],Object.getOwnPropertyDescriptor(de.prototype,"getSchemaByIndexRoute"),de.prototype),x()(de.prototype,"getSchemaByKeyRoute",[J],Object.getOwnPropertyDescriptor(de.prototype,"getSchemaByKeyRoute"),de.prototype),x()(de.prototype,"getNewJsonKeyIndex",[D],Object.getOwnPropertyDescriptor(de.prototype,"getNewJsonKeyIndex"),de.prototype),x()(de.prototype,"isExitJsonKey",[B],Object.getOwnPropertyDescriptor(de.prototype,"isExitJsonKey"),de.prototype),x()(de.prototype,"isSupportCurType",[P],Object.getOwnPropertyDescriptor(de.prototype,"isSupportCurType"),de.prototype),x()(de.prototype,"addChildJson",[V],Object.getOwnPropertyDescriptor(de.prototype,"addChildJson"),de.prototype),x()(de.prototype,"changeType",[L],Object.getOwnPropertyDescriptor(de.prototype,"changeType"),de.prototype),x()(de.prototype,"updateSchemaData",[F],Object.getOwnPropertyDescriptor(de.prototype,"updateSchemaData"),de.prototype),x()(de.prototype,"editSchemaData",[q],Object.getOwnPropertyDescriptor(de.prototype,"editSchemaData"),de.prototype),x()(de.prototype,"editJsonKey",[A],Object.getOwnPropertyDescriptor(de.prototype,"editJsonKey"),de.prototype),x()(de.prototype,"addNextJsonData",[_],Object.getOwnPropertyDescriptor(de.prototype,"addNextJsonData"),de.prototype),x()(de.prototype,"insertJsonData",[M],Object.getOwnPropertyDescriptor(de.prototype,"insertJsonData"),de.prototype),x()(de.prototype,"deleteJsonByIndex_CurKey",[W],Object.getOwnPropertyDescriptor(de.prototype,"deleteJsonByIndex_CurKey"),de.prototype),x()(de.prototype,"deleteJsonByIndex",[z],Object.getOwnPropertyDescriptor(de.prototype,"deleteJsonByIndex"),de.prototype),x()(de.prototype,"updateEnumItem",[G],Object.getOwnPropertyDescriptor(de.prototype,"updateEnumItem"),de.prototype),x()(de.prototype,"isExitEnumKey",[U],Object.getOwnPropertyDescriptor(de.prototype,"isExitEnumKey"),de.prototype),x()(de.prototype,"updateEnumKey",[H],Object.getOwnPropertyDescriptor(de.prototype,"updateEnumKey"),de.prototype),x()(de.prototype,"updateEnumText",[X],Object.getOwnPropertyDescriptor(de.prototype,"updateEnumText"),de.prototype),x()(de.prototype,"deleteEnumItem",[Q],Object.getOwnPropertyDescriptor(de.prototype,"deleteEnumItem"),de.prototype),x()(de.prototype,"insertEnumItem",[Y],Object.getOwnPropertyDescriptor(de.prototype,"insertEnumItem"),de.prototype),x()(de.prototype,"getNewEnumIndex",[Z],Object.getOwnPropertyDescriptor(de.prototype,"getNewEnumIndex"),de.prototype),x()(de.prototype,"addEnumItem",[$],Object.getOwnPropertyDescriptor(de.prototype,"addEnumItem"),de.prototype),x()(de.prototype,"copyEnumItem",[ee],Object.getOwnPropertyDescriptor(de.prototype,"copyEnumItem"),de.prototype),x()(de.prototype,"updateOptionItem",[te],Object.getOwnPropertyDescriptor(de.prototype,"updateOptionItem"),de.prototype),x()(de.prototype,"isExitOptionLabel",[ne],Object.getOwnPropertyDescriptor(de.prototype,"isExitOptionLabel"),de.prototype),x()(de.prototype,"updateOptionLabel",[ae],Object.getOwnPropertyDescriptor(de.prototype,"updateOptionLabel"),de.prototype),x()(de.prototype,"updateOptionValue",[oe],Object.getOwnPropertyDescriptor(de.prototype,"updateOptionValue"),de.prototype),x()(de.prototype,"deleteOptionItem",[re],Object.getOwnPropertyDescriptor(de.prototype,"deleteOptionItem"),de.prototype),x()(de.prototype,"insertOption",[ie],Object.getOwnPropertyDescriptor(de.prototype,"insertOption"),de.prototype),x()(de.prototype,"getNewOptionValue",[se],Object.getOwnPropertyDescriptor(de.prototype,"getNewOptionValue"),de.prototype),x()(de.prototype,"addOptionItem",[ce],Object.getOwnPropertyDescriptor(de.prototype,"addOptionItem"),de.prototype),x()(de.prototype,"copyOptionItem",[le],Object.getOwnPropertyDescriptor(de.prototype,"copyOptionItem"),de.prototype),ge=x()(de.prototype,"childElemSort",[pe],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){for(var n=(0,Oe.getSchemaByIndexRoute)(t,e.jsonSchema),a=n.propertyOrder,o=[],r=[],i=[],s=[],c=[],l=[],p=[],d=[],m=0,u=a.length;m<u;m++){var h=a[m];switch(n.properties[h].type){case"input":case"url":o.push(h);break;case"number":case"quantity":r.push(h);break;case"radio":case"checkboxes":case"boolean":case"color":i.push(h);break;case"date":case"date-time":case"time":s.push(h);break;case"textarea":case"json":case"codearea":case"htmlarea":c.push(h);break;case"image":l.push(h);break;case"object":case"array":p.push(h);break;default:d.push(h)}}n.propertyOrder=[].concat(o,r,i,s,l,c,p,d),e.jsonSchemaChange()}}}),de)},we=require("@ant-design/icons"),Ie=require("react-ace"),Re=n.n(Ie),Ke=(require("ace-builds/src-noconflict/mode-json"),require("ace-builds/src-noconflict/theme-solarized_light"),n(975),S.Input.TextArea),ke=(S.Select.Option,function(e){function t(t){var n;return(n=e.call(this,t)||this).handleValueChange=function(e,t){var a=(n.props.schemaStore||{}).editSchemaData,o=n.props,r=o.indexRoute,i=o.jsonKey;if(o.targetJsonSchema[e]!==t){var s={};s[e]=t,a(r,i,s)}},n.renderDefaultContent=function(e,t,a){if("boolean"===e)return r.createElement(S.Switch,{style:{display:"inline-block"},defaultChecked:t.default,checkedChildren:"true",unCheckedChildren:"false",onChange:function(e){n.handleValueChange("default",e)}});if("checkboxes"===e||"select"===e&&t.multiple){var o=t.options;return r.createElement(S.Checkbox.Group,{style:{display:"inline-block"},onChange:function(e){n.handleValueChange("default",e)},defaultValue:t.default},o&&o.length>0&&o.map((function(e,t){var n=a+"-options-"+t;return r.createElement(S.Checkbox,{value:e.value,key:n},e.label||e.name)})))}if("radio"===e||"select"===e){var i=t.options;return r.createElement(S.Radio.Group,{style:{display:"inline-block"},defaultValue:t.default,onChange:function(e){var t=e.target.value;n.handleValueChange("default",t)}},i&&i.length>0&&i.map((function(e,t){var n=a+"-options-"+t;return r.createElement(S.Radio,{value:e.value,key:n},e.label||e.name)})))}return"color"===e?r.createElement(S.Input,{style:{display:"inline-block"},className:"color-item-form",type:"color",defaultValue:t.default,onChange:function(e){var t=e.target.value;n.handleValueChange("default",t)}}):"textarea"===e||"codearea"===e||"htmlarea"===e||"json"===e?r.createElement(Ke,{style:{display:"inline-block"},rows:4,placeholder:"请输入"+t.title+"的默认值",defaultValue:t.default,onPressEnter:function(e){var t=e.target.value;n.handleValueChange("default",t)},onBlur:function(e){var t=e.target.value;n.handleValueChange("default",t)}}):"number"===e?r.createElement(S.InputNumber,{style:{display:"inline-block"},placeholder:"请输入"+t.title+"的默认值",defaultValue:t.default,onChange:function(e){n.handleValueChange("default",e)}}):r.createElement(S.Input,{style:{display:"inline-block"},placeholder:"请输入"+t.title+"的默认值",defaultValue:t.default,onPressEnter:function(e){var t=e.target.value;n.handleValueChange("default",t)},onBlur:function(e){var t=e.target.value;n.handleValueChange("default",t)}})},n.state={isShowWarn:!1,warnText:"",curJSONDataTemp:void 0},n.handleValueChange=n.handleValueChange.bind(n),n}return o()(t,e),t.prototype.render=function(){var e,t=this,n=(this.props.schemaStore||{}).indexRoute2keyRoute,a=this.props,o=a.nodeKey,i=a.indexRoute,s=a.targetJsonSchema,c=this.state,l=c.isShowWarn,p=c.warnText,d=c.curJSONDataTemp,m=s.type,u=(n(i),s.isConditionProp);return r.createElement("div",{className:"advance-config-model"},function(e){return["boolean","input","number","color","url","radio","select","date","date-time","time","input-image"].indexOf(e)>-1}(m)&&r.createElement("div",{className:"wide-screen-element-warp",key:o+"-isConditionProp"},r.createElement("div",{className:"element-title"},r.createElement(S.Tooltip,{title:"设置为条件字段后,其他字段可根据其数值变化进行实时联动",placement:"top"},r.createElement("span",{className:"title-text"},"条件字段"))),r.createElement("div",{className:"content-item"},r.createElement("div",{className:"form-item-box",key:o+"-isConditionProp-switch"},r.createElement(S.Switch,{style:{display:"inline-block"},defaultChecked:u,checkedChildren:"是",unCheckedChildren:"否",onChange:function(e){t.handleValueChange("isConditionProp",e)}})))),("select"===m||"cascader"===m)&&r.createElement("div",{className:"wide-screen-element-warp",key:o+"-selectConfig"},r.createElement("div",{className:"element-title"},r.createElement(S.Tooltip,{title:"开启多选后,select下拉列表支持选择多个选项。",placement:"top"},r.createElement("span",{className:"title-text"},"支持多选"))),r.createElement("div",{className:"content-item"},r.createElement("div",{className:"form-item-box",key:o+"-selectConfig-multiple"},r.createElement(S.Switch,{style:{display:"inline-block"},defaultChecked:s.multiple,checkedChildren:"多选",unCheckedChildren:"单选",onChange:function(e){t.handleValueChange("multiple",e)}})))),function(e){return[].concat(fe,["quantity","text-editor","json","codearea","htmlarea"]).indexOf(e)>-1}(m)&&r.createElement("div",{className:"wide-screen-element-warp",key:o+"-readOnly-"+s.readOnly},r.createElement("div",{className:"element-title"},r.createElement(S.Tooltip,{title:"当前属性设置为只读后,用户不能对其进行任何编辑操作",placement:"top"},r.createElement("span",{className:"title-text"},"是否只读"))),r.createElement("div",{className:"content-item"},r.createElement("div",{className:"form-item-box"},r.createElement(S.Switch,{style:{display:"inline-block"},defaultChecked:s.readOnly,checkedChildren:"true",unCheckedChildren:"false",onChange:function(e){t.handleValueChange("readOnly",e)}})))),function(e){return[].concat(fe,["quantity","text-editor","json","codearea","htmlarea"]).indexOf(e)>-1}(m)&&r.createElement("div",{className:"wide-screen-element-warp",key:o+"-isRequired-"+s.isRequired},r.createElement("div",{className:"element-title"},r.createElement(S.Tooltip,{title:"当前属性设置为必填项后,如果用户没有给其设置数值,则会进行标红提示。",placement:"top"},r.createElement("span",{className:"title-text"},"是否必填项"))),r.createElement("div",{className:"content-item"},r.createElement("div",{className:"form-item-box"},r.createElement(S.Switch,{style:{display:"inline-block"},defaultChecked:s.isRequired,checkedChildren:"true",unCheckedChildren:"false",onChange:function(e){t.handleValueChange("isRequired",e)}})))),function(e){return[].concat(fe,["json","codearea","htmlarea"]).indexOf(e)>-1}(m)&&r.createElement("div",{className:"wide-screen-element-warp",key:o+"-default"},r.createElement("div",{className:"element-title"},r.createElement(S.Tooltip,{placement:"top"},r.createElement("span",{className:"title-text"},"默认值"))),r.createElement("div",{className:"content-item"},r.createElement("div",{className:"form-item-box"},this.renderDefaultContent(m,s,o)))),"cascader"===m&&r.createElement("div",{className:"wide-screen-element-warp",key:o+"-cascader-options"},r.createElement("div",{className:"element-title"},r.createElement(S.Tooltip,{title:"用于添加 级联选择 组件的 options 数据。",placement:"top"},r.createElement("span",{className:"title-text"},"options 配置"))),r.createElement("div",{className:"content-item"},l&&r.createElement("div",{className:"warning-box code-area-item"},r.createElement("div",{className:"warning-img"},"X"),r.createElement("div",{className:"warning-text"},p)),r.createElement(Re(),{id:o+"-json_area_ace",value:(0,Oe.hasProperties)(d)?d:JSON.stringify(s.options,null,2),className:"json-view-ace",mode:"json",theme:"solarized_light",name:"JSON_CODE_EDIT",fontSize:14,showPrintMargin:!0,showGutter:!0,highlightActiveLine:!0,readOnly:!1,minLines:3,maxLines:6,width:"100%",onChange:function(e){try{var n=JSON.parse(e);t.handleValueChange("options",n),t.setState({isShowWarn:!1,curJSONDataTemp:void 0})}catch(n){t.setState({curJSONDataTemp:e,warnText:n.message,isShowWarn:!0})}},setOptions:{useWorker:!1,showLineNumbers:!0,tabSize:2}}))),r.createElement("div",{className:"wide-screen-element-warp",key:o+"-description"},r.createElement("div",{className:"element-title"},r.createElement(S.Tooltip,{title:"字段描述内容将作为Title的补充信息提供给用户",placement:"top"},r.createElement("span",{className:"title-text"},"字段描述"))),r.createElement("div",{className:"content-item"},r.createElement("div",{className:"form-item-box"},r.createElement(S.Input,{style:{display:"inline-block"},placeholder:"请输入"+s.title+"的字段描述",defaultValue:s.description,onPressEnter:function(e){var n=e.target.value;t.handleValueChange("description",n)},onBlur:function(e){var n=e.target.value;t.handleValueChange("description",n)}})))),r.createElement("div",{className:"wide-screen-element-warp",key:o+"-showKey"},r.createElement("div",{className:"element-title"},r.createElement(S.Tooltip,{title:"开启后,在JSONEditor端会展示当前Key值,以便增加辨识度。",placement:"top"},r.createElement("span",{className:"title-text"},"展示Key值"))),r.createElement("div",{className:"content-item"},r.createElement("div",{className:"form-item-box"},r.createElement(S.Switch,{style:{display:"inline-block"},defaultChecked:s.showKey,checkedChildren:"true",unCheckedChildren:"false",onChange:function(e){t.handleValueChange("showKey",e)}})))),function(e){return["input","url","textarea","text-editor","date","date-time","time","json","codearea","htmlarea"].indexOf(e)>-1}(m)&&r.createElement("div",{className:"wide-screen-element-warp",key:o+"-placeholder"},r.createElement("div",{className:"element-title"},r.createElement(S.Tooltip,{title:"输入提示内容将作为输入区域的提示信息展示给用户",placement:"top"},r.createElement("span",{className:"title-text"},"输入提示"))),r.createElement("div",{className:"content-item"},r.createElement("div",{className:"form-item-box"},r.createElement(S.Input,{style:{display:"inline-block"},placeholder:"请输入"+s.title+"的输入提示",defaultValue:s.placeholder,onPressEnter:function(e){var n=e.target.value;t.handleValueChange("placeholder",n)},onBlur:function(e){var n=e.target.value;t.handleValueChange("placeholder",n)}})))),function(e){return[].concat(ve,["array"]).indexOf(e)>-1}(m)&&r.createElement("div",{className:"wide-screen-element-warp",key:o+"-showCodeViewBtn-"+s.showCodeViewBtn},r.createElement("div",{className:"element-title"},r.createElement(S.Tooltip,{title:"用于控制是否显示源码模式切换按钮,默认显示",placement:"top"},r.createElement("span",{className:"title-text"},"源码模式"))),r.createElement("div",{className:"content-item"},r.createElement("div",{className:"form-item-box"},r.createElement(S.Switch,{style:{display:"inline-block"},defaultChecked:null==(e=s.showCodeViewBtn)||e,checkedChildren:"true",unCheckedChildren:"false",onChange:function(e){t.handleValueChange("showCodeViewBtn",e)}})))),"number"===(0,Oe.getExpectType)(m)&&r.createElement(r.Fragment,null,r.createElement("div",{className:"wide-screen-element-warp",key:o+"-minimum-"+s.minimum},r.createElement("div",{className:"element-title"},r.createElement(S.Tooltip,{title:"设置最小值后,用户输入的数值必须大于当前最小值",placement:"top"},r.createElement("span",{className:"title-text"},"最小值"))),r.createElement("div",{className:"content-item"},r.createElement("div",{className:"form-item-box"},r.createElement(S.InputNumber,{style:{display:"inline-block"},defaultValue:s.minimum,onPressEnter:function(e){var n=e.target.value;t.handleValueChange("minimum",n)},onBlur:function(e){var n=e.target.value;t.handleValueChange("minimum",n)}})))),r.createElement("div",{className:"wide-screen-element-warp",key:o+"-maximum-"+s.maximum},r.createElement("div",{className:"element-title"},r.createElement(S.Tooltip,{title:"设置最大值后,用户输入的数值必须大于当前最大值",placement:"top"},r.createElement("span",{className:"title-text"},"最大值"))),r.createElement("div",{className:"content-item"},r.createElement("div",{className:"form-item-box"},r.createElement(S.InputNumber,{style:{display:"inline-block"},defaultValue:s.maximum,onPressEnter:function(e){var n=e.target.value;t.handleValueChange("maximum",n)},onBlur:function(e){var n=e.target.value;t.handleValueChange("maximum",n)}}))))),"array"===(0,Oe.getExpectType)(m)&&r.createElement(r.Fragment,null,r.createElement("div",{className:"wide-screen-element-warp",key:o+"-minimum-child"},r.createElement("div",{className:"element-title"},r.createElement(S.Tooltip,{title:"用于限制数据项最小个数",placement:"top"},r.createElement("span",{className:"title-text"},"最小数据项"))),r.createElement("div",{className:"content-item"},r.createElement("div",{className:"form-item-box"},r.createElement(S.InputNumber,{style:{display:"inline-block"},defaultValue:s["minimum-child"],onChange:function(e){t.handleValueChange("minimum-child",e)}})))),r.createElement("div",{className:"wide-screen-element-warp",key:o+"-maximum-child"},r.createElement("div",{className:"element-title"},r.createElement(S.Tooltip,{title:"用于限制数据项最多个数",placement:"top"},r.createElement("span",{className:"title-text"},"最多数据项"))),r.createElement("div",{className:"content-item"},r.createElement("div",{className:"form-item-box"},r.createElement(S.InputNumber,{style:{display:"inline-block"},defaultValue:s["maximum-child"],onChange:function(e){t.handleValueChange("maximum-child",e)}}))))),r.createElement("div",{className:"wide-screen-element-warp",key:o+"-onShow"},r.createElement("div",{className:"element-title"},r.createElement(S.Tooltip,{title:'用于设置显隐表达式(onShow),比如设置 "dataType === 1",则表示当数据域中 dataType 为 1 时显示当前配置项。',placement:"top"},r.createElement("span",{className:"title-text"},"显隐表达式"))),r.createElement("div",{className:"content-item"},r.createElement("div",{className:"form-item-box"},r.createElement(S.Input,{style:{display:"inline-block"},placeholder:"请输入显隐表达式",defaultValue:s.onShow,onPressEnter:function(e){var n=e.target.value;t.handleValueChange("onShow",n)},onBlur:function(e){var n=e.target.value;t.handleValueChange("onShow",n)}})))))},t}(r.PureComponent));ke.propTypes={jsonKey:d().string,indexRoute:d().string,nodeKey:d().string,targetJsonSchema:d().any};var Te=(0,l.inject)((function(e){return{schemaStore:e.schemaStore}}))((0,l.observer)(ke)),Je=(n(915),S.Select.Option),De=function(e){function t(t){var n;return(n=e.call(this,t)||this).selectHandleChange=function(e){var t=(n.props.schemaStore||{}).changeType,a=n.props,o=a.indexRoute,r=a.jsonKey;a.targetJsonSchema.type!==e&&t(o,r,Oe.TypeDataList[e])},n.handleJsonKeyChange=function(e){var t=n.props.schemaStore||{},a=t.editJsonKey,o=t.isExitJsonKey,r=e.target.value,i=n.props,s=i.indexRoute;i.jsonKey!==r&&(o(s,r)?S.message.warning("当前key已存在,请换一个吧。"):a(s,r))},n.handleTitleChange=function(e){var t=(n.props.schemaStore||{}).editSchemaData,a=e.target.value,o=n.props,r=o.indexRoute,i=o.jsonKey;o.targetJsonSchema.title!==a&&t(r,i,{title:a})},n.getCurrentTypeList=function(e){var t=(n.props.schemaStore||{}).SchemaTypeList,a=t[e||"all"];return a&&0!==a.length||(a=t.all),a},n.onAddBtnEvent=function(){var e=n.props.schemaStore||{},t=e.addChildJson,a=e.addNextJsonData,o=n.props,r=o.indexRoute,i=o.targetJsonSchema;(0,Oe.isContainerSchema)(i)?t(r):a(r)},n.onCopyBtnEvent=function(){var e=n.props,t=e.indexRoute,a=e.targetJsonSchema,o=e.jsonKey,r=n.props.schemaStore||{},i=r.getSchemaByIndexRoute,s=r.indexRoute2keyRoute,c=r.insertJsonData,l=r.getNewJsonKeyIndex,p=E(a),d=(0,Oe.getParentIndexRoute)(t),m=l(i(d),o),u=a.type;C(s(d)+"-"+m+"-"+u,s(t)),c(t,m,p)},n.onDeleteBtnEvent=function(){var e=n.props,t=e.jsonKey,a=e.indexRoute;(0,(n.props.schemaStore||{}).deleteJsonByIndex_CurKey)(a,t)},n.ignoreDragEvent=function(e){e.preventDefault(),e.stopPropagation()},n.childElemSort=function(){var e=n.props.indexRoute;(0,(n.props.schemaStore||{}).childElemSort)(e)},n.state={showAdvanceConfig:!1},n.onAddBtnEvent=n.onAddBtnEvent.bind(n),n.onCopyBtnEvent=n.onCopyBtnEvent.bind(n),n.onDeleteBtnEvent=n.onDeleteBtnEvent.bind(n),n.handleJsonKeyChange=n.handleJsonKeyChange.bind(n),n.handleTitleChange=n.handleTitleChange.bind(n),n.selectHandleChange=n.selectHandleChange.bind(n),n.childElemSort=n.childElemSort.bind(n),n}return o()(t,e),t.prototype.render=function(){var e,t=this,n=(this.props.schemaStore||{}).getSchemaByIndexRoute,a=this.props,o=a.parentType,i=a.indexRoute,s=a.jsonKey,c=a.nodeKey,l=a.targetJsonSchema,p=this.state.showAdvanceConfig,d=i?(0,Oe.getParentIndexRoute)(i):"",m=d?n(d):{},u=null==(e=m&&m.isContainer)||e,h=l.isFixed||this.props.isFixed||!1,y=(this.props.readOnly||l.readOnly,void 0!==this.props.keyIsFixed?this.props.keyIsFixed:!u||h),g=void 0!==this.props.typeIsFixed?this.props.typeIsFixed:h,f=void 0!==this.props.titleIsFixed?this.props.titleIsFixed:h,v=this.props.hideOperaBtn||!u,x=!!v&&this.props.showAdvanceBtn,b=this.getCurrentTypeList(o),E=l.type,O=(0,Oe.isContainerSchema)(l);return r.createElement(r.Fragment,null,l&&r.createElement("div",{className:"base-schema-box",id:c},r.createElement("div",{className:"key-input-item",draggable:"true",onDragStart:this.ignoreDragEvent},r.createElement(S.Input,{defaultValue:s||"key值不存在",disabled:y,onPressEnter:this.handleJsonKeyChange,onBlur:this.handleJsonKeyChange})),r.createElement("div",{className:"type-select-item",draggable:"true",onDragStart:this.ignoreDragEvent},r.createElement(S.Select,{showSearch:!0,defaultValue:E,style:{width:150},onChange:this.selectHandleChange,disabled:g},b.map((function(e){return r.createElement(Je,{key:e,value:e},e)})))),r.createElement("div",{className:"title-input-item",draggable:"true",onDragStart:this.ignoreDragEvent},r.createElement(S.Input,{defaultValue:l.title,disabled:f,onPressEnter:this.handleTitleChange,onBlur:this.handleTitleChange})),!v&&r.createElement("div",{className:"operate-item"},!h&&r.createElement(S.Tooltip,{title:"删除"},r.createElement(we.CloseOutlined,{className:"operate-btn delete-operate",onClick:this.onDeleteBtnEvent})),r.createElement(S.Tooltip,{title:O?"新增子元素":"新增同级元素"},r.createElement(we.PlusOutlined,{className:"operate-btn",onClick:this.onAddBtnEvent})),O&&r.createElement(S.Tooltip,{title:"数据项排序"},r.createElement(we.SortAscendingOutlined,{className:"operate-btn",onClick:this.childElemSort})),!h&&r.createElement(r.Fragment,null,r.createElement(S.Tooltip,{title:"复制"},r.createElement(we.CopyOutlined,{className:"operate-btn",onClick:this.onCopyBtnEvent})),r.createElement(S.Tooltip,{title:"高级设置"},r.createElement(we.SettingOutlined,{className:"operate-btn",onClick:function(){t.setState({showAdvanceConfig:!0})}})),r.createElement(S.Tooltip,{title:"按住进行拖拽"},r.createElement(we.DragOutlined,{className:"operate-btn drag-btn"})))),x&&r.createElement("div",{className:"operate-item"},r.createElement(S.Tooltip,{title:"高级设置"},r.createElement(we.SettingOutlined,{className:"operate-btn",onClick:function(){t.setState({showAdvanceConfig:!0})}}))),p&&r.createElement(S.Modal,{visible:!0,title:"高级设置 / 当前字段:"+l.title+"("+s+")",onCancel:function(){t.setState({showAdvanceConfig:!1})},footer:[r.createElement(S.Button,{key:"submit",type:"primary",onClick:function(){t.setState({showAdvanceConfig:!1})}},"保存并关闭")]},r.createElement(Te,{indexRoute:i,jsonKey:s,targetJsonSchema:l}))),!l&&r.createElement("div",{className:"base-schema-box"},r.createElement("div",{className:"warn-text"},s,":数据元素为空")))},t}(r.PureComponent);De.propTypes={parentType:d().string,jsonKey:d().string,indexRoute:d().string,nodeKey:d().string,targetJsonSchema:d().any,isFixed:d().bool,hideOperaBtn:d().bool,showAdvanceBtn:d().bool,keyIsFixed:d().bool,typeIsFixed:d().bool,titleIsFixed:d().bool};var Be=(0,l.inject)((function(e){return{schemaStore:e.schemaStore}}))((0,l.observer)(De)),Pe=S.Tree.TreeNode,Ve=function(e){return i().createElement(Be,e)},Le=function(e){var t=e.jsonKey,n=e.indexRoute,a=e.nodeKey,o=e.targetJsonSchema,r=o.type,s=n?n+"-0":"0",c="items",l=a?a+"-"+c:c,p=o[c]||{};return i().createElement(Pe,{className:r+"-schema schema-item-form",id:a,key:a,indexRoute:n,jsonKey:t,title:Ve(u()({},e))},function(e){var t=e.parentType,n=e.jsonKey,a=e.indexRoute,o=e.nodeKey,r=e.targetJsonSchema;return i().createElement(Pe,{className:"array-item-schema schema-item-form",id:o,key:o,indexRoute:a,jsonKey:n,disabled:!0,title:Ve({indexRoute:a,jsonKey:n,targetJsonSchema:r,parentType:t,nodeKey:o,isFixed:!0,typeIsFixed:!1})},"object"===r.type&&function(e){var t=e.properties,n=e.parentIndexRoute,a=e.parentNodeKey,o=e.parentType;return e.propertyOrder.map((function(e,r){var i=n?n+"-"+r:""+r,s=e,c=t[s],l=c.type,p=(a?a+"-":"")+l+"-"+s;return ot({parentType:o,jsonKey:s,indexRoute:i,key:p,nodeKey:p,targetJsonSchema:c})}))}({propertyOrder:r.propertyOrder,properties:r.properties,parentIndexRoute:a,parentNodeKey:o,parentType:t}))}({parentType:"array",jsonKey:c,indexRoute:s,nodeKey:l,targetJsonSchema:p}))},Fe=(n(790),S.Select.Option),qe=function(e){function t(t){var n;return(n=e.call(this,t)||this).typeChange=function(e){var t=n.props.schemaStore||{},a=t.editSchemaData,o=t.updateSchemaData,r=n.props,i=r.indexRoute,s=r.jsonKey,c=r.targetJsonSchema,l=r.typeSelectData;if(c.default!==e){if(a(i,s,{default:e}),l){var p=l[e];p&&"数据源类型"===c.title&&a((0,Oe.getNextIndexRoute)(i),"data",p)}if(Oe.EventTypeDataList){var d=Oe.EventTypeDataList[e];"事件类型"===c.title&&d&&o((0,Oe.getParentIndexRoute)(i),d)}}},n.typeChange=n.typeChange.bind(n),n}return o()(t,e),t.prototype.render=function(){var e=this.props,t=e.nodeKey,n=e.targetJsonSchema,a=n.type,o=n.options||[];return r.createElement("div",{className:"typeSelect-schema-box",id:t},r.createElement("div",{className:"key-input-item"},r.createElement(S.Select,{defaultValue:n.default||"local",onChange:this.typeChange},o.map((function(e,t){return r.createElement(Fe,{key:t,value:e.value},e.label||e.name)})))),r.createElement("div",{className:"type-select-item"},r.createElement(S.Select,{defaultValue:a,style:{width:120},disabled:!0},r.createElement(Fe,{key:a,value:a},a))),r.createElement("div",{className:"title-input-item"},r.createElement(S.Input,{defaultValue:n.title,disabled:!0})),r.createElement("div",{className:"operate-item"}," "))},t}(r.PureComponent);qe.propTypes={parentType:d().string,jsonKey:d().string,indexRoute:d().string,nodeKey:d().string,targetJsonSchema:d().any,typeSelectData:d().any,isFixed:d().any};var Ae=(0,l.inject)((function(e){return{schemaStore:e.schemaStore}}))((0,l.observer)(qe)),_e=S.Tree.TreeNode,Me=function(e){return i().createElement(Be,e)},We={local:{type:"json",title:"本地json数据",default:"{}",placeholder:"请输入静态json数据",isRequired:!0,description:"用于设置本地的静态json数据"},remote:{type:"url",title:"远程json数据",default:"http://xxx",placeholder:"请输入远程json数据源地址",isRequired:!0,description:"用于设置获取元素数据的请求地址"}},ze=S.Tree.TreeNode,Ge=function(e){return i().createElement(Be,e)},Ue=S.Tree.TreeNode,He=function(e){return i().createElement(Be,e)},Xe=S.Tree.TreeNode,Qe=function(e){return i().createElement(Be,e)},Ye=(n(617),S.Select.Option),Ze=function(e){function t(t){var n;return(n=e.call(this,t)||this).handleLabelChange=function(e){var t=n.props.schemaStore||{},a=t.isExitOptionLabel,o=t.updateOptionLabel,r=e.target.value,i=n.props,s=i.indexRoute,c=i.optionIndex;r!==i.optionLabel&&(a(s,r)?S.message.warning("对不起,存在相同的Label值,请重新设置。"):o(s,c,r))},n.handleValueChange=function(e){var t=(n.props.schemaStore||{}).updateOptionValue,a=e.target.value,o=n.props,r=o.indexRoute,i=o.optionIndex;a!==o.optionValue&&t(r,i,a)},n.onAddBtnEvent=function(){var e=(n.props.schemaStore||{}).addOptionItem,t=n.props;e(t.indexRoute,t.optionIndex)},n.onCopyBtnEvent=function(){var e=(n.props.schemaStore||{}).copyOptionItem,t=n.props;e(t.indexRoute,t.optionIndex)},n.onDeleteBtnEvent=function(){var e=n.props.schemaStore||{},t=e.getSchemaByIndexRoute,a=e.deleteOptionItem,o=n.props,r=o.indexRoute,i=o.optionIndex,s=t(r);s.options&&s.options.length>1?a(r,i):S.message.warning("删除失败,至少保留一个可选项。")},n.onAddBtnEvent=n.onAddBtnEvent.bind(n),n.onCopyBtnEvent=n.onCopyBtnEvent.bind(n),n.onDeleteBtnEvent=n.onDeleteBtnEvent.bind(n),n.handleLabelChange=n.handleLabelChange.bind(n),n.handleValueChange=n.handleValueChange.bind(n),n}return o()(t,e),t.prototype.render=function(){var e=this.props,t=e.optionLabel,n=e.optionValue;return e.optionNodeKey,r.createElement("div",{className:"option-schema-box",id:t},r.createElement("div",{className:"key-input-item"},r.createElement(S.Input,{defaultValue:n,onPressEnter:this.handleValueChange,onBlur:this.handleValueChange})),r.createElement("div",{className:"type-select-item"},r.createElement(S.Select,{defaultValue:"string",style:{width:120}},r.createElement(Ye,{key:"string",value:"string"},"string"))),r.createElement("div",{className:"title-input-item"},r.createElement(S.Input,{defaultValue:t,onPressEnter:this.handleLabelChange,onBlur:this.handleLabelChange})),r.createElement("div",{className:"operate-item"},r.createElement(S.Tooltip,{title:"删除"},r.createElement(we.CloseOutlined,{className:"operate-btn delete-operate",onClick:this.onDeleteBtnEvent})),r.createElement(S.Tooltip,{title:"新增可选项"},r.createElement(we.PlusOutlined,{className:"operate-btn",onClick:this.onAddBtnEvent})),r.createElement(S.Tooltip,{title:"复制"},r.createElement(we.CopyOutlined,{className:"operate-btn",onClick:this.onCopyBtnEvent}))))},t}(r.PureComponent);Ze.propTypes={indexRoute:d().string,optionIndex:d().any,optionLabel:d().string,optionValue:d().string,optionNodeKey:d().string};var $e=(0,l.inject)((function(e){return{schemaStore:e.schemaStore}}))((0,l.observer)(Ze)),et=S.Tree.TreeNode,tt=function(e){return i().createElement($e,e)},nt=S.Tree.TreeNode,at=function(e){return i().createElement(Be,e)},ot=function(e){switch(e.targetJsonSchema.type){case"object":case"func":case"style":case"data":case"dynamic-config":case"sohu-source":case"sohu-event":return st(e);case"array":return Le(e);case"datasource":return function(e){var t,n=e.jsonKey,a=e.indexRoute,o=e.nodeKey,r=e.targetJsonSchema,s=r.type,c=r.properties.data||{};return i().createElement(_e,{className:s+"-schema schema-item-form",id:o,key:o,indexRoute:a,jsonKey:n,title:Me(u()({},e))},i().createElement(_e,{className:"dataSource-type-item-schema schema-item-form",id:o+"-type",key:o+"-type",indexRoute:a?a+"-0":"0",jsonKey:"type",disabled:!0,title:(t={indexRoute:a?a+"-0":"0",jsonKey:"type",targetJsonSchema:r.properties.type,parentType:s,nodeKey:o+"-type",typeSelectData:We},i().createElement(Ae,t))}),i().createElement(_e,{className:"dataSource-data-item-schema schema-item-form",id:o+"-data-"+c.type,key:o+"-data-"+c.type,indexRoute:a?a+"-1":"1",jsonKey:"data",disabled:!0,title:Me({indexRoute:a?a+"-1":"1",jsonKey:"data",targetJsonSchema:c,parentType:s,nodeKey:o+"-data-"+c.type,hideOperaBtn:!0,keyIsFixed:!0,typeIsFixed:!0})}),i().createElement(_e,{className:"dataSource-filter-item-schema schema-item-form",id:o+"-filter",key:o+"-filter",indexRoute:a?a+"-2":"2",jsonKey:"filter",disabled:!0,title:Me({indexRoute:a?a+"-2":"2",jsonKey:"filter",targetJsonSchema:r.properties.filter,parentType:s,nodeKey:o+"-filter",hideOperaBtn:!0,keyIsFixed:!0,typeIsFixed:!0})}))}(e);case"dynamic-data":return function(e){var t,n=e.jsonKey,a=e.indexRoute,o=e.nodeKey,r=e.targetJsonSchema,s=r.type,c=r.properties.config||{},l=r.properties.data||{};return i().createElement(ze,{className:s+"-schema schema-item-form",id:o,key:o,indexRoute:a,jsonKey:n,title:Ge(u()({},e))},i().createElement(ze,{className:"dataSource-type-item-schema schema-item-form",id:o+"-type",key:o+"-type",indexRoute:a?a+"-0":"0",jsonKey:"type",disabled:!0,title:(t={indexRoute:a?a+"-0":"0",jsonKey:"type",targetJsonSchema:r.properties.type,parentType:s,nodeKey:o+"-type"},i().createElement(Ae,t))}),i().createElement(ze,{className:"dataSource-config-item-schema schema-item-form",id:o+"-config-"+l.type,key:o+"-config-"+l.type,indexRoute:a?a+"-1":"1",jsonKey:"config",disabled:!0,title:Ge({indexRoute:a?a+"-1":"1",jsonKey:"config",targetJsonSchema:c,parentType:s,nodeKey:o+"-config-"+c.type,hideOperaBtn:!0,keyIsFixed:!0,typeIsFixed:!0})}),i().createElement(ze,{className:"dataSource-data-item-schema schema-item-form",id:o+"-data-"+l.type,key:o+"-data-"+l.type,indexRoute:a?a+"-2":"2",jsonKey:"data",disabled:!0,title:Ge({indexRoute:a?a+"-2":"2",jsonKey:"data",targetJsonSchema:l,parentType:s,nodeKey:o+"-data-"+l.type,hideOperaBtn:!0,keyIsFixed:!0,typeIsFixed:!0})}))}(e);case"event":return function(e){var t,n=e.jsonKey,a=e.indexRoute,o=e.nodeKey,r=e.targetJsonSchema,s=r.type,c=r.properties.type||{},l=r.properties.register||{},p=r.properties.actionFunc||{},d=r.properties.trigger||{},m=r.properties.eventData||{};return i().createElement(Ue,{className:s+"-schema schema-item-form",id:o,key:o,indexRoute:a,jsonKey:n,title:He(u()({},e))},i().createElement(Ue,{className:"event-type-item-schema schema-item-form",id:o+"-type",key:o+"-type",indexRoute:a?a+"-0":"0",jsonKey:"type",disabled:!0,title:(t={indexRoute:a?a+"-0":"0",jsonKey:"type",targetJsonSchema:c,parentType:s,nodeKey:o+"-type"},i().createElement(Ae,t))}),"on"===c.default&&l&&i().createElement(Ue,{className:"event-register-item-schema schema-item-form",id:o+"-register-"+c.default,key:o+"-register-"+c.default,indexRoute:a?a+"-1":"1",jsonKey:"register",disabled:!0,title:He({indexRoute:a?a+"-1":"1",jsonKey:"register",targetJsonSchema:l,parentType:s,nodeKey:o+"-register-"+c.default,hideOperaBtn:!0,keyIsFixed:!0,typeIsFixed:!0})}),"on"===c.default&&p&&i().createElement(Ue,{className:"event-actionFunc-item-schema schema-item-form",id:o+"-actionFunc-"+c.default,key:o+"-actionFunc-"+c.default,indexRoute:a?a+"-2":"2",jsonKey:"actionFunc",disabled:!0,title:He({indexRoute:a?a+"-2":"2",jsonKey:"actionFunc",targetJsonSchema:p,parentType:s,nodeKey:o+"-actionFunc-"+c.default,hideOperaBtn:!0,keyIsFixed:!0,typeIsFixed:!0})}),"emit"===c.default&&d&&i().createElement(Ue,{className:"event-trigger-item-schema schema-item-form",id:o+"-trigger-"+c.default,key:o+"-trigger-"+c.default,indexRoute:a?a+"-1":"1",jsonKey:"trigger",disabled:!0,title:He({indexRoute:a?a+"-1":"1",jsonKey:"trigger",targetJsonSchema:d,parentType:s,nodeKey:o+"-trigger-"+c.default,hideOperaBtn:!0,keyIsFixed:!0,typeIsFixed:!0})}),"emit"===c.default&&m&&i().createElement(Ue,{className:"event-eventData-item-schema schema-item-form",id:o+"-eventData-"+c.default,key:o+"-eventData-"+c.default,indexRoute:a?a+"-2":"2",jsonKey:"eventData",disabled:!0,title:He({indexRoute:a?a+"-2":"2",jsonKey:"eventData",targetJsonSchema:m,parentType:s,nodeKey:o+"-eventData-"+c.default,hideOperaBtn:!0,keyIsFixed:!0,typeIsFixed:!0})}))}(e);case"quantity":case"box-style":return function(e){var t,n=e.jsonKey,a=e.indexRoute,o=e.nodeKey,r=e.targetJsonSchema,s=r.type,c=r.propertyOrder[0],l=r.properties[c];return i().createElement(Xe,{className:s+"-schema schema-item-form",id:o,key:o,indexRoute:a,jsonKey:n,title:Qe(u()({},e))},i().createElement(Xe,{className:"quantity-unit-item-schema schema-item-form",id:o+"-"+c,key:o+"-"+c,indexRoute:a?a+"-0":"0",jsonKey:c,disabled:!0,title:Qe({indexRoute:a?a+"-0":"0",jsonKey:c,targetJsonSchema:l,parentType:s,nodeKey:o+"-"+c,hideOperaBtn:!0,showAdvanceBtn:!0,typeIsFixed:!0})}),i().createElement(Xe,{className:"quantity-typeSelect-item-schema schema-item-form",id:o+"-quantity",key:o+"-quantity",indexRoute:a?a+"-1":"1",jsonKey:"quantity",disabled:!0,title:(t={indexRoute:a?a+"-1":"1",jsonKey:"quantity",targetJsonSchema:r.properties.quantity,parentType:s,nodeKey:o+"-quantity"},i().createElement(Ae,t))}))}(e);case"radio":case"checkboxes":case"select":return function(e){var t,n=e.jsonKey,a=e.indexRoute,o=e.nodeKey,r=e.targetJsonSchema,s=r.type,c=r.options,l=a||"0";return i().createElement(et,{className:s+"-schema schema-item-form",id:o,key:o,indexRoute:a,jsonKey:n,title:(t=u()({},e),i().createElement(Be,t))},c&&c.length>0&&c.map((function(e,t){var n=e.label||e.name,a=e.value,r=""+o+s+"-"+n;return i().createElement(et,{className:"enum-item-schema schema-item-form",id:r,key:r,indexRoute:l,disabled:!0,title:tt({indexRoute:l,optionIndex:t,optionLabel:n,optionValue:a,optionNodeKey:r})})})))}(e);default:return function(e){var t=e.jsonKey,n=e.indexRoute,a=e.nodeKey,o=e.targetJsonSchema.type;return i().createElement(nt,{className:o+"-schema schema-item-form",id:a,key:a,indexRoute:n,jsonKey:t,title:at(e)})}(e)}},rt=S.Tree.TreeNode,it=function(e){return i().createElement(Be,e)},st=function(e){var t,n,a,o,r,s=e.jsonKey,c=e.indexRoute,l=e.nodeKey,p=e.targetJsonSchema,d=e.isOnlyShowChild,m=p.type,h=p.isFixed,y=(t={propertyOrder:p.propertyOrder,properties:p.properties,parentIndexRoute:c,parentNodeKey:l,parentType:m,isOnlyShowChild:d},n=t.properties,a=t.parentIndexRoute,o=t.parentNodeKey,r=t.parentType,t.propertyOrder.map((function(e,t){var i=a?a+"-"+t:""+t,s=e,c=n[s],l=c.type,p=(o?o+"-":"")+l+"-"+s;return ot({parentType:r,jsonKey:s,indexRoute:i,key:p,nodeKey:p,targetJsonSchema:c})}))),g=i().createElement(rt,{className:m+"-schema schema-item-form",id:l,key:l,indexRoute:c,jsonKey:s,disabled:h,title:it(u()({},e))},y);return d?y:g},ct=(n(23),function(e){function t(t){var n;(n=e.call(this,t)||this).onDragStart=function(e){(0,(n.props.schemaStore||{}).getSchemaByIndexRoute)(e.node.indexRoute).isFixed&&S.message.warning("当前元素不支持拖拽哦。")},n.onDrop=function(e){var t=e.dragNode,a=e.node,o=n.props.schemaStore||{},r=o.getSchemaByIndexRoute,i=o.indexRoute2keyRoute,s=o.insertJsonData,c=o.deleteJsonByIndex,l=o.isExitJsonKey,p=o.isSupportCurType,d=t.indexRoute,m=t.jsonKey,u=r(d);if(!u.isFixed){var h=a.indexRoute,y=(0,Oe.isSameParent)(d,h),g=(0,Oe.getCurPosition)(d,h);if(y)c(d,!0),"before"===g&&(h=(0,Oe.moveForward)(h)),a.dragOverGapTop?s(h,m,u,"before"):(a.dragOver||a.dragOverGapBottom)&&s(h,m,u);else{if(l(h,m))return void S.message.warning("目标位置中有重名的元素");var f=u.type;if(!p(h,f))return void S.message.warning("目标位置不支持"+f+"类型元素");var v=i(d),x=(0,Oe.getParentIndexRoute)(h),b=function(e){if(window.sessionStorage)return window.sessionStorage.getItem(e)}(v+"-"+f);C(i(x)+"-"+m+"-"+f,b||v),a.dragOverGapTop?"after"===g?(c(d,!0),s(h,m,u,"before")):(s(h,m,u,"before",!0),c(d)):(a.dragOver||a.dragOverGapBottom)&&("after"===g?(c(d,!0),s(h,m,u)):(s(h,m,u,"",!0),c(d)))}}},n.catchExpandedKeys=function(e){var t=[];return e&&e.propertyOrder&&e.properties&&e.propertyOrder.map((function(n,a){var o=n,r=e.properties[o].type+"-"+o;t.push(r)})),t};var a=n.props.schemaStore||{},o=a.initJSONSchemaData,r=a.initOnChange,i=a.initSchemaTypeList;return t.data&&o(t.data),t.onChange&&r(t.onChange),t.typeList&&i(t.typeList),n}o()(t,e);var n=t.prototype;return n.componentWillReceiveProps=function(e){var t=this.props.schemaStore||{},n=t.initJSONSchemaData,a=t.initOnChange,o=t.initSchemaTypeList;O(e.data,this.props.data)||n(e.data),O(e.onChange,this.props.onChange)||a(e.onChange),O(e.typeList,this.props.typeList)||o(e.typeList)},n.render=function(){var e=(this.props.schemaStore||{}).jsonSchema,t=(0,Oe.isEmptySchema)(e),n=e.type;return r.createElement("div",{className:"json-schema-container"},!t&&r.createElement(r.Fragment,null,r.createElement(S.Tree,{draggable:!0,selectable:!1,onDragStart:this.onDragStart,onDrop:this.onDrop,defaultExpandedKeys:"object"!==n||t?[]:this.catchExpandedKeys(e)},"object"===n&&st({parentType:"",jsonKey:"",indexRoute:"",nodeKey:"",targetJsonSchema:e,isOnlyShowChild:!0}),"object"!==n&&ot({parentType:"",jsonKey:"",indexRoute:"",nodeKey:"first-schema",targetJsonSchema:e,key:"schema",isFirstSchema:!0}))),t&&r.createElement("p",{className:"json-schema-empty"},"当前jsonSchema没有数据内容"))},t}(r.PureComponent));ct.propTypes={onChange:d().func,data:d().object,typeList:d().object};var lt=(0,l.inject)((function(e){return{schemaStore:e.schemaStore}}))((0,l.observer)(ct)),pt=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={schemaStore:new je.schemaStore},n}return o()(t,e),t.prototype.render=function(){var e=this.props,t=e.data,n=e.typeList,a=e.onChange,o=e.element,i=e.wideScreen,s=this.state.schemaStore,p=r.createElement(l.Provider,{schemaStore:s},r.createElement(lt,{data:t,typeList:n,onChange:a,wideScreen:i}));return o?(c().render(p,o),""):p},t}(r.PureComponent);pt.propTypes={wideScreen:d().any,onChange:d().func,data:d().any,typeList:d().any,element:d().any}}(),a}()}));
|