el-plus 0.0.45 → 0.0.50
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/CHANGELOG.md +30 -0
- package/dist/index.css +1 -1
- package/dist/index.full.js +456 -278
- package/dist/index.full.min.js +1 -1
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +1 -1
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +455 -277
- package/es/components/attachment/index.d.ts +24 -3
- package/es/components/attachment/src/attachment.d.ts +4 -0
- package/es/components/attachment/src/attachment.mjs +5 -0
- package/es/components/attachment/src/attachment.mjs.map +1 -1
- package/es/components/attachment/src/attachment.vue.d.ts +12 -1
- package/es/components/attachment/src/attachment.vue2.mjs +69 -29
- package/es/components/attachment/src/attachment.vue2.mjs.map +1 -1
- package/es/components/attachment/src/use-attachment.d.ts +32 -24
- package/es/components/attachment/src/use-attachment.mjs +65 -12
- package/es/components/attachment/src/use-attachment.mjs.map +1 -1
- package/es/components/header/index.d.ts +15 -0
- package/es/components/header/src/header.d.ts +4 -0
- package/es/components/header/src/header.mjs +6 -1
- package/es/components/header/src/header.mjs.map +1 -1
- package/es/components/header/src/header.vue.d.ts +9 -0
- package/es/components/header/src/header.vue2.mjs +6 -1
- package/es/components/header/src/header.vue2.mjs.map +1 -1
- package/es/components/header/src/use-header.mjs +42 -44
- package/es/components/header/src/use-header.mjs.map +1 -1
- package/es/components/uni-vue/src/use-uni-vue.mjs +2 -1
- package/es/components/uni-vue/src/use-uni-vue.mjs.map +1 -1
- package/es/hooks/dialog/use-dialog.mjs.map +1 -1
- package/es/locale/lang/en.d.ts +12 -0
- package/es/locale/lang/en.mjs +12 -0
- package/es/locale/lang/en.mjs.map +1 -1
- package/es/locale/lang/zh-cn.d.ts +12 -0
- package/es/locale/lang/zh-cn.mjs +12 -0
- package/es/locale/lang/zh-cn.mjs.map +1 -1
- package/es/package.json.mjs +1 -1
- package/es/utils/file.d.ts +1 -1
- package/es/utils/file.mjs.map +1 -1
- package/lib/components/attachment/index.d.ts +24 -3
- package/lib/components/attachment/src/attachment.d.ts +4 -0
- package/lib/components/attachment/src/attachment.js +5 -0
- package/lib/components/attachment/src/attachment.js.map +1 -1
- package/lib/components/attachment/src/attachment.vue.d.ts +12 -1
- package/lib/components/attachment/src/attachment.vue2.js +68 -28
- package/lib/components/attachment/src/attachment.vue2.js.map +1 -1
- package/lib/components/attachment/src/use-attachment.d.ts +32 -24
- package/lib/components/attachment/src/use-attachment.js +63 -10
- package/lib/components/attachment/src/use-attachment.js.map +1 -1
- package/lib/components/header/index.d.ts +15 -0
- package/lib/components/header/src/header.d.ts +4 -0
- package/lib/components/header/src/header.js +6 -1
- package/lib/components/header/src/header.js.map +1 -1
- package/lib/components/header/src/header.vue.d.ts +9 -0
- package/lib/components/header/src/header.vue2.js +6 -1
- package/lib/components/header/src/header.vue2.js.map +1 -1
- package/lib/components/header/src/use-header.js +42 -44
- package/lib/components/header/src/use-header.js.map +1 -1
- package/lib/components/uni-vue/src/use-uni-vue.js +2 -1
- package/lib/components/uni-vue/src/use-uni-vue.js.map +1 -1
- package/lib/hooks/dialog/use-dialog.js.map +1 -1
- package/lib/locale/lang/en.d.ts +12 -0
- package/lib/locale/lang/en.js +12 -0
- package/lib/locale/lang/en.js.map +1 -1
- package/lib/locale/lang/zh-cn.d.ts +12 -0
- package/lib/locale/lang/zh-cn.js +12 -0
- package/lib/locale/lang/zh-cn.js.map +1 -1
- package/lib/package.json.js +1 -1
- package/lib/utils/file.d.ts +1 -1
- package/lib/utils/file.js.map +1 -1
- package/package.json +1 -1
- package/theme-chalk/attachment.css +1 -0
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/attachment.scss +37 -0
- package/theme-chalk/src/index.scss +2 -1
package/es/utils/file.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.mjs","sources":["../../../../packages/utils/file.ts"],"sourcesContent":["import { http, type AxiosResponse } from './http'\nimport { ElMessage, ElMessageBox } from 'element-plus'\nimport { getEnv, getLocationEnv } from './env'\nimport { encode } from 'js-base64'\n/**\n * 获取全路径\n * @param filePath 附件地址\n * @returns 全路径\n */\n\nexport const getFullUrl = (filePath: string) => {\n return filePath.indexOf('hongxinshop.com') > -1\n ? filePath\n : `${window.location.protocol}${getEnv() === 'local' ? `//${getLocationEnv()}-hxjf.hongxinshop.com` : ''}/image/${filePath}`\n}\nconst downloadSrc = ({\n src,\n fileName,\n blob,\n}: {\n src: string\n fileName: string\n blob?: boolean\n}) => {\n if (src) {\n fileName = fileName || src.split('/')[src.split('/').length - 1]\n const a = document.createElement('a')\n a.style.display = 'none'\n document.body.appendChild(a)\n const event = new MouseEvent('click')\n a.download = fileName\n a.href = blob ? src : getFullUrl(src)\n\n a.target = '_blank'\n a.dispatchEvent(event)\n document.body.removeChild(a)\n }\n}\n\n// 下载文件\nexport async function downloadFile({\n api = '',\n blob,\n data = {},\n src,\n fileName = '',\n config = {},\n}: {\n api?: string\n blob?: boolean\n data?: Record<string, any>\n src?: string\n fileName?: string\n config?: Record<string, any>\n}) {\n if (src) {\n downloadSrc({ src, fileName })\n return\n }\n http\n .request<any, AxiosResponse>(api, {\n method: config.method || 'post',\n data,\n loading: true,\n responseType: blob ? 'blob' : undefined,\n responseReturn: 'raw',\n ...config,\n })\n .then((res) => {\n const { headers } = res\n if (!res.data.success) {\n return ElMessage.error(res.data.msg)\n }\n const data = res.data?.data || res.data?.data?.url || ''\n const lowerHeaders = {}\n for (const key in headers) {\n lowerHeaders[key.toLowerCase()] = headers[key]\n }\n let src = ''\n if (blob) {\n const contentDisposition = lowerHeaders['content-disposition'] || ''\n fileName =\n fileName ||\n decodeURIComponent(contentDisposition.split('filename=')[1])\n const blob = new Blob([data], {\n type: headers['content-type'],\n })\n src = window.URL.createObjectURL(blob)\n setTimeout(() => window.URL.revokeObjectURL(src), 100) // 释放内存\n } else {\n src = data\n }\n downloadSrc({ src, fileName, blob })\n })\n}\n\n// 导入文件\ninterface ImportFileOptions {\n accept?: string\n multiple?: boolean\n fieldName?: string\n api?: string\n failedFileName?: string // 导入失败时提示的文件名\n extraData?: Record<string, any> // 随文件一同发送的其他表单数据\n}\nexport const importFile = async ({\n accept = '*',\n multiple = false,\n fieldName = 'file',\n failedFileName = '',\n extraData = {},\n api = '',\n}: ImportFileOptions) => {\n return new Promise((resolve, reject) => {\n const input = document.createElement('input')\n input.type = 'file'\n input.accept = accept\n input.multiple = multiple\n const formData = new FormData()\n Object.keys(extraData).forEach((key) => {\n formData.append(key, extraData[key])\n })\n input.onchange = async (event: Event) => {\n const target = event.target as HTMLInputElement\n const files = target.files\n if (files && files.length > 0) {\n if (!multiple) {\n formData.append(fieldName, files[0])\n } else {\n Array.from(files).forEach((file, index) => {\n formData.append(`${fieldName}${index}`, file)\n })\n }\n try {\n const { data } = await http.request<any, AxiosResponse>(api, {\n method: 'post',\n data: formData,\n loading: true,\n responseReturn: 'raw',\n transformRequest: [\n function (data) {\n return data\n },\n ],\n })\n if (data.success) {\n return resolve(data.data)\n }\n if (data.code === -2) {\n const fileName =\n failedFileName ||\n data.data.split('/')[data.data.split('/').length - 1]\n const url = `${window.location.origin}/image/${data.data}`\n const failedHtml = `<div style=\"word-break: break-all;\">失败详情:<a style=\"color:#409EFF;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap\" title=\"${url}\" href=\"${url}\" download=\"${fileName}\">${url}</a></div>`\n ElMessageBox.alert(failedHtml, '提示', {\n confirmButtonText: '确定',\n type: 'error',\n dangerouslyUseHTMLString: true,\n })\n return\n }\n return ElMessage.error(data.msg)\n } catch (error) {\n console.error(error)\n }\n input.onchange = null\n }\n }\n input.click()\n })\n}\n\n// 预览文件\nexport const previewFile = (url: string) => {\n url = getFullUrl(url)\n const origin = getFullUrl('').replace('/image/', '')\n const previewUrl = `${origin}/kfv/onlinePreview?url=${encode(url)}`\n window.open(previewUrl, '_blank')\n}\n"],"names":["data","src","blob"],"mappings":";;;;;A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AA,CAAA;AACvN,YAAA,YAAA,CAAa,KAAA,CAAM,YAAY,cAAA,EAAM;AAAA,cACnC,iBAAA,EAAmB,cAAA;AAAA,cACnB,IAAA,EAAM,OAAA;AAAA,cACN,wBAAA,EAA0B;AAAA,aAC3B,CAAA;AACD,YAAA;AAAA,UACF;AACA,UAAA,OAAO,SAAA,CAAU,KAAA,CAAM,IAAA,CAAK,GAAG,CAAA;AAAA,QACjC,SAAS,KAAA,EAAO;AACd,UAAA,OAAA,CAAQ,MAAM,KAAK,CAAA;AAAA,QACrB;AACA,QAAA,KAAA,CAAM,QAAA,GAAW,IAAA;AAAA,MACnB;AAAA,IACF,CAAA;AACA,IAAA,KAAA,CAAM,KAAA,EAAM;AAAA,EACd,CAAC,CAAA;AACH;AAGO,MAAM,WAAA,GAAc,CAAC,GAAA,KAAgB;AAC1C,EAAA,GAAA,GAAM,WAAW,GAAG,CAAA;AACpB,EAAA,MAAM,SAAS,UAAA,CAAW,EAAE,CAAA,CAAE,OAAA,CAAQ,WAAW,EAAE,CAAA;AACnD,EAAA,MAAM,aAAa,CAAA,EAAG,MAAM,CAAA,uBAAA,EAA0B,MAAA,CAAO,GAAG,CAAC,CAAA,CAAA;AACjE,EAAA,MAAA,CAAO,IAAA,CAAK,YAAY,QAAQ,CAAA;AAClC;;;;"}
|
|
1
|
+
{"version":3,"file":"file.mjs","sources":["../../../../packages/utils/file.ts"],"sourcesContent":["import { http, type AxiosResponse } from './http'\nimport { ElMessage, ElMessageBox } from 'element-plus'\nimport { getEnv, getLocationEnv } from './env'\nimport { encode } from 'js-base64'\n/**\n * 获取全路径\n * @param filePath 附件地址\n * @returns 全路径\n */\n\nexport const getFullUrl = (filePath: string) => {\n return filePath.indexOf('hongxinshop.com') > -1\n ? filePath\n : `${window.location.protocol}${getEnv() === 'local' ? `//${getLocationEnv()}-hxjf.hongxinshop.com` : ''}/image/${filePath}`\n}\nconst downloadSrc = ({\n src,\n fileName,\n blob,\n}: {\n src: string\n fileName: string\n blob?: boolean\n}) => {\n if (src) {\n fileName = fileName || src.split('/')[src.split('/').length - 1]\n const a = document.createElement('a')\n a.style.display = 'none'\n document.body.appendChild(a)\n const event = new MouseEvent('click')\n a.download = fileName\n a.href = blob ? src : getFullUrl(src)\n\n a.target = '_blank'\n a.dispatchEvent(event)\n document.body.removeChild(a)\n }\n}\n\n// 下载文件\nexport async function downloadFile({\n api = '',\n blob,\n data = {},\n src,\n fileName = '',\n config = {},\n}: {\n api?: string\n blob?: boolean\n data?: Record<string, any>\n src?: string\n fileName?: string\n config?: Record<string, any>\n}) {\n if (src) {\n downloadSrc({ src, fileName })\n return\n }\n http\n .request<any, AxiosResponse>(api, {\n method: config.method || 'post',\n data,\n loading: true,\n responseType: blob ? 'blob' : undefined,\n responseReturn: 'raw',\n ...config,\n })\n .then((res) => {\n const { headers } = res\n if (!res.data.success) {\n return ElMessage.error(res.data.msg)\n }\n const data = res.data?.data || res.data?.data?.url || ''\n const lowerHeaders = {}\n for (const key in headers) {\n lowerHeaders[key.toLowerCase()] = headers[key]\n }\n let src = ''\n if (blob) {\n const contentDisposition = lowerHeaders['content-disposition'] || ''\n fileName =\n fileName ||\n decodeURIComponent(contentDisposition.split('filename=')[1])\n const blob = new Blob([data], {\n type: headers['content-type'],\n })\n src = window.URL.createObjectURL(blob)\n setTimeout(() => window.URL.revokeObjectURL(src), 100) // 释放内存\n } else {\n src = data\n }\n downloadSrc({ src, fileName, blob })\n })\n}\n\n// 导入文件\ninterface ImportFileOptions {\n accept?: string\n multiple?: boolean\n fieldName?: string\n api?: string\n failedFileName?: string // 导入失败时提示的文件名\n extraData?: Record<string, any> // 随文件一同发送的其他表单数据\n}\nexport const importFile = async ({\n accept = '*',\n multiple = false,\n fieldName = 'file',\n failedFileName = '',\n extraData = {},\n api = '',\n}: ImportFileOptions) => {\n return new Promise<Record<string, any>>((resolve, reject) => {\n const input = document.createElement('input')\n input.type = 'file'\n input.accept = accept\n input.multiple = multiple\n const formData = new FormData()\n Object.keys(extraData).forEach((key) => {\n formData.append(key, extraData[key])\n })\n input.onchange = async (event: Event) => {\n const target = event.target as HTMLInputElement\n const files = target.files\n if (files && files.length > 0) {\n if (!multiple) {\n formData.append(fieldName, files[0])\n } else {\n Array.from(files).forEach((file, index) => {\n formData.append(`${fieldName}${index}`, file)\n })\n }\n try {\n const { data } = await http.request<any, AxiosResponse>(api, {\n method: 'post',\n data: formData,\n loading: true,\n responseReturn: 'raw',\n transformRequest: [\n function (data) {\n return data\n },\n ],\n })\n if (data.success) {\n return resolve(data.data)\n }\n if (data.code === -2) {\n const fileName =\n failedFileName ||\n data.data.split('/')[data.data.split('/').length - 1]\n const url = `${window.location.origin}/image/${data.data}`\n const failedHtml = `<div style=\"word-break: break-all;\">失败详情:<a style=\"color:#409EFF;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap\" title=\"${url}\" href=\"${url}\" download=\"${fileName}\">${url}</a></div>`\n ElMessageBox.alert(failedHtml, '提示', {\n confirmButtonText: '确定',\n type: 'error',\n dangerouslyUseHTMLString: true,\n })\n return\n }\n return ElMessage.error(data.msg)\n } catch (error) {\n console.error(error)\n }\n input.onchange = null\n }\n }\n input.click()\n })\n}\n\n// 预览文件\nexport const previewFile = (url: string) => {\n url = getFullUrl(url)\n const origin = getFullUrl('').replace('/image/', '')\n const previewUrl = `${origin}/kfv/onlinePreview?url=${encode(url)}`\n window.open(previewUrl, '_blank')\n}\n"],"names":["data","src","blob"],"mappings":";;;;;AAUO,MAAM,UAAA,GAAa,CAAC,QAAA,KAAqB;AAC9C,EAAA,OAAO,QAAA,CAAS,QAAQ,iBAAiB,CAAA,GAAI,KACzC,QAAA,GACA,CAAA,EAAG,OAAO,QAAA,CAAS,QAAQ,GAAG,MAAA,EAAO,KAAM,UAAU,CAAA,EAAA,EAAK,cAAA,EAAgB,CAAA,qBAAA,CAAA,GAA0B,EAAE,UAAU,QAAQ,CAAA,CAAA;AAC9H;AACA,MAAM,cAAc,CAAC;AAAA,EACnB,GAAA;AAAA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AA;AAAA,QACrB;AACA,QAAA,KAAA,CAAM,QAAA,GAAW,IAAA;AAAA,MACnB;AAAA,IACF,CAAA;AACA,IAAA,KAAA,CAAM,KAAA,EAAM;AAAA,EACd,CAAC,CAAA;AACH;AAGO,MAAM,WAAA,GAAc,CAAC,GAAA,KAAgB;AAC1C,EAAA,GAAA,GAAM,WAAW,GAAG,CAAA;AACpB,EAAA,MAAM,SAAS,UAAA,CAAW,EAAE,CAAA,CAAE,OAAA,CAAQ,WAAW,EAAE,CAAA;AACnD,EAAA,MAAM,aAAa,CAAA,EAAG,MAAM,CAAA,uBAAA,EAA0B,MAAA,CAAO,GAAG,CAAC,CAAA,CAAA;AACjE,EAAA,MAAA,CAAO,IAAA,CAAK,YAAY,QAAQ,CAAA;AAClC;;;;"}
|
|
@@ -32,12 +32,18 @@ export declare const EpAttachment: {
|
|
|
32
32
|
readonly type: BooleanConstructor;
|
|
33
33
|
readonly default: false;
|
|
34
34
|
};
|
|
35
|
+
isShowOpenDialogButton: {
|
|
36
|
+
readonly type: BooleanConstructor;
|
|
37
|
+
readonly default: false;
|
|
38
|
+
};
|
|
35
39
|
modelValue: {
|
|
36
40
|
type: import("vue").PropType<any[]>;
|
|
37
41
|
};
|
|
38
42
|
}>> & Readonly<{
|
|
39
43
|
"onUpdate:modelValue"?: ((value: any[] | undefined) => any) | undefined;
|
|
40
|
-
}>, {
|
|
44
|
+
}>, {
|
|
45
|
+
open: () => Promise<any>;
|
|
46
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
41
47
|
"update:modelValue": (value: any[] | undefined) => any;
|
|
42
48
|
}, import("vue").PublicProps, {
|
|
43
49
|
formatColumns: Partial<import("element-plus").TableColumnCtx & {
|
|
@@ -57,6 +63,7 @@ export declare const EpAttachment: {
|
|
|
57
63
|
openType: "dialog" | "normal";
|
|
58
64
|
isType: boolean;
|
|
59
65
|
isNote: boolean;
|
|
66
|
+
isShowOpenDialogButton: boolean;
|
|
60
67
|
}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
61
68
|
P: {};
|
|
62
69
|
B: {};
|
|
@@ -97,12 +104,18 @@ export declare const EpAttachment: {
|
|
|
97
104
|
readonly type: BooleanConstructor;
|
|
98
105
|
readonly default: false;
|
|
99
106
|
};
|
|
107
|
+
isShowOpenDialogButton: {
|
|
108
|
+
readonly type: BooleanConstructor;
|
|
109
|
+
readonly default: false;
|
|
110
|
+
};
|
|
100
111
|
modelValue: {
|
|
101
112
|
type: import("vue").PropType<any[]>;
|
|
102
113
|
};
|
|
103
114
|
}>> & Readonly<{
|
|
104
115
|
"onUpdate:modelValue"?: ((value: any[] | undefined) => any) | undefined;
|
|
105
|
-
}>, {
|
|
116
|
+
}>, {
|
|
117
|
+
open: () => Promise<any>;
|
|
118
|
+
}, {}, {}, {}, {
|
|
106
119
|
formatColumns: Partial<import("element-plus").TableColumnCtx & {
|
|
107
120
|
[key: string]: any;
|
|
108
121
|
required: boolean | (() => boolean);
|
|
@@ -120,6 +133,7 @@ export declare const EpAttachment: {
|
|
|
120
133
|
openType: "dialog" | "normal";
|
|
121
134
|
isType: boolean;
|
|
122
135
|
isNote: boolean;
|
|
136
|
+
isShowOpenDialogButton: boolean;
|
|
123
137
|
}>;
|
|
124
138
|
__isFragment?: never;
|
|
125
139
|
__isTeleport?: never;
|
|
@@ -144,12 +158,18 @@ export declare const EpAttachment: {
|
|
|
144
158
|
readonly type: BooleanConstructor;
|
|
145
159
|
readonly default: false;
|
|
146
160
|
};
|
|
161
|
+
isShowOpenDialogButton: {
|
|
162
|
+
readonly type: BooleanConstructor;
|
|
163
|
+
readonly default: false;
|
|
164
|
+
};
|
|
147
165
|
modelValue: {
|
|
148
166
|
type: import("vue").PropType<any[]>;
|
|
149
167
|
};
|
|
150
168
|
}>> & Readonly<{
|
|
151
169
|
"onUpdate:modelValue"?: ((value: any[] | undefined) => any) | undefined;
|
|
152
|
-
}>, {
|
|
170
|
+
}>, {
|
|
171
|
+
open: () => Promise<any>;
|
|
172
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
153
173
|
"update:modelValue": (value: any[] | undefined) => any;
|
|
154
174
|
}, string, {
|
|
155
175
|
formatColumns: Partial<import("element-plus").TableColumnCtx & {
|
|
@@ -169,6 +189,7 @@ export declare const EpAttachment: {
|
|
|
169
189
|
openType: "dialog" | "normal";
|
|
170
190
|
isType: boolean;
|
|
171
191
|
isNote: boolean;
|
|
192
|
+
isShowOpenDialogButton: boolean;
|
|
172
193
|
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("vue").Plugin;
|
|
173
194
|
export default EpAttachment;
|
|
174
195
|
export * from './src/attachment';
|
|
@@ -19,5 +19,9 @@ export declare const attachmentProps: {
|
|
|
19
19
|
readonly type: BooleanConstructor;
|
|
20
20
|
readonly default: false;
|
|
21
21
|
};
|
|
22
|
+
readonly isShowOpenDialogButton: {
|
|
23
|
+
readonly type: BooleanConstructor;
|
|
24
|
+
readonly default: false;
|
|
25
|
+
};
|
|
22
26
|
};
|
|
23
27
|
export type AttachmentProps = ExtractPropTypes<typeof attachmentProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment.js","sources":["../../../../../../packages/components/attachment/src/attachment.ts"],"sourcesContent":["import type { ExtractPropTypes, PropType } from 'vue'\nimport { tableProps } from '@el-plus/components/table'\nimport { headerProps } from '@el-plus/components/header'\nexport const attachmentProps = {\n // 格式化列\n formatColumns: {\n ...tableProps.formatColumns,\n },\n // 页面模式\n mode: {\n ...headerProps.mode,\n },\n // 展示模式\n openType: {\n type: String as PropType<'dialog' | 'normal'>,\n default: 'dialog',\n },\n // 是否需要类型\n isType: {\n type: Boolean,\n default: true,\n },\n // 是否需要备注\n isNote: {\n type: Boolean,\n default: false,\n },\n} as const\nexport type AttachmentProps = ExtractPropTypes<typeof attachmentProps>\n"],"names":["tableProps","headerProps"],"mappings":";;;;;AAGO,MAAM,eAAA,GAAkB;AAAA;AAAA,EAE7B,aAAA,EAAe;AAAA,IACb,GAAGA,gBAAA,CAAW;AAAA,GAChB;AAAA;AAAA,EAEA,IAAA,EAAM;AAAA,IACJ,GAAGC,kBAAA,CAAY;AAAA,GACjB;AAAA;AAAA,EAEA,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA,EAEA,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA,EAEA,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA;AAEb;;;;"}
|
|
1
|
+
{"version":3,"file":"attachment.js","sources":["../../../../../../packages/components/attachment/src/attachment.ts"],"sourcesContent":["import type { ExtractPropTypes, PropType } from 'vue'\nimport { tableProps } from '@el-plus/components/table'\nimport { headerProps } from '@el-plus/components/header'\nexport const attachmentProps = {\n // 格式化列\n formatColumns: {\n ...tableProps.formatColumns,\n },\n // 页面模式\n mode: {\n ...headerProps.mode,\n },\n // 展示模式\n openType: {\n type: String as PropType<'dialog' | 'normal'>,\n default: 'dialog',\n },\n // 是否需要类型\n isType: {\n type: Boolean,\n default: true,\n },\n // 是否需要备注\n isNote: {\n type: Boolean,\n default: false,\n },\n // 是否需要打开弹窗按钮\n isShowOpenDialogButton: {\n type: Boolean,\n default: false,\n },\n} as const\nexport type AttachmentProps = ExtractPropTypes<typeof attachmentProps>\n"],"names":["tableProps","headerProps"],"mappings":";;;;;AAGO,MAAM,eAAA,GAAkB;AAAA;AAAA,EAE7B,aAAA,EAAe;AAAA,IACb,GAAGA,gBAAA,CAAW;AAAA,GAChB;AAAA;AAAA,EAEA,IAAA,EAAM;AAAA,IACJ,GAAGC,kBAAA,CAAY;AAAA,GACjB;AAAA;AAAA,EAEA,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA,EAEA,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA,EAEA,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA;AAAA,EAEA,sBAAA,EAAwB;AAAA,IACtB,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA;AAEb;;;;"}
|
|
@@ -18,10 +18,16 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
18
18
|
readonly type: BooleanConstructor;
|
|
19
19
|
readonly default: false;
|
|
20
20
|
};
|
|
21
|
+
isShowOpenDialogButton: {
|
|
22
|
+
readonly type: BooleanConstructor;
|
|
23
|
+
readonly default: false;
|
|
24
|
+
};
|
|
21
25
|
modelValue: {
|
|
22
26
|
type: import("vue").PropType<any[]>;
|
|
23
27
|
};
|
|
24
|
-
}>, {
|
|
28
|
+
}>, {
|
|
29
|
+
open: () => Promise<any>;
|
|
30
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
25
31
|
"update:modelValue": (value: any[] | undefined) => any;
|
|
26
32
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
27
33
|
formatColumns: {
|
|
@@ -43,6 +49,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
43
49
|
readonly type: BooleanConstructor;
|
|
44
50
|
readonly default: false;
|
|
45
51
|
};
|
|
52
|
+
isShowOpenDialogButton: {
|
|
53
|
+
readonly type: BooleanConstructor;
|
|
54
|
+
readonly default: false;
|
|
55
|
+
};
|
|
46
56
|
modelValue: {
|
|
47
57
|
type: import("vue").PropType<any[]>;
|
|
48
58
|
};
|
|
@@ -66,6 +76,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
66
76
|
openType: "dialog" | "normal";
|
|
67
77
|
isType: boolean;
|
|
68
78
|
isNote: boolean;
|
|
79
|
+
isShowOpenDialogButton: boolean;
|
|
69
80
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
70
81
|
declare const _default: typeof __VLS_export;
|
|
71
82
|
export default _default;
|
|
@@ -9,6 +9,8 @@ var attachment = require('./attachment.js');
|
|
|
9
9
|
var index = require('../../table/index.js');
|
|
10
10
|
var useAttachment = require('./use-attachment.js');
|
|
11
11
|
var useDialog = require('../../../hooks/dialog/use-dialog.js');
|
|
12
|
+
var useLocale = require('../../../hooks/use-locale.js');
|
|
13
|
+
var elementPlus = require('element-plus');
|
|
12
14
|
|
|
13
15
|
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
14
16
|
...{
|
|
@@ -21,46 +23,84 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
21
23
|
"modelModifiers": {}
|
|
22
24
|
}),
|
|
23
25
|
emits: ["update:modelValue"],
|
|
24
|
-
setup(__props) {
|
|
26
|
+
setup(__props, { expose: __expose }) {
|
|
27
|
+
const { t } = useLocale.useLocale();
|
|
25
28
|
const bem$1 = bem.createNameSpace("attachment");
|
|
26
29
|
const props$1 = __props;
|
|
27
30
|
const modelValue = vue.useModel(__props, "modelValue");
|
|
31
|
+
const { columns, addAttachment, isNormalOpen, onConfirm, onCancel } = useAttachment.useAttachment(props$1, {
|
|
32
|
+
data: modelValue
|
|
33
|
+
});
|
|
28
34
|
const AttachmentDialog = useDialog.useDialog({
|
|
29
|
-
class: bem$1.em("dialog", props$1.openType === "normal" ? props$1.openType : ""),
|
|
30
35
|
width: 850,
|
|
31
36
|
center: true,
|
|
32
|
-
title: "
|
|
37
|
+
title: isNormalOpen ? "" : t("ep.attachment.manageAttachment"),
|
|
38
|
+
modal: !isNormalOpen,
|
|
39
|
+
showClose: !isNormalOpen,
|
|
40
|
+
showFooter: !isNormalOpen,
|
|
41
|
+
transition: isNormalOpen ? "" : "dialog-fade",
|
|
42
|
+
modalClass: bem$1.em(
|
|
43
|
+
"dialog",
|
|
44
|
+
props$1.openType === "normal" ? props$1.openType : ""
|
|
45
|
+
),
|
|
33
46
|
onConfirm: async (resolve) => {
|
|
47
|
+
onConfirm(resolve);
|
|
48
|
+
},
|
|
49
|
+
onCancel: (resolve) => {
|
|
50
|
+
onCancel(resolve);
|
|
34
51
|
}
|
|
35
52
|
});
|
|
36
|
-
const
|
|
37
|
-
|
|
53
|
+
const open = AttachmentDialog.open;
|
|
54
|
+
if (isNormalOpen) {
|
|
55
|
+
open();
|
|
56
|
+
}
|
|
57
|
+
__expose({
|
|
58
|
+
open
|
|
38
59
|
});
|
|
39
60
|
return (_ctx, _cache) => {
|
|
40
|
-
const
|
|
41
|
-
return vue.openBlock(), vue.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
61
|
+
const _component_EpButtons = vue.resolveComponent("EpButtons");
|
|
62
|
+
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
63
|
+
_ctx.isShowOpenDialogButton ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElButton), {
|
|
64
|
+
key: 0,
|
|
65
|
+
type: "primary",
|
|
66
|
+
plain: "",
|
|
67
|
+
size: "small",
|
|
68
|
+
class: vue.normalizeClass(vue.unref(bem$1).e("handler")),
|
|
69
|
+
onClick: vue.unref(open)
|
|
70
|
+
}, {
|
|
71
|
+
default: vue.withCtx(() => [
|
|
72
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(t)("ep.attachment.manageAttachment")) + "(" + vue.toDisplayString(modelValue.value?.length || 0) + ") ", 1)
|
|
73
|
+
]),
|
|
74
|
+
_: 1
|
|
75
|
+
}, 8, ["class", "onClick"])) : vue.createCommentVNode("", true),
|
|
76
|
+
vue.createVNode(vue.unref(AttachmentDialog), null, {
|
|
77
|
+
default: vue.withCtx(() => [
|
|
78
|
+
vue.createElementVNode("div", { style: { "margin-bottom": "10px", "text-align": "right" } }, [
|
|
79
|
+
_ctx.openType === "dialog" ? (vue.openBlock(), vue.createBlock(_component_EpButtons, {
|
|
80
|
+
key: 0,
|
|
81
|
+
type: "primary",
|
|
82
|
+
list: [
|
|
83
|
+
{
|
|
84
|
+
name: vue.unref(t)("ep.attachment.addAttachment"),
|
|
85
|
+
type: "primary",
|
|
86
|
+
onClick: vue.unref(addAttachment)
|
|
87
|
+
}
|
|
88
|
+
]
|
|
89
|
+
}, null, 8, ["list"])) : vue.createCommentVNode("", true)
|
|
50
90
|
]),
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
data
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
91
|
+
vue.createVNode(vue.unref(index.EpTable), vue.mergeProps({
|
|
92
|
+
ref: "tableRef",
|
|
93
|
+
class: `${vue.unref(bem$1).b()} ${vue.unref(props.prepareClassNames)()}`,
|
|
94
|
+
style: {
|
|
95
|
+
...vue.unref(props.prepareStyles)()
|
|
96
|
+
},
|
|
97
|
+
columns: vue.unref(columns),
|
|
98
|
+
data: modelValue.value
|
|
99
|
+
}, props$1), null, 16, ["class", "style", "columns", "data"])
|
|
100
|
+
]),
|
|
101
|
+
_: 1
|
|
102
|
+
})
|
|
103
|
+
], 64);
|
|
64
104
|
};
|
|
65
105
|
}
|
|
66
106
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment.vue2.js","sources":["../../../../../../packages/components/attachment/src/attachment.vue"],"sourcesContent":["<template>\n <AttachmentDialog>\n <
|
|
1
|
+
{"version":3,"file":"attachment.vue2.js","sources":["../../../../../../packages/components/attachment/src/attachment.vue"],"sourcesContent":["<template>\n <ElButton\n v-if=\"isShowOpenDialogButton\"\n type=\"primary\"\n plain\n size=\"small\"\n :class=\"bem.e('handler')\"\n @click=\"open\"\n >\n {{ t('ep.attachment.manageAttachment') }}({{ modelValue?.length || 0 }})\n </ElButton>\n <AttachmentDialog>\n <div style=\"margin-bottom: 10px; text-align: right\">\n <EpButtons\n v-if=\"openType === 'dialog'\"\n type=\"primary\"\n :list=\"[\n {\n name: t('ep.attachment.addAttachment'),\n type: 'primary',\n onClick: addAttachment,\n },\n ]\"\n />\n </div>\n\n <EpTable\n ref=\"tableRef\"\n :class=\"`${bem.b()} ${prepareClassNames()}`\"\n :style=\"{\n ...prepareStyles(),\n }\"\n :columns=\"columns\"\n :data=\"modelValue\"\n v-bind=\"props\"\n >\n </EpTable>\n </AttachmentDialog>\n</template>\n<script setup lang=\"ts\">\nimport { createNameSpace } from '@el-plus/utils/bem'\nimport { prepareClassNames, prepareStyles } from '@el-plus/utils/props'\nimport { attachmentProps } from './attachment'\nimport EpTable from '@el-plus/components/table'\nimport { useAttachment } from './use-attachment'\nimport type { TableProps } from '@el-plus/components/table'\nimport { useDialog } from '@el-plus/hooks/dialog/use-dialog'\nimport { useLocale } from '@el-plus/hooks/use-locale'\nimport { ElButton } from 'element-plus'\nconst { t } = useLocale()\ndefineOptions({\n name: 'EpAttachment',\n inheritAttrs: false,\n})\nconst bem = createNameSpace('attachment')\nconst props = defineProps(attachmentProps)\nconst modelValue = defineModel<TableProps['data']>()\nconst { columns, addAttachment, isNormalOpen, onConfirm, onCancel } =\n useAttachment(props, {\n data: modelValue,\n })\nconst AttachmentDialog = useDialog({\n width: 850,\n center: true,\n title: isNormalOpen ? '' : t('ep.attachment.manageAttachment'),\n modal: !isNormalOpen,\n showClose: !isNormalOpen,\n showFooter: !isNormalOpen,\n transition: isNormalOpen ? '' : 'dialog-fade',\n modalClass: bem.em(\n 'dialog',\n props.openType === 'normal' ? props.openType : '',\n ),\n onConfirm: async (resolve) => {\n onConfirm(resolve)\n },\n onCancel: (resolve) => {\n onCancel(resolve)\n },\n})\nconst open = AttachmentDialog.open\nif (isNormalOpen) {\n open()\n}\ndefineExpose({\n open,\n})\n</script>\n"],"names":["useLocale","bem","createNameSpace","props","_useModel","useAttachment","useDialog","isShowOpenDialogButton","_createBlock","_unref","ElButton","_normalizeClass","_createTextVNode","_toDisplayString","_createVNode","_createElementVNode","openType","_mergeProps","prepareClassNames","prepareStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,IAAA,MAAM,EAAE,CAAA,EAAE,GAAIA,mBAAA,EAAU;AAKxB,IAAA,MAAMC,KAAA,GAAMC,oBAAgB,YAAY,CAAA;AACxC,IAAA,MAAMC,OAAA,GAAQ,OAAA;AACd,IAAA,MAAM,UAAA,GAAaC,YAAA,CAA+B,OAAA,EAAA,YAAC,CAAA;AACnD,IAAA,MAAM,EAAE,SAAS,aAAA,EAAe,YAAA,EAAc,WAAW,QAAA,EAAS,GAChEC,4BAAcF,OAAA,EAAO;AAAA,MACnB,IAAA,EAAM;AAAA,KACP,CAAA;AACH,IAAA,MAAM,mBAAmBG,mBAAA,CAAU;AAAA,MACjC,KAAA,EAAO,GAAA;AAAA,MACP,MAAA,EAAQ,IAAA;AAAA,MACR,KAAA,EAAO,YAAA,GAAe,EAAA,GAAK,CAAA,CAAE,gCAAgC,CAAA;AAAA,MAC7D,OAAO,CAAC,YAAA;AAAA,MACR,WAAW,CAAC,YAAA;AAAA,MACZ,YAAY,CAAC,YAAA;AAAA,MACb,UAAA,EAAY,eAAe,EAAA,GAAK,aAAA;AAAA,MAChC,YAAYL,KAAA,CAAI,EAAA;AAAA,QACd,QAAA;AAAA,QACAE,OAAA,CAAM,QAAA,KAAa,QAAA,GAAWA,OAAA,CAAM,QAAA,GAAW;AAAA,OACjD;AAAA,MACA,SAAA,EAAW,OAAO,OAAA,KAAY;AAC5B,QAAA,SAAA,CAAU,OAAO,CA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AAA,EAAI,UAAA;AAAA,cACH,KAAA,EAAK,CAAA,EAAKR,SAAA,CAAAR,KAAA,CAAA,CAAI,CAAA,MAAOQ,SAAA,CAAAS,uBAAA,CAAA,EAAiB,CAAA,CAAA;AAAA,cACtC,KAAA,EAAK;AAAA,mBAAeT,SAAA,CAAAU,mBAAA,CAAA;AAAa;cAGjC,OAAA,EAASV,UAAA,OAAA,CAAA;AAAA,cACT,MAAM,UAAA,CAAA;AAAA,eACCN,OAAK,CAAA,EAAA,IAAA,EAAA,EAAA,EAAA,CAAA,OAAA,EAAA,OAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAAA;;;;;;;;;;"}
|
|
@@ -3,21 +3,22 @@ export declare const useAttachment: (props: any, { data }: {
|
|
|
3
3
|
}) => {
|
|
4
4
|
columns: import("vue").Ref<({
|
|
5
5
|
type: string;
|
|
6
|
-
label:
|
|
6
|
+
label: any;
|
|
7
7
|
width: string;
|
|
8
8
|
props: {
|
|
9
9
|
type: string;
|
|
10
10
|
list: ({
|
|
11
|
-
name:
|
|
11
|
+
name: any;
|
|
12
12
|
onClick: ({ row }: {
|
|
13
13
|
row: any;
|
|
14
14
|
}) => void;
|
|
15
15
|
disabled?: undefined;
|
|
16
16
|
} | {
|
|
17
|
-
name:
|
|
17
|
+
name: any;
|
|
18
18
|
disabled: () => boolean;
|
|
19
|
-
onClick: ({ $index }: {
|
|
19
|
+
onClick: ({ $index, row }: {
|
|
20
20
|
$index: any;
|
|
21
|
+
row: any;
|
|
21
22
|
}) => void;
|
|
22
23
|
})[];
|
|
23
24
|
desc?: undefined;
|
|
@@ -27,7 +28,7 @@ export declare const useAttachment: (props: any, { data }: {
|
|
|
27
28
|
show?: undefined;
|
|
28
29
|
onClick?: undefined;
|
|
29
30
|
} | {
|
|
30
|
-
label:
|
|
31
|
+
label: any;
|
|
31
32
|
prop: string;
|
|
32
33
|
type: string;
|
|
33
34
|
required: boolean;
|
|
@@ -42,7 +43,7 @@ export declare const useAttachment: (props: any, { data }: {
|
|
|
42
43
|
width?: undefined;
|
|
43
44
|
onClick?: undefined;
|
|
44
45
|
} | {
|
|
45
|
-
label:
|
|
46
|
+
label: any;
|
|
46
47
|
prop: string;
|
|
47
48
|
type: string;
|
|
48
49
|
onClick: ({ row }: {
|
|
@@ -53,7 +54,7 @@ export declare const useAttachment: (props: any, { data }: {
|
|
|
53
54
|
required?: undefined;
|
|
54
55
|
show?: undefined;
|
|
55
56
|
} | {
|
|
56
|
-
label:
|
|
57
|
+
label: any;
|
|
57
58
|
prop: string;
|
|
58
59
|
type?: undefined;
|
|
59
60
|
width?: undefined;
|
|
@@ -62,7 +63,7 @@ export declare const useAttachment: (props: any, { data }: {
|
|
|
62
63
|
show?: undefined;
|
|
63
64
|
onClick?: undefined;
|
|
64
65
|
} | {
|
|
65
|
-
label:
|
|
66
|
+
label: any;
|
|
66
67
|
prop: string;
|
|
67
68
|
type: string;
|
|
68
69
|
show: () => any;
|
|
@@ -72,21 +73,22 @@ export declare const useAttachment: (props: any, { data }: {
|
|
|
72
73
|
onClick?: undefined;
|
|
73
74
|
})[], ({
|
|
74
75
|
type: string;
|
|
75
|
-
label:
|
|
76
|
+
label: any;
|
|
76
77
|
width: string;
|
|
77
78
|
props: {
|
|
78
79
|
type: string;
|
|
79
80
|
list: ({
|
|
80
|
-
name:
|
|
81
|
+
name: any;
|
|
81
82
|
onClick({ row }: {
|
|
82
83
|
row: any;
|
|
83
84
|
}): void;
|
|
84
85
|
disabled?: undefined;
|
|
85
86
|
} | {
|
|
86
|
-
name:
|
|
87
|
+
name: any;
|
|
87
88
|
disabled: () => boolean;
|
|
88
|
-
onClick: ({ $index }: {
|
|
89
|
+
onClick: ({ $index, row }: {
|
|
89
90
|
$index: any;
|
|
91
|
+
row: any;
|
|
90
92
|
}) => void;
|
|
91
93
|
})[];
|
|
92
94
|
desc?: undefined;
|
|
@@ -96,7 +98,7 @@ export declare const useAttachment: (props: any, { data }: {
|
|
|
96
98
|
show?: undefined;
|
|
97
99
|
onClick?: undefined;
|
|
98
100
|
} | {
|
|
99
|
-
label:
|
|
101
|
+
label: any;
|
|
100
102
|
prop: string;
|
|
101
103
|
type: string;
|
|
102
104
|
required: boolean;
|
|
@@ -111,7 +113,7 @@ export declare const useAttachment: (props: any, { data }: {
|
|
|
111
113
|
width?: undefined;
|
|
112
114
|
onClick?: undefined;
|
|
113
115
|
} | {
|
|
114
|
-
label:
|
|
116
|
+
label: any;
|
|
115
117
|
prop: string;
|
|
116
118
|
type: string;
|
|
117
119
|
onClick({ row }: {
|
|
@@ -122,7 +124,7 @@ export declare const useAttachment: (props: any, { data }: {
|
|
|
122
124
|
required?: undefined;
|
|
123
125
|
show?: undefined;
|
|
124
126
|
} | {
|
|
125
|
-
label:
|
|
127
|
+
label: any;
|
|
126
128
|
prop: string;
|
|
127
129
|
type?: undefined;
|
|
128
130
|
width?: undefined;
|
|
@@ -131,7 +133,7 @@ export declare const useAttachment: (props: any, { data }: {
|
|
|
131
133
|
show?: undefined;
|
|
132
134
|
onClick?: undefined;
|
|
133
135
|
} | {
|
|
134
|
-
label:
|
|
136
|
+
label: any;
|
|
135
137
|
prop: string;
|
|
136
138
|
type: string;
|
|
137
139
|
show: () => any;
|
|
@@ -141,21 +143,22 @@ export declare const useAttachment: (props: any, { data }: {
|
|
|
141
143
|
onClick?: undefined;
|
|
142
144
|
})[] | ({
|
|
143
145
|
type: string;
|
|
144
|
-
label:
|
|
146
|
+
label: any;
|
|
145
147
|
width: string;
|
|
146
148
|
props: {
|
|
147
149
|
type: string;
|
|
148
150
|
list: ({
|
|
149
|
-
name:
|
|
151
|
+
name: any;
|
|
150
152
|
onClick: ({ row }: {
|
|
151
153
|
row: any;
|
|
152
154
|
}) => void;
|
|
153
155
|
disabled?: undefined;
|
|
154
156
|
} | {
|
|
155
|
-
name:
|
|
157
|
+
name: any;
|
|
156
158
|
disabled: () => boolean;
|
|
157
|
-
onClick: ({ $index }: {
|
|
159
|
+
onClick: ({ $index, row }: {
|
|
158
160
|
$index: any;
|
|
161
|
+
row: any;
|
|
159
162
|
}) => void;
|
|
160
163
|
})[];
|
|
161
164
|
desc?: undefined;
|
|
@@ -165,7 +168,7 @@ export declare const useAttachment: (props: any, { data }: {
|
|
|
165
168
|
show?: undefined;
|
|
166
169
|
onClick?: undefined;
|
|
167
170
|
} | {
|
|
168
|
-
label:
|
|
171
|
+
label: any;
|
|
169
172
|
prop: string;
|
|
170
173
|
type: string;
|
|
171
174
|
required: boolean;
|
|
@@ -180,7 +183,7 @@ export declare const useAttachment: (props: any, { data }: {
|
|
|
180
183
|
width?: undefined;
|
|
181
184
|
onClick?: undefined;
|
|
182
185
|
} | {
|
|
183
|
-
label:
|
|
186
|
+
label: any;
|
|
184
187
|
prop: string;
|
|
185
188
|
type: string;
|
|
186
189
|
onClick: ({ row }: {
|
|
@@ -191,7 +194,7 @@ export declare const useAttachment: (props: any, { data }: {
|
|
|
191
194
|
required?: undefined;
|
|
192
195
|
show?: undefined;
|
|
193
196
|
} | {
|
|
194
|
-
label:
|
|
197
|
+
label: any;
|
|
195
198
|
prop: string;
|
|
196
199
|
type?: undefined;
|
|
197
200
|
width?: undefined;
|
|
@@ -200,7 +203,7 @@ export declare const useAttachment: (props: any, { data }: {
|
|
|
200
203
|
show?: undefined;
|
|
201
204
|
onClick?: undefined;
|
|
202
205
|
} | {
|
|
203
|
-
label:
|
|
206
|
+
label: any;
|
|
204
207
|
prop: string;
|
|
205
208
|
type: string;
|
|
206
209
|
show: () => any;
|
|
@@ -209,4 +212,9 @@ export declare const useAttachment: (props: any, { data }: {
|
|
|
209
212
|
required?: undefined;
|
|
210
213
|
onClick?: undefined;
|
|
211
214
|
})[]>;
|
|
215
|
+
addAttachment: () => Promise<void>;
|
|
216
|
+
isNormalOpen: boolean;
|
|
217
|
+
isDialogOpen: boolean;
|
|
218
|
+
onConfirm: (resolve: any) => Promise<void>;
|
|
219
|
+
onCancel: (resolve: any) => void;
|
|
212
220
|
};
|