import{r as l,V as x,d as O,f as R,aw as F,c as I,o as T,w as s,j as i,l as f,cS as V,N as k,gU as h,X as G}from"./index-9PRMimni.js";import{B as z}from"./BasicForm-dL_oCSPM.js";import{al as C,w as H}from"./template-rpthWlT9.js";import{u as M}from"./useForm-CKmgcynv.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";const{t:e}=x(),J=l([]);function L(){const t=l(!1),u=l(null),p=[{field:"vesselPassTime",component:"NInput",label:e("hsqe.nc.Date"),componentProps:{disabled:t}},{field:"officerVerification",component:"NSelect",label:e("hsqe.nc.VerifyResult"),componentProps:{options:[{label:"YES",value:"yes"},{label:"NO",value:"no"}],disabled:t}},{field:"captainSingUrl",label:e("hsqe.deficiency.masterOrHeadOfDept"),slot:"captainSingUrl",giProps:{span:1}},{field:"officePassTime",component:"NDatePicker",label:e("hsqe.nc.RectifyData"),componentProps:{valueFormat:"yyyy-MM-dd HH:mm:ss",type:"date",disabled:t}},{field:"officerSingUrl",label:e("hsqe.nc.verifiedBy"),slot:"officerSingUrl"},{field:"officerVerifyResult",component:"NInput",label:e("hsqe.deficiency.verification"),componentProps:{type:"textarea",disabled:t},giProps:{span:3}},{field:"dpaPassTime",component:"NInput",label:e("hsqe.nc.Date"),componentProps:{disabled:t}},{field:"dpaSingUrl",label:e("hsqe.nc.dpa"),slot:"dpaSingUrl"}];return{schemas:p,methods:{setReadOnly:o=>{t.value=o},setReportType:o=>{u.value=o},setDefectList:o=>{J.value=o.list},getSchemas:()=>p}}}const de=O({__name:"index",emits:["saveCallBack"],setup(t,{expose:u,emit:p}){const m=R(),o=p,_=l([]),{methods:b}=L(),{setReadOnly:y,getSchemas:v}=b,[S,{setFieldsValue:w,getFieldsValue:D}]=M({schemas:_,labelWidth:"auto",layout:"horizontal",gridProps:{cols:3,xGap:15},showActionButtonGroup:!1}),N=l({});async function P(){if(m.query.id){const a=await C(Number(m.query.id));let n=JSON.parse(JSON.stringify(a));w(n)}m.query.type==="view"?y(!0):y(!1);const d=v();_.value=d,y(!0)}async function q(){let d=D();const a={...N.value,...d};a.expirationTime&&(a.expirationTime+=" 00:00:00"),await H(a),o("saveCallBack")}return F(()=>{P()}),u({submit:q}),(d,a)=>{const n=k,g=V,B=z,U=G;return T(),I(U,null,{default:s(()=>[i(B,{class:"mt-3",onRegister:f(S)},{captainSingUrl:s(({model:r,field:c})=>[i(g,{width:"100",src:r[c],"preview-disabled":""},{error:s(()=>[i(n,{size:80,color:"lightGrey",component:f(h)},null,8,["component"])]),_:2},1032,["src"])]),officerSingUrl:s(({model:r,field:c})=>[i(g,{width:"100",src:r[c],"preview-disabled":""},{error:s(()=>[i(n,{size:80,color:"lightGrey",component:f(h)},null,8,["component"])]),_:2},1032,["src"])]),dpaSingUrl:s(({model:r,field:c})=>[i(g,{width:"100",src:r[c],"preview-disabled":""},{error:s(()=>[i(n,{size:80,color:"lightGrey",component:f(h)},null,8,["component"])]),_:2},1032,["src"])]),_:1},8,["onRegister"])]),_:1})}}});export{de as default};
