@sunny-base-web/effects 0.8.86 → 0.8.88
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.d.ts +9 -3
- package/dist/index.js +1 -1
- package/dist/index.mjs +6 -0
- package/package.json +10 -10
package/dist/index.d.ts
CHANGED
|
@@ -1407,8 +1407,8 @@ onSuccess?: (() => any) | undefined;
|
|
|
1407
1407
|
}>, {
|
|
1408
1408
|
id: string;
|
|
1409
1409
|
visible: boolean;
|
|
1410
|
-
parentId: string;
|
|
1411
1410
|
cExresnum: string;
|
|
1411
|
+
parentId: string;
|
|
1412
1412
|
parentName: string;
|
|
1413
1413
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
1414
1414
|
|
|
@@ -1800,6 +1800,7 @@ readonly helpMessage?: string | undefined;
|
|
|
1800
1800
|
readonly closeOnEsc?: boolean | undefined;
|
|
1801
1801
|
readonly fullscreen?: boolean | undefined;
|
|
1802
1802
|
readonly closeOnClickModal?: boolean | undefined;
|
|
1803
|
+
readonly unmountOnClose?: boolean | undefined;
|
|
1803
1804
|
readonly okText?: string | undefined;
|
|
1804
1805
|
readonly cancelText?: string | undefined;
|
|
1805
1806
|
readonly okLoading?: boolean | undefined;
|
|
@@ -1851,6 +1852,7 @@ helpMessage: string;
|
|
|
1851
1852
|
closeOnEsc: boolean;
|
|
1852
1853
|
fullscreen: boolean;
|
|
1853
1854
|
closeOnClickModal: boolean;
|
|
1855
|
+
unmountOnClose: boolean;
|
|
1854
1856
|
}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & {
|
|
1855
1857
|
beforeCreate?: (() => void) | (() => void)[];
|
|
1856
1858
|
created?: (() => void) | (() => void)[];
|
|
@@ -1880,12 +1882,13 @@ helpMessage: string;
|
|
|
1880
1882
|
closeOnEsc: boolean;
|
|
1881
1883
|
fullscreen: boolean;
|
|
1882
1884
|
closeOnClickModal: boolean;
|
|
1885
|
+
unmountOnClose: boolean;
|
|
1883
1886
|
}> & Omit<Readonly<ModalProps> & Readonly<{
|
|
1884
1887
|
onClose?: (() => any) | undefined;
|
|
1885
1888
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
1886
1889
|
onOk?: (() => any) | undefined;
|
|
1887
1890
|
"onFullscreen-change"?: ((value: boolean) => any) | undefined;
|
|
1888
|
-
}>, "toggleMaximize" | ("title" | "modelValue" | "width" | "zIndex" | "helpMessage" | "closeOnEsc" | "fullscreen" | "closeOnClickModal")> & ShallowUnwrapRef< {
|
|
1891
|
+
}>, "toggleMaximize" | ("title" | "modelValue" | "width" | "zIndex" | "helpMessage" | "closeOnEsc" | "fullscreen" | "closeOnClickModal" | "unmountOnClose")> & ShallowUnwrapRef< {
|
|
1889
1892
|
toggleMaximize: () => void;
|
|
1890
1893
|
}> & {} & ComponentCustomProperties & {} & {
|
|
1891
1894
|
$slots: {
|
|
@@ -1955,6 +1958,7 @@ readonly helpMessage?: string | undefined;
|
|
|
1955
1958
|
readonly closeOnEsc?: boolean | undefined;
|
|
1956
1959
|
readonly fullscreen?: boolean | undefined;
|
|
1957
1960
|
readonly closeOnClickModal?: boolean | undefined;
|
|
1961
|
+
readonly unmountOnClose?: boolean | undefined;
|
|
1958
1962
|
readonly okText?: string | undefined;
|
|
1959
1963
|
readonly cancelText?: string | undefined;
|
|
1960
1964
|
readonly okLoading?: boolean | undefined;
|
|
@@ -2006,6 +2010,7 @@ helpMessage: string;
|
|
|
2006
2010
|
closeOnEsc: boolean;
|
|
2007
2011
|
fullscreen: boolean;
|
|
2008
2012
|
closeOnClickModal: boolean;
|
|
2013
|
+
unmountOnClose: boolean;
|
|
2009
2014
|
}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & {
|
|
2010
2015
|
beforeCreate?: (() => void) | (() => void)[];
|
|
2011
2016
|
created?: (() => void) | (() => void)[];
|
|
@@ -2035,12 +2040,13 @@ helpMessage: string;
|
|
|
2035
2040
|
closeOnEsc: boolean;
|
|
2036
2041
|
fullscreen: boolean;
|
|
2037
2042
|
closeOnClickModal: boolean;
|
|
2043
|
+
unmountOnClose: boolean;
|
|
2038
2044
|
}> & Omit<Readonly<ModalProps> & Readonly<{
|
|
2039
2045
|
onClose?: (() => any) | undefined;
|
|
2040
2046
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
2041
2047
|
onOk?: (() => any) | undefined;
|
|
2042
2048
|
"onFullscreen-change"?: ((value: boolean) => any) | undefined;
|
|
2043
|
-
}>, "toggleMaximize" | ("title" | "modelValue" | "width" | "zIndex" | "helpMessage" | "closeOnEsc" | "fullscreen" | "closeOnClickModal")> & ShallowUnwrapRef< {
|
|
2049
|
+
}>, "toggleMaximize" | ("title" | "modelValue" | "width" | "zIndex" | "helpMessage" | "closeOnEsc" | "fullscreen" | "closeOnClickModal" | "unmountOnClose")> & ShallowUnwrapRef< {
|
|
2044
2050
|
toggleMaximize: () => void;
|
|
2045
2051
|
}> & {} & ComponentCustomProperties & {} & {
|
|
2046
2052
|
$slots: {
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<strong>${t("jobinfo.title")}:</strong>${z.title}<br/>
|
|
4
4
|
<strong>${t("jobinfo.registerType")}:</strong>${z.addressType==="0"?t("jobinfo.autoRegister"):t("jobinfo.manualEntry")}<br/>
|
|
5
5
|
<strong>${t("jobinfo.onlineAddress")}:</strong>${z.addressList||""}<br/>
|
|
6
|
-
</div>`,dangerouslyUseHTMLString:!0})}}catch(P){console.error("查询注册节点失败:",P),b.Message.error(t("jobinfo.queryFailed"))}break;case"jobinfo/rizhi":window.location.href=`/setting/dsrw/joblog?jobGroup=${p.jobGroup}&jobDesc=${encodeURIComponent(p.jobDesc)}`;break}},N=()=>{E.value?.refresh()};return(u,p)=>(A.openBlock(),A.createElementBlock("div",{class:"job-info-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:p[3]||(p[3]=A.withKeys((...M)=>A.unref(w)&&A.unref(w)(...M),["enter"])),tabindex:"-1"},[A.createElementVNode("div",lB,[A.createElementVNode("div",CB,[A.createVNode(A.unref(a))]),A.createElementVNode("div",cB,[A.createVNode(A.unref(C),{class:"flex-1"},{actionSlot:A.withCtx(({row:M})=>[(A.openBlock(!0),A.createElementBlock(A.Fragment,null,A.renderList(k(),P=>(A.openBlock(),A.createElementBlock("button",{key:P.id,type:"button",class:"text-[rgb(var(--primary-6))] hover:text-[rgb(var(--primary-5))] mr-2",onClick:z=>F(P,M)},A.toDisplayString(P.label),9,QB))),128))]),_:1})])]),A.createVNode($s,{ref_key:"formRef",ref:B,visible:n.value,"onUpdate:visible":p[0]||(p[0]=M=>n.value=M),onSuccess:N},null,8,["visible"]),A.createVNode(eB,{ref_key:"onceRef",ref:i,visible:s.value,"onUpdate:visible":p[1]||(p[1]=M=>s.value=M),onSuccess:N},null,8,["visible"]),A.createVNode(aB,{ref_key:"codeRef",ref:c,visible:r.value,"onUpdate:visible":p[2]||(p[2]=M=>r.value=M),onSuccess:N},null,8,["visible"])],32))}}),[["__scopeId","data-v-73ae3969"]]),xe=({t:e})=>{const t=[{cKeyname:e("joblog.success"),cKeynumb:"200"},{cKeyname:e("joblog.failure"),cKeynumb:"500"},{cKeyname:e("joblog.empty"),cKeynumb:"0"}],g=[{cKeyname:e("joblog.success"),cKeynumb:"200"},{cKeyname:e("joblog.failure"),cKeynumb:"500"},{cKeyname:e("joblog.failureTimeout"),cKeynumb:"502"}],o=[{fieldName:"jobGroup",label:e("joblog.executor"),component:"Select",componentProps:{placeholder:e("joblog.selectExecutor"),allowClear:!0,options:[]},colProps:{span:4}},{fieldName:"jobDesc",label:e("joblog.jobDesc"),component:"Input",componentProps:{placeholder:e("joblog.inputJobDesc"),allowClear:!0},colProps:{span:4}},{fieldName:"triggerStatus",label:e("joblog.status"),component:"Select",componentProps:{placeholder:e("joblog.selectStatus"),allowClear:!0,options:[{label:e("joblog.all"),value:"-1"},{label:e("joblog.success"),value:"1"},{label:e("joblog.failure"),value:"2"},{label:e("joblog.running"),value:"3"}]},colProps:{span:4}},{fieldName:"timeList",label:e("joblog.scheduleDate"),component:"RangePicker",componentProps:{allowClear:!0,format:"YYYY-MM-DD",valueFormat:"YYYY-MM-DD"},colProps:{span:4}}],n=[{field:"jobld",title:e("joblog.jobId")},{field:"jobDesc",title:e("joblog.jobDesc")},{field:"triggerCode",title:e("joblog.scheduleResult"),formatter:({cellValue:s})=>t.find(B=>B.cKeynumb===s)?.cKeyname||s},{field:"triggerTime",title:e("joblog.scheduleTime")},{field:"executorAddress",title:e("joblog.executorAddress")},{field:"executorHandler",title:e("joblog.executorHandler")},{field:"executorParam",title:e("joblog.executorParam")},{field:"handleDdbz",title:e("joblog.scheduleRemark"),slots:{default:"handleDdbzSlot"}},{field:"handleTime",title:e("joblog.handleTime")},{field:"handleCode",title:e("joblog.handleResult"),formatter:({cellValue:s})=>g.find(B=>B.cKeynumb===s)?.cKeyname||s},{field:"handleMsg",title:e("joblog.handleMsg"),slots:{default:"handleMsgSlot"}},{field:"handleZxrz",title:e("joblog.handleLog"),slots:{default:"handleZxrzSlot"}}];return{searchFormSchema:o,tableColumns:n,triggerCodeOptions:t,handleCodeOptions:g}},EB={resourceId:"joblog",nResourceid:583,cModnumb:"9aad5aa1-14be-4c03-934d-e9e6722cdd4f"},IB={class:"bg-[#2b2b2b] inline-block text-center w-[40px] mr-2.5 select-none"},dB={class:"inline-block whitespace-nowrap mr-2.5"},fB={class:"absolute right-2.5 bottom-2.5 flex items-end flex-wrap flex-col h-[160px] justify-evenly"},wB=A.defineComponent({__name:"LogList",props:{visible:{type:Boolean}},emits:["update:visible"],setup(e,{expose:t,emit:g}){const{t:o}=$.useI18n(),n=g,s=A.ref(!1),r=A.ref([]),B=A.ref(""),i=A.ref(!1),c=A.ref(null),I=async C=>{B.value=C,r.value=[];try{const E=await G.post("/schedule/joblog/logDetail",{fromLineNum:0,id:C});E.success&&E.data&&(r.value=E.data.content?.logContentList||[],n("update:visible",!0),A.nextTick(()=>{c.value&&(c.value.scrollTop=c.value.scrollHeight)}))}catch(E){console.error("获取日志失败:",E)}},Q=()=>{c.value&&(c.value.scrollTop=0)},a=async()=>{i.value=!0;try{const C=await G.post("/schedule/joblog/logDetail",{fromLineNum:r.value.length+1,id:B.value});if(C.success&&C.data){const E=C.data.content?.logContentList||[];r.value=r.value.concat(E),A.nextTick(()=>{c.value&&(c.value.scrollTop=c.value.scrollHeight)})}}catch(C){console.error("加载更多日志失败:",C)}finally{i.value=!1}},l=()=>{n("update:visible",!1)};return t({show:I}),(C,E)=>{const d=A.resolveComponent("a-button"),w=A.resolveComponent("a-modal");return A.openBlock(),A.createBlock(w,{visible:e.visible,"onUpdate:visible":E[1]||(E[1]=m=>n("update:visible",m)),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:A.withCtx(()=>[A.createElementVNode("div",{ref_key:"logboxRef",ref:c,class:"overflow-y-auto scroll-smooth bg-[#222]",style:A.normalizeStyle({height:s.value?"100vh":"60vh"})},[(A.openBlock(!0),A.createElementBlock(A.Fragment,null,A.renderList(r.value,(m,f)=>(A.openBlock(),A.createElementBlock("div",{key:f,class:"bg-[#222] leading-[28px] text-xs text-[#ccc] whitespace-nowrap hover:bg-[#2b2b2b]"},[A.createElementVNode("div",IB,A.toDisplayString(f+1),1),A.createElementVNode("div",dB,A.toDisplayString(m),1)]))),128))],4),A.createElementVNode("div",fB,[A.createVNode(d,{type:"primary",status:"danger",shape:"circle",onClick:l,tooltip:A.unref(o)("joblog.close")},{icon:A.withCtx(()=>[A.createVNode(A.unref(Ut))]),_:1},8,["tooltip"]),A.createVNode(d,{type:"primary",status:"danger",shape:"circle",onClick:E[0]||(E[0]=m=>s.value=!s.value),tooltip:A.unref(o)("joblog.fullscreen")},{icon:A.withCtx(()=>[A.createVNode(A.unref(so))]),_:1},8,["tooltip"]),A.createVNode(d,{type:"primary",status:"danger",shape:"circle",onClick:Q,tooltip:A.unref(o)("joblog.scrollToTop")},{icon:A.withCtx(()=>[A.createVNode(A.unref(ht))]),_:1},8,["tooltip"]),A.createVNode(d,{type:"primary",status:"danger",shape:"circle",loading:i.value,onClick:a,tooltip:A.unref(o)("joblog.scrollToBottom")},{icon:A.withCtx(()=>[A.createVNode(A.unref(yt))]),_:1},8,["loading","tooltip"])])]),_:1},8,["visible","fullscreen"])}}}),uB={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},mB={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},DB={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},pB=["onClick"],bB=["onClick"],PB=["onClick"],vB={class:"p-5"},MB=["innerHTML"],yB={class:"flex justify-center mt-4"},FB=A.defineComponent({__name:"JobLogQuery",setup(e){const{t}=$.useI18n(),{searchFormSchema:g,tableColumns:o}=xe({t}),n=A.ref(!1),s=A.ref(""),r=A.ref(!1),B=A.ref(null),i=async({page:h,formValues:k})=>{const F={pageNo:h.currentPage,pageSize:h.pageSize,xxlJobLog:k};return G.post("/schedule/joblog/selectForPage",F)},{QueryForm:c,formApi:I,Grid:Q,gridApi:a,submitting:l,handleGlobalEnter:C,searchPlanList:E,currentSearchPlan:d,resourceId:w,nResourceid:m,handleSearchPlanSearch:f,handleDefaultPlanLoaded:y}=lA({searchFormSchema:g,tableColumns:o,resourceConfig:EB,queryFunction:i}),v=h=>{s.value=h.handleDdbz||"",n.value=!0},U=h=>{b.Modal.info({title:t("joblog.handleMsgTitle"),content:h||"",width:500})},D=h=>{B.value&&B.value.show(h.jobld.toString())};return(h,k)=>{const F=A.resolveComponent("a-button"),N=A.resolveComponent("a-modal");return A.openBlock(),A.createElementBlock("div",{class:"job-log-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:k[3]||(k[3]=A.withKeys((...u)=>A.unref(C)&&A.unref(C)(...u),["enter"])),tabindex:"-1"},[A.createElementVNode("div",uB,[A.createElementVNode("div",mB,[A.createVNode(A.unref(c))]),A.createElementVNode("div",DB,[A.createVNode(A.unref(Q),{class:"flex-1"},{handleDdbzSlot:A.withCtx(({row:u})=>[A.createElementVNode("button",{type:"button",class:"text-[rgb(var(--primary-6))] hover:text-[rgb(var(--primary-5))]",onClick:p=>v(u)},A.toDisplayString(A.unref(t)("joblog.view")),9,pB)]),handleMsgSlot:A.withCtx(({row:u})=>[u.handleMsg?(A.openBlock(),A.createElementBlock("button",{key:0,type:"button",class:"text-[rgb(var(--primary-6))] hover:text-[rgb(var(--primary-5))]",onClick:p=>U(u.handleMsg)},A.toDisplayString(A.unref(t)("joblog.view")),9,bB)):A.createCommentVNode("",!0)]),handleZxrzSlot:A.withCtx(({row:u})=>[u.nShow===1?(A.openBlock(),A.createElementBlock("button",{key:0,type:"button",class:"text-[rgb(var(--primary-6))] hover:text-[rgb(var(--primary-5))]",onClick:p=>D(u)},A.toDisplayString(A.unref(t)("joblog.view")),9,PB)):A.createCommentVNode("",!0)]),_:1})])]),A.createVNode(N,{visible:n.value,"onUpdate:visible":k[1]||(k[1]=u=>n.value=u),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:A.withCtx(()=>[...k[4]||(k[4]=[A.createElementVNode("div",null,null,-1)])]),default:A.withCtx(()=>[A.createElementVNode("div",vB,[A.createElementVNode("div",{innerHTML:s.value},null,8,MB)]),A.createElementVNode("div",yB,[A.createVNode(F,{type:"primary",onClick:k[0]||(k[0]=u=>n.value=!1)},{default:A.withCtx(()=>[A.createTextVNode(A.toDisplayString(A.unref(t)("joblog.confirm")),1)]),_:1})])]),_:1},8,["visible"]),A.createVNode(wB,{ref_key:"logListRef",ref:B,visible:r.value,"onUpdate:visible":k[2]||(k[2]=u=>r.value=u)},null,8,["visible"])],32)}}}),Ve=({t:e})=>{const t=[{cKeyname:e("jobgroup.online"),cKeynumb:"1"},{cKeyname:e("jobgroup.offline"),cKeynumb:"0"}],g=[{cKeyname:e("jobgroup.autoRegister"),cKeynumb:"0"},{cKeyname:e("jobgroup.manualEntry"),cKeynumb:"1"}],o=[{fieldName:"appname",label:e("jobgroup.appname"),component:"Input",componentProps:{placeholder:e("jobgroup.inputAppname"),allowClear:!0},colProps:{span:4}},{fieldName:"title",label:e("jobgroup.title"),component:"Input",componentProps:{placeholder:e("jobgroup.inputTitle"),allowClear:!0},colProps:{span:4}}],n=[{field:"appname",title:e("jobgroup.appname")},{field:"title",title:e("jobgroup.title")},{field:"addressType",title:e("jobgroup.registerType"),formatter:({cellValue:s})=>g.find(B=>B.cKeynumb===s)?.cKeyname||s},{field:"addressList",title:e("jobgroup.onlineAddressList")},{field:"action",title:e("jobgroup.action"),fixed:"right",width:400,slots:{default:"actionSlot"}}];return{searchFormSchema:o,tableColumns:n,statusOptions:t,zcfsOpts:g}},kB={resourceId:"jobgroup",nResourceid:584,cModnumb:"bfd3d15f-f261-4e02-9f37-be3dfd7edd00"},zB={class:"flex justify-end gap-2 mt-4"},hB=A.defineComponent({__name:"JobGroupForm",props:{visible:{type:Boolean},formData:{}},emits:["update:visible","success"],setup(e,{expose:t,emit:g}){const{t:o}=$.useI18n(),n=e,s=g,r=A.ref(null),B=A.reactive({appname:"",title:"",addressType:"0",addressList:"",id:""}),i={zcfsOpts:[{cKeyname:o("jobgroup.autoRegister"),cKeynumb:"0"},{cKeyname:o("jobgroup.manualEntry"),cKeynumb:"1"}]},c=A.ref(!1);A.watch(()=>n.formData,a=>{a&&Object.assign(B,a)},{deep:!0});const I=async()=>{r.value&&r.value.validate().then(async()=>{c.value=!0;try{let a;B.id?a=await G.post("/schedule/jobgroup/update",B):a=await G.post("/schedule/jobgroup/save",B),a.success&&(b.Message.success(B.id?o("jobgroup.editSuccess"):o("jobgroup.addSuccess")),s("success"),Q())}catch(a){console.error("保存失败:",a),b.Message.error(o("jobgroup.saveFailed"))}finally{c.value=!1}})},Q=()=>{r.value&&r.value.clearValidate(),Object.assign(B,{appname:"",title:"",addressType:"0",addressList:"",id:""}),s("update:visible",!1)};return t({show:a=>{a?Object.assign(B,a):Object.assign(B,{appname:"",title:"",addressType:"0",addressList:"",id:""}),s("update:visible",!0)}}),(a,l)=>{const C=A.resolveComponent("a-input"),E=A.resolveComponent("a-form-item"),d=A.resolveComponent("a-radio"),w=A.resolveComponent("a-radio-group"),m=A.resolveComponent("a-textarea"),f=A.resolveComponent("a-form"),y=A.resolveComponent("a-button"),v=A.resolveComponent("a-modal");return A.openBlock(),A.createBlock(v,{title:B.id?A.unref(o)("jobgroup.editTitle"):A.unref(o)("jobgroup.addTitle"),visible:e.visible,"onUpdate:visible":l[4]||(l[4]=U=>s("update:visible",U)),"mask-closable":!1,closable:!1,width:"900px",footer:!1},{default:A.withCtx(()=>[A.createVNode(f,{ref_key:"formRef",ref:r,model:B,"label-width":130},{default:A.withCtx(()=>[A.createVNode(E,{label:A.unref(o)("jobgroup.appname"),field:"appname",rules:[{required:!0,message:A.unref(o)("jobgroup.inputAppname")}]},{default:A.withCtx(()=>[A.createVNode(C,{modelValue:B.appname,"onUpdate:modelValue":l[0]||(l[0]=U=>B.appname=U),placeholder:A.unref(o)("jobgroup.inputAppname")},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),A.createVNode(E,{label:A.unref(o)("jobgroup.title"),field:"title",rules:[{required:!0,message:A.unref(o)("jobgroup.inputTitle")}]},{default:A.withCtx(()=>[A.createVNode(C,{modelValue:B.title,"onUpdate:modelValue":l[1]||(l[1]=U=>B.title=U),placeholder:A.unref(o)("jobgroup.inputTitle")},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),A.createVNode(E,{label:A.unref(o)("jobgroup.registerType"),field:"addressType",rules:[{required:!0,message:A.unref(o)("jobgroup.selectRegisterType")}]},{default:A.withCtx(()=>[A.createVNode(w,{modelValue:B.addressType,"onUpdate:modelValue":l[2]||(l[2]=U=>B.addressType=U)},{default:A.withCtx(()=>[(A.openBlock(!0),A.createElementBlock(A.Fragment,null,A.renderList(i.zcfsOpts,U=>(A.openBlock(),A.createBlock(d,{key:U.cKeynumb,value:U.cKeynumb},{default:A.withCtx(()=>[A.createTextVNode(A.toDisplayString(U.cKeyname),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["label","rules"]),A.createVNode(E,{label:A.unref(o)("jobgroup.machineAddress"),field:"addressList",rules:[{required:B.addressType==="1",message:A.unref(o)("jobgroup.inputMachineAddress")}]},{default:A.withCtx(()=>[A.createVNode(m,{modelValue:B.addressList,"onUpdate:modelValue":l[3]||(l[3]=U=>B.addressList=U),rows:4,"max-rows":8,disabled:B.addressType==="0",placeholder:A.unref(o)("jobgroup.inputMachineAddressList")},null,8,["modelValue","disabled","placeholder"])]),_:1},8,["label","rules"])]),_:1},8,["model"]),A.createElementVNode("div",zB,[A.createVNode(y,{type:"primary",loading:c.value,onClick:I},{default:A.withCtx(()=>[A.createTextVNode(A.toDisplayString(A.unref(o)("jobgroup.save")),1)]),_:1},8,["loading"]),A.createVNode(y,{onClick:Q},{default:A.withCtx(()=>[A.createTextVNode(A.toDisplayString(A.unref(o)("jobgroup.cancel")),1)]),_:1})])]),_:1},8,["title","visible"])}}}),NB={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},OB={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},SB={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},UB=["onClick"],GB=nA(A.defineComponent({__name:"JobGroupQuery",setup(e){const{t}=$.useI18n(),{searchFormSchema:g,tableColumns:o}=Ve({t}),n=A.ref(!1),s=A.ref(null),r=async({page:h,formValues:k})=>{const F={pageNo:h.currentPage,pageSize:h.pageSize,xxlJobGroup:k};return G.post("/schedule/jobgroup/selectForPage",F)},B={async toolbarButtonClick(h){[...h.$grid.getCheckboxRecords()],h.button.code==="jobgroup/add"&&s.value&&s.value.show()}},{QueryForm:i,formApi:c,Grid:I,gridApi:Q,submitting:a,handleGlobalEnter:l,searchPlanList:C,currentSearchPlan:E,resourceId:d,nResourceid:w,resourceButtons:m,handleSearchPlanSearch:f,handleDefaultPlanLoaded:y}=lA({searchFormSchema:g,tableColumns:o,resourceConfig:kB,queryFunction:r,gridEvents:B}),v=h=>m.value.filter(k=>k.cSubArea==="columnTable"),U=async(h,k)=>{const{handle:F}=h;switch(F){case"jobgroup/edit":try{const N=await G.post("/schedule/jobgroup/get",{id:k.id});if(N.success&&N.data){const u=N.data;u.addressType=String(u.addressType),s.value&&s.value.show(u)}}catch(N){console.error("查询单个执行器失败:",N),b.Message.error(t("jobgroup.queryFailed"))}break;case"jobgroup/del":b.Modal.confirm({title:t("jobgroup.confirmDelete"),content:t("jobgroup.confirmDeleteSingle",{title:k.title}),onOk:async()=>{try{(await G.post("/schedule/jobgroup/remove",{id:k.id})).success&&(b.Message.success(t("jobgroup.deleteSuccess")),Q.value?.refresh())}catch(N){console.error("删除失败:",N),b.Message.error(t("jobgroup.deleteFailed"))}}});break}},D=()=>{Q.value?.refresh()};return(h,k)=>(A.openBlock(),A.createElementBlock("div",{class:"job-group-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:k[1]||(k[1]=A.withKeys((...F)=>A.unref(l)&&A.unref(l)(...F),["enter"])),tabindex:"-1"},[A.createElementVNode("div",NB,[A.createElementVNode("div",OB,[A.createVNode(A.unref(i))]),A.createElementVNode("div",SB,[A.createVNode(A.unref(I),{class:"flex-1"},{actionSlot:A.withCtx(({row:F})=>[(A.openBlock(!0),A.createElementBlock(A.Fragment,null,A.renderList(v(),N=>(A.openBlock(),A.createElementBlock("button",{key:N.id,type:"button",class:"text-[rgb(var(--primary-6))] hover:text-[rgb(var(--primary-5))] mr-2",onClick:u=>U(N,F)},A.toDisplayString(N.label),9,UB))),128))]),_:1})])]),A.createVNode(hB,{ref_key:"formRef",ref:s,visible:n.value,"onUpdate:visible":k[0]||(k[0]=F=>n.value=F),onSuccess:D},null,8,["visible"])],32))}}),[["__scopeId","data-v-69c513e0"]]),xB=A.markRaw(Y.SunnyCustomizeSelect),Le=({t:e,formApi:t})=>{const g=[{cKeyname:e("zdyxlk.backendSQL"),cKeynumb:"0"},{cKeyname:e("zdyxlk.customImplementation"),cKeynumb:"1"}],o=[{cKeyname:e("zdyxlk.dropdown"),cKeynumb:"0"},{cKeyname:e("zdyxlk.searchableDropdown"),cKeynumb:"1"}],n=[{cKeyname:e("zdyxlk.private"),cKeynumb:"0"},{cKeyname:e("zdyxlk.public"),cKeynumb:"1"}],s=[{cKeyname:e("zdyxlk.exactMatch"),cKeynumb:"0"},{cKeyname:e("zdyxlk.fuzzyMatch"),cKeynumb:"1"}],r=[{fieldName:"cNum",label:e("zdyxlk.cNum"),component:"Input",componentProps:{placeholder:e("zdyxlk.inputcNum"),allowClear:!0},colProps:{span:4}},{fieldName:"cTitle",label:e("zdyxlk.cTitle"),component:"Input",componentProps:{placeholder:e("zdyxlk.inputcTitle"),allowClear:!0},colProps:{span:4}},{fieldName:"cWork",label:e("zdyxlk.cWork"),component:xB,componentProps:{placeholder:e("zdyxlk.inputcWork"),allowClear:!0,cNum:"UserSearch1",fieldNames:{label:"cKeyname",value:"cKeyname"}},colProps:{span:4}}],B=[{type:"checkbox",width:40},{field:"cNum",title:e("zdyxlk.cNum")},{field:"nCbtype",title:e("zdyxlk.nCbtype"),formatter:({cellValue:c})=>g.find(Q=>Q.cKeynumb===c)?.cKeyname||c},{field:"cCbclass",title:e("zdyxlk.cCbclass")},{field:"cTitle",title:e("zdyxlk.cTitle")},{field:"cValcol",title:e("zdyxlk.cValcol")},{field:"cLabelcol",title:e("zdyxlk.cLabelcol")},{field:"cLabelslotcol",title:e("zdyxlk.cLabelslotcol")},{field:"nType",title:e("zdyxlk.nType"),formatter:({cellValue:c})=>o.find(Q=>Q.cKeynumb===c)?.cKeyname||c},{field:"nSearchinterval",title:e("zdyxlk.nSearchinterval")},{field:"cStaffname",title:e("zdyxlk.cStaffname")},{field:"nLimit",title:e("zdyxlk.nLimit")},{field:"nSfcommon",title:e("zdyxlk.nSfcommon"),formatter:({cellValue:c})=>n.find(Q=>Q.cKeynumb===c)?.cKeyname||c}],i=[{fieldName:"nCbtype",label:e("zdyxlk.nCbtype"),component:"Select",componentProps:{placeholder:e("zdyxlk.selectnCbtype"),options:g.map(c=>({label:c.cKeyname,value:c.cKeynumb})),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"cCbclass",label:e("zdyxlk.cCbclass"),component:"Input",componentProps:{placeholder:e("zdyxlk.inputcCbclass"),allowClear:!0},colProps:{span:8}},{fieldName:"cNum",label:e("zdyxlk.cNum"),component:"Input",componentProps:{placeholder:e("zdyxlk.inputcNum"),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"cTitle",label:e("zdyxlk.cTitle"),component:"Input",componentProps:{placeholder:e("zdyxlk.inputcTitle"),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"cValcol",label:e("zdyxlk.cValcol"),component:"Input",componentProps:{placeholder:e("zdyxlk.inputcValcol"),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"cLabelcol",label:e("zdyxlk.cLabelcol"),component:"Input",componentProps:{placeholder:e("zdyxlk.inputcLabelcol"),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"cLabelslotcol",label:e("zdyxlk.cLabelslotcol"),component:"Input",componentProps:{placeholder:e("zdyxlk.inputcLabelslotcol"),allowClear:!0},colProps:{span:8}},{fieldName:"nType",label:e("zdyxlk.nType"),component:"Select",componentProps:{placeholder:e("zdyxlk.selectnType"),options:o.map(c=>({label:c.cKeyname,value:c.cKeynumb})),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"nLikematch",label:e("zdyxlk.nLikematch"),component:"Select",componentProps:{placeholder:e("zdyxlk.selectnLikematch"),options:s.map(c=>({label:c.cKeyname,value:c.cKeynumb})),allowClear:!0},colProps:{span:8}},{fieldName:"nSearchinterval",label:e("zdyxlk.nSearchinterval"),component:"InputNumber",componentProps:{placeholder:"默认700毫秒",min:0,max:5e3,allowClear:!0},colProps:{span:8}},{fieldName:"nLimit",label:e("zdyxlk.nLimit"),component:"InputNumber",componentProps:{placeholder:"默认20",min:1,max:1e3,allowClear:!0},colProps:{span:8}},{fieldName:"nSfcommon",label:e("zdyxlk.nSfcommon"),component:"Select",componentProps:{placeholder:e("zdyxlk.selectnSfcommon"),options:n.map(c=>({label:c.cKeyname,value:c.cKeynumb})),allowClear:!0},colProps:{span:8}},{fieldName:"cPrefixUrl",label:e("zdyxlk.cPrefixUrl"),component:"Input",componentProps:{placeholder:e("zdyxlk.inputcPrefixUrl"),allowClear:!0},colProps:{span:8}}];return{searchFormSchema:r,tableColumns:B,addEditFormSchema:i,nCbtypeOptions:g,nTypeOptions:o,nSfcommonOptions:n,nLikematchOptions:s}},VB={resourceId:"zdyxlk",nResourceid:11908,cModnumb:"ZDYXLK"},LB=A.defineComponent({__name:"ZdyxlkAdd",emits:["success"],setup(e,{expose:t,emit:g}){const{t:o}=$.useI18n(),n=A.ref(!1),s=A.ref("add"),r=A.ref(!1),B=g,[i,c]=Y.useSunnyForm({layout:"vertical",size:"small",labelWidth:120,showDefaultActions:!1,scrollToFirstError:!0,schema:[]}),{addEditFormSchema:I}=Le({t:o,formApi:c});c.setState({handleValuesChange:d=>{"nCbtype"in d&&(d.nCbtype,Q(d.nCbtype))}});const Q=d=>{const w=d==="0";c.updateSchema([{fieldName:"cValcol",hidden:!w},{fieldName:"cLabelcol",hidden:!w}])};t({addInit:async()=>{n.value=!0,s.value="add",c.setState({schema:I}),c.resetForm(),c.setValues({nCbtype:"0"}),await A.nextTick(),Q("0")},editInit:async d=>{r.value=!0,s.value="edit";let w=null;try{const m=await G.post("/core/assSelect/update_init",{id:d.id});m.code===200&&m.result&&(w={...m.result},w.nCbtype!==void 0&&(w.nCbtype=String(w.nCbtype)),w.nLikematch!==void 0&&(w.nLikematch=String(w.nLikematch)),w.nSfcommon!==void 0&&(w.nSfcommon=String(w.nSfcommon)),w.nType!==void 0&&(w.nType=String(w.nType)))}catch(m){console.error("查询失败:",m),b.Message.error(o("zdyxlk.queryFailed"))}n.value=!0,await A.nextTick(),c.setState({schema:I}),c.resetForm(),w&&(c.setValues(w,!1),c.updateSchema([{fieldName:"cNum",componentProps:{disabled:!0}}]),Q(w.nCbtype)),r.value=!1}});const C=async()=>{const{valid:d}=await c.validate();if(!d)return!1;const m={...await c.getValues()};try{const f=await G.post(s.value==="add"?"/core/assSelect/insert":"/core/assSelect/update",m);return f.code===200?(b.Message.success(s.value==="add"?o("zdyxlk.addSuccess"):o("zdyxlk.editSuccess")),n.value=!1,B("success"),!0):(b.Message.error(f.message||o("zdyxlk.saveFailed")),!1)}catch(f){return console.error("保存失败:",f),b.Message.error(o("zdyxlk.saveFailed")),!1}},E=()=>{n.value=!1};return(d,w)=>(A.openBlock(),A.createBlock(A.unref(Y.Modal),{"model-value":n.value,title:s.value==="add"?A.unref(o)("zdyxlk.addTitle"):A.unref(o)("zdyxlk.editTitle"),"on-before-ok":C,onClose:E,width:"800px"},{default:A.withCtx(()=>[A.createVNode(A.unref(i))]),_:1},8,["model-value","title"]))}}),YB={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},KB={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},RB={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},jB=["onClick"],XB=nA(A.defineComponent({__name:"ZdyxlkQuery",setup(e){const t=A.ref(),{t:g}=$.useI18n(),{searchFormSchema:o,tableColumns:n}=Le({t:g}),s=async({page:U,formValues:D})=>{const h={pageNo:U.currentPage,pageSize:U.pageSize,assSelect:D},k=await G.post("/core/assSelect/selectForPage",h);return k.code===200&&k.result&&k.result.records&&(k.result.records=k.result.records.map(F=>({...F,nCbtype:F.nCbtype!==void 0?String(F.nCbtype):F.nCbtype,nType:F.nType!==void 0?String(F.nType):F.nType,nLikematch:F.nLikematch!==void 0?String(F.nLikematch):F.nLikematch,nSfcommon:F.nSfcommon!==void 0?String(F.nSfcommon):F.nSfcommon}))),k},r={async toolbarButtonClick(U){const D=[...U.$grid.getCheckboxRecords()];switch(U.button.code){case"zdyxlk/add":t.value.addInit();break;case"zdyxlk/edit":if(D.length!==1){b.Message.warning(g("common.selectOne"));return}t.value.editInit(D[0]);break;case"zdyxlk/del":if(D.length===0){b.Message.warning(g("zdyxlk.selectDeleteRecords"));return}b.Modal.confirm({title:g("zdyxlk.confirmDelete"),content:g("zdyxlk.confirmDeleteMultiple",{count:D.length}),onBeforeOk:async()=>{const h=D.map(F=>F.id),k=await G.post("/core/assSelect/delete",{idList:h});return k.code===200?(b.Message.success(k.message),U.$grid.commitProxy("query",{}),!0):(b.Message.error(k.message),!1)}});break}}},{QueryForm:B,formApi:i,Grid:c,gridApi:I,submitting:Q,handleGlobalEnter:a,searchPlanList:l,currentSearchPlan:C,resourceId:E,nResourceid:d,resourceButtons:w,handleSearchPlanSearch:m,handleDefaultPlanLoaded:f}=lA({searchFormSchema:o,tableColumns:n,resourceConfig:VB,queryFunction:s,gridEvents:r}),y=U=>w.value.filter(D=>D.cSubArea==="columnTable"),v=async(U,D)=>{const{handle:h}=U;switch(h){case"zdyxlk/edit":t.value.editInit(D);break;case"zdyxlk/del":b.Modal.confirm({title:g("zdyxlk.confirmDelete"),content:g("zdyxlk.confirmDeleteSingle",{CTitle:D.CTitle}),onOk:async()=>{try{const k=await G.post("/core/assSelect/delete",{id:D.id});k.code===200?(b.Message.success(k.message),I.value?.refresh()):b.Message.error(k.message)}catch(k){console.error("删除失败:",k),b.Message.error(g("zdyxlk.deleteFailed"))}}});break}};return(U,D)=>(A.openBlock(),A.createElementBlock("div",{class:"zdyxlk-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:D[1]||(D[1]=A.withKeys((...h)=>A.unref(a)&&A.unref(a)(...h),["enter"])),tabindex:"-1"},[A.createElementVNode("div",YB,[A.createElementVNode("div",KB,[A.createVNode(A.unref(B))]),A.createElementVNode("div",RB,[A.createVNode(A.unref(c),{class:"flex-1"},{actionSlot:A.withCtx(({row:h})=>[(A.openBlock(!0),A.createElementBlock(A.Fragment,null,A.renderList(y(),k=>(A.openBlock(),A.createElementBlock("button",{key:k.id,type:"button",class:"text-[rgb(var(--primary-6))] hover:text-[rgb(var(--primary-5))] mr-2",onClick:F=>v(k,h)},A.toDisplayString(k.label),9,jB))),128))]),_:1})])]),A.createVNode(LB,{ref_key:"ZdyxlkAddRef",ref:t,onSuccess:D[0]||(D[0]=()=>A.unref(I).commitProxy("query"))},null,512)],32))}}),[["__scopeId","data-v-2065aa57"]]),le=({t:e})=>{const t=[{cKeyname:"启用",cKeynumb:"0"},{cKeyname:"禁用",cKeynumb:"1"}],g=[{fieldName:"cModnumb",label:e("assSendoa.cModnumb"),component:"Input",componentProps:{placeholder:e("assSendoa.inputcModnumb"),allowClear:!0},colProps:{span:4}},{fieldName:"cGongsi",label:e("assSendoa.cGongsi"),component:"Input",componentProps:{placeholder:e("assSendoa.inputcGongsi"),allowClear:!0},colProps:{span:4}},{fieldName:"nSign",label:e("assSendoa.nSign"),component:"Select",componentProps:{placeholder:e("assSendoa.selectnSign"),allowClear:!0,options:t.map(s=>({label:s.cKeyname,value:s.cKeynumb}))},colProps:{span:4}},{fieldName:"cUrl",label:e("assSendoa.cUrl"),component:"Input",componentProps:{placeholder:e("assSendoa.inputcUrl"),allowClear:!0},colProps:{span:4}}],o=[{type:"checkbox",width:40},{field:"cModnumb",title:e("assSendoa.cModnumb")},{field:"cGongsi",title:e("assSendoa.cGongsi")},{field:"cLcmc",title:e("assSendoa.cLcmc")},{field:"cOalcid",title:e("assSendoa.cOalcid")},{field:"cUrl",title:e("assSendoa.cUrl")},{field:"nSign",title:e("assSendoa.nSign"),formatter:({cellValue:s})=>t.find(B=>B.cKeynumb===s)?.cKeyname||s},{field:"cCreateuserName",title:e("assSendoa.CreateuserName")},{field:"dCreatetime",title:e("assSendoa.dCreatetime")},{field:"cBeizhu",title:e("assSendoa.cBeizhu")}],n=[{fieldName:"cModnumb",label:e("assSendoa.cModnumb"),component:"Input",componentProps:{placeholder:e("assSendoa.inputcModnumb"),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"cGongsi",label:e("assSendoa.cGongsi"),component:"Input",componentProps:{placeholder:e("assSendoa.inputcGongsi"),allowClear:!0},colProps:{span:8}},{fieldName:"nSign",label:e("assSendoa.nSign"),component:"Select",componentProps:{placeholder:e("assSendoa.selectnSign"),options:t.map(s=>({label:s.cKeyname,value:s.cKeynumb})),allowClear:!0},colProps:{span:8}},{fieldName:"cLcmc",label:e("assSendoa.cLcmc"),component:"Input",componentProps:{placeholder:e("assSendoa.inputcLcmc"),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"cUrl",label:e("assSendoa.cUrl"),component:"Input",componentProps:{placeholder:e("assSendoa.inputcUrl"),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"cOalcid",label:e("assSendoa.cOalcid"),component:"Input",componentProps:{placeholder:e("assSendoa.cOalcid"),allowClear:!0},rules:"required",colProps:{span:8}}];return{searchFormSchema:g,tableColumns:o,addEditFormSchema:n,userSfqyOpts:t}},ZB={resourceId:"assSendoa",nResourceid:326,cModnumb:"066e0071-1bb5-494a-9d5e-506eb65b8c81"},Ye=A.defineComponent({__name:"AssSendoaAdd",emits:["success"],setup(e,{expose:t,emit:g}){const{t:o}=$.useI18n(),n=A.ref(!1),s=A.ref("add"),r=A.ref(!1),B=g,[i,c]=Y.useSunnyForm({layout:"vertical",size:"small",labelWidth:120,showDefaultActions:!1,scrollToFirstError:!0,schema:[]}),{addEditFormSchema:I}=le({t:o});t({addInit:async()=>{n.value=!0,s.value="add",c.setState({schema:I}),c.resetForm(),await A.nextTick()},editInit:async E=>{r.value=!0,s.value="edit";let d=null;try{const w=await G.post("/core/assSendoa/update_init",{assSendoa:{id:E.id}});w.code===200&&w.result&&(d={...w.result},d.nSign!==void 0&&(d.nSign=String(d.nSign)))}catch(w){console.error("查询失败:",w),b.Message.error(o("assSendoa.queryFailed"))}n.value=!0,await A.nextTick(),c.setState({schema:I}),c.resetForm(),d&&c.setValues(d,!1),r.value=!1}});const l=async()=>{const{valid:E}=await c.validate();if(!E)return!1;const w={assSendoa:{...await c.getValues()}};try{const m=await G.post(s.value==="add"?"/core/assSendoa/insert":"/core/assSendoa/update",w);return m.code===200?(b.Message.success(s.value==="add"?o("assSendoa.addSuccess"):o("assSendoa.editSuccess")),n.value=!1,B("success"),!0):(b.Message.error(m.message||o("assSendoa.saveFailed")),!1)}catch(m){return console.error("保存失败:",m),b.Message.error(o("assSendoa.saveFailed")),!1}},C=()=>{n.value=!1};return(E,d)=>(A.openBlock(),A.createBlock(A.unref(Y.Modal),{"model-value":n.value,title:s.value==="add"?A.unref(o)("assSendoa.addTitle"):A.unref(o)("assSendoa.editTitle"),"on-before-ok":l,onClose:C,width:"800px"},{default:A.withCtx(()=>[A.createVNode(A.unref(i))]),_:1},8,["model-value","title"]))}}),JB={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},HB={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},WB={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},TB=["onClick"],qB=nA(A.defineComponent({__name:"AssSendoaQuery",setup(e){const t=A.ref(),{t:g}=$.useI18n(),{searchFormSchema:o,tableColumns:n}=le({t:g}),s=async({page:U,formValues:D})=>{const h={pageNo:U.currentPage,pageSize:U.pageSize,assSendoa:D},k=await G.post("/core/assSendoa/selectForPage",h);return k.result&&k.result.records&&k.result.records.forEach(F=>{F.nSign!==void 0&&(F.nSign=String(F.nSign))}),k},r={async toolbarButtonClick(U){const D=[...U.$grid.getCheckboxRecords()];switch(U.button.code){case"assSendoa/add":t.value.addInit();break;case"assSendoa/edit":if(D.length!==1){b.Message.warning(g("common.selectOne"));return}t.value.editInit(D[0]);break;case"assSendoa/del":if(D.length===0){b.Message.warning(g("assSendoa.selectDeleteRecords"));return}b.Modal.confirm({title:g("assSendoa.confirmDelete"),content:g("assSendoa.confirmDeleteMultiple",{count:D.length}),onBeforeOk:async()=>{const h=D.map(F=>F.id),k=await G.post("/core/assSendoa/delete",{idList:h});return k.code===200?(b.Message.success(k.message),U.$grid.commitProxy("query",{}),!0):(b.Message.error(k.message),!1)}});break}}},{QueryForm:B,formApi:i,Grid:c,gridApi:I,submitting:Q,handleGlobalEnter:a,searchPlanList:l,currentSearchPlan:C,resourceId:E,nResourceid:d,resourceButtons:w,handleSearchPlanSearch:m,handleDefaultPlanLoaded:f}=lA({searchFormSchema:o,tableColumns:n,resourceConfig:ZB,queryFunction:s,gridEvents:r}),y=U=>w.value.filter(D=>D.cSubArea==="columnTable"),v=async(U,D)=>{const{handle:h}=U;switch(h){case"assSendoa/edit":t.value.editInit(D);break;case"assSendoa/del":b.Modal.confirm({title:g("assSendoa.confirmDelete"),content:g("assSendoa.confirmDeleteSingle",{cModnumb:D.cModnumb}),onOk:async()=>{try{const k=await G.post("/core/assSendoa/delete",{id:D.id});k.code===200?(b.Message.success(k.message),I.value?.refresh()):b.Message.error(k.message)}catch(k){console.error("删除失败:",k),b.Message.error(g("assSendoa.deleteFailed"))}}});break}};return(U,D)=>(A.openBlock(),A.createElementBlock("div",{class:"assSendoa-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:D[1]||(D[1]=A.withKeys((...h)=>A.unref(a)&&A.unref(a)(...h),["enter"])),tabindex:"-1"},[A.createElementVNode("div",JB,[A.createElementVNode("div",HB,[A.createVNode(A.unref(B))]),A.createElementVNode("div",WB,[A.createVNode(A.unref(c),{class:"flex-1"},{actionSlot:A.withCtx(({row:h})=>[(A.openBlock(!0),A.createElementBlock(A.Fragment,null,A.renderList(y(),k=>(A.openBlock(),A.createElementBlock("button",{key:k.id,type:"button",class:"text-[rgb(var(--primary-6))] hover:text-[rgb(var(--primary-5))] mr-2",onClick:F=>v(k,h)},A.toDisplayString(k.label),9,TB))),128))]),_:1})])]),A.createVNode(Ye,{ref_key:"AssSendoaAddRef",ref:t,onSuccess:D[0]||(D[0]=()=>A.unref(I).commitProxy("query"))},null,512)],32))}}),[["__scopeId","data-v-53c27ad8"]]),Ke=({t:e})=>{const t=[{fieldName:"cNum",label:e("ggcxtc.cNum"),component:"Input",componentProps:{placeholder:e("ggcxtc.inputcNum"),allowClear:!0},colProps:{span:4}},{fieldName:"cTitle",label:e("ggcxtc.cTitle"),component:"Input",componentProps:{placeholder:e("ggcxtc.inputcTitle"),allowClear:!0},colProps:{span:4}},{fieldName:"nSfcommon",label:e("ggcxtc.nSfcommon"),component:"Select",componentProps:{placeholder:e("ggcxtc.selectnSfcommon"),allowClear:!0,options:ae},colProps:{span:4}}],g=[{type:"checkbox",width:40},{field:"cNum",title:e("ggcxtc.cNum")},{field:"cTitle",title:e("ggcxtc.cTitle")},{field:"nCbtype",title:e("ggcxtc.nCbtype"),formatter:({cellValue:o})=>ke.find(s=>s.value===o)?.label||o},{field:"cCbclass",title:e("ggcxtc.cCbclass")},{field:"cCondition",title:e("ggcxtc.cCondition")},{field:"cWidth",title:e("ggcxtc.cWidth")},{field:"cHeight",title:e("ggcxtc.cHeight")},{field:"nRows",title:e("ggcxtc.nRows")},{field:"cSql",title:e("ggcxtc.cSql")},{field:"cTablecols",title:e("ggcxtc.cTablecols")},{field:"cCrenumb",title:e("ggcxtc.cCrenumb")},{field:"cCrename",title:e("ggcxtc.cCrename")},{field:"dDate",title:e("ggcxtc.dDate")},{field:"cOrder",title:e("ggcxtc.cOrder")},{field:"nSfcommon",title:e("ggcxtc.nSfcommon"),formatter:({cellValue:o})=>ae.find(s=>s.value===o)?.label||o}];return{searchFormSchema:t,tableColumns:g}},_B={resourceId:"Ggcxtc",nResourceid:11955,cModnumb:"GGCXTC"},$B=A.defineComponent({__name:"GgcxtcReview",props:{visible:{type:Boolean},cNum:{}},emits:["close"],setup(e,{emit:t}){const g=e,o=t,{t:n}=$.useI18n(),[s,r]=Y.useSunnyForm({layout:"vertical",size:"small",labelWidth:120,showDefaultActions:!1,scrollToFirstError:!0,schema:[{fieldName:"businessSearchValue",label:"业务搜索",component:"SunnyBusinessSearch",componentProps:()=>({cNum:g.cNum,placeholder:"请选择",modalProps:{multiple:!0,fieldNames:{label:"LASTNAME",value:"WORKCODE"}}}),colProps:{span:8}}]});A.watch(()=>g.visible,c=>{c&&r.resetForm()});const B=async()=>{const{valid:c}=await r.validate();return c?(o("close"),!0):!1},i=()=>{o("close")};return(c,I)=>(A.openBlock(),A.createBlock(A.unref(Y.Modal),{"model-value":e.visible,title:"预览查询弹窗","on-before-ok":B,onClose:i,width:"800px"},{default:A.withCtx(()=>[A.createVNode(A.unref(s))]),_:1},8,["model-value"]))}}),Aa={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},ea={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},ta={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},oa=["onClick"],ga=nA(A.defineComponent({__name:"GgcxtcQuery",setup(e){const{t}=$.useI18n(),{searchFormSchema:g,tableColumns:o}=Ke({t}),n=A.ref(!1),s=A.ref(""),r=async({page:D,formValues:h})=>{const k={pageNo:D.currentPage,pageSize:D.pageSize,assDialog:h},F=await G.post("/core/assDialog/selectForPage",k);return F.result&&F.result.records&&F.result.records.forEach(N=>{N.nCbtype!==void 0&&(N.nCbtype=String(N.nCbtype)),N.nSfcommon!==void 0&&(N.nSfcommon=String(N.nSfcommon))}),F},B={async toolbarButtonClick(D){const h=[...D.$grid.getCheckboxRecords()];switch(D.button.code){case"ggcxtc/add":b.Message.info("新增功能开发中");break;case"ggcxtc/edit":if(h.length!==1){b.Message.warning(t("common.selectOne"));return}b.Message.info("修改功能开发中");break;case"ggcxtc/review":if(h.length!==1){b.Message.warning(t("common.selectOne"));return}s.value=h[0].cNum,n.value=!0;break;case"ggcxtc/del":if(h.length===0){b.Message.warning(t("ggcxtc.selectDeleteRecords"));return}b.Modal.confirm({title:t("ggcxtc.confirmDelete"),content:t("ggcxtc.confirmDeleteMultiple",{count:h.length}),onBeforeOk:async()=>{const k=h.map(N=>N.id),F=await G.post("/core/assDialog/delete",{idList:k});return F.code===200?(b.Message.success(F.message),D.$grid.commitProxy("query",{}),!0):(b.Message.error(F.message),!1)}});break}}},{QueryForm:i,formApi:c,Grid:I,gridApi:Q,submitting:a,handleGlobalEnter:l,searchPlanList:C,currentSearchPlan:E,resourceId:d,nResourceid:w,resourceButtons:m,handleSearchPlanSearch:f,handleDefaultPlanLoaded:y}=lA({searchFormSchema:g,tableColumns:o,resourceConfig:_B,queryFunction:r,gridEvents:B}),v=D=>m.value.filter(h=>h.cSubArea==="columnTable"),U=async(D,h)=>{const{handle:k}=D;switch(k){case"ggcxtc/add":b.Message.info("新增功能开发中");break;case"ggcxtc/edit":b.Message.info("修改功能开发中");break;case"ggcxtc/review":s.value=h.cNum,n.value=!0;break;case"ggcxtc/del":b.Modal.confirm({title:t("ggcxtc.confirmDelete"),content:t("ggcxtc.confirmDeleteSingle",{cTitle:h.cTitle}),onOk:async()=>{try{const F=await G.post("/core/assDialog/delete",{id:h.id});F.code===200?(b.Message.success(F.message),Q.value?.refresh()):b.Message.error(F.message)}catch(F){console.error("删除失败:",F),b.Message.error(t("ggcxtc.deleteFailed"))}}});break}};return(D,h)=>(A.openBlock(),A.createElementBlock("div",{class:"ggcxtc-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:h[1]||(h[1]=A.withKeys((...k)=>A.unref(l)&&A.unref(l)(...k),["enter"])),tabindex:"-1"},[A.createElementVNode("div",Aa,[A.createElementVNode("div",ea,[A.createVNode(A.unref(i))]),A.createElementVNode("div",ta,[A.createVNode(A.unref(I),{class:"flex-1"},{actionSlot:A.withCtx(({row:k})=>[(A.openBlock(!0),A.createElementBlock(A.Fragment,null,A.renderList(v(),F=>(A.openBlock(),A.createElementBlock("button",{key:F.id,type:"button",class:"text-[rgb(var(--primary-6))] hover:text-[rgb(var(--primary-5))] mr-2",onClick:N=>U(F,k)},A.toDisplayString(F.label),9,oa))),128))]),_:1})])]),A.createVNode($B,{visible:n.value,"c-num":s.value,onClose:h[0]||(h[0]=k=>n.value=!1)},null,8,["visible","c-num"])],32))}}),[["__scopeId","data-v-1c9496cc"]]);function hA({t:e}){const t=[{fieldName:"cExresnum",label:e("otherPermissions.cExresnum"),component:"Input",componentProps:{placeholder:e("otherPermissions.inputcExresnum"),allowClear:!0},colProps:{span:6}},{fieldName:"cExresname",label:e("otherPermissions.cExresname"),component:"Input",componentProps:{placeholder:e("otherPermissions.inputcExresname"),allowClear:!0},colProps:{span:6}}],g=[{fieldName:"cExresnum",label:e("otherPermissions.cExresnum"),component:"Input",rules:"required",componentProps:{placeholder:e("otherPermissions.inputcExresnum"),allowClear:!0}},{fieldName:"cExresname",label:e("otherPermissions.cExresname"),component:"Input",rules:"required",componentProps:{placeholder:e("otherPermissions.inputcExresname"),allowClear:!0}},{fieldName:"cOrg",label:e("otherPermissions.cOrg"),component:"Select",componentProps:{placeholder:e("otherPermissions.inputcOrg"),allowClear:!0},permissionOptions:{code:"COMPANY",fieldMapping:{label:"cExresname",value:"cExresnum"}}},{fieldName:"nOrder",label:e("otherPermissions.nOrder"),component:"InputNumber",componentProps:{placeholder:e("otherPermissions.inputnOrder"),min:1,precision:0}}],o=[{type:"checkbox",width:50},{field:"cExresnum",title:e("otherPermissions.cExresnum"),minWidth:140,treeNode:!0,params:{nBill:3,cEntityTable:"AUTH_EXRES"}},{field:"cExresname",title:e("otherPermissions.cExresname"),minWidth:180},{field:"cOrg",title:e("otherPermissions.cOrg"),minWidth:150},{field:"dCredate",title:e("otherPermissions.dCredate"),width:180},{field:"cCreateName",title:e("otherPermissions.cCreateName"),width:120},{field:"nOrder",title:e("otherPermissions.nOrder"),width:80}];return{searchFormSchema:t,addFormSchema:g,tableColumns:o}}const na={resourceId:"otherPermissions",nResourceid:67,cModnumb:"db7a8e32-f20b-444b-af0f-aed54ec99532"};class ra{cache=new Map;loadingPromises=new Map;async loadOptions(t,g,o=!1){const n=Y.DEFAULT_FORM_COMMON_CONFIG.selectOptionsAdapter;if(!n?.loadOptions)return console.warn("[SelectOptionsManager] Adapter not configured"),{};if(!t||t.length===0)return{};const s=o?t:t.filter(i=>!this.cache.has(String(i)));if(s.length===0){const i={};return t.forEach(c=>{i[String(c)]=this.cache.get(String(c))||[]}),i}const r=s.map(String).sort((i,c)=>i.localeCompare(c)).join(",");let B=this.loadingPromises.get(r);B||(B=n.loadOptions(s,g),this.loadingPromises.set(r,B));try{const i=await B;i&&typeof i=="object"&&Object.keys(i).forEach(I=>{this.cache.set(I,i[I])});const c={};return t.forEach(I=>{c[String(I)]=this.cache.get(String(I))||[]}),c}finally{this.loadingPromises.delete(r)}}getOptions(t){return this.cache.get(String(t))||[]}clearCache(t){t?this.cache.delete(String(t)):this.cache.clear()}hasCache(t){return this.cache.has(String(t))}getCacheSize(){return this.cache.size}}const PA=new ra;function fA(e){const{numbList:t,fieldMapping:g,immediate:o=!0,forceReload:n=!1}=e,s=A.ref({}),r=A.ref(!1),B=async()=>{if(!(!t||t.length===0)){r.value=!0;try{const Q=await PA.loadOptions(t,g,n);s.value=Q}catch(Q){console.error("[useSelectOptions] Failed to load options:",Q)}finally{r.value=!1}}},i=Q=>s.value[String(Q)]||[],c=async Q=>{PA.clearCache(Q);const a=await PA.loadOptions([Q],g,!0);s.value={...s.value,...a}},I=Q=>{if(PA.clearCache(Q),Q){const a={...s.value};delete a[String(Q)],s.value=a}else s.value={}};return o&&t&&t.length>0&&(A.getCurrentInstance()?A.onMounted(()=>{B()}):B()),{optionsMap:s,loading:r,load:B,getOptions:i,reload:c,clearCache:I}}function wA(e,t=!0){const g=A.computed(()=>{const i=typeof e=="object"&&"value"in e?e.value:e,c=[];return i.forEach(I=>{I.selectOptions?.dictCode&&c.push({fieldName:I.fieldName||"",...I.selectOptions})}),c}),o=A.computed(()=>{const i=new Set;return g.value.forEach(c=>{i.add(c.dictCode)}),Array.from(i)}),{optionsMap:n,loading:s,load:r}=fA({numbList:o.value,fieldMapping:g.value[0]?.fieldMapping,immediate:!1}),B=A.computed(()=>(typeof e=="object"&&"value"in e?e.value:e).map(c=>{if(c.selectOptions?.dictCode){const I=c.componentProps,Q=String(c.selectOptions.dictCode);return{...c,componentProps:a=>({...typeof I=="function"?I(a):I,options:n.value[Q]||[]})}}return c}));return t&&o.value.length>0&&A.onMounted(async()=>{await r()}),{enhancedSchema:B,optionsMap:n,loading:s,load:r}}async function sa(e,t){if(!e||e.length===0)return;const{load:g}=fA({numbList:e,fieldMapping:t,immediate:!1});await g()}function Ba(e){const t=new Set;return e.forEach(g=>{g.selectOptions?.dictCode&&t.add(g.selectOptions.dictCode)}),Array.from(t)}class aa{cache=new Map;loadingPromises=new Map;async loadOptions(t,g,o=!1){const n=Y.DEFAULT_FORM_COMMON_CONFIG.permissionOptionsAdapter;if(!n?.loadOptions)return console.warn("[PermissionOptionsManager] Adapter not configured"),{};if(!t||t.length===0)return{};const s=o?t:t.filter(i=>!this.cache.has(String(i)));if(s.length===0){const i={};return t.forEach(c=>{i[String(c)]=this.cache.get(String(c))||[]}),i}const r=s.map(String).sort((i,c)=>i.localeCompare(c)).join(",");let B=this.loadingPromises.get(r);B||(B=n.loadOptions(s,g),this.loadingPromises.set(r,B));try{const i=await B;i&&typeof i=="object"&&Object.keys(i).forEach(I=>{this.cache.set(I,i[I])});const c={};return t.forEach(I=>{c[String(I)]=this.cache.get(String(I))||[]}),c}finally{this.loadingPromises.delete(r)}}getOptions(t){return this.cache.get(String(t))||[]}clearCache(t){t?this.cache.delete(String(t)):this.cache.clear()}hasCache(t){return this.cache.has(String(t))}getCacheSize(){return this.cache.size}}const vA=new aa;function Re(e){const{numbList:t,fieldMapping:g,immediate:o=!0,forceReload:n=!1}=e,s=A.ref({}),r=A.ref(!1),B=async()=>{if(!(!t||t.length===0)){r.value=!0;try{const Q=await vA.loadOptions(t,g,n);s.value=Q}catch(Q){console.error("[usePermissionOptions] Failed to load options:",Q)}finally{r.value=!1}}},i=Q=>s.value[String(Q)]||[],c=async Q=>{vA.clearCache(Q);const a=await vA.loadOptions([Q],g,!0);s.value={...s.value,...a}},I=Q=>{if(vA.clearCache(Q),Q){const a={...s.value};delete a[String(Q)],s.value=a}else s.value={}};return o&&t&&t.length>0&&(A.getCurrentInstance()?A.onMounted(()=>{B()}):B()),{optionsMap:s,loading:r,load:B,getOptions:i,reload:c,clearCache:I}}function uA(e,t={}){const{immediate:g=!0,onAutoSelect:o}=t,n=A.computed(()=>{const Q=A.isRef(e)?e.value:e,a=[];return Q.forEach(l=>{l.permissionOptions?.code&&a.push({fieldName:l.fieldName||"",...l.permissionOptions})}),console.log("[useSchemaPermissionLoader] collectDeclarations:",a),a}),s=A.computed(()=>{const Q=new Set;return n.value.forEach(a=>{Q.add(a.code)}),Array.from(Q)}),{optionsMap:r,loading:B,load:i}=Re({numbList:s.value,fieldMapping:n.value[0]?.fieldMapping,immediate:!1}),c=A.computed(()=>{const Q=A.isRef(e)?e.value:e;return console.log("[useSchemaPermissionLoader] schemaValue:",Q),console.log("[useSchemaPermissionLoader] optionsMap.value:",r.value),Q.map(a=>{if(a.permissionOptions?.code){const l=a.componentProps,C=String(a.permissionOptions.code);return{...a,componentProps:E=>({...typeof l=="function"?l(E):l,options:r.value[C]||[]})}}return a})}),I=A.computed(()=>{const Q={};return n.value.forEach(a=>{if(a.autoSelectFirst){const l=String(a.code),C=r.value[l];C&&C.length>0&&(Q[a.fieldName]=C[0].value)}}),Q});return console.log("[useSchemaPermissionLoader] immediate:",g,"codes.value.length:",s.value.length),g&&s.value.length>0&&A.onMounted(async()=>{console.log("[useSchemaPermissionLoader] onMounted triggered, calling load()"),await i();const Q=I.value;Object.keys(Q).length>0&&o&&await o(Q)}),{enhancedSchema:c,optionsMap:r,loading:B,load:i,autoSelectDefaults:I}}function la(e){const t=new Set;return e.forEach(g=>{g.permissionOptions?.code&&t.add(g.permissionOptions.code)}),Array.from(t)}async function MA(e,t){const g=Object.keys(e);if(g.length===0)return;const o=await t.getValues();for(const n of g){const s=o[n];(s==null||s==="")&&await t.setFieldValue(n,e[n])}}const je={layout:"vertical",size:"mini",labelWidth:"auto",gridProps:{xGap:8,yGap:0},commonConfig:{colProps:{span:24,lg:8,xl:6}},showDefaultActions:!1,scrollToFirstError:!0};function mA({schema:e=[],objectToValueFields:t,handleValuesChange:g,...o}={}){const{enhancedSchema:n}=wA(e);let s;const{enhancedSchema:r}=uA(n,{onAutoSelect:i=>MA(i,s)}),B=Y.useSunnyForm({...je,schema:r.value,...t?{objectToValueFields:t}:{},...g?{handleValuesChange:g}:{},...o});return s=B[1],B}const Xe=A.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(e,{emit:t}){const{t:g}=$.useI18n(),{addFormSchema:o}=hA({t:g}),n=e,s=t;A.ref(!1);const[r,B]=mA({schema:o});A.watch(()=>n.visible,Q=>{Q&&(B.resetForm(),n.cExresnum&&B.setValues({cExresparnum:n.cExresnum,id:n.id}))});const i=A.computed(()=>n.parentId&&n.parentId!=="0"?`${g("otherPermissions.addTitle")} - ${n.parentName}`:g("otherPermissions.addTitle"));async function c(){try{const{valid:Q}=await B.validate();if(!Q)return!1;const l={authExres:{...await B.getValues(),cExresparnum:n.cExresnum||"",id:n.id||""}},C=await G.post("/core/authExres/add",l);return b.Message.success(C.message||g("otherPermissions.addSuccess")),s("success"),!0}catch(Q){return console.error("新增失败:",Q),!1}}function I(){s("update:visible",!1)}return(Q,a)=>(A.openBlock(),A.createBlock(A.unref(Y.Modal),{"model-value":n.visible,title:i.value,width:700,"on-before-ok":c,"onUpdate:modelValue":a[0]||(a[0]=l=>s("update:visible",l)),onClose:I},{default:A.withCtx(()=>[A.createVNode(A.unref(r))]),_:1},8,["model-value","title"]))}}),Ze=A.defineComponent({name:"OtherPermissionsUpdate",__name:"OtherPermissionsUpdate",props:{visible:{type:Boolean,default:!1},row:{default:null}},emits:["update:visible","success"],setup(e,{emit:t}){const{t:g}=$.useI18n(),{addFormSchema:o}=hA({t:g}),n=e,s=t;A.ref(!1);const[r,B]=mA({schema:o});A.watch(()=>n.visible,Q=>{Q&&n.row&&(B.resetForm(),B.setValues({...n.row}),B.updateSchema([{fieldName:"cExresnum",componentProps:{disabled:!0}}]))});const i=A.computed(()=>g("otherPermissions.updateTitle"));async function c(){try{const{valid:Q}=await B.validate();if(!Q)return!1;const l={authExres:{...await B.getValues(),id:n.row.id,cExresparnum:n.row.cExresparnum||""}},C=await G.post("/core/authExres/edit",l);return b.Message.success(C.message||g("otherPermissions.updateSuccess")),s("success"),!0}catch(Q){return console.error("修改失败:",Q),!1}}function I(){s("update:visible",!1)}return(Q,a)=>(A.openBlock(),A.createBlock(A.unref(Y.Modal),{"model-value":n.visible,title:i.value,width:700,"on-before-ok":c,"onUpdate:modelValue":a[0]||(a[0]=l=>s("update:visible",l)),onClose:I},{default:A.withCtx(()=>[A.createVNode(A.unref(r))]),_:1},8,["model-value","title"]))}}),Ca={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},ca={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},Qa={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},ia=nA(A.defineComponent({__name:"OtherPermissionsQuery",setup(e){const{t}=$.useI18n(),{searchFormSchema:g,tableColumns:o}=hA({t}),n=async({page:z,formValues:V})=>{const L={pageNo:z.currentPage,pageSize:z.pageSize,authExres:{...V,nType:0}},X=await G.post("/core/authExres/selectForPage",L);return X.result?.records&&(X.result.records=X.result.records.map(H=>({...H,hasChildren:!0}))),X};async function s({row:z}){await i.getValues();const V={authExres:{cExresparnum:z.cExresnum}};try{return((await G.post("/core/authExres/queryChildList",V)).result?.authExresList||[]).map(H=>({...H}))}catch(L){return console.error("加载子节点失败:",L),[]}}const r={lazy:!0,rowField:"id",hasChild:"hasChildren",expandAll:!1,loadMethod:s},{QueryForm:B,formApi:i,Grid:c,gridApi:I,submitting:Q,handleGlobalEnter:a,searchPlanList:l,currentSearchPlan:C,resourceId:E,nResourceid:d,handleSearchPlanSearch:w,handleDefaultPlanLoaded:m,businessResumeState:f}=lA({searchFormSchema:g,tableColumns:o,resourceConfig:na,queryFunction:n,gridEvents:{toolbarButtonClick:({code:z})=>{z==="otherPermissions/add"?y():z==="otherPermissions/update"?v():z==="otherPermissions/enable"?U("10001"):z==="otherPermissions/disable"?U("10002"):z==="otherPermissions/del"&&D()}},treeConfig:r,lazy:!0});function y(){const z=I.getSelection();if(z.length>1){b.Message.warning(t("common.selectOne"));return}z.length===1?(u.value=z[0].cExresnum,p.value=z[0].id,F.value=z[0].id,N.value=z[0].cExresname):(u.value="",p.value="",F.value="0",N.value=""),k.value=!0}function v(){const z=I.getSelection();if(z.length!==1){b.Message.warning("请选择一条数据进行修改");return}const V=z[0];P.value=V,M.value=!0}async function U(z){const V=I.getSelection();if(V.length===0){b.Message.warning("请选择要操作的数据");return}if(V.length>1){b.Message.warning(t("common.selectOne"));return}const L=V[0];try{const X=await G.post("/core/authExres/sign",{authExres:{id:L.id,cSign:z}});b.Message.success(X.message||t("otherPermissions.signSuccess")),I.commitProxy("query")}catch(X){console.error("操作失败:",X)}}function D(){const z=I.getSelection();if(z.length===0){b.Message.warning(t("common.selectData"));return}if(z.length>1){b.Message.warning(t("common.selectOne"));return}const V=z[0];b.Modal.confirm({title:t("common.confirm"),content:t("otherPermissions.delConfirm"),okText:t("common.confirm"),cancelText:t("common.cancel"),onOk:async()=>{try{const L=await G.post("/core/authExres/delete",{authExres:{id:V.id}});b.Message.success(L.message||t("otherPermissions.delSuccess")),I.commitProxy("query")}catch(L){console.error("删除失败:",L)}}})}function h(){I.commitProxy("query")}const k=A.ref(!1),F=A.ref("0"),N=A.ref(""),u=A.ref(""),p=A.ref(""),M=A.ref(!1),P=A.ref(null);return(z,V)=>(A.openBlock(),A.createElementBlock("div",{class:"other-permissions-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:V[2]||(V[2]=A.withKeys((...L)=>A.unref(a)&&A.unref(a)(...L),["enter"])),tabindex:"-1"},[A.createElementVNode("div",Ca,[A.createElementVNode("div",ca,[A.createVNode(A.unref(B))]),A.createElementVNode("div",Qa,[A.createVNode(A.unref(c),{class:"flex-1"})])]),A.createVNode(Xe,{visible:k.value,"onUpdate:visible":V[0]||(V[0]=L=>k.value=L),"parent-id":F.value,"parent-name":N.value,"c-exresnum":u.value,id:p.value,onSuccess:h},null,8,["visible","parent-id","parent-name","c-exresnum","id"]),A.createVNode(Ze,{visible:M.value,"onUpdate:visible":V[1]||(V[1]=L=>M.value=L),row:P.value,onSuccess:h},null,8,["visible","row"]),A.createVNode(A.unref(pA),{state:A.unref(f)},null,8,["state"])],32))}}),[["__scopeId","data-v-96f076fe"]]);function Je(){return G.post("/core/assSysSetting/findAllSettings",{})}function He(e){return G.post("/core/assSysSetting/saveAllSettings",{assSysSettingList:e})}const Ea={class:"h-full w-full overflow-auto bg-[var(--color-fill-2)]"},Ia={class:"flex flex-col h-full w-full"},da={class:"flex-1 overflow-auto"},fa={class:"space-y-4"},wa={class:"grid grid-cols-1 md:grid-cols-2 gap-x-8 gap-y-4"},ua={class:"flex items-center gap-3"},ma={class:"shrink-0 w-20 text-sm text-[var(--color-text-2)]"},Da={class:"flex items-start gap-3"},pa={class:"shrink-0 w-20 pt-1.5 text-sm text-[var(--color-text-2)]"},ba={class:"flex-1"},Pa={class:"flex gap-2"},va={key:0,class:"flex flex-wrap gap-1.5 mt-2"},Ma={class:"grid grid-cols-1 lg:grid-cols-2 gap-4 items-start"},ya={class:"flex items-center justify-between"},Fa={class:"text-sm text-[var(--color-text-1)]"},ka={class:"text-xs text-[var(--color-text-4)] mt-0.5"},za={key:0,class:"mt-4 pt-4 border-t border-[var(--color-border-1)] space-y-3"},ha={class:"flex items-center gap-3"},Na={class:"shrink-0 w-20 text-sm text-[var(--color-text-2)]"},Oa={class:"flex items-center gap-3"},Sa={class:"shrink-0 w-20 text-sm text-[var(--color-text-2)]"},Ua={class:"flex items-center justify-between"},Ga={class:"text-sm text-[var(--color-text-1)]"},xa={class:"text-xs text-[var(--color-text-4)] mt-0.5"},Va={class:"shrink-0 p-2 bg-[var(--color-bg-2)] border-t border-[var(--color-border-1)]"},La={class:"flex justify-end"},Ya=A.defineComponent({__name:"SystemSetting",setup(e){const{t}=oA.useI18n(),g=A.ref(!1),o=A.ref(!1),n=A.reactive({initialPassword:"",weakPasswords:[],showSubMenuIcon:!0,showAgent:!1,agentUrl:"",agentToken:""}),s=A.ref([]),r=A.ref(""),B=A.computed(()=>n.showAgent),i=()=>{const a=r.value.trim();if(!a){b.Message.warning(t("common.systemSetting.enterWeakPassword"));return}if(s.value.some(l=>l.password===a)){b.Message.warning(t("common.systemSetting.weakPasswordExists"));return}s.value.push({id:Date.now().toString(),password:a}),n.weakPasswords=s.value.map(l=>l.password),r.value=""},c=a=>{s.value=s.value.filter(l=>l.id!==a),n.weakPasswords=s.value.map(l=>l.password)},I=async()=>{g.value=!0;try{((await Je()).result||[]).forEach(C=>{switch(C.cNum){case"InitPwd":n.initialPassword=C.cValue||"";break;case"PwdStrVal":try{const E=JSON.parse(C.cValue||"{}");E.list&&Array.isArray(E.list)&&(s.value=E.list.map((d,w)=>({id:String(w),password:d})),n.weakPasswords=E.list)}catch(E){console.error("Parse weak password config failed",E)}break;case"SubMenuIconShow":try{const E=JSON.parse(C.cValue||"{}");n.showSubMenuIcon=E.show===E.activeValue||E.show==="1"}catch(E){console.error("Parse menu icon config failed",E)}break;case"ShowAgent":try{const E=JSON.parse(C.cValue||"{}");n.showAgent=E.show===E.activeValue||E.show==="1",n.agentUrl=E.agentUrl||"",n.agentToken=E.token||""}catch(E){console.error("Parse agent config failed",E)}break}})}catch{b.Message.error(t("common.systemSetting.loadFailed"))}finally{g.value=!1}},Q=async()=>{if(n.showAgent){if(!n.agentUrl.trim()){b.Message.warning(t("common.systemSetting.enterAgentUrl"));return}if(!n.agentToken.trim()){b.Message.warning(t("common.systemSetting.enterAgentToken"));return}}o.value=!0;try{const a=[{cNum:"InitPwd",cValue:n.initialPassword},{cNum:"PwdStrVal",cValue:JSON.stringify({enabled:!0,list:n.weakPasswords})},{cNum:"SubMenuIconShow",cValue:JSON.stringify({show:n.showSubMenuIcon?"1":"0",activeText:"显示",activeValue:"1",inactiveText:"不显示",inactiveValue:"0"})},{cNum:"ShowAgent",cValue:JSON.stringify({show:n.showAgent?"1":"0",activeText:"显示",activeValue:"1",inactiveText:"不显示",inactiveValue:"0",type:"dify",token:n.agentToken,agentUrl:n.agentUrl})}];await He(a),b.Message.success(t("common.systemSetting.saveSuccess"))}catch{b.Message.error(t("common.systemSetting.saveFailed"))}finally{o.value=!1}};return I(),(a,l)=>{const C=A.resolveComponent("a-input-password"),E=A.resolveComponent("a-input"),d=A.resolveComponent("a-button"),w=A.resolveComponent("a-tag"),m=A.resolveComponent("a-card"),f=A.resolveComponent("a-switch"),y=A.resolveComponent("a-spin");return A.openBlock(),A.createElementBlock("div",Ea,[A.createVNode(y,{loading:g.value,class:"h-full w-full"},{default:A.withCtx(()=>[A.createElementVNode("div",Ia,[A.createElementVNode("div",da,[A.createElementVNode("div",fa,[A.createVNode(m,{title:A.unref(t)("common.systemSetting.securitySetting"),bordered:!1},{extra:A.withCtx(()=>[A.createVNode(A.unref(ho),{class:"text-[var(--color-text-4)]"})]),default:A.withCtx(()=>[A.createElementVNode("div",wa,[A.createElementVNode("div",ua,[A.createElementVNode("label",ma,A.toDisplayString(A.unref(t)("common.systemSetting.initialPassword")),1),A.createVNode(C,{modelValue:n.initialPassword,"onUpdate:modelValue":l[0]||(l[0]=v=>n.initialPassword=v),placeholder:A.unref(t)("common.systemSetting.initialPasswordPlaceholder"),"allow-clear":"",class:"flex-1"},null,8,["modelValue","placeholder"])]),A.createElementVNode("div",Da,[A.createElementVNode("label",pa,A.toDisplayString(A.unref(t)("common.systemSetting.weakPassword")),1),A.createElementVNode("div",ba,[A.createElementVNode("div",Pa,[A.createVNode(E,{modelValue:r.value,"onUpdate:modelValue":l[1]||(l[1]=v=>r.value=v),placeholder:A.unref(t)("common.systemSetting.weakPasswordPlaceholder"),"allow-clear":"",size:"small",onPressEnter:i},null,8,["modelValue","placeholder"]),A.createVNode(d,{type:"primary",size:"small",onClick:i},{default:A.withCtx(()=>[A.createVNode(A.unref(Ie))]),_:1})]),s.value.length>0?(A.openBlock(),A.createElementBlock("div",va,[(A.openBlock(!0),A.createElementBlock(A.Fragment,null,A.renderList(s.value,v=>(A.openBlock(),A.createBlock(w,{key:v.id,closable:"",color:"orangered",size:"small",onClose:U=>c(v.id)},{default:A.withCtx(()=>[A.createTextVNode(A.toDisplayString(v.password),1)]),_:2},1032,["onClose"]))),128))])):A.createCommentVNode("",!0)])])])]),_:1},8,["title"]),A.createElementVNode("div",Ma,[A.createVNode(m,{title:A.unref(t)("common.systemSetting.agentSetting"),bordered:!1},{extra:A.withCtx(()=>[A.createVNode(A.unref(yo),{class:"text-[var(--color-text-4)]"})]),default:A.withCtx(()=>[A.createElementVNode("div",ya,[A.createElementVNode("div",null,[A.createElementVNode("div",Fa,A.toDisplayString(A.unref(t)("common.systemSetting.enableAgent")),1),A.createElementVNode("div",ka,A.toDisplayString(A.unref(t)("common.systemSetting.enableAgentDesc")),1)]),A.createVNode(f,{modelValue:n.showAgent,"onUpdate:modelValue":l[2]||(l[2]=v=>n.showAgent=v)},null,8,["modelValue"])]),A.createVNode(A.Transition,{name:"expand"},{default:A.withCtx(()=>[B.value?(A.openBlock(),A.createElementBlock("div",za,[A.createElementVNode("div",ha,[A.createElementVNode("label",Na,A.toDisplayString(A.unref(t)("common.systemSetting.agentUrl")),1),A.createVNode(E,{modelValue:n.agentUrl,"onUpdate:modelValue":l[3]||(l[3]=v=>n.agentUrl=v),placeholder:A.unref(t)("common.systemSetting.agentUrlPlaceholder"),"allow-clear":"",class:"flex-1"},null,8,["modelValue","placeholder"])]),A.createElementVNode("div",Oa,[A.createElementVNode("label",Sa,A.toDisplayString(A.unref(t)("common.systemSetting.agentToken")),1),A.createVNode(C,{modelValue:n.agentToken,"onUpdate:modelValue":l[4]||(l[4]=v=>n.agentToken=v),placeholder:A.unref(t)("common.systemSetting.agentTokenPlaceholder"),"allow-clear":"",class:"flex-1"},null,8,["modelValue","placeholder"])])])):A.createCommentVNode("",!0)]),_:1})]),_:1},8,["title"]),A.createVNode(m,{title:A.unref(t)("common.systemSetting.interfaceSetting"),bordered:!1},{extra:A.withCtx(()=>[A.createVNode(A.unref(bo),{class:"text-[var(--color-text-4)]"})]),default:A.withCtx(()=>[A.createElementVNode("div",Ua,[A.createElementVNode("div",null,[A.createElementVNode("div",Ga,A.toDisplayString(A.unref(t)("common.systemSetting.subMenuIcon")),1),A.createElementVNode("div",xa,A.toDisplayString(A.unref(t)("common.systemSetting.subMenuIconDesc")),1)]),A.createVNode(f,{modelValue:n.showSubMenuIcon,"onUpdate:modelValue":l[5]||(l[5]=v=>n.showSubMenuIcon=v)},null,8,["modelValue"])])]),_:1},8,["title"])])])]),A.createElementVNode("div",Va,[A.createElementVNode("div",La,[A.createVNode(d,{type:"primary",loading:o.value,onClick:Q},{icon:A.withCtx(()=>[A.createVNode(A.unref($t))]),default:A.withCtx(()=>[A.createTextVNode(" "+A.toDisplayString(A.unref(t)("common.systemSetting.save")),1)]),_:1},8,["loading"])])])])]),_:1},8,["loading"])])}}}),Ka=[{label:"启用",value:"10001"},{label:"禁用",value:"10002"}],Ra=[{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}}],We=[{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}}],ja=[{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:e})=>Ka.find(g=>g.value===e)?.label||e},{field:"cCreateName",title:"创建人",width:120},{field:"dCreate",title:"创建时间",width:180},{field:"nOrder",title:"排序",width:80}],Te=[{type:"checkbox",width:50,align:"center"},{field:"key",title:"属性键",minWidth:150,...Y.EditRender.SelectRender,params:{placeholder:"请选择属性键",allowClear:!0,options:[]},selectOptions:{dictCode:"DICTATTR",fieldMapping:{label:"cName",value:"cXuhao"}},formatter:({cellValue:e,column:t})=>(t.params?.options||[]).find(n=>n.value===e)?.label||e,filters:[{data:{checks:[],sVal:"",sMenu:"",fType1:"",fVal1:"",fMode:"and",fType2:"",fVal2:""}}],filterRender:{name:"FilterCombination"}},{field:"value",title:"属性值",minWidth:200,...Y.EditRender.InputRender,params:{placeholder:"请输入属性值",allowClear:!0},filters:[{data:{checks:[],sVal:"",sMenu:"",fType1:"",fVal1:"",fMode:"and",fType2:"",fVal2:""}}],filterRender:{name:"FilterCombination"}}],Xa=[{field:"cXuhao",title:"子级数据字典编号",minWidth:200,...Y.EditRender.InputRender,params:{placeholder:"请输入子级数据字典编号",allowClear:!0,disabled:!0}},{field:"cName",title:"子级数据字典名称",minWidth:200,...Y.EditRender.InputRender,params:{placeholder:"请输入子级数据字典名称",allowClear:!0}},{field:"nOrder",title:"子级数据字典排序",minWidth:150,...Y.EditRender.InputRender,params:{placeholder:"请输入排序",allowClear:!0}}],qe={key:[{required:!0,message:"请输入属性键"}]},_e=[{code:"insert",name:"添加属性"},{code:"remove",name:"删除"}],$e=[{title:"额外属性",type:"grid",gridConfig:{columns:Te,editRules:qe,toolbarButtons:_e}},{title:"子级数据字典",type:"grid",gridConfig:{columns:Xa,editRules:{},toolbarButtons:[]}}],Za={resourceId:"dataDictionary",nResourceid:62,cModnumb:"40577f0e-1c19-4fa6-bb88-d247fff5e32a"};function Ce({formSchema:e=[],tableColumns:t=[],tableEditRules:g={},tableToolbarButtons:o=[],objectToValueFields:n,aggregateConfig:s,gridEvents:r}={}){const{enhancedSchema:B}=wA(e);let i;const{enhancedSchema:c}=uA(B,{onAutoSelect:v=>MA(v,i)}),Q=(()=>{const v=new Set;return t.forEach(U=>{U.selectOptions?.dictCode&&v.add(U.selectOptions.dictCode)}),Array.from(v)})(),{optionsMap:a,load:l}=fA({numbList:Q,immediate:!1});Q.length>0&&l();const[C,E]=Y.useSunnyForm({layout:"horizontal",size:"mini",labelWidth:100,gridProps:{xGap:0,yGap:0},showDefaultActions:!1,scrollToFirstError:!0,schema:c.value,...n?{objectToValueFields:n}:{}});i=E;const d=v=>v.map(U=>{if(U.selectOptions?.dictCode){const D=String(U.selectOptions.dictCode),h=a.value[D]||[];return{...U,params:{...U.params,options:h}}}return U}),w=A.reactive({id:"meta-grid",columns:d(t),data:[],size:"mini",editRules:g,height:"auto",clipConfig:Y.createEditableClipConfig(),toolbarConfig:{enabled:!0,zoom:!0,custom:!0,buttons:o},zoomConfig:{enabled:!0},columnConfig:{resizable:!0},customConfig:{storage:!0,mode:"popup",showSortPutButton:!0,visibleMethod:v=>!(v.column.type==="checkbox"||v.column.type==="seq")},...s&&{aggregateConfig:s}});A.watch(()=>a.value,()=>{w.columns=d(t)},{deep:!0});const[m,f]=Y.useSunnyEditGrid({gridOptions:w,gridEvents:r}),y=f.reloadData.bind(f);return f.reloadData=v=>(w.data=v,y(v)),[C,E,m,f]}const Ja=A.defineComponent({name:"DataDictionaryAdd",__name:"DataDictionaryAdd",props:{visible:{type:Boolean,default:!1},parentId:{default:"0"},parentName:{default:""}},emits:["update:visible","success"],setup(e,{emit:t}){const g=e,o=t;A.ref(!1);const[n,s,r,B]=Ce({formSchema:We,tableColumns:Te,tableEditRules:qe,tableToolbarButtons:_e});A.watch(()=>g.visible,Q=>{Q&&(s.resetForm(),s.setValues({parentName:g.parentName||"无"}),B.reloadData([]))});const i=A.computed(()=>g.parentId&&g.parentId!=="0"?`新增子级字典 - ${g.parentName}`:"新增根级字典");async function c(){try{const{valid:Q}=await s.validate();if(!Q||await B.validate())return!1;const l=await B.getFullData(),C=l.filter(y=>y.key).map(y=>y.key),E=new Set(C);if(C.length!==E.size)return b.Message.warning("属性键不能重复"),!1;const d=await s.getValues(),w={};l.forEach(y=>{y.key&&(w[y.key]=y.value||"")});const m={authDict:{cXuhao:d.cXuhao,cName:d.cName,cSign:d.cSign,nParent:g.parentId||"0",nOrder:d.nOrder||0,cMeta:JSON.stringify(w)}},f=await G.post("/core/authDict/add",m);return b.Message.success(f.message),o("success"),!0}catch(Q){return console.error("新增失败:",Q),!1}}function I(){o("update:visible",!1)}return(Q,a)=>(A.openBlock(),A.createBlock(A.unref(Y.Modal),{"model-value":g.visible,title:i.value,width:700,"on-before-ok":c,"onUpdate:modelValue":a[0]||(a[0]=l=>o("update:visible",l)),onClose:I},{default:A.withCtx(()=>[A.createVNode(A.unref(n)),A.createVNode(A.unref(r),{id:"metaGrid",border:"","max-height":"300"})]),_:1},8,["model-value","title"]))}});function ce({formSchema:e=[],tabsConfig:t=[],objectToValueFields:g}={}){const{enhancedSchema:o}=wA(e);let n;const{enhancedSchema:s}=uA(o,{onAutoSelect:C=>MA(C,n)}),B=(()=>{const C=new Set;return t.forEach(d=>{d.type==="grid"&&d.gridConfig&&d.gridConfig.columns.forEach(w=>{w.selectOptions?.dictCode&&C.add(w.selectOptions.dictCode)})}),Array.from(C)})(),{optionsMap:i,load:c}=fA({numbList:B,immediate:!1});B.length>0&&c();const[I,Q]=Y.useSunnyForm({layout:"horizontal",size:"small",labelWidth:100,gridProps:{xGap:0,yGap:0},showDefaultActions:!1,scrollToFirstError:!0,schema:s.value,...g?{objectToValueFields:g}:{}});n=Q;const a=A.shallowRef([]),l=A.ref([]);return t.forEach((C,E)=>{if(C.type==="grid"&&C.gridConfig){const d=A.reactive({id:`grid-${E}`,columns:C.gridConfig.columns,data:[],editRules:C.gridConfig.editRules,height:"auto",clipConfig:Y.createEditableClipConfig(),toolbarConfig:{enabled:C.gridConfig.toolbarButtons&&C.gridConfig.toolbarButtons.length>0,zoom:!0,custom:!0,buttons:C.gridConfig.toolbarButtons||[]},zoomConfig:{enabled:!0},customConfig:{storage:!0,mode:"popup",visibleMethod:y=>!(y.column.type==="checkbox"||y.column.type==="seq")},...C.gridConfig.aggregateConfig&&{aggregateConfig:C.gridConfig.aggregateConfig}});A.watch(()=>i.value,y=>{d.columns=(d.columns||[]).map(v=>{if(v.selectOptions?.dictCode){const U=String(v.selectOptions.dictCode),D=y[U]||[];return{...v,params:{...v.params,options:D}}}return v})},{deep:!0});const[w,m]=Y.useSunnyEditGrid({gridOptions:d}),f={...m,reloadData:y=>(d.data=y,m.reloadData(y)),validate:()=>m.validate(),getFullData:()=>m.getFullData()};a.value.push(A.markRaw(w)),l.value.push(f)}}),[I,Q,a,l]}const Ha=A.defineComponent({name:"DataDictionaryUpdate",__name:"DataDictionaryUpdate",props:{visible:{type:Boolean,default:!1},row:{default:void 0}},emits:["update:visible","success"],setup(e,{emit:t}){const{TabPane:g}=b.Tabs,o=e,n=t;A.ref(!1);const s=A.ref(0),[r,B,i,c]=ce({formSchema:We,tabsConfig:$e});A.watch(()=>o.visible,async l=>{if(l&&o.row){await A.nextTick(),B.resetForm(),c.value[0].reloadData([]);try{const E=(await G.post("/core/authDict/editInit",{authDict:{id:o.row.id}})).result;if(E){if(B.setValues({cXuhao:E.authDict.cXuhao,cName:E.authDict.cName,cSign:E.authDict.cSign,nOrder:E.authDict.nOrder}),E.authDict.cMeta)try{const d=JSON.parse(E.authDict.cMeta),w=Object.keys(d).map(m=>({key:m,value:d[m]}));c.value[0].reloadData(w)}catch(d){console.error("解析额外属性失败:",d)}E.childList&&E.childList.length>0?c.value[1].reloadData(E.childList):c.value[1].reloadData([])}}catch(C){console.error("加载数据失败:",C),b.Message.error("加载数据失败")}}});const I=A.computed(()=>"修改字典");async function Q(){try{const{valid:l}=await B.validate();if(!l||await c.value[0].validate())return!1;const E=await c.value[0].getFullData(),d=E.filter(D=>D.key).map(D=>D.key),w=new Set(d);if(d.length!==w.size)return b.Message.warning("属性键不能重复"),!1;const m=await B.getValues(),f={};E.forEach(D=>{D.key&&(f[D.key]=D.value||"")});const y=await c.value[1].getFullData(),v={authDict:{id:o.row?.id,cXuhao:m.cXuhao,cName:m.cName,cSign:m.cSign,nOrder:m.nOrder||0,cMeta:JSON.stringify(f),nParent:o.row?.nParent||0,nType:o.row?.nType||1},authDictList:y},U=await G.post("/core/authDict/edit",v);return b.Message.success(U.message),n("success"),!0}catch(l){return console.error("修改失败:",l),!1}}function a(){n("update:visible",!1)}return(l,C)=>(A.openBlock(),A.createBlock(A.unref(Y.Modal),{"model-value":o.visible,title:I.value,width:700,"on-before-ok":Q,"onUpdate:modelValue":C[1]||(C[1]=E=>n("update:visible",E)),onClose:a},{default:A.withCtx(()=>[A.createVNode(A.unref(r)),A.createVNode(A.unref(b.Tabs),{modelValue:s.value,"onUpdate:modelValue":C[0]||(C[0]=E=>s.value=E)},{default:A.withCtx(()=>[(A.openBlock(!0),A.createElementBlock(A.Fragment,null,A.renderList(A.unref($e),(E,d)=>(A.openBlock(),A.createBlock(A.unref(g),{key:d,title:E.title},{default:A.withCtx(()=>[(A.openBlock(),A.createBlock(A.resolveDynamicComponent(A.unref(i)[d]),{id:`grid-${d}`,border:"","max-height":"300"},null,8,["id"]))]),_:2},1032,["title"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["model-value","title"]))}}),Wa={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},Ta={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},qa={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},_a=nA(A.defineComponent({__name:"DataDictionaryQuery",setup(e){const t=async({page:N,formValues:u})=>{const p={pageNo:N.currentPage,pageSize:N.pageSize,authDict:{cSign:u.cSign||"",cXuhao:u.cXuhao||"",cName:u.cName||"",nParent:0}},M=await G.post("/core/authDict/selectForPage",p);return M.result?.records&&(M.result.records=M.result.records.map(P=>({...P,hasChildren:!0}))),M};async function g({row:N}){const p={pageNo:1,pageSize:9999,authDict:{...await s.getValues(),nParent:N.id}};try{return((await G.post("/core/authDict/selectForPage",p)).result?.records||[]).map(z=>({...z,hasChildren:!0}))}catch(M){return console.error("加载子节点失败:",M),[]}}const o={lazy:!0,rowField:"id",hasChild:"hasChildren",expandAll:!1,loadMethod:g},{QueryForm:n,formApi:s,Grid:r,gridApi:B,submitting:i,handleGlobalEnter:c,searchPlanList:I,currentSearchPlan:Q,resourceId:a,nResourceid:l,handleSearchPlanSearch:C,handleDefaultPlanLoaded:E,businessResumeState:d}=lA({searchFormSchema:Ra,tableColumns:ja,resourceConfig:Za,queryFunction:t,gridEvents:{toolbarButtonClick:({code:N})=>{N==="dataDictionary/add"?U():N==="dataDictionary/update"?D():N==="dataDictionary/enable"?h("10001"):N==="dataDictionary/disable"?h("10002"):N==="dataDictionary/del"&&k()}},treeConfig:o,lazy:!0}),w=A.ref(!1),m=A.ref("0"),f=A.ref(""),y=A.ref(!1),v=A.ref(void 0);function U(){const N=B.getSelection();if(N.length>1){b.Message.warning("最多只能选择一条数据作为父级");return}N.length===1?(m.value=N[0].id,f.value=N[0].cName):(m.value="0",f.value=""),w.value=!0}function D(){const N=B.getSelection();if(N.length===0){b.Message.warning("请选择要修改的数据");return}if(N.length>1){b.Message.warning("一次只能修改一条数据");return}v.value=N[0],y.value=!0}async function h(N){const u=B.getSelection();if(u.length===0){b.Message.warning("请选择要操作的数据");return}if(u.length>1){b.Message.warning("一次只能操作一条数据");return}const p=u[0],M=N==="10001"?"启用":"禁用";try{const P=await G.post("/core/authDict/sign",{authDict:{id:p.id,cSign:N}});b.Message.success(P.message||`${M}成功`),B.commitProxy("query")}catch(P){console.error(`${M}失败:`,P)}}function k(){const N=B.getSelection();if(N.length===0){b.Message.warning("请选择要删除的数据");return}if(N.length>1){b.Message.warning("一次只能删除一条数据");return}const u=N[0];b.Modal.confirm({title:"确认删除",content:`确定要删除「${u.cName}」吗?`,okText:"确定",cancelText:"取消",onOk:async()=>{try{const p=await G.post("/core/authDict/delete",{authDict:{id:u.id}});b.Message.success(p.message||"删除成功"),B.commitProxy("query")}catch(p){console.error("删除失败:",p)}}})}function F(){B.commitProxy("query")}return(N,u)=>(A.openBlock(),A.createElementBlock("div",{class:"data-dictionary-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:u[2]||(u[2]=A.withKeys((...p)=>A.unref(c)&&A.unref(c)(...p),["enter"])),tabindex:"-1"},[A.createElementVNode("div",Wa,[A.createElementVNode("div",Ta,[A.createVNode(A.unref(n))]),A.createElementVNode("div",qa,[A.createVNode(A.unref(r),{class:"flex-1"})])]),A.createVNode(Ja,{visible:w.value,"onUpdate:visible":u[0]||(u[0]=p=>w.value=p),"parent-id":m.value,"parent-name":f.value,onSuccess:F},null,8,["visible","parent-id","parent-name"]),A.createVNode(Ha,{visible:y.value,"onUpdate:visible":u[1]||(u[1]=p=>y.value=p),row:v.value,onSuccess:F},null,8,["visible","row"]),A.createVNode(A.unref(pA),{state:A.unref(d)},null,8,["state"])],32))}}),[["__scopeId","data-v-4940c6dd"]]),$a=[{label:"启用",value:"10001"},{label:"禁用",value:"10002"}],Al=[{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}}],At=[{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}}],el=[{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:e})=>$a.find(g=>g.value===e)?.label||e},{field:"cCreateName",title:"创建人",width:120},{field:"dCreate",title:"创建时间",width:180},{field:"nOrder",title:"排序",width:80}],et=[{type:"checkbox",width:50,align:"center"},{field:"key",title:"属性键",minWidth:150,...Y.EditRender.SelectRender,params:{placeholder:"请选择属性键",allowClear:!0,options:[]},selectOptions:{dictCode:"DICTATTR",fieldMapping:{label:"cName",value:"cXuhao"}}},{field:"value",title:"属性值",minWidth:200,...Y.EditRender.InputRender,params:{placeholder:"请输入属性值",allowClear:!0}}],tl=[{field:"cXuhao",title:"子级数据字典编号",minWidth:200,...Y.EditRender.InputRender,params:{placeholder:"请输入子级数据字典编号",allowClear:!0,disabled:!0}},{field:"cName",title:"子级数据字典名称",minWidth:200,...Y.EditRender.InputRender,params:{placeholder:"请输入子级数据字典名称",allowClear:!0}},{field:"nOrder",title:"子级数据字典排序",minWidth:150,...Y.EditRender.InputRender,params:{placeholder:"请输入排序",allowClear:!0}}],tt={key:[{required:!0,message:"请输入属性键"}]},ot=[{code:"insert",name:"添加属性"},{code:"remove",name:"删除"}],gt=[{title:"额外属性",type:"grid",gridConfig:{columns:et,editRules:tt,toolbarButtons:ot}},{title:"子级数据字典",type:"grid",gridConfig:{columns:tl,editRules:{},toolbarButtons:[]}}],ol={resourceId:"ywsjzd",nResourceid:161,cModnumb:"b2a3c6ba-d6d8-4d51-ad78-887f05b9e56b"},gl=A.defineComponent({name:"YwsjzdAdd",__name:"YwsjzdAdd",props:{visible:{type:Boolean,default:!1},parentId:{default:"0"},parentName:{default:""}},emits:["update:visible","success"],setup(e,{emit:t}){const g=e,o=t;A.ref(!1);const[n,s,r,B]=Ce({formSchema:At,tableColumns:et,tableEditRules:tt,tableToolbarButtons:ot});A.watch(()=>g.visible,Q=>{Q&&(s.resetForm(),s.setValues({parentName:g.parentName||"无"}),B.reloadData([]))});const i=A.computed(()=>g.parentId&&g.parentId!=="0"?`新增子级字典 - ${g.parentName}`:"新增根级字典");async function c(){try{const{valid:Q}=await s.validate();if(!Q||await B.validate())return!1;const l=await B.getFullData(),C=l.filter(y=>y.key).map(y=>y.key),E=new Set(C);if(C.length!==E.size)return b.Message.warning("属性键不能重复"),!1;const d=await s.getValues(),w={};l.forEach(y=>{y.key&&(w[y.key]=y.value||"")});const m={authDict:{cXuhao:d.cXuhao,cName:d.cName,cSign:d.cSign,nParent:g.parentId||"0",nOrder:d.nOrder||0,cMeta:JSON.stringify(w)}},f=await G.post("/core/authDict/addBS",m);return b.Message.success(f.message),o("success"),!0}catch(Q){return console.error("新增失败:",Q),!1}}function I(){o("update:visible",!1)}return(Q,a)=>(A.openBlock(),A.createBlock(A.unref(Y.Modal),{"model-value":g.visible,title:i.value,width:700,"on-before-ok":c,"onUpdate:modelValue":a[0]||(a[0]=l=>o("update:visible",l)),onClose:I},{default:A.withCtx(()=>[A.createVNode(A.unref(n)),A.createVNode(A.unref(r),{id:"metaGrid",border:"","max-height":"300"})]),_:1},8,["model-value","title"]))}}),nl=A.defineComponent({name:"YwsjzdUpdate",__name:"YwsjzdUpdate",props:{visible:{type:Boolean,default:!1},row:{default:void 0}},emits:["update:visible","success"],setup(e,{emit:t}){const{TabPane:g}=b.Tabs,o=e,n=t;A.ref(!1);const s=A.ref(0),[r,B,i,c]=ce({formSchema:At,tabsConfig:gt});A.watch(()=>o.visible,async l=>{if(l&&o.row){await A.nextTick(),B.resetForm(),c.value[0].reloadData([]);try{const E=(await G.post("/core/authDict/editInit",{authDict:{id:o.row.id}})).result;if(E){if(B.setValues({cXuhao:E.authDict.cXuhao,cName:E.authDict.cName,cSign:E.authDict.cSign,nOrder:E.authDict.nOrder}),E.authDict.cMeta)try{const d=JSON.parse(E.authDict.cMeta),w=Object.keys(d).map(m=>({key:m,value:d[m]}));c.value[0].reloadData(w)}catch(d){console.error("解析额外属性失败:",d)}E.childList&&E.childList.length>0?c.value[1].reloadData(E.childList):c.value[1].reloadData([])}}catch(C){console.error("加载数据失败:",C),b.Message.error("加载数据失败")}}});const I=A.computed(()=>"修改字典");async function Q(){try{const{valid:l}=await B.validate();if(!l||await c.value[0].validate())return!1;const E=await c.value[0].getFullData(),d=E.filter(D=>D.key).map(D=>D.key),w=new Set(d);if(d.length!==w.size)return b.Message.warning("属性键不能重复"),!1;const m=await B.getValues(),f={};E.forEach(D=>{D.key&&(f[D.key]=D.value||"")});const y=await c.value[1].getFullData(),v={authDict:{id:o.row?.id,cXuhao:m.cXuhao,cName:m.cName,cSign:m.cSign,nOrder:m.nOrder||0,cMeta:JSON.stringify(f),nParent:o.row?.nParent||0,nType:o.row?.nType||1},authDictList:y},U=await G.post("/core/authDict/editBS",v);return b.Message.success(U.message),n("success"),!0}catch(l){return console.error("修改失败:",l),!1}}function a(){n("update:visible",!1)}return(l,C)=>(A.openBlock(),A.createBlock(A.unref(Y.Modal),{"model-value":o.visible,title:I.value,width:700,"on-before-ok":Q,"onUpdate:modelValue":C[1]||(C[1]=E=>n("update:visible",E)),onClose:a},{default:A.withCtx(()=>[A.createVNode(A.unref(r)),A.createVNode(A.unref(b.Tabs),{modelValue:s.value,"onUpdate:modelValue":C[0]||(C[0]=E=>s.value=E)},{default:A.withCtx(()=>[(A.openBlock(!0),A.createElementBlock(A.Fragment,null,A.renderList(A.unref(gt),(E,d)=>(A.openBlock(),A.createBlock(A.unref(g),{key:d,title:E.title},{default:A.withCtx(()=>[(A.openBlock(),A.createBlock(A.resolveDynamicComponent(A.unref(i)[d]),{id:`grid-${d}`,border:"","max-height":"300"},null,8,["id"]))]),_:2},1032,["title"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["model-value","title"]))}}),rl={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},sl={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},Bl={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},al=nA(A.defineComponent({__name:"YwsjzdQuery",setup(e){const t=async({page:N,formValues:u})=>{const p={pageNo:N.currentPage,pageSize:N.pageSize,authDict:{cSign:u.cSign||"",cXuhao:u.cXuhao||"",cName:u.cName||"",nParent:0}},M=await G.post("/core/authDict/selectForPageBS",p);return M.result?.records&&(M.result.records=M.result.records.map(P=>({...P,hasChildren:!0}))),M};async function g({row:N}){const p={pageNo:1,pageSize:9999,authDict:{...await s.getValues(),nParent:N.id}};try{return((await G.post("/core/authDict/selectForPageBS",p)).result?.records||[]).map(z=>({...z,hasChildren:!0}))}catch(M){return console.error("加载子节点失败:",M),[]}}const o={lazy:!0,rowField:"id",hasChild:"hasChildren",expandAll:!1,loadMethod:g},{QueryForm:n,formApi:s,Grid:r,gridApi:B,submitting:i,handleGlobalEnter:c,searchPlanList:I,currentSearchPlan:Q,resourceId:a,nResourceid:l,handleSearchPlanSearch:C,handleDefaultPlanLoaded:E,businessResumeState:d}=lA({searchFormSchema:Al,tableColumns:el,resourceConfig:ol,queryFunction:t,gridEvents:{toolbarButtonClick:({code:N})=>{N==="ywsjzd/add"?U():N==="ywsjzd/update"?D():N==="ywsjzd/enable"?h("10001"):N==="ywsjzd/disable"?h("10002"):N==="ywsjzd/del"&&k()}},treeConfig:o,lazy:!0}),w=A.ref(!1),m=A.ref("0"),f=A.ref(""),y=A.ref(!1),v=A.ref(null);function U(){const N=B.getSelection();if(N.length>1){b.Message.warning("最多只能选择一条数据作为父级");return}N.length===1?(m.value=N[0].id,f.value=N[0].cName):(m.value="0",f.value=""),w.value=!0}function D(){const N=B.getSelection();if(N.length!==1){b.Message.warning("请选择一条数据进行修改");return}const u=N[0];v.value=u,y.value=!0}async function h(N){const u=B.getSelection();if(u.length===0){b.Message.warning("请选择要操作的数据");return}if(u.length>1){b.Message.warning("一次只能操作一条数据");return}const p=u[0],M=N==="10001"?"启用":"禁用";try{const P=await G.post("/core/authDict/signBS",{authDict:{id:p.id,cSign:N}});b.Message.success(P.message||`${M}成功`),B.commitProxy("query")}catch(P){console.error(`${M}失败:`,P)}}function k(){const N=B.getSelection();if(N.length===0){b.Message.warning("请选择要删除的数据");return}if(N.length>1){b.Message.warning("一次只能删除一条数据");return}const u=N[0];b.Modal.confirm({title:"确认删除",content:`确定要删除「${u.cName}」吗?`,okText:"确定",cancelText:"取消",onOk:async()=>{try{const p=await G.post("/core/authDict/deleteBS",{authDict:{id:u.id}});b.Message.success(p.message||"删除成功"),B.commitProxy("query")}catch(p){console.error("删除失败:",p)}}})}function F(){B.commitProxy("query")}return(N,u)=>(A.openBlock(),A.createElementBlock("div",{class:"ywsjzd-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:u[2]||(u[2]=A.withKeys((...p)=>A.unref(c)&&A.unref(c)(...p),["enter"])),tabindex:"-1"},[A.createElementVNode("div",rl,[A.createElementVNode("div",sl,[A.createVNode(A.unref(n))]),A.createElementVNode("div",Bl,[A.createVNode(A.unref(r),{class:"flex-1"})])]),A.createVNode(gl,{visible:w.value,"onUpdate:visible":u[0]||(u[0]=p=>w.value=p),"parent-id":m.value,"parent-name":f.value,onSuccess:F},null,8,["visible","parent-id","parent-name"]),A.createVNode(nl,{visible:y.value,"onUpdate:visible":u[1]||(u[1]=p=>y.value=p),row:v.value,onSuccess:F},null,8,["visible","row"]),A.createVNode(A.unref(pA),{state:A.unref(d)},null,8,["state"])],32))}}),[["__scopeId","data-v-24b85090"]]),NA=({t:e,formApi:t})=>{const g=[{label:"普通用户",value:"0"},{label:"超级用户",value:"1"}],o=[{label:"启用",value:"0"},{label:"禁用",value:"1"}],n=[{label:"是",value:"1"},{label:"否",value:"0"}],s=[{fieldName:"cUsernumb",label:e("user.cUsernumb"),component:"Input",componentProps:{allowClear:!0}},{fieldName:"cUsername",label:e("user.cUsername"),component:"Input",componentProps:{allowClear:!0}},{fieldName:"cAdmin",label:e("user.cAdmin"),component:"Select",componentProps:{allowClear:!0,options:g}},{fieldName:"dLastLoginList",label:e("user.dLastLoginList"),component:"RangePicker",componentProps:{allowClear:!0}}],r=[{type:"checkbox",width:40},{field:"id",title:"ID",minWidth:80,params:{nBill:3,cEntityTable:"AUTH_USER"}},{field:"cUsernumb",title:e("user.cUsernumb"),minWidth:120},{field:"cUsername",title:e("user.cUsername"),minWidth:120},{field:"cAdmin",title:e("user.cAdmin"),minWidth:120,params:{optionlist:g},formatter:({cellValue:a,column:l})=>DA(a,l.params.optionlist)},{field:"cWork",title:e("user.cWork"),minWidth:120},{field:"dCredate",title:e("user.dCredate"),minWidth:120},{field:"cSign",title:e("user.cSign"),minWidth:120,params:{optionlist:o},formatter:({cellValue:a,column:l})=>DA(a,l.params.optionlist)},{field:"cEmail",title:e("user.cEmail"),minWidth:120},{field:"cDeptname",title:e("user.cDeptname"),minWidth:120},{field:"nMainAccount",title:e("user.nMainAccount"),minWidth:120,params:{optionlist:n},formatter:({cellValue:a,column:l})=>DA(a,l.params.optionlist)},{field:"nOuterUser",title:e("user.nOuterUser"),minWidth:120,params:{optionlist:n},formatter:({cellValue:a,column:l})=>DA(a,l.params.optionlist)},{field:"dLastLogin",title:e("user.dLastLogin"),minWidth:120}],B={resourceId:"88",nResourceid:80,cModnumb:"XTGL_YHGL_LIST"},i=[{fieldName:"cUsernumb",label:e("user.cUsernumb"),component:"Input",componentProps:{allowClear:!0},rules:"required"},{fieldName:"cUsername",label:e("user.cUsername"),component:"Input",componentProps:{allowClear:!0},rules:"required"},{fieldName:"cAdmin",label:e("user.cAdmin"),component:"Select",componentProps:{allowClear:!0,options:g},rules:"required"},{fieldName:"nMainAccount",label:e("user.nMainAccount"),component:"RadioGroup",componentProps:{allowClear:!0,options:n}},{fieldName:"nOuterUser",label:e("user.nOuterUser"),component:"RadioGroup",componentProps:{allowClear:!0,options:n}},{fieldName:"cWork",label:e("user.cWork"),component:"SunnyBusinessSearch",componentProps:(a,l)=>({allowClear:!0,cNum:"INNER_WORK_OPT",defaultModel:{WORKCODE:"1084870"},modalProps:{multiple:!1,fieldNames:{value:"WORKCODE",label:"LASTNAME"}},onChange:(C,E)=>{C.length>0?(l.setFieldValue("cDeptnum",C[0].DEPTCODE),l.setFieldValue("cDeptname",C[0].DEPTNAME)):(l.setFieldValue("cDeptnum",""),l.setFieldValue("cDeptname",""))}}),dependencies:{show:a=>a.nOuterUser==="0"}},{fieldName:"cDeptnum",label:e("user.cDeptnum"),component:"Input",componentProps:{allowClear:!0,disabled:!0},dependencies:{show:a=>a.nOuterUser==="0"}},{fieldName:"cDeptname",label:e("user.cDeptname"),component:"Input",componentProps:{allowClear:!0,disabled:!0},dependencies:{show:a=>a.nOuterUser==="0"}}],c=[{fieldName:"cUsernumb",label:e("user.cUsernumb"),component:"Input",componentProps:{disabled:!0},colProps:{span:12}},{fieldName:"cUsername",label:e("user.cUsername"),component:"Input",componentProps:{disabled:!0},colProps:{span:12}}],I=[{type:"checkbox",width:40,align:"center"},{field:"cRolenumb",title:e("user.cRolenumb"),minWidth:100},{field:"cRolename",title:e("user.cRolename"),minWidth:200},{field:"nSensitive",title:e("user.nSensitive"),minWidth:100,formatter:({cellValue:a,column:l})=>DA(a,l.params.optionlist),params:{optionlist:n}},{field:"cSystem",title:e("user.cSystem"),minWidth:100}],Q=[{type:"checkbox",width:40,align:"center"},{field:"cMac",title:e("user.cMac"),...Y.EditRender.InputRender},{field:"cMacdesc",title:e("user.cMacdesc"),...Y.EditRender.InputRender},{field:"cCreateusername",title:e("user.cCreateusername")},{field:"dDate",title:e("user.dDate")}];return{searchFormSchema:s,tableColumns:r,resourceConfig:B,addEditFormSchema:i,authFormSchema:c,authGridColumns:I,bindMacGridColumns:Q}},ll=A.defineComponent({__name:"UserAdd",emits:["success"],setup(e,{expose:t,emit:g}){const{t:o}=$.useI18n(),n=A.ref(!1),s=A.ref("add"),r=g,[B,i]=mA({schema:[],objectToValueFields:["cWork"]}),{addEditFormSchema:c}=NA({t:o,formApi:i}),I=()=>{n.value=!0,s.value="add",i.setState({schema:c}),i.resetForm(),i.setValues({nMainAccount:"1",nOuterUser:"0"})},Q=async E=>{s.value="edit";const d=await G.post("/core/authUser/queryById",{authUser:{id:E.id}});n.value=!0,await A.nextTick(),i.setState({schema:c}),i.resetForm(),d.code===200&&i.setValues({...d.result,nMainAccount:d.result.nMainAccount.toString(),nOuterUser:d.result.nOuterUser.toString()},!1)};t({addInit:I,editInit:Q,detailInit:E=>{Q(E)}});const l=async()=>{const{valid:E}=await i.validate();if(!E)return!1;const w={authUser:await i.getValues()},m=await G.post(s.value==="add"?"/core/authUser/add":"/core/authUser/edit",w);return m.code===200?(b.Message.success(m.message),n.value=!1,r("success"),!0):(b.Message.error(m.message),!1)};function C(){n.value=!1}return(E,d)=>(A.openBlock(),A.createBlock(A.unref(Y.Modal),{"model-value":n.value,title:s.value==="add"?A.unref(o)("user.addTitle"):A.unref(o)("user.editTitle"),width:600,"on-before-ok":l,onClose:C},{default:A.withCtx(()=>[A.createVNode(A.unref(B))]),_:1},8,["model-value","title"]))}}),Cl=A.defineComponent({__name:"UserChooseRole",emits:["chooseRoleEmit"],setup(e,{expose:t,emit:g}){const{t:o}=$.useI18n(),n=A.ref(!1),s=A.ref([]);A.ref([]),A.ref(!1);const r=g,B=[{fieldName:"cRolenumb",label:o("user.cRolenumb"),component:"Input",componentProps:{allowClear:!0},colProps:{span:6}},{fieldName:"cRolename",label:o("user.cRolename"),component:"Input",componentProps:{allowClear:!0},colProps:{span:6}}],i=[{type:"checkbox",width:50,fixed:"left"},{field:"cRolenumb",title:o("user.cRolenumb"),width:120},{field:"cRolename",title:o("user.cRolename"),width:120},{field:"nSensitive",title:o("user.nSensitive"),width:120,formatter:({row:a})=>a.nSensitive=="1"?o("common.yes"):o("common.no")},{field:"cSystem",title:o("user.cSystem"),width:120}],c=()=>{n.value=!0},I=a=>{r("chooseRoleEmit",a)},Q=async a=>{var l={authRole:{cRolenumb:a.cRolenumb,cRolename:a.cRolename},pageNo:a.pageNo,pageSize:a.pageSize};const C=await G.post("/core/authRole/queryAllPageList",l);return{list:C.result.records,total:C.result.total}};return t({openInit:c}),(a,l)=>(A.openBlock(),A.createBlock(A.unref(Y.SunnySearchModal),{visible:n.value,"onUpdate:visible":l[0]||(l[0]=C=>n.value=C),modelValue:s.value,"onUpdate:modelValue":l[1]||(l[1]=C=>s.value=C),title:a.$t("系统角色权限查询"),"form-schema":B,"table-columns":i,"search-api":Q,"field-names":{label:"cRolename",value:"cRolenumb"},onConfirm:I},null,8,["visible","modelValue","title"]))}}),cl=A.defineComponent({__name:"UserAuth",emits:["success"],setup(e,{expose:t,emit:g}){const o=A.ref(),{t:n}=$.useI18n(),s=A.ref(!1),r=g,[B,i]=mA({schema:[]}),{authFormSchema:c,authGridColumns:I}=NA({t:n,formApi:i}),[Q,a]=Y.useSunnyEditGrid({gridOptions:{data:[],columns:I,border:!0,size:"mini",maxHeight:400,columnConfig:{resizable:!0}}});t({openInit:async f=>{const y=await G.post("/core/authUser/queryUserRole",{authUser:{id:f.id}}),v=y.code===200?y.result:[];s.value=!0,await A.nextTick(),i.setState({schema:c}),i.resetForm(),i.setValues({cUsernumb:f.cUsernumb,cUsername:f.cUsername}),a.reloadData(v)}});const C=async()=>{const{valid:f}=await i.validate();if(!f)return!1;const y=await i.getValues(),v=await a.getFullData(),U={authorizedNumb:y.cUsernumb,authUserRoleList:v},D=await G.post("/core/authUser/saveUserAuth",U);return D.code===200?(b.Message.success(D.message),s.value=!1,r("success"),!0):(b.Message.error(D.message),!1)};function E(){s.value=!1}const d=()=>{o.value.openInit()},w=async f=>{const y=await a.getFullData();f.forEach(v=>{T.findIndex(y,U=>U.nRoleid===v.id)>-1?b.Message.warning(n("user.duplicateRole",{roleName:v.cRolename})):a.addEvent({nRoleid:v.id,cSystem:v.cSystem,cRolename:v.cRolename,cRolenumb:v.cRolenumb,nSensitive:v.nSensitive})})},m=()=>{a.deleteSelection()};return(f,y)=>{const v=A.resolveComponent("a-button"),U=A.resolveComponent("a-space");return A.openBlock(),A.createBlock(A.unref(Y.Modal),{"model-value":s.value,title:A.unref(n)("user.authTitle"),width:700,"on-before-ok":C,onClose:E},{default:A.withCtx(()=>[A.createVNode(A.unref(B)),A.createVNode(A.unref(Q),null,{toolbar:A.withCtx(()=>[A.createVNode(U,{class:"mb-2"},{default:A.withCtx(()=>[A.createVNode(v,{type:"primary",onClick:d},{default:A.withCtx(()=>[A.createTextVNode(A.toDisplayString(A.unref(n)("common.create")),1)]),_:1}),A.createVNode(v,{type:"primary",onClick:m},{default:A.withCtx(()=>[A.createTextVNode(A.toDisplayString(A.unref(n)("common.deleteSelected")),1)]),_:1})]),_:1})]),_:1}),A.createVNode(Cl,{ref_key:"UserChooseRoleRef",ref:o,onChooseRoleEmit:w},null,512)]),_:1},8,["model-value","title"])}}}),Ql=A.defineComponent({__name:"UserBindMac",emits:["success"],setup(e,{expose:t,emit:g}){const{t:o}=$.useI18n(),n=A.ref(!1),s=A.ref({}),r=g,{bindMacGridColumns:B}=NA({t:o}),[i,c]=Y.useSunnyEditGrid({gridOptions:{data:[],columns:B,border:!0,size:"mini",maxHeight:400,columnConfig:{resizable:!0},editRules:{cMac:[{required:!0,message:o("user.cMacMessage")}]}}});t({openInit:async E=>{const d=await G.post("/core/authUser/queryMac",{cUsernumb:E.cUsernumb}),w=d.code===200?d.result:[];d.code===200&&(s.value=E),n.value=!0,await A.nextTick(),c.reloadData(w)}});const Q=async()=>{if(await c.validate())return!1;const w={authUserMacList:await c.getFullData(),authUserMac:{cUsernumb:s.value.cUsernumb}},m=await G.post("/core/authUser/saveMac",w);return m.code===200?(b.Message.success(m.message),n.value=!1,r("success"),!0):(b.Message.error(m.message),!1)};function a(){n.value=!1}const l=()=>{c.addEvent({})},C=()=>{c.deleteSelection()};return(E,d)=>{const w=A.resolveComponent("a-button"),m=A.resolveComponent("a-space");return A.openBlock(),A.createBlock(A.unref(Y.Modal),{"model-value":n.value,title:A.unref(o)("user.bindMacTitle"),width:700,"on-before-ok":Q,onClose:a},{default:A.withCtx(()=>[A.createVNode(A.unref(i),null,{toolbar:A.withCtx(()=>[A.createVNode(m,{class:"mb-2"},{default:A.withCtx(()=>[A.createVNode(w,{type:"primary",onClick:l},{default:A.withCtx(()=>[A.createTextVNode(A.toDisplayString(A.unref(o)("common.create")),1)]),_:1}),A.createVNode(w,{type:"primary",onClick:C},{default:A.withCtx(()=>[A.createTextVNode(A.toDisplayString(A.unref(o)("common.deleteSelected")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["model-value","title"])}}}),il={class:"otherAuthTable"},El={class:"th1"},Il={class:"th2"},dl={class:"th3"},fl={class:"tr1"},wl={class:"tr2"},ul={class:"tr3"},ml={key:0,style:{color:"#24b77b"}},Dl=nA(A.defineComponent({__name:"UserOtherAuth",emits:["success"],setup(e,{expose:t,emit:g}){const{t:o}=$.useI18n(),n=A.ref(!1),s=A.ref([]),r=A.ref({}),B=(Q,a)=>{a.forEach(l=>{l.check=!!Q})};t({openInit:async Q=>{const a=await G.post("/core/authUser/queryUserExres",{authUser:{id:Q.id}});a.code===200&&(s.value=a.result,r.value=Q),n.value=!0}});const c=async()=>{const Q={authUser:{id:r.value.id},userExresAuthBOList:s.value.map(l=>({...l,allCheck:!1}))},a=await G.post("/core/authUser/saveUserExres",Q);return a.code===200?(b.Message.success(a.message),n.value=!1,!0):(b.Message.error(a.message),!1)};function I(){n.value=!1}return(Q,a)=>{const l=A.resolveComponent("a-checkbox");return A.openBlock(),A.createBlock(A.unref(Y.Modal),{"model-value":n.value,title:A.unref(o)("user.otherAuth.title"),width:900,class:"macAddressDialog","on-before-ok":c,onClose:I},{default:A.withCtx(()=>[A.createElementVNode("div",null,[A.createElementVNode("table",il,[a[1]||(a[1]=A.createElementVNode("caption",null,null,-1)),A.createElementVNode("th",El,A.toDisplayString(A.unref(o)("user.otherAuth.tab")),1),A.createElementVNode("th",Il,A.toDisplayString(A.unref(o)("user.otherAuth.tabDesc")),1),A.createElementVNode("th",dl,A.toDisplayString(A.unref(o)("user.otherAuth.option")),1),(A.openBlock(!0),A.createElementBlock(A.Fragment,null,A.renderList(s.value,C=>(A.openBlock(),A.createElementBlock("tr",null,[A.createElementVNode("td",fl,A.toDisplayString(C.parname),1),A.createElementVNode("td",wl,[A.createVNode(l,{modelValue:C.allCheck,"onUpdate:modelValue":E=>C.allCheck=E,onChange:E=>B(E,C.authExresList)},null,8,["modelValue","onUpdate:modelValue","onChange"]),a[0]||(a[0]=A.createTextVNode(" 是 ",-1))]),A.createElementVNode("td",ul,[(A.openBlock(!0),A.createElementBlock(A.Fragment,null,A.renderList(C.authExresList,E=>(A.openBlock(),A.createBlock(l,{modelValue:E.check,"onUpdate:modelValue":d=>E.check=d},{default:A.withCtx(()=>[A.createTextVNode(A.toDisplayString(E.cExresnum+"-"+E.cExresname)+" ",1),E.cOrg?(A.openBlock(),A.createElementBlock("span",ml,"["+A.toDisplayString(E.cOrg)+"]",1)):A.createCommentVNode("",!0)]),_:2},1032,["modelValue","onUpdate:modelValue"]))),256))])]))),256))])])]),_:1},8,["model-value","title"])}}}),[["__scopeId","data-v-c249a204"]]),pl={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},bl={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},Pl={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},vl=nA(A.defineComponent({__name:"UserQuery",setup(e){const t=A.ref(),g=A.ref(),o=A.ref(),n=A.ref(),s=QA.useRouter(),{t:r}=$.useI18n(),{searchFormSchema:B,tableColumns:i,resourceConfig:c}=NA({t:r}),I=async({page:p,formValues:M})=>{const P={pageNo:p.currentPage,pageSize:p.pageSize,authUser:M};return G.post("/core/authUser/selectForPage",P)},Q={async toolbarButtonClick(p){const M=[...p.$grid.getCheckboxRecords()];switch(p.button.code){case"userManagement/add":t.value.addInit();break;case"userManagement/update":if(M.length!==1){b.Message.warning(r("common.selectOne"));return}t.value.editInit(M[0]);break;case"userManagement/delete":if(M.length!==1){b.Message.warning(r("common.selectOne"));return}b.Modal.confirm({title:r("common.prompt"),content:`确定删除选中 ${M.length} 项吗?`,onBeforeOk:async()=>{const z=await G.post("/core/authUser/delete",{id:M[0].id});return z.code===200?(b.Message.success(z.message),p.$grid.commitProxy("query",{}),!0):(b.Message.error(z.message),!1)}});break;case"userManagement/detail":if(M.length!==1){b.Message.warning(r("common.selectOne"));return}t.value.detailInit(M[0]);break;case"userManagement/resetPassword":if(M.length!==1){b.Message.warning(r("common.selectOne"));return}b.Modal.confirm({title:r("common.prompt"),content:r("user.resetPasswordTips",{username:M[0].cUsername}),onBeforeOk:async()=>{const z=await G.post("/core/authUser/resetPwd",{id:M[0].id});return z.code===200?(b.Message.success(z.message),p.$grid.commitProxy("query",{}),!0):(b.Message.error(z.message),!1)}});break;case"userManagement/enable":if(M.length!==1){b.Message.warning(r("common.selectOne"));return}b.Modal.confirm({title:r("common.prompt"),content:r("user.enableTips",{username:M[0].cUsername}),onBeforeOk:async()=>{const z=await G.post("/core/authUser/updateSign",{id:M[0].id,cSign:"0"});return z.code===200?(b.Message.success(z.message),p.$grid.commitProxy("query",{}),!0):(b.Message.error(z.message),!1)}});break;case"userManagement/disable":if(M.length!==1){b.Message.warning(r("common.selectOne"));return}b.Modal.confirm({title:r("common.prompt"),content:r("user.disableTips",{username:M[0].cUsername}),onBeforeOk:async()=>{const z=await G.post("/core/authUser/updateSign",{id:M[0].id,cSign:"1"});return z.code===200?(b.Message.success(z.message),p.$grid.commitProxy("query",{}),!0):(b.Message.error(z.message),!1)}});break;case"userManagement/auth":if(M.length!==1){b.Message.warning(r("common.selectOne"));return}g.value.openInit(M[0]);break;case"userManagement/macBind":if(M.length!==1){b.Message.warning(r("common.selectOne"));return}o.value.openInit(M[0]);break;case"userManagement/otherAuth":if(M.length!==1){b.Message.warning(r("common.selectOne"));return}n.value.openInit(M[0]);break;case"daoru/show":u.open({nModid:s.currentRoute.value.meta.id,nButtonid:p.button.nButtonid});break;case"daochu/show":const P=await l.getValues();F({conditionMap:P,tableColumns:i});break}}},{QueryForm:a,formApi:l,Grid:C,gridApi:E,submitting:d,handleGlobalEnter:w,searchPlanList:m,currentSearchPlan:f,resourceId:y,nResourceid:v,handleSearchPlanSearch:U,handleDefaultPlanLoaded:D,businessResumeState:h}=lA({searchFormSchema:B,tableColumns:i,resourceConfig:c,queryFunction:I,gridEvents:Q,showCheckbox:!0}),{ExportModal:k,open:F}=it({exportUrl:"/core/authUser"}),[N,u]=Y.useImportModal({});return(p,M)=>(A.openBlock(),A.createElementBlock("div",{class:"operation-log-query h-full flex flex-col bg-[var(--color-fill-2)] focus:outline-none",onKeydown:M[4]||(M[4]=A.withKeys((...P)=>A.unref(w)&&A.unref(w)(...P),["enter"])),tabindex:"-1"},[A.createElementVNode("div",pl,[A.createElementVNode("div",bl,[A.createVNode(A.unref(a))]),A.createElementVNode("div",Pl,[A.createVNode(A.unref(C),{class:"flex-1"})]),A.createVNode(A.unref(k)),A.createVNode(A.unref(N)),A.createVNode(ll,{ref_key:"UserAddRef",ref:t,onSuccess:M[0]||(M[0]=()=>A.unref(E).commitProxy("query"))},null,512),A.createVNode(cl,{ref_key:"UserAuthRef",ref:g,onSuccess:M[1]||(M[1]=()=>A.unref(E).commitProxy("query"))},null,512),A.createVNode(Ql,{ref_key:"UserBindMacRef",ref:o,onSuccess:M[2]||(M[2]=()=>A.unref(E).commitProxy("query"))},null,512),A.createVNode(Dl,{ref_key:"UserOtherAuthRef",ref:n,onSuccess:M[3]||(M[3]=()=>A.unref(E).commitProxy("query"))},null,512),A.createVNode(A.unref(pA),{state:A.unref(h)},null,8,["state"])])],32))}}),[["__scopeId","data-v-98e86324"]]),OA=({t:e,formApi:t})=>{e("role.enable"),e("role.disable");const g=[{cKeyname:e("common.no"),cKeynumb:"0"},{cKeyname:e("common.yes"),cKeynumb:"1"}],o=[{cKeyname:e("role.baseSystem"),cKeynumb:"BASE"}],n=[{cKeyname:e("role.type1"),cKeynumb:"1"},{cKeyname:e("role.type2"),cKeynumb:"2"}],s=[{fieldName:"cRolenumb",label:e("user.cRolenumb"),component:"Input",componentProps:{placeholder:e("role.inputRoleNumb"),allowClear:!0},colProps:{span:4}},{fieldName:"cRolename",label:e("user.cRolename"),component:"Input",componentProps:{placeholder:e("role.inputRoleName"),allowClear:!0},colProps:{span:4}},{fieldName:"cOrg",label:e("role.org"),component:"Input",componentProps:{placeholder:e("role.inputOrg"),allowClear:!0},colProps:{span:4}}],r=[{type:"checkbox",width:40},{field:"id",title:e("role.id"),params:{nBill:3,cEntityTable:"AUTH_ROLE"}},{field:"cRolenumb",title:e("user.cRolenumb")},{field:"cRolename",title:e("user.cRolename")},{field:"CSystem",title:e("role.system"),formatter:({cellValue:Q})=>o.find(l=>l.cKeynumb===Q)?.cKeyname||Q},{field:"corg",title:e("role.org")},{field:"сType",title:e("role.type"),formatter:({cellValue:Q})=>n.find(l=>l.cKeynumb===Q)?.cKeyname||Q},{field:"nSensitive",title:e("user.nSensitive"),formatter:({cellValue:Q})=>g.find(l=>l.cKeynumb===String(Q))?.cKeyname||Q},{field:"cCrename",title:e("role.createUser")},{field:"dCredate",title:e("role.createTime")}],B={resourceId:"role",nResourceid:95,cModnumb:"XTGL_JSGL_LIST"},i=[{fieldName:"cRolenumb",label:e("user.cRolenumb"),component:"Input",componentProps:{allowClear:!0},colProps:{span:4}},{fieldName:"cRolename",label:e("user.cRolename"),component:"Input",componentProps:{allowClear:!0},rules:"required",colProps:{span:4}},{fieldName:"cSystem",label:e("role.system"),component:"Select",componentProps:{allowClear:!0,options:o.map(Q=>({label:Q.cKeyname,value:Q.cKeynumb}))},rules:"required",colProps:{span:4}},{fieldName:"corg",label:e("role.org"),component:"Input",componentProps:{allowClear:!0},colProps:{span:4}},{fieldName:"сType",label:e("role.type"),component:"Select",componentProps:{allowClear:!0,options:n.map(Q=>({label:Q.cKeyname,value:Q.cKeynumb}))},colProps:{span:4}}],c=[{fieldName:"cRolenumb",label:e("user.cRolenumb"),component:"Input",componentProps:{disabled:!0},colProps:{span:12}},{fieldName:"cRolename",label:e("user.cRolename"),component:"Input",componentProps:{disabled:!0},colProps:{span:12}}],I=[{type:"checkbox",width:40,align:"center"},{field:"cUsernumb",title:e("user.cUsernumb"),minWidth:100},{field:"cUsername",title:e("user.cUsername"),minWidth:200},{field:"cAdmin",title:e("user.cAdmin"),minWidth:100,formatter:({cellValue:Q})=>[{cKeyname:e("role.normalUser"),cKeynumb:"0"},{cKeyname:e("role.superUser"),cKeynumb:"1"}].find(C=>C.cKeynumb===String(Q))?.cKeyname||Q}];return{searchFormSchema:s,tableColumns:r,resourceConfig:B,addEditFormSchema:i,authFormSchema:c,authGridColumns:I}},Ml={class:"h-full flex flex-col"},yl={class:"mt-5 flex-1 overflow-hidden"},Fl={class:"mb-3 text-sm font-medium"},kl={class:"h-[calc(100%-36px)] overflow-auto"},zl={class:"extra-container ml-[250px] mr-auto",style:{"flex-shrink":"0","max-width":"70%","overflow-x":"auto"}},hl={key:0,class:"flex flex-nowrap gap-3",style:{width:"max-content"}},nt=A.defineComponent({__name:"RoleAdd",emits:["success"],setup(e,{expose:t,emit:g}){const{t:o}=$.useI18n(),n=A.ref(!1),s=A.ref("add"),r=A.ref(),B=A.ref(),i=A.ref(!1),c=g,I=A.reactive({treeData:[],defaultChecked:[],expandedKeys:[]}),Q=async p=>{const M=await G.post("/core/authResource/getResourceTreeMenu",{authResMenu:{cSystem:p}});if(M.code===200){const P=M.result;I.treeData=y(P),a(I.treeData)}},a=p=>{p.forEach(M=>{M.buttonList&&M.buttonList.length&&M.buttonList.forEach(P=>{P.checked=I.defaultChecked.includes(String(P.id))}),M.children&&a(M.children)})},l=p=>{let M=[];return p.buttonList&&p.buttonList.length&&(M=M.concat(p.buttonList.map(P=>P.id))),p.children&&p.children.length&&p.children.forEach(P=>{M.push(P.id),M=M.concat(l(P))}),M},C=p=>{const M=[],P=(z,V,L=[])=>{for(const X of z){if(X.id===V)return M.push(...L),!0;if(X.children&&P(X.children,V,[...L,X.id]))return!0}return!1};return P(I.treeData,p),M},E=(p,M)=>{const P=M.node,z=M.checked,V=[...p];if(z){C(P.id).forEach(x=>{V.includes(x)||V.push(x)}),P.buttonList&&P.buttonList.length&&P.buttonList.forEach(x=>{V.includes(x.id)||V.push(x.id),x.checked=!0}),l(P).forEach(x=>{V.includes(x)||V.push(x)});const H=(x,O)=>{x.forEach(j=>{j.buttonList&&j.buttonList.length&&j.buttonList.forEach(J=>{J.checked=O}),j.children&&H(j.children,O)})};P.children&&H(P.children,!0)}else{P.buttonList&&P.buttonList.length&&P.buttonList.forEach(H=>{const x=V.indexOf(H.id);x!==-1&&V.splice(x,1),H.checked=!1}),l(P).forEach(H=>{const x=V.indexOf(H);x!==-1&&V.splice(x,1)});const X=(H,x)=>{H.forEach(O=>{O.buttonList&&O.buttonList.length&&O.buttonList.forEach(j=>{j.checked=x}),O.children&&X(O.children,x)})};P.children&&X(P.children,!1)}I.defaultChecked=V},[d,w]=Y.useSunnyForm({layout:"horizontal",size:"small",labelWidth:100,showDefaultActions:!1,scrollToFirstError:!0,schema:[]}),{addEditFormSchema:m}=OA({t:o,formApi:w}),f=async p=>{p?(await Q(p),I.defaultChecked=[]):(I.treeData=[],I.defaultChecked=[])};w.setState({handleValuesChange:(p,M)=>{"cSystem"in p&&!i.value&&f(p.cSystem)}});const y=p=>p.map(M=>{const P=M.label||M.name||M.text||M.cName||M.id,z={...M,label:P,expanded:!1};if(z.children&&z.children.length){const V=[],L=[];z.children.forEach(X=>{if(X.cType==="2"){const H=X.label||X.name||X.text||X.cName||X.id;V.push({...X,label:H,checked:I.defaultChecked.includes(String(X.id))})}else L.push(y([X])[0])}),z.buttonList=V,z.children=L.length?L:void 0}return z}),v=(p,M)=>{for(const P of p){if(P.buttonList&&P.buttonList.some(z=>z.id===M))return P;if(P.children){const z=v(P.children,M);if(z)return z}}return null},U=p=>{if(p.checked){I.defaultChecked.includes(p.id)||I.defaultChecked.push(p.id);const M=v(I.treeData,p.id);M&&(I.defaultChecked.includes(M.id)||I.defaultChecked.push(M.id),((V,L)=>{let X=[];const H=(O,j)=>{for(const J of O)if(J.children){if(J.children.some(q=>q.id===j))return J;const Z=H(J.children,j);if(Z)return X.push(J.id),Z}return null};let x=V;for(;x;){const O=H(L,x.id);if(O)X.push(O.id),x=O;else break}return X})(M,I.treeData).forEach(V=>{I.defaultChecked.includes(V)||I.defaultChecked.push(V)}))}else{const M=I.defaultChecked.indexOf(p.id);M!==-1&&I.defaultChecked.splice(M,1)}},D=(p,M,P)=>{I.expandedKeys=p},h=async()=>{n.value=!0,s.value="add",w.setState({schema:m}),w.resetForm(),I.treeData=[],I.defaultChecked=[],I.treeData=[],await A.nextTick(),r.value&&r.value.toggleMaximize()},k=async p=>{i.value=!0,s.value="edit";const M=await G.post("/core/authRole/update_init",{authRole:{id:p.id}});if(n.value=!0,await A.nextTick(),w.setState({schema:m}),w.resetForm(),M.code===200){w.setValues(M.result.role,!1),w.updateSchema([{fieldName:"cRolenumb",componentProps:{disabled:!0}}]),I.defaultChecked=(M.result.resourceidList||[]).map(String);const P=M.result.treeList||[];I.treeData=y(P),a(I.treeData),I.expandedKeys=[]}await A.nextTick(),r.value&&r.value.toggleMaximize(),i.value=!1};t({addInit:h,editInit:k,detailInit:p=>{k(p)}});const N=async()=>{const{valid:p}=await w.validate();if(!p)return!1;const P={authRole:await w.getValues(),idList:I.defaultChecked},z=await G.post(s.value==="add"?"/core/authRole/saveRole":"/core/authRole/saveUpdateRole",P);return z.code===200?(b.Message.success(z.message),n.value=!1,c("success"),!0):(b.Message.error(z.message),!1)};function u(){n.value=!1}return(p,M)=>(A.openBlock(),A.createBlock(A.unref(Y.Modal),{ref_key:"modalRef",ref:r,"model-value":n.value,title:s.value==="add"?A.unref(o)("role.addTitle"):A.unref(o)("role.editTitle"),"on-before-ok":N,onClose:u},{default:A.withCtx(()=>[A.createElementVNode("div",Ml,[A.createVNode(A.unref(d)),A.createElementVNode("div",yl,[A.createElementVNode("h4",Fl,A.toDisplayString(A.unref(o)("role.resourceConfig")),1),A.createElementVNode("div",kl,[A.createVNode(A.unref(b.Tree),{ref_key:"treeRef",ref:B,data:I.treeData,"node-key":"id",checkable:!0,"check-strictly":!0,"checked-keys":I.defaultChecked,"expanded-keys":I.expandedKeys,"field-names":{key:"id",title:"label",children:"children",disabled:"disabled"},"default-expand-all":!1,onExpand:D,onCheck:E},{extra:A.withCtx(P=>[A.createElementVNode("div",zl,[P?.buttonList&&P.buttonList.length?(A.openBlock(),A.createElementBlock("div",hl,[(A.openBlock(!0),A.createElementBlock(A.Fragment,null,A.renderList(P.buttonList,z=>(A.openBlock(),A.createBlock(A.unref(b.Checkbox),{key:z.id,modelValue:z.checked,"onUpdate:modelValue":V=>z.checked=V,disabled:z.disabled,class:"flex-shrink-0 whitespace-nowrap",onChange:V=>U(z)},{default:A.withCtx(()=>[A.createTextVNode(A.toDisplayString(z.label),1)]),_:2},1032,["modelValue","onUpdate:modelValue","disabled","onChange"]))),128))])):A.createCommentVNode("",!0)])]),_:1},8,["data","checked-keys","expanded-keys"])])])])]),_:1},8,["model-value","title"]))}}),Nl=A.defineComponent({__name:"RoleChooseUser",emits:["chooseUserEmit"],setup(e,{expose:t,emit:g}){const{t:o}=$.useI18n(),n=A.ref(!1),s=A.ref([]),r=g,B=[{fieldName:"cUsernumb",label:o("user.cUsernumb"),component:"Input",componentProps:{allowClear:!0,placeholder:o("role.inputPlaceholder")},colProps:{span:12}},{fieldName:"cUsername",label:o("user.cUsername"),component:"Input",componentProps:{allowClear:!0,placeholder:o("role.inputPlaceholder")},colProps:{span:12}}],i=[{type:"checkbox",width:50,fixed:"left"},{field:"cUsernumb",title:o("user.cUsernumb"),width:120},{field:"cUsername",title:o("user.cUsername"),width:120},{field:"cDeptname",title:o("user.cDeptname"),width:120},{field:"cJobname",title:o("role.jobname"),width:120}],c=()=>{s.value=[],n.value=!0},I=a=>{r("chooseUserEmit",a)},Q=async a=>{var l={authUser:{cUsernumb:a.cUsernumb||"",cUsername:a.cUsername||""},pageNo:a.pageNo,pageSize:a.pageSize};const C=await G.post("/core/authUser/selectForPage",l);return{list:C.result.records,total:C.result.total}};return t({openInit:c}),(a,l)=>(A.openBlock(),A.createBlock(A.unref(Y.SunnySearchModal),{visible:n.value,"onUpdate:visible":l[0]||(l[0]=C=>n.value=C),modelValue:s.value,"onUpdate:modelValue":l[1]||(l[1]=C=>s.value=C),title:A.unref(o)("role.userSearch"),"form-schema":B,"table-columns":i,"search-api":Q,"field-names":{label:"cUsername",value:"id"},onConfirm:I},null,8,["visible","modelValue","title"]))}}),rt=A.defineComponent({__name:"RoleAuth",emits:["success"],setup(e,{expose:t,emit:g}){const o=A.ref(),{t:n}=$.useI18n(),s=A.ref(!1),r=A.ref(null),B=A.ref([]),i=g,[c,I]=mA({schema:[]}),{authFormSchema:Q,authGridColumns:a}=OA({t:n,formApi:I}),[l,C]=Y.useSunnyEditGrid({gridOptions:{data:[],columns:a,border:!0,size:"mini",maxHeight:400,columnConfig:{resizable:!0}}});t({openInit:async v=>{r.value=v;const U=await G.post("/core/authRole/findRoleUser",{authRole:{id:v.id}}),D=U.code===200?U.result.authUserList||[]:[];B.value=JSON.parse(JSON.stringify(D)),s.value=!0,await A.nextTick(),I.setState({schema:Q}),I.resetForm(),I.setValues({cRolenumb:v.cRolenumb,cRolename:v.cRolename}),C.reloadData(D)}});const d=()=>{o.value.openInit()},w=async v=>{const U=await C.getFullData();v.forEach(D=>{T.findIndex(U,h=>h.id===D.id)>-1?b.Message.warning(n("role.duplicateUser",{username:D.cUsername})):C.addEvent({id:D.id,cAdmin:D.cAdmin,cUsername:D.cUsername,cUsernumb:D.cUsernumb})})},m=()=>{C.deleteSelection()},f=async()=>{const{valid:v}=await I.validate();if(!v)return!1;await I.getValues();const U=await C.getFullData(),D=await C.$grid.getRemoveRecords(),h=U.filter(N=>!B.value.some(u=>u.id===N.id)),k={authRole:{id:r.value.id},authUserDelList:D,authUserInsList:h},F=await G.post("/core/authRole/saveRoleUser",k);return F.code===200?(b.Message.success(F.message),s.value=!1,i("success"),!0):(b.Message.error(F.message),!1)};function y(){s.value=!1}return(v,U)=>{const D=A.resolveComponent("a-button"),h=A.resolveComponent("a-space");return A.openBlock(),A.createBlock(A.unref(Y.Modal),{"model-value":s.value,title:A.unref(n)("role.authTitle"),width:700,"on-before-ok":f,onClose:y},{default:A.withCtx(()=>[A.createVNode(A.unref(c)),A.createVNode(A.unref(l),null,{toolbar:A.withCtx(()=>[A.createVNode(h,{class:"mb-2"},{default:A.withCtx(()=>[A.createVNode(D,{type:"primary",onClick:d},{default:A.withCtx(()=>[A.createTextVNode(A.toDisplayString(A.unref(n)("common.create")),1)]),_:1}),A.createVNode(D,{type:"primary",onClick:m},{default:A.withCtx(()=>[A.createTextVNode(A.toDisplayString(A.unref(n)("common.deleteSelected")),1)]),_:1})]),_:1})]),_:1}),A.createVNode(Nl,{ref_key:"RoleChooseUserRef",ref:o,onChooseUserEmit:w},null,512)]),_:1},8,["model-value","title"])}}}),Ol={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},Sl={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},Ul={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},Gl=nA(A.defineComponent({__name:"RoleQuery",setup(e){const t=A.ref(),g=A.ref(),{t:o}=$.useI18n(),{searchFormSchema:n,tableColumns:s,resourceConfig:r}=OA({t:o}),B=async({page:U,formValues:D})=>{const h={pageNo:U.currentPage,pageSize:U.pageSize,authRole:D};return G.post("/core/authRole/selectForPage",h)},i={async toolbarButtonClick(U){const D=[...U.$grid.getCheckboxRecords()];switch(U.button.code){case"roleManagement/add":t.value.addInit();break;case"roleManagement/update":if(D.length!==1){b.Message.warning(o("common.selectOne"));return}t.value.editInit(D[0]);break;case"roleManagement/delete":if(D.length===0){b.Message.warning(o("role.selectDeleteRecords"));return}b.Modal.confirm({title:o("common.prompt"),content:o("role.deleteConfirm",{count:D.length}),onBeforeOk:async()=>{const h=D.map(F=>F.id),k=await G.post("/core/authRole/deleteRole",{idList:h});return k.code===200?(b.Message.success(k.message),U.$grid.commitProxy("query",{}),!0):(b.Message.error(k.message),!1)}});break;case"roleManagement/detail":if(D.length!==1){b.Message.warning(o("common.selectOne"));return}t.value.detailInit(D[0]);break;case"roleManagement/auth":if(D.length!==1){b.Message.warning(o("common.selectOne"));return}g.value.openInit(D[0]);break}}},{QueryForm:c,formApi:I,Grid:Q,gridApi:a,submitting:l,handleGlobalEnter:C,searchPlanList:E,currentSearchPlan:d,resourceId:w,nResourceid:m,handleSearchPlanSearch:f,handleDefaultPlanLoaded:y,businessResumeState:v}=lA({searchFormSchema:n,tableColumns:s,resourceConfig:r,queryFunction:B,gridEvents:i});return(U,D)=>(A.openBlock(),A.createElementBlock("div",{class:"role-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:D[2]||(D[2]=A.withKeys((...h)=>A.unref(C)&&A.unref(C)(...h),["enter"])),tabindex:"-1"},[A.createElementVNode("div",Ol,[A.createElementVNode("div",Sl,[A.createVNode(A.unref(c))]),A.createElementVNode("div",Ul,[A.createVNode(A.unref(Q),{class:"flex-1"})]),A.createVNode(nt,{ref_key:"RoleAddRef",ref:t,onSuccess:D[0]||(D[0]=()=>A.unref(a).commitProxy("query"))},null,512),A.createVNode(rt,{ref_key:"RoleAuthRef",ref:g,onSuccess:D[1]||(D[1]=()=>A.unref(a).commitProxy("query"))},null,512),A.createVNode(A.unref(pA),{state:A.unref(v)},null,8,["state"])])],32))}}),[["__scopeId","data-v-4f1fc0bd"]]);function xl(e,t){if(!Array.isArray(e))return[];const{label:g="cName",value:o="cXuhao"}=t||{};return e.map(n=>({label:String(n[g]||""),value:n[o],...n}))}const st={loadOptions:async(e,t)=>{if(!e||e.length===0)return{};try{const g=await G.post("/core/contact/findAuthDictList",{numbList:e}),o=g?.result||g,n={};return Object.keys(o).forEach(s=>{n[s]=xl(o[s],t)}),n}catch(g){return console.error("[SelectOptionsAdapter] Failed to load options:",g),{}}}},Bt={loadOptions:async(e,t)=>{if(!e||e.length===0)return{};const{label:g="cExresname",value:o="cExresnum"}=t||{},n=s=>typeof g=="function"?g(s):Array.isArray(g)?g.map(r=>s[r]??"").join("-"):String(s[g]||"");try{const s=await G.post("/core/contact/findUserExresList",{numbList:e}),r=s?.result||s,B={};return Object.keys(r).forEach(i=>{const c=r[i]||[];B[i]=c.map(I=>({label:n(I),value:I[o],...I}))}),B}catch(s){return console.error("[PermissionOptionsAdapter] Failed to load options:",s),{}}}};function Vl(e){return{input:"Input",select:"Select",date:"DatePicker",datetime:"TimePicker"}[e]||"Input"}function Ll(e){return e.map(t=>{const g={label:t.label,fieldName:t.prop,component:Vl(t.type),componentProps:{placeholder:t.meta?.placeholder||`请输入${t.label}`,...t.meta}};return t.type==="select"&&Array.isArray(t.optionlist)&&t.optionlist.length>0&&(g.componentProps.options=t.optionlist.map(o=>({label:o.cKeyname,value:o.cKeynumb}))),t.seltype==="3"&&t.selval&&(g.component="SunnyCustomizeSelect",g.componentProps={...g.componentProps,cNum:t.selval}),g})}function Yl(e){return e.map(t=>({title:t.label,field:t.prop,width:t.width}))}function Kl(e){return{title:e.cTitle,width:e.cWidth?isNaN(Number(e.cWidth))?e.cWidth:`${e.cWidth}px`:void 0,contentHeight:e.cHeight?isNaN(Number(e.cHeight))?e.cHeight:Number(e.cHeight):300,multiple:e.cSelectionMode!=="single",formSchema:Ll(e.conditions),tableColumns:Yl(e.tableCols)}}function Rl(e,t){const{page:g,pageNo:o,pageSize:n,...s}=e;return{pageNo:o||g,pageSize:n,sqlNum:t,conditions:s}}function jl(e){const t=e?.result||e;return{records:t?.records||t?.list||[],total:t?.total||t?.totalSize||0}}const at={loadConfig:async e=>{const t=await G.post("/core/assDialog/openInit",{cNum:e});return Kl(t)},search:async e=>{const{cNum:t,...g}=e,o=Rl(g,t),n=await G.post("/core/assDialog/selectForPageCommon",o);return jl(n)}},IA={disabled:!1,disabledOnChangeListener:!0,disabledOnInputListener:!0,emptyStateValue:void 0,businessSearchAdapter:at,customizeSelectAdapter:{query:async e=>{const g=(await G.post("/core/assSelect/commonQuery",e))?.result||{};return{options:g.optionList||[],config:g.assSelect||void 0}}},selectOptionsAdapter:st,permissionOptionsAdapter:Bt,uploadConfig:void 0,apiPrefix:void 0};function Xl(e={}){const{config:t,defineRules:g}=e,o={...IA,...t,businessSearchAdapter:{...IA.businessSearchAdapter,...t?.businessSearchAdapter},customizeSelectAdapter:{...IA.customizeSelectAdapter,...t?.customizeSelectAdapter},selectOptionsAdapter:{...IA.selectOptionsAdapter,...t?.selectOptionsAdapter},permissionOptionsAdapter:{...IA.permissionOptionsAdapter,...t?.permissionOptionsAdapter},uploadConfig:{...IA.uploadConfig,...t?.uploadConfig},apiPrefix:t?.apiPrefix};Y.setupSunnyForm({config:o,defineRules:g})}function SA(e,t){if(Array.isArray(e)){const g=e.map(n=>`'${t[n.prop]||void 0}' ${n.comparison} '${n.value||void 0}'`),o=T.first(e)?.logical||"&&";return g.join(` ${o} `)}else if(e&&e.type==="group"){if(!e.children||e.children.length===0)return"";const g=e.children.map(o=>{if(o.type==="group"){const n=SA(o,t);return n?`(${n})`:null}else return`'${t[o.prop]||void 0}' ${o.comparison} '${o.value||void 0}'`}).filter(o=>o);return g.length===0?"":g.join(` ${e.logical} `)}return""}function lt(e){const{cName:t,cStoremethod:g,cIcon:o,cClass:n,nOrder:s,id:r,cEvent:B,cSubArea:i}=e;return{label:t,handle:g,icon:o,class:n,order:s,loading:!1,size:"mini",nButtonid:r,cEvent:B,cSubArea:i,name:t,code:g,params:JSON.stringify(e)}}function Ct(e){const{cFieldtype:t,cLabel:g,cProp:o,cMeta:n,cSeltype:s,cSelval:r,cRequired:B,cPlaceholder:i,nOrder:c,cSign:I,cShow:Q,nLg:a,cDefVal:l,nI18ndata:C,cDirectives:E,cDynamicShow:d,cDynamicRules:w,cDynamicDisabled:m,cWidth:f}=e,y=n?JSON.parse(n):{};var v={components:t,label:g,fieldName:o,componentProps:{placeholder:i,disabled:I==="0"},hidden:Q!=="1",rules:B==="0"?"required":null,colSpan:a,defaultValue:l,order:c};return v={...v,...y},(t==="Input"||t==="Select")&&(v.componentProps.allowClear=!0),s&&r&&y.components!=="DatePicker"&&(v.componentProps.options=Qe(e),s==="3"&&(v.components="SunnyCustomizeSelect",v.componentProps.cNum=r)),v.dependencies={show:U=>{const D=JSON.parse(d),h=SA(D,U);return h?new Function(`return ${h}`)():!0},required:U=>{const D=JSON.parse(w),h=SA(D,U);return h?new Function(`return ${h}`)():!0},disabled:U=>{const D=JSON.parse(m),h=SA(D,U);return h?new Function(`return ${h}`)():!1}},v}function ct(e){const{cLabel:t,cProp:g,cFieldtype:o,cMeta:n,cSeltype:s,cSelval:r,cWidth:B,nOrder:i,nBill:c,cSign:I,cRequired:Q,cShow:a,cDirectives:l,cEntityTable:C,cDynamicRules:E,cDynamicDisabled:d}=e,w=n?JSON.parse(n):{};var m={title:t,field:g,width:B,...Y.EditRender[o]??{},params:{required:Q==="0",disabled:I==="0",visible:a==="0",order:i,nBill:c,cEntityTable:C}};return m={...w,...m},s&&r&&(m.params.options=Qe(e)),m}function UA(e){const t=T.groupBy(T.orderBy(e.resFieldList.map(s=>({...Ct(s),cArea:s.cArea})),["order"],["asc"]),"cArea"),g=T.groupBy(T.orderBy(e.resButtonList.map(s=>({...lt(s),cArea:s.cArea,cSubArea:s.cSubArea})),["order"],["asc"]),"cArea"),o=T.groupBy(T.orderBy(e.resFieldList.map(s=>({...ct(s),cArea:s.cArea})),["order"],["asc"]),"cArea"),n=e.resMenu;return{resFieldList:t,resButtonList:g,resColumnList:o,resMenu:n}}function Qe(e){const{cSeltype:t,cSelval:g,fieldDictList:o,fieldUserExresList:n}=e;var s=[];return t==="0"?s=o.map(r=>({label:r.cName,value:r.cXuhao,cConnkey:r.cConnkey})):t==="1"?s=_[g]:t==="2"?s=[]:t==="3"?s=[]:t==="4"&&(s=n.map(r=>({label:r.cExresnum+"-"+r.cExresname,value:r.cExresnum}))),s}function DA(e,t){const g=(t||[]).find(o=>o.value==e);return g?g.label:e}function ie(e,t){console.error("[Error Report]",{error:e,context:t,timestamp:new Date().toISOString()})}function Zl(e){const t=e.reason instanceof Error?e.reason:new Error(String(e.reason));ie(t,{type:"unhandledrejection",url:window.location.href,userAgent:navigator.userAgent,timestamp:new Date().toISOString()})}function Jl(e){const t=e.error instanceof Error?e.error:new Error(e.message);ie(t,{type:"global_error",filename:e.filename,lineno:e.lineno,colno:e.colno,url:window.location.href,userAgent:navigator.userAgent,timestamp:new Date().toISOString()})}const Qt=()=>({findAllByResourceid:e=>G.post("/core/assSearchplan/findAllByResourceid",e),findSearchPlanColsByPlanId:e=>G.post("/core/assSearchplan/findSearchPlanColsByPlanId",e),insert:e=>G.post("/core/assSearchplan/insert",e),update:e=>G.post("/core/assSearchplan/update",e),del:e=>G.post("/core/assSearchplan/delete",e),findDefSearchPlan:e=>G.post("/core/assSearchplan/findDefSearchPlan",e)}),Ee=Qt();function lA(e){const{searchFormSchema:t,tableColumns:g,dataType:o,resourceConfig:n,queryFunction:s,gridEvents:r,treeConfig:B,loadMethod:i,objectToValueFields:c,fieldMappingTime:I,arrayToStringFields:Q,lazy:a,autoLoad:l=!0,showCheckbox:C=!0,aggregateConfig:E,queryOnReset:d=!0}=e,{toolbarButtonClick:w,...m}=r||{},{resourceId:f,nResourceid:y,cModnumb:v}=n,U=A.ref([]),D=A.ref(void 0),h=A.ref(!1),{enhancedSchema:k}=wA(t);let F;const{enhancedSchema:N}=uA(k,{onAutoSelect:R=>MA(R,F)}),[u,p]=Y.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:h},actionColProps:{span:24,sm:12,md:8,lg:6,xl:4},schema:N.value,objectToValueFields:c,fieldMappingTime:I,arrayToStringFields:Q});F=p;const M=A.reactive({id:"OperationLogQuery",border:!0,size:"mini",showOverflow:!0,stripe:!B&&!a,height:"auto",align:"center",rowConfig:{keyField:"id",isCurrent:!0,isHover:!0},...C&&{checkboxConfig:{highlight:!0,range:!B&&!a,reserve:!1,trigger:"row",checkStrictly:!!(B||a)}},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(P){console.error("查询注册节点失败:",P),b.Message.error(t("jobinfo.queryFailed"))}break;case"jobinfo/rizhi":window.location.href=`/setting/dsrw/joblog?jobGroup=${p.jobGroup}&jobDesc=${encodeURIComponent(p.jobDesc)}`;break}},N=()=>{E.value?.refresh()};return(u,p)=>(A.openBlock(),A.createElementBlock("div",{class:"job-info-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:p[3]||(p[3]=A.withKeys((...M)=>A.unref(w)&&A.unref(w)(...M),["enter"])),tabindex:"-1"},[A.createElementVNode("div",lB,[A.createElementVNode("div",CB,[A.createVNode(A.unref(a))]),A.createElementVNode("div",cB,[A.createVNode(A.unref(C),{class:"flex-1"},{actionSlot:A.withCtx(({row:M})=>[(A.openBlock(!0),A.createElementBlock(A.Fragment,null,A.renderList(k(),P=>(A.openBlock(),A.createElementBlock("button",{key:P.id,type:"button",class:"text-[rgb(var(--primary-6))] hover:text-[rgb(var(--primary-5))] mr-2",onClick:z=>F(P,M)},A.toDisplayString(P.label),9,QB))),128))]),_:1})])]),A.createVNode($s,{ref_key:"formRef",ref:B,visible:n.value,"onUpdate:visible":p[0]||(p[0]=M=>n.value=M),onSuccess:N},null,8,["visible"]),A.createVNode(eB,{ref_key:"onceRef",ref:i,visible:s.value,"onUpdate:visible":p[1]||(p[1]=M=>s.value=M),onSuccess:N},null,8,["visible"]),A.createVNode(aB,{ref_key:"codeRef",ref:c,visible:r.value,"onUpdate:visible":p[2]||(p[2]=M=>r.value=M),onSuccess:N},null,8,["visible"])],32))}}),[["__scopeId","data-v-73ae3969"]]),xe=({t:e})=>{const t=[{cKeyname:e("joblog.success"),cKeynumb:"200"},{cKeyname:e("joblog.failure"),cKeynumb:"500"},{cKeyname:e("joblog.empty"),cKeynumb:"0"}],g=[{cKeyname:e("joblog.success"),cKeynumb:"200"},{cKeyname:e("joblog.failure"),cKeynumb:"500"},{cKeyname:e("joblog.failureTimeout"),cKeynumb:"502"}],o=[{fieldName:"jobGroup",label:e("joblog.executor"),component:"Select",componentProps:{placeholder:e("joblog.selectExecutor"),allowClear:!0,options:[]},colProps:{span:4}},{fieldName:"jobDesc",label:e("joblog.jobDesc"),component:"Input",componentProps:{placeholder:e("joblog.inputJobDesc"),allowClear:!0},colProps:{span:4}},{fieldName:"triggerStatus",label:e("joblog.status"),component:"Select",componentProps:{placeholder:e("joblog.selectStatus"),allowClear:!0,options:[{label:e("joblog.all"),value:"-1"},{label:e("joblog.success"),value:"1"},{label:e("joblog.failure"),value:"2"},{label:e("joblog.running"),value:"3"}]},colProps:{span:4}},{fieldName:"timeList",label:e("joblog.scheduleDate"),component:"RangePicker",componentProps:{allowClear:!0,format:"YYYY-MM-DD",valueFormat:"YYYY-MM-DD"},colProps:{span:4}}],n=[{field:"jobld",title:e("joblog.jobId")},{field:"jobDesc",title:e("joblog.jobDesc")},{field:"triggerCode",title:e("joblog.scheduleResult"),formatter:({cellValue:s})=>t.find(B=>B.cKeynumb===s)?.cKeyname||s},{field:"triggerTime",title:e("joblog.scheduleTime")},{field:"executorAddress",title:e("joblog.executorAddress")},{field:"executorHandler",title:e("joblog.executorHandler")},{field:"executorParam",title:e("joblog.executorParam")},{field:"handleDdbz",title:e("joblog.scheduleRemark"),slots:{default:"handleDdbzSlot"}},{field:"handleTime",title:e("joblog.handleTime")},{field:"handleCode",title:e("joblog.handleResult"),formatter:({cellValue:s})=>g.find(B=>B.cKeynumb===s)?.cKeyname||s},{field:"handleMsg",title:e("joblog.handleMsg"),slots:{default:"handleMsgSlot"}},{field:"handleZxrz",title:e("joblog.handleLog"),slots:{default:"handleZxrzSlot"}}];return{searchFormSchema:o,tableColumns:n,triggerCodeOptions:t,handleCodeOptions:g}},EB={resourceId:"joblog",nResourceid:583,cModnumb:"9aad5aa1-14be-4c03-934d-e9e6722cdd4f"},IB={class:"bg-[#2b2b2b] inline-block text-center w-[40px] mr-2.5 select-none"},dB={class:"inline-block whitespace-nowrap mr-2.5"},fB={class:"absolute right-2.5 bottom-2.5 flex items-end flex-wrap flex-col h-[160px] justify-evenly"},wB=A.defineComponent({__name:"LogList",props:{visible:{type:Boolean}},emits:["update:visible"],setup(e,{expose:t,emit:g}){const{t:o}=$.useI18n(),n=g,s=A.ref(!1),r=A.ref([]),B=A.ref(""),i=A.ref(!1),c=A.ref(null),I=async C=>{B.value=C,r.value=[];try{const E=await G.post("/schedule/joblog/logDetail",{fromLineNum:0,id:C});E.success&&E.data&&(r.value=E.data.content?.logContentList||[],n("update:visible",!0),A.nextTick(()=>{c.value&&(c.value.scrollTop=c.value.scrollHeight)}))}catch(E){console.error("获取日志失败:",E)}},Q=()=>{c.value&&(c.value.scrollTop=0)},a=async()=>{i.value=!0;try{const C=await G.post("/schedule/joblog/logDetail",{fromLineNum:r.value.length+1,id:B.value});if(C.success&&C.data){const E=C.data.content?.logContentList||[];r.value=r.value.concat(E),A.nextTick(()=>{c.value&&(c.value.scrollTop=c.value.scrollHeight)})}}catch(C){console.error("加载更多日志失败:",C)}finally{i.value=!1}},l=()=>{n("update:visible",!1)};return t({show:I}),(C,E)=>{const d=A.resolveComponent("a-button"),w=A.resolveComponent("a-modal");return A.openBlock(),A.createBlock(w,{visible:e.visible,"onUpdate:visible":E[1]||(E[1]=m=>n("update:visible",m)),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:A.withCtx(()=>[A.createElementVNode("div",{ref_key:"logboxRef",ref:c,class:"overflow-y-auto scroll-smooth bg-[#222]",style:A.normalizeStyle({height:s.value?"100vh":"60vh"})},[(A.openBlock(!0),A.createElementBlock(A.Fragment,null,A.renderList(r.value,(m,f)=>(A.openBlock(),A.createElementBlock("div",{key:f,class:"bg-[#222] leading-[28px] text-xs text-[#ccc] whitespace-nowrap hover:bg-[#2b2b2b]"},[A.createElementVNode("div",IB,A.toDisplayString(f+1),1),A.createElementVNode("div",dB,A.toDisplayString(m),1)]))),128))],4),A.createElementVNode("div",fB,[A.createVNode(d,{type:"primary",status:"danger",shape:"circle",onClick:l,tooltip:A.unref(o)("joblog.close")},{icon:A.withCtx(()=>[A.createVNode(A.unref(Ut))]),_:1},8,["tooltip"]),A.createVNode(d,{type:"primary",status:"danger",shape:"circle",onClick:E[0]||(E[0]=m=>s.value=!s.value),tooltip:A.unref(o)("joblog.fullscreen")},{icon:A.withCtx(()=>[A.createVNode(A.unref(so))]),_:1},8,["tooltip"]),A.createVNode(d,{type:"primary",status:"danger",shape:"circle",onClick:Q,tooltip:A.unref(o)("joblog.scrollToTop")},{icon:A.withCtx(()=>[A.createVNode(A.unref(ht))]),_:1},8,["tooltip"]),A.createVNode(d,{type:"primary",status:"danger",shape:"circle",loading:i.value,onClick:a,tooltip:A.unref(o)("joblog.scrollToBottom")},{icon:A.withCtx(()=>[A.createVNode(A.unref(yt))]),_:1},8,["loading","tooltip"])])]),_:1},8,["visible","fullscreen"])}}}),uB={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},mB={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},DB={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},pB=["onClick"],bB=["onClick"],PB=["onClick"],vB={class:"p-5"},MB=["innerHTML"],yB={class:"flex justify-center mt-4"},FB=A.defineComponent({__name:"JobLogQuery",setup(e){const{t}=$.useI18n(),{searchFormSchema:g,tableColumns:o}=xe({t}),n=A.ref(!1),s=A.ref(""),r=A.ref(!1),B=A.ref(null),i=async({page:h,formValues:k})=>{const F={pageNo:h.currentPage,pageSize:h.pageSize,xxlJobLog:k};return G.post("/schedule/joblog/selectForPage",F)},{QueryForm:c,formApi:I,Grid:Q,gridApi:a,submitting:l,handleGlobalEnter:C,searchPlanList:E,currentSearchPlan:d,resourceId:w,nResourceid:m,handleSearchPlanSearch:f,handleDefaultPlanLoaded:y}=lA({searchFormSchema:g,tableColumns:o,resourceConfig:EB,queryFunction:i}),v=h=>{s.value=h.handleDdbz||"",n.value=!0},U=h=>{b.Modal.info({title:t("joblog.handleMsgTitle"),content:h||"",width:500})},D=h=>{B.value&&B.value.show(h.jobld.toString())};return(h,k)=>{const F=A.resolveComponent("a-button"),N=A.resolveComponent("a-modal");return A.openBlock(),A.createElementBlock("div",{class:"job-log-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:k[3]||(k[3]=A.withKeys((...u)=>A.unref(C)&&A.unref(C)(...u),["enter"])),tabindex:"-1"},[A.createElementVNode("div",uB,[A.createElementVNode("div",mB,[A.createVNode(A.unref(c))]),A.createElementVNode("div",DB,[A.createVNode(A.unref(Q),{class:"flex-1"},{handleDdbzSlot:A.withCtx(({row:u})=>[A.createElementVNode("button",{type:"button",class:"text-[rgb(var(--primary-6))] hover:text-[rgb(var(--primary-5))]",onClick:p=>v(u)},A.toDisplayString(A.unref(t)("joblog.view")),9,pB)]),handleMsgSlot:A.withCtx(({row:u})=>[u.handleMsg?(A.openBlock(),A.createElementBlock("button",{key:0,type:"button",class:"text-[rgb(var(--primary-6))] hover:text-[rgb(var(--primary-5))]",onClick:p=>U(u.handleMsg)},A.toDisplayString(A.unref(t)("joblog.view")),9,bB)):A.createCommentVNode("",!0)]),handleZxrzSlot:A.withCtx(({row:u})=>[u.nShow===1?(A.openBlock(),A.createElementBlock("button",{key:0,type:"button",class:"text-[rgb(var(--primary-6))] hover:text-[rgb(var(--primary-5))]",onClick:p=>D(u)},A.toDisplayString(A.unref(t)("joblog.view")),9,PB)):A.createCommentVNode("",!0)]),_:1})])]),A.createVNode(N,{visible:n.value,"onUpdate:visible":k[1]||(k[1]=u=>n.value=u),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:A.withCtx(()=>[...k[4]||(k[4]=[A.createElementVNode("div",null,null,-1)])]),default:A.withCtx(()=>[A.createElementVNode("div",vB,[A.createElementVNode("div",{innerHTML:s.value},null,8,MB)]),A.createElementVNode("div",yB,[A.createVNode(F,{type:"primary",onClick:k[0]||(k[0]=u=>n.value=!1)},{default:A.withCtx(()=>[A.createTextVNode(A.toDisplayString(A.unref(t)("joblog.confirm")),1)]),_:1})])]),_:1},8,["visible"]),A.createVNode(wB,{ref_key:"logListRef",ref:B,visible:r.value,"onUpdate:visible":k[2]||(k[2]=u=>r.value=u)},null,8,["visible"])],32)}}}),Ve=({t:e})=>{const t=[{cKeyname:e("jobgroup.online"),cKeynumb:"1"},{cKeyname:e("jobgroup.offline"),cKeynumb:"0"}],g=[{cKeyname:e("jobgroup.autoRegister"),cKeynumb:"0"},{cKeyname:e("jobgroup.manualEntry"),cKeynumb:"1"}],o=[{fieldName:"appname",label:e("jobgroup.appname"),component:"Input",componentProps:{placeholder:e("jobgroup.inputAppname"),allowClear:!0},colProps:{span:4}},{fieldName:"title",label:e("jobgroup.title"),component:"Input",componentProps:{placeholder:e("jobgroup.inputTitle"),allowClear:!0},colProps:{span:4}}],n=[{field:"appname",title:e("jobgroup.appname")},{field:"title",title:e("jobgroup.title")},{field:"addressType",title:e("jobgroup.registerType"),formatter:({cellValue:s})=>g.find(B=>B.cKeynumb===s)?.cKeyname||s},{field:"addressList",title:e("jobgroup.onlineAddressList")},{field:"action",title:e("jobgroup.action"),fixed:"right",width:400,slots:{default:"actionSlot"}}];return{searchFormSchema:o,tableColumns:n,statusOptions:t,zcfsOpts:g}},kB={resourceId:"jobgroup",nResourceid:584,cModnumb:"bfd3d15f-f261-4e02-9f37-be3dfd7edd00"},zB={class:"flex justify-end gap-2 mt-4"},hB=A.defineComponent({__name:"JobGroupForm",props:{visible:{type:Boolean},formData:{}},emits:["update:visible","success"],setup(e,{expose:t,emit:g}){const{t:o}=$.useI18n(),n=e,s=g,r=A.ref(null),B=A.reactive({appname:"",title:"",addressType:"0",addressList:"",id:""}),i={zcfsOpts:[{cKeyname:o("jobgroup.autoRegister"),cKeynumb:"0"},{cKeyname:o("jobgroup.manualEntry"),cKeynumb:"1"}]},c=A.ref(!1);A.watch(()=>n.formData,a=>{a&&Object.assign(B,a)},{deep:!0});const I=async()=>{r.value&&r.value.validate().then(async()=>{c.value=!0;try{let a;B.id?a=await G.post("/schedule/jobgroup/update",B):a=await G.post("/schedule/jobgroup/save",B),a.success&&(b.Message.success(B.id?o("jobgroup.editSuccess"):o("jobgroup.addSuccess")),s("success"),Q())}catch(a){console.error("保存失败:",a),b.Message.error(o("jobgroup.saveFailed"))}finally{c.value=!1}})},Q=()=>{r.value&&r.value.clearValidate(),Object.assign(B,{appname:"",title:"",addressType:"0",addressList:"",id:""}),s("update:visible",!1)};return t({show:a=>{a?Object.assign(B,a):Object.assign(B,{appname:"",title:"",addressType:"0",addressList:"",id:""}),s("update:visible",!0)}}),(a,l)=>{const C=A.resolveComponent("a-input"),E=A.resolveComponent("a-form-item"),d=A.resolveComponent("a-radio"),w=A.resolveComponent("a-radio-group"),m=A.resolveComponent("a-textarea"),f=A.resolveComponent("a-form"),y=A.resolveComponent("a-button"),v=A.resolveComponent("a-modal");return A.openBlock(),A.createBlock(v,{title:B.id?A.unref(o)("jobgroup.editTitle"):A.unref(o)("jobgroup.addTitle"),visible:e.visible,"onUpdate:visible":l[4]||(l[4]=U=>s("update:visible",U)),"mask-closable":!1,closable:!1,width:"900px",footer:!1},{default:A.withCtx(()=>[A.createVNode(f,{ref_key:"formRef",ref:r,model:B,"label-width":130},{default:A.withCtx(()=>[A.createVNode(E,{label:A.unref(o)("jobgroup.appname"),field:"appname",rules:[{required:!0,message:A.unref(o)("jobgroup.inputAppname")}]},{default:A.withCtx(()=>[A.createVNode(C,{modelValue:B.appname,"onUpdate:modelValue":l[0]||(l[0]=U=>B.appname=U),placeholder:A.unref(o)("jobgroup.inputAppname")},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),A.createVNode(E,{label:A.unref(o)("jobgroup.title"),field:"title",rules:[{required:!0,message:A.unref(o)("jobgroup.inputTitle")}]},{default:A.withCtx(()=>[A.createVNode(C,{modelValue:B.title,"onUpdate:modelValue":l[1]||(l[1]=U=>B.title=U),placeholder:A.unref(o)("jobgroup.inputTitle")},null,8,["modelValue","placeholder"])]),_:1},8,["label","rules"]),A.createVNode(E,{label:A.unref(o)("jobgroup.registerType"),field:"addressType",rules:[{required:!0,message:A.unref(o)("jobgroup.selectRegisterType")}]},{default:A.withCtx(()=>[A.createVNode(w,{modelValue:B.addressType,"onUpdate:modelValue":l[2]||(l[2]=U=>B.addressType=U)},{default:A.withCtx(()=>[(A.openBlock(!0),A.createElementBlock(A.Fragment,null,A.renderList(i.zcfsOpts,U=>(A.openBlock(),A.createBlock(d,{key:U.cKeynumb,value:U.cKeynumb},{default:A.withCtx(()=>[A.createTextVNode(A.toDisplayString(U.cKeyname),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["label","rules"]),A.createVNode(E,{label:A.unref(o)("jobgroup.machineAddress"),field:"addressList",rules:[{required:B.addressType==="1",message:A.unref(o)("jobgroup.inputMachineAddress")}]},{default:A.withCtx(()=>[A.createVNode(m,{modelValue:B.addressList,"onUpdate:modelValue":l[3]||(l[3]=U=>B.addressList=U),rows:4,"max-rows":8,disabled:B.addressType==="0",placeholder:A.unref(o)("jobgroup.inputMachineAddressList")},null,8,["modelValue","disabled","placeholder"])]),_:1},8,["label","rules"])]),_:1},8,["model"]),A.createElementVNode("div",zB,[A.createVNode(y,{type:"primary",loading:c.value,onClick:I},{default:A.withCtx(()=>[A.createTextVNode(A.toDisplayString(A.unref(o)("jobgroup.save")),1)]),_:1},8,["loading"]),A.createVNode(y,{onClick:Q},{default:A.withCtx(()=>[A.createTextVNode(A.toDisplayString(A.unref(o)("jobgroup.cancel")),1)]),_:1})])]),_:1},8,["title","visible"])}}}),NB={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},OB={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},SB={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},UB=["onClick"],GB=nA(A.defineComponent({__name:"JobGroupQuery",setup(e){const{t}=$.useI18n(),{searchFormSchema:g,tableColumns:o}=Ve({t}),n=A.ref(!1),s=A.ref(null),r=async({page:h,formValues:k})=>{const F={pageNo:h.currentPage,pageSize:h.pageSize,xxlJobGroup:k};return G.post("/schedule/jobgroup/selectForPage",F)},B={async toolbarButtonClick(h){[...h.$grid.getCheckboxRecords()],h.button.code==="jobgroup/add"&&s.value&&s.value.show()}},{QueryForm:i,formApi:c,Grid:I,gridApi:Q,submitting:a,handleGlobalEnter:l,searchPlanList:C,currentSearchPlan:E,resourceId:d,nResourceid:w,resourceButtons:m,handleSearchPlanSearch:f,handleDefaultPlanLoaded:y}=lA({searchFormSchema:g,tableColumns:o,resourceConfig:kB,queryFunction:r,gridEvents:B}),v=h=>m.value.filter(k=>k.cSubArea==="columnTable"),U=async(h,k)=>{const{handle:F}=h;switch(F){case"jobgroup/edit":try{const N=await G.post("/schedule/jobgroup/get",{id:k.id});if(N.success&&N.data){const u=N.data;u.addressType=String(u.addressType),s.value&&s.value.show(u)}}catch(N){console.error("查询单个执行器失败:",N),b.Message.error(t("jobgroup.queryFailed"))}break;case"jobgroup/del":b.Modal.confirm({title:t("jobgroup.confirmDelete"),content:t("jobgroup.confirmDeleteSingle",{title:k.title}),onOk:async()=>{try{(await G.post("/schedule/jobgroup/remove",{id:k.id})).success&&(b.Message.success(t("jobgroup.deleteSuccess")),Q.value?.refresh())}catch(N){console.error("删除失败:",N),b.Message.error(t("jobgroup.deleteFailed"))}}});break}},D=()=>{Q.value?.refresh()};return(h,k)=>(A.openBlock(),A.createElementBlock("div",{class:"job-group-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:k[1]||(k[1]=A.withKeys((...F)=>A.unref(l)&&A.unref(l)(...F),["enter"])),tabindex:"-1"},[A.createElementVNode("div",NB,[A.createElementVNode("div",OB,[A.createVNode(A.unref(i))]),A.createElementVNode("div",SB,[A.createVNode(A.unref(I),{class:"flex-1"},{actionSlot:A.withCtx(({row:F})=>[(A.openBlock(!0),A.createElementBlock(A.Fragment,null,A.renderList(v(),N=>(A.openBlock(),A.createElementBlock("button",{key:N.id,type:"button",class:"text-[rgb(var(--primary-6))] hover:text-[rgb(var(--primary-5))] mr-2",onClick:u=>U(N,F)},A.toDisplayString(N.label),9,UB))),128))]),_:1})])]),A.createVNode(hB,{ref_key:"formRef",ref:s,visible:n.value,"onUpdate:visible":k[0]||(k[0]=F=>n.value=F),onSuccess:D},null,8,["visible"])],32))}}),[["__scopeId","data-v-69c513e0"]]),xB=A.markRaw(Y.SunnyCustomizeSelect),Le=({t:e,formApi:t})=>{const g=[{cKeyname:e("zdyxlk.backendSQL"),cKeynumb:"0"},{cKeyname:e("zdyxlk.customImplementation"),cKeynumb:"1"}],o=[{cKeyname:e("zdyxlk.dropdown"),cKeynumb:"0"},{cKeyname:e("zdyxlk.searchableDropdown"),cKeynumb:"1"}],n=[{cKeyname:e("zdyxlk.private"),cKeynumb:"0"},{cKeyname:e("zdyxlk.public"),cKeynumb:"1"}],s=[{cKeyname:e("zdyxlk.exactMatch"),cKeynumb:"0"},{cKeyname:e("zdyxlk.fuzzyMatch"),cKeynumb:"1"}],r=[{fieldName:"cNum",label:e("zdyxlk.cNum"),component:"Input",componentProps:{placeholder:e("zdyxlk.inputcNum"),allowClear:!0},colProps:{span:4}},{fieldName:"cTitle",label:e("zdyxlk.cTitle"),component:"Input",componentProps:{placeholder:e("zdyxlk.inputcTitle"),allowClear:!0},colProps:{span:4}},{fieldName:"cWork",label:e("zdyxlk.cWork"),component:xB,componentProps:{placeholder:e("zdyxlk.inputcWork"),allowClear:!0,cNum:"UserSearch1",fieldNames:{label:"cKeyname",value:"cKeyname"}},colProps:{span:4}}],B=[{type:"checkbox",width:40},{field:"cNum",title:e("zdyxlk.cNum")},{field:"nCbtype",title:e("zdyxlk.nCbtype"),formatter:({cellValue:c})=>g.find(Q=>Q.cKeynumb===c)?.cKeyname||c},{field:"cCbclass",title:e("zdyxlk.cCbclass")},{field:"cTitle",title:e("zdyxlk.cTitle")},{field:"cValcol",title:e("zdyxlk.cValcol")},{field:"cLabelcol",title:e("zdyxlk.cLabelcol")},{field:"cLabelslotcol",title:e("zdyxlk.cLabelslotcol")},{field:"nType",title:e("zdyxlk.nType"),formatter:({cellValue:c})=>o.find(Q=>Q.cKeynumb===c)?.cKeyname||c},{field:"nSearchinterval",title:e("zdyxlk.nSearchinterval")},{field:"cStaffname",title:e("zdyxlk.cStaffname")},{field:"nLimit",title:e("zdyxlk.nLimit")},{field:"nSfcommon",title:e("zdyxlk.nSfcommon"),formatter:({cellValue:c})=>n.find(Q=>Q.cKeynumb===c)?.cKeyname||c}],i=[{fieldName:"nCbtype",label:e("zdyxlk.nCbtype"),component:"Select",componentProps:{placeholder:e("zdyxlk.selectnCbtype"),options:g.map(c=>({label:c.cKeyname,value:c.cKeynumb})),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"cCbclass",label:e("zdyxlk.cCbclass"),component:"Input",componentProps:{placeholder:e("zdyxlk.inputcCbclass"),allowClear:!0},colProps:{span:8}},{fieldName:"cNum",label:e("zdyxlk.cNum"),component:"Input",componentProps:{placeholder:e("zdyxlk.inputcNum"),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"cTitle",label:e("zdyxlk.cTitle"),component:"Input",componentProps:{placeholder:e("zdyxlk.inputcTitle"),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"cValcol",label:e("zdyxlk.cValcol"),component:"Input",componentProps:{placeholder:e("zdyxlk.inputcValcol"),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"cLabelcol",label:e("zdyxlk.cLabelcol"),component:"Input",componentProps:{placeholder:e("zdyxlk.inputcLabelcol"),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"cLabelslotcol",label:e("zdyxlk.cLabelslotcol"),component:"Input",componentProps:{placeholder:e("zdyxlk.inputcLabelslotcol"),allowClear:!0},colProps:{span:8}},{fieldName:"nType",label:e("zdyxlk.nType"),component:"Select",componentProps:{placeholder:e("zdyxlk.selectnType"),options:o.map(c=>({label:c.cKeyname,value:c.cKeynumb})),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"nLikematch",label:e("zdyxlk.nLikematch"),component:"Select",componentProps:{placeholder:e("zdyxlk.selectnLikematch"),options:s.map(c=>({label:c.cKeyname,value:c.cKeynumb})),allowClear:!0},colProps:{span:8}},{fieldName:"nSearchinterval",label:e("zdyxlk.nSearchinterval"),component:"InputNumber",componentProps:{placeholder:"默认700毫秒",min:0,max:5e3,allowClear:!0},colProps:{span:8}},{fieldName:"nLimit",label:e("zdyxlk.nLimit"),component:"InputNumber",componentProps:{placeholder:"默认20",min:1,max:1e3,allowClear:!0},colProps:{span:8}},{fieldName:"nSfcommon",label:e("zdyxlk.nSfcommon"),component:"Select",componentProps:{placeholder:e("zdyxlk.selectnSfcommon"),options:n.map(c=>({label:c.cKeyname,value:c.cKeynumb})),allowClear:!0},colProps:{span:8}},{fieldName:"cPrefixUrl",label:e("zdyxlk.cPrefixUrl"),component:"Input",componentProps:{placeholder:e("zdyxlk.inputcPrefixUrl"),allowClear:!0},colProps:{span:8}}];return{searchFormSchema:r,tableColumns:B,addEditFormSchema:i,nCbtypeOptions:g,nTypeOptions:o,nSfcommonOptions:n,nLikematchOptions:s}},VB={resourceId:"zdyxlk",nResourceid:11908,cModnumb:"ZDYXLK"},LB=A.defineComponent({__name:"ZdyxlkAdd",emits:["success"],setup(e,{expose:t,emit:g}){const{t:o}=$.useI18n(),n=A.ref(!1),s=A.ref("add"),r=A.ref(!1),B=g,[i,c]=Y.useSunnyForm({layout:"vertical",size:"small",labelWidth:120,showDefaultActions:!1,scrollToFirstError:!0,schema:[]}),{addEditFormSchema:I}=Le({t:o,formApi:c});c.setState({handleValuesChange:d=>{"nCbtype"in d&&(d.nCbtype,Q(d.nCbtype))}});const Q=d=>{const w=d==="0";c.updateSchema([{fieldName:"cValcol",hidden:!w},{fieldName:"cLabelcol",hidden:!w}])};t({addInit:async()=>{n.value=!0,s.value="add",c.setState({schema:I}),c.resetForm(),c.setValues({nCbtype:"0"}),await A.nextTick(),Q("0")},editInit:async d=>{r.value=!0,s.value="edit";let w=null;try{const m=await G.post("/core/assSelect/update_init",{id:d.id});m.code===200&&m.result&&(w={...m.result},w.nCbtype!==void 0&&(w.nCbtype=String(w.nCbtype)),w.nLikematch!==void 0&&(w.nLikematch=String(w.nLikematch)),w.nSfcommon!==void 0&&(w.nSfcommon=String(w.nSfcommon)),w.nType!==void 0&&(w.nType=String(w.nType)))}catch(m){console.error("查询失败:",m),b.Message.error(o("zdyxlk.queryFailed"))}n.value=!0,await A.nextTick(),c.setState({schema:I}),c.resetForm(),w&&(c.setValues(w,!1),c.updateSchema([{fieldName:"cNum",componentProps:{disabled:!0}}]),Q(w.nCbtype)),r.value=!1}});const C=async()=>{const{valid:d}=await c.validate();if(!d)return!1;const m={...await c.getValues()};try{const f=await G.post(s.value==="add"?"/core/assSelect/insert":"/core/assSelect/update",m);return f.code===200?(b.Message.success(s.value==="add"?o("zdyxlk.addSuccess"):o("zdyxlk.editSuccess")),n.value=!1,B("success"),!0):(b.Message.error(f.message||o("zdyxlk.saveFailed")),!1)}catch(f){return console.error("保存失败:",f),b.Message.error(o("zdyxlk.saveFailed")),!1}},E=()=>{n.value=!1};return(d,w)=>(A.openBlock(),A.createBlock(A.unref(Y.Modal),{"model-value":n.value,title:s.value==="add"?A.unref(o)("zdyxlk.addTitle"):A.unref(o)("zdyxlk.editTitle"),"on-before-ok":C,onClose:E,width:"800px"},{default:A.withCtx(()=>[A.createVNode(A.unref(i))]),_:1},8,["model-value","title"]))}}),YB={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},KB={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},RB={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},jB=["onClick"],XB=nA(A.defineComponent({__name:"ZdyxlkQuery",setup(e){const t=A.ref(),{t:g}=$.useI18n(),{searchFormSchema:o,tableColumns:n}=Le({t:g}),s=async({page:U,formValues:D})=>{const h={pageNo:U.currentPage,pageSize:U.pageSize,assSelect:D},k=await G.post("/core/assSelect/selectForPage",h);return k.code===200&&k.result&&k.result.records&&(k.result.records=k.result.records.map(F=>({...F,nCbtype:F.nCbtype!==void 0?String(F.nCbtype):F.nCbtype,nType:F.nType!==void 0?String(F.nType):F.nType,nLikematch:F.nLikematch!==void 0?String(F.nLikematch):F.nLikematch,nSfcommon:F.nSfcommon!==void 0?String(F.nSfcommon):F.nSfcommon}))),k},r={async toolbarButtonClick(U){const D=[...U.$grid.getCheckboxRecords()];switch(U.button.code){case"zdyxlk/add":t.value.addInit();break;case"zdyxlk/edit":if(D.length!==1){b.Message.warning(g("common.selectOne"));return}t.value.editInit(D[0]);break;case"zdyxlk/del":if(D.length===0){b.Message.warning(g("zdyxlk.selectDeleteRecords"));return}b.Modal.confirm({title:g("zdyxlk.confirmDelete"),content:g("zdyxlk.confirmDeleteMultiple",{count:D.length}),onBeforeOk:async()=>{const h=D.map(F=>F.id),k=await G.post("/core/assSelect/delete",{idList:h});return k.code===200?(b.Message.success(k.message),U.$grid.commitProxy("query",{}),!0):(b.Message.error(k.message),!1)}});break}}},{QueryForm:B,formApi:i,Grid:c,gridApi:I,submitting:Q,handleGlobalEnter:a,searchPlanList:l,currentSearchPlan:C,resourceId:E,nResourceid:d,resourceButtons:w,handleSearchPlanSearch:m,handleDefaultPlanLoaded:f}=lA({searchFormSchema:o,tableColumns:n,resourceConfig:VB,queryFunction:s,gridEvents:r}),y=U=>w.value.filter(D=>D.cSubArea==="columnTable"),v=async(U,D)=>{const{handle:h}=U;switch(h){case"zdyxlk/edit":t.value.editInit(D);break;case"zdyxlk/del":b.Modal.confirm({title:g("zdyxlk.confirmDelete"),content:g("zdyxlk.confirmDeleteSingle",{CTitle:D.CTitle}),onOk:async()=>{try{const k=await G.post("/core/assSelect/delete",{id:D.id});k.code===200?(b.Message.success(k.message),I.value?.refresh()):b.Message.error(k.message)}catch(k){console.error("删除失败:",k),b.Message.error(g("zdyxlk.deleteFailed"))}}});break}};return(U,D)=>(A.openBlock(),A.createElementBlock("div",{class:"zdyxlk-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:D[1]||(D[1]=A.withKeys((...h)=>A.unref(a)&&A.unref(a)(...h),["enter"])),tabindex:"-1"},[A.createElementVNode("div",YB,[A.createElementVNode("div",KB,[A.createVNode(A.unref(B))]),A.createElementVNode("div",RB,[A.createVNode(A.unref(c),{class:"flex-1"},{actionSlot:A.withCtx(({row:h})=>[(A.openBlock(!0),A.createElementBlock(A.Fragment,null,A.renderList(y(),k=>(A.openBlock(),A.createElementBlock("button",{key:k.id,type:"button",class:"text-[rgb(var(--primary-6))] hover:text-[rgb(var(--primary-5))] mr-2",onClick:F=>v(k,h)},A.toDisplayString(k.label),9,jB))),128))]),_:1})])]),A.createVNode(LB,{ref_key:"ZdyxlkAddRef",ref:t,onSuccess:D[0]||(D[0]=()=>A.unref(I).commitProxy("query"))},null,512)],32))}}),[["__scopeId","data-v-2065aa57"]]),le=({t:e})=>{const t=[{cKeyname:"启用",cKeynumb:"0"},{cKeyname:"禁用",cKeynumb:"1"}],g=[{fieldName:"cModnumb",label:e("assSendoa.cModnumb"),component:"Input",componentProps:{placeholder:e("assSendoa.inputcModnumb"),allowClear:!0},colProps:{span:4}},{fieldName:"cGongsi",label:e("assSendoa.cGongsi"),component:"Input",componentProps:{placeholder:e("assSendoa.inputcGongsi"),allowClear:!0},colProps:{span:4}},{fieldName:"nSign",label:e("assSendoa.nSign"),component:"Select",componentProps:{placeholder:e("assSendoa.selectnSign"),allowClear:!0,options:t.map(s=>({label:s.cKeyname,value:s.cKeynumb}))},colProps:{span:4}},{fieldName:"cUrl",label:e("assSendoa.cUrl"),component:"Input",componentProps:{placeholder:e("assSendoa.inputcUrl"),allowClear:!0},colProps:{span:4}}],o=[{type:"checkbox",width:40},{field:"cModnumb",title:e("assSendoa.cModnumb")},{field:"cGongsi",title:e("assSendoa.cGongsi")},{field:"cLcmc",title:e("assSendoa.cLcmc")},{field:"cOalcid",title:e("assSendoa.cOalcid")},{field:"cUrl",title:e("assSendoa.cUrl")},{field:"nSign",title:e("assSendoa.nSign"),formatter:({cellValue:s})=>t.find(B=>B.cKeynumb===s)?.cKeyname||s},{field:"cCreateuserName",title:e("assSendoa.CreateuserName")},{field:"dCreatetime",title:e("assSendoa.dCreatetime")},{field:"cBeizhu",title:e("assSendoa.cBeizhu")}],n=[{fieldName:"cModnumb",label:e("assSendoa.cModnumb"),component:"Input",componentProps:{placeholder:e("assSendoa.inputcModnumb"),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"cGongsi",label:e("assSendoa.cGongsi"),component:"Input",componentProps:{placeholder:e("assSendoa.inputcGongsi"),allowClear:!0},colProps:{span:8}},{fieldName:"nSign",label:e("assSendoa.nSign"),component:"Select",componentProps:{placeholder:e("assSendoa.selectnSign"),options:t.map(s=>({label:s.cKeyname,value:s.cKeynumb})),allowClear:!0},colProps:{span:8}},{fieldName:"cLcmc",label:e("assSendoa.cLcmc"),component:"Input",componentProps:{placeholder:e("assSendoa.inputcLcmc"),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"cUrl",label:e("assSendoa.cUrl"),component:"Input",componentProps:{placeholder:e("assSendoa.inputcUrl"),allowClear:!0},rules:"required",colProps:{span:8}},{fieldName:"cOalcid",label:e("assSendoa.cOalcid"),component:"Input",componentProps:{placeholder:e("assSendoa.cOalcid"),allowClear:!0},rules:"required",colProps:{span:8}}];return{searchFormSchema:g,tableColumns:o,addEditFormSchema:n,userSfqyOpts:t}},ZB={resourceId:"assSendoa",nResourceid:326,cModnumb:"066e0071-1bb5-494a-9d5e-506eb65b8c81"},Ye=A.defineComponent({__name:"AssSendoaAdd",emits:["success"],setup(e,{expose:t,emit:g}){const{t:o}=$.useI18n(),n=A.ref(!1),s=A.ref("add"),r=A.ref(!1),B=g,[i,c]=Y.useSunnyForm({layout:"vertical",size:"small",labelWidth:120,showDefaultActions:!1,scrollToFirstError:!0,schema:[]}),{addEditFormSchema:I}=le({t:o});t({addInit:async()=>{n.value=!0,s.value="add",c.setState({schema:I}),c.resetForm(),await A.nextTick()},editInit:async E=>{r.value=!0,s.value="edit";let d=null;try{const w=await G.post("/core/assSendoa/update_init",{assSendoa:{id:E.id}});w.code===200&&w.result&&(d={...w.result},d.nSign!==void 0&&(d.nSign=String(d.nSign)))}catch(w){console.error("查询失败:",w),b.Message.error(o("assSendoa.queryFailed"))}n.value=!0,await A.nextTick(),c.setState({schema:I}),c.resetForm(),d&&c.setValues(d,!1),r.value=!1}});const l=async()=>{const{valid:E}=await c.validate();if(!E)return!1;const w={assSendoa:{...await c.getValues()}};try{const m=await G.post(s.value==="add"?"/core/assSendoa/insert":"/core/assSendoa/update",w);return m.code===200?(b.Message.success(s.value==="add"?o("assSendoa.addSuccess"):o("assSendoa.editSuccess")),n.value=!1,B("success"),!0):(b.Message.error(m.message||o("assSendoa.saveFailed")),!1)}catch(m){return console.error("保存失败:",m),b.Message.error(o("assSendoa.saveFailed")),!1}},C=()=>{n.value=!1};return(E,d)=>(A.openBlock(),A.createBlock(A.unref(Y.Modal),{"model-value":n.value,title:s.value==="add"?A.unref(o)("assSendoa.addTitle"):A.unref(o)("assSendoa.editTitle"),"on-before-ok":l,onClose:C,width:"800px"},{default:A.withCtx(()=>[A.createVNode(A.unref(i))]),_:1},8,["model-value","title"]))}}),JB={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},HB={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},WB={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},TB=["onClick"],qB=nA(A.defineComponent({__name:"AssSendoaQuery",setup(e){const t=A.ref(),{t:g}=$.useI18n(),{searchFormSchema:o,tableColumns:n}=le({t:g}),s=async({page:U,formValues:D})=>{const h={pageNo:U.currentPage,pageSize:U.pageSize,assSendoa:D},k=await G.post("/core/assSendoa/selectForPage",h);return k.result&&k.result.records&&k.result.records.forEach(F=>{F.nSign!==void 0&&(F.nSign=String(F.nSign))}),k},r={async toolbarButtonClick(U){const D=[...U.$grid.getCheckboxRecords()];switch(U.button.code){case"assSendoa/add":t.value.addInit();break;case"assSendoa/edit":if(D.length!==1){b.Message.warning(g("common.selectOne"));return}t.value.editInit(D[0]);break;case"assSendoa/del":if(D.length===0){b.Message.warning(g("assSendoa.selectDeleteRecords"));return}b.Modal.confirm({title:g("assSendoa.confirmDelete"),content:g("assSendoa.confirmDeleteMultiple",{count:D.length}),onBeforeOk:async()=>{const h=D.map(F=>F.id),k=await G.post("/core/assSendoa/delete",{idList:h});return k.code===200?(b.Message.success(k.message),U.$grid.commitProxy("query",{}),!0):(b.Message.error(k.message),!1)}});break}}},{QueryForm:B,formApi:i,Grid:c,gridApi:I,submitting:Q,handleGlobalEnter:a,searchPlanList:l,currentSearchPlan:C,resourceId:E,nResourceid:d,resourceButtons:w,handleSearchPlanSearch:m,handleDefaultPlanLoaded:f}=lA({searchFormSchema:o,tableColumns:n,resourceConfig:ZB,queryFunction:s,gridEvents:r}),y=U=>w.value.filter(D=>D.cSubArea==="columnTable"),v=async(U,D)=>{const{handle:h}=U;switch(h){case"assSendoa/edit":t.value.editInit(D);break;case"assSendoa/del":b.Modal.confirm({title:g("assSendoa.confirmDelete"),content:g("assSendoa.confirmDeleteSingle",{cModnumb:D.cModnumb}),onOk:async()=>{try{const k=await G.post("/core/assSendoa/delete",{id:D.id});k.code===200?(b.Message.success(k.message),I.value?.refresh()):b.Message.error(k.message)}catch(k){console.error("删除失败:",k),b.Message.error(g("assSendoa.deleteFailed"))}}});break}};return(U,D)=>(A.openBlock(),A.createElementBlock("div",{class:"assSendoa-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:D[1]||(D[1]=A.withKeys((...h)=>A.unref(a)&&A.unref(a)(...h),["enter"])),tabindex:"-1"},[A.createElementVNode("div",JB,[A.createElementVNode("div",HB,[A.createVNode(A.unref(B))]),A.createElementVNode("div",WB,[A.createVNode(A.unref(c),{class:"flex-1"},{actionSlot:A.withCtx(({row:h})=>[(A.openBlock(!0),A.createElementBlock(A.Fragment,null,A.renderList(y(),k=>(A.openBlock(),A.createElementBlock("button",{key:k.id,type:"button",class:"text-[rgb(var(--primary-6))] hover:text-[rgb(var(--primary-5))] mr-2",onClick:F=>v(k,h)},A.toDisplayString(k.label),9,TB))),128))]),_:1})])]),A.createVNode(Ye,{ref_key:"AssSendoaAddRef",ref:t,onSuccess:D[0]||(D[0]=()=>A.unref(I).commitProxy("query"))},null,512)],32))}}),[["__scopeId","data-v-53c27ad8"]]),Ke=({t:e})=>{const t=[{fieldName:"cNum",label:e("ggcxtc.cNum"),component:"Input",componentProps:{placeholder:e("ggcxtc.inputcNum"),allowClear:!0},colProps:{span:4}},{fieldName:"cTitle",label:e("ggcxtc.cTitle"),component:"Input",componentProps:{placeholder:e("ggcxtc.inputcTitle"),allowClear:!0},colProps:{span:4}},{fieldName:"nSfcommon",label:e("ggcxtc.nSfcommon"),component:"Select",componentProps:{placeholder:e("ggcxtc.selectnSfcommon"),allowClear:!0,options:ae},colProps:{span:4}}],g=[{type:"checkbox",width:40},{field:"cNum",title:e("ggcxtc.cNum")},{field:"cTitle",title:e("ggcxtc.cTitle")},{field:"nCbtype",title:e("ggcxtc.nCbtype"),formatter:({cellValue:o})=>ke.find(s=>s.value===o)?.label||o},{field:"cCbclass",title:e("ggcxtc.cCbclass")},{field:"cCondition",title:e("ggcxtc.cCondition")},{field:"cWidth",title:e("ggcxtc.cWidth")},{field:"cHeight",title:e("ggcxtc.cHeight")},{field:"nRows",title:e("ggcxtc.nRows")},{field:"cSql",title:e("ggcxtc.cSql")},{field:"cTablecols",title:e("ggcxtc.cTablecols")},{field:"cCrenumb",title:e("ggcxtc.cCrenumb")},{field:"cCrename",title:e("ggcxtc.cCrename")},{field:"dDate",title:e("ggcxtc.dDate")},{field:"cOrder",title:e("ggcxtc.cOrder")},{field:"nSfcommon",title:e("ggcxtc.nSfcommon"),formatter:({cellValue:o})=>ae.find(s=>s.value===o)?.label||o}];return{searchFormSchema:t,tableColumns:g}},_B={resourceId:"Ggcxtc",nResourceid:11955,cModnumb:"GGCXTC"},$B=A.defineComponent({__name:"GgcxtcReview",props:{visible:{type:Boolean},cNum:{}},emits:["close"],setup(e,{emit:t}){const g=e,o=t,{t:n}=$.useI18n(),[s,r]=Y.useSunnyForm({layout:"vertical",size:"small",labelWidth:120,showDefaultActions:!1,scrollToFirstError:!0,schema:[{fieldName:"businessSearchValue",label:"业务搜索",component:"SunnyBusinessSearch",componentProps:()=>({cNum:g.cNum,placeholder:"请选择",modalProps:{multiple:!0,fieldNames:{label:"LASTNAME",value:"WORKCODE"}}}),colProps:{span:8}}]});A.watch(()=>g.visible,c=>{c&&r.resetForm()});const B=async()=>{const{valid:c}=await r.validate();return c?(o("close"),!0):!1},i=()=>{o("close")};return(c,I)=>(A.openBlock(),A.createBlock(A.unref(Y.Modal),{"model-value":e.visible,title:"预览查询弹窗","on-before-ok":B,onClose:i,width:"800px"},{default:A.withCtx(()=>[A.createVNode(A.unref(s))]),_:1},8,["model-value"]))}}),Aa={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},ea={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},ta={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},oa=["onClick"],ga=nA(A.defineComponent({__name:"GgcxtcQuery",setup(e){const{t}=$.useI18n(),{searchFormSchema:g,tableColumns:o}=Ke({t}),n=A.ref(!1),s=A.ref(""),r=async({page:D,formValues:h})=>{const k={pageNo:D.currentPage,pageSize:D.pageSize,assDialog:h},F=await G.post("/core/assDialog/selectForPage",k);return F.result&&F.result.records&&F.result.records.forEach(N=>{N.nCbtype!==void 0&&(N.nCbtype=String(N.nCbtype)),N.nSfcommon!==void 0&&(N.nSfcommon=String(N.nSfcommon))}),F},B={async toolbarButtonClick(D){const h=[...D.$grid.getCheckboxRecords()];switch(D.button.code){case"ggcxtc/add":b.Message.info("新增功能开发中");break;case"ggcxtc/edit":if(h.length!==1){b.Message.warning(t("common.selectOne"));return}b.Message.info("修改功能开发中");break;case"ggcxtc/review":if(h.length!==1){b.Message.warning(t("common.selectOne"));return}s.value=h[0].cNum,n.value=!0;break;case"ggcxtc/del":if(h.length===0){b.Message.warning(t("ggcxtc.selectDeleteRecords"));return}b.Modal.confirm({title:t("ggcxtc.confirmDelete"),content:t("ggcxtc.confirmDeleteMultiple",{count:h.length}),onBeforeOk:async()=>{const k=h.map(N=>N.id),F=await G.post("/core/assDialog/delete",{idList:k});return F.code===200?(b.Message.success(F.message),D.$grid.commitProxy("query",{}),!0):(b.Message.error(F.message),!1)}});break}}},{QueryForm:i,formApi:c,Grid:I,gridApi:Q,submitting:a,handleGlobalEnter:l,searchPlanList:C,currentSearchPlan:E,resourceId:d,nResourceid:w,resourceButtons:m,handleSearchPlanSearch:f,handleDefaultPlanLoaded:y}=lA({searchFormSchema:g,tableColumns:o,resourceConfig:_B,queryFunction:r,gridEvents:B}),v=D=>m.value.filter(h=>h.cSubArea==="columnTable"),U=async(D,h)=>{const{handle:k}=D;switch(k){case"ggcxtc/add":b.Message.info("新增功能开发中");break;case"ggcxtc/edit":b.Message.info("修改功能开发中");break;case"ggcxtc/review":s.value=h.cNum,n.value=!0;break;case"ggcxtc/del":b.Modal.confirm({title:t("ggcxtc.confirmDelete"),content:t("ggcxtc.confirmDeleteSingle",{cTitle:h.cTitle}),onOk:async()=>{try{const F=await G.post("/core/assDialog/delete",{id:h.id});F.code===200?(b.Message.success(F.message),Q.value?.refresh()):b.Message.error(F.message)}catch(F){console.error("删除失败:",F),b.Message.error(t("ggcxtc.deleteFailed"))}}});break}};return(D,h)=>(A.openBlock(),A.createElementBlock("div",{class:"ggcxtc-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:h[1]||(h[1]=A.withKeys((...k)=>A.unref(l)&&A.unref(l)(...k),["enter"])),tabindex:"-1"},[A.createElementVNode("div",Aa,[A.createElementVNode("div",ea,[A.createVNode(A.unref(i))]),A.createElementVNode("div",ta,[A.createVNode(A.unref(I),{class:"flex-1"},{actionSlot:A.withCtx(({row:k})=>[(A.openBlock(!0),A.createElementBlock(A.Fragment,null,A.renderList(v(),F=>(A.openBlock(),A.createElementBlock("button",{key:F.id,type:"button",class:"text-[rgb(var(--primary-6))] hover:text-[rgb(var(--primary-5))] mr-2",onClick:N=>U(F,k)},A.toDisplayString(F.label),9,oa))),128))]),_:1})])]),A.createVNode($B,{visible:n.value,"c-num":s.value,onClose:h[0]||(h[0]=k=>n.value=!1)},null,8,["visible","c-num"])],32))}}),[["__scopeId","data-v-1c9496cc"]]);function hA({t:e}){const t=[{fieldName:"cExresnum",label:e("otherPermissions.cExresnum"),component:"Input",componentProps:{placeholder:e("otherPermissions.inputcExresnum"),allowClear:!0},colProps:{span:6}},{fieldName:"cExresname",label:e("otherPermissions.cExresname"),component:"Input",componentProps:{placeholder:e("otherPermissions.inputcExresname"),allowClear:!0},colProps:{span:6}}],g=[{fieldName:"cExresnum",label:e("otherPermissions.cExresnum"),component:"Input",rules:"required",componentProps:{placeholder:e("otherPermissions.inputcExresnum"),allowClear:!0}},{fieldName:"cExresname",label:e("otherPermissions.cExresname"),component:"Input",rules:"required",componentProps:{placeholder:e("otherPermissions.inputcExresname"),allowClear:!0}},{fieldName:"cOrg",label:e("otherPermissions.cOrg"),component:"Select",componentProps:{placeholder:e("otherPermissions.inputcOrg"),allowClear:!0},permissionOptions:{code:"COMPANY",fieldMapping:{label:"cExresname",value:"cExresnum"}}},{fieldName:"nOrder",label:e("otherPermissions.nOrder"),component:"InputNumber",componentProps:{placeholder:e("otherPermissions.inputnOrder"),min:1,precision:0}}],o=[{type:"checkbox",width:50},{field:"cExresnum",title:e("otherPermissions.cExresnum"),minWidth:140,treeNode:!0,params:{nBill:3,cEntityTable:"AUTH_EXRES"}},{field:"cExresname",title:e("otherPermissions.cExresname"),minWidth:180},{field:"cOrg",title:e("otherPermissions.cOrg"),minWidth:150},{field:"dCredate",title:e("otherPermissions.dCredate"),width:180},{field:"cCreateName",title:e("otherPermissions.cCreateName"),width:120},{field:"nOrder",title:e("otherPermissions.nOrder"),width:80}];return{searchFormSchema:t,addFormSchema:g,tableColumns:o}}const na={resourceId:"otherPermissions",nResourceid:67,cModnumb:"db7a8e32-f20b-444b-af0f-aed54ec99532"};class ra{cache=new Map;loadingPromises=new Map;async loadOptions(t,g,o=!1){const n=Y.DEFAULT_FORM_COMMON_CONFIG.selectOptionsAdapter;if(!n?.loadOptions)return console.warn("[SelectOptionsManager] Adapter not configured"),{};if(!t||t.length===0)return{};const s=o?t:t.filter(i=>!this.cache.has(String(i)));if(s.length===0){const i={};return t.forEach(c=>{i[String(c)]=this.cache.get(String(c))||[]}),i}const r=s.map(String).sort((i,c)=>i.localeCompare(c)).join(",");let B=this.loadingPromises.get(r);B||(B=n.loadOptions(s,g),this.loadingPromises.set(r,B));try{const i=await B;i&&typeof i=="object"&&Object.keys(i).forEach(I=>{this.cache.set(I,i[I])});const c={};return t.forEach(I=>{c[String(I)]=this.cache.get(String(I))||[]}),c}finally{this.loadingPromises.delete(r)}}getOptions(t){return this.cache.get(String(t))||[]}clearCache(t){t?this.cache.delete(String(t)):this.cache.clear()}hasCache(t){return this.cache.has(String(t))}getCacheSize(){return this.cache.size}}const PA=new ra;function fA(e){const{numbList:t,fieldMapping:g,immediate:o=!0,forceReload:n=!1}=e,s=A.ref({}),r=A.ref(!1),B=async()=>{if(!(!t||t.length===0)){r.value=!0;try{const Q=await PA.loadOptions(t,g,n);s.value=Q}catch(Q){console.error("[useSelectOptions] Failed to load options:",Q)}finally{r.value=!1}}},i=Q=>s.value[String(Q)]||[],c=async Q=>{PA.clearCache(Q);const a=await PA.loadOptions([Q],g,!0);s.value={...s.value,...a}},I=Q=>{if(PA.clearCache(Q),Q){const a={...s.value};delete a[String(Q)],s.value=a}else s.value={}};return o&&t&&t.length>0&&(A.getCurrentInstance()?A.onMounted(()=>{B()}):B()),{optionsMap:s,loading:r,load:B,getOptions:i,reload:c,clearCache:I}}function wA(e,t=!0){const g=A.computed(()=>{const i=typeof e=="object"&&"value"in e?e.value:e,c=[];return i.forEach(I=>{I.selectOptions?.dictCode&&c.push({fieldName:I.fieldName||"",...I.selectOptions})}),c}),o=A.computed(()=>{const i=new Set;return g.value.forEach(c=>{i.add(c.dictCode)}),Array.from(i)}),{optionsMap:n,loading:s,load:r}=fA({numbList:o.value,fieldMapping:g.value[0]?.fieldMapping,immediate:!1}),B=A.computed(()=>(typeof e=="object"&&"value"in e?e.value:e).map(c=>{if(c.selectOptions?.dictCode){const I=c.componentProps,Q=String(c.selectOptions.dictCode);return{...c,componentProps:a=>({...typeof I=="function"?I(a):I,options:n.value[Q]||[]})}}return c}));return t&&o.value.length>0&&A.onMounted(async()=>{await r()}),{enhancedSchema:B,optionsMap:n,loading:s,load:r}}async function sa(e,t){if(!e||e.length===0)return;const{load:g}=fA({numbList:e,fieldMapping:t,immediate:!1});await g()}function Ba(e){const t=new Set;return e.forEach(g=>{g.selectOptions?.dictCode&&t.add(g.selectOptions.dictCode)}),Array.from(t)}class aa{cache=new Map;loadingPromises=new Map;async loadOptions(t,g,o=!1){const n=Y.DEFAULT_FORM_COMMON_CONFIG.permissionOptionsAdapter;if(!n?.loadOptions)return console.warn("[PermissionOptionsManager] Adapter not configured"),{};if(!t||t.length===0)return{};const s=o?t:t.filter(i=>!this.cache.has(String(i)));if(s.length===0){const i={};return t.forEach(c=>{i[String(c)]=this.cache.get(String(c))||[]}),i}const r=s.map(String).sort((i,c)=>i.localeCompare(c)).join(",");let B=this.loadingPromises.get(r);B||(B=n.loadOptions(s,g),this.loadingPromises.set(r,B));try{const i=await B;i&&typeof i=="object"&&Object.keys(i).forEach(I=>{this.cache.set(I,i[I])});const c={};return t.forEach(I=>{c[String(I)]=this.cache.get(String(I))||[]}),c}finally{this.loadingPromises.delete(r)}}getOptions(t){return this.cache.get(String(t))||[]}clearCache(t){t?this.cache.delete(String(t)):this.cache.clear()}hasCache(t){return this.cache.has(String(t))}getCacheSize(){return this.cache.size}}const vA=new aa;function Re(e){const{numbList:t,fieldMapping:g,immediate:o=!0,forceReload:n=!1}=e,s=A.ref({}),r=A.ref(!1),B=async()=>{if(!(!t||t.length===0)){r.value=!0;try{const Q=await vA.loadOptions(t,g,n);s.value=Q}catch(Q){console.error("[usePermissionOptions] Failed to load options:",Q)}finally{r.value=!1}}},i=Q=>s.value[String(Q)]||[],c=async Q=>{vA.clearCache(Q);const a=await vA.loadOptions([Q],g,!0);s.value={...s.value,...a}},I=Q=>{if(vA.clearCache(Q),Q){const a={...s.value};delete a[String(Q)],s.value=a}else s.value={}};return o&&t&&t.length>0&&(A.getCurrentInstance()?A.onMounted(()=>{B()}):B()),{optionsMap:s,loading:r,load:B,getOptions:i,reload:c,clearCache:I}}function uA(e,t={}){const{immediate:g=!0,onAutoSelect:o}=t,n=A.computed(()=>{const Q=A.isRef(e)?e.value:e,a=[];return Q.forEach(l=>{l.permissionOptions?.code&&a.push({fieldName:l.fieldName||"",...l.permissionOptions})}),console.log("[useSchemaPermissionLoader] collectDeclarations:",a),a}),s=A.computed(()=>{const Q=new Set;return n.value.forEach(a=>{Q.add(a.code)}),Array.from(Q)}),{optionsMap:r,loading:B,load:i}=Re({numbList:s.value,fieldMapping:n.value[0]?.fieldMapping,immediate:!1}),c=A.computed(()=>{const Q=A.isRef(e)?e.value:e;return console.log("[useSchemaPermissionLoader] schemaValue:",Q),console.log("[useSchemaPermissionLoader] optionsMap.value:",r.value),Q.map(a=>{if(a.permissionOptions?.code){const l=a.componentProps,C=String(a.permissionOptions.code);return{...a,componentProps:E=>({...typeof l=="function"?l(E):l,options:r.value[C]||[]})}}return a})}),I=A.computed(()=>{const Q={};return n.value.forEach(a=>{if(a.autoSelectFirst){const l=String(a.code),C=r.value[l];C&&C.length>0&&(Q[a.fieldName]=C[0].value)}}),Q});return console.log("[useSchemaPermissionLoader] immediate:",g,"codes.value.length:",s.value.length),g&&s.value.length>0&&A.onMounted(async()=>{console.log("[useSchemaPermissionLoader] onMounted triggered, calling load()"),await i();const Q=I.value;Object.keys(Q).length>0&&o&&await o(Q)}),{enhancedSchema:c,optionsMap:r,loading:B,load:i,autoSelectDefaults:I}}function la(e){const t=new Set;return e.forEach(g=>{g.permissionOptions?.code&&t.add(g.permissionOptions.code)}),Array.from(t)}async function MA(e,t){const g=Object.keys(e);if(g.length===0)return;const o=await t.getValues();for(const n of g){const s=o[n];(s==null||s==="")&&await t.setFieldValue(n,e[n])}}const je={layout:"vertical",size:"mini",labelWidth:"auto",gridProps:{xGap:8,yGap:0},commonConfig:{colProps:{span:24,lg:8,xl:6}},showDefaultActions:!1,scrollToFirstError:!0};function mA({schema:e=[],objectToValueFields:t,handleValuesChange:g,...o}={}){const{enhancedSchema:n}=wA(e);let s;const{enhancedSchema:r}=uA(n,{onAutoSelect:i=>MA(i,s)}),B=Y.useSunnyForm({...je,schema:r.value,...t?{objectToValueFields:t}:{},...g?{handleValuesChange:g}:{},...o});return s=B[1],B}const Xe=A.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(e,{emit:t}){const{t:g}=$.useI18n(),{addFormSchema:o}=hA({t:g}),n=e,s=t;A.ref(!1);const[r,B]=mA({schema:o});A.watch(()=>n.visible,Q=>{Q&&(B.resetForm(),n.cExresnum&&B.setValues({cExresparnum:n.cExresnum,id:n.id}))});const i=A.computed(()=>n.parentId&&n.parentId!=="0"?`${g("otherPermissions.addTitle")} - ${n.parentName}`:g("otherPermissions.addTitle"));async function c(){try{const{valid:Q}=await B.validate();if(!Q)return!1;const l={authExres:{...await B.getValues(),cExresparnum:n.cExresnum||"",id:n.id||""}},C=await G.post("/core/authExres/add",l);return b.Message.success(C.message||g("otherPermissions.addSuccess")),s("success"),!0}catch(Q){return console.error("新增失败:",Q),!1}}function I(){s("update:visible",!1)}return(Q,a)=>(A.openBlock(),A.createBlock(A.unref(Y.Modal),{"model-value":n.visible,title:i.value,width:700,"on-before-ok":c,"onUpdate:modelValue":a[0]||(a[0]=l=>s("update:visible",l)),onClose:I},{default:A.withCtx(()=>[A.createVNode(A.unref(r))]),_:1},8,["model-value","title"]))}}),Ze=A.defineComponent({name:"OtherPermissionsUpdate",__name:"OtherPermissionsUpdate",props:{visible:{type:Boolean,default:!1},row:{default:null}},emits:["update:visible","success"],setup(e,{emit:t}){const{t:g}=$.useI18n(),{addFormSchema:o}=hA({t:g}),n=e,s=t;A.ref(!1);const[r,B]=mA({schema:o});A.watch(()=>n.visible,Q=>{Q&&n.row&&(B.resetForm(),B.setValues({...n.row}),B.updateSchema([{fieldName:"cExresnum",componentProps:{disabled:!0}}]))});const i=A.computed(()=>g("otherPermissions.updateTitle"));async function c(){try{const{valid:Q}=await B.validate();if(!Q)return!1;const l={authExres:{...await B.getValues(),id:n.row.id,cExresparnum:n.row.cExresparnum||""}},C=await G.post("/core/authExres/edit",l);return b.Message.success(C.message||g("otherPermissions.updateSuccess")),s("success"),!0}catch(Q){return console.error("修改失败:",Q),!1}}function I(){s("update:visible",!1)}return(Q,a)=>(A.openBlock(),A.createBlock(A.unref(Y.Modal),{"model-value":n.visible,title:i.value,width:700,"on-before-ok":c,"onUpdate:modelValue":a[0]||(a[0]=l=>s("update:visible",l)),onClose:I},{default:A.withCtx(()=>[A.createVNode(A.unref(r))]),_:1},8,["model-value","title"]))}}),Ca={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},ca={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},Qa={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},ia=nA(A.defineComponent({__name:"OtherPermissionsQuery",setup(e){const{t}=$.useI18n(),{searchFormSchema:g,tableColumns:o}=hA({t}),n=async({page:z,formValues:V})=>{const L={pageNo:z.currentPage,pageSize:z.pageSize,authExres:{...V,nType:0}},X=await G.post("/core/authExres/selectForPage",L);return X.result?.records&&(X.result.records=X.result.records.map(H=>({...H,hasChildren:!0}))),X};async function s({row:z}){await i.getValues();const V={authExres:{cExresparnum:z.cExresnum}};try{return((await G.post("/core/authExres/queryChildList",V)).result?.authExresList||[]).map(H=>({...H}))}catch(L){return console.error("加载子节点失败:",L),[]}}const r={lazy:!0,rowField:"id",hasChild:"hasChildren",expandAll:!1,loadMethod:s},{QueryForm:B,formApi:i,Grid:c,gridApi:I,submitting:Q,handleGlobalEnter:a,searchPlanList:l,currentSearchPlan:C,resourceId:E,nResourceid:d,handleSearchPlanSearch:w,handleDefaultPlanLoaded:m,businessResumeState:f}=lA({searchFormSchema:g,tableColumns:o,resourceConfig:na,queryFunction:n,gridEvents:{toolbarButtonClick:({code:z})=>{z==="otherPermissions/add"?y():z==="otherPermissions/update"?v():z==="otherPermissions/enable"?U("10001"):z==="otherPermissions/disable"?U("10002"):z==="otherPermissions/del"&&D()}},treeConfig:r,lazy:!0});function y(){const z=I.getSelection();if(z.length>1){b.Message.warning(t("common.selectOne"));return}z.length===1?(u.value=z[0].cExresnum,p.value=z[0].id,F.value=z[0].id,N.value=z[0].cExresname):(u.value="",p.value="",F.value="0",N.value=""),k.value=!0}function v(){const z=I.getSelection();if(z.length!==1){b.Message.warning("请选择一条数据进行修改");return}const V=z[0];P.value=V,M.value=!0}async function U(z){const V=I.getSelection();if(V.length===0){b.Message.warning("请选择要操作的数据");return}if(V.length>1){b.Message.warning(t("common.selectOne"));return}const L=V[0];try{const X=await G.post("/core/authExres/sign",{authExres:{id:L.id,cSign:z}});b.Message.success(X.message||t("otherPermissions.signSuccess")),I.commitProxy("query")}catch(X){console.error("操作失败:",X)}}function D(){const z=I.getSelection();if(z.length===0){b.Message.warning(t("common.selectData"));return}if(z.length>1){b.Message.warning(t("common.selectOne"));return}const V=z[0];b.Modal.confirm({title:t("common.confirm"),content:t("otherPermissions.delConfirm"),okText:t("common.confirm"),cancelText:t("common.cancel"),onOk:async()=>{try{const L=await G.post("/core/authExres/delete",{authExres:{id:V.id}});b.Message.success(L.message||t("otherPermissions.delSuccess")),I.commitProxy("query")}catch(L){console.error("删除失败:",L)}}})}function h(){I.commitProxy("query")}const k=A.ref(!1),F=A.ref("0"),N=A.ref(""),u=A.ref(""),p=A.ref(""),M=A.ref(!1),P=A.ref(null);return(z,V)=>(A.openBlock(),A.createElementBlock("div",{class:"other-permissions-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:V[2]||(V[2]=A.withKeys((...L)=>A.unref(a)&&A.unref(a)(...L),["enter"])),tabindex:"-1"},[A.createElementVNode("div",Ca,[A.createElementVNode("div",ca,[A.createVNode(A.unref(B))]),A.createElementVNode("div",Qa,[A.createVNode(A.unref(c),{class:"flex-1"})])]),A.createVNode(Xe,{visible:k.value,"onUpdate:visible":V[0]||(V[0]=L=>k.value=L),"parent-id":F.value,"parent-name":N.value,"c-exresnum":u.value,id:p.value,onSuccess:h},null,8,["visible","parent-id","parent-name","c-exresnum","id"]),A.createVNode(Ze,{visible:M.value,"onUpdate:visible":V[1]||(V[1]=L=>M.value=L),row:P.value,onSuccess:h},null,8,["visible","row"]),A.createVNode(A.unref(pA),{state:A.unref(f)},null,8,["state"])],32))}}),[["__scopeId","data-v-96f076fe"]]);function Je(){return G.post("/core/assSysSetting/findAllSettings",{})}function He(e){return G.post("/core/assSysSetting/saveAllSettings",{assSysSettingList:e})}const Ea={class:"h-full w-full overflow-auto bg-[var(--color-fill-2)]"},Ia={class:"flex flex-col h-full w-full"},da={class:"flex-1 overflow-auto"},fa={class:"space-y-4"},wa={class:"grid grid-cols-1 md:grid-cols-2 gap-x-8 gap-y-4"},ua={class:"flex items-center gap-3"},ma={class:"shrink-0 w-20 text-sm text-[var(--color-text-2)]"},Da={class:"flex items-start gap-3"},pa={class:"shrink-0 w-20 pt-1.5 text-sm text-[var(--color-text-2)]"},ba={class:"flex-1"},Pa={class:"flex gap-2"},va={key:0,class:"flex flex-wrap gap-1.5 mt-2"},Ma={class:"grid grid-cols-1 lg:grid-cols-2 gap-4 items-start"},ya={class:"flex items-center justify-between"},Fa={class:"text-sm text-[var(--color-text-1)]"},ka={class:"text-xs text-[var(--color-text-4)] mt-0.5"},za={key:0,class:"mt-4 pt-4 border-t border-[var(--color-border-1)] space-y-3"},ha={class:"flex items-center gap-3"},Na={class:"shrink-0 w-20 text-sm text-[var(--color-text-2)]"},Oa={class:"flex items-center gap-3"},Sa={class:"shrink-0 w-20 text-sm text-[var(--color-text-2)]"},Ua={class:"flex items-center justify-between"},Ga={class:"text-sm text-[var(--color-text-1)]"},xa={class:"text-xs text-[var(--color-text-4)] mt-0.5"},Va={class:"shrink-0 p-2 bg-[var(--color-bg-2)] border-t border-[var(--color-border-1)]"},La={class:"flex justify-end"},Ya=A.defineComponent({__name:"SystemSetting",setup(e){const{t}=oA.useI18n(),g=A.ref(!1),o=A.ref(!1),n=A.reactive({initialPassword:"",weakPasswords:[],showSubMenuIcon:!0,showAgent:!1,agentUrl:"",agentToken:""}),s=A.ref([]),r=A.ref(""),B=A.computed(()=>n.showAgent),i=()=>{const a=r.value.trim();if(!a){b.Message.warning(t("common.systemSetting.enterWeakPassword"));return}if(s.value.some(l=>l.password===a)){b.Message.warning(t("common.systemSetting.weakPasswordExists"));return}s.value.push({id:Date.now().toString(),password:a}),n.weakPasswords=s.value.map(l=>l.password),r.value=""},c=a=>{s.value=s.value.filter(l=>l.id!==a),n.weakPasswords=s.value.map(l=>l.password)},I=async()=>{g.value=!0;try{((await Je()).result||[]).forEach(C=>{switch(C.cNum){case"InitPwd":n.initialPassword=C.cValue||"";break;case"PwdStrVal":try{const E=JSON.parse(C.cValue||"{}");E.list&&Array.isArray(E.list)&&(s.value=E.list.map((d,w)=>({id:String(w),password:d})),n.weakPasswords=E.list)}catch(E){console.error("Parse weak password config failed",E)}break;case"SubMenuIconShow":try{const E=JSON.parse(C.cValue||"{}");n.showSubMenuIcon=E.show===E.activeValue||E.show==="1"}catch(E){console.error("Parse menu icon config failed",E)}break;case"ShowAgent":try{const E=JSON.parse(C.cValue||"{}");n.showAgent=E.show===E.activeValue||E.show==="1",n.agentUrl=E.agentUrl||"",n.agentToken=E.token||""}catch(E){console.error("Parse agent config failed",E)}break}})}catch{b.Message.error(t("common.systemSetting.loadFailed"))}finally{g.value=!1}},Q=async()=>{if(n.showAgent){if(!n.agentUrl.trim()){b.Message.warning(t("common.systemSetting.enterAgentUrl"));return}if(!n.agentToken.trim()){b.Message.warning(t("common.systemSetting.enterAgentToken"));return}}o.value=!0;try{const a=[{cNum:"InitPwd",cValue:n.initialPassword},{cNum:"PwdStrVal",cValue:JSON.stringify({enabled:!0,list:n.weakPasswords})},{cNum:"SubMenuIconShow",cValue:JSON.stringify({show:n.showSubMenuIcon?"1":"0",activeText:"显示",activeValue:"1",inactiveText:"不显示",inactiveValue:"0"})},{cNum:"ShowAgent",cValue:JSON.stringify({show:n.showAgent?"1":"0",activeText:"显示",activeValue:"1",inactiveText:"不显示",inactiveValue:"0",type:"dify",token:n.agentToken,agentUrl:n.agentUrl})}];await He(a),b.Message.success(t("common.systemSetting.saveSuccess"))}catch{b.Message.error(t("common.systemSetting.saveFailed"))}finally{o.value=!1}};return I(),(a,l)=>{const C=A.resolveComponent("a-input-password"),E=A.resolveComponent("a-input"),d=A.resolveComponent("a-button"),w=A.resolveComponent("a-tag"),m=A.resolveComponent("a-card"),f=A.resolveComponent("a-switch"),y=A.resolveComponent("a-spin");return A.openBlock(),A.createElementBlock("div",Ea,[A.createVNode(y,{loading:g.value,class:"h-full w-full"},{default:A.withCtx(()=>[A.createElementVNode("div",Ia,[A.createElementVNode("div",da,[A.createElementVNode("div",fa,[A.createVNode(m,{title:A.unref(t)("common.systemSetting.securitySetting"),bordered:!1},{extra:A.withCtx(()=>[A.createVNode(A.unref(ho),{class:"text-[var(--color-text-4)]"})]),default:A.withCtx(()=>[A.createElementVNode("div",wa,[A.createElementVNode("div",ua,[A.createElementVNode("label",ma,A.toDisplayString(A.unref(t)("common.systemSetting.initialPassword")),1),A.createVNode(C,{modelValue:n.initialPassword,"onUpdate:modelValue":l[0]||(l[0]=v=>n.initialPassword=v),placeholder:A.unref(t)("common.systemSetting.initialPasswordPlaceholder"),"allow-clear":"",class:"flex-1"},null,8,["modelValue","placeholder"])]),A.createElementVNode("div",Da,[A.createElementVNode("label",pa,A.toDisplayString(A.unref(t)("common.systemSetting.weakPassword")),1),A.createElementVNode("div",ba,[A.createElementVNode("div",Pa,[A.createVNode(E,{modelValue:r.value,"onUpdate:modelValue":l[1]||(l[1]=v=>r.value=v),placeholder:A.unref(t)("common.systemSetting.weakPasswordPlaceholder"),"allow-clear":"",size:"small",onPressEnter:i},null,8,["modelValue","placeholder"]),A.createVNode(d,{type:"primary",size:"small",onClick:i},{default:A.withCtx(()=>[A.createVNode(A.unref(Ie))]),_:1})]),s.value.length>0?(A.openBlock(),A.createElementBlock("div",va,[(A.openBlock(!0),A.createElementBlock(A.Fragment,null,A.renderList(s.value,v=>(A.openBlock(),A.createBlock(w,{key:v.id,closable:"",color:"orangered",size:"small",onClose:U=>c(v.id)},{default:A.withCtx(()=>[A.createTextVNode(A.toDisplayString(v.password),1)]),_:2},1032,["onClose"]))),128))])):A.createCommentVNode("",!0)])])])]),_:1},8,["title"]),A.createElementVNode("div",Ma,[A.createVNode(m,{title:A.unref(t)("common.systemSetting.agentSetting"),bordered:!1},{extra:A.withCtx(()=>[A.createVNode(A.unref(yo),{class:"text-[var(--color-text-4)]"})]),default:A.withCtx(()=>[A.createElementVNode("div",ya,[A.createElementVNode("div",null,[A.createElementVNode("div",Fa,A.toDisplayString(A.unref(t)("common.systemSetting.enableAgent")),1),A.createElementVNode("div",ka,A.toDisplayString(A.unref(t)("common.systemSetting.enableAgentDesc")),1)]),A.createVNode(f,{modelValue:n.showAgent,"onUpdate:modelValue":l[2]||(l[2]=v=>n.showAgent=v)},null,8,["modelValue"])]),A.createVNode(A.Transition,{name:"expand"},{default:A.withCtx(()=>[B.value?(A.openBlock(),A.createElementBlock("div",za,[A.createElementVNode("div",ha,[A.createElementVNode("label",Na,A.toDisplayString(A.unref(t)("common.systemSetting.agentUrl")),1),A.createVNode(E,{modelValue:n.agentUrl,"onUpdate:modelValue":l[3]||(l[3]=v=>n.agentUrl=v),placeholder:A.unref(t)("common.systemSetting.agentUrlPlaceholder"),"allow-clear":"",class:"flex-1"},null,8,["modelValue","placeholder"])]),A.createElementVNode("div",Oa,[A.createElementVNode("label",Sa,A.toDisplayString(A.unref(t)("common.systemSetting.agentToken")),1),A.createVNode(C,{modelValue:n.agentToken,"onUpdate:modelValue":l[4]||(l[4]=v=>n.agentToken=v),placeholder:A.unref(t)("common.systemSetting.agentTokenPlaceholder"),"allow-clear":"",class:"flex-1"},null,8,["modelValue","placeholder"])])])):A.createCommentVNode("",!0)]),_:1})]),_:1},8,["title"]),A.createVNode(m,{title:A.unref(t)("common.systemSetting.interfaceSetting"),bordered:!1},{extra:A.withCtx(()=>[A.createVNode(A.unref(bo),{class:"text-[var(--color-text-4)]"})]),default:A.withCtx(()=>[A.createElementVNode("div",Ua,[A.createElementVNode("div",null,[A.createElementVNode("div",Ga,A.toDisplayString(A.unref(t)("common.systemSetting.subMenuIcon")),1),A.createElementVNode("div",xa,A.toDisplayString(A.unref(t)("common.systemSetting.subMenuIconDesc")),1)]),A.createVNode(f,{modelValue:n.showSubMenuIcon,"onUpdate:modelValue":l[5]||(l[5]=v=>n.showSubMenuIcon=v)},null,8,["modelValue"])])]),_:1},8,["title"])])])]),A.createElementVNode("div",Va,[A.createElementVNode("div",La,[A.createVNode(d,{type:"primary",loading:o.value,onClick:Q},{icon:A.withCtx(()=>[A.createVNode(A.unref($t))]),default:A.withCtx(()=>[A.createTextVNode(" "+A.toDisplayString(A.unref(t)("common.systemSetting.save")),1)]),_:1},8,["loading"])])])])]),_:1},8,["loading"])])}}}),Ka=[{label:"启用",value:"10001"},{label:"禁用",value:"10002"}],Ra=[{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}}],We=[{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}}],ja=[{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:e})=>Ka.find(g=>g.value===e)?.label||e},{field:"cCreateName",title:"创建人",width:120},{field:"dCreate",title:"创建时间",width:180},{field:"nOrder",title:"排序",width:80}],Te=[{type:"checkbox",width:50,align:"center"},{field:"key",title:"属性键",minWidth:150,...Y.EditRender.SelectRender,params:{placeholder:"请选择属性键",allowClear:!0,options:[]},selectOptions:{dictCode:"DICTATTR",fieldMapping:{label:"cName",value:"cXuhao"}},formatter:({cellValue:e,column:t})=>(t.params?.options||[]).find(n=>n.value===e)?.label||e,filters:[{data:{checks:[],sVal:"",sMenu:"",fType1:"",fVal1:"",fMode:"and",fType2:"",fVal2:""}}],filterRender:{name:"FilterCombination"}},{field:"value",title:"属性值",minWidth:200,...Y.EditRender.InputRender,params:{placeholder:"请输入属性值",allowClear:!0},filters:[{data:{checks:[],sVal:"",sMenu:"",fType1:"",fVal1:"",fMode:"and",fType2:"",fVal2:""}}],filterRender:{name:"FilterCombination"}}],Xa=[{field:"cXuhao",title:"子级数据字典编号",minWidth:200,...Y.EditRender.InputRender,params:{placeholder:"请输入子级数据字典编号",allowClear:!0,disabled:!0}},{field:"cName",title:"子级数据字典名称",minWidth:200,...Y.EditRender.InputRender,params:{placeholder:"请输入子级数据字典名称",allowClear:!0}},{field:"nOrder",title:"子级数据字典排序",minWidth:150,...Y.EditRender.InputRender,params:{placeholder:"请输入排序",allowClear:!0}}],qe={key:[{required:!0,message:"请输入属性键"}]},_e=[{code:"insert",name:"添加属性"},{code:"remove",name:"删除"}],$e=[{title:"额外属性",type:"grid",gridConfig:{columns:Te,editRules:qe,toolbarButtons:_e}},{title:"子级数据字典",type:"grid",gridConfig:{columns:Xa,editRules:{},toolbarButtons:[]}}],Za={resourceId:"dataDictionary",nResourceid:62,cModnumb:"40577f0e-1c19-4fa6-bb88-d247fff5e32a"};function Ce({formSchema:e=[],tableColumns:t=[],tableEditRules:g={},tableToolbarButtons:o=[],objectToValueFields:n,aggregateConfig:s,gridEvents:r}={}){const{enhancedSchema:B}=wA(e);let i;const{enhancedSchema:c}=uA(B,{onAutoSelect:v=>MA(v,i)}),Q=(()=>{const v=new Set;return t.forEach(U=>{U.selectOptions?.dictCode&&v.add(U.selectOptions.dictCode)}),Array.from(v)})(),{optionsMap:a,load:l}=fA({numbList:Q,immediate:!1});Q.length>0&&l();const[C,E]=Y.useSunnyForm({layout:"horizontal",size:"mini",labelWidth:100,gridProps:{xGap:0,yGap:0},showDefaultActions:!1,scrollToFirstError:!0,schema:c.value,...n?{objectToValueFields:n}:{}});i=E;const d=v=>v.map(U=>{if(U.selectOptions?.dictCode){const D=String(U.selectOptions.dictCode),h=a.value[D]||[];return{...U,params:{...U.params,options:h}}}return U}),w=A.reactive({id:"meta-grid",columns:d(t),data:[],size:"mini",editRules:g,height:"auto",clipConfig:Y.createEditableClipConfig(),toolbarConfig:{enabled:!0,zoom:!0,custom:!0,buttons:o},zoomConfig:{enabled:!0},columnConfig:{resizable:!0},customConfig:{storage:!0,mode:"popup",showSortPutButton:!0,visibleMethod:v=>!(v.column.type==="checkbox"||v.column.type==="seq")},...s&&{aggregateConfig:s}});A.watch(()=>a.value,()=>{w.columns=d(t)},{deep:!0});const[m,f]=Y.useSunnyEditGrid({gridOptions:w,gridEvents:r}),y=f.reloadData.bind(f);return f.reloadData=v=>(w.data=v,y(v)),[C,E,m,f]}const Ja=A.defineComponent({name:"DataDictionaryAdd",__name:"DataDictionaryAdd",props:{visible:{type:Boolean,default:!1},parentId:{default:"0"},parentName:{default:""}},emits:["update:visible","success"],setup(e,{emit:t}){const g=e,o=t;A.ref(!1);const[n,s,r,B]=Ce({formSchema:We,tableColumns:Te,tableEditRules:qe,tableToolbarButtons:_e});A.watch(()=>g.visible,Q=>{Q&&(s.resetForm(),s.setValues({parentName:g.parentName||"无"}),B.reloadData([]))});const i=A.computed(()=>g.parentId&&g.parentId!=="0"?`新增子级字典 - ${g.parentName}`:"新增根级字典");async function c(){try{const{valid:Q}=await s.validate();if(!Q||await B.validate())return!1;const l=await B.getFullData(),C=l.filter(y=>y.key).map(y=>y.key),E=new Set(C);if(C.length!==E.size)return b.Message.warning("属性键不能重复"),!1;const d=await s.getValues(),w={};l.forEach(y=>{y.key&&(w[y.key]=y.value||"")});const m={authDict:{cXuhao:d.cXuhao,cName:d.cName,cSign:d.cSign,nParent:g.parentId||"0",nOrder:d.nOrder||0,cMeta:JSON.stringify(w)}},f=await G.post("/core/authDict/add",m);return b.Message.success(f.message),o("success"),!0}catch(Q){return console.error("新增失败:",Q),!1}}function I(){o("update:visible",!1)}return(Q,a)=>(A.openBlock(),A.createBlock(A.unref(Y.Modal),{"model-value":g.visible,title:i.value,width:700,"on-before-ok":c,"onUpdate:modelValue":a[0]||(a[0]=l=>o("update:visible",l)),onClose:I},{default:A.withCtx(()=>[A.createVNode(A.unref(n)),A.createVNode(A.unref(r),{id:"metaGrid",border:"","max-height":"300"})]),_:1},8,["model-value","title"]))}});function ce({formSchema:e=[],tabsConfig:t=[],objectToValueFields:g}={}){const{enhancedSchema:o}=wA(e);let n;const{enhancedSchema:s}=uA(o,{onAutoSelect:C=>MA(C,n)}),B=(()=>{const C=new Set;return t.forEach(d=>{d.type==="grid"&&d.gridConfig&&d.gridConfig.columns.forEach(w=>{w.selectOptions?.dictCode&&C.add(w.selectOptions.dictCode)})}),Array.from(C)})(),{optionsMap:i,load:c}=fA({numbList:B,immediate:!1});B.length>0&&c();const[I,Q]=Y.useSunnyForm({layout:"horizontal",size:"small",labelWidth:100,gridProps:{xGap:0,yGap:0},showDefaultActions:!1,scrollToFirstError:!0,schema:s.value,...g?{objectToValueFields:g}:{}});n=Q;const a=A.shallowRef([]),l=A.ref([]);return t.forEach((C,E)=>{if(C.type==="grid"&&C.gridConfig){const d=A.reactive({id:`grid-${E}`,columns:C.gridConfig.columns,data:[],editRules:C.gridConfig.editRules,height:"auto",clipConfig:Y.createEditableClipConfig(),toolbarConfig:{enabled:C.gridConfig.toolbarButtons&&C.gridConfig.toolbarButtons.length>0,zoom:!0,custom:!0,buttons:C.gridConfig.toolbarButtons||[]},zoomConfig:{enabled:!0},customConfig:{storage:!0,mode:"popup",visibleMethod:y=>!(y.column.type==="checkbox"||y.column.type==="seq")},...C.gridConfig.aggregateConfig&&{aggregateConfig:C.gridConfig.aggregateConfig}});A.watch(()=>i.value,y=>{d.columns=(d.columns||[]).map(v=>{if(v.selectOptions?.dictCode){const U=String(v.selectOptions.dictCode),D=y[U]||[];return{...v,params:{...v.params,options:D}}}return v})},{deep:!0});const[w,m]=Y.useSunnyEditGrid({gridOptions:d}),f={...m,reloadData:y=>(d.data=y,m.reloadData(y)),validate:()=>m.validate(),getFullData:()=>m.getFullData()};a.value.push(A.markRaw(w)),l.value.push(f)}}),[I,Q,a,l]}const Ha=A.defineComponent({name:"DataDictionaryUpdate",__name:"DataDictionaryUpdate",props:{visible:{type:Boolean,default:!1},row:{default:void 0}},emits:["update:visible","success"],setup(e,{emit:t}){const{TabPane:g}=b.Tabs,o=e,n=t;A.ref(!1);const s=A.ref(0),[r,B,i,c]=ce({formSchema:We,tabsConfig:$e});A.watch(()=>o.visible,async l=>{if(l&&o.row){await A.nextTick(),B.resetForm(),c.value[0].reloadData([]);try{const E=(await G.post("/core/authDict/editInit",{authDict:{id:o.row.id}})).result;if(E){if(B.setValues({cXuhao:E.authDict.cXuhao,cName:E.authDict.cName,cSign:E.authDict.cSign,nOrder:E.authDict.nOrder}),E.authDict.cMeta)try{const d=JSON.parse(E.authDict.cMeta),w=Object.keys(d).map(m=>({key:m,value:d[m]}));c.value[0].reloadData(w)}catch(d){console.error("解析额外属性失败:",d)}E.childList&&E.childList.length>0?c.value[1].reloadData(E.childList):c.value[1].reloadData([])}}catch(C){console.error("加载数据失败:",C),b.Message.error("加载数据失败")}}});const I=A.computed(()=>"修改字典");async function Q(){try{const{valid:l}=await B.validate();if(!l||await c.value[0].validate())return!1;const E=await c.value[0].getFullData(),d=E.filter(D=>D.key).map(D=>D.key),w=new Set(d);if(d.length!==w.size)return b.Message.warning("属性键不能重复"),!1;const m=await B.getValues(),f={};E.forEach(D=>{D.key&&(f[D.key]=D.value||"")});const y=await c.value[1].getFullData(),v={authDict:{id:o.row?.id,cXuhao:m.cXuhao,cName:m.cName,cSign:m.cSign,nOrder:m.nOrder||0,cMeta:JSON.stringify(f),nParent:o.row?.nParent||0,nType:o.row?.nType||1},authDictList:y},U=await G.post("/core/authDict/edit",v);return b.Message.success(U.message),n("success"),!0}catch(l){return console.error("修改失败:",l),!1}}function a(){n("update:visible",!1)}return(l,C)=>(A.openBlock(),A.createBlock(A.unref(Y.Modal),{"model-value":o.visible,title:I.value,width:700,"on-before-ok":Q,"onUpdate:modelValue":C[1]||(C[1]=E=>n("update:visible",E)),onClose:a},{default:A.withCtx(()=>[A.createVNode(A.unref(r)),A.createVNode(A.unref(b.Tabs),{modelValue:s.value,"onUpdate:modelValue":C[0]||(C[0]=E=>s.value=E)},{default:A.withCtx(()=>[(A.openBlock(!0),A.createElementBlock(A.Fragment,null,A.renderList(A.unref($e),(E,d)=>(A.openBlock(),A.createBlock(A.unref(g),{key:d,title:E.title},{default:A.withCtx(()=>[(A.openBlock(),A.createBlock(A.resolveDynamicComponent(A.unref(i)[d]),{id:`grid-${d}`,border:"","max-height":"300"},null,8,["id"]))]),_:2},1032,["title"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["model-value","title"]))}}),Wa={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},Ta={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},qa={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},_a=nA(A.defineComponent({__name:"DataDictionaryQuery",setup(e){const t=async({page:N,formValues:u})=>{const p={pageNo:N.currentPage,pageSize:N.pageSize,authDict:{cSign:u.cSign||"",cXuhao:u.cXuhao||"",cName:u.cName||"",nParent:0}},M=await G.post("/core/authDict/selectForPage",p);return M.result?.records&&(M.result.records=M.result.records.map(P=>({...P,hasChildren:!0}))),M};async function g({row:N}){const p={pageNo:1,pageSize:9999,authDict:{...await s.getValues(),nParent:N.id}};try{return((await G.post("/core/authDict/selectForPage",p)).result?.records||[]).map(z=>({...z,hasChildren:!0}))}catch(M){return console.error("加载子节点失败:",M),[]}}const o={lazy:!0,rowField:"id",hasChild:"hasChildren",expandAll:!1,loadMethod:g},{QueryForm:n,formApi:s,Grid:r,gridApi:B,submitting:i,handleGlobalEnter:c,searchPlanList:I,currentSearchPlan:Q,resourceId:a,nResourceid:l,handleSearchPlanSearch:C,handleDefaultPlanLoaded:E,businessResumeState:d}=lA({searchFormSchema:Ra,tableColumns:ja,resourceConfig:Za,queryFunction:t,gridEvents:{toolbarButtonClick:({code:N})=>{N==="dataDictionary/add"?U():N==="dataDictionary/update"?D():N==="dataDictionary/enable"?h("10001"):N==="dataDictionary/disable"?h("10002"):N==="dataDictionary/del"&&k()}},treeConfig:o,lazy:!0}),w=A.ref(!1),m=A.ref("0"),f=A.ref(""),y=A.ref(!1),v=A.ref(void 0);function U(){const N=B.getSelection();if(N.length>1){b.Message.warning("最多只能选择一条数据作为父级");return}N.length===1?(m.value=N[0].id,f.value=N[0].cName):(m.value="0",f.value=""),w.value=!0}function D(){const N=B.getSelection();if(N.length===0){b.Message.warning("请选择要修改的数据");return}if(N.length>1){b.Message.warning("一次只能修改一条数据");return}v.value=N[0],y.value=!0}async function h(N){const u=B.getSelection();if(u.length===0){b.Message.warning("请选择要操作的数据");return}if(u.length>1){b.Message.warning("一次只能操作一条数据");return}const p=u[0],M=N==="10001"?"启用":"禁用";try{const P=await G.post("/core/authDict/sign",{authDict:{id:p.id,cSign:N}});b.Message.success(P.message||`${M}成功`),B.commitProxy("query")}catch(P){console.error(`${M}失败:`,P)}}function k(){const N=B.getSelection();if(N.length===0){b.Message.warning("请选择要删除的数据");return}if(N.length>1){b.Message.warning("一次只能删除一条数据");return}const u=N[0];b.Modal.confirm({title:"确认删除",content:`确定要删除「${u.cName}」吗?`,okText:"确定",cancelText:"取消",onOk:async()=>{try{const p=await G.post("/core/authDict/delete",{authDict:{id:u.id}});b.Message.success(p.message||"删除成功"),B.commitProxy("query")}catch(p){console.error("删除失败:",p)}}})}function F(){B.commitProxy("query")}return(N,u)=>(A.openBlock(),A.createElementBlock("div",{class:"data-dictionary-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:u[2]||(u[2]=A.withKeys((...p)=>A.unref(c)&&A.unref(c)(...p),["enter"])),tabindex:"-1"},[A.createElementVNode("div",Wa,[A.createElementVNode("div",Ta,[A.createVNode(A.unref(n))]),A.createElementVNode("div",qa,[A.createVNode(A.unref(r),{class:"flex-1"})])]),A.createVNode(Ja,{visible:w.value,"onUpdate:visible":u[0]||(u[0]=p=>w.value=p),"parent-id":m.value,"parent-name":f.value,onSuccess:F},null,8,["visible","parent-id","parent-name"]),A.createVNode(Ha,{visible:y.value,"onUpdate:visible":u[1]||(u[1]=p=>y.value=p),row:v.value,onSuccess:F},null,8,["visible","row"]),A.createVNode(A.unref(pA),{state:A.unref(d)},null,8,["state"])],32))}}),[["__scopeId","data-v-4940c6dd"]]),$a=[{label:"启用",value:"10001"},{label:"禁用",value:"10002"}],Al=[{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}}],At=[{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}}],el=[{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:e})=>$a.find(g=>g.value===e)?.label||e},{field:"cCreateName",title:"创建人",width:120},{field:"dCreate",title:"创建时间",width:180},{field:"nOrder",title:"排序",width:80}],et=[{type:"checkbox",width:50,align:"center"},{field:"key",title:"属性键",minWidth:150,...Y.EditRender.SelectRender,params:{placeholder:"请选择属性键",allowClear:!0,options:[]},selectOptions:{dictCode:"DICTATTR",fieldMapping:{label:"cName",value:"cXuhao"}}},{field:"value",title:"属性值",minWidth:200,...Y.EditRender.InputRender,params:{placeholder:"请输入属性值",allowClear:!0}}],tl=[{field:"cXuhao",title:"子级数据字典编号",minWidth:200,...Y.EditRender.InputRender,params:{placeholder:"请输入子级数据字典编号",allowClear:!0,disabled:!0}},{field:"cName",title:"子级数据字典名称",minWidth:200,...Y.EditRender.InputRender,params:{placeholder:"请输入子级数据字典名称",allowClear:!0}},{field:"nOrder",title:"子级数据字典排序",minWidth:150,...Y.EditRender.InputRender,params:{placeholder:"请输入排序",allowClear:!0}}],tt={key:[{required:!0,message:"请输入属性键"}]},ot=[{code:"insert",name:"添加属性"},{code:"remove",name:"删除"}],gt=[{title:"额外属性",type:"grid",gridConfig:{columns:et,editRules:tt,toolbarButtons:ot}},{title:"子级数据字典",type:"grid",gridConfig:{columns:tl,editRules:{},toolbarButtons:[]}}],ol={resourceId:"ywsjzd",nResourceid:161,cModnumb:"b2a3c6ba-d6d8-4d51-ad78-887f05b9e56b"},gl=A.defineComponent({name:"YwsjzdAdd",__name:"YwsjzdAdd",props:{visible:{type:Boolean,default:!1},parentId:{default:"0"},parentName:{default:""}},emits:["update:visible","success"],setup(e,{emit:t}){const g=e,o=t;A.ref(!1);const[n,s,r,B]=Ce({formSchema:At,tableColumns:et,tableEditRules:tt,tableToolbarButtons:ot});A.watch(()=>g.visible,Q=>{Q&&(s.resetForm(),s.setValues({parentName:g.parentName||"无"}),B.reloadData([]))});const i=A.computed(()=>g.parentId&&g.parentId!=="0"?`新增子级字典 - ${g.parentName}`:"新增根级字典");async function c(){try{const{valid:Q}=await s.validate();if(!Q||await B.validate())return!1;const l=await B.getFullData(),C=l.filter(y=>y.key).map(y=>y.key),E=new Set(C);if(C.length!==E.size)return b.Message.warning("属性键不能重复"),!1;const d=await s.getValues(),w={};l.forEach(y=>{y.key&&(w[y.key]=y.value||"")});const m={authDict:{cXuhao:d.cXuhao,cName:d.cName,cSign:d.cSign,nParent:g.parentId||"0",nOrder:d.nOrder||0,cMeta:JSON.stringify(w)}},f=await G.post("/core/authDict/addBS",m);return b.Message.success(f.message),o("success"),!0}catch(Q){return console.error("新增失败:",Q),!1}}function I(){o("update:visible",!1)}return(Q,a)=>(A.openBlock(),A.createBlock(A.unref(Y.Modal),{"model-value":g.visible,title:i.value,width:700,"on-before-ok":c,"onUpdate:modelValue":a[0]||(a[0]=l=>o("update:visible",l)),onClose:I},{default:A.withCtx(()=>[A.createVNode(A.unref(n)),A.createVNode(A.unref(r),{id:"metaGrid",border:"","max-height":"300"})]),_:1},8,["model-value","title"]))}}),nl=A.defineComponent({name:"YwsjzdUpdate",__name:"YwsjzdUpdate",props:{visible:{type:Boolean,default:!1},row:{default:void 0}},emits:["update:visible","success"],setup(e,{emit:t}){const{TabPane:g}=b.Tabs,o=e,n=t;A.ref(!1);const s=A.ref(0),[r,B,i,c]=ce({formSchema:At,tabsConfig:gt});A.watch(()=>o.visible,async l=>{if(l&&o.row){await A.nextTick(),B.resetForm(),c.value[0].reloadData([]);try{const E=(await G.post("/core/authDict/editInit",{authDict:{id:o.row.id}})).result;if(E){if(B.setValues({cXuhao:E.authDict.cXuhao,cName:E.authDict.cName,cSign:E.authDict.cSign,nOrder:E.authDict.nOrder}),E.authDict.cMeta)try{const d=JSON.parse(E.authDict.cMeta),w=Object.keys(d).map(m=>({key:m,value:d[m]}));c.value[0].reloadData(w)}catch(d){console.error("解析额外属性失败:",d)}E.childList&&E.childList.length>0?c.value[1].reloadData(E.childList):c.value[1].reloadData([])}}catch(C){console.error("加载数据失败:",C),b.Message.error("加载数据失败")}}});const I=A.computed(()=>"修改字典");async function Q(){try{const{valid:l}=await B.validate();if(!l||await c.value[0].validate())return!1;const E=await c.value[0].getFullData(),d=E.filter(D=>D.key).map(D=>D.key),w=new Set(d);if(d.length!==w.size)return b.Message.warning("属性键不能重复"),!1;const m=await B.getValues(),f={};E.forEach(D=>{D.key&&(f[D.key]=D.value||"")});const y=await c.value[1].getFullData(),v={authDict:{id:o.row?.id,cXuhao:m.cXuhao,cName:m.cName,cSign:m.cSign,nOrder:m.nOrder||0,cMeta:JSON.stringify(f),nParent:o.row?.nParent||0,nType:o.row?.nType||1},authDictList:y},U=await G.post("/core/authDict/editBS",v);return b.Message.success(U.message),n("success"),!0}catch(l){return console.error("修改失败:",l),!1}}function a(){n("update:visible",!1)}return(l,C)=>(A.openBlock(),A.createBlock(A.unref(Y.Modal),{"model-value":o.visible,title:I.value,width:700,"on-before-ok":Q,"onUpdate:modelValue":C[1]||(C[1]=E=>n("update:visible",E)),onClose:a},{default:A.withCtx(()=>[A.createVNode(A.unref(r)),A.createVNode(A.unref(b.Tabs),{modelValue:s.value,"onUpdate:modelValue":C[0]||(C[0]=E=>s.value=E)},{default:A.withCtx(()=>[(A.openBlock(!0),A.createElementBlock(A.Fragment,null,A.renderList(A.unref(gt),(E,d)=>(A.openBlock(),A.createBlock(A.unref(g),{key:d,title:E.title},{default:A.withCtx(()=>[(A.openBlock(),A.createBlock(A.resolveDynamicComponent(A.unref(i)[d]),{id:`grid-${d}`,border:"","max-height":"300"},null,8,["id"]))]),_:2},1032,["title"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["model-value","title"]))}}),rl={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},sl={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},Bl={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},al=nA(A.defineComponent({__name:"YwsjzdQuery",setup(e){const t=async({page:N,formValues:u})=>{const p={pageNo:N.currentPage,pageSize:N.pageSize,authDict:{cSign:u.cSign||"",cXuhao:u.cXuhao||"",cName:u.cName||"",nParent:0}},M=await G.post("/core/authDict/selectForPageBS",p);return M.result?.records&&(M.result.records=M.result.records.map(P=>({...P,hasChildren:!0}))),M};async function g({row:N}){const p={pageNo:1,pageSize:9999,authDict:{...await s.getValues(),nParent:N.id}};try{return((await G.post("/core/authDict/selectForPageBS",p)).result?.records||[]).map(z=>({...z,hasChildren:!0}))}catch(M){return console.error("加载子节点失败:",M),[]}}const o={lazy:!0,rowField:"id",hasChild:"hasChildren",expandAll:!1,loadMethod:g},{QueryForm:n,formApi:s,Grid:r,gridApi:B,submitting:i,handleGlobalEnter:c,searchPlanList:I,currentSearchPlan:Q,resourceId:a,nResourceid:l,handleSearchPlanSearch:C,handleDefaultPlanLoaded:E,businessResumeState:d}=lA({searchFormSchema:Al,tableColumns:el,resourceConfig:ol,queryFunction:t,gridEvents:{toolbarButtonClick:({code:N})=>{N==="ywsjzd/add"?U():N==="ywsjzd/update"?D():N==="ywsjzd/enable"?h("10001"):N==="ywsjzd/disable"?h("10002"):N==="ywsjzd/del"&&k()}},treeConfig:o,lazy:!0}),w=A.ref(!1),m=A.ref("0"),f=A.ref(""),y=A.ref(!1),v=A.ref(null);function U(){const N=B.getSelection();if(N.length>1){b.Message.warning("最多只能选择一条数据作为父级");return}N.length===1?(m.value=N[0].id,f.value=N[0].cName):(m.value="0",f.value=""),w.value=!0}function D(){const N=B.getSelection();if(N.length!==1){b.Message.warning("请选择一条数据进行修改");return}const u=N[0];v.value=u,y.value=!0}async function h(N){const u=B.getSelection();if(u.length===0){b.Message.warning("请选择要操作的数据");return}if(u.length>1){b.Message.warning("一次只能操作一条数据");return}const p=u[0],M=N==="10001"?"启用":"禁用";try{const P=await G.post("/core/authDict/signBS",{authDict:{id:p.id,cSign:N}});b.Message.success(P.message||`${M}成功`),B.commitProxy("query")}catch(P){console.error(`${M}失败:`,P)}}function k(){const N=B.getSelection();if(N.length===0){b.Message.warning("请选择要删除的数据");return}if(N.length>1){b.Message.warning("一次只能删除一条数据");return}const u=N[0];b.Modal.confirm({title:"确认删除",content:`确定要删除「${u.cName}」吗?`,okText:"确定",cancelText:"取消",onOk:async()=>{try{const p=await G.post("/core/authDict/deleteBS",{authDict:{id:u.id}});b.Message.success(p.message||"删除成功"),B.commitProxy("query")}catch(p){console.error("删除失败:",p)}}})}function F(){B.commitProxy("query")}return(N,u)=>(A.openBlock(),A.createElementBlock("div",{class:"ywsjzd-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:u[2]||(u[2]=A.withKeys((...p)=>A.unref(c)&&A.unref(c)(...p),["enter"])),tabindex:"-1"},[A.createElementVNode("div",rl,[A.createElementVNode("div",sl,[A.createVNode(A.unref(n))]),A.createElementVNode("div",Bl,[A.createVNode(A.unref(r),{class:"flex-1"})])]),A.createVNode(gl,{visible:w.value,"onUpdate:visible":u[0]||(u[0]=p=>w.value=p),"parent-id":m.value,"parent-name":f.value,onSuccess:F},null,8,["visible","parent-id","parent-name"]),A.createVNode(nl,{visible:y.value,"onUpdate:visible":u[1]||(u[1]=p=>y.value=p),row:v.value,onSuccess:F},null,8,["visible","row"]),A.createVNode(A.unref(pA),{state:A.unref(d)},null,8,["state"])],32))}}),[["__scopeId","data-v-24b85090"]]),NA=({t:e,formApi:t})=>{const g=[{label:"普通用户",value:"0"},{label:"超级用户",value:"1"}],o=[{label:"启用",value:"0"},{label:"禁用",value:"1"}],n=[{label:"是",value:"1"},{label:"否",value:"0"}],s=[{fieldName:"cUsernumb",label:e("user.cUsernumb"),component:"Input",componentProps:{allowClear:!0}},{fieldName:"cUsername",label:e("user.cUsername"),component:"Input",componentProps:{allowClear:!0}},{fieldName:"cAdmin",label:e("user.cAdmin"),component:"Select",componentProps:{allowClear:!0,options:g}},{fieldName:"dLastLoginList",label:e("user.dLastLoginList"),component:"RangePicker",componentProps:{allowClear:!0}}],r=[{type:"checkbox",width:40},{field:"id",title:"ID",minWidth:80,params:{nBill:3,cEntityTable:"AUTH_USER"}},{field:"cUsernumb",title:e("user.cUsernumb"),minWidth:120},{field:"cUsername",title:e("user.cUsername"),minWidth:120},{field:"cAdmin",title:e("user.cAdmin"),minWidth:120,params:{optionlist:g},formatter:({cellValue:a,column:l})=>DA(a,l.params.optionlist)},{field:"cWork",title:e("user.cWork"),minWidth:120},{field:"dCredate",title:e("user.dCredate"),minWidth:120},{field:"cSign",title:e("user.cSign"),minWidth:120,params:{optionlist:o},formatter:({cellValue:a,column:l})=>DA(a,l.params.optionlist)},{field:"cEmail",title:e("user.cEmail"),minWidth:120},{field:"cDeptname",title:e("user.cDeptname"),minWidth:120},{field:"nMainAccount",title:e("user.nMainAccount"),minWidth:120,params:{optionlist:n},formatter:({cellValue:a,column:l})=>DA(a,l.params.optionlist)},{field:"nOuterUser",title:e("user.nOuterUser"),minWidth:120,params:{optionlist:n},formatter:({cellValue:a,column:l})=>DA(a,l.params.optionlist)},{field:"dLastLogin",title:e("user.dLastLogin"),minWidth:120}],B={resourceId:"88",nResourceid:80,cModnumb:"XTGL_YHGL_LIST"},i=[{fieldName:"cUsernumb",label:e("user.cUsernumb"),component:"Input",componentProps:{allowClear:!0},rules:"required"},{fieldName:"cUsername",label:e("user.cUsername"),component:"Input",componentProps:{allowClear:!0},rules:"required"},{fieldName:"cAdmin",label:e("user.cAdmin"),component:"Select",componentProps:{allowClear:!0,options:g},rules:"required"},{fieldName:"nMainAccount",label:e("user.nMainAccount"),component:"RadioGroup",componentProps:{allowClear:!0,options:n}},{fieldName:"nOuterUser",label:e("user.nOuterUser"),component:"RadioGroup",componentProps:{allowClear:!0,options:n}},{fieldName:"cWork",label:e("user.cWork"),component:"SunnyBusinessSearch",componentProps:(a,l)=>({allowClear:!0,cNum:"INNER_WORK_OPT",defaultModel:{WORKCODE:"1084870"},modalProps:{multiple:!1,fieldNames:{value:"WORKCODE",label:"LASTNAME"}},onChange:(C,E)=>{C.length>0?(l.setFieldValue("cDeptnum",C[0].DEPTCODE),l.setFieldValue("cDeptname",C[0].DEPTNAME)):(l.setFieldValue("cDeptnum",""),l.setFieldValue("cDeptname",""))}}),dependencies:{show:a=>a.nOuterUser==="0"}},{fieldName:"cDeptnum",label:e("user.cDeptnum"),component:"Input",componentProps:{allowClear:!0,disabled:!0},dependencies:{show:a=>a.nOuterUser==="0"}},{fieldName:"cDeptname",label:e("user.cDeptname"),component:"Input",componentProps:{allowClear:!0,disabled:!0},dependencies:{show:a=>a.nOuterUser==="0"}}],c=[{fieldName:"cUsernumb",label:e("user.cUsernumb"),component:"Input",componentProps:{disabled:!0},colProps:{span:12}},{fieldName:"cUsername",label:e("user.cUsername"),component:"Input",componentProps:{disabled:!0},colProps:{span:12}}],I=[{type:"checkbox",width:40,align:"center"},{field:"cRolenumb",title:e("user.cRolenumb"),minWidth:100},{field:"cRolename",title:e("user.cRolename"),minWidth:200},{field:"nSensitive",title:e("user.nSensitive"),minWidth:100,formatter:({cellValue:a,column:l})=>DA(a,l.params.optionlist),params:{optionlist:n}},{field:"cSystem",title:e("user.cSystem"),minWidth:100}],Q=[{type:"checkbox",width:40,align:"center"},{field:"cMac",title:e("user.cMac"),...Y.EditRender.InputRender},{field:"cMacdesc",title:e("user.cMacdesc"),...Y.EditRender.InputRender},{field:"cCreateusername",title:e("user.cCreateusername")},{field:"dDate",title:e("user.dDate")}];return{searchFormSchema:s,tableColumns:r,resourceConfig:B,addEditFormSchema:i,authFormSchema:c,authGridColumns:I,bindMacGridColumns:Q}},ll=A.defineComponent({__name:"UserAdd",emits:["success"],setup(e,{expose:t,emit:g}){const{t:o}=$.useI18n(),n=A.ref(!1),s=A.ref("add"),r=g,[B,i]=mA({schema:[],objectToValueFields:["cWork"]}),{addEditFormSchema:c}=NA({t:o,formApi:i}),I=()=>{n.value=!0,s.value="add",i.setState({schema:c}),i.resetForm(),i.setValues({nMainAccount:"1",nOuterUser:"0"})},Q=async E=>{s.value="edit";const d=await G.post("/core/authUser/queryById",{authUser:{id:E.id}});n.value=!0,await A.nextTick(),i.setState({schema:c}),i.resetForm(),d.code===200&&i.setValues({...d.result,nMainAccount:d.result.nMainAccount.toString(),nOuterUser:d.result.nOuterUser.toString()},!1)};t({addInit:I,editInit:Q,detailInit:E=>{Q(E)}});const l=async()=>{const{valid:E}=await i.validate();if(!E)return!1;const w={authUser:await i.getValues()},m=await G.post(s.value==="add"?"/core/authUser/add":"/core/authUser/edit",w);return m.code===200?(b.Message.success(m.message),n.value=!1,r("success"),!0):(b.Message.error(m.message),!1)};function C(){n.value=!1}return(E,d)=>(A.openBlock(),A.createBlock(A.unref(Y.Modal),{"model-value":n.value,title:s.value==="add"?A.unref(o)("user.addTitle"):A.unref(o)("user.editTitle"),width:600,"on-before-ok":l,onClose:C},{default:A.withCtx(()=>[A.createVNode(A.unref(B))]),_:1},8,["model-value","title"]))}}),Cl=A.defineComponent({__name:"UserChooseRole",emits:["chooseRoleEmit"],setup(e,{expose:t,emit:g}){const{t:o}=$.useI18n(),n=A.ref(!1),s=A.ref([]);A.ref([]),A.ref(!1);const r=g,B=[{fieldName:"cRolenumb",label:o("user.cRolenumb"),component:"Input",componentProps:{allowClear:!0},colProps:{span:6}},{fieldName:"cRolename",label:o("user.cRolename"),component:"Input",componentProps:{allowClear:!0},colProps:{span:6}}],i=[{type:"checkbox",width:50,fixed:"left"},{field:"cRolenumb",title:o("user.cRolenumb"),width:120},{field:"cRolename",title:o("user.cRolename"),width:120},{field:"nSensitive",title:o("user.nSensitive"),width:120,formatter:({row:a})=>a.nSensitive=="1"?o("common.yes"):o("common.no")},{field:"cSystem",title:o("user.cSystem"),width:120}],c=()=>{n.value=!0},I=a=>{r("chooseRoleEmit",a)},Q=async a=>{var l={authRole:{cRolenumb:a.cRolenumb,cRolename:a.cRolename},pageNo:a.pageNo,pageSize:a.pageSize};const C=await G.post("/core/authRole/queryAllPageList",l);return{list:C.result.records,total:C.result.total}};return t({openInit:c}),(a,l)=>(A.openBlock(),A.createBlock(A.unref(Y.SunnySearchModal),{visible:n.value,"onUpdate:visible":l[0]||(l[0]=C=>n.value=C),modelValue:s.value,"onUpdate:modelValue":l[1]||(l[1]=C=>s.value=C),title:a.$t("系统角色权限查询"),"form-schema":B,"table-columns":i,"search-api":Q,"field-names":{label:"cRolename",value:"cRolenumb"},onConfirm:I},null,8,["visible","modelValue","title"]))}}),cl=A.defineComponent({__name:"UserAuth",emits:["success"],setup(e,{expose:t,emit:g}){const o=A.ref(),{t:n}=$.useI18n(),s=A.ref(!1),r=g,[B,i]=mA({schema:[]}),{authFormSchema:c,authGridColumns:I}=NA({t:n,formApi:i}),[Q,a]=Y.useSunnyEditGrid({gridOptions:{data:[],columns:I,border:!0,size:"mini",maxHeight:400,columnConfig:{resizable:!0}}});t({openInit:async f=>{const y=await G.post("/core/authUser/queryUserRole",{authUser:{id:f.id}}),v=y.code===200?y.result:[];s.value=!0,await A.nextTick(),i.setState({schema:c}),i.resetForm(),i.setValues({cUsernumb:f.cUsernumb,cUsername:f.cUsername}),a.reloadData(v)}});const C=async()=>{const{valid:f}=await i.validate();if(!f)return!1;const y=await i.getValues(),v=await a.getFullData(),U={authorizedNumb:y.cUsernumb,authUserRoleList:v},D=await G.post("/core/authUser/saveUserAuth",U);return D.code===200?(b.Message.success(D.message),s.value=!1,r("success"),!0):(b.Message.error(D.message),!1)};function E(){s.value=!1}const d=()=>{o.value.openInit()},w=async f=>{const y=await a.getFullData();f.forEach(v=>{T.findIndex(y,U=>U.nRoleid===v.id)>-1?b.Message.warning(n("user.duplicateRole",{roleName:v.cRolename})):a.addEvent({nRoleid:v.id,cSystem:v.cSystem,cRolename:v.cRolename,cRolenumb:v.cRolenumb,nSensitive:v.nSensitive})})},m=()=>{a.deleteSelection()};return(f,y)=>{const v=A.resolveComponent("a-button"),U=A.resolveComponent("a-space");return A.openBlock(),A.createBlock(A.unref(Y.Modal),{"model-value":s.value,title:A.unref(n)("user.authTitle"),width:700,"on-before-ok":C,onClose:E},{default:A.withCtx(()=>[A.createVNode(A.unref(B)),A.createVNode(A.unref(Q),null,{toolbar:A.withCtx(()=>[A.createVNode(U,{class:"mb-2"},{default:A.withCtx(()=>[A.createVNode(v,{type:"primary",onClick:d},{default:A.withCtx(()=>[A.createTextVNode(A.toDisplayString(A.unref(n)("common.create")),1)]),_:1}),A.createVNode(v,{type:"primary",onClick:m},{default:A.withCtx(()=>[A.createTextVNode(A.toDisplayString(A.unref(n)("common.deleteSelected")),1)]),_:1})]),_:1})]),_:1}),A.createVNode(Cl,{ref_key:"UserChooseRoleRef",ref:o,onChooseRoleEmit:w},null,512)]),_:1},8,["model-value","title"])}}}),Ql=A.defineComponent({__name:"UserBindMac",emits:["success"],setup(e,{expose:t,emit:g}){const{t:o}=$.useI18n(),n=A.ref(!1),s=A.ref({}),r=g,{bindMacGridColumns:B}=NA({t:o}),[i,c]=Y.useSunnyEditGrid({gridOptions:{data:[],columns:B,border:!0,size:"mini",maxHeight:400,columnConfig:{resizable:!0},editRules:{cMac:[{required:!0,message:o("user.cMacMessage")}]}}});t({openInit:async E=>{const d=await G.post("/core/authUser/queryMac",{cUsernumb:E.cUsernumb}),w=d.code===200?d.result:[];d.code===200&&(s.value=E),n.value=!0,await A.nextTick(),c.reloadData(w)}});const Q=async()=>{if(await c.validate())return!1;const w={authUserMacList:await c.getFullData(),authUserMac:{cUsernumb:s.value.cUsernumb}},m=await G.post("/core/authUser/saveMac",w);return m.code===200?(b.Message.success(m.message),n.value=!1,r("success"),!0):(b.Message.error(m.message),!1)};function a(){n.value=!1}const l=()=>{c.addEvent({})},C=()=>{c.deleteSelection()};return(E,d)=>{const w=A.resolveComponent("a-button"),m=A.resolveComponent("a-space");return A.openBlock(),A.createBlock(A.unref(Y.Modal),{"model-value":n.value,title:A.unref(o)("user.bindMacTitle"),width:700,"on-before-ok":Q,onClose:a},{default:A.withCtx(()=>[A.createVNode(A.unref(i),null,{toolbar:A.withCtx(()=>[A.createVNode(m,{class:"mb-2"},{default:A.withCtx(()=>[A.createVNode(w,{type:"primary",onClick:l},{default:A.withCtx(()=>[A.createTextVNode(A.toDisplayString(A.unref(o)("common.create")),1)]),_:1}),A.createVNode(w,{type:"primary",onClick:C},{default:A.withCtx(()=>[A.createTextVNode(A.toDisplayString(A.unref(o)("common.deleteSelected")),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["model-value","title"])}}}),il={class:"otherAuthTable"},El={class:"th1"},Il={class:"th2"},dl={class:"th3"},fl={class:"tr1"},wl={class:"tr2"},ul={class:"tr3"},ml={key:0,style:{color:"#24b77b"}},Dl=nA(A.defineComponent({__name:"UserOtherAuth",emits:["success"],setup(e,{expose:t,emit:g}){const{t:o}=$.useI18n(),n=A.ref(!1),s=A.ref([]),r=A.ref({}),B=(Q,a)=>{a.forEach(l=>{l.check=!!Q})};t({openInit:async Q=>{const a=await G.post("/core/authUser/queryUserExres",{authUser:{id:Q.id}});a.code===200&&(s.value=a.result,r.value=Q),n.value=!0}});const c=async()=>{const Q={authUser:{id:r.value.id},userExresAuthBOList:s.value.map(l=>({...l,allCheck:!1}))},a=await G.post("/core/authUser/saveUserExres",Q);return a.code===200?(b.Message.success(a.message),n.value=!1,!0):(b.Message.error(a.message),!1)};function I(){n.value=!1}return(Q,a)=>{const l=A.resolveComponent("a-checkbox");return A.openBlock(),A.createBlock(A.unref(Y.Modal),{"model-value":n.value,title:A.unref(o)("user.otherAuth.title"),width:900,class:"macAddressDialog","on-before-ok":c,onClose:I},{default:A.withCtx(()=>[A.createElementVNode("div",null,[A.createElementVNode("table",il,[a[1]||(a[1]=A.createElementVNode("caption",null,null,-1)),A.createElementVNode("th",El,A.toDisplayString(A.unref(o)("user.otherAuth.tab")),1),A.createElementVNode("th",Il,A.toDisplayString(A.unref(o)("user.otherAuth.tabDesc")),1),A.createElementVNode("th",dl,A.toDisplayString(A.unref(o)("user.otherAuth.option")),1),(A.openBlock(!0),A.createElementBlock(A.Fragment,null,A.renderList(s.value,C=>(A.openBlock(),A.createElementBlock("tr",null,[A.createElementVNode("td",fl,A.toDisplayString(C.parname),1),A.createElementVNode("td",wl,[A.createVNode(l,{modelValue:C.allCheck,"onUpdate:modelValue":E=>C.allCheck=E,onChange:E=>B(E,C.authExresList)},null,8,["modelValue","onUpdate:modelValue","onChange"]),a[0]||(a[0]=A.createTextVNode(" 是 ",-1))]),A.createElementVNode("td",ul,[(A.openBlock(!0),A.createElementBlock(A.Fragment,null,A.renderList(C.authExresList,E=>(A.openBlock(),A.createBlock(l,{modelValue:E.check,"onUpdate:modelValue":d=>E.check=d},{default:A.withCtx(()=>[A.createTextVNode(A.toDisplayString(E.cExresnum+"-"+E.cExresname)+" ",1),E.cOrg?(A.openBlock(),A.createElementBlock("span",ml,"["+A.toDisplayString(E.cOrg)+"]",1)):A.createCommentVNode("",!0)]),_:2},1032,["modelValue","onUpdate:modelValue"]))),256))])]))),256))])])]),_:1},8,["model-value","title"])}}}),[["__scopeId","data-v-c249a204"]]),pl={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},bl={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},Pl={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},vl=nA(A.defineComponent({__name:"UserQuery",setup(e){const t=A.ref(),g=A.ref(),o=A.ref(),n=A.ref(),s=QA.useRouter(),{t:r}=$.useI18n(),{searchFormSchema:B,tableColumns:i,resourceConfig:c}=NA({t:r}),I=async({page:p,formValues:M})=>{const P={pageNo:p.currentPage,pageSize:p.pageSize,authUser:M};return G.post("/core/authUser/selectForPage",P)},Q={async toolbarButtonClick(p){const M=[...p.$grid.getCheckboxRecords()];switch(p.button.code){case"userManagement/add":t.value.addInit();break;case"userManagement/update":if(M.length!==1){b.Message.warning(r("common.selectOne"));return}t.value.editInit(M[0]);break;case"userManagement/delete":if(M.length!==1){b.Message.warning(r("common.selectOne"));return}b.Modal.confirm({title:r("common.prompt"),content:`确定删除选中 ${M.length} 项吗?`,onBeforeOk:async()=>{const z=await G.post("/core/authUser/delete",{id:M[0].id});return z.code===200?(b.Message.success(z.message),p.$grid.commitProxy("query",{}),!0):(b.Message.error(z.message),!1)}});break;case"userManagement/detail":if(M.length!==1){b.Message.warning(r("common.selectOne"));return}t.value.detailInit(M[0]);break;case"userManagement/resetPassword":if(M.length!==1){b.Message.warning(r("common.selectOne"));return}b.Modal.confirm({title:r("common.prompt"),content:r("user.resetPasswordTips",{username:M[0].cUsername}),onBeforeOk:async()=>{const z=await G.post("/core/authUser/resetPwd",{id:M[0].id});return z.code===200?(b.Message.success(z.message),p.$grid.commitProxy("query",{}),!0):(b.Message.error(z.message),!1)}});break;case"userManagement/enable":if(M.length!==1){b.Message.warning(r("common.selectOne"));return}b.Modal.confirm({title:r("common.prompt"),content:r("user.enableTips",{username:M[0].cUsername}),onBeforeOk:async()=>{const z=await G.post("/core/authUser/updateSign",{id:M[0].id,cSign:"0"});return z.code===200?(b.Message.success(z.message),p.$grid.commitProxy("query",{}),!0):(b.Message.error(z.message),!1)}});break;case"userManagement/disable":if(M.length!==1){b.Message.warning(r("common.selectOne"));return}b.Modal.confirm({title:r("common.prompt"),content:r("user.disableTips",{username:M[0].cUsername}),onBeforeOk:async()=>{const z=await G.post("/core/authUser/updateSign",{id:M[0].id,cSign:"1"});return z.code===200?(b.Message.success(z.message),p.$grid.commitProxy("query",{}),!0):(b.Message.error(z.message),!1)}});break;case"userManagement/auth":if(M.length!==1){b.Message.warning(r("common.selectOne"));return}g.value.openInit(M[0]);break;case"userManagement/macBind":if(M.length!==1){b.Message.warning(r("common.selectOne"));return}o.value.openInit(M[0]);break;case"userManagement/otherAuth":if(M.length!==1){b.Message.warning(r("common.selectOne"));return}n.value.openInit(M[0]);break;case"daoru/show":u.open({nModid:s.currentRoute.value.meta.id,nButtonid:p.button.nButtonid});break;case"daochu/show":const P=await l.getValues();F({conditionMap:P,tableColumns:i});break}}},{QueryForm:a,formApi:l,Grid:C,gridApi:E,submitting:d,handleGlobalEnter:w,searchPlanList:m,currentSearchPlan:f,resourceId:y,nResourceid:v,handleSearchPlanSearch:U,handleDefaultPlanLoaded:D,businessResumeState:h}=lA({searchFormSchema:B,tableColumns:i,resourceConfig:c,queryFunction:I,gridEvents:Q,showCheckbox:!0}),{ExportModal:k,open:F}=it({exportUrl:"/core/authUser"}),[N,u]=Y.useImportModal({});return(p,M)=>(A.openBlock(),A.createElementBlock("div",{class:"operation-log-query h-full flex flex-col bg-[var(--color-fill-2)] focus:outline-none",onKeydown:M[4]||(M[4]=A.withKeys((...P)=>A.unref(w)&&A.unref(w)(...P),["enter"])),tabindex:"-1"},[A.createElementVNode("div",pl,[A.createElementVNode("div",bl,[A.createVNode(A.unref(a))]),A.createElementVNode("div",Pl,[A.createVNode(A.unref(C),{class:"flex-1"})]),A.createVNode(A.unref(k)),A.createVNode(A.unref(N)),A.createVNode(ll,{ref_key:"UserAddRef",ref:t,onSuccess:M[0]||(M[0]=()=>A.unref(E).commitProxy("query"))},null,512),A.createVNode(cl,{ref_key:"UserAuthRef",ref:g,onSuccess:M[1]||(M[1]=()=>A.unref(E).commitProxy("query"))},null,512),A.createVNode(Ql,{ref_key:"UserBindMacRef",ref:o,onSuccess:M[2]||(M[2]=()=>A.unref(E).commitProxy("query"))},null,512),A.createVNode(Dl,{ref_key:"UserOtherAuthRef",ref:n,onSuccess:M[3]||(M[3]=()=>A.unref(E).commitProxy("query"))},null,512),A.createVNode(A.unref(pA),{state:A.unref(h)},null,8,["state"])])],32))}}),[["__scopeId","data-v-98e86324"]]),OA=({t:e,formApi:t})=>{e("role.enable"),e("role.disable");const g=[{cKeyname:e("common.no"),cKeynumb:"0"},{cKeyname:e("common.yes"),cKeynumb:"1"}],o=[{cKeyname:e("role.baseSystem"),cKeynumb:"BASE"}],n=[{cKeyname:e("role.type1"),cKeynumb:"1"},{cKeyname:e("role.type2"),cKeynumb:"2"}],s=[{fieldName:"cRolenumb",label:e("user.cRolenumb"),component:"Input",componentProps:{placeholder:e("role.inputRoleNumb"),allowClear:!0},colProps:{span:4}},{fieldName:"cRolename",label:e("user.cRolename"),component:"Input",componentProps:{placeholder:e("role.inputRoleName"),allowClear:!0},colProps:{span:4}},{fieldName:"cOrg",label:e("role.org"),component:"Input",componentProps:{placeholder:e("role.inputOrg"),allowClear:!0},colProps:{span:4}}],r=[{type:"checkbox",width:40},{field:"id",title:e("role.id"),params:{nBill:3,cEntityTable:"AUTH_ROLE"}},{field:"cRolenumb",title:e("user.cRolenumb")},{field:"cRolename",title:e("user.cRolename")},{field:"CSystem",title:e("role.system"),formatter:({cellValue:Q})=>o.find(l=>l.cKeynumb===Q)?.cKeyname||Q},{field:"corg",title:e("role.org")},{field:"сType",title:e("role.type"),formatter:({cellValue:Q})=>n.find(l=>l.cKeynumb===Q)?.cKeyname||Q},{field:"nSensitive",title:e("user.nSensitive"),formatter:({cellValue:Q})=>g.find(l=>l.cKeynumb===String(Q))?.cKeyname||Q},{field:"cCrename",title:e("role.createUser")},{field:"dCredate",title:e("role.createTime")}],B={resourceId:"role",nResourceid:95,cModnumb:"XTGL_JSGL_LIST"},i=[{fieldName:"cRolenumb",label:e("user.cRolenumb"),component:"Input",componentProps:{allowClear:!0},colProps:{span:4}},{fieldName:"cRolename",label:e("user.cRolename"),component:"Input",componentProps:{allowClear:!0},rules:"required",colProps:{span:4}},{fieldName:"cSystem",label:e("role.system"),component:"Select",componentProps:{allowClear:!0,options:o.map(Q=>({label:Q.cKeyname,value:Q.cKeynumb}))},rules:"required",colProps:{span:4}},{fieldName:"corg",label:e("role.org"),component:"Input",componentProps:{allowClear:!0},colProps:{span:4}},{fieldName:"сType",label:e("role.type"),component:"Select",componentProps:{allowClear:!0,options:n.map(Q=>({label:Q.cKeyname,value:Q.cKeynumb}))},colProps:{span:4}}],c=[{fieldName:"cRolenumb",label:e("user.cRolenumb"),component:"Input",componentProps:{disabled:!0},colProps:{span:12}},{fieldName:"cRolename",label:e("user.cRolename"),component:"Input",componentProps:{disabled:!0},colProps:{span:12}}],I=[{type:"checkbox",width:40,align:"center"},{field:"cUsernumb",title:e("user.cUsernumb"),minWidth:100},{field:"cUsername",title:e("user.cUsername"),minWidth:200},{field:"cAdmin",title:e("user.cAdmin"),minWidth:100,formatter:({cellValue:Q})=>[{cKeyname:e("role.normalUser"),cKeynumb:"0"},{cKeyname:e("role.superUser"),cKeynumb:"1"}].find(C=>C.cKeynumb===String(Q))?.cKeyname||Q}];return{searchFormSchema:s,tableColumns:r,resourceConfig:B,addEditFormSchema:i,authFormSchema:c,authGridColumns:I}},Ml={class:"h-full flex flex-col"},yl={class:"mt-5 flex-1 overflow-hidden"},Fl={class:"mb-3 text-sm font-medium"},kl={class:"h-[calc(100%-36px)] overflow-auto"},zl={class:"extra-container ml-[250px] mr-auto",style:{"flex-shrink":"0","max-width":"70%","overflow-x":"auto"}},hl={key:0,class:"flex flex-nowrap gap-3",style:{width:"max-content"}},nt=A.defineComponent({__name:"RoleAdd",emits:["success"],setup(e,{expose:t,emit:g}){const{t:o}=$.useI18n(),n=A.ref(!1),s=A.ref("add"),r=A.ref(),B=A.ref(),i=A.ref(!1),c=g,I=A.reactive({treeData:[],defaultChecked:[],expandedKeys:[]}),Q=async p=>{const M=await G.post("/core/authResource/getResourceTreeMenu",{authResMenu:{cSystem:p}});if(M.code===200){const P=M.result;I.treeData=y(P),a(I.treeData)}},a=p=>{p.forEach(M=>{M.buttonList&&M.buttonList.length&&M.buttonList.forEach(P=>{P.checked=I.defaultChecked.includes(String(P.id))}),M.children&&a(M.children)})},l=p=>{let M=[];return p.buttonList&&p.buttonList.length&&(M=M.concat(p.buttonList.map(P=>P.id))),p.children&&p.children.length&&p.children.forEach(P=>{M.push(P.id),M=M.concat(l(P))}),M},C=p=>{const M=[],P=(z,V,L=[])=>{for(const X of z){if(X.id===V)return M.push(...L),!0;if(X.children&&P(X.children,V,[...L,X.id]))return!0}return!1};return P(I.treeData,p),M},E=(p,M)=>{const P=M.node,z=M.checked,V=[...p];if(z){C(P.id).forEach(x=>{V.includes(x)||V.push(x)}),P.buttonList&&P.buttonList.length&&P.buttonList.forEach(x=>{V.includes(x.id)||V.push(x.id),x.checked=!0}),l(P).forEach(x=>{V.includes(x)||V.push(x)});const H=(x,O)=>{x.forEach(j=>{j.buttonList&&j.buttonList.length&&j.buttonList.forEach(J=>{J.checked=O}),j.children&&H(j.children,O)})};P.children&&H(P.children,!0)}else{P.buttonList&&P.buttonList.length&&P.buttonList.forEach(H=>{const x=V.indexOf(H.id);x!==-1&&V.splice(x,1),H.checked=!1}),l(P).forEach(H=>{const x=V.indexOf(H);x!==-1&&V.splice(x,1)});const X=(H,x)=>{H.forEach(O=>{O.buttonList&&O.buttonList.length&&O.buttonList.forEach(j=>{j.checked=x}),O.children&&X(O.children,x)})};P.children&&X(P.children,!1)}I.defaultChecked=V},[d,w]=Y.useSunnyForm({layout:"horizontal",size:"small",labelWidth:100,showDefaultActions:!1,scrollToFirstError:!0,schema:[]}),{addEditFormSchema:m}=OA({t:o,formApi:w}),f=async p=>{p?(await Q(p),I.defaultChecked=[]):(I.treeData=[],I.defaultChecked=[])};w.setState({handleValuesChange:(p,M)=>{"cSystem"in p&&!i.value&&f(p.cSystem)}});const y=p=>p.map(M=>{const P=M.label||M.name||M.text||M.cName||M.id,z={...M,label:P,expanded:!1};if(z.children&&z.children.length){const V=[],L=[];z.children.forEach(X=>{if(X.cType==="2"){const H=X.label||X.name||X.text||X.cName||X.id;V.push({...X,label:H,checked:I.defaultChecked.includes(String(X.id))})}else L.push(y([X])[0])}),z.buttonList=V,z.children=L.length?L:void 0}return z}),v=(p,M)=>{for(const P of p){if(P.buttonList&&P.buttonList.some(z=>z.id===M))return P;if(P.children){const z=v(P.children,M);if(z)return z}}return null},U=p=>{if(p.checked){I.defaultChecked.includes(p.id)||I.defaultChecked.push(p.id);const M=v(I.treeData,p.id);M&&(I.defaultChecked.includes(M.id)||I.defaultChecked.push(M.id),((V,L)=>{let X=[];const H=(O,j)=>{for(const J of O)if(J.children){if(J.children.some(q=>q.id===j))return J;const Z=H(J.children,j);if(Z)return X.push(J.id),Z}return null};let x=V;for(;x;){const O=H(L,x.id);if(O)X.push(O.id),x=O;else break}return X})(M,I.treeData).forEach(V=>{I.defaultChecked.includes(V)||I.defaultChecked.push(V)}))}else{const M=I.defaultChecked.indexOf(p.id);M!==-1&&I.defaultChecked.splice(M,1)}},D=(p,M,P)=>{I.expandedKeys=p},h=async()=>{n.value=!0,s.value="add",w.setState({schema:m}),w.resetForm(),I.treeData=[],I.defaultChecked=[],I.treeData=[],await A.nextTick(),r.value&&r.value.toggleMaximize()},k=async p=>{i.value=!0,s.value="edit";const M=await G.post("/core/authRole/update_init",{authRole:{id:p.id}});if(n.value=!0,await A.nextTick(),w.setState({schema:m}),w.resetForm(),M.code===200){w.setValues(M.result.role,!1),w.updateSchema([{fieldName:"cRolenumb",componentProps:{disabled:!0}}]),I.defaultChecked=(M.result.resourceidList||[]).map(String);const P=M.result.treeList||[];I.treeData=y(P),a(I.treeData),I.expandedKeys=[]}await A.nextTick(),r.value&&r.value.toggleMaximize(),i.value=!1};t({addInit:h,editInit:k,detailInit:p=>{k(p)}});const N=async()=>{const{valid:p}=await w.validate();if(!p)return!1;const P={authRole:await w.getValues(),idList:I.defaultChecked},z=await G.post(s.value==="add"?"/core/authRole/saveRole":"/core/authRole/saveUpdateRole",P);return z.code===200?(b.Message.success(z.message),n.value=!1,c("success"),!0):(b.Message.error(z.message),!1)};function u(){n.value=!1}return(p,M)=>(A.openBlock(),A.createBlock(A.unref(Y.Modal),{ref_key:"modalRef",ref:r,"model-value":n.value,title:s.value==="add"?A.unref(o)("role.addTitle"):A.unref(o)("role.editTitle"),"on-before-ok":N,onClose:u},{default:A.withCtx(()=>[A.createElementVNode("div",Ml,[A.createVNode(A.unref(d)),A.createElementVNode("div",yl,[A.createElementVNode("h4",Fl,A.toDisplayString(A.unref(o)("role.resourceConfig")),1),A.createElementVNode("div",kl,[A.createVNode(A.unref(b.Tree),{ref_key:"treeRef",ref:B,data:I.treeData,"node-key":"id",checkable:!0,"check-strictly":!0,"checked-keys":I.defaultChecked,"expanded-keys":I.expandedKeys,"field-names":{key:"id",title:"label",children:"children",disabled:"disabled"},"default-expand-all":!1,onExpand:D,onCheck:E},{extra:A.withCtx(P=>[A.createElementVNode("div",zl,[P?.buttonList&&P.buttonList.length?(A.openBlock(),A.createElementBlock("div",hl,[(A.openBlock(!0),A.createElementBlock(A.Fragment,null,A.renderList(P.buttonList,z=>(A.openBlock(),A.createBlock(A.unref(b.Checkbox),{key:z.id,modelValue:z.checked,"onUpdate:modelValue":V=>z.checked=V,disabled:z.disabled,class:"flex-shrink-0 whitespace-nowrap",onChange:V=>U(z)},{default:A.withCtx(()=>[A.createTextVNode(A.toDisplayString(z.label),1)]),_:2},1032,["modelValue","onUpdate:modelValue","disabled","onChange"]))),128))])):A.createCommentVNode("",!0)])]),_:1},8,["data","checked-keys","expanded-keys"])])])])]),_:1},8,["model-value","title"]))}}),Nl=A.defineComponent({__name:"RoleChooseUser",emits:["chooseUserEmit"],setup(e,{expose:t,emit:g}){const{t:o}=$.useI18n(),n=A.ref(!1),s=A.ref([]),r=g,B=[{fieldName:"cUsernumb",label:o("user.cUsernumb"),component:"Input",componentProps:{allowClear:!0,placeholder:o("role.inputPlaceholder")},colProps:{span:12}},{fieldName:"cUsername",label:o("user.cUsername"),component:"Input",componentProps:{allowClear:!0,placeholder:o("role.inputPlaceholder")},colProps:{span:12}}],i=[{type:"checkbox",width:50,fixed:"left"},{field:"cUsernumb",title:o("user.cUsernumb"),width:120},{field:"cUsername",title:o("user.cUsername"),width:120},{field:"cDeptname",title:o("user.cDeptname"),width:120},{field:"cJobname",title:o("role.jobname"),width:120}],c=()=>{s.value=[],n.value=!0},I=a=>{r("chooseUserEmit",a)},Q=async a=>{var l={authUser:{cUsernumb:a.cUsernumb||"",cUsername:a.cUsername||""},pageNo:a.pageNo,pageSize:a.pageSize};const C=await G.post("/core/authUser/selectForPage",l);return{list:C.result.records,total:C.result.total}};return t({openInit:c}),(a,l)=>(A.openBlock(),A.createBlock(A.unref(Y.SunnySearchModal),{visible:n.value,"onUpdate:visible":l[0]||(l[0]=C=>n.value=C),modelValue:s.value,"onUpdate:modelValue":l[1]||(l[1]=C=>s.value=C),title:A.unref(o)("role.userSearch"),"form-schema":B,"table-columns":i,"search-api":Q,"field-names":{label:"cUsername",value:"id"},onConfirm:I},null,8,["visible","modelValue","title"]))}}),rt=A.defineComponent({__name:"RoleAuth",emits:["success"],setup(e,{expose:t,emit:g}){const o=A.ref(),{t:n}=$.useI18n(),s=A.ref(!1),r=A.ref(null),B=A.ref([]),i=g,[c,I]=mA({schema:[]}),{authFormSchema:Q,authGridColumns:a}=OA({t:n,formApi:I}),[l,C]=Y.useSunnyEditGrid({gridOptions:{data:[],columns:a,border:!0,size:"mini",maxHeight:400,columnConfig:{resizable:!0}}});t({openInit:async v=>{r.value=v;const U=await G.post("/core/authRole/findRoleUser",{authRole:{id:v.id}}),D=U.code===200?U.result.authUserList||[]:[];B.value=JSON.parse(JSON.stringify(D)),s.value=!0,await A.nextTick(),I.setState({schema:Q}),I.resetForm(),I.setValues({cRolenumb:v.cRolenumb,cRolename:v.cRolename}),C.reloadData(D)}});const d=()=>{o.value.openInit()},w=async v=>{const U=await C.getFullData();v.forEach(D=>{T.findIndex(U,h=>h.id===D.id)>-1?b.Message.warning(n("role.duplicateUser",{username:D.cUsername})):C.addEvent({id:D.id,cAdmin:D.cAdmin,cUsername:D.cUsername,cUsernumb:D.cUsernumb})})},m=()=>{C.deleteSelection()},f=async()=>{const{valid:v}=await I.validate();if(!v)return!1;await I.getValues();const U=await C.getFullData(),D=await C.$grid.getRemoveRecords(),h=U.filter(N=>!B.value.some(u=>u.id===N.id)),k={authRole:{id:r.value.id},authUserDelList:D,authUserInsList:h},F=await G.post("/core/authRole/saveRoleUser",k);return F.code===200?(b.Message.success(F.message),s.value=!1,i("success"),!0):(b.Message.error(F.message),!1)};function y(){s.value=!1}return(v,U)=>{const D=A.resolveComponent("a-button"),h=A.resolveComponent("a-space");return A.openBlock(),A.createBlock(A.unref(Y.Modal),{"model-value":s.value,title:A.unref(n)("role.authTitle"),width:700,"on-before-ok":f,onClose:y},{default:A.withCtx(()=>[A.createVNode(A.unref(c)),A.createVNode(A.unref(l),null,{toolbar:A.withCtx(()=>[A.createVNode(h,{class:"mb-2"},{default:A.withCtx(()=>[A.createVNode(D,{type:"primary",onClick:d},{default:A.withCtx(()=>[A.createTextVNode(A.toDisplayString(A.unref(n)("common.create")),1)]),_:1}),A.createVNode(D,{type:"primary",onClick:m},{default:A.withCtx(()=>[A.createTextVNode(A.toDisplayString(A.unref(n)("common.deleteSelected")),1)]),_:1})]),_:1})]),_:1}),A.createVNode(Nl,{ref_key:"RoleChooseUserRef",ref:o,onChooseUserEmit:w},null,512)]),_:1},8,["model-value","title"])}}}),Ol={class:"flex-1 bg-[var(--color-bg-2)] flex flex-col shadow-sm border border-[var(--color-border)] overflow-hidden rounded"},Sl={class:"px-4 border-b py-2 pb-3 border-[var(--color-border)]"},Ul={class:"flex-1 px-2 pt-1 overflow-hidden flex flex-col"},Gl=nA(A.defineComponent({__name:"RoleQuery",setup(e){const t=A.ref(),g=A.ref(),{t:o}=$.useI18n(),{searchFormSchema:n,tableColumns:s,resourceConfig:r}=OA({t:o}),B=async({page:U,formValues:D})=>{const h={pageNo:U.currentPage,pageSize:U.pageSize,authRole:D};return G.post("/core/authRole/selectForPage",h)},i={async toolbarButtonClick(U){const D=[...U.$grid.getCheckboxRecords()];switch(U.button.code){case"roleManagement/add":t.value.addInit();break;case"roleManagement/update":if(D.length!==1){b.Message.warning(o("common.selectOne"));return}t.value.editInit(D[0]);break;case"roleManagement/delete":if(D.length===0){b.Message.warning(o("role.selectDeleteRecords"));return}b.Modal.confirm({title:o("common.prompt"),content:o("role.deleteConfirm",{count:D.length}),onBeforeOk:async()=>{const h=D.map(F=>F.id),k=await G.post("/core/authRole/deleteRole",{idList:h});return k.code===200?(b.Message.success(k.message),U.$grid.commitProxy("query",{}),!0):(b.Message.error(k.message),!1)}});break;case"roleManagement/detail":if(D.length!==1){b.Message.warning(o("common.selectOne"));return}t.value.detailInit(D[0]);break;case"roleManagement/auth":if(D.length!==1){b.Message.warning(o("common.selectOne"));return}g.value.openInit(D[0]);break}}},{QueryForm:c,formApi:I,Grid:Q,gridApi:a,submitting:l,handleGlobalEnter:C,searchPlanList:E,currentSearchPlan:d,resourceId:w,nResourceid:m,handleSearchPlanSearch:f,handleDefaultPlanLoaded:y,businessResumeState:v}=lA({searchFormSchema:n,tableColumns:s,resourceConfig:r,queryFunction:B,gridEvents:i});return(U,D)=>(A.openBlock(),A.createElementBlock("div",{class:"role-query h-full flex flex-col bg-[var(--color-fill-2)]",onKeydown:D[2]||(D[2]=A.withKeys((...h)=>A.unref(C)&&A.unref(C)(...h),["enter"])),tabindex:"-1"},[A.createElementVNode("div",Ol,[A.createElementVNode("div",Sl,[A.createVNode(A.unref(c))]),A.createElementVNode("div",Ul,[A.createVNode(A.unref(Q),{class:"flex-1"})]),A.createVNode(nt,{ref_key:"RoleAddRef",ref:t,onSuccess:D[0]||(D[0]=()=>A.unref(a).commitProxy("query"))},null,512),A.createVNode(rt,{ref_key:"RoleAuthRef",ref:g,onSuccess:D[1]||(D[1]=()=>A.unref(a).commitProxy("query"))},null,512),A.createVNode(A.unref(pA),{state:A.unref(v)},null,8,["state"])])],32))}}),[["__scopeId","data-v-4f1fc0bd"]]);function xl(e,t){if(!Array.isArray(e))return[];const{label:g="cName",value:o="cXuhao"}=t||{};return e.map(n=>({label:String(n[g]||""),value:n[o],...n}))}const st={loadOptions:async(e,t)=>{if(!e||e.length===0)return{};try{const g=await G.post("/core/contact/findAuthDictList",{numbList:e}),o=g?.result||g,n={};return Object.keys(o).forEach(s=>{n[s]=xl(o[s],t)}),n}catch(g){return console.error("[SelectOptionsAdapter] Failed to load options:",g),{}}}},Bt={loadOptions:async(e,t)=>{if(!e||e.length===0)return{};const{label:g="cExresname",value:o="cExresnum"}=t||{},n=s=>typeof g=="function"?g(s):Array.isArray(g)?g.map(r=>s[r]??"").join("-"):String(s[g]||"");try{const s=await G.post("/core/contact/findUserExresList",{numbList:e}),r=s?.result||s,B={};return Object.keys(r).forEach(i=>{const c=r[i]||[];B[i]=c.map(I=>({label:n(I),value:I[o],...I}))}),B}catch(s){return console.error("[PermissionOptionsAdapter] Failed to load options:",s),{}}}};function Vl(e){return{input:"Input",select:"Select",date:"DatePicker",datetime:"TimePicker"}[e]||"Input"}function Ll(e){return e.map(t=>{const g={label:t.label,fieldName:t.prop,component:Vl(t.type),componentProps:{placeholder:t.meta?.placeholder||`请输入${t.label}`,...t.meta}};return t.type==="select"&&Array.isArray(t.optionlist)&&t.optionlist.length>0&&(g.componentProps.options=t.optionlist.map(o=>({label:o.cKeyname,value:o.cKeynumb}))),t.seltype==="3"&&t.selval&&(g.component="SunnyCustomizeSelect",g.componentProps={...g.componentProps,cNum:t.selval}),g})}function Yl(e){return e.map(t=>({title:t.label,field:t.prop,width:t.width}))}function Kl(e){return{title:e.cTitle,width:e.cWidth?isNaN(Number(e.cWidth))?e.cWidth:`${e.cWidth}px`:void 0,contentHeight:e.cHeight?isNaN(Number(e.cHeight))?e.cHeight:Number(e.cHeight):300,multiple:e.cSelectionMode!=="single",formSchema:Ll(e.conditions),tableColumns:Yl(e.tableCols)}}function Rl(e,t){const{page:g,pageNo:o,pageSize:n,...s}=e;return{pageNo:o||g,pageSize:n,sqlNum:t,conditions:s}}function jl(e){const t=e?.result||e;return{records:t?.records||t?.list||[],total:t?.total||t?.totalSize||0}}const at={loadConfig:async e=>{const t=await G.post("/core/assDialog/openInit",{cNum:e});return Kl(t)},search:async e=>{const{cNum:t,...g}=e,o=Rl(g,t),n=await G.post("/core/assDialog/selectForPageCommon",o);return jl(n)}},IA={disabled:!1,disabledOnChangeListener:!0,disabledOnInputListener:!0,emptyStateValue:void 0,businessSearchAdapter:at,customizeSelectAdapter:{query:async e=>{const g=(await G.post("/core/assSelect/commonQuery",e))?.result||{};return{options:g.optionList||[],config:g.assSelect||void 0}}},selectOptionsAdapter:st,permissionOptionsAdapter:Bt,uploadConfig:void 0,apiPrefix:void 0};function Xl(e={}){const{config:t,defineRules:g}=e,o={...IA,...t,businessSearchAdapter:{...IA.businessSearchAdapter,...t?.businessSearchAdapter},customizeSelectAdapter:{...IA.customizeSelectAdapter,...t?.customizeSelectAdapter},selectOptionsAdapter:{...IA.selectOptionsAdapter,...t?.selectOptionsAdapter},permissionOptionsAdapter:{...IA.permissionOptionsAdapter,...t?.permissionOptionsAdapter},uploadConfig:{...IA.uploadConfig,...t?.uploadConfig},apiPrefix:t?.apiPrefix};Y.setupSunnyForm({config:o,defineRules:g})}function SA(e,t){if(Array.isArray(e)){const g=e.map(n=>`'${t[n.prop]||void 0}' ${n.comparison} '${n.value||void 0}'`),o=T.first(e)?.logical||"&&";return g.join(` ${o} `)}else if(e&&e.type==="group"){if(!e.children||e.children.length===0)return"";const g=e.children.map(o=>{if(o.type==="group"){const n=SA(o,t);return n?`(${n})`:null}else return`'${t[o.prop]||void 0}' ${o.comparison} '${o.value||void 0}'`}).filter(o=>o);return g.length===0?"":g.join(` ${e.logical} `)}return""}function lt(e){const{cName:t,cStoremethod:g,cIcon:o,cClass:n,nOrder:s,id:r,cEvent:B,cSubArea:i}=e;return{label:t,handle:g,icon:o,class:n,order:s,loading:!1,size:"mini",nButtonid:r,cEvent:B,cSubArea:i,name:t,code:g,params:JSON.stringify(e)}}function Ct(e){const{cFieldtype:t,cLabel:g,cProp:o,cMeta:n,cSeltype:s,cSelval:r,cRequired:B,cPlaceholder:i,nOrder:c,cSign:I,cShow:Q,nLg:a,cDefVal:l,nI18ndata:C,cDirectives:E,cDynamicShow:d,cDynamicRules:w,cDynamicDisabled:m,cWidth:f}=e,y=n?JSON.parse(n):{};var v={components:t,label:g,fieldName:o,componentProps:{placeholder:i,disabled:I==="0"},hidden:Q!=="1",rules:B==="0"?"required":null,colSpan:a,defaultValue:l,order:c};return v={...v,...y},(t==="Input"||t==="Select")&&(v.componentProps.allowClear=!0),s&&r&&y.components!=="DatePicker"&&(v.componentProps.options=Qe(e),s==="3"&&(v.components="SunnyCustomizeSelect",v.componentProps.cNum=r)),v.dependencies={show:U=>{const D=JSON.parse(d),h=SA(D,U);return h?new Function(`return ${h}`)():!0},required:U=>{const D=JSON.parse(w),h=SA(D,U);return h?new Function(`return ${h}`)():!0},disabled:U=>{const D=JSON.parse(m),h=SA(D,U);return h?new Function(`return ${h}`)():!1}},v}function ct(e){const{cLabel:t,cProp:g,cFieldtype:o,cMeta:n,cSeltype:s,cSelval:r,cWidth:B,nOrder:i,nBill:c,cSign:I,cRequired:Q,cShow:a,cDirectives:l,cEntityTable:C,cDynamicRules:E,cDynamicDisabled:d}=e,w=n?JSON.parse(n):{};var m={title:t,field:g,width:B,...Y.EditRender[o]??{},params:{required:Q==="0",disabled:I==="0",visible:a==="0",order:i,nBill:c,cEntityTable:C}};return m={...w,...m},s&&r&&(m.params.options=Qe(e)),m}function UA(e){const t=T.groupBy(T.orderBy(e.resFieldList.map(s=>({...Ct(s),cArea:s.cArea})),["order"],["asc"]),"cArea"),g=T.groupBy(T.orderBy(e.resButtonList.map(s=>({...lt(s),cArea:s.cArea,cSubArea:s.cSubArea})),["order"],["asc"]),"cArea"),o=T.groupBy(T.orderBy(e.resFieldList.map(s=>({...ct(s),cArea:s.cArea})),["order"],["asc"]),"cArea"),n=e.resMenu;return{resFieldList:t,resButtonList:g,resColumnList:o,resMenu:n}}function Qe(e){const{cSeltype:t,cSelval:g,fieldDictList:o,fieldUserExresList:n}=e;var s=[];return t==="0"?s=o.map(r=>({label:r.cName,value:r.cXuhao,cConnkey:r.cConnkey})):t==="1"?s=_[g]:t==="2"?s=[]:t==="3"?s=[]:t==="4"&&(s=n.map(r=>({label:r.cExresnum+"-"+r.cExresname,value:r.cExresnum}))),s}function DA(e,t){const g=(t||[]).find(o=>o.value==e);return g?g.label:e}function ie(e,t){console.error("[Error Report]",{error:e,context:t,timestamp:new Date().toISOString()})}function Zl(e){const t=e.reason instanceof Error?e.reason:new Error(String(e.reason));ie(t,{type:"unhandledrejection",url:window.location.href,userAgent:navigator.userAgent,timestamp:new Date().toISOString()})}function Jl(e){const t=e.error instanceof Error?e.error:new Error(e.message);ie(t,{type:"global_error",filename:e.filename,lineno:e.lineno,colno:e.colno,url:window.location.href,userAgent:navigator.userAgent,timestamp:new Date().toISOString()})}const Qt=()=>({findAllByResourceid:e=>G.post("/core/assSearchplan/findAllByResourceid",e),findSearchPlanColsByPlanId:e=>G.post("/core/assSearchplan/findSearchPlanColsByPlanId",e),insert:e=>G.post("/core/assSearchplan/insert",e),update:e=>G.post("/core/assSearchplan/update",e),del:e=>G.post("/core/assSearchplan/delete",e),findDefSearchPlan:e=>G.post("/core/assSearchplan/findDefSearchPlan",e)}),Ee=Qt();function lA(e){const{searchFormSchema:t,tableColumns:g,dataType:o,resourceConfig:n,queryFunction:s,gridEvents:r,treeConfig:B,loadMethod:i,objectToValueFields:c,fieldMappingTime:I,arrayToStringFields:Q,lazy:a,autoLoad:l=!0,showCheckbox:C=!0,aggregateConfig:E,queryOnReset:d=!0}=e,{toolbarButtonClick:w,...m}=r||{},{resourceId:f,nResourceid:y,cModnumb:v}=n,U=A.ref([]),D=A.ref(void 0),h=A.ref(!1),{enhancedSchema:k}=wA(t);let F;const{enhancedSchema:N}=uA(k,{onAutoSelect:R=>MA(R,F)}),[u,p]=Y.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:h},actionColProps:{span:24,sm:12,md:8,lg:6,xl:4},schema:N.value,objectToValueFields:c,fieldMappingTime:I,arrayToStringFields:Q});F=p;const M=A.reactive({id:"OperationLogQuery",border:!0,size:"mini",showOverflow:!0,stripe:!B&&!a,height:"auto",align:"center",scrollX:{enabled:!0,gt:20},scrollY:{enabled:!0,gt:20},rowConfig:{keyField:"id",isCurrent:!0,isHover:!0},...C&&{checkboxConfig:{highlight:!0,range:!B&&!a,reserve:!1,trigger:"row",checkStrictly:!!(B||a)}},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. 支持鼠标区域选取,Ctrl+A 全选
|
|
9
9
|
4. 支持 Ctrl+C 复制选中区域
|
package/dist/index.mjs
CHANGED
|
@@ -14945,6 +14945,12 @@ function kA(A) {
|
|
|
14945
14945
|
stripe: !B && !C,
|
|
14946
14946
|
height: "auto",
|
|
14947
14947
|
align: "center",
|
|
14948
|
+
// 虚拟滚动:可见行/列约 12,gt 取约 1.7× 可见量(=20)。
|
|
14949
|
+
// vxe-table 4.x 激活条件 = enabled && (gt===0 || gt<数据量),故必须显式 enabled:true;
|
|
14950
|
+
// gt:20 → ≤20 行/列全量渲染(pageSize 20 不虚拟化、行为不变),50/100 才虚拟化省渲染。
|
|
14951
|
+
// 树形表格的行虚拟滚动由 vxe-table 按 treeConfig 自动关闭,不会与懒加载冲突。
|
|
14952
|
+
scrollX: { enabled: !0, gt: 20 },
|
|
14953
|
+
scrollY: { enabled: !0, gt: 20 },
|
|
14948
14954
|
rowConfig: {
|
|
14949
14955
|
keyField: "id",
|
|
14950
14956
|
isCurrent: !0,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sunny-base-web/effects",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.88",
|
|
4
4
|
"private": false,
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"vxe-table": "^4.17.49",
|
|
35
35
|
"xe-utils": "3.9.1",
|
|
36
36
|
"zod": "^4.3.6",
|
|
37
|
-
"@sunny-base-web/
|
|
38
|
-
"@sunny-base-web/icons": "^0.8.
|
|
39
|
-
"@sunny-base-web/
|
|
40
|
-
"@sunny-base-web/
|
|
41
|
-
"@sunny-base-web/
|
|
37
|
+
"@sunny-base-web/stores": "^0.8.88",
|
|
38
|
+
"@sunny-base-web/icons": "^0.8.88",
|
|
39
|
+
"@sunny-base-web/ui": "^0.8.88",
|
|
40
|
+
"@sunny-base-web/utils": "^0.8.88",
|
|
41
|
+
"@sunny-base-web/locales": "^0.8.88"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/lodash-es": "^4.17.12",
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
"typescript": "^5.7.2",
|
|
50
50
|
"vite": "^7.3.1",
|
|
51
51
|
"vite-plugin-dts": "^4.5.4",
|
|
52
|
-
"@sunny-base-web/
|
|
53
|
-
"@sunny-base-web/
|
|
54
|
-
"@sunny-base-web/
|
|
55
|
-
"@sunny-base-web/
|
|
52
|
+
"@sunny-base-web/constants": "0.8.88",
|
|
53
|
+
"@sunny-base-web/tailwind-config": "0.8.88",
|
|
54
|
+
"@sunny-base-web/designer-studio": "^0.1.1",
|
|
55
|
+
"@sunny-base-web/tsconfig": "0.8.88"
|
|
56
56
|
},
|
|
57
57
|
"publishConfig": {
|
|
58
58
|
"style": "./dist/effects.css",
|