bm-admin-ui 1.0.55-alpha → 1.0.57-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/float-table/index.d.ts +2 -2
- package/es/components/float-table/src/float-table.vue.d.ts +2 -2
- package/es/components/form-create/index.js +133 -100
- package/es/components/form-designer/index.js +11 -3
- package/es/components/staffs-selector/index.d.ts +2 -2
- package/es/components/staffs-selector/index.js +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/lib/components/float-table/index.d.ts +2 -2
- package/lib/components/float-table/src/float-table.vue.d.ts +2 -2
- package/lib/components/form-create/index.js +132 -99
- package/lib/components/form-designer/index.js +11 -3
- package/lib/components/staffs-selector/index.d.ts +2 -2
- package/lib/components/staffs-selector/index.js +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/package.json +1 -1
- package/types/components/float-table/index.d.ts +2 -2
- package/types/components/float-table/src/float-table.vue.d.ts +2 -2
- 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
|
@@ -42,9 +42,9 @@ declare const BmFloatTable: import("bm-admin-ui/es/utils/with-install").SFCWithI
|
|
|
42
42
|
gridOptions: import("vue").ComputedRef<any>;
|
|
43
43
|
gridEvents: import("vue").ComputedRef<any>;
|
|
44
44
|
pager: import("vue").ComputedRef<any>;
|
|
45
|
-
simpleImage: import("vue").Ref<(string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
45
|
+
simpleImage: import("vue").Ref<JSX.Element | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
46
46
|
[key: string]: any;
|
|
47
|
-
}> | null | undefined) |
|
|
47
|
+
}> | null | undefined) | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
48
48
|
[key: string]: any;
|
|
49
49
|
}> | null | undefined)[]>;
|
|
50
50
|
floatRefsId: import("vue").Ref<{}>;
|
|
@@ -42,9 +42,9 @@ declare const _default: {
|
|
|
42
42
|
gridOptions: import("vue").ComputedRef<any>;
|
|
43
43
|
gridEvents: import("vue").ComputedRef<any>;
|
|
44
44
|
pager: import("vue").ComputedRef<any>;
|
|
45
|
-
simpleImage: import("vue").Ref<(string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
45
|
+
simpleImage: import("vue").Ref<JSX.Element | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
46
46
|
[key: string]: any;
|
|
47
|
-
}> | null | undefined) |
|
|
47
|
+
}> | null | undefined) | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
48
48
|
[key: string]: any;
|
|
49
49
|
}> | null | undefined)[]>;
|
|
50
50
|
floatRefsId: import("vue").Ref<{}>;
|
|
@@ -6,7 +6,7 @@ import Picture from 'bm-admin-ui/es/components/upload';
|
|
|
6
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
|
-
import { cloneDeep, floor
|
|
9
|
+
import { debounce, cloneDeep, floor } from 'lodash-es';
|
|
10
10
|
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
|
11
11
|
import { isNull } from 'bm-admin-ui/es/utils/isNull';
|
|
12
12
|
|
|
@@ -1354,6 +1354,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1354
1354
|
);
|
|
1355
1355
|
const productInputSlots = reactive([]);
|
|
1356
1356
|
const formData = computed(() => props.formCreateInject.api.bind());
|
|
1357
|
+
const queryProductInfoDebounce = debounce(handlePressEnter, 500);
|
|
1357
1358
|
function isShow(key) {
|
|
1358
1359
|
return props.rule.config.tableAdvancedFeatures.includes(key);
|
|
1359
1360
|
}
|
|
@@ -1437,7 +1438,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1437
1438
|
default({ row }) {
|
|
1438
1439
|
if (item.value === "\u5546\u54C1\u56FE\u7247" && row[childField]) {
|
|
1439
1440
|
return h("img", {
|
|
1440
|
-
src:
|
|
1441
|
+
src: props.extraConfig.common.previewImg(row[childField]),
|
|
1441
1442
|
style: {
|
|
1442
1443
|
width: "86px",
|
|
1443
1444
|
height: "86px",
|
|
@@ -1489,7 +1490,11 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1489
1490
|
});
|
|
1490
1491
|
}
|
|
1491
1492
|
function handleImport() {
|
|
1492
|
-
|
|
1493
|
+
if (importDisabled()) {
|
|
1494
|
+
message.error("\u8BF7\u5148\u9009\u62E9\u5E97\u94FA\uFF01");
|
|
1495
|
+
} else {
|
|
1496
|
+
inputRef.value.click();
|
|
1497
|
+
}
|
|
1493
1498
|
}
|
|
1494
1499
|
function emitChange() {
|
|
1495
1500
|
emits("change", data);
|
|
@@ -1497,13 +1502,15 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1497
1502
|
async function queryProductInfo(rule, row) {
|
|
1498
1503
|
const field = rule.field;
|
|
1499
1504
|
const associatedFields = rule?.config?.associatedFields;
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1505
|
+
let result = void 0;
|
|
1506
|
+
if (row[field]) {
|
|
1507
|
+
result = await props.extraConfig.product.fetch({ productCode: row[field] });
|
|
1508
|
+
}
|
|
1509
|
+
if (associatedFields.length)
|
|
1510
|
+
associatedFields.forEach((item) => {
|
|
1511
|
+
row[field + item.value] = result ? result[productInfoKeyMap[item.value]] : void 0;
|
|
1512
|
+
});
|
|
1513
|
+
return result;
|
|
1507
1514
|
}
|
|
1508
1515
|
function handleChange(e) {
|
|
1509
1516
|
const file = e.target.files[0];
|
|
@@ -1629,11 +1636,33 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1629
1636
|
}
|
|
1630
1637
|
if (rule.name === "people" || rule.name === "department") {
|
|
1631
1638
|
const limit = rule.props.limit;
|
|
1632
|
-
value = value.split("\u3001")
|
|
1639
|
+
value = value.split("\u3001");
|
|
1633
1640
|
if (limit === 1 && value.length > limit) {
|
|
1634
1641
|
error = `${title}\u6700\u591A\u53EA\u80FD\u9009\u4E00\u4E2A`;
|
|
1635
1642
|
break;
|
|
1636
1643
|
}
|
|
1644
|
+
let infoExist = true;
|
|
1645
|
+
const result = [];
|
|
1646
|
+
const fieldNames = props.extraConfig[rule.name].fieldNames;
|
|
1647
|
+
for (const id of value) {
|
|
1648
|
+
const info = await props.extraConfig[rule.name].getInfo(id);
|
|
1649
|
+
if (info) {
|
|
1650
|
+
result.push({
|
|
1651
|
+
key: id,
|
|
1652
|
+
title: info.name,
|
|
1653
|
+
[fieldNames.value]: id,
|
|
1654
|
+
[fieldNames.label]: info.name
|
|
1655
|
+
});
|
|
1656
|
+
} else {
|
|
1657
|
+
infoExist = false;
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
if (!infoExist) {
|
|
1661
|
+
error = `${title}\u67E5\u8BE2\u7684\u4FE1\u606F\u4E0D\u5B58\u5728`;
|
|
1662
|
+
break;
|
|
1663
|
+
} else {
|
|
1664
|
+
value = result;
|
|
1665
|
+
}
|
|
1637
1666
|
}
|
|
1638
1667
|
if (rule.name === "product") {
|
|
1639
1668
|
const productInfo = await queryProductInfo(rule, row);
|
|
@@ -1670,6 +1699,12 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1670
1699
|
}
|
|
1671
1700
|
});
|
|
1672
1701
|
}
|
|
1702
|
+
function handleProductInputChange(rule, row) {
|
|
1703
|
+
queryProductInfoDebounce(rule, row);
|
|
1704
|
+
}
|
|
1705
|
+
function importDisabled() {
|
|
1706
|
+
return productInputSlots.filter((item) => item.config?.dataFiltering).some((item) => !formData.value[item.config.dataFiltering]);
|
|
1707
|
+
}
|
|
1673
1708
|
watch(
|
|
1674
1709
|
() => props.rule,
|
|
1675
1710
|
() => {
|
|
@@ -1791,8 +1826,9 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1791
1826
|
"onUpdate:value": ($event) => row[item.field] = $event,
|
|
1792
1827
|
placeholder: "\u8BF7\u8F93\u5165",
|
|
1793
1828
|
disabled: item.disabled || pruductInputDisabled(item.config?.dataFiltering),
|
|
1794
|
-
onPressEnter: ($event) => handlePressEnter(item, row)
|
|
1795
|
-
|
|
1829
|
+
onPressEnter: ($event) => handlePressEnter(item, row),
|
|
1830
|
+
onChange: ($event) => handleProductInputChange(item, row)
|
|
1831
|
+
}, null, 8, ["value", "onUpdate:value", "disabled", "onPressEnter", "onChange"])
|
|
1796
1832
|
])
|
|
1797
1833
|
};
|
|
1798
1834
|
})
|
|
@@ -1853,6 +1889,11 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
1853
1889
|
activePane2.tableRule = getTableRule(result);
|
|
1854
1890
|
});
|
|
1855
1891
|
}
|
|
1892
|
+
function handleSelectFromModel(tempId) {
|
|
1893
|
+
const activePane2 = getAcitvePane();
|
|
1894
|
+
delete activePane2.tableData;
|
|
1895
|
+
handleSelect(tempId);
|
|
1896
|
+
}
|
|
1856
1897
|
function getAcitvePane() {
|
|
1857
1898
|
return panes.find((pane) => pane.key === activeKey.value);
|
|
1858
1899
|
}
|
|
@@ -1913,36 +1954,42 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
1913
1954
|
4: (txt) => /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(txt)
|
|
1914
1955
|
};
|
|
1915
1956
|
const activePane2 = getAcitvePane();
|
|
1916
|
-
const childRules =
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1957
|
+
const childRules = [];
|
|
1958
|
+
if (preSetItems) {
|
|
1959
|
+
childRules.push(
|
|
1960
|
+
...preSetItems.split(",").map((preSetItem) => ({
|
|
1961
|
+
name: "product",
|
|
1962
|
+
title: {
|
|
1963
|
+
title: preSetItem
|
|
1964
|
+
},
|
|
1965
|
+
field: preSetItem,
|
|
1966
|
+
effect: {
|
|
1967
|
+
required: true
|
|
1968
|
+
},
|
|
1969
|
+
props: {
|
|
1970
|
+
placeholder: "\u8BF7\u8F93\u5165"
|
|
1971
|
+
},
|
|
1972
|
+
config: {
|
|
1973
|
+
associatedFields: coverageArr.filter((coverage) => {
|
|
1974
|
+
if (coverage.fieldType === 4) {
|
|
1975
|
+
const extraValues = JSON.parse(coverage.extraValues);
|
|
1976
|
+
return extraValues.fieldName === preSetItem;
|
|
1977
|
+
} else {
|
|
1978
|
+
return false;
|
|
1979
|
+
}
|
|
1980
|
+
}).map((coverage) => {
|
|
1981
|
+
const extraValues = JSON.parse(coverage.extraValues);
|
|
1982
|
+
return {
|
|
1983
|
+
value: extraValues.presetFieldName,
|
|
1984
|
+
label: extraValues.presetFieldName
|
|
1985
|
+
};
|
|
1986
|
+
})
|
|
1935
1987
|
}
|
|
1936
|
-
})
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
};
|
|
1942
|
-
})
|
|
1943
|
-
}
|
|
1944
|
-
})).concat(
|
|
1945
|
-
coverageArr.filter((coverage) => coverage.isEdit).map((coverage) => {
|
|
1988
|
+
}))
|
|
1989
|
+
);
|
|
1990
|
+
}
|
|
1991
|
+
childRules.push(
|
|
1992
|
+
...coverageArr.filter((coverage) => coverage.isEdit).map((coverage) => {
|
|
1946
1993
|
const extraValues = JSON.parse(coverage.extraValues);
|
|
1947
1994
|
const value = {
|
|
1948
1995
|
name: fieldTypeMap[coverage.fieldType],
|
|
@@ -2316,7 +2363,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
2316
2363
|
"main-shop-value": unref(mainShopValue),
|
|
2317
2364
|
"fetch-material-type": __props.extraConfig.materialTemp.fetchMaterialType,
|
|
2318
2365
|
"fetch-material-temp": __props.extraConfig.materialTemp.fetchMaterialTemp,
|
|
2319
|
-
onSelect:
|
|
2366
|
+
onSelect: handleSelectFromModel
|
|
2320
2367
|
}, null, 8, ["visible", "main-shop-value", "fetch-material-type", "fetch-material-temp"])
|
|
2321
2368
|
], 64);
|
|
2322
2369
|
};
|
|
@@ -2410,16 +2457,34 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
2410
2457
|
};
|
|
2411
2458
|
const unitMap = ["\u652F", "\u74F6", "\u5957", "\u7EC4", "\u7BB1", "\u4E2A", "\u5F20"];
|
|
2412
2459
|
const formData = computed(() => props.formCreateInject.api.bind());
|
|
2460
|
+
const debounceFn = debounce(handleBlur, 500);
|
|
2461
|
+
const inputValue = ref(props.defalutValue);
|
|
2413
2462
|
async function fetch(value) {
|
|
2414
|
-
productInfo.value = await props.extraConfig.product.fetch({
|
|
2463
|
+
return productInfo.value = await props.extraConfig.product.fetch({
|
|
2415
2464
|
productCode: value,
|
|
2416
2465
|
filterByShopcode: props.dataFiltering
|
|
2417
2466
|
}) || {};
|
|
2418
2467
|
}
|
|
2419
2468
|
function handleBlur(evt) {
|
|
2420
2469
|
const value = evt.target.value;
|
|
2421
|
-
|
|
2422
|
-
|
|
2470
|
+
if (value) {
|
|
2471
|
+
fetch(value).then((result) => {
|
|
2472
|
+
if (Object.keys(result).length) {
|
|
2473
|
+
emitChange(value);
|
|
2474
|
+
} else {
|
|
2475
|
+
emitChange("");
|
|
2476
|
+
inputValue.value = "";
|
|
2477
|
+
}
|
|
2478
|
+
}).catch(() => {
|
|
2479
|
+
emitChange("");
|
|
2480
|
+
inputValue.value = "";
|
|
2481
|
+
});
|
|
2482
|
+
} else {
|
|
2483
|
+
emitChange("");
|
|
2484
|
+
}
|
|
2485
|
+
}
|
|
2486
|
+
function handleChange(evt) {
|
|
2487
|
+
debounceFn(evt);
|
|
2423
2488
|
}
|
|
2424
2489
|
function getValue(value) {
|
|
2425
2490
|
return productInfo.value[productInfoKeyMap[value]];
|
|
@@ -2460,10 +2525,12 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
2460
2525
|
createVNode(unref(Col), { flex: 1 }, {
|
|
2461
2526
|
default: withCtx(() => [
|
|
2462
2527
|
createVNode(unref(Input), {
|
|
2528
|
+
value: inputValue.value,
|
|
2529
|
+
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
|
|
2463
2530
|
placeholder: "\u8BF7\u8F93\u5165",
|
|
2464
|
-
value: __props.defalutValue,
|
|
2465
2531
|
disabled: __props.disabled || inputDisbale(__props.dataFiltering),
|
|
2466
|
-
onPressEnter: handleBlur
|
|
2532
|
+
onPressEnter: handleBlur,
|
|
2533
|
+
onChange: handleChange
|
|
2467
2534
|
}, null, 8, ["value", "disabled"])
|
|
2468
2535
|
]),
|
|
2469
2536
|
_: 1
|
|
@@ -2740,45 +2807,27 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
2740
2807
|
const props = __props;
|
|
2741
2808
|
const options = ref([]);
|
|
2742
2809
|
function initOptions() {
|
|
2743
|
-
props.config.fetch(
|
|
2744
|
-
result
|
|
2745
|
-
item.isLeaf = props.format === 1;
|
|
2746
|
-
});
|
|
2810
|
+
props.config.fetch().then((result) => {
|
|
2811
|
+
processOptions(result, 1);
|
|
2747
2812
|
options.value = result;
|
|
2748
|
-
return options.value;
|
|
2749
|
-
}).then((options2) => {
|
|
2750
|
-
if (props.value?.length) {
|
|
2751
|
-
if (props.multiple) {
|
|
2752
|
-
props.value.forEach((item) => loadValueOptions(item, options2));
|
|
2753
|
-
} else {
|
|
2754
|
-
loadValueOptions(props.value, options2);
|
|
2755
|
-
}
|
|
2756
|
-
}
|
|
2757
2813
|
});
|
|
2758
2814
|
}
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
level
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
});
|
|
2770
|
-
if (result.length) {
|
|
2771
|
-
targetOption.children = result;
|
|
2772
|
-
} else {
|
|
2773
|
-
targetOption.isLeaf = true;
|
|
2815
|
+
function processOptions(options2, level) {
|
|
2816
|
+
options2.forEach((option) => {
|
|
2817
|
+
option.value = option[props.config.fieldNames.value];
|
|
2818
|
+
option.label = option[props.config.fieldNames.label];
|
|
2819
|
+
option.children = option[props.config.fieldNames.children];
|
|
2820
|
+
if (level === props.format) {
|
|
2821
|
+
delete option.children;
|
|
2822
|
+
}
|
|
2823
|
+
if (option.children?.length) {
|
|
2824
|
+
processOptions(option.children, level + 1);
|
|
2774
2825
|
}
|
|
2775
|
-
}).finally(() => {
|
|
2776
|
-
targetOption.loading = false;
|
|
2777
2826
|
});
|
|
2778
2827
|
}
|
|
2779
2828
|
function handleChange(value, selectedOptions) {
|
|
2780
2829
|
const result = cloneDeep(selectedOptions);
|
|
2781
|
-
processValue(result);
|
|
2830
|
+
result && processValue(result);
|
|
2782
2831
|
emits("change", result);
|
|
2783
2832
|
}
|
|
2784
2833
|
function processValue(selectedOptions) {
|
|
@@ -2804,23 +2853,6 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
2804
2853
|
return pre;
|
|
2805
2854
|
}, []);
|
|
2806
2855
|
}
|
|
2807
|
-
async function loadValueOptions(value, options2) {
|
|
2808
|
-
const selectedOptions = [];
|
|
2809
|
-
for (const option of value) {
|
|
2810
|
-
let cur;
|
|
2811
|
-
if (selectedOptions.length) {
|
|
2812
|
-
cur = selectedOptions[selectedOptions.length - 1].children.find(
|
|
2813
|
-
(item) => item.value === option.value
|
|
2814
|
-
);
|
|
2815
|
-
} else {
|
|
2816
|
-
cur = options2.find((item) => item.value === option.value);
|
|
2817
|
-
}
|
|
2818
|
-
if (!cur.isLeaf) {
|
|
2819
|
-
selectedOptions.push(cur);
|
|
2820
|
-
await loadData(selectedOptions);
|
|
2821
|
-
}
|
|
2822
|
-
}
|
|
2823
|
-
}
|
|
2824
2856
|
initOptions();
|
|
2825
2857
|
return (_ctx, _cache) => {
|
|
2826
2858
|
return openBlock(), createBlock(unref(Cascader), {
|
|
@@ -2828,7 +2860,6 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
2828
2860
|
placeholder: "\u8BF7\u8F93\u5165",
|
|
2829
2861
|
multiple: __props.multiple,
|
|
2830
2862
|
options: options.value,
|
|
2831
|
-
"load-data": loadData,
|
|
2832
2863
|
"change-on-select": "",
|
|
2833
2864
|
"get-popup-container": unref(getContainer),
|
|
2834
2865
|
onChange: handleChange
|
|
@@ -2867,6 +2898,7 @@ var materialType = {
|
|
|
2867
2898
|
const rule = inject.self;
|
|
2868
2899
|
rule.value = list;
|
|
2869
2900
|
rule.props.value = list;
|
|
2901
|
+
inject.api.emit('value-change', inject.api.bind());
|
|
2870
2902
|
nextTick(() => {
|
|
2871
2903
|
setTimeout(() => {
|
|
2872
2904
|
inject.api.validateField(rule.field);
|
|
@@ -2904,6 +2936,7 @@ var materialType = {
|
|
|
2904
2936
|
const rule = inject.self;
|
|
2905
2937
|
rule.value = list;
|
|
2906
2938
|
rule.props.value = list;
|
|
2939
|
+
inject.api.emit('value-change', inject.api.bind());
|
|
2907
2940
|
nextTick(() => {
|
|
2908
2941
|
setTimeout(() => {
|
|
2909
2942
|
inject.api.validateField(rule.field);
|
|
@@ -3123,7 +3156,7 @@ var table = {
|
|
|
3123
3156
|
change(inject, value) {
|
|
3124
3157
|
const rule = inject.self;
|
|
3125
3158
|
rule.value = value;
|
|
3126
|
-
inject.api.emit('
|
|
3159
|
+
inject.api.emit('value-change', inject.api.bind());
|
|
3127
3160
|
},
|
|
3128
3161
|
},
|
|
3129
3162
|
validate: [
|
|
@@ -3149,7 +3182,7 @@ var table = {
|
|
|
3149
3182
|
on: {
|
|
3150
3183
|
change(inject, value) {
|
|
3151
3184
|
inject.self.value = value;
|
|
3152
|
-
inject.api.emit('
|
|
3185
|
+
inject.api.emit('value-change', inject.api.bind());
|
|
3153
3186
|
},
|
|
3154
3187
|
},
|
|
3155
3188
|
validate: [
|
|
@@ -3481,7 +3514,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
3481
3514
|
option,
|
|
3482
3515
|
rule: rule.value,
|
|
3483
3516
|
"onUpdate:modelValue": handleValue,
|
|
3484
|
-
|
|
3517
|
+
onValueChange: handleValue
|
|
3485
3518
|
}, null, 8, ["api", "model-value", "rule"])
|
|
3486
3519
|
], 64);
|
|
3487
3520
|
};
|
|
@@ -1264,6 +1264,9 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
1264
1264
|
dateValue.value = date;
|
|
1265
1265
|
emitChange(date);
|
|
1266
1266
|
}
|
|
1267
|
+
function getPopupContainer() {
|
|
1268
|
+
return document.body;
|
|
1269
|
+
}
|
|
1267
1270
|
watch(format, () => {
|
|
1268
1271
|
handleDateChange("");
|
|
1269
1272
|
});
|
|
@@ -1309,6 +1312,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
1309
1312
|
picker: unref(extraProps).picker,
|
|
1310
1313
|
"show-time": unref(extraProps).showTime,
|
|
1311
1314
|
placeholder: "\u8BF7\u9009\u62E9",
|
|
1315
|
+
"get-popup-container": getPopupContainer,
|
|
1312
1316
|
onChange: handleDateChange
|
|
1313
1317
|
}, null, 8, ["value", "format", "value-format", "picker", "show-time"])) : createCommentVNode("v-if", true)
|
|
1314
1318
|
]),
|
|
@@ -4002,8 +4006,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4002
4006
|
if (newIndex >= 0) {
|
|
4003
4007
|
setActiveRule(parentList[newIndex]);
|
|
4004
4008
|
} else {
|
|
4005
|
-
|
|
4006
|
-
activeParentRule.value = widgetFormRules;
|
|
4009
|
+
resetActiveRule();
|
|
4007
4010
|
}
|
|
4008
4011
|
}
|
|
4009
4012
|
}
|
|
@@ -4152,6 +4155,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4152
4155
|
requiredRule.props.disabled = !!flowCondition[activeRule.value.field];
|
|
4153
4156
|
}
|
|
4154
4157
|
}
|
|
4158
|
+
function resetActiveRule() {
|
|
4159
|
+
activeRule.value = {};
|
|
4160
|
+
activeParentRule.value = widgetFormRules;
|
|
4161
|
+
}
|
|
4155
4162
|
watch(
|
|
4156
4163
|
() => props.formRules,
|
|
4157
4164
|
(formRules) => {
|
|
@@ -4179,7 +4186,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4179
4186
|
expose({
|
|
4180
4187
|
getFormRule,
|
|
4181
4188
|
getRule,
|
|
4182
|
-
validate
|
|
4189
|
+
validate,
|
|
4190
|
+
resetActiveRule
|
|
4183
4191
|
});
|
|
4184
4192
|
return (_ctx, _cache) => {
|
|
4185
4193
|
const _component_ACol = resolveComponent("ACol");
|
|
@@ -910,9 +910,9 @@ declare const BmStaffsSelector: import("bm-admin-ui/es/utils/with-install").SFCW
|
|
|
910
910
|
searchVal: import("vue").Ref<string>;
|
|
911
911
|
selectAll: import("vue").Ref<boolean>;
|
|
912
912
|
indeterminate: import("vue").Ref<boolean>;
|
|
913
|
-
emptyPic: import("vue").Ref<(string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
913
|
+
emptyPic: import("vue").Ref<JSX.Element | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
914
914
|
[key: string]: any;
|
|
915
|
-
}> | null | undefined) |
|
|
915
|
+
}> | null | undefined) | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
916
916
|
[key: string]: any;
|
|
917
917
|
}> | null | undefined)[]>;
|
|
918
918
|
isFulfill: import("vue").Ref<boolean>;
|
|
@@ -782,8 +782,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
782
782
|
function summitSelect() {
|
|
783
783
|
if (typeof selected.value === "string") {
|
|
784
784
|
let data = selectState.dataMap.get(String(selected.value));
|
|
785
|
-
emit("update:select", data);
|
|
786
|
-
emit("change", data);
|
|
785
|
+
emit("update:select", [data]);
|
|
786
|
+
emit("change", [data]);
|
|
787
787
|
} else if (props.mode === MODE.MULTIPLE) {
|
|
788
788
|
let arr = computeSelected.value.map((key) => findDataByKey(key));
|
|
789
789
|
emit("update:select", arr);
|
|
@@ -28,9 +28,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
28
28
|
searchVal: import("vue").Ref<string>;
|
|
29
29
|
selectAll: import("vue").Ref<boolean>;
|
|
30
30
|
indeterminate: import("vue").Ref<boolean>;
|
|
31
|
-
emptyPic: import("vue").Ref<(string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
31
|
+
emptyPic: import("vue").Ref<JSX.Element | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
32
32
|
[key: string]: any;
|
|
33
|
-
}> | null | undefined) |
|
|
33
|
+
}> | null | undefined) | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
34
34
|
[key: string]: any;
|
|
35
35
|
}> | null | undefined)[]>;
|
|
36
36
|
isFulfill: import("vue").Ref<boolean>;
|
|
@@ -910,9 +910,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
910
910
|
searchVal: import("vue").Ref<string>;
|
|
911
911
|
selectAll: import("vue").Ref<boolean>;
|
|
912
912
|
indeterminate: import("vue").Ref<boolean>;
|
|
913
|
-
emptyPic: import("vue").Ref<(string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
913
|
+
emptyPic: import("vue").Ref<JSX.Element | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
914
914
|
[key: string]: any;
|
|
915
|
-
}> | null | undefined) |
|
|
915
|
+
}> | null | undefined) | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
916
916
|
[key: string]: any;
|
|
917
917
|
}> | null | undefined)[]>;
|
|
918
918
|
isFulfill: import("vue").Ref<boolean>;
|
|
@@ -42,9 +42,9 @@ declare const BmFloatTable: import("bm-admin-ui/es/utils/with-install").SFCWithI
|
|
|
42
42
|
gridOptions: import("vue").ComputedRef<any>;
|
|
43
43
|
gridEvents: import("vue").ComputedRef<any>;
|
|
44
44
|
pager: import("vue").ComputedRef<any>;
|
|
45
|
-
simpleImage: import("vue").Ref<(string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
45
|
+
simpleImage: import("vue").Ref<JSX.Element | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
46
46
|
[key: string]: any;
|
|
47
|
-
}> | null | undefined) |
|
|
47
|
+
}> | null | undefined) | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
48
48
|
[key: string]: any;
|
|
49
49
|
}> | null | undefined)[]>;
|
|
50
50
|
floatRefsId: import("vue").Ref<{}>;
|
|
@@ -42,9 +42,9 @@ declare const _default: {
|
|
|
42
42
|
gridOptions: import("vue").ComputedRef<any>;
|
|
43
43
|
gridEvents: import("vue").ComputedRef<any>;
|
|
44
44
|
pager: import("vue").ComputedRef<any>;
|
|
45
|
-
simpleImage: import("vue").Ref<(string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
45
|
+
simpleImage: import("vue").Ref<JSX.Element | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
46
46
|
[key: string]: any;
|
|
47
|
-
}> | null | undefined) |
|
|
47
|
+
}> | null | undefined) | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
48
48
|
[key: string]: any;
|
|
49
49
|
}> | null | undefined)[]>;
|
|
50
50
|
floatRefsId: import("vue").Ref<{}>;
|
|
@@ -1365,6 +1365,7 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1365
1365
|
);
|
|
1366
1366
|
const productInputSlots = vue.reactive([]);
|
|
1367
1367
|
const formData = vue.computed(() => props.formCreateInject.api.bind());
|
|
1368
|
+
const queryProductInfoDebounce = lodashEs.debounce(handlePressEnter, 500);
|
|
1368
1369
|
function isShow(key) {
|
|
1369
1370
|
return props.rule.config.tableAdvancedFeatures.includes(key);
|
|
1370
1371
|
}
|
|
@@ -1448,7 +1449,7 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1448
1449
|
default({ row }) {
|
|
1449
1450
|
if (item.value === "\u5546\u54C1\u56FE\u7247" && row[childField]) {
|
|
1450
1451
|
return vue.h("img", {
|
|
1451
|
-
src:
|
|
1452
|
+
src: props.extraConfig.common.previewImg(row[childField]),
|
|
1452
1453
|
style: {
|
|
1453
1454
|
width: "86px",
|
|
1454
1455
|
height: "86px",
|
|
@@ -1500,7 +1501,11 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1500
1501
|
});
|
|
1501
1502
|
}
|
|
1502
1503
|
function handleImport() {
|
|
1503
|
-
|
|
1504
|
+
if (importDisabled()) {
|
|
1505
|
+
antDesignVue.message.error("\u8BF7\u5148\u9009\u62E9\u5E97\u94FA\uFF01");
|
|
1506
|
+
} else {
|
|
1507
|
+
inputRef.value.click();
|
|
1508
|
+
}
|
|
1504
1509
|
}
|
|
1505
1510
|
function emitChange() {
|
|
1506
1511
|
emits("change", data);
|
|
@@ -1508,13 +1513,15 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1508
1513
|
async function queryProductInfo(rule, row) {
|
|
1509
1514
|
const field = rule.field;
|
|
1510
1515
|
const associatedFields = rule?.config?.associatedFields;
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1516
|
+
let result = void 0;
|
|
1517
|
+
if (row[field]) {
|
|
1518
|
+
result = await props.extraConfig.product.fetch({ productCode: row[field] });
|
|
1519
|
+
}
|
|
1520
|
+
if (associatedFields.length)
|
|
1521
|
+
associatedFields.forEach((item) => {
|
|
1522
|
+
row[field + item.value] = result ? result[productInfoKeyMap[item.value]] : void 0;
|
|
1523
|
+
});
|
|
1524
|
+
return result;
|
|
1518
1525
|
}
|
|
1519
1526
|
function handleChange(e) {
|
|
1520
1527
|
const file = e.target.files[0];
|
|
@@ -1640,11 +1647,33 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1640
1647
|
}
|
|
1641
1648
|
if (rule.name === "people" || rule.name === "department") {
|
|
1642
1649
|
const limit = rule.props.limit;
|
|
1643
|
-
value = value.split("\u3001")
|
|
1650
|
+
value = value.split("\u3001");
|
|
1644
1651
|
if (limit === 1 && value.length > limit) {
|
|
1645
1652
|
error = `${title}\u6700\u591A\u53EA\u80FD\u9009\u4E00\u4E2A`;
|
|
1646
1653
|
break;
|
|
1647
1654
|
}
|
|
1655
|
+
let infoExist = true;
|
|
1656
|
+
const result = [];
|
|
1657
|
+
const fieldNames = props.extraConfig[rule.name].fieldNames;
|
|
1658
|
+
for (const id of value) {
|
|
1659
|
+
const info = await props.extraConfig[rule.name].getInfo(id);
|
|
1660
|
+
if (info) {
|
|
1661
|
+
result.push({
|
|
1662
|
+
key: id,
|
|
1663
|
+
title: info.name,
|
|
1664
|
+
[fieldNames.value]: id,
|
|
1665
|
+
[fieldNames.label]: info.name
|
|
1666
|
+
});
|
|
1667
|
+
} else {
|
|
1668
|
+
infoExist = false;
|
|
1669
|
+
}
|
|
1670
|
+
}
|
|
1671
|
+
if (!infoExist) {
|
|
1672
|
+
error = `${title}\u67E5\u8BE2\u7684\u4FE1\u606F\u4E0D\u5B58\u5728`;
|
|
1673
|
+
break;
|
|
1674
|
+
} else {
|
|
1675
|
+
value = result;
|
|
1676
|
+
}
|
|
1648
1677
|
}
|
|
1649
1678
|
if (rule.name === "product") {
|
|
1650
1679
|
const productInfo = await queryProductInfo(rule, row);
|
|
@@ -1681,6 +1710,12 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1681
1710
|
}
|
|
1682
1711
|
});
|
|
1683
1712
|
}
|
|
1713
|
+
function handleProductInputChange(rule, row) {
|
|
1714
|
+
queryProductInfoDebounce(rule, row);
|
|
1715
|
+
}
|
|
1716
|
+
function importDisabled() {
|
|
1717
|
+
return productInputSlots.filter((item) => item.config?.dataFiltering).some((item) => !formData.value[item.config.dataFiltering]);
|
|
1718
|
+
}
|
|
1684
1719
|
vue.watch(
|
|
1685
1720
|
() => props.rule,
|
|
1686
1721
|
() => {
|
|
@@ -1802,8 +1837,9 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1802
1837
|
"onUpdate:value": ($event) => row[item.field] = $event,
|
|
1803
1838
|
placeholder: "\u8BF7\u8F93\u5165",
|
|
1804
1839
|
disabled: item.disabled || pruductInputDisabled(item.config?.dataFiltering),
|
|
1805
|
-
onPressEnter: ($event) => handlePressEnter(item, row)
|
|
1806
|
-
|
|
1840
|
+
onPressEnter: ($event) => handlePressEnter(item, row),
|
|
1841
|
+
onChange: ($event) => handleProductInputChange(item, row)
|
|
1842
|
+
}, null, 8, ["value", "onUpdate:value", "disabled", "onPressEnter", "onChange"])
|
|
1807
1843
|
])
|
|
1808
1844
|
};
|
|
1809
1845
|
})
|
|
@@ -1864,6 +1900,11 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1864
1900
|
activePane2.tableRule = getTableRule(result);
|
|
1865
1901
|
});
|
|
1866
1902
|
}
|
|
1903
|
+
function handleSelectFromModel(tempId) {
|
|
1904
|
+
const activePane2 = getAcitvePane();
|
|
1905
|
+
delete activePane2.tableData;
|
|
1906
|
+
handleSelect(tempId);
|
|
1907
|
+
}
|
|
1867
1908
|
function getAcitvePane() {
|
|
1868
1909
|
return panes.find((pane) => pane.key === activeKey.value);
|
|
1869
1910
|
}
|
|
@@ -1924,36 +1965,42 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1924
1965
|
4: (txt) => /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(txt)
|
|
1925
1966
|
};
|
|
1926
1967
|
const activePane2 = getAcitvePane();
|
|
1927
|
-
const childRules =
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1968
|
+
const childRules = [];
|
|
1969
|
+
if (preSetItems) {
|
|
1970
|
+
childRules.push(
|
|
1971
|
+
...preSetItems.split(",").map((preSetItem) => ({
|
|
1972
|
+
name: "product",
|
|
1973
|
+
title: {
|
|
1974
|
+
title: preSetItem
|
|
1975
|
+
},
|
|
1976
|
+
field: preSetItem,
|
|
1977
|
+
effect: {
|
|
1978
|
+
required: true
|
|
1979
|
+
},
|
|
1980
|
+
props: {
|
|
1981
|
+
placeholder: "\u8BF7\u8F93\u5165"
|
|
1982
|
+
},
|
|
1983
|
+
config: {
|
|
1984
|
+
associatedFields: coverageArr.filter((coverage) => {
|
|
1985
|
+
if (coverage.fieldType === 4) {
|
|
1986
|
+
const extraValues = JSON.parse(coverage.extraValues);
|
|
1987
|
+
return extraValues.fieldName === preSetItem;
|
|
1988
|
+
} else {
|
|
1989
|
+
return false;
|
|
1990
|
+
}
|
|
1991
|
+
}).map((coverage) => {
|
|
1992
|
+
const extraValues = JSON.parse(coverage.extraValues);
|
|
1993
|
+
return {
|
|
1994
|
+
value: extraValues.presetFieldName,
|
|
1995
|
+
label: extraValues.presetFieldName
|
|
1996
|
+
};
|
|
1997
|
+
})
|
|
1946
1998
|
}
|
|
1947
|
-
})
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
};
|
|
1953
|
-
})
|
|
1954
|
-
}
|
|
1955
|
-
})).concat(
|
|
1956
|
-
coverageArr.filter((coverage) => coverage.isEdit).map((coverage) => {
|
|
1999
|
+
}))
|
|
2000
|
+
);
|
|
2001
|
+
}
|
|
2002
|
+
childRules.push(
|
|
2003
|
+
...coverageArr.filter((coverage) => coverage.isEdit).map((coverage) => {
|
|
1957
2004
|
const extraValues = JSON.parse(coverage.extraValues);
|
|
1958
2005
|
const value = {
|
|
1959
2006
|
name: fieldTypeMap[coverage.fieldType],
|
|
@@ -2327,7 +2374,7 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
2327
2374
|
"main-shop-value": vue.unref(mainShopValue),
|
|
2328
2375
|
"fetch-material-type": __props.extraConfig.materialTemp.fetchMaterialType,
|
|
2329
2376
|
"fetch-material-temp": __props.extraConfig.materialTemp.fetchMaterialTemp,
|
|
2330
|
-
onSelect:
|
|
2377
|
+
onSelect: handleSelectFromModel
|
|
2331
2378
|
}, null, 8, ["visible", "main-shop-value", "fetch-material-type", "fetch-material-temp"])
|
|
2332
2379
|
], 64);
|
|
2333
2380
|
};
|
|
@@ -2421,16 +2468,34 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
2421
2468
|
};
|
|
2422
2469
|
const unitMap = ["\u652F", "\u74F6", "\u5957", "\u7EC4", "\u7BB1", "\u4E2A", "\u5F20"];
|
|
2423
2470
|
const formData = vue.computed(() => props.formCreateInject.api.bind());
|
|
2471
|
+
const debounceFn = lodashEs.debounce(handleBlur, 500);
|
|
2472
|
+
const inputValue = vue.ref(props.defalutValue);
|
|
2424
2473
|
async function fetch(value) {
|
|
2425
|
-
productInfo.value = await props.extraConfig.product.fetch({
|
|
2474
|
+
return productInfo.value = await props.extraConfig.product.fetch({
|
|
2426
2475
|
productCode: value,
|
|
2427
2476
|
filterByShopcode: props.dataFiltering
|
|
2428
2477
|
}) || {};
|
|
2429
2478
|
}
|
|
2430
2479
|
function handleBlur(evt) {
|
|
2431
2480
|
const value = evt.target.value;
|
|
2432
|
-
|
|
2433
|
-
|
|
2481
|
+
if (value) {
|
|
2482
|
+
fetch(value).then((result) => {
|
|
2483
|
+
if (Object.keys(result).length) {
|
|
2484
|
+
emitChange(value);
|
|
2485
|
+
} else {
|
|
2486
|
+
emitChange("");
|
|
2487
|
+
inputValue.value = "";
|
|
2488
|
+
}
|
|
2489
|
+
}).catch(() => {
|
|
2490
|
+
emitChange("");
|
|
2491
|
+
inputValue.value = "";
|
|
2492
|
+
});
|
|
2493
|
+
} else {
|
|
2494
|
+
emitChange("");
|
|
2495
|
+
}
|
|
2496
|
+
}
|
|
2497
|
+
function handleChange(evt) {
|
|
2498
|
+
debounceFn(evt);
|
|
2434
2499
|
}
|
|
2435
2500
|
function getValue(value) {
|
|
2436
2501
|
return productInfo.value[productInfoKeyMap[value]];
|
|
@@ -2471,10 +2536,12 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
2471
2536
|
vue.createVNode(vue.unref(antDesignVue.Col), { flex: 1 }, {
|
|
2472
2537
|
default: vue.withCtx(() => [
|
|
2473
2538
|
vue.createVNode(vue.unref(antDesignVue.Input), {
|
|
2539
|
+
value: inputValue.value,
|
|
2540
|
+
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
|
|
2474
2541
|
placeholder: "\u8BF7\u8F93\u5165",
|
|
2475
|
-
value: __props.defalutValue,
|
|
2476
2542
|
disabled: __props.disabled || inputDisbale(__props.dataFiltering),
|
|
2477
|
-
onPressEnter: handleBlur
|
|
2543
|
+
onPressEnter: handleBlur,
|
|
2544
|
+
onChange: handleChange
|
|
2478
2545
|
}, null, 8, ["value", "disabled"])
|
|
2479
2546
|
]),
|
|
2480
2547
|
_: 1
|
|
@@ -2751,45 +2818,27 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
|
2751
2818
|
const props = __props;
|
|
2752
2819
|
const options = vue.ref([]);
|
|
2753
2820
|
function initOptions() {
|
|
2754
|
-
props.config.fetch(
|
|
2755
|
-
result
|
|
2756
|
-
item.isLeaf = props.format === 1;
|
|
2757
|
-
});
|
|
2821
|
+
props.config.fetch().then((result) => {
|
|
2822
|
+
processOptions(result, 1);
|
|
2758
2823
|
options.value = result;
|
|
2759
|
-
return options.value;
|
|
2760
|
-
}).then((options2) => {
|
|
2761
|
-
if (props.value?.length) {
|
|
2762
|
-
if (props.multiple) {
|
|
2763
|
-
props.value.forEach((item) => loadValueOptions(item, options2));
|
|
2764
|
-
} else {
|
|
2765
|
-
loadValueOptions(props.value, options2);
|
|
2766
|
-
}
|
|
2767
|
-
}
|
|
2768
2824
|
});
|
|
2769
2825
|
}
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
level
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
});
|
|
2781
|
-
if (result.length) {
|
|
2782
|
-
targetOption.children = result;
|
|
2783
|
-
} else {
|
|
2784
|
-
targetOption.isLeaf = true;
|
|
2826
|
+
function processOptions(options2, level) {
|
|
2827
|
+
options2.forEach((option) => {
|
|
2828
|
+
option.value = option[props.config.fieldNames.value];
|
|
2829
|
+
option.label = option[props.config.fieldNames.label];
|
|
2830
|
+
option.children = option[props.config.fieldNames.children];
|
|
2831
|
+
if (level === props.format) {
|
|
2832
|
+
delete option.children;
|
|
2833
|
+
}
|
|
2834
|
+
if (option.children?.length) {
|
|
2835
|
+
processOptions(option.children, level + 1);
|
|
2785
2836
|
}
|
|
2786
|
-
}).finally(() => {
|
|
2787
|
-
targetOption.loading = false;
|
|
2788
2837
|
});
|
|
2789
2838
|
}
|
|
2790
2839
|
function handleChange(value, selectedOptions) {
|
|
2791
2840
|
const result = lodashEs.cloneDeep(selectedOptions);
|
|
2792
|
-
processValue(result);
|
|
2841
|
+
result && processValue(result);
|
|
2793
2842
|
emits("change", result);
|
|
2794
2843
|
}
|
|
2795
2844
|
function processValue(selectedOptions) {
|
|
@@ -2815,23 +2864,6 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
|
2815
2864
|
return pre;
|
|
2816
2865
|
}, []);
|
|
2817
2866
|
}
|
|
2818
|
-
async function loadValueOptions(value, options2) {
|
|
2819
|
-
const selectedOptions = [];
|
|
2820
|
-
for (const option of value) {
|
|
2821
|
-
let cur;
|
|
2822
|
-
if (selectedOptions.length) {
|
|
2823
|
-
cur = selectedOptions[selectedOptions.length - 1].children.find(
|
|
2824
|
-
(item) => item.value === option.value
|
|
2825
|
-
);
|
|
2826
|
-
} else {
|
|
2827
|
-
cur = options2.find((item) => item.value === option.value);
|
|
2828
|
-
}
|
|
2829
|
-
if (!cur.isLeaf) {
|
|
2830
|
-
selectedOptions.push(cur);
|
|
2831
|
-
await loadData(selectedOptions);
|
|
2832
|
-
}
|
|
2833
|
-
}
|
|
2834
|
-
}
|
|
2835
2867
|
initOptions();
|
|
2836
2868
|
return (_ctx, _cache) => {
|
|
2837
2869
|
return vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Cascader), {
|
|
@@ -2839,7 +2871,6 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
|
2839
2871
|
placeholder: "\u8BF7\u8F93\u5165",
|
|
2840
2872
|
multiple: __props.multiple,
|
|
2841
2873
|
options: options.value,
|
|
2842
|
-
"load-data": loadData,
|
|
2843
2874
|
"change-on-select": "",
|
|
2844
2875
|
"get-popup-container": vue.unref(getContainer),
|
|
2845
2876
|
onChange: handleChange
|
|
@@ -2878,6 +2909,7 @@ var materialType = {
|
|
|
2878
2909
|
const rule = inject.self;
|
|
2879
2910
|
rule.value = list;
|
|
2880
2911
|
rule.props.value = list;
|
|
2912
|
+
inject.api.emit('value-change', inject.api.bind());
|
|
2881
2913
|
vue.nextTick(() => {
|
|
2882
2914
|
setTimeout(() => {
|
|
2883
2915
|
inject.api.validateField(rule.field);
|
|
@@ -2915,6 +2947,7 @@ var materialType = {
|
|
|
2915
2947
|
const rule = inject.self;
|
|
2916
2948
|
rule.value = list;
|
|
2917
2949
|
rule.props.value = list;
|
|
2950
|
+
inject.api.emit('value-change', inject.api.bind());
|
|
2918
2951
|
vue.nextTick(() => {
|
|
2919
2952
|
setTimeout(() => {
|
|
2920
2953
|
inject.api.validateField(rule.field);
|
|
@@ -3134,7 +3167,7 @@ var table = {
|
|
|
3134
3167
|
change(inject, value) {
|
|
3135
3168
|
const rule = inject.self;
|
|
3136
3169
|
rule.value = value;
|
|
3137
|
-
inject.api.emit('
|
|
3170
|
+
inject.api.emit('value-change', inject.api.bind());
|
|
3138
3171
|
},
|
|
3139
3172
|
},
|
|
3140
3173
|
validate: [
|
|
@@ -3160,7 +3193,7 @@ var table = {
|
|
|
3160
3193
|
on: {
|
|
3161
3194
|
change(inject, value) {
|
|
3162
3195
|
inject.self.value = value;
|
|
3163
|
-
inject.api.emit('
|
|
3196
|
+
inject.api.emit('value-change', inject.api.bind());
|
|
3164
3197
|
},
|
|
3165
3198
|
},
|
|
3166
3199
|
validate: [
|
|
@@ -3492,7 +3525,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
3492
3525
|
option,
|
|
3493
3526
|
rule: rule.value,
|
|
3494
3527
|
"onUpdate:modelValue": handleValue,
|
|
3495
|
-
|
|
3528
|
+
onValueChange: handleValue
|
|
3496
3529
|
}, null, 8, ["api", "model-value", "rule"])
|
|
3497
3530
|
], 64);
|
|
3498
3531
|
};
|
|
@@ -1274,6 +1274,9 @@ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
|
|
|
1274
1274
|
dateValue.value = date;
|
|
1275
1275
|
emitChange(date);
|
|
1276
1276
|
}
|
|
1277
|
+
function getPopupContainer() {
|
|
1278
|
+
return document.body;
|
|
1279
|
+
}
|
|
1277
1280
|
vue.watch(format, () => {
|
|
1278
1281
|
handleDateChange("");
|
|
1279
1282
|
});
|
|
@@ -1319,6 +1322,7 @@ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
|
|
|
1319
1322
|
picker: vue.unref(extraProps).picker,
|
|
1320
1323
|
"show-time": vue.unref(extraProps).showTime,
|
|
1321
1324
|
placeholder: "\u8BF7\u9009\u62E9",
|
|
1325
|
+
"get-popup-container": getPopupContainer,
|
|
1322
1326
|
onChange: handleDateChange
|
|
1323
1327
|
}, null, 8, ["value", "format", "value-format", "picker", "show-time"])) : vue.createCommentVNode("v-if", true)
|
|
1324
1328
|
]),
|
|
@@ -4012,8 +4016,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
4012
4016
|
if (newIndex >= 0) {
|
|
4013
4017
|
setActiveRule(parentList[newIndex]);
|
|
4014
4018
|
} else {
|
|
4015
|
-
|
|
4016
|
-
activeParentRule.value = widgetFormRules;
|
|
4019
|
+
resetActiveRule();
|
|
4017
4020
|
}
|
|
4018
4021
|
}
|
|
4019
4022
|
}
|
|
@@ -4162,6 +4165,10 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
4162
4165
|
requiredRule.props.disabled = !!flowCondition[activeRule.value.field];
|
|
4163
4166
|
}
|
|
4164
4167
|
}
|
|
4168
|
+
function resetActiveRule() {
|
|
4169
|
+
activeRule.value = {};
|
|
4170
|
+
activeParentRule.value = widgetFormRules;
|
|
4171
|
+
}
|
|
4165
4172
|
vue.watch(
|
|
4166
4173
|
() => props.formRules,
|
|
4167
4174
|
(formRules) => {
|
|
@@ -4189,7 +4196,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
4189
4196
|
expose({
|
|
4190
4197
|
getFormRule,
|
|
4191
4198
|
getRule,
|
|
4192
|
-
validate
|
|
4199
|
+
validate,
|
|
4200
|
+
resetActiveRule
|
|
4193
4201
|
});
|
|
4194
4202
|
return (_ctx, _cache) => {
|
|
4195
4203
|
const _component_ACol = vue.resolveComponent("ACol");
|
|
@@ -910,9 +910,9 @@ declare const BmStaffsSelector: import("bm-admin-ui/es/utils/with-install").SFCW
|
|
|
910
910
|
searchVal: import("vue").Ref<string>;
|
|
911
911
|
selectAll: import("vue").Ref<boolean>;
|
|
912
912
|
indeterminate: import("vue").Ref<boolean>;
|
|
913
|
-
emptyPic: import("vue").Ref<(string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
913
|
+
emptyPic: import("vue").Ref<JSX.Element | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
914
914
|
[key: string]: any;
|
|
915
|
-
}> | null | undefined) |
|
|
915
|
+
}> | null | undefined) | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
916
916
|
[key: string]: any;
|
|
917
917
|
}> | null | undefined)[]>;
|
|
918
918
|
isFulfill: import("vue").Ref<boolean>;
|
|
@@ -786,8 +786,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
786
786
|
function summitSelect() {
|
|
787
787
|
if (typeof selected.value === "string") {
|
|
788
788
|
let data = selectState.dataMap.get(String(selected.value));
|
|
789
|
-
emit("update:select", data);
|
|
790
|
-
emit("change", data);
|
|
789
|
+
emit("update:select", [data]);
|
|
790
|
+
emit("change", [data]);
|
|
791
791
|
} else if (props.mode === MODE.MULTIPLE) {
|
|
792
792
|
let arr = computeSelected.value.map((key) => findDataByKey(key));
|
|
793
793
|
emit("update:select", arr);
|
|
@@ -28,9 +28,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
28
28
|
searchVal: import("vue").Ref<string>;
|
|
29
29
|
selectAll: import("vue").Ref<boolean>;
|
|
30
30
|
indeterminate: import("vue").Ref<boolean>;
|
|
31
|
-
emptyPic: import("vue").Ref<(string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
31
|
+
emptyPic: import("vue").Ref<JSX.Element | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
32
32
|
[key: string]: any;
|
|
33
|
-
}> | null | undefined) |
|
|
33
|
+
}> | null | undefined) | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
34
34
|
[key: string]: any;
|
|
35
35
|
}> | null | undefined)[]>;
|
|
36
36
|
isFulfill: import("vue").Ref<boolean>;
|
|
@@ -910,9 +910,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
910
910
|
searchVal: import("vue").Ref<string>;
|
|
911
911
|
selectAll: import("vue").Ref<boolean>;
|
|
912
912
|
indeterminate: import("vue").Ref<boolean>;
|
|
913
|
-
emptyPic: import("vue").Ref<(string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
913
|
+
emptyPic: import("vue").Ref<JSX.Element | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
914
914
|
[key: string]: any;
|
|
915
|
-
}> | null | undefined) |
|
|
915
|
+
}> | null | undefined) | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
916
916
|
[key: string]: any;
|
|
917
917
|
}> | null | undefined)[]>;
|
|
918
918
|
isFulfill: import("vue").Ref<boolean>;
|
package/package.json
CHANGED
|
@@ -42,9 +42,9 @@ declare const BmFloatTable: import("bm-admin-ui/es/utils/with-install").SFCWithI
|
|
|
42
42
|
gridOptions: import("vue").ComputedRef<any>;
|
|
43
43
|
gridEvents: import("vue").ComputedRef<any>;
|
|
44
44
|
pager: import("vue").ComputedRef<any>;
|
|
45
|
-
simpleImage: import("vue").Ref<(string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
45
|
+
simpleImage: import("vue").Ref<JSX.Element | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
46
46
|
[key: string]: any;
|
|
47
|
-
}> | null | undefined) |
|
|
47
|
+
}> | null | undefined) | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
48
48
|
[key: string]: any;
|
|
49
49
|
}> | null | undefined)[]>;
|
|
50
50
|
floatRefsId: import("vue").Ref<{}>;
|
|
@@ -42,9 +42,9 @@ declare const _default: {
|
|
|
42
42
|
gridOptions: import("vue").ComputedRef<any>;
|
|
43
43
|
gridEvents: import("vue").ComputedRef<any>;
|
|
44
44
|
pager: import("vue").ComputedRef<any>;
|
|
45
|
-
simpleImage: import("vue").Ref<(string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
45
|
+
simpleImage: import("vue").Ref<JSX.Element | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
46
46
|
[key: string]: any;
|
|
47
|
-
}> | null | undefined) |
|
|
47
|
+
}> | null | undefined) | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
48
48
|
[key: string]: any;
|
|
49
49
|
}> | null | undefined)[]>;
|
|
50
50
|
floatRefsId: import("vue").Ref<{}>;
|
|
@@ -910,9 +910,9 @@ declare const BmStaffsSelector: import("bm-admin-ui/es/utils/with-install").SFCW
|
|
|
910
910
|
searchVal: import("vue").Ref<string>;
|
|
911
911
|
selectAll: import("vue").Ref<boolean>;
|
|
912
912
|
indeterminate: import("vue").Ref<boolean>;
|
|
913
|
-
emptyPic: import("vue").Ref<(string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
913
|
+
emptyPic: import("vue").Ref<JSX.Element | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
914
914
|
[key: string]: any;
|
|
915
|
-
}> | null | undefined) |
|
|
915
|
+
}> | null | undefined) | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
916
916
|
[key: string]: any;
|
|
917
917
|
}> | null | undefined)[]>;
|
|
918
918
|
isFulfill: import("vue").Ref<boolean>;
|
|
@@ -28,9 +28,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
28
28
|
searchVal: import("vue").Ref<string>;
|
|
29
29
|
selectAll: import("vue").Ref<boolean>;
|
|
30
30
|
indeterminate: import("vue").Ref<boolean>;
|
|
31
|
-
emptyPic: import("vue").Ref<(string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
31
|
+
emptyPic: import("vue").Ref<JSX.Element | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
32
32
|
[key: string]: any;
|
|
33
|
-
}> | null | undefined) |
|
|
33
|
+
}> | null | undefined) | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
34
34
|
[key: string]: any;
|
|
35
35
|
}> | null | undefined)[]>;
|
|
36
36
|
isFulfill: import("vue").Ref<boolean>;
|
|
@@ -910,9 +910,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
910
910
|
searchVal: import("vue").Ref<string>;
|
|
911
911
|
selectAll: import("vue").Ref<boolean>;
|
|
912
912
|
indeterminate: import("vue").Ref<boolean>;
|
|
913
|
-
emptyPic: import("vue").Ref<(string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
913
|
+
emptyPic: import("vue").Ref<JSX.Element | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
914
914
|
[key: string]: any;
|
|
915
|
-
}> | null | undefined) |
|
|
915
|
+
}> | null | undefined) | (string | number | boolean | void | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
916
916
|
[key: string]: any;
|
|
917
917
|
}> | null | undefined)[]>;
|
|
918
918
|
isFulfill: import("vue").Ref<boolean>;
|