adtec-hnyzfc-core-package 1.5.7 → 1.5.8
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 +1 @@
|
|
|
1
|
-
import{defineComponent as Q,ref as g,useModel as X,computed as Y,onMounted as Z,watch as _,resolveComponent as F,openBlock as s,createElementBlock as $,createVNode as ee,withCtx as u,renderSlot as P,createBlock as m,createTextVNode as f,toDisplayString as v,createCommentVNode as d,unref as te,Fragment as ae,mergeModels as q}from"vue";import
|
|
1
|
+
import{defineComponent as Q,ref as g,useModel as X,computed as Y,onMounted as Z,watch as _,resolveComponent as F,openBlock as s,createElementBlock as $,createVNode as ee,withCtx as u,renderSlot as P,createBlock as m,createTextVNode as f,toDisplayString as v,createCommentVNode as d,unref as te,Fragment as ae,mergeModels as q}from"vue";import B from"../../api/workflow/workflowInstApi.js";import oe from"./components/SelectAssigneeDialog.vue.js";import{_ as re}from"../../../chunks/AddOrMinusMultiDialog.vue_vue_type_script_setup_true_lang-SYw6MXOl.js";import ne from"./components/CheckDialog.vue.js";import L from"../../utils/FrameworkUtils.js";import{userInfoStore as y}from"../../stores/userInfoStore.js";import{frontendBus as h}from"../../utils/frontendBus.js";import{showTodoDialog as ie}from"../../hooks/workflowTodo.js";import{_ as le}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"element-plus";import"../../utils/globalLoading.js";import"../../utils/workflowTaskContext.js";import"../../config/GlobalLoadingConfig.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"xlsx-js-style";import"../../api/SysUserApi.js";import"../bpmntree/components/UserSelector/UserTag.vue.js";import"../upload/CustomElUpload.vue.js";import"@element-plus/icons-vue";import"../../hooks/useFileView.js";import"../../api/DocumentApi.js";import"../../hooks/useDeleteConfirmHooks.js";import"../../hooks/useBehaviorAction.js";import"../../utils/uploadAccept.js";import"../../utils/buildUploadHeaders.js";import"pinia";import"../../utils/userSessionStorage.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 se=Q({__name:"TaskOperation",props:q({taskId:{type:String,required:!1},showProcessBtn:{type:Boolean,required:!1,default:!1},params:{type:Object,required:!1},taskInfo:{type:Object,required:!1},showOperationsBtn:{type:Boolean,required:!1,default:!0},showCurWorkBth:{type:Boolean,required:!1,default:!0},onProcessDetail:{type:Function,required:!1},renderDialog:{type:Function,required:!1}},{butLoading:{type:Boolean,default:!1},butLoadingModifiers:{}}),emits:q(["success"],["update:butLoading"]),setup(o,{expose:A,emit:E}){const N=y(),T=g(null),n=o,i=X(o,"butLoading"),b=E,e=g({taskId:"",comment:""}),D=n.renderDialog,k=(t,a,r,w,p,J)=>{if(!D){console.warn("[TaskOperation] 未注入 renderDialog,无法打开操作弹窗(请通过 props 传入 useDialogHooks 的 render)");return}D(t,a,r,w,p,J)},R=()=>{typeof n.onProcessDetail=="function"&&n.onProcessDetail(e.value)},I=Y(()=>e.value?.operations==="assignee"),O=g(""),U=g([{source:"edit"}]),K=async()=>{await ie(g(e.value),U)},c=async t=>{if(t&&(O.value=t),!e.value)return;let a=!1;if(t==="complete"&&n.params?.beforeCompleteFunction)try{const r=await n.params?.beforeCompleteFunction({taskId:e.value.taskId,userId:y().getUserInfo.userCode,comment:"同意。",procInsId:e.value.procInsId,procDefKey:e.value.procDefKey});if(r===!1)return;r?.readonly&&(a=!0),e.value={...e.value,...r}}catch{return}if(t==="addMulti"||t==="minusMulti")k(re,{taskId:e.value.taskId,dialogType:t,renderDialog:k,onSuccess:C},{title:t==="addMulti"?"加签":"减签",size:"400px"},"dialog");else if(t==="assignee")M(e.value.taskId);else{if(e.value.variables,t==="complete"&&e.value.firstSubmitNode&&n.params?.ignoreConfirm){await j();return}k(ne,{taskVo:e.value,dialogType:t,taskOperate:n?.params,commentReadonly:a,renderDialog:k,onOpenAssignee:M,onSuccess:C},{title:V(t),size:"480px",closeOnClickModal:!1},"dialog")}},V=t=>{switch(t){case"complete":return"流程审批";case"refuse":return"终止审批";case"back":return"驳回审批";case"transfer":return"转办审批";default:return"流程审批"}},j=async()=>{if(!(!e.value||!y().getUserInfo.userCode))try{i.value=!0;const t={taskId:e.value.taskId,userId:y().getUserInfo.userCode,comment:e.value.comment??"",procInsId:e.value.procInsId,procDefKey:e.value.procDefKey,variables:e.value.variables};if(n.params?.completeFunction){const a=await n.params?.completeFunction(t);a&&a?.taskId?e.value=a:e.value=await B.getTaskInst(e.value.taskId)}else e.value=await B.taskComplete(t);C(e.value)}catch(t){L.messageError(t)}finally{i.value=!1}},z=()=>{n.params?.workflowComplete(),b("success")},M=t=>{k(oe,{taskId:t,onSuccess:z},{title:"指定执行人",size:"450px"},"dialog")},C=t=>{t&&(e.value=t),n.params?.workflowComplete(e.value,O.value),h.emit("todoRefresh"),h.emit("homePageRefresh"),b("success")},S=(t,a)=>t?t.classList?.contains(a)?t:S(t.parentElement,a):null,W=()=>{const t=S(T.value,"todo-dialog-class");return t?console.log("找到满足条件的元素:",t):console.log("未找到满足条件的元素"),t};Z(()=>{W(),x()});const l=g(!1),H=async()=>{l.value=!0},G=()=>{l.value=!1},x=async()=>{if(n.taskInfo)e.value=n.taskInfo,e.value.finishTime&&console.log("该待办已完成!");else if(n.taskId)try{H(),e.value=await B.getTaskInst(n.taskId),e.value.finishTime&&console.log("该待办已完成!")}catch(t){L.messageError(t)}finally{G()}};return A({reload:()=>{x()}}),_(()=>n.taskId,x),(t,a)=>{const r=F("el-button"),w=F("el-flex");return s(),$("div",{ref_key:"taskFlexRef",ref:T,class:"task-operation"},[ee(w,{align:"center",justify:"flex-end"},{default:u(()=>[P(t.$slots,"left",{},void 0,!0),o.params?.cancelBtnText!==""?(s(),m(r,{key:0,loading:i.value||l.value,onClick:o.params?.cancelFunction},{default:u(()=>[f(v(o.params?.cancelBtnText??"取消"),1)]),_:1},8,["loading","onClick"])):d("v-if",!0),o.showProcessBtn&&e.value?.procInsId?(s(),m(r,{key:1,type:"info",loading:i.value||l.value,onClick:R},{default:u(()=>[...a[7]||(a[7]=[f(" 流程信息 ",-1)])]),_:1},8,["loading"])):d("v-if",!0),!I.value&&e.value?.taskId&&o.showCurWorkBth&&!o.showOperationsBtn?(s(),m(r,{key:2,loading:i.value||l.value,type:"warning",disabled:e.value?.taskId&&(!e.value?.operations||te(N).getUserInfo.userCode!==e.value?.assigneeId),onClick:K},{default:u(()=>[f(v(e.value.taskName),1)]),_:1},8,["loading","disabled"])):d("v-if",!0),I.value?(s(),m(r,{key:3,type:"primary",loading:i.value||l.value,onClick:a[0]||(a[0]=p=>c("assignee"))},{default:u(()=>[...a[8]||(a[8]=[f("指定执行人 ",-1)])]),_:1},8,["loading"])):d("v-if",!0),!I.value&&e.value?.taskId&&e.value?.operations&&o.showOperationsBtn?(s(),$(ae,{key:4},[o.params?.saveBtnText?(s(),m(r,{key:0,loading:i.value||l.value,type:"primary",onClick:o.params?.saveFunction},{default:u(()=>[f(v(o.params?.saveBtnText),1)]),_:1},8,["loading","onClick"])):d("v-if",!0),e.value?.operations.indexOf("addMulti")>-1?(s(),m(r,{key:1,type:"warning",loading:i.value||l.value,onClick:a[1]||(a[1]=p=>c("addMulti"))},{default:u(()=>[...a[9]||(a[9]=[f("加签 ",-1)])]),_:1},8,["loading"])):d("v-if",!0),e.value?.operations.indexOf("minusMulti")>-1?(s(),m(r,{key:2,type:"danger",loading:i.value||l.value,onClick:a[2]||(a[2]=p=>c("minusMulti"))},{default:u(()=>[...a[10]||(a[10]=[f("减签 ",-1)])]),_:1},8,["loading"])):d("v-if",!0),e.value?.operations.indexOf("refuse")>-1&&o.params?.refuseBtnText!==""?(s(),m(r,{key:3,loading:i.value||l.value,type:"danger",onClick:a[3]||(a[3]=p=>c("refuse"))},{default:u(()=>[f(v(o.params?.refuseBtnText??"终止"),1)]),_:1},8,["loading"])):d("v-if",!0),e.value?.operations.indexOf("transfer")>-1&&o.params?.transferBtnText!==""?(s(),m(r,{key:4,loading:i.value||l.value,type:"warning",onClick:a[4]||(a[4]=p=>c("transfer"))},{default:u(()=>[f(v(o.params?.transferBtnText??"转办"),1)]),_:1},8,["loading"])):d("v-if",!0),e.value?.operations.indexOf("back")>-1&&o.params?.backBtnText!==""?(s(),m(r,{key:5,loading:i.value||l.value,type:"danger",onClick:a[5]||(a[5]=p=>c("back"))},{default:u(()=>[f(v(o.params?.backBtnText??"驳回"),1)]),_:1},8,["loading"])):d("v-if",!0),e.value?.operations.indexOf("complete")>-1&&o.params?.completeBtnText!==""?(s(),m(r,{key:6,loading:i.value||l.value,type:"primary",onClick:a[6]||(a[6]=p=>c("complete"))},{default:u(()=>[f(v(o.params?.completeBtnText??"同意"),1)]),_:1},8,["loading"])):d("v-if",!0)],64)):d("v-if",!0),P(t.$slots,"right",{},void 0,!0)]),_:3})],512)}}}),mt=le(se,[["__scopeId","data-v-dac4939f"]]);export{mt as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{computed as B,ref as
|
|
2
|
-
/* dialog-hooks
|
|
1
|
+
import{computed as B,ref as x,unref as w,createApp as ro,nextTick as ao,h as n}from"vue";import so,{ElDrawer as no,ElDialog as co,ElButton as T}from"element-plus";import R from"../stores/storeConfig.js";/* empty css */import*as $ from"@element-plus/icons-vue";import"../config/ElementPlusConfig.js";import{installVxeGrid as ho}from"../config/VxeTableConfig.js";import go from"element-plus/es/locale/lang/zh-cn";import po from"./useListenerHooks.js";import{permissionStore as uo}from"../stores/permissionStore.js";import bo from"../components/icon/ElIcons.vue.js";import mo from"../components/ElDialogBody/ElDialogBody.vue.js";import fo from"crypto-js/enc-base64";import ko from"crypto-js/enc-utf8";import{frontendBus as D}from"../utils/frontendBus.js";import{GLOBAL_LOADING_EVENT as H,notifyDialogLoadingScope as _o}from"../utils/globalLoading.js";import yo 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 vo={},xo="subAppModalOverlay",E="adtec-subapp-modal-open";let U=0;const u=[],_=new Map;let I=!1;const P=new WeakSet,wo=()=>{for(let o=u.length-1;o>=0;o--)if(u[o].open.value)return u[o]},j=o=>{if(!o?.id)return;if(o.phase==="start"){const l=wo();if(!l)return;_.set(o.id,l),l.requestLoadingIds.add(o.id),l.requestLoading.value=!0;return}const e=_.get(o.id);e&&(_.delete(o.id),e.requestLoadingIds.delete(o.id),e.requestLoading.value=e.requestLoadingIds.size>0)},Eo=o=>{u.push(o),!I&&(D.on(H,j),I=!0)},Io=o=>{const e=u.indexOf(o);e>-1&&u.splice(e,1),o.requestLoadingIds.forEach(l=>_.delete(l)),o.requestLoadingIds.clear(),o.requestLoading.value=!1,!(u.length>0||!I)&&(D.off(H,j),I=!1,_.clear())},Lo=o=>{const e=vo||{};return o.applicationModule||e.VITE_APPLICATION_MODULE||e.VITE_APP_MODULE||String(o.router.currentRoute.value.meta.applicationModule||"")},q=(o,e,l)=>{if(typeof window>"u"||!window.__POWERED_BY_WUJIE__)return;const i=Lo(o);if(!i||(l&&!e.overlayId&&(e.overlayId=`${i}-${Date.now()}-${++U}`),!e.overlayId))return;const c={applicationModule:i,overlayId:e.overlayId,open:l};D.emit(xo,c),l||(e.overlayId=void 0)},z=(o,e)=>{e&&!o.overlayId&&(o.overlayId=`dialog-${Date.now()}-${++U}`),o.overlayId&&_o({id:o.overlayId,open:e})};function So(){const e="dialog-hooks-styles",l=document.getElementById(e);if(l&&(l.textContent||"").includes("/* dialog-hooks v20 */"))return;l?.remove();const i=document.createElement("style");i.id=e,i.type="text/css",i.innerHTML=`
|
|
2
|
+
/* dialog-hooks v20 */
|
|
3
3
|
/* 抽屉组件 - 无滚动条样式 */
|
|
4
4
|
.dialog-hooks-no-scroll.el-drawer .el-drawer__body {
|
|
5
5
|
overflow: hidden !important;
|
|
@@ -74,46 +74,77 @@ import{computed as B,ref as v,unref as w,createApp as lo,nextTick as io,h as n}f
|
|
|
74
74
|
.dialog-hooks-host.el-drawer .el-drawer__body .el-title {
|
|
75
75
|
padding-right: 0;
|
|
76
76
|
}
|
|
77
|
-
/*
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
77
|
+
/* 弹窗/抽屉内容滚动条:滚动条槽位占满弹窗/抽屉右侧 8px 内边距(贴边),
|
|
78
|
+
但滑块用 2px 透明边框 + background-clip 收成 4px,两侧各留 2px 空隙——
|
|
79
|
+
否则滑块会紧贴内容块右 border,看起来和内容连在一起。平时透明、滚动或悬停时显示。
|
|
80
|
+
业务内容根节点自带 overflow: auto(el-flex 的默认值,如创建任务书抽屉)时,
|
|
81
|
+
滚动条长在内容层的直接子节点上,所以子节点也一并覆盖,否则它会退回全局 8px 常显滚动条。
|
|
82
|
+
注意:Chromium 只要看到 scrollbar-width/scrollbar-color 非 auto,就会丢弃
|
|
83
|
+
::-webkit-scrollbar 定制,退回系统原生 thin(约 11px)或 macOS 覆盖式滚动条——
|
|
84
|
+
于是滚动条变粗,且覆盖式滚动条实测占位是 0,下面 --dialog-hooks-scrollbar 的右侧补偿
|
|
85
|
+
失效,滚动条会压在内容右侧、看起来左右边距不等(“人员详情”细、“创建任务书”粗的根因)。
|
|
86
|
+
所以 scrollbar-width/scrollbar-color 只留给不支持 ::-webkit-scrollbar 的浏览器(Firefox),
|
|
87
|
+
Chromium 走下面 6px 的经典滚动条:占位宽度稳定为 6px,配合实测补偿把滚动条
|
|
88
|
+
落进弹窗/抽屉右侧 8px 内边距里,左右边距一致。 */
|
|
89
|
+
@supports not selector(::-webkit-scrollbar) {
|
|
90
|
+
.dialog-hooks-host .el-drawer__body,
|
|
91
|
+
.dialog-hooks-host .el-dialog__body,
|
|
92
|
+
.dialog-hooks-host .el-dialog-body__content,
|
|
93
|
+
.dialog-hooks-host .el-dialog-body__content > * {
|
|
94
|
+
scrollbar-width: thin;
|
|
95
|
+
scrollbar-color: transparent transparent;
|
|
96
|
+
}
|
|
87
97
|
}
|
|
88
98
|
.dialog-hooks-host .el-drawer__body::-webkit-scrollbar,
|
|
89
99
|
.dialog-hooks-host .el-dialog__body::-webkit-scrollbar,
|
|
90
|
-
.dialog-hooks-host .el-dialog-body__content::-webkit-scrollbar
|
|
91
|
-
|
|
92
|
-
|
|
100
|
+
.dialog-hooks-host .el-dialog-body__content::-webkit-scrollbar,
|
|
101
|
+
.dialog-hooks-host .el-dialog-body__content > *:not([class*='vxe']):not([class*='umo'])::-webkit-scrollbar {
|
|
102
|
+
/* 与全局 *::-webkit-scrollbar 一致:-webkit-appearance: none 才切换为经典滚动条,
|
|
103
|
+
否则 macOS 的覆盖式细滚动条会忽略 width,占位宽度变成 0 */
|
|
104
|
+
-webkit-appearance: none;
|
|
105
|
+
appearance: none;
|
|
106
|
+
width: var(--adtec-scrollbar-size, 8px);
|
|
107
|
+
height: var(--adtec-scrollbar-size, 8px);
|
|
108
|
+
background: transparent;
|
|
93
109
|
}
|
|
94
110
|
.dialog-hooks-host .el-drawer__body::-webkit-scrollbar-thumb,
|
|
95
111
|
.dialog-hooks-host .el-dialog__body::-webkit-scrollbar-thumb,
|
|
96
|
-
.dialog-hooks-host .el-dialog-body__content::-webkit-scrollbar-thumb
|
|
97
|
-
|
|
98
|
-
|
|
112
|
+
.dialog-hooks-host .el-dialog-body__content::-webkit-scrollbar-thumb,
|
|
113
|
+
.dialog-hooks-host .el-dialog-body__content > *:not([class*='vxe']):not([class*='umo'])::-webkit-scrollbar-thumb {
|
|
114
|
+
/* 2px 透明边框 + padding-box 裁剪:8px 槽位里只画出 4px 滑块,与内容 border 留出空隙 */
|
|
115
|
+
background-color: transparent;
|
|
116
|
+
border: 2px solid transparent;
|
|
117
|
+
background-clip: padding-box;
|
|
118
|
+
border-radius: 4px;
|
|
99
119
|
}
|
|
100
120
|
/* Chrome 不会因为滚动容器自身的 :hover 重绘滚动条,
|
|
101
121
|
必须由父级弹窗/抽屉(.dialog-hooks-host)的 :hover 触发(与 vxe 表格同一写法) */
|
|
102
122
|
.dialog-hooks-host:hover .el-drawer__body::-webkit-scrollbar-thumb,
|
|
103
123
|
.dialog-hooks-host:hover .el-dialog__body::-webkit-scrollbar-thumb,
|
|
104
124
|
.dialog-hooks-host:hover .el-dialog-body__content::-webkit-scrollbar-thumb,
|
|
125
|
+
.dialog-hooks-host:hover
|
|
126
|
+
.el-dialog-body__content
|
|
127
|
+
> *:not([class*='vxe']):not([class*='umo'])::-webkit-scrollbar-thumb,
|
|
105
128
|
.dialog-hooks-host .el-drawer__body.is-scrolling::-webkit-scrollbar-thumb,
|
|
106
129
|
.dialog-hooks-host .el-dialog__body.is-scrolling::-webkit-scrollbar-thumb,
|
|
107
|
-
.dialog-hooks-host .el-dialog-body__content.is-scrolling::-webkit-scrollbar-thumb
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
130
|
+
.dialog-hooks-host .el-dialog-body__content.is-scrolling::-webkit-scrollbar-thumb,
|
|
131
|
+
.dialog-hooks-host
|
|
132
|
+
.el-dialog-body__content
|
|
133
|
+
> *:not([class*='vxe']):not([class*='umo']).is-scrolling::-webkit-scrollbar-thumb {
|
|
134
|
+
background-color: rgba(144, 147, 153, 0.4);
|
|
135
|
+
}
|
|
136
|
+
/* 同上:只有 Firefox 这类没有 ::-webkit-scrollbar 的浏览器才需要 scrollbar-color 兜底 */
|
|
137
|
+
@supports not selector(::-webkit-scrollbar) {
|
|
138
|
+
.dialog-hooks-host:hover .el-drawer__body,
|
|
139
|
+
.dialog-hooks-host:hover .el-dialog__body,
|
|
140
|
+
.dialog-hooks-host:hover .el-dialog-body__content,
|
|
141
|
+
.dialog-hooks-host:hover .el-dialog-body__content > *,
|
|
142
|
+
.dialog-hooks-host .el-drawer__body.is-scrolling,
|
|
143
|
+
.dialog-hooks-host .el-dialog__body.is-scrolling,
|
|
144
|
+
.dialog-hooks-host .el-dialog-body__content.is-scrolling,
|
|
145
|
+
.dialog-hooks-host .el-dialog-body__content > *.is-scrolling {
|
|
146
|
+
scrollbar-color: rgba(144, 147, 153, 0.4) transparent;
|
|
147
|
+
}
|
|
117
148
|
}
|
|
118
149
|
/* 滚动条当右侧内边距用:内容区的滚动条落在弹窗/抽屉右侧 8px 内边距里,左右边距一致。
|
|
119
150
|
滚动条占位宽度由 syncDialogScrollbarOffset 实测后写入 --dialog-hooks-scrollbar
|
|
@@ -231,14 +262,14 @@ import{computed as B,ref as v,unref as w,createApp as lo,nextTick as io,h as n}f
|
|
|
231
262
|
|
|
232
263
|
/* 非当前子应用被宿主提升以显示弹窗时,仅隐藏其页面壳;是否添加该状态类
|
|
233
264
|
由宿主根据当前路由判断,当前子应用自己的页面始终保留在遮罩下方。 */
|
|
234
|
-
html.${
|
|
265
|
+
html.${E} #app > .subapp-main {
|
|
235
266
|
visibility: hidden !important;
|
|
236
267
|
pointer-events: none !important;
|
|
237
268
|
}
|
|
238
|
-
html.${
|
|
239
|
-
html.${
|
|
240
|
-
html.${
|
|
269
|
+
html.${E},
|
|
270
|
+
html.${E} body,
|
|
271
|
+
html.${E} #app {
|
|
241
272
|
background: transparent !important;
|
|
242
273
|
background-color: transparent !important;
|
|
243
274
|
}
|
|
244
|
-
`,document.head.appendChild(
|
|
275
|
+
`,document.head.appendChild(i)}function W(o){const e=[];return o.querySelectorAll(".el-dialog-body__content").forEach(l=>{e.push({owner:l,targets:[l,...l.querySelectorAll(":scope > *")]})}),o.querySelectorAll(".el-drawer__body, .el-dialog__body").forEach(l=>{e.push({owner:l,targets:[l]})}),e}const N=new WeakSet;function Co(o){W(o).forEach(({targets:e})=>{e.forEach(l=>{N.has(l)||(N.add(l),Do(l))})})}function Do(o){let e;const l=()=>{o.classList.add("is-scrolling"),e&&window.clearTimeout(e),e=window.setTimeout(()=>o.classList.remove("is-scrolling"),600)};o.addEventListener("scroll",l,{passive:!0}),o.addEventListener("mouseenter",l),o.addEventListener("mouseleave",()=>{e&&window.clearTimeout(e),o.classList.remove("is-scrolling")})}function V(o){W(o).forEach(({owner:e,targets:l})=>{let i;const c=()=>{if(!e.isConnected){i?.disconnect();return}const f=Math.max(0,...l.map(y=>y.offsetWidth-y.clientWidth));e.style.setProperty("--dialog-hooks-scrollbar",`${f}px`)};typeof ResizeObserver<"u"&&!P.has(e)&&(P.add(e),i=new ResizeObserver(c),l.forEach(f=>i.observe(f))),c()})}function Oo(o,e,l){return o===!1?{enabled:!1,scroll:l,class:void 0,contentClass:void 0}:o===!0||o===void 0?{enabled:o===!0?!0:e,scroll:l,class:void 0,contentClass:void 0}:{enabled:o.enabled??e,scroll:o.scroll??l,class:o.class,contentClass:o.contentClass}}function Ao(o,e){if(e)return e;try{const l=o.router.currentRoute.value.meta?.sysMenuData?.icon;if(l)return l}catch{}try{const l=sessionStorage.getItem("permissionStore");if(l){const i=JSON.parse(fo.parse(l).toString(ko));if(i?.activeMenuInfo?.icon)return i.activeMenuInfo.icon}}catch{}try{return uo(R).getActiveMenuInfo?.icon||""}catch{return""}}function Ce(o){return function(l){const i=[],c=()=>i[i.length-1],f=a=>{const r=w(a?.data),k=w(a?.row),v=w(a?.formData),p=a?.id??a?.taskId??a?.selectedId??r?.id??k?.id??v?.id;return p==null||p===""?"":String(p)},y=(a,r,k,v="drawer",p,J=!0)=>{So();const{icon:Q,hideConfirm:L,hideFooter:X,dialogBody:Z,...d}=k||{},m=Oo(Z,o.defaultDialogBody??!0,J),oo=`${v}|${typeof a=="string"?a:a?.__name||a?.name||""}|${d.title||""}|${f(r)}`,O=x(!1),A=x(!1),t={open:x(!0),loading:B(()=>O.value||A.value),manualLoading:O,requestLoading:A,requestLoadingIds:new Set,childInstance:x(),app:null,div:null,closing:!1,renderKey:oo,actionName:d.title||"确认"},eo=Object.fromEntries(Object.entries(r||{}).map(([s,g])=>[s,w(g)])),lo={...d,class:["dialog-hooks-host",...m.enabled?["dialog-hooks-body-contained"]:[],...m.scroll?[]:["dialog-hooks-no-scroll"],"dialog-hooks-scroll-auto",...Array.isArray(d.class)?d.class:d.class?[d.class]:[]]},to=d.onClosed,S=typeof d.title=="string"&&d.title,M=S?Ao(o,Q):"",io=()=>n("div",{class:"dialog-hooks-header"},[M?n("div",{class:"dialog-hooks-header-icon"},[n(bo,{modelValue:M})]):null,n("div",{class:"dialog-hooks-header-title"},[d.title]),t.loading.value&&!L?null:n("button",{type:"button",class:"dialog-hooks-header-close",onClick:()=>b(t)},[n($.Close)])]),h=ro(()=>n(v==="drawer"?no:co,{...lo,modelValue:t.open.value,showClose:S?!1:d.showClose??!0,onClosed(){z(t,!1),q(o,t,!1),Io(t),to?.();const s=i.indexOf(t);s>-1&&i.splice(s,1),t.app?.unmount(),t.div?.parentNode&&t.div.parentNode.removeChild(t.div),t.app=null,t.div=null},onClose(){b(t)}},{...S?{header:io}:{},default:()=>{const s=n(a,{...eo,loading:t.loading.value,"onUpdate:loading":g=>{t.manualLoading.value=g},ref:t.childInstance});return m.enabled?n(mo,{scroll:m.scroll,class:m.class,contentClass:m.contentClass},{default:()=>s}):s},...X?{}:{footer:()=>{if(p&&p.length){const s=p.map(g=>typeof g=="function"?g():g);return n("div",{className:"dialog-footer"},s)}return n("div",{className:"dialog-footer"},[n(T,{onClick:()=>b(t),loading:!L&&t.loading.value},"取 消"),L?null:n(T,{type:"primary",onClick:()=>Y(t),loading:t.loading.value},"确 认")])}}}));o.plugins?.forEach(s=>h.use(s)),h.use(so,{locale:go}),h.use(R),h.use(o.router);for(const[s,g]of Object.entries($))h.component(s,g);ho(h),o.setupApp?.(h);const C=document.createElement("div");return document.body.appendChild(C),t.app=h,t.div=C,i.push(t),Eo(t),z(t,!0),q(o,t,!0),h.mount(C),ao(()=>{Co(document.body),V(document.body),t.childInstance.value?.resetQuery?.(),setTimeout(()=>{V(document.body),window.dispatchEvent(new Event("resize"))},350)}),po(),{cancel:()=>b(t)}},Y=async a=>{const r=a||c();if(!r)return;const{runBehaviorAction:k}=yo();await k({code:`dialog:${r.renderKey}:confirm`,name:r.actionName||"确认",actionType:"SUBMIT"},async()=>{try{r.manualLoading.value=!0,await r.childInstance.value?.confirm?.(),l&&b(r)}finally{r.manualLoading.value=!1}})},b=a=>{const r=a||c();!r||!r.open.value||(r.closing=!0,r.open.value=!1)},G=a=>{const r=c();r&&(r.manualLoading.value=a)},F=()=>c()?.loading.value??!1,K=B(()=>c()?.childInstance.value);return{render:y,cancel:b,setLoading:G,getLoading:F,instance:K}}}export{Ce as createDialogHooks,Ce as default};
|