@sunny-base-web/effects 0.8.93 → 0.8.94
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/index.js +1 -1
- package/dist/index.mjs +89 -89
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<strong>${o("jobinfo.title")}:</strong>${T.title}<br/>
|
|
4
4
|
<strong>${o("jobinfo.registerType")}:</strong>${T.addressType==="0"?o("jobinfo.autoRegister"):o("jobinfo.manualEntry")}<br/>
|
|
5
5
|
<strong>${o("jobinfo.onlineAddress")}:</strong>${T.addressList||""}<br/>
|
|
6
|
-
</div>`,dangerouslyUseHTMLString:!0})}}catch(N){console.error("查询注册节点失败:",N),S.Message.error(o("jobinfo.queryFailed"))}break;case"jobinfo/rizhi":window.location.href=`/setting/dsrw/joblog?jobGroup=${w.jobGroup}&jobDesc=${encodeURIComponent(w.jobDesc)}`;break}},R=()=>{h.value?.refresh()};return(C,w)=>(e.openBlock(),e.createElementBlock("div",{class:"job-info-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:w[3]||(w[3]=e.withKeys((...V)=>e.unref(y)&&e.unref(y)(...V),["enter"])),tabindex:"-1"},[e.createElementVNode("div",hi,[e.createElementVNode("div",gi,[e.createVNode(e.unref(c))]),e.createElementVNode("div",bi,[e.createVNode(e.unref(u),{class:"flex-1"},{actionSlot:e.withCtx(({row:V})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M(),N=>(e.openBlock(),e.createElementBlock("button",{key:N.id,type:"button",class:"text-[rgb(var(--primary-6))] hover:text-[rgb(var(--primary-5))] mr-2",onClick:T=>P(N,V)},e.toDisplayString(N.label),9,vi))),128))]),_:1})])]),e.createVNode(ri,{ref_key:"formRef",ref:i,visible:l.value,"onUpdate:visible":w[0]||(w[0]=V=>l.value=V),onSuccess:R},null,8,["visible"]),e.createVNode(ai,{ref_key:"onceRef",ref:f,visible:s.value,"onUpdate:visible":w[1]||(w[1]=V=>s.value=V),onSuccess:R},null,8,["visible"]),e.createVNode(fi,{ref_key:"codeRef",ref:m,visible:a.value,"onUpdate:visible":w[2]||(w[2]=V=>a.value=V),onSuccess:R},null,8,["visible"])],32))}}),Ci=re(yi,[["__scopeId","data-v-73ae3969"]]),jt=({t})=>{const o=[{cKeyname:t("joblog.success"),cKeynumb:"200"},{cKeyname:t("joblog.failure"),cKeynumb:"500"},{cKeyname:t("joblog.empty"),cKeynumb:"0"}],r=[{cKeyname:t("joblog.success"),cKeynumb:"200"},{cKeyname:t("joblog.failure"),cKeynumb:"500"},{cKeyname:t("joblog.failureTimeout"),cKeynumb:"502"}],n=[{fieldName:"jobGroup",label:t("joblog.executor"),component:"Select",componentProps:{placeholder:t("joblog.selectExecutor"),allowClear:!0,options:[]},colProps:{span:4}},{fieldName:"jobDesc",label:t("joblog.jobDesc"),component:"Input",componentProps:{placeholder:t("joblog.inputJobDesc"),allowClear:!0},colProps:{span:4}},{fieldName:"triggerStatus",label:t("joblog.status"),component:"Select",componentProps:{placeholder:t("joblog.selectStatus"),allowClear:!0,options:[{label:t("joblog.all"),value:"-1"},{label:t("joblog.success"),value:"1"},{label:t("joblog.failure"),value:"2"},{label:t("joblog.running"),value:"3"}]},colProps:{span:4}},{fieldName:"timeList",label:t("joblog.scheduleDate"),component:"RangePicker",componentProps:{allowClear:!0,format:"YYYY-MM-DD",valueFormat:"YYYY-MM-DD"},colProps:{span:4}}],l=[{field:"jobld",title:t("joblog.jobId")},{field:"jobDesc",title:t("joblog.jobDesc")},{field:"triggerCode",title:t("joblog.scheduleResult"),formatter:({cellValue:s})=>o.find(i=>i.cKeynumb===s)?.cKeyname||s},{field:"triggerTime",title:t("joblog.scheduleTime")},{field:"executorAddress",title:t("joblog.executorAddress")},{field:"executorHandler",title:t("joblog.executorHandler")},{field:"executorParam",title:t("joblog.executorParam")},{field:"handleDdbz",title:t("joblog.scheduleRemark"),slots:{default:"handleDdbzSlot"}},{field:"handleTime",title:t("joblog.handleTime")},{field:"handleCode",title:t("joblog.handleResult"),formatter:({cellValue:s})=>r.find(i=>i.cKeynumb===s)?.cKeyname||s},{field:"handleMsg",title:t("joblog.handleMsg"),slots:{default:"handleMsgSlot"}},{field:"handleZxrz",title:t("joblog.handleLog"),slots:{default:"handleZxrzSlot"}}];return{searchFormSchema:n,tableColumns:l,triggerCodeOptions:o,handleCodeOptions:r}},xi={resourceId:"joblog",nResourceid:583,cModnumb:"9aad5aa1-14be-4c03-934d-e9e6722cdd4f"},ki={class:"bg-[#2b2b2b] inline-block text-center w-[40px] mr-2.5 select-none"},wi={class:"inline-block whitespace-nowrap mr-2.5"},Si={class:"absolute right-2.5 bottom-2.5 flex items-end flex-wrap flex-col h-[160px] justify-evenly"},Ni=e.defineComponent({__name:"LogList",props:{visible:{type:Boolean}},emits:["update:visible"],setup(t,{expose:o,emit:r}){const{t:n}=Y.useI18n(),l=r,s=e.ref(!1),a=e.ref([]),i=e.ref(""),f=e.ref(!1),m=e.ref(null),b=async u=>{i.value=u,a.value=[];try{const h=await I.post("/schedule/joblog/logDetail",{fromLineNum:0,id:u});h.success&&h.data&&(a.value=h.data.content?.logContentList||[],l("update:visible",!0),e.nextTick(()=>{m.value&&(m.value.scrollTop=m.value.scrollHeight)}))}catch(h){console.error("获取日志失败:",h)}},p=()=>{m.value&&(m.value.scrollTop=0)},c=async()=>{f.value=!0;try{const u=await I.post("/schedule/joblog/logDetail",{fromLineNum:a.value.length+1,id:i.value});if(u.success&&u.data){const h=u.data.content?.logContentList||[];a.value=a.value.concat(h),e.nextTick(()=>{m.value&&(m.value.scrollTop=m.value.scrollHeight)})}}catch(u){console.error("加载更多日志失败:",u)}finally{f.value=!1}},d=()=>{l("update:visible",!1)};return o({show:b}),(u,h)=>{const g=e.resolveComponent("a-button"),y=e.resolveComponent("a-modal");return e.openBlock(),e.createBlock(y,{visible:t.visible,"onUpdate:visible":h[1]||(h[1]=x=>l("update:visible",x)),footer:!1,"mask-closable":!1,closable:!1,fullscreen:s.value,width:"50%",height:"100%","modal-style":{background:"#222"},"body-style":{background:"#222",padding:0},"header-style":{background:"#222",padding:0}},{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"logboxRef",ref:m,class:"overflow-y-auto scroll-smooth bg-[#222]",style:e.normalizeStyle({height:s.value?"100vh":"60vh"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(x,v)=>(e.openBlock(),e.createElementBlock("div",{key:v,class:"bg-[#222] leading-[28px] text-xs text-[#ccc] whitespace-nowrap hover:bg-[#2b2b2b]"},[e.createElementVNode("div",ki,e.toDisplayString(v+1),1),e.createElementVNode("div",wi,e.toDisplayString(x),1)]))),128))],4),e.createElementVNode("div",Si,[e.createVNode(g,{type:"primary",status:"danger",shape:"circle",onClick:d,tooltip:e.unref(n)("joblog.close")},{icon:e.withCtx(()=>[e.createVNode(e.unref(Jo))]),_:1},8,["tooltip"]),e.createVNode(g,{type:"primary",status:"danger",shape:"circle",onClick:h[0]||(h[0]=x=>s.value=!s.value),tooltip:e.unref(n)("joblog.fullscreen")},{icon:e.withCtx(()=>[e.createVNode(e.unref(xn))]),_:1},8,["tooltip"]),e.createVNode(g,{type:"primary",status:"danger",shape:"circle",onClick:p,tooltip:e.unref(n)("joblog.scrollToTop")},{icon:e.withCtx(()=>[e.createVNode(e.unref(Ko))]),_:1},8,["tooltip"]),e.createVNode(g,{type:"primary",status:"danger",shape:"circle",loading:f.value,onClick:c,tooltip:e.unref(n)("joblog.scrollToBottom")},{icon:e.withCtx(()=>[e.createVNode(e.unref(Fo))]),_:1},8,["loading","tooltip"])])]),_:1},8,["visible","fullscreen"])}}}),_i={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},Vi={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},Ei={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},Pi=["onClick"],Mi=["onClick"],Ti=["onClick"],Bi={class:"p-5"},Ri=["innerHTML"],$i={class:"flex justify-center mt-4"},Li=e.defineComponent({__name:"JobLogQuery",setup(t){const{t:o}=Y.useI18n(),{searchFormSchema:r,tableColumns:n}=jt({t:o}),l=e.ref(!1),s=e.ref(""),a=e.ref(!1),i=e.ref(null),f=async({page:B,formValues:M})=>{const P={pageNo:B.currentPage,pageSize:B.pageSize,xxlJobLog:M};return I.post("/schedule/joblog/selectForPage",P)},{QueryForm:m,formApi:b,Grid:p,gridApi:c,submitting:d,handleGlobalEnter:u,searchPlanList:h,currentSearchPlan:g,resourceId:y,nResourceid:x,handleSearchPlanSearch:v,handleDefaultPlanLoaded:E}=ce({searchFormSchema:r,tableColumns:n,resourceConfig:xi,queryFunction:f}),_=B=>{s.value=B.handleDdbz||"",l.value=!0},L=B=>{S.Modal.info({title:o("joblog.handleMsgTitle"),content:B||"",width:500})},k=B=>{i.value&&i.value.show(B.jobld.toString())};return(B,M)=>{const P=e.resolveComponent("a-button"),R=e.resolveComponent("a-modal");return e.openBlock(),e.createElementBlock("div",{class:"job-log-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:M[3]||(M[3]=e.withKeys((...C)=>e.unref(u)&&e.unref(u)(...C),["enter"])),tabindex:"-1"},[e.createElementVNode("div",_i,[e.createElementVNode("div",Vi,[e.createVNode(e.unref(m))]),e.createElementVNode("div",Ei,[e.createVNode(e.unref(p),{class:"flex-1"},{handleDdbzSlot:e.withCtx(({row:C})=>[e.createElementVNode("button",{type:"button",class:"text-[rgb(var(--primary-6))] hover:text-[rgb(var(--primary-5))]",onClick:w=>_(C)},e.toDisplayString(e.unref(o)("joblog.view")),9,Pi)]),handleMsgSlot:e.withCtx(({row:C})=>[C.handleMsg?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"text-[rgb(var(--primary-6))] hover:text-[rgb(var(--primary-5))]",onClick:w=>L(C.handleMsg)},e.toDisplayString(e.unref(o)("joblog.view")),9,Mi)):e.createCommentVNode("",!0)]),handleZxrzSlot:e.withCtx(({row:C})=>[C.nShow===1?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"text-[rgb(var(--primary-6))] hover:text-[rgb(var(--primary-5))]",onClick:w=>k(C)},e.toDisplayString(e.unref(o)("joblog.view")),9,Ti)):e.createCommentVNode("",!0)]),_:1})])]),e.createVNode(R,{visible:l.value,"onUpdate:visible":M[1]||(M[1]=C=>l.value=C),footer:!1,"mask-closable":!1,width:"500px",closable:!1,"modal-style":{background:"transparent",boxShadow:"none",border:"none"},"body-style":{background:"transparent"},"header-style":{background:"transparent"},"footer-style":{background:"transparent"}},{header:e.withCtx(()=>[...M[4]||(M[4]=[e.createElementVNode("div",null,null,-1)])]),default:e.withCtx(()=>[e.createElementVNode("div",Bi,[e.createElementVNode("div",{innerHTML:s.value},null,8,Ri)]),e.createElementVNode("div",$i,[e.createVNode(P,{type:"primary",onClick:M[0]||(M[0]=C=>l.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("joblog.confirm")),1)]),_:1})])]),_:1},8,["visible"]),e.createVNode(Ni,{ref_key:"logListRef",ref:i,visible:a.value,"onUpdate:visible":M[2]||(M[2]=C=>a.value=C)},null,8,["visible"])],32)}}}),zt=({t})=>{const o=[{cKeyname:t("jobgroup.online"),cKeynumb:"1"},{cKeyname:t("jobgroup.offline"),cKeynumb:"0"}],r=[{cKeyname:t("jobgroup.autoRegister"),cKeynumb:"0"},{cKeyname:t("jobgroup.manualEntry"),cKeynumb:"1"}],n=[{fieldName:"appname",label:t("jobgroup.appname"),component:"Input",componentProps:{placeholder:t("jobgroup.inputAppname"),allowClear:!0},colProps:{span:4}},{fieldName:"title",label:t("jobgroup.title"),component:"Input",componentProps:{placeholder:t("jobgroup.inputTitle"),allowClear:!0},colProps:{span:4}}],l=[{field:"appname",title:t("jobgroup.appname")},{field:"title",title:t("jobgroup.title")},{field:"addressType",title:t("jobgroup.registerType"),formatter:({cellValue:s})=>r.find(i=>i.cKeynumb===s)?.cKeyname||s},{field:"addressList",title:t("jobgroup.onlineAddressList")},{field:"action",title:t("jobgroup.action"),fixed:"right",width:400,slots:{default:"actionSlot"}}];return{searchFormSchema:n,tableColumns:l,statusOptions:o,zcfsOpts:r}},Ii={resourceId:"jobgroup",nResourceid:584,cModnumb:"bfd3d15f-f261-4e02-9f37-be3dfd7edd00"},Di={class:"flex justify-end gap-2 mt-4"},Oi=e.defineComponent({__name:"JobGroupForm",props:{visible:{type:Boolean},formData:{}},emits:["update:visible","success"],setup(t,{expose:o,emit:r}){const{t:n}=Y.useI18n(),l=t,s=r,a=e.ref(null),i=e.reactive({appname:"",title:"",addressType:"0",addressList:"",id:""}),f={zcfsOpts:[{cKeyname:n("jobgroup.autoRegister"),cKeynumb:"0"},{cKeyname:n("jobgroup.manualEntry"),cKeynumb:"1"}]},m=e.ref(!1);e.watch(()=>l.formData,c=>{c&&Object.assign(i,c)},{deep:!0});const b=async()=>{a.value&&a.value.validate().then(async()=>{m.value=!0;try{let c;i.id?c=await I.post("/schedule/jobgroup/update",i):c=await I.post("/schedule/jobgroup/save",i),c.success&&(S.Message.success(i.id?n("jobgroup.editSuccess"):n("jobgroup.addSuccess")),s("success"),p())}catch(c){console.error("保存失败:",c),S.Message.error(n("jobgroup.saveFailed"))}finally{m.value=!1}})},p=()=>{a.value&&a.value.clearValidate(),Object.assign(i,{appname:"",title:"",addressType:"0",addressList:"",id:""}),s("update:visible",!1)};return o({show:c=>{c?Object.assign(i,c):Object.assign(i,{appname:"",title:"",addressType:"0",addressList:"",id:""}),s("update:visible",!0)}}),(c,d)=>{const u=e.resolveComponent("a-input"),h=e.resolveComponent("a-form-item"),g=e.resolveComponent("a-radio"),y=e.resolveComponent("a-radio-group"),x=e.resolveComponent("a-textarea"),v=e.resolveComponent("a-form"),E=e.resolveComponent("a-button"),_=e.resolveComponent("a-modal");return e.openBlock(),e.createBlock(_,{title:i.id?e.unref(n)("jobgroup.editTitle"):e.unref(n)("jobgroup.addTitle"),visible:t.visible,"onUpdate:visible":d[4]||(d[4]=L=>s("update:visible",L)),"mask-closable":!1,closable:!1,width:"900px",footer:!1},{default:e.withCtx(()=>[e.createVNode(v,{ref_key:"formRef",ref:a,model:i,"label-width":130},{default:e.withCtx(()=>[e.createVNode(h,{label:e.unref(n)("jobgroup.appname"),field:"appname",rules:[{required:!0,message:e.unref(n)("jobgroup.inputAppname")}]},{default:e.withCtx(()=>[e.createVNode(u,{modelValue:i.appname,"onUpdate:modelValue":d[0]||(d[0]=L=>i.appname=L),placeholder:e.unref(n)("jobgroup.inputAppname")},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),e.createVNode(h,{label:e.unref(n)("jobgroup.title"),field:"title",rules:[{required:!0,message:e.unref(n)("jobgroup.inputTitle")}]},{default:e.withCtx(()=>[e.createVNode(u,{modelValue:i.title,"onUpdate:modelValue":d[1]||(d[1]=L=>i.title=L),placeholder:e.unref(n)("jobgroup.inputTitle")},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),e.createVNode(h,{label:e.unref(n)("jobgroup.registerType"),field:"addressType",rules:[{required:!0,message:e.unref(n)("jobgroup.selectRegisterType")}]},{default:e.withCtx(()=>[e.createVNode(y,{modelValue:i.addressType,"onUpdate:modelValue":d[2]||(d[2]=L=>i.addressType=L)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.zcfsOpts,L=>(e.openBlock(),e.createBlock(g,{key:L.cKeynumb,value:L.cKeynumb},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(L.cKeyname),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["label","rules"]),e.createVNode(h,{label:e.unref(n)("jobgroup.machineAddress"),field:"addressList",rules:[{required:i.addressType==="1",message:e.unref(n)("jobgroup.inputMachineAddress")}]},{default:e.withCtx(()=>[e.createVNode(x,{modelValue:i.addressList,"onUpdate:modelValue":d[3]||(d[3]=L=>i.addressList=L),rows:4,"max-rows":8,disabled:i.addressType==="0",placeholder:e.unref(n)("jobgroup.inputMachineAddressList")},null,8,["modelValue","disabled","placeholder"])]),_:1},8,["label","rules"])]),_:1},8,["model"]),e.createElementVNode("div",Di,[e.createVNode(E,{type:"primary",loading:m.value,onClick:b},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("jobgroup.save")),1)]),_:1},8,["loading"]),e.createVNode(E,{onClick:p},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("jobgroup.cancel")),1)]),_:1})])]),_:1},8,["title","visible"])}}}),ji={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},zi={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},Fi={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},Ai=["onClick"],Ui=e.defineComponent({__name:"JobGroupQuery",setup(t){const{t:o}=Y.useI18n(),{searchFormSchema:r,tableColumns:n}=zt({t:o}),l=e.ref(!1),s=e.ref(null),a=async({page:B,formValues:M})=>{const P={pageNo:B.currentPage,pageSize:B.pageSize,xxlJobGroup:M};return I.post("/schedule/jobgroup/selectForPage",P)},i={async toolbarButtonClick(B){[...B.$grid.getCheckboxRecords()],B.button.code==="jobgroup/add"&&s.value&&s.value.show()}},{QueryForm:f,formApi:m,Grid:b,gridApi:p,submitting:c,handleGlobalEnter:d,searchPlanList:u,currentSearchPlan:h,resourceId:g,nResourceid:y,resourceButtons:x,handleSearchPlanSearch:v,handleDefaultPlanLoaded:E}=ce({searchFormSchema:r,tableColumns:n,resourceConfig:Ii,queryFunction:a,gridEvents:i}),_=B=>x.value.filter(M=>M.cSubArea==="columnTable"),L=async(B,M)=>{const{handle:P}=B;switch(P){case"jobgroup/edit":try{const R=await I.post("/schedule/jobgroup/get",{id:M.id});if(R.success&&R.data){const C=R.data;C.addressType=String(C.addressType),s.value&&s.value.show(C)}}catch(R){console.error("查询单个执行器失败:",R),S.Message.error(o("jobgroup.queryFailed"))}break;case"jobgroup/del":S.Modal.confirm({title:o("jobgroup.confirmDelete"),content:o("jobgroup.confirmDeleteSingle",{title:M.title}),onOk:async()=>{try{(await I.post("/schedule/jobgroup/remove",{id:M.id})).success&&(S.Message.success(o("jobgroup.deleteSuccess")),p.value?.refresh())}catch(R){console.error("删除失败:",R),S.Message.error(o("jobgroup.deleteFailed"))}}});break}},k=()=>{p.value?.refresh()};return(B,M)=>(e.openBlock(),e.createElementBlock("div",{class:"job-group-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:M[1]||(M[1]=e.withKeys((...P)=>e.unref(d)&&e.unref(d)(...P),["enter"])),tabindex:"-1"},[e.createElementVNode("div",ji,[e.createElementVNode("div",zi,[e.createVNode(e.unref(f))]),e.createElementVNode("div",Fi,[e.createVNode(e.unref(b),{class:"flex-1"},{actionSlot:e.withCtx(({row:P})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_(),R=>(e.openBlock(),e.createElementBlock("button",{key:R.id,type:"button",class:"text-[rgb(var(--primary-6))] hover:text-[rgb(var(--primary-5))] mr-2",onClick:C=>L(R,P)},e.toDisplayString(R.label),9,Ai))),128))]),_:1})])]),e.createVNode(Oi,{ref_key:"formRef",ref:s,visible:l.value,"onUpdate:visible":M[0]||(M[0]=P=>l.value=P),onSuccess:k},null,8,["visible"])],32))}}),qi=re(Ui,[["__scopeId","data-v-69c513e0"]]),Ki=e.markRaw(z.SunnyCustomizeSelect),Ft=({t,formApi:o})=>{const r=[{cKeyname:t("zdyxlk.backendSQL"),cKeynumb:"0"},{cKeyname:t("zdyxlk.customImplementation"),cKeynumb:"1"}],n=[{cKeyname:t("zdyxlk.dropdown"),cKeynumb:"0"},{cKeyname:t("zdyxlk.searchableDropdown"),cKeynumb:"1"}],l=[{cKeyname:t("zdyxlk.private"),cKeynumb:"0"},{cKeyname:t("zdyxlk.public"),cKeynumb:"1"}],s=[{cKeyname:t("zdyxlk.exactMatch"),cKeynumb:"0"},{cKeyname:t("zdyxlk.fuzzyMatch"),cKeynumb:"1"}],a=[{fieldName:"cNum",label:t("zdyxlk.cNum"),component:"Input",componentProps:{placeholder:t("zdyxlk.inputcNum"),allowClear:!0},colProps:{span:4}},{fieldName:"cTitle",label:t("zdyxlk.cTitle"),component:"Input",componentProps:{placeholder:t("zdyxlk.inputcTitle"),allowClear:!0},colProps:{span:4}},{fieldName:"cWork",label:t("zdyxlk.cWork"),component:Ki,componentProps:{placeholder:t("zdyxlk.inputcWork"),allowClear:!0,cNum:"UserSearch1",fieldNames:{label:"cKeyname",value:"cKeyname"}},colProps:{span:4}}],i=[{type:"checkbox",width:40},{field:"cNum",title:t("zdyxlk.cNum")},{field:"nCbtype",title:t("zdyxlk.nCbtype"),formatter:({cellValue:m})=>r.find(p=>p.cKeynumb===m)?.cKeyname||m},{field:"cCbclass",title:t("zdyxlk.cCbclass")},{field:"cTitle",title:t("zdyxlk.cTitle")},{field:"cValcol",title:t("zdyxlk.cValcol")},{field:"cLabelcol",title:t("zdyxlk.cLabelcol")},{field:"cLabelslotcol",title:t("zdyxlk.cLabelslotcol")},{field:"nType",title:t("zdyxlk.nType"),formatter:({cellValue:m})=>n.find(p=>p.cKeynumb===m)?.cKeyname||m},{field:"nSearchinterval",title:t("zdyxlk.nSearchinterval")},{field:"cStaffname",title:t("zdyxlk.cStaffname")},{field:"nLimit",title:t("zdyxlk.nLimit")},{field:"nSfcommon",title:t("zdyxlk.nSfcommon"),formatter:({cellValue:m})=>l.find(p=>p.cKeynumb===m)?.cKeyname||m}],f=[{fieldName:"nCbtype",label:t("zdyxlk.nCbtype"),component:"Select",componentProps:{placeholder:t("zdyxlk.selectnCbtype"),options:r.map(m=>({label:m.cKeyname,value:m.cKeynumb})),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"cCbclass",label:t("zdyxlk.cCbclass"),component:"Input",componentProps:{placeholder:t("zdyxlk.inputcCbclass"),allowClear:!0},colProps:{span:8}},{fieldName:"cNum",label:t("zdyxlk.cNum"),component:"Input",componentProps:{placeholder:t("zdyxlk.inputcNum"),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"cTitle",label:t("zdyxlk.cTitle"),component:"Input",componentProps:{placeholder:t("zdyxlk.inputcTitle"),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"cValcol",label:t("zdyxlk.cValcol"),component:"Input",componentProps:{placeholder:t("zdyxlk.inputcValcol"),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"cLabelcol",label:t("zdyxlk.cLabelcol"),component:"Input",componentProps:{placeholder:t("zdyxlk.inputcLabelcol"),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"cLabelslotcol",label:t("zdyxlk.cLabelslotcol"),component:"Input",componentProps:{placeholder:t("zdyxlk.inputcLabelslotcol"),allowClear:!0},colProps:{span:8}},{fieldName:"nType",label:t("zdyxlk.nType"),component:"Select",componentProps:{placeholder:t("zdyxlk.selectnType"),options:n.map(m=>({label:m.cKeyname,value:m.cKeynumb})),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"nLikematch",label:t("zdyxlk.nLikematch"),component:"Select",componentProps:{placeholder:t("zdyxlk.selectnLikematch"),options:s.map(m=>({label:m.cKeyname,value:m.cKeynumb})),allowClear:!0},colProps:{span:8}},{fieldName:"nSearchinterval",label:t("zdyxlk.nSearchinterval"),component:"InputNumber",componentProps:{placeholder:"默认700毫秒",min:0,max:5e3,allowClear:!0},colProps:{span:8}},{fieldName:"nLimit",label:t("zdyxlk.nLimit"),component:"InputNumber",componentProps:{placeholder:"默认20",min:1,max:1e3,allowClear:!0},colProps:{span:8}},{fieldName:"nSfcommon",label:t("zdyxlk.nSfcommon"),component:"Select",componentProps:{placeholder:t("zdyxlk.selectnSfcommon"),options:l.map(m=>({label:m.cKeyname,value:m.cKeynumb})),allowClear:!0},colProps:{span:8}},{fieldName:"cPrefixUrl",label:t("zdyxlk.cPrefixUrl"),component:"Input",componentProps:{placeholder:t("zdyxlk.inputcPrefixUrl"),allowClear:!0},colProps:{span:8}}];return{searchFormSchema:a,tableColumns:i,addEditFormSchema:f,nCbtypeOptions:r,nTypeOptions:n,nSfcommonOptions:l,nLikematchOptions:s}},Wi={resourceId:"zdyxlk",nResourceid:11908,cModnumb:"ZDYXLK"},Gi=e.defineComponent({__name:"ZdyxlkAdd",emits:["success"],setup(t,{expose:o,emit:r}){const{t:n}=Y.useI18n(),l=e.ref(!1),s=e.ref("add"),a=e.ref(!1),i=r,[f,m]=z.useSunnyForm({layout:"vertical",size:"small",labelWidth:120,showDefaultActions:!1,scrollToFirstError:!0,schema:[]}),{addEditFormSchema:b}=Ft({t:n,formApi:m});m.setState({handleValuesChange:g=>{"nCbtype"in g&&(g.nCbtype,p(g.nCbtype))}});const p=g=>{const y=g==="0";m.updateSchema([{fieldName:"cValcol",hidden:!y},{fieldName:"cLabelcol",hidden:!y}])};o({addInit:async()=>{l.value=!0,s.value="add",m.setState({schema:b}),m.resetForm(),m.setValues({nCbtype:"0"}),await e.nextTick(),p("0")},editInit:async g=>{a.value=!0,s.value="edit";let y=null;try{const x=await I.post("/core/assSelect/update_init",{id:g.id});x.code===200&&x.result&&(y={...x.result},y.nCbtype!==void 0&&(y.nCbtype=String(y.nCbtype)),y.nLikematch!==void 0&&(y.nLikematch=String(y.nLikematch)),y.nSfcommon!==void 0&&(y.nSfcommon=String(y.nSfcommon)),y.nType!==void 0&&(y.nType=String(y.nType)))}catch(x){console.error("查询失败:",x),S.Message.error(n("zdyxlk.queryFailed"))}l.value=!0,await e.nextTick(),m.setState({schema:b}),m.resetForm(),y&&(m.setValues(y,!1),m.updateSchema([{fieldName:"cNum",componentProps:{disabled:!0}}]),p(y.nCbtype)),a.value=!1}});const u=async()=>{const{valid:g}=await m.validate();if(!g)return!1;const x={...await m.getValues()};try{const v=await I.post(s.value==="add"?"/core/assSelect/insert":"/core/assSelect/update",x);return v.code===200?(S.Message.success(s.value==="add"?n("zdyxlk.addSuccess"):n("zdyxlk.editSuccess")),l.value=!1,i("success"),!0):(S.Message.error(v.message||n("zdyxlk.saveFailed")),!1)}catch(v){return console.error("保存失败:",v),S.Message.error(n("zdyxlk.saveFailed")),!1}},h=()=>{l.value=!1};return(g,y)=>(e.openBlock(),e.createBlock(e.unref(z.Modal),{"model-value":l.value,title:s.value==="add"?e.unref(n)("zdyxlk.addTitle"):e.unref(n)("zdyxlk.editTitle"),"on-before-ok":u,onClose:h,width:"800px"},{default:e.withCtx(()=>[e.createVNode(e.unref(f))]),_:1},8,["model-value","title"]))}}),Hi={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},Ji={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},Qi={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},Xi=["onClick"],Yi=e.defineComponent({__name:"ZdyxlkQuery",setup(t){const o=e.ref(),{t:r}=Y.useI18n(),{searchFormSchema:n,tableColumns:l}=Ft({t:r}),s=async({page:L,formValues:k})=>{const B={pageNo:L.currentPage,pageSize:L.pageSize,assSelect:k},M=await I.post("/core/assSelect/selectForPage",B);return M.code===200&&M.result&&M.result.records&&(M.result.records=M.result.records.map(P=>({...P,nCbtype:P.nCbtype!==void 0?String(P.nCbtype):P.nCbtype,nType:P.nType!==void 0?String(P.nType):P.nType,nLikematch:P.nLikematch!==void 0?String(P.nLikematch):P.nLikematch,nSfcommon:P.nSfcommon!==void 0?String(P.nSfcommon):P.nSfcommon}))),M},a={async toolbarButtonClick(L){const k=[...L.$grid.getCheckboxRecords()];switch(L.button.code){case"zdyxlk/add":o.value.addInit();break;case"zdyxlk/edit":if(k.length!==1){S.Message.warning(r("common.selectOne"));return}o.value.editInit(k[0]);break;case"zdyxlk/del":if(k.length===0){S.Message.warning(r("zdyxlk.selectDeleteRecords"));return}S.Modal.confirm({title:r("zdyxlk.confirmDelete"),content:r("zdyxlk.confirmDeleteMultiple",{count:k.length}),onBeforeOk:async()=>{const B=k.map(P=>P.id),M=await I.post("/core/assSelect/delete",{idList:B});return M.code===200?(S.Message.success(M.message),L.$grid.commitProxy("query",{}),!0):(S.Message.error(M.message),!1)}});break}}},{QueryForm:i,formApi:f,Grid:m,gridApi:b,submitting:p,handleGlobalEnter:c,searchPlanList:d,currentSearchPlan:u,resourceId:h,nResourceid:g,resourceButtons:y,handleSearchPlanSearch:x,handleDefaultPlanLoaded:v}=ce({searchFormSchema:n,tableColumns:l,resourceConfig:Wi,queryFunction:s,gridEvents:a}),E=L=>y.value.filter(k=>k.cSubArea==="columnTable"),_=async(L,k)=>{const{handle:B}=L;switch(B){case"zdyxlk/edit":o.value.editInit(k);break;case"zdyxlk/del":S.Modal.confirm({title:r("zdyxlk.confirmDelete"),content:r("zdyxlk.confirmDeleteSingle",{CTitle:k.CTitle}),onOk:async()=>{try{const M=await I.post("/core/assSelect/delete",{id:k.id});M.code===200?(S.Message.success(M.message),b.value?.refresh()):S.Message.error(M.message)}catch(M){console.error("删除失败:",M),S.Message.error(r("zdyxlk.deleteFailed"))}}});break}};return(L,k)=>(e.openBlock(),e.createElementBlock("div",{class:"zdyxlk-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:k[1]||(k[1]=e.withKeys((...B)=>e.unref(c)&&e.unref(c)(...B),["enter"])),tabindex:"-1"},[e.createElementVNode("div",Hi,[e.createElementVNode("div",Ji,[e.createVNode(e.unref(i))]),e.createElementVNode("div",Qi,[e.createVNode(e.unref(m),{class:"flex-1"},{actionSlot:e.withCtx(({row:B})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E(),M=>(e.openBlock(),e.createElementBlock("button",{key:M.id,type:"button",class:"text-[rgb(var(--primary-6))] hover:text-[rgb(var(--primary-5))] mr-2",onClick:P=>_(M,B)},e.toDisplayString(M.label),9,Xi))),128))]),_:1})])]),e.createVNode(Gi,{ref_key:"ZdyxlkAddRef",ref:o,onSuccess:k[0]||(k[0]=()=>e.unref(b).commitProxy("query"))},null,512)],32))}}),Zi=re(Yi,[["__scopeId","data-v-2065aa57"]]),ct=({t})=>{const o=[{cKeyname:"启用",cKeynumb:"0"},{cKeyname:"禁用",cKeynumb:"1"}],r=[{fieldName:"cModnumb",label:t("assSendoa.cModnumb"),component:"Input",componentProps:{placeholder:t("assSendoa.inputcModnumb"),allowClear:!0},colProps:{span:4}},{fieldName:"cGongsi",label:t("assSendoa.cGongsi"),component:"Input",componentProps:{placeholder:t("assSendoa.inputcGongsi"),allowClear:!0},colProps:{span:4}},{fieldName:"nSign",label:t("assSendoa.nSign"),component:"Select",componentProps:{placeholder:t("assSendoa.selectnSign"),allowClear:!0,options:o.map(s=>({label:s.cKeyname,value:s.cKeynumb}))},colProps:{span:4}},{fieldName:"cUrl",label:t("assSendoa.cUrl"),component:"Input",componentProps:{placeholder:t("assSendoa.inputcUrl"),allowClear:!0},colProps:{span:4}}],n=[{type:"checkbox",width:40},{field:"cModnumb",title:t("assSendoa.cModnumb")},{field:"cGongsi",title:t("assSendoa.cGongsi")},{field:"cLcmc",title:t("assSendoa.cLcmc")},{field:"cOalcid",title:t("assSendoa.cOalcid")},{field:"cUrl",title:t("assSendoa.cUrl")},{field:"nSign",title:t("assSendoa.nSign"),formatter:({cellValue:s})=>o.find(i=>i.cKeynumb===s)?.cKeyname||s},{field:"cCreateuserName",title:t("assSendoa.CreateuserName")},{field:"dCreatetime",title:t("assSendoa.dCreatetime")},{field:"cBeizhu",title:t("assSendoa.cBeizhu")}],l=[{fieldName:"cModnumb",label:t("assSendoa.cModnumb"),component:"Input",componentProps:{placeholder:t("assSendoa.inputcModnumb"),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"cGongsi",label:t("assSendoa.cGongsi"),component:"Input",componentProps:{placeholder:t("assSendoa.inputcGongsi"),allowClear:!0},colProps:{span:8}},{fieldName:"nSign",label:t("assSendoa.nSign"),component:"Select",componentProps:{placeholder:t("assSendoa.selectnSign"),options:o.map(s=>({label:s.cKeyname,value:s.cKeynumb})),allowClear:!0},colProps:{span:8}},{fieldName:"cLcmc",label:t("assSendoa.cLcmc"),component:"Input",componentProps:{placeholder:t("assSendoa.inputcLcmc"),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"cUrl",label:t("assSendoa.cUrl"),component:"Input",componentProps:{placeholder:t("assSendoa.inputcUrl"),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"cOalcid",label:t("assSendoa.cOalcid"),component:"Input",componentProps:{placeholder:t("assSendoa.cOalcid"),allowClear:!0},rules:"required",colProps:{span:8}}];return{searchFormSchema:r,tableColumns:n,addEditFormSchema:l,userSfqyOpts:o}},ec={resourceId:"assSendoa",nResourceid:326,cModnumb:"066e0071-1bb5-494a-9d5e-506eb65b8c81"},At=e.defineComponent({__name:"AssSendoaAdd",emits:["success"],setup(t,{expose:o,emit:r}){const{t:n}=Y.useI18n(),l=e.ref(!1),s=e.ref("add"),a=e.ref(!1),i=r,[f,m]=z.useSunnyForm({layout:"vertical",size:"small",labelWidth:120,showDefaultActions:!1,scrollToFirstError:!0,schema:[]}),{addEditFormSchema:b}=ct({t:n});o({addInit:async()=>{l.value=!0,s.value="add",m.setState({schema:b}),m.resetForm(),await e.nextTick()},editInit:async h=>{a.value=!0,s.value="edit";let g=null;try{const y=await I.post("/core/assSendoa/update_init",{assSendoa:{id:h.id}});y.code===200&&y.result&&(g={...y.result},g.nSign!==void 0&&(g.nSign=String(g.nSign)))}catch(y){console.error("查询失败:",y),S.Message.error(n("assSendoa.queryFailed"))}l.value=!0,await e.nextTick(),m.setState({schema:b}),m.resetForm(),g&&m.setValues(g,!1),a.value=!1}});const d=async()=>{const{valid:h}=await m.validate();if(!h)return!1;const y={assSendoa:{...await m.getValues()}};try{const x=await I.post(s.value==="add"?"/core/assSendoa/insert":"/core/assSendoa/update",y);return x.code===200?(S.Message.success(s.value==="add"?n("assSendoa.addSuccess"):n("assSendoa.editSuccess")),l.value=!1,i("success"),!0):(S.Message.error(x.message||n("assSendoa.saveFailed")),!1)}catch(x){return console.error("保存失败:",x),S.Message.error(n("assSendoa.saveFailed")),!1}},u=()=>{l.value=!1};return(h,g)=>(e.openBlock(),e.createBlock(e.unref(z.Modal),{"model-value":l.value,title:s.value==="add"?e.unref(n)("assSendoa.addTitle"):e.unref(n)("assSendoa.editTitle"),"on-before-ok":d,onClose:u,width:"800px"},{default:e.withCtx(()=>[e.createVNode(e.unref(f))]),_:1},8,["model-value","title"]))}}),tc={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},oc={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},nc={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},rc=["onClick"],lc=e.defineComponent({__name:"AssSendoaQuery",setup(t){const o=e.ref(),{t:r}=Y.useI18n(),{searchFormSchema:n,tableColumns:l}=ct({t:r}),s=async({page:L,formValues:k})=>{const B={pageNo:L.currentPage,pageSize:L.pageSize,assSendoa:k},M=await I.post("/core/assSendoa/selectForPage",B);return M.result&&M.result.records&&M.result.records.forEach(P=>{P.nSign!==void 0&&(P.nSign=String(P.nSign))}),M},a={async toolbarButtonClick(L){const k=[...L.$grid.getCheckboxRecords()];switch(L.button.code){case"assSendoa/add":o.value.addInit();break;case"assSendoa/edit":if(k.length!==1){S.Message.warning(r("common.selectOne"));return}o.value.editInit(k[0]);break;case"assSendoa/del":if(k.length===0){S.Message.warning(r("assSendoa.selectDeleteRecords"));return}S.Modal.confirm({title:r("assSendoa.confirmDelete"),content:r("assSendoa.confirmDeleteMultiple",{count:k.length}),onBeforeOk:async()=>{const B=k.map(P=>P.id),M=await I.post("/core/assSendoa/delete",{idList:B});return M.code===200?(S.Message.success(M.message),L.$grid.commitProxy("query",{}),!0):(S.Message.error(M.message),!1)}});break}}},{QueryForm:i,formApi:f,Grid:m,gridApi:b,submitting:p,handleGlobalEnter:c,searchPlanList:d,currentSearchPlan:u,resourceId:h,nResourceid:g,resourceButtons:y,handleSearchPlanSearch:x,handleDefaultPlanLoaded:v}=ce({searchFormSchema:n,tableColumns:l,resourceConfig:ec,queryFunction:s,gridEvents:a}),E=L=>y.value.filter(k=>k.cSubArea==="columnTable"),_=async(L,k)=>{const{handle:B}=L;switch(B){case"assSendoa/edit":o.value.editInit(k);break;case"assSendoa/del":S.Modal.confirm({title:r("assSendoa.confirmDelete"),content:r("assSendoa.confirmDeleteSingle",{cModnumb:k.cModnumb}),onOk:async()=>{try{const M=await I.post("/core/assSendoa/delete",{id:k.id});M.code===200?(S.Message.success(M.message),b.value?.refresh()):S.Message.error(M.message)}catch(M){console.error("删除失败:",M),S.Message.error(r("assSendoa.deleteFailed"))}}});break}};return(L,k)=>(e.openBlock(),e.createElementBlock("div",{class:"assSendoa-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:k[1]||(k[1]=e.withKeys((...B)=>e.unref(c)&&e.unref(c)(...B),["enter"])),tabindex:"-1"},[e.createElementVNode("div",tc,[e.createElementVNode("div",oc,[e.createVNode(e.unref(i))]),e.createElementVNode("div",nc,[e.createVNode(e.unref(m),{class:"flex-1"},{actionSlot:e.withCtx(({row:B})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E(),M=>(e.openBlock(),e.createElementBlock("button",{key:M.id,type:"button",class:"text-[rgb(var(--primary-6))] hover:text-[rgb(var(--primary-5))] mr-2",onClick:P=>_(M,B)},e.toDisplayString(M.label),9,rc))),128))]),_:1})])]),e.createVNode(At,{ref_key:"AssSendoaAddRef",ref:o,onSuccess:k[0]||(k[0]=()=>e.unref(b).commitProxy("query"))},null,512)],32))}}),ac=re(lc,[["__scopeId","data-v-53c27ad8"]]),Ut=({t})=>{const o=[{fieldName:"cNum",label:t("ggcxtc.cNum"),component:"Input",componentProps:{placeholder:t("ggcxtc.inputcNum"),allowClear:!0},colProps:{span:4}},{fieldName:"cTitle",label:t("ggcxtc.cTitle"),component:"Input",componentProps:{placeholder:t("ggcxtc.inputcTitle"),allowClear:!0},colProps:{span:4}},{fieldName:"nSfcommon",label:t("ggcxtc.nSfcommon"),component:"Select",componentProps:{placeholder:t("ggcxtc.selectnSfcommon"),allowClear:!0,options:rt},colProps:{span:4}}],r=[{type:"checkbox",width:40},{field:"cNum",title:t("ggcxtc.cNum")},{field:"cTitle",title:t("ggcxtc.cTitle")},{field:"nCbtype",title:t("ggcxtc.nCbtype"),formatter:({cellValue:n})=>Bt.find(s=>s.value===n)?.label||n},{field:"cCbclass",title:t("ggcxtc.cCbclass")},{field:"cCondition",title:t("ggcxtc.cCondition")},{field:"cWidth",title:t("ggcxtc.cWidth")},{field:"cHeight",title:t("ggcxtc.cHeight")},{field:"nRows",title:t("ggcxtc.nRows")},{field:"cSql",title:t("ggcxtc.cSql")},{field:"cTablecols",title:t("ggcxtc.cTablecols")},{field:"cCrenumb",title:t("ggcxtc.cCrenumb")},{field:"cCrename",title:t("ggcxtc.cCrename")},{field:"dDate",title:t("ggcxtc.dDate")},{field:"cOrder",title:t("ggcxtc.cOrder")},{field:"nSfcommon",title:t("ggcxtc.nSfcommon"),formatter:({cellValue:n})=>rt.find(s=>s.value===n)?.label||n}];return{searchFormSchema:o,tableColumns:r}},sc={resourceId:"Ggcxtc",nResourceid:11955,cModnumb:"GGCXTC"},ic=e.defineComponent({__name:"GgcxtcReview",props:{visible:{type:Boolean},cNum:{}},emits:["close"],setup(t,{emit:o}){const r=t,n=o,{t:l}=Y.useI18n(),[s,a]=z.useSunnyForm({layout:"vertical",size:"small",labelWidth:120,showDefaultActions:!1,scrollToFirstError:!0,schema:[{fieldName:"businessSearchValue",label:"业务搜索",component:"SunnyBusinessSearch",componentProps:()=>({cNum:r.cNum,placeholder:"请选择",modalProps:{multiple:!0,fieldNames:{label:"LASTNAME",value:"WORKCODE"}}}),colProps:{span:8}}]});e.watch(()=>r.visible,m=>{m&&a.resetForm()});const i=async()=>{const{valid:m}=await a.validate();return m?(n("close"),!0):!1},f=()=>{n("close")};return(m,b)=>(e.openBlock(),e.createBlock(e.unref(z.Modal),{"model-value":t.visible,title:"预览查询弹窗","on-before-ok":i,onClose:f,width:"800px"},{default:e.withCtx(()=>[e.createVNode(e.unref(s))]),_:1},8,["model-value"]))}}),cc={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},dc={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},uc={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},mc=["onClick"],pc=e.defineComponent({__name:"GgcxtcQuery",setup(t){const{t:o}=Y.useI18n(),{searchFormSchema:r,tableColumns:n}=Ut({t:o}),l=e.ref(!1),s=e.ref(""),a=async({page:k,formValues:B})=>{const M={pageNo:k.currentPage,pageSize:k.pageSize,assDialog:B},P=await I.post("/core/assDialog/selectForPage",M);return P.result&&P.result.records&&P.result.records.forEach(R=>{R.nCbtype!==void 0&&(R.nCbtype=String(R.nCbtype)),R.nSfcommon!==void 0&&(R.nSfcommon=String(R.nSfcommon))}),P},i={async toolbarButtonClick(k){const B=[...k.$grid.getCheckboxRecords()];switch(k.button.code){case"ggcxtc/add":S.Message.info("新增功能开发中");break;case"ggcxtc/edit":if(B.length!==1){S.Message.warning(o("common.selectOne"));return}S.Message.info("修改功能开发中");break;case"ggcxtc/review":if(B.length!==1){S.Message.warning(o("common.selectOne"));return}s.value=B[0].cNum,l.value=!0;break;case"ggcxtc/del":if(B.length===0){S.Message.warning(o("ggcxtc.selectDeleteRecords"));return}S.Modal.confirm({title:o("ggcxtc.confirmDelete"),content:o("ggcxtc.confirmDeleteMultiple",{count:B.length}),onBeforeOk:async()=>{const M=B.map(R=>R.id),P=await I.post("/core/assDialog/delete",{idList:M});return P.code===200?(S.Message.success(P.message),k.$grid.commitProxy("query",{}),!0):(S.Message.error(P.message),!1)}});break}}},{QueryForm:f,formApi:m,Grid:b,gridApi:p,submitting:c,handleGlobalEnter:d,searchPlanList:u,currentSearchPlan:h,resourceId:g,nResourceid:y,resourceButtons:x,handleSearchPlanSearch:v,handleDefaultPlanLoaded:E}=ce({searchFormSchema:r,tableColumns:n,resourceConfig:sc,queryFunction:a,gridEvents:i}),_=k=>x.value.filter(B=>B.cSubArea==="columnTable"),L=async(k,B)=>{const{handle:M}=k;switch(M){case"ggcxtc/add":S.Message.info("新增功能开发中");break;case"ggcxtc/edit":S.Message.info("修改功能开发中");break;case"ggcxtc/review":s.value=B.cNum,l.value=!0;break;case"ggcxtc/del":S.Modal.confirm({title:o("ggcxtc.confirmDelete"),content:o("ggcxtc.confirmDeleteSingle",{cTitle:B.cTitle}),onOk:async()=>{try{const P=await I.post("/core/assDialog/delete",{id:B.id});P.code===200?(S.Message.success(P.message),p.value?.refresh()):S.Message.error(P.message)}catch(P){console.error("删除失败:",P),S.Message.error(o("ggcxtc.deleteFailed"))}}});break}};return(k,B)=>(e.openBlock(),e.createElementBlock("div",{class:"ggcxtc-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:B[1]||(B[1]=e.withKeys((...M)=>e.unref(d)&&e.unref(d)(...M),["enter"])),tabindex:"-1"},[e.createElementVNode("div",cc,[e.createElementVNode("div",dc,[e.createVNode(e.unref(f))]),e.createElementVNode("div",uc,[e.createVNode(e.unref(b),{class:"flex-1"},{actionSlot:e.withCtx(({row:M})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_(),P=>(e.openBlock(),e.createElementBlock("button",{key:P.id,type:"button",class:"text-[rgb(var(--primary-6))] hover:text-[rgb(var(--primary-5))] mr-2",onClick:R=>L(P,M)},e.toDisplayString(P.label),9,mc))),128))]),_:1})])]),e.createVNode(ic,{visible:l.value,"c-num":s.value,onClose:B[0]||(B[0]=M=>l.value=!1)},null,8,["visible","c-num"])],32))}}),fc=re(pc,[["__scopeId","data-v-1c9496cc"]]);function Be({t}){const o=[{fieldName:"cExresnum",label:t("otherPermissions.cExresnum"),component:"Input",componentProps:{placeholder:t("otherPermissions.inputcExresnum"),allowClear:!0},colProps:{span:6}},{fieldName:"cExresname",label:t("otherPermissions.cExresname"),component:"Input",componentProps:{placeholder:t("otherPermissions.inputcExresname"),allowClear:!0},colProps:{span:6}}],r=[{fieldName:"cExresnum",label:t("otherPermissions.cExresnum"),component:"Input",rules:"required",componentProps:{placeholder:t("otherPermissions.inputcExresnum"),allowClear:!0}},{fieldName:"cExresname",label:t("otherPermissions.cExresname"),component:"Input",rules:"required",componentProps:{placeholder:t("otherPermissions.inputcExresname"),allowClear:!0}},{fieldName:"cOrg",label:t("otherPermissions.cOrg"),component:"Select",componentProps:{placeholder:t("otherPermissions.inputcOrg"),allowClear:!0},permissionOptions:{code:"COMPANY",fieldMapping:{label:"cExresname",value:"cExresnum"}}},{fieldName:"nOrder",label:t("otherPermissions.nOrder"),component:"InputNumber",componentProps:{placeholder:t("otherPermissions.inputnOrder"),min:1,precision:0}}],n=[{type:"checkbox",width:50},{field:"cExresnum",title:t("otherPermissions.cExresnum"),minWidth:140,treeNode:!0,params:{nBill:3,cEntityTable:"AUTH_EXRES"}},{field:"cExresname",title:t("otherPermissions.cExresname"),minWidth:180},{field:"cOrg",title:t("otherPermissions.cOrg"),minWidth:150},{field:"dCredate",title:t("otherPermissions.dCredate"),width:180},{field:"cCreateName",title:t("otherPermissions.cCreateName"),width:120},{field:"nOrder",title:t("otherPermissions.nOrder"),width:80}];return{searchFormSchema:o,addFormSchema:r,tableColumns:n}}const hc={resourceId:"otherPermissions",nResourceid:67,cModnumb:"db7a8e32-f20b-444b-af0f-aed54ec99532"};class gc{cache=new Map;loadingPromises=new Map;async loadOptions(o,r,n=!1){const l=z.DEFAULT_FORM_COMMON_CONFIG.selectOptionsAdapter;if(!l?.loadOptions)return console.warn("[SelectOptionsManager] Adapter not configured"),{};if(!o||o.length===0)return{};const s=n?o:o.filter(f=>!this.cache.has(String(f)));if(s.length===0){const f={};return o.forEach(m=>{f[String(m)]=this.cache.get(String(m))||[]}),f}const a=s.map(String).sort((f,m)=>f.localeCompare(m)).join(",");let i=this.loadingPromises.get(a);i||(i=l.loadOptions(s,r),this.loadingPromises.set(a,i));try{const f=await i;f&&typeof f=="object"&&Object.keys(f).forEach(b=>{this.cache.set(b,f[b])});const m={};return o.forEach(b=>{m[String(b)]=this.cache.get(String(b))||[]}),m}finally{this.loadingPromises.delete(a)}}getOptions(o){return this.cache.get(String(o))||[]}clearCache(o){o?this.cache.delete(String(o)):this.cache.clear()}hasCache(o){return this.cache.has(String(o))}getCacheSize(){return this.cache.size}}const Se=new gc;function ve(t){const{numbList:o,fieldMapping:r,immediate:n=!0,forceReload:l=!1}=t,s=e.ref({}),a=e.ref(!1),i=async()=>{if(!(!o||o.length===0)){a.value=!0;try{const p=await Se.loadOptions(o,r,l);s.value=p}catch(p){console.error("[useSelectOptions] Failed to load options:",p)}finally{a.value=!1}}},f=p=>s.value[String(p)]||[],m=async p=>{Se.clearCache(p);const c=await Se.loadOptions([p],r,!0);s.value={...s.value,...c}},b=p=>{if(Se.clearCache(p),p){const c={...s.value};delete c[String(p)],s.value=c}else s.value={}};return n&&o&&o.length>0&&(e.getCurrentInstance()?e.onMounted(()=>{i()}):i()),{optionsMap:s,loading:a,load:i,getOptions:f,reload:m,clearCache:b}}function ye(t,o=!0){const r=e.computed(()=>{const f=typeof t=="object"&&"value"in t?t.value:t,m=[];return f.forEach(b=>{b.selectOptions?.dictCode&&m.push({fieldName:b.fieldName||"",...b.selectOptions})}),m}),n=e.computed(()=>{const f=new Set;return r.value.forEach(m=>{f.add(m.dictCode)}),Array.from(f)}),{optionsMap:l,loading:s,load:a}=ve({numbList:n.value,fieldMapping:r.value[0]?.fieldMapping,immediate:!1}),i=e.computed(()=>(typeof t=="object"&&"value"in t?t.value:t).map(m=>{if(m.selectOptions?.dictCode){const b=m.componentProps,p=String(m.selectOptions.dictCode);return{...m,componentProps:c=>({...typeof b=="function"?b(c):b,options:l.value[p]||[]})}}return m}));return o&&n.value.length>0&&e.onMounted(async()=>{await a()}),{enhancedSchema:i,optionsMap:l,loading:s,load:a}}async function bc(t,o){if(!t||t.length===0)return;const{load:r}=ve({numbList:t,fieldMapping:o,immediate:!1});await r()}function vc(t){const o=new Set;return t.forEach(r=>{r.selectOptions?.dictCode&&o.add(r.selectOptions.dictCode)}),Array.from(o)}class yc{cache=new Map;loadingPromises=new Map;async loadOptions(o,r,n=!1){const l=z.DEFAULT_FORM_COMMON_CONFIG.permissionOptionsAdapter;if(!l?.loadOptions)return console.warn("[PermissionOptionsManager] Adapter not configured"),{};if(!o||o.length===0)return{};const s=n?o:o.filter(f=>!this.cache.has(String(f)));if(s.length===0){const f={};return o.forEach(m=>{f[String(m)]=this.cache.get(String(m))||[]}),f}const a=s.map(String).sort((f,m)=>f.localeCompare(m)).join(",");let i=this.loadingPromises.get(a);i||(i=l.loadOptions(s,r),this.loadingPromises.set(a,i));try{const f=await i;f&&typeof f=="object"&&Object.keys(f).forEach(b=>{this.cache.set(b,f[b])});const m={};return o.forEach(b=>{m[String(b)]=this.cache.get(String(b))||[]}),m}finally{this.loadingPromises.delete(a)}}getOptions(o){return this.cache.get(String(o))||[]}clearCache(o){o?this.cache.delete(String(o)):this.cache.clear()}hasCache(o){return this.cache.has(String(o))}getCacheSize(){return this.cache.size}}const Ne=new yc;function qt(t){const{numbList:o,fieldMapping:r,immediate:n=!0,forceReload:l=!1}=t,s=e.ref({}),a=e.ref(!1),i=async()=>{if(!(!o||o.length===0)){a.value=!0;try{const p=await Ne.loadOptions(o,r,l);s.value=p}catch(p){console.error("[usePermissionOptions] Failed to load options:",p)}finally{a.value=!1}}},f=p=>s.value[String(p)]||[],m=async p=>{Ne.clearCache(p);const c=await Ne.loadOptions([p],r,!0);s.value={...s.value,...c}},b=p=>{if(Ne.clearCache(p),p){const c={...s.value};delete c[String(p)],s.value=c}else s.value={}};return n&&o&&o.length>0&&(e.getCurrentInstance()?e.onMounted(()=>{i()}):i()),{optionsMap:s,loading:a,load:i,getOptions:f,reload:m,clearCache:b}}function Ce(t,o={}){const{immediate:r=!0,onAutoSelect:n}=o,l=e.computed(()=>{const p=e.isRef(t)?t.value:t,c=[];return p.forEach(d=>{d.permissionOptions?.code&&c.push({fieldName:d.fieldName||"",...d.permissionOptions})}),console.log("[useSchemaPermissionLoader] collectDeclarations:",c),c}),s=e.computed(()=>{const p=new Set;return l.value.forEach(c=>{p.add(c.code)}),Array.from(p)}),{optionsMap:a,loading:i,load:f}=qt({numbList:s.value,fieldMapping:l.value[0]?.fieldMapping,immediate:!1}),m=e.computed(()=>{const p=e.isRef(t)?t.value:t;return console.log("[useSchemaPermissionLoader] schemaValue:",p),console.log("[useSchemaPermissionLoader] optionsMap.value:",a.value),p.map(c=>{if(c.permissionOptions?.code){const d=c.componentProps,u=String(c.permissionOptions.code);return{...c,componentProps:h=>({...typeof d=="function"?d(h):d,options:a.value[u]||[]})}}return c})}),b=e.computed(()=>{const p={};return l.value.forEach(c=>{if(c.autoSelectFirst){const d=String(c.code),u=a.value[d];u&&u.length>0&&(p[c.fieldName]=u[0].value)}}),p});return console.log("[useSchemaPermissionLoader] immediate:",r,"codes.value.length:",s.value.length),r&&s.value.length>0&&e.onMounted(async()=>{console.log("[useSchemaPermissionLoader] onMounted triggered, calling load()"),await f();const p=b.value;Object.keys(p).length>0&&n&&await n(p)}),{enhancedSchema:m,optionsMap:a,loading:i,load:f,autoSelectDefaults:b}}function Cc(t){const o=new Set;return t.forEach(r=>{r.permissionOptions?.code&&o.add(r.permissionOptions.code)}),Array.from(o)}async function Ve(t,o){const r=Object.keys(t);if(r.length===0)return;const n=await o.getValues();for(const l of r){const s=n[l];(s==null||s==="")&&await o.setFieldValue(l,t[l])}}const Kt={layout:"vertical",size:"mini",labelWidth:"auto",gridProps:{xGap:8,yGap:0},commonConfig:{colProps:{span:24,lg:8,xl:6}},showDefaultActions:!1,scrollToFirstError:!0};function xe({schema:t=[],objectToValueFields:o,handleValuesChange:r,...n}={}){const{enhancedSchema:l}=ye(t);let s;const{enhancedSchema:a}=Ce(l,{onAutoSelect:f=>Ve(f,s)}),i=z.useSunnyForm({...Kt,schema:a.value,...o?{objectToValueFields:o}:{},...r?{handleValuesChange:r}:{},...n});return s=i[1],i}const Wt=e.defineComponent({name:"OtherPermissionsAdd",__name:"OtherPermissionsAdd",props:{visible:{type:Boolean,default:!1},parentId:{default:"0"},parentName:{default:""},cExresnum:{default:""},id:{default:""}},emits:["update:visible","success"],setup(t,{emit:o}){const{t:r}=Y.useI18n(),{addFormSchema:n}=Be({t:r}),l=t,s=o;e.ref(!1);const[a,i]=xe({schema:n});e.watch(()=>l.visible,p=>{p&&(i.resetForm(),l.cExresnum&&i.setValues({cExresparnum:l.cExresnum,id:l.id}))});const f=e.computed(()=>l.parentId&&l.parentId!=="0"?`${r("otherPermissions.addTitle")} - ${l.parentName}`:r("otherPermissions.addTitle"));async function m(){try{const{valid:p}=await i.validate();if(!p)return!1;const d={authExres:{...await i.getValues(),cExresparnum:l.cExresnum||"",id:l.id||""}},u=await I.post("/core/authExres/add",d);return S.Message.success(u.message||r("otherPermissions.addSuccess")),s("success"),!0}catch(p){return console.error("新增失败:",p),!1}}function b(){s("update:visible",!1)}return(p,c)=>(e.openBlock(),e.createBlock(e.unref(z.Modal),{"model-value":l.visible,title:f.value,width:700,"on-before-ok":m,"onUpdate:modelValue":c[0]||(c[0]=d=>s("update:visible",d)),onClose:b},{default:e.withCtx(()=>[e.createVNode(e.unref(a))]),_:1},8,["model-value","title"]))}}),Gt=e.defineComponent({name:"OtherPermissionsUpdate",__name:"OtherPermissionsUpdate",props:{visible:{type:Boolean,default:!1},row:{default:null}},emits:["update:visible","success"],setup(t,{emit:o}){const{t:r}=Y.useI18n(),{addFormSchema:n}=Be({t:r}),l=t,s=o;e.ref(!1);const[a,i]=xe({schema:n});e.watch(()=>l.visible,p=>{p&&l.row&&(i.resetForm(),i.setValues({...l.row}),i.updateSchema([{fieldName:"cExresnum",componentProps:{disabled:!0}}]))});const f=e.computed(()=>r("otherPermissions.updateTitle"));async function m(){try{const{valid:p}=await i.validate();if(!p)return!1;const d={authExres:{...await i.getValues(),id:l.row.id,cExresparnum:l.row.cExresparnum||""}},u=await I.post("/core/authExres/edit",d);return S.Message.success(u.message||r("otherPermissions.updateSuccess")),s("success"),!0}catch(p){return console.error("修改失败:",p),!1}}function b(){s("update:visible",!1)}return(p,c)=>(e.openBlock(),e.createBlock(e.unref(z.Modal),{"model-value":l.visible,title:f.value,width:700,"on-before-ok":m,"onUpdate:modelValue":c[0]||(c[0]=d=>s("update:visible",d)),onClose:b},{default:e.withCtx(()=>[e.createVNode(e.unref(a))]),_:1},8,["model-value","title"]))}}),xc={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},kc={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},wc={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},Sc=e.defineComponent({__name:"OtherPermissionsQuery",setup(t){const{t:o}=Y.useI18n(),{searchFormSchema:r,tableColumns:n}=Be({t:o}),l=async({page:T,formValues:O})=>{const j={pageNo:T.currentPage,pageSize:T.pageSize,authExres:{...O,nType:0}},q=await I.post("/core/authExres/selectForPage",j);return q.result?.records&&(q.result.records=q.result.records.map(G=>({...G,hasChildren:!0}))),q};async function s({row:T}){await f.getValues();const O={authExres:{cExresparnum:T.cExresnum}};try{return((await I.post("/core/authExres/queryChildList",O)).result?.authExresList||[]).map(G=>({...G}))}catch(j){return console.error("加载子节点失败:",j),[]}}const a={lazy:!0,rowField:"id",hasChild:"hasChildren",expandAll:!1,loadMethod:s},{QueryForm:i,formApi:f,Grid:m,gridApi:b,submitting:p,handleGlobalEnter:c,searchPlanList:d,currentSearchPlan:u,resourceId:h,nResourceid:g,handleSearchPlanSearch:y,handleDefaultPlanLoaded:x,businessResumeState:v}=ce({searchFormSchema:r,tableColumns:n,resourceConfig:hc,queryFunction:l,gridEvents:{toolbarButtonClick:({code:T})=>{T==="otherPermissions/add"?E():T==="otherPermissions/update"?_():T==="otherPermissions/enable"?L("10001"):T==="otherPermissions/disable"?L("10002"):T==="otherPermissions/del"&&k()}},treeConfig:a,lazy:!0});function E(){const T=b.getSelection();if(T.length>1){S.Message.warning(o("common.selectOne"));return}T.length===1?(C.value=T[0].cExresnum,w.value=T[0].id,P.value=T[0].id,R.value=T[0].cExresname):(C.value="",w.value="",P.value="0",R.value=""),M.value=!0}function _(){const T=b.getSelection();if(T.length!==1){S.Message.warning("请选择一条数据进行修改");return}const O=T[0];N.value=O,V.value=!0}async function L(T){const O=b.getSelection();if(O.length===0){S.Message.warning("请选择要操作的数据");return}if(O.length>1){S.Message.warning(o("common.selectOne"));return}const j=O[0];try{const q=await I.post("/core/authExres/sign",{authExres:{id:j.id,cSign:T}});S.Message.success(q.message||o("otherPermissions.signSuccess")),b.commitProxy("query")}catch(q){console.error("操作失败:",q)}}function k(){const T=b.getSelection();if(T.length===0){S.Message.warning(o("common.selectData"));return}if(T.length>1){S.Message.warning(o("common.selectOne"));return}const O=T[0];S.Modal.confirm({title:o("common.confirm"),content:o("otherPermissions.delConfirm"),okText:o("common.confirm"),cancelText:o("common.cancel"),onOk:async()=>{try{const j=await I.post("/core/authExres/delete",{authExres:{id:O.id}});S.Message.success(j.message||o("otherPermissions.delSuccess")),b.commitProxy("query")}catch(j){console.error("删除失败:",j)}}})}function B(){b.commitProxy("query")}const M=e.ref(!1),P=e.ref("0"),R=e.ref(""),C=e.ref(""),w=e.ref(""),V=e.ref(!1),N=e.ref(null);return(T,O)=>(e.openBlock(),e.createElementBlock("div",{class:"other-permissions-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:O[2]||(O[2]=e.withKeys((...j)=>e.unref(c)&&e.unref(c)(...j),["enter"])),tabindex:"-1"},[e.createElementVNode("div",xc,[e.createElementVNode("div",kc,[e.createVNode(e.unref(i))]),e.createElementVNode("div",wc,[e.createVNode(e.unref(m),{class:"flex-1"})])]),e.createVNode(Wt,{visible:M.value,"onUpdate:visible":O[0]||(O[0]=j=>M.value=j),"parent-id":P.value,"parent-name":R.value,"c-exresnum":C.value,id:w.value,onSuccess:B},null,8,["visible","parent-id","parent-name","c-exresnum","id"]),e.createVNode(Gt,{visible:V.value,"onUpdate:visible":O[1]||(O[1]=j=>V.value=j),row:N.value,onSuccess:B},null,8,["visible","row"]),e.createVNode(e.unref(ke),{state:e.unref(v)},null,8,["state"])],32))}}),Nc=re(Sc,[["__scopeId","data-v-96f076fe"]]);function Ht(){return I.post("/core/assSysSetting/findAllSettings",{})}function Jt(t){return I.post("/core/assSysSetting/saveAllSettings",{assSysSettingList:t})}const _c={class:"h-full w-full overflow-auto bg-[var(--color-fill-2)]"},Vc={class:"flex flex-col h-full w-full"},Ec={class:"flex-1 overflow-auto"},Pc={class:"space-y-4"},Mc={class:"grid grid-cols-1 md:grid-cols-2 gap-x-8 gap-y-4"},Tc={class:"flex items-center gap-3"},Bc={class:"shrink-0 w-20 text-sm text-[var(--color-text-2)]"},Rc={class:"flex items-start gap-3"},$c={class:"shrink-0 w-20 pt-1.5 text-sm text-[var(--color-text-2)]"},Lc={class:"flex-1"},Ic={class:"flex gap-2"},Dc={key:0,class:"flex flex-wrap gap-1.5 mt-2"},Oc={class:"grid grid-cols-1 lg:grid-cols-2 gap-4 items-start"},jc={class:"flex items-center justify-between"},zc={class:"text-sm text-[var(--color-text-1)]"},Fc={class:"text-xs text-[var(--color-text-4)] mt-0.5"},Ac={key:0,class:"mt-4 pt-4 border-t border-[var(--color-border-1)] space-y-3"},Uc={class:"flex items-center gap-3"},qc={class:"shrink-0 w-20 text-sm text-[var(--color-text-2)]"},Kc={class:"flex items-center gap-3"},Wc={class:"shrink-0 w-20 text-sm text-[var(--color-text-2)]"},Gc={class:"flex items-center justify-between"},Hc={class:"text-sm text-[var(--color-text-1)]"},Jc={class:"text-xs text-[var(--color-text-4)] mt-0.5"},Qc={class:"shrink-0 p-2 bg-[var(--color-bg-2)] border-t border-[var(--color-border-1)]"},Xc={class:"flex justify-end"},Yc=e.defineComponent({__name:"SystemSetting",setup(t){const{t:o}=ne.useI18n(),r=e.ref(!1),n=e.ref(!1),l=e.reactive({initialPassword:"",weakPasswords:[],showSubMenuIcon:!0,showAgent:!1,agentUrl:"",agentToken:""}),s=e.ref([]),a=e.ref(""),i=e.computed(()=>l.showAgent),f=()=>{const c=a.value.trim();if(!c){S.Message.warning(o("common.systemSetting.enterWeakPassword"));return}if(s.value.some(d=>d.password===c)){S.Message.warning(o("common.systemSetting.weakPasswordExists"));return}s.value.push({id:Date.now().toString(),password:c}),l.weakPasswords=s.value.map(d=>d.password),a.value=""},m=c=>{s.value=s.value.filter(d=>d.id!==c),l.weakPasswords=s.value.map(d=>d.password)},b=async()=>{r.value=!0;try{((await Ht()).result||[]).forEach(u=>{switch(u.cNum){case"InitPwd":l.initialPassword=u.cValue||"";break;case"PwdStrVal":try{const h=JSON.parse(u.cValue||"{}");h.list&&Array.isArray(h.list)&&(s.value=h.list.map((g,y)=>({id:String(y),password:g})),l.weakPasswords=h.list)}catch(h){console.error("Parse weak password config failed",h)}break;case"SubMenuIconShow":try{const h=JSON.parse(u.cValue||"{}");l.showSubMenuIcon=h.show===h.activeValue||h.show==="1"}catch(h){console.error("Parse menu icon config failed",h)}break;case"ShowAgent":try{const h=JSON.parse(u.cValue||"{}");l.showAgent=h.show===h.activeValue||h.show==="1",l.agentUrl=h.agentUrl||"",l.agentToken=h.token||""}catch(h){console.error("Parse agent config failed",h)}break}})}catch{S.Message.error(o("common.systemSetting.loadFailed"))}finally{r.value=!1}},p=async()=>{if(l.showAgent){if(!l.agentUrl.trim()){S.Message.warning(o("common.systemSetting.enterAgentUrl"));return}if(!l.agentToken.trim()){S.Message.warning(o("common.systemSetting.enterAgentToken"));return}}n.value=!0;try{const c=[{cNum:"InitPwd",cValue:l.initialPassword},{cNum:"PwdStrVal",cValue:JSON.stringify({enabled:!0,list:l.weakPasswords})},{cNum:"SubMenuIconShow",cValue:JSON.stringify({show:l.showSubMenuIcon?"1":"0",activeText:"显示",activeValue:"1",inactiveText:"不显示",inactiveValue:"0"})},{cNum:"ShowAgent",cValue:JSON.stringify({show:l.showAgent?"1":"0",activeText:"显示",activeValue:"1",inactiveText:"不显示",inactiveValue:"0",type:"dify",token:l.agentToken,agentUrl:l.agentUrl})}];await Jt(c),S.Message.success(o("common.systemSetting.saveSuccess"))}catch{S.Message.error(o("common.systemSetting.saveFailed"))}finally{n.value=!1}};return b(),(c,d)=>{const u=e.resolveComponent("a-input-password"),h=e.resolveComponent("a-input"),g=e.resolveComponent("a-button"),y=e.resolveComponent("a-tag"),x=e.resolveComponent("a-card"),v=e.resolveComponent("a-switch"),E=e.resolveComponent("a-spin");return e.openBlock(),e.createElementBlock("div",_c,[e.createVNode(E,{loading:r.value,class:"h-full w-full"},{default:e.withCtx(()=>[e.createElementVNode("div",Vc,[e.createElementVNode("div",Ec,[e.createElementVNode("div",Pc,[e.createVNode(x,{title:e.unref(o)("common.systemSetting.securitySetting"),bordered:!1},{extra:e.withCtx(()=>[e.createVNode(e.unref(Kn),{class:"text-[var(--color-text-4)]"})]),default:e.withCtx(()=>[e.createElementVNode("div",Mc,[e.createElementVNode("div",Tc,[e.createElementVNode("label",Bc,e.toDisplayString(e.unref(o)("common.systemSetting.initialPassword")),1),e.createVNode(u,{modelValue:l.initialPassword,"onUpdate:modelValue":d[0]||(d[0]=_=>l.initialPassword=_),placeholder:e.unref(o)("common.systemSetting.initialPasswordPlaceholder"),"allow-clear":"",class:"flex-1"},null,8,["modelValue","placeholder"])]),e.createElementVNode("div",Rc,[e.createElementVNode("label",$c,e.toDisplayString(e.unref(o)("common.systemSetting.weakPassword")),1),e.createElementVNode("div",Lc,[e.createElementVNode("div",Ic,[e.createVNode(h,{modelValue:a.value,"onUpdate:modelValue":d[1]||(d[1]=_=>a.value=_),placeholder:e.unref(o)("common.systemSetting.weakPasswordPlaceholder"),"allow-clear":"",size:"small",onPressEnter:f},null,8,["modelValue","placeholder"]),e.createVNode(g,{type:"primary",size:"small",onClick:f},{default:e.withCtx(()=>[e.createVNode(e.unref(xt))]),_:1})]),s.value.length>0?(e.openBlock(),e.createElementBlock("div",Dc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,_=>(e.openBlock(),e.createBlock(y,{key:_.id,closable:"",color:"orangered",size:"small",onClose:L=>m(_.id)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(_.password),1)]),_:2},1032,["onClose"]))),128))])):e.createCommentVNode("",!0)])])])]),_:1},8,["title"]),e.createElementVNode("div",Oc,[e.createVNode(x,{title:e.unref(o)("common.systemSetting.agentSetting"),bordered:!1},{extra:e.withCtx(()=>[e.createVNode(e.unref(Fn),{class:"text-[var(--color-text-4)]"})]),default:e.withCtx(()=>[e.createElementVNode("div",jc,[e.createElementVNode("div",null,[e.createElementVNode("div",zc,e.toDisplayString(e.unref(o)("common.systemSetting.enableAgent")),1),e.createElementVNode("div",Fc,e.toDisplayString(e.unref(o)("common.systemSetting.enableAgentDesc")),1)]),e.createVNode(v,{modelValue:l.showAgent,"onUpdate:modelValue":d[2]||(d[2]=_=>l.showAgent=_)},null,8,["modelValue"])]),e.createVNode(e.Transition,{name:"expand"},{default:e.withCtx(()=>[i.value?(e.openBlock(),e.createElementBlock("div",Ac,[e.createElementVNode("div",Uc,[e.createElementVNode("label",qc,e.toDisplayString(e.unref(o)("common.systemSetting.agentUrl")),1),e.createVNode(h,{modelValue:l.agentUrl,"onUpdate:modelValue":d[3]||(d[3]=_=>l.agentUrl=_),placeholder:e.unref(o)("common.systemSetting.agentUrlPlaceholder"),"allow-clear":"",class:"flex-1"},null,8,["modelValue","placeholder"])]),e.createElementVNode("div",Kc,[e.createElementVNode("label",Wc,e.toDisplayString(e.unref(o)("common.systemSetting.agentToken")),1),e.createVNode(u,{modelValue:l.agentToken,"onUpdate:modelValue":d[4]||(d[4]=_=>l.agentToken=_),placeholder:e.unref(o)("common.systemSetting.agentTokenPlaceholder"),"allow-clear":"",class:"flex-1"},null,8,["modelValue","placeholder"])])])):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["title"]),e.createVNode(x,{title:e.unref(o)("common.systemSetting.interfaceSetting"),bordered:!1},{extra:e.withCtx(()=>[e.createVNode(e.unref(Dn),{class:"text-[var(--color-text-4)]"})]),default:e.withCtx(()=>[e.createElementVNode("div",Gc,[e.createElementVNode("div",null,[e.createElementVNode("div",Hc,e.toDisplayString(e.unref(o)("common.systemSetting.subMenuIcon")),1),e.createElementVNode("div",Jc,e.toDisplayString(e.unref(o)("common.systemSetting.subMenuIconDesc")),1)]),e.createVNode(v,{modelValue:l.showSubMenuIcon,"onUpdate:modelValue":d[5]||(d[5]=_=>l.showSubMenuIcon=_)},null,8,["modelValue"])])]),_:1},8,["title"])])])]),e.createElementVNode("div",Qc,[e.createElementVNode("div",Xc,[e.createVNode(g,{type:"primary",loading:n.value,onClick:p},{icon:e.withCtx(()=>[e.createVNode(e.unref(pn))]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(o)("common.systemSetting.save")),1)]),_:1},8,["loading"])])])])]),_:1},8,["loading"])])}}}),Zc=[{label:"启用",value:"10001"},{label:"禁用",value:"10002"}],ed=[{fieldName:"cXuhao",label:"字典编号",component:"Input",componentProps:{placeholder:"请输入字典编号",allowClear:!0},colProps:{span:6}},{fieldName:"cName",label:"字典名称",component:"Input",componentProps:{placeholder:"请输入字典名称",allowClear:!0},colProps:{span:6}},{fieldName:"cSign",label:"是否启用",component:"Select",selectOptions:{dictCode:"SFQY",fieldMapping:{label:"cName",value:"cXuhao"}},componentProps:{placeholder:"请选择是否启用",allowClear:!0},colProps:{span:6}}],Qt=[{fieldName:"parentName",label:"父级字典",component:"Input",componentProps:{disabled:!0,placeholder:"无"}},{fieldName:"cXuhao",label:"字典编号",component:"Input",rules:"required",componentProps:{placeholder:"请输入字典编号",allowClear:!0}},{fieldName:"cName",label:"字典名称",component:"Input",rules:"required",componentProps:{placeholder:"请输入字典名称",allowClear:!0}},{fieldName:"cSign",label:"是否启用",component:"Select",rules:"required",selectOptions:{dictCode:"SFQY"},componentProps:{placeholder:"请选择是否启用"}},{fieldName:"nOrder",label:"排序",component:"InputNumber",componentProps:{placeholder:"请输入排序",min:0,precision:0}}],td=[{type:"checkbox",width:50},{field:"id",title:"数据字典ID",minWidth:140,treeNode:!0,params:{nBill:3,cEntityTable:"AUTH_DICT"}},{field:"cXuhao",title:"字典编号",minWidth:140},{field:"cName",title:"字典名称",minWidth:180},{field:"cSign",title:"是否启用",width:100,formatter:({cellValue:t})=>Zc.find(r=>r.value===t)?.label||t},{field:"cCreateName",title:"创建人",width:120},{field:"dCreate",title:"创建时间",width:180},{field:"nOrder",title:"排序",width:80}],Xt=[{type:"checkbox",width:50,align:"center"},{field:"key",title:"属性键",minWidth:150,...z.EditRender.SelectRender,params:{placeholder:"请选择属性键",allowClear:!0,options:[]},selectOptions:{dictCode:"DICTATTR",fieldMapping:{label:"cName",value:"cXuhao"}},formatter:({cellValue:t,column:o})=>(o.params?.options||[]).find(l=>l.value===t)?.label||t},{field:"value",title:"属性值",minWidth:200,...z.EditRender.InputRender,params:{placeholder:"请输入属性值",allowClear:!0}}],od=[{field:"cXuhao",title:"子级数据字典编号",minWidth:200,...z.EditRender.InputRender,params:{placeholder:"请输入子级数据字典编号",allowClear:!0,disabled:!0}},{field:"cName",title:"子级数据字典名称",minWidth:200,...z.EditRender.InputRender,params:{placeholder:"请输入子级数据字典名称",allowClear:!0}},{field:"nOrder",title:"子级数据字典排序",minWidth:150,...z.EditRender.InputRender,params:{placeholder:"请输入排序",allowClear:!0}}],Yt={key:[{required:!0,message:"请输入属性键"}]},Zt=[{code:"insert",name:"添加属性"},{code:"remove",name:"删除"}],yt=[{title:"额外属性",type:"grid",gridConfig:{columns:Xt,editRules:Yt,toolbarButtons:Zt}},{title:"子级数据字典",type:"grid",gridConfig:{columns:od,editRules:{},toolbarButtons:[]}}],nd={resourceId:"dataDictionary",nResourceid:62,cModnumb:"40577f0e-1c19-4fa6-bb88-d247fff5e32a"};function dt({formSchema:t=[],tableColumns:o=[],tableEditRules:r={},tableToolbarButtons:n=[],objectToValueFields:l,aggregateConfig:s,gridEvents:a}={}){const{enhancedSchema:i}=ye(t);let f;const{enhancedSchema:m}=Ce(i,{onAutoSelect:_=>Ve(_,f)}),p=(()=>{const _=new Set;return o.forEach(L=>{L.selectOptions?.dictCode&&_.add(L.selectOptions.dictCode)}),Array.from(_)})(),{optionsMap:c,load:d}=ve({numbList:p,immediate:!1});p.length>0&&d();const[u,h]=z.useSunnyForm({layout:"horizontal",size:"mini",labelWidth:100,gridProps:{xGap:0,yGap:0},showDefaultActions:!1,scrollToFirstError:!0,schema:m.value,...l?{objectToValueFields:l}:{}});f=h;const g=_=>_.map(L=>{if(L.selectOptions?.dictCode){const k=String(L.selectOptions.dictCode),B=c.value[k]||[];return{...L,params:{...L.params,options:B}}}return L}),y=e.reactive({id:"meta-grid",columns:g(o),data:[],size:"mini",editRules:r,height:"auto",clipConfig:z.createEditableClipConfig(),toolbarConfig:{enabled:!0,zoom:!0,custom:!0,buttons:n},zoomConfig:{enabled:!0},columnConfig:{resizable:!0},customConfig:{storage:!0,mode:"popup",showSortPutButton:!0,visibleMethod:_=>!(_.column.type==="checkbox"||_.column.type==="seq")},...s&&{aggregateConfig:s}});e.watch(()=>c.value,()=>{y.columns=g(o)},{deep:!0});const[x,v]=z.useSunnyEditGrid({gridOptions:y,gridEvents:a}),E=v.reloadData.bind(v);return v.reloadData=_=>(y.data=_,E(_)),[u,h,x,v]}const rd=e.defineComponent({name:"DataDictionaryAdd",__name:"DataDictionaryAdd",props:{visible:{type:Boolean,default:!1},parentId:{default:"0"},parentName:{default:""}},emits:["update:visible","success"],setup(t,{emit:o}){const r=t,n=o;e.ref(!1);const[l,s,a,i]=dt({formSchema:Qt,tableColumns:Xt,tableEditRules:Yt,tableToolbarButtons:Zt});e.watch(()=>r.visible,p=>{p&&(s.resetForm(),s.setValues({parentName:r.parentName||"无"}),i.reloadData([]))});const f=e.computed(()=>r.parentId&&r.parentId!=="0"?`新增子级字典 - ${r.parentName}`:"新增根级字典");async function m(){try{const{valid:p}=await s.validate();if(!p||await i.validate())return!1;const d=await i.getFullData(),u=d.filter(E=>E.key).map(E=>E.key),h=new Set(u);if(u.length!==h.size)return S.Message.warning("属性键不能重复"),!1;const g=await s.getValues(),y={};d.forEach(E=>{E.key&&(y[E.key]=E.value||"")});const x={authDict:{cXuhao:g.cXuhao,cName:g.cName,cSign:g.cSign,nParent:r.parentId||"0",nOrder:g.nOrder||0,cMeta:JSON.stringify(y)}},v=await I.post("/core/authDict/add",x);return S.Message.success(v.message),n("success"),!0}catch(p){return console.error("新增失败:",p),!1}}function b(){n("update:visible",!1)}return(p,c)=>(e.openBlock(),e.createBlock(e.unref(z.Modal),{"model-value":r.visible,title:f.value,width:700,"on-before-ok":m,"onUpdate:modelValue":c[0]||(c[0]=d=>n("update:visible",d)),onClose:b},{default:e.withCtx(()=>[e.createVNode(e.unref(l)),e.createVNode(e.unref(a),{id:"metaGrid",border:"","max-height":"300"})]),_:1},8,["model-value","title"]))}});function ut({formSchema:t=[],tabsConfig:o=[],objectToValueFields:r}={}){const{enhancedSchema:n}=ye(t);let l;const{enhancedSchema:s}=Ce(n,{onAutoSelect:u=>Ve(u,l)}),i=(()=>{const u=new Set;return o.forEach(g=>{g.type==="grid"&&g.gridConfig&&g.gridConfig.columns.forEach(y=>{y.selectOptions?.dictCode&&u.add(y.selectOptions.dictCode)})}),Array.from(u)})(),{optionsMap:f,load:m}=ve({numbList:i,immediate:!1});i.length>0&&m();const[b,p]=z.useSunnyForm({layout:"horizontal",size:"small",labelWidth:100,gridProps:{xGap:0,yGap:0},showDefaultActions:!1,scrollToFirstError:!0,schema:s.value,...r?{objectToValueFields:r}:{}});l=p;const c=e.shallowRef([]),d=e.ref([]);return o.forEach((u,h)=>{if(u.type==="grid"&&u.gridConfig){const g=e.reactive({id:`grid-${h}`,columns:u.gridConfig.columns,data:[],editRules:u.gridConfig.editRules,height:"auto",clipConfig:z.createEditableClipConfig(),toolbarConfig:{enabled:u.gridConfig.toolbarButtons&&u.gridConfig.toolbarButtons.length>0,zoom:!0,custom:!0,buttons:u.gridConfig.toolbarButtons||[]},zoomConfig:{enabled:!0},customConfig:{storage:!0,mode:"popup",visibleMethod:E=>!(E.column.type==="checkbox"||E.column.type==="seq")},...u.gridConfig.aggregateConfig&&{aggregateConfig:u.gridConfig.aggregateConfig}});e.watch(()=>f.value,E=>{g.columns=(g.columns||[]).map(_=>{if(_.selectOptions?.dictCode){const L=String(_.selectOptions.dictCode),k=E[L]||[];return{..._,params:{..._.params,options:k}}}return _})},{deep:!0});const[y,x]=z.useSunnyEditGrid({gridOptions:g}),v={...x,reloadData:E=>(g.data=E,x.reloadData(E)),validate:()=>x.validate(),getFullData:()=>x.getFullData()};c.value.push(e.markRaw(y)),d.value.push(v)}}),[b,p,c,d]}const ld=e.defineComponent({name:"DataDictionaryUpdate",__name:"DataDictionaryUpdate",props:{visible:{type:Boolean,default:!1},row:{default:void 0}},emits:["update:visible","success"],setup(t,{emit:o}){const{TabPane:r}=S.Tabs,n=t,l=o;e.ref(!1);const s=e.ref(0),[a,i,f,m]=ut({formSchema:Qt,tabsConfig:yt});e.watch(()=>n.visible,async d=>{if(d&&n.row){await e.nextTick(),i.resetForm(),m.value[0].reloadData([]);try{const h=(await I.post("/core/authDict/editInit",{authDict:{id:n.row.id}})).result;if(h){if(i.setValues({cXuhao:h.authDict.cXuhao,cName:h.authDict.cName,cSign:h.authDict.cSign,nOrder:h.authDict.nOrder}),h.authDict.cMeta)try{const g=JSON.parse(h.authDict.cMeta),y=Object.keys(g).map(x=>({key:x,value:g[x]}));m.value[0].reloadData(y)}catch(g){console.error("解析额外属性失败:",g)}h.childList&&h.childList.length>0?m.value[1].reloadData(h.childList):m.value[1].reloadData([])}}catch(u){console.error("加载数据失败:",u),S.Message.error("加载数据失败")}}});const b=e.computed(()=>"修改字典");async function p(){try{const{valid:d}=await i.validate();if(!d||await m.value[0].validate())return!1;const h=await m.value[0].getFullData(),g=h.filter(k=>k.key).map(k=>k.key),y=new Set(g);if(g.length!==y.size)return S.Message.warning("属性键不能重复"),!1;const x=await i.getValues(),v={};h.forEach(k=>{k.key&&(v[k.key]=k.value||"")});const E=await m.value[1].getFullData(),_={authDict:{id:n.row?.id,cXuhao:x.cXuhao,cName:x.cName,cSign:x.cSign,nOrder:x.nOrder||0,cMeta:JSON.stringify(v),nParent:n.row?.nParent||0,nType:n.row?.nType||1},authDictList:E},L=await I.post("/core/authDict/edit",_);return S.Message.success(L.message),l("success"),!0}catch(d){return console.error("修改失败:",d),!1}}function c(){l("update:visible",!1)}return(d,u)=>(e.openBlock(),e.createBlock(e.unref(z.Modal),{"model-value":n.visible,title:b.value,width:700,"on-before-ok":p,"onUpdate:modelValue":u[1]||(u[1]=h=>l("update:visible",h)),onClose:c},{default:e.withCtx(()=>[e.createVNode(e.unref(a)),e.createVNode(e.unref(S.Tabs),{modelValue:s.value,"onUpdate:modelValue":u[0]||(u[0]=h=>s.value=h)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(yt),(h,g)=>(e.openBlock(),e.createBlock(e.unref(r),{key:g,title:h.title},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(f)[g]),{id:`grid-${g}`,border:"","max-height":"300"},null,8,["id"]))]),_:2},1032,["title"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["model-value","title"]))}}),ad={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},sd={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},id={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},cd=e.defineComponent({__name:"DataDictionaryQuery",setup(t){const o=async({page:R,formValues:C})=>{const w={pageNo:R.currentPage,pageSize:R.pageSize,authDict:{cSign:C.cSign||"",cXuhao:C.cXuhao||"",cName:C.cName||"",nParent:0}},V=await I.post("/core/authDict/selectForPage",w);return V.result?.records&&(V.result.records=V.result.records.map(N=>({...N,hasChildren:!0}))),V};async function r({row:R}){const w={pageNo:1,pageSize:9999,authDict:{...await s.getValues(),nParent:R.id}};try{return((await I.post("/core/authDict/selectForPage",w)).result?.records||[]).map(T=>({...T,hasChildren:!0}))}catch(V){return console.error("加载子节点失败:",V),[]}}const n={lazy:!0,rowField:"id",hasChild:"hasChildren",expandAll:!1,loadMethod:r},{QueryForm:l,formApi:s,Grid:a,gridApi:i,submitting:f,handleGlobalEnter:m,searchPlanList:b,currentSearchPlan:p,resourceId:c,nResourceid:d,handleSearchPlanSearch:u,handleDefaultPlanLoaded:h,businessResumeState:g}=ce({searchFormSchema:ed,tableColumns:td,resourceConfig:nd,queryFunction:o,gridEvents:{toolbarButtonClick:({code:R})=>{R==="dataDictionary/add"?L():R==="dataDictionary/update"?k():R==="dataDictionary/enable"?B("10001"):R==="dataDictionary/disable"?B("10002"):R==="dataDictionary/del"&&M()}},treeConfig:n,lazy:!0}),y=e.ref(!1),x=e.ref("0"),v=e.ref(""),E=e.ref(!1),_=e.ref(void 0);function L(){const R=i.getSelection();if(R.length>1){S.Message.warning("最多只能选择一条数据作为父级");return}R.length===1?(x.value=R[0].id,v.value=R[0].cName):(x.value="0",v.value=""),y.value=!0}function k(){const R=i.getSelection();if(R.length===0){S.Message.warning("请选择要修改的数据");return}if(R.length>1){S.Message.warning("一次只能修改一条数据");return}_.value=R[0],E.value=!0}async function B(R){const C=i.getSelection();if(C.length===0){S.Message.warning("请选择要操作的数据");return}if(C.length>1){S.Message.warning("一次只能操作一条数据");return}const w=C[0],V=R==="10001"?"启用":"禁用";try{const N=await I.post("/core/authDict/sign",{authDict:{id:w.id,cSign:R}});S.Message.success(N.message||`${V}成功`),i.commitProxy("query")}catch(N){console.error(`${V}失败:`,N)}}function M(){const R=i.getSelection();if(R.length===0){S.Message.warning("请选择要删除的数据");return}if(R.length>1){S.Message.warning("一次只能删除一条数据");return}const C=R[0];S.Modal.confirm({title:"确认删除",content:`确定要删除「${C.cName}」吗?`,okText:"确定",cancelText:"取消",onOk:async()=>{try{const w=await I.post("/core/authDict/delete",{authDict:{id:C.id}});S.Message.success(w.message||"删除成功"),i.commitProxy("query")}catch(w){console.error("删除失败:",w)}}})}function P(){i.commitProxy("query")}return(R,C)=>(e.openBlock(),e.createElementBlock("div",{class:"data-dictionary-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:C[2]||(C[2]=e.withKeys((...w)=>e.unref(m)&&e.unref(m)(...w),["enter"])),tabindex:"-1"},[e.createElementVNode("div",ad,[e.createElementVNode("div",sd,[e.createVNode(e.unref(l))]),e.createElementVNode("div",id,[e.createVNode(e.unref(a),{class:"flex-1"})])]),e.createVNode(rd,{visible:y.value,"onUpdate:visible":C[0]||(C[0]=w=>y.value=w),"parent-id":x.value,"parent-name":v.value,onSuccess:P},null,8,["visible","parent-id","parent-name"]),e.createVNode(ld,{visible:E.value,"onUpdate:visible":C[1]||(C[1]=w=>E.value=w),row:_.value,onSuccess:P},null,8,["visible","row"]),e.createVNode(e.unref(ke),{state:e.unref(g)},null,8,["state"])],32))}}),dd=re(cd,[["__scopeId","data-v-4940c6dd"]]),ud=[{label:"启用",value:"10001"},{label:"禁用",value:"10002"}],md=[{fieldName:"cXuhao",label:"字典编号",component:"Input",componentProps:{placeholder:"请输入字典编号",allowClear:!0},colProps:{span:6}},{fieldName:"cName",label:"字典名称",component:"Input",componentProps:{placeholder:"请输入字典名称",allowClear:!0},colProps:{span:6}},{fieldName:"cSign",label:"是否启用",component:"Select",selectOptions:{dictCode:"SFQY",fieldMapping:{label:"cName",value:"cXuhao"}},componentProps:{placeholder:"请选择是否启用",allowClear:!0},colProps:{span:6}}],eo=[{fieldName:"parentName",label:"父级字典",component:"Input",componentProps:{disabled:!0,placeholder:"无"}},{fieldName:"cXuhao",label:"字典编号",component:"Input",rules:"required",componentProps:{placeholder:"请输入字典编号",allowClear:!0}},{fieldName:"cName",label:"字典名称",component:"Input",rules:"required",componentProps:{placeholder:"请输入字典名称",allowClear:!0}},{fieldName:"cSign",label:"是否启用",component:"Select",rules:"required",selectOptions:{dictCode:"SFQY"},componentProps:{placeholder:"请选择是否启用"}},{fieldName:"nOrder",label:"排序",component:"InputNumber",componentProps:{placeholder:"请输入排序",min:0,precision:0}}],pd=[{type:"checkbox",width:50},{field:"id",title:"数据字典ID",minWidth:140,treeNode:!0,params:{nBill:3,cEntityTable:"AUTH_DICT"}},{field:"cXuhao",title:"字典编号",minWidth:140},{field:"cName",title:"字典名称",minWidth:180},{field:"cSign",title:"是否启用",width:100,formatter:({cellValue:t})=>ud.find(r=>r.value===t)?.label||t},{field:"cCreateName",title:"创建人",width:120},{field:"dCreate",title:"创建时间",width:180},{field:"nOrder",title:"排序",width:80}],to=[{type:"checkbox",width:50,align:"center"},{field:"key",title:"属性键",minWidth:150,...z.EditRender.SelectRender,params:{placeholder:"请选择属性键",allowClear:!0,options:[]},selectOptions:{dictCode:"DICTATTR",fieldMapping:{label:"cName",value:"cXuhao"}}},{field:"value",title:"属性值",minWidth:200,...z.EditRender.InputRender,params:{placeholder:"请输入属性值",allowClear:!0}}],fd=[{field:"cXuhao",title:"子级数据字典编号",minWidth:200,...z.EditRender.InputRender,params:{placeholder:"请输入子级数据字典编号",allowClear:!0,disabled:!0}},{field:"cName",title:"子级数据字典名称",minWidth:200,...z.EditRender.InputRender,params:{placeholder:"请输入子级数据字典名称",allowClear:!0}},{field:"nOrder",title:"子级数据字典排序",minWidth:150,...z.EditRender.InputRender,params:{placeholder:"请输入排序",allowClear:!0}}],oo={key:[{required:!0,message:"请输入属性键"}]},no=[{code:"insert",name:"添加属性"},{code:"remove",name:"删除"}],Ct=[{title:"额外属性",type:"grid",gridConfig:{columns:to,editRules:oo,toolbarButtons:no}},{title:"子级数据字典",type:"grid",gridConfig:{columns:fd,editRules:{},toolbarButtons:[]}}],hd={resourceId:"ywsjzd",nResourceid:161,cModnumb:"b2a3c6ba-d6d8-4d51-ad78-887f05b9e56b"},gd=e.defineComponent({name:"YwsjzdAdd",__name:"YwsjzdAdd",props:{visible:{type:Boolean,default:!1},parentId:{default:"0"},parentName:{default:""}},emits:["update:visible","success"],setup(t,{emit:o}){const r=t,n=o;e.ref(!1);const[l,s,a,i]=dt({formSchema:eo,tableColumns:to,tableEditRules:oo,tableToolbarButtons:no});e.watch(()=>r.visible,p=>{p&&(s.resetForm(),s.setValues({parentName:r.parentName||"无"}),i.reloadData([]))});const f=e.computed(()=>r.parentId&&r.parentId!=="0"?`新增子级字典 - ${r.parentName}`:"新增根级字典");async function m(){try{const{valid:p}=await s.validate();if(!p||await i.validate())return!1;const d=await i.getFullData(),u=d.filter(E=>E.key).map(E=>E.key),h=new Set(u);if(u.length!==h.size)return S.Message.warning("属性键不能重复"),!1;const g=await s.getValues(),y={};d.forEach(E=>{E.key&&(y[E.key]=E.value||"")});const x={authDict:{cXuhao:g.cXuhao,cName:g.cName,cSign:g.cSign,nParent:r.parentId||"0",nOrder:g.nOrder||0,cMeta:JSON.stringify(y)}},v=await I.post("/core/authDict/addBS",x);return S.Message.success(v.message),n("success"),!0}catch(p){return console.error("新增失败:",p),!1}}function b(){n("update:visible",!1)}return(p,c)=>(e.openBlock(),e.createBlock(e.unref(z.Modal),{"model-value":r.visible,title:f.value,width:700,"on-before-ok":m,"onUpdate:modelValue":c[0]||(c[0]=d=>n("update:visible",d)),onClose:b},{default:e.withCtx(()=>[e.createVNode(e.unref(l)),e.createVNode(e.unref(a),{id:"metaGrid",border:"","max-height":"300"})]),_:1},8,["model-value","title"]))}}),bd=e.defineComponent({name:"YwsjzdUpdate",__name:"YwsjzdUpdate",props:{visible:{type:Boolean,default:!1},row:{default:void 0}},emits:["update:visible","success"],setup(t,{emit:o}){const{TabPane:r}=S.Tabs,n=t,l=o;e.ref(!1);const s=e.ref(0),[a,i,f,m]=ut({formSchema:eo,tabsConfig:Ct});e.watch(()=>n.visible,async d=>{if(d&&n.row){await e.nextTick(),i.resetForm(),m.value[0].reloadData([]);try{const h=(await I.post("/core/authDict/editInit",{authDict:{id:n.row.id}})).result;if(h){if(i.setValues({cXuhao:h.authDict.cXuhao,cName:h.authDict.cName,cSign:h.authDict.cSign,nOrder:h.authDict.nOrder}),h.authDict.cMeta)try{const g=JSON.parse(h.authDict.cMeta),y=Object.keys(g).map(x=>({key:x,value:g[x]}));m.value[0].reloadData(y)}catch(g){console.error("解析额外属性失败:",g)}h.childList&&h.childList.length>0?m.value[1].reloadData(h.childList):m.value[1].reloadData([])}}catch(u){console.error("加载数据失败:",u),S.Message.error("加载数据失败")}}});const b=e.computed(()=>"修改字典");async function p(){try{const{valid:d}=await i.validate();if(!d||await m.value[0].validate())return!1;const h=await m.value[0].getFullData(),g=h.filter(k=>k.key).map(k=>k.key),y=new Set(g);if(g.length!==y.size)return S.Message.warning("属性键不能重复"),!1;const x=await i.getValues(),v={};h.forEach(k=>{k.key&&(v[k.key]=k.value||"")});const E=await m.value[1].getFullData(),_={authDict:{id:n.row?.id,cXuhao:x.cXuhao,cName:x.cName,cSign:x.cSign,nOrder:x.nOrder||0,cMeta:JSON.stringify(v),nParent:n.row?.nParent||0,nType:n.row?.nType||1},authDictList:E},L=await I.post("/core/authDict/editBS",_);return S.Message.success(L.message),l("success"),!0}catch(d){return console.error("修改失败:",d),!1}}function c(){l("update:visible",!1)}return(d,u)=>(e.openBlock(),e.createBlock(e.unref(z.Modal),{"model-value":n.visible,title:b.value,width:700,"on-before-ok":p,"onUpdate:modelValue":u[1]||(u[1]=h=>l("update:visible",h)),onClose:c},{default:e.withCtx(()=>[e.createVNode(e.unref(a)),e.createVNode(e.unref(S.Tabs),{modelValue:s.value,"onUpdate:modelValue":u[0]||(u[0]=h=>s.value=h)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Ct),(h,g)=>(e.openBlock(),e.createBlock(e.unref(r),{key:g,title:h.title},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(f)[g]),{id:`grid-${g}`,border:"","max-height":"300"},null,8,["id"]))]),_:2},1032,["title"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["model-value","title"]))}}),vd={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},yd={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},Cd={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},xd=e.defineComponent({__name:"YwsjzdQuery",setup(t){const o=async({page:R,formValues:C})=>{const w={pageNo:R.currentPage,pageSize:R.pageSize,authDict:{cSign:C.cSign||"",cXuhao:C.cXuhao||"",cName:C.cName||"",nParent:0}},V=await I.post("/core/authDict/selectForPageBS",w);return V.result?.records&&(V.result.records=V.result.records.map(N=>({...N,hasChildren:!0}))),V};async function r({row:R}){const w={pageNo:1,pageSize:9999,authDict:{...await s.getValues(),nParent:R.id}};try{return((await I.post("/core/authDict/selectForPageBS",w)).result?.records||[]).map(T=>({...T,hasChildren:!0}))}catch(V){return console.error("加载子节点失败:",V),[]}}const n={lazy:!0,rowField:"id",hasChild:"hasChildren",expandAll:!1,loadMethod:r},{QueryForm:l,formApi:s,Grid:a,gridApi:i,submitting:f,handleGlobalEnter:m,searchPlanList:b,currentSearchPlan:p,resourceId:c,nResourceid:d,handleSearchPlanSearch:u,handleDefaultPlanLoaded:h,businessResumeState:g}=ce({searchFormSchema:md,tableColumns:pd,resourceConfig:hd,queryFunction:o,gridEvents:{toolbarButtonClick:({code:R})=>{R==="ywsjzd/add"?L():R==="ywsjzd/update"?k():R==="ywsjzd/enable"?B("10001"):R==="ywsjzd/disable"?B("10002"):R==="ywsjzd/del"&&M()}},treeConfig:n,lazy:!0}),y=e.ref(!1),x=e.ref("0"),v=e.ref(""),E=e.ref(!1),_=e.ref(null);function L(){const R=i.getSelection();if(R.length>1){S.Message.warning("最多只能选择一条数据作为父级");return}R.length===1?(x.value=R[0].id,v.value=R[0].cName):(x.value="0",v.value=""),y.value=!0}function k(){const R=i.getSelection();if(R.length!==1){S.Message.warning("请选择一条数据进行修改");return}const C=R[0];_.value=C,E.value=!0}async function B(R){const C=i.getSelection();if(C.length===0){S.Message.warning("请选择要操作的数据");return}if(C.length>1){S.Message.warning("一次只能操作一条数据");return}const w=C[0],V=R==="10001"?"启用":"禁用";try{const N=await I.post("/core/authDict/signBS",{authDict:{id:w.id,cSign:R}});S.Message.success(N.message||`${V}成功`),i.commitProxy("query")}catch(N){console.error(`${V}失败:`,N)}}function M(){const R=i.getSelection();if(R.length===0){S.Message.warning("请选择要删除的数据");return}if(R.length>1){S.Message.warning("一次只能删除一条数据");return}const C=R[0];S.Modal.confirm({title:"确认删除",content:`确定要删除「${C.cName}」吗?`,okText:"确定",cancelText:"取消",onOk:async()=>{try{const w=await I.post("/core/authDict/deleteBS",{authDict:{id:C.id}});S.Message.success(w.message||"删除成功"),i.commitProxy("query")}catch(w){console.error("删除失败:",w)}}})}function P(){i.commitProxy("query")}return(R,C)=>(e.openBlock(),e.createElementBlock("div",{class:"ywsjzd-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:C[2]||(C[2]=e.withKeys((...w)=>e.unref(m)&&e.unref(m)(...w),["enter"])),tabindex:"-1"},[e.createElementVNode("div",vd,[e.createElementVNode("div",yd,[e.createVNode(e.unref(l))]),e.createElementVNode("div",Cd,[e.createVNode(e.unref(a),{class:"flex-1"})])]),e.createVNode(gd,{visible:y.value,"onUpdate:visible":C[0]||(C[0]=w=>y.value=w),"parent-id":x.value,"parent-name":v.value,onSuccess:P},null,8,["visible","parent-id","parent-name"]),e.createVNode(bd,{visible:E.value,"onUpdate:visible":C[1]||(C[1]=w=>E.value=w),row:_.value,onSuccess:P},null,8,["visible","row"]),e.createVNode(e.unref(ke),{state:e.unref(g)},null,8,["state"])],32))}}),kd=re(xd,[["__scopeId","data-v-24b85090"]]),Re=({t,formApi:o})=>{const r=[{label:"普通用户",value:"0"},{label:"超级用户",value:"1"}],n=[{label:"启用",value:"0"},{label:"禁用",value:"1"}],l=[{label:"是",value:"1"},{label:"否",value:"0"}],s=[{fieldName:"cUsernumb",label:t("user.cUsernumb"),component:"Input",componentProps:{allowClear:!0}},{fieldName:"cUsername",label:t("user.cUsername"),component:"Input",componentProps:{allowClear:!0}},{fieldName:"cAdmin",label:t("user.cAdmin"),component:"Select",componentProps:{allowClear:!0,options:r}},{fieldName:"dLastLoginList",label:t("user.dLastLoginList"),component:"RangePicker",componentProps:{allowClear:!0}}],a=[{type:"checkbox",width:40},{field:"id",title:"ID",minWidth:80,params:{nBill:3,cEntityTable:"AUTH_USER"}},{field:"cUsernumb",title:t("user.cUsernumb"),minWidth:120},{field:"cUsername",title:t("user.cUsername"),minWidth:120},{field:"cAdmin",title:t("user.cAdmin"),minWidth:120,params:{optionlist:r},formatter:({cellValue:c,column:d})=>be(c,d.params.optionlist)},{field:"cWork",title:t("user.cWork"),minWidth:120},{field:"dCredate",title:t("user.dCredate"),minWidth:120},{field:"cSign",title:t("user.cSign"),minWidth:120,params:{optionlist:n},formatter:({cellValue:c,column:d})=>be(c,d.params.optionlist)},{field:"cEmail",title:t("user.cEmail"),minWidth:120},{field:"cDeptname",title:t("user.cDeptname"),minWidth:120},{field:"nMainAccount",title:t("user.nMainAccount"),minWidth:120,params:{optionlist:l},formatter:({cellValue:c,column:d})=>be(c,d.params.optionlist)},{field:"nOuterUser",title:t("user.nOuterUser"),minWidth:120,params:{optionlist:l},formatter:({cellValue:c,column:d})=>be(c,d.params.optionlist)},{field:"dLastLogin",title:t("user.dLastLogin"),minWidth:120}],i={resourceId:"88",nResourceid:80,cModnumb:"XTGL_YHGL_LIST"},f=[{fieldName:"cUsernumb",label:t("user.cUsernumb"),component:"Input",componentProps:{allowClear:!0},rules:"required"},{fieldName:"cUsername",label:t("user.cUsername"),component:"Input",componentProps:{allowClear:!0},rules:"required"},{fieldName:"cAdmin",label:t("user.cAdmin"),component:"Select",componentProps:{allowClear:!0,options:r},rules:"required"},{fieldName:"nMainAccount",label:t("user.nMainAccount"),component:"RadioGroup",componentProps:{allowClear:!0,options:l}},{fieldName:"nOuterUser",label:t("user.nOuterUser"),component:"RadioGroup",componentProps:{allowClear:!0,options:l}},{fieldName:"cWork",label:t("user.cWork"),component:"SunnyBusinessSearch",componentProps:(c,d)=>({allowClear:!0,cNum:"INNER_WORK_OPT",defaultModel:{WORKCODE:"1084870"},modalProps:{multiple:!1,fieldNames:{value:"WORKCODE",label:"LASTNAME"}},onChange:(u,h)=>{u.length>0?(d.setFieldValue("cDeptnum",u[0].DEPTCODE),d.setFieldValue("cDeptname",u[0].DEPTNAME)):(d.setFieldValue("cDeptnum",""),d.setFieldValue("cDeptname",""))}}),dependencies:{show:c=>c.nOuterUser==="0"}},{fieldName:"cDeptnum",label:t("user.cDeptnum"),component:"Input",componentProps:{allowClear:!0,disabled:!0},dependencies:{show:c=>c.nOuterUser==="0"}},{fieldName:"cDeptname",label:t("user.cDeptname"),component:"Input",componentProps:{allowClear:!0,disabled:!0},dependencies:{show:c=>c.nOuterUser==="0"}}],m=[{fieldName:"cUsernumb",label:t("user.cUsernumb"),component:"Input",componentProps:{disabled:!0},colProps:{span:12}},{fieldName:"cUsername",label:t("user.cUsername"),component:"Input",componentProps:{disabled:!0},colProps:{span:12}}],b=[{type:"checkbox",width:40,align:"center"},{field:"cRolenumb",title:t("user.cRolenumb"),minWidth:100},{field:"cRolename",title:t("user.cRolename"),minWidth:200},{field:"nSensitive",title:t("user.nSensitive"),minWidth:100,formatter:({cellValue:c,column:d})=>be(c,d.params.optionlist),params:{optionlist:l}},{field:"cSystem",title:t("user.cSystem"),minWidth:100}],p=[{type:"checkbox",width:40,align:"center"},{field:"cMac",title:t("user.cMac"),...z.EditRender.InputRender},{field:"cMacdesc",title:t("user.cMacdesc"),...z.EditRender.InputRender},{field:"cCreateusername",title:t("user.cCreateusername")},{field:"dDate",title:t("user.dDate")}];return{searchFormSchema:s,tableColumns:a,resourceConfig:i,addEditFormSchema:f,authFormSchema:m,authGridColumns:b,bindMacGridColumns:p}},wd=e.defineComponent({__name:"UserAdd",emits:["success"],setup(t,{expose:o,emit:r}){const{t:n}=Y.useI18n(),l=e.ref(!1),s=e.ref("add"),a=r,[i,f]=xe({schema:[],objectToValueFields:["cWork"]}),{addEditFormSchema:m}=Re({t:n,formApi:f}),b=()=>{l.value=!0,s.value="add",f.setState({schema:m}),f.resetForm(),f.setValues({nMainAccount:"1",nOuterUser:"0"})},p=async h=>{s.value="edit";const g=await I.post("/core/authUser/queryById",{authUser:{id:h.id}});l.value=!0,await e.nextTick(),f.setState({schema:m}),f.resetForm(),g.code===200&&f.setValues({...g.result,nMainAccount:g.result.nMainAccount.toString(),nOuterUser:g.result.nOuterUser.toString()},!1)};o({addInit:b,editInit:p,detailInit:h=>{p(h)}});const d=async()=>{const{valid:h}=await f.validate();if(!h)return!1;const y={authUser:await f.getValues()},x=await I.post(s.value==="add"?"/core/authUser/add":"/core/authUser/edit",y);return x.code===200?(S.Message.success(x.message),l.value=!1,a("success"),!0):(S.Message.error(x.message),!1)};function u(){l.value=!1}return(h,g)=>(e.openBlock(),e.createBlock(e.unref(z.Modal),{"model-value":l.value,title:s.value==="add"?e.unref(n)("user.addTitle"):e.unref(n)("user.editTitle"),width:600,"on-before-ok":d,onClose:u},{default:e.withCtx(()=>[e.createVNode(e.unref(i))]),_:1},8,["model-value","title"]))}}),Sd=e.defineComponent({__name:"UserChooseRole",emits:["chooseRoleEmit"],setup(t,{expose:o,emit:r}){const{t:n}=Y.useI18n(),l=e.ref(!1),s=e.ref([]);e.ref([]),e.ref(!1);const a=r,i=[{fieldName:"cRolenumb",label:n("user.cRolenumb"),component:"Input",componentProps:{allowClear:!0},colProps:{span:6}},{fieldName:"cRolename",label:n("user.cRolename"),component:"Input",componentProps:{allowClear:!0},colProps:{span:6}}],f=[{type:"checkbox",width:50,fixed:"left"},{field:"cRolenumb",title:n("user.cRolenumb"),width:120},{field:"cRolename",title:n("user.cRolename"),width:120},{field:"nSensitive",title:n("user.nSensitive"),width:120,formatter:({row:c})=>c.nSensitive=="1"?n("common.yes"):n("common.no")},{field:"cSystem",title:n("user.cSystem"),width:120}],m=()=>{l.value=!0},b=c=>{a("chooseRoleEmit",c)},p=async c=>{var d={authRole:{cRolenumb:c.cRolenumb,cRolename:c.cRolename},pageNo:c.pageNo,pageSize:c.pageSize};const u=await I.post("/core/authRole/queryAllPageList",d);return{list:u.result.records,total:u.result.total}};return o({openInit:m}),(c,d)=>(e.openBlock(),e.createBlock(e.unref(z.SunnySearchModal),{visible:l.value,"onUpdate:visible":d[0]||(d[0]=u=>l.value=u),modelValue:s.value,"onUpdate:modelValue":d[1]||(d[1]=u=>s.value=u),title:c.$t("系统角色权限查询"),"form-schema":i,"table-columns":f,"search-api":p,"field-names":{label:"cRolename",value:"cRolenumb"},onConfirm:b},null,8,["visible","modelValue","title"]))}}),Nd=e.defineComponent({__name:"UserAuth",emits:["success"],setup(t,{expose:o,emit:r}){const n=e.ref(),{t:l}=Y.useI18n(),s=e.ref(!1),a=r,[i,f]=xe({schema:[]}),{authFormSchema:m,authGridColumns:b}=Re({t:l,formApi:f}),[p,c]=z.useSunnyEditGrid({gridOptions:{data:[],columns:b,border:!0,size:"mini",maxHeight:400,columnConfig:{resizable:!0}}});o({openInit:async v=>{const E=await I.post("/core/authUser/queryUserRole",{authUser:{id:v.id}}),_=E.code===200?E.result:[];s.value=!0,await e.nextTick(),f.setState({schema:m}),f.resetForm(),f.setValues({cUsernumb:v.cUsernumb,cUsername:v.cUsername}),c.reloadData(_)}});const u=async()=>{const{valid:v}=await f.validate();if(!v)return!1;const E=await f.getValues(),_=await c.getFullData(),L={authorizedNumb:E.cUsernumb,authUserRoleList:_},k=await I.post("/core/authUser/saveUserAuth",L);return k.code===200?(S.Message.success(k.message),s.value=!1,a("success"),!0):(S.Message.error(k.message),!1)};function h(){s.value=!1}const g=()=>{n.value.openInit()},y=async v=>{const E=await c.getFullData();v.forEach(_=>{Q.findIndex(E,L=>L.nRoleid===_.id)>-1?S.Message.warning(l("user.duplicateRole",{roleName:_.cRolename})):c.addEvent({nRoleid:_.id,cSystem:_.cSystem,cRolename:_.cRolename,cRolenumb:_.cRolenumb,nSensitive:_.nSensitive})})},x=()=>{c.deleteSelection()};return(v,E)=>{const _=e.resolveComponent("a-button"),L=e.resolveComponent("a-space");return e.openBlock(),e.createBlock(e.unref(z.Modal),{"model-value":s.value,title:e.unref(l)("user.authTitle"),width:700,"on-before-ok":u,onClose:h},{default:e.withCtx(()=>[e.createVNode(e.unref(i)),e.createVNode(e.unref(p),null,{toolbar:e.withCtx(()=>[e.createVNode(L,{class:"mb-2"},{default:e.withCtx(()=>[e.createVNode(_,{type:"primary",onClick:g},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("common.create")),1)]),_:1}),e.createVNode(_,{type:"primary",onClick:x},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("common.deleteSelected")),1)]),_:1})]),_:1})]),_:1}),e.createVNode(Sd,{ref_key:"UserChooseRoleRef",ref:n,onChooseRoleEmit:y},null,512)]),_:1},8,["model-value","title"])}}}),_d=e.defineComponent({__name:"UserBindMac",emits:["success"],setup(t,{expose:o,emit:r}){const{t:n}=Y.useI18n(),l=e.ref(!1),s=e.ref({}),a=r,{bindMacGridColumns:i}=Re({t:n}),[f,m]=z.useSunnyEditGrid({gridOptions:{data:[],columns:i,border:!0,size:"mini",maxHeight:400,columnConfig:{resizable:!0},editRules:{cMac:[{required:!0,message:n("user.cMacMessage")}]}}});o({openInit:async h=>{const g=await I.post("/core/authUser/queryMac",{cUsernumb:h.cUsernumb}),y=g.code===200?g.result:[];g.code===200&&(s.value=h),l.value=!0,await e.nextTick(),m.reloadData(y)}});const p=async()=>{if(await m.validate())return!1;const y={authUserMacList:await m.getFullData(),authUserMac:{cUsernumb:s.value.cUsernumb}},x=await I.post("/core/authUser/saveMac",y);return x.code===200?(S.Message.success(x.message),l.value=!1,a("success"),!0):(S.Message.error(x.message),!1)};function c(){l.value=!1}const d=()=>{m.addEvent({})},u=()=>{m.deleteSelection()};return(h,g)=>{const y=e.resolveComponent("a-button"),x=e.resolveComponent("a-space");return e.openBlock(),e.createBlock(e.unref(z.Modal),{"model-value":l.value,title:e.unref(n)("user.bindMacTitle"),width:700,"on-before-ok":p,onClose:c},{default:e.withCtx(()=>[e.createVNode(e.unref(f),null,{toolbar:e.withCtx(()=>[e.createVNode(x,{class:"mb-2"},{default:e.withCtx(()=>[e.createVNode(y,{type:"primary",onClick:d},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("common.create")),1)]),_:1}),e.createVNode(y,{type:"primary",onClick:u},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("common.deleteSelected")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["model-value","title"])}}}),Vd={class:"otherAuthTable"},Ed={class:"th1"},Pd={class:"th2"},Md={class:"th3"},Td={class:"tr1"},Bd={class:"tr2"},Rd={class:"tr3"},$d={key:0,style:{color:"#24b77b"}},Ld=e.defineComponent({__name:"UserOtherAuth",emits:["success"],setup(t,{expose:o,emit:r}){const{t:n}=Y.useI18n(),l=e.ref(!1),s=e.ref([]),a=e.ref({}),i=(p,c)=>{c.forEach(d=>{d.check=!!p})};o({openInit:async p=>{const c=await I.post("/core/authUser/queryUserExres",{authUser:{id:p.id}});c.code===200&&(s.value=c.result,a.value=p),l.value=!0}});const m=async()=>{const p={authUser:{id:a.value.id},userExresAuthBOList:s.value.map(d=>({...d,allCheck:!1}))},c=await I.post("/core/authUser/saveUserExres",p);return c.code===200?(S.Message.success(c.message),l.value=!1,!0):(S.Message.error(c.message),!1)};function b(){l.value=!1}return(p,c)=>{const d=e.resolveComponent("a-checkbox");return e.openBlock(),e.createBlock(e.unref(z.Modal),{"model-value":l.value,title:e.unref(n)("user.otherAuth.title"),width:900,class:"macAddressDialog","on-before-ok":m,onClose:b},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createElementVNode("table",Vd,[c[1]||(c[1]=e.createElementVNode("caption",null,null,-1)),e.createElementVNode("th",Ed,e.toDisplayString(e.unref(n)("user.otherAuth.tab")),1),e.createElementVNode("th",Pd,e.toDisplayString(e.unref(n)("user.otherAuth.tabDesc")),1),e.createElementVNode("th",Md,e.toDisplayString(e.unref(n)("user.otherAuth.option")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,u=>(e.openBlock(),e.createElementBlock("tr",null,[e.createElementVNode("td",Td,e.toDisplayString(u.parname),1),e.createElementVNode("td",Bd,[e.createVNode(d,{modelValue:u.allCheck,"onUpdate:modelValue":h=>u.allCheck=h,onChange:h=>i(h,u.authExresList)},null,8,["modelValue","onUpdate:modelValue","onChange"]),c[0]||(c[0]=e.createTextVNode(" 是 ",-1))]),e.createElementVNode("td",Rd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.authExresList,h=>(e.openBlock(),e.createBlock(d,{modelValue:h.check,"onUpdate:modelValue":g=>h.check=g},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.cExresnum+"-"+h.cExresname)+" ",1),h.cOrg?(e.openBlock(),e.createElementBlock("span",$d,"["+e.toDisplayString(h.cOrg)+"]",1)):e.createCommentVNode("",!0)]),_:2},1032,["modelValue","onUpdate:modelValue"]))),256))])]))),256))])])]),_:1},8,["model-value","title"])}}}),Id=re(Ld,[["__scopeId","data-v-c249a204"]]),Dd={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},Od={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},jd={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},zd=e.defineComponent({__name:"UserQuery",setup(t){const o=e.ref(),r=e.ref(),n=e.ref(),l=e.ref(),s=me.useRouter(),{t:a}=Y.useI18n(),{searchFormSchema:i,tableColumns:f,resourceConfig:m}=Re({t:a}),b=async({page:w,formValues:V})=>{const N={pageNo:w.currentPage,pageSize:w.pageSize,authUser:V};return I.post("/core/authUser/selectForPage",N)},p={async toolbarButtonClick(w){const V=[...w.$grid.getCheckboxRecords()];switch(w.button.code){case"userManagement/add":o.value.addInit();break;case"userManagement/update":if(V.length!==1){S.Message.warning(a("common.selectOne"));return}o.value.editInit(V[0]);break;case"userManagement/delete":if(V.length!==1){S.Message.warning(a("common.selectOne"));return}S.Modal.confirm({title:a("common.prompt"),content:`确定删除选中 ${V.length} 项吗?`,onBeforeOk:async()=>{const T=await I.post("/core/authUser/delete",{id:V[0].id});return T.code===200?(S.Message.success(T.message),w.$grid.commitProxy("query",{}),!0):(S.Message.error(T.message),!1)}});break;case"userManagement/detail":if(V.length!==1){S.Message.warning(a("common.selectOne"));return}o.value.detailInit(V[0]);break;case"userManagement/resetPassword":if(V.length!==1){S.Message.warning(a("common.selectOne"));return}S.Modal.confirm({title:a("common.prompt"),content:a("user.resetPasswordTips",{username:V[0].cUsername}),onBeforeOk:async()=>{const T=await I.post("/core/authUser/resetPwd",{id:V[0].id});return T.code===200?(S.Message.success(T.message),w.$grid.commitProxy("query",{}),!0):(S.Message.error(T.message),!1)}});break;case"userManagement/enable":if(V.length!==1){S.Message.warning(a("common.selectOne"));return}S.Modal.confirm({title:a("common.prompt"),content:a("user.enableTips",{username:V[0].cUsername}),onBeforeOk:async()=>{const T=await I.post("/core/authUser/updateSign",{id:V[0].id,cSign:"0"});return T.code===200?(S.Message.success(T.message),w.$grid.commitProxy("query",{}),!0):(S.Message.error(T.message),!1)}});break;case"userManagement/disable":if(V.length!==1){S.Message.warning(a("common.selectOne"));return}S.Modal.confirm({title:a("common.prompt"),content:a("user.disableTips",{username:V[0].cUsername}),onBeforeOk:async()=>{const T=await I.post("/core/authUser/updateSign",{id:V[0].id,cSign:"1"});return T.code===200?(S.Message.success(T.message),w.$grid.commitProxy("query",{}),!0):(S.Message.error(T.message),!1)}});break;case"userManagement/auth":if(V.length!==1){S.Message.warning(a("common.selectOne"));return}r.value.openInit(V[0]);break;case"userManagement/macBind":if(V.length!==1){S.Message.warning(a("common.selectOne"));return}n.value.openInit(V[0]);break;case"userManagement/otherAuth":if(V.length!==1){S.Message.warning(a("common.selectOne"));return}l.value.openInit(V[0]);break;case"daoru/show":C.open({nModid:s.currentRoute.value.meta.id,nButtonid:w.button.nButtonid});break;case"daochu/show":const N=await d.getValues();P({conditionMap:N,tableColumns:f});break}}},{QueryForm:c,formApi:d,Grid:u,gridApi:h,submitting:g,handleGlobalEnter:y,searchPlanList:x,currentSearchPlan:v,resourceId:E,nResourceid:_,handleSearchPlanSearch:L,handleDefaultPlanLoaded:k,businessResumeState:B}=ce({searchFormSchema:i,tableColumns:f,resourceConfig:m,queryFunction:b,gridEvents:p,showCheckbox:!0}),{ExportModal:M,open:P}=fo({exportUrl:"/core/authUser"}),[R,C]=z.useImportModal({});return(w,V)=>(e.openBlock(),e.createElementBlock("div",{class:"operation-log-query h-full flex flex-col bg-[var(--color-fill-2)] focus:outline-none",onKeydown:V[4]||(V[4]=e.withKeys((...N)=>e.unref(y)&&e.unref(y)(...N),["enter"])),tabindex:"-1"},[e.createElementVNode("div",Dd,[e.createElementVNode("div",Od,[e.createVNode(e.unref(c))]),e.createElementVNode("div",jd,[e.createVNode(e.unref(u),{class:"flex-1"})]),e.createVNode(e.unref(M)),e.createVNode(e.unref(R)),e.createVNode(wd,{ref_key:"UserAddRef",ref:o,onSuccess:V[0]||(V[0]=()=>e.unref(h).commitProxy("query"))},null,512),e.createVNode(Nd,{ref_key:"UserAuthRef",ref:r,onSuccess:V[1]||(V[1]=()=>e.unref(h).commitProxy("query"))},null,512),e.createVNode(_d,{ref_key:"UserBindMacRef",ref:n,onSuccess:V[2]||(V[2]=()=>e.unref(h).commitProxy("query"))},null,512),e.createVNode(Id,{ref_key:"UserOtherAuthRef",ref:l,onSuccess:V[3]||(V[3]=()=>e.unref(h).commitProxy("query"))},null,512),e.createVNode(e.unref(ke),{state:e.unref(B)},null,8,["state"])])],32))}}),Fd=re(zd,[["__scopeId","data-v-98e86324"]]),$e=({t,formApi:o})=>{t("role.enable"),t("role.disable");const r=[{cKeyname:t("common.no"),cKeynumb:"0"},{cKeyname:t("common.yes"),cKeynumb:"1"}],n=[{cKeyname:t("role.baseSystem"),cKeynumb:"BASE"}],l=[{cKeyname:t("role.type1"),cKeynumb:"1"},{cKeyname:t("role.type2"),cKeynumb:"2"}],s=[{fieldName:"cRolenumb",label:t("user.cRolenumb"),component:"Input",componentProps:{placeholder:t("role.inputRoleNumb"),allowClear:!0},colProps:{span:4}},{fieldName:"cRolename",label:t("user.cRolename"),component:"Input",componentProps:{placeholder:t("role.inputRoleName"),allowClear:!0},colProps:{span:4}},{fieldName:"cOrg",label:t("role.org"),component:"Input",componentProps:{placeholder:t("role.inputOrg"),allowClear:!0},colProps:{span:4}}],a=[{type:"checkbox",width:40},{field:"id",title:t("role.id"),params:{nBill:3,cEntityTable:"AUTH_ROLE"}},{field:"cRolenumb",title:t("user.cRolenumb")},{field:"cRolename",title:t("user.cRolename")},{field:"CSystem",title:t("role.system"),formatter:({cellValue:p})=>n.find(d=>d.cKeynumb===p)?.cKeyname||p},{field:"corg",title:t("role.org")},{field:"сType",title:t("role.type"),formatter:({cellValue:p})=>l.find(d=>d.cKeynumb===p)?.cKeyname||p},{field:"nSensitive",title:t("user.nSensitive"),formatter:({cellValue:p})=>r.find(d=>d.cKeynumb===String(p))?.cKeyname||p},{field:"cCrename",title:t("role.createUser")},{field:"dCredate",title:t("role.createTime")}],i={resourceId:"role",nResourceid:95,cModnumb:"XTGL_JSGL_LIST"},f=[{fieldName:"cRolenumb",label:t("user.cRolenumb"),component:"Input",componentProps:{allowClear:!0},colProps:{span:4}},{fieldName:"cRolename",label:t("user.cRolename"),component:"Input",componentProps:{allowClear:!0},rules:"required",colProps:{span:4}},{fieldName:"cSystem",label:t("role.system"),component:"Select",componentProps:{allowClear:!0,options:n.map(p=>({label:p.cKeyname,value:p.cKeynumb}))},rules:"required",colProps:{span:4}},{fieldName:"corg",label:t("role.org"),component:"Input",componentProps:{allowClear:!0},colProps:{span:4}},{fieldName:"сType",label:t("role.type"),component:"Select",componentProps:{allowClear:!0,options:l.map(p=>({label:p.cKeyname,value:p.cKeynumb}))},colProps:{span:4}}],m=[{fieldName:"cRolenumb",label:t("user.cRolenumb"),component:"Input",componentProps:{disabled:!0},colProps:{span:12}},{fieldName:"cRolename",label:t("user.cRolename"),component:"Input",componentProps:{disabled:!0},colProps:{span:12}}],b=[{type:"checkbox",width:40,align:"center"},{field:"cUsernumb",title:t("user.cUsernumb"),minWidth:100},{field:"cUsername",title:t("user.cUsername"),minWidth:200},{field:"cAdmin",title:t("user.cAdmin"),minWidth:100,formatter:({cellValue:p})=>[{cKeyname:t("role.normalUser"),cKeynumb:"0"},{cKeyname:t("role.superUser"),cKeynumb:"1"}].find(u=>u.cKeynumb===String(p))?.cKeyname||p}];return{searchFormSchema:s,tableColumns:a,resourceConfig:i,addEditFormSchema:f,authFormSchema:m,authGridColumns:b}},Ad={class:"h-full flex flex-col"},Ud={class:"mt-5 flex-1 overflow-hidden"},qd={class:"mb-3 text-sm font-medium"},Kd={class:"h-[calc(100%-36px)] overflow-auto"},Wd={class:"extra-container ml-[250px] mr-auto",style:{"flex-shrink":"0","max-width":"70%","overflow-x":"auto"}},Gd={key:0,class:"flex flex-nowrap gap-3",style:{width:"max-content"}},ro=e.defineComponent({__name:"RoleAdd",emits:["success"],setup(t,{expose:o,emit:r}){const{t:n}=Y.useI18n(),l=e.ref(!1),s=e.ref("add"),a=e.ref(),i=e.ref(),f=e.ref(!1),m=r,b=e.reactive({treeData:[],defaultChecked:[],expandedKeys:[]}),p=async w=>{const V=await I.post("/core/authResource/getResourceTreeMenu",{authResMenu:{cSystem:w}});if(V.code===200){const N=V.result;b.treeData=E(N),c(b.treeData)}},c=w=>{w.forEach(V=>{V.buttonList&&V.buttonList.length&&V.buttonList.forEach(N=>{N.checked=b.defaultChecked.includes(String(N.id))}),V.children&&c(V.children)})},d=w=>{let V=[];return w.buttonList&&w.buttonList.length&&(V=V.concat(w.buttonList.map(N=>N.id))),w.children&&w.children.length&&w.children.forEach(N=>{V.push(N.id),V=V.concat(d(N))}),V},u=w=>{const V=[],N=(T,O,j=[])=>{for(const q of T){if(q.id===O)return V.push(...j),!0;if(q.children&&N(q.children,O,[...j,q.id]))return!0}return!1};return N(b.treeData,w),V},h=(w,V)=>{const N=V.node,T=V.checked,O=[...w];if(T){u(N.id).forEach(D=>{O.includes(D)||O.push(D)}),N.buttonList&&N.buttonList.length&&N.buttonList.forEach(D=>{O.includes(D.id)||O.push(D.id),D.checked=!0}),d(N).forEach(D=>{O.includes(D)||O.push(D)});const G=(D,$)=>{D.forEach(U=>{U.buttonList&&U.buttonList.length&&U.buttonList.forEach(W=>{W.checked=$}),U.children&&G(U.children,$)})};N.children&&G(N.children,!0)}else{N.buttonList&&N.buttonList.length&&N.buttonList.forEach(G=>{const D=O.indexOf(G.id);D!==-1&&O.splice(D,1),G.checked=!1}),d(N).forEach(G=>{const D=O.indexOf(G);D!==-1&&O.splice(D,1)});const q=(G,D)=>{G.forEach($=>{$.buttonList&&$.buttonList.length&&$.buttonList.forEach(U=>{U.checked=D}),$.children&&q($.children,D)})};N.children&&q(N.children,!1)}b.defaultChecked=O},[g,y]=z.useSunnyForm({layout:"horizontal",size:"small",labelWidth:100,showDefaultActions:!1,scrollToFirstError:!0,schema:[]}),{addEditFormSchema:x}=$e({t:n,formApi:y}),v=async w=>{w?(await p(w),b.defaultChecked=[]):(b.treeData=[],b.defaultChecked=[])};y.setState({handleValuesChange:(w,V)=>{"cSystem"in w&&!f.value&&v(w.cSystem)}});const E=w=>w.map(V=>{const N=V.label||V.name||V.text||V.cName||V.id,T={...V,label:N,expanded:!1};if(T.children&&T.children.length){const O=[],j=[];T.children.forEach(q=>{if(q.cType==="2"){const G=q.label||q.name||q.text||q.cName||q.id;O.push({...q,label:G,checked:b.defaultChecked.includes(String(q.id))})}else j.push(E([q])[0])}),T.buttonList=O,T.children=j.length?j:void 0}return T}),_=(w,V)=>{for(const N of w){if(N.buttonList&&N.buttonList.some(T=>T.id===V))return N;if(N.children){const T=_(N.children,V);if(T)return T}}return null},L=w=>{if(w.checked){b.defaultChecked.includes(w.id)||b.defaultChecked.push(w.id);const V=_(b.treeData,w.id);V&&(b.defaultChecked.includes(V.id)||b.defaultChecked.push(V.id),((O,j)=>{let q=[];const G=($,U)=>{for(const W of $)if(W.children){if(W.children.some(H=>H.id===U))return W;const K=G(W.children,U);if(K)return q.push(W.id),K}return null};let D=O;for(;D;){const $=G(j,D.id);if($)q.push($.id),D=$;else break}return q})(V,b.treeData).forEach(O=>{b.defaultChecked.includes(O)||b.defaultChecked.push(O)}))}else{const V=b.defaultChecked.indexOf(w.id);V!==-1&&b.defaultChecked.splice(V,1)}},k=(w,V,N)=>{b.expandedKeys=w},B=async()=>{l.value=!0,s.value="add",y.setState({schema:x}),y.resetForm(),b.treeData=[],b.defaultChecked=[],b.treeData=[],await e.nextTick(),a.value&&a.value.toggleMaximize()},M=async w=>{f.value=!0,s.value="edit";const V=await I.post("/core/authRole/update_init",{authRole:{id:w.id}});if(l.value=!0,await e.nextTick(),y.setState({schema:x}),y.resetForm(),V.code===200){y.setValues(V.result.role,!1),y.updateSchema([{fieldName:"cRolenumb",componentProps:{disabled:!0}}]),b.defaultChecked=(V.result.resourceidList||[]).map(String);const N=V.result.treeList||[];b.treeData=E(N),c(b.treeData),b.expandedKeys=[]}await e.nextTick(),a.value&&a.value.toggleMaximize(),f.value=!1};o({addInit:B,editInit:M,detailInit:w=>{M(w)}});const R=async()=>{const{valid:w}=await y.validate();if(!w)return!1;const N={authRole:await y.getValues(),idList:b.defaultChecked},T=await I.post(s.value==="add"?"/core/authRole/saveRole":"/core/authRole/saveUpdateRole",N);return T.code===200?(S.Message.success(T.message),l.value=!1,m("success"),!0):(S.Message.error(T.message),!1)};function C(){l.value=!1}return(w,V)=>(e.openBlock(),e.createBlock(e.unref(z.Modal),{ref_key:"modalRef",ref:a,"model-value":l.value,title:s.value==="add"?e.unref(n)("role.addTitle"):e.unref(n)("role.editTitle"),"on-before-ok":R,onClose:C},{default:e.withCtx(()=>[e.createElementVNode("div",Ad,[e.createVNode(e.unref(g)),e.createElementVNode("div",Ud,[e.createElementVNode("h4",qd,e.toDisplayString(e.unref(n)("role.resourceConfig")),1),e.createElementVNode("div",Kd,[e.createVNode(e.unref(S.Tree),{ref_key:"treeRef",ref:i,data:b.treeData,"node-key":"id",checkable:!0,"check-strictly":!0,"checked-keys":b.defaultChecked,"expanded-keys":b.expandedKeys,"field-names":{key:"id",title:"label",children:"children",disabled:"disabled"},"default-expand-all":!1,onExpand:k,onCheck:h},{extra:e.withCtx(N=>[e.createElementVNode("div",Wd,[N?.buttonList&&N.buttonList.length?(e.openBlock(),e.createElementBlock("div",Gd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.buttonList,T=>(e.openBlock(),e.createBlock(e.unref(S.Checkbox),{key:T.id,modelValue:T.checked,"onUpdate:modelValue":O=>T.checked=O,disabled:T.disabled,class:"flex-shrink-0 whitespace-nowrap",onChange:O=>L(T)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(T.label),1)]),_:2},1032,["modelValue","onUpdate:modelValue","disabled","onChange"]))),128))])):e.createCommentVNode("",!0)])]),_:1},8,["data","checked-keys","expanded-keys"])])])])]),_:1},8,["model-value","title"]))}}),Hd=e.defineComponent({__name:"RoleChooseUser",emits:["chooseUserEmit"],setup(t,{expose:o,emit:r}){const{t:n}=Y.useI18n(),l=e.ref(!1),s=e.ref([]),a=r,i=[{fieldName:"cUsernumb",label:n("user.cUsernumb"),component:"Input",componentProps:{allowClear:!0,placeholder:n("role.inputPlaceholder")},colProps:{span:12}},{fieldName:"cUsername",label:n("user.cUsername"),component:"Input",componentProps:{allowClear:!0,placeholder:n("role.inputPlaceholder")},colProps:{span:12}}],f=[{type:"checkbox",width:50,fixed:"left"},{field:"cUsernumb",title:n("user.cUsernumb"),width:120},{field:"cUsername",title:n("user.cUsername"),width:120},{field:"cDeptname",title:n("user.cDeptname"),width:120},{field:"cJobname",title:n("role.jobname"),width:120}],m=()=>{s.value=[],l.value=!0},b=c=>{a("chooseUserEmit",c)},p=async c=>{var d={authUser:{cUsernumb:c.cUsernumb||"",cUsername:c.cUsername||""},pageNo:c.pageNo,pageSize:c.pageSize};const u=await I.post("/core/authUser/selectForPage",d);return{list:u.result.records,total:u.result.total}};return o({openInit:m}),(c,d)=>(e.openBlock(),e.createBlock(e.unref(z.SunnySearchModal),{visible:l.value,"onUpdate:visible":d[0]||(d[0]=u=>l.value=u),modelValue:s.value,"onUpdate:modelValue":d[1]||(d[1]=u=>s.value=u),title:e.unref(n)("role.userSearch"),"form-schema":i,"table-columns":f,"search-api":p,"field-names":{label:"cUsername",value:"id"},onConfirm:b},null,8,["visible","modelValue","title"]))}}),lo=e.defineComponent({__name:"RoleAuth",emits:["success"],setup(t,{expose:o,emit:r}){const n=e.ref(),{t:l}=Y.useI18n(),s=e.ref(!1),a=e.ref(null),i=e.ref([]),f=r,[m,b]=xe({schema:[]}),{authFormSchema:p,authGridColumns:c}=$e({t:l,formApi:b}),[d,u]=z.useSunnyEditGrid({gridOptions:{data:[],columns:c,border:!0,size:"mini",maxHeight:400,columnConfig:{resizable:!0}}});o({openInit:async _=>{a.value=_;const L=await I.post("/core/authRole/findRoleUser",{authRole:{id:_.id}}),k=L.code===200?L.result.authUserList||[]:[];i.value=JSON.parse(JSON.stringify(k)),s.value=!0,await e.nextTick(),b.setState({schema:p}),b.resetForm(),b.setValues({cRolenumb:_.cRolenumb,cRolename:_.cRolename}),u.reloadData(k)}});const g=()=>{n.value.openInit()},y=async _=>{const L=await u.getFullData();_.forEach(k=>{Q.findIndex(L,B=>B.id===k.id)>-1?S.Message.warning(l("role.duplicateUser",{username:k.cUsername})):u.addEvent({id:k.id,cAdmin:k.cAdmin,cUsername:k.cUsername,cUsernumb:k.cUsernumb})})},x=()=>{u.deleteSelection()},v=async()=>{const{valid:_}=await b.validate();if(!_)return!1;await b.getValues();const L=await u.getFullData(),k=await u.$grid.getRemoveRecords(),B=L.filter(R=>!i.value.some(C=>C.id===R.id)),M={authRole:{id:a.value.id},authUserDelList:k,authUserInsList:B},P=await I.post("/core/authRole/saveRoleUser",M);return P.code===200?(S.Message.success(P.message),s.value=!1,f("success"),!0):(S.Message.error(P.message),!1)};function E(){s.value=!1}return(_,L)=>{const k=e.resolveComponent("a-button"),B=e.resolveComponent("a-space");return e.openBlock(),e.createBlock(e.unref(z.Modal),{"model-value":s.value,title:e.unref(l)("role.authTitle"),width:700,"on-before-ok":v,onClose:E},{default:e.withCtx(()=>[e.createVNode(e.unref(m)),e.createVNode(e.unref(d),null,{toolbar:e.withCtx(()=>[e.createVNode(B,{class:"mb-2"},{default:e.withCtx(()=>[e.createVNode(k,{type:"primary",onClick:g},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("common.create")),1)]),_:1}),e.createVNode(k,{type:"primary",onClick:x},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("common.deleteSelected")),1)]),_:1})]),_:1})]),_:1}),e.createVNode(Hd,{ref_key:"RoleChooseUserRef",ref:n,onChooseUserEmit:y},null,512)]),_:1},8,["model-value","title"])}}}),Jd={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},Qd={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},Xd={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},Yd=e.defineComponent({__name:"RoleQuery",setup(t){const o=e.ref(),r=e.ref(),{t:n}=Y.useI18n(),{searchFormSchema:l,tableColumns:s,resourceConfig:a}=$e({t:n}),i=async({page:L,formValues:k})=>{const B={pageNo:L.currentPage,pageSize:L.pageSize,authRole:k};return I.post("/core/authRole/selectForPage",B)},f={async toolbarButtonClick(L){const k=[...L.$grid.getCheckboxRecords()];switch(L.button.code){case"roleManagement/add":o.value.addInit();break;case"roleManagement/update":if(k.length!==1){S.Message.warning(n("common.selectOne"));return}o.value.editInit(k[0]);break;case"roleManagement/delete":if(k.length===0){S.Message.warning(n("role.selectDeleteRecords"));return}S.Modal.confirm({title:n("common.prompt"),content:n("role.deleteConfirm",{count:k.length}),onBeforeOk:async()=>{const B=k.map(P=>P.id),M=await I.post("/core/authRole/deleteRole",{idList:B});return M.code===200?(S.Message.success(M.message),L.$grid.commitProxy("query",{}),!0):(S.Message.error(M.message),!1)}});break;case"roleManagement/detail":if(k.length!==1){S.Message.warning(n("common.selectOne"));return}o.value.detailInit(k[0]);break;case"roleManagement/auth":if(k.length!==1){S.Message.warning(n("common.selectOne"));return}r.value.openInit(k[0]);break}}},{QueryForm:m,formApi:b,Grid:p,gridApi:c,submitting:d,handleGlobalEnter:u,searchPlanList:h,currentSearchPlan:g,resourceId:y,nResourceid:x,handleSearchPlanSearch:v,handleDefaultPlanLoaded:E,businessResumeState:_}=ce({searchFormSchema:l,tableColumns:s,resourceConfig:a,queryFunction:i,gridEvents:f});return(L,k)=>(e.openBlock(),e.createElementBlock("div",{class:"role-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:k[2]||(k[2]=e.withKeys((...B)=>e.unref(u)&&e.unref(u)(...B),["enter"])),tabindex:"-1"},[e.createElementVNode("div",Jd,[e.createElementVNode("div",Qd,[e.createVNode(e.unref(m))]),e.createElementVNode("div",Xd,[e.createVNode(e.unref(p),{class:"flex-1"})]),e.createVNode(ro,{ref_key:"RoleAddRef",ref:o,onSuccess:k[0]||(k[0]=()=>e.unref(c).commitProxy("query"))},null,512),e.createVNode(lo,{ref_key:"RoleAuthRef",ref:r,onSuccess:k[1]||(k[1]=()=>e.unref(c).commitProxy("query"))},null,512),e.createVNode(e.unref(ke),{state:e.unref(_)},null,8,["state"])])],32))}}),Zd=re(Yd,[["__scopeId","data-v-4f1fc0bd"]]);function eu(t,o){if(!Array.isArray(t))return[];const{label:r="cName",value:n="cXuhao"}=o||{};return t.map(l=>({label:String(l[r]||""),value:l[n],...l}))}const ao={loadOptions:async(t,o)=>{if(!t||t.length===0)return{};try{const r=await I.post("/core/contact/findAuthDictList",{numbList:t}),n=r?.result||r,l={};return Object.keys(n).forEach(s=>{l[s]=eu(n[s],o)}),l}catch(r){return console.error("[SelectOptionsAdapter] Failed to load options:",r),{}}}},so={loadOptions:async(t,o)=>{if(!t||t.length===0)return{};const{label:r="cExresname",value:n="cExresnum"}=o||{},l=s=>typeof r=="function"?r(s):Array.isArray(r)?r.map(a=>s[a]??"").join("-"):String(s[r]||"");try{const s=await I.post("/core/contact/findUserExresList",{numbList:t}),a=s?.result||s,i={};return Object.keys(a).forEach(f=>{const m=a[f]||[];i[f]=m.map(b=>({label:l(b),value:b[n],...b}))}),i}catch(s){return console.error("[PermissionOptionsAdapter] Failed to load options:",s),{}}}};function tu(t){return{input:"Input",select:"Select",date:"DatePicker",datetime:"TimePicker"}[t]||"Input"}function ou(t){return t.map(o=>{const r={label:o.label,fieldName:o.prop,component:tu(o.type),componentProps:{placeholder:o.meta?.placeholder||`请输入${o.label}`,...o.meta}};return o.type==="select"&&Array.isArray(o.optionlist)&&o.optionlist.length>0&&(r.componentProps.options=o.optionlist.map(n=>({label:n.cKeyname,value:n.cKeynumb}))),o.seltype==="3"&&o.selval&&(r.component="SunnyCustomizeSelect",r.componentProps={...r.componentProps,cNum:o.selval}),r})}function nu(t){return t.map(o=>({title:o.label,field:o.prop,width:o.width}))}function ru(t){return{title:t.cTitle,width:t.cWidth?isNaN(Number(t.cWidth))?t.cWidth:`${t.cWidth}px`:void 0,contentHeight:t.cHeight?isNaN(Number(t.cHeight))?t.cHeight:Number(t.cHeight):300,multiple:t.cSelectionMode!=="single",formSchema:ou(t.conditions),tableColumns:nu(t.tableCols)}}function lu(t,o){const{page:r,pageNo:n,pageSize:l,...s}=t;return{pageNo:n||r,pageSize:l,sqlNum:o,conditions:s}}function au(t){const o=t?.result||t;return{records:o?.records||o?.list||[],total:o?.total||o?.totalSize||0}}const io={loadConfig:async t=>{const o=await I.post("/core/assDialog/openInit",{cNum:t});return ru(o)},search:async t=>{const{cNum:o,...r}=t,n=lu(r,o),l=await I.post("/core/assDialog/selectForPageCommon",n);return au(l)}},su={query:async t=>{const r=(await I.post("/core/assSelect/commonQuery",t))?.result||{};return{options:r.optionList||[],config:r.assSelect||void 0}}},fe={disabled:!1,disabledOnChangeListener:!0,disabledOnInputListener:!0,emptyStateValue:void 0,businessSearchAdapter:io,customizeSelectAdapter:su,selectOptionsAdapter:ao,permissionOptionsAdapter:so,uploadConfig:void 0,apiPrefix:void 0};function iu(t={}){const{config:o,defineRules:r}=t,n={...fe,...o,businessSearchAdapter:{...fe.businessSearchAdapter,...o?.businessSearchAdapter},customizeSelectAdapter:{...fe.customizeSelectAdapter,...o?.customizeSelectAdapter},selectOptionsAdapter:{...fe.selectOptionsAdapter,...o?.selectOptionsAdapter},permissionOptionsAdapter:{...fe.permissionOptionsAdapter,...o?.permissionOptionsAdapter},uploadConfig:{...fe.uploadConfig,...o?.uploadConfig},apiPrefix:o?.apiPrefix};z.setupSunnyForm({config:n,defineRules:r})}function Te(t,o){if(Array.isArray(t)){const r=t.map(l=>`'${o[l.prop]||void 0}' ${l.comparison} '${l.value||void 0}'`),n=Q.first(t)?.logical||"&&";return r.join(` ${n} `)}else if(t&&t.type==="group"){if(!t.children||t.children.length===0)return"";const r=t.children.map(n=>{if(n.type==="group"){const l=Te(n,o);return l?`(${l})`:null}else return`'${o[n.prop]||void 0}' ${n.comparison} '${n.value||void 0}'`}).filter(n=>n);return r.length===0?"":r.join(` ${t.logical} `)}return""}function co(t){const{cName:o,cStoremethod:r,cIcon:n,cClass:l,nOrder:s,id:a,cEvent:i,cSubArea:f}=t;return{label:o,handle:r,icon:n,class:l,order:s,loading:!1,size:"mini",nButtonid:a,cEvent:i,cSubArea:f,name:o,code:r,params:JSON.stringify(t)}}function uo(t){const{cFieldtype:o,cLabel:r,cProp:n,cMeta:l,cSeltype:s,cSelval:a,cRequired:i,cPlaceholder:f,nOrder:m,cSign:b,cShow:p,nLg:c,cDefVal:d,nI18ndata:u,cDirectives:h,cDynamicShow:g,cDynamicRules:y,cDynamicDisabled:x,cWidth:v}=t,E=l?JSON.parse(l):{};var _={components:o,label:r,fieldName:n,componentProps:{placeholder:f,disabled:b==="0"},hidden:p!=="1",rules:i==="0"?"required":null,colSpan:c,defaultValue:d,order:m};return _={..._,...E},(o==="Input"||o==="Select")&&(_.componentProps.allowClear=!0),s&&a&&E.components!=="DatePicker"&&(_.componentProps.options=mt(t),s==="3"&&(_.components="SunnyCustomizeSelect",_.componentProps.cNum=a)),_.dependencies={show:L=>{const k=JSON.parse(g),B=Te(k,L);return B?new Function(`return ${B}`)():!0},required:L=>{const k=JSON.parse(y),B=Te(k,L);return B?new Function(`return ${B}`)():!0},disabled:L=>{const k=JSON.parse(x),B=Te(k,L);return B?new Function(`return ${B}`)():!1}},_}function mo(t){const{cLabel:o,cProp:r,cFieldtype:n,cMeta:l,cSeltype:s,cSelval:a,cWidth:i,nOrder:f,nBill:m,cSign:b,cRequired:p,cShow:c,cDirectives:d,cEntityTable:u,cDynamicRules:h,cDynamicDisabled:g}=t,y=l?JSON.parse(l):{};var x={title:o,field:r,width:i,...z.EditRender[n]??{},params:{required:p==="0",disabled:b==="0",visible:c==="0",order:f,nBill:m,cEntityTable:u}};return x={...y,...x},s&&a&&(x.params.options=mt(t)),x}function Le(t){const o=Q.groupBy(Q.orderBy(t.resFieldList.map(s=>({...uo(s),cArea:s.cArea})),["order"],["asc"]),"cArea"),r=Q.groupBy(Q.orderBy(t.resButtonList.map(s=>({...co(s),cArea:s.cArea,cSubArea:s.cSubArea})),["order"],["asc"]),"cArea"),n=Q.groupBy(Q.orderBy(t.resFieldList.map(s=>({...mo(s),cArea:s.cArea})),["order"],["asc"]),"cArea"),l=t.resMenu;return{resFieldList:o,resButtonList:r,resColumnList:n,resMenu:l}}function mt(t){const{cSeltype:o,cSelval:r,fieldDictList:n,fieldUserExresList:l}=t;var s=[];return o==="0"?s=n.map(a=>({label:a.cName,value:a.cXuhao,cConnkey:a.cConnkey})):o==="1"?s=X[r]:o==="2"?s=[]:o==="3"?s=[]:o==="4"&&(s=l.map(a=>({label:a.cExresnum+"-"+a.cExresname,value:a.cExresnum}))),s}function be(t,o){const r=(o||[]).find(n=>n.value==t);return r?r.label:t}function pt(t,o){console.error("[Error Report]",{error:t,context:o,timestamp:new Date().toISOString()})}function cu(t){const o=t.reason instanceof Error?t.reason:new Error(String(t.reason));pt(o,{type:"unhandledrejection",url:window.location.href,userAgent:navigator.userAgent,timestamp:new Date().toISOString()})}function du(t){const o=t.error instanceof Error?t.error:new Error(t.message);pt(o,{type:"global_error",filename:t.filename,lineno:t.lineno,colno:t.colno,url:window.location.href,userAgent:navigator.userAgent,timestamp:new Date().toISOString()})}const po=()=>({findAllByResourceid:t=>I.post("/core/assSearchplan/findAllByResourceid",t),findSearchPlanColsByPlanId:t=>I.post("/core/assSearchplan/findSearchPlanColsByPlanId",t),insert:t=>I.post("/core/assSearchplan/insert",t),update:t=>I.post("/core/assSearchplan/update",t),del:t=>I.post("/core/assSearchplan/delete",t),findDefSearchPlan:t=>I.post("/core/assSearchplan/findDefSearchPlan",t)}),ft=po();function ce(t){const{searchFormSchema:o,tableColumns:r,dataType:n,resourceConfig:l,queryFunction:s,gridEvents:a,treeConfig:i,loadMethod:f,objectToValueFields:m,fieldMappingTime:b,arrayToStringFields:p,lazy:c,autoLoad:d=!0,showCheckbox:u=!0,aggregateConfig:h,queryOnReset:g=!0}=t,{toolbarButtonClick:y,...x}=a||{},{resourceId:v,nResourceid:E,cModnumb:_}=l,L=e.ref([]),k=e.ref(void 0),B=e.ref(!1),{enhancedSchema:M}=ye(o);let P;const{enhancedSchema:R}=Ce(M,{onAutoSelect:A=>Ve(A,P)}),[C,w]=z.useSunnyForm({layout:"vertical",size:"mini",gridProps:{xGap:8,yGap:8,collapsedRows:1},commonConfig:{colProps:{span:24,sm:12,md:8,lg:6,xl:4}},collapsed:!0,showCollapseButton:!0,showDefaultActions:!0,submitOnEnter:!0,submitButtonOptions:{loading:B},actionColProps:{span:24,sm:12,md:8,lg:6,xl:4},schema:R.value,objectToValueFields:m,fieldMappingTime:b,arrayToStringFields:p});P=w;const V=e.reactive({id:"OperationLogQuery",border:!0,size:"mini",showOverflow:!0,stripe:!i&&!c,height:"auto",align:"center",scrollX:{enabled:!0,gt:20},scrollY:{enabled:!0,gt:20},rowConfig:{keyField:"id",isCurrent:!0,isHover:!0},...u&&{checkboxConfig:{highlight:!0,range:!i&&!c,reserve:!1,trigger:"row",checkStrictly:!!(i||c)}},columnConfig:{resizable:!0},pagerConfig:{enabled:!0,size:"mini",pageSize:20,pageSizes:[10,20,50,100]},toolbarConfig:{refresh:!0,zoom:!0,custom:!0},customConfig:{mode:"popup",storage:!0,showSortPutButton:!0},gridTip:`1. 表格支持本地(换电脑清空)列配置,退出登录不清空
|
|
6
|
+
</div>`,dangerouslyUseHTMLString:!0})}}catch(N){console.error("查询注册节点失败:",N),S.Message.error(o("jobinfo.queryFailed"))}break;case"jobinfo/rizhi":window.location.href=`/setting/dsrw/joblog?jobGroup=${w.jobGroup}&jobDesc=${encodeURIComponent(w.jobDesc)}`;break}},R=()=>{h.value?.refresh()};return(C,w)=>(e.openBlock(),e.createElementBlock("div",{class:"job-info-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:w[3]||(w[3]=e.withKeys((...V)=>e.unref(y)&&e.unref(y)(...V),["enter"])),tabindex:"-1"},[e.createElementVNode("div",hi,[e.createElementVNode("div",gi,[e.createVNode(e.unref(c))]),e.createElementVNode("div",bi,[e.createVNode(e.unref(u),{class:"flex-1"},{actionSlot:e.withCtx(({row:V})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M(),N=>(e.openBlock(),e.createElementBlock("button",{key:N.id,type:"button",class:"text-[rgb(var(--primary-6))] hover:text-[rgb(var(--primary-5))] mr-2",onClick:T=>P(N,V)},e.toDisplayString(N.label),9,vi))),128))]),_:1})])]),e.createVNode(ri,{ref_key:"formRef",ref:i,visible:l.value,"onUpdate:visible":w[0]||(w[0]=V=>l.value=V),onSuccess:R},null,8,["visible"]),e.createVNode(ai,{ref_key:"onceRef",ref:f,visible:s.value,"onUpdate:visible":w[1]||(w[1]=V=>s.value=V),onSuccess:R},null,8,["visible"]),e.createVNode(fi,{ref_key:"codeRef",ref:m,visible:a.value,"onUpdate:visible":w[2]||(w[2]=V=>a.value=V),onSuccess:R},null,8,["visible"])],32))}}),Ci=re(yi,[["__scopeId","data-v-73ae3969"]]),jt=({t})=>{const o=[{cKeyname:t("joblog.success"),cKeynumb:"200"},{cKeyname:t("joblog.failure"),cKeynumb:"500"},{cKeyname:t("joblog.empty"),cKeynumb:"0"}],r=[{cKeyname:t("joblog.success"),cKeynumb:"200"},{cKeyname:t("joblog.failure"),cKeynumb:"500"},{cKeyname:t("joblog.failureTimeout"),cKeynumb:"502"}],n=[{fieldName:"jobGroup",label:t("joblog.executor"),component:"Select",componentProps:{placeholder:t("joblog.selectExecutor"),allowClear:!0,options:[]},colProps:{span:4}},{fieldName:"jobDesc",label:t("joblog.jobDesc"),component:"Input",componentProps:{placeholder:t("joblog.inputJobDesc"),allowClear:!0},colProps:{span:4}},{fieldName:"triggerStatus",label:t("joblog.status"),component:"Select",componentProps:{placeholder:t("joblog.selectStatus"),allowClear:!0,options:[{label:t("joblog.all"),value:"-1"},{label:t("joblog.success"),value:"1"},{label:t("joblog.failure"),value:"2"},{label:t("joblog.running"),value:"3"}]},colProps:{span:4}},{fieldName:"timeList",label:t("joblog.scheduleDate"),component:"RangePicker",componentProps:{allowClear:!0,format:"YYYY-MM-DD",valueFormat:"YYYY-MM-DD"},colProps:{span:4}}],l=[{field:"jobld",title:t("joblog.jobId")},{field:"jobDesc",title:t("joblog.jobDesc")},{field:"triggerCode",title:t("joblog.scheduleResult"),formatter:({cellValue:s})=>o.find(i=>i.cKeynumb===s)?.cKeyname||s},{field:"triggerTime",title:t("joblog.scheduleTime")},{field:"executorAddress",title:t("joblog.executorAddress")},{field:"executorHandler",title:t("joblog.executorHandler")},{field:"executorParam",title:t("joblog.executorParam")},{field:"handleDdbz",title:t("joblog.scheduleRemark"),slots:{default:"handleDdbzSlot"}},{field:"handleTime",title:t("joblog.handleTime")},{field:"handleCode",title:t("joblog.handleResult"),formatter:({cellValue:s})=>r.find(i=>i.cKeynumb===s)?.cKeyname||s},{field:"handleMsg",title:t("joblog.handleMsg"),slots:{default:"handleMsgSlot"}},{field:"handleZxrz",title:t("joblog.handleLog"),slots:{default:"handleZxrzSlot"}}];return{searchFormSchema:n,tableColumns:l,triggerCodeOptions:o,handleCodeOptions:r}},xi={resourceId:"joblog",nResourceid:583,cModnumb:"9aad5aa1-14be-4c03-934d-e9e6722cdd4f"},ki={class:"bg-[#2b2b2b] inline-block text-center w-[40px] mr-2.5 select-none"},wi={class:"inline-block whitespace-nowrap mr-2.5"},Si={class:"absolute right-2.5 bottom-2.5 flex items-end flex-wrap flex-col h-[160px] justify-evenly"},Ni=e.defineComponent({__name:"LogList",props:{visible:{type:Boolean}},emits:["update:visible"],setup(t,{expose:o,emit:r}){const{t:n}=Y.useI18n(),l=r,s=e.ref(!1),a=e.ref([]),i=e.ref(""),f=e.ref(!1),m=e.ref(null),b=async u=>{i.value=u,a.value=[];try{const h=await I.post("/schedule/joblog/logDetail",{fromLineNum:0,id:u});h.success&&h.data&&(a.value=h.data.content?.logContentList||[],l("update:visible",!0),e.nextTick(()=>{m.value&&(m.value.scrollTop=m.value.scrollHeight)}))}catch(h){console.error("获取日志失败:",h)}},p=()=>{m.value&&(m.value.scrollTop=0)},c=async()=>{f.value=!0;try{const u=await I.post("/schedule/joblog/logDetail",{fromLineNum:a.value.length+1,id:i.value});if(u.success&&u.data){const h=u.data.content?.logContentList||[];a.value=a.value.concat(h),e.nextTick(()=>{m.value&&(m.value.scrollTop=m.value.scrollHeight)})}}catch(u){console.error("加载更多日志失败:",u)}finally{f.value=!1}},d=()=>{l("update:visible",!1)};return o({show:b}),(u,h)=>{const g=e.resolveComponent("a-button"),y=e.resolveComponent("a-modal");return e.openBlock(),e.createBlock(y,{visible:t.visible,"onUpdate:visible":h[1]||(h[1]=x=>l("update:visible",x)),footer:!1,"mask-closable":!1,closable:!1,fullscreen:s.value,width:"50%",height:"100%","modal-style":{background:"#222"},"body-style":{background:"#222",padding:0},"header-style":{background:"#222",padding:0}},{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"logboxRef",ref:m,class:"overflow-y-auto scroll-smooth bg-[#222]",style:e.normalizeStyle({height:s.value?"100vh":"60vh"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(x,v)=>(e.openBlock(),e.createElementBlock("div",{key:v,class:"bg-[#222] leading-[28px] text-xs text-[#ccc] whitespace-nowrap hover:bg-[#2b2b2b]"},[e.createElementVNode("div",ki,e.toDisplayString(v+1),1),e.createElementVNode("div",wi,e.toDisplayString(x),1)]))),128))],4),e.createElementVNode("div",Si,[e.createVNode(g,{type:"primary",status:"danger",shape:"circle",onClick:d,tooltip:e.unref(n)("joblog.close")},{icon:e.withCtx(()=>[e.createVNode(e.unref(Jo))]),_:1},8,["tooltip"]),e.createVNode(g,{type:"primary",status:"danger",shape:"circle",onClick:h[0]||(h[0]=x=>s.value=!s.value),tooltip:e.unref(n)("joblog.fullscreen")},{icon:e.withCtx(()=>[e.createVNode(e.unref(xn))]),_:1},8,["tooltip"]),e.createVNode(g,{type:"primary",status:"danger",shape:"circle",onClick:p,tooltip:e.unref(n)("joblog.scrollToTop")},{icon:e.withCtx(()=>[e.createVNode(e.unref(Ko))]),_:1},8,["tooltip"]),e.createVNode(g,{type:"primary",status:"danger",shape:"circle",loading:f.value,onClick:c,tooltip:e.unref(n)("joblog.scrollToBottom")},{icon:e.withCtx(()=>[e.createVNode(e.unref(Fo))]),_:1},8,["loading","tooltip"])])]),_:1},8,["visible","fullscreen"])}}}),_i={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},Vi={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},Ei={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},Pi=["onClick"],Mi=["onClick"],Ti=["onClick"],Bi={class:"p-5"},Ri=["innerHTML"],$i={class:"flex justify-center mt-4"},Li=e.defineComponent({__name:"JobLogQuery",setup(t){const{t:o}=Y.useI18n(),{searchFormSchema:r,tableColumns:n}=jt({t:o}),l=e.ref(!1),s=e.ref(""),a=e.ref(!1),i=e.ref(null),f=async({page:B,formValues:M})=>{const P={pageNo:B.currentPage,pageSize:B.pageSize,xxlJobLog:M};return I.post("/schedule/joblog/selectForPage",P)},{QueryForm:m,formApi:b,Grid:p,gridApi:c,submitting:d,handleGlobalEnter:u,searchPlanList:h,currentSearchPlan:g,resourceId:y,nResourceid:x,handleSearchPlanSearch:v,handleDefaultPlanLoaded:E}=ce({searchFormSchema:r,tableColumns:n,resourceConfig:xi,queryFunction:f}),_=B=>{s.value=B.handleDdbz||"",l.value=!0},L=B=>{S.Modal.info({title:o("joblog.handleMsgTitle"),content:B||"",width:500})},k=B=>{i.value&&i.value.show(B.jobld.toString())};return(B,M)=>{const P=e.resolveComponent("a-button"),R=e.resolveComponent("a-modal");return e.openBlock(),e.createElementBlock("div",{class:"job-log-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:M[3]||(M[3]=e.withKeys((...C)=>e.unref(u)&&e.unref(u)(...C),["enter"])),tabindex:"-1"},[e.createElementVNode("div",_i,[e.createElementVNode("div",Vi,[e.createVNode(e.unref(m))]),e.createElementVNode("div",Ei,[e.createVNode(e.unref(p),{class:"flex-1"},{handleDdbzSlot:e.withCtx(({row:C})=>[e.createElementVNode("button",{type:"button",class:"text-[rgb(var(--primary-6))] hover:text-[rgb(var(--primary-5))]",onClick:w=>_(C)},e.toDisplayString(e.unref(o)("joblog.view")),9,Pi)]),handleMsgSlot:e.withCtx(({row:C})=>[C.handleMsg?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"text-[rgb(var(--primary-6))] hover:text-[rgb(var(--primary-5))]",onClick:w=>L(C.handleMsg)},e.toDisplayString(e.unref(o)("joblog.view")),9,Mi)):e.createCommentVNode("",!0)]),handleZxrzSlot:e.withCtx(({row:C})=>[C.nShow===1?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"text-[rgb(var(--primary-6))] hover:text-[rgb(var(--primary-5))]",onClick:w=>k(C)},e.toDisplayString(e.unref(o)("joblog.view")),9,Ti)):e.createCommentVNode("",!0)]),_:1})])]),e.createVNode(R,{visible:l.value,"onUpdate:visible":M[1]||(M[1]=C=>l.value=C),footer:!1,"mask-closable":!1,width:"500px",closable:!1,"modal-style":{background:"transparent",boxShadow:"none",border:"none"},"body-style":{background:"transparent"},"header-style":{background:"transparent"},"footer-style":{background:"transparent"}},{header:e.withCtx(()=>[...M[4]||(M[4]=[e.createElementVNode("div",null,null,-1)])]),default:e.withCtx(()=>[e.createElementVNode("div",Bi,[e.createElementVNode("div",{innerHTML:s.value},null,8,Ri)]),e.createElementVNode("div",$i,[e.createVNode(P,{type:"primary",onClick:M[0]||(M[0]=C=>l.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("joblog.confirm")),1)]),_:1})])]),_:1},8,["visible"]),e.createVNode(Ni,{ref_key:"logListRef",ref:i,visible:a.value,"onUpdate:visible":M[2]||(M[2]=C=>a.value=C)},null,8,["visible"])],32)}}}),zt=({t})=>{const o=[{cKeyname:t("jobgroup.online"),cKeynumb:"1"},{cKeyname:t("jobgroup.offline"),cKeynumb:"0"}],r=[{cKeyname:t("jobgroup.autoRegister"),cKeynumb:"0"},{cKeyname:t("jobgroup.manualEntry"),cKeynumb:"1"}],n=[{fieldName:"appname",label:t("jobgroup.appname"),component:"Input",componentProps:{placeholder:t("jobgroup.inputAppname"),allowClear:!0},colProps:{span:4}},{fieldName:"title",label:t("jobgroup.title"),component:"Input",componentProps:{placeholder:t("jobgroup.inputTitle"),allowClear:!0},colProps:{span:4}}],l=[{field:"appname",title:t("jobgroup.appname")},{field:"title",title:t("jobgroup.title")},{field:"addressType",title:t("jobgroup.registerType"),formatter:({cellValue:s})=>r.find(i=>i.cKeynumb===s)?.cKeyname||s},{field:"addressList",title:t("jobgroup.onlineAddressList")},{field:"action",title:t("jobgroup.action"),fixed:"right",width:400,slots:{default:"actionSlot"}}];return{searchFormSchema:n,tableColumns:l,statusOptions:o,zcfsOpts:r}},Ii={resourceId:"jobgroup",nResourceid:584,cModnumb:"bfd3d15f-f261-4e02-9f37-be3dfd7edd00"},Di={class:"flex justify-end gap-2 mt-4"},Oi=e.defineComponent({__name:"JobGroupForm",props:{visible:{type:Boolean},formData:{}},emits:["update:visible","success"],setup(t,{expose:o,emit:r}){const{t:n}=Y.useI18n(),l=t,s=r,a=e.ref(null),i=e.reactive({appname:"",title:"",addressType:"0",addressList:"",id:""}),f={zcfsOpts:[{cKeyname:n("jobgroup.autoRegister"),cKeynumb:"0"},{cKeyname:n("jobgroup.manualEntry"),cKeynumb:"1"}]},m=e.ref(!1);e.watch(()=>l.formData,c=>{c&&Object.assign(i,c)},{deep:!0});const b=async()=>{a.value&&a.value.validate().then(async()=>{m.value=!0;try{let c;i.id?c=await I.post("/schedule/jobgroup/update",i):c=await I.post("/schedule/jobgroup/save",i),c.success&&(S.Message.success(i.id?n("jobgroup.editSuccess"):n("jobgroup.addSuccess")),s("success"),p())}catch(c){console.error("保存失败:",c),S.Message.error(n("jobgroup.saveFailed"))}finally{m.value=!1}})},p=()=>{a.value&&a.value.clearValidate(),Object.assign(i,{appname:"",title:"",addressType:"0",addressList:"",id:""}),s("update:visible",!1)};return o({show:c=>{c?Object.assign(i,c):Object.assign(i,{appname:"",title:"",addressType:"0",addressList:"",id:""}),s("update:visible",!0)}}),(c,d)=>{const u=e.resolveComponent("a-input"),h=e.resolveComponent("a-form-item"),g=e.resolveComponent("a-radio"),y=e.resolveComponent("a-radio-group"),x=e.resolveComponent("a-textarea"),v=e.resolveComponent("a-form"),E=e.resolveComponent("a-button"),_=e.resolveComponent("a-modal");return e.openBlock(),e.createBlock(_,{title:i.id?e.unref(n)("jobgroup.editTitle"):e.unref(n)("jobgroup.addTitle"),visible:t.visible,"onUpdate:visible":d[4]||(d[4]=L=>s("update:visible",L)),"mask-closable":!1,closable:!1,width:"900px",footer:!1},{default:e.withCtx(()=>[e.createVNode(v,{ref_key:"formRef",ref:a,model:i,"label-width":130},{default:e.withCtx(()=>[e.createVNode(h,{label:e.unref(n)("jobgroup.appname"),field:"appname",rules:[{required:!0,message:e.unref(n)("jobgroup.inputAppname")}]},{default:e.withCtx(()=>[e.createVNode(u,{modelValue:i.appname,"onUpdate:modelValue":d[0]||(d[0]=L=>i.appname=L),placeholder:e.unref(n)("jobgroup.inputAppname")},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),e.createVNode(h,{label:e.unref(n)("jobgroup.title"),field:"title",rules:[{required:!0,message:e.unref(n)("jobgroup.inputTitle")}]},{default:e.withCtx(()=>[e.createVNode(u,{modelValue:i.title,"onUpdate:modelValue":d[1]||(d[1]=L=>i.title=L),placeholder:e.unref(n)("jobgroup.inputTitle")},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),e.createVNode(h,{label:e.unref(n)("jobgroup.registerType"),field:"addressType",rules:[{required:!0,message:e.unref(n)("jobgroup.selectRegisterType")}]},{default:e.withCtx(()=>[e.createVNode(y,{modelValue:i.addressType,"onUpdate:modelValue":d[2]||(d[2]=L=>i.addressType=L)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.zcfsOpts,L=>(e.openBlock(),e.createBlock(g,{key:L.cKeynumb,value:L.cKeynumb},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(L.cKeyname),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["label","rules"]),e.createVNode(h,{label:e.unref(n)("jobgroup.machineAddress"),field:"addressList",rules:[{required:i.addressType==="1",message:e.unref(n)("jobgroup.inputMachineAddress")}]},{default:e.withCtx(()=>[e.createVNode(x,{modelValue:i.addressList,"onUpdate:modelValue":d[3]||(d[3]=L=>i.addressList=L),rows:4,"max-rows":8,disabled:i.addressType==="0",placeholder:e.unref(n)("jobgroup.inputMachineAddressList")},null,8,["modelValue","disabled","placeholder"])]),_:1},8,["label","rules"])]),_:1},8,["model"]),e.createElementVNode("div",Di,[e.createVNode(E,{type:"primary",loading:m.value,onClick:b},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("jobgroup.save")),1)]),_:1},8,["loading"]),e.createVNode(E,{onClick:p},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("jobgroup.cancel")),1)]),_:1})])]),_:1},8,["title","visible"])}}}),ji={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},zi={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},Fi={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},Ai=["onClick"],Ui=e.defineComponent({__name:"JobGroupQuery",setup(t){const{t:o}=Y.useI18n(),{searchFormSchema:r,tableColumns:n}=zt({t:o}),l=e.ref(!1),s=e.ref(null),a=async({page:B,formValues:M})=>{const P={pageNo:B.currentPage,pageSize:B.pageSize,xxlJobGroup:M};return I.post("/schedule/jobgroup/selectForPage",P)},i={async toolbarButtonClick(B){[...B.$grid.getCheckboxRecords()],B.button.code==="jobgroup/add"&&s.value&&s.value.show()}},{QueryForm:f,formApi:m,Grid:b,gridApi:p,submitting:c,handleGlobalEnter:d,searchPlanList:u,currentSearchPlan:h,resourceId:g,nResourceid:y,resourceButtons:x,handleSearchPlanSearch:v,handleDefaultPlanLoaded:E}=ce({searchFormSchema:r,tableColumns:n,resourceConfig:Ii,queryFunction:a,gridEvents:i}),_=B=>x.value.filter(M=>M.cSubArea==="columnTable"),L=async(B,M)=>{const{handle:P}=B;switch(P){case"jobgroup/edit":try{const R=await I.post("/schedule/jobgroup/get",{id:M.id});if(R.success&&R.data){const C=R.data;C.addressType=String(C.addressType),s.value&&s.value.show(C)}}catch(R){console.error("查询单个执行器失败:",R),S.Message.error(o("jobgroup.queryFailed"))}break;case"jobgroup/del":S.Modal.confirm({title:o("jobgroup.confirmDelete"),content:o("jobgroup.confirmDeleteSingle",{title:M.title}),onOk:async()=>{try{(await I.post("/schedule/jobgroup/remove",{id:M.id})).success&&(S.Message.success(o("jobgroup.deleteSuccess")),p.value?.refresh())}catch(R){console.error("删除失败:",R),S.Message.error(o("jobgroup.deleteFailed"))}}});break}},k=()=>{p.value?.refresh()};return(B,M)=>(e.openBlock(),e.createElementBlock("div",{class:"job-group-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:M[1]||(M[1]=e.withKeys((...P)=>e.unref(d)&&e.unref(d)(...P),["enter"])),tabindex:"-1"},[e.createElementVNode("div",ji,[e.createElementVNode("div",zi,[e.createVNode(e.unref(f))]),e.createElementVNode("div",Fi,[e.createVNode(e.unref(b),{class:"flex-1"},{actionSlot:e.withCtx(({row:P})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_(),R=>(e.openBlock(),e.createElementBlock("button",{key:R.id,type:"button",class:"text-[rgb(var(--primary-6))] hover:text-[rgb(var(--primary-5))] mr-2",onClick:C=>L(R,P)},e.toDisplayString(R.label),9,Ai))),128))]),_:1})])]),e.createVNode(Oi,{ref_key:"formRef",ref:s,visible:l.value,"onUpdate:visible":M[0]||(M[0]=P=>l.value=P),onSuccess:k},null,8,["visible"])],32))}}),qi=re(Ui,[["__scopeId","data-v-69c513e0"]]),Ki=e.markRaw(z.SunnyCustomizeSelect),Ft=({t,formApi:o})=>{const r=[{cKeyname:t("zdyxlk.backendSQL"),cKeynumb:"0"},{cKeyname:t("zdyxlk.customImplementation"),cKeynumb:"1"}],n=[{cKeyname:t("zdyxlk.dropdown"),cKeynumb:"0"},{cKeyname:t("zdyxlk.searchableDropdown"),cKeynumb:"1"}],l=[{cKeyname:t("zdyxlk.private"),cKeynumb:"0"},{cKeyname:t("zdyxlk.public"),cKeynumb:"1"}],s=[{cKeyname:t("zdyxlk.exactMatch"),cKeynumb:"0"},{cKeyname:t("zdyxlk.fuzzyMatch"),cKeynumb:"1"}],a=[{fieldName:"cNum",label:t("zdyxlk.cNum"),component:"Input",componentProps:{placeholder:t("zdyxlk.inputcNum"),allowClear:!0},colProps:{span:4}},{fieldName:"cTitle",label:t("zdyxlk.cTitle"),component:"Input",componentProps:{placeholder:t("zdyxlk.inputcTitle"),allowClear:!0},colProps:{span:4}},{fieldName:"cWork",label:t("zdyxlk.cWork"),component:Ki,componentProps:{placeholder:t("zdyxlk.inputcWork"),allowClear:!0,cNum:"UserSearch1",fieldNames:{label:"cKeyname",value:"cKeyname"}},colProps:{span:4}}],i=[{type:"checkbox",width:40},{field:"cNum",title:t("zdyxlk.cNum")},{field:"nCbtype",title:t("zdyxlk.nCbtype"),formatter:({cellValue:m})=>r.find(p=>p.cKeynumb===m)?.cKeyname||m},{field:"cCbclass",title:t("zdyxlk.cCbclass")},{field:"cTitle",title:t("zdyxlk.cTitle")},{field:"cValcol",title:t("zdyxlk.cValcol")},{field:"cLabelcol",title:t("zdyxlk.cLabelcol")},{field:"cLabelslotcol",title:t("zdyxlk.cLabelslotcol")},{field:"nType",title:t("zdyxlk.nType"),formatter:({cellValue:m})=>n.find(p=>p.cKeynumb===m)?.cKeyname||m},{field:"nSearchinterval",title:t("zdyxlk.nSearchinterval")},{field:"cStaffname",title:t("zdyxlk.cStaffname")},{field:"nLimit",title:t("zdyxlk.nLimit")},{field:"nSfcommon",title:t("zdyxlk.nSfcommon"),formatter:({cellValue:m})=>l.find(p=>p.cKeynumb===m)?.cKeyname||m}],f=[{fieldName:"nCbtype",label:t("zdyxlk.nCbtype"),component:"Select",componentProps:{placeholder:t("zdyxlk.selectnCbtype"),options:r.map(m=>({label:m.cKeyname,value:m.cKeynumb})),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"cCbclass",label:t("zdyxlk.cCbclass"),component:"Input",componentProps:{placeholder:t("zdyxlk.inputcCbclass"),allowClear:!0},colProps:{span:8}},{fieldName:"cNum",label:t("zdyxlk.cNum"),component:"Input",componentProps:{placeholder:t("zdyxlk.inputcNum"),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"cTitle",label:t("zdyxlk.cTitle"),component:"Input",componentProps:{placeholder:t("zdyxlk.inputcTitle"),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"cValcol",label:t("zdyxlk.cValcol"),component:"Input",componentProps:{placeholder:t("zdyxlk.inputcValcol"),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"cLabelcol",label:t("zdyxlk.cLabelcol"),component:"Input",componentProps:{placeholder:t("zdyxlk.inputcLabelcol"),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"cLabelslotcol",label:t("zdyxlk.cLabelslotcol"),component:"Input",componentProps:{placeholder:t("zdyxlk.inputcLabelslotcol"),allowClear:!0},colProps:{span:8}},{fieldName:"nType",label:t("zdyxlk.nType"),component:"Select",componentProps:{placeholder:t("zdyxlk.selectnType"),options:n.map(m=>({label:m.cKeyname,value:m.cKeynumb})),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"nLikematch",label:t("zdyxlk.nLikematch"),component:"Select",componentProps:{placeholder:t("zdyxlk.selectnLikematch"),options:s.map(m=>({label:m.cKeyname,value:m.cKeynumb})),allowClear:!0},colProps:{span:8}},{fieldName:"nSearchinterval",label:t("zdyxlk.nSearchinterval"),component:"InputNumber",componentProps:{placeholder:"默认700毫秒",min:0,max:5e3,allowClear:!0},colProps:{span:8}},{fieldName:"nLimit",label:t("zdyxlk.nLimit"),component:"InputNumber",componentProps:{placeholder:"默认20",min:1,max:1e3,allowClear:!0},colProps:{span:8}},{fieldName:"nSfcommon",label:t("zdyxlk.nSfcommon"),component:"Select",componentProps:{placeholder:t("zdyxlk.selectnSfcommon"),options:l.map(m=>({label:m.cKeyname,value:m.cKeynumb})),allowClear:!0},colProps:{span:8}},{fieldName:"cPrefixUrl",label:t("zdyxlk.cPrefixUrl"),component:"Input",componentProps:{placeholder:t("zdyxlk.inputcPrefixUrl"),allowClear:!0},colProps:{span:8}}];return{searchFormSchema:a,tableColumns:i,addEditFormSchema:f,nCbtypeOptions:r,nTypeOptions:n,nSfcommonOptions:l,nLikematchOptions:s}},Wi={resourceId:"zdyxlk",nResourceid:11908,cModnumb:"ZDYXLK"},Gi=e.defineComponent({__name:"ZdyxlkAdd",emits:["success"],setup(t,{expose:o,emit:r}){const{t:n}=Y.useI18n(),l=e.ref(!1),s=e.ref("add"),a=e.ref(!1),i=r,[f,m]=z.useSunnyForm({layout:"vertical",size:"small",labelWidth:120,showDefaultActions:!1,scrollToFirstError:!0,schema:[]}),{addEditFormSchema:b}=Ft({t:n,formApi:m});m.setState({handleValuesChange:g=>{"nCbtype"in g&&(g.nCbtype,p(g.nCbtype))}});const p=g=>{const y=g==="0";m.updateSchema([{fieldName:"cValcol",hidden:!y},{fieldName:"cLabelcol",hidden:!y}])};o({addInit:async()=>{l.value=!0,s.value="add",m.setState({schema:b}),m.resetForm(),m.setValues({nCbtype:"0"}),await e.nextTick(),p("0")},editInit:async g=>{a.value=!0,s.value="edit";let y=null;try{const x=await I.post("/core/assSelect/update_init",{id:g.id});x.code===200&&x.result&&(y={...x.result},y.nCbtype!==void 0&&(y.nCbtype=String(y.nCbtype)),y.nLikematch!==void 0&&(y.nLikematch=String(y.nLikematch)),y.nSfcommon!==void 0&&(y.nSfcommon=String(y.nSfcommon)),y.nType!==void 0&&(y.nType=String(y.nType)))}catch(x){console.error("查询失败:",x),S.Message.error(n("zdyxlk.queryFailed"))}l.value=!0,await e.nextTick(),m.setState({schema:b}),m.resetForm(),y&&(m.setValues(y,!1),m.updateSchema([{fieldName:"cNum",componentProps:{disabled:!0}}]),p(y.nCbtype)),a.value=!1}});const u=async()=>{const{valid:g}=await m.validate();if(!g)return!1;const x={...await m.getValues()};try{const v=await I.post(s.value==="add"?"/core/assSelect/insert":"/core/assSelect/update",x);return v.code===200?(S.Message.success(s.value==="add"?n("zdyxlk.addSuccess"):n("zdyxlk.editSuccess")),l.value=!1,i("success"),!0):(S.Message.error(v.message||n("zdyxlk.saveFailed")),!1)}catch(v){return console.error("保存失败:",v),S.Message.error(n("zdyxlk.saveFailed")),!1}},h=()=>{l.value=!1};return(g,y)=>(e.openBlock(),e.createBlock(e.unref(z.Modal),{"model-value":l.value,title:s.value==="add"?e.unref(n)("zdyxlk.addTitle"):e.unref(n)("zdyxlk.editTitle"),"on-before-ok":u,onClose:h,width:"800px"},{default:e.withCtx(()=>[e.createVNode(e.unref(f))]),_:1},8,["model-value","title"]))}}),Hi={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},Ji={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},Qi={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},Xi=["onClick"],Yi=e.defineComponent({__name:"ZdyxlkQuery",setup(t){const o=e.ref(),{t:r}=Y.useI18n(),{searchFormSchema:n,tableColumns:l}=Ft({t:r}),s=async({page:L,formValues:k})=>{const B={pageNo:L.currentPage,pageSize:L.pageSize,assSelect:k},M=await I.post("/core/assSelect/selectForPage",B);return M.code===200&&M.result&&M.result.records&&(M.result.records=M.result.records.map(P=>({...P,nCbtype:P.nCbtype!==void 0?String(P.nCbtype):P.nCbtype,nType:P.nType!==void 0?String(P.nType):P.nType,nLikematch:P.nLikematch!==void 0?String(P.nLikematch):P.nLikematch,nSfcommon:P.nSfcommon!==void 0?String(P.nSfcommon):P.nSfcommon}))),M},a={async toolbarButtonClick(L){const k=[...L.$grid.getCheckboxRecords()];switch(L.button.code){case"zdyxlk/add":o.value.addInit();break;case"zdyxlk/edit":if(k.length!==1){S.Message.warning(r("common.selectOne"));return}o.value.editInit(k[0]);break;case"zdyxlk/del":if(k.length===0){S.Message.warning(r("zdyxlk.selectDeleteRecords"));return}S.Modal.confirm({title:r("zdyxlk.confirmDelete"),content:r("zdyxlk.confirmDeleteMultiple",{count:k.length}),onBeforeOk:async()=>{const B=k.map(P=>P.id),M=await I.post("/core/assSelect/delete",{idList:B});return M.code===200?(S.Message.success(M.message),L.$grid.commitProxy("query",{}),!0):(S.Message.error(M.message),!1)}});break}}},{QueryForm:i,formApi:f,Grid:m,gridApi:b,submitting:p,handleGlobalEnter:c,searchPlanList:d,currentSearchPlan:u,resourceId:h,nResourceid:g,resourceButtons:y,handleSearchPlanSearch:x,handleDefaultPlanLoaded:v}=ce({searchFormSchema:n,tableColumns:l,resourceConfig:Wi,queryFunction:s,gridEvents:a}),E=L=>y.value.filter(k=>k.cSubArea==="columnTable"),_=async(L,k)=>{const{handle:B}=L;switch(B){case"zdyxlk/edit":o.value.editInit(k);break;case"zdyxlk/del":S.Modal.confirm({title:r("zdyxlk.confirmDelete"),content:r("zdyxlk.confirmDeleteSingle",{CTitle:k.CTitle}),onOk:async()=>{try{const M=await I.post("/core/assSelect/delete",{id:k.id});M.code===200?(S.Message.success(M.message),b.value?.refresh()):S.Message.error(M.message)}catch(M){console.error("删除失败:",M),S.Message.error(r("zdyxlk.deleteFailed"))}}});break}};return(L,k)=>(e.openBlock(),e.createElementBlock("div",{class:"zdyxlk-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:k[1]||(k[1]=e.withKeys((...B)=>e.unref(c)&&e.unref(c)(...B),["enter"])),tabindex:"-1"},[e.createElementVNode("div",Hi,[e.createElementVNode("div",Ji,[e.createVNode(e.unref(i))]),e.createElementVNode("div",Qi,[e.createVNode(e.unref(m),{class:"flex-1"},{actionSlot:e.withCtx(({row:B})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E(),M=>(e.openBlock(),e.createElementBlock("button",{key:M.id,type:"button",class:"text-[rgb(var(--primary-6))] hover:text-[rgb(var(--primary-5))] mr-2",onClick:P=>_(M,B)},e.toDisplayString(M.label),9,Xi))),128))]),_:1})])]),e.createVNode(Gi,{ref_key:"ZdyxlkAddRef",ref:o,onSuccess:k[0]||(k[0]=()=>e.unref(b).commitProxy("query"))},null,512)],32))}}),Zi=re(Yi,[["__scopeId","data-v-2065aa57"]]),ct=({t})=>{const o=[{cKeyname:"启用",cKeynumb:"0"},{cKeyname:"禁用",cKeynumb:"1"}],r=[{fieldName:"cModnumb",label:t("assSendoa.cModnumb"),component:"Input",componentProps:{placeholder:t("assSendoa.inputcModnumb"),allowClear:!0},colProps:{span:4}},{fieldName:"cGongsi",label:t("assSendoa.cGongsi"),component:"Input",componentProps:{placeholder:t("assSendoa.inputcGongsi"),allowClear:!0},colProps:{span:4}},{fieldName:"nSign",label:t("assSendoa.nSign"),component:"Select",componentProps:{placeholder:t("assSendoa.selectnSign"),allowClear:!0,options:o.map(s=>({label:s.cKeyname,value:s.cKeynumb}))},colProps:{span:4}},{fieldName:"cUrl",label:t("assSendoa.cUrl"),component:"Input",componentProps:{placeholder:t("assSendoa.inputcUrl"),allowClear:!0},colProps:{span:4}}],n=[{type:"checkbox",width:40},{field:"cModnumb",title:t("assSendoa.cModnumb")},{field:"cGongsi",title:t("assSendoa.cGongsi")},{field:"cLcmc",title:t("assSendoa.cLcmc")},{field:"cOalcid",title:t("assSendoa.cOalcid")},{field:"cUrl",title:t("assSendoa.cUrl")},{field:"nSign",title:t("assSendoa.nSign"),formatter:({cellValue:s})=>o.find(i=>i.cKeynumb===s)?.cKeyname||s},{field:"cCreateuserName",title:t("assSendoa.CreateuserName")},{field:"dCreatetime",title:t("assSendoa.dCreatetime")},{field:"cBeizhu",title:t("assSendoa.cBeizhu")}],l=[{fieldName:"cModnumb",label:t("assSendoa.cModnumb"),component:"Input",componentProps:{placeholder:t("assSendoa.inputcModnumb"),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"cGongsi",label:t("assSendoa.cGongsi"),component:"Input",componentProps:{placeholder:t("assSendoa.inputcGongsi"),allowClear:!0},colProps:{span:8}},{fieldName:"nSign",label:t("assSendoa.nSign"),component:"Select",componentProps:{placeholder:t("assSendoa.selectnSign"),options:o.map(s=>({label:s.cKeyname,value:s.cKeynumb})),allowClear:!0},colProps:{span:8}},{fieldName:"cLcmc",label:t("assSendoa.cLcmc"),component:"Input",componentProps:{placeholder:t("assSendoa.inputcLcmc"),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"cUrl",label:t("assSendoa.cUrl"),component:"Input",componentProps:{placeholder:t("assSendoa.inputcUrl"),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"cOalcid",label:t("assSendoa.cOalcid"),component:"Input",componentProps:{placeholder:t("assSendoa.cOalcid"),allowClear:!0},rules:"required",colProps:{span:8}}];return{searchFormSchema:r,tableColumns:n,addEditFormSchema:l,userSfqyOpts:o}},ec={resourceId:"assSendoa",nResourceid:326,cModnumb:"066e0071-1bb5-494a-9d5e-506eb65b8c81"},At=e.defineComponent({__name:"AssSendoaAdd",emits:["success"],setup(t,{expose:o,emit:r}){const{t:n}=Y.useI18n(),l=e.ref(!1),s=e.ref("add"),a=e.ref(!1),i=r,[f,m]=z.useSunnyForm({layout:"vertical",size:"small",labelWidth:120,showDefaultActions:!1,scrollToFirstError:!0,schema:[]}),{addEditFormSchema:b}=ct({t:n});o({addInit:async()=>{l.value=!0,s.value="add",m.setState({schema:b}),m.resetForm(),await e.nextTick()},editInit:async h=>{a.value=!0,s.value="edit";let g=null;try{const y=await I.post("/core/assSendoa/update_init",{assSendoa:{id:h.id}});y.code===200&&y.result&&(g={...y.result},g.nSign!==void 0&&(g.nSign=String(g.nSign)))}catch(y){console.error("查询失败:",y),S.Message.error(n("assSendoa.queryFailed"))}l.value=!0,await e.nextTick(),m.setState({schema:b}),m.resetForm(),g&&m.setValues(g,!1),a.value=!1}});const d=async()=>{const{valid:h}=await m.validate();if(!h)return!1;const y={assSendoa:{...await m.getValues()}};try{const x=await I.post(s.value==="add"?"/core/assSendoa/insert":"/core/assSendoa/update",y);return x.code===200?(S.Message.success(s.value==="add"?n("assSendoa.addSuccess"):n("assSendoa.editSuccess")),l.value=!1,i("success"),!0):(S.Message.error(x.message||n("assSendoa.saveFailed")),!1)}catch(x){return console.error("保存失败:",x),S.Message.error(n("assSendoa.saveFailed")),!1}},u=()=>{l.value=!1};return(h,g)=>(e.openBlock(),e.createBlock(e.unref(z.Modal),{"model-value":l.value,title:s.value==="add"?e.unref(n)("assSendoa.addTitle"):e.unref(n)("assSendoa.editTitle"),"on-before-ok":d,onClose:u,width:"800px"},{default:e.withCtx(()=>[e.createVNode(e.unref(f))]),_:1},8,["model-value","title"]))}}),tc={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},oc={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},nc={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},rc=["onClick"],lc=e.defineComponent({__name:"AssSendoaQuery",setup(t){const o=e.ref(),{t:r}=Y.useI18n(),{searchFormSchema:n,tableColumns:l}=ct({t:r}),s=async({page:L,formValues:k})=>{const B={pageNo:L.currentPage,pageSize:L.pageSize,assSendoa:k},M=await I.post("/core/assSendoa/selectForPage",B);return M.result&&M.result.records&&M.result.records.forEach(P=>{P.nSign!==void 0&&(P.nSign=String(P.nSign))}),M},a={async toolbarButtonClick(L){const k=[...L.$grid.getCheckboxRecords()];switch(L.button.code){case"assSendoa/add":o.value.addInit();break;case"assSendoa/edit":if(k.length!==1){S.Message.warning(r("common.selectOne"));return}o.value.editInit(k[0]);break;case"assSendoa/del":if(k.length===0){S.Message.warning(r("assSendoa.selectDeleteRecords"));return}S.Modal.confirm({title:r("assSendoa.confirmDelete"),content:r("assSendoa.confirmDeleteMultiple",{count:k.length}),onBeforeOk:async()=>{const B=k.map(P=>P.id),M=await I.post("/core/assSendoa/delete",{idList:B});return M.code===200?(S.Message.success(M.message),L.$grid.commitProxy("query",{}),!0):(S.Message.error(M.message),!1)}});break}}},{QueryForm:i,formApi:f,Grid:m,gridApi:b,submitting:p,handleGlobalEnter:c,searchPlanList:d,currentSearchPlan:u,resourceId:h,nResourceid:g,resourceButtons:y,handleSearchPlanSearch:x,handleDefaultPlanLoaded:v}=ce({searchFormSchema:n,tableColumns:l,resourceConfig:ec,queryFunction:s,gridEvents:a}),E=L=>y.value.filter(k=>k.cSubArea==="columnTable"),_=async(L,k)=>{const{handle:B}=L;switch(B){case"assSendoa/edit":o.value.editInit(k);break;case"assSendoa/del":S.Modal.confirm({title:r("assSendoa.confirmDelete"),content:r("assSendoa.confirmDeleteSingle",{cModnumb:k.cModnumb}),onOk:async()=>{try{const M=await I.post("/core/assSendoa/delete",{id:k.id});M.code===200?(S.Message.success(M.message),b.value?.refresh()):S.Message.error(M.message)}catch(M){console.error("删除失败:",M),S.Message.error(r("assSendoa.deleteFailed"))}}});break}};return(L,k)=>(e.openBlock(),e.createElementBlock("div",{class:"assSendoa-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:k[1]||(k[1]=e.withKeys((...B)=>e.unref(c)&&e.unref(c)(...B),["enter"])),tabindex:"-1"},[e.createElementVNode("div",tc,[e.createElementVNode("div",oc,[e.createVNode(e.unref(i))]),e.createElementVNode("div",nc,[e.createVNode(e.unref(m),{class:"flex-1"},{actionSlot:e.withCtx(({row:B})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E(),M=>(e.openBlock(),e.createElementBlock("button",{key:M.id,type:"button",class:"text-[rgb(var(--primary-6))] hover:text-[rgb(var(--primary-5))] mr-2",onClick:P=>_(M,B)},e.toDisplayString(M.label),9,rc))),128))]),_:1})])]),e.createVNode(At,{ref_key:"AssSendoaAddRef",ref:o,onSuccess:k[0]||(k[0]=()=>e.unref(b).commitProxy("query"))},null,512)],32))}}),ac=re(lc,[["__scopeId","data-v-53c27ad8"]]),Ut=({t})=>{const o=[{fieldName:"cNum",label:t("ggcxtc.cNum"),component:"Input",componentProps:{placeholder:t("ggcxtc.inputcNum"),allowClear:!0},colProps:{span:4}},{fieldName:"cTitle",label:t("ggcxtc.cTitle"),component:"Input",componentProps:{placeholder:t("ggcxtc.inputcTitle"),allowClear:!0},colProps:{span:4}},{fieldName:"nSfcommon",label:t("ggcxtc.nSfcommon"),component:"Select",componentProps:{placeholder:t("ggcxtc.selectnSfcommon"),allowClear:!0,options:rt},colProps:{span:4}}],r=[{type:"checkbox",width:40},{field:"cNum",title:t("ggcxtc.cNum")},{field:"cTitle",title:t("ggcxtc.cTitle")},{field:"nCbtype",title:t("ggcxtc.nCbtype"),formatter:({cellValue:n})=>Bt.find(s=>s.value===n)?.label||n},{field:"cCbclass",title:t("ggcxtc.cCbclass")},{field:"cCondition",title:t("ggcxtc.cCondition")},{field:"cWidth",title:t("ggcxtc.cWidth")},{field:"cHeight",title:t("ggcxtc.cHeight")},{field:"nRows",title:t("ggcxtc.nRows")},{field:"cSql",title:t("ggcxtc.cSql")},{field:"cTablecols",title:t("ggcxtc.cTablecols")},{field:"cCrenumb",title:t("ggcxtc.cCrenumb")},{field:"cCrename",title:t("ggcxtc.cCrename")},{field:"dDate",title:t("ggcxtc.dDate")},{field:"cOrder",title:t("ggcxtc.cOrder")},{field:"nSfcommon",title:t("ggcxtc.nSfcommon"),formatter:({cellValue:n})=>rt.find(s=>s.value===n)?.label||n}];return{searchFormSchema:o,tableColumns:r}},sc={resourceId:"Ggcxtc",nResourceid:11955,cModnumb:"GGCXTC"},ic=e.defineComponent({__name:"GgcxtcReview",props:{visible:{type:Boolean},cNum:{}},emits:["close"],setup(t,{emit:o}){const r=t,n=o,{t:l}=Y.useI18n(),[s,a]=z.useSunnyForm({layout:"vertical",size:"small",labelWidth:120,showDefaultActions:!1,scrollToFirstError:!0,schema:[{fieldName:"businessSearchValue",label:"业务搜索",component:"SunnyBusinessSearch",componentProps:()=>({cNum:r.cNum,placeholder:"请选择",modalProps:{multiple:!0,fieldNames:{label:"LASTNAME",value:"WORKCODE"}}}),colProps:{span:8}}]});e.watch(()=>r.visible,m=>{m&&a.resetForm()});const i=async()=>{const{valid:m}=await a.validate();return m?(n("close"),!0):!1},f=()=>{n("close")};return(m,b)=>(e.openBlock(),e.createBlock(e.unref(z.Modal),{"model-value":t.visible,title:"预览查询弹窗","on-before-ok":i,onClose:f,width:"800px"},{default:e.withCtx(()=>[e.createVNode(e.unref(s))]),_:1},8,["model-value"]))}}),cc={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},dc={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},uc={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},mc=["onClick"],pc=e.defineComponent({__name:"GgcxtcQuery",setup(t){const{t:o}=Y.useI18n(),{searchFormSchema:r,tableColumns:n}=Ut({t:o}),l=e.ref(!1),s=e.ref(""),a=async({page:k,formValues:B})=>{const M={pageNo:k.currentPage,pageSize:k.pageSize,assDialog:B},P=await I.post("/core/assDialog/selectForPage",M);return P.result&&P.result.records&&P.result.records.forEach(R=>{R.nCbtype!==void 0&&(R.nCbtype=String(R.nCbtype)),R.nSfcommon!==void 0&&(R.nSfcommon=String(R.nSfcommon))}),P},i={async toolbarButtonClick(k){const B=[...k.$grid.getCheckboxRecords()];switch(k.button.code){case"ggcxtc/add":S.Message.info("新增功能开发中");break;case"ggcxtc/edit":if(B.length!==1){S.Message.warning(o("common.selectOne"));return}S.Message.info("修改功能开发中");break;case"ggcxtc/review":if(B.length!==1){S.Message.warning(o("common.selectOne"));return}s.value=B[0].cNum,l.value=!0;break;case"ggcxtc/del":if(B.length===0){S.Message.warning(o("ggcxtc.selectDeleteRecords"));return}S.Modal.confirm({title:o("ggcxtc.confirmDelete"),content:o("ggcxtc.confirmDeleteMultiple",{count:B.length}),onBeforeOk:async()=>{const M=B.map(R=>R.id),P=await I.post("/core/assDialog/delete",{idList:M});return P.code===200?(S.Message.success(P.message),k.$grid.commitProxy("query",{}),!0):(S.Message.error(P.message),!1)}});break}}},{QueryForm:f,formApi:m,Grid:b,gridApi:p,submitting:c,handleGlobalEnter:d,searchPlanList:u,currentSearchPlan:h,resourceId:g,nResourceid:y,resourceButtons:x,handleSearchPlanSearch:v,handleDefaultPlanLoaded:E}=ce({searchFormSchema:r,tableColumns:n,resourceConfig:sc,queryFunction:a,gridEvents:i}),_=k=>x.value.filter(B=>B.cSubArea==="columnTable"),L=async(k,B)=>{const{handle:M}=k;switch(M){case"ggcxtc/add":S.Message.info("新增功能开发中");break;case"ggcxtc/edit":S.Message.info("修改功能开发中");break;case"ggcxtc/review":s.value=B.cNum,l.value=!0;break;case"ggcxtc/del":S.Modal.confirm({title:o("ggcxtc.confirmDelete"),content:o("ggcxtc.confirmDeleteSingle",{cTitle:B.cTitle}),onOk:async()=>{try{const P=await I.post("/core/assDialog/delete",{id:B.id});P.code===200?(S.Message.success(P.message),p.value?.refresh()):S.Message.error(P.message)}catch(P){console.error("删除失败:",P),S.Message.error(o("ggcxtc.deleteFailed"))}}});break}};return(k,B)=>(e.openBlock(),e.createElementBlock("div",{class:"ggcxtc-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:B[1]||(B[1]=e.withKeys((...M)=>e.unref(d)&&e.unref(d)(...M),["enter"])),tabindex:"-1"},[e.createElementVNode("div",cc,[e.createElementVNode("div",dc,[e.createVNode(e.unref(f))]),e.createElementVNode("div",uc,[e.createVNode(e.unref(b),{class:"flex-1"},{actionSlot:e.withCtx(({row:M})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_(),P=>(e.openBlock(),e.createElementBlock("button",{key:P.id,type:"button",class:"text-[rgb(var(--primary-6))] hover:text-[rgb(var(--primary-5))] mr-2",onClick:R=>L(P,M)},e.toDisplayString(P.label),9,mc))),128))]),_:1})])]),e.createVNode(ic,{visible:l.value,"c-num":s.value,onClose:B[0]||(B[0]=M=>l.value=!1)},null,8,["visible","c-num"])],32))}}),fc=re(pc,[["__scopeId","data-v-1c9496cc"]]);function Be({t}){const o=[{fieldName:"cExresnum",label:t("otherPermissions.cExresnum"),component:"Input",componentProps:{placeholder:t("otherPermissions.inputcExresnum"),allowClear:!0},colProps:{span:6}},{fieldName:"cExresname",label:t("otherPermissions.cExresname"),component:"Input",componentProps:{placeholder:t("otherPermissions.inputcExresname"),allowClear:!0},colProps:{span:6}}],r=[{fieldName:"cExresnum",label:t("otherPermissions.cExresnum"),component:"Input",rules:"required",componentProps:{placeholder:t("otherPermissions.inputcExresnum"),allowClear:!0}},{fieldName:"cExresname",label:t("otherPermissions.cExresname"),component:"Input",rules:"required",componentProps:{placeholder:t("otherPermissions.inputcExresname"),allowClear:!0}},{fieldName:"cOrg",label:t("otherPermissions.cOrg"),component:"Select",componentProps:{placeholder:t("otherPermissions.inputcOrg"),allowClear:!0},permissionOptions:{code:"COMPANY",fieldMapping:{label:"cExresname",value:"cExresnum"}}},{fieldName:"nOrder",label:t("otherPermissions.nOrder"),component:"InputNumber",componentProps:{placeholder:t("otherPermissions.inputnOrder"),min:1,precision:0}}],n=[{type:"checkbox",width:50},{field:"cExresnum",title:t("otherPermissions.cExresnum"),minWidth:140,treeNode:!0,params:{nBill:3,cEntityTable:"AUTH_EXRES"}},{field:"cExresname",title:t("otherPermissions.cExresname"),minWidth:180},{field:"cOrg",title:t("otherPermissions.cOrg"),minWidth:150},{field:"dCredate",title:t("otherPermissions.dCredate"),width:180},{field:"cCreateName",title:t("otherPermissions.cCreateName"),width:120},{field:"nOrder",title:t("otherPermissions.nOrder"),width:80}];return{searchFormSchema:o,addFormSchema:r,tableColumns:n}}const hc={resourceId:"otherPermissions",nResourceid:67,cModnumb:"db7a8e32-f20b-444b-af0f-aed54ec99532"};class gc{cache=new Map;loadingPromises=new Map;async loadOptions(o,r,n=!1){const l=z.DEFAULT_FORM_COMMON_CONFIG.selectOptionsAdapter;if(!l?.loadOptions)return console.warn("[SelectOptionsManager] Adapter not configured"),{};if(!o||o.length===0)return{};const s=n?o:o.filter(f=>!this.cache.has(String(f)));if(s.length===0){const f={};return o.forEach(m=>{f[String(m)]=this.cache.get(String(m))||[]}),f}const a=s.map(String).sort((f,m)=>f.localeCompare(m)).join(",");let i=this.loadingPromises.get(a);i||(i=l.loadOptions(s,r),this.loadingPromises.set(a,i));try{const f=await i;f&&typeof f=="object"&&Object.keys(f).forEach(b=>{this.cache.set(b,f[b])});const m={};return o.forEach(b=>{m[String(b)]=this.cache.get(String(b))||[]}),m}finally{this.loadingPromises.delete(a)}}getOptions(o){return this.cache.get(String(o))||[]}clearCache(o){o?this.cache.delete(String(o)):this.cache.clear()}hasCache(o){return this.cache.has(String(o))}getCacheSize(){return this.cache.size}}const Se=new gc;function ve(t){const{numbList:o,fieldMapping:r,immediate:n=!0,forceReload:l=!1}=t,s=e.ref({}),a=e.ref(!1),i=async()=>{if(!(!o||o.length===0)){a.value=!0;try{const p=await Se.loadOptions(o,r,l);s.value=p}catch(p){console.error("[useSelectOptions] Failed to load options:",p)}finally{a.value=!1}}},f=p=>s.value[String(p)]||[],m=async p=>{Se.clearCache(p);const c=await Se.loadOptions([p],r,!0);s.value={...s.value,...c}},b=p=>{if(Se.clearCache(p),p){const c={...s.value};delete c[String(p)],s.value=c}else s.value={}};return n&&o&&o.length>0&&(e.getCurrentInstance()?e.onMounted(()=>{i()}):i()),{optionsMap:s,loading:a,load:i,getOptions:f,reload:m,clearCache:b}}function ye(t,o=!0){const r=e.computed(()=>{const f=typeof t=="object"&&"value"in t?t.value:t,m=[];return f.forEach(b=>{b.selectOptions?.dictCode&&m.push({fieldName:b.fieldName||"",...b.selectOptions})}),m}),n=e.computed(()=>{const f=new Set;return r.value.forEach(m=>{f.add(m.dictCode)}),Array.from(f)}),{optionsMap:l,loading:s,load:a}=ve({numbList:n.value,fieldMapping:r.value[0]?.fieldMapping,immediate:!1}),i=e.computed(()=>(typeof t=="object"&&"value"in t?t.value:t).map(m=>{if(m.selectOptions?.dictCode){const b=m.componentProps,p=String(m.selectOptions.dictCode);return{...m,componentProps:c=>({...typeof b=="function"?b(c):b,options:l.value[p]||[]})}}return m}));return o&&n.value.length>0&&e.onMounted(async()=>{await a()}),{enhancedSchema:i,optionsMap:l,loading:s,load:a}}async function bc(t,o){if(!t||t.length===0)return;const{load:r}=ve({numbList:t,fieldMapping:o,immediate:!1});await r()}function vc(t){const o=new Set;return t.forEach(r=>{r.selectOptions?.dictCode&&o.add(r.selectOptions.dictCode)}),Array.from(o)}class yc{cache=new Map;loadingPromises=new Map;async loadOptions(o,r,n=!1){const l=z.DEFAULT_FORM_COMMON_CONFIG.permissionOptionsAdapter;if(!l?.loadOptions)return console.warn("[PermissionOptionsManager] Adapter not configured"),{};if(!o||o.length===0)return{};const s=n?o:o.filter(f=>!this.cache.has(String(f)));if(s.length===0){const f={};return o.forEach(m=>{f[String(m)]=this.cache.get(String(m))||[]}),f}const a=s.map(String).sort((f,m)=>f.localeCompare(m)).join(",");let i=this.loadingPromises.get(a);i||(i=l.loadOptions(s,r),this.loadingPromises.set(a,i));try{const f=await i;f&&typeof f=="object"&&Object.keys(f).forEach(b=>{this.cache.set(b,f[b])});const m={};return o.forEach(b=>{m[String(b)]=this.cache.get(String(b))||[]}),m}finally{this.loadingPromises.delete(a)}}getOptions(o){return this.cache.get(String(o))||[]}clearCache(o){o?this.cache.delete(String(o)):this.cache.clear()}hasCache(o){return this.cache.has(String(o))}getCacheSize(){return this.cache.size}}const Ne=new yc;function qt(t){const{numbList:o,fieldMapping:r,immediate:n=!0,forceReload:l=!1}=t,s=e.ref({}),a=e.ref(!1),i=async()=>{if(!(!o||o.length===0)){a.value=!0;try{const p=await Ne.loadOptions(o,r,l);s.value=p}catch(p){console.error("[usePermissionOptions] Failed to load options:",p)}finally{a.value=!1}}},f=p=>s.value[String(p)]||[],m=async p=>{Ne.clearCache(p);const c=await Ne.loadOptions([p],r,!0);s.value={...s.value,...c}},b=p=>{if(Ne.clearCache(p),p){const c={...s.value};delete c[String(p)],s.value=c}else s.value={}};return n&&o&&o.length>0&&(e.getCurrentInstance()?e.onMounted(()=>{i()}):i()),{optionsMap:s,loading:a,load:i,getOptions:f,reload:m,clearCache:b}}function Ce(t,o={}){const{immediate:r=!0,onAutoSelect:n}=o,l=e.computed(()=>{const p=e.isRef(t)?t.value:t,c=[];return p.forEach(d=>{d.permissionOptions?.code&&c.push({fieldName:d.fieldName||"",...d.permissionOptions})}),console.log("[useSchemaPermissionLoader] collectDeclarations:",c),c}),s=e.computed(()=>{const p=new Set;return l.value.forEach(c=>{p.add(c.code)}),Array.from(p)}),{optionsMap:a,loading:i,load:f}=qt({numbList:s.value,fieldMapping:l.value[0]?.fieldMapping,immediate:!1}),m=e.computed(()=>{const p=e.isRef(t)?t.value:t;return console.log("[useSchemaPermissionLoader] schemaValue:",p),console.log("[useSchemaPermissionLoader] optionsMap.value:",a.value),p.map(c=>{if(c.permissionOptions?.code){const d=c.componentProps,u=String(c.permissionOptions.code);return{...c,componentProps:h=>({...typeof d=="function"?d(h):d,options:a.value[u]||[]})}}return c})}),b=e.computed(()=>{const p={};return l.value.forEach(c=>{if(c.autoSelectFirst){const d=String(c.code),u=a.value[d];u&&u.length>0&&(p[c.fieldName]=u[0].value)}}),p});return console.log("[useSchemaPermissionLoader] immediate:",r,"codes.value.length:",s.value.length),r&&s.value.length>0&&e.onMounted(async()=>{console.log("[useSchemaPermissionLoader] onMounted triggered, calling load()"),await f();const p=b.value;Object.keys(p).length>0&&n&&await n(p)}),{enhancedSchema:m,optionsMap:a,loading:i,load:f,autoSelectDefaults:b}}function Cc(t){const o=new Set;return t.forEach(r=>{r.permissionOptions?.code&&o.add(r.permissionOptions.code)}),Array.from(o)}async function Ve(t,o){const r=Object.keys(t);if(r.length===0)return;const n=await o.getValues();for(const l of r){const s=n[l];(s==null||s==="")&&await o.setFieldValue(l,t[l])}}const Kt={layout:"vertical",size:"mini",labelWidth:"auto",gridProps:{xGap:8,yGap:0},commonConfig:{colProps:{span:24,lg:8,xl:6}},showDefaultActions:!1,scrollToFirstError:!0};function xe({schema:t=[],objectToValueFields:o,handleValuesChange:r,...n}={}){const{enhancedSchema:l}=ye(t);let s;const{enhancedSchema:a}=Ce(l,{onAutoSelect:f=>Ve(f,s)}),i=z.useSunnyForm({...Kt,schema:a.value,...o?{objectToValueFields:o}:{},...r?{handleValuesChange:r}:{},...n});return s=i[1],i}const Wt=e.defineComponent({name:"OtherPermissionsAdd",__name:"OtherPermissionsAdd",props:{visible:{type:Boolean,default:!1},parentId:{default:"0"},parentName:{default:""},cExresnum:{default:""},id:{default:""}},emits:["update:visible","success"],setup(t,{emit:o}){const{t:r}=Y.useI18n(),{addFormSchema:n}=Be({t:r}),l=t,s=o;e.ref(!1);const[a,i]=xe({schema:n});e.watch(()=>l.visible,p=>{p&&(i.resetForm(),l.cExresnum&&i.setValues({cExresparnum:l.cExresnum,id:l.id}))});const f=e.computed(()=>l.parentId&&l.parentId!=="0"?`${r("otherPermissions.addTitle")} - ${l.parentName}`:r("otherPermissions.addTitle"));async function m(){try{const{valid:p}=await i.validate();if(!p)return!1;const d={authExres:{...await i.getValues(),cExresparnum:l.cExresnum||"",id:l.id||""}},u=await I.post("/core/authExres/add",d);return S.Message.success(u.message||r("otherPermissions.addSuccess")),s("success"),!0}catch(p){return console.error("新增失败:",p),!1}}function b(){s("update:visible",!1)}return(p,c)=>(e.openBlock(),e.createBlock(e.unref(z.Modal),{"model-value":l.visible,title:f.value,width:700,"on-before-ok":m,"onUpdate:modelValue":c[0]||(c[0]=d=>s("update:visible",d)),onClose:b},{default:e.withCtx(()=>[e.createVNode(e.unref(a))]),_:1},8,["model-value","title"]))}}),Gt=e.defineComponent({name:"OtherPermissionsUpdate",__name:"OtherPermissionsUpdate",props:{visible:{type:Boolean,default:!1},row:{default:null}},emits:["update:visible","success"],setup(t,{emit:o}){const{t:r}=Y.useI18n(),{addFormSchema:n}=Be({t:r}),l=t,s=o;e.ref(!1);const[a,i]=xe({schema:n});e.watch(()=>l.visible,p=>{p&&l.row&&(i.resetForm(),i.setValues({...l.row}),i.updateSchema([{fieldName:"cExresnum",componentProps:{disabled:!0}}]))});const f=e.computed(()=>r("otherPermissions.updateTitle"));async function m(){try{const{valid:p}=await i.validate();if(!p)return!1;const d={authExres:{...await i.getValues(),id:l.row.id,cExresparnum:l.row.cExresparnum||""}},u=await I.post("/core/authExres/edit",d);return S.Message.success(u.message||r("otherPermissions.updateSuccess")),s("success"),!0}catch(p){return console.error("修改失败:",p),!1}}function b(){s("update:visible",!1)}return(p,c)=>(e.openBlock(),e.createBlock(e.unref(z.Modal),{"model-value":l.visible,title:f.value,width:700,"on-before-ok":m,"onUpdate:modelValue":c[0]||(c[0]=d=>s("update:visible",d)),onClose:b},{default:e.withCtx(()=>[e.createVNode(e.unref(a))]),_:1},8,["model-value","title"]))}}),xc={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},kc={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},wc={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},Sc=e.defineComponent({__name:"OtherPermissionsQuery",setup(t){const{t:o}=Y.useI18n(),{searchFormSchema:r,tableColumns:n}=Be({t:o}),l=async({page:T,formValues:O})=>{const j={pageNo:T.currentPage,pageSize:T.pageSize,authExres:{...O,nType:0}},q=await I.post("/core/authExres/selectForPage",j);return q.result?.records&&(q.result.records=q.result.records.map(G=>({...G,hasChildren:!0}))),q};async function s({row:T}){await f.getValues();const O={authExres:{cExresparnum:T.cExresnum}};try{return((await I.post("/core/authExres/queryChildList",O)).result?.authExresList||[]).map(G=>({...G}))}catch(j){return console.error("加载子节点失败:",j),[]}}const a={lazy:!0,rowField:"id",hasChild:"hasChildren",expandAll:!1,loadMethod:s},{QueryForm:i,formApi:f,Grid:m,gridApi:b,submitting:p,handleGlobalEnter:c,searchPlanList:d,currentSearchPlan:u,resourceId:h,nResourceid:g,handleSearchPlanSearch:y,handleDefaultPlanLoaded:x,businessResumeState:v}=ce({searchFormSchema:r,tableColumns:n,resourceConfig:hc,queryFunction:l,gridEvents:{toolbarButtonClick:({code:T})=>{T==="otherPermissions/add"?E():T==="otherPermissions/update"?_():T==="otherPermissions/enable"?L("10001"):T==="otherPermissions/disable"?L("10002"):T==="otherPermissions/del"&&k()}},treeConfig:a,lazy:!0});function E(){const T=b.getSelection();if(T.length>1){S.Message.warning(o("common.selectOne"));return}T.length===1?(C.value=T[0].cExresnum,w.value=T[0].id,P.value=T[0].id,R.value=T[0].cExresname):(C.value="",w.value="",P.value="0",R.value=""),M.value=!0}function _(){const T=b.getSelection();if(T.length!==1){S.Message.warning("请选择一条数据进行修改");return}const O=T[0];N.value=O,V.value=!0}async function L(T){const O=b.getSelection();if(O.length===0){S.Message.warning("请选择要操作的数据");return}if(O.length>1){S.Message.warning(o("common.selectOne"));return}const j=O[0];try{const q=await I.post("/core/authExres/sign",{authExres:{id:j.id,cSign:T}});S.Message.success(q.message||o("otherPermissions.signSuccess")),b.commitProxy("query")}catch(q){console.error("操作失败:",q)}}function k(){const T=b.getSelection();if(T.length===0){S.Message.warning(o("common.selectData"));return}if(T.length>1){S.Message.warning(o("common.selectOne"));return}const O=T[0];S.Modal.confirm({title:o("common.confirm"),content:o("otherPermissions.delConfirm"),okText:o("common.confirm"),cancelText:o("common.cancel"),onOk:async()=>{try{const j=await I.post("/core/authExres/delete",{authExres:{id:O.id}});S.Message.success(j.message||o("otherPermissions.delSuccess")),b.commitProxy("query")}catch(j){console.error("删除失败:",j)}}})}function B(){b.commitProxy("query")}const M=e.ref(!1),P=e.ref("0"),R=e.ref(""),C=e.ref(""),w=e.ref(""),V=e.ref(!1),N=e.ref(null);return(T,O)=>(e.openBlock(),e.createElementBlock("div",{class:"other-permissions-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:O[2]||(O[2]=e.withKeys((...j)=>e.unref(c)&&e.unref(c)(...j),["enter"])),tabindex:"-1"},[e.createElementVNode("div",xc,[e.createElementVNode("div",kc,[e.createVNode(e.unref(i))]),e.createElementVNode("div",wc,[e.createVNode(e.unref(m),{class:"flex-1"})])]),e.createVNode(Wt,{visible:M.value,"onUpdate:visible":O[0]||(O[0]=j=>M.value=j),"parent-id":P.value,"parent-name":R.value,"c-exresnum":C.value,id:w.value,onSuccess:B},null,8,["visible","parent-id","parent-name","c-exresnum","id"]),e.createVNode(Gt,{visible:V.value,"onUpdate:visible":O[1]||(O[1]=j=>V.value=j),row:N.value,onSuccess:B},null,8,["visible","row"]),e.createVNode(e.unref(ke),{state:e.unref(v)},null,8,["state"])],32))}}),Nc=re(Sc,[["__scopeId","data-v-96f076fe"]]);function Ht(){return I.post("/core/assSysSetting/findAllSettings",{})}function Jt(t){return I.post("/core/assSysSetting/saveAllSettings",{assSysSettingList:t})}const _c={class:"h-full w-full overflow-auto bg-[var(--color-fill-2)]"},Vc={class:"flex flex-col h-full w-full"},Ec={class:"flex-1 overflow-auto"},Pc={class:"space-y-4"},Mc={class:"grid grid-cols-1 md:grid-cols-2 gap-x-8 gap-y-4"},Tc={class:"flex items-center gap-3"},Bc={class:"shrink-0 w-20 text-sm text-[var(--color-text-2)]"},Rc={class:"flex items-start gap-3"},$c={class:"shrink-0 w-20 pt-1.5 text-sm text-[var(--color-text-2)]"},Lc={class:"flex-1"},Ic={class:"flex gap-2"},Dc={key:0,class:"flex flex-wrap gap-1.5 mt-2"},Oc={class:"grid grid-cols-1 lg:grid-cols-2 gap-4 items-start"},jc={class:"flex items-center justify-between"},zc={class:"text-sm text-[var(--color-text-1)]"},Fc={class:"text-xs text-[var(--color-text-4)] mt-0.5"},Ac={key:0,class:"mt-4 pt-4 border-t border-[var(--color-border-1)] space-y-3"},Uc={class:"flex items-center gap-3"},qc={class:"shrink-0 w-20 text-sm text-[var(--color-text-2)]"},Kc={class:"flex items-center gap-3"},Wc={class:"shrink-0 w-20 text-sm text-[var(--color-text-2)]"},Gc={class:"flex items-center justify-between"},Hc={class:"text-sm text-[var(--color-text-1)]"},Jc={class:"text-xs text-[var(--color-text-4)] mt-0.5"},Qc={class:"shrink-0 p-2 bg-[var(--color-bg-2)] border-t border-[var(--color-border-1)]"},Xc={class:"flex justify-end"},Yc=e.defineComponent({__name:"SystemSetting",setup(t){const{t:o}=ne.useI18n(),r=e.ref(!1),n=e.ref(!1),l=e.reactive({initialPassword:"",weakPasswords:[],showSubMenuIcon:!0,showAgent:!1,agentUrl:"",agentToken:""}),s=e.ref([]),a=e.ref(""),i=e.computed(()=>l.showAgent),f=()=>{const c=a.value.trim();if(!c){S.Message.warning(o("common.systemSetting.enterWeakPassword"));return}if(s.value.some(d=>d.password===c)){S.Message.warning(o("common.systemSetting.weakPasswordExists"));return}s.value.push({id:Date.now().toString(),password:c}),l.weakPasswords=s.value.map(d=>d.password),a.value=""},m=c=>{s.value=s.value.filter(d=>d.id!==c),l.weakPasswords=s.value.map(d=>d.password)},b=async()=>{r.value=!0;try{((await Ht()).result||[]).forEach(u=>{switch(u.cNum){case"InitPwd":l.initialPassword=u.cValue||"";break;case"PwdStrVal":try{const h=JSON.parse(u.cValue||"{}");h.list&&Array.isArray(h.list)&&(s.value=h.list.map((g,y)=>({id:String(y),password:g})),l.weakPasswords=h.list)}catch(h){console.error("Parse weak password config failed",h)}break;case"SubMenuIconShow":try{const h=JSON.parse(u.cValue||"{}");l.showSubMenuIcon=h.show===h.activeValue||h.show==="1"}catch(h){console.error("Parse menu icon config failed",h)}break;case"ShowAgent":try{const h=JSON.parse(u.cValue||"{}");l.showAgent=h.show===h.activeValue||h.show==="1",l.agentUrl=h.agentUrl||"",l.agentToken=h.token||""}catch(h){console.error("Parse agent config failed",h)}break}})}catch{S.Message.error(o("common.systemSetting.loadFailed"))}finally{r.value=!1}},p=async()=>{if(l.showAgent){if(!l.agentUrl.trim()){S.Message.warning(o("common.systemSetting.enterAgentUrl"));return}if(!l.agentToken.trim()){S.Message.warning(o("common.systemSetting.enterAgentToken"));return}}n.value=!0;try{const c=[{cNum:"InitPwd",cValue:l.initialPassword},{cNum:"PwdStrVal",cValue:JSON.stringify({enabled:!0,list:l.weakPasswords})},{cNum:"SubMenuIconShow",cValue:JSON.stringify({show:l.showSubMenuIcon?"1":"0",activeText:"显示",activeValue:"1",inactiveText:"不显示",inactiveValue:"0"})},{cNum:"ShowAgent",cValue:JSON.stringify({show:l.showAgent?"1":"0",activeText:"显示",activeValue:"1",inactiveText:"不显示",inactiveValue:"0",type:"dify",token:l.agentToken,agentUrl:l.agentUrl})}];await Jt(c),S.Message.success(o("common.systemSetting.saveSuccess"))}catch{S.Message.error(o("common.systemSetting.saveFailed"))}finally{n.value=!1}};return b(),(c,d)=>{const u=e.resolveComponent("a-input-password"),h=e.resolveComponent("a-input"),g=e.resolveComponent("a-button"),y=e.resolveComponent("a-tag"),x=e.resolveComponent("a-card"),v=e.resolveComponent("a-switch"),E=e.resolveComponent("a-spin");return e.openBlock(),e.createElementBlock("div",_c,[e.createVNode(E,{loading:r.value,class:"h-full w-full"},{default:e.withCtx(()=>[e.createElementVNode("div",Vc,[e.createElementVNode("div",Ec,[e.createElementVNode("div",Pc,[e.createVNode(x,{title:e.unref(o)("common.systemSetting.securitySetting"),bordered:!1},{extra:e.withCtx(()=>[e.createVNode(e.unref(Kn),{class:"text-[var(--color-text-4)]"})]),default:e.withCtx(()=>[e.createElementVNode("div",Mc,[e.createElementVNode("div",Tc,[e.createElementVNode("label",Bc,e.toDisplayString(e.unref(o)("common.systemSetting.initialPassword")),1),e.createVNode(u,{modelValue:l.initialPassword,"onUpdate:modelValue":d[0]||(d[0]=_=>l.initialPassword=_),placeholder:e.unref(o)("common.systemSetting.initialPasswordPlaceholder"),"allow-clear":"",class:"flex-1"},null,8,["modelValue","placeholder"])]),e.createElementVNode("div",Rc,[e.createElementVNode("label",$c,e.toDisplayString(e.unref(o)("common.systemSetting.weakPassword")),1),e.createElementVNode("div",Lc,[e.createElementVNode("div",Ic,[e.createVNode(h,{modelValue:a.value,"onUpdate:modelValue":d[1]||(d[1]=_=>a.value=_),placeholder:e.unref(o)("common.systemSetting.weakPasswordPlaceholder"),"allow-clear":"",size:"small",onPressEnter:f},null,8,["modelValue","placeholder"]),e.createVNode(g,{type:"primary",size:"small",onClick:f},{default:e.withCtx(()=>[e.createVNode(e.unref(xt))]),_:1})]),s.value.length>0?(e.openBlock(),e.createElementBlock("div",Dc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,_=>(e.openBlock(),e.createBlock(y,{key:_.id,closable:"",color:"orangered",size:"small",onClose:L=>m(_.id)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(_.password),1)]),_:2},1032,["onClose"]))),128))])):e.createCommentVNode("",!0)])])])]),_:1},8,["title"]),e.createElementVNode("div",Oc,[e.createVNode(x,{title:e.unref(o)("common.systemSetting.agentSetting"),bordered:!1},{extra:e.withCtx(()=>[e.createVNode(e.unref(Fn),{class:"text-[var(--color-text-4)]"})]),default:e.withCtx(()=>[e.createElementVNode("div",jc,[e.createElementVNode("div",null,[e.createElementVNode("div",zc,e.toDisplayString(e.unref(o)("common.systemSetting.enableAgent")),1),e.createElementVNode("div",Fc,e.toDisplayString(e.unref(o)("common.systemSetting.enableAgentDesc")),1)]),e.createVNode(v,{modelValue:l.showAgent,"onUpdate:modelValue":d[2]||(d[2]=_=>l.showAgent=_)},null,8,["modelValue"])]),e.createVNode(e.Transition,{name:"expand"},{default:e.withCtx(()=>[i.value?(e.openBlock(),e.createElementBlock("div",Ac,[e.createElementVNode("div",Uc,[e.createElementVNode("label",qc,e.toDisplayString(e.unref(o)("common.systemSetting.agentUrl")),1),e.createVNode(h,{modelValue:l.agentUrl,"onUpdate:modelValue":d[3]||(d[3]=_=>l.agentUrl=_),placeholder:e.unref(o)("common.systemSetting.agentUrlPlaceholder"),"allow-clear":"",class:"flex-1"},null,8,["modelValue","placeholder"])]),e.createElementVNode("div",Kc,[e.createElementVNode("label",Wc,e.toDisplayString(e.unref(o)("common.systemSetting.agentToken")),1),e.createVNode(u,{modelValue:l.agentToken,"onUpdate:modelValue":d[4]||(d[4]=_=>l.agentToken=_),placeholder:e.unref(o)("common.systemSetting.agentTokenPlaceholder"),"allow-clear":"",class:"flex-1"},null,8,["modelValue","placeholder"])])])):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["title"]),e.createVNode(x,{title:e.unref(o)("common.systemSetting.interfaceSetting"),bordered:!1},{extra:e.withCtx(()=>[e.createVNode(e.unref(Dn),{class:"text-[var(--color-text-4)]"})]),default:e.withCtx(()=>[e.createElementVNode("div",Gc,[e.createElementVNode("div",null,[e.createElementVNode("div",Hc,e.toDisplayString(e.unref(o)("common.systemSetting.subMenuIcon")),1),e.createElementVNode("div",Jc,e.toDisplayString(e.unref(o)("common.systemSetting.subMenuIconDesc")),1)]),e.createVNode(v,{modelValue:l.showSubMenuIcon,"onUpdate:modelValue":d[5]||(d[5]=_=>l.showSubMenuIcon=_)},null,8,["modelValue"])])]),_:1},8,["title"])])])]),e.createElementVNode("div",Qc,[e.createElementVNode("div",Xc,[e.createVNode(g,{type:"primary",loading:n.value,onClick:p},{icon:e.withCtx(()=>[e.createVNode(e.unref(pn))]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(e.unref(o)("common.systemSetting.save")),1)]),_:1},8,["loading"])])])])]),_:1},8,["loading"])])}}}),Zc=[{label:"启用",value:"10001"},{label:"禁用",value:"10002"}],ed=[{fieldName:"cXuhao",label:"字典编号",component:"Input",componentProps:{placeholder:"请输入字典编号",allowClear:!0},colProps:{span:6}},{fieldName:"cName",label:"字典名称",component:"Input",componentProps:{placeholder:"请输入字典名称",allowClear:!0},colProps:{span:6}},{fieldName:"cSign",label:"是否启用",component:"Select",selectOptions:{dictCode:"SFQY",fieldMapping:{label:"cName",value:"cXuhao"}},componentProps:{placeholder:"请选择是否启用",allowClear:!0},colProps:{span:6}}],Qt=[{fieldName:"parentName",label:"父级字典",component:"Input",componentProps:{disabled:!0,placeholder:"无"}},{fieldName:"cXuhao",label:"字典编号",component:"Input",rules:"required",componentProps:{placeholder:"请输入字典编号",allowClear:!0}},{fieldName:"cName",label:"字典名称",component:"Input",rules:"required",componentProps:{placeholder:"请输入字典名称",allowClear:!0}},{fieldName:"cSign",label:"是否启用",component:"Select",rules:"required",selectOptions:{dictCode:"SFQY"},componentProps:{placeholder:"请选择是否启用"}},{fieldName:"nOrder",label:"排序",component:"InputNumber",componentProps:{placeholder:"请输入排序",min:0,precision:0}}],td=[{type:"checkbox",width:50},{field:"id",title:"数据字典ID",minWidth:140,treeNode:!0,params:{nBill:3,cEntityTable:"AUTH_DICT"}},{field:"cXuhao",title:"字典编号",minWidth:140},{field:"cName",title:"字典名称",minWidth:180},{field:"cSign",title:"是否启用",width:100,formatter:({cellValue:t})=>Zc.find(r=>r.value===t)?.label||t},{field:"cCreateName",title:"创建人",width:120},{field:"dCreate",title:"创建时间",width:180},{field:"nOrder",title:"排序",width:80}],Xt=[{type:"checkbox",width:50,align:"center"},{field:"key",title:"属性键",minWidth:150,...z.EditRender.SelectRender,params:{placeholder:"请选择属性键",allowClear:!0,options:[]},selectOptions:{dictCode:"DICTATTR",fieldMapping:{label:"cName",value:"cXuhao"}},formatter:({cellValue:t,column:o})=>(o.params?.options||[]).find(l=>l.value===t)?.label||t},{field:"value",title:"属性值",minWidth:200,...z.EditRender.InputRender,params:{placeholder:"请输入属性值",allowClear:!0}}],od=[{field:"cXuhao",title:"子级数据字典编号",minWidth:200,...z.EditRender.InputRender,params:{placeholder:"请输入子级数据字典编号",allowClear:!0,disabled:!0}},{field:"cName",title:"子级数据字典名称",minWidth:200,...z.EditRender.InputRender,params:{placeholder:"请输入子级数据字典名称",allowClear:!0}},{field:"nOrder",title:"子级数据字典排序",minWidth:150,...z.EditRender.InputRender,params:{placeholder:"请输入排序",allowClear:!0}}],Yt={key:[{required:!0,message:"请输入属性键"}]},Zt=[{code:"insert",name:"添加属性"},{code:"remove",name:"删除"}],yt=[{title:"额外属性",type:"grid",gridConfig:{columns:Xt,editRules:Yt,toolbarButtons:Zt}},{title:"子级数据字典",type:"grid",gridConfig:{columns:od,editRules:{},toolbarButtons:[]}}],nd={resourceId:"dataDictionary",nResourceid:62,cModnumb:"40577f0e-1c19-4fa6-bb88-d247fff5e32a"};function dt({formSchema:t=[],tableColumns:o=[],tableEditRules:r={},tableToolbarButtons:n=[],objectToValueFields:l,aggregateConfig:s,gridEvents:a}={}){const{enhancedSchema:i}=ye(t);let f;const{enhancedSchema:m}=Ce(i,{onAutoSelect:_=>Ve(_,f)}),p=(()=>{const _=new Set;return o.forEach(L=>{L.selectOptions?.dictCode&&_.add(L.selectOptions.dictCode)}),Array.from(_)})(),{optionsMap:c,load:d}=ve({numbList:p,immediate:!1});p.length>0&&d();const[u,h]=z.useSunnyForm({layout:"horizontal",size:"mini",labelWidth:100,gridProps:{xGap:0,yGap:0},showDefaultActions:!1,scrollToFirstError:!0,schema:m.value,...l?{objectToValueFields:l}:{}});f=h;const g=_=>_.map(L=>{if(L.selectOptions?.dictCode){const k=String(L.selectOptions.dictCode),B=c.value[k]||[];return{...L,params:{...L.params,options:B}}}return L}),y=e.reactive({id:"meta-grid",columns:g(o),data:[],size:"mini",editRules:r,height:"auto",clipConfig:z.createEditableClipConfig(),toolbarConfig:{enabled:!0,zoom:!0,custom:!0,buttons:n},zoomConfig:{enabled:!0},columnConfig:{resizable:!0},customConfig:{storage:!0,mode:"popup",showSortPutButton:!0,visibleMethod:_=>!(_.column.type==="checkbox"||_.column.type==="seq")},...s&&{aggregateConfig:s}});e.watch(()=>c.value,()=>{y.columns=g(o)},{deep:!0});const[x,v]=z.useSunnyEditGrid({gridOptions:y,gridEvents:a}),E=v.reloadData.bind(v);return v.reloadData=_=>(y.data=_,E(_)),[u,h,x,v]}const rd=e.defineComponent({name:"DataDictionaryAdd",__name:"DataDictionaryAdd",props:{visible:{type:Boolean,default:!1},parentId:{default:"0"},parentName:{default:""}},emits:["update:visible","success"],setup(t,{emit:o}){const r=t,n=o;e.ref(!1);const[l,s,a,i]=dt({formSchema:Qt,tableColumns:Xt,tableEditRules:Yt,tableToolbarButtons:Zt});e.watch(()=>r.visible,async p=>{p&&(await e.nextTick(),s.resetForm(),s.setValues({parentName:r.parentName||"无"}),i.reloadData([]))});const f=e.computed(()=>r.parentId&&r.parentId!=="0"?`新增子级字典 - ${r.parentName}`:"新增根级字典");async function m(){try{const{valid:p}=await s.validate();if(!p||await i.validate())return!1;const d=await i.getFullData(),u=d.filter(E=>E.key).map(E=>E.key),h=new Set(u);if(u.length!==h.size)return S.Message.warning("属性键不能重复"),!1;const g=await s.getValues(),y={};d.forEach(E=>{E.key&&(y[E.key]=E.value||"")});const x={authDict:{cXuhao:g.cXuhao,cName:g.cName,cSign:g.cSign,nParent:r.parentId||"0",nOrder:g.nOrder||0,cMeta:JSON.stringify(y)}},v=await I.post("/core/authDict/add",x);return S.Message.success(v.message),n("success"),!0}catch(p){return console.error("新增失败:",p),!1}}function b(){n("update:visible",!1)}return(p,c)=>(e.openBlock(),e.createBlock(e.unref(z.Modal),{"model-value":r.visible,title:f.value,width:700,"on-before-ok":m,"onUpdate:modelValue":c[0]||(c[0]=d=>n("update:visible",d)),onClose:b},{default:e.withCtx(()=>[e.createVNode(e.unref(l)),e.createVNode(e.unref(a),{id:"metaGrid",border:"","max-height":"300"})]),_:1},8,["model-value","title"]))}});function ut({formSchema:t=[],tabsConfig:o=[],objectToValueFields:r}={}){const{enhancedSchema:n}=ye(t);let l;const{enhancedSchema:s}=Ce(n,{onAutoSelect:u=>Ve(u,l)}),i=(()=>{const u=new Set;return o.forEach(g=>{g.type==="grid"&&g.gridConfig&&g.gridConfig.columns.forEach(y=>{y.selectOptions?.dictCode&&u.add(y.selectOptions.dictCode)})}),Array.from(u)})(),{optionsMap:f,load:m}=ve({numbList:i,immediate:!1});i.length>0&&m();const[b,p]=z.useSunnyForm({layout:"horizontal",size:"small",labelWidth:100,gridProps:{xGap:0,yGap:0},showDefaultActions:!1,scrollToFirstError:!0,schema:s.value,...r?{objectToValueFields:r}:{}});l=p;const c=e.shallowRef([]),d=e.ref([]);return o.forEach((u,h)=>{if(u.type==="grid"&&u.gridConfig){const g=e.reactive({id:`grid-${h}`,columns:u.gridConfig.columns,data:[],editRules:u.gridConfig.editRules,height:"auto",clipConfig:z.createEditableClipConfig(),toolbarConfig:{enabled:u.gridConfig.toolbarButtons&&u.gridConfig.toolbarButtons.length>0,zoom:!0,custom:!0,buttons:u.gridConfig.toolbarButtons||[]},zoomConfig:{enabled:!0},customConfig:{storage:!0,mode:"popup",visibleMethod:E=>!(E.column.type==="checkbox"||E.column.type==="seq")},...u.gridConfig.aggregateConfig&&{aggregateConfig:u.gridConfig.aggregateConfig}});e.watch(()=>f.value,E=>{g.columns=(g.columns||[]).map(_=>{if(_.selectOptions?.dictCode){const L=String(_.selectOptions.dictCode),k=E[L]||[];return{..._,params:{..._.params,options:k}}}return _})},{deep:!0});const[y,x]=z.useSunnyEditGrid({gridOptions:g}),v={...x,reloadData:E=>(g.data=E,x.reloadData(E)),validate:()=>x.validate(),getFullData:()=>x.getFullData()};c.value.push(e.markRaw(y)),d.value.push(v)}}),[b,p,c,d]}const ld=e.defineComponent({name:"DataDictionaryUpdate",__name:"DataDictionaryUpdate",props:{visible:{type:Boolean,default:!1},row:{default:void 0}},emits:["update:visible","success"],setup(t,{emit:o}){const{TabPane:r}=S.Tabs,n=t,l=o;e.ref(!1);const s=e.ref(0),[a,i,f,m]=ut({formSchema:Qt,tabsConfig:yt});e.watch(()=>n.visible,async d=>{if(d&&n.row){await e.nextTick(),i.resetForm(),m.value[0].reloadData([]);try{const h=(await I.post("/core/authDict/editInit",{authDict:{id:n.row.id}})).result;if(h){if(i.setValues({cXuhao:h.authDict.cXuhao,cName:h.authDict.cName,cSign:h.authDict.cSign,nOrder:h.authDict.nOrder}),h.authDict.cMeta)try{const g=JSON.parse(h.authDict.cMeta),y=Object.keys(g).map(x=>({key:x,value:g[x]}));m.value[0].reloadData(y)}catch(g){console.error("解析额外属性失败:",g)}h.childList&&h.childList.length>0?m.value[1].reloadData(h.childList):m.value[1].reloadData([])}}catch(u){console.error("加载数据失败:",u),S.Message.error("加载数据失败")}}});const b=e.computed(()=>"修改字典");async function p(){try{const{valid:d}=await i.validate();if(!d||await m.value[0].validate())return!1;const h=await m.value[0].getFullData(),g=h.filter(k=>k.key).map(k=>k.key),y=new Set(g);if(g.length!==y.size)return S.Message.warning("属性键不能重复"),!1;const x=await i.getValues(),v={};h.forEach(k=>{k.key&&(v[k.key]=k.value||"")});const E=await m.value[1].getFullData(),_={authDict:{id:n.row?.id,cXuhao:x.cXuhao,cName:x.cName,cSign:x.cSign,nOrder:x.nOrder||0,cMeta:JSON.stringify(v),nParent:n.row?.nParent||0,nType:n.row?.nType||1},authDictList:E},L=await I.post("/core/authDict/edit",_);return S.Message.success(L.message),l("success"),!0}catch(d){return console.error("修改失败:",d),!1}}function c(){l("update:visible",!1)}return(d,u)=>(e.openBlock(),e.createBlock(e.unref(z.Modal),{"model-value":n.visible,title:b.value,width:700,"on-before-ok":p,"onUpdate:modelValue":u[1]||(u[1]=h=>l("update:visible",h)),onClose:c},{default:e.withCtx(()=>[e.createVNode(e.unref(a)),e.createVNode(e.unref(S.Tabs),{modelValue:s.value,"onUpdate:modelValue":u[0]||(u[0]=h=>s.value=h)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(yt),(h,g)=>(e.openBlock(),e.createBlock(e.unref(r),{key:g,title:h.title},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(f)[g]),{id:`grid-${g}`,border:"","max-height":"300"},null,8,["id"]))]),_:2},1032,["title"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["model-value","title"]))}}),ad={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},sd={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},id={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},cd=e.defineComponent({__name:"DataDictionaryQuery",setup(t){const o=async({page:R,formValues:C})=>{const w={pageNo:R.currentPage,pageSize:R.pageSize,authDict:{cSign:C.cSign||"",cXuhao:C.cXuhao||"",cName:C.cName||"",nParent:0}},V=await I.post("/core/authDict/selectForPage",w);return V.result?.records&&(V.result.records=V.result.records.map(N=>({...N,hasChildren:!0}))),V};async function r({row:R}){const w={pageNo:1,pageSize:9999,authDict:{...await s.getValues(),nParent:R.id}};try{return((await I.post("/core/authDict/selectForPage",w)).result?.records||[]).map(T=>({...T,hasChildren:!0}))}catch(V){return console.error("加载子节点失败:",V),[]}}const n={lazy:!0,rowField:"id",hasChild:"hasChildren",expandAll:!1,loadMethod:r},{QueryForm:l,formApi:s,Grid:a,gridApi:i,submitting:f,handleGlobalEnter:m,searchPlanList:b,currentSearchPlan:p,resourceId:c,nResourceid:d,handleSearchPlanSearch:u,handleDefaultPlanLoaded:h,businessResumeState:g}=ce({searchFormSchema:ed,tableColumns:td,resourceConfig:nd,queryFunction:o,gridEvents:{toolbarButtonClick:({code:R})=>{R==="dataDictionary/add"?L():R==="dataDictionary/update"?k():R==="dataDictionary/enable"?B("10001"):R==="dataDictionary/disable"?B("10002"):R==="dataDictionary/del"&&M()}},treeConfig:n,lazy:!0}),y=e.ref(!1),x=e.ref("0"),v=e.ref(""),E=e.ref(!1),_=e.ref(void 0);function L(){const R=i.getSelection();if(R.length>1){S.Message.warning("最多只能选择一条数据作为父级");return}R.length===1?(x.value=R[0].id,v.value=R[0].cName):(x.value="0",v.value=""),y.value=!0}function k(){const R=i.getSelection();if(R.length===0){S.Message.warning("请选择要修改的数据");return}if(R.length>1){S.Message.warning("一次只能修改一条数据");return}_.value=R[0],E.value=!0}async function B(R){const C=i.getSelection();if(C.length===0){S.Message.warning("请选择要操作的数据");return}if(C.length>1){S.Message.warning("一次只能操作一条数据");return}const w=C[0],V=R==="10001"?"启用":"禁用";try{const N=await I.post("/core/authDict/sign",{authDict:{id:w.id,cSign:R}});S.Message.success(N.message||`${V}成功`),i.commitProxy("query")}catch(N){console.error(`${V}失败:`,N)}}function M(){const R=i.getSelection();if(R.length===0){S.Message.warning("请选择要删除的数据");return}if(R.length>1){S.Message.warning("一次只能删除一条数据");return}const C=R[0];S.Modal.confirm({title:"确认删除",content:`确定要删除「${C.cName}」吗?`,okText:"确定",cancelText:"取消",onOk:async()=>{try{const w=await I.post("/core/authDict/delete",{authDict:{id:C.id}});S.Message.success(w.message||"删除成功"),i.commitProxy("query")}catch(w){console.error("删除失败:",w)}}})}function P(){i.commitProxy("query")}return(R,C)=>(e.openBlock(),e.createElementBlock("div",{class:"data-dictionary-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:C[2]||(C[2]=e.withKeys((...w)=>e.unref(m)&&e.unref(m)(...w),["enter"])),tabindex:"-1"},[e.createElementVNode("div",ad,[e.createElementVNode("div",sd,[e.createVNode(e.unref(l))]),e.createElementVNode("div",id,[e.createVNode(e.unref(a),{class:"flex-1"})])]),e.createVNode(rd,{visible:y.value,"onUpdate:visible":C[0]||(C[0]=w=>y.value=w),"parent-id":x.value,"parent-name":v.value,onSuccess:P},null,8,["visible","parent-id","parent-name"]),e.createVNode(ld,{visible:E.value,"onUpdate:visible":C[1]||(C[1]=w=>E.value=w),row:_.value,onSuccess:P},null,8,["visible","row"]),e.createVNode(e.unref(ke),{state:e.unref(g)},null,8,["state"])],32))}}),dd=re(cd,[["__scopeId","data-v-4940c6dd"]]),ud=[{label:"启用",value:"10001"},{label:"禁用",value:"10002"}],md=[{fieldName:"cXuhao",label:"字典编号",component:"Input",componentProps:{placeholder:"请输入字典编号",allowClear:!0},colProps:{span:6}},{fieldName:"cName",label:"字典名称",component:"Input",componentProps:{placeholder:"请输入字典名称",allowClear:!0},colProps:{span:6}},{fieldName:"cSign",label:"是否启用",component:"Select",selectOptions:{dictCode:"SFQY",fieldMapping:{label:"cName",value:"cXuhao"}},componentProps:{placeholder:"请选择是否启用",allowClear:!0},colProps:{span:6}}],eo=[{fieldName:"parentName",label:"父级字典",component:"Input",componentProps:{disabled:!0,placeholder:"无"}},{fieldName:"cXuhao",label:"字典编号",component:"Input",rules:"required",componentProps:{placeholder:"请输入字典编号",allowClear:!0}},{fieldName:"cName",label:"字典名称",component:"Input",rules:"required",componentProps:{placeholder:"请输入字典名称",allowClear:!0}},{fieldName:"cSign",label:"是否启用",component:"Select",rules:"required",selectOptions:{dictCode:"SFQY"},componentProps:{placeholder:"请选择是否启用"}},{fieldName:"nOrder",label:"排序",component:"InputNumber",componentProps:{placeholder:"请输入排序",min:0,precision:0}}],pd=[{type:"checkbox",width:50},{field:"id",title:"数据字典ID",minWidth:140,treeNode:!0,params:{nBill:3,cEntityTable:"AUTH_DICT"}},{field:"cXuhao",title:"字典编号",minWidth:140},{field:"cName",title:"字典名称",minWidth:180},{field:"cSign",title:"是否启用",width:100,formatter:({cellValue:t})=>ud.find(r=>r.value===t)?.label||t},{field:"cCreateName",title:"创建人",width:120},{field:"dCreate",title:"创建时间",width:180},{field:"nOrder",title:"排序",width:80}],to=[{type:"checkbox",width:50,align:"center"},{field:"key",title:"属性键",minWidth:150,...z.EditRender.SelectRender,params:{placeholder:"请选择属性键",allowClear:!0,options:[]},selectOptions:{dictCode:"DICTATTR",fieldMapping:{label:"cName",value:"cXuhao"}}},{field:"value",title:"属性值",minWidth:200,...z.EditRender.InputRender,params:{placeholder:"请输入属性值",allowClear:!0}}],fd=[{field:"cXuhao",title:"子级数据字典编号",minWidth:200,...z.EditRender.InputRender,params:{placeholder:"请输入子级数据字典编号",allowClear:!0,disabled:!0}},{field:"cName",title:"子级数据字典名称",minWidth:200,...z.EditRender.InputRender,params:{placeholder:"请输入子级数据字典名称",allowClear:!0}},{field:"nOrder",title:"子级数据字典排序",minWidth:150,...z.EditRender.InputRender,params:{placeholder:"请输入排序",allowClear:!0}}],oo={key:[{required:!0,message:"请输入属性键"}]},no=[{code:"insert",name:"添加属性"},{code:"remove",name:"删除"}],Ct=[{title:"额外属性",type:"grid",gridConfig:{columns:to,editRules:oo,toolbarButtons:no}},{title:"子级数据字典",type:"grid",gridConfig:{columns:fd,editRules:{},toolbarButtons:[]}}],hd={resourceId:"ywsjzd",nResourceid:161,cModnumb:"b2a3c6ba-d6d8-4d51-ad78-887f05b9e56b"},gd=e.defineComponent({name:"YwsjzdAdd",__name:"YwsjzdAdd",props:{visible:{type:Boolean,default:!1},parentId:{default:"0"},parentName:{default:""}},emits:["update:visible","success"],setup(t,{emit:o}){const r=t,n=o;e.ref(!1);const[l,s,a,i]=dt({formSchema:eo,tableColumns:to,tableEditRules:oo,tableToolbarButtons:no});e.watch(()=>r.visible,async p=>{p&&(await e.nextTick(),s.resetForm(),s.setValues({parentName:r.parentName||"无"}),i.reloadData([]))});const f=e.computed(()=>r.parentId&&r.parentId!=="0"?`新增子级字典 - ${r.parentName}`:"新增根级字典");async function m(){try{const{valid:p}=await s.validate();if(!p||await i.validate())return!1;const d=await i.getFullData(),u=d.filter(E=>E.key).map(E=>E.key),h=new Set(u);if(u.length!==h.size)return S.Message.warning("属性键不能重复"),!1;const g=await s.getValues(),y={};d.forEach(E=>{E.key&&(y[E.key]=E.value||"")});const x={authDict:{cXuhao:g.cXuhao,cName:g.cName,cSign:g.cSign,nParent:r.parentId||"0",nOrder:g.nOrder||0,cMeta:JSON.stringify(y)}},v=await I.post("/core/authDict/addBS",x);return S.Message.success(v.message),n("success"),!0}catch(p){return console.error("新增失败:",p),!1}}function b(){n("update:visible",!1)}return(p,c)=>(e.openBlock(),e.createBlock(e.unref(z.Modal),{"model-value":r.visible,title:f.value,width:700,"on-before-ok":m,"onUpdate:modelValue":c[0]||(c[0]=d=>n("update:visible",d)),onClose:b},{default:e.withCtx(()=>[e.createVNode(e.unref(l)),e.createVNode(e.unref(a),{id:"metaGrid",border:"","max-height":"300"})]),_:1},8,["model-value","title"]))}}),bd=e.defineComponent({name:"YwsjzdUpdate",__name:"YwsjzdUpdate",props:{visible:{type:Boolean,default:!1},row:{default:void 0}},emits:["update:visible","success"],setup(t,{emit:o}){const{TabPane:r}=S.Tabs,n=t,l=o;e.ref(!1);const s=e.ref(0),[a,i,f,m]=ut({formSchema:eo,tabsConfig:Ct});e.watch(()=>n.visible,async d=>{if(d&&n.row){await e.nextTick(),i.resetForm(),m.value[0].reloadData([]);try{const h=(await I.post("/core/authDict/editInit",{authDict:{id:n.row.id}})).result;if(h){if(i.setValues({cXuhao:h.authDict.cXuhao,cName:h.authDict.cName,cSign:h.authDict.cSign,nOrder:h.authDict.nOrder}),h.authDict.cMeta)try{const g=JSON.parse(h.authDict.cMeta),y=Object.keys(g).map(x=>({key:x,value:g[x]}));m.value[0].reloadData(y)}catch(g){console.error("解析额外属性失败:",g)}h.childList&&h.childList.length>0?m.value[1].reloadData(h.childList):m.value[1].reloadData([])}}catch(u){console.error("加载数据失败:",u),S.Message.error("加载数据失败")}}});const b=e.computed(()=>"修改字典");async function p(){try{const{valid:d}=await i.validate();if(!d||await m.value[0].validate())return!1;const h=await m.value[0].getFullData(),g=h.filter(k=>k.key).map(k=>k.key),y=new Set(g);if(g.length!==y.size)return S.Message.warning("属性键不能重复"),!1;const x=await i.getValues(),v={};h.forEach(k=>{k.key&&(v[k.key]=k.value||"")});const E=await m.value[1].getFullData(),_={authDict:{id:n.row?.id,cXuhao:x.cXuhao,cName:x.cName,cSign:x.cSign,nOrder:x.nOrder||0,cMeta:JSON.stringify(v),nParent:n.row?.nParent||0,nType:n.row?.nType||1},authDictList:E},L=await I.post("/core/authDict/editBS",_);return S.Message.success(L.message),l("success"),!0}catch(d){return console.error("修改失败:",d),!1}}function c(){l("update:visible",!1)}return(d,u)=>(e.openBlock(),e.createBlock(e.unref(z.Modal),{"model-value":n.visible,title:b.value,width:700,"on-before-ok":p,"onUpdate:modelValue":u[1]||(u[1]=h=>l("update:visible",h)),onClose:c},{default:e.withCtx(()=>[e.createVNode(e.unref(a)),e.createVNode(e.unref(S.Tabs),{modelValue:s.value,"onUpdate:modelValue":u[0]||(u[0]=h=>s.value=h)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Ct),(h,g)=>(e.openBlock(),e.createBlock(e.unref(r),{key:g,title:h.title},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(f)[g]),{id:`grid-${g}`,border:"","max-height":"300"},null,8,["id"]))]),_:2},1032,["title"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["model-value","title"]))}}),vd={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},yd={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},Cd={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},xd=e.defineComponent({__name:"YwsjzdQuery",setup(t){const o=async({page:R,formValues:C})=>{const w={pageNo:R.currentPage,pageSize:R.pageSize,authDict:{cSign:C.cSign||"",cXuhao:C.cXuhao||"",cName:C.cName||"",nParent:0}},V=await I.post("/core/authDict/selectForPageBS",w);return V.result?.records&&(V.result.records=V.result.records.map(N=>({...N,hasChildren:!0}))),V};async function r({row:R}){const w={pageNo:1,pageSize:9999,authDict:{...await s.getValues(),nParent:R.id}};try{return((await I.post("/core/authDict/selectForPageBS",w)).result?.records||[]).map(T=>({...T,hasChildren:!0}))}catch(V){return console.error("加载子节点失败:",V),[]}}const n={lazy:!0,rowField:"id",hasChild:"hasChildren",expandAll:!1,loadMethod:r},{QueryForm:l,formApi:s,Grid:a,gridApi:i,submitting:f,handleGlobalEnter:m,searchPlanList:b,currentSearchPlan:p,resourceId:c,nResourceid:d,handleSearchPlanSearch:u,handleDefaultPlanLoaded:h,businessResumeState:g}=ce({searchFormSchema:md,tableColumns:pd,resourceConfig:hd,queryFunction:o,gridEvents:{toolbarButtonClick:({code:R})=>{R==="ywsjzd/add"?L():R==="ywsjzd/update"?k():R==="ywsjzd/enable"?B("10001"):R==="ywsjzd/disable"?B("10002"):R==="ywsjzd/del"&&M()}},treeConfig:n,lazy:!0}),y=e.ref(!1),x=e.ref("0"),v=e.ref(""),E=e.ref(!1),_=e.ref(null);function L(){const R=i.getSelection();if(R.length>1){S.Message.warning("最多只能选择一条数据作为父级");return}R.length===1?(x.value=R[0].id,v.value=R[0].cName):(x.value="0",v.value=""),y.value=!0}function k(){const R=i.getSelection();if(R.length!==1){S.Message.warning("请选择一条数据进行修改");return}const C=R[0];_.value=C,E.value=!0}async function B(R){const C=i.getSelection();if(C.length===0){S.Message.warning("请选择要操作的数据");return}if(C.length>1){S.Message.warning("一次只能操作一条数据");return}const w=C[0],V=R==="10001"?"启用":"禁用";try{const N=await I.post("/core/authDict/signBS",{authDict:{id:w.id,cSign:R}});S.Message.success(N.message||`${V}成功`),i.commitProxy("query")}catch(N){console.error(`${V}失败:`,N)}}function M(){const R=i.getSelection();if(R.length===0){S.Message.warning("请选择要删除的数据");return}if(R.length>1){S.Message.warning("一次只能删除一条数据");return}const C=R[0];S.Modal.confirm({title:"确认删除",content:`确定要删除「${C.cName}」吗?`,okText:"确定",cancelText:"取消",onOk:async()=>{try{const w=await I.post("/core/authDict/deleteBS",{authDict:{id:C.id}});S.Message.success(w.message||"删除成功"),i.commitProxy("query")}catch(w){console.error("删除失败:",w)}}})}function P(){i.commitProxy("query")}return(R,C)=>(e.openBlock(),e.createElementBlock("div",{class:"ywsjzd-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:C[2]||(C[2]=e.withKeys((...w)=>e.unref(m)&&e.unref(m)(...w),["enter"])),tabindex:"-1"},[e.createElementVNode("div",vd,[e.createElementVNode("div",yd,[e.createVNode(e.unref(l))]),e.createElementVNode("div",Cd,[e.createVNode(e.unref(a),{class:"flex-1"})])]),e.createVNode(gd,{visible:y.value,"onUpdate:visible":C[0]||(C[0]=w=>y.value=w),"parent-id":x.value,"parent-name":v.value,onSuccess:P},null,8,["visible","parent-id","parent-name"]),e.createVNode(bd,{visible:E.value,"onUpdate:visible":C[1]||(C[1]=w=>E.value=w),row:_.value,onSuccess:P},null,8,["visible","row"]),e.createVNode(e.unref(ke),{state:e.unref(g)},null,8,["state"])],32))}}),kd=re(xd,[["__scopeId","data-v-24b85090"]]),Re=({t,formApi:o})=>{const r=[{label:"普通用户",value:"0"},{label:"超级用户",value:"1"}],n=[{label:"启用",value:"0"},{label:"禁用",value:"1"}],l=[{label:"是",value:"1"},{label:"否",value:"0"}],s=[{fieldName:"cUsernumb",label:t("user.cUsernumb"),component:"Input",componentProps:{allowClear:!0}},{fieldName:"cUsername",label:t("user.cUsername"),component:"Input",componentProps:{allowClear:!0}},{fieldName:"cAdmin",label:t("user.cAdmin"),component:"Select",componentProps:{allowClear:!0,options:r}},{fieldName:"dLastLoginList",label:t("user.dLastLoginList"),component:"RangePicker",componentProps:{allowClear:!0}}],a=[{type:"checkbox",width:40},{field:"id",title:"ID",minWidth:80,params:{nBill:3,cEntityTable:"AUTH_USER"}},{field:"cUsernumb",title:t("user.cUsernumb"),minWidth:120},{field:"cUsername",title:t("user.cUsername"),minWidth:120},{field:"cAdmin",title:t("user.cAdmin"),minWidth:120,params:{optionlist:r},formatter:({cellValue:c,column:d})=>be(c,d.params.optionlist)},{field:"cWork",title:t("user.cWork"),minWidth:120},{field:"dCredate",title:t("user.dCredate"),minWidth:120},{field:"cSign",title:t("user.cSign"),minWidth:120,params:{optionlist:n},formatter:({cellValue:c,column:d})=>be(c,d.params.optionlist)},{field:"cEmail",title:t("user.cEmail"),minWidth:120},{field:"cDeptname",title:t("user.cDeptname"),minWidth:120},{field:"nMainAccount",title:t("user.nMainAccount"),minWidth:120,params:{optionlist:l},formatter:({cellValue:c,column:d})=>be(c,d.params.optionlist)},{field:"nOuterUser",title:t("user.nOuterUser"),minWidth:120,params:{optionlist:l},formatter:({cellValue:c,column:d})=>be(c,d.params.optionlist)},{field:"dLastLogin",title:t("user.dLastLogin"),minWidth:120}],i={resourceId:"88",nResourceid:80,cModnumb:"XTGL_YHGL_LIST"},f=[{fieldName:"cUsernumb",label:t("user.cUsernumb"),component:"Input",componentProps:{allowClear:!0},rules:"required"},{fieldName:"cUsername",label:t("user.cUsername"),component:"Input",componentProps:{allowClear:!0},rules:"required"},{fieldName:"cAdmin",label:t("user.cAdmin"),component:"Select",componentProps:{allowClear:!0,options:r},rules:"required"},{fieldName:"nMainAccount",label:t("user.nMainAccount"),component:"RadioGroup",componentProps:{allowClear:!0,options:l}},{fieldName:"nOuterUser",label:t("user.nOuterUser"),component:"RadioGroup",componentProps:{allowClear:!0,options:l}},{fieldName:"cWork",label:t("user.cWork"),component:"SunnyBusinessSearch",componentProps:(c,d)=>({allowClear:!0,cNum:"INNER_WORK_OPT",defaultModel:{WORKCODE:"1084870"},modalProps:{multiple:!1,fieldNames:{value:"WORKCODE",label:"LASTNAME"}},onChange:(u,h)=>{u.length>0?(d.setFieldValue("cDeptnum",u[0].DEPTCODE),d.setFieldValue("cDeptname",u[0].DEPTNAME)):(d.setFieldValue("cDeptnum",""),d.setFieldValue("cDeptname",""))}}),dependencies:{show:c=>c.nOuterUser==="0"}},{fieldName:"cDeptnum",label:t("user.cDeptnum"),component:"Input",componentProps:{allowClear:!0,disabled:!0},dependencies:{show:c=>c.nOuterUser==="0"}},{fieldName:"cDeptname",label:t("user.cDeptname"),component:"Input",componentProps:{allowClear:!0,disabled:!0},dependencies:{show:c=>c.nOuterUser==="0"}}],m=[{fieldName:"cUsernumb",label:t("user.cUsernumb"),component:"Input",componentProps:{disabled:!0},colProps:{span:12}},{fieldName:"cUsername",label:t("user.cUsername"),component:"Input",componentProps:{disabled:!0},colProps:{span:12}}],b=[{type:"checkbox",width:40,align:"center"},{field:"cRolenumb",title:t("user.cRolenumb"),minWidth:100},{field:"cRolename",title:t("user.cRolename"),minWidth:200},{field:"nSensitive",title:t("user.nSensitive"),minWidth:100,formatter:({cellValue:c,column:d})=>be(c,d.params.optionlist),params:{optionlist:l}},{field:"cSystem",title:t("user.cSystem"),minWidth:100}],p=[{type:"checkbox",width:40,align:"center"},{field:"cMac",title:t("user.cMac"),...z.EditRender.InputRender},{field:"cMacdesc",title:t("user.cMacdesc"),...z.EditRender.InputRender},{field:"cCreateusername",title:t("user.cCreateusername")},{field:"dDate",title:t("user.dDate")}];return{searchFormSchema:s,tableColumns:a,resourceConfig:i,addEditFormSchema:f,authFormSchema:m,authGridColumns:b,bindMacGridColumns:p}},wd=e.defineComponent({__name:"UserAdd",emits:["success"],setup(t,{expose:o,emit:r}){const{t:n}=Y.useI18n(),l=e.ref(!1),s=e.ref("add"),a=r,[i,f]=xe({schema:[],objectToValueFields:["cWork"]}),{addEditFormSchema:m}=Re({t:n,formApi:f}),b=()=>{l.value=!0,s.value="add",f.setState({schema:m}),f.resetForm(),f.setValues({nMainAccount:"1",nOuterUser:"0"})},p=async h=>{s.value="edit";const g=await I.post("/core/authUser/queryById",{authUser:{id:h.id}});l.value=!0,await e.nextTick(),f.setState({schema:m}),f.resetForm(),g.code===200&&f.setValues({...g.result,nMainAccount:g.result.nMainAccount.toString(),nOuterUser:g.result.nOuterUser.toString()},!1)};o({addInit:b,editInit:p,detailInit:h=>{p(h)}});const d=async()=>{const{valid:h}=await f.validate();if(!h)return!1;const y={authUser:await f.getValues()},x=await I.post(s.value==="add"?"/core/authUser/add":"/core/authUser/edit",y);return x.code===200?(S.Message.success(x.message),l.value=!1,a("success"),!0):(S.Message.error(x.message),!1)};function u(){l.value=!1}return(h,g)=>(e.openBlock(),e.createBlock(e.unref(z.Modal),{"model-value":l.value,title:s.value==="add"?e.unref(n)("user.addTitle"):e.unref(n)("user.editTitle"),width:600,"on-before-ok":d,onClose:u},{default:e.withCtx(()=>[e.createVNode(e.unref(i))]),_:1},8,["model-value","title"]))}}),Sd=e.defineComponent({__name:"UserChooseRole",emits:["chooseRoleEmit"],setup(t,{expose:o,emit:r}){const{t:n}=Y.useI18n(),l=e.ref(!1),s=e.ref([]);e.ref([]),e.ref(!1);const a=r,i=[{fieldName:"cRolenumb",label:n("user.cRolenumb"),component:"Input",componentProps:{allowClear:!0},colProps:{span:6}},{fieldName:"cRolename",label:n("user.cRolename"),component:"Input",componentProps:{allowClear:!0},colProps:{span:6}}],f=[{type:"checkbox",width:50,fixed:"left"},{field:"cRolenumb",title:n("user.cRolenumb"),width:120},{field:"cRolename",title:n("user.cRolename"),width:120},{field:"nSensitive",title:n("user.nSensitive"),width:120,formatter:({row:c})=>c.nSensitive=="1"?n("common.yes"):n("common.no")},{field:"cSystem",title:n("user.cSystem"),width:120}],m=()=>{l.value=!0},b=c=>{a("chooseRoleEmit",c)},p=async c=>{var d={authRole:{cRolenumb:c.cRolenumb,cRolename:c.cRolename},pageNo:c.pageNo,pageSize:c.pageSize};const u=await I.post("/core/authRole/queryAllPageList",d);return{list:u.result.records,total:u.result.total}};return o({openInit:m}),(c,d)=>(e.openBlock(),e.createBlock(e.unref(z.SunnySearchModal),{visible:l.value,"onUpdate:visible":d[0]||(d[0]=u=>l.value=u),modelValue:s.value,"onUpdate:modelValue":d[1]||(d[1]=u=>s.value=u),title:c.$t("系统角色权限查询"),"form-schema":i,"table-columns":f,"search-api":p,"field-names":{label:"cRolename",value:"cRolenumb"},onConfirm:b},null,8,["visible","modelValue","title"]))}}),Nd=e.defineComponent({__name:"UserAuth",emits:["success"],setup(t,{expose:o,emit:r}){const n=e.ref(),{t:l}=Y.useI18n(),s=e.ref(!1),a=r,[i,f]=xe({schema:[]}),{authFormSchema:m,authGridColumns:b}=Re({t:l,formApi:f}),[p,c]=z.useSunnyEditGrid({gridOptions:{data:[],columns:b,border:!0,size:"mini",maxHeight:400,columnConfig:{resizable:!0}}});o({openInit:async v=>{const E=await I.post("/core/authUser/queryUserRole",{authUser:{id:v.id}}),_=E.code===200?E.result:[];s.value=!0,await e.nextTick(),f.setState({schema:m}),f.resetForm(),f.setValues({cUsernumb:v.cUsernumb,cUsername:v.cUsername}),c.reloadData(_)}});const u=async()=>{const{valid:v}=await f.validate();if(!v)return!1;const E=await f.getValues(),_=await c.getFullData(),L={authorizedNumb:E.cUsernumb,authUserRoleList:_},k=await I.post("/core/authUser/saveUserAuth",L);return k.code===200?(S.Message.success(k.message),s.value=!1,a("success"),!0):(S.Message.error(k.message),!1)};function h(){s.value=!1}const g=()=>{n.value.openInit()},y=async v=>{const E=await c.getFullData();v.forEach(_=>{Q.findIndex(E,L=>L.nRoleid===_.id)>-1?S.Message.warning(l("user.duplicateRole",{roleName:_.cRolename})):c.addEvent({nRoleid:_.id,cSystem:_.cSystem,cRolename:_.cRolename,cRolenumb:_.cRolenumb,nSensitive:_.nSensitive})})},x=()=>{c.deleteSelection()};return(v,E)=>{const _=e.resolveComponent("a-button"),L=e.resolveComponent("a-space");return e.openBlock(),e.createBlock(e.unref(z.Modal),{"model-value":s.value,title:e.unref(l)("user.authTitle"),width:700,"on-before-ok":u,onClose:h},{default:e.withCtx(()=>[e.createVNode(e.unref(i)),e.createVNode(e.unref(p),null,{toolbar:e.withCtx(()=>[e.createVNode(L,{class:"mb-2"},{default:e.withCtx(()=>[e.createVNode(_,{type:"primary",onClick:g},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("common.create")),1)]),_:1}),e.createVNode(_,{type:"primary",onClick:x},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("common.deleteSelected")),1)]),_:1})]),_:1})]),_:1}),e.createVNode(Sd,{ref_key:"UserChooseRoleRef",ref:n,onChooseRoleEmit:y},null,512)]),_:1},8,["model-value","title"])}}}),_d=e.defineComponent({__name:"UserBindMac",emits:["success"],setup(t,{expose:o,emit:r}){const{t:n}=Y.useI18n(),l=e.ref(!1),s=e.ref({}),a=r,{bindMacGridColumns:i}=Re({t:n}),[f,m]=z.useSunnyEditGrid({gridOptions:{data:[],columns:i,border:!0,size:"mini",maxHeight:400,columnConfig:{resizable:!0},editRules:{cMac:[{required:!0,message:n("user.cMacMessage")}]}}});o({openInit:async h=>{const g=await I.post("/core/authUser/queryMac",{cUsernumb:h.cUsernumb}),y=g.code===200?g.result:[];g.code===200&&(s.value=h),l.value=!0,await e.nextTick(),m.reloadData(y)}});const p=async()=>{if(await m.validate())return!1;const y={authUserMacList:await m.getFullData(),authUserMac:{cUsernumb:s.value.cUsernumb}},x=await I.post("/core/authUser/saveMac",y);return x.code===200?(S.Message.success(x.message),l.value=!1,a("success"),!0):(S.Message.error(x.message),!1)};function c(){l.value=!1}const d=()=>{m.addEvent({})},u=()=>{m.deleteSelection()};return(h,g)=>{const y=e.resolveComponent("a-button"),x=e.resolveComponent("a-space");return e.openBlock(),e.createBlock(e.unref(z.Modal),{"model-value":l.value,title:e.unref(n)("user.bindMacTitle"),width:700,"on-before-ok":p,onClose:c},{default:e.withCtx(()=>[e.createVNode(e.unref(f),null,{toolbar:e.withCtx(()=>[e.createVNode(x,{class:"mb-2"},{default:e.withCtx(()=>[e.createVNode(y,{type:"primary",onClick:d},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("common.create")),1)]),_:1}),e.createVNode(y,{type:"primary",onClick:u},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("common.deleteSelected")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["model-value","title"])}}}),Vd={class:"otherAuthTable"},Ed={class:"th1"},Pd={class:"th2"},Md={class:"th3"},Td={class:"tr1"},Bd={class:"tr2"},Rd={class:"tr3"},$d={key:0,style:{color:"#24b77b"}},Ld=e.defineComponent({__name:"UserOtherAuth",emits:["success"],setup(t,{expose:o,emit:r}){const{t:n}=Y.useI18n(),l=e.ref(!1),s=e.ref([]),a=e.ref({}),i=(p,c)=>{c.forEach(d=>{d.check=!!p})};o({openInit:async p=>{const c=await I.post("/core/authUser/queryUserExres",{authUser:{id:p.id}});c.code===200&&(s.value=c.result,a.value=p),l.value=!0}});const m=async()=>{const p={authUser:{id:a.value.id},userExresAuthBOList:s.value.map(d=>({...d,allCheck:!1}))},c=await I.post("/core/authUser/saveUserExres",p);return c.code===200?(S.Message.success(c.message),l.value=!1,!0):(S.Message.error(c.message),!1)};function b(){l.value=!1}return(p,c)=>{const d=e.resolveComponent("a-checkbox");return e.openBlock(),e.createBlock(e.unref(z.Modal),{"model-value":l.value,title:e.unref(n)("user.otherAuth.title"),width:900,class:"macAddressDialog","on-before-ok":m,onClose:b},{default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createElementVNode("table",Vd,[c[1]||(c[1]=e.createElementVNode("caption",null,null,-1)),e.createElementVNode("th",Ed,e.toDisplayString(e.unref(n)("user.otherAuth.tab")),1),e.createElementVNode("th",Pd,e.toDisplayString(e.unref(n)("user.otherAuth.tabDesc")),1),e.createElementVNode("th",Md,e.toDisplayString(e.unref(n)("user.otherAuth.option")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,u=>(e.openBlock(),e.createElementBlock("tr",null,[e.createElementVNode("td",Td,e.toDisplayString(u.parname),1),e.createElementVNode("td",Bd,[e.createVNode(d,{modelValue:u.allCheck,"onUpdate:modelValue":h=>u.allCheck=h,onChange:h=>i(h,u.authExresList)},null,8,["modelValue","onUpdate:modelValue","onChange"]),c[0]||(c[0]=e.createTextVNode(" 是 ",-1))]),e.createElementVNode("td",Rd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.authExresList,h=>(e.openBlock(),e.createBlock(d,{modelValue:h.check,"onUpdate:modelValue":g=>h.check=g},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.cExresnum+"-"+h.cExresname)+" ",1),h.cOrg?(e.openBlock(),e.createElementBlock("span",$d,"["+e.toDisplayString(h.cOrg)+"]",1)):e.createCommentVNode("",!0)]),_:2},1032,["modelValue","onUpdate:modelValue"]))),256))])]))),256))])])]),_:1},8,["model-value","title"])}}}),Id=re(Ld,[["__scopeId","data-v-c249a204"]]),Dd={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},Od={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},jd={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},zd=e.defineComponent({__name:"UserQuery",setup(t){const o=e.ref(),r=e.ref(),n=e.ref(),l=e.ref(),s=me.useRouter(),{t:a}=Y.useI18n(),{searchFormSchema:i,tableColumns:f,resourceConfig:m}=Re({t:a}),b=async({page:w,formValues:V})=>{const N={pageNo:w.currentPage,pageSize:w.pageSize,authUser:V};return I.post("/core/authUser/selectForPage",N)},p={async toolbarButtonClick(w){const V=[...w.$grid.getCheckboxRecords()];switch(w.button.code){case"userManagement/add":o.value.addInit();break;case"userManagement/update":if(V.length!==1){S.Message.warning(a("common.selectOne"));return}o.value.editInit(V[0]);break;case"userManagement/delete":if(V.length!==1){S.Message.warning(a("common.selectOne"));return}S.Modal.confirm({title:a("common.prompt"),content:`确定删除选中 ${V.length} 项吗?`,onBeforeOk:async()=>{const T=await I.post("/core/authUser/delete",{id:V[0].id});return T.code===200?(S.Message.success(T.message),w.$grid.commitProxy("query",{}),!0):(S.Message.error(T.message),!1)}});break;case"userManagement/detail":if(V.length!==1){S.Message.warning(a("common.selectOne"));return}o.value.detailInit(V[0]);break;case"userManagement/resetPassword":if(V.length!==1){S.Message.warning(a("common.selectOne"));return}S.Modal.confirm({title:a("common.prompt"),content:a("user.resetPasswordTips",{username:V[0].cUsername}),onBeforeOk:async()=>{const T=await I.post("/core/authUser/resetPwd",{id:V[0].id});return T.code===200?(S.Message.success(T.message),w.$grid.commitProxy("query",{}),!0):(S.Message.error(T.message),!1)}});break;case"userManagement/enable":if(V.length!==1){S.Message.warning(a("common.selectOne"));return}S.Modal.confirm({title:a("common.prompt"),content:a("user.enableTips",{username:V[0].cUsername}),onBeforeOk:async()=>{const T=await I.post("/core/authUser/updateSign",{id:V[0].id,cSign:"0"});return T.code===200?(S.Message.success(T.message),w.$grid.commitProxy("query",{}),!0):(S.Message.error(T.message),!1)}});break;case"userManagement/disable":if(V.length!==1){S.Message.warning(a("common.selectOne"));return}S.Modal.confirm({title:a("common.prompt"),content:a("user.disableTips",{username:V[0].cUsername}),onBeforeOk:async()=>{const T=await I.post("/core/authUser/updateSign",{id:V[0].id,cSign:"1"});return T.code===200?(S.Message.success(T.message),w.$grid.commitProxy("query",{}),!0):(S.Message.error(T.message),!1)}});break;case"userManagement/auth":if(V.length!==1){S.Message.warning(a("common.selectOne"));return}r.value.openInit(V[0]);break;case"userManagement/macBind":if(V.length!==1){S.Message.warning(a("common.selectOne"));return}n.value.openInit(V[0]);break;case"userManagement/otherAuth":if(V.length!==1){S.Message.warning(a("common.selectOne"));return}l.value.openInit(V[0]);break;case"daoru/show":C.open({nModid:s.currentRoute.value.meta.id,nButtonid:w.button.nButtonid});break;case"daochu/show":const N=await d.getValues();P({conditionMap:N,tableColumns:f});break}}},{QueryForm:c,formApi:d,Grid:u,gridApi:h,submitting:g,handleGlobalEnter:y,searchPlanList:x,currentSearchPlan:v,resourceId:E,nResourceid:_,handleSearchPlanSearch:L,handleDefaultPlanLoaded:k,businessResumeState:B}=ce({searchFormSchema:i,tableColumns:f,resourceConfig:m,queryFunction:b,gridEvents:p,showCheckbox:!0}),{ExportModal:M,open:P}=fo({exportUrl:"/core/authUser"}),[R,C]=z.useImportModal({});return(w,V)=>(e.openBlock(),e.createElementBlock("div",{class:"operation-log-query h-full flex flex-col bg-[var(--color-fill-2)] focus:outline-none",onKeydown:V[4]||(V[4]=e.withKeys((...N)=>e.unref(y)&&e.unref(y)(...N),["enter"])),tabindex:"-1"},[e.createElementVNode("div",Dd,[e.createElementVNode("div",Od,[e.createVNode(e.unref(c))]),e.createElementVNode("div",jd,[e.createVNode(e.unref(u),{class:"flex-1"})]),e.createVNode(e.unref(M)),e.createVNode(e.unref(R)),e.createVNode(wd,{ref_key:"UserAddRef",ref:o,onSuccess:V[0]||(V[0]=()=>e.unref(h).commitProxy("query"))},null,512),e.createVNode(Nd,{ref_key:"UserAuthRef",ref:r,onSuccess:V[1]||(V[1]=()=>e.unref(h).commitProxy("query"))},null,512),e.createVNode(_d,{ref_key:"UserBindMacRef",ref:n,onSuccess:V[2]||(V[2]=()=>e.unref(h).commitProxy("query"))},null,512),e.createVNode(Id,{ref_key:"UserOtherAuthRef",ref:l,onSuccess:V[3]||(V[3]=()=>e.unref(h).commitProxy("query"))},null,512),e.createVNode(e.unref(ke),{state:e.unref(B)},null,8,["state"])])],32))}}),Fd=re(zd,[["__scopeId","data-v-98e86324"]]),$e=({t,formApi:o})=>{t("role.enable"),t("role.disable");const r=[{cKeyname:t("common.no"),cKeynumb:"0"},{cKeyname:t("common.yes"),cKeynumb:"1"}],n=[{cKeyname:t("role.baseSystem"),cKeynumb:"BASE"}],l=[{cKeyname:t("role.type1"),cKeynumb:"1"},{cKeyname:t("role.type2"),cKeynumb:"2"}],s=[{fieldName:"cRolenumb",label:t("user.cRolenumb"),component:"Input",componentProps:{placeholder:t("role.inputRoleNumb"),allowClear:!0},colProps:{span:4}},{fieldName:"cRolename",label:t("user.cRolename"),component:"Input",componentProps:{placeholder:t("role.inputRoleName"),allowClear:!0},colProps:{span:4}},{fieldName:"cOrg",label:t("role.org"),component:"Input",componentProps:{placeholder:t("role.inputOrg"),allowClear:!0},colProps:{span:4}}],a=[{type:"checkbox",width:40},{field:"id",title:t("role.id"),params:{nBill:3,cEntityTable:"AUTH_ROLE"}},{field:"cRolenumb",title:t("user.cRolenumb")},{field:"cRolename",title:t("user.cRolename")},{field:"CSystem",title:t("role.system"),formatter:({cellValue:p})=>n.find(d=>d.cKeynumb===p)?.cKeyname||p},{field:"corg",title:t("role.org")},{field:"сType",title:t("role.type"),formatter:({cellValue:p})=>l.find(d=>d.cKeynumb===p)?.cKeyname||p},{field:"nSensitive",title:t("user.nSensitive"),formatter:({cellValue:p})=>r.find(d=>d.cKeynumb===String(p))?.cKeyname||p},{field:"cCrename",title:t("role.createUser")},{field:"dCredate",title:t("role.createTime")}],i={resourceId:"role",nResourceid:95,cModnumb:"XTGL_JSGL_LIST"},f=[{fieldName:"cRolenumb",label:t("user.cRolenumb"),component:"Input",componentProps:{allowClear:!0},colProps:{span:4}},{fieldName:"cRolename",label:t("user.cRolename"),component:"Input",componentProps:{allowClear:!0},rules:"required",colProps:{span:4}},{fieldName:"cSystem",label:t("role.system"),component:"Select",componentProps:{allowClear:!0,options:n.map(p=>({label:p.cKeyname,value:p.cKeynumb}))},rules:"required",colProps:{span:4}},{fieldName:"corg",label:t("role.org"),component:"Input",componentProps:{allowClear:!0},colProps:{span:4}},{fieldName:"сType",label:t("role.type"),component:"Select",componentProps:{allowClear:!0,options:l.map(p=>({label:p.cKeyname,value:p.cKeynumb}))},colProps:{span:4}}],m=[{fieldName:"cRolenumb",label:t("user.cRolenumb"),component:"Input",componentProps:{disabled:!0},colProps:{span:12}},{fieldName:"cRolename",label:t("user.cRolename"),component:"Input",componentProps:{disabled:!0},colProps:{span:12}}],b=[{type:"checkbox",width:40,align:"center"},{field:"cUsernumb",title:t("user.cUsernumb"),minWidth:100},{field:"cUsername",title:t("user.cUsername"),minWidth:200},{field:"cAdmin",title:t("user.cAdmin"),minWidth:100,formatter:({cellValue:p})=>[{cKeyname:t("role.normalUser"),cKeynumb:"0"},{cKeyname:t("role.superUser"),cKeynumb:"1"}].find(u=>u.cKeynumb===String(p))?.cKeyname||p}];return{searchFormSchema:s,tableColumns:a,resourceConfig:i,addEditFormSchema:f,authFormSchema:m,authGridColumns:b}},Ad={class:"h-full flex flex-col"},Ud={class:"mt-5 flex-1 overflow-hidden"},qd={class:"mb-3 text-sm font-medium"},Kd={class:"h-[calc(100%-36px)] overflow-auto"},Wd={class:"extra-container ml-[250px] mr-auto",style:{"flex-shrink":"0","max-width":"70%","overflow-x":"auto"}},Gd={key:0,class:"flex flex-nowrap gap-3",style:{width:"max-content"}},ro=e.defineComponent({__name:"RoleAdd",emits:["success"],setup(t,{expose:o,emit:r}){const{t:n}=Y.useI18n(),l=e.ref(!1),s=e.ref("add"),a=e.ref(),i=e.ref(),f=e.ref(!1),m=r,b=e.reactive({treeData:[],defaultChecked:[],expandedKeys:[]}),p=async w=>{const V=await I.post("/core/authResource/getResourceTreeMenu",{authResMenu:{cSystem:w}});if(V.code===200){const N=V.result;b.treeData=E(N),c(b.treeData)}},c=w=>{w.forEach(V=>{V.buttonList&&V.buttonList.length&&V.buttonList.forEach(N=>{N.checked=b.defaultChecked.includes(String(N.id))}),V.children&&c(V.children)})},d=w=>{let V=[];return w.buttonList&&w.buttonList.length&&(V=V.concat(w.buttonList.map(N=>N.id))),w.children&&w.children.length&&w.children.forEach(N=>{V.push(N.id),V=V.concat(d(N))}),V},u=w=>{const V=[],N=(T,O,j=[])=>{for(const q of T){if(q.id===O)return V.push(...j),!0;if(q.children&&N(q.children,O,[...j,q.id]))return!0}return!1};return N(b.treeData,w),V},h=(w,V)=>{const N=V.node,T=V.checked,O=[...w];if(T){u(N.id).forEach(D=>{O.includes(D)||O.push(D)}),N.buttonList&&N.buttonList.length&&N.buttonList.forEach(D=>{O.includes(D.id)||O.push(D.id),D.checked=!0}),d(N).forEach(D=>{O.includes(D)||O.push(D)});const G=(D,$)=>{D.forEach(U=>{U.buttonList&&U.buttonList.length&&U.buttonList.forEach(W=>{W.checked=$}),U.children&&G(U.children,$)})};N.children&&G(N.children,!0)}else{N.buttonList&&N.buttonList.length&&N.buttonList.forEach(G=>{const D=O.indexOf(G.id);D!==-1&&O.splice(D,1),G.checked=!1}),d(N).forEach(G=>{const D=O.indexOf(G);D!==-1&&O.splice(D,1)});const q=(G,D)=>{G.forEach($=>{$.buttonList&&$.buttonList.length&&$.buttonList.forEach(U=>{U.checked=D}),$.children&&q($.children,D)})};N.children&&q(N.children,!1)}b.defaultChecked=O},[g,y]=z.useSunnyForm({layout:"horizontal",size:"small",labelWidth:100,showDefaultActions:!1,scrollToFirstError:!0,schema:[]}),{addEditFormSchema:x}=$e({t:n,formApi:y}),v=async w=>{w?(await p(w),b.defaultChecked=[]):(b.treeData=[],b.defaultChecked=[])};y.setState({handleValuesChange:(w,V)=>{"cSystem"in w&&!f.value&&v(w.cSystem)}});const E=w=>w.map(V=>{const N=V.label||V.name||V.text||V.cName||V.id,T={...V,label:N,expanded:!1};if(T.children&&T.children.length){const O=[],j=[];T.children.forEach(q=>{if(q.cType==="2"){const G=q.label||q.name||q.text||q.cName||q.id;O.push({...q,label:G,checked:b.defaultChecked.includes(String(q.id))})}else j.push(E([q])[0])}),T.buttonList=O,T.children=j.length?j:void 0}return T}),_=(w,V)=>{for(const N of w){if(N.buttonList&&N.buttonList.some(T=>T.id===V))return N;if(N.children){const T=_(N.children,V);if(T)return T}}return null},L=w=>{if(w.checked){b.defaultChecked.includes(w.id)||b.defaultChecked.push(w.id);const V=_(b.treeData,w.id);V&&(b.defaultChecked.includes(V.id)||b.defaultChecked.push(V.id),((O,j)=>{let q=[];const G=($,U)=>{for(const W of $)if(W.children){if(W.children.some(H=>H.id===U))return W;const K=G(W.children,U);if(K)return q.push(W.id),K}return null};let D=O;for(;D;){const $=G(j,D.id);if($)q.push($.id),D=$;else break}return q})(V,b.treeData).forEach(O=>{b.defaultChecked.includes(O)||b.defaultChecked.push(O)}))}else{const V=b.defaultChecked.indexOf(w.id);V!==-1&&b.defaultChecked.splice(V,1)}},k=(w,V,N)=>{b.expandedKeys=w},B=async()=>{l.value=!0,s.value="add",y.setState({schema:x}),y.resetForm(),b.treeData=[],b.defaultChecked=[],b.treeData=[],await e.nextTick(),a.value&&a.value.toggleMaximize()},M=async w=>{f.value=!0,s.value="edit";const V=await I.post("/core/authRole/update_init",{authRole:{id:w.id}});if(l.value=!0,await e.nextTick(),y.setState({schema:x}),y.resetForm(),V.code===200){y.setValues(V.result.role,!1),y.updateSchema([{fieldName:"cRolenumb",componentProps:{disabled:!0}}]),b.defaultChecked=(V.result.resourceidList||[]).map(String);const N=V.result.treeList||[];b.treeData=E(N),c(b.treeData),b.expandedKeys=[]}await e.nextTick(),a.value&&a.value.toggleMaximize(),f.value=!1};o({addInit:B,editInit:M,detailInit:w=>{M(w)}});const R=async()=>{const{valid:w}=await y.validate();if(!w)return!1;const N={authRole:await y.getValues(),idList:b.defaultChecked},T=await I.post(s.value==="add"?"/core/authRole/saveRole":"/core/authRole/saveUpdateRole",N);return T.code===200?(S.Message.success(T.message),l.value=!1,m("success"),!0):(S.Message.error(T.message),!1)};function C(){l.value=!1}return(w,V)=>(e.openBlock(),e.createBlock(e.unref(z.Modal),{ref_key:"modalRef",ref:a,"model-value":l.value,title:s.value==="add"?e.unref(n)("role.addTitle"):e.unref(n)("role.editTitle"),"on-before-ok":R,onClose:C},{default:e.withCtx(()=>[e.createElementVNode("div",Ad,[e.createVNode(e.unref(g)),e.createElementVNode("div",Ud,[e.createElementVNode("h4",qd,e.toDisplayString(e.unref(n)("role.resourceConfig")),1),e.createElementVNode("div",Kd,[e.createVNode(e.unref(S.Tree),{ref_key:"treeRef",ref:i,data:b.treeData,"node-key":"id",checkable:!0,"check-strictly":!0,"checked-keys":b.defaultChecked,"expanded-keys":b.expandedKeys,"field-names":{key:"id",title:"label",children:"children",disabled:"disabled"},"default-expand-all":!1,onExpand:k,onCheck:h},{extra:e.withCtx(N=>[e.createElementVNode("div",Wd,[N?.buttonList&&N.buttonList.length?(e.openBlock(),e.createElementBlock("div",Gd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.buttonList,T=>(e.openBlock(),e.createBlock(e.unref(S.Checkbox),{key:T.id,modelValue:T.checked,"onUpdate:modelValue":O=>T.checked=O,disabled:T.disabled,class:"flex-shrink-0 whitespace-nowrap",onChange:O=>L(T)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(T.label),1)]),_:2},1032,["modelValue","onUpdate:modelValue","disabled","onChange"]))),128))])):e.createCommentVNode("",!0)])]),_:1},8,["data","checked-keys","expanded-keys"])])])])]),_:1},8,["model-value","title"]))}}),Hd=e.defineComponent({__name:"RoleChooseUser",emits:["chooseUserEmit"],setup(t,{expose:o,emit:r}){const{t:n}=Y.useI18n(),l=e.ref(!1),s=e.ref([]),a=r,i=[{fieldName:"cUsernumb",label:n("user.cUsernumb"),component:"Input",componentProps:{allowClear:!0,placeholder:n("role.inputPlaceholder")},colProps:{span:12}},{fieldName:"cUsername",label:n("user.cUsername"),component:"Input",componentProps:{allowClear:!0,placeholder:n("role.inputPlaceholder")},colProps:{span:12}}],f=[{type:"checkbox",width:50,fixed:"left"},{field:"cUsernumb",title:n("user.cUsernumb"),width:120},{field:"cUsername",title:n("user.cUsername"),width:120},{field:"cDeptname",title:n("user.cDeptname"),width:120},{field:"cJobname",title:n("role.jobname"),width:120}],m=()=>{s.value=[],l.value=!0},b=c=>{a("chooseUserEmit",c)},p=async c=>{var d={authUser:{cUsernumb:c.cUsernumb||"",cUsername:c.cUsername||""},pageNo:c.pageNo,pageSize:c.pageSize};const u=await I.post("/core/authUser/selectForPage",d);return{list:u.result.records,total:u.result.total}};return o({openInit:m}),(c,d)=>(e.openBlock(),e.createBlock(e.unref(z.SunnySearchModal),{visible:l.value,"onUpdate:visible":d[0]||(d[0]=u=>l.value=u),modelValue:s.value,"onUpdate:modelValue":d[1]||(d[1]=u=>s.value=u),title:e.unref(n)("role.userSearch"),"form-schema":i,"table-columns":f,"search-api":p,"field-names":{label:"cUsername",value:"id"},onConfirm:b},null,8,["visible","modelValue","title"]))}}),lo=e.defineComponent({__name:"RoleAuth",emits:["success"],setup(t,{expose:o,emit:r}){const n=e.ref(),{t:l}=Y.useI18n(),s=e.ref(!1),a=e.ref(null),i=e.ref([]),f=r,[m,b]=xe({schema:[]}),{authFormSchema:p,authGridColumns:c}=$e({t:l,formApi:b}),[d,u]=z.useSunnyEditGrid({gridOptions:{data:[],columns:c,border:!0,size:"mini",maxHeight:400,columnConfig:{resizable:!0}}});o({openInit:async _=>{a.value=_;const L=await I.post("/core/authRole/findRoleUser",{authRole:{id:_.id}}),k=L.code===200?L.result.authUserList||[]:[];i.value=JSON.parse(JSON.stringify(k)),s.value=!0,await e.nextTick(),b.setState({schema:p}),b.resetForm(),b.setValues({cRolenumb:_.cRolenumb,cRolename:_.cRolename}),u.reloadData(k)}});const g=()=>{n.value.openInit()},y=async _=>{const L=await u.getFullData();_.forEach(k=>{Q.findIndex(L,B=>B.id===k.id)>-1?S.Message.warning(l("role.duplicateUser",{username:k.cUsername})):u.addEvent({id:k.id,cAdmin:k.cAdmin,cUsername:k.cUsername,cUsernumb:k.cUsernumb})})},x=()=>{u.deleteSelection()},v=async()=>{const{valid:_}=await b.validate();if(!_)return!1;await b.getValues();const L=await u.getFullData(),k=await u.$grid.getRemoveRecords(),B=L.filter(R=>!i.value.some(C=>C.id===R.id)),M={authRole:{id:a.value.id},authUserDelList:k,authUserInsList:B},P=await I.post("/core/authRole/saveRoleUser",M);return P.code===200?(S.Message.success(P.message),s.value=!1,f("success"),!0):(S.Message.error(P.message),!1)};function E(){s.value=!1}return(_,L)=>{const k=e.resolveComponent("a-button"),B=e.resolveComponent("a-space");return e.openBlock(),e.createBlock(e.unref(z.Modal),{"model-value":s.value,title:e.unref(l)("role.authTitle"),width:700,"on-before-ok":v,onClose:E},{default:e.withCtx(()=>[e.createVNode(e.unref(m)),e.createVNode(e.unref(d),null,{toolbar:e.withCtx(()=>[e.createVNode(B,{class:"mb-2"},{default:e.withCtx(()=>[e.createVNode(k,{type:"primary",onClick:g},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("common.create")),1)]),_:1}),e.createVNode(k,{type:"primary",onClick:x},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("common.deleteSelected")),1)]),_:1})]),_:1})]),_:1}),e.createVNode(Hd,{ref_key:"RoleChooseUserRef",ref:n,onChooseUserEmit:y},null,512)]),_:1},8,["model-value","title"])}}}),Jd={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},Qd={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},Xd={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},Yd=e.defineComponent({__name:"RoleQuery",setup(t){const o=e.ref(),r=e.ref(),{t:n}=Y.useI18n(),{searchFormSchema:l,tableColumns:s,resourceConfig:a}=$e({t:n}),i=async({page:L,formValues:k})=>{const B={pageNo:L.currentPage,pageSize:L.pageSize,authRole:k};return I.post("/core/authRole/selectForPage",B)},f={async toolbarButtonClick(L){const k=[...L.$grid.getCheckboxRecords()];switch(L.button.code){case"roleManagement/add":o.value.addInit();break;case"roleManagement/update":if(k.length!==1){S.Message.warning(n("common.selectOne"));return}o.value.editInit(k[0]);break;case"roleManagement/delete":if(k.length===0){S.Message.warning(n("role.selectDeleteRecords"));return}S.Modal.confirm({title:n("common.prompt"),content:n("role.deleteConfirm",{count:k.length}),onBeforeOk:async()=>{const B=k.map(P=>P.id),M=await I.post("/core/authRole/deleteRole",{idList:B});return M.code===200?(S.Message.success(M.message),L.$grid.commitProxy("query",{}),!0):(S.Message.error(M.message),!1)}});break;case"roleManagement/detail":if(k.length!==1){S.Message.warning(n("common.selectOne"));return}o.value.detailInit(k[0]);break;case"roleManagement/auth":if(k.length!==1){S.Message.warning(n("common.selectOne"));return}r.value.openInit(k[0]);break}}},{QueryForm:m,formApi:b,Grid:p,gridApi:c,submitting:d,handleGlobalEnter:u,searchPlanList:h,currentSearchPlan:g,resourceId:y,nResourceid:x,handleSearchPlanSearch:v,handleDefaultPlanLoaded:E,businessResumeState:_}=ce({searchFormSchema:l,tableColumns:s,resourceConfig:a,queryFunction:i,gridEvents:f});return(L,k)=>(e.openBlock(),e.createElementBlock("div",{class:"role-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:k[2]||(k[2]=e.withKeys((...B)=>e.unref(u)&&e.unref(u)(...B),["enter"])),tabindex:"-1"},[e.createElementVNode("div",Jd,[e.createElementVNode("div",Qd,[e.createVNode(e.unref(m))]),e.createElementVNode("div",Xd,[e.createVNode(e.unref(p),{class:"flex-1"})]),e.createVNode(ro,{ref_key:"RoleAddRef",ref:o,onSuccess:k[0]||(k[0]=()=>e.unref(c).commitProxy("query"))},null,512),e.createVNode(lo,{ref_key:"RoleAuthRef",ref:r,onSuccess:k[1]||(k[1]=()=>e.unref(c).commitProxy("query"))},null,512),e.createVNode(e.unref(ke),{state:e.unref(_)},null,8,["state"])])],32))}}),Zd=re(Yd,[["__scopeId","data-v-4f1fc0bd"]]);function eu(t,o){if(!Array.isArray(t))return[];const{label:r="cName",value:n="cXuhao"}=o||{};return t.map(l=>({label:String(l[r]||""),value:l[n],...l}))}const ao={loadOptions:async(t,o)=>{if(!t||t.length===0)return{};try{const r=await I.post("/core/contact/findAuthDictList",{numbList:t}),n=r?.result||r,l={};return Object.keys(n).forEach(s=>{l[s]=eu(n[s],o)}),l}catch(r){return console.error("[SelectOptionsAdapter] Failed to load options:",r),{}}}},so={loadOptions:async(t,o)=>{if(!t||t.length===0)return{};const{label:r="cExresname",value:n="cExresnum"}=o||{},l=s=>typeof r=="function"?r(s):Array.isArray(r)?r.map(a=>s[a]??"").join("-"):String(s[r]||"");try{const s=await I.post("/core/contact/findUserExresList",{numbList:t}),a=s?.result||s,i={};return Object.keys(a).forEach(f=>{const m=a[f]||[];i[f]=m.map(b=>({label:l(b),value:b[n],...b}))}),i}catch(s){return console.error("[PermissionOptionsAdapter] Failed to load options:",s),{}}}};function tu(t){return{input:"Input",select:"Select",date:"DatePicker",datetime:"TimePicker"}[t]||"Input"}function ou(t){return t.map(o=>{const r={label:o.label,fieldName:o.prop,component:tu(o.type),componentProps:{placeholder:o.meta?.placeholder||`请输入${o.label}`,...o.meta}};return o.type==="select"&&Array.isArray(o.optionlist)&&o.optionlist.length>0&&(r.componentProps.options=o.optionlist.map(n=>({label:n.cKeyname,value:n.cKeynumb}))),o.seltype==="3"&&o.selval&&(r.component="SunnyCustomizeSelect",r.componentProps={...r.componentProps,cNum:o.selval}),r})}function nu(t){return t.map(o=>({title:o.label,field:o.prop,width:o.width}))}function ru(t){return{title:t.cTitle,width:t.cWidth?isNaN(Number(t.cWidth))?t.cWidth:`${t.cWidth}px`:void 0,contentHeight:t.cHeight?isNaN(Number(t.cHeight))?t.cHeight:Number(t.cHeight):300,multiple:t.cSelectionMode!=="single",formSchema:ou(t.conditions),tableColumns:nu(t.tableCols)}}function lu(t,o){const{page:r,pageNo:n,pageSize:l,...s}=t;return{pageNo:n||r,pageSize:l,sqlNum:o,conditions:s}}function au(t){const o=t?.result||t;return{records:o?.records||o?.list||[],total:o?.total||o?.totalSize||0}}const io={loadConfig:async t=>{const o=await I.post("/core/assDialog/openInit",{cNum:t});return ru(o)},search:async t=>{const{cNum:o,...r}=t,n=lu(r,o),l=await I.post("/core/assDialog/selectForPageCommon",n);return au(l)}},su={query:async t=>{const r=(await I.post("/core/assSelect/commonQuery",t))?.result||{};return{options:r.optionList||[],config:r.assSelect||void 0}}},fe={disabled:!1,disabledOnChangeListener:!0,disabledOnInputListener:!0,emptyStateValue:void 0,businessSearchAdapter:io,customizeSelectAdapter:su,selectOptionsAdapter:ao,permissionOptionsAdapter:so,uploadConfig:void 0,apiPrefix:void 0};function iu(t={}){const{config:o,defineRules:r}=t,n={...fe,...o,businessSearchAdapter:{...fe.businessSearchAdapter,...o?.businessSearchAdapter},customizeSelectAdapter:{...fe.customizeSelectAdapter,...o?.customizeSelectAdapter},selectOptionsAdapter:{...fe.selectOptionsAdapter,...o?.selectOptionsAdapter},permissionOptionsAdapter:{...fe.permissionOptionsAdapter,...o?.permissionOptionsAdapter},uploadConfig:{...fe.uploadConfig,...o?.uploadConfig},apiPrefix:o?.apiPrefix};z.setupSunnyForm({config:n,defineRules:r})}function Te(t,o){if(Array.isArray(t)){const r=t.map(l=>`'${o[l.prop]||void 0}' ${l.comparison} '${l.value||void 0}'`),n=Q.first(t)?.logical||"&&";return r.join(` ${n} `)}else if(t&&t.type==="group"){if(!t.children||t.children.length===0)return"";const r=t.children.map(n=>{if(n.type==="group"){const l=Te(n,o);return l?`(${l})`:null}else return`'${o[n.prop]||void 0}' ${n.comparison} '${n.value||void 0}'`}).filter(n=>n);return r.length===0?"":r.join(` ${t.logical} `)}return""}function co(t){const{cName:o,cStoremethod:r,cIcon:n,cClass:l,nOrder:s,id:a,cEvent:i,cSubArea:f}=t;return{label:o,handle:r,icon:n,class:l,order:s,loading:!1,size:"mini",nButtonid:a,cEvent:i,cSubArea:f,name:o,code:r,params:JSON.stringify(t)}}function uo(t){const{cFieldtype:o,cLabel:r,cProp:n,cMeta:l,cSeltype:s,cSelval:a,cRequired:i,cPlaceholder:f,nOrder:m,cSign:b,cShow:p,nLg:c,cDefVal:d,nI18ndata:u,cDirectives:h,cDynamicShow:g,cDynamicRules:y,cDynamicDisabled:x,cWidth:v}=t,E=l?JSON.parse(l):{};var _={components:o,label:r,fieldName:n,componentProps:{placeholder:f,disabled:b==="0"},hidden:p!=="1",rules:i==="0"?"required":null,colSpan:c,defaultValue:d,order:m};return _={..._,...E},(o==="Input"||o==="Select")&&(_.componentProps.allowClear=!0),s&&a&&E.components!=="DatePicker"&&(_.componentProps.options=mt(t),s==="3"&&(_.components="SunnyCustomizeSelect",_.componentProps.cNum=a)),_.dependencies={show:L=>{const k=JSON.parse(g),B=Te(k,L);return B?new Function(`return ${B}`)():!0},required:L=>{const k=JSON.parse(y),B=Te(k,L);return B?new Function(`return ${B}`)():!0},disabled:L=>{const k=JSON.parse(x),B=Te(k,L);return B?new Function(`return ${B}`)():!1}},_}function mo(t){const{cLabel:o,cProp:r,cFieldtype:n,cMeta:l,cSeltype:s,cSelval:a,cWidth:i,nOrder:f,nBill:m,cSign:b,cRequired:p,cShow:c,cDirectives:d,cEntityTable:u,cDynamicRules:h,cDynamicDisabled:g}=t,y=l?JSON.parse(l):{};var x={title:o,field:r,width:i,...z.EditRender[n]??{},params:{required:p==="0",disabled:b==="0",visible:c==="0",order:f,nBill:m,cEntityTable:u}};return x={...y,...x},s&&a&&(x.params.options=mt(t)),x}function Le(t){const o=Q.groupBy(Q.orderBy(t.resFieldList.map(s=>({...uo(s),cArea:s.cArea})),["order"],["asc"]),"cArea"),r=Q.groupBy(Q.orderBy(t.resButtonList.map(s=>({...co(s),cArea:s.cArea,cSubArea:s.cSubArea})),["order"],["asc"]),"cArea"),n=Q.groupBy(Q.orderBy(t.resFieldList.map(s=>({...mo(s),cArea:s.cArea})),["order"],["asc"]),"cArea"),l=t.resMenu;return{resFieldList:o,resButtonList:r,resColumnList:n,resMenu:l}}function mt(t){const{cSeltype:o,cSelval:r,fieldDictList:n,fieldUserExresList:l}=t;var s=[];return o==="0"?s=n.map(a=>({label:a.cName,value:a.cXuhao,cConnkey:a.cConnkey})):o==="1"?s=X[r]:o==="2"?s=[]:o==="3"?s=[]:o==="4"&&(s=l.map(a=>({label:a.cExresnum+"-"+a.cExresname,value:a.cExresnum}))),s}function be(t,o){const r=(o||[]).find(n=>n.value==t);return r?r.label:t}function pt(t,o){console.error("[Error Report]",{error:t,context:o,timestamp:new Date().toISOString()})}function cu(t){const o=t.reason instanceof Error?t.reason:new Error(String(t.reason));pt(o,{type:"unhandledrejection",url:window.location.href,userAgent:navigator.userAgent,timestamp:new Date().toISOString()})}function du(t){const o=t.error instanceof Error?t.error:new Error(t.message);pt(o,{type:"global_error",filename:t.filename,lineno:t.lineno,colno:t.colno,url:window.location.href,userAgent:navigator.userAgent,timestamp:new Date().toISOString()})}const po=()=>({findAllByResourceid:t=>I.post("/core/assSearchplan/findAllByResourceid",t),findSearchPlanColsByPlanId:t=>I.post("/core/assSearchplan/findSearchPlanColsByPlanId",t),insert:t=>I.post("/core/assSearchplan/insert",t),update:t=>I.post("/core/assSearchplan/update",t),del:t=>I.post("/core/assSearchplan/delete",t),findDefSearchPlan:t=>I.post("/core/assSearchplan/findDefSearchPlan",t)}),ft=po();function ce(t){const{searchFormSchema:o,tableColumns:r,dataType:n,resourceConfig:l,queryFunction:s,gridEvents:a,treeConfig:i,loadMethod:f,objectToValueFields:m,fieldMappingTime:b,arrayToStringFields:p,lazy:c,autoLoad:d=!0,showCheckbox:u=!0,aggregateConfig:h,queryOnReset:g=!0}=t,{toolbarButtonClick:y,...x}=a||{},{resourceId:v,nResourceid:E,cModnumb:_}=l,L=e.ref([]),k=e.ref(void 0),B=e.ref(!1),{enhancedSchema:M}=ye(o);let P;const{enhancedSchema:R}=Ce(M,{onAutoSelect:A=>Ve(A,P)}),[C,w]=z.useSunnyForm({layout:"vertical",size:"mini",gridProps:{xGap:8,yGap:8,collapsedRows:1},commonConfig:{colProps:{span:24,sm:12,md:8,lg:6,xl:4}},collapsed:!0,showCollapseButton:!0,showDefaultActions:!0,submitOnEnter:!0,submitButtonOptions:{loading:B},actionColProps:{span:24,sm:12,md:8,lg:6,xl:4},schema:R.value,objectToValueFields:m,fieldMappingTime:b,arrayToStringFields:p});P=w;const V=e.reactive({id:"OperationLogQuery",border:!0,size:"mini",showOverflow:!0,stripe:!i&&!c,height:"auto",align:"center",scrollX:{enabled:!0,gt:20},scrollY:{enabled:!0,gt:20},rowConfig:{keyField:"id",isCurrent:!0,isHover:!0},...u&&{checkboxConfig:{highlight:!0,range:!i&&!c,reserve:!1,trigger:"row",checkStrictly:!!(i||c)}},columnConfig:{resizable:!0},pagerConfig:{enabled:!0,size:"mini",pageSize:20,pageSizes:[10,20,50,100]},toolbarConfig:{refresh:!0,zoom:!0,custom:!0},customConfig:{mode:"popup",storage:!0,showSortPutButton:!0},gridTip:`1. 表格支持本地(换电脑清空)列配置,退出登录不清空
|
|
7
7
|
2. 支持服务端排序
|
|
8
8
|
3. 支持 Tab/方向键/Shift+方向键导航
|
|
9
9
|
`,...i&&{treeConfig:{...i,lazy:i.lazy!==void 0?i.lazy:c,rowField:i.rowField||"id",hasChild:i.hasChild||"hasChildren",expandAll:i.expandAll||!1,loadMethod:i.loadMethod||(f?(A,Z)=>{f(A).then(Z).catch(()=>Z([]))}:void 0)}},...h&&{aggregateConfig:h},sortConfig:{remote:!0},filterConfig:{remote:!1},columns:u?r:r.filter(A=>A.type!=="checkbox"),proxyConfig:{seq:!0,autoLoad:!1,response:{result:"result.records",total:"result.total"},ajax:{query:async({page:A,sorts:Z},le)=>{const J=await w.getValues();return s({page:A,formValues:J,filterValues:le,sorts:Z})}}}}),N=()=>{G.commitProxy("query")},T=e.reactive({visible:!1,billValue:"",entityTable:"",nType:0,nResource:0}),O=A=>{const Z=A.$grid.getCheckboxRecords();if(Z.length!==1){S.Message.warning(ne.$t("common.selectOne"));return}const le=Z[0];K.value&&(T.billValue=le[K.value.field],T.entityTable=K.value.params?.cEntityTable||"",T.nType=K.value.params?.nBill||0,T.nResource=E,T.visible=!0)},j=async A=>{if(A.button.code==="operationLog/FindBusiness"){O(A);return}await y?.(A)},[q,G]=z.useSunnyQueryGrid({gridOptions:V,gridEvents:{sortChange:N,toolbarButtonClick:j,...x}}),D=async A=>{await w.setValues(A),await G.commitProxy("query")},$=async A=>{await w.setValues(A),d&&await G.commitProxy("query")};setTimeout(()=>{w.setState({searchPlanConfig:{enable:!0,formConfig:R.value,currentSearchPlan:k.value,searchPlanList:L.value,resourceId:v,nResourceid:E,api:ft,onSearch:D,onDefaultPlanLoaded:$,onUpdateCurrentSearchPlan:A=>{k.value=A},onUpdateSearchPlanList:A=>{L.value=A}}})},0),e.watch([L,k],([A,Z])=>{w.setState({searchPlanConfig:{...w.getState().searchPlanConfig,searchPlanList:A,currentSearchPlan:Z}})},{deep:!0}),w.setState({handleSubmit:async()=>{B.value=!0;try{await G.commitProxy("query")}finally{B.value=!1}},handleReset:async()=>{await w.resetForm(),g&&G.commitProxy("query")}});function U(A){A.target instanceof HTMLTextAreaElement||(A.preventDefault(),w.submitForm())}const W=e.ref([]),K=e.ref(r.find(A=>[1,2,3].includes(A.params?.nBill))||null),H=async()=>{if(!_){console.warn("[useList] 未配置 cModnumb,跳过资源获取");return}try{const A=await Tt({modnumb:_});if(A.code===200&&A.result){const{resButtonList:Z}=Le(A.result);W.value=Z?.searchTable||[];const le=W.value.filter(J=>!J.cSubArea);K.value&&le.push({label:ne.$t("common.queryBusinessHistory"),handle:"operationLog/FindBusiness",icon:"sunnyfont baseicon-record",order:"",loading:!1,size:"mini",billColumn:K.value,name:ne.$t("common.queryBusinessHistory"),code:"operationLog/FindBusiness",params:JSON.stringify({billColumn:K.value})}),le.length>0&&(V.toolbarConfig={...V.toolbarConfig,buttons:le})}}catch(A){console.error("[useList] 获取资源配置失败:",A)}};return e.onMounted(()=>{H()}),{QueryForm:C,formApi:w,Grid:q,gridApi:G,submitting:B,handleGlobalEnter:U,searchPlanList:L,currentSearchPlan:k,resourceId:v,nResourceid:E,resourceButtons:W,billColumn:K,businessResumeState:T,handleSearchPlanSearch:D,handleDefaultPlanLoaded:$,fetchResourceConfig:H}}function uu(t){const{resourceConfig:o,autoLoad:r=!0,formConfig:n,grid1:l,grid2:s}=t,{resourceId:a,nResourceid:i,cModnumb:f}=o,m=e.ref([]),b=e.ref(void 0),p=e.ref(!1);let c=null,d=null;if(n?.searchFormSchema?.length){const{enhancedSchema:$}=ye(n.searchFormSchema);let U;const{enhancedSchema:W}=Ce($,{onAutoSelect:A=>Ve(A,U)}),[K,H]=z.useSunnyForm({layout:"vertical",size:"mini",gridProps:{xGap:8,yGap:8,collapsedRows:1},commonConfig:{colProps:{span:24,sm:12,md:8,lg:6,xl:4}},collapsed:!0,showCollapseButton:!0,showDefaultActions:!0,submitOnEnter:!0,submitButtonOptions:{loading:p},actionColProps:{span:24,sm:12,md:8,lg:6,xl:4},schema:W.value,objectToValueFields:n.objectToValueFields,fieldMappingTime:n.fieldMappingTime,arrayToStringFields:n.arrayToStringFields});U=H,c=K,d=H,d.setState({handleSubmit:async()=>{p.value=!0;try{await B.commitProxy("query"),await T.commitProxy("query")}finally{p.value=!1}},handleReset:async()=>{await d.resetForm(),l.queryOnReset!==!1&&B.commitProxy("query"),s.queryOnReset!==!1&&T.commitProxy("query")}})}const u=e.ref(null),h=e.ref([]),{toolbarButtonClick:g,...y}=l.gridEvents||{},x=e.reactive({id:"DualListGrid1",border:!0,size:"mini",showOverflow:!0,stripe:!l.treeConfig&&!l.lazy,height:"auto",align:"center",rowConfig:{keyField:"id",isCurrent:!0,isHover:!0},...l.showCheckbox!==!1&&{checkboxConfig:{highlight:!0,range:!l.treeConfig&&!l.lazy,reserve:!1,trigger:"row",checkStrictly:!!(l.treeConfig||l.lazy)}},columnConfig:{resizable:!0},pagerConfig:{enabled:!0,size:"mini",pageSize:20,pageSizes:[10,20,50,100]},toolbarConfig:{refresh:!0,zoom:!0,custom:!0},customConfig:{mode:"popup",storage:!0,showSortPutButton:!0},gridTip:`1. 支持服务端排序
|