import{V as F,bk as D,d as H,e as T,f as B,r as d,a as E,Z as L,gW as y,gX as f,c as V,o as I,w as h,j as r,W as P,l as i,X as W}from"./index-9PRMimni.js";import{B as X}from"./BasicForm-dL_oCSPM.js";import{B as j}from"./Table-0PViRYCf.js";import{_ as A}from"./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";import{g as U}from"./smsFileHistory-3qnGgVom.js";import{c as M}from"./schemas-B8iAcMwN.js";import{u as O}from"./useForm-CKmgcynv.js";import{h as Z}from"./has-CjqcrIOV.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"./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"./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"./useTimeout-BxFilWvD.js";import"./usePageCache-DluHn7Yy.js";import"./Flex-CTSf12gq.js";const n=D(),{t}=F();function $(){return{columns:[{title:t("common.messagedefine.Num"),key:"num",width:60,render:(s,a)=>a+1},{title:t("sms.smsFileHistory.smsCategory"),key:n.getLocale==="en"?"categoryNameEn":"categoryName",width:80},{title:t("sms.smsFileHistory.smsSection"),key:n.getLocale==="en"?"sectionNameEn":"sectionName",width:80},{title:t("sms.smsFileHistory.smsFileCode"),key:"code",width:100},{title:t("sms.smsFileHistory.smsFileNameEn"),key:"nameEn",width:120},{title:t("sms.smsFileHistory.smsFileNameCn"),key:"nameCn",width:120},{title:t("sms.smsFileHistory.version"),key:"version",width:120},{title:t("sms.smsFileHistory.interval"),key:n.getLocale==="en"?"frequencyNameEn":"frequencyName",width:80},{title:t("sms.smsFileHistory.reportBy"),key:"reportBy",width:80},{title:t("sms.smsFileHistory.reportDate"),key:"reportDate",width:100},{title:t("sms.smsFileHistory.status"),key:n.getLocale==="en"?"statusNameEn":"statusName",width:100}]}}const Te=H({__name:"index",setup(v){const{t:s}=F(),{columns:a}=$(),m=T(),l=B(),{schemas:C}=M(),[S,{getFieldsValue:w,setFieldsValue:q}]=O({gridProps:{cols:6},schemas:C}),_=d(),g=d(!1),c=d(l.query),N=E({width:140,title:s("common.optionsText"),key:"action",fixed:"right",align:"center",render(e){return L(A,{style:"text",actions:[{label:s("common.optionsEditText"),labelShow:!1,icon:y(f.edit),onClick:()=>m.push({name:"smsDetail",query:{id:e.id,type:"edit"}}),ifShow:()=>[1,3].includes(e.status)&&e.canEdit},{label:s("common.optionsApproveText"),labelShow:!1,icon:y(f.approve),onClick:()=>m.push({name:"smsDetail",query:{id:e.id,type:"approve"}}),ifShow:()=>[2].includes(e.status)&&e.canApprove},{label:s("common.optionsViewText"),labelShow:!1,icon:y(f.view,"blue"),onClick:()=>{m.push({name:"smsDetail",query:{id:e.id,type:"view"}})}}]})}});function k(){const e=new URL(window.location.href);e.search="",window.history.replaceState({},"",e.toString()),c.value={},_.value?.restReload()}async function R(e,o){if(o.reportDate&&o.reportDate.length!==0&&(o.reportDate=o.reportDate.join(",")),!Z(w(),"shipId")&&!g.value){const u={...c.value,frequency:l.query.frequency?Number(l.query.frequency):void 0};q(u),g.value=!0}return await U({...e,...o,...c.value})}return(e,o)=>{const u=X,b=P,x=W;return I(),V(x,null,{default:h(()=>[r(b,{bordered:!1,class:"proCard"},{default:h(()=>[r(u,{onRegister:i(S),onSubmit:k,onReset:k},null,8,["onRegister"])]),_:1}),r(b,{bordered:!1,class:"proCard mt-2"},{default:h(()=>[r(i(j),{ref_key:"basicTableRef",ref:_,columns:i(a),actionColumn:i(N),request:p=>R(p,i(w)()),"row-key":p=>p.id,autoScrollX:!0,"virtual-scroll":""},null,8,["columns","actionColumn","request","row-key"])]),_:1})]),_:1})}}});export{Te as default};
