import{_ as q}from"./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";import"./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";import{B as L}from"./Table-0PViRYCf.js";import{_ as I}from"./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";import{r as K,t as W}from"./jobOrder-CGbsc7bp.js";import{B as $}from"./BasicForm-dL_oCSPM.js";import{u as X}from"./useForm-CKmgcynv.js";import{V as R,bk as Z,d as z,e as G,r as a,a as H,Z as g,h as J,o as Q,j as n,w as k,W as U,l as r,ac as Y,d8 as ee}from"./index-9PRMimni.js";import{u as te}from"./useModal-CO65vga3.js";import{i as oe}from"./isEmpty-BUg1OsQj.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 w=Z(),{t}=R();function se(){return{riskAssessmentColumns:[{key:"isSelect",type:"selection",width:60,multiple:!1},{title:t("common.messagedefine.Num"),key:"num",width:60,render:(l,i)=>i+1},{title:t("jobOrder.riskAssessmentReportNo"),key:"reportNo",width:120},{title:t("jobOrder.category"),key:w.getLocale==="en"?"operationEnglish":"operationChinese",width:120},{title:t("jobOrder.completionDate"),key:"estimatedTime",width:120},{title:t("jobOrder.createBy"),key:w.getLocale==="en"?"roleNameEn":"roleName",width:120},{title:t("jobOrder.createDate"),key:"createTime",width:120}]}}function re(){return{workPermitColumns:[{key:"isSelect",type:"selection",width:60,multiple:!1},{title:t("common.messagedefine.Num"),key:"num",width:60,render:(l,i)=>i+1},{title:t("jobOrder.smsFileCode"),key:"code",width:120},{title:t("jobOrder.smsFileNameEn"),key:"nameEn",width:120},{title:t("jobOrder.smsFileNameCn"),key:"nameCn",width:120},{title:t("jobOrder.reportDate"),key:"reportDate",width:120},{title:t("jobOrder.reportBy"),key:w.getLocale==="en"?"reportRoleEn":"reportRole",width:120}]}}const Ke=z({__name:"Modal",emits:["success"],setup(h,{expose:l,emit:i}){const T=i,{t:m}=R(),y=G(),{riskAssessmentColumns:A}=se(),{workPermitColumns:O}=re(),c=a(),o=a(""),u=a({}),p=a(!1),j=H({width:80,title:m("common.optionsText"),key:"action",fixed:"right",align:"center",render(e){return g(I,{style:"text",actions:[{label:m("common.optionsViewText"),labelShow:!1,icon:g("i",{class:"iconfont icon-View blue"}),onClick:()=>{o.value==="workPermit"?(y.push({name:"workPermitDetail",query:{id:e.id}}),d()):o.value==="riskAssessment"&&(y.push({name:"RiskAssessment_View",query:{id:e.id,type:"tabs_view"}}),d())}}]})}}),[x,{openModal:B,closeModal:d,setProps:P}]=te({subBtuText:m("common.saveText"),width:960}),[S,{getFieldsValue:N,setSchema:D}]=X({gridProps:{cols:4},showAdvancedButton:!1});async function E(e,s){o.value=s,u.value=e,B(),_()}function _(){p.value=!1,Y(()=>{o.value==="workPermit"?b(u.value.workPermitId):o.value==="riskAssessment"&&b(u.value.riskAssessmentId),p.value=!0})}function b(e){!ee(e)&&oe(e)||c.value?.setCheckedRowKeys([e])}function M(e,s){console.log("行选中",e.value,s),!(!s||!p.value)&&(T("success",e.value[0],s,o.value),d())}async function F(e,s){if(_(),o.value=="workPermit")return await K({...e,...s});if(o.value=="riskAssessment")return await W({...e,...s,status:10})}function C(){c.value?.restReload()}return l({handleOpenModal:E,setProps:P,setSchema:D}),(e,s)=>{const v=U,V=q;return Q(),J("template",null,[n(V,{ref:"modalRef",onRegister:r(x),showAction:!1},{default:k(()=>[n(v,{bordered:!1,class:"proCard","content-class":"p-0"},{default:k(()=>[n(r($),{onRegister:r(S),onSubmit:C,onReset:C},null,8,["onRegister"])]),_:1}),n(v,{bordered:!1,class:"proCard mt-2","content-class":"p-0"},{default:k(()=>[n(r(L),{ref_key:"basicTableRef",ref:c,columns:r(o)==="riskAssessment"?r(A):r(O),request:f=>F(f,r(N)()),"row-key":f=>f.id,autoScrollX:!0,actionColumn:r(j),showTableSetting:!1,"virtual-scroll":"",onCheckedRowChange:M},null,8,["columns","request","row-key","actionColumn"])]),_:1})]),_:1},8,["onRegister"])])}}});export{Ke as default};
