Files
open-bi-refactor/p__AddChart__index.80eff442.async.js
T

2 lines
8.2 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([[318],{63089:function(S,c,e){e.r(c);var f=e(15009),C=e.n(f),I=e(97857),d=e.n(I),W=e(99289),h=e.n(W),K=e(5574),E=e.n(K),g=e(73829),$=e(88484),O=e(2453),w=e(71230),D=e(15746),F=e(4393),p=e(98138),L=e(74482),M=e(34041),Z=e(72708),P=e(10932),N=e(78957),T=e(74330),V=e(96074),v=e(22913),y=e(67294),R=e(9276),t=e(85893),A=function(){var b,a=(0,y.useState)(),r=E()(a,2),_=r[0],s=r[1],n=(0,y.useState)(),i=E()(n,2),B=i[0],l=i[1],m=(0,y.useState)(!1),u=E()(m,2),U=u[0],z=u[1],Y=function(){var k=h()(C()().mark(function H(x){var Q,j,J,G;return C()().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(!U){o.next=2;break}return o.abrupt("return");case 2:return z(!0),s(void 0),l(void 0),Q=d()(d()({},x),{},{file:void 0}),o.prev=6,o.next=9,(0,g.VG)(Q,{},x.file.file.originFileObj);case 9:if(j=o.sent,j!=null&&j.data){o.next=14;break}O.ZP.error("\u5206\u6790\u5931\u8D25"),o.next=22;break;case 14:if(O.ZP.success("\u5206\u6790\u6210\u529F"),G=JSON.parse((J=j.data.genChart)!==null&&J!==void 0?J:""),G){o.next=20;break}throw new Error("\u56FE\u8868\u4EE3\u7801\u89E3\u6790\u9519\u8BEF");case 20:s(j.data),l(G);case 22:o.next=27;break;case 24:o.prev=24,o.t0=o.catch(6),O.ZP.error("\u5206\u6790\u5931\u8D25\uFF0C"+o.t0.message);case 27:z(!1);case 28:case"end":return o.stop()}},H,null,[[6,24]])}));return function(x){return k.apply(this,arguments)}}();return(0,t.jsx)("div",{className:"add-chart",children:(0,t.jsxs)(w.Z,{gutter:24,children:[(0,t.jsx)(D.Z,{span:12,children:(0,t.jsx)(F.Z,{title:"\u667A\u80FD\u5206\u6790",children:(0,t.jsxs)(p.Z,{name:"addChart",labelAlign:"left",labelCol:{span:4},wrapperCol:{span:16},onFinish:Y,initialValues:{},children:[(0,t.jsx)(p.Z.Item,{name:"goal",label:"\u5206\u6790\u76EE\u6807",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5206\u6790\u76EE\u6807"}],children:(0,t.jsx)(v.Z,{placeholder:"\u8BF7\u8F93\u5165\u4F60\u7684\u5206\u6790\u9700\u6C42\uFF0C\u6BD4\u5982\uFF1A\u5206\u6790\u7F51\u7AD9\u7528\u6237\u7684\u589E\u957F\u60C5\u51B5"})}),(0,t.jsx)(p.Z.Item,{name:"name",label:"\u56FE\u8868\u540D\u79F0",children:(0,t.jsx)(L.Z,{placeholder:"\u8BF7\u8F93\u5165\u56FE\u8868\u540D\u79F0"})}),(0,t.jsx)(p.Z.Item,{name:"chartType",label:"\u56FE\u8868\u7C7B\u578B",children:(0,t.jsx)(M.Z,{options:[{value:"\u6298\u7EBF\u56FE",label:"\u6298\u7EBF\u56FE"},{value:"\u67F1\u72B6\u56FE",label:"\u67F1\u72B6\u56FE"},{value:"\u5806\u53E0\u56FE",label:"\u5806\u53E0\u56FE"},{value:"\u997C\u56FE",label:"\u997C\u56FE"},{value:"\u96F7\u8FBE\u56FE",label:"\u96F7\u8FBE\u56FE"}]})}),(0,t.jsx)(p.Z.Item,{name:"file",label:"\u539F\u59CB\u6570\u636E",children:(0,t.jsx)(Z.Z,{name:"file",maxCount:1,children:(0,t.jsx)(P.ZP,{icon:(0,t.jsx)($.Z,{}),children:"\u4E0A\u4F20 Excel \u6587\u4EF6"})})}),(0,t.jsx)(p.Z.Item,{wrapperCol:{span:16,offset:4},children:(0,t.jsxs)(N.Z,{children:[(0,t.jsx)(P.ZP,{type:"primary",htmlType:"submit",loading:U,disabled:U,children:"\u63D0\u4EA4"}),(0,t.jsx)(P.ZP,{htmlType:"reset",children:"\u91CD\u7F6E"})]})})]})})}),(0,t.jsxs)(D.Z,{span:12,children:[(0,t.jsxs)(F.Z,{title:"\u5206\u6790\u7ED3\u8BBA",children:[(b=_==null?void 0:_.genResult)!==null&&b!==void 0?b:(0,t.jsx)("div",{children:"\u8BF7\u5148\u5728\u5DE6\u4FA7\u8FDB\u884C\u63D0\u4EA4"}),(0,t.jsx)(T.Z,{spinning:U})]}),(0,t.jsx)(V.Z,{}),(0,t.jsxs)(F.Z,{title:"\u53EF\u89C6\u5316\u56FE\u8868",children:[B?(0,t.jsx)(R.Z,{option:B}):(0,t.jsx)("div",{children:"\u8BF7\u5148\u5728\u5DE6\u4FA7\u8FDB\u884C\u63D0\u4EA4"}),(0,t.jsx)(T.Z,{spinning:U})]})]})]})})};c.default=A},73829:function(S,c,e){e.d(c,{I6:function(){return Z},MW:function(){return t},VG:function(){return L},bq:function(){return y}});var f=e(52677),C=e.n(f),I=e(15009),d=e.n(I),W=e(97857),h=e.n(W),K=e(99289),E=e.n(K),g=e(35312);function $(a,r){return O.apply(this,arguments)}function O(){return O=_asyncToGenerator(_regeneratorRuntime().mark(function a(r,_){return _regeneratorRuntime().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",request("/api/chart/add",_objectSpread({method:"POST",headers:{"Content-Type