mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2026-01-18 09:38:09 +00:00
2 lines
5.5 KiB
JavaScript
2 lines
5.5 KiB
JavaScript
import{d as M,v as S,l as F,k as a,r as L,h as c,c as f,e as o,w as n,a as h,t as d,u as r,F as N,O as T,m as w,i as E,J as G,B as x,D as I,G as J,_ as q,bE as A,ac as Q,bf as W,E as X,H as Z,K as ee,$ as te,a0 as ae,a1 as le,L as oe}from"./index-785a2eda.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{c as z}from"./notice-0492bc40.js";import{_ as re}from"./notice-records-info.vue_vue_type_script_setup_true_lang-081b9414.js";/* empty css *//* empty css */const ne={class:"main-container"},ie={class:"flex justify-between items-center"},se={class:"text-page-title"},ce={class:"mt-[10px]"},pe={key:0},de={key:1},me={key:2},ue={class:"mt-[16px] flex justify-end"},Oe=M({__name:"notice_records",setup(_e){const B=S().meta.title,t=F({page:1,limit:10,total:0,loading:!0,data:[],searchParam:{key:"",receiver:"",create_time:[]}}),m=F({buyer:{label:a("buyerNotice"),list:[]},seller:{label:a("sellerNotice"),list:[]}});(async()=>{z({}).then(i=>{m.buyer.list=[],m.seller.list=[],i.data.forEach(e=>{if(e.notice.length){const _=[],s=[];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}):s.push({name:p.name,value:p.key})}),_.length&&(_.unshift({name:e.title,value:e.key,disabled:!0}),m.buyer.list=m.buyer.list.concat(_)),s.length&&(s.unshift({name:e.title,value:e.key,disabled:!0}),m.seller.list=m.seller.list.concat(s))}})}).catch(i=>{})})();const D=L(),u=(i=1)=>{t.loading=!0,t.page=i,z({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 $=i=>{i&&(i.resetFields(),u())},y=L(null),U=i=>{y.value.setFormData(i),y.value.showDialog=!0};return(i,e)=>{const _=I,s=J,g=q,C=A,p=Q,j=W,v=X,K=Z,P=ee,b=te,O=ae,R=le,Y=oe;return c(),f("div",ne,[o(P,{class:"box-card !border-none",shadow:"never"},{default:n(()=>[h("div",ie,[h("span",se,d(r(B)),1)]),o(P,{class:"box-card !border-none my-[10px] table-search-wrap",shadow:"never"},{default:n(()=>[o(K,{inline:!0,model:t.searchParam,ref_key:"searchFormRef",ref:D},{default:n(()=>[o(s,{label:r(a)("searchReceiver"),prop:"receiver"},{default:n(()=>[o(_,{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(s,{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(N,null,T(m,(l,V)=>(c(),w(C,{key:V,label:l.label},{default:n(()=>[(c(!0),f(N,null,T(l.list,(k,H)=>(c(),w(g,{label:k.name,value:k.value,disabled:k.disabled??!1,key:H},null,8,["label","value","disabled"]))),128))]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),o(s,{label:r(a)("createTime"),prop:"create_time"},{default:n(()=>[o(j,{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(s,null,{default:n(()=>[o(v,{type:"primary",onClick:e[3]||(e[3]=l=>u())},{default:n(()=>[E(d(r(a)("search")),1)]),_:1}),o(v,{onClick:e[4]||(e[4]=l=>$(D.value))},{default:n(()=>[E(d(r(a)("reset")),1)]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),h("div",ce,[G((c(),w(O,{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",pe,d(r(a)("sms")),1)):x("",!0),l.notice_type=="wechat"?(c(),f("div",de,d(r(a)("wechat")),1)):x("",!0),l.notice_type=="weapp"?(c(),f("div",me,d(r(a)("weapp")),1)):x("",!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(()=>[E(d(r(a)("info")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data"])),[[Y,t.loading]]),h("div",ue,[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(re,{ref_key:"recordsDialog",ref:y,onComplete:u},null,512)]),_:1})])}}});export{Oe as default};
|