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