2 lines
3.8 KiB
JavaScript
2 lines
3.8 KiB
JavaScript
import{_ as e}from"./index.1758193456747cFSKyg_j.js";import{b2 as a,r as t,bt as o,ag as l,o as r,c as n,e as p,N as s,w as i,an as c,O as d,t as u,g,aY as m,aO as b}from"./index.1758193456747CyhEUdoH.js";import h from"./robot-group-send.1758193456747DzkoEX5z.js";import{s as _}from"./payee-configure.1758193456747DRy-HeRE.js";import v from"./content.1758193456747U9hCIGDa.js";import{r as y}from"./payee-count.1758193456747D6fvcAXj.js";/* empty css */import"./el-col.1758193456747BQedCmvQ.js";const w=a({__name:"robot-send",setup(a){const w=t(!1),f=t("");o({legacy:!0});const j=l({columns:[{prop:"telegram_group",label:"群编码",align:"center",width:120},{prop:"telegram_group_name",label:"群名称",align:"center",width:120},{prop:"send_user",label:"发送人ID",align:"center",width:120},{prop:"image",label:"图片ID",align:"center",width:120},{prop:"content",label:"内容",align:"center",slot:"content_slot",width:120},{prop:"type",label:"类型",align:"center",formatter:e=>1==e?"商户":"供应商",width:120},{prop:"status",label:"是否发送",align:"center",formatter:e=>{let a="";switch(e){case 1:a="未发送";break;case 2:a="成功";break;case 3:a="失败";break;default:a=""}return a}},{prop:"send_type",label:"来源",align:"center",formatter:e=>1==e?"机器人发送":"后台发送"},{prop:"admin_id",label:"管理员ID",align:"center"},{prop:"create_time",label:"创建时间",align:"center"},{prop:"succ_time",label:"发送时间",align:"center"},{prop:"operate",label:"操作",align:"center",slot:"operate_slot"}],tableData:[],searchFields:[{prop:"create_time",label:"异动时间",type:"date",dateType:"datetimerange",value:[]},{label:"状态",type:"select",prop:"status",options:[{label:"未发送",value:1,type:"primary"},{label:"成功",value:2,type:"success"},{label:"失败",value:3,type:"danger"}],value:""},{label:"类型",type:"select",prop:"type",options:[{label:"商户",value:1,type:"primary"},{label:"供应商",value:2,type:"success"}],value:""}],total:0,page:1,per_page:50,loading:!1,showRobotGroupSend:!1}),C=()=>{j.searchFields.forEach(e=>{"datetimerange"==e.dateType?e.value=[]:e.value=""}),D()};r(()=>{D()});const D=()=>{j.loading=!0;let e={limit:j.per_page,page:j.page},a=(e=>{const a={};return e.forEach(e=>{e.prop&&void 0!==e.value&&(a[e.prop]=e.value)}),a})(j.searchFields);_(Object.assign(e,a)).then(e=>{j.tableData=e.data,j.total=e.total,j.loading=!1}).catch(()=>{j.loading=!1})};return(a,t)=>{const o=c,l=e;return p(),n("div",null,[s(l,{type:"export",columns:g(j).columns,searchFields:g(j).searchFields,"onUpdate:searchFields":t[0]||(t[0]=e=>g(j).searchFields=e),data:g(j).tableData,per_page:g(j).per_page,"onUpdate:per_page":t[1]||(t[1]=e=>g(j).per_page=e),page:g(j).page,"onUpdate:page":t[2]||(t[2]=e=>g(j).page=e),total:g(j).total,onGetTableData:D,onResetForm:C,loading:g(j).loading,showSelection:!1,showRightRefreshSlot:!1},{content_slot:i(({row:e})=>[s(o,{link:"",type:"primary",size:"small",onClick:a=>{return t=e.content,f.value=t,void(w.value=!0);var t}},{default:i(()=>t[6]||(t[6]=[d(" 查看 ")])),_:2,__:[6]},1032,["onClick"])]),operate_slot:i(({row:e})=>[s(o,{type:"primary",size:"small",onClick:a=>(e=>{let a={id:e.id,type:0};y(a).then(e=>{b.success("操作成功"),D()})})(e)},{default:i(()=>[d(u(2==e.send_status?"重新发送":"发送通知"),1)]),_:2},1032,["onClick"])]),_:1},8,["columns","searchFields","data","per_page","page","total","loading"]),s(h,{showRobotGroupSend:g(j).showRobotGroupSend,"onUpdate:showRobotGroupSend":t[3]||(t[3]=e=>g(j).showRobotGroupSend=e)},null,8,["showRobotGroupSend"]),s(v,{viewContentDialog:g(w),"onUpdate:viewContentDialog":t[4]||(t[4]=e=>m(w)?w.value=e:null),currentContent:g(f),"onUpdate:currentContent":t[5]||(t[5]=e=>m(f)?f.value=e:null)},null,8,["viewContentDialog","currentContent"])])}}},[["__scopeId","data-v-3507dfa1"]]);export{w as default};
|