adtec-hnyzfc-core-package 1.5.8 → 1.6.0
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 +7 -1
- package/dist/src/api/DocumentApi.js +1 -1
- package/dist/src/components/upload/AttachmentPreview.vue.js +1 -1
- package/dist/src/components/upload/OfficePreview.vue.d.ts +9 -0
- package/dist/src/components/upload/OfficePreview.vue.js +2 -2
- package/dist/src/components/workflow/WorkflowTodoShell.vue.js +3 -3
- package/dist/src/hooks/createDialogHooks.js +24 -12
- package/dist/src/utils/AxiosConfig.js +1 -1
- package/dist/src/utils/request.d.ts +6 -0
- package/dist/src/utils/request.js +1 -1
- package/dist/styles/element-ui.css +1 -1
- package/package.json +1 -1
|
@@ -18,7 +18,13 @@ declare const _default: {
|
|
|
18
18
|
delSysUploadFiles(ids: string[]): Promise<Record<string, string>>;
|
|
19
19
|
/** 公开注册:将附件 createBy 绑定为注册手机号 */
|
|
20
20
|
updateFilesCreateBy(ids: string[], createBy: string): Promise<Record<string, string>>;
|
|
21
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* 创建仅供当前浏览器内嵌使用的短期预览会话。
|
|
23
|
+
*
|
|
24
|
+
* skipGlobalLoading:预览区自己有加载层(OfficePreview 的 overlay + 预览页内层 loading),
|
|
25
|
+
* 会话创建不应再点亮整页 loading,也不应被 createDialogHooks 计入「抽屉/弹窗 loading」——
|
|
26
|
+
* 否则在抽屉里打开附件预览时,会出现抽屉 loading 与预览 loading 同时转圈。
|
|
27
|
+
*/
|
|
22
28
|
createPreviewSession(id: string): Promise<{
|
|
23
29
|
url: string;
|
|
24
30
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"../utils/request.js";import
|
|
1
|
+
import o from"../utils/request.js";import s 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 i="/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()},b={getUpLoadFilesVoById(e){return o.get(i+"getUpLoadFilesVoById/"+e)},getFileAccessAddress(e){return o.get(i+"getFileAccessAddress",{id:e})},async createRichTextImageUrl(e){const{url:t}=await this.createPreviewSession(e),r=/\/preview\/fileView\/([^/]+)\//.exec(t||"");if(!r?.[1])throw new Error("预览会话创建失败");return`${i}preview/fileView/${encodeURIComponent(r[1])}/image`},getUpLoadFilesByBussinessIds(e,t){const r=t===void 0?i+"getUpLoadFilesByBussinessIds":i+"getUpLoadFilesByBussinessIds/"+t;return o.post(r,e)},delSysUploadFile(e){return o.get(i+"delSysUploadFile/"+e)},getBusinessDocuments(e,t){return o.get(i+"getBusinessDocuments/"+e+"/"+t)},fileStatusConfirmation(e){return o.post(i+"fileStatusConfirmation",e)},delSysUploadFiles(e){return o.post(i+"delSysUploadFiles",e)},updateFilesCreateBy(e,t){return o.post(i+"updateFilesCreateBy",{ids:e,createBy:t})},createPreviewSession(e){return o.postWithOptions(i+"preview/session/"+e,void 0,{skipGlobalLoading:!0})},async downloadFile(e,t){const r=await s({url:i+"preview/download/"+e+(t?"?format="+t:""),method:"get",responseType:"blob"});return{blob:r.data,fileName:n(r.headers?.["content-disposition"])}}};export{b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineComponent as F,ref as s,watch as P,openBlock as
|
|
1
|
+
import{defineComponent as F,ref as s,watch as P,openBlock as h,createElementBlock as R,normalizeClass as T,unref as f,createBlock as w,withCtx as A,renderSlot as D}from"vue";import{ElEmpty as I}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 l=t,r=y,i=s(l.fileId||""),d=s(l.fileName||""),m=s(l.fileType||""),u=s(!1),n=s(null);P(()=>[l.fileId,l.fileName,l.fileType],([e,o,a])=>{i.value=e||"",d.value=o||"",m.value=a||""});const{previewContainerRef:g,isPreviewFullscreen:p,togglePreviewFullscreen:B}=x(),k=e=>{const o=e.id!==i.value;return i.value=e.id,d.value=e.name||"",m.value=e.type||"",r("update:fileId",e.id),r("update:fileName",e.name||""),r("update:fileType",e.type||""),r("change",e),o},c=async()=>{r("refresh");const e=l.refreshAttachment;if(e){u.value=!0;try{const o=await e();if(o?.id&&k(o))return;n.value?.reloadPreview()}catch(o){N.messageError(o)}finally{u.value=!1}}};return v({reload:()=>n.value?.reloadPreview(),download:e=>n.value?.download(e),refreshAttachment:c,isFullscreen:p}),(e,o)=>(h(),R("div",{ref_key:"previewContainerRef",ref:g,class:T(["attachment-preview",{"preview-fullscreen-fallback":f(p)}])},[i.value?(h(),w(C,{key:0,ref_key:"previewRef",ref:n,"file-id":i.value,"file-name":d.value,"file-type":m.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":u.value,"defer-refresh":!!t.refreshAttachment,"attachment-lost":t.attachmentLost,"lost-description":t.lostDescription,onLoaded:o[0]||(o[0]=a=>r("loaded")),onError:o[1]||(o[1]=a=>r("error",a)),onRefresh:c,onDownload:o[2]||(o[2]=a=>r("download",a)),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","defer-refresh","attachment-lost","lost-description","onToggleFullscreen"])):(h(),w(f(I),{key:1,description:t.emptyDescription},{default:A(()=>[D(e.$slots,"empty",{},void 0,!0)]),_:3},8,["description"]))],2))}}),ne=E(L,[["__scopeId","data-v-8ee24fdd"]]);export{ne as default};
|
|
@@ -16,6 +16,14 @@ type __VLS_Props = {
|
|
|
16
16
|
fullscreen?: boolean;
|
|
17
17
|
downloadLoading?: boolean;
|
|
18
18
|
refreshLoading?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* 刷新由调用方接管:点击刷新只对外发 `refresh` 通知,不在这里立即重载预览。
|
|
21
|
+
*
|
|
22
|
+
* 用于调用方需要"先重新取/重新生成附件、再重载"的场景(AttachmentPreview 配置了
|
|
23
|
+
* refresh-attachment 时会打开它)。否则一次点击会创建两个预览会话——先加载旧内容、
|
|
24
|
+
* 再加载新内容,既闪屏,又可能因为两次会话解析出的水印不同而看到"先没水印、后有水印"。
|
|
25
|
+
*/
|
|
26
|
+
deferRefresh?: boolean;
|
|
19
27
|
lostDescription?: string;
|
|
20
28
|
attachmentLost?: boolean;
|
|
21
29
|
};
|
|
@@ -61,6 +69,7 @@ declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
61
69
|
fileId: string;
|
|
62
70
|
fileType: string;
|
|
63
71
|
showHeader: boolean;
|
|
72
|
+
deferRefresh: boolean;
|
|
64
73
|
lostDescription: string;
|
|
65
74
|
attachmentLost: boolean;
|
|
66
75
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{defineComponent as
|
|
2
|
-
切换时淡出过渡,避免 spinner 相位/进度条状态差异造成的跳动 `),I("div",
|
|
1
|
+
import{defineComponent as Me,useModel as Ie,ref as c,computed as m,watch as ee,nextTick as Le,onMounted as Re,onBeforeUnmount as Pe,openBlock as B,createElementBlock as W,normalizeClass as Oe,createBlock as A,unref as O,createCommentVNode as M,createElementVNode as I,createVNode as Te,Transition as ze,withCtx as H,normalizeStyle as be,createTextVNode as ke,mergeModels as te}from"vue";import{ElEmpty as Ze,ElButton as De,ElMessage as $}from"element-plus";import Ve from"../../api/DocumentApi.js";import We from"../../utils/FrameworkUtils.js";import Ae from"../../utils/fileDownload.js";import{resolveOfficeFileExt as He,canExportPdf as $e,MAX_RICH_PREVIEW_ZOOM as oe,MIN_OFFICE_ZOOM as ae,clampRichPreviewZoom as re,OFFICE_ZOOM_STEP as le}from"../../utils/officePreviewUtil.js";import qe from"./OfficePreviewHeaderBar.vue.js";import{_ as _e}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 Ue={class:"fileview-frame-wrap"},Xe={key:0,class:"preview-loading-overlay"},Qe=["src","title"],je=Me({__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},deferRefresh:{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=Ie(s,"scale"),v=se,g=c(""),x=c(null),E=c(!1),h=c(!1),L=c(""),d=c(""),S=c(-1),C=c(0),F=c(!1),u=c(!1),T=c(!1);let R=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(()=>He(o.fileType,o.fileName,o.url)),U=m(()=>o.showSearch&&!h.value&&ie.has(_.value)),de=m(()=>o.showZoom&&!h.value),ue=m(()=>o.showDownload&&$e(_.value)),fe=m(()=>o.downloadLoading||T.value),me=m(()=>u.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"}}),z=t=>{x.value?.contentWindow?.postMessage({source:"adtec-office-preview",type:"command",...t},"*")},b=()=>{try{return x.value?.contentWindow||null}catch{return null}},k=t=>{const e=Number(t?.total||0);C.value=e,S.value=e>0?Number(t?.index||0):-1,e===0&&d.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},N=()=>{!u.value&&he(b())||z({command:"zoom",scale:n.value})},X=()=>{n.value=re(n.value+le),N()},Q=()=>{n.value=re(n.value-le),N()},j=()=>{n.value=1,N()};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 y=f.parentElement;return!y||!f.nodeValue||!f.nodeValue.trim()||y.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 y=f.indexOf(r);for(;y!==-1;)a.push({node:p,start:y,end:y+e.length}),y=f.indexOf(r,y+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=d.value;if(!e)return;const a=b(),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(!u.value){const r=pe(a,e,t);if(r){k(r);return}}z({command:"search",query:e,direction:t})},ye=()=>{i={query:"",matches:[],index:-1};const t=b(),e=t?.adtecFileViewAdapter;if(e?.clearSearch)try{e.clearSearch();return}catch{}if(!u.value)try{t?.getSelection?.()?.removeAllRanges()}catch{}z({command:"clear-search"})},ge=t=>{const e=t.trim();if(d.value=e,S.value=-1,C.value=0,!e){J();return}if(u.value){$.warning("当前预览服务不支持内容搜索,请下载后查看");return}Z("first")},J=()=>{d.value="",S.value=-1,C.value=0,ye()},xe=()=>{d.value&&Z("prev")},Ee=()=>{d.value&&Z("next")},G=t=>{if(!(t.source!==x.value?.contentWindow||t.data?.source!=="adtec-fileview")){if(t.data.type==="ready"){F.value=!0,u.value=!1,N();return}if(t.data.type==="search-result"){const e=Number(t.data.total||0);C.value=e,S.value=e>0?Number(t.data.index||0):-1,e===0&&d.value&&$.warning("未找到匹配内容")}}},P=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||P.has(e)))try{e.addEventListener("message",G),P.add(e)}catch{}})},Ce=()=>{P.forEach(t=>{try{t.removeEventListener("message",G)}catch{}}),P.clear()},K=async()=>{const t=++R;if(g.value="",E.value=!1,h.value=!1,L.value="",n.value=1,d.value="",S.value=-1,C.value=0,F.value=!1,u.value=!1,o.attachmentLost){h.value=!0,v("error");return}E.value=!0;try{if(o.fileId){const e=await Ve.createPreviewSession(o.fileId);if(t!==R)return;g.value=e.url;return}if(o.url.startsWith("/api/doc/preview/fileView/")){g.value=o.url;return}throw new Error("为保护附件地址,旧版文件直链已停止预览,请使用附件 ID 打开")}catch(e){if(t!==R)return;E.value=!1,h.value=!0,L.value=e?.msg||e?.message||"文件预览失败,请下载后查看",v("error",e)}},Y=()=>{K()},Fe=()=>{v("refresh"),!o.deferRefresh&&Y()},V=async(t="original")=>{if(v("download",t),!!o.fileId){T.value=!0;try{await Ae(o.fileId,o.fileName,t)}catch(e){We.messageError(e)}finally{T.value=!1}}},Be=()=>{E.value=!1,D();const t=x.value?.contentWindow;if(t&&!F.value)try{t.adtecPreviewBridge&&(F.value=!0,u.value=!1)}catch{}F.value||window.setTimeout(()=>{F.value||(u.value=!0)},1500),N(),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(g,t=>{t&&Le(()=>D())}),Re(()=>D()),Pe(()=>{R++,Ce()}),ne({reloadPreview:Y,zoomIn:X,zoomOut:Q,resetZoom:j,download:V}),(t,e)=>(B(),W("div",{class:Oe(["office-preview-root",{"is-fullscreen":s.fullscreen}])},[s.showHeader?(B(),A(qe,{key:0,title:q.value,"title-only":!U.value,zoom:n.value,"search-query":d.value,"search-index":S.value,"search-total":C.value,"show-search":U.value,"show-page-nav":!1,"show-zoom":de.value,"show-download":s.showDownload,"pdf-export":ue.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:ge,onSearchClear:J,onSearchPrev:xe,onSearchNext:Ee,onDownload:V,onRefresh:Fe,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",Ue,[Te(ze,{name:"preview-loading-fade"},{default:H(()=>[E.value?(B(),W("div",Xe,[...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}),g.value&&!h.value?(B(),W("iframe",{key:g.value,ref_key:"previewFrameRef",ref:x,class:"fileview-frame",style:be(ve.value),src:g.value,title:q.value||"文件预览",referrerpolicy:"same-origin",onLoad:Be,onError:Ne},null,44,Qe)):h.value?(B(),A(O(Ze),{key:1,description:ce.value},{default:H(()=>[s.showDownload?(B(),A(O(De),{key:0,type:"primary",onClick:e[2]||(e[2]=a=>V())},{default:H(()=>[...e[4]||(e[4]=[ke(" 下载文件 ",-1)])]),_:1})):M("v-if",!0)]),_:1},8,["description"])):M("v-if",!0)])],2))}}),St=_e(je,[["__scopeId","data-v-d048ae89"]]);export{St as default};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{defineComponent as Ie,useModel as Te,ref as E,computed as y,resolveComponent as h,resolveDirective as xe,openBlock as n,createElementBlock as r,createCommentVNode as d,withDirectives as
|
|
1
|
+
import{defineComponent as Ie,useModel as Te,ref as E,computed as y,resolveComponent as h,resolveDirective as xe,openBlock as n,createElementBlock as r,createCommentVNode as d,withDirectives as Ce,createVNode as D,createElementVNode as i,createBlock as x,Fragment as p,renderList as C,normalizeClass as J,toDisplayString as u,renderSlot as be,resolveDynamicComponent as Ne,mergeProps as De,withCtx as K,normalizeStyle as Ee,createTextVNode as b,unref as X,mergeModels as Z,nextTick as Ke}from"vue";import V from"../../api/workflow/workflowInstApi.js";import Ae from"../../api/DocumentApi.js";import Be from"../../hooks/useFileView.js";import Le from"../../utils/FrameworkUtils.js";import{formatDateTime as Me}from"../../utils/dateTime.js";import{userInfoStore as Se}from"../../stores/userInfoStore.js";import Pe from"./TaskOperation.vue.js";import{_ as $e}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"element-plus";import"../../utils/frontendBus.js";import"../../utils/globalLoading.js";import"../../utils/workflowTaskContext.js";import"../../config/GlobalLoadingConfig.js";import"xlsx-js-style";import"pinia";import"../../utils/userSessionStorage.js";import"./components/SelectAssigneeDialog.vue.js";import"../../../chunks/AddOrMinusMultiDialog.vue_vue_type_script_setup_true_lang-SYw6MXOl.js";import"../business/comp.userForm.vue.js";import"@vueuse/core";import"../../api/DeptInfoApi.js";import"../../api/EmployeeInfoApi.js";import"../../hooks/useResetRefHooks.js";import"../../config/vxeSelectColumn.js";import"../../../chunks/ElTagDisplay.vue_vue_type_script_setup_true_lang-DQXuYsW_.js";/* empty css */import"../../api/SysUserApi.js";import"./components/CheckDialog.vue.js";import"../bpmntree/components/UserSelector/UserTag.vue.js";import"../upload/CustomElUpload.vue.js";import"@element-plus/icons-vue";import"../../hooks/useDeleteConfirmHooks.js";import"../../hooks/useBehaviorAction.js";import"../../utils/uploadAccept.js";import"../../utils/buildUploadHeaders.js";import"../../hooks/workflowTodo.js";import"../../hooks/usePermissionHooks.js";import"vue-router";import"../../stores/permissionStore.js";import"../../utils/operationAuth.js";import"../../utils/routeMetaParams.js";import"../../hooks/useOpenNewMenu.js";import"../../utils/commonUtils.js";import"../../utils/tree.js";const Ve={class:"workflow-todo-shell"},je={class:"workflow-todo-shell__body dialog-content-fill"},Fe={key:1,class:"wf-progress-scroll"},Oe={class:"wf-progress-steps"},Ue={class:"wf-progress-step__icon-wrap"},ze={class:"wf-progress-step__icon"},Re={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},Qe={key:4},Ge={class:"wf-progress-step__name"},We={class:"wf-progress-step__name-text"},Ye={class:"wf-progress-step__name-label"},qe={key:0,class:"wf-progress-step__occurrence"},He={key:0,class:"workflow-todo-shell__record-occurrence"},Je={key:1,class:"workflow-todo-shell__record-type"},Xe={key:0,class:"workflow-todo-shell__record-user"},Ze={class:"workflow-todo-shell__record-person__name"},et={key:0,class:"workflow-todo-shell__comment"},tt={key:0,class:"workflow-todo-shell__record-files"},st=["onClick"],ot={class:"workflow-todo-shell__record-person__name"},nt={key:0,class:"workflow-todo-shell__comment"},at={key:1,class:"workflow-todo-shell__record-files"},rt=["onClick"],lt={class:"workflow-todo-shell__record-person__name"},it={key:0,class:"workflow-todo-shell__footer"},ee="__end__",ct=Ie({__name:"WorkflowTodoShell",props:Z({taskId:{},taskInfo:{default:void 0},readonly:{type:Boolean,default:!1},contentComponent:{default:void 0},contentProps:{default:()=>({})},renderDialog:{type:Function,default:void 0},showFooter:{type:Boolean,default:!0}},{loading:{type:Boolean,default:!1},loadingModifiers:{}}),emits:Z(["cancel","success"],["update:loading"]),setup(w,{expose:te,emit:se}){const f=w,A=se,g=Te(w,"loading"),v=E(),m=E(),B=E(),L=E(!1),oe=e=>[...e].sort((t,o)=>(t.createTime||"").localeCompare(o.createTime||"")),j=y(()=>oe([...m.value?.hisTasks||[],...m.value?.activeTasks||[]])),M=E({}),F=Be().fileView,O=e=>{const t=(e.split(".").pop()||"").toLowerCase();return".jpg,.jpeg,.png,.gif,.bmp".includes(t)?"adtec-image":t==="pdf"?"adtec-pdf":t==="doc"||t==="docx"?"adtec-word":t==="xls"||t==="xlsx"?"adtec-excel":t==="ppt"||t==="pptx"?"adtec-ppt":"adtec-text"},N=e=>e?M.value[e]||[]:[],ne=async()=>{var t;const e=Array.from(new Set(j.value.map(o=>o.taskId).filter(o=>!!o)));if(e.length)try{const o=await Ae.getUpLoadFilesByBussinessIds(e),a={};for(const l of o)l.businessId&&(a[t=l.businessId]||(a[t]=[])).push(l);M.value=a}catch{M.value={}}},S=y(()=>{const e=new Map;for(const t of j.value){const o=q(t),a=e.get(o);a?a.tasks.push(t):e.set(o,{taskName:t.taskName,taskDefKey:t.taskDefKey,parentExecutionId:t.parentExecutionId,tasks:[t],approvalType:t.approvalType})}return Array.from(e.values())}),U=y(()=>v.value?.procEndTime?!0:!!(m.value&&!(m.value.activeTasks||[]).length&&(m.value.hisTasks||[]).length)),ae=y(()=>{const e=[...S.value],t=new Set(e.map(a=>z(a)));for(const a of m.value?.futureTasks||[]){const l=`${a.taskDefKey||a.taskName}-`;t.has(l)||e.push({taskName:a.taskName,taskDefKey:a.taskDefKey,tasks:[],assigneeNames:a.assigneeNames,approvalType:a.approvalType})}e.push({taskName:"结束",taskDefKey:ee,tasks:[],isEnd:!0});const o=new Map;for(const a of e){const l=a.taskDefKey||a.taskName||"";l&&(a.occurrence=(o.get(l)||0)+1,o.set(l,a.occurrence))}return e}),z=e=>`${e.taskDefKey||e.taskName}-${e.parentExecutionId||""}`,re={single:"或签",joint:"会签",all:"会签"},R=e=>re[e.approvalType||e.tasks[0]?.approvalType||""]||"",le=e=>(e.approvalType||e.tasks[0]?.approvalType||"")==="single",Q=e=>{const t=(e.assigneeNames||"").split(",").map(o=>o.trim()).filter(Boolean);return t.length?t:["待处理"]},ie={1:{label:"同意",type:"success"},2:{label:"驳回",type:"warning"},3:{label:"终止",type:"danger"},4:{label:"委派",type:"warning"},5:{label:"转办",type:"warning"},6:{label:"终止",type:"danger"},7:{label:"撤回",type:"info"}},ce=e=>Me(e.finishTime||e.createTime),de={success:"var(--el-color-success)",warning:"var(--el-color-warning)",danger:"var(--el-color-danger)",primary:"var(--el-color-primary)"},pe=e=>de[e]||"",I=e=>{if(e.isEnd)return U.value?{label:"已结束",type:"success",hollow:!1}:{label:"等待",type:"info",hollow:!1};if(!e.tasks.length)return{label:"等待",type:"info",hollow:!1};const t=e.tasks;if(t.some(l=>!l.finishTime))return{label:"进行中",type:"primary",hollow:!1};let o="已办",a="success";if(t.some(l=>l.taskLocalVars?.firstTask))o="提交";else{const l=[...t].sort((k,$)=>($.finishTime||"").localeCompare(k.finishTime||""))[0]?.commentList?.[0],T=ie[l?.type||""];o=T?.label||"已办",a=T?.type||"success"}return{label:o,type:a,hollow:!1}},G=e=>{const t=e.assigneeName||e.startUserName||"待处理";return e.finishTime?`${t} · ${ce(e)}`:t},ue=e=>e.tasks.length?e.tasks.map(G).join(" / "):Q(e).join(" / "),P=e=>e.tasks.map(t=>t.comment).filter(Boolean).join(" / "),W=y(()=>{const e=new Map,t=[];for(const o of S.value){const a=o.taskDefKey||o.taskName||"";if(!a)continue;const l=o.tasks.some(k=>!k.finishTime)?"process":I(o).type,T=e.get(a);if(T!==void 0){const k=t[T];k.occurrence=(k.occurrence||1)+1,k.parentExecutionId=o.parentExecutionId,k.status=l;continue}e.set(a,t.length),t.push({taskName:o.taskName,taskDefKey:o.taskDefKey,parentExecutionId:o.parentExecutionId,status:l,occurrence:1})}for(const o of m.value?.futureTasks||[]){const a=o.taskDefKey||o.taskName||"";if(!a)continue;const l=e.get(a);if(l!==void 0){t[l].status="wait";continue}e.set(a,t.length),t.push({taskName:o.taskName,taskDefKey:o.taskDefKey,status:"wait"})}return t.push({taskName:"结束",taskDefKey:ee,status:U.value?"success":"wait"}),t}),Y=e=>{const t=Se().getUserInfo.userCode;return!t||!e?!1:!!(e.assigneeId===t||e.candidate&&e.candidate.split(",").map(a=>a.trim()).filter(Boolean).includes(t))},fe=y(()=>Y(v.value)?!0:(m.value?.activeTasks||[]).some(e=>Y(e))),me=y(()=>f.readonly||!!v.value?.finishTime||!!v.value?.procEndTime||L.value&&!(m.value?.activeTasks||[]).length||!fe.value),ke=y(()=>B.value?.taskOption),ve=y(()=>{const e=ke.value;return{...e||{},cancelFunction:(...t)=>{e?.cancelFunction?.(...t),A("cancel")},workflowComplete:(...t)=>{e?.workflowComplete?.(...t)}}}),q=e=>`${e.taskDefKey||e.taskName}-${e.parentExecutionId||""}`,H=async(e,t=!1)=>{const o=f.taskInfo&&f.taskInfo.procInsId==null&&f.taskInfo.processInstanceId!=null?{...f.taskInfo,procInsId:f.taskInfo.processInstanceId}:f.taskInfo;if(!(!f.taskId&&!o?.procInsId))try{g.value=!0,L.value=!1,v.value=e?{...v.value,...e}:t&&f.taskId?await V.getTaskInst(f.taskId):o||await V.getTaskInst(f.taskId),v.value?.procInsId&&(m.value=await V.getProcessTaskList(v.value.procInsId)),L.value=!0,await ne(),await Ke(),await B.value?.resetQuery?.()}catch(a){Le.messageError(a)}finally{g.value=!1}},_e=async e=>{A("success",e),await H(e,!0)};return te({resetQuery:async()=>{await H()}}),(e,t)=>{const o=h("el-title"),a=h("el-empty"),l=h("el-tag-display"),T=h("el-flex"),k=h("el-icons"),$=h("el-timeline-item"),ye=h("el-timeline"),we=h("el-button"),he=xe("loading");return n(),r("div",Ve,[d(`
|
|
2
2
|
内容区撑满剩余空间统一使用 dialog-content-fill(flex/height 由核心工具类提供),
|
|
3
3
|
滚动仅保留在本内容区,底部操作栏固定不随内容滚动。
|
|
4
|
-
`),
|
|
4
|
+
`),Ce((n(),r("div",je,[D(o,{level:"1",title:"流程进度",style:{"border-bottom":"var(--border)"}}),i("div",null,[W.value.length?(n(),r("div",Fe,[i("div",Oe,[(n(!0),r(p,null,C(W.value,(s,c)=>(n(),r("div",{key:q(s),class:J(["wf-progress-step",{done:s.status==="success",current:s.status==="process",rejected:s.status==="warning",stopped:s.status==="error"||s.status==="danger"}])},[i("div",Ue,[i("div",ze,[d(" 同意/提交:对勾 "),s.status==="success"?(n(),r("svg",Re,[...t[3]||(t[3]=[i("path",{d:"M20 6L9 17l-5-5"},null,-1)])])):s.status==="warning"?(n(),r(p,{key:1},[d(" 驳回:回退箭头 "),t[4]||(t[4]=i("svg",{viewBox:"0 0 24 24",fill:"currentColor"},[i("path",{d:"M10 9V5l-7 7 7 7v-4.1c5 0 8.5 1.6 11 5.1-1-5-4-10-11-11z"})],-1))],2112)):s.status==="danger"||s.status==="error"?(n(),r(p,{key:2},[d(" 终止:叉 "),t[5]||(t[5]=i("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},[i("path",{d:"M18 6L6 18"}),i("path",{d:"M6 6l12 12"})],-1))],2112)):s.status==="info"?(n(),r(p,{key:3},[d(" 撤回:撤销箭头 "),t[6]||(t[6]=i("svg",{viewBox:"0 0 24 24",fill:"currentColor"},[i("path",{d:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"})],-1))],2112)):(n(),r("span",Qe,u(c+1),1))])]),i("div",Ge,[i("span",We,[i("span",Ye,u(s.taskName||"未命名节点"),1),s.occurrence&&s.occurrence>1?(n(),r("sup",qe,u(s.occurrence),1)):d("v-if",!0)])])],2))),128))])])):(n(),x(a,{key:0,description:"暂无流程进度","image-size":48}))]),d(`
|
|
5
5
|
业务审核内容:完全由业务内容组件/插槽决定(含它自己的标题、分区、网格),
|
|
6
6
|
通用抽屉不再注入任何标题,业务页面给什么就展示什么。
|
|
7
|
-
`),
|
|
7
|
+
`),be(e.$slots,"content",{task:v.value,process:m.value},()=>[w.contentComponent?(n(),x(Ne(w.contentComponent),De({key:0,ref_key:"contentRef",ref:B},w.contentProps,{loading:g.value,"onUpdate:loading":t[0]||(t[0]=s=>g.value=s)}),null,16,["loading"])):d("v-if",!0)],!0),D(o,{level:"1",title:"审批记录",style:{"border-bottom":"var(--border)"}}),i("div",null,[S.value.length?(n(),x(ye,{key:1,class:"workflow-todo-shell__timeline"},{default:K(()=>[(n(!0),r(p,null,C(ae.value,s=>(n(),x($,{key:z(s),type:I(s).type,hollow:I(s).hollow,style:Ee({"--el-timeline-node-color":pe(I(s).type)})},{default:K(()=>[D(T,{align:"center",justify:"space-between",class:J(["workflow-todo-shell__record-title",`is-${I(s).type}`])},{default:K(()=>[i("span",null,[b(u(s.taskName||"未命名节点")+" ",1),(s.occurrence||0)>1?(n(),r("span",He,u(s.occurrence),1)):d("v-if",!0),R(s)?(n(),r("span",Je,u(R(s)),1)):d("v-if",!0)]),D(l,{type:I(s).type,size:"small"},{default:K(()=>[b(u(I(s).label),1)]),_:2},1032,["type"])]),_:2},1032,["class"]),le(s)?(n(),r("div",Xe,[i("span",Ze,u(ue(s)),1),P(s)||s.tasks.some(c=>N(c.taskId).length)?(n(),r("div",et,[P(s)?(n(),r(p,{key:0},[b(u(P(s)),1)],64)):d("v-if",!0),(n(!0),r(p,null,C(s.tasks,c=>(n(),r(p,{key:c.taskId},[N(c.taskId).length?(n(),r("div",tt,[(n(!0),r(p,null,C(N(c.taskId),_=>(n(),r("span",{key:_.id,class:"workflow-todo-shell__record-file",onClick:ge=>X(F)(_.id)},[D(k,{"model-value":O(_.name)},null,8,["model-value"]),b(u(_.name),1)],8,st))),128))])):d("v-if",!0)],64))),128))])):d("v-if",!0)])):s.tasks.length?(n(!0),r(p,{key:1},C(s.tasks,c=>(n(),r("div",{key:c.taskId,class:"workflow-todo-shell__record-user"},[i("span",ot,u(G(c)),1),c.comment||N(c.taskId).length?(n(),r("div",nt,[c.comment?(n(),r(p,{key:0},[b(u(c.comment),1)],64)):d("v-if",!0),N(c.taskId).length?(n(),r("div",at,[(n(!0),r(p,null,C(N(c.taskId),_=>(n(),r("span",{key:_.id,class:"workflow-todo-shell__record-file",onClick:ge=>X(F)(_.id)},[D(k,{"model-value":O(_.name)},null,8,["model-value"]),b(u(_.name),1)],8,rt))),128))])):d("v-if",!0)])):d("v-if",!0)]))),128)):s.isEnd?d("v-if",!0):(n(),r(p,{key:2},[d(" 结束节点只有节点名与状态,不展示审签人 "),(n(!0),r(p,null,C(Q(s),c=>(n(),r("div",{key:c,class:"workflow-todo-shell__record-user"},[i("span",lt,u(c),1)]))),128))],64))]),_:2},1032,["type","hollow","style"]))),128))]),_:1})):(n(),x(a,{key:0,description:"暂无审批记录","image-size":48}))])])),[[he,g.value]]),w.showFooter?(n(),r("div",it,[me.value?(n(),x(we,{key:0,onClick:t[1]||(t[1]=s=>A("cancel"))},{default:K(()=>[...t[7]||(t[7]=[b("取消",-1)])]),_:1})):(n(),x(Pe,{key:1,"task-id":w.taskId,params:ve.value,"render-dialog":w.renderDialog,"show-process-btn":!1,"but-loading":g.value,"onUpdate:butLoading":t[2]||(t[2]=s=>g.value=s),onSuccess:_e},null,8,["task-id","params","render-dialog","but-loading"]))])):d("v-if",!0)])}}}),fs=$e(ct,[["__scopeId","data-v-2dd4e6d0"]]);export{fs as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{computed as
|
|
2
|
-
/* dialog-hooks
|
|
1
|
+
import{computed as $,ref as x,unref as w,createApp as so,nextTick as no,h as d}from"vue";import co,{ElDrawer as ho,ElDialog as go,ElButton as q}from"element-plus";import V from"../stores/storeConfig.js";/* empty css */import*as P from"@element-plus/icons-vue";import"../config/ElementPlusConfig.js";import{installVxeGrid as uo}from"../config/VxeTableConfig.js";import po from"element-plus/es/locale/lang/zh-cn";import bo from"./useListenerHooks.js";import{permissionStore as mo}from"../stores/permissionStore.js";import fo from"../components/icon/ElIcons.vue.js";import _o from"../components/ElDialogBody/ElDialogBody.vue.js";import ko from"crypto-js/enc-base64";import yo from"crypto-js/enc-utf8";import{frontendBus as A}from"../utils/frontendBus.js";import{GLOBAL_LOADING_EVENT as W,notifyDialogLoadingScope as vo}from"../utils/globalLoading.js";import xo from"./useBehaviorAction.js";import"pinia";import"pinia-plugin-store";import"../utils/patchWujiePopperCoordinates.js";import"vxe-table";import"@vxe-ui/core";import"@vxe-ui/plugin-export-xlsx";import"exceljs";import"vxe-table/es/style.css";import"vxe-table/es/locale/lang/zh-CN";import"../components/vxeReplace/index.js";import"../components/tooltip/index.js";import"../components/tooltip/src/tooltip.js";import"../../chunks/VxeButton.vue_vue_type_script_setup_true_lang-s_mYx9TA.js";import"../../chunks/VxeInput.vue_vue_type_script_setup_true_lang-v9AqGSoL.js";import"../../chunks/VxeSelect.vue_vue_type_script_setup_true_lang-DcVggycZ.js";import"../../chunks/VxeCheckbox.vue_vue_type_script_setup_true_lang-Ccr5YD1x.js";import"../../chunks/VxeModal.vue_vue_type_script_setup_true_lang-B4gh7jFR.js";import"../../chunks/VxeLoading.vue_vue_type_script_setup_true_lang-B253kD5t.js";import"../../chunks/VxePager.vue_vue_type_script_setup_true_lang-DpOa3T96.js";import"../../chunks/VxeForm.vue_vue_type_script_setup_true_lang-DXNZ8Qzg.js";import"../utils/behaviorTrack.js";import"axios";import"../utils/uuid.js";import"uuid";import"../utils/behaviorContext.js";import"../utils/encrypt.js";import"jsencrypt";import"../utils/dateTime.js";import"../utils/operationAuth.js";import"../stores/userInfoStore.js";import"../utils/userSessionStorage.js";import"@vueuse/core";import"../../chunks/_plugin-vue_export-helper-DlAUqK2U.js";const wo={},Eo="subAppModalOverlay",E="adtec-subapp-modal-open";let U=0;const b=[],y=new Map;let S=!1;const C=new WeakMap,So=()=>{for(let o=b.length-1;o>=0;o--)if(b[o].open.value)return b[o]},j=o=>{if(!o?.id)return;if(o.phase==="start"){const t=So();if(!t)return;y.set(o.id,t),t.requestLoadingIds.add(o.id),t.requestLoading.value=!0;return}const e=y.get(o.id);e&&(y.delete(o.id),e.requestLoadingIds.delete(o.id),e.requestLoading.value=e.requestLoadingIds.size>0)},Lo=o=>{b.push(o),!S&&(A.on(W,j),S=!0)},Io=o=>{const e=b.indexOf(o);e>-1&&b.splice(e,1),o.requestLoadingIds.forEach(t=>y.delete(t)),o.requestLoadingIds.clear(),o.requestLoading.value=!1,!(b.length>0||!S)&&(A.off(W,j),S=!1,y.clear())},Oo=o=>{const e=wo||{};return o.applicationModule||e.VITE_APPLICATION_MODULE||e.VITE_APP_MODULE||String(o.router.currentRoute.value.meta.applicationModule||"")},z=(o,e,t)=>{if(typeof window>"u"||!window.__POWERED_BY_WUJIE__)return;const r=Oo(o);if(!r||(t&&!e.overlayId&&(e.overlayId=`${r}-${Date.now()}-${++U}`),!e.overlayId))return;const s={applicationModule:r,overlayId:e.overlayId,open:t};A.emit(Eo,s),t||(e.overlayId=void 0)},N=(o,e)=>{e&&!o.overlayId&&(o.overlayId=`dialog-${Date.now()}-${++U}`),o.overlayId&&vo({id:o.overlayId,open:e})};function Co(){const e="dialog-hooks-styles",t=document.getElementById(e);if(t&&(t.textContent||"").includes("/* dialog-hooks v24 */"))return;t?.remove();const r=document.createElement("style");r.id=e,r.type="text/css",r.innerHTML=`
|
|
2
|
+
/* dialog-hooks v24 */
|
|
3
3
|
/* 抽屉组件 - 无滚动条样式 */
|
|
4
4
|
.dialog-hooks-no-scroll.el-drawer .el-drawer__body {
|
|
5
5
|
overflow: hidden !important;
|
|
@@ -77,8 +77,10 @@ import{computed as B,ref as x,unref as w,createApp as ro,nextTick as ao,h as n}f
|
|
|
77
77
|
/* 弹窗/抽屉内容滚动条:滚动条槽位占满弹窗/抽屉右侧 8px 内边距(贴边),
|
|
78
78
|
但滑块用 2px 透明边框 + background-clip 收成 4px,两侧各留 2px 空隙——
|
|
79
79
|
否则滑块会紧贴内容块右 border,看起来和内容连在一起。平时透明、滚动或悬停时显示。
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
业务内容里自带 overflow: auto 的节点(el-flex 的默认值——创建任务书抽屉的根节点、
|
|
81
|
+
审批抽屉里嵌套的表单根节点、workflow-todo-shell__body 等)滚动条长在它们自己身上,
|
|
82
|
+
所以内容层里的所有滚动容器一并覆盖(排除 vxe 网格、umo 编辑器和 textarea,它们有自己的滚动条样式),
|
|
83
|
+
否则这些内嵌滚动条会退回全局 8px 常显样式。
|
|
82
84
|
注意:Chromium 只要看到 scrollbar-width/scrollbar-color 非 auto,就会丢弃
|
|
83
85
|
::-webkit-scrollbar 定制,退回系统原生 thin(约 11px)或 macOS 覆盖式滚动条——
|
|
84
86
|
于是滚动条变粗,且覆盖式滚动条实测占位是 0,下面 --dialog-hooks-scrollbar 的右侧补偿
|
|
@@ -90,7 +92,9 @@ import{computed as B,ref as x,unref as w,createApp as ro,nextTick as ao,h as n}f
|
|
|
90
92
|
.dialog-hooks-host .el-drawer__body,
|
|
91
93
|
.dialog-hooks-host .el-dialog__body,
|
|
92
94
|
.dialog-hooks-host .el-dialog-body__content,
|
|
93
|
-
.dialog-hooks-host
|
|
95
|
+
.dialog-hooks-host
|
|
96
|
+
.el-dialog-body__content
|
|
97
|
+
*:not([class*='vxe']):not([class*='umo']):not(.el-textarea__inner) {
|
|
94
98
|
scrollbar-width: thin;
|
|
95
99
|
scrollbar-color: transparent transparent;
|
|
96
100
|
}
|
|
@@ -98,7 +102,9 @@ import{computed as B,ref as x,unref as w,createApp as ro,nextTick as ao,h as n}f
|
|
|
98
102
|
.dialog-hooks-host .el-drawer__body::-webkit-scrollbar,
|
|
99
103
|
.dialog-hooks-host .el-dialog__body::-webkit-scrollbar,
|
|
100
104
|
.dialog-hooks-host .el-dialog-body__content::-webkit-scrollbar,
|
|
101
|
-
.dialog-hooks-host
|
|
105
|
+
.dialog-hooks-host
|
|
106
|
+
.el-dialog-body__content
|
|
107
|
+
*:not([class*='vxe']):not([class*='umo']):not(.el-textarea__inner)::-webkit-scrollbar {
|
|
102
108
|
/* 与全局 *::-webkit-scrollbar 一致:-webkit-appearance: none 才切换为经典滚动条,
|
|
103
109
|
否则 macOS 的覆盖式细滚动条会忽略 width,占位宽度变成 0 */
|
|
104
110
|
-webkit-appearance: none;
|
|
@@ -110,7 +116,9 @@ import{computed as B,ref as x,unref as w,createApp as ro,nextTick as ao,h as n}f
|
|
|
110
116
|
.dialog-hooks-host .el-drawer__body::-webkit-scrollbar-thumb,
|
|
111
117
|
.dialog-hooks-host .el-dialog__body::-webkit-scrollbar-thumb,
|
|
112
118
|
.dialog-hooks-host .el-dialog-body__content::-webkit-scrollbar-thumb,
|
|
113
|
-
.dialog-hooks-host
|
|
119
|
+
.dialog-hooks-host
|
|
120
|
+
.el-dialog-body__content
|
|
121
|
+
*:not([class*='vxe']):not([class*='umo']):not(.el-textarea__inner)::-webkit-scrollbar-thumb {
|
|
114
122
|
/* 2px 透明边框 + padding-box 裁剪:8px 槽位里只画出 4px 滑块,与内容 border 留出空隙 */
|
|
115
123
|
background-color: transparent;
|
|
116
124
|
border: 2px solid transparent;
|
|
@@ -124,13 +132,13 @@ import{computed as B,ref as x,unref as w,createApp as ro,nextTick as ao,h as n}f
|
|
|
124
132
|
.dialog-hooks-host:hover .el-dialog-body__content::-webkit-scrollbar-thumb,
|
|
125
133
|
.dialog-hooks-host:hover
|
|
126
134
|
.el-dialog-body__content
|
|
127
|
-
|
|
135
|
+
*:not([class*='vxe']):not([class*='umo']):not(.el-textarea__inner)::-webkit-scrollbar-thumb,
|
|
128
136
|
.dialog-hooks-host .el-drawer__body.is-scrolling::-webkit-scrollbar-thumb,
|
|
129
137
|
.dialog-hooks-host .el-dialog__body.is-scrolling::-webkit-scrollbar-thumb,
|
|
130
138
|
.dialog-hooks-host .el-dialog-body__content.is-scrolling::-webkit-scrollbar-thumb,
|
|
131
139
|
.dialog-hooks-host
|
|
132
140
|
.el-dialog-body__content
|
|
133
|
-
|
|
141
|
+
*:not([class*='vxe']):not([class*='umo']):not(.el-textarea__inner).is-scrolling::-webkit-scrollbar-thumb {
|
|
134
142
|
background-color: rgba(144, 147, 153, 0.4);
|
|
135
143
|
}
|
|
136
144
|
/* 同上:只有 Firefox 这类没有 ::-webkit-scrollbar 的浏览器才需要 scrollbar-color 兜底 */
|
|
@@ -138,11 +146,15 @@ import{computed as B,ref as x,unref as w,createApp as ro,nextTick as ao,h as n}f
|
|
|
138
146
|
.dialog-hooks-host:hover .el-drawer__body,
|
|
139
147
|
.dialog-hooks-host:hover .el-dialog__body,
|
|
140
148
|
.dialog-hooks-host:hover .el-dialog-body__content,
|
|
141
|
-
.dialog-hooks-host:hover
|
|
149
|
+
.dialog-hooks-host:hover
|
|
150
|
+
.el-dialog-body__content
|
|
151
|
+
*:not([class*='vxe']):not([class*='umo']):not(.el-textarea__inner),
|
|
142
152
|
.dialog-hooks-host .el-drawer__body.is-scrolling,
|
|
143
153
|
.dialog-hooks-host .el-dialog__body.is-scrolling,
|
|
144
154
|
.dialog-hooks-host .el-dialog-body__content.is-scrolling,
|
|
145
|
-
.dialog-hooks-host
|
|
155
|
+
.dialog-hooks-host
|
|
156
|
+
.el-dialog-body__content
|
|
157
|
+
*:not([class*='vxe']):not([class*='umo']):not(.el-textarea__inner).is-scrolling {
|
|
146
158
|
scrollbar-color: rgba(144, 147, 153, 0.4) transparent;
|
|
147
159
|
}
|
|
148
160
|
}
|
|
@@ -272,4 +284,4 @@ import{computed as B,ref as x,unref as w,createApp as ro,nextTick as ao,h as n}f
|
|
|
272
284
|
background: transparent !important;
|
|
273
285
|
background-color: transparent !important;
|
|
274
286
|
}
|
|
275
|
-
`,document.head.appendChild(
|
|
287
|
+
`,document.head.appendChild(r)}const Do=8;function F(o){const e=[];return o.querySelectorAll(".el-dialog-body__content").forEach(t=>e.push(t)),o.querySelectorAll(".el-drawer__body, .el-dialog__body").forEach(t=>{t.querySelector(".el-dialog-body__content")||e.push(t)}),e}function G(o){const e=[o];return o.querySelectorAll("*").forEach(t=>{(t.scrollHeight>t.clientHeight+1||t.scrollWidth>t.clientWidth+1)&&e.push(t)}),e}const R=new WeakSet;function Ao(o){F(o).forEach(e=>{G(e).forEach(t=>{R.has(t)||(R.add(t),Mo(t))})})}function Mo(o){let e;const t=()=>{o.classList.add("is-scrolling"),e&&window.clearTimeout(e),e=window.setTimeout(()=>o.classList.remove("is-scrolling"),600)};o.addEventListener("scroll",t,{passive:!0}),o.addEventListener("mouseenter",t),o.addEventListener("mouseleave",()=>{e&&window.clearTimeout(e),o.classList.remove("is-scrolling")})}function D(o){F(o).forEach(e=>{const t=C.get(e);if(!e.isConnected){t?.observer.disconnect(),C.delete(e);return}const r=G(e);if(H(e,r),typeof ResizeObserver>"u")return;let s=t;if(!s){const h={observer:new ResizeObserver(()=>H(e,h.targets)),targets:new Set};s=h,C.set(e,h)}const _=new Set(r);s.targets.forEach(h=>{_.has(h)||s.observer.unobserve(h)}),_.forEach(h=>{s.targets.has(h)||s.observer.observe(h)}),s.targets=_})}function H(o,e){let t=0;e.forEach(r=>{t=Math.max(t,r.offsetWidth-r.clientWidth)}),o.style.setProperty("--dialog-hooks-scrollbar",`${Math.min(Do,Math.max(0,t))}px`)}function To(o,e,t){return o===!1?{enabled:!1,scroll:t,class:void 0,contentClass:void 0}:o===!0||o===void 0?{enabled:o===!0?!0:e,scroll:t,class:void 0,contentClass:void 0}:{enabled:o.enabled??e,scroll:o.scroll??t,class:o.class,contentClass:o.contentClass}}function Bo(o,e){if(e)return e;try{const t=o.router.currentRoute.value.meta?.sysMenuData?.icon;if(t)return t}catch{}try{const t=sessionStorage.getItem("permissionStore");if(t){const r=JSON.parse(ko.parse(t).toString(yo));if(r?.activeMenuInfo?.icon)return r.activeMenuInfo.icon}}catch{}try{return mo(V).getActiveMenuInfo?.icon||""}catch{return""}}function Ae(o){return function(t){const r=[],s=()=>r[r.length-1],_=i=>{const a=w(i?.data),k=w(i?.row),v=w(i?.formData),p=i?.id??i?.taskId??i?.selectedId??a?.id??k?.id??v?.id;return p==null||p===""?"":String(p)},h=(i,a,k,v="drawer",p,X=!0)=>{Co();const{icon:Z,hideConfirm:L,hideFooter:oo,dialogBody:eo,...c}=k||{},f=To(eo,o.defaultDialogBody??!0,X),to=`${v}|${typeof i=="string"?i:i?.__name||i?.name||""}|${c.title||""}|${_(a)}`,M=x(!1),T=x(!1),l={open:x(!0),loading:$(()=>M.value||T.value),manualLoading:M,requestLoading:T,requestLoadingIds:new Set,childInstance:x(),app:null,div:null,closing:!1,renderKey:to,actionName:c.title||"确认"},lo=Object.fromEntries(Object.entries(a||{}).map(([n,u])=>[n,w(u)])),ro={...c,class:["dialog-hooks-host",...f.enabled?["dialog-hooks-body-contained"]:[],...f.scroll?[]:["dialog-hooks-no-scroll"],"dialog-hooks-scroll-auto",...Array.isArray(c.class)?c.class:c.class?[c.class]:[]]},ao=c.onClosed,I=typeof c.title=="string"&&c.title,B=I?Bo(o,Z):"",io=()=>d("div",{class:"dialog-hooks-header"},[B?d("div",{class:"dialog-hooks-header-icon"},[d(fo,{modelValue:B})]):null,d("div",{class:"dialog-hooks-header-title"},[c.title]),l.loading.value&&!L?null:d("button",{type:"button",class:"dialog-hooks-header-close",onClick:()=>m(l)},[d(P.Close)])]),g=so(()=>d(v==="drawer"?ho:go,{...ro,modelValue:l.open.value,showClose:I?!1:c.showClose??!0,onClosed(){N(l,!1),z(o,l,!1),Io(l),ao?.();const n=r.indexOf(l);n>-1&&r.splice(n,1),l.app?.unmount(),l.div?.parentNode&&l.div.parentNode.removeChild(l.div),l.app=null,l.div=null},onClose(){m(l)}},{...I?{header:io}:{},default:()=>{const n=d(i,{...lo,loading:l.loading.value,"onUpdate:loading":u=>{l.manualLoading.value=u},ref:l.childInstance});return f.enabled?d(_o,{scroll:f.scroll,class:f.class,contentClass:f.contentClass},{default:()=>n}):n},...oo?{}:{footer:()=>{if(p&&p.length){const n=p.map(u=>typeof u=="function"?u():u);return d("div",{className:"dialog-footer"},n)}return d("div",{className:"dialog-footer"},[d(q,{onClick:()=>m(l),loading:!L&&l.loading.value},"取 消"),L?null:d(q,{type:"primary",onClick:()=>Y(l),loading:l.loading.value},"确 认")])}}}));o.plugins?.forEach(n=>g.use(n)),g.use(co,{locale:po}),g.use(V),g.use(o.router);for(const[n,u]of Object.entries(P))g.component(n,u);uo(g),o.setupApp?.(g);const O=document.createElement("div");return document.body.appendChild(O),l.app=g,l.div=O,r.push(l),Lo(l),N(l,!0),z(o,l,!0),g.mount(O),no(()=>{Ao(document.body),D(document.body),l.childInstance.value?.resetQuery?.(),setTimeout(()=>{D(document.body),window.dispatchEvent(new Event("resize"))},350),setTimeout(()=>D(document.body),1200)}),bo(),{cancel:()=>m(l)}},Y=async i=>{const a=i||s();if(!a)return;const{runBehaviorAction:k}=xo();await k({code:`dialog:${a.renderKey}:confirm`,name:a.actionName||"确认",actionType:"SUBMIT"},async()=>{try{a.manualLoading.value=!0,await a.childInstance.value?.confirm?.(),t&&m(a)}finally{a.manualLoading.value=!1}})},m=i=>{const a=i||s();!a||!a.open.value||(a.closing=!0,a.open.value=!1)},K=i=>{const a=s();a&&(a.manualLoading.value=i)},J=()=>s()?.loading.value??!1,Q=$(()=>s()?.childInstance.value);return{render:h,cancel:m,setLoading:K,getLoading:J,instance:Q}}}export{Ae as createDialogHooks,Ae as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import y from"axios";import{createUuid as f}from"./uuid.js";import S from"./encrypt.js";import{getCurrentMenu as v,getBehaviorParentId as A,reportApiCall as h}from"./behaviorTrack.js";import{buildRequestContext as P}from"./behaviorContext.js";import{ElMessage as I}from"element-plus";import{frontendBus as C}from"./frontendBus.js";import{notifyGlobalLoading as w}from"./globalLoading.js";import{getWorkflowTaskContext as q}from"./workflowTaskContext.js";import{getGlobalLoadingIgnoredPaths as x}from"../config/GlobalLoadingConfig.js";import"uuid";import"jsencrypt";import"crypto-js/enc-base64";import"crypto-js/enc-utf8";import"./dateTime.js";import"vue";let n=!1;const T=()=>{C.emit("loginAgain")};let d=[];const i=y.create({timeout:6e4,validateStatus(e){return e>=200&&e<500}}),k=e=>{const a=String(e?.url||"").split(/[?#]/,1)[0];return!x().includes(a)},c=e=>{if(!k(e))return;const a=e?.__globalLoadingId;a&&(w({phase:"finish",id:a}),delete e.__globalLoadingId)},p=e=>{if(!k(e))return;const a=f();e.__globalLoadingId=a,w({phase:"start",id:a})};function L(e){const a=e.skipAuthorization?"":sessionStorage.getItem("Authorization");if(e.headers.sessionId=e.skipAuthorization?"":sessionStorage.getItem("sessionId"),e.headers.Authorization=a,!e.debounceKey){const u=e.method==="get"?e.params:e.data;try{e.debounceKey=typeof u=="string"?u:JSON.stringify(u??"")}catch{e.debounceKey=String(u??"")}}const t=e.menuId||v()?.id,s=e.behaviorContext||P(e.behavior);e.behaviorContext=s,e.headers["X-Menu-Id"]=t||"",e.headers["X-Behavior-Id"]=s?.pageViewId||t&&A(t)||"",e.headers["X-Behavior-Page-Id"]=s?.pageViewId||"",e.headers["X-Behavior-Action-Id"]=s?.actionId||"",e.headers["X-Behavior-Request-Id"]=s?.requestId||"",e.headers["X-Behavior-Association"]=s?.associationMode||"PAGE_ONLY";const o=q();e.headers["X-Workflow-Task-Id"]=o.taskId||"",e.headers["X-Workflow-Business-Id"]=o.businessId||"",e.headers["X-Workflow-Proc-Ins-Id"]=o.procInsId||"";const r=sessionStorage.getItem("timeDifference"),l=f(),m=new Date().getTime(),b={timeDifference:r,guid:l,localTime:m};e.headers.replayToken=S.encrypt(JSON.stringify(b))}const g=new Map;i.interceptors.request.use(e=>{if(L(e),e.isAntiShake){const a=e.antiShakeTime,t=`${e.method}-${e.url}-${e.debounceKey}`,s=g.get(t);return s&&s(),new Promise(o=>{const r=setTimeout(()=>{clearTimeout(r),p(e),o(e)},a);g.set(t,()=>{clearTimeout(r)})})}else return p(e),e},e=>(c(e?.config),Promise.resolve(e)));i.interceptors.response.use(async e=>{const{status:a,data:t,config:s}=e;if(c(s),a===200){if(t.code==="0")return Promise.resolve(e);if(t.code=="10508")n=!0;else if(t.code=="10401"&&s.url!=="/api/system/login/refreshToken"&&sessionStorage.getItem("Authorization")&&sessionStorage.getItem("refreshToken")){if(n)return new Promise(o=>{d.push({fn:()=>{o(i(s))},url:s.url})});{n=!0;const o=sessionStorage.getItem("refreshToken"),r=await i.post("/api/system/login/refreshToken",{rToken:o});if(r.data.code==="0"){sessionStorage.setItem("Authorization",r.data.data.token),sessionStorage.setItem("refreshToken",r.data.data.refreshToken);const l=i(s);return d.forEach(m=>{m.fn()}),n=!1,d=[],l}else throw n=!1,d=[],I.warning({showClose:!0,message:"用户信息已过期,请重新登录",grouping:!0}),T(),{code:"10508",msg:"用户信息已过期,请重新登录",url:s.url,config:s}}}else return Promise.resolve(e)}return Promise.resolve(e)},e=>(c(e?.config||e?.response?.config),Promise.reject(e)));const V=e=>{const a=Date.now();return i(e).then(t=>{const s=t.config||e;if(t.status===500)throw{code:t.status+"",msg:t.status+t.statusText,url:e.url,status:t.status,config:s};if(t.status!==200)throw{code:t.status+"",msg:t.status+t.statusText,url:e.url,status:t.status,config:s};if(e.responseType==="blob")return h({config:s,status:t.status,costTime:Date.now()-a}),t;{const o=t.data;if(o.code==="0")return h({config:s,status:t.status,code:o.code,costTime:Date.now()-a}),o.data;throw o.code=="10508"?(I.warning({showClose:!0,message:"用户信息已过期,请重新登录",grouping:!0}),T(),{code:o.code,msg:o.msg,url:e.url,config:s}):{code:o.code,msg:o.msg,url:e.url,status:t.status,config:s}}}).catch(t=>{const s=t?.config||t?.response?.config||e;throw h({config:s,status:t?.status||t?.response?.status,code:t?.code,error:t,costTime:Date.now()-a}),t.msg?t:{code:t.response?.status?t.response.status+"":t.code||"500",msg:t.message||"请求失败",url:e.url}})};export{V as default};
|
|
1
|
+
import y from"axios";import{createUuid as f}from"./uuid.js";import S from"./encrypt.js";import{getCurrentMenu as v,getBehaviorParentId as A,reportApiCall as h}from"./behaviorTrack.js";import{buildRequestContext as P}from"./behaviorContext.js";import{ElMessage as I}from"element-plus";import{frontendBus as C}from"./frontendBus.js";import{notifyGlobalLoading as w}from"./globalLoading.js";import{getWorkflowTaskContext as q}from"./workflowTaskContext.js";import{getGlobalLoadingIgnoredPaths as x}from"../config/GlobalLoadingConfig.js";import"uuid";import"jsencrypt";import"crypto-js/enc-base64";import"crypto-js/enc-utf8";import"./dateTime.js";import"vue";let n=!1;const T=()=>{C.emit("loginAgain")};let d=[];const i=y.create({timeout:6e4,validateStatus(e){return e>=200&&e<500}}),k=e=>{if(e?.skipGlobalLoading===!0)return!1;const a=String(e?.url||"").split(/[?#]/,1)[0];return!x().includes(a)},c=e=>{if(!k(e))return;const a=e?.__globalLoadingId;a&&(w({phase:"finish",id:a}),delete e.__globalLoadingId)},p=e=>{if(!k(e))return;const a=f();e.__globalLoadingId=a,w({phase:"start",id:a})};function L(e){const a=e.skipAuthorization?"":sessionStorage.getItem("Authorization");if(e.headers.sessionId=e.skipAuthorization?"":sessionStorage.getItem("sessionId"),e.headers.Authorization=a,!e.debounceKey){const u=e.method==="get"?e.params:e.data;try{e.debounceKey=typeof u=="string"?u:JSON.stringify(u??"")}catch{e.debounceKey=String(u??"")}}const t=e.menuId||v()?.id,s=e.behaviorContext||P(e.behavior);e.behaviorContext=s,e.headers["X-Menu-Id"]=t||"",e.headers["X-Behavior-Id"]=s?.pageViewId||t&&A(t)||"",e.headers["X-Behavior-Page-Id"]=s?.pageViewId||"",e.headers["X-Behavior-Action-Id"]=s?.actionId||"",e.headers["X-Behavior-Request-Id"]=s?.requestId||"",e.headers["X-Behavior-Association"]=s?.associationMode||"PAGE_ONLY";const o=q();e.headers["X-Workflow-Task-Id"]=o.taskId||"",e.headers["X-Workflow-Business-Id"]=o.businessId||"",e.headers["X-Workflow-Proc-Ins-Id"]=o.procInsId||"";const r=sessionStorage.getItem("timeDifference"),l=f(),m=new Date().getTime(),b={timeDifference:r,guid:l,localTime:m};e.headers.replayToken=S.encrypt(JSON.stringify(b))}const g=new Map;i.interceptors.request.use(e=>{if(L(e),e.isAntiShake){const a=e.antiShakeTime,t=`${e.method}-${e.url}-${e.debounceKey}`,s=g.get(t);return s&&s(),new Promise(o=>{const r=setTimeout(()=>{clearTimeout(r),p(e),o(e)},a);g.set(t,()=>{clearTimeout(r)})})}else return p(e),e},e=>(c(e?.config),Promise.resolve(e)));i.interceptors.response.use(async e=>{const{status:a,data:t,config:s}=e;if(c(s),a===200){if(t.code==="0")return Promise.resolve(e);if(t.code=="10508")n=!0;else if(t.code=="10401"&&s.url!=="/api/system/login/refreshToken"&&sessionStorage.getItem("Authorization")&&sessionStorage.getItem("refreshToken")){if(n)return new Promise(o=>{d.push({fn:()=>{o(i(s))},url:s.url})});{n=!0;const o=sessionStorage.getItem("refreshToken"),r=await i.post("/api/system/login/refreshToken",{rToken:o});if(r.data.code==="0"){sessionStorage.setItem("Authorization",r.data.data.token),sessionStorage.setItem("refreshToken",r.data.data.refreshToken);const l=i(s);return d.forEach(m=>{m.fn()}),n=!1,d=[],l}else throw n=!1,d=[],I.warning({showClose:!0,message:"用户信息已过期,请重新登录",grouping:!0}),T(),{code:"10508",msg:"用户信息已过期,请重新登录",url:s.url,config:s}}}else return Promise.resolve(e)}return Promise.resolve(e)},e=>(c(e?.config||e?.response?.config),Promise.reject(e)));const V=e=>{const a=Date.now();return i(e).then(t=>{const s=t.config||e;if(t.status===500)throw{code:t.status+"",msg:t.status+t.statusText,url:e.url,status:t.status,config:s};if(t.status!==200)throw{code:t.status+"",msg:t.status+t.statusText,url:e.url,status:t.status,config:s};if(e.responseType==="blob")return h({config:s,status:t.status,costTime:Date.now()-a}),t;{const o=t.data;if(o.code==="0")return h({config:s,status:t.status,code:o.code,costTime:Date.now()-a}),o.data;throw o.code=="10508"?(I.warning({showClose:!0,message:"用户信息已过期,请重新登录",grouping:!0}),T(),{code:o.code,msg:o.msg,url:e.url,config:s}):{code:o.code,msg:o.msg,url:e.url,status:t.status,config:s}}}).catch(t=>{const s=t?.config||t?.response?.config||e;throw h({config:s,status:t?.status||t?.response?.status,code:t?.code,error:t,costTime:Date.now()-a}),t.msg?t:{code:t.response?.status?t.response.status+"":t.code||"500",msg:t.message||"请求失败",url:e.url}})};export{V as default};
|
|
@@ -7,6 +7,12 @@ export interface RequestOptions {
|
|
|
7
7
|
logSuccess?: boolean;
|
|
8
8
|
};
|
|
9
9
|
skipBehavior?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* 跳过全局/弹窗请求 loading。
|
|
12
|
+
* 适用于自身已有加载态的内部请求(如附件预览会话:预览区自己有加载层),
|
|
13
|
+
* 避免它们点亮整页 loading 或弹窗/抽屉级 loading。
|
|
14
|
+
*/
|
|
15
|
+
skipGlobalLoading?: boolean;
|
|
10
16
|
}
|
|
11
17
|
declare const _default: {
|
|
12
18
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import r from"./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 A={get(e,i,t=!1,a=500,m){return r({url:e,method:"get",params:this.trimObjectSpaces(i),isAntiShake:t,antiShakeTime:a,menuId:m})},post(e,i,t=!1,a=500,m){return r({url:e,method:"post",data:this.trimObjectSpaces(i),isAntiShake:t,antiShakeTime:a,menuId:m})},getWithOptions(e,i,t={}){return r({url:e,method:"get",params:this.trimObjectSpaces(i),isAntiShake:t.isAntiShake||!1,antiShakeTime:t.antiShakeTime||500,menuId:t.menuId,behavior:t.behavior,skipBehavior:t.skipBehavior})},postWithOptions(e,i,t={}){return r({url:e,method:"post",data:this.trimObjectSpaces(i),isAntiShake:t.isAntiShake||!1,antiShakeTime:t.antiShakeTime||500,menuId:t.menuId,behavior:t.behavior,skipBehavior:t.skipBehavior})},trimObjectSpaces(e){if(typeof e!="object"||e===null)return e;for(const i in e)if(e.hasOwnProperty(i)){const t=e[i];typeof t=="string"?e[i]=t.trim():typeof t=="object"&&this.trimObjectSpaces(t)}return e}};export{A as default};
|
|
1
|
+
import r from"./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 A={get(e,i,t=!1,a=500,m){return r({url:e,method:"get",params:this.trimObjectSpaces(i),isAntiShake:t,antiShakeTime:a,menuId:m})},post(e,i,t=!1,a=500,m){return r({url:e,method:"post",data:this.trimObjectSpaces(i),isAntiShake:t,antiShakeTime:a,menuId:m})},getWithOptions(e,i,t={}){return r({url:e,method:"get",params:this.trimObjectSpaces(i),isAntiShake:t.isAntiShake||!1,antiShakeTime:t.antiShakeTime||500,menuId:t.menuId,behavior:t.behavior,skipBehavior:t.skipBehavior,skipGlobalLoading:t.skipGlobalLoading})},postWithOptions(e,i,t={}){return r({url:e,method:"post",data:this.trimObjectSpaces(i),isAntiShake:t.isAntiShake||!1,antiShakeTime:t.antiShakeTime||500,menuId:t.menuId,behavior:t.behavior,skipBehavior:t.skipBehavior,skipGlobalLoading:t.skipGlobalLoading})},trimObjectSpaces(e){if(typeof e!="object"||e===null)return e;for(const i in e)if(e.hasOwnProperty(i)){const t=e[i];typeof t=="string"?e[i]=t.trim():typeof t=="object"&&this.trimObjectSpaces(t)}return e}};export{A as default};
|