import{d as R,b as F,r as s,p as N,c as n,e as O,f as P,g as u,h as a,i as l,t as y,u as o,aO as V,F as q,m as g,E as L,R as $,S as M,_ as W}from"./index.0308b213.js";import{b as G,c as H}from"./vehicle.ca594789.js";const D=m=>($("data-v-9fd7d157"),m=m(),M(),m),J={class:"data"},K=g("\u65B0\u589E\u8F66\u8F86\u7C7B\u578B"),Q={class:"table"},X=g("\u7F16\u8F91"),Y={class:"pagination"},Z={class:"entry-card-detail"},ee={class:"detail-content"},te={class:"detail-section"},ae=D(()=>u("div",{class:"section-title"},"\u8F66\u8F86\u7C7B\u578B\u4FE1\u606F",-1)),le={class:"section-content"},ue={class:"info-item"},oe=D(()=>u("span",{class:"label"},"\u7C7B\u578B\u540D\u79F0\uFF1A",-1)),se={class:"value"},ne=g("\u53D6\u6D88"),ie=g("\u4FDD\u5B58"),de=R({setup(m){const i=F({page_size:10,page:1}),w=F({id:2,type_name:"\u8212\u9002\u578B",create_time:0,update_time:0}),f=F({list:[],count:0});let x=s([]);s([]),s([]);const h=()=>{G(i).then(d=>{x.value=[],f.list=d.list,f.count=d.total})},B=s(!1);h(),N(()=>[i.page,i.page_size],()=>{h()});const p=s({id:0,type_name:"",create_time:0,update_time:0}),c=s(!1),_=s(!1);s("+60");const T=F({type_name:[{required:!0,message:"\u8BF7\u8F93\u5165\u7C7B\u578B\u540D\u79F0",trigger:"blur"}]}),b=s();function E(){c.value=!1,Object.assign(p.value,{id:0,type_name:"",create_time:0,update_time:0}),_.value=!0}function z(d){c.value=!0,Object.assign(p.value,{...d}),_.value=!0}function k(){b.value.validate(d=>{if(!d)return;const t={...p.value};c.value||delete t.id,H(t.id,t.type_name).then(()=>{L.success(c.value?"\u7F16\u8F91\u6210\u529F":"\u65B0\u589E\u6210\u529F"),_.value=!1,h()})})}return(d,t)=>{const v=n("el-button"),r=n("el-table-column"),S=n("el-table"),I=n("el-pagination"),C=n("el-dialog"),U=n("el-input"),j=n("el-form-item"),A=n("el-form");return O(),P(q,null,[u("div",J,[a(v,{type:"primary",onClick:E,style:{"margin-bottom":"16px"}},{default:l(()=>[K]),_:1}),u("div",Q,[a(S,{data:o(f).list},{default:l(()=>[a(r,{label:"\u7C7B\u578BID",prop:"id",width:"120px"}),a(r,{label:"\u7C7B\u578B\u540D\u79F0",width:"350px"},{default:l(e=>[u("span",null,y(e.row.type_name),1)]),_:1}),a(r,{label:"\u521B\u5EFA\u65F6\u95F4",width:"160px"},{default:l(e=>[u("span",null,y(e.row.create_time?o(V)(e.row.create_time):"-"),1)]),_:1}),a(r,{label:"\u66F4\u65B0\u65F6\u95F4",width:"160px"},{default:l(e=>[u("span",null,y(e.row.update_time?o(V)(e.row.update_time):"-"),1)]),_:1}),a(r,{fixed:"right",label:"\u64CD\u4F5C"},{default:l(e=>[a(v,{type:"primary",size:"small",onClick:pe=>z(e.row)},{default:l(()=>[X]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])])]),u("div",Y,[a(I,{currentPage:o(i).page,"onUpdate:currentPage":t[0]||(t[0]=e=>o(i).page=e),"page-size":o(i).page_size,"onUpdate:page-size":t[1]||(t[1]=e=>o(i).page_size=e),"page-sizes":[10,20,30,40],layout:"total, sizes, prev, pager, next, jumper",total:o(f).count},null,8,["currentPage","page-size","total"])]),a(C,{modelValue:B.value,"onUpdate:modelValue":t[2]||(t[2]=e=>B.value=e),title:"\u8F66\u8F86\u7C7B\u578B\u8BE6\u60C5",width:"80%","close-on-click-modal":!1},{default:l(()=>[u("div",Z,[u("div",ee,[u("div",te,[ae,u("div",le,[u("div",ue,[oe,u("span",se,y(o(w).type_name),1)])])])])])]),_:1},8,["modelValue"]),a(C,{modelValue:_.value,"onUpdate:modelValue":t[5]||(t[5]=e=>_.value=e),title:c.value?"\u7F16\u8F91\u8F66\u8F86\u7C7B\u578B":"\u65B0\u589E\u8F66\u8F86\u7C7B\u578B"},{footer:l(()=>[a(v,{onClick:t[4]||(t[4]=e=>_.value=!1)},{default:l(()=>[ne]),_:1}),a(v,{type:"primary",onClick:k},{default:l(()=>[ie]),_:1})]),default:l(()=>[a(A,{model:p.value,rules:o(T),ref_key:"vehicleTypeFormRef",ref:b,"label-width":"100px"},{default:l(()=>[a(j,{label:"\u7C7B\u578B\u540D\u79F0",prop:"type_name"},{default:l(()=>[a(U,{modelValue:p.value.type_name,"onUpdate:modelValue":t[3]||(t[3]=e=>p.value.type_name=e)},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["modelValue","title"])],64)}}});const re=W(de,[["__scopeId","data-v-9fd7d157"]]);export{re as default};
