@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/******/ (function() { // webpackBootstrap
|
|
2
2
|
/******/ var __webpack_modules__ = ({
|
|
3
3
|
|
|
4
|
-
/***/
|
|
4
|
+
/***/ 2397:
|
|
5
5
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
6
6
|
|
|
7
7
|
"use strict";
|
|
@@ -15,7 +15,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
15
15
|
|
|
16
16
|
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()));
|
|
17
17
|
// Module
|
|
18
|
-
___CSS_LOADER_EXPORT___.push([module.id, ".module-page-select[data-v-
|
|
18
|
+
___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}", ""]);
|
|
19
19
|
// Exports
|
|
20
20
|
/* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___);
|
|
21
21
|
|
|
@@ -148,19 +148,19 @@ exports.A = (sfc, props) => {
|
|
|
148
148
|
|
|
149
149
|
/***/ }),
|
|
150
150
|
|
|
151
|
-
/***/
|
|
151
|
+
/***/ 6772:
|
|
152
152
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
153
153
|
|
|
154
154
|
// style-loader: Adds some css to the DOM by adding a <style> tag
|
|
155
155
|
|
|
156
156
|
// load the styles
|
|
157
|
-
var content = __webpack_require__(
|
|
157
|
+
var content = __webpack_require__(2397);
|
|
158
158
|
if(content.__esModule) content = content.default;
|
|
159
159
|
if(typeof content === 'string') content = [[module.id, content, '']];
|
|
160
160
|
if(content.locals) module.exports = content.locals;
|
|
161
161
|
// add the styles to the DOM
|
|
162
162
|
var add = (__webpack_require__(8459)/* ["default"] */ .A)
|
|
163
|
-
var update = add("
|
|
163
|
+
var update = add("64cc404a", content, true, {"sourceMap":false,"shadowMode":false});
|
|
164
164
|
|
|
165
165
|
/***/ }),
|
|
166
166
|
|
|
@@ -3279,6 +3279,277 @@ $({ target: 'Iterator', proto: true, real: true, forced: someWithoutClosingOnEar
|
|
|
3279
3279
|
});
|
|
3280
3280
|
|
|
3281
3281
|
|
|
3282
|
+
/***/ }),
|
|
3283
|
+
|
|
3284
|
+
/***/ 9112:
|
|
3285
|
+
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
|
3286
|
+
|
|
3287
|
+
"use strict";
|
|
3288
|
+
|
|
3289
|
+
var $ = __webpack_require__(6518);
|
|
3290
|
+
var DESCRIPTORS = __webpack_require__(3724);
|
|
3291
|
+
var globalThis = __webpack_require__(4576);
|
|
3292
|
+
var getBuiltIn = __webpack_require__(7751);
|
|
3293
|
+
var uncurryThis = __webpack_require__(9504);
|
|
3294
|
+
var call = __webpack_require__(9565);
|
|
3295
|
+
var isCallable = __webpack_require__(4901);
|
|
3296
|
+
var isObject = __webpack_require__(34);
|
|
3297
|
+
var isArray = __webpack_require__(4376);
|
|
3298
|
+
var hasOwn = __webpack_require__(9297);
|
|
3299
|
+
var toString = __webpack_require__(655);
|
|
3300
|
+
var lengthOfArrayLike = __webpack_require__(6198);
|
|
3301
|
+
var createProperty = __webpack_require__(4659);
|
|
3302
|
+
var fails = __webpack_require__(9039);
|
|
3303
|
+
var parseJSONString = __webpack_require__(8235);
|
|
3304
|
+
var NATIVE_SYMBOL = __webpack_require__(4495);
|
|
3305
|
+
|
|
3306
|
+
var JSON = globalThis.JSON;
|
|
3307
|
+
var Number = globalThis.Number;
|
|
3308
|
+
var SyntaxError = globalThis.SyntaxError;
|
|
3309
|
+
var nativeParse = JSON && JSON.parse;
|
|
3310
|
+
var enumerableOwnProperties = getBuiltIn('Object', 'keys');
|
|
3311
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
3312
|
+
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
3313
|
+
var at = uncurryThis(''.charAt);
|
|
3314
|
+
var slice = uncurryThis(''.slice);
|
|
3315
|
+
var exec = uncurryThis(/./.exec);
|
|
3316
|
+
var push = uncurryThis([].push);
|
|
3317
|
+
|
|
3318
|
+
var IS_DIGIT = /^\d$/;
|
|
3319
|
+
var IS_NON_ZERO_DIGIT = /^[1-9]$/;
|
|
3320
|
+
var IS_NUMBER_START = /^[\d-]$/;
|
|
3321
|
+
var IS_WHITESPACE = /^[\t\n\r ]$/;
|
|
3322
|
+
|
|
3323
|
+
var PRIMITIVE = 0;
|
|
3324
|
+
var OBJECT = 1;
|
|
3325
|
+
|
|
3326
|
+
var $parse = function (source, reviver) {
|
|
3327
|
+
source = toString(source);
|
|
3328
|
+
var context = new Context(source, 0, '');
|
|
3329
|
+
var root = context.parse();
|
|
3330
|
+
var value = root.value;
|
|
3331
|
+
var endIndex = context.skip(IS_WHITESPACE, root.end);
|
|
3332
|
+
if (endIndex < source.length) {
|
|
3333
|
+
throw new SyntaxError('Unexpected extra character: "' + at(source, endIndex) + '" after the parsed data at: ' + endIndex);
|
|
3334
|
+
}
|
|
3335
|
+
return isCallable(reviver) ? internalize({ '': value }, '', reviver, root) : value;
|
|
3336
|
+
};
|
|
3337
|
+
|
|
3338
|
+
var internalize = function (holder, name, reviver, node) {
|
|
3339
|
+
var val = holder[name];
|
|
3340
|
+
var unmodified = node && val === node.value;
|
|
3341
|
+
var context = unmodified && typeof node.source == 'string' ? { source: node.source } : {};
|
|
3342
|
+
var elementRecordsLen, keys, len, i, P;
|
|
3343
|
+
if (isObject(val)) {
|
|
3344
|
+
var nodeIsArray = isArray(val);
|
|
3345
|
+
var nodes = unmodified ? node.nodes : nodeIsArray ? [] : {};
|
|
3346
|
+
if (nodeIsArray) {
|
|
3347
|
+
elementRecordsLen = nodes.length;
|
|
3348
|
+
len = lengthOfArrayLike(val);
|
|
3349
|
+
for (i = 0; i < len; i++) {
|
|
3350
|
+
internalizeProperty(val, i, internalize(val, '' + i, reviver, i < elementRecordsLen ? nodes[i] : undefined));
|
|
3351
|
+
}
|
|
3352
|
+
} else {
|
|
3353
|
+
keys = enumerableOwnProperties(val);
|
|
3354
|
+
len = lengthOfArrayLike(keys);
|
|
3355
|
+
for (i = 0; i < len; i++) {
|
|
3356
|
+
P = keys[i];
|
|
3357
|
+
internalizeProperty(val, P, internalize(val, P, reviver, hasOwn(nodes, P) ? nodes[P] : undefined));
|
|
3358
|
+
}
|
|
3359
|
+
}
|
|
3360
|
+
}
|
|
3361
|
+
return call(reviver, holder, name, val, context);
|
|
3362
|
+
};
|
|
3363
|
+
|
|
3364
|
+
var internalizeProperty = function (object, key, value) {
|
|
3365
|
+
if (DESCRIPTORS) {
|
|
3366
|
+
var descriptor = getOwnPropertyDescriptor(object, key);
|
|
3367
|
+
if (descriptor && !descriptor.configurable) return;
|
|
3368
|
+
}
|
|
3369
|
+
if (value === undefined) delete object[key];
|
|
3370
|
+
else createProperty(object, key, value);
|
|
3371
|
+
};
|
|
3372
|
+
|
|
3373
|
+
var Node = function (value, end, source, nodes) {
|
|
3374
|
+
this.value = value;
|
|
3375
|
+
this.end = end;
|
|
3376
|
+
this.source = source;
|
|
3377
|
+
this.nodes = nodes;
|
|
3378
|
+
};
|
|
3379
|
+
|
|
3380
|
+
var Context = function (source, index) {
|
|
3381
|
+
this.source = source;
|
|
3382
|
+
this.index = index;
|
|
3383
|
+
};
|
|
3384
|
+
|
|
3385
|
+
// https://www.json.org/json-en.html
|
|
3386
|
+
Context.prototype = {
|
|
3387
|
+
fork: function (nextIndex) {
|
|
3388
|
+
return new Context(this.source, nextIndex);
|
|
3389
|
+
},
|
|
3390
|
+
parse: function () {
|
|
3391
|
+
var source = this.source;
|
|
3392
|
+
var i = this.skip(IS_WHITESPACE, this.index);
|
|
3393
|
+
var fork = this.fork(i);
|
|
3394
|
+
var chr = at(source, i);
|
|
3395
|
+
if (exec(IS_NUMBER_START, chr)) return fork.number();
|
|
3396
|
+
switch (chr) {
|
|
3397
|
+
case '{':
|
|
3398
|
+
return fork.object();
|
|
3399
|
+
case '[':
|
|
3400
|
+
return fork.array();
|
|
3401
|
+
case '"':
|
|
3402
|
+
return fork.string();
|
|
3403
|
+
case 't':
|
|
3404
|
+
return fork.keyword(true);
|
|
3405
|
+
case 'f':
|
|
3406
|
+
return fork.keyword(false);
|
|
3407
|
+
case 'n':
|
|
3408
|
+
return fork.keyword(null);
|
|
3409
|
+
} throw new SyntaxError('Unexpected character: "' + chr + '" at: ' + i);
|
|
3410
|
+
},
|
|
3411
|
+
node: function (type, value, start, end, nodes) {
|
|
3412
|
+
return new Node(value, end, type ? null : slice(this.source, start, end), nodes);
|
|
3413
|
+
},
|
|
3414
|
+
object: function () {
|
|
3415
|
+
var source = this.source;
|
|
3416
|
+
var i = this.index + 1;
|
|
3417
|
+
var expectKeypair = false;
|
|
3418
|
+
var object = {};
|
|
3419
|
+
var nodes = {};
|
|
3420
|
+
var closed = false;
|
|
3421
|
+
while (i < source.length) {
|
|
3422
|
+
i = this.until(['"', '}'], i);
|
|
3423
|
+
if (at(source, i) === '}' && !expectKeypair) {
|
|
3424
|
+
i++;
|
|
3425
|
+
closed = true;
|
|
3426
|
+
break;
|
|
3427
|
+
}
|
|
3428
|
+
// Parsing the key
|
|
3429
|
+
var result = this.fork(i).string();
|
|
3430
|
+
var key = result.value;
|
|
3431
|
+
i = result.end;
|
|
3432
|
+
i = this.until([':'], i) + 1;
|
|
3433
|
+
// Parsing value
|
|
3434
|
+
i = this.skip(IS_WHITESPACE, i);
|
|
3435
|
+
result = this.fork(i).parse();
|
|
3436
|
+
createProperty(nodes, key, result);
|
|
3437
|
+
createProperty(object, key, result.value);
|
|
3438
|
+
i = this.until([',', '}'], result.end);
|
|
3439
|
+
var chr = at(source, i);
|
|
3440
|
+
if (chr === ',') {
|
|
3441
|
+
expectKeypair = true;
|
|
3442
|
+
i++;
|
|
3443
|
+
} else if (chr === '}') {
|
|
3444
|
+
i++;
|
|
3445
|
+
closed = true;
|
|
3446
|
+
break;
|
|
3447
|
+
}
|
|
3448
|
+
}
|
|
3449
|
+
if (!closed) throw new SyntaxError('Unterminated object at: ' + i);
|
|
3450
|
+
return this.node(OBJECT, object, this.index, i, nodes);
|
|
3451
|
+
},
|
|
3452
|
+
array: function () {
|
|
3453
|
+
var source = this.source;
|
|
3454
|
+
var i = this.index + 1;
|
|
3455
|
+
var expectElement = false;
|
|
3456
|
+
var array = [];
|
|
3457
|
+
var nodes = [];
|
|
3458
|
+
var closed = false;
|
|
3459
|
+
while (i < source.length) {
|
|
3460
|
+
i = this.skip(IS_WHITESPACE, i);
|
|
3461
|
+
if (at(source, i) === ']' && !expectElement) {
|
|
3462
|
+
i++;
|
|
3463
|
+
closed = true;
|
|
3464
|
+
break;
|
|
3465
|
+
}
|
|
3466
|
+
var result = this.fork(i).parse();
|
|
3467
|
+
push(nodes, result);
|
|
3468
|
+
push(array, result.value);
|
|
3469
|
+
i = this.until([',', ']'], result.end);
|
|
3470
|
+
if (at(source, i) === ',') {
|
|
3471
|
+
expectElement = true;
|
|
3472
|
+
i++;
|
|
3473
|
+
} else if (at(source, i) === ']') {
|
|
3474
|
+
i++;
|
|
3475
|
+
closed = true;
|
|
3476
|
+
break;
|
|
3477
|
+
}
|
|
3478
|
+
}
|
|
3479
|
+
if (!closed) throw new SyntaxError('Unterminated array at: ' + i);
|
|
3480
|
+
return this.node(OBJECT, array, this.index, i, nodes);
|
|
3481
|
+
},
|
|
3482
|
+
string: function () {
|
|
3483
|
+
var index = this.index;
|
|
3484
|
+
var parsed = parseJSONString(this.source, this.index + 1);
|
|
3485
|
+
return this.node(PRIMITIVE, parsed.value, index, parsed.end);
|
|
3486
|
+
},
|
|
3487
|
+
number: function () {
|
|
3488
|
+
var source = this.source;
|
|
3489
|
+
var startIndex = this.index;
|
|
3490
|
+
var i = startIndex;
|
|
3491
|
+
if (at(source, i) === '-') i++;
|
|
3492
|
+
if (at(source, i) === '0') i++;
|
|
3493
|
+
else if (exec(IS_NON_ZERO_DIGIT, at(source, i))) i = this.skip(IS_DIGIT, i + 1);
|
|
3494
|
+
else throw new SyntaxError('Failed to parse number at: ' + i);
|
|
3495
|
+
if (at(source, i) === '.') {
|
|
3496
|
+
var fractionStartIndex = i + 1;
|
|
3497
|
+
i = this.skip(IS_DIGIT, fractionStartIndex);
|
|
3498
|
+
if (fractionStartIndex === i) throw new SyntaxError("Failed to parse number's fraction at: " + i);
|
|
3499
|
+
}
|
|
3500
|
+
if (at(source, i) === 'e' || at(source, i) === 'E') {
|
|
3501
|
+
i++;
|
|
3502
|
+
if (at(source, i) === '+' || at(source, i) === '-') i++;
|
|
3503
|
+
var exponentStartIndex = i;
|
|
3504
|
+
i = this.skip(IS_DIGIT, i);
|
|
3505
|
+
if (exponentStartIndex === i) throw new SyntaxError("Failed to parse number's exponent value at: " + i);
|
|
3506
|
+
}
|
|
3507
|
+
return this.node(PRIMITIVE, Number(slice(source, startIndex, i)), startIndex, i);
|
|
3508
|
+
},
|
|
3509
|
+
keyword: function (value) {
|
|
3510
|
+
var keyword = '' + value;
|
|
3511
|
+
var index = this.index;
|
|
3512
|
+
var endIndex = index + keyword.length;
|
|
3513
|
+
if (slice(this.source, index, endIndex) !== keyword) throw new SyntaxError('Failed to parse value at: ' + index);
|
|
3514
|
+
return this.node(PRIMITIVE, value, index, endIndex);
|
|
3515
|
+
},
|
|
3516
|
+
skip: function (regex, i) {
|
|
3517
|
+
var source = this.source;
|
|
3518
|
+
for (; i < source.length; i++) if (!exec(regex, at(source, i))) break;
|
|
3519
|
+
return i;
|
|
3520
|
+
},
|
|
3521
|
+
until: function (array, i) {
|
|
3522
|
+
i = this.skip(IS_WHITESPACE, i);
|
|
3523
|
+
var chr = at(this.source, i);
|
|
3524
|
+
for (var j = 0; j < array.length; j++) if (array[j] === chr) return i;
|
|
3525
|
+
throw new SyntaxError('Unexpected character: "' + chr + '" at: ' + i);
|
|
3526
|
+
}
|
|
3527
|
+
};
|
|
3528
|
+
|
|
3529
|
+
var NO_SOURCE_SUPPORT = fails(function () {
|
|
3530
|
+
var unsafeInt = '9007199254740993';
|
|
3531
|
+
var source;
|
|
3532
|
+
nativeParse(unsafeInt, function (key, value, context) {
|
|
3533
|
+
source = context.source;
|
|
3534
|
+
});
|
|
3535
|
+
return source !== unsafeInt;
|
|
3536
|
+
});
|
|
3537
|
+
|
|
3538
|
+
var PROPER_BASE_PARSE = NATIVE_SYMBOL && !fails(function () {
|
|
3539
|
+
// Safari 9 bug
|
|
3540
|
+
return 1 / nativeParse('-0 \t') !== -Infinity;
|
|
3541
|
+
});
|
|
3542
|
+
|
|
3543
|
+
// `JSON.parse` method
|
|
3544
|
+
// https://tc39.es/ecma262/#sec-json.parse
|
|
3545
|
+
// https://github.com/tc39/proposal-json-parse-with-source
|
|
3546
|
+
$({ target: 'JSON', stat: true, forced: NO_SOURCE_SUPPORT }, {
|
|
3547
|
+
parse: function parse(text, reviver) {
|
|
3548
|
+
return PROPER_BASE_PARSE && !isCallable(reviver) ? nativeParse(text) : $parse(text, reviver);
|
|
3549
|
+
}
|
|
3550
|
+
});
|
|
3551
|
+
|
|
3552
|
+
|
|
3282
3553
|
/***/ }),
|
|
3283
3554
|
|
|
3284
3555
|
/***/ 3110:
|
|
@@ -3541,7 +3812,7 @@ if (typeof window !== 'undefined') {
|
|
|
3541
3812
|
|
|
3542
3813
|
;// external {"commonjs":"vue","commonjs2":"vue","root":"Vue"}
|
|
3543
3814
|
var external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject = require("vue");
|
|
3544
|
-
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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=
|
|
3815
|
+
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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
|
|
3545
3816
|
|
|
3546
3817
|
const _hoisted_1 = {
|
|
3547
3818
|
class: "module-page-select"
|
|
@@ -3635,31 +3906,31 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3635
3906
|
}, {
|
|
3636
3907
|
default: (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.withCtx)(() => [field.type === 'text' ? ((0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createBlock)(_component_a_input, {
|
|
3637
3908
|
key: 0,
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
}, null, 8, ["
|
|
3909
|
+
"model-value": $options.getNestedValue(key, field),
|
|
3910
|
+
placeholder: field.placeholder || '',
|
|
3911
|
+
"onUpdate:modelValue": val => $options.setNestedValue(key, field, val)
|
|
3912
|
+
}, null, 8, ["model-value", "placeholder", "onUpdate:modelValue"])) : field.type === 'number' ? ((0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createBlock)(_component_a_input_number, {
|
|
3642
3913
|
key: 1,
|
|
3643
|
-
|
|
3644
|
-
"onUpdate:modelValue": $event => $data.formData[key] = $event,
|
|
3914
|
+
"model-value": $options.getNestedValue(key, field),
|
|
3645
3915
|
placeholder: field.placeholder || '',
|
|
3646
3916
|
style: {
|
|
3647
3917
|
"width": "100%"
|
|
3648
|
-
}
|
|
3649
|
-
|
|
3918
|
+
},
|
|
3919
|
+
"onUpdate:modelValue": val => $options.setNestedValue(key, field, val)
|
|
3920
|
+
}, null, 8, ["model-value", "placeholder", "onUpdate:modelValue"])) : field.type === 'textarea' ? ((0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createBlock)(_component_a_textarea, {
|
|
3650
3921
|
key: 2,
|
|
3651
|
-
|
|
3652
|
-
"onUpdate:modelValue": $event => $data.formData[key] = $event,
|
|
3922
|
+
"model-value": $options.getNestedValue(key, field),
|
|
3653
3923
|
placeholder: field.placeholder || '',
|
|
3654
3924
|
"auto-size": {
|
|
3655
3925
|
minRows: 3,
|
|
3656
3926
|
maxRows: 6
|
|
3657
|
-
}
|
|
3658
|
-
|
|
3927
|
+
},
|
|
3928
|
+
"onUpdate:modelValue": val => $options.setNestedValue(key, field, val)
|
|
3929
|
+
}, null, 8, ["model-value", "placeholder", "onUpdate:modelValue"])) : field.type === 'select' ? ((0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createBlock)(_component_a_select, {
|
|
3659
3930
|
key: 3,
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3931
|
+
"model-value": $options.getNestedValue(key, field),
|
|
3932
|
+
placeholder: "请选择",
|
|
3933
|
+
"onUpdate:modelValue": val => $options.setNestedValue(key, field, val)
|
|
3663
3934
|
}, {
|
|
3664
3935
|
default: (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.withCtx)(() => [((0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.openBlock)(true), (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createElementBlock)(external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.Fragment, null, (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.renderList)(field.options, option => {
|
|
3665
3936
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createBlock)(_component_a_option, {
|
|
@@ -3672,7 +3943,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3672
3943
|
}, 1032, ["value", "label"]);
|
|
3673
3944
|
}), 128))]),
|
|
3674
3945
|
_: 2
|
|
3675
|
-
}, 1032, ["
|
|
3946
|
+
}, 1032, ["model-value", "onUpdate:modelValue"])) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createCommentVNode)("", true)]),
|
|
3676
3947
|
_: 2
|
|
3677
3948
|
}, 1032, ["label", "field"]);
|
|
3678
3949
|
}), 128))], 64)) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createCommentVNode)("", true), $data.showConfirmButton ? ((0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.openBlock)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject.createBlock)(_component_a_button, {
|
|
@@ -3692,7 +3963,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3692
3963
|
_: 1
|
|
3693
3964
|
})]);
|
|
3694
3965
|
}
|
|
3695
|
-
;// ./src/components/ModulePageSelect.vue?vue&type=template&id=
|
|
3966
|
+
;// ./src/components/ModulePageSelect.vue?vue&type=template&id=42acf54b&scoped=true
|
|
3696
3967
|
|
|
3697
3968
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.constructor.js
|
|
3698
3969
|
var es_iterator_constructor = __webpack_require__(8111);
|
|
@@ -3704,6 +3975,8 @@ var es_iterator_for_each = __webpack_require__(7588);
|
|
|
3704
3975
|
var es_iterator_map = __webpack_require__(1701);
|
|
3705
3976
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.some.js
|
|
3706
3977
|
var es_iterator_some = __webpack_require__(3579);
|
|
3978
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.json.parse.js
|
|
3979
|
+
var es_json_parse = __webpack_require__(9112);
|
|
3707
3980
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.json.stringify.js
|
|
3708
3981
|
var es_json_stringify = __webpack_require__(3110);
|
|
3709
3982
|
;// external {"commonjs":"@tuoyuan/gateway-request-lib","commonjs2":"@tuoyuan/gateway-request-lib","root":"GatewayRequestLib"}
|
|
@@ -3716,6 +3989,7 @@ var gateway_request_lib_root_GatewayRequestLib_namespaceObject = require("@tuoyu
|
|
|
3716
3989
|
|
|
3717
3990
|
|
|
3718
3991
|
|
|
3992
|
+
|
|
3719
3993
|
/* harmony default export */ var ModulePageSelectvue_type_script_lang_js = ({
|
|
3720
3994
|
name: 'ModulePageSelect',
|
|
3721
3995
|
props: {
|
|
@@ -4067,11 +4341,9 @@ var gateway_request_lib_root_GatewayRequestLib_namespaceObject = require("@tuoyu
|
|
|
4067
4341
|
if (page.options && typeof page.options === 'object' && Object.keys(page.options).length > 0) {
|
|
4068
4342
|
this.configFields = this.parseConfigSchema(page.options);
|
|
4069
4343
|
this.showConfigForm = true;
|
|
4070
|
-
//
|
|
4344
|
+
// 如果有已有的配置数据,加载它(支持嵌套结构)
|
|
4071
4345
|
if (this.modelValue?.config) {
|
|
4072
|
-
this.formData =
|
|
4073
|
-
...this.modelValue.config
|
|
4074
|
-
};
|
|
4346
|
+
this.formData = this.deepClone(this.modelValue.config);
|
|
4075
4347
|
} else {
|
|
4076
4348
|
// 初始化表单数据为默认值
|
|
4077
4349
|
this.initFormData();
|
|
@@ -4082,22 +4354,98 @@ var gateway_request_lib_root_GatewayRequestLib_namespaceObject = require("@tuoyu
|
|
|
4082
4354
|
this.formData = {};
|
|
4083
4355
|
}
|
|
4084
4356
|
},
|
|
4085
|
-
//
|
|
4357
|
+
// 深拷贝对象
|
|
4358
|
+
deepClone(obj) {
|
|
4359
|
+
if (obj === null || typeof obj !== 'object') return obj;
|
|
4360
|
+
if (Array.isArray(obj)) return obj.map(item => this.deepClone(item));
|
|
4361
|
+
const cloned = {};
|
|
4362
|
+
Object.keys(obj).forEach(key => {
|
|
4363
|
+
cloned[key] = this.deepClone(obj[key]);
|
|
4364
|
+
});
|
|
4365
|
+
return cloned;
|
|
4366
|
+
},
|
|
4367
|
+
// 获取嵌套字段的值
|
|
4368
|
+
getNestedValue(key, field) {
|
|
4369
|
+
if (field.parentKey && field.subKey) {
|
|
4370
|
+
return this.formData[field.parentKey]?.[field.subKey] ?? '';
|
|
4371
|
+
}
|
|
4372
|
+
const value = this.formData[key];
|
|
4373
|
+
// 如果是数组类型,转换为 JSON 字符串显示
|
|
4374
|
+
if (field.type === 'textarea' && Array.isArray(value)) {
|
|
4375
|
+
return JSON.stringify(value, null, 2);
|
|
4376
|
+
}
|
|
4377
|
+
return value ?? '';
|
|
4378
|
+
},
|
|
4379
|
+
// 设置嵌套字段的值(Vue 3 直接赋值即可响应)
|
|
4380
|
+
setNestedValue(key, field, value) {
|
|
4381
|
+
if (field.parentKey && field.subKey) {
|
|
4382
|
+
if (!this.formData[field.parentKey]) {
|
|
4383
|
+
this.formData[field.parentKey] = {};
|
|
4384
|
+
}
|
|
4385
|
+
this.formData[field.parentKey][field.subKey] = value;
|
|
4386
|
+
} else {
|
|
4387
|
+
// 如果是数组类型的字段,尝试解析 JSON
|
|
4388
|
+
if (field.type === 'textarea' && typeof value === 'string') {
|
|
4389
|
+
try {
|
|
4390
|
+
this.formData[key] = JSON.parse(value);
|
|
4391
|
+
} catch (e) {
|
|
4392
|
+
// 解析失败,保存原始字符串
|
|
4393
|
+
this.formData[key] = value;
|
|
4394
|
+
}
|
|
4395
|
+
} else {
|
|
4396
|
+
this.formData[key] = value;
|
|
4397
|
+
}
|
|
4398
|
+
}
|
|
4399
|
+
},
|
|
4400
|
+
// 解析配置 schema(基于 JSON Schema)- 支持嵌套的 object 和 array 类型
|
|
4086
4401
|
parseConfigSchema(schema) {
|
|
4087
4402
|
const fields = {};
|
|
4088
4403
|
if (schema.properties) {
|
|
4089
4404
|
Object.keys(schema.properties).forEach(key => {
|
|
4090
4405
|
const prop = schema.properties[key];
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
}
|
|
4406
|
+
|
|
4407
|
+
// 如果是数组类型,暂时用 textarea 让用户输入 JSON
|
|
4408
|
+
if (prop.type === 'array') {
|
|
4409
|
+
fields[key] = {
|
|
4410
|
+
label: prop.title || key,
|
|
4411
|
+
type: 'textarea',
|
|
4412
|
+
placeholder: prop.description || '请输入JSON格式的数组',
|
|
4413
|
+
default: prop.default || []
|
|
4414
|
+
};
|
|
4415
|
+
}
|
|
4416
|
+
// 如果是嵌套的 object 类型,递归解析其子字段
|
|
4417
|
+
else if (prop.type === 'object' && prop.properties) {
|
|
4418
|
+
Object.keys(prop.properties).forEach(subKey => {
|
|
4419
|
+
const subProp = prop.properties[subKey];
|
|
4420
|
+
// 使用 "parentKey.subKey" 作为表单字段的 key
|
|
4421
|
+
const fieldKey = `${key}.${subKey}`;
|
|
4422
|
+
fields[fieldKey] = {
|
|
4423
|
+
label: subProp.title || subKey,
|
|
4424
|
+
type: this.mapSchemaType(subProp.type),
|
|
4425
|
+
placeholder: subProp.description || '',
|
|
4426
|
+
options: subProp.enum ? subProp.enum.map((v, i) => ({
|
|
4427
|
+
label: subProp.enumDescriptions?.[i] || v,
|
|
4428
|
+
value: v
|
|
4429
|
+
})) : null,
|
|
4430
|
+
default: subProp.default,
|
|
4431
|
+
parentKey: key,
|
|
4432
|
+
// 记录父字段名,用于保存数据时重建嵌套结构
|
|
4433
|
+
subKey: subKey
|
|
4434
|
+
};
|
|
4435
|
+
});
|
|
4436
|
+
} else {
|
|
4437
|
+
// 非 object/array 类型,直接解析
|
|
4438
|
+
fields[key] = {
|
|
4439
|
+
label: prop.title || key,
|
|
4440
|
+
type: this.mapSchemaType(prop.type),
|
|
4441
|
+
placeholder: prop.description || '',
|
|
4442
|
+
options: prop.enum ? prop.enum.map((v, i) => ({
|
|
4443
|
+
label: prop.enumDescriptions?.[i] || v,
|
|
4444
|
+
value: v
|
|
4445
|
+
})) : null,
|
|
4446
|
+
default: prop.default
|
|
4447
|
+
};
|
|
4448
|
+
}
|
|
4101
4449
|
});
|
|
4102
4450
|
}
|
|
4103
4451
|
return fields;
|
|
@@ -4116,7 +4464,18 @@ var gateway_request_lib_root_GatewayRequestLib_namespaceObject = require("@tuoyu
|
|
|
4116
4464
|
initFormData() {
|
|
4117
4465
|
const data = {};
|
|
4118
4466
|
Object.keys(this.configFields).forEach(key => {
|
|
4119
|
-
|
|
4467
|
+
const field = this.configFields[key];
|
|
4468
|
+
const defaultValue = field.default !== undefined ? field.default : '';
|
|
4469
|
+
|
|
4470
|
+
// 如果是嵌套字段(有 parentKey),需要构建嵌套结构
|
|
4471
|
+
if (field.parentKey && field.subKey) {
|
|
4472
|
+
if (!data[field.parentKey]) {
|
|
4473
|
+
data[field.parentKey] = {};
|
|
4474
|
+
}
|
|
4475
|
+
data[field.parentKey][field.subKey] = defaultValue;
|
|
4476
|
+
} else {
|
|
4477
|
+
data[key] = defaultValue;
|
|
4478
|
+
}
|
|
4120
4479
|
});
|
|
4121
4480
|
this.formData = data;
|
|
4122
4481
|
},
|
|
@@ -4160,9 +4519,9 @@ var gateway_request_lib_root_GatewayRequestLib_namespaceObject = require("@tuoyu
|
|
|
4160
4519
|
});
|
|
4161
4520
|
;// ./src/components/ModulePageSelect.vue?vue&type=script&lang=js
|
|
4162
4521
|
|
|
4163
|
-
// EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-12.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/components/ModulePageSelect.vue?vue&type=style&index=0&id=
|
|
4164
|
-
var
|
|
4165
|
-
;// ./src/components/ModulePageSelect.vue?vue&type=style&index=0&id=
|
|
4522
|
+
// EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-12.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.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
|
|
4523
|
+
var ModulePageSelectvue_type_style_index_0_id_42acf54b_scoped_true_lang_css = __webpack_require__(6772);
|
|
4524
|
+
;// ./src/components/ModulePageSelect.vue?vue&type=style&index=0&id=42acf54b&scoped=true&lang=css
|
|
4166
4525
|
|
|
4167
4526
|
// EXTERNAL MODULE: ./node_modules/vue-loader/dist/exportHelper.js
|
|
4168
4527
|
var exportHelper = __webpack_require__(1241);
|
|
@@ -4174,7 +4533,7 @@ var exportHelper = __webpack_require__(1241);
|
|
|
4174
4533
|
;
|
|
4175
4534
|
|
|
4176
4535
|
|
|
4177
|
-
const __exports__ = /*#__PURE__*/(0,exportHelper/* default */.A)(ModulePageSelectvue_type_script_lang_js, [['render',render],['__scopeId',"data-v-
|
|
4536
|
+
const __exports__ = /*#__PURE__*/(0,exportHelper/* default */.A)(ModulePageSelectvue_type_script_lang_js, [['render',render],['__scopeId',"data-v-42acf54b"]])
|
|
4178
4537
|
|
|
4179
4538
|
/* harmony default export */ var ModulePageSelect = (__exports__);
|
|
4180
4539
|
;// ./src/index.js
|