From def03dd04cda49960c31b01f96d17a38098753fb Mon Sep 17 00:00:00 2001 From: Zira <48037743+wasfzxt@users.noreply.github.com> Date: Wed, 15 Jan 2020 13:14:08 +0800 Subject: [PATCH] Add two Demo Sports and breakfast in miniprogram --- miniprogram/tcb-demo-breakfast/README.md | 22 ++ miniprogram/tcb-demo-breakfast/base/food.jpg | Bin 0 -> 10484 bytes miniprogram/tcb-demo-breakfast/base/food.json | 1 + .../cloudfunctions/cancelfood/config.json | 6 + .../cloudfunctions/cancelfood/index.js | 11 + .../cloudfunctions/cancelfood/package.json | 14 + .../cloudfunctions/contact/config.json | 7 + .../cloudfunctions/contact/index.js | 31 +++ .../cloudfunctions/contact/package.json | 14 + .../cloudfunctions/donefood/config.json | 14 + .../cloudfunctions/donefood/index.js | 40 +++ .../cloudfunctions/donefood/package.json | 14 + .../cloudfunctions/initfood/config.json | 6 + .../cloudfunctions/initfood/index.js | 41 +++ .../cloudfunctions/initfood/package.json | 14 + .../cloudfunctions/sendfood/config.json | 14 + .../cloudfunctions/sendfood/index.js | 41 +++ .../cloudfunctions/sendfood/package.json | 14 + .../cloudfunctions/submitfood/config.json | 6 + .../cloudfunctions/submitfood/index.js | 87 ++++++ .../cloudfunctions/submitfood/package.json | 14 + .../tcb-demo-breakfast/miniprogram/app.js | 12 + .../tcb-demo-breakfast/miniprogram/app.json | 13 + .../tcb-demo-breakfast/miniprogram/app.wxss | 0 .../miniprogram/pages/index/index.js | 155 +++++++++++ .../miniprogram/pages/index/index.json | 5 + .../miniprogram/pages/index/index.wxml | 50 ++++ .../miniprogram/pages/index/index.wxss | 91 +++++++ .../miniprogram/pages/index/tools.wxs | 6 + .../miniprogram/sitemap.json | 7 + .../half-screen-dialog/half-screen-dialog.js | 165 ++++++++++++ .../half-screen-dialog.json | 4 + .../half-screen-dialog.wxml | 43 +++ .../half-screen-dialog.wxss | 1 + .../ui/static/icon/s-arrow-back.png | Bin 0 -> 987 bytes .../ui/static/icon/s-arrow-back.svg | 20 ++ .../tcb-demo-breakfast/project.config.json | 38 +++ miniprogram/tcb-demo-sports/README.md | 18 ++ .../cloudfunctions/getRun/config.json | 6 + .../cloudfunctions/getRun/index.js | 38 +++ .../cloudfunctions/getRun/package.json | 14 + .../cloudfunctions/initRun/config.json | 6 + .../cloudfunctions/initRun/index.js | 82 ++++++ .../cloudfunctions/initRun/package.json | 14 + .../cloudfunctions/saveimg/config.json | 6 + .../cloudfunctions/saveimg/index.js | 50 ++++ .../cloudfunctions/saveimg/package.json | 14 + .../cloudfunctions/savetext/config.json | 6 + .../cloudfunctions/savetext/index.js | 38 +++ .../cloudfunctions/savetext/package.json | 14 + .../cloudfunctions/secimg/config.json | 7 + .../cloudfunctions/secimg/index.js | 15 ++ .../cloudfunctions/secimg/package.json | 14 + .../cloudfunctions/sectext/config.json | 7 + .../cloudfunctions/sectext/index.js | 8 + .../cloudfunctions/sectext/package.json | 14 + .../cloudfunctions/setstar/config.json | 6 + .../cloudfunctions/setstar/index.js | 51 ++++ .../cloudfunctions/setstar/package.json | 14 + .../cloudfunctions/tostar/config.json | 6 + .../cloudfunctions/tostar/index.js | 23 ++ .../cloudfunctions/tostar/package.json | 14 + .../tcb-demo-sports/miniprogram/app.js | 38 +++ .../tcb-demo-sports/miniprogram/app.json | 16 ++ .../tcb-demo-sports/miniprogram/app.wxss | 114 ++++++++ .../miniprogram/ec-canvas/ec-canvas.js | 135 ++++++++++ .../miniprogram/ec-canvas/ec-canvas.json | 4 + .../miniprogram/ec-canvas/ec-canvas.wxml | 4 + .../miniprogram/ec-canvas/ec-canvas.wxss | 4 + .../miniprogram/ec-canvas/echarts.js | 22 ++ .../miniprogram/ec-canvas/wx-canvas.js | 97 +++++++ .../miniprogram/image/share.png | Bin 0 -> 17930 bytes .../miniprogram/pages/edit/edit.js | 164 ++++++++++++ .../miniprogram/pages/edit/edit.json | 3 + .../miniprogram/pages/edit/edit.wxml | 17 ++ .../miniprogram/pages/edit/edit.wxss | 51 ++++ .../miniprogram/pages/index/index.js | 251 ++++++++++++++++++ .../miniprogram/pages/index/index.json | 6 + .../miniprogram/pages/index/index.wxml | 30 +++ .../miniprogram/pages/index/index.wxss | 51 ++++ .../miniprogram/pages/show/show.js | 127 +++++++++ .../miniprogram/pages/show/show.json | 5 + .../miniprogram/pages/show/show.wxml | 15 ++ .../miniprogram/pages/show/show.wxss | 10 + .../tcb-demo-sports/miniprogram/sitemap.json | 7 + .../tcb-demo-sports/project.config.json | 62 +++++ 86 files changed, 2739 insertions(+) create mode 100644 miniprogram/tcb-demo-breakfast/README.md create mode 100644 miniprogram/tcb-demo-breakfast/base/food.jpg create mode 100644 miniprogram/tcb-demo-breakfast/base/food.json create mode 100644 miniprogram/tcb-demo-breakfast/cloudfunctions/cancelfood/config.json create mode 100644 miniprogram/tcb-demo-breakfast/cloudfunctions/cancelfood/index.js create mode 100644 miniprogram/tcb-demo-breakfast/cloudfunctions/cancelfood/package.json create mode 100644 miniprogram/tcb-demo-breakfast/cloudfunctions/contact/config.json create mode 100644 miniprogram/tcb-demo-breakfast/cloudfunctions/contact/index.js create mode 100644 miniprogram/tcb-demo-breakfast/cloudfunctions/contact/package.json create mode 100644 miniprogram/tcb-demo-breakfast/cloudfunctions/donefood/config.json create mode 100644 miniprogram/tcb-demo-breakfast/cloudfunctions/donefood/index.js create mode 100644 miniprogram/tcb-demo-breakfast/cloudfunctions/donefood/package.json create mode 100644 miniprogram/tcb-demo-breakfast/cloudfunctions/initfood/config.json create mode 100644 miniprogram/tcb-demo-breakfast/cloudfunctions/initfood/index.js create mode 100644 miniprogram/tcb-demo-breakfast/cloudfunctions/initfood/package.json create mode 100644 miniprogram/tcb-demo-breakfast/cloudfunctions/sendfood/config.json create mode 100644 miniprogram/tcb-demo-breakfast/cloudfunctions/sendfood/index.js create mode 100644 miniprogram/tcb-demo-breakfast/cloudfunctions/sendfood/package.json create mode 100644 miniprogram/tcb-demo-breakfast/cloudfunctions/submitfood/config.json create mode 100644 miniprogram/tcb-demo-breakfast/cloudfunctions/submitfood/index.js create mode 100644 miniprogram/tcb-demo-breakfast/cloudfunctions/submitfood/package.json create mode 100644 miniprogram/tcb-demo-breakfast/miniprogram/app.js create mode 100644 miniprogram/tcb-demo-breakfast/miniprogram/app.json create mode 100644 miniprogram/tcb-demo-breakfast/miniprogram/app.wxss create mode 100644 miniprogram/tcb-demo-breakfast/miniprogram/pages/index/index.js create mode 100644 miniprogram/tcb-demo-breakfast/miniprogram/pages/index/index.json create mode 100644 miniprogram/tcb-demo-breakfast/miniprogram/pages/index/index.wxml create mode 100644 miniprogram/tcb-demo-breakfast/miniprogram/pages/index/index.wxss create mode 100644 miniprogram/tcb-demo-breakfast/miniprogram/pages/index/tools.wxs create mode 100644 miniprogram/tcb-demo-breakfast/miniprogram/sitemap.json create mode 100644 miniprogram/tcb-demo-breakfast/miniprogram/ui/half-screen-dialog/half-screen-dialog.js create mode 100644 miniprogram/tcb-demo-breakfast/miniprogram/ui/half-screen-dialog/half-screen-dialog.json create mode 100644 miniprogram/tcb-demo-breakfast/miniprogram/ui/half-screen-dialog/half-screen-dialog.wxml create mode 100644 miniprogram/tcb-demo-breakfast/miniprogram/ui/half-screen-dialog/half-screen-dialog.wxss create mode 100644 miniprogram/tcb-demo-breakfast/miniprogram/ui/static/icon/s-arrow-back.png create mode 100644 miniprogram/tcb-demo-breakfast/miniprogram/ui/static/icon/s-arrow-back.svg create mode 100644 miniprogram/tcb-demo-breakfast/project.config.json create mode 100644 miniprogram/tcb-demo-sports/README.md create mode 100644 miniprogram/tcb-demo-sports/cloudfunctions/getRun/config.json create mode 100644 miniprogram/tcb-demo-sports/cloudfunctions/getRun/index.js create mode 100644 miniprogram/tcb-demo-sports/cloudfunctions/getRun/package.json create mode 100644 miniprogram/tcb-demo-sports/cloudfunctions/initRun/config.json create mode 100644 miniprogram/tcb-demo-sports/cloudfunctions/initRun/index.js create mode 100644 miniprogram/tcb-demo-sports/cloudfunctions/initRun/package.json create mode 100644 miniprogram/tcb-demo-sports/cloudfunctions/saveimg/config.json create mode 100644 miniprogram/tcb-demo-sports/cloudfunctions/saveimg/index.js create mode 100644 miniprogram/tcb-demo-sports/cloudfunctions/saveimg/package.json create mode 100644 miniprogram/tcb-demo-sports/cloudfunctions/savetext/config.json create mode 100644 miniprogram/tcb-demo-sports/cloudfunctions/savetext/index.js create mode 100644 miniprogram/tcb-demo-sports/cloudfunctions/savetext/package.json create mode 100644 miniprogram/tcb-demo-sports/cloudfunctions/secimg/config.json create mode 100644 miniprogram/tcb-demo-sports/cloudfunctions/secimg/index.js create mode 100644 miniprogram/tcb-demo-sports/cloudfunctions/secimg/package.json create mode 100644 miniprogram/tcb-demo-sports/cloudfunctions/sectext/config.json create mode 100644 miniprogram/tcb-demo-sports/cloudfunctions/sectext/index.js create mode 100644 miniprogram/tcb-demo-sports/cloudfunctions/sectext/package.json create mode 100644 miniprogram/tcb-demo-sports/cloudfunctions/setstar/config.json create mode 100644 miniprogram/tcb-demo-sports/cloudfunctions/setstar/index.js create mode 100644 miniprogram/tcb-demo-sports/cloudfunctions/setstar/package.json create mode 100644 miniprogram/tcb-demo-sports/cloudfunctions/tostar/config.json create mode 100644 miniprogram/tcb-demo-sports/cloudfunctions/tostar/index.js create mode 100644 miniprogram/tcb-demo-sports/cloudfunctions/tostar/package.json create mode 100644 miniprogram/tcb-demo-sports/miniprogram/app.js create mode 100644 miniprogram/tcb-demo-sports/miniprogram/app.json create mode 100644 miniprogram/tcb-demo-sports/miniprogram/app.wxss create mode 100644 miniprogram/tcb-demo-sports/miniprogram/ec-canvas/ec-canvas.js create mode 100644 miniprogram/tcb-demo-sports/miniprogram/ec-canvas/ec-canvas.json create mode 100644 miniprogram/tcb-demo-sports/miniprogram/ec-canvas/ec-canvas.wxml create mode 100644 miniprogram/tcb-demo-sports/miniprogram/ec-canvas/ec-canvas.wxss create mode 100644 miniprogram/tcb-demo-sports/miniprogram/ec-canvas/echarts.js create mode 100644 miniprogram/tcb-demo-sports/miniprogram/ec-canvas/wx-canvas.js create mode 100644 miniprogram/tcb-demo-sports/miniprogram/image/share.png create mode 100644 miniprogram/tcb-demo-sports/miniprogram/pages/edit/edit.js create mode 100644 miniprogram/tcb-demo-sports/miniprogram/pages/edit/edit.json create mode 100644 miniprogram/tcb-demo-sports/miniprogram/pages/edit/edit.wxml create mode 100644 miniprogram/tcb-demo-sports/miniprogram/pages/edit/edit.wxss create mode 100644 miniprogram/tcb-demo-sports/miniprogram/pages/index/index.js create mode 100644 miniprogram/tcb-demo-sports/miniprogram/pages/index/index.json create mode 100644 miniprogram/tcb-demo-sports/miniprogram/pages/index/index.wxml create mode 100644 miniprogram/tcb-demo-sports/miniprogram/pages/index/index.wxss create mode 100644 miniprogram/tcb-demo-sports/miniprogram/pages/show/show.js create mode 100644 miniprogram/tcb-demo-sports/miniprogram/pages/show/show.json create mode 100644 miniprogram/tcb-demo-sports/miniprogram/pages/show/show.wxml create mode 100644 miniprogram/tcb-demo-sports/miniprogram/pages/show/show.wxss create mode 100644 miniprogram/tcb-demo-sports/miniprogram/sitemap.json create mode 100644 miniprogram/tcb-demo-sports/project.config.json diff --git a/miniprogram/tcb-demo-breakfast/README.md b/miniprogram/tcb-demo-breakfast/README.md new file mode 100644 index 0000000..dede224 --- /dev/null +++ b/miniprogram/tcb-demo-breakfast/README.md @@ -0,0 +1,22 @@ +# 【外卖点餐-早餐预定】小程序云开发项目实战 + +## 项目介绍 + +- 小程序模拟一个商户对辖区内供应早餐的情景,用户通过在线预定早餐,商户实施配送,直到付款配送完成整个流程。整个流程分为预定中,已确认,已完成3个状态。在预定中状态用户可以取消预定。其他时候用户可以发起客服会话。 +- 因为模拟展示,所以没有添加商户端和配送员端,状态变化由时间触发。 + + +## 部署介绍 + +此处为项目完整代码,可以直接部署使用;以下是部署步骤: + +- 初始化云开发环境,如果有多个云开发环境造成wx.cloud.init错误,则在app.js处进行环境定义; +- 在云开发环境中创建一个数据库,名称为food; +- 将项目目录下base文件夹中的food.json文件导入food数据库; +- 将项目目录下base文件夹中的food.jpg图片文件上传至云存储,并将CloudID填写到food数据库ADMIN中的img字段里; +- 将cloudfunctions文件夹内的6个云函数创建并部署,并将donefood、sendfood云函数上传触发器; +- 打开云开发控制台-设置tag-全局设置,添加消息推送,选择消息类型为text,环境ID选择你部署的环境ID,云函数选择contact; + +## 参考文档 + +- [云开发文档](https://developers.weixin.qq.com/miniprogram/dev/wxcloud/basis/getting-started.html) \ No newline at end of file diff --git a/miniprogram/tcb-demo-breakfast/base/food.jpg b/miniprogram/tcb-demo-breakfast/base/food.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0a05a44721e2ca5258158cc633439dca8bd5e4a4 GIT binary patch literal 10484 zcmb7qbzD@@x9kdW?%VQ7#T zy6*V9_kHerf4(&{`?neRn=4h92^|r1@;5n&H_pR>3!k{ z#6+YINFI=rky6lb(a}&-(+IP&KjxAak&~4Yk(7A)!d&~QvXP2}TzqkEg!oj_Rhfi=9D^wr_aB*?&;NsoEC&0tUyMwKR6_VkRGYdb%rvSfZ@q7c) zP0Sf4pj526|s?F*|=D`1Kjx^ zISww_9cFT2yk`_FU`mkZ>)RQC7%Rha$p8glb7v{|e(mK$N3izb>%vDajBQ*~QRo8m zTrpCS^N_nR$0>SX5FKaeFhvCDe^Gl{qYN9#&By)yi!DX1OA<%5+Bi3nE7y@y$^Dxv zUz;V-$-z*t+EM^lg*(H2N4GnGQMEYCQV2g-rMeEMnx!nKy3WCps5ZvY4?moHhF+sK z#(~O}B)>`Nzb`7)EX_I9-yK|uib|<^9@VGz;Mu3Vkc3zB=Tq*UkRUo|l^iGwlfZm4 zG`P(cL2hwRm4+jcih*DxfDtHh|8{aoZ5e=@PqxeX zrtpp7PuHEqU}c+c;lJtF%K9@BM#&0b}ZW#Dtas?BTeQ6!Bm? z$pOhHJ4GJ5Wg%;k?QNEsp6s7%*mn+T2rF>j_TR@R{mDRWX^cyQYfSOse^9lCxLO7Pz zFD#X{D7tZ-!$H>JKlyOlVFaHn1GtPC?}h_yZI-xgLv8==3Dro50S5;q75$-ma1(h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>|QhN6}w~j5Oks&|9X8oT=cIe}_bpXtjKsYw!l48rxgv6#a zHo%v?$8EO%(d;F$5+NQoHQ$E);@!boITfLh5H1ac@;(h$Sx3y9e}~Sdcj)hbqkmfR znw`9#0Ek?)QfK={gTqF{1~7*={Y&X%5yBD j|2uJn?GbD;9B5+(+6XJj0TvcT9PB!bjO{nh?eu>E)+QI) literal 0 HcmV?d00001 diff --git a/miniprogram/tcb-demo-breakfast/base/food.json b/miniprogram/tcb-demo-breakfast/base/food.json new file mode 100644 index 0000000..ada33d5 --- /dev/null +++ b/miniprogram/tcb-demo-breakfast/base/food.json @@ -0,0 +1 @@ +{"_id":"ADMIN","ban":[],"tel":"13255524548","price":15.0,"food":"WAMAFO独营营养新鲜早餐全餐【手抓饼、玉米、坚果、黑豆浆、水果小食】","img":"","tips":"每个用户每天只能购买一次,在订餐时需要你的个人信息用于核验;若你点餐但不收配送也不付款则影响你后续的订餐。"} diff --git a/miniprogram/tcb-demo-breakfast/cloudfunctions/cancelfood/config.json b/miniprogram/tcb-demo-breakfast/cloudfunctions/cancelfood/config.json new file mode 100644 index 0000000..5ecc33e --- /dev/null +++ b/miniprogram/tcb-demo-breakfast/cloudfunctions/cancelfood/config.json @@ -0,0 +1,6 @@ +{ + "permissions": { + "openapi": [ + ] + } +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-breakfast/cloudfunctions/cancelfood/index.js b/miniprogram/tcb-demo-breakfast/cloudfunctions/cancelfood/index.js new file mode 100644 index 0000000..7e17678 --- /dev/null +++ b/miniprogram/tcb-demo-breakfast/cloudfunctions/cancelfood/index.js @@ -0,0 +1,11 @@ +const cloud = require('wx-server-sdk') + +cloud.init(); +const db = cloud.database(); +const _ = db.command; + +exports.main = async (event, context) => { + await db.collection('food').where({ + userID:event.userInfo.openId + }).remove(); +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-breakfast/cloudfunctions/cancelfood/package.json b/miniprogram/tcb-demo-breakfast/cloudfunctions/cancelfood/package.json new file mode 100644 index 0000000..16dfd6e --- /dev/null +++ b/miniprogram/tcb-demo-breakfast/cloudfunctions/cancelfood/package.json @@ -0,0 +1,14 @@ +{ + "name": "cancelfood", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "wx-server-sdk": "~1.8.0" + } +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-breakfast/cloudfunctions/contact/config.json b/miniprogram/tcb-demo-breakfast/cloudfunctions/contact/config.json new file mode 100644 index 0000000..43aa5fc --- /dev/null +++ b/miniprogram/tcb-demo-breakfast/cloudfunctions/contact/config.json @@ -0,0 +1,7 @@ +{ + "permissions": { + "openapi": [ + "customerServiceMessage.send" + ] + } +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-breakfast/cloudfunctions/contact/index.js b/miniprogram/tcb-demo-breakfast/cloudfunctions/contact/index.js new file mode 100644 index 0000000..40c8a13 --- /dev/null +++ b/miniprogram/tcb-demo-breakfast/cloudfunctions/contact/index.js @@ -0,0 +1,31 @@ +// 云函数入口文件 +const cloud = require('wx-server-sdk') + +cloud.init(); +const db = cloud.database(); +const _ = db.command; + +// 云函数入口函数 +exports.main = async (event, context) => { + console.log(event); + + let content = "收到消息,将在稍后打电话处理" + + if(event.Content.indexOf('取消')!=-1){ + await db.collection('food').where({ + userID:event.userInfo.openId + }).remove(); + content='已经成功删除' + } + + + await cloud.openapi.customerServiceMessage.send({ + touser: event.userInfo.openId, + msgtype: 'text', + text: { + content: content, + }, + }) + + return 'success' +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-breakfast/cloudfunctions/contact/package.json b/miniprogram/tcb-demo-breakfast/cloudfunctions/contact/package.json new file mode 100644 index 0000000..628191c --- /dev/null +++ b/miniprogram/tcb-demo-breakfast/cloudfunctions/contact/package.json @@ -0,0 +1,14 @@ +{ + "name": "contact", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "wx-server-sdk": "~1.8.0" + } +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-breakfast/cloudfunctions/donefood/config.json b/miniprogram/tcb-demo-breakfast/cloudfunctions/donefood/config.json new file mode 100644 index 0000000..8f32fc2 --- /dev/null +++ b/miniprogram/tcb-demo-breakfast/cloudfunctions/donefood/config.json @@ -0,0 +1,14 @@ +{ + "permissions": { + "openapi": [ + "subscribeMessage.send" + ] + }, + "triggers": [ + { + "name": "sendMessagerTimer", + "type": "timer", + "config": "*/5 * * * * * *" + } + ] +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-breakfast/cloudfunctions/donefood/index.js b/miniprogram/tcb-demo-breakfast/cloudfunctions/donefood/index.js new file mode 100644 index 0000000..45863e6 --- /dev/null +++ b/miniprogram/tcb-demo-breakfast/cloudfunctions/donefood/index.js @@ -0,0 +1,40 @@ +const cloud = require('wx-server-sdk'); +const doneSID = 'Xw4e3cMQ3Bp2Fm2B4xaPZ213BicUK1CeozGoBUrcBDA'; + +cloud.init(); +const db = cloud.database(); +const _ = db.command; + +exports.main = async (event, context) => { + try { + let now = new Date(new Date().getTime()+28800000); + const messages = await db.collection('food').where({ + state : 1, + donetime: _.lt(now) + }).get(); + + const sendPromises = messages.data.map(async message => { + try { + if(message.doneMess==true){ + await cloud.openapi.subscribeMessage.send({ + touser: message.userID, + page: 'index', + data: message.doneContent, + templateId: doneSID, + }); + } + return db.collection('food').doc(message._id).update({ + data: { + state: 2 + }, + }); + } catch (e) { + return e; + } + }); + return Promise.all(sendPromises); + } catch (err) { + console.log(err); + return err; + } +}; \ No newline at end of file diff --git a/miniprogram/tcb-demo-breakfast/cloudfunctions/donefood/package.json b/miniprogram/tcb-demo-breakfast/cloudfunctions/donefood/package.json new file mode 100644 index 0000000..786f7a1 --- /dev/null +++ b/miniprogram/tcb-demo-breakfast/cloudfunctions/donefood/package.json @@ -0,0 +1,14 @@ +{ + "name": "donefood", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "wx-server-sdk": "~1.8.0" + } +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-breakfast/cloudfunctions/initfood/config.json b/miniprogram/tcb-demo-breakfast/cloudfunctions/initfood/config.json new file mode 100644 index 0000000..5ecc33e --- /dev/null +++ b/miniprogram/tcb-demo-breakfast/cloudfunctions/initfood/config.json @@ -0,0 +1,6 @@ +{ + "permissions": { + "openapi": [ + ] + } +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-breakfast/cloudfunctions/initfood/index.js b/miniprogram/tcb-demo-breakfast/cloudfunctions/initfood/index.js new file mode 100644 index 0000000..b1d4f34 --- /dev/null +++ b/miniprogram/tcb-demo-breakfast/cloudfunctions/initfood/index.js @@ -0,0 +1,41 @@ +const cloud = require('wx-server-sdk') + +cloud.init(); +const db = cloud.database(); +const _ = db.command; + +exports.main = async (event, context) => { + try{ + const AFood = (await db.collection('food').doc('ADMIN').get()).data; + + const User = (await db.collection('food').where({ + userID:event.userInfo.openId + }).get()).data + + if(User.length != 0){ + return { + Food:AFood, + state:User[0].state, + submittime:User[0].submittime, + SID:User[0].SID, + statetime:User[0].statetime!=null?User[0].statetime:null, + donetime:User[0].donetime!=null?User[0].donetime:null + } + } + else{ + //判断用户是否被禁止预定,此为手动添加 + if(AFood.ban.indexOf(event.userInfo.openId)==-1){ + return { + Food:AFood, + } + } + else{ + return 1 + } + } + } + catch(e){ + console.log(e); + return -1 + } +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-breakfast/cloudfunctions/initfood/package.json b/miniprogram/tcb-demo-breakfast/cloudfunctions/initfood/package.json new file mode 100644 index 0000000..10a5c8c --- /dev/null +++ b/miniprogram/tcb-demo-breakfast/cloudfunctions/initfood/package.json @@ -0,0 +1,14 @@ +{ + "name": "initfood", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "wx-server-sdk": "~1.8.0" + } +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-breakfast/cloudfunctions/sendfood/config.json b/miniprogram/tcb-demo-breakfast/cloudfunctions/sendfood/config.json new file mode 100644 index 0000000..8f32fc2 --- /dev/null +++ b/miniprogram/tcb-demo-breakfast/cloudfunctions/sendfood/config.json @@ -0,0 +1,14 @@ +{ + "permissions": { + "openapi": [ + "subscribeMessage.send" + ] + }, + "triggers": [ + { + "name": "sendMessagerTimer", + "type": "timer", + "config": "*/5 * * * * * *" + } + ] +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-breakfast/cloudfunctions/sendfood/index.js b/miniprogram/tcb-demo-breakfast/cloudfunctions/sendfood/index.js new file mode 100644 index 0000000..4665d61 --- /dev/null +++ b/miniprogram/tcb-demo-breakfast/cloudfunctions/sendfood/index.js @@ -0,0 +1,41 @@ +const cloud = require('wx-server-sdk'); +const stateSID = 'gkuwX69tU4YsS6Up6Lhhh3G8eSzh1SgN4zSifDfYk0c'; + +cloud.init(); +const db = cloud.database(); +const _ = db.command; + +exports.main = async (event, context) => { + try { + let now = new Date(new Date().getTime()+28800000); + const messages = await db.collection('food').where({ + state : 0, + statetime: _.lt(now) + }).get(); + + const sendPromises = messages.data.map(async message => { + try { + if(message.stateMess==true){ + console.log(message.stateContent) + await cloud.openapi.subscribeMessage.send({ + touser: message.userID, + page: 'index', + data: message.stateContent, + templateId: stateSID, + }); + } + return db.collection('food').doc(message._id).update({ + data: { + state: 1 + }, + }); + } catch (e) { + return e; + } + }); + return Promise.all(sendPromises); + } catch (err) { + console.log(err); + return err; + } +}; \ No newline at end of file diff --git a/miniprogram/tcb-demo-breakfast/cloudfunctions/sendfood/package.json b/miniprogram/tcb-demo-breakfast/cloudfunctions/sendfood/package.json new file mode 100644 index 0000000..933fcaf --- /dev/null +++ b/miniprogram/tcb-demo-breakfast/cloudfunctions/sendfood/package.json @@ -0,0 +1,14 @@ +{ + "name": "sendfood", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "wx-server-sdk": "~1.8.0" + } +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-breakfast/cloudfunctions/submitfood/config.json b/miniprogram/tcb-demo-breakfast/cloudfunctions/submitfood/config.json new file mode 100644 index 0000000..5ecc33e --- /dev/null +++ b/miniprogram/tcb-demo-breakfast/cloudfunctions/submitfood/config.json @@ -0,0 +1,6 @@ +{ + "permissions": { + "openapi": [ + ] + } +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-breakfast/cloudfunctions/submitfood/index.js b/miniprogram/tcb-demo-breakfast/cloudfunctions/submitfood/index.js new file mode 100644 index 0000000..eff1a88 --- /dev/null +++ b/miniprogram/tcb-demo-breakfast/cloudfunctions/submitfood/index.js @@ -0,0 +1,87 @@ +const cloud = require('wx-server-sdk') + +cloud.init(); +const db = cloud.database(); +const _ = db.command; + +exports.main = async (event, context) => { + try{ + const AFood = (await db.collection('food').doc('ADMIN').get()).data; + console.log(AFood); + + var foodData={ + Info:event.Info, + Address:event.Address, + stateMess:event.stateMess, + doneMess:event.doneMess + }; + + let nowtime = new Date(new Date().getTime()+28800000); + + foodData.state = 0; + foodData.submittime = nowtime; + foodData.SID = event.userInfo.openId.slice(0,4)+nowtime.getTime(); + foodData.userID = event.userInfo.openId; + foodData.statetime = new Date(Date.parse(nowtime) + 5000); + foodData.donetime = new Date(Date.parse(nowtime) + 15000); + + if(event.stateMess==true){ + foodData.stateContent={ + character_string6:{ + value:foodData.SID + }, + date3:{ + value:formdate(foodData.submittime) + }, + thing12:{ + value:event.Address.detailInfo.slice(0,20) + }, + date13:{ + value:formdate(foodData.donetime) + }, + phone_number11:{ + value:AFood.tel + } + } + } + if(event.doneMess==true){ + foodData.doneContent={ + character_string1:{ + value:foodData.SID + }, + amount2:{ + value:AFood.price+'元' + }, + phrase3:{ + value:'配送完成' + }, + date4:{ + value:formdate(foodData.donetime) + } + } + } + const result = await db.collection('food').add({ + data:foodData + }); + + return { + code:0, + res:result + } + } + catch(e){ + console.log(e); + return { + code:-1 + } + } +} + +function formdate(date){ + var year = date.getFullYear(); + var month = date.getMonth() + 1; + var date1 = date.getDate(); + var hour = date.getHours(); + var minutes = date.getMinutes(); + return year + "年" + month + "月" + date1 + "日 " + hour + ":" + minutes; +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-breakfast/cloudfunctions/submitfood/package.json b/miniprogram/tcb-demo-breakfast/cloudfunctions/submitfood/package.json new file mode 100644 index 0000000..7b043b5 --- /dev/null +++ b/miniprogram/tcb-demo-breakfast/cloudfunctions/submitfood/package.json @@ -0,0 +1,14 @@ +{ + "name": "submitfood", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "wx-server-sdk": "~1.8.0" + } +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-breakfast/miniprogram/app.js b/miniprogram/tcb-demo-breakfast/miniprogram/app.js new file mode 100644 index 0000000..37c4db9 --- /dev/null +++ b/miniprogram/tcb-demo-breakfast/miniprogram/app.js @@ -0,0 +1,12 @@ +//app.js +App({ + onLaunch: function () { + if (!wx.cloud) { + console.error('请使用 2.2.3 或以上的基础库以使用云能力') + } else { + wx.cloud.init({ + traceUser: true + }) + } + } +}) diff --git a/miniprogram/tcb-demo-breakfast/miniprogram/app.json b/miniprogram/tcb-demo-breakfast/miniprogram/app.json new file mode 100644 index 0000000..fa38d85 --- /dev/null +++ b/miniprogram/tcb-demo-breakfast/miniprogram/app.json @@ -0,0 +1,13 @@ +{ + "pages": [ + "pages/index/index" + ], + "window": { + "backgroundColor": "#2c2c2c", + "navigationStyle":"custom", + "backgroundTextStyle": "light", + "navigationBarTextStyle": "white" + }, + "sitemapLocation": "sitemap.json", + "style": "v2" +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-breakfast/miniprogram/app.wxss b/miniprogram/tcb-demo-breakfast/miniprogram/app.wxss new file mode 100644 index 0000000..e69de29 diff --git a/miniprogram/tcb-demo-breakfast/miniprogram/pages/index/index.js b/miniprogram/tcb-demo-breakfast/miniprogram/pages/index/index.js new file mode 100644 index 0000000..c7a6df0 --- /dev/null +++ b/miniprogram/tcb-demo-breakfast/miniprogram/pages/index/index.js @@ -0,0 +1,155 @@ +const app = getApp(); +var that = this; +const doneSID = 'Xw4e3cMQ3Bp2Fm2B4xaPZ213BicUK1CeozGoBUrcBDA' +const stateSID = 'gkuwX69tU4YsS6Up6Lhhh3G8eSzh1SgN4zSifDfYk0c'; + +Page({ + data:{ + sale:false, + model:0 + }, + onLoad(){ + that = this; + }, + onShow(){ + this.init(); + }, + init(){ + wx.cloud.callFunction({ + name:'initfood', + success(res){ + console.log(res.result) + let mess = {} + if(res.result==-1) mess.model=3;//加载失败 + else if(res.result==1) mess.model=4;//被禁止 + else{ + if(res.result.state==null){ + mess.model=1; + mess.desc='早餐价格:'+res.result.Food.price+'元'; + mess.tips=res.result.Food.tips; + mess.fooddes=res.result.Food.food; + mess.foodimg=res.result.Food.img; + } + else{ + mess.model=2; + mess.state=res.result.state; + mess.submittime=res.result.submittime; + mess.SID=res.result.SID; + mess.statetime=res.result.statetime; + mess.donetime=res.result.donetime; + mess.tel = res.result.Food.tel; + } + } + that.setData(mess); + }, + fail(e){ + console.log(e); + } + }) + }, + select(e){ + this.setData({ + sale:true + }) + }, + submit(e){ + if(e.detail.errMsg=="getUserInfo:ok"){ + this.uInfo = e.detail.userInfo; + wx.chooseAddress({ + success (res) { + that.uAddress = res; + console.log(res); + let name = res.userName; + let tel = res.telNumber; + + if(res.cityName=="深圳市"&&res.countyName=="南山区"){ + let address = res.provinceName + res.cityName + res.countyName + res.detailInfo; + + that.setData({ + taddress:address, + tname:name, + ttel:tel, + sale:false, + conf:true, + nosubmit:false + }) + } + else{ + that.setData({ + taddress:"当前地址不在配送范围内,只限深圳市南山区,感谢理解!", + tname:name, + ttel:tel, + sale:false, + conf:true, + nosubmit:true + }) + } + } + }) + } + }, + cancel(){ + wx.showLoading({ + title:'取消中' + }) + wx.cloud.callFunction({ + name:'cancelfood', + success(){ + that.init(); + wx.showToast({ + title: '取消成功', + }) + } + }) + }, + reset(){ + that.setData({ + sale:true, + conf:false + }) + }, + confirm(){ + wx.requestSubscribeMessage({ + tmplIds: [stateSID,doneSID], + success(res) { + if (res.errMsg === 'requestSubscribeMessage:ok') { + console.log(res); + that.setData({conf:false}) + wx.showLoading({ + title: '订餐中', + mask:true + }) + let doneMess = (res[doneSID]=='accept'); + let stateMess = (res[stateSID]=='accept'); + wx.cloud.callFunction({ + name: 'submitfood', + data: { + Info:that.uInfo, + Address:that.uAddress, + stateMess:stateMess, + doneMess:doneMess + }, + success(res){ + wx.hideLoading(); + that.init(); + wx.showToast({ + title: '订餐成功' + }); + }, + fail(e){ + wx.hideLoading(); + wx.showModal({ + title:'网络错误', + content:'订餐请求发起失败,请检查网络后重新尝试!', + showCancel:false + }) + } + }) + } + }, + }); + }, + handleContact(e){ + console.log(e); + } +}) diff --git a/miniprogram/tcb-demo-breakfast/miniprogram/pages/index/index.json b/miniprogram/tcb-demo-breakfast/miniprogram/pages/index/index.json new file mode 100644 index 0000000..761e07b --- /dev/null +++ b/miniprogram/tcb-demo-breakfast/miniprogram/pages/index/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "half":"../../ui/half-screen-dialog/half-screen-dialog" + } +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-breakfast/miniprogram/pages/index/index.wxml b/miniprogram/tcb-demo-breakfast/miniprogram/pages/index/index.wxml new file mode 100644 index 0000000..96c601d --- /dev/null +++ b/miniprogram/tcb-demo-breakfast/miniprogram/pages/index/index.wxml @@ -0,0 +1,50 @@ + + +准备中 + + + + + {{fooddes}} + + + + + + 早餐预定单 + 预定状态:{{state==0?'已预定,等待确认':(state==1?'已确认,正在送货':'配送完成,已支付')}} + 预定编号:{{SID}} + 预定时间:{{tools.date(submittime)}} + 确定时间:{{tools.date(statetime)}} + 配餐电话:{{tel}} + 送达时间:{{tools.date(donetime)}} + + + + + + + + + + + + + + + + diff --git a/miniprogram/tcb-demo-breakfast/miniprogram/pages/index/index.wxss b/miniprogram/tcb-demo-breakfast/miniprogram/pages/index/index.wxss new file mode 100644 index 0000000..5a39193 --- /dev/null +++ b/miniprogram/tcb-demo-breakfast/miniprogram/pages/index/index.wxss @@ -0,0 +1,91 @@ +page{ + background:linear-gradient(to top right,#94a3fc,#fc9799); + display: flex; + height: 100%; +} +.loadshow{ + margin: auto; + font-size: 25px; + color: #FFFFFF; + font-weight: 900; + letter-spacing: 5px; + animation: loading 5s; + animation-iteration-count:12; + -webkit-animation: loading 5s; + -webkit-animation-iteration-count:12; +} +@keyframes loading +{ + 0% {color: #FFFFFF;} + 50% {color: #f3cd7a;} + 100% {color: #FFFFFF;} +} +@-webkit-keyframes loading +{ + 0% {color: #FFFFFF;} + 50% {color: #f3cd7a;} + 100% {color: #FFFFFF;} +} +.model{ + height: 310px; + width: 600rpx; + padding: 20px 25rpx; + margin:auto; + background-color: white; + box-shadow: 0 3px 10px rgba(0,0,0,0.3),0 0 10px rgba(0,0,0,0.1) inset; +} +.M_title{ + font-size: 20px; + font-weight: 900; + color: #454545; + letter-spacing: 3px; + text-align: center; + margin-bottom: 20px; +} +.M_item{ + font-size: 15px; + color: #565656; + height: 40px; + line-height: 40px; +} +.blob{ + font-weight: 900; +} +.M_btn{ + margin-top:30px; +} +.foodshow{ + width: 500rpx; + margin: 0 50rpx; +} +.foodimg{ + width: 500rpx; + height: 500rpx; +} +.fooddes{ + font-size: 12px; + color: rgb(82, 97, 176); +} +.selectbtn{ + margin-top: 15px; + background-color: #fc9799; + color: white; + border-radius: 0; + font-size: 14px; + padding: 0; + height: 40px; + line-height: 40px; +} +.conffooter{ + display: flex; + width: 640rpx; + margin-left: -55rpx; +} +.confbtn{ + margin: auto; + max-width: 300rpx; + height: 40px; + font-size: 13px; + padding: 0; + line-height: 40px; +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-breakfast/miniprogram/pages/index/tools.wxs b/miniprogram/tcb-demo-breakfast/miniprogram/pages/index/tools.wxs new file mode 100644 index 0000000..c3126d8 --- /dev/null +++ b/miniprogram/tcb-demo-breakfast/miniprogram/pages/index/tools.wxs @@ -0,0 +1,6 @@ +var date = function (data) { + return data.slice(5, 7) + "月" + data.slice(8, 10) + "日"+data.slice(11, 19); +} +module.exports = { + date:date +}; \ No newline at end of file diff --git a/miniprogram/tcb-demo-breakfast/miniprogram/sitemap.json b/miniprogram/tcb-demo-breakfast/miniprogram/sitemap.json new file mode 100644 index 0000000..ca02add --- /dev/null +++ b/miniprogram/tcb-demo-breakfast/miniprogram/sitemap.json @@ -0,0 +1,7 @@ +{ + "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", + "rules": [{ + "action": "allow", + "page": "*" + }] +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-breakfast/miniprogram/ui/half-screen-dialog/half-screen-dialog.js b/miniprogram/tcb-demo-breakfast/miniprogram/ui/half-screen-dialog/half-screen-dialog.js new file mode 100644 index 0000000..9f7c6eb --- /dev/null +++ b/miniprogram/tcb-demo-breakfast/miniprogram/ui/half-screen-dialog/half-screen-dialog.js @@ -0,0 +1,165 @@ +module.exports = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 17); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ 17: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Component({ + options: { + multipleSlots: true, + addGlobalClass: true + }, + properties: { + closabled: { + type: Boolean, + value: true + }, + title: { + type: String, + value: '' + }, + subTitle: { + type: String, + value: '' + }, + extClass: { + type: String, + value: '' + }, + desc: { + type: String, + value: '' + }, + tips: { + type: String, + value: '' + }, + maskClosable: { + type: Boolean, + value: true + }, + mask: { + type: Boolean, + value: true + }, + show: { + type: Boolean, + value: false, + observer: '_showChange' + }, + buttons: { + type: Array, + value: [] + } + }, + methods: { + close: function close(e) { + var type = e.currentTarget.dataset.type; + + if (this.data.maskClosable || type === 'close') { + this.setData({ + show: false + }); + this.triggerEvent('close'); + } + }, + buttonTap: function buttonTap(e) { + var index = e.currentTarget.dataset.index; + + this.triggerEvent('buttontap', { index: index, item: this.data.buttons[index] }, {}); + } + } +}); + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/miniprogram/tcb-demo-breakfast/miniprogram/ui/half-screen-dialog/half-screen-dialog.json b/miniprogram/tcb-demo-breakfast/miniprogram/ui/half-screen-dialog/half-screen-dialog.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/miniprogram/tcb-demo-breakfast/miniprogram/ui/half-screen-dialog/half-screen-dialog.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-breakfast/miniprogram/ui/half-screen-dialog/half-screen-dialog.wxml b/miniprogram/tcb-demo-breakfast/miniprogram/ui/half-screen-dialog/half-screen-dialog.wxml new file mode 100644 index 0000000..7aa5d49 --- /dev/null +++ b/miniprogram/tcb-demo-breakfast/miniprogram/ui/half-screen-dialog/half-screen-dialog.wxml @@ -0,0 +1,43 @@ + + + + + + 关闭 + + + + {{title}} + {{subTitle}} + + + + + + + 更多 + + + + + {{desc}} + {{tips}} + + + + + + + + + + + + \ No newline at end of file diff --git a/miniprogram/tcb-demo-breakfast/miniprogram/ui/half-screen-dialog/half-screen-dialog.wxss b/miniprogram/tcb-demo-breakfast/miniprogram/ui/half-screen-dialog/half-screen-dialog.wxss new file mode 100644 index 0000000..93f2fe2 --- /dev/null +++ b/miniprogram/tcb-demo-breakfast/miniprogram/ui/half-screen-dialog/half-screen-dialog.wxss @@ -0,0 +1 @@ +.weui-half-screen-dialog{position:fixed;left:0;right:0;bottom:0;max-height:75%;z-index:5000;line-height:1.4;background-color:#FFFFFF;border-top-left-radius:12px;border-top-right-radius:12px;overflow:hidden;padding:0 24px;padding:0 calc(24px + constant(safe-area-inset-right)) constant(safe-area-inset-bottom) calc(24px + constant(safe-area-inset-left));padding:0 calc(24px + env(safe-area-inset-right)) env(safe-area-inset-bottom) calc(24px + env(safe-area-inset-left))}.weui-half-screen-dialog__hd{font-size:8px;height:8em;display:flex;align-items:center}.weui-half-screen-dialog__hd .weui-icon-btn{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.weui-half-screen-dialog__hd__side{position:relative;left:-8px}.weui-half-screen-dialog__hd__main{flex:1}.weui-half-screen-dialog__hd__side+.weui-half-screen-dialog__hd__main{text-align:center;padding:0 40px}.weui-half-screen-dialog__hd__main+.weui-half-screen-dialog__hd__side{right:-8px;left:auto}.weui-half-screen-dialog__hd__main+.weui-half-screen-dialog__hd__side .weui-icon-btn{right:0}.weui-half-screen-dialog__title{display:block;color:rgba(0,0,0,0.9);font-weight:700;font-size:15px}.weui-half-screen-dialog__subtitle{display:block;color:rgba(0,0,0,0.5);font-size:10px}.weui-half-screen-dialog__bd{word-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;overflow-y:auto}.weui-half-screen-dialog__desc{padding-top:4px;font-size:17px;font-weight:700;color:rgba(0,0,0,0.9);line-height:1.4}.weui-half-screen-dialog__tips{padding-top:16px;font-size:14px;color:rgba(0,0,0,0.3);line-height:1.4}.weui-half-screen-dialog__ft{padding:40px 24px 32px;text-align:center}.weui-half-screen-dialog__ft .weui-btn:nth-last-child(n+2),.weui-half-screen-dialog__ft .weui-btn:nth-last-child(n+2)+.weui-btn{display:inline-block;vertical-align:top;margin:0 8px;width:120px}.weui-icon-btn{background-color:transparent;background-repeat:no-repeat;background-position:50% 50%;background-size:100%;border:0;outline:0;font-size:0}.weui-icon-btn_goback{width:12px;height:24px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='24' viewBox='0 0 12 24'%3E %3Cg fill='none' fill-rule='evenodd' transform='translate(-16 -20)'%3E %3Cpath fill='%23FFF' d='M0 12C0 5.373 5.367 0 12 0h390c6.628 0 12 5.374 12 12v52H0V12z'/%3E %3Cpath fill='%23000' fill-opacity='.9' d='M26 39.438L24.955 40.5l-7.666-7.79a1.02 1.02 0 0 1 0-1.42l7.666-7.79L26 24.563 18.682 32 26 39.438z'/%3E %3C/g%3E%3C/svg%3E")}.weui-icon-btn_close{width:24px;height:24px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='24' height='24' viewBox='0 0 24 24'%3E %3Cdefs%3E %3Cpath id='33cf2e7b-22e9-42d7-9c56-a9f4a4e03565-a' d='M8 6.943L1.807.75.75 1.807 6.943 8 .75 14.193l1.057 1.057L8 9.057l6.193 6.193 1.057-1.057L9.057 8l6.193-6.193L14.193.75z'/%3E %3C/defs%3E %3Cg fill='none' fill-rule='evenodd' transform='translate(-16 -20)'%3E %3Cpath fill='%23FFF' d='M0 12C0 5.373 5.367 0 12 0h390c6.628 0 12 5.374 12 12v52H0V12z'/%3E %3Cuse fill='%23000' fill-opacity='.9' transform='translate(20 24)' xlink:href='%2333cf2e7b-22e9-42d7-9c56-a9f4a4e03565-a'/%3E %3C/g%3E%3C/svg%3E")}.weui-icon-btn_more{width:24px;height:24px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Cg fill='none' fill-rule='evenodd' transform='translate(-374 -20)'%3E %3Cpath fill='%23FFF' d='M0 12C0 5.373 5.367 0 12 0h390c6.628 0 12 5.374 12 12v52H0V12z'/%3E %3Cpath fill='%23000' fill-opacity='.9' d='M380.75 32a1.75 1.75 0 1 1-3.5 0 1.75 1.75 0 0 1 3.5 0zm5.25-1.75a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5zm7 0a1.75 1.75 0 1 1 0 3.5 1.75 1.75 0 0 1 0-3.5z'/%3E %3C/g%3E%3C/svg%3E")}.weui-mask{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0;background:rgba(0,0,0,0.6)}.weui-mask_transparent{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0}.weui-mask,.weui-half-screen-dialog{transition:all .3s}.weui-hidden .weui-mask{visibility:hidden;opacity:0}.weui-hidden .weui-half-screen-dialog{transform:translateY(100%)}.weui-show .weui-mask{opacity:1;visibility:visible}.weui-show .weui-half-screen-dialog{transform:translateY(0%)} \ No newline at end of file diff --git a/miniprogram/tcb-demo-breakfast/miniprogram/ui/static/icon/s-arrow-back.png b/miniprogram/tcb-demo-breakfast/miniprogram/ui/static/icon/s-arrow-back.png new file mode 100644 index 0000000000000000000000000000000000000000..720481d574ef15d62d15f7641daca6f8ad575604 GIT binary patch literal 987 zcmV<110?*3P)Px&l}SWFRA>e5S-rApF%*tFx6rE?l`$0PR0=a@yn&%mcnXy#PC>*aF_lU^1_5U>nS_cL zIy{j`kkM!)BLPw@7H`AhkfLMo`G9=4jI(P<4TT%HV3((HPs{=*P2wW3wiW>lXtV!fBKT53u1Q}G zVZGL1!@zpIE)03(rf8H-OVQy9T8XO>`)oN)XMCf2JAnkTrGGpmz!LE$G$4 z0t + + + Icons/Filled/arrow Copy 2 + Created with Sketch. + + + + + + + + + + + + + + + diff --git a/miniprogram/tcb-demo-breakfast/project.config.json b/miniprogram/tcb-demo-breakfast/project.config.json new file mode 100644 index 0000000..be296e3 --- /dev/null +++ b/miniprogram/tcb-demo-breakfast/project.config.json @@ -0,0 +1,38 @@ +{ + "miniprogramRoot": "miniprogram/", + "cloudfunctionRoot": "cloudfunctions/", + "setting": { + "urlCheck": true, + "es6": true, + "postcss": true, + "minified": true, + "newFeature": true, + "enhance": true + }, + "appid": "", + "projectname": "%E5%A4%96%E5%8D%96%E7%82%B9%E9%A4%90", + "libVersion": "2.8.1", + "simulatorType": "wechat", + "simulatorPluginLibVersion": {}, + "condition": { + "search": { + "current": -1, + "list": [] + }, + "conversation": { + "current": -1, + "list": [] + }, + "plugin": { + "current": -1, + "list": [] + }, + "game": { + "list": [] + }, + "miniprogram": { + "current": 0, + "list": [] + } + } +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/README.md b/miniprogram/tcb-demo-sports/README.md new file mode 100644 index 0000000..96e335f --- /dev/null +++ b/miniprogram/tcb-demo-sports/README.md @@ -0,0 +1,18 @@ +# 【运动社交排名-步数全网排名】小程序云开发项目实战 + +## 项目介绍 + +此项目使用微信步数数据,展示阶段性运动步数趋势。用户可以随时上传运动图片和分享文字,并可以参与运动排行榜,与全网所有用户一起排名。 +参与排行榜后,用户的图片和分享文字可以被其他人看到,其他人可以给赞。 + +## 部署介绍 + +此处为项目完整代码,可以直接部署使用;以下是部署步骤: + +- 初始化云开发环境,如果有多个云开发环境造成wx.cloud.init错误,则在app.js处进行环境定义。 +- 在云开发环境中创建一个数据库,名称为rundata +- 将cloudfunctions文件夹内的8个云函数创建并部署; + +## 参考文档 + +- [云开发文档](https://developers.weixin.qq.com/miniprogram/dev/wxcloud/basis/getting-started.html) diff --git a/miniprogram/tcb-demo-sports/cloudfunctions/getRun/config.json b/miniprogram/tcb-demo-sports/cloudfunctions/getRun/config.json new file mode 100644 index 0000000..5ecc33e --- /dev/null +++ b/miniprogram/tcb-demo-sports/cloudfunctions/getRun/config.json @@ -0,0 +1,6 @@ +{ + "permissions": { + "openapi": [ + ] + } +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/cloudfunctions/getRun/index.js b/miniprogram/tcb-demo-sports/cloudfunctions/getRun/index.js new file mode 100644 index 0000000..9d90d8a --- /dev/null +++ b/miniprogram/tcb-demo-sports/cloudfunctions/getRun/index.js @@ -0,0 +1,38 @@ +// 云函数入口文件 +const cloud = require('wx-server-sdk') + +cloud.init() +const db = cloud.database(); + +// 云函数入口函数 +exports.main = async (event, context) => { + const userdata = (await db.collection('rundata').where({ + openid: event.userInfo.openId + }).get()).data; + + let stepobj={}; + let runauth=true; + if(event.mess!=null){ + event.mess.data.stepInfoList.map(step=>{ + if(step.step!=0){ + stepobj[step.timestamp]={ + step:step.step, + time:new Date((step.timestamp)*1000) + } + } + }) + } + else{ + runauth=false; + } + + if (userdata.length != 0) { + await db.collection('rundata').doc(userdata[0]._id).update({ + data:{ + rundata:stepobj, + runauth:runauth + } + }) + } + return stepobj; +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/cloudfunctions/getRun/package.json b/miniprogram/tcb-demo-sports/cloudfunctions/getRun/package.json new file mode 100644 index 0000000..c2b0510 --- /dev/null +++ b/miniprogram/tcb-demo-sports/cloudfunctions/getRun/package.json @@ -0,0 +1,14 @@ +{ + "name": "getRun", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "wx-server-sdk": "~1.7.0" + } +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/cloudfunctions/initRun/config.json b/miniprogram/tcb-demo-sports/cloudfunctions/initRun/config.json new file mode 100644 index 0000000..5ecc33e --- /dev/null +++ b/miniprogram/tcb-demo-sports/cloudfunctions/initRun/config.json @@ -0,0 +1,6 @@ +{ + "permissions": { + "openapi": [ + ] + } +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/cloudfunctions/initRun/index.js b/miniprogram/tcb-demo-sports/cloudfunctions/initRun/index.js new file mode 100644 index 0000000..011bf8e --- /dev/null +++ b/miniprogram/tcb-demo-sports/cloudfunctions/initRun/index.js @@ -0,0 +1,82 @@ +// 云函数入口文件 +const cloud = require('wx-server-sdk') + +cloud.init() +const db = cloud.database(); +const _ = db.command; + +// 云函数入口函数 +exports.main = async (event, context) => { + let d={}; + + const userdata = (await db.collection('rundata').where({ + openid: event.userInfo.openId + }).get()).data; + + if (userdata.length != 0) { + d.rundata = userdata[0].rundata; + d.runauth = userdata[0].runauth; + d.runimg = userdata[0].perimg?userdata[0].perimg:null; + d.runtext = userdata[0].runtext?userdata[0].runtext:""; + d.runinrule = userdata[0].inrule + d.id = userdata[0]._id; + d.avatarUrl = userdata[0].avatarUrl?userdata[0].avatarUrl:null; + d.nickname = userdata[0].nickname?userdata[0].nickname:null; + } + else{ + let result = await db.collection('rundata').add({ + data:{ + openid: event.userInfo.openId, + runauth:false, + inrule:false + } + }) + d.run = null; + d.runauth = false; + d.runimg = null; + d.runtext = ""; + d.runinrule = false; + d.id = result._id; + } + let other = (await db.collection('rundata').where({ + inrule:true, + // openid:_.neq(event.userInfo.openId) + }).field({ + perimg:true, + runtext:true, + avatarUrl:true, + nickname:true, + rundata:true + }).get()).data; + + let tempnow = new Date(new Date().getTime()+28800000); + + let nowlocal = tempnow.toLocaleDateString(); + + let nowdate=new Date(nowlocal); + + console.log('当前时间',tempnow,'0点时间',nowlocal,nowdate); + for(let c in other){ + let temp={}; + let Rdata=[]; + let Rdate=[]; + let rundata = other[c].rundata; + for(let i =6;i>=0;i--){ + let tim = new Date(nowdate.getTime()-28800000-86400000*i); + let runtemp = rundata[parseInt(tim.getTime()/1000)]; + let runitem = runtemp?runtemp.step:0; + Rdata.push(runitem); + Rdate.push(i==6?(tim.getMonth())+1+'.'+tim.getDate():tim.getDate()); + + if(i==0){ + other[c].Rnow = runitem; + } + } + temp.Rdata = Rdata; + temp.Rdate = Rdate; + other[c].rundata=temp; + } + d.other = other; + + return d; +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/cloudfunctions/initRun/package.json b/miniprogram/tcb-demo-sports/cloudfunctions/initRun/package.json new file mode 100644 index 0000000..0fd17cd --- /dev/null +++ b/miniprogram/tcb-demo-sports/cloudfunctions/initRun/package.json @@ -0,0 +1,14 @@ +{ + "name": "initRun", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "wx-server-sdk": "~1.7.0" + } +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/cloudfunctions/saveimg/config.json b/miniprogram/tcb-demo-sports/cloudfunctions/saveimg/config.json new file mode 100644 index 0000000..5ecc33e --- /dev/null +++ b/miniprogram/tcb-demo-sports/cloudfunctions/saveimg/config.json @@ -0,0 +1,6 @@ +{ + "permissions": { + "openapi": [ + ] + } +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/cloudfunctions/saveimg/index.js b/miniprogram/tcb-demo-sports/cloudfunctions/saveimg/index.js new file mode 100644 index 0000000..68dc23f --- /dev/null +++ b/miniprogram/tcb-demo-sports/cloudfunctions/saveimg/index.js @@ -0,0 +1,50 @@ +// 云函数入口文件 +const cloud = require('wx-server-sdk') + +cloud.init() +const db = cloud.database(); + +// 云函数入口函数 +exports.main = async (event, context) => { + let d={}; + const userdata = (await db.collection('rundata').where({ + openid: event.userInfo.openId + }).get()).data; + if (userdata.length != 0) { + const oldimg = userdata[0].perimg?userdata[0].perimg:null; + try{ + await cloud.callFunction({ + name: 'secimg', + data: { + img:event.img + } + }) + await db.collection('rundata').where({ + openid: event.userInfo.openId + }).update({ + data:{ + perimg:event.img + } + }); + if(oldimg!=null){ + await cloud.deleteFile({ + fileList: [oldimg] + }) + } + d.code = 0; + d.img = event.img; + } + catch(e){ + console.log(e); + await cloud.deleteFile({ + fileList: [event.img] + }); + d.code = 1; + d.img = oldimg; + } + } + else{ + d.code=-1; + } + return d; +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/cloudfunctions/saveimg/package.json b/miniprogram/tcb-demo-sports/cloudfunctions/saveimg/package.json new file mode 100644 index 0000000..eeea36c --- /dev/null +++ b/miniprogram/tcb-demo-sports/cloudfunctions/saveimg/package.json @@ -0,0 +1,14 @@ +{ + "name": "saveimg", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "wx-server-sdk": "~1.7.1" + } +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/cloudfunctions/savetext/config.json b/miniprogram/tcb-demo-sports/cloudfunctions/savetext/config.json new file mode 100644 index 0000000..5ecc33e --- /dev/null +++ b/miniprogram/tcb-demo-sports/cloudfunctions/savetext/config.json @@ -0,0 +1,6 @@ +{ + "permissions": { + "openapi": [ + ] + } +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/cloudfunctions/savetext/index.js b/miniprogram/tcb-demo-sports/cloudfunctions/savetext/index.js new file mode 100644 index 0000000..70cfb8c --- /dev/null +++ b/miniprogram/tcb-demo-sports/cloudfunctions/savetext/index.js @@ -0,0 +1,38 @@ +// 云函数入口文件 +const cloud = require('wx-server-sdk') + +cloud.init() +const db = cloud.database(); + +// 云函数入口函数 +exports.main = async (event, context) => { + let d = {}; + + try{ + if(event.text!=""){ + await cloud.callFunction({ + name: 'sectext', + data: { + text:event.text + } + }) + } + await db.collection('rundata').where({ + openid: event.userInfo.openId + }).update({ + data:{ + inrule:event.inrule, + runtext:event.text, + Info:event.Info, + avatarUrl:event.Info.avatarUrl, + nickname:event.Info.nickName + } + }); + d.code = 0; + } + catch(e){ + console.log(e); + d.code = 1; + } + return d; +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/cloudfunctions/savetext/package.json b/miniprogram/tcb-demo-sports/cloudfunctions/savetext/package.json new file mode 100644 index 0000000..88aabbd --- /dev/null +++ b/miniprogram/tcb-demo-sports/cloudfunctions/savetext/package.json @@ -0,0 +1,14 @@ +{ + "name": "savetext", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "wx-server-sdk": "~1.7.1" + } +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/cloudfunctions/secimg/config.json b/miniprogram/tcb-demo-sports/cloudfunctions/secimg/config.json new file mode 100644 index 0000000..4c12646 --- /dev/null +++ b/miniprogram/tcb-demo-sports/cloudfunctions/secimg/config.json @@ -0,0 +1,7 @@ +{ + "permissions": { + "openapi": [ + "security.imgSecCheck" + ] + } +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/cloudfunctions/secimg/index.js b/miniprogram/tcb-demo-sports/cloudfunctions/secimg/index.js new file mode 100644 index 0000000..f10ddd9 --- /dev/null +++ b/miniprogram/tcb-demo-sports/cloudfunctions/secimg/index.js @@ -0,0 +1,15 @@ +const cloud = require('wx-server-sdk'); +cloud.init() + +exports.main = async (event, context) => { + const imgmsg = (await cloud.downloadFile({ + fileID: event.img, + })).fileContent; + + return cloud.openapi.security.imgSecCheck({ + media: { + contentType: 'image/png', + value: imgmsg + } + }) +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/cloudfunctions/secimg/package.json b/miniprogram/tcb-demo-sports/cloudfunctions/secimg/package.json new file mode 100644 index 0000000..984ba0c --- /dev/null +++ b/miniprogram/tcb-demo-sports/cloudfunctions/secimg/package.json @@ -0,0 +1,14 @@ +{ + "name": "secimg", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "wx-server-sdk": "~1.7.1" + } +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/cloudfunctions/sectext/config.json b/miniprogram/tcb-demo-sports/cloudfunctions/sectext/config.json new file mode 100644 index 0000000..555df89 --- /dev/null +++ b/miniprogram/tcb-demo-sports/cloudfunctions/sectext/config.json @@ -0,0 +1,7 @@ +{ + "permissions": { + "openapi": [ + "security.msgSecCheck" + ] + } +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/cloudfunctions/sectext/index.js b/miniprogram/tcb-demo-sports/cloudfunctions/sectext/index.js new file mode 100644 index 0000000..fbd8d7d --- /dev/null +++ b/miniprogram/tcb-demo-sports/cloudfunctions/sectext/index.js @@ -0,0 +1,8 @@ +const cloud = require('wx-server-sdk') +cloud.init() + +exports.main = async (event, context) => { + return await cloud.openapi.security.msgSecCheck({ + content:event.text + }) +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/cloudfunctions/sectext/package.json b/miniprogram/tcb-demo-sports/cloudfunctions/sectext/package.json new file mode 100644 index 0000000..aa58866 --- /dev/null +++ b/miniprogram/tcb-demo-sports/cloudfunctions/sectext/package.json @@ -0,0 +1,14 @@ +{ + "name": "sectext", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "wx-server-sdk": "~1.7.1" + } +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/cloudfunctions/setstar/config.json b/miniprogram/tcb-demo-sports/cloudfunctions/setstar/config.json new file mode 100644 index 0000000..5ecc33e --- /dev/null +++ b/miniprogram/tcb-demo-sports/cloudfunctions/setstar/config.json @@ -0,0 +1,6 @@ +{ + "permissions": { + "openapi": [ + ] + } +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/cloudfunctions/setstar/index.js b/miniprogram/tcb-demo-sports/cloudfunctions/setstar/index.js new file mode 100644 index 0000000..ca9e679 --- /dev/null +++ b/miniprogram/tcb-demo-sports/cloudfunctions/setstar/index.js @@ -0,0 +1,51 @@ +// 云函数入口文件 +const cloud = require('wx-server-sdk') + +cloud.init() +const db = cloud.database(); +const _ = db.command; + +// 云函数入口函数 +exports.main = async (event, context) => { + const user = (await db.collection('rundata').doc(event.ta).get()).data; + + if(user.star==null||user.star.indexOf(event.userInfo.openId)==-1){ + if(event.flag==false){ + await db.collection('rundata').doc(event.ta).update({ + data:{ + star:_.push(event.userInfo.openId) + } + + }); + return { + num:user.star?user.star.length+1:0+1, + status:1 + } + } + else{ + return { + num:user.star?user.star.length:0, + status:0 + } + } + } + else{ + if(event.flag==true){ + await db.collection('rundata').doc(event.ta).update({ + data:{ + star:_.pull(event.userInfo.openId) + } + }); + return { + num:user.star?user.star.length-1:0, + status:0 + } + } + else{ + return { + num:user.star?user.star.length:0, + status:1 + } + } + } +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/cloudfunctions/setstar/package.json b/miniprogram/tcb-demo-sports/cloudfunctions/setstar/package.json new file mode 100644 index 0000000..15ec689 --- /dev/null +++ b/miniprogram/tcb-demo-sports/cloudfunctions/setstar/package.json @@ -0,0 +1,14 @@ +{ + "name": "setstar", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "wx-server-sdk": "~1.7.1" + } +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/cloudfunctions/tostar/config.json b/miniprogram/tcb-demo-sports/cloudfunctions/tostar/config.json new file mode 100644 index 0000000..5ecc33e --- /dev/null +++ b/miniprogram/tcb-demo-sports/cloudfunctions/tostar/config.json @@ -0,0 +1,6 @@ +{ + "permissions": { + "openapi": [ + ] + } +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/cloudfunctions/tostar/index.js b/miniprogram/tcb-demo-sports/cloudfunctions/tostar/index.js new file mode 100644 index 0000000..2a19a1a --- /dev/null +++ b/miniprogram/tcb-demo-sports/cloudfunctions/tostar/index.js @@ -0,0 +1,23 @@ +// 云函数入口文件 +const cloud = require('wx-server-sdk') + +cloud.init() +const db = cloud.database(); +const _ = db.command; + +// 云函数入口函数 +exports.main = async (event, context) => { + const user = (await db.collection('rundata').doc(event.ta).get()).data; + if(user.star==null||user.star.indexOf(event.userInfo.openId)==-1){ + return { + num:user.star?user.star.length:0, + status:0 + } + } + else{ + return { + num:user.star?user.star.length:0, + status:1 + } + } +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/cloudfunctions/tostar/package.json b/miniprogram/tcb-demo-sports/cloudfunctions/tostar/package.json new file mode 100644 index 0000000..88b5aee --- /dev/null +++ b/miniprogram/tcb-demo-sports/cloudfunctions/tostar/package.json @@ -0,0 +1,14 @@ +{ + "name": "tostar", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "wx-server-sdk": "~1.7.1" + } +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/miniprogram/app.js b/miniprogram/tcb-demo-sports/miniprogram/app.js new file mode 100644 index 0000000..f6d5bc0 --- /dev/null +++ b/miniprogram/tcb-demo-sports/miniprogram/app.js @@ -0,0 +1,38 @@ +//app.js +App({ + onLaunch: function () { + if (!wx.cloud) { + console.error('请使用 2.2.3 或以上的基础库以使用云能力') + } else { + wx.cloud.init({ + traceUser: true, + }) + } + this.globalData.rundata = wx.getStorageSync('RunData'); + }, + initRun: function (obj) { + let that = this; + wx.cloud.callFunction({ + name:'initRun', + success(res){ + res.result.other = res.result.other.sort((a,b)=>{return b.Rnow-a.Rnow}) + that.globalData.rundata = res.result; + wx.setStorageSync('RunData',res.result); + console.log('init request ID:',res.requestID); + obj.success(); + }, + fail(e){ + console.error('init request error',e); + wx.showModal({ + title:"错误", + content:"初始化错误,请退出小程序检查网络后重新进入", + showCancel:false + }) + obj.fail(e); + } + }) + }, + globalData:{ + + } +}) diff --git a/miniprogram/tcb-demo-sports/miniprogram/app.json b/miniprogram/tcb-demo-sports/miniprogram/app.json new file mode 100644 index 0000000..bb59c1d --- /dev/null +++ b/miniprogram/tcb-demo-sports/miniprogram/app.json @@ -0,0 +1,16 @@ +{ + "pages": [ + "pages/index/index", + "pages/edit/edit", + "pages/show/show" + ], + "window": { + "backgroundColor": "#191A21", + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#191A21", + "navigationBarTitleText": "TM 运动", + "navigationBarTextStyle": "white" + }, + "sitemapLocation": "sitemap.json", + "style": "v2" +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/miniprogram/app.wxss b/miniprogram/tcb-demo-sports/miniprogram/app.wxss new file mode 100644 index 0000000..6ed03c7 --- /dev/null +++ b/miniprogram/tcb-demo-sports/miniprogram/app.wxss @@ -0,0 +1,114 @@ +page{ + background-color: #191A21; +} +button{ + background-color: #ff2245; + color: white; + width: 300rpx; + height: 40px; + line-height: 40px; + font-size: 12px; + padding: 0; + letter-spacing: 2px; + border-radius: 3px; +} +.model{ + display: flex; + flex-direction: column; + width: 650rpx; + margin:20px 50rpx; + border-radius: 5px; +} +.stepshow{ + margin: 0 0 5px 0; +} +.authtips{ + margin-top: 100px; + font-size: 28px; + font-weight: 900; + color: white; + text-align: center; + letter-spacing: 5px; +} +.stepnumber{ + color: #ff2245; + font-size: 50px; + font-weight: 900; + text-align: center; +} +.steptips{ + color: white; + font-size: 13px; + text-align: center; +} +.charts{ + width: 650rpx; + height: 140px; +} +.pushshow{ + border-top: 1px solid #8c8D90; + width: 650rpx; + margin: 10px 50rpx; + padding-top: 20px; + display: flex; + flex-direction: column; +} +.splaceitem{ + width: 600rpx; + margin:10px auto 0 auto; + background-color: #2D313C; + padding:20px 25rpx; +} +.personitem{ + position: relative; + padding: 0; + width: 650rpx; +} +.splacetips{ + text-align: center; + font-size: 15px; + color: #8c8D90; + line-height: 35px; + margin-bottom: 10px; +} +.avatarimg{ + width: 100rpx; + height: 100rpx; + border-radius: 50%; + position: absolute; + top: -60rpx; + left: calc(50% - 55rpx); + border: 10rpx solid #191A21; + z-index: 9; +} +.itemtext{ + color: white; + font-size: 13px; + width: calc(100% - 40rpx); + padding: 10rpx 20rpx; + bottom: 20rpx; + letter-spacing: 1px; + position: absolute; + z-index: 9; +} +.itemimg{ + width: 100%; + margin-top: 70rpx; + height: 390rpx; + filter:brightness(73%); + z-index: -1; + animation: imgload 2s; + margin-bottom: -10px; +} + +@keyframes imgload +{ + from {height: 50rpx;} + to {height: 390rpx;} +} + +@-webkit-keyframes imgload +{ + from {height: 50rpx;} + to {height: 390rpx;} +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/miniprogram/ec-canvas/ec-canvas.js b/miniprogram/tcb-demo-sports/miniprogram/ec-canvas/ec-canvas.js new file mode 100644 index 0000000..9cc2454 --- /dev/null +++ b/miniprogram/tcb-demo-sports/miniprogram/ec-canvas/ec-canvas.js @@ -0,0 +1,135 @@ +import WxCanvas from './wx-canvas'; +import * as echarts from './echarts'; + +let ctx; + +Component({ + properties: { + canvasId: { + type: String, + value: 'ec-canvas' + }, + + ec: { + type: Object + } + }, + + data: { + + }, + + ready: function () { + if (!this.data.ec) { + console.warn('组件需绑定 ec 变量,例:'); + return; + } + + if (!this.data.ec.lazyLoad) { + this.init(); + } + }, + + methods: { + init: function (callback) { + const version = wx.version.version.split('.').map(n => parseInt(n, 10)); + const isValid = version[0] > 1 || (version[0] === 1 && version[1] > 9) + || (version[0] === 1 && version[1] === 9 && version[2] >= 91); + if (!isValid) { + console.error('微信基础库版本过低,需大于等于 1.9.91。' + + '参见:https://github.com/ecomfe/echarts-for-weixin' + + '#%E5%BE%AE%E4%BF%A1%E7%89%88%E6%9C%AC%E8%A6%81%E6%B1%82'); + return; + } + + ctx = wx.createCanvasContext(this.data.canvasId, this); + + const canvas = new WxCanvas(ctx, this.data.canvasId); + + echarts.setCanvasCreator(() => { + return canvas; + }); + + var query = wx.createSelectorQuery().in(this); + query.select('.ec-canvas').boundingClientRect(res => { + if (typeof callback === 'function') { + this.chart = callback(canvas, res.width, res.height); + } + else if (this.data.ec && typeof this.data.ec.onInit === 'function') { + this.chart = this.data.ec.onInit(canvas, res.width, res.height); + } + else { + this.triggerEvent('init', { + canvas: canvas, + width: res.width, + height: res.height + }); + } + }).exec(); + }, + + canvasToTempFilePath(opt) { + if (!opt.canvasId) { + opt.canvasId = this.data.canvasId; + } + + ctx.draw(true, () => { + wx.canvasToTempFilePath(opt, this); + }); + }, + + touchStart(e) { + if (this.chart && e.touches.length > 0) { + var touch = e.touches[0]; + var handler = this.chart.getZr().handler; + handler.dispatch('mousedown', { + zrX: touch.x, + zrY: touch.y + }); + handler.dispatch('mousemove', { + zrX: touch.x, + zrY: touch.y + }); + handler.processGesture(wrapTouch(e), 'start'); + } + }, + + touchMove(e) { + if (this.chart && e.touches.length > 0) { + var touch = e.touches[0]; + var handler = this.chart.getZr().handler; + handler.dispatch('mousemove', { + zrX: touch.x, + zrY: touch.y + }); + handler.processGesture(wrapTouch(e), 'change'); + } + }, + + touchEnd(e) { + if (this.chart) { + const touch = e.changedTouches ? e.changedTouches[0] : {}; + var handler = this.chart.getZr().handler; + handler.dispatch('mouseup', { + zrX: touch.x, + zrY: touch.y + }); + handler.dispatch('click', { + zrX: touch.x, + zrY: touch.y + }); + handler.processGesture(wrapTouch(e), 'end'); + } + } + } +}); + +function wrapTouch(event) { + for (let i = 0; i < event.touches.length; ++i) { + const touch = event.touches[i]; + touch.offsetX = touch.x; + touch.offsetY = touch.y; + } + return event; +} diff --git a/miniprogram/tcb-demo-sports/miniprogram/ec-canvas/ec-canvas.json b/miniprogram/tcb-demo-sports/miniprogram/ec-canvas/ec-canvas.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/miniprogram/tcb-demo-sports/miniprogram/ec-canvas/ec-canvas.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/miniprogram/ec-canvas/ec-canvas.wxml b/miniprogram/tcb-demo-sports/miniprogram/ec-canvas/ec-canvas.wxml new file mode 100644 index 0000000..33cfaf7 --- /dev/null +++ b/miniprogram/tcb-demo-sports/miniprogram/ec-canvas/ec-canvas.wxml @@ -0,0 +1,4 @@ + + diff --git a/miniprogram/tcb-demo-sports/miniprogram/ec-canvas/ec-canvas.wxss b/miniprogram/tcb-demo-sports/miniprogram/ec-canvas/ec-canvas.wxss new file mode 100644 index 0000000..0d64b10 --- /dev/null +++ b/miniprogram/tcb-demo-sports/miniprogram/ec-canvas/ec-canvas.wxss @@ -0,0 +1,4 @@ +.ec-canvas { + width: 100%; + height: 100%; +} diff --git a/miniprogram/tcb-demo-sports/miniprogram/ec-canvas/echarts.js b/miniprogram/tcb-demo-sports/miniprogram/ec-canvas/echarts.js new file mode 100644 index 0000000..68264a5 --- /dev/null +++ b/miniprogram/tcb-demo-sports/miniprogram/ec-canvas/echarts.js @@ -0,0 +1,22 @@ + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + + +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.echarts={})}(this,function(t){"use strict";var e=2311,n=function(){return e++},v="object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?{browser:{},os:{},node:!1,wxa:!0,canvasSupported:!0,svgSupported:!1,touchEventsSupported:!0,domSupported:!1}:"undefined"==typeof document&&"undefined"!=typeof self?{browser:{},os:{},node:!1,worker:!0,canvasSupported:!0,domSupported:!1}:"undefined"==typeof navigator?{browser:{},os:{},node:!0,worker:!1,canvasSupported:!0,svgSupported:!0,domSupported:!1}:function(t){var e={},i=t.match(/Firefox\/([\d.]+)/),n=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),o=t.match(/Edge\/([\d.]+)/),a=/micromessenger/i.test(t);i&&(e.firefox=!0,e.version=i[1]);n&&(e.ie=!0,e.version=n[1]);o&&(e.edge=!0,e.version=o[1]);a&&(e.weChat=!0);return{browser:e,os:{},node:!1,canvasSupported:!!document.createElement("canvas").getContext,svgSupported:"undefined"!=typeof SVGRect,touchEventsSupported:"ontouchstart"in window&&!e.ie&&!e.edge,pointerEventsSupported:"onpointerdown"in window&&(e.edge||e.ie&&11<=e.version),domSupported:"undefined"!=typeof document}}(navigator.userAgent);var s={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},l={"[object Int8Array]":1,"[object Uint8Array]":1,"[object Uint8ClampedArray]":1,"[object Int16Array]":1,"[object Uint16Array]":1,"[object Int32Array]":1,"[object Uint32Array]":1,"[object Float32Array]":1,"[object Float64Array]":1},u=Object.prototype.toString,i=Array.prototype,r=i.forEach,h=i.filter,o=i.slice,c=i.map,d=i.reduce,a={};function f(t,e){"createCanvas"===t&&(y=null),a[t]=e}function D(t){if(null==t||"object"!=typeof t)return t;var e=t,i=u.call(t);if("[object Array]"===i){if(!$(t)){e=[];for(var n=0,o=t.length;n>1)%2;s.cssText=["position:absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","width:0","height:0",n[l]+":0",o[u]+":0",n[1-l]+":auto",o[1-u]+":auto",""].join("!important;"),t.appendChild(r),i.push(r)}return i}(t,r),r);if(s)return s(zt,n,o),i.zrX=zt[0],void(i.zrY=zt[1])}i.zrX=i.zrY=0}function Vt(t){return t||window.event}function Gt(t,e,i){if(null!=(e=Vt(e)).zrX)return e;var n=e.type;if(n&&0<=n.indexOf("touch")){var o="touchend"!==n?e.targetTouches[0]:e.changedTouches[0];o&&Rt(t,o,e,i)}else Rt(t,e,e,i),e.zrDelta=e.wheelDelta?e.wheelDelta/120:-(e.detail||0)/3;var a=e.button;return null==e.which&&void 0!==a&&Ot.test(e.type)&&(e.which=1&a?1:2&a?3:4&a?2:0),e}function Ft(t,e,i,n){Nt?t.addEventListener(e,i,n):t.attachEvent("on"+e,i)}var Wt=Nt?function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0}:function(t){t.returnValue=!1,t.cancelBubble=!0};function Ht(t){return 2===t.which||3===t.which}function Zt(){this._track=[]}function Ut(t){var e=t[1][0]-t[0][0],i=t[1][1]-t[0][1];return Math.sqrt(e*e+i*i)}Zt.prototype={constructor:Zt,recognize:function(t,e,i){return this._doTrack(t,e,i),this._recognize(t)},clear:function(){return this._track.length=0,this},_doTrack:function(t,e,i){var n=t.touches;if(n){for(var o={points:[],touches:[],target:e,event:t},a=0,r=n.length;an.getWidth()||i<0||i>n.getHeight()}Kt.prototype={constructor:Kt,setHandlerProxy:function(e){this.proxy&&this.proxy.dispose(),e&&(E($t,function(t){e.on&&e.on(t,this[t],this)},this),e.handler=this),this.proxy=e},mousemove:function(t){var e=t.zrX,i=t.zrY,n=Qt(this,e,i),o=this._hovered,a=o.target;a&&!a.__zr&&(a=(o=this.findHover(o.x,o.y)).target);var r=this._hovered=n?{x:e,y:i}:this.findHover(e,i),s=r.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),a&&s!==a&&this.dispatchToElement(o,"mouseout",t),this.dispatchToElement(r,"mousemove",t),s&&s!==a&&this.dispatchToElement(r,"mouseover",t)},mouseout:function(t){var e=t.zrEventControl,i=t.zrIsToLocalDOM;"only_globalout"!==e&&this.dispatchToElement(this._hovered,"mouseout",t),"no_globalout"!==e&&(i||this.trigger("globalout",{type:"globalout",event:t}))},resize:function(t){this._hovered={}},dispatch:function(t,e){var i=this[t];i&&i.call(this,e)},dispose:function(){this.proxy.dispose(),this.storage=this.proxy=this.painter=null},setCursorStyle:function(t){var e=this.proxy;e.setCursor&&e.setCursor(t)},dispatchToElement:function(t,e,i){var n=(t=t||{}).target;if(!n||!n.silent){for(var o="on"+e,a=function(t,e,i){return{type:t,event:i,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:i.zrX,offsetY:i.zrY,gestureEvent:i.gestureEvent,pinchX:i.pinchX,pinchY:i.pinchY,pinchScale:i.pinchScale,wheelDelta:i.zrDelta,zrByTouch:i.zrByTouch,which:i.which,stop:jt}}(e,t,i);n&&(n[o]&&(a.cancelBubble=n[o].call(n,a)),n.trigger(e,a),n=n.parent,!a.cancelBubble););a.cancelBubble||(this.trigger(e,a),this.painter&&this.painter.eachOtherLayer(function(t){"function"==typeof t[o]&&t[o].call(t,a),t.trigger&&t.trigger(e,a)}))}},findHover:function(t,e,i){for(var n=this.storage.getDisplayList(),o={x:t,y:e},a=n.length-1;0<=a;a--){var r;if(n[a]!==i&&!n[a].ignore&&(r=Jt(n[a],t,e))&&(o.topTarget||(o.topTarget=n[a]),r!==Yt)){o.target=n[a];break}}return o},processGesture:function(t,e){this._gestureMgr||(this._gestureMgr=new Zt);var i=this._gestureMgr;"start"===e&&i.clear();var n=i.recognize(t,this.findHover(t.zrX,t.zrY,null).target,this.proxy.dom);if("end"===e&&i.clear(),n){var o=n.type;t.gestureEvent=o,this.dispatchToElement({target:n.target},o,n.event)}}},E(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(r){Kt.prototype[r]=function(t){var e,i,n=t.zrX,o=t.zrY,a=Qt(this,n,o);if("mouseup"===r&&a||(i=(e=this.findHover(n,o)).target),"mousedown"===r)this._downEl=i,this._downPoint=[t.zrX,t.zrY],this._upEl=i;else if("mouseup"===r)this._upEl=i;else if("click"===r){if(this._downEl!==this._upEl||!this._downPoint||4=this._maxSize&&0>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,1),ze(t,e),e):void Pe(e,0,0,0,1):7===o.length?0<=(n=parseInt(o.substr(1),16))&&n<=16777215?(Pe(e,(16711680&n)>>16,(65280&n)>>8,255&n,1),ze(t,e),e):void Pe(e,0,0,0,1):void 0;var a=o.indexOf("("),r=o.indexOf(")");if(-1!==a&&r+1===o.length){var s=o.substr(0,a),l=o.substr(a+1,r-(a+1)).split(","),u=1;switch(s){case"rgba":if(4!==l.length)return void Pe(e,0,0,0,1);u=Ce(l.pop());case"rgb":return 3!==l.length?void Pe(e,0,0,0,1):(Pe(e,De(l[0]),De(l[1]),De(l[2]),u),ze(t,e),e);case"hsla":return 4!==l.length?void Pe(e,0,0,0,1):(l[3]=Ce(l[3]),Be(l,e),ze(t,e),e);case"hsl":return 3!==l.length?void Pe(e,0,0,0,1):(Be(l,e),ze(t,e),e);default:return}}Pe(e,0,0,0,1)}}function Be(t,e){var i=(parseFloat(t[0])%360+360)%360/360,n=Ce(t[1]),o=Ce(t[2]),a=o<=.5?o*(n+1):o+n-o*n,r=2*o-a;return Pe(e=e||[],Te(255*Le(r,a,i+1/3)),Te(255*Le(r,a,i)),Te(255*Le(r,a,i-1/3)),1),4===t.length&&(e[3]=t[3]),e}function Ve(t,e){var i=Re(t);if(i){for(var n=0;n<3;n++)i[n]=e<0?i[n]*(1-e)|0:(255-i[n])*e+i[n]|0,255e);i++);i=Math.min(i-1,u-2)}C=e;var n=g[(D=i)+1]-g[i];if(0!=n)if(S=(e-g[i])/n,l)if(I=m[i],M=m[0===i?i:i-1],T=m[u-2=i.x&&t<=i.x+i.width&&e>=i.y&&e<=i.y+i.height},clone:function(){return new Mi(this.x,this.y,this.width,this.height)},copy:function(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height},plain:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},Mi.create=function(t){return new Mi(t.x,t.y,t.width,t.height)};var Ii=function(t){for(var e in t=t||{},mi.call(this,t),t)t.hasOwnProperty(e)&&(this[e]=t[e]);this._children=[],this.__storage=null,this.__dirty=!0};Ii.prototype={constructor:Ii,isGroup:!0,type:"group",silent:!1,children:function(){return this._children.slice()},childAt:function(t){return this._children[t]},childOfName:function(t){for(var e=this._children,i=0;i>>1])<0?l=a:s=1+a;var u=n-s;switch(u){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;0>>1);0>>1);a(t,e[i+h])<0?l=h:r=h+1}return l}function Pi(p,g){var r,s,m=Ai,l=0,v=[];function e(t){var e=r[t],i=s[t],n=r[t+1],o=s[t+1];s[t]=i+o,t===l-3&&(r[t+1]=r[t+2],s[t+1]=s[t+2]),l--;var a=ki(p[n],p,e,i,0,g);e+=a,0!==(i-=a)&&0!==(o=Li(p[e+i-1],p,n,o,o-1,g))&&(i<=o?function(t,e,i,n){var o=0;for(o=0;os[t+1])break;e(t)}},this.forceMergeRuns=function(){for(;1>=1;return t+e}(o);do{if((a=Di(t,i,n,e))=e.maxIterations){t+=e.ellipsis;break}var s=0===r?yn(t,o,e.ascCharWidth,e.cnCharWidth):0f)return{lines:[],width:0,height:0};C.textWidth=hn(C.text,w);var S=x.textWidth,M=null==S||"auto"===S;if("string"==typeof S&&"%"===S.charAt(S.length-1))C.percentWidth=S,u.push(C),S=0;else{if(M){S=C.textWidth;var I=x.textBackgroundColor,T=I&&I.image;T&&nn(T=Qi(T))&&(S=Math.max(S,T.width*b/T.height))}var A=_?_[1]+_[3]:0;S+=A;var D=null!=d?d-v:null;null!=D&&Dn[0]){for(r=0;rt);r++);a=i[n[r]]}if(n.splice(r+1,0,t),!(i[t]=e).virtual)if(a){var l=a.dom;l.nextSibling?s.insertBefore(e.dom,l.nextSibling):s.appendChild(e.dom)}else s.firstChild?s.insertBefore(e.dom,s.firstChild):s.appendChild(e.dom)}else fi("Layer of zlevel "+t+" is not valid")},eachLayer:function(t,e){var i,n,o=this._zlevelList;for(n=0;n=a.length&&a.push({option:t})}}),a}function Go(t){var r=Q();ko(t,function(t,e){var i=t.exist;i&&r.set(i.id,t)}),ko(t,function(t,e){var i=t.option;Y(!i||null==i.id||!r.get(i.id)||r.get(i.id)===t,"id duplicates: "+(i&&i.id)),i&&null!=i.id&&r.set(i.id,t),t.keyInfo||(t.keyInfo={})}),ko(t,function(t,e){var i=t.exist,n=t.option,o=t.keyInfo;if(Po(n)){if(o.name=null!=n.name?n.name+"":i?i.name:Oo+e,i)o.id=i.id;else if(null!=n.id)o.id=n.id+"";else for(var a=0;o.id="\0"+o.name+"\0"+a++,r.get(o.id););r.set(o.id,t)}})}function Fo(t){var e=t.name;return!(!e||!e.indexOf(Oo))}function Wo(t){return Po(t)&&t.id&&0===(t.id+"").indexOf("\0_ec_\0")}function Ho(e,t){return null!=t.dataIndexInside?t.dataIndexInside:null!=t.dataIndex?k(t.dataIndex)?N(t.dataIndex,function(t){return e.indexOfRawIndex(t)}):e.indexOfRawIndex(t.dataIndex):null!=t.name?k(t.name)?N(t.name,function(t){return e.indexOfName(t)}):e.indexOfName(t.name):void 0}function Zo(){var e="__\0ec_inner_"+Uo+++"_"+Math.random().toFixed(5);return function(t){return t[e]||(t[e]={})}}var Uo=0;function Xo(s,l,u){if(z(l)){var t={};t[l+"Index"]=0,l=t}var e=u&&u.defaultMainType;!e||Yo(l,e+"Index")||Yo(l,e+"Id")||Yo(l,e+"Name")||(l[e+"Index"]=0);var h={};return ko(l,function(t,e){t=l[e];if("dataIndex"!==e&&"dataIndexInside"!==e){var i=e.match(/^(\w+)(Index|Id|Name)$/)||[],n=i[1],o=(i[2]||"").toLowerCase();if(!(!n||!o||null==t||"index"===o&&"none"===t||u&&u.includeMainTypes&&_(u.includeMainTypes,n)<0)){var a={mainType:n};"index"===o&&"all"===t||(a[o]=t);var r=s.queryComponents(a);h[n+"Models"]=r,h[n+"Model"]=r[0]}}else h[e]=t}),h}function Yo(t,e){return t&&t.hasOwnProperty(e)}function jo(t,e,i){t.setAttribute?t.setAttribute(e,i):t[e]=i}function qo(t){return"auto"===t?v.domSupported?"html":"richText":t||"html"}function Ko(t,i){var n=Q(),o=[];return E(t,function(t){var e=i(t);(n.get(e)||(o.push(e),n.set(e,[]))).push(t)}),{keys:o,buckets:n}}var $o=".",Jo="___EC__COMPONENT__CONTAINER___";function Qo(t){var e={main:"",sub:""};return t&&(t=t.split($o),e.main=t[0]||"",e.sub=t[1]||""),e}function ta(t){(t.$constructor=t).extend=function(t){function e(){t.$constructor?t.$constructor.apply(this,arguments):i.apply(this,arguments)}var i=this;return L(e.prototype,t),e.extend=this.extend,e.superCall=na,e.superApply=oa,w(e,this),e.superClass=i,e}}var ea=0;function ia(t){var e=["__\0is_clz",ea++,Math.random().toFixed(3)].join("_");t.prototype[e]=!0,t.isInstance=function(t){return!(!t||!t[e])}}function na(t,e){var i=U(arguments,2);return this.superClass.prototype[e].apply(t,i)}function oa(t,e,i){return this.superClass.prototype[e].apply(t,i)}function aa(i,t){t=t||{};var o={};if(i.registerClass=function(t,e){if(e)if(function(t){Y(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(t),'componentType "'+t+'" illegal')}(e),(e=Qo(e)).sub){if(e.sub!==Jo){(function(t){var e=o[t.main];e&&e[Jo]||((e=o[t.main]={})[Jo]=!0);return e})(e)[e.sub]=t}}else o[e.main]=t;return t},i.getClass=function(t,e,i){var n=o[t];if(n&&n[Jo]&&(n=e?n[e]:null),i&&!n)throw new Error(e?"Component "+t+"."+(e||"")+" not exists. Load it first.":t+".type should be specified.");return n},i.getClassesByMainType=function(t){t=Qo(t);var i=[],e=o[t.main];return e&&e[Jo]?E(e,function(t,e){e!==Jo&&i.push(t)}):i.push(e),i},i.hasClass=function(t){return t=Qo(t),!!o[t.main]},i.getAllClassMainTypes=function(){var i=[];return E(o,function(t,e){i.push(e)}),i},i.hasSubTypes=function(t){t=Qo(t);var e=o[t.main];return e&&e[Jo]},i.parseClassType=Qo,t.registerWhenExtend){var n=i.extend;n&&(i.extend=function(t){var e=n.call(this,t);return i.registerClass(e,t.type)})}return i}function ra(s){for(var t=0;tthis._ux||tr(e-this._yi)>this._uy||this._len<5;return this.addData(Za.L,t,e),this._ctx&&i&&(this._needsDash()?this._dashedLineTo(t,e):this._ctx.lineTo(t,e)),i&&(this._xi=t,this._yi=e),this},bezierCurveTo:function(t,e,i,n,o,a){return this.addData(Za.C,t,e,i,n,o,a),this._ctx&&(this._needsDash()?this._dashedBezierTo(t,e,i,n,o,a):this._ctx.bezierCurveTo(t,e,i,n,o,a)),this._xi=o,this._yi=a,this},quadraticCurveTo:function(t,e,i,n){return this.addData(Za.Q,t,e,i,n),this._ctx&&(this._needsDash()?this._dashedQuadraticTo(t,e,i,n):this._ctx.quadraticCurveTo(t,e,i,n)),this._xi=i,this._yi=n,this},arc:function(t,e,i,n,o,a){return this.addData(Za.A,t,e,i,i,n,o-n,0,a?0:1),this._ctx&&this._ctx.arc(t,e,i,n,o,a),this._xi=$a(o)*i+t,this._yi=Ja(o)*i+e,this},arcTo:function(t,e,i,n,o){return this._ctx&&this._ctx.arcTo(t,e,i,n,o),this},rect:function(t,e,i,n){return this._ctx&&this._ctx.rect(t,e,i,n),this.addData(Za.R,t,e,i,n),this},closePath:function(){this.addData(Za.Z);var t=this._ctx,e=this._x0,i=this._y0;return t&&(this._needsDash()&&this._dashedLineTo(e,i),t.closePath()),this._xi=e,this._yi=i,this},fill:function(t){t&&t.fill(),this.toStatic()},stroke:function(t){t&&t.stroke(),this.toStatic()},setLineDash:function(t){if(t instanceof Array){this._lineDash=t;for(var e=this._dashIdx=0,i=0;ie.length&&(this._expandData(),e=this.data);for(var i=0;il||tr(r-o)>u||c===h-1)&&(t.lineTo(a,r),n=a,o=r);break;case Za.C:t.bezierCurveTo(s[c++],s[c++],s[c++],s[c++],s[c++],s[c++]),n=s[c-2],o=s[c-1];break;case Za.Q:t.quadraticCurveTo(s[c++],s[c++],s[c++],s[c++]),n=s[c-2],o=s[c-1];break;case Za.A:var f=s[c++],p=s[c++],g=s[c++],m=s[c++],v=s[c++],y=s[c++],x=s[c++],_=s[c++],w=m=pr[n=0]+t&&r<=pr[1]+t?h:0}if(a){l=n;n=sr(o),o=sr(l)}else n=sr(n),o=sr(o);oMath.PI/2&&p<1.5*Math.PI&&(h=-h),c+=h)}}return c}function xr(t,e,i,n,o){for(var a=0,r=0,s=0,l=0,u=0,h=0;hMath.abs(a[1])?0=e[1])return i[1]}else{if(t>=e[0])return i[0];if(t<=e[1])return i[1]}else{if(t===e[0])return i[0];if(t===e[1])return i[1]}return(t-e[0])/o*a+i[0]}function Pl(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%"}return"string"==typeof t?function(t){return t.replace(/^\s+|\s+$/g,"")}(t).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):null==t?NaN:+t}function Nl(t,e,i){return null==e&&(e=10),e=Math.min(Math.max(0,e),20),t=(+t).toFixed(e),i?t:+t}function Ol(t){return t.sort(function(t,e){return t-e}),t}function El(t){if(t=+t,isNaN(t))return 0;for(var e=1,i=0;Math.round(t*e)/e!==t;)e*=10,i++;return i}function zl(t){var e=t.toString(),i=e.indexOf("e");if(0h&&(h=u[d],c=d);++s[c],u[c]=0,++l}return s[e]/o}var Vl=9007199254740991;function Gl(t){var e=2*Math.PI;return(t%e+e)%e}function Fl(t){return-Ll"'])/g,tu={"&":"&","<":"<",">":">",'"':""","'":"'"};function eu(t){return null==t?"":(t+"").replace(Ql,function(t,e){return tu[e]})}function iu(t,e){return"{"+t+(null==e?"":e)+"}"}var nu=["a","b","c","d","e","f","g"];function ou(t,e,i){k(e)||(e=[e]);var n=e.length;if(!n)return"";for(var o=e[0].$vars||[],a=0;a':'':{renderMode:o,content:"{marker"+a+"|} ",style:{color:i}}:""}function su(t,e){return"0000".substr(0,e-(t+="").length)+t}function lu(t,e,i){"week"!==t&&"month"!==t&&"quarter"!==t&&"half-year"!==t&&"year"!==t||(t="MM-dd\nyyyy");var n=Hl(e),o=i?"UTC":"",a=n["get"+o+"FullYear"](),r=n["get"+o+"Month"]()+1,s=n["get"+o+"Date"](),l=n["get"+o+"Hours"](),u=n["get"+o+"Minutes"](),h=n["get"+o+"Seconds"](),c=n["get"+o+"Milliseconds"]();return t=t.replace("MM",su(r,2)).replace("M",r).replace("yyyy",a).replace("yy",a%100).replace("dd",su(s,2)).replace("d",s).replace("hh",su(l,2)).replace("h",l).replace("mm",su(u,2)).replace("m",u).replace("ss",su(h,2)).replace("s",h).replace("SSS",su(c,3))}function uu(t){return t?t.charAt(0).toUpperCase()+t.substr(1):t}var hu=gn;var cu=(Object.freeze||Object)({addCommas:Kl,toCamelCase:$l,normalizeCssArray:Jl,encodeHTML:eu,formatTpl:ou,formatTplSimple:au,getTooltipMarker:ru,formatTime:lu,capitalFirst:uu,truncateText:hu,getTextBoundingRect:function(t){return cn(t.text,t.font,t.textAlign,t.textVerticalAlign,t.textPadding,t.textLineHeight,t.rich,t.truncate)},getTextRect:function(t,e,i,n,o,a,r,s){return cn(t,e,i,n,o,s,a,r)}}),du=E,fu=["left","right","top","bottom","width","height"],pu=[["width","left","right"],["height","top","bottom"]];function gu(h,c,d,f,p){var g=0,m=0;null==f&&(f=1/0),null==p&&(p=1/0);var v=0;c.eachChild(function(t,e){var i,n,o=t.position,a=t.getBoundingRect(),r=c.childAt(e+1),s=r&&r.getBoundingRect();if("horizontal"===h){var l=a.width+(s?-s.x+a.x:0);v=f<(i=g+l)||t.newline?(g=0,i=l,m+=v+d,a.height):Math.max(v,a.height)}else{var u=a.height+(s?-s.y+a.y:0);v=p<(n=m+u)||t.newline?(g+=v+d,m=0,n=u,a.width):Math.max(v,a.width)}t.newline||(o[0]=g,o[1]=m,"horizontal"===h?g=i+d:m=n+d)})}var mu=gu;T(gu,"vertical"),T(gu,"horizontal");function vu(t,e,i){i=Jl(i||0);var n=e.width,o=e.height,a=Pl(t.left,n),r=Pl(t.top,o),s=Pl(t.right,n),l=Pl(t.bottom,o),u=Pl(t.width,n),h=Pl(t.height,o),c=i[2]+i[0],d=i[1]+i[3],f=t.aspect;switch(isNaN(u)&&(u=n-s-d-a),isNaN(h)&&(h=o-l-c-r),null!=f&&(isNaN(u)&&isNaN(h)&&(n/oe)return t[n];return t[i-1]}(s,i):r;if((l=l||r)&&l.length){var u=l[o];return t&&(a[t]=u),n.colorIdx=(o+1)%l.length,u}}},Pu="original",Nu="arrayRows",Ou="objectRows",Eu="keyedColumns",zu="unknown",Ru="typedArray",Bu="column",Vu="row";function Gu(t){this.fromDataset=t.fromDataset,this.data=t.data||(t.sourceFormat===Eu?{}:[]),this.sourceFormat=t.sourceFormat||zu,this.seriesLayoutBy=t.seriesLayoutBy||Bu,this.dimensionsDefine=t.dimensionsDefine,this.encodeDefine=t.encodeDefine&&Q(t.encodeDefine),this.startIndex=t.startIndex||0,this.dimensionsDetectCount=t.dimensionsDetectCount}Gu.seriesDataToSource=function(t){return new Gu({data:t,sourceFormat:V(t)?Ru:Pu,fromDataset:!1})},ia(Gu);var Fu={Must:1,Might:2,Not:3},Wu=Zo();function Hu(t){var e=t.option,i=e.data,n=V(i)?Ru:Pu,o=!1,a=e.seriesLayoutBy,r=e.sourceHeader,s=e.dimensions,l=ju(t);if(l){var u=l.option;i=u.source,n=Wu(l).sourceFormat,o=!0,a=a||u.seriesLayoutBy,null==r&&(r=u.sourceHeader),s=s||u.dimensions}var h=function(t,e,i,n,o){if(!t)return{dimensionsDefine:Zu(o)};var a,r;if(e===Nu)"auto"===n||null==n?Uu(function(t){null!=t&&"-"!==t&&(z(t)?null==r&&(r=1):r=0)},i,t,10):r=n?1:0,o||1!==r||(o=[],Uu(function(t,e){o[e]=null!=t?t:""},i,t)),a=o?o.length:i===Vu?t.length:t[0]?t[0].length:null;else if(e===Ou)o=o||function(t){var e,i=0;for(;i":"\n",f="richText"===c,p={},g=0;function i(t){return{renderMode:c,content:eu(Kl(t)),style:p}}var m=this.getData(),a=m.mapDimension("defaultedTooltip",!0),n=a.length,r=this.getRawValue(o),s=k(r),v=m.getItemVisual(o,"color");R(v)&&v.colorStops&&(v=(v.colorStops[0]||{}).color),v=v||"transparent";var l=(1":"",n=i+u.join(i||", ");return{renderMode:c,content:n,style:p}}(r):i(n?Bh(m,o,a[0]):s?r[0]:r)).content,u=d.seriesIndex+"at"+g,y=ru({color:v,type:"item",renderMode:c,markerId:u});p[u]=v,++g;var x=m.getName(o),_=this.name;Fo(this)||(_=""),_=_?eu(_)+(h?": ":e):"";var w="string"==typeof y?y:y.content;return{html:h?w+_+l:_+w+(x?eu(x)+": "+l:l),markers:p}},isAnimationEnabled:function(){if(v.node)return!1;var t=this.getShallow("animation");return t&&this.getData().count()>this.getShallow("animationThreshold")&&(t=!1),t},restoreData:function(){this.dataTask.dirty()},getColorFromPalette:function(t,e,i){var n=this.ecModel,o=ku.getColorFromPalette.call(this,t,e,i);return o=o||n.getColorFromPalette(t,e,i)},coordDimToDataDim:function(t){return this.getRawData().mapDimension(t,!0)},getProgressive:function(){return this.get("progressive")},getProgressiveThreshold:function(){return this.get("progressiveThreshold")},getAxisTooltipData:null,getTooltipPosition:null,pipeTask:null,preventIncremental:null,pipelineContext:null});function nc(t){var e=t.name;Fo(t)||(t.name=function(t){var i=t.getRawData(),e=i.mapDimension("seriesName",!0),n=[];return E(e,function(t){var e=i.getDimensionInfo(t);e.displayName&&n.push(e.displayName)}),n.join(" ")}(t)||e)}function oc(t){return t.model.getRawData().count()}function ac(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),rc}function rc(t,e){t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function sc(e,i){E(e.CHANGABLE_METHODS,function(t){e.wrapMethod(t,T(lc,i))})}function lc(t){var e=uc(t);e&&e.setOutputEnd(this.count())}function uc(t){var e=(t.ecModel||{}).scheduler,i=e&&e.getPipeline(t.uid);if(i){var n=i.currentTask;if(n){var o=n.agentStubMap;o&&(n=o.get(t.uid))}return n}}b(ic,Fh),b(ic,ku);var hc=function(){this.group=new Ii,this.uid=Cl("viewComponent")};hc.prototype={constructor:hc,init:function(t,e){},render:function(t,e,i,n){},dispose:function(){},filterForExposedEvent:null};var cc=hc.prototype;cc.updateView=cc.updateLayout=cc.updateVisual=function(t,e,i,n){},ta(hc),aa(hc,{registerWhenExtend:!0});function dc(){var s=Zo();return function(t){var e=s(t),i=t.pipelineContext,n=e.large,o=e.progressiveRender,a=e.large=i.large,r=e.progressiveRender=i.progressiveRender;return!!(n^a||o^r)&&"reset"}}var fc=Zo(),pc=dc();function gc(){this.group=new Ii,this.uid=Cl("viewChart"),this.renderTask=Wh({plan:xc,reset:_c}),this.renderTask.context={view:this}}var mc=gc.prototype={type:"chart",init:function(t,e){},render:function(t,e,i,n){},highlight:function(t,e,i,n){yc(t.getData(),n,"emphasis")},downplay:function(t,e,i,n){yc(t.getData(),n,"normal")},remove:function(t,e){this.group.removeAll()},dispose:function(){},incrementalPrepareRender:null,incrementalRender:null,updateTransform:null,filterForExposedEvent:null};function vc(t,e,i){if(t&&(t.trigger(e,i),t.isGroup&&!qs(t)))for(var n=0,o=t.childCount();nc?i+=p(g("data.partialData"),{displayCnt:c}):i+=g("data.allData");for(var r=[],s=0;si.blockIndex?i.step:null,a=n&&n.modDataCount;return{step:o,modBy:null!=a?Math.ceil(a/o):null,modDataCount:a}}},Nc.getPipeline=function(t){return this._pipelineMap.get(t)},Nc.updateStreamModes=function(t,e){var i=this._pipelineMap.get(t.uid),n=t.getData().count(),o=i.progressiveEnabled&&e.incrementalPrepareRender&&n>=i.threshold,a=t.get("large")&&n>=t.get("largeThreshold"),r="mod"===t.get("progressiveChunkMode")?n:null;t.pipelineContext=i.context={progressiveRender:o,modDataCount:r,large:a}},Nc.restorePipelines=function(t){var n=this,o=n._pipelineMap=Q();t.eachSeries(function(t){var e=t.getProgressive(),i=t.uid;o.set(i,{id:i,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:e&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(e||700),count:0}),Uc(n,t,t.dataTask)})},Nc.prepareStageTasks=function(){var i=this._stageTaskMap,n=this.ecInstance.getModel(),o=this.api;E(this._allHandlers,function(t){var e=i.get(t.uid)||i.set(t.uid,[]);t.reset&&function(n,o,t,a,r){var s=t.seriesTaskMap||(t.seriesTaskMap=Q()),e=o.seriesType,i=o.getTargetSeries;o.createOnAllSeries?a.eachRawSeries(l):e?a.eachRawSeriesByType(e,l):i&&i(a,r).each(l);function l(t){var e=t.uid,i=s.get(e)||s.set(e,Wh({plan:Gc,reset:Fc,count:Zc}));i.context={model:t,ecModel:a,api:r,useClearVisual:o.isVisual&&!o.isLayout,plan:o.plan,reset:o.reset,scheduler:n},Uc(n,t,i)}var u=n._pipelineMap;s.each(function(t,e){u.get(e)||(t.dispose(),s.removeKey(e))})}(this,t,e,n,o),t.overallReset&&function(n,t,e,i,o){var a=e.overallTask=e.overallTask||Wh({reset:zc});a.context={ecModel:i,api:o,overallReset:t.overallReset,scheduler:n};var r=a.agentStubMap=a.agentStubMap||Q(),s=t.seriesType,l=t.getTargetSeries,u=!0,h=t.modifyOutputEnd;s?i.eachRawSeriesByType(s,c):l?l(i,o).each(c):(u=!1,E(i.getSeries(),c));function c(t){var e=t.uid,i=r.get(e);i||(i=r.set(e,Wh({reset:Rc,onDirty:Vc})),a.dirty()),i.context={model:t,overallProgress:u,modifyOutputEnd:h},i.agent=a,i.__block=u,Uc(n,t,i)}var d=n._pipelineMap;r.each(function(t,e){d.get(e)||(t.dispose(),a.dirty(),r.removeKey(e))})}(this,t,e,n,o)},this)},Nc.prepareView=function(t,e,i,n){var o=t.renderTask,a=o.context;a.model=e,a.ecModel=i,a.api=n,o.__block=!t.incrementalPrepareRender,Uc(this,e,o)},Nc.performDataProcessorTasks=function(t,e){Oc(this,this._dataProcessorHandlers,t,e,{block:!0})},Nc.performVisualTasks=function(t,e,i){Oc(this,this._visualHandlers,t,e,i)},Nc.performSeriesTasks=function(t){var e;t.eachSeries(function(t){e|=t.dataTask.perform()}),this.unfinished|=e},Nc.plan=function(){this._pipelineMap.each(function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}e=e.getUpstream()}while(e)})};var Ec=Nc.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)};function zc(t){t.overallReset(t.ecModel,t.api,t.payload)}function Rc(t,e){return t.overallProgress&&Bc}function Bc(){this.agent.dirty(),this.getDownstream().dirty()}function Vc(){this.agent&&this.agent.dirty()}function Gc(t){return t.plan&&t.plan(t.model,t.ecModel,t.api,t.payload)}function Fc(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=Eo(t.reset(t.model,t.ecModel,t.api,t.payload));return 1t.get("hoverLayerThreshold")&&!v.node&&t.eachSeries(function(t){if(!t.preventUsingHoverLayer){var e=i._chartsMap[t.__viewId];e.__alive&&e.group.traverse(function(t){t.useHoverLayer=!0})}})}(n,t),Lc(n._zr.dom,t)}function Ud(e,i){wd(Qd,function(t){t(e,i)})}Pd.resize=function(t){if(!this._disposed){this._zr.resize(t);var e=this._model;if(this._loadingFX&&this._loadingFX.resize(),e){var i=e.resetOption("media"),n=t&&t.silent;this[Td]=!0,i&&Ed(this),Od.update.call(this),this[Td]=!1,Vd.call(this,n),Gd.call(this,n)}}},Pd.showLoading=function(t,e){if(!this._disposed&&(Sd(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),nf[t])){var i=nf[t](this._api,e),n=this._zr;this._loadingFX=i,n.add(i)}},Pd.hideLoading=function(){this._disposed||(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},Pd.makeActionFromEvent=function(t){var e=L({},t);return e.type=Kd[t.type],e},Pd.dispatchAction=function(t,e){this._disposed||(Sd(e)||(e={silent:!!e}),qd[t.type]&&this._model&&(this[Td]?this._pendingActions.push(t):(Bd.call(this,t,e.silent),e.flush?this._zr.flush(!0):!1!==e.flush&&v.browser.weChat&&this._throttledZrFlush(),Vd.call(this,e.silent),Gd.call(this,e.silent))))},Pd.appendData=function(t){if(!this._disposed){var e=t.seriesIndex;this.getModel().getSeriesByIndex(e).appendData(t),this._scheduler.unfinished=!0}},Pd.on=Cd("on",!1),Pd.off=Cd("off",!1),Pd.one=Cd("one",!1);var Xd=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];function Yd(t,e){var i=t.get("z"),n=t.get("zlevel");e.group.traverse(function(t){"group"!==t.type&&(null!=i&&(t.z=i),null!=n&&(t.zlevel=n))})}function jd(){this.eventInfo}Pd._initEvents=function(){wd(Xd,function(u){function t(t){var e,i=this.getModel(),n=t.target;if("globalout"===u)e={};else if(n&&null!=n.dataIndex){var o=n.dataModel||i.getSeriesByIndex(n.seriesIndex);e=o&&o.getDataParams(n.dataIndex,n.dataType,n)||{}}else n&&n.eventData&&(e=L({},n.eventData));if(e){var a=e.componentType,r=e.componentIndex;"markLine"!==a&&"markPoint"!==a&&"markArea"!==a||(a="series",r=e.seriesIndex);var s=a&&null!=r&&i.getComponent(a,r),l=s&&this["series"===s.mainType?"_chartsMap":"_componentsMap"][s.__viewId];e.event=t,e.type=u,this._ecEventProcessor.eventInfo={targetEl:n,packedEvent:e,model:s,view:l},this.trigger(u,e)}}t.zrEventfulCallAtLast=!0,this._zr.on(u,t,this)},this),wd(Kd,function(t,e){this._messageCenter.on(e,function(t){this.trigger(e,t)},this)},this)},Pd.isDisposed=function(){return this._disposed},Pd.clear=function(){this._disposed||this.setOption({series:[]},!0)},Pd.dispose=function(){if(!this._disposed){this._disposed=!0,jo(this.getDom(),lf,"");var e=this._api,i=this._model;wd(this._componentsViews,function(t){t.dispose(i,e)}),wd(this._chartsViews,function(t){t.dispose(i,e)}),this._zr.dispose(),delete of[this.id]}},b(kd,Ct),jd.prototype={constructor:jd,normalizeQuery:function(t){var s={},l={},u={};if(z(t)){var e=Md(t);s.mainType=e.main||null,s.subType=e.sub||null}else{var h=["Index","Name","Id"],c={name:1,dataIndex:1,dataType:1};E(t,function(t,e){for(var i=!1,n=0;nx[1]&&(x[1]=y)}e&&(this._nameList[d]=e[f])}this._rawCount=this._count=l,this._extent={},Uf(this)},Hf._initDataFromProvider=function(t,e){if(!(e<=t)){for(var i,n=this._chunkSize,o=this._rawData,a=this._storage,r=this.dimensions,s=r.length,l=this._dimensionInfos,u=this._nameList,h=this._idList,c=this._rawExtent,d=this._nameRepeatCount={},f=this._chunkCount,p=0;pM[1]&&(M[1]=S)}if(!o.pure){var I=u[v];if(m&&null==I)if(null!=m.name)u[v]=I=m.name;else if(null!=i){var T=r[i],A=a[T][y];if(A){I=A[x];var D=l[T].ordinalMeta;D&&D.categories.length&&(I=D.categories[I])}}var C=null==m?null:m.id;null==C&&null!=I&&(d[I]=d[I]||0,0=this._rawCount||t<0)return-1;if(!this._indices)return t;var e=this._indices,i=e[t];if(null!=i&&it))return a;o=a-1}}return-1},Hf.indicesOfNearest=function(t,e,i){var n=[];if(!this._storage[t])return n;null==i&&(i=1/0);for(var o=1/0,a=-1,r=0,s=0,l=this.count();st[I][1])&&(M=!1)}M&&(a[r++]=this.getRawIndex(m))}return rw[1]&&(w[1]=_)}}}return o},Hf.downSample=function(t,e,i,n){for(var o=$f(this,[t]),a=o._storage,r=[],s=Math.floor(1/e),l=a[t],u=this.count(),h=this._chunkSize,c=o._rawExtent[t],d=new(Bf(this))(u),f=0,p=0;pc[1]&&(c[1]=x),d[f++]=_}return o._count=f,o._indices=d,o.getRawIndex=jf,o},Hf.getItemModel=function(t){var e=this.hostModel;return new Il(this.getRawDataItem(t),e,e&&e.ecModel)},Hf.diff=function(e){var i=this;return new Tf(e?e.getIndices():[],this.getIndices(),function(t){return qf(e,t)},function(t){return qf(i,t)})},Hf.getVisual=function(t){var e=this._visual;return e&&e[t]},Hf.setVisual=function(t,e){if(Pf(t))for(var i in t)t.hasOwnProperty(i)&&this.setVisual(i,t[i]);else this._visual=this._visual||{},this._visual[t]=e},Hf.setLayout=function(t,e){if(Pf(t))for(var i in t)t.hasOwnProperty(i)&&this.setLayout(i,t[i]);else this._layout[t]=e},Hf.getLayout=function(t){return this._layout[t]},Hf.getItemLayout=function(t){return this._itemLayouts[t]},Hf.setItemLayout=function(t,e,i){this._itemLayouts[t]=i?L(this._itemLayouts[t]||{},e):e},Hf.clearItemLayouts=function(){this._itemLayouts.length=0},Hf.getItemVisual=function(t,e,i){var n=this._itemVisuals[t],o=n&&n[e];return null!=o||i?o:this.getVisual(e)},Hf.setItemVisual=function(t,e,i){var n=this._itemVisuals[t]||{},o=this.hasItemVisual;if(this._itemVisuals[t]=n,Pf(e))for(var a in e)e.hasOwnProperty(a)&&(n[a]=e[a],o[a]=!0);else n[e]=i,o[e]=!0},Hf.clearAllVisual=function(){this._visual={},this._itemVisuals=[],this.hasItemVisual={}};function tp(t){t.seriesIndex=this.seriesIndex,t.dataIndex=this.dataIndex,t.dataType=this.dataType}function ep(t,e,i){Gu.isInstance(e)||(e=Gu.seriesDataToSource(e)),i=i||{},t=(t||[]).slice();for(var n=(i.dimsDef||[]).slice(),o=Q(),a=Q(),l=[],r=function(t,e,i,n){var o=Math.max(t.dimensionsDetectCount||1,e.length,i.length,n||0);return E(e,function(t){var e=t.dimsDef;e&&(o=Math.max(o,e.length))}),o}(e,t,n,i.dimCount),s=0;s=e[0]&&t<=e[1]},cp.prototype.normalize=function(t){var e=this._extent;return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])},cp.prototype.scale=function(t){var e=this._extent;return t*(e[1]-e[0])+e[0]},cp.prototype.unionExtent=function(t){var e=this._extent;t[0]e[1]&&(e[1]=t[1])},cp.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},cp.prototype.getExtent=function(){return this._extent.slice()},cp.prototype.setExtent=function(t,e){var i=this._extent;isNaN(t)||(i[0]=t),isNaN(e)||(i[1]=e)},cp.prototype.isBlank=function(){return this._isBlank},cp.prototype.setBlank=function(t){this._isBlank=t},cp.prototype.getLabel=null,ta(cp),aa(cp,{registerWhenExtend:!0}),dp.createByAxisModel=function(t){var e=t.option,i=e.data,n=i&&N(i,gp);return new dp({categories:n,needCollect:!n,deduplication:!1!==e.dedplication})};var fp=dp.prototype;function pp(t){return t._map||(t._map=Q(t.categories))}function gp(t){return R(t)&&null!=t.value?t.value:t+""}fp.getOrdinal=function(t){return pp(this).get(t)},fp.parseAndCollect=function(t){var e,i=this._needCollect;if("string"!=typeof t&&!i)return t;if(i&&!this._deduplication)return e=this.categories.length,this.categories[e]=t,e;var n=pp(this);return null==(e=n.get(t))&&(i?(e=this.categories.length,this.categories[e]=t,n.set(t,e)):e=NaN),e};var mp=cp.prototype,vp=cp.extend({type:"ordinal",init:function(t,e){t&&!k(t)||(t=new dp({categories:t})),this._ordinalMeta=t,this._extent=e||[0,t.categories.length-1]},parse:function(t){return"string"==typeof t?this._ordinalMeta.getOrdinal(t):Math.round(t)},contain:function(t){return t=this.parse(t),mp.contain.call(this,t)&&null!=this._ordinalMeta.categories[t]},normalize:function(t){return mp.normalize.call(this,this.parse(t))},scale:function(t){return Math.round(mp.scale.call(this,t))},getTicks:function(){for(var t=[],e=this._extent,i=e[0];i<=e[1];)t.push(i),i++;return t},getLabel:function(t){if(!this.isBlank())return this._ordinalMeta.categories[t]},count:function(){return this._extent[1]-this._extent[0]+1},unionExtentFromData:function(t,e){this.unionExtent(t.getApproximateExtent(e))},getOrdinalMeta:function(){return this._ordinalMeta},niceTicks:et,niceExtent:et});vp.create=function(){return new vp};var yp=Nl;function xp(t){return zl(t)+2}function _p(t,e,i){t[e]=Math.max(Math.min(t[e],i[1]),i[0])}function wp(t,e){isFinite(t[0])||(t[0]=e[0]),isFinite(t[1])||(t[1]=e[1]),_p(t,0,e),_p(t,1,e),t[0]>t[1]&&(t[0]=t[1])}var bp=Nl,Sp=cp.extend({type:"interval",_interval:0,_intervalPrecision:2,setExtent:function(t,e){var i=this._extent;isNaN(t)||(i[0]=parseFloat(t)),isNaN(e)||(i[1]=parseFloat(e))},unionExtent:function(t){var e=this._extent;t[0]e[1]&&(e[1]=t[1]),Sp.prototype.setExtent.call(this,e[0],e[1])},getInterval:function(){return this._interval},setInterval:function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=xp(t)},getTicks:function(t){var e=this._interval,i=this._extent,n=this._niceExtent,o=this._intervalPrecision,a=[];if(!e)return a;i[0]s&&(t?a.push(s+e):a.push(i[1])),a},getMinorTicks:function(t){for(var e=this.getTicks(!0),i=[],n=this.getExtent(),o=1;on[0]&&h>>1;t[o][1]>1^-(1&s),l=l>>1^-(1&l),o=s+=o,a=l+=a,n.push([s/i,l/i])}return n}bg.prototype={constructor:bg,properties:null,getBoundingRect:function(){var t=this._rect;if(t)return t;for(var e=Number.MAX_VALUE,i=[e,e],n=[-e,-e],o=[],a=[],r=this.geometries,s=0;ss[1];d(e[0].coord,s[0])&&(n?e[0].coord=s[0]:e.shift());n&&d(s[0],e[0].coord)&&e.unshift({coord:s[0]});d(s[1],a.coord)&&(n?a.coord=s[1]:e.pop());n&&d(a.coord,s[1])&&e.push({coord:s[1]});function d(t,e){return t=Nl(t),e=Nl(e),c?en[0]&&(n[0]=a[0]),a[1]>n[1]&&(n[1]=a[1])}return{min:e?i:n,max:e?n:i}}var pm=Sr.extend({type:"ec-polyline",shape:{points:[],smooth:0,smoothConstraint:!0,smoothMonotone:null,connectNulls:!1},style:{fill:null,stroke:"#000"},brush:Wr(Sr.prototype.brush),buildPath:function(t,e){var i=e.points,n=0,o=i.length,a=fm(i,e.smoothConstraint);if(e.connectNulls){for(;0n)return!1;return!0}(a,e))){var r=e.mapDimension(a.dim),s={};return E(a.getViewLabels(),function(t){s[t.tickValue]=1}),function(t){return!s.hasOwnProperty(e.get(r,t))}}}}function Sm(t,e,i){if("cartesian2d"!==t.type)return vm(t,e,i);var n=t.getBaseAxis().isHorizontal(),o=mm(t,e,i);if(!i.get("clip",!0)){var a=o.shape,r=Math.max(a.width,a.height);n?(a.y-=r,a.height+=2*r):(a.x-=r,a.width+=2*r)}return o}gc.extend({type:"line",init:function(){var t=new Ii,e=new $g;this.group.add(e.group),this._symbolDraw=e,this._lineGroup=t},render:function(t,e,i){var n=t.coordinateSystem,o=this.group,a=t.getData(),r=t.getModel("lineStyle"),s=t.getModel("areaStyle"),l=a.mapArray(a.getItemLayout),u="polar"===n.type,h=this._coordSys,c=this._symbolDraw,d=this._polyline,f=this._polygon,p=this._lineGroup,g=t.get("animation"),m=!s.isEmpty(),v=s.get("origin"),y=function(t,e,i){if(!i.valueDim)return[];for(var n=[],o=0,a=e.count();oh[c-1].coord&&(h.reverse(),d.reverse());var f=h[0].coord-10,p=h[c-1].coord+10,g=p-f;if(g<.001)return"transparent";E(h,function(t){t.offset=(t.coord-f)/g}),h.push({offset:c?h[c-1].offset:.5,color:d[1]||"transparent"}),h.unshift({offset:c?h[0].offset:.5,color:d[0]||"transparent"});var m=new cs(0,0,0,0,h,!0);return m[n]=f,m[n+"2"]=p,m}}}(a,n)||a.getVisual("color");d.useStyle(C(r.getLineStyle(),{fill:"none",stroke:M,lineJoin:"bevel"}));var I=t.get("smooth");if(I=_m(t.get("smooth")),d.setShape({smooth:I,smoothMonotone:t.get("smoothMonotone"),connectNulls:t.get("connectNulls")}),f){var T=a.getCalculationInfo("stackedOnSeries"),A=0;f.useStyle(C(s.getAreaStyle(),{fill:M,opacity:.7,lineJoin:"bevel"})),T&&(A=_m(T.get("smooth"))),f.setShape({smooth:I,stackedOnSmooth:A,smoothMonotone:t.get("smoothMonotone"),connectNulls:t.get("connectNulls")})}this._data=a,this._coordSys=n,this._stackedOnPoints=y,this._points=l,this._step=S,this._valueOrigin=v},dispose:function(){},highlight:function(t,e,i,n){var o=t.getData(),a=Ho(o,n);if(!(a instanceof Array)&&null!=a&&0<=a){var r=o.getItemGraphicEl(a);if(!r){var s=o.getItemLayout(a);if(!s)return;if(this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(s[0],s[1]))return;(r=new Fg(o,a)).position=s,r.setZ(t.get("zlevel"),t.get("z")),r.ignore=isNaN(s[0])||isNaN(s[1]),r.__temp=!0,o.setItemGraphicEl(a,r),r.stopSymbolAnimation(!0),this.group.add(r)}r.highlight()}else gc.prototype.highlight.call(this,t,e,i,n)},downplay:function(t,e,i,n){var o=t.getData(),a=Ho(o,n);if(null!=a&&0<=a){var r=o.getItemGraphicEl(a);r&&(r.__temp?(o.setItemGraphicEl(a,null),this.group.remove(r)):r.downplay())}else gc.prototype.downplay.call(this,t,e,i,n)},_newPolyline:function(t){var e=this._polyline;return e&&this._lineGroup.remove(e),e=new pm({shape:{points:t},silent:!0,z2:10}),this._lineGroup.add(e),this._polyline=e},_newPolygon:function(t,e){var i=this._polygon;return i&&this._lineGroup.remove(i),i=new gm({shape:{points:t,stackedOnPoints:e},silent:!0}),this._lineGroup.add(i),this._polygon=i},_updateAnimation:function(t,e,i,n,o,a){var r=this._polyline,s=this._polygon,l=t.hostModel,u=function(t,e,i,n,o,a,r,s){for(var l=function(t,e){var i=[];return e.diff(t).add(function(t){i.push({cmd:"+",idx:t})}).update(function(t,e){i.push({cmd:"=",idx:e,idx1:t})}).remove(function(t){i.push({cmd:"-",idx:t})}).execute(),i}(t,e),u=[],h=[],c=[],d=[],f=[],p=[],g=[],m=im(o,e,r),v=im(a,t,s),y=0;ye&&(e=t[i]);return isFinite(e)?e:NaN},min:function(t){for(var e=1/0,i=0;ie[1]&&e.reverse(),e},getOtherAxis:function(){this.grid.getOtherAxis()},pointToData:function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},toLocalCoord:null,toGlobalCoord:null},w(km,Eg);var Pm={show:!0,zlevel:0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#333",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}},Nm={};Nm.categoryAxis=m({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},Pm),Nm.valueAxis=m({boundaryGap:[0,0],splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#eee",width:1}}},Pm),Nm.timeAxis=C({scale:!0,min:"dataMin",max:"dataMax"},Nm.valueAxis),Nm.logAxis=C({scale:!0,logBase:10},Nm.valueAxis);function Om(a,t,r,e){E(Em,function(o){t.extend({type:a+"Axis."+o,mergeDefaultAndTheme:function(t,e){var i=this.layoutMode,n=i?_u(t):{};m(t,e.getTheme().get(o+"Axis")),m(t,this.getDefaultOption()),t.type=r(a,t),i&&xu(t,n,i)},optionUpdated:function(){"category"===this.option.type&&(this.__ordinalMeta=dp.createByAxisModel(this))},getCategories:function(t){var e=this.option;if("category"===e.type)return t?e.data:this.__ordinalMeta.categories},getOrdinalMeta:function(){return this.__ordinalMeta},defaultOption:p([{},Nm[o+"Axis"],e],!0)})}),Tu.registerSubTypeDefaulter(a+"Axis",T(r,a))}var Em=["value","category","time","log"],zm=Tu.extend({type:"cartesian2dAxis",axis:null,init:function(){zm.superApply(this,"init",arguments),this.resetRange()},mergeOption:function(){zm.superApply(this,"mergeOption",arguments),this.resetRange()},restoreData:function(){zm.superApply(this,"restoreData",arguments),this.resetRange()},getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"grid",index:this.option.gridIndex,id:this.option.gridId})[0]}});function Rm(t,e){return e.type||(e.data?"category":"value")}m(zm.prototype,sg);var Bm={offset:0};function Vm(t,e){return t.getCoordSysModel()===e}function Gm(t,e,i){this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this._initCartesian(t,e,i),this.model=t}Om("x",zm,Rm,Bm),Om("y",zm,Rm,Bm),Tu.extend({type:"grid",dependencies:["xAxis","yAxis"],layoutMode:"box",coordinateSystem:null,defaultOption:{show:!1,zlevel:0,z:0,left:"10%",top:60,right:"10%",bottom:60,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"}});var Fm=Gm.prototype;function Wm(t,e,i,n){i.getAxesOnZeroOf=function(){return o?[o]:[]};var o,a=t[e],r=i.model,s=r.get("axisLine.onZero"),l=r.get("axisLine.onZeroAxisIndex");if(s){if(null!=l)Hm(a[l])&&(o=a[l]);else for(var u in a)if(a.hasOwnProperty(u)&&Hm(a[u])&&!n[h(a[u])]){o=a[u];break}o&&(n[h(o)]=!0)}function h(t){return t.dim+"_"+t.index}}function Hm(t){return t&&"category"!==t.type&&"time"!==t.type&&function(t){var e=t.scale.getExtent(),i=e[0],n=e[1];return!(0u[1]?-1:1,c=["start"===a?u[0]-h*l:"end"===a?u[1]+h*l:(u[0]+u[1])/2,ev(a)?t.labelOffset+r*l:0],d=e.get("nameRotate");null!=d&&(d=d*jm/180),ev(a)?n=$m(t.rotation,null!=d?d:t.rotation,r):(n=function(t,e,i,n){var o,a,r=Gl(i-t.rotation),s=n[0]>n[1],l="start"===e&&!s||"start"!==e&&s;o=Fl(r-jm/2)?(a=l?"bottom":"top","center"):Fl(r-1.5*jm)?(a=l?"top":"bottom","center"):(a="middle",r<1.5*jm&&jm/2l[1]&&l.reverse(),(null==r||r>l[1])&&(r=l[1]),r=i.r0}}});var jv=Math.PI/180;function qv(o,t,e,i,n,a,r,s,l,u){function h(t,e,i){for(var n=t;nl+r);n++)if(o[n].y+=i,to[n].y+o[n].height)return void c(n,i/2);c(e-1,i/2)}function c(t,e){for(var i=t;0<=i&&!(o[i].y-eo[i-1].y+o[i-1].height));i--);}function d(t,e,i,n,o,a){for(var r=e?Number.MAX_VALUE:0,s=0,l=t.length;s=e?v.push(o[y]):m.push(o[y]);d(m,!1,t,e,i,n),d(v,!0,t,e,i,n)}function Kv(t){return"center"===t.position}function $v(L,k,P,t,N,e){var O,E,z=L.getData(),R=[],B=!1,V=(L.get("minShowLabelAngle")||0)*jv;z.each(function(t){var e=z.getItemLayout(t),i=z.getItemModel(t),n=i.getModel("label"),o=n.get("position")||i.get("emphasis.label.position"),a=n.get("distanceToLabelLine"),r=n.get("alignTo"),s=Pl(n.get("margin"),P),l=n.get("bleedMargin"),u=n.getFont(),h=i.getModel("labelLine"),c=h.get("length");c=Pl(c,P);var d=h.get("length2");if(d=Pl(d,P),!(e.anglei[0]&&isFinite(u)&&isFinite(i[0]););else{var h=o.getTicks().length-1;f"+N(t,function(t,e){var i=o.get(o.mapDimension(t.dim),n);return eu(t.name+" : "+i)}).join("
")},defaultOption:{zlevel:0,z:2,coordinateSystem:"radar",legendHoverLink:!0,radarIndex:0,lineStyle:{width:2,type:"solid"},label:{position:"top"},symbol:"emptyCircle",symbolSize:4}});Mf({type:"radar",render:function(l,t,e){var i=l.coordinateSystem,g=this.group,m=l.getData(),s=this._data;function u(t,e){var i=t.getItemVisual(e,"symbol")||"circle",n=t.getItemVisual(e,"color");if("none"!==i){var o=function(t){return k(t)||(t=[+t,+t]),t}(t.getItemVisual(e,"symbolSize")),a=mg(i,-1,-1,2,2,n);return a.attr({style:{strokeNoScale:!0},z2:100,scale:[o[0]/2,o[1]/2]}),a}}function h(t,e,i,n,o,a){i.removeAll();for(var r=0;r"+eu(n+" : "+i)},getTooltipPosition:function(t){if(null!=t){var e=this.getData().getName(t),i=this.coordinateSystem,n=i.getRegion(e);return n&&i.dataToPoint(n.center)}},setZoom:function(t){this.option.zoom=t},setCenter:function(t){this.option.center=t},defaultOption:{zlevel:0,z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:.75,showLegendSymbol:!0,dataRangeHoverLink:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}}}}),Vv);var Ay="\0_ec_interaction_mutex";function Dy(t,e){return!!Cy(t)[e]}function Cy(t){return t[Ay]||(t[Ay]={})}function Ly(i){this.pointerChecker,this._zr=i,this._opt={};var t=A,n=t(ky,this),o=t(Py,this),a=t(Ny,this),r=t(Oy,this),s=t(Ey,this);Ct.call(this),this.setPointerChecker=function(t){this.pointerChecker=t},this.enable=function(t,e){this.disable(),this._opt=C(D(e)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),null==t&&(t=!0),!0!==t&&"move"!==t&&"pan"!==t||(i.on("mousedown",n),i.on("mousemove",o),i.on("mouseup",a)),!0!==t&&"scale"!==t&&"zoom"!==t||(i.on("mousewheel",r),i.on("pinch",s))},this.disable=function(){i.off("mousedown",n),i.off("mousemove",o),i.off("mouseup",a),i.off("mousewheel",r),i.off("pinch",s)},this.dispose=this.disable,this.isDragging=function(){return this._dragging},this.isPinching=function(){return this._pinching}}function ky(t){if(!(Ht(t)||t.target&&t.target.draggable)){var e=t.offsetX,i=t.offsetY;this.pointerChecker&&this.pointerChecker(t,e,i)&&(this._x=e,this._y=i,this._dragging=!0)}}function Py(t){if(this._dragging&&By("moveOnMouseMove",t,this._opt)&&"pinch"!==t.gestureEvent&&!Dy(this._zr,"globalPan")){var e=t.offsetX,i=t.offsetY,n=this._x,o=this._y,a=e-n,r=i-o;this._x=e,this._y=i,this._opt.preventDefaultMouseMove&&Wt(t.event),Ry(this,"pan","moveOnMouseMove",t,{dx:a,dy:r,oldX:n,oldY:o,newX:e,newY:i})}}function Ny(t){Ht(t)||(this._dragging=!1)}function Oy(t){var e=By("zoomOnMouseWheel",t,this._opt),i=By("moveOnMouseWheel",t,this._opt),n=t.wheelDelta,o=Math.abs(n),a=t.offsetX,r=t.offsetY;if(0!==n&&(e||i)){if(e){var s=3x.x)||(m-=Math.PI);var b=v?"left":"right",S=a.labelModel.get("rotate"),M=S*(Math.PI/180);g.setStyle({textPosition:a.labelModel.get("position")||b,textRotation:null==S?-m:M,textOrigin:"center",verticalAlign:"middle"})}if(s.parentNode&&s.parentNode!==u){var I=i.__edge;sl(I=I||(i.__edge=new ls({shape:Px(a,f,f),style:C({opacity:0,strokeNoScale:!0},a.lineStyle)})),{shape:Px(a,d,p),style:{opacity:1}},o),n.add(I)}}function kx(t,e,i,n,o,a){for(var r,s=t.tree.getNodeByDataIndex(e),l=t.tree.root,u=s.getModel(),h=(a=Cx(s,u,a),s.parentNode===l?s:s.parentNode||s);null==(r=h.getLayout());)h=h.parentNode===l?h:h.parentNode||h;sl(i,{position:[r.x+1,r.y+1]},o,function(){n.remove(i),t.setItemGraphicEl(e,null)}),i.fadeOut(null,{keepLabel:!0});var c=i.__edge;c&&sl(c,{shape:Px(a,r,r),style:{opacity:0}},o,function(){n.remove(c)})}function Px(t,e,i){var n,o,a,r,s,l,u,h,c=t.orient;if("radial"!==t.layout)return s=e.x,u=e.y,l=i.x,h=i.y,"LR"!==c&&"RL"!==c||(n=s+(l-s)*t.curvature,o=u,a=l+(s-l)*t.curvature,r=h),"TB"!==c&&"BT"!==c||(n=s,o=u+(h-u)*t.curvature,a=l,r=h+(u-h)*t.curvature),{x1:s,y1:u,x2:l,y2:h,cpx1:n,cpy1:o,cpx2:a,cpy2:r};s=e.rawX,u=e.rawY,l=i.rawX,h=i.rawY;var d=Sx(s,u),f=Sx(s,u+(h-u)*t.curvature),p=Sx(l,h+(u-h)*t.curvature),g=Sx(l,h);return{x1:d.x,y1:d.y,x2:g.x,y2:g.y,cpx1:f.x,cpy1:f.y,cpx2:p.x,cpy2:p.y}}function Nx(t,e){for(var i,n=[t];i=n.pop();)if(e(i),i.isExpand){var o=i.children;if(o.length)for(var a=o.length-1;0<=a;a--)n.push(o[a])}}mx.prototype={constructor:mx,isRemoved:function(){return this.dataIndex<0},eachNode:function(t,e,i){"function"==typeof t&&(i=e,e=t,t=null),z(t=t||{})&&(t={order:t});var n,o=t.order||"preorder",a=this[t.attr||"children"];"preorder"===o&&(n=e.call(i,this));for(var r=0;!n&&re&&(e=n.height)}this.height=e+1},getNodeById:function(t){if(this.getId()===t)return this;for(var e=0,i=this.children,n=i.length;ea&&(a=t.depth)});var r=t.expandAndCollapse&&0<=t.initialTreeDepth?t.initialTreeDepth:a;return o.root.eachNode("preorder",function(t){var e=t.hostTree.data.getRawDataItem(t.dataIndex);t.isExpand=e&&null!=e.collapsed?!e.collapsed:t.depth<=r}),o.data},getOrient:function(){var t=this.get("orient");return"horizontal"===t?t="LR":"vertical"===t&&(t="TB"),t},setZoom:function(t){this.option.zoom=t},setCenter:function(t){this.option.center=t},formatTooltip:function(t){for(var e=this.getData().tree,i=e.root.children[0],n=e.getNodeByDataIndex(t),o=n.getValue(),a=n.name;n&&n!==i;)a=n.parentNode.name+"."+a,n=n.parentNode;return eu(a+(isNaN(o)||null==o?"":" : "+o))},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderColor:"#c23531",borderWidth:1.5},label:{show:!0,color:"#555"},leaves:{label:{show:!0}},animationEasing:"linear",animationDuration:700,animationDurationUpdate:1e3}}),Mf({type:"tree",init:function(t,e){this._oldTree,this._mainGroup=new Ii,this._controller=new Ly(e.getZr()),this._controllerHost={target:this.group},this.group.add(this._mainGroup)},render:function(n,t,i,e){var o=n.getData(),a=n.layoutInfo,r=this._mainGroup,s=n.get("layout");"radial"===s?r.attr("position",[a.x+a.width/2,a.y+a.height/2]):r.attr("position",[a.x,a.y]),this._updateViewCoordSys(n,a,s),this._updateController(n,t,i);var l=this._data,u={expandAndCollapse:n.get("expandAndCollapse"),layout:s,orient:n.getOrient(),curvature:n.get("lineStyle.curveness"),symbolRotate:n.get("symbolRotate"),symbolOffset:n.get("symbolOffset"),hoverAnimation:n.get("hoverAnimation"),useNameLabel:!0,fadeIn:!0};o.diff(l).add(function(t){Dx(o,t)&&Lx(o,t,null,r,n,u)}).update(function(t,e){var i=l.getItemGraphicEl(e);Dx(o,t)?Lx(o,t,i,r,n,u):i&&kx(l,e,i,r,n,u)}).remove(function(t){var e=l.getItemGraphicEl(t);e&&kx(l,t,e,r,n,u)}).execute(),this._nodeScaleRatio=n.get("nodeScaleRatio"),this._updateNodeAndLinkScale(n),!0===u.expandAndCollapse&&o.eachItemGraphicEl(function(t,e){t.off("click").on("click",function(){i.dispatchAction({type:"treeExpandAndCollapse",seriesId:n.id,dataIndex:e})})}),this._data=o},_updateViewCoordSys:function(t){var i=t.getData(),n=[];i.each(function(t){var e=i.getItemLayout(t);!e||isNaN(e.x)||isNaN(e.y)||n.push([+e.x,+e.y])});var e=[],o=[];Ba(n,e,o);var a=this._min,r=this._max;o[0]-e[0]==0&&(e[0]=a?a[0]:e[0]-1,o[0]=r?r[0]:o[0]+1),o[1]-e[1]==0&&(e[1]=a?a[1]:e[1]-1,o[1]=r?r[1]:o[1]+1);var s=t.coordinateSystem=new Qy;s.zoomLimit=t.get("scaleLimit"),s.setBoundingRect(e[0],e[1],o[0]-e[0],o[1]-e[1]),s.setCenter(t.get("center")),s.setZoom(t.get("zoom")),this.group.attr({position:s.position,scale:s.scale}),this._viewCoordSys=s,this._min=e,this._max=o},_updateController:function(o,t,a){var e=this._controller,i=this._controllerHost,r=this.group;e.setPointerChecker(function(t,e,i){var n=r.getBoundingRect();return n.applyTransform(r.transform),n.contain(e,i)&&!Wy(t,a,o)}),e.enable(o.get("roam")),i.zoomLimit=o.get("scaleLimit"),i.zoom=o.coordinateSystem.getZoom(),e.off("pan").off("zoom").on("pan",function(t){Vy(i,t.dx,t.dy),a.dispatchAction({seriesId:o.id,type:"treeRoam",dx:t.dx,dy:t.dy})},this).on("zoom",function(t){Gy(i,t.scale,t.originX,t.originY),a.dispatchAction({seriesId:o.id,type:"treeRoam",zoom:t.scale,originX:t.originX,originY:t.originY}),this._updateNodeAndLinkScale(o)},this)},_updateNodeAndLinkScale:function(t){var e=t.getData(),i=this._getNodeGlobalScale(t),n=[i,i];e.eachItemGraphicEl(function(t,e){t.attr("scale",n)})},_getNodeGlobalScale:function(t){var e=t.coordinateSystem;if("view"!==e.type)return 1;var i=this._nodeScaleRatio,n=e.scale,o=n&&n[0]||1;return((e.getZoom()-1)*i+1)/o},dispose:function(){this._controller&&this._controller.dispose(),this._controllerHost={}},remove:function(){this._mainGroup.removeAll(),this._data=null}}),gf({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(n,t){t.eachComponent({mainType:"series",subType:"tree",query:n},function(t){var e=n.dataIndex,i=t.getData().tree.getNodeByDataIndex(e);i.isExpand=!i.isExpand})}),gf({type:"treeRoam",event:"treeRoam",update:"none"},function(i,t){t.eachComponent({mainType:"series",subType:"tree",query:i},function(t){var e=Ky(t.coordinateSystem,i);t.setCenter&&t.setCenter(e.center),t.setZoom&&t.setZoom(e.zoom)})});function Ox(t,e,i){if(t&&0<=_(e,t.type)){var n=i.getData().tree.root,o=t.targetNode;if("string"==typeof o&&(o=n.getNodeById(o)),o&&n.contains(o))return{node:o};var a=t.targetNodeId;if(null!=a&&(o=n.getNodeById(a)))return{node:o}}}function Ex(t){for(var e=[];t;)(t=t.parentNode)&&e.push(t);return e.reverse()}function zx(t,e){return 0<=_(Ex(t),e)}function Rx(t,e){for(var i=[];t;){var n=t.dataIndex;i.push({name:t.name,dataIndex:n,value:e.getRawValue(n)}),t=t.parentNode}return i.reverse(),i}yf(Mm("tree","circle")),vf(function(t,e){t.eachSeriesByType("tree",function(t){!function(t,e){var i=function(t,e){return vu(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}(t,e);t.layoutInfo=i;var n=t.get("layout"),o=0,a=0,r=null;r="radial"===n?(o=2*Math.PI,a=Math.min(i.height,i.width)/2,bx(function(t,e){return(t.parentNode===e.parentNode?1:2)/t.depth})):(o=i.width,a=i.height,bx());var s=t.getData().tree.root,l=s.children[0];if(l){!function(t){t.hierNode={defaultAncestor:null,ancestor:t,prelim:0,modifier:0,change:0,shift:0,i:0,thread:null};for(var e,i,n=[t];e=n.pop();)if(i=e.children,e.isExpand&&i.length)for(var o=i.length-1;0<=o;o--){var a=i[o];a.hierNode={defaultAncestor:null,ancestor:a,prelim:0,modifier:0,change:0,shift:0,i:o,thread:null},n.push(a)}}(s),function(t,e,i){for(var n,o=[t],a=[];n=o.pop();)if(a.push(n),n.isExpand){var r=n.children;if(r.length)for(var s=0;sh.getLayout().x&&(h=t),t.depth>c.depth&&(c=t)});var d=u===h?1:r(u,h)/2,f=d-u.getLayout().x,p=0,g=0,m=0,v=0;if("radial"===n)p=o/(h.getLayout().x+d+f),g=a/(c.depth-1||1),Nx(l,function(t){m=(t.getLayout().x+f)*p,v=(t.depth-1)*g;var e=Sx(m,v);t.setLayout({x:e.x,y:e.y,rawX:m,rawY:v},!0)});else{var y=t.getOrient();"RL"===y||"LR"===y?(g=a/(h.getLayout().x+d+f),p=o/(c.depth-1||1),Nx(l,function(t){v=(t.getLayout().x+f)*g,m="LR"===y?(t.depth-1)*p:o-(t.depth-1)*p,t.setLayout({x:m,y:v},!0)})):"TB"!==y&&"BT"!==y||(p=o/(h.getLayout().x+d+f),g=a/(c.depth-1||1),Nx(l,function(t){m=(t.getLayout().x+f)*p,v="TB"===y?(t.depth-1)*g:a-(t.depth-1)*g,t.setLayout({x:m,y:v},!0)}))}}}(t,e)})}),ic.extend({type:"series.treemap",layoutMode:"box",dependencies:["grid","polar"],preventUsingHoverLayer:!0,_viewRoot:null,defaultOption:{progressive:0,left:"center",top:"middle",right:null,bottom:null,width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.1024,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",borderColor:"rgba(255,255,255,0.7)",borderWidth:1,shadowColor:"rgba(150,150,150,1)",shadowBlur:3,shadowOffsetX:0,shadowOffsetY:0,textStyle:{color:"#fff"}},emphasis:{textStyle:{}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",ellipsis:!0},upperLabel:{show:!1,position:[0,"50%"],height:20,color:"#fff",ellipsis:!0,verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],color:"#fff",ellipsis:!0,verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},getInitialData:function(t,e){var i={name:t.name,children:t.data};!function i(t){var n=0;E(t.children,function(t){i(t);var e=t.value;k(e)&&(e=e[0]),n+=e});var e=t.value;k(e)&&(e=e[0]);null!=e&&!isNaN(e)||(e=n);e<0&&(e=0);k(t.value)?t.value[0]=e:t.value=e}(i);var n=t.levels||[];n=t.levels=function(t,e){var n,i=e.get("color");if(!i)return;if(E(t=t||[],function(t){var e=new Il(t),i=e.get("color");(e.get("itemStyle.color")||i&&"none"!==i)&&(n=!0)}),!n){(t[0]||(t[0]={})).color=i.slice()}return t}(n,e);var o={};return o.levels=n,vx.createTree(i,this,o).data},optionUpdated:function(){this.resetViewRoot()},formatTooltip:function(t){var e=this.getData(),i=this.getRawValue(t),n=k(i)?Kl(i[0]):Kl(i);return eu(e.getName(t)+": "+n)},getDataParams:function(t){var e=ic.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return e.treePathInfo=Rx(i,this),e},setLayoutInfo:function(t){this.layoutInfo=this.layoutInfo||{},L(this.layoutInfo,t)},mapIdToIndex:function(t){var e=this._idIndexMap;e||(e=this._idIndexMap=Q(),this._idIndexMapCount=0);var i=e.get(t);return null==i&&e.set(t,i=this._idIndexMapCount++),i},getViewRoot:function(){return this._viewRoot},resetViewRoot:function(t){t?this._viewRoot=t:t=this._viewRoot;var e=this.getRawData().tree.root;t&&(t===e||e.contains(t))||(this._viewRoot=e)}});var Bx=5;function Vx(t){this.group=new Ii,t.add(this.group)}function Gx(t,e,i,n,o,a){var r=[[o?t:t-Bx,e],[t+i,e],[t+i,e+n],[o?t:t-Bx,e+n]];return a||r.splice(2,0,[t+i+Bx,e+n/2]),o||r.push([t,e+n/2]),r}Vx.prototype={constructor:Vx,render:function(t,e,i,n){var o=t.getModel("breadcrumb"),a=this.group;if(a.removeAll(),o.get("show")&&i){var r=o.getModel("itemStyle"),s=r.getModel("textStyle"),l={pos:{left:o.get("left"),right:o.get("right"),top:o.get("top"),bottom:o.get("bottom")},box:{width:e.getWidth(),height:e.getHeight()},emptyItemWidth:o.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(i,l,s),this._renderContent(t,l,r,s,n),yu(a,l.pos,l.box)}},_prepare:function(t,e,i){for(var n=t;n;n=n.parentNode){var o=n.getModel().get("name"),a=i.getTextRect(o),r=Math.max(a.width+16,e.emptyItemWidth);e.totalWidth+=r+8,e.renderList.push({node:n,text:o,width:r})}},_renderContent:function(t,e,i,n,o){for(var a,r,s=0,l=e.emptyItemWidth,u=t.get("breadcrumb.height"),h=function(t,e,i){var n=e.width,o=e.height,a=Pl(t.x,n),r=Pl(t.y,o),s=Pl(t.x2,n),l=Pl(t.y2,o);return(isNaN(a)||isNaN(parseFloat(t.x)))&&(a=0),(isNaN(s)||isNaN(parseFloat(t.x2)))&&(s=n),(isNaN(r)||isNaN(parseFloat(t.y)))&&(r=0),(isNaN(l)||isNaN(parseFloat(t.y2)))&&(l=o),i=Jl(i||0),{width:Math.max(s-a-i[1]-i[3],0),height:Math.max(l-r-i[0]-i[2],0)}}(e.pos,e.box),c=e.totalWidth,d=e.renderList,f=d.length-1;0<=f;f--){var p=d[f],g=p.node,m=p.width,v=p.text;c>h.width&&(c-=m-l,m=l,v=null);var y=new qr({shape:{points:Gx(s,0,m,u,f===d.length-1,0===f)},style:C(i.getItemStyle(),{lineJoin:"bevel",text:v,textFill:n.getTextColor(),textFont:n.getFont()}),z:10,onclick:T(o,g)});this.group.add(y),a=t,r=g,y.eventData={componentType:"series",componentSubType:"treemap",componentIndex:a.componentIndex,seriesIndex:a.componentIndex,seriesName:a.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:r&&r.dataIndex,name:r&&r.name},treePathInfo:r&&Rx(r,a)},s+=m+8}},remove:function(){this.group.removeAll()}};function Fx(t){var e=$x(t);return e.stroke=e.fill=e.lineWidth=null,e}var Wx=A,Hx=Ii,Zx=is,Ux=E,Xx=["label"],Yx=["emphasis","label"],jx=["upperLabel"],qx=["emphasis","upperLabel"],Kx=10,$x=ra([["fill","color"],["stroke","strokeColor"],["lineWidth","strokeWidth"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]);function Jx(d,r,s,l,u,i,f,t,e,n){if(f){var p=f.getLayout();if(p&&p.isInView){var h=p.width,c=p.height,g=p.borderWidth,m=p.invisible,v=f.getRawIndex(),y=t&&t.getRawIndex(),o=f.viewChildren,x=p.upperHeight,a=o&&o.length,_=f.getModel("itemStyle"),w=f.getModel("emphasis.itemStyle"),b=A("nodeGroup",Hx);if(b){if(e.add(b),b.attr("position",[p.x||0,p.y||0]),b.__tmNodeWidth=h,b.__tmNodeHeight=c,p.isAboveViewRoot)return b;var S=A("background",Zx,n,1);if(S&&function(t,n,o){n.dataIndex=f.dataIndex,n.seriesIndex=d.seriesIndex,n.setShape({x:0,y:0,width:h,height:c});var a=f.getVisual("borderColor",!0),r=w.get("borderColor");I(n,function(){var t=Fx(_);t.fill=a;var e=$x(w);if(e.fill=r,o){var i=h-2*g;T(t,e,a,i,x,{x:g,y:0,width:i,height:x})}else t.text=e.text=null;n.setStyle(t),Ys(n,e)}),t.add(n)}(b,S,a&&p.upperHeight),!a){var M=A("content",Zx,n,2);M&&function(t,i){i.dataIndex=f.dataIndex,i.seriesIndex=d.seriesIndex;var n=Math.max(h-2*g,0),o=Math.max(c-2*g,0);i.culling=!0,i.setShape({x:g,y:g,width:n,height:o});var a=f.getVisual("color",!0);I(i,function(){var t=Fx(_);t.fill=a;var e=$x(w);T(t,e,a,n,o),i.setStyle(t),Ys(i,e)}),t.add(i)}(b,M)}return b}}}function I(t,e){m?t.invisible||i.push(t):(e(),t.__tmWillVisible||(t.invisible=!1))}function T(t,e,i,n,o,a){var r=f.getModel(),s=W(d.getFormattedLabel(f.dataIndex,"normal",null,null,a?"upperLabel":"label"),r.get("name"));if(!a&&p.isLeafRoot){var l=d.get("drillDownIcon",!0);s=l?l+" "+s:s}var u=r.getModel(a?jx:Xx),h=r.getModel(a?qx:Yx),c=u.getShallow("show");$s(t,e,u,h,{defaultText:c?s:null,autoColor:i,isRectText:!0}),a&&(t.textRect=D(a)),t.truncate=c&&u.get("ellipsis")?{outerWidth:n,outerHeight:o,minChar:2}:null}function A(t,e,i,n){var o=null!=y&&s[t][y],a=u[t];return o?(s[t][y]=null,function(t,e,i){(t[v]={}).old="nodeGroup"===i?e.position.slice():L({},e.shape)}(a,o,t)):m||((o=new e({z:function(t,e){var i=t*Kx+e;return(i-1)/i}(i,n)})).__tmDepth=i,function(t,e,i){var n=t[v]={},o=f.parentNode;if(o&&(!l||"drillDown"===l.direction)){var a=0,r=0,s=u.background[o.getRawIndex()];!l&&s&&s.old&&(a=s.old.width,r=s.old.height),n.old="nodeGroup"===i?[0,r]:{x:a,y:r,width:0,height:0}}n.fadein="nodeGroup"!==i}(a,0,o.__tmStorageName=t)),r[t][v]=o}}Mf({type:"treemap",init:function(t,e){this._containerGroup,this._storage={nodeGroup:[],background:[],content:[]},this._oldTree,this._breadcrumb,this._controller,this._state="ready"},render:function(t,e,i,n){if(!(_(e.findComponents({mainType:"series",subType:"treemap",query:n}),t)<0)){this.seriesModel=t,this.api=i,this.ecModel=e;var o=Ox(n,["treemapZoomToNode","treemapRootToNode"],t),a=n&&n.type,r=t.layoutInfo,s=!this._oldTree,l=this._storage,u="treemapRootToNode"===a&&o&&l?{rootNodeGroup:l.nodeGroup[o.node.getRawIndex()],direction:n.direction}:null,h=this._giveContainerGroup(r),c=this._doRender(h,t,u);s||a&&"treemapZoomToNode"!==a&&"treemapRootToNode"!==a?c.renderFinally():this._doAnimation(h,c,t,u),this._resetController(i),this._renderBreadcrumb(t,i,o)}},_giveContainerGroup:function(t){var e=this._containerGroup;return e||(e=this._containerGroup=new Hx,this._initEvents(e),this.group.add(e)),e.attr("position",[t.x,t.y]),e},_doRender:function(t,e,i){var n=e.getData().tree,o=this._oldTree,a={nodeGroup:[],background:[],content:[]},r={nodeGroup:[],background:[],content:[]},s=this._storage,l=[],c=T(Jx,e,r,s,i,a,l);!function a(r,s,l,u,h){u?Ux(s=r,function(t,e){t.isRemoved()||i(e,e)}):new Tf(s,r,t,t).add(i).update(i).remove(T(i,null)).execute();function t(t){return t.getId()}function i(t,e){var i=null!=t?r[t]:null,n=null!=e?s[e]:null,o=c(i,n,l,h);o&&a(i&&i.viewChildren||[],n&&n.viewChildren||[],o,u,h+1)}}(n.root?[n.root]:[],o&&o.root?[o.root]:[],t,n===o||!o,0);var u,h,d=(h={nodeGroup:[],background:[],content:[]},(u=s)&&Ux(u,function(t,e){var i=h[e];Ux(t,function(t){t&&(i.push(t),t.__tmWillDelete=1)})}),h);return this._oldTree=n,this._storage=r,{lastsForAnimation:a,willDeleteEls:d,renderFinally:function(){Ux(d,function(t){Ux(t,function(t){t.parent&&t.parent.remove(t)})}),Ux(l,function(t){t.invisible=!0,t.dirty()})}}},_doAnimation:function(t,a,e,s){if(e.get("animation")){var l=e.get("animationDurationUpdate"),u=e.get("animationEasing"),h=function(){var a,r=[],s={};return{add:function(t,e,i,n,o){return z(n)&&(o=n,n=0),!s[t.id]&&(s[t.id]=1,r.push({el:t,target:e,time:i,delay:n,easing:o}),!0)},done:function(t){return a=t,this},start:function(){for(var t=r.length,e=0,i=r.length;e=r.length||t===r[t.depth]){var i=T_(l,c,t,e,y,s);n(t,i,o,a,r,s)}})}else p=b_(c),t.setVisual("color",p)}(a,{},N(o.levelModels,function(t){return t?t.get(x_):null}),r,t.getViewRoot().getAncestors(),t)}};function w_(i,n,o,a){var r=L({},n);return E(["color","colorAlpha","colorSaturation"],function(t){var e=i.get(t,!0);null==e&&o&&(e=o[t]),null==e&&(e=n[t]),null==e&&(e=a.get(t)),null!=e&&(r[t]=e)}),r}function b_(t){var e=S_(t,"color");if(e){var i=S_(t,"colorAlpha"),n=S_(t,"colorSaturation");return n&&(e=Ue(e,null,null,n)),i&&(e=Xe(e,i)),e}}function S_(t,e){var i=t[e];if(null!=i&&"none"!==i)return i}function M_(t,e,i,n,o,a){if(a&&a.length){var r=I_(e,"color")||null!=o.color&&"none"!==o.color&&(I_(e,"colorAlpha")||I_(e,"colorSaturation"));if(r){var s=e.get("visualMin"),l=e.get("visualMax"),u=i.dataExtent.slice();null!=s&&su[1]&&(u[1]=l);var h=e.get("colorMappingBy"),c={type:r.name,dataExtent:u,visual:r.range};"color"!==c.type||"index"!==h&&"id"!==h?c.mappingMethod="linear":(c.mappingMethod="category",c.loop=!0);var d=new a_(c);return d.__drColorMappingBy=h,d}}}function I_(t,e){var i=t.get(e);return y_(i)&&i.length?{name:e,range:i}:null}function T_(t,e,i,n,o,a){var r=L({},e);if(o){var s=o.type,l="color"===s&&o.__drColorMappingBy,u="index"===l?n:"id"===l?a.mapIdToIndex(i.getId()):i.getValue(t.get("visualDimension"));r[s]=o.mapValueToVisual(u)}return r}var A_=Math.max,D_=Math.min,C_=W,L_=E,k_=["itemStyle","borderWidth"],P_=["itemStyle","gapWidth"],N_=["upperLabel","show"],O_=["upperLabel","height"],E_={seriesType:"treemap",reset:function(t,e,i,n){var o=i.getWidth(),a=i.getHeight(),r=t.option,s=vu(t.getBoxLayoutParams(),{width:i.getWidth(),height:i.getHeight()}),l=r.size||[],u=Pl(C_(s.width,l[0]),o),h=Pl(C_(s.height,l[1]),a),c=n&&n.type,d=Ox(n,["treemapZoomToNode","treemapRootToNode"],t),f="treemapRender"===c||"treemapMove"===c?n.rootRect:null,p=t.getViewRoot(),g=Ex(p);if("treemapMove"!==c){var m="treemapZoomToNode"===c?function(t,e,i,n,o){var a,r=(e||{}).node,s=[n,o];if(!r||r===i)return s;var l=n*o,u=l*t.option.zoomToNodeRatio;for(;a=r.parentNode;){for(var h=0,c=a.children,d=0,f=c.length;ds[1]&&(s[1]=e)})}else s=[NaN,NaN];return{sum:n,dataExtent:s}}(e,r,s);if(0===u.sum)return t.viewChildren=[];if(u.sum=function(t,e,i,n,o){if(!n)return i;for(var a=t.get("visibleMin"),r=o.length,s=r,l=r-1;0<=l;l--){var u=o["asc"===n?r-l-1:l].getValue();u/i*ei[l[r]])&&(h=i[l[r]]);for(var c=0,d=t.length;c "+d)),u++)}var f,p=i.get("coordinateSystem");if("cartesian2d"===p||"polar"===p)f=hp(t,i);else{var g=nh.get(p),m=g&&"view"!==g.type&&g.dimensions||[];_(m,"value")<0&&m.concat(["value"]);var v=np(t,{coordDimensions:m});(f=new Wf(v,i)).initData(t)}var y=new Wf(["value"],i);return y.initData(l,s),o&&o(f,y),ux({mainData:f,struct:a,structAttr:"graph",datas:{node:f,edge:y},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}var Y_=Sf({type:"series.graph",init:function(t){Y_.superApply(this,"init",arguments);var e=this;function i(){return e._categoriesData}this.legendVisualProvider=new Gv(i,i),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},mergeOption:function(t){Y_.superApply(this,"mergeOption",arguments),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},mergeDefaultAndTheme:function(t){Y_.superApply(this,"mergeDefaultAndTheme",arguments),zo(t,["edgeLabel"],["show"])},getInitialData:function(t,s){var e=t.edges||t.links||[],i=t.data||t.nodes||[],l=this;if(i&&e)return X_(i,e,this,!0,function(t,e){t.wrapMethod("getItemModel",function(t){var e=l._categoriesModels[t.getShallow("category")];return e&&(e.parentModel=t.parentModel,t.parentModel=e),t});var i=l.getModel("edgeLabel"),n=new Il({label:i.option},i.parentModel,s),o=l.getModel("emphasis.edgeLabel"),a=new Il({emphasis:{label:o.option}},o.parentModel,s);function r(t){return(t=this.parsePath(t))&&"label"===t[0]?n:t&&"emphasis"===t[0]&&"label"===t[1]?a:this.parentModel}e.wrapMethod("getItemModel",function(t){return t.customizeGetParent(r),t})}).data},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},getCategoriesData:function(){return this._categoriesData},formatTooltip:function(t,e,i){if("edge"!==i)return Y_.superApply(this,"formatTooltip",arguments);var n=this.getData(),o=this.getDataParams(t,i),a=n.graph.getEdgeByIndex(t),r=n.getName(a.node1.dataIndex),s=n.getName(a.node2.dataIndex),l=[];return null!=r&&l.push(r),null!=s&&l.push(s),l=eu(l.join(" > ")),o.value&&(l+=" : "+eu(o.value)),l},_updateCategoriesData:function(){var t=N(this.option.categories||[],function(t){return null!=t.value?t:L({value:0},t)}),e=new Wf(["value"],this);e.initData(t),this._categoriesData=e,this._categoriesModels=e.mapArray(function(t){return e.getItemModel(t,!0)})},setZoom:function(t){this.option.zoom=t},setCenter:function(t){this.option.center=t},isAnimationEnabled:function(){return Y_.superCall(this,"isAnimationEnabled")&&!("force"===this.get("layout")&&this.get("force.layoutAnimation"))},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",legendHoverLink:!0,hoverAnimation:!0,layout:null,focusNodeAdjacency:!1,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle"},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,curveness:0,opacity:.5},emphasis:{label:{show:!0}}}}),j_=os.prototype,q_=ls.prototype;function K_(t){return isNaN(+t.cpx1)||isNaN(+t.cpy1)}var $_=Is({type:"ec-line",style:{stroke:"#000",fill:null},shape:{x1:0,y1:0,x2:0,y2:0,percent:1,cpx1:null,cpy1:null},buildPath:function(t,e){this[K_(e)?"_buildPathLine":"_buildPathCurve"](t,e)},_buildPathLine:j_.buildPath,_buildPathCurve:q_.buildPath,pointAt:function(t){return this[K_(this.shape)?"_pointAtLine":"_pointAtCurve"](t)},_pointAtLine:j_.pointAt,_pointAtCurve:q_.pointAt,tangentAt:function(t){var e=this.shape,i=K_(e)?[e.x2-e.x1,e.y2-e.y1]:this._tangentAtCurve(t);return mt(i,i)},_tangentAtCurve:q_.tangentAt}),J_=["fromSymbol","toSymbol"];function Q_(t){return"_"+t+"Type"}function tw(t,e,i){var n=e.getItemVisual(i,"color"),o=e.getItemVisual(i,t),a=e.getItemVisual(i,t+"Size");if(o&&"none"!==o){k(a)||(a=[a,a]);var r=mg(o,-a[0]/2,-a[1]/2,a[0],a[1],n);return r.name=t,r}}function ew(t,e){t.x1=e[0][0],t.y1=e[0][1],t.x2=e[1][0],t.y2=e[1][1],t.percent=1;var i=e[2];i?(t.cpx1=i[0],t.cpy1=i[1]):(t.cpx1=NaN,t.cpy1=NaN)}function iw(t,e,i){Ii.call(this),this._createLine(t,e,i)}var nw=iw.prototype;function ow(t){this._ctor=t||iw,this.group=new Ii}nw.beforeUpdate=function(){var t=this.childOfName("fromSymbol"),e=this.childOfName("toSymbol"),i=this.childOfName("label");if(t||e||!i.ignore){for(var n=1,o=this.parent;o;)o.scale&&(n/=o.scale[0]),o=o.parent;var a=this.childOfName("line");if(this.__dirty||a.__dirty){var r=a.shape.percent,s=a.pointAt(0),l=a.pointAt(r),u=ht([],l,s);if(mt(u,u),t){t.attr("position",s);var h=a.tangentAt(0);t.attr("rotation",Math.PI/2-Math.atan2(h[1],h[0])),t.attr("scale",[n*r,n*r])}if(e){e.attr("position",l);h=a.tangentAt(1);e.attr("rotation",-Math.PI/2-Math.atan2(h[1],h[0])),e.attr("scale",[n*r,n*r])}if(!i.ignore){var c,d,f;i.attr("position",l);var p=5*n;if("end"===i.__position)c=[u[0]*p+l[0],u[1]*p+l[1]],d=.8=t&&(0===e?0:n[e-1][0])a&&(e[1-n]=e[n]+c.sign*a),e}function Hw(t,e){var i=t[e]-t[1-e];return{span:Math.abs(i),sign:0o*(1-h[0])?(l="jump",r=s-o*(1-h[2])):0<=(r=s-o*h[1])&&(r=s-o*(1-h[1]))<=0&&(r=0),(r*=e.axisExpandWidth/u)?Ww(r,n,a,"all"):l="none";else{o=n[1]-n[0];(n=[Yw(0,a[1]*s/o-o/2)])[1]=Xw(a[1],n[0]+o),n[0]=n[1]-o}return{axisExpandWindow:n,behavior:l}}},nh.register("parallel",{create:function(n,o){var a=[];return n.eachComponent("parallel",function(t,e){var i=new Jw(t,n,o);i.name="parallel_"+e,i.resize(t,o),(t.coordinateSystem=i).model=t,a.push(i)}),n.eachSeries(function(t){if("parallel"===t.get("coordinateSystem")){var e=n.queryComponents({mainType:"parallel",index:t.get("parallelIndex"),id:t.get("parallelId")})[0];t.coordinateSystem=e.coordinateSystem}}),a}});var tb=Tu.extend({type:"baseParallelAxis",axis:null,activeIntervals:[],getAreaSelectStyle:function(){return ra([["fill","color"],["lineWidth","borderWidth"],["stroke","borderColor"],["width","width"],["opacity","opacity"]])(this.getModel("areaSelectStyle"))},setActiveIntervals:function(t){var e=this.activeIntervals=D(t);if(e)for(var i=e.length-1;0<=i;i--)Ol(e[i])},getActiveState:function(t){var e=this.activeIntervals;if(!e.length)return"normal";if(null==t||isNaN(t))return"inactive";if(1===e.length){var i=e[0];if(i[0]<=t&&t<=i[1])return"active"}else for(var n=0,o=e.length;nn.getWidth()||i<0||i>n.getHeight()}(t,e)){var n=t._zr,o=t._covers,a=bb(t,e,i);if(!t._dragging)for(var r=0;rf&&(f=m.depth),g.setLayout({depth:v?m.depth:c},!0),"vertical"===a?g.setLayout({dy:i},!0):g.setLayout({dx:i},!0);for(var y=0;y "))},preventIncremental:function(){return!!this.get("effect.show")},getProgressive:function(){var t=this.option.progressive;return null==t?this.option.large?1e4:this.get("progressive"):t},getProgressiveThreshold:function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?2e4:this.get("progressiveThreshold"):t},defaultOption:{coordinateSystem:"geo",zlevel:0,z:2,legendHoverLink:!0,hoverAnimation:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}}});function QS(t,e,i){Ii.call(this),this.add(this.createLine(t,e,i)),this._updateEffectSymbol(t,e)}var tM=QS.prototype;function eM(t,e,i){Ii.call(this),this._createPolyline(t,e,i)}tM.createLine=function(t,e,i){return new iw(t,e,i)},tM._updateEffectSymbol=function(t,e){var i=t.getItemModel(e).getModel("effect"),n=i.get("symbolSize"),o=i.get("symbol");k(n)||(n=[n,n]);var a=i.get("color")||t.getItemVisual(e,"color"),r=this.childAt(1);this._symbolType!==o&&(this.remove(r),(r=mg(o,-.5,-.5,1,1,a)).z2=100,r.culling=!0,this.add(r)),r&&(r.setStyle("shadowColor",a),r.setStyle(i.getItemStyle(["color"])),r.attr("scale",n),r.setColor(a),r.attr("scale",n),this._symbolType=o,this._updateEffectAnimation(t,i,e))},tM._updateEffectAnimation=function(e,t,i){var n=this.childAt(1);if(n){var o=this,a=e.getItemLayout(i),r=1e3*t.get("period"),s=t.get("loop"),l=t.get("constantSpeed"),u=W(t.get("delay"),function(t){return t/e.count()*r/3}),h="function"==typeof u;if(n.ignore=!0,this.updateAnimationPoints(n,a),0e);r++);r=Math.min(r-1,o-2)}wt(t.position,i[r],i[r+1],(e-n[r])/(n[r+1]-n[r]));var s=i[r+1][0]-i[r][0],l=i[r+1][1]-i[r][1];t.rotation=-Math.atan2(l,s)-Math.PI/2,this._lastFrame=r,this._lastFramePercent=e,t.ignore=!1}},w(nM,QS);var aM=Is({shape:{polyline:!1,curveness:0,segs:[]},buildPath:function(t,e){var i=e.segs,n=e.curveness;if(e.polyline)for(var o=0;o=e[0]&&t<=e[1]}}(y,e.option.range):function(e,n,o){var i=e[1]-e[0],a=(n=N(n,function(t){return{interval:[(t.interval[0]-e[0])/i,(t.interval[1]-e[0])/i]}})).length,r=0;return function(t){for(var e=r;e=e.y&&t[1]<=e.y+e.height:i.contain(i.toLocalCoord(t[1]))&&t[0]>=e.y&&t[0]<=e.y+e.height},pointToData:function(t){var e=this.getAxis();return[e.coordToData(e.toLocalCoord(t["horizontal"===e.orient?0:1]))]},dataToPoint:function(t){var e=this.getAxis(),i=this.getRect(),n=[],o="horizontal"===e.orient?0:1;return t instanceof Array&&(t=t[0]),n[o]=e.toGlobalCoord(e.dataToCoord(+t)),n[1-o]=0==o?i.y+i.height/2:i.x+i.width/2,n}}).dimensions});var BM=["axisLine","axisTickLabel","axisName"],VM="splitLine",GM=hv.extend({type:"singleAxis",axisPointerClass:"SingleAxisPointer",render:function(t,e,i,n){var o=this.group;o.removeAll();var a=RM(t),r=new Ym(t,a);E(BM,r.add,r),o.add(r.getGroup()),t.get(VM+".show")&&this["_"+VM](t),GM.superCall(this,"render",t,e,i,n)},_splitLine:function(t){var e=t.axis;if(!e.scale.isBlank()){var i=t.getModel("splitLine"),n=i.getModel("lineStyle"),o=n.get("width"),a=n.get("color");a=a instanceof Array?a:[a];for(var r=t.coordinateSystem.getRect(),s=e.isHorizontal(),l=[],u=0,h=e.getTicksCoords({tickModel:i}),c=[],d=[],f=0;fr)return!0;if(a){var s=sv(t).seriesDataCount,l=n.getExtent();return Math.abs(l[0]-l[1])/s>r}return!1},makeElOption:function(t,e,i,n,o){},createPointerEl:function(t,e,i,n){var o=e.pointer;if(o){var a=oI(t).pointerEl=new yl[o.type](aI(e.pointer));t.add(a)}},createLabelEl:function(t,e,i,n){if(e.label){var o=oI(t).labelEl=new is(aI(e.label));t.add(o),uI(o,n)}},updatePointerEl:function(t,e,i){var n=oI(t).pointerEl;n&&e.pointer&&(n.setStyle(e.pointer.style),i(n,{shape:e.pointer.shape}))},updateLabelEl:function(t,e,i,n){var o=oI(t).labelEl;o&&(o.setStyle(e.label.style),i(o,{shape:e.label.shape,position:e.label.position}),uI(o,n))},_renderHandle:function(t){if(!this._dragging&&this.updateHandleTransform){var e,i=this._axisPointerModel,n=this._api.getZr(),o=this._handle,a=i.getModel("handle"),r=i.get("status");if(!a.get("show")||!r||"hide"===r)return o&&n.remove(o),void(this._handle=null);this._handle||(e=!0,o=this._handle=pl(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(t){Wt(t.event)},onmousedown:rI(this._onHandleDragMove,this,0,0),drift:rI(this._onHandleDragMove,this),ondragend:rI(this._onHandleDragEnd,this)}),n.add(o)),cI(o,i,!1);o.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=a.get("size");k(s)||(s=[s,s]),o.attr("scale",[s[0]/2,s[1]/2]),Tc(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,e)}},_moveHandleToValue:function(t,e){lI(this._axisPointerModel,!e&&this._moveAnimation,this._handle,hI(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},_onHandleDragMove:function(t,e){var i=this._handle;if(i){this._dragging=!0;var n=this.updateHandleTransform(hI(i),[t,e],this._axisModel,this._axisPointerModel);this._payloadInfo=n,i.stopAnimation(),i.attr(hI(n)),oI(i).lastProp=null,this._doDispatchAxisPointer()}},_doDispatchAxisPointer:function(){if(this._handle){var t=this._payloadInfo,e=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:e.axis.dim,axisIndex:e.componentIndex}]})}},_onHandleDragEnd:function(t){if(this._dragging=!1,this._handle){var e=this._axisPointerModel.get("value");this._moveHandleToValue(e),this._api.dispatchAction({type:"hideTip"})}},getHandleTransform:null,updateHandleTransform:null,clear:function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),i=this._group,n=this._handle;e&&i&&(this._lastGraphicKey=null,i&&e.remove(i),n&&e.remove(n),this._group=null,this._handle=null,this._payloadInfo=null)},doClear:function(){},buildLabel:function(t,e,i){return{x:t[i=i||0],y:t[1-i],width:e[i],height:e[1-i]}}}).constructor=sI);var _I=sI.extend({makeElOption:function(t,e,i,n,o){var a=i.axis,r=a.grid,s=n.get("type"),l=wI(r,a).getOtherAxis(a).getGlobalExtent(),u=a.toGlobalCoord(a.dataToCoord(e,!0));if(s&&"none"!==s){var h=dI(n),c=bI[s](a,u,l);c.style=h,t.graphicKey=c.type,t.pointer=c}mI(e,t,pv(r.model,i),i,n,o)},getHandleTransform:function(t,e,i){var n=pv(e.axis.grid.model,e,{labelInside:!1});return n.labelMargin=i.get("handle.margin"),{position:gI(e.axis,t,n),rotation:n.rotation+(n.labelDirection<0?Math.PI:0)}},updateHandleTransform:function(t,e,i,n){var o=i.axis,a=o.grid,r=o.getGlobalExtent(!0),s=wI(a,o).getOtherAxis(o).getGlobalExtent(),l="x"===o.dim?0:1,u=t.position;u[l]+=e[l],u[l]=Math.min(r[1],u[l]),u[l]=Math.max(r[0],u[l]);var h=(s[1]+s[0])/2,c=[h,h];c[l]=u[l];return{position:u,rotation:t.rotation,cursorPoint:c,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][l]}}});function wI(t,e){var i={};return i[e.dim+"AxisIndex"]=e.index,t.getCartesian(i)}var bI={line:function(t,e,i){return{type:"Line",subPixelOptimize:!0,shape:vI([e,i[0]],[e,i[1]],SI(t))}},shadow:function(t,e,i){var n=Math.max(1,t.getBandWidth()),o=i[1]-i[0];return{type:"Rect",shape:yI([e-n/2,i[0]],[n,o],SI(t))}}};function SI(t){return"x"===t.dim?0:1}hv.registerAxisPointerClass("CartesianAxisPointer",_I),ff(function(t){if(t){t.axisPointer&&0!==t.axisPointer.length||(t.axisPointer={});var e=t.axisPointer.link;e&&!k(e)&&(t.axisPointer.link=[e])}}),pf(Id.PROCESSOR.STATISTIC,function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=av(t,e)}),gf({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},function(t,e,i){var n=t.currTrigger,r=[t.x,t.y],o=t,a=t.dispatchAction||A(i.dispatchAction,i),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){KM(r)&&(r=WM({seriesIndex:o.seriesIndex,dataIndex:o.dataIndex},e).point);var l=KM(r),u=o.axesInfo,h=s.axesInfo,c="leave"===n||KM(r),d={},f={},p={list:[],map:{}},g={showPointer:ZM(YM,f),showTooltip:ZM(jM,p)};HM(s.coordSysMap,function(t,e){var a=l||t.containPoint(r);HM(s.coordSysAxesInfo[e],function(t,e){var i=t.axis,n=function(t,e){for(var i=0;i<(t||[]).length;i++){var n=t[i];if(e.axis.dim===n.axisDim&&e.axis.model.componentIndex===n.axisIndex)return n}}(u,t);if(!c&&a&&(!u||n)){var o=n&&n.value;null!=o||l||(o=i.pointToData(r)),null!=o&&XM(t,o,g,!1,d)}})});var m={};return HM(h,function(o,t){var a=o.linkGroup;a&&!f[t]&&HM(a.axesInfo,function(t,e){var i=f[e];if(t!==o&&i){var n=i.value;a.mapper&&(n=o.axis.scale.parse(a.mapper(n,qM(t),qM(o)))),m[o.key]=n}})}),HM(m,function(t,e){XM(h[e],t,g,!0,d)}),function(o,t,e){var a=e.axesInfo=[];HM(t,function(t,e){var i=t.axisPointerModel.option,n=o[e];n?(t.useHandle||(i.status="show"),i.value=n.value,i.seriesDataIndices=(n.payloadBatch||[]).slice()):t.useHandle||(i.status="hide"),"show"===i.status&&a.push({axisDim:t.axis.dim,axisIndex:t.axis.model.componentIndex,value:i.value})})}(f,h,d),function(t,e,i,n){if(KM(e)||!t.list.length)return n({type:"hideTip"});var o=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};n({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:i.tooltipOption,position:i.position,dataIndexInside:o.dataIndexInside,dataIndex:o.dataIndex,seriesIndex:o.seriesIndex,dataByCoordSys:t.list})}(p,r,t,a),function(t,e,i){var n=i.getZr(),o="axisPointerLastHighlights",a=UM(n)[o]||{},r=UM(n)[o]={};HM(t,function(t,e){var i=t.axisPointerModel.option;"show"===i.status&&HM(i.seriesDataIndices,function(t){var e=t.seriesIndex+" | "+t.dataIndex;r[e]=t})});var s=[],l=[];E(a,function(t,e){r[e]||l.push(t)}),E(r,function(t,e){a[e]||s.push(t)}),l.length&&i.dispatchAction({type:"downplay",escapeConnect:!0,batch:l}),s.length&&i.dispatchAction({type:"highlight",escapeConnect:!0,batch:s})}(h,0,i),d}});var MI=["x","y"],II=["width","height"],TI=sI.extend({makeElOption:function(t,e,i,n,o){var a=i.axis,r=a.coordinateSystem,s=CI(r,1-DI(a)),l=r.dataToPoint(e)[0],u=n.get("type");if(u&&"none"!==u){var h=dI(n),c=AI[u](a,l,s);c.style=h,t.graphicKey=c.type,t.pointer=c}mI(e,t,RM(i),i,n,o)},getHandleTransform:function(t,e,i){var n=RM(e,{labelInside:!1});return n.labelMargin=i.get("handle.margin"),{position:gI(e.axis,t,n),rotation:n.rotation+(n.labelDirection<0?Math.PI:0)}},updateHandleTransform:function(t,e,i,n){var o=i.axis,a=o.coordinateSystem,r=DI(o),s=CI(a,r),l=t.position;l[r]+=e[r],l[r]=Math.min(s[1],l[r]),l[r]=Math.max(s[0],l[r]);var u=CI(a,1-r),h=(u[1]+u[0])/2,c=[h,h];return c[r]=l[r],{position:l,rotation:t.rotation,cursorPoint:c,tooltipOption:{verticalAlign:"middle"}}}}),AI={line:function(t,e,i){return{type:"Line",subPixelOptimize:!0,shape:vI([e,i[0]],[e,i[1]],DI(t))}},shadow:function(t,e,i){var n=t.getBandWidth(),o=i[1]-i[0];return{type:"Rect",shape:yI([e-n/2,i[0]],[n,o],DI(t))}}};function DI(t){return t.isHorizontal()?0:1}function CI(t,e){var i=t.getRect();return[i[MI[e]],i[MI[e]]+i[II[e]]]}hv.registerAxisPointerClass("SingleAxisPointer",TI),bf({type:"single"});var LI=ic.extend({type:"series.themeRiver",dependencies:["singleAxis"],nameMap:null,init:function(t){LI.superApply(this,"init",arguments),this.legendVisualProvider=new Gv(A(this.getData,this),A(this.getRawData,this))},fixData:function(t){var e=t.length,i=Ko(t,function(t){return t[2]}),n=[];i.buckets.each(function(t,e){n.push({name:e,dataList:t})});for(var o=n.length,a=-1,r=-1,s=0;sMath.PI/2?"right":"left"):y&&"center"!==y?"left"===y?(d=l.r0+v,f>Math.PI/2&&(y="right")):"right"===y&&(d=l.r-v,f>Math.PI/2&&(y="left")):(d=(l.r+l.r0)/2,y="center"),c.attr("style",{text:s,textAlign:y,textVerticalAlign:S("verticalAlign")||"middle",opacity:S("opacity")});var x=d*p+l.cx,_=d*g+l.cy;c.attr("position",[x,_]);var w=S("rotate"),b=0;function S(t){var e=a.get(t);return null==e?o.get(t):e}"radial"===w?(b=-f)<-Math.PI/2&&(b+=Math.PI):"tangential"===w?(b=Math.PI/2-f)>Math.PI/2?b-=Math.PI:b<-Math.PI/2&&(b+=Math.PI):"number"==typeof w&&(b=w*Math.PI/180),c.attr("rotation",b)},BI._initEvents=function(t,e,i,n){t.off("mouseover").off("mouseout").off("emphasis").off("normal");function o(){r.onEmphasis(n)}function a(){r.onNormal()}var r=this;i.isAnimationEnabled()&&t.on("mouseover",o).on("mouseout",a).on("emphasis",o).on("normal",a).on("downplay",function(){r.onDownplay()}).on("highlight",function(){r.onHighlight()})},w(RI,Ii);gc.extend({type:"sunburst",init:function(){},render:function(o,a,t,e){var n=this;this.seriesModel=o,this.api=t,this.ecModel=a;var r=o.getData(),s=r.tree.root,i=o.getViewRoot(),l=this.group,u=o.get("renderLabelForZeroData"),h=[];i.eachNode(function(t){h.push(t)});var c=this._oldChildren||[];if(function(i,n){if(0===i.length&&0===n.length)return;function t(t){return t.getId()}function e(t,e){!function(t,e){u||!t||t.getValue()||(t=null);if(t!==s&&e!==s)if(e&&e.piece)t?(e.piece.updateData(!1,t,"normal",o,a),r.setItemGraphicEl(t.dataIndex,e.piece)):function(t){if(!t)return;t.piece&&(l.remove(t.piece),t.piece=null)}(e);else if(t){var i=new RI(t,o,a);l.add(i),r.setItemGraphicEl(t.dataIndex,i)}}(null==t?null:i[t],null==e?null:n[e])}new Tf(n,i,t,t).add(e).update(e).remove(T(e,null)).execute()}(h,c),function(t,e){if(0=i.r0}}});var VI="sunburstRootToNode";gf({type:VI,update:"updateView"},function(o,t){t.eachComponent({mainType:"series",subType:"sunburst",query:o},function(t,e){var i=Ox(o,[VI],t);if(i){var n=t.getViewRoot();n&&(o.direction=zx(n,i.node)?"rollUp":"drillDown"),t.resetViewRoot(i.node)}})});var GI="sunburstHighlight";gf({type:GI,update:"updateView"},function(n,t){t.eachComponent({mainType:"series",subType:"sunburst",query:n},function(t,e){var i=Ox(n,[GI],t);i&&(n.highlight=i.node)})});gf({type:"sunburstUnhighlight",update:"updateView"},function(i,t){t.eachComponent({mainType:"series",subType:"sunburst",query:i},function(t,e){i.unhighlight=!0})});var FI=Math.PI/180;function WI(t,e){if("function"==typeof e)return t.sort(e);var n="asc"===e;return t.sort(function(t,e){var i=(t.getValue()-e.getValue())*(n?1:-1);return 0==i?(t.dataIndex-e.dataIndex)*(n?-1:1):i})}function HI(a,r){return r=r||[0,0],N(["x","y"],function(t,e){var i=this.getAxis(t),n=r[e],o=a[e]/2;return"category"===i.type?i.getBandWidth():Math.abs(i.dataToCoord(n-o)-i.dataToCoord(n+o))},this)}yf(T(Yv,"sunburst")),vf(T(function(t,e,C,i){e.eachSeriesByType(t,function(t){var e=t.get("center"),i=t.get("radius");k(i)||(i=[0,i]),k(e)||(e=[e,e]);var n=C.getWidth(),o=C.getHeight(),h=Math.min(n,o),c=Pl(e[0],n),d=Pl(e[1],o),f=Pl(i[0],h/2),a=Pl(i[1],h/2),r=-t.get("startAngle")*FI,p=t.get("minAngle")*FI,g=t.getData().tree.root,s=t.getViewRoot(),m=s.depth,l=t.get("sort");null!=l&&!function e(t,i){var n=t.children||[];t.children=WI(n,i);n.length&&E(t.children,function(t){e(t,i)})}(s,l);var u=0;E(s.children,function(t){isNaN(t.getValue())||u++});var v=s.getValue(),y=Math.PI/(v||u)*2,x=0t[1]&&t.reverse(),{coordSys:{type:"polar",cx:o.cx,cy:o.cy,r:t[1],r0:t[0]},api:{coord:A(function(t){var e=a.dataToRadius(t[0]),i=r.dataToAngle(t[1]),n=o.coordToPoint([e,i]);return n.push(e,i*Math.PI/180),n}),size:A(XI,o)}}},calendar:function(i){var t=i.getRect(),e=i.getRangeInfo();return{coordSys:{type:"calendar",x:t.x,y:t.y,width:t.width,height:t.height,cellWidth:i.getCellWidth(),cellHeight:i.getCellHeight(),rangeInfo:{start:e.start,end:e.end,weeks:e.weeks,dayCount:e.allDay}},api:{coord:function(t,e){return i.dataToPoint(t,e)}}}}};function tT(t,e,i,n,o){null==i[t]||o||(e[t]=i[t],i[t]=n[t])}function eT(a,r,e,t){var i=a.get("renderItem"),n=a.coordinateSystem,o={};n&&(o=n.prepareCustoms?n.prepareCustoms():QI[n.type](n));var s,l,u,h,c,d=C({getWidth:t.getWidth,getHeight:t.getHeight,getZr:t.getZr,getDevicePixelRatio:t.getDevicePixelRatio,value:function(t,e){return null==e&&(e=s),r.get(r.getDimension(t||0),e)},style:function(t,e){null==e&&(e=s),g(e);var i=l.getModel(jI).getItemStyle();null!=c&&(i.fill=c);var n=r.getItemVisual(e,"opacity");null!=n&&(i.opacity=n);var o=t?rT(t,u):u;return Qs(i,o,null,{autoColor:c,isRectText:!0}),i.text=o.getShallow("show")?H(a.getFormattedLabel(e,"normal"),Gg(r,e)):null,t&&sT(i,t),i},styleEmphasis:function(t,e){null==e&&(e=s),g(e);var i=l.getModel(qI).getItemStyle(),n=t?rT(t,h):h;return Qs(i,n,null,{isRectText:!0},!0),i.text=n.getShallow("show")?Z(a.getFormattedLabel(e,"emphasis"),a.getFormattedLabel(e,"normal"),Gg(r,e)):null,t&&sT(i,t),i},visual:function(t,e){return null==e&&(e=s),r.getItemVisual(e,t)},barLayout:function(t){if(n.getBaseAxis){return function(t){var e=[],i=t.axis;if("category"===i.type){for(var n=i.getBandWidth(),o=0;oe[1]&&e.reverse();var i=t.getExtent(),n=Math.PI/180;return{cx:this.cx,cy:this.cy,r0:e[0],r:e[1],startAngle:-i[0]*n,endAngle:-i[1]*n,clockwise:t.inverse,contain:function(t,e){var i=t-this.cx,n=e-this.cy,o=i*i+n*n,a=this.r,r=this.r0;return o<=a*a&&r*r<=o}}}};var vT=Tu.extend({type:"polarAxis",axis:null,getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"polar",index:this.option.polarIndex,id:this.option.polarId})[0]}});m(vT.prototype,sg);var yT={splitNumber:5};function xT(t,e){return e.type||(e.data?"category":"value")}function _T(t,e){var i=this,n=i.getAngleAxis(),o=i.getRadiusAxis();if(n.scale.setExtent(1/0,-1/0),o.scale.setExtent(1/0,-1/0),t.eachSeries(function(t){if(t.coordinateSystem===i){var e=t.getData();E(e.mapDimension("radius",!0),function(t){o.scale.unionExtentFromData(e,up(e,t))}),E(e.mapDimension("angle",!0),function(t){n.scale.unionExtentFromData(e,up(e,t))})}}),eg(n.scale,n.model),eg(o.scale,o.model),"category"===n.type&&!n.onBand){var a=n.getExtent(),r=360/n.scale.count();n.inverse?a[1]+=r:a[1]-=r,n.setExtent(a[0],a[1])}}function wT(t,e){if(t.type=e.get("type"),t.scale=ig(e),t.onBand=e.get("boundaryGap")&&"category"===t.type,t.inverse=e.get("inverse"),"angleAxis"===e.mainType){t.inverse^=e.get("clockwise");var i=e.get("startAngle");t.setExtent(i,i+(t.inverse?-360:360))}(e.axis=t).model=e}Om("angle",vT,xT,{startAngle:90,clockwise:!0,splitNumber:12,axisLabel:{rotate:!1}}),Om("radius",vT,xT,yT),wf({type:"polar",dependencies:["polarAxis","angleAxis"],coordinateSystem:null,findAxisModel:function(t){var e;return this.ecModel.eachComponent(t,function(t){t.getCoordSysModel()===this&&(e=t)},this),e},defaultOption:{zlevel:0,z:0,center:["50%","50%"],radius:"80%"}}),nh.register("polar",{dimensions:mT.prototype.dimensions,create:function(i,s){var l=[];return i.eachComponent("polar",function(t,e){var i=new mT(e);i.update=_T;var n=i.getRadiusAxis(),o=i.getAngleAxis(),a=t.findAxisModel("radiusAxis"),r=t.findAxisModel("angleAxis");wT(n,a),wT(o,r),function(t,e,i){var n=e.get("center"),o=i.getWidth(),a=i.getHeight();t.cx=Pl(n[0],o),t.cy=Pl(n[1],a);var r=t.getRadiusAxis(),s=Math.min(o,a)/2,l=e.get("radius");null==l?l=[0,"100%"]:k(l)||(l=[0,l]),l=[Pl(l[0],s),Pl(l[1],s)],r.inverse?r.setExtent(l[1],l[0]):r.setExtent(l[0],l[1])}(i,t,s),l.push(i),(t.coordinateSystem=i).model=t}),i.eachSeries(function(t){if("polar"===t.get("coordinateSystem")){var e=i.queryComponents({mainType:"polar",index:t.get("polarIndex"),id:t.get("polarId")})[0];t.coordinateSystem=e.coordinateSystem}}),l}});var bT=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function ST(t,e,i){e[1]>e[0]&&(e=e.slice().reverse());var n=t.coordToPoint([e[0],i]),o=t.coordToPoint([e[1],i]);return{x1:n[0],y1:n[1],x2:o[0],y2:o[1]}}function MT(t){return t.getRadiusAxis().inverse?0:1}function IT(t){var e=t[0],i=t[t.length-1];e&&i&&Math.abs(Math.abs(e.coord-i.coord)-360)<1e-4&&t.pop()}hv.extend({type:"angleAxis",axisPointerClass:"PolarAxisPointer",render:function(e,t){if(this.group.removeAll(),e.get("show")){var i=e.axis,n=i.polar,o=n.getRadiusAxis().getExtent(),a=i.getTicksCoords(),r=i.getMinorTicksCoords(),s=N(i.getViewLabels(),function(t){return(t=D(t)).coord=i.dataToCoord(t.tickValue),t});IT(s),IT(a),E(bT,function(t){!e.get(t+".show")||i.scale.isBlank()&&"axisLine"!==t||this["_"+t](e,n,a,r,o,s)},this)}},_axisLine:function(t,e,i,n,o){var a,r=t.getModel("axisLine.lineStyle"),s=MT(e),l=s?0:1;(a=0===o[l]?new Hr({shape:{cx:e.cx,cy:e.cy,r:o[s]},style:r.getLineStyle(),z2:1,silent:!0}):new Xr({shape:{cx:e.cx,cy:e.cy,r:o[s],r0:o[l]},style:r.getLineStyle(),z2:1,silent:!0})).style.fill=null,this.group.add(a)},_axisTick:function(t,e,i,n,o){var a=t.getModel("axisTick"),r=(a.get("inside")?-1:1)*a.get("length"),s=o[MT(e)],l=N(i,function(t){return new os({shape:ST(e,[s,s+r],t.coord)})});this.group.add(ks(l,{style:C(a.getModel("lineStyle").getLineStyle(),{stroke:t.get("axisLine.lineStyle.color")})}))},_minorTick:function(t,e,i,n,o){if(n.length){for(var a=t.getModel("axisTick"),r=t.getModel("minorTick"),s=(a.get("inside")?-1:1)*r.get("length"),l=o[MT(e)],u=[],h=0;hr?"left":"right",u=Math.abs(a[1]-s)/o<.3?"middle":a[1]>s?"top":"bottom";p&&p[n]&&p[n].textStyle&&(i=new Il(p[n].textStyle,g,g.ecModel));var h=new Fr({silent:Ym.isLabelSilent(c)});this.group.add(h),Qs(h.style,i,{x:a[0],y:a[1],textFill:i.getTextColor()||c.get("axisLine.lineStyle.color"),text:t.formattedLabel,textAlign:l,textVerticalAlign:u}),v&&(h.eventData=Ym.makeAxisEventDataBase(c),h.eventData.targetType="axisLabel",h.eventData.value=t.rawLabel)},this)},_splitLine:function(t,e,i,n,o){var a=t.getModel("splitLine").getModel("lineStyle"),r=a.get("color"),s=0;r=r instanceof Array?r:[r];for(var l=[],u=0;um?"left":"right",h=Math.abs(l[1]-v)/g<.3?"middle":l[1]>v?"top":"bottom"}return{position:l,align:u,verticalAlign:h}}(e,i,0,s,d))}});var CT={line:function(t,e,i,n,o){return"angle"===t.dim?{type:"Line",shape:vI(e.coordToPoint([n[0],i]),e.coordToPoint([n[1],i]))}:{type:"Circle",shape:{cx:e.cx,cy:e.cy,r:i}}},shadow:function(t,e,i,n,o){var a=Math.max(1,t.getBandWidth()),r=Math.PI/180;return"angle"===t.dim?{type:"Sector",shape:xI(e.cx,e.cy,n[0],n[1],(-i-a/2)*r,(a/2-i)*r)}:{type:"Sector",shape:xI(e.cx,e.cy,i-a/2,i+a/2,0,2*Math.PI)}}};function LT(n,t){t.update="updateView",gf(t,function(t,e){var i={};return e.eachComponent({mainType:"geo",query:t},function(e){e[n](t.name),E(e.coordinateSystem.regions,function(t){i[t.name]=e.isSelected(t.name)||!1})}),{selected:i,name:t.name}})}hv.registerAxisPointerClass("PolarAxisPointer",DT),vf(T(function(t,e,i){var N={},O=function(t){var g={};E(t,function(t,e){var i=t.getData(),n=t.coordinateSystem,o=n.getBaseAxis(),a=dT(n,o),r=o.getExtent(),s="category"===o.type?o.getBandWidth():Math.abs(r[1]-r[0])/i.count(),l=g[a]||{bandWidth:s,remainedWidth:s,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},u=l.stacks;g[a]=l;var h=cT(t);u[h]||l.autoWidthCount++,u[h]=u[h]||{width:0,maxWidth:0};var c=Pl(t.get("barWidth"),s),d=Pl(t.get("barMaxWidth"),s),f=t.get("barGap"),p=t.get("barCategoryGap");c&&!u[h].width&&(c=Math.min(l.remainedWidth,c),u[h].width=c,l.remainedWidth-=c),d&&(u[h].maxWidth=d),null!=f&&(l.gap=f),null!=p&&(l.categoryGap=p)});var d={};return E(g,function(t,i){d[i]={};var e=t.stacks,n=t.bandWidth,o=Pl(t.categoryGap,n),a=Pl(t.gap,1),r=t.remainedWidth,s=t.autoWidthCount,l=(r-o)/(s+(s-1)*a);l=Math.max(l,0),E(e,function(t,e){var i=t.maxWidth;i&&i=n.start.time&&i.timea.end.time&&t.reverse(),t},_getRangeInfo:function(t){var e;(t=[this.getDateInfo(t[0]),this.getDateInfo(t[1])])[0].time>t[1].time&&(e=!0,t.reverse());var i=Math.floor(t[1].time/864e5)-Math.floor(t[0].time/864e5)+1,n=new Date(t[0].time),o=n.getDate(),a=t[1].date.getDate();if(n.setDate(o+i-1),n.getDate()!==a)for(var r=0n.weeks||0===t&&en.lweek)return!1;var o=7*(t-1)-n.fweek+e,a=new Date(n.start.time);return a.setDate(n.start.d+o),this.getDateInfo(a)}},kT.dimensions=kT.prototype.dimensions,kT.getDimensionsInfo=kT.prototype.getDimensionsInfo,kT.create=function(i,n){var o=[];return i.eachComponent("calendar",function(t){var e=new kT(t,i,n);o.push(e),t.coordinateSystem=e}),i.eachSeries(function(t){"calendar"===t.get("coordinateSystem")&&(t.coordinateSystem=o[t.get("calendarIndex")||0])}),o},nh.register("calendar",kT);var NT=Tu.extend({type:"calendar",coordinateSystem:null,defaultOption:{zlevel:0,z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",nameMap:"en",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",nameMap:"en",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},init:function(t,e,i,n){var o=_u(t);NT.superApply(this,"init",arguments),OT(t,o)},mergeOption:function(t,e){NT.superApply(this,"mergeOption",arguments),OT(this.option,t)}});function OT(t,e){var i=t.cellSize;k(i)?1===i.length&&(i[1]=i[0]):i=t.cellSize=[i,i];var n=N([0,1],function(t){return function(t,e){return null!=t[pu[e][0]]||null!=t[pu[e][1]]&&null!=t[pu[e][2]]}(e,t)&&(i[t]="auto"),null!=i[t]&&"auto"!==i[t]});xu(t,e,{type:"box",ignoreSize:n})}var ET={EN:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],CN:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},zT={EN:["S","M","T","W","T","F","S"],CN:["日","一","二","三","四","五","六"]};bf({type:"calendar",_tlpoints:null,_blpoints:null,_firstDayOfMonth:null,_firstDayPoints:null,render:function(t,e,i){var n=this.group;n.removeAll();var o=t.coordinateSystem,a=o.getRangeInfo(),r=o.getOrient();this._renderDayRect(t,a,n),this._renderLines(t,a,r,n),this._renderYearText(t,a,r,n),this._renderMonthText(t,r,n),this._renderWeekText(t,a,r,n)},_renderDayRect:function(t,e,i){for(var n=t.coordinateSystem,o=t.getModel("itemStyle").getItemStyle(),a=n.getCellWidth(),r=n.getCellHeight(),s=e.start.time;s<=e.end.time;s=n.getNextNDay(s,1).time){var l=n.dataToRect([s],!1).tl,u=new is({shape:{x:l[0],y:l[1],width:a,height:r},cursor:"default",style:o});i.add(u)}},_renderLines:function(i,t,n,o){var a=this,r=i.coordinateSystem,s=i.getModel("splitLine.lineStyle").getLineStyle(),l=i.get("splitLine.show"),e=s.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var u=t.start,h=0;u.time<=t.end.time;h++){d(u.formatedDate),0===h&&(u=r.getDateInfo(t.start.y+"-"+t.start.m));var c=u.date;c.setMonth(c.getMonth()+1),u=r.getDateInfo(c)}function d(t){a._firstDayOfMonth.push(r.getDateInfo(t)),a._firstDayPoints.push(r.dataToRect([t],!1).tl);var e=a._getLinePointsOfOneWeek(i,t,n);a._tlpoints.push(e[0]),a._blpoints.push(e[e.length-1]),l&&a._drawSplitline(e,s,o)}d(r.getNextNDay(t.end.time,1).formatedDate),l&&this._drawSplitline(a._getEdgesPoints(a._tlpoints,e,n),s,o),l&&this._drawSplitline(a._getEdgesPoints(a._blpoints,e,n),s,o)},_getEdgesPoints:function(t,e,i){var n=[t[0].slice(),t[t.length-1].slice()],o="horizontal"===i?0:1;return n[0][o]=n[0][o]-e/2,n[1][o]=n[1][o]+e/2,n},_drawSplitline:function(t,e,i){var n=new Kr({z2:20,shape:{points:t},style:e});i.add(n)},_getLinePointsOfOneWeek:function(t,e,i){var n=t.coordinateSystem;e=n.getDateInfo(e);for(var o=[],a=0;a<7;a++){var r=n.getNextNDay(e.time,a),s=n.dataToRect([r.time],!1);o[2*r.day]=s.tl,o[2*r.day+1]=s["horizontal"===i?"bl":"tr"]}return o},_formatterLabel:function(t,e){return"string"==typeof t&&t?au(t,e):"function"==typeof t?t(e):e.nameMap},_yearTextPositionControl:function(t,e,i,n,o){e=e.slice();var a=["center","bottom"];"bottom"===n?(e[1]+=o,a=["center","top"]):"left"===n?e[0]-=o:"right"===n?(e[0]+=o,a=["center","top"]):e[1]-=o;var r=0;return"left"!==n&&"right"!==n||(r=Math.PI/2),{rotation:r,position:e,style:{textAlign:a[0],textVerticalAlign:a[1]}}},_renderYearText:function(t,e,i,n){var o=t.getModel("yearLabel");if(o.get("show")){var a=o.get("margin"),r=o.get("position");r=r||("horizontal"!==i?"top":"left");var s=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],l=(s[0][0]+s[1][0])/2,u=(s[0][1]+s[1][1])/2,h="horizontal"===i?0:1,c={top:[l,s[h][1]],bottom:[l,s[1-h][1]],left:[s[1-h][0],u],right:[s[h][0],u]},d=e.start.y;+e.end.y>+e.start.y&&(d=d+"-"+e.end.y);var f=o.get("formatter"),p={start:e.start.y,end:e.end.y,nameMap:d},g=this._formatterLabel(f,p),m=new Fr({z2:30});Qs(m.style,o,{text:g}),m.attr(this._yearTextPositionControl(m,c[r],i,r,a)),n.add(m)}},_monthTextPositionControl:function(t,e,i,n,o){var a="left",r="top",s=t[0],l=t[1];return"horizontal"===i?(l+=o,e&&(a="center"),"start"===n&&(r="bottom")):(s+=o,e&&(r="middle"),"start"===n&&(a="right")),{x:s,y:l,textAlign:a,textVerticalAlign:r}},_renderMonthText:function(t,e,i){var n=t.getModel("monthLabel");if(n.get("show")){var o=n.get("nameMap"),a=n.get("margin"),r=n.get("position"),s=n.get("align"),l=[this._tlpoints,this._blpoints];z(o)&&(o=ET[o.toUpperCase()]||[]);var u="start"===r?0:1,h="horizontal"===e?0:1;a="start"===r?-a:a;for(var c="center"===s,d=0;dd.getHeight()&&(i.textPosition="top",a=!0);var r=a?-5-n.height:p+8;o+n.width/2>d.getWidth()?(i.textPosition=["100%",r],i.textAlign="right"):o-n.width/2<0&&(i.textPosition=[0,r],i.textAlign="left")}})}function t(t,e){var i,n=m[t],o=m[e],a=u[n],r=new Il(a,h,h.ecModel);if(l&&null!=l.newTitle&&(a.title=l.newTitle),n&&!o){if(function(t){return 0===t.indexOf("my")}(n))i={model:r,onclick:r.option.onclick,featureName:n};else{var s=ZT(n);if(!s)return;i=new s(r,c,d)}g[n]=i}else{if(!(i=g[o]))return;i.model=r,i.ecModel=c,i.api=d}n||!o?r.get("show")&&!i.unusable?(function(o,a,t){var r=o.getModel("iconStyle"),s=o.getModel("emphasis.iconStyle"),e=a.getIcons?a.getIcons():o.get("icon"),l=o.get("title")||{};if("string"==typeof e){var i=e,n=l;l={},(e={})[t]=i,l[t]=n}var u=o.iconPaths={};E(e,function(t,e){var i=pl(t,{},{x:-p/2,y:-p/2,width:p,height:p});i.setStyle(r.getItemStyle()),i.hoverStyle=s.getItemStyle(),i.setStyle({text:l[e],textAlign:s.get("textAlign"),textBorderRadius:s.get("textBorderRadius"),textPadding:s.get("textPadding"),textFill:null});var n=h.getModel("tooltip");n&&n.get("show")&&i.attr("tooltip",L({content:l[e],formatter:n.get("formatter",!0)||function(){return l[e]},formatterParams:{componentType:"toolbox",name:e,title:l[e],$vars:["name","title"]},position:n.get("position",!0)||"bottom"},n.option)),Ys(i),h.get("showTitle")&&(i.__title=l[e],i.on("mouseover",function(){var t=s.getItemStyle(),e="vertical"===h.get("orient")?null==h.get("right")?"right":"left":null==h.get("bottom")?"bottom":"top";i.setStyle({textFill:s.get("textFill")||t.fill||t.stroke||"#000",textBackgroundColor:s.get("textBackgroundColor"),textPosition:s.get("textPosition")||e})}).on("mouseout",function(){i.setStyle({textFill:null,textBackgroundColor:null})})),i.trigger(o.get("iconStatus."+e)||"normal"),f.add(i),i.on("click",A(a.onclick,a,c,d,e)),u[e]=i})}(r,i,n),r.setIconStatus=function(t,e){var i=this.option,n=this.iconPaths;i.iconStatus=i.iconStatus||{},i.iconStatus[t]=e,n[t]&&n[t].trigger(e)},i.render&&i.render(r,c,d,l)):i.remove&&i.remove(c,d):i.dispose&&i.dispose(c,d)}},updateView:function(t,e,i,n){E(this._features,function(t){t.updateView&&t.updateView(t.model,e,i,n)})},remove:function(e,i){E(this._features,function(t){t.remove&&t.remove(e,i)}),this.group.removeAll()},dispose:function(e,i){E(this._features,function(t){t.dispose&&t.dispose(e,i)})}});var YT=Cc.toolbox.saveAsImage;function jT(t){this.model=t}jT.defaultOption={show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:YT.title,type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],pixelRatio:1,lang:YT.lang.slice()},jT.prototype.unusable=!v.canvasSupported,jT.prototype.onclick=function(t,e){var i=this.model,n=i.get("name")||t.get("title.0.text")||"echarts",o=i.get("type",!0)||"png",a=e.getConnectedDataURL({type:o,backgroundColor:i.get("backgroundColor",!0)||t.get("backgroundColor")||"#fff",connectedBackgroundColor:i.get("connectedBackgroundColor"),excludeComponents:i.get("excludeComponents"),pixelRatio:i.get("pixelRatio")});if("function"!=typeof MouseEvent||v.browser.ie||v.browser.edge)if(window.navigator.msSaveOrOpenBlob){for(var r=atob(a.split(",")[1]),s=r.length,l=new Uint8Array(s);s--;)l[s]=r.charCodeAt(s);var u=new Blob([l]);window.navigator.msSaveOrOpenBlob(u,n+"."+o)}else{var h=i.get("lang"),c='';window.open().document.write(c)}else{var d=document.createElement("a");d.download=n+"."+o,d.target="_blank",d.href=a;var f=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!1});d.dispatchEvent(f)}},HT("saveAsImage",jT);var qT=Cc.toolbox.magicType,KT="__ec_magicType_stack__";function $T(t){this.model=t}$T.defaultOption={show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:D(qT.title),option:{},seriesIndex:{}};var JT=$T.prototype;JT.getIcons=function(){var t=this.model,e=t.get("icon"),i={};return E(t.get("type"),function(t){e[t]&&(i[t]=e[t])}),i};var QT={line:function(t,e,i,n){if("bar"===t)return m({id:e,type:"line",data:i.get("data"),stack:i.get("stack"),markPoint:i.get("markPoint"),markLine:i.get("markLine")},n.get("option.line")||{},!0)},bar:function(t,e,i,n){if("line"===t)return m({id:e,type:"bar",data:i.get("data"),stack:i.get("stack"),markPoint:i.get("markPoint"),markLine:i.get("markLine")},n.get("option.bar")||{},!0)},stack:function(t,e,i,n){var o=i.get("stack")===KT;if("line"===t||"bar"===t)return n.setIconStatus("stack",o?"normal":"emphasis"),m({id:e,stack:o?"":KT},n.get("option.stack")||{},!0)}},tA=[["line","bar"],["stack"]];JT.onclick=function(u,t,h){var c=this.model,e=c.get("seriesIndex."+h);if(QT[h]){var i,d={series:[]};if(E(tA,function(t){0<=_(t,h)&&E(t,function(t){c.setIconStatus(t,"normal")})}),c.setIconStatus(h,"emphasis"),u.eachComponent({mainType:"series",query:null==e?null:{seriesIndex:e}},function(t){var e=t.subType,i=t.id,n=QT[h](e,i,t,c);n&&(C(n,t.option),d.series.push(n));var o=t.coordinateSystem;if(o&&"cartesian2d"===o.type&&("line"===h||"bar"===h)){var a=o.getAxesByScale("ordinal")[0];if(a){var r=a.dim+"Axis",s=u.queryComponents({mainType:r,index:t.get(name+"Index"),id:t.get(name+"Id")})[0].componentIndex;d[r]=d[r]||[];for(var l=0;l<=s;l++)d[r][s]=d[r][s]||{};d[r][s].boundaryGap="bar"===h}}}),"stack"===h)i=d.series&&d.series[0]&&d.series[0].stack===KT?m({stack:qT.title.tiled},qT.title):D(qT.title);t.dispatchAction({type:"changeMagicType",currentType:h,newOption:d,newTitle:i})}},gf({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(t,e){e.mergeOption(t.newOption)}),HT("magicType",$T);var eA=Cc.toolbox.dataView,iA=new Array(60).join("-"),nA="\t";function oA(t){var e=function(t){var o={},a=[],r=[];return t.eachRawSeries(function(t){var e=t.coordinateSystem;if(!e||"cartesian2d"!==e.type&&"polar"!==e.type)a.push(t);else{var i=e.getBaseAxis();if("category"===i.type){var n=i.dim+"_"+i.index;o[n]||(o[n]={categoryAxis:i,valueAxis:e.getOtherAxis(i),series:[]},r.push({axisDim:i.dim,axisIndex:i.index})),o[n].series.push(t)}else a.push(t)}}),{seriesGroupByCategoryAxis:o,other:a,meta:r}}(t);return{value:M([function(t){var h=[];return E(t,function(t,e){var i=t.categoryAxis,n=t.valueAxis.dim,o=[" "].concat(N(t.series,function(t){return t.name})),a=[i.model.getCategories()];E(t.series,function(t){a.push(t.getRawData().mapArray(n,function(t){return t}))});for(var r=[o.join(nA)],s=0;st[1]&&t.reverse(),t}function vA(t,e){return Xo(t,e,{includeMainTypes:fA})}gA.setOutputRanges=function(t,e){this.matchOutputRanges(t,e,function(t,e,i){if((t.coordRanges||(t.coordRanges=[])).push(e),!t.coordRange){t.coordRange=e;var n=wA[t.brushType](0,i,e);t.__rangeOffset={offset:SA[t.brushType](n.values,t.range,[1,1]),xyMinMax:n.xyMinMax}}})},gA.matchOutputRanges=function(t,n,o){uA(t,function(i){var t=this.findTargetInfo(i,n);t&&!0!==t&&E(t.coordSyses,function(t){var e=wA[i.brushType](1,t,i.range);o(i,e.values,t,n)})},this)},gA.setInputRanges=function(t,o){uA(t,function(t){var e=this.findTargetInfo(t,o);if(t.range=t.range||[],e&&!0!==e){t.panelId=e.panelId;var i=wA[t.brushType](0,e.coordSys,t.coordRange),n=t.__rangeOffset;t.range=n?SA[t.brushType](i.values,n.offset,function(t,e){var i=IA(t),n=IA(e),o=[i[0]/n[0],i[1]/n[1]];return isNaN(o[0])&&(o[0]=1),isNaN(o[1])&&(o[1]=1),o}(i.xyMinMax,n.xyMinMax)):i.values}},this)},gA.makePanelOpts=function(i,n){return N(this._targetInfoList,function(t){var e=t.getPanelRect();return{panelId:t.panelId,defaultBrushType:n&&n(t),clipPath:Ub(e),isTargetByCursor:Yb(e,i,t.coordSysModel),getLinearBrushOtherExtent:Xb(e)}})},gA.controlSeries=function(t,e,i){var n=this.findTargetInfo(t,i);return!0===n||n&&0<=hA(n.coordSyses,e.coordinateSystem)},gA.findTargetInfo=function(t,e){for(var i=this._targetInfoList,n=vA(e,t),o=0;on[1]&&(n[1]=e[1])})}),n[1]c[1];if(r&&!s&&!l)return!0;r&&(n=!0),s&&(e=!0),l&&(i=!0)}return n&&e&&i}):RA(h,function(t){if("empty"===o)i.setData(u=u.map(t,function(t){return function(t){return t>=c[0]&&t<=c[1]}(t)?t:NaN}));else{var e={};e[t]=c,u.selectRange(e)}}),RA(h,function(t){u.setApproximateExtent(c,t)}))})}}};var GA=E,FA=OA,WA=wf({type:"dataZoom",dependencies:["xAxis","yAxis","zAxis","radiusAxis","angleAxis","singleAxis","series"],defaultOption:{zlevel:0,z:4,orient:null,xAxisIndex:null,yAxisIndex:null,filterMode:"filter",throttle:null,start:0,end:100,startValue:null,endValue:null,minSpan:null,maxSpan:null,minValueSpan:null,maxValueSpan:null,rangeMode:null},init:function(t,e,i){this._dataIntervalByAxis={},this._dataInfo={},this._axisProxies={},this.textStyleModel,this._autoThrottle=!0,this._rangePropMode=["percent","percent"];var n=HA(t);this.settledOption=n,this.mergeDefaultAndTheme(t,i),this.doInit(n)},mergeOption:function(t){var e=HA(t);m(this.option,t,!0),m(this.settledOption,e,!0),this.doInit(e)},doInit:function(t){var i=this.option;v.canvasSupported||(i.realtime=!1),this._setDefaultThrottle(t),ZA(this,t);var n=this.settledOption;GA([["start","startValue"],["end","endValue"]],function(t,e){"value"===this._rangePropMode[e]&&(i[t[0]]=n[t[0]]=null)},this),this.textStyleModel=this.getModel("textStyle"),this._resetTarget(),this._giveAxisProxies()},_giveAxisProxies:function(){var r=this._axisProxies;this.eachTargetAxis(function(t,e,i,n){var o=this.dependentModels[t.axis][e],a=o.__dzAxisProxy||(o.__dzAxisProxy=new zA(t.name,e,this,n));r[t.name+"_"+e]=a},this)},_resetTarget:function(){var i=this.option,t=this._judgeAutoMode();FA(function(t){var e=t.axisIndex;i[e]=Eo(i[e])},this),"axisIndex"===t?this._autoSetAxisIndex():"orient"===t&&this._autoSetOrient()},_judgeAutoMode:function(){var e=this.option,i=!1;FA(function(t){null!=e[t.axisIndex]&&(i=!0)},this);var t=e.orient;return null==t&&i?"orient":i?void 0:(null==t&&(e.orient="horizontal"),"axisIndex")},_autoSetAxisIndex:function(){var a=!0,e=this.get("orient",!0),r=this.option,t=this.dependentModels;if(a){var i="vertical"===e?"y":"x";t[i+"Axis"].length?(r[i+"AxisIndex"]=[0],a=!1):GA(t.singleAxis,function(t){a&&t.get("orient",!0)===e&&(r.singleAxisIndex=[t.componentIndex],a=!1)})}a&&FA(function(t){if(a){var e=[],i=this.dependentModels[t.axis];if(i.length&&!e.length)for(var n=0,o=i.length;ne[0][1]&&(e[0][1]=a[0]),a[1]e[1][1]&&(e[1][1]=a[1])}return e&&CD(e)}};function CD(t){return new Mi(t[0][0],t[1][0],t[0][1]-t[0][0],t[1][1]-t[1][0])}var LD=["#ddd"];wf({type:"brush",dependencies:["geo","grid","xAxis","yAxis","parallel","series"],defaultOption:{toolbox:null,brushLink:null,seriesIndex:"all",geoIndex:null,xAxisIndex:null,yAxisIndex:null,brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(120,140,180,0.3)",borderColor:"rgba(120,140,180,0.8)"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},areas:[],brushType:null,brushOption:{},coordInfoList:[],optionUpdated:function(t,e){var i=this.option;e||vD(i,t,["inBrush","outOfBrush"]);var n=i.inBrush=i.inBrush||{};i.outOfBrush=i.outOfBrush||{color:LD},n.hasOwnProperty("liftZ")||(n.liftZ=5)},setAreas:function(t){t&&(this.areas=N(t,function(t){return kD(this.option,t)},this))},setBrushOption:function(t){this.brushOption=kD(this.option,t),this.brushType=this.brushOption.brushType}});function kD(t,e){return m({brushType:t.brushType,brushMode:t.brushMode,transformable:t.transformable,brushStyle:new Il(t.brushStyle).getItemStyle(),removeOnClick:t.removeOnClick,z:t.z},e,!0)}function PD(t,e,i,n){n&&n.$from===t.id||this._brushController.setPanels(t.brushTargetManager.makePanelOpts(i)).enableBrush(t.brushOption).updateCovers(t.areas.slice())}bf({type:"brush",init:function(t,e){this.ecModel=t,this.api=e,this.model,(this._brushController=new gb(e.getZr())).on("brush",A(this._onBrush,this)).mount()},render:function(t){return this.model=t,PD.apply(this,arguments)},updateTransform:PD,updateView:PD,dispose:function(){this._brushController.dispose()},_onBrush:function(t,e){var i=this.model.id;this.model.brushTargetManager.setOutputRanges(t,this.ecModel),e.isEnd&&!e.removeOnClick||this.api.dispatchAction({type:"brush",brushId:i,areas:D(t),$from:i}),e.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:i,areas:D(t),$from:i})}}),gf({type:"brush",event:"brush"},function(e,t){t.eachComponent({mainType:"brush",query:e},function(t){t.setAreas(e.areas)})}),gf({type:"brushSelect",event:"brushSelected",update:"none"},function(){}),gf({type:"brushEnd",event:"brushEnd",update:"none"},function(){});var ND=Cc.toolbox.brush;function OD(t,e,i){this.model=t,this.ecModel=e,this.api=i,this._brushType,this._brushMode}OD.defaultOption={show:!0,type:["rect","polygon","lineX","lineY","keep","clear"],icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:D(ND.title)};var ED=OD.prototype;ED.render=ED.updateView=function(e,t,i){var n,o,a;t.eachComponent({mainType:"brush"},function(t){n=t.brushType,o=t.brushOption.brushMode||"single",a|=t.areas.length}),this._brushType=n,this._brushMode=o,E(e.get("type",!0),function(t){e.setIconStatus(t,("keep"===t?"multiple"===o:"clear"===t?a:t===n)?"emphasis":"normal")})},ED.getIcons=function(){var t=this.model,e=t.get("icon",!0),i={};return E(t.get("type",!0),function(t){e[t]&&(i[t]=e[t])}),i},ED.onclick=function(t,e,i){var n=this._brushType,o=this._brushMode;"clear"===i?(e.dispatchAction({type:"axisAreaSelect",intervals:[]}),e.dispatchAction({type:"brush",command:"clear",areas:[]})):e.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:"keep"===i?n:n!==i&&i,brushMode:"keep"===i?"multiple"===o?"single":"multiple":o}})},HT("brush",OD),ff(function(t,e){var i=t&&t.brush;if(k(i)||(i=i?[i]:[]),i.length){var n=[];E(i,function(t){var e=t.hasOwnProperty("toolbox")?t.toolbox:[];e instanceof Array&&(n=n.concat(e))});var o=t&&t.toolbox;k(o)&&(o=o[0]),o||(o={feature:{}},t.toolbox=[o]);var a=o.feature||(o.feature={}),r=a.brush||(a.brush={}),s=r.type||(r.type=[]);s.push.apply(s,n),function(i){var e={};E(i,function(t){e[t]=1}),i.length=0,E(e,function(t,e){i.push(e)})}(s),e&&!s.length&&s.push.apply(s,fD)}}),wf({type:"title",layoutMode:{type:"box",ignoreSize:!0},defaultOption:{zlevel:0,z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bolder",color:"#333"},subtextStyle:{color:"#aaa"}}}),bf({type:"title",render:function(t,e,i){if(this.group.removeAll(),t.get("show")){var n=this.group,o=t.getModel("textStyle"),a=t.getModel("subtextStyle"),r=t.get("textAlign"),s=H(t.get("textBaseline"),t.get("textVerticalAlign")),l=new Fr({style:Qs({},o,{text:t.get("text"),textFill:o.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),h=t.get("subtext"),c=new Fr({style:Qs({},a,{text:h,textFill:a.getTextColor(),y:u.height+t.get("itemGap"),textVerticalAlign:"top"},{disableBox:!0}),z2:10}),d=t.get("link"),f=t.get("sublink"),p=t.get("triggerEvent",!0);l.silent=!d&&!p,c.silent=!f&&!p,d&&l.on("click",function(){window.open(d,"_"+t.get("target"))}),f&&c.on("click",function(){window.open(f,"_"+t.get("subtarget"))}),l.eventData=c.eventData=p?{componentType:"title",componentIndex:t.componentIndex}:null,n.add(l),h&&n.add(c);var g=n.getBoundingRect(),m=t.getBoxLayoutParams();m.width=g.width,m.height=g.height;var v=vu(m,{width:i.getWidth(),height:i.getHeight()},t.get("padding"));r||("middle"===(r=t.get("left")||t.get("right"))&&(r="center"),"right"===r?v.x+=v.width:"center"===r&&(v.x+=v.width/2)),s||("center"===(s=t.get("top")||t.get("bottom"))&&(s="middle"),"bottom"===s?v.y+=v.height:"middle"===s&&(v.y+=v.height/2),s=s||"top"),n.attr("position",[v.x,v.y]);var y={textAlign:r,textVerticalAlign:s};l.setStyle(y),c.setStyle(y),g=n.getBoundingRect();var x=v.margin,_=t.getItemStyle(["color","opacity"]);_.fill=t.get("backgroundColor");var w=new is({shape:{x:g.x-x[3],y:g.y-x[0],width:g.width+x[1]+x[3],height:g.height+x[0]+x[2],r:t.get("borderRadius")},style:_,subPixelOptimize:!0,silent:!0});n.add(w)}}});function zD(t){var e=t.itemStyle||(t.itemStyle={}),i=e.emphasis||(e.emphasis={}),n=t.label||t.label||{},o=n.normal||(n.normal={}),a={normal:1,emphasis:1};E(n,function(t,e){a[e]||RD(o,e)||(o[e]=t)}),i.label&&!RD(n,"emphasis")&&(n.emphasis=i.label,delete i.label)}function RD(t,e){return t.hasOwnProperty(e)}Tu.registerSubTypeDefaulter("timeline",function(){return"slider"}),gf({type:"timelineChange",event:"timelineChanged",update:"prepareAndUpdate"},function(t,e){var i=e.getComponent("timeline");return i&&null!=t.currentIndex&&(i.setCurrentIndex(t.currentIndex),!i.get("loop",!0)&&i.isIndexMax()&&i.setPlayState(!1)),e.resetOption("timeline"),C({currentIndex:i.option.currentIndex},t)}),gf({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},function(t,e){var i=e.getComponent("timeline");i&&null!=t.playState&&i.setPlayState(t.playState)});var BD=Tu.extend({type:"timeline",layoutMode:"box",defaultOption:{zlevel:0,z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},init:function(t,e,i){this._data,this._names,this.mergeDefaultAndTheme(t,i),this._initData()},mergeOption:function(t){BD.superApply(this,"mergeOption",arguments),this._initData()},setCurrentIndex:function(t){null==t&&(t=this.option.currentIndex);var e=this._data.count();this.option.loop?t=(t%e+e)%e:(e<=t&&(t=e-1),t<0&&(t=0)),this.option.currentIndex=t},getCurrentIndex:function(){return this.option.currentIndex},isIndexMax:function(){return this.getCurrentIndex()>=this._data.count()-1},setPlayState:function(t){this.option.autoPlay=!!t},getPlayState:function(){return!!this.option.autoPlay},_initData:function(){var t=this.option,e=t.data||[],i=t.axisType,o=this._names=[];if("category"===i){var a=[];E(e,function(t,e){var i,n=Bo(t);R(t)?(i=D(t)).value=e:i=e,a.push(i),z(n)||null!=n&&!isNaN(n)||(n=""),o.push(n+"")}),e=a}var n={category:"ordinal",time:"time"}[i]||"number";(this._data=new Wf([{name:"value",type:n}],this)).initData(e,o)},getData:function(){return this._data},getCategories:function(){if("category"===this.get("axisType"))return this._names.slice()}});b(BD.extend({type:"timeline.slider",defaultOption:{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"emptyCircle",symbolSize:10,lineStyle:{show:!0,width:2,color:"#304654"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#304654"},itemStyle:{color:"#304654",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:13,color:"#c23531",borderWidth:5,borderColor:"rgba(194,53,49, 0.5)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:22,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"path://M18.6,50.8l22.5-22.5c0.2-0.2,0.3-0.4,0.3-0.7c0-0.3-0.1-0.5-0.3-0.7L18.7,4.4c-0.1-0.1-0.2-0.3-0.2-0.5 c0-0.4,0.3-0.8,0.8-0.8c0.2,0,0.5,0.1,0.6,0.3l23.5,23.5l0,0c0.2,0.2,0.3,0.4,0.3,0.7c0,0.3-0.1,0.5-0.3,0.7l-0.1,0.1L19.7,52 c-0.1,0.1-0.3,0.2-0.5,0.2c-0.4,0-0.8-0.3-0.8-0.8C18.4,51.2,18.5,51,18.6,50.8z",prevIcon:"path://M43,52.8L20.4,30.3c-0.2-0.2-0.3-0.4-0.3-0.7c0-0.3,0.1-0.5,0.3-0.7L42.9,6.4c0.1-0.1,0.2-0.3,0.2-0.5 c0-0.4-0.3-0.8-0.8-0.8c-0.2,0-0.5,0.1-0.6,0.3L18.3,28.8l0,0c-0.2,0.2-0.3,0.4-0.3,0.7c0,0.3,0.1,0.5,0.3,0.7l0.1,0.1L41.9,54 c0.1,0.1,0.3,0.2,0.5,0.2c0.4,0,0.8-0.3,0.8-0.8C43.2,53.2,43.1,53,43,52.8z",color:"#304654",borderColor:"#304654",borderWidth:1},emphasis:{label:{show:!0,color:"#c23531"},itemStyle:{color:"#c23531"},controlStyle:{color:"#c23531",borderColor:"#c23531",borderWidth:2}},data:[]}}),Fh);function VD(t,e,i,n){Eg.call(this,t,e,i),this.type=n||"value",this.model=null}var GD=hc.extend({type:"timeline"});VD.prototype={constructor:VD,getLabelModel:function(){return this.model.getModel("label")},isHorizontal:function(){return"horizontal"===this.model.get("orient")}},w(VD,Eg);var FD=A,WD=E,HD=Math.PI;function ZD(t,e,i,n,o,a){var r=e.get("color");o?(o.setColor(r),i.add(o),a&&a.onUpdate(o)):((o=mg(t.get("symbol"),-1,-1,2,2,r)).setStyle("strokeNoScale",!0),i.add(o),a&&a.onCreate(o));var s=e.getItemStyle(["color","symbol","symbolSize"]);o.setStyle(s),n=m({rectHover:!0,z2:100},n,!0);var l=t.get("symbolSize");(l=l instanceof Array?l.slice():[+l,+l])[0]/=2,l[1]/=2,n.scale=l;var u=t.get("symbolOffset");if(u){var h=n.position=n.position||[0,0];h[0]+=Pl(u[0],l[0]),h[1]+=Pl(u[1],l[1])}var c=t.get("symbolRotate");return n.rotation=(c||0)*Math.PI/180||0,o.attr(n),o.updateTransform(),o}function UD(t,e,i,n,o){if(!t.dragging){var a=n.getModel("checkpointStyle"),r=i.dataToCoord(n.getData().get(["value"],e));o||!a.get("animation",!0)?t.attr({position:[r,0]}):(t.stopAnimation(!0),t.animateTo({position:[r,0]},a.get("animationDuration",!0),a.get("animationEasing",!0)))}}GD.extend({type:"timeline.slider",init:function(t,e){this.api=e,this._axis,this._viewRect,this._timer,this._currentPointer,this._mainGroup,this._labelGroup},render:function(e,t,i,n){if(this.model=e,this.api=i,this.ecModel=t,this.group.removeAll(),e.get("show",!0)){var o=this._layout(e,i),a=this._createGroup("mainGroup"),r=this._createGroup("labelGroup"),s=this._axis=this._createAxis(o,e);e.formatTooltip=function(t){return eu(s.scale.getLabel(t))},WD(["AxisLine","AxisTick","Control","CurrentPointer"],function(t){this["_render"+t](o,a,s,e)},this),this._renderAxisLabel(o,r,s,e),this._position(o,e)}this._doPlayStop()},remove:function(){this._clearTimer(),this.group.removeAll()},dispose:function(){this._clearTimer()},_layout:function(t,e){var i=t.get("label.position"),n=t.get("orient"),o=function(t,e){return vu(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()},t.get("padding"))}(t,e);null==i||"auto"===i?i="horizontal"===n?o.y+o.height/2n[1]&&(i=n[1]),i"),o&&(a+=YD(o),null!=i&&(a+=" : ")),null!=i&&(a+=YD(n)),a},getData:function(){return this._data},setData:function(t){this._data=t}});b(qD,Fh),qD.extend({type:"markPoint",defaultOption:{zlevel:0,z:5,symbol:"pin",symbolSize:50,tooltip:{trigger:"item"},label:{show:!0,position:"inside"},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}}});var KD=_;function $D(t,e,i,n,o,a){var r=[],s=lp(e,n)?e.getCalculationInfo("stackResultDimension"):n,l=oC(e,s,t),u=e.indicesOfNearest(s,l)[0];r[o]=e.get(i,u),r[a]=e.get(n,u);var h=El(e.get(n,u));return 0<=(h=Math.min(h,20))&&(r[a]=+r[a].toFixed(h)),r}var JD=T,QD={min:JD($D,"min"),max:JD($D,"max"),average:JD($D,"average")};function tC(t,e){var i=t.getData(),n=t.coordinateSystem;if(e&&!function(t){return!isNaN(parseFloat(t.x))&&!isNaN(parseFloat(t.y))}(e)&&!k(e.coord)&&n){var o=n.dimensions,a=eC(e,i,n,t);if((e=D(e)).type&&QD[e.type]&&a.baseAxis&&a.valueAxis){var r=KD(o,a.baseAxis.dim),s=KD(o,a.valueAxis.dim);e.coord=QD[e.type](i,a.baseDataDim,a.valueDataDim,r,s),e.value=e.coord[s]}else{for(var l=[null!=e.xAxis?e.xAxis:e.radiusAxis,null!=e.yAxis?e.yAxis:e.angleAxis],u=0;u<2;u++)QD[l[u]]&&(l[u]=oC(i,i.mapDimension(o[u]),l[u]));e.coord=l}}return e}function eC(t,e,i,n){var o={};return null!=t.valueIndex||null!=t.valueDim?(o.valueDataDim=null!=t.valueIndex?e.getDimension(t.valueIndex):t.valueDim,o.valueAxis=i.getAxis(function(t,e){var i=t.getData(),n=i.dimensions;e=i.getDimension(e);for(var o=0;oi[o],f=[-h.x,-h.y];e||(f[n]=s.position[n]);var p=[0,0],g=[-c.x,-c.y],m=H(t.get("pageButtonGap",!0),t.get("itemGap",!0));d&&("end"===t.get("pageButtonPosition",!0)?g[n]+=i[o]-c[o]:p[n]+=c[o]+m);g[1-n]+=h[a]/2-c[a]/2,s.attr("position",f),l.attr("position",p),u.attr("position",g);var v={x:0,y:0};if(v[o]=d?i[o]:h[o],v[a]=Math.max(h[a],c[a]),v[r]=Math.min(0,c[r]+g[1-n]),l.__rectSize=i[o],d){var y={x:0,y:0};y[o]=Math.max(i[o]-c[o]-m,0),y[a]=v[a],l.setClipPath(new is({shape:y})),l.__rectSize=y[o]}else u.eachChild(function(t){t.attr({invisible:!0,silent:!0})});var x=this._getPageInfo(t);return null!=x.pageIndex&&sl(s,{position:x.contentPosition},d&&t),this._updatePageInfoView(t,x),v},_pageGo:function(t,e,i){var n=this._getPageInfo(e)[t];null!=n&&i.dispatchAction({type:"legendScroll",scrollDataIndex:n,legendId:e.id})},_updatePageInfoView:function(n,o){var a=this._controllerGroup;E(["pagePrev","pageNext"],function(t){var e=null!=o[t+"DataIndex"],i=a.childOfName(t);i&&(i.setStyle("fill",e?n.get("pageIconColor",!0):n.get("pageIconInactiveColor",!0)),i.cursor=e?"pointer":"default")});var t=a.childOfName("pageText"),e=n.get("pageFormatter"),i=o.pageIndex,r=null!=i?i+1:0,s=o.pageCount;t&&e&&t.setStyle("text",z(e)?e.replace("{current}",r).replace("{total}",s):e({current:r,total:s}))},_getPageInfo:function(t){var e=t.get("scrollDataIndex",!0),i=this.getContentGroup(),n=this._containerGroup.__rectSize,o=t.getOrient().index,a=NC[o],r=OC[o],s=this._findTargetItemIndex(e),l=i.children(),u=l[s],h=l.length,c=h?1:0,d={contentPosition:i.position.slice(),pageCount:c,pageIndex:c-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!u)return d;var f=y(u);d.contentPosition[o]=-f.s;for(var p=s+1,g=f,m=f,v=null;p<=h;++p)(!(v=y(l[p]))&&m.e>g.s+n||v&&!x(v,g.s))&&(g=m.i>g.i?m:v)&&(null==d.pageNextDataIndex&&(d.pageNextDataIndex=g.i),++d.pageCount),m=v;for(p=s-1,g=f,m=f,v=null;-1<=p;--p)(v=y(l[p]))&&x(m,v.s)||!(g.i=e&&t.s<=e+n}},_findTargetItemIndex:function(n){var o,a,t=this.getContentGroup();return this._showController&&t.eachChild(function(t,e){var i=t.__legendDataIndex;null==a&&null!=i&&(a=e),i===n&&(o=e)}),null!=o?o:a}});gf("legendScroll","legendscroll",function(t,e){var i=t.scrollDataIndex;null!=i&&e.eachComponent({mainType:"legend",subType:"scroll",query:t},function(t){t.setScrollDataIndex(i)})});WA.extend({type:"dataZoom.slider",layoutMode:"box",defaultOption:{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#2f4554",width:.5,opacity:.3},areaStyle:{color:"rgba(47,69,84,0.3)",opacity:.3}},borderColor:"#ddd",fillerColor:"rgba(167,183,204,0.4)",handleIcon:"M8.2,13.6V3.9H6.3v9.7H3.1v14.9h3.3v9.7h1.8v-9.7h3.3V13.6H8.2z M9.7,24.4H4.8v-1.4h4.9V24.4z M9.7,19.1H4.8v-1.4h4.9V19.1z",handleSize:"100%",handleStyle:{color:"#a7b7cc"},labelPrecision:null,labelFormatter:null,showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#333"}}});var zC=is,RC=kl,BC=Ol,VC=A,GC=E,FC="horizontal",WC="vertical",HC=["line","bar","candlestick","scatter"],ZC=UA.extend({type:"dataZoom.slider",init:function(t,e){this._displayables={},this._orient,this._range,this._handleEnds,this._size,this._handleWidth,this._handleHeight,this._location,this._dragging,this._dataShadowInfo,this.api=e},render:function(t,e,i,n){ZC.superApply(this,"render",arguments),Tc(this,"_dispatchZoomAction",this.dataZoomModel.get("throttle"),"fixRate"),this._orient=t.get("orient"),!1!==this.dataZoomModel.get("show")?(n&&"dataZoom"===n.type&&n.from===this.uid||this._buildView(),this._updateView()):this.group.removeAll()},remove:function(){ZC.superApply(this,"remove",arguments),Ac(this,"_dispatchZoomAction")},dispose:function(){ZC.superApply(this,"dispose",arguments),Ac(this,"_dispatchZoomAction")},_buildView:function(){var t=this.group;t.removeAll(),this._resetLocation(),this._resetInterval();var e=this._displayables.barGroup=new Ii;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),t.add(e),this._positionGroup()},_resetLocation:function(){var t=this.dataZoomModel,e=this.api,i=this._findCoordRect(),n={width:e.getWidth(),height:e.getHeight()},o=this._orient===FC?{right:n.width-i.x-i.width,top:n.height-30-7,width:i.width,height:30}:{right:7,top:i.y,width:30,height:i.height},a=_u(t.option);E(["right","top","width","height"],function(t){"ph"===a[t]&&(a[t]=o[t])});var r=vu(a,n,t.padding);this._location={x:r.x,y:r.y},this._size=[r.width,r.height],this._orient===WC&&this._size.reverse()},_positionGroup:function(){var t=this.group,e=this._location,i=this._orient,n=this.dataZoomModel.getFirstTargetAxisModel(),o=n&&n.get("inverse"),a=this._displayables.barGroup,r=(this._dataShadowInfo||{}).otherAxisInverse;a.attr(i!==FC||o?i===FC&&o?{scale:r?[-1,1]:[-1,-1]}:i!==WC||o?{scale:r?[-1,-1]:[-1,1],rotation:Math.PI/2}:{scale:r?[1,-1]:[1,1],rotation:Math.PI/2}:{scale:r?[1,1]:[1,-1]});var s=t.getBoundingRect([a]);t.attr("position",[e.x-s.x,e.y-s.y])},_getViewExtent:function(){return[0,this._size[0]]},_renderBackground:function(){var t=this.dataZoomModel,e=this._size,i=this._displayables.barGroup;i.add(new zC({silent:!0,shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:t.get("backgroundColor")},z2:-40})),i.add(new zC({shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:"transparent"},z2:0,onclick:A(this._onClickPanelClick,this)}))},_renderDataShadow:function(){var t=this._dataShadowInfo=this._prepareDataShadowInfo();if(t){var e=this._size,i=t.series,n=i.getRawData(),o=i.getShadowDim?i.getShadowDim():t.otherDim;if(null!=o){var a=n.getDataExtent(o),r=.3*(a[1]-a[0]);a=[a[0]-r,a[1]+r];var s,l=[0,e[1]],u=[0,e[0]],h=[[e[0],0],[0,0]],c=[],d=u[1]/(n.count()-1),f=0,p=Math.round(n.count()/e[0]);n.each([o],function(t,e){if(0e[0]||i[1]<0||i[1]>e[1])){var n=this._handleEnds,o=(n[0]+n[1])/2,a=this._updateInterval("all",i[0]-o);this._updateView(),a&&this._dispatchZoomAction()}},_dispatchZoomAction:function(){var t=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,start:t[0],end:t[1]})},_findCoordRect:function(){var i;if(GC(this.getTargetCoordInfo(),function(t){if(!i&&t.length){var e=t[0].model.coordinateSystem;i=e.getRect&&e.getRect()}}),!i){var t=this.api.getWidth(),e=this.api.getHeight();i={x:.2*t,y:.2*e,width:.6*t,height:.6*e}}return i}});function UC(t){return"vertical"===t?"ns-resize":"ew-resize"}WA.extend({type:"dataZoom.inside",defaultOption:{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}});var XC="\0_ec_dataZoom_roams";function YC(t,n){var e=qC(t),o=n.dataZoomId,a=n.coordId;E(e,function(t,e){var i=t.dataZoomInfos;i[o]&&_(n.allCoordIds,a)<0&&(delete i[o],t.count--)}),KC(e);var i=e[a];i||((i=e[a]={coordId:a,dataZoomInfos:{},count:0}).controller=function(t,r){var e=new Ly(t.getZr());return E(["pan","zoom","scrollMove"],function(a){e.on(a,function(n){var o=[];E(r.dataZoomInfos,function(t){if(n.isAvailableBehavior(t.dataZoomModel.option)){var e=(t.getRange||{})[a],i=e&&e(r.controller,n);!t.dataZoomModel.get("disabled",!0)&&i&&o.push({dataZoomId:t.dataZoomId,start:i[0],end:i[1]})}}),o.length&&r.dispatchAction(o)})}),e}(t,i),i.dispatchAction=T($C,t)),i.dataZoomInfos[o]||i.count++,i.dataZoomInfos[o]=n;var r=function(t){var n,o={type_true:2,type_move:1,type_false:0,type_undefined:-1},a=!0;return E(t,function(t){var e=t.dataZoomModel,i=!e.get("disabled",!0)&&(!e.get("zoomLock",!0)||"move");o["type_"+n]"],k(t)&&(t=t.slice(),n=!0),o=e?t:n?[u(t[0]),u(t[1])]:u(t),z(l)?l.replace("{value}",n?o[0]:o).replace("{value2}",n?o[1]:o):O(l)?n?l(t[0],t[1]):l(t):n?t[0]===s[0]?i[0]+" "+o[1]:t[1]===s[1]?i[1]+" "+o[0]:o[0]+" - "+o[1]:o;function u(t){return t===s[0]?"min":t===s[1]?"max":(+t).toFixed(Math.min(r,20))}},resetExtent:function(){var t=this.option,e=pL([t.min,t.max]);this._dataExtent=e},getDataDimension:function(t){var e=this.option.dimension,i=t.dimensions;if(null!=e||i.length){if(null!=e)return t.getDimension(e);for(var n=t.dimensions,o=n.length-1;0<=o;o--){var a=n[o];if(!t.getDimensionInfo(a).isCalculationCoord)return a}}},getExtent:function(){return this._dataExtent.slice()},completeVisualOption:function(){var t=this.ecModel,e=this.option,i={inRange:e.inRange,outOfRange:e.outOfRange},n=e.target||(e.target={}),o=e.controller||(e.controller={});m(n,i),m(o,i);var u=this.isCategory();function a(n){dL(e.color)&&!n.inRange&&(n.inRange={color:e.color.slice().reverse()}),n.inRange=n.inRange||{color:t.get("gradientColor")},fL(this.stateList,function(t){var e=n[t];if(z(e)){var i=lL(e,"active",u);i?(n[t]={},n[t][e]=i):delete n[t]}},this)}a.call(this,n),a.call(this,o),function(t,e,i){var n=t[e],o=t[i];n&&!o&&(o=t[i]={},fL(n,function(t,e){if(a_.isValidType(e)){var i=lL(e,"inactive",u);null!=i&&(o[e]=i,"color"!==e||o.hasOwnProperty("opacity")||o.hasOwnProperty("colorAlpha")||(o.opacity=[0,0]))}}))}.call(this,n,"inRange","outOfRange"),function(a){var r=(a.inRange||{}).symbol||(a.outOfRange||{}).symbol,s=(a.inRange||{}).symbolSize||(a.outOfRange||{}).symbolSize,l=this.get("inactiveColor");fL(this.stateList,function(t){var e=this.itemSize,i=a[t];null==(i=i||(a[t]={color:u?l:[l]})).symbol&&(i.symbol=r&&D(r)||(u?"roundRect":["roundRect"])),null==i.symbolSize&&(i.symbolSize=s&&D(s)||(u?e[0]:[e[0],e[0]])),i.symbol=hL(i.symbol,function(t){return"none"===t||"square"===t?"roundRect":t});var n=i.symbolSize;if(null!=n){var o=-1/0;cL(n,function(t){oe[1]&&e.reverse(),e[0]=Math.max(e[0],t[0]),e[1]=Math.min(e[1],t[1]))},completeVisualOption:function(){mL.prototype.completeVisualOption.apply(this,arguments),E(this.stateList,function(t){var e=this.option.controller[t].symbolSize;e&&e[0]!==e[1]&&(e[0]=0)},this)},setSelected:function(t){this.option.range=t.slice(),this._resetRange()},getSelected:function(){var t=this.getExtent(),e=Ol((this.get("range")||[]).slice());return e[0]>t[1]&&(e[0]=t[1]),e[1]>t[1]&&(e[1]=t[1]),e[0]=i[1]||t<=e[1])?"inRange":"outOfRange"},findTargetDataIndices:function(n){var o=[];return this.eachTargetSeries(function(t){var i=[],e=t.getData();e.each(this.getDataDimension(e),function(t,e){n[0]<=t&&t<=n[1]&&i.push(e)},this),o.push({seriesId:t.id,dataIndex:i})},this),o},getVisualMeta:function(i){var t=xL(this,"outOfRange",this.getExtent()),e=xL(this,"inRange",this.option.range.slice()),n=[];function o(t,e){n.push({value:t,color:i(t,e)})}for(var a=0,r=0,s=e.length,l=t.length;rt[1])break;i.push({color:this.getControllerVisual(a,"color",e),offset:o/100})}return i.push({color:this.getControllerVisual(t[1],"color",e),offset:1}),i},_createBarPoints:function(t,e){var i=this.visualMapModel.itemSize;return[[i[0]-e[0],t[0]],[i[0],t[0]],[i[0],t[1]],[i[0]-e[1],t[1]]]},_createBarGroup:function(t){var e=this._orient,i=this.visualMapModel.get("inverse");return new Ii("horizontal"!==e||i?"horizontal"===e&&i?{scale:"bottom"===t?[-1,1]:[1,1],rotation:-Math.PI/2}:"vertical"!==e||i?{scale:"left"===t?[1,1]:[-1,1]}:{scale:"left"===t?[1,-1]:[-1,-1]}:{scale:"bottom"===t?[1,1]:[-1,1],rotation:Math.PI/2})},_updateHandle:function(n,o){if(this._useHandle){var a=this._shapes,r=this.visualMapModel,s=a.handleThumbs,l=a.handleLabels;ML([0,1],function(t){var e=s[t];e.setStyle("fill",o.handlesColor[t]),e.position[1]=n[t];var i=hl(a.handleLabelPoints[t],ul(e,this.group));l[t].setStyle({x:i[0],y:i[1],text:r.formatValueText(this._dataInterval[t]),textVerticalAlign:"middle",textAlign:this._applyTransform("horizontal"===this._orient?0===t?"bottom":"top":"left",a.barGroup)})},this)}},_showIndicator:function(t,e,i,n){var o=this.visualMapModel,a=o.getExtent(),r=o.itemSize,s=[0,r[1]],l=SL(t,a,s,!0),u=this._shapes,h=u.indicator;if(h){h.position[1]=l,h.attr("invisible",!1),h.setShape("points",function(t,e,i,n){return t?[[0,-IL(e,TL(i,0))],[6,0],[0,IL(e,TL(n-i,0))]]:[[0,0],[5,-5],[5,5]]}(!!i,n,l,r[1]));var c=this.getControllerVisual(t,"color",{convertOpacityToAlpha:!0});h.setStyle("fill",c);var d=hl(u.indicatorLabelPoint,ul(h,this.group)),f=u.indicatorLabel;f.attr("invisible",!1);var p=this._applyTransform("left",u.barGroup),g=this._orient;f.setStyle({text:(i||"")+o.formatValueText(e),textVerticalAlign:"horizontal"===g?p:"middle",textAlign:"horizontal"===g?"center":p,x:d[0],y:d[1]})}},_enableHoverLinkToSeries:function(){var n=this;this._shapes.barGroup.on("mousemove",function(t){if(n._hovering=!0,!n._dragging){var e=n.visualMapModel.itemSize,i=n._applyTransform([t.offsetX,t.offsetY],n._shapes.barGroup,!0,!0);i[1]=IL(TL(0,i[1]),e[1]),n._doHoverLinkToSeries(i[1],0<=i[0]&&i[0]<=e[0])}}).on("mouseout",function(){n._hovering=!1,n._dragging||n._clearHoverLinkToSeries()})},_enableHoverLinkFromSeries:function(){var t=this.api.getZr();this.visualMapModel.option.hoverLink?(t.on("mouseover",this._hoverLinkFromSeriesMouseOver,this),t.on("mouseout",this._hideIndicator,this)):this._clearHoverLinkFromSeries()},_doHoverLinkToSeries:function(t,e){var i=this.visualMapModel,n=i.itemSize;if(i.option.hoverLink){var o=[0,n[1]],a=i.getExtent();t=IL(TL(o[0],t),o[1]);var r=function(t,e,i){var n=6,o=t.get("hoverLinkDataSize");o&&(n=SL(o,e,i,!0)/2);return n}(i,a,o),s=[t-r,t+r],l=SL(t,o,a,!0),u=[SL(s[0],o,a,!0),SL(s[1],o,a,!0)];s[0] ",r):this._showIndicator(l,l,"≈ ",r));var h=this._hoverLinkDataIndices,c=[];(e||CL(i))&&(c=this._hoverLinkDataIndices=i.findTargetDataIndices(u));var d=function(t,e){var i={},n={};return o(t||[],i),o(e||[],n,i),[a(i),a(n)];function o(t,e,i){for(var n=0,o=t.length;ni&&n([i,e[0]],"outOfRange"),n(e.slice()),i=e[1])},this),{stops:a,outerColors:r}}function n(t,e){var i=s.getRepresentValue({interval:t});e=e||s.getValueState(i);var n=o(i,e);t[0]===-1/0?r[0]=n:t[1]===1/0?r[1]=n:a.push({value:t[0],color:n},{value:t[1],color:n})}}}),PL={splitNumber:function(){var t=this.option,e=this._pieceList,i=Math.min(t.precision,20),n=this.getExtent(),o=t.splitNumber;o=Math.max(parseInt(o,10),1),t.splitNumber=o;for(var a=(n[1]-n[0])/o;+a.toFixed(i)!==a&&i<5;)i++;t.precision=i,a=+a.toFixed(i);var r=0;t.minOpen&&e.push({index:r++,interval:[-1/0,n[0]],close:[0,0]});for(var s=n[0],l=r+o;r","≥"][e[0]]];t.text=t.text||this.formatValueText(null!=t.value?t.value:t.interval,!1,i)},this)}};function NL(t,e){var i=t.inverse;("vertical"===t.orient?!i:i)&&e.reverse()}_L.extend({type:"visualMap.piecewise",doRender:function(){var a=this.group;a.removeAll();var r=this.visualMapModel,s=r.get("textGap"),t=r.textStyleModel,l=t.getFont(),u=t.getTextColor(),h=this._getItemAlign(),c=r.itemSize,e=this._getViewData(),i=e.endsText,d=W(r.get("showLabel",!0),!i);i&&this._renderEndsText(a,i[0],c,d,h),E(e.viewPieceList,function(t){var e=t.piece,i=new Ii;i.onclick=A(this._onItemClick,this,e),this._enableHoverLink(i,t.indexInModelPieceList);var n=r.getRepresentValue(e);if(this._createItemSymbol(i,n,[0,0,c[0],c[1]]),d){var o=this.visualMapModel.getValueState(n);i.add(new Fr({style:{x:"right"===h?-s:c[0]+s,y:c[1]/2,text:e.text,textVerticalAlign:"middle",textAlign:h,textFont:l,textFill:u,opacity:"outOfRange"===o?.5:1}}))}a.add(i)},this),i&&this._renderEndsText(a,i[1],c,d,h),mu(r.get("orient"),a,r.get("itemGap")),this.renderBackground(a),this.positionGroup(a)},_enableHoverLink:function(t,i){function e(t){var e=this.visualMapModel;e.option.hoverLink&&this.api.dispatchAction({type:t,batch:bL(e.findTargetDataIndices(i),e)})}t.on("mouseover",A(e,this,"highlight")).on("mouseout",A(e,this,"downplay"))},_getItemAlign:function(){var t=this.visualMapModel,e=t.option;if("vertical"===e.orient)return wL(t,this.api,t.itemSize);var i=e.align;return i&&"auto"!==i||(i="left"),i},_renderEndsText:function(t,e,i,n,o){if(e){var a=new Ii,r=this.visualMapModel.textStyleModel;a.add(new Fr({style:{x:n?"right"===o?i[0]:0:i[0]/2,y:i[1]/2,textVerticalAlign:"middle",textAlign:n?o:"center",text:e,textFont:r.getFont(),textFill:r.getTextColor()}})),t.add(a)}},_getViewData:function(){var t=this.visualMapModel,e=N(t.getPieceList(),function(t,e){return{piece:t,indexInModelPieceList:e}}),i=t.get("text"),n=t.get("orient"),o=t.get("inverse");return("horizontal"===n?o:!o)?e.reverse():i=i&&i.slice().reverse(),{viewPieceList:e,endsText:i}},_createItemSymbol:function(t,e,i){t.add(mg(this.getControllerVisual(e,"symbol"),i[0],i[1],i[2],i[3],this.getControllerVisual(e,"color")))},_onItemClick:function(t){var e=this.visualMapModel,i=e.option,n=D(i.selected),o=e.getSelectedMapKey(t);"single"===i.selectedMode?(n[o]=!0,E(n,function(t,e){n[e]=e===o})):n[o]=!n[o],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:n})}});ff(iL);var OL,EL="urn:schemas-microsoft-com:vml",zL="undefined"==typeof window?null:window,RL=!1,BL=zL&&zL.document;function VL(t){return OL(t)}if(BL&&!v.canvasSupported)try{BL.namespaces.zrvml||BL.namespaces.add("zrvml",EL),OL=function(t){return BL.createElement("')}}catch(t){OL=function(t){return BL.createElement("<"+t+' xmlns="'+EL+'" class="zrvml">')}}var GL,FL=ir.CMD,WL=Math.round,HL=Math.sqrt,ZL=Math.abs,UL=Math.cos,XL=Math.sin,YL=Math.max;if(!v.canvasSupported){var jL=",",qL="progid:DXImageTransform.Microsoft",KL=21600,$L=KL/2,JL=function(t){t.style.cssText="position:absolute;left:0;top:0;width:1px;height:1px;",t.coordsize=KL+","+KL,t.coordorigin="0,0"},QL=function(t,e,i){return"rgb("+[t,e,i].join(",")+")"},tk=function(t,e){e&&t&&e.parentNode!==t&&t.appendChild(e)},ek=function(t,e){e&&t&&e.parentNode===t&&t.removeChild(e)},ik=function(t,e,i){return 1e5*(parseFloat(t)||0)+1e3*(parseFloat(e)||0)+i},nk=Hn,ok=function(t,e,i){var n=Re(e);i=+i,isNaN(i)&&(i=1),n&&(t.color=QL(n[0],n[1],n[2]),t.opacity=i*n[3])},ak=function(t,e,i,n){var o="fill"===e,a=t.getElementsByTagName(e)[0];null!=i[e]&&"none"!==i[e]&&(o||!o&&i.lineWidth)?(t[o?"filled":"stroked"]="true",i[e]instanceof ss&&ek(t,a),a=a||VL(e),o?function(t,e,i){var n,o,a=e.fill;if(null!=a)if(a instanceof ss){var r,s=0,l=[0,0],u=0,h=1,c=i.getBoundingRect(),d=c.width,f=c.height;if("linear"===a.type){r="gradient";var p=i.transform,g=[a.x*d,a.y*f],m=[a.x2*d,a.y2*f];p&&(bt(g,g,p),bt(m,m,p));var v=m[0]-g[0],y=m[1]-g[1];(s=180*Math.atan2(v,y)/Math.PI)<0&&(s+=360),s<1e-6&&(s=0)}else{r="gradientradial";g=[a.x*d,a.y*f],p=i.transform;var x=i.scale,_=d,w=f;l=[(g[0]-c.x)/_,(g[1]-c.y)/w],p&&bt(g,g,p),_/=x[0]*KL,w/=x[1]*KL;var b=YL(_,w);u=0/b,h=2*a.r/b-u}var S=a.colorStops.slice();S.sort(function(t,e){return t.offset-e.offset});for(var M=S.length,I=[],T=[],A=0;A=c&&d<=i+1){for(var n=[],o=0;o=c&&d<=o+1)return jk(h,e.components,u,l);p[t]=e}else p[t]=void 0}var s;f++}for(;f<=e;){var r=a();if(r)return r}},pushComponent:function(t,e,i){var n=t[t.length-1];n&&n.added===e&&n.removed===i?t[t.length-1]={count:n.count+1,added:e,removed:i}:t.push({count:1,added:e,removed:i})},extractCommon:function(t,e,i,n){for(var o=e.length,a=i.length,r=t.newPos,s=r-n,l=0;r+1 { + Object.defineProperty(ctx, style, { + set: value => { + if (style !== 'fillStyle' && style !== 'strokeStyle' + || value !== 'none' && value !== null + ) { + ctx['set' + style.charAt(0).toUpperCase() + style.slice(1)](value); + } + } + }); + }); + + ctx.createRadialGradient = () => { + return ctx.createCircularGradient(arguments); + }; + } + + _initEvent() { + this.event = {}; + const eventNames = [{ + wxName: 'touchStart', + ecName: 'mousedown' + }, { + wxName: 'touchMove', + ecName: 'mousemove' + }, { + wxName: 'touchEnd', + ecName: 'mouseup' + }, { + wxName: 'touchEnd', + ecName: 'click' + }]; + + eventNames.forEach(name => { + this.event[name.wxName] = e => { + const touch = e.touches[0]; + this.chart.getZr().handler.dispatch(name.ecName, { + zrX: name.wxName === 'tap' ? touch.clientX : touch.x, + zrY: name.wxName === 'tap' ? touch.clientY : touch.y + }); + }; + }); + } +} diff --git a/miniprogram/tcb-demo-sports/miniprogram/image/share.png b/miniprogram/tcb-demo-sports/miniprogram/image/share.png new file mode 100644 index 0000000000000000000000000000000000000000..ebcb1f3e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ODAneo@)G$PzvZz{%abk#i>#_f+=OTDXl1wUshKEe1t_pVPa;Y&Pe zR9L-+;(RZsY>6~yQim|{f_m7`tB$a} zw}#;)anZ?VZCwrT!>{d(p%t5ADKBe!$(1}Yie9;G4yF6FM}N~6m(A6U)K@!*8J+O8 z^Nl2>Zo1(T*O?m7&`U;b~7waNl@t&g0@~JA<#y(KzaIJ40~O)s>GtKC?Za^8N0M zC(EbIUwAP`{lrXHw`p(IEMN?}Yo%Dt8|C+{y6x}xFBhUUt&_X?o(tXa(hZvPdOzbT zmf7)4rdd0j<$wvs{l*_54teI`vkr&mD~qB84^6oAn!RBo&#+s=MDwttWTjVG$3J`f YRm)d}UfwAOJimp()78&qol`;+0Hg2b9smFU literal 0 HcmV?d00001 diff --git a/miniprogram/tcb-demo-sports/miniprogram/pages/edit/edit.js b/miniprogram/tcb-demo-sports/miniprogram/pages/edit/edit.js new file mode 100644 index 0000000..ac6ee83 --- /dev/null +++ b/miniprogram/tcb-demo-sports/miniprogram/pages/edit/edit.js @@ -0,0 +1,164 @@ +const app = getApp(); +var that = null; +Page({ + data:{ + img:null, + text:"", + inrule:false + }, + onLoad(){ + that = this; + this.setData({ + img:app.globalData.rundata.runimg, + text:app.globalData.rundata.runtext, + inrule:app.globalData.rundata.runinrule + }) + }, + previewimg(){ + wx.previewImage({ + urls: [that.data.img] + }) + }, + uploadimg(){ + this.oldimg=that.data.img; + wx.chooseImage({ + count:1, + sizeType:['compressed'], + success(res){ + that.setData({ + img:res.tempFilePaths[0] + }); + wx.showLoading({ + title: '上传中', + mask:true + }) + that.uploadtourl(res.tempFilePaths[0]); + } + }) + }, + uploadtourl(file){ + wx.cloud.uploadFile({ + cloudPath: 'run/'+app.globalData.rundata.id+new Date().getTime()+'.png', + filePath: file, + success: res => { + let fileimg = res.fileID; + wx.cloud.callFunction({ + name:'saveimg', + data:{ + img:fileimg + }, + success:res=>{ + wx.hideLoading(); + if(res.result.code==0){ + wx.showToast({ + title: '上传成功' + }) + that.setData({ + img:res.result.img + }) + } + else if(res.result.code==1){ + wx.showModal({ + title:'安全提示', + content:'你上传的图片内容不安全,请更换图片上传或者重新尝试', + showCancel:false + }) + console.log(res.result.img) + that.setData({ + img:res.result.img + }) + } + else{ + wx.navigateBack({ + delta:1 + }) + } + }, + fail:err=>{ + console.log(err); + wx.hideLoading(); + that.setData({ + img:that.oldimg + }) + wx.showModal({ + title:'网络错误', + content:'网络出现问题,请检查网络后重新尝试', + showCancel:false + }) + wx.cloud.deleteFile({ + fileList: [fileimg] + }) + } + }); + }, + fail: err => { + console.log(err); + wx.hideLoading(); + that.setData({ + img:that.oldimg + }) + wx.showModal({ + title:'上传错误', + content:'封面上传失败,请检查网络后重新尝试!', + showCancel:false + }) + } + }) + }, + inmytext(e){ + this.setData({ + text:e.detail.value + }) + }, + startset(e){ + this.setData({ + inrule:e.detail.value + }) + }, + save(e){ + if(e.detail.errMsg=='getUserInfo:ok'){ + wx.showLoading({ + title:"保存中", + mask:true + }) + wx.cloud.callFunction({ + name:"savetext", + data:{ + text:that.data.text, + inrule:that.data.inrule, + Info:e.detail.userInfo + }, + success:res=>{ + wx.hideLoading(); + if(res.result.code==0){ + wx.showToast({ + title: '保存成功', + }) + } + else{ + wx.showModal({ + title:'安全提示', + content:'你输入的内容不安全,请改正内容或者重新尝试', + showCancel:false + }) + } + }, + fail: err => { + console.log(err); + wx.hideLoading(); + wx.showModal({ + title:'网络错误', + content:'网络出现问题,请检查网络后重新尝试', + showCancel:false + }) + } + }) + } + else{ + wx.showModal({ + title:"提示", + content:'应用获取你的信息为了更好的展示处理信息,不会外泄你的数据' + }) + } + } +}) \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/miniprogram/pages/edit/edit.json b/miniprogram/tcb-demo-sports/miniprogram/pages/edit/edit.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/miniprogram/tcb-demo-sports/miniprogram/pages/edit/edit.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/miniprogram/pages/edit/edit.wxml b/miniprogram/tcb-demo-sports/miniprogram/pages/edit/edit.wxml new file mode 100644 index 0000000..c7b8fe9 --- /dev/null +++ b/miniprogram/tcb-demo-sports/miniprogram/pages/edit/edit.wxml @@ -0,0 +1,17 @@ + + + + + + 加入运动排行榜 + + + 长按图片可更换,点击可预览 + + diff --git a/miniprogram/tcb-demo-sports/miniprogram/pages/edit/edit.wxss b/miniprogram/tcb-demo-sports/miniprogram/pages/edit/edit.wxss new file mode 100644 index 0000000..9993865 --- /dev/null +++ b/miniprogram/tcb-demo-sports/miniprogram/pages/edit/edit.wxss @@ -0,0 +1,51 @@ +button{ + background-color: #ff2245; + color: white; + width: 300rpx; + height: 40px; + line-height: 40px; + font-size: 12px; + padding: 0; + letter-spacing: 2px; + border-radius: 3px; +} +.myupimg{ + margin: 20px 0; +} +.mytext{ + background-color: #2D313C; + width: 690rpx; + padding: 30rpx 30rpx; + color:white; + font-size: 13px; + height: 70px; +} +.topimage{ + width: 100%; + height: 450rpx; + /* filter: blur(3px); */ +} +.setitem{ + width: 100%; + margin-top: 10px; + display: flex; + height: 100rpx; + background-color: #2D313C; + } +.setitem_name{ + margin-left: 30rpx; + height: 50px; + font-size: 13px; + color:white; + line-height: 100rpx; + } +.setitem_switch{ + margin: auto; + margin-right: 30rpx; + } + .tips{ + color: #8c8D90; + font-size: 11px; + margin-top: 10px; + padding-left: 10px; + } \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/miniprogram/pages/index/index.js b/miniprogram/tcb-demo-sports/miniprogram/pages/index/index.js new file mode 100644 index 0000000..dedc834 --- /dev/null +++ b/miniprogram/tcb-demo-sports/miniprogram/pages/index/index.js @@ -0,0 +1,251 @@ +const app = getApp(); +import * as echarts from '../../ec-canvas/echarts'; +var that=null; +var today=null; + +Page({ + data:{ + ec: { + lazyLoad: true + }, + today:parseInt(new Date(new Date().toLocaleDateString()).getTime()/1000), + chartload:false + }, + onLoad(options){ + that = this; + let old = wx.getStorageSync('RunData'); + if(old!=""||old!=null){ + this.setData(old); + } + }, + onShow(){ + this.init(); + }, + onReady(){ + this.Loadcharts(()=>{}); + }, + onPullDownRefresh(){ + this.init(); + }, + init(){ + wx.showNavigationBarLoading(); + app.initRun({ + success(res){ + wx.hideNavigationBarLoading(); + wx.stopPullDownRefresh() + that.setData(app.globalData.rundata); + if(app.globalData.rundata.runauth==true){ + console.log('更新运动数据') + that.GetRunData(); + } + else{ + that.setData({ + chartload:false + }) + } + }, + fail(e){ + wx.hideNavigationBarLoading(); + wx.stopPullDownRefresh() + } + }) + }, + Scope(scope,doit,fail){ + wx.getSetting({ + success(setres) { + if (!setres.authSetting[scope]) { + console.log('2') + wx.authorize({ + scope: scope, + success () { + doit() + }, + fail(e){ + wx.hideNavigationBarLoading(); + wx.hideLoading(); + fail(); + } + }) + } + else{ + doit() + } + } + }) + }, + toGetRunData(){ + wx.showLoading({ + title: '载入运动数据', + }) + this.GetRunData(); + }, + GetRunData(){ + this.Scope("scope.werun",function(){ + wx.getWeRunData({ + success (authres) { + const cloudID = authres.cloudID + that.GetRunDataCall(wx.cloud.CloudID(cloudID),function(callres){ + that.setData({ + rundata:callres.result, + runauth:true + }) + that.LoadRunData(callres.result); + wx.hideNavigationBarLoading(); + }) + } + }) + },function(){ + wx.setStorageSync('RunFlag', false); + wx.showModal({t:'', + title:'提示', + content:'应用需要你的运动步数数据用于趋势记录和生成你的分享图,不会用于其他场景和服务。没有数据你也可以浏览他人的分享,但是你不能发起分享。', + confirmText:'重新授权', + success(e){ + if(e.confirm){ + wx.openSetting({ + success (res) { + if(res.authSetting['scope.werun']==true){ + wx.showNavigationBarLoading() + that.GetRunData(); + } + else{ + that.GetRunDataCall(null,()=>{ + that.init(); + }); + } + } + }) + } + if(e.cancel){ + that.GetRunDataCall(null,()=>{ + that.init(); + }); + } + } + }) + that.setData({ + RunFlag:false + }) + }) + }, + GetRunDataCall(mess,succ){ + wx.cloud.callFunction({ + name:"getRun", + data:{ + mess:mess + }, + success(callres){ + succ(callres); + }, + fail(calle){ + console.log(calle); + }, + complete(){ + wx.hideLoading() + } + }) + }, + LoadRunData(rundata){ + let now=new Date(new Date().toLocaleDateString()); + let Rdata=[]; + let Rdate=[]; + let Rmin=0; + for(let i =6;i>=0;i--){ + let tim = new Date(now.getTime()-86400000*i); + let runtemp = rundata[parseInt(tim.getTime()/1000)]; + let runitem = runtemp?runtemp.step:0; + if(runitem!=null&&runitem { + const chart = echarts.init(canvas, null, { + width: width, + height: height + }); + this.chart = chart; + this.setData({ + chartload:true + }) + succ(); + return chart; + }); + } + }, + setOption(obj){ + var option = { + color: ["#ff2245"], + grid: { + show:false, + left:10, + right:10, + top:20, + bottom:20 + }, + xAxis: { + show: true, + type: 'category', + data: obj.date, + axisLabel:{ + color:"#ffffff", + interval:0 + }, + axisLine:{ + show:false + }, + axisTick:{ + show:false + } + }, + yAxis: { + show:false, + min:obj.min + }, + tooltip: { + trigger: 'axis', + formatter: '{c}', + backgroundColor:'rgba(250,250,250,0.2)' + }, + series: [{ + type: 'line', + smooth: true, + data: obj.data, + }] + }; + if(this.data.chartload){ + console.log('装载') + this.chart.setOption(option); + } + else{ + this.Loadcharts(()=>{ + this.chart.setOption(option); + }) + } + }, + onShareAppMessage(){ + return{ + title:this.data.runtext!=""?this.data.runtext:'TM运动-记录你的每一天', + imageUrl:this.data.runimg?this.data.runimg:"../../image/share.png" + } + }, + tocreate(e){ + wx.navigateTo({ + url: '../edit/edit', + }) + }, + toother(e){ + wx.setStorageSync('tempuser', this.data.other[e.currentTarget.dataset.i]); + wx.navigateTo({ + url: '../show/show' + }) + } +}) \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/miniprogram/pages/index/index.json b/miniprogram/tcb-demo-sports/miniprogram/pages/index/index.json new file mode 100644 index 0000000..1fa04e2 --- /dev/null +++ b/miniprogram/tcb-demo-sports/miniprogram/pages/index/index.json @@ -0,0 +1,6 @@ +{ + "usingComponents": { + "ec-canvas": "/ec-canvas/ec-canvas" + }, + "enablePullDownRefresh":true +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/miniprogram/pages/index/index.wxml b/miniprogram/tcb-demo-sports/miniprogram/pages/index/index.wxml new file mode 100644 index 0000000..b3c6b60 --- /dev/null +++ b/miniprogram/tcb-demo-sports/miniprogram/pages/index/index.wxml @@ -0,0 +1,30 @@ + + + {{rundata[today]?rundata[today].step:0}} + 今日运动步数 + + + 记录你的脚步 + + + + + + + 还没有自己的封面,如何上榜? + + + + + {{runtext}} + + + + + {{index+1}} + + {{item.nickname}} + {{item.Rnow}} + + + \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/miniprogram/pages/index/index.wxss b/miniprogram/tcb-demo-sports/miniprogram/pages/index/index.wxss new file mode 100644 index 0000000..70e35ea --- /dev/null +++ b/miniprogram/tcb-demo-sports/miniprogram/pages/index/index.wxss @@ -0,0 +1,51 @@ +button{ + background-color: #ff2245; + color: white; + width: 300rpx; + height: 40px; + line-height: 40px; + font-size: 12px; + padding: 0; + letter-spacing: 2px; + border-radius: 3px; +} +.getrunbtn{ + margin: 30px 0; +} +.ranklist{ + width: 650rpx; + margin:20px auto 0 auto; + background-color: #2D313C; +} +.rankitem{ + display: flex; + height: 60px; +} +.ranknumber{ + line-height: 60px; + width: 50px; + text-align: center; + color: white; + font-weight: bold; +} +.rankimg{ + width: 45px; + height: 45px; + border-radius: 50%; + margin:auto 5px; +} +.rankname{ + line-height: 60px; + width: 50px; + text-align: center; + color: white; + font-size: 13px; +} +.rankdata{ + line-height: 60px; + text-align: center; + color: #ff2245; + font-weight: bold; + font-size: 20px; + margin:0 10px 0 auto; +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/miniprogram/pages/show/show.js b/miniprogram/tcb-demo-sports/miniprogram/pages/show/show.js new file mode 100644 index 0000000..ca9d130 --- /dev/null +++ b/miniprogram/tcb-demo-sports/miniprogram/pages/show/show.js @@ -0,0 +1,127 @@ +import * as echarts from '../../ec-canvas/echarts'; +var that = null; +Page({ + data:{ + starbtn:false, + starflag:false, + starload:false + }, + onLoad(){ + that=this; + let data=wx.getStorageSync('tempuser'); + this.setData(data); + this.option = this.loadoptions({ + date:data.rundata.Rdate, + data:data.rundata.Rdata, + min:0 + }); + wx.setNavigationBarTitle({ + title: data.nickname+'的运动', + }) + this.init(data._id); + }, + init(id){ + wx.cloud.callFunction({ + name:'tostar', + data:{ + ta:id + }, + success(res){ + that.setData({ + starbtn:res.result.status==2?false:true, + starflag:res.result.status==1?true:false, + starnum:res.result.num + }) + } + }) + }, + onReady(){ + this.Loadcharts(()=>{ + this.chart.setOption(this.option); + }); + }, + Loadcharts(succ){ + this.ecComponent = this.selectComponent('#mychart-dom-line2'); + this.ecComponent.init((canvas, width, height) => { + const chart = echarts.init(canvas, null, { + width: width, + height: height + }); + this.chart = chart; + succ(); + return chart; + }); + }, + loadoptions(obj){ + return { + color: ["#ff2245"], + grid: { + show:false, + left:10, + right:10, + top:20, + bottom:20 + }, + xAxis: { + show: true, + type: 'category', + data: obj.date, + axisLabel:{ + color:"#ffffff", + interval:0 + }, + axisLine:{ + show:false + }, + axisTick:{ + show:false + } + }, + yAxis: { + show:false, + min:obj.min + }, + tooltip: { + trigger: 'axis', + formatter: '{c}', + backgroundColor:'rgba(250,250,250,0.2)' + }, + series: [{ + type: 'line', + smooth: true, + data: obj.data, + }] + }; + }, + topreview(){ + wx.previewImage({ + urls: [this.data.perimg], + }) + }, + tostar(){ + this.setData({ + starload:true + }) + wx.cloud.callFunction({ + name:"setstar", + data:{ + ta:that.data._id, + flag:that.data.starflag + }, + success(res){ + that.setData({ + starbtn:res.result.status==2?false:true, + starflag:res.result.status==1?true:false, + starnum:res.result.num, + starload:false + }) + }, + fail(e){ + console.log(e); + that.setData({ + starload:false + }) + } + }) + } +}) \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/miniprogram/pages/show/show.json b/miniprogram/tcb-demo-sports/miniprogram/pages/show/show.json new file mode 100644 index 0000000..3422ad3 --- /dev/null +++ b/miniprogram/tcb-demo-sports/miniprogram/pages/show/show.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "ec-canvas": "/ec-canvas/ec-canvas" + } +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/miniprogram/pages/show/show.wxml b/miniprogram/tcb-demo-sports/miniprogram/pages/show/show.wxml new file mode 100644 index 0000000..6098bcf --- /dev/null +++ b/miniprogram/tcb-demo-sports/miniprogram/pages/show/show.wxml @@ -0,0 +1,15 @@ + + + {{Rnow}} + 今日运动步数 + + + + + + + {{runtext}} + + + + \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/miniprogram/pages/show/show.wxss b/miniprogram/tcb-demo-sports/miniprogram/pages/show/show.wxss new file mode 100644 index 0000000..c860f90 --- /dev/null +++ b/miniprogram/tcb-demo-sports/miniprogram/pages/show/show.wxss @@ -0,0 +1,10 @@ +.star{ + margin: 20px auto; + min-width: 650rpx; + height: 40px; + line-height: 40px; + font-size: 12px; + padding: 0; + letter-spacing: 2px; + border-radius: 3px; +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/miniprogram/sitemap.json b/miniprogram/tcb-demo-sports/miniprogram/sitemap.json new file mode 100644 index 0000000..ca02add --- /dev/null +++ b/miniprogram/tcb-demo-sports/miniprogram/sitemap.json @@ -0,0 +1,7 @@ +{ + "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", + "rules": [{ + "action": "allow", + "page": "*" + }] +} \ No newline at end of file diff --git a/miniprogram/tcb-demo-sports/project.config.json b/miniprogram/tcb-demo-sports/project.config.json new file mode 100644 index 0000000..a4fa0ee --- /dev/null +++ b/miniprogram/tcb-demo-sports/project.config.json @@ -0,0 +1,62 @@ +{ + "miniprogramRoot": "miniprogram/", + "cloudfunctionRoot": "cloudfunctions/", + "setting": { + "urlCheck": true, + "es6": true, + "postcss": true, + "minified": true, + "newFeature": true, + "enhance": true + }, + "appid": "", + "projectname": "%E8%BF%90%E5%8A%A8%E7%A4%BE%E4%BA%A4%E5%88%86%E4%BA%AB", + "libVersion": "2.8.1", + "simulatorType": "wechat", + "simulatorPluginLibVersion": {}, + "condition": { + "search": { + "current": -1, + "list": [] + }, + "conversation": { + "current": -1, + "list": [] + }, + "plugin": { + "current": -1, + "list": [] + }, + "game": { + "list": [] + }, + "gamePlugin": { + "current": -1, + "list": [] + }, + "miniprogram": { + "current": 0, + "list": [ + { + "id": -1, + "name": "db guide", + "pathName": "pages/databaseGuide/databaseGuide", + "query": "" + }, + { + "id": -1, + "name": "pages/edit/edit", + "pathName": "pages/edit/edit", + "query": "", + "scene": null + }, + { + "id": -1, + "name": "pages/show/show", + "pathName": "pages/show/show", + "scene": null + } + ] + } + } +}