2 lines
3.9 KiB
JavaScript
2 lines
3.9 KiB
JavaScript
import{_ as e}from"./index.1760685172143Dni7r4WH.js";import{b3 as t,r as a,ag as o,bu as l,o as r,c as s,e as n,N as p,w as i,an as c,O as u,t as d,g,aY as m,aO as b}from"./index.1760685172143ChvXXrGI.js";import{E as _}from"./el-text.1760685172143BWHdRXwV.js";import h from"./robot-group-send.1760685172143CqihlqQv.js";import{s as y}from"./payee-configure.1760685172143DLY_hL3i.js";import v from"./content.1760685172143BxG-SgbU.js";import{r as w}from"./payee-count.1760685172143BSj-1vb_.js";/* empty css */import"./el-col.1760685172143CNfdOm1y.js";const f=t({__name:"robot-send",setup(t){const f=a(!1),j=a(""),C=o([{label:"未发送",value:1,type:"primary"},{label:"成功",value:2,type:"success"},{label:"失败",value:3,type:"danger"}]);l({legacy:!0});const D=o({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",slot:"status_slot",width:120},{prop:"send_type",label:"来源",align:"center",formatter:e=>1==e?"机器人发送":"后台发送"},{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:C,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}),F=()=>{D.searchFields.forEach(e=>{"datetimerange"==e.dateType?e.value=[]:e.value=""}),R()};r(()=>{R()});const R=()=>{D.loading=!0;let e={limit:D.per_page,page:D.page,is_bill:0},t=(e=>{const t={};return e.forEach(e=>{e.prop&&void 0!==e.value&&(t[e.prop]=e.value)}),t})(D.searchFields);y(Object.assign(e,t)).then(e=>{D.tableData=e.data,D.total=e.total,D.loading=!1}).catch(()=>{D.loading=!1})};return(t,a)=>{const o=_,l=c,r=e;return n(),s("div",null,[p(r,{type:"export",columns:g(D).columns,searchFields:g(D).searchFields,"onUpdate:searchFields":a[0]||(a[0]=e=>g(D).searchFields=e),data:g(D).tableData,per_page:g(D).per_page,"onUpdate:per_page":a[1]||(a[1]=e=>g(D).per_page=e),page:g(D).page,"onUpdate:page":a[2]||(a[2]=e=>g(D).page=e),total:g(D).total,onGetTableData:R,onResetForm:F,loading:g(D).loading,showSelection:!1,showRightRefreshSlot:!1},{status_slot:i(({row:e})=>[p(o,{type:g(C).find(t=>t.value==e.status).type},{default:i(()=>[u(d(g(C).find(t=>t.value==e.status).label),1)]),_:2},1032,["type"])]),content_slot:i(({row:e})=>[p(l,{link:"",type:"primary",size:"small",onClick:t=>{return a=e.content,j.value=a,void(f.value=!0);var a}},{default:i(()=>a[6]||(a[6]=[u(" 查看 ")])),_:2,__:[6]},1032,["onClick"])]),operate_slot:i(({row:e})=>[p(l,{type:"primary",size:"small",onClick:t=>(e=>{let t={id:e.id,type:0};w(t).then(e=>{b.success("操作成功"),R()})})(e)},{default:i(()=>[u(d(2==e.send_status?"重新发送":"发送通知"),1)]),_:2},1032,["onClick"])]),_:1},8,["columns","searchFields","data","per_page","page","total","loading"]),p(h,{showRobotGroupSend:g(D).showRobotGroupSend,"onUpdate:showRobotGroupSend":a[3]||(a[3]=e=>g(D).showRobotGroupSend=e)},null,8,["showRobotGroupSend"]),p(v,{viewContentDialog:g(f),"onUpdate:viewContentDialog":a[4]||(a[4]=e=>m(f)?f.value=e:null),currentContent:g(j),"onUpdate:currentContent":a[5]||(a[5]=e=>m(j)?j.value=e:null)},null,8,["viewContentDialog","currentContent"])])}}},[["__scopeId","data-v-c22a886c"]]);export{f as default};
|