WxCardDrawer-s0zNincR.js 5.0 KB

1
  1. var _=Object.defineProperty;var m=Object.getOwnPropertySymbols;var q=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable;var x=(a,t,r)=>t in a?_(a,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[t]=r,f=(a,t)=>{for(var r in t||(t={}))q.call(t,r)&&x(a,r,t[r]);if(m)for(var r of m(t))B.call(t,r)&&x(a,r,t[r]);return a};var h=(a,t,r)=>new Promise((s,i)=>{var w=o=>{try{d(r.next(o))}catch(c){i(c)}},l=o=>{try{d(r.throw(o))}catch(c){i(c)}},d=o=>o.done?s(o.value):Promise.resolve(o.value).then(w,l);d((r=r.apply(a,t)).next())});import{B as M,u as v}from"./useForm-pwHPrILC.js";import{b as y,aq as D,a as p,v as A,_ as W}from"./entry/index-DJx93RYF-1731481145019.js";import{B as F,a as P}from"./index-CzIUqxsa.js";import{d as S,f as T,c as U,u,a9 as I,_ as $,a6 as k,a7 as R,k as K,aa as L}from"./vue-B5pbXMv7.js";const{t:e}=y(),Z=[{title:e("wechat.wxCard.userId"),dataIndex:"userId",width:100},{title:e("wechat.wxCard.wxUserId"),dataIndex:"wxUserId",width:100},{title:e("wechat.wxCard.avatar"),dataIndex:"avatar",width:100},{title:e("wechat.wxCard.logo"),dataIndex:"logo",width:100},{title:e("wechat.wxCard.name"),dataIndex:"name",width:100},{title:e("wechat.wxCard.company"),dataIndex:"company",width:100},{title:e("wechat.wxCard.address"),dataIndex:"address",width:100},{title:e("wechat.wxCard.phone"),dataIndex:"phone",width:100},{title:e("wechat.wxCard.officialAccount"),dataIndex:"officialAccount",width:100},{title:e("wechat.wxCard.wechatAccount"),dataIndex:"wechatAccount",width:100},{title:e("wechat.wxCard.email"),dataIndex:"email",width:100},{title:e("wechat.wxCard.apiBase"),dataIndex:"apiBase",width:100},{title:e("wechat.wxCard.apiKey"),dataIndex:"apiKey",width:100},{title:e("wechat.wxCard.aiInfo"),dataIndex:"aiInfo",width:100},{title:e("wechat.wxCard.intro"),dataIndex:"intro",width:100},{title:e("common.createTime"),dataIndex:"createdAt",width:70,customRender:({record:a})=>D(a.createdAt)}],ee=[{field:"avatar",label:e("wechat.wxCard.avatar"),component:"Input",colProps:{span:8}},{field:"logo",label:e("wechat.wxCard.logo"),component:"Input",colProps:{span:8}},{field:"name",label:e("wechat.wxCard.name"),component:"Input",colProps:{span:8}}],N=[{field:"id",label:"ID",component:"Input",show:!1},{field:"userId",label:e("wechat.wxCard.userId"),component:"InputNumber",required:!0},{field:"wxUserId",label:e("wechat.wxCard.wxUserId"),component:"InputNumber",required:!0},{field:"avatar",label:e("wechat.wxCard.avatar"),component:"Input",required:!0},{field:"logo",label:e("wechat.wxCard.logo"),component:"Input",required:!0},{field:"name",label:e("wechat.wxCard.name"),component:"Input",required:!0},{field:"company",label:e("wechat.wxCard.company"),component:"Input",required:!0},{field:"address",label:e("wechat.wxCard.address"),component:"Input",required:!0},{field:"phone",label:e("wechat.wxCard.phone"),component:"Input",required:!0},{field:"officialAccount",label:e("wechat.wxCard.officialAccount"),component:"Input",required:!0},{field:"wechatAccount",label:e("wechat.wxCard.wechatAccount"),component:"Input",required:!0},{field:"email",label:e("wechat.wxCard.email"),component:"Input",required:!0},{field:"apiBase",label:e("wechat.wxCard.apiBase"),component:"Input",required:!0},{field:"apiKey",label:e("wechat.wxCard.apiKey"),component:"Input",required:!0},{field:"aiInfo",label:e("wechat.wxCard.aiInfo"),component:"Input",required:!0},{field:"intro",label:e("wechat.wxCard.intro"),component:"Input",required:!0}],ae=(a,t="notice")=>p.post({url:"/wechat-api/wx_card/list",params:a},{errorMessageMode:t}),O=(a,t="notice")=>p.post({url:"/wechat-api/wx_card/create",params:a},{errorMessageMode:t,successMessageMode:t}),j=(a,t="notice")=>p.post({url:"/wechat-api/wx_card/update",params:a},{errorMessageMode:t,successMessageMode:t}),te=(a,t="notice")=>p.post({url:"/wechat-api/wx_card/delete",params:a},{errorMessageMode:t,successMessageMode:t}),V=S({name:"WxCardDrawer",components:{BasicDrawer:F,BasicForm:M},emits:["success","register"],setup(a,{emit:t}){const r=T(!0),{t:s}=A.useI18n(),[i,{resetFields:w,setFieldsValue:l,validate:d}]=v({labelWidth:160,baseColProps:{span:24},layout:"vertical",schemas:N,showActionButtonGroup:!1}),[o,{setDrawerProps:c,closeDrawer:C}]=P(n=>h(this,null,function*(){w(),c({confirmLoading:!1}),r.value=!!(n!=null&&n.isUpdate),u(r)&&l(f({},n.record))})),g=U(()=>u(r)?s("wechat.wxCard.editWxCard"):s("wechat.wxCard.addWxCard"));function b(){return h(this,null,function*(){const n=yield d();c({confirmLoading:!0}),n.id=u(r)?Number(n.id):0,(u(r)?yield j(n):yield O(n)).code===0&&(C(),t("success")),c({confirmLoading:!1})})}return{registerDrawer:o,registerForm:i,getTitle:g,handleSubmit:b}}});function z(a,t,r,s,i,w){const l=I("BasicForm"),d=I("BasicDrawer");return $(),k(d,L(a.$attrs,{onRegister:a.registerDrawer,showFooter:"",title:a.getTitle,width:"35%",onOk:a.handleSubmit}),{default:R(()=>[K(l,{onRegister:a.registerForm},null,8,["onRegister"])]),_:1},16,["onRegister","title","onOk"])}const G=W(V,[["render",z]]),re=Object.freeze(Object.defineProperty({__proto__:null,default:G},Symbol.toStringTag,{value:"Module"}));export{G as W,re as a,Z as c,te as d,ae as g,ee as s};