yc-pro-components 0.0.44 → 0.0.46
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/display-item/src/index.vue2.mjs +16 -3
- package/es/components/index.d.ts +1 -0
- package/es/components/index.mjs +2 -0
- package/es/components/yc-batch-import-dialog/index.d.ts +167 -0
- package/es/components/yc-batch-import-dialog/index.mjs +13 -0
- package/es/components/yc-batch-import-dialog/src/UploadRecordList.vue.d.ts +45 -0
- package/es/components/yc-batch-import-dialog/src/UploadRecordList.vue.mjs +6 -0
- package/es/components/yc-batch-import-dialog/src/UploadRecordList.vue2.mjs +186 -0
- package/es/components/yc-batch-import-dialog/src/index.vue.d.ts +73 -0
- package/es/components/yc-batch-import-dialog/src/index.vue.mjs +6 -0
- package/es/components/yc-batch-import-dialog/src/index.vue2.mjs +579 -0
- package/es/components/yc-batch-import-dialog/src/types.d.ts +159 -0
- package/es/components/yc-batch-import-dialog/src/types.mjs +1 -0
- package/es/components/yc-drawer/src/index.vue.mjs +1 -1
- package/es/components/yc-drawer/src/index.vue2.mjs +37 -10
- package/es/components/yc-drawer/src/type.d.ts +17 -0
- package/es/components/yc-drawer/store.d.ts +6 -0
- package/es/components/yc-plus-page/src/index.vue.d.ts +210 -26
- package/es/components/yc-plus-page/src/index.vue.mjs +1 -1
- package/es/components/yc-plus-page/src/index.vue2.mjs +96 -8
- package/es/components/yc-plus-page/src/type.d.ts +12 -0
- package/es/dict/createDictStore.d.ts +1 -1
- package/es/index.css +13 -11
- package/es/index.mjs +2 -0
- package/index.css +291 -12
- package/index.js +1215 -325
- package/index.min.css +5 -3
- package/index.min.js +11 -11
- package/index.min.mjs +11 -11
- package/index.mjs +1215 -328
- package/lib/components/display-item/src/index.vue2.js +16 -3
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +5 -0
- package/lib/components/yc-batch-import-dialog/index.d.ts +167 -0
- package/lib/components/yc-batch-import-dialog/index.js +20 -0
- package/lib/components/yc-batch-import-dialog/src/UploadRecordList.vue.d.ts +45 -0
- package/lib/components/yc-batch-import-dialog/src/UploadRecordList.vue.js +10 -0
- package/lib/components/yc-batch-import-dialog/src/UploadRecordList.vue2.js +190 -0
- package/lib/components/yc-batch-import-dialog/src/index.vue.d.ts +73 -0
- package/lib/components/yc-batch-import-dialog/src/index.vue.js +10 -0
- package/lib/components/yc-batch-import-dialog/src/index.vue2.js +583 -0
- package/lib/components/yc-batch-import-dialog/src/types.d.ts +159 -0
- package/lib/components/yc-batch-import-dialog/src/types.js +2 -0
- package/lib/components/yc-drawer/src/index.vue.js +1 -1
- package/lib/components/yc-drawer/src/index.vue2.js +36 -9
- package/lib/components/yc-drawer/src/type.d.ts +17 -0
- package/lib/components/yc-drawer/store.d.ts +6 -0
- package/lib/components/yc-plus-page/src/index.vue.d.ts +210 -26
- package/lib/components/yc-plus-page/src/index.vue.js +1 -1
- package/lib/components/yc-plus-page/src/index.vue2.js +95 -7
- package/lib/components/yc-plus-page/src/type.d.ts +12 -0
- package/lib/dict/createDictStore.d.ts +1 -1
- package/lib/index.css +12 -10
- package/lib/index.js +5 -0
- 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/theme-chalk/index.css +1 -1
- package/theme-chalk/plus-table.css +1 -1
- package/theme-chalk/plus-yc-plus-page.css +1 -1
- package/theme-chalk/src/table.scss +5 -0
- package/theme-chalk/src/yc-plus-page.scss +46 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BatchImportDialog - 类型定义
|
|
3
|
+
* @description 批量导入对话框组件的类型定义
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* 导入状态类型
|
|
7
|
+
*/
|
|
8
|
+
export type ImportStatus = "initial" | "uploaded" | "importing" | "success" | "error";
|
|
9
|
+
/**
|
|
10
|
+
* 响应类型
|
|
11
|
+
* - json: 返回 JSON 格式的导入结果
|
|
12
|
+
* - blob: 返回文件(如带错误标注的 Excel)
|
|
13
|
+
*/
|
|
14
|
+
export type ResponseType = "json" | "blob";
|
|
15
|
+
/**
|
|
16
|
+
* 导入接口函数类型
|
|
17
|
+
*/
|
|
18
|
+
export type ImportApiFn = (formData: FormData) => Promise<unknown>;
|
|
19
|
+
/**
|
|
20
|
+
* 自定义下载模板函数类型
|
|
21
|
+
*/
|
|
22
|
+
export type DownloadTemplateFn = () => void | Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* BatchImportDialog Props
|
|
25
|
+
*/
|
|
26
|
+
export interface BatchImportDialogProps {
|
|
27
|
+
/**
|
|
28
|
+
* 对话框标题
|
|
29
|
+
* @default "批量导入"
|
|
30
|
+
*/
|
|
31
|
+
title?: string;
|
|
32
|
+
/**
|
|
33
|
+
* 对话框宽度
|
|
34
|
+
* @default 520
|
|
35
|
+
*/
|
|
36
|
+
width?: number;
|
|
37
|
+
/**
|
|
38
|
+
* 图标 CDN 基础路径(用于加载 import.svg, excel.svg 等)
|
|
39
|
+
* 需要以 / 结尾
|
|
40
|
+
* @example "https://cdn.example.com/assets/"
|
|
41
|
+
*/
|
|
42
|
+
iconBaseUrl?: string;
|
|
43
|
+
/**
|
|
44
|
+
* 第一步标题
|
|
45
|
+
* @default "第一步:请严格按照导入模板填写内容后导入,否则将新增失败!"
|
|
46
|
+
*/
|
|
47
|
+
stepOneTitle?: string;
|
|
48
|
+
/**
|
|
49
|
+
* 注意事项提示文案
|
|
50
|
+
* @default "注意:单次导入数据不得超过5000条,否则导入可能失败!"
|
|
51
|
+
*/
|
|
52
|
+
tips?: string;
|
|
53
|
+
/**
|
|
54
|
+
* 模板下载地址(CDN 地址)
|
|
55
|
+
* 与 onDownloadTemplate 二选一,onDownloadTemplate 优先级更高
|
|
56
|
+
*/
|
|
57
|
+
templateUrl?: string;
|
|
58
|
+
/**
|
|
59
|
+
* 下载模板的文件名
|
|
60
|
+
* 如果不提供,则使用 URL 中的文件名
|
|
61
|
+
* @example "客户导入模板.xlsx"
|
|
62
|
+
*/
|
|
63
|
+
templateFileName?: string;
|
|
64
|
+
/**
|
|
65
|
+
* 下载导入结果的文件名(不含扩展名和时间戳)
|
|
66
|
+
* 如果不提供,则使用默认值 "导入结果"
|
|
67
|
+
* @example "项目信息导入结果"
|
|
68
|
+
*/
|
|
69
|
+
resultFileName?: string;
|
|
70
|
+
/**
|
|
71
|
+
* 下载模板按钮文案
|
|
72
|
+
* @default "下载导入模板"
|
|
73
|
+
*/
|
|
74
|
+
templateButtonText?: string;
|
|
75
|
+
/**
|
|
76
|
+
* 自定义下载模板函数
|
|
77
|
+
* 优先级高于 templateUrl
|
|
78
|
+
*/
|
|
79
|
+
onDownloadTemplate?: DownloadTemplateFn;
|
|
80
|
+
/**
|
|
81
|
+
* 第二步标题
|
|
82
|
+
* @default "第二步:选择模板文件并开始导入"
|
|
83
|
+
*/
|
|
84
|
+
stepTwoTitle?: string;
|
|
85
|
+
/**
|
|
86
|
+
* 接受的文件类型
|
|
87
|
+
* @default ".xls,.xlsx"
|
|
88
|
+
*/
|
|
89
|
+
accept?: string;
|
|
90
|
+
/**
|
|
91
|
+
* 最大文件大小(MB)
|
|
92
|
+
* @default 10
|
|
93
|
+
*/
|
|
94
|
+
maxFileSize?: number;
|
|
95
|
+
/**
|
|
96
|
+
* 最大导入条数(用于提示文案)
|
|
97
|
+
* @default 5000
|
|
98
|
+
*/
|
|
99
|
+
maxRowCount?: number;
|
|
100
|
+
/**
|
|
101
|
+
* 导入接口函数(必填)
|
|
102
|
+
* @param formData 包含 file 字段的表单数据
|
|
103
|
+
* @returns Promise
|
|
104
|
+
*/
|
|
105
|
+
importApi: ImportApiFn;
|
|
106
|
+
/**
|
|
107
|
+
* 额外的表单参数
|
|
108
|
+
* 会追加到 FormData 中一起提交
|
|
109
|
+
*/
|
|
110
|
+
extraFormData?: Record<string, string | Blob>;
|
|
111
|
+
/**
|
|
112
|
+
* 响应类型
|
|
113
|
+
* - json: 返回 JSON 格式的导入结果
|
|
114
|
+
* - blob: 返回文件(如带错误标注的 Excel)
|
|
115
|
+
* @default "blob"
|
|
116
|
+
*/
|
|
117
|
+
responseType?: ResponseType;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* BatchImportDialog Emits
|
|
121
|
+
*/
|
|
122
|
+
export interface BatchImportDialogEmits {
|
|
123
|
+
/** 导入成功事件 */
|
|
124
|
+
(e: "success", result: unknown): void;
|
|
125
|
+
/** 导入失败事件 */
|
|
126
|
+
(e: "error", error: Error): void;
|
|
127
|
+
/** 对话框关闭事件 */
|
|
128
|
+
(e: "close"): void;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* BatchImportDialog Expose
|
|
132
|
+
*/
|
|
133
|
+
export interface BatchImportDialogExpose {
|
|
134
|
+
/** 打开对话框 */
|
|
135
|
+
open: () => void;
|
|
136
|
+
/** 关闭对话框 */
|
|
137
|
+
close: () => void;
|
|
138
|
+
/** 重置状态 */
|
|
139
|
+
reset: () => void;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* 上传状态枚举
|
|
143
|
+
*/
|
|
144
|
+
export type BatchUploadRecordStatus = "uploading" | "paused" | "completed" | "error";
|
|
145
|
+
/**
|
|
146
|
+
* 上传记录接口
|
|
147
|
+
*/
|
|
148
|
+
export interface BatchUploadRecord {
|
|
149
|
+
/** 唯一标识 */
|
|
150
|
+
id: string;
|
|
151
|
+
/** 文件名 */
|
|
152
|
+
name: string;
|
|
153
|
+
/** 文件大小(字节) */
|
|
154
|
+
size: number;
|
|
155
|
+
/** 上传进度(0-100) */
|
|
156
|
+
progress: number;
|
|
157
|
+
/** 上传状态 */
|
|
158
|
+
status: BatchUploadRecordStatus;
|
|
159
|
+
}
|
|
@@ -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-f6f2fd13"], ["__file", "index.vue"]]);
|
|
9
9
|
|
|
10
10
|
exports.default = YcDrawerComponent;
|
|
@@ -6,8 +6,9 @@ var vue = require('vue');
|
|
|
6
6
|
var lodashEs = require('lodash-es');
|
|
7
7
|
var ElementPlusIconsVue = require('@element-plus/icons-vue');
|
|
8
8
|
var store = require('../store.js');
|
|
9
|
+
var dict = require('../../../constants/dict.js');
|
|
9
10
|
|
|
10
|
-
const _withScopeId = (n) => (vue.pushScopeId("data-v-
|
|
11
|
+
const _withScopeId = (n) => (vue.pushScopeId("data-v-f6f2fd13"), n = n(), vue.popScopeId(), n);
|
|
11
12
|
const _hoisted_1 = { class: "custom-drawer-header" };
|
|
12
13
|
const _hoisted_2 = { class: "header-content" };
|
|
13
14
|
const _hoisted_3 = ["id"];
|
|
@@ -25,6 +26,24 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
25
26
|
},
|
|
26
27
|
__name: "index",
|
|
27
28
|
setup(__props) {
|
|
29
|
+
const DictStoreProvider = vue.defineComponent({
|
|
30
|
+
name: "DictStoreProvider",
|
|
31
|
+
props: {
|
|
32
|
+
dictStore: {
|
|
33
|
+
type: Object,
|
|
34
|
+
default: null
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
setup(props) {
|
|
38
|
+
if (props.dictStore) {
|
|
39
|
+
vue.provide(dict.DictStoreInjectionKey, props.dictStore);
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
render() {
|
|
43
|
+
var _a, _b;
|
|
44
|
+
return (_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
28
47
|
const sureBtnMap = vue.ref({});
|
|
29
48
|
const footerButtons = vue.computed(() => {
|
|
30
49
|
return (options) => {
|
|
@@ -136,14 +155,22 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
136
155
|
_hoisted_4
|
|
137
156
|
])
|
|
138
157
|
]),
|
|
139
|
-
default: vue.withCtx(() =>
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
158
|
+
default: vue.withCtx(() => [
|
|
159
|
+
vue.createVNode(vue.unref(DictStoreProvider), {
|
|
160
|
+
"dict-store": options == null ? void 0 : options.dictStore
|
|
161
|
+
}, {
|
|
162
|
+
default: vue.withCtx(() => {
|
|
163
|
+
var _a, _b;
|
|
164
|
+
return [
|
|
165
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent((_a = options == null ? void 0 : options.contentRenderer) == null ? void 0 : _a.call(options, { options, index })), vue.mergeProps((_b = options == null ? void 0 : options.props) != null ? _b : {}, {
|
|
166
|
+
onClose: (args) => handleClose(options, index, args)
|
|
167
|
+
}), null, 16, ["onClose"]))
|
|
168
|
+
];
|
|
169
|
+
}),
|
|
170
|
+
_: 2
|
|
171
|
+
/* DYNAMIC */
|
|
172
|
+
}, 1032, ["dict-store"])
|
|
173
|
+
]),
|
|
147
174
|
_: 2
|
|
148
175
|
/* DYNAMIC */
|
|
149
176
|
}, [
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DictStoreInterface } from 'yc-pro-components/es/constants';
|
|
1
2
|
import { CSSProperties, VNode, Component } from 'vue';
|
|
2
3
|
|
|
3
4
|
type DoneFn = (cancel?: boolean) => void;
|
|
@@ -202,5 +203,21 @@ interface DrawerOptions extends DrawerProps {
|
|
|
202
203
|
index: number;
|
|
203
204
|
closeLoading: () => void;
|
|
204
205
|
}) => void;
|
|
206
|
+
/**
|
|
207
|
+
* 字典 Store 实例
|
|
208
|
+
* @description 当传入时,会将此 dictStore 通过 provide 注入到 Drawer 内容的组件树中,
|
|
209
|
+
* 使内容组件中 autoDict: true 的列配置可以正常获取字典数据。
|
|
210
|
+
* @example
|
|
211
|
+
* ```ts
|
|
212
|
+
* import { useDictStore } from '@/store/modules/dict'
|
|
213
|
+
*
|
|
214
|
+
* addDrawer({
|
|
215
|
+
* title: '详情',
|
|
216
|
+
* dictStore: useDictStore(),
|
|
217
|
+
* contentRenderer: () => h(YourContent, { ... })
|
|
218
|
+
* })
|
|
219
|
+
* ```
|
|
220
|
+
*/
|
|
221
|
+
dictStore?: DictStoreInterface;
|
|
205
222
|
}
|
|
206
223
|
export type { ButtonProps, DrawerOptions, ArgsType, DrawerProps, EventType };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Globals } from 'csstype';
|
|
2
|
+
import { OptionsRow } from 'packages/yc-components';
|
|
2
3
|
import { NavigationGuardWithThis, NavigationGuard } from 'vue-router';
|
|
3
4
|
import { LooseRequired } from '@vue/shared';
|
|
4
5
|
import { Ref, FunctionalComponent, Slot, Component, ComputedOptions, MethodOptions, Directive, WatchCallback, WatchOptions, ComponentProvideOptions, DebuggerEvent, ComponentPublicInstance, ComponentOptionsBase, VNode, RendererNode, RendererElement } from 'vue';
|
|
@@ -721,6 +722,11 @@ export declare const drawerStore: Ref<{
|
|
|
721
722
|
index: number;
|
|
722
723
|
closeLoading: () => void;
|
|
723
724
|
}) => void) | undefined;
|
|
725
|
+
dictStore?: {
|
|
726
|
+
getDictData: (field: string) => OptionsRow<undefined>[];
|
|
727
|
+
hasDict?: ((field: string) => boolean) | undefined;
|
|
728
|
+
getDictLabel?: ((field: string, value: string | number) => string) | undefined;
|
|
729
|
+
} | undefined;
|
|
724
730
|
visible?: boolean | undefined;
|
|
725
731
|
appendToBody?: boolean | undefined;
|
|
726
732
|
appendTo?: string | undefined;
|