niucloud-admin/niucloud/public/admin/assets/notice_records-eeb1e01d.js
全栈小学生 d680214fd1 up
2025-06-11 09:21:43 +08:00

2 lines
5.5 KiB
JavaScript

import{d as H,v as K,l as L,k as a,r as N,h as c,c as f,e as o,w as n,a as h,t as d,u as r,F as T,T as F,m as w,i as x,J as O,B as E,D as S,G as I,a1 as A,bG as J,af as q,bh as Q,E as W,H as X,L as Z,a3 as ee,a4 as te,a5 as ae,M as le}from"./index-e05985b6.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-form-item-4ed993c7.js";import{A as oe,B as re}from"./notice-19cf93c4.js";import{_ as ne}from"./notice-records-info.vue_vue_type_script_setup_true_lang-15f9b1af.js";/* empty css *//* empty css */const se={class:"main-container"},ie={class:"flex justify-between items-center"},ce={class:"text-page-title"},pe={class:"mt-[10px]"},de={key:0},me={key:1},ue={key:2},_e={class:"mt-[16px] flex justify-end"},Ye=H({__name:"notice_records",setup(be){const B=K().meta.title,t=L({page:1,limit:10,total:0,loading:!0,data:[],searchParam:{key:"",receiver:"",create_time:[]}}),m=L({buyer:{label:a("buyerNotice"),list:[]},seller:{label:a("sellerNotice"),list:[]}});(async()=>{oe({}).then(s=>{m.buyer.list=[],m.seller.list=[],s.data.forEach(e=>{if(e.notice.length){const _=[],i=[];Object.keys(e.notice).forEach((g,C)=>{const p=e.notice[g];p.addon_name=e.title,p.receiver_type==1?_.push({name:p.name,value:p.key}):i.push({name:p.name,value:p.key})}),_.length&&(_.unshift({name:e.title,value:e.key,disabled:!0}),m.buyer.list=m.buyer.list.concat(_)),i.length&&(i.unshift({name:e.title,value:e.key,disabled:!0}),m.seller.list=m.seller.list.concat(i))}})}).catch(s=>{})})();const D=N(),u=(s=1)=>{t.loading=!0,t.page=s,re({page:t.page,limit:t.limit,...t.searchParam}).then(e=>{t.loading=!1,t.data=e.data.data,t.total=e.data.total}).catch(()=>{t.loading=!1})};u();const z=s=>{s&&(s.resetFields(),u())},y=N(null),U=s=>{y.value.setFormData(s),y.value.showDialog=!0};return(s,e)=>{const _=S,i=I,g=A,C=J,p=q,$=Q,v=W,j=X,P=Z,b=ee,M=te,R=ae,Y=le;return c(),f("div",se,[o(P,{class:"box-card !border-none",shadow:"never"},{default:n(()=>[h("div",ie,[h("span",ce,d(r(B)),1)]),o(P,{class:"box-card !border-none my-[10px] table-search-wrap",shadow:"never"},{default:n(()=>[o(j,{inline:!0,model:t.searchParam,ref_key:"searchFormRef",ref:D},{default:n(()=>[o(i,{label:r(a)("searchReceiver"),prop:"receiver"},{default:n(()=>[o(_,{class:"!w-[200px]",modelValue:t.searchParam.receiver,"onUpdate:modelValue":e[0]||(e[0]=l=>t.searchParam.receiver=l),modelModifiers:{trim:!0},placeholder:r(a)("receiverPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),o(i,{label:r(a)("noticeKey"),prop:"key"},{default:n(()=>[o(p,{modelValue:t.searchParam.key,"onUpdate:modelValue":e[1]||(e[1]=l=>t.searchParam.key=l),clearable:"",placeholder:r(a)("noticeKeyPlaceholder"),class:"input-width","popper-class":"notice"},{default:n(()=>[(c(!0),f(T,null,F(m,(l,V)=>(c(),w(C,{key:V,label:l.label},{default:n(()=>[(c(!0),f(T,null,F(l.list,(k,G)=>(c(),w(g,{label:k.name,value:k.value,disabled:k.disabled??!1,key:G},null,8,["label","value","disabled"]))),128))]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),o(i,{label:r(a)("createTime"),prop:"create_time"},{default:n(()=>[o($,{modelValue:t.searchParam.create_time,"onUpdate:modelValue":e[2]||(e[2]=l=>t.searchParam.create_time=l),type:"datetimerange","value-format":"YYYY-MM-DD HH:mm:ss","start-placeholder":r(a)("startDate"),"end-placeholder":r(a)("endDate")},null,8,["modelValue","start-placeholder","end-placeholder"])]),_:1},8,["label"]),o(i,null,{default:n(()=>[o(v,{type:"primary",onClick:e[3]||(e[3]=l=>u())},{default:n(()=>[x(d(r(a)("search")),1)]),_:1}),o(v,{onClick:e[4]||(e[4]=l=>z(D.value))},{default:n(()=>[x(d(r(a)("reset")),1)]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),h("div",pe,[O((c(),w(M,{data:t.data,size:"large"},{empty:n(()=>[h("span",null,d(t.loading?"":r(a)("emptyData")),1)]),default:n(()=>[o(b,{prop:"name",label:r(a)("noticeKey"),"min-width":"120"},null,8,["label"]),o(b,{prop:"notice_type",label:r(a)("noticeType"),"min-width":"120"},{default:n(({row:l})=>[l.notice_type=="sms"?(c(),f("div",de,d(r(a)("sms")),1)):E("",!0),l.notice_type=="wechat"?(c(),f("div",me,d(r(a)("wechat")),1)):E("",!0),l.notice_type=="weapp"?(c(),f("div",ue,d(r(a)("weapp")),1)):E("",!0)]),_:1},8,["label"]),o(b,{prop:"nickname",label:r(a)("nickname"),"min-width":"120"},null,8,["label"]),o(b,{prop:"receiver",label:r(a)("receiver"),"min-width":"120"},null,8,["label"]),o(b,{prop:"create_time",label:r(a)("createTime"),"min-width":"140"},null,8,["label"]),o(b,{label:r(a)("operation"),align:"right",fixed:"right",width:"100"},{default:n(({row:l})=>[o(v,{type:"primary",link:"",onClick:V=>U(l)},{default:n(()=>[x(d(r(a)("info")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data"])),[[Y,t.loading]]),h("div",_e,[o(R,{"current-page":t.page,"onUpdate:current-page":e[5]||(e[5]=l=>t.page=l),"page-size":t.limit,"onUpdate:page-size":e[6]||(e[6]=l=>t.limit=l),layout:"total, sizes, prev, pager, next, jumper",total:t.total,onSizeChange:e[7]||(e[7]=l=>u()),onCurrentChange:u},null,8,["current-page","page-size","total"])])]),o(ne,{ref_key:"recordsDialog",ref:y,onComplete:u},null,512)]),_:1})])}}});export{Ye as default};