import{d as $,eV as S,f as V,u as q,r as l,Z as x,n as A,a as E,ac as C,l as a,aw as D,c as Q,o as U,w as o,j as t,W,U as J,M as K,p as X,A as Z,B as H,h4 as Y,h3 as ee,X as te}from"./index-9PRMimni.js";import{d as oe,g as ne,a as le}from"./group-DxznlajQ.js";import{_ as ae}from"./addGroup.vue_vue_type_script_setup_true_lang-epv7CiH2.js";import{B as ie}from"./Table-0PViRYCf.js";import{_ as se}from"./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";import{_ as re}from"./ItemForm.vue_vue_type_script_setup_true_lang-CtdlO5VT.js";import{_ as ue}from"./Flex-CTSf12gq.js";import"./BasicForm-dL_oCSPM.js";import"./Render.vue_vue_type_script_lang-DKUYY0Zw.js";import"./SingleImageUpload-CNx4b9eC.js";import"./ImageUpload.vue_vue_type_style_index_0_scoped_cb086928_lang-D-28kXvw.js";import"./componentSetting-DVhNDBTO.js";import"./ImageUpload-DUsnro3W.js";import"./vuedraggable.umd-Co2xEC3p.js";import"./BasicUpload.vue_vue_type_style_index_0_scoped_a4d0e930_lang-DxRbtP01.js";import"./tabsView-BXskTdVh.js";import"./BasicForm.vue_vue_type_style_index_0_scoped_b9e995ec_lang-CEvcLwxD.js";import"./propTypes-CebMRUpe.js";import"./BasicSelect-C_uwzMkE.js";import"./BasicSelect.vue_vue_type_style_index_0_scoped_772d51cc_lang-Brp6PjEU.js";import"./dictionary-BRse4lkf.js";import"./index-DkvzUEqh.js";import"./index-kKnqLkWM.js";import"./AutoComplete-Dv1Bqed4.js";import"./TreeSelect-BZh2DeCh.js";import"./useForm-CKmgcynv.js";import"./usePageCache-DluHn7Yy.js";import"./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";import"./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";import"./useModal-CO65vga3.js";import"./Table.vue_vue_type_style_index_0_scoped_7b9e6ece_lang-BoW2DV_e.js";import"./componentMap-CElCaWis.js";import"./format-DgF6KtHk.js";import"./omit-B2_8Y6O_.js";import"./_flatRest-DBrd2CHT.js";import"./flatten-DeoUZLdb.js";import"./print-CT_2hrjP.js";import"./useTimeout-BxFilWvD.js";import"./gitDictData-jrP3nJ1a.js";const Xe=$({__name:"index",setup(me){const{t:n}=S(),d=V(),f=q(),_=l([]),g=l(),v=l(),i=l(null),y=l(),T=l(""),s=l(),w=l(n("drill.manage.addGroup")),m=l(!1),G={showQuickJumper:!1},R=[{key:"select",fixed:"left",width:40,render(e){return x(A,{checked:i.value===e.id,"onUpdate:checked"(){i.value=e.id}})}},{title:n("drill.manage.groupTitle"),key:"groupName"}],L=E({width:140,title:n("drill.manage.operation"),key:"action",fixed:"right",align:"center",render(e){return x(se,{actions:[{label:n("drill.manage.delete"),onPositiveClick:I.bind(null,e),isConfirm:!0,confirmContent:`您确定要删除【${e.groupName}】吗？`},{label:n("drill.manage.edit"),onClick:F.bind(null,e)}]})}});function B(){s.value.openModal(),C(()=>{m.value=!1,s.value.setProps({title:n("drill.manage.addGroup")})})}function I(e){T.value=e.name,oe(e.id).then(()=>{f.success(n("drill.manage.deleteSuccess")),b()})}async function j(){try{const e=await ne(d.query.id);_.value=e,i.value=e.length>0?e[0].groupId:null}catch(e){console.error("获取项目列表项时出错:",e)}}function F(e){s.value.openModal(),C(()=>{m.value=!0,s.value.setProps({title:n("drill.manage.editGroup")}),s.value.setFieldsValue({...a(e)})})}function b(){g.value.restReload()}function N(){console.log("menuChange"),i.value=null}function z(){if(i.value===null){f.error(n("drill.manage.addButtonRules"));return}let e=y.value.find(r=>r.id===i.value);a(v).submit(e)}const M=async()=>{const{records:e,total:r}=await le({});if(y.value=e,e.length){const p=l(null);e.length&&(p.value=e[0].id)}return{list:e,total:r}};return D(()=>{d.query.type==="edit"&&(j(),m.value=!0)}),(e,r)=>{const u=K,p=H,O=ue,h=J,c=W,P=te;return U(),Q(P,null,{default:o(()=>[t(c,{segmented:{content:"hard"},bordered:!1,size:"small"},{default:o(()=>[t(h,{cols:"1 s:1 m:1 l:4 xl:4 2xl:4",responsive:"screen","x-gap":10},{default:o(()=>[t(u,{span:"1",class:"font-bold text-xl"},{default:o(()=>[X(Z(a(n)("drill.manage.formTitle")),1)]),_:1}),t(u,{span:"3"},{default:o(()=>[t(O,{justify:"end"},{default:o(()=>[t(p,{type:"primary",size:"small",onClick:z},{icon:o(()=>[t(a(Y))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),t(h,{cols:"1 s:1 m:1 l:4 xl:4 2xl:4",responsive:"screen","x-gap":10},{default:o(()=>[t(u,{span:"1",class:"mb-4 mt-2"},{default:o(()=>[t(c,{title:a(n)("drill.manage.formGroup"),segmented:{content:"hard"},bordered:!1,size:"small"},{default:o(()=>[t(a(ie),{columns:R,request:M,"row-key":k=>k.id,ref_key:"leftTableRef",ref:g,showTableSetting:!1,pagination:G,actionColumn:L},{tableTitle:o(()=>[t(p,{type:"primary",size:"small",onClick:B},{icon:o(()=>[t(a(ee))]),_:1})]),_:1},8,["row-key","actionColumn"])]),_:1},8,["title"])]),_:1}),t(u,{span:"3",class:"mt-2 h-full"},{default:o(()=>[t(c,{segmented:{content:"hard"},bordered:!1,size:"small"},{default:o(()=>[t(re,{ref_key:"menuFormRef",ref:v,onChange:N,isEdit:m.value,resultList:_.value,class:"w-2/4 ml-10"},null,8,["isEdit","resultList"])]),_:1})]),_:1})]),_:1}),t(ae,{ref_key:"addGroupRef",ref:s,title:w.value,onChange:r[0]||(r[0]=k=>b())},null,8,["title"])]),_:1})}}});export{Xe as default};
