智慧教务系统 PHP-NiuCloud框架开发
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1 lines
15 KiB

import{au as F,d as ee,f as te,r as C,l as k,N as ae,h as w,c as E,e as t,w as s,a,t as p,u as o,k as n,i as j,F as se,O as oe,m as S,J as ne,z as le,B as ie,bg as ce,G as re,E as de,H as pe,T as ue,ax as me,bp as _e,K as fe,D as he,bb as xe,_ as ge,ac as ve,C as be,$ as ye,a0 as we,a1 as De,L as Te,p as Ce,g as ke}from"./index-208710d8.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 *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-form-item-4ed993c7.js";/* empty css */import{_ as R}from"./goods_default-664bb559.js";import{i as Ee}from"./index-d2519496.js";import{g as Fe}from"./goods-cf5aa89c.js";import{_ as Ve}from"./_plugin-vue_export-helper-c27b6911.js";function Ne(m){return F.get("shop/goods/statistics/basic",{params:m})}function Pe(m){return F.get("shop/goods/statistics/trend",{params:m})}function je(){return F.get("shop/goods/statistics/type")}function Se(m){return F.get("shop/goods/statistics/rank",{params:m})}const h=m=>(Ce("data-v-e76c6a1c"),m=m(),ke(),m),ze={class:"main-container"},Me={class:"flex justify-between items-start"},Ye={class:"text-lg font-extrabold mr-[10px]"},Ae={class:"flex items-center"},Ie={class:"flex flex-wrap"},Le={class:"w-[25%] flex flex-shrink-0 mb-[30px]"},Re=h(()=>a("div",{class:"w-[32px] h-[32px] bg-[#1890ff] rounded-full flex justify-center items-center mr-[15px]"},[a("span",{class:"nc-iconfont nc-icon-a-Group840V6xx text-[#fff]"})],-1)),Ge={class:"flex items-center"},Be={class:"mr-[5px] text-[14px]"},Ue={class:"w-[25%] flex flex-shrink-0 mb-[30px]"},$e=h(()=>a("div",{class:"w-[32px] h-[32px] bg-[#00c050] rounded-full flex justify-center items-center mr-[15px]"},[a("span",{class:"nc-iconfont nc-icon-a-zuji34 text-[#fff]"})],-1)),Oe={class:"flex items-center"},qe={class:"mr-[5px] text-[14px]"},Qe={class:"w-[25%] flex flex-shrink-0 mb-[30px]"},He=h(()=>a("div",{class:"w-[32px] h-[32px] bg-[#ffab2b] rounded-full flex justify-center items-center mr-[15px]"},[a("span",{class:"nc-iconfont nc-icon-gouwucheV6xx-11 text-[#fff]"})],-1)),Je={class:"flex items-center"},Ke={class:"mr-[5px] text-[14px]"},We={class:"w-[25%] flex flex-shrink-0 mb-[30px]"},Xe=h(()=>a("div",{class:"w-[32px] h-[32px] bg-[#b37feb] rounded-full flex justify-center items-center mr-[15px]"},[a("span",{class:"nc-iconfont nc-icon-xiadanjianshu text-[#fff]"})],-1)),Ze={class:"flex items-center"},et={class:"mr-[5px] text-[14px]"},tt={class:"w-[25%] flex flex-shrink-0 mb-[30px]"},at=h(()=>a("div",{class:"w-[32px] h-[32px] bg-[#627DFE] rounded-full flex justify-center items-center mr-[15px]"},[a("span",{class:"nc-iconfont nc-icon-zhifujianshu text-[#fff]"})],-1)),st={class:"flex items-center"},ot={class:"mr-[5px] text-[14px]"},nt={class:"w-[25%] flex flex-shrink-0"},lt=h(()=>a("div",{class:"w-[32px] h-[32px] bg-[#F76A6C] rounded-full flex justify-center items-center mr-[15px]"},[a("span",{class:"nc-iconfont nc-icon-zhifujine text-[#fff]"})],-1)),it={class:"flex items-center"},ct={class:"mr-[5px] text-[14px]"},rt={class:"w-[25%] flex flex-shrink-0"},dt=h(()=>a("div",{class:"w-[32px] h-[32px] bg-[#43C5FF] rounded-full flex justify-center items-center mr-[15px]"},[a("span",{class:"nc-iconfont nc-icon-tuikuanjine text-[#fff]"})],-1)),pt={class:"flex items-center"},ut={class:"mr-[5px] text-[14px]"},mt={class:"w-[25%] flex flex-shrink-0"},_t=h(()=>a("div",{class:"w-[32px] h-[32px] bg-[#11D0EA] rounded-full flex justify-center items-center mr-[15px]"},[a("span",{class:"nc-iconfont nc-icon-tuikuanjianshu text-[#fff]"})],-1)),ft={class:"flex items-center"},ht={class:"mr-[5px] text-[14px]"},xt={class:"bg-[white] mt-[20px]"},gt={class:"text-lg font-extrabold mb-[20px]"},vt=["onClick"],bt={class:"min-w-[70px] h-[70px] flex items-center justify-center"},yt=h(()=>a("div",{class:"image-slot"},[a("img",{class:"w-[70px] h-[70px]",src:R})],-1)),wt={key:1,class:"w-[70px] h-[70px]",src:R,fit:"contain"},Dt={class:"ml-2 flex flex-col items-start"},Tt=["title"],Ct={key:0,class:"px-[4px] text-[12px] text-[#fff] rounded-[4px] bg-primary leading-[18px]"},kt={class:"mt-[16px] flex justify-end"},Et=ee({__name:"goods",setup(m){const G=te(),B=()=>{const l=new Date,e=new Date;e.setTime(e.getTime()-3600*1e3*24*29);const i=d=>{const u=d.getFullYear(),y=d.getMonth()+1,_=d.getDate();return u+"/"+y+"/"+_};return[i(e),i(l)]},T=C([]);T.value=B();const z=[{text:"今天",value:new Date},{text:"昨天",value:()=>{const l=new Date,e=new Date;return e.setTime(e.getTime()-3600*1e3*24),[e,l]}},{text:"最近7天",value:()=>{const l=new Date,e=new Date;return e.setTime(e.getTime()-3600*1e3*24*7),[e,l]}},{text:"最近30天",value:()=>{const l=new Date,e=new Date;return e.setTime(e.getTime()-3600*1e3*24*29),[e,l]}},{text:"上月",value:()=>{const l=new Date,e=l.getFullYear(),i=l.getMonth(),d=new Date(e,i-1,1),u=new Date(e,i,0);return[d,u]}},{text:"本月",value:()=>{const l=new Date,e=l.getFullYear(),i=l.getMonth(),d=new Date(e,i,1),u=new Date;return[d,u]}},{text:"本年",value:()=>{const e=new Date().getFullYear(),i=new Date(e,0,1),d=new Date;return[i,d]}}],f=C([]),V=C([]),M=async()=>{const l=T.value?T.value.join("-"):"";f.value=await(await Ne({date:l})).data,V.value=await(await Pe({date:l})).data,setTimeout(()=>{U()},20)};M();const N=C(null),U=()=>{const l=k([]),e=k([]);if(V.value.data.forEach(i=>{i.name=="goods_visit_member_count"?(l.push({name:"商品访客数",type:"line",smooth:!0,data:i.data}),e.push("商品访客数")):i.name=="access_count"?(l.push({name:"浏览量",type:"line",smooth:!0,data:i.data}),e.push("浏览量")):i.name=="cart_num"?(l.push({name:"加购件数",type:"bar",data:i.data}),e.push("加购件数")):i.name=="sale_num"?(l.push({name:"下单件数",type:"bar",data:i.data}),e.push("下单件数")):i.name=="pay_num"?(l.push({name:"支付件数",type:"bar",data:i.data}),e.push("支付件数")):i.name=="pay_money"?(l.push({name:"支付金额",type:"bar",data:i.data}),e.push("支付金额")):i.name=="refund_money"?(l.push({name:"退款金额",type:"bar",data:i.data}),e.push("退款金额")):i.name=="refund_num"&&(l.push({name:"退款件数",type:"bar",data:i.data}),e.push("退款件数"))}),N.value!==null){const i=Ee(N.value),d={tooltip:{trigger:"axis",axisPointer:{type:"cross"}},color:["#1890ff","#00c050","#F76A6C","#43C5FF","#ffab2b","#b37feb","#627DFE","#11D0EA"],legend:{data:[],selected:{加购件数:!1,下单件数:!1,支付件数:!1,退款件数:!1}},xAxis:{type:"category",axisLabel:{interval:0,rotate:45},data:V.value.xAxis},yAxis:{type:"value"},grid:[{left:"3%",right:"3%",bottom:"40",containLabel:!0}],series:[]};d.series=l,d.legend.data=e,i.setOption(d),i.resize({width:"auto"}),window.addEventListener("resize",()=>{i.resize()})}},P=k([]),Y=k([]);(()=>{Fe().then(l=>{const e=l.data;if(e){const i=[];i.push({value:"",label:"全部",children:[]}),e.forEach(d=>{const u=[];d.child_list&&(u.push({value:d.category_id,label:"全部"}),d.child_list.forEach(y=>{u.push({value:y.category_id,label:y.category_name})})),i.push({value:d.category_id,label:d.category_name,children:u})}),P.splice(0,P.length,...i)}}),je().then(l=>{if(l.data)for(const e in l.data)Y.push({label:l.data[e],value:e})})})();const c=k({page:1,limit:10,total:0,loading:!0,data:[],searchParam:{goods_name:"",date:[],category_ids:"",type:""}}),D=(l=1)=>{c.loading=!0,c.page=l;const e={page:c.page,limit:c.limit,goods_name:c.searchParam.goods_name,type:c.searchParam.type,date:c.searchParam.date?c.searchParam.date.join("-"):"",category_ids:c.searchParam.category_ids?[c.searchParam.category_ids]:[]};Se(e).then(i=>{c.data=i.data.data,c.total=i.data.total,c.loading=!1})};D();const A=()=>{D()},I=C(),$=l=>{l&&(l.resetFields(),D())},O=l=>{const e=G.resolve({path:"/preview/wap",query:{page:`/addon/shop/pages/goods/detail?goods_id=${l.goods_id}`}});window.open(e.href)};return(l,e)=>{const i=ce,d=re,u=de,y=pe,_=ae("QuestionFilled"),x=ue,g=me,v=_e,L=fe,q=he,Q=xe,H=ge,J=ve,K=be,b=ye,W=we,X=De,Z=Te;return w(),E("div",ze,[t(L,{shadow:"never",class:"!border-none goods-stat"},{header:s(()=>[a("div",Me,[a("span",Ye,p(o(n)("goodsOverview")),1),a("div",Ae,[t(y,{inline:!0},{default:s(()=>[t(d,{label:o(n)("timeFilter"),prop:"date"},{default:s(()=>[t(i,{modelValue:T.value,"onUpdate:modelValue":e[0]||(e[0]=r=>T.value=r),type:"daterange","value-format":"YYYY/MM/DD","start-placeholder":o(n)("startTime"),"end-placeholder":o(n)("endTime"),shortcuts:z},null,8,["modelValue","start-placeholder","end-placeholder"])]),_:1},8,["label"]),t(d,null,{default:s(()=>[t(u,{type:"primary",onClick:e[1]||(e[1]=r=>M())},{default:s(()=>[j(p(o(n)("search")),1)]),_:1})]),_:1})]),_:1})])])]),default:s(()=>[a("div",Ie,[a("div",Le,[Re,t(v,{value:f.value.access_num},{title:s(()=>[a("div",Ge,[a("span",Be,p(o(n)("goodsAccessNum")),1),t(g,{class:"box-item",effect:"light",content:o(n)("goodsAccessNumTip"),placement:"top"},{default:s(()=>[t(x,null,{default:s(()=>[t(_)]),_:1})]),_:1},8,["content"])])]),_:1},8,["value"])]),a("div",Ue,[$e,t(v,{value:f.value.goods_visit_member_count},{title:s(()=>[a("div",Oe,[a("span",qe,p(o(n)("goodsVisitCount")),1),t(g,{class:"box-item",effect:"light",content:o(n)("goodsVisitCountTips"),placement:"top"},{default:s(()=>[t(x,null,{default:s(()=>[t(_)]),_:1})]),_:1},8,["content"])])]),_:1},8,["value"])]),a("div",Qe,[He,t(v,{value:f.value.cart_num},{title:s(()=>[a("div",Je,[a("span",Ke,p(o(n)("cartNum")),1),t(g,{class:"box-item",effect:"light",content:o(n)("cartNumTips"),placement:"top"},{default:s(()=>[t(x,null,{default:s(()=>[t(_)]),_:1})]),_:1},8,["content"])])]),_:1},8,["value"])]),a("div",We,[Xe,t(v,{value:f.value.sale_num},{title:s(()=>[a("div",Ze,[a("span",et,p(o(n)("saleNum")),1),t(g,{class:"box-item",effect:"light",content:o(n)("saleNumTips"),placement:"top"},{default:s(()=>[t(x,null,{default:s(()=>[t(_)]),_:1})]),_:1},8,["content"])])]),_:1},8,["value"])]),a("div",tt,[at,t(v,{value:f.value.pay_num},{title:s(()=>[a("div",st,[a("span",ot,p(o(n)("payNum")),1),t(g,{class:"box-item",effect:"light",content:o(n)("payNumTips"),placement:"top"},{default:s(()=>[t(x,null,{default:s(()=>[t(_)]),_:1})]),_:1},8,["content"])])]),_:1},8,["value"])]),a("div",nt,[lt,t(v,{value:f.value.pay_money,class:"flex-1",precision:"2"},{title:s(()=>[a("div",it,[a("span",ct,p(o(n)("payMoney")),1),t(g,{class:"box-item",effect:"light",content:o(n)("payMoneyTips"),placement:"top"},{default:s(()=>[t(x,null,{default:s(()=>[t(_)]),_:1})]),_:1},8,["content"])])]),_:1},8,["value"])]),a("div",rt,[dt,t(v,{value:f.value.refund_money,class:"flex-1",precision:"2"},{title:s(()=>[a("div",pt,[a("span",ut,p(o(n)("refundMoney")),1),t(g,{class:"box-item",effect:"light",content:o(n)("refundMoneyTips"),placement:"top"},{default:s(()=>[t(x,null,{default:s(()=>[t(_)]),_:1})]),_:1},8,["content"])])]),_:1},8,["value"])]),a("div",mt,[_t,t(v,{value:f.value.refund_num},{title:s(()=>[a("div",ft,[a("span",ht,p(o(n)("refundNum")),1),t(g,{class:"box-item",effect:"light",content:o(n)("refundNumTips"),placement:"top"},{default:s(()=>[t(x,null,{default:s(()=>[t(_)]),_:1})]),_:1},8,["content"])])]),_:1},8,["value"])])])]),_:1}),a("div",xt,[a("div",{ref_key:"incomeChartRef",ref:N,class:"h-[400px] w-full pt-[30px]"},null,512)]),t(L,{shadow:"never",class:"!border-none goods-stat mt-[20px]"},{header:s(()=>[a("div",null,[a("div",gt,p(o(n)("goodsRank")),1),t(y,{inline:!0,model:c.searchParam,ref_key:"searchFormRef",ref:I},{default:s(()=>[t(d,{label:o(n)("goodsName"),prop:"goods_name"},{default:s(()=>[t(q,{modelValue:c.searchParam.goods_name,"onUpdate:modelValue":e[2]||(e[2]=r=>c.searchParam.goods_name=r),modelModifiers:{trim:!0},placeholder:o(n)("goodsNamePlaceholder"),maxlength:"60"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,{label:o(n)("goodsCategory"),prop:"category_ids"},{default:s(()=>[t(Q,{modelValue:c.searchParam.category_ids,"onUpdate:modelValue":e[3]||(e[3]=r=>c.searchParam.category_ids=r),options:P,placeholder:o(n)("all"),clearable:"",props:{value:"value",label:"label",emitPath:!1},onChange:A},null,8,["modelValue","options","placeholder"])]),_:1},8,["label"]),t(d,{label:o(n)("totalType"),prop:"type"},{default:s(()=>[t(J,{modelValue:c.searchParam.type,"onUpdate:modelValue":e[4]||(e[4]=r=>c.searchParam.type=r),placeholder:o(n)("totalTypePlaceholder"),clearable:"",onChange:A},{default:s(()=>[(w(!0),E(se,null,oe(Y,r=>(w(),S(H,{key:r.value,label:r.label,value:r.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,{label:o(n)("timeFilter"),prop:"date"},{default:s(()=>[t(i,{modelValue:c.searchParam.date,"onUpdate:modelValue":e[5]||(e[5]=r=>c.searchParam.date=r),type:"daterange","value-format":"YYYY/MM/DD","start-placeholder":o(n)("startTime"),"end-placeholder":o(n)("endTime"),shortcuts:z},null,8,["modelValue","start-placeholder","end-placeholder"])]),_:1},8,["label"]),t(d,null,{default:s(()=>[t(u,{type:"primary",onClick:e[6]||(e[6]=r=>D())},{default:s(()=>[j(p(o(n)("search")),1)]),_:1}),t(u,{onClick:e[7]||(e[7]=r=>$(I.value))},{default:s(()=>[j(p(o(n)("reset")),1)]),_:1})]),_:1})]),_:1},8,["model"])])]),default:s(()=>[a("div",null,[ne((w(),S(W,{data:c.data,size:"large",ref:"goodsListTableRef"},{empty:s(()=>[a("span",null,p(c.loading?"":o(n)("emptyData")),1)]),default:s(()=>[t(b,{label:o(n)("goodsInfo"),"min-width":"300"},{default:s(({row:r})=>[a("div",{class:"flex items-center cursor-pointer",onClick:Vt=>O(r)},[a("div",bt,[r.goods_cover_thumb_small?(w(),S(K,{key:0,class:"w-[70px] h-[70px]",src:o(le)(r.goods_cover_thumb_small),fit:"contain"},{error:s(()=>[yt]),_:2},1032,["src"])):(w(),E("img",wt))]),a("div",Dt,[a("span",{title:r.goods_name,class:"multi-hidden"},p(r.goods_name),9,Tt),r.is_gift==1?(w(),E("span",Ct,"赠品")):ie("",!0)])],8,vt)]),_:1},8,["label"]),t(b,{prop:"access_num",label:o(n)("accessNum"),"min-width":"100"},null,8,["label"]),t(b,{prop:"goods_visit_member_count",label:o(n)("visitCount"),"min-width":"100"},null,8,["label"]),t(b,{prop:"cart_num",label:o(n)("cartNumber"),"min-width":"100"},null,8,["label"]),t(b,{prop:"sale_num",label:o(n)("saleNumber"),"min-width":"100"},null,8,["label"]),t(b,{prop:"pay_num",label:o(n)("payNum"),"min-width":"100"},null,8,["label"]),t(b,{prop:"pay_money",label:o(n)("payTotal"),"min-width":"100"},null,8,["label"]),t(b,{prop:"collect_num",label:o(n)("collectNum"),"min-width":"100"},null,8,["label"])]),_:1},8,["data"])),[[Z,c.loading]]),a("div",kt,[t(X,{"current-page":c.page,"onUpdate:current-page":e[8]||(e[8]=r=>c.page=r),"page-size":c.limit,"onUpdate:page-size":e[9]||(e[9]=r=>c.limit=r),layout:"total, sizes, prev, pager, next, jumper",total:c.total,onSizeChange:e[10]||(e[10]=r=>D()),onCurrentChange:D},null,8,["current-page","page-size","total"])])])]),_:1})])}}});const sa=Ve(Et,[["__scopeId","data-v-e76c6a1c"]]);export{sa as default};