!function(){functione(t){returne="function"==typeofSymbol&&"symbol"==typeofSymbol.iterator?function(e){returntypeofe}:function(e){returne&&"function"==typeofSymbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeofe},e(t)}functiont(e){returnfunction(e){if(Array.isArray(e))returnr(e)}(e)||function(e){if("undefined"!=typeofSymbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])returnArray.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeofe)returnr(e,t);varn=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)returnArray.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))returnr(e,t)}(e)||function(){thrownewTypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}functionr(e,t){(null==t||t>e.length)&&(t=e.length);for(varr=0,n=newArray(t);r<t;r++)n[r]=e[r];returnn}functionn(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */n=function(){returnt};vart={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeofSymbol?Symbol:{},s=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";functionl(e,t,r){returnObject.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(j){l=function(e,t,r){returne[t]=r}}functionh(e,t,r,n){varo=t&&t.prototypeinstanceofd?t:d,a=Object.create(o.prototype),s=newP(n||[]);returni(a,"_invoke",{value:S(e,r,s)}),a}functionf(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(j){return{type:"throw",arg:j}}}t.wrap=h;varp={};functiond(){}functionv(){}functiony(){}varm={};l(m,s,(function(){returnthis}));varg=Object.getPrototypeOf,w=g&&g(g(k([])));w&&w!==r&&o.call(w,s)&&(m=w);varb=y.prototype=d.prototype=Object.create(m);functionx(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){returnthis._invoke(t,e)}))}))}functionC(t,r){functionn(i,a,s,c){varu=f(t[i],t,a);if("throw"!==u.type){varl=u.arg,h=l.value;returnh&&"object"==e(h)&&o.call(h,"__await")?r.resolve(h.__await).then((function(e){n("next",e,s,c)}),(function(e){n("throw",e,s,c)})):r.resolve(h).then((function(e){l.value=e,s(l)}),(function(e){returnn("throw",e,s,c)}))}c(u.arg)}vara;i(this,"_invoke",{value:function(e,t){functiono(){returnnewr((function(r,o){n(e,t,r,o)}))}returna=a?a.then(o,o):o()}})}functionS(e,t,r){varn="suspendedStart";returnfunction(o,i){if("executing"===n)thrownewError("Generator is already running");if("completed"===n){if("throw"===o)throwi;returnA()}for(r.method=o,r.arg=i;;){vara=r.delegate;if(a){vars=O(a,r);if(s){if(s===p)continue;returns}}if("next"===r.method)r.sent=r._sent=r.arg;elseif("throw"===r.method){if("suspendedStart"===n)thrown="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";varc=f(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}functionO(e,t){varr=t.method,n=e.iterator[r];if(void0===n)returnt.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void0,O(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=newTypeError("The iterator does not provide a '"+r+"' method")),p;varo=f(n,e.iterator,t.arg);if("throw"===o.type)returnt.method="throw",t.arg=o.arg,t.delegate=null,p;vari=o.arg;returni?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void0),t.delegate=null,p):i:(t.method="throw",t.arg=newTypeError("iterator result is not an object"),t.delegate=null,p)}functionL(e){vart={tryLoc:e[0]};1ine&&(t.catchLoc=e[1]),2ine&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}functionE(e){vart=e.completion||{};t.type="normal",deletet.arg,e.completion=t}functionP(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}functionk(e){if(e){vart=e[s];if(t)returnt.call(e);if("function"==typeofe.next)returne;if(!isNaN(e.length)){varr=-1,n=functiont(){for(;++r<e.length;)if(o.call(e,r))returnt.value=e[r],t.done=!1,t;returnt.value=void0,t.done=!0,t};returnn.next=n}}return{next:A}}functionA(){return{value:void0,done:!0}}returnv.prototype=y,i(b,"constructor",{value:y,configurable:!0}),i(y,"constructor",{value:v,configurable:!0}),v.displayName=l(y,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){vart="function"==typeofe&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){returnObject.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,l(e,u,"GeneratorFunction")),e.prototype=Object.create(b),e},t.awrap=function(e){return{__await:e}},x(C.prototype),l(C.prototype,c,(function(){returnthis})),t.AsyncIterator=C,t.async=function(e,r,n,o,i){void0===i&&(i=Promise);vara=newC(h(e,r,n,o),i);returnt.isGeneratorFunction(r)?a:a.next().then((function(e){returne.done?e.value:a.next()}))},x(b),l(b,u,"Generator"),l(b,s,(function(){returnthis})),l(b,"toString",(function(){return"[object Generator]"})),t.keys=function(e){vart=Object(e),r=[];for(varnint)r.push(n);returnr.reverse(),functione(){for(;r.length;){varn=r.pop();if(nint)returne.value=n,e.done=!1,e}returne.done=!0,e}},t.values=k,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void0,this.done=!1,this.delegate=null,this.method="next",this.arg=void0,this.tryEntries.forEach(E),!e)for(vartinthis)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void0)},stop:function(){this.done=!0;vare=this.tryEntries[0].completion;if("throw"===e.type)throwe.arg;returnthis.rval},dispatchException:function(e){if(this.done)throwe;vart=this;functionr(r,n){returna.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void0),!!n}for(varn=this.tryEntries.length-1;n>=0;--n){vari=this.tryEntries[n],a=i.completion;if("root"===i.tryLoc)returnr("end");if(i.tryLoc<=this.prev){vars=o.call(i,"catchLoc"),c=o.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)returnr(i.catchLoc,!0);if(this.prev<i.finallyLoc)returnr(i.finallyLoc)}elseif(s){if(this.prev<i.catchLoc)returnr(i.catchLoc,!0)}else{if(!c)thrownewError("try statement without catch or finally");if(this.prev<i.finallyLoc)returnr(i.finallyLoc)}}}},abrupt:function(e,t){for(varr=this.tryEntries.length-1;r>=0;--r){varn=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){vari=n;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);vara=i?i.completion:{};returna.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(a)},complete:function(e,t){if("throw"===e.type)throwe.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(vart=this.tryEntries.length-1;t>=0;--t){varr=this.tryEntries[t];if(r.finallyLoc===e)returnthis.complete(r.completion,r.afterLoc),E(r),p}},catch:function(e){for(vart=this.tryEntries.length-1;t>=0;--t){varr=this.tryEntries[t];if(r.tryLoc===e){varn=r.completion;if("throw"===n.type){varo=n.arg;E(r)}returno}}thrownewError("illegal catch attempt")},delegateYield:function(e,t,r){returnthis.delegate={iterator:k(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void0),p}},t}functiono(e,t,r,n,o,i,a){try{vars=e[i](a),c=s.value}catch(u){returnvoidr(u)}s.done?t(c):Promise.resolve(c).then(n,o)}functioni(e){returnfunction(){vart=this,r=arguments;returnnewPromise((function(n,i){vara=e.apply(t,r);functions(e){o(a,n,i,s,c,"next",e)}functionc(e){o(a,n,i,s,c,"throw",e)}s(void0)}))}}functiona(e,t){varr=Object.keys(e);if(Object.getOwnPropertySymbols){varn=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){returnObject.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}returnr}functions(e){for(vart=1;t<arguments.length;t++){varr=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){c(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}returne}functionc(e,t,r){return(t=f(t))ine?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}functionu(){returnu="undefined"!=typeofReflect&&Reflect.get?Reflect.get.bind():function(e,t,r){varn=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=g(e)););returne}(e,t);if(n){varo=Object.getOwnPropertyDescriptor(n,t);returno.get?o.get.call(arguments.length<3?e:r):o.value}},u.apply(this,arguments)}functionl(e,t){for(varr=0;r<t.length;r++){varn=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"inn&&(n.writable=!0),Object.defineProperty(e,f(n.key),n)}}functionh(e,t,r){returnt&&l(e.prototype,t),r&&l(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}functionf(t){varr=function(t,r){if("object"!==e(t)||null===t)returnt;varn=t[Symbol.toPrimitive];if(void0!==n){varo=n.call(t,r||"default");if("object"!==e(o))returno;thrownewTypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"===e(r)?r:String(r)}functionp(e,t){if(!(einstanceoft))thrownewTypeError("Cannot call a class as a function")}functiond(e,t){if("function"!=typeoft&&null!==t)thrownewTypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&v(e,t)}functionv(e,t){returnv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){returne.__proto__=t,e},v(e,t)}functiony(t){varr=function(){if("undefined"==typeofReflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeofProxy)return!0;try{returnBoolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();returnfunction(){varn,o=g(t);if(r){vari=g(this).constructor;n=Reflect.construct(o,arguments,i)}elsen=o.apply(this,arguments);returnfunction(t,r){if(r&&("object"===e(r)||"function"==typeofr))returnr;if(void0!==r)thrownewTypeError("Derived constructors may only return object or undefined");returnm(t)}(this,n)}}functionm(e){if(void0===e)thrownewReferenceError("this hasn't been initialised - super() hasn't been called");returne}functiong(e){returng=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){returne.__proto__||Object.getPrototypeOf(e)},g(e)}System.register(["@ibiz-template/vue-util","@ibiz-template/controller","qx-util","echarts","ramda","@ibiz-template/service"],(function(e,r){"use strict";varo,a,l,f,v,w,b,x;return{setters:[function(e){o=e.useControlController},function(e){a=e.Neuron,l=e.ControlNerve,f=e.ControlController},function(e){v=e.createUUID},function(e){w=e.init},function(e){b=e.mergeDeepRight},function(e){x=e.ControlService}],execute:function(){e("u",(function(e,t,r){varn=arguments.length>3&&void0!==arguments[3]?arguments[3]:{};returno(e,(function(){returnnewE(t,r,n)}))}));varr=function(e){d(r,e);vart=y(r);functionr(){returnp(this,r),t.apply(this,arguments)}returnh(r)}(a),C=function(e){d(n,e);vart=y(n);functionn(){returnp(this,n),t.apply(this,arguments)}returnh(n,[{key:"createNeuron",value:function(){returnnewr(this.bindAbility())}},{key:"bindAbility",value:function(){returns(s({},u(g(n.prototype),"bindAbility",this).call(this)),{},{load:this.controller.load.bind(this.controller)})}}]),n}(l);functionS(e){vart={};returne&&Object.keys(e).forEach((function(r){varn=r.indexOf(".");if(-1!==n){varo=r.slice(n+1);if(o&&void0!==e[r])try{t[o]=JSON.parse(e[r])}catch(i){ibiz.log.error("".concat(o," 解析错误"))}}})),t}functionO(e){return{axisLabel:{formatter:function(t){return1===e?t.length>4?"".concat(t.slice(0,4).split("").join("\n"),"\n..."):t.split("").join("\n"):2===e&&t.length>4?"".concat(t.slice(0,4),"..."):t},rotate:2===e?45:0}}}varL=function(e){d(l,e);varr,o,a,u=y(l);functionl(e){vart;p(this,l),c(m(t=u.call(this,e)),"seriesList",[]);varr=e.source.getPSDEChartSerieses();if(!r||!r.length)thrownewError("图表序列集合不能为空");returnt.seriesList=r,t}returnh(l,[{key:"fetch",value:(a=i(n().mark((functione(t){varr,o,i=arguments;returnn().wrap((function(e){for(;;)switch(e.prev=e.next){case0:returnr=i.length>1&&void0!==i[1]?i[1]:{},e.next=3,this.exec(this.model.fetchAction,t,r);case3:returno=e.sent,e.abrupt("return",o);case5:case"end":returne.stop()}}),e,this)}))),function(e){returna.apply(this,arguments)})},{key:"getAllCodeListMap",value:(o=i(n().mark((functione(t,r){varo;returnn().wrap((function(e){for(;;)switch(e.prev=e.next){case0:returno=[],e.next=3,Promise.all(this.seriesList.map(function(){vare=i(n().mark((functione(i,a){vars,c,u,l,h,f,p,d,v,y,m;returnn().wrap((function(e){for(;;)switch(e.prev=e.next){case0:if(h={},f=null===(s=i.getCatalogPSCodeList)||void0===s||null===(c=s.call(i))||void0===c?void0:c.codeName,p=null===(u=i.getSeriesPSCodeList)||void0===u||null===(l=u.call(i))||void0===l?void0:l.codeName,!f){e.next=8;break}returne.next=6,ibiz.codeListService.get(f,t,r);case6:(d=e.sent)&&(v=newMap,d.forEach((function(e){v.set(e.value,e.text)})),h.catalog=v);case8:if(!p){e.next=13;break}returne.next=11,ibiz.codeListService.get(p,t,r);case11:(y=e.sent)&&(m=newMap,y.forEach((function(e){m.set(e.value,e.text)})),h.series=m);case13:o[a]=h;case14:case"end":returne.stop()}}),e)})));returnfunction(t,r){returne.apply(this,arguments)}}()));case3:returne.abrupt("return",o);case4:case"end":returne.stop()}}),e,this)}))),function(e,t){returno.apply(this,arguments)})},{key:"generateDatasetOption",value:function(e,r,n){varo,i={},a=[];i.source=a;vars=e.catalogField.toLowerCase(),c=e.valueField.toLowerCase(),u=null===(o=e.seriesField)||void0===o?void0:o.toLowerCase();if(u){varl=newSet;r.forEach((function(e){l.add(e[u])})),a.push([s].concat(t(l)))}elsea.push([s,c]);a.push.apply(a,t(r.map((function(e){returna[0].map((function(t,r){return0===r?(n&&n.catalog?n.catalog.get(e[t]):e[t])||"未定义":u?t===e[u]&&e[c]||0:e[c]||0}))})))),n&&n.series&&(a[0]=a[0].map((function(e,t){varr;return0===t?e:(null===(r=n.series)||void0===r?void0:r.get(e))||e})));for(varh=function(e){for(vart=e+1;t<a.length;t++)a[t][0]===a[e][0]&&(a[t].forEach((function(t,r){0!==r&&(a[e][r]+=t)})),a.splice(t,1),t-=1)},f=1;f<a.length;f++)h(f);returni}},{key:"generateChartOption",value:(r=i(n().mark((functione(r,o,i){vara,s,c=this;returnn().wrap((function(e){for(;;)switch(e.prev=e.next){case0:return(a={}).dataset=[],a.series=[],e.next=5,this.getAllCodeListMap(o,i);case5:returns=e.sent,this.seriesList.forEach((function(e,n){if("radar"!==e.eChartsType){varo=c.generateDatasetOption(e,r,s[n]);if(Array.isArray(a.dataset)&&a.dataset.push(o),"bar"===e.eChartsType){vari,u=c.generateBarSeriesOption(e,r,s[n],n);Array.isArray(a.series)&&(i=a.series).push.apply(i,t(u))}elseif("line"===e.eChartsType){varl,h=c.generateLineSeriesOption(e,r,s[n],n);Array.isArray(a.series)&&(l=a.series).push.apply(l,t(h))}elseif("pie"===e.eChartsType){varf,p=c.generatePieSeriesOption(e,r,s[n],n);Array.isArray(a.series)&&(f=a.series).push.apply(f,t(p))}elseif("funnel"===e.eChartsType){vard,v=c.generateFunnelSeriesOption(e,r,s[n],n);Array.isArray(a.series)&&(d=a.series).push.apply(d,t(v))}else{if("scatter"!==e.eChartsType)thrownewError("".concat(e.eChartsType,"类型的图表暂未实现"));vary,m=c.generateScatterSeriesOption(e,r,s[n],n);Array.isArray(a.series)&&(y=a.series).push.apply(y,t(m))}}else{varg,w=c.generateRadarSeriesOption(e,r,s[n]),b=w.series,x=w.radar;Array.isArray(a.series)&&(g=a.series).push.apply(g,t(b)),a.radar=x}})),e.abrupt("return",a);case8:case"end":returne.stop()}}),e,this)}))),function(e,t,n){returnr.apply(this,arguments)})},{key:"generateBarSeriesOption",value:function(e,r,n,o){vari,a,c,u,l,h,f,p=[],d=e.eChartsType,v=e.catalogField.toLowerCase(),y=e.valueField.toLowerCase(),m=null===(i=e.seriesField)||void0===i?void0:i.toLowerCase(),g=+(null===(a=e.M)||void0===a||null===(c=a.getPSChartSeriesEncode)||void0===c||null===(u=c.getPSChartXAxis)||void0===u?void0:u.id)||0,w=+(null===(l=e.M)||void0===l||null===(h=l.getPSChartSeriesEncode)||void0===h||null===(f=h.getPSChartYAxis)||void0===f?void0:f.id)||0,x={};if(m){varC=newSet;r.forEach((function(e){vart=e[m];C.add(n&&n.series&&n.series.get(t)||t)})),p.push.apply(p,t(t(C).map((function(t){returns({type:d,xAxisIndex:g,yAxisIndex:w,name:t,datasetIndex:o,encode:{x:v,y:t}},b(x,S(e.userParams)))}))))}elsep.push(s({type:d,xAxisIndex:g,yAxisIndex:w,name:e.caption||e.id,datasetIndex:o,encode:{x:v,y:y}},b(x,S(e.userParams))));returnp}},{key:"generateLineSeriesOption",value:function(e,r,n,o){vari,a,c,u,l,h,f,p=[],d=e.eChartsType,v=e.catalogField.toLowerCase(),y=e.valueField.toLowerCase(),m=null===(i=e.seriesField)||void0===i?void0:i.toLowerCase(),g=+(null===(a=e.M)||void0===a||null===(c=a.getPSChartSeriesEncode)||void0===c||null===(u=c.getPSChartXAxis)||void0===u?void0:u.id)||0,w=+(null===(l=e.M)||void0===l||null===(h=l.getPSChartSeriesEncode)||void0===h||null===(f=h.getPSChartYAxis)||void0===f?void0:f.id)||0,x={emphasis:{label:{fontSize:20,show:!0}},label:{position:"top",show:!0}};if(m){varC=newSet;r.forEach((function(e){vart=e[m];C.add(n&&n.series&&n.series.get(t)||t)})),p.push.apply(p,t(t(C).map((function(t){returns({type:d,xAxisIndex:g,yAxisIndex:w,name:t,datasetIndex:o,encode:{x:v,y:t},stack:e.M.stack?e.id:void0,step:!!e.M.step&&"middle"},b(x,S(e.userParams)))}))))}elsep.push(s({type:d,xAxisIndex:g,yAxisIndex:w,name:e.caption||e.id,datasetIndex:o,encode:{x:v,y:y}},b(x,S(e.userParams))));returnp}},{key:"generatePieSeriesOption",value:function(e,r,n,o){vari,a=[],c=e.eChartsType,u=e.catalogField.toLowerCase(),l=e.valueField.toLowerCase(),h=null===(i=e.seriesField)||void0===i?void0:i.toLowerCase(),f={emphasis:{label:{fontSize:20,show:!0}},label:{formatter:"{b}: {d}%({@age})",position:"outside",show:!0}};if(h){varp=newSet;r.forEach((function(e){vart=e[h];p.add(n&&n.series&&n.series.get(t)||t)})),a.push.apply(a,t(t(p).map((function(t){returns({type:c,name:t,datasetIndex:o,encode:{itemName:u,value:t}},b(f,S(e.userParams)))}))))}elsea.push(s({type:c,name:e.caption||e.id,datasetIndex:o,encode:{itemName:u,value:l}},b(f,S(e.userParams))));returna}},{key:"generateFunnelSeriesOption",value:function(e,r,n,o){vari,a=[],c=e.eChartsType,u=e.catalogField.toLowerCase(),l=e.valueField.toLowerCase(),h=null===(i=e.seriesField)||void0===i?void0:i.toLowerCase(),f={emphasis:{label:{fontSize:20,show:!0}},label:{formatter:"{b}: {d}%({@age})",position:"outside",show:!0}};if(h){varp=newSet;r.forEach((function(e){vart=e[h];p.add(n&&n.series&&n.series.get(t)||t)})),a.push.apply(a,t(t(p).map((function(t){returns({type:c,name:t,datasetIndex:o,encode:{itemName:u,value:t}},b(f,S(e.userParams)))}))))}elsea.push(s({type:c,name:e.caption||e.id,datasetIndex:o,encode:{itemName:u,value:l}},b(f,S(e.userParams))));returna}},{key:"generateScatterSeriesOption",value:function(e,r,n,o){vari,a=[],c=e.eChartsType,u=e.catalogField.toLowerCase(),l=e.valueField.toLowerCase(),h=null===(i=e.seriesField)||void0===i?void0:i.toLowerCase(),f={emphasis:{label:{fontSize:20,show:!0}},label:{position:"top",show:!0}};if(h){varp=newSet;r.forEach((function(e){vart=e[h];p.add(n&&n.series&&n.series.get(t)||t)})),a.push.apply(a,t(t(p).map((function(t){returns({type:c,name:t,datasetIndex:o,encode:{x:u,y:t}},b(f,S(e.userParams)))}))))}elsea.push(s({type:c,name:e.caption||e.id,datasetIndex:o,encode:{x:u,y:l}},b(f,S(e.userParams))));returna}},{key:"generateRadarSeriesOption",value:function(e,r,n){varo,i=[],a=[],c=e.eChartsType,u=e.catalogField.toLowerCase(),l=e.valueField.toLowerCase(),h=null===(o=e.seriesField)||void0===o?void0:o.toLowerCase();if(h){varf=newSet;r.forEach((function(e){f.add(e[h])})),a.push([u].concat(t(f)))}elsea.push([u,l]);a.push.apply(a,t(r.map((function(e){returna[0].map((function(t,r){return0===r?(n&&n.catalog?n.catalog.get(e[t]):e[t])||"未定义":h?t===e[h]?e[l]:0:e[l]}))})))),n&&n.series&&(a[0]=a[0].map((function(e,t){varr;return0===t?e:(null===(r=n.series)||void0===r?void0:r.get(e))||e})));for(varp=function(e){for(vart=e+1;t<a.length;t++)a[t][0]===a[e][0]&&(a[t].forEach((function(t,r){0!==r&&(a[e][r]+=t)})),a.splice(t,1),t-=1)},d=1;d<a.length;d++)p(d);varv=a[0].slice(1).map((function(e,t){returna.slice(1).map((function(e){returne[t+1]}))}));i.push(s({type:c,name:e.caption||e.id,data:v},b({emphasis:{label:{fontSize:20,show:!0}},label:{position:"top",show:!0}},S(e.userParams))));vary=-1/0;returnv.forEach((function(e){e.forEach((function(e){+e>y&&(y=+e)}))})),{series:i,radar:{indicator:a.slice(1).map((function(e){return{name:e[0],max:y}}))}}}}]),l}(x),E=function(e){d(a,e);vart,r,o=y(a);functiona(){vare;p(this,a);for(vart=arguments.length,r=newArray(t),n=0;n<t;n++)r[n]=arguments[n];returnc(m(e=o.call.apply(o,[this].concat(r))),"chart",null),c(m(e),"chartId","chart_".concat(v())),c(m(e),"chartStaticOption",{}),c(m(e),"hook",void0),c(m(e),"loadHook",void0),c(m(e),"items",[]),c(m(e),"queryParams",{page:0,size:1e3,query:""}),c(m(e),"width","100%"),c(m(e),"height","100%"),e}returnh(a,[{key:"createNerve",value:function(){returnnewC(this)}},{key:"onInit",value:(r=i(n().mark((functione(){vart,r,o;returnn().wrap((function(e){for(;;)switch(e.prev=e.next){case0:returne.next=2,u(g(a.prototype),"onInit",this).call(this);case2:returnthis.service=newL(this.model),e.next=5,this.service.init(this.context);case5:this.initChartStaticOption(),this.resizeChart=this.resizeChart.bind(this),window.addEventListener("resize",this.resizeChart),t=this.model.source,r=t.width,o=t.height,r&&(this.width="".concat(r,"px")),o&&(this.height="".concat(o,"px"));case11:case"end":returne.stop()}}),e,this)}))),function(){returnr.apply(this,arguments)})},{key:"resizeChart",value:function(){vare;null===(e=this.chart)||void0===e||e.resize()}},{key:"initChartStaticOption",value:function(){vare={},t=this.model.source.getPSDEChartTitle();e.title=t?function(e){vart={};if(e){varr;t.show=e.showTitle,t.text=e.title,t.subtext=e.subTitle;varn=null===(r=e.titlePos)||void0===r?void0:r.toLowerCase();"left"===n||"right"===n?t.left=n:"bottom"!==n&&"top"!==n||(t.left="center",t.top=n)}returnt}(t):{},e.tooltip={show:!0};varr=this.model.source.getPSDEChartSerieses();r&&r.length&&"bar"===r[0].eChartsType&&(e.tooltip={show:!0,padding:0,backgroundColor:"rgba(255, 255, 255, 0)",borderWidth:0,className:"chart-tooltip",borderRadius:6,extraCssText:"box-shadow: none;",trigger:"axis",axisPointer:{type:"shadow"},appendToBody:!0,formatter:function(e){vart=e,r=document.createElement("div");if(r.classList.add("chart-tooltip-container"),Array.isArray(e)){varn=[],o=newMap;t.forEach((function(e){vart=e.seriesName,r=e.dimensionNames;r.slice(1).forEach((function(i,a){vars=2===r.length?t:i,c=e.value[a+1];o.has(s)||(n.push({x:s,y:c}),o.set(s,c))}))}));vari=document.createElement("div");returni.classList.add("chart-tooltip-title"),i.textContent=t[0].value[0],r.appendChild(i),n.forEach((function(e){vart=document.createElement("div");t.classList.add("chart-tooltip-item");varn=document.createElement("div");n.classList.add("chart-tooltip-item-name"),n.textContent=e.x,t.appendChild(n);varo=document.createElement("div");o.classList.add("chart-tooltip-item-number"),o.textContent=e.y,t.appendChild(o),r.appendChild(t)})),r}returnr}});varn=this.model.source.getPSDEChartLegend();e.legend=n?function(e){vart={};if(e){varr;t.show=e.showLegend;varn=null===(r=e.legendPos)||void0===r?void0:r.toLowerCase();"left"===n||"right"===n?(t.left=n,t.top="middle",t.orient="vertical"):"bottom"===n&&(t.top=n)}returnt}(n):{};varo=this.model.source.getPSChartXAxises();e.xAxis=o?function(e){vart=[];returne&&e.length&&e.forEach((function(e){varr=e.caption,n=e.minValue,o=e.maxValue,i=e.eChartsType,a=e.position,c={name:r,min:n,max:o};Object.assign(c,s({type:i,position:a},b(O(e.dataShowMode),S(e.userParams)))),t.push(c)})),t}(o):[];vari=this.model.source.getPSChartYAxises();e.yAxis=i?function(e){vart=[];returne&&e.length&&e.forEach((function(e){varr=e.caption,n=e.minValue,o=e.maxValue,i=e.eChartsType,a=e.position,c={name:r,min:n,max:o};Object.assign(c,s({type:i,position:a},b(O(e.dataShowMode),S(e.userParams)))),t.push(c)})),t}(i):[],Object.assign(this.chartStaticOption,b(e,S(this.model.source.userParams)))}},{key:"registerHook",value:function(e){this.hook=e}},{key:"registerLoadHook",value:function(e){this.loadHook=e}},{key:"load",value:(t=i(n().mark((functione(){vart,r,o,i,a,c,u;returnn().wrap((function(e){for(;;)switch(e.prev=e.next){case0:returne.next=2,this.startLoading();case2:returne.prev=2,e.next=5,this.service.fetch(this.context,s(s({},this.params),this.queryParams));case5:if(t=e.sent,r=t.data,r=this.loadHook?this.loadHook(r):r,!Array.isArray(r)||!r.length){e.next=27;break}if(this.items=r,this.chart){e.next=15;break}if(o=document.querySelector("#".concat(this.chartId))){e.next=14;break}thrownewError("未找到ECharts绘制容器元素");case14:this.chart=w(o);case15:returne.next=17,this.service.generateChartOption(r,this.context,this.params);case17:if(i=e.sent,a=b(this.chartStaticOption,i),c=a,!this.hook){e.next=24;break}returne.next=23,this.hook(a);case23:c=e.sent;case24:this.chart.setOption(c),e.next=29;break;case27:this.items=[],null===(u=this.chart)||void0===u||u.clear();case29:returne.prev=29,e.next=32,this.endLoading();case32:returne.finish(29);case33:case"end":returne.stop()}}),e,this,[[2,,29,33]])}))),function(){returnt.apply(this,arguments)})},{key:"destroy",value:function(){vare;u(g(a.prototype),"destroy",this).call(this),null===(e=this.chart)||void0===e||e.dispose(),window.removeEventListener("resize",this.resizeChart)}}]),a}(f)}}}))}();