yc-pro-components 0.0.12 → 0.0.14
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/dialog/src/index.vue2.mjs +17 -4
- package/es/components/dialog-form/src/index.vue2.mjs +19 -5
- package/es/components/display-item/index.d.ts +42 -6
- package/es/components/display-item/src/index.vue.d.ts +42 -6
- package/es/components/drawer-form/src/index.vue2.mjs +15 -5
- package/es/components/form/src/form-content.vue.d.ts +42 -6
- package/es/components/form/src/index.vue2.mjs +15 -5
- package/es/components/form-item/index.d.ts +88 -16
- package/es/components/form-item/src/index.vue.d.ts +35 -4
- package/es/components/form-item/src/index.vue2.mjs +1 -0
- package/es/components/page/src/index.vue2.mjs +1 -1
- package/es/components/popover/src/index.vue2.mjs +15 -5
- package/es/components/render/index.d.ts +3 -3
- package/es/components/render/src/index.vue.d.ts +1 -1
- package/es/components/table/src/table-action-bar.vue2.mjs +1 -1
- package/es/components/table/src/table-column.vue.d.ts +42 -6
- package/es/components/yc-drawer/src/index.vue.mjs +1 -1
- package/es/components/yc-drawer/src/index.vue2.mjs +3 -1
- package/es/components/yc-plus-tree/src/index.vue.mjs +1 -1
- package/es/components/yc-plus-tree/src/index.vue2.mjs +16 -4
- package/es/components/yc-status-dialog/src/index.vue.mjs +1 -1
- package/es/components/yc-status-dialog/src/index.vue2.mjs +14 -4
- package/es/constants/dict.d.ts +78 -0
- package/es/constants/dict.mjs +3 -0
- package/es/constants/index.d.ts +1 -0
- package/es/constants/index.mjs +1 -0
- package/es/hooks/index.d.ts +1 -0
- package/es/hooks/index.mjs +1 -0
- package/es/hooks/useDictInjection.d.ts +38 -0
- package/es/hooks/useDictInjection.mjs +18 -0
- package/es/hooks/useGetOptions.mjs +118 -30
- package/es/index.css +4 -4
- package/es/index.d.ts +1 -1
- package/es/index.mjs +2 -0
- package/es/types/plus.d.ts +74 -0
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/yc-components/index.d.ts +1 -1
- package/es/yc-components/version.d.ts +1 -1
- package/index.css +65 -53
- package/index.js +276 -95
- package/index.min.css +4 -4
- package/index.min.js +7 -7
- package/index.min.mjs +7 -7
- package/index.mjs +276 -97
- package/lib/components/dialog/src/index.vue2.js +17 -4
- package/lib/components/dialog-form/src/index.vue2.js +19 -5
- package/lib/components/display-item/index.d.ts +42 -6
- package/lib/components/display-item/src/index.vue.d.ts +42 -6
- package/lib/components/drawer-form/src/index.vue2.js +15 -5
- package/lib/components/form/src/form-content.vue.d.ts +42 -6
- package/lib/components/form/src/index.vue2.js +15 -5
- package/lib/components/form-item/index.d.ts +88 -16
- package/lib/components/form-item/src/index.vue.d.ts +35 -4
- package/lib/components/form-item/src/index.vue2.js +1 -0
- package/lib/components/page/src/index.vue2.js +1 -1
- package/lib/components/popover/src/index.vue2.js +14 -4
- package/lib/components/render/index.d.ts +3 -3
- package/lib/components/render/src/index.vue.d.ts +1 -1
- package/lib/components/table/src/table-action-bar.vue2.js +1 -1
- package/lib/components/table/src/table-column.vue.d.ts +42 -6
- package/lib/components/yc-drawer/src/index.vue.js +1 -1
- package/lib/components/yc-drawer/src/index.vue2.js +3 -1
- package/lib/components/yc-plus-tree/src/index.vue.js +1 -1
- package/lib/components/yc-plus-tree/src/index.vue2.js +16 -4
- package/lib/components/yc-status-dialog/src/index.vue.js +1 -1
- package/lib/components/yc-status-dialog/src/index.vue2.js +13 -3
- package/lib/constants/dict.d.ts +78 -0
- package/lib/constants/dict.js +5 -0
- package/lib/constants/index.d.ts +1 -0
- package/lib/constants/index.js +2 -0
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/index.js +2 -0
- package/lib/hooks/useDictInjection.d.ts +38 -0
- package/lib/hooks/useDictInjection.js +20 -0
- package/lib/hooks/useGetOptions.js +117 -29
- package/lib/index.css +4 -4
- package/lib/index.d.ts +1 -1
- package/lib/index.js +4 -0
- package/lib/types/plus.d.ts +74 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/yc-components/index.d.ts +1 -1
- package/lib/yc-components/version.d.ts +1 -1
- package/locale/en.js +1 -1
- package/locale/en.min.js +1 -1
- package/locale/en.min.mjs +1 -1
- package/locale/en.mjs +1 -1
- package/locale/ja.js +1 -1
- package/locale/ja.min.js +1 -1
- package/locale/ja.min.mjs +1 -1
- package/locale/ja.mjs +1 -1
- package/locale/ko.js +1 -1
- package/locale/ko.min.js +1 -1
- package/locale/ko.min.mjs +1 -1
- package/locale/ko.mjs +1 -1
- package/locale/zh-cn.js +1 -1
- package/locale/zh-cn.min.js +1 -1
- package/locale/zh-cn.min.mjs +1 -1
- package/locale/zh-cn.mjs +1 -1
- package/locale/zh-tw.js +1 -1
- package/locale/zh-tw.min.js +1 -1
- package/locale/zh-tw.min.mjs +1 -1
- package/locale/zh-tw.mjs +1 -1
- package/package.json +1 -1
- package/es/components/dialog-form/index.d.ts +0 -1142
- package/es/components/dialog-form/src/index.vue.d.ts +0 -481
- package/es/components/drawer-form/index.d.ts +0 -3455
- package/es/components/drawer-form/src/index.vue.d.ts +0 -1242
- package/es/components/form/index.d.ts +0 -1645
- package/es/components/form/src/index.vue.d.ts +0 -628
- package/es/components/page/index.d.ts +0 -15194
- package/es/components/page/src/index.vue.d.ts +0 -5234
- package/es/components/search/index.d.ts +0 -4430
- package/es/components/search/src/index.vue.d.ts +0 -1503
- package/es/components/yc-plus-page/src/index.vue.d.ts +0 -12672
- package/es/hooks/usePlusFormReset.d.ts +0 -9853
- package/lib/components/dialog-form/index.d.ts +0 -1142
- package/lib/components/dialog-form/src/index.vue.d.ts +0 -481
- package/lib/components/drawer-form/index.d.ts +0 -3455
- package/lib/components/drawer-form/src/index.vue.d.ts +0 -1242
- package/lib/components/form/index.d.ts +0 -1645
- package/lib/components/form/src/index.vue.d.ts +0 -628
- package/lib/components/page/index.d.ts +0 -15194
- package/lib/components/page/src/index.vue.d.ts +0 -5234
- package/lib/components/search/index.d.ts +0 -4430
- package/lib/components/search/src/index.vue.d.ts +0 -1503
- package/lib/components/yc-plus-page/src/index.vue.d.ts +0 -12672
- package/lib/hooks/usePlusFormReset.d.ts +0 -9853
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! yc-pro-components v0.0.
|
|
1
|
+
/*! yc-pro-components v0.0.14 */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('element-plus')) :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(['exports', 'vue', 'element-plus'], factory) :
|
|
@@ -14,8 +14,6 @@
|
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
const version$2 = "2.6.3";
|
|
18
|
-
|
|
19
17
|
/** Detect free variable `global` from Node.js. */
|
|
20
18
|
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
|
|
21
19
|
|
|
@@ -4643,6 +4641,8 @@
|
|
|
4643
4641
|
return object == null ? object : baseSet(object, path, value);
|
|
4644
4642
|
}
|
|
4645
4643
|
|
|
4644
|
+
const version$2 = "2.6.3";
|
|
4645
|
+
|
|
4646
4646
|
const objectToString = Object.prototype.toString;
|
|
4647
4647
|
const toTypeString = (value) => objectToString.call(value);
|
|
4648
4648
|
const toRawType = (value) => {
|
|
@@ -4770,6 +4770,36 @@
|
|
|
4770
4770
|
return data;
|
|
4771
4771
|
};
|
|
4772
4772
|
|
|
4773
|
+
const DefaultPageSizeList = [10, 20, 30, 40, 50, 100, 200, 300, 400, 500];
|
|
4774
|
+
const DefaultPageInfo = {
|
|
4775
|
+
page: 1,
|
|
4776
|
+
pageSize: 10
|
|
4777
|
+
};
|
|
4778
|
+
|
|
4779
|
+
const TableFormRefInjectionKey = Symbol("tableFormRefInjectionKey");
|
|
4780
|
+
const TableFormFieldRefInjectionKey = Symbol("tableFormFieldRefInjectionKey");
|
|
4781
|
+
const TableFormRowInfoInjectionKey = Symbol("tableFormRowInfoInjectionKey");
|
|
4782
|
+
const DatePickerValueIsArrayList = ["datetimerange", "daterange", "monthrange"];
|
|
4783
|
+
const ValueIsNumberList = ["rate", "input-number", "slider"];
|
|
4784
|
+
const ValueIsBooleanList = ["switch"];
|
|
4785
|
+
const ValueIsArrayList = [
|
|
4786
|
+
"checkbox",
|
|
4787
|
+
"cascader",
|
|
4788
|
+
"plus-date-picker",
|
|
4789
|
+
"plus-input-tag",
|
|
4790
|
+
"transfer"
|
|
4791
|
+
];
|
|
4792
|
+
|
|
4793
|
+
const selectValueTypeList = [
|
|
4794
|
+
"select",
|
|
4795
|
+
"radio",
|
|
4796
|
+
"checkbox",
|
|
4797
|
+
"select-v2",
|
|
4798
|
+
"plus-radio"
|
|
4799
|
+
];
|
|
4800
|
+
|
|
4801
|
+
const DictStoreInjectionKey = Symbol("DictStore");
|
|
4802
|
+
|
|
4773
4803
|
const throwError = (data) => {
|
|
4774
4804
|
if (!isArray(data)) {
|
|
4775
4805
|
console.error("Uncaught TypeError: ", `options expected Array but got ${toRawType(data)}`);
|
|
@@ -4796,27 +4826,53 @@
|
|
|
4796
4826
|
const useGetOptions = (props) => {
|
|
4797
4827
|
const options = vue.ref([]);
|
|
4798
4828
|
const optionsIsReady = vue.ref(false);
|
|
4799
|
-
|
|
4829
|
+
const injectedDictStore = vue.inject(DictStoreInjectionKey, null);
|
|
4830
|
+
const hasValidOptions = props.options && (!isArray(props.options) || props.options.length > 0);
|
|
4831
|
+
if (hasValidOptions) {
|
|
4832
|
+
handleOptions();
|
|
4833
|
+
} else if (props.autoDict) {
|
|
4834
|
+
handleAutoDict();
|
|
4835
|
+
} else {
|
|
4800
4836
|
options.value = [];
|
|
4801
4837
|
optionsIsReady.value = true;
|
|
4802
|
-
}
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
4838
|
+
}
|
|
4839
|
+
function handleOptions() {
|
|
4840
|
+
if (!props.options) {
|
|
4841
|
+
options.value = [];
|
|
4842
|
+
optionsIsReady.value = true;
|
|
4843
|
+
return;
|
|
4844
|
+
}
|
|
4845
|
+
if (vue.isRef(props.options) || vue.isReactive(props.options) || isArray(props.options)) {
|
|
4846
|
+
vue.watch(
|
|
4847
|
+
() => props.options,
|
|
4848
|
+
(val) => {
|
|
4849
|
+
const value = vue.isRef(val) ? val.value : val;
|
|
4850
|
+
options.value = getOptionsByOptionsMap(value, props);
|
|
4851
|
+
optionsIsReady.value = true;
|
|
4852
|
+
},
|
|
4853
|
+
{
|
|
4854
|
+
immediate: true,
|
|
4855
|
+
deep: true
|
|
4856
|
+
}
|
|
4857
|
+
);
|
|
4858
|
+
} else if (isFunction(props.options)) {
|
|
4859
|
+
const getValue = props.options;
|
|
4860
|
+
const result = getValue(props);
|
|
4861
|
+
if (isPromise(result)) {
|
|
4862
|
+
result.then((value) => {
|
|
4863
|
+
options.value = getOptionsByOptionsMap(value, props);
|
|
4864
|
+
optionsIsReady.value = true;
|
|
4865
|
+
throwError(options.value);
|
|
4866
|
+
}).catch((err) => {
|
|
4867
|
+
throw err;
|
|
4868
|
+
});
|
|
4869
|
+
} else {
|
|
4870
|
+
options.value = getOptionsByOptionsMap(result, props);
|
|
4808
4871
|
optionsIsReady.value = true;
|
|
4809
|
-
},
|
|
4810
|
-
{
|
|
4811
|
-
immediate: true,
|
|
4812
|
-
deep: true
|
|
4813
4872
|
}
|
|
4814
|
-
)
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
const result = getValue(props);
|
|
4818
|
-
if (isPromise(result)) {
|
|
4819
|
-
result.then((value) => {
|
|
4873
|
+
} else if (isPromise(props.options)) {
|
|
4874
|
+
const getValue = props.options;
|
|
4875
|
+
getValue.then((value) => {
|
|
4820
4876
|
options.value = getOptionsByOptionsMap(value, props);
|
|
4821
4877
|
optionsIsReady.value = true;
|
|
4822
4878
|
throwError(options.value);
|
|
@@ -4824,21 +4880,82 @@
|
|
|
4824
4880
|
throw err;
|
|
4825
4881
|
});
|
|
4826
4882
|
} else {
|
|
4827
|
-
options.value = getOptionsByOptionsMap(result, props);
|
|
4828
4883
|
optionsIsReady.value = true;
|
|
4884
|
+
throwError(props.options);
|
|
4829
4885
|
}
|
|
4830
|
-
}
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
4886
|
+
}
|
|
4887
|
+
function handleAutoDict() {
|
|
4888
|
+
if (isFunction(props.autoDict)) {
|
|
4889
|
+
const autoDictFn = props.autoDict;
|
|
4890
|
+
vue.watch(
|
|
4891
|
+
() => {
|
|
4892
|
+
return autoDictFn(props);
|
|
4893
|
+
},
|
|
4894
|
+
(result) => {
|
|
4895
|
+
if (isPromise(result)) {
|
|
4896
|
+
result.then((value) => {
|
|
4897
|
+
options.value = getOptionsByOptionsMap(value, props);
|
|
4898
|
+
optionsIsReady.value = true;
|
|
4899
|
+
}).catch((err) => {
|
|
4900
|
+
console.error("[yc-components] autoDict function error:", err);
|
|
4901
|
+
options.value = [];
|
|
4902
|
+
optionsIsReady.value = true;
|
|
4903
|
+
});
|
|
4904
|
+
} else {
|
|
4905
|
+
options.value = getOptionsByOptionsMap(result, props);
|
|
4906
|
+
optionsIsReady.value = true;
|
|
4907
|
+
}
|
|
4908
|
+
},
|
|
4909
|
+
{ immediate: true }
|
|
4910
|
+
);
|
|
4911
|
+
} else if (typeof props.autoDict === "object" && props.autoDict !== null) {
|
|
4912
|
+
const { store, method = "getDictData", transform, dictCode } = props.autoDict;
|
|
4913
|
+
const dictStore = store || injectedDictStore;
|
|
4914
|
+
const fieldOrCode = dictCode || props.prop;
|
|
4915
|
+
if (dictStore && isFunction(dictStore[method])) {
|
|
4916
|
+
vue.watch(
|
|
4917
|
+
() => dictStore[method](fieldOrCode),
|
|
4918
|
+
(val) => {
|
|
4919
|
+
try {
|
|
4920
|
+
const data = transform && isFunction(transform) ? transform(val) : val;
|
|
4921
|
+
options.value = getOptionsByOptionsMap(data, props);
|
|
4922
|
+
optionsIsReady.value = true;
|
|
4923
|
+
} catch (err) {
|
|
4924
|
+
console.error("[yc-components] autoDict transform error:", err);
|
|
4925
|
+
options.value = [];
|
|
4926
|
+
optionsIsReady.value = true;
|
|
4927
|
+
}
|
|
4928
|
+
},
|
|
4929
|
+
{ immediate: true }
|
|
4930
|
+
);
|
|
4931
|
+
} else {
|
|
4932
|
+
console.warn(
|
|
4933
|
+
`[yc-components] autoDict: DictStore or method "${method}" not found for field "${fieldOrCode}"`
|
|
4934
|
+
);
|
|
4935
|
+
options.value = [];
|
|
4936
|
+
optionsIsReady.value = true;
|
|
4937
|
+
}
|
|
4938
|
+
} else if (props.autoDict === true) {
|
|
4939
|
+
if (injectedDictStore && isFunction(injectedDictStore.getDictData)) {
|
|
4940
|
+
vue.watch(
|
|
4941
|
+
() => injectedDictStore.getDictData(props.prop),
|
|
4942
|
+
(val) => {
|
|
4943
|
+
options.value = getOptionsByOptionsMap(val, props);
|
|
4944
|
+
optionsIsReady.value = true;
|
|
4945
|
+
},
|
|
4946
|
+
{ immediate: true }
|
|
4947
|
+
);
|
|
4948
|
+
} else {
|
|
4949
|
+
console.warn(
|
|
4950
|
+
`[yc-components] autoDict: DictStore not provided via inject for field "${props.prop}". Please use useDictInjection() in parent component.`
|
|
4951
|
+
);
|
|
4952
|
+
options.value = [];
|
|
4953
|
+
optionsIsReady.value = true;
|
|
4954
|
+
}
|
|
4955
|
+
} else {
|
|
4956
|
+
options.value = [];
|
|
4834
4957
|
optionsIsReady.value = true;
|
|
4835
|
-
|
|
4836
|
-
}).catch((err) => {
|
|
4837
|
-
throw err;
|
|
4838
|
-
});
|
|
4839
|
-
} else {
|
|
4840
|
-
optionsIsReady.value = true;
|
|
4841
|
-
throwError(props.options);
|
|
4958
|
+
}
|
|
4842
4959
|
}
|
|
4843
4960
|
return { customOptions: options, customOptionsIsReady: optionsIsReady };
|
|
4844
4961
|
};
|
|
@@ -4937,34 +5054,6 @@
|
|
|
4937
5054
|
}));
|
|
4938
5055
|
};
|
|
4939
5056
|
|
|
4940
|
-
const DefaultPageSizeList = [10, 20, 30, 40, 50, 100, 200, 300, 400, 500];
|
|
4941
|
-
const DefaultPageInfo = {
|
|
4942
|
-
page: 1,
|
|
4943
|
-
pageSize: 10
|
|
4944
|
-
};
|
|
4945
|
-
|
|
4946
|
-
const TableFormRefInjectionKey = Symbol("tableFormRefInjectionKey");
|
|
4947
|
-
const TableFormFieldRefInjectionKey = Symbol("tableFormFieldRefInjectionKey");
|
|
4948
|
-
const TableFormRowInfoInjectionKey = Symbol("tableFormRowInfoInjectionKey");
|
|
4949
|
-
const DatePickerValueIsArrayList = ["datetimerange", "daterange", "monthrange"];
|
|
4950
|
-
const ValueIsNumberList = ["rate", "input-number", "slider"];
|
|
4951
|
-
const ValueIsBooleanList = ["switch"];
|
|
4952
|
-
const ValueIsArrayList = [
|
|
4953
|
-
"checkbox",
|
|
4954
|
-
"cascader",
|
|
4955
|
-
"plus-date-picker",
|
|
4956
|
-
"plus-input-tag",
|
|
4957
|
-
"transfer"
|
|
4958
|
-
];
|
|
4959
|
-
|
|
4960
|
-
const selectValueTypeList = [
|
|
4961
|
-
"select",
|
|
4962
|
-
"radio",
|
|
4963
|
-
"checkbox",
|
|
4964
|
-
"select-v2",
|
|
4965
|
-
"plus-radio"
|
|
4966
|
-
];
|
|
4967
|
-
|
|
4968
5057
|
function useTable(_pageInfo) {
|
|
4969
5058
|
const defaultPageInfo = vue.unref(_pageInfo) || DefaultPageInfo;
|
|
4970
5059
|
const tableData = vue.ref([]);
|
|
@@ -8485,6 +8574,20 @@
|
|
|
8485
8574
|
};
|
|
8486
8575
|
}
|
|
8487
8576
|
|
|
8577
|
+
function useDictInjection(dictStore) {
|
|
8578
|
+
if (!dictStore) {
|
|
8579
|
+
console.warn("[yc-components] useDictInjection: dictStore is required");
|
|
8580
|
+
return;
|
|
8581
|
+
}
|
|
8582
|
+
if (typeof dictStore.getDictData !== "function") {
|
|
8583
|
+
console.error(
|
|
8584
|
+
"[yc-components] useDictInjection: dictStore must implement getDictData method. Please ensure your dictStore implements DictStoreInterface."
|
|
8585
|
+
);
|
|
8586
|
+
return;
|
|
8587
|
+
}
|
|
8588
|
+
vue.provide(DictStoreInjectionKey, dictStore);
|
|
8589
|
+
}
|
|
8590
|
+
|
|
8488
8591
|
const _hoisted_1$q = { class: "plus-dialog-body" };
|
|
8489
8592
|
var _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
|
|
8490
8593
|
...{
|
|
@@ -8515,9 +8618,21 @@
|
|
|
8515
8618
|
vue.watchEffect(() => {
|
|
8516
8619
|
subVisible.value = props.modelValue;
|
|
8517
8620
|
});
|
|
8518
|
-
const
|
|
8621
|
+
const isSubmitting = vue.ref(false);
|
|
8622
|
+
const computedLoading = vue.computed(() => props.confirmLoading || isSubmitting.value);
|
|
8623
|
+
const doConfirm = () => {
|
|
8624
|
+
isSubmitting.value = true;
|
|
8519
8625
|
emit("confirm");
|
|
8626
|
+
setTimeout(() => {
|
|
8627
|
+
isSubmitting.value = false;
|
|
8628
|
+
}, 300);
|
|
8520
8629
|
};
|
|
8630
|
+
const handleConfirm = debounce(doConfirm, 300, {
|
|
8631
|
+
leading: true,
|
|
8632
|
+
// 立即执行第一次
|
|
8633
|
+
trailing: false
|
|
8634
|
+
// 不执行最后一次
|
|
8635
|
+
});
|
|
8521
8636
|
const handleCancel = () => {
|
|
8522
8637
|
emit("update:modelValue", false);
|
|
8523
8638
|
emit("cancel");
|
|
@@ -8574,8 +8689,8 @@
|
|
|
8574
8689
|
}),
|
|
8575
8690
|
vue.createVNode(vue.unref(elementPlus.ElButton), {
|
|
8576
8691
|
type: "primary",
|
|
8577
|
-
loading:
|
|
8578
|
-
onClick: handleConfirm
|
|
8692
|
+
loading: computedLoading.value,
|
|
8693
|
+
onClick: vue.unref(handleConfirm)
|
|
8579
8694
|
}, {
|
|
8580
8695
|
default: vue.withCtx(() => [
|
|
8581
8696
|
vue.createTextVNode(
|
|
@@ -8586,7 +8701,7 @@
|
|
|
8586
8701
|
]),
|
|
8587
8702
|
_: 1
|
|
8588
8703
|
/* STABLE */
|
|
8589
|
-
}, 8, ["loading"])
|
|
8704
|
+
}, 8, ["loading", "onClick"])
|
|
8590
8705
|
])
|
|
8591
8706
|
],
|
|
8592
8707
|
4
|
|
@@ -15782,6 +15897,7 @@
|
|
|
15782
15897
|
fieldChildrenSlot: { type: Function, default: void 0 },
|
|
15783
15898
|
renderErrorMessage: { type: Function, default: void 0 },
|
|
15784
15899
|
optionsMap: { default: void 0 },
|
|
15900
|
+
autoDict: { type: [Boolean, Function, Object], default: void 0 },
|
|
15785
15901
|
index: { default: 0 },
|
|
15786
15902
|
clearable: { type: Boolean, default: true }
|
|
15787
15903
|
},
|
|
@@ -16681,8 +16797,11 @@
|
|
|
16681
16797
|
var _a;
|
|
16682
16798
|
(_a = formInstance.value) == null ? void 0 : _a.clearValidate();
|
|
16683
16799
|
};
|
|
16684
|
-
const
|
|
16800
|
+
const isSubmitting = vue.ref(false);
|
|
16801
|
+
const computedLoading = vue.computed(() => props.submitLoading || isSubmitting.value);
|
|
16802
|
+
const doSubmit = async () => {
|
|
16685
16803
|
var _a, _b, _c;
|
|
16804
|
+
isSubmitting.value = true;
|
|
16686
16805
|
try {
|
|
16687
16806
|
const valid = await ((_a = formInstance.value) == null ? void 0 : _a.validate());
|
|
16688
16807
|
if (valid) {
|
|
@@ -16700,6 +16819,12 @@
|
|
|
16700
16819
|
}
|
|
16701
16820
|
return false;
|
|
16702
16821
|
};
|
|
16822
|
+
const handleSubmit = debounce(doSubmit, 300, {
|
|
16823
|
+
leading: true,
|
|
16824
|
+
// 立即执行第一次
|
|
16825
|
+
trailing: false
|
|
16826
|
+
// 不执行最后一次
|
|
16827
|
+
});
|
|
16703
16828
|
const handleReset = () => {
|
|
16704
16829
|
clearValidate();
|
|
16705
16830
|
values.value = { ...props.defaultValues };
|
|
@@ -16848,7 +16973,7 @@
|
|
|
16848
16973
|
style: vue.normalizeStyle(style.value)
|
|
16849
16974
|
},
|
|
16850
16975
|
[
|
|
16851
|
-
vue.renderSlot(_ctx.$slots, "footer", vue.normalizeProps(vue.guardReactiveProps({ handleReset, handleSubmit })), () => [
|
|
16976
|
+
vue.renderSlot(_ctx.$slots, "footer", vue.normalizeProps(vue.guardReactiveProps({ handleReset, handleSubmit: vue.unref(handleSubmit) })), () => [
|
|
16852
16977
|
_ctx.hasReset ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElButton), {
|
|
16853
16978
|
key: 0,
|
|
16854
16979
|
onClick: handleReset
|
|
@@ -16866,8 +16991,8 @@
|
|
|
16866
16991
|
})) : vue.createCommentVNode("v-if", true),
|
|
16867
16992
|
vue.createVNode(vue.unref(elementPlus.ElButton), {
|
|
16868
16993
|
type: "primary",
|
|
16869
|
-
loading:
|
|
16870
|
-
onClick: handleSubmit
|
|
16994
|
+
loading: computedLoading.value,
|
|
16995
|
+
onClick: vue.unref(handleSubmit)
|
|
16871
16996
|
}, {
|
|
16872
16997
|
default: vue.withCtx(() => [
|
|
16873
16998
|
vue.createCommentVNode(" \u63D0\u4EA4 "),
|
|
@@ -16879,7 +17004,7 @@
|
|
|
16879
17004
|
]),
|
|
16880
17005
|
_: 1
|
|
16881
17006
|
/* STABLE */
|
|
16882
|
-
}, 8, ["loading"])
|
|
17007
|
+
}, 8, ["loading", "onClick"])
|
|
16883
17008
|
])
|
|
16884
17009
|
],
|
|
16885
17010
|
4
|
|
@@ -17983,10 +18108,19 @@
|
|
|
17983
18108
|
subVisible.value = false;
|
|
17984
18109
|
emit("cancel");
|
|
17985
18110
|
};
|
|
17986
|
-
const
|
|
18111
|
+
const isSubmitting = vue.ref(false);
|
|
18112
|
+
const computedLoading = vue.computed(() => props.confirmLoading || isSubmitting.value);
|
|
18113
|
+
const doConfirm = () => {
|
|
18114
|
+
isSubmitting.value = true;
|
|
17987
18115
|
subVisible.value = false;
|
|
17988
18116
|
emit("confirm");
|
|
17989
18117
|
};
|
|
18118
|
+
const handleConfirmPopover = debounce(doConfirm, 300, {
|
|
18119
|
+
leading: true,
|
|
18120
|
+
// 立即执行第一次
|
|
18121
|
+
trailing: false
|
|
18122
|
+
// 不执行最后一次
|
|
18123
|
+
});
|
|
17990
18124
|
return (_ctx, _cache) => {
|
|
17991
18125
|
return vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElPopover), vue.mergeProps({
|
|
17992
18126
|
visible: subVisible.value,
|
|
@@ -18018,8 +18152,8 @@
|
|
|
18018
18152
|
vue.createVNode(vue.unref(elementPlus.ElButton), {
|
|
18019
18153
|
size: "small",
|
|
18020
18154
|
type: "primary",
|
|
18021
|
-
loading:
|
|
18022
|
-
onClick: handleConfirmPopover
|
|
18155
|
+
loading: computedLoading.value,
|
|
18156
|
+
onClick: vue.unref(handleConfirmPopover)
|
|
18023
18157
|
}, {
|
|
18024
18158
|
default: vue.withCtx(() => [
|
|
18025
18159
|
vue.createTextVNode(
|
|
@@ -18030,7 +18164,7 @@
|
|
|
18030
18164
|
]),
|
|
18031
18165
|
_: 1
|
|
18032
18166
|
/* STABLE */
|
|
18033
|
-
}, 8, ["loading"])
|
|
18167
|
+
}, 8, ["loading", "onClick"])
|
|
18034
18168
|
])) : vue.createCommentVNode("v-if", true)
|
|
18035
18169
|
]),
|
|
18036
18170
|
_: 3
|
|
@@ -19467,8 +19601,10 @@
|
|
|
19467
19601
|
emit("update:modelValue", values);
|
|
19468
19602
|
emit("change", values, column);
|
|
19469
19603
|
};
|
|
19470
|
-
const
|
|
19604
|
+
const isSubmitting = vue.ref(false);
|
|
19605
|
+
const doConfirm = async () => {
|
|
19471
19606
|
var _a, _b, _c;
|
|
19607
|
+
isSubmitting.value = true;
|
|
19472
19608
|
try {
|
|
19473
19609
|
const valid = await ((_a = computedFormInstance.value) == null ? void 0 : _a.validate());
|
|
19474
19610
|
if (valid) {
|
|
@@ -19482,8 +19618,18 @@
|
|
|
19482
19618
|
elementPlus.ElMessage.warning(message || t("plus.form.errorTip"));
|
|
19483
19619
|
}
|
|
19484
19620
|
emit("confirmError", errors);
|
|
19621
|
+
} finally {
|
|
19622
|
+
setTimeout(() => {
|
|
19623
|
+
isSubmitting.value = false;
|
|
19624
|
+
}, 300);
|
|
19485
19625
|
}
|
|
19486
19626
|
};
|
|
19627
|
+
const handleConfirm = debounce(doConfirm, 300, {
|
|
19628
|
+
leading: true,
|
|
19629
|
+
// 立即执行第一次
|
|
19630
|
+
trailing: false
|
|
19631
|
+
// 不执行最后一次
|
|
19632
|
+
});
|
|
19487
19633
|
const handleCancel = () => {
|
|
19488
19634
|
subVisible.value = false;
|
|
19489
19635
|
emit("update:visible", subVisible.value);
|
|
@@ -19505,11 +19651,12 @@
|
|
|
19505
19651
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => subVisible.value = $event),
|
|
19506
19652
|
width: "800px",
|
|
19507
19653
|
top: "10vh",
|
|
19508
|
-
title: vue.unref(t)("plus.dialogForm.title")
|
|
19654
|
+
title: vue.unref(t)("plus.dialogForm.title"),
|
|
19655
|
+
"confirm-loading": isSubmitting.value
|
|
19509
19656
|
}, _ctx.dialog, {
|
|
19510
19657
|
onClose: handleClose,
|
|
19511
19658
|
onCancel: handleCancel,
|
|
19512
|
-
onConfirm: handleConfirm
|
|
19659
|
+
onConfirm: vue.unref(handleConfirm)
|
|
19513
19660
|
}), vue.createSlots({
|
|
19514
19661
|
default: vue.withCtx(() => [
|
|
19515
19662
|
vue.createVNode(vue.unref(PlusForm), vue.mergeProps({
|
|
@@ -19560,11 +19707,11 @@
|
|
|
19560
19707
|
_ctx.$slots["dialog-footer"] ? {
|
|
19561
19708
|
name: "footer",
|
|
19562
19709
|
fn: vue.withCtx(() => [
|
|
19563
|
-
vue.renderSlot(_ctx.$slots, "dialog-footer", vue.normalizeProps(vue.guardReactiveProps({ handleConfirm, handleCancel })))
|
|
19710
|
+
vue.renderSlot(_ctx.$slots, "dialog-footer", vue.normalizeProps(vue.guardReactiveProps({ handleConfirm: vue.unref(handleConfirm), handleCancel })))
|
|
19564
19711
|
]),
|
|
19565
19712
|
key: "1"
|
|
19566
19713
|
} : void 0
|
|
19567
|
-
]), 1040, ["modelValue", "title"]);
|
|
19714
|
+
]), 1040, ["modelValue", "title", "confirm-loading", "onConfirm"]);
|
|
19568
19715
|
};
|
|
19569
19716
|
}
|
|
19570
19717
|
});
|
|
@@ -19626,8 +19773,11 @@
|
|
|
19626
19773
|
emit("update:modelValue", values);
|
|
19627
19774
|
emit("change", values, column);
|
|
19628
19775
|
};
|
|
19629
|
-
const
|
|
19776
|
+
const isSubmitting = vue.ref(false);
|
|
19777
|
+
const computedLoading = vue.computed(() => props.confirmLoading || isSubmitting.value);
|
|
19778
|
+
const doConfirm = async () => {
|
|
19630
19779
|
var _a, _b, _c;
|
|
19780
|
+
isSubmitting.value = true;
|
|
19631
19781
|
try {
|
|
19632
19782
|
const valid = await ((_a = computedFormInstance.value) == null ? void 0 : _a.validate());
|
|
19633
19783
|
if (valid) {
|
|
@@ -19643,6 +19793,12 @@
|
|
|
19643
19793
|
emit("confirmError", errors);
|
|
19644
19794
|
}
|
|
19645
19795
|
};
|
|
19796
|
+
const handleConfirm = debounce(doConfirm, 300, {
|
|
19797
|
+
leading: true,
|
|
19798
|
+
// 立即执行第一次
|
|
19799
|
+
trailing: false
|
|
19800
|
+
// 不执行最后一次
|
|
19801
|
+
});
|
|
19646
19802
|
const handleClose = () => {
|
|
19647
19803
|
handleCancel();
|
|
19648
19804
|
emit("update:visible", subVisible.value);
|
|
@@ -19716,7 +19872,7 @@
|
|
|
19716
19872
|
name: "footer",
|
|
19717
19873
|
fn: vue.withCtx(() => [
|
|
19718
19874
|
vue.createElementVNode("div", _hoisted_1$d, [
|
|
19719
|
-
vue.renderSlot(_ctx.$slots, "drawer-footer", vue.normalizeProps(vue.guardReactiveProps({ handleConfirm, handleCancel })), () => [
|
|
19875
|
+
vue.renderSlot(_ctx.$slots, "drawer-footer", vue.normalizeProps(vue.guardReactiveProps({ handleConfirm: vue.unref(handleConfirm), handleCancel })), () => [
|
|
19720
19876
|
vue.createVNode(vue.unref(elementPlus.ElButton), { onClick: handleCancel }, {
|
|
19721
19877
|
default: vue.withCtx(() => [
|
|
19722
19878
|
vue.createTextVNode(
|
|
@@ -19730,8 +19886,8 @@
|
|
|
19730
19886
|
}),
|
|
19731
19887
|
vue.createVNode(vue.unref(elementPlus.ElButton), {
|
|
19732
19888
|
type: "primary",
|
|
19733
|
-
loading:
|
|
19734
|
-
onClick: handleConfirm
|
|
19889
|
+
loading: computedLoading.value,
|
|
19890
|
+
onClick: vue.unref(handleConfirm)
|
|
19735
19891
|
}, {
|
|
19736
19892
|
default: vue.withCtx(() => [
|
|
19737
19893
|
vue.createTextVNode(
|
|
@@ -19742,7 +19898,7 @@
|
|
|
19742
19898
|
]),
|
|
19743
19899
|
_: 1
|
|
19744
19900
|
/* STABLE */
|
|
19745
|
-
}, 8, ["loading"])
|
|
19901
|
+
}, 8, ["loading", "onClick"])
|
|
19746
19902
|
])
|
|
19747
19903
|
])
|
|
19748
19904
|
]),
|
|
@@ -57191,6 +57347,7 @@
|
|
|
57191
57347
|
});
|
|
57192
57348
|
return (_ctx, _cache) => {
|
|
57193
57349
|
const _component_el_input = vue.resolveComponent("el-input");
|
|
57350
|
+
const _component_el_tooltip = vue.resolveComponent("el-tooltip");
|
|
57194
57351
|
const _component_el_divider = vue.resolveComponent("el-divider");
|
|
57195
57352
|
const _component_el_dropdown_item = vue.resolveComponent("el-dropdown-item");
|
|
57196
57353
|
const _component_el_dropdown_menu = vue.resolveComponent("el-dropdown-menu");
|
|
@@ -57311,10 +57468,21 @@
|
|
|
57311
57468
|
}, () => [
|
|
57312
57469
|
vue.createElementVNode("span", _hoisted_4$3, [
|
|
57313
57470
|
vue.createCommentVNode(" \u9ED8\u8BA4\u8282\u70B9\u6807\u7B7E\u6587\u672C "),
|
|
57314
|
-
vue.
|
|
57315
|
-
|
|
57316
|
-
|
|
57317
|
-
|
|
57471
|
+
vue.createVNode(_component_el_tooltip, {
|
|
57472
|
+
content: node.label,
|
|
57473
|
+
placement: "top",
|
|
57474
|
+
disabled: !node.label || node.label.length <= 20,
|
|
57475
|
+
"show-after": 500
|
|
57476
|
+
}, {
|
|
57477
|
+
default: vue.withCtx(() => [
|
|
57478
|
+
vue.createElementVNode("span", {
|
|
57479
|
+
class: "label-text",
|
|
57480
|
+
innerHTML: highlightKeyword(node.label, props.searchMode === "local" ? filterText.value : "")
|
|
57481
|
+
}, null, 8, _hoisted_5$3)
|
|
57482
|
+
]),
|
|
57483
|
+
_: 2
|
|
57484
|
+
/* DYNAMIC */
|
|
57485
|
+
}, 1032, ["content", "disabled"])
|
|
57318
57486
|
])
|
|
57319
57487
|
], true),
|
|
57320
57488
|
vue.createCommentVNode(" \u8282\u70B9\u64CD\u4F5C\u533A\u57DF\uFF08\u72EC\u7ACB\u4E8E\u81EA\u5B9A\u4E49 slot\uFF09 "),
|
|
@@ -57425,7 +57593,7 @@
|
|
|
57425
57593
|
}
|
|
57426
57594
|
});
|
|
57427
57595
|
|
|
57428
|
-
var YcPlusTreeComponent = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-
|
|
57596
|
+
var YcPlusTreeComponent = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-0043eed3"], ["__file", "index.vue"]]);
|
|
57429
57597
|
|
|
57430
57598
|
const YcPlusTree = l(YcPlusTreeComponent);
|
|
57431
57599
|
const RePlusTree = YcPlusTree;
|
|
@@ -57560,7 +57728,7 @@
|
|
|
57560
57728
|
drawerStore.value = [];
|
|
57561
57729
|
};
|
|
57562
57730
|
|
|
57563
|
-
const _withScopeId$1 = (n) => (vue.pushScopeId("data-v-
|
|
57731
|
+
const _withScopeId$1 = (n) => (vue.pushScopeId("data-v-f8ad9f74"), n = n(), vue.popScopeId(), n);
|
|
57564
57732
|
const _hoisted_1$4 = { class: "custom-drawer-header" };
|
|
57565
57733
|
const _hoisted_2$4 = { class: "header-content" };
|
|
57566
57734
|
const _hoisted_3$4 = ["id"];
|
|
@@ -57603,7 +57771,9 @@
|
|
|
57603
57771
|
bg: true,
|
|
57604
57772
|
popConfirm: options == null ? void 0 : options.popConfirm,
|
|
57605
57773
|
btnClick: ({ drawer: { options: options2, index } }) => {
|
|
57774
|
+
var _a;
|
|
57606
57775
|
if (!options2 || index === void 0) return;
|
|
57776
|
+
if ((_a = sureBtnMap.value[index]) == null ? void 0 : _a.loading) return;
|
|
57607
57777
|
if (options2 == null ? void 0 : options2.sureBtnLoading) {
|
|
57608
57778
|
sureBtnMap.value[index] = Object.assign({}, sureBtnMap.value[index] || {}, {
|
|
57609
57779
|
loading: true
|
|
@@ -57782,7 +57952,7 @@
|
|
|
57782
57952
|
}
|
|
57783
57953
|
});
|
|
57784
57954
|
|
|
57785
|
-
var YcDrawerComponent = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-
|
|
57955
|
+
var YcDrawerComponent = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-f8ad9f74"], ["__file", "index.vue"]]);
|
|
57786
57956
|
|
|
57787
57957
|
const YcDrawer = YcDrawerComponent;
|
|
57788
57958
|
const ReDrawer = YcDrawerComponent;
|
|
@@ -57866,10 +58036,18 @@
|
|
|
57866
58036
|
if (props.confirmText) return props.confirmText;
|
|
57867
58037
|
return props.status === "delete" ? "\u5220\u9664" : "\u786E\u5B9A";
|
|
57868
58038
|
});
|
|
57869
|
-
const
|
|
58039
|
+
const isSubmitting = vue.ref(false);
|
|
58040
|
+
const doConfirm = () => {
|
|
58041
|
+
isSubmitting.value = true;
|
|
57870
58042
|
emit("confirm");
|
|
57871
58043
|
dialogVisible.value = false;
|
|
57872
58044
|
};
|
|
58045
|
+
const handleConfirm = debounce(doConfirm, 300, {
|
|
58046
|
+
leading: true,
|
|
58047
|
+
// 立即执行第一次
|
|
58048
|
+
trailing: false
|
|
58049
|
+
// 不执行最后一次
|
|
58050
|
+
});
|
|
57873
58051
|
const handleCancel = () => {
|
|
57874
58052
|
emit("cancel");
|
|
57875
58053
|
dialogVisible.value = false;
|
|
@@ -57928,7 +58106,8 @@
|
|
|
57928
58106
|
})) : vue.createCommentVNode("v-if", true),
|
|
57929
58107
|
vue.createVNode(vue.unref(elementPlus.ElButton), {
|
|
57930
58108
|
type: currentStatusConfig.value.confirmButtonType,
|
|
57931
|
-
|
|
58109
|
+
loading: isSubmitting.value,
|
|
58110
|
+
onClick: vue.unref(handleConfirm)
|
|
57932
58111
|
}, {
|
|
57933
58112
|
default: vue.withCtx(() => [
|
|
57934
58113
|
vue.createTextVNode(
|
|
@@ -57939,7 +58118,7 @@
|
|
|
57939
58118
|
]),
|
|
57940
58119
|
_: 1
|
|
57941
58120
|
/* STABLE */
|
|
57942
|
-
}, 8, ["type"])
|
|
58121
|
+
}, 8, ["type", "loading", "onClick"])
|
|
57943
58122
|
], true)
|
|
57944
58123
|
])
|
|
57945
58124
|
]),
|
|
@@ -57963,7 +58142,7 @@
|
|
|
57963
58142
|
}
|
|
57964
58143
|
});
|
|
57965
58144
|
|
|
57966
|
-
var YcStatusDialog = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-
|
|
58145
|
+
var YcStatusDialog = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-a1851fcd"], ["__file", "index.vue"]]);
|
|
57967
58146
|
|
|
57968
58147
|
var _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
57969
58148
|
...{
|
|
@@ -59639,7 +59818,7 @@
|
|
|
59639
59818
|
|
|
59640
59819
|
var installer = makeInstaller([...plugins]);
|
|
59641
59820
|
|
|
59642
|
-
const version = "0.
|
|
59821
|
+
const version = "0.0.13";
|
|
59643
59822
|
|
|
59644
59823
|
const install = installer.install;
|
|
59645
59824
|
|
|
@@ -59648,6 +59827,7 @@
|
|
|
59648
59827
|
exports.DatePickerValueIsArrayList = DatePickerValueIsArrayList;
|
|
59649
59828
|
exports.DefaultPageInfo = DefaultPageInfo;
|
|
59650
59829
|
exports.DefaultPageSizeList = DefaultPageSizeList;
|
|
59830
|
+
exports.DictStoreInjectionKey = DictStoreInjectionKey;
|
|
59651
59831
|
exports.PlusBreadcrumb = PlusBreadcrumb;
|
|
59652
59832
|
exports.PlusCheckCard = PlusCheckCard;
|
|
59653
59833
|
exports.PlusCheckCardGroup = PlusCheckCardGroup;
|
|
@@ -59755,6 +59935,7 @@
|
|
|
59755
59935
|
exports.selectValueTypeList = selectValueTypeList;
|
|
59756
59936
|
exports.updateDrawer = updateDrawer;
|
|
59757
59937
|
exports.useDialogFormConfig = useDialogFormConfig;
|
|
59938
|
+
exports.useDictInjection = useDictInjection;
|
|
59758
59939
|
exports.useDrawerFormConfig = useDrawerFormConfig;
|
|
59759
59940
|
exports.useGetOptions = useGetOptions;
|
|
59760
59941
|
exports.useLocale = useLocale;
|