!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,i=r.hasOwnProperty,o=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(k){l=function(e,t,r){returne[t]=r}}functionh(e,t,r,n){vari=t&&t.prototypeinstanceofd?t:d,a=Object.create(i.prototype),s=newP(n||[]);returno(a,"_invoke",{value:S(e,r,s)}),a}functionf(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(k){return{type:"throw",arg:k}}}t.wrap=h;varp={};functiond(){}functionv(){}functiony(){}varm={};l(m,s,(function(){returnthis}));varg=Object.getPrototypeOf,w=g&&g(g(j([])));w&&w!==r&&i.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(o,a,s,c){varu=f(t[o],t,a);if("throw"!==u.type){varl=u.arg,h=l.value;returnh&&"object"==e(h)&&i.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;o(this,"_invoke",{value:function(e,t){functioni(){returnnewr((function(r,i){n(e,t,r,i)}))}returna=a?a.then(i,i):i()}})}functionS(e,t,r){varn="suspendedStart";returnfunction(i,o){if("executing"===n)thrownewError("Generator is already running");if("completed"===n){if("throw"===i)throwo;returnA()}for(r.method=i,r.arg=o;;){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;vari=f(n,e.iterator,t.arg);if("throw"===i.type)returnt.method="throw",t.arg=i.arg,t.delegate=null,p;varo=i.arg;returno?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void0),t.delegate=null,p):o:(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)}functionj(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(i.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,o(b,"constructor",{value:y,configurable:!0}),o(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,i,o){void0===o&&(o=Promise);vara=newC(h(e,r,n,i),o);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=j,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)&&i.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){varo=this.tryEntries[n],a=o.completion;if("root"===o.tryLoc)returnr("end");if(o.tryLoc<=this.prev){vars=i.call(o,"catchLoc"),c=i.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)returnr(o.catchLoc,!0);if(this.prev<o.finallyLoc)returnr(o.finallyLoc)}elseif(s){if(this.prev<o.catchLoc)returnr(o.catchLoc,!0)}else{if(!c)thrownewError("try statement without catch or finally");if(this.prev<o.finallyLoc)returnr(o.finallyLoc)}}}},abrupt:function(e,t){for(varr=this.tryEntries.length-1;r>=0;--r){varn=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){varo=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);vara=o?o.completion:{};returna.type=e,a.arg=t,o?(this.method="next",this.next=o.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){vari=n.arg;E(r)}returni}}thrownewError("illegal catch attempt")},delegateYield:function(e,t,r){returnthis.delegate={iterator:j(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void0),p}},t}functioni(e,t,r,n,i,o,a){try{vars=e[o](a),c=s.value}catch(u){returnvoidr(u)}s.done?t(c):Promise.resolve(c).then(n,i)}functiono(e){returnfunction(){vart=this,r=arguments;returnnewPromise((function(n,o){vara=e.apply(t,r);functions(e){i(a,n,o,s,c,"next",e)}functionc(e){i(a,n,o,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){vari=Object.getOwnPropertyDescriptor(n,t);returni.get?i.get.call(arguments.length<3?e:r):i.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){vari=n.call(t,r||"default");if("object"!==e(i))returni;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,i=g(t);if(r){varo=g(this).constructor;n=Reflect.construct(i,arguments,o)}elsen=i.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(["vue","@ibiz-template/vue-util","@ibiz-template/model","@ibiz-template/controller","qx-util","echarts","ramda","@ibiz-template/service"],(function(e,r){"use strict";vari,a,l,f,v,w,b,x,C,S,O,L,E;return{setters:[function(e){i=e.defineComponent,a=e.getCurrentInstance,l=e.h},function(e){f=e.useControlController,v=e.useNamespace},function(e){w=e.ChartModel},function(e){b=e.Neuron,x=e.ControlNerve,C=e.ControlController},function(e){S=e.createUUID},function(e){O=e.init},function(e){L=e.mergeDeepRight},function(e){E=e.ControlService}],execute:function(){varr=function(e){d(r,e);vart=y(r);functionr(){returnp(this,r),t.apply(this,arguments)}returnh(r)}(b),P=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}(x);functionj(e){vart={};returne&&Object.keys(e).forEach((function(r){varn=r.indexOf(".");if(-1!==n){vari=r.slice(n+1);i&&void0!==e[r]&&(t[i]=JSON.parse(e[r]))}})),t}functionA(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}}}vark=function(e){d(l,e);varr,i,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=o(n().mark((functione(t){varr,i,o=arguments;returnn().wrap((function(e){for(;;)switch(e.prev=e.next){case0:returnr=o.length>1&&void0!==o[1]?o[1]:{},e.next=3,this.exec(this.model.fetchAction,t,r);case3:returni=e.sent,e.abrupt("return",i);case5:case"end":returne.stop()}}),e,this)}))),function(e){returna.apply(this,arguments)})},{key:"getAllCodeListMap",value:(i=o(n().mark((functione(t,r){vari;returnn().wrap((function(e){for(;;)switch(e.prev=e.next){case0:returni=[],e.next=3,Promise.all(this.seriesList.map(function(){vare=o(n().mark((functione(o,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=o.getCatalogPSCodeList)||void0===s||null===(c=s.call(o))||void0===c?void0:c.codeName,p=null===(u=o.getSeriesPSCodeList)||void0===u||null===(l=u.call(o))||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:i[a]=h;case14:case"end":returne.stop()}}),e)})));returnfunction(t,r){returne.apply(this,arguments)}}()));case3:returne.abrupt("return",i);case4:case"end":returne.stop()}}),e,this)}))),function(e,t){returni.apply(this,arguments)})},{key:"generateDatasetOption",value:function(e,r,n){vari,o={},a=[];o.source=a;vars=e.catalogField.toLowerCase(),c=e.valueField.toLowerCase(),u=null===(i=e.seriesField)||void0===i?void0:i.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);returno}},{key:"generateChartOption",value:(r=o(n().mark((functione(r,i,o){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(i,o);case5:returns=e.sent,this.seriesList.forEach((function(e,n){if("radar"!==e.eChartsType){vari=c.generateDatasetOption(e,r,s[n]);if(Array.isArray(a.dataset)&&a.dataset.push(i),"bar"===e.eChartsType){varo,u=c.generateBarSeriesOption(e,r,s[n],n);Array.isArray(a.series)&&(o=a.series).push.apply(o,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,i){varo,a,c,u,l,h,f,p=[],d=e.eChartsType,v=e.catalogField.toLowerCase(),y=e.valueField.toLowerCase(),m=null===(o=e.seriesField)||void0===o?void0:o.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,b={};if(m){varx=newSet;r.forEach((function(e){vart=e[m];x.add(n&&n.series&&n.series.get(t)||t)})),p.push.apply(p,t(t(x).map((function(t){returns({type:d,xAxisIndex:g,yAxisIndex:w,name:t,datasetIndex:i,encode:{x:v,y:t}},L(b,j(e.userParams)))}))))}elsep.push(s({type:d,xAxisIndex:g,yAxisIndex:w,name:e.caption||e.id,datasetIndex:i,encode:{x:v,y:y}},L(b,j(e.userParams))));returnp}},{key:"generateLineSeriesOption",value:function(e,r,n,i){varo,a,c,u,l,h,f,p=[],d=e.eChartsType,v=e.catalogField.toLowerCase(),y=e.valueField.toLowerCase(),m=null===(o=e.seriesField)||void0===o?void0:o.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,b={emphasis:{label:{fontSize:20,show:!0}},label:{position:"top",show:!0}};if(m){varx=newSet;r.forEach((function(e){vart=e[m];x.add(n&&n.series&&n.series.get(t)||t)})),p.push.apply(p,t(t(x).map((function(t){returns({type:d,xAxisIndex:g,yAxisIndex:w,name:t,datasetIndex:i,encode:{x:v,y:t},stack:e.M.stack?e.id:void0,step:!!e.M.step&&"middle"},L(b,j(e.userParams)))}))))}elsep.push(s({type:d,xAxisIndex:g,yAxisIndex:w,name:e.caption||e.id,datasetIndex:i,encode:{x:v,y:y}},L(b,j(e.userParams))));returnp}},{key:"generatePieSeriesOption",value:function(e,r,n,i){varo,a=[],c=e.eChartsType,u=e.catalogField.toLowerCase(),l=e.valueField.toLowerCase(),h=null===(o=e.seriesField)||void0===o?void0:o.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:i,encode:{itemName:u,value:t}},L(f,j(e.userParams)))}))))}elsea.push(s({type:c,name:e.caption||e.id,datasetIndex:i,encode:{itemName:u,value:l}},L(f,j(e.userParams))));returna}},{key:"generateFunnelSeriesOption",value:function(e,r,n,i){varo,a=[],c=e.eChartsType,u=e.catalogField.toLowerCase(),l=e.valueField.toLowerCase(),h=null===(o=e.seriesField)||void0===o?void0:o.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:i,encode:{itemName:u,value:t}},L(f,j(e.userParams)))}))))}elsea.push(s({type:c,name:e.caption||e.id,datasetIndex:i,encode:{itemName:u,value:l}},L(f,j(e.userParams))));returna}},{key:"generateScatterSeriesOption",value:function(e,r,n,i){varo,a=[],c=e.eChartsType,u=e.catalogField.toLowerCase(),l=e.valueField.toLowerCase(),h=null===(o=e.seriesField)||void0===o?void0:o.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:i,encode:{x:u,y:t}},L(f,j(e.userParams)))}))))}elsea.push(s({type:c,name:e.caption||e.id,datasetIndex:i,encode:{x:u,y:l}},L(f,j(e.userParams))));returna}},{key:"generateRadarSeriesOption",value:function(e,r,n){vari,o=[],a=[],c=e.eChartsType,u=e.catalogField.toLowerCase(),l=e.valueField.toLowerCase(),h=null===(i=e.seriesField)||void0===i?void0:i.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]}))}));o.push(s({type:c,name:e.caption||e.id,data:v},L({emphasis:{label:{fontSize:20,show:!0}},label:{position:"top",show:!0}},j(e.userParams))));vary=-1/0;returnv.forEach((function(e){e.forEach((function(e){+e>y&&(y=+e)}))})),{series:o,radar:{indicator:a.slice(1).map((function(e){return{name:e[0],max:y}}))}}}}]),l}(E),I=function(e){d(a,e);vart,r,i=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=i.call.apply(i,[this].concat(r))),"chart",null),c(m(e),"chartId","chart_".concat(S())),c(m(e),"chartStaticOption",{}),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(){returnnewP(this)}},{key:"onInit",value:(r=o(n().mark((functione(){vart,r,i;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=newk(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,i=t.height,r&&(this.width="".concat(r,"px")),i&&(this.height="".concat(i,"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=[],i=newMap;t.forEach((function(e){vart=e.seriesName,r=e.dimensionNames;r.slice(1).forEach((function(o,a){vars=2===r.length?t:o,c=e.value[a+1];i.has(s)||(n.push({x:s,y:c}),i.set(s,c))}))}));varo=document.createElement("div");returno.classList.add("chart-tooltip-title"),o.textContent=t[0].value[0],r.appendChild(o),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);vari=document.createElement("div");i.classList.add("chart-tooltip-item-number"),i.textContent=e.y,t.appendChild(i),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):{};vari=this.model.source.getPSChartXAxises();e.xAxis=i?function(e){vart=[];returne&&e.length&&e.forEach((function(e){varr=e.caption,n=e.minValue,i=e.maxValue,o=e.eChartsType,a=e.position,c={name:r,min:n,max:i};Object.assign(c,s({type:o,position:a},L(A(e.dataShowMode),j(e.userParams)))),t.push(c)})),t}(i):[];varo=this.model.source.getPSChartYAxises();e.yAxis=o?function(e){vart=[];returne&&e.length&&e.forEach((function(e){varr=e.caption,n=e.minValue,i=e.maxValue,o=e.eChartsType,a=e.position,c={name:r,min:n,max:i};Object.assign(c,s({type:o,position:a},L(A(e.dataShowMode),j(e.userParams)))),t.push(c)})),t}(o):[],Object.assign(this.chartStaticOption,L(e,j(this.model.source.userParams)))}},{key:"load",value:(t=o(n().mark((functione(){vart,r,i,o,a;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,!Array.isArray(r)||!r.length){e.next=20;break}if(this.items=r,this.chart){e.next=14;break}if(i=document.querySelector("#".concat(this.chartId))){e.next=13;break}thrownewError("未找到ECharts绘制容器元素");case13:this.chart=O(i);case14:returne.next=16,this.service.generateChartOption(r,this.context,this.params);case16:o=e.sent,this.chart.setOption(s(s({},this.chartStaticOption),o)),e.next=22;break;case20:this.items=[],null===(a=this.chart)||void0===a||a.clear();case22:returne.prev=22,e.next=25,this.endLoading();case25:returne.finish(22);case26:case"end":returne.stop()}}),e,this,[[2,,22,26]])}))),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}(C);e("default",i({name:"ChartControl",props:{modelData:{type:w,required:!0},context:{type:Object,required:!0},params:{type:Object,default:function(){return{}}}},setup:function(e){vart=a().proxy,r=v("chart"),n=function(e,t,r){varn=arguments.length>3&&void0!==arguments[3]?arguments[3]:{};returnf(e,(function(){returnnewI(t,r,n)}))}(t,e.modelData,e.context,e.params);return{c:n,ns:r}},render:function(){if(this.c.complete)returnl("control-layout",{attrs:{modelData:this.c.model}},[l("div",{class:this.ns.b(),style:{width:this.c.width,height:this.c.height}},[l("div",{attrs:{id:this.c.chartId},class:this.ns.b("content")}),this.c.items.length?null:l("div",{class:this.ns.b("empty-content")},["暂无数据"])])])}}))}}}))}();