ch3chi-commons-vue 1.2.0 → 1.8.1
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/package.json +2 -1
- package/src/api/ApiService.ts +869 -0
- package/src/auth/AuthorizationService.ts +138 -0
- package/src/auth/PermissionDescriptor.ts +99 -0
- package/src/auth/keys.ts +5 -0
- package/src/components/CAlert.vue +188 -0
- package/src/components/CAlertDefine.ts +20 -0
- package/src/components/CBSToast.vue +119 -0
- package/src/components/CGlobalSpinner.vue +84 -0
- package/src/components/CImage.vue +67 -0
- package/src/components/CRowCheckBox.vue +75 -0
- package/src/components/CRowTextInput.vue +27 -0
- package/src/components/CTable.vue +524 -0
- package/src/components/CTableDefine.ts +566 -0
- package/src/components/CTableTD.vue +28 -0
- package/src/components/HasPermission.vue +28 -0
- package/src/components/form/CChangePasswordFormField.vue +146 -0
- package/src/components/form/CCheckBoxFormField.vue +91 -0
- package/src/components/form/CCheckBoxPlatFormField.vue +94 -0
- package/src/components/form/CDateFormField.vue +149 -0
- package/src/components/form/CDateQueryField.vue +111 -0
- package/src/components/form/CDateRangeFormField.vue +138 -0
- package/src/components/form/CFilePickerFormField.vue +471 -0
- package/src/components/form/CRadioFormField.vue +62 -0
- package/src/components/form/CRadioPlatFormField.vue +67 -0
- package/src/components/form/CSelectFormField.vue +175 -0
- package/src/components/form/CTextAreaFormField.vue +84 -0
- package/src/components/form/CTextInputFormField.vue +99 -0
- package/src/components/form/CTinyMCEEditorFormField.vue +99 -0
- package/src/components/form/SCTextInputFormField.vue +129 -0
- package/src/composables/useCheckBoxFormField.ts +126 -0
- package/src/composables/useRadioFormField.ts +106 -0
- package/src/directive/CBootstrapDirective.ts +83 -0
- package/src/directive/CDateFormatterDirective.ts +37 -0
- package/src/directive/CFTurnstileDirective.ts +46 -0
- package/src/directive/CFormDirective.ts +57 -0
- package/src/directive/PermissionDirective.ts +102 -0
- package/src/env.d.ts +19 -0
- package/src/index.ts +83 -0
- package/src/model/BSFieldStyleConfig.ts +349 -0
- package/src/model/BaseDictionary.ts +86 -0
- package/src/model/BaseFormDataModel.ts +623 -0
- package/src/model/BaseListViewModel.ts +392 -0
- package/src/model/CBSModalViewModel.ts +91 -0
- package/src/model/CFileDataModel.ts +181 -0
- package/src/model/CImageViewModel.ts +34 -0
- package/src/model/CMenuItem.ts +199 -0
- package/src/model/EmailReceiverDataModel.ts +149 -0
- package/src/model/EmptyDataModel.ts +25 -0
- package/src/model/FormOptions.ts +112 -0
- package/src/model/LoginDataModel.ts +51 -0
- package/src/model/PasswordDataModel.ts +70 -0
- package/src/model/QueryParameter.ts +310 -0
- package/src/model/SessionUser.ts +110 -0
- package/src/model/ShowMessageDataModel.ts +69 -0
- package/src/model/TokenUser.ts +157 -0
- package/src/stores/FormDataStore.ts +73 -0
- package/src/stores/ViewStore.ts +701 -0
- package/src/stores/VueSessionStoreInstaller.ts +22 -0
- package/src/types/turnstile.d.ts +8 -0
- package/src/utils/CToolUtils.ts +133 -0
- package/dist/api/ApiService.d.ts +0 -233
- package/dist/auth/AuthorizationService.d.ts +0 -56
- package/dist/auth/PermissionDescriptor.d.ts +0 -37
- package/dist/components/CAlert.vue.d.ts +0 -17
- package/dist/components/CAlertDefine.d.ts +0 -14
- package/dist/components/CBSToast.vue.d.ts +0 -6
- package/dist/components/CGlobalSpinner.vue.d.ts +0 -13
- package/dist/components/CRowCheckBox.vue.d.ts +0 -14
- package/dist/components/CRowTextInput.vue.d.ts +0 -10
- package/dist/components/CTable.vue.d.ts +0 -24
- package/dist/components/CTableDefine.d.ts +0 -201
- package/dist/components/CTableTD.vue.d.ts +0 -7
- package/dist/components/form/CChangePasswordFormField.vue.d.ts +0 -14
- package/dist/components/form/CCheckBoxFormField.vue.d.ts +0 -30
- package/dist/components/form/CDateFormField.vue.d.ts +0 -17
- package/dist/components/form/CDateQueryField.vue.d.ts +0 -16
- package/dist/components/form/CDateRangeFormField.vue.d.ts +0 -17
- package/dist/components/form/CFilePickerFormField.vue.d.ts +0 -28
- package/dist/components/form/CRadioFormField.vue.d.ts +0 -30
- package/dist/components/form/CSelectFormField.vue.d.ts +0 -18
- package/dist/components/form/CTextAreaFormField.vue.d.ts +0 -16
- package/dist/components/form/CTextInputFormField.vue.d.ts +0 -22
- package/dist/directive/CBootstrapDirective.d.ts +0 -17
- package/dist/directive/CDateFormatterDirective.d.ts +0 -10
- package/dist/directive/CFTurnstileDirective.d.ts +0 -15
- package/dist/directive/CFormDirective.d.ts +0 -9
- package/dist/directive/PermissionDirective.d.ts +0 -15
- package/dist/index.cjs.js +0 -19103
- package/dist/index.d.ts +0 -45
- package/dist/index.es.js +0 -19086
- package/dist/model/BSFieldStyleConfig.d.ts +0 -121
- package/dist/model/BaseDictionary.d.ts +0 -34
- package/dist/model/BaseFormDataModel.d.ts +0 -199
- package/dist/model/BaseListViewModel.d.ts +0 -165
- package/dist/model/CBSModalViewModel.d.ts +0 -44
- package/dist/model/CFileDataModel.d.ts +0 -74
- package/dist/model/CImageViewModel.d.ts +0 -8
- package/dist/model/CMenuItem.d.ts +0 -86
- package/dist/model/EmailReceiverDataModel.d.ts +0 -57
- package/dist/model/EmptyDataModel.d.ts +0 -7
- package/dist/model/FormOptions.d.ts +0 -60
- package/dist/model/LoginDataModel.d.ts +0 -12
- package/dist/model/PasswordDataModel.d.ts +0 -15
- package/dist/model/QueryParameter.d.ts +0 -92
- package/dist/model/SessionUser.d.ts +0 -45
- package/dist/model/ShowMessageDataModel.d.ts +0 -44
- package/dist/model/TokenUser.d.ts +0 -50
- package/dist/stores/FormDataStore.d.ts +0 -31
- package/dist/stores/ViewStore.d.ts +0 -349
- package/dist/style.css +0 -223
- package/dist/utils/CToolUtils.d.ts +0 -53
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { Ref } from 'vue';
|
|
2
|
-
import { PermissionDescriptor } from '../auth/PermissionDescriptor';
|
|
3
|
-
/**
|
|
4
|
-
* MenuItem 介面用於描述左側選單項目結構
|
|
5
|
-
* name: 顯示名稱
|
|
6
|
-
* icon: 圖示 class 或路徑(可選)
|
|
7
|
-
* path: 路由路徑
|
|
8
|
-
* children: 子選單項目(可選,型別為 CMenuItem 陣列)
|
|
9
|
-
*/
|
|
10
|
-
export interface MenuItem {
|
|
11
|
-
id: string;
|
|
12
|
-
name: string;
|
|
13
|
-
icon?: string;
|
|
14
|
-
fontIcon?: string;
|
|
15
|
-
path?: string;
|
|
16
|
-
children?: MenuItem[];
|
|
17
|
-
needRoles?: string[];
|
|
18
|
-
permission?: string | string[];
|
|
19
|
-
activePaths?: string[];
|
|
20
|
-
hasChildren?: () => boolean;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* CMenuItem 類別實現 MenuItem 介面
|
|
24
|
-
*/
|
|
25
|
-
export declare class CMenuItem implements MenuItem {
|
|
26
|
-
id: string;
|
|
27
|
-
name: string;
|
|
28
|
-
icon?: string;
|
|
29
|
-
fontIcon?: string;
|
|
30
|
-
path?: string;
|
|
31
|
-
needRoles?: string[];
|
|
32
|
-
permission?: string | string[];
|
|
33
|
-
permissionDescriptors?: PermissionDescriptor[];
|
|
34
|
-
activePaths?: string[];
|
|
35
|
-
children?: CMenuItem[];
|
|
36
|
-
isOpen?: Ref<boolean>;
|
|
37
|
-
isActive?: Ref<boolean>;
|
|
38
|
-
constructor(params: MenuItem);
|
|
39
|
-
/**
|
|
40
|
-
* 判斷是否有子選單項目
|
|
41
|
-
* @returns {boolean} 如果有子選單項目則返回 true,否則返回 false
|
|
42
|
-
*/
|
|
43
|
-
hasChildren(): boolean;
|
|
44
|
-
/**
|
|
45
|
-
* 使用 collapse 屬性來控制子選單的展開或收起狀態
|
|
46
|
-
* 這個方法可以在 Vue 模板中使用 v-bind 指令來
|
|
47
|
-
* 綁定到 collapse 屬性上,以實現子選單的折
|
|
48
|
-
*/
|
|
49
|
-
useCollapseAttribute(): Record<string, any>;
|
|
50
|
-
/**
|
|
51
|
-
* 使用 collapseId 方法來生成唯一的折疊 ID
|
|
52
|
-
*/
|
|
53
|
-
useCollapseId(): string;
|
|
54
|
-
/**
|
|
55
|
-
* 使用 useClassName 方法來生成 CSS 類名
|
|
56
|
-
*/
|
|
57
|
-
useClassNameForNavLink(): string;
|
|
58
|
-
/**
|
|
59
|
-
* 使用 useClassName 方法來生成 CSS 類名
|
|
60
|
-
*/
|
|
61
|
-
useClassNameForLi(): string;
|
|
62
|
-
/**
|
|
63
|
-
* 計算箭頭圖示的 CSS 類名
|
|
64
|
-
*/
|
|
65
|
-
computeArrowClass(): string;
|
|
66
|
-
/**
|
|
67
|
-
* 計算折疊顯示的 CSS 類名
|
|
68
|
-
*/
|
|
69
|
-
computeCollapseShowClass(): string;
|
|
70
|
-
/**
|
|
71
|
-
* 計算折疊的 CSS 類名
|
|
72
|
-
* @returns {string} 返回折疊的 CSS 類名
|
|
73
|
-
*/
|
|
74
|
-
collapseClassName(): string;
|
|
75
|
-
/**
|
|
76
|
-
* 檢查當前路徑是否與此選單項目的路徑匹配
|
|
77
|
-
* @param currentPath
|
|
78
|
-
*/
|
|
79
|
-
checkCurrentPath(currentPath: string): boolean;
|
|
80
|
-
/**
|
|
81
|
-
* 靜態方法用於從 MenuItem 物件解析出 CMenuItem 實例
|
|
82
|
-
* @param item {MenuItem} 要解析的 MenuItem 物件
|
|
83
|
-
* @return {CMenuItem} 返回解析後的 CMenuItem 實例
|
|
84
|
-
*/
|
|
85
|
-
static parse(item: MenuItem): CMenuItem;
|
|
86
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { BaseFormDataModel } from './BaseFormDataModel';
|
|
2
|
-
import { ComputedRef } from 'vue';
|
|
3
|
-
import * as yup from "yup";
|
|
4
|
-
/**
|
|
5
|
-
* Email 收件人資料
|
|
6
|
-
*/
|
|
7
|
-
export declare class EmailRecipientData extends BaseFormDataModel {
|
|
8
|
-
email: string;
|
|
9
|
-
type: 'receiver' | 'cc' | 'bcc';
|
|
10
|
-
constructor(data?: Partial<EmailRecipientData>);
|
|
11
|
-
dataFieldNameList(): string[];
|
|
12
|
-
initFormSchema(): yup.ObjectSchema<{
|
|
13
|
-
email: string;
|
|
14
|
-
type: NonNullable<"receiver" | "cc" | "bcc" | undefined>;
|
|
15
|
-
}, yup.AnyObject, {
|
|
16
|
-
email: undefined;
|
|
17
|
-
type: undefined;
|
|
18
|
-
}, "">;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Email 收件人資料模型
|
|
22
|
-
*
|
|
23
|
-
*/
|
|
24
|
-
export declare class EmailReceiverDataModel extends BaseFormDataModel {
|
|
25
|
-
recipientList: Array<EmailRecipientData>;
|
|
26
|
-
constructor(data?: Partial<EmailReceiverDataModel>);
|
|
27
|
-
dataFieldNameList(): string[];
|
|
28
|
-
initFormSchema(): yup.ObjectSchema<{
|
|
29
|
-
recipientList: {
|
|
30
|
-
type: NonNullable<"receiver" | "cc" | "bcc" | undefined>;
|
|
31
|
-
email: string;
|
|
32
|
-
}[] | undefined;
|
|
33
|
-
}, yup.AnyObject, {
|
|
34
|
-
recipientList: "";
|
|
35
|
-
}, "">;
|
|
36
|
-
toPayload(key?: string): Record<string, any>;
|
|
37
|
-
/**
|
|
38
|
-
* 收件人列表
|
|
39
|
-
* @return {ComputedRef<Array<EmailRecipientData>>}
|
|
40
|
-
*/
|
|
41
|
-
dataList(): ComputedRef<Array<EmailRecipientData>>;
|
|
42
|
-
/**
|
|
43
|
-
* 新增收件人
|
|
44
|
-
* @param data
|
|
45
|
-
*/
|
|
46
|
-
add(data?: Partial<EmailRecipientData>): void;
|
|
47
|
-
/**
|
|
48
|
-
* 刪除收件人
|
|
49
|
-
* @param index
|
|
50
|
-
*/
|
|
51
|
-
remove(index: number): void;
|
|
52
|
-
/**
|
|
53
|
-
* 清空表單
|
|
54
|
-
*/
|
|
55
|
-
clean(): void;
|
|
56
|
-
get recipientListField(): import('vee-validate').FieldContext;
|
|
57
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { BaseFormDataModel } from './BaseFormDataModel';
|
|
2
|
-
import * as yup from 'yup';
|
|
3
|
-
export declare class EmptyDataModel extends BaseFormDataModel {
|
|
4
|
-
constructor(data?: Partial<EmptyDataModel>);
|
|
5
|
-
initFormSchema(): yup.ObjectSchema<{}, yup.AnyObject, {}, "">;
|
|
6
|
-
dataFieldNameList(): string[];
|
|
7
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 表單選項相關的 TypeScript 接口定義
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* COptionItem 接口定義
|
|
6
|
-
*/
|
|
7
|
-
export interface COptionItem {
|
|
8
|
-
id: string;
|
|
9
|
-
text: string;
|
|
10
|
-
value: string | number | boolean;
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
selected?: boolean;
|
|
13
|
-
children?: CCOptionItem[];
|
|
14
|
-
meta?: Record<string, any>;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* COptionItem 類別實現
|
|
18
|
-
*/
|
|
19
|
-
export declare class CCOptionItem implements COptionItem {
|
|
20
|
-
id: string;
|
|
21
|
-
text: string;
|
|
22
|
-
value: string | number | boolean;
|
|
23
|
-
disabled?: boolean;
|
|
24
|
-
selected?: boolean;
|
|
25
|
-
children?: CCOptionItem[];
|
|
26
|
-
meta?: Record<string, any>;
|
|
27
|
-
constructor(data?: Partial<COptionItem>);
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* DataCategory 資料類別
|
|
31
|
-
*/
|
|
32
|
-
export declare class DataCategory {
|
|
33
|
-
slug?: string;
|
|
34
|
-
name?: string;
|
|
35
|
-
constructor(data?: Partial<DataCategory>);
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* 基本狀態選項
|
|
39
|
-
*/
|
|
40
|
-
export declare const ToggleStatusOptions: COptionItem[];
|
|
41
|
-
/**
|
|
42
|
-
* 通用選項,適用當 value 為 boolean 時
|
|
43
|
-
*/
|
|
44
|
-
export declare const CommonStatusOptions: COptionItem[];
|
|
45
|
-
/**
|
|
46
|
-
* 通用選項,適用當 value 為字串時
|
|
47
|
-
*/
|
|
48
|
-
export declare const CommonStatusStrOptions: COptionItem[];
|
|
49
|
-
/**
|
|
50
|
-
* 是/否 選項
|
|
51
|
-
*/
|
|
52
|
-
export declare const YesNoStatusOptions: COptionItem[];
|
|
53
|
-
export declare const OptionUtils: {
|
|
54
|
-
/**
|
|
55
|
-
* 根據 CommonStatusOptions 產生對應的 狀態標籤 HTML
|
|
56
|
-
* @param value 狀態值
|
|
57
|
-
*/
|
|
58
|
-
makeCommonStatusLabelText: (value: string | boolean) => string;
|
|
59
|
-
};
|
|
60
|
-
export declare const __FormOptionsTypes__: COptionItem & DataCategory;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { BaseFormDataModel } from './BaseFormDataModel';
|
|
2
|
-
import { ObjectSchema } from 'yup';
|
|
3
|
-
export declare class LoginDataModel extends BaseFormDataModel {
|
|
4
|
-
account?: string;
|
|
5
|
-
password?: string;
|
|
6
|
-
turnstileToken?: string;
|
|
7
|
-
enableCFTurnstile: boolean;
|
|
8
|
-
constructor(data?: Partial<LoginDataModel>);
|
|
9
|
-
dataFieldNameList(): string[];
|
|
10
|
-
initFormSchema(): ObjectSchema<any>;
|
|
11
|
-
formToJsonData(): Record<string, any>;
|
|
12
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { BaseFormDataModel } from './BaseFormDataModel';
|
|
2
|
-
import { ObjectSchema } from 'yup';
|
|
3
|
-
/**
|
|
4
|
-
* 密碼數據模型
|
|
5
|
-
*/
|
|
6
|
-
export declare class PasswordDataModel extends BaseFormDataModel {
|
|
7
|
-
oldPassword: string | null;
|
|
8
|
-
newPassword: string | null;
|
|
9
|
-
confirmNewPassword: string | null;
|
|
10
|
-
requiredOldPassword: boolean;
|
|
11
|
-
constructor(data?: Partial<PasswordDataModel>);
|
|
12
|
-
dataFieldNameList(): string[];
|
|
13
|
-
initFormSchema(): ObjectSchema<any>;
|
|
14
|
-
toPayload(): Record<string, any>;
|
|
15
|
-
}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { ApiResponse } from '../api/ApiService';
|
|
2
|
-
export type SortDirection = 'ASC' | 'asc' | 'DESC' | 'desc';
|
|
3
|
-
/**
|
|
4
|
-
* QuerySort 定義了查詢的排序條件
|
|
5
|
-
*/
|
|
6
|
-
export interface QuerySort {
|
|
7
|
-
field: string;
|
|
8
|
-
direction: SortDirection;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* IQueryPage 定義了查詢的分頁資訊
|
|
12
|
-
*/
|
|
13
|
-
export interface IQueryPage {
|
|
14
|
-
pageIndex: number;
|
|
15
|
-
pageSize: number;
|
|
16
|
-
totalPage: number;
|
|
17
|
-
totalCount: number;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* QueryPage 實現了 IQueryPage 接口,提供分頁資訊的管理
|
|
21
|
-
*/
|
|
22
|
-
export declare class QueryPage implements IQueryPage {
|
|
23
|
-
pageIndex: number;
|
|
24
|
-
pageSize: number;
|
|
25
|
-
totalPage: number;
|
|
26
|
-
private _totalCount;
|
|
27
|
-
pageRangeDisplayed: number;
|
|
28
|
-
constructor(data?: Partial<QueryPage>);
|
|
29
|
-
get totalCount(): number;
|
|
30
|
-
set totalCount(value: number);
|
|
31
|
-
get offset(): number;
|
|
32
|
-
/**
|
|
33
|
-
* 計算總頁數
|
|
34
|
-
*/
|
|
35
|
-
calcTotalPage(): void;
|
|
36
|
-
hasPreviousPage(): boolean;
|
|
37
|
-
hasNextPage(): boolean;
|
|
38
|
-
previous(): void;
|
|
39
|
-
next(): void;
|
|
40
|
-
isShowFirstPage(): boolean;
|
|
41
|
-
isShowLastPage(): boolean;
|
|
42
|
-
usePageItemArray(): number[];
|
|
43
|
-
/**
|
|
44
|
-
* 生成分頁的顯示範圍,項目為從 0 開始的頁碼陣列
|
|
45
|
-
*
|
|
46
|
-
* @returns {number[]} 返回一個包含顯示頁碼的陣列
|
|
47
|
-
*/
|
|
48
|
-
pageRange(): number[];
|
|
49
|
-
}
|
|
50
|
-
export interface QueryParameter {
|
|
51
|
-
keyword?: string | null;
|
|
52
|
-
page?: QueryPage;
|
|
53
|
-
sort?: QuerySort[];
|
|
54
|
-
}
|
|
55
|
-
export declare class QueryParameter implements QueryParameter {
|
|
56
|
-
keyword?: string | null;
|
|
57
|
-
page?: QueryPage;
|
|
58
|
-
sort?: QuerySort[];
|
|
59
|
-
constructor(data?: Partial<QueryParameter>);
|
|
60
|
-
/**
|
|
61
|
-
* 載入查詢參數資料
|
|
62
|
-
* @param data 部分或全部的查詢參數
|
|
63
|
-
*/
|
|
64
|
-
load(data?: Partial<QueryParameter>): void;
|
|
65
|
-
/**
|
|
66
|
-
* 載入 API 回應資料
|
|
67
|
-
* @param response
|
|
68
|
-
*/
|
|
69
|
-
loadResponse(response: ApiResponse): void;
|
|
70
|
-
/**
|
|
71
|
-
* 產生 API 使用的 payload
|
|
72
|
-
* @returns {Record<string, any>} 返回一個包含查詢參數的物件
|
|
73
|
-
*/
|
|
74
|
-
toPayload(): Record<string, any>;
|
|
75
|
-
/**
|
|
76
|
-
* 產生 URL 查詢參數
|
|
77
|
-
*/
|
|
78
|
-
toQueryStringParam(): Record<string, any>;
|
|
79
|
-
/**
|
|
80
|
-
* 清除查詢參數
|
|
81
|
-
*/
|
|
82
|
-
clear(): void;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* 適用於 Date Range 的查詢參數
|
|
86
|
-
*/
|
|
87
|
-
export declare class DateRangeParam extends QueryParameter {
|
|
88
|
-
startsAt?: Date | null;
|
|
89
|
-
endsAt?: Date | null;
|
|
90
|
-
clear(): void;
|
|
91
|
-
}
|
|
92
|
-
export declare const __QueryParameterDefine__: SortDirection;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Role model
|
|
3
|
-
*/
|
|
4
|
-
export declare class Role {
|
|
5
|
-
uid?: string;
|
|
6
|
-
name?: string;
|
|
7
|
-
type?: string;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* 用來描述操作人員的物件
|
|
11
|
-
* 用來保存已登入的使用者資訊
|
|
12
|
-
*/
|
|
13
|
-
export declare class SessionUser {
|
|
14
|
-
userUid?: string;
|
|
15
|
-
iat?: number;
|
|
16
|
-
account?: string;
|
|
17
|
-
name?: string;
|
|
18
|
-
email?: string;
|
|
19
|
-
roleCode?: string;
|
|
20
|
-
roleName?: string;
|
|
21
|
-
permissions?: string[];
|
|
22
|
-
constructor(data?: Partial<SessionUser>);
|
|
23
|
-
/**
|
|
24
|
-
* 載入資料
|
|
25
|
-
* @param data
|
|
26
|
-
*/
|
|
27
|
-
load(data: Record<string, any>): this;
|
|
28
|
-
/**
|
|
29
|
-
* 從驗證會話資料載入
|
|
30
|
-
* @param data
|
|
31
|
-
*/
|
|
32
|
-
loadFromValidateSession(data: any): this;
|
|
33
|
-
/**
|
|
34
|
-
* 合併資料
|
|
35
|
-
* @param data
|
|
36
|
-
*/
|
|
37
|
-
merge(data: Partial<SessionUser>): SessionUser;
|
|
38
|
-
/**
|
|
39
|
-
* 對載入的資料進行預處理
|
|
40
|
-
* @param data
|
|
41
|
-
*/
|
|
42
|
-
process(data: Record<string, any>): Record<string, any>;
|
|
43
|
-
toJSON(): Record<string, any>;
|
|
44
|
-
loadJSON(data: Record<string, any>): this;
|
|
45
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ShowMessage 訊息類型列舉
|
|
3
|
-
*/
|
|
4
|
-
export declare enum ShowMessageType {
|
|
5
|
-
/** 忘記密碼郵件已發送 */
|
|
6
|
-
FORGOT_PASSWORD_SENT = "FP_SENT",
|
|
7
|
-
/** 重置密碼成功 */
|
|
8
|
-
RESET_PASSWORD_SUCCESS = "RP_OK",
|
|
9
|
-
/** 認證過期 */
|
|
10
|
-
AUTH_EXPIRED = "AUTH_EXP"
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* ShowMessage 頁面訊息資料模型
|
|
14
|
-
* 用於定義系統各種訊息的標題、內容、狀態碼等資訊
|
|
15
|
-
*/
|
|
16
|
-
export interface IShowMessageData {
|
|
17
|
-
title: string;
|
|
18
|
-
message: string;
|
|
19
|
-
code?: string;
|
|
20
|
-
showLoginButton?: boolean;
|
|
21
|
-
showHomeButton?: boolean;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* ShowMessage 訊息定義
|
|
25
|
-
*/
|
|
26
|
-
export declare class ShowMessageDataModel {
|
|
27
|
-
private static _messageMap;
|
|
28
|
-
static set messageMap(map: Record<ShowMessageType, IShowMessageData>);
|
|
29
|
-
/**
|
|
30
|
-
* 根據訊息類型取得訊息資料
|
|
31
|
-
*/
|
|
32
|
-
static getMessageData(type: ShowMessageType): IShowMessageData;
|
|
33
|
-
/**
|
|
34
|
-
* 根據 key 字串取得訊息資料(用於從 query string 解析)
|
|
35
|
-
*/
|
|
36
|
-
static getMessageDataByKey(key: string): IShowMessageData | null;
|
|
37
|
-
/**
|
|
38
|
-
* 將訊息類型轉換為路由參數(path params)
|
|
39
|
-
*/
|
|
40
|
-
static toRouteParams(type: ShowMessageType): {
|
|
41
|
-
type: string;
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
export declare const __ShowMessageDataModelDefine__: ShowMessageType & IShowMessageData;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { SessionUser } from './SessionUser';
|
|
2
|
-
/**
|
|
3
|
-
* 存放存取權杖相關資訊
|
|
4
|
-
*/
|
|
5
|
-
export declare class AccessToken {
|
|
6
|
-
tokenType?: string;
|
|
7
|
-
accessToken?: string;
|
|
8
|
-
accessTokenExpiresAt?: string;
|
|
9
|
-
refreshToken?: string;
|
|
10
|
-
refreshTokenExpiresAt?: string;
|
|
11
|
-
sessionUid?: string;
|
|
12
|
-
constructor(data?: Partial<AccessToken>);
|
|
13
|
-
/**
|
|
14
|
-
* 存取權杖是否已過期
|
|
15
|
-
*/
|
|
16
|
-
isExpired(): boolean;
|
|
17
|
-
/**
|
|
18
|
-
* 刷新權杖是否已過期
|
|
19
|
-
*/
|
|
20
|
-
isRefreshTokenExpired(): boolean;
|
|
21
|
-
/**
|
|
22
|
-
* 載入資料
|
|
23
|
-
* @param data
|
|
24
|
-
*/
|
|
25
|
-
loadToken(data: Record<string, any>): this;
|
|
26
|
-
/**
|
|
27
|
-
* 轉換為 JSON 物件
|
|
28
|
-
*/
|
|
29
|
-
toJSON(): Record<string, any>;
|
|
30
|
-
/**
|
|
31
|
-
* 從 JSON 資料載入
|
|
32
|
-
* @param data
|
|
33
|
-
*/
|
|
34
|
-
loadJSON(data: Record<string, any>): this;
|
|
35
|
-
/**
|
|
36
|
-
* 取得 Bearer Token 字串
|
|
37
|
-
*/
|
|
38
|
-
get bearerToken(): string;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* 帶有 Token 資訊的使用者物件
|
|
42
|
-
*/
|
|
43
|
-
export declare class TokenUser extends SessionUser {
|
|
44
|
-
tokens?: AccessToken;
|
|
45
|
-
profile?: Record<string, any>;
|
|
46
|
-
constructor(data?: Partial<AccessToken>);
|
|
47
|
-
load(data: Record<string, any>): this;
|
|
48
|
-
toJSON(): Record<string, any>;
|
|
49
|
-
loadJSON(data: Record<string, any>): this;
|
|
50
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Backup Form Data Store
|
|
3
|
-
* This store is used to manage the system setting details in a backup form.
|
|
4
|
-
*/
|
|
5
|
-
export declare const backupFormDataStore: import('pinia').StoreDefinition<"formData", {
|
|
6
|
-
store: Record<string, any>;
|
|
7
|
-
}, {
|
|
8
|
-
getBackupData: (state: {
|
|
9
|
-
store: Record<string, any>;
|
|
10
|
-
} & import('pinia').PiniaCustomStateProperties<{
|
|
11
|
-
store: Record<string, any>;
|
|
12
|
-
}>) => (dataName: string) => Record<string, any> | null;
|
|
13
|
-
}, {
|
|
14
|
-
backupData(dataName: string, data: Record<string, any>): void;
|
|
15
|
-
}>;
|
|
16
|
-
/**
|
|
17
|
-
* 用來保留查詢表單的資料到 local storage
|
|
18
|
-
*/
|
|
19
|
-
export declare const useQueryFormDataStore: import('pinia').StoreDefinition<"queryFormData", {
|
|
20
|
-
store: Record<string, any>;
|
|
21
|
-
}, {
|
|
22
|
-
getQueryParam: (state: {
|
|
23
|
-
store: Record<string, any>;
|
|
24
|
-
} & import('pinia').PiniaCustomStateProperties<{
|
|
25
|
-
store: Record<string, any>;
|
|
26
|
-
}>) => (formName: string) => Record<string, any> | null;
|
|
27
|
-
}, {
|
|
28
|
-
save(formName: string, queryParam: Record<string, any>): void;
|
|
29
|
-
loadAllFromLocalStorage(): void;
|
|
30
|
-
clearQueryParam(formName: string): void;
|
|
31
|
-
}>;
|