adtec-hnyzfc-core-package 1.5.8 → 1.5.9
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.
|
@@ -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};
|