(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[5],{OtmW:function(e,t,i){"use strict";var r=i("g09b");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(i("gWZ8"));i("miYZ");var a=r(i("tsqr")),o=r(i("qIgq")),c=l(i("q1tI")),u=i("yP6+"),d=r(i("CLrh")),s=i("N8P2");function f(e){if("function"!==typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(f=function(e){return e?i:t})(e)}function l(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==typeof e&&"function"!==typeof e)return{default:e};var i=f(t);if(i&&i.has(e))return i.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=n?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}return r.default=e,i&&i.set(e,r),r}var m=function(e){var t=e.config,i=[],r=(0,c.useState)(i),f=(0,o.default)(r,2),l=f[0],m=f[1],g=(0,c.useState)(300),v=(0,o.default)(g,2),p=v[0],y=v[1];(0,c.useEffect)(function(){var t=document.getElementById(e.id);t&&y(t.offsetHeight-50)},[e.ySize]);var h={sold:{alias:t.x||"\u9500\u552e\u91cf",tickCount:t.history&&t.history>9?Math.ceil(t.history/2):10},genre:{alias:t.y||"\u6e38\u620f\u79cd\u7c7b",type:"cat",range:[1/(t.history-1),1-1/(t.history-1)],tickCount:5}};return(0,c.useEffect)(function(){e.ready&&e.ready(function(){a.default.success("\u66f4\u65b0\u3002\u3002\u3002".concat(e.id))}),e.edit&&e.edit(function(){return e.config}),e.preview&&e.preview(function(){return"https://www.baidu.com/link?url=kuSzeluGn9dkOqcDvPcvU5g1gh-DMms6auTTUACJkdPm559tFM6GRDYkHE7p8fSHDl-RSOc5KeDGQBCictIOZsdgBL5Ds_kDaZCu1qgx99BitlSq6ocOJp3htq0bW7IoATv4Y0I33tKGyQL-bBDOuAqHvqsLeQiWlDuR0KCJiA3u-SswRJhJQHgREuKPOHszUZ0L_9oieMXOwCY0HYUDGsIKBjIMNoV3x6CFP4h63kPC3rmMwKTs-0WtEa1VceLscigtzPQiQmqZqlctYr1JX1IWLbR6r6rNcvQvP2o8NqaHqfzcG0tTiE6y7fSgM9D2N1E9ON8yyBf8iRnPOIzjfc6p2FPMmuM6_Rc6cBFhhPC_ujQWj4kc_CveBLiapyLMDS4E1KVznYHYWSz_OiK-DZIvGqriXnBUCz5j25CgJFm_mMK-LrwLAXkHY_2BzRr4WQFBMoOzesktllvUaOmzlkircgLMGRVKQZRubOzkJ0ocCySDlUKSyNeIX01yGRGGOZ5EEBoPD6BVVUFCKKUUEEp6NEj-6vVN_Jihgk-_W1J--9a9PKRuXKuS0EbKjvySdY3f5ink5eax6jvSvv7GNywDh1E6slJqj8rHTBQO32niX9mPlD9vfLrbOxSUcTBO_GUmwK6K7OIZSCUChT3Lpuwv38Lr8vlFbuUdZIB2tSO1lDLjDshWgPlic54ECPb4TLsGMdlJg8p8q_BLL4Qdly75nte91d1jYcb3EbEbFViLVewOfeOspKTyimZFT-G0Qe15r1klAAZvt7dD5LBqu_Nh89uLs4_ZZ4jhQJKBSLm&timg=&click_t=1587465382772&s_info=1622_978&wd=&eqid=e5c3ddcc00000e74000000065e9ecca5"})},[]),(0,c.useEffect)(function(){var i,r=[],a=e.config.dimension;return"history"===a?r=[{dashboard:"device",object:e.productId,measurement:"temperature",dimension:a,params:{history:t.history,deviceId:e.deviceId}}]:"agg"===a?r=[{dashboard:"device",object:e.productId,measurement:"temperature",dimension:a,params:{limit:e.config.limit,deviceId:e.deviceId,time:e.config.time,agg:e.config.agg,format:e.config.format,from:e.config.from,to:e.config.to}}]:"realTime"===a&&(i=(0,s.getWebsocket)("".concat(e.id,"-").concat(e.productId,"-").concat(e.deviceId,"-").concat(e.config.measurement),"/dashboard/device/".concat(e.productId,"/").concat(e.config.measurement,"/realTime"),{deviceId:e.deviceId,history:e.config.history}).subscribe(function(t){var i=t.payload;l.push({genre:i.timestamp,sold:i.value.value}),l.length>e.config.history&&l.shift(),m((0,n.default)(l))})),"realTime"!==a&&d.default.visualization.getDashboardData(r).then(function(e){if(200===e.status){var t=e.result,i=t.map(function(e){return{genre:e.data.timeString,sold:e.data.value.value}});m(i)}}),function(){return i&&i.unsubscribe()}},[]),c.default.createElement(u.Chart,{height:p,data:l,renderer:"svg",scale:h,forceFit:!0},c.default.createElement(u.Axis,{name:"genre",title:!0,label:{autoRotate:!0,formatter:function(e){return e}}}),c.default.createElement(u.Axis,{name:"sold",title:!0}),c.default.createElement(u.Tooltip,null),c.default.createElement(u.Geom,{type:"interval",position:"genre*sold",color:"genre"}))},g=m;t.default=g}}]);