Files
open-bi-refactor/p__MyChart__index.d57e3c35.async.js
T

2 lines
10 KiB
JavaScript
Raw Normal View History

2025-11-06 14:31:48 +08:00
"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[743],{90901:function(q,F,n){n.r(F);var C=n(15009),x=n.n(C),Z=n(99289),P=n.n(Z),z=n(97857),m=n.n(z),G=n(5574),T=n.n(G),R=n(73829),V=n(35312),B=n(2453),J=n(74467),L=n(4393),E=n(7134),O=n(29905),j=n(9276),l=n(67294),g=n(33076),t=n(85893),H=function(){var $={current:1,pageSize:4,sortField:"createTime",sortOrder:"desc"},U=(0,l.useState)(m()({},$)),W=T()(U,2),h=W[0],A=W[1],S=(0,V.useModel)("@@initialState"),I=S.initialState,K=I!=null?I:{},r=K.currentUser,a=(0,l.useState)(),_=T()(a,2),u=_[0],e=_[1],p=(0,l.useState)(0),b=T()(p,2),d=b[0],v=b[1],i=(0,l.useState)(!0),N=T()(i,2),X=N[0],Y=N[1],k=function(){var D=P()(x()().mark(function o(){var f,w,Q;return x()().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return Y(!0),s.prev=1,s.next=4,(0,R.MW)(h);case 4:f=s.sent,f.data?(e((w=f.data.records)!==null&&w!==void 0?w:[]),v((Q=f.data.total)!==null&&Q!==void 0?Q:0),f.data.records&&f.data.records.forEach(function(c){if(c.status==="succeed"){var y,ne=JSON.parse((y=c.genChart)!==null&&y!==void 0?y:"{}");ne.title=void 0,c.genChart=JSON.stringify(ne)}})):B.ZP.error("\u83B7\u53D6\u6211\u7684\u56FE\u8868\u5931\u8D25"),s.next=11;break;case 8:s.prev=8,s.t0=s.catch(1),B.ZP.error("\u83B7\u53D6\u6211\u7684\u56FE\u8868\u5931\u8D25\uFF0C"+s.t0.message);case 11:Y(!1);case 12:case"end":return s.stop()}},o,null,[[1,8]])}));return function(){return D.apply(this,arguments)}}();return(0,l.useEffect)(function(){k()},[h]),(0,t.jsxs)("div",{className:"my-chart-page",children:[(0,t.jsx)("div",{children:(0,t.jsx)(g.Z,{placeholder:"\u8BF7\u8F93\u5165\u56FE\u8868\u540D\u79F0",enterButton:!0,loading:X,onSearch:function(o){A(m()(m()({},$),{},{name:o}))}})}),(0,t.jsx)("div",{className:"margin-16"}),(0,t.jsx)(J.Z,{grid:{gutter:16,xs:1,sm:1,md:1,lg:2,xl:2,xxl:2},pagination:{onChange:function(o,f){A(m()(m()({},h),{},{current:o,pageSize:f}))},current:h.current,pageSize:h.pageSize,total:d},loading:X,dataSource:u,renderItem:function(o){var f;return(0,t.jsx)(J.Z.Item,{children:(0,t.jsxs)(L.Z,{style:{width:"100%"},children:[(0,t.jsx)(J.Z.Item.Meta,{avatar:(0,t.jsx)(E.C,{src:r&&r.userAvatar}),title:o.name,description:o.chartType?"\u56FE\u8868\u7C7B\u578B\uFF1A"+o.chartType:void 0}),(0,t.jsxs)(t.Fragment,{children:[o.status==="wait"&&(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(O.ZP,{status:"warning",title:"\u5F85\u751F\u6210",subTitle:(f=o.execMessage)!==null&&f!==void 0?f:"\u5F53\u524D\u56FE\u8868\u751F\u6210\u961F\u5217\u7E41\u5FD9\uFF0C\u8BF7\u8010\u5FC3\u7B49\u5019"})}),o.status==="running"&&(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(O.ZP,{status:"info",title:"\u56FE\u8868\u751F\u6210\u4E2D",subTitle:o.execMessage})}),o.status==="succeed"&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{style:{marginBottom:16}}),(0,t.jsx)("p",{children:"\u5206\u6790\u76EE\u6807\uFF1A"+o.goal}),(0,t.jsx)("div",{style:{marginBottom:16}}),(0,t.jsx)("p",{children:"\u5206\u6790\u7ED3\u8BBA\uFF1A"+o.genResult}),(0,t.jsx)(j.Z,{option:o.genChart&&JSON.parse(o.genChart)})]}),o.status==="failed"&&(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(O.ZP,{status:"error",title:"\u56FE\u8868\u751F\u6210\u5931\u8D25",subTitle:o.execMessage})})]})]})},o.id)}})]})};F.default=H},73829:function(q,F,n){n.d(F,{I6:function(){return g},MW:function(){return A},VG:function(){return j},bq:function(){return W}});var C=n(52677),x=n.n(C),Z=n(15009),P=n.n(Z),z=n(97857),m=n.n(z),G=n(99289),T=n.n(G),R=n(35312);function V(r,a){return B.apply(this,arguments)}function B(){return B=_asyncToGenerator(_regeneratorRuntime().mark(function r(a,_){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",request("/api/chart/add",_objectSpread({method:"POST",headers:{"Content-Type":"application/json"},data:a},_||{})));case 1:case"end":return e.stop()}},r)})),B.apply(this,arguments)}function J(r,a){return L.apply(this,arguments)}function L(){return L=_asyncToGenerator(_regeneratorRuntime().mark(function r(a,_){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abr