@tuoyuan/module-page-select 1.0.7 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module-page-select.common.js +402 -43
- package/dist/module-page-select.common.js.map +1 -1
- package/dist/module-page-select.umd.js +402 -43
- package/dist/module-page-select.umd.js.map +1 -1
- package/dist/module-page-select.umd.min.js +1 -1
- package/dist/module-page-select.umd.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
return /******/ (function() { // webpackBootstrap
|
|
12
12
|
/******/ var __webpack_modules__ = ({
|
|
13
13
|
|
|
14
|
-
/***/
|
|
14
|
+
/***/ 7587:
|
|
15
15
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
16
16
|
|
|
17
17
|
"use strict";
|
|
@@ -25,7 +25,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
25
25
|
|
|
26
26
|
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
|
|
27
27
|
// Module
|
|
28
|
-
___CSS_LOADER_EXPORT___.push([module.id, ".module-page-select[data-v-
|
|
28
|
+
___CSS_LOADER_EXPORT___.push([module.id, ".module-page-select[data-v-42acf54b]{width:100%}.selection-preview[data-v-42acf54b]{margin-top:8px;padding:8px 12px;background:#f0f9ff;border:1px solid #91d5ff;border-radius:4px;font-size:13px}.preview-label[data-v-42acf54b]{color:#666;font-size:12px;margin-bottom:4px}.preview-value[data-v-42acf54b]{color:#1890ff;font-weight:500}.config-form[data-v-42acf54b]{margin-top:16px}", ""]);
|
|
29
29
|
// Exports
|
|
30
30
|
/* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
|
|
31
31
|
|
|
@@ -158,19 +158,19 @@ exports.A = (sfc, props) => {
|
|
|
158
158
|
|
|
159
159
|
/***/ }),
|
|
160
160
|
|
|
161
|
-
/***/
|
|
161
|
+
/***/ 8476:
|
|
162
162
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
163
163
|
|
|
164
164
|
// style-loader: Adds some css to the DOM by adding a <style> tag
|
|
165
165
|
|
|
166
166
|
// load the styles
|
|
167
|
-
var content = __webpack_require__(
|
|
167
|
+
var content = __webpack_require__(7587);
|
|
168
168
|
if(content.__esModule) content = content.default;
|
|
169
169
|
if(typeof content === 'string') content = [[module.id, content, '']];
|
|
170
170
|
if(content.locals) module.exports = content.locals;
|
|
171
171
|
// add the styles to the DOM
|
|
172
172
|
var add = (__webpack_require__(258)/* ["default"] */ .A)
|
|
173
|
-
var update = add("
|
|
173
|
+
var update = add("041258cc", content, true, {"sourceMap":false,"shadowMode":false});
|
|
174
174
|
|
|
175
175
|
/***/ }),
|
|
176
176
|
|
|
@@ -3305,6 +3305,277 @@ $({ target: 'Iterator', proto: true, real: true, forced: someWithoutClosingOnEar
|
|
|
3305
3305
|
});
|
|
3306
3306
|
|
|
3307
3307
|
|
|
3308
|
+
/***/ }),
|
|
3309
|
+
|
|
3310
|
+
/***/ 9112:
|
|
3311
|
+
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
|
3312
|
+
|
|
3313
|
+
"use strict";
|
|
3314
|
+
|
|
3315
|
+
var $ = __webpack_require__(6518);
|
|
3316
|
+
var DESCRIPTORS = __webpack_require__(3724);
|
|
3317
|
+
var globalThis = __webpack_require__(4576);
|
|
3318
|
+
var getBuiltIn = __webpack_require__(7751);
|
|
3319
|
+
var uncurryThis = __webpack_require__(9504);
|
|
3320
|
+
var call = __webpack_require__(9565);
|
|
3321
|
+
var isCallable = __webpack_require__(4901);
|
|
3322
|
+
var isObject = __webpack_require__(34);
|
|
3323
|
+
var isArray = __webpack_require__(4376);
|
|
3324
|
+
var hasOwn = __webpack_require__(9297);
|
|
3325
|
+
var toString = __webpack_require__(655);
|
|
3326
|
+
var lengthOfArrayLike = __webpack_require__(6198);
|
|
3327
|
+
var createProperty = __webpack_require__(4659);
|
|
3328
|
+
var fails = __webpack_require__(9039);
|
|
3329
|
+
var parseJSONString = __webpack_require__(8235);
|
|
3330
|
+
var NATIVE_SYMBOL = __webpack_require__(4495);
|
|
3331
|
+
|
|
3332
|
+
var JSON = globalThis.JSON;
|
|
3333
|
+
var Number = globalThis.Number;
|
|
3334
|
+
var SyntaxError = globalThis.SyntaxError;
|
|
3335
|
+
var nativeParse = JSON && JSON.parse;
|
|
3336
|
+
var enumerableOwnProperties = getBuiltIn('Object', 'keys');
|
|
3337
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
3338
|
+
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
3339
|
+
var at = uncurryThis(''.charAt);
|
|
3340
|
+
var slice = uncurryThis(''.slice);
|
|
3341
|
+
var exec = uncurryThis(/./.exec);
|
|
3342
|
+
var push = uncurryThis([].push);
|
|
3343
|
+
|
|
3344
|
+
var IS_DIGIT = /^\d$/;
|
|
3345
|
+
var IS_NON_ZERO_DIGIT = /^[1-9]$/;
|
|
3346
|
+
var IS_NUMBER_START = /^[\d-]$/;
|
|
3347
|
+
var IS_WHITESPACE = /^[\t\n\r ]$/;
|
|
3348
|
+
|
|
3349
|
+
var PRIMITIVE = 0;
|
|
3350
|
+
var OBJECT = 1;
|
|
3351
|
+
|
|
3352
|
+
var $parse = function (source, reviver) {
|
|
3353
|
+
source = toString(source);
|
|
3354
|
+
var context = new Context(source, 0, '');
|
|
3355
|
+
var root = context.parse();
|
|
3356
|
+
var value = root.value;
|
|
3357
|
+
var endIndex = context.skip(IS_WHITESPACE, root.end);
|
|
3358
|
+
if (endIndex < source.length) {
|
|
3359
|
+
throw new SyntaxError('Unexpected extra character: "' + at(source, endIndex) + '" after the parsed data at: ' + endIndex);
|
|
3360
|
+
}
|
|
3361
|
+
return isCallable(reviver) ? internalize({ '': value }, '', reviver, root) : value;
|
|
3362
|
+
};
|
|
3363
|
+
|
|
3364
|
+
var internalize = function (holder, name, reviver, node) {
|
|
3365
|
+
var val = holder[name];
|
|
3366
|
+
var unmodified = node && val === node.value;
|
|
3367
|
+
var context = unmodified && typeof node.source == 'string' ? { source: node.source } : {};
|
|
3368
|
+
var elementRecordsLen, keys, len, i, P;
|
|
3369
|
+
if (isObject(val)) {
|
|
3370
|
+
var nodeIsArray = isArray(val);
|
|
3371
|
+
var nodes = unmodified ? node.nodes : nodeIsArray ? [] : {};
|
|
3372
|
+
if (nodeIsArray) {
|
|
3373
|
+
elementRecordsLen = nodes.length;
|
|
3374
|
+
len = lengthOfArrayLike(val);
|
|
3375
|
+
for (i = 0; i < len; i++) {
|
|
3376
|
+
internalizeProperty(val, i, internalize(val, '' + i, reviver, i < elementRecordsLen ? nodes[i] : undefined));
|
|
3377
|
+
}
|
|
3378
|
+
} else {
|
|
3379
|
+
keys = enumerableOwnProperties(val);
|
|
3380
|
+
len = lengthOfArrayLike(keys);
|
|
3381
|
+
for (i = 0; i < len; i++) {
|
|
3382
|
+
P = keys[i];
|
|
3383
|
+
internalizeProperty(val, P, internalize(val, P, reviver, hasOwn(nodes, P) ? nodes[P] : undefined));
|
|
3384
|
+
}
|
|
3385
|
+
}
|
|
3386
|
+
}
|
|
3387
|
+
return call(reviver, holder, name, val, context);
|
|
3388
|
+
};
|
|
3389
|
+
|
|
3390
|
+
var internalizeProperty = function (object, key, value) {
|
|
3391
|
+
if (DESCRIPTORS) {
|
|
3392
|
+
var descriptor = getOwnPropertyDescriptor(object, key);
|
|
3393
|
+
if (descriptor && !descriptor.configurable) return;
|
|
3394
|
+
}
|
|
3395
|
+
if (value === undefined) delete object[key];
|
|
3396
|
+
else createProperty(object, key, value);
|
|
3397
|
+
};
|
|
3398
|
+
|
|
3399
|
+
var Node = function (value, end, source, nodes) {
|
|
3400
|
+
this.value = value;
|
|
3401
|
+
this.end = end;
|
|
3402
|
+
this.source = source;
|
|
3403
|
+
this.nodes = nodes;
|
|
3404
|
+
};
|
|
3405
|
+
|
|
3406
|
+
var Context = function (source, index) {
|
|
3407
|
+
this.source = source;
|
|
3408
|
+
this.index = index;
|
|
3409
|
+
};
|
|
3410
|
+
|
|
3411
|
+
// https://www.json.org/json-en.html
|
|
3412
|
+
Context.prototype = {
|
|
3413
|
+
fork: function (nextIndex) {
|
|
3414
|
+
return new Context(this.source, nextIndex);
|
|
3415
|
+
},
|
|
3416
|
+
parse: function () {
|
|
3417
|
+
var source = this.source;
|
|
3418
|
+
var i = this.skip(IS_WHITESPACE, this.index);
|
|
3419
|
+
var fork = this.fork(i);
|
|
3420
|
+
var chr = at(source, i);
|
|
3421
|
+
if (exec(IS_NUMBER_START, chr)) return fork.number();
|
|
3422
|
+
switch (chr) {
|
|
3423
|
+
case '{':
|
|
3424
|
+
return fork.object();
|
|
3425
|
+
case '[':
|
|
3426
|
+
return fork.array();
|
|
3427
|
+
case '"':
|
|
3428
|
+
return fork.string();
|
|
3429
|
+
case 't':
|
|
3430
|
+
return fork.keyword(true);
|
|
3431
|
+
case 'f':
|
|
3432
|
+
return fork.keyword(false);
|
|
3433
|
+
case 'n':
|
|
3434
|
+
return fork.keyword(null);
|
|
3435
|
+
} throw new SyntaxError('Unexpected character: "' + chr + '" at: ' + i);
|
|
3436
|
+
},
|
|
3437
|
+
node: function (type, value, start, end, nodes) {
|
|
3438
|
+
return new Node(value, end, type ? null : slice(this.source, start, end), nodes);
|
|
3439
|
+
},
|
|
3440
|
+
object: function () {
|
|
3441
|
+
var source = this.source;
|
|
3442
|
+
var i = this.index + 1;
|
|
3443
|
+
var expectKeypair = false;
|
|
3444
|
+
var object = {};
|
|
3445
|
+
var nodes = {};
|
|
3446
|
+
var closed = false;
|
|
3447
|
+
while (i < source.length) {
|
|
3448
|
+
i = this.until(['"', '}'], i);
|
|
3449
|
+
if (at(source, i) === '}' && !expectKeypair) {
|
|
3450
|
+
i++;
|
|
3451
|
+
closed = true;
|
|
3452
|
+
break;
|
|
3453
|
+
}
|
|
3454
|
+
// Parsing the key
|
|
3455
|
+
var result = this.fork(i).string();
|
|
3456
|
+
var key = result.value;
|
|
3457
|
+
i = result.end;
|
|
3458
|
+
i = this.until([':'], i) + 1;
|
|
3459
|
+
// Parsing value
|
|
3460
|
+
i = this.skip(IS_WHITESPACE, i);
|
|
3461
|
+
result = this.fork(i).parse();
|
|
3462
|
+
createProperty(nodes, key, result);
|
|
3463
|
+
createProperty(object, key, result.value);
|
|
3464
|
+
i = this.until([',', '}'], result.end);
|
|
3465
|
+
var chr = at(source, i);
|
|
3466
|
+
if (chr === ',') {
|
|
3467
|
+
expectKeypair = true;
|
|
3468
|
+
i++;
|
|
3469
|
+
} else if (chr === '}') {
|
|
3470
|
+
i++;
|
|
3471
|
+
closed = true;
|
|
3472
|
+
break;
|
|
3473
|
+
}
|
|
3474
|
+
}
|
|
3475
|
+
if (!closed) throw new SyntaxError('Unterminated object at: ' + i);
|
|
3476
|
+
return this.node(OBJECT, object, this.index, i, nodes);
|
|
3477
|
+
},
|
|
3478
|
+
array: function () {
|
|
3479
|
+
var source = this.source;
|
|
3480
|
+
var i = this.index + 1;
|
|
3481
|
+
var expectElement = false;
|
|
3482
|
+
var array = [];
|
|
3483
|
+
var nodes = [];
|
|
3484
|
+
var closed = false;
|
|
3485
|
+
while (i < source.length) {
|
|
3486
|
+
i = this.skip(IS_WHITESPACE, i);
|
|
3487
|
+
if (at(source, i) === ']' && !expectElement) {
|
|
3488
|
+
i++;
|
|
3489
|
+
closed = true;
|
|
3490
|
+
break;
|
|
3491
|
+
}
|
|
3492
|
+
var result = this.fork(i).parse();
|
|
3493
|
+
push(nodes, result);
|
|
3494
|
+
push(array, result.value);
|
|
3495
|
+
i = this.until([',', ']'], result.end);
|
|
3496
|
+
if (at(source, i) === ',') {
|
|
3497
|
+
expectElement = true;
|
|
3498
|
+
i++;
|
|
3499
|
+
} else if (at(source, i) === ']') {
|
|
3500
|
+
i++;
|
|
3501
|
+
closed = true;
|
|
3502
|
+
break;
|
|
3503
|
+
}
|
|
3504
|
+
}
|
|
3505
|
+
if (!closed) throw new SyntaxError('Unterminated array at: ' + i);
|
|
3506
|
+
return this.node(OBJECT, array, this.index, i, nodes);
|
|
3507
|
+
},
|
|
3508
|
+
string: function () {
|
|
3509
|
+
var index = this.index;
|
|
3510
|
+
var parsed = parseJSONString(this.source, this.index + 1);
|
|
3511
|
+
return this.node(PRIMITIVE, parsed.value, index, parsed.end);
|
|
3512
|
+
},
|
|
3513
|
+
number: function () {
|
|
3514
|
+
var source = this.source;
|
|
3515
|
+
var startIndex = this.index;
|
|
3516
|
+
var i = startIndex;
|
|
3517
|
+
if (at(source, i) === '-') i++;
|
|
3518
|
+
if (at(source, i) === '0') i++;
|
|
3519
|
+
else if (exec(IS_NON_ZERO_DIGIT, at(source, i))) i = this.skip(IS_DIGIT, i + 1);
|
|
3520
|
+
else throw new SyntaxError('Failed to parse number at: ' + i);
|
|
3521
|
+
if (at(source, i) === '.') {
|
|
3522
|
+
var fractionStartIndex = i + 1;
|
|
3523
|
+
i = this.skip(IS_DIGIT, fractionStartIndex);
|
|
3524
|
+
if (fractionStartIndex === i) throw new SyntaxError("Failed to parse number's fraction at: " + i);
|
|
3525
|
+
}
|
|
3526
|
+
if (at(source, i) === 'e' || at(source, i) === 'E') {
|
|
3527
|
+
i++;
|
|
3528
|
+
if (at(source, i) === '+' || at(source, i) === '-') i++;
|
|
3529
|
+
var exponentStartIndex = i;
|
|
3530
|
+
i = this.skip(IS_DIGIT, i);
|
|
3531
|
+
if (exponentStartIndex === i) throw new SyntaxError("Failed to parse number's exponent value at: " + i);
|
|
3532
|
+
}
|
|
3533
|
+
return this.node(PRIMITIVE, Number(slice(source, startIndex, i)), startIndex, i);
|
|
3534
|
+
},
|
|
3535
|
+
keyword: function (value) {
|
|
3536
|
+
var keyword = '' + value;
|
|
3537
|
+
var index = this.index;
|
|
3538
|
+
var endIndex = index + keyword.length;
|
|
3539
|
+
if (slice(this.source, index, endIndex) !== keyword) throw new SyntaxError('Failed to parse value at: ' + index);
|
|
3540
|
+
return this.node(PRIMITIVE, value, index, endIndex);
|
|
3541
|
+
},
|
|
3542
|
+
skip: function (regex, i) {
|
|
3543
|
+
var source = this.source;
|
|
3544
|
+
for (; i < source.length; i++) if (!exec(regex, at(source, i))) break;
|
|
3545
|
+
return i;
|
|
3546
|
+
},
|
|
3547
|
+
until: function (array, i) {
|
|
3548
|
+
i = this.skip(IS_WHITESPACE, i);
|
|
3549
|
+
var chr = at(this.source, i);
|
|
3550
|
+
for (var j = 0; j < array.length; j++) if (array[j] === chr) return i;
|
|
3551
|
+
throw new SyntaxError('Unexpected character: "' + chr + '" at: ' + i);
|
|
3552
|
+
}
|
|
3553
|
+
};
|
|
3554
|
+
|
|
3555
|
+
var NO_SOURCE_SUPPORT = fails(function () {
|
|
3556
|
+
var unsafeInt = '9007199254740993';
|
|
3557
|
+
var source;
|
|
3558
|
+
nativeParse(unsafeInt, function (key, value, context) {
|
|
3559
|
+
source = context.source;
|
|
3560
|
+
});
|
|
3561
|
+
return source !== unsafeInt;
|
|
3562
|
+
});
|
|
3563
|
+
|
|
3564
|
+
var PROPER_BASE_PARSE = NATIVE_SYMBOL && !fails(function () {
|
|
3565
|
+
// Safari 9 bug
|
|
3566
|
+
return 1 / nativeParse('-0 \t') !== -Infinity;
|
|
3567
|
+
});
|
|
3568
|
+
|
|
3569
|
+
// `JSON.parse` method
|
|
3570
|
+
// https://tc39.es/ecma262/#sec-json.parse
|
|
3571
|
+
// https://github.com/tc39/proposal-json-parse-with-source
|
|
3572
|
+
$({ target: 'JSON', stat: true, forced: NO_SOURCE_SUPPORT }, {
|
|
3573
|
+
parse: function parse(text, reviver) {
|
|
3574
|
+
return PROPER_BASE_PARSE && !isCallable(reviver) ? nativeParse(text) : $parse(text, reviver);
|
|
3575
|
+
}
|
|
3576
|
+
});
|
|
3577
|
+
|
|
3578
|
+
|
|
3308
3579
|
/***/ }),
|
|
3309
3580
|
|
|
3310
3581
|
/***/ 3110:
|
|
@@ -3567,7 +3838,7 @@ if (typeof window !== 'undefined') {
|
|
|
3567
3838
|
|
|
3568
3839
|
// EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"}
|
|
3569
3840
|
var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__(9274);
|
|
3570
|
-
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/components/ModulePageSelect.vue?vue&type=template&id=
|
|
3841
|
+
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/components/ModulePageSelect.vue?vue&type=template&id=42acf54b&scoped=true
|
|
3571
3842
|
|
|
3572
3843
|
const _hoisted_1 = {
|
|
3573
3844
|
class: "module-page-select"
|
|
@@ -3661,31 +3932,31 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3661
3932
|
}, {
|
|
3662
3933
|
default: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.withCtx)(() => [field.type === 'text' ? ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createBlock)(_component_a_input, {
|
|
3663
3934
|
key: 0,
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
}, null, 8, ["
|
|
3935
|
+
"model-value": $options.getNestedValue(key, field),
|
|
3936
|
+
placeholder: field.placeholder || '',
|
|
3937
|
+
"onUpdate:modelValue": val => $options.setNestedValue(key, field, val)
|
|
3938
|
+
}, null, 8, ["model-value", "placeholder", "onUpdate:modelValue"])) : field.type === 'number' ? ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createBlock)(_component_a_input_number, {
|
|
3668
3939
|
key: 1,
|
|
3669
|
-
|
|
3670
|
-
"onUpdate:modelValue": $event => $data.formData[key] = $event,
|
|
3940
|
+
"model-value": $options.getNestedValue(key, field),
|
|
3671
3941
|
placeholder: field.placeholder || '',
|
|
3672
3942
|
style: {
|
|
3673
3943
|
"width": "100%"
|
|
3674
|
-
}
|
|
3675
|
-
|
|
3944
|
+
},
|
|
3945
|
+
"onUpdate:modelValue": val => $options.setNestedValue(key, field, val)
|
|
3946
|
+
}, null, 8, ["model-value", "placeholder", "onUpdate:modelValue"])) : field.type === 'textarea' ? ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createBlock)(_component_a_textarea, {
|
|
3676
3947
|
key: 2,
|
|
3677
|
-
|
|
3678
|
-
"onUpdate:modelValue": $event => $data.formData[key] = $event,
|
|
3948
|
+
"model-value": $options.getNestedValue(key, field),
|
|
3679
3949
|
placeholder: field.placeholder || '',
|
|
3680
3950
|
"auto-size": {
|
|
3681
3951
|
minRows: 3,
|
|
3682
3952
|
maxRows: 6
|
|
3683
|
-
}
|
|
3684
|
-
|
|
3953
|
+
},
|
|
3954
|
+
"onUpdate:modelValue": val => $options.setNestedValue(key, field, val)
|
|
3955
|
+
}, null, 8, ["model-value", "placeholder", "onUpdate:modelValue"])) : field.type === 'select' ? ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createBlock)(_component_a_select, {
|
|
3685
3956
|
key: 3,
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3957
|
+
"model-value": $options.getNestedValue(key, field),
|
|
3958
|
+
placeholder: "请选择",
|
|
3959
|
+
"onUpdate:modelValue": val => $options.setNestedValue(key, field, val)
|
|
3689
3960
|
}, {
|
|
3690
3961
|
default: (0,external_commonjs_vue_commonjs2_vue_root_Vue_.withCtx)(() => [((0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(true), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createElementBlock)(external_commonjs_vue_commonjs2_vue_root_Vue_.Fragment, null, (0,external_commonjs_vue_commonjs2_vue_root_Vue_.renderList)(field.options, option => {
|
|
3691
3962
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createBlock)(_component_a_option, {
|
|
@@ -3698,7 +3969,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3698
3969
|
}, 1032, ["value", "label"]);
|
|
3699
3970
|
}), 128))]),
|
|
3700
3971
|
_: 2
|
|
3701
|
-
}, 1032, ["
|
|
3972
|
+
}, 1032, ["model-value", "onUpdate:modelValue"])) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)("", true)]),
|
|
3702
3973
|
_: 2
|
|
3703
3974
|
}, 1032, ["label", "field"]);
|
|
3704
3975
|
}), 128))], 64)) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)("", true), $data.showConfirmButton ? ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createBlock)(_component_a_button, {
|
|
@@ -3718,7 +3989,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3718
3989
|
_: 1
|
|
3719
3990
|
})]);
|
|
3720
3991
|
}
|
|
3721
|
-
;// ./src/components/ModulePageSelect.vue?vue&type=template&id=
|
|
3992
|
+
;// ./src/components/ModulePageSelect.vue?vue&type=template&id=42acf54b&scoped=true
|
|
3722
3993
|
|
|
3723
3994
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.constructor.js
|
|
3724
3995
|
var es_iterator_constructor = __webpack_require__(8111);
|
|
@@ -3730,6 +4001,8 @@ var es_iterator_for_each = __webpack_require__(7588);
|
|
|
3730
4001
|
var es_iterator_map = __webpack_require__(1701);
|
|
3731
4002
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.some.js
|
|
3732
4003
|
var es_iterator_some = __webpack_require__(3579);
|
|
4004
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.json.parse.js
|
|
4005
|
+
var es_json_parse = __webpack_require__(9112);
|
|
3733
4006
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.json.stringify.js
|
|
3734
4007
|
var es_json_stringify = __webpack_require__(3110);
|
|
3735
4008
|
// EXTERNAL MODULE: external {"commonjs":"@tuoyuan/gateway-request-lib","commonjs2":"@tuoyuan/gateway-request-lib","root":"GatewayRequestLib"}
|
|
@@ -3742,6 +4015,7 @@ var gateway_request_lib_root_GatewayRequestLib_ = __webpack_require__(3092);
|
|
|
3742
4015
|
|
|
3743
4016
|
|
|
3744
4017
|
|
|
4018
|
+
|
|
3745
4019
|
/* harmony default export */ var ModulePageSelectvue_type_script_lang_js = ({
|
|
3746
4020
|
name: 'ModulePageSelect',
|
|
3747
4021
|
props: {
|
|
@@ -4093,11 +4367,9 @@ var gateway_request_lib_root_GatewayRequestLib_ = __webpack_require__(3092);
|
|
|
4093
4367
|
if (page.options && typeof page.options === 'object' && Object.keys(page.options).length > 0) {
|
|
4094
4368
|
this.configFields = this.parseConfigSchema(page.options);
|
|
4095
4369
|
this.showConfigForm = true;
|
|
4096
|
-
//
|
|
4370
|
+
// 如果有已有的配置数据,加载它(支持嵌套结构)
|
|
4097
4371
|
if (this.modelValue?.config) {
|
|
4098
|
-
this.formData =
|
|
4099
|
-
...this.modelValue.config
|
|
4100
|
-
};
|
|
4372
|
+
this.formData = this.deepClone(this.modelValue.config);
|
|
4101
4373
|
} else {
|
|
4102
4374
|
// 初始化表单数据为默认值
|
|
4103
4375
|
this.initFormData();
|
|
@@ -4108,22 +4380,98 @@ var gateway_request_lib_root_GatewayRequestLib_ = __webpack_require__(3092);
|
|
|
4108
4380
|
this.formData = {};
|
|
4109
4381
|
}
|
|
4110
4382
|
},
|
|
4111
|
-
//
|
|
4383
|
+
// 深拷贝对象
|
|
4384
|
+
deepClone(obj) {
|
|
4385
|
+
if (obj === null || typeof obj !== 'object') return obj;
|
|
4386
|
+
if (Array.isArray(obj)) return obj.map(item => this.deepClone(item));
|
|
4387
|
+
const cloned = {};
|
|
4388
|
+
Object.keys(obj).forEach(key => {
|
|
4389
|
+
cloned[key] = this.deepClone(obj[key]);
|
|
4390
|
+
});
|
|
4391
|
+
return cloned;
|
|
4392
|
+
},
|
|
4393
|
+
// 获取嵌套字段的值
|
|
4394
|
+
getNestedValue(key, field) {
|
|
4395
|
+
if (field.parentKey && field.subKey) {
|
|
4396
|
+
return this.formData[field.parentKey]?.[field.subKey] ?? '';
|
|
4397
|
+
}
|
|
4398
|
+
const value = this.formData[key];
|
|
4399
|
+
// 如果是数组类型,转换为 JSON 字符串显示
|
|
4400
|
+
if (field.type === 'textarea' && Array.isArray(value)) {
|
|
4401
|
+
return JSON.stringify(value, null, 2);
|
|
4402
|
+
}
|
|
4403
|
+
return value ?? '';
|
|
4404
|
+
},
|
|
4405
|
+
// 设置嵌套字段的值(Vue 3 直接赋值即可响应)
|
|
4406
|
+
setNestedValue(key, field, value) {
|
|
4407
|
+
if (field.parentKey && field.subKey) {
|
|
4408
|
+
if (!this.formData[field.parentKey]) {
|
|
4409
|
+
this.formData[field.parentKey] = {};
|
|
4410
|
+
}
|
|
4411
|
+
this.formData[field.parentKey][field.subKey] = value;
|
|
4412
|
+
} else {
|
|
4413
|
+
// 如果是数组类型的字段,尝试解析 JSON
|
|
4414
|
+
if (field.type === 'textarea' && typeof value === 'string') {
|
|
4415
|
+
try {
|
|
4416
|
+
this.formData[key] = JSON.parse(value);
|
|
4417
|
+
} catch (e) {
|
|
4418
|
+
// 解析失败,保存原始字符串
|
|
4419
|
+
this.formData[key] = value;
|
|
4420
|
+
}
|
|
4421
|
+
} else {
|
|
4422
|
+
this.formData[key] = value;
|
|
4423
|
+
}
|
|
4424
|
+
}
|
|
4425
|
+
},
|
|
4426
|
+
// 解析配置 schema(基于 JSON Schema)- 支持嵌套的 object 和 array 类型
|
|
4112
4427
|
parseConfigSchema(schema) {
|
|
4113
4428
|
const fields = {};
|
|
4114
4429
|
if (schema.properties) {
|
|
4115
4430
|
Object.keys(schema.properties).forEach(key => {
|
|
4116
4431
|
const prop = schema.properties[key];
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
}
|
|
4432
|
+
|
|
4433
|
+
// 如果是数组类型,暂时用 textarea 让用户输入 JSON
|
|
4434
|
+
if (prop.type === 'array') {
|
|
4435
|
+
fields[key] = {
|
|
4436
|
+
label: prop.title || key,
|
|
4437
|
+
type: 'textarea',
|
|
4438
|
+
placeholder: prop.description || '请输入JSON格式的数组',
|
|
4439
|
+
default: prop.default || []
|
|
4440
|
+
};
|
|
4441
|
+
}
|
|
4442
|
+
// 如果是嵌套的 object 类型,递归解析其子字段
|
|
4443
|
+
else if (prop.type === 'object' && prop.properties) {
|
|
4444
|
+
Object.keys(prop.properties).forEach(subKey => {
|
|
4445
|
+
const subProp = prop.properties[subKey];
|
|
4446
|
+
// 使用 "parentKey.subKey" 作为表单字段的 key
|
|
4447
|
+
const fieldKey = `${key}.${subKey}`;
|
|
4448
|
+
fields[fieldKey] = {
|
|
4449
|
+
label: subProp.title || subKey,
|
|
4450
|
+
type: this.mapSchemaType(subProp.type),
|
|
4451
|
+
placeholder: subProp.description || '',
|
|
4452
|
+
options: subProp.enum ? subProp.enum.map((v, i) => ({
|
|
4453
|
+
label: subProp.enumDescriptions?.[i] || v,
|
|
4454
|
+
value: v
|
|
4455
|
+
})) : null,
|
|
4456
|
+
default: subProp.default,
|
|
4457
|
+
parentKey: key,
|
|
4458
|
+
// 记录父字段名,用于保存数据时重建嵌套结构
|
|
4459
|
+
subKey: subKey
|
|
4460
|
+
};
|
|
4461
|
+
});
|
|
4462
|
+
} else {
|
|
4463
|
+
// 非 object/array 类型,直接解析
|
|
4464
|
+
fields[key] = {
|
|
4465
|
+
label: prop.title || key,
|
|
4466
|
+
type: this.mapSchemaType(prop.type),
|
|
4467
|
+
placeholder: prop.description || '',
|
|
4468
|
+
options: prop.enum ? prop.enum.map((v, i) => ({
|
|
4469
|
+
label: prop.enumDescriptions?.[i] || v,
|
|
4470
|
+
value: v
|
|
4471
|
+
})) : null,
|
|
4472
|
+
default: prop.default
|
|
4473
|
+
};
|
|
4474
|
+
}
|
|
4127
4475
|
});
|
|
4128
4476
|
}
|
|
4129
4477
|
return fields;
|
|
@@ -4142,7 +4490,18 @@ var gateway_request_lib_root_GatewayRequestLib_ = __webpack_require__(3092);
|
|
|
4142
4490
|
initFormData() {
|
|
4143
4491
|
const data = {};
|
|
4144
4492
|
Object.keys(this.configFields).forEach(key => {
|
|
4145
|
-
|
|
4493
|
+
const field = this.configFields[key];
|
|
4494
|
+
const defaultValue = field.default !== undefined ? field.default : '';
|
|
4495
|
+
|
|
4496
|
+
// 如果是嵌套字段(有 parentKey),需要构建嵌套结构
|
|
4497
|
+
if (field.parentKey && field.subKey) {
|
|
4498
|
+
if (!data[field.parentKey]) {
|
|
4499
|
+
data[field.parentKey] = {};
|
|
4500
|
+
}
|
|
4501
|
+
data[field.parentKey][field.subKey] = defaultValue;
|
|
4502
|
+
} else {
|
|
4503
|
+
data[key] = defaultValue;
|
|
4504
|
+
}
|
|
4146
4505
|
});
|
|
4147
4506
|
this.formData = data;
|
|
4148
4507
|
},
|
|
@@ -4186,9 +4545,9 @@ var gateway_request_lib_root_GatewayRequestLib_ = __webpack_require__(3092);
|
|
|
4186
4545
|
});
|
|
4187
4546
|
;// ./src/components/ModulePageSelect.vue?vue&type=script&lang=js
|
|
4188
4547
|
|
|
4189
|
-
// EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-54.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-54.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-54.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-54.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/components/ModulePageSelect.vue?vue&type=style&index=0&id=
|
|
4190
|
-
var
|
|
4191
|
-
;// ./src/components/ModulePageSelect.vue?vue&type=style&index=0&id=
|
|
4548
|
+
// EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-54.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-54.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-54.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-54.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/components/ModulePageSelect.vue?vue&type=style&index=0&id=42acf54b&scoped=true&lang=css
|
|
4549
|
+
var ModulePageSelectvue_type_style_index_0_id_42acf54b_scoped_true_lang_css = __webpack_require__(8476);
|
|
4550
|
+
;// ./src/components/ModulePageSelect.vue?vue&type=style&index=0&id=42acf54b&scoped=true&lang=css
|
|
4192
4551
|
|
|
4193
4552
|
// EXTERNAL MODULE: ./node_modules/vue-loader/dist/exportHelper.js
|
|
4194
4553
|
var exportHelper = __webpack_require__(5907);
|
|
@@ -4200,7 +4559,7 @@ var exportHelper = __webpack_require__(5907);
|
|
|
4200
4559
|
;
|
|
4201
4560
|
|
|
4202
4561
|
|
|
4203
|
-
const __exports__ = /*#__PURE__*/(0,exportHelper/* default */.A)(ModulePageSelectvue_type_script_lang_js, [['render',render],['__scopeId',"data-v-
|
|
4562
|
+
const __exports__ = /*#__PURE__*/(0,exportHelper/* default */.A)(ModulePageSelectvue_type_script_lang_js, [['render',render],['__scopeId',"data-v-42acf54b"]])
|
|
4204
4563
|
|
|
4205
4564
|
/* harmony default export */ var ModulePageSelect = (__exports__);
|
|
4206
4565
|
;// ./src/index.js
|