This commit is contained in:
PC-202306242200\Administrator
2024-09-20 10:33:40 +08:00
parent 2081393a33
commit 0744635890
32 changed files with 1271 additions and 33 deletions

View File

@@ -84,7 +84,7 @@ export default defineConfig({
},
define: {
'process.env': {
API_URL: "http://guangdongapp.zhongshuai2023.com",
API_URL: "http://guangdongadminapi.zhongshuai2023.com",
// API_URL: "http://192.168.1.32:1002",
WS_URL: "ws://lv.com",
STATIC_URL: "http://lv.com",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

117
dist/4104.c246b8ea.async.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
dist/index.html vendored
View File

@@ -8,6 +8,6 @@
</head>
<body>
<div id="root"></div>
<script src="/umi.5de21d31.js"></script>
<script src="/umi.bde1f6e3.js"></script>
</body></html>

View File

@@ -0,0 +1 @@
"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[9163],{49091:function(S,T,e){var l=e(35361),d=e(11642),C=e(73356),A=e(56929),D=e(959),P=e(50925),p=e(41268),B=e(50159),s=e(50959),L=e(50756),a=e(11527),v=["rules","name","phoneName","fieldProps","onTiming","captchaTextRender","captchaProps"],O=s.forwardRef(function(t,R){var f=P.Z.useFormInstance(),i=(0,s.useState)(t.countDown||60),r=(0,D.Z)(i,2),m=r[0],W=r[1],c=(0,s.useState)(!1),F=(0,D.Z)(c,2),g=F[0],M=F[1],x=(0,s.useState)(),K=(0,D.Z)(x,2),G=K[0],Z=K[1],w=t.rules,H=t.name,b=t.phoneName,E=t.fieldProps,j=t.onTiming,U=t.captchaTextRender,$=U===void 0?function(_,o){return _?"".concat(o," \u79D2\u540E\u91CD\u65B0\u83B7\u53D6"):"\u83B7\u53D6\u9A8C\u8BC1\u7801"}:U,N=t.captchaProps,V=(0,A.Z)(t,v),y=function(){var _=(0,C.Z)((0,d.Z)().mark(function o(h){return(0,d.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.prev=0,Z(!0),u.next=4,V.onGetCaptcha(h);case 4:Z(!1),M(!0),u.next=13;break;case 8:u.prev=8,u.t0=u.catch(0),M(!1),Z(!1),console.log(u.t0);case 13:case"end":return u.stop()}},o,null,[[0,8]])}));return function(h){return _.apply(this,arguments)}}();return(0,s.useImperativeHandle)(R,function(){return{startTiming:function(){return M(!0)},endTiming:function(){return M(!1)}}}),(0,s.useEffect)(function(){var _=0,o=t.countDown;return g&&(_=window.setInterval(function(){W(function(h){return h<=1?(M(!1),clearInterval(_),o||60):h-1})},1e3)),function(){return clearInterval(_)}},[g]),(0,s.useEffect)(function(){j&&j(m)},[m,j]),(0,a.jsxs)("div",{style:(0,l.Z)((0,l.Z)({},E==null?void 0:E.style),{},{display:"flex",alignItems:"center"}),ref:R,children:[(0,a.jsx)(p.Z,(0,l.Z)((0,l.Z)({},E),{},{style:(0,l.Z)({flex:1,transition:"width .3s",marginRight:8},E==null?void 0:E.style)})),(0,a.jsx)(B.ZP,(0,l.Z)((0,l.Z)({style:{display:"block"},disabled:g,loading:G},N),{},{onClick:(0,C.Z)((0,d.Z)().mark(function _(){var o;return(0,d.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,!b){n.next=9;break}return n.next=4,f.validateFields([b].flat(1));case 4:return o=f.getFieldValue([b].flat(1)),n.next=7,y(o);case 7:n.next=11;break;case 9:return n.next=11,y("");case 11:n.next=16;break;case 13:n.prev=13,n.t0=n.catch(0),console.log(n.t0);case 16:case"end":return n.stop()}},_,null,[[0,13]])})),children:$(g,m)}))]})}),I=(0,L.G)(O);T.Z=I},11767:function(S,T,e){e.r(T);var l=e(90228),d=e.n(l),C=e(87999),A=e.n(C),D=e(5e4),P=e(19014),p=e(49547),B=e(49091),s=e(50959),L=e(2733),a=e(11527);T.default=function(v){var O=v.values,I=v.modalOpenState,t=v.onModalOpenState,R=v.onSubmit,f=(0,s.useRef)();return(0,s.useEffect)(function(){var i;(i=f.current)===null||i===void 0||i.setFieldsValue(O)},[O]),(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(D.Y,{title:"\u6D3B\u52A8-\u4F5C\u5E9F",formRef:f,submitter:{searchConfig:{resetText:"\u91CD\u7F6E"},resetButtonProps:{onClick:function(){var r;(r=f.current)===null||r===void 0||r.resetFields()}}},initialValues:O,onFinish:R,open:I,onOpenChange:t,children:[(0,a.jsx)(P.Z,{hidden:!0,width:"md",name:"id"}),(0,a.jsx)(p.A.Group,{children:(0,a.jsx)(P.Z,{rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}],width:"md",name:"username",label:"\u7528\u6237\u540D",placeholder:"\u8BF7\u8F93\u5165"})}),(0,a.jsx)(p.A.Group,{children:(0,a.jsx)(P.Z,{rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}],width:"md",name:"mobile",label:"\u624B\u673A\u53F7",placeholder:"\u8BF7\u8F93\u5165"})}),(0,a.jsx)(p.A.Group,{children:(0,a.jsx)(B.Z,{placeholder:"\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801",captchaTextRender:function(r,m){return r?"".concat(m," ","\u83B7\u53D6\u9A8C\u8BC1\u7801"):"\u83B7\u53D6\u9A8C\u8BC1\u7801"},label:"\u9A8C\u8BC1\u7801",name:"code",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801\uFF01"}],onGetCaptcha:A()(d()().mark(function i(){var r,m;return d()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,smsSendcode();case 2:r=c.sent,m=r.data;case 4:case"end":return c.stop()}},i)}))})})]})})}}}]);

View File

