rayyy-vue-table-components 1.3.7 → 1.3.9
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/dist/index.es.js +1354 -1313
- package/dist/index.umd.js +8 -8
- package/dist/rayyy-vue-table-components.css +1 -1
- package/dist/src/components/form/BaseInput.vue.d.ts +1 -1
- package/dist/src/components/index.d.ts +3 -1
- package/dist/src/components/items/BaseWaringDialog.vue.d.ts +33 -0
- package/dist/src/router/constants.d.ts +2 -0
- package/dist/src/types/components.d.ts +66 -11
- package/dist/src/views/demo/BaseWaringDialogDemo.vue.d.ts +2 -0
- package/package.json +1 -1
- package/src/assets/styles/_dialogs.scss +2 -2
- package/src/components/form/BaseInput.vue +2 -2
- package/src/components/form/BaseSelector.vue +0 -1
- package/src/components/index.ts +6 -0
- package/src/components/items/BaseWaringDialog.vue +50 -0
- package/src/components/items/SearchBar.vue +1 -0
- package/src/types/components.d.ts +66 -11
- package/src/components/form/BaseForm.vue +0 -69
|
@@ -10,7 +10,7 @@ type __VLS_Props = {
|
|
|
10
10
|
readonly?: boolean;
|
|
11
11
|
maxlength?: string | number;
|
|
12
12
|
autocomplete?: string;
|
|
13
|
-
|
|
13
|
+
showSearch?: boolean;
|
|
14
14
|
};
|
|
15
15
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
16
16
|
"update:modelValue": (data: string | number | null | undefined) => any;
|
|
@@ -2,6 +2,7 @@ export { default as BaseTable } from './tables/BaseTable.vue';
|
|
|
2
2
|
export { default as BaseBtn } from './items/BaseBtn.vue';
|
|
3
3
|
export { default as BaseInput } from './form/BaseInput.vue';
|
|
4
4
|
export { default as BaseDialog } from './items/BaseDialog.vue';
|
|
5
|
+
export { default as BaseWaringDialog } from './items/BaseWaringDialog.vue';
|
|
5
6
|
export { default as BaseMultipleInput } from './form/BaseMultipleInput.vue';
|
|
6
7
|
export { default as SortTable } from './tables/SortTable.vue';
|
|
7
8
|
export { default as TitleTable } from './tables/TitleTable.vue';
|
|
@@ -13,11 +14,12 @@ export { default as MainPanel } from './layout/MainPanel.vue';
|
|
|
13
14
|
export { default as SearchableListPanel } from './layout/SearchableListPanel.vue';
|
|
14
15
|
export { default as DetailLayout } from './layout/DetailLayout.vue';
|
|
15
16
|
export { default as FilterLayout } from './layout/FilterLayout.vue';
|
|
16
|
-
export type { BaseTableProps, BaseTableEmits, BaseTableInstance, BaseBtnProps, BaseBtnEmits, BaseBtnInstance, BaseDialogProps, BaseDialogEmits, BaseDialogInstance, BaseInputProps, BaseInputEmits, BaseInputInstance, SortTableProps, SortTableEmits, SortTableInstance, TitleTableProps, TitleTableEmits, TitleTableInstance, SearchBarProps, SearchBarEmits, SearchBarInstance, SearchBarSlots, TransferDialogProps, TransferDialogEmits, TransferDialogInstance, TransferItemProps, TransferItemEmits, TransferItemInstance, MainPanelProps, MainPanelEmits, MainPanelInstance, SearchableListPanelProps, SearchableListPanelEmits, SearchableListPanelInstance, SearchableListPanelSlots, FunctionHeaderProps, FunctionHeaderEmits, FunctionHeaderInstance, DetailLayoutProps, DetailLayoutEmits, DetailLayoutInstance, FilterLayoutProps, FilterLayoutEmits, FilterLayoutInstance, PluginOptions, VueTableComponentsPlugin } from '../types/components.d';
|
|
17
|
+
export type { BaseTableProps, BaseTableEmits, BaseTableInstance, BaseBtnProps, BaseBtnEmits, BaseBtnInstance, BaseDialogProps, BaseDialogEmits, BaseDialogInstance, BaseWaringDialogProps, BaseWaringDialogEmits, BaseWaringDialogInstance, BaseInputProps, BaseInputEmits, BaseInputInstance, SortTableProps, SortTableEmits, SortTableInstance, TitleTableProps, TitleTableEmits, TitleTableInstance, SearchBarProps, SearchBarEmits, SearchBarInstance, SearchBarSlots, TransferDialogProps, TransferDialogEmits, TransferDialogInstance, TransferItemProps, TransferItemEmits, TransferItemInstance, MainPanelProps, MainPanelEmits, MainPanelInstance, SearchableListPanelProps, SearchableListPanelEmits, SearchableListPanelInstance, SearchableListPanelSlots, FunctionHeaderProps, FunctionHeaderEmits, FunctionHeaderInstance, DetailLayoutProps, DetailLayoutEmits, DetailLayoutInstance, FilterLayoutProps, FilterLayoutEmits, FilterLayoutInstance, PluginOptions, VueTableComponentsPlugin } from '../types/components.d';
|
|
17
18
|
export type { default as BaseTableType } from './tables/BaseTable.vue';
|
|
18
19
|
export type { default as BaseBtnType } from './items/BaseBtn.vue';
|
|
19
20
|
export type { default as BaseInputType } from './form/BaseInput.vue';
|
|
20
21
|
export type { default as BaseDialogType } from './items/BaseDialog.vue';
|
|
22
|
+
export type { default as BaseWaringDialogType } from './items/BaseWaringDialog.vue';
|
|
21
23
|
export type { default as SortTableType } from './tables/SortTable.vue';
|
|
22
24
|
export type { default as TitleTableType } from './tables/TitleTable.vue';
|
|
23
25
|
export type { default as SearchBarType } from './items/SearchBar.vue';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
modelValue: boolean;
|
|
3
|
+
waringText?: string;
|
|
4
|
+
subWaringText?: string;
|
|
5
|
+
titleText?: string;
|
|
6
|
+
modalWidth?: string;
|
|
7
|
+
};
|
|
8
|
+
declare function __VLS_template(): {
|
|
9
|
+
attrs: Partial<{}>;
|
|
10
|
+
slots: {
|
|
11
|
+
default?(_: {}): any;
|
|
12
|
+
};
|
|
13
|
+
refs: {};
|
|
14
|
+
rootEl: any;
|
|
15
|
+
};
|
|
16
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
17
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
18
|
+
"update:modelValue": (value: boolean) => any;
|
|
19
|
+
"update:submit": () => any;
|
|
20
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
21
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
22
|
+
"onUpdate:submit"?: (() => any) | undefined;
|
|
23
|
+
}>, {
|
|
24
|
+
waringText: string;
|
|
25
|
+
titleText: string;
|
|
26
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
27
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
28
|
+
export default _default;
|
|
29
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
30
|
+
new (): {
|
|
31
|
+
$slots: S;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -11,6 +11,7 @@ export declare const ROUTES: {
|
|
|
11
11
|
readonly BASE_BTN: "/demo/base-btn";
|
|
12
12
|
readonly BASE_INPUT: "/demo/base-input";
|
|
13
13
|
readonly BASE_DIALOG: "/demo/base-dialog";
|
|
14
|
+
readonly BASE_WARING_DIALOG: "/demo/base-waring-dialog";
|
|
14
15
|
readonly BASE_FORM: "/demo/base-form";
|
|
15
16
|
readonly TABLE: "/demo/table";
|
|
16
17
|
readonly SEARCH_BAR: "/demo/search-bar";
|
|
@@ -33,6 +34,7 @@ export declare const ROUTE_NAMES: {
|
|
|
33
34
|
readonly BASE_BTN: "BaseBtn";
|
|
34
35
|
readonly BASE_INPUT: "BaseInput";
|
|
35
36
|
readonly BASE_DIALOG: "BaseDialog";
|
|
37
|
+
readonly BASE_WARING_DIALOG: "BaseWaringDialog";
|
|
36
38
|
readonly TABLE: "Table";
|
|
37
39
|
readonly SEARCH_BAR: "SearchBar";
|
|
38
40
|
readonly FUNCTION_HEADER: "FunctionHeader";
|
|
@@ -21,7 +21,7 @@ export interface BaseTableProps<T extends Record<string, unknown> = Record<strin
|
|
|
21
21
|
showOverFlowTooltip?: boolean
|
|
22
22
|
/** 匯總方法 */
|
|
23
23
|
summaryMethod?: (param: {
|
|
24
|
-
columns: TableColumnCtx<Record<string, unknown>>[]
|
|
24
|
+
columns: TableColumnCtx<Record<string, unknown>>[]
|
|
25
25
|
data: T[]
|
|
26
26
|
}) => (string | VNode)[]
|
|
27
27
|
/** 行樣式類名 */
|
|
@@ -67,7 +67,10 @@ export interface SortTableProps<T extends Record<string, unknown> = Record<strin
|
|
|
67
67
|
/** 是否顯示溢出提示 */
|
|
68
68
|
showOverFlowTooltip?: boolean
|
|
69
69
|
/** 匯總方法 */
|
|
70
|
-
summaryMethod?: (param: {
|
|
70
|
+
summaryMethod?: (param: {
|
|
71
|
+
columns: import('element-plus').TableColumnCtx<Record<string, unknown>>[]
|
|
72
|
+
data: T[]
|
|
73
|
+
}) => (string | import('vue').VNode)[]
|
|
71
74
|
/** 行樣式類名 */
|
|
72
75
|
sortTableRowClassName?: (data: { row: T; rowIndex: number }) => string
|
|
73
76
|
}
|
|
@@ -117,7 +120,10 @@ export interface TitleTableProps<T extends Record<string, unknown> = Record<stri
|
|
|
117
120
|
/** 是否顯示溢出提示 */
|
|
118
121
|
showOverFlowTooltip?: boolean
|
|
119
122
|
/** 匯總方法 */
|
|
120
|
-
summaryMethod?: (param: {
|
|
123
|
+
summaryMethod?: (param: {
|
|
124
|
+
columns: import('element-plus').TableColumnCtx<Record<string, unknown>>[]
|
|
125
|
+
data: T[]
|
|
126
|
+
}) => (string | import('vue').VNode)[]
|
|
121
127
|
}
|
|
122
128
|
|
|
123
129
|
/** TitleTable 組件 Emits 類型 */
|
|
@@ -186,7 +192,6 @@ export interface BaseBtnInstance {
|
|
|
186
192
|
$emit: BaseBtnEmits
|
|
187
193
|
}
|
|
188
194
|
|
|
189
|
-
|
|
190
195
|
// ==================== 對話框相關組件類型 ====================
|
|
191
196
|
|
|
192
197
|
// ==================== BaseDialog 組件類型 ====================
|
|
@@ -229,6 +234,38 @@ export interface BaseDialogInstance {
|
|
|
229
234
|
$emit: BaseDialogEmits
|
|
230
235
|
}
|
|
231
236
|
|
|
237
|
+
// ==================== BaseWaringDialog 組件類型 ====================
|
|
238
|
+
|
|
239
|
+
/** BaseWaringDialog 組件 Props 類型 */
|
|
240
|
+
export interface BaseWaringDialogProps {
|
|
241
|
+
/** 是否顯示對話框 */
|
|
242
|
+
modelValue: boolean
|
|
243
|
+
/** 警告文字 */
|
|
244
|
+
waringText?: string
|
|
245
|
+
/** 副警告文字 */
|
|
246
|
+
subWaringText?: string
|
|
247
|
+
/** 標題文字 */
|
|
248
|
+
titleText?: string
|
|
249
|
+
/** 對話框寬度 */
|
|
250
|
+
modalWidth?: string
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/** BaseWaringDialog 組件 Emits 類型 */
|
|
254
|
+
export interface BaseWaringDialogEmits {
|
|
255
|
+
/** 更新 modelValue 事件 */
|
|
256
|
+
(e: 'update:modelValue', value: boolean): void
|
|
257
|
+
/** 提交事件 */
|
|
258
|
+
(e: 'update:submit'): void
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/** BaseWaringDialog 組件實例類型 */
|
|
262
|
+
export interface BaseWaringDialogInstance {
|
|
263
|
+
/** 組件 Props */
|
|
264
|
+
$props: BaseWaringDialogProps
|
|
265
|
+
/** 組件 Emits */
|
|
266
|
+
$emit: BaseWaringDialogEmits
|
|
267
|
+
}
|
|
268
|
+
|
|
232
269
|
// ==================== TransferDialog 組件類型 ====================
|
|
233
270
|
|
|
234
271
|
/** TransferDialog 組件 Props 類型 */
|
|
@@ -248,7 +285,10 @@ export interface TransferDialogEmits<T = Record<string, unknown>> {
|
|
|
248
285
|
/** 提交事件 */
|
|
249
286
|
(e: 'update:submit', data: import('./index').TableColumn<T>[]): void
|
|
250
287
|
/** checkbox 狀態變更事件 */
|
|
251
|
-
(
|
|
288
|
+
(
|
|
289
|
+
e: 'update:checkChange',
|
|
290
|
+
data: { columns: import('./index').TableColumn<T>[]; checkList: string[] },
|
|
291
|
+
): void
|
|
252
292
|
}
|
|
253
293
|
|
|
254
294
|
/** TransferDialog 組件實例類型 */
|
|
@@ -284,7 +324,7 @@ export interface BaseInputProps {
|
|
|
284
324
|
/** 自動完成 */
|
|
285
325
|
autocomplete?: string
|
|
286
326
|
/** 測試屬性 */
|
|
287
|
-
|
|
327
|
+
showSearch?: boolean
|
|
288
328
|
}
|
|
289
329
|
|
|
290
330
|
/** BaseInput 組件 Emits 類型 */
|
|
@@ -303,7 +343,6 @@ export interface BaseInputInstance {
|
|
|
303
343
|
$emit: BaseInputEmits
|
|
304
344
|
}
|
|
305
345
|
|
|
306
|
-
|
|
307
346
|
// ==================== BaseMultipleInput 組件類型 ====================
|
|
308
347
|
|
|
309
348
|
/** BaseMultipleInput 組件 Props 類型 */
|
|
@@ -314,8 +353,6 @@ export interface BaseMultipleInputProps {
|
|
|
314
353
|
type?: string
|
|
315
354
|
/** 驗證規則函數 */
|
|
316
355
|
validateRule?: (inputString: string) => boolean
|
|
317
|
-
/** 測試屬性 */
|
|
318
|
-
dataCy?: string
|
|
319
356
|
}
|
|
320
357
|
|
|
321
358
|
/** BaseMultipleInput 組件 Emits 類型 */
|
|
@@ -642,7 +679,6 @@ export declare const BaseBtn: DefineComponent<
|
|
|
642
679
|
install: (app: App) => void
|
|
643
680
|
}
|
|
644
681
|
|
|
645
|
-
|
|
646
682
|
/** BaseDialog 組件定義 */
|
|
647
683
|
export declare const BaseDialog: DefineComponent<
|
|
648
684
|
BaseDialogProps,
|
|
@@ -659,6 +695,23 @@ export declare const BaseDialog: DefineComponent<
|
|
|
659
695
|
install: (app: App) => void
|
|
660
696
|
}
|
|
661
697
|
|
|
698
|
+
/** BaseWaringDialog 組件定義 */
|
|
699
|
+
export declare const BaseWaringDialog: DefineComponent<
|
|
700
|
+
BaseWaringDialogProps,
|
|
701
|
+
{},
|
|
702
|
+
{},
|
|
703
|
+
{},
|
|
704
|
+
{},
|
|
705
|
+
{},
|
|
706
|
+
{},
|
|
707
|
+
{},
|
|
708
|
+
{},
|
|
709
|
+
BaseWaringDialogEmits
|
|
710
|
+
> & {
|
|
711
|
+
/** 安裝方法 */
|
|
712
|
+
install: (app: App) => void
|
|
713
|
+
}
|
|
714
|
+
|
|
662
715
|
/** TransferDialog 組件定義 */
|
|
663
716
|
export declare const TransferDialog: DefineComponent<
|
|
664
717
|
TransferDialogProps<any>,
|
|
@@ -691,7 +744,6 @@ export declare const BaseInput: DefineComponent<
|
|
|
691
744
|
install: (app: App) => void
|
|
692
745
|
}
|
|
693
746
|
|
|
694
|
-
|
|
695
747
|
/** BaseMultipleInput 組件定義 */
|
|
696
748
|
export declare const BaseMultipleInput: DefineComponent<
|
|
697
749
|
BaseMultipleInputProps,
|
|
@@ -844,6 +896,8 @@ export interface VueTableComponentsPlugin {
|
|
|
844
896
|
BaseBtn: typeof BaseBtn
|
|
845
897
|
/** BaseDialog 組件 */
|
|
846
898
|
BaseDialog: typeof BaseDialog
|
|
899
|
+
/** BaseWaringDialog 組件 */
|
|
900
|
+
BaseWaringDialog: typeof BaseWaringDialog
|
|
847
901
|
/** TransferDialog 組件 */
|
|
848
902
|
TransferDialog: typeof TransferDialog
|
|
849
903
|
/** BaseInput 組件 */
|
|
@@ -875,6 +929,7 @@ declare module '@vue/runtime-core' {
|
|
|
875
929
|
TitleTable: typeof TitleTable
|
|
876
930
|
BaseBtn: typeof BaseBtn
|
|
877
931
|
BaseDialog: typeof BaseDialog
|
|
932
|
+
BaseWaringDialog: typeof BaseWaringDialog
|
|
878
933
|
TransferDialog: typeof TransferDialog
|
|
879
934
|
BaseInput: typeof BaseInput
|
|
880
935
|
BaseMultipleInput: typeof BaseMultipleInput
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
|
+
export default _default;
|
package/package.json
CHANGED
|
@@ -36,14 +36,14 @@
|
|
|
36
36
|
// 警告對話框樣式
|
|
37
37
|
.waring-dialog {
|
|
38
38
|
.el-dialog__header {
|
|
39
|
-
@apply border-b-orange;
|
|
39
|
+
@apply border-b-orange border border-solid;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
// 上傳結果對話框樣式
|
|
44
44
|
.upload-result-dialog {
|
|
45
45
|
.el-dialog__header {
|
|
46
|
-
@apply border-b-blue-10;
|
|
46
|
+
@apply border-b-blue-10 border border-solid;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -12,7 +12,7 @@ const props = defineProps<{
|
|
|
12
12
|
readonly?: boolean
|
|
13
13
|
maxlength?: string | number
|
|
14
14
|
autocomplete?: string
|
|
15
|
-
|
|
15
|
+
showSearch?: boolean
|
|
16
16
|
}>()
|
|
17
17
|
|
|
18
18
|
const emits = defineEmits<{
|
|
@@ -47,7 +47,7 @@ const handlerClear = () => {
|
|
|
47
47
|
clearable
|
|
48
48
|
@clear="handlerClear"
|
|
49
49
|
>
|
|
50
|
-
<template #prefix>
|
|
50
|
+
<template #prefix v-if="showSearch">
|
|
51
51
|
<div class="text-text-border w-full h-full flex items-center justify-center text-lg">
|
|
52
52
|
<el-icon><Search /></el-icon>
|
|
53
53
|
</div>
|
package/src/components/index.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { default as BaseTable } from './tables/BaseTable.vue'
|
|
|
3
3
|
export { default as BaseBtn } from './items/BaseBtn.vue'
|
|
4
4
|
export { default as BaseInput } from './form/BaseInput.vue'
|
|
5
5
|
export { default as BaseDialog } from './items/BaseDialog.vue'
|
|
6
|
+
export { default as BaseWaringDialog } from './items/BaseWaringDialog.vue'
|
|
6
7
|
export { default as BaseMultipleInput } from './form/BaseMultipleInput.vue'
|
|
7
8
|
export { default as SortTable } from './tables/SortTable.vue'
|
|
8
9
|
export { default as TitleTable } from './tables/TitleTable.vue'
|
|
@@ -29,6 +30,10 @@ export type {
|
|
|
29
30
|
BaseDialogProps,
|
|
30
31
|
BaseDialogEmits,
|
|
31
32
|
BaseDialogInstance,
|
|
33
|
+
// BaseWaringDialog 組件類型
|
|
34
|
+
BaseWaringDialogProps,
|
|
35
|
+
BaseWaringDialogEmits,
|
|
36
|
+
BaseWaringDialogInstance,
|
|
32
37
|
// BaseInput 組件類型
|
|
33
38
|
BaseInputProps,
|
|
34
39
|
BaseInputEmits,
|
|
@@ -85,6 +90,7 @@ export type { default as BaseTableType } from './tables/BaseTable.vue'
|
|
|
85
90
|
export type { default as BaseBtnType } from './items/BaseBtn.vue'
|
|
86
91
|
export type { default as BaseInputType } from './form/BaseInput.vue'
|
|
87
92
|
export type { default as BaseDialogType } from './items/BaseDialog.vue'
|
|
93
|
+
export type { default as BaseWaringDialogType } from './items/BaseWaringDialog.vue'
|
|
88
94
|
export type { default as SortTableType } from './tables/SortTable.vue'
|
|
89
95
|
export type { default as TitleTableType } from './tables/TitleTable.vue'
|
|
90
96
|
export type { default as SearchBarType } from './items/SearchBar.vue'
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import BaseDialog from './BaseDialog.vue'
|
|
4
|
+
|
|
5
|
+
const props = withDefaults(
|
|
6
|
+
defineProps<{
|
|
7
|
+
modelValue: boolean
|
|
8
|
+
waringText?: string
|
|
9
|
+
subWaringText?: string
|
|
10
|
+
titleText?: string
|
|
11
|
+
modalWidth?: string
|
|
12
|
+
}>(),
|
|
13
|
+
{
|
|
14
|
+
waringText: '請問是否確認移除該使用者',
|
|
15
|
+
titleText: '警告',
|
|
16
|
+
},
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
const emit = defineEmits<{
|
|
20
|
+
(e: 'update:modelValue', value: boolean): void
|
|
21
|
+
(e: 'update:submit'): void
|
|
22
|
+
}>()
|
|
23
|
+
const dialogVisible = computed({
|
|
24
|
+
get: () => props.modelValue,
|
|
25
|
+
set: (value) => emit('update:modelValue', value),
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
const handleSubmit = () => {
|
|
29
|
+
emit('update:submit')
|
|
30
|
+
}
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<template>
|
|
34
|
+
<base-dialog
|
|
35
|
+
v-model="dialogVisible"
|
|
36
|
+
:title="titleText"
|
|
37
|
+
:custom-width="modalWidth"
|
|
38
|
+
:is-waring="true"
|
|
39
|
+
@click:submit="handleSubmit"
|
|
40
|
+
>
|
|
41
|
+
<div class="w-full h-16 flex items-center justify-center flex-col">
|
|
42
|
+
<slot>
|
|
43
|
+
<p>{{ subWaringText }}</p>
|
|
44
|
+
<p>{{ waringText }} ?</p>
|
|
45
|
+
</slot>
|
|
46
|
+
</div>
|
|
47
|
+
</base-dialog>
|
|
48
|
+
</template>
|
|
49
|
+
|
|
50
|
+
<style scoped lang="scss"></style>
|
|
@@ -22,7 +22,7 @@ export interface BaseTableProps<T extends Record<string, unknown> = Record<strin
|
|
|
22
22
|
showOverFlowTooltip?: boolean
|
|
23
23
|
/** 匯總方法 */
|
|
24
24
|
summaryMethod?: (param: {
|
|
25
|
-
columns: TableColumnCtx<Record<string, unknown>>[]
|
|
25
|
+
columns: TableColumnCtx<Record<string, unknown>>[]
|
|
26
26
|
data: T[]
|
|
27
27
|
}) => (string | VNode)[]
|
|
28
28
|
/** 行樣式類名 */
|
|
@@ -68,7 +68,10 @@ export interface SortTableProps<T extends Record<string, unknown> = Record<strin
|
|
|
68
68
|
/** 是否顯示溢出提示 */
|
|
69
69
|
showOverFlowTooltip?: boolean
|
|
70
70
|
/** 匯總方法 */
|
|
71
|
-
summaryMethod?: (param: {
|
|
71
|
+
summaryMethod?: (param: {
|
|
72
|
+
columns: import('element-plus').TableColumnCtx<Record<string, unknown>>[]
|
|
73
|
+
data: T[]
|
|
74
|
+
}) => (string | import('vue').VNode)[]
|
|
72
75
|
/** 行樣式類名 */
|
|
73
76
|
sortTableRowClassName?: (data: { row: T; rowIndex: number }) => string
|
|
74
77
|
}
|
|
@@ -118,7 +121,10 @@ export interface TitleTableProps<T extends Record<string, unknown> = Record<stri
|
|
|
118
121
|
/** 是否顯示溢出提示 */
|
|
119
122
|
showOverFlowTooltip?: boolean
|
|
120
123
|
/** 匯總方法 */
|
|
121
|
-
summaryMethod?: (param: {
|
|
124
|
+
summaryMethod?: (param: {
|
|
125
|
+
columns: import('element-plus').TableColumnCtx<Record<string, unknown>>[]
|
|
126
|
+
data: T[]
|
|
127
|
+
}) => (string | import('vue').VNode)[]
|
|
122
128
|
}
|
|
123
129
|
|
|
124
130
|
/** TitleTable 組件 Emits 類型 */
|
|
@@ -187,7 +193,6 @@ export interface BaseBtnInstance {
|
|
|
187
193
|
$emit: BaseBtnEmits
|
|
188
194
|
}
|
|
189
195
|
|
|
190
|
-
|
|
191
196
|
// ==================== 對話框相關組件類型 ====================
|
|
192
197
|
|
|
193
198
|
// ==================== BaseDialog 組件類型 ====================
|
|
@@ -230,6 +235,38 @@ export interface BaseDialogInstance {
|
|
|
230
235
|
$emit: BaseDialogEmits
|
|
231
236
|
}
|
|
232
237
|
|
|
238
|
+
// ==================== BaseWaringDialog 組件類型 ====================
|
|
239
|
+
|
|
240
|
+
/** BaseWaringDialog 組件 Props 類型 */
|
|
241
|
+
export interface BaseWaringDialogProps {
|
|
242
|
+
/** 是否顯示對話框 */
|
|
243
|
+
modelValue: boolean
|
|
244
|
+
/** 警告文字 */
|
|
245
|
+
waringText?: string
|
|
246
|
+
/** 副警告文字 */
|
|
247
|
+
subWaringText?: string
|
|
248
|
+
/** 標題文字 */
|
|
249
|
+
titleText?: string
|
|
250
|
+
/** 對話框寬度 */
|
|
251
|
+
modalWidth?: string
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/** BaseWaringDialog 組件 Emits 類型 */
|
|
255
|
+
export interface BaseWaringDialogEmits {
|
|
256
|
+
/** 更新 modelValue 事件 */
|
|
257
|
+
(e: 'update:modelValue', value: boolean): void
|
|
258
|
+
/** 提交事件 */
|
|
259
|
+
(e: 'update:submit'): void
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/** BaseWaringDialog 組件實例類型 */
|
|
263
|
+
export interface BaseWaringDialogInstance {
|
|
264
|
+
/** 組件 Props */
|
|
265
|
+
$props: BaseWaringDialogProps
|
|
266
|
+
/** 組件 Emits */
|
|
267
|
+
$emit: BaseWaringDialogEmits
|
|
268
|
+
}
|
|
269
|
+
|
|
233
270
|
// ==================== TransferDialog 組件類型 ====================
|
|
234
271
|
|
|
235
272
|
/** TransferDialog 組件 Props 類型 */
|
|
@@ -249,7 +286,10 @@ export interface TransferDialogEmits<T = Record<string, unknown>> {
|
|
|
249
286
|
/** 提交事件 */
|
|
250
287
|
(e: 'update:submit', data: import('./index').TableColumn<T>[]): void
|
|
251
288
|
/** checkbox 狀態變更事件 */
|
|
252
|
-
(
|
|
289
|
+
(
|
|
290
|
+
e: 'update:checkChange',
|
|
291
|
+
data: { columns: import('./index').TableColumn<T>[]; checkList: string[] },
|
|
292
|
+
): void
|
|
253
293
|
}
|
|
254
294
|
|
|
255
295
|
/** TransferDialog 組件實例類型 */
|
|
@@ -285,7 +325,7 @@ export interface BaseInputProps {
|
|
|
285
325
|
/** 自動完成 */
|
|
286
326
|
autocomplete?: string
|
|
287
327
|
/** 測試屬性 */
|
|
288
|
-
|
|
328
|
+
showSearch?: boolean
|
|
289
329
|
}
|
|
290
330
|
|
|
291
331
|
/** BaseInput 組件 Emits 類型 */
|
|
@@ -304,7 +344,6 @@ export interface BaseInputInstance {
|
|
|
304
344
|
$emit: BaseInputEmits
|
|
305
345
|
}
|
|
306
346
|
|
|
307
|
-
|
|
308
347
|
// ==================== BaseMultipleInput 組件類型 ====================
|
|
309
348
|
|
|
310
349
|
/** BaseMultipleInput 組件 Props 類型 */
|
|
@@ -315,8 +354,6 @@ export interface BaseMultipleInputProps {
|
|
|
315
354
|
type?: string
|
|
316
355
|
/** 驗證規則函數 */
|
|
317
356
|
validateRule?: (inputString: string) => boolean
|
|
318
|
-
/** 測試屬性 */
|
|
319
|
-
dataCy?: string
|
|
320
357
|
}
|
|
321
358
|
|
|
322
359
|
/** BaseMultipleInput 組件 Emits 類型 */
|
|
@@ -643,7 +680,6 @@ export declare const BaseBtn: DefineComponent<
|
|
|
643
680
|
install: (app: App) => void
|
|
644
681
|
}
|
|
645
682
|
|
|
646
|
-
|
|
647
683
|
/** BaseDialog 組件定義 */
|
|
648
684
|
export declare const BaseDialog: DefineComponent<
|
|
649
685
|
BaseDialogProps,
|
|
@@ -660,6 +696,23 @@ export declare const BaseDialog: DefineComponent<
|
|
|
660
696
|
install: (app: App) => void
|
|
661
697
|
}
|
|
662
698
|
|
|
699
|
+
/** BaseWaringDialog 組件定義 */
|
|
700
|
+
export declare const BaseWaringDialog: DefineComponent<
|
|
701
|
+
BaseWaringDialogProps,
|
|
702
|
+
{},
|
|
703
|
+
{},
|
|
704
|
+
{},
|
|
705
|
+
{},
|
|
706
|
+
{},
|
|
707
|
+
{},
|
|
708
|
+
{},
|
|
709
|
+
{},
|
|
710
|
+
BaseWaringDialogEmits
|
|
711
|
+
> & {
|
|
712
|
+
/** 安裝方法 */
|
|
713
|
+
install: (app: App) => void
|
|
714
|
+
}
|
|
715
|
+
|
|
663
716
|
/** TransferDialog 組件定義 */
|
|
664
717
|
export declare const TransferDialog: DefineComponent<
|
|
665
718
|
TransferDialogProps<any>,
|
|
@@ -692,7 +745,6 @@ export declare const BaseInput: DefineComponent<
|
|
|
692
745
|
install: (app: App) => void
|
|
693
746
|
}
|
|
694
747
|
|
|
695
|
-
|
|
696
748
|
/** BaseMultipleInput 組件定義 */
|
|
697
749
|
export declare const BaseMultipleInput: DefineComponent<
|
|
698
750
|
BaseMultipleInputProps,
|
|
@@ -845,6 +897,8 @@ export interface VueTableComponentsPlugin {
|
|
|
845
897
|
BaseBtn: typeof BaseBtn
|
|
846
898
|
/** BaseDialog 組件 */
|
|
847
899
|
BaseDialog: typeof BaseDialog
|
|
900
|
+
/** BaseWaringDialog 組件 */
|
|
901
|
+
BaseWaringDialog: typeof BaseWaringDialog
|
|
848
902
|
/** TransferDialog 組件 */
|
|
849
903
|
TransferDialog: typeof TransferDialog
|
|
850
904
|
/** BaseInput 組件 */
|
|
@@ -876,6 +930,7 @@ declare module '@vue/runtime-core' {
|
|
|
876
930
|
TitleTable: typeof TitleTable
|
|
877
931
|
BaseBtn: typeof BaseBtn
|
|
878
932
|
BaseDialog: typeof BaseDialog
|
|
933
|
+
BaseWaringDialog: typeof BaseWaringDialog
|
|
879
934
|
TransferDialog: typeof TransferDialog
|
|
880
935
|
BaseInput: typeof BaseInput
|
|
881
936
|
BaseMultipleInput: typeof BaseMultipleInput
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts" generic="T extends Record<string, unknown>">
|
|
2
|
-
import { computed, ref, useAttrs } from 'vue'
|
|
3
|
-
import type { FormInstance, FormRules } from 'element-plus'
|
|
4
|
-
|
|
5
|
-
type Props<T extends object = object> = {
|
|
6
|
-
modelValue?: T
|
|
7
|
-
rules?: FormRules
|
|
8
|
-
labelWidth?: string
|
|
9
|
-
}
|
|
10
|
-
const props = withDefaults(defineProps<Props>(), {})
|
|
11
|
-
|
|
12
|
-
// 獲取所有非 props 屬性
|
|
13
|
-
const attrs = useAttrs()
|
|
14
|
-
|
|
15
|
-
const computedLabelWidth = computed(() => {
|
|
16
|
-
if (props.labelWidth) return props.labelWidth
|
|
17
|
-
else return '100px'
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
const formData = computed(() => props.modelValue)
|
|
21
|
-
|
|
22
|
-
defineEmits<{
|
|
23
|
-
(e: 'update:modelValue', value: Record<string, unknown>): void
|
|
24
|
-
(e: 'submit'): void
|
|
25
|
-
(e: 'validate', valid: boolean): void
|
|
26
|
-
}>()
|
|
27
|
-
|
|
28
|
-
const formRef = ref<FormInstance>()
|
|
29
|
-
|
|
30
|
-
const validate = async () => {
|
|
31
|
-
if (!formRef.value) return false
|
|
32
|
-
return await formRef.value.validate()
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const resetFields = () => {
|
|
36
|
-
formRef.value?.resetFields()
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const clearValidate = (props?: string | string[]) => {
|
|
40
|
-
formRef.value?.clearValidate(props)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const validateField = (prop: string) => {
|
|
44
|
-
formRef.value?.validateField(prop)
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
defineExpose({
|
|
48
|
-
validate,
|
|
49
|
-
resetFields,
|
|
50
|
-
clearValidate,
|
|
51
|
-
validateField,
|
|
52
|
-
})
|
|
53
|
-
</script>
|
|
54
|
-
|
|
55
|
-
<template>
|
|
56
|
-
<el-form
|
|
57
|
-
v-bind="attrs"
|
|
58
|
-
ref="formRef"
|
|
59
|
-
:model="formData"
|
|
60
|
-
:label-width="computedLabelWidth"
|
|
61
|
-
:rules="rules"
|
|
62
|
-
@submit.prevent
|
|
63
|
-
class="filter-form"
|
|
64
|
-
>
|
|
65
|
-
<slot></slot>
|
|
66
|
-
</el-form>
|
|
67
|
-
</template>
|
|
68
|
-
|
|
69
|
-
<style scoped lang="scss"></style>
|