import{C as V}from"./api.a76c2034.js";import{d as F,r as p,a as f,c as s,f as k,g as C,l as o,m as t,h as E,j as _,k as w,x as h}from"./index.3a30a18d.js";import{_ as G}from"./_plugin-vue_export-helper.cdc0426e.js";const L={class:"dialog-container"},A={class:"dialog-footer"},j=F({name:"configDialog"}),N=F({...j,emits:["refresh"],setup(O,{expose:b,emit:D}){p();const e=f({tableData:{data:[],total:0,loading:!1},configForm:{id:"",policeEventStatus:"Over",actionTaken:"",actionTendency:"",processedSuggestion:"",processedLocaleGuidance:""},dialog:{isShowDialog:!1,type:"",title:"",submitTxt:""}}),S=f({policeEventStatus:[{required:!0,message:"\u8BF7\u9009\u62E9",trigger:"blur"}]}),d=p(),x=(i,l)=>{if(i==="edit"){let a=JSON.parse(JSON.stringify(l));console.log("rowobj",a),a.policeEventStatus="Over",e.configForm=a,e.dialog.title="\u5904\u7406",e.dialog.submitTxt="\u5904 \u7406",e.dialog.type="edit"}else e.configForm=Object.assign({}),e.dialog.title="\u65B0\u589E",e.dialog.submitTxt="\u4FDD \u5B58",e.dialog.type="add";e.dialog.isShowDialog=!0},r=()=>{e.dialog.isShowDialog=!1,h(()=>{var i;(i=d.value)==null||i.resetFields()})},g=()=>{r()},T=()=>{d.value.validate(i=>{if(i)if(e.dialog.type==="edit"){let l={id:e.configForm.id,policeEventStatus:e.configForm.policeEventStatus,actionTaken:e.configForm.actionTaken,actionTendency:e.configForm.actionTendency,processedSuggestion:e.configForm.processedSuggestion,processedLocaleGuidance:e.configForm.processedLocaleGuidance};V().policeIncidentsEditApi(l).then(a=>{console.log("response\u8FD4\u56DE",a),a.status==200&&(D("refresh"),r())}).catch(a=>{console.log("erro\u9519\u8BEF",a)})}else e.configForm.policeEventStatus,e.configForm.actionTaken,e.configForm.actionTendency,e.configForm.processedSuggestion,e.configForm.processedLocaleGuidance})};return b({openDialog:x}),(i,l)=>{const a=s("el-input"),c=s("el-form-item"),u=s("el-col"),y=s("el-row"),B=s("el-form"),m=s("el-button"),v=s("el-dialog");return k(),C("div",L,[o(v,{title:e.dialog.title,modelValue:e.dialog.isShowDialog,"onUpdate:modelValue":l[4]||(l[4]=n=>e.dialog.isShowDialog=n),width:"769px","close-on-click-modal":!1,draggable:"","destroy-on-close":"",onClose:g},{footer:t(()=>[E("span",A,[o(m,{onClick:g,size:"default"},{default:t(()=>[_("\u53D6 \u6D88")]),_:1}),o(m,{type:"primary",onClick:T,size:"default"},{default:t(()=>[_(w(e.dialog.submitTxt),1)]),_:1})])]),default:t(()=>[o(B,{ref_key:"DialogFormRef",ref:d,model:e.configForm,size:"default",rules:S,"label-width":"150px"},{default:t(()=>[o(y,{gutter:35},{default:t(()=>[o(u,{xs:24,sm:24,md:24,lg:24,xl:24,class:"mb20"},{default:t(()=>[o(c,{label:"\u5DF2\u91C7\u53D6\u63AA\u65BD",prop:"actionTaken"},{default:t(()=>[o(a,{modelValue:e.configForm.actionTaken,"onUpdate:modelValue":l[0]||(l[0]=n=>e.configForm.actionTaken=n),placeholder:"\u8BF7\u8F93\u5165",clearable:""},null,8,["modelValue"])]),_:1})]),_:1}),o(u,{xs:24,sm:24,md:24,lg:24,xl:24,class:"mb20"},{default:t(()=>[o(c,{label:"\u5904\u7406\u60C5\u51B5\u53CA\u53D1\u5C55\u8D8B\u52BF",prop:"actionTendency"},{default:t(()=>[o(a,{modelValue:e.configForm.actionTendency,"onUpdate:modelValue":l[1]||(l[1]=n=>e.configForm.actionTendency=n),placeholder:"\u8BF7\u8F93\u5165",clearable:""},null,8,["modelValue"])]),_:1})]),_:1}),o(u,{xs:24,sm:24,md:24,lg:24,xl:24,class:"mb20"},{default:t(()=>[o(c,{label:"\u8FDB\u4E00\u6B65\u5904\u7F6E\u610F\u89C1",prop:"processedSuggestion"},{default:t(()=>[o(a,{modelValue:e.configForm.processedSuggestion,"onUpdate:modelValue":l[2]||(l[2]=n=>e.configForm.processedSuggestion=n),placeholder:"\u8BF7\u8F93\u5165",clearable:""},null,8,["modelValue"])]),_:1})]),_:1}),o(u,{xs:24,sm:24,md:24,lg:24,xl:24,class:"mb20"},{default:t(()=>[o(c,{label:"\u73B0\u573A\u8C03\u5EA6\u6307\u5BFC",prop:"processedLocaleGuidance"},{default:t(()=>[o(a,{modelValue:e.configForm.processedLocaleGuidance,"onUpdate:modelValue":l[3]||(l[3]=n=>e.configForm.processedLocaleGuidance=n),placeholder:"\u8BF7\u8F93\u5165",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title","modelValue"])])}}});const J=G(N,[["__scopeId","data-v-c636914c"]]);export{J as default};
