yuang-framework-ui-pc 1.1.51 → 1.1.52

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.
Files changed (38) hide show
  1. package/es/core-components.d.ts +1 -2
  2. package/es/core-components.js +2 -4
  3. package/es/ele-upload-list/components/list-item.d.ts +1 -0
  4. package/es/ele-upload-list/components/list-item.js +11 -3
  5. package/es/ele-upload-list/index.d.ts +2 -0
  6. package/es/ele-upload-list/index.js +16 -3
  7. package/es/ele-upload-list/types.d.ts +2 -0
  8. package/es/{yu-framework-attachment-image-upload → yu-framework-attachment-upload}/index.js +31 -50
  9. package/es/yu-framework-slider-captcha-dialog/{SliderCaptcha.js → components/SliderCaptcha.js} +1 -1
  10. package/es/yu-framework-slider-captcha-dialog/index.js +1 -1
  11. package/lib/core-components.cjs +2 -4
  12. package/lib/core-components.d.ts +1 -2
  13. package/lib/ele-upload-list/components/list-item.cjs +11 -3
  14. package/lib/ele-upload-list/components/list-item.d.ts +1 -0
  15. package/lib/ele-upload-list/index.cjs +16 -3
  16. package/lib/ele-upload-list/index.d.ts +2 -0
  17. package/lib/ele-upload-list/types.d.ts +2 -0
  18. package/lib/{yu-framework-attachment-image-upload → yu-framework-attachment-upload}/index.cjs +31 -50
  19. package/lib/yu-framework-slider-captcha-dialog/{SliderCaptcha.cjs → components/SliderCaptcha.cjs} +1 -1
  20. package/lib/yu-framework-slider-captcha-dialog/index.cjs +1 -1
  21. package/package.json +2 -2
  22. package/typings/global.d.ts +1 -2
  23. package/es/yu-framework-attachment-file-upload/CommonUpload/index.d.ts +0 -161
  24. package/es/yu-framework-attachment-file-upload/CommonUpload/index.js +0 -173
  25. package/es/yu-framework-attachment-file-upload/FileUpload/index.d.ts +0 -143
  26. package/es/yu-framework-attachment-file-upload/FileUpload/index.js +0 -219
  27. package/es/yu-framework-attachment-file-upload/index.d.ts +0 -16
  28. package/es/yu-framework-attachment-file-upload/index.js +0 -55
  29. package/lib/yu-framework-attachment-file-upload/CommonUpload/index.cjs +0 -172
  30. package/lib/yu-framework-attachment-file-upload/CommonUpload/index.d.ts +0 -161
  31. package/lib/yu-framework-attachment-file-upload/FileUpload/index.cjs +0 -218
  32. package/lib/yu-framework-attachment-file-upload/FileUpload/index.d.ts +0 -143
  33. package/lib/yu-framework-attachment-file-upload/index.cjs +0 -54
  34. package/lib/yu-framework-attachment-file-upload/index.d.ts +0 -16
  35. /package/es/{yu-framework-attachment-image-upload → yu-framework-attachment-upload}/index.d.ts +0 -0
  36. /package/es/yu-framework-slider-captcha-dialog/{SliderCaptcha.d.ts → components/SliderCaptcha.d.ts} +0 -0
  37. /package/lib/{yu-framework-attachment-image-upload → yu-framework-attachment-upload}/index.d.ts +0 -0
  38. /package/lib/yu-framework-slider-captcha-dialog/{SliderCaptcha.d.ts → components/SliderCaptcha.d.ts} +0 -0
@@ -60,8 +60,7 @@ declare module '@vue/runtime-core' {
60
60
  EleVirtualTable: (typeof import('yuang-framework-ui-pc'))['EleVirtualTable'];
61
61
  EleWatermark: (typeof import('yuang-framework-ui-pc'))['EleWatermark'];
62
62
  EleXgPlayer: (typeof import('yuang-framework-ui-pc'))['EleXgPlayer'];
63
- YuFrameworkAttachmentFileUpload: (typeof import('yuang-framework-ui-pc'))['YuFrameworkAttachmentFileUpload'];
64
- YuFrameworkAttachmentImageUpload: (typeof import('yuang-framework-ui-pc'))['YuFrameworkAttachmentImageUpload'];
63
+ YuFrameworkAttachmentUpload: (typeof import('yuang-framework-ui-pc'))['YuFrameworkAttachmentUpload'];
65
64
  YuFrameworkSliderCaptchaDialog: (typeof import('yuang-framework-ui-pc'))['YuFrameworkSliderCaptchaDialog'];
66
65
  YuTest: (typeof import('yuang-framework-ui-pc'))['YuTest'];
67
66
  }
