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
|
@@ -227,7 +227,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
|
|
|
227
227
|
};
|
|
228
228
|
}> & {} & ComponentCustomProperties & {} & {
|
|
229
229
|
$slots: Partial<Record<string, (_: {
|
|
230
|
-
column: Readonly<Omit< LooseRequired<PlusFormItemProps>, "index" | "label" | "tooltip" | "formItemProps" | "fieldProps" | "options" | "modelValue" | "fieldSlots" | "fieldChildrenSlot" | "hasLabel" | "clearable" | "valueType" | "renderField" | "renderLabel" | "renderErrorMessage" | "optionsMap">> & {
|
|
230
|
+
column: Readonly<Omit< LooseRequired<PlusFormItemProps>, "index" | "label" | "tooltip" | "formItemProps" | "fieldProps" | "options" | "modelValue" | "fieldSlots" | "fieldChildrenSlot" | "hasLabel" | "clearable" | "valueType" | "renderField" | "renderLabel" | "renderErrorMessage" | "optionsMap" | "autoDict">> & {
|
|
231
231
|
readonly label: string | ComputedRef<string>;
|
|
232
232
|
readonly modelValue: string | number | boolean | string[] | [string, string] | number[] | Date | RecordType | boolean[] | Date[] | [Date, Date] | [number, number] | string[][] | number[][] | null;
|
|
233
233
|
readonly hasLabel: boolean | Ref<boolean> | ComputedRef<boolean>;
|
|
@@ -256,7 +256,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
|
|
|
256
256
|
};
|
|
257
257
|
rows: number;
|
|
258
258
|
autocomplete: string;
|
|
259
|
-
type: "" | "number" | "default" | "search" | "button" | "textarea" | "time" | "circle" | "image" | "line" | "text" | "
|
|
259
|
+
type: "" | "number" | "default" | "search" | "button" | "textarea" | "time" | "circle" | "image" | "line" | "text" | "datetimerange" | "daterange" | "monthrange" | "checkbox" | "radio" | "color" | "success" | "warning" | "info" | "primary" | "danger" | "reset" | "submit" | "hidden" | "range" | "date" | "year" | "years" | "month" | "dates" | "week" | "datetime" | "dashboard" | "datetime-local" | "email" | "file" | "password" | "tel" | "url";
|
|
260
260
|
loading: EpPropMergeType<BooleanConstructor, unknown, unknown> | EpPropMergeType<StringConstructor, "lazy" | "eager", unknown> | undefined;
|
|
261
261
|
step: string | number;
|
|
262
262
|
format: string | ProgressFn | undefined;
|
|
@@ -283,6 +283,12 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
|
|
|
283
283
|
label?: string | undefined;
|
|
284
284
|
value?: string | undefined;
|
|
285
285
|
} | undefined;
|
|
286
|
+
readonly autoDict: boolean | ((column: PlusColumn) => OptionsRow<undefined>[] | Promise< OptionsRow<undefined>[]>) | {
|
|
287
|
+
store?: any;
|
|
288
|
+
method?: string | undefined;
|
|
289
|
+
transform?: ((data: any) => OptionsRow<undefined>[]) | undefined;
|
|
290
|
+
dictCode?: string | undefined;
|
|
291
|
+
} | undefined;
|
|
286
292
|
readonly clearable: boolean;
|
|
287
293
|
readonly index: number;
|
|
288
294
|
} & {
|
|
@@ -320,10 +326,16 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
|
|
|
320
326
|
label?: string | undefined;
|
|
321
327
|
value?: string | undefined;
|
|
322
328
|
} | undefined;
|
|
329
|
+
autoDict: boolean | ((column: PlusColumn) => OptionsRow<undefined>[] | Promise< OptionsRow<undefined>[]>) | {
|
|
330
|
+
store?: any;
|
|
331
|
+
method?: string | undefined;
|
|
332
|
+
transform?: ((data: any) => OptionsRow<undefined>[]) | undefined;
|
|
333
|
+
dictCode?: string | undefined;
|
|
334
|
+
} | undefined;
|
|
323
335
|
clearable: boolean;
|
|
324
336
|
index: number;
|
|
325
337
|
}) => any>> & Partial<Record<string, (_: {
|
|
326
|
-
column: Readonly<Omit< LooseRequired<PlusFormItemProps>, "index" | "label" | "tooltip" | "formItemProps" | "fieldProps" | "options" | "modelValue" | "fieldSlots" | "fieldChildrenSlot" | "hasLabel" | "clearable" | "valueType" | "renderField" | "renderLabel" | "renderErrorMessage" | "optionsMap">> & {
|
|
338
|
+
column: Readonly<Omit< LooseRequired<PlusFormItemProps>, "index" | "label" | "tooltip" | "formItemProps" | "fieldProps" | "options" | "modelValue" | "fieldSlots" | "fieldChildrenSlot" | "hasLabel" | "clearable" | "valueType" | "renderField" | "renderLabel" | "renderErrorMessage" | "optionsMap" | "autoDict">> & {
|
|
327
339
|
readonly label: string | ComputedRef<string>;
|
|
328
340
|
readonly modelValue: string | number | boolean | string[] | [string, string] | number[] | Date | RecordType | boolean[] | Date[] | [Date, Date] | [number, number] | string[][] | number[][] | null;
|
|
329
341
|
readonly hasLabel: boolean | Ref<boolean> | ComputedRef<boolean>;
|
|
@@ -352,7 +364,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
|
|
|
352
364
|
};
|
|
353
365
|
rows: number;
|
|
354
366
|
autocomplete: string;
|
|
355
|
-
type: "" | "number" | "default" | "search" | "button" | "textarea" | "time" | "circle" | "image" | "line" | "text" | "
|
|
367
|
+
type: "" | "number" | "default" | "search" | "button" | "textarea" | "time" | "circle" | "image" | "line" | "text" | "datetimerange" | "daterange" | "monthrange" | "checkbox" | "radio" | "color" | "success" | "warning" | "info" | "primary" | "danger" | "reset" | "submit" | "hidden" | "range" | "date" | "year" | "years" | "month" | "dates" | "week" | "datetime" | "dashboard" | "datetime-local" | "email" | "file" | "password" | "tel" | "url";
|
|
356
368
|
loading: EpPropMergeType<BooleanConstructor, unknown, unknown> | EpPropMergeType<StringConstructor, "lazy" | "eager", unknown> | undefined;
|
|
357
369
|
step: string | number;
|
|
358
370
|
format: string | ProgressFn | undefined;
|
|
@@ -379,6 +391,12 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
|
|
|
379
391
|
label?: string | undefined;
|
|
380
392
|
value?: string | undefined;
|
|
381
393
|
} | undefined;
|
|
394
|
+
readonly autoDict: boolean | ((column: PlusColumn) => OptionsRow<undefined>[] | Promise< OptionsRow<undefined>[]>) | {
|
|
395
|
+
store?: any;
|
|
396
|
+
method?: string | undefined;
|
|
397
|
+
transform?: ((data: any) => OptionsRow<undefined>[]) | undefined;
|
|
398
|
+
dictCode?: string | undefined;
|
|
399
|
+
} | undefined;
|
|
382
400
|
readonly clearable: boolean;
|
|
383
401
|
readonly index: number;
|
|
384
402
|
} & {
|
|
@@ -416,10 +434,16 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
|
|
|
416
434
|
label?: string | undefined;
|
|
417
435
|
value?: string | undefined;
|
|
418
436
|
} | undefined;
|
|
437
|
+
autoDict: boolean | ((column: PlusColumn) => OptionsRow<undefined>[] | Promise< OptionsRow<undefined>[]>) | {
|
|
438
|
+
store?: any;
|
|
439
|
+
method?: string | undefined;
|
|
440
|
+
transform?: ((data: any) => OptionsRow<undefined>[]) | undefined;
|
|
441
|
+
dictCode?: string | undefined;
|
|
442
|
+
} | undefined;
|
|
419
443
|
clearable: boolean;
|
|
420
444
|
index: number;
|
|
421
445
|
}) => any>> & Partial<Record<string, (_: {
|
|
422
|
-
column: Readonly<Omit< LooseRequired<PlusFormItemProps>, "index" | "label" | "tooltip" | "formItemProps" | "fieldProps" | "options" | "modelValue" | "fieldSlots" | "fieldChildrenSlot" | "hasLabel" | "clearable" | "valueType" | "renderField" | "renderLabel" | "renderErrorMessage" | "optionsMap">> & {
|
|
446
|
+
column: Readonly<Omit< LooseRequired<PlusFormItemProps>, "index" | "label" | "tooltip" | "formItemProps" | "fieldProps" | "options" | "modelValue" | "fieldSlots" | "fieldChildrenSlot" | "hasLabel" | "clearable" | "valueType" | "renderField" | "renderLabel" | "renderErrorMessage" | "optionsMap" | "autoDict">> & {
|
|
423
447
|
readonly label: string | ComputedRef<string>;
|
|
424
448
|
readonly modelValue: string | number | boolean | string[] | [string, string] | number[] | Date | RecordType | boolean[] | Date[] | [Date, Date] | [number, number] | string[][] | number[][] | null;
|
|
425
449
|
readonly hasLabel: boolean | Ref<boolean> | ComputedRef<boolean>;
|
|
@@ -448,7 +472,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
|
|
|
448
472
|
};
|
|
449
473
|
rows: number;
|
|
450
474
|
autocomplete: string;
|
|
451
|
-
type: "" | "number" | "default" | "search" | "button" | "textarea" | "time" | "circle" | "image" | "line" | "text" | "
|
|
475
|
+
type: "" | "number" | "default" | "search" | "button" | "textarea" | "time" | "circle" | "image" | "line" | "text" | "datetimerange" | "daterange" | "monthrange" | "checkbox" | "radio" | "color" | "success" | "warning" | "info" | "primary" | "danger" | "reset" | "submit" | "hidden" | "range" | "date" | "year" | "years" | "month" | "dates" | "week" | "datetime" | "dashboard" | "datetime-local" | "email" | "file" | "password" | "tel" | "url";
|
|
452
476
|
loading: EpPropMergeType<BooleanConstructor, unknown, unknown> | EpPropMergeType<StringConstructor, "lazy" | "eager", unknown> | undefined;
|
|
453
477
|
step: string | number;
|
|
454
478
|
format: string | ProgressFn | undefined;
|
|
@@ -475,6 +499,12 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
|
|
|
475
499
|
label?: string | undefined;
|
|
476
500
|
value?: string | undefined;
|
|
477
501
|
} | undefined;
|
|
502
|
+
readonly autoDict: boolean | ((column: PlusColumn) => OptionsRow<undefined>[] | Promise< OptionsRow<undefined>[]>) | {
|
|
503
|
+
store?: any;
|
|
504
|
+
method?: string | undefined;
|
|
505
|
+
transform?: ((data: any) => OptionsRow<undefined>[]) | undefined;
|
|
506
|
+
dictCode?: string | undefined;
|
|
507
|
+
} | undefined;
|
|
478
508
|
readonly clearable: boolean;
|
|
479
509
|
readonly index: number;
|
|
480
510
|
} & {
|
|
@@ -512,6 +542,12 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
|
|
|
512
542
|
label?: string | undefined;
|
|
513
543
|
value?: string | undefined;
|
|
514
544
|
} | undefined;
|
|
545
|
+
autoDict: boolean | ((column: PlusColumn) => OptionsRow<undefined>[] | Promise< OptionsRow<undefined>[]>) | {
|
|
546
|
+
store?: any;
|
|
547
|
+
method?: string | undefined;
|
|
548
|
+
transform?: ((data: any) => OptionsRow<undefined>[]) | undefined;
|
|
549
|
+
dictCode?: string | undefined;
|
|
550
|
+
} | undefined;
|
|
515
551
|
clearable: boolean;
|
|
516
552
|
index: number;
|
|
517
553
|
}) => any>> & Partial<Record<string, (_: {
|
|
@@ -5,6 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var index_vue_vue_type_script_setup_true_lang = require('./index.vue2.js');
|
|
6
6
|
var _pluginVue_exportHelper = require('../../../_virtual/_plugin-vue_export-helper.js');
|
|
7
7
|
|
|
8
|
-
var YcDrawerComponent = /* @__PURE__ */ _pluginVue_exportHelper.default(index_vue_vue_type_script_setup_true_lang.default, [["__scopeId", "data-v-
|
|
8
|
+
var YcDrawerComponent = /* @__PURE__ */ _pluginVue_exportHelper.default(index_vue_vue_type_script_setup_true_lang.default, [["__scopeId", "data-v-f8ad9f74"], ["__file", "index.vue"]]);
|
|
9
9
|
|
|
10
10
|
exports.default = YcDrawerComponent;
|
|
@@ -7,7 +7,7 @@ var lodashEs = require('lodash-es');
|
|
|
7
7
|
var ElementPlusIconsVue = require('@element-plus/icons-vue');
|
|
8
8
|
var store = require('../store.js');
|
|
9
9
|
|
|
10
|
-
const _withScopeId = (n) => (vue.pushScopeId("data-v-
|
|
10
|
+
const _withScopeId = (n) => (vue.pushScopeId("data-v-f8ad9f74"), n = n(), vue.popScopeId(), n);
|
|
11
11
|
const _hoisted_1 = { class: "custom-drawer-header" };
|
|
12
12
|
const _hoisted_2 = { class: "header-content" };
|
|
13
13
|
const _hoisted_3 = ["id"];
|
|
@@ -50,7 +50,9 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
50
50
|
bg: true,
|
|
51
51
|
popConfirm: options == null ? void 0 : options.popConfirm,
|
|
52
52
|
btnClick: ({ drawer: { options: options2, index } }) => {
|
|
53
|
+
var _a;
|
|
53
54
|
if (!options2 || index === void 0) return;
|
|
55
|
+
if ((_a = sureBtnMap.value[index]) == null ? void 0 : _a.loading) return;
|
|
54
56
|
if (options2 == null ? void 0 : options2.sureBtnLoading) {
|
|
55
57
|
sureBtnMap.value[index] = Object.assign({}, sureBtnMap.value[index] || {}, {
|
|
56
58
|
loading: true
|
|
@@ -5,6 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var index_vue_vue_type_script_setup_true_lang = require('./index.vue2.js');
|
|
6
6
|
var _pluginVue_exportHelper = require('../../../_virtual/_plugin-vue_export-helper.js');
|
|
7
7
|
|
|
8
|
-
var YcPlusTreeComponent = /* @__PURE__ */ _pluginVue_exportHelper.default(index_vue_vue_type_script_setup_true_lang.default, [["__scopeId", "data-v-
|
|
8
|
+
var YcPlusTreeComponent = /* @__PURE__ */ _pluginVue_exportHelper.default(index_vue_vue_type_script_setup_true_lang.default, [["__scopeId", "data-v-0043eed3"], ["__file", "index.vue"]]);
|
|
9
9
|
|
|
10
10
|
exports.default = YcPlusTreeComponent;
|
|
@@ -655,6 +655,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
655
655
|
});
|
|
656
656
|
return (_ctx, _cache) => {
|
|
657
657
|
const _component_el_input = vue.resolveComponent("el-input");
|
|
658
|
+
const _component_el_tooltip = vue.resolveComponent("el-tooltip");
|
|
658
659
|
const _component_el_divider = vue.resolveComponent("el-divider");
|
|
659
660
|
const _component_el_dropdown_item = vue.resolveComponent("el-dropdown-item");
|
|
660
661
|
const _component_el_dropdown_menu = vue.resolveComponent("el-dropdown-menu");
|
|
@@ -775,10 +776,21 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
775
776
|
}, () => [
|
|
776
777
|
vue.createElementVNode("span", _hoisted_4, [
|
|
777
778
|
vue.createCommentVNode(" \u9ED8\u8BA4\u8282\u70B9\u6807\u7B7E\u6587\u672C "),
|
|
778
|
-
vue.
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
779
|
+
vue.createVNode(_component_el_tooltip, {
|
|
780
|
+
content: node.label,
|
|
781
|
+
placement: "top",
|
|
782
|
+
disabled: !node.label || node.label.length <= 20,
|
|
783
|
+
"show-after": 500
|
|
784
|
+
}, {
|
|
785
|
+
default: vue.withCtx(() => [
|
|
786
|
+
vue.createElementVNode("span", {
|
|
787
|
+
class: "label-text",
|
|
788
|
+
innerHTML: highlightKeyword(node.label, props.searchMode === "local" ? filterText.value : "")
|
|
789
|
+
}, null, 8, _hoisted_5)
|
|
790
|
+
]),
|
|
791
|
+
_: 2
|
|
792
|
+
/* DYNAMIC */
|
|
793
|
+
}, 1032, ["content", "disabled"])
|
|
782
794
|
])
|
|
783
795
|
], true),
|
|
784
796
|
vue.createCommentVNode(" \u8282\u70B9\u64CD\u4F5C\u533A\u57DF\uFF08\u72EC\u7ACB\u4E8E\u81EA\u5B9A\u4E49 slot\uFF09 "),
|
|
@@ -5,6 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var index_vue_vue_type_script_setup_true_lang = require('./index.vue2.js');
|
|
6
6
|
var _pluginVue_exportHelper = require('../../../_virtual/_plugin-vue_export-helper.js');
|
|
7
7
|
|
|
8
|
-
var YcStatusDialog = /* @__PURE__ */ _pluginVue_exportHelper.default(index_vue_vue_type_script_setup_true_lang.default, [["__scopeId", "data-v-
|
|
8
|
+
var YcStatusDialog = /* @__PURE__ */ _pluginVue_exportHelper.default(index_vue_vue_type_script_setup_true_lang.default, [["__scopeId", "data-v-a1851fcd"], ["__file", "index.vue"]]);
|
|
9
9
|
|
|
10
10
|
exports.default = YcStatusDialog;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var vue = require('vue');
|
|
6
|
+
var lodashEs = require('lodash-es');
|
|
6
7
|
var elementPlus = require('element-plus');
|
|
7
8
|
var ElementPlusIconsVue = require('@element-plus/icons-vue');
|
|
8
9
|
var type = require('./type.js');
|
|
@@ -78,10 +79,18 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
78
79
|
if (props.confirmText) return props.confirmText;
|
|
79
80
|
return props.status === "delete" ? "\u5220\u9664" : "\u786E\u5B9A";
|
|
80
81
|
});
|
|
81
|
-
const
|
|
82
|
+
const isSubmitting = vue.ref(false);
|
|
83
|
+
const doConfirm = () => {
|
|
84
|
+
isSubmitting.value = true;
|
|
82
85
|
emit("confirm");
|
|
83
86
|
dialogVisible.value = false;
|
|
84
87
|
};
|
|
88
|
+
const handleConfirm = lodashEs.debounce(doConfirm, 300, {
|
|
89
|
+
leading: true,
|
|
90
|
+
// 立即执行第一次
|
|
91
|
+
trailing: false
|
|
92
|
+
// 不执行最后一次
|
|
93
|
+
});
|
|
85
94
|
const handleCancel = () => {
|
|
86
95
|
emit("cancel");
|
|
87
96
|
dialogVisible.value = false;
|
|
@@ -140,7 +149,8 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
140
149
|
})) : vue.createCommentVNode("v-if", true),
|
|
141
150
|
vue.createVNode(vue.unref(elementPlus.ElButton), {
|
|
142
151
|
type: currentStatusConfig.value.confirmButtonType,
|
|
143
|
-
|
|
152
|
+
loading: isSubmitting.value,
|
|
153
|
+
onClick: vue.unref(handleConfirm)
|
|
144
154
|
}, {
|
|
145
155
|
default: vue.withCtx(() => [
|
|
146
156
|
vue.createTextVNode(
|
|
@@ -151,7 +161,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
151
161
|
]),
|
|
152
162
|
_: 1
|
|
153
163
|
/* STABLE */
|
|
154
|
-
}, 8, ["type"])
|
|
164
|
+
}, 8, ["type", "loading", "onClick"])
|
|
155
165
|
], true)
|
|
156
166
|
])
|
|
157
167
|
]),
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { OptionsRow } from 'yc-pro-components/es/types';
|
|
2
|
+
import { InjectionKey } from 'vue';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 字典 Store 标准接口
|
|
6
|
+
* @description 所有项目的字典 Store 必须实现此接口才能使用自动字典注入功能
|
|
7
|
+
* @version v0.2.0
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import type { DictStoreInterface } from 'yc-components'
|
|
11
|
+
*
|
|
12
|
+
* export const useDictStore = defineStore('dict', () => {
|
|
13
|
+
* const getDictData = (field: string): OptionsRow[] => {
|
|
14
|
+
* // 返回字典数据
|
|
15
|
+
* return dictData.value[field] || []
|
|
16
|
+
* }
|
|
17
|
+
*
|
|
18
|
+
* const hasDict = (field: string): boolean => {
|
|
19
|
+
* return !!dictData.value[field]
|
|
20
|
+
* }
|
|
21
|
+
*
|
|
22
|
+
* const getDictLabel = (field: string, value: string | number): string => {
|
|
23
|
+
* const items = dictData.value[field] || []
|
|
24
|
+
* const item = items.find(item => item.value === value)
|
|
25
|
+
* return item?.label || String(value)
|
|
26
|
+
* }
|
|
27
|
+
*
|
|
28
|
+
* return { getDictData, hasDict, getDictLabel }
|
|
29
|
+
* })
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export interface DictStoreInterface {
|
|
33
|
+
/**
|
|
34
|
+
* 根据字段名或字典 code 获取字典数据
|
|
35
|
+
* @param field 字段名(如 "status")或字典 code(如 "ORDER_STATUS")
|
|
36
|
+
* @returns 字典选项数组
|
|
37
|
+
* @description 此方法是核心方法,必须实现
|
|
38
|
+
*/
|
|
39
|
+
getDictData: (field: string) => OptionsRow[];
|
|
40
|
+
/**
|
|
41
|
+
* 检查字段是否有字典映射
|
|
42
|
+
* @param field 字段名或字典 code
|
|
43
|
+
* @returns 是否存在字典数据
|
|
44
|
+
* @description 可选方法,用于优化性能
|
|
45
|
+
*/
|
|
46
|
+
hasDict?: (field: string) => boolean;
|
|
47
|
+
/**
|
|
48
|
+
* 获取字典标签
|
|
49
|
+
* @param field 字段名或字典 code
|
|
50
|
+
* @param value 字典值
|
|
51
|
+
* @returns 字典标签
|
|
52
|
+
* @description 可选方法,用于显示字典标签
|
|
53
|
+
*/
|
|
54
|
+
getDictLabel?: (field: string, value: string | number) => string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* 字典 Store 注入 Key
|
|
58
|
+
* @description 用于 provide/inject 传递字典 Store 实例
|
|
59
|
+
* @version v0.2.0
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* // 提供字典 Store
|
|
63
|
+
* import { provide } from 'vue'
|
|
64
|
+
* import { DictStoreInjectionKey } from 'yc-components'
|
|
65
|
+
*
|
|
66
|
+
* const dictStore = useDictStore()
|
|
67
|
+
* provide(DictStoreInjectionKey, dictStore)
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* ```ts
|
|
71
|
+
* // 注入字典 Store
|
|
72
|
+
* import { inject } from 'vue'
|
|
73
|
+
* import { DictStoreInjectionKey } from 'yc-components'
|
|
74
|
+
*
|
|
75
|
+
* const dictStore = inject(DictStoreInjectionKey)
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export declare const DictStoreInjectionKey: InjectionKey<DictStoreInterface>;
|
package/lib/constants/index.d.ts
CHANGED
package/lib/constants/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var page = require('./page.js');
|
|
4
4
|
var form = require('./form.js');
|
|
5
5
|
var displayItem = require('./display-item.js');
|
|
6
|
+
var dict = require('./dict.js');
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
|
|
@@ -16,3 +17,4 @@ exports.ValueIsArrayList = form.ValueIsArrayList;
|
|
|
16
17
|
exports.ValueIsBooleanList = form.ValueIsBooleanList;
|
|
17
18
|
exports.ValueIsNumberList = form.ValueIsNumberList;
|
|
18
19
|
exports.selectValueTypeList = displayItem.selectValueTypeList;
|
|
20
|
+
exports.DictStoreInjectionKey = dict.DictStoreInjectionKey;
|
package/lib/hooks/index.d.ts
CHANGED
package/lib/hooks/index.js
CHANGED
|
@@ -8,6 +8,7 @@ var usePlusProConfig = require('./usePlusProConfig.js');
|
|
|
8
8
|
var useSortableDrag = require('./useSortableDrag.js');
|
|
9
9
|
var usePlusFormReset = require('./usePlusFormReset.js');
|
|
10
10
|
var useSelectWithPagination = require('./useSelectWithPagination.js');
|
|
11
|
+
var useDictInjection = require('./useDictInjection.js');
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
|
|
@@ -28,3 +29,4 @@ exports.usePlusFormClearValidate = usePlusFormReset.usePlusFormClearValidate;
|
|
|
28
29
|
exports.usePlusFormFullReset = usePlusFormReset.usePlusFormFullReset;
|
|
29
30
|
exports.usePlusFormReset = usePlusFormReset.usePlusFormReset;
|
|
30
31
|
exports.useSelectWithPagination = useSelectWithPagination.useSelectWithPagination;
|
|
32
|
+
exports.useDictInjection = useDictInjection.useDictInjection;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { DictStoreInterface } from 'yc-pro-components/es/constants';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 提供字典 Store 给子组件
|
|
5
|
+
* @param dictStore 字典 Store 实例,必须实现 DictStoreInterface 接口
|
|
6
|
+
* @description 在父组件中调用此函数,将字典 Store 提供给所有子组件使用
|
|
7
|
+
* @version v0.2.0
|
|
8
|
+
* @example
|
|
9
|
+
* ```vue
|
|
10
|
+
* <!-- 在父组件中提供字典 Store -->
|
|
11
|
+
* <script setup lang="ts">
|
|
12
|
+
* import { useDictInjection } from 'yc-components'
|
|
13
|
+
* import { useFieldCatalogStore } from '@/store/modules/fieldCatalog'
|
|
14
|
+
*
|
|
15
|
+
* const fieldCatalogStore = useFieldCatalogStore()
|
|
16
|
+
*
|
|
17
|
+
* // 提供字典 Store 给所有子组件
|
|
18
|
+
* useDictInjection(fieldCatalogStore)
|
|
19
|
+
* </script>
|
|
20
|
+
*
|
|
21
|
+
* <template>
|
|
22
|
+
* <PlusPage :columns="columns" />
|
|
23
|
+
* </template>
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* ```ts
|
|
27
|
+
* // 子组件中使用 autoDict
|
|
28
|
+
* const columns: PlusColumn[] = [
|
|
29
|
+
* {
|
|
30
|
+
* label: '状态',
|
|
31
|
+
* prop: 'status',
|
|
32
|
+
* valueType: 'select',
|
|
33
|
+
* autoDict: true // 自动从父组件注入的 dictStore 获取
|
|
34
|
+
* }
|
|
35
|
+
* ]
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare function useDictInjection(dictStore: DictStoreInterface): void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var vue = require('vue');
|
|
4
|
+
var dict = require('../constants/dict.js');
|
|
5
|
+
|
|
6
|
+
function useDictInjection(dictStore) {
|
|
7
|
+
if (!dictStore) {
|
|
8
|
+
console.warn("[yc-components] useDictInjection: dictStore is required");
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
if (typeof dictStore.getDictData !== "function") {
|
|
12
|
+
console.error(
|
|
13
|
+
"[yc-components] useDictInjection: dictStore must implement getDictData method. Please ensure your dictStore implements DictStoreInterface."
|
|
14
|
+
);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
vue.provide(dict.DictStoreInjectionKey, dictStore);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
exports.useDictInjection = useDictInjection;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var vue = require('vue');
|
|
4
|
+
var dict = require('../constants/dict.js');
|
|
4
5
|
var is = require('../components/utils/is.js');
|
|
5
6
|
|
|
6
7
|
const throwError = (data) => {
|
|
@@ -29,27 +30,53 @@ const getOptionsByOptionsMap = (options, props) => {
|
|
|
29
30
|
const useGetOptions = (props) => {
|
|
30
31
|
const options = vue.ref([]);
|
|
31
32
|
const optionsIsReady = vue.ref(false);
|
|
32
|
-
|
|
33
|
+
const injectedDictStore = vue.inject(dict.DictStoreInjectionKey, null);
|
|
34
|
+
const hasValidOptions = props.options && (!is.isArray(props.options) || props.options.length > 0);
|
|
35
|
+
if (hasValidOptions) {
|
|
36
|
+
handleOptions();
|
|
37
|
+
} else if (props.autoDict) {
|
|
38
|
+
handleAutoDict();
|
|
39
|
+
} else {
|
|
33
40
|
options.value = [];
|
|
34
41
|
optionsIsReady.value = true;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
}
|
|
43
|
+
function handleOptions() {
|
|
44
|
+
if (!props.options) {
|
|
45
|
+
options.value = [];
|
|
46
|
+
optionsIsReady.value = true;
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (vue.isRef(props.options) || vue.isReactive(props.options) || is.isArray(props.options)) {
|
|
50
|
+
vue.watch(
|
|
51
|
+
() => props.options,
|
|
52
|
+
(val) => {
|
|
53
|
+
const value = vue.isRef(val) ? val.value : val;
|
|
54
|
+
options.value = getOptionsByOptionsMap(value, props);
|
|
55
|
+
optionsIsReady.value = true;
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
immediate: true,
|
|
59
|
+
deep: true
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
} else if (is.isFunction(props.options)) {
|
|
63
|
+
const getValue = props.options;
|
|
64
|
+
const result = getValue(props);
|
|
65
|
+
if (is.isPromise(result)) {
|
|
66
|
+
result.then((value) => {
|
|
67
|
+
options.value = getOptionsByOptionsMap(value, props);
|
|
68
|
+
optionsIsReady.value = true;
|
|
69
|
+
throwError(options.value);
|
|
70
|
+
}).catch((err) => {
|
|
71
|
+
throw err;
|
|
72
|
+
});
|
|
73
|
+
} else {
|
|
74
|
+
options.value = getOptionsByOptionsMap(result, props);
|
|
41
75
|
optionsIsReady.value = true;
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
immediate: true,
|
|
45
|
-
deep: true
|
|
46
76
|
}
|
|
47
|
-
)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const result = getValue(props);
|
|
51
|
-
if (is.isPromise(result)) {
|
|
52
|
-
result.then((value) => {
|
|
77
|
+
} else if (is.isPromise(props.options)) {
|
|
78
|
+
const getValue = props.options;
|
|
79
|
+
getValue.then((value) => {
|
|
53
80
|
options.value = getOptionsByOptionsMap(value, props);
|
|
54
81
|
optionsIsReady.value = true;
|
|
55
82
|
throwError(options.value);
|
|
@@ -57,21 +84,82 @@ const useGetOptions = (props) => {
|
|
|
57
84
|
throw err;
|
|
58
85
|
});
|
|
59
86
|
} else {
|
|
60
|
-
options.value = getOptionsByOptionsMap(result, props);
|
|
61
87
|
optionsIsReady.value = true;
|
|
88
|
+
throwError(props.options);
|
|
62
89
|
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
90
|
+
}
|
|
91
|
+
function handleAutoDict() {
|
|
92
|
+
if (is.isFunction(props.autoDict)) {
|
|
93
|
+
const autoDictFn = props.autoDict;
|
|
94
|
+
vue.watch(
|
|
95
|
+
() => {
|
|
96
|
+
return autoDictFn(props);
|
|
97
|
+
},
|
|
98
|
+
(result) => {
|
|
99
|
+
if (is.isPromise(result)) {
|
|
100
|
+
result.then((value) => {
|
|
101
|
+
options.value = getOptionsByOptionsMap(value, props);
|
|
102
|
+
optionsIsReady.value = true;
|
|
103
|
+
}).catch((err) => {
|
|
104
|
+
console.error("[yc-components] autoDict function error:", err);
|
|
105
|
+
options.value = [];
|
|
106
|
+
optionsIsReady.value = true;
|
|
107
|
+
});
|
|
108
|
+
} else {
|
|
109
|
+
options.value = getOptionsByOptionsMap(result, props);
|
|
110
|
+
optionsIsReady.value = true;
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
{ immediate: true }
|
|
114
|
+
);
|
|
115
|
+
} else if (typeof props.autoDict === "object" && props.autoDict !== null) {
|
|
116
|
+
const { store, method = "getDictData", transform, dictCode } = props.autoDict;
|
|
117
|
+
const dictStore = store || injectedDictStore;
|
|
118
|
+
const fieldOrCode = dictCode || props.prop;
|
|
119
|
+
if (dictStore && is.isFunction(dictStore[method])) {
|
|
120
|
+
vue.watch(
|
|
121
|
+
() => dictStore[method](fieldOrCode),
|
|
122
|
+
(val) => {
|
|
123
|
+
try {
|
|
124
|
+
const data = transform && is.isFunction(transform) ? transform(val) : val;
|
|
125
|
+
options.value = getOptionsByOptionsMap(data, props);
|
|
126
|
+
optionsIsReady.value = true;
|
|
127
|
+
} catch (err) {
|
|
128
|
+
console.error("[yc-components] autoDict transform error:", err);
|
|
129
|
+
options.value = [];
|
|
130
|
+
optionsIsReady.value = true;
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
{ immediate: true }
|
|
134
|
+
);
|
|
135
|
+
} else {
|
|
136
|
+
console.warn(
|
|
137
|
+
`[yc-components] autoDict: DictStore or method "${method}" not found for field "${fieldOrCode}"`
|
|
138
|
+
);
|
|
139
|
+
options.value = [];
|
|
140
|
+
optionsIsReady.value = true;
|
|
141
|
+
}
|
|
142
|
+
} else if (props.autoDict === true) {
|
|
143
|
+
if (injectedDictStore && is.isFunction(injectedDictStore.getDictData)) {
|
|
144
|
+
vue.watch(
|
|
145
|
+
() => injectedDictStore.getDictData(props.prop),
|
|
146
|
+
(val) => {
|
|
147
|
+
options.value = getOptionsByOptionsMap(val, props);
|
|
148
|
+
optionsIsReady.value = true;
|
|
149
|
+
},
|
|
150
|
+
{ immediate: true }
|
|
151
|
+
);
|
|
152
|
+
} else {
|
|
153
|
+
console.warn(
|
|
154
|
+
`[yc-components] autoDict: DictStore not provided via inject for field "${props.prop}". Please use useDictInjection() in parent component.`
|
|
155
|
+
);
|
|
156
|
+
options.value = [];
|
|
157
|
+
optionsIsReady.value = true;
|
|
158
|
+
}
|
|
159
|
+
} else {
|
|
160
|
+
options.value = [];
|
|
67
161
|
optionsIsReady.value = true;
|
|
68
|
-
|
|
69
|
-
}).catch((err) => {
|
|
70
|
-
throw err;
|
|
71
|
-
});
|
|
72
|
-
} else {
|
|
73
|
-
optionsIsReady.value = true;
|
|
74
|
-
throwError(props.options);
|
|
162
|
+
}
|
|
75
163
|
}
|
|
76
164
|
return { customOptions: options, customOptionsIsReady: optionsIsReady };
|
|
77
165
|
};
|