adtec-hnyzfc-core-package 1.5.1 → 1.5.3
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/src/api/DocumentApi.d.ts +9 -2
- package/dist/src/api/DocumentApi.js +1 -1
- package/dist/src/components/upload/AttachmentPreview.vue.d.ts +78 -0
- package/dist/src/components/upload/AttachmentPreview.vue.js +1 -0
- package/dist/src/components/upload/FileView.vue.d.ts +2 -2
- package/dist/src/components/upload/FileView.vue.js +1 -1
- package/dist/src/components/upload/FileViewComponents.vue.js +1 -1
- package/dist/src/components/upload/OfficePreview.vue.d.ts +7 -3
- package/dist/src/components/upload/OfficePreview.vue.js +2 -2
- package/dist/src/components/upload/OfficePreviewHeaderBar.vue.d.ts +5 -2
- package/dist/src/components/upload/OfficePreviewHeaderBar.vue.js +1 -1
- package/dist/src/hooks/useFileOpen.d.ts +14 -0
- package/dist/src/hooks/useFileOpen.js +1 -0
- package/dist/src/mixin/globalMixin.js +1 -1
- package/dist/src/packages/index.d.ts +2 -0
- package/dist/src/packages/index.js +1 -1
- package/dist/src/plugins/plugins.js +1 -1
- package/dist/src/plugins/renderDialog.js +1 -1
- package/dist/src/utils/fileDownload.d.ts +9 -0
- package/dist/src/utils/fileDownload.js +1 -0
- package/dist/src/utils/modules.js +2 -2
- package/dist/src/utils/officePreviewUtil.d.ts +7 -0
- package/dist/src/utils/officePreviewUtil.js +1 -1
- package/dist/styles/element-ui.css +1 -1
- package/package.json +1 -1
|
@@ -22,7 +22,14 @@ declare const _default: {
|
|
|
22
22
|
createPreviewSession(id: string): Promise<{
|
|
23
23
|
url: string;
|
|
24
24
|
}>;
|
|
25
|
-
/**
|
|
26
|
-
|
|
25
|
+
/**
|
|
26
|
+
* 通过鉴权接口下载附件,不向前端暴露存储地址。
|
|
27
|
+
* format:original(默认,原始附件)/ pdf(Office 文档导出 PDF,后端转换后同样叠加水印)。
|
|
28
|
+
* 返回后端 Content-Disposition 指定的文件名,前端据此命名可保证 .pdf 等后缀与内容一致。
|
|
29
|
+
*/
|
|
30
|
+
downloadFile(id: string, format?: string): Promise<{
|
|
31
|
+
blob: Blob;
|
|
32
|
+
fileName?: string;
|
|
33
|
+
}>;
|
|
27
34
|
};
|
|
28
35
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from"../utils/request.js";import i from"../utils/AxiosConfig.js";import"axios";import"../utils/uuid.js";import"uuid";import"../utils/encrypt.js";import"jsencrypt";import"../utils/behaviorTrack.js";import"crypto-js/enc-base64";import"crypto-js/enc-utf8";import"../utils/behaviorContext.js";import"../utils/dateTime.js";import"element-plus";import"../utils/frontendBus.js";import"../utils/globalLoading.js";import"vue";import"../utils/workflowTaskContext.js";import"../config/GlobalLoadingConfig.js";const r="/api/doc/",n=e=>{if(!e)return;const t=/filename\*=(?:UTF-8|utf-8)''([^;]+)/i.exec(e);if(t?.[1])try{return decodeURIComponent(t[1].trim())}catch{}return/filename="?([^";]+)"?/i.exec(e)?.[1]?.trim()},x={getUpLoadFilesVoById(e){return o.get(r+"getUpLoadFilesVoById/"+e)},getFileAccessAddress(e){return o.get(r+"getFileAccessAddress",{id:e})},async createRichTextImageUrl(e){const{url:t}=await this.createPreviewSession(e),s=/\/preview\/fileView\/([^/]+)\//.exec(t||"");if(!s?.[1])throw new Error("预览会话创建失败");return`${r}preview/fileView/${encodeURIComponent(s[1])}/image`},getUpLoadFilesByBussinessIds(e,t){const s=t===void 0?r+"getUpLoadFilesByBussinessIds":r+"getUpLoadFilesByBussinessIds/"+t;return o.post(s,e)},delSysUploadFile(e){return o.get(r+"delSysUploadFile/"+e)},getBusinessDocuments(e,t){return o.get(r+"getBusinessDocuments/"+e+"/"+t)},fileStatusConfirmation(e){return o.post(r+"fileStatusConfirmation",e)},delSysUploadFiles(e){return o.post(r+"delSysUploadFiles",e)},updateFilesCreateBy(e,t){return o.post(r+"updateFilesCreateBy",{ids:e,createBy:t})},createPreviewSession(e){return o.post(r+"preview/session/"+e)},async downloadFile(e,t){const s=await i({url:r+"preview/download/"+e+(t?"?format="+t:""),method:"get",responseType:"blob"});return{blob:s.data,fileName:n(s.headers?.["content-disposition"])}}};export{x as default};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/** 附件信息(刷新附件方法返回它来切换预览目标) */
|
|
2
|
+
type PreviewAttachment = {
|
|
3
|
+
id: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
type?: string;
|
|
6
|
+
};
|
|
7
|
+
type __VLS_Props = {
|
|
8
|
+
fileId?: string;
|
|
9
|
+
fileName?: string;
|
|
10
|
+
fileType?: string;
|
|
11
|
+
/** 预览标题;不传时用文件名。下载文件名始终取 fileName */
|
|
12
|
+
title?: string;
|
|
13
|
+
showHeader?: boolean;
|
|
14
|
+
showSearch?: boolean;
|
|
15
|
+
showZoom?: boolean;
|
|
16
|
+
showDownload?: boolean;
|
|
17
|
+
showRefresh?: boolean;
|
|
18
|
+
showFullscreen?: boolean;
|
|
19
|
+
/** 附件已丢失:不做预览,直接给出丢失提示(仍可下载) */
|
|
20
|
+
attachmentLost?: boolean;
|
|
21
|
+
emptyDescription?: string;
|
|
22
|
+
lostDescription?: string;
|
|
23
|
+
/** 刷新附件方法:重新取附件(可重新生成),返回新附件则切换预览目标 */
|
|
24
|
+
refreshAttachment?: () => Promise<PreviewAttachment | void>;
|
|
25
|
+
};
|
|
26
|
+
declare var __VLS_18: {};
|
|
27
|
+
type __VLS_Slots = {} & {
|
|
28
|
+
empty?: (props: typeof __VLS_18) => any;
|
|
29
|
+
};
|
|
30
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {
|
|
31
|
+
/** 重载预览(不重新取附件) */
|
|
32
|
+
reload: () => void | undefined;
|
|
33
|
+
/** 下载当前附件(format 省略时下载原始附件) */
|
|
34
|
+
download: (format?: string) => Promise<void> | undefined;
|
|
35
|
+
/** 刷新附件(等价于点击工具栏刷新) */
|
|
36
|
+
refreshAttachment: () => Promise<void>;
|
|
37
|
+
isFullscreen: globalThis.Ref<boolean, boolean>;
|
|
38
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
39
|
+
change: (attachment: PreviewAttachment) => any;
|
|
40
|
+
error: (err?: unknown) => any;
|
|
41
|
+
loaded: () => any;
|
|
42
|
+
download: (format?: string | undefined) => any;
|
|
43
|
+
refresh: () => any;
|
|
44
|
+
"update:fileId": (id: string) => any;
|
|
45
|
+
"update:fileName": (name: string) => any;
|
|
46
|
+
"update:fileType": (type: string) => any;
|
|
47
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
48
|
+
onChange?: ((attachment: PreviewAttachment) => any) | undefined;
|
|
49
|
+
onError?: ((err?: unknown) => any) | undefined;
|
|
50
|
+
onLoaded?: (() => any) | undefined;
|
|
51
|
+
onDownload?: ((format?: string | undefined) => any) | undefined;
|
|
52
|
+
onRefresh?: (() => any) | undefined;
|
|
53
|
+
"onUpdate:fileId"?: ((id: string) => any) | undefined;
|
|
54
|
+
"onUpdate:fileName"?: ((name: string) => any) | undefined;
|
|
55
|
+
"onUpdate:fileType"?: ((type: string) => any) | undefined;
|
|
56
|
+
}>, {
|
|
57
|
+
title: string;
|
|
58
|
+
fileName: string;
|
|
59
|
+
emptyDescription: string;
|
|
60
|
+
showSearch: boolean;
|
|
61
|
+
showZoom: boolean;
|
|
62
|
+
showDownload: boolean;
|
|
63
|
+
showRefresh: boolean;
|
|
64
|
+
showFullscreen: boolean;
|
|
65
|
+
fileId: string;
|
|
66
|
+
fileType: string;
|
|
67
|
+
showHeader: boolean;
|
|
68
|
+
lostDescription: string;
|
|
69
|
+
attachmentLost: boolean;
|
|
70
|
+
refreshAttachment: () => Promise<PreviewAttachment | void>;
|
|
71
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
72
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
73
|
+
export default _default;
|
|
74
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
75
|
+
new (): {
|
|
76
|
+
$slots: S;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineComponent as F,ref as s,watch as P,openBlock as c,createElementBlock as R,normalizeClass as T,unref as f,createBlock as w,withCtx as D,renderSlot as I}from"vue";import{ElEmpty as A}from"element-plus";import N from"../../utils/FrameworkUtils.js";import x from"../../hooks/usePreviewFullscreen.js";import C from"./OfficePreview.vue.js";import{_ as E}from"../../../chunks/_plugin-vue_export-helper-DlAUqK2U.js";import"xlsx-js-style";import"crypto-js/enc-base64";import"crypto-js/enc-utf8";import"../../api/DocumentApi.js";import"../../utils/request.js";import"../../utils/AxiosConfig.js";import"axios";import"../../utils/uuid.js";import"uuid";import"../../utils/encrypt.js";import"jsencrypt";import"../../utils/behaviorTrack.js";import"../../utils/behaviorContext.js";import"../../utils/dateTime.js";import"../../utils/frontendBus.js";import"../../utils/globalLoading.js";import"../../utils/workflowTaskContext.js";import"../../config/GlobalLoadingConfig.js";import"../../utils/fileDownload.js";import"../../utils/officePreviewUtil.js";import"./OfficePreviewHeaderBar.vue.js";import"@element-plus/icons-vue";const L=F({__name:"AttachmentPreview",props:{fileId:{default:""},fileName:{default:""},fileType:{default:""},title:{default:""},showHeader:{type:Boolean,default:!0},showSearch:{type:Boolean,default:!0},showZoom:{type:Boolean,default:!0},showDownload:{type:Boolean,default:!1},showRefresh:{type:Boolean,default:!1},showFullscreen:{type:Boolean,default:!1},attachmentLost:{type:Boolean,default:!1},emptyDescription:{default:"暂无附件"},lostDescription:{default:"附件已丢失或无权访问"},refreshAttachment:{type:Function,default:void 0}},emits:["loaded","error","download","refresh","change","update:fileId","update:fileName","update:fileType"],setup(t,{expose:v,emit:y}){const r=t,l=y,a=s(r.fileId||""),d=s(r.fileName||""),u=s(r.fileType||""),m=s(!1),n=s(null);P(()=>[r.fileId,r.fileName,r.fileType],([e,o,i])=>{a.value=e||"",d.value=o||"",u.value=i||""});const{previewContainerRef:g,isPreviewFullscreen:p,togglePreviewFullscreen:B}=x(),k=e=>{const o=e.id!==a.value;return a.value=e.id,d.value=e.name||"",u.value=e.type||"",l("update:fileId",e.id),l("update:fileName",e.name||""),l("update:fileType",e.type||""),l("change",e),o},h=async()=>{l("refresh");const e=r.refreshAttachment;if(e){m.value=!0;try{const o=await e();if(o?.id&&k(o))return;n.value?.reloadPreview()}catch(o){N.messageError(o)}finally{m.value=!1}}};return v({reload:()=>n.value?.reloadPreview(),download:e=>n.value?.download(e),refreshAttachment:h,isFullscreen:p}),(e,o)=>(c(),R("div",{ref_key:"previewContainerRef",ref:g,class:T(["attachment-preview",{"preview-fullscreen-fallback":f(p)}])},[a.value?(c(),w(C,{key:0,ref_key:"previewRef",ref:n,"file-id":a.value,"file-name":d.value,"file-type":u.value,title:t.title,"show-header":t.showHeader,"show-search":t.showSearch,"show-zoom":t.showZoom,"show-download":t.showDownload,"show-refresh":t.showRefresh,"show-fullscreen":t.showFullscreen,fullscreen:f(p),"refresh-loading":m.value,"attachment-lost":t.attachmentLost,"lost-description":t.lostDescription,onLoaded:o[0]||(o[0]=i=>l("loaded")),onError:o[1]||(o[1]=i=>l("error",i)),onRefresh:h,onDownload:o[2]||(o[2]=i=>l("download",i)),onToggleFullscreen:f(B)},null,8,["file-id","file-name","file-type","title","show-header","show-search","show-zoom","show-download","show-refresh","show-fullscreen","fullscreen","refresh-loading","attachment-lost","lost-description","onToggleFullscreen"])):(c(),w(f(A),{key:1,description:t.emptyDescription},{default:D(()=>[I(e.$slots,"empty",{},void 0,!0)]),_:3},8,["description"]))],2))}}),ne=E(L,[["__scopeId","data-v-8d6329ed"]]);export{ne as default};
|
|
@@ -19,9 +19,9 @@ declare const _default: import("vue").DefineComponent<globalThis.ExtractPropType
|
|
|
19
19
|
type: globalThis.PropType<any>;
|
|
20
20
|
};
|
|
21
21
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
22
|
+
"update:fileId": (...args: any[]) => void;
|
|
22
23
|
"update:title": (...args: any[]) => void;
|
|
23
24
|
"update:url": (...args: any[]) => void;
|
|
24
|
-
"update:fileId": (...args: any[]) => void;
|
|
25
25
|
"update:edit": (...args: any[]) => void;
|
|
26
26
|
"update:modelValue": (value: any) => void;
|
|
27
27
|
}, string, import("vue").PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
@@ -46,9 +46,9 @@ declare const _default: import("vue").DefineComponent<globalThis.ExtractPropType
|
|
|
46
46
|
};
|
|
47
47
|
}>> & Readonly<{
|
|
48
48
|
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
49
|
+
"onUpdate:fileId"?: ((...args: any[]) => any) | undefined;
|
|
49
50
|
"onUpdate:title"?: ((...args: any[]) => any) | undefined;
|
|
50
51
|
"onUpdate:url"?: ((...args: any[]) => any) | undefined;
|
|
51
|
-
"onUpdate:fileId"?: ((...args: any[]) => any) | undefined;
|
|
52
52
|
"onUpdate:edit"?: ((...args: any[]) => any) | undefined;
|
|
53
53
|
}>, {
|
|
54
54
|
title: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as
|
|
1
|
+
import{defineComponent as F,useModel as _,openBlock as y,createBlock as V,Teleport as h,createElementVNode as m,normalizeClass as n,unref as e,createVNode as C,createCommentVNode as P,mergeModels as p}from"vue";import{useVModel as i}from"@vueuse/core";import x from"../../hooks/usePreviewFullscreen.js";import I from"./OfficePreview.vue.js";import{_ as k}from"../../../chunks/_plugin-vue_export-helper-DlAUqK2U.js";import"element-plus";import"../../api/DocumentApi.js";import"../../utils/request.js";import"../../utils/AxiosConfig.js";import"axios";import"../../utils/uuid.js";import"uuid";import"../../utils/encrypt.js";import"jsencrypt";import"../../utils/behaviorTrack.js";import"crypto-js/enc-base64";import"crypto-js/enc-utf8";import"../../utils/behaviorContext.js";import"../../utils/dateTime.js";import"../../utils/frontendBus.js";import"../../utils/globalLoading.js";import"../../utils/workflowTaskContext.js";import"../../config/GlobalLoadingConfig.js";import"../../utils/FrameworkUtils.js";import"xlsx-js-style";import"../../utils/fileDownload.js";import"../../utils/officePreviewUtil.js";import"./OfficePreviewHeaderBar.vue.js";import"@element-plus/icons-vue";const M=F({__name:"FileView",props:p({title:{type:String,default:""},url:{type:String,default:""},fileId:{type:String,default:""},edit:{type:String,default:"view"}},{modelValue:{},modelModifiers:{}}),emits:p(["update:title","update:url","update:fileId","update:edit"],["update:modelValue"]),setup(l,{emit:c}){const s=_(l,"modelValue"),t=l,o=c,u=i(t,"title",o),a=i(t,"fileId",o),d=i(t,"url",o),{previewContainerRef:f,isPreviewFullscreen:r,togglePreviewFullscreen:w,exitPreviewFullscreen:v}=x(),g=async()=>{await v(),s.value=!1};return(S,N)=>s.value?(y(),V(h,{key:0,to:"body"},[m("div",{class:n(["file-view-overlay",{"is-preview-fullscreen":e(r)}])},[m("div",{ref_key:"previewContainerRef",ref:f,class:n(["office-preview",{"fullscreen-mode":e(r)}])},[C(I,{url:e(d),"file-id":e(a),"file-name":e(u),"show-header":"","show-download":"","show-fullscreen":"","show-close":"",fullscreen:e(r),onToggleFullscreen:e(w),onClose:g},null,8,["url","file-id","file-name","fullscreen","onToggleFullscreen"])],2)],2)])):P("v-if",!0)}}),se=k(M,[["__scopeId","data-v-ecb4067a"]]);export{se as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as
|
|
1
|
+
import{defineComponent as s,ref as m,openBlock as f,createBlock as v,createCommentVNode as d}from"vue";import c from"../../api/DocumentApi.js";import w from"../../utils/FrameworkUtils.js";import V from"../../utils/fileDownload.js";import F from"./FileView.vue.js";import{getFileSuffix as x,isPreviewableSuffix as _}from"../../utils/uploadAccept.js";import"../../utils/request.js";import"../../utils/AxiosConfig.js";import"axios";import"../../utils/uuid.js";import"uuid";import"../../utils/encrypt.js";import"jsencrypt";import"../../utils/behaviorTrack.js";import"crypto-js/enc-base64";import"crypto-js/enc-utf8";import"../../utils/behaviorContext.js";import"../../utils/dateTime.js";import"element-plus";import"../../utils/frontendBus.js";import"../../utils/globalLoading.js";import"../../utils/workflowTaskContext.js";import"../../config/GlobalLoadingConfig.js";import"xlsx-js-style";import"@vueuse/core";import"../../hooks/usePreviewFullscreen.js";import"./OfficePreview.vue.js";import"../../utils/officePreviewUtil.js";import"./OfficePreviewHeaderBar.vue.js";import"@element-plus/icons-vue";import"../../../chunks/_plugin-vue_export-helper-DlAUqK2U.js";const ee=s({__name:"FileViewComponents",setup(y,{expose:p}){const e=m(!1),l=m(""),r=m(""),u=m("view");let a=0;return p({viewFile:async i=>{const o=++a;l.value="文件预览",r.value=i,e.value=!0;try{const t=await c.getUpLoadFilesVoById(i);if(o!==a||!e.value||r.value!==i)return;const n=x(t);if(!_(n)){e.value=!1,await V(t.id,t.name);return}l.value=t.name}catch(t){if(o!==a||!e.value||r.value!==i)return;e.value=!1,w.messageError(t)}}}),(i,o)=>e.value?(f(),v(F,{key:0,modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=t=>e.value=t),title:l.value,"file-id":r.value,edit:u.value},null,8,["modelValue","title","file-id","edit"])):d("v-if",!0)}});export{ee as default};
|
|
@@ -3,6 +3,8 @@ type __VLS_Props = {
|
|
|
3
3
|
fileId?: string;
|
|
4
4
|
fileName?: string;
|
|
5
5
|
fileType?: string;
|
|
6
|
+
/** 预览标题:不传时用文件名(文件名仍用于下载命名) */
|
|
7
|
+
title?: string;
|
|
6
8
|
showHeader?: boolean;
|
|
7
9
|
showSearch?: boolean;
|
|
8
10
|
showPageNav?: boolean;
|
|
@@ -25,11 +27,12 @@ declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
25
27
|
zoomIn: () => void;
|
|
26
28
|
zoomOut: () => void;
|
|
27
29
|
resetZoom: () => void;
|
|
30
|
+
download: (format?: string) => Promise<void>;
|
|
28
31
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
29
32
|
close: () => any;
|
|
30
33
|
error: (err?: unknown) => any;
|
|
31
34
|
loaded: () => any;
|
|
32
|
-
download: () => any;
|
|
35
|
+
download: (format?: string | undefined) => any;
|
|
33
36
|
refresh: () => any;
|
|
34
37
|
"toggle-fullscreen": () => any;
|
|
35
38
|
"update:scale": (value: number) => any;
|
|
@@ -37,13 +40,15 @@ declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
37
40
|
onClose?: (() => any) | undefined;
|
|
38
41
|
onError?: ((err?: unknown) => any) | undefined;
|
|
39
42
|
onLoaded?: (() => any) | undefined;
|
|
40
|
-
onDownload?: (() => any) | undefined;
|
|
43
|
+
onDownload?: ((format?: string | undefined) => any) | undefined;
|
|
41
44
|
onRefresh?: (() => any) | undefined;
|
|
42
45
|
"onToggle-fullscreen"?: (() => any) | undefined;
|
|
43
46
|
"onUpdate:scale"?: ((value: number) => any) | undefined;
|
|
44
47
|
}>, {
|
|
48
|
+
title: string;
|
|
45
49
|
url: string;
|
|
46
50
|
showClose: boolean;
|
|
51
|
+
fileName: string;
|
|
47
52
|
fullscreen: boolean;
|
|
48
53
|
showSearch: boolean;
|
|
49
54
|
showPageNav: boolean;
|
|
@@ -54,7 +59,6 @@ declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
54
59
|
downloadLoading: boolean;
|
|
55
60
|
refreshLoading: boolean;
|
|
56
61
|
fileId: string;
|
|
57
|
-
fileName: string;
|
|
58
62
|
fileType: string;
|
|
59
63
|
showHeader: boolean;
|
|
60
64
|
lostDescription: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{defineComponent as
|
|
2
|
-
切换时淡出过渡,避免 spinner 相位/进度条状态差异造成的跳动 `),
|
|
1
|
+
import{defineComponent as Be,useModel as Me,ref as c,computed as m,watch as ee,nextTick as Ie,onMounted as Le,onBeforeUnmount as Pe,openBlock as N,createElementBlock as W,normalizeClass as Re,createBlock as A,unref as O,createCommentVNode as M,createElementVNode as I,createVNode as Oe,Transition as Te,withCtx as H,normalizeStyle as be,createTextVNode as ze,mergeModels as te}from"vue";import{ElEmpty as ke,ElButton as Ze,ElMessage as $}from"element-plus";import De from"../../api/DocumentApi.js";import Ve from"../../utils/FrameworkUtils.js";import We from"../../utils/fileDownload.js";import{resolveOfficeFileExt as Ae,canExportPdf as He,MAX_RICH_PREVIEW_ZOOM as oe,MIN_OFFICE_ZOOM as ae,clampRichPreviewZoom as re,OFFICE_ZOOM_STEP as le}from"../../utils/officePreviewUtil.js";import $e from"./OfficePreviewHeaderBar.vue.js";import{_ as qe}from"../../../chunks/_plugin-vue_export-helper-DlAUqK2U.js";import"../../utils/request.js";import"../../utils/AxiosConfig.js";import"axios";import"../../utils/uuid.js";import"uuid";import"../../utils/encrypt.js";import"jsencrypt";import"../../utils/behaviorTrack.js";import"crypto-js/enc-base64";import"crypto-js/enc-utf8";import"../../utils/behaviorContext.js";import"../../utils/dateTime.js";import"../../utils/frontendBus.js";import"../../utils/globalLoading.js";import"../../utils/workflowTaskContext.js";import"../../config/GlobalLoadingConfig.js";import"xlsx-js-style";import"@element-plus/icons-vue";const _e={class:"fileview-frame-wrap"},Ue={key:0,class:"preview-loading-overlay"},Xe=["src","title"],Qe=Be({__name:"OfficePreview",props:te({url:{default:""},fileId:{default:""},fileName:{default:""},fileType:{default:""},title:{default:""},showHeader:{type:Boolean,default:!0},showSearch:{type:Boolean,default:!0},showPageNav:{type:Boolean,default:!1},showZoom:{type:Boolean,default:!0},showDownload:{type:Boolean,default:!1},showRefresh:{type:Boolean,default:!1},showFullscreen:{type:Boolean,default:!1},showClose:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1},downloadLoading:{type:Boolean,default:!1},refreshLoading:{type:Boolean,default:!1},lostDescription:{default:"附件已丢失或无权访问"},attachmentLost:{type:Boolean,default:!1}},{scale:{default:1},scaleModifiers:{}}),emits:te(["loaded","error","download","refresh","toggle-fullscreen","close"],["update:scale"]),setup(s,{expose:ne,emit:se}){const o=s,n=Me(s,"scale"),v=se,y=c(""),x=c(null),E=c(!1),h=c(!1),L=c(""),u=c(""),S=c(-1),F=c(0),C=c(!1),d=c(!1),T=c(!1);let P=0;const ie=new Set(["pdf","doc","docx","xls","xlsx","ppt","pptx","txt","csv","html","htm","xml","json","md"]),ce=m(()=>L.value||o.lostDescription),q=m(()=>o.title||o.fileName),_=m(()=>Ae(o.fileType,o.fileName,o.url)),U=m(()=>o.showSearch&&!h.value&&ie.has(_.value)),ue=m(()=>o.showZoom&&!h.value),de=m(()=>o.showDownload&&He(_.value)),fe=m(()=>o.downloadLoading||T.value),me=m(()=>d.value&&n.value!==1),ve=m(()=>{if(!me.value)return;const t=n.value;return{position:"absolute",top:"0",left:"0",width:`${100/t}%`,height:`${100/t}%`,transform:`scale(${t})`,transformOrigin:"top left"}}),b=t=>{x.value?.contentWindow?.postMessage({source:"adtec-office-preview",type:"command",...t},"*")},z=()=>{try{return x.value?.contentWindow||null}catch{return null}},k=t=>{const e=Number(t?.total||0);F.value=e,S.value=e>0?Number(t?.index||0):-1,e===0&&u.value&&$.warning("未找到匹配内容")},he=t=>{const e=t?.adtecFileViewAdapter;if(e?.zoom)try{return e.zoom(n.value),!0}catch{}try{const a=t?.document?.documentElement;if(a){const l=Math.max(ae,Math.min(oe,n.value));return a.style.zoom=String(l),a.style.width=`${100/l}%`,a.style.height=`${100/l}%`,!0}}catch{}return!1},B=()=>{!d.value&&he(z())||b({command:"zoom",scale:n.value})},X=()=>{n.value=re(n.value+le),B()},Q=()=>{n.value=re(n.value-le),B()},j=()=>{n.value=1,B()};let i={query:"",matches:[],index:-1};const we=(t,e)=>{const a=[],l=t.body;if(!l)return a;const r=e.toLocaleLowerCase(),w=t.createTreeWalker(l,NodeFilter.SHOW_TEXT,{acceptNode:f=>{const g=f.parentElement;return!g||!f.nodeValue||!f.nodeValue.trim()||g.closest("script, style, noscript, input, textarea, #wm_div_id")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});let p=w.nextNode();for(;p;){const f=p.nodeValue?.toLocaleLowerCase()||"";let g=f.indexOf(r);for(;g!==-1;)a.push({node:p,start:g,end:g+e.length}),g=f.indexOf(r,g+Math.max(1,e.length));p=w.nextNode()}return a},pe=(t,e,a)=>{const l=t?.document;if(!l?.body)return null;(a==="first"||i.query!==e)&&(i={query:e,matches:we(l,e),index:-1});const r=i.matches.length;if(r===0)return{total:0,index:-1};a==="prev"?i.index=(i.index-1+r)%r:i.index=(i.index+1)%r;const w=i.matches[i.index];try{const p=l.createRange();p.setStart(w.node,w.start),p.setEnd(w.node,w.end);const f=t?.getSelection?.();f?.removeAllRanges(),f?.addRange(p),w.node.parentElement?.scrollIntoView({block:"center",behavior:"smooth"})}catch{}return{total:r,index:i.index}},Z=t=>{const e=u.value;if(!e)return;const a=z(),l=a?.adtecFileViewAdapter;if(l?.search)try{const r=l.search(e,t);r&&typeof r.then=="function"?r.then(k):k(r);return}catch{}if(!d.value){const r=pe(a,e,t);if(r){k(r);return}}b({command:"search",query:e,direction:t})},ge=()=>{i={query:"",matches:[],index:-1};const t=z(),e=t?.adtecFileViewAdapter;if(e?.clearSearch)try{e.clearSearch();return}catch{}if(!d.value)try{t?.getSelection?.()?.removeAllRanges()}catch{}b({command:"clear-search"})},ye=t=>{const e=t.trim();if(u.value=e,S.value=-1,F.value=0,!e){J();return}if(d.value){$.warning("当前预览服务不支持内容搜索,请下载后查看");return}Z("first")},J=()=>{u.value="",S.value=-1,F.value=0,ge()},xe=()=>{u.value&&Z("prev")},Ee=()=>{u.value&&Z("next")},G=t=>{if(!(t.source!==x.value?.contentWindow||t.data?.source!=="adtec-fileview")){if(t.data.type==="ready"){C.value=!0,d.value=!1,B();return}if(t.data.type==="search-result"){const e=Number(t.data.total||0);F.value=e,S.value=e>0?Number(t.data.index||0):-1,e===0&&u.value&&$.warning("未找到匹配内容")}}},R=new Set,Se=()=>{const t=x.value;if(!t)return null;try{const e=t.contentWindow;if(e?.parent&&e.parent!==e)return e.parent}catch{}return null},D=()=>{[window,Se()].forEach(e=>{if(!(!e||R.has(e)))try{e.addEventListener("message",G),R.add(e)}catch{}})},Fe=()=>{R.forEach(t=>{try{t.removeEventListener("message",G)}catch{}}),R.clear()},K=async()=>{const t=++P;if(y.value="",E.value=!1,h.value=!1,L.value="",n.value=1,u.value="",S.value=-1,F.value=0,C.value=!1,d.value=!1,o.attachmentLost){h.value=!0,v("error");return}E.value=!0;try{if(o.fileId){const e=await De.createPreviewSession(o.fileId);if(t!==P)return;y.value=e.url;return}if(o.url.startsWith("/api/doc/preview/fileView/")){y.value=o.url;return}throw new Error("为保护附件地址,旧版文件直链已停止预览,请使用附件 ID 打开")}catch(e){if(t!==P)return;E.value=!1,h.value=!0,L.value=e?.msg||e?.message||"文件预览失败,请下载后查看",v("error",e)}},Y=()=>{v("refresh"),K()},V=async(t="original")=>{if(v("download",t),!!o.fileId){T.value=!0;try{await We(o.fileId,o.fileName,t)}catch(e){Ve.messageError(e)}finally{T.value=!1}}},Ce=()=>{E.value=!1,D();const t=x.value?.contentWindow;if(t&&!C.value)try{t.adtecPreviewBridge&&(C.value=!0,d.value=!1)}catch{}C.value||window.setTimeout(()=>{C.value||(d.value=!0)},1500),B(),v("loaded")},Ne=t=>{E.value=!1,h.value=!0,L.value="文件预览服务暂不可用,请稍后重试或下载后查看",v("error",t)};return ee(()=>[o.fileId,o.url,o.attachmentLost],()=>void K(),{immediate:!0}),ee(y,t=>{t&&Ie(()=>D())}),Le(()=>D()),Pe(()=>{P++,Fe()}),ne({reloadPreview:Y,zoomIn:X,zoomOut:Q,resetZoom:j,download:V}),(t,e)=>(N(),W("div",{class:Re(["office-preview-root",{"is-fullscreen":s.fullscreen}])},[s.showHeader?(N(),A($e,{key:0,title:q.value,"title-only":!U.value,zoom:n.value,"search-query":u.value,"search-index":S.value,"search-total":F.value,"show-search":U.value,"show-page-nav":!1,"show-zoom":ue.value,"show-download":s.showDownload,"pdf-export":de.value,"show-refresh":s.showRefresh,"show-fullscreen":s.showFullscreen,"show-close":s.showClose,fullscreen:s.fullscreen,"download-loading":fe.value,"refresh-loading":s.refreshLoading,"min-zoom":O(ae),"max-zoom":O(oe),onZoomIn:X,onZoomOut:Q,onZoomReset:j,onSearch:ye,onSearchClear:J,onSearchPrev:xe,onSearchNext:Ee,onDownload:V,onRefresh:Y,onToggleFullscreen:e[0]||(e[0]=a=>v("toggle-fullscreen")),onClose:e[1]||(e[1]=a=>v("close"))},null,8,["title","title-only","zoom","search-query","search-index","search-total","show-search","show-zoom","show-download","pdf-export","show-refresh","show-fullscreen","show-close","fullscreen","download-loading","refresh-loading","min-zoom","max-zoom"])):M("v-if",!0),M(` 外层加载层与预览页内层样式完全一致(spinner + 正在加载文件... + 进度条),
|
|
2
|
+
切换时淡出过渡,避免 spinner 相位/进度条状态差异造成的跳动 `),I("div",_e,[Oe(Te,{name:"preview-loading-fade"},{default:H(()=>[E.value?(N(),W("div",Ue,[...e[3]||(e[3]=[I("div",{class:"preview-loading-spinner"},null,-1),I("div",{class:"preview-loading-text"},"正在加载文件...",-1),I("div",{class:"preview-loading-progress"},[I("div",{class:"preview-loading-bar is-indeterminate"})],-1)])])):M("v-if",!0)]),_:1}),y.value&&!h.value?(N(),W("iframe",{key:y.value,ref_key:"previewFrameRef",ref:x,class:"fileview-frame",style:be(ve.value),src:y.value,title:q.value||"文件预览",referrerpolicy:"same-origin",onLoad:Ce,onError:Ne},null,44,Xe)):h.value?(N(),A(O(ke),{key:1,description:ce.value},{default:H(()=>[s.showDownload?(N(),A(O(Ze),{key:0,type:"primary",onClick:e[2]||(e[2]=a=>V())},{default:H(()=>[...e[4]||(e[4]=[ze(" 下载文件 ",-1)])]),_:1})):M("v-if",!0)]),_:1},8,["description"])):M("v-if",!0)])],2))}}),Et=qe(Qe,[["__scopeId","data-v-e2b19417"]]);export{Et as default};
|
|
@@ -11,6 +11,8 @@ type __VLS_Props = {
|
|
|
11
11
|
showPageNav?: boolean;
|
|
12
12
|
showZoom?: boolean;
|
|
13
13
|
showDownload?: boolean;
|
|
14
|
+
/** 是否提供“下载原始文件 / 下载 PDF”的下载菜单(Office 类附件) */
|
|
15
|
+
pdfExport?: boolean;
|
|
14
16
|
showRefresh?: boolean;
|
|
15
17
|
showFullscreen?: boolean;
|
|
16
18
|
showClose?: boolean;
|
|
@@ -26,7 +28,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
26
28
|
"zoom-in": () => any;
|
|
27
29
|
"zoom-out": () => any;
|
|
28
30
|
"zoom-reset": () => any;
|
|
29
|
-
download: () => any;
|
|
31
|
+
download: (format: string) => any;
|
|
30
32
|
refresh: () => any;
|
|
31
33
|
"toggle-fullscreen": () => any;
|
|
32
34
|
"page-prev": () => any;
|
|
@@ -40,7 +42,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
40
42
|
"onZoom-in"?: (() => any) | undefined;
|
|
41
43
|
"onZoom-out"?: (() => any) | undefined;
|
|
42
44
|
"onZoom-reset"?: (() => any) | undefined;
|
|
43
|
-
onDownload?: (() => any) | undefined;
|
|
45
|
+
onDownload?: ((format: string) => any) | undefined;
|
|
44
46
|
onRefresh?: (() => any) | undefined;
|
|
45
47
|
"onToggle-fullscreen"?: (() => any) | undefined;
|
|
46
48
|
"onPage-prev"?: (() => any) | undefined;
|
|
@@ -63,6 +65,7 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
63
65
|
showPageNav: boolean;
|
|
64
66
|
showZoom: boolean;
|
|
65
67
|
showDownload: boolean;
|
|
68
|
+
pdfExport: boolean;
|
|
66
69
|
showRefresh: boolean;
|
|
67
70
|
showFullscreen: boolean;
|
|
68
71
|
downloadLoading: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as
|
|
1
|
+
import{defineComponent as D,ref as F,computed as p,watch as I,resolveComponent as y,openBlock as a,createElementBlock as r,normalizeClass as N,toDisplayString as c,createCommentVNode as u,createVNode as l,unref as o,withCtx as n,createElementVNode as f,Fragment as C,createBlock as b,createTextVNode as B}from"vue";import{ArrowUp as T,ArrowDown as V,ArrowLeft as E,ArrowRight as R,ZoomOut as S,ZoomIn as A,RefreshRight as M,Loading as w,Download as x,Refresh as Q,Close as P,FullScreen as H}from"@element-plus/icons-vue";import{ElIcon as s}from"element-plus";import{MAX_PDF_ZOOM as U,MIN_OFFICE_ZOOM as X}from"../../utils/officePreviewUtil.js";import{_ as j}from"../../../chunks/_plugin-vue_export-helper-DlAUqK2U.js";const q=["title"],G={key:1,class:"header-search"},J={key:0,class:"search-count"},K={class:"header-actions"},W=["disabled"],Y={class:"page-label"},_=["disabled"],ee=["disabled"],te={class:"zoom-label"},oe=["disabled"],le=["disabled"],ae=["disabled"],ne=["disabled"],de=["title"],se=D({__name:"OfficePreviewHeaderBar",props:{title:{default:""},titleOnly:{type:Boolean,default:!1},zoom:{default:1},currentPage:{default:1},totalPages:{default:0},searchQuery:{default:""},searchIndex:{default:-1},searchTotal:{default:0},showSearch:{type:Boolean,default:!0},showPageNav:{type:Boolean,default:!0},showZoom:{type:Boolean,default:!0},showDownload:{type:Boolean,default:!1},pdfExport:{type:Boolean,default:!1},showRefresh:{type:Boolean,default:!1},showFullscreen:{type:Boolean,default:!1},showClose:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1},downloadLoading:{type:Boolean,default:!1},refreshLoading:{type:Boolean,default:!1},minZoom:{default:X},maxZoom:{default:U}},emits:["zoom-in","zoom-out","zoom-reset","download","refresh","toggle-fullscreen","close","page-prev","page-next","search","search-clear","search-prev","search-next"],setup(e,{emit:z}){const v=e,i=z,m=F(v.searchQuery),$=p(()=>Math.round(v.zoom*100));I(()=>v.searchQuery,g=>{m.value=g});const h=()=>{i("search",m.value.trim())};return(g,t)=>{const L=y("el-search-input"),k=y("el-dropdown-item"),O=y("el-dropdown-menu"),Z=y("el-dropdown");return a(),r("div",{class:N(["office-preview-header",{"is-title-only":e.titleOnly}])},[e.title?(a(),r("div",{key:0,class:"header-title",title:e.title},c(e.title),9,q)):u("v-if",!0),e.showSearch?(a(),r("div",G,[l(L,{modelValue:m.value,"onUpdate:modelValue":t[0]||(t[0]=d=>m.value=d),class:"search-input",clearable:"",placeholder:"搜索文档内容",panel:!1,"action-tip":"查找",onSearch:h,onChange:h,onClear:t[1]||(t[1]=d=>i("search-clear"))},null,8,["modelValue"]),e.searchTotal>0?(a(),r("span",J,c(e.searchIndex+1)+"/"+c(e.searchTotal),1)):u("v-if",!0),e.searchTotal>0?(a(),r("button",{key:1,class:"toolbar-btn",type:"button",title:"上一处",onClick:t[2]||(t[2]=d=>i("search-prev"))},[l(o(s),null,{default:n(()=>[l(o(T))]),_:1})])):u("v-if",!0),e.searchTotal>0?(a(),r("button",{key:2,class:"toolbar-btn",type:"button",title:"下一处",onClick:t[3]||(t[3]=d=>i("search-next"))},[l(o(s),null,{default:n(()=>[l(o(V))]),_:1})])):u("v-if",!0)])):u("v-if",!0),f("div",K,[e.showPageNav&&e.totalPages>0?(a(),r(C,{key:0},[f("button",{class:"toolbar-btn",type:"button",title:"上一页",disabled:e.currentPage<=1,onClick:t[4]||(t[4]=d=>i("page-prev"))},[l(o(s),null,{default:n(()=>[l(o(E))]),_:1})],8,W),f("span",Y,c(e.currentPage)+" / "+c(e.totalPages),1),f("button",{class:"toolbar-btn",type:"button",title:"下一页",disabled:e.currentPage>=e.totalPages,onClick:t[5]||(t[5]=d=>i("page-next"))},[l(o(s),null,{default:n(()=>[l(o(R))]),_:1})],8,_),t[14]||(t[14]=f("span",{class:"toolbar-divider"},null,-1))],64)):u("v-if",!0),e.showZoom?(a(),r(C,{key:1},[f("button",{class:"toolbar-btn",type:"button",title:"缩小",disabled:e.zoom<=e.minZoom,onClick:t[6]||(t[6]=d=>i("zoom-out"))},[l(o(s),null,{default:n(()=>[l(o(S))]),_:1})],8,ee),f("span",te,c($.value)+"%",1),f("button",{class:"toolbar-btn",type:"button",title:"放大",disabled:e.zoom>=e.maxZoom,onClick:t[7]||(t[7]=d=>i("zoom-in"))},[l(o(s),null,{default:n(()=>[l(o(A))]),_:1})],8,oe),f("button",{class:"toolbar-btn",type:"button",title:"重置缩放",onClick:t[8]||(t[8]=d=>i("zoom-reset"))},[l(o(s),null,{default:n(()=>[l(o(M))]),_:1})]),t[15]||(t[15]=f("span",{class:"toolbar-divider"},null,-1))],64)):u("v-if",!0),e.showDownload&&e.pdfExport?(a(),b(Z,{key:2,trigger:"click",disabled:e.downloadLoading,onCommand:t[9]||(t[9]=d=>i("download",d))},{dropdown:n(()=>[l(O,null,{default:n(()=>[l(k,{command:"original"},{default:n(()=>[...t[16]||(t[16]=[B("下载原始文件",-1)])]),_:1}),l(k,{command:"pdf"},{default:n(()=>[...t[17]||(t[17]=[B("下载 PDF",-1)])]),_:1})]),_:1})]),default:n(()=>[f("button",{class:"toolbar-btn",type:"button",title:"下载",disabled:e.downloadLoading},[e.downloadLoading?(a(),b(o(s),{key:0,class:"is-loading"},{default:n(()=>[l(o(w))]),_:1})):(a(),b(o(s),{key:1},{default:n(()=>[l(o(x))]),_:1}))],8,le)]),_:1},8,["disabled"])):e.showDownload?(a(),r("button",{key:3,class:"toolbar-btn",type:"button",title:"下载",disabled:e.downloadLoading,onClick:t[10]||(t[10]=d=>i("download","original"))},[e.downloadLoading?(a(),b(o(s),{key:0,class:"is-loading"},{default:n(()=>[l(o(w))]),_:1})):(a(),b(o(s),{key:1},{default:n(()=>[l(o(x))]),_:1}))],8,ae)):u("v-if",!0),e.showRefresh?(a(),r("button",{key:4,class:"toolbar-btn",type:"button",title:"刷新附件",disabled:e.refreshLoading,onClick:t[11]||(t[11]=d=>i("refresh"))},[e.refreshLoading?(a(),b(o(s),{key:0,class:"is-loading"},{default:n(()=>[l(o(w))]),_:1})):(a(),b(o(s),{key:1},{default:n(()=>[l(o(Q))]),_:1}))],8,ne)):u("v-if",!0),e.showFullscreen?(a(),r("button",{key:5,class:"toolbar-btn",type:"button",title:e.fullscreen?"退出全屏":"全屏",onClick:t[12]||(t[12]=d=>i("toggle-fullscreen"))},[l(o(s),null,{default:n(()=>[e.fullscreen?(a(),b(o(P),{key:0})):(a(),b(o(H),{key:1}))]),_:1})],8,de)):u("v-if",!0),e.showClose?(a(),r("button",{key:6,class:"toolbar-btn toolbar-btn--close",type:"button",title:"关闭",onClick:t[13]||(t[13]=d=>i("close"))},[l(o(s),null,{default:n(()=>[l(o(P))]),_:1})])):u("v-if",!0)])],2)}}}),ce=j(se,[["__scopeId","data-v-befd4ab6"]]);export{ce as default};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** 附件最小信息:id 必填,name/type 用于判断可预览性与下载命名 */
|
|
2
|
+
export interface FileOpenTarget {
|
|
3
|
+
id?: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
type?: string;
|
|
6
|
+
}
|
|
7
|
+
/** 取后缀:优先文件名,其次附件类型(忽略 MIME 形式) */
|
|
8
|
+
export declare const resolveFileSuffix: (file?: FileOpenTarget) => string;
|
|
9
|
+
export default function useFileOpen(): {
|
|
10
|
+
openFile: (file?: FileOpenTarget) => Promise<void>;
|
|
11
|
+
downloadFile: (file?: FileOpenTarget) => Promise<void>;
|
|
12
|
+
isPreviewable: (file?: FileOpenTarget) => boolean;
|
|
13
|
+
resolveFileSuffix: (file?: FileOpenTarget) => string;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import p from"./useFileView.js";import n from"../utils/FrameworkUtils.js";import s from"../utils/fileDownload.js";import{isPreviewableSuffix as a}from"../utils/uploadAccept.js";import"../utils/frontendBus.js";import"element-plus";import"xlsx-js-style";import"crypto-js/enc-base64";import"crypto-js/enc-utf8";import"../api/DocumentApi.js";import"../utils/request.js";import"../utils/AxiosConfig.js";import"axios";import"../utils/uuid.js";import"uuid";import"../utils/encrypt.js";import"jsencrypt";import"../utils/behaviorTrack.js";import"../utils/behaviorContext.js";import"../utils/dateTime.js";import"../utils/globalLoading.js";import"vue";import"../utils/workflowTaskContext.js";import"../config/GlobalLoadingConfig.js";const m=t=>{const o=(t?.name||"").split(".").pop()||"";if(o&&o!==t?.name)return o.toLowerCase();const i=(t?.type||"").replace(/^\./,"").toLowerCase();return i.includes("/")?"":i};function U(){const{fileView:t}=p(),o=r=>{const e=m(r);return!e||a(e)},i=async r=>{if(r?.id)try{await s(r.id,r.name)}catch(e){n.messageError(e)}};return{openFile:async r=>{if(r?.id){if(o(r)){t(r.id);return}await i(r)}},downloadFile:i,isPreviewable:o,resolveFileSuffix:m}}export{U as default,m as resolveFileSuffix};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as p}from"../../chunks/operationAuth.vue_vue_type_script_lang-BgqMGXbQ.js";import{_ as e}from"../../chunks/ElFlex.vue_vue_type_script_setup_true_lang-DYk3SQcE.js";import{_ as a}from"../../chunks/ElDescForm.vue_vue_type_style_index_0_lang-BU3FMUMx.js";import s from"../components/ElContentPanel/ElContentPanel.vue.js";import n from"../components/ElSplitPanel/ElSplitPanel.vue.js";import _ from"../components/ElCardSection/ElCardSection.vue.js";import f from"../components/ElDialogBody/ElDialogBody.vue.js";import
|
|
1
|
+
import{_ as p}from"../../chunks/operationAuth.vue_vue_type_script_lang-BgqMGXbQ.js";import{_ as e}from"../../chunks/ElFlex.vue_vue_type_script_setup_true_lang-DYk3SQcE.js";import{_ as a}from"../../chunks/ElDescForm.vue_vue_type_style_index_0_lang-BU3FMUMx.js";import s from"../components/ElContentPanel/ElContentPanel.vue.js";import n from"../components/ElSplitPanel/ElSplitPanel.vue.js";import _ from"../components/ElCardSection/ElCardSection.vue.js";import f from"../components/upload/AttachmentPreview.vue.js";import l from"../components/ElDialogBody/ElDialogBody.vue.js";import c from"../components/ElGrid/ElGrid.vue.js";import h from"../components/Search/ElSearch.vue.js";import u from"../components/Title/ElTitle.vue.js";import d from"../components/icon/ElIcons.vue.js";import E from"../components/icon/ElIconBtn.vue.js";import $ from"../components/Search/ElIconSearch.vue.js";import v from"../components/Search/ElSearchInput.vue.js";import{_ as I}from"../../chunks/ElCopyTooltip.vue_vue_type_script_setup_true_lang-Qg1P3If6.js";/* empty css */import{reportPageLeave as i,setCurrentMenu as m,reportPageActivate as b,reportFeatureOpen as g}from"../utils/behaviorTrack.js";import{_ as P}from"../../chunks/userSelect.vue_vue_type_script_setup_true_lang-DlEso2ua.js";import{_ as A}from"../../chunks/comp.selectUser.vue_vue_type_script_setup_true_lang-BQDO393q.js";import{_ as M}from"../../chunks/DictDisplay.vue_vue_type_script_setup_true_lang-DiFlFWi1.js";import{_ as D}from"../../chunks/ElScrollbars.vue_vue_type_script_setup_true_lang-0Vhrxdyr.js";import{_ as L}from"../../chunks/ElTotalTools.vue_vue_type_script_setup_true_lang-BqRnIFkw.js";import T from"../components/ElCardList.vue.js";import C from"../components/kFrame/KFrame.vue.js";import{_ as S}from"../../chunks/ElPagePagination.vue_vue_type_style_index_0_lang-CGjSyYgn.js";import{_ as y}from"../../chunks/ElCellLink.vue_vue_type_script_setup_true_lang-DXGj9pCT.js";import{_ as O}from"../../chunks/ElTagDisplay.vue_vue_type_script_setup_true_lang-DQXuYsW_.js";import{_ as F}from"../../chunks/DragHandleIcon.vue_vue_type_script_setup_true_lang-DnMWn5jY.js";import N from"../components/ElCircleBadge/ElCircleBadge.vue.js";import U from"../components/AsideCardList/AsideCardList.vue.js";import{_ as x}from"../../chunks/ElNumericInput.vue_vue_type_script_setup_true_lang-C6KlCE6f.js";import B from"../components/ElIndicatorInput/ElIndicatorInput.vue.js";import K from"../components/ElTabsPanel/ElTabsPanel.vue.js";import"vue";import"../hooks/useBehaviorAction.js";import"../utils/behaviorContext.js";import"../utils/uuid.js";import"uuid";import"axios";import"crypto-js/enc-base64";import"crypto-js/enc-utf8";import"../utils/encrypt.js";import"jsencrypt";import"../utils/dateTime.js";import"../hooks/useOperationAuth.js";import"vue-router";import"../stores/permissionStore.js";import"pinia";import"../utils/frontendBus.js";import"../utils/operationAuth.js";import"../stores/userInfoStore.js";import"../utils/userSessionStorage.js";import"../interface/enum/FlexEnum.js";import"@vueuse/core";import"../../chunks/_plugin-vue_export-helper-DlAUqK2U.js";import"element-plus";import"../utils/FrameworkUtils.js";import"xlsx-js-style";import"../hooks/usePreviewFullscreen.js";import"../components/upload/OfficePreview.vue.js";import"../api/DocumentApi.js";import"../utils/request.js";import"../utils/AxiosConfig.js";import"../utils/globalLoading.js";import"../utils/workflowTaskContext.js";import"../config/GlobalLoadingConfig.js";import"../utils/fileDownload.js";import"../utils/officePreviewUtil.js";import"../components/upload/OfficePreviewHeaderBar.vue.js";import"@element-plus/icons-vue";import"../components/ElGrid/ElGridColumnSetting.vue.js";import"../utils/columnSettingStorage.js";import"../components/business/userSelectContent.vue.js";import"../api/BasicApi.js";import"../api/SysUserApi.js";import"../api/EmployeeInfoApi.js";import"../components/business/comp.userForm.vue.js";import"../api/DeptInfoApi.js";import"../hooks/useResetRefHooks.js";import"../config/vxeSelectColumn.js";import"../hooks/useDictHooks.js";import"../api/SysDictCacheApi.js";import"../stores/dictStore.js";import"@vueuse/components";import"../components/kFrame/IframeOptions.js";import"../components/RichTextEditor/RichTextEditor.vue.js";import"../../chunks/preload-helper-BlTxHScW.js";import"../components/RichTextEditor/richTextHtmlUtils.js";import"../components/RichTextEditor/installUmoEditorApp.js";import"tdesign-vue-next";import"../components/RichTextEditor/richTextImageUpload.js";import"../utils/buildUploadHeaders.js";import"../components/ElIndicatorInput/interface.js";const Mr={mounted(){const t=this.$route,r=t?.meta?.sysMenuData;r?.id&&m(r);const o=this.$options?.__name||this.$options?.name;this.$options?.__isPageWrapper||this.$parent?.$options?.__isPageWrapper&&r?.id&&o&&o===t?.name&&(g(r,t.fullPath),this.__behaviorMenuId=r.id,this.__behaviorActivatedOnce=!1,this.__behaviorLeft=!1)},activated(){const t=this.$route?.meta?.sysMenuData;t?.id&&m(t);const r=this.__behaviorMenuId;if(r){if(!this.__behaviorActivatedOnce){this.__behaviorActivatedOnce=!0;return}b(r),this.__behaviorLeft=!1}},deactivated(){const t=this.__behaviorMenuId;t&&(i(t,"KEEP_ALIVE_DEACTIVATE"),this.__behaviorLeft=!0)},beforeUnmount(){const t=this.__behaviorMenuId;t&&i(t,"UNMOUNT",!0,!this.__behaviorLeft)},components:{operationAuth:p,ElFlex:e,ElDescForm:a,ElContentPanel:s,ElSplitPanel:n,ElCardSection:_,AttachmentPreview:f,ElDialogBody:l,ElGrid:c,ElSearch:h,ElTitle:u,ElIcons:d,ElIconBtn:E,ElIconSearch:$,ElSearchInput:v,ElTooltip:I,userSelect:P,mdmUserSelect:A,ElScrollbars:D,ElTotalTools:L,ElCardList:T,KFrame:C,ElPagePagination:S,ElCellLink:y,ElTagDisplay:O,DictDisplay:M,DragHandleIcon:F,ElCircleBadge:N,AsideCardList:U,ElNumericInput:x,ElIndicatorInput:B,ElTabsPanel:K}};export{Mr as globalMixin};
|
|
@@ -781,6 +781,8 @@ export { INDICATOR_RANGE_TYPE } from '../components/ElIndicatorInput/interface';
|
|
|
781
781
|
export { evaluateComputedIndicators, evaluateIndicatorFormula, formatIndicatorFormulaResult, formatIndicatorRangeValue, isComputedIndicator, isIndicatorReadonly, parseIndicatorTags, parseIndicatorRangeValue, validateIndicatorValue, } from '../components/ElIndicatorInput/interface';
|
|
782
782
|
export { useDescForm } from '../hooks/useDescForm';
|
|
783
783
|
export { default as useOperationAuth } from '../hooks/useOperationAuth';
|
|
784
|
+
export { default as useFileOpen } from '../hooks/useFileOpen';
|
|
785
|
+
export type { FileOpenTarget } from '../hooks/useFileOpen';
|
|
784
786
|
export { matchOperation, resolveOperationList, resolveOperationMenu, } from '../utils/operationAuth';
|
|
785
787
|
export type { IOperationAuthContext } from '../utils/operationAuth';
|
|
786
788
|
export { DATE_FORMAT, DATE_TIME_FORMAT, DATE_TIME_MILLISECONDS_FORMAT, formatDateTime, } from '../utils/dateTime';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../config/ElementPlusConfig.js";import{_ as o}from"../../chunks/ElFlex.vue_vue_type_script_setup_true_lang-DYk3SQcE.js";import{_ as r}from"../../chunks/ElDescForm.vue_vue_type_style_index_0_lang-BU3FMUMx.js";import t from"../components/icon/ElIcons.vue.js";import m from"../components/icon/ElIconBtn.vue.js";import{_ as i}from"../../chunks/operationAuth.vue_vue_type_script_lang-BgqMGXbQ.js";import p from"../components/Search/ElSearch.vue.js";import a from"../components/Search/ElIconSearch.vue.js";import e from"../components/Search/ElSearchInput.vue.js";import{_ as l}from"../../chunks/ElCellLink.vue_vue_type_script_setup_true_lang-DXGj9pCT.js";import{_ as n}from"../../chunks/ElTagDisplay.vue_vue_type_script_setup_true_lang-DQXuYsW_.js";import s from"../components/ElCircleBadge/ElCircleBadge.vue.js";import{_ as f}from"../../chunks/ElNumericInput.vue_vue_type_script_setup_true_lang-C6KlCE6f.js";import c from"../components/ElIndicatorInput/ElIndicatorInput.vue.js";import
|
|
1
|
+
import"../config/ElementPlusConfig.js";import{_ as o}from"../../chunks/ElFlex.vue_vue_type_script_setup_true_lang-DYk3SQcE.js";import{_ as r}from"../../chunks/ElDescForm.vue_vue_type_style_index_0_lang-BU3FMUMx.js";import t from"../components/icon/ElIcons.vue.js";import m from"../components/icon/ElIconBtn.vue.js";import{_ as i}from"../../chunks/operationAuth.vue_vue_type_script_lang-BgqMGXbQ.js";import p from"../components/Search/ElSearch.vue.js";import a from"../components/Search/ElIconSearch.vue.js";import e from"../components/Search/ElSearchInput.vue.js";import{_ as l}from"../../chunks/ElCellLink.vue_vue_type_script_setup_true_lang-DXGj9pCT.js";import{_ as n}from"../../chunks/ElTagDisplay.vue_vue_type_script_setup_true_lang-DQXuYsW_.js";import s from"../components/ElCircleBadge/ElCircleBadge.vue.js";import{_ as f}from"../../chunks/ElNumericInput.vue_vue_type_script_setup_true_lang-C6KlCE6f.js";import c from"../components/ElIndicatorInput/ElIndicatorInput.vue.js";import u from"../components/ElTabsPanel/ElTabsPanel.vue.js";import{INDICATOR_RANGE_TYPE as Ao,evaluateComputedIndicators as Fo,evaluateIndicatorFormula as xo,formatIndicatorFormulaResult as Ro,formatIndicatorRangeValue as go,isComputedIndicator as Co,isIndicatorReadonly as Mo,parseIndicatorRangeValue as ho,parseIndicatorTags as vo,validateIndicatorValue as No}from"../components/ElIndicatorInput/interface.js";import{useDescForm as $o}from"../hooks/useDescForm.js";import{default as Po}from"../hooks/useOperationAuth.js";import{default as Vo}from"../hooks/useFileOpen.js";import{matchOperation as bo,resolveOperationList as ko,resolveOperationMenu as Go}from"../utils/operationAuth.js";import{DATE_FORMAT as jo,DATE_TIME_FORMAT as qo,DATE_TIME_MILLISECONDS_FORMAT as wo,formatDateTime as zo}from"../utils/dateTime.js";import _ from"element-plus";import"../utils/patchWujiePopperCoordinates.js";import"vue";import"../interface/enum/FlexEnum.js";import"@vueuse/core";import"../../chunks/_plugin-vue_export-helper-DlAUqK2U.js";import"../hooks/useBehaviorAction.js";import"../utils/behaviorTrack.js";import"axios";import"crypto-js/enc-base64";import"crypto-js/enc-utf8";import"../utils/uuid.js";import"uuid";import"../utils/behaviorContext.js";import"../utils/encrypt.js";import"jsencrypt";import"vue-router";import"@element-plus/icons-vue";import"../utils/frontendBus.js";import"../components/RichTextEditor/RichTextEditor.vue.js";import"../../chunks/preload-helper-BlTxHScW.js";import"../components/RichTextEditor/richTextHtmlUtils.js";import"../components/RichTextEditor/installUmoEditorApp.js";import"tdesign-vue-next";import"../components/RichTextEditor/richTextImageUpload.js";import"../api/DocumentApi.js";import"../utils/request.js";import"../utils/AxiosConfig.js";import"../utils/globalLoading.js";import"../utils/workflowTaskContext.js";import"../config/GlobalLoadingConfig.js";import"../utils/buildUploadHeaders.js";import"../stores/permissionStore.js";import"pinia";import"../stores/userInfoStore.js";import"../utils/userSessionStorage.js";import"../hooks/useFileView.js";import"../utils/FrameworkUtils.js";import"xlsx-js-style";import"../utils/fileDownload.js";import"../utils/uploadAccept.js";const To={ElFlex:o,ElDescForm:r,ElIcons:t,ElIconBtn:m,OperationAuth:i,ElSearch:p,ElIconSearch:a,ElSearchInput:e,ElCellLink:l,ElTagDisplay:n,ElCircleBadge:s,ElNumericInput:f,ElIndicatorInput:c,ElTabsPanel:u,elementPlusConfig:_};export{jo as DATE_FORMAT,qo as DATE_TIME_FORMAT,wo as DATE_TIME_MILLISECONDS_FORMAT,s as ElCircleBadge,r as ElDescForm,c as ElIndicatorInput,f as ElNumericInput,e as ElSearchInput,u as ElTabsPanel,n as ElTagDisplay,Ao as INDICATOR_RANGE_TYPE,To as default,Fo as evaluateComputedIndicators,xo as evaluateIndicatorFormula,zo as formatDateTime,Ro as formatIndicatorFormulaResult,go as formatIndicatorRangeValue,Co as isComputedIndicator,Mo as isIndicatorReadonly,bo as matchOperation,ho as parseIndicatorRangeValue,vo as parseIndicatorTags,ko as resolveOperationList,Go as resolveOperationMenu,$o as useDescForm,Vo as useFileOpen,Po as useOperationAuth,No as validateIndicatorValue};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{globalMixin as o}from"../mixin/globalMixin.js";import"../../chunks/operationAuth.vue_vue_type_script_lang-BgqMGXbQ.js";import"vue";import"../hooks/useBehaviorAction.js";import"../utils/behaviorTrack.js";import"axios";import"crypto-js/enc-base64";import"crypto-js/enc-utf8";import"../utils/uuid.js";import"uuid";import"../utils/behaviorContext.js";import"../utils/encrypt.js";import"jsencrypt";import"../utils/dateTime.js";import"../hooks/useOperationAuth.js";import"vue-router";import"../stores/permissionStore.js";import"pinia";import"../utils/frontendBus.js";import"../utils/operationAuth.js";import"../stores/userInfoStore.js";import"../utils/userSessionStorage.js";import"../../chunks/ElFlex.vue_vue_type_script_setup_true_lang-DYk3SQcE.js";import"../interface/enum/FlexEnum.js";import"@vueuse/core";import"../components/icon/ElIcons.vue.js";import"../../chunks/_plugin-vue_export-helper-DlAUqK2U.js";import"../../chunks/ElDescForm.vue_vue_type_style_index_0_lang-BU3FMUMx.js";import"../components/ElContentPanel/ElContentPanel.vue.js";import"../components/ElSplitPanel/ElSplitPanel.vue.js";import"../components/ElCardSection/ElCardSection.vue.js";import"../components/
|
|
1
|
+
import{globalMixin as o}from"../mixin/globalMixin.js";import"../../chunks/operationAuth.vue_vue_type_script_lang-BgqMGXbQ.js";import"vue";import"../hooks/useBehaviorAction.js";import"../utils/behaviorTrack.js";import"axios";import"crypto-js/enc-base64";import"crypto-js/enc-utf8";import"../utils/uuid.js";import"uuid";import"../utils/behaviorContext.js";import"../utils/encrypt.js";import"jsencrypt";import"../utils/dateTime.js";import"../hooks/useOperationAuth.js";import"vue-router";import"../stores/permissionStore.js";import"pinia";import"../utils/frontendBus.js";import"../utils/operationAuth.js";import"../stores/userInfoStore.js";import"../utils/userSessionStorage.js";import"../../chunks/ElFlex.vue_vue_type_script_setup_true_lang-DYk3SQcE.js";import"../interface/enum/FlexEnum.js";import"@vueuse/core";import"../components/icon/ElIcons.vue.js";import"../../chunks/_plugin-vue_export-helper-DlAUqK2U.js";import"../../chunks/ElDescForm.vue_vue_type_style_index_0_lang-BU3FMUMx.js";import"../components/ElContentPanel/ElContentPanel.vue.js";import"../components/ElSplitPanel/ElSplitPanel.vue.js";import"../components/ElCardSection/ElCardSection.vue.js";import"../components/upload/AttachmentPreview.vue.js";import"element-plus";import"../utils/FrameworkUtils.js";import"xlsx-js-style";import"../hooks/usePreviewFullscreen.js";import"../components/upload/OfficePreview.vue.js";import"../api/DocumentApi.js";import"../utils/request.js";import"../utils/AxiosConfig.js";import"../utils/globalLoading.js";import"../utils/workflowTaskContext.js";import"../config/GlobalLoadingConfig.js";import"../utils/fileDownload.js";import"../utils/officePreviewUtil.js";import"../components/upload/OfficePreviewHeaderBar.vue.js";import"@element-plus/icons-vue";import"../components/ElDialogBody/ElDialogBody.vue.js";import"../components/ElGrid/ElGrid.vue.js";import"../components/ElGrid/ElGridColumnSetting.vue.js";import"../../chunks/DragHandleIcon.vue_vue_type_script_setup_true_lang-DnMWn5jY.js";import"../utils/columnSettingStorage.js";import"../../chunks/ElTotalTools.vue_vue_type_script_setup_true_lang-BqRnIFkw.js";import"../../chunks/ElPagePagination.vue_vue_type_style_index_0_lang-CGjSyYgn.js";import"../components/Search/ElSearch.vue.js";import"../components/Title/ElTitle.vue.js";import"../components/icon/ElIconBtn.vue.js";import"../components/Search/ElIconSearch.vue.js";import"../components/Search/ElSearchInput.vue.js";import"../../chunks/ElCopyTooltip.vue_vue_type_script_setup_true_lang-Qg1P3If6.js";/* empty css */import"../../chunks/userSelect.vue_vue_type_script_setup_true_lang-DlEso2ua.js";import"../components/business/userSelectContent.vue.js";import"../api/BasicApi.js";import"../api/SysUserApi.js";import"../../chunks/comp.selectUser.vue_vue_type_script_setup_true_lang-BQDO393q.js";import"../api/EmployeeInfoApi.js";import"../components/business/comp.userForm.vue.js";import"../api/DeptInfoApi.js";import"../hooks/useResetRefHooks.js";import"../config/vxeSelectColumn.js";import"../../chunks/ElTagDisplay.vue_vue_type_script_setup_true_lang-DQXuYsW_.js";import"../../chunks/DictDisplay.vue_vue_type_script_setup_true_lang-DiFlFWi1.js";import"../hooks/useDictHooks.js";import"../api/SysDictCacheApi.js";import"../stores/dictStore.js";import"../../chunks/ElScrollbars.vue_vue_type_script_setup_true_lang-0Vhrxdyr.js";import"@vueuse/components";import"../components/ElCardList.vue.js";import"../components/kFrame/KFrame.vue.js";import"../components/kFrame/IframeOptions.js";import"../../chunks/ElCellLink.vue_vue_type_script_setup_true_lang-DXGj9pCT.js";import"../components/ElCircleBadge/ElCircleBadge.vue.js";import"../components/AsideCardList/AsideCardList.vue.js";import"../../chunks/ElNumericInput.vue_vue_type_script_setup_true_lang-C6KlCE6f.js";import"../components/ElIndicatorInput/ElIndicatorInput.vue.js";import"../components/RichTextEditor/RichTextEditor.vue.js";import"../../chunks/preload-helper-BlTxHScW.js";import"../components/RichTextEditor/richTextHtmlUtils.js";import"../components/RichTextEditor/installUmoEditorApp.js";import"tdesign-vue-next";import"../components/RichTextEditor/richTextImageUpload.js";import"../utils/buildUploadHeaders.js";import"../components/ElIndicatorInput/interface.js";import"../components/ElTabsPanel/ElTabsPanel.vue.js";const Ri={install(i){i.mixin(o)}};export{Ri as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ref as m,createApp as g,h as t}from"vue";import v,{ElDialog as y,ElDrawer as C,ElButton as n}from"element-plus";import E from"./plugins.js";import h from"../stores/storeConfig.js";/* empty css */import"../config/ElementPlusConfig.js";import b from"element-plus/es/locale/lang/zh-cn";import"../mixin/globalMixin.js";import"../../chunks/operationAuth.vue_vue_type_script_lang-BgqMGXbQ.js";import"../hooks/useBehaviorAction.js";import"../utils/behaviorTrack.js";import"axios";import"crypto-js/enc-base64";import"crypto-js/enc-utf8";import"../utils/uuid.js";import"uuid";import"../utils/behaviorContext.js";import"../utils/encrypt.js";import"jsencrypt";import"../utils/dateTime.js";import"../hooks/useOperationAuth.js";import"vue-router";import"../stores/permissionStore.js";import"pinia";import"../utils/frontendBus.js";import"../utils/operationAuth.js";import"../stores/userInfoStore.js";import"../utils/userSessionStorage.js";import"../../chunks/ElFlex.vue_vue_type_script_setup_true_lang-DYk3SQcE.js";import"../interface/enum/FlexEnum.js";import"@vueuse/core";import"../components/icon/ElIcons.vue.js";import"../../chunks/_plugin-vue_export-helper-DlAUqK2U.js";import"../../chunks/ElDescForm.vue_vue_type_style_index_0_lang-BU3FMUMx.js";import"../components/ElContentPanel/ElContentPanel.vue.js";import"../components/ElSplitPanel/ElSplitPanel.vue.js";import"../components/ElCardSection/ElCardSection.vue.js";import"../components/
|
|
1
|
+
import{ref as m,createApp as g,h as t}from"vue";import v,{ElDialog as y,ElDrawer as C,ElButton as n}from"element-plus";import E from"./plugins.js";import h from"../stores/storeConfig.js";/* empty css */import"../config/ElementPlusConfig.js";import b from"element-plus/es/locale/lang/zh-cn";import"../mixin/globalMixin.js";import"../../chunks/operationAuth.vue_vue_type_script_lang-BgqMGXbQ.js";import"../hooks/useBehaviorAction.js";import"../utils/behaviorTrack.js";import"axios";import"crypto-js/enc-base64";import"crypto-js/enc-utf8";import"../utils/uuid.js";import"uuid";import"../utils/behaviorContext.js";import"../utils/encrypt.js";import"jsencrypt";import"../utils/dateTime.js";import"../hooks/useOperationAuth.js";import"vue-router";import"../stores/permissionStore.js";import"pinia";import"../utils/frontendBus.js";import"../utils/operationAuth.js";import"../stores/userInfoStore.js";import"../utils/userSessionStorage.js";import"../../chunks/ElFlex.vue_vue_type_script_setup_true_lang-DYk3SQcE.js";import"../interface/enum/FlexEnum.js";import"@vueuse/core";import"../components/icon/ElIcons.vue.js";import"../../chunks/_plugin-vue_export-helper-DlAUqK2U.js";import"../../chunks/ElDescForm.vue_vue_type_style_index_0_lang-BU3FMUMx.js";import"../components/ElContentPanel/ElContentPanel.vue.js";import"../components/ElSplitPanel/ElSplitPanel.vue.js";import"../components/ElCardSection/ElCardSection.vue.js";import"../components/upload/AttachmentPreview.vue.js";import"../utils/FrameworkUtils.js";import"xlsx-js-style";import"../hooks/usePreviewFullscreen.js";import"../components/upload/OfficePreview.vue.js";import"../api/DocumentApi.js";import"../utils/request.js";import"../utils/AxiosConfig.js";import"../utils/globalLoading.js";import"../utils/workflowTaskContext.js";import"../config/GlobalLoadingConfig.js";import"../utils/fileDownload.js";import"../utils/officePreviewUtil.js";import"../components/upload/OfficePreviewHeaderBar.vue.js";import"@element-plus/icons-vue";import"../components/ElDialogBody/ElDialogBody.vue.js";import"../components/ElGrid/ElGrid.vue.js";import"../components/ElGrid/ElGridColumnSetting.vue.js";import"../../chunks/DragHandleIcon.vue_vue_type_script_setup_true_lang-DnMWn5jY.js";import"../utils/columnSettingStorage.js";import"../../chunks/ElTotalTools.vue_vue_type_script_setup_true_lang-BqRnIFkw.js";import"../../chunks/ElPagePagination.vue_vue_type_style_index_0_lang-CGjSyYgn.js";import"../components/Search/ElSearch.vue.js";import"../components/Title/ElTitle.vue.js";import"../components/icon/ElIconBtn.vue.js";import"../components/Search/ElIconSearch.vue.js";import"../components/Search/ElSearchInput.vue.js";import"../../chunks/ElCopyTooltip.vue_vue_type_script_setup_true_lang-Qg1P3If6.js";/* empty css */import"../../chunks/userSelect.vue_vue_type_script_setup_true_lang-DlEso2ua.js";import"../components/business/userSelectContent.vue.js";import"../api/BasicApi.js";import"../api/SysUserApi.js";import"../../chunks/comp.selectUser.vue_vue_type_script_setup_true_lang-BQDO393q.js";import"../api/EmployeeInfoApi.js";import"../components/business/comp.userForm.vue.js";import"../api/DeptInfoApi.js";import"../hooks/useResetRefHooks.js";import"../config/vxeSelectColumn.js";import"../../chunks/ElTagDisplay.vue_vue_type_script_setup_true_lang-DQXuYsW_.js";import"../../chunks/DictDisplay.vue_vue_type_script_setup_true_lang-DiFlFWi1.js";import"../hooks/useDictHooks.js";import"../api/SysDictCacheApi.js";import"../stores/dictStore.js";import"../../chunks/ElScrollbars.vue_vue_type_script_setup_true_lang-0Vhrxdyr.js";import"@vueuse/components";import"../components/ElCardList.vue.js";import"../components/kFrame/KFrame.vue.js";import"../components/kFrame/IframeOptions.js";import"../../chunks/ElCellLink.vue_vue_type_script_setup_true_lang-DXGj9pCT.js";import"../components/ElCircleBadge/ElCircleBadge.vue.js";import"../components/AsideCardList/AsideCardList.vue.js";import"../../chunks/ElNumericInput.vue_vue_type_script_setup_true_lang-C6KlCE6f.js";import"../components/ElIndicatorInput/ElIndicatorInput.vue.js";import"../components/RichTextEditor/RichTextEditor.vue.js";import"../../chunks/preload-helper-BlTxHScW.js";import"../components/RichTextEditor/richTextHtmlUtils.js";import"../components/RichTextEditor/installUmoEditorApp.js";import"tdesign-vue-next";import"../components/RichTextEditor/richTextImageUpload.js";import"../utils/buildUploadHeaders.js";import"../components/ElIndicatorInput/interface.js";import"../components/ElTabsPanel/ElTabsPanel.vue.js";import"pinia-plugin-store";import"../utils/patchWujiePopperCoordinates.js";function Ct(a,u,c,s,d="dialog"){const p=m(!0),i=m(!1),e=m(),o=g(()=>t(d==="dialog"?y:C,{...c,modelValue:p.value,onClosed(){o.unmount(),document.body.removeChild(r)},onClose(){l()}},{default:()=>t(a,{...u,ref:e}),footer:()=>t("div",{className:"dialog-footer"},[t(n,{onClick:l},()=>"取 消"),t(n,{type:"primary",onClick:f,loading:i.value},()=>"确 认")])}));o.use(E),o.use(v,{locale:b}),o.use(h),o.use(s);const r=document.createElement("div");document.body.appendChild(r),o.mount(r);async function f(){i.value=!0;try{await e.value?.confirm?.()}finally{i.value=!1}}function l(){p.value=!1}}export{Ct as renderDialog};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 按附件 ID 下载文件(统一的产物下载实现)。
|
|
3
|
+
*
|
|
4
|
+
* 预览组件的下载按钮、文件查看弹层、不可预览附件的自动下载都走这里,
|
|
5
|
+
* 避免各页面各写一份 Blob + a[download] 逻辑。
|
|
6
|
+
* 只负责取流并触发浏览器下载:loading 与错误提示由调用方处理。
|
|
7
|
+
*/
|
|
8
|
+
export declare const downloadFileById: (id: string, fileName?: string, format?: string) => Promise<void>;
|
|
9
|
+
export default downloadFileById;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import a from"../api/DocumentApi.js";import"./request.js";import"./AxiosConfig.js";import"axios";import"./uuid.js";import"uuid";import"./encrypt.js";import"jsencrypt";import"./behaviorTrack.js";import"crypto-js/enc-base64";import"crypto-js/enc-utf8";import"./behaviorContext.js";import"./dateTime.js";import"element-plus";import"./frontendBus.js";import"./globalLoading.js";import"vue";import"./workflowTaskContext.js";import"../config/GlobalLoadingConfig.js";const $=async(o,e,r)=>{if(!o)return;const{blob:t,fileName:p}=await a.downloadFile(o,r),m=URL.createObjectURL(t),i=document.createElement("a");i.href=m,i.download=p||c(e,o,r),i.click(),URL.revokeObjectURL(m)},c=(o,e,r)=>{const t=o||e;return r?.toLowerCase()==="pdf"&&!/\.pdf$/i.test(t)?t.replace(/\.[^./\\]+$/,"")+".pdf":t};export{$ as default,$ as downloadFileById};
|