@@ -1,161 +0,0 @@
1
- import { CSSProperties } from 'vue';
2
- import { ElProgressProps, ElImageProps } from '../../ele-app/el';
3
- import { EleImageViewerProps } from '../../ele-app/plus';
4
- import { UploadItem, ListType, BeforeUploadClick, BeforeItemEdit, UploadLocale } from '../../ele-upload-list/types';
5
-
6
- declare function __VLS_template(): Partial<Record<string, (_: any) => any>>;
7
- declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
8
- modelValue: import('vue').PropType<UploadItem[]>;
9
- drag: {
10
- type: import('vue').PropType<boolean>;
11
- default: boolean;
12
- };
13
- disabled: {
14
- type: import('vue').PropType<boolean>;
15
- };
16
- readonly: {
17
- type: import('vue').PropType<boolean>;
18
- };
19
- sortable: {
20
- type: import('vue').PropType<boolean | Record<string | number | symbol, any>>;
21
- default: () => {
22
- forceFallback: boolean;
23
- };
24
- };
25
- multiple: {
26
- type: import('vue').PropType<boolean>;
27
- };
28
- preview: {
29
- type: import('vue').PropType<boolean>;
30
- default: boolean;
31
- };
32
- accept: {
33
- type: import('vue').PropType<string>;
34
- default: string;
35
- };
36
- tools: {
37
- type: import('vue').PropType<boolean>;
38
- default: boolean;
39
- };
40
- beforeUploadClick: {
41
- type: import('vue').PropType<BeforeUploadClick>;
42
- };
43
- locale: {
44
- type: import('vue').PropType<Partial<UploadLocale>>;
45
- };
46
- imageProps: {
47
- type: import('vue').PropType<ElImageProps>;
48
- };
49
- progressProps: {
50
- type: import('vue').PropType<ElProgressProps>;
51
- };
52
- listType: {
53
- type: import('vue').PropType<ListType>;
54
- };
55
- limit: {
56
- type: import('vue').PropType<number>;
57
- };
58
- itemStyle: {
59
- type: import('vue').PropType<CSSProperties>;
60
- };
61
- buttonStyle: {
62
- type: import('vue').PropType<CSSProperties>;
63
- };
64
- previewProps: {
65
- type: import('vue').PropType<EleImageViewerProps>;
66
- };
67
- beforeItemEdit: {
68
- type: import('vue').PropType<BeforeItemEdit>;
69
- };
70
- fileLimit: {
71
- type: import('vue').PropType<number>;
72
- default: number;
73
- };
74
- }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
75
- itemClick: (item: UploadItem) => void;
76
- preview: (item: UploadItem) => void;
77
- }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
78
- modelValue: import('vue').PropType<UploadItem[]>;
79
- drag: {
80
- type: import('vue').PropType<boolean>;
81
- default: boolean;
82
- };
83
- disabled: {
84
- type: import('vue').PropType<boolean>;
85
- };
86
- readonly: {
87
- type: import('vue').PropType<boolean>;
88
- };
89
- sortable: {
90
- type: import('vue').PropType<boolean | Record<string | number | symbol, any>>;
91
- default: () => {
92
- forceFallback: boolean;
93
- };
94
- };
95
- multiple: {
96
- type: import('vue').PropType<boolean>;
97
- };
98
- preview: {
99
- type: import('vue').PropType<boolean>;
100
- default: boolean;
101
- };
102
- accept: {
103
- type: import('vue').PropType<string>;
104
- default: string;
105
- };
106
- tools: {
107
- type: import('vue').PropType<boolean>;
108
- default: boolean;
109
- };
110
- beforeUploadClick: {
111
- type: import('vue').PropType<BeforeUploadClick>;
112
- };
113
- locale: {
114
- type: import('vue').PropType<Partial<UploadLocale>>;
115
- };
116
- imageProps: {
117
- type: import('vue').PropType<ElImageProps>;
118
- };
119
- progressProps: {
120
- type: import('vue').PropType<ElProgressProps>;
121
- };
122
- listType: {
123
- type: import('vue').PropType<ListType>;
124
- };
125
- limit: {
126
- type: import('vue').PropType<number>;
127
- };
128
- itemStyle: {
129
- type: import('vue').PropType<CSSProperties>;
130
- };
131
- buttonStyle: {
132
- type: import('vue').PropType<CSSProperties>;
133
- };
134
- previewProps: {
135
- type: import('vue').PropType<EleImageViewerProps>;
136
- };
137
- beforeItemEdit: {
138
- type: import('vue').PropType<BeforeItemEdit>;
139
- };
140
- fileLimit: {
141
- type: import('vue').PropType<number>;
142
- default: number;
143
- };
144
- }>> & Readonly<{
145
- onItemClick?: ((item: UploadItem) => any) | undefined;
146
- onPreview?: ((item: UploadItem) => any) | undefined;
147
- }>, {
148
- drag: boolean;
149
- sortable: boolean | Record<keyof any, any>;
150
- preview: boolean;
151
- accept: string;
152
- tools: boolean;
153
- fileLimit: number;
154
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
155
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
156
- export default _default;
157
- type __VLS_WithTemplateSlots<T, S> = T & {
158
- new (): {
159
- $slots: S;
160
- };
161
- };
@@ -1,173 +0,0 @@
1
- import { defineComponent, mergeModels, useModel, resolveComponent, createBlock, openBlock, createSlots, renderList, withCtx, renderSlot, normalizeProps, guardReactiveProps } from "vue";
2
- import { EleMessage } from "../../utils/message";
3
- import { ElMessageBox } from "element-plus/es";
4
- import { http } from "yuang-framework-ui-common/lib/config/httpConfig";
5
- import { getShortUuid } from "yuang-framework-ui-common/lib/utils/uuidUtils";
6
- import { application } from "yuang-framework-ui-common/lib/config/applicationConfig";
7
- const _sfc_main = /* @__PURE__ */ defineComponent({
8
- ...{ name: "CommonUpload" },
9
- __name: "index",
10
- props: /* @__PURE__ */ mergeModels({
11
- fileLimit: { default: 100 },
12
- readonly: { type: Boolean },
13
- disabled: { type: Boolean },
14
- preview: { type: Boolean, default: true },
15
- limit: {},
16
- multiple: { type: Boolean },
17
- drag: { type: Boolean, default: true },
18
- accept: { default: "" },
19
- itemStyle: {},
20
- buttonStyle: {},
21
- sortable: { type: [Boolean, Object], default: () => ({ forceFallback: true }) },
22
- imageProps: {},
23
- progressProps: {},
24
- previewProps: {},
25
- tools: { type: Boolean, default: true },
26
- listType: {},
27
- beforeUploadClick: {},
28
- beforeItemEdit: {},
29
- locale: {}
30
- }, {
31
- "modelValue": {
32
- type: Array,
33
- default: () => []
34
- },
35
- "modelModifiers": {}
36
- }),
37
- emits: /* @__PURE__ */ mergeModels(["itemClick", "preview"], ["update:modelValue"]),
38
- setup(__props, { emit: __emit }) {
39
- const props = __props;
40
- const emit = __emit;
41
- const images = useModel(__props, "modelValue");
42
- const checkFile = (file) => {
43
- if (!file) {
44
- return;
45
- }
46
- if (props.accept === "image/*") {
47
- if (!file.type.startsWith("image")) {
48
- EleMessage.error("只能选择图片");
49
- return;
50
- }
51
- } else if (props.accept === ".xls,.xlsx") {
52
- if (![
53
- "application/vnd.ms-excel",
54
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
55
- ].includes(file.type)) {
56
- EleMessage.error("只能选择 excel 文件");
57
- return;
58
- }
59
- }
60
- if (props.fileLimit && file.size / 1024 / 1024 > props.fileLimit) {
61
- EleMessage.error(`大小不能超过 ${props.fileLimit}MB`);
62
- return;
63
- }
64
- return true;
65
- };
66
- const handleItemUpload = (uploadItem, retry) => {
67
- if (!uploadItem.file || !checkFile(uploadItem.file)) {
68
- return;
69
- }
70
- if (!retry) {
71
- images.value.push({ ...uploadItem });
72
- }
73
- const item = images.value.find((t) => t.key === uploadItem.key);
74
- if (!item) {
75
- return;
76
- }
77
- item.status = "uploading";
78
- item.progress = 0;
79
- debugger;
80
- let formData = new FormData();
81
- formData.append("code", getShortUuid());
82
- formData.append("multipartFile", uploadItem.file, uploadItem.file.name);
83
- http({
84
- url: `/framework-api/core/framework-attachment/uploadAttachment`,
85
- method: "post",
86
- headers: {
87
- "Content-Type": "multipart/form-data"
88
- },
89
- data: formData
90
- }).then((res) => {
91
- EleMessage.success(res.data.message);
92
- item.progress = 100;
93
- item.status = "done";
94
- item.url = res.data.data.fullUrl;
95
- }).catch((e) => {
96
- item.status = "exception";
97
- EleMessage.error(e.message);
98
- });
99
- };
100
- const handleItemEditUpload = ({ item, newItem }) => {
101
- if (!checkFile(newItem.file)) {
102
- return;
103
- }
104
- const oldItem = images.value.find((t) => t.key === item.key);
105
- if (oldItem) {
106
- oldItem.url = void 0;
107
- oldItem.name = newItem.name;
108
- oldItem.file = newItem.file;
109
- oldItem.progress = 0;
110
- oldItem.status = void 0;
111
- handleItemUpload(oldItem, true);
112
- }
113
- };
114
- const handleItemRemove = (uploadItem) => {
115
- let id = uploadItem.id;
116
- ElMessageBox.confirm("确定要删除吗?", "系统提示", { type: "warning", draggable: true }).then(() => {
117
- http.get(`${application.gatewayServerBaseUrl}/framework-api/core/framework-attachment/deleteInfo`, { params: { id } }).then((res) => {
118
- EleMessage.success(res.data.message);
119
- images.value.splice(images.value.indexOf(uploadItem), 1);
120
- });
121
- });
122
- };
123
- const handleItemClick = (item) => {
124
- emit("itemClick", item);
125
- };
126
- const handleItemPreview = (item) => {
127
- emit("preview", item);
128
- };
129
- return (_ctx, _cache) => {
130
- const _component_EleUploadList = resolveComponent("EleUploadList");
131
- return openBlock(), createBlock(_component_EleUploadList, {
132
- modelValue: images.value,
133
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => images.value = $event),
134
- readonly: _ctx.readonly,
135
- disabled: _ctx.disabled,
136
- preview: _ctx.preview,
137
- limit: _ctx.limit,
138
- multiple: _ctx.multiple,
139
- drag: _ctx.drag,
140
- accept: _ctx.accept,
141
- itemStyle: _ctx.itemStyle,
142
- buttonStyle: _ctx.buttonStyle,
143
- sortable: _ctx.sortable,
144
- imageProps: _ctx.imageProps,
145
- progressProps: _ctx.progressProps,
146
- previewProps: _ctx.previewProps,
147
- tools: _ctx.tools,
148
- listType: _ctx.listType,
149
- beforeUploadClick: _ctx.beforeUploadClick,
150
- beforeItemEdit: _ctx.beforeItemEdit,
151
- locale: _ctx.locale,
152
- onUpload: handleItemUpload,
153
- onRetry: _cache[1] || (_cache[1] = (item) => handleItemUpload(item, true)),
154
- onRemove: handleItemRemove,
155
- onEditUpload: handleItemEditUpload,
156
- onItemClick: handleItemClick,
157
- onPreview: handleItemPreview
158
- }, createSlots({ _: 2 }, [
159
- renderList(Object.keys(_ctx.$slots), (name) => {
160
- return {
161
- name,
162
- fn: withCtx((slotProps) => [
163
- renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(slotProps || {})))
164
- ])
165
- };
166
- })
167
- ]), 1032, ["modelValue", "readonly", "disabled", "preview", "limit", "multiple", "drag", "accept", "itemStyle", "buttonStyle", "sortable", "imageProps", "progressProps", "previewProps", "tools", "listType", "beforeUploadClick", "beforeItemEdit", "locale"]);
168
- };
169
- }
170
- });
171
- export {
172
- _sfc_main as default
173
- };
@@ -1,143 +0,0 @@
1
- import { CSSProperties } from 'vue';
2
- import { ElProgressProps, ElImageProps } from '../../ele-app/el';
3
- import { EleImageViewerProps } from '../../ele-app/plus';
4
- import { ListType, BeforeUploadClick, BeforeItemEdit, UploadLocale } from '../../ele-upload-list/types';
5
-
6
- declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
7
- /** 绑定值 */
8
- modelValue?: string;
9
- /** 文件大小限制, 单位MB */
10
- fileLimit?: number;
11
- /** 是否只读 */
12
- readonly?: boolean;
13
- /** 是否禁用 */
14
- disabled?: boolean;
15
- /** 是否支持点击预览 */
16
- preview?: boolean;
17
- /** 最大上传数量 */
18
- limit?: number;
19
- /** 是否支持多选文件 */
20
- multiple?: boolean;
21
- /** 是否启用拖拽上传 */
22
- drag?: boolean;
23
- /** 接受上传的文件类型 */
24
- accept?: string;
25
- /** 自定义样式 */
26
- itemStyle?: CSSProperties;
27
- /** 自定义上传按钮样式 */
28
- buttonStyle?: CSSProperties;
29
- /** 是否开启拖拽排序 */
30
- sortable?: boolean | Record<keyof any, any>;
31
- /** 自定义图片属性 */
32
- imageProps?: ElImageProps;
33
- /** 自定义进度条属性 */
34
- progressProps?: ElProgressProps;
35
- /** 自定义图片预览属性 */
36
- previewProps?: EleImageViewerProps;
37
- /** 是否开启底部预览和修改的操作按钮 */
38
- tools?: boolean;
39
- /** 列表显示样式 */
40
- listType?: ListType;
41
- /** 上传按钮点击前的钩子 */
42
- beforeUploadClick?: BeforeUploadClick;
43
- /** 修改按钮点击前的钩子 */
44
- beforeItemEdit?: BeforeItemEdit;
45
- /** 国际化 */
46
- locale?: Partial<UploadLocale>;
47
- }>, {
48
- fileLimit: number;
49
- preview: boolean;
50
- drag: boolean;
51
- accept: string;
52
- sortable: () => {
53
- forceFallback: boolean;
54
- };
55
- tools: boolean;
56
- listType: string;
57
- }>>, {
58
- clearData: () => void;
59
- isDone: () => boolean;
60
- }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
61
- "update:modelValue": (value?: string | undefined) => void;
62
- change: (value?: string | undefined) => void;
63
- }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
64
- /** 绑定值 */
65
- modelValue?: string;
66
- /** 文件大小限制, 单位MB */
67
- fileLimit?: number;
68
- /** 是否只读 */
69
- readonly?: boolean;
70
- /** 是否禁用 */
71
- disabled?: boolean;
72
- /** 是否支持点击预览 */
73
- preview?: boolean;
74
- /** 最大上传数量 */
75
- limit?: number;
76
- /** 是否支持多选文件 */
77
- multiple?: boolean;
78
- /** 是否启用拖拽上传 */
79
- drag?: boolean;
80
- /** 接受上传的文件类型 */
81
- accept?: string;
82
- /** 自定义样式 */
83
- itemStyle?: CSSProperties;
84
- /** 自定义上传按钮样式 */
85
- buttonStyle?: CSSProperties;
86
- /** 是否开启拖拽排序 */
87
- sortable?: boolean | Record<keyof any, any>;
88
- /** 自定义图片属性 */
89
- imageProps?: ElImageProps;
90
- /** 自定义进度条属性 */
91
- progressProps?: ElProgressProps;
92
- /** 自定义图片预览属性 */
93
- previewProps?: EleImageViewerProps;
94
- /** 是否开启底部预览和修改的操作按钮 */
95
- tools?: boolean;
96
- /** 列表显示样式 */
97
- listType?: ListType;
98
- /** 上传按钮点击前的钩子 */
99
- beforeUploadClick?: BeforeUploadClick;
100
- /** 修改按钮点击前的钩子 */
101
- beforeItemEdit?: BeforeItemEdit;
102
- /** 国际化 */
103
- locale?: Partial<UploadLocale>;
104
- }>, {
105
- fileLimit: number;
106
- preview: boolean;
107
- drag: boolean;
108
- accept: string;
109
- sortable: () => {
110
- forceFallback: boolean;
111
- };
112
- tools: boolean;
113
- listType: string;
114
- }>>> & Readonly<{
115
- onChange?: ((value?: string | undefined) => any) | undefined;
116
- "onUpdate:modelValue"?: ((value?: string | undefined) => any) | undefined;
117
- }>, {
118
- sortable: boolean | Record<keyof any, any>;
119
- drag: boolean;
120
- preview: boolean;
121
- accept: string;
122
- tools: boolean;
123
- listType: ListType;
124
- fileLimit: number;
125
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
126
- export default _default;
127
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
128
- type __VLS_TypePropsToRuntimeProps<T> = {
129
- [K in keyof T]-?: {} extends Pick<T, K> ? {
130
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
131
- } : {
132
- type: import('vue').PropType<T[K]>;
133
- required: true;
134
- };
135
- };
136
- type __VLS_WithDefaults<P, D> = {
137
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
138
- default: D[K];
139
- }> : P[K];
140
- };
141
- type __VLS_Prettify<T> = {
142
- [K in keyof T]: T[K];
143
- } & {};