index-90aba4f7.js 3.2 KB

1
  1. import{d as U,z as j,r as _,f as B,Q as G,o as s,c as H,i as t,w as o,a as l,B as m,j as d,m as y,F as J,G as K,_ as M,q as Q,H as D,I as E,J as W,K as A}from"./index-03f5d926.js";import{_ as L}from"./index.vue_vue_type_script_setup_true_lang-e704331b.js";import{_ as O}from"./ContentWrap.vue_vue_type_script_setup_true_lang-48ba01fb.js";import{d as V}from"./formatTime-f911d219.js";import{a as X,d as Y,s as Z}from"./index-529e9019.js";import{_ as $}from"./TagForm.vue_vue_type_script_setup_true_lang-b685b7e5.js";import{_ as aa}from"./main.vue_vue_type_script_setup_true_lang-7fbdde43.js";import{u as ta}from"./useMessage-2e335eca.js";import"./index-662200b7.js";import"./el-card-0ac51a7f.js";import"./Dialog-05c67d4e.js";import"./_plugin-vue_export-helper-1b428a4d.js";import"./index-d8609f66.js";const ea=U({name:"MpTag",__name:"index",setup(la){const u=ta(),{t:v}=j(),b=_(!0),w=_(0),k=_([]),e=B({pageNo:1,pageSize:10,accountId:-1}),C=_(null),z=i=>{e.accountId=i,e.pageNo=1,r()},r=async()=>{try{b.value=!0;const i=await X(e);k.value=i.list,w.value=i.total}finally{b.value=!1}},I=(i,a)=>{var p;(p=C.value)==null||p.open(i,e.accountId,a)},N=async()=>{try{await u.confirm("\u662F\u5426\u786E\u8BA4\u540C\u6B65\u6807\u7B7E\uFF1F"),await Z(e.accountId),u.success("\u540C\u6B65\u6807\u7B7E\u6210\u529F"),await r()}catch{}};return(i,a)=>{const p=K,h=M,f=Q,S=D,x=O,c=E,q=W,F=L,g=G("hasPermi"),P=A;return s(),H(J,null,[t(x,null,{default:o(()=>[t(S,{class:"-mb-15px",model:l(e),ref:"queryFormRef",inline:!0,"label-width":"68px"},{default:o(()=>[t(p,{label:"\u516C\u4F17\u53F7",prop:"accountId"},{default:o(()=>[t(l(aa),{onChange:z})]),_:1}),t(p,null,{default:o(()=>[m((s(),d(f,{type:"primary",plain:"",onClick:a[0]||(a[0]=n=>I("create")),disabled:l(e).accountId===0},{default:o(()=>[t(h,{icon:"ep:plus",class:"mr-5px"}),a[3]||(a[3]=y(" \u65B0\u589E "))]),_:1},8,["disabled"])),[[g,["mp:tag:create"]]]),m((s(),d(f,{type:"success",plain:"",onClick:N,disabled:l(e).accountId===0},{default:o(()=>[t(h,{icon:"ep:refresh",class:"mr-5px"}),a[4]||(a[4]=y(" \u540C\u6B65 "))]),_:1},8,["disabled"])),[[g,["mp:tag:sync"]]])]),_:1})]),_:1},8,["model"])]),_:1}),t(x,null,{default:o(()=>[m((s(),d(q,{data:l(k)},{default:o(()=>[t(c,{label:"\u7F16\u53F7",align:"center",prop:"id"}),t(c,{label:"\u6807\u7B7E\u540D\u79F0",align:"center",prop:"name"}),t(c,{label:"\u7C89\u4E1D\u6570",align:"center",prop:"count"}),t(c,{label:"\u521B\u5EFA\u65F6\u95F4",align:"center",prop:"createTime",width:"180",formatter:l(V)},null,8,["formatter"]),t(c,{label:"\u64CD\u4F5C",align:"center"},{default:o(n=>[m((s(),d(f,{link:"",type:"primary",onClick:R=>I("update",n.row.id)},{default:o(()=>a[5]||(a[5]=[y(" \u4FEE\u6539 ")])),_:2},1032,["onClick"])),[[g,["mp:tag:update"]]]),m((s(),d(f,{link:"",type:"danger",onClick:R=>(async T=>{try{await u.delConfirm(),await Y(T),u.success(v("common.delSuccess")),await r()}catch{}})(n.row.id)},{default:o(()=>a[6]||(a[6]=[y(" \u5220\u9664 ")])),_:2},1032,["onClick"])),[[g,["mp:tag:delete"]]])]),_:1})]),_:1},8,["data"])),[[P,l(b)]]),t(F,{total:l(w),page:l(e).pageNo,"onUpdate:page":a[1]||(a[1]=n=>l(e).pageNo=n),limit:l(e).pageSize,"onUpdate:limit":a[2]||(a[2]=n=>l(e).pageSize=n),onPagination:r},null,8,["total","page","limit"])]),_:1}),t($,{ref_key:"formRef",ref:C,onSuccess:r},null,512)],64)}}});export{ea as default};