bm-admin-ui 1.0.45-alpha → 1.0.46-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 +1 -1
- package/es/components/editor/src/editor.vue.d.ts +1 -1
- package/es/components/float-table/index.d.ts +1 -1
- package/es/components/float-table/index.js +22 -11
- package/es/components/float-table/src/float-table.vue.d.ts +1 -1
- package/es/components/form-create/index.js +86 -81
- package/es/components/form-designer/index.js +59 -67
- 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/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 +1 -1
- package/lib/components/editor/src/editor.vue.d.ts +1 -1
- package/lib/components/float-table/index.d.ts +1 -1
- package/lib/components/float-table/index.js +22 -11
- package/lib/components/float-table/src/float-table.vue.d.ts +1 -1
- package/lib/components/form-create/index.js +86 -82
- package/lib/components/form-designer/index.js +59 -67
- 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/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 +1 -1
- package/types/components/editor/src/editor.vue.d.ts +1 -1
- package/types/components/float-table/index.d.ts +1 -1
- package/types/components/float-table/src/float-table.vue.d.ts +1 -1
- 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/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
|
@@ -78,7 +78,7 @@ declare const BmButton: import("bm-admin-ui/es/utils/with-install").SFCWithInsta
|
|
|
78
78
|
onMousedown: {
|
|
79
79
|
type: import("vue").PropType<(event: MouseEvent) => void>;
|
|
80
80
|
};
|
|
81
|
-
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "
|
|
81
|
+
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "htmlType" | "loading" | "disabled" | "ghost" | "block" | "danger">;
|
|
82
82
|
$attrs: {
|
|
83
83
|
[x: string]: unknown;
|
|
84
84
|
};
|
|
@@ -80,7 +80,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
80
80
|
onMousedown: {
|
|
81
81
|
type: import("vue").PropType<(event: MouseEvent) => void>;
|
|
82
82
|
};
|
|
83
|
-
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "
|
|
83
|
+
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "htmlType" | "loading" | "disabled" | "ghost" | "block" | "danger">;
|
|
84
84
|
$attrs: {
|
|
85
85
|
[x: string]: unknown;
|
|
86
86
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -293,8 +293,8 @@ declare const BmEditor: import("bm-admin-ui/es/utils/with-install").SFCWithInsta
|
|
|
293
293
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
294
294
|
onGetCount?: ((...args: any[]) => any) | undefined;
|
|
295
295
|
}, {
|
|
296
|
-
value: string;
|
|
297
296
|
disabled: boolean;
|
|
297
|
+
value: string;
|
|
298
298
|
options: {
|
|
299
299
|
[key: string]: any;
|
|
300
300
|
};
|
|
@@ -293,8 +293,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
293
293
|
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
294
294
|
onGetCount?: ((...args: any[]) => any) | undefined;
|
|
295
295
|
}, {
|
|
296
|
-
value: string;
|
|
297
296
|
disabled: boolean;
|
|
297
|
+
value: string;
|
|
298
298
|
options: {
|
|
299
299
|
[key: string]: any;
|
|
300
300
|
};
|
|
@@ -58,7 +58,7 @@ declare const BmFloatTable: import("bm-admin-ui/es/utils/with-install").SFCWithI
|
|
|
58
58
|
}>;
|
|
59
59
|
trNodes: import("vue").Ref<any>;
|
|
60
60
|
isInScroll: import("vue").Ref<boolean>;
|
|
61
|
-
|
|
61
|
+
inMaxScrollX: import("vue").Ref<boolean>;
|
|
62
62
|
floatRow: import("vue").Ref<{}>;
|
|
63
63
|
floatRowIndex: import("vue").Ref<undefined>;
|
|
64
64
|
floatHandleDomCol: import("vue").Ref<any>;
|
|
@@ -45,6 +45,7 @@ const _sfc_main = {
|
|
|
45
45
|
"radioChange",
|
|
46
46
|
"checkboxChange",
|
|
47
47
|
"checkboxChangeAll",
|
|
48
|
+
"cellClick",
|
|
48
49
|
"pageChange",
|
|
49
50
|
"pageSizeChange"
|
|
50
51
|
],
|
|
@@ -76,7 +77,7 @@ const _sfc_main = {
|
|
|
76
77
|
reserve: false,
|
|
77
78
|
highlight: computed(function() {
|
|
78
79
|
return props.config.columns.some(function(item) {
|
|
79
|
-
return item.type === "checkbox"
|
|
80
|
+
return item.type === "checkbox";
|
|
80
81
|
});
|
|
81
82
|
}),
|
|
82
83
|
trigger: "row"
|
|
@@ -96,6 +97,16 @@ const _sfc_main = {
|
|
|
96
97
|
},
|
|
97
98
|
checkboxAll(val) {
|
|
98
99
|
emit("checkboxChangeAll", val);
|
|
100
|
+
},
|
|
101
|
+
cellClick(data) {
|
|
102
|
+
let { row, column } = data;
|
|
103
|
+
if (column.type === "checkbox" || column.type === "radio" || column.field === "action" || column.slots?.default === "floatHandle")
|
|
104
|
+
return;
|
|
105
|
+
else {
|
|
106
|
+
xGrid.value.clearCheckboxRow();
|
|
107
|
+
xGrid.value.setCheckboxRow(row, true);
|
|
108
|
+
emit("cellClick", data);
|
|
109
|
+
}
|
|
99
110
|
}
|
|
100
111
|
},
|
|
101
112
|
atVisible: false,
|
|
@@ -106,7 +117,7 @@ const _sfc_main = {
|
|
|
106
117
|
},
|
|
107
118
|
trNodes: [],
|
|
108
119
|
isInScroll: false,
|
|
109
|
-
|
|
120
|
+
inMaxScrollX: false,
|
|
110
121
|
floatRow: {},
|
|
111
122
|
floatRowIndex: void 0,
|
|
112
123
|
floatHandleDomCol: null
|
|
@@ -117,7 +128,7 @@ const _sfc_main = {
|
|
|
117
128
|
"bm-table",
|
|
118
129
|
`table-${props.size}`,
|
|
119
130
|
{
|
|
120
|
-
floatHandleTable: props.isNeedFloatHandle && (!state.atVisible || state.
|
|
131
|
+
floatHandleTable: props.isNeedFloatHandle && (!state.atVisible || state.inMaxScrollX) && state.floatHandleDomCol
|
|
121
132
|
}
|
|
122
133
|
];
|
|
123
134
|
});
|
|
@@ -131,14 +142,14 @@ const _sfc_main = {
|
|
|
131
142
|
const gridEvents = computed(() => {
|
|
132
143
|
let extraFn = {};
|
|
133
144
|
if (props.isNeedFloatHandle) {
|
|
134
|
-
let
|
|
145
|
+
let propsCellMouseenter = props.events.cellMouseenter;
|
|
135
146
|
extraFn.cellMouseenter = (e) => {
|
|
136
147
|
if (props.isNeedFloatHandle) {
|
|
137
148
|
if (state.isInScroll) {
|
|
138
149
|
state.isShowFloatHandle = false;
|
|
139
150
|
return;
|
|
140
151
|
}
|
|
141
|
-
if (state.
|
|
152
|
+
if (state.inMaxScrollX) {
|
|
142
153
|
state.isShowFloatHandle = false;
|
|
143
154
|
}
|
|
144
155
|
let rowid = e.rowid;
|
|
@@ -167,7 +178,7 @@ const _sfc_main = {
|
|
|
167
178
|
top,
|
|
168
179
|
height: clientHeight
|
|
169
180
|
};
|
|
170
|
-
if (!state.atVisible && !state.
|
|
181
|
+
if (!state.atVisible && !state.inMaxScrollX) {
|
|
171
182
|
state.isShowFloatHandle = true;
|
|
172
183
|
}
|
|
173
184
|
nextTick(() => {
|
|
@@ -178,23 +189,23 @@ const _sfc_main = {
|
|
|
178
189
|
});
|
|
179
190
|
}, 200);
|
|
180
191
|
}
|
|
181
|
-
|
|
192
|
+
propsCellMouseenter && propsCellMouseenter(e);
|
|
182
193
|
};
|
|
183
194
|
extraFn.scroll = (e) => {
|
|
184
|
-
let
|
|
195
|
+
let propsScroll = props.events.scroll;
|
|
185
196
|
if (e.isY && props.isNeedFloatHandle) {
|
|
186
197
|
methods.scrollNotShowFloat();
|
|
187
198
|
}
|
|
188
199
|
if (e.isX && props.isNeedFloatHandle && state.floatHandleDomCol && gridOptions.value.data && gridOptions.value.data.length > 0) {
|
|
189
200
|
if (e.scrollLeft + e.$event.target.clientWidth >= e.$event.target.scrollWidth - state.floatHandleDomCol.clientWidth) {
|
|
190
|
-
state.
|
|
201
|
+
state.inMaxScrollX = true;
|
|
191
202
|
state.isShowFloatHandle = false;
|
|
192
203
|
} else {
|
|
193
|
-
state.
|
|
204
|
+
state.inMaxScrollX = false;
|
|
194
205
|
state.isShowFloatHandle = true;
|
|
195
206
|
}
|
|
196
207
|
}
|
|
197
|
-
|
|
208
|
+
propsScroll && propsScroll(e);
|
|
198
209
|
};
|
|
199
210
|
extraFn.cellMouseleave = (e) => {
|
|
200
211
|
let propsCellMouseLeave = props.events.cellMouseleave;
|
|
@@ -58,7 +58,7 @@ declare const _default: {
|
|
|
58
58
|
}>;
|
|
59
59
|
trNodes: import("vue").Ref<any>;
|
|
60
60
|
isInScroll: import("vue").Ref<boolean>;
|
|
61
|
-
|
|
61
|
+
inMaxScrollX: import("vue").Ref<boolean>;
|
|
62
62
|
floatRow: import("vue").Ref<{}>;
|
|
63
63
|
floatRowIndex: import("vue").Ref<undefined>;
|
|
64
64
|
floatHandleDomCol: import("vue").Ref<any>;
|
|
@@ -7,7 +7,6 @@ import BmStaffsSelector from 'bm-admin-ui/es/components/staffs-selector';
|
|
|
7
7
|
import { BmTagsDisplay, BmFloatTable } from 'bm-admin-ui/es/components';
|
|
8
8
|
import { SearchOutlined, CheckCircleFilled, PlusOutlined } from '@ant-design/icons-vue';
|
|
9
9
|
import { cloneDeep, debounce, merge } from 'lodash-es';
|
|
10
|
-
import FC from '@form-create/ant-design-vue';
|
|
11
10
|
|
|
12
11
|
const fieldRatioMap = {
|
|
13
12
|
'25%': 6,
|
|
@@ -774,15 +773,27 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
774
773
|
"placeholder",
|
|
775
774
|
"defaultSelected",
|
|
776
775
|
"load",
|
|
777
|
-
"disabled"
|
|
776
|
+
"disabled",
|
|
777
|
+
"fieldNames"
|
|
778
778
|
],
|
|
779
779
|
emits: ["change"],
|
|
780
780
|
setup(__props, { emit: emits }) {
|
|
781
781
|
const props = __props;
|
|
782
|
+
const fieldNames = props.fieldNames || {
|
|
783
|
+
label: "name",
|
|
784
|
+
value: "code"
|
|
785
|
+
};
|
|
782
786
|
const selected = ref([]);
|
|
783
787
|
const visible = ref(false);
|
|
784
788
|
function selectedChange(val) {
|
|
785
|
-
emits(
|
|
789
|
+
emits(
|
|
790
|
+
"change",
|
|
791
|
+
val.map((item) => ({
|
|
792
|
+
[fieldNames.value]: item.key,
|
|
793
|
+
[fieldNames.label]: item.title,
|
|
794
|
+
...item
|
|
795
|
+
}))
|
|
796
|
+
);
|
|
786
797
|
}
|
|
787
798
|
function handleAdd() {
|
|
788
799
|
visible.value = true;
|
|
@@ -827,6 +838,7 @@ var StaffSelector = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__file", "staff-
|
|
|
827
838
|
var people = {
|
|
828
839
|
name: 'people',
|
|
829
840
|
rule(data, extraConfig) {
|
|
841
|
+
var _a;
|
|
830
842
|
return {
|
|
831
843
|
type: 'StaffSelector',
|
|
832
844
|
component: StaffSelector,
|
|
@@ -842,6 +854,7 @@ var people = {
|
|
|
842
854
|
return yield extraConfig.people.fetch(params);
|
|
843
855
|
});
|
|
844
856
|
},
|
|
857
|
+
fieldNames: (_a = extraConfig.people) === null || _a === void 0 ? void 0 : _a.fieldNames,
|
|
845
858
|
},
|
|
846
859
|
effect: {
|
|
847
860
|
required: data.effect.required && '请选择',
|
|
@@ -866,6 +879,7 @@ var people = {
|
|
|
866
879
|
};
|
|
867
880
|
},
|
|
868
881
|
rowRule(data, extraConfig) {
|
|
882
|
+
var _a;
|
|
869
883
|
return {
|
|
870
884
|
type: 'StaffSelector',
|
|
871
885
|
component: StaffSelector,
|
|
@@ -881,6 +895,7 @@ var people = {
|
|
|
881
895
|
return yield extraConfig.people.fetch(params);
|
|
882
896
|
});
|
|
883
897
|
},
|
|
898
|
+
fieldNames: (_a = extraConfig.people) === null || _a === void 0 ? void 0 : _a.fieldNames,
|
|
884
899
|
},
|
|
885
900
|
effect: {
|
|
886
901
|
required: data.effect.required && '请选择',
|
|
@@ -2227,7 +2242,11 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
2227
2242
|
emits: ["change"],
|
|
2228
2243
|
setup(__props, { emit: emits }) {
|
|
2229
2244
|
const props = __props;
|
|
2230
|
-
const
|
|
2245
|
+
const fieldNames = props.extraConfig.fieldNames || {
|
|
2246
|
+
label: "name",
|
|
2247
|
+
value: "code"
|
|
2248
|
+
};
|
|
2249
|
+
const value = ref(props.value?.[fieldNames.value]);
|
|
2231
2250
|
const options = ref([]);
|
|
2232
2251
|
const keyword = ref("");
|
|
2233
2252
|
const debounceFetch = debounce((value2) => {
|
|
@@ -2247,7 +2266,10 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
2247
2266
|
}
|
|
2248
2267
|
function handleChange(val, option) {
|
|
2249
2268
|
value.value = val;
|
|
2250
|
-
emits("change",
|
|
2269
|
+
emits("change", {
|
|
2270
|
+
[fieldNames.value]: option.value,
|
|
2271
|
+
[fieldNames.label]: option.label
|
|
2272
|
+
});
|
|
2251
2273
|
}
|
|
2252
2274
|
function handleSearch(value2) {
|
|
2253
2275
|
keyword.value = value2;
|
|
@@ -2366,7 +2388,7 @@ var shop = {
|
|
|
2366
2388
|
};
|
|
2367
2389
|
|
|
2368
2390
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
2369
|
-
__name: "material-type
|
|
2391
|
+
__name: "material-type",
|
|
2370
2392
|
props: ["config", "multiple", "format", "value"],
|
|
2371
2393
|
emits: ["change"],
|
|
2372
2394
|
setup(__props, { emit: emits }) {
|
|
@@ -2391,58 +2413,65 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
2391
2413
|
result.forEach((item) => {
|
|
2392
2414
|
item.isLeaf = props.format === optionLength + 1;
|
|
2393
2415
|
});
|
|
2394
|
-
|
|
2416
|
+
if (result.length) {
|
|
2417
|
+
targetOption.children = result;
|
|
2418
|
+
} else {
|
|
2419
|
+
targetOption.isLeaf = true;
|
|
2420
|
+
}
|
|
2395
2421
|
}).finally(() => {
|
|
2396
2422
|
targetOption.loading = false;
|
|
2397
2423
|
});
|
|
2398
2424
|
}
|
|
2399
|
-
function handleChange(
|
|
2400
|
-
|
|
2425
|
+
function handleChange(value, selectedOptions) {
|
|
2426
|
+
const result = cloneDeep(selectedOptions);
|
|
2427
|
+
processValue(result);
|
|
2428
|
+
emits("change", result);
|
|
2429
|
+
}
|
|
2430
|
+
function processValue(selectedOptions) {
|
|
2431
|
+
selectedOptions.forEach((item) => {
|
|
2432
|
+
if (Array.isArray(item))
|
|
2433
|
+
processValue(item);
|
|
2434
|
+
else {
|
|
2435
|
+
delete item.disabled;
|
|
2436
|
+
delete item.children;
|
|
2437
|
+
delete item.isLeaf;
|
|
2438
|
+
delete item.loading;
|
|
2439
|
+
}
|
|
2440
|
+
});
|
|
2441
|
+
}
|
|
2442
|
+
function formatValue(value) {
|
|
2443
|
+
value = value || [];
|
|
2444
|
+
return value.reduce((pre, cur) => {
|
|
2445
|
+
if (Array.isArray(cur)) {
|
|
2446
|
+
pre.push(cur.map((c) => c.value));
|
|
2447
|
+
} else {
|
|
2448
|
+
pre.push(cur.value);
|
|
2449
|
+
}
|
|
2450
|
+
return pre;
|
|
2451
|
+
}, []);
|
|
2401
2452
|
}
|
|
2402
2453
|
initOptions();
|
|
2403
2454
|
return (_ctx, _cache) => {
|
|
2404
2455
|
return openBlock(), createBlock(unref(Cascader), {
|
|
2405
|
-
value: __props.value,
|
|
2456
|
+
value: formatValue(__props.value),
|
|
2406
2457
|
placeholder: "\u8BF7\u8F93\u5165",
|
|
2407
2458
|
multiple: __props.multiple,
|
|
2408
2459
|
options: options.value,
|
|
2409
2460
|
"load-data": loadData,
|
|
2410
2461
|
"get-popup-container": unref(getContainer),
|
|
2411
|
-
|
|
2462
|
+
onChange: handleChange
|
|
2412
2463
|
}, null, 8, ["value", "multiple", "options", "get-popup-container"]);
|
|
2413
2464
|
};
|
|
2414
2465
|
}
|
|
2415
2466
|
});
|
|
2416
|
-
var
|
|
2467
|
+
var materialType$1 = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__file", "material-type.vue"]]);
|
|
2417
2468
|
|
|
2418
|
-
FC.register({
|
|
2419
|
-
name: 'materialTypesOption',
|
|
2420
|
-
init({ value }, rule) {
|
|
2421
|
-
getOption(value, { level: 1, relationCode: '' }).then((data) => {
|
|
2422
|
-
data = isLeaf(data, rule.config.format === 1);
|
|
2423
|
-
if (rule.props) {
|
|
2424
|
-
rule.props.options = data;
|
|
2425
|
-
}
|
|
2426
|
-
else {
|
|
2427
|
-
(rule.props = {}).options = data;
|
|
2428
|
-
}
|
|
2429
|
-
});
|
|
2430
|
-
},
|
|
2431
|
-
});
|
|
2432
|
-
function getOption(config, data) {
|
|
2433
|
-
return config.fetch(data);
|
|
2434
|
-
}
|
|
2435
|
-
function isLeaf(data, value) {
|
|
2436
|
-
data.forEach((item) => {
|
|
2437
|
-
item.isLeaf = value;
|
|
2438
|
-
});
|
|
2439
|
-
return data;
|
|
2440
|
-
}
|
|
2441
2469
|
var materialType = {
|
|
2442
2470
|
name: 'materialType',
|
|
2443
2471
|
rule(data, extraConfig) {
|
|
2444
2472
|
return {
|
|
2445
|
-
type: '
|
|
2473
|
+
type: 'materialType',
|
|
2474
|
+
component: materialType$1,
|
|
2446
2475
|
field: data.field,
|
|
2447
2476
|
title: '素材类型',
|
|
2448
2477
|
validate: [
|
|
@@ -2454,38 +2483,22 @@ var materialType = {
|
|
|
2454
2483
|
},
|
|
2455
2484
|
],
|
|
2456
2485
|
props: {
|
|
2457
|
-
|
|
2486
|
+
value: data.value,
|
|
2458
2487
|
multiple: data.props.multiple,
|
|
2459
|
-
loadData(inject, selectedOptions) {
|
|
2460
|
-
const optionLength = selectedOptions.length;
|
|
2461
|
-
const targetOption = selectedOptions[optionLength - 1];
|
|
2462
|
-
targetOption.loading = true;
|
|
2463
|
-
getOption(extraConfig.materialType, {
|
|
2464
|
-
level: optionLength + 1,
|
|
2465
|
-
relationCode: targetOption.value,
|
|
2466
|
-
})
|
|
2467
|
-
.then((result) => {
|
|
2468
|
-
result = isLeaf(result, inject.self.config.format === optionLength + 1);
|
|
2469
|
-
targetOption.children = result;
|
|
2470
|
-
})
|
|
2471
|
-
.finally(() => {
|
|
2472
|
-
targetOption.loading = false;
|
|
2473
|
-
});
|
|
2474
|
-
},
|
|
2475
|
-
},
|
|
2476
|
-
config: {
|
|
2477
2488
|
format: data.config.format,
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
materialTypesOption: extraConfig.materialType,
|
|
2489
|
+
config: extraConfig.materialType,
|
|
2490
|
+
disabled: data.disabled,
|
|
2481
2491
|
},
|
|
2482
2492
|
inject: true,
|
|
2483
2493
|
on: {
|
|
2484
2494
|
change(inject, list) {
|
|
2485
2495
|
const rule = inject.self;
|
|
2486
2496
|
rule.value = list;
|
|
2497
|
+
rule.props.value = list;
|
|
2487
2498
|
nextTick(() => {
|
|
2488
|
-
|
|
2499
|
+
setTimeout(() => {
|
|
2500
|
+
inject.api.validateField(rule.field);
|
|
2501
|
+
});
|
|
2489
2502
|
});
|
|
2490
2503
|
},
|
|
2491
2504
|
},
|
|
@@ -2494,7 +2507,8 @@ var materialType = {
|
|
|
2494
2507
|
},
|
|
2495
2508
|
rowRule(data, extraConfig) {
|
|
2496
2509
|
return {
|
|
2497
|
-
type: '
|
|
2510
|
+
type: 'materialType',
|
|
2511
|
+
component: materialType$1,
|
|
2498
2512
|
field: data.field,
|
|
2499
2513
|
title: '素材类型',
|
|
2500
2514
|
validate: [
|
|
@@ -2506,35 +2520,22 @@ var materialType = {
|
|
|
2506
2520
|
},
|
|
2507
2521
|
],
|
|
2508
2522
|
props: {
|
|
2509
|
-
|
|
2523
|
+
value: data.value,
|
|
2510
2524
|
multiple: data.props.multiple,
|
|
2511
|
-
loadData(inject, selectedOptions) {
|
|
2512
|
-
const optionLength = selectedOptions.length;
|
|
2513
|
-
const targetOption = selectedOptions[optionLength - 1];
|
|
2514
|
-
targetOption.loading = true;
|
|
2515
|
-
getOption(extraConfig.materialType, optionLength + 1)
|
|
2516
|
-
.then((result) => {
|
|
2517
|
-
result = isLeaf(result, inject.self.config.format === optionLength + 1);
|
|
2518
|
-
targetOption.children = result;
|
|
2519
|
-
})
|
|
2520
|
-
.finally(() => {
|
|
2521
|
-
targetOption.loading = false;
|
|
2522
|
-
});
|
|
2523
|
-
},
|
|
2524
|
-
},
|
|
2525
|
-
config: {
|
|
2526
2525
|
format: data.config.format,
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
materialTypesOption: extraConfig.materialType,
|
|
2526
|
+
config: extraConfig.materialType,
|
|
2527
|
+
disabled: data.disabled,
|
|
2530
2528
|
},
|
|
2531
2529
|
inject: true,
|
|
2532
2530
|
on: {
|
|
2533
2531
|
change(inject, list) {
|
|
2534
2532
|
const rule = inject.self;
|
|
2535
2533
|
rule.value = list;
|
|
2534
|
+
rule.props.value = list;
|
|
2536
2535
|
nextTick(() => {
|
|
2537
|
-
|
|
2536
|
+
setTimeout(() => {
|
|
2537
|
+
inject.api.validateField(rule.field);
|
|
2538
|
+
});
|
|
2538
2539
|
});
|
|
2539
2540
|
},
|
|
2540
2541
|
},
|
|
@@ -2553,7 +2554,7 @@ var materialType = {
|
|
|
2553
2554
|
minWidth: '138px',
|
|
2554
2555
|
slots: {
|
|
2555
2556
|
default({ row }) {
|
|
2556
|
-
return h(
|
|
2557
|
+
return h(materialType$1, {
|
|
2557
2558
|
multiple: data.props.multiple,
|
|
2558
2559
|
format: data.config.format,
|
|
2559
2560
|
config: extraConfig.materialType,
|
|
@@ -2603,6 +2604,7 @@ var row = {
|
|
|
2603
2604
|
var department = {
|
|
2604
2605
|
name: 'department',
|
|
2605
2606
|
rule(data, extraConfig) {
|
|
2607
|
+
var _a;
|
|
2606
2608
|
return {
|
|
2607
2609
|
type: 'StaffSelector',
|
|
2608
2610
|
component: StaffSelector,
|
|
@@ -2620,6 +2622,7 @@ var department = {
|
|
|
2620
2622
|
return yield extraConfig.department.fetch();
|
|
2621
2623
|
});
|
|
2622
2624
|
},
|
|
2625
|
+
fieldNames: (_a = extraConfig.people) === null || _a === void 0 ? void 0 : _a.fieldNames,
|
|
2623
2626
|
},
|
|
2624
2627
|
effect: {
|
|
2625
2628
|
required: data.effect.required && '请选择',
|
|
@@ -2644,6 +2647,7 @@ var department = {
|
|
|
2644
2647
|
};
|
|
2645
2648
|
},
|
|
2646
2649
|
rowRule(data, extraConfig) {
|
|
2650
|
+
var _a;
|
|
2647
2651
|
return {
|
|
2648
2652
|
type: 'StaffSelector',
|
|
2649
2653
|
component: StaffSelector,
|
|
@@ -2661,6 +2665,7 @@ var department = {
|
|
|
2661
2665
|
return yield extraConfig.department.fetch();
|
|
2662
2666
|
});
|
|
2663
2667
|
},
|
|
2668
|
+
fieldNames: (_a = extraConfig.people) === null || _a === void 0 ? void 0 : _a.fieldNames,
|
|
2664
2669
|
},
|
|
2665
2670
|
effect: {
|
|
2666
2671
|
required: data.effect.required && '请选择',
|