import{d as Z,Q as $,J as j,r as u,A as D,b as E,a1 as G,o as n,c as M,k as e,B as t,a as l,a2 as O,F as T,i as H,a3 as I,N as z,g as d,O as m,P as f,a7 as L,S as ee,$ as ae,R as le,U as te,V as oe,W as se,X as re,Y as ne,Z as pe}from"./index-BP6bNRoi.js";import{_ as ie}from"./index.vue_vue_type_script_setup_true_lang-sJUY8qtC.js";import{_ as ue}from"./DictTag.vue_vue_type_script_lang-DwXPHgid.js";import{_ as de}from"./ContentWrap.vue_vue_type_script_setup_true_lang-CR_2gECF.js";import{d as me}from"./formatTime-DwR9f7DP.js";import{d as ce}from"./download-e0EdwhTv.js";import{b as fe,d as ye,e as _e}from"./index-DkNlrmPs.js";import{_ as ge}from"./PostForm.vue_vue_type_script_setup_true_lang-0UdXDls6.js";import"./index-BZESAUPP.js";import"./color-DXkOL5Tu.js";import"./el-card-bU92WWV4.js";import"./Dialog.vue_vue_type_style_index_0_lang-DFckl8Er.js";import"./constants-CuOBQ73z.js";const be=Z({name:"SystemPost",__name:"index",setup(ke){const k=$(),{t:P}=j(),v=u(!0),x=u(0),C=u([]),o=D({pageNo:1,pageSize:10,code:"",name:"",status:void 0}),S=u(),w=u(!1),c=async()=>{v.value=!0;try{const p=await fe(o);C.value=p.list,x.value=p.total}finally{v.value=!1}},y=()=>{o.pageNo=1,c()},R=()=>{S.value.resetFields(),y()},h=u(),V=(p,s)=>{h.value.open(p,s)},A=async()=>{try{await k.exportConfirm(),w.value=!0;const p=await _e(o);ce.excel(p,"\u5C97\u4F4D\u5217\u8868.xls")}catch{}finally{w.value=!1}};return E(()=>{c()}),(p,s)=>{const U=L,_=ee,F=ae,K=le,g=te,i=oe,q=se,N=de,r=re,B=ue,J=ne,Q=ie,b=G("hasPermi"),W=pe;return n(),M(T,null,[e(N,null,{default:t(()=>[e(q,{class:"-mb-15px",model:l(o),ref_key:"queryFormRef",ref:S,inline:!0,"label-width":"68px"},{default:t(()=>[e(_,{label:"\u5C97\u4F4D\u540D\u79F0",prop:"name"},{default:t(()=>[e(U,{modelValue:l(o).name,"onUpdate:modelValue":s[0]||(s[0]=a=>l(o).name=a),placeholder:"\u8BF7\u8F93\u5165\u5C97\u4F4D\u540D\u79F0",clearable:"",onKeyup:O(y,["enter"])},null,8,["modelValue"])]),_:1}),e(_,{label:"\u5C97\u4F4D\u7F16\u7801",prop:"code"},{default:t(()=>[e(U,{modelValue:l(o).code,"onUpdate:modelValue":s[1]||(s[1]=a=>l(o).code=a),placeholder:"\u8BF7\u8F93\u5165\u5C97\u4F4D\u7F16\u7801",clearable:"",onKeyup:O(y,["enter"])},null,8,["modelValue"])]),_:1}),e(_,{label:"\u72B6\u6001",prop:"status"},{default:t(()=>[e(K,{modelValue:l(o).status,"onUpdate:modelValue":s[2]||(s[2]=a=>l(o).status=a),placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001",clearable:""},{default:t(()=>[(n(!0),M(T,null,H(l(I)(l(z).COMMON_STATUS),a=>(n(),d(F,{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(_,null,{default:t(()=>[e(i,{onClick:y},{default:t(()=>[e(g,{icon:"ep:search",class:"mr-5px"}),m(" \u641C\u7D22")]),_:1}),e(i,{onClick:R},{default:t(()=>[e(g,{icon:"ep:refresh",class:"mr-5px"}),m(" \u91CD\u7F6E")]),_:1}),f((n(),d(i,{type:"primary",plain:"",onClick:s[3]||(s[3]=a=>V("create"))},{default:t(()=>[e(g,{icon:"ep:plus",class:"mr-5px"}),m(" \u65B0\u589E ")]),_:1})),[[b,["system:post:create"]]]),f((n(),d(i,{type:"success",plain:"",onClick:A,loading:l(w)},{default:t(()=>[e(g,{icon:"ep:download",class:"mr-5px"}),m(" \u5BFC\u51FA ")]),_:1},8,["loading"])),[[b,["system:post:export"]]])]),_:1})]),_:1},8,["model"])]),_:1}),e(N,null,{default:t(()=>[f((n(),d(J,{data:l(C)},{default:t(()=>[e(r,{label:"\u5C97\u4F4D\u7F16\u53F7",align:"center",prop:"id"}),e(r,{label:"\u5C97\u4F4D\u540D\u79F0",align:"center",prop:"name"}),e(r,{label:"\u5C97\u4F4D\u7F16\u7801",align:"center",prop:"code"}),e(r,{label:"\u5C97\u4F4D\u987A\u5E8F",align:"center",prop:"sort"}),e(r,{label:"\u5C97\u4F4D\u5907\u6CE8",align:"center",prop:"remark"}),e(r,{label:"\u72B6\u6001",align:"center",prop:"status"},{default:t(a=>[e(B,{type:l(z).COMMON_STATUS,value:a.row.status},null,8,["type","value"])]),_:1}),e(r,{label:"\u521B\u5EFA\u65F6\u95F4",align:"center",prop:"createTime",width:"180",formatter:l(me)},null,8,["formatter"]),e(r,{label:"\u64CD\u4F5C",align:"center"},{default:t(a=>[f((n(),d(i,{link:"",type:"primary",onClick:X=>V("update",a.row.id)},{default:t(()=>[m(" \u7F16\u8F91 ")]),_:2},1032,["onClick"])),[[b,["system:post:update"]]]),f((n(),d(i,{link:"",type:"danger",onClick:X=>(async Y=>{try{await k.delConfirm(),await ye(Y),k.success(P("common.delSuccess")),await c()}catch{}})(a.row.id)},{default:t(()=>[m(" \u5220\u9664 ")]),_:2},1032,["onClick"])),[[b,["system:post:delete"]]])]),_:1})]),_:1},8,["data"])),[[W,l(v)]]),e(Q,{total:l(x),page:l(o).pageNo,"onUpdate:page":s[4]||(s[4]=a=>l(o).pageNo=a),limit:l(o).pageSize,"onUpdate:limit":s[5]||(s[5]=a=>l(o).pageSize=a),onPagination:c},null,8,["total","page","limit"])]),_:1}),e(ge,{ref_key:"formRef",ref:h,onSuccess:c},null,512)],64)}}});export{be as default};
|