@@ -0,0 +1 @@
"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[8446],{34927:function(j,m,e){var a=e(35361),p=e(56929),h=e(89558),E=e(47186),F=e(50959),v=e(50756),B=e(20734),D=e(11527),_=["fieldProps","options","radioType","layout","proFieldProps","valueEnum"],O=F.forwardRef(function(u,r){var s=u.fieldProps,i=u.options,M=u.radioType,t=u.layout,f=u.proFieldProps,P=u.valueEnum,A=(0,p.Z)(u,_);return(0,D.jsx)(B.Z,(0,a.Z)((0,a.Z)({valueType:M==="button"?"radioButton":"radio",ref:r,valueEnum:(0,h.h)(P,void 0)},A),{},{fieldProps:(0,a.Z)({options:i,layout:t},s),proFieldProps:f,filedConfig:{customLightMode:!0}}))}),d=F.forwardRef(function(u,r){var s=u.fieldProps,i=u.children;return(0,D.jsx)(E.ZP,(0,a.Z)((0,a.Z)({},s),{},{ref:r,children:i}))}),R=(0,v.G)(d,{valuePropName:"checked",ignoreWidth:!0}),n=R;n.Group=O,n.Button=E.ZP.Button,n.displayName="ProFormComponent",m.Z=n},4871:function(j,m,e){e.r(m);var a=e(90228),p=e.n(a),h=e(87999),E=e.n(h),F=e(48305),v=e.n(F),B=e(5e4),D=e(49547),_=e(19014),O=e(34927),d=e(50959),R=e(2733),n=e(11527);m.default=function(u){var r=u.values,s=u.modalOpenState,i=u.onModalOpenState,M=u.onSubmit,t=(0,d.useRef)(),f=(0,d.useState)([]),P=v()(f,2),A=P[0],x=P[1],W=function(o){console.log(o)};(0,d.useEffect)(function(){var l;(l=t.current)===null||l===void 0||l.setFieldsValue(r)},[r]);var T=function(){var l=E()(p()().mark(function o(C){var b;return p()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,M(C);case 2:(b=t.current)===null||b===void 0||b.resetFields();case 3:case"end":return c.stop()}},o)}));return function(C){return l.apply(this,arguments)}}();return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(B.Y,{title:"513\u6D3B\u52A8-\u6DFB\u52A0",formRef:t,submitter:{searchConfig:{resetText:"\u91CD\u7F6E"},resetButtonProps:{onClick:function(){var o;(o=t.current)===null||o===void 0||o.resetFields()}}},initialValues:r,onFinish:T,open:s,onOpenChange:i,children:(0,n.jsxs)(D.A.Group,{children:[(0,n.jsx)(_.Z,{width:"md",name:"username",label:"\u7528\u6237\u540D",placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u540D",rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}]}),(0,n.jsx)(_.Z,{width:"md",name:"mobile",label:"\u624B\u673A\u53F7",placeholder:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7"},{pattern:/^1[3-9]\d{9}$/,message:"\u8BF7\u8F93\u5165\u6709\u6548\u7684\u624B\u673A\u53F7"}]}),(0,n.jsx)(O.Z.Group,{label:"\u65F6\u95F4",name:"m",initialValue:"6\u6708",rules:[{required:!0,message:"\u8BF7\u9009\u62E9"}],options:[{label:"6\u6708",value:"6\u6708"},{label:"12\u6708",value:"12\u6708"},{label:"24\u6708",value:"24\u6708"},{label:"36\u6708",value:"36\u6708"},{label:"48\u6708",value:"48\u6708"},{label:"60\u6708",value:"60\u6708"}]}),(0,n.jsx)(_.Z,{width:"md",name:["info","car_name"],label:"\u8F66\u8F86\u578B\u53F7",placeholder:"\u8BF7\u8F93\u5165\u8F66\u8F86\u578B\u53F7"}),(0,n.jsx)(_.Z,{width:"md",name:["info","realname"],label:"\u8F66\u4E3B\u59D3\u540D",placeholder:"\u8BF7\u8F93\u5165\u8F66\u4E3B\u59D3\u540D"}),(0,n.jsx)(_.Z,{width:"md",name:["info","plate_code"],label:"\u8F66\u724C\u53F7\u7801",placeholder:"\u8BF7\u8F93\u5165\u8F66\u724C\u53F7\u7801"}),(0,n.jsx)(_.Z,{width:"md",name:["info","car_code"],label:"\u8F66\u67B6\u53F7\u7801",placeholder:"\u8BF7\u8F93\u5165\u8F66\u67B6\u53F7\u7801"}),(0,n.jsx)(_.Z,{width:"md",name:["info","bank_num"],label:"\u8FD8\u6B3E\u5361\u53F7",placeholder:"\u8BF7\u8F93\u5165\u8FD8\u6B3E\u5361\u53F7"}),(0,n.jsx)(_.Z,{width:"md",name:["info","bank_name"],label:"\u94F6\u884C\u540D\u79F0",placeholder:"\u8BF7\u8F93\u5165\u94F6\u884C\u540D\u79F0"}),(0,n.jsx)(_.Z,{width:"md",name:["info","todate"],label:"\u8FD8\u6B3E\u65E5\u671F",placeholder:"\u8BF7\u8F93\u5165\u8FD8\u6B3E\u65E5\u671F"})]})})})}}}]);

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[7579],{3891:function(){}}]);

View File

@@ -0,0 +1 @@
"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[4417],{40860:function(w,c,_){_.r(c);var b=_(90228),v=_.n(b),j=_(87999),M=_.n(j),O=_(26068),u=_.n(O),A=_(67825),R=_.n(A),I=_(48305),m=_.n(I),i=_(50959),x=_(98984),y=_(16030),C=_(35384),o=_(11527),S=["type","defaultRender","formItemProps","fieldProps"];c.default=function(){var B={shop_id:"",todate:""},T={username:"",mobile:"",code:""},W=(0,i.useState)(B),h=m()(W,2),H=h[0],J=h[1],K=(0,i.useState)(T),E=m()(K,2),Q=E[0],V=E[1],L=(0,i.useRef)(),U=(0,i.useState)([]),f=m()(U,2),G=f[0],F=f[1],g=(0,i.useState)(null),D=m()(g,2),X=D[0],$=D[1],Z=function(r){shopItems({username:r}).then(function(e){var n,a=e.data,d=[];a==null||(n=a.data)===null||n===void 0||n.map(function(t){t.label="".concat(t.username," ").concat(t.mobile),d.push(t)}),F(d)})},z=[{title:"\u6D3B\u52A8\u540D\u79F0",dataIndex:"title",search:!1},{title:"\u6295\u8D44\u4EBA",dataIndex:"shop_id",render:function(r,e){var n,a;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{children:["\u7528\u6237\u540D\uFF1A",e==null||(n=e.shop)===null||n===void 0?void 0:n.username]}),(0,o.jsxs)("div",{children:["\u624B\u673A\u53F7\uFF1A",e==null||(a=e.shop)===null||a===void 0?void 0:a.mobile]})]})},renderFormItem:function(r,e,n){var a=e.type,d=e.defaultRender,t=e.formItemProps,p=e.fieldProps,N=R()(e,S);return(0,o.jsx)(x.Z,u()(u()({},p),{},{allowClear:!0,showSearch:!0,placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u540D",style:{width:"100%"},filterOption:!1,onSearch:function(P){P&&Z(P)},fieldNames:{label:"label",value:"id"},options:G}))}},{title:"\u8BA4\u9886\u65F6\u95F4",dataIndex:"todate",search:!1},{title:"\u5145\u7535\u6869",dataIndex:"device",search:!1,render:function(r,e){var n=e==null?void 0:e.device.map(function(a){return a.id});return n.join(",")}},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"created_at",search:!1}];return(0,o.jsx)(y._z,{ghost:!0,children:(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(C.Z,{actionRef:L,rowKey:"id",search:{defaultCollapsed:!1},toolBarRender:function(){return[]},request:function(){var l=M()(v()().mark(function r(e,n,a){var d,t,p;return v()().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return $(u()({token:""},e)),s.next=3,shopActivityItems813(u()(u()({},e),{},{sorter:n,filter:a}));case 3:return d=s.sent,t=d.data,p=d.success,s.abrupt("return",{data:(t==null?void 0:t.items)||[],total:t==null?void 0:t.total,success:p});case 7:case"end":return s.stop()}},r)}));return function(r,e,n){return l.apply(this,arguments)}}(),columns:z})})})}}}]);

