import{V as g,Z as k,n as N,d as j,r as I,bl as M,a as V,gW as p,gX as m,cZ as W,c as u,o as _,w as n,j as s,W as X,l as r,D as $,H as q,aI as A,p as E,A as J,B as O,ca as Z,X as z}from"./index-9PRMimni.js";import{B as H}from"./Table-0PViRYCf.js";import{_ as F}from"./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";import{k as G,c as K}from"./jobPlanDetails-5wu16ZE_.js";import{_ as L}from"./index.vue_vue_type_script_setup_true_lang-D9a4EZYr.js";import{p as y}from"./pick-Cg3anC-c.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"./BasicForm-dL_oCSPM.js";import"./SingleImageUpload-CNx4b9eC.js";import"./ImageUpload.vue_vue_type_style_index_0_scoped_cb086928_lang-D-28kXvw.js";import"./ImageUpload-DUsnro3W.js";import"./BasicUpload.vue_vue_type_style_index_0_scoped_a4d0e930_lang-DxRbtP01.js";import"./BasicForm.vue_vue_type_style_index_0_scoped_b9e995ec_lang-CEvcLwxD.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";const{t:h}=g(),Q=[{title:"No.",key:"num",width:60,render:(i,e)=>e+1},{title:h("jobPlan.viewDetails.proceduresTab.procedureDetails"),key:"procedureDetail"},{title:h("jobPlan.viewDetails.proceduresTab.mandatory"),key:"mandatory",width:200,render:i=>{const{mandatory:e}=i;return k(N,{style:{cursor:"default"},readonly:!0,checked:e,checkedValue:!0,uncheckedValue:!1})}}],We=j({__name:"index",props:{isReadonly:{type:Boolean},data:{}},setup(i){const{t:e}=g(),C=W(),t=i,f=I(),c=M("proceduresModalRef"),R=V({width:100,title:e("common.optionsText"),key:"action",fixed:"right",align:"center",render(o){return k(F,{style:"text",actions:[{label:e("common.optionsEditText"),labelShow:!1,ifShow:!t.isReadonly,icon:p(m.edit),onClick:w.bind(null,o)},{label:e("common.delText"),labelShow:!1,ifShow:!t.isReadonly,icon:p(m.delete,"red"),onPositiveClick:T.bind(null,o),isConfirm:!0,confirmContent:e("common.delPop.contRole")}]})}});function w(o){c.value?.handleOpenModal({type:"edit",record:o})}function T(o){const l={...y(t.data,["shipId","serialNumber","productCode","model","jobCode"]),id:o?.id};G(l).then(a=>{C.success(e("common.optionsDelSuccessText")),b()})}function v(){c.value?.handleOpenModal()}async function x(o){const l=y(t.data,["shipId","serialNumber","productCode","model","jobCode"]);try{const a=await K({...l});return{list:a??[],total:a?.length??0}}catch(a){return console.error("加载表格数据失败:",a),{list:[],total:0}}}function b(){f.value?.restReload()}return(o,l)=>{const a=O,D=A,P=q,S=X,B=z;return _(),u(B,null,{default:n(()=>[s(S,{bordered:!1,class:"proCard mt-2"},{default:n(()=>[s(r(H),{ref_key:"tableRef",ref:f,columns:r(Q),request:d=>x(d),"row-key":d=>d.id,autoScrollX:!0,showTableSetting:!1,"virtual-scroll":"",pagination:!1,actionColumn:t.isReadonly?void 0:r(R)},{toolbar:n(()=>[t.isReadonly?$("",!0):(_(),u(P,{key:0},{default:n(()=>[s(D,{trigger:"hover"},{trigger:n(()=>[s(a,{type:"primary",strong:"",bordered:"",secondary:"",class:"size-7",onClick:v},{icon:n(()=>[(_(),u(Z(r(p)(r(m).add))))]),_:1})]),default:n(()=>[E(" "+J(r(e)("jobPlan.viewDetails.proceduresTab.add")),1)]),_:1})]),_:1}))]),_:1},8,["columns","request","row-key","actionColumn"])]),_:1}),s(L,{ref_key:"proceduresModalRef",ref:c,onRefresh:b,data:t.data},null,8,["data"])]),_:1})}}});export{We as default};
