import{V as h,Z as l,d as x,r as d,a as j,cZ as B,c as u,o as _,w as a,j as r,W as M,l as i,D as I,H as V,aI as $,p as W,A as X,B as q,ca as A,gW as E,gX as O,X as Q}from"./index-9PRMimni.js";import{o as U,e as Z}from"./jobPlanDetails-5wu16ZE_.js";import{B as z}from"./Table-0PViRYCf.js";import{_ as F}from"./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";import{_ as H}from"./index.vue_vue_type_script_setup_true_lang-DX4KqILq.js";import{_ as G}from"./index.vue_vue_type_script_setup_true_lang-CY7gkyew.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";import"./pick-Cg3anC-c.js";import"./head-aneRfQQJ.js";const{t:s}=h();function J(){return[{title:"No.",key:"num",width:60,render:(o,t)=>t+1},{title:s("jobPlan.viewDetails.sparePartsTab.partNumber"),key:"sparePartNumber",width:100},{title:s("jobPlan.viewDetails.sparePartsTab.itemDescription"),key:"itemDescription",width:200},{title:s("jobPlan.viewDetails.sparePartsTab.plannedQty"),key:"plannedQuantity",width:100},{title:s("jobPlan.viewDetails.sparePartsTab.units"),key:"unitName",width:100},{title:s("jobPlan.viewDetails.sparePartsTab.drawingNumber"),key:"drawingNumber",width:100},{title:s("jobPlan.viewDetails.sparePartsTab.drawing"),key:"drawing",width:100,render:o=>o.drawingUrl?l("a",{href:o.drawingUrl,target:"_blank"},o.drawing?.split("/")?.pop()||""):o.drawing?.split("/")?.pop()||""}]}const We=x({__name:"index",props:{isReadonly:{type:Boolean},data:{}},setup(o){const{t}=h(),y=B(),n=o,f=d(),b=d(),w=d(),g=j({width:60,title:t("common.optionsText"),key:"action",fixed:"right",align:"center",render(e){return l(F,{style:"text",actions:[{label:t("common.optionsEditText"),labelShow:!1,ifShow:!n.isReadonly,icon:l("i",{class:"iconfont icon-a-Frame28"}),onClick:k.bind(null,e)},{label:t("common.delText"),labelShow:!1,ifShow:!n.isReadonly,icon:l("i",{class:"iconfont icon-Delete red"}),onPositiveClick:C.bind(null,e),isConfirm:!0,confirmContent:t("common.delPop.contRole")}]})}});function P(){b.value?.handleOpenModal()}function k(e){w.value?.handleOpenModal({record:e})}function C(e){U({shipId:e.shipId,productCode:e.productCode,model:e.model,serialNumber:e.serialNumber,jobCode:e.jobCode,sparePartNumber:e.sparePartNumber}).then(()=>{y.success(t("common.optionsDelSuccessText")),p()})}async function R(e){try{return await Z({...n.data,...e})}catch(m){return console.error("加载表格数据失败:",m),{list:[],total:0}}}function p(){f.value?.restReload()}return(e,m)=>{const T=q,v=$,D=V,N=M,S=Q;return _(),u(S,null,{default:a(()=>[r(N,{bordered:!1,class:"proCard mt-2"},{default:a(()=>[r(i(z),{ref_key:"tableRef",ref:f,columns:i(J)(),request:c=>R(c),"row-key":c=>c.id,autoScrollX:!0,showTableSetting:!1,"virtual-scroll":"",actionColumn:n.isReadonly?void 0:i(g)},{toolbar:a(()=>[n.isReadonly?I("",!0):(_(),u(D,{key:0},{default:a(()=>[r(v,{trigger:"hover"},{trigger:a(()=>[r(T,{type:"primary",strong:"",bordered:"",secondary:"",class:"size-7",onClick:P},{icon:a(()=>[(_(),u(A(i(E)(i(O).add))))]),_:1})]),default:a(()=>[W(" "+X(i(t)("jobPlan.viewDetails.proceduresTab.add")),1)]),_:1})]),_:1}))]),_:1},8,["columns","request","row-key","actionColumn"])]),_:1}),r(H,{ref_key:"selectSparePartsModalRef",ref:b,data:n.data,onRefresh:p},null,8,["data"]),r(G,{ref_key:"sparePartsModalRef",ref:w,onRefresh:p},null,512)]),_:1})}}});export{We as default};
