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