import{V as y,Z as s,d as g,r as d,a as I,gE as v,ay as M,ac as O,c as x,o as V,w as R,j as l,l as n,G as B,X as N}from"./index-9PRMimni.js";import{c as S,F as $}from"./FormModal-EdElmVaV.js";import{B as F}from"./BasicForm-dL_oCSPM.js";import{u as D}from"./useForm-CKmgcynv.js";import{B as A}from"./Table-0PViRYCf.js";import{_ as P}from"./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";import{d as K}from"./vesselEquipmentDetails-CJeqdW1Z.js";import{_ as f}from"./index-DatBjkM3.js";import"./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";import"./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";import"./account-C850CBTF.js";import"./useModal-CO65vga3.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"./usePageCache-DluHn7Yy.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"./Flex-CTSf12gq.js";const{t:i}=y();function W(){return{columns:[{title:i("equipmentLibrary.equipmentMainLibrary.tableNum"),key:"num",width:80,render:(e,a)=>a+1},{title:i("equipmentLibrary.equipmentMainLibrary.conditionOfClass.status"),key:"status",width:160,render(e){return s(f,{cacheKey:"equipment_condition_status",dictValue:e.status,optionType:"number"})}},{title:i("equipmentLibrary.equipmentMainLibrary.conditionOfClass.category"),key:"category",width:160,render(e){return s(f,{cacheKey:"equipment_condition_category",dictValue:e.category,optionType:"number"})}},{title:i("equipmentLibrary.equipmentMainLibrary.conditionOfClass.description"),key:"narration",width:200},{title:i("equipmentLibrary.equipmentMainLibrary.conditionOfClass.dateIssued"),key:"dateIssued",width:140},{title:i("equipmentLibrary.equipmentMainLibrary.conditionOfClass.dueDate"),key:"dueDate",width:140},{title:i("equipmentLibrary.equipmentMainLibrary.conditionOfClass.correctiveAction"),key:"correctiveAction",width:200},{title:i("equipmentLibrary.equipmentMainLibrary.conditionOfClass.attachment"),key:"attachmentCode",width:200,render(e){return s("a",{href:e?.fileUrl,target:"_blank",download:e?.fileName},e?.fileName)}},{title:i("equipmentLibrary.equipmentMainLibrary.conditionOfClass.remarks"),key:"remarks",width:200}]}}const Me=g({__name:"index",props:{selectedTreeItem:{}},setup(c){const e=c,{t:a}=y(),u=d(),p=d(),{searchSchemas:b}=S(),[_,{getFieldsValue:h}]=D({gridProps:{cols:"2 s:3 xl:4"},schemas:b,labelWidth:"auto",labelPlacement:"top",showAdvancedButton:!1}),{columns:w}=W(),C=I({width:160,title:a("common.optionsText"),key:"action",fixed:"right",align:"center",render(t){return s(P,{style:"text",actions:[{label:a("common.optionsViewText"),labelShow:!1,icon:s(v,{iconName:"view",iconType:"lineIcon"}),onClick:q.bind(null,t)}]})}});M(()=>e.selectedTreeItem,()=>{O(()=>{m(!0)})},{immediate:!0,deep:!0});function T(t,o){return K({...t,...o,productCode:e.selectedTreeItem?.code,model:e.selectedTreeItem?.model,serialNumber:e.selectedTreeItem?.serialNumber,shipId:e.selectedTreeItem?.shipId})}function q(t){p.value?.handleOpenModal(a("common.optionsViewText"),t,"view")}function m(t){u.value[t?"restReload":"reload"]()}return(t,o)=>{const k=B,L=N;return V(),x(L,null,{default:R(()=>[l(n(F),{onRegister:n(_),onSubmit:o[0]||(o[0]=r=>m(!0)),onReset:o[1]||(o[1]=r=>m(!0))},null,8,["onRegister"]),l(k,{class:"mt-3 mb-4"}),l(n(A),{ref_key:"basicTableRef",ref:u,columns:n(w),request:r=>T(r,n(h)()),"row-key":r=>r.id,autoScrollX:!0,actionColumn:n(C),immediate:!1,"virtual-scroll":""},null,8,["columns","request","row-key","actionColumn"]),l($,{ref_key:"formModalRef",ref:p,selectedTreeItem:t.selectedTreeItem,onSuccess:o[2]||(o[2]=r=>m(!1))},null,8,["selectedTreeItem"])]),_:1})}}});export{Me as default};