View File

@@ -0,0 +1 @@
"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[5917],{35748:function(U,c,e){var h=e(35361),i=e(56929),C=e(50959),p=e(20734),E=e(11527),P=["fieldProps","min","proFieldProps","max"],d=function(n,g){var j=n.fieldProps,T=n.min,D=n.proFieldProps,t=n.max,y=(0,i.Z)(n,P);return(0,E.jsx)(p.Z,(0,h.Z)({valueType:"digit",fieldProps:(0,h.Z)({min:T,max:t},j),ref:g,filedConfig:{defaultProps:{width:"100%"}},proFieldProps:D},y))},o=C.forwardRef(d);c.Z=o},27471:function(U,c,e){e.r(c),e.d(c,{default:function(){return N}});var h=e(90228),i=e.n(h),C=e(87999),p=e.n(C),E=e(48305),P=e.n(E),d=e(50959),o=e(49547),R=e(35748),n=e(19014),g=e(35361),j=e(56929),T=e(71252),D=e(20734),t=e(11527),y=["fieldProps","proFieldProps"],I="dateTime",B=d.forwardRef(function(F,a){var O=F.fieldProps,x=F.proFieldProps,u=(0,j.Z)(F,y),m=(0,d.useContext)(T.Z);return(0,t.jsx)(D.Z,(0,g.Z)({ref:a,fieldProps:(0,g.Z)({getPopupContainer:m.getPopupContainer},O),valueType:I,proFieldProps:x,filedConfig:{valueType:I,customLightMode:!0}},u))}),S=B,G=e(50925),K=e(94675),$=e(7485),z=e(2733),W=e(17885),H=e(66001),M=e.n(H),ee=e(8776),V=function(a){var O=(0,d.useState)(M().createEditorState("")),x=P()(O,2),u=x[0],m=x[1],b=G.Z.useForm(),J=P()(b,1),f=J[0],L=a.values;(0,d.useEffect)(function(){m(M().createEditorState(L.detail)),f.resetFields(),f.setFieldsValue(L)},[f,a]);var te=(0,$.useIntl)(),Q=function(){f.submit()},X=function(){a.onCancel()},Y=function(){var s=p()(i()().mark(function l(r){return i()().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:r.detail=u.toHTML(),a.onSubmit(r);case 2:case"end":return v.stop()}},l)}));return function(r){return s.apply(this,arguments)}}(),k=["undo","redo","separator","font-size","line-height","letter-spacing","separator","text-color","bold","italic","underline","strike-through","separator","superscript","subscript","remove-styles","emoji","separator","text-indent","text-align","separator","headings","list-ul","list-ol","blockquote","code","separator","link","separator","hr","separator","clear"],w=function(){var s=p()(i()().mark(function l(r){var Z,v;return i()().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:Z=[".mp4",".mkv",".avi",".mov",".wmv",".flv",".webm",".m4v",".3gp",".3g2"],v=r.toLowerCase(),Z.some(function(_){return v.endsWith(_)})?m(W.ContentUtils.insertMedias(u,[{type:"VIDEO",url:r}])):m(W.ContentUtils.insertMedias(u,[{type:"IMAGE",url:r}]));case 3:case"end":return A.stop()}},l)}));return function(r){return s.apply(this,arguments)}}(),q=["separator",{key:"FilesManagerImage",title:"\u4E0A\u4F20\u56FE\u7247/\u89C6\u9891",html:null,text:(0,t.jsx)(z.Z,{fileType:"images",mode:"",imagesShow:!1,onChange:w,count:1}),onClick:function(){console.log("Hello World!")}}];return(0,t.jsx)(K.Z,{width:800,title:"\u516C\u544A\u7BA1\u7406",open:a.open,forceRender:!0,destroyOnClose:!0,onOk:Q,onCancel:X,children:(0,t.jsxs)(o.A,{form:f,submitter:!1,layout:"horizontal",onFinish:Y,children:[(0,t.jsx)(R.Z,{name:"id",label:"ID",disabled:!0,hidden:!0}),(0,t.jsx)(o.A.Group,{children:(0,t.jsx)(n.Z,{name:"title",label:"\u6807\u9898",placeholder:"\u8BF7\u8F93\u5165\u6807\u9898"})}),(0,t.jsxs)(o.A.Group,{children:[(0,t.jsx)(S,{rules:[{required:!0,message:"\u8BF7\u9009\u62E9"}],name:"startTime",label:"\u5F00\u59CB\u65E5\u671F"}),(0,t.jsx)(S,{rules:[{required:!0,message:"\u8BF7\u9009\u62E9"}],name:"endTime",label:"\u7ED3\u675F\u65E5\u671F"})]}),(0,t.jsx)(o.A.Group,{children:(0,t.jsx)(o.A.Item,{name:"detail",children:(0,t.jsx)("div",{className:"border-solid border-2 border-indigo-600",children:(0,t.jsx)(M(),{value:u,controls:k,extendControls:q,onChange:function(l){m(l)}})})})})]})})},N=V}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[7951],{89100:function(N,m,n){n.r(m),n.d(m,{default:function(){return P}});var T=n(26068),f=n.n(T),G=n(48305),x=n.n(G),v=n(50959),j=n(40676),F=n(14417),a=n(87980),s=n(23885),r=n(57385),$=n(90228),p=n.n($),D=n(87999),g=n.n(D),y=n(7485);function M(i){return Z.apply(this,arguments)}function Z(){return Z=g()(p()().mark(function i(o){return p()().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",(0,y.request)("/api/orders/statMallStatistics",f()({method:"GET"},o||{})));case 1:case"end":return u.stop()}},i)})),Z.apply(this,arguments)}function R(i){return E.apply(this,arguments)}function E(){return E=g()(p()().mark(function i(o){return p()().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",(0,y.request)("/api/orders/getAmountAndGoodsCount",f()({method:"GET"},o||{})));case 1:case"end":return u.stop()}},i)})),E.apply(this,arguments)}var B=n(54569),t=n(11527),P=function(){var i,o,d,u,W=(0,v.useState)([]),A=x()(W,2),z=A[0],H=A[1],I=(0,v.useState)([]),S=x()(I,2),e=S[0],J=S[1],K=(0,v.useState)([]),C=x()(K,2),O=C[0],Q=C[1],L={data:z,xField:"name",yField:"value",seriesField:"type",xAxis:{type:"time"},padding:"auto",legend:{position:"right-top"},yAxis:{label:{formatter:function(c){return"".concat(c).replace(/\d{1,3}(?=(\d{3})+$)/g,function(l){return"".concat(l,",")})}}}};return(0,v.useEffect)(function(){M().then(function(h){J(h.data)}),R().then(function(h){var c=[];h.data.map(function(l,U){c.push({name:l.createTime,category:"\u5546\u54C1\u6570\u91CF",value:l.goodsCount,type:1}),c.push({name:l.createTime,category:"\u91D1\u989D",value:l.amountCount,type:2})}),H(c)})},[]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.Z,{children:"\u5145\u7535\u6869"}),(0,t.jsxs)(F.Z,{gutter:10,children:[(0,t.jsx)(a.Z,{span:6,children:(0,t.jsx)(s.Z,{children:(0,t.jsx)(r.Z,{title:"\u4ECA\u65E5\u5145\u7535",value:e==null||(i=e.device_count)===null||i===void 0?void 0:i.today,precision:2,prefix:"\uFFE5"})})}),(0,t.jsx)(a.Z,{span:6,children:(0,t.jsx)(s.Z,{children:(0,t.jsx)(r.Z,{title:"\u6628\u65E5\u5145\u7535",value:e==null||(o=e.device_count)===null||o===void 0?void 0:o.yesterday,precision:2,prefix:"\uFFE5"})})}),(0,t.jsx)(a.Z,{span:6,children:(0,t.jsx)(s.Z,{children:(0,t.jsx)(r.Z,{title:"\u4E0A\u5468\u5145\u7535",value:e==null||(d=e.device_count)===null||d===void 0?void 0:d.week,precision:2,prefix:"\uFFE5"})})}),(0,t.jsx)(a.Z,{span:6,children:(0,t.jsx)(s.Z,{children:(0,t.jsx)(r.Z,{title:"\u4E0A\u6708\u5145\u7535",value:e==null||(u=e.device_count)===null||u===void 0?void 0:u.month,precision:2,prefix:"\uFFE5"})})})]}),(0,t.jsx)(j.Z,{children:"\u5546\u57CE"}),(0,t.jsxs)(F.Z,{gutter:10,children:[(0,t.jsx)(a.Z,{span:6,children:(0,t.jsx)(s.Z,{children:(0,t.jsx)(r.Z,{title:"\u4ECA\u5929\u6210\u4EA4",value:e==null?void 0:e.todayTransaction,precision:2,prefix:"\uFFE5"})})}),(0,t.jsx)(a.Z,{span:6,children:(0,t.jsx)(s.Z,{children:(0,t.jsx)(r.Z,{title:"\u6628\u5929\u6210\u4EA4",value:e==null?void 0:e.yesterdayTransaction,precision:2,prefix:"\uFFE5"})})}),(0,t.jsx)(a.Z,{span:6,children:(0,t.jsx)(s.Z,{children:(0,t.jsx)(r.Z,{title:"\u4E0A\u5468\u6210\u4EA4",value:e==null?void 0:e.lastWeekTransaction,precision:2,prefix:"\uFFE5"})})}),(0,t.jsx)(a.Z,{span:6,children:(0,t.jsx)(s.Z,{children:(0,t.jsx)(r.Z,{title:"\u4E0A\u6708\u6210\u4EA4",value:e==null?void 0:e.lastMonthTransaction,precision:2,prefix:"\uFFE5"})})})]}),(0,t.jsx)(j.Z,{children:"\u5546\u57CE(\u5546\u54C1\u6570\u91CF/\u91D1\u989D)-\u6298\u7EBF\u56FE"}),(0,t.jsx)(B.Z,f()({},L))]})}}}]);

File diff suppressed because one or more lines are too long

View File

@@ -38,6 +38,7 @@
"not ie <= 10"
],
"dependencies": {
"@ant-design/charts": "^2.2.1",
"@ant-design/icons": "^4.8.1",
"@ant-design/plots": "^2.1.5",
"@ant-design/pro-components": "^2.6.44",

18
pnpm-lock.yaml generated
View File

@@ -8,6 +8,9 @@ importers:
.:
dependencies:
'@ant-design/charts':
specifier: ^2.2.1
version: 2.2.1(lodash-es@4.17.21)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)
'@ant-design/icons':
specifier: ^4.8.1
version: 4.8.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0)
@@ -227,6 +230,12 @@ packages:
react: '>=16.8.4'
react-dom: '>=16.8.4'
'@ant-design/charts@2.2.1':
resolution: {integrity: sha512-OjAZeJo2xWlatj1/dw8eB9CDMsGCZ/BA6Z6k2sLPkSqDV9GUIjGNgXQ9igYrIqfpB+xVq5lLPvHndyXCHcOzMQ==}
peerDependencies:
react: '>=16.8.4'
react-dom: '>=16.8.4'
'@ant-design/colors@6.0.0':
resolution: {integrity: sha512-qAZRvPzfdWHtfameEGP2Qvuf838NhergR35o+EuVyB5XvSA98xod5r4utvi4TJ3ywmevm290g9nsCG5MryrdWQ==}
@@ -9397,6 +9406,15 @@ snapshots:
react: 18.2.0
react-dom: 18.2.0(react@18.2.0)
'@ant-design/charts@2.2.1(lodash-es@4.17.21)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)':
dependencies:
'@ant-design/plots': 2.1.5(lodash-es@4.17.21)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)
lodash: 4.17.21
react: 18.2.0
react-dom: 18.2.0(react@18.2.0)
transitivePeerDependencies:
- lodash-es
'@ant-design/colors@6.0.0':
dependencies:
'@ctrl/tinycolor': 3.6.1

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,87 @@
/*
* @Note:
* @Author: 2058827620@qq.com
* @Date: 2022-04-03 17:02:15
*/
import { ProForm, ModalForm, ProFormSelect, ProFormText, ProFormCaptcha } from '@ant-design/pro-components';
import { Tree } from 'antd';
import { useEffect, useRef } from 'react';
import FilesManager from '@/components/FilesManage/index';
// import services from '@/services/admin';
// const { smsSendcode } = services.SmsController;
// const { shopLevelItems } = services.ShopLevelController;
// const { shopItems } = services.ShopController;
export default ({ values, modalOpenState, onModalOpenState, onSubmit }) => {
const restFormRef = useRef();
useEffect(() => {
restFormRef.current?.setFieldsValue(values);
}, [values]);
return (
<>
<ModalForm
title="活动-作废"
formRef={restFormRef}
submitter={{
searchConfig: {
resetText: '重置',
},
resetButtonProps: {
onClick: () => {
restFormRef.current?.resetFields();
},
},
}}
initialValues={values}
onFinish={onSubmit}
open={modalOpenState}
onOpenChange={onModalOpenState}
>
<ProFormText hidden={true} width="md" name="id" />
<ProForm.Group>
<ProFormText
rules={[{ required: true, message: '请输入' }]}
width="md"
name="username"
label="用户名"
placeholder="请输入"
/>
</ProForm.Group>
<ProForm.Group>
<ProFormText
rules={[{ required: true, message: '请输入' }]}
width="md"
name="mobile"
label="手机号"
placeholder="请输入"
/>
</ProForm.Group>
<ProForm.Group>
<ProFormCaptcha
placeholder={'请输入验证码'}
captchaTextRender={(timing, count) => {
if (timing) {
return `${count} ${'获取验证码'}`;
}
return '获取验证码';
}}
label="验证码"
name="code"
rules={[
{
required: true,
message: '请输入验证码!',
},
]}
onGetCaptcha={async () => {
const { data } = await smsSendcode();
}}
/>
</ProForm.Group>
</ModalForm>
</>
);
};

View File

@@ -0,0 +1,132 @@
/*
* @Note:
* @Author: 2058827620@qq.com
* @Date: 2022-04-03 17:02:15
*/
import { ProForm, ModalForm, ProFormSelect, ProFormText, ProFormDatePicker, ProFormRadio } from '@ant-design/pro-components';
import { Tree } from 'antd';
import { useEffect, useRef, useState } from 'react';
import FilesManager from '@/components/FilesManage/index';
// import services from '@/services/admin';
// const { shopLevelItems } = services.ShopLevelController;
// const { shopItems } = services.ShopController;
export default ({ values, modalOpenState, onModalOpenState, onSubmit }) => {
const restFormRef = useRef();
const [shopOption, setShopOption] = useState([]);
const searchShop = (e) => {
console.log(e);
}
useEffect(() => {
restFormRef.current?.setFieldsValue(values);
}, [values]);
const handleFinish = async (formValues) => {
await onSubmit(formValues);
restFormRef.current?.resetFields();
};
return (
<>
<ModalForm
title="513活动-添加"
formRef={restFormRef}
submitter={{
searchConfig: {
resetText: '重置',
},
resetButtonProps: {
onClick: () => {
restFormRef.current?.resetFields();
},
},
}}
initialValues={values}
onFinish={handleFinish}
open={modalOpenState}
onOpenChange={onModalOpenState}
>
<ProForm.Group>
<ProFormText
width="md"
name="username"
label="用户名"
placeholder="请输入用户名"
rules={[{ required: true, message: '请输入' }]}
/>
<ProFormText
width="md"
name="mobile"
label="手机号"
placeholder="请输入手机号"
rules={[{ required: true, message: '请输入手机号' },{ pattern: /^1[3-9]\d{9}$/, message: '请输入有效的手机号' }]}
/>
<ProFormRadio.Group
label="时间"
name="m"
initialValue="6月"
rules={[{ required: true, message: '请选择' }]}
options={[
{ label: '6月', value: '6月' },
{ label: '12月', value: '12月' },
{ label: '24月', value: '24月' },
{ label: '36月', value: '36月' },
{ label: '48月', value: '48月' },
{ label: '60月', value: '60月' },
]}
/>
<ProFormText
width="md"
name={['info', 'car_name']}
label="车辆型号"
placeholder="请输入车辆型号"
/>
<ProFormText
width="md"
name={['info', 'realname']}
label="车主姓名"
placeholder="请输入车主姓名"
/>
<ProFormText
width="md"
name={['info', 'plate_code']}
label="车牌号码"
placeholder="请输入车牌号码"
/>
<ProFormText
width="md"
name={['info', 'car_code']}
label="车架号码"
placeholder="请输入车架号码"
/>
<ProFormText
width="md"
name={['info', 'bank_num']}
label="还款卡号"
placeholder="请输入还款卡号"
/>
<ProFormText
width="md"
name={['info', 'bank_name']}
label="银行名称"
placeholder="请输入银行名称"
/>
<ProFormText
width="md"
name={['info', 'todate']}
label="还款日期"
placeholder="请输入还款日期"
/>
</ProForm.Group>
</ModalForm>
</>
);
};

View File

@@ -0,0 +1,245 @@
import React, { useRef, useEffect, useState } from 'react';
import { history } from '@umijs/max';
import CreateFormModal from './components/CreateFormModal';
import CancellationModal from './components/CancellationModal';
import { Select, Space, Image, Button } from 'antd';
import {
PageContainer,
ProTable,
} from '@ant-design/pro-components';
import dayjs from 'dayjs';
import { exportLink } from '@/utils/func';
import AuthConsumer from '@/components/Authority';
// import services from '@/services/admin';
// const { shopActivityItems, shopDeleteItems } = services.ShopActivityController;
// const { shopItems } = services.ShopController;
// const { shopActivity } = services.ShopActivity;
export default () => {
const [createFormModal, setCreateFormModal] = useState(false);
const [cancellationModal, setCancellationModal] = useState(false)
const initRow = {
shop_id: '',
todate: '',
};
const initRowCancellationModal = {
username: "",
mobile: "",
code: ""
}
const [row, setRow] = useState(initRow);
const [rowCancellationModal, setRowCancellationModal] = useState(initRowCancellationModal);
const actionRef = useRef();
const [config, setConfig] = useState();
const [shopOption, setShopOption] = useState([]);
const [searchParams, setSearchParams] = useState(null);
const searchShop = (value) => {
shopItems({
username: value
}).then(({ data }) => {
const arr = [];
data?.data?.map((item) => {
item.label = `${item.username} ${item.mobile}`;
arr.push(item);
});
setShopOption(arr);
});
}
const handleCreate = async (fields) => {
setRow(fields);
// let data = JSON.parse(JSON.stringify(fields))
// const { m, mobile, username, ...rest } = data;
// const extracted = { m, mobile, username };
// const remainingData = { ...rest };
const { success } = await shopActivity(fields);
if (success) {
setRow(initRow);
actionRef.current?.reload();
setCreateFormModal(false);
}
};
const handleCreateFormModal = async (fields) => {
setRowCancellationModal(fields)
const { success } = await shopDeleteItems(fields);
if (success) {
setRowCancellationModal(initRow);
actionRef.current?.reload();
setCancellationModal(false);
}
}
const columns = [
{
title: '活动名称',
dataIndex: 'title',
search: false,
},
{
title: '投资人',
dataIndex: 'shop_id',
render: (_, record) => {
return <>
<div>{record?.shop?.username}</div>
<div>{record?.shop?.mobile}</div>
<div>{record?.vip}</div>
</>
},
renderFormItem: (
_,
{ type, defaultRender, formItemProps, fieldProps, ...rest },
form,
) => {
return <Select
{...fieldProps}
allowClear
showSearch
placeholder="请输入用户名"
style={{ width: "100%" }}
filterOption={false}
onSearch={
(e) => {
if (!e) {
return;
}
searchShop(e);
}
}
fieldNames={{
label: "label",
value: "id"
}}
options={shopOption}
/>
},
},
{
title: '时间',
dataIndex: 'm',
search: false,
render: (_, record) => {
return record?.m + '个月'
},
},
{
title: '有效期',
dataIndex: 'type',
search: false,
render: (_, record) => {
return record?.valid_time ? dayjs(record?.valid_time * 1000).format('YYYY-MM-DD') : ''
},
},
{
title: '客户资料',
dataIndex: 'type',
search: false,
render: (_, record) => {
return <>
<div>{record?.info?.car_name}</div>
<div>{record?.info?.realname}</div>
<div>{record?.info?.plate_code}</div>
<div>{record?.info?.car_code}</div>
<div>{record?.info?.bank_num}</div>
<div>{record?.info?.bank_name}</div>
<div>{record?.info?.todate}</div>
</>
},
},
{
title: '创建时间',
dataIndex: 'created_at',
search: false,
}
];
return (
<PageContainer
ghost
>
<>
<CreateFormModal
values={row}
modalOpenState={createFormModal}
onModalOpenState={setCreateFormModal}
onSubmit={handleCreate}
/>
<CancellationModal
values={rowCancellationModal}
modalOpenState={cancellationModal}
onModalOpenState={setCancellationModal}
onSubmit={handleCreateFormModal}
/>
<ProTable
actionRef={actionRef}
rowKey="id"
search={{
defaultCollapsed: false,
}}
toolBarRender={() => [
<AuthConsumer action={'admin/shop_activity/create'} key="admin/shop_activity/create">
<Button
type="primary"
style={{ background: '#67c23a' }}
onClick={() => {
setCreateFormModal(true)
}}
>
</Button>
</AuthConsumer>,
<AuthConsumer action={'admin/shop_activity/export'} key="admin/shop_activity/export">
<Button type="primary" onClick={() => {
window.location.href = exportLink(searchParams, '/admin/shop_activity/export');
}}></Button>
</AuthConsumer>,
<AuthConsumer action={'admin/shop_activity/delete'} key="admin/shop_activity/delete">
<Button
danger
type="primary"
onClick={() => {
setCancellationModal(true)
}}
>
</Button>
</AuthConsumer>
]}
request={async (params, sorter, filter) => {
setSearchParams({ token: '', ...params });
const { data, success } = await shopActivityItems({
...params,
sorter,
filter,
});
return {
data: data?.items || [],
total: data?.total,
success,
};
}}
columns={columns}
/>
</>
</PageContainer>
);
};

View File

@@ -0,0 +1,171 @@
import React, { useRef, useEffect, useState } from 'react';
import { Select, Space, Image, Button } from 'antd';
import {
PageContainer,
ProTable,
} from '@ant-design/pro-components';
export default () => {
const initRow = {
shop_id: '',
todate: '',
};
const initRowCancellationModal = {
username: "",
mobile: "",
code: ""
}
const [row, setRow] = useState(initRow);
const [rowCancellationModal, setRowCancellationModal] = useState(initRowCancellationModal);
const actionRef = useRef();
const [shopOption, setShopOption] = useState([]);
const [searchParams, setSearchParams] = useState(null);
const searchShop = (value) => {
shopItems({
username: value
}).then(({ data }) => {
const arr = [];
data?.data?.map((item) => {
item.label = `${item.username} ${item.mobile}`;
arr.push(item);
});
setShopOption(arr);
});
}
const columns = [
{
title: '活动名称',
dataIndex: 'title',
search: false,
},
{
title: '投资人',
dataIndex: 'shop_id',
render: (_, record) => {
return <>
<div>用户名{record?.shop?.username}</div>
<div>手机号{record?.shop?.mobile}</div>
</>
},
renderFormItem: (
_,
{ type, defaultRender, formItemProps, fieldProps, ...rest },
form,
) => {
return <Select
{...fieldProps}
allowClear
showSearch
placeholder="请输入用户名"
style={{ width: "100%" }}
filterOption={false}
onSearch={
(e) => {
if (!e) {
return;
}
searchShop(e);
}
}
fieldNames={{
label: "label",
value: "id"
}}
options={shopOption}
/>
},
},
{
title: '认领时间',
dataIndex: 'todate',
search: false,
},
{
title: '充电桩',
dataIndex: 'device',
search: false,
render: (_, record) => {
let ids = record?.device.map((item) => {
return item.id
})
return ids.join(',')
},
},
{
title: '创建时间',
dataIndex: 'created_at',
search: false,
}
];
return (
<PageContainer
ghost
>
<>
<ProTable
actionRef={actionRef}
rowKey="id"
search={{
defaultCollapsed: false,
}}
toolBarRender={() => [
// <AuthConsumer action={'admin/shop_activity/create'} key="admin/shop_activity/create">
// <Button
// type="primary"
// style={{ background: '#67c23a' }}
// onClick={() => {
// setCreateFormModal(true)
// }}
// >
// 添加
// </Button>
// </AuthConsumer>,
// <AuthConsumer action={'admin/shop_activity/export'} key="admin/shop_activity/export">
// <Button type="primary" onClick={() => {
// window.location.href = exportLink(searchParams, '/admin/shop_activity/export');
// }}>导出表格</Button>
// </AuthConsumer>,
// <AuthConsumer action={'admin/shop_activity/delete'} key="admin/shop_activity/delete">
// <Button
// danger
// type="primary"
// onClick={() => {
// setCancellationModal(true)
// }}
// >
// 作废
// </Button>
// </AuthConsumer>
]}
request={async (params, sorter, filter) => {
setSearchParams({ token: '', ...params });
const { data, success } = await shopActivityItems813({
...params,
sorter,
filter,
});
return {
data: data?.items || [],
total: data?.total,
success,
};
}}
columns={columns}
/>
</>
</PageContainer>
);
};

View File

@@ -0,0 +1,147 @@
import React, { useEffect, useState } from 'react';
import { contentcategoryPage } from '@/services/note/cate';
import {
ProForm,
ProFormDigit,
ProFormText,
ProFormDateTimePicker
} from '@ant-design/pro-components';
import { Form, Modal, InputNumber } from 'antd';
import { useIntl } from '@umijs/max';
import FilesManager from '@/components/FilesManage/index';
import { ContentUtils } from 'braft-utils'
// 引入编辑器组件
import BraftEditor from 'braft-editor'
// 引入编辑器样式
import 'braft-editor/dist/index.css'
const RoleForm: React.FC = (props: any) => {
const [editorState, setEditorState] = useState(BraftEditor.createEditorState(''))
const [form] = Form.useForm();
const { values } = props;
useEffect(() => {
setEditorState(BraftEditor.createEditorState(values.detail))
form.resetFields();
form.setFieldsValue(values);
}, [form, props]);
const intl = useIntl();
const handleOk = () => {
form.submit();
};
const handleCancel = () => {
props.onCancel();
};
const handleFinish = async (values: any) => {
values.detail = editorState.toHTML()
props.onSubmit(values);
};
const controls = [
'undo', 'redo', 'separator',
'font-size', 'line-height', 'letter-spacing', 'separator',
'text-color', 'bold', 'italic', 'underline', 'strike-through', 'separator',
'superscript', 'subscript', 'remove-styles', 'emoji', 'separator', 'text-indent', 'text-align', 'separator',
'headings', 'list-ul', 'list-ol', 'blockquote', 'code', 'separator',
'link', 'separator', 'hr', 'separator',
'clear'
]
const onChange = async (e) => {
const videoExtensions = ['.mp4', '.mkv', '.avi', '.mov', '.wmv', '.flv', '.webm', '.m4v', '.3gp', '.3g2'];
// 将URL转换为小写以便进行不区分大小写的比较
const lowerCaseUrl = e.toLowerCase();
// 检查链接是否以任何一个视频扩展名结尾
if (videoExtensions.some(e => lowerCaseUrl.endsWith(e))) {
setEditorState(ContentUtils.insertMedias(editorState, [{
type: 'VIDEO',
url: e
}]));
} else {
setEditorState(ContentUtils.insertMedias(editorState, [{ type: 'IMAGE', url: e, },]))
}
}
const extendControls = [
'separator',
{
key: 'FilesManagerImage', // 控件唯一标识,必传
title: '上传图片/视频', // 指定鼠标悬停提示文案
html: null, // 指定在按钮中渲染的html字符串
text: <FilesManager
fileType="images"
mode=""
imagesShow={false}
onChange={onChange}
count={1}
/>, // 指定按钮文字此处可传入jsx若已指定html则text不会显示
onClick: () => {
console.log('Hello World!');
},
}
]
return (
<Modal
width={800}
title={'公告管理'}
open={props.open}
forceRender
destroyOnClose
onOk={handleOk}
onCancel={handleCancel}
>
<ProForm
form={form}
submitter={false}
layout="horizontal"
onFinish={handleFinish}>
<ProFormDigit
name="id"
label={'ID'}
disabled
hidden={true}
/>
<ProForm.Group>
<ProFormText
name="title"
label={'标题'}
placeholder="请输入标题"
/>
</ProForm.Group>
<ProForm.Group>
<ProFormDateTimePicker
rules={[{ required: true, message: '请选择' }]}
name="startTime"
label="开始日期"
/>
<ProFormDateTimePicker
rules={[{ required: true, message: '请选择' }]}
name="endTime"
label="结束日期"
/>
</ProForm.Group>
<ProForm.Group>
<ProForm.Item
name="detail"
>
<div className="border-solid border-2 border-indigo-600">
<BraftEditor value={editorState} controls={controls} extendControls={extendControls} onChange={(val) => {
setEditorState(val)
}} />
</div>
</ProForm.Item>
</ProForm.Group>
</ProForm>
</Modal>
);
};
export default RoleForm;

View File

@@ -0,0 +1,227 @@
import { activityPage,deleteBatchByIds,activityAdd,activityUpdate } from '@/services/activity/index';
import React, { useState, useRef, useEffect } from 'react';
import { useIntl, FormattedMessage, useAccess } from '@umijs/max';
import { Button, message, Modal, Image } from 'antd';
import { ActionType, FooterToolbar, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
import { PlusOutlined, DeleteOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
import UpdateForm from './edit';
import { DataNode } from 'antd/es/tree';
/**
* 添加节点
*
* @param fields
*/
const handleAdd = async (fields) => {
const hide = message.loading('正在添加');
try {
fields.status = fields.status ? 0 : 1
await activityAdd({ ...fields });
hide();
message.success('添加成功');
return true;
} catch (error) {
hide();
return false;
}
};
/**
* 更新节点
*
* @param fields
*/
const handleUpdate = async (fields: API.System.Menu) => {
const hide = message.loading('正在修改');
try {
await activityUpdate(fields);
hide();
message.success('修改成功');
return true;
} catch (error) {
hide();
return false;
}
};
const handleRemoveOne = async (selectedRow: API.System.Menu) => {
const hide = message.loading('正在删除');
if (!selectedRow) return true;
try {
const params = [selectedRow.id];
await deleteBatchByIds(params);
hide();
message.success('删除成功');
return true;
} catch (error) {
hide();
message.error('删除失败,请重试');
return false;
}
};
const MenuTableList: React.FC = () => {
const [modalVisible, setModalVisible] = useState<boolean>(false);
const intRow = {
"id": 1,
"imageUrl": "",
"sortOrder": 0,
"status": 0,
"title": "",
"jumpUrl": ""
}
const actionRef = useRef<ActionType>();
const [currentRow, setCurrentRow] = useState(intRow);
const access = useAccess();
/** 国际化配置 */
const intl = useIntl();
useEffect(() => {
}, []);
const columns = [
{
title: 'ID',
dataIndex: 'id',
valueType: 'text',
search: false,
},
{
title: '标题',
dataIndex: 'title',
valueType: 'text',
search: true,
},
{
title: '开始时间',
dataIndex: 'startTime',
valueType: 'text',
search: false,
},
{
title: '结束时间',
dataIndex: 'endTime',
valueType: 'text',
search: false,
},
{
title: '创建时间',
dataIndex: 'createTime',
valueType: 'text',
search: false,
},
{
title: '操作',
dataIndex: 'option',
width: '220px',
valueType: 'option',
render: (_, record) => [
<Button
type="link"
size="small"
hidden={!access.hasPerms('admin/banner/update')}
onClick={() => {
setModalVisible(true);
setCurrentRow(record);
}}
>
</Button>,
<Button
type="link"
size="small"
danger
// hidden={!access.hasPerms('admin:banner:update')}
onClick={async () => {
Modal.confirm({
title: '删除',
content: '确定删除该项吗?',
okText: '确认',
cancelText: '取消',
onOk: async () => {
const success = await handleRemoveOne(record);
if (success) {
if (actionRef.current) {
actionRef.current.reload();
}
}
},
});
}}
>
</Button>,
],
},
];
return (
<PageContainer>
<div style={{ width: '100%', float: 'right' }}>
<ProTable<API.System.Menu>
actionRef={actionRef}
rowKey="id"
key="menuList"
search={{
labelWidth: 120,
}}
toolBarRender={() => [
<Button
type="primary"
key="add"
onClick={async () => {
setCurrentRow(undefined);
setModalVisible(true);
}}
>
<PlusOutlined />
</Button>
]}
request={async (params, sorter, filter) => {
let { data } = await activityPage(params)
return {
data: data?.records || [],
total: data?.total,
};
}}
columns={columns}
/>
</div>
<UpdateForm
onSubmit={async (values) => {
let success = false;
if (values.id) {
success = await handleUpdate({ ...values });
} else {
success = await handleAdd({ ...values });
}
if (success) {
setModalVisible(false);
setCurrentRow(undefined);
if (actionRef.current) {
actionRef.current.reload();
}
}
}}
onCancel={() => {
setModalVisible(false);
setCurrentRow(undefined);
}}
open={modalVisible}
values={currentRow || {}}
/>
</PageContainer>
);
};
export default MenuTableList;

View File

@@ -4,6 +4,9 @@ import { PageContainer, ProTable } from '@ant-design/pro-components';
import { Card, Col, Row, Statistic, Divider, Tag, Image } from 'antd';
import { ArrowDownOutlined, ArrowUpOutlined } from '@ant-design/icons';
import { statMallStatistics, getAmountAndGoodsCount } from '@/services/home/index'
import { Line } from '@ant-design/charts';
export default () => {
const [deviceData, setDeviceData] = useState([]);
const [profit, setProfit] = useState([]);
@@ -12,10 +15,12 @@ export default () => {
data: deviceData,
xField: 'name',
yField: 'value',
seriesField: 'category',
seriesField: 'type',
xAxis: {
type: 'time',
},
padding: 'auto',
legend: { position: 'right-top' },
yAxis: {
label: {
// 数值格式化为千分位
@@ -25,7 +30,29 @@ export default () => {
};
useEffect(() => {
statMallStatistics().then((res) => {
setProfit(res.data)
})
getAmountAndGoodsCount().then((res) => {
let list = []
res.data.map((item, index) => {
list.push({
"name": item.createTime,
"category": "商品数量",
"value": item.goodsCount,
"type": 1
})
list.push({
"name": item.createTime,
"category": "金额",
"value": item.amountCount,
"type": 2
})
})
setDeviceData(list)
})
}, []);
return (
@@ -79,7 +106,7 @@ export default () => {
<Card>
<Statistic
title="今天成交"
value={profit?.shop_count?.today}
value={profit?.todayTransaction}
precision={2}
prefix="¥"
/>
@@ -89,7 +116,7 @@ export default () => {
<Card>
<Statistic
title="昨天成交"
value={profit?.shop_count?.yesterday}
value={profit?.yesterdayTransaction}
precision={2}
prefix="¥"
/>
@@ -99,7 +126,7 @@ export default () => {
<Card>
<Statistic
title="上周成交"
value={profit?.shop_count?.week}
value={profit?.lastWeekTransaction}
precision={2}
prefix="¥"
/>
@@ -109,14 +136,15 @@ export default () => {
<Card>
<Statistic
title="上月成交"
value={profit?.shop_count?.month}
value={profit?.lastMonthTransaction}
precision={2}
prefix="¥"
/>
</Card>
</Col>
</Row>
{/* <Divider>商城(商品数量/金额)-折线图</Divider> */}
<Divider>(/)-线</Divider>
<Line {...deviceConfig} />
</>
);
};

View File

@@ -0,0 +1,43 @@
import { request } from '@umijs/max';
export async function activityPage(body) {
return request('/api/activity/findPage', {
method: 'POST',
headers: {
'contentcategory-Type': 'application/json;charset=UTF-8',
},
data: body || {},
});
}
export async function activityAdd(body) {
return request('/api/activity/add', {
method: 'POST',
headers: {
'contentcategory-Type': 'application/json;charset=UTF-8',
},
data: body || {},
});
}
export async function activityUpdate(body) {
return request('/api/activity/update', {
method: 'POST',
headers: {
'contentcategory-Type': 'application/json;charset=UTF-8',
},
data: body || {},
});
}
export async function deleteBatchByIds(body) {
return request('/api/activity/deleteBatchByIds', {
method: 'POST',
headers: {
'contentcategory-Type': 'application/json;charset=UTF-8',
},
data: body || {},
});
}

View File

@@ -0,0 +1,16 @@
import { request } from '@umijs/max';
export async function statMallStatistics(options?: {}) {
return request('/api/orders/statMallStatistics', {
method: 'GET',
...(options || {}),
});
}
export async function getAmountAndGoodsCount(options?: {}) {
return request('/api/orders/getAmountAndGoodsCount', {
method: 'GET',
...(options || {}),
});
}