joy-admin-components 0.2.104 → 0.2.105
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/components/CmpDictionary/index.d.ts +8 -0
- package/dist/components/CmpTag/index.d.ts +29 -0
- package/dist/components/DownExcelTemp/index.d.ts +33 -7
- package/dist/components/ImportButton/index.d.ts +23 -9
- package/dist/directive/index.d.ts +86 -0
- package/dist/index.d.ts +4 -2
- package/dist/joy-admin-components.es.js +406 -382
- package/dist/joy-admin-components.umd.js +2 -2
- package/dist/utils/index.d.ts +78 -12
- package/package.json +1 -1
- package/src/components/CmpTag/index.d.ts +30 -0
- package/src/components/DownExcelTemp/index.d.ts +33 -7
- package/src/components/ImportButton/index.d.ts +23 -9
- package/src/index.d.ts +2 -0
- package/src/utils/index.d.ts +77 -11
|
@@ -40,3 +40,11 @@ export interface CmpDictionaryEmits {
|
|
|
40
40
|
|
|
41
41
|
declare const CmpDictionary: DefineComponent<CmpDictionaryProps>;
|
|
42
42
|
export default CmpDictionary;
|
|
43
|
+
Partial<{}>;
|
|
44
|
+
slots: {
|
|
45
|
+
header?(_: {}): any;
|
|
46
|
+
header?(_: {}): any;
|
|
47
|
+
};
|
|
48
|
+
refs: {};
|
|
49
|
+
rootEl: any;
|
|
50
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { DefineComponent } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* CmpTag 组件 - 自定义颜色标签
|
|
4
|
+
* 基于 Element Plus Tag 封装,支持通过 fontColor 属性自定义标签颜色
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```vue
|
|
8
|
+
* <!-- 自定义颜色 -->
|
|
9
|
+
* <CmpTag fontColor="#ff6600">进行中</CmpTag>
|
|
10
|
+
* <CmpTag fontColor="#52c41a">已完成</CmpTag>
|
|
11
|
+
*
|
|
12
|
+
* <!-- 不传 fontColor 时使用 Element Plus 默认样式 -->
|
|
13
|
+
* <CmpTag>默认标签</CmpTag>
|
|
14
|
+
*
|
|
15
|
+
* <!-- 支持 Element Plus Tag 的所有属性 -->
|
|
16
|
+
* <CmpTag fontColor="#f56c6c" closable @close="handleClose">可关闭</CmpTag>
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export interface CmpTagProps {
|
|
20
|
+
/**
|
|
21
|
+
* 自定义标签颜色
|
|
22
|
+
* 传入后会自动计算背景色(5% 透明度混合)和边框色
|
|
23
|
+
* 不传则使用 Element Plus Tag 默认样式
|
|
24
|
+
*/
|
|
25
|
+
fontColor?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
declare const CmpTag: DefineComponent<CmpTagProps>;
|
|
29
|
+
export default CmpTag;
|
|
@@ -1,19 +1,45 @@
|
|
|
1
1
|
import { DefineComponent } from 'vue';
|
|
2
2
|
/**
|
|
3
|
-
* DownExcelTemp 组件
|
|
3
|
+
* DownExcelTemp 组件 - 下载 Excel 导入模板
|
|
4
|
+
* 点击后根据配置生成并下载 Excel 模板文件
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```vue
|
|
8
|
+
* <DownExcelTemp :sheetsConfig="config" fileName="商品导入模板" :version="1" />
|
|
9
|
+
* ```
|
|
4
10
|
*/
|
|
5
11
|
export interface DownExcelTempProps {
|
|
6
12
|
/**
|
|
7
|
-
* Excel
|
|
13
|
+
* Excel 多 sheet 配置
|
|
14
|
+
* key 为 sheet 名称,value 为该 sheet 的表头和数据配置
|
|
8
15
|
*/
|
|
9
|
-
sheetsConfig: Record<
|
|
10
|
-
|
|
16
|
+
sheetsConfig: Record<
|
|
17
|
+
string,
|
|
18
|
+
{
|
|
19
|
+
tableHeader: Array<{
|
|
20
|
+
header: string;
|
|
21
|
+
key: string;
|
|
22
|
+
width?: number;
|
|
23
|
+
style?: any;
|
|
24
|
+
option?: Array<{ label: any; value: any }>;
|
|
25
|
+
required?: boolean;
|
|
26
|
+
numFmt?: string;
|
|
27
|
+
locked?: boolean;
|
|
28
|
+
optionFormater?: (item: any) => string;
|
|
29
|
+
}>;
|
|
30
|
+
tableData?: any[];
|
|
31
|
+
sort?: number;
|
|
32
|
+
}
|
|
33
|
+
>;
|
|
34
|
+
/** 导出的文件名 */
|
|
35
|
+
fileName: string;
|
|
11
36
|
/**
|
|
12
|
-
*
|
|
37
|
+
* 模板版本号
|
|
38
|
+
* 指定后文件名格式为:{fileName}__v{version}.xlsx
|
|
39
|
+
* 配合 ImportButton 的 version 属性做版本校验
|
|
13
40
|
*/
|
|
14
|
-
|
|
41
|
+
version?: number;
|
|
15
42
|
}
|
|
16
43
|
|
|
17
44
|
declare const DownExcelTemp: DefineComponent<DownExcelTempProps>;
|
|
18
|
-
|
|
19
45
|
export default DownExcelTemp;
|
|
@@ -1,18 +1,32 @@
|
|
|
1
1
|
import { DefineComponent } from 'vue';
|
|
2
2
|
/**
|
|
3
|
-
* 导入按钮组件 -
|
|
4
|
-
*
|
|
3
|
+
* 导入按钮组件 - Excel 文件导入
|
|
4
|
+
* 点击按钮选择 Excel 文件,自动解析后调用回调函数
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```vue
|
|
8
|
+
* <ImportButton :fields="importFields" :fileChange="handleImport" :version="1" />
|
|
9
|
+
* ```
|
|
5
10
|
*/
|
|
6
11
|
export interface ImportButtonProps {
|
|
7
12
|
/** 接受的文件类型,默认 '.xlsx,.xls' */
|
|
8
13
|
accept?: string;
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
|
|
14
|
+
/**
|
|
15
|
+
* 字段映射配置,按 sheet 名称组织
|
|
16
|
+
* 格式:{ 'Sheet名': { 字段名: '列字母' | '列字母---option' | '列字母---image' } }
|
|
17
|
+
*/
|
|
18
|
+
fields?: Record<string, Record<string, string>>;
|
|
19
|
+
/**
|
|
20
|
+
* 文件解析完成的回调函数
|
|
21
|
+
* @param data 按 sheet 名称组织的解析结果
|
|
22
|
+
* @returns Promise,组件会等待 Promise 完成后恢复按钮状态
|
|
23
|
+
*/
|
|
24
|
+
fileChange: (data: Record<string, any[]>) => Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* 模板版本号校验
|
|
27
|
+
* 指定后会校验文件名中的版本号(格式:xxx__v{n}.xlsx),不匹配则拒绝导入
|
|
28
|
+
*/
|
|
29
|
+
version?: number;
|
|
16
30
|
}
|
|
17
31
|
|
|
18
32
|
declare const ImportButton: DefineComponent<ImportButtonProps>;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { App, Directive } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* v-auth 权限指令
|
|
4
|
+
* 根据用户角色权限列表控制元素是否显示
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```vue
|
|
8
|
+
* <el-button v-auth:edit>编辑</el-button>
|
|
9
|
+
* <el-button v-auth:delete>删除</el-button>
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
export declare const auth: Directive;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* v-copy 复制指令
|
|
16
|
+
* 点击元素时将绑定值复制到剪贴板
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```vue
|
|
20
|
+
* <el-button v-copy="textValue">复制</el-button>
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare const copy: Directive;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* v-debounce 防抖指令
|
|
27
|
+
* 为按钮添加点击防抖(200ms)
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```vue
|
|
31
|
+
* <el-button v-debounce="handleClick">提交</el-button>
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare const debounce: Directive;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* v-drag 弹窗拖拽指令
|
|
38
|
+
* 用于 Element Plus Dialog 的拖拽功能
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```vue
|
|
42
|
+
* <div v-drag="dialogVisible">
|
|
43
|
+
* <el-dialog v-model="dialogVisible">...</el-dialog>
|
|
44
|
+
* </div>
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export declare const drag: Directive;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* v-dragable 元素拖拽指令
|
|
51
|
+
* 使元素可在父级范围内自由拖拽
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```vue
|
|
55
|
+
* <div v-dragable>可拖拽元素</div>
|
|
56
|
+
* <div v-dragable="'father'">在父级内拖拽</div>
|
|
57
|
+
* <div v-dragable="'#app'">在指定容器内拖拽</div>
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export declare const dragable: Directive;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* v-waterMarker 水印指令
|
|
64
|
+
* 为元素添加水印背景
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```vue
|
|
68
|
+
* <div v-waterMarker="{ text: '机密文件', textColor: 'rgba(0,0,0,0.1)' }">
|
|
69
|
+
* 内容
|
|
70
|
+
* </div>
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
export declare const waterMarker: Directive;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* 注册所有自定义指令到 Vue 应用
|
|
77
|
+
* @param app Vue 应用实例
|
|
78
|
+
*/
|
|
79
|
+
export default function useDirective(app: App): void;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* 权限检查函数
|
|
83
|
+
* @param binding 指令绑定对象
|
|
84
|
+
* @returns 是否有权限
|
|
85
|
+
*/
|
|
86
|
+
export declare function checkAuth(binding: { arg?: string }): boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import { default as LayOutForm } from './components/LayOutForm/index';
|
|
2
2
|
import { default as CmpDictionary } from './components/CmpDictionary/index';
|
|
3
3
|
import { default as CmpIcon } from './components/CmpIcon/index';
|
|
4
|
+
import { default as CmpTag } from './components/CmpTag/index';
|
|
4
5
|
import { default as ConfrimButton } from './components/ConfrimButton/index';
|
|
5
6
|
import { default as ImportButton } from './components/ImportButton/index';
|
|
6
7
|
import { default as ListPage } from './components/ListPage/index';
|
|
7
8
|
import { default as SearchBar } from './components/SearchBar/index';
|
|
8
9
|
import { default as DownExcelTemp } from './components/DownExcelTemp/index';
|
|
9
10
|
import { default as Layer } from './components/Layer/index';
|
|
10
|
-
export { LayOutForm, CmpDictionary, CmpIcon, ConfrimButton, ImportButton, ListPage, SearchBar, DownExcelTemp, Layer, };
|
|
11
|
+
export { LayOutForm, CmpDictionary, CmpIcon, CmpTag, ConfrimButton, ImportButton, ListPage, SearchBar, DownExcelTemp, Layer, };
|
|
11
12
|
export * from './utils/index.js';
|
|
12
|
-
export { registerVxeFormatters, registerVxeRenderers, registerVxePlugins } from './components/VxeTable/index.jsx';
|
|
13
|
+
export { registerVxeFormatters, registerVxeRenderers, registerVxePlugins, } from './components/VxeTable/index.jsx';
|
|
13
14
|
export { setupI18n, getI18n, getI18nT, zh_cn, en_us, messages } from './locales/index';
|
|
14
15
|
export { setListPageConfig, getListPageConfig, resetListPageConfig } from './components/ListPage/config';
|
|
15
16
|
export type * from './components/LayOutForm/index';
|
|
16
17
|
export type * from './components/CmpDictionary/index';
|
|
17
18
|
export type * from './components/CmpIcon/index';
|
|
19
|
+
export type * from './components/CmpTag/index';
|
|
18
20
|
export type * from './components/ConfrimButton/index';
|
|
19
21
|
export type * from './components/ImportButton/index';
|
|
20
22
|
export type * from './components/ListPage/index';
|