!function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function n(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */n=function(){return t};var t={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(j){l=function(e,t,r){return e[t]=r}}function h(e,t,r,n){var o=t&&t.prototype instanceof d?t:d,a=Object.create(o.prototype),s=new P(n||[]);return i(a,"_invoke",{value:S(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(j){return{type:"throw",arg:j}}}t.wrap=h;var p={};function d(){}function v(){}function y(){}var m={};l(m,s,(function(){return this}));var g=Object.getPrototypeOf,w=g&&g(g(k([])));w&&w!==r&&o.call(w,s)&&(m=w);var b=y.prototype=d.prototype=Object.create(m);function x(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function C(t,r){function n(i,a,s,c){var u=f(t[i],t,a);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"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){return n("throw",e,s,c)}))}c(u.arg)}var a;i(this,"_invoke",{value:function(e,t){function o(){return new r((function(r,o){n(e,t,r,o)}))}return a=a?a.then(o,o):o()}})}function S(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return A()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=O(a,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=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)}}}function O(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,O(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var o=f(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,p;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function k(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;)if(o.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:A}}function A(){return{value:void 0,done:!0}}return v.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){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.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(){return this})),t.AsyncIterator=C,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new C(h(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},x(b),l(b,u,"Generator"),l(b,s,(function(){return this})),l(b,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=k,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),c=o.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.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)throw e.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(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:k(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},t}function o(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,o)}function i(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var a=e.apply(t,r);function s(e){o(a,n,i,s,c,"next",e)}function c(e){o(a,n,i,s,c,"throw",e)}s(void 0)}))}}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=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))}))}return e}function c(e,t,r){return(t=f(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(){return u="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=g(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(arguments.length<3?e:r):o.value}},u.apply(this,arguments)}function l(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,f(n.key),n)}}function h(e,t,r){return t&&l(e.prototype,t),r&&l(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function f(t){var r=function(t,r){if("object"!==e(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,r||"default");if("object"!==e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(t,"string");return"symbol"===e(r)?r:String(r)}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("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)}function v(e,t){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},v(e,t)}function y(t){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=g(t);if(r){var i=g(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return function(t,r){if(r&&("object"===e(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return m(t)}(this,n)}}function m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(e){return g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__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";var o,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){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return o(e,(function(){return new E(t,r,n)}))}));var r=function(e){d(r,e);var t=y(r);function r(){return p(this,r),t.apply(this,arguments)}return h(r)}(a),C=function(e){d(n,e);var t=y(n);function n(){return p(this,n),t.apply(this,arguments)}return h(n,[{key:"createNeuron",value:function(){return new r(this.bindAbility())}},{key:"bindAbility",value:function(){return s(s({},u(g(n.prototype),"bindAbility",this).call(this)),{},{load:this.controller.load.bind(this.controller)})}}]),n}(l);function S(e){var t={};return e&&Object.keys(e).forEach((function(r){var n=r.indexOf(".");if(-1!==n){var o=r.slice(n+1);if(o&&void 0!==e[r])try{t[o]=JSON.parse(e[r])}catch(i){ibiz.log.error("".concat(o," 解析错误"))}}})),t}function O(e){return{axisLabel:{formatter:function(t){return 1===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}}}var L=function(e){d(l,e);var r,o,a,u=y(l);function l(e){var t;p(this,l),c(m(t=u.call(this,e)),"seriesList",[]);var r=e.source.getPSDEChartSerieses();if(!r||!r.length)throw new Error("图表序列集合不能为空");return t.seriesList=r,t}return h(l,[{key:"fetch",value:(a=i(n().mark((function e(t){var r,o,i=arguments;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=i.length>1&&void 0!==i[1]?i[1]:{},e.next=3,this.exec(this.model.fetchAction,t,r);case 3:return o=e.sent,e.abrupt("return",o);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"getAllCodeListMap",value:(o=i(n().mark((function e(t,r){var o;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=[],e.next=3,Promise.all(this.seriesList.map(function(){var e=i(n().mark((function e(i,a){var s,c,u,l,h,f,p,d,v,y,m;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(h={},f=null===(s=i.getCatalogPSCodeList)||void 0===s||null===(c=s.call(i))||void 0===c?void 0:c.codeName,p=null===(u=i.getSeriesPSCodeList)||void 0===u||null===(l=u.call(i))||void 0===l?void 0:l.codeName,!f){e.next=8;break}return e.next=6,ibiz.codeListService.get(f,t,r);case 6:(d=e.sent)&&(v=new Map,d.forEach((function(e){v.set(e.value,e.text)})),h.catalog=v);case 8:if(!p){e.next=13;break}return e.next=11,ibiz.codeListService.get(p,t,r);case 11:(y=e.sent)&&(m=new Map,y.forEach((function(e){m.set(e.value,e.text)})),h.series=m);case 13:o[a]=h;case 14:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()));case 3:return e.abrupt("return",o);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"generateDatasetOption",value:function(e,r,n){var o,i={},a=[];i.source=a;var s=e.catalogField.toLowerCase(),c=e.valueField.toLowerCase(),u=null===(o=e.seriesField)||void 0===o?void 0:o.toLowerCase();if(u){var l=new Set;r.forEach((function(e){l.add(e[u])})),a.push([s].concat(t(l)))}else a.push([s,c]);a.push.apply(a,t(r.map((function(e){return a[0].map((function(t,r){return 0===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){var r;return 0===t?e:(null===(r=n.series)||void 0===r?void 0:r.get(e))||e})));for(var h=function(e){for(var t=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);return i}},{key:"generateChartOption",value:(r=i(n().mark((function e(r,o,i){var a,s,c=this;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(a={}).dataset=[],a.series=[],e.next=5,this.getAllCodeListMap(o,i);case 5:return s=e.sent,this.seriesList.forEach((function(e,n){if("radar"!==e.eChartsType){var o=c.generateDatasetOption(e,r,s[n]);if(Array.isArray(a.dataset)&&a.dataset.push(o),"bar"===e.eChartsType){var i,u=c.generateBarSeriesOption(e,r,s[n],n);Array.isArray(a.series)&&(i=a.series).push.apply(i,t(u))}else if("line"===e.eChartsType){var l,h=c.generateLineSeriesOption(e,r,s[n],n);Array.isArray(a.series)&&(l=a.series).push.apply(l,t(h))}else if("pie"===e.eChartsType){var f,p=c.generatePieSeriesOption(e,r,s[n],n);Array.isArray(a.series)&&(f=a.series).push.apply(f,t(p))}else if("funnel"===e.eChartsType){var d,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)throw new Error("".concat(e.eChartsType,"类型的图表暂未实现"));var y,m=c.generateScatterSeriesOption(e,r,s[n],n);Array.isArray(a.series)&&(y=a.series).push.apply(y,t(m))}}else{var g,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);case 8:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return r.apply(this,arguments)})},{key:"generateBarSeriesOption",value:function(e,r,n,o){var i,a,c,u,l,h,f,p=[],d=e.eChartsType,v=e.catalogField.toLowerCase(),y=e.valueField.toLowerCase(),m=null===(i=e.seriesField)||void 0===i?void 0:i.toLowerCase(),g=+(null===(a=e.M)||void 0===a||null===(c=a.getPSChartSeriesEncode)||void 0===c||null===(u=c.getPSChartXAxis)||void 0===u?void 0:u.id)||0,w=+(null===(l=e.M)||void 0===l||null===(h=l.getPSChartSeriesEncode)||void 0===h||null===(f=h.getPSChartYAxis)||void 0===f?void 0:f.id)||0,x={};if(m){var C=new Set;r.forEach((function(e){var t=e[m];C.add(n&&n.series&&n.series.get(t)||t)})),p.push.apply(p,t(t(C).map((function(t){return s({type:d,xAxisIndex:g,yAxisIndex:w,name:t,datasetIndex:o,encode:{x:v,y:t}},b(x,S(e.userParams)))}))))}else p.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))));return p}},{key:"generateLineSeriesOption",value:function(e,r,n,o){var i,a,c,u,l,h,f,p=[],d=e.eChartsType,v=e.catalogField.toLowerCase(),y=e.valueField.toLowerCase(),m=null===(i=e.seriesField)||void 0===i?void 0:i.toLowerCase(),g=+(null===(a=e.M)||void 0===a||null===(c=a.getPSChartSeriesEncode)||void 0===c||null===(u=c.getPSChartXAxis)||void 0===u?void 0:u.id)||0,w=+(null===(l=e.M)||void 0===l||null===(h=l.getPSChartSeriesEncode)||void 0===h||null===(f=h.getPSChartYAxis)||void 0===f?void 0:f.id)||0,x={emphasis:{label:{fontSize:20,show:!0}},label:{position:"top",show:!0}};if(m){var C=new Set;r.forEach((function(e){var t=e[m];C.add(n&&n.series&&n.series.get(t)||t)})),p.push.apply(p,t(t(C).map((function(t){return s({type:d,xAxisIndex:g,yAxisIndex:w,name:t,datasetIndex:o,encode:{x:v,y:t},stack:e.M.stack?e.id:void 0,step:!!e.M.step&&"middle"},b(x,S(e.userParams)))}))))}else p.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))));return p}},{key:"generatePieSeriesOption",value:function(e,r,n,o){var i,a=[],c=e.eChartsType,u=e.catalogField.toLowerCase(),l=e.valueField.toLowerCase(),h=null===(i=e.seriesField)||void 0===i?void 0:i.toLowerCase(),f={emphasis:{label:{fontSize:20,show:!0}},label:{formatter:"{b}: {d}%({@age})",position:"outside",show:!0}};if(h){var p=new Set;r.forEach((function(e){var t=e[h];p.add(n&&n.series&&n.series.get(t)||t)})),a.push.apply(a,t(t(p).map((function(t){return s({type:c,name:t,datasetIndex:o,encode:{itemName:u,value:t}},b(f,S(e.userParams)))}))))}else a.push(s({type:c,name:e.caption||e.id,datasetIndex:o,encode:{itemName:u,value:l}},b(f,S(e.userParams))));return a}},{key:"generateFunnelSeriesOption",value:function(e,r,n,o){var i,a=[],c=e.eChartsType,u=e.catalogField.toLowerCase(),l=e.valueField.toLowerCase(),h=null===(i=e.seriesField)||void 0===i?void 0:i.toLowerCase(),f={emphasis:{label:{fontSize:20,show:!0}},label:{formatter:"{b}: {d}%({@age})",position:"outside",show:!0}};if(h){var p=new Set;r.forEach((function(e){var t=e[h];p.add(n&&n.series&&n.series.get(t)||t)})),a.push.apply(a,t(t(p).map((function(t){return s({type:c,name:t,datasetIndex:o,encode:{itemName:u,value:t}},b(f,S(e.userParams)))}))))}else a.push(s({type:c,name:e.caption||e.id,datasetIndex:o,encode:{itemName:u,value:l}},b(f,S(e.userParams))));return a}},{key:"generateScatterSeriesOption",value:function(e,r,n,o){var i,a=[],c=e.eChartsType,u=e.catalogField.toLowerCase(),l=e.valueField.toLowerCase(),h=null===(i=e.seriesField)||void 0===i?void 0:i.toLowerCase(),f={emphasis:{label:{fontSize:20,show:!0}},label:{position:"top",show:!0}};if(h){var p=new Set;r.forEach((function(e){var t=e[h];p.add(n&&n.series&&n.series.get(t)||t)})),a.push.apply(a,t(t(p).map((function(t){return s({type:c,name:t,datasetIndex:o,encode:{x:u,y:t}},b(f,S(e.userParams)))}))))}else a.push(s({type:c,name:e.caption||e.id,datasetIndex:o,encode:{x:u,y:l}},b(f,S(e.userParams))));return a}},{key:"generateRadarSeriesOption",value:function(e,r,n){var o,i=[],a=[],c=e.eChartsType,u=e.catalogField.toLowerCase(),l=e.valueField.toLowerCase(),h=null===(o=e.seriesField)||void 0===o?void 0:o.toLowerCase();if(h){var f=new Set;r.forEach((function(e){f.add(e[h])})),a.push([u].concat(t(f)))}else a.push([u,l]);a.push.apply(a,t(r.map((function(e){return a[0].map((function(t,r){return 0===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){var r;return 0===t?e:(null===(r=n.series)||void 0===r?void 0:r.get(e))||e})));for(var p=function(e){for(var t=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);var v=a[0].slice(1).map((function(e,t){return a.slice(1).map((function(e){return e[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))));var y=-1/0;return v.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);var t,r,o=y(a);function a(){var e;p(this,a);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return c(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",void 0),c(m(e),"loadHook",void 0),c(m(e),"items",[]),c(m(e),"queryParams",{page:0,size:1e3,query:""}),c(m(e),"width","100%"),c(m(e),"height","100%"),e}return h(a,[{key:"createNerve",value:function(){return new C(this)}},{key:"onInit",value:(r=i(n().mark((function e(){var t,r,o;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u(g(a.prototype),"onInit",this).call(this);case 2:return this.service=new L(this.model),e.next=5,this.service.init(this.context);case 5: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"));case 11:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"resizeChart",value:function(){var e;null===(e=this.chart)||void 0===e||e.resize()}},{key:"initChartStaticOption",value:function(){var e={},t=this.model.source.getPSDEChartTitle();e.title=t?function(e){var t={};if(e){var r;t.show=e.showTitle,t.text=e.title,t.subtext=e.subTitle;var n=null===(r=e.titlePos)||void 0===r?void 0:r.toLowerCase();"left"===n||"right"===n?t.left=n:"bottom"!==n&&"top"!==n||(t.left="center",t.top=n)}return t}(t):{},e.tooltip={show:!0};var r=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){var t=e,r=document.createElement("div");if(r.classList.add("chart-tooltip-container"),Array.isArray(e)){var n=[],o=new Map;t.forEach((function(e){var t=e.seriesName,r=e.dimensionNames;r.slice(1).forEach((function(i,a){var s=2===r.length?t:i,c=e.value[a+1];o.has(s)||(n.push({x:s,y:c}),o.set(s,c))}))}));var i=document.createElement("div");return i.classList.add("chart-tooltip-title"),i.textContent=t[0].value[0],r.appendChild(i),n.forEach((function(e){var t=document.createElement("div");t.classList.add("chart-tooltip-item");var n=document.createElement("div");n.classList.add("chart-tooltip-item-name"),n.textContent=e.x,t.appendChild(n);var o=document.createElement("div");o.classList.add("chart-tooltip-item-number"),o.textContent=e.y,t.appendChild(o),r.appendChild(t)})),r}return r}});var n=this.model.source.getPSDEChartLegend();e.legend=n?function(e){var t={};if(e){var r;t.show=e.showLegend;var n=null===(r=e.legendPos)||void 0===r?void 0:r.toLowerCase();"left"===n||"right"===n?(t.left=n,t.top="middle",t.orient="vertical"):"bottom"===n&&(t.top=n)}return t}(n):{};var o=this.model.source.getPSChartXAxises();e.xAxis=o?function(e){var t=[];return e&&e.length&&e.forEach((function(e){var r=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):[];var i=this.model.source.getPSChartYAxises();e.yAxis=i?function(e){var t=[];return e&&e.length&&e.forEach((function(e){var r=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((function e(){var t,r,o,i,a,c,u;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.startLoading();case 2:return e.prev=2,e.next=5,this.service.fetch(this.context,s(s({},this.params),this.queryParams));case 5: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}throw new Error("未找到ECharts绘制容器元素");case 14:this.chart=w(o);case 15:return e.next=17,this.service.generateChartOption(r,this.context,this.params);case 17:if(i=e.sent,a=b(this.chartStaticOption,i),c=a,!this.hook){e.next=24;break}return e.next=23,this.hook(a);case 23:c=e.sent;case 24:this.chart.setOption(c),e.next=29;break;case 27:this.items=[],null===(u=this.chart)||void 0===u||u.clear();case 29:return e.prev=29,e.next=32,this.endLoading();case 32:return e.finish(29);case 33:case"end":return e.stop()}}),e,this,[[2,,29,33]])}))),function(){return t.apply(this,arguments)})},{key:"destroy",value:function(){var e;u(g(a.prototype),"destroy",this).call(this),null===(e=this.chart)||void 0===e||e.dispose(),window.removeEventListener("resize",this.resizeChart)}}]),a}(f)}}}))}();