bm-admin-ui 1.0.45-alpha → 1.0.47-alpha
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/es/components/button/index.d.ts +1 -1
- package/es/components/button/src/button.vue.d.ts +1 -1
- package/es/components/editor/__test__/index.test.d.ts +1 -0
- package/es/components/editor/index.d.ts +3 -2
- package/es/components/editor/index.js +2 -1
- package/es/components/editor/src/editor.vue.d.ts +3 -2
- package/es/components/float-table/index.d.ts +3 -3
- package/es/components/float-table/index.js +22 -11
- package/es/components/float-table/src/float-table.vue.d.ts +3 -3
- package/es/components/form-create/index.js +126 -89
- package/es/components/form-designer/index.js +77 -93
- package/es/components/index.d.ts +1 -0
- package/es/components/index.js +1 -0
- package/es/components/search-filter/index.d.ts +3 -3
- package/es/components/search-filter/src/search-filter.vue.d.ts +3 -3
- package/es/components/select-all/index.d.ts +1 -1
- package/es/components/select-all/src/selectAll.vue.d.ts +1 -1
- package/es/components/staffs-selector/index.d.ts +2 -2
- package/es/components/staffs-selector/src/multipleCmp.vue.d.ts +2 -2
- package/es/components/staffs-selector/src/staffs-selector.vue.d.ts +2 -2
- package/es/components/upload/index.d.ts +2 -1
- package/es/components/upload/index.js +2 -1
- package/es/components/upload/src/upload.vue.d.ts +2 -1
- package/es/components/videoView/__test__/index.test.d.ts +1 -0
- package/es/components/videoView/index.d.ts +37 -0
- package/es/components/videoView/index.js +100 -0
- package/es/components/videoView/src/videoView.vue.d.ts +36 -0
- package/lib/components/button/index.d.ts +1 -1
- package/lib/components/button/src/button.vue.d.ts +1 -1
- package/lib/components/editor/__test__/index.test.d.ts +1 -0
- package/lib/components/editor/index.d.ts +3 -2
- package/lib/components/editor/index.js +2 -1
- package/lib/components/editor/src/editor.vue.d.ts +3 -2
- package/lib/components/float-table/index.d.ts +3 -3
- package/lib/components/float-table/index.js +22 -11
- package/lib/components/float-table/src/float-table.vue.d.ts +3 -3
- package/lib/components/form-create/index.js +126 -90
- package/lib/components/form-designer/index.js +77 -93
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +7 -0
- package/lib/components/search-filter/index.d.ts +3 -3
- package/lib/components/search-filter/src/search-filter.vue.d.ts +3 -3
- package/lib/components/select-all/index.d.ts +1 -1
- package/lib/components/select-all/src/selectAll.vue.d.ts +1 -1
- package/lib/components/staffs-selector/index.d.ts +2 -2
- package/lib/components/staffs-selector/src/multipleCmp.vue.d.ts +2 -2
- package/lib/components/staffs-selector/src/staffs-selector.vue.d.ts +2 -2
- package/lib/components/upload/index.d.ts +2 -1
- package/lib/components/upload/index.js +2 -1
- package/lib/components/upload/src/upload.vue.d.ts +2 -1
- package/lib/components/videoView/__test__/index.test.d.ts +1 -0
- package/lib/components/videoView/index.d.ts +37 -0
- package/lib/components/videoView/index.js +105 -0
- package/lib/components/videoView/src/videoView.vue.d.ts +36 -0
- package/package.json +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/videoView.css +1 -0
- package/types/components/button/index.d.ts +1 -1
- package/types/components/button/src/button.vue.d.ts +1 -1
- package/types/components/editor/__test__/index.test.d.ts +1 -0
- package/types/components/editor/index.d.ts +3 -2
- package/types/components/editor/src/editor.vue.d.ts +3 -2
- package/types/components/float-table/index.d.ts +3 -3
- package/types/components/float-table/src/float-table.vue.d.ts +3 -3
- package/types/components/index.d.ts +1 -0
- package/types/components/search-filter/index.d.ts +3 -3
- package/types/components/search-filter/src/search-filter.vue.d.ts +3 -3
- package/types/components/select-all/index.d.ts +1 -1
- package/types/components/select-all/src/selectAll.vue.d.ts +1 -1
- package/types/components/staffs-selector/index.d.ts +2 -2
- package/types/components/staffs-selector/src/multipleCmp.vue.d.ts +2 -2
- package/types/components/staffs-selector/src/staffs-selector.vue.d.ts +2 -2
- package/types/components/upload/index.d.ts +2 -1
- package/types/components/upload/src/upload.vue.d.ts +2 -1
- package/types/components/videoView/__test__/index.test.d.ts +1 -0
- package/types/components/videoView/index.d.ts +37 -0
- package/types/components/videoView/src/videoView.vue.d.ts +36 -0
- package/index.esm.js +0 -150081
- package/index.js +0 -150115
|
@@ -11,14 +11,12 @@ var BmStaffsSelector = require('bm-admin-ui/lib/components/staffs-selector');
|
|
|
11
11
|
var components = require('bm-admin-ui/lib/components');
|
|
12
12
|
var iconsVue = require('@ant-design/icons-vue');
|
|
13
13
|
var lodashEs = require('lodash-es');
|
|
14
|
-
var FC = require('@form-create/ant-design-vue');
|
|
15
14
|
|
|
16
15
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
17
16
|
|
|
18
17
|
var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
|
|
19
18
|
var Picture__default = /*#__PURE__*/_interopDefaultLegacy(Picture);
|
|
20
19
|
var BmStaffsSelector__default = /*#__PURE__*/_interopDefaultLegacy(BmStaffsSelector);
|
|
21
|
-
var FC__default = /*#__PURE__*/_interopDefaultLegacy(FC);
|
|
22
20
|
|
|
23
21
|
const fieldRatioMap = {
|
|
24
22
|
'25%': 6,
|
|
@@ -785,15 +783,27 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
|
785
783
|
"placeholder",
|
|
786
784
|
"defaultSelected",
|
|
787
785
|
"load",
|
|
788
|
-
"disabled"
|
|
786
|
+
"disabled",
|
|
787
|
+
"fieldNames"
|
|
789
788
|
],
|
|
790
789
|
emits: ["change"],
|
|
791
790
|
setup(__props, { emit: emits }) {
|
|
792
791
|
const props = __props;
|
|
792
|
+
const fieldNames = props.fieldNames || {
|
|
793
|
+
label: "name",
|
|
794
|
+
value: "code"
|
|
795
|
+
};
|
|
793
796
|
const selected = vue.ref([]);
|
|
794
797
|
const visible = vue.ref(false);
|
|
795
798
|
function selectedChange(val) {
|
|
796
|
-
emits(
|
|
799
|
+
emits(
|
|
800
|
+
"change",
|
|
801
|
+
val.map((item) => ({
|
|
802
|
+
[fieldNames.value]: item.key,
|
|
803
|
+
[fieldNames.label]: item.title,
|
|
804
|
+
...item
|
|
805
|
+
}))
|
|
806
|
+
);
|
|
797
807
|
}
|
|
798
808
|
function handleAdd() {
|
|
799
809
|
visible.value = true;
|
|
@@ -838,6 +848,7 @@ var StaffSelector = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__file", "staff-
|
|
|
838
848
|
var people = {
|
|
839
849
|
name: 'people',
|
|
840
850
|
rule(data, extraConfig) {
|
|
851
|
+
var _a;
|
|
841
852
|
return {
|
|
842
853
|
type: 'StaffSelector',
|
|
843
854
|
component: StaffSelector,
|
|
@@ -853,6 +864,7 @@ var people = {
|
|
|
853
864
|
return yield extraConfig.people.fetch(params);
|
|
854
865
|
});
|
|
855
866
|
},
|
|
867
|
+
fieldNames: (_a = extraConfig.people) === null || _a === void 0 ? void 0 : _a.fieldNames,
|
|
856
868
|
},
|
|
857
869
|
effect: {
|
|
858
870
|
required: data.effect.required && '请选择',
|
|
@@ -877,6 +889,7 @@ var people = {
|
|
|
877
889
|
};
|
|
878
890
|
},
|
|
879
891
|
rowRule(data, extraConfig) {
|
|
892
|
+
var _a;
|
|
880
893
|
return {
|
|
881
894
|
type: 'StaffSelector',
|
|
882
895
|
component: StaffSelector,
|
|
@@ -892,6 +905,7 @@ var people = {
|
|
|
892
905
|
return yield extraConfig.people.fetch(params);
|
|
893
906
|
});
|
|
894
907
|
},
|
|
908
|
+
fieldNames: (_a = extraConfig.people) === null || _a === void 0 ? void 0 : _a.fieldNames,
|
|
895
909
|
},
|
|
896
910
|
effect: {
|
|
897
911
|
required: data.effect.required && '请选择',
|
|
@@ -1629,6 +1643,8 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1629
1643
|
index++;
|
|
1630
1644
|
}
|
|
1631
1645
|
function handleDelete(targetKey) {
|
|
1646
|
+
if (panes.length === 1)
|
|
1647
|
+
return;
|
|
1632
1648
|
panes.splice(
|
|
1633
1649
|
panes.findIndex((pane) => pane.key === targetKey),
|
|
1634
1650
|
1
|
|
@@ -2231,14 +2247,18 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
2231
2247
|
props: [
|
|
2232
2248
|
"value",
|
|
2233
2249
|
"extraConfig",
|
|
2234
|
-
"
|
|
2250
|
+
"dataFiltering",
|
|
2235
2251
|
"disabled",
|
|
2236
2252
|
"formCreateInject"
|
|
2237
2253
|
],
|
|
2238
2254
|
emits: ["change"],
|
|
2239
2255
|
setup(__props, { emit: emits }) {
|
|
2240
2256
|
const props = __props;
|
|
2241
|
-
const
|
|
2257
|
+
const fieldNames = props.extraConfig.fieldNames || {
|
|
2258
|
+
label: "name",
|
|
2259
|
+
value: "code"
|
|
2260
|
+
};
|
|
2261
|
+
const value = vue.ref(props.value?.[fieldNames.value]);
|
|
2242
2262
|
const options = vue.ref([]);
|
|
2243
2263
|
const keyword = vue.ref("");
|
|
2244
2264
|
const debounceFetch = lodashEs.debounce((value2) => {
|
|
@@ -2249,7 +2269,7 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
2249
2269
|
}, 300);
|
|
2250
2270
|
const postData = vue.computed(() => ({
|
|
2251
2271
|
keyword: keyword.value,
|
|
2252
|
-
filterByUser: props.
|
|
2272
|
+
filterByUser: props.dataFiltering
|
|
2253
2273
|
}));
|
|
2254
2274
|
function initOptions() {
|
|
2255
2275
|
props.extraConfig.fetch(postData.value).then((data) => {
|
|
@@ -2257,8 +2277,11 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
2257
2277
|
});
|
|
2258
2278
|
}
|
|
2259
2279
|
function handleChange(val, option) {
|
|
2260
|
-
|
|
2261
|
-
|
|
2280
|
+
emits("change", {
|
|
2281
|
+
[fieldNames.value]: option.value,
|
|
2282
|
+
[fieldNames.label]: option.label,
|
|
2283
|
+
...option
|
|
2284
|
+
});
|
|
2262
2285
|
}
|
|
2263
2286
|
function handleSearch(value2) {
|
|
2264
2287
|
keyword.value = value2;
|
|
@@ -2288,6 +2311,7 @@ var ShopWidget = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__file", "shop-widg
|
|
|
2288
2311
|
var shop = {
|
|
2289
2312
|
name: 'shop',
|
|
2290
2313
|
rule(data, extraConfig) {
|
|
2314
|
+
var _a;
|
|
2291
2315
|
const shopExtraConfig = extraConfig.shop;
|
|
2292
2316
|
return {
|
|
2293
2317
|
type: 'ShopWidget',
|
|
@@ -2298,7 +2322,7 @@ var shop = {
|
|
|
2298
2322
|
required: data.effect.required && '请选择店铺',
|
|
2299
2323
|
},
|
|
2300
2324
|
props: {
|
|
2301
|
-
|
|
2325
|
+
dataFiltering: (_a = data.config) === null || _a === void 0 ? void 0 : _a.dataFiltering,
|
|
2302
2326
|
extraConfig: shopExtraConfig,
|
|
2303
2327
|
value: data.value,
|
|
2304
2328
|
},
|
|
@@ -2319,6 +2343,7 @@ var shop = {
|
|
|
2319
2343
|
};
|
|
2320
2344
|
},
|
|
2321
2345
|
rowRule(data, extraConfig) {
|
|
2346
|
+
var _a;
|
|
2322
2347
|
const shopExtraConfig = extraConfig.shop;
|
|
2323
2348
|
return {
|
|
2324
2349
|
type: 'ShopWidget',
|
|
@@ -2329,7 +2354,7 @@ var shop = {
|
|
|
2329
2354
|
required: data.effect.required && '请选择店铺',
|
|
2330
2355
|
},
|
|
2331
2356
|
props: {
|
|
2332
|
-
|
|
2357
|
+
dataFiltering: (_a = data.config) === null || _a === void 0 ? void 0 : _a.dataFiltering,
|
|
2333
2358
|
extraConfig: shopExtraConfig,
|
|
2334
2359
|
value: data.value,
|
|
2335
2360
|
},
|
|
@@ -2361,8 +2386,9 @@ var shop = {
|
|
|
2361
2386
|
minWidth: '138px',
|
|
2362
2387
|
slots: {
|
|
2363
2388
|
default({ row }) {
|
|
2389
|
+
var _a;
|
|
2364
2390
|
return vue.h(ShopWidget, {
|
|
2365
|
-
|
|
2391
|
+
dataFiltering: (_a = data.config) === null || _a === void 0 ? void 0 : _a.dataFiltering,
|
|
2366
2392
|
extraConfig: extraConfig.shop,
|
|
2367
2393
|
value: row[field],
|
|
2368
2394
|
disabled: data.disabled,
|
|
@@ -2377,7 +2403,7 @@ var shop = {
|
|
|
2377
2403
|
};
|
|
2378
2404
|
|
|
2379
2405
|
const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
2380
|
-
__name: "material-type
|
|
2406
|
+
__name: "material-type",
|
|
2381
2407
|
props: ["config", "multiple", "format", "value"],
|
|
2382
2408
|
emits: ["change"],
|
|
2383
2409
|
setup(__props, { emit: emits }) {
|
|
@@ -2389,71 +2415,105 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
|
2389
2415
|
item.isLeaf = props.format === 1;
|
|
2390
2416
|
});
|
|
2391
2417
|
options.value = result;
|
|
2418
|
+
return options.value;
|
|
2419
|
+
}).then((options2) => {
|
|
2420
|
+
if (props.value.length) {
|
|
2421
|
+
if (props.multiple) {
|
|
2422
|
+
props.value.forEach((item) => loadValueOptions(item, options2));
|
|
2423
|
+
} else {
|
|
2424
|
+
loadValueOptions(props.value, options2);
|
|
2425
|
+
}
|
|
2426
|
+
}
|
|
2392
2427
|
});
|
|
2393
2428
|
}
|
|
2394
|
-
function loadData(selectedOptions) {
|
|
2429
|
+
async function loadData(selectedOptions) {
|
|
2395
2430
|
const optionLength = selectedOptions.length;
|
|
2396
2431
|
const targetOption = selectedOptions[optionLength - 1];
|
|
2397
2432
|
targetOption.loading = true;
|
|
2398
|
-
props.config.fetch({
|
|
2433
|
+
return await props.config.fetch({
|
|
2399
2434
|
level: optionLength + 1,
|
|
2400
2435
|
relationCode: targetOption.value
|
|
2401
2436
|
}).then((result) => {
|
|
2402
2437
|
result.forEach((item) => {
|
|
2403
2438
|
item.isLeaf = props.format === optionLength + 1;
|
|
2404
2439
|
});
|
|
2405
|
-
|
|
2440
|
+
if (result.length) {
|
|
2441
|
+
targetOption.children = result;
|
|
2442
|
+
} else {
|
|
2443
|
+
targetOption.isLeaf = true;
|
|
2444
|
+
}
|
|
2406
2445
|
}).finally(() => {
|
|
2407
2446
|
targetOption.loading = false;
|
|
2408
2447
|
});
|
|
2409
2448
|
}
|
|
2410
|
-
function handleChange(
|
|
2411
|
-
|
|
2449
|
+
function handleChange(value, selectedOptions) {
|
|
2450
|
+
const result = lodashEs.cloneDeep(selectedOptions);
|
|
2451
|
+
processValue(result);
|
|
2452
|
+
emits("change", result);
|
|
2453
|
+
}
|
|
2454
|
+
function processValue(selectedOptions) {
|
|
2455
|
+
selectedOptions.forEach((item) => {
|
|
2456
|
+
if (Array.isArray(item))
|
|
2457
|
+
processValue(item);
|
|
2458
|
+
else {
|
|
2459
|
+
delete item.disabled;
|
|
2460
|
+
delete item.children;
|
|
2461
|
+
delete item.isLeaf;
|
|
2462
|
+
delete item.loading;
|
|
2463
|
+
}
|
|
2464
|
+
});
|
|
2465
|
+
}
|
|
2466
|
+
function formatValue(value) {
|
|
2467
|
+
value = value || [];
|
|
2468
|
+
return value.reduce((pre, cur) => {
|
|
2469
|
+
if (Array.isArray(cur)) {
|
|
2470
|
+
pre.push(cur.map((c) => c.value));
|
|
2471
|
+
} else {
|
|
2472
|
+
pre.push(cur.value);
|
|
2473
|
+
}
|
|
2474
|
+
return pre;
|
|
2475
|
+
}, []);
|
|
2476
|
+
}
|
|
2477
|
+
async function loadValueOptions(value, options2) {
|
|
2478
|
+
const selectedOptions = [];
|
|
2479
|
+
for (const option of value) {
|
|
2480
|
+
let cur;
|
|
2481
|
+
if (selectedOptions.length) {
|
|
2482
|
+
cur = selectedOptions[selectedOptions.length - 1].children.find(
|
|
2483
|
+
(item) => item.value === option.value
|
|
2484
|
+
);
|
|
2485
|
+
} else {
|
|
2486
|
+
cur = options2.find((item) => item.value === option.value);
|
|
2487
|
+
}
|
|
2488
|
+
if (!cur.isLeaf) {
|
|
2489
|
+
selectedOptions.push(cur);
|
|
2490
|
+
await loadData(selectedOptions);
|
|
2491
|
+
}
|
|
2492
|
+
}
|
|
2412
2493
|
}
|
|
2413
2494
|
initOptions();
|
|
2414
2495
|
return (_ctx, _cache) => {
|
|
2415
2496
|
return vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Cascader), {
|
|
2416
|
-
value: __props.value,
|
|
2497
|
+
value: formatValue(__props.value),
|
|
2417
2498
|
placeholder: "\u8BF7\u8F93\u5165",
|
|
2418
2499
|
multiple: __props.multiple,
|
|
2419
2500
|
options: options.value,
|
|
2420
2501
|
"load-data": loadData,
|
|
2502
|
+
"change-on-select": "",
|
|
2421
2503
|
"get-popup-container": vue.unref(getContainer),
|
|
2422
|
-
|
|
2504
|
+
onChange: handleChange
|
|
2423
2505
|
}, null, 8, ["value", "multiple", "options", "get-popup-container"]);
|
|
2424
2506
|
};
|
|
2425
2507
|
}
|
|
2426
2508
|
});
|
|
2427
|
-
var
|
|
2509
|
+
var materialType$1 = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__file", "material-type.vue"]]);
|
|
2428
2510
|
|
|
2429
|
-
FC__default["default"].register({
|
|
2430
|
-
name: 'materialTypesOption',
|
|
2431
|
-
init({ value }, rule) {
|
|
2432
|
-
getOption(value, { level: 1, relationCode: '' }).then((data) => {
|
|
2433
|
-
data = isLeaf(data, rule.config.format === 1);
|
|
2434
|
-
if (rule.props) {
|
|
2435
|
-
rule.props.options = data;
|
|
2436
|
-
}
|
|
2437
|
-
else {
|
|
2438
|
-
(rule.props = {}).options = data;
|
|
2439
|
-
}
|
|
2440
|
-
});
|
|
2441
|
-
},
|
|
2442
|
-
});
|
|
2443
|
-
function getOption(config, data) {
|
|
2444
|
-
return config.fetch(data);
|
|
2445
|
-
}
|
|
2446
|
-
function isLeaf(data, value) {
|
|
2447
|
-
data.forEach((item) => {
|
|
2448
|
-
item.isLeaf = value;
|
|
2449
|
-
});
|
|
2450
|
-
return data;
|
|
2451
|
-
}
|
|
2452
2511
|
var materialType = {
|
|
2453
2512
|
name: 'materialType',
|
|
2454
2513
|
rule(data, extraConfig) {
|
|
2455
2514
|
return {
|
|
2456
|
-
type: '
|
|
2515
|
+
type: 'materialType',
|
|
2516
|
+
component: materialType$1,
|
|
2457
2517
|
field: data.field,
|
|
2458
2518
|
title: '素材类型',
|
|
2459
2519
|
validate: [
|
|
@@ -2465,38 +2525,22 @@ var materialType = {
|
|
|
2465
2525
|
},
|
|
2466
2526
|
],
|
|
2467
2527
|
props: {
|
|
2468
|
-
|
|
2528
|
+
value: data.value,
|
|
2469
2529
|
multiple: data.props.multiple,
|
|
2470
|
-
loadData(inject, selectedOptions) {
|
|
2471
|
-
const optionLength = selectedOptions.length;
|
|
2472
|
-
const targetOption = selectedOptions[optionLength - 1];
|
|
2473
|
-
targetOption.loading = true;
|
|
2474
|
-
getOption(extraConfig.materialType, {
|
|
2475
|
-
level: optionLength + 1,
|
|
2476
|
-
relationCode: targetOption.value,
|
|
2477
|
-
})
|
|
2478
|
-
.then((result) => {
|
|
2479
|
-
result = isLeaf(result, inject.self.config.format === optionLength + 1);
|
|
2480
|
-
targetOption.children = result;
|
|
2481
|
-
})
|
|
2482
|
-
.finally(() => {
|
|
2483
|
-
targetOption.loading = false;
|
|
2484
|
-
});
|
|
2485
|
-
},
|
|
2486
|
-
},
|
|
2487
|
-
config: {
|
|
2488
2530
|
format: data.config.format,
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
materialTypesOption: extraConfig.materialType,
|
|
2531
|
+
config: extraConfig.materialType,
|
|
2532
|
+
disabled: data.disabled,
|
|
2492
2533
|
},
|
|
2493
2534
|
inject: true,
|
|
2494
2535
|
on: {
|
|
2495
2536
|
change(inject, list) {
|
|
2496
2537
|
const rule = inject.self;
|
|
2497
2538
|
rule.value = list;
|
|
2539
|
+
rule.props.value = list;
|
|
2498
2540
|
vue.nextTick(() => {
|
|
2499
|
-
|
|
2541
|
+
setTimeout(() => {
|
|
2542
|
+
inject.api.validateField(rule.field);
|
|
2543
|
+
});
|
|
2500
2544
|
});
|
|
2501
2545
|
},
|
|
2502
2546
|
},
|
|
@@ -2505,7 +2549,8 @@ var materialType = {
|
|
|
2505
2549
|
},
|
|
2506
2550
|
rowRule(data, extraConfig) {
|
|
2507
2551
|
return {
|
|
2508
|
-
type: '
|
|
2552
|
+
type: 'materialType',
|
|
2553
|
+
component: materialType$1,
|
|
2509
2554
|
field: data.field,
|
|
2510
2555
|
title: '素材类型',
|
|
2511
2556
|
validate: [
|
|
@@ -2517,35 +2562,22 @@ var materialType = {
|
|
|
2517
2562
|
},
|
|
2518
2563
|
],
|
|
2519
2564
|
props: {
|
|
2520
|
-
|
|
2565
|
+
value: data.value,
|
|
2521
2566
|
multiple: data.props.multiple,
|
|
2522
|
-
loadData(inject, selectedOptions) {
|
|
2523
|
-
const optionLength = selectedOptions.length;
|
|
2524
|
-
const targetOption = selectedOptions[optionLength - 1];
|
|
2525
|
-
targetOption.loading = true;
|
|
2526
|
-
getOption(extraConfig.materialType, optionLength + 1)
|
|
2527
|
-
.then((result) => {
|
|
2528
|
-
result = isLeaf(result, inject.self.config.format === optionLength + 1);
|
|
2529
|
-
targetOption.children = result;
|
|
2530
|
-
})
|
|
2531
|
-
.finally(() => {
|
|
2532
|
-
targetOption.loading = false;
|
|
2533
|
-
});
|
|
2534
|
-
},
|
|
2535
|
-
},
|
|
2536
|
-
config: {
|
|
2537
2567
|
format: data.config.format,
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
materialTypesOption: extraConfig.materialType,
|
|
2568
|
+
config: extraConfig.materialType,
|
|
2569
|
+
disabled: data.disabled,
|
|
2541
2570
|
},
|
|
2542
2571
|
inject: true,
|
|
2543
2572
|
on: {
|
|
2544
2573
|
change(inject, list) {
|
|
2545
2574
|
const rule = inject.self;
|
|
2546
2575
|
rule.value = list;
|
|
2576
|
+
rule.props.value = list;
|
|
2547
2577
|
vue.nextTick(() => {
|
|
2548
|
-
|
|
2578
|
+
setTimeout(() => {
|
|
2579
|
+
inject.api.validateField(rule.field);
|
|
2580
|
+
});
|
|
2549
2581
|
});
|
|
2550
2582
|
},
|
|
2551
2583
|
},
|
|
@@ -2564,7 +2596,7 @@ var materialType = {
|
|
|
2564
2596
|
minWidth: '138px',
|
|
2565
2597
|
slots: {
|
|
2566
2598
|
default({ row }) {
|
|
2567
|
-
return vue.h(
|
|
2599
|
+
return vue.h(materialType$1, {
|
|
2568
2600
|
multiple: data.props.multiple,
|
|
2569
2601
|
format: data.config.format,
|
|
2570
2602
|
config: extraConfig.materialType,
|
|
@@ -2614,6 +2646,7 @@ var row = {
|
|
|
2614
2646
|
var department = {
|
|
2615
2647
|
name: 'department',
|
|
2616
2648
|
rule(data, extraConfig) {
|
|
2649
|
+
var _a;
|
|
2617
2650
|
return {
|
|
2618
2651
|
type: 'StaffSelector',
|
|
2619
2652
|
component: StaffSelector,
|
|
@@ -2631,6 +2664,7 @@ var department = {
|
|
|
2631
2664
|
return yield extraConfig.department.fetch();
|
|
2632
2665
|
});
|
|
2633
2666
|
},
|
|
2667
|
+
fieldNames: (_a = extraConfig.people) === null || _a === void 0 ? void 0 : _a.fieldNames,
|
|
2634
2668
|
},
|
|
2635
2669
|
effect: {
|
|
2636
2670
|
required: data.effect.required && '请选择',
|
|
@@ -2655,6 +2689,7 @@ var department = {
|
|
|
2655
2689
|
};
|
|
2656
2690
|
},
|
|
2657
2691
|
rowRule(data, extraConfig) {
|
|
2692
|
+
var _a;
|
|
2658
2693
|
return {
|
|
2659
2694
|
type: 'StaffSelector',
|
|
2660
2695
|
component: StaffSelector,
|
|
@@ -2672,6 +2707,7 @@ var department = {
|
|
|
2672
2707
|
return yield extraConfig.department.fetch();
|
|
2673
2708
|
});
|
|
2674
2709
|
},
|
|
2710
|
+
fieldNames: (_a = extraConfig.people) === null || _a === void 0 ? void 0 : _a.fieldNames,
|
|
2675
2711
|
},
|
|
2676
2712
|
effect: {
|
|
2677
2713
|
required: data.effect.required && '请选择',
|