import{d as y,V as w,r,a4 as k,a as x,Z as c,gE as m,ay as D,cZ as J,c as S,o as B,w as d,j as p,l as o,c6 as E,X as I,v as N}from"./index-9PRMimni.js";import{B as j}from"./Table-0PViRYCf.js";import{_ as L}from"./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";import{x as R,y as V}from"./vesselEquipmentDetails-CJeqdW1Z.js";import{c as X}from"./columns-BV6QS8Hv.js";import"./Table.vue_vue_type_style_index_0_scoped_7b9e6ece_lang-BoW2DV_e.js";import"./vuedraggable.umd-Co2xEC3p.js";import"./Render.vue_vue_type_script_lang-DKUYY0Zw.js";import"./componentMap-CElCaWis.js";import"./propTypes-CebMRUpe.js";import"./format-DgF6KtHk.js";import"./omit-B2_8Y6O_.js";import"./_flatRest-DBrd2CHT.js";import"./flatten-DeoUZLdb.js";import"./print-CT_2hrjP.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"./componentSetting-DVhNDBTO.js";import"./useTimeout-BxFilWvD.js";import"./usePageCache-DluHn7Yy.js";import"./tabsView-BXskTdVh.js";import"./Flex-CTSf12gq.js";import"./index-DatBjkM3.js";import"./columns-BK5KZ8kW.js";import"./schemas-Cam1kIsU.js";import"./dateUtil-BtafrT1f.js";import"./AutoComplete-Dv1Bqed4.js";const Z=y({__name:"Procedures",props:{selectedJobPlanParams:{},isEditable:{type:Boolean}},setup(u){const t=u,{t:s}=w(),f=J(),b=r(),i=r(!1),a=r([]),{proceduresTableColumns:_}=X({handleGetTableList:n,nodeProps:t}),C=k(()=>(a.value||[]).some(e=>e?.editable)),P=x({width:120,title:s("common.optionsText"),key:"action",fixed:"right",align:"center",render(e,l){return c(L,{style:"text",actions:[{label:s("common.optionsDelText"),labelShow:!1,icon:c(m,{iconName:"delete",iconType:"lineIcon"}),isConfirm:!0,confirmContent:s("common.dialogContentDeleteText"),onPositiveClick:()=>{v(e,l)}}]})}});D(()=>t.selectedJobPlanParams,e=>{e&&n()},{immediate:!0,deep:!0});function h(){a.value=a.value||[],a.value.push({procedureDetail:"",mandatory:!1,editable:!0,...t.selectedJobPlanParams||{}})}async function n(){i.value=!0;try{a.value=await R(t.selectedJobPlanParams||{}),i.value=!1}catch{i.value=!1}}async function v(e,l){e.id?(await V({id:e.id,jobCode:e.jobCode,productCode:e.productCode,model:e.model,serialNumber:e.serialNumber,shipId:e.shipId}),await n()):a.value.splice(l,1),f.success(s("common.optionsDelSuccessText"))}return(e,l)=>{const T=I;return B(),S(T,null,{default:d(()=>[p(o(j),{ref_key:"basicTableRef",ref:b,columns:o(_),dataSource:o(a),"row-key":g=>g.id,actionColumn:e.isEditable?o(P):null,autoScrollX:!0,pagination:!1,immediate:!1,showTableSetting:!1,loading:o(i),canResize:!1,"virtual-scroll":""},E({_:2},[e.isEditable?{name:"toolbar",fn:d(()=>[p(o(m),{disabled:o(C),iconName:"add",onClick:h},null,8,["disabled"])]),key:"0"}:void 0]),1032,["columns","dataSource","row-key","actionColumn","loading"])]),_:1})}}}),fe=N(Z,[["__scopeId","data-v-acf57602"]]);export{fe as default};
