diff --git a/AGENTS.md b/AGENTS.md index 4ace5d0..1a1501a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -56,6 +56,25 @@ - 定时任务注册在 `la_dev_crontab`,通过 `php think crontab` 统一调度。 - MySQL 保留字如 `system`、`order`、`group`、`key` 等写原生 SQL 时必须用反引号包裹。 +### 数据库连接方式 + +测试数据库连接信息位于 `server/.env`(不入库)。连接参数: + +| 配置项 | 值 | +| --- | --- | +| Host | `95.40.220.223` | +| Port | `3300` | +| Database | `sbnews` | +| User | `sbnews` | +| Password | 见 `server/.env` 中 `PASSWORD` 字段 | + +> ⚠️ 安全提醒:密码禁止硬编码到代码或文档中,统一从 `.env` 读取。命令行查询时避免 `-p"密码"` 方式(会暴露在进程列表),改用交互式输入: +> +> ```bash +> mysql -h 95.40.220.223 -P 3300 -u sbnews -p sbnews -e "SELECT ..." +> # 回车后输入密码 +> ``` + ## 代码修改后验证与评审 除非用户特别说明不需要验证,代码修改完成后按改动类型选择验证方式: @@ -109,3 +128,5 @@ - `adminapi/match.match/edit` 写入失败时,先查测试库或线上库表结构,确认 `la_match` 已补齐对应字段,不要只盯业务代码。 - 世界杯专题页、比赛详情页这类前后端联动改动,要统一入口显示规则和跳转目标,避免只改一处导致入口不一致。 - 构建产生的 `server/public/admin`、`server/public/mobile` 等产物不要混进提交,提交前先清理临时截图和生成文件。 +- **uni-app iOS 端 scroll-view+JS 计算高度 间隙问题**:在 iOS(APP-PLUS/MP)端,通过 `uni.createSelectorQuery()` 计算 `windowHeight - topBar - inputBar` 然后设置 `scroll-view` 的 inline `height` 会因安全区域、设备像素比等因素产生几像素偏差,导致 `scroll-view` 底部与固定输入栏之间出现间隙。**正确做法**:页面使用 `height: 100vh; display: flex; flex-direction: column`,topbar 和 input-bar 设 `flex-shrink: 0`,scroll-view 设 `flex: 1; min-height: 0` 自然填满剩余空间,不再用 JS 计算高度。 +- **Vue3 ` - - +[app] onLaunch 执行完毕 +share-popup.vue:67 [Vue warn]: Unhandled error during execution of watcher callback + at +at +at +at +at +at +at +at +at +at +at +share-popup.vue:67 ReferenceError: Cannot access 'init' before initialization + at watch.immediate (share-popup.vue:72:13) + at setup (share-popup.vue:67:1) diff --git a/pc/pages/index.vue b/pc/pages/index.vue index 49f806e..877ca33 100644 --- a/pc/pages/index.vue +++ b/pc/pages/index.vue @@ -52,10 +52,13 @@ diff --git a/qa/backend/test_kb_article_analysis.py b/qa/backend/test_kb_article_analysis.py new file mode 100644 index 0000000..585d602 --- /dev/null +++ b/qa/backend/test_kb_article_analysis.py @@ -0,0 +1,24 @@ +""" +接口验证: 资讯知识库增强 AI 分析 +路径: GET /api/ai/articleAnalysis +""" +import requests + +BASE_URL = "http://127.0.0.1:8000" + + +def test_article_analysis(article_id: int = 1): + resp = requests.get(f"{BASE_URL}/api/ai/articleAnalysis", params={"article_id": article_id}, timeout=30) + assert resp.status_code == 200, resp.text + data = resp.json() + assert data["code"] == 1, data + analysis = data["data"]["analysis"] + assert "summary" in analysis + assert "evidence_list" in analysis + assert "retrieval_meta" in analysis + print("资讯知识库AI分析通过") + + +if __name__ == "__main__": + test_article_analysis() + print("全部通过") diff --git a/qa/backend/test_kb_post_analysis.py b/qa/backend/test_kb_post_analysis.py new file mode 100644 index 0000000..1ac4a4f --- /dev/null +++ b/qa/backend/test_kb_post_analysis.py @@ -0,0 +1,34 @@ +""" +接口验证: 帖子知识库增强 AI 分析 +路径: GET /api/community/aiAnalysis +""" +import requests + +BASE_URL = "http://127.0.0.1:8000" +TOKEN = "" + + +def test_post_analysis(post_id: int = 1): + headers = {"token": TOKEN} if TOKEN else {} + resp = requests.get( + f"{BASE_URL}/api/community/aiAnalysis", + params={"post_id": post_id}, + headers=headers, + timeout=30, + ) + assert resp.status_code == 200, resp.text + data = resp.json() + assert data["code"] in (0, 1), data + if data["code"] == 1: + analysis = data["data"]["analysis"] + assert "summary" in analysis + assert "evidence_list" in analysis + assert "retrieval_meta" in analysis + print("帖子知识库AI分析通过") + else: + print("当前环境需要登录 token,接口返回:", data["msg"]) + + +if __name__ == "__main__": + test_post_analysis() + print("全部通过") diff --git a/qa/screenshots/ai-popup-scroll-test.png b/qa/screenshots/ai-popup-scroll-test.png new file mode 100644 index 0000000..270e10d Binary files /dev/null and b/qa/screenshots/ai-popup-scroll-test.png differ diff --git a/qa/screenshots/community-page.txt b/qa/screenshots/community-page.txt new file mode 100644 index 0000000..7241e66 --- /dev/null +++ b/qa/screenshots/community-page.txt @@ -0,0 +1,81 @@ +uid=3_0 RootWebArea "乐博头条" url="http://localhost:8993/" + uid=3_1 StaticText "" + uid=3_2 StaticText "搜索乐博头条" + uid=3_3 StaticText "推荐" + uid=3_4 StaticText "世界杯" + uid=3_5 StaticText "中超" + uid=3_6 StaticText "英超" + uid=3_7 StaticText "西甲" + uid=3_8 StaticText "法甲" + uid=3_9 StaticText "德甲" + uid=3_10 StaticText "意甲" + uid=3_11 StaticText "CBA" + uid=3_12 StaticText "NBA" + uid=3_13 StaticText "加密资讯" + uid=3_14 StaticText "彩票资讯" + uid=3_1 StaticText "" + uid=3_15 link "冠军体质,坎塞洛成为第一个在四大联赛中夺得联赛冠军的球员 北京时间5月11日,西甲第35轮,巴塞罗那2-0战胜皇家马德里,成功卫冕西甲冠军,坎塞洛也就此成为了第一个获得五大联赛中四个联赛的冠军的球员。此前,坎塞洛曾在曼城获得20-21、21-22、22-23 Aphelios19 @懂球帝 1评论 05-11 05:01" url="http://localhost:8993/pages/news_detail/news_detail?id=1172191" + uid=3_16 StaticText "冠军体质,坎塞洛成为第一个在四大联赛中夺得联赛冠军的球员" + uid=3_17 StaticText "北京时间5月11日,西甲第35轮,巴塞罗那2-0战胜皇家马德里,成功卫冕西甲冠军,坎塞洛也就此成为了第一个获得五大联赛中四个联赛的冠军的球员。此前,坎塞洛曾在曼城获得20-21、21-22、22-23" + uid=3_18 StaticText "Aphelios19 @懂球帝" + uid=3_19 StaticText "1评论" + uid=3_20 StaticText "05-11 05:01" + uid=3_21 link "累积五张黄牌,埃斯图皮尼安将在客战热那亚时被停赛 意甲第36轮主场迎战亚特兰大的比赛中,米兰后卫埃斯图皮尼安在下半场第89分钟因为犯规被主裁判黄牌警告。埃斯图皮尼安在本场比赛的第80分钟才替换巴尔泰萨吉出场,不到10分钟之后他就得到了一张黄牌。这张黄 四条腿的车 @懂球帝 6评论 05-11 05:01" url="http://localhost:8993/pages/news_detail/news_detail?id=1172192" + uid=3_22 StaticText "累积五张黄牌,埃斯图皮尼安将在客战热那亚时被停赛" + uid=3_23 StaticText "意甲第36轮主场迎战亚特兰大的比赛中,米兰后卫埃斯图皮尼安在下半场第89分钟因为犯规被主裁判黄牌警告。埃斯图皮尼安在本场比赛的第80分钟才替换巴尔泰萨吉出场,不到10分钟之后他就得到了一张黄牌。这张黄" + uid=3_24 StaticText "四条腿的车 @懂球帝" + uid=3_25 StaticText "6评论" + uid=3_26 StaticText "05-11 05:01" + uid=3_27 link "剑南春丨米兰2-3不敌亚特兰大,帕夫、恩昆库破门难救主 战报bot 0评论 05-11 06:01" url="http://localhost:8993/pages/news_detail/news_detail?id=1173520" + uid=3_28 StaticText "剑南春丨米兰2-3不敌亚特兰大,帕夫、恩昆库破门难救主" + uid=3_29 StaticText "战报bot" + uid=3_30 StaticText "0评论" + uid=3_31 StaticText "05-11 06:01" + uid=3_32 link "加斯佩里尼:迪巴拉说他续约没进展?我很希望他能再留队一年 在客场3-2逆转帕尔马的赛后,罗马主帅加斯佩里尼出席新闻发布会并答记者问,以下为他的发言实录。谈比赛我觉得所有判罚的细节都非常清楚,我也完全能理解对手的失落感。眼看着一场本以为已经稳拿胜利的比赛,却在 RoronoaZorofree @懂球帝 2评论 05-11 05:01" url="http://localhost:8993/pages/news_detail/news_detail?id=1172194" + uid=3_33 StaticText "加斯佩里尼:迪巴拉说他续约没进展?我很希望他能再留队一年" + uid=3_34 StaticText "在客场3-2逆转帕尔马的赛后,罗马主帅加斯佩里尼出席新闻发布会并答记者问,以下为他的发言实录。谈比赛我觉得所有判罚的细节都非常清楚,我也完全能理解对手的失落感。眼看着一场本以为已经稳拿胜利的比赛,却在" + uid=3_35 StaticText "RoronoaZorofree @懂球帝" + uid=3_36 StaticText "2评论" + uid=3_37 StaticText "05-11 05:01" + uid=3_38 link "科莫主席庆祝队史首次打进欧战:感谢小法,让我们可以逐梦 北京时间5月10日,意甲第36轮,科莫在客场1-0战胜维罗纳。在客场全取3分后,科莫积65分暂时排名意甲第5,领先第7名亚特兰大达10分,从而提前锁定下赛季欧战席位,这也是科莫队史首次进军欧战。赛后, 曼尼菲尔德守护者 @懂球帝 3评论 05-11 04:01" url="http://localhost:8993/pages/news_detail/news_detail?id=1170897" + uid=3_39 StaticText "科莫主席庆祝队史首次打进欧战:感谢小法,让我们可以逐梦" + uid=3_40 StaticText "北京时间5月10日,意甲第36轮,科莫在客场1-0战胜维罗纳。在客场全取3分后,科莫积65分暂时排名意甲第5,领先第7名亚特兰大达10分,从而提前锁定下赛季欧战席位,这也是科莫队史首次进军欧战。赛后," + uid=3_41 StaticText "曼尼菲尔德守护者 @懂球帝" + uid=3_42 StaticText "3评论" + uid=3_43 StaticText "05-11 04:01" + uid=3_44 link "半场:米兰0-2亚特兰大,埃德松、扎帕科斯塔建功 北京时间5月11日意大利足球顶级联赛第36轮,AC米兰主场对阵亚特兰大。上半场埃德松-席尔瓦首开记录,扎帕科斯塔破门扩大比分。半场战罢,场上比分AC米兰 0-2 亚特兰大。关键事件第6分钟,首开记录! 战报bot @懂球帝 3评论 05-11 04:01" url="http://localhost:8993/pages/news_detail/news_detail?id=1170899" + uid=3_45 StaticText "半场:米兰0-2亚特兰大,埃德松、扎帕科斯塔建功" + uid=3_46 StaticText "北京时间5月11日意大利足球顶级联赛第36轮,AC米兰主场对阵亚特兰大。上半场埃德松-席尔瓦首开记录,扎帕科斯塔破门扩大比分。半场战罢,场上比分AC米兰 0-2 亚特兰大。关键事件第6分钟,首开记录!" + uid=3_47 StaticText "战报bot @懂球帝" + uid=3_48 StaticText "3评论" + uid=3_49 StaticText "05-11 04:01" + uid=3_50 link "迪巴拉:德比很可能是我在罗马主场最后一战;没人找我谈续约 北京时间5月11日,在意甲第36轮的比赛中,罗马补时阶段连入两球,最终在客场3-2神奇逆转绝杀帕尔马,赛后此战送出一次助攻的迪巴拉接受了意大利天空体育的采访。这场比赛的价值几何?“这支球队会拼到最后一 Diavel_aDRy @懂球帝 1评论 05-11 04:01" url="http://localhost:8993/pages/news_detail/news_detail?id=1170900" + uid=3_51 StaticText "迪巴拉:德比很可能是我在罗马主场最后一战;没人找我谈续约" + uid=3_52 StaticText "北京时间5月11日,在意甲第36轮的比赛中,罗马补时阶段连入两球,最终在客场3-2神奇逆转绝杀帕尔马,赛后此战送出一次助攻的迪巴拉接受了意大利天空体育的采访。这场比赛的价值几何?“这支球队会拼到最后一" + uid=3_53 StaticText "Diavel_aDRy @懂球帝" + uid=3_54 StaticText "1评论" + uid=3_55 StaticText "05-11 04:01" + uid=3_56 link "降入意丙,雷吉亚纳球迷打出横幅嘲讽票价:1欧元就是你们的价值 5月9日,在本赛季意大利乙级联赛赛季收官战中,雷吉亚纳虽以1-0小胜桑普多利亚,但仍然降入意丙联赛。本场胜利也无法掩盖球迷对球队和管理层的强烈不满。比赛期间,雷吉亚纳看台挂出醒目的横幅:“1欧元就是你 曼尼菲尔德守护者 @懂球帝 0评论 05-11 03:31" url="http://localhost:8993/pages/news_detail/news_detail?id=1169971" + uid=3_57 StaticText "降入意丙,雷吉亚纳球迷打出横幅嘲讽票价:1欧元就是你们的价值" + uid=3_58 StaticText "5月9日,在本赛季意大利乙级联赛赛季收官战中,雷吉亚纳虽以1-0小胜桑普多利亚,但仍然降入意丙联赛。本场胜利也无法掩盖球迷对球队和管理层的强烈不满。比赛期间,雷吉亚纳看台挂出醒目的横幅:“1欧元就是你" + uid=3_59 StaticText "曼尼菲尔德守护者 @懂球帝" + uid=3_60 StaticText "0评论" + uid=3_61 StaticText "05-11 03:31" + uid=3_62 link "累积五张黄牌,莱奥将在客战热那亚时被停赛 意甲第36轮主场迎战亚特兰大的比赛中,米兰前锋莱奥在上半场第34分钟因为犯规被主裁判黄牌警告。这张黄牌是莱奥在本赛季意甲联赛参加的28场比赛当中得到的第五张黄牌,他将因此而被停赛一轮,无缘参加第37轮 四条腿的车 @懂球帝 0评论 05-11 03:31" url="http://localhost:8993/pages/news_detail/news_detail?id=1169972" + uid=3_63 StaticText "累积五张黄牌,莱奥将在客战热那亚时被停赛" + uid=3_64 StaticText "意甲第36轮主场迎战亚特兰大的比赛中,米兰前锋莱奥在上半场第34分钟因为犯规被主裁判黄牌警告。这张黄牌是莱奥在本赛季意甲联赛参加的28场比赛当中得到的第五张黄牌,他将因此而被停赛一轮,无缘参加第37轮" + uid=3_65 StaticText "四条腿的车 @懂球帝" + uid=3_66 StaticText "0评论" + uid=3_67 StaticText "05-11 03:31" + uid=3_68 link "米体:佩斯卡拉降入意丙后引发球迷骚乱,因西涅赛后落泪 北京时间5月9日,本赛季意大利乙级联赛结束之夜,对于佩斯卡拉俱乐部来说可谓苦涩至极。在对阵斯佩齐亚的收官战中,佩斯卡拉以失利告终,直接降入意丙,引发了球迷的强烈不满与骚乱。比赛结束后,队长洛伦佐-因西 曼尼菲尔德守护者 @懂球帝 1评论 05-11 03:31" url="http://localhost:8993/pages/news_detail/news_detail?id=1169973" + uid=3_69 StaticText "米体:佩斯卡拉降入意丙后引发球迷骚乱,因西涅赛后落泪" + uid=3_70 StaticText "北京时间5月9日,本赛季意大利乙级联赛结束之夜,对于佩斯卡拉俱乐部来说可谓苦涩至极。在对阵斯佩齐亚的收官战中,佩斯卡拉以失利告终,直接降入意丙,引发了球迷的强烈不满与骚乱。比赛结束后,队长洛伦佐-因西" + uid=3_71 StaticText "曼尼菲尔德守护者 @懂球帝" + uid=3_72 StaticText "1评论" + uid=3_73 StaticText "05-11 03:31" + uid=3_74 StaticText "首页" + uid=3_75 StaticText "赛事" + uid=3_76 StaticText "加密行情" + uid=3_77 StaticText "彩票" + uid=3_78 StaticText "社区" + uid=3_79 StaticText "我的" diff --git a/sport-erp-admin/App.vue b/sport-erp-admin/App.vue deleted file mode 100644 index 533eb7a..0000000 --- a/sport-erp-admin/App.vue +++ /dev/null @@ -1,92 +0,0 @@ - - - diff --git a/sport-erp-admin/LICENSE b/sport-erp-admin/LICENSE deleted file mode 100644 index 96da8cd..0000000 --- a/sport-erp-admin/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 DCloud - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/sport-erp-admin/README.md b/sport-erp-admin/README.md deleted file mode 100644 index 4b343e0..0000000 --- a/sport-erp-admin/README.md +++ /dev/null @@ -1,19 +0,0 @@ -## uni-admin - -uni-admin,是基于 uni-app 和 uniCloud 的管理后台项目模版。 - -对于uniCloud的开发者而言,其后台管理系统应该使用本框架。 - -我们搭建了[uni-admin演示站点](http://hellouniadmin.dcloud.net.cn/admin/),你登录后即可快速体验uni-admin。 - -uni-admin 是开源的,遵循 MIT 协议,你可以从[Github](https://github.com/dcloudio/uni-admin)或[码云](https://gitee.com/dcloud/uni-admin)获取源码,也可以从[DCloud插件市场](https://ext.dcloud.net.cn/plugin?id=3268)快捷下载。 - -## 框架特征 -- 基于 uni-app 的宽屏适配,可自动适配 PC 宽屏和手机各端。了解[宽屏适配](https://uniapp.dcloud.io/adapt) -- 基于 uniCloud,是 serverless 的云开发。了解[uniCloud](https://uniapp.dcloud.io/uniCloud/README) -- 基于 uni-id,使用 uni-id 的用户账户、角色、权限系统。了解[uni-id](https://uniapp.dcloud.io/uniCloud/uni-id) - -## 看视频,15分钟掌握uni-admin - - uni-admin视频教程 - diff --git a/sport-erp-admin/admin.config.js b/sport-erp-admin/admin.config.js deleted file mode 100644 index 861b8aa..0000000 --- a/sport-erp-admin/admin.config.js +++ /dev/null @@ -1,85 +0,0 @@ -export default { - login: { - url: '/uni_modules/uni-id-pages/pages/login/login-withpwd' // 登录页面路径 - }, - index: { - url: '/pages/index/index' // 登录后跳转的第一个页面 - }, - error: { - url: '/pages/error/404' // 404 Not Found 错误页面路径 - }, - navBar: { // 顶部导航 - logo: '/static/logo.png', // 左侧 Logo - langs: [{ - text: '中文简体', - lang: 'zh-Hans' - }, { - text: '中文繁體', - lang: 'zh-Hant' - }, { - text: 'English', - lang: 'en' - }], - themes: [{ - text: '默认', - value: 'default' - }, { - text: '绿柔', - value: 'green' - }], - debug: { - enable: process.env.NODE_ENV !== 'production', //是否显示错误信息 - engine: [{ // 搜索引擎配置(每条错误信息后,会自动生成搜索链接,点击后跳转至搜索引擎) - name: '百度', - url: 'https://www.baidu.com/baidu?wd=ERR_MSG' - }, { - name: '谷歌', - url: 'https://www.google.com/search?q=ERR_MSG' - }] - } - }, - sideBar: { // 左侧菜单 - // 配置静态菜单列表(放置在用户被授权的菜单列表下边) - staticMenu: [{ - menu_id: "demo", - text: '静态功能演示', - icon: 'admin-icons-kaifashili', - url: "", - children: [{ - menu_id: "icons", - text: '图标', - icon: 'admin-icons-icon', - value: '/pages/demo/icons/icons', - }, { - menu_id: "table", - text: '表格', - icon: 'admin-icons-table', - value: '/pages/demo/table/table', - }] - }, { - menu_id: "admim-doc-pulgin", - text: '文档与插件', - icon: 'admin-icons-eco', - url: "", - children: [{ - menu_id: "admin-doc", - icon: 'admin-icons-doc', - text: 'uni-admin 框架文档', - value: 'https://uniapp.dcloud.net.cn/uniCloud/admin' - }, { - menu_id: "stat-doc", - icon: 'admin-icons-help', - text: 'uni 统计教程', - value: 'https://uniapp.dcloud.net.cn/uni-stat-v2.html' - }, { - menu_id: "admin-pulgin", - icon: 'admin-icons-pulgin', - text: 'uni-admin 插件', - value: 'https://ext.dcloud.net.cn/?cat1=7&cat2=74' - }] - }] - }, - uniStat: { - - } -} diff --git a/sport-erp-admin/changelog.md b/sport-erp-admin/changelog.md deleted file mode 100644 index 1f689d5..0000000 --- a/sport-erp-admin/changelog.md +++ /dev/null @@ -1,355 +0,0 @@ -## 2.5.13(2025-11-21) -- 修复 当404页面不存在时会陷入死循环的问题,并优化404页面样式 -## 2.5.12(2025-09-17) -- 修复 右上角按钮区弹窗显示宽度错误问题 -## 2.5.11(2025-09-03) -- 优化 数据表索引兼容支付宝云规范,声明字段类型 -## 2.5.10(2025-08-21) -- 优化 安卓端支持国际化 -## 2.5.9(2025-08-13) -修复左侧菜单部分情况下不加载的问题 -## 2.5.8(2025-08-08) -修复 uni统计 渠道统计 时间范围查询时,次均停留时长和设备平均停留时长显示错误的问题 -## 2.5.7(2025-07-11) -- 应用管理新增应用类型,用以区分 uni-app 和 uni-app x 项目 -## 2.5.6(2025-06-24) -- 去除 index.html 模板中的 lang="en" -## 2.5.5(2025-06-24) -- 调整表 uni-id-users 的默认索引,使之兼容支付宝云 -## 2.5.4(2025-06-18) -- 调整表 opendb-admin-menus、opendb-app-versions 的默认索引,使之兼容支付宝云 -## 2.5.3(2025-06-13) -- 优化 uni-sms-co 群发短信不需要再配置 smsKey 和 smsSecret -## 2.5.2(2025-06-05) -- 修复 uni统计-设备统计-概况会弹自定义选择平台弹窗的问题 -## 2.5.1(2025-04-24) -- 修复 应用管理生成发布页模板报错的 Bug -## 2.5.0(2025-03-18) -- 修复 注册用户统计-趋势分析中次均停留时长和人均停留时长不准确的问题 -- 优化 统计平台对比图表样式 -- 优化 支付宝云数据库查询兼容性调整 -## 2.4.25(2024-12-02) -- 新增 uni统计支持鸿蒙元服务平台 -## 2.4.24(2024-11-18) -- 新增 uni统计支持鸿蒙平台 -## 2.4.23(2024-11-13) -- 调整 因页面 error/js/js 使用了App不支持的依赖,故编译到App端时,去除该页面 -## 2.4.22(2024-11-06) -- 修复 升级中心发布 wgt 升级时没有上传至云存储 -## 2.4.21(2024-11-01) -- 更新 应用管理支持添加 HarmonyOS Next 信息 -- 更新 App升级中心支持发布 HarmonyOS Next 整包更新、wgt 更新(App 端需要配合 HBuilderX 4.32、uni-upgrade-center-app 0.9.1+ 使用) -- 更新 uni-portal 支持 HarmonyOS Next 设备 -## 2.4.20(2024-09-23) -- 更新 uni-forms组件,修复因 uni-forms 组件导致的APP升级中心发布新版安装包无法上线的问题 -## 2.4.19(2024-09-20) -- 优化 uni统计平台补充初始化数据文件 .init_data.json 内的数据 -- 优化 应用管理-发行页面模板适配 ipad 访问 -## 2.4.18(2024-09-14) -- 更新 uni-forms组件,修复因 uni-forms 组件导致的用户禁用后无法改回启用状态的问题 -## 2.4.17(2024-07-22) -- 更新 uni_modules 依赖 -## 2.4.16(2024-07-15) -- 更新 uni-file-picker 组件,兼容vue3,并修复 schema2code 在vue3下,图片不显示的问题 -## 2.4.15(2024-07-04) -- 修复 uni统计-内容统计开启redis后统计数据会变少问题 -## 2.4.14(2024-06-03) -- 修复 uni统计-趋势分析-次均停留和设备平均停留时长异常问题 -- 修复 左侧父级菜单右侧箭头不显示的问题 -## 2.4.13(2024-05-24) -- 修复 2.4.9 更新引出的设备统计-概况默认不是按天查询等问题 -## 2.4.12(2024-05-22) -- 优化 非debug模式下,去除支付统计的日志打印 -## 2.4.11(2024-05-21) -- 修复 uni统计支付宝云批量添加可能会报错的问题 -## 2.4.10(2024-05-20) -- 更新 uni-id-pages 至 1.1.20 -- 更新 uni_modules 依赖 -## 2.4.9(2024-05-16) -优化 uni统计维度选择支持按时查询 -## 2.4.8(2024-05-10) -- 优化 uni统计维度选择支持按时查询,调整应用选择的选择器宽度样式 -- 更新 uni统计表的索引,对齐opendb仓库内表的索引 -## 2.4.7(2024-04-23) -- 优化 uni统计未选择appid时不进行查询 -## 2.4.6(2024-04-23) -- 还原 uni-tooltip 组件的更新(新版uni-tooltip组件有问题) -## 2.4.5(2024-04-19) -- 更新 uni_modules依赖 -- 新增 数据库索引初始化文件 -- 优化 抖音小程序兼容性 -## 2.4.4(2024-04-10) -- 更新 菜单表初始化数据指定_id(防止重复初始化时数据重复) -- 更新 update: 优化vue3模块下菜单管理无法显示待添加的插件菜单的问题 -- 更新 应用管理支持填写 iOS ABM 包登录获取链接,发布页支持 iOS ABM 包获取,[hello-uniapp x](https://hellouniappx.dcloud.net.cn/) -## 2.4.3(2024-01-25) -- 优化 修改数据库初始化提示语使用新版初始化方案 -- 优化 uni统计-内容统计-页面规则 支持根据应用筛选 -- 优化 代码通过 SonarLint 规范检测 -## 2.4.2(2024-01-15) -- 优化 APP升级中心,支持上传到扩展存储 [简介](https://doc.dcloud.net.cn/uniCloud/ext-storage/intro.html) -## 2.4.1(2023-12-27) -- 调整 db_init.json 新增内容统计相关表 [详情](https://uniapp.dcloud.net.cn/uni-stat-v2.html#upgrade2) -## 2.4.0(2023-12-27) -- 重要 uni统计-内容统计 [详情](https://uniapp.dcloud.net.cn/uni-stat-v2.html#upgrade2) -## 2.3.13(2023-12-15) -- 修复 opendb-news-comments.schema.json permission 配置少一个s的问题 -## 2.3.12(2023-11-07) -- 修复 uni统计兼容 skd 未上报 ut 参数的Bug -- 优化 uni统计配置增加cronMinTips,用于对cronMin参数进行解释 -- 更新 uni-captcha模块至0.7.0 -- 更新 升级中心升级至 0.6.1 -- 新增 升级中心 uni-upgrade-center 云函数 checkVersion.js 支持传递 is_uniapp_x 参数(uni-app x 项目安卓端无 wgt 更新) -## 2.3.11(2023-08-07) -- 优化 当菜单表无数据时,提示请先初始化云数据库 -## 2.3.10(2023-08-04) -- 调整 db_init.json新增opendb-poi表 -## 2.3.9(2023-08-04) -- 优化 打开选择地图时,确认按钮被top-window窗口覆盖的问题 -## 2.3.8(2023-08-03) -- 修复 uni统计页面统计修改页面名称不生效的问题 -- 调整 uni统计支付订单明细查询改用全等匹配 -- 调整 opendb-news-articles.schema.json read默认权限 -- 优化 合并uni_modules插件的菜单时,菜单默认启用(不再需要一个一个点修改了) -## 2.3.7(2023-05-29) -- 升级 uni-id-pages 至 1.1.14 -- 修复 uni统计自定义事件的查询bug -- 优化 uni统计日期选择支持时分秒 -- 优化 uni统计优化自定义事件查询,支持事件ID和设备标识查询 -- 优化 去除注册admin时的验证码组件(admin只能注册一次,无需验证码) -## 2.3.6(2023-04-10) -- 优化 支付统计-价值用户排行:只统计已支付的订单金额,且去除退款金额。 -## 2.3.5(2023-02-24) -- 修复 升级中心安卓应用商店不显示的Bug -## 2.3.4(2023-02-09) -- 重要 阿里云空间支持上传sourceMap用以分析js错误统计 [详情](https://uniapp.dcloud.net.cn/uni-stat-v2.html#sourcemap-parse-error) -## 2.3.3(2023-02-02) -- 新增 菜单管理新增【更新内置菜单】功能,方便旧版本uni-admin升级至新版本uni-admin后一键同步内置菜单 -- 升级 uni-id-pages 至 1.1.0 -- 优化 uni-admin的storage键名命名规范 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-storage-format.html) -- 优化 安全审计-用户日志 排序规则调整为降序 -- 优化 uni统计-版本选择组件的查询条件短期内多次变更只查询最后一次变更后的结果 -## 2.3.2(2023-01-30) -- 修复 禁用的菜单仍然会在左侧菜单列表中显示的bug -## 2.3.1(2023-01-29) -- 短信群发功能 新增 筛选用户后可以跨分页群发 -## 2.3.0(2023-01-16) -- 重要 新增uni-starter需要的相关依赖和初始化数据(方便uni-starter关联uni-admin后可直接运行) -- 升级 uni-id-pages 至 1.0.40 -- 修复 非H5环境时,点击跳首页会报错的问题。 -- 修复 charts 更新后,vue3模式下无法显示的bug -- 修复 用户管理-编辑时,新增标签后返回报错的问题 -- 修复 用户管理-编辑时,若用户拥有的应用未添加到应用管理时,点击保存会导致用户丢失该应用的appid,进而导致下次登录提示未在该应用注册的问题。 -- 修复 用户管理-编辑时,无法将已禁用的用户恢复成正常状态的问题。 -- 修复 用户管理-编辑时,无法将手机号和邮箱清空的问题。 -- 优化 用户管理-编辑时,禁止将当前登录的admin账户禁用(防止误操作导致无法登录admin) -- 优化 统计报表中的版本选择组件显示的内容,以便更好的区分平台和版本号 -- 优化 新增用户时的表单验证提示 -- 优化 当没有创建任何应用时,首页会友好提示请先创建应用。 -## 2.2.3(2022-12-30) -- 修复 uni统计js报错页面无法正常显示数据的问题 [详情](https://ask.dcloud.net.cn/question/160337) -- 修复 一键部署因database目录有多余的db_init.json 导致部署失败的问题。 -- 优化 uni统计前端页面,减少不必要的请求次数。 -## 2.2.2(2022-12-20) -- 修复 升级中心删除安装包时报错的Bug [详情](https://ask.dcloud.net.cn/question/159918) -## 2.2.1(2022-12-13) -- 修复 因HBX升级3.6.13导致菜单管理加载失败的问题 -- 优化 微信小程序报很多警告的问题 -## 2.2.0(2022-12-12) -- 新增 uni统计新增支付统计 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-pay.html#pay-stat) -- 优化 uni统计UI排版细节 -- 修复 国际化繁体中文 新增一級菜單 文案错误问题 -## 2.1.9(2022-12-06) -- 升级 uni-id-pages 至 1.0.35 -- 优化 去除非必要的日志打印 -- 优化 用户管理、角色管理、日志管理使用getTemp连表,提升查询性能 -- 优化 添加用户时手机号、邮箱选填 -- 优化 添加用户时,昵称允许是中文 -- 修复 运行时提示表不存在的问题 -## 2.1.8(2022-12-01) -- 修复 uni-stat-receiver 无法找到 uni-id 模块的bug -## 2.1.7(2022-11-30) -- 新增 换肤功能 -## 2.1.6(2022-11-28) -- 优化 群发短信功能的 schema 命名规范 -## 2.1.5(2022-11-17) -- 升级 uni-id-pages 至 1.0.31 -- 优化 添加用户时手机号、邮箱必填 -## 2.1.4(2022-11-11) -- 修复 Vue3微信小程序运行报错的bug -## 2.1.3(2022-11-03) -- 修复 微信小程序上运行时错误 `process is not defined` -## 2.1.2(2022-11-02) -- 修复 Vue3无法导入插件菜单 -## 2.1.1(2022-10-17) -- 修复 uni统计 App-Android 平台部分统计数据不准确的Bug [详情](https://ask.dcloud.net.cn/article/40097) -- 修复 uni统计 周/月数据不准确的Bug -## 2.1.0(2022-10-14) -- 新增 群发短信功能 [详情](https://uniapp.dcloud.net.cn//uniCloud/admin.html#batch-sms) -- 修复 无法重置用户密码的bug -## 2.0.5(2022-09-28) -- 修复 导入插件时不显示“待添加菜单”bug -## 2.0.4(2022-09-23) -- 升级 uni-id-pages 至 1.0.22 -## 2.0.3(2022-09-21) -- 修复 云函数请求无返回数据的bug -## 2.0.2(2022-09-20) -- 升级 uni-id-pages 至 1.0.18 -- 优化 导航登录用户名的显示规则:用户昵称 > 用户名 > 手机号 > 邮箱 -## 2.0.1(2022-09-19) -- 升级 uni-id-pages 至 1.0.17 -- 修改 导航登录用户名的显示规则:优先显示用户昵称,其次显示用户名 -- 增加 用户管理列表展示“用户昵称”字段 -- 增加 创建用户支持添加“用户昵称”字段 -## 2.0.0(2022-09-16) -- 升级 uni-id-pages 至 1.0.13 -- 修复 应用中心修改应用无法修改的bug -## 1.10.1(2022-09-08) -- 修复 使用 uniIdRouter 时导致页面无法打开的Bug -## 1.10.0(2022-09-08) -- 升级 uni-id 至 4.0,移除 uni-id、uni-id-cf 插件,增加 uni-id-pages、uni-id-common 插件。[uni-id详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-summary.html) -## 1.9.8(2022-08-15) -- 修复 应用管理修改页面报错 -## 1.9.7(2022-08-08) -- 改进 sourceMap 回溯源码功能使用方法,需要在 admin.config.js 中配置相关信息。[详情](https://uniapp.dcloud.net.cn/uni-stat-v2.html#upload-sourcemap) -- 修复 js报错统计报错的Bug -## 1.9.6(2022-08-02) -- 修复 vue3 打包报错的Bug -- 修复 升级中心发布 wgt 时原生 App 最低版本没有必填的Bug -- 修复 升级中心发布 wgt 时显示Android应用市场的Bug -## 1.9.5(2022-07-29) -- 修复 运行到微信小程序控制台报错的Bug -## 1.9.4(2022-07-28) -- 新增 uni-admin uni统计支持上传 sourceMap,报错可准确回溯源码 [详情](https://uniapp.dcloud.io/uni-stat-v2.html#sourcemap-parse-error) -## 1.9.3(2022-07-19) -- 优化 uni-admin 应用管理模块可管理App下载地址、小程序二维码等更多应用信息 [详情](https://uniapp.dcloud.io/uniCloud/admin.html#app-manager) -- 调整 uni-admin 内置 统一发布页(uni-portal)插件 [详情](https://uniapp.dcloud.io/uniCloud/admin.html#uni-portal) -- 调整 uni-admin 内置 App升级中心(uni-upgrade-center)插件,并支持多应用商店更新 [详情](https://uniapp.dcloud.io/uniCloud/admin.html#uni-upgrade-center) -- 升级前最好将旧版 uni-portal、uni-upgrade-center 插件备份并移出 uni_modules 目录 -## 1.9.2(2022-07-11) -- 修复 留存统计跑批任务获取不到版本号的Bug -## 1.9.1(2022-07-06) -- 新增 opendb-device表,开通 uni-push2.0 与 uni统计2.0 自动上报 push_clientid 到 opendb-device表 -## 1.9.0(2022-07-05) -- 【重要】uni-admin 优化 uni统计 版本记录复用uni升级中心的opendb-app-versions表,废弃uni-stat-app-versions表 [详情](https://uniapp.dcloud.net.cn/uni-stat-v2.html#upgrade) -- 新增 uni统计 app崩溃页面,补充崩溃率统计 -- 修复 uni统计 js报错页面,错误率计算不准确的Bug -- 修复 uni统计 切换版本或者修改时间等操作后,趋势图状态显示不正确的Bug -- 修复 uni统计 部分页面首次进入时界面闪烁的问题 -## 1.8.5(2022-06-29) -- 新增 支持 ios 安全区 -## 1.8.4(2022-06-01) -- 新增 uni统计 可通过选择「应用版本」查询数据 -- 新增 uni统计 原生 app 崩溃页各项功能 -- 修复 uni统计 渠道页 table 表格最后一列空白的 bug -- 修复 uni统计 场景分析页趋势图有数据却显示为 0 的 bug -- 修复 系统设置权限只能加载 20 条的 bug -## 1.8.3(2022-05-19) -- 优化 「首页」逻辑调整,无 appid 时提示添加 app 记录,可跳转 app 管理的新增页 -- 优化 移除登录时多余的 init 的逻辑,提升登录速度 -- 优化 「页面统计」添加 「入口页」、「登录页」的提示文字 -- 修复 从「首页」跳转「概况」时,url 的 query 丢失的 bug -## 1.8.2(2022-05-18) -- 优化 uni 统计的「统计首页」菜单移动到应用「首页」,添加了设备概览、注册用户概览 -- 优化 uni 统计的「帮助」菜单移动到「文档与插件」 -- 修复 路由改变后面包屑未响应的 bug -## 1.8.1(2022-05-17) -- 修复 去掉多余的 schema -## 1.8.0(2022-05-17) -**重要更新:** -- 新增 用户日志功能 -- 新增 内置 uni 统计报表体系,开源、免费、可私有化部署,[了解更多](https://uniapp.dcloud.net.cn/uni-stat-v2.html#uni%E7%BB%9F%E8%AE%A1),具体功能如下 - - 统计首页 - - 设备统计 - - 用户统计 - - 页面统计 - - 渠道/场景值分析 - - 自定义事件 - - 错误统计 -## 1.7.13(2022-02-15) -- 修复 新增菜单页‘内置图标’在 vue3 平台不显示的 bug -- 修复 ‘新增一级菜单’ 按钮的文字错误 -## 1.7.12(2022-01-26) -- 修复 uni-admin 的 'registerUser' 接口,注册用户含有多余字段 uid -## 1.7.11(2022-01-19) -- 修复 多个用户的用户名相同时,后注册的同名用户登录时提示“用户不存在”的 bug -- 修复 偶发的验证码输出正确却提示“验证码错误”的 bug -- 修复 刷新页面后验证码消的 bug -## 1.7.10(2021-12-20) -- 优化 支持 vue3 查找并注册的菜单(包括插件菜单) -## 1.7.9(2021-12-07) -- 新增 标签管理功能,可批量为用户添加或移除标签、通过标签过滤用户 -## 1.7.8(2021-11-30) -- 修复 Android 平台切换语言闪退的 bug,该平台暂不支持切换语言 -## 1.7.7(2021-11-29) -- 修复 uni-datetime-picker 国际化未默认英文的问题 -- 修复 uni-datetime-picker 范围选择在表格列头中渲染相同月份的问题 -## 1.7.6(2021-11-11) -- 优化 修改密码功能不再支持查看明文密码 -- 修复 某些屏幕上,input 框中下划线 '_' 被隐藏的 bug -## 1.7.5(2021-10-08) -- 修复 用户管理与角色管理模糊搜索时关联的外键无法搜索的 bug -## 1.7.4(2021-09-30) -- 修复 topwindow 非 h5 端,key 使用表达式报错的 bug -- 优化 topwindow 中英文混排不对齐的问题 -## 1.7.3(2021-09-27) -- 修复 vue3 上加载 PostCSS 插件失败的 bug -## 1.7.2(2021-09-17) -- 优化 取消菜单管理请求数据条数限制 -- 优化 topwindow 菜单文字换行的问题 -- 修复 左侧菜单栏刷新失去打开状态的 bug -## 1.7.1(2021-09-14) -- 修复 vue3 下 i18n 未定义的 bug -- 优化 抛出被 error.js 拦截的报错 -## 1.7.0(2021-08-31) -- 新增 支持国际化 i18n -- 优化 验证码图片边框样式调整 -## 1.6.2(2021-08-26) -- 修复 非 admin 角色的用户无权限访问菜单表,动态菜单不显示的 bug - > 更新后,需上传 opendb-admin-menus.schema.json -- 优化 list 页的表格样式 -## 1.6.1(2021-08-16) -- 修复 uni-id-cf 中无用的node_modules造成的报错 -- 修复 uni.css 中样式穿透造成的 uni-file-picker 不可见的 bug -## 1.6.0(2021-07-31) -**重要更新:** -- 新增 应用管理功能,管理用户可登录的应用(uni-id@3.3.1+ 支持) -- 新增 升级系统管理 list 页的表格功能,支持数据排序、筛选、搜索等功能 -- 新增 同时适配 vue2 和 vue3(HBuilder X 3.2.0+ 支持 vue3) -- 修复 刷新页面时,左侧菜单丢失高亮状态的 bug -- 修复 修改密码失败的 bug -## 1.5.8(2021-07-12) -- 修复 侧边栏菜单查询数据条数一次不超过 20 条的 bug(限制是最大一次 500 条) -## 1.5.7(2021-07-02) -- 修复 菜单管理排序错误的 bug -- 优化 框架设定非 admin 不能创建用户, 用户可自定义 -## 1.5.6(2021-06-28) -- 修复 left-window 在小程序上的编译错误 -## 1.5.5(2021-06-21) -- 修复 角色管理删除功能失效的 bug -- 修复 权限管理删除功能失效的 bug -## 1.5.4(2021-06-21) -- 优化 云函数 uni-id-cf uni_module 化,更新更方便 -## 1.5.3(2021-06-17) -- 优化 opendb-admin-menus.schema 读权限配置默认为 true - > 原因:侧边栏菜单管理功能使用了 clientDB, 默认全部读取,通过用户权限过滤 -## 1.4.6(2021-05-27) -- 修复 未连接服务空间时登录页空白的 bug - -## 1.4.5(2021-05-18) -- 新增 选择表格分页条数功能 -- 修复 切换分页条数当前分页不是1时获取数据出错的 bug -## 1.4.4(2021-05-17) -- 优化 导出 Excel 功能的代码 -- 优化 系统管理 list 页面样式 -- 优化 文案调整 -## 1.4.3(2021-05-14) -- PC 端支持表格导出数据为 Excel -## 1.4.2(2021-04-21) -- 更新 uni-id 3.1.0 - - 增加对用户名、邮箱、密码字段的两端去空格 - - 默认忽略用户名、邮箱的大小写 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=case-sensitive) - - 修复 customToken导出async方法报错的Bug -## 1.4.1(2021-04-16) -- 更新 uni-tabel 1.0.3 -- 新增 根目录下 changelog.md diff --git a/sport-erp-admin/common/admin-icons.css b/sport-erp-admin/common/admin-icons.css deleted file mode 100644 index 8e0b89d..0000000 --- a/sport-erp-admin/common/admin-icons.css +++ /dev/null @@ -1,199 +0,0 @@ -@font-face { - font-family: admin-icons; - src: url('~@/static/admin-icons.ttf') format('truetype'); - font-weight: 400; - font-display: "auto"; - font-style: normal -} - - -[class*="admin-icons-"], -[class^=admin-icons-] { - font-family: admin-icons !important; - speak: none; - font-style: normal; - font-weight: 400; - font-variant: normal; - text-transform: none; - line-height: 1; - vertical-align: baseline; - display: inline-block; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale -} - - - -.admin-icons-stat:before { - content: "\e64a"; -} - -.admin-icons-fl-xitong:before { - content: "\e623"; -} - -.admin-icons-tongji:before { - content: "\e64a"; -} - -.admin-icons-yonghutongji:before { - content: "\e661"; -} - -.admin-icons-dashboard:before { - content: "\e78b"; -} - -.admin-icons-qudaofenxi:before { - content: "\e6c6"; -} - -.admin-icons-shebeitongji:before { - content: "\e6fd"; -} - -.admin-icons-xitongguanli:before { - content: "\e671"; -} - -.admin-icons-kaifashili:before { - content: "\e614"; -} - -.admin-icons-yonghutongji1:before { - content: "\e769"; -} - -.admin-icons-shijianfenxi:before { - content: "\e604"; -} - -.admin-icons-ziyuan:before { - content: "\e619"; -} - -.admin-icons-cuowutongji:before { - content: "\e51f"; -} - -.admin-icons-shijianfenxi1:before { - content: "\e629"; -} - - -.admin-icons-tongjishouye:before { - content: "\e679"; -} - -.admin-icons-yemiantongji:before { - content: "\e684"; -} - - -.admin-icons-manager-user:before { - content: "\e610"; -} - -.admin-icons-manager-role:before { - content: "\e61a"; -} - -.admin-icons-manager-permission:before { - content: "\e637"; -} - -.admin-icons-manager-app:before { - content: "\e65b"; -} - -.admin-icons-manager-tag:before { - content: "\e83c"; -} - -.admin-icons-manager-menu:before { - content: "\e629"; -} - -.admin-icons-overview:before { - content: "\e609"; -} - -.admin-icons-activity:before { - content: "\e70e"; -} - -.admin-icons-trend:before { - content: "\e63c"; -} - -.admin-icons-retention:before { - content: "\e697"; -} - -.admin-icons-comparison:before { - content: "\e955"; -} - -.admin-icons-stickiness:before { - content: "\e770"; -} - -.admin-icons-page-ent:before { - content: "\e767"; -} - -.admin-icons-page-res:before { - content: "\e69b"; -} - -.admin-icons-scene:before { - content: "\e601"; -} - -.admin-icons-channel:before { - content: "\e603"; -} - -.admin-icons-error-js:before { - content: "\ec0c"; -} - -.admin-icons-error-app:before { - content: "\e617"; -} - -.admin-icons-help:before { - content: "\e65c"; -} - -.admin-icons-icon:before { - content: "\e503"; -} - -.admin-icons-table:before { - content: "\e639"; -} - -.admin-icons-eco:before { - content: "\e698"; -} - -.admin-icons-doc:before { - content: "\e656"; -} - -.admin-icons-pulgin:before { - content: "\e648"; -} - -.admin-icons-lang:before { - content: "\e618"; -} - -.admin-icons-user:before { - content: "\e68d"; -} - -.admin-icons-safety:before { - content: "\e769"; -} diff --git a/sport-erp-admin/common/theme.scss b/sport-erp-admin/common/theme.scss deleted file mode 100644 index 053347e..0000000 --- a/sport-erp-admin/common/theme.scss +++ /dev/null @@ -1,293 +0,0 @@ -@import '@/uni.scss'; - -$theme-map: (); -$primary-key: 'primary'; -$success-key: 'success'; -$warn-key: 'warn'; -$warning-key: 'warning'; -$error-key: 'error'; - -@mixin themeify { - @each $theme-name, $theme-map in $themes { - $theme-map: $theme-map !global; - [data-theme='#{inspect($theme-name)}'] { - @content; - } - } -} -@function getTheme($key) { - @return map-get($theme-map, $key); -} -@mixin uni-button($button-type) { - $button-type-color: getTheme(#{$button-type + '-color'}); - uni-button, - button { - &[type='#{$button-type}'] { - background-color: $button-type-color; - &[disabled] { - background-color: opacify($button-type-color, 0.6); - } - &[plain] { - color: $button-type-color; - border-color: $button-type-color; - background-color: transparent; - } - &[loading] { - background-color: $button-type-color; - &[plain] { - color: $button-type-color; - } - } - &.button-hover { - $hover-color: darken( - $color: $button-type-color, - $amount: 10% - ); - background-color: $hover-color; - &[plain] { - color: $hover-color; - border-color: $hover-color; - background-color: transparent; - } - } - } - } -} -@mixin uni-switch { - $primary-color: getTheme(#{$primary-key + '-color'}); - .uni-switch-input.uni-switch-input-checked { - background-color: $primary-color !important; - border-color: $primary-color !important; - } -} -@mixin uni-ui-checkbox { - $primary-color: getTheme(#{$primary-key + '-color'}); - .checklist-box { - &.is-checked { - .checkbox__inner { - border-color: $primary-color !important; - background-color: $primary-color !important; - } - .radio__inner { - border-color: $primary-color !important; - .radio__inner-icon { - background-color: $primary-color !important; - } - } - .checklist-text { - color: $primary-color !important; - } - } - .checkbox__inner:hover { - border-color: $primary-color !important; - } - } -} -@mixin uni-ui-easyinput { - $primary-color: getTheme(#{$primary-key + '-color'}); - $error-color: getTheme(#{$error-key + '-color'}); - .uni-easyinput { - &.uni-easyinput-error { - color: $error-color !important; - } - .uni-easyinput__content { - &.is-focused { - &.is-input-border { - border-color: $primary-color !important; - } - .uni-icons { - color: $primary-color !important; - } - } - } - } -} -@mixin uni-menu { - $primary-color: getTheme(#{$primary-key + '-color'}); - // 左侧菜单 - .uni-nav-menu { - .uni-menu-item.is-active { - color: $primary-color; - } - } - // 修改密码 - .navbar-menu { - .menu-item.hover-highlight:hover { - color: $primary-color; - } - } -} -@mixin uni-table { - $primary-color: getTheme(#{$primary-key + '-color'}); - .uni-table { - .link-btn-color { - color: $primary-color; - } - .uni-table-checkbox { - .checkbox__inner { - &.checkbox--indeterminate, - &.is-checked { - border-color: $primary-color; - background-color: $primary-color; - } - } - .checkbox__inner:hover { - border-color: $primary-color; - } - } - .uni-table-th-content { - .arrow-box { - .arrow.active ::after { - background-color: $primary-color; - } - } - } - // 表格头部搜索按钮 - .opera-area { - .btn.btn-submit { - background-color: $primary-color; - } - } - .dropdown-btn { - .icon-search.active { - .icon-search-0 { - border-color: $primary-color; - } - .icon-search-1 { - background-color: $primary-color; - } - } - .icon-calendar.active { - .icon-calendar-0 { - border-color: $primary-color; - } - .icon-calendar-1 { - background-color: $primary-color; - } - } - } - .uni-icons.uni-stat-edit--btn { - color: $primary-color !important; - } - } - .uni-pagination { - .uni-pagination__num-current .page--active { - background-color: $primary-color !important; - } - } -} -@mixin uni-picker { - $primary-color: getTheme(#{$primary-key + '-color'}); - .uni-picker-select { - .uni-picker-item.selected { - color: $primary-color; - } - } -} -@mixin uni-calendar { - $primary-color: getTheme(#{$primary-key + '-color'}); - .uni-calendar__button-text { - color: $primary-color; - } - .uni-datetime-picker--btn { - background-color: $primary-color; - } - .uni-calendar-item--multiple { - .uni-calendar-item--before-checked, - .uni-calendar-item--after-checked { - background-color: $primary-color; - } - } - .uni-calendar-item__weeks-box { - .uni-calendar-item--checked { - background-color: $primary-color; - } - &-text { - color: darken($color: $primary-color, $amount: 40%); - } - } -} -@mixin uni-popup { - $primary-color: getTheme(#{$primary-key + '-color'}); - .uni-popup-dialog { - .uni-button-color { - color: $primary-color; - } - } -} -@mixin uni-tag($tag-type) { - $tag-type-color: getTheme(#{$tag-type + '-color'}); - .uni-tag { - &--#{$tag-type} { - background-color: $tag-type-color !important; - border-color: $tag-type-color !important; - } - &--#{$tag-type}--inverted { - background-color: #fff !important; - color: $tag-type-color !important; - } - } -} - -body { - @at-root { - @include themeify { - $primary-color: getTheme(#{$primary-key + '-color'}); - // 组件 - @include uni-button($primary-key); - @include uni-button($warn-key); - @include uni-tag($primary-key); - @include uni-tag($success-key); - @include uni-tag($warning-key); - @include uni-tag($error-key); - @include uni-ui-checkbox; - @include uni-switch; - @include uni-ui-easyinput; - @include uni-menu; - @include uni-table; - @include uni-picker; - @include uni-calendar; - @include uni-popup; - // 页面 - .link-btn { - color: $primary-color !important; - } - .uni-stat--tab-item { - &.uni-stat--tab-item-line-active, - &.uni-stat--tab-item-boldLine-active { - color: $primary-color; - border-color: $primary-color; - } - &.uni-stat--tab-item-box-active { - border-color: $primary-color; - } - } - .uni-title.app-list { - color: $primary-color; - border-color: $primary-color; - } - .uni-link { - color: $primary-color; - } - .uni-selector-select .uni-picker-item.selected { - color: $primary-color; - } - .uni-tabs__item.is-active { - color: $primary-color; - } - .uni-modal__btn_primary { - color: $primary-color !important; - } - .uni-radio-input-checked { - background-color: $primary-color !important; - border-color: $primary-color !important; - } - .uni-container { - .icon-item:hover, - .icon-item:hover .icon-text { - color: $primary-color; - } - } - } - } -} diff --git a/sport-erp-admin/common/uni-icons.css b/sport-erp-admin/common/uni-icons.css deleted file mode 100644 index 5e678db..0000000 --- a/sport-erp-admin/common/uni-icons.css +++ /dev/null @@ -1,542 +0,0 @@ -@font-face { - font-family: uni-icons; - src: url('~@/uni_modules/uni-icons/components/uni-icons/uni.ttf') format('truetype'); - font-weight: 400; - font-display: "auto"; - font-style: normal -} - -[class*=" uni-icons-"], -[class^=uni-icons-] { - font-family: uni-icons !important; - speak: none; - font-style: normal; - font-weight: 400; - font-variant: normal; - text-transform: none; - line-height: 1; - vertical-align: baseline; - display: inline-block; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale -} - -.uni-icons-shop:before { - content: "\e609"; -} - -.uni-icons-headphones:before { - content: "\e8bf"; -} - -.uni-icons-pulldown:before { - content: "\e588"; -} - -.uni-icons-scan:before { - content: "\e612"; -} - -.uni-icons-back:before { - content: "\e471"; -} - -.uni-icons-forward:before { - content: "\e470"; -} - -.uni-icons-refreshempty:before { - content: "\e461"; -} - -.uni-icons-checkbox-filled:before { - content: "\e442"; -} - -.uni-icons-checkbox:before { - content: "\e7fa"; -} - -.uni-icons-loop:before { - content: "\e565"; -} - -.uni-icons-arrowthindown:before { - content: "\e585"; -} - -.uni-icons-arrowthinleft:before { - content: "\e586"; -} - -.uni-icons-arrowthinright:before { - content: "\e587"; -} - -.uni-icons-arrowthinup:before { - content: "\e584"; -} - -.uni-icons-bars:before { - content: "\e563"; -} - -.uni-icons-cart-filled:before { - content: "\e7f4"; -} - -.uni-icons-cart:before { - content: "\e7f5"; -} - -.uni-icons-arrowleft:before { - content: "\e582"; -} - -.uni-icons-arrowdown:before { - content: "\e581"; -} - -.uni-icons-arrowright:before { - content: "\e583"; -} - -.uni-icons-arrowup:before { - content: "\e580"; -} - -.uni-icons-eye-filled:before { - content: "\e568"; -} - -.uni-icons-eye-slash-filled:before { - content: "\e822"; -} - -.uni-icons-eye-slash:before { - content: "\e823"; -} - -.uni-icons-eye:before { - content: "\e824"; -} - -.uni-icons-reload:before { - content: "\e462"; -} - -.uni-icons-hand-thumbsdown-filled:before { - content: "\e83b"; -} - -.uni-icons-hand-thumbsdown:before { - content: "\e83c"; -} - -.uni-icons-hand-thumbsup-filled:before { - content: "\e83d"; -} - -.uni-icons-heart-filled:before { - content: "\e83e"; -} - -.uni-icons-hand-thumbsup:before { - content: "\e83f"; -} - -.uni-icons-heart:before { - content: "\e840"; -} - -.uni-icons-mail-open-filled:before { - content: "\e84d"; -} - -.uni-icons-mail-open:before { - content: "\e84e"; -} - -.uni-icons-list:before { - content: "\e562"; -} - -.uni-icons-map-pin:before { - content: "\e85e"; -} - -.uni-icons-map-pin-ellipse:before { - content: "\e864"; -} - -.uni-icons-paperclip:before { - content: "\e567"; -} - -.uni-icons-images-filled:before { - content: "\e87a"; -} - -.uni-icons-images:before { - content: "\e87b"; -} - -.uni-icons-search:before { - content: "\e466"; -} - -.uni-icons-settings:before { - content: "\e560"; -} - -.uni-icons-cloud-download:before { - content: "\e8e4"; -} - -.uni-icons-cloud-upload-filled:before { - content: "\e8e5"; -} - -.uni-icons-cloud-upload:before { - content: "\e8e6"; -} - -.uni-icons-cloud-download-filled:before { - content: "\e8e9"; -} - -.uni-icons-more:before { - content: "\e507"; -} - -.uni-icons-more-filled:before { - content: "\e537"; -} - -.uni-icons-refresh:before { - content: "\e407"; -} - -.uni-icons-refresh-filled:before { - content: "\e437"; -} - -.uni-icons-undo-filled:before { - content: "\e7d6"; -} - -.uni-icons-undo:before { - content: "\e406"; -} - -.uni-icons-redo:before { - content: "\e405"; -} - -.uni-icons-redo-filled:before { - content: "\e7d9"; -} - -.uni-icons-camera:before { - content: "\e301"; -} - -.uni-icons-camera-filled:before { - content: "\e7ef"; -} - -.uni-icons-smallcircle-filled:before { - content: "\e801"; -} - -.uni-icons-circle:before { - content: "\e411"; -} - -.uni-icons-flag-filled:before { - content: "\e825"; -} - -.uni-icons-flag:before { - content: "\e508"; -} - -.uni-icons-gear-filled:before { - content: "\e532"; -} - -.uni-icons-gear:before { - content: "\e502"; -} - -.uni-icons-home:before { - content: "\e500"; -} - -.uni-icons-info:before { - content: "\e504"; -} - -.uni-icons-home-filled:before { - content: "\e530"; -} - -.uni-icons-info-filled:before { - content: "\e534"; -} - -.uni-icons-circle-filled:before { - content: "\e441"; -} - -.uni-icons-chat-filled:before { - content: "\e847"; -} - -.uni-icons-chat:before { - content: "\e263"; -} - -.uni-icons-checkmarkempty:before { - content: "\e472"; -} - -.uni-icons-locked-filled:before { - content: "\e856"; -} - -.uni-icons-locked:before { - content: "\e506"; -} - -.uni-icons-map-filled:before { - content: "\e85c"; -} - -.uni-icons-map:before { - content: "\e364"; -} - -.uni-icons-minus-filled:before { - content: "\e440"; -} - -.uni-icons-mic-filled:before { - content: "\e332"; -} - -.uni-icons-minus:before { - content: "\e410"; -} - -.uni-icons-micoff:before { - content: "\e360"; -} - -.uni-icons-mic:before { - content: "\e302"; -} - -.uni-icons-clear:before { - content: "\e434"; -} - -.uni-icons-smallcircle:before { - content: "\e868"; -} - -.uni-icons-close:before { - content: "\e404"; -} - -.uni-icons-closeempty:before { - content: "\e460"; -} - -.uni-icons-paperplane:before { - content: "\e503"; -} - -.uni-icons-paperplane-filled:before { - content: "\e86e"; -} - -.uni-icons-image:before { - content: "\e363"; -} - -.uni-icons-image-filled:before { - content: "\e877"; -} - -.uni-icons-location-filled:before { - content: "\e333"; -} - -.uni-icons-location:before { - content: "\e303"; -} - -.uni-icons-plus-filled:before { - content: "\e439"; -} - -.uni-icons-plus:before { - content: "\e409"; -} - -.uni-icons-plusempty:before { - content: "\e468"; -} - -.uni-icons-help-filled:before { - content: "\e535"; -} - -.uni-icons-help:before { - content: "\e505"; -} - -.uni-icons-navigate-filled:before { - content: "\e884"; -} - -.uni-icons-navigate:before { - content: "\e501"; -} - -.uni-icons-mic-slash-filled:before { - content: "\e892"; -} - -.uni-icons-sound:before { - content: "\e590"; -} - -.uni-icons-sound-filled:before { - content: "\e8a1"; -} - -.uni-icons-spinner-cycle:before { - content: "\e465"; -} - -.uni-icons-download-filled:before { - content: "\e8a4"; -} - -.uni-icons-videocam-filled:before { - content: "\e8af"; -} - -.uni-icons-upload:before { - content: "\e402"; -} - -.uni-icons-upload-filled:before { - content: "\e8b1"; -} - -.uni-icons-starhalf:before { - content: "\e463"; -} - -.uni-icons-star-filled:before { - content: "\e438"; -} - -.uni-icons-star:before { - content: "\e408"; -} - -.uni-icons-trash:before { - content: "\e401"; -} - -.uni-icons-compose:before { - content: "\e400"; -} - -.uni-icons-videocam:before { - content: "\e300"; -} - -.uni-icons-trash-filled:before { - content: "\e8dc"; -} - -.uni-icons-download:before { - content: "\e403"; -} - -.uni-icons-qq:before { - content: "\e264"; -} - -.uni-icons-weibo:before { - content: "\e260"; -} - -.uni-icons-weixin:before { - content: "\e261"; -} - -.uni-icons-pengyouquan:before { - content: "\e262"; -} - -.uni-icons-chatboxes:before { - content: "\e203"; -} - -.uni-icons-chatboxes-filled:before { - content: "\e233"; -} - -.uni-icons-email-filled:before { - content: "\e231"; -} - -.uni-icons-email:before { - content: "\e201"; -} - -.uni-icons-person-filled:before { - content: "\e131"; -} - -.uni-icons-contact-filled:before { - content: "\e130"; -} - -.uni-icons-person:before { - content: "\e101"; -} - -.uni-icons-contact:before { - content: "\e100"; -} - -.uni-icons-phone:before { - content: "\e200"; -} - -.uni-icons-personadd-filled:before { - content: "\e132"; -} - -.uni-icons-personadd:before { - content: "\e102"; -} - -.uni-icons-phone-filled:before { - content: "\e230"; -} - -.uni-icons-chatbubble-filled:before { - content: "\e232"; -} - -.uni-icons-chatbubble:before { - content: "\e202"; -} diff --git a/sport-erp-admin/common/uni.css b/sport-erp-admin/common/uni.css deleted file mode 100644 index c0aa5d9..0000000 --- a/sport-erp-admin/common/uni.css +++ /dev/null @@ -1,605 +0,0 @@ -/* 全局公共样式 */ - -body, -html { - -webkit-user-select: auto; - user-select: auto; - font-size: 16px; -} - -/* #ifdef H5 */ - -.uni-app--showleftwindow uni-main { - position: relative; - background-color: #f5f5f5; -} - -.uni-mask + .uni-left-window, -.uni-mask + .uni-right-window { - position: fixed; -} - -.uni-app--showleftwindow uni-page-head .uni-page-head { - color: #333 !important; -} - -uni-page-head .uni-btn-icon { - color: #333 !important; -} - -.uni-app--showleftwindow - uni-page-head[uni-page-head-type="default"] - ~ uni-page-wrapper { - height: auto; - padding-top: 44px; -} - -.uni-app--showleftwindow uni-page-wrapper { - position: absolute; - width: 100%; - top: 0; - bottom: 0; - padding: 15px; - overflow-y: auto; - box-sizing: border-box; - background-color: #f5f5f5; -} - -.uni-app--showleftwindow uni-page-body { - width: 100%; - min-height: 100%; - box-sizing: border-box; - border-radius: 5px; - box-shadow: -1px -1px 5px 0 rgba(0, 0, 0, 0.1); - background-color: #fff; -} - -.uni-app--showleftwindow .uni-container .uni-forms { - padding: 15px; - max-width: 650px; -} - -/* #endif */ - -/* #ifndef H5 */ -.uni-nav-menu { - height: 100vh; -} - -/* #endif */ - -.pointer { - cursor: pointer; -} - -.uni-top-window { - z-index: 999; - overflow: visible; -} - -.uni-tips { - font-size: 12px; - color: #666; -} - -/* 容器 */ -.uni-container { - padding: 15px; - box-sizing: border-box; -} - -/* 标题栏 */ -.uni-header { - padding: 0 15px; - display: flex; - min-height: 55px; - align-items: center; - justify-content: space-between; - border-bottom: 1px #f5f5f5 solid; - flex-wrap: wrap; -} - -.uni-title { - margin-right: 10px; - font-size: 16px; - font-weight: 500; - color: #333; -} - -.uni-sub-title { - margin-top: 3px; - font-size: 14px; - color: #999; -} - -.uni-link { - color: #3a8ee6; - cursor: pointer; - text-decoration: underline; -} - -.uni-group { - display: flex; - align-items: center; - justify-content: center; - flex-wrap: wrap; - word-break: keep-all; -} - -/* 按钮样式 */ -.uni-button-group { - margin-top: 30px; - display: flex; - align-items: center; - justify-content: center; -} - -.uni-button { - padding: 10px 20px; - font-size: 14px; - border-radius: 4px; - line-height: 1; - margin: 0; - box-sizing: border-box; - overflow: initial; -} - -.uni-group .uni-button { - margin: 10px; -} - -.uni-group .uni-search { - margin: 10px; -} - -.uni-group > .uni-button:first-child { - margin-left: 0; -} - -.uni-button:hover, -.uni-button:focus { - opacity: 0.9; -} - -.uni-button:active { - opacity: 1; -} - -.uni-button-full { - width: 100%; -} - -/* 搜索框样式 */ -.uni-search { - width: 268px; - height: 28px; - line-height: 28px; - font-size: 12px; - color: #606266; - padding: 0 10px; - border: 1px #dcdfe6 solid; - border-radius: 3px; -} - -/* 分页容器 */ -.uni-pagination-box { - margin-top: 20px; - display: flex; - align-items: center; - justify-content: center; -} - -.uni-input-border, -.uni-textarea-border { - width: 100%; - font-size: 14px; - color: #666; - border: 1px #e5e5e5 solid; - border-radius: 5px; - box-sizing: border-box; -} - -.uni-input-border { - padding: 0 10px; - height: 35px; -} - -.uni-textarea-border { - padding: 10px; - height: 80px; -} - -.uni-disabled { - background-color: #f5f7fa; - color: #c0c4cc; -} - -.uni-icon-password-eye { - position: absolute; - right: 8px; - top: 6px; - font-size: 20px; - font-weight: normal; - font-style: normal; - width: 24px; - height: 24px; - line-height: 24px; - color: #999999; -} - -.uni-eye-active { - color: #007aff; -} - -.uni-tabs__header { - position: relative; - background-color: #f5f7fa; - border-bottom: 1px solid #e4e7ed; -} - -.uni-tabs__nav-wrap { - overflow: hidden; - margin-bottom: -1px; - position: relative; -} - -.uni-tabs__nav-scroll { - overflow: hidden; -} - -.uni-tabs__nav { - position: relative; - white-space: nowrap; -} - -.uni-tabs__item { - position: relative; - padding: 0 20px; - height: 40px; - box-sizing: border-box; - line-height: 40px; - display: inline-block; - list-style: none; - font-size: 14px; - font-weight: 500; - color: #909399; - margin-top: -1px; - margin-left: -1px; - border: 1px solid transparent; - cursor: pointer; -} - -.uni-tabs__item.is-active { - background-color: #fff; - border-right-color: #dcdfe6; - border-left-color: #dcdfe6; -} - -.uni-form-item-tips { - color: #999; - font-size: 12px; - margin-top: 10px; -} - -.uni-form-item-empty { - color: #999; - min-height: 36px; - line-height: 36px; -} - -::v-deep .uni-forms-item__label .label-text { - color: #606266 !important; -} - -::v-deep .flex-center-x .uni-forms-item__content { - display: flex; - align-items: center; - flex-wrap: wrap; -} - -.link-btn { - line-height: 26px; - margin-top: 5px; - color: #007aff !important; - text-decoration: underline; - cursor: pointer; -} - -/* button 重置样式 */ -::v-deep button[size="mini"] { - line-height: 2.4; - font-size: 12px; - border-radius: 3px; -} - -button { - /* #ifndef MP-TOUTIAO */ - background: #fff; - /* #endif */ - border: 1px solid #dcdfe6; - color: #606266; - box-sizing: border-box; -} - -button[type="primary"] { - background-color: #409eff; - border-color: #409eff; - border-width: 0; -} - -button[type="warn"] { - background-color: #f56c6c; - border-color: #f56c6c; - border-width: 0; -} - -button[type="default"] { - background: #fff; - border: 1px solid #dcdfe6; - color: #606266; - box-sizing: border-box; -} - -button[type="primary"][plain] { - border-color: #409eff; - color: #409eff; -} - -button[type="warn"][plain] { - border-color: #f56c6c; - color: #f56c6c; -} - -button[type="default"][plain] { - border-color: #dcdfe6; - color: #606266; -} - -button[plain] { - border-color: #dcdfe6; - color: #606266; -} - -button:after { - border-width: 0; -} - -.uni-input-placeholder { - color: #999; -} - -.select-picker { - margin-right: 20px; -} - -.select-picker button { - margin-top: 5px; - line-height: 29px; - font-size: 14px; -} - -.select-picker button text { - color: #999; -} - -.select-picker-icon { - margin-left: 8px; -} - -/* stat style start */ -.m-m { - margin: 15px !important; -} - -.mb-s { - margin-bottom: 5px; -} - -.mb-m { - margin-bottom: 15px !important; -} - -.mb-l { - margin-bottom: 30px !important; -} - -.ml-s { - margin-left: 5px; -} - -.ml-m { - margin-left: 15px !important; -} - -.ml-l { - margin-left: 30px !important; -} - -.p-m { - padding: 15px; -} - -.p-channel { - padding: 0 15px 15px 15px; -} - -.p-1015 { - padding: 10px 15px; -} - -.uni-charts-box { - width: 100%; - height: 350px; -} - -.uni-stat--x { - border-radius: 4px; - box-shadow: -1px -1px 5px 0 rgba(0, 0, 0, 0.1); - margin-bottom: 15px; -} -.uni-stat--app-select{ - display: flex; - flex-wrap: wrap; - align-items: center; - width: 900px; - max-width: 100%; -} - -.flex { - display: flex; - flex-wrap: wrap; - align-items: center; -} - -.label-text { - font-size: 14px; - font-weight: bold; - color: #555; - margin: auto 0; - margin-right: 5px; -} - -.uni-stat-edit--x { - display: flex; - justify-content: space-between; -} - -.uni-stat-edit--btn { - cursor: pointer; -} - -.uni-stat-datetime-picker { - margin: 15px; -} - -/* uni-popup modal start */ -.modal { - max-width: calc(100vw - 200px); - min-width: 600px; - margin: 0 auto; - background-color: #ffffff; -} - -.modal-header { - padding: 20px 0; - text-align: center; - border-bottom: 1px solid #eee; -} - -.modal-footer { - padding: 20px; - display: flex; - justify-content: flex-end; - align-items: center; -} - -.modal-content { - padding: 15px; - height: 600px; - box-sizing: border-box; -} - -/* uni-popup modal end */ - -.uni-stat-tooltip-s { - width: 160px; - white-space: normal; -} - -/* #ifndef APP-NVUE */ -@media screen and (max-width: 500px) { - .hide-on-phone { - display: none !important; - } - - .uni-charts-box { - width: 100%; - height: 220px; - } - - .uni-group .uni-search { - height: 32px; - line-height: 32px; - width: 100%; - margin: 20px 20px 10px 20px; - } - - .uni-header { - padding-left: 0px; - padding-right: 0px; - border: unset; - } - - .uni-group { - width: 100%; - } - - .uni-stat-breadcrumb-on-phone { - padding: 0 20px !important; - border-bottom: 1px #f5f5f5 solid; - } - - .flex { - width: 100%; - display: flex; - flex-wrap: wrap; - align-items: center; - } -} - -@media screen and (min-width: 500px) { - .dispaly-grid { - display: grid; - grid-template-columns: 1fr 1fr; - column-gap: 15px; - } - - .pc-flex-wrap { - display: flex; - flex-wrap: wrap; - align-items: center; - } - - .uni-stat-datetime-picker { - max-width: 350px; - } - - ::v-deep .uni-pagination-picker-show .uni-picker-container .uni-picker-custom { - width: 100px; - margin: 0 86px; - } - - ::v-deep .uni-pagination-picker-show .uni-picker-container .uni-picker-custom .uni-picker-select + div { - left: 50% !important; - } -} - -/* #endif */ - -/* #ifdef H5 */ -/* fix 弹出层被遮盖 */ -::v-deep .uni-table-scroll { - min-height: calc(100vh - 237px); - box-sizing: border-box; -} -::v-deep .uni-table .tr-table--border { - border-left: 1px #ebeef5 solid; -} -/* #endif */ - -/* #ifndef H5 */ -.fix-top-window { - margin-top: 85px; -} -/* #endif */ - -/* 地图选择top需要大于topWindow的高度 */ -.uni-system-choose-location{ - display: block; - position: fixed; - left: 0; - top: 60px; - width: 100%; - height: calc(100% - 60px); - background: #f8f8f8; -} diff --git a/sport-erp-admin/components/batch-sms/batch-sms.vue b/sport-erp-admin/components/batch-sms/batch-sms.vue deleted file mode 100644 index 1550042..0000000 --- a/sport-erp-admin/components/batch-sms/batch-sms.vue +++ /dev/null @@ -1,507 +0,0 @@ - - - - - diff --git a/sport-erp-admin/components/download-excel/download-excel.vue b/sport-erp-admin/components/download-excel/download-excel.vue deleted file mode 100644 index 92b701c..0000000 --- a/sport-erp-admin/components/download-excel/download-excel.vue +++ /dev/null @@ -1,361 +0,0 @@ - - - diff --git a/sport-erp-admin/components/download-excel/download.js b/sport-erp-admin/components/download-excel/download.js deleted file mode 100644 index 6131947..0000000 --- a/sport-erp-admin/components/download-excel/download.js +++ /dev/null @@ -1,153 +0,0 @@ -//download.js v4.2, by dandavis; 2008-2016. [MIT] see http://danml.com/download.html for tests/usage -// v1 landed a FF+Chrome compat way of downloading strings to local un-named files, upgraded to use a hidden frame and optional mime -// v2 added named files via a[download], msSaveBlob, IE (10+) support, and window.URL support for larger+faster saves than dataURLs -// v3 added dataURL and Blob Input, bind-toggle arity, and legacy dataURL fallback was improved with force-download mime and base64 support. 3.1 improved safari handling. -// v4 adds AMD/UMD, commonJS, and plain browser support -// v4.1 adds url download capability via solo URL argument (same domain/CORS only) -// v4.2 adds semantic variable names, long (over 2MB) dataURL support, and hidden by default temp anchors -// https://github.com/rndme/download - -export default function download(data, strFileName, strMimeType) { - - let self = window, // this script is only for browsers anyway... - defaultMime = "application/octet-stream", // this default mime also triggers iframe downloads - mimeType = strMimeType || defaultMime, - payload = data, - url = !strFileName && !strMimeType && payload, - anchor = document.createElement("a"), - toString = function(a) { return String(a); }, - myBlob = (self.Blob || self.MozBlob || self.WebKitBlob || toString), - fileName = strFileName || "download", - blob, - reader; - myBlob = myBlob.call ? myBlob.bind(self) : Blob; - - if (String(this) === "true") { //reverse arguments, allowing download.bind(true, "text/xml", "export.xml") to act as a callback - payload = [payload, mimeType]; - mimeType = payload[0]; - payload = payload[1]; - } - - - if (url && url.length < 2048) { // if no filename and no mime, assume a url was passed as the only argument - fileName = url.split("/").pop().split("?")[0]; - anchor.href = url; // assign href prop to temp anchor - if (anchor.href.indexOf(url) !== -1) { // if the browser determines that it's a potentially valid url path: - let ajax = new XMLHttpRequest(); - ajax.open("GET", url, true); - ajax.responseType = 'blob'; - ajax.onload = function(e) { - download(e.target.response, fileName, defaultMime); - }; - setTimeout(function() { ajax.send(); }, 0); // allows setting custom ajax headers using the return: - return ajax; - } // end if valid url? - } // end if url? - - - //go ahead and download dataURLs right away - if (/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(payload)) { - - if (payload.length > (1024 * 1024 * 1.999) && myBlob !== toString) { - payload = dataUrlToBlob(payload); - mimeType = payload.type || defaultMime; - } else { - return navigator.msSaveBlob ? // IE10 can't do a[download], only Blobs: - navigator.msSaveBlob(dataUrlToBlob(payload), fileName) : - saver(payload); // everyone else can save dataURLs un-processed - } - - } else { //not data url, is it a string with special needs? - if (/([\x80-\xff])/.test(payload)) { - let i = 0, - tempUiArr = new Uint8Array(payload.length), - mx = tempUiArr.length; - for (i; i < mx; ++i) tempUiArr[i] = payload.charCodeAt(i); - payload = new myBlob([tempUiArr], { type: mimeType }); - } - } - blob = payload instanceof myBlob ? - payload : - new myBlob([payload], { type: mimeType }); - - - function dataUrlToBlob(strUrl) { - let parts = strUrl.split(/[:;,]/), - type = parts[1], - decoder = parts[2] == "base64" ? atob : decodeURIComponent, - binData = decoder(parts.pop()), - mx = binData.length, - i = 0, - uiArr = new Uint8Array(mx); - - for (i; i < mx; ++i) uiArr[i] = binData.charCodeAt(i); - - return new myBlob([uiArr], { type: type }); - } - - function saver(url, winMode) { - - if ('download' in anchor) { //html5 A[download] - anchor.href = url; - anchor.setAttribute("download", fileName); - anchor.className = "download-js-link"; - anchor.innerHTML = "downloading..."; - anchor.style.display = "none"; - document.body.appendChild(anchor); - setTimeout(function() { - anchor.click(); - document.body.removeChild(anchor); - if (winMode === true) { setTimeout(function() { self.URL.revokeObjectURL(anchor.href); }, 250); } - }, 66); - return true; - } - - // handle non-a[download] safari as best we can: - if (/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent)) { - if (/^data:/.test(url)) url = "data:" + url.replace(/^data:([\w\/\-\+]+)/, defaultMime); - if (!window.open(url)) { // popup blocked, offer direct download: - if (confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")) { location.href = url; } - } - return true; - } - - //do iframe dataURL download (old ch+FF): - let f = document.createElement("iframe"); - document.body.appendChild(f); - - if (!winMode && /^data:/.test(url)) { // force a mime that will download: - url = "data:" + url.replace(/^data:([\w\/\-\+]+)/, defaultMime); - } - f.src = url; - setTimeout(function() { document.body.removeChild(f); }, 333); - - } //end saver - - - - - if (navigator.msSaveBlob) { // IE10+ : (has Blob, but not a[download] or URL) - return navigator.msSaveBlob(blob, fileName); - } - - if (self.URL) { // simple fast and modern way using Blob and URL: - saver(self.URL.createObjectURL(blob), true); - } else { - // handle non-Blob()+non-URL browsers: - if (typeof blob === "string" || blob.constructor === toString) { - try { - return saver("data:" + mimeType + ";base64," + self.btoa(blob)); - } catch (y) { - return saver("data:" + mimeType + "," + encodeURIComponent(blob)); - } - } - - // Blob but not URL support: - reader = new FileReader(); - reader.onload = function(e) { - saver(this.result); - }; - reader.readAsDataURL(blob); - } - return true; -}; /* end download() */ diff --git a/sport-erp-admin/components/fix-window/fix-window.vue b/sport-erp-admin/components/fix-window/fix-window.vue deleted file mode 100644 index 4b540e4..0000000 --- a/sport-erp-admin/components/fix-window/fix-window.vue +++ /dev/null @@ -1,69 +0,0 @@ - - - - - diff --git a/sport-erp-admin/components/show-info/show-info.vue b/sport-erp-admin/components/show-info/show-info.vue deleted file mode 100644 index 9fc943e..0000000 --- a/sport-erp-admin/components/show-info/show-info.vue +++ /dev/null @@ -1,55 +0,0 @@ - - - - - diff --git a/sport-erp-admin/components/uni-data-menu/uni-data-menu.vue b/sport-erp-admin/components/uni-data-menu/uni-data-menu.vue deleted file mode 100644 index 3a0b139..0000000 --- a/sport-erp-admin/components/uni-data-menu/uni-data-menu.vue +++ /dev/null @@ -1,184 +0,0 @@ - - - - - diff --git a/sport-erp-admin/components/uni-data-menu/util.js b/sport-erp-admin/components/uni-data-menu/util.js deleted file mode 100644 index 256d3e8..0000000 --- a/sport-erp-admin/components/uni-data-menu/util.js +++ /dev/null @@ -1,67 +0,0 @@ -function buildMenu(menu, menuList, menuIds) { - let nextLayer = [] - for (let i = menu.length - 1; i > -1; i--) { - const currentMenu = menu[i] - const subMenu = menuList.filter(item => { - if (item.parent_id === currentMenu.menu_id) { - menuIds.push(item.menu_id) - return true - } - }) - nextLayer = nextLayer.concat(subMenu) - currentMenu.children = subMenu - } - if (nextLayer.length) { - buildMenu(nextLayer, menuList, menuIds) - } -} - -function getParentIds(menuItem, menuList) { - const parentArr = [] - let currentItem = menuItem - while (currentItem && currentItem.parent_id) { - parentArr.push(currentItem.parent_id) - currentItem = menuList.find(item => item.menu_id === currentItem.parent_id) - } - return parentArr -} - -function buildMenus(menuList, trim = true) { - // 保证父子级顺序 - menuList = menuList.sort(function(a, b) { - const parentIdsA = getParentIds(a, menuList) - const parentIdsB = getParentIds(b, menuList) - if (parentIdsA.includes(b.menu_id)) { - return 1 - } - return parentIdsA.length - parentIdsB.length || a.sort - b.sort - }) - // 删除无subMenu且非子节点的菜单项 - if (trim) { - for (let i = menuList.length - 1; i > -1; i--) { - const currentMenu = menuList[i] - const subMenu = menuList.filter(subMenuItem => subMenuItem.parent_id === currentMenu.menu_id) - if (!currentMenu.isLeafNode && !subMenu.length) { - menuList.splice(i, 1) - } - } - } - const menuIds = [] - const menu = menuList.filter(item => { - if (!item.parent_id) { - menuIds.push(item.menu_id) - return true - } - }) - buildMenu(menu, menuList, menuIds) - // 包含所有无效菜单 - if (!trim && menuIds.length !== menuList.length) { - menu.push(...menuList.filter(item => !menuIds.includes(item.menu_id))) - } - return menu -} - -export { - buildMenu, - buildMenus -} diff --git a/sport-erp-admin/components/uni-menu-group/uni-menu-group.vue b/sport-erp-admin/components/uni-menu-group/uni-menu-group.vue deleted file mode 100644 index 78d65b0..0000000 --- a/sport-erp-admin/components/uni-menu-group/uni-menu-group.vue +++ /dev/null @@ -1,49 +0,0 @@ - - - - - diff --git a/sport-erp-admin/components/uni-menu-item/uni-menu-item.vue b/sport-erp-admin/components/uni-menu-item/uni-menu-item.vue deleted file mode 100644 index c72a354..0000000 --- a/sport-erp-admin/components/uni-menu-item/uni-menu-item.vue +++ /dev/null @@ -1,134 +0,0 @@ - - - - - diff --git a/sport-erp-admin/components/uni-menu-sidebar/uni-menu-sidebar.vue b/sport-erp-admin/components/uni-menu-sidebar/uni-menu-sidebar.vue deleted file mode 100644 index 8205c44..0000000 --- a/sport-erp-admin/components/uni-menu-sidebar/uni-menu-sidebar.vue +++ /dev/null @@ -1,48 +0,0 @@ - - - - - diff --git a/sport-erp-admin/components/uni-nav-menu/mixins/rootParent.js b/sport-erp-admin/components/uni-nav-menu/mixins/rootParent.js deleted file mode 100644 index 776b0c3..0000000 --- a/sport-erp-admin/components/uni-nav-menu/mixins/rootParent.js +++ /dev/null @@ -1,29 +0,0 @@ -export default { - methods:{ - /** - * 获取所有父元素 - * @param {Object} name - * @param {Object} parent - */ - getParentAll(name, parent) { - parent = this.getParent(`uni${name}`, parent) - if (parent) { - this.rootMenu[name].push(parent) - this.getParentAll(name, parent) - } - }, - /** - * 获取父元素实例 - */ - getParent(name, parent, type) { - parent = parent.$parent; - let parentName = parent.$options.name; - while (parentName !== name) { - parent = parent.$parent; - if (!parent) return false - parentName = parent.$options.name; - } - return parent; - } - } -} \ No newline at end of file diff --git a/sport-erp-admin/components/uni-nav-menu/uni-nav-menu.vue b/sport-erp-admin/components/uni-nav-menu/uni-nav-menu.vue deleted file mode 100644 index 7a2fe77..0000000 --- a/sport-erp-admin/components/uni-nav-menu/uni-nav-menu.vue +++ /dev/null @@ -1,209 +0,0 @@ - - - - - diff --git a/sport-erp-admin/components/uni-stat-breadcrumb/uni-stat-breadcrumb.vue b/sport-erp-admin/components/uni-stat-breadcrumb/uni-stat-breadcrumb.vue deleted file mode 100644 index 294586f..0000000 --- a/sport-erp-admin/components/uni-stat-breadcrumb/uni-stat-breadcrumb.vue +++ /dev/null @@ -1,36 +0,0 @@ - - - - - diff --git a/sport-erp-admin/components/uni-stat-panel/uni-stat-panel.vue b/sport-erp-admin/components/uni-stat-panel/uni-stat-panel.vue deleted file mode 100644 index 9fab7c9..0000000 --- a/sport-erp-admin/components/uni-stat-panel/uni-stat-panel.vue +++ /dev/null @@ -1,116 +0,0 @@ - - - - - diff --git a/sport-erp-admin/components/uni-stat-table/uni-stat-table.vue b/sport-erp-admin/components/uni-stat-table/uni-stat-table.vue deleted file mode 100644 index c41e494..0000000 --- a/sport-erp-admin/components/uni-stat-table/uni-stat-table.vue +++ /dev/null @@ -1,71 +0,0 @@ - - - - - diff --git a/sport-erp-admin/components/uni-stat-tabs/uni-stat-tabs.vue b/sport-erp-admin/components/uni-stat-tabs/uni-stat-tabs.vue deleted file mode 100644 index 3cf479b..0000000 --- a/sport-erp-admin/components/uni-stat-tabs/uni-stat-tabs.vue +++ /dev/null @@ -1,452 +0,0 @@ - - - - - diff --git a/sport-erp-admin/components/uni-sub-menu/uni-sub-menu.vue b/sport-erp-admin/components/uni-sub-menu/uni-sub-menu.vue deleted file mode 100644 index 51378fe..0000000 --- a/sport-erp-admin/components/uni-sub-menu/uni-sub-menu.vue +++ /dev/null @@ -1,165 +0,0 @@ - - - - - diff --git a/sport-erp-admin/i18n/en.json b/sport-erp-admin/i18n/en.json deleted file mode 100644 index 91e2352..0000000 --- a/sport-erp-admin/i18n/en.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "login": { - "text": { - "title": "System Login", - "prompt": "If there is no administrator account, please create an administrator first..." - }, - "field": { - "username": "Account", - "password": "Password", - "captcha": "Captcha" - }, - "button": { - "login": "Log In" - } - }, - "topwindow": { - "text": { - "doc": "Admin doc", - "plugin": "More admin plugin", - "changeLanguage": "Language", - "changePwd": "ChangePwd", - "signOut": "Sign out" - } - }, - "index": { - "text": { - "prompt": "Main content, customizable content and style", - "vesion": "The current version can be viewed in the console and package.json" - } - }, - "updatePwd": { - "text": { - "title": "Change Password" - }, - "field": { - "oldPassword": "Old password", - "newPassword": "New password", - "passwordConfirmation": "Confirm password" - }, - "button": { - "save": "Save", - "back": "Back" - } - }, - "common": { - "placeholder": { - "query": "Enter search content" - }, - "button": { - "search": "Search", - "add": "Add", - "edit": "Edit", - "delete": "Delete", - "batchDelete": "Batch Delete", - "exportExcel": "Export Excel", - "submit": "Submit", - "back": "Back", - "tagManager": "Tag Manager", - "publish": "Publish page management", - "version": "version manager", - "sendSMS": "Send SMS" - }, - "empty": "No more data", - "piecePerPage": "piece/page" - }, - "user": { - "text": { - "userManager": "Users Manager" - } - }, - "role": { - "text": { - "roleManager": "Roles Manager" - } - }, - "permission": { - "text": { - "permissionManager": "Permissions Manager" - } - }, - "app": { - "text": { - "appManager": "App Manager", - "describle": "Manage the apps that users can login" - } - }, - "menu": { - "text": { - "menuManager": "Menus Manager", - "additiveMenu": "Additive Menu" - }, - "button": { - "addFirstLevelMenu": "Add First-level Menu", - "addChildMenu": "Submenu", - "updateBuiltInMenu": "Update built-in Menu" - } - }, - "demo": { - "icons": { - "title": "Icons", - "describle": "Click icons to copy the icon code" - }, - "table": { - "title": "Table" - } - } -} diff --git a/sport-erp-admin/i18n/index.js b/sport-erp-admin/i18n/index.js deleted file mode 100644 index 8c3b392..0000000 --- a/sport-erp-admin/i18n/index.js +++ /dev/null @@ -1,8 +0,0 @@ -import en from './en.json' -import zhHans from './zh-Hans.json' -import zhHant from './zh-Hant.json' -export default { - en, - 'zh-Hans': zhHans, - 'zh-Hant': zhHant -} diff --git a/sport-erp-admin/i18n/zh-Hans.json b/sport-erp-admin/i18n/zh-Hans.json deleted file mode 100644 index 97ad64d..0000000 --- a/sport-erp-admin/i18n/zh-Hans.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "login": { - "text": { - "title": "系统登录", - "prompt": "如无管理员账号,请先创建管理员" - }, - "field": { - "username": "账号", - "password": "密码", - "captcha": "验证码" - }, - "button": { - "login": "登录" - } - }, - "topwindow": { - "text": { - "doc": "Admin 框架文档", - "plugin": "浏览更多 Admin 插件", - "changeLanguage": "切换语言", - "changePwd": "修改密码", - "signOut": "退出" - } - }, - "index": { - "text": { - "prompt": "内容主体,可自定义内容及样式", - "vesion": "可在控制台和 package.json 中查看当前的版本" - } - }, - "updatePwd": { - "text": { - "title": "修改密码" - }, - "field": { - "oldPassword": "旧密码", - "newPassword": "新密码", - "passwordConfirmation": "确认新密码" - }, - "button": { - "save": "保存", - "back": "返回" - } - }, - "common": { - "placeholder": { - "query": "请输入搜索内容" - }, - "button": { - "search": "搜索", - "add": "新增", - "edit": "修改", - "delete": "删除", - "batchDelete": "批量删除", - "exportExcel": "导出 Excel", - "submit": "提交", - "back": "返回", - "tagManager": "标签管理", - "publish": "发布页管理", - "version": "版本管理", - "sendSMS": "群发短信" - }, - "empty": "没有更多数据", - "piecePerPage": "条/页" - }, - "user": { - "text": { - "userManager": "用户管理" - } - }, - "role": { - "text": { - "roleManager": "角色管理" - } - }, - "permission": { - "text": { - "permissionManager": "权限管理" - } - }, - "app": { - "text": { - "appManager": "应用管理", - "describle": "管理用户可登录的应用" - } - }, - "menu": { - "text": { - "menuManager": "菜单列表", - "additiveMenu": "待添加菜单" - }, - "button": { - "addFirstLevelMenu": "新增一级菜单", - "addChildMenu": "子菜单", - "updateBuiltInMenu": "更新内置菜单" - } - }, - "demo": { - "icons": { - "title": "图标", - "describle": "点击图标即可复制图标代码" - }, - "table": { - "title": "表格" - } - } -} diff --git a/sport-erp-admin/i18n/zh-Hant.json b/sport-erp-admin/i18n/zh-Hant.json deleted file mode 100644 index 68fbd0c..0000000 --- a/sport-erp-admin/i18n/zh-Hant.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "login": { - "text": { - "title": "系統登錄", - "prompt": "如無管理員賬號,請先創建管理員..." - }, - "field": { - "username": "賬號", - "password": "密碼", - "captcha": "驗證碼" - }, - "button": { - "login": "登錄" - } - }, - "topwindow": { - "text": { - "doc": "Admin 框架文檔", - "plugin": "瀏覽更多 Admin 插件", - "changeLanguage": "切换语言", - "changePwd": "修改密碼", - "signOut": "退出" - } - }, - "index": { - "text": { - "prompt": "內容主體,可自定義內容及樣式", - "vesion": "可在控制台和 package.json 中查看當前的版本" - } - }, - "updatePwd": { - "text": { - "title": "修改密碼" - }, - "field": { - "oldPassword": "舊密碼", - "newPassword": "新密碼", - "passwordConfirmation": "確認新密碼" - }, - "button": { - "save": "保存", - "back": "返回" - } - }, - "common": { - "placeholder": { - "query": "請輸入搜索內容" - }, - "button": { - "search": "檢索", - "add": "新增", - "edit": "修改", - "delete": "刪除", - "batchDelete": "批量刪除", - "exportExcel": "導出 Excel", - "submit": "提交", - "back": "返回", - "tagManager": "標簽管理", - "publish": "發布頁管理", - "version": "版本管理", - "sendSMS": "群發短信" - }, - "empty": "沒有更多數據", - "piecePerPage": "條/頁" - }, - "user": { - "text": { - "userManager": "用戶管理" - } - }, - "role": { - "text": { - "roleManager": "角色管理" - } - }, - "permission": { - "text": { - "permissionManager": "權限管理" - } - }, - "app": { - "text": { - "appManager": "應用管理", - "describle": "管理用戶可登錄的應用" - } - }, - "menu": { - "text": { - "menuManager": "菜單列表", - "additiveMenu": "待添加菜單" - }, - "button": { - "addFirstLevelMenu": "新增一級菜單", - "addChildMenu": "子菜單", - "updateBuiltInMenu": "更新內寘選單" - } - }, - "demo": { - "icons": { - "title": "圖標", - "describle": "點擊圖標即可複製圖標代碼" - }, - "table": { - "title": "表格" - } - } -} diff --git a/sport-erp-admin/index.html b/sport-erp-admin/index.html deleted file mode 100644 index a2be37c..0000000 --- a/sport-erp-admin/index.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - -
- - - diff --git a/sport-erp-admin/js_sdk/ext-storage/uploadFileForExtStorage.js b/sport-erp-admin/js_sdk/ext-storage/uploadFileForExtStorage.js deleted file mode 100644 index 9f1688d..0000000 --- a/sport-erp-admin/js_sdk/ext-storage/uploadFileForExtStorage.js +++ /dev/null @@ -1,204 +0,0 @@ -/** - * 设置 uniCloud.uploadFile 默认上传到扩展存储 - * @param {String} provider 云储存供应商 - * @value unicloud 内置存储 - * @value extStorage 扩展存储 - * @param {String} domain 自定义域名,仅扩展存储有效 - * @param {Boolean} fileID2fileURL 是否将fileID转为fileURL - * @param {Function} uploadFileOptions 获取上传参数的函数,仅扩展存储有效 - */ -function init(options = {}) { - let { - provider: defaultProvider, - } = options; - let originalDefaultProvider = defaultProvider; - let extStorage = new ExtStorage(options); - - const uploadFile = uniCloud.uploadFile; - uniCloud.uploadFile = (...e) => { - let options = e[0] || {}; - let { - provider = defaultProvider - } = options; - if (provider === "extStorage") { - return extStorage.uploadFile(...e); - } else { - return uploadFile(...e); - } - } - - const getTempFileURL = uniCloud.getTempFileURL; - uniCloud.getTempFileURL = (...e) => { - let options = e[0] || {}; - let { - provider = defaultProvider - } = options; - if (provider === "extStorage") { - return extStorage.getTempFileURL(...e); - } else { - return getTempFileURL(...e); - } - } - - const deleteFile = uniCloud.deleteFile; - uniCloud.deleteFile = (...e) => { - let options = e[0] || {}; - let { - provider = defaultProvider - } = options; - if (provider === "extStorage") { - return extStorage.deleteFile(...e); - } else { - return deleteFile(...e); - } - } - - uniCloud.setCloudStorage = (data={}) => { - let { - provider, - domain, - fileID2fileURL, - } = data; - if (provider === null) { - defaultProvider = originalDefaultProvider; - } else if (provider) { - defaultProvider = provider; - } - if (domain) extStorage.domain = domain; - if (fileID2fileURL) extStorage.fileID2fileURL = fileID2fileURL; - } - -} - -export default { - init -} - -class ExtStorage { - constructor(data = {}) { - let { - uploadFileOptions, - domain, - fileID2fileURL - } = data; - this.uploadFileOptions = uploadFileOptions; - this.domain = domain; - this.fileID2fileURL = fileID2fileURL; - } - - // 上传文件 - uploadFile(options) { - let { - filePath, - cloudPath, - } = options; - const promiseRes = new Promise(async (resolve, reject) => { - try { - const uploadFileOptionsRes = await this.uploadFileOptions({ - cloudPath, - domain: this.domain - }); - const uploadTask = uni.uploadFile({ - ...uploadFileOptionsRes.uploadFileOptions, // 上传文件所需参数 - filePath, // 本地文件路径 - success: (uploadFileRes) => { - if (uploadFileRes.statusCode !== 200) { - const err = uploadFileRes; - if (typeof options.fail === "function") options.fail(err); - reject(err); - } else { - const res = { - cloudPath: uploadFileOptionsRes.cloudPath, // 文件云端路径 - fileID: uploadFileOptionsRes.fileID, // 文件ID - fileURL: uploadFileOptionsRes.fileURL, // 文件URL(如果是私有权限,则此URL是无法直接访问的) - }; - if (this.fileID2fileURL) { - res.fileID = `https://${this.domain}/${res.cloudPath}`; - } - if (typeof options.success === "function") options.success(res); - resolve(res); - } - }, - fail: (err) => { - if (typeof options.fail === "function") options.fail(err); - reject(err); - }, - complete: () => { - if (typeof options.complete === "function") options.complete(); - } - }); - // 监听上传进度 - uploadTask.onProgressUpdate((progressEvent) => { - if (typeof options.onUploadProgress === "function") { - const total = progressEvent.totalBytesExpectedToSend; - const loaded = progressEvent.totalBytesSent; - const progress = Math.round(loaded * 100 / total); - options.onUploadProgress({ - total, - loaded, - progress - }); - } - }); - } catch (err) { - if (typeof options.fail === "function") options.fail(err); - reject(err); - if (typeof options.complete === "function") options.complete(); - } - }); - promiseRes.catch(() => { - - }); - return promiseRes; - } - - // 获取临时文件下载地址 - getTempFileURL(options = {}) { - let { - fileList - } = options; - - return new Promise((resolve, reject) => { - let res = { - fileList: fileList.map((item, index) => { - let cloudPath = getCloudPath(item); - return { - fileID: item, - tempFileURL: `https://${this.domain}/${cloudPath}` - } - }) - } - if (typeof options.success === "function") options.success(res); - resolve(res); - if (typeof options.complete === "function") options.complete(); - }); - } - - // 删除文件 - deleteFile(options = {}) { - // 扩展存储不允许前端删除文件(故此处直接返回) - return new Promise((resolve, reject) => { - let res = { - fileList: [] - }; - if (typeof options.success === "function") options.success(res); - resolve(res); - if (typeof options.complete === "function") options.complete(); - }); - } - -} - -function getCloudPath(cloudPath) { - const qiniuPrefix = 'qiniu://'; - if (cloudPath.indexOf(qiniuPrefix) === 0) { - cloudPath = cloudPath.substring(qiniuPrefix.length); - } else if (cloudPath.indexOf('http://') === 0 || cloudPath.indexOf('https://') === 0) { - let startIndex = cloudPath.indexOf('://') + 3; - startIndex = cloudPath.indexOf('/', startIndex); - let endIndex = cloudPath.indexOf('?') === -1 ? cloudPath.length : cloudPath.indexOf('?'); - endIndex = cloudPath.indexOf('#') !== -1 && cloudPath.indexOf('#') < endIndex ? cloudPath.indexOf('#') : endIndex; - cloudPath = cloudPath.substring(startIndex + 1, endIndex); - } - return cloudPath -} diff --git a/sport-erp-admin/js_sdk/uni-admin/constants.js b/sport-erp-admin/js_sdk/uni-admin/constants.js deleted file mode 100644 index 2c5d0f3..0000000 --- a/sport-erp-admin/js_sdk/uni-admin/constants.js +++ /dev/null @@ -1,66 +0,0 @@ -const uniAdminPrefix = 'UNI_ADMIN' - -export const MENU = `${uniAdminPrefix}_MENU` - -/** uni-id 云端错误码 */ -export const UNI_ID_ERR_CODE = { - /** 登陆状态失效,token已过期 */ - TOKEN_EXPIRED: 'UNI-ID-TOKEN-EXPIRED', - /** token校验未通过 */ - CHECK_TOKEN_FAILED: 'uni-id-check-token-failed', - /** 账户已存在 */ - ACCOUNT_EXISTS: 'uni-id-account-exists', - /** 账户不存在 */ - ACCOUNT_NOT_EXISTS: 'uni-id-account-not-exists', - /** 用户账号冲突,可能会由开发者手动更新数据库导致,正常情况下不应 */ - ACCOUNT_CONFLICT: 'uni-id-account-conflict', - /** 此账号已封禁 */ - ACCOUNT_BANNED: 'uni-id-account-banned', - /** 此账号正在审核中 */ - ACCOUNT_AUDITING: 'uni-id-account-auditing', - /** 此账号审核失败 */ - ACCOUNT_AUDIT_FAILED: 'uni-id-account-audit-failed', - /** 此账号已注销 */ - ACCOUNT_CLOSED: 'uni-id-account-closed', - /** 请输入图形验证码 */ - CAPTCHA_REQUIRED: 'uni-id-captcha-required', - /** 用户名或密码错误 */ - PASSWORD_ERROR: 'uni-id-password-error', - /** 用户名不合法 */ - INVALID_USERNAME: 'uni-id-invalid-username', - /** 密码不合法 */ - INVALID_PASSWORD: 'uni-id-invalid-password', - /** 手机号码不合法 */ - INVALID_MOBILE: 'uni-id-invalid-mobile', - /** 邮箱不合法 */ - INVALID_EMAIL: 'uni-id-invalid-email', - /** 昵称不合法 */ - INVALID_NICKNAME: 'uni-id-invalid-nickname', - /** 参数错误 */ - INVALID_PARAM: 'uni-id-invalid-param', - /** 缺少参数 */ - PARAM_REQUIRED: 'uni-id-param-required', - /** 获取第三方账号失败 */ - GET_THIRD_PARTY_ACCOUNT_FAILED: 'uni-id-get-third-party-account-failed', - /** 获取第三方用户信息失败 */ - GET_THIRD_PARTY_USER_INFO_FAILED: 'uni-id-get-third-party-user-info-failed', - /** 手机验证码错误或已过期 */ - MOBILE_VERIFY_CODE_ERROR: 'uni-id-mobile-verify-code-error', - /** 邮箱验证码错误或已过期 */ - EMAIL_VERIFY_CODE_ERROR: 'uni-id-email-verify-code-error', - /** 超级管理员已存在 */ - ADMIN_EXISTS: 'uni-id-admin-exists', - /** 权限错误 */ - PERMISSION_ERROR: 'uni-id-permission-error', - /** 系统错误 */ - SYSTEM_ERROR: 'uni-id-system-error', - /** 设置邀请码失败 */ - SET_INVITE_CODE_FAILED: 'uni-id-set-invite-code-failed', - /** 邀请码不可用 */ - INVALID_INVITE_CODE: 'uni-id-invalid-invite-code', - /** 禁止修改邀请人 */ - CHANGE_INVITER_FORBIDDEN: 'uni-id-change-inviter-forbidden', - /** 此账号(微信、QQ、手机号等)已被绑定 */ - BIND_CONFLICT: 'uni-id-bind-conflict', - -} diff --git a/sport-erp-admin/js_sdk/uni-admin/error.js b/sport-erp-admin/js_sdk/uni-admin/error.js deleted file mode 100644 index 95c9b64..0000000 --- a/sport-erp-admin/js_sdk/uni-admin/error.js +++ /dev/null @@ -1,42 +0,0 @@ -import store from '@/store' -import config from '@/admin.config.js' - -// #ifndef VUE3 -export function initError(Vue) { - const debugOptions = config.navBar.debug - if (debugOptions && debugOptions.enable === true) { - const oldErrorHandler = Vue.config.errorHandler - Vue.config.errorHandler = function errorHandler(err, vm, info) { - console.error(err) - const route = vm.$page && vm.$page.route - store.dispatch('error/add', { - err: err.toString(), - info, - route, - time: new Date().toLocaleTimeString() - }) - return oldErrorHandler(err, vm, info) - } - } -} -// #endif - -// #ifdef VUE3 -export function initError(app) { - const debugOptions = config.navBar.debug - if (debugOptions && debugOptions.enable === true) { - const oldErrorHandler = app.config.errorHandler - app.config.errorHandler = function errorHandler(err, vm, info) { - console.error(err) - const route = vm.$page && vm.$page.route - store.dispatch('error/add', { - err: err.toString(), - info, - route, - time: new Date().toLocaleTimeString() - }) - return oldErrorHandler && oldErrorHandler(err, vm, info) - } - } -} -// #endif diff --git a/sport-erp-admin/js_sdk/uni-admin/fetchMock.js b/sport-erp-admin/js_sdk/uni-admin/fetchMock.js deleted file mode 100644 index 62749cc..0000000 --- a/sport-erp-admin/js_sdk/uni-admin/fetchMock.js +++ /dev/null @@ -1,23 +0,0 @@ -function fetchMock(url) { - // return fetch(url) - // .then(response => response.json()) - // .then(res => { - // return Promise.resolve(res) - // }).catch(err => { - // return Promise.resolve([]) - // }) - - return Promise.resolve([]) -} - -// #ifndef VUE3 -export function initFetch(Vue) { - Vue.prototype.$fetch = fetchMock -} -// #endif - -// #ifdef VUE3 -export function initFetch(app) { - app.config.globalProperties.$fetch = fetchMock -} -// #endif diff --git a/sport-erp-admin/js_sdk/uni-admin/interceptor.js b/sport-erp-admin/js_sdk/uni-admin/interceptor.js deleted file mode 100644 index c714f5e..0000000 --- a/sport-erp-admin/js_sdk/uni-admin/interceptor.js +++ /dev/null @@ -1,21 +0,0 @@ -import config from '@/admin.config.js' - -export function initInterceptor() { - let isNavigatingToError = false - - uni.addInterceptor('navigateTo', { - invoke({ url }) { - isNavigatingToError = url && url.startsWith(config.error.url) ? true : false; - }, - fail: ({ errMsg }) => { - if (errMsg.indexOf('is not found') !== -1) { - // 避免错误页面本身不存在时产生死循环 - if (!isNavigatingToError) { - uni.navigateTo({ - url: config.error.url + '?errMsg=' + errMsg - }) - } - } - } - }) -} diff --git a/sport-erp-admin/js_sdk/uni-admin/permission.js b/sport-erp-admin/js_sdk/uni-admin/permission.js deleted file mode 100644 index 13eba8c..0000000 --- a/sport-erp-admin/js_sdk/uni-admin/permission.js +++ /dev/null @@ -1,27 +0,0 @@ -// #ifndef VUE3 -export function initPermission(Vue) { - Vue.prototype.$hasPermission = function hasPermission(name) { - const permission = this.$uniIdPagesStore.store.userInfo.permission || [] - const role = this.$uniIdPagesStore.store.userInfo.role || [] - return role.indexOf('admin') > -1 || permission.indexOf(name) > -1 - } - Vue.prototype.$hasRole = function hasRole(name) { - const role = this.$uniIdPagesStore.store.userInfo.role || [] - return role.indexOf(name) > -1 - } -} -// #endif - -// #ifdef VUE3 -export function initPermission(app) { - app.config.globalProperties.$hasPermission = function hasPermission(name) { - const permission = this.$uniIdPagesStore.store.userInfo.permission || [] - const role = this.$uniIdPagesStore.store.userInfo.role || [] - return role.indexOf('admin') > -1 || permission.indexOf(name) > -1 - } - app.config.globalProperties.$hasRole = function hasRole(name) { - const role = this.$uniIdPagesStore.store.userInfo.role || [] - return role.indexOf(name) > -1 - } -} -// #endif diff --git a/sport-erp-admin/js_sdk/uni-admin/plugin.js b/sport-erp-admin/js_sdk/uni-admin/plugin.js deleted file mode 100644 index 0de7829..0000000 --- a/sport-erp-admin/js_sdk/uni-admin/plugin.js +++ /dev/null @@ -1,34 +0,0 @@ -import { - initUtil -} from './util.js' -import { - initError -} from './error.js' -import { - initRequest -} from './request.js' -import { - initFetch -} from './fetchMock.js' -import { - initPermission -} from './permission.js' -import { - initInterceptor -} from './interceptor.js' - -import { - initUniIdPageStore -} from "../uni-id-pages/store" - -export default { - install(Vue) { - initUtil(Vue) - initError(Vue) - initUniIdPageStore(Vue) - initRequest(Vue) - initFetch(Vue) - initPermission(Vue) - initInterceptor() - } -} diff --git a/sport-erp-admin/js_sdk/uni-admin/request.js b/sport-erp-admin/js_sdk/uni-admin/request.js deleted file mode 100644 index 5c933db..0000000 --- a/sport-erp-admin/js_sdk/uni-admin/request.js +++ /dev/null @@ -1,77 +0,0 @@ -import store from '@/store/index.js' -import config from '@/admin.config.js' -const debugOptions = config.navBar.debug - -const db = uniCloud.database() - -export function request (action, params, options) { - const {objectName, functionName, showModal, ...objectOptions} = Object.assign({ - objectName: 'uni-id-co', - functionName: '', - showModal: false, - - customUI: true, - loadingOptions: { - title: 'xxx' - }, - }, options) - - // 兼容 云函数 与 云对象 请求,默认为云对象 - let call - if (functionName) { - call = uniCloud.callFunction({ - name: functionName, - data: { - action, - params - } - }) - } else { - const uniCloudObject = uniCloud.importObject(objectName, objectOptions) - call = uniCloudObject[action](params) - } - - return call.then(result => { - result = functionName ? result.result: result - if (!result) { - return Promise.resolve(result) - } - - if (result.errCode) { - return Promise.reject(result) - } - - return Promise.resolve(result) - - }).catch(err => { - showModal && uni.showModal({ - content: err.errMsg || '请求服务失败', - showCancel: false - }) - // #ifdef H5 - const noDebugPages = ['/uni_modules/uni-id-pages/pages/login/login-withpwd', '/uni_modules/uni-id-pages/pages/register/register'] - const path = location.hash.split('#')[1] - if (debugOptions && debugOptions.enable === true && noDebugPages.indexOf(path) === -1) { - store.dispatch('error/add', { - err: err.toString(), - info: '$request("' + action + '")', - route: '', - time: new Date().toLocaleTimeString() - }) - } - // #endif - return Promise.reject(err) - }) -} - -// #ifndef VUE3 -export function initRequest(Vue) { - Vue.prototype.$request = request -} -// #endif - -// #ifdef VUE3 -export function initRequest(app) { - app.config.globalProperties.$request = request -} -// #endif diff --git a/sport-erp-admin/js_sdk/uni-admin/util.js b/sport-erp-admin/js_sdk/uni-admin/util.js deleted file mode 100644 index 2f512fd..0000000 --- a/sport-erp-admin/js_sdk/uni-admin/util.js +++ /dev/null @@ -1,29 +0,0 @@ -import { - formatDate -} from '@/uni_modules/uni-dateformat/components/uni-dateformat/date-format.js' - -function formatBytes(bytes) { - const sizes = ['B', 'KB', 'MB', 'GB', 'TB'] - if (bytes == 0) { - return 'n/a' - } - const i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024))) - if (i == 0) { - return bytes + ' ' + sizes[i] - } - return (bytes / Math.pow(1024, i)).toFixed(1) + ' ' + sizes[i] -} - -// #ifndef VUE3 -export function initUtil(Vue) { - Vue.prototype.$formatDate = formatDate - Vue.prototype.$formatBytes = formatBytes -} -// #endif - -// #ifdef VUE3 -export function initUtil(app) { - app.config.globalProperties.$formatDate = formatDate - app.config.globalProperties.$formatBytes = formatBytes -} -// #endif \ No newline at end of file diff --git a/sport-erp-admin/js_sdk/uni-id-pages/store.js b/sport-erp-admin/js_sdk/uni-id-pages/store.js deleted file mode 100644 index f11e350..0000000 --- a/sport-erp-admin/js_sdk/uni-id-pages/store.js +++ /dev/null @@ -1,13 +0,0 @@ -import * as uniIdPagesStore from '@/uni_modules/uni-id-pages/common/store' - -// #ifndef VUE3 -export function initUniIdPageStore(Vue) { - Vue.prototype.$uniIdPagesStore = uniIdPagesStore -} -// #endif - -// #ifdef VUE3 -export function initUniIdPageStore(app) { - app.config.globalProperties.$uniIdPagesStore = uniIdPagesStore -} -// #endif diff --git a/sport-erp-admin/js_sdk/uni-stat/timeUtil.js b/sport-erp-admin/js_sdk/uni-stat/timeUtil.js deleted file mode 100644 index 98e6e5a..0000000 --- a/sport-erp-admin/js_sdk/uni-stat/timeUtil.js +++ /dev/null @@ -1,186 +0,0 @@ -/** - * 时间工具类 - */ -let timeUtil = {}; - -// 尽可能的将参数转成正确的时间对象 -timeUtil.getDateObject = function(date) { - if (!date) return ""; - let nowDate; - // 如果是字符串,且纯数字,则强制转数值 - if (typeof date === "string" && !isNaN(date)) date = Number(date); - if (typeof date === "number") { - if (date.toString().length === 10) date *= 1000; - nowDate = new Date(date); // 转时间对象 - } else if (typeof date === "object") { - nowDate = new Date(date.getTime()); // 新建一个时间对象 - } - return nowDate; -}; - -/** - * 日期格式化 - * @param {Date || Number} date 需要格式化的时间 - * timeUtil.timeFormat(new Date(),"yyyy-MM-dd hh:mm:ss"); - */ -timeUtil.timeFormat = function(date, fmt = 'yyyy-MM-dd hh:mm:ss') { - try { - if (!date) return ""; - let nowDate = timeUtil.getDateObject(date); - let opt = { - "M+": nowDate.getMonth() + 1, //月份 - "d+": nowDate.getDate(), //日 - "h+": nowDate.getHours(), //小时 - "m+": nowDate.getMinutes(), //分 - "s+": nowDate.getSeconds(), //秒 - //"w+": nowDate.getDay(), //周 - "q+": Math.floor((nowDate.getMonth() + 3) / 3), //季度 - "S": nowDate.getMilliseconds() //毫秒 - }; - if (/(y+)/.test(fmt)) { - fmt = fmt.replace(RegExp.$1, (nowDate.getFullYear() + "").substr(4 - RegExp.$1.length)); - } - for (let k in opt) { - if (new RegExp("(" + k + ")").test(fmt)) { - fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (opt[k]) : (("00" + opt[k]).substr(("" + opt[k]).length))); - } - } - return fmt; - } catch (err) { - // 若格式错误,则原值显示 - return time; - } -}; - -/** - * 解析日期对象属性 - * @param {Date || Number} date 需要转换的时间 - * timeUtil.getDateInfo(new Date()); - */ -timeUtil.getDateInfo = function(date = new Date()) { - let nowDate = timeUtil.getDateObject(date); - let year = nowDate.getFullYear() + ''; - let month = (nowDate.getMonth() + 1 < 10 ? '0' + (nowDate.getMonth() + 1) : nowDate.getMonth() + 1); - let day = (nowDate.getDate() < 10 ? '0' + (nowDate.getDate()) : nowDate.getDate()); - let hour = (nowDate.getHours() < 10 ? '0' + (nowDate.getHours()) : nowDate.getHours()); - let minute = (nowDate.getMinutes() < 10 ? '0' + (nowDate.getMinutes()) : nowDate.getMinutes()); - let second = (nowDate.getSeconds() < 10 ? '0' + (nowDate.getSeconds()) : nowDate.getSeconds()); - let millisecond = nowDate.getMilliseconds(); //毫秒 - let week = nowDate.getDay(); // 周 - let quarter = Math.floor((nowDate.getMonth() + 3) / 3); //季度 - return { - year: Number(year), - month: Number(month), - day: Number(day), - hour: Number(hour), - minute: Number(minute), - second: Number(second), - millisecond: Number(millisecond), - week: Number(week), - quarter: Number(quarter), - }; -}; - -/** - * 获得相对当前时间的偏移 count 小时、天、周、月、季度、年的起止日期(开始和结束时间戳) - * @param {Number} count 偏移量 - * @param {Date || Number} date 指定从哪个时间节点开始计算 - * timeUtil.getOffsetStartAndEnd("hour", 0); - * timeUtil.getOffsetStartAndEnd("day", 0); - * timeUtil.getOffsetStartAndEnd("week", 0); - * timeUtil.getOffsetStartAndEnd("month", 0); - * timeUtil.getOffsetStartAndEnd("quarter", 0); - * timeUtil.getOffsetStartAndEnd("year", 0); - */ -timeUtil.getOffsetStartAndEnd = function(type="day", count = 0, date = new Date()) { - let startTime, endTime; - let nowDate = timeUtil.getDateObject(date); - if (type === "hour") { - // 小时 - // 一小时毫秒数 - let offsetMillisecond = 1000 * 60 * 60; - // 相对于当前日期count个天的日期 - let dateInfo = timeUtil.getDateInfo(new Date(nowDate.getTime() + (offsetMillisecond * 1 * count))); - // 获得当天的起始时间 - startTime = new Date(`${dateInfo.year}/${dateInfo.month}/${dateInfo.day} ${dateInfo.hour}:00:00`).getTime(); - // 获得当天的结束时间 - endTime = new Date(`${dateInfo.year}/${dateInfo.month}/${dateInfo.day} ${dateInfo.hour}:00:00`).getTime() + (offsetMillisecond -1); - } else if (type === "day") { - // 天 - // 一天的毫秒数 - let offsetMillisecond = 1000 * 60 * 60 * 24; - // 相对于当前日期count个天的日期 - let dateInfo = timeUtil.getDateInfo(new Date(nowDate.getTime() + (offsetMillisecond * 1 * count))); - // 获得当天的起始时间 - startTime = new Date(`${dateInfo.year}/${dateInfo.month}/${dateInfo.day}`).getTime(); - // 获得当天的结束时间 - endTime = new Date(`${dateInfo.year}/${dateInfo.month}/${dateInfo.day}`).getTime() + (offsetMillisecond - 1); - } else if (type === "week") { - // 周 - nowDate.setDate(nowDate.getDate() - nowDate.getDay() + 1 + count * 7); - let dateInfo1 = timeUtil.getDateInfo(nowDate); - nowDate.setDate(nowDate.getDate() + 7); - let dateInfo2 = timeUtil.getDateInfo(nowDate); - // 开始时间 - startTime = new Date(`${dateInfo1.year}/${dateInfo1.month}/${dateInfo1.day}`).getTime(); - // 结束时间 - endTime = new Date(`${dateInfo2.year}/${dateInfo2.month}/${dateInfo2.day}`).getTime() - 1; - } else if (type === "month") { - // 月 - let dateInfo = timeUtil.getDateInfo(nowDate); - let month = dateInfo.month + count; - let year = dateInfo.year; - if (month > 12) { - year = year + Math.floor(month / 12); - month = Math.abs(month) % 12; - } else if (month <= 0) { - year = year - 1 - Math.floor(Math.abs(month) / 12); - month = 12 - Math.abs(month) % 12; - } - let month_last_day = new Date(year, month, 0).getDate(); - // 开始时间 - startTime = new Date(`${year}/${month}/1`).getTime(); - // 结束时间 - endTime = new Date(`${year}/${month}/${month_last_day}`).getTime() + (24 * 60 * 60 * 1000 - 1); - } else if (type === "quarter") { - // 季度 - nowDate.setMonth(nowDate.getMonth() + count * 3); - let dateInfo = timeUtil.getDateInfo(nowDate); - let month = dateInfo.month; - if ([1, 2, 3].indexOf(month) > -1) { - // 第1季度 - month = 1; - } else if ([4, 5, 6].indexOf(month) > -1) { - // 第2季度 - month = 4; - } else if ([7, 8, 9].indexOf(month) > -1) { - // 第3季度 - month = 7; - } else if ([10, 11, 12].indexOf(month) > -1) { - // 第4季度 - month = 10; - } - nowDate.setMonth(month - 1); // 因为0代表1月,所以这里要减1 - let dateInfo1 = timeUtil.getDateInfo(nowDate); - nowDate.setMonth(nowDate.getMonth() + 3); - let dateInfo2 = timeUtil.getDateInfo(nowDate); - // 开始时间 - startTime = new Date(`${dateInfo1.year}/${dateInfo1.month}/1`).getTime(); - // 结束时间 - endTime = new Date(`${dateInfo2.year}/${dateInfo2.month}/1`).getTime() - 1; - } else if (type === "year") { - // 年 - let dateInfo = timeUtil.getDateInfo(nowDate); - let year = dateInfo.year + count; - // 开始时间 - startTime = new Date(`${year}/1/1`).getTime(); - // 结束时间 - endTime = new Date(`${year}/12/31`).getTime() + (24 * 60 * 60 * 1000 - 1); - } - return { - startTime, - endTime - }; -}; - -export default timeUtil; diff --git a/sport-erp-admin/js_sdk/uni-stat/util.js b/sport-erp-admin/js_sdk/uni-stat/util.js deleted file mode 100644 index 750e2de..0000000 --- a/sport-erp-admin/js_sdk/uni-stat/util.js +++ /dev/null @@ -1,497 +0,0 @@ -/** - * 以下为 uni-stat 的工具方法 - */ - -// 千分位 -function regexHandleNum(num) { - return String(num).replace(/\B(?=(\d{3})+(?!\d))/g, ','); // 3是千分位,4是万分位 -} - -// 新版格式化字段数据函数 -function formatterData(object) { - let { - fieldsMap, - data, - formatter = true - } = object; - let rows = JSON.parse(JSON.stringify(data)); - rows.map((row) => { - for (let key in row) { - let fieldItem = fieldsMap.find((item) => { - return item.field == key; - }); - if (typeof fieldItem === "object") { - let { - fix = 0, - } = fieldItem; - if (typeof fieldItem.multiple === "number" && typeof row[key] === "number") { - row[key] = Number((row[key] * fieldItem.multiple).toFixed(fix)); - } - if (formatter && fieldItem.formatter && typeof row[key] === "number") { - if (fieldItem.formatter === ",") { - row[key] = regexHandleNum(row[key]); - } else if (fieldItem.formatter === "%") { - row[key] = `${(row[key] * 100).toFixed(fix)}%` - } else if (fieldItem.formatter === "-") { - // 时分秒格式 - row[key] = parseDateTime(row[key]); - } - } - } - } - }); - return rows; -} - -// 补全趋势图的数据 -function fillTrendChartData(data, query, fieldsMap) { - let { start_time, dimension } = query; - if (["hour","day"].indexOf(dimension)>-1){ - let timeArr = []; - let oneTime; - if (dimension === "hour"){ - oneTime = 1000*3600; - } else if (dimension === "day"){ - oneTime = 1000*3600*24; - } - let start = start_time[0]; - let end = start_time[1]; - let nowTime = start; - timeArr = [start]; - while ((nowTime+oneTime)<=end){ - nowTime += oneTime; - timeArr.push(nowTime); - } - - let newData = []; - for (let i = 0; i < timeArr.length; i++) { - let time = timeArr[i]; - let dataItem = data.find((item, index) => { - return item.start_time === time; - }); - if (dataItem) { - newData.push(dataItem); - } else { - let obj = { - start_time: time - }; - fieldsMap.map((item, index) => { - obj[item.field] = 0; - }); - - newData.push(obj); - } - } - return newData - } else { - return data; - } -} - - -// 将查询条件拼接为字符串 -function stringifyQuery(query, dimension = false, delArrs = []) { - const queryArr = [] - const keys = Object.keys(query) - const time = query.start_time - keys.forEach(key => { - if (key === 'time_range' || delArrs.indexOf(key) !== -1) return - let val = query[key] - if (val) { - if (typeof val === 'string' && val.indexOf(key) > -1) { - queryArr.push(val) - } else { - if (typeof val === 'string') { - val = `"${val}"` - } - if (Array.isArray(val)) { - if (val.length === 2 && key.indexOf('time') > -1) { - queryArr.push(`${key} >= ${val[0]} && ${key} <= ${val[1]}`) - } else { - val = val.map(item => `${key} == "${item}"`).join(' || ') - val && queryArr.push(`(${val})`) - } - } else if (dimension && key === 'dimension') { - if (maxDeltaDay(time)) { - queryArr.push(`dimension == "hour"`) - } else { - // 判断页面,仅在pages/uni-stat/device/trend/trend和pages/uni-stat/user/trend/trend页面下,放开按小时查询的时间限制 - let pages = getCurrentPages(); - let page = pages[pages.length-1]; - if (["pages/uni-stat/device/trend/trend","pages/uni-stat/user/trend/trend"].indexOf(page.route) > -1) { - // 放开按小时查询的时间限制 - queryArr.push(`${key} == ${val}`) - } else { - if (val && val !== `"hour"`) { - queryArr.push(`${key} == ${val}`) - } else { - queryArr.push(`dimension == "day"`) - } - } - } - } else { - queryArr.push(`${key} == ${val}`) - } - } - } - }) - const queryStr = queryArr.join(' && ') - return queryStr || {} -} - -// 根据页面字段配置 fieldsMap 数据计算、格式化字段 -function mapfields(map, data = {}, goal, prefix = '', prop = 'value') { - const goals = [], - argsGoal = goal - map = JSON.parse(JSON.stringify(map)) - const origin = JSON.parse(JSON.stringify(data)) - for (const mapper of map) { - let { - field, - computed, - formatter, - disable, - fix - } = mapper - if (!disable) { - goal = argsGoal || mapper - const hasValue = goal.hasOwnProperty(prop) - const preField = prefix + field - if (data) { - const value = data[preField] - if (computed) { - const computedFields = computed.split('/') - let [dividend, divisor] = computedFields - dividend = Number(origin[prefix + dividend]) - divisor = Number(origin[prefix + divisor]) - const val = format(division(dividend, divisor), formatter, fix) - if (hasValue && field === goal.field) { - goal[prop] = val - } else { - goal[field] = val - } - } else { - if (value) { - const val = format(value, formatter, fix) - if (hasValue) { - if (goal.field === field) { - goal[prop] = val - } - } else { - goal[field] = val - } - } - } - } - if (hasValue) { - goals.push(goal) - } - } - } - return goals -} - -// 将查询条件对象拼接为字符串,给 client db 的 field 属性消费 -function stringifyField(mapping, goal, prop) { - if (goal) { - mapping = mapping.filter(f => f.field === goal) - } - if (prop) { - mapping = mapping.filter(f => f.field && f.hasOwnProperty(prop)) - } - const fieldString = mapping.map(f => { - let fields = [] - if (f.computed) { - fields = f.computed.split('/') - } else { - fields.push(f.field) - } - fields = fields.map(field => { - if (f.stat === -1) { - return field - } else { - return `${field} as ${ 'temp_' + field}` - } - }) - return fields.join() - }) - return fieldString.join() -} - -// 将查询条件对象拼接为字符串,给 client db 的 groupField 属性消费 -function stringifyGroupField(mapping, goal, prop) { - if (goal) { - mapping = mapping.filter(f => f.field === goal) - } - if (prop) { - mapping = mapping.filter(f => f.field && f.hasOwnProperty(prop)) - } - const groupField = mapping.map(f => { - const stat = f.stat - let fields = [] - if (f.computed) { - fields = f.computed.split('/') - } else { - fields.push(f.field) - } - fields = fields.map(field => { - if (stat !== -1) { - return `${stat ? stat : 'sum' }(${'temp_' + field}) as ${field}` - } - }) - return fields.filter(Boolean).join() - }) - .filter(Boolean) - .join() - - return groupField -} - -// 除法函数 -function division(dividend, divisor) { - if (divisor) { - return dividend / divisor - } else { - return 0 - } -} - -// 对数字进行格式化,格式 type 配置在页面 fieldMap.js 中 -function format(num, type = ',', fix) { - // if (!type) return num - if (typeof num !== 'number') return num - if (type === '%') { - // 注意浮点数精度 - num = (num * 100) - if (String(num).indexOf('.') > -1) { - num = num.toFixed(2) - } - num = num ? num + type : num - return num - } else if (type === '%%') { - num = Number(num) - return num.toFixed(2) + '%' - } else if (type === '-') { - return formatDate(num, 'day') - } else if (type === ':') { - num = Math.ceil(num) - let h, m, s - h = m = s = 0 - const wunH = 60 * 60, - wunM = 60 // 单位秒, wun 通 one - if (num >= wunH) { - h = Math.floor(num / wunH) - const remainder = num % wunH - if (remainder >= wunM) { - m = Math.floor(remainder / wunM) - s = remainder % wunM - } else { - s = remainder - } - } else if (wunH >= num && num >= wunM) { - m = Math.floor(num / wunM) - s = num % wunM - } else { - s = num - } - const hms = [h, m, s].map(i => i < 10 ? '0' + i : i) - return hms.join(type) - } else if (type === ',') { - return num.toLocaleString() - } else { - if (String(num).indexOf('.') > -1) { - if (Math.abs(num) > 1) { - num = num.toFixed(fix || 0) - } else { - num = num.toFixed(fix || 2) - } - } - return num - } -} - -// 格式化日期,返回其所在的范围 -function formatDate(date, type) { - let d = new Date(date) - if (type === 'hour') { - let h = d.getHours() - h = h < 10 ? '0' + h : h - let str = `${h}:00 ~ ${h}:59` - if (h === "00") { - // 0 点的时候,显示为 yyyy-mm-dd(00:00 ~ 00:59) - let firstday = parseDateTime(d) - str = firstday + "(00:00 ~ 00:59)"; - } - return str - } else if (type === 'week') { - const first = d.getDate() - d.getDay() + 1; // First day is the day of the month - the day of the week - const last = first + 6; // last day is the first day + 6 - let firstday = new Date(d.setDate(first)); - firstday = parseDateTime(firstday) - let lastday = new Date(d.setDate(last)); - lastday = parseDateTime(lastday) - return `${firstday} ~ ${lastday}` - } else if (type === 'month') { - let firstday = new Date(d.getFullYear(), d.getMonth(), 1); - firstday = parseDateTime(firstday) - let lastday = new Date(d.getFullYear(), d.getMonth() + 1, 0); - lastday = parseDateTime(lastday) - return `${firstday} ~ ${lastday}` - } else { - return parseDateTime(d) - } -} - -// 格式化日期,返回其 yyyy-mm-dd 格式 -function parseDateTime(datetime, type, splitor = '-') { - let d = datetime - if (typeof d !== 'object') { - d = new Date(d) - } - const year = d.getFullYear() - const month = d.getMonth() + 1 - const day = d.getDate() - const hour = d.getHours() - const minute = d.getMinutes() - const second = d.getSeconds() - const date = [year, lessTen(month), lessTen(day)].join(splitor) - const time = [lessTen(hour), lessTen(minute), lessTen(second)].join(':') - if (type === "dateTime") { - return date + ' ' + time - } - return date -} - -function lessTen(item) { - return item < 10 ? '0' + item : item -} - -// 获取指定日期当天或 n 天前零点的时间戳,丢弃时分秒 -function getTimeOfSomeDayAgo(days = 0, date = Date.now()) { - const d = new Date(date) - const oneDayTime = 24 * 60 * 60 * 1000 - let ymd = [d.getFullYear(), d.getMonth() + 1, d.getDate()].join('/') - ymd = ymd + ' 00:00:00' - const someDaysAgoTime = new Date(ymd).getTime() - oneDayTime * days - return someDaysAgoTime -} - -// 判断时间差值 delta,单位为天 -function maxDeltaDay(times, delta = 2) { - if (!times.length) return true - const wunDay = 24 * 60 * 60 * 1000 - const [start, end] = times - const max = end - start < wunDay * delta - return max -} - -// 查询 总设备数、总用户数, 通过 field 配置 -function getFieldTotal(query = this.query, field = "total_devices") { - let fieldTotal - if (typeof query === 'object') { - query = stringifyQuery(query, false, ['uni_platform']) - } - const db = uniCloud.database() - return db.collection('uni-stat-result') - .where(query) - .field(`${field} as temp_${field}, start_time`) - .groupBy('start_time') - .groupField(`sum(temp_${field}) as ${field}`) - .orderBy('start_time', 'desc') - .get() - .then(cur => { - const data = cur.result.data - fieldTotal = data.length && data[0][field] - fieldTotal = format(fieldTotal) - this.panelData && this.panelData.forEach(item => { - if (item.field === field) { - item.value = fieldTotal - } - }) - return Promise.resolve(fieldTotal) - }) -} - -// 防抖函数 -function debounce(fn, time = 100) { - let timer = null - return function(...args) { - if (timer) clearTimeout(timer) - timer = setTimeout(() => { - fn.apply(this, args) - }, time) - } -} - - -const files = {} - -function fileToUrl(file) { - for (const key in files) { - if (files.hasOwnProperty(key)) { - const oldFile = files[key] - if (oldFile === file) { - return key - } - } - } - let url = (window.URL || window.webkitURL).createObjectURL(file) - files[url] = file - return url -} -/** - * 获取两个时间戳之间的所有时间 - * let start = new Date(1642694400000) // 2022-01-21 00:00:00 - * let end = new Date(1643644800000) // 2022-02-01 00:00:00 - * dateList = getAllDateCN(date1, date2) - * @param {*} startTime - * @param {*} endTime - */ -function getAllDateCN(startTime, endTime) { - let date_all = []; - let i = 0; - while (endTime.getTime() - startTime.getTime() >= 0) { - // 获取日期和时间 - // let year = startTime.getFullYear() - // let month = startTime.getMonth() + 1 - // let day = startTime.getDate() - // let time = startTime.toLocaleTimeString() - date_all[i] = startTime.getTime() - - // 获取每天00:00:00的时间戳 - // date_all[i] = new Date(startTime.toLocaleDateString()).getTime() / 1000; - - // 天数+1 - startTime.setDate(startTime.getDate() + 1); - i += 1; - } - return date_all; -} - -function createUniStatQuery(object) { - return Object.assign({}, object, { - type: "native_app", - create_env: "uni-stat" - }) -} - - -export { - formatterData, - fillTrendChartData, - stringifyQuery, - stringifyField, - stringifyGroupField, - mapfields, - getTimeOfSomeDayAgo, - division, - format, - formatDate, - parseDateTime, - maxDeltaDay, - debounce, - fileToUrl, - getFieldTotal, - getAllDateCN, - createUniStatQuery -} diff --git a/sport-erp-admin/js_sdk/validator/opendb-admin-menus.js b/sport-erp-admin/js_sdk/validator/opendb-admin-menus.js deleted file mode 100644 index ac99690..0000000 --- a/sport-erp-admin/js_sdk/validator/opendb-admin-menus.js +++ /dev/null @@ -1,77 +0,0 @@ -// 校验规则由 schema 生成,请不要直接修改当前文件,如果需要请在uniCloud控制台修改schema -// uniCloud: https://unicloud.dcloud.net.cn/ - - - -export default { - "menu_id": { - "rules": [ - { - "required": true - }, - { - "format": "string" - } - ] - }, - "name": { - "rules": [ - { - "required": true - }, - { - "format": "string" - } - ] - }, - "icon": { - "rules": [ - { - "format": "string" - } - ] - }, - "url": { - "rules": [ - { - "format": "string" - }, - { - validateFunction:function(rule,value,data,callback){ - if (value !== "" && value.indexOf("http") === -1 && value.indexOf("/") !==0){ - callback('URL必须以/开头,如/pages/index/index') - } - return true - } - } - ] - }, - "sort": { - "rules": [ - { - "format": "int" - } - ] - }, - "parent_id": { - "rules": [ - { - "format": "string" - } - ] - }, - "permission": { - "rules": [ - { - "format": "array" - } - ] - }, - "enable": { - "rules": [ - { - "format": "bool" - } - ] - } -} diff --git a/sport-erp-admin/js_sdk/validator/opendb-app-list.js b/sport-erp-admin/js_sdk/validator/opendb-app-list.js deleted file mode 100644 index 0be596c..0000000 --- a/sport-erp-admin/js_sdk/validator/opendb-app-list.js +++ /dev/null @@ -1,133 +0,0 @@ -// 表单校验规则由 schema2code 生成,不建议直接修改校验规则,而建议通过 schema2code 生成, 详情: https://uniapp.dcloud.net.cn/uniCloud/schema - - -const validator = { - "appid": { - "rules": [{ - "required": true - }, - { - "format": "string" - } - ], - "label": "AppID" - }, - "name": { - "rules": [{ - "required": true - }, - { - "format": "string" - } - ], - "label": "应用名称" - }, - "app_type": { - "rules": [{ - "required": true - }, - { - "format": "int" - } - ], - "label": "应用类型" - }, - "icon_url": { - "rules": [{ - "format": "string" - }], - "label": "应用图标" - }, - "introduction": { - "rules": [{ - "format": "string" - }], - "label": "应用简介" - }, - "description": { - "rules": [{ - "format": "string" - }], - "label": "应用描述" - }, - "screenshot": { - "rules": [{ - "format": "array" - }], - "label": "应用截图" - }, - "create_date": { - "rules": [{ - "format": "timestamp" - }], - "label": "发行时间" - } -} - -function filterToWhere(filter, command) { - let where = {} - for (let field in filter) { - let { - type, - value - } = filter[field] - switch (type) { - case "search": - if (typeof value === 'string' && value.length) { - where[field] = new RegExp(value) - } - break; - case "select": - if (value.length) { - let selectValue = [] - for (let s of value) { - selectValue.push(command.eq(s)) - } - where[field] = command.or(selectValue) - } - break; - case "range": - if (value.length) { - let gt = value[0] - let lt = value[1] - where[field] = command.and([command.gte(gt), command.lte(lt)]) - } - break; - case "date": - if (value.length) { - let [s, e] = value - let startDate = new Date(s) - let endDate = new Date(e) - where[field] = command.and([command.gte(startDate), command.lte(endDate)]) - } - break; - case "timestamp": - if (value.length) { - let [startDate, endDate] = value - where[field] = command.and([command.gte(startDate), command.lte(endDate)]) - } - break; - } - } - return where -} -const enumConverter = {} -const mpPlatform = { - 'mp_weixin': '微信小程序', - 'mp_alipay': '支付宝小程序', - 'mp_baidu': '百度小程序', - 'mp_toutiao': '字节小程序', - 'mp_qq': 'QQ小程序', - 'mp_dingtalk': '钉钉小程序', - 'mp_kuaishou': '快手小程序', - 'mp_lark': '飞书小程序', - 'mp_jd': '京东小程序', - 'quickapp': '快应用' -} - -export { - enumConverter, - validator, - filterToWhere, - mpPlatform -} diff --git a/sport-erp-admin/js_sdk/validator/opendb-app-versions.js b/sport-erp-admin/js_sdk/validator/opendb-app-versions.js deleted file mode 100644 index bf955f8..0000000 --- a/sport-erp-admin/js_sdk/validator/opendb-app-versions.js +++ /dev/null @@ -1,222 +0,0 @@ -// 表单校验规则由 schema2code 生成,不建议直接修改校验规则,而建议通过 schema2code 生成, 详情: https://uniapp.dcloud.net.cn/uniCloud/schema - -const PLATFORM = [ - { - "value": "Android", - "text": "安卓" - }, - { - "value": "iOS", - "text": "苹果" - }, - { - "value": "Harmony", - "text": "鸿蒙 Next" - } -] - -const validator = { - "appid": { - "rules": [{ - "required": true - }, - { - "format": "string" - } - ], - "label": "AppID" - }, - "name": { - "rules": [{ - "format": "string" - }], - "label": "应用名称" - }, - "title": { - "rules": [{ - "format": "string" - }], - "label": "更新标题" - }, - "contents": { - "rules": [{ - "required": true - }, - { - "format": "string" - } - ], - "label": "更新内容" - }, - "platform": { - "rules": [{ - "required": true - }, - /* 此处不校验数据类型,因为platform在发布app端是单选,在发布wgt时可能是多选 - { - "format": "array" - }, */ - { - "range": PLATFORM - } - ], - "label": "平台" - }, - "type": { - "rules": [{ - "required": true - }, { - "format": "string" - }, - { - "range": [{ - "value": "native_app", - "text": "原生App安装包" - }, - { - "value": "wgt", - "text": "wgt资源包" - } - ] - } - ], - "label": "安装包类型" - }, - "version": { - "rules": [{ - "required": true - }, - { - "format": "string" - } - ], - "label": "版本号" - }, - "min_uni_version": { - "rules": [{ - "format": "string" - }], - "label": "原生App最低版本" - }, - "url": { - "rules": [{ - "required": true - }, { - "format": "string" - }], - "label": "链接" - }, - "stable_publish": { - "rules": [{ - "format": "bool" - }], - "label": "上线发行" - }, - "create_date": { - "rules": [{ - "format": "timestamp" - }], - "label": "上传时间" - }, - "is_silently": { - "rules": [{ - "format": "bool" - }], - "label": "静默更新", - "defaultValue": false - }, - "is_mandatory": { - "rules": [{ - "format": "bool" - }], - "label": "强制更新", - "defaultValue": false - }, - "uni_platform": { - "rules": [ - { - "required": true - }, - { - "format": "string" - } - ], - "label": "uni 平台" - }, - "create_env": { - "rules": [ - { - "required": true - }, - { - "format": "string" - } - ] - }, - "store_list": { - "rules": [{ - "format": "array" - }], - "label": "应用市场" - }, -} - -const enumConverter = { - "platform_valuetotext": PLATFORM, - "type_valuetotext": { - "native_app": "原生App安装包", - "wgt": "wgt资源包" - } -} - -function filterToWhere(filter, command) { - let where = {} - for (let field in filter) { - let { type, value } = filter[field] - switch (type) { - case "search": - if (typeof value === 'string' && value.length) { - where[field] = new RegExp(value) - } - break; - case "select": - if (value.length) { - let selectValue = [] - for (let s of value) { - selectValue.push(command.eq(s)) - } - where[field] = command.or(selectValue) - } - break; - case "range": - if (value.length) { - let gt = value[0] - let lt = value[1] - where[field] = command.and([command.gte(gt), command.lte(lt)]) - } - break; - case "date": - if (value.length) { - let [s, e] = value - let startDate = new Date(s) - let endDate = new Date(e) - where[field] = command.and([command.gte(startDate), command.lte(endDate)]) - } - break; - case "timestamp": - if (value.length) { - let [startDate, endDate] = value - where[field] = command.and([command.gte(startDate), command.lte(endDate)]) - } - break; - } - } - return where -} - - -export { - validator, - enumConverter, - filterToWhere -} diff --git a/sport-erp-admin/js_sdk/validator/uni-id-log.js b/sport-erp-admin/js_sdk/validator/uni-id-log.js deleted file mode 100644 index dd4ee2c..0000000 --- a/sport-erp-admin/js_sdk/validator/uni-id-log.js +++ /dev/null @@ -1,38 +0,0 @@ -// 校验规则由 schema 生成,请不要直接修改当前文件,如果需要请在uniCloud控制台修改schema -// uniCloud: https://unicloud.dcloud.net.cn/ - - - -export default { - "user_name": { - "rules": [ - { - "format": "string" - } - ] - }, - "content": { - "rules": [ - { - "required": true - }, - { - "format": "string" - } - ] - }, - "ip": { - "rules": [ - { - "format": "string" - } - ] - }, - "create_date": { - "rules": [ - { - "format": "timestamp" - } - ] - } -} diff --git a/sport-erp-admin/js_sdk/validator/uni-id-permissions.js b/sport-erp-admin/js_sdk/validator/uni-id-permissions.js deleted file mode 100644 index 2147c81..0000000 --- a/sport-erp-admin/js_sdk/validator/uni-id-permissions.js +++ /dev/null @@ -1,84 +0,0 @@ -// 表单校验规则由 schema2code 生成,不建议直接修改校验规则,而建议通过 schema2code 生成, 详情: https://uniapp.dcloud.net.cn/uniCloud/schema - - -const validator = { - "permission_id": { - "rules": [ - { - "required": true - }, - { - "format": "string" - } - ], - "label": "权限标识" - }, - "permission_name": { - "rules": [ - { - "required": true - }, - { - "format": "string" - } - ], - "label": "权限名称" - }, - "comment": { - "rules": [ - { - "format": "string" - } - ], - "label": "备注" - } -} - -const enumConverter = {} - -function filterToWhere(filter, command) { - let where = {} - for (let field in filter) { - let { type, value } = filter[field] - switch (type) { - case "search": - if (typeof value === 'string' && value.length) { - where[field] = new RegExp(value) - } - break; - case "select": - if (value.length) { - let selectValue = [] - for (let s of value) { - selectValue.push(command.eq(s)) - } - where[field] = command.or(selectValue) - } - break; - case "range": - if (value.length) { - let gt = value[0] - let lt = value[1] - where[field] = command.and([command.gte(gt), command.lte(lt)]) - } - break; - case "date": - if (value.length) { - let [s, e] = value - let startDate = new Date(s) - let endDate = new Date(e) - where[field] = command.and([command.gte(startDate), command.lte(endDate)]) - } - break; - case "timestamp": - if (value.length) { - let [startDate, endDate] = value - where[field] = command.and([command.gte(startDate), command.lte(endDate)]) - } - break; - } - } - return where -} - -export { validator, enumConverter, filterToWhere } diff --git a/sport-erp-admin/js_sdk/validator/uni-id-roles.js b/sport-erp-admin/js_sdk/validator/uni-id-roles.js deleted file mode 100644 index 96b594d..0000000 --- a/sport-erp-admin/js_sdk/validator/uni-id-roles.js +++ /dev/null @@ -1,99 +0,0 @@ -// 表单校验规则由 schema2code 生成,不建议直接修改校验规则,而建议通过 schema2code 生成, 详情: https://uniapp.dcloud.net.cn/uniCloud/schema - - -const validator = { - "role_id": { - "rules": [ - { - "required": true - }, - { - "format": "string" - } - ], - "label": "唯一ID" - }, - "role_name": { - "rules": [ - { - "required": true - }, - { - "format": "string" - } - ], - "label": "名称" - }, - "permission": { - "rules": [ - { - "format": "array" - } - ], - "label": "权限" - }, - "comment": { - "rules": [ - { - "format": "string" - } - ], - "label": "备注" - }, - "create_date": { - "rules": [ - { - "format": "timestamp" - } - ] - } -} - -const enumConverter = {} - -function filterToWhere(filter, command) { - let where = {} - for (let field in filter) { - let { type, value } = filter[field] - switch (type) { - case "search": - if (typeof value === 'string' && value.length) { - where[field] = new RegExp(value) - } - break; - case "select": - if (value.length) { - let selectValue = [] - for (let s of value) { - selectValue.push(command.eq(s)) - } - where[field] = command.or(selectValue) - } - break; - case "range": - if (value.length) { - let gt = value[0] - let lt = value[1] - where[field] = command.and([command.gte(gt), command.lte(lt)]) - } - break; - case "date": - if (value.length) { - let [s, e] = value - let startDate = new Date(s) - let endDate = new Date(e) - where[field] = command.and([command.gte(startDate), command.lte(endDate)]) - } - break; - case "timestamp": - if (value.length) { - let [startDate, endDate] = value - where[field] = command.and([command.gte(startDate), command.lte(endDate)]) - } - break; - } - } - return where -} - -export { validator, enumConverter, filterToWhere } diff --git a/sport-erp-admin/js_sdk/validator/uni-id-tag.js b/sport-erp-admin/js_sdk/validator/uni-id-tag.js deleted file mode 100644 index 4788f94..0000000 --- a/sport-erp-admin/js_sdk/validator/uni-id-tag.js +++ /dev/null @@ -1,84 +0,0 @@ -// 表单校验规则由 schema2code 生成,不建议直接修改校验规则,而建议通过 schema2code 生成, 详情: https://uniapp.dcloud.net.cn/uniCloud/schema - - -const validator = { - "tagid": { - "rules": [ - { - "required": true - }, - { - "format": "string" - } - ], - "label": "标签的tagid" - }, - "name": { - "rules": [ - { - "required": true - }, - { - "format": "string" - } - ], - "label": "标签名称" - }, - "description": { - "rules": [ - { - "format": "string" - } - ], - "label": "标签描述" - } -} - -const enumConverter = {} - -function filterToWhere(filter, command) { - let where = {} - for (let field in filter) { - let { type, value } = filter[field] - switch (type) { - case "search": - if (typeof value === 'string' && value.length) { - where[field] = new RegExp(value) - } - break; - case "select": - if (value.length) { - let selectValue = [] - for (let s of value) { - selectValue.push(command.eq(s)) - } - where[field] = command.or(selectValue) - } - break; - case "range": - if (value.length) { - let gt = value[0] - let lt = value[1] - where[field] = command.and([command.gte(gt), command.lte(lt)]) - } - break; - case "date": - if (value.length) { - let [s, e] = value - let startDate = new Date(s) - let endDate = new Date(e) - where[field] = command.and([command.gte(startDate), command.lte(endDate)]) - } - break; - case "timestamp": - if (value.length) { - let [startDate, endDate] = value - where[field] = command.and([command.gte(startDate), command.lte(endDate)]) - } - break; - } - } - return where -} - -export { validator, enumConverter, filterToWhere } diff --git a/sport-erp-admin/js_sdk/validator/uni-id-users.js b/sport-erp-admin/js_sdk/validator/uni-id-users.js deleted file mode 100644 index a8a8d4f..0000000 --- a/sport-erp-admin/js_sdk/validator/uni-id-users.js +++ /dev/null @@ -1,191 +0,0 @@ -// 表单校验规则由 schema2code 生成,不建议直接修改校验规则,而建议通过 schema2code 生成, 详情: https://uniapp.dcloud.net.cn/uniCloud/schema - - -const validator = { - "username": { - "rules": [{ - "required": true, - "errorMessage": '请输入用户名', - }, - { - "minLength": 3, - "maxLength": 32, - "errorMessage": '用户名长度在 {minLength} 到 {maxLength} 个字符', - }, - { - validateFunction: function(rule, value, data, callback) { - // console.log(value); - if (/^1\d{10}$/.test(value) || /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/.test(value)) { - callback('用户名不能是:手机号或邮箱') - }; - if (/^\d+$/.test(value)) { - callback('用户名不能为纯数字') - }; - if(/[\u4E00-\u9FA5\uF900-\uFA2D]{1,}/.test(value)){ - callback('用户名不能包含中文') - } - return true - } - } - ], - "label": "用户名" - }, - "nickname": { - "rules": [{ - minLength: 3, - maxLength: 32, - errorMessage: '昵称长度在 {minLength} 到 {maxLength} 个字符', - }, - { - validateFunction: function(rule, value, data, callback) { - // console.log(value); - if (/^1\d{10}$/.test(value) || /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/.test(value)) { - callback('昵称不能是:手机号或邮箱') - }; - if (/^\d+$/.test(value)) { - callback('昵称不能为纯数字') - }; - // if(/[\u4E00-\u9FA5\uF900-\uFA2D]{1,}/.test(value)){ - // callback('昵称不能包含中文') - // } - return true - } - } - ], - "label": "昵称" - }, - "password": { - "rules": [{ - "required": true, - }, - { - "format": "password" - }, - { - "minLength": 6 - } - ], - "label": "密码" - }, - "mobile": { - "rules": [{ - "format": "string" - }, - { - "pattern": "^\\+?[0-9-]{3,20}$" - } - ], - "label": "手机号码" - }, - "status": { - "rules": [{ - "format": "int" - }, - { - "range": [{ - "text": "正常", - "value": 0 - }, - { - "text": "禁用", - "value": 1 - }, - { - "text": "审核中", - "value": 2 - }, - { - "text": "审核拒绝", - "value": 3 - } - ] - } - ], - "defaultValue": 0, - "label": "用户状态" - }, - "email": { - "rules": [{ - "format": "string" - }, - { - "format": "email" - } - ], - "label": "邮箱" - }, - "role": { - "rules": [{ - "format": "array" - }], - "label": "角色" - }, - "last_login_date": { - "rules": [{ - "format": "timestamp" - }] - } -} - -const enumConverter = { - "status_valuetotext": { - "0": "正常", - "1": "禁用", - "2": "审核中", - "3": "审核拒绝" - } -} - -function filterToWhere(filter, command) { - let where = {} - for (let field in filter) { - let { - type, - value - } = filter[field] - switch (type) { - case "search": - if (typeof value === 'string' && value.length) { - where[field] = new RegExp(value) - } - break; - case "select": - if (value.length) { - let selectValue = [] - for (let s of value) { - selectValue.push(command.eq(s)) - } - where[field] = command.or(selectValue) - } - break; - case "range": - if (value.length) { - let gt = value[0] - let lt = value[1] - where[field] = command.and([command.gte(gt), command.lte(lt)]) - } - break; - case "date": - if (value.length) { - let [s, e] = value - let startDate = new Date(s) - let endDate = new Date(e) - where[field] = command.and([command.gte(startDate), command.lte(endDate)]) - } - break; - case "timestamp": - if (value.length) { - let [startDate, endDate] = value - where[field] = command.and([command.gte(startDate), command.lte(endDate)]) - } - break; - } - } - return where -} - -export { - validator, - enumConverter, - filterToWhere -} diff --git a/sport-erp-admin/js_sdk/validator/uni-pay-orders.js b/sport-erp-admin/js_sdk/validator/uni-pay-orders.js deleted file mode 100644 index 4ad22ef..0000000 --- a/sport-erp-admin/js_sdk/validator/uni-pay-orders.js +++ /dev/null @@ -1,309 +0,0 @@ -// 表单校验规则由 schema2code 生成,不建议直接修改校验规则,而建议通过 schema2code 生成, 详情: https://uniapp.dcloud.net.cn/uniCloud/schema - - -const validator = { - "user_id": { - "rules": [ - { - "format": "string" - } - ], - "label": "用户ID" - }, - "provider": { - "rules": [ - { - "format": "string" - }, - { - "range": [ - { - "text": "微信支付", - "value": "wxpay" - }, - { - "text": "支付宝", - "value": "alipay" - }, - { - "text": "苹果应用内支付", - "value": "appleiap" - } - ] - } - ], - "label": "支付供应商" - }, - "provider_pay_type": { - "rules": [ - { - "format": "string" - } - ], - "label": "支付方式" - }, - "uni_platform": { - "rules": [ - { - "format": "string" - } - ], - "label": "应用平台" - }, - "status": { - "rules": [ - { - "format": "int" - }, - { - "range": [ - { - "text": "已关闭", - "value": -1 - }, - { - "text": "未支付", - "value": 0 - }, - { - "text": "已支付", - "value": 1 - }, - { - "text": "已部分退款", - "value": 2 - }, - { - "text": "已全额退款", - "value": 3 - } - ] - } - ], - "defaultValue": 0, - "label": "订单状态" - }, - "type": { - "rules": [ - { - "format": "string" - } - ], - "label": "订单类型" - }, - "order_no": { - "rules": [ - { - "format": "string" - }, - { - "minLength": 20, - "maxLength": 28 - } - ], - "label": "业务系统订单号" - }, - "out_trade_no": { - "rules": [ - { - "format": "string" - } - ], - "label": "支付插件订单号" - }, - "transaction_id": { - "rules": [ - { - "format": "string" - } - ], - "label": "交易单号" - }, - "device_id": { - "rules": [ - { - "format": "string" - } - ], - "label": "设备ID" - }, - "client_ip": { - "rules": [ - { - "format": "string" - } - ], - "label": "客户端IP" - }, - "openid": { - "rules": [ - { - "format": "string" - } - ], - "label": "openid" - }, - "description": { - "rules": [ - { - "format": "string" - } - ], - "label": "支付描述" - }, - "err_msg ": { - "rules": [ - { - "format": "string" - } - ], - "label": "支付失败原因" - }, - "total_fee": { - "rules": [ - { - "format": "int" - } - ], - "label": "订单总金额" - }, - "refund_fee": { - "rules": [ - { - "format": "int" - } - ], - "label": "订单总退款金额" - }, - "refund_count": { - "rules": [ - { - "format": "int" - } - ], - "label": "当前退款笔数" - }, - "refund_list": { - "rules": [ - { - "format": "array" - } - ], - "label": "退款详情" - }, - "provider_appid": { - "rules": [ - { - "format": "string" - } - ], - "label": "开放平台appid" - }, - "appid": { - "rules": [ - { - "format": "string" - } - ], - "label": "DCloud AppId" - }, - "user_order_success": { - "rules": [ - { - "format": "bool" - } - ], - "label": "回调状态" - }, - "pay_date": { - "rules": [ - { - "format": "timestamp" - } - ], - "label": "支付时间" - }, - "notify_date": { - "rules": [ - { - "format": "timestamp" - } - ], - "label": "异步通知时间" - }, - "cancel_date": { - "rules": [ - { - "format": "timestamp" - } - ], - "label": "取消时间" - } -} - -const enumConverter = { - "provider_valuetotext": { - "wxpay": "微信支付", - "alipay": "支付宝", - "appleiap": "苹果应用内支付" - }, - "status_valuetotext": { - "0": "未支付", - "1": "已支付", - "2": "已部分退款", - "3": "已全额退款", - "-1": "已关闭" - } -} - -function filterToWhere(filter, command) { - let where = {} - for (let field in filter) { - let { type, value } = filter[field] - switch (type) { - case "search": - if (typeof value === 'string' && value.length) { - //where[field] = new RegExp(value) - where[field] = value - } - // if (typeof value === 'string' && value.length) { - // str += `(${field} == '${value}' || /${value}/.test(${field}))` - // where[field] = new RegExp(value) - // } - break; - case "select": - if (value.length) { - let selectValue = [] - for (let s of value) { - selectValue.push(command.eq(s)) - } - where[field] = command.or(selectValue) - } - break; - case "range": - if (value.length) { - let gt = value[0] - let lt = value[1] - where[field] = command.and([command.gte(gt), command.lte(lt)]) - } - break; - case "date": - if (value.length) { - let [s, e] = value - let startDate = new Date(s) - let endDate = new Date(e) - where[field] = command.and([command.gte(startDate), command.lte(endDate)]) - } - break; - case "timestamp": - if (value.length) { - let [startDate, endDate] = value - where[field] = command.and([command.gte(startDate), command.lte(endDate)]) - } - break; - } - } - return where -} - -export { validator, enumConverter, filterToWhere } diff --git a/sport-erp-admin/js_sdk/validator/uni-stat-app-crash-logs.js b/sport-erp-admin/js_sdk/validator/uni-stat-app-crash-logs.js deleted file mode 100644 index ea10ddc..0000000 --- a/sport-erp-admin/js_sdk/validator/uni-stat-app-crash-logs.js +++ /dev/null @@ -1,264 +0,0 @@ -// 表单校验规则由 schema2code 生成,不建议直接修改校验规则,而建议通过 schema2code 生成, 详情: https://uniapp.dcloud.net.cn/uniCloud/schema - - -const validator = { - "appid": { - "rules": [ - { - "format": "string" - } - ] - }, - "version": { - "rules": [ - { - "format": "string" - } - ] - }, - "platform": { - "rules": [ - { - "format": "string" - } - ] - }, - "channel": { - "rules": [ - { - "format": "string" - } - ] - }, - "sdk_version": { - "rules": [ - { - "format": "string" - } - ] - }, - "device_id": { - "rules": [ - { - "format": "string" - } - ] - }, - "device_net": { - "rules": [ - { - "format": "string" - } - ] - }, - "device_os": { - "rules": [ - { - "format": "string" - } - ] - }, - "device_os_version": { - "rules": [ - { - "format": "string" - } - ] - }, - "device_vendor": { - "rules": [ - { - "format": "string" - } - ] - }, - "device_model": { - "rules": [ - { - "format": "string" - } - ] - }, - "device_is_root": { - "rules": [ - { - "format": "int" - } - ] - }, - "device_os_name": { - "rules": [ - { - "format": "string" - } - ] - }, - "device_batt_level": { - "rules": [ - { - "format": "int" - } - ] - }, - "device_batt_temp": { - "rules": [ - { - "format": "string" - } - ] - }, - "device_memory_use_size": { - "rules": [ - { - "format": "int" - } - ] - }, - "device_memory_total_size": { - "rules": [ - { - "format": "int" - } - ] - }, - "device_disk_use_size": { - "rules": [ - { - "format": "int" - } - ] - }, - "device_disk_total_size": { - "rules": [ - { - "format": "int" - } - ] - }, - "device_abis": { - "rules": [ - { - "format": "string" - } - ] - }, - "app_count": { - "rules": [ - { - "format": "int" - } - ] - }, - "app_use_memory_size": { - "rules": [ - { - "format": "int" - } - ] - }, - "app_webview_count": { - "rules": [ - { - "format": "int" - } - ] - }, - "app_use_duration": { - "rules": [ - { - "format": "int" - } - ] - }, - "app_run_fore": { - "rules": [ - { - "format": "int" - } - ] - }, - "package_name": { - "rules": [ - { - "format": "string" - } - ] - }, - "package_version": { - "rules": [ - { - "format": "string" - } - ] - }, - "page_url": { - "rules": [ - { - "format": "string" - } - ] - }, - "error_msg": { - "rules": [ - { - "format": "string" - } - ] - }, - "create_time": { - "rules": [ - { - "format": "timestamp" - } - ] - } -} - -const enumConverter = {} - -function filterToWhere(filter, command) { - let where = {} - for (let field in filter) { - let { type, value } = filter[field] - switch (type) { - case "search": - if (typeof value === 'string' && value.length) { - where[field] = new RegExp(value) - } - break; - case "select": - if (value.length) { - let selectValue = [] - for (let s of value) { - selectValue.push(command.eq(s)) - } - where[field] = command.or(selectValue) - } - break; - case "range": - if (value.length) { - let gt = value[0] - let lt = value[1] - where[field] = command.and([command.gte(gt), command.lte(lt)]) - } - break; - case "date": - if (value.length) { - let [s, e] = value - let startDate = new Date(s) - let endDate = new Date(e) - where[field] = command.and([command.gte(startDate), command.lte(endDate)]) - } - break; - case "timestamp": - if (value.length) { - let [startDate, endDate] = value - where[field] = command.and([command.gte(startDate), command.lte(endDate)]) - } - break; - } - } - return where -} - -export { validator, enumConverter, filterToWhere } diff --git a/sport-erp-admin/js_sdk/validator/uni-stat-pages.js b/sport-erp-admin/js_sdk/validator/uni-stat-pages.js deleted file mode 100644 index 21c08fc..0000000 --- a/sport-erp-admin/js_sdk/validator/uni-stat-pages.js +++ /dev/null @@ -1,68 +0,0 @@ -// 表单校验规则由 schema2code 生成,不建议直接修改校验规则,而建议通过 schema2code 生成, 详情: https://uniapp.dcloud.net.cn/uniCloud/schema - - -const validator = { - "title": { - "rules": [ - { - "format": "string" - } - ] - }, - "path": { - "rules": [ - { - "format": "string" - } - ] - } -} - -const enumConverter = {} - -function filterToWhere(filter, command) { - let where = {} - for (let field in filter) { - let { type, value } = filter[field] - switch (type) { - case "search": - if (typeof value === 'string' && value.length) { - where[field] = new RegExp(value) - } - break; - case "select": - if (value.length) { - let selectValue = [] - for (let s of value) { - selectValue.push(command.eq(s)) - } - where[field] = command.or(selectValue) - } - break; - case "range": - if (value.length) { - let gt = value[0] - let lt = value[1] - where[field] = command.and([command.gte(gt), command.lte(lt)]) - } - break; - case "date": - if (value.length) { - let [s, e] = value - let startDate = new Date(s) - let endDate = new Date(e) - where[field] = command.and([command.gte(startDate), command.lte(endDate)]) - } - break; - case "timestamp": - if (value.length) { - let [startDate, endDate] = value - where[field] = command.and([command.gte(startDate), command.lte(endDate)]) - } - break; - } - } - return where -} - -export { validator, enumConverter, filterToWhere } diff --git a/sport-erp-admin/main.js b/sport-erp-admin/main.js deleted file mode 100644 index 0b6daab..0000000 --- a/sport-erp-admin/main.js +++ /dev/null @@ -1,43 +0,0 @@ -import App from './App' -import store from './store' -import plugin from './js_sdk/uni-admin/plugin' -import messages from './i18n/index.js' - -const lang = uni.getLocale() -// #ifndef VUE3 -import Vue from 'vue' -import VueI18n from 'vue-i18n' -Vue.config.productionTip = false -Vue.use(VueI18n) -// 通过选项创建 VueI18n 实例 -const i18n = new VueI18n({ - locale: lang, // 设置地区 - messages, // 设置地区信息 -}) -Vue.use(plugin) -App.mpType = 'app' -const app = new Vue({ - i18n, - store, - ...App -}) -app.$mount() -// #endif - -// #ifdef VUE3 -import { createSSRApp } from 'vue' -import { createI18n } from 'vue-i18n' -export function createApp() { - const app = createSSRApp(App) - const i18n = createI18n({ - locale: lang, - messages - }) - app.use(i18n) - app.use(plugin) - app.use(store) - return { - app - } -} -// #endif diff --git a/sport-erp-admin/manifest.json b/sport-erp-admin/manifest.json deleted file mode 100644 index cfbdcbe..0000000 --- a/sport-erp-admin/manifest.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "name" : "sport-erp-admin", - "appid" : "__UNI__9B11716", - "description" : "", - "versionName" : "1.0.0", - "versionCode" : "100", - "transformPx" : false, - /* 5+App特有相关 */ - "app-plus" : { - "usingComponents" : true, - "nvueCompiler" : "uni-app", - "compilerVersion" : 3, - "splashscreen" : { - "alwaysShowBeforeRender" : true, - "waiting" : true, - "autoclose" : true, - "delay" : 0 - }, - /* 模块配置 */ - "modules" : {}, - /* 应用发布信息 */ - "distribute" : { - /* android打包配置 */ - "android" : { - "permissions" : [ - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "" - ] - }, - /* ios打包配置 */ - "ios" : { - "dSYMs" : false - }, - /* SDK配置 */ - "sdkConfigs" : {} - } - }, - /* 快应用特有相关 */ - "quickapp" : {}, - /* 小程序特有相关 */ - "mp-weixin" : { - "appid" : "", - "setting" : { - "urlCheck" : false, - "minified" : true, - "postcss" : true - }, - "usingComponents" : true - }, - "mp-alipay" : { - "usingComponents" : true - }, - "mp-baidu" : { - "usingComponents" : true - }, - "mp-toutiao" : { - "usingComponents" : true, - "scopedSlotsCompiler" : "augmented", - "setting" : { - "urlCheck" : false, - "postcss" : true, - "minified" : true - } - }, - "uniStatistics" : { - "enable" : false - }, - "h5" : { - "template" : "template.h5.html", - "router" : { - "mode" : "hash", - "base" : "/admin/" - } - }, - "vueVersion" : "3", - "networkTimeout" : { - "uploadFile" : 1200000 //ms, 如果不配置,上传大文件可能会超时 - } -} diff --git a/sport-erp-admin/mock/uni-stat/appOverview.json b/sport-erp-admin/mock/uni-stat/appOverview.json deleted file mode 100644 index 18d70e9..0000000 --- a/sport-erp-admin/mock/uni-stat/appOverview.json +++ /dev/null @@ -1,14 +0,0 @@ - { - "yesterday": { - "num_new_visitor": "394", - "num_visitor": "884", - "num_page_views": "21,818", - "num_total_visitor": "726,161" - }, - "today": { - "num_new_visitor": "258", - "num_visitor": "564", - "num_page_views": "14,795", - "num_total_visitor": "781,700" - } - } \ No newline at end of file diff --git a/sport-erp-admin/mock/uni-stat/appsDetail.json b/sport-erp-admin/mock/uni-stat/appsDetail.json deleted file mode 100644 index aacbd11..0000000 --- a/sport-erp-admin/mock/uni-stat/appsDetail.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "last_page": 1, - "current_page": 1, - "total": 1, - "item": [{ - "id_app": 3, - "today_num_new_visitor": "245", - "today_num_visitor": "502", - "today_num_page_views": "10,777", - "num_total_visitor": "724,620", - "appid": "__UNI__HelloUniApp", - "name": "Hello uni-app", - "yesterday_num_new_visitor": "666", - "yesterday_num_visitor": "1,170", - "yesterday_num_page_views": "28,699" - }] -} diff --git a/sport-erp-admin/mock/uni-stat/db.js b/sport-erp-admin/mock/uni-stat/db.js deleted file mode 100644 index 8d9234e..0000000 --- a/sport-erp-admin/mock/uni-stat/db.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = function() { - return { - appsDetail: require('./appsDetail'), - pageRule: require('./pageRule'), - appOverview: require('./appOverview'), - pageContent: require('./pageContent'), - pageRes: require('./pageRes'), - pageEnt: require('./pageEnt'), - event: require('./event'), - } -} diff --git a/sport-erp-admin/mock/uni-stat/event.json b/sport-erp-admin/mock/uni-stat/event.json deleted file mode 100644 index 6fbdeae..0000000 --- a/sport-erp-admin/mock/uni-stat/event.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "last_page": 1, - "current_page": 1, - "total": 10, - "item": [ - { - "id_event": 3, - "event_key": "login", - "event_name": "登录事件", - "num_visitor": "65", - "num_visits": "666", - "visitor_avg_hits": "10.25" - }, - { - "id_event": 30, - "event_key": "share", - "event_name": "分享", - "num_visitor": "18", - "num_visits": "164", - "visitor_avg_hits": "9.11" - }, - { - "id_event": 82, - "event_key": "pay_fail", - "event_name": "支付失败", - "num_visitor": "11", - "num_visits": "145", - "visitor_avg_hits": "13.18" - }, - { - "id_event": 841, - "event_key": "加入购物车", - "event_name": "", - "num_visitor": "13", - "num_visits": "74", - "visitor_avg_hits": "5.69" - }, - { - "id_event": 840, - "event_key": "收藏", - "event_name": "", - "num_visitor": "13", - "num_visits": "57", - "visitor_avg_hits": "4.38" - }, - { - "id_event": 842, - "event_key": "立即购买", - "event_name": "", - "num_visitor": "12", - "num_visits": "54", - "visitor_avg_hits": "4.50" - }, - { - "id_event": 844, - "event_key": "取消收藏", - "event_name": "", - "num_visitor": "8", - "num_visits": "32", - "visitor_avg_hits": "4.00" - }, - { - "id_event": 161, - "event_key": "pay_success", - "event_name": "支付成功", - "num_visitor": "1", - "num_visits": "11", - "visitor_avg_hits": "11.00" - }, - { - "id_event": 94522, - "event_key": "ipa", - "event_name": "", - "num_visitor": "1", - "num_visits": "2", - "visitor_avg_hits": "2.00" - }, - { - "id_event": 281238, - "event_key": "iapstatus", - "event_name": "", - "num_visitor": "1", - "num_visits": "2", - "visitor_avg_hits": "2.00" - } - ] -} \ No newline at end of file diff --git a/sport-erp-admin/mock/uni-stat/pageContent.json b/sport-erp-admin/mock/uni-stat/pageContent.json deleted file mode 100644 index f67abb0..0000000 --- a/sport-erp-admin/mock/uni-stat/pageContent.json +++ /dev/null @@ -1,508 +0,0 @@ -{ - "base_url": "", - "last_page": 4, - "current_page": 1, - "total": 199, - "item": [ - { - "id_page": 81556056, - "url": "pages/forum/detail/detail?id=39355&type=2", - "name": "uni-app提供开箱即用的SSR支持", - "num_visitor": "54", - "num_visits": "60", - "visit_avg_time": "00:00:21", - "visitor_avg_time": "00:00:23", - "num_share": "0" - }, - { - "id_page": 82631518, - "url": "pages/forum/detail/detail?id=133960&type=1", - "name": "前端老手,寻找远程工作机会,外包项目合作,个人随缘接单", - "num_visitor": "36", - "num_visits": "38", - "visit_avg_time": "00:00:23", - "visitor_avg_time": "00:00:25", - "num_share": "0" - }, - { - "id_page": 1241, - "url": "pages/forum/detail/detail?id=35050&type=2", - "name": "【收费ui ¥200】uni-app前端UI框架 graceUI 持续更新(29个基础组件 14 个界面库 表单验证模块 ),大幅度提高您的开发速度!实测 真实项目30个页面 2天完成布局", - "num_visitor": "19", - "num_visits": "34", - "visit_avg_time": "00:00:09", - "visitor_avg_time": "00:00:16", - "num_share": "0" - }, - { - "id_page": 65803226, - "url": "pages/forum/detail/detail?id=100790&type=1", - "name": "请问uniapp怎么获取手机内的文件", - "num_visitor": "14", - "num_visits": "14", - "visit_avg_time": "00:00:13", - "visitor_avg_time": "00:00:13", - "num_share": "0" - }, - { - "id_page": 68899690, - "url": "pages/forum/detail/detail?id=37834&type=2", - "name": " uni-app 项目小程序端支持 vue3 介绍", - "num_visitor": "13", - "num_visits": "13", - "visit_avg_time": "00:00:26", - "visitor_avg_time": "00:00:26", - "num_share": "0" - }, - { - "id_page": 83432568, - "url": "pages/forum/detail/detail?id=135769&type=1", - "name": "【报Bug】字节跳动小程序使用page-meta设置背景,开发工具有报错,uni.setBackgroundColor is not a function", - "num_visitor": "9", - "num_visits": "11", - "visit_avg_time": "00:00:05", - "visitor_avg_time": "00:00:07", - "num_share": "0" - }, - { - "id_page": 82778852, - "url": "pages/forum/detail/detail?id=134332&type=1", - "name": "uniapp打包后的通知授权推送", - "num_visitor": "11", - "num_visits": "11", - "visit_avg_time": "00:00:08", - "visitor_avg_time": "00:00:08", - "num_share": "0" - }, - { - "id_page": 83039358, - "url": "pages/forum/detail/detail?id=134922&type=1", - "name": "google play 上架应用因为Dcloud SDK被暂停", - "num_visitor": "9", - "num_visits": "10", - "visit_avg_time": "00:00:09", - "visitor_avg_time": "00:00:10", - "num_share": "0" - }, - { - "id_page": 83419662, - "url": "pages/forum/detail/detail?id=135744&type=1", - "name": "一键登录开通应用催审", - "num_visitor": "10", - "num_visits": "10", - "visit_avg_time": "00:00:03", - "visitor_avg_time": "00:00:03", - "num_share": "0" - }, - { - "id_page": 62476061, - "url": "pages/forum/detail/detail?id=35915&type=2", - "name": "iOS平台:用Native.js来写 如何判断系统功能权限是否开启", - "num_visitor": "6", - "num_visits": "10", - "visit_avg_time": "00:00:15", - "visitor_avg_time": "00:00:25", - "num_share": "0" - }, - { - "id_page": 74506803, - "url": "pages/forum/detail/detail?id=36027&type=2", - "name": "终于搞定了UniApp开发的微信小程序的支付,分享下有关微信支付踩的坑", - "num_visitor": "9", - "num_visits": "9", - "visit_avg_time": "00:00:30", - "visitor_avg_time": "00:00:30", - "num_share": "0" - }, - { - "id_page": 62529047, - "url": "pages/forum/detail/detail?id=85976&type=1", - "name": "uni app 打包成 Android 后无法请求服务器", - "num_visitor": "9", - "num_visits": "9", - "visit_avg_time": "00:00:34", - "visitor_avg_time": "00:00:34", - "num_share": "0" - }, - { - "id_page": 83415318, - "url": "pages/forum/detail/detail?id=135730&type=1", - "name": "uniapp-安卓实现自动拍照", - "num_visitor": "8", - "num_visits": "8", - "visit_avg_time": "00:00:07", - "visitor_avg_time": "00:00:07", - "num_share": "0" - }, - { - "id_page": 83418841, - "url": "pages/forum/detail/detail?id=135739&type=1", - "name": "", - "num_visitor": "6", - "num_visits": "7", - "visit_avg_time": "00:00:04", - "visitor_avg_time": "00:00:04", - "num_share": "0" - }, - { - "id_page": 66951069, - "url": "pages/forum/detail/detail?id=102581&type=1", - "name": "uniapp 打包成手机h5 js缓存问题怎么解决,只能清手机缓存吗", - "num_visitor": "6", - "num_visits": "7", - "visit_avg_time": "00:00:10", - "visitor_avg_time": "00:00:11", - "num_share": "0" - }, - { - "id_page": 83408388, - "url": "pages/forum/detail/detail?id=135713&type=1", - "name": "使用VideoPlayer播放视频,视频有宽度自动收缩", - "num_visitor": "7", - "num_visits": "7", - "visit_avg_time": "00:00:02", - "visitor_avg_time": "00:00:02", - "num_share": "0" - }, - { - "id_page": 83442697, - "url": "pages/forum/detail/detail?id=135783&type=1", - "name": "有没有不用二维数组的版本", - "num_visitor": "7", - "num_visits": "7", - "visit_avg_time": "00:00:02", - "visitor_avg_time": "00:00:02", - "num_share": "0" - }, - { - "id_page": 63688602, - "url": "pages/forum/detail/detail?id=37228&type=2", - "name": "5 App和uni-app在App开发上的对比", - "num_visitor": "7", - "num_visits": "7", - "visit_avg_time": "00:00:11", - "visitor_avg_time": "00:00:11", - "num_share": "0" - }, - { - "id_page": 83415397, - "url": "pages/forum/detail/detail?id=39503&type=2", - "name": "uniapp MIUI全局自由窗口适配,uniapp悬浮小窗和分屏适配", - "num_visitor": "2", - "num_visits": "7", - "visit_avg_time": "00:00:17", - "visitor_avg_time": "00:00:59", - "num_share": "0" - }, - { - "id_page": 62347163, - "url": "pages/forum/detail/detail?id=80913&type=1", - "name": "uni-app flex布局,position:absolute有问题", - "num_visitor": "7", - "num_visits": "7", - "visit_avg_time": "00:00:28", - "visitor_avg_time": "00:00:28", - "num_share": "0" - }, - { - "id_page": 75994881, - "url": "pages/forum/detail/detail?id=122399&type=1", - "name": "【报Bug】uni.chooseVideo() 方法选中视频文件 加载时长问题", - "num_visitor": "5", - "num_visits": "6", - "visit_avg_time": "00:00:06", - "visitor_avg_time": "00:00:08", - "num_share": "0" - }, - { - "id_page": 83422277, - "url": "pages/forum/detail/detail?id=135749&type=1", - "name": "【报Bug】plus.video.LivePusher控件推流出现变形,直播源是压扁的", - "num_visitor": "5", - "num_visits": "6", - "visit_avg_time": "00:00:09", - "visitor_avg_time": "00:00:10", - "num_share": "0" - }, - { - "id_page": 83340805, - "url": "pages/forum/detail/detail?id=135644&type=1", - "name": "uniapp中的input、text area、editor聚焦后无法唤起输入法", - "num_visitor": "3", - "num_visits": "6", - "visit_avg_time": "00:00:01", - "visitor_avg_time": "00:00:03", - "num_share": "0" - }, - { - "id_page": 82122616, - "url": "pages/forum/detail/detail?id=39390&type=2", - "name": "公告:阿里云服务空间云存储容量上限调整周知", - "num_visitor": "6", - "num_visits": "6", - "visit_avg_time": "00:00:27", - "visitor_avg_time": "00:00:27", - "num_share": "0" - }, - { - "id_page": 83434138, - "url": "pages/forum/detail/detail?id=135773&type=1", - "name": "海报 二维码", - "num_visitor": "5", - "num_visits": "6", - "visit_avg_time": "00:00:01", - "visitor_avg_time": "00:00:02", - "num_share": "0" - }, - { - "id_page": 79225826, - "url": "pages/forum/detail/detail?id=127577&type=1", - "name": "【报Bug】uniapp安卓热更新偶尔出现第一次重启样式错乱,第二次重启正常。", - "num_visitor": "6", - "num_visits": "6", - "visit_avg_time": "00:00:07", - "visitor_avg_time": "00:00:07", - "num_share": "0" - }, - { - "id_page": 83416762, - "url": "pages/forum/detail/detail?id=135731&type=1", - "name": "【报Bug】uni.chooseVideo方法 拍摄视频 超过一分钟之后返回的路径不对", - "num_visitor": "5", - "num_visits": "6", - "visit_avg_time": "00:00:03", - "visitor_avg_time": "00:00:04", - "num_share": "0" - }, - { - "id_page": 83113722, - "url": "pages/forum/detail/detail?id=135136&type=1", - "name": "【报Bug】ios nvue 组件中使用富文本rich-text,设置font-size,更新数据后崩溃", - "num_visitor": "5", - "num_visits": "6", - "visit_avg_time": "00:00:05", - "visitor_avg_time": "00:00:06", - "num_share": "0" - }, - { - "id_page": 83437008, - "url": "pages/forum/detail/detail?id=135779&type=1", - "name": "详情", - "num_visitor": "5", - "num_visits": "6", - "visit_avg_time": "00:00:03", - "visitor_avg_time": "00:00:03", - "num_share": "0" - }, - { - "id_page": 1427, - "url": "pages/forum/detail/detail?id=41&type=2", - "name": "iOS离线打包", - "num_visitor": "5", - "num_visits": "6", - "visit_avg_time": "00:00:14", - "visitor_avg_time": "00:00:17", - "num_share": "0" - }, - { - "id_page": 63162055, - "url": "pages/forum/detail/detail?id=37140&type=2", - "name": "解决uni-app的pages.json的模块化及模块热重载的问题", - "num_visitor": "4", - "num_visits": "5", - "visit_avg_time": "00:00:07", - "visitor_avg_time": "00:00:09", - "num_share": "0" - }, - { - "id_page": 83405330, - "url": "pages/forum/detail/detail?id=135711&type=1", - "name": "【报Bug】将网站套壳打包,wap2app,创建的app会随机出现无响应的情况", - "num_visitor": "5", - "num_visits": "5", - "visit_avg_time": "00:00:01", - "visitor_avg_time": "00:00:01", - "num_share": "0" - }, - { - "id_page": 83444463, - "url": "pages/forum/detail/detail?id=135784&type=1", - "name": "#插件讨论# 【 区块链货币数字钱包APP uni-app模板 - 8***@qq.com 】 怎么加你", - "num_visitor": "3", - "num_visits": "5", - "visit_avg_time": "00:00:06", - "visitor_avg_time": "00:00:10", - "num_share": "0" - }, - { - "id_page": 83447956, - "url": "pages/forum/detail/detail?id=106275&type=1", - "name": "外包uni-app项目里的APP两端的“APP原生插件配置”谷歌地图开发", - "num_visitor": "4", - "num_visits": "5", - "visit_avg_time": "00:00:05", - "visitor_avg_time": "00:00:07", - "num_share": "0" - }, - { - "id_page": 83445502, - "url": "pages/forum/detail/detail?id=135786&type=1", - "name": "【报Bug】savefile 保存doc文件时提示文件没有发现", - "num_visitor": "4", - "num_visits": "5", - "visit_avg_time": "00:00:04", - "visitor_avg_time": "00:00:05", - "num_share": "0" - }, - { - "id_page": 83424862, - "url": "pages/forum/detail/detail?id=135755&type=1", - "name": "web-view嵌套的h5页面怎么实现video全屏横屏播放", - "num_visitor": "4", - "num_visits": "5", - "visit_avg_time": "00:00:02", - "visitor_avg_time": "00:00:03", - "num_share": "0" - }, - { - "id_page": 83397776, - "url": "pages/forum/detail/detail?id=135707&type=1", - "name": "插件上传,一直都是提示名称错误", - "num_visitor": "4", - "num_visits": "4", - "visit_avg_time": "00:00:05", - "visitor_avg_time": "00:00:05", - "num_share": "0" - }, - { - "id_page": 82995242, - "url": "pages/forum/detail/detail?id=134753&type=1", - "name": "【报Bug】华为应用市场 收集个人信息因 ‘好的’ ‘我知道了’ 字眼 违规", - "num_visitor": "4", - "num_visits": "4", - "visit_avg_time": "00:00:02", - "visitor_avg_time": "00:00:02", - "num_share": "0" - }, - { - "id_page": 68918405, - "url": "pages/forum/detail/detail?id=102915&type=1", - "name": "uniapp 如何重写音量键动作呢?", - "num_visitor": "4", - "num_visits": "4", - "visit_avg_time": "00:00:10", - "visitor_avg_time": "00:00:10", - "num_share": "0" - }, - { - "id_page": 83430380, - "url": "pages/forum/detail/detail?id=135768&type=1", - "name": "在官网下载的App离线SDK,配置了appid、包名、签名、appkey,打包运行后一直停留在HBuilder的界面,没有错误提示,请问如何解决?", - "num_visitor": "4", - "num_visits": "4", - "visit_avg_time": "00:00:04", - "visitor_avg_time": "00:00:04", - "num_share": "0" - }, - { - "id_page": 83424008, - "url": "pages/forum/detail/detail?id=135752&type=1", - "name": "uni.navigateTo和uni.redirectTo跳转", - "num_visitor": "4", - "num_visits": "4", - "visit_avg_time": "00:00:04", - "visitor_avg_time": "00:00:04", - "num_share": "0" - }, - { - "id_page": 83423019, - "url": "pages/forum/detail/detail?id=135736&type=1", - "name": "使用video组件 模拟器上能正常播放,真机上无法播放", - "num_visitor": "3", - "num_visits": "4", - "visit_avg_time": "00:00:02", - "visitor_avg_time": "00:00:02", - "num_share": "0" - }, - { - "id_page": 83396003, - "url": "pages/forum/detail/detail?id=135705&type=1", - "name": "【报Bug】HBuilderX3.3.0 引出的“系统定位”模块 问题", - "num_visitor": "3", - "num_visits": "4", - "visit_avg_time": "00:00:39", - "visitor_avg_time": "00:00:52", - "num_share": "0" - }, - { - "id_page": 885, - "url": "pages/forum/detail/detail?id=63012&type=1", - "name": "用HTML5 新增的蓝牙Bluetooth模块的demo测试,安卓手机可以搜索到附近的蓝牙设备,但是苹果手机搜索不到附近的蓝牙设备,用的ios都是11.1版本以上的,请问一下这是什么原因呢?", - "num_visitor": "4", - "num_visits": "4", - "visit_avg_time": "00:00:08", - "visitor_avg_time": "00:00:08", - "num_share": "0" - }, - { - "id_page": 9977925, - "url": "pages/forum/detail/detail?id=35907&type=2", - "name": "DCloud appid 用途/作用/使用说明", - "num_visitor": "3", - "num_visits": "4", - "visit_avg_time": "00:00:13", - "visitor_avg_time": "00:00:17", - "num_share": "0" - }, - { - "id_page": 83351021, - "url": "pages/forum/detail/detail?id=135657&type=1", - "name": "【报Bug】 使用了Hbuilder 3.2.13之后的版本 进行usb设备的拔插后(如键盘等输入设备) 页面v-if会失效以及很多视图无法及时更新。", - "num_visitor": "4", - "num_visits": "4", - "visit_avg_time": "00:00:04", - "visitor_avg_time": "00:00:04", - "num_share": "0" - }, - { - "id_page": 63151975, - "url": "pages/forum/detail/detail?id=81272&type=1", - "name": "uni.chooseImage方法使用从相册选择上传就好使 拍照的上传就失败 文件都能获取到", - "num_visitor": "3", - "num_visits": "4", - "visit_avg_time": "00:00:04", - "visitor_avg_time": "00:00:06", - "num_share": "0" - }, - { - "id_page": 74766262, - "url": "pages/forum/detail/detail?id=119804&type=1", - "name": "求助!scroll-view 自定义下拉刷新多次触发问题,上滑都会多次触发", - "num_visitor": "4", - "num_visits": "4", - "visit_avg_time": "00:00:10", - "visitor_avg_time": "00:00:10", - "num_share": "0" - }, - { - "id_page": 83441117, - "url": "pages/forum/detail/detail?id=135781&type=1", - "name": "【报Bug】onLaunch时 plus.screen.lockOrientation('portrait-primary') 屏幕锁定无效", - "num_visitor": "3", - "num_visits": "4", - "visit_avg_time": "00:00:09", - "visitor_avg_time": "00:00:12", - "num_share": "0" - }, - { - "id_page": 83417459, - "url": "pages/forum/detail/detail?id=135738&type=1", - "name": "使用unicloud,车辆运行轨迹数据库应该如何设计", - "num_visitor": "4", - "num_visits": "4", - "visit_avg_time": "00:00:03", - "visitor_avg_time": "00:00:03", - "num_share": "0" - } - ] -} \ No newline at end of file diff --git a/sport-erp-admin/mock/uni-stat/pageEnt.json b/sport-erp-admin/mock/uni-stat/pageEnt.json deleted file mode 100644 index 37ebf6d..0000000 --- a/sport-erp-admin/mock/uni-stat/pageEnt.json +++ /dev/null @@ -1,337 +0,0 @@ -{ - "last_page": 6, - "current_page": 1, - "total": 170, - "item": [ - { - "id_page": 8, - "url": "pages/tabBar/forum/forum", - "name": "社区", - "num_visitor": "868", - "num_visits": "3,203", - "visit_avg_time": "00:01:27", - "visitor_avg_time": "00:05:23", - "entry_num_visits": "1,231", - "bounce_rate": "2.52%" - }, - { - "id_page": 9, - "url": "pages/forum/detail/detail", - "name": "社区详情", - "num_visitor": "293", - "num_visits": "1,005", - "visit_avg_time": "00:00:00", - "visitor_avg_time": "00:00:01", - "entry_num_visits": "70", - "bounce_rate": "18.57%" - }, - { - "id_page": 11, - "url": "pages/tabBar/case/case", - "name": "实例", - "num_visitor": "550", - "num_visits": "6,957", - "visit_avg_time": "00:00:22", - "visitor_avg_time": "00:04:47", - "entry_num_visits": "65", - "bounce_rate": "23.08%" - }, - { - "id_page": 126, - "url": "pages/forum/login/login", - "name": "登录", - "num_visitor": "156", - "num_visits": "375", - "visit_avg_time": "00:00:00", - "visitor_avg_time": "00:00:00", - "entry_num_visits": "25", - "bounce_rate": "0.00%" - }, - { - "id_page": 10, - "url": "pages/tabBar/center/center", - "name": "个人中心", - "num_visitor": "365", - "num_visits": "1,046", - "visit_avg_time": "00:01:53", - "visitor_avg_time": "00:05:24", - "entry_num_visits": "18", - "bounce_rate": "50.00%" - }, - { - "id_page": 169, - "url": "pages/forum/search/index", - "name": "[object Object]", - "num_visitor": "84", - "num_visits": "266", - "visit_avg_time": "00:00:00", - "visitor_avg_time": "00:00:00", - "entry_num_visits": "15", - "bounce_rate": "40.00%" - }, - { - "id_page": 74, - "url": "pages/template/list2detail-list/list2detail-list", - "name": "列表到详情示例", - "num_visitor": "53", - "num_visits": "129", - "visit_avg_time": "00:00:00", - "visitor_avg_time": "00:00:00", - "entry_num_visits": "13", - "bounce_rate": "0.00%" - }, - { - "id_page": 33, - "url": "pages/component/scroll-view/scroll-view", - "name": "scroll-view", - "num_visitor": "62", - "num_visits": "86", - "visit_avg_time": "00:00:00", - "visitor_avg_time": "00:00:00", - "entry_num_visits": "10", - "bounce_rate": "40.00%" - }, - { - "id_page": 141, - "url": "pages/API/scan-code/scan-code", - "name": "扫码", - "num_visitor": "38", - "num_visits": "90", - "visit_avg_time": "00:00:00", - "visitor_avg_time": "00:00:00", - "entry_num_visits": "9", - "bounce_rate": "11.11%" - }, - { - "id_page": 25, - "url": "pages/component/view/view", - "name": "view", - "num_visitor": "98", - "num_visits": "126", - "visit_avg_time": "00:00:00", - "visitor_avg_time": "00:00:00", - "entry_num_visits": "9", - "bounce_rate": "0.00%" - }, - { - "id_page": 60, - "url": "pages/template/ucharts/ucharts", - "name": "uCharts 图表", - "num_visitor": "65", - "num_visits": "88", - "visit_avg_time": "00:00:00", - "visitor_avg_time": "00:00:00", - "entry_num_visits": "9", - "bounce_rate": "22.22%" - }, - { - "id_page": 78, - "url": "pages/component/button/button", - "name": "button", - "num_visitor": "73", - "num_visits": "124", - "visit_avg_time": "00:00:00", - "visitor_avg_time": "00:00:00", - "entry_num_visits": "9", - "bounce_rate": "11.11%" - }, - { - "id_page": 123, - "url": "pages/template/nav-dot/nav-dot", - "name": "[object Object]", - "num_visitor": "34", - "num_visits": "65", - "visit_avg_time": "00:00:00", - "visitor_avg_time": "00:00:00", - "entry_num_visits": "8", - "bounce_rate": "37.50%" - }, - { - "id_page": 144, - "url": "pages/template/scheme/scheme", - "name": "打开外部应用", - "num_visitor": "55", - "num_visits": "115", - "visit_avg_time": "00:00:00", - "visitor_avg_time": "00:00:00", - "entry_num_visits": "7", - "bounce_rate": "28.57%" - }, - { - "id_page": 2835009, - "url": "pages/component/ad/index", - "name": "", - "num_visitor": "76", - "num_visits": "215", - "visit_avg_time": "00:00:00", - "visitor_avg_time": "00:00:00", - "entry_num_visits": "7", - "bounce_rate": "0.00%" - }, - { - "id_page": 313, - "url": "platforms/app-plus/push/push", - "name": "推送", - "num_visitor": "38", - "num_visits": "110", - "visit_avg_time": "00:00:00", - "visitor_avg_time": "00:00:01", - "entry_num_visits": "7", - "bounce_rate": "0.00%" - }, - { - "id_page": 34, - "url": "pages/component/swiper/swiper", - "name": "swiper", - "num_visitor": "43", - "num_visits": "59", - "visit_avg_time": "00:00:00", - "visitor_avg_time": "00:00:00", - "entry_num_visits": "6", - "bounce_rate": "66.67%" - }, - { - "id_page": 40, - "url": "pages/about/about", - "name": "关于", - "num_visitor": "47", - "num_visits": "68", - "visit_avg_time": "00:00:00", - "visitor_avg_time": "00:00:00", - "entry_num_visits": "5", - "bounce_rate": "0.00%" - }, - { - "id_page": 315, - "url": "pages/template/vant-button/vant-button", - "name": "微信自定义组件示例", - "num_visitor": "37", - "num_visits": "44", - "visit_avg_time": "00:00:00", - "visitor_avg_time": "00:00:00", - "entry_num_visits": "5", - "bounce_rate": "0.00%" - }, - { - "id_page": 339, - "url": "pages/component/web-view-local/web-view-local", - "name": "button", - "num_visitor": "33", - "num_visits": "47", - "visit_avg_time": "00:00:01", - "visitor_avg_time": "00:00:01", - "entry_num_visits": "5", - "bounce_rate": "20.00%" - }, - { - "id_page": 99, - "url": "pages/template/nav-button/nav-button", - "name": "导航栏带自定义按钮", - "num_visitor": "69", - "num_visits": "133", - "visit_avg_time": "00:00:00", - "visitor_avg_time": "00:00:00", - "entry_num_visits": "5", - "bounce_rate": "0.00%" - }, - { - "id_page": 32, - "url": "pages/component/picker/picker", - "name": "picker", - "num_visitor": "38", - "num_visits": "52", - "visit_avg_time": "00:00:05", - "visitor_avg_time": "00:00:06", - "entry_num_visits": "5", - "bounce_rate": "40.00%" - }, - { - "id_page": 30, - "url": "pages/component/web-view/web-view", - "name": "web-view", - "num_visitor": "60", - "num_visits": "125", - "visit_avg_time": "00:00:00", - "visitor_avg_time": "00:00:00", - "entry_num_visits": "4", - "bounce_rate": "25.00%" - }, - { - "id_page": 110, - "url": "pages/component/textarea/textarea", - "name": "textarea", - "num_visitor": "31", - "num_visits": "34", - "visit_avg_time": "00:00:00", - "visitor_avg_time": "00:00:00", - "entry_num_visits": "4", - "bounce_rate": "0.00%" - }, - { - "id_page": 342, - "url": "pages/template/nav-image/nav-image", - "name": "[object Object]", - "num_visitor": "37", - "num_visits": "51", - "visit_avg_time": "00:00:00", - "visitor_avg_time": "00:00:00", - "entry_num_visits": "4", - "bounce_rate": "0.00%" - }, - { - "id_page": 16, - "url": "pages/tabBar/component/component", - "name": "组件", - "num_visitor": "4", - "num_visits": "11", - "visit_avg_time": "00:00:02", - "visitor_avg_time": "00:00:07", - "entry_num_visits": "4", - "bounce_rate": "0.00%" - }, - { - "id_page": 44, - "url": "pages/API/request/request", - "name": "网络请求", - "num_visitor": "22", - "num_visits": "29", - "visit_avg_time": "00:00:00", - "visitor_avg_time": "00:00:00", - "entry_num_visits": "4", - "bounce_rate": "50.00%" - }, - { - "id_page": 128, - "url": "pages/API/share/share", - "name": "分享", - "num_visitor": "24", - "num_visits": "77", - "visit_avg_time": "00:00:00", - "visitor_avg_time": "00:00:00", - "entry_num_visits": "4", - "bounce_rate": "75.00%" - }, - { - "id_page": 26, - "url": "pages/API/set-navigation-bar-title/set-navigation-bar-title", - "name": "设置界面标题", - "num_visitor": "63", - "num_visits": "85", - "visit_avg_time": "00:00:00", - "visitor_avg_time": "00:00:00", - "entry_num_visits": "4", - "bounce_rate": "0.00%" - }, - { - "id_page": 35, - "url": "pages/component/movable-view/movable-view", - "name": "movable-view", - "num_visitor": "30", - "num_visits": "40", - "visit_avg_time": "00:00:00", - "visitor_avg_time": "00:00:00", - "entry_num_visits": "4", - "bounce_rate": "50.00%" - } - ] -} \ No newline at end of file diff --git a/sport-erp-admin/mock/uni-stat/pageRes.json b/sport-erp-admin/mock/uni-stat/pageRes.json deleted file mode 100644 index e5a205f..0000000 --- a/sport-erp-admin/mock/uni-stat/pageRes.json +++ /dev/null @@ -1,397 +0,0 @@ - { - "last_page": 6, - "current_page": 1, - "total": 170, - "item": [ - { - "id_page": 11, - "url": "pages/tabBar/case/case", - "name": "实例", - "num_visitor": "550", - "num_visits": "6,957", - "visit_avg_time": "00:00:38", - "visitor_avg_time": "00:08:05", - "exit_num_visits": "485", - "exit_rate": "6.97%", - "num_share": "0", - "hasChildren": true - }, - { - "id_page": 8, - "url": "pages/tabBar/forum/forum", - "name": "社区", - "num_visitor": "868", - "num_visits": "3,203", - "visit_avg_time": "00:01:47", - "visitor_avg_time": "00:06:37", - "exit_num_visits": "519", - "exit_rate": "16.20%", - "num_share": "0", - "hasChildren": true - }, - { - "id_page": 10, - "url": "pages/tabBar/center/center", - "name": "个人中心", - "num_visitor": "365", - "num_visits": "1,046", - "visit_avg_time": "00:02:18", - "visitor_avg_time": "00:06:37", - "exit_num_visits": "93", - "exit_rate": "8.89%", - "num_share": "0", - "hasChildren": true - }, - { - "id_page": 9, - "url": "pages/forum/detail/detail", - "name": "社区详情", - "num_visitor": "293", - "num_visits": "1,005", - "visit_avg_time": "00:00:15", - "visitor_avg_time": "00:00:53", - "exit_num_visits": "122", - "exit_rate": "12.14%", - "num_share": "0", - "hasChildren": true - }, - { - "id_page": 126, - "url": "pages/forum/login/login", - "name": "登录", - "num_visitor": "156", - "num_visits": "375", - "visit_avg_time": "00:00:06", - "visitor_avg_time": "00:00:14", - "exit_num_visits": "27", - "exit_rate": "7.20%", - "num_share": "0", - "hasChildren": true - }, - { - "id_page": 169, - "url": "pages/forum/search/index", - "name": "[object Object]", - "num_visitor": "84", - "num_visits": "266", - "visit_avg_time": "00:00:11", - "visitor_avg_time": "00:00:35", - "exit_num_visits": "34", - "exit_rate": "12.78%", - "num_share": "0", - "hasChildren": true - }, - { - "id_page": 310, - "url": "pages/API/subnvue/subnvue", - "name": "SubNvue", - "num_visitor": "50", - "num_visits": "241", - "visit_avg_time": "00:00:12", - "visitor_avg_time": "00:00:58", - "exit_num_visits": "6", - "exit_rate": "2.49%", - "num_share": "0", - "hasChildren": true - }, - { - "id_page": 2835009, - "url": "pages/component/ad/index", - "name": "", - "num_visitor": "76", - "num_visits": "215", - "visit_avg_time": "00:00:01", - "visitor_avg_time": "00:00:04", - "exit_num_visits": "9", - "exit_rate": "4.19%", - "num_share": "0", - "hasChildren": true - }, - { - "id_page": 21, - "url": "pages/template/tabbar/tabbar", - "name": "可拖动顶部选项卡", - "num_visitor": "66", - "num_visits": "143", - "visit_avg_time": "00:00:30", - "visitor_avg_time": "00:01:06", - "exit_num_visits": "5", - "exit_rate": "3.50%", - "num_share": "0", - "hasChildren": true - }, - { - "id_page": 99, - "url": "pages/template/nav-button/nav-button", - "name": "导航栏带自定义按钮", - "num_visitor": "69", - "num_visits": "133", - "visit_avg_time": "00:00:04", - "visitor_avg_time": "00:00:09", - "exit_num_visits": "5", - "exit_rate": "3.76%", - "num_share": "0", - "hasChildren": true - }, - { - "id_page": 74, - "url": "pages/template/list2detail-list/list2detail-list", - "name": "列表到详情示例", - "num_visitor": "53", - "num_visits": "129", - "visit_avg_time": "00:00:07", - "visitor_avg_time": "00:00:19", - "exit_num_visits": "3", - "exit_rate": "2.33%", - "num_share": "0", - "hasChildren": true - }, - { - "id_page": 25, - "url": "pages/component/view/view", - "name": "view", - "num_visitor": "98", - "num_visits": "126", - "visit_avg_time": "00:00:10", - "visitor_avg_time": "00:00:13", - "exit_num_visits": "3", - "exit_rate": "2.38%", - "num_share": "0", - "hasChildren": true - }, - { - "id_page": 27, - "url": "pages/component/navigator/navigator", - "name": "navigator", - "num_visitor": "67", - "num_visits": "125", - "visit_avg_time": "00:00:01", - "visitor_avg_time": "00:00:02", - "exit_num_visits": "2", - "exit_rate": "1.60%", - "num_share": "0", - "hasChildren": true - }, - { - "id_page": 30, - "url": "pages/component/web-view/web-view", - "name": "web-view", - "num_visitor": "60", - "num_visits": "125", - "visit_avg_time": "00:00:03", - "visitor_avg_time": "00:00:08", - "exit_num_visits": "6", - "exit_rate": "4.80%", - "num_share": "0", - "hasChildren": true - }, - { - "id_page": 78, - "url": "pages/component/button/button", - "name": "button", - "num_visitor": "73", - "num_visits": "124", - "visit_avg_time": "00:00:06", - "visitor_avg_time": "00:00:11", - "exit_num_visits": "10", - "exit_rate": "8.06%", - "num_share": "0", - "hasChildren": true - }, - { - "id_page": 144, - "url": "pages/template/scheme/scheme", - "name": "打开外部应用", - "num_visitor": "55", - "num_visits": "115", - "visit_avg_time": "00:00:06", - "visitor_avg_time": "00:00:13", - "exit_num_visits": "16", - "exit_rate": "13.91%", - "num_share": "0", - "hasChildren": true - }, - { - "id_page": 313, - "url": "platforms/app-plus/push/push", - "name": "推送", - "num_visitor": "38", - "num_visits": "110", - "visit_avg_time": "00:00:05", - "visitor_avg_time": "00:00:15", - "exit_num_visits": "4", - "exit_rate": "3.64%", - "num_share": "0", - "hasChildren": true - }, - { - "id_page": 129, - "url": "pages/API/login/login", - "name": "授权登录", - "num_visitor": "44", - "num_visits": "109", - "visit_avg_time": "00:00:03", - "visitor_avg_time": "00:00:08", - "exit_num_visits": "5", - "exit_rate": "4.59%", - "num_share": "0", - "hasChildren": true - }, - { - "id_page": 135, - "url": "pages/API/request-payment/request-payment", - "name": "发起支付", - "num_visitor": "43", - "num_visits": "101", - "visit_avg_time": "00:00:04", - "visitor_avg_time": "00:00:10", - "exit_num_visits": "5", - "exit_rate": "4.95%", - "num_share": "0", - "hasChildren": true - }, - { - "id_page": 141, - "url": "pages/API/scan-code/scan-code", - "name": "扫码", - "num_visitor": "38", - "num_visits": "90", - "visit_avg_time": "00:00:20", - "visitor_avg_time": "00:00:48", - "exit_num_visits": "13", - "exit_rate": "14.44%", - "num_share": "0", - "hasChildren": true - }, - { - "id_page": 42, - "url": "pages/API/navigator/navigator", - "name": "页面跳转", - "num_visitor": "27", - "num_visits": "89", - "visit_avg_time": "00:00:02", - "visitor_avg_time": "00:00:07", - "exit_num_visits": "1", - "exit_rate": "1.12%", - "num_share": "0", - "hasChildren": true - }, - { - "id_page": 57, - "url": "pages/extUI/list/list", - "name": "List 列表", - "num_visitor": "36", - "num_visits": "88", - "visit_avg_time": "00:03:21", - "visitor_avg_time": "00:08:11", - "exit_num_visits": "8", - "exit_rate": "9.09%", - "num_share": "0", - "hasChildren": true - }, - { - "id_page": 60, - "url": "pages/template/ucharts/ucharts", - "name": "uCharts 图表", - "num_visitor": "65", - "num_visits": "88", - "visit_avg_time": "00:00:19", - "visitor_avg_time": "00:00:26", - "exit_num_visits": "12", - "exit_rate": "13.64%", - "num_share": "0", - "hasChildren": true - }, - { - "id_page": 33, - "url": "pages/component/scroll-view/scroll-view", - "name": "scroll-view", - "num_visitor": "62", - "num_visits": "86", - "visit_avg_time": "00:00:11", - "visitor_avg_time": "00:00:16", - "exit_num_visits": "11", - "exit_rate": "12.79%", - "num_share": "0", - "hasChildren": true - }, - { - "id_page": 26, - "url": "pages/API/set-navigation-bar-title/set-navigation-bar-title", - "name": "设置界面标题", - "num_visitor": "63", - "num_visits": "85", - "visit_avg_time": "00:00:06", - "visitor_avg_time": "00:00:08", - "exit_num_visits": "1", - "exit_rate": "1.18%", - "num_share": "0", - "hasChildren": true - }, - { - "id_page": 3084839, - "url": "pages/template/swiper-list-nvue/swiper-list-nvue", - "name": "", - "num_visitor": "48", - "num_visits": "80", - "visit_avg_time": "00:01:11", - "visitor_avg_time": "00:01:58", - "exit_num_visits": "6", - "exit_rate": "7.50%", - "num_share": "0", - "hasChildren": true - }, - { - "id_page": 128, - "url": "pages/API/share/share", - "name": "分享", - "num_visitor": "24", - "num_visits": "77", - "visit_avg_time": "00:00:06", - "visitor_avg_time": "00:00:22", - "exit_num_visits": "8", - "exit_rate": "10.39%", - "num_share": "0", - "hasChildren": true - }, - { - "id_page": 360577, - "url": "pages/template/component-communication/component-communication", - "name": "组件通讯", - "num_visitor": "52", - "num_visits": "71", - "visit_avg_time": "00:00:03", - "visitor_avg_time": "00:00:04", - "exit_num_visits": "1", - "exit_rate": "1.41%", - "num_share": "0", - "hasChildren": true - }, - { - "id_page": 361612, - "url": "pages/API/navigator/new-page/new-vue-page-1", - "name": "新VUE页面1", - "num_visitor": "18", - "num_visits": "71", - "visit_avg_time": "00:00:01", - "visitor_avg_time": "00:00:06", - "exit_num_visits": "0", - "exit_rate": "0.00%", - "num_share": "0", - "hasChildren": true - }, - { - "id_page": 314, - "url": "platforms/app-plus/feedback/feedback", - "name": "问题反馈", - "num_visitor": "39", - "num_visits": "69", - "visit_avg_time": "00:00:10", - "visitor_avg_time": "00:00:18", - "exit_num_visits": "7", - "exit_rate": "10.14%", - "num_share": "0", - "hasChildren": true - } - ] - } \ No newline at end of file diff --git a/sport-erp-admin/mock/uni-stat/pageRule.json b/sport-erp-admin/mock/uni-stat/pageRule.json deleted file mode 100644 index 3361cd5..0000000 --- a/sport-erp-admin/mock/uni-stat/pageRule.json +++ /dev/null @@ -1,132 +0,0 @@ -{ - "last_page": 16, - "current_page": 1, - "total": 315, - "item": [ - { - "id_page": 8, - "url": "pages/tabBar/forum/forum", - "name": "社区", - "rules": [ - "id", - "type" - ] - }, - { - "id_page": 9, - "url": "pages/forum/detail/detail", - "name": "社区详情", - "rules": [ - "id,type" - ] - }, - { - "id_page": 10, - "url": "pages/tabBar/center/center", - "name": "个人中心", - "rules": null - }, - { - "id_page": 11, - "url": "pages/tabBar/case/case", - "name": "实例", - "rules": null - }, - { - "id_page": 16, - "url": "pages/tabBar/component/component", - "name": "组件", - "rules": null - }, - { - "id_page": 17, - "url": "pages/tabBar/API/API", - "name": "API", - "rules": null - }, - { - "id_page": 18, - "url": "pages/tabBar/extUI/extUI", - "name": "扩展组件", - "rules": null - }, - { - "id_page": 19, - "url": "pages/tabBar/template/template", - "name": "模版", - "rules": null - }, - { - "id_page": 20, - "url": "pages/template/mpvue-picker/mpvue-picker", - "name": "多列选择picker", - "rules": null - }, - { - "id_page": 21, - "url": "pages/template/tabbar/tabbar", - "name": "可拖动顶部选项卡", - "rules": null - }, - { - "id_page": 22, - "url": "pages/template/scrollmsg/scrollmsg", - "name": "滚动公告", - "rules": null - }, - { - "id_page": 23, - "url": "pages/template/datachecker/datachecker", - "name": "表单校验", - "rules": null - }, - { - "id_page": 24, - "url": "pages/extUI/swipe-action/swipe-action", - "name": "SwipeAction 滑动操作", - "rules": null - }, - { - "id_page": 25, - "url": "pages/component/view/view", - "name": "view", - "rules": null - }, - { - "id_page": 26, - "url": "pages/API/set-navigation-bar-title/set-navigation-bar-title", - "name": "设置界面标题", - "rules": null - }, - { - "id_page": 27, - "url": "pages/component/navigator/navigator", - "name": "navigator", - "rules": null - }, - { - "id_page": 28, - "url": "pages/component/navigator/redirect/redirect", - "name": "redirectPage", - "rules": null - }, - { - "id_page": 29, - "url": "pages/component/map/map", - "name": "map", - "rules": null - }, - { - "id_page": 30, - "url": "pages/component/web-view/web-view", - "name": "web-view", - "rules": null - }, - { - "id_page": 31, - "url": "pages/component/form/form", - "name": "form", - "rules": null - } - ] -} \ No newline at end of file diff --git a/sport-erp-admin/mock/uni-stat/userActivity.json b/sport-erp-admin/mock/uni-stat/userActivity.json deleted file mode 100644 index 6baf91f..0000000 --- a/sport-erp-admin/mock/uni-stat/userActivity.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "categories": [ - "2021-11-08", - "2021-11-09", - "2021-11-10", - "2021-11-11", - "2021-11-12", - "2021-11-13", - "2021-11-14", - "2021-11-15", - "2021-11-16", - "2021-11-17", - "2021-11-18", - "2021-11-19", - "2021-11-20", - "2021-11-21", - "2021-11-22", - "2021-11-23", - "2021-11-24", - "2021-11-25", - "2021-11-26", - "2021-11-27", - "2021-11-28", - "2021-11-29", - "2021-11-30", - "2021-12-01", - "2021-12-02", - "2021-12-03", - "2021-12-04", - "2021-12-05", - "2021-12-06", - "2021-12-07", - "2021-12-08" - ], - "series": [ - { - "name": "日活", - "data": [ - 1520, - 1523, - 1462, - 1445, - 1433, - 972, - 768, - 1421, - 1581, - 1613, - 1549, - 1517, - 989, - 839, - 1579, - 1539, - 1574, - 1518, - 1584, - 1043, - 853, - 1498, - 1553, - 1170, - 909, - 866, - 620, - 566, - 884, - 905, - 643 - ] - } - ] -} \ No newline at end of file diff --git a/sport-erp-admin/package.json b/sport-erp-admin/package.json deleted file mode 100644 index f4686dd..0000000 --- a/sport-erp-admin/package.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "name": "uni-admin 基础框架(原名 uniCloud admin)", - "id": "uni-template-admin", - "displayName": "uni-admin 基础框架", - "version": "2.5.13", - "description": "基于uni-app & uniCloud的后台管理项目模板(管理后台开发必备神器)", - "main": "main.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": "https://github.com/dcloudio/uni-admin.git", - "keywords": [ - "admin", - "uniCloud", - "管理后台", - "云后台", - "uni-admin" -], - "engines": { - "HBuilderX": "^3.6.0", - "uni-app": "^4.36", - "uni-app-x": "" - }, - "author": "", - "license": "MIT", - "bugs": { - "url": "https://github.com/dcloudio/uni-admin/issues" - }, - "homepage": "https://github.com/dcloudio/uni-admin#readme", - "dcloudext": { - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "", - "type": "unicloud-template-project", - "darkmode": "x", - "i18n": "√", - "widescreen": "√" - }, - "uni_modules": { - "dependencies": [], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "√", - "aliyun": "√", - "alipay": "√" - }, - "client": { - "uni-app": { - "vue": { - "vue2": "√", - "vue3": "√" - }, - "web": { - "safari": "√", - "chrome": "√" - }, - "app": { - "vue": "√", - "nvue": "x", - "android": "√", - "ios": "√", - "harmony": "√" - }, - "mp": { - "weixin": "√", - "alipay": "√", - "toutiao": "-", - "baidu": "-", - "kuaishou": "-", - "jd": "-", - "harmony": "-", - "qq": "-", - "lark": "-" - }, - "quickapp": { - "huawei": "-", - "union": "-" - } - }, - "uni-app-x": { - "web": { - "safari": "-", - "chrome": "-" - }, - "app": { - "android": "-", - "ios": "-", - "harmony": "-" - }, - "mp": { - "weixin": "-" - } - }, - "App": { - "app-harmony": "u", - "app-nvue": "u", - "app-uvue": "u", - "app-vue": "u" - } - } - } - } -} \ No newline at end of file diff --git a/sport-erp-admin/pages.json b/sport-erp-admin/pages.json deleted file mode 100644 index b1e420e..0000000 --- a/sport-erp-admin/pages.json +++ /dev/null @@ -1,508 +0,0 @@ -{ - "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages - { - "path": "pages/index/index" - }, - { - "path": "pages/demo/icons/icons", - "style": { - "navigationBarTitleText": "图标" - } - }, - { - "path": "pages/demo/table/table", - "style": { - "navigationBarTitleText": "表格" - } - }, - { - "path": "uni_modules/uni-id-pages/pages/login/login-withpwd", - "style": { - "topWindow": false, - "leftWindow": false, - "navigationBarTitleText": "登录" - } - }, - { - "path": "pages/error/404", - "style": { - "navigationBarTitleText": "Not Found" - } - }, - { - "path": "uni_modules/uni-id-pages/pages/userinfo/change_pwd/change_pwd", - "style": { - "navigationBarTitleText": "修改密码" - } - }, - { - "path": "uni_modules/uni-upgrade-center/pages/version/list", - "style": { - "navigationBarTitleText": "版本列表" - } - }, - { - "path": "uni_modules/uni-upgrade-center/pages/version/add", - "style": { - "navigationBarTitleText": "新版发布" - } - }, - { - "path": "uni_modules/uni-upgrade-center/pages/version/detail", - "style": { - "navigationBarTitleText": "版本信息查看" - } - }, - { - "path": "uni_modules/uni-id-pages/pages/userinfo/deactivate/deactivate", - "style": { - "navigationBarTitleText": "注销账号" - } - }, - { - "path": "uni_modules/uni-id-pages/pages/userinfo/userinfo", - "style": { - "navigationBarTitleText": "个人资料" - } - }, - { - "path": "uni_modules/uni-id-pages/pages/userinfo/bind-mobile/bind-mobile", - "style": { - "navigationBarTitleText": "绑定手机号码" - } - }, { - "path": "uni_modules/uni-id-pages/pages/userinfo/cropImage/cropImage", - "style": { - "navigationBarTitleText": "" - } - }, - { - "path": "uni_modules/uni-id-pages/pages/login/login-smscode", - "style": { - "topWindow": false, - "leftWindow": false, - "navigationBarTitleText": "手机验证码登录" - } - }, - { - "path": "uni_modules/uni-id-pages/pages/login/login-withoutpwd", - "style": { - "topWindow": false, - "leftWindow": false, - "navigationBarTitleText": "免密登录页" - } - }, - { - "path": "uni_modules/uni-id-pages/pages/register/register", - "style": { - "topWindow": false, - "leftWindow": false, - "navigationBarTitleText": "注册" - } - }, - { - "path": "uni_modules/uni-id-pages/pages/register/register-admin", - "style": { - "topWindow": false, - "leftWindow": false, - "navigationBarTitleText": "创建超级管理员" - } - }, - { - "path": "uni_modules/uni-id-pages/pages/register/register-by-email", - "style": { - "topWindow": false, - "leftWindow": false, - "navigationBarTitleText": "邮箱验证码注册" - } - }, - { - "path": "uni_modules/uni-id-pages/pages/retrieve/retrieve", - "style": { - "topWindow": false, - "leftWindow": false, - "navigationBarTitleText": "重置密码" - } - }, - { - "path": "uni_modules/uni-id-pages/pages/retrieve/retrieve-by-email", - "style": { - "topWindow": false, - "leftWindow": false, - "navigationBarTitleText": "通过邮箱重置密码" - } - }, - { - "path": "uni_modules/uni-id-pages/pages/common/webview/webview", - "style": { - "topWindow": false, - "leftWindow": false, - "enablePullDownRefresh": false, - "navigationBarTitleText": "" - } - }, - { - "path": "uni_modules/uni-id-pages/pages/userinfo/set-pwd/set-pwd", - "style": { - "enablePullDownRefresh": false, - "navigationBarTitleText": "设置密码" - } - } - ,{ - "path": "uni_modules/uni-id-pages/pages/userinfo/realname-verify/realname-verify", - "style": { - "enablePullDownRefresh": false, - "navigationBarTitleText": "实名认证" - } -} -], - "subPackages": [{ - "root": "pages/system", - "pages": [{ - "path": "menu/list", - "style": { - "navigationBarTitleText": "菜单管理" - } - }, - { - "path": "menu/add", - "style": { - "navigationBarTitleText": "新增菜单", - "navigationStyle": "default" - } - }, - { - "path": "menu/edit", - "style": { - "navigationBarTitleText": "修改菜单", - "navigationStyle": "default" - } - }, - { - "path": "permission/list", - "style": { - "navigationBarTitleText": "权限管理" - } - }, - { - "path": "permission/add", - "style": { - "navigationBarTitleText": "新增权限", - "navigationStyle": "default" - } - }, - { - "path": "permission/edit", - "style": { - "navigationBarTitleText": "修改权限", - "navigationStyle": "default" - } - }, - { - "path": "role/add", - "style": { - "navigationBarTitleText": "新增角色", - "navigationStyle": "default" - } - }, - { - "path": "role/edit", - "style": { - "navigationBarTitleText": "修改角色", - "navigationStyle": "default" - } - }, - { - "path": "role/list", - "style": { - "navigationBarTitleText": "角色管理" - } - }, - { - "path": "user/add", - "style": { - "navigationBarTitleText": "新增用户", - "navigationStyle": "default" - } - }, - { - "path": "user/edit", - "style": { - "navigationBarTitleText": "修改用户", - "navigationStyle": "default" - } - }, - { - "path": "user/list", - "style": { - "navigationBarTitleText": "用户管理" - } - }, - { - "path": "app/add", - "style": { - "navigationBarTitleText": "新增应用", - "navigationStyle": "default" - } - }, - { - "path": "app/list", - "style": { - "navigationBarTitleText": "应用管理" - } - }, - { - "path": "app/uni-portal/uni-portal", - "style": { - "navigationBarTitleText": "发布页管理", - "navigationStyle": "default" - } - }, - { - "path": "tag/add", - "style": { - "navigationBarTitleText": "新增标签" - } - }, - { - "path": "tag/edit", - "style": { - "navigationBarTitleText": "修改标签" - } - }, - { - "path": "tag/list", - "style": { - "navigationBarTitleText": "标签管理" - } - }, - { - "path": "safety/list", - "style": { - "navigationBarTitleText": "用户日志" - } - } - ] - }, - { - "root": "pages/uni-stat", - "pages": [{ - "path": "page-res/page-res", - "style": { - "navigationBarTitleText": "受访页", - "enablePullDownRefresh": false - } - }, - { - "path": "page-ent/page-ent", - "style": { - "navigationBarTitleText": "入口页", - "enablePullDownRefresh": false - } - }, - { - "path": "page-content/page-content", - "style": { - "navigationBarTitleText": "内容统计", - "enablePullDownRefresh": false - } - }, - { - "path": "page-rule/page-rule", - "style": { - "navigationBarTitleText": "页面规则", - "enablePullDownRefresh": false - } - }, - { - "path": "scene/scene", - "style": { - "navigationBarTitleText": "场景值(小程序)", - "enablePullDownRefresh": false - } - }, - { - "path": "channel/channel", - "style": { - "navigationBarTitleText": "渠道(app)", - "enablePullDownRefresh": false - } - }, - // #ifndef MP || APP - { - "path": "error/js/js", - "style": { - "navigationBarTitleText": "js报错统计", - "enablePullDownRefresh": false - } - }, - // #endif - { - "path": "error/js/detail", - "style": { - "navigationBarTitleText": "错误信息", - "navigationStyle": "default", - "enablePullDownRefresh": false - } - }, - { - "path": "error/app/app", - "style": { - "navigationBarTitleText": "app原生报错统计", - "enablePullDownRefresh": false - } - }, - { - "path": "event/event", - "style": { - "navigationBarTitleText": "事件和转化", - "enablePullDownRefresh": false - } - }, - { - "path": "device/overview/overview", - "style": { - "navigationBarTitleText": "今日概况", - "enablePullDownRefresh": false - } - }, - { - "path": "device/activity/activity", - "style": { - "navigationBarTitleText": "活跃度", - "enablePullDownRefresh": false - } - }, - { - "path": "device/trend/trend", - "style": { - "navigationBarTitleText": "趋势分析", - "enablePullDownRefresh": false - } - }, - { - "path": "device/retention/retention", - "style": { - "navigationBarTitleText": "留存", - "enablePullDownRefresh": false - } - }, - { - "path": "device/comparison/comparison", - "style": { - "navigationBarTitleText": "平台对比", - "enablePullDownRefresh": false - } - }, - { - "path": "device/stickiness/stickiness", - "style": { - "navigationBarTitleText": "粘性", - "enablePullDownRefresh": false - } - }, - { - "path": "user/overview/overview", - "style": { - "navigationBarTitleText": "今日概况", - "enablePullDownRefresh": false - } - }, - { - "path": "user/activity/activity", - "style": { - "navigationBarTitleText": "活跃度", - "enablePullDownRefresh": false - } - }, - { - "path": "user/trend/trend", - "style": { - "navigationBarTitleText": "趋势分析", - "enablePullDownRefresh": false - } - }, - { - "path": "user/retention/retention", - "style": { - "navigationBarTitleText": "留存", - "enablePullDownRefresh": false - } - }, - { - "path": "user/comparison/comparison", - "style": { - "navigationBarTitleText": "平台对比", - "enablePullDownRefresh": false - } - }, - { - "path": "user/stickiness/stickiness", - "style": { - "navigationBarTitleText": "粘性", - "enablePullDownRefresh": false - } - }, - { - "path": "pay-order/overview/overview", - "style": { - "navigationBarTitleText": "订单概况", - "enablePullDownRefresh": false - } - }, - { - "path": "pay-order/list/list", - "style": { - "navigationBarTitleText": "订单明细", - "enablePullDownRefresh": false - } - }, - { - "path": "pay-order/funnel/funnel", - "style": { - "navigationBarTitleText": "漏斗分析", - "enablePullDownRefresh": false - } - }, - { - "path": "pay-order/ranking/ranking", - "style": { - "navigationBarTitleText": "用户价值排行", - "enablePullDownRefresh": false - } - } - ] - } - ], - "globalStyle": { - "navigationBarTextStyle": "black", - "navigationBarTitleText": "管理系统", - "navigationBarBackgroundColor": "#F8F8F8", - "backgroundColor": "#F8F8F8", - "h5": { - "titleNView": false - } - }, - "topWindow": { - "path": "windows/topWindow", - "style": { - "height": "60px" - }, - "matchMedia": { - "minWidth": 0 - } - }, - "leftWindow": { - "path": "windows/leftWindow", - "style": { - "width": "240px" - } - }, - "uniIdRouter": { - "loginPage": "uni_modules/uni-id-pages/pages/login/login-withpwd", - "needLogin": [ - "^(?!.*uni-id-pages\/pages\/(login|register|retrieve)\/).*$" - ], - "resToLogin": true - } -} diff --git a/sport-erp-admin/pages/demo/icons/icons.vue b/sport-erp-admin/pages/demo/icons/icons.vue deleted file mode 100644 index 61c06e3..0000000 --- a/sport-erp-admin/pages/demo/icons/icons.vue +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - diff --git a/sport-erp-admin/pages/demo/icons/uni-icons.js b/sport-erp-admin/pages/demo/icons/uni-icons.js deleted file mode 100644 index fa2cba9..0000000 --- a/sport-erp-admin/pages/demo/icons/uni-icons.js +++ /dev/null @@ -1,132 +0,0 @@ -export default [ - 'pulldown', - 'refreshempty', - 'back', - 'forward', - 'more', - 'more-filled', - 'scan', - 'qq', - 'weibo', - 'weixin', - 'pengyouquan', - 'loop', - 'refresh', - 'refresh-filled', - 'arrowthindown', - 'arrowthinleft', - 'arrowthinright', - 'arrowthinup', - 'undo-filled', - 'undo', - 'redo', - 'redo-filled', - 'bars', - 'chatboxes', - 'camera', - 'chatboxes-filled', - 'camera-filled', - 'cart-filled', - 'cart', - 'checkbox-filled', - 'checkbox', - 'arrowleft', - 'arrowdown', - 'arrowright', - 'smallcircle-filled', - 'arrowup', - 'circle', - 'eye-filled', - 'eye-slash-filled', - 'eye-slash', - 'eye', - 'flag-filled', - 'flag', - 'gear-filled', - 'reload', - 'gear', - 'hand-thumbsdown-filled', - 'hand-thumbsdown', - 'hand-thumbsup-filled', - 'heart-filled', - 'hand-thumbsup', - 'heart', - 'home', - 'info', - 'home-filled', - 'info-filled', - 'circle-filled', - 'chat-filled', - 'chat', - 'mail-open-filled', - 'email-filled', - 'mail-open', - 'email', - 'checkmarkempty', - 'list', - 'locked-filled', - 'locked', - 'map-filled', - 'map-pin', - 'map-pin-ellipse', - 'map', - 'minus-filled', - 'mic-filled', - 'minus', - 'micoff', - 'mic', - 'clear', - 'smallcircle', - 'close', - 'closeempty', - 'paperclip', - 'paperplane', - 'paperplane-filled', - 'person-filled', - 'contact-filled', - 'person', - 'contact', - 'images-filled', - 'phone', - 'images', - 'image', - 'image-filled', - 'location-filled', - 'location', - 'plus-filled', - 'plus', - 'plusempty', - 'help-filled', - 'help', - 'navigate-filled', - 'navigate', - 'mic-slash-filled', - 'search', - 'settings', - 'sound', - 'sound-filled', - 'spinner-cycle', - 'download-filled', - 'personadd-filled', - 'videocam-filled', - 'personadd', - 'upload', - 'upload-filled', - 'starhalf', - 'star-filled', - 'star', - 'trash', - 'phone-filled', - 'compose', - 'videocam', - 'trash-filled', - 'download', - 'chatbubble-filled', - 'chatbubble', - 'cloud-download', - 'cloud-upload-filled', - 'cloud-upload', - 'cloud-download-filled', - 'headphones', - 'shop' -] diff --git a/sport-erp-admin/pages/demo/table/table.vue b/sport-erp-admin/pages/demo/table/table.vue deleted file mode 100644 index 681ff5f..0000000 --- a/sport-erp-admin/pages/demo/table/table.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - diff --git a/sport-erp-admin/pages/demo/table/tableData.js b/sport-erp-admin/pages/demo/table/tableData.js deleted file mode 100644 index 14ac826..0000000 --- a/sport-erp-admin/pages/demo/table/tableData.js +++ /dev/null @@ -1,193 +0,0 @@ -export default [{ - "date": "2020-09-01", - "name": "Dcloud1", - "address": "上海市普陀区金沙江路 1518 弄" -}, { - "date": "2020-09-02", - "name": "Dcloud2", - "address": "上海市普陀区金沙江路 1517 弄" -}, { - "date": "2020-09-03", - "name": "Dcloud3", - "address": "上海市普陀区金沙江路 1519 弄" -}, { - "date": "2020-09-04", - "name": "Dcloud4", - "address": "上海市普陀区金沙江路 1516 弄" -}, { - "date": "2020-09-05", - "name": "Dcloud5", - "address": "上海市普陀区金沙江路 1518 弄" -}, { - "date": "2020-09-06", - "name": "Dcloud6", - "address": "上海市普陀区金沙江路 1517 弄" -}, { - "date": "2020-09-07", - "name": "Dcloud7", - "address": "上海市普陀区金沙江路 1519 弄" -}, { - "date": "2020-09-08", - "name": "Dcloud8", - "address": "上海市普陀区金沙江路 1516 弄" -}, { - "date": "2020-09-09", - "name": "Dcloud9", - "address": "上海市普陀区金沙江路 1518 弄" -}, { - "date": "2020-09-10", - "name": "Dcloud10", - "address": "上海市普陀区金沙江路 1517 弄" -}, { - "date": "2020-09-11", - "name": "Dcloud11", - "address": "上海市普陀区金沙江路 1519 弄" -}, { - "date": "2020-09-12", - "name": "Dcloud12", - "address": "上海市普陀区金沙江路 1516 弄" -}, { - "date": "2020-09-13", - "name": "Dcloud13", - "address": "上海市普陀区金沙江路 1518 弄" -}, { - "date": "2020-09-14", - "name": "Dcloud14", - "address": "上海市普陀区金沙江路 1517 弄" -}, { - "date": "2020-09-15", - "name": "Dcloud15", - "address": "上海市普陀区金沙江路 1519 弄" -}, { - "date": "2020-09-16", - "name": "Dcloud16", - "address": "上海市普陀区金沙江路 1516 弄" -}, { - "date": "2020-09-01", - "name": "Dcloud17", - "address": "上海市普陀区金沙江路 1518 弄" -}, { - "date": "2020-09-02", - "name": "Dcloud18", - "address": "上海市普陀区金沙江路 1517 弄" -}, { - "date": "2020-09-03", - "name": "Dcloud19", - "address": "上海市普陀区金沙江路 1519 弄" -}, { - "date": "2020-09-04", - "name": "Dcloud20", - "address": "上海市普陀区金沙江路 1516 弄" -}, { - "date": "2020-09-05", - "name": "Dcloud21", - "address": "上海市普陀区金沙江路 1518 弄" -}, { - "date": "2020-09-06", - "name": "Dcloud22", - "address": "上海市普陀区金沙江路 1517 弄" -}, { - "date": "2020-09-07", - "name": "Dcloud23", - "address": "上海市普陀区金沙江路 1519 弄" -}, { - "date": "2020-09-08", - "name": "Dcloud24", - "address": "上海市普陀区金沙江路 1516 弄" -}, { - "date": "2020-09-09", - "name": "Dcloud25", - "address": "上海市普陀区金沙江路 1518 弄" -}, { - "date": "2020-09-10", - "name": "Dcloud26", - "address": "上海市普陀区金沙江路 1517 弄" -}, { - "date": "2020-09-11", - "name": "Dcloud27", - "address": "上海市普陀区金沙江路 1519 弄" -}, { - "date": "2020-09-12", - "name": "Dcloud28", - "address": "上海市普陀区金沙江路 1516 弄" -}, { - "date": "2020-09-13", - "name": "Dcloud29", - "address": "上海市普陀区金沙江路 1518 弄" -}, { - "date": "2020-09-14", - "name": "Dcloud30", - "address": "上海市普陀区金沙江路 1517 弄" -}, { - "date": "2020-09-15", - "name": "Dcloud31", - "address": "上海市普陀区金沙江路 1519 弄" -}, { - "date": "2020-09-16", - "name": "Dcloud32", - "address": "上海市普陀区金沙江路 1516 弄" -}, { - "date": "2020-09-01", - "name": "Dcloud33", - "address": "上海市普陀区金沙江路 1518 弄" -}, { - "date": "2020-09-02", - "name": "Dcloud34", - "address": "上海市普陀区金沙江路 1517 弄" -}, { - "date": "2020-09-03", - "name": "Dcloud35", - "address": "上海市普陀区金沙江路 1519 弄" -}, { - "date": "2020-09-04", - "name": "Dcloud36", - "address": "上海市普陀区金沙江路 1516 弄" -}, { - "date": "2020-09-05", - "name": "Dcloud37", - "address": "上海市普陀区金沙江路 1518 弄" -}, { - "date": "2020-09-06", - "name": "Dcloud38", - "address": "上海市普陀区金沙江路 1517 弄" -}, { - "date": "2020-09-07", - "name": "Dcloud39", - "address": "上海市普陀区金沙江路 1519 弄" -}, { - "date": "2020-09-08", - "name": "Dcloud40", - "address": "上海市普陀区金沙江路 1516 弄" -}, { - "date": "2020-09-09", - "name": "Dcloud41", - "address": "上海市普陀区金沙江路 1518 弄" -}, { - "date": "2020-09-10", - "name": "Dcloud42", - "address": "上海市普陀区金沙江路 1517 弄" -}, { - "date": "2020-09-11", - "name": "Dcloud43", - "address": "上海市普陀区金沙江路 1519 弄" -}, { - "date": "2020-09-12", - "name": "Dcloud44", - "address": "上海市普陀区金沙江路 1516 弄" -}, { - "date": "2020-09-13", - "name": "Dcloud45", - "address": "上海市普陀区金沙江路 1518 弄" -}, { - "date": "2020-09-14", - "name": "Dcloud46", - "address": "上海市普陀区金沙江路 1517 弄" -}, { - "date": "2020-09-15", - "name": "Dcloud47", - "address": "上海市普陀区金沙江路 1519 弄" -}, { - "date": "2020-09-16", - "name": "Dcloud48", - "address": "上海市普陀区金沙江路 1516 弄" -}] diff --git a/sport-erp-admin/pages/error/404.vue b/sport-erp-admin/pages/error/404.vue deleted file mode 100644 index 23dc934..0000000 --- a/sport-erp-admin/pages/error/404.vue +++ /dev/null @@ -1,59 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/index/fieldsMap.js b/sport-erp-admin/pages/index/fieldsMap.js deleted file mode 100644 index e1d1bbb..0000000 --- a/sport-erp-admin/pages/index/fieldsMap.js +++ /dev/null @@ -1,82 +0,0 @@ -const deviceFeildsMap = [{ - value: '今天', - contrast: '昨天' -}, { - field: 'appid', - title: 'APPID', - tooltip: '', -}, { - field: 'name', - title: '应用名', - tooltip: '', -}, { - field: 'total_devices', - title: '总设备数', - tooltip: '从添加统计到当前选择时间的总设备数(去重)', - value: 0, - contrast: 0, -}, { - field: 'new_device_count', - title: '新增设备', - tooltip: '首次访问应用的设备数(以设备为判断标准,去重)', - value: 0, - contrast: 0 -}, { - field: 'active_device_count', - title: '活跃设备', - tooltip: '访问过应用内任意页面的总设备数(去重)', - value: 0, - contrast: 0 -}, -// { -// field: 'page_visit_count', -// title: '访问次数', -// tooltip: '访问过应用内任意页面总次数,多个页面之间跳转、同一页面的重复访问计为多次访问', -// value: 0, -// contrast: 0 -// } -] - -const userFeildsMap = [{ - value: '今天', - contrast: '昨天' -}, { - field: 'appid', - title: 'APPID', - tooltip: '', -}, { - field: 'name', - title: '应用名', - tooltip: '', -}, { - field: 'total_users', - title: '总用户数', - tooltip: '从添加统计到当前选择时间的总用户数(去重)', - value: 0, - contrast: 0, -}, { - field: 'new_user_count', - title: '新增用户', - tooltip: '首次访问应用的用户数(以用户为判断标准,去重)', - value: 0, - contrast: 0 -}, { - field: 'active_user_count', - title: '活跃用户', - tooltip: '访问过应用内任意页面的总用户数(去重)', - value: 0, - contrast: 0 -}, -// { -// field: 'page_visit_count', -// title: '访问次数', -// tooltip: '访问过应用内任意页面总次数,多个页面之间跳转、同一页面的重复访问计为多次访问', -// value: 0, -// co\rast: 0 -// } -] - -export { - deviceFeildsMap, - userFeildsMap -} diff --git a/sport-erp-admin/pages/index/index.vue b/sport-erp-admin/pages/index/index.vue deleted file mode 100644 index 4787a2f..0000000 --- a/sport-erp-admin/pages/index/index.vue +++ /dev/null @@ -1,424 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/index/test.ts b/sport-erp-admin/pages/index/test.ts deleted file mode 100644 index ddb6788..0000000 --- a/sport-erp-admin/pages/index/test.ts +++ /dev/null @@ -1 +0,0 @@ -var testValue = 3 > 2 ? true : false; \ No newline at end of file diff --git a/sport-erp-admin/pages/system/app/add.vue b/sport-erp-admin/pages/system/app/add.vue deleted file mode 100644 index b002ddb..0000000 --- a/sport-erp-admin/pages/system/app/add.vue +++ /dev/null @@ -1,540 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/system/app/list.vue b/sport-erp-admin/pages/system/app/list.vue deleted file mode 100644 index b69dfc5..0000000 --- a/sport-erp-admin/pages/system/app/list.vue +++ /dev/null @@ -1,313 +0,0 @@ - - - - diff --git a/sport-erp-admin/pages/system/app/mixin/publish_add_detail_mixin.js b/sport-erp-admin/pages/system/app/mixin/publish_add_detail_mixin.js deleted file mode 100644 index 19dbb5e..0000000 --- a/sport-erp-admin/pages/system/app/mixin/publish_add_detail_mixin.js +++ /dev/null @@ -1,271 +0,0 @@ -import { - validator, - mpPlatform -} from '@/js_sdk/validator/opendb-app-list.js'; - -const formatFilePickerValue = (url) => (url ? { - "name": "", - "extname": "", - "url": url, -} : {}) - -function getValidator(fields) { - let result = {} - for (let key in validator) { - if (fields.includes(key)) { - result[key] = validator[key] - } - } - return result -} - -const schemes = ["mimarket", "samsungapps", "appmarket", "oppomarket", "vivomarket"] -const schemeBrand = ["xiaomi", "samsung", "huawei", "oppo", "vivo"] - -export default { - data() { - let formData = { - "appid": "", - "name": "", - "app_type": 0, - "icon_url": "", - "introduction": "", - "alias": "", - "description": "", - "screenshot": [], - "store_list": [], - "app_android": {}, - "app_ios": {}, - "app_harmony": {}, - "mp_weixin": {}, - "mp_alipay": {}, - "mp_baidu": {}, - "mp_toutiao": {}, - "mp_qq": {}, - "mp_lark": {}, - "mp_kuaishou": {}, - "mp_dingtalk": {}, - "mp_jd": {}, - "h5": {}, - "quickapp": {} - } - const data = { - formData, - rules: Object.freeze(getValidator(Object.keys(formData))), - mpPlatform: Object.freeze(mpPlatform), - screenshotList: [], - middleware_img: {}, - middleware_checkbox: {}, - appPackageInfo: {}, - appPlatformKeys: Object.freeze(['app_ios', 'app_android', 'app_harmony']), - appPlatformValues: Object.freeze({ - app_android: 'Android', - app_ios: 'iOS', - app_harmony: 'Harmony' - }), - keepItems: Object.freeze([]), - isEdit: false, - deletedStore: [] - } - const mpKeys = Object.keys(mpPlatform); - data.mpPlatformKeys = Object.freeze(mpKeys); - [].concat(mpKeys, ['icon_url', 'quickapp']).forEach(key => data.middleware_img[key] = {}); - data.platFormKeys = Object.freeze([].concat(mpKeys, data.appPlatformKeys)) - data.platFormKeys.forEach(key => data.middleware_checkbox[key] = false) - return data - }, - methods: { - requestCloudFunction(functionName, params = {}) { - return this.$request(functionName, params, { - functionName: 'uni-upgrade-center' - }) - }, - hasValue(value) { - if (typeof value !== 'object') return !!value - if (value instanceof Array) return !!value.length - return !!(value && Object.keys(value).length) - }, - initFormData(obj) { - if (!obj || !Object.keys(obj).length) return; - // TODO delete - for (let key in obj) { - const value = obj[key] - switch (key) { - case 'icon_url': - this.middleware_img[key] = formatFilePickerValue(value) - break; - case 'screenshot': - this.screenshotList = value.map(item => formatFilePickerValue(item)) - break; - default: - if ((key.indexOf('mp') !== -1 || key.indexOf('app') !== -1) && this.hasValue(value)) { - this.setPlatformChcekbox(key, true) - if (value.qrcode_url) - this.middleware_img[key] = formatFilePickerValue(value.qrcode_url) - } - break; - } - this.setFormData(key, value) - } - }, - setFormData(key, value) { - const keys = key.indexOf('.') !== -1 ? key.split('.') : [key]; - const lens = keys.length - 1 - let tempObj = this.formData - keys.forEach((key, index) => { - const obj = tempObj[key] - if (typeof obj === 'object' && index < lens) { - tempObj = obj - } else { - tempObj[key] = value - } - }) - }, - getFormData(key) { - const keys = key.indexOf('.') !== -1 ? key.split('.') : [key]; - const lens = keys.length - 1 - let tempObj = this.formData - for (let i = 0; i < keys.length; i++) { - const key = keys[i] - tempObj = tempObj[key] - if (tempObj == null) { - return false - } - } - return tempObj - }, - formatFormData() { - this.setFormData('screenshot', this.screenshotList.map(item => item.fileID || item.url)) - - for (let i = 0; i < this.formData.store_list.length; i++) { - const item = this.formData.store_list[i] - - if (item.scheme.trim().length === 0) { - this.formData.store_list.splice(i, 1) - i-- - continue; - } - - const index = schemes.indexOf((item.scheme.match(/(.*):\/\//) || [])[1]) - if (index !== -1) { - if (item.id !== schemeBrand[index]) { - this.deletedStore.push(item.id) - } - item.id = schemeBrand[index] - } - item.priority = parseFloat(item.priority) - } - - this.keepItems = this.platFormKeys - .filter(key => - this.getPlatformChcekbox(key) && - (this.formData[key].url || this.formData[key].abm_url || this.formData[key].qrcode_url) - ) - .concat(['icon_url', 'screenshot', 'create_date', 'store_list', 'app_type']) - - if (this.formData.h5 && this.formData.h5.url) - this.keepItems.push('h5'); - }, - // 根据 appid 自动填充 - autoFill() { - const appid = this.getFormData('appid') - if (!appid) { - return - } - - uni.showLoading({ - mask: true - }) - - this.requestCloudFunction('getAppInfo', { - appid - }) - .then(res => { - if (res.success) { - this.setFormData('description', res.description) - this.setFormData('name', res.name) - return - } - }).catch(e => { - console.error(e) - }).finally(() => { - uni.hideLoading() - }) - }, - autoFillApp() { - const appid = this.getFormData('appid') - if (!appid) { - return - } - - this.appPlatformKeys.forEach(key => { - this.fetchAppInfo(appid, this.appPlatformValues[key]).then(res => { - if (res && res.success) { - this.setPlatformChcekbox(key, true) - this.setFormData(key, { - name: res.name, - url: res.url - }) - return; - } - }) - }) - }, - fetchAppInfo(appid, platform) { - uni.showLoading({ - mask: true - }) - return this.requestCloudFunction('getAppVersionInfo', { - appid, - platform - }).then(res => { - return res - }).catch(e => { - console.error(e) - }).finally(() => { - uni.hideLoading() - }) - }, - iconUrlSuccess(res, key) { - uni.showToast({ - icon: 'success', - title: '上传成功', - duration: 500 - }) - this.setFormData(key, res.tempFilePaths[0]) - }, - async iconUrlDelete(res, key) { - let deleteRes = await this.requestCloudFunction('deleteFile', { - fileList: [res.tempFile.fileID || res.tempFile.url] - }) - uni.showToast({ - icon: 'success', - title: '删除成功', - duration: 800 - }) - if (!key) return; - this.setFormData(key, '') - this.$refs.form.clearValidate(key) - }, - getPlatformChcekbox(mp_name) { - return this.middleware_checkbox[mp_name] - }, - setPlatformChcekbox(mp_name, value = false) { - this.middleware_checkbox[mp_name] = value - }, - selectFile() { - if (this.hasPackage) { - uni.showToast({ - icon: 'none', - title: '只可上传一个文件,请删除已上传后重试', - duration: 1000 - }); - } - } - }, - computed: { - hasPackage() { - return this.appPackageInfo && !!Object.keys(this.appPackageInfo).length - }, - } -} diff --git a/sport-erp-admin/pages/system/app/uni-portal/uni-portal.vue b/sport-erp-admin/pages/system/app/uni-portal/uni-portal.vue deleted file mode 100644 index 3e4dfba..0000000 --- a/sport-erp-admin/pages/system/app/uni-portal/uni-portal.vue +++ /dev/null @@ -1,160 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/system/menu/add.vue b/sport-erp-admin/pages/system/menu/add.vue deleted file mode 100644 index 738d619..0000000 --- a/sport-erp-admin/pages/system/menu/add.vue +++ /dev/null @@ -1,164 +0,0 @@ - - - - diff --git a/sport-erp-admin/pages/system/menu/edit.vue b/sport-erp-admin/pages/system/menu/edit.vue deleted file mode 100644 index b21f416..0000000 --- a/sport-erp-admin/pages/system/menu/edit.vue +++ /dev/null @@ -1,188 +0,0 @@ - - - - diff --git a/sport-erp-admin/pages/system/menu/list.vue b/sport-erp-admin/pages/system/menu/list.vue deleted file mode 100644 index 7b43a1c..0000000 --- a/sport-erp-admin/pages/system/menu/list.vue +++ /dev/null @@ -1,495 +0,0 @@ - - - - diff --git a/sport-erp-admin/pages/system/menu/originalMenuList.json b/sport-erp-admin/pages/system/menu/originalMenuList.json deleted file mode 100644 index a85e72a..0000000 --- a/sport-erp-admin/pages/system/menu/originalMenuList.json +++ /dev/null @@ -1,446 +0,0 @@ -[{ - "menu_id": "index", - "name": "首页", - "icon": "uni-icons-home", - "url": "/", - "sort": 100, - "parent_id": "", - "permission": [], - "enable": true, - "create_date": 1602662469396 - }, { - "menu_id": "system_management", - "name": "系统管理", - "icon": "admin-icons-fl-xitong", - "url": "", - "sort": 1000, - "parent_id": "", - "permission": [], - "enable": true, - "create_date": 1602662469396 - }, { - "menu_id": "system_user", - "name": "用户管理", - "icon": "admin-icons-manager-user", - "url": "/pages/system/user/list", - "sort": 1010, - "parent_id": "system_management", - "permission": [], - "enable": true, - "create_date": 1602662469398 - }, { - "menu_id": "system_role", - "name": "角色管理", - "icon": "admin-icons-manager-role", - "url": "/pages/system/role/list", - "sort": 1020, - "parent_id": "system_management", - "permission": [], - "enable": true, - "create_date": 1602662469397 - }, { - "menu_id": "system_permission", - "name": "权限管理", - "icon": "admin-icons-manager-permission", - "url": "/pages/system/permission/list", - "sort": 1030, - "parent_id": "system_management", - "permission": [], - "enable": true, - "create_date": 1602662469396 - }, { - "menu_id": "system_menu", - "name": "菜单管理", - "icon": "admin-icons-manager-menu", - "url": "/pages/system/menu/list", - "sort": 1040, - "parent_id": "system_management", - "permission": [], - "enable": true, - "create_date": 1602662469396 - }, { - "menu_id": "system_app", - "name": "应用管理", - "icon": "admin-icons-manager-app", - "url": "/pages/system/app/list", - "sort": 1035, - "parent_id": "system_management", - "permission": [], - "enable": true, - "create_date": 1602662469399 - }, { - "menu_id": "system_update", - "name": "App升级中心", - "icon": "uni-icons-cloud-upload", - "url": "/uni_modules/uni-upgrade-center/pages/version/list", - "sort": 1036, - "parent_id": "system_management", - "permission": [], - "enable": true, - "create_date": 1656491532434 - }, { - "menu_id": "system_tag", - "name": "标签管理", - "icon": "admin-icons-manager-tag", - "url": "/pages/system/tag/list", - "sort": 1037, - "parent_id": "system_management", - "permission": [], - "enable": true, - "create_date": 1602662479389 - }, { - "permission": [], - "enable": true, - "menu_id": "safety_statistics", - "name": "安全审计", - "icon": "admin-icons-safety", - "url": "", - "sort": 3100, - "parent_id": "", - "create_date": 1638356430871 - }, { - "permission": [], - "enable": true, - "menu_id": "safety_statistics_user_log", - "name": "用户日志", - "icon": "", - "url": "/pages/system/safety/list", - "sort": 3101, - "parent_id": "safety_statistics", - "create_date": 1638356430871 - }, { - "permission": [], - "enable": true, - "menu_id": "uni-stat", - "name": "uni 统计", - "icon": "admin-icons-tongji", - "url": "", - "sort": 2100, - "parent_id": "", - "create_date": 1638356430871 - }, { - "parent_id": "uni-stat", - "permission": [], - "enable": true, - "menu_id": "uni-stat-device", - "name": "设备统计", - "icon": "admin-icons-shebeitongji", - "url": "", - "sort": 2120, - "create_date": 1638356902516 - }, { - "parent_id": "uni-stat-device", - "permission": [], - "enable": true, - "menu_id": "uni-stat-device-overview", - "name": "概况", - "icon": "", - "url": "/pages/uni-stat/device/overview/overview", - "sort": 2121, - "create_date": 1638356902516 - }, { - "parent_id": "uni-stat-device", - "permission": [], - "enable": true, - "menu_id": "uni-stat-device-activity", - "name": "活跃度", - "icon": "", - "url": "/pages/uni-stat/device/activity/activity", - "sort": 2122, - "create_date": 1638356902516 - }, { - "parent_id": "uni-stat-device", - "permission": [], - "enable": true, - "menu_id": "uni-stat-device-trend", - "name": "趋势分析", - "icon": "", - "url": "/pages/uni-stat/device/trend/trend", - "sort": 2123, - "create_date": 1638356902516 - }, { - "parent_id": "uni-stat-device", - "permission": [], - "enable": true, - "menu_id": "uni-stat-device-retention", - "name": "留存", - "icon": "", - "url": "/pages/uni-stat/device/retention/retention", - "sort": 2124, - "create_date": 1638356902516 - }, { - "parent_id": "uni-stat-device", - "permission": [], - "enable": true, - "menu_id": "uni-stat-device-comparison", - "name": "平台对比", - "icon": "", - "url": "/pages/uni-stat/device/comparison/comparison", - "sort": 2125, - "create_date": 1638356902516 - }, { - "parent_id": "uni-stat-device", - "permission": [], - "enable": true, - "menu_id": "uni-stat-device-stickiness", - "name": "粘性", - "icon": "", - "url": "/pages/uni-stat/device/stickiness/stickiness", - "sort": 2126, - "create_date": 1638356902516 - }, { - "parent_id": "uni-stat", - "permission": [], - "enable": true, - "menu_id": "uni-stat-user", - "name": "注册用户统计", - "icon": "admin-icons-yonghutongji", - "url": "", - "sort": 2122, - "create_date": 1638356902516 - }, { - "parent_id": "uni-stat-user", - "permission": [], - "enable": true, - "menu_id": "uni-stat-user-overview", - "name": "概况", - "icon": "", - "url": "/pages/uni-stat/user/overview/overview", - "sort": 2121, - "create_date": 1638356902516 - }, { - "parent_id": "uni-stat-user", - "permission": [], - "enable": true, - "menu_id": "uni-stat-user-activity", - "name": "活跃度", - "icon": "", - "url": "/pages/uni-stat/user/activity/activity", - "sort": 2122, - "create_date": 1638356902516 - }, { - "parent_id": "uni-stat-user", - "permission": [], - "enable": true, - "icon": "", - "menu_id": "uni-stat-user-trend", - "name": "趋势分析", - "url": "/pages/uni-stat/user/trend/trend", - "sort": 2123, - "create_date": 1638356902516 - }, { - "parent_id": "uni-stat-user", - "permission": [], - "enable": true, - "menu_id": "uni-stat-user-retention", - "name": "留存", - "icon": "", - "url": "/pages/uni-stat/user/retention/retention", - "sort": 2124, - "create_date": 1638356902516 - }, { - "parent_id": "uni-stat-user", - "permission": [], - "enable": true, - "menu_id": "uni-stat-user-comparison", - "name": "平台对比", - "icon": "", - "url": "/pages/uni-stat/user/comparison/comparison", - "sort": 2125, - "create_date": 1638356902516 - }, { - "parent_id": "uni-stat-user", - "permission": [], - "enable": true, - "menu_id": "uni-stat-user-stickiness", - "name": "粘性", - "icon": "", - "url": "/pages/uni-stat/user/stickiness/stickiness", - "sort": 2126, - "create_date": 1638356902516 - }, { - "parent_id": "uni-stat", - "permission": [], - "enable": true, - "menu_id": "uni-stat-page-analysis", - "name": "页面统计", - "icon": "admin-icons-page-ent", - "url": "", - "sort": 2123, - "create_date": 1638356902516 - }, { - "parent_id": "uni-stat-page-analysis", - "permission": [], - "enable": true, - "menu_id": "uni-stat-page-res", - "name": "受访页", - "icon": "", - "url": "/pages/uni-stat/page-res/page-res", - "sort": 2131, - "create_date": 1638356902516 - }, { - "parent_id": "uni-stat-page-analysis", - "permission": [], - "enable": true, - "menu_id": "uni-stat-page-ent", - "name": "入口页", - "icon": "", - "url": "/pages/uni-stat/page-ent/page-ent", - "sort": 2132, - "create_date": 1638356902516 - },{ - "parent_id": "uni-stat", - "permission": [], - "enable": true, - "menu_id": "uni-stat-page-content-analysis", - "name": "内容统计", - "icon": "admin-icons-doc", - "url": "", - "sort": 2140, - "create_date": 1638356902516 - }, { - "parent_id": "uni-stat-page-content-analysis", - "permission": [], - "enable": true, - "menu_id": "uni-stat-page-content", - "name": "内容统计", - "icon": "", - "url": "/pages/uni-stat/page-content/page-content", - "sort": 2141, - "create_date": 1638356902516 - }, { - "parent_id": "uni-stat-page-content-analysis", - "permission": [], - "enable": true, - "menu_id": "uni-stat-page-rule", - "name": "页面规则", - "icon": "", - "url": "/pages/uni-stat/page-rule/page-rule", - "sort": 2142, - "create_date": 1638356902516 - },{ - "parent_id": "uni-stat", - "permission": [], - "enable": true, - "menu_id": "uni-stat-senceChannel", - "name": "渠道/场景值分析", - "icon": "admin-icons-qudaofenxi", - "url": "", - "sort": 2150, - "create_date": 1638356902516 - }, { - "parent_id": "uni-stat-senceChannel", - "permission": [], - "enable": true, - "menu_id": "uni-stat-senceChannel-scene", - "name": "场景值(小程序)", - "icon": "", - "url": "/pages/uni-stat/scene/scene", - "sort": 2151, - "create_date": 1638356902516 - }, { - "parent_id": "uni-stat-senceChannel", - "permission": [], - "enable": true, - "menu_id": "uni-stat-senceChannel-channel", - "name": "渠道(app)", - "icon": "", - "url": "/pages/uni-stat/channel/channel", - "sort": 2152, - "create_date": 1638356902516 - }, { - "parent_id": "uni-stat", - "permission": [], - "enable": true, - "menu_id": "uni-stat-event-event", - "name": "自定义事件", - "icon": "admin-icons-shijianfenxi", - "url": "/pages/uni-stat/event/event", - "sort": 2160, - "create_date": 1638356902516 - }, { - "parent_id": "uni-stat", - "permission": [], - "enable": true, - "menu_id": "uni-stat-error", - "name": "错误统计", - "icon": "admin-icons-cuowutongji", - "url": "", - "sort": 2170, - "create_date": 1638356902516 - }, { - "parent_id": "uni-stat-error", - "permission": [], - "enable": true, - "menu_id": "uni-stat-error-js", - "name": "代码错误", - "icon": "", - "url": "/pages/uni-stat/error/js/js", - "sort": 2171, - "create_date": 1638356902516 - }, { - "parent_id": "uni-stat-error", - "permission": [], - "enable": true, - "menu_id": "uni-stat-error-app", - "name": "app崩溃", - "icon": "", - "url": "/pages/uni-stat/error/app/app", - "sort": 2172, - "create_date": 1638356902516 - }, - { - "menu_id": "uni-stat-pay", - "name": "支付统计", - "icon": "uni-icons-circle", - "url": "", - "sort": 2122, - "parent_id": "uni-stat", - "permission": [], - "enable": true, - "create_date": 1667386977981 - }, { - "menu_id": "uni-stat-pay-overview", - "name": "概况", - "icon": "", - "url": "/pages/uni-stat/pay-order/overview/overview", - "sort": 21221, - "parent_id": "uni-stat-pay", - "permission": [], - "enable": true, - "create_date": 1667387038602 - }, - { - "menu_id": "uni-stat-pay-funnel", - "name": "转换漏斗分析", - "icon": "", - "url": "/pages/uni-stat/pay-order/funnel/funnel", - "sort": 21222, - "parent_id": "uni-stat-pay", - "permission": [], - "enable": true, - "create_date": 1668430092890 - }, - { - "menu_id": "uni-stat-pay-ranking", - "name": "价值用户排行", - "icon": "", - "url": "/pages/uni-stat/pay-order/ranking/ranking", - "sort": 21223, - "parent_id": "uni-stat-pay", - "permission": [], - "enable": true, - "create_date": 1668430128302 - }, - { - "menu_id": "uni-stat-pay-order-list", - "name": "订单明细", - "icon": "", - "url": "/pages/uni-stat/pay-order/list/list", - "sort": 21224, - "parent_id": "uni-stat-pay", - "permission": [], - "enable": true, - "create_date": 1667387078947 - } -] diff --git a/sport-erp-admin/pages/system/permission/add.vue b/sport-erp-admin/pages/system/permission/add.vue deleted file mode 100644 index 047cf89..0000000 --- a/sport-erp-admin/pages/system/permission/add.vue +++ /dev/null @@ -1,98 +0,0 @@ - - - - - \ No newline at end of file diff --git a/sport-erp-admin/pages/system/permission/list.vue b/sport-erp-admin/pages/system/permission/list.vue deleted file mode 100644 index bd31925..0000000 --- a/sport-erp-admin/pages/system/permission/list.vue +++ /dev/null @@ -1,234 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/system/role/add.vue b/sport-erp-admin/pages/system/role/add.vue deleted file mode 100644 index 110a9a6..0000000 --- a/sport-erp-admin/pages/system/role/add.vue +++ /dev/null @@ -1,102 +0,0 @@ - - - - diff --git a/sport-erp-admin/pages/system/role/edit.vue b/sport-erp-admin/pages/system/role/edit.vue deleted file mode 100644 index 2bff056..0000000 --- a/sport-erp-admin/pages/system/role/edit.vue +++ /dev/null @@ -1,132 +0,0 @@ - - - - diff --git a/sport-erp-admin/pages/system/role/list.vue b/sport-erp-admin/pages/system/role/list.vue deleted file mode 100644 index c564f39..0000000 --- a/sport-erp-admin/pages/system/role/list.vue +++ /dev/null @@ -1,237 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/system/safety/list.vue b/sport-erp-admin/pages/system/safety/list.vue deleted file mode 100644 index ea48c97..0000000 --- a/sport-erp-admin/pages/system/safety/list.vue +++ /dev/null @@ -1,130 +0,0 @@ - - - - diff --git a/sport-erp-admin/pages/system/tag/add.vue b/sport-erp-admin/pages/system/tag/add.vue deleted file mode 100644 index 0d34519..0000000 --- a/sport-erp-admin/pages/system/tag/add.vue +++ /dev/null @@ -1,100 +0,0 @@ - - - - diff --git a/sport-erp-admin/pages/system/tag/edit.vue b/sport-erp-admin/pages/system/tag/edit.vue deleted file mode 100644 index 20bfd72..0000000 --- a/sport-erp-admin/pages/system/tag/edit.vue +++ /dev/null @@ -1,129 +0,0 @@ - - - - diff --git a/sport-erp-admin/pages/system/tag/list.vue b/sport-erp-admin/pages/system/tag/list.vue deleted file mode 100644 index 9301c0c..0000000 --- a/sport-erp-admin/pages/system/tag/list.vue +++ /dev/null @@ -1,241 +0,0 @@ - - - diff --git a/sport-erp-admin/pages/system/user/add.vue b/sport-erp-admin/pages/system/user/add.vue deleted file mode 100644 index 28b2140..0000000 --- a/sport-erp-admin/pages/system/user/add.vue +++ /dev/null @@ -1,193 +0,0 @@ - - - - diff --git a/sport-erp-admin/pages/system/user/edit.vue b/sport-erp-admin/pages/system/user/edit.vue deleted file mode 100644 index d6d0c5b..0000000 --- a/sport-erp-admin/pages/system/user/edit.vue +++ /dev/null @@ -1,342 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/system/user/list.vue b/sport-erp-admin/pages/system/user/list.vue deleted file mode 100644 index 866a5b5..0000000 --- a/sport-erp-admin/pages/system/user/list.vue +++ /dev/null @@ -1,462 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/uni-stat/channel/channel.vue b/sport-erp-admin/pages/uni-stat/channel/channel.vue deleted file mode 100644 index 714c870..0000000 --- a/sport-erp-admin/pages/uni-stat/channel/channel.vue +++ /dev/null @@ -1,478 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/uni-stat/channel/fieldsMap.js b/sport-erp-admin/pages/uni-stat/channel/fieldsMap.js deleted file mode 100644 index 148111a..0000000 --- a/sport-erp-admin/pages/uni-stat/channel/fieldsMap.js +++ /dev/null @@ -1,76 +0,0 @@ -/** - * 页面上的数据都来自数据库,且多处 ui 消费,页面直接使用字段会造成耦合和无谓的重复,固在此抽出来统一配置和处理(计算、格式化等) - * title 显示所使用名称 - * field 字段名 - * computed 计算表达式配置(需要 mapfield 函数支持) - * tooltip 对字段解释的提示文字 - * formatter 数字格式化的配置,省缺为 ',' - * '' 空字符串 则表示不格式化 - * ',' 数字格式,例:1000 格式为 1,000 - * '%' 百分比格式 例:0.1 格式为 10% - * ':' 时分秒格式 例:90 格式为 00:01:30 - * '-' 日期格式 例:1655196831390(值需为时间戳) 格式为 2022-06-14 - * fix 数字保留几位小数,>1 默认不保留小数,<1 默认保留两位小数 - * value 默认值 (仅用于 uni-stat-panel 组件) todo: 可移除 - * contrast 对比值 (仅用于 uni-stat-panel 组件) todo: 可移除 - */ - -export default [{ - title: '渠道值', - field: 'channel_code', - tooltip: '', - formatter: '', -}, { - title: '渠道名称', - field: 'channel_name', - tooltip: '', - formatter: '', -}, { - title: '新增设备', - field: 'new_device_count', - tooltip: '首次访问应用的设备数(以设备为判断标准,去重)', - value: 0 -}, { - title: '活跃设备', - field: 'active_device_count', - tooltip: '访问过应用内任意页面的总设备数(去重)', - value: 0 -}, { - title: '访问次数', - field: 'page_visit_count', - tooltip: '访问过应用内任意页面总次数,多个页面之间跳转、同一页面的重复访问计为多次访问', - value: 0 -}, { - title: '启动次数', - field: 'app_launch_count', - tooltip: '设备从打开应用到主动关闭应用或超时退出计为一次启动', - value: 0 -}, { - title: '次均停留时长', - field: 'avg_device_session_time', - computed: 'duration/app_launch_count', - formatter: ':', - tooltip: '平均每次打开应用停留在应用内的总时长,即应用停留总时长/启动次数', - value: 0 -}, { - title: '设备平均停留时长 ', - field: 'avg_device_time', - computed: 'duration/active_device_count', - formatter: ':', - tooltip: '平均每个设备停留在应用内的总时长,即应用停留总时长/活跃设备', - value: 0 -}, { - title: '跳出率', - field: 'bounceRate', - computed: 'bounce_times/app_launch_count', - formatter: '%', - tooltip: '只浏览一个页面便离开应用的次数占总启动次数的百分比', - value: 0, - contrast: 0, - fix: 2 -}, { - title: '总设备数', - field: 'total_devices', - tooltip: '从添加统计到当前选择时间的总设备数(去重)', - value: 0, -}] diff --git a/sport-erp-admin/pages/uni-stat/device/activity/activity.vue b/sport-erp-admin/pages/uni-stat/device/activity/activity.vue deleted file mode 100644 index dfc3777..0000000 --- a/sport-erp-admin/pages/uni-stat/device/activity/activity.vue +++ /dev/null @@ -1,442 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/uni-stat/device/activity/fieldsMap.js b/sport-erp-admin/pages/uni-stat/device/activity/fieldsMap.js deleted file mode 100644 index 98b0c57..0000000 --- a/sport-erp-admin/pages/uni-stat/device/activity/fieldsMap.js +++ /dev/null @@ -1,48 +0,0 @@ -/** - * 页面上的数据都来自数据库,且多处 ui 消费,页面直接使用字段会造成耦合和无谓的重复,固在此抽出来统一配置和处理(计算、格式化等) - * title 显示所使用名称 - * field 字段名 - * computed 计算表达式配置(需要 mapfield 函数支持) - * tooltip 对字段解释的提示文字 - * formatter 数字格式化的配置,省缺为 ',' - * '' 空字符串 则表示不格式化 - * ',' 数字格式,例:1000 格式为 1,000 - * '%' 百分比格式 例:0.1 格式为 10% - * ':' 时分秒格式 例:90 格式为 00:01:30 - * '-' 日期格式 例:1655196831390(值需为时间戳) 格式为 2022-06-14 - * fix 数字保留几位小数,>1 默认不保留小数,<1 默认保留两位小数 - * value 默认值 (仅用于 uni-stat-panel 组件) todo: 可移除 - * contrast 对比值 (仅用于 uni-stat-panel 组件) todo: 可移除 - */ - - -export default [{ - title: '日期', - field: 'start_time', - tooltip: '', - formatter: '-', -}, { - title: '日活', - field: 'active_device_count', - tooltip: '选中日期当天的访问用户数', -}, { - title: '周活', - field: 'week_active_device_count', - tooltip: '选中日期所在自然周(包括选中日期在内)的访问用户数', -}, { - title: '日活/周活', - field: 'active_device_count/week_active_device_count', - computed: 'active_device_count/week_active_device_count', - tooltip: '选中日期的访问用户数占周访问用户数的百分比', - formatter: '%', -}, { - title: '月活', - field: 'month_active_device_count', - tooltip: '选中日期所在自然月(包括选中日期在内)的访问用户数', -}, { - title: '日活/月活', - field: 'active_device_count/month_active_device_count', - computed: 'active_device_count/month_active_device_count', - tooltip: '选中日期的访问用户数占月访问用户数的百分比', - formatter: '%', -}] diff --git a/sport-erp-admin/pages/uni-stat/device/comparison/comparison.vue b/sport-erp-admin/pages/uni-stat/device/comparison/comparison.vue deleted file mode 100644 index 23f58e4..0000000 --- a/sport-erp-admin/pages/uni-stat/device/comparison/comparison.vue +++ /dev/null @@ -1,271 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/uni-stat/device/overview/fieldsMap.js b/sport-erp-admin/pages/uni-stat/device/overview/fieldsMap.js deleted file mode 100644 index 01e13f6..0000000 --- a/sport-erp-admin/pages/uni-stat/device/overview/fieldsMap.js +++ /dev/null @@ -1,124 +0,0 @@ -/** - * 页面上的数据都来自数据库,且多处 ui 消费,页面直接使用字段会造成耦合和冗余,固在此抽出来统一配置(clientdb 查询方法、概念文字提示等)和处理(对值再计算、格式化等) - * title 显示所使用名称 - * field 数据库字段名 - * computed 计算表达式配置,只支持除法计算(需要 mapfield 函数支持,也可自行扩展) - * tooltip 对字段解释的提示文字 - * formatter 数字格式化的配置,省缺为 ',' - * '' 空字符串 则表示不格式化 - * ',' 数字格式,例:1000 格式为 1,000 - * '%' 百分比格式 例:0.1 格式为 10% - * ':' 时分秒格式 例:90 格式为 00:01:30 - * '-' 日期格式 例:1655196831390(值需为时间戳) 格式为 2022-06-14 - * stat 对字段做 groupField 时需使用的数据库计算方法,省缺为 'sum' - * 'sum' 表示对字段做求和运算 - * 'avg' 表示对字段做平均运算 - * fix 数字保留几位小数,>1 默认不保留小数,<1 默认保留两位小数 - * value 默认值 (仅用于 uni-stat-panel 组件) todo: 可移除 - * contrast 对比值 (仅用于 uni-stat-panel 组件) todo: 可移除 - */ - -const fieldsMap = [{ - value: '今天', - contrast: '昨天' -}, { - title: '新增设备', - field: 'new_device_count', - tooltip: '首次访问应用的设备数(以设备为判断标准,去重)', - value: 0, - contrast: 0 -}, { - title: '活跃设备', - field: 'active_device_count', - tooltip: '访问过应用内任意页面的总设备数,今日数据为每小时活跃设备累加(未虑重),昨日数据为全天活跃设备虑重后结果', - value: 0, - contrast: 0 -}, { - title: '访问次数', - field: 'page_visit_count', - tooltip: '访问过应用内任意页面总次数,多个页面之间跳转、同一页面的重复访问计为多次访问', - value: 0, - contrast: 0 -}, { - title: '启动次数', - field: 'app_launch_count', - tooltip: '设备从打开应用到主动关闭应用或超时退出计为一次启动', - value: 0, - contrast: 0 -}, { - title: '次均停留时长', - field: 'avg_device_session_time', - computed: 'duration/app_launch_count', - formatter: ':', - tooltip: '平均每次打开应用停留在应用内的总时长,即应用停留总时长/启动次数', - value: 0, - contrast: 0, - //stat: 'avg' -}, { - title: '设备平均停留时长 ', - field: 'avg_device_time', - computed: 'duration/active_device_count', - formatter: ':', - tooltip: '平均每个设备停留在应用内的总时长,即应用停留总时长/活跃设备', - value: 0, - contrast: 0, - //stat: 'avg' -}, { - title: '跳出率', - field: 'bounceRate', - computed: 'bounce_times/app_launch_count', - formatter: '%', - tooltip: '只浏览一个页面便离开应用的次数占总启动次数的百分比', - value: 0, - contrast: 0, - fix: 2 -}, { - title: '总设备数', - field: 'total_devices', - tooltip: '从添加统计到当前选择时间的总设备数(去重)', - value: 0, - contrast: 0 -}] - -const resFieldsMap = [{ - title: '受访页', - field: 'path', - tooltip: '设备进入应用访问的所有页面,例如设备从页面1进入应用,跳转到页面2,1,2均为受访页', - formatter: '' -}, { - title: '访问次数', - field: 'visit_times', - tooltip: '访问该页面的总次数', - value: 0 - -}, { - title: '占比', - field: 'rate', - computed: 'visit_times/total_app_access', - tooltip: '页面的访问次数占所有页面访问次数的比例', - formatter: '%', -}] - -const entFieldsMap = [{ - title: '入口页', - field: 'path', - tooltip: '设备进入应用访问的第一个页面,例如设备从页面1进入应用,跳转到页面2,1为入口页,而2不是', - formatter: '' -}, { - title: '入口页次数', - field: 'entry_count', - tooltip: '访问该入口页的总次数', - value: 0 -}, { - title: '占比', - field: 'rate', - computed: 'entry_count/total_app_access', - tooltip: '页面的入口页次数占所有页面访问次数的比例', - formatter: '%' -}] - -export { - fieldsMap, - resFieldsMap, - entFieldsMap -} diff --git a/sport-erp-admin/pages/uni-stat/device/overview/overview.vue b/sport-erp-admin/pages/uni-stat/device/overview/overview.vue deleted file mode 100644 index 7881d39..0000000 --- a/sport-erp-admin/pages/uni-stat/device/overview/overview.vue +++ /dev/null @@ -1,566 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/uni-stat/device/retention/fieldsMap.js b/sport-erp-admin/pages/uni-stat/device/retention/fieldsMap.js deleted file mode 100644 index e0a7d39..0000000 --- a/sport-erp-admin/pages/uni-stat/device/retention/fieldsMap.js +++ /dev/null @@ -1,57 +0,0 @@ -/** - * 页面上的数据都来自数据库,且多处 ui 消费,页面直接使用字段会造成耦合和冗余,固在此抽出来统一配置(clientdb 查询方法、概念文字提示等)和处理(对值再计算、格式化等) - * title 显示所使用名称 - * field 数据库字段名 - * computed 计算表达式配置,只支持除法计算(需要 mapfield 函数支持,也可自行扩展) - * tooltip 对字段解释的提示文字 - * formatter 数字格式化的配置,省缺为 ',' - * '' 空字符串 则表示不格式化 - * ',' 数字格式,例:1000 格式为 1,000 - * '%' 百分比格式 例:0.1 格式为 10% - * ':' 时分秒格式 例:90 格式为 00:01:30 - * '-' 日期格式 例:1655196831390(值需为时间戳) 格式为 2022-06-14 - * stat 对字段做 groupField 时需使用的数据库计算方法,省缺为 'sum' - * 'sum' 表示对字段做求和运算 - * 'avg' 表示对字段做平均运算 - * '-1' 表示不对字段做运算 - * fix 数字保留几位小数,>1 默认不保留小数,<1 默认保留两位小数 - * value 默认值 (仅用于 uni-stat-panel 组件) todo: 可移除 - * contrast 对比值 (仅用于 uni-stat-panel 组件) todo: 可移除 - */ - -function fieldsFactory(maps = [{ - title: '新增设备', - field: 'new_device_count', - stat: 0 -}]) { - let fieldsMap = [{ - title: '日期', - field: 'start_time', - tooltip: '', - formatter: '-', - stat: -1 - }] - - if (maps) { - fieldsMap.push(...maps) - } - - const values = [1, 2, 3, 4, 5, 6, 7, 14, 30] - const fields = values.map(val => { - return { - title: `${val}天后`, - field: `d_${val}`, - computed: `d_${val}/${maps[0].field}`, - formatter: '%', - tooltip: '' - } - }) - - fieldsMap = fieldsMap.concat(fields) - - return fieldsMap - - -} - -export default fieldsFactory diff --git a/sport-erp-admin/pages/uni-stat/device/retention/retention.vue b/sport-erp-admin/pages/uni-stat/device/retention/retention.vue deleted file mode 100644 index b172c4f..0000000 --- a/sport-erp-admin/pages/uni-stat/device/retention/retention.vue +++ /dev/null @@ -1,441 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/uni-stat/device/stickiness/fieldsMap.js b/sport-erp-admin/pages/uni-stat/device/stickiness/fieldsMap.js deleted file mode 100644 index 29c7deb..0000000 --- a/sport-erp-admin/pages/uni-stat/device/stickiness/fieldsMap.js +++ /dev/null @@ -1,48 +0,0 @@ -/** - * 页面上的数据都来自数据库,且多处 ui 消费,页面直接使用字段会造成耦合和冗余,固在此抽出来统一配置(clientdb 查询方法、概念文字提示等)和处理(对值再计算、格式化等) - * title 显示所使用名称 - * field 数据库字段名 - * computed 计算表达式配置,只支持除法计算(需要 mapfield 函数支持,也可自行扩展) - * tooltip 对字段解释的提示文字 - * formatter 数字格式化的配置,省缺为 ',' - * '' 空字符串 则表示不格式化 - * ',' 数字格式,例:1000 格式为 1,000 - * '%' 百分比格式 例:0.1 格式为 10% - * ':' 时分秒格式 例:90 格式为 00:01:30 - * '-' 日期格式 例:1655196831390(值需为时间戳) 格式为 2022-06-14 - * stat 对字段做 groupField 时需使用的数据库计算方法,省缺为 'sum' - * 'sum' 表示对字段做求和运算 - * 'avg' 表示对字段做平均运算 - * '-1' 表示不对字段做运算 - * fix 数字保留几位小数,>1 默认不保留小数,<1 默认保留两位小数 - * value 默认值 (仅用于 uni-stat-panel 组件) todo: 可移除 - * contrast 对比值 (仅用于 uni-stat-panel 组件) todo: 可移除 - */ - -export default [{ - title: '名称', - field: 'name', - tooltip: '', - formatter: '', -}, { - title: '访问人数', - field: 'visit_devices', - tooltip: '访问人数(活跃用户数):访问过应用内任意页面的总用户数(去重)', - value: 0 -}, { - title: '访问人数占比', - field: 'visit_devices/total_visit_devices', - computed: 'visit_devices/total_visit_devices', - formatter: '%', -}, { - title: '访问次数', - field: 'visit_times', - tooltip: '访问过应用内任意页面总次数,多个页面之间跳转、同一页面的重复访问计为多次访问', - value: 0 -}, { - title: '访问次数占比', - field: 'visit_times/total_visit_times', - computed: 'visit_times/total_visit_times', - formatter: '%', - tooltip: '', -}] diff --git a/sport-erp-admin/pages/uni-stat/device/stickiness/stickiness.vue b/sport-erp-admin/pages/uni-stat/device/stickiness/stickiness.vue deleted file mode 100644 index e0a3e09..0000000 --- a/sport-erp-admin/pages/uni-stat/device/stickiness/stickiness.vue +++ /dev/null @@ -1,422 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/uni-stat/device/trend/fieldsMap.js b/sport-erp-admin/pages/uni-stat/device/trend/fieldsMap.js deleted file mode 100644 index 6c5ce47..0000000 --- a/sport-erp-admin/pages/uni-stat/device/trend/fieldsMap.js +++ /dev/null @@ -1,81 +0,0 @@ -/** - * 页面上的数据都来自数据库,且多处 ui 消费,页面直接使用字段会造成耦合和冗余,固在此抽出来统一配置(clientdb 查询方法、概念文字提示等)和处理(对值再计算、格式化等) - * title 显示所使用名称 - * field 数据库字段名 - * computed 计算表达式配置,只支持除法计算(需要 mapfield 函数支持,也可自行扩展) - * tooltip 对字段解释的提示文字 - * formatter 数字格式化的配置,省缺为 ',' - * '' 空字符串 则表示不格式化 - * ',' 数字格式,例:1000 格式为 1,000 - * '%' 百分比格式 例:0.1 格式为 10% - * ':' 时分秒格式 例:90 格式为 00:01:30 - * '-' 日期格式 例:1655196831390(值需为时间戳) 格式为 2022-06-14 - * stat 对字段做 groupField 时需使用的数据库计算方法,省缺为 'sum' - * 'sum' 表示对字段做求和运算 - * 'avg' 表示对字段做平均运算 - * '-1' 表示不对字段做运算 - * fix 数字保留几位小数,>1 默认不保留小数,<=1 默认保留两位小数 - * value 默认值 (仅用于 uni-stat-panel 组件) todo: 可移除 - * contrast 对比值 (仅用于 uni-stat-panel 组件) todo: 可移除 - */ - -export default [{ - title: '日期', - field: 'start_time', - tooltip: '', - formatter: '', - stat: -1 -}, { - title: '新增设备', - field: 'new_device_count', - tooltip: '首次访问应用的设备数(以设备为判断标准,去重)', - value: 0 -}, { - title: '活跃设备', - field: 'active_device_count', - tooltip: '访问过应用内任意页面的总设备数(去重)', - value: 0 -}, { - title: '访问次数', - field: 'page_visit_count', - tooltip: '访问过应用内任意页面总次数,多个页面之间跳转、同一页面的重复访问计为多次访问', - value: 0 -}, { - title: '启动次数', - field: 'app_launch_count', - tooltip: '设备从打开应用到主动关闭应用或超时退出计为一次启动', - value: 0 -}, { - title: '次均停留时长', - field: 'avg_device_session_time', - computed: 'duration/app_launch_count', - formatter: ':', - tooltip: '平均每次打开应用停留在应用内的总时长,即应用停留总时长/启动次数', - value: 0, - //stat: 'avg' -}, { - title: '设备平均停留时长 ', - field: 'avg_device_time', - computed: 'duration/active_device_count', - formatter: ':', - tooltip: '平均每个设备停留在应用内的总时长,即应用停留总时长/活跃设备', - value: 0, - //stat: 'avg' -}, { - title: '跳出率', - field: 'bounceRate', - computed: 'bounce_times/app_launch_count', - formatter: '%', - tooltip: '只浏览一个页面便离开应用的次数占总启动次数的百分比', - value: 0, - contrast: 0, - fix: 2 -}, { - field: 'bounce_times', - disable: true -}, { - title: '总设备数', - field: 'total_devices', - tooltip: '从添加统计到当前选择时间的总设备数(去重)', - value: 0, -}] diff --git a/sport-erp-admin/pages/uni-stat/device/trend/trend.vue b/sport-erp-admin/pages/uni-stat/device/trend/trend.vue deleted file mode 100644 index b230ab0..0000000 --- a/sport-erp-admin/pages/uni-stat/device/trend/trend.vue +++ /dev/null @@ -1,456 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/uni-stat/error/app/app.vue b/sport-erp-admin/pages/uni-stat/error/app/app.vue deleted file mode 100644 index f1b8e7a..0000000 --- a/sport-erp-admin/pages/uni-stat/error/app/app.vue +++ /dev/null @@ -1,573 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/uni-stat/error/app/fieldsMap.js b/sport-erp-admin/pages/uni-stat/error/app/fieldsMap.js deleted file mode 100644 index 4169364..0000000 --- a/sport-erp-admin/pages/uni-stat/error/app/fieldsMap.js +++ /dev/null @@ -1,210 +0,0 @@ -/** - * 页面上的数据都来自数据库,且多处 ui 消费,页面直接使用字段会造成耦合和冗余,固在此抽出来统一配置(clientdb 查询方法、概念文字提示等)和处理(对值再计算、格式化等) - * title 显示所使用名称 - * field 数据库字段名 - * computed 计算表达式配置,只支持除法计算(需要 mapfield 函数支持,也可自行扩展) - * tooltip 对字段解释的提示文字 - * formatter 数字格式化的配置,省缺为 ',' - * '' 空字符串 则表示不格式化 - * ',' 数字格式,例:1000 格式为 1,000 - * '%' 百分比格式 例:0.1 格式为 10% - * ':' 时分秒格式 例:90 格式为 00:01:30 - * '-' 日期格式 例:1655196831390(值需为时间戳) 格式为 2022-06-14 - * stat 对字段做 groupField 时需使用的数据库计算方法,省缺为 'sum' - * 'sum' 表示对字段做求和运算 - * 'avg' 表示对字段做平均运算 - * '-1' 表示不对字段做运算 - * fix 数字保留几位小数,>1 默认不保留小数,<1 默认保留两位小数 - * filter 对字段过滤的类型 (暂未应用) - * value 默认值 (仅用于 uni-stat-panel 组件) todo: 可移除 - * contrast 对比值 (仅用于 uni-stat-panel 组件) todo: 可移除 - */ - -const fieldsMap = [{ - title: '报错时间', - field: 'create_time', - tooltip: '', - formatter: '', - filter: "timestamp" -}, { - title: '错误信息', - field: 'error_msg', - formatter: '', - filter: "search" -}, { - title: '原生应用包名', - field: 'package_name', - formatter: '', - filter: "search" -}, { - title: '用户端上报的应用版本号', - field: 'version', - formatter: '', - tooltip: 'manifest.json中的versionName的值', - filter: "search" -}, { - title: '平台', - field: 'platform', - formatter: '', - tooltip: '用户端上报的平台code', - filter: "search" -}, { - title: '渠道', - field: 'channel', - formatter: '', - tooltip: '用户端上报的渠道code场景值', - filter: "search" -}, { - title: '基础库版本号', - field: 'sdk_version', - formatter: '', - tooltip: '', - filter: "search" -}, { - title: '设备标识', - field: 'device_id', - formatter: '', - tooltip: '客户端携带的设备标识', - filter: "search" -}, { - title: '设备网络型号', - field: 'device_net', - formatter: '', - tooltip: '设备网络型号wifi\/3G\/4G\/', - filter: "search" -}, { - title: '系统版本', - field: 'device_os', - formatter: '', - tooltip: 'iOS平台为系统版本号,如15.1;Android平台为API等级,如30', - filter: "search" -}, { - title: '系统版本名称', - field: 'device_os_version', - formatter: '', - tooltip: 'iOS平台与os字段一致;Android平台为版本名称,如5.1.1', - filter: "search" -}, { - title: '设备供应商', - field: 'device_vendor', - formatter: '', - tooltip: '', - filter: "search" -}, { - title: '设备型号', - field: 'device_model', - formatter: '', - tooltip: '', - filter: "search" -}, { - title: '是否root', - field: 'device_is_root', - formatter: '', - tooltip: '1表示root;0表示未root', - filter: "range" -}, { - title: '系统名称', - field: 'device_os_name', - formatter: '', - tooltip: '用于区别Android和鸿蒙,仅Android支持', - filter: "search" -}, { - title: '设备电池电量', - field: 'device_batt_level', - formatter: '', - tooltip: '取值范围0-100,仅Android支持', - filter: "range" -}, { - title: '电池温度', - field: 'device_batt_temp', - formatter: '', - tooltip: '仅Android支持', - filter: "search" -}, { - title: '系统已使用内存', - field: 'device_memory_use_size', - formatter: '', - tooltip: '单位为Byte,仅Android支持', - filter: "range" -}, { - title: '系统总内存', - field: 'device_memory_total_size', - formatter: '', - tooltip: '单位为Byte,仅Android支持', - filter: "range" -}, { - title: '系统磁盘已使用大小', - field: 'device_disk_use_size', - formatter: '', - tooltip: '单位为Byte,仅Android支持', - filter: "range" -}, { - title: '系统磁盘总大小', - field: 'device_disk_total_size', - formatter: '', - tooltip: '单位为Byte,仅Android支持', - filter: "range" -}, { - title: '设备支持的CPU架构', - field: 'device_abis', - formatter: '', - tooltip: '多个使用,分割,如arm64-v8a,armeabi-v7a,armeabi,仅Android支持', - filter: "search" -}, { - title: '运行的app个数', - field: 'app_count', - formatter: '', - tooltip: '包括运行的uni小程序数目,独立App时值为1', - filter: "range" -}, { - title: 'APP使用的内存量', - field: 'app_use_memory_size', - formatter: '', - tooltip: '单位为Byte', - filter: "range" -}, { - title: '运行应用的个数', - field: 'app_count', - formatter: '', - filter: "range" -}, { - title: '打开 Webview 的个数', - field: 'app_webview_count', - formatter: '', - filter: "range" -}, { - title: 'APP使用时长', - field: 'app_use_duration', - formatter: '', - tooltip: '单位为s', - filter: "range" -}, { - title: '是否前台运行', - field: 'app_run_fore', - formatter: '', - tooltip: '1表示前台运行,0表示后台运行', - filter: "search" -}, { - title: '原生应用版本名称', - field: 'package_version', - formatter: '', - tooltip: 'Android的apk版本名称;iOS的ipa版本名称', - filter: "search" -}, -// { -// title: 'APP使用的内存量', -// field: 'app_use_memory_size', -// formatter: '', -// tooltip: '单位为Byte', -// filter: "search" -// }, -{ - title: '页面url', - field: 'page_url', - formatter: '', - filter: "search" -}] - -export { - fieldsMap -} diff --git a/sport-erp-admin/pages/uni-stat/error/js/detail.vue b/sport-erp-admin/pages/uni-stat/error/js/detail.vue deleted file mode 100644 index 9ed9e65..0000000 --- a/sport-erp-admin/pages/uni-stat/error/js/detail.vue +++ /dev/null @@ -1,125 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/uni-stat/error/js/fieldsMap.js b/sport-erp-admin/pages/uni-stat/error/js/fieldsMap.js deleted file mode 100644 index c015d5a..0000000 --- a/sport-erp-admin/pages/uni-stat/error/js/fieldsMap.js +++ /dev/null @@ -1,69 +0,0 @@ -/** - * 页面上的数据都来自数据库,且多处 ui 消费,页面直接使用字段会造成耦合和冗余,固在此抽出来统一配置(clientdb 查询方法、概念文字提示等)和处理(对值再计算、格式化等) - * title 显示所使用名称 - * field 数据库字段名 - * computed 计算表达式配置,只支持除法计算(需要 mapfield 函数支持,也可自行扩展) - * tooltip 对字段解释的提示文字 - * formatter 数字格式化的配置,省缺为 ',' - * '' 空字符串 则表示不格式化 - * ',' 数字格式,例:1000 格式为 1,000 - * '%' 百分比格式 例:0.1 格式为 10% - * ':' 时分秒格式 例:90 格式为 00:01:30 - * '-' 日期格式 例:1655196831390(值需为时间戳) 格式为 2022-06-14 - * stat 对字段做 groupField 时需使用的数据库计算方法,省缺为 'sum' - * 'sum' 表示对字段做求和运算 - * 'avg' 表示对字段做平均运算 - * '-1' 表示不对字段做运算 - * fix 数字保留几位小数,>1 默认不保留小数,<1 默认保留两位小数 - * value 默认值 (仅用于 uni-stat-panel 组件) todo: 可移除 - * contrast 对比值 (仅用于 uni-stat-panel 组件) todo: 可移除 - */ - -const fieldsMap = [{ - title: '最近发生时间', - field: 'last_time', - tooltip: '', - formatter: '', -}, { - title: '错误次数', - field: 'count', - tooltip: '相同错误在某时间段内发生的次数', -}, { - title: '错误占比', - computed: 'count/total_count', - field: 'count/total_count', - formatter: '%', - tooltip: '某个错误发生的次数/总错误数', -}, { - title: '平台', - field: 'platform', - formatter: '', -}, { - title: '平台版本号', - field: 'version', - tooltip: '原生平台为客户端 SDK 版本号;小程序平台为微信、支付宝、百度等应用的版本号', - formatter: '', -}, { - title: '错误信息', - field: 'msg', - formatter: '', -}] - -const popupFieldsMap = [{ - title: '创建时间', - field: 'create_time', - formatter: '', -}, { - title: '客户端操作系统', - field: 'os', - formatter: '', -}, { - title: '客户端 user-agent 信息', - field: 'ua', - formatter: '', -}] - -export { - fieldsMap, - popupFieldsMap, -} diff --git a/sport-erp-admin/pages/uni-stat/error/js/js.vue b/sport-erp-admin/pages/uni-stat/error/js/js.vue deleted file mode 100644 index 2dcce82..0000000 --- a/sport-erp-admin/pages/uni-stat/error/js/js.vue +++ /dev/null @@ -1,1018 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/uni-stat/error/js/uploadTask.vue b/sport-erp-admin/pages/uni-stat/error/js/uploadTask.vue deleted file mode 100644 index 46061d0..0000000 --- a/sport-erp-admin/pages/uni-stat/error/js/uploadTask.vue +++ /dev/null @@ -1,62 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/uni-stat/event/event.vue b/sport-erp-admin/pages/uni-stat/event/event.vue deleted file mode 100644 index 8ff7632..0000000 --- a/sport-erp-admin/pages/uni-stat/event/event.vue +++ /dev/null @@ -1,319 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/uni-stat/event/fieldsMap.js b/sport-erp-admin/pages/uni-stat/event/fieldsMap.js deleted file mode 100644 index 2412a60..0000000 --- a/sport-erp-admin/pages/uni-stat/event/fieldsMap.js +++ /dev/null @@ -1,43 +0,0 @@ -/** - * 页面上的数据都来自数据库,且多处 ui 消费,页面直接使用字段会造成耦合和冗余,固在此抽出来统一配置(clientdb 查询方法、概念文字提示等)和处理(对值再计算、格式化等) - * title 显示所使用名称 - * field 数据库字段名 - * computed 计算表达式配置,只支持除法计算(需要 mapfield 函数支持,也可自行扩展) - * tooltip 对字段解释的提示文字 - * formatter 数字格式化的配置,省缺为 ',' - * '' 空字符串 则表示不格式化 - * ',' 数字格式,例:1000 格式为 1,000 - * '%' 百分比格式 例:0.1 格式为 10% - * ':' 时分秒格式 例:90 格式为 00:01:30 - * '-' 日期格式 例:1655196831390(值需为时间戳) 格式为 2022-06-14 - * stat 对字段做 groupField 时需使用的数据库计算方法,省缺为 'sum' - * 'sum' 表示对字段做求和运算 - * 'avg' 表示对字段做平均运算 - * '-1' 表示不对字段做运算 - * fix 数字保留几位小数,>1 默认不保留小数,<1 默认保留两位小数 - * value 默认值 (仅用于 uni-stat-panel 组件) todo: 可移除 - * contrast 对比值 (仅用于 uni-stat-panel 组件) todo: 可移除 - */ - -export default [{ - title: '创建时间', - field: 'create_time', - tooltip: '', - formatter: '' -}, { - title: '事件ID', - field: 'event_key', - stat: -1 -}, { - title: '事件参数', - field: 'param', - tooltip: '', -}, { - title: '平台', - field: 'platform', - tooltip: '', -}, { - title: '设备标识', - field: 'device_id', - tooltip: '' -}] diff --git a/sport-erp-admin/pages/uni-stat/page-content/fieldsMap.js b/sport-erp-admin/pages/uni-stat/page-content/fieldsMap.js deleted file mode 100644 index 96de53a..0000000 --- a/sport-erp-admin/pages/uni-stat/page-content/fieldsMap.js +++ /dev/null @@ -1,61 +0,0 @@ -/** - * 页面上的数据都来自数据库,且多处 ui 消费,页面直接使用字段会造成耦合和冗余,固在此抽出来统一配置(clientdb 查询方法、概念文字提示等)和处理(对值再计算、格式化等) - * title 显示所使用名称 - * field 数据库字段名 - * computed 计算表达式配置,只支持除法计算(需要 mapfield 函数支持,也可自行扩展) - * tooltip 对字段解释的提示文字 - * formatter 数字格式化的配置,省缺为 ',' - * '' 空字符串 则表示不格式化 - * ',' 数字格式,例:1000 格式为 1,000 - * '%' 百分比格式 例:0.1 格式为 10% - * ':' 时分秒格式 例:90 格式为 00:01:30 - * '-' 日期格式 例:1655196831390(值需为时间戳) 格式为 2022-06-14 - * stat 对字段做 groupField 时需使用的数据库计算方法,省缺为 'sum' - * 'sum' 表示对字段做求和运算 - * 'avg' 表示对字段做平均运算 - * '-1' 表示不对字段做运算 - * fix 数字保留几位小数,>1 默认不保留小数,<1 默认保留两位小数 - * value 默认值 (仅用于 uni-stat-panel 组件) todo: 可移除 - * contrast 对比值 (仅用于 uni-stat-panel 组件) todo: 可移除 - */ - -export default [{ - title: '内容统计页面', - field: 'page_link', - stat: -1 -}, { - title: '页面名称', - field: 'page_title', - stat: -1 -}, -{ - title: '访问次数', - field: 'visit_times', - tooltip: '访问过应用内任意页面总次数,多个页面之间跳转、同一页面的重复访问计为多次访问;', - value: 0 -}, { - title: '访问设备数', - field: 'visit_devices', - tooltip: '访问过应用内任意页面总次数,多个页面之间跳转、同一页面的重复访问计为多次访问;', - value: 0 -}, -{ - title: '次均停留时长', - field: 'avg_device_session_time', - computed: 'duration/visit_times', - formatter: ':', - tooltip: '平均每次打开应用停留在应用内的总时长,即应用停留总时长/启动次数', - value: 0 -}, { - title: '设备平均停留时长', - field: 'avg_user_time', - computed: 'duration/visit_devices', - formatter: ':', - tooltip: '平均每个设备停留在应用内的总时长,即应用停留总时长/访问设备数', - value: 0 -}, { - title: '分享次数', - field: 'share_count', - tooltip: '页面被分享成功的次数', - value: 0 -}] diff --git a/sport-erp-admin/pages/uni-stat/page-content/page-content.vue b/sport-erp-admin/pages/uni-stat/page-content/page-content.vue deleted file mode 100644 index 9b2b441..0000000 --- a/sport-erp-admin/pages/uni-stat/page-content/page-content.vue +++ /dev/null @@ -1,392 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/uni-stat/page-ent/fieldsMap.js b/sport-erp-admin/pages/uni-stat/page-ent/fieldsMap.js deleted file mode 100644 index 2f369f2..0000000 --- a/sport-erp-admin/pages/uni-stat/page-ent/fieldsMap.js +++ /dev/null @@ -1,64 +0,0 @@ -/** - * 页面上的数据都来自数据库,且多处 ui 消费,页面直接使用字段会造成耦合和冗余,固在此抽出来统一配置(clientdb 查询方法、概念文字提示等)和处理(对值再计算、格式化等) - * title 显示所使用名称 - * field 数据库字段名 - * computed 计算表达式配置,只支持除法计算(需要 mapfield 函数支持,也可自行扩展) - * tooltip 对字段解释的提示文字 - * formatter 数字格式化的配置,省缺为 ',' - * '' 空字符串 则表示不格式化 - * ',' 数字格式,例:1000 格式为 1,000 - * '%' 百分比格式 例:0.1 格式为 10% - * ':' 时分秒格式 例:90 格式为 00:01:30 - * '-' 日期格式 例:1655196831390(值需为时间戳) 格式为 2022-06-14 - * stat 对字段做 groupField 时需使用的数据库计算方法,省缺为 'sum' - * 'sum' 表示对字段做求和运算 - * 'avg' 表示对字段做平均运算 - * '-1' 表示不对字段做运算 - * fix 数字保留几位小数,>1 默认不保留小数,<1 默认保留两位小数 - * value 默认值 (仅用于 uni-stat-panel 组件) todo: 可移除 - * contrast 对比值 (仅用于 uni-stat-panel 组件) todo: 可移除 - */ - -export default [{ - title: '入口页', - field: 'path', - tooltip: '设备进入应用访问的第一个页面,例如设备从页面1进入应用,跳转到页面2,1为入口页,而2不是', -}, { - title: '页面名称', - field: 'title', -}, { - title: '访问次数', - field: 'visit_times', - tooltip: '访问过应用内任意页面总次数,多个页面之间跳转、同一页面的重复访问计为多次访问', - value: 0 -}, { - title: '入口页次数', - field: 'entry_count', - tooltip: '作为访问会话第一个访问页面(即着陆页)的次数', - value: 0 -}, { - title: '跳出率', - field: 'bounce_rate', - formatter: '%%', - tooltip: '只浏览一个页面便离开应用的次数占总启动次数的百分比', - value: 0, - stat: 'avg' -}, { - title: '访问总时长(秒)', - field: 'duration', - disabled: true, -}, { - title: '次均停留时长', - field: 'avg_device_session_time', - computed: 'duration/visit_times', - formatter: ':', - tooltip: '平均每次打开应用停留在应用内的总时长,即应用停留总时长/启动次数', - value: 0 -}, { - title: '设备平均停留时长 ', - field: 'avg_user_time', - computed: 'duration/visit_devices', - formatter: ':', - tooltip: '平均每个设备停留在应用内的总时长,即应用停留总时长/访问设备数', - value: 0 -}, ] diff --git a/sport-erp-admin/pages/uni-stat/page-ent/page-ent.vue b/sport-erp-admin/pages/uni-stat/page-ent/page-ent.vue deleted file mode 100644 index 5cf5813..0000000 --- a/sport-erp-admin/pages/uni-stat/page-ent/page-ent.vue +++ /dev/null @@ -1,333 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/uni-stat/page-res/fieldsMap.js b/sport-erp-admin/pages/uni-stat/page-res/fieldsMap.js deleted file mode 100644 index afb1e16..0000000 --- a/sport-erp-admin/pages/uni-stat/page-res/fieldsMap.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * 页面上的数据都来自数据库,且多处 ui 消费,页面直接使用字段会造成耦合和冗余,固在此抽出来统一配置(clientdb 查询方法、概念文字提示等)和处理(对值再计算、格式化等) - * title 显示所使用名称 - * field 数据库字段名 - * computed 计算表达式配置,只支持除法计算(需要 mapfield 函数支持,也可自行扩展) - * tooltip 对字段解释的提示文字 - * formatter 数字格式化的配置,省缺为 ',' - * '' 空字符串 则表示不格式化 - * ',' 数字格式,例:1000 格式为 1,000 - * '%' 百分比格式 例:0.1 格式为 10% - * ':' 时分秒格式 例:90 格式为 00:01:30 - * '-' 日期格式 例:1655196831390(值需为时间戳) 格式为 2022-06-14 - * stat 对字段做 groupField 时需使用的数据库计算方法,省缺为 'sum' - * 'sum' 表示对字段做求和运算 - * 'avg' 表示对字段做平均运算 - * '-1' 表示不对字段做运算 - * fix 数字保留几位小数,>1 默认不保留小数,<1 默认保留两位小数 - * value 默认值 (仅用于 uni-stat-panel 组件) todo: 可移除 - * contrast 对比值 (仅用于 uni-stat-panel 组件) todo: 可移除 - */ - -export default [{ - title: '受访页', - field: 'path', - tooltip: '设备进入应用访问的所有页面,例如设备从页面1进入应用,跳转到页面2,1,2均为受访页', - stat: -1 -}, { - title: '页面名称', - field: 'title', - stat: -1 -}, -{ - title: '访问次数', - field: 'visit_times', - tooltip: '访问过应用内任意页面总次数,多个页面之间跳转、同一页面的重复访问计为多次访问;', - value: 0 -}, { - title: '退出页次数', - field: 'exit_times', - tooltip: '作为访问会话最后一个访问页面(即离开页)的次数', - value: 0 -}, { - title: '退出率', - field: 'exitRate', - computed: 'exit_times/visit_times', - formatter: '%', - tooltip: '在此页面,选择离开应用占此页面访问次数的比例', - // value: 0, - stat: -1 -}, { - title: '访问总时长(秒)', - field: 'duration', - disabled: true, -}, { - title: '次均停留时长', - field: 'avg_device_session_time', - computed: 'duration/visit_times', - formatter: ':', - tooltip: '平均每次打开应用停留在应用内的总时长,即应用停留总时长/启动次数', - value: 0 -}, { - title: '设备平均停留时长', - field: 'avg_user_time', - computed: 'duration/visit_devices', - formatter: ':', - tooltip: '平均每个设备停留在应用内的总时长,即应用停留总时长/访问设备数', - value: 0 -}, { - title: '分享次数', - field: 'share_count', - tooltip: '页面被分享成功的次数', - value: 0 -}] diff --git a/sport-erp-admin/pages/uni-stat/page-res/page-res.vue b/sport-erp-admin/pages/uni-stat/page-res/page-res.vue deleted file mode 100644 index 0b25d35..0000000 --- a/sport-erp-admin/pages/uni-stat/page-res/page-res.vue +++ /dev/null @@ -1,381 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/uni-stat/page-rule/page-rule.vue b/sport-erp-admin/pages/uni-stat/page-rule/page-rule.vue deleted file mode 100644 index 17e0dc5..0000000 --- a/sport-erp-admin/pages/uni-stat/page-rule/page-rule.vue +++ /dev/null @@ -1,419 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/uni-stat/pay-order/components/test.vue b/sport-erp-admin/pages/uni-stat/pay-order/components/test.vue deleted file mode 100644 index 0a33844..0000000 --- a/sport-erp-admin/pages/uni-stat/pay-order/components/test.vue +++ /dev/null @@ -1,64 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/uni-stat/pay-order/funnel/components/funnelChart.vue b/sport-erp-admin/pages/uni-stat/pay-order/funnel/components/funnelChart.vue deleted file mode 100644 index d26470c..0000000 --- a/sport-erp-admin/pages/uni-stat/pay-order/funnel/components/funnelChart.vue +++ /dev/null @@ -1,218 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/uni-stat/pay-order/funnel/components/trendChart.vue b/sport-erp-admin/pages/uni-stat/pay-order/funnel/components/trendChart.vue deleted file mode 100644 index f0b5579..0000000 --- a/sport-erp-admin/pages/uni-stat/pay-order/funnel/components/trendChart.vue +++ /dev/null @@ -1,254 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/uni-stat/pay-order/funnel/fieldsMap.js b/sport-erp-admin/pages/uni-stat/pay-order/funnel/fieldsMap.js deleted file mode 100644 index fec7214..0000000 --- a/sport-erp-admin/pages/uni-stat/pay-order/funnel/fieldsMap.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * 页面上的数据都来自数据库,且多处 ui 消费,页面直接使用字段会造成耦合和冗余,固在此抽出来统一配置(clientdb 查询方法、概念文字提示等)和处理(对值再计算、格式化等) - * title 显示所使用名称 - * field 数据库字段名 - * computed 计算表达式配置,只支持除法计算(需要 mapfield 函数支持,也可自行扩展) - * tooltip 对字段解释的提示文字 - * formatter 数字格式化的配置,省缺为 ',' - * '' 空字符串 则表示不格式化 - * ',' 数字格式,例:1000 格式为 1,000 - * '%' 百分比格式 例:0.1 格式为 10% - * ':' 时分秒格式 例:90 格式为 00:01:30 - * '-' 日期格式 例:1655196831390(值需为时间戳) 格式为 2022-06-14 - * stat 对字段做 groupField 时需使用的数据库计算方法,省缺为 'sum' - * 'sum' 表示对字段做求和运算 - * 'avg' 表示对字段做平均运算 - * '-1' 表示不对字段做运算 - * fix 数字保留几位小数,>1 默认不保留小数,<1 默认保留两位小数 - * value 默认值 (仅用于 uni-stat-panel 组件) todo: 可移除 - * contrast 对比值 (仅用于 uni-stat-panel 组件) todo: 可移除 - */ -const fieldsMap = [ - { title: '活跃设备数', field: 'activity_device_count', tooltip: '统计时间内,访问设备数,一台设备多次访问被计为一台(包含未登录的用户)。', formatter: ',', value: 0, contrast: 0, stat: 'sum' }, - { title: '活跃用户数', field: 'activity_user_count', tooltip: '活跃用户数:统计时间内,访问人数,一人多次访问被计为一人(只统计已登录的用户)。', formatter: ',', value: 0, contrast: 0, stat: 'sum' }, - { title: '支付用户数', field: 'pay_user_count', tooltip: '统计时间内,成功支付的人数(不剔除退款订单)(只统计已登录的用户)。', formatter: ',', value: 0, contrast: 0, stat: 'sum' }, -] - - -export { - fieldsMap, -} diff --git a/sport-erp-admin/pages/uni-stat/pay-order/funnel/funnel.vue b/sport-erp-admin/pages/uni-stat/pay-order/funnel/funnel.vue deleted file mode 100644 index ac1f427..0000000 --- a/sport-erp-admin/pages/uni-stat/pay-order/funnel/funnel.vue +++ /dev/null @@ -1,117 +0,0 @@ - - - diff --git a/sport-erp-admin/pages/uni-stat/pay-order/list/list.vue b/sport-erp-admin/pages/uni-stat/pay-order/list/list.vue deleted file mode 100644 index 8911f77..0000000 --- a/sport-erp-admin/pages/uni-stat/pay-order/list/list.vue +++ /dev/null @@ -1,515 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/uni-stat/pay-order/overview/components/statPanelToday.vue b/sport-erp-admin/pages/uni-stat/pay-order/overview/components/statPanelToday.vue deleted file mode 100644 index f922e28..0000000 --- a/sport-erp-admin/pages/uni-stat/pay-order/overview/components/statPanelToday.vue +++ /dev/null @@ -1,232 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/uni-stat/pay-order/overview/components/statPanelTotal.vue b/sport-erp-admin/pages/uni-stat/pay-order/overview/components/statPanelTotal.vue deleted file mode 100644 index cc2e4ff..0000000 --- a/sport-erp-admin/pages/uni-stat/pay-order/overview/components/statPanelTotal.vue +++ /dev/null @@ -1,317 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/uni-stat/pay-order/overview/components/trendChart.vue b/sport-erp-admin/pages/uni-stat/pay-order/overview/components/trendChart.vue deleted file mode 100644 index c35d04a..0000000 --- a/sport-erp-admin/pages/uni-stat/pay-order/overview/components/trendChart.vue +++ /dev/null @@ -1,278 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/uni-stat/pay-order/overview/fieldsMap.js b/sport-erp-admin/pages/uni-stat/pay-order/overview/fieldsMap.js deleted file mode 100644 index c08ba62..0000000 --- a/sport-erp-admin/pages/uni-stat/pay-order/overview/fieldsMap.js +++ /dev/null @@ -1,77 +0,0 @@ -/** - * 页面上的数据都来自数据库,且多处 ui 消费,页面直接使用字段会造成耦合和冗余,固在此抽出来统一配置(clientdb 查询方法、概念文字提示等)和处理(对值再计算、格式化等) - * title 显示所使用名称 - * field 数据库字段名 - * multiple 显示的倍数,只对number类型生效,如原值为100,multiple=0.01 则显示成1 - * tooltip 对字段解释的提示文字 - * formatter 数字格式化的配置,省缺为 ',' - * '' 空字符串 则表示不格式化 - * ',' 数字格式,例:1000 格式为 1,000 - * '%' 百分比格式 例:0.1 格式为 10% - * '-' 日期格式 例:1655196831390(值需为时间戳) 格式为 2022-06-14 - * stat 对字段做 groupField 时需使用的数据库计算方法,省缺为 'sum' - * 'sum' 表示对字段做求和运算 - * 'avg' 表示对字段做平均运算 - * '-1' 表示不对字段做运算 - * fix 数字保留几位小数,>1 默认不保留小数,<1 默认保留两位小数 - * value 默认值 (仅用于 uni-stat-panel 组件) todo: 可移除 - * contrast 对比值 (仅用于 uni-stat-panel 组件) todo: 可移除 - */ - -const fieldsGroupMap = [ - { - title: '订单金额', group: "total_amount", - list:[ - { title: '下单金额', field: 'create_total_amount', tooltip: '下单:统计时间内,下单金额(包含未支付订单和退款订单)。', formatter: ',', value: "-", contrast: 0, stat: 'sum', fix:2, trendChart: true, multiple:0.01 }, - { title: '收款金额', field: 'pay_total_amount', tooltip: '收款:统计时间内,成功支付的订单金额(包含退款订单)。', formatter: ',', value: "-", contrast: 0, stat: 'sum', fix:2, trendChart: true, multiple:0.01 }, - { title: '退款金额', field: 'refund_total_amount', tooltip: '退款:统计时间内,发生退款的金额。', formatter: ',', value: "-", contrast: 0, stat: 'sum', fix:2, multiple:0.01 }, - ] - }, - { - title: '订单数量', group: "order_count", - list:[ - { title: '下单数量', field: 'create_order_count', tooltip: '下单:统计时间内,成功下单的订单笔数(包含未支付订单和退款订单)。', formatter: ',', value: "-", contrast: 0, stat: 'sum', fix:0, trendChart: true }, - { title: '收款数量', field: 'pay_order_count', tooltip: '收款:统计时间内,成功支付的订单数(包含退款订单)。', formatter: '', value: "-", contrast: 0, stat: 'sum', fix:0, trendChart: true }, - { title: '退款数量', field: 'refund_order_count', tooltip: '退款:统计时间内,发生退款的订单数。', formatter: '', value: "-", contrast: 0, stat: 'sum', fix:0 }, - ] - }, - { - title: '用户数量', group: "user_count", - list:[ - { title: '下单用户数', field: 'create_user_count', tooltip: '下单:统计时间内,成功下单的客户数(包含未支付订单和退款订单)。', formatter: ',', value: "-", contrast: 0, stat: 'sum', fix:0, trendChart: true }, - { title: '收款用户数', field: 'pay_user_count', tooltip: '收款:统计时间内,成功支付的用户数(包含退款订单)。', formatter: ',', value: "-", contrast: 0, stat: 'sum', fix:0, trendChart: true }, - { title: '退款用户数', field: 'refund_user_count', tooltip: '退款:统计时间内,发生退款的用户数。', formatter: ',', value: "-", contrast: 0, stat: 'sum', fix:0 }, - ] - }, - { - title: '设备数量', group: "device_count", - list:[ - { title: '下单设备数', field: 'create_device_count', tooltip: '下单:统计时间内,成功下单的设备数(包含未支付订单和退款订单)。', formatter: ',', value: "-", contrast: 0, stat: 'sum', fix:0, trendChart: true }, - { title: '收款设备数', field: 'pay_device_count', tooltip: '收款:统计时间内,成功支付的设备数(包含退款订单)。', formatter: ',', value: "-", contrast: 0, stat: 'sum', fix:0, trendChart: true }, - { title: '退款设备数', field: 'refund_device_count', tooltip: '退款:统计时间内,发生退款的设备数。', formatter: ',', value: "-", contrast: 0, stat: 'sum', fix:0 }, - ] - }, -]; - -let fieldsMap = []; - -fieldsGroupMap.map((item1, index1) => { - item1.list.map((item2, index2) => { - fieldsMap.push(item2); - }); -}); - - -const statPanelTodayFieldsMap = [ - { title: '下单金额(GMV)', field: 'create_total_amount', tooltip: '统计时间内,下单金额(包含未支付订单和退款订单)。', formatter: ',', value: "-", contrast: 0, stat: 'sum', fix:2, trendChart: true, multiple:0.01 }, - { title: '收款金额(GPV)', field: 'pay_total_amount', tooltip: '统计时间内,成功支付的订单金额(包含退款订单)。', formatter: ',', value: "-", contrast: 0, stat: 'sum', fix:2, trendChart: true, multiple:0.01 }, - //{ title: '支付订单数量', field: 'pay_order_count', tooltip: '统计时间内,成功支付的订单数(包含退款订单)。', formatter: '', value: "-", contrast: 0, stat: 'sum', fix:0, trendChart: true }, - { title: '退款金额', field: 'refund_total_amount', tooltip: '统计时间内,发生退款的金额。', formatter: ',', value: "-", contrast: 0, stat: 'sum', fix:2, trendChart: true, multiple:0.01 }, - { title: '实收金额', field: 'actual_total_amount', tooltip: '实收金额=收款金额-退款金额', formatter: ',', value: "-", contrast: 0, stat: 'sum', fix:2, trendChart: true, multiple:0.01 }, -]; - -export { - fieldsMap, - fieldsGroupMap, - statPanelTodayFieldsMap -} diff --git a/sport-erp-admin/pages/uni-stat/pay-order/overview/overview.vue b/sport-erp-admin/pages/uni-stat/pay-order/overview/overview.vue deleted file mode 100644 index 47081f2..0000000 --- a/sport-erp-admin/pages/uni-stat/pay-order/overview/overview.vue +++ /dev/null @@ -1,112 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/uni-stat/pay-order/ranking/ranking.vue b/sport-erp-admin/pages/uni-stat/pay-order/ranking/ranking.vue deleted file mode 100644 index e50be0a..0000000 --- a/sport-erp-admin/pages/uni-stat/pay-order/ranking/ranking.vue +++ /dev/null @@ -1,344 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/uni-stat/scene/fieldsMap.js b/sport-erp-admin/pages/uni-stat/scene/fieldsMap.js deleted file mode 100644 index 34c6503..0000000 --- a/sport-erp-admin/pages/uni-stat/scene/fieldsMap.js +++ /dev/null @@ -1,86 +0,0 @@ -/** - * 页面上的数据都来自数据库,且多处 ui 消费,页面直接使用字段会造成耦合和冗余,固在此抽出来统一配置(clientdb 查询方法、概念文字提示等)和处理(对值再计算、格式化等) - * title 显示所使用名称 - * field 数据库字段名 - * computed 计算表达式配置,只支持除法计算(需要 mapfield 函数支持,也可自行扩展) - * tooltip 对字段解释的提示文字 - * formatter 数字格式化的配置,省缺为 ',' - * '' 空字符串 则表示不格式化 - * ',' 数字格式,例:1000 格式为 1,000 - * '%' 百分比格式 例:0.1 格式为 10% - * ':' 时分秒格式 例:90 格式为 00:01:30 - * '-' 日期格式 例:1655196831390(值需为时间戳) 格式为 2022-06-14 - * stat 对字段做 groupField 时需使用的数据库计算方法,省缺为 'sum' - * 'sum' 表示对字段做求和运算 - * 'avg' 表示对字段做平均运算 - * '-1' 表示不对字段做运算 - * fix 数字保留几位小数,>1 默认不保留小数,<1 默认保留两位小数 - * disabled 是否用于展示,默认为 true - * value 默认值 (仅用于 uni-stat-panel 组件) todo: 可移除 - * contrast 对比值 (仅用于 uni-stat-panel 组件) todo: 可移除 - */ - -export default [{ - title: '场景值', - field: 'channel_code', - tooltip: '', - formatter: '', -}, { - title: '场景名称', - field: 'channel_name', - tooltip: '', - formatter: '', -}, { - title: '新增设备', - field: 'new_device_count', - tooltip: '首次访问应用的设备数(以设备为判断标准,去重)', - value: 0 -}, { - title: '活跃设备', - field: 'active_device_count', - tooltip: '访问过应用内任意页面的总设备数(去重)', - value: 0 -}, { - title: '访问次数', - field: 'page_visit_count', - tooltip: '访问过应用内任意页面总次数,多个页面之间跳转、同一页面的重复访问计为多次访问', - value: 0 -}, { - title: '启动次数', - field: 'app_launch_count', - tooltip: '设备从打开应用到主动关闭应用或超时退出计为一次启动', - value: 0 -}, { - title: '次均停留时长', - field: 'avg_device_session_time', - computed: 'duration/app_launch_count', - formatter: ':', - tooltip: '平均每次打开应用停留在应用内的总时长,即应用停留总时长/启动次数', - value: 0, - stat: 'avg' -}, { - title: '设备平均停留时长 ', - field: 'avg_device_time', - computed: 'duration/active_device_count', - formatter: ':', - tooltip: '平均每个设备停留在应用内的总时长,即应用停留总时长/活跃设备', - value: 0, - stat: 'avg' -}, { - title: '跳出率', - field: 'bounceRate', - computed: 'bounce_times/app_launch_count', - formatter: '%', - tooltip: '只浏览一个页面便离开应用的次数占总启动次数的百分比', - value: 0, - contrast: 0, - fix: 2 -}, { - field: 'bounce_times', - disable: true -}, { - title: '总设备数', - field: 'total_devices', - tooltip: '从添加统计到当前选择时间的总设备数(去重)', - value: 0, -}] diff --git a/sport-erp-admin/pages/uni-stat/scene/scene.vue b/sport-erp-admin/pages/uni-stat/scene/scene.vue deleted file mode 100644 index 564d8da..0000000 --- a/sport-erp-admin/pages/uni-stat/scene/scene.vue +++ /dev/null @@ -1,384 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/uni-stat/user/activity/activity.vue b/sport-erp-admin/pages/uni-stat/user/activity/activity.vue deleted file mode 100644 index d9310ed..0000000 --- a/sport-erp-admin/pages/uni-stat/user/activity/activity.vue +++ /dev/null @@ -1,445 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/uni-stat/user/activity/fieldsMap.js b/sport-erp-admin/pages/uni-stat/user/activity/fieldsMap.js deleted file mode 100644 index 2f40d61..0000000 --- a/sport-erp-admin/pages/uni-stat/user/activity/fieldsMap.js +++ /dev/null @@ -1,50 +0,0 @@ -/** - * 页面上的数据都来自数据库,且多处 ui 消费,页面直接使用字段会造成耦合和冗余,固在此抽出来统一配置(clientdb 查询方法、概念文字提示等)和处理(对值再计算、格式化等) - * title 显示所使用名称 - * field 数据库字段名 - * computed 计算表达式配置,只支持除法计算(需要 mapfield 函数支持,也可自行扩展) - * tooltip 对字段解释的提示文字 - * formatter 数字格式化的配置,省缺为 ',' - * '' 空字符串 则表示不格式化 - * ',' 数字格式,例:1000 格式为 1,000 - * '%' 百分比格式 例:0.1 格式为 10% - * ':' 时分秒格式 例:90 格式为 00:01:30 - * '-' 日期格式 例:1655196831390(值需为时间戳) 格式为 2022-06-14 - * stat 对字段做 groupField 时需使用的数据库计算方法,省缺为 'sum' - * 'sum' 表示对字段做求和运算 - * 'avg' 表示对字段做平均运算 - * '-1' 表示不对字段做运算 - * fix 数字保留几位小数,>1 默认不保留小数,<1 默认保留两位小数 - * value 默认值 (仅用于 uni-stat-panel 组件) todo: 可移除 - * contrast 对比值 (仅用于 uni-stat-panel 组件) todo: 可移除 - */ -export default [{ - title: '日期', - field: 'start_time', - tooltip: '', - formatter: '-', -}, { - title: '日活', - field: 'active_user_count', - tooltip: '选中日期当天的访问用户数', -}, { - title: '周活', - field: 'week_active_user_count', - tooltip: '选中日期所在自然周(包括选中日期在内)的访问用户数', -}, { - title: '日活/周活', - field: 'active_user_count/week_active_user_count', - computed: 'active_user_count/week_active_user_count', - tooltip: '选中日期的访问用户数占周访问用户数的百分比', - formatter: '%', -}, { - title: '月活', - field: 'month_active_user_count', - tooltip: '选中日期所在自然月(包括选中日期在内)的访问用户数', -}, { - title: '日活/月活', - field: 'active_user_count/month_active_user_count', - computed: 'active_user_count/month_active_user_count', - tooltip: '选中日期的访问用户数占月访问用户数的百分比', - formatter: '%', -}] diff --git a/sport-erp-admin/pages/uni-stat/user/comparison/comparison.vue b/sport-erp-admin/pages/uni-stat/user/comparison/comparison.vue deleted file mode 100644 index 866ab39..0000000 --- a/sport-erp-admin/pages/uni-stat/user/comparison/comparison.vue +++ /dev/null @@ -1,207 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/uni-stat/user/overview/fieldsMap.js b/sport-erp-admin/pages/uni-stat/user/overview/fieldsMap.js deleted file mode 100644 index 2492621..0000000 --- a/sport-erp-admin/pages/uni-stat/user/overview/fieldsMap.js +++ /dev/null @@ -1,104 +0,0 @@ -/** - * 页面上的数据都来自数据库,且多处 ui 消费,页面直接使用字段会造成耦合和冗余,固在此抽出来统一配置(clientdb 查询方法、概念文字提示等)和处理(对值再计算、格式化等) - * title 显示所使用名称 - * field 数据库字段名 - * computed 计算表达式配置,只支持除法计算(需要 mapfield 函数支持,也可自行扩展) - * tooltip 对字段解释的提示文字 - * formatter 数字格式化的配置,省缺为 ',' - * '' 空字符串 则表示不格式化 - * ',' 数字格式,例:1000 格式为 1,000 - * '%' 百分比格式 例:0.1 格式为 10% - * ':' 时分秒格式 例:90 格式为 00:01:30 - * '-' 日期格式 例:1655196831390(值需为时间戳) 格式为 2022-06-14 - * stat 对字段做 groupField 时需使用的数据库计算方法,省缺为 'sum' - * 'sum' 表示对字段做求和运算 - * 'avg' 表示对字段做平均运算 - * '-1' 表示不对字段做运算 - * fix 数字保留几位小数,>1 默认不保留小数,<1 默认保留两位小数 - * value 默认值 (仅用于 uni-stat-panel 组件) todo: 可移除 - * contrast 对比值 (仅用于 uni-stat-panel 组件) todo: 可移除 - */ -const fieldsMap = [{ - value: '今天', - contrast: '昨天', - // stat: -1 -}, { - title: '新增用户', - field: 'new_user_count', - tooltip: '首次访问应用的用户数(以用户为判断标准,去重)', - value: 0, - contrast: 0 -}, { - title: '活跃用户', - field: 'active_user_count', - tooltip: '访问过应用内任意页面的总用户数,今日数据为每小时活跃用户累加(未虑重),昨日数据为全天活跃用户虑重后结果。', - value: 0, - contrast: 0 -}, { - title: '次均停留时长', - field: 'avg_user_session_time', - computed: 'duration/user_session_times', - formatter: ':', - tooltip: '平均每次打开应用停留在应用内的总时长,即应用停留总时长/启动次数', - value: 0, - contrast: 0, - //stat: 'avg' -}, { - title: '人均停留时长 ', - field: 'avg_user_time', - computed: 'duration/active_user_count', - formatter: ':', - tooltip: '平均每个用户停留在应用内的总时长,即应用停留总时长/活跃用户', - value: 0, - contrast: 0, - //stat: 'avg' -}, { - title: '总用户数', - field: 'total_users', - tooltip: '从添加统计到当前选择时间的总用户数(去重)', - value: 0, - contrast: 0 -}] - -const resFieldsMap = [{ - title: '受访页', - field: 'path', - tooltip: '用户进入应用访问的所有页面,例如用户从页面1进入应用,跳转到页面2,1,2均为受访页', - formatter: '' -}, { - title: '访问次数', - field: 'visit_times', - tooltip: '访问该页面的总次数', - value: 0 - -}, { - title: '占比', - field: 'rate', - computed: 'visit_times/total_app_access', - tooltip: '某个页面的访问次数占所有页面访问次数的比例', - formatter: '%', -}] - -const entFieldsMap = [{ - title: '入口页', - field: 'path', - tooltip: '用户进入应用访问的第一个页面,例如用户从页面1进入应用,跳转到页面2,1为入口页,而2不是', - formatter: '' -}, { - title: '访问次数', - field: 'entry_count', - tooltip: '访问该页面的总次数', - value: 0 -}, { - title: '占比', - field: 'rate', - computed: 'entry_count/total_app_access', - tooltip: '某个页面的访问次数占所有页面访问次数的比例', - formatter: '%' -}] - -export { - fieldsMap, - resFieldsMap, - entFieldsMap -} diff --git a/sport-erp-admin/pages/uni-stat/user/overview/overview.vue b/sport-erp-admin/pages/uni-stat/user/overview/overview.vue deleted file mode 100644 index 2ff6b75..0000000 --- a/sport-erp-admin/pages/uni-stat/user/overview/overview.vue +++ /dev/null @@ -1,419 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/uni-stat/user/retention/fieldsMap.js b/sport-erp-admin/pages/uni-stat/user/retention/fieldsMap.js deleted file mode 100644 index 588dae3..0000000 --- a/sport-erp-admin/pages/uni-stat/user/retention/fieldsMap.js +++ /dev/null @@ -1,56 +0,0 @@ -/** - * 页面上的数据都来自数据库,且多处 ui 消费,页面直接使用字段会造成耦合和冗余,固在此抽出来统一配置(clientdb 查询方法、概念文字提示等)和处理(对值再计算、格式化等) - * title 显示所使用名称 - * field 数据库字段名 - * computed 计算表达式配置,只支持除法计算(需要 mapfield 函数支持,也可自行扩展) - * tooltip 对字段解释的提示文字 - * formatter 数字格式化的配置,省缺为 ',' - * '' 空字符串 则表示不格式化 - * ',' 数字格式,例:1000 格式为 1,000 - * '%' 百分比格式 例:0.1 格式为 10% - * ':' 时分秒格式 例:90 格式为 00:01:30 - * '-' 日期格式 例:1655196831390(值需为时间戳) 格式为 2022-06-14 - * stat 对字段做 groupField 时需使用的数据库计算方法,省缺为 'sum' - * 'sum' 表示对字段做求和运算 - * 'avg' 表示对字段做平均运算 - * '-1' 表示不对字段做运算 - * fix 数字保留几位小数,>1 默认不保留小数,<1 默认保留两位小数 - * value 默认值 (仅用于 uni-stat-panel 组件) todo: 可移除 - * contrast 对比值 (仅用于 uni-stat-panel 组件) todo: 可移除 - */ -function fieldsFactory(maps = [{ - title: '新增用户', - field: 'new_user_count', - stat: 0 -}]) { - let fieldsMap = [{ - title: '日期', - field: 'start_time', - tooltip: '', - formatter: '-', - stat: -1 - }] - - if (maps) { - fieldsMap.push(...maps) - } - - const values = [1, 2, 3, 4, 5, 6, 7, 14, 30] - const fields = values.map(val => { - return { - title: `${val}天后`, - field: `d_${val}`, - computed: `d_${val}/${maps[0].field}`, - formatter: '%', - tooltip: '' - } - }) - - fieldsMap = fieldsMap.concat(fields) - - return fieldsMap - - -} - -export default fieldsFactory diff --git a/sport-erp-admin/pages/uni-stat/user/retention/retention.vue b/sport-erp-admin/pages/uni-stat/user/retention/retention.vue deleted file mode 100644 index b08ba8f..0000000 --- a/sport-erp-admin/pages/uni-stat/user/retention/retention.vue +++ /dev/null @@ -1,439 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/uni-stat/user/stickiness/fieldsMap.js b/sport-erp-admin/pages/uni-stat/user/stickiness/fieldsMap.js deleted file mode 100644 index c893f70..0000000 --- a/sport-erp-admin/pages/uni-stat/user/stickiness/fieldsMap.js +++ /dev/null @@ -1,48 +0,0 @@ -/** - * 页面上的数据都来自数据库,且多处 ui 消费,页面直接使用字段会造成耦合和冗余,固在此抽出来统一配置(clientdb 查询方法、概念文字提示等)和处理(对值再计算、格式化等) - * title 显示所使用名称 - * field 数据库字段名 - * computed 计算表达式配置,只支持除法计算(需要 mapfield 函数支持,也可自行扩展) - * tooltip 对字段解释的提示文字 - * formatter 数字格式化的配置,省缺为 ',' - * '' 空字符串 则表示不格式化 - * ',' 数字格式,例:1000 格式为 1,000 - * '%' 百分比格式 例:0.1 格式为 10% - * ':' 时分秒格式 例:90 格式为 00:01:30 - * '-' 日期格式 例:1655196831390(值需为时间戳) 格式为 2022-06-14 - * stat 对字段做 groupField 时需使用的数据库计算方法,省缺为 'sum' - * 'sum' 表示对字段做求和运算 - * 'avg' 表示对字段做平均运算 - * '-1' 表示不对字段做运算 - * fix 数字保留几位小数,>1 默认不保留小数,<1 默认保留两位小数 - * value 默认值 (仅用于 uni-stat-panel 组件) todo: 可移除 - * contrast 对比值 (仅用于 uni-stat-panel 组件) todo: 可移除 - */ - -export default [{ - title: '名称', - field: 'name', - tooltip: '', - formatter: '', -}, { - title: '访问人数', - field: 'visit_users', - tooltip: '访问人数(活跃用户数):访问过应用内任意页面的总用户数(去重)', - value: 0 -}, { - title: '访问人数占比', - field: 'visit_users/total_visit_users', - computed: 'visit_users/total_visit_users', - formatter: '%', -}, { - title: '访问次数', - field: 'visit_times', - tooltip: '访问过应用内任意页面总次数,多个页面之间跳转、同一页面的重复访问计为多次访问', - value: 0 -}, { - title: '访问次数占比', - field: 'visit_times/total_visit_times', - computed: 'visit_times/total_visit_times', - formatter: '%', - tooltip: '', -}] diff --git a/sport-erp-admin/pages/uni-stat/user/stickiness/stickiness.vue b/sport-erp-admin/pages/uni-stat/user/stickiness/stickiness.vue deleted file mode 100644 index 355aa67..0000000 --- a/sport-erp-admin/pages/uni-stat/user/stickiness/stickiness.vue +++ /dev/null @@ -1,419 +0,0 @@ - - - - - diff --git a/sport-erp-admin/pages/uni-stat/user/trend/fieldsMap.js b/sport-erp-admin/pages/uni-stat/user/trend/fieldsMap.js deleted file mode 100644 index 141a581..0000000 --- a/sport-erp-admin/pages/uni-stat/user/trend/fieldsMap.js +++ /dev/null @@ -1,59 +0,0 @@ -/** - * 页面上的数据都来自数据库,且多处 ui 消费,页面直接使用字段会造成耦合和冗余,固在此抽出来统一配置(clientdb 查询方法、概念文字提示等)和处理(对值再计算、格式化等) - * title 显示所使用名称 - * field 数据库字段名 - * computed 计算表达式配置,只支持除法计算(需要 mapfield 函数支持,也可自行扩展) - * tooltip 对字段解释的提示文字 - * formatter 数字格式化的配置,省缺为 ',' - * '' 空字符串 则表示不格式化 - * ',' 数字格式,例:1000 格式为 1,000 - * '%' 百分比格式 例:0.1 格式为 10% - * ':' 时分秒格式 例:90 格式为 00:01:30 - * '-' 日期格式 例:1655196831390(值需为时间戳) 格式为 2022-06-14 - * stat 对字段做 groupField 时需使用的数据库计算方法,省缺为 'sum' - * 'sum' 表示对字段做求和运算 - * 'avg' 表示对字段做平均运算 - * '-1' 表示不对字段做运算 - * fix 数字保留几位小数,>1 默认不保留小数,<1 默认保留两位小数 - * value 默认值 (仅用于 uni-stat-panel 组件) todo: 可移除 - * contrast 对比值 (仅用于 uni-stat-panel 组件) todo: 可移除 - */ -export default [{ - title: '日期', - field: 'start_time', - tooltip: '', - formatter: '', - stat: -1 -}, { - title: '新增用户', - field: 'new_user_count', - tooltip: '首次访问应用的用户数(以设备为判断标准,去重)', - value: 0 -}, { - title: '活跃用户', - field: 'active_user_count', - tooltip: '访问过应用内任意页面的总用户数(去重)', - value: 0 -}, -{ - title: '次均停留时长', - field: 'avg_user_session_time', - computed: 'user_duration/active_user_count', - formatter: ':', - tooltip: '平均每次打开应用停留在应用内的总时长,即应用停留总时长/启动次数', - value: 0 -}, -{ - title: '人均停留时长', - field: 'avg_user_time', - computed: 'user_duration/user_session_times', - formatter: ':', - tooltip: '平均每个用户停留在应用内的总时长,即应用停留总时长/活跃用户', - value: 0 -}, -{ - title: '总用户数', - field: 'total_users', - tooltip: '从添加统计到当前选择时间的总用户数(去重)', - value: 0, -}] diff --git a/sport-erp-admin/pages/uni-stat/user/trend/trend.vue b/sport-erp-admin/pages/uni-stat/user/trend/trend.vue deleted file mode 100644 index 3754970..0000000 --- a/sport-erp-admin/pages/uni-stat/user/trend/trend.vue +++ /dev/null @@ -1,459 +0,0 @@ - - - - - diff --git a/sport-erp-admin/postcss.config.js b/sport-erp-admin/postcss.config.js deleted file mode 100644 index 6c53a17..0000000 --- a/sport-erp-admin/postcss.config.js +++ /dev/null @@ -1,44 +0,0 @@ -if (process.env.VITE_ROOT_DIR) { // vite - const { - uniPostcssPlugin, - parseRpx2UnitOnce, - } = require('@dcloudio/uni-cli-shared') - module.exports = { - plugins: [ - uniPostcssPlugin( - Object.assign({ - page: process.env.UNI_PLATFORM === 'h5' ? 'uni-page-body' : 'body' - }, - parseRpx2UnitOnce(process.env.UNI_INPUT_DIR) - ) - ), - require('autoprefixer')(), - ], - } -} else { - - const path = require('path') - module.exports = { - parser: 'postcss-comment', - plugins: { - 'postcss-import': { - resolve(id, basedir, importOptions) { - if (id.startsWith('~@/')) { - return path.resolve(process.env.UNI_INPUT_DIR, id.substr(3)) - } else if (id.startsWith('@/')) { - return path.resolve(process.env.UNI_INPUT_DIR, id.substr(2)) - } else if (id.startsWith('/') && !id.startsWith('//')) { - return path.resolve(process.env.UNI_INPUT_DIR, id.substr(1)) - } - return id - } - }, - 'autoprefixer': { - overrideBrowserslist: ["> 1%", "last 2 versions", "not dead"], - remove: process.env.UNI_PLATFORM !== 'h5', - ignoreUnknownVersions: true - }, - '@dcloudio/vue-cli-plugin-uni/packages/postcss': {} - } - } -} diff --git a/sport-erp-admin/static/admin-icons.ttf b/sport-erp-admin/static/admin-icons.ttf deleted file mode 100644 index 8b74e53..0000000 Binary files a/sport-erp-admin/static/admin-icons.ttf and /dev/null differ diff --git a/sport-erp-admin/static/logo.png b/sport-erp-admin/static/logo.png deleted file mode 100644 index 710f924..0000000 Binary files a/sport-erp-admin/static/logo.png and /dev/null differ diff --git a/sport-erp-admin/store/constants.js b/sport-erp-admin/store/constants.js deleted file mode 100644 index 7f08993..0000000 --- a/sport-erp-admin/store/constants.js +++ /dev/null @@ -1,5 +0,0 @@ -/** uni-admin 缓存键名 */ -export const uniAdminCacheKey = { - theme: "uni-admin-theme", // 主题 - -} diff --git a/sport-erp-admin/store/index.js b/sport-erp-admin/store/index.js deleted file mode 100644 index eb9a0ec..0000000 --- a/sport-erp-admin/store/index.js +++ /dev/null @@ -1,41 +0,0 @@ -import app from './modules/app.js' -import error from './modules/error.js' -import user from './modules/user.js' - -// const modulesFiles = require.context('./modules', true, /\.js$/) -// const modules = modulesFiles.keys().reduce((modules, modulePath) => { -// const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1') -// const value = modulesFiles(modulePath) -// modules[moduleName] = value.default -// return modules -// }, {}) - -// #ifndef VUE3 -import Vue from 'vue' -import Vuex from 'vuex' -Vue.use(Vuex) -const store = new Vuex.Store({ - modules: { - app, - error, - user - } -}) -// #endif - -// #ifdef VUE3 -import { - createStore -} from 'vuex' -// todo ssr -const store = createStore({ - modules: { - app, - error, - user - } -}) -// #endif - - -export default store diff --git a/sport-erp-admin/store/modules/app.js b/sport-erp-admin/store/modules/app.js deleted file mode 100644 index b7101d8..0000000 --- a/sport-erp-admin/store/modules/app.js +++ /dev/null @@ -1,67 +0,0 @@ -import { - uniAdminCacheKey -} from '../constants.js' - -// #ifndef VUE3 -const statConfig = require('uni-stat-config').default || require('uni-stat-config'); -// #endif - -export default { - namespaced: true, - state: { - inited: false, - navMenu: [], - routes: [], - theme: uni.getStorageSync(uniAdminCacheKey.theme) || 'default', - // #ifndef VUE3 - appName: process.env.VUE_APP_NAME || '', - appid: statConfig && statConfig.appid || '', - // #endif - // #ifdef VUE3 - appName: process.env.UNI_APP_NAME || '', - appid: process.env.UNI_APP_ID || '' - // #endif - }, - mutations: { - SET_APP_NAME: (state, appName) => { - state.appName = appName - }, - SET_NAV_MENU: (state, navMenu) => { - state.inited = true - state.navMenu = navMenu - }, - SET_ROUTES: (state, routes) => { - state.routes = routes - }, - SET_THEME: (state, theme) => { - // #ifdef H5 - document - .getElementsByTagName('body')[0] - .setAttribute('data-theme', theme) - // #endif - uni.setStorageSync(uniAdminCacheKey.theme, theme) - state.theme = theme - } - }, - actions: { - init({ - commit, - dispatch - }) { - // 初始化获取用户信息 - dispatch('user/getUserInfo', null, { - root: true - }) - }, - setAppName({ - commit - }, appName) { - commit('SET_APP_NAME', appName) - }, - setRoutes({ - commit - }, routes) { - commit('SET_ROUTES', routes) - } - } -} diff --git a/sport-erp-admin/store/modules/error.js b/sport-erp-admin/store/modules/error.js deleted file mode 100644 index dded325..0000000 --- a/sport-erp-admin/store/modules/error.js +++ /dev/null @@ -1,33 +0,0 @@ -export default { - namespaced: true, - state: { - logs: [] - }, - mutations: { - ADD_ERROR_LOG: (state, log) => { - state.logs.unshift(log) - }, - CLEAR_ERROR_LOG: (state) => { - state.logs.splice(0) - } - }, - actions: { - add({ - commit - }, log) { - if (!log.route) { - const pages = getCurrentPages() - if (pages.length) { - log.route = pages[pages.length - 1].route - } - } - log.route = '/' + (log.route || '') - commit('ADD_ERROR_LOG', log) - }, - clear({ - commit - }) { - commit('CLEAR_ERROR_LOG') - } - } -} diff --git a/sport-erp-admin/store/modules/user.js b/sport-erp-admin/store/modules/user.js deleted file mode 100644 index 3c546ac..0000000 --- a/sport-erp-admin/store/modules/user.js +++ /dev/null @@ -1,23 +0,0 @@ -import * as uniIdPagesStore from '@/uni_modules/uni-id-pages/common/store' -export default { - namespaced: true, - state: {}, - mutations: {}, - actions: { - getUserInfo ({commit}) { - const db = uniCloud.database() - return db - .collection('uni-id-users') - .where('_id==$cloudEnv_uid') - .field('username,nickname,mobile,email,role,permission') - .get() - .then(({result}) => { - const [userInfo] = result.data - - uniIdPagesStore.mutations.setUserInfo(userInfo, true) - - return Promise.resolve(userInfo) - }) - } - } -} diff --git a/sport-erp-admin/template.h5.html b/sport-erp-admin/template.h5.html deleted file mode 100644 index ba3e44b..0000000 --- a/sport-erp-admin/template.h5.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - <%= htmlWebpackPlugin.options.title %> - - - - - - - -
- - - - \ No newline at end of file diff --git a/sport-erp-admin/uni.scss b/sport-erp-admin/uni.scss deleted file mode 100644 index 4c7bc24..0000000 --- a/sport-erp-admin/uni.scss +++ /dev/null @@ -1,102 +0,0 @@ -/** - * 这里是uni-app内置的常用样式变量 - * - * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量 - * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App - * - */ - -/** - * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能 - * - * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 - */ - -/* 颜色变量 */ - -@import '@/uni_modules/uni-scss/variables.scss'; - -/* 行为相关颜色 */ -$uni-color-primary: #2979ff; -$uni-color-success: #18bc37; -$uni-color-warning: #f3a73f; -$uni-color-error: #e43d33; - -$themes: ( - default: ( - primary-color: $uni-color-primary, - success-color: $uni-color-success, - warn-color: $uni-color-error, - warning-color: $uni-color-warning, - error-color: $uni-color-error - ), - green: ( - primary-color: #42b983, - success-color: $uni-color-success, - warn-color: $uni-color-error, - warning-color: $uni-color-warning, - error-color: $uni-color-error - ) -); -/* 兼容 uni-ui 相关颜色 */ -$uni-primary: $uni-color-primary; -$uni-success: $uni-color-success; -$uni-warning: $uni-color-warning; -$uni-error: $uni-color-error; - -/* 文字基本颜色 */ -$uni-text-color: #333; // 基本色 -$uni-text-color-inverse: #fff; // 反色 -$uni-text-color-grey: #999; // 辅助灰色,如加载更多的提示信息 -$uni-text-color-placeholder: #808080; -$uni-text-color-disable: #c0c0c0; -/* 背景颜色 */ -$uni-bg-color: #ffffff; -$uni-bg-color-grey: #f8f8f8; -$uni-bg-color-hover: #f1f1f1; // 点击状态颜色 -$uni-bg-color-mask: rgba(0, 0, 0, 0.4); // 遮罩颜色 -/* 边框颜色 */ -$uni-border-color: #c8c7cc; -$uni-table-border-color: #e6ebf5; - -/* 尺寸变量 */ -/* 文字尺寸 */ -$uni-font-size-sm: 12px; -$uni-font-size-base: 14px; -$uni-font-size-lg: 16px; -/* 图片尺寸 */ -$uni-img-size-sm: 20px; -$uni-img-size-base: 26px; -$uni-img-size-lg: 40px; -/* Border Radius */ -$uni-border-radius-sm: 3px; -$uni-border-radius-base: 5px; -$uni-border-radius-lg: 10px; -$uni-border-radius-circle: 50%; -/* 水平间距 */ -$uni-spacing-row-sm: 10px; -$uni-spacing-row-base: 15px; -$uni-spacing-row-lg: 20px; -/* 垂直间距 */ -$uni-spacing-col-sm: 5px; -$uni-spacing-col-base: 10px; -$uni-spacing-col-lg: 15px; -/* 透明度 */ -$uni-opacity-disabled: 0.3; -// 组件禁用态的透明度 -/* 文章场景相关 */ -$uni-color-title: #2c405a; // 文章标题颜色 -$uni-font-size-title: 20px; -$uni-color-subtitle: #555555; // 二级标题颜色 -$uni-font-size-subtitle: 18px; -$uni-color-paragraph: #3f536e; // 文章段落颜色 -$uni-font-size-paragraph: 14px; -$menu-bg-color: #fff; // 一级菜单背景色 -$sub-menu-bg-color: darken($menu-bg-color, 8%); // 二级以下菜单背景色 -$menu-bg-color-hover: darken($menu-bg-color, 15%); -// 菜单 hover 背景颜色 -$menu-text-color: #333; // 菜单前景色 -$menu-text-color-actived: #409eff; // 菜单激活前景色 -$left-window-bg-color: $menu-bg-color; // 左侧窗口背景色 -$top-window-bg-color: #fff; // 顶部窗口背景色 -$top-window-text-color: #999; // 顶部窗口前景色 diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/index.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/index.js deleted file mode 100644 index 7b505d4..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/index.js +++ /dev/null @@ -1,23 +0,0 @@ -const { - createApi -} = require('./shared/index') - -let reportDataReceiver, dataStatCron -module.exports = { - //uni统计数据上报数据接收器初始化 - initReceiver: (options = {}) => { - if(!reportDataReceiver) { - reportDataReceiver = require('./stat/receiver') - } - options.clientType = options.clientType || __ctx__.PLATFORM - return createApi(reportDataReceiver, options) - }, - //uni统计数据统计模块初始化 - initStat: (options = {}) => { - if(!dataStatCron) { - dataStatCron = require('./stat/stat') - } - options.clientType = options.clientType || __ctx__.PLATFORM - return createApi(dataStatCron, options) - } -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/package.json b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/package.json deleted file mode 100644 index 2e0e509..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "uni-stat", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "keywords": [], - "author": "", - "license": "ISC", - "dependencies": { - "uni-config-center": "file:..\/..\/..\/..\/uni_modules\/uni-config-center\/uniCloud\/cloudfunctions\/common\/uni-config-center" - }, - "origin-plugin-dev-name": "uni-template-admin", - "origin-plugin-version": "2.5.13", - "plugin-dev-name": "uni-template-admin", - "plugin-version": "2.5.13" -} \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/shared/create-api.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/shared/create-api.js deleted file mode 100644 index ea438f6..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/shared/create-api.js +++ /dev/null @@ -1,82 +0,0 @@ -const { - isFn, - isPlainObject -} = require('./utils') - -/** - * 实例参数处理,注意:不进行递归处理 - * @param {Object} params 初始参数 - * @param {Object} rule 规则集 - * @returns {Object} 处理后的参数 - */ -function parseParams (params = {}, rule) { - if (!rule || !params) { - return params - } - const internalKeys = ['_pre', '_purify', '_post'] - // 转换之前的处理 - if (rule._pre) { - params = rule._pre(params) - } - // 净化参数 - let purify = { shouldDelete: new Set([]) } - if (rule._purify) { - const _purify = rule._purify - for (const purifyKey in _purify) { - _purify[purifyKey] = new Set(_purify[purifyKey]) - } - purify = Object.assign(purify, _purify) - } - if (isPlainObject(rule)) { - for (const key in rule) { - const parser = rule[key] - if (isFn(parser) && internalKeys.indexOf(key) === -1) { - params[key] = parser(params) - } else if (typeof parser === 'string' && internalKeys.indexOf(key) === -1) { - // 直接转换属性名称的删除旧属性名 - params[key] = params[parser] - purify.shouldDelete.add(parser) - } - } - } else if (isFn(rule)) { - params = rule(params) - } - - if (purify.shouldDelete) { - for (const item of purify.shouldDelete) { - delete params[item] - } - } - - // 转换之后的处理 - if (rule._post) { - params = rule._post(params) - } - - return params -} - -/** - * 返回一个提供应用上下文的应用实例。应用实例挂载的整个组件树共享同一个上下文 - * @param {class} ApiClass 实例类 - * @param {Object} options 参数 - * @returns {Object} 实例类对象 - */ -module.exports = function createApi (ApiClass, options) { - const apiInstance = new ApiClass(options) - return new Proxy(apiInstance, { - get: function (obj, prop) { - if (typeof obj[prop] === 'function' && prop.indexOf('_') !== 0 && obj._protocols && obj._protocols[prop]) { - const protocol = obj._protocols[prop] - return async function (params) { - params = parseParams(params, protocol.args) - let result = await obj[prop](params) - result = parseParams(result, protocol.returnValue) - return result - } - } else { - return obj[prop] - } - } - }) -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/shared/error.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/shared/error.js deleted file mode 100644 index 2955d22..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/shared/error.js +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @class UniCloudError 错误处理模块 - */ -module.exports = class UniCloudError extends Error { - constructor (options) { - super(options.message) - this.errMsg = options.message || '' - Object.defineProperties(this, { - message: { - get () { - return `errCode: ${options.code || ''} | errMsg: ` + this.errMsg - }, - set (msg) { - this.errMsg = msg - } - } - }) - } -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/shared/index.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/shared/index.js deleted file mode 100644 index 12951c8..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/shared/index.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - UniCloudError: require('./error'), - createApi: require('./create-api'), - ... require('./utils') -} - diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/shared/utils.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/shared/utils.js deleted file mode 100644 index 3a26ecb..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/shared/utils.js +++ /dev/null @@ -1,199 +0,0 @@ -const _toString = Object.prototype.toString -const hasOwnProperty = Object.prototype.hasOwnProperty - -/** - * 检查对象是否包含某个属性 - * @param {Object} obj 对象 - * @param {String} key 属性键值 - */ -function hasOwn(obj, key) { - return hasOwnProperty.call(obj, key) -} - -/** - * 参数是否为JavaScript的简单对象 - * @param {Object} obj - * @returns {Boolean} true|false - */ -function isPlainObject(obj) { - return _toString.call(obj) === '[object Object]' -} - -/** - * 是否为函数 - * @param {String} fn 函数名 - */ -function isFn(fn) { - return typeof fn === 'function' -} - -/** - * 深度克隆对象 - * @param {Object} obj - */ -function deepClone(obj) { - return JSON.parse(JSON.stringify(obj)) -} - - -/** - * 解析客户端上报的参数 - * @param {String} primitiveParams 原始参数 - * @param {Object} context 附带的上下文 - */ -function parseUrlParams(primitiveParams, context) { - if (!primitiveParams) { - return primitiveParams - } - - let params = {} - if(typeof primitiveParams === 'string') { - params = primitiveParams.split('&').reduce((res, cur) => { - const arr = cur.split('=') - return Object.assign({ - [arr[0]]: arr[1] - }, res) - }, {}) - } else { - //转换参数类型--兼容性 - for(let key in primitiveParams) { - if(typeof primitiveParams[key] === 'number') { - params[key] = primitiveParams[key] + '' - } else { - params[key] = primitiveParams[key] - } - } - } - - //原以下数据要从客户端上报,现调整为如果以下参数客户端未上报,则通过请求附带的context参数中获取 - const convertParams = { - //appid - ak: 'appId', - //当前登录用户编号 - uid: 'uid', - //设备编号 - did: 'deviceId', - //uni-app 运行平台,与条件编译平台相同。 - up: 'uniPlatform', - //操作系统名称 - p: 'osName', - //因为p参数可能会被前端覆盖掉,所以这里单独拿出来一个osName - on: 'osName', - //客户端ip - ip: 'clientIP', - //客户端的UA - ua: 'userAgent', - //当前服务空间编号 - spid: 'spaceId', - //当前服务空间提供商 - sppd: 'provider', - //应用版本号 - v: 'appVersion', - //rom 名称 - rn: 'romName', - //rom 版本 - rv: 'romVersion', - //操作系统版本 - sv: 'osVersion', - //操作系统语言 - lang: 'osLanguage', - //操作系统主题 - ot: 'osTheme', - //设备类型 - dtp: 'deviceType', - //设备品牌 - brand: 'deviceBrand', - //设备型号 - md: 'deviceModel', - //设备像素比 - pr: 'devicePixelRatio', - //可使用窗口宽度 - ww: 'windowWidth', - //可使用窗口高度 - wh: 'windowHeight', - //屏幕宽度 - sw: 'screenWidth', - //屏幕高度 - sh: 'screenHeight', - //兼容前端sdk未上报ut参数的问题 - ut: 'uniPlatform' - } - context = context ? context : {} - for (let key in convertParams) { - if (!params[key] && context[convertParams[key]]) { - params[key] = context[convertParams[key]] - } - } - - return params -} - -/** - * 解析url - * @param {String} url - */ -function parseUrl(url) { - if (typeof url !== "string" || !url) { - return false - } - const urlInfo = url.split('?') - - let baseurl = urlInfo[0] - if (baseurl !== '/' && baseurl.indexOf('/') === 0) { - baseurl = baseurl.substr(1) - } - - return { - path: baseurl, - query: urlInfo[1] ? decodeURI(urlInfo[1]) : '' - } -} - -//加载配置中心-uni-config-center -let createConfig -try { - createConfig = require('uni-config-center') -} catch (e) {} - -/** - * 获取配置文件信息 - * @param {String} file 配置文件名称 - * @param {String} key 配置参数键值 - */ -function getConfig(file, key) { - if (!file) { - return false - } - - const uniConfig = createConfig && createConfig({ - pluginId: 'uni-stat' - }) - - if (!uniConfig || !uniConfig.hasFile(file + '.json')) { - console.error('Not found the config file') - return false - } - - const config = uniConfig.requireFile(file) - - return key ? config[key] : config -} - -/** - * 休眠 - * @param {Object} ms 休眠时间(毫秒) - */ -function sleep(ms) { - return new Promise(resolve => setTimeout(() => resolve(), ms)) -} - -module.exports = { - hasOwn, - isPlainObject, - isFn, - deepClone, - parseUrlParams, - parseUrl, - getConfig, - sleep -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/lib/date.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/lib/date.js deleted file mode 100644 index 00417a1..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/lib/date.js +++ /dev/null @@ -1,371 +0,0 @@ -/** - * @class DateTime - * @description 日期处理模块 - */ -module.exports = class DateTime { - constructor() { - //默认日期展示格式 - this.defaultDateFormat = 'Y-m-d H:i:s' - //默认时区 - this.defaultTimezone = 8 - this.setTimeZone(this.defaultTimezone) - } - - /** - * 设置时区 - * @param {Number} timezone 时区 - */ - setTimeZone(timezone) { - if (timezone) { - this.timezone = parseInt(timezone) - } - return this - } - - /** - * 获取 Date对象 - * @param {Date|Time} time - */ - getDateObj(time) { - return time ? new Date(time) : new Date() - } - - /** - * 获取毫秒/秒级时间戳 - * @param {DateTime} datetime 日期 例:'2022-04-21 00:00:00' - * @param {Boolean} showSenconds 是否显示为秒级时间戳 - */ - getTime(datetime, showSenconds) { - let time = this.getDateObj(datetime).getTime() - if (showSenconds) { - time = Math.trunc(time / 1000) - } - return time - } - - /** - * 获取日期 - * @param {String} dateFormat 日期格式 - * @param {Time} time 时间戳 - */ - getDate(dateFormat, time) { - return this.dateFormat(dateFormat, time) - } - - - /** - * 获取日期在不同时区下的时间戳 - * @param {Date|Time}} time 日期或时间戳 - * @param {Object} timezone 时区 - */ - getTimeByTimeZone(time, timezone) { - this.setTimeZone(timezone) - const thisDate = time ? new Date(time) : new Date() - const localTime = thisDate.getTime() - const offset = thisDate.getTimezoneOffset() - const utc = offset * 60000 + localTime - return utc + (3600000 * this.timezone) - } - - /** - * 获取时间信息 - * @param {Time} time 时间戳 - * @param {Boolean} full 是否完整展示, 为true时小于10的位会自动补0 - */ - getTimeInfo(time, full = true) { - time = this.getTimeByTimeZone(time) - const date = this.getDateObj(time) - const retData = { - nYear: date.getFullYear(), - nMonth: date.getMonth() + 1, - nWeek: date.getDay() || 7, - nDay: date.getDate(), - nHour: date.getHours(), - nMinutes: date.getMinutes(), - nSeconds: date.getSeconds() - } - - if (full) { - for (const k in retData) { - if (retData[k] < 10) { - retData[k] = '0' + retData[k] - } - } - } - return retData - } - - /** - * 时间格式转换 - * @param {String} format 展示格式如:Y-m-d H:i:s - * @param {Time} time 时间戳 - */ - dateFormat(format, time) { - const timeInfo = this.getTimeInfo(time) - format = format || this.defaultDateFormat - let date = format - if (format.indexOf('Y') > -1) { - date = date.replace(/Y/, timeInfo.nYear) - } - if (format.indexOf('m') > -1) { - date = date.replace(/m/, timeInfo.nMonth) - } - if (format.indexOf('d') > -1) { - date = date.replace(/d/, timeInfo.nDay) - } - if (format.indexOf('H') > -1) { - date = date.replace(/H/, timeInfo.nHour) - } - if (format.indexOf('i') > -1) { - date = date.replace(/i/, timeInfo.nMinutes) - } - if (format.indexOf('s') > -1) { - date = date.replace(/s/, timeInfo.nSeconds) - } - return date - } - - /** - * 获取utc格式时间 - * @param {Date|Time} datetime 日期或时间戳 - */ - getUTC(datetime) { - return this.getDateObj(datetime).toUTCString() - } - - /** - * 获取ISO 格式时间 - * @param {Date|Time} datetime 日期或时间戳 - */ - getISO(datetime) { - return this.getDateObj(datetime).toISOString() - } - - /** - * 获取两时间相差天数 - * @param {Time} time1 时间戳 - * @param {Time} time2 时间戳 - */ - getDiffDays(time1, time2) { - if (!time1) { - return false - } - time2 = time2 ? time2 : this.getTime() - - let diffTime = time2 - time1 - if (diffTime < 0) { - diffTime = Math.abs(diffTime) - } - - return Math.ceil(diffTime / 86400000) - } - - /** - * 字符串转时间戳 - * @param {Object} str 字符串类型的时间戳 - */ - strToTime(str) { - if (Array.from(str).length === 10) { - str += '000' - } - return this.getTime(parseInt(str)) - } - - /** - * 根据设置的天数获取指定日期N天后(前)的时间戳 - * @param {Number} days 天数 - * @param {Date|Time} time 指定的日期或时间戳 - * @param {Boolean} getAll 是否获取完整时间戳,为 false 时返回指定日期初始时间戳(当天00:00:00的时间戳) - */ - getTimeBySetDays(days, time, getAll = false) { - const date = this.getDateObj(time) - date.setDate(date.getDate() + days) - let startTime = date.getTime() - if (!getAll) { - const realdate = this.getDate('Y-m-d 00:00:00', startTime) - startTime = this.getTimeByDateAndTimezone(realdate) - } - return startTime - } - - /** - * 根据设置的小时数获取指定日期N小时后(前)的时间戳 - * @param {Number} hours 小时数 - * @param {Date|Time} time 指定的日期或时间戳 - * @param {Boolean} getAll 是否获取完整时间戳,为 false 时返回指定时间初始时间戳(该小时00:00的时间戳) - */ - getTimeBySetHours(hours, time, getAll = false) { - const date = this.getDateObj(time) - date.setHours(date.getHours() + hours) - let startTime = date.getTime() - if (!getAll) { - const realdate = this.getDate('Y-m-d H:00:00', startTime) - startTime = this.getTimeByDateAndTimezone(realdate) - } - return startTime - } - - /** - * 根据设置的周数获取指定日期N周后(前)的时间戳 - * @param {Number} weeks 周数 - * @param {Date|Time} time 指定的日期或时间戳 - * @param {Boolean} getAll 是否获取完整时间戳,为 false 时返回指定日期初始时间戳(当天00:00:00的时间戳) - */ - getTimeBySetWeek(weeks, time, getAll = false) { - const date = this.getDateObj(time) - const dateInfo = this.getTimeInfo(time) - const day = dateInfo.nWeek - const offsetDays = 1 - day - weeks = weeks * 7 + offsetDays - date.setDate(date.getDate() + weeks) - let startTime = date.getTime() - if (!getAll) { - const realdate = this.getDate('Y-m-d 00:00:00', startTime) - startTime = this.getTimeByDateAndTimezone(realdate) - } - return startTime - } - - /** - * 根据设置的月数获取指定日期N月后(前)的时间戳 - * @param {Number} monthes 月数 - * @param {Date|Time} time 指定的日期或时间戳 - * @param {Boolean} getAll 是否获取完整时间戳,为 false 时返回指定日期初始时间戳(当天00:00:00的时间戳) - */ - getTimeBySetMonth(monthes, time, getAll = false) { - const date = this.getDateObj(time) - date.setMonth(date.getMonth() + monthes) - let startTime = date.getTime() - if (!getAll) { - const realdate = this.getDate('Y-m-01 00:00:00', startTime) - startTime = this.getTimeByDateAndTimezone(realdate) - } - return startTime - } - - /** - * 根据设置的季度数获取指定日期N个季度后(前)的时间戳 - * @param {Number} quarter 季度 - * @param {Date|Time} time 指定的日期或时间戳 - * @param {Boolean} getAll 是否获取完整时间戳,为 false 时返回指定日期初始时间戳(当天00:00:00的时间戳) - */ - getTimeBySetQuarter(quarter, time, getAll = false) { - const date = this.getDateObj(time) - const dateInfo = this.getTimeInfo(time) - date.setMonth(date.getMonth() + quarter * 3) - const month = date.getMonth() + 1; - let quarterN; - let mm; - if ([1,2,3].indexOf(month) > -1) { - // 第1季度 - mm = "01"; - } else if ([4,5,6].indexOf(month) > -1) { - // 第2季度 - mm = "04"; - } else if ([7,8,9].indexOf(month) > -1) { - // 第3季度 - mm = "07"; - } else if ([10,11,12].indexOf(month) > -1) { - // 第4季度 - mm = "10"; - } - let yyyy = date.getFullYear(); - let startTime = date.getTime() - if (!getAll) { - const realdate = this.getDate(`${yyyy}-${mm}-01 00:00:00`, startTime) - startTime = this.getTimeByDateAndTimezone(realdate) - } - return startTime - } - - /** - * 根据设置的年数获取指定日期N年后(前)的时间戳 - * @param {Number} year 月数 - * @param {Date|Time} time 指定的日期或时间戳 - * @param {Boolean} getAll 是否获取完整时间戳,为 false 时返回指定日期初始时间戳(当天00:00:00的时间戳) - */ - getTimeBySetYear(year, time, getAll = false) { - const date = this.getDateObj(time) - date.setFullYear(date.getFullYear() + year) - let startTime = date.getTime() - if (!getAll) { - const realdate = this.getDate('Y-01-01 00:00:00', startTime) - startTime = this.getTimeByDateAndTimezone(realdate) - } - return startTime - } - - - /** - * 根据时区获取指定时间的偏移时间 - * @param {Date|Time} 指定的日期或时间戳 - * @param {Number} timezone 时区 - */ - getTimeByDateAndTimezone(date, timezone) { - if (!timezone) { - timezone = this.timezone - } - const thisDate = this.getDateObj(date) - const thisTime = thisDate.getTime() - const offset = thisDate.getTimezoneOffset() - const offsetTime = offset * 60000 + timezone * 3600000 - return thisTime - offsetTime - } - - /** - * 根据指定的时间类型获取时间范围 - * @param {String} type 时间类型 hour:小时 day:天 week:周 month:月 - * @param {Number} offset 时间的偏移量 - * @param {Date|Time} thistime 指定的日期或时间戳 - * @param {Boolean} getAll 是否获取完整时间戳,为 false 时返回指定日期初始时间戳(当天00:00:00的时间戳) - */ - getTimeDimensionByType(type, offset = 0, thistime, getAll = false) { - let startTime = 0 - let endTime = 0 - switch (type) { - case 'hour': { - startTime = this.getTimeBySetHours(offset, thistime, getAll) - endTime = getAll ? startTime : startTime + 3599999 - break - } - case 'day': { - startTime = this.getTimeBySetDays(offset, thistime, getAll) - endTime = getAll ? startTime : startTime + 86399999 - break - } - case 'week': { - startTime = this.getTimeBySetWeek(offset, thistime, getAll) - endTime = getAll ? startTime + 86400000 * 6 : startTime + 86400000 * 6 + 86399999 - break - } - case 'month': { - startTime = this.getTimeBySetMonth(offset, thistime, getAll) - const date = this.getDateObj(this.getDate('Y-m-d H:i:s', startTime)) - const nextMonthFirstDayTime = new Date(date.getFullYear(), date.getMonth() + 1, 1).getTime() - endTime = getAll ? nextMonthFirstDayTime - 86400000 : this.getTimeByDateAndTimezone( - nextMonthFirstDayTime) - 1 - break - } - case 'quarter': { - startTime = this.getTimeBySetQuarter(offset, thistime, getAll) - const date = this.getDateObj(this.getDate('Y-m-d H:i:s', startTime)) - const nextMonthFirstDayTime = new Date(date.getFullYear(), date.getMonth() + 3, 1).getTime() - endTime = getAll ? nextMonthFirstDayTime - 86400000 : this.getTimeByDateAndTimezone( - nextMonthFirstDayTime) - 1 - break - } - case 'year': { - startTime = this.getTimeBySetYear(offset, thistime, getAll) - const date = this.getDateObj(this.getDate('Y-m-d H:i:s', startTime)) - const nextFirstDayTime = new Date(date.getFullYear() + 1, 0, 1).getTime() - endTime = getAll ? nextFirstDayTime - 86400000 : this.getTimeByDateAndTimezone( - nextFirstDayTime) - 1 - break - } - } - return { - startTime, - endTime - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/lib/index.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/lib/index.js deleted file mode 100644 index 4ccab05..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/lib/index.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - DateTime: require('./date'), - UniCrypto: require('./uni-crypto') -} \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/lib/uni-crypto.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/lib/uni-crypto.js deleted file mode 100644 index d5cdc8d..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/lib/uni-crypto.js +++ /dev/null @@ -1,98 +0,0 @@ -/** - * @class UniCrypto 数据加密服务 - * @function init 初始化函数 - * @function showConfig 返回配置信息函数 - * @function getCrypto 返回原始crypto对象函数 - * @function aesEncode AES加密函数 - * @function aesDecode AES解密函数 - * @function md5 MD5加密函数 - */ -const crypto = require('crypto') -module.exports = class UniCrypto { - constructor(config) { - this.init(config) - } - - /** - * 配置初始化函数 - * @param {Object} config - */ - init(config) { - this.config = { - //AES加密默认参数 - AES: { - mod: 'aes-128-cbc', - pasword: 'UniStat!010', - iv: 'UniStativ', - charset: 'utf8', - encodeReturnType: 'base64' - }, - //MD5加密默认参数 - MD5: { - encodeReturnType: 'hex' - }, - ...config || {} - } - return this - } - - /** - * 返回配置信息函数 - */ - showConfig() { - return this.config - } - - /** - * 返回原始crypto对象函数 - */ - getCrypto() { - return crypto - } - - /** - * AES加密函数 - * @param {String} data 加密数据明文 - * @param {String} encodeReturnType 返回加密数据类型,如:base64 - * @param {String} key 密钥 - * @param {String} iv 偏移量 - * @param {String} mod 模式 - * @param {String} charset 编码 - */ - aesEncode(data, encodeReturnType, key, iv, mod, charset) { - const cipher = crypto.createCipheriv(mod || this.config.AES.mod, key || this.config.AES.pasword, iv || - this.config.AES.iv) - let crypted = cipher.update(data, charset || this.config.AES.charset, 'binary') - crypted += cipher.final('binary') - crypted = Buffer.from(crypted, 'binary').toString(encodeReturnType || this.config.AES.encodeReturnType) - return crypted - } - - /** - * AES解密函数 - * @param {Object} crypted 加密数据密文 - * @param {Object} encodeReturnType 返回加密数据类型,如:base64 - * @param {Object} key 密钥 - * @param {Object} iv 偏移量 - * @param {Object} mod 模式 - * @param {Object} charset 编码 - */ - aesDecode(crypted, encodeReturnType, key, iv, mod, charset) { - crypted = Buffer.from(crypted, encodeReturnType || this.config.AES.encodeReturnType).toString('binary') - const decipher = crypto.createDecipheriv(mod || this.config.AES.mod, key || this.config.AES.pasword, - iv || this.config.AES.iv) - let decoded = decipher.update(crypted, 'binary', charset || this.config.AES.charset) - decoded += decipher.final(charset || this.config.AES.charset) - return decoded - } - - /** - * @param {Object} str 加密字符串 - * @param {Object} encodeReturnType encodeReturnType 返回加密数据类型,如:hex(转为16进制) - */ - md5(str, encodeReturnType) { - const md5Mod = crypto.createHash('md5') - md5Mod.update(str) - return md5Mod.digest(encodeReturnType || this.config.MD5.encodeReturnType) - } -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/activeDevices.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/activeDevices.js deleted file mode 100644 index dd61a45..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/activeDevices.js +++ /dev/null @@ -1,528 +0,0 @@ -/** - * @class ActiveDevices 活跃设备模型 - 每日跑批合并,仅添加本周/本月首次访问的设备。 - */ -const BaseMod = require('./base') -const Platform = require('./platform') -const Channel = require('./channel') -const Version = require('./version') -const SessionLog = require('./sessionLog') -const { - DateTime, - UniCrypto -} = require('../lib') -module.exports = class ActiveDevices extends BaseMod { - constructor() { - super() - this.tableName = 'active-devices' - this.platforms = [] - this.channels = [] - this.versions = [] - } - - /** - * @desc 活跃设备统计 - 为周统计/月统计提供周活/月活数据 - * @param {date|time} date - * @param {bool} reset - */ - async stat(date, reset) { - const dateTime = new DateTime() - const dateDimension = dateTime.getTimeDimensionByType('day', -1, date) - this.startTime = dateDimension.startTime - // 查看当前时间段数据是否已存在,防止重复生成 - if (!reset) { - const checkRes = await this.getCollection(this.tableName).where({ - create_time: { - $gte: dateDimension.startTime, - $lte: dateDimension.endTime - } - }).get() - if (checkRes.data.length > 0) { - console.log('data have exists') - return { - code: 1003, - msg: 'Devices data in this time have already existed' - } - } - } else { - const delRes = await this.delete(this.tableName, { - create_time: { - $gte: dateDimension.startTime, - $lte: dateDimension.endTime - } - }) - console.log('Delete old data result:', JSON.stringify(delRes)) - } - - const sessionLog = new SessionLog() - const statRes = await this.aggregate(sessionLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - is_first_visit: 1, - create_time: 1, - device_id: 1 - }, - match: { - create_time: { - $gte: dateDimension.startTime, - $lte: dateDimension.endTime - } - }, - group: { - _id: { - appid: '$appid', - version: '$version', - platform: '$platform', - channel: '$channel', - device_id: '$device_id' - }, - is_new: { - $max: '$is_first_visit' - }, - create_time: { - $min: '$create_time' - } - }, - sort: { - create_time: 1 - }, - getAll: true - }) - - let res = { - code: 0, - msg: 'success' - } - // if (this.debug) { - // console.log('statRes', JSON.stringify(statRes)) - // } - if (statRes.data.length > 0) { - const uniCrypto = new UniCrypto() - // 同应用、平台、渠道、版本的数据合并 - const statData = []; - let statKey; - let data - - const statOldRes = await this.aggregate(sessionLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - is_first_visit: 1, - create_time: 1, - old_device_id: 1 - }, - match: { - create_time: { - $gte: dateDimension.startTime, - $lte: dateDimension.endTime - }, - old_device_id: {$exists: true} - }, - group: { - _id: { - appid: '$appid', - version: '$version', - platform: '$platform', - channel: '$channel', - old_device_id: '$old_device_id' - }, - create_time: { - $min: '$create_time' - } - }, - sort: { - create_time: 1 - }, - getAll: true - }) - if (this.debug) { - console.log('statOldRes', JSON.stringify(statOldRes)) - } - for (const sti in statRes.data) { - data = statRes.data[sti] - statKey = uniCrypto.md5(data._id.appid + data._id.platform + data._id.version + data._id - .channel) - if (!statData[statKey]) { - statData[statKey] = { - appid: data._id.appid, - platform: data._id.platform, - version: data._id.version, - channel: data._id.channel, - device_ids: [], - old_device_ids: [], - info: [], - old_info: [] - } - statData[statKey].device_ids.push(data._id.device_id) - statData[statKey].info[data._id.device_id] = { - is_new: data.is_new, - create_time: data.create_time - } - } else { - statData[statKey].device_ids.push(data._id.device_id) - statData[statKey].info[data._id.device_id] = { - is_new: data.is_new, - create_time: data.create_time - } - } - } - if(statOldRes.data.length) { - const oldDeviceIds = [] - for(const osti in statOldRes.data) { - if(!statOldRes.data[osti]._id.old_device_id) { - continue - } - oldDeviceIds.push(statOldRes.data[osti]._id.old_device_id) - } - if(oldDeviceIds.length) { - const statOldDidRes = await this.aggregate(sessionLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - is_first_visit: 1, - create_time: 1, - device_id: 1 - }, - match: { - create_time: { - $gte: dateDimension.startTime, - $lte: dateDimension.endTime - }, - device_id: {$in: oldDeviceIds} - }, - group: { - _id: { - appid: '$appid', - version: '$version', - platform: '$platform', - channel: '$channel', - old_device_id: '$device_id' - }, - create_time: { - $min: '$create_time' - } - }, - sort: { - create_time: 1 - }, - getAll: true - }) - - if(statOldDidRes.data.length){ - for(const osti in statOldDidRes.data) { - data = statOldDidRes.data[osti] - statKey = uniCrypto.md5(data._id.appid + data._id.platform + data._id.version + data._id - .channel) - if(!data._id.old_device_id) { - continue - } - - if (!statData[statKey]) { - statData[statKey] = { - appid: data._id.appid, - platform: data._id.platform, - version: data._id.version, - channel: data._id.channel, - device_ids: [], - old_device_ids: [], - old_info: [] - } - statData[statKey].old_device_ids.push(data._id.old_device_id) - } else { - statData[statKey].old_device_ids.push(data._id.old_device_id) - } - if(!statData[statKey].old_info[data._id.old_device_id]) { - statData[statKey].old_info[data._id.old_device_id] = { - create_time: data.create_time - } - } - } - } - } - } - this.fillData = [] - for (const sk in statData) { - await this.getFillData(statData[sk]) - } - - if (this.fillData.length > 0) { - res = await this.batchInsert(this.tableName, this.fillData) - } - } - return res - } - - /** - * 获取填充数据 - * @param {Object} data - */ - async getFillData(data) { - // 平台信息 - let platformInfo = null - if (this.platforms && this.platforms[data.platform]) { - platformInfo = this.platforms[data.platform] - } else { - const platform = new Platform() - platformInfo = await platform.getPlatformAndCreate(data.platform, null) - if (!platformInfo || platformInfo.length === 0) { - platformInfo._id = '' - } - this.platforms[data.platform] = platformInfo - if (this.debug) { - console.log('platformInfo', JSON.stringify(platformInfo)) - } - } - - // 渠道信息 - let channelInfo = null - const channelKey = data.appid + '_' + platformInfo._id + '_' + data.channel - if (this.channels && this.channels[channelKey]) { - channelInfo = this.channels[channelKey] - } else { - const channel = new Channel() - channelInfo = await channel.getChannelAndCreate(data.appid, platformInfo._id, data.channel) - if (!channelInfo || channelInfo.length === 0) { - channelInfo._id = '' - } - this.channels[channelKey] = channelInfo - if (this.debug) { - console.log('channelInfo', JSON.stringify(channelInfo)) - } - } - - // 版本信息 - let versionInfo = null - const versionKey = data.appid + '_' + data.platform + '_' + data.version - if (this.versions && this.versions[versionKey]) { - versionInfo = this.versions[versionKey] - } else { - const version = new Version() - versionInfo = await version.getVersionAndCreate(data.appid, data.platform, data.version) - if (!versionInfo || versionInfo.length === 0) { - versionInfo._id = '' - } - this.versions[versionKey] = versionInfo - if (this.debug) { - console.log('versionInfo', JSON.stringify(versionInfo)) - } - } - - const datetime = new DateTime() - const dateDimension = datetime.getTimeDimensionByType('week', 0, this.startTime) - const dateMonthDimension = datetime.getTimeDimensionByType('month', 0, this.startTime) - - if(data.device_ids) { - // 取出本周已经存储的device_id - const weekHaveDeviceList = [] - const haveWeekList = await this.selectAll(this.tableName, { - appid: data.appid, - version_id: versionInfo._id, - platform_id: platformInfo._id, - channel_id: channelInfo._id, - device_id: { - $in: data.device_ids - }, - dimension: 'week', - create_time: { - $gte: dateDimension.startTime, - $lte: dateDimension.endTime - } - }, { - device_id: 1 - }) - if (haveWeekList.data.length > 0) { - for (const hui in haveWeekList.data) { - weekHaveDeviceList.push(haveWeekList.data[hui].device_id) - } - } - if (this.debug) { - console.log('weekHaveDeviceList', JSON.stringify(weekHaveDeviceList)) - } - - // 取出本月已经存储的device_id - const monthHaveDeviceList = [] - const haveMonthList = await this.selectAll(this.tableName, { - appid: data.appid, - version_id: versionInfo._id, - platform_id: platformInfo._id, - channel_id: channelInfo._id, - device_id: { - $in: data.device_ids - }, - dimension: 'month', - create_time: { - $gte: dateMonthDimension.startTime, - $lte: dateMonthDimension.endTime - } - }, { - device_id: 1 - }) - if (haveMonthList.data.length > 0) { - for (const hui in haveMonthList.data) { - monthHaveDeviceList.push(haveMonthList.data[hui].device_id) - } - } - if (this.debug) { - console.log('monthHaveDeviceList', JSON.stringify(monthHaveDeviceList)) - } - //数据填充 - for (const ui in data.device_ids) { - //周活跃数据填充 - if (!weekHaveDeviceList.includes(data.device_ids[ui])) { - this.fillData.push({ - appid: data.appid, - platform_id: platformInfo._id, - channel_id: channelInfo._id, - version_id: versionInfo._id, - is_new: data.info[data.device_ids[ui]].is_new, - device_id: data.device_ids[ui], - dimension: 'week', - create_time: data.info[data.device_ids[ui]].create_time - }) - } - //月活跃数据填充 - if (!monthHaveDeviceList.includes(data.device_ids[ui])) { - this.fillData.push({ - appid: data.appid, - platform_id: platformInfo._id, - channel_id: channelInfo._id, - version_id: versionInfo._id, - is_new: data.info[data.device_ids[ui]].is_new, - device_id: data.device_ids[ui], - dimension: 'month', - create_time: data.info[data.device_ids[ui]].create_time - }) - } - } - } - - if(data.old_device_ids) { - // 取出本周已经存储的old_device_id - const weekHaveOldDeviceList = [] - const haveOldWeekList = await this.selectAll(this.tableName, { - appid: data.appid, - version_id: versionInfo._id, - platform_id: platformInfo._id, - channel_id: channelInfo._id, - device_id: { - $in: data.old_device_ids - }, - dimension: 'week-old', - create_time: { - $gte: dateDimension.startTime, - $lte: dateDimension.endTime - } - }, { - device_id: 1 - }) - if (haveOldWeekList.data.length > 0) { - for (const hui in haveOldWeekList.data) { - weekHaveOldDeviceList.push(haveOldWeekList.data[hui].device_id) - } - } - if (this.debug) { - console.log('weekHaveOldDeviceList', JSON.stringify(weekHaveOldDeviceList)) - } - - // 取出本月已经存储的old_device_id - const monthHaveOldDeviceList = [] - const haveOldMonthList = await this.selectAll(this.tableName, { - appid: data.appid, - version_id: versionInfo._id, - platform_id: platformInfo._id, - channel_id: channelInfo._id, - device_id: { - $in: data.old_device_ids - }, - dimension: 'month-old', - create_time: { - $gte: dateMonthDimension.startTime, - $lte: dateMonthDimension.endTime - } - }, { - device_id: 1 - }) - if (haveOldMonthList.data.length > 0) { - for (const hui in haveOldMonthList.data) { - monthHaveOldDeviceList.push(haveOldMonthList.data[hui].device_id) - } - } - if (this.debug) { - console.log('monthHaveOldDeviceList', JSON.stringify(monthHaveOldDeviceList)) - } - //数据填充 - for (const ui in data.old_device_ids) { - //周活跃数据填充 - if (!weekHaveOldDeviceList.includes(data.old_device_ids[ui])) { - this.fillData.push({ - appid: data.appid, - platform_id: platformInfo._id, - channel_id: channelInfo._id, - version_id: versionInfo._id, - is_new: 0, - device_id: data.old_device_ids[ui], - dimension: 'week-old', - create_time: data.old_info[data.old_device_ids[ui]].create_time - }) - } - //月活跃数据填充 - if (!monthHaveOldDeviceList.includes(data.old_device_ids[ui])) { - this.fillData.push({ - appid: data.appid, - platform_id: platformInfo._id, - channel_id: channelInfo._id, - version_id: versionInfo._id, - is_new: 0, - device_id: data.old_device_ids[ui], - dimension: 'month-old', - create_time: data.old_info[data.old_device_ids[ui]].create_time - }) - } - } - } - - return true - } - - /** - * 日志清理,此处日志为临时数据并不需要自定义清理,默认为固定值即可 - */ - async clean() { - // 清除周数据,周留存统计最高需要10周数据,多余的为无用数据 - const weeks = 10 - console.log('Clean device\'s weekly logs - week:', weeks) - - const dateTime = new DateTime() - - const res = await this.delete(this.tableName, { - dimension: 'week', - create_time: { - $lt: dateTime.getTimeBySetWeek(0 - weeks) - } - }) - - if (!res.code) { - console.log('Clean device\'s weekly logs - res:', res) - } - - // 清除月数据,月留存统计最高需要10个月数据,多余的为无用数据 - const monthes = 10 - console.log('Clean device\'s monthly logs - month:', monthes) - const monthRes = await this.delete(this.tableName, { - dimension: 'month', - create_time: { - $lt: dateTime.getTimeBySetMonth(0 - monthes) - } - }) - if (!monthRes.code) { - console.log('Clean device\'s monthly logs - res:', res) - } - return monthRes - } -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/activeUsers.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/activeUsers.js deleted file mode 100644 index 1b40228..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/activeUsers.js +++ /dev/null @@ -1,314 +0,0 @@ -/** - * @class ActiveUsers 活跃用户模型 - 每日跑批合并,仅添加本周/本月首次访问的用户。 - */ -const BaseMod = require('./base') -const Platform = require('./platform') -const Channel = require('./channel') -const Version = require('./version') -const UserSessionLog = require('./userSessionLog') -const { - DateTime, - UniCrypto -} = require('../lib') -module.exports = class ActiveUsers extends BaseMod { - constructor() { - super() - this.tableName = 'active-users' - this.platforms = [] - this.channels = [] - this.versions = [] - } - - async stat(date, reset) { - const dateTime = new DateTime() - const dateDimension = dateTime.getTimeDimensionByType('day', -1, date) - this.startTime = dateDimension.startTime - // 查看当前时间段数据是否已存在,防止重复生成 - if (!reset) { - const checkRes = await this.getCollection(this.tableName).where({ - create_time: { - $gte: dateDimension.startTime, - $lte: dateDimension.endTime - } - }).get() - if (checkRes.data.length > 0) { - console.log('data have exists') - return { - code: 1003, - msg: 'Users data in this time have already existed' - } - } - } else { - const delRes = await this.delete(this.tableName, { - create_time: { - $gte: dateDimension.startTime, - $lte: dateDimension.endTime - } - }) - console.log('Delete old data result:', JSON.stringify(delRes)) - } - - const userSessionLog = new UserSessionLog() - const statRes = await this.aggregate(userSessionLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - create_time: 1, - uid: 1 - }, - match: { - create_time: { - $gte: dateDimension.startTime, - $lte: dateDimension.endTime - } - }, - group: { - _id: { - appid: '$appid', - version: '$version', - platform: '$platform', - channel: '$channel', - uid: '$uid' - }, - create_time: { - $min: '$create_time' - } - }, - sort: { - create_time: 1 - }, - getAll: true - }) - - let res = { - code: 0, - msg: 'success' - } - // if (this.debug) { - // console.log('statRes', JSON.stringify(statRes)) - // } - if (statRes.data.length > 0) { - const uniCrypto = new UniCrypto() - // 同应用、平台、渠道、版本的数据合并 - const statData = []; - let statKey; - let data - - for (const sti in statRes.data) { - data = statRes.data[sti] - statKey = uniCrypto.md5(data._id.appid + data._id.platform + data._id.version + data._id - .channel) - if (!statData[statKey]) { - statData[statKey] = { - appid: data._id.appid, - platform: data._id.platform, - version: data._id.version, - channel: data._id.channel, - uids: [], - info: [] - } - statData[statKey].uids.push(data._id.uid) - statData[statKey].info[data._id.uid] = { - create_time: data.create_time - } - } else { - statData[statKey].uids.push(data._id.uid) - statData[statKey].info[data._id.uid] = { - create_time: data.create_time - } - } - } - - this.fillData = [] - for (const sk in statData) { - await this.getFillData(statData[sk]) - } - - if (this.fillData.length > 0) { - res = await this.batchInsert(this.tableName, this.fillData) - } - } - return res - } - - async getFillData(data) { - // 平台信息 - let platformInfo = null - if (this.platforms && this.platforms[data.platform]) { - platformInfo = this.platforms[data.platform] - } else { - const platform = new Platform() - platformInfo = await platform.getPlatformAndCreate(data.platform, null) - if (!platformInfo || platformInfo.length === 0) { - platformInfo._id = '' - } - this.platforms[data.platform] = platformInfo - if (this.debug) { - console.log('platformInfo', JSON.stringify(platformInfo)) - } - } - - // 渠道信息 - let channelInfo = null - const channelKey = data.appid + '_' + platformInfo._id + '_' + data.channel - if (this.channels && this.channels[channelKey]) { - channelInfo = this.channels[channelKey] - } else { - const channel = new Channel() - channelInfo = await channel.getChannelAndCreate(data.appid, platformInfo._id, data.channel) - if (!channelInfo || channelInfo.length === 0) { - channelInfo._id = '' - } - this.channels[channelKey] = channelInfo - if (this.debug) { - console.log('channelInfo', JSON.stringify(channelInfo)) - } - } - - // 版本信息 - let versionInfo = null - const versionKey = data.appid + '_' + data.platform + '_' + data.version - if (this.versions && this.versions[versionKey]) { - versionInfo = this.versions[versionKey] - } else { - const version = new Version() - versionInfo = await version.getVersionAndCreate(data.appid, data.platform, data.version) - if (!versionInfo || versionInfo.length === 0) { - versionInfo._id = '' - } - this.versions[versionKey] = versionInfo - if (this.debug) { - console.log('versionInfo', JSON.stringify(versionInfo)) - } - } - - // 是否在本周内已存在 - const datetime = new DateTime() - const dateDimension = datetime.getTimeDimensionByType('week', 0, this.startTime) - - // 取出本周已经存储的uid - const weekHaveUserList = [] - const haveWeekList = await this.selectAll(this.tableName, { - appid: data.appid, - version_id: versionInfo._id, - platform_id: platformInfo._id, - channel_id: channelInfo._id, - uid: { - $in: data.uids - }, - dimension: 'week', - create_time: { - $gte: dateDimension.startTime, - $lte: dateDimension.endTime - } - }, { - uid: 1 - }) - - if (this.debug) { - console.log('haveWeekList', JSON.stringify(haveWeekList)) - } - - if (haveWeekList.data.length > 0) { - for (const hui in haveWeekList.data) { - weekHaveUserList.push(haveWeekList.data[hui].uid) - } - } - - // 取出本月已经存储的uid - const dateMonthDimension = datetime.getTimeDimensionByType('month', 0, this.startTime) - const monthHaveUserList = [] - const haveMonthList = await this.selectAll(this.tableName, { - appid: data.appid, - version_id: versionInfo._id, - platform_id: platformInfo._id, - channel_id: channelInfo._id, - uid: { - $in: data.uids - }, - dimension: 'month', - create_time: { - $gte: dateMonthDimension.startTime, - $lte: dateMonthDimension.endTime - } - }, { - uid: 1 - }) - - if (this.debug) { - console.log('haveMonthList', JSON.stringify(haveMonthList)) - } - - if (haveMonthList.data.length > 0) { - for (const hui in haveMonthList.data) { - monthHaveUserList.push(haveMonthList.data[hui].uid) - } - } - - for (const ui in data.uids) { - if (!weekHaveUserList.includes(data.uids[ui])) { - this.fillData.push({ - appid: data.appid, - platform_id: platformInfo._id, - channel_id: channelInfo._id, - version_id: versionInfo._id, - uid: data.uids[ui], - dimension: 'week', - create_time: data.info[data.uids[ui]].create_time - }) - } - - if (!monthHaveUserList.includes(data.uids[ui])) { - this.fillData.push({ - appid: data.appid, - platform_id: platformInfo._id, - channel_id: channelInfo._id, - version_id: versionInfo._id, - uid: data.uids[ui], - dimension: 'month', - create_time: data.info[data.uids[ui]].create_time - }) - } - } - - return true - } - - /** - * 日志清理,此处日志为临时数据并不需要自定义清理,默认为固定值即可 - */ - async clean() { - // 清除周数据,周留存统计最高需要10周数据,多余的为无用数据 - const weeks = 10 - console.log('Clean user\'s weekly logs - week:', weeks) - - const dateTime = new DateTime() - - const res = await this.delete(this.tableName, { - dimension: 'week', - create_time: { - $lt: dateTime.getTimeBySetWeek(0 - weeks) - } - }) - - if (!res.code) { - console.log('Clean user\'s weekly logs - res:', res) - } - - // 清除月数据,月留存统计最高需要10个月数据,多余的为无用数据 - const monthes = 10 - console.log('Clean user\'s monthly logs - month:', monthes) - const monthRes = await this.delete(this.tableName, { - dimension: 'month', - create_time: { - $lt: dateTime.getTimeBySetMonth(0 - monthes) - } - }) - if (!monthRes.code) { - console.log('Clean user\'s monthly logs - res:', res) - } - return monthRes - } -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/appCrashLogs.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/appCrashLogs.js deleted file mode 100644 index 34c53a8..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/appCrashLogs.js +++ /dev/null @@ -1,107 +0,0 @@ -/** - * @class AppCrashLogs 原生应用崩溃日志模型 - * @function clean 原生应用崩溃日志清理函数 - */ -const BaseMod = require('./base') -const Platform = require('./platform') -const Channel = require('./channel') -const { - DateTime, - UniCrypto -} = require('../lib') -module.exports = class AppCrashLogs extends BaseMod { - constructor() { - super() - this.tableName = 'app-crash-logs' - } - - /** - * 原生应用崩溃日志填充 - * @param {Object} reportParams 上报参数 - */ - async fill(reportParams) { - const platform = new Platform() - const channel = new Channel() - const dateTime = new DateTime() - const fillParams = [] - - for (let params of reportParams) { - fillParams.push({ - appid: params.ak, - version: params.v || '', - platform: platform.getPlatformCode(params.ut, params.p), - channel: channel.getChannelCode(params), - sdk_version: params.vb || '', - device_id: params.did, - device_net: params.net || '', - device_os: params.os || '', - device_os_name: params.on ? params.on : platform.getOsName(params.p), - device_os_version: params.sv || '', - device_vendor: params.brand || '', - device_model: params.md || '', - device_is_root: params.root ? parseInt(params.root) : 0, - device_batt_level: params.batlevel ? parseInt(params.batlevel) : 0, - device_batt_temp: params.battemp ? parseInt(params.battemp) : 0, - device_memory_use_size: params.memuse ? parseInt(params.memuse) : 0, - device_memory_total_size: params.memtotal ? parseInt(params.memtotal) : 0, - device_disk_use_size: params.diskuse ? parseInt(params.diskuse) : 0, - device_disk_total_size: params.disktotal ? parseInt(params.disktotal) : 0, - device_abis: params.abis ? params.abis : '', - app_count: params.appcount ? parseInt(params.appcount) : 0, - app_use_memory_size: params.mem ? parseInt(params.mem) : 0, - app_webview_count: params.wvcount ? parseInt(params.wvcount) : 0, - app_use_duration: params.duration ? parseInt(params.duration) : 0, - app_run_fore: params.fore ? parseInt(params.fore) : 0, - package_name: params.pn || '', - package_version: params.pv || '', - page_url: params.url, - error_msg: params.log || '', - create_time: dateTime.getTime() - }) - } - - if (fillParams.length === 0) { - console.log('No app crash log params') - return { - code: 200, - msg: 'Invild param' - } - } - - //日志数据入库 - const res = await this.insert(this.tableName, fillParams) - if (res && res.inserted) { - return { - code: 0, - msg: 'success' - } - } else { - return { - code: 500, - msg: 'Filled error' - } - } - } - - /** - * 原生应用崩溃日志清理函数 - * @param {Number} days 保留天数, 0为永久保留 - */ - async clean(days = 7) { - if (days === 0) { - return false; - } - days = Math.max(parseInt(days), 1) - console.log('clean app crash logs - day:', days) - const dateTime = new DateTime() - const res = await this.delete(this.tableName, { - create_time: { - $lt: dateTime.getTimeBySetDays(0 - days) - } - }) - if (!res.code) { - console.log('clean app crash log:', res) - } - return res - } -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/base.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/base.js deleted file mode 100644 index afd80d6..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/base.js +++ /dev/null @@ -1,489 +0,0 @@ -/** - * @class BaseMod 数据模型基类,提供基础服务支持 - */ -const { - getConfig -} = require('../../shared') -//基类 -module.exports = class BaseMod { - constructor() { - //配置信息 - this.config = getConfig('config') - //开启/关闭debug - this.debug = this.config.debug - //主键 - this.primaryKey = '_id' - //单次查询最多返回 500 条数据(阿里云500,腾讯云1000,这里取最小值) - this.selectMaxLimit = 500 - //数据表前缀 - this.tablePrefix = 'uni-stat' - //数据表连接符 - this.tableConnectors = '-' - //数据表名 - this.tableName = '' - //参数 - this.params = {} - //数据库连接 - this._dbConnection() - //redis连接 - this._redisConnection() - } - - /** - * 建立uniCloud数据库连接 - */ - _dbConnection() { - if (!this.db) { - try { - this.db = uniCloud.database() - this.dbCmd = this.db.command - this.dbAggregate = this.dbCmd.aggregate - } catch (e) { - console.error('database connection failed: ' + e) - throw new Error('database connection failed: ' + e) - } - } - } - - /** - * 建立uniCloud redis连接 - */ - _redisConnection() { - if (this.config.redis && !this.redis) { - try { - this.redis = uniCloud.redis() - } catch (e) { - console.log('redis server connection failed: ' + e) - } - } - } - - /** - * 获取uni统计配置项 - * @param {String} key - */ - getConfig(key) { - return this.config[key] - } - - /** - * 获取带前缀的数据表名称 - * @param {String} tab 表名 - * @param {Boolean} useDBPre 是否使用数据表前缀 - */ - getTableName(tab, useDBPre = true) { - tab = tab || this.tableName - const table = (useDBPre && this.tablePrefix && tab.indexOf(this.tablePrefix) !== 0) ? this.tablePrefix + this - .tableConnectors + tab : tab - return table - } - - /** - * 获取数据集 - * @param {String} tab表名 - * @param {Boolean} useDBPre 是否使用数据表前缀 - */ - getCollection(tab, useDBPre = true) { - return this.db.collection(this.getTableName(tab, useDBPre)) - } - - /** - * 获取reids缓存 - * @param {String} key reids缓存键值 - */ - async getCache(key) { - if (!this.redis || !key) { - return false - } - let cacheResult = await this.redis.get(key) - - if (this.debug) { - console.log('get cache result by key:' + key, cacheResult) - } - - if (cacheResult) { - try { - cacheResult = JSON.parse(cacheResult) - } catch (e) { - if (this.debug) { - console.log('json parse error: ' + e) - } - } - } - return cacheResult - } - - /** - * 设置redis缓存 - * @param {String} key 键值 - * @param {String} val 值 - * @param {Number} expireTime 过期时间 - */ - async setCache(key, val, expireTime) { - if (!this.redis || !key) { - return false - } - - if (val instanceof Object) { - val = JSON.stringify(val) - } - - if (this.debug) { - console.log('set cache result by key:' + key, val) - } - - return await this.redis.set(key, val, 'EX', expireTime || this.config.cachetime) - } - - /** - * 清除redis缓存 - * @param {String} key 键值 - */ - async clearCache(key) { - if (!this.redis || !key) { - return false - } - - if (this.debug) { - console.log('delete cache by key:' + key) - } - - return await this.redis.del(key) - } - - getCacheKeyByParams(params) { - return Object.keys(params).map((key) => key + ':' + params[key]).join('-') - } - - /** - * 通过数据表主键(_id)获取数据 - * @param {String} tab 表名 - * @param {String} id 主键值 - * @param {Boolean} useDBPre 是否使用数据表前缀 - */ - async getById(tab, id, useDBPre = true) { - const condition = {} - condition[this.primaryKey] = id - const info = await this.getCollection(tab, useDBPre).where(condition).get() - return (info && info.data.length > 0) ? info.data[0] : [] - } - - /** - * 插入数据到数据表 - * @param {String} tab 表名 - * @param {Object} params 字段参数 - * @param {Boolean} useDBPre 是否使用数据表前缀 - */ - async insert(tab, params, useDBPre = true) { - params = params || this.params - return await this.getCollection(tab, useDBPre).add(params) - } - - /** - * 修改数据表数据 - * @param {String} tab 表名 - * @param {Object} params 字段参数 - * @param {Object} condition 条件 - * @param {Boolean} useDBPre 是否使用数据表前缀 - */ - async update(tab, params, condition, useDBPre = true) { - params = params || this.params - return await this.getCollection(tab).where(condition).update(params) - } - - /** - * 删除数据表数据 - * @param {String} tab 表名 - * @param {Object} condition 条件 - * @param {Boolean} useDBPre 是否使用数据表前缀 - */ - async delete(tab, condition, useDBPre = true) { - if (!condition) { - return false - } - return await this.getCollection(tab, useDBPre).where(condition).remove() - } - - /** - * 批量插入 - 云服务空间对单条mongo语句执行时间有限制,所以批量插入需限制每次执行条数 - * @param {String} tab 表名 - * @param {Object} data 数据集合 - * @param {Boolean} useDBPre 是否使用数据表前缀 - */ - async batchInsert(tab, data, useDBPre = true) { - let batchInsertNum = this.getConfig('batchInsertNum') || 1000 - batchInsertNum = Math.min(batchInsertNum, 1000) // 兼容支付宝云最大1000 - const insertNum = Math.ceil(data.length / batchInsertNum) - let start; - let end; - let fillData; - let insertRes; - const res = { - code: 0, - msg: 'success', - data: { - inserted: 0 - } - } - for (let p = 0; p < insertNum; p++) { - start = p * batchInsertNum - end = Math.min(start + batchInsertNum, data.length) - fillData = [] - for (let i = start; i < end; i++) { - fillData.push(data[i]) - } - if (fillData.length > 0) { - insertRes = await this.insert(tab, fillData, useDBPre) - if (insertRes && insertRes.inserted) { - res.data.inserted += insertRes.inserted - } - } - } - return res - } - - /** - * 批量删除 - 云服务空间对单条mongo语句执行时间有限制,所以批量删除需限制每次执行条数 - * @param {String} tab 表名 - * @param {Object} condition 条件 - * @param {Boolean} useDBPre 是否使用数据表前缀 - */ - async batchDelete(tab, condition, useDBPre = true) { - const batchDeletetNum = 5000; - let deleteIds; - let delRes; - let thisCondition - const res = { - code: 0, - msg: 'success', - data: { - deleted: 0 - } - } - let run = true - while (run) { - const dataRes = await this.getCollection(tab).where(condition).limit(batchDeletetNum).get() - if (dataRes && dataRes.data.length > 0) { - deleteIds = [] - for (let i = 0; i < dataRes.data.length; i++) { - deleteIds.push(dataRes.data[i][this.primaryKey]) - } - if (deleteIds.length > 0) { - thisCondition = {} - thisCondition[this.primaryKey] = { - $in: deleteIds - } - delRes = await this.delete(tab, thisCondition, useDBPre) - if (delRes && delRes.deleted) { - res.data.deleted += delRes.deleted - } - } - } else { - run = false - } - } - return res - } - - /** - * 基础查询 - * @param {String} tab 表名 - * @param {Object} params 查询参数 where:where条件,field:返回字段,skip:跳过的文档数,limit:返回的记录数,orderBy:排序,count:返回查询结果的数量 - * @param {Boolean} useDBPre 是否使用数据表前缀 - */ - async select(tab, params, useDBPre = true) { - const { - where, - field, - skip, - limit, - orderBy, - count - } = params - - const query = this.getCollection(tab, useDBPre) - - //拼接where条件 - if (where) { - if (where.length > 0) { - where.forEach(key => { - query.where(where[key]) - }) - } else { - query.where(where) - } - } - - //排序 - if (orderBy) { - Object.keys(orderBy).forEach(key => { - query.orderBy(key, orderBy[key]) - }) - } - - //指定跳过的文档数 - if (skip) { - query.skip(skip) - } - - //指定返回的记录数 - if (limit) { - query.limit(limit) - } - - //指定返回字段 - if (field) { - query.field(field) - } - - //指定返回查询结果数量 - if (count) { - return await query.count() - } - - //返回查询结果数据 - return await query.get() - } - - /** - * 查询并返回全部数据 - * @param {String} tab 表名 - * @param {Object} condition 条件 - * @param {Object} field 指定查询返回字段 - * @param {Boolean} useDBPre 是否使用数据表前缀 - */ - async selectAll(tab, condition, field = {}, useDBPre = true) { - const countRes = await this.getCollection(tab, useDBPre).where(condition).count() - if (countRes && countRes.total > 0) { - const pageCount = Math.ceil(countRes.total / this.selectMaxLimit) - let res, returnData - for (let p = 0; p < pageCount; p++) { - res = await this.getCollection(tab, useDBPre).where(condition).orderBy(this.primaryKey, 'asc').skip(p * - this.selectMaxLimit).limit(this.selectMaxLimit).field(field).get() - if (!returnData) { - returnData = res - } else { - returnData.affectedDocs += res.affectedDocs - for (const i in res.data) { - returnData.data.push(res.data[i]) - } - } - } - return returnData - } - return { - affectedDocs: 0, - data: [] - } - } - - /** - * 聚合查询 - * @param {String} tab 表名 - * @param {Object} params 聚合参数 - */ - async aggregate(tab, params) { - let { - project, - match, - lookup, - group, - skip, - limit, - sort, - getAll, - useDBPre, - addFields - } = params - //useDBPre 是否使用数据表前缀 - useDBPre = (useDBPre !== null && useDBPre !== undefined) ? useDBPre : true - const query = this.getCollection(tab, useDBPre).aggregate() - - //设置匹配条件 - if (match) { - query.match(match) - } - - //设置返回字段 - if (project) { - query.project(project) - } - - //数据表关联 - if (lookup) { - query.lookup(lookup) - } - - //分组 - if (group) { - if (group.length > 0) { - for (const gi in group) { - query.group(group[gi]) - } - } else { - query.group(group) - } - } - - //添加字段 - if (addFields) { - query.addFields(addFields) - } - - //排序 - if (sort) { - query.sort(sort) - } - - //分页 - if (skip) { - query.skip(skip) - } - if (limit) { - query.limit(limit) - } else if (!getAll) { - query.limit(this.selectMaxLimit) - } - - //如果未指定全部返回则直接返回查询结果 - if (!getAll) { - return await query.end() - } - - //若指定了全部返回则分页查询全部结果后再返回 - const resCount = await query.group({ - _id: {}, - aggregate_count: { - $sum: 1 - } - }).end() - - if (resCount && resCount.data.length > 0 && resCount.data[0].aggregate_count > 0) { - //分页查询 - const total = resCount.data[0].aggregate_count - const pageCount = Math.ceil(total / this.selectMaxLimit) - let res, returnData - params.limit = this.selectMaxLimit - params.getAll = false - //结果合并 - for (let p = 0; p < pageCount; p++) { - params.skip = p * params.limit - res = await this.aggregate(tab, params) - if (!returnData) { - returnData = res - } else { - returnData.affectedDocs += res.affectedDocs - for (const i in res.data) { - returnData.data.push(res.data[i]) - } - } - } - return returnData - } else { - return { - affectedDocs: 0, - data: [] - } - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/channel.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/channel.js deleted file mode 100644 index fea5ed7..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/channel.js +++ /dev/null @@ -1,109 +0,0 @@ -/** - * @class Channel 渠道模型 - */ -const BaseMod = require('./base') -const Scenes = require('./scenes') -const Platform = require('./platform') -const { - DateTime -} = require('../lib') -module.exports = class Channel extends BaseMod { - constructor() { - super() - this.tableName = 'app-channels' - this.scenes = new Scenes() - } - - /** - * 获取渠道信息 - * @param {String} appid - * @param {String} platformId 平台编号 - * @param {String} channel 渠道代码 - */ - async getChannel(appid, platformId, channel) { - const cacheKey = 'uni-stat-channel-' + appid + '-' + platformId + '-' + channel - let channelData = await this.getCache(cacheKey) - if (!channelData) { - const channelInfo = await this.getCollection(this.tableName).where({ - appid: appid, - platform_id: platformId, - channel_code: channel - }).limit(1).get() - channelData = [] - if (channelInfo.data.length > 0) { - channelData = channelInfo.data[0] - if (channelData.channel_name === '') { - const scenesName = await this.scenes.getScenesNameByPlatformId(platformId, channel) - if (scenesName) { - await this.update(this.tableName, { - channel_name: scenesName, - update_time: new DateTime().getTime() - }, { - _id: channelData._id - }) - } - } - await this.setCache(cacheKey, channelData) - } - } - return channelData - } - - /** - * 获取渠道信息没有则进行创建 - * @param {String} appid - * @param {String} platformId - * @param {String} channel - */ - async getChannelAndCreate(appid, platformId, channel) { - if (!appid || !platformId) { - return [] - } - const channelInfo = await this.getChannel(appid, platformId, channel) - if (channelInfo.length === 0) { - const thisTime = new DateTime().getTime() - const insertParam = { - appid: appid, - platform_id: platformId, - channel_code: channel, - channel_name: await this.scenes.getScenesNameByPlatformId(platformId, channel), - create_time: thisTime, - update_time: thisTime - } - const res = await this.insert(this.tableName, insertParam) - if (res && res.id) { - return Object.assign(insertParam, { - _id: res.id - }) - } - } - return channelInfo - } - - /** - * 获取渠道_id - * @param {String} appid - * @param {String} platformId - * @param {String} channel - */ - async getChannelId(appid, platformId, channel) { - const channelInfo = await this.getChannel(appid, platformId, channel) - return channelInfo.length > 0 ? channelInfo._id : '' - } - - /** - * 获取渠道码或者场景值 - * @param {Object} params 上报参数 - */ - getChannelCode(params) { - //小程序未上报渠道则使用场景值 - const platform = new Platform() - const platformCode = platform.getPlatformCode(params.ut, params.p) - if (params.ch) { - return params.ch - } else if (params.sc && platformCode.indexOf('mp-') === 0) { - return params.sc - } - return this.scenes.defualtCode - } -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/device.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/device.js deleted file mode 100644 index 1784c00..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/device.js +++ /dev/null @@ -1,184 +0,0 @@ -/** - * @class Device 设备模型 - */ -const BaseMod = require('./base') -const Platform = require('./platform') -const { - DateTime -} = require('../lib') -module.exports = class Device extends BaseMod { - constructor() { - super() - this.tableName = 'opendb-device' - this.tablePrefix = false - this.cacheKeyPre = 'uni-stat-device-' - } - - /** - * 通过设备编号获取设备信息 - * @param {Object} deviceId 设备编号 - */ - async getDeviceById(deviceId) { - const cacheKey = this.cacheKeyPre + deviceId - let deviceData = await this.getCache(cacheKey) - if (!deviceData) { - const deviceRes = await this.getCollection().where({ - device_id: deviceId - }).get() - deviceData = [] - if (deviceRes.data.length > 0) { - deviceData = deviceRes.data[0] - await this.setCache(cacheKey, deviceData) - } - } - return deviceData - } - - /** - * 设置设备信息 - * @param {Object} params 上报参数 - */ - async setDevice(params) { - // 设备信息 - if (!params.did) { - return { - code: 200, - msg: 'Parameter "did" not found' - } - } - const deviceData = await this.getDeviceById(params.did) - //不存在则添加 - if(deviceData.length === 0) { - return await this.addDevice(params) - } else { - return await this.updateDevice(params, deviceData) - } - } - - /** - * 添加设备信息 - * @param {Object} params 上报参数 - */ - async addDevice(params) { - const dateTime = new DateTime() - const platform = new Platform() - const fillParams = { - device_id: params.did, - appid: params.ak, - vendor: params.brand ? params.brand : '', - push_clientid: params.cid ? params.cid : '', - imei: params.imei ? params.imei : '', - oaid: params.oaid ? params.oaid : '', - idfa: params.idfa ? params.idfa : '', - imsi: params.imsi ? params.imsi : '', - model: params.md ? params.md : '', - uni_platform: params.up ? params.up : '', - os_name: params.on ? params.on : platform.getOsName(params.p), - os_version: params.sv ? params.sv : '', - os_language: params.lang ? params.lang : '', - os_theme: params.ot ? params.ot : '', - pixel_ratio: params.pr ? params.pr : '', - network_model: params.net ? params.net : '', - window_width: params.ww ? params.ww : '', - window_height: params.wh ? params.wh : '', - screen_width: params.sw ? params.sw : '', - screen_height: params.sh ? params.sh : '', - rom_name: params.rn ? params.rn : '', - rom_version: params.rv ? params.rv : '', - location_ip: params.ip ? params.ip : '', - location_latitude: params.lat ? parseFloat(params.lat) : 0, - location_longitude: params.lng ? parseFloat(params.lng) : 0, - location_country: params.cn ? params.cn : '', - location_province: params.pn ? params.pn : '', - location_city: params.ct ? params.ct : '', - create_date: dateTime.getTime(), - last_update_date: dateTime.getTime() - } - const res = await this.insert(this.tableName, fillParams) - if (res && res.id) { - return { - code: 0, - msg: 'success', - } - } else { - return { - code: 500, - msg: 'Device data filled error' - } - } - } - - /** - * 修改设备信息 - * @param {Object} params - * @param {Object} deviceData - */ - async updateDevice(params, deviceData) { - //最新的参数 - const dateTime = new DateTime() - const platform = new Platform() - console.log('device params', params) - const newDeviceParams = { - appid: params.ak, - push_clientid: params.cid ? params.cid : '', - imei: params.imei ? params.imei : '', - oaid: params.oaid ? params.oaid : '', - idfa: params.idfa ? params.idfa : '', - imsi: params.imsi ? params.imsi : '', - uni_platform: params.up ? params.up : '', - os_name: params.on ? params.on : platform.getOsName(params.p), - os_version: params.sv ? params.sv : '', - os_language: params.lang ? params.lang : '', - pixel_ratio: params.pr ? params.pr : '', - network_model: params.net ? params.net : '', - window_width: params.ww ? params.ww : '', - window_height: params.wh ? params.wh : '', - screen_width: params.sw ? params.sw : '', - screen_height: params.sh ? params.sh : '', - rom_name: params.rn ? params.rn : '', - rom_version: params.rv ? params.rv : '', - location_ip: params.ip ? params.ip : '', - location_latitude: params.lat ? parseFloat(params.lat) : '', - location_longitude: params.lng ? parseFloat(params.lng) : '', - location_country: params.cn ? params.cn : '', - location_province: params.pn ? params.pn : '', - location_city: params.ct ? params.ct : '', - } - - //检查是否有需要更新的数据 - const updateData = {} - for(let key in newDeviceParams) { - if(newDeviceParams[key] && newDeviceParams[key] !== deviceData[key]) { - updateData[key] = newDeviceParams[key] - } - } - - if(Object.keys(updateData).length) { - if(this.debug) { - console.log('Device need to update', updateData) - } - //数据更新 - updateData.last_update_date = dateTime.getTime() - await this.update(this.tableName, updateData, {device_id: params.did}) - } else { - if(this.debug) { - console.log('Device not need update', newDeviceParams) - } - } - - return { - code: 0, - msg: 'success' - } - } - - async bindPush(params) { - if (!params.cid) { - return { - code: 200, - msg: 'Parameter "cid" not found' - } - } - return await this.setDevice(params) - } -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/errorLog.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/errorLog.js deleted file mode 100644 index bc2331b..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/errorLog.js +++ /dev/null @@ -1,141 +0,0 @@ -/** - * @class ErrorLog 错误日志模型 - */ -const BaseMod = require('./base') -const Platform = require('./platform') -const Channel = require('./channel') -const { - DateTime, - UniCrypto -} = require('../lib') -module.exports = class ErrorLog extends BaseMod { - constructor() { - super() - this.tableName = 'error-logs' - } - - /** - * 错误日志数据填充 - * @param {Object} reportParams 上报参数 - */ - async fill(reportParams) { - let params, errorHash, errorCount, cacheKey; - const fillParams = [] - const platform = new Platform() - const dateTime = new DateTime() - const uniCrypto = new UniCrypto() - const channel = new Channel() - const { - needCheck, - checkTime - } = this.getConfig('errorCheck') - const errorCheckTime = Math.max(checkTime, 1) - let spaceId - let spaceProvider - for (const rk in reportParams) { - params = reportParams[rk] - errorHash = uniCrypto.md5(params.em) - cacheKey = 'error-count-' + errorHash - // 校验在指定时间段内是否已存在相同的错误项 - if (needCheck) { - errorCount = await this.getCache(cacheKey) - if (!errorCount) { - errorCount = await this.getCollection(this.tableName).where({ - error_hash: errorHash, - create_time: { - $gte: dateTime.getTime() - errorCheckTime * 60000 - } - }).count() - if (errorCount && errorCount.total > 0) { - await this.setCache(cacheKey, errorCount, errorCheckTime * 60) - } - } - - if (errorCount && errorCount.total > 0) { - if (this.debug) { - console.log('This error have already existsed: ' + params.em) - } - continue - } - } - - //获取云端信息 - spaceId = null - spaceProvider = null - if (params.spi) { - //云函数调用参数 - spaceId = params.spi.spaceId - spaceProvider = params.spi.provider - } else { - //云对象调用参数 - if (params.spid) { - spaceId = params.spid - } - if (params.sppd) { - spaceProvider = params.sppd - } - } - - // 填充数据 - fillParams.push({ - appid: params.ak, - version: params.v ? params.v : '', - platform: platform.getPlatformCode(params.ut, params.p), - channel: channel.getChannelCode(params), - device_id: params.did, - uid: params.uid ? params.uid : '', - os: params.on ? params.on : platform.getOsName(params.p), - ua: params.ua ? params.ua : '', - page_url: params.url ? params.url : '', - space_id: spaceId ? spaceId : '', - space_provider: spaceProvider ? spaceProvider : '', - platform_version: params.mpv ? params.mpv : '', - error_msg: params.em ? params.em : '', - error_hash: errorHash, - create_time: dateTime.getTime() - }) - } - - if (fillParams.length === 0) { - return { - code: 200, - msg: 'Invild param' - } - } - - const res = await this.insert(this.tableName, fillParams) - if (res && res.inserted) { - return { - code: 0, - msg: 'success' - } - } else { - return { - code: 500, - msg: 'Filled error' - } - } - } - - /** - * 错误日志清理 - * @param {Number} days 日志保留天数, 0为永久保留 - */ - async clean(days) { - if(days === 0) { - return false; - } - days = Math.max(parseInt(days), 1) - console.log('clean error logs - day:', days) - const dateTime = new DateTime() - const res = await this.delete(this.tableName, { - create_time: { - $lt: dateTime.getTimeBySetDays(0 - days) - } - }) - if (!res.code) { - console.log('clean error log:', res) - } - return res - } -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/errorResult.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/errorResult.js deleted file mode 100644 index 5cd1ff6..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/errorResult.js +++ /dev/null @@ -1,459 +0,0 @@ -/** - * @class ErrorResult 错误结果统计模型 - */ -const BaseMod = require('./base') -const Platform = require('./platform') -const Channel = require('./channel') -const Version = require('./version') -const ErrorLog = require('./errorLog') -const AppCrashLogs = require('./appCrashLogs') -const SessionLog = require('./sessionLog') -const { - DateTime -} = require('../lib') -module.exports = class ErrorResult extends BaseMod { - constructor() { - super() - this.tableName = 'error-result' - this.platforms = [] - this.channels = [] - this.versions = [] - this.errors = [] - } - - /** - * 错误结果统计 - * @param {String} type 统计类型 hour:实时统计 day:按天统计,week:按周统计 month:按月统计 - * @param {Date|Time} date 指定日期或时间戳 - * @param {Boolean} reset 是否重置,为ture时会重置该批次数据 - */ - async stat(type, date, reset) { - //前端js错误统计 - const resJs = await this.statJs(type, date, reset) - //原生应用崩溃错误统计 - const resCrash = await this.statCrash(type, date, reset) - - return { - code: 0, - msg: 'success', - data: { - resJs, - resCrash - } - } - } - - /** - * 前端js错误结果统计 - * @param {String} type 统计类型 hour:实时统计 day:按天统计,week:按周统计 month:按月统计 - * @param {Date|Time} date 指定日期或时间戳 - * @param {Boolean} reset 是否重置,为ture时会重置该批次数据 - */ - async statJs(type, date, reset) { - const allowedType = ['day'] - if (!allowedType.includes(type)) { - return { - code: 1002, - msg: 'This type is not allowed' - } - } - this.fillType = type - const dateTime = new DateTime() - const dateDimension = dateTime.getTimeDimensionByType(type, -1, date) - this.startTime = dateDimension.startTime - this.endTime = dateDimension.endTime - - if (this.debug) { - console.log('dimension time', this.startTime + '--' + this.endTime) - } - - // 查看当前时间段日志是否已存在,防止重复生成 - if (!reset) { - const checkRes = await this.getCollection(this.tableName).where({ - type: 'js', - start_time: this.startTime, - end_time: this.endTime - }).get() - if (checkRes.data.length > 0) { - console.log('error log have existed') - return { - code: 1003, - msg: 'This log have existed' - } - } - } else { - const delRes = await this.delete(this.tableName, { - type: 'js', - start_time: this.startTime, - end_time: this.endTime - }) - console.log('delete old data result:', JSON.stringify(delRes)) - } - - // 数据获取 - this.errorLog = new ErrorLog() - const statRes = await this.aggregate(this.errorLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - error_hash: 1, - create_time: 1 - }, - match: { - create_time: { - $gte: this.startTime, - $lte: this.endTime - } - }, - group: { - _id: { - appid: '$appid', - version: '$version', - platform: '$platform', - channel: '$channel', - error_hash: '$error_hash' - }, - error_count: { - $sum: 1 - } - }, - sort: { - error_count: 1 - }, - getAll: true - }) - - let res = { - code: 0, - msg: 'success' - } - if (this.debug) { - console.log('statRes', JSON.stringify(statRes)) - } - if (statRes.data.length > 0) { - this.fillData = [] - for (const i in statRes.data) { - await this.fillJs(statRes.data[i]) - } - - if (this.fillData.length > 0) { - res = await this.batchInsert(this.tableName, this.fillData) - } - } - return res - } - - /** - * 前端js错误统计结果数据填充 - * @param {Object} data 数据集合 - */ - async fillJs(data) { - // 平台信息 - let platformInfo = null - if (this.platforms && this.platforms[data._id.platform]) { - //暂存下数据,减少读库 - platformInfo = this.platforms[data._id.platform] - } else { - const platform = new Platform() - platformInfo = await platform.getPlatformAndCreate(data._id.platform, null) - if (!platformInfo || platformInfo.length === 0) { - platformInfo._id = '' - } - this.platforms[data._id.platform] = platformInfo - if (this.debug) { - console.log('platformInfo', JSON.stringify(platformInfo)) - } - } - - // 渠道信息 - let channelInfo = null - const channelKey = data._id.appid + '_' + platformInfo._id + '_' + data._id.channel - if (this.channels && this.channels[channelKey]) { - channelInfo = this.channels[channelKey] - } else { - const channel = new Channel() - channelInfo = await channel.getChannelAndCreate(data._id.appid, platformInfo._id, data._id.channel) - if (!channelInfo || channelInfo.length === 0) { - channelInfo._id = '' - } - this.channels[channelKey] = channelInfo - if (this.debug) { - console.log('channelInfo', JSON.stringify(channelInfo)) - } - } - - // 版本信息 - let versionInfo = null - const versionKey = data._id.appid + '_' + data._id.platform + '_' + data._id.version - if (this.versions && this.versions[versionKey]) { - versionInfo = this.versions[versionKey] - } else { - const version = new Version() - versionInfo = await version.getVersionAndCreate(data._id.appid, data._id.platform, data._id.version) - if (!versionInfo || versionInfo.length === 0) { - versionInfo._id = '' - } - this.versions[versionKey] = versionInfo - if (this.debug) { - console.log('versionInfo', JSON.stringify(versionInfo)) - } - } - - // 错误信息 - let errorInfo = null - if (this.errors && this.errors[data._id.error_hash]) { - errorInfo = this.errors[data._id.error_hash] - } else { - const cacheKey = 'uni-stat-errors-' + data._id.error_hash - errorInfo = await this.getCache(cacheKey) - if (!errorInfo) { - errorInfo = await this.getCollection(this.errorLog.tableName).where({ - error_hash: data._id.error_hash - }).limit(1).get() - if (!errorInfo || errorInfo.data.length === 0) { - errorInfo.error_msg = '' - } else { - errorInfo = errorInfo.data[0] - await this.setCache(cacheKey, errorInfo) - } - } - this.errors[data._id.error_hash] = errorInfo - } - - // 最近一次报错时间 - const matchCondition = data._id - Object.assign(matchCondition, { - create_time: { - $gte: this.startTime, - $lte: this.endTime - } - }) - const lastErrorLog = await this.getCollection(this.errorLog.tableName).where(matchCondition).orderBy( - 'create_time', 'desc').limit(1).get() - let lastErrorTime = '' - if (lastErrorLog && lastErrorLog.data.length > 0) { - lastErrorTime = lastErrorLog.data[0].create_time - } - - //数据填充 - const datetime = new DateTime() - const insertParams = { - appid: data._id.appid, - platform_id: platformInfo._id, - channel_id: channelInfo._id, - version_id: versionInfo._id, - type: 'js', - hash: data._id.error_hash, - msg: errorInfo.error_msg, - count: data.error_count, - last_time: lastErrorTime, - dimension: this.fillType, - stat_date: datetime.getDate('Ymd', this.startTime), - start_time: this.startTime, - end_time: this.endTime - } - - this.fillData.push(insertParams) - - return insertParams - } - - - /** - * 原生应用错误结果统计 - * @param {String} type 统计类型 hour:实时统计 day:按天统计,week:按周统计 month:按月统计 - * @param {Date|Time} date 指定日期或时间戳 - * @param {Boolean} reset 是否重置,为ture时会重置该批次数据 - */ - async statCrash(type, date, reset) { - const allowedType = ['day'] - if (!allowedType.includes(type)) { - return { - code: 1002, - msg: 'This type is not allowed' - } - } - this.fillType = type - const dateTime = new DateTime() - const dateDimension = dateTime.getTimeDimensionByType(type, -1, date) - this.startTime = dateDimension.startTime - this.endTime = dateDimension.endTime - - if (this.debug) { - console.log('dimension time', this.startTime + '--' + this.endTime) - } - - // 查看当前时间段日志是否已存在,防止重复生成 - if (!reset) { - const checkRes = await this.getCollection(this.tableName).where({ - type: 'crash', - start_time: this.startTime, - end_time: this.endTime - }).get() - if (checkRes.data.length > 0) { - console.log('error log have existed') - return { - code: 1003, - msg: 'This log have existed' - } - } - } else { - const delRes = await this.delete(this.tableName, { - type: 'crash', - start_time: this.startTime, - end_time: this.endTime - }) - console.log('delete old data result:', JSON.stringify(delRes)) - } - - // 数据获取 - this.crashLogs = new AppCrashLogs() - const statRes = await this.aggregate(this.crashLogs.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - create_time: 1 - }, - match: { - create_time: { - $gte: this.startTime, - $lte: this.endTime - } - }, - group: { - _id: { - appid: '$appid', - version: '$version', - platform: '$platform', - channel: '$channel' - }, - error_count: { - $sum: 1 - } - }, - sort: { - error_count: 1 - }, - getAll: true - }) - - let res = { - code: 0, - msg: 'success' - } - if (this.debug) { - console.log('statRes', JSON.stringify(statRes)) - } - if (statRes.data.length > 0) { - this.fillData = [] - for (const i in statRes.data) { - await this.fillCrash(statRes.data[i]) - } - - if (this.fillData.length > 0) { - res = await this.batchInsert(this.tableName, this.fillData) - } - } - return res - } - - async fillCrash(data) { - // 平台信息 - let platformInfo = null - if (this.platforms && this.platforms[data._id.platform]) { - //暂存下数据,减少读库 - platformInfo = this.platforms[data._id.platform] - } else { - const platform = new Platform() - platformInfo = await platform.getPlatformAndCreate(data._id.platform, null) - if (!platformInfo || platformInfo.length === 0) { - platformInfo._id = '' - } - this.platforms[data._id.platform] = platformInfo - if (this.debug) { - console.log('platformInfo', JSON.stringify(platformInfo)) - } - } - - // 渠道信息 - let channelInfo = null - data._id.channel = data._id.channel ? data._id.channel : '1001' - const channelKey = data._id.appid + '_' + platformInfo._id + '_' + data._id.channel - if (this.channels && this.channels[channelKey]) { - channelInfo = this.channels[channelKey] - } else { - const channel = new Channel() - channelInfo = await channel.getChannelAndCreate(data._id.appid, platformInfo._id, data._id.channel) - if (!channelInfo || channelInfo.length === 0) { - channelInfo._id = '' - } - this.channels[channelKey] = channelInfo - if (this.debug) { - console.log('channelInfo', JSON.stringify(channelInfo)) - } - } - - // 版本信息 - let versionInfo = null - const versionKey = data._id.appid + '_' + data._id.platform + '_' + data._id.version - if (this.versions && this.versions[versionKey]) { - versionInfo = this.versions[versionKey] - } else { - const version = new Version() - versionInfo = await version.getVersionAndCreate(data._id.appid, data._id.platform, data._id.version) - if (!versionInfo || versionInfo.length === 0) { - versionInfo._id = '' - } - this.versions[versionKey] = versionInfo - if (this.debug) { - console.log('versionInfo', JSON.stringify(versionInfo)) - } - } - - //app启动次数 - const sessionLog = new SessionLog() - const sessionTimesRes = await this.getCollection(sessionLog.tableName).where({ - appid: data._id.appid, - version: data._id.version, - platform: data._id.platform, - channel: data._id.channel, - create_time: { - $gte: this.startTime, - $lte: this.endTime - } - }).count() - - let sessionTimes = 0 - if(sessionTimesRes && sessionTimesRes.total > 0) { - sessionTimes = sessionTimesRes.total - } else { - console.log('Not found session logs') - return false - } - - - //数据填充 - const datetime = new DateTime() - const insertParams = { - appid: data._id.appid, - platform_id: platformInfo._id, - channel_id: channelInfo._id, - version_id: versionInfo._id, - type: 'crash', - count: data.error_count, - app_launch_count: sessionTimes, - dimension: this.fillType, - stat_date: datetime.getDate('Ymd', this.startTime), - start_time: this.startTime, - end_time: this.endTime - } - - this.fillData.push(insertParams) - - return insertParams - } -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/event.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/event.js deleted file mode 100644 index 82e104c..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/event.js +++ /dev/null @@ -1,72 +0,0 @@ -/** - * @class StatEvent 事件统计模型 - */ -const BaseMod = require('./base') -const { - DateTime -} = require('../lib') -module.exports = class StatEvent extends BaseMod { - constructor() { - super() - this.tableName = 'events' - this.defaultEvent = this.getConfig('event') || { - login: '登录', - register: '注册', - click: '点击', - share: '分享', - pay_success: '支付成功', - pay_fail: '支付失败' - } - } - - /** - * 获取事件信息 - * @param {String} appid: DCloud appid - * @param {String} eventKey 事件键值 - */ - async getEvent(appid, eventKey) { - const cacheKey = 'uni-stat-event-' + appid + '-' + eventKey - let eventData = await this.getCache(cacheKey) - if (!eventData) { - const eventInfo = await this.getCollection(this.tableName).where({ - appid: appid, - event_key: eventKey - }).get() - eventData = [] - if (eventInfo.data.length > 0) { - eventData = eventInfo.data[0] - await this.setCache(cacheKey, eventData) - } - } - return eventData - } - - - /** - * 获取事件信息不存在则创建 - * @param {String} appid: DCloud appid - * @param {String} eventKey 事件键值 - */ - async getEventAndCreate(appid, eventKey) { - const eventInfo = await this.getEvent(appid, eventKey) - if (eventInfo.length === 0) { - const thisTime = new DateTime().getTime() - const insertParam = { - appid: appid, - event_key: eventKey, - event_name: this.defaultEvent[eventKey] ? this.defaultEvent[eventKey] : '', - create_time: thisTime, - update_time: thisTime - } - const res = await this.insert(this.tableName, insertParam) - - if (res && res.id) { - return Object.assign(insertParam, { - _id: res.id - }) - } - } - - return eventInfo - } -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/eventLog.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/eventLog.js deleted file mode 100644 index 9634b4d..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/eventLog.js +++ /dev/null @@ -1,171 +0,0 @@ -/** - * @class EventLog 事件日志模型 - */ -const BaseMod = require('./base') -const Platform = require('./platform') -const Channel = require('./channel') -const StatEvent = require('./event') -const SessionLog = require('./sessionLog') -const ShareLog = require('./shareLog') -const { - DateTime -} = require('../lib') -module.exports = class EventLog extends BaseMod { - constructor() { - super() - this.tableName = 'event-logs' - this.sessionLogInfo = [] - } - - /** - * 事件日志填充 - * @param {Object} reportParams 上报参数 - */ - async fill(reportParams) { - let params; - let sessionKey, sessionLogKey; - let sessionLogInfo; - const sessionData = [] - const fillParams = [] - const shareParams = [] - const sessionLog = new SessionLog() - const event = new StatEvent() - const platform = new Platform() - const dateTime = new DateTime() - const channel = new Channel() - for (const rk in reportParams) { - params = reportParams[rk] - - //暂存下会话数据,减少读库 - sessionKey = params.ak + params.did + params.p - if (!this.sessionLogInfo[sessionKey]) { - // 会话日志 - sessionLogInfo = await sessionLog.getSession(params) - if (sessionLogInfo.code) { - return sessionLogInfo - } - if (this.debug) { - console.log('sessionLogInfo', JSON.stringify(sessionLogInfo)) - } - this.sessionLogInfo[sessionKey] = sessionLogInfo - } else { - sessionLogInfo = this.sessionLogInfo[sessionKey] - } - - // 会话数据 - sessionLogKey = sessionLogInfo.data.sessionLogId.toString() - if (!sessionData[sessionLogKey]) { - sessionData[sessionLogKey] = { - eventCount: sessionLogInfo.data.eventCount + 1, - addEventCount: 1, - uid: sessionLogInfo.data.uid, - createTime: sessionLogInfo.data.createTime - } - } else { - sessionData[sessionLogKey].eventCount++ - sessionData[sessionLogKey].addEventCount++ - } - - // 事件 - const eventInfo = await event.getEventAndCreate(params.ak, params.e_n) - - //事件参数,尝试转为object类型 - let eventParam = '' - if(params.e_v) { - try { - eventParam = JSON.parse(params.e_v) - } catch(e) { - eventParam = params.e_v - } - } - - // 填充数据 - fillParams.push({ - appid: params.ak, - version: params.v ? params.v : '', - platform: platform.getPlatformCode(params.ut, params.p), - channel: channel.getChannelCode(params), - device_id: params.did, - uid: params.uid ? params.uid : '', - session_id: sessionLogInfo.data.sessionLogId, - page_id: sessionLogInfo.data.pageId, - event_key: eventInfo.event_key, - param: eventParam, - // 版本 - sdk_version: params.mpsdk ? params.mpsdk : '', - platform_version: params.mpv ? params.mpv : '', - // 设备相关 - device_os_name: params.on ? params.on : platform.getOsName(params.p), - device_os_version: params.sv ? params.sv : '', - device_vendor: params.brand ? params.brand : '', - device_model: params.md ? params.md : '', - device_language: params.lang ? params.lang : '', - device_pixel_ratio: params.pr ? params.pr : '', - device_window_width: params.ww ? params.ww : '', - device_window_height: params.wh ? params.wh : '', - device_screen_width: params.sw ? params.sw : '', - device_screen_height: params.sh ? params.sh : '', - create_time: dateTime.getTime() - }) - // 分享数据 - if (eventInfo.event_key === 'share') { - shareParams.push(params) - } - } - - if (fillParams.length === 0) { - return { - code: 200, - msg: 'Invild param' - } - } - - if (shareParams.length > 0) { - const shareLog = new ShareLog() - await shareLog.fill(shareParams, this.sessionLogInfo) - } - - const res = await this.insert(this.tableName, fillParams) - if (res && res.inserted) { - for (const sid in sessionData) { - await sessionLog.updateSession(sid, sessionData[sid]) - } - return { - code: 0, - msg: 'success' - } - } else { - return { - code: 500, - msg: 'Filled error' - } - } - } - - /** - * 事件日志清理 - * @param {Number} days 保留天数 - */ - async clean(days) { - if(days === 0) { - return false; - } - - days = Math.max(parseInt(days), 1) - - console.log('clean event logs - day:', days) - - const dateTime = new DateTime() - //删除过期数据 - const res = await this.delete(this.tableName, { - create_time: { - $lt: dateTime.getTimeBySetDays(0 - days) - } - }) - - if (!res.code) { - console.log('clean event log:', res) - } - return res - } -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/eventResult.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/eventResult.js deleted file mode 100644 index 89e69a9..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/eventResult.js +++ /dev/null @@ -1,268 +0,0 @@ -/** - * @class EventResult 事件结果统计 - */ -const BaseMod = require('./base') -const Platform = require('./platform') -const Channel = require('./channel') -const Version = require('./version') -const EventLog = require('./eventLog') -const { - DateTime -} = require('../lib') -module.exports = class EventResult extends BaseMod { - constructor() { - super() - this.tableName = 'event-result' - this.platforms = [] - this.channels = [] - this.versions = [] - } - - /** - * 事件数据统计 - * @param {String} type 统计类型 hour:实时统计 day:按天统计,week:按周统计 month:按月统计 - * @param {Date|Time} date 指定日期或时间戳 - * @param {Boolean} reset 是否重置,为ture时会重置该批次数据 - */ - async stat(type, date, reset) { - const allowedType = ['day'] - if (!allowedType.includes(type)) { - return { - code: 1002, - msg: 'This type is not allowed' - } - } - this.fillType = type - const dateTime = new DateTime() - const dateDimension = dateTime.getTimeDimensionByType(type, -1, date) - this.startTime = dateDimension.startTime - this.endTime = dateDimension.endTime - if (this.debug) { - console.log('dimension time', this.startTime + '--' + this.endTime) - } - - // 查看当前时间段日志是否已存在,防止重复生成 - if (!reset) { - const checkRes = await this.getCollection(this.tableName).where({ - start_time: this.startTime, - end_time: this.endTime - }).get() - if (checkRes.data.length > 0) { - console.log('event log have existed') - return { - code: 1003, - msg: 'This log have existed' - } - } - } else { - const delRes = await this.delete(this.tableName, { - start_time: this.startTime, - end_time: this.endTime - }) - console.log('delete old data result:', JSON.stringify(delRes)) - } - - // 数据获取 - this.eventLog = new EventLog() - const statRes = await this.aggregate(this.eventLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - event_key: 1, - device_id: 1, - create_time: 1 - }, - match: { - create_time: { - $gte: this.startTime, - $lte: this.endTime - } - }, - group: { - _id: { - appid: '$appid', - version: '$version', - platform: '$platform', - channel: '$channel', - event_key: '$event_key' - }, - event_count: { - $sum: 1 - } - }, - sort: { - event_count: 1 - }, - getAll: true - }) - - let res = { - code: 0, - msg: 'success' - } - if (this.debug) { - console.log('statRes', JSON.stringify(statRes)) - } - if (statRes.data.length > 0) { - this.fillData = [] - for (const i in statRes.data) { - await this.fill(statRes.data[i]) - } - if (this.fillData.length > 0) { - res = await this.batchInsert(this.tableName, this.fillData) - } - } - return res - } - - /** - * 事件统计数据填充 - * @param {Object} data 数据集合 - */ - async fill(data) { - // 平台信息 - let platformInfo = null - if (this.platforms && this.platforms[data._id.platform]) { - //暂存下数据,减少读库 - platformInfo = this.platforms[data._id.platform] - } else { - const platform = new Platform() - platformInfo = await platform.getPlatformAndCreate(data._id.platform, null) - if (!platformInfo || platformInfo.length === 0) { - platformInfo._id = '' - } - this.platforms[data._id.platform] = platformInfo - if (this.debug) { - console.log('platformInfo', JSON.stringify(platformInfo)) - } - } - - // 渠道信息 - let channelInfo = null - const channelKey = data._id.appid + '_' + platformInfo._id + '_' + data._id.channel - if (this.channels && this.channels[channelKey]) { - channelInfo = this.channels[channelKey] - } else { - const channel = new Channel() - channelInfo = await channel.getChannelAndCreate(data._id.appid, platformInfo._id, data._id.channel) - if (!channelInfo || channelInfo.length === 0) { - channelInfo._id = '' - } - this.channels[channelKey] = channelInfo - if (this.debug) { - console.log('channelInfo', JSON.stringify(channelInfo)) - } - } - - // 版本信息 - let versionInfo = null - const versionKey = data._id.appid + '_' + data._id.platform + '_' + data._id.version - if (this.versions && this.versions[versionKey]) { - versionInfo = this.versions[versionKey] - } else { - const version = new Version() - versionInfo = await version.getVersionAndCreate(data._id.appid, data._id.platform, data._id.version) - if (!versionInfo || versionInfo.length === 0) { - versionInfo._id = '' - } - this.versions[versionKey] = versionInfo - if (this.debug) { - console.log('versionInfo', JSON.stringify(versionInfo)) - } - } - - const matchCondition = data._id - Object.assign(matchCondition, { - create_time: { - $gte: this.startTime, - $lte: this.endTime - } - }) - if (this.debug) { - console.log('matchCondition', JSON.stringify(matchCondition)) - } - - // 触发事件设备数统计 - const statEventDeviceRes = await this.aggregate(this.eventLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - event_key: 1, - device_id: 1, - create_time: 1 - }, - match: matchCondition, - group: [{ - _id: { - device_id: '$device_id' - } - }, { - _id: {}, - total_devices: { - $sum: 1 - } - }] - }) - - let eventDeviceCount = 0 - if (statEventDeviceRes.data.length > 0) { - eventDeviceCount = statEventDeviceRes.data[0].total_devices - } - - // 触发事件用户数统计 - const statEventUserRes = await this.aggregate(this.eventLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - event_key: 1, - uid: 1, - create_time: 1 - }, - match: { - ...matchCondition, - uid: { - $ne: '' - } - }, - group: [{ - _id: { - uid: '$uid' - } - }, { - _id: {}, - total_users: { - $sum: 1 - } - }] - }) - - let eventUserCount = 0 - if (statEventUserRes.data.length > 0) { - eventUserCount = statEventUserRes.data[0].total_users - } - - const datetime = new DateTime() - const insertParams = { - appid: data._id.appid, - platform_id: platformInfo._id, - channel_id: channelInfo._id, - version_id: versionInfo._id, - event_key: data._id.event_key, - event_count: data.event_count, - device_count: eventDeviceCount, - user_count: eventUserCount, - dimension: this.fillType, - stat_date: datetime.getDate('Ymd', this.startTime), - start_time: this.startTime, - end_time: this.endTime - } - this.fillData.push(insertParams) - return insertParams - } -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/index.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/index.js deleted file mode 100644 index 2f130b9..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/index.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * 基础对外模型 - */ -module.exports = { - BaseMod: require('./base'), - SessionLog: require('./sessionLog'), - UserSessionLog: require('./userSessionLog'), - PageLog: require('./pageLog'), - EventLog: require('./eventLog'), - ShareLog: require('./shareLog'), - ErrorLog: require('./errorLog'), - AppCrashLogs: require('./appCrashLogs'), - StatResult: require('./statResult'), - ActiveUsers: require('./activeUsers'), - ActiveDevices: require('./activeDevices'), - PageResult: require('./pageResult'), - PageDetailResult: require('./pageDetailResult'), - EventResult: require('./eventResult'), - ErrorResult: require('./errorResult'), - Loyalty: require('./loyalty'), - RunErrors: require('./runErrors'), - uniPay: require('./uni-pay'), - Setting: require('./setting'), -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/loyalty.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/loyalty.js deleted file mode 100644 index 273c04b..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/loyalty.js +++ /dev/null @@ -1,491 +0,0 @@ -/** - * 设备/用户忠诚度(粘性)统计模型 - */ -const BaseMod = require('./base') -const Platform = require('./platform') -const Channel = require('./channel') -const Version = require('./version') -const SessionLog = require('./sessionLog') -const UserSessionLog = require('./userSessionLog') -const { - DateTime -} = require('../lib') -module.exports = class Loyalty extends BaseMod { - constructor() { - super() - this.tableName = 'loyalty-result' - this.platforms = [] - this.channels = [] - this.versions = [] - } - - /** - * 设备/用户忠诚度(粘性)统计 - * @param {String} type 统计类型 hour:实时统计 day:按天统计,week:按周统计 month:按月统计 - * @param {Date|Time} date 指定日期或时间戳 - * @param {Boolean} reset 是否重置,为ture时会重置该批次数据 - */ - async stat(type, date, reset) { - const allowedType = ['day'] - if (!allowedType.includes(type)) { - return { - code: 1002, - msg: 'This type is not allowed' - } - } - - this.fillType = type - const dateTime = new DateTime() - const dateDimension = dateTime.getTimeDimensionByType(type, -1, date) - this.startTime = dateDimension.startTime - this.endTime = dateDimension.endTime - - if (this.debug) { - console.log('this time', dateTime.getTime()) - console.log('dimension time', this.startTime + '--' + this.endTime) - } - - // 查看当前时间段日志是否已存在,防止重复生成 - if (!reset) { - const checkRes = await this.getCollection(this.tableName).where({ - start_time: this.startTime, - end_time: this.endTime - }).get() - if (checkRes.data.length > 0) { - console.log('loyalty log have existed') - return { - code: 1003, - msg: 'This log have existed' - } - } - } else { - const delRes = await this.delete(this.tableName, { - start_time: this.startTime, - end_time: this.endTime - }) - console.log('delete old data result:', JSON.stringify(delRes)) - } - - // 数据获取 - this.sessionLog = new SessionLog() - const statRes = await this.aggregate(this.sessionLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - page_count: 1, - duration: 1, - create_time: 1 - }, - match: { - create_time: { - $gte: this.startTime, - $lte: this.endTime - } - }, - group: { - _id: { - appid: '$appid', - version: '$version', - platform: '$platform', - channel: '$channel' - }, - page_count_sum: { - $sum: '$page_count' - }, - duration_sum: { - $sum: '$duration' - } - }, - sort: { - page_count_sum: 1, - duration_sum: 1 - }, - getAll: true - }) - - let res = { - code: 0, - msg: 'success' - } - if (this.debug) { - console.log('statRes', JSON.stringify(statRes)) - } - if (statRes.data.length > 0) { - this.fillData = [] - for (const i in statRes.data) { - await this.fill(statRes.data[i]) - } - - if (this.fillData.length > 0) { - res = await this.batchInsert(this.tableName, this.fillData) - } - } - return res - } - - /** - * 设备/用户忠诚度(粘性)数据填充 - * @param {Object} data 数据集合 - */ - async fill(data) { - // 平台信息 - let platformInfo = null - if (this.platforms && this.platforms[data._id.platform]) { - platformInfo = this.platforms[data._id.platform] - } else { - const platform = new Platform() - platformInfo = await platform.getPlatformAndCreate(data._id.platform, null) - if (!platformInfo || platformInfo.length === 0) { - platformInfo._id = '' - } - this.platforms[data._id.platform] = platformInfo - if (this.debug) { - console.log('platformInfo', JSON.stringify(platformInfo)) - } - } - - // 渠道信息 - let channelInfo = null - const channelKey = data._id.appid + '_' + platformInfo._id + '_' + data._id.channel - if (this.channels && this.channels[channelKey]) { - channelInfo = this.channels[channelKey] - } else { - const channel = new Channel() - channelInfo = await channel.getChannelAndCreate(data._id.appid, platformInfo._id, data._id.channel) - if (!channelInfo || channelInfo.length === 0) { - channelInfo._id = '' - } - this.channels[channelKey] = channelInfo - if (this.debug) { - console.log('channelInfo', JSON.stringify(channelInfo)) - } - } - - // 版本信息 - let versionInfo = null - const versionKey = data._id.appid + '_' + data._id.platform + '_' + data._id.version - if (this.versions && this.versions[versionKey]) { - versionInfo = this.versions[versionKey] - } else { - const version = new Version() - versionInfo = await version.getVersionAndCreate(data._id.appid, data._id.platform, data._id.version) - if (!versionInfo || versionInfo.length === 0) { - versionInfo._id = '' - } - this.versions[versionKey] = versionInfo - if (this.debug) { - console.log('versionInfo', JSON.stringify(versionInfo)) - } - } - - // 访问深度-用户数统计和访问次数 - const pageMark = [1, 2, 3, 4, [5, 10], [10]] - - const matchCondition = Object.assign(data._id, { - create_time: { - $gte: this.startTime, - $lte: this.endTime - } - }) - - const visitDepthData = { - visit_devices: {}, - visit_users: {}, - visit_times: {} - } - - const userSessionLog = new UserSessionLog() - //根据各访问页面数区间统计 - for (const pi in pageMark) { - let pageMarkCondition = { - page_count: pageMark[pi] - } - - if (Array.isArray(pageMark[pi])) { - if (pageMark[pi].length === 2) { - pageMarkCondition = { - page_count: { - $gte: pageMark[pi][0], - $lte: pageMark[pi][1] - } - } - } else { - pageMarkCondition = { - page_count: { - $gt: pageMark[pi][0] - } - } - } - } - - // 访问次数(会话次数)统计 - const searchCondition = { - ...matchCondition, - ...pageMarkCondition - } - const vistRes = await this.aggregate(this.sessionLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - page_count: 1, - create_time: 1 - }, - match: searchCondition, - group: { - _id: {}, - total_visits: { - $sum: 1 - } - } - }) - - if (this.debug) { - console.log('vistResCondtion', JSON.stringify(searchCondition)) - console.log('vistRes', JSON.stringify(vistRes)) - } - let vistCount = 0 - if (vistRes.data.length > 0) { - vistCount = vistRes.data[0].total_visits - } - - // 设备数统计 - const deviceRes = await this.aggregate(this.sessionLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - page_count: 1, - create_time: 1, - device_id: 1 - }, - match: searchCondition, - group: [{ - _id: { - device_id: '$device_id' - } - }, { - _id: {}, - total_devices: { - $sum: 1 - } - }] - }) - - if (this.debug) { - console.log('searchCondition', JSON.stringify(searchCondition)) - console.log('deviceRes', JSON.stringify(deviceRes)) - } - - let deviceCount = 0 - if (deviceRes.data.length > 0) { - deviceCount = deviceRes.data[0].total_devices - } - - // 用户数统计 - const userRes = await this.aggregate(userSessionLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - page_count: 1, - create_time: 1, - uid: 1 - }, - match: searchCondition, - group: [{ - _id: { - uid: '$uid' - } - }, { - _id: {}, - total_users: { - $sum: 1 - } - }] - }) - - if (this.debug) { - console.log('userResCondtion', JSON.stringify(searchCondition)) - console.log('userRes', JSON.stringify(userRes)) - } - - let userCount = 0 - if (userRes.data.length > 0) { - userCount = userRes.data[0].total_users - } - - const pageKey = 'p_' + (Array.isArray(pageMark[pi]) ? pageMark[pi][0] : pageMark[pi]) - visitDepthData.visit_devices[pageKey] = deviceCount - visitDepthData.visit_users[pageKey] = userCount - visitDepthData.visit_times[pageKey] = vistCount - } - - // 访问时长-用户数统计和访问次数 - const durationMark = [ - [0, 2], - [3, 5], - [6, 10], - [11, 20], - [21, 30], - [31, 50], - [51, 100], - [100] - ] - const durationData = { - visit_devices: {}, - visit_users: {}, - visit_times: {} - } - //根据各访问时长区间统计 - for (const di in durationMark) { - let durationMarkCondition = { - duration: durationMark[di] - } - - if (Array.isArray(durationMark[di])) { - if (durationMark[di].length === 2) { - durationMarkCondition = { - duration: { - $gte: durationMark[di][0], - $lte: durationMark[di][1] - } - } - } else { - durationMarkCondition = { - duration: { - $gt: durationMark[di][0] - } - } - } - } - - // 访问次数(会话次数)统计 - const searchCondition = { - ...matchCondition, - ...durationMarkCondition - } - if (this.debug) { - console.log('searchCondition', JSON.stringify(searchCondition)) - } - const vistRes = await this.aggregate(this.sessionLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - duration: 1, - create_time: 1 - }, - match: searchCondition, - group: { - _id: {}, - total_visits: { - $sum: 1 - } - } - }) - - if (this.debug) { - console.log('vistRes', JSON.stringify(vistRes)) - } - let vistCount = 0 - if (vistRes.data.length > 0) { - vistCount = vistRes.data[0].total_visits - } - - // 设备数统计 - const deviceRes = await this.aggregate(this.sessionLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - device_id: 1, - duration: 1, - create_time: 1 - }, - match: searchCondition, - group: [{ - _id: { - device_id: '$device_id' - } - }, { - _id: {}, - total_devices: { - $sum: 1 - } - }] - }) - - if (this.debug) { - console.log('userRes', JSON.stringify(deviceRes)) - } - - let deviceCount = 0 - if (deviceRes.data.length > 0) { - deviceCount = deviceRes.data[0].total_devices - } - - // 用户数统计 - const userRes = await this.aggregate(userSessionLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - uid: 1, - duration: 1, - create_time: 1 - }, - match: searchCondition, - group: [{ - _id: { - uid: '$uid' - } - }, { - _id: {}, - total_users: { - $sum: 1 - } - }] - }) - - if (this.debug) { - console.log('userRes', JSON.stringify(userRes)) - } - - let userCount = 0 - if (userRes.data.length > 0) { - userCount = userRes.data[0].total_users - } - - const pageKey = 's_' + (Array.isArray(durationMark[di]) ? durationMark[di][0] : durationMark[di]) - durationData.visit_devices[pageKey] = deviceCount - durationData.visit_users[pageKey] = userCount - durationData.visit_times[pageKey] = vistCount - } - - // 数据填充 - const datetime = new DateTime() - const insertParams = { - appid: data._id.appid, - platform_id: platformInfo._id, - channel_id: channelInfo._id, - version_id: versionInfo._id, - visit_depth_data: visitDepthData, - duration_data: durationData, - stat_date: datetime.getDate('Ymd', this.startTime), - start_time: this.startTime, - end_time: this.endTime - } - - this.fillData.push(insertParams) - return insertParams - } -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/page.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/page.js deleted file mode 100644 index cb9d85f..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/page.js +++ /dev/null @@ -1,96 +0,0 @@ -/** - * @class Page 页面模型 - */ -const BaseMod = require('./base') -const { - parseUrl -} = require('../../shared') -const { - DateTime -} = require('../lib') -module.exports = class Page extends BaseMod { - constructor() { - super() - this.tableName = 'pages' - } - - /** - * 获取页面信息 - * @param {String} appid - * @param {String} url 页面地址 - */ - async getPage(appid, url) { - const cacheKey = 'uni-stat-page-' + appid + '-' + url - let pageData = await this.getCache(cacheKey) - if (!pageData) { - const pageInfo = await this.getCollection(this.tableName).where({ - appid: appid, - path: url - }).limit(1).get() - pageData = [] - if (pageInfo.data.length > 0) { - pageData = pageInfo.data[0] - await this.setCache(cacheKey, pageData) - } - } - return pageData - } - - /** - * 获取页面信息不存在则创建 - * @param {String} appid - * @param {String} url 页面地址 - * @param {Object} title 页面标题 - */ - async getPageAndCreate(appid, url, title) { - //获取url信息 - const urlInfo = parseUrl(url) - if (!urlInfo) { - return false - } - const baseurl = urlInfo.path - const pageInfo = await this.getPage(appid, baseurl) - //页面不存在则创建 - if (pageInfo.length === 0) { - const thisTime = new DateTime().getTime() - const insertParam = { - appid: appid, - path: baseurl, - title: title, - page_params: [], - create_time: thisTime, - update_time: thisTime - } - const res = await this.insert(this.tableName, insertParam) - - if (res && res.id) { - return Object.assign(insertParam, { - _id: res.id - }) - } - } else if (!pageInfo.title && title) { - const cacheKey = 'uni-stat-page-' + appid + '-' + baseurl - await this.clearCache(cacheKey) - await this.update(this.tableName, { - title: title - }, { - _id: pageInfo._id - }) - } - - return pageInfo - } - - /** - * 获取页面标题 - */ - getPageTitle(params) { - const titleKeys = ['ttct', 'ttc', 'ttn', 'ttpj'] - for(let item of titleKeys) { - if(params[item]) { - return params[item] - } - } - return '' - } -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/pageDetail.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/pageDetail.js deleted file mode 100644 index bb20942..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/pageDetail.js +++ /dev/null @@ -1,184 +0,0 @@ -/** - * @class Page 页面模型 - */ -const BaseMod = require('./base') -const { - parseUrl -} = require('../../shared') -const { - DateTime -} = require('../lib') -module.exports = class PageDetail extends BaseMod { - constructor() { - super() - this.tableName = 'page-details' - } - - /** - * 获取页面详情信息 - * @param {String} appid Dcloud-appid - * @param {String} pageId 页面id - * @param {String} url 页面地址 - * @return {Object} pageDetailInfo 页面详情信息 - */ - async getPageDetail({ - appid, - pageId, - url - } = {}) { - const cacheKey = this.getCacheKeyByParams({ - module: 'pageDetail', - appid, - pageId, - url - }) - let pageDetailData = await this.getCache(cacheKey) - if (!pageDetailData) { - const pageDetailInfo = await this.getCollection(this.tableName).where({ - appid, - page_id: pageId, - page_link: url - }).limit(1).get() - pageDetailData = [] - if (pageDetailInfo.data.length > 0) { - pageDetailData = pageDetailInfo.data[0] - await this.setCache(cacheKey, pageDetailData) - } - } - return pageDetailData - } - - /** - * 获取页面详情信息不存在则创建 - * @param {String} appid Dcloud-appid - * @param {String} pageId 页面id - * @param {String} url 页面详情匹配地址 - * @param {String} title 页面标题 - * @return {Object} pageDetailInfo 页面详情信息 - */ - async getPageDetailAndCreate({ - appid, - pageId, - url, - title - } = {}) { - const pageDetailInfo = await this.getPageDetail({ - appid, - pageId, - url - }) - //页面不存在则创建 - if (pageDetailInfo.length === 0) { - const thisTime = new DateTime().getTime() - const insertParam = { - appid: appid, - page_id: pageId, - page_link: url, - page_title: title, - create_time: thisTime, - update_time: thisTime - } - const res = await this.insert(this.tableName, insertParam) - if (res && res.id) { - return Object.assign(insertParam, { - _id: res.id - }) - } - } else if (!pageDetailInfo.page_title && title) { - const cacheKey = this.getCacheKeyByParams({ - module: 'pageDetail', - appid, - pageId, - url - }) - await this.clearCache(cacheKey) - await this.update(this.tableName, { - page_title: title - }, { - _id: pageDetailInfo._id - }) - } - return pageDetailInfo - } - - - /** - * 通过页面规则获取页面详情信息 - * @param {String} appid DCloud appid - * @param {String} pageUrl 页面链接 - * @param {String} pageTitle 页面标题 - * @param {String} pageId 页面编号 - * @param {Array} pageRules 页面规则 - * @return {Object} pageDetailInfo 页面详情信息 - */ - async getPageDetailByPageRules({ - appid, - pageUrl, - pageTitle, - pageId, - pageRules - } = {}) { - const pageDetailUrl = this.getPageDetailUrlByRules(pageUrl, pageRules) - if(this.debug) { - console.log('pageDetailUrl', pageDetailUrl, pageUrl) - } - if (!pageDetailUrl) { - return false - } - return await this.getPageDetailAndCreate({ - appid, - pageId, - url: pageDetailUrl, - title: pageTitle - }) - } - - /** - * 通过页面规则获取页面详情链接 - * @param {Object} url 原始页面地址 - * @param {Object} pageRules 页面规则 - * @return {String} pageDetailUrl 页面详情链接 - */ - getPageDetailUrlByRules(url, pageRules) { - if (!url || !pageRules) { - return false - } - let urlInfo = parseUrl(url) - if (!urlInfo.query) { - return false - } - const urlParams = urlInfo.query.split('&').reduce((res, cur) => { - const arr = cur.split('=') - return Object.assign({ - [arr[0]]: arr[1] - }, res) - }, {}) - let isMatch - let matchParams - let matchRulePrams - pageRules.forEach((item) => { - isMatch = true - matchParams = {} - for (let rule of item) { - if (Object.keys(urlParams).indexOf(rule) < 0) { - isMatch = false - break - } - matchParams[rule] = urlParams[rule] - } - if (isMatch) { - const matchRuleKeys = Object.keys(matchParams) - matchRuleKeys.sort() - matchRulePrams = {} - for(let key of matchRuleKeys) { - matchRulePrams[key] = matchParams[key] - } - } - }) - if (!matchRulePrams) { - return false - } - const matchQuery = Object.keys(matchRulePrams).map((key) => key + '=' + matchRulePrams[key]).join('&') - return urlInfo.path + '?' + matchQuery - } -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/pageDetailResult.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/pageDetailResult.js deleted file mode 100644 index ab52fee..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/pageDetailResult.js +++ /dev/null @@ -1,321 +0,0 @@ -/** - * @class PageResult 页面详情结果统计模型,既页面内容统计模型 - */ -const BaseMod = require('./base') -const Platform = require('./platform') -const Channel = require('./channel') -const Version = require('./version') -const SessionLog = require('./sessionLog') -const PageLog = require('./pageLog') -const ShareLog = require('./shareLog') -const { - DateTime -} = require('../lib') -module.exports = class PageDetailResult extends BaseMod { - constructor() { - super() - this.tableName = 'page-detail-result' - this.platforms = [] - this.channels = [] - this.versions = [] - } - - /** - * 数据统计 - * @param {String} type 统计类型 hour:实时统计 day:按天统计,week:按周统计 month:按月统计 - * @param {Date|Time} date 指定日期或时间戳 - * @param {Boolean} reset 是否重置,为ture时会重置该批次数据 - */ - async stat(type, date, reset) { - if(!this.getConfig('pageDetailStat')) { - return { - code: 1001, - msg: 'The page detail module not opened' - } - } - //允许的类型 - const allowedType = ['day'] - if (!allowedType.includes(type)) { - return { - code: 1002, - msg: 'This type is not allowed' - } - } - this.fillType = type - //获取当前统计的时间范围 - const dateTime = new DateTime() - const dateDimension = dateTime.getTimeDimensionByType(type, -1, date) - this.startTime = dateDimension.startTime - this.endTime = dateDimension.endTime - if (this.debug) { - console.log('dimension time', this.startTime + '--' + this.endTime) - } - - // 查看当前时间段日志是否已存在,防止重复执行 - if (!reset) { - const checkRes = await this.getCollection(this.tableName).where({ - start_time: this.startTime, - end_time: this.endTime - }).get() - if (checkRes.data.length > 0) { - console.error('This page detail stat log have exists') - return { - code: 1003, - msg: 'This page detail stat log have existed' - } - } - } else { - const delRes = await this.delete(this.tableName, { - start_time: this.startTime, - end_time: this.endTime - }) - console.log('Delete old data result:', JSON.stringify(delRes)) - } - - // 数据获取 - this.pageLog = new PageLog() - const statRes = await this.aggregate(this.pageLog.tableName, { - match: { - create_time: { - $gte: this.startTime, - $lte: this.endTime - }, - page_detail_id: { - $exists: true - } - }, - group: { - _id: { - appid: '$appid', - version: '$version', - platform: '$platform', - channel: '$channel', - page_detail_id: '$page_detail_id' - }, - page_id: { - $first: '$page_id' - }, - visit_times: { - $sum: 1 - } - }, - sort: { - visit_times: 1 - }, - getAll: true - }) - - - let res = { - code: 0, - msg: 'success' - } - if (this.debug) { - console.log('Page detail statRes', JSON.stringify(statRes.data)) - } - if (statRes.data.length > 0) { - this.fillData = [] - //获取填充数据 - for (const pdd of statRes.data) { - try { - await this.fill(pdd) - } catch (e) { - console.error('Page detail result data filled error', e, pdd) - } - } - //数据批量入库 - if (this.fillData.length > 0) { - res = await this.batchInsert(this.tableName, this.fillData) - } - } - return res - } - - /** - * 页面详情(内容)统计数据填充 - * @param {Object} data 统计数据 - */ - async fill(data) { - // 平台信息 - let platformInfo = null - if (this.platforms && this.platforms[data._id.platform]) { - //暂存下数据,减少读库 - platformInfo = this.platforms[data._id.platform] - } else { - const platform = new Platform() - platformInfo = await platform.getPlatformAndCreate(data._id.platform, null) - if (!platformInfo || platformInfo.length === 0) { - platformInfo._id = '' - } - this.platforms[data._id.platform] = platformInfo - if (this.debug) { - console.log('platformInfo', JSON.stringify(platformInfo)) - } - } - - // 渠道信息 - let channelInfo = null - const channelKey = data._id.appid + '_' + platformInfo._id + '_' + data._id.channel - if (this.channels && this.channels[channelKey]) { - channelInfo = this.channels[channelKey] - } else { - const channel = new Channel() - channelInfo = await channel.getChannelAndCreate(data._id.appid, platformInfo._id, data._id.channel) - if (!channelInfo || channelInfo.length === 0) { - channelInfo._id = '' - } - this.channels[channelKey] = channelInfo - if (this.debug) { - console.log('channelInfo', JSON.stringify(channelInfo)) - } - } - - // 版本信息 - let versionInfo = null - const versionKey = data._id.appid + '_' + data._id.platform + '_' + data._id.version - if (this.versions && this.versions[versionKey]) { - versionInfo = this.versions[versionKey] - } else { - const version = new Version() - versionInfo = await version.getVersionAndCreate(data._id.appid, data._id.platform, data._id.version) - if (!versionInfo || versionInfo.length === 0) { - versionInfo._id = '' - } - this.versions[versionKey] = versionInfo - if (this.debug) { - console.log('versionInfo', JSON.stringify(versionInfo)) - } - } - - const matchCondition = data._id - Object.assign(matchCondition, { - create_time: { - $gte: this.startTime, - $lte: this.endTime - } - }) - if (this.debug) { - console.log('matchCondition', JSON.stringify(matchCondition)) - } - - // 当前页面详情访问设备数 - const statPageDetailDeviceRes = await this.aggregate(this.pageLog.tableName, { - match: matchCondition, - group: [{ - _id: { - device_id: '$device_id' - } - }, { - _id: {}, - total_devices: { - $sum: 1 - } - }] - }) - - let pageDetailVisitDevices = 0 - if (statPageDetailDeviceRes.data.length > 0) { - pageDetailVisitDevices = statPageDetailDeviceRes.data[0].total_devices - } - - //当前页面详情访问人数 - const statPageDetailUserRes = await this.aggregate(this.pageLog.tableName, { - match: { - ...matchCondition, - uid: { - $ne: '' - } - }, - group: [{ - _id: { - uid: '$uid' - } - }, { - _id: {}, - total_users: { - $sum: 1 - } - }] - }) - - let pageDetailVisitUsers = 0 - if (statPageDetailUserRes.data.length > 0) { - pageDetailVisitUsers = statPageDetailUserRes.data[0].total_users - } - - // 访问时长 - const statPageDetailDurationRes = await this.aggregate(this.pageLog.tableName, { - match: { - appid: data._id.appid, - version: data._id.version, - platform: data._id.platform, - channel: data._id.channel, - previous_page_detail_id: data._id.page_detail_id, - create_time: { - $gte: this.startTime, - $lte: this.endTime - } - }, - group: { - _id: {}, - total_duration: { - $sum: '$previous_page_duration' - } - } - }) - - let totalDuration = 0 - if (statPageDetailDurationRes.data.length > 0) { - totalDuration = statPageDetailDurationRes.data[0].total_duration - } - - // 分享次数 - const shareLog = new ShareLog() - const statShareRes = await this.aggregate(shareLog.tableName, { - match: { - appid: data._id.appid, - version: data._id.version, - platform: data._id.platform, - channel: data._id.channel, - page_detail_id: data._id.page_detail_id, - create_time: { - $gte: this.startTime, - $lte: this.endTime - } - }, - group: { - _id: {}, - share_count: { - $sum: 1 - } - } - }) - - let shareCount = 0 - if (statShareRes.data.length > 0) { - shareCount = statShareRes.data[0].share_count - } - - // 数据填充 - const datetime = new DateTime() - const insertParams = { - appid: data._id.appid, - platform_id: platformInfo._id, - channel_id: channelInfo._id, - version_id: versionInfo._id, - page_id: data.page_id, - page_detail_id: data._id.page_detail_id, - visit_times: data.visit_times, - visit_devices: pageDetailVisitDevices, - visit_users: pageDetailVisitUsers, - duration: totalDuration > 0 ? totalDuration : 1, - share_count: shareCount, - dimension: this.fillType, - stat_date: datetime.getDate('Ymd', this.startTime), - start_time: this.startTime, - end_time: this.endTime - } - this.fillData.push(insertParams) - return insertParams - } -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/pageLog.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/pageLog.js deleted file mode 100644 index a673e98..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/pageLog.js +++ /dev/null @@ -1,214 +0,0 @@ -/** - * @class PageLog 页面日志模型 - */ -const BaseMod = require('./base') -const Page = require('./page') -const Platform = require('./platform') -const Channel = require('./channel') -const SessionLog = require('./sessionLog') -const PageDetail = require('./pageDetail') -const { - DateTime -} = require('../lib') -const { - parseUrl -} = require('../../shared') -module.exports = class PageLog extends BaseMod { - constructor() { - super() - this.tableName = 'page-logs' - this.sessionLogInfo = [] - } - - /** - * 页面日志数据填充 - * @param {Object} reportParams 上报参数 - */ - async fill(reportParams) { - let params; - let sessionKey - let sessionLogKey - let sessionLogInfo - let pageKey - let pageInfo - let referPageInfo - const sessionData = [] - const pageData = [] - const fillParams = [] - const sessionLog = new SessionLog() - const page = new Page() - const platform = new Platform() - const dateTime = new DateTime() - const channel = new Channel() - const pageDetail = new PageDetail() - for (const pk in reportParams) { - params = reportParams[pk] - if (['3', '4'].includes(params.lt) && !params.url && params.urlref) { - params.url = params.urlref - } - - // 页面信息 - pageKey = params.ak + params.url - if (pageData[pageKey]) { - pageInfo = pageData[pageKey] - } else { - pageInfo = await page.getPageAndCreate(params.ak, params.url, page.getPageTitle(params)) - if (!pageInfo || pageInfo.length === 0) { - console.log('Not found this page by param:', JSON.stringify(params)) - continue - } - pageData[pageKey] = pageInfo - } - - // 会话日志,暂存下会话数据,减少读库 - sessionKey = params.ak + params.did + params.p - if (!this.sessionLogInfo[sessionKey]) { - sessionLogInfo = await sessionLog.getSession(params) - if (sessionLogInfo.code) { - return sessionLogInfo - } - if (this.debug) { - console.log('sessionLogInfo', JSON.stringify(sessionLogInfo)) - } - this.sessionLogInfo[sessionKey] = sessionLogInfo - } else { - sessionLogInfo = this.sessionLogInfo[sessionKey] - } - - // 会话数据 - sessionLogKey = sessionLogInfo.data.sessionLogId.toString() - if (!sessionData[sessionLogKey]) { - //临时存储减少查询次数 - sessionData[sessionLogKey] = { - pageCount: sessionLogInfo.data.pageCount + 1, - addPageCount: 1, - createTime: sessionLogInfo.data.createTime, - pageId: pageInfo._id, - uid: sessionLogInfo.data.uid - } - - if (this.debug) { - console.log('add sessionData - ' + sessionLogKey, sessionData) - } - - } else { - sessionData[sessionLogKey].pageCount += 1 - sessionData[sessionLogKey].addPageCount += 1 - sessionData[sessionLogKey].pageId = pageInfo._id - - if (this.debug) { - console.log('update sessionData - ' + sessionLogKey, sessionData) - } - } - - // 上级页面信息 - pageKey = params.ak + params.urlref - if (pageData[pageKey]) { - referPageInfo = pageData[pageKey] - } else { - referPageInfo = await page.getPageAndCreate(params.ak, params.urlref, page.getPageTitle(params)) - if (!referPageInfo || referPageInfo.length === 0) { - referPageInfo = {_id:''} - } - pageData[pageKey] = referPageInfo - } - - //当前页面url信息 - const urlInfo = parseUrl(params.url) - - //记录页面内容统计数据 - let pageDetailInfo - let referPageDetailInfo - if(this.getConfig('pageDetailStat')) { - pageDetailInfo = await pageDetail.getPageDetailByPageRules({ - appid: params.ak, - pageUrl: params.url, - pageTitle: page.getPageTitle(params), - pageId: pageInfo._id, - pageRules: pageInfo.page_rules - }) - if(this.debug) { - console.log('pageDetailInfo', pageDetailInfo) - } - if(params.urlref && referPageInfo) { - referPageDetailInfo = await pageDetail.getPageDetailByPageRules({ - appid: params.ak, - pageUrl: params.urlref, - pageTitle: page.getPageTitle(params), - pageId: referPageInfo._id, - pageRules: referPageInfo.page_rules - }) - } - } - - // 填充数据 - fillParams.push({ - appid: params.ak, - version: params.v ? params.v : '', - platform: platform.getPlatformCode(params.ut, params.p), - channel: channel.getChannelCode(params), - device_id: params.did, - uid: params.uid ? params.uid : '', - session_id: sessionLogInfo.data.sessionLogId, - page_id: pageInfo._id, - query_string: urlInfo.query, - //上级页面相关 - previous_page_id: referPageInfo._id, - previous_page_duration: params.urlref_ts ? parseInt(params.urlref_ts) : 0, - previous_page_is_entry: referPageInfo._id === sessionLogInfo.data.entryPageId ? 1 : 0, - page_detail_id: (pageDetailInfo && pageDetailInfo._id) || undefined, - previous_page_detail_id: (referPageDetailInfo && referPageDetailInfo._id) || undefined, - create_time: dateTime.getTime() - }) - } - - if (fillParams.length === 0) { - console.log('No page params') - return { - code: 200, - msg: 'Invild param' - } - } - - //日志数据入库 - const res = await this.insert(this.tableName, fillParams) - if (res && res.inserted) { - // 更新会话数据 - const nowTime = dateTime.getTime() - for (const sid in sessionData) { - await sessionLog.updateSession(sid, sessionData[sid]) - } - return { - code: 0, - msg: 'success' - } - } else { - return { - code: 500, - msg: 'Filled error' - } - } - } - - /** - * 页面日志清理 - * @param {Number} days 页面日志保留天数 - */ - async clean(days) { - if(days === 0) { - return false; - } - days = Math.max(parseInt(days), 1) - console.log('clean page logs - day:', days) - const dateTime = new DateTime() - const res = await this.delete(this.tableName, { - create_time: { - $lt: dateTime.getTimeBySetDays(0 - days) - } - }) - if (!res.code) { - console.log('clean page log:', res) - } - return res - } -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/pageResult.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/pageResult.js deleted file mode 100644 index c0594ee..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/pageResult.js +++ /dev/null @@ -1,585 +0,0 @@ -/** - * @class PageResult 页面结果统计模型 - */ -const BaseMod = require('./base') -const Platform = require('./platform') -const Channel = require('./channel') -const Version = require('./version') -const SessionLog = require('./sessionLog') -const PageLog = require('./pageLog') -const ShareLog = require('./shareLog') -const { - DateTime -} = require('../lib') -module.exports = class PageResult extends BaseMod { - constructor() { - super() - this.tableName = 'page-result' - this.platforms = [] - this.channels = [] - this.versions = [] - } - - /** - * 数据统计 - * @param {String} type 统计类型 hour:实时统计 day:按天统计,week:按周统计 month:按月统计 - * @param {Date|Time} date 指定日期或时间戳 - * @param {Boolean} reset 是否重置,为ture时会重置该批次数据 - */ - async stat(type, date, reset) { - //允许的类型 - const allowedType = ['day'] - if (!allowedType.includes(type)) { - return { - code: 1002, - msg: 'This type is not allowed' - } - } - this.fillType = type - //获取当前统计的时间范围 - const dateTime = new DateTime() - const dateDimension = dateTime.getTimeDimensionByType(type, -1, date) - this.startTime = dateDimension.startTime - this.endTime = dateDimension.endTime - if (this.debug) { - console.log('dimension time', this.startTime + '--' + this.endTime) - } - - // 查看当前时间段日志是否已存在,防止重复执行 - if (!reset) { - const checkRes = await this.getCollection(this.tableName).where({ - start_time: this.startTime, - end_time: this.endTime - }).get() - if (checkRes.data.length > 0) { - console.error('This page stat log have exists') - return { - code: 1003, - msg: 'This page stat log have existed' - } - } - } else { - const delRes = await this.delete(this.tableName, { - start_time: this.startTime, - end_time: this.endTime - }) - console.log('Delete old data result:', JSON.stringify(delRes)) - } - - // 数据获取 - this.pageLog = new PageLog() - const countRes = await this.getCollection(this.pageLog.tableName).where({ - create_time: { - $gte: this.startTime, - $lte: this.endTime - } - }).count() - let pageLogData = [] - //临时处理-数据量过大按小时分片组合 - if (countRes.total > 500000) { - const list = {} - for (let start = 0; start < 24; start++) { - const getRes = await this.aggregate(this.pageLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - page_id: 1, - create_time: 1 - }, - match: { - create_time: { - $gte: this.startTime + start * 3600000, - $lte: this.startTime + (start + 1) * 3600000 - 1 - } - }, - group: { - _id: { - appid: '$appid', - version: '$version', - platform: '$platform', - channel: '$channel', - page_id: '$page_id' - }, - visit_times: { - $sum: 1 - } - }, - sort: { - visit_times: 1 - }, - getAll: true - }) - - if (getRes.data.length) { - for (let resData of getRes.data) { - const resKey = Object.values(resData._id).join('_') - if (!list[resKey]) { - list[resKey] = resData - } else { - list[resKey].visit_times += resData.visit_times - } - } - } - } - pageLogData = Object.values(list) - } else { - const statRes = await this.aggregate(this.pageLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - page_id: 1, - create_time: 1 - }, - match: { - create_time: { - $gte: this.startTime, - $lte: this.endTime - } - }, - group: { - _id: { - appid: '$appid', - version: '$version', - platform: '$platform', - channel: '$channel', - page_id: '$page_id' - }, - visit_times: { - $sum: 1 - } - }, - sort: { - visit_times: 1 - }, - getAll: true - }) - pageLogData = statRes.data - } - - - let res = { - code: 0, - msg: 'success' - } - if (this.debug) { - console.log('Page statRes', JSON.stringify(pageLogData)) - } - if (pageLogData.length > 0) { - this.fillData = [] - //获取填充数据 - for (const i in pageLogData) { - try{ - await this.fill(pageLogData[i]) - }catch(e){ - console.error('page result data filled error', e) - } - } - - //数据批量入库 - if (this.fillData.length > 0) { - res = await this.batchInsert(this.tableName, this.fillData) - } - } - return res - } - - /** - * 页面统计数据填充 - * @param {Object} data 统计数据 - */ - async fill(data) { - // 平台信息 - let platformInfo = null - if (this.platforms && this.platforms[data._id.platform]) { - //暂存下数据,减少读库 - platformInfo = this.platforms[data._id.platform] - } else { - const platform = new Platform() - platformInfo = await platform.getPlatformAndCreate(data._id.platform, null) - if (!platformInfo || platformInfo.length === 0) { - platformInfo._id = '' - } - this.platforms[data._id.platform] = platformInfo - if (this.debug) { - console.log('platformInfo', JSON.stringify(platformInfo)) - } - } - - // 渠道信息 - let channelInfo = null - const channelKey = data._id.appid + '_' + platformInfo._id + '_' + data._id.channel - if (this.channels && this.channels[channelKey]) { - channelInfo = this.channels[channelKey] - } else { - const channel = new Channel() - channelInfo = await channel.getChannelAndCreate(data._id.appid, platformInfo._id, data._id.channel) - if (!channelInfo || channelInfo.length === 0) { - channelInfo._id = '' - } - this.channels[channelKey] = channelInfo - if (this.debug) { - console.log('channelInfo', JSON.stringify(channelInfo)) - } - } - - // 版本信息 - let versionInfo = null - const versionKey = data._id.appid + '_' + data._id.platform + '_' + data._id.version - if (this.versions && this.versions[versionKey]) { - versionInfo = this.versions[versionKey] - } else { - const version = new Version() - versionInfo = await version.getVersionAndCreate(data._id.appid, data._id.platform, data._id.version) - if (!versionInfo || versionInfo.length === 0) { - versionInfo._id = '' - } - this.versions[versionKey] = versionInfo - if (this.debug) { - console.log('versionInfo', JSON.stringify(versionInfo)) - } - } - - const matchCondition = data._id - Object.assign(matchCondition, { - create_time: { - $gte: this.startTime, - $lte: this.endTime - } - }) - if (this.debug) { - console.log('matchCondition', JSON.stringify(matchCondition)) - } - - // 当前页面访问设备数 - const statPageDeviceRes = await this.aggregate(this.pageLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - device_id: 1, - page_id: 1, - create_time: 1 - }, - match: matchCondition, - group: [{ - _id: { - device_id: '$device_id' - } - }, { - _id: {}, - total_devices: { - $sum: 1 - } - }] - }) - - let pageVisitDevices = 0 - if (statPageDeviceRes.data.length > 0) { - pageVisitDevices = statPageDeviceRes.data[0].total_devices - } - - //当前页面访问人数 - const statPageUserRes = await this.aggregate(this.pageLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - uid: 1, - page_id: 1, - create_time: 1 - }, - match: { - ...matchCondition, - uid: { - $ne: '' - } - }, - group: [{ - _id: { - uid: '$uid' - } - }, { - _id: {}, - total_users: { - $sum: 1 - } - }] - }) - - let pageVisitUsers = 0 - if (statPageUserRes.data.length > 0) { - pageVisitUsers = statPageUserRes.data[0].total_users - } - - // 退出次数 - const sessionLog = new SessionLog() - let existTimes = 0 - const existRes = await this.getCollection(sessionLog.tableName).where({ - appid: data._id.appid, - version: data._id.version, - platform: data._id.platform, - channel: data._id.channel, - exit_page_id: data._id.page_id, - create_time: { - $gte: this.startTime, - $lte: this.endTime - } - }).count() - if (existRes && existRes.total > 0) { - existTimes = existRes.total - } - - // 访问时长 - const statPageDurationRes = await this.aggregate(this.pageLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - previous_page_id: 1, - previous_page_duration: 1, - create_time: 1 - }, - match: { - appid: data._id.appid, - version: data._id.version, - platform: data._id.platform, - channel: data._id.channel, - previous_page_id: data._id.page_id, - create_time: { - $gte: this.startTime, - $lte: this.endTime - } - }, - group: { - _id: {}, - total_duration: { - $sum: '$previous_page_duration' - } - } - }) - - let totalDuration = 0 - if (statPageDurationRes.data.length > 0) { - totalDuration = statPageDurationRes.data[0].total_duration - } - - // 分享次数 - const shareLog = new ShareLog() - const statShareRes = await this.aggregate(shareLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - page_id: 1, - create_time: 1 - }, - match: { - appid: data._id.appid, - version: data._id.version, - platform: data._id.platform, - channel: data._id.channel, - page_id: data._id.page_id, - create_time: { - $gte: this.startTime, - $lte: this.endTime - } - }, - group: { - _id: {}, - share_count: { - $sum: 1 - } - } - }) - - let shareCount = 0 - if (statShareRes.data.length > 0) { - shareCount = statShareRes.data[0].share_count - } - - // 作为入口页的总次数和总访问时长 - const statPageEntryCountRes = await this.aggregate(this.pageLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - previous_page_id: 1, - previous_page_duration: 1, - previous_page_is_entry: 1, - create_time: 1 - }, - match: { - appid: data._id.appid, - version: data._id.version, - platform: data._id.platform, - channel: data._id.channel, - previous_page_id: data._id.page_id, - previous_page_is_entry: 1, - create_time: { - $gte: this.startTime, - $lte: this.endTime - } - }, - group: { - _id: {}, - entry_count: { - $sum: 1 - }, - entry_duration: { - $sum: '$previous_page_duration' - } - } - }) - - let entryCount = 0 - let entryDuration = 0 - if (statPageEntryCountRes.data.length > 0) { - entryCount = statPageEntryCountRes.data[0].entry_count - entryDuration = statPageEntryCountRes.data[0].entry_duration - } - - // 作为入口页的总设备数 - const statPageEntryDevicesRes = await this.aggregate(this.pageLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - device_id: 1, - previous_page_id: 1, - previous_page_is_entry: 1, - create_time: 1 - }, - match: { - appid: data._id.appid, - version: data._id.version, - platform: data._id.platform, - channel: data._id.channel, - previous_page_id: data._id.page_id, - previous_page_is_entry: 1, - create_time: { - $gte: this.startTime, - $lte: this.endTime - } - }, - group: [{ - _id: { - device_id: '$device_id' - } - }, { - _id: {}, - entry_devices: { - $sum: 1 - } - }] - }) - - let entryDevices = 0 - if (statPageEntryDevicesRes.data.length > 0) { - entryDevices = statPageEntryDevicesRes.data[0].entry_devices - } - - // 作为入口页的总人数 - const statPageEntryUsersRes = await this.aggregate(this.pageLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - uid: 1, - previous_page_id: 1, - previous_page_is_entry: 1, - create_time: 1 - }, - match: { - appid: data._id.appid, - version: data._id.version, - platform: data._id.platform, - channel: data._id.channel, - previous_page_id: data._id.page_id, - previous_page_is_entry: 1, - uid: { - $ne: '' - }, - create_time: { - $gte: this.startTime, - $lte: this.endTime - } - }, - group: [{ - _id: { - uid: '$uid' - } - }, { - _id: {}, - entry_users: { - $sum: 1 - } - }] - }) - - let entryUsers = 0 - if (statPageEntryUsersRes.data.length > 0) { - entryUsers = statPageEntryUsersRes.data[0].entry_users - } - - // 跳出率 - let bounceTimes = 0 - const bounceRes = await this.getCollection(sessionLog.tableName).where({ - appid: data._id.appid, - version: data._id.version, - platform: data._id.platform, - channel: data._id.channel, - entry_page_id: data._id.page_id, - page_count: 1, - create_time: { - $gte: this.startTime, - $lte: this.endTime - } - }).count() - if (bounceRes && bounceRes.total > 0) { - bounceTimes = bounceRes.total - } - let bounceRate = 0 - if (bounceTimes > 0 && data.visit_times > 0) { - bounceRate = bounceTimes * 100 / data.visit_times - bounceRate = parseFloat(bounceRate.toFixed(2)) - } - - // 数据填充 - const datetime = new DateTime() - const insertParams = { - appid: data._id.appid, - platform_id: platformInfo._id, - channel_id: channelInfo._id, - version_id: versionInfo._id, - page_id: data._id.page_id, - visit_times: data.visit_times, - visit_devices: pageVisitDevices, - visit_users: pageVisitUsers, - exit_times: existTimes, - duration: totalDuration > 0 ? totalDuration : 1, - share_count: shareCount, - entry_users: entryUsers, - entry_devices: entryDevices, - entry_count: entryCount, - entry_duration: entryDuration, - bounce_rate: bounceRate, - dimension: this.fillType, - stat_date: datetime.getDate('Ymd', this.startTime), - start_time: this.startTime, - end_time: this.endTime - } - this.fillData.push(insertParams) - return insertParams - } -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/platform.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/platform.js deleted file mode 100644 index c86d6ba..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/platform.js +++ /dev/null @@ -1,180 +0,0 @@ -/** - * @class Platform 应用平台模型 - */ -const BaseMod = require('./base') -const { - DateTime -} = require('../lib') -module.exports = class Platform extends BaseMod { - constructor() { - super() - this.tableName = 'app-platforms' - } - - /** - * 获取平台信息 - * @param {String} platform 平台代码 - * @param {String} os 系统 - */ - async getPlatform(platform, os) { - const cacheKey = 'uni-stat-platform-' + platform + '-' + os - let platformData = await this.getCache(cacheKey) - if (!platformData) { - const platformCode = this.getPlatformCode(platform, os) - const platformInfo = await this.getCollection(this.tableName).where({ - code: platformCode - }).limit(1).get() - platformData = [] - if (platformInfo.data.length > 0) { - platformData = platformInfo.data[0] - await this.setCache(cacheKey, platformData) - } - } - return platformData - } - - /** - * 获取平台信息没有则创建 - * @param {String} platform 平台代码 - * @param {String} os 系统 - */ - async getPlatformAndCreate(platform, os) { - if (!platform) { - return false - } - const platformInfo = await this.getPlatform(platform, os) - - if (platformInfo.length === 0) { - const platformCode = this.getPlatformCode(platform, os) - const insertParam = { - code: platformCode, - name: platformCode, - create_time: new DateTime().getTime() - } - const res = await this.insert(this.tableName, insertParam) - if (res && res.id) { - return Object.assign(insertParam, { - _id: res.id - }) - } - } - return platformInfo - } - - /** - * 获取平台代码 - * @param {String} platform 平台代码 - * @param {String} os 系统 - */ - getPlatformCode(platform, os) { - let platformCode = platform - - //兼容客户端上报参数 - switch (platform) { - //h5|web - case 'h5': - platformCode = 'web' - break - //微信小程序 - case 'wx': - platformCode = 'mp-weixin' - break - //百度小程序 - case 'bd': - platformCode = 'mp-baidu' - break - //支付宝小程序 - case 'ali': - platformCode = 'mp-alipay' - break - //字节跳动小程序 - case 'tt': - platformCode = 'mp-toutiao' - break - //qq小程序 - case 'qq': - platformCode = 'mp-qq' - break - //快应用联盟 - case 'qn': - platformCode = 'quickapp-webview-union' - break - //快应用(webview) - case 'qw': - platformCode = 'quickapp-webview' - break - //快应用华为 - case 'qi': - platformCode = 'quickapp-webview-huawei' - break - //360小程序 - case '360': - platformCode = 'mp-360' - break - //京东小程序 - case 'jd': - platformCode = 'mp-jd' - break - //钉钉小程序 - case 'dt': - platformCode = 'mp-dingtalk' - break - //快手小程序 - case 'ks': - platformCode = 'mp-kuaishou' - break - //飞书小程序 - case 'lark': - platformCode = 'mp-lark' - break - //鸿蒙元服务 - case 'mhm': - platformCode = 'mp-harmony' - break - //小红书小程序 - case 'xhs': - platformCode = 'mp-xhs' - break - //原生应用 - case 'app-android': - platformCode = 'android' - break - case 'app-ios': - platformCode = 'ios' - break - case 'app-harmony': - platformCode = 'harmony' - break - case 'n': - case 'app-plus': - case 'app': - os = this.getOsName(os) - if (os === 'ios') { - platformCode = 'ios' - } else if (os === 'harmonyos') { - platformCode = 'harmony' - } else { - platformCode = 'android' - } - break - } - return platformCode - } - - /** - * 获取系统名称 - * @param {Object} os系统标识 - */ - getOsName(os) { - if (!os) { - return '' - } - //兼容老版上报参数 - const osSetting = { - i: 'ios', - a: 'android', - h: 'harmonyos' - } - return osSetting[os] ? osSetting[os] : os - } -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/runErrors.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/runErrors.js deleted file mode 100644 index be09242..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/runErrors.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @class RunErrors 运行错误日志 - */ -const BaseMod = require('./base') -module.exports = class RunErrors extends BaseMod { - constructor() { - super() - this.tableName = 'run-errors' - } - - /** - * 创建日志 - * @param {Object} params 参数 - */ - async create(params) { - if (!params) return - const res = await this.insert(this.tableName, params) - return res - } -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/scenes.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/scenes.js deleted file mode 100644 index af04b3c..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/scenes.js +++ /dev/null @@ -1,80 +0,0 @@ -/** - * @class Scenes 场景值模型 - */ -const BaseMod = require('./base') -const Platform = require('./platform') -module.exports = class Scenes extends BaseMod { - constructor() { - super() - this.tableName = 'mp-scenes' - this.defualtCode = '1001' - } - - /** - * 获取场景值 - * @param {String} platform 平台代码 - * @param {String} code 场景值代码 - */ - async getScenes(platform, code) { - const cacheKey = 'uni-stat-scenes-' + platform + '-' + code - let scenesData = await this.getCache(cacheKey) - if (!scenesData) { - const scenesInfo = await this.getCollection(this.tableName).where({ - platform: platform, - scene_code: code - }).limit(1).get() - scenesData = [] - if (scenesInfo.data.length > 0) { - scenesData = scenesInfo.data[0] - await this.setCache(cacheKey, scenesData) - } - } - return scenesData - } - - /** - * 通过平台编号获取场景值 - * @param {String} platformId 平台编号 - * @param {String} code 场景值代码 - */ - async getScenesByPlatformId(platformId, code) { - const platform = new Platform() - let platformInfo = await this.getCollection(platform.tableName).where({ - _id: platformId - }).limit(1).get() - let scenesData - if (platformInfo.data.length > 0) { - platformInfo = platformInfo.data[0] - scenesData = await this.getScenes(platformInfo.code, code) - } else { - scenesData = [] - } - return scenesData - } - - /** - * 获取场景值名称 - * @param {String} platform 平台代码 - * @param {String} code 场景值代码 - */ - async getScenesName(platform, code) { - const scenesData = await this.getScenes(platform, code) - if (scenesData.length === 0) { - return '' - } - return scenesData.scene_name - } - - /** - * 通过平台编号获取场景值名称 - * @param {String} platformId 平台编号 - * @param {String} code 场景值代码 - */ - async getScenesNameByPlatformId(platformId, code) { - const scenesData = await this.getScenesByPlatformId(platformId, code) - if (scenesData.length === 0) { - return code === this.defualtCode ? '默认' : '' - } - return scenesData.scene_name - } -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/sessionLog.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/sessionLog.js deleted file mode 100644 index 4e13768..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/sessionLog.js +++ /dev/null @@ -1,346 +0,0 @@ -/** - * @class SessionLog 基础会话日志模型 - */ -const BaseMod = require('./base') -const Page = require('./page') -const Platform = require('./platform') -const Channel = require('./channel') -const UserSessionLog = require('./userSessionLog') -const Device = require('./device') -const { - DateTime -} = require('../lib') -module.exports = class SessionLog extends BaseMod { - constructor() { - super() - this.tableName = 'session-logs' - } - - - /** - * 会话日志批量填充 - * @param {Object} reportParams 上报参数 - */ - async batchFill(reportParams) { - let params, pageInfo, nowTime, firstVistTime, lastVistTime; - const fillParams = [] - - const page = new Page() - const platform = new Platform() - const dateTime = new DateTime() - const channel = new Channel() - const device = new Device() - let res - for (const pk in reportParams) { - params = reportParams[pk] - res = await this.fill(params) - if (res.code) { - console.error(res.msg) - } else { - //添加设备信息 - await device.setDevice(params) - } - } - return res - } - - /** - * 会话日志填充 - * @param {Object} params 上报参数 - */ - async fill(params) { - // 应用信息 - if (!params.ak) { - return { - code: 200, - msg: 'Parameter "ak" not found' - } - } - - // 平台信息 - if (!params.ut) { - return { - code: 200, - msg: 'Parameter "ut" not found' - } - } - - // 设备信息 - if (!params.did) { - return { - code: 200, - msg: 'Parameter "did" not found' - } - } - - // 页面信息 - const page = new Page() - const pageInfo = await page.getPageAndCreate(params.ak, params.url, page.getPageTitle(params)) - if (!pageInfo || pageInfo.length === 0) { - return { - code: 300, - msg: 'Not found this entry page' - } - } - if (this.debug) { - console.log('pageInfo', JSON.stringify(pageInfo)) - } - const platform = new Platform() - const dateTime = new DateTime() - const channel = new Channel() - const nowTime = dateTime.getTime() - const firstVistTime = params.fvts ? dateTime.strToTime(params.fvts) : nowTime - const lastVistTime = (params.lvts && params.lvts !== '0') ? dateTime.strToTime(params.lvts) : 0 - - const fillParams = { - appid: params.ak, - version: params.v ? params.v : '', - platform: platform.getPlatformCode(params.ut, params.p), - channel: channel.getChannelCode(params), - type: params.cst ? parseInt(params.cst) : 0, - // 访问设备 - device_id: params.did, - //是否为首次访问,判断标准:最后一次访问时间为0 - is_first_visit: (params.lt === '1' && !lastVistTime) ? 1 : 0, - first_visit_time: firstVistTime, - last_visit_time: nowTime, - visit_count: params.tvc ? parseInt(params.tvc) : 1, - // 用户相关 - last_visit_user_id: params.uid ? params.uid : '', - // 页面相关 - entry_page_id: pageInfo._id, - exit_page_id: pageInfo._id, - page_count: 0, - event_count: 0, - duration: 1, - // 版本 - sdk_version: params.mpsdk ? params.mpsdk : '', - platform_version: params.mpv ? params.mpv : '', - // 设备相关 - device_os_name: params.on ? params.on : platform.getOsName(params.p), - device_os_version: params.sv ? params.sv : '', - device_vendor: params.brand ? params.brand : '', - device_model: params.md ? params.md : '', - device_language: params.lang ? params.lang : '', - device_pixel_ratio: params.pr ? params.pr : '', - device_window_width: params.ww ? params.ww : '', - device_window_height: params.wh ? params.wh : '', - device_screen_width: params.sw ? params.sw : '', - device_screen_height: params.sh ? params.sh : '', - // 地区相关 - location_ip: params.ip ? params.ip : '', - location_latitude: params.lat ? parseFloat(params.lat) : -1, - location_longitude: params.lng ? parseFloat(params.lng) : -1, - location_country: params.cn ? params.cn : '', - location_province: params.pn ? params.pn : '', - location_city: params.ct ? params.ct : '', - is_finish: 0, - create_time: nowTime - } - - if(this.isHaveOldDeviceId(params)) { - fillParams.old_device_id = params.odid - } - - const res = await this.insert(this.tableName, fillParams) - - if (res && res.id) { - - //填充用户的会话日志 - if (params.uid) { - await new UserSessionLog().fill({ - ...params, - page_id: pageInfo._id, - sid: res.id - }) - } - - return { - code: 0, - msg: 'success', - data: { - pageId: pageInfo._id, - pageRules: pageInfo.page_rules, - sessionLogId: res.id, - entryPageId: fillParams.entry_page_id, - eventCount: fillParams.event_count, - startTime: fillParams.first_visit_time, - createTime: fillParams.create_time, - pageCount: fillParams.page_count, - uid: fillParams.last_visit_user_id - } - } - } else { - return { - code: 500, - msg: 'Session log filled error' - } - } - } - - /** - * 判断是否包含老版本sdk生成的device_id, 此功能用于处理前端sdk升级后 device_id 发生变化导致日活、留存数据不准确的问题 - * @param {Object} params - */ - isHaveOldDeviceId(params) { - if(params.odid && params.odid !== params.did && params.odid !== 'YluY92BA6nJ6NfixI77sFQ%3D%3D&ie=1') { - console.log('params.odid', params.odid) - return true - } - return false - } - - - /** - * 获取会话 - * @param {Object} params 上报参数 - */ - async getSession(params) { - // 页面信息 - const page = new Page() - const pageInfo = await page.getPageAndCreate(params.ak, params.url, page.getPageTitle(params)) - if (!pageInfo || pageInfo.length === 0) { - return { - code: 300, - msg: 'Not found this entry page' - } - } - - const platformObj = new Platform() - const platform = platformObj.getPlatformCode(params.ut, params.p) - // 查询日志 - const sessionLogInfo = await this.getCollection(this.tableName).where({ - appid: params.ak, - platform: platform, - device_id: params.did, - is_finish: 0 - }).orderBy('create_time', 'desc').limit(1).get() - - if (sessionLogInfo.data.length > 0) { - const userSessionLog = new UserSessionLog() - const sessionLogInfoData = sessionLogInfo.data[0] - // 最后一次访问时间距现在超过半小时算上次会话已结束并生成一次新的会话 - let sessionExpireTime = this.getConfig('sessionExpireTime') - sessionExpireTime = sessionExpireTime ? sessionExpireTime : 1800 - const sessionTime = new DateTime().getTime() - sessionLogInfoData.last_visit_time - if (sessionTime >= sessionExpireTime * 1000) { - if (this.debug) { - console.log('session log time expired', sessionTime) - } - await this.update(this.tableName, { - is_finish: 1 - }, { - appid: params.ak, - platform: platform, - device_id: params.did, - is_finish: 0 - }) - //关闭用户会话 - await userSessionLog.closeUserSession() - - return await this.fill(params) - } else { - //如果当前会话切换了用户则生成新的用户会话 - if (params.uid != sessionLogInfoData.last_visit_user_id) { - await userSessionLog.checkUserSession({ - ...params, - page_id: pageInfo._id, - sid: sessionLogInfoData._id, - last_visit_user_id: sessionLogInfoData.last_visit_user_id - }) - - await this.update(this.tableName, { - last_visit_user_id: params.uid ? params.uid : '' - }, { - _id: sessionLogInfoData._id - }) - } - - return { - code: 0, - msg: 'success', - data: { - pageId: pageInfo._id, - pageRules: pageInfo.page_rules, - sessionLogId: sessionLogInfoData._id, - entryPageId: sessionLogInfoData.entry_page_id, - eventCount: sessionLogInfoData.event_count, - startTime: sessionLogInfoData.first_visit_time, - createTime: sessionLogInfoData.create_time, - pageCount: sessionLogInfoData.page_count, - uid: sessionLogInfoData.last_visit_user_id - } - } - } - } else { - return await this.fill(params) - } - } - - /** - * 更新会话信息 - * @param {String} sid 会话编号 - * @param {Object} data 更新数据 - */ - async updateSession(sid, data) { - const nowTime = new DateTime().getTime() - const accessTime = nowTime - data.createTime - const accessSenconds = accessTime > 1000 ? parseInt(accessTime / 1000) : 1 - - const updateData = { - last_visit_time: nowTime, - duration: accessSenconds, - } - //访问页面数量 - if (data.addPageCount) { - updateData.page_count = data.pageCount - } - //最终访问的页面编号 - if (data.pageId) { - updateData.exit_page_id = data.pageId - } - //产生事件次数 - if (data.eventCount) { - updateData.event_count = data.eventCount - } - - if (this.debug) { - console.log('update session log by sid-' + sid, updateData) - } - - //更新会话 - await this.update(this.tableName, updateData, { - _id: sid - }) - - //更新用户会话 - if (data.uid) { - data.nowTime = nowTime - await new UserSessionLog().updateUserSession(sid, data) - } - - return true - } - - /** - * 清理日志数据 - * @param {Number} days 保留天数, 留存统计需要计算30天后留存率,因此至少应保留31天的日志数据 - */ - async clean(days) { - if(days === 0) { - return false; - } - days = Math.max(parseInt(days), 1) - console.log('clean session logs - day:', days) - const dateTime = new DateTime() - const res = await this.delete(this.tableName, { - create_time: { - $lt: dateTime.getTimeBySetDays(0 - days) - } - }) - if (!res.code) { - console.log('clean session log:', res) - } - return res - } -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/setting.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/setting.js deleted file mode 100644 index c0ebc94..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/setting.js +++ /dev/null @@ -1,44 +0,0 @@ -/** - * @class Version 应用版本模型 - */ -const BaseMod = require('./base') -const { - DateTime -} = require('../lib') -module.exports = class Setting extends BaseMod { - constructor() { - super() - this.tableName = 'opendb-tempdata' - this.tablePrefix = false - this.settingKey = "uni-stat-setting" - } - - /** - * 获取统计云端配置 - */ - async getSetting() { - const res = await this.getCollection(this.tableName).doc(this.settingKey).get(); - if (res.data && res.data[0] && res.data[0].value) { - return res.data[0].value; - } else { - return { - mode: "open", - day: 7 - }; - } - } - /** - * 检测N天内是否有设备访问记录,如果有,则返回true,否则返回false - */ - async checkAutoRun(obj = {}) { - let { - day = 7 - } = obj; - const _ = this.dbCmd; - let nowTime = Date.now(); - const res = await this.getCollection("uni-stat-session-logs").where({ - create_time: _.gte(nowTime - 1000 * 3600 * 24 * day) - }).count(); - return res.total > 0 ? true : false; - } -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/shareLog.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/shareLog.js deleted file mode 100644 index 0df5551..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/shareLog.js +++ /dev/null @@ -1,118 +0,0 @@ -/** - * @class ShareLog 分享日志模型 - */ -const BaseMod = require('./base') -const Platform = require('./platform') -const Channel = require('./channel') -const SessionLog = require('./sessionLog') -const PageDetail = require('./pageDetail') -const { - DateTime -} = require('../lib') -module.exports = class ShareLog extends BaseMod { - constructor() { - super() - this.tableName = 'share-logs' - } - - /** - * 分析日志填充 - * @param {Object} reportParams 上报参数 - * @param {Object} sessionLogData 会话日志数据,此参数传递可减少数据库查询 - */ - async fill(reportParams, sessionLogData) { - let params, sessionLogInfo, sessionKey; - const fillParams = [] - const sessionLog = new SessionLog() - const platform = new Platform() - const dateTime = new DateTime() - const channel = new Channel() - const pageDetail = new PageDetail() - for (const rk in reportParams) { - params = reportParams[rk] - - //暂存下会话数据,减少读库 - sessionKey = params.ak + params.did + params.p - if (!sessionLogData[sessionKey]) { - // 会话日志 - sessionLogInfo = await sessionLog.getSession(params) - if (sessionLogInfo.code) { - return sessionLogInfo - } - if (this.debug) { - console.log('sessionLogInfo', JSON.stringify(sessionLogInfo)) - } - sessionLogData[sessionKey] = sessionLogInfo - } else { - sessionLogInfo = sessionLogData[sessionKey] - } - - let pageDetailInfo - if(this.getConfig('pageDetailStat')) { - pageDetailInfo = await pageDetail.getPageDetailByPageRules({ - appid: params.ak, - pageUrl: params.url, - pageTitle: params.ttpj, - pageId: sessionLogInfo.data.pageId, - pageRules: sessionLogInfo.data.pageRules - }) - } - - // 填充数据 - fillParams.push({ - appid: params.ak, - version: params.v ? params.v : '', - platform: platform.getPlatformCode(params.ut, params.p), - channel: channel.getChannelCode(params), - device_id: params.did, - uid: params.uid ? params.uid : '', - session_id: sessionLogInfo.data.sessionLogId, - page_id: sessionLogInfo.data.pageId, - page_detail_id: (pageDetailInfo && pageDetailInfo._id) || undefined, - create_time: dateTime.getTime() - }) - } - - if (fillParams.length === 0) { - return { - code: 200, - msg: 'Invild param' - } - } - - const res = await this.insert(this.tableName, fillParams) - if (res && res.inserted) { - return { - code: 0, - msg: 'success' - } - } else { - return { - code: 500, - msg: 'Filled error' - } - } - } - - /** - * 分享日志清理 - * @param {Number} days 保留天数 - */ - async clean(days) { - if(days === 0) { - return false; - } - days = Math.max(parseInt(days), 1) - console.log('clean share logs - day:', days) - const dateTime = new DateTime() - const res = await this.delete(this.tableName, { - create_time: { - $lt: dateTime.getTimeBySetDays(0 - days) - } - }) - if (!res.code) { - console.log('clean share log:', res) - } - return res - } -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/statResult.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/statResult.js deleted file mode 100644 index 0035d28..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/statResult.js +++ /dev/null @@ -1,2155 +0,0 @@ -/** - * @class StatResult 基础数据结果统计模型 - */ -const BaseMod = require('./base') -const Platform = require('./platform') -const Channel = require('./channel') -const Version = require('./version') -const SessionLog = require('./sessionLog') -const UserSessionLog = require('./userSessionLog') -const ErrorLog = require('./errorLog') -const ActiveDevices = require('./activeDevices') -const ActiveUsers = require('./activeUsers') -const UniIDUsers = require('./uniIDUsers') -const { - DateTime -} = require('../lib') -module.exports = class StatResult extends BaseMod { - constructor() { - super() - this.tableName = 'result' - this.platforms = [] - this.channels = [] - this.versions = [] - } - - /** - * 基础数据统计 - * @param {String} type 统计类型 hour:实时统计 day:按天统计,week:按周统计 month:按月统计 - * @param {Date|Time} date 指定日期或时间戳 - * @param {Boolean} reset 是否重置,为ture时会重置该批次数据 - */ - async stat(type, date, reset) { - const allowedType = ['hour', 'day', 'week', 'month'] - if (!allowedType.includes(type)) { - return { - code: 1002, - msg: 'This type is not allowed' - } - } - - if (this.debug) { - console.log('result --type:' + type + ', date:' + date + ', reset:' + reset) - } - - this.fillType = type - const dateTime = new DateTime() - const dateDimension = dateTime.getTimeDimensionByType(type, -1, date) - this.startTime = dateDimension.startTime - this.endTime = dateDimension.endTime - if (this.debug) { - console.log('dimension time', this.startTime + '--' + this.endTime) - } - - // 查看当前时间段日志是否已存在,防止重复生成 - if (!reset) { - const checkRes = await this.getCollection(this.tableName).where({ - dimension: this.fillType, - start_time: this.startTime, - end_time: this.endTime - }).get() - if (checkRes.data.length > 0) { - console.log('log have existed') - return { - code: 1003, - msg: 'This log have existed' - } - } - } else { - const delRes = await this.delete(this.tableName, { - start_time: this.startTime, - end_time: this.endTime - }) - console.log('delete old data result:', JSON.stringify(delRes)) - } - - // 周月数据单独统计 - if (['week', 'month'].includes(this.fillType)) { - return await this.statWeekOrMonth() - } - - // 数据获取 - this.sessionLog = new SessionLog() - const statRes = await this.aggregate(this.sessionLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - is_first_visit: 1, - page_count: 1, - duration: 1, - create_time: 1 - }, - match: { - create_time: { - $gte: this.startTime, - $lte: this.endTime - } - }, - group: { - _id: { - appid: '$appid', - version: '$version', - platform: '$platform', - channel: '$channel' - }, - new_device_count: { - $sum: '$is_first_visit' - }, - page_view_count: { - $sum: '$page_count' - }, - total_duration: { - $sum: '$duration' - }, - session_times: { - $sum: 1 - } - }, - sort: { - new_device_count: 1, - page_view_count: 1, - session_times: 1 - }, - getAll: true - }) - - let res = { - code: 0, - msg: 'success' - } - if (this.debug) { - console.log('statRes', JSON.stringify(statRes)) - } - - this.fillData = [] - this.composes = [] - if (statRes.data.length > 0) { - for (const i in statRes.data) { - await this.fill(statRes.data[i]) - } - } - //补充数据 - await this.replenishStat() - if (this.fillData.length > 0) { - res = await this.batchInsert(this.tableName, this.fillData) - } - return res - } - - /** - * 按周/月统计 - */ - async statWeekOrMonth() { - const statRes = await this.aggregate(this.tableName, { - project: { - appid: 1, - version_id: 1, - platform_id: 1, - channel_id: 1, - new_device_count: 1, - new_user_count: 1, - page_visit_count: 1, - user_visit_times: 1, - app_launch_count: 1, - error_count: 1, - bounce_times: 1, - duration: 1, - user_duration: 1, - dimension: 1, - start_time: 1 - }, - match: { - dimension: 'day', - start_time: { - $gte: this.startTime, - $lte: this.endTime - } - }, - group: { - _id: { - appid: '$appid', - version_id: '$version_id', - platform_id: '$platform_id', - channel_id: '$channel_id' - }, - new_device_count: { - $sum: '$new_device_count' - }, - new_user_count: { - $sum: '$new_user_count' - }, - error_count: { - $sum: '$error_count' - }, - page_count: { - $sum: '$page_visit_count' - }, - total_duration: { - $sum: '$duration' - }, - total_user_duration: { - $sum: '$user_duration' - }, - total_user_session_times: { - $sum: '$user_session_times' - }, - session_times: { - $sum: '$app_launch_count' - }, - total_bounce_times: { - $sum: '$bounce_times' - } - }, - sort: { - new_device_count: 1, - error_count: 1, - page_count: 1 - }, - getAll: true - }) - - let res = { - code: 0, - msg: 'success' - } - if (this.debug) { - console.log('statRes', JSON.stringify(statRes)) - } - - this.activeDevices = new ActiveDevices() - this.activeUsers = new ActiveUsers() - this.fillData = [] - this.composes = [] - if (statRes.data.length > 0) { - for (const i in statRes.data) { - await this.getWeekOrMonthData(statRes.data[i]) - } - } - //补充数据 - await this.replenishStat() - if (this.fillData.length > 0) { - res = await this.batchInsert(this.tableName, this.fillData) - } - return res - } - - /** - * 获取周/月维度的填充数据 - * @param {Object} data 统计数据 - */ - async getWeekOrMonthData(data) { - - const matchCondition = { - ...data._id, - create_time: { - $gte: this.startTime, - $lte: this.endTime - } - } - - // 查询活跃设备数 - const statVisitDeviceRes = await this.getCollection(this.activeDevices.tableName).where({ - ...matchCondition, - dimension: this.fillType - }).count() - - let activeDeviceCount = 0 - if (statVisitDeviceRes && statVisitDeviceRes.total > 0) { - activeDeviceCount = statVisitDeviceRes.total - } - - // 设备次均停留时长 - let avgSessionTime = 0 - if (data.total_duration > 0 && data.session_times > 0) { - avgSessionTime = Math.round(data.total_duration / data.session_times) - } - - // 设均停留时长 - let avgDeviceTime = 0 - if (data.total_duration > 0 && activeDeviceCount > 0) { - avgDeviceTime = Math.round(data.total_duration / activeDeviceCount) - } - - // 跳出率 - let bounceRate = 0 - if (data.total_bounce_times > 0 && data.session_times > 0) { - bounceRate = data.total_bounce_times * 100 / data.session_times - bounceRate = parseFloat(bounceRate.toFixed(2)) - } - - // 累计设备数 - let totalDevices = data.new_device_count - const totalDeviceRes = await this.getCollection(this.tableName).where({ - ...matchCondition, - dimension: this.fillType, - start_time: { - $lt: this.startTime - } - }).orderBy('start_time', 'desc').limit(1).get() - if (totalDeviceRes && totalDeviceRes.data.length > 0) { - totalDevices += totalDeviceRes.data[0].total_devices - } - - //活跃用户数 - const statVisitUserRes = await this.getCollection(this.activeUsers.tableName).where({ - ...matchCondition, - dimension: this.fillType - }).count() - let activeUserCount = 0 - if (statVisitUserRes && statVisitUserRes.total > 0) { - activeUserCount = statVisitUserRes.total - } - - // 平台信息 - let platformInfo = null - if (this.platforms && this.platforms[data._id.platform_id]) { - platformInfo = this.platforms[data._id.platform_id] - } else { - const platform = new Platform() - platformInfo = await this.getById(platform.tableName, data._id.platform_id) - if (!platformInfo || platformInfo.length === 0) { - platformInfo.code = '' - } - this.platforms[data._id.platform_id] = platformInfo - } - - // 渠道信息 - let channelInfo = null - if (this.channels && this.channels[data._id.channel_id]) { - channelInfo = this.channels[data._id.channel_id] - } else { - const channel = new Channel() - channelInfo = await this.getById(channel.tableName, data._id.channel_id) - if (!channelInfo || channelInfo.length === 0) { - channelInfo.channel_code = '' - } - this.channels[data._id.channel_id] = channelInfo - } - - // 版本信息 - let versionInfo = null - if (this.versions && this.versions[data._id.version_id]) { - versionInfo = this.versions[data._id.version_id] - } else { - const version = new Version() - versionInfo = await this.getById(version.tableName, data._id.version_id, false) - if (!versionInfo || versionInfo.length === 0) { - versionInfo.version = '' - } - this.versions[data._id.version_id] = versionInfo - } - - //总用户数 - const uniIDUsers = new UniIDUsers() - let totalUserCount = await uniIDUsers.getUserCount(data._id.appid, platformInfo.code, channelInfo.channel_code, versionInfo.version, { - $lte: this.endTime - }) - - //人均停留时长 - let avgUserTime = 0 - if (data.total_user_duration > 0 && activeUserCount > 0) { - avgUserTime = Math.round(data.total_user_duration / activeUserCount) - } - - //用户次均访问时长 - let avgUserSessionTime = 0 - if (data.total_user_duration > 0 && data.total_user_session_times > 0) { - avgUserSessionTime = Math.round(data.total_user_duration / data.total_user_session_times) - } - - //安卓平台活跃设备数需要减去sdk更新后device_id发生变更的设备数 - if(platformInfo.code === 'android') { - try{ - const statVisitOldDeviceRes = await this.getCollection(this.activeDevices.tableName).where({ - ...data._id, - create_time: { - $gte: this.startTime, - $lte: this.endTime - }, - dimension: this.fillType + '-old' - }).count() - if (statVisitOldDeviceRes && statVisitOldDeviceRes.total > 0) { - // 活跃设备留存数 - activeDeviceCount -= statVisitOldDeviceRes.total - //平均设备停留时长 - avgDeviceTime = Math.round(data.total_duration / activeDeviceCount) - } - } catch (e) { - console.log('server error: ' + e) - } - } - - const insertParam = { - appid: data._id.appid, - platform_id: data._id.platform_id, - channel_id: data._id.channel_id, - version_id: data._id.version_id, - //总设备数 - total_devices: totalDevices, - //本时间段新增设备数 - new_device_count: data.new_device_count, - //登录用户会话次数 - user_session_times: data.total_user_session_times, - //活跃设备数 - active_device_count: activeDeviceCount, - //总用户数 - total_users: totalUserCount, - //新增用户数 - new_user_count: data.new_user_count, - //活跃用户数 - active_user_count: activeUserCount, - //应用启动次数 = 设备会话次数 - app_launch_count: data.session_times, - //页面访问次数 - page_visit_count: data.page_view_count, - //错误次数 - error_count: data.error_count, - //会话总访问时长 - duration: data.total_duration, - //用户会话总访问时长 - user_duration: data.total_user_duration, - avg_device_session_time: avgSessionTime, - avg_user_session_time: avgUserSessionTime, - avg_device_time: avgDeviceTime, - avg_user_time: avgUserTime, - bounce_times: data.total_bounce_times, - bounce_rate: bounceRate, - retention: {}, - dimension: this.fillType, - stat_date: new DateTime().getDate('Ymd', this.startTime), - start_time: this.startTime, - end_time: this.endTime - } - - this.fillData.push(insertParam) - this.composes.push(data._id.appid + '_' + data._id.platform_id + '_' + data._id.channel_id + '_' + data - ._id.version_id) - - return insertParam - } - - /** - * 基础填充数据-目前只有小时和天维度的数据 - * @param {Object} data 统计数据 - */ - async fill(data) { - // 平台信息 - let platformInfo = null - if (this.platforms && this.platforms[data._id.platform]) { - //暂存下数据,减少读库 - platformInfo = this.platforms[data._id.platform] - } else { - const platform = new Platform() - platformInfo = await platform.getPlatformAndCreate(data._id.platform, null) - if (!platformInfo || platformInfo.length === 0) { - platformInfo._id = '' - } - this.platforms[data._id.platform] = platformInfo - if (this.debug) { - console.log('platformInfo', JSON.stringify(platformInfo)) - } - } - - // 渠道信息 - let channelInfo = null - const channelKey = data._id.appid + '_' + platformInfo._id + '_' + data._id.channel - if (this.channels && this.channels[channelKey]) { - channelInfo = this.channels[channelKey] - } else { - const channel = new Channel() - channelInfo = await channel.getChannelAndCreate(data._id.appid, platformInfo._id, data._id.channel) - if (!channelInfo || channelInfo.length === 0) { - channelInfo._id = '' - } - this.channels[channelKey] = channelInfo - if (this.debug) { - console.log('channelInfo', JSON.stringify(channelInfo)) - } - } - - // 版本信息 - let versionInfo = null - const versionKey = data._id.appid + '_' + data._id.platform + '_' + data._id.version - if (this.versions && this.versions[versionKey]) { - versionInfo = this.versions[versionKey] - } else { - const version = new Version() - versionInfo = await version.getVersionAndCreate(data._id.appid, data._id.platform, data._id.version) - if (!versionInfo || versionInfo.length === 0) { - versionInfo._id = '' - } - this.versions[versionKey] = versionInfo - if (this.debug) { - console.log('versionInfo', JSON.stringify(versionInfo)) - } - } - - // 访问设备数统计 - const matchCondition = data._id - Object.assign(matchCondition, { - create_time: { - $gte: this.startTime, - $lte: this.endTime - } - }) - const statVisitDeviceRes = await this.aggregate(this.sessionLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - device_id: 1, - create_time: 1 - }, - match: matchCondition, - group: [{ - _id: { - device_id: '$device_id' - } - }, { - _id: {}, - total_devices: { - $sum: 1 - } - }] - }) - let activeDeviceCount = 0 - if (statVisitDeviceRes.data.length > 0) { - activeDeviceCount = statVisitDeviceRes.data[0].total_devices - } - - //安卓平台活跃设备数需要减去sdk更新后device_id发生变更的设备数 - if(platformInfo.code === 'android') { - const oldDeviceRes = await this.aggregate(this.sessionLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - old_device_id: 1, - create_time: 1 - }, - match: matchCondition, - group: { - _id: { - device_id: '$old_device_id' - }, - create_time: { - $min: '$create_time' - }, - sessionCount: { - $sum: 1 - } - }, - sort: { - create_time: 1, - sessionCount: 1 - }, - getAll: true - }) - - if(oldDeviceRes.data.length) { - const thisOldDeviceIds = [] - for (const tau in oldDeviceRes.data) { - if(oldDeviceRes.data[tau]._id.device_id) { - thisOldDeviceIds.push(oldDeviceRes.data[tau]._id.device_id) - } - } - const statVisitOldDeviceRes = await this.aggregate(this.sessionLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - device_id: 1, - create_time: 1 - }, - match: { - ...matchCondition, - device_id: { - $in: thisOldDeviceIds - } - }, - group: [{ - _id: { - device_id: '$device_id' - } - }, { - _id: {}, - total_devices: { - $sum: 1 - } - }] - }) - - if (this.debug) { - console.log('statVisitOldDeviceRes', JSON.stringify(statVisitOldDeviceRes)) - } - if (statVisitOldDeviceRes && statVisitOldDeviceRes.data.length > 0) { - // 活跃设备留存数 - activeDeviceCount -= statVisitOldDeviceRes.data[0].total_devices - } - } - } - - // 错误数量统计 - const errorLog = new ErrorLog() - const statErrorRes = await this.getCollection(errorLog.tableName).where(matchCondition).count() - let errorCount = 0 - if (statErrorRes && statErrorRes.total > 0) { - errorCount = statErrorRes.total - } - - // 设备的次均停留时长,设备访问总时长/设备会话次数 - let avgSessionTime = 0 - if (data.total_duration > 0 && data.session_times > 0) { - avgSessionTime = Math.round(data.total_duration / data.session_times) - } - - // 设均停留时长 - let avgDeviceTime = 0 - if (data.total_duration > 0 && activeDeviceCount > 0) { - avgDeviceTime = Math.round(data.total_duration / activeDeviceCount) - } - - // 跳出率 - let bounceTimes = 0 - const bounceRes = await this.getCollection(this.sessionLog.tableName).where({ - ...matchCondition, - page_count: 1 - }).count() - if (bounceRes && bounceRes.total > 0) { - bounceTimes = bounceRes.total - } - let bounceRate = 0 - if (bounceTimes > 0 && data.session_times > 0) { - bounceRate = bounceTimes * 100 / data.session_times - bounceRate = parseFloat(bounceRate.toFixed(2)) - } - - // 应用启动次数 = 会话次数 - const launchCount = data.session_times - - // 累计设备数 - let totalDevices = data.new_device_count - const totalDeviceRes = await this.getCollection(this.tableName).where({ - appid: data._id.appid, - platform_id: platformInfo._id, - channel_id: channelInfo._id, - version_id: versionInfo._id, - dimension: this.fillType, - start_time: { - $lt: this.startTime - } - }).orderBy('start_time', 'desc').limit(1).get() - - if (totalDeviceRes && totalDeviceRes.data.length > 0) { - totalDevices += totalDeviceRes.data[0].total_devices - } - - //活跃用户数 - const userSessionLog = new UserSessionLog() - let activeUserCount = 0 - const activeUserCountRes = await this.aggregate(userSessionLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - uid: 1, - create_time: 1 - }, - match: matchCondition, - group: [{ - _id: { - uid: '$uid' - } - }, { - _id: {}, - total_users: { - $sum: 1 - } - }] - }) - - if (activeUserCountRes && activeUserCountRes.data.length > 0) { - activeUserCount = activeUserCountRes.data[0].total_users - } - - //新增用户数 - const uniIDUsers = new UniIDUsers() - let newUserCount = await uniIDUsers.getUserCount(matchCondition.appid, matchCondition.platform, - matchCondition.channel, matchCondition.version, { - $gte: this.startTime, - $lte: this.endTime - }) - - //总用户数 - let totalUserCount = await uniIDUsers.getUserCount(matchCondition.appid, matchCondition.platform, - matchCondition.channel, matchCondition.version, { - $lte: this.endTime - }) - - - //用户停留总时长及总会话次数 - let totalUserDuration = 0 - let totalUserSessionTimes = 0 - const totalUserDurationRes = await this.aggregate(userSessionLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - duration: 1, - create_time: 1 - }, - match: matchCondition, - group: [{ - _id: {}, - total_duration: { - $sum: "$duration" - }, - total_session_times: { - $sum: 1 - } - }] - }) - if (totalUserDurationRes && totalUserDurationRes.data.length > 0) { - totalUserDuration = totalUserDurationRes.data[0].total_duration - totalUserSessionTimes = totalUserDurationRes.data[0].total_session_times - } - - //人均停留时长 - let avgUserTime = 0 - //用户次均访问时长 - let avgUserSessionTime = 0 - if (totalUserDuration > 0 && activeUserCount > 0) { - avgUserTime = Math.round(totalUserDuration / activeUserCount) - avgUserSessionTime = Math.round(totalUserDuration / totalUserSessionTimes) - } - - //设置填充数据 - const datetime = new DateTime() - const insertParam = { - appid: data._id.appid, - platform_id: platformInfo._id, - channel_id: channelInfo._id, - version_id: versionInfo._id, - total_devices: totalDevices, - new_device_count: data.new_device_count, - active_device_count: activeDeviceCount, - total_users: totalUserCount, - new_user_count: newUserCount, - active_user_count: activeUserCount, - user_session_times: totalUserSessionTimes, - app_launch_count: launchCount, - page_visit_count: data.page_view_count, - error_count: errorCount, - duration: data.total_duration, - user_duration: totalUserDuration, - avg_device_session_time: avgSessionTime, - avg_user_session_time: avgUserSessionTime, - avg_device_time: avgDeviceTime, - avg_user_time: avgUserTime, - bounce_times: bounceTimes, - bounce_rate: bounceRate, - retention: {}, - dimension: this.fillType, - stat_date: datetime.getDate('Ymd', this.startTime), - start_time: this.startTime, - end_time: this.endTime - } - - //数据填充 - this.fillData.push(insertParam) - this.composes.push(data._id.appid + '_' + platformInfo._id + '_' + channelInfo._id + '_' + versionInfo - ._id) - return insertParam - } - - /** - * 基础统计数据补充,防止累计数据丢失 - */ - async replenishStat() { - if (this.debug) { - console.log('composes data', this.composes) - } - - const datetime = new DateTime() - // const { - // startTime - // } = datetime.getTimeDimensionByType(this.fillType, -1, this.startTime) - - //上一次统计时间 - let preStatRes = await this.getCollection(this.tableName).where({ - start_time: {$lt: this.startTime}, - dimension: this.fillType - }).orderBy('start_time', 'desc').limit(1).get() - let preStartTime = 0 - if(preStatRes && preStatRes.data.length > 0) { - preStartTime = preStatRes.data[0].start_time - } - - if (this.debug) { - console.log('replenishStat-preStartTime', preStartTime) - } - - if(!preStartTime) { - return false - } - - // 上一阶段数据 - const preStatData = await this.selectAll(this.tableName, { - start_time: preStartTime, - dimension: this.fillType - }, { - appid: 1, - platform_id: 1, - channel_id: 1, - version_id: 1, - total_devices: 1, - total_users: 1 - }) - - if (!preStatData || preStatData.data.length === 0) { - return false - } - - if (this.debug) { - console.log('preStatData', JSON.stringify(preStatData)) - } - - let preKey - const preKeyArr = [] - for (const pi in preStatData.data) { - preKey = preStatData.data[pi].appid + '_' + preStatData.data[pi].platform_id + '_' + preStatData - .data[pi].channel_id + '_' + preStatData.data[pi].version_id - if (!this.composes.includes(preKey) && !preKeyArr.includes(preKey)) { - preKeyArr.push(preKey) - if (this.debug) { - console.log('preKey -add', preKey) - } - this.fillData.push({ - appid: preStatData.data[pi].appid, - platform_id: preStatData.data[pi].platform_id, - channel_id: preStatData.data[pi].channel_id, - version_id: preStatData.data[pi].version_id, - total_devices: preStatData.data[pi].total_devices, - new_device_count: 0, - active_device_count: 0, - total_users: preStatData.data[pi].total_users, - new_user_count: 0, - active_user_count: 0, - user_session_times: 0, - app_launch_count: 0, - page_visit_count: 0, - error_count: 0, - duration: 0, - user_duration: 0, - avg_device_session_time: 0, - avg_user_session_time: 0, - avg_device_time: 0, - avg_user_time: 0, - bounce_times: 0, - bounce_rate: 0, - retention: {}, - dimension: this.fillType, - stat_date: datetime.getDate('Ymd', this.startTime), - start_time: this.startTime, - end_time: this.endTime - }) - } else if (this.debug) { - console.log('preKey -have', preKey) - } - } - - return true - } - - /** - * 留存数据统计 - * @param {String} type 统计类型 hour:实时统计 day:按天统计,week:按周统计 month:按月统计 - * @param {Date|Time} date 指定日期或时间戳 - * @param {String} mod 统计模块 device:设备,user:用户 - */ - async retentionStat(type, date, mod = 'device') { - date = date ? date : new DateTime().getTimeBySetDays(-1, date) - const allowedType = ['day', 'week', 'month'] - if (!allowedType.includes(type)) { - return { - code: 1002, - msg: 'This type is not allowed' - } - } - let days = [] - switch (type) { - case 'week': - case 'month': - days = [1, 2, 3, 4, 5, 6, 7, 8, 9] - break - default: - days = [1, 2, 3, 4, 5, 6, 7, 14, 30] - break - } - - let res = { - code: 0, - msg: 'success' - } - - for (const day in days) { - //留存统计数据库查询较为复杂,因此这里拆分为多个维度 - if (mod && mod === 'user') { - //用户留存统计 - if (type === 'day') { - res = await this.userRetentionFillDayly(type, days[day], date) - } else { - res = await this.userRetentionFillWeekOrMonth(type, days[day], date) - } - } else { - //设备留存统计 - if (type === 'day') { - res = await this.deviceRetentionFillDayly(type, days[day], date) - } else { - res = await this.deviceRetentionFillWeekOrMonth(type, days[day], date) - } - } - } - return res - } - - /** - * 设备日留存统计数据填充 - * @param {String} type 统计类型 hour:实时统计 day:按天统计,week:按周统计 month:按月统计 - * @param {Date|Time} date 指定日期或时间戳 - * @param {Boolean} reset 是否重置,为ture时会重置该批次数据 - */ - async deviceRetentionFillDayly(type, day, date) { - if (type !== 'day') { - return { - code: 301, - msg: 'Type error:' + type - } - } - const dateTime = new DateTime() - const { - startTime, - endTime - } = dateTime.getTimeDimensionByType(type, 0 - day, date) - - if (!startTime || !endTime) { - return { - code: 1001, - msg: 'The statistic time get failed' - } - } - - // 截止时间范围 - const lastTimeInfo = dateTime.getTimeDimensionByType(type, 0, date) - - // 获取当时批次的统计日志 - const resultLogRes = await this.selectAll(this.tableName, { - dimension: type, - start_time: startTime, - end_time: endTime - }) - // const resultLogRes = await this.getCollection(this.tableName).where({ - // dimension: type, - // start_time: startTime, - // end_time: endTime - // }).get() - - if (this.debug) { - console.log('resultLogRes', JSON.stringify(resultLogRes)) - } - - if (!resultLogRes || resultLogRes.data.length === 0) { - if (this.debug) { - console.log('Not found this log --' + type + ':' + day + ', start:' + startTime + ',endTime:' + - endTime) - } - return { - code: 1000, - msg: 'Not found this log' - } - } - - const sessionLog = new SessionLog() - const platform = new Platform() - const channel = new Channel() - const version = new Version() - let res = null - for (const resultIndex in resultLogRes.data) { - const resultLog = resultLogRes.data[resultIndex] - // 平台信息 - let platformInfo = null - if (this.platforms && this.platforms[resultLog.platform_id]) { - platformInfo = this.platforms[resultLog.platform_id] - } else { - platformInfo = await this.getById(platform.tableName, resultLog.platform_id) - if (!platformInfo || platformInfo.length === 0) { - platformInfo.code = '' - } - this.platforms[resultLog.platform_id] = platformInfo - if (this.debug) { - console.log('platformInfo', JSON.stringify(platformInfo)) - } - } - // 渠道信息 - let channelInfo = null - if (this.channels && this.channels[resultLog.channel_id]) { - channelInfo = this.channels[resultLog.channel_id] - } else { - channelInfo = await this.getById(channel.tableName, resultLog.channel_id) - if (!channelInfo || channelInfo.length === 0) { - channelInfo.channel_code = '' - } - this.channels[resultLog.channel_id] = channelInfo - if (this.debug) { - console.log('channelInfo', JSON.stringify(channelInfo)) - } - } - // 版本信息 - let versionInfo = null - if (this.versions && this.versions[resultLog.version_id]) { - versionInfo = this.versions[resultLog.version_id] - } else { - versionInfo = await this.getById(version.tableName, resultLog.version_id, false) - if (!versionInfo || versionInfo.length === 0) { - versionInfo.version = '' - } - this.versions[resultLog.version_id] = versionInfo - if (this.debug) { - console.log('versionInfo', JSON.stringify(versionInfo)) - } - } - - // 获取该批次的活跃设备数 - const activeDeviceRes = await this.aggregate(sessionLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - device_id: 1, - create_time: 1 - }, - match: { - appid: resultLog.appid, - version: versionInfo.version, - platform: platformInfo.code, - channel: channelInfo.channel_code, - create_time: { - $gte: startTime, - $lte: endTime - } - }, - group: { - _id: { - device_id: '$device_id' - }, - create_time: { - $min: '$create_time' - }, - sessionCount: { - $sum: 1 - } - }, - sort: { - create_time: 1, - sessionCount: 1 - }, - getAll: true - }) - - if (this.debug) { - console.log('activeDeviceRes', JSON.stringify(activeDeviceRes)) - } - let activeDeviceRate = 0 - let activeDevices = 0 - if (activeDeviceRes && activeDeviceRes.data.length > 0) { - const thisDayActiveDevices = activeDeviceRes.data.length - const thisDayActiveDeviceIds = [] - for (const tau in activeDeviceRes.data) { - thisDayActiveDeviceIds.push(activeDeviceRes.data[tau]._id.device_id) - } - if (this.debug) { - console.log('thisDayActiveDeviceIds', JSON.stringify(thisDayActiveDeviceIds)) - } - - // 留存活跃设备查询 - const retentionActiveDeviceRes = await this.aggregate(sessionLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - device_id: 1, - create_time: 1 - }, - match: { - appid: resultLog.appid, - version: versionInfo.version, - platform: platformInfo.code, - channel: channelInfo.channel_code, - device_id: { - $in: thisDayActiveDeviceIds - }, - create_time: { - $gte: lastTimeInfo.startTime, - $lte: lastTimeInfo.endTime - } - }, - group: [{ - _id: { - device_id: '$device_id' - } - }, { - _id: {}, - total_devices: { - $sum: 1 - } - }] - }) - - if (this.debug) { - console.log('retentionActiveDeviceRes', JSON.stringify(retentionActiveDeviceRes)) - } - if (retentionActiveDeviceRes && retentionActiveDeviceRes.data.length > 0) { - // 活跃设备留存数 - activeDevices = retentionActiveDeviceRes.data[0].total_devices - // 活跃设备留存率 - activeDeviceRate = parseFloat((activeDevices * 100 / thisDayActiveDevices).toFixed(2)) - } - - //安卓平台留存需要增加sdk更新后device_id发生变更的设备数 - if(platformInfo.code === 'android') { - const retentionActiveOldDeviceRes = await this.aggregate(sessionLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - old_device_id: 1, - create_time: 1 - }, - match: { - appid: resultLog.appid, - version: versionInfo.version, - platform: platformInfo.code, - channel: channelInfo.channel_code, - old_device_id: { - $in: thisDayActiveDeviceIds - }, - create_time: { - $gte: lastTimeInfo.startTime, - $lte: lastTimeInfo.endTime - } - }, - group: [{ - _id: { - device_id: '$old_device_id' - } - }, { - _id: {}, - total_devices: { - $sum: 1 - } - }] - }) - - if (this.debug) { - console.log('retentionActiveOldDeviceRes', JSON.stringify(retentionActiveOldDeviceRes)) - } - if (retentionActiveOldDeviceRes && retentionActiveOldDeviceRes.data.length > 0) { - // 活跃设备留存数 - activeDevices += retentionActiveOldDeviceRes.data[0].total_devices - // 活跃设备留存率 - activeDeviceRate = parseFloat((activeDevices * 100 / thisDayActiveDevices).toFixed(2)) - } - } - } - - // 获取该批次新增设备数 - const newDeviceRes = await this.aggregate(sessionLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - is_first_visit: 1, - device_id: 1, - create_time: 1 - }, - match: { - appid: resultLog.appid, - version: versionInfo.version, - platform: platformInfo.code, - channel: channelInfo.channel_code, - is_first_visit: 1, - create_time: { - $gte: startTime, - $lte: endTime - } - }, - group: { - _id: { - device_id: '$device_id' - }, - create_time: { - $min: '$create_time' - }, - sessionCount: { - $sum: 1 - } - }, - sort: { - create_time: 1, - sessionCount: 1 - }, - getAll: true - }) - - let newDeviceRate = 0 - let newDevices = 0 - if (newDeviceRes && newDeviceRes.data.length > 0) { - const thisDayNewDevices = newDeviceRes.data.length - const thisDayNewDeviceIds = [] - for (const tau in newDeviceRes.data) { - thisDayNewDeviceIds.push(newDeviceRes.data[tau]._id.device_id) - } - - if (this.debug) { - console.log('thisDayNewDeviceIds', JSON.stringify(thisDayNewDeviceIds)) - } - - // 留存的设备查询 - const retentionNewDeviceRes = await this.aggregate(sessionLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - device_id: 1, - create_time: 1 - }, - match: { - appid: resultLog.appid, - version: versionInfo.version, - platform: platformInfo.code, - channel: channelInfo.channel_code, - device_id: { - $in: thisDayNewDeviceIds - }, - create_time: { - $gte: lastTimeInfo.startTime, - $lte: lastTimeInfo.endTime - } - }, - group: [{ - _id: { - device_id: '$device_id' - } - }, { - _id: {}, - total_devices: { - $sum: 1 - } - }] - }) - - if (retentionNewDeviceRes && retentionNewDeviceRes.data.length > 0) { - // 新增设备留存数 - newDevices = retentionNewDeviceRes.data[0].total_devices - // 新增设备留存率 - newDeviceRate = parseFloat((newDevices * 100 / thisDayNewDevices).toFixed(2)) - } - - //安卓平台留存需要增加sdk更新后device_id发生变更的设备数 - if(platformInfo.code === 'android') { - const retentionNewOldDeviceRes = await this.aggregate(sessionLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - old_device_id: 1, - create_time: 1 - }, - match: { - appid: resultLog.appid, - version: versionInfo.version, - platform: platformInfo.code, - channel: channelInfo.channel_code, - old_device_id: { - $in: thisDayNewDeviceIds - }, - create_time: { - $gte: lastTimeInfo.startTime, - $lte: lastTimeInfo.endTime - } - }, - group: [{ - _id: { - device_id: '$old_device_id' - } - }, { - _id: {}, - total_devices: { - $sum: 1 - } - }] - }) - - if (this.debug) { - console.log('retentionNewOldDeviceRes', JSON.stringify(retentionNewOldDeviceRes)) - } - - if (retentionNewOldDeviceRes && retentionNewOldDeviceRes.data.length > 0) { - // 新增设备留存数 - newDevices += retentionNewOldDeviceRes.data[0].total_devices - // 新增设备留存率 - newDeviceRate = parseFloat((newDevices * 100 / thisDayNewDevices).toFixed(2)) - } - } - } - - // 数据更新 - const retentionData = resultLog.retention - const dataKey = type.substr(0, 1) + '_' + day - if (!retentionData.active_device) { - retentionData.active_device = {} - } - retentionData.active_device[dataKey] = { - device_count: activeDevices, - device_rate: activeDeviceRate - } - if (!retentionData.new_device) { - retentionData.new_device = {} - } - retentionData.new_device[dataKey] = { - device_count: newDevices, - device_rate: newDeviceRate - } - - if (this.debug) { - console.log('retentionData', JSON.stringify(retentionData)) - } - - res = await this.update(this.tableName, { - retention: retentionData - }, { - _id: resultLog._id - }) - } - - if (res && res.updated) { - return { - code: 0, - msg: 'success' - } - } else { - return { - code: 500, - msg: 'retention data update failed' - } - } - } - - /** - * 设备周/月留存数据填充 - * @param {String} type 统计类型 hour:实时统计 day:按天统计,week:按周统计 month:按月统计 - * @param {Date|Time} date 指定日期或时间戳 - * @param {Boolean} reset 是否重置,为ture时会重置该批次数据 - */ - async deviceRetentionFillWeekOrMonth(type, day, date) { - if (!['week', 'month'].includes(type)) { - return { - code: 301, - msg: 'Type error:' + type - } - } - const dateTime = new DateTime() - const { - startTime, - endTime - } = dateTime.getTimeDimensionByType(type, 0 - day, date) - - if (!startTime || !endTime) { - return { - code: 1001, - msg: 'The statistic time get failed' - } - } - - // 截止时间范围 - const lastTimeInfo = dateTime.getTimeDimensionByType(type, 0, date) - - // 获取当时批次的统计日志 - const resultLogRes = await this.selectAll(this.tableName, { - dimension: type, - start_time: startTime, - end_time: endTime - }) - - if (this.debug) { - console.log('resultLogRes', JSON.stringify(resultLogRes)) - } - - if (!resultLogRes || resultLogRes.data.length === 0) { - if (this.debug) { - console.log('Not found this session log --' + type + ':' + day + ', start:' + startTime + - ',endTime:' + endTime) - } - return { - code: 1000, - msg: 'Not found this session log' - } - } - - const activeDevicesObj = new ActiveDevices() - let res = null; - let activeDeviceRes; - let activeDeviceRate; - let activeDevices; - let newDeviceRate; - let newDevices - for (const resultIndex in resultLogRes.data) { - const resultLog = resultLogRes.data[resultIndex] - // 获取该批次的活跃设备数 - activeDeviceRes = await this.selectAll(activeDevicesObj.tableName, { - appid: resultLog.appid, - platform_id: resultLog.platform_id, - channel_id: resultLog.channel_id, - version_id: resultLog.version_id, - dimension: type, - create_time: { - $gte: startTime, - $lte: endTime - } - }, { - device_id: 1 - }) - - if (this.debug) { - console.log('activeDeviceRes', JSON.stringify(activeDeviceRes)) - } - - activeDeviceRate = 0 - activeDevices = 0 - if (activeDeviceRes && activeDeviceRes.data.length > 0) { - const thisDayActiveDevices = activeDeviceRes.data.length - const thisDayActiveDeviceIds = [] - for (const tau in activeDeviceRes.data) { - thisDayActiveDeviceIds.push(activeDeviceRes.data[tau].device_id) - } - if (this.debug) { - console.log('thisDayActiveDeviceIds', JSON.stringify(thisDayActiveDeviceIds)) - } - // 留存活跃设备数 - const retentionActiveDeviceRes = await this.getCollection(activeDevicesObj.tableName).where({ - appid: resultLog.appid, - platform_id: resultLog.platform_id, - channel_id: resultLog.channel_id, - version_id: resultLog.version_id, - device_id: { - $in: thisDayActiveDeviceIds - }, - dimension: type, - create_time: { - $gte: lastTimeInfo.startTime, - $lte: lastTimeInfo.endTime - } - }).count() - - if (this.debug) { - console.log('retentionActiveDeviceRes', JSON.stringify(retentionActiveDeviceRes)) - } - if (retentionActiveDeviceRes && retentionActiveDeviceRes.total > 0) { - // 活跃设备留存数 - activeDevices = retentionActiveDeviceRes.total - // 活跃设备留存率 - activeDeviceRate = parseFloat((activeDevices * 100 / thisDayActiveDevices).toFixed(2)) - } - } - - // 获取该批次的新增设备数 - const newDeviceRes = await this.selectAll(activeDevicesObj.tableName, { - appid: resultLog.appid, - platform_id: resultLog.platform_id, - channel_id: resultLog.channel_id, - version_id: resultLog.version_id, - is_new: 1, - dimension: type, - create_time: { - $gte: startTime, - $lte: endTime - } - }, { - device_id: 1 - }) - - newDeviceRate = 0 - newDevices = 0 - if (newDeviceRes && newDeviceRes.data.length > 0) { - const thisDayNewDevices = newDeviceRes.data.length - const thisDayNewDeviceIds = [] - for (const tau in newDeviceRes.data) { - thisDayNewDeviceIds.push(newDeviceRes.data[tau].device_id) - } - - // 新增设备留存数 - const retentionNewDeviceRes = await this.getCollection(activeDevicesObj.tableName).where({ - appid: resultLog.appid, - platform_id: resultLog.platform_id, - channel_id: resultLog.channel_id, - version_id: resultLog.version_id, - device_id: { - $in: thisDayNewDeviceIds - }, - dimension: type, - create_time: { - $gte: lastTimeInfo.startTime, - $lte: lastTimeInfo.endTime - } - }).count() - - if (retentionNewDeviceRes && retentionNewDeviceRes.total > 0) { - // 新增设备留存数 - newDevices = retentionNewDeviceRes.total - // 新增设备留存率 - newDeviceRate = parseFloat((newDevices * 100 / thisDayNewDevices).toFixed(2)) - } - } - - // 数据更新 - const retentionData = resultLog.retention - const dataKey = type.substr(0, 1) + '_' + day - if (!retentionData.active_device) { - retentionData.active_device = {} - } - retentionData.active_device[dataKey] = { - device_count: activeDevices, - device_rate: activeDeviceRate - } - if (!retentionData.new_device) { - retentionData.new_device = {} - } - retentionData.new_device[dataKey] = { - device_count: newDevices, - device_rate: newDeviceRate - } - - if (this.debug) { - console.log('retentionData', JSON.stringify(retentionData)) - } - - res = await this.update(this.tableName, { - retention: retentionData - }, { - _id: resultLog._id - }) - } - - if (res && res.updated) { - return { - code: 0, - msg: 'success' - } - } else { - return { - code: 500, - msg: 'retention data update failed' - } - } - } - - /** - * 用户日留存数据填充 - * @param {String} type 统计类型 hour:实时统计 day:按天统计,week:按周统计 month:按月统计 - * @param {Date|Time} date 指定日期或时间戳 - * @param {Boolean} reset 是否重置,为ture时会重置该批次数据 - */ - async userRetentionFillDayly(type, day, date) { - if (type !== 'day') { - return { - code: 301, - msg: 'Type error:' + type - } - } - const dateTime = new DateTime() - const { - startTime, - endTime - } = dateTime.getTimeDimensionByType(type, 0 - day, date) - - if (!startTime || !endTime) { - return { - code: 1001, - msg: 'The statistic time get failed' - } - } - - // 截止时间范围 - const lastTimeInfo = dateTime.getTimeDimensionByType(type, 0, date) - - // 获取当时批次的统计日志 - const resultLogRes = await this.selectAll(this.tableName, { - dimension: type, - start_time: startTime, - end_time: endTime - }) - - if (this.debug) { - console.log('resultLogRes', JSON.stringify(resultLogRes)) - } - - if (!resultLogRes || resultLogRes.data.length === 0) { - if (this.debug) { - console.log('Not found this log --' + type + ':' + day + ', start:' + startTime + ',endTime:' + - endTime) - } - return { - code: 1000, - msg: 'Not found this log' - } - } - - const userSessionLog = new UserSessionLog() - const uniIDUsers = new UniIDUsers() - const platform = new Platform() - const channel = new Channel() - const version = new Version() - let res = null - for (const resultIndex in resultLogRes.data) { - const resultLog = resultLogRes.data[resultIndex] - // 平台信息 - let platformInfo = null - if (this.platforms && this.platforms[resultLog.platform_id]) { - platformInfo = this.platforms[resultLog.platform_id] - } else { - platformInfo = await this.getById(platform.tableName, resultLog.platform_id) - if (!platformInfo || platformInfo.length === 0) { - platformInfo.code = '' - } - this.platforms[resultLog.platform_id] = platformInfo - if (this.debug) { - console.log('platformInfo', JSON.stringify(platformInfo)) - } - } - // 渠道信息 - let channelInfo = null - if (this.channels && this.channels[resultLog.channel_id]) { - channelInfo = this.channels[resultLog.channel_id] - } else { - channelInfo = await this.getById(channel.tableName, resultLog.channel_id) - if (!channelInfo || channelInfo.length === 0) { - channelInfo.channel_code = '' - } - this.channels[resultLog.channel_id] = channelInfo - if (this.debug) { - console.log('channelInfo', JSON.stringify(channelInfo)) - } - } - // 版本信息 - let versionInfo = null - if (this.versions && this.versions[resultLog.version_id]) { - versionInfo = this.versions[resultLog.version_id] - } else { - versionInfo = await this.getById(version.tableName, resultLog.version_id, false) - if (!versionInfo || versionInfo.length === 0) { - versionInfo.version = '' - } - this.versions[resultLog.version_id] = versionInfo - if (this.debug) { - console.log('versionInfo', JSON.stringify(versionInfo)) - } - } - - // 获取该时间段内的活跃用户 - const activeUserRes = await this.aggregate(userSessionLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - uid: 1, - create_time: 1 - }, - match: { - appid: resultLog.appid, - version: versionInfo.version, - platform: platformInfo.code, - channel: channelInfo.channel_code, - create_time: { - $gte: startTime, - $lte: endTime - } - }, - group: { - _id: { - uid: '$uid' - }, - create_time: { - $min: '$create_time' - }, - sessionCount: { - $sum: 1 - } - }, - sort: { - create_time: 1, - sessionCount: 1 - }, - getAll: true - }) - - if (this.debug) { - console.log('activeUserRes', JSON.stringify(activeUserRes)) - } - - //活跃用户留存率 - let activeUserRate = 0 - //活跃用户留存数 - let activeUsers = 0 - if (activeUserRes && activeUserRes.data.length > 0) { - const thisDayActiveUsers = activeUserRes.data.length - //获取该时间段内的活跃用户编号,这里没用lookup联查是因为数据量较大时lookup效率很低 - const thisDayActiveUids = [] - for (let tau in activeUserRes.data) { - thisDayActiveUids.push(activeUserRes.data[tau]._id.uid) - } - - if (this.debug) { - console.log('thisDayActiveUids', JSON.stringify(thisDayActiveUids)) - } - - // 留存活跃用户数 - const retentionActiveUserRes = await this.aggregate(userSessionLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - uid: 1, - create_time: 1 - }, - match: { - appid: resultLog.appid, - version: versionInfo.version, - platform: platformInfo.code, - channel: channelInfo.channel_code, - uid: { - $in: thisDayActiveUids - }, - create_time: { - $gte: lastTimeInfo.startTime, - $lte: lastTimeInfo.endTime - } - }, - group: [{ - _id: { - uid: '$uid' - } - }, { - _id: {}, - total_users: { - $sum: 1 - } - }] - }) - - if (this.debug) { - console.log('retentionActiveUserRes', JSON.stringify(retentionActiveUserRes)) - } - if (retentionActiveUserRes && retentionActiveUserRes.data.length > 0) { - // 活跃用户留存数 - activeUsers = retentionActiveUserRes.data[0].total_users - // 活跃用户留存率 - activeUserRate = parseFloat((activeUsers * 100 / thisDayActiveUsers).toFixed(2)) - } - } - - - - //新增用户编号 - const thisDayNewUids = await uniIDUsers.getUserIds(resultLog.appid, platformInfo.code, channelInfo.channel_code, versionInfo.version, { - $gte: startTime, - $lte: endTime - }) - //新增用户留存率 - let newUserRate = 0 - //新增用户留存数 - let newUsers = 0 - if (thisDayNewUids.length > 0) { - // 现在依然活跃的用户数 - const retentionNewUserRes = await this.aggregate(userSessionLog.tableName, { - project: { - appid: 1, - version: 1, - platform: 1, - channel: 1, - uid: 1, - create_time: 1 - }, - match: { - appid: resultLog.appid, - version: versionInfo.version, - platform: platformInfo.code, - channel: channelInfo.channel_code, - uid: { - $in: thisDayNewUids - }, - create_time: { - $gte: lastTimeInfo.startTime, - $lte: lastTimeInfo.endTime - } - }, - group: [{ - _id: { - uid: '$uid' - } - }, { - _id: {}, - total_users: { - $sum: 1 - } - }] - }) - - if (retentionNewUserRes && retentionNewUserRes.data.length > 0) { - // 新增用户留存数 - newUsers = retentionNewUserRes.data[0].total_users - // 新增用户留存率 - newUserRate = parseFloat((newUsers * 100 / thisDayNewUids.length).toFixed(2)) - } - } - - // 数据更新 - const retentionData = resultLog.retention - const dataKey = type.substr(0, 1) + '_' + day - if (!retentionData.active_user) { - retentionData.active_user = {} - } - retentionData.active_user[dataKey] = { - user_count: activeUsers, - user_rate: activeUserRate - } - if (!retentionData.new_user) { - retentionData.new_user = {} - } - retentionData.new_user[dataKey] = { - user_count: newUsers, - user_rate: newUserRate - } - - if (this.debug) { - console.log('retentionData', JSON.stringify(retentionData)) - } - - res = await this.update(this.tableName, { - retention: retentionData - }, { - _id: resultLog._id - }) - } - - if (res && res.updated) { - return { - code: 0, - msg: 'success' - } - } else { - return { - code: 500, - msg: 'retention data update failed' - } - } - } - - - /** - * 用户周/月留存数据填充 - * @param {String} type 统计类型 hour:实时统计 day:按天统计,week:按周统计 month:按月统计 - * @param {Date|Time} date 指定日期或时间戳 - * @param {Boolean} reset 是否重置,为ture时会重置该批次数据 - */ - async userRetentionFillWeekOrMonth(type, day, date) { - if (!['week', 'month'].includes(type)) { - return { - code: 301, - msg: 'Type error:' + type - } - } - const dateTime = new DateTime() - const { - startTime, - endTime - } = dateTime.getTimeDimensionByType(type, 0 - day, date) - - if (!startTime || !endTime) { - return { - code: 1001, - msg: 'The statistic time get failed' - } - } - - // 截止时间范围 - const lastTimeInfo = dateTime.getTimeDimensionByType(type, 0, date) - - // 获取当时批次的统计日志 - const resultLogRes = await this.selectAll(this.tableName, { - dimension: type, - start_time: startTime, - end_time: endTime - }) - - if (this.debug) { - console.log('resultLogRes', JSON.stringify(resultLogRes)) - } - - if (!resultLogRes || resultLogRes.data.length === 0) { - if (this.debug) { - console.log('Not found this session log --' + type + ':' + day + ', start:' + startTime + - ',endTime:' + endTime) - } - return { - code: 1000, - msg: 'Not found this session log' - } - } - - const activeUserObj = new ActiveUsers() - const uniIDUsers = new UniIDUsers() - const platform = new Platform() - const channel = new Channel() - const version = new Version() - let res = null - //活跃用户留存率 - let activeUserRate - //活跃用户留存数 - let activeUsers - //新增用户留存率 - let newUserRate - //新增用户留存数 - let newUsers - for (const resultIndex in resultLogRes.data) { - const resultLog = resultLogRes.data[resultIndex] - - // 平台信息 - let platformInfo = null - if (this.platforms && this.platforms[resultLog.platform_id]) { - platformInfo = this.platforms[resultLog.platform_id] - } else { - platformInfo = await this.getById(platform.tableName, resultLog.platform_id) - if (!platformInfo || platformInfo.length === 0) { - platformInfo.code = '' - } - this.platforms[resultLog.platform_id] = platformInfo - if (this.debug) { - console.log('platformInfo', JSON.stringify(platformInfo)) - } - } - // 渠道信息 - let channelInfo = null - if (this.channels && this.channels[resultLog.channel_id]) { - channelInfo = this.channels[resultLog.channel_id] - } else { - channelInfo = await this.getById(channel.tableName, resultLog.channel_id) - if (!channelInfo || channelInfo.length === 0) { - channelInfo.channel_code = '' - } - this.channels[resultLog.channel_id] = channelInfo - if (this.debug) { - console.log('channelInfo', JSON.stringify(channelInfo)) - } - } - // 版本信息 - let versionInfo = null - if (this.versions && this.versions[resultLog.version_id]) { - versionInfo = this.versions[resultLog.version_id] - } else { - versionInfo = await this.getById(version.tableName, resultLog.version_id, false) - if (!versionInfo || versionInfo.length === 0) { - versionInfo.version = '' - } - this.versions[resultLog.version_id] = versionInfo - if (this.debug) { - console.log('versionInfo', JSON.stringify(versionInfo)) - } - } - - // 获取该批次的活跃用户数 - const activeUserRes = await this.selectAll(activeUserObj.tableName, { - appid: resultLog.appid, - platform_id: resultLog.platform_id, - channel_id: resultLog.channel_id, - version_id: resultLog.version_id, - dimension: type, - create_time: { - $gte: startTime, - $lte: endTime - } - }, { - uid: 1 - }) - - if (this.debug) { - console.log('activeUserRes', JSON.stringify(activeUserRes)) - } - - activeUserRate = 0 - activeUsers = 0 - if (activeUserRes && activeUserRes.data.length > 0) { - const thisDayactiveUsers = activeUserRes.data.length - const thisDayActiveDeviceIds = [] - for (const tau in activeUserRes.data) { - thisDayActiveDeviceIds.push(activeUserRes.data[tau].uid) - } - if (this.debug) { - console.log('thisDayActiveDeviceIds', JSON.stringify(thisDayActiveDeviceIds)) - } - // 留存活跃用户数 - const retentionactiveUserRes = await this.getCollection(activeUserObj.tableName).where({ - appid: resultLog.appid, - platform_id: resultLog.platform_id, - channel_id: resultLog.channel_id, - version_id: resultLog.version_id, - uid: { - $in: thisDayActiveDeviceIds - }, - dimension: type, - create_time: { - $gte: lastTimeInfo.startTime, - $lte: lastTimeInfo.endTime - } - }).count() - - if (this.debug) { - console.log('retentionactiveUserRes', JSON.stringify(retentionactiveUserRes)) - } - if (retentionactiveUserRes && retentionactiveUserRes.total > 0) { - // 活跃用户留存数 - activeUsers = retentionactiveUserRes.total - // 活跃用户留存率 - activeUserRate = parseFloat((activeUsers * 100 / thisDayactiveUsers).toFixed(2)) - } - } - - - //新增用户编号 - const thisDayNewUids = await uniIDUsers.getUserIds(resultLog.appid, platformInfo.code, channelInfo.channel_code, versionInfo.version, { - $gte: startTime, - $lte: endTime - }) - - // 新增用户留存率 - newUserRate = 0 - // 新增用户留存数 - newUsers = 0 - if(thisDayNewUids && thisDayNewUids.length > 0) { - // 新增用户留存数 - const retentionnewUserRes = await this.getCollection(activeUserObj.tableName).where({ - appid: resultLog.appid, - platform_id: resultLog.platform_id, - channel_id: resultLog.channel_id, - version_id: resultLog.version_id, - uid: { - $in: thisDayNewUids - }, - dimension: type, - create_time: { - $gte: lastTimeInfo.startTime, - $lte: lastTimeInfo.endTime - } - }).count() - - if (retentionnewUserRes && retentionnewUserRes.total > 0) { - // 新增用户留存数 - newUsers = retentionnewUserRes.total - // 新增用户留存率 - newUserRate = parseFloat((newUsers * 100 / thisDayNewUids.length).toFixed(2)) - } - } - - // 数据更新 - const retentionData = resultLog.retention - const dataKey = type.substr(0, 1) + '_' + day - if (!retentionData.active_user) { - retentionData.active_user = {} - } - retentionData.active_user[dataKey] = { - user_count: activeUsers, - user_rate: activeUserRate - } - if (!retentionData.new_user) { - retentionData.new_user = {} - } - retentionData.new_user[dataKey] = { - user_count: newUsers, - user_rate: newUserRate - } - - if (this.debug) { - console.log('retentionData', JSON.stringify(retentionData)) - } - - res = await this.update(this.tableName, { - retention: retentionData - }, { - _id: resultLog._id - }) - } - - if (res && res.updated) { - return { - code: 0, - msg: 'success' - } - } else { - return { - code: 500, - msg: 'retention data update failed' - } - } - } - - - /** - * 清理实时统计的日志 - * @param {Number} days 实时统计日志保留天数 - */ - async cleanHourLog(days = 7) { - if(days === 0) { - return false; - } - - days = Math.max(parseInt(days), 1) - - console.log('clean hour logs - day:', days) - - const dateTime = new DateTime() - const res = await this.delete(this.tableName, { - dimension: 'hour', - start_time: { - $lt: dateTime.getTimeBySetDays(0 - days) - } - }) - - if (!res.code) { - console.log('clean hour logs - res:', res) - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/uni-pay/dao/config.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/uni-pay/dao/config.js deleted file mode 100644 index c285788..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/uni-pay/dao/config.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 表名 - */ -const dbName = { - uniIdUsers: 'uni-id-users', // 支付订单明细表 - uniPayOrders: 'uni-pay-orders', // 支付订单明细表 - uniStatPayResult: 'uni-stat-pay-result', // 统计结果存储表 - uniStatSessionLogs: 'uni-stat-session-logs', // 设备会话日志表(主要用于统计访问设备数) - uniStatUserSessionLogs: 'uni-stat-user-session-logs', // 用户会话日志表(主要用于统计访问人数) -}; - -module.exports = dbName; diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/uni-pay/dao/index.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/uni-pay/dao/index.js deleted file mode 100644 index 933a82b..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/uni-pay/dao/index.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * 数据库操作 - */ -module.exports = { - uniIdUsers: require('./uniIdUsers'), - uniPayOrders: require('./uniPayOrders'), - uniStatPayResult: require('./uniStatPayResult'), - uniStatSessionLogs: require('./uniStatSessionLogs'), - uniStatUserSessionLogs: require('./uniStatUserSessionLogs'), -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/uni-pay/dao/uniIdUsers.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/uni-pay/dao/uniIdUsers.js deleted file mode 100644 index d685563..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/uni-pay/dao/uniIdUsers.js +++ /dev/null @@ -1,70 +0,0 @@ -/** - * 数据库操作 - */ - -// 引入配置文件 -const dbName = require("./config"); - -// 创建数据库对象 -let db = uniCloud.database(); - -// 获取数据库命令对象 -let _ = db.command; - -// 获取聚合操作对象 -let $ = _.aggregate; - -class Dao { - - // 计算符合条件的文档数量 - async count(whereJson) { - let dbRes = await db.collection(dbName.uniIdUsers).where(whereJson).count(); - return dbRes && dbRes.total ? dbRes.total : 0; - } - - // 计算具有指定状态的新用户订单数量 - async countNewUserOrder(obj) { - let { - whereJson, - status - } = obj; - let dbRes = await db.collection(dbName.uniIdUsers).aggregate() - .match(whereJson) // 匹配条件 - .lookup({ - from: dbName.uniPayOrders, // 关联集合名称 - let: { - user_id: '$_id', // 定义关联字段 - }, - pipeline: $.pipeline() - .match(_.expr($.and([ - $.eq(['$user_id', '$$user_id']), // 关联条件 - $.in(['$status', status]) // 关联条件 - ]))) - .limit(1) // 返回结果数量限制 - .done(), // 结束关联管道 - as: 'order', // 关联结果存储字段 - }) - .unwind({ - path: '$order', // 展开关联结果 - }) - .group({ - _id: null, // 分组字段为null,表示整个集合作为一个组 - count: { - $addToSet: '$_id' // 将符合条件的文档_id添加到数组 - }, - }) - .addFields({ - count: { - $size: '$count' // 统计数组的长度,即订单数量 - } - }) - .end(); // 执行聚合操作并返回结果 - try { - return dbRes.data[0].count; // 返回订单数量 - } catch (err) { - return 0; // 出现错误时返回0 - } - } -} - -module.exports = new Dao(); diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/uni-pay/dao/uniPayOrders.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/uni-pay/dao/uniPayOrders.js deleted file mode 100644 index 6ded6dd..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/uni-pay/dao/uniPayOrders.js +++ /dev/null @@ -1,99 +0,0 @@ -/** - * 数据库操作 - */ -const BaseMod = require('../../base'); -const dbName = require("./config"); - -class Dao extends BaseMod { - - constructor() { - super(); - this.tablePrefix = false; // 不使用表前缀 - } - - async group(data) { - let { - start_time, - end_time, - status: status_str - } = data; - - let status; - if (status_str === "已下单") { - // 留空,表示不筛选特定状态的订单 - } else if (status_str === "已付款") { - status = { - $gt: 0 - }; // 状态大于0表示已付款 - } else if (status_str === "已退款") { - status = { - $in: [2, 3] - }; // 状态为2或3表示已退款 - } - - const dbRes = await this.aggregate(dbName.uniPayOrders, { - match: { - create_date: { - $gte: start_time, - $lte: end_time - }, - status // 筛选指定状态的订单 - }, - group: { - _id: { - appid: '$appid', - version: '$stat_data.app_version', - platform: '$stat_data.platform', - channel: '$stat_data.channel', - }, - status: { - $first: '$status' - }, - // 支付金额 - total_fee: { - $sum: '$total_fee' - }, - // 退款金额 - refund_fee: { - $sum: '$refund_fee' - }, - // 支付笔数 - order_count: { - $sum: 1 - }, - // 支付人数(去重复) - user_count: { - $addToSet: '$user_id' - }, - // 支付设备数(去重复) - device_count: { - $addToSet: '$device_id' - }, - create_date: { - $min: '$create_date' - } - }, - addFields: { - user_count: { - $size: '$user_count' - }, - device_count: { - $size: '$device_count' - } - }, - // 按创建时间排序 - sort: { - create_date: 1 - }, - getAll: true - }); - - let list = dbRes.data; - list.map((item) => { - item.status_str = status_str; // 添加状态字符串到结果对象中 - }); - return list; - } -} - -module.exports = new Dao(); diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/uni-pay/dao/uniStatPayResult.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/uni-pay/dao/uniStatPayResult.js deleted file mode 100644 index 8ae0cd0..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/uni-pay/dao/uniStatPayResult.js +++ /dev/null @@ -1,38 +0,0 @@ -/** - * 数据库操作 - */ -const BaseMod = require('../../base'); -const dbName = require("./config"); - -class Dao extends BaseMod { - - constructor() { - super(); - this.tablePrefix = false; // 不使用表前缀 - } - - // 获取符合条件的文档列表 - async list(data) { - let { - whereJson, - } = data; - const dbRes = await this.getCollection(dbName.uniStatPayResult).where(whereJson).get(); - return dbRes.data; - } - - // 删除符合条件的文档 - async del(data) { - let { - whereJson - } = data; - const dbRes = await this.delete(dbName.uniStatPayResult, whereJson); - return dbRes.deleted; - } - - // 批量插入文档 - async adds(saveList) { - return await this.batchInsert(dbName.uniStatPayResult, saveList); - } -} - -module.exports = new Dao(); diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/uni-pay/dao/uniStatSessionLogs.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/uni-pay/dao/uniStatSessionLogs.js deleted file mode 100644 index 3998ecf..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/uni-pay/dao/uniStatSessionLogs.js +++ /dev/null @@ -1,78 +0,0 @@ -/** - * 数据库操作 - */ -const BaseMod = require('../../base'); -const dbName = require("./config"); - -class Dao extends BaseMod { - - constructor() { - super(); - this.tablePrefix = false; // 不使用表前缀 - } - - // 分组查询 - async group(data) { - let { - whereJson, - } = data; - const dbRes = await this.aggregate(dbName.uniStatSessionLogs, { - match: whereJson, // 匹配查询条件 - group: { - _id: { - appid: '$appid', - version: '$version', - platform: '$platform', - channel: '$channel', - }, - // 设备数(去重复) - device_count: { - $addToSet: '$device_id' - }, - create_time: { - $min: '$create_time' - } - }, - addFields: { - device_count: { - $size: '$device_count' - } - }, - // 按创建时间排序 - sort: { - create_time: 1 - }, - getAll: true - }); - - return dbRes.data; - } - - // 分组统计数量 - async groupCount(whereJson) { - const dbRes = await this.aggregate(dbName.uniStatSessionLogs, { - match: whereJson, // 匹配查询条件 - group: { - _id: null, - // 设备数(去重复) - count: { - $addToSet: '$device_id' - }, - }, - addFields: { - count: { - $size: '$count' - } - }, - getAll: true - }); - try { - return dbRes.data[0].count; - } catch (err) { - return 0; - } - } - -} - -module.exports = new Dao(); diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/uni-pay/dao/uniStatUserSessionLogs.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/uni-pay/dao/uniStatUserSessionLogs.js deleted file mode 100644 index 64bdb0c..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/uni-pay/dao/uniStatUserSessionLogs.js +++ /dev/null @@ -1,78 +0,0 @@ -/** - * 数据库操作 - */ -const BaseMod = require('../../base'); -const dbName = require("./config"); - -class Dao extends BaseMod { - - constructor() { - super(); - this.tablePrefix = false; // 不使用表前缀 - } - - // 分组查询 - async group(data) { - let { - whereJson - } = data; - const dbRes = await this.aggregate(dbName.uniStatUserSessionLogs, { - match: whereJson, // 匹配查询条件 - group: { - _id: { - appid: '$appid', - version: '$version', - platform: '$platform', - channel: '$channel', - }, - // 用户数(去重复) - user_count: { - $addToSet: '$uid' - }, - create_time: { - $min: '$create_time' - } - }, - addFields: { - user_count: { - $size: '$user_count' - } - }, - // 按创建时间排序 - sort: { - create_time: 1 - }, - getAll: true - }); - - let list = dbRes.data; - return list; - } - - // 分组统计数量 - async groupCount(whereJson) { - const dbRes = await this.aggregate(dbName.uniStatUserSessionLogs, { - match: whereJson, // 匹配查询条件 - group: { - _id: null, - // 用户数(去重复) - count: { - $addToSet: '$uid' - }, - }, - addFields: { - count: { - $size: '$count' - } - }, - getAll: true - }); - try { - return dbRes.data[0].count; - } catch (err) { - return 0; - } - } -} - -module.exports = new Dao(); diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/uni-pay/index.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/uni-pay/index.js deleted file mode 100644 index c22fea2..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/uni-pay/index.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * 基础对外模型 - */ -module.exports = { - PayResult: require('./payResult'), -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/uni-pay/payResult.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/uni-pay/payResult.js deleted file mode 100644 index ac72fb2..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/uni-pay/payResult.js +++ /dev/null @@ -1,543 +0,0 @@ -/** - * @class ActiveDevices 活跃设备模型 - 每日跑批合并,仅添加本周/本月首次访问的设备。 - */ -// 导入BaseMod模块 -const BaseMod = require('../base') - -// 导入Platform模块 -const Platform = require('../platform') - -// 导入Channel模块 -const Channel = require('../channel') - -// 导入Version模块 -const Version = require('../version') - - -const { - DateTime, - UniCrypto -} = require('../../lib') - -// 导入dao模块 -const dao = require('./dao') - -// 获取uniCloud数据库实例 -let db = uniCloud.database(); -// 获取uniCloud数据库操作符command -let _ = db.command; -// 获取uniCloud数据库操作符aggregate -let $ = _.aggregate; - - -module.exports = class PayResult extends BaseMod { - // 构造函数 - constructor() { - // 调用父类的构造函数 - super() - // 初始化平台数组 - this.platforms = [] - // 初始化渠道数组 - this.channels = [] - // 初始化版本数组 - this.versions = [] - } - - - /** - 支付金额:统计时间内,成功支付的订单金额之和(不剔除退款订单)。 - 支付笔数:统计时间内,成功支付的订单数,一个订单对应唯一一个订单号。(不剔除退款订单。) - 支付人数:统计时间内,成功支付的人数(不剔除退款订单)。 - 支付设备数:统计时间内,成功支付的设备数(不剔除退款订单)。 - 下单金额:统计时间内,成功下单的订单金额(不剔除退款订单)。 - 下单笔数:统计时间内,成功下单的订单笔数(不剔除退款订单)。 - 下单人数:统计时间内,成功下单的客户数,一人多次下单记为一人(不剔除退款订单)。 - 下单设备数:统计时间内,成功下单的设备数,一台设备多次访问被计为一台(不剔除退款订单)。 - 访问人数:统计时间内,访问人数,一人多次访问被计为一人(只统计已登录的用户)。 - 访问设备数:统计时间内,访问设备数,一台设备多次访问被计为一台(包含未登录的用户)。 - * @desc 支付统计(按日统计) - * @param {string} type 统计范围 hour:按小时统计,day:按天统计,week:按周统计,month:按月统计 quarter:按季度统计 year:按年统计 - * @param {date|time} date - * @param {bool} reset - */ - async stat(type, date, reset, config = {}) { - if (!date) date = Date.now(); - - // 以下是测试代码----------------------------------------------------------- - //reset = true; - //date = 1667318400000; - // 以上是测试代码----------------------------------------------------------- - let res = await this.run(type, date, reset, config); // 每小时 - if (type === "hour" && config.timely) { - /** - * 如果是小时纬度统计,则还需要再统计(今日实时数据) - * 2022-11-01 01:00:00 统计的是 2022-11-01 的天维度数据(即该天0点-1点数据) - * 2022-11-01 02:00:00 统计的是 2022-11-01 的天维度数据(即该天0点-2点数据) - * 2022-11-01 23:00:00 统计的是 2022-11-01 的天维度数据(即该天0点-23点数据) - * 2022-11-02 00:00:00 统计的是 2022-11-01 的天维度数据(即该天最终数据) - * 2022-11-02 01:00:00 统计的是 2022-11-02 的天维度数据(即该天0点-1点数据) - */ - date -= 1000 * 3600; // 需要减去1小时 - let tasks = []; - tasks.push(this.run("day", date, true, 0)); // 今日 - // 以下数据每6小时刷新一次 - const dateTime = new DateTime(); - const timeInfo = dateTime.getTimeInfo(date); - if ((timeInfo.nHour + 1) % 6 === 0) { - tasks.push(this.run("week", date, true, 0)); // 本周 - tasks.push(this.run("month", date, true, 0)); // 本月 - tasks.push(this.run("quarter", date, true, 0)); // 本季度 - tasks.push(this.run("year", date, true, 0)); // 本年度 - } - await Promise.all(tasks); - } - return res; - } - /** - * @desc 支付统计 - * @param {string} type 统计范围 hour:按小时统计,day:按天统计,week:按周统计,month:按月统计 quarter:按季度统计 year:按年统计 - * @param {date|time} date 哪个时间节点计算(默认已当前时间计算) - * @param {bool} reset 如果统计数据已存在,是否需要重新统计 - */ - async run(type, date, reset, offset = -1) { - // 定义变量 dimension,赋值为 type - let dimension = type; - // 创建一个 DateTime 实例 - const dateTime = new DateTime(); - // 根据 dimension、offset 和 date 获取时间维度 - const dateDimension = dateTime.getTimeDimensionByType(dimension, offset, date); - // 获取时间维度的起始时间,赋值给 start_time - let start_time = dateDimension.startTime; - // 获取时间维度的结束时间,赋值给 end_time - let end_time = dateDimension.endTime; - // 获取当前时间的时间戳,赋值给 runStartTime - let runStartTime = Date.now(); - // 定义变量 debug,赋值为 true - let debug = this.debug; - if (debug) { - console.log(`-----------------支付统计开始(${dimension})-----------------`); - console.log('本次统计时间:', dateTime.getDate('Y-m-d H:i:s', start_time), "-", dateTime.getDate('Y-m-d H:i:s', - end_time)) - console.log('本次统计参数:', 'type:' + type, 'date:' + date, 'reset:' + reset) - } - this.startTime = start_time; - let pubWhere = { - start_time, - end_time - }; - - // 查看当前时间段数据是否已存在,防止重复生成 - - if (!reset) { - // 如果 reset 为 false - // 调用 dao.uniStatPayResult.list 方法获取列表 - let list = await dao.uniStatPayResult.list({ - whereJson: { - ...pubWhere, // 使用 pubWhere 对象的属性作为查询条件 - dimension // 使用 dimension 变量作为查询条件 - } - }); - // 如果列表长度大于0 - if (list.length > 0) { - console.log('data have exists'); // 输出数据已存在的提示信息 - // 如果 debug 为 true - if (debug) { - let runEndTime = Date.now(); - console.log(`耗时:${((runEndTime - runStartTime ) / 1000).toFixed(3)} 秒`); // 输出耗时信息 - console.log(`-----------------支付统计结束(${dimension})-----------------`); // 输出支付统计结束信息 - } - // 返回一个对象,包含 code 和 msg 属性 - return { - code: 1003, - msg: 'Pay data in this time have already existed' - }; - } - } else { - // 如果 reset 为 true - // 调用 dao.uniStatPayResult.del 方法删除数据 - let delRes = await dao.uniStatPayResult.del({ - whereJson: { - ...pubWhere, // 使用 pubWhere 对象的属性作为删除条件 - dimension // 使用 dimension 变量作为删除条件 - } - }); - if (debug) console.log('Delete old data result:', JSON.stringify(delRes)); // 输出删除数据的结果 - } - - // 支付订单分组(已下单) - let statPayOrdersList1 = await dao.uniPayOrders.group({ - ...pubWhere, - status: "已下单" - }); - // 支付订单分组(且已付款,含退款) - let statPayOrdersList2 = await dao.uniPayOrders.group({ - ...pubWhere, - status: "已付款" - }); - // 支付订单分组(已退款) - let statPayOrdersList3 = await dao.uniPayOrders.group({ - ...pubWhere, - status: "已退款" - }); - let statPayOrdersList = statPayOrdersList1.concat(statPayOrdersList2).concat(statPayOrdersList3); - let res = { - code: 0, - msg: 'success' - } - // 将支付订单分组查询结果组装 - let statDta = {}; - if (statPayOrdersList.length > 0) { - // 如果 statPayOrdersList 的长度大于0 - // 遍历 statPayOrdersList 列表 - for (let i = 0; i < statPayOrdersList.length; i++) { - let item = statPayOrdersList[i]; // 获取当前遍历到的元素 - let { - appid, - version, - platform, - channel, - } = item._id; // 从 _id 属性中解构出 appid、version、platform 和 channel 属性 - if (!appid) { - continue - } - let { - status_str - } = item; // 解构出 status_str 属性 - let key = `${appid}-${version}-${platform}-${channel}`; // 拼接 key 字符串 - if (!statDta[key]) { - // 如果 statDta 对应的 key 不存在 - - statDta[key] = { // 创建一个新的对象,赋值给 statDta[key] - appid, - version, - platform, - channel, - status: {} // 创建一个空的 status 对象 - }; - } - let newItem = JSON.parse(JSON.stringify(item)); // 复制 item 对象,赋值给 newItem - delete newItem._id; // 删除 newItem 中的 _id 属性 - statDta[key].status[status_str] = newItem; // 将 newItem 添加到 statDta[key].status 对象中 - } - } - - if (this.debug) console.log('statDta: ', statDta) - - let saveList = []; - for (let key in statDta) { - let item = statDta[key]; - let { - appid, - version, - platform, - channel, - status: statusData, - } = item; - if (!channel) channel = item.scene; - - let fieldData = { - pay_total_amount: 0, - pay_order_count: 0, - pay_user_count: 0, - pay_device_count: 0, - create_total_amount: 0, - create_order_count: 0, - create_user_count: 0, - create_device_count: 0, - refund_total_amount: 0, - refund_order_count: 0, - refund_user_count: 0, - refund_device_count: 0, - }; - - - for (let status in statusData) { - let statusItem = statusData[status]; - if (status === "已下单") { - // 已下单 - fieldData.create_total_amount += statusItem.total_fee; - fieldData.create_order_count += statusItem.order_count; - fieldData.create_user_count += statusItem.user_count; - fieldData.create_device_count += statusItem.device_count; - } else if (status === "已付款") { - // 已付款 - fieldData.pay_total_amount += statusItem.total_fee; - fieldData.pay_order_count += statusItem.order_count; - fieldData.pay_user_count += statusItem.user_count; - fieldData.pay_device_count += statusItem.device_count; - } else if (status === "已退款") { - // 已退款 - fieldData.refund_total_amount += statusItem.total_fee; - fieldData.refund_order_count += statusItem.order_count; - fieldData.refund_user_count += statusItem.user_count; - fieldData.refund_device_count += statusItem.device_count; - } - } - // 平台信息 - let platformInfo = null; - if (this.platforms && this.platforms[platform]) { - // 从缓存中读取数据 - platformInfo = this.platforms[platform] - } else { - const platformObj = new Platform() - platformInfo = await platformObj.getPlatformAndCreate(platform, null) - if (!platformInfo || platformInfo.length === 0) { - platformInfo._id = '' - } - this.platforms[platform] = platformInfo; - } - // 渠道信息 - let channelInfo = null - const channelKey = appid + '_' + platformInfo._id + '_' + channel; - if (this.channels && this.channels[channelKey]) { - channelInfo = this.channels[channelKey]; - } else { - const channelObj = new Channel() - channelInfo = await channelObj.getChannelAndCreate(appid, platformInfo._id, channel) - if (!channelInfo || channelInfo.length === 0) { - channelInfo._id = '' - } - this.channels[channelKey] = channelInfo - } - // 版本信息 - let versionInfo = null - const versionKey = appid + '_' + platform + '_' + version - if (this.versions && this.versions[versionKey]) { - versionInfo = this.versions[versionKey] - } else { - const versionObj = new Version() - versionInfo = await versionObj.getVersionAndCreate(appid, platform, version) - if (!versionInfo || versionInfo.length === 0) { - versionInfo._id = '' - } - this.versions[versionKey] = versionInfo - } - let countWhereJson = { - create_time: _.gte(start_time).lte(end_time), - appid, - version, - platform: _.in(getUniPlatform(platform)), - channel, - }; - // 活跃设备数量 - let activity_device_count = await dao.uniStatSessionLogs.groupCount(countWhereJson); - // 活跃用户数量 - let activity_user_count = await dao.uniStatUserSessionLogs.groupCount(countWhereJson); - - /* - // TODO 此处有问题,暂不使用 - // 新设备数量 - let new_device_count = await dao.uniStatSessionLogs.groupCount({ - ...countWhereJson, - is_first_visit: 1, - }); - // 新注册用户数量 - let new_user_count = await dao.uniIdUsers.count({ - register_date: _.gte(start_time).lte(end_time), - register_env: { - appid, - app_version: version, - uni_platform: _.in(getUniPlatform(platform)), - channel, - } - }); - - - // 新注册用户中下单的人数 - let new_user_create_order_count = await dao.uniIdUsers.countNewUserOrder({ - whereJson: { - register_date: _.gte(start_time).lte(end_time), - register_env: { - appid, - app_version: version, - uni_platform: _.in(getUniPlatform(platform)), - channel, - } - }, - status: [-1, 0] - }); - // 新注册用户中支付成功的人数 - let new_user_pay_order_count = await dao.uniIdUsers.countNewUserOrder({ - whereJson: { - register_date: _.gte(start_time).lte(end_time), - register_env: { - appid, - app_version: version, - uni_platform: _.in(getUniPlatform(platform)), - channel, - } - }, - status: [1, 2, 3] - }); */ - - - saveList.push({ - appid, - platform_id: platformInfo._id, - channel_id: channelInfo._id, - version_id: versionInfo._id, - dimension, - create_date: Date.now(), // 记录下当前时间 - start_time, - end_time, - stat_date: getNowDate(start_time, 8, dimension), - ...fieldData, - activity_user_count, - activity_device_count, - // new_user_count, - // new_device_count, - // new_user_create_order_count, - // new_user_pay_order_count, - }); - } - if (this.debug) console.log('saveList: ', saveList) - //return; - if (saveList.length > 0) { - res = await dao.uniStatPayResult.adds(saveList); - } - if (debug) { - let runEndTime = Date.now(); - console.log(`耗时:${((runEndTime - runStartTime ) / 1000).toFixed(3)} 秒`) - console.log(`本次共添加:${saveList.length } 条记录`) - console.log(`-----------------支付统计结束(${dimension})-----------------`); - } - return res - } - -} - -// 获取平台 -function getUniPlatform(platform) { - let list = []; - if (["h5", "web"].indexOf(platform) > -1) { - list = ["h5", "web"]; - } else if (["app-plus", "app"].indexOf(platform) > -1) { - list = ["app-plus", "app"]; - } else { - list = [platform]; - } - return list; -} -// 获取当前时间 -function getNowDate(date = new Date(), targetTimezone = 8, dimension) { - if (typeof date === "string" && !isNaN(date)) date = Number(date); - if (typeof date == "number") { - if (date.toString().length == 10) date *= 1000; - date = new Date(date); - } - const { - year, - month, - day, - hour, - minute, - second - } = getFullTime(date); - // 现在的时间 - let date_str; - if (dimension === "month") { - date_str = timeFormat(date, "yyyy-MM", targetTimezone); - } else if (dimension === "quarter") { - date_str = timeFormat(date, "yyyy-MM", targetTimezone); - } else if (dimension === "year") { - date_str = timeFormat(date, "yyyy", targetTimezone); - } else { - date_str = timeFormat(date, "yyyy-MM-dd", targetTimezone); - } - return { - date_str, - year, - month, - day, - hour, - //minute, - //second, - }; -} -// 获取完整的时间对象参数 -function getFullTime(date = new Date(), targetTimezone = 8) { - if (!date) { - return ""; - } - if (typeof date === "string" && !isNaN(date)) date = Number(date); - if (typeof date == "number") { - if (date.toString().length == 10) date *= 1000; - date = new Date(date); - } - const dif = date.getTimezoneOffset(); - const timeDif = dif * 60 * 1000 + (targetTimezone * 60 * 60 * 1000); - const east8time = date.getTime() + timeDif; - date = new Date(east8time); - - let YYYY = date.getFullYear() + ''; - let MM = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1); - let DD = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()); - let hh = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()); - let mm = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()); - let ss = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds()); - return { - YYYY: Number(YYYY), - MM: Number(MM), - DD: Number(DD), - hh: Number(hh), - mm: Number(mm), - ss: Number(ss), - - year: Number(YYYY), - month: Number(MM), - day: Number(DD), - hour: Number(hh), - minute: Number(mm), - second: Number(ss), - }; -}; - - -/** - * 日期格式化 - */ -function timeFormat(time, fmt = 'yyyy-MM-dd hh:mm:ss', targetTimezone = 8) { - try { - if (!time) { - return ""; - } - if (typeof time === "string" && !isNaN(time)) time = Number(time); - // 其他更多是格式化有如下: - // yyyy-MM-dd hh:mm:ss|yyyy年MM月dd日 hh时MM分等,可自定义组合 - let date; - if (typeof time === "number") { - if (time.toString().length == 10) time *= 1000; - date = new Date(time); - } else { - date = time; - } - - const dif = date.getTimezoneOffset(); - const timeDif = dif * 60 * 1000 + (targetTimezone * 60 * 60 * 1000); - const east8time = date.getTime() + timeDif; - - date = new Date(east8time); - let opt = { - "M+": date.getMonth() + 1, //月份 - "d+": date.getDate(), //日 - "h+": date.getHours(), //小时 - "m+": date.getMinutes(), //分 - "s+": date.getSeconds(), //秒 - "q+": Math.floor((date.getMonth() + 3) / 3), //季度 - "S": date.getMilliseconds() //毫秒 - }; - if (/(y+)/.test(fmt)) { - fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length)); - } - for (let k in opt) { - if (new RegExp("(" + k + ")").test(fmt)) { - fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (opt[k]) : (("00" + opt[k]).substr(("" + opt[k]) - .length))); - } - } - return fmt; - } catch (err) { - // 若格式错误,则原值显示 - return time; - } -}; diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/uniIDUsers.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/uniIDUsers.js deleted file mode 100644 index 6f40dde..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/uniIDUsers.js +++ /dev/null @@ -1,97 +0,0 @@ -/** - * @class UniIDUsers uni-id 用户模型 - */ -const BaseMod = require('./base') -module.exports = class UniIDUsers extends BaseMod { - - constructor() { - super() - this.tableName = 'uni-id-users' - this.tablePrefix = false - } - - /** - * 获取用户数 - * @param {String} appid DCloud-appid - * @param {String} platform 平台 - * @param {String} channel 渠道 - * @param {String} version 版本 - * @param {Object} registerTime 注册时间范围 例:{$gte:开始日期时间戳, $lte:结束日期时间戳} - * @return {Number} - */ - async getUserCount(appid, platform, channel, version, registerTime) { - if(!appid || !platform) { - return false - } - const condition = this.getCondition(appid, platform, channel, version, registerTime) - let userCount = 0 - const userCountRes = await this.getCollection(this.tableName).where(condition).count() - if(userCountRes && userCountRes.total > 0) { - userCount = userCountRes.total - } - return userCount - } - - /** - * 获取用户编号列表 - * @param {String} appid DCloud-appid - * @param {String} platform 平台 - * @param {String} channel 渠道 - * @param {String} version 版本 - * @param {Object} registerTime 注册时间范围 例:{$gte:开始日期时间戳, $lte:结束日期时间戳} - * @return {Array} - */ - async getUserIds(appid, platform, channel, version, registerTime) { - if(!appid || !platform) { - return false - } - const condition = this.getCondition(appid, platform, channel, version, registerTime) - let uids = [] - const uidsRes = await this.selectAll(this.tableName, condition, { - _id: 1 - }) - - for (const u in uidsRes.data) { - uids.push(uidsRes.data[u]._id) - } - - return uids - } - - /** - * 获取查询条件 - * @param {String} appid DCloud-appid - * @param {String} platform 平台 - * @param {String} channel 渠道 - * @param {String} version 版本 - * @param {Object} registerTime 注册时间范围 例:{$gte:开始日期时间戳, $lte:结束日期时间戳} - */ - getCondition(appid, platform, channel, version, registerTime) { - - let condition = { - 'register_env.appid': appid,//DCloud appid - 'register_env.uni_platform': platform,//平台 - 'register_env.channel': channel ? channel : '1001', //渠道或场景值 - 'register_env.app_version' : version //应用版本区分 - } - - //原生应用平台 - if(['android', 'ios'].includes(platform)) { - condition['register_env.uni_platform'] = 'app'//systemInfo中uniPlatform字段android和ios都用app表示,所以此处查询需要用osName区分一下 - condition['register_env.os_name'] = platform //系统 - } - - //兼容vue2 - if(channel === '1001') { - condition['register_env.channel'] = {$in:['', '1001']} - } - - //注册时间 - if(registerTime) { - condition.register_date = registerTime - } - - return condition - } - -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/userSessionLog.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/userSessionLog.js deleted file mode 100644 index c6b4dcb..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/userSessionLog.js +++ /dev/null @@ -1,230 +0,0 @@ -/** - * @class UserSessionLog 用户会话日志模型 - */ -const BaseMod = require('./base') -const Platform = require('./platform') -const Channel = require('./channel') -const { - DateTime -} = require('../lib') -module.exports = class UserSessionLog extends BaseMod { - constructor() { - super() - this.tableName = 'user-session-logs' - } - - /** - * 用户会话日志数据填充 - * @param {Object} params 上报参数 - */ - async fill(params) { - - if (!params.sid) { - return { - code: 200, - msg: 'Not found session log' - } - } - - if (!params.uid) { - return { - code: 200, - msg: 'Parameter "uid" not found' - } - } - - const dateTime = new DateTime() - const platform = new Platform() - const channel = new Channel() - - //获取当前页面信息 - if (!params.page_id) { - const pageInfo = await page.getPageAndCreate(params.ak, params.url, params.ttpj) - if (!pageInfo || pageInfo.length === 0) { - return { - code: 300, - msg: 'Not found this entry page' - } - } - params.page_id = pageInfo._id - } - - const nowTime = dateTime.getTime() - - const fillParams = { - appid: params.ak, - version: params.v ? params.v : '', - platform: platform.getPlatformCode(params.ut, params.p), - channel: channel.getChannelCode(params), - session_id: params.sid, - uid: params.uid, - last_visit_time: nowTime, - entry_page_id: params.page_id, - exit_page_id: params.page_id, - page_count: 0, - event_count: 0, - duration: 1, - is_finish: 0, - create_time: nowTime, - } - - const res = await this.insert(this.tableName, fillParams) - - if (res && res.id) { - return { - code: 0, - msg: 'success' - } - } else { - return { - code: 500, - msg: 'User session log filled error' - } - } - } - - /** - * 检测用户会话是否有变化,并更新 - * @param {Object} params 校验参数 - sid:基础会话编号 uid:用户编号 last_visit_user_id:基础会话中最近一个访问用户的编号 - */ - async checkUserSession(params) { - if (!params.sid) { - return { - code: 200, - msg: 'Not found session log' - } - } - - if (!params.uid) { - //用户已退出会话 - if (params.last_visit_user_id) { - if (this.debug) { - console.log('user "' + params.last_visit_user_id + '" is exit session :', params.sid) - } - await this.closeUserSession(params.sid) - } - } else { - //添加用户日志 - if (!params.last_visit_user_id) { - await this.fill(params) - } - //用户已切换 - else if (params.uid != params.last_visit_user_id) { - if (this.debug) { - console.log('user "' + params.last_visit_user_id + '" change to "' + params.uid + - '" in the session :', params.sid) - } - //关闭原会话生成新用户对话 - await this.closeUserSession(params.sid) - await this.fill(params) - } - } - return { - code: 0, - msg: 'success' - } - } - - - - /** - * 关闭用户会话 - * @param {String} sid 基础会话编号 - */ - async closeUserSession(sid) { - if (this.debug) { - console.log('close user session log by sid:', sid) - } - return await this.update(this.tableName, { - is_finish: 1 - }, { - session_id: sid, - is_finish: 0 - }) - } - - - /** - * 更新会话信息 - * @param {String} sid 基础会话编号 - * @param {Object} data 更新数据 - */ - async updateUserSession(sid, data) { - - const userSession = await this.getCollection(this.tableName).where({ - session_id: sid, - uid: data.uid, - is_finish: 0 - }).orderBy('create_time', 'desc').limit(1).get() - - if (userSession.data.length === 0) { - console.log('Not found the user session', { - session_id: sid, - uid: data.uid, - is_finish: 0 - }) - return { - code: 300, - msg: 'Not found the user session' - } - } - - let nowTime = data.nowTime ? data.nowTime : new DateTime().getTime() - const accessTime = nowTime - userSession.data[0].create_time - const accessSenconds = accessTime > 1000 ? parseInt(accessTime / 1000) : 1 - - const updateData = { - last_visit_time: nowTime, - duration: accessSenconds, - } - - //访问页面数量 - if (data.addPageCount) { - updateData.page_count = userSession.data[0].page_count + data.addPageCount - } - //最终访问的页面编号 - if (data.pageId) { - updateData.exit_page_id = data.pageId - } - //产生事件次数 - if (data.eventCount) { - updateData.event_count = userSession.data[0].event_count + data.addEventCount - } - - if (this.debug) { - console.log('update user session log by sid-' + sid, updateData) - } - - await this.update(this.tableName, updateData, { - _id: userSession.data[0]._id - }) - - return { - code: 0, - msg: 'success' - } - } - - /** - * 清理用户会话日志数据 - * @param {Object} days 保留天数, 留存统计需要计算30天后留存率,因此至少应保留31天的日志数据 - */ - async clean(days = 31) { - if(days === 0) { - return false; - } - days = Math.max(parseInt(days), 1) - console.log('clean user session logs - day:', days) - const dateTime = new DateTime() - const res = await this.delete(this.tableName, { - create_time: { - $lt: dateTime.getTimeBySetDays(0 - days) - } - }) - if (!res.code) { - console.log('clean user session log:', res) - } - return res - } - -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/version.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/version.js deleted file mode 100644 index b20236a..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/mod/version.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * @class Version 应用版本模型 - */ -const BaseMod = require('./base') -const { - DateTime -} = require('../lib') -module.exports = class Version extends BaseMod { - constructor() { - super() - this.tableName = 'opendb-app-versions' - this.tablePrefix = false - this.cacheKeyPre = 'uni-stat-app-version-' - } - - /** - * 获取版本信息 - * @param {String} appid DCloud-appid - * @param {String} platformId 平台编号 - * @param {String} appVersion 平台版本号 - */ - async getVersion(appid, platform, appVersion) { - const cacheKey = this.cacheKeyPre + appid + '-' + platform + '-' + appVersion - let versionData = await this.getCache(cacheKey) - if (!versionData) { - const versionInfo = await this.getCollection(this.tableName).where({ - appid: appid, - uni_platform: platform, - type: 'native_app', - version: appVersion - }).limit(1).get() - versionData = [] - if (versionInfo.data.length > 0) { - versionData = versionInfo.data[0] - await this.setCache(cacheKey, versionData) - } - } - return versionData - } - - - /** - * 获取版本信息没有则进行创建 - * @param {String} appid DCloud-appid - * @param {String} platform 平台代码 - * @param {String} appVersion 平台版本号 - */ - async getVersionAndCreate(appid, platform, appVersion) { - const versionInfo = await this.getVersion(appid, platform, appVersion) - if (versionInfo.length === 0) { - if (appVersion.length > 0 && !appVersion.includes('}')) { - const thisTime = new DateTime().getTime() - const insertParam = { - appid: appid, - platform: [], - uni_platform: platform, - type: 'native_app', - version: appVersion, - stable_publish: false, - create_env: 'uni-stat', - create_date: thisTime - } - const res = await this.insert(this.tableName, insertParam) - if (res && res.id) { - return Object.assign(insertParam, { - _id: res.id - }) - } - } - } - return versionInfo - } -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/receiver.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/receiver.js deleted file mode 100644 index 8b76618..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/receiver.js +++ /dev/null @@ -1,138 +0,0 @@ -/** - * @class UniStatReportDataReceiver uni统计上报数据接收器 - * @function report 上报数据调度处理函数 - */ -const { - parseUrlParams -} = require('../shared') -const SessionLog = require('./mod/sessionLog') -const PageLog = require('./mod/pageLog') -const EventLog = require('./mod/eventLog') -const ErrorLog = require('./mod/errorLog') -const AppCrashLog = require('./mod/appCrashLogs.js') -const Device = require('./mod/device') -class UniStatReportDataReceiver { - /** - * @description 上报数据调度处理函数 - * @param {Object} params 基础上报参数 - * @param {Object} context 请求附带的上下文信息 - */ - async report(params, context) { - let res = { - code: 0, - msg: 'success' - } - - if (!params || !params.requests) { - return { - code: 200, - msg: 'Invild params' - } - } - - // JSON参数解析 - const requestParam = JSON.parse(params.requests) - if (!requestParam || requestParam.length === 0) { - return { - code: 200, - msg: 'Invild params' - } - } - - // 日志填充 - const sessionParams = [] - const pageParams = [] - const eventParams = [] - const appCrashParams = [] - const errorParams = [] - const device = new Device() - for (const ri in requestParam) { - //参数解析 - const urlParams = parseUrlParams(requestParam[ri], context) - if (!urlParams.ak) { - return { - code: 201, - msg: 'Not found appid' - } - } - - if (!urlParams.lt) { - return { - code: 202, - msg: 'Not found this log type' - } - } - - switch (parseInt(urlParams.lt)) { - // 会话日志 - case 1: { - sessionParams.push(urlParams) - break - } - // 页面日志 - case 3: - case 11: { - pageParams.push(urlParams) - break - } - // 事件日志 - case 21: { - eventParams.push(urlParams) - break - } - // 错误日志 - case 31: { - errorParams.push(urlParams) - break - } - //uni-app x应用崩溃日志 - case 41: { - appCrashParams.push(urlParams) - } - //unipush信息绑定 - case 101: { - res = await device.bindPush(urlParams) - break - } - default: { - console.log('Invalid type by param "lt:' + urlParams.lt + '"') - break - } - } - } - - //会话日志填充 - if (sessionParams.length > 0) { - const sessionLog = new SessionLog() - res = await sessionLog.batchFill(sessionParams) - } - - //页面日志填充 - if (pageParams.length > 0) { - const pageLog = new PageLog() - res = await pageLog.fill(pageParams) - } - - //事件日志填充 - if (eventParams.length > 0) { - const eventLog = new EventLog() - res = await eventLog.fill(eventParams) - } - - //错误日志填充 - if (errorParams.length > 0) { - const errorLog = new ErrorLog() - res = await errorLog.fill(errorParams) - } - - //uni-app x应用崩溃日志填充 - if(appCrashParams.length > 0) { - const appCrashLog = new AppCrashLog() - res = await appCrashLog.fill(appCrashParams) - } - - return res - } -} - -module.exports = UniStatReportDataReceiver diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/stat.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/stat.js deleted file mode 100644 index 34a204f..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/common/uni-stat/stat/stat.js +++ /dev/null @@ -1,406 +0,0 @@ -/** - * @class UniStatDataStat uni统计-数据统计调度处理模块 - * @function cron 数据统计定时任务处理函数 - * @function stat 数据统计调度处理函数 - * @function cleanLog 日志清理调度处理函数 - */ -const { - DateTime -} = require('./lib') - -const { - sleep -} = require('../shared') - -const { - BaseMod, - SessionLog, - PageLog, - EventLog, - ShareLog, - ErrorLog, - StatResult, - ActiveDevices, - ActiveUsers, - PageResult, - PageDetailResult, - EventResult, - ErrorResult, - Loyalty, - RunErrors, - UserSessionLog, - uniPay, - Setting, - AppCrashLogs -} = require('./mod') -class UniStatDataStat { - /** - * 数据统计定时任务处理函数 - * @param {Object} context 服务器请求上下文参数 - */ - async cron(context) { - const baseMod = new BaseMod() - const dateTime = new DateTime() - console.log('Cron start time: ', dateTime.getDate('Y-m-d H:i:s')) - - // const setting = new Setting(); - // let settingValue = await setting.getSetting() - // if (settingValue.mode === "close") { - // // 如果关闭了统计任务,则任务直接结束 - // return { - // code: 0, - // msg: 'Task is close', - // } - // } else if (settingValue.mode === "auto") { - // // 如果开启了节能模式,则判断N天内是否有设备访问记录 - // let runKey = await setting.checkAutoRun(settingValue); - // if (!runKey) { - // return { - // code: 0, - // msg: 'Task is auto close', - // } - // } - // } - - //获取运行参数 - const timeInfo = dateTime.getTimeInfo(null, false) - const cronConfig = baseMod.getConfig('cron') - const cronMin = baseMod.getConfig('cronMin') - const realtimeStat = baseMod.getConfig('realtimeStat') - // 数据跑批 - let res = null - if (cronConfig && cronConfig.length > 0) { - for (let mi in cronConfig) { - const currCronConfig = cronConfig[mi] - const cronType = currCronConfig.type - const cronTime = currCronConfig.time.split(' ') - const cronDimension = currCronConfig.dimension - - //未开启分钟级定时任务,则设置为小时级定时任务 - if (cronTime.length === 4 && !cronMin) { - cronTime.splice(3, 1) - } - - if (baseMod.debug) { - console.log('cronTime', cronTime) - } - //精度为分钟级的定时任务 - if (cronTime.length === 4) { - if (cronTime[0] !== '*') { - //周统计任务 - if (timeInfo.nWeek == cronTime[0] && timeInfo.nHour == cronTime[2] && timeInfo.nMinutes == - cronTime[3]) { - let dimension = cronDimension || 'week'; - console.log(cronType + `--${dimension} run`) - res = await this.stat({ - type: cronType, - dimension: cronDimension, - config: currCronConfig - }) - } - } else if (cronTime[1] !== '*') { - //月统计任务(包含季度统计任务和年统计任务) - if (timeInfo.nDay == cronTime[1] && timeInfo.nHour == cronTime[2] && timeInfo.nMinutes == - cronTime[3]) { - let dimension = cronDimension || 'month'; - console.log(cronType + `--${dimension} run`) - res = await this.stat({ - type: cronType, - dimension: dimension, - config: currCronConfig - }) - } - } else if (cronTime[2] !== '*') { - //日统计任务 - if (timeInfo.nHour == cronTime[2] && timeInfo.nMinutes == cronTime[3]) { - let dimension = cronDimension || 'day'; - console.log(cronType + `--${dimension} run`) - res = await this.stat({ - type: cronType, - dimension: dimension, - config: currCronConfig - }) - } - } else if (cronTime[3] !== '*') { - //实时统计任务 - if (timeInfo.nMinutes == cronTime[3] && realtimeStat) { - let dimension = cronDimension || 'hour'; - console.log(cronType + `--${dimension} run`) - res = await this.stat({ - type: cronType, - dimension: dimension, - config: currCronConfig - }) - } - } - } - //精度为小时级的定时任务 - else if (cronTime.length === 3) { - if (cronTime[0] !== '*') { - //周统计任务 - if (timeInfo.nWeek == cronTime[0] && timeInfo.nHour == cronTime[2]) { - let dimension = cronDimension || 'week'; - console.log(cronType + `--${dimension} run`) - res = await this.stat({ - type: cronType, - dimension: dimension, - config: currCronConfig - }) - } - } else if (cronTime[1] !== '*') { - //月统计任务(包含季度统计任务和年统计任务) - if (timeInfo.nDay == cronTime[1] && timeInfo.nHour == cronTime[2]) { - let dimension = cronDimension || 'month'; - console.log(cronType + `--${dimension} run`) - res = await this.stat({ - type: cronType, - dimension: dimension, - config: currCronConfig - }) - } - } else if (cronTime[2] !== '*') { - //日统计任务 - if (timeInfo.nHour == cronTime[2]) { - let dimension = cronDimension || 'day'; - console.log(cronType + `--${dimension} run`) - res = await this.stat({ - type: cronType, - dimension: dimension, - config: currCronConfig - }) - } - } else { - //实时统计任务 - if (realtimeStat) { - let dimension = cronDimension || 'hour'; - console.log(cronType + `--${dimension} run`) - res = await this.stat({ - type: cronType, - dimension: dimension, - config: currCronConfig - }) - } - } - } else { - console.error('Cron configuration error') - } - } - } - console.log('Cron end time: ', dateTime.getDate('Y-m-d H:i:s')) - return { - code: 0, - msg: 'Task have done', - lastCronResult: res - } - } - - /** - * 数据统计调度处理函数 - * @param {Object} params 统计参数 - */ - async stat(params) { - const { - type, - dimension, - date, - reset, - config - } = params - let res = { - code: 0, - msg: 'success' - } - - try { - switch (type) { - // 基础统计 - case 'stat': { - const resultStat = new StatResult() - res = await resultStat.stat(dimension, date, reset) - break - } - // 活跃设备统计归集 - case 'active-device': { - const activeDevices = new ActiveDevices() - res = await activeDevices.stat(date, reset) - break - } - // 活跃用户统计归集 - case 'active-user': { - const activeUsers = new ActiveUsers() - res = await activeUsers.stat(date, reset) - break - } - // 设备留存统计 - case 'retention-device': { - const retentionStat = new StatResult() - res = await retentionStat.retentionStat(dimension, date) - break - } - // 用户留存统计 - case 'retention-user': { - const retentionStat = new StatResult() - res = await retentionStat.retentionStat(dimension, date, 'user') - break - } - // 页面统计 - case 'page': { - const pageStat = new PageResult() - res = await pageStat.stat(dimension, date, reset) - break - } - // 页面内容统计 - case 'page-detail': { - const pageDetailStat = new PageDetailResult() - res = await pageDetailStat.stat(dimension, date, reset) - break - } - // 事件统计 - case 'event': { - const eventStat = new EventResult() - res = await eventStat.stat(dimension, date, reset) - break - } - // 错误统计 - case 'error': { - const errorStat = new ErrorResult() - res = await errorStat.stat(dimension, date, reset) - break - } - // 设备忠诚度统计 - case 'loyalty': { - const loyaltyStat = new Loyalty() - res = await loyaltyStat.stat(dimension, date, reset) - break - } - // 日志清理 - case 'clean': { - res = await this.cleanLog() - } - // 支付统计 - case 'pay-result': { - const paymentResult = new uniPay.PayResult() - res = await paymentResult.stat(dimension, date, reset, config) - break - } - } - } catch (e) { - const maxTryTimes = 2 - if (!this.tryTimes) { - this.tryTimes = 1 - } else { - this.tryTimes++ - } - - //报错则重新尝试2次, 解决部分云服务器偶现连接超时问题 - if (this.tryTimes <= maxTryTimes) { - //休眠3秒后重新调用 - await sleep(3000) - params.reset = true - res = await this.stat(params) - } else { - // 2次尝试失败后记录错误 - console.error('server error: ' + e) - const runError = new RunErrors() - runError.create({ - mod: 'stat', - params: params, - error: e, - create_time: new DateTime().getTime() - }) - - res = { - code: 500, - msg: 'server error' + e - } - } - } - return res - } - - /** - * 日志清理调度处理函数 - */ - async cleanLog() { - const baseMod = new BaseMod() - const cleanLog = baseMod.getConfig('cleanLog') - if (!cleanLog || !cleanLog.open) { - return { - code: 100, - msg: 'The log cleanup service has not been turned on' - } - } - - const res = { - code: 0, - msg: 'success', - data: {} - } - - // 会话日志 - if (cleanLog.reserveDays.sessionLog > 0) { - const sessionLog = new SessionLog() - res.data.sessionLog = await sessionLog.clean(cleanLog.reserveDays.sessionLog) - } - - // 用户会话日志 - if (cleanLog.reserveDays.userSessionLog > 0) { - const userSessionLog = new UserSessionLog() - res.data.userSessionLog = await userSessionLog.clean(cleanLog.reserveDays.userSessionLog) - } - - // 页面日志 - if (cleanLog.reserveDays.pageLog > 0) { - const pageLog = new PageLog() - res.data.pageLog = await pageLog.clean(cleanLog.reserveDays.pageLog) - } - - // 事件日志 - if (cleanLog.reserveDays.eventLog > 0) { - const eventLog = new EventLog() - res.data.eventLog = await eventLog.clean(cleanLog.reserveDays.eventLog) - } - - // 分享日志 - if (cleanLog.reserveDays.shareLog > 0) { - const shareLog = new ShareLog() - res.data.shareLog = await shareLog.clean(cleanLog.reserveDays.shareLog) - } - - // 错误日志 - if (cleanLog.reserveDays.errorLog > 0) { - const errorLog = new ErrorLog() - res.data.errorLog = await errorLog.clean(cleanLog.reserveDays.errorLog) - } - - // 活跃设备日志 - const activeDevicesLog = new ActiveDevices() - res.data.activeDevicesLog = await activeDevicesLog.clean() - - // 活跃用户日志 - const activeUsersLog = new ActiveUsers() - res.data.activeUsersLog = await activeUsersLog.clean() - - // 实时统计日志 - const resultHourLog = new StatResult() - if(Object.keys(cleanLog.reserveDays).indexOf('resultHourLog') > -1) { - res.data.resultHourLog = await resultHourLog.cleanHourLog(cleanLog.reserveDays.resultHourLog) - } else { - //兼容老版本 - res.data.resultHourLog = await resultHourLog.cleanHourLog() - } - - //原生应用崩溃日志 - const appCrashLogs = new AppCrashLogs() - if(Object.keys(cleanLog.reserveDays).indexOf('appCrashLog') > -1) { - res.data.appCrashLogs = await appCrashLogs.clean(cleanLog.reserveDays.appCrashLog) - } else { - //兼容老版本 - res.data.appCrashLogs = await appCrashLogs.clean() - } - - return res - } -} - -module.exports = UniStatDataStat diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/ext-storage-co/index.obj.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/ext-storage-co/index.obj.js deleted file mode 100644 index a858606..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/ext-storage-co/index.obj.js +++ /dev/null @@ -1,58 +0,0 @@ -const provider = "qiniu"; -module.exports = { - _before: function() { - - }, - getUploadFileOptions(data = {}) { - let { - cloudPath, - domain, - } = data; - // 可以在此先判断下此路径是否允许上传等逻辑 - // ... - - // 然后获取 extStorageManager 对象实例 - const extStorageManager = uniCloud.getExtStorageManager({ - provider, // 扩展存储供应商 - domain, // 自定义域名 - }); - // 最后调用 extStorageManager.getUploadFileOptions - let uploadFileOptionsRes = extStorageManager.getUploadFileOptions({ - cloudPath: `public/${cloudPath}`, // 强制在public目录下 - allowUpdate: false, // 是否允许覆盖更新,如果返回前端,建议设置false,代表仅新增,不可覆盖 - }); - return uploadFileOptionsRes; - }, - // // 下载文件 - // async downloadFile(data = {}) { - // let { - // fileID, - // domain, - // } = data; - // const extStorageManager = uniCloud.getExtStorageManager({ - // provider, // 扩展存储供应商 - // domain, // 自定义域名 - // }); - // let res = extStorageManager.downloadFile({ - // fileID - // }); - // return res; - // }, - // // 删除文件 - // async deleteFile(data = {}) { - // let { - // fileList, - // domain - // } = data; - // const extStorageManager = uniCloud.getExtStorageManager({ - // provider, // 扩展存储供应商 - // domain, // 自定义域名 - // }); - // let res = await extStorageManager.deleteFile({ - // fileList - // }); - // console.log('deleteFile: ', res); - // return res; - // }, - -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/ext-storage-co/package.json b/sport-erp-admin/uniCloud-alipay/cloudfunctions/ext-storage-co/package.json deleted file mode 100644 index f65d47c..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/ext-storage-co/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "ext-storage-co", - "dependencies": {}, - "extensions": { - "uni-cloud-ext-storage": {} - }, - "origin-plugin-dev-name": "uni-template-admin", - "origin-plugin-version": "2.5.13", - "plugin-dev-name": "uni-template-admin", - "plugin-version": "2.5.13" -} \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-analyse-searchhot/index.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-analyse-searchhot/index.js deleted file mode 100644 index 1f16dc2..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-analyse-searchhot/index.js +++ /dev/null @@ -1,49 +0,0 @@ -'use strict'; -exports.main = async (event, context) => { - /** - * 根据搜索记录,设定时间间隔来归纳出热搜数据并存储在热搜表中 - */ - const SEARCHHOT = 'opendb-search-hot'; // 热搜数据库名称 - const SEARCHLOG = 'opendb-search-log'; // 搜索记录数据库名称 - const SEARCHLOG_timeZone = 604800000; // 归纳搜索记录时间间隔,毫秒数,默认为最近7天 - const SEARCHHOT_size = 10; // 热搜条数 - - const DB = uniCloud.database(); - const DBCmd = DB.command; - const $ = DB.command.aggregate; - const SEARCHHOT_db = DB.collection(SEARCHHOT); - const SEARCHLOG_db = DB.collection(SEARCHLOG); - const timeEnd = Date.now() - SEARCHLOG_timeZone; - - let { - data: searchHotData - } = await SEARCHLOG_db - .aggregate() - .match({ - create_date: DBCmd.gt(timeEnd) - }) - .group({ - _id: { - 'content': '$content', - }, - count: $.sum(1) - }) - .replaceRoot({ - newRoot: $.mergeObjects(['$_id', '$$ROOT']) - }) - .project({ - _id: false - }) - .sort({ - count: -1 - }) - .end(); - - let now = Date.now(); - searchHotData.map(item => { - item.create_date = now; - return item; - }).slice(0, SEARCHHOT_size); - // searchHotData = searchHotData.sort((a, b) => b.count - a.count).slice(0, SEARCHHOT_size); - return searchHotData.length ? await SEARCHHOT_db.add(searchHotData) : '' -}; diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-analyse-searchhot/package.json b/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-analyse-searchhot/package.json deleted file mode 100644 index 3e99a10..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-analyse-searchhot/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "uni-analyse-searchhot", - "version": "1.0.0", - "description": "定时归纳热搜", - "main": "index.js", - "dependencies": {}, - "cloudfunction-config": { - "triggers": [ - { - "name": "analyse-searchHot", - "type": "timer", - "config": "0 0 *\/2 * * * *" - } - ] - }, - "origin-plugin-dev-name": "uni-template-admin", - "origin-plugin-version": "2.5.13", - "plugin-dev-name": "uni-template-admin", - "plugin-version": "2.5.13" -} \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-portal/createPublishHtml/index.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-portal/createPublishHtml/index.js deleted file mode 100644 index 2168467..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-portal/createPublishHtml/index.js +++ /dev/null @@ -1,215 +0,0 @@ -const fs = require('fs') -const path = require('path') -const TE = require('./lib/art-template.js'); - -// 标准语法的界定符规则 -TE.defaults.openTag = '{@' -TE.defaults.closeTag = '@}' -TE.defaults.escape = false - -const success = { - success: true -} -const fail = { - success: false -} - -async function translateTCB(_fileList = []) { - if (!_fileList.length) return _fileList - // 腾讯云和阿里云下载链接不同,需要处理一下,阿里云会原样返回 - const translateUrl = [] - const translateUrlIndex = [] // 确保处理过后位置不变 - _fileList.forEach((item, index) => { - if (/^cloud:\/\//.test(item)) { - translateUrl.push(item) - translateUrlIndex.push(index) - } - }) - if (translateUrl.length) { - const { - fileList - } = await uniCloud.getTempFileURL({ - fileList: translateUrl - }); - fileList.forEach((item, index) => { - if (item.tempFileURL) { - _fileList.splice(translateUrlIndex[index], 1, item.tempFileURL) - } - }) - } - return _fileList -} - -function hasValue(value) { - if (typeof value !== 'object') return !!value - if (value instanceof Array) return !!value.length - return !!(value && Object.keys(value).length) -} - -module.exports = async function(id) { - if (!id) { - return { - ...fail, - code: -1, - errMsg: 'id required' - }; - } - - // 根据sitemap配置加载页面模板,例如列表页,详情页 - let templatePage = fs.readFileSync(path.resolve(__dirname, './template.html'), 'utf8'); - if (!templatePage) { - return { - ...fail, - code: -2, - errMsg: 'page template no found' - }; - } - - const db = uniCloud.database() - let dbPublishList - try { - dbPublishList = db.collection('opendb-app-list') - } catch (e) {} - - if (!dbPublishList) return fail; - - const record = await dbPublishList.where({ - _id: id - }).get({ - getOne: true - }) - - if (record && record.data && record.data.length) { - const appInfo = record.data[0] - - const defaultOptions = { - hasApp: false, - hasMP: false, - hasH5: false, - hasQuickApp: false - } - - defaultOptions.mpNames = { - 'mp_weixin': '微信', - 'mp_alipay': '支付宝', - 'mp_baidu': '百度', - 'mp_toutiao': '字节', - 'mp_qq': 'QQ', - 'mp_dingtalk': '钉钉', - 'mp_kuaishou': '快手', - 'mp_lark': '飞书', - 'mp_jd': '京东' - } - - const imageList = []; - ['app_android'].forEach(key => { - if (!hasValue(appInfo[key])) return - imageList.push({ - key, - urlKey: 'url', - url: appInfo[key].url - }) - }) - Object.keys(defaultOptions.mpNames).concat('quickapp').forEach(key => { - if (!hasValue(appInfo[key])) return - imageList.push({ - key, - urlKey: 'qrcode_url', - url: appInfo[key].qrcode_url - }) - }); - ['icon_url'].forEach(key => { - if (!hasValue(appInfo[key])) return - imageList.push({ - key, - url: appInfo[key] - }) - }) - const filelist = await translateTCB(imageList.map(item => item.url)) - imageList.forEach((item, index) => { - if (item.urlKey) { - appInfo[item.key][item.urlKey] = filelist[index] - } else { - appInfo[item.key] = filelist[index] - } - }) - if (hasValue(appInfo.screenshot)) { - appInfo.screenshot = await translateTCB(appInfo.screenshot) - } - - { - const appInfoKeys = Object.keys(appInfo) - if (appInfoKeys.some(key => { - return key.indexOf('app_') !== -1 && hasValue(appInfo[key]) - })) { - defaultOptions.hasApp = true - } - if (appInfoKeys.some(key => { - return key.indexOf('mp') !== -1 && hasValue(appInfo[key]) - })) { - defaultOptions.hasMP = true - } - if (appInfo.h5 && appInfo.h5.url) { - defaultOptions.hasH5 = true - } - if (appInfo.quickapp && appInfo.quickapp.qrcode_url) { - defaultOptions.hasQuickApp = true - } - - // app - if (defaultOptions.hasApp && appInfo.app_android && appInfo.app_android.url) { - defaultOptions.android_url = appInfo.app_android.url - } else { - defaultOptions.android_url = '' - } - if (defaultOptions.hasApp && appInfo.app_ios) { - if (appInfo.app_ios.url) { - defaultOptions.ios_url = appInfo.app_ios.url - } - if (appInfo.app_ios.abm_url) { - defaultOptions.ios_abm_url = appInfo.app_ios.abm_url - } - } else { - defaultOptions.ios_url = '' - defaultOptions.ios_abm_url = '' - } - if (defaultOptions.hasApp && appInfo.app_harmony && appInfo.app_harmony.url) { - defaultOptions.harmony_url = appInfo.app_harmony.url - } else { - defaultOptions.harmony_url = '' - } - - // mp - defaultOptions.mpKeys = Object.keys(appInfo).filter(key => { - return key.indexOf('mp') !== -1 && hasValue(appInfo[key]) - }) - } - - if (!(defaultOptions.hasApp || defaultOptions.hasH5 || defaultOptions.hasMP || defaultOptions - .hasQuickApp)) { - return { - ...fail, - code: -100, - errMsg: '缺少应用信息,App、小程序、H5、快应用请至少填写一项' - } - } - - const html = TE.render(templatePage)(Object.assign({}, appInfo, defaultOptions)); - - return { - ...success, - mpserverlessComposedResponse: true, // 使用阿里云返回集成响应是需要此字段为true - statusCode: 200, - headers: { - 'content-type': 'text/html' - }, - body: html - }; - } - - return { - ...fail, - code: -3, - errMsg: 'no record' - }; -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-portal/createPublishHtml/lib/art-template.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-portal/createPublishHtml/lib/art-template.js deleted file mode 100644 index b292990..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-portal/createPublishHtml/lib/art-template.js +++ /dev/null @@ -1,2 +0,0 @@ -/*!art-template - Template Engine | http://aui.github.com/artTemplate/*/ -!function(){function a(a){return a.replace(t,"").replace(u,",").replace(v,"").replace(w,"").replace(x,"").split(y)}function b(a){return"'"+a.replace(/('|\\)/g,"\\$1").replace(/\r/g,"\\r").replace(/\n/g,"\\n")+"'"}function c(c,d){function e(a){return m+=a.split(/\n/).length-1,k&&(a=a.replace(/\s+/g," ").replace(//g,"")),a&&(a=s[1]+b(a)+s[2]+"\n"),a}function f(b){var c=m;if(j?b=j(b,d):g&&(b=b.replace(/\n/g,function(){return m++,"$line="+m+";"})),0===b.indexOf("=")){var e=l&&!/^=[=#]/.test(b);if(b=b.replace(/^=[=#]?|[\s;]*$/g,""),e){var f=b.replace(/\s*\([^\)]+\)/,"");n[f]||/^(include|print)$/.test(f)||(b="$escape("+b+")")}else b="$string("+b+")";b=s[1]+b+s[2]}return g&&(b="$line="+c+";"+b),r(a(b),function(a){if(a&&!p[a]){var b;b="print"===a?u:"include"===a?v:n[a]?"$utils."+a:o[a]?"$helpers."+a:"$data."+a,w+=a+"="+b+",",p[a]=!0}}),b+"\n"}var g=d.debug,h=d.openTag,i=d.closeTag,j=d.parser,k=d.compress,l=d.escape,m=1,p={$data:1,$filename:1,$utils:1,$helpers:1,$out:1,$line:1},q="".trim,s=q?["$out='';","$out+=",";","$out"]:["$out=[];","$out.push(",");","$out.join('')"],t=q?"$out+=text;return $out;":"$out.push(text);",u="function(){var text=''.concat.apply('',arguments);"+t+"}",v="function(filename,data){data=data||$data;var text=$utils.$include(filename,data,$filename);"+t+"}",w="'use strict';var $utils=this,$helpers=$utils.$helpers,"+(g?"$line=0,":""),x=s[0],y="return new String("+s[3]+");";r(c.split(h),function(a){a=a.split(i);var b=a[0],c=a[1];1===a.length?x+=e(b):(x+=f(b),c&&(x+=e(c)))});var z=w+x+y;g&&(z="try{"+z+"}catch(e){throw {filename:$filename,name:'Render Error',message:e.message,line:$line,source:"+b(c)+".split(/\\n/)[$line-1].replace(/^\\s+/,'')};}");try{var A=new Function("$data","$filename",z);return A.prototype=n,A}catch(B){throw B.temp="function anonymous($data,$filename) {"+z+"}",B}}var d=function(a,b){return"string"==typeof b?q(b,{filename:a}):g(a,b)};d.version="3.0.0",d.config=function(a,b){e[a]=b};var e=d.defaults={openTag:"<%",closeTag:"%>",escape:!0,cache:!0,compress:!1,parser:null},f=d.cache={};d.render=function(a,b){return q(a,b)};var g=d.renderFile=function(a,b){var c=d.get(a)||p({filename:a,name:"Render Error",message:"Template not found"});return b?c(b):c};d.get=function(a){var b;if(f[a])b=f[a];else if("object"==typeof document){var c=document.getElementById(a);if(c){var d=(c.value||c.innerHTML).replace(/^\s*|\s*$/g,"");b=q(d,{filename:a})}}return b};var h=function(a,b){return"string"!=typeof a&&(b=typeof a,"number"===b?a+="":a="function"===b?h(a.call(a)):""),a},i={"<":"<",">":">",'"':""","'":"'","&":"&"},j=function(a){return i[a]},k=function(a){return h(a).replace(/&(?![\w#]+;)|[<>"']/g,j)},l=Array.isArray||function(a){return"[object Array]"==={}.toString.call(a)},m=function(a,b){var c,d;if(l(a))for(c=0,d=a.length;d>c;c++)b.call(a,a[c],c,a);else for(c in a)b.call(a,a[c],c)},n=d.utils={$helpers:{},$include:g,$string:h,$escape:k,$each:m};d.helper=function(a,b){o[a]=b};var o=d.helpers=n.$helpers;d.onerror=function(a){var b="Template Error\n\n";for(var c in a)b+="<"+c+">\n"+a[c]+"\n\n";"object"==typeof console&&console.error(b)};var p=function(a){return d.onerror(a),function(){return"{Template Error}"}},q=d.compile=function(a,b){function d(c){try{return new i(c,h)+""}catch(d){return b.debug?p(d)():(b.debug=!0,q(a,b)(c))}}b=b||{};for(var g in e)void 0===b[g]&&(b[g]=e[g]);var h=b.filename;try{var i=c(a,b)}catch(j){return j.filename=h||"anonymous",j.name="Syntax Error",p(j)}return d.prototype=i.prototype,d.toString=function(){return i.toString()},h&&b.cache&&(f[h]=d),d},r=n.$each,s="break,case,catch,continue,debugger,default,delete,do,else,false,finally,for,function,if,in,instanceof,new,null,return,switch,this,throw,true,try,typeof,var,void,while,with,abstract,boolean,byte,char,class,const,double,enum,export,extends,final,float,goto,implements,import,int,interface,long,native,package,private,protected,public,short,static,super,synchronized,throws,transient,volatile,arguments,let,yield,undefined",t=/\/\*[\w\W]*?\*\/|\/\/[^\n]*\n|\/\/[^\n]*$|"(?:[^"\\]|\\[\w\W])*"|'(?:[^'\\]|\\[\w\W])*'|\s*\.\s*[$\w\.]+/g,u=/[^\w$]+/g,v=new RegExp(["\\b"+s.replace(/,/g,"\\b|\\b")+"\\b"].join("|"),"g"),w=/^\d[^,]*|,\d[^,]*/g,x=/^,+|,+$/g,y=/^$|,+/;e.openTag="{{",e.closeTag="}}";var z=function(a,b){var c=b.split(":"),d=c.shift(),e=c.join(":")||"";return e&&(e=", "+e),"$helpers."+d+"("+a+e+")"};e.parser=function(a){a=a.replace(/^\s/,"");var b=a.split(" "),c=b.shift(),e=b.join(" ");switch(c){case"if":a="if("+e+"){";break;case"else":b="if"===b.shift()?" if("+b.join(" ")+")":"",a="}else"+b+"{";break;case"/if":a="}";break;case"each":var f=b[0]||"$data",g=b[1]||"as",h=b[2]||"$value",i=b[3]||"$index",j=h+","+i;"as"!==g&&(f="[]"),a="$each("+f+",function("+j+"){";break;case"/each":a="});";break;case"echo":a="print("+e+");";break;case"print":case"include":a=c+"("+b.join(",")+");";break;default:if(/^\s*\|\s*[\w\$]/.test(e)){var k=!0;0===a.indexOf("#")&&(a=a.substr(1),k=!1);for(var l=0,m=a.split("|"),n=m.length,o=m[l++];n>l;l++)o=z(o,m[l]);a=(k?"=":"=#")+o}else a=d.helpers[c]?"=#"+c+"("+b.join(",")+");":"="+a}return a},"function"==typeof define?define(function(){return d}):"undefined"!=typeof exports?module.exports=d:this.template=d}(); \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-portal/createPublishHtml/template.html b/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-portal/createPublishHtml/template.html deleted file mode 100644 index 52ccfd1..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-portal/createPublishHtml/template.html +++ /dev/null @@ -1,271 +0,0 @@ - - - - - - - - - {@name@} - - - - -
- -
- -
- -

{@name@}

-

{@introduction@}

-
- - {@if hasApp || hasMP || hasH5 || hasQuickApp@} -
-
- {@if hasApp@} - App - {@/if@} - {@if hasMP@} - 小程序 - {@/if@} - {@if hasH5@} - H5 - {@/if@} - {@if hasQuickApp@} - 快应用 - {@/if@} -
-
- {@if hasApp@} -
- -

扫码获取

- 下载安装 - - -

OS平台尚未发布,敬请期待~

- {@if ios_abm_url@} - 获取 ABM 应用 - {@/if@} -
- {@/if@} - {@if hasMP@} -
-
-
- {@each mpKeys@} -
-
-
- {@mpNames[$value]@} -
-
- {@/each@} -
-
- {@each mpKeys@} -
- - -

长按图片识别小程序

-
- {@/each@} -
-
-
- {@/if@} - {@if hasH5@} -
-
- - {@h5.url@} -
-
- {@/if@} - {@if hasQuickApp@} -
- -

快应用

-

扫描二维码或复制名称后可在手机应用市场中搜索快应用

-
- {@/if@} -
-
- {@/if@} - - -
-
- -
-
-
- -
- - -
-

{@name@}

-

{@introduction@}

-
- - {@if hasApp || hasMP || hasH5 || hasQuickApp@} -
-
- {@if hasApp@} - App - {@/if@} - {@if hasMP@} - 小程序 - {@/if@} - {@if hasH5@} - H5 - {@/if@} - {@if hasQuickApp@} - 快应用 - {@/if@} -
-
- {@if hasApp@} -
- -

扫码获取

-
- - {@if android_url@} - - - Android 平台下载 - - {@/if@} - - {@if ios_url@} - - - iOS 平台下载 - - {@/if@} - - {@if ios_abm_url@} -

iOS 平台分发 ABM 应用,请使用 iPhone 扫码获取

- 获取 - ABM 应用 - {@/if@} - - {@if harmony_url@} -

鸿蒙 App 仅支持 HarmonyOS Next 设备扫码下载

- {@/if@} - {@if !android_url@} -

Android平台尚未发布,敬请期待~

- {@/if@} - {@if !harmony_url@} -

HarmonyOS Next 平台尚未发布,敬请期待~

- {@/if@} - {@if !ios_url && !ios_abm_url@} -

iOS平台尚未发布,敬请期待~

- {@/if@} -
-
- {@/if@} - {@if hasMP@} -
- {@each mpKeys@} -
- -
扫二维码识别小程序
-
{@mpNames[$value]@}小程序
-
- {@/each@} -
- {@/if@} - {@if hasH5@} -
-
-
- {@h5.url@} -
-
- {@/if@} - {@if hasQuickApp@} -
- -

快应用

-

扫描二维码或复制名称后可在手机应用市场中搜索快应用

-
- {@/if@} -
-
- {@/if@} -
- - {@if description && description.length@} -
-

应用描述

-
{@description@}
-
- {@/if@} - - {@if screenshot && screenshot.length@} -
-

应用截图

-
-
-
    - {@each screenshot@} -
  • - -
  • - {@/each@} -
-
- {@/if@} -
-

复制成功

-
-
- - - - - diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-portal/index.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-portal/index.js deleted file mode 100644 index cbea5b8..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-portal/index.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict'; - -// 定义一个对象success, 成功时使用 -const success = { - success: true -}; - -// 定义一个对象fail, 失败时使用 -const fail = { - success: false -}; - -// 引入createPublishHtml函数 -const createPublishHtml = require('./createPublishHtml'); - -// 导出一个main函数 -exports.main = async (event, context) => { - //event为客户端上传的参数 - console.log('event : ', event); - - // 初始化res对象 - let res = {}; - - // 获取event对象中data或params的值, 并初始化为params - let params = event.data || event.params; - - // 根据不同的action, 执行不同的操作 - switch (event.action) { - case 'createPublishHtml': // 如果action是createPublishHtml - // 执行createPublishHtml函数并将结果赋值给res - res = createPublishHtml(params.id); - break; - } - - //返回数据给客户端 - return res; -}; diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-portal/package.json b/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-portal/package.json deleted file mode 100644 index ca581c1..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-portal/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "uni-portal", - "dependencies": {}, - "extensions": { - "uni-cloud-jql": {} - }, - "origin-plugin-dev-name": "uni-template-admin", - "origin-plugin-version": "2.5.13", - "plugin-dev-name": "uni-template-admin", - "plugin-version": "2.5.13" -} \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-sms-co/build-template-data.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-sms-co/build-template-data.js deleted file mode 100644 index 179b49a..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-sms-co/build-template-data.js +++ /dev/null @@ -1,38 +0,0 @@ -module.exports = (templateData, user) => { - - const data = {} - - for (const template of templateData) { - - // 检查模板是否包含动态值 - const isDynamic = /\{.*?\}/.test(template.value) - - // 仅支持uni-id-users - if (isDynamic) { - // 从模板中提取出集合和字段名 - const [collection, field] = template.value.replace(/\{|\}/g, '').split('.') - // 如果是uni-id-users,提取相应字段的值 - // 否则使用模板值本身 - data[template.field] = collection === 'uni-id-users' ? user[field] || template.value: template.value - } else { - // 如果没有动态值,则使用模板值本身 - data[template.field] = template.value - } - // 下面是一些注释的代码 - // switch (template.type) { - // case 'static': - // // 对于静态值,直接使用模板值本身 - // data[template.field] = template.value - // break - // case 'dynamic': - // // 对于动态值,使用用户对象中的相应字段 - // data[template.field] = user[template.value] || '' - // break - // default: - // // 抛出不支持的模板类型错误 - // throw new Error(`template type [${template.type}] not supported`) - // } - } - - return data -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-sms-co/index.obj.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-sms-co/index.obj.js deleted file mode 100644 index 6b16a65..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-sms-co/index.obj.js +++ /dev/null @@ -1,488 +0,0 @@ -// 云对象教程: https://uniapp.dcloud.net.cn/uniCloud/cloud-obj -// jsdoc语法提示教程:https://ask.dcloud.net.cn/docs/#//ask.dcloud.net.cn/article/129 - -// 导入 createConfig 模块 -const createConfig = require('uni-config-center'); -// 导入 buildTemplateData 模块 -const buildTemplateData = require('./build-template-data'); -// 导入 utils 模块中的 parserDynamicField 函数 -const { - parserDynamicField -} = require('./utils'); -// 导入 schema-name-adapter 模块 -const schemaNameAdapter = require('./schema-name-adapter'); -// 导入 preset-condition 模块中的 presetCondition 和 conditionConvert 函数 -const { - presetCondition, - conditionConvert -} = require("./preset-condition"); - -// 导入 uni-sms-co 模块 -const uniSmsCo = uniCloud.importObject('uni-sms-co'); -// 导入 uniCloud.database 模块 -const db = uniCloud.database(); -// 使用 createConfig 函数创建 smsConfig 对象 -const smsConfig = createConfig({ - pluginId: 'uni-sms-co' -}).config(); -// 定义 errCode 函数,返回错误码 -function errCode(code) { - return 'uni-sms-co-' + code; -} - -// 定义 tableNames 对象 -const tableNames = { - template: 'opendb-sms-template', // 模板表名为 'opendb-sms-template' - task: 'opendb-sms-task', // 任务表名为 'opendb-sms-task' - log: 'opendb-sms-log' // 日志表名为 'opendb-sms-log' -}; - - -module.exports = { - _before: async function() { // 通用预处理器 - this.tableNames = tableNames - - /** - * 优化 schema 的命名规范,需要兼容 uni-admin@2.1.6 以下版本 - * 如果是在uni-admin@2.1.6版本以上创建的项目可以将其注释 - * */ - await schemaNameAdapter.call(this) - }, - _after: function(error, result) { - if (error) { - console.error(error); - if (error instanceof Error) { - // 如果错误是 Error 实例,则返回包含错误信息的对象 - return { - errCode: 'error', - errMsg: error.message - }; - } - if (error.errCode) { - // 如果错误对象中包含 errCode 属性,则直接返回错误对象 - return error; - } - // 抛出其他类型的错误 - throw error; - } - // 返回结果 - return result; - }, - - /** - * 创建短信任务 - * @param {{receiver: *[], type: string}} to - * @param {String} to.type=user to.all=true时用来区分发送类型 - * @param {Array} to.receiver 用户ID's / 用户标签ID's - * @param {Object} to.condition 用户筛选条件 - * @param {String} templateId 短信模板ID - * @param {Array} templateData 短信模板数据 - * @param {Object} options - * @param {String} options.taskName 任务名称 - */ - async createSmsTask(to, templateId, templateData, options = {}) { - if (!templateId) { - // 如果缺少 templateId,则返回错误信息 - return { - errCode: errCode('template-id-required'), - errMsg: '缺少templateId' - }; - } - - if (!to.condition && (!to.receiver || to.receiver.length <= 0)) { - // 如果没有预设条件且没有接收者,则返回错误信息 - return { - errCode: errCode('send-users-is-null'), - errMsg: '请选择要发送的用户' - }; - } - - const clientInfo = this.getClientInfo(); - - // 查询短信模板 - const { - data: templates - } = await db.collection(this.tableNames.template).where({ - _id: templateId - }).get(); - if (templates.length <= 0) { - // 如果短信模板不存在,则返回错误信息 - return { - errCode: errCode('template-not-found'), - errMsg: '短信模板不存在' - }; - } - const [template] = templates; - - // 预设条件 - if (presetCondition[to.condition]) { - to.condition = typeof presetCondition[to.condition] === "function" ? presetCondition[to.condition] - () : presetCondition[to.condition]; - } - - // 创建短信任务 - const task = await db.collection(this.tableNames.task).add({ - app_id: clientInfo.appId, - name: options.taskName, - template_id: templateId, - template_content: template.content, - vars: templateData, - to, - send_qty: 0, - success_qty: 0, - fail_qty: 0, - create_date: Date.now() - }); - - uniSmsCo.createUserSmsMessage(task.id); - - // 返回任务创建成功的异步结果 - return new Promise(resolve => setTimeout(() => resolve({ - errCode: 0, - errMsg: '任务创建成功', - taskId: task.id - }), 300)); - }, - - async createUserSmsMessage(taskId, execData = {}) { - const parallel = 100 - let beforeId - const { - data: tasks - } = await db.collection(this.tableNames.task).where({ - _id: taskId - }).get() - - if (tasks.length <= 0) { - return { - errCode: errCode('task-id-not-found'), - errMsg: '任务ID不存在' - } - } - - const [task] = tasks - let query = { - mobile: db.command.exists(true) - } - - // 指定用户发送 - if (task.to.type === 'user' && task.to.receiver.length > 0 && !task.to.condition) { - let index = 0 - if (execData.beforeId) { - const i = task.to.receiver.findIndex(id => id === execData.beforeId) - index = i !== -1 ? i + 1 : 0 - } - - const receiver = task.to.receiver.slice(index, index + parallel) - query._id = db.command.in(receiver) - beforeId = receiver[receiver.length - 1] - } - - // 指定用户标签 - if (task.to.type === 'userTags') { - query.tags = db.command.in(task.to.receiver) - } - - // 自定义条件 - if (task.to.condition) { - const condition = conditionConvert(task.to.condition, db.command) - - query = { - ...query, - ...condition - } - } - - if ((task.to.condition || task.to.type === "userTags") && execData.beforeId) { - query._id = db.command.gt(execData.beforeId) - } - - // 动态数据仅支持uni-id-users表字段 - const dynamicField = parserDynamicField(task.vars) - const userFields = dynamicField['uni-id-users'] ? dynamicField['uni-id-users'].reduce((res, field) => { - res[field] = true - return res - }, {}) : {} - - const { - data: users - } = await db.collection('uni-id-users') - .where(query) - .field({ - mobile: true, - ...userFields - }) - .limit(parallel) - .orderBy('_id', 'asc') - .get() - - if (users.length <= 0) { - // 更新要发送的短信数量 - const count = await db.collection(this.tableNames.log).where({ - task_id: taskId - }).count() - await db.collection(this.tableNames.task).where({ - _id: taskId - }).update({ - send_qty: count.total - }) - - // 开始发送 - uniSmsCo.sendSms(taskId) - - return new Promise(resolve => setTimeout(() => resolve({ - errCode: 0, - errMsg: '创建完成' - }), 500)) - } - - if (!beforeId) { - beforeId = users[users.length - 1]._id - } - - let docs = [] - for (const user of users) { - const varData = await buildTemplateData(task.vars, user) - docs.push({ - uid: user._id, - task_id: taskId, - mobile: user.mobile, - var_data: varData, - status: 0, - create_date: Date.now() - }) - } - - await db.collection(this.tableNames.log).add(docs) - - uniSmsCo.createUserSmsMessage(taskId, { - beforeId - }) - - return new Promise(resolve => setTimeout(() => resolve(), 500)) - }, - async sendSms(taskId) { - const { - data: tasks - } = await db.collection(this.tableNames.task).where({ - _id: taskId - }).get(); - if (tasks.length <= 0) { - // 如果找不到任务,则输出警告信息并返回 - console.warn(`task [${taskId}] not found`); - return; - } - - const [task] = tasks; - const isStaticTemplate = !task.vars.length; - - let sendData = { - appid: task.app_id, - templateId: task.template_id, - data: {} - }; - - const { - data: records - } = await db.collection(this.tableNames.log) - .where({ - task_id: taskId, - status: 0 - }) - .limit(isStaticTemplate ? 50 : 1) - .field({ - mobile: true, - var_data: true - }) - .get(); - - if (records.length <= 0) { - // 如果没有要发送的记录,则返回发送完成的异步结果 - return { - errCode: 0, - errMsg: '发送完成' - }; - } - - if (isStaticTemplate) { - sendData.phoneList = records.reduce((res, user) => { - res.push(user.mobile); - return res; - }, []); - } else { - const [record] = records; - sendData.phone = record.mobile; - sendData.data = record.var_data; - } - - try { - // 发送短信 - await uniCloud.sendSms(sendData); - // 修改发送状态为已发送 - await db.collection(this.tableNames.log).where({ - _id: db.command.in(records.map(record => record._id)) - }).update({ - status: 1, - send_date: Date.now() - }); - // 更新任务的短信成功数 - await db.collection(this.tableNames.task).where({ - _id: taskId - }) - .update({ - success_qty: db.command.inc(records.length) - }); - } catch (e) { - console.error('[sendSms Fail]', e); - // 修改发送状态为发送失败 - await db.collection(this.tableNames.log).where({ - _id: db.command.in(records.map(record => record._id)) - }).update({ - status: 2, - reason: e.errMsg || '未知原因', - send_date: Date.now() - }); - // 更新任务的短信失败数 - await db.collection(this.tableNames.task).where({ - _id: taskId - }) - .update({ - fail_qty: db.command.inc(records.length) - }); - } - - uniSmsCo.sendSms(taskId); - - return new Promise(resolve => setTimeout(() => resolve(), 500)); - }, - async template() { - const { - data: templates = [] - } = await db.collection(this.tableNames.template).get(); - // 获取所有短信模板 - return templates; - }, - - async task(id) { - const { - data: tasks - } = await db.collection(this.tableNames.task).where({ - _id: id - }).get(); - if (tasks.length <= 0) { - // 如果找不到任务,则返回 null - return null; - } - - // 返回第一个找到的任务 - return tasks[0]; - }, - - async updateTemplates(templates) { - if (templates.length <= 0) { - // 如果模板信息为空,则返回错误 - return { - errCode: errCode('template-is-null'), - errMsg: '缺少模板信息' - }; - } - - let group = []; - for (const template of templates) { - group.push( - db.collection(this.tableNames.template).doc(String(template.templateId)).set({ - name: template.templateName, - content: template.templateContent, - type: template.templateType, - sign: template.templateSign - }) - ); - } - - await Promise.all(group); - - return { - errCode: 0, - errMsg: '更新成功' - }; - }, - /** - * @param to - * @param templateId - * @param templateData - * @param options {Object} - * @param options.condition 群发条件 - * */ - async preview(to, templateId, templateData, options = {}) { - const count = 1 - let query = { - mobile: db.command.exists(true) - } - - // 指定用户发送 - if (to.type === 'user' && to.receiver.length > 0 && !to.condition) { - // const receiver = to.receiver.slice(0, 10) - query._id = db.command.in(to.receiver) - } - - // 指定用户标签 - if (to.type === 'userTags') { - query.tags = db.command.in(to.receiver) - } - - // 自定义条件 - let condition = to.condition - if (presetCondition[to.condition]) { - condition = typeof presetCondition[to.condition] === "function" ? presetCondition[to.condition]() : - presetCondition[to.condition] - } - - if (condition) { - query = { - ...query, - ...conditionConvert(condition, db.command) - } - } - - const { - data: users - } = await db.collection('uni-id-users').where(query).limit(count).get() - const { - total - } = await db.collection('uni-id-users').where(query).count() - - if (users.length <= 0) { - return { - errCode: errCode('users-is-null'), - errMsg: '请添加要发送的用户' - } - } - - const { - data: templates - } = await db.collection(this.tableNames.template).where({ - _id: templateId - }).get() - if (templates.length <= 0) { - return { - errCode: errCode('template-not-found'), - errMsg: '模板不存在' - } - } - const [template] = templates - - let docs = [] - for (const user of users) { - const varData = buildTemplateData(templateData, user) - const content = template.content.replace(/\$\{(.*?)\}/g, ($1, param) => varData[param] || $1) - docs.push(`【${template.sign}】${content}`) - } - - return { - errCode: 0, - errMsg: '', - list: docs, - total - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-sms-co/package.json b/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-sms-co/package.json deleted file mode 100644 index e35f885..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-sms-co/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "uni-sms-co", - "dependencies": { - "uni-config-center": "file:..\/..\/..\/uni_modules\/uni-config-center\/uniCloud\/cloudfunctions\/common\/uni-config-center" - }, - "extensions": { - "uni-cloud-sms": {}, - "uni-cloud-jql": {} - }, - "origin-plugin-dev-name": "uni-template-admin", - "origin-plugin-version": "2.5.13", - "plugin-dev-name": "uni-template-admin", - "plugin-version": "2.5.13" -} \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-sms-co/preset-condition.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-sms-co/preset-condition.js deleted file mode 100644 index b39a543..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-sms-co/preset-condition.js +++ /dev/null @@ -1,91 +0,0 @@ -const presetCondition = { - // 预设条件:全部 - all: {}, - // 预设条件:7天未登录用户 - '7-day-offline-users': () => ({ - last_login_date: { - type: 'lt', - value: Date.now() - (7 * 24 * 60 * 60 * 1000) - } - }), - // 预设条件:15天未登录用户 - '15-day-offline-users': () => ({ - last_login_date: { - type: 'lt', - value: Date.now() - (15 * 24 * 60 * 60 * 1000) - } - }), - // 预设条件:30天未登录用户 - '30-day-offline-users': () => ({ - last_login_date: { - type: 'lt', - value: Date.now() - (30 * 24 * 60 * 60 * 1000) - } - }) -}; - -function conditionConvert(condition, command) { - const newCondition = {}; - - for (const key in condition) { - const field = condition[key]; - - switch (field.type) { - case 'search': - // 搜索条件 - newCondition[key] = new RegExp(field.value); - break; - case 'select': - // 选择条件 - if (field.value.length) { - newCondition[key] = command.or( - field.value.map(value => command.eq(value)) - ); - } - break; - case 'range': - // 范围条件 - if (field.value.length) { - const [gt, lt] = field.value; - newCondition[key] = command.and([ - command.gte(gt), - command.lte(lt) - ]); - } - break; - case 'date': - // 日期条件 - if (field.value.length) { - const [startTimestamp, endTimestamp] = field.value; - const startDate = new Date(startTimestamp); - const endDate = new Date(endTimestamp); - - newCondition[key] = command.and([ - command.gte(startDate), - command.lte(endDate) - ]); - } - break; - case 'timestamp': - // 时间戳条件 - if (field.value.length) { - const [startDate, endDate] = field.value; - - newCondition[key] = command.and([ - command.gte(startDate), - command.lte(endDate) - ]); - } - break; - case 'lt': - // 小于条件 - newCondition[key] = command.lt(field.value); - break; - } - } - - return newCondition; -} - -module.exports.presetCondition = presetCondition; -module.exports.conditionConvert = conditionConvert; diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-sms-co/schema-name-adapter.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-sms-co/schema-name-adapter.js deleted file mode 100644 index f198c2f..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-sms-co/schema-name-adapter.js +++ /dev/null @@ -1,18 +0,0 @@ -// 引入uniCloud的数据库操作 -const db = uniCloud.database() - -module.exports = async function () { - try { - // 查询批量短信模板的文档数 - const count = await db.collection('batch-sms-template').count() - - // 如果文档数大于0,则设置表名 - if (count.total > 0) { - this.tableNames = { - template: 'batch-sms-template', // 模板表名 - task: 'batch-sms-task', // 任务表名 - log: 'batch-sms-result' // 日志表名 - } - } - } catch (e) {} -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-sms-co/utils.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-sms-co/utils.js deleted file mode 100644 index edf34b8..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-sms-co/utils.js +++ /dev/null @@ -1,42 +0,0 @@ -exports.chunk = function (arr, num) { - const list = [] - let current = [] - - for (const item of arr) { - current.push(item); - if (current.length === num) { - list.push(current) - current = [] - } - } - - if (current.length) list.push(current) - - return list -} - -exports.checkIsStaticTemplate = function (data = []) { - let isStatic = data.length <= 0 - - for (const template of data) { - if (template.type === 'static') { - isStatic = true - break - } - } - - return isStatic -} - -exports.parserDynamicField = function (templateData) { - return templateData.reduce((res, template) => { - if (/\{.*?\}/.test(template.value)) { - const [collection, field] = template.value.replace(/\{|\}/g, '').split('.') - if (!res[collection]) { - res[collection] = [] - } - res[collection].push(field) - } - return res - }, {}) -} \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-stat-cron/index.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-stat-cron/index.js deleted file mode 100644 index 685c330..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-stat-cron/index.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; -const uniStat = require('uni-stat') -exports.main = async (event, context) => { - //数据跑批处理函数 - return await uniStat.initStat().cron(context) -}; diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-stat-cron/package.json b/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-stat-cron/package.json deleted file mode 100644 index ffccacf..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-stat-cron/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "uni-stat-cron", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC", - "dependencies": { - "uni-stat": "file:..\/common\/uni-stat" - }, - "cloudfunction-config": { - "concurrency": 1, - "memorySize": 512, - "timeout": 600, - "triggers": [ - { - "name": "uni-stat-cron", - "type": "timer", - "config": "19 19 * * * * *" - } - ] - }, - "extensions": {}, - "origin-plugin-dev-name": "uni-template-admin", - "origin-plugin-version": "2.5.13", - "plugin-dev-name": "uni-template-admin", - "plugin-version": "2.5.13" -} \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-stat-receiver/index.obj.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-stat-receiver/index.obj.js deleted file mode 100644 index dac8354..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-stat-receiver/index.obj.js +++ /dev/null @@ -1,29 +0,0 @@ -const uniStat = require('uni-stat') -const uniID = require('uni-id-common') -module.exports = { - report: async function (params = {}) { - //客户端信息 - const clientInfo = this.getClientInfo() - //云服务信息 - const cloudInfo = this.getCloudInfo() - //token信息 - const token = this.getUniIdToken() - //当前登录用户id - let uid - if(token) { - const tokenRes = await uniID.createInstance({ - clientInfo - }).checkToken(token) - - if(tokenRes.uid) { - uid = tokenRes.uid - } - } - //数据上报 - return await uniStat.initReceiver().report(params, { - ...clientInfo, - ...cloudInfo, - uid - }) - } -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-stat-receiver/package.json b/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-stat-receiver/package.json deleted file mode 100644 index 4b82fd5..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-stat-receiver/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "uni-stat-receiver", - "dependencies": { - "uni-stat": "file:..\/common\/uni-stat", - "uni-id-common": "file:..\/..\/..\/uni_modules\/uni-id-common\/uniCloud\/cloudfunctions\/common\/uni-id-common" - }, - "cloudfunction-config": { - "concurrency": 1, - "memorySize": 128, - "timeout": 60, - "triggers": [] - }, - "extensions": { - "uni-cloud-jql": {} - }, - "origin-plugin-dev-name": "uni-template-admin", - "origin-plugin-version": "2.5.13", - "plugin-dev-name": "uni-template-admin", - "plugin-version": "2.5.13" -} \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-upgrade-center/checkVersion/index.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-upgrade-center/checkVersion/index.js deleted file mode 100644 index cbbc010..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-upgrade-center/checkVersion/index.js +++ /dev/null @@ -1,192 +0,0 @@ -'use strict'; -module.exports = async (event, context) => { - /** - * 检测升级 使用说明 - * 上传包: - * 1. 根据传参,先检测传参是否完整,appid appVersion wgtVersion 必传 - * 2. 先从数据库取出所有该平台(从上下文读取平台信息,默认 Andriod)的所有线上发行更新 - * 3. 再从所有线上发行更新中取出版本最大的一版。如果可以,尽量先检测wgt的线上发行版更新 - * 4. 使用上步取出的版本包的版本号 和传参 appVersion、wgtVersion 来检测是否有更新,必须同时大于这两项,否则返回暂无更新 - * 5. 如果库中 wgt包 版本大于传参 appVersion,但是不满足 min_uni_version < appVersion,则不会使用wgt更新,会接着判断库中 app包version 是否大于 appVersion - * 6. is_uniapp_x 为了区分 App 类型,uni-app x 项目安卓端没有 wgt 升级 - */ - - let { - appid, - appVersion, - wgtVersion, - is_uniapp_x = false - } = event; - - const platform_Android = 'Android'; - const platform_iOS = 'iOS'; - const platform_Harmony = 'Harmony'; - const package_app = 'native_app'; - const package_wgt = 'wgt'; - const app_version_db_name = 'opendb-app-versions' - - let platform = platform_Android; - - // 云函数URL化请求 - if (event.headers) { - let body; - try { - if (event.httpMethod.toLocaleLowerCase() === 'get') { - body = event.queryStringParameters; - } else { - body = JSON.parse(event.body); - } - } catch (e) { - return { - code: 500, - msg: '请求错误' - }; - } - - appid = body.appid; - appVersion = body.appVersion; - wgtVersion = body.wgtVersion; - - if (/iPhone|iPad/.test(event.headers)) { - platform = platform_iOS - } else if (/Android|android/.test(event.headers)) { - platform = platform_Android - } else { - platform = platform_Harmony - } - } else if (context.OS) { - platform = context.OS === 'android' ? - platform_Android : - context.OS === 'ios' ? - platform_iOS : - context.OS === 'harmonyos' ? - platform_Harmony : - platform_Android; - } - - if (appid && appVersion && wgtVersion && platform) { - const collection = uniCloud.database().collection(app_version_db_name); - - const record = await collection.where({ - appid, - platform, - stable_publish: true - }) - .orderBy('create_date', 'desc') - .get(); - - if (record && record.data && record.data.length > 0) { - const appVersionInDb = record.data.find(item => item.type === package_app) || {}; - const wgtVersionInDb = record.data.find(item => item.type === package_wgt) || {}; - const hasAppPackage = !!Object.keys(appVersionInDb).length; - const hasWgtPackage = !!Object.keys(wgtVersionInDb).length; - - // 取两个版本中版本号最大的包,版本一样,使用wgt包 - let stablePublishDb = (() => { - // uni-app x 项目安卓端没有 wgt 升级 - if (is_uniapp_x === true && platform === platform_Android) { - if (hasAppPackage) return appVersionInDb - return {} - } - if (hasAppPackage && hasWgtPackage) { - if (compare(wgtVersionInDb.version, appVersionInDb.version) >= 0) - return wgtVersionInDb - else { - return appVersionInDb - } - } else if (hasAppPackage) { - return appVersionInDb - } else if (hasWgtPackage) { - return wgtVersionInDb - } - return {} - })(); - - if (Object.keys(stablePublishDb).length) { - const { - version, - min_uni_version - } = stablePublishDb; - - // 库中的version必须满足同时大于appVersion和wgtVersion才行,因为上次更新可能是wgt更新 - const appUpdate = compare(version, appVersion) === 1; // app包可用更新 - const wgtUpdate = compare(version, wgtVersion) === 1; // wgt包可用更新 - - if (appUpdate && wgtUpdate) { - // 判断是否可用wgt更新 - if (min_uni_version && compare(min_uni_version, appVersion) < 1) { - return { - code: 101, - message: 'wgt更新', - ...stablePublishDb - }; - } else if (hasAppPackage && compare(appVersionInDb.version, appVersion) === 1) { - return { - code: 102, - message: '整包更新', - ...appVersionInDb - }; - } - } - } - - return { - code: 0, - message: '当前版本已经是最新的,不需要更新' - }; - } - - return { - code: -101, - message: '暂无更新或检查appid是否填写正确' - }; - } - - return { - code: -102, - message: '请检查传参是否填写正确' - }; -}; - -/** - * 对比版本号,如需要,请自行修改判断规则 - * 支持比对 ("3.0.0.0.0.1.0.1", "3.0.0.0.0.1") ("3.0.0.1", "3.0") ("3.1.1", "3.1.1.1") 之类的 - * @param {Object} v1 - * @param {Object} v2 - * v1 > v2 return 1 - * v1 < v2 return -1 - * v1 == v2 return 0 - */ -function compare(v1 = '0', v2 = '0') { - v1 = String(v1).split('.') - v2 = String(v2).split('.') - const minVersionLens = Math.min(v1.length, v2.length); - - let result = 0; - for (let i = 0; i < minVersionLens; i++) { - const curV1 = Number(v1[i]) - const curV2 = Number(v2[i]) - - if (curV1 > curV2) { - result = 1 - break; - } else if (curV1 < curV2) { - result = -1 - break; - } - } - - if (result === 0 && (v1.length !== v2.length)) { - const v1BiggerThenv2 = v1.length > v2.length; - const maxLensVersion = v1BiggerThenv2 ? v1 : v2; - for (let i = minVersionLens; i < maxLensVersion.length; i++) { - const curVersion = Number(maxLensVersion[i]) - if (curVersion > 0) { - v1BiggerThenv2 ? result = 1 : result = -1 - break; - } - } - } - - return result; -} diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-upgrade-center/index.js b/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-upgrade-center/index.js deleted file mode 100644 index cfbd836..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-upgrade-center/index.js +++ /dev/null @@ -1,110 +0,0 @@ -'use strict'; -const uniID = require('uni-id-common') -const success = { success: true } -const fail = { success: false } -const checkVersion = require('./checkVersion') - -async function checkPermission(uniIDIns, uniIdToken, permission) { - const checkTokenRes = await uniIDIns.checkToken(uniIdToken) - if (checkTokenRes.errCode === 0) { - if (checkTokenRes.permission.indexOf(permission) > -1 || checkTokenRes.role.indexOf('admin') > -1) { - return true - } else { - return Object.assign({ errMsg: '权限不足' }, fail) - } - } else { - return Object.assign({}, checkTokenRes, { errMsg: checkTokenRes.message }, fail) - } -} - -exports.main = async (event, context) => { - //event为客户端上传的参数 - - const db = uniCloud.database() - const appListDBName = 'opendb-app-list' - const appVersionDBName = 'opendb-app-versions' - const uniIDIns = uniID.createInstance({ context: context }) - let res = {}; - - if (event.headers) { - try { - if (event.httpMethod.toLocaleLowerCase() === 'get') { - event = event.queryStringParameters; - } else { - event = JSON.parse(event.body); - } - } catch (e) { - return { - code: 500, - msg: '请求错误' - }; - } - } - - let params = event.data || event.params; - switch (event.action) { - case 'checkVersion': - res = await checkVersion(event, context) - break; - case 'deleteFile': - let checkDeletePermission = await checkPermission(uniIDIns, event.uniIdToken, 'DELETE_OPENDB_APP_VERSIONS') - if (checkDeletePermission === true) { - res = await uniCloud.deleteFile({ fileList: params.fileList }) - } else { - return checkDeletePermission - } - break; - case 'setNewAppData': - let checkUpdatePermission = await checkPermission(uniIDIns, event.uniIdToken, 'UPDATE_OPENDB_APP_LIST') - if (checkUpdatePermission === true) { - params.value.create_date = Date.now() - res = await db.collection(appListDBName).doc(params.id).set(params.value) - } else { - return checkUpdatePermission - } - break; - case 'getAppInfo': - let dbAppList - try { - dbAppList = db.collection(appListDBName) - } catch (e) {} - - if (!dbAppList) return fail; - - const dbAppListRecord = await dbAppList.where({ - appid: params.appid - }).get() - - if (dbAppListRecord && dbAppListRecord.data.length) - return Object.assign({}, success, dbAppListRecord.data[0]) - - //返回数据给客户端 - return fail - break; - case 'getAppVersionInfo': - let dbVersionList - try { - dbVersionList = db.collection(appVersionDBName) - } catch (e) {} - - if (!dbVersionList) return fail; - - const dbVersionListrecord = await dbVersionList.where({ - appid: params.appid, - platform: params.platform, - type: "native_app", - stable_publish: true - }) - .orderBy('create_date', 'desc') - .get(); - - if (dbVersionListrecord && dbVersionListrecord.data && dbVersionListrecord.data.length > 0) - return Object.assign({}, dbVersionListrecord.data[0], success) - - return fail - break; - } - - //返回数据给客户端 - return res -}; diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-upgrade-center/package.json b/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-upgrade-center/package.json deleted file mode 100644 index e8f34a9..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-upgrade-center/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "uni-app-manager", - "dependencies": { - "uni-id-common": "file:..\/..\/..\/uni_modules\/uni-id-common\/uniCloud\/cloudfunctions\/common\/uni-id-common" - }, - "extensions": { - "uni-cloud-jql": {} - }, - "origin-plugin-dev-name": "uni-template-admin", - "origin-plugin-version": "2.5.13", - "plugin-dev-name": "uni-template-admin", - "plugin-version": "2.5.13" -} \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-upgrade-center/uni-upgrade-center.param.json b/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-upgrade-center/uni-upgrade-center.param.json deleted file mode 100644 index 7cdff72..0000000 --- a/sport-erp-admin/uniCloud-alipay/cloudfunctions/uni-upgrade-center/uni-upgrade-center.param.json +++ /dev/null @@ -1,10 +0,0 @@ -// 本文件中的json内容将在云函数【运行】时作为参数传给云函数。 - -// 配置教程参考:https://uniapp.dcloud.net.cn/uniCloud/quickstart?id=runparam - -{ - "action": "checkVersion", - "appid": "__UNI__3584C99", - "appVersion": "1.0.0", - "wgtVersion": "1.0.0" -} diff --git a/sport-erp-admin/uniCloud-alipay/database/JQL查询.jql b/sport-erp-admin/uniCloud-alipay/database/JQL查询.jql deleted file mode 100644 index 35d21de..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/JQL查询.jql +++ /dev/null @@ -1,12 +0,0 @@ -// 本文件用于,使用JQL语法操作项目关联的uniCloud空间的数据库,方便开发调试和远程数据库管理 -// 编写clientDB的js API(也支持常规js语法,比如var),可以对云数据库进行增删改查操作。不支持uniCloud-db组件写法 -// 可以全部运行,也可以选中部分代码运行。点击工具栏上的运行按钮或者按下【F5】键运行代码 -// 如果文档中存在多条JQL语句,只有最后一条语句生效 -// 如果混写了普通js,最后一条语句需是数据库操作语句 -// 此处代码运行不受DB Schema的权限控制,移植代码到实际业务中注意在schema中配好permission -// 不支持clientDB的action -// 数据库查询有最大返回条数限制,详见:https://uniapp.dcloud.net.cn/uniCloud/cf-database.html#limit -// 详细JQL语法,请参考:https://uniapp.dcloud.net.cn/uniCloud/jql.html - -// 下面示例查询uni-id-users表的所有数据 -db.collection('uni-id-users').get(); diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-admin-menus.index.json b/sport-erp-admin/uniCloud-alipay/database/opendb-admin-menus.index.json deleted file mode 100644 index 0495ecd..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-admin-menus.index.json +++ /dev/null @@ -1,39 +0,0 @@ -[ - { - "IndexName": "menu_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "menu_id", - "Direction": "1" - } - ], - "MgoIsUnique": true - } - }, - { - "IndexName": "parent_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "parent_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "permission", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "permission", - "Direction": "1", - "Type": "array" - } - ], - "MgoIsUnique": false - } - } -] diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-admin-menus.init_data.json b/sport-erp-admin/uniCloud-alipay/database/opendb-admin-menus.init_data.json deleted file mode 100644 index 3b00964..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-admin-menus.init_data.json +++ /dev/null @@ -1,530 +0,0 @@ -[ - { - "menu_id": "index", - "name": "首页", - "icon": "uni-icons-home", - "url": "/", - "sort": 100, - "parent_id": "", - "permission": [], - "enable": true, - "create_date": 1602662469396, - "_id": "index" - }, - { - "menu_id": "system_management", - "name": "系统管理", - "icon": "admin-icons-fl-xitong", - "url": "", - "sort": 1000, - "parent_id": "", - "permission": [], - "enable": true, - "create_date": 1602662469396, - "_id": "system_management" - }, - { - "menu_id": "system_user", - "name": "用户管理", - "icon": "admin-icons-manager-user", - "url": "/pages/system/user/list", - "sort": 1010, - "parent_id": "system_management", - "permission": [], - "enable": true, - "create_date": 1602662469398, - "_id": "system_user" - }, - { - "menu_id": "system_role", - "name": "角色管理", - "icon": "admin-icons-manager-role", - "url": "/pages/system/role/list", - "sort": 1020, - "parent_id": "system_management", - "permission": [], - "enable": true, - "create_date": 1602662469397, - "_id": "system_role" - }, - { - "menu_id": "system_permission", - "name": "权限管理", - "icon": "admin-icons-manager-permission", - "url": "/pages/system/permission/list", - "sort": 1030, - "parent_id": "system_management", - "permission": [], - "enable": true, - "create_date": 1602662469396, - "_id": "system_permission" - }, - { - "menu_id": "system_menu", - "name": "菜单管理", - "icon": "admin-icons-manager-menu", - "url": "/pages/system/menu/list", - "sort": 1040, - "parent_id": "system_management", - "permission": [], - "enable": true, - "create_date": 1602662469396, - "_id": "system_menu" - }, - { - "menu_id": "system_app", - "name": "应用管理", - "icon": "admin-icons-manager-app", - "url": "/pages/system/app/list", - "sort": 1035, - "parent_id": "system_management", - "permission": [], - "enable": true, - "create_date": 1602662469399, - "_id": "system_app" - }, - { - "menu_id": "system_update", - "name": "App升级中心", - "icon": "uni-icons-cloud-upload", - "url": "/uni_modules/uni-upgrade-center/pages/version/list", - "sort": 1036, - "parent_id": "system_management", - "permission": [], - "enable": true, - "create_date": 1656491532434, - "_id": "system_update" - }, - { - "menu_id": "system_tag", - "name": "标签管理", - "icon": "admin-icons-manager-tag", - "url": "/pages/system/tag/list", - "sort": 1037, - "parent_id": "system_management", - "permission": [], - "enable": true, - "create_date": 1602662479389, - "_id": "system_tag" - }, - { - "permission": [], - "enable": true, - "menu_id": "safety_statistics", - "name": "安全审计", - "icon": "admin-icons-safety", - "url": "", - "sort": 3100, - "parent_id": "", - "create_date": 1638356430871, - "_id": "safety_statistics" - }, - { - "permission": [], - "enable": true, - "menu_id": "safety_statistics_user_log", - "name": "用户日志", - "icon": "", - "url": "/pages/system/safety/list", - "sort": 3101, - "parent_id": "safety_statistics", - "create_date": 1638356430871, - "_id": "safety_statistics_user_log" - }, - { - "permission": [], - "enable": true, - "menu_id": "uni-stat", - "name": "uni 统计", - "icon": "admin-icons-tongji", - "url": "", - "sort": 2100, - "parent_id": "", - "create_date": 1638356430871, - "_id": "uni-stat" - }, - { - "parent_id": "uni-stat", - "permission": [], - "enable": true, - "menu_id": "uni-stat-device", - "name": "设备统计", - "icon": "admin-icons-shebeitongji", - "url": "", - "sort": 2120, - "create_date": 1638356902516, - "_id": "uni-stat-device" - }, - { - "parent_id": "uni-stat-device", - "permission": [], - "enable": true, - "menu_id": "uni-stat-device-overview", - "name": "概况", - "icon": "", - "url": "/pages/uni-stat/device/overview/overview", - "sort": 2121, - "create_date": 1638356902516, - "_id": "uni-stat-device-overview" - }, - { - "parent_id": "uni-stat-device", - "permission": [], - "enable": true, - "menu_id": "uni-stat-device-activity", - "name": "活跃度", - "icon": "", - "url": "/pages/uni-stat/device/activity/activity", - "sort": 2122, - "create_date": 1638356902516, - "_id": "uni-stat-device-activity" - }, - { - "parent_id": "uni-stat-device", - "permission": [], - "enable": true, - "menu_id": "uni-stat-device-trend", - "name": "趋势分析", - "icon": "", - "url": "/pages/uni-stat/device/trend/trend", - "sort": 2123, - "create_date": 1638356902516, - "_id": "uni-stat-device-trend" - }, - { - "parent_id": "uni-stat-device", - "permission": [], - "enable": true, - "menu_id": "uni-stat-device-retention", - "name": "留存", - "icon": "", - "url": "/pages/uni-stat/device/retention/retention", - "sort": 2124, - "create_date": 1638356902516, - "_id": "uni-stat-device-retention" - }, - { - "parent_id": "uni-stat-device", - "permission": [], - "enable": true, - "menu_id": "uni-stat-device-comparison", - "name": "平台对比", - "icon": "", - "url": "/pages/uni-stat/device/comparison/comparison", - "sort": 2125, - "create_date": 1638356902516, - "_id": "uni-stat-device-comparison" - }, - { - "parent_id": "uni-stat-device", - "permission": [], - "enable": true, - "menu_id": "uni-stat-device-stickiness", - "name": "粘性", - "icon": "", - "url": "/pages/uni-stat/device/stickiness/stickiness", - "sort": 2126, - "create_date": 1638356902516, - "_id": "uni-stat-device-stickiness" - }, - { - "parent_id": "uni-stat", - "permission": [], - "enable": true, - "menu_id": "uni-stat-user", - "name": "注册用户统计", - "icon": "admin-icons-yonghutongji", - "url": "", - "sort": 2122, - "create_date": 1638356902516, - "_id": "uni-stat-user" - }, - { - "parent_id": "uni-stat-user", - "permission": [], - "enable": true, - "menu_id": "uni-stat-user-overview", - "name": "概况", - "icon": "", - "url": "/pages/uni-stat/user/overview/overview", - "sort": 2121, - "create_date": 1638356902516, - "_id": "uni-stat-user-overview" - }, - { - "parent_id": "uni-stat-user", - "permission": [], - "enable": true, - "menu_id": "uni-stat-user-activity", - "name": "活跃度", - "icon": "", - "url": "/pages/uni-stat/user/activity/activity", - "sort": 2122, - "create_date": 1638356902516, - "_id": "uni-stat-user-activity" - }, - { - "parent_id": "uni-stat-user", - "permission": [], - "enable": true, - "icon": "", - "menu_id": "uni-stat-user-trend", - "name": "趋势分析", - "url": "/pages/uni-stat/user/trend/trend", - "sort": 2123, - "create_date": 1638356902516, - "_id": "uni-stat-user-trend" - }, - { - "parent_id": "uni-stat-user", - "permission": [], - "enable": true, - "menu_id": "uni-stat-user-retention", - "name": "留存", - "icon": "", - "url": "/pages/uni-stat/user/retention/retention", - "sort": 2124, - "create_date": 1638356902516, - "_id": "uni-stat-user-retention" - }, - { - "parent_id": "uni-stat-user", - "permission": [], - "enable": true, - "menu_id": "uni-stat-user-comparison", - "name": "平台对比", - "icon": "", - "url": "/pages/uni-stat/user/comparison/comparison", - "sort": 2125, - "create_date": 1638356902516, - "_id": "uni-stat-user-comparison" - }, - { - "parent_id": "uni-stat-user", - "permission": [], - "enable": true, - "menu_id": "uni-stat-user-stickiness", - "name": "粘性", - "icon": "", - "url": "/pages/uni-stat/user/stickiness/stickiness", - "sort": 2126, - "create_date": 1638356902516, - "_id": "uni-stat-user-stickiness" - }, - { - "parent_id": "uni-stat", - "permission": [], - "enable": true, - "menu_id": "uni-stat-page-analysis", - "name": "页面统计", - "icon": "admin-icons-page-ent", - "url": "", - "sort": 2123, - "create_date": 1638356902516, - "_id": "uni-stat-page-analysis" - }, - { - "parent_id": "uni-stat-page-analysis", - "permission": [], - "enable": true, - "menu_id": "uni-stat-page-res", - "name": "受访页", - "icon": "", - "url": "/pages/uni-stat/page-res/page-res", - "sort": 2131, - "create_date": 1638356902516, - "_id": "uni-stat-page-res" - }, - { - "parent_id": "uni-stat-page-analysis", - "permission": [], - "enable": true, - "menu_id": "uni-stat-page-ent", - "name": "入口页", - "icon": "", - "url": "/pages/uni-stat/page-ent/page-ent", - "sort": 2132, - "create_date": 1638356902516, - "_id": "uni-stat-page-ent" - }, - { - "parent_id": "uni-stat", - "permission": [], - "enable": true, - "menu_id": "uni-stat-page-content-analysis", - "name": "内容统计", - "icon": "admin-icons-doc", - "url": "", - "sort": 2140, - "create_date": 1638356902516, - "_id": "uni-stat-page-content-analysis" - }, - { - "parent_id": "uni-stat-page-content-analysis", - "permission": [], - "enable": true, - "menu_id": "uni-stat-page-content", - "name": "内容统计", - "icon": "", - "url": "/pages/uni-stat/page-content/page-content", - "sort": 2141, - "create_date": 1638356902516, - "_id": "uni-stat-page-content" - }, - { - "parent_id": "uni-stat-page-content-analysis", - "permission": [], - "enable": true, - "menu_id": "uni-stat-page-rule", - "name": "页面规则", - "icon": "", - "url": "/pages/uni-stat/page-rule/page-rule", - "sort": 2142, - "create_date": 1638356902516, - "_id": "uni-stat-page-rule" - }, - { - "parent_id": "uni-stat", - "permission": [], - "enable": true, - "menu_id": "uni-stat-senceChannel", - "name": "渠道/场景值分析", - "icon": "admin-icons-qudaofenxi", - "url": "", - "sort": 2150, - "create_date": 1638356902516, - "_id": "uni-stat-senceChannel" - }, - { - "parent_id": "uni-stat-senceChannel", - "permission": [], - "enable": true, - "menu_id": "uni-stat-senceChannel-scene", - "name": "场景值(小程序)", - "icon": "", - "url": "/pages/uni-stat/scene/scene", - "sort": 2151, - "create_date": 1638356902516, - "_id": "uni-stat-senceChannel-scene" - }, - { - "parent_id": "uni-stat-senceChannel", - "permission": [], - "enable": true, - "menu_id": "uni-stat-senceChannel-channel", - "name": "渠道(app)", - "icon": "", - "url": "/pages/uni-stat/channel/channel", - "sort": 2152, - "create_date": 1638356902516, - "_id": "uni-stat-senceChannel-channel" - }, - { - "parent_id": "uni-stat", - "permission": [], - "enable": true, - "menu_id": "uni-stat-event-event", - "name": "自定义事件", - "icon": "admin-icons-shijianfenxi", - "url": "/pages/uni-stat/event/event", - "sort": 2160, - "create_date": 1638356902516, - "_id": "uni-stat-event-event" - }, - { - "parent_id": "uni-stat", - "permission": [], - "enable": true, - "menu_id": "uni-stat-error", - "name": "错误统计", - "icon": "admin-icons-cuowutongji", - "url": "", - "sort": 2170, - "create_date": 1638356902516, - "_id": "uni-stat-error" - }, - { - "parent_id": "uni-stat-error", - "permission": [], - "enable": true, - "menu_id": "uni-stat-error-js", - "name": "代码错误", - "icon": "", - "url": "/pages/uni-stat/error/js/js", - "sort": 2171, - "create_date": 1638356902516, - "_id": "uni-stat-error-js" - }, - { - "parent_id": "uni-stat-error", - "permission": [], - "enable": true, - "menu_id": "uni-stat-error-app", - "name": "app崩溃", - "icon": "", - "url": "/pages/uni-stat/error/app/app", - "sort": 2172, - "create_date": 1638356902516, - "_id": "uni-stat-error-app" - }, - { - "menu_id": "uni-stat-pay", - "name": "支付统计", - "icon": "uni-icons-circle", - "url": "", - "sort": 2122, - "parent_id": "uni-stat", - "permission": [], - "enable": true, - "create_date": 1667386977981, - "_id": "uni-stat-pay" - }, - { - "menu_id": "uni-stat-pay-overview", - "name": "概况", - "icon": "", - "url": "/pages/uni-stat/pay-order/overview/overview", - "sort": 21221, - "parent_id": "uni-stat-pay", - "permission": [], - "enable": true, - "create_date": 1667387038602, - "_id": "uni-stat-pay-overview" - }, - { - "menu_id": "uni-stat-pay-funnel", - "name": "转换漏斗分析", - "icon": "", - "url": "/pages/uni-stat/pay-order/funnel/funnel", - "sort": 21222, - "parent_id": "uni-stat-pay", - "permission": [], - "enable": true, - "create_date": 1668430092890, - "_id": "uni-stat-pay-funnel" - }, - { - "menu_id": "uni-stat-pay-ranking", - "name": "价值用户排行", - "icon": "", - "url": "/pages/uni-stat/pay-order/ranking/ranking", - "sort": 21223, - "parent_id": "uni-stat-pay", - "permission": [], - "enable": true, - "create_date": 1668430128302, - "_id": "uni-stat-pay-ranking" - }, - { - "menu_id": "uni-stat-pay-order-list", - "name": "订单明细", - "icon": "", - "url": "/pages/uni-stat/pay-order/list/list", - "sort": 21224, - "parent_id": "uni-stat-pay", - "permission": [], - "enable": true, - "create_date": 1667387078947, - "_id": "uni-stat-pay-order-list" - } -] diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-admin-menus.schema.json b/sport-erp-admin/uniCloud-alipay/database/opendb-admin-menus.schema.json deleted file mode 100644 index 3ffcb4c..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-admin-menus.schema.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "bsonType": "object", - "required": ["name", "menu_id"], - "permission": { - "read": true, - "create": "'CREATE_OPENDB_ADMIN_MENUS' in auth.permission", - "update": "'UPDATE_OPENDB_ADMIN_MENUS' in auth.permission", - "delete": "'DELETE_OPENDB_ADMIN_MENUS' in auth.permission" - }, - "properties": { - "_id": { - "description": "存储文档 ID,系统自动生成" - }, - "menu_id": { - "bsonType": "string", - "description": "菜单项的ID,不可重复", - "trim": "both" - }, - "name": { - "bsonType": "string", - "description": "菜单名称", - "trim": "both" - }, - "icon": { - "bsonType": "string", - "description": "菜单图标", - "trim": "both" - }, - "url": { - "bsonType": "string", - "description": "菜单url", - "trim": "both" - }, - "sort": { - "bsonType": "int", - "description": "菜单序号(越大越靠后)" - }, - "parent_id": { - "bsonType": "string", - "description": "父级菜单Id", - "parentKey": "menu_id" - }, - "permission": { - "bsonType": "array", - "description": "菜单权限列表" - }, - "enable": { - "bsonType": "bool", - "description": "是否启用菜单,true启用、false禁用" - }, - "create_date": { - "bsonType": "timestamp", - "description": "菜单创建时间", - "forceDefaultValue": { - "$env": "now" - } - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-app-list.index.json b/sport-erp-admin/uniCloud-alipay/database/opendb-app-list.index.json deleted file mode 100644 index eeb7316..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-app-list.index.json +++ /dev/null @@ -1,26 +0,0 @@ -[ - { - "IndexName": "appid", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "appid", - "Direction": "1" - } - ], - "MgoIsUnique": true - } - }, - { - "IndexName": "name", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "name", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - } -] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-app-list.init_data.json b/sport-erp-admin/uniCloud-alipay/database/opendb-app-list.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-app-list.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-app-list.schema.json b/sport-erp-admin/uniCloud-alipay/database/opendb-app-list.schema.json deleted file mode 100644 index 8a86347..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-app-list.schema.json +++ /dev/null @@ -1,379 +0,0 @@ -{ - "bsonType": "object", - "required": [ - "appid", - "name" - ], - "permission": { - "read": "'READ_OPENDB_APP_LIST' in auth.permission", - "create": "'CREATE_OPENDB_APP_LIST' in auth.permission", - "update": "'UPDATE_OPENDB_APP_LIST' in auth.permission", - "delete": "'DELETE_OPENDB_APP_LIST' in auth.permission" - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "appid": { - "bsonType": "string", - "description": "应用的AppID", - "label": "AppID", - "componentForEdit": { - "name": "uni-easyinput", - "props": { - ":disabled": true - } - } - }, - "app_type": { - "bsonType": "int", - "defaultValue": 0, - "description": "应用类型,0:uni-app 1:uni-app x", - "enum": [{ - "text": "uni-app", - "value": 0 - }, - { - "text": "uni-app x", - "value": 1 - } - ], - "title": "应用类型" - }, - "name": { - "bsonType": "string", - "description": "应用名称", - "label": "应用名称", - "componentForEdit": { - "name": "uni-easyinput", - "props": { - ":disabled": true - } - } - }, - "description": { - "bsonType": "string", - "description": "应用描述", - "label": "应用描述", - "componentForEdit": { - "name": "textarea" - }, - "componentForShow": { - "name": "textarea", - "props": { - ":disabled": true - } - } - }, - "creator_uid": { - "description": "创建者的user_id,创建者必然是用户,不随应用转让而改变", - "bsonType": "string" - }, - "owner_type": { - "bsonType": "int", - "description": "应用当前归属者类型,1:个人,2:企业" - }, - "owner_id": { - "bsonType": "string", - "description": "应用当前归属者的id,user_id or enterprise_id" - }, - "managers": { - "bsonType": "array", - "description": "应用管理员ID列表" - }, - "members": { - "bsonType": "array", - "description": "团队成员ID列表" - }, - "icon_url": { - "bsonType": "string", - "trim": "both", - "description": "应用图标链接", - "label": "应用图标" - }, - "introduction": { - "bsonType": "string", - "trim": "both", - "description": "应用简介", - "label": "应用简介", - "componentForEdit": { - "name": "uni-easyinput", - "props": { - "disabled": true - } - } - }, - "screenshot": { - "bsonType": "array", - "description": "应用截图", - "label": "应用截图" - }, - "app_android": { - "bsonType": "object", - "description": "安卓 App 相关信息", - "properties": { - "name": { - "bsonType": "string", - "description": "快应用名称", - "label": "快应用名称" - }, - "url": { - "bsonType": "string", - "description": "安卓可下载安装包地址", - "label": "安卓下载地址" - } - } - }, - "app_ios": { - "bsonType": "object", - "description": "苹果 App 相关信息", - "properties": { - "name": { - "bsonType": "string", - "description": "快应用名称", - "label": "快应用名称" - }, - "url": { - "bsonType": "string", - "description": "AppStore 上架地址", - "label": "AppStore 地址" - }, - "abm_url": { - "bsonType": "string", - "description": "获取 iOS ABM 应用登录链接", - "label": "获取 iOS ABM 应用登录链接" - } - } - }, - "app_harmony": { - "bsonType": "object", - "description": "HarmonyOS Next App 相关信息", - "properties": { - "name": { - "bsonType": "string", - "description": "应用名称", - "label": "应用名称" - }, - "url": { - "bsonType": "string", - "description": "可下载安装包或可访问地址", - "label": "下载地址" - } - } - }, - "mp_weixin": { - "bsonType": "object", - "description": "微信小程序相关信息", - "label": "微信小程序", - "properties": { - "name": { - "bsonType": "string", - "description": "小程序名字" - }, - "qrcode_url": { - "bsonType": "string", - "description": "二维码url" - } - } - }, - "mp_alipay": { - "bsonType": "object", - "description": "支付宝小程序相关信息", - "label": "支付宝小程序", - "properties": { - "name": { - "bsonType": "string", - "description": "小程序名字" - }, - "qrcode_url": { - "bsonType": "string", - "description": "二维码url" - } - } - }, - "mp_baidu": { - "bsonType": "object", - "description": "百度小程序相关信息", - "label": "百度小程序", - "properties": { - "name": { - "bsonType": "string", - "description": "小程序名字" - }, - "qrcode_url": { - "bsonType": "string", - "description": "二维码url" - } - } - }, - "mp_toutiao": { - "bsonType": "object", - "description": "头条小程序相关信息", - "label": "头条小程序", - "properties": { - "name": { - "bsonType": "string", - "description": "小程序名字" - }, - "qrcode_url": { - "bsonType": "string", - "description": "二维码url" - } - } - }, - "mp_qq": { - "bsonType": "object", - "description": "QQ小程序相关信息", - "label": "QQ小程序", - "properties": { - "name": { - "bsonType": "string", - "description": "小程序名字" - }, - "qrcode_url": { - "bsonType": "string", - "description": "二维码url" - } - } - }, - "mp_kuaishou": { - "bsonType": "object", - "description": "快手小程序相关信息", - "label": "快手小程序", - "properties": { - "name": { - "bsonType": "string", - "description": "小程序名字" - }, - "qrcode_url": { - "bsonType": "string", - "description": "二维码url" - } - } - }, - "mp_lark": { - "bsonType": "object", - "description": "飞书小程序相关信息", - "label": "飞书小程序", - "properties": { - "name": { - "bsonType": "string", - "description": "小程序名字" - }, - "qrcode_url": { - "bsonType": "string", - "description": "二维码url" - } - } - }, - "mp_jd": { - "bsonType": "object", - "description": "京东小程序相关信息", - "label": "京东小程序", - "properties": { - "name": { - "bsonType": "string", - "description": "小程序名字" - }, - "qrcode_url": { - "bsonType": "string", - "description": "二维码url" - } - } - }, - "mp_dingtalk": { - "bsonType": "object", - "description": "钉钉小程序相关信息", - "label": "钉钉小程序", - "properties": { - "name": { - "bsonType": "string", - "description": "小程序名字" - }, - "qrcode_url": { - "bsonType": "string", - "description": "二维码url" - } - } - }, - "h5": { - "bsonType": "object", - "properties": { - "url": { - "bsonType": "string", - "description": "H5 可访问链接" - } - } - }, - "quickapp": { - "bsonType": "object", - "properties": { - "name": { - "bsonType": "string", - "description": "快应用名称", - "label": "快应用名称" - }, - "qrcode_url": { - "bsonType": "string", - "description": "快应用二维码url" - } - } - }, - "store_list": { - "bsonType": "array", - "description": "发布的应用市场", - "label": "应用市场", - "properties": { - "id": { - "bsonType": "string", - "description": "应用id,自动生成", - "label": "id" - }, - "name": { - "bsonType": "string", - "description": "应用名称", - "label": "应用名称" - }, - "scheme": { - "bsonType": "string", - "description": "应用 scheme", - "label": "应用 scheme" - }, - "enable": { - "bsonType": "bool", - "description": "是否启用" - }, - "priority": { - "bsonType": "int", - "description": "按照从大到小排序", - "label": "优先级" - } - } - }, - "remark": { - "bsonType": "string", - "description": "备注", - "label": "备注", - "componentForEdit": { - "name": "textarea" - }, - "componentForShow": { - "name": "textarea", - "props": { - ":disabled": true - } - } - }, - "create_date": { - "bsonType": "timestamp", - "label": "创建时间", - "forceDefaultValue": { - "$env": "now" - }, - "componentForEdit": { - "name": "uni-dateformat" - } - } - }, - "version": "0.0.1" -} diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-app-versions.index.json b/sport-erp-admin/uniCloud-alipay/database/opendb-app-versions.index.json deleted file mode 100644 index 00cc71d..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-app-versions.index.json +++ /dev/null @@ -1,29 +0,0 @@ -[{ - "IndexName": "appid", - "MgoKeySchema": { "MgoIndexKeys": [{ "Name": "appid", "Direction": "1" }], "MgoIsUnique": false } - }, - { - "IndexName": "name", - "MgoKeySchema": { "MgoIndexKeys": [{ "Name": "name", "Direction": "1" }], "MgoIsUnique": false } - }, - { - "IndexName": "platform", - "MgoKeySchema": { "MgoIndexKeys": [{ "Name": "platform", "Direction": "1", "Type": "array" }], "MgoIsUnique": false } - }, - { - "IndexName": "type", - "MgoKeySchema": { "MgoIndexKeys": [{ "Name": "type", "Direction": "1" }], "MgoIsUnique": false } - }, - { - "IndexName": "uni_platform", - "MgoKeySchema": { "MgoIndexKeys": [{ "Name": "uni_platform", "Direction": "1" }], "MgoIsUnique": false } - }, - { - "IndexName": "create_env", - "MgoKeySchema": { "MgoIndexKeys": [{ "Name": "create_env", "Direction": "1" }], "MgoIsUnique": false } - }, - { - "IndexName": "stable_publish", - "MgoKeySchema": { "MgoIndexKeys": [{ "Name": "stable_publish", "Direction": "1", "Type": "bool" }], "MgoIsUnique": false } - } -] diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-app-versions.init_data.json b/sport-erp-admin/uniCloud-alipay/database/opendb-app-versions.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-app-versions.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-app-versions.schema.json b/sport-erp-admin/uniCloud-alipay/database/opendb-app-versions.schema.json deleted file mode 100644 index e6cbff6..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-app-versions.schema.json +++ /dev/null @@ -1,182 +0,0 @@ -// 文档教程: https://uniapp.dcloud.net.cn/uniCloud/schema -{ - "bsonType": "object", - "required": [ - "appid", - "uni_platform", - "version", - "type", - "create_env" - ], - "permission": { - "read": "'READ_OPENDB_APP_VERSIONS' in auth.permission", - "create": "'CREATE_OPENDB_APP_VERSIONS' in auth.permission", - "update": "'UPDATE_OPENDB_APP_VERSIONS' in auth.permission", - "delete": "'DELETE_OPENDB_APP_VERSIONS' in auth.permission" - }, - "properties": { - "_id": { - "description": "记录id,自动生成" - }, - "appid": { - "bsonType": "string", - "trim": "both", - "description": "应用的AppID", - "label": "AppID", - "componentForEdit": { - "name": "uni-easyinput", - "props": { - "disabled": true - } - } - }, - "name": { - "bsonType": "string", - "trim": "both", - "description": "应用名称", - "label": "应用名称", - "componentForEdit": { - "name": "uni-easyinput", - "props": { - "disabled": true - } - } - }, - "title": { - "bsonType": "string", - "description": "更新标题", - "label": "更新标题" - }, - "contents": { - "bsonType": "string", - "description": "更新内容", - "label": "更新内容", - "componentForEdit": { - "name": "textarea" - }, - "componentForShow": { - "name": "textarea", - "props": { - "disabled": true - } - } - }, - "platform": { - "bsonType": "array", - "enum": [ - { - "value": "Android", - "text": "安卓" - }, - { - "value": "iOS", - "text": "苹果" - }, - { - "value": "Harmony", - "text": "鸿蒙 Next" - } - ], - "description": "更新平台,Android || iOS || Harmony || [Android, iOS, Harmony]", - "label": "平台" - }, - "type": { - "bsonType": "string", - "enum": [ - { - "value": "native_app", - "text": "原生App安装包" - }, - { - "value": "wgt", - "text": "Wgt资源包" - } - ], - "description": "安装包类型,native_app || wgt", - "label": "安装包类型" - }, - "version": { - "bsonType": "string", - "description": "当前包版本号,必须大于当前线上发行版本号", - "label": "版本号" - }, - "min_uni_version": { - "bsonType": "string", - "description": "原生App最低版本", - "label": "原生App最低版本" - }, - "url": { - "bsonType": "string", - "description": "可下载或跳转的链接", - "label": "链接" - }, - "stable_publish": { - "bsonType": "bool", - "description": "是否上线发行", - "label": "上线发行" - }, - "is_silently": { - "bsonType": "bool", - "description": "是否静默更新", - "label": "静默更新", - "defaultValue": false - }, - "is_mandatory": { - "bsonType": "bool", - "description": "是否强制更新", - "label": "强制更新", - "defaultValue": false - }, - "create_date": { - "bsonType": "timestamp", - "label": "上传时间", - "forceDefaultValue": { - "$env": "now" - }, - "componentForEdit": { - "name": "uni-dateformat" - } - }, - "uni_platform": { - "bsonType": "string", - "description": "uni平台信息,如:mp-weixin/web/ios/android", - "label": "uni 平台" - }, - "create_env": { - "bsonType": "string", - "description": "创建来源,uni-stat:uni统计自动创建,upgrade-center:升级中心管理员创建" - }, - "store_list": { - "bsonType": "array", - "description": "发布的应用市场", - "label": "应用市场", - "properties": { - "id": { - "bsonType": "string", - "description": "应用id,自动生成", - "label": "id" - }, - "name": { - "bsonType": "string", - "description": "应用名称", - "label": "应用名称" - }, - "scheme": { - "bsonType": "string", - "description": "应用 scheme", - "label": "应用 scheme" - }, - "enable": { - "bsonType": "bool", - "description": "是否启用" - }, - "priority": { - "bsonType": "int", - "description": "按照从大到小排序", - "label": "优先级" - } - } - } - }, - "version": "0.0.1" -} diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-banner.index.json b/sport-erp-admin/uniCloud-alipay/database/opendb-banner.index.json deleted file mode 100644 index c842f52..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-banner.index.json +++ /dev/null @@ -1,40 +0,0 @@ -[ - { - "IndexName": "sort_", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "sort", - "Direction": "1", - "Type": "int" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "status_", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "status", - "Direction": "1", - "Type": "bool" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "category_id_", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "category_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - } -] diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-banner.init_data.json b/sport-erp-admin/uniCloud-alipay/database/opendb-banner.init_data.json deleted file mode 100644 index 19655d8..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-banner.init_data.json +++ /dev/null @@ -1,41 +0,0 @@ -[ - { - "status": true, - "bannerfile": { - "name": "094a9dc0-50c0-11eb-b680-7980c8a877b8.jpg", - "extname": "jpg", - "fileType": "image", - "url": "https://web-assets.dcloud.net.cn/unidoc/zh/shuijiao.jpg", - "size": 70880, - "image": { - "width": 500, - "height": 333 - }, - "path": "https://web-assets.dcloud.net.cn/unidoc/zh/shuijiao.jpg" - }, - "open_url": "https://www.dcloud.io/", - "title": "测试", - "sort": 1, - "category_id": "", - "description": "" - }, - { - "status": true, - "bannerfile": { - "name": "094a9dc0-50c0-11eb-b680-7980c8a877b8.jpg", - "extname": "jpg", - "fileType": "image", - "url": "https://web-assets.dcloud.net.cn/unidoc/zh/shuijiao.jpg", - "size": 70880, - "image": { - "width": 500, - "height": 333 - }, - "path": "https://web-assets.dcloud.net.cn/unidoc/zh/shuijiao.jpg" - }, - "open_url": "https://www.dcloud.io/", - "title": "", - "category_id": "", - "description": "" - } -] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-banner.schema.json b/sport-erp-admin/uniCloud-alipay/database/opendb-banner.schema.json deleted file mode 100644 index a027517..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-banner.schema.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "bsonType": "object", - "required": ["bannerfile"], - "permission": { - "read": true - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "bannerfile": { - "bsonType": "file", - "fileMediaType": "image", - "title": "图片文件", - "description": "图片文件信息,包括文件名、url等" - }, - "open_url": { - "bsonType": "string", - "description": "点击跳转目标地址。如果是web地址则使用内置web-view打开;如果是本地页面则跳转本地页面;如果是schema地址则打开本地的app", - "title": "点击目标地址", - "format": "url", - "pattern": "^(http:\/\/|https:\/\/|\/|.\/|@\/)\\S", - "trim": "both" - }, - "title": { - "bsonType": "string", - "description": "注意标题文字颜色和背景图靠色导致看不清的问题", - "maxLength": 20, - "title": "标题", - "trim": "both" - }, - "sort": { - "bsonType": "int", - "description": "数字越小,排序越前", - "title": "排序" - }, - "category_id": { - "bsonType": "string", - "description": "多个栏目的banner都存在一个表里时可用这个字段区分", - "title": "分类id" - }, - "status": { - "bsonType": "bool", - "defaultValue": true, - "title": "生效状态" - }, - "description": { - "bsonType": "string", - "description": "维护者自用描述", - "title": "备注", - "trim": "both" - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-department.index.json b/sport-erp-admin/uniCloud-alipay/database/opendb-department.index.json deleted file mode 100644 index 85bb1e7..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-department.index.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "IndexName": "name", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "name", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - } -] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-department.init_data.json b/sport-erp-admin/uniCloud-alipay/database/opendb-department.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-department.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-device.index.json b/sport-erp-admin/uniCloud-alipay/database/opendb-device.index.json deleted file mode 100644 index b28c7a8..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-device.index.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "IndexName": "index_device_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "device_id", - "Direction": "1" - } - ], - "MgoIsUnique": true - } - } -] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-device.init_data.json b/sport-erp-admin/uniCloud-alipay/database/opendb-device.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-device.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-feedback.index.json b/sport-erp-admin/uniCloud-alipay/database/opendb-feedback.index.json deleted file mode 100644 index 1cc63d9..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-feedback.index.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "IndexName": "_user_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "user_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - } -] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-feedback.init_data.json b/sport-erp-admin/uniCloud-alipay/database/opendb-feedback.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-feedback.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-frv-logs.init_data.json b/sport-erp-admin/uniCloud-alipay/database/opendb-frv-logs.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-frv-logs.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-news-articles.init_data.json b/sport-erp-admin/uniCloud-alipay/database/opendb-news-articles.init_data.json deleted file mode 100644 index 4102a4a..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-news-articles.init_data.json +++ /dev/null @@ -1,17 +0,0 @@ -[ - { - "title": "阿里小程序IDE官方内嵌uni-app,为开发者提供多端开发服务", - "excerpt": "阿里小程序IDE官方内嵌uni-app,为开发者提供多端开发服务", - "content": "

随着微信、阿里、百度、头条、QQ纷纷推出小程序,开发者的开发维护成本持续上升,负担过重。这点已经成为共识,现在连小程序平台厂商也充分意识到了。

\n

阿里小程序团队,为了减轻开发者的负担,在官方的小程序开发者工具中整合了多端框架。

\n

经过阿里团队仔细评估,uni-app 在产品完成度、跨平台支持度、开发者社区、可持续发展等多方面优势明显,最终选定 uni-app内置于阿里小程序开发工具中,为开发者提供多端开发解决方案。

\n

经过之前1个月的公测,10月10日,阿里小程序正式发布0.70版开发者工具,通过 uni-app 实现多端开发,成为本次版本更新的亮点功能!

\n

如下图,在阿里小程序工具左侧主导航选择 uni-app,创建项目,即可开发。

\n
\n


阿里小程序开发工具更新说明详见:https://docs.alipay.com/mini/ide/0.70-stable

\n

 

\n

集成uni-app,这对于阿里团队而言,并不是一个容易做出的决定。毕竟 uni-app 是一个三方产品,要经过复杂的评审流程。

\n

这一方面突显出阿里团队以开发者需求为本的优秀价值观,另一方面也证明 uni-app的产品确实过硬。

\n

很多开发者都有多端需求,但又没有足够精力去了解、评估 uni-app,而处于观望态度。现在大家可以更放心的使用 uni-app 了,它没有让阿里失望,也不会让你失望。

\n

自从uni-app推出以来,DCloud也取得了高速的发展,目前拥有370万开发者,框架运行在4.6亿手机用户设备上,月活达到1.35亿(仅包括部分接入DCloud统计平台的数据)。并且数据仍在高速增长中,在市场占有率上处于遥遥领先的位置。

\n

本次阿里小程序工具集成 uni-app,会让 uni-app 继续快速爆发,取得更大的成功。

\n

后续DCloud还将深化与阿里的合作,在serverless等领域给开发者提供更多优质服务。

\n

使用多端框架开发各端应用,是多赢的模式。开发者减轻了负担,获得了更多新流量。而小程序平台厂商,也能保证自己平台上的各种应用可以被及时的更新。

\n

DCloud欢迎更多小程序平台厂商,与我们一起合作,为开发者、平台、用户的多赢而努力。

\n

进一步了解uni-app,详见:https://uniapp.dcloud.io

\n

欢迎扫码关注DCloud公众号,转发消息到朋友圈。

", - "avatar": "https://ask.dcloud.net.cn/uploads/article/20191014/56f7dc1bd5f265e824649f7cb4f78d5b.png", - "type": 0, - "user_id": "_uni_starter_test_user_id", - "comment_count": 0, - "like_count": 0, - "comment_status": 0, - "article_status": 1, - "publish_date": 1616092287006, - "last_modify_date": 1616092303031, - "create_date": 1616092287006 - } -] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-news-articles.schema.json b/sport-erp-admin/uniCloud-alipay/database/opendb-news-articles.schema.json deleted file mode 100644 index 09eaf84..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-news-articles.schema.json +++ /dev/null @@ -1,165 +0,0 @@ -{ - "bsonType": "object", - "required": ["user_id", "title", "content"], - "permission": { - "read": "doc.user_id == auth.uid && doc.article_status == 0 || doc.article_status == 1", - "create": "auth.uid != null", - "update": "doc.user_id == auth.uid", - "delete": "doc.user_id == auth.uid" - }, - "properties": { - "_id": { - "description": "存储文档 ID(用户 ID),系统自动生成" - }, - "user_id": { - "bsonType": "string", - "description": "文章作者ID, 参考`uni-id-users` 表", - "foreignKey": "uni-id-users._id", - "defaultValue": { - "$env": "uid" - } - }, - "category_id": { - "bsonType": "string", - "title": "分类", - "description": "分类 id,参考`uni-news-categories`表", - "foreignKey": "opendb-news-categories._id", - "enum": { - "collection": "opendb-news-categories", - "field": "name as text, _id as value" - } - }, - "title": { - "bsonType": "string", - "title": "标题", - "description": "标题", - "label": "标题", - "trim": "both" - }, - "content": { - "bsonType": "string", - "title": "文章内容", - "description": "文章内容", - "label": "文章内容", - "trim": "right" - }, - "excerpt": { - "bsonType": "string", - "title": "文章摘录", - "description": "文章摘录", - "label": "摘要", - "trim": "both" - }, - "article_status": { - "bsonType": "int", - "title": "文章状态", - "description": "文章状态:0 草稿箱 1 已发布", - "defaultValue": 0, - "enum": [{ - "value": 0, - "text": "草稿箱" - }, { - "value": 1, - "text": "已发布" - }] - }, - "view_count": { - "bsonType": "int", - "title": "阅读数量", - "description": "阅读数量", - "permission": { - "write": false - } - }, - "like_count": { - "bsonType": "int", - "description": "喜欢数、点赞数", - "permission": { - "write": false - } - }, - "is_sticky": { - "bsonType": "bool", - "title": "是否置顶", - "description": "是否置顶", - "permission": { - "write": false - } - }, - "is_essence": { - "bsonType": "bool", - "title": "阅读加精", - "description": "阅读加精", - "permission": { - "write": false - } - }, - "comment_status": { - "bsonType": "int", - "title": "开放评论", - "description": "评论状态:0 关闭 1 开放", - "enum": [{ - "value": 0, - "text": "关闭" - }, { - "value": 1, - "text": "开放" - }] - }, - "comment_count": { - "bsonType": "int", - "description": "评论数量", - "permission": { - "write": false - } - }, - "last_comment_user_id": { - "bsonType": "string", - "description": "最后回复用户 id,参考`uni-id-users` 表", - "foreignKey": "uni-id-users._id" - }, - "avatar": { - "bsonType": "string", - "title": "封面大图", - "description": "缩略图地址", - "label": "封面大图", - "trim": "both" - }, - "publish_date": { - "bsonType": "timestamp", - "title": "发表时间", - "description": "发表时间", - "defaultValue": { - "$env": "now" - } - }, - "publish_ip": { - "bsonType": "string", - "title": "发布文章时IP地址", - "description": "发表时 IP 地址", - "forceDefaultValue": { - "$env": "clientIP" - } - }, - "last_modify_date": { - "bsonType": "timestamp", - "title": "最后修改时间", - "description": "最后修改时间", - "defaultValue": { - "$env": "now" - } - }, - "last_modify_ip": { - "bsonType": "string", - "description": "最后修改时 IP 地址", - "forceDefaultValue": { - "$env": "clientIP" - } - }, - "mode": { - "bsonType": "number", - "title": "排版显示模式", - "description": "排版显示模式,如左图右文、上图下文等" - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-news-categories.init_data.json b/sport-erp-admin/uniCloud-alipay/database/opendb-news-categories.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-news-categories.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-news-categories.schema.json b/sport-erp-admin/uniCloud-alipay/database/opendb-news-categories.schema.json deleted file mode 100644 index 976c8a8..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-news-categories.schema.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "bsonType": "object", - "required": ["name"], - "permission": { - "read": true, - "create": false, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "存储文档 ID(文章 ID),系统自动生成" - }, - "name": { - "bsonType": "string", - "description": "类别名称", - "label": "名称", - "trim": "both" - }, - "description": { - "bsonType": "string", - "description": "类别描述", - "label": "描述", - "trim": "both" - }, - "icon": { - "bsonType": "string", - "description": "类别图标地址", - "label": "图标地址", - "pattern": "^(http:\/\/|https:\/\/|\/|.\/|@\/)\\S", - "trim": "both" - }, - "sort": { - "bsonType": "int", - "description": "类别显示顺序", - "label": "排序" - }, - "article_count": { - "bsonType": "int", - "description": "该类别下文章数量" - }, - "create_date": { - "bsonType": "timestamp", - "description": "创建时间", - "forceDefaultValue": { - "$env": "now" - } - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-news-comments.index.json b/sport-erp-admin/uniCloud-alipay/database/opendb-news-comments.index.json deleted file mode 100644 index acd865f..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-news-comments.index.json +++ /dev/null @@ -1,26 +0,0 @@ -[ - { - "IndexName": "article_id_", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "article_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "user_id_", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "user_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - } -] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-news-comments.init_data.json b/sport-erp-admin/uniCloud-alipay/database/opendb-news-comments.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-news-comments.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-news-comments.schema.json b/sport-erp-admin/uniCloud-alipay/database/opendb-news-comments.schema.json deleted file mode 100644 index 847a60e..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-news-comments.schema.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "bsonType": "object", - "required": ["article_id", "user_id", "comment_content", "like_count", "comment_type", "reply_user_id", - "reply_comment_id" - ], - "permission": { - "read": true, - "create": "auth.uid != null && get(`database.opendb-news-articles.${doc.article_id}`).comment_status == 1", - "update": "doc.user_id == auth.uid", - "delete": "doc.user_id == auth.uid" - }, - "properties": { - "_id": { - "description": "存储文档 ID(文章 ID),系统自动生成" - }, - "article_id": { - "bsonType": "string", - "description": "文章ID,opendb-news-posts 表中的`_id`字段", - "foreignKey": "opendb-news-articles._id" - }, - "user_id": { - "bsonType": "string", - "description": "评论者ID,参考`uni-id-users` 表", - "forceDefaultValue": { - "$env": "uid" - }, - "foreignKey": "uni-id-users._id" - }, - "comment_content": { - "bsonType": "string", - "description": "评论内容", - "title": "评论内容", - "trim": "right" - }, - "like_count": { - "bsonType": "int", - "description": "评论喜欢数、点赞数" - }, - "comment_type": { - "bsonType": "int", - "description": "回复类型: 0 针对文章的回复 1 针对评论的回复" - }, - "reply_user_id": { - "bsonType": "string", - "description": "被回复的评论用户ID,comment_type为1时有效", - "foreignKey": "uni-id-users._id" - }, - "reply_comment_id": { - "bsonType": "string", - "description": "被回复的评论ID,comment_type为1时有效", - "foreignKey": "opendb-news-comments._id" - }, - "comment_date": { - "bsonType": "timestamp", - "description": "评论发表时间", - "forceDefaultValue": { - "$env": "now" - } - }, - "comment_ip": { - "bsonType": "string", - "description": "评论发表时 IP 地址", - "forceDefaultValue": { - "$env": "clientIP" - } - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-news-favorite.index.json b/sport-erp-admin/uniCloud-alipay/database/opendb-news-favorite.index.json deleted file mode 100644 index f074032..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-news-favorite.index.json +++ /dev/null @@ -1,18 +0,0 @@ -[ - { - "IndexName": "article_user_", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "article_id", - "Direction": "1" - }, - { - "Name": "user_id", - "Direction": "1" - } - ], - "MgoIsUnique": true - } - } -] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-news-favorite.init_data.json b/sport-erp-admin/uniCloud-alipay/database/opendb-news-favorite.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-news-favorite.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-news-favorite.schema.json b/sport-erp-admin/uniCloud-alipay/database/opendb-news-favorite.schema.json deleted file mode 100644 index a4034f1..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-news-favorite.schema.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "bsonType": "object", - "required": ["user_id", "article_id"], - "permission": { - "read": "doc.user_id == auth.uid", - "create": "auth.uid != null", - "update": "doc.user_id == auth.uid", - "delete": "doc.user_id == auth.uid" - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "article_id": { - "bsonType": "string", - "description": "文章id,参考opendb-news-articles表", - "foreignKey": "opendb-news-articles._id" - }, - "article_title": { - "bsonType": "string", - "description": "文章标题" - }, - "user_id": { - "bsonType": "string", - "description": "收藏者id,参考uni-id-users表", - "forceDefaultValue": { - "$env": "uid" - }, - "foreignKey": "uni-id-users._id" - }, - "create_date": { - "bsonType": "timestamp", - "description": "收藏时间", - "forceDefaultValue": { - "$env": "now" - } - }, - "update_date": { - "bsonType": "timestamp", - "description": "更新\/修改时间", - "forceDefaultValue": { - "$env": "now" - } - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-open-data.init_data.json b/sport-erp-admin/uniCloud-alipay/database/opendb-open-data.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-open-data.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-poi.index.json b/sport-erp-admin/uniCloud-alipay/database/opendb-poi.index.json deleted file mode 100644 index b602714..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-poi.index.json +++ /dev/null @@ -1,58 +0,0 @@ -[ - { - "IndexName": "location", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "location", - "Direction": "2dsphere" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "visible", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "visible", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "province-city-district", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "province", - "Direction": "1" - }, - { - "Name": "city", - "Direction": "1" - }, - { - "Name": "district", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "create_date", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "create_date", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - } -] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-poi.init_data.json b/sport-erp-admin/uniCloud-alipay/database/opendb-poi.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-poi.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-search-hot.init_data.json b/sport-erp-admin/uniCloud-alipay/database/opendb-search-hot.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-search-hot.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-search-hot.schema.json b/sport-erp-admin/uniCloud-alipay/database/opendb-search-hot.schema.json deleted file mode 100644 index 1230be4..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-search-hot.schema.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "bsonType": "object", - "permission": { - "create": false, - "delete": false, - "read": true, - "update": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "content": { - "bsonType": "string", - "description": "搜索内容" - }, - "count": { - "bsonType": "long", - "description": "搜索次数" - }, - "create_date": { - "bsonType": "timestamp", - "description": "统计时间" - } - }, - "required": ["content", "count"] -} diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-search-log.init_data.json b/sport-erp-admin/uniCloud-alipay/database/opendb-search-log.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-search-log.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-search-log.schema.json b/sport-erp-admin/uniCloud-alipay/database/opendb-search-log.schema.json deleted file mode 100644 index 421ee8c..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-search-log.schema.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "bsonType": "object", - "permission": { - "create": true, - "delete": false, - "read": false, - "update": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "content": { - "bsonType": "string", - "description": "搜索内容" - }, - "create_date": { - "bsonType": "timestamp", - "description": "统计时间" - }, - "device_id": { - "bsonType": "string", - "description": "设备id" - }, - "user_id": { - "bsonType": "string", - "description": "收藏者id,参考uni-id-users表" - } - }, - "required": ["content"] -} diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-sign-in.init_data.json b/sport-erp-admin/uniCloud-alipay/database/opendb-sign-in.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-sign-in.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-sms-log.init_data.json b/sport-erp-admin/uniCloud-alipay/database/opendb-sms-log.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-sms-log.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-sms-log.schema.json b/sport-erp-admin/uniCloud-alipay/database/opendb-sms-log.schema.json deleted file mode 100644 index ed66233..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-sms-log.schema.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "bsonType": "object", - "required": [], - "permission": { - "read": false, - "create": false, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "task_id": { - "bsonType": "string", - "description": "任务ID", - "foreignKey": "batch-sms-task._id" - }, - "uid": { - "bsonType": "string", - "description": "用户ID", - "foreignKey": "uni-id-users._id" - }, - "mobile": { - "bsonType": "int", - "description": "手机号" - }, - "var_data": { - "bsonType": "object", - "description": "变量数据" - }, - "status": { - "bsonType": "int", - "description": "发送状态", - "defaultValue": 0, - "enum": [{ - "text": "未发送", - "value": 0 - }, { - "text": "已发送", - "value": 1 - }, { - "text": "发送失败", - "value": 2 - }] - }, - "reason": { - "bsonType": "string", - "description": "发送失败原因" - }, - "send_date": { - "bsonType": "timestamp", - "description": "发送时间" - }, - "ccreate_date": { - "bsonType": "timestamp", - "description": "创建时间", - "forceDefaultValue": { - "$env": "now" - } - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-sms-task.init_data.json b/sport-erp-admin/uniCloud-alipay/database/opendb-sms-task.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-sms-task.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-sms-task.schema.json b/sport-erp-admin/uniCloud-alipay/database/opendb-sms-task.schema.json deleted file mode 100644 index c2cea06..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-sms-task.schema.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "bsonType": "object", - "required": [], - "permission": { - "read": false, - "create": false, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "name": { - "bsonType": "string", - "description": "任务名称", - "trim": "both" - }, - "app_id": { - "bsonType": "string", - "description": "App ID", - "trim": "both" - }, - "template_id": { - "bsonType": "string", - "description": "短信模板ID", - "trim": "both" - }, - "template_content": { - "bsonType": "string", - "description": "短信模板内容", - "trim": "both" - }, - "vars": { - "bsonType": "array", - "description": "短信变量" - }, - "to": { - "bsonType": "object", - "description": "短信接收者信息", - "properties": { - "all": { - "bsonType": "bool", - "description": "全部用户发送;字段废弃,由 condition 替代" - }, - "type": { - "bsonType": "string", - "description": "可选值 user | userTags" - }, - "receiver": { - "bsonType": "array", - "description": "用户ID's / 用户标签ID's;指定id发送" - }, - "condition": { - "bsonType": "object", - "description": "根据条件发送,例如给所有人发送" - } - } - }, - "send_qty": { - "bsonType": "int", - "description": "发送总数" - }, - "success_qty": { - "bsonType": "int", - "description": "成功总数" - }, - "fail_qty": { - "bsonType": "int", - "description": "失败总数" - }, - "create_date": { - "bsonType": "timestamp", - "description": "创建时间", - "forceDefaultValue": { - "$env": "now" - } - } - }, - "version": "0.0.1" -} \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-sms-template.init_data.json b/sport-erp-admin/uniCloud-alipay/database/opendb-sms-template.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-sms-template.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-sms-template.schema.json b/sport-erp-admin/uniCloud-alipay/database/opendb-sms-template.schema.json deleted file mode 100644 index e8e571e..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-sms-template.schema.json +++ /dev/null @@ -1,32 +0,0 @@ -// 文档教程: https://uniapp.dcloud.net.cn/uniCloud/schema -{ - "bsonType": "object", - "required": [], - "permission": { - "read": false, - "create": false, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "模板ID" - }, - "name": { - "bsonType": "string", - "description": "模板名称" - }, - "content": { - "bsonType": "string", - "description": "模板内容" - }, - "type": { - "bsonType": "int", - "description": "模板类型" - }, - "sign": { - "bsonType": "string", - "description": "模板签名" - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-tempdata.init_data.json b/sport-erp-admin/uniCloud-alipay/database/opendb-tempdata.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-tempdata.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-tempdata.schema.json b/sport-erp-admin/uniCloud-alipay/database/opendb-tempdata.schema.json deleted file mode 100644 index 1a741f3..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-tempdata.schema.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "bsonType": "object", - "required": ["value", "expired"], - "permission": { - "read": false, - "create": false, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "value": { - "description": "值" - }, - "expired": { - "description": "过期时间", - "bsonType": "timestamp" - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-verify-codes.index.json b/sport-erp-admin/uniCloud-alipay/database/opendb-verify-codes.index.json deleted file mode 100644 index 2c76a61..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-verify-codes.index.json +++ /dev/null @@ -1,62 +0,0 @@ -[ - { - "IndexName": "mobile_code_", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "mobile", - "Direction": "1" - }, - { - "Name": "code", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "email_code_", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "email", - "Direction": "1" - }, - { - "Name": "code", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "device_uuid_code_", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "device_uuid", - "Direction": "1" - }, - { - "Name": "code", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "expired_data_", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "expired_date", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - } -] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/opendb-verify-codes.init_data.json b/sport-erp-admin/uniCloud-alipay/database/opendb-verify-codes.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/opendb-verify-codes.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/read-news-log.init_data.json b/sport-erp-admin/uniCloud-alipay/database/read-news-log.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/read-news-log.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/read-news-log.schema.json b/sport-erp-admin/uniCloud-alipay/database/read-news-log.schema.json deleted file mode 100644 index 1cbd342..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/read-news-log.schema.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "bsonType": "object", - "required": ["user_id", "article_id"], - "permission": { - "read": "doc.user_id == auth.uid", - "create": "auth.uid != null", - "update": "doc.user_id == auth.uid" - //"delete": "doc.user_id == auth.uid" - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "article_id": { - "bsonType": "string", - "description": "文章id,参考opendb-news-articles表", - "foreignKey": "opendb-news-articles._id" - }, - "user_id": { - "bsonType": "string", - "description": "收藏者id,参考uni-id-users表", - "forceDefaultValue": { - "$env": "uid" - }, - "foreignKey": "uni-id-users._id" - }, - "last_time": { //设计策略是多次看同一个文章只做一次记录,重复看的文章时间更新为当前时间 - "bsonType": "timestamp", - "description": "最后一次看的时间", - "defaultValue": { - "$env": "now" - } - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-id-device.init_data.json b/sport-erp-admin/uniCloud-alipay/database/uni-id-device.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-id-device.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-id-log.index.json b/sport-erp-admin/uniCloud-alipay/database/uni-id-log.index.json deleted file mode 100644 index 50c3d20..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-id-log.index.json +++ /dev/null @@ -1,74 +0,0 @@ -[ - { - "IndexName": "user_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "user_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "device_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "device_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "ip", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "ip", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "username", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "username", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "mobile", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "mobile", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "email", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "email", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - } -] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-id-log.init_data.json b/sport-erp-admin/uniCloud-alipay/database/uni-id-log.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-id-log.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-id-permissions.index.json b/sport-erp-admin/uniCloud-alipay/database/uni-id-permissions.index.json deleted file mode 100644 index 9198b25..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-id-permissions.index.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "IndexName": "permission_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "permission_id", - "Direction": "1" - } - ], - "MgoIsUnique": true - } - } -] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-id-permissions.init_data.json b/sport-erp-admin/uniCloud-alipay/database/uni-id-permissions.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-id-permissions.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-id-roles.index.json b/sport-erp-admin/uniCloud-alipay/database/uni-id-roles.index.json deleted file mode 100644 index 0a83717..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-id-roles.index.json +++ /dev/null @@ -1,22 +0,0 @@ -[{ - "IndexName": "role_id_", - "MgoKeySchema": { - "MgoIndexKeys": [{ - "Name": "role_id", - "Direction": "1" - }], - "MgoIsUnique": true - } - }, - { - "IndexName": "permission", - "MgoKeySchema": { - "MgoIndexKeys": [{ - "Name": "permission", - "Direction": "1", - "Type": "array" - }], - "MgoIsUnique": false - } - } -] diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-id-roles.init_data.json b/sport-erp-admin/uniCloud-alipay/database/uni-id-roles.init_data.json deleted file mode 100644 index e6c78a9..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-id-roles.init_data.json +++ /dev/null @@ -1,9 +0,0 @@ -[ - { - "role_id": "admin", - "role_name": "超级管理员", - "permission": [], - "comment": "超级管理员拥有所有权限", - "create_date": 0 - } -] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-id-scores.init_data.json b/sport-erp-admin/uniCloud-alipay/database/uni-id-scores.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-id-scores.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-id-scores.schema.json b/sport-erp-admin/uniCloud-alipay/database/uni-id-scores.schema.json deleted file mode 100644 index 0e2a7f6..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-id-scores.schema.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "bsonType": "object", - "required": ["user_id", "score", "balance"], - "permission": { - "read": "doc.user_id == auth.uid", - "create": false, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "user_id": { - "bsonType": "string", - "description": "用户id,参考uni-id-users表" - }, - "score": { - "bsonType": "int", - "description": "本次变化的积分" - }, - "type": { - "bsonType": "int", - "enum": [1, 2], - "description": "积分类型 1:收入 2:支出" - }, - "balance": { - "bsonType": "int", - "description": "变化后的积分余额" - }, - "comment": { - "bsonType": "string", - "description": "备注,说明积分新增、消费的缘由", - "trim": "both" - }, - "create_date": { - "bsonType": "timestamp", - "description": "创建时间", - "forceDefaultValue": { - "$env": "now" - } - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-id-tag.index.json b/sport-erp-admin/uniCloud-alipay/database/uni-id-tag.index.json deleted file mode 100644 index 43b5390..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-id-tag.index.json +++ /dev/null @@ -1,26 +0,0 @@ -[ - { - "IndexName": "tagid", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "tagid", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "name", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "name", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - } -] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-id-tag.init_data.json b/sport-erp-admin/uniCloud-alipay/database/uni-id-tag.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-id-tag.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-id-tag.schema.json b/sport-erp-admin/uniCloud-alipay/database/uni-id-tag.schema.json deleted file mode 100644 index 1589273..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-id-tag.schema.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "bsonType": "object", - "required": ["tagid", "name"], - "permission": { - "read": "'READ_UNI_ID_TAG' in auth.permission", - "create": "'CREATE_UNI_ID_TAG' in auth.permission", - "update": "'UPDATE_UNI_ID_TAG' in auth.permission", - "delete": "'DELETE_UNI_ID_TAG' in auth.permission" - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "tagid": { - "bsonType": "string", - "description": "标签tagid", - "label": "标签tagid", - "componentForEdit": { - "name": "uni-easyinput" - } - }, - "name": { - "bsonType": "string", - "description": "标签名称", - "label": "标签名称", - "componentForEdit": { - "name": "uni-easyinput" - } - }, - "description": { - "bsonType": "string", - "description": "标签描述", - "label": "标签描述", - "componentForEdit": { - "name": "textarea" - }, - "componentForShow": { - "name": "textarea" - } - }, - "create_date": { - "bsonType": "timestamp", - "label": "创建时间", - "forceDefaultValue": { - "$env": "now" - }, - "componentForEdit": { - "name": "uni-dateformat" - } - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-id-users.index.json b/sport-erp-admin/uniCloud-alipay/database/uni-id-users.index.json deleted file mode 100644 index 34a7e05..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-id-users.index.json +++ /dev/null @@ -1,103 +0,0 @@ -[{ - "IndexName": "username", - "MgoKeySchema": { "MgoIndexKeys": [{ "Name": "username", "Direction": "1" }], "MgoIsUnique": false } - }, - { - "IndexName": "mobile", - "MgoKeySchema": { "MgoIndexKeys": [{ "Name": "mobile", "Direction": "1" }], "MgoIsUnique": false } - }, - { - "IndexName": "email", - "MgoKeySchema": { "MgoIndexKeys": [{ "Name": "email", "Direction": "1" }], "MgoIsUnique": false } - }, - { - "IndexName": "wx_openid.app", - "MgoKeySchema": { "MgoIndexKeys": [{ "Name": "wx_openid.app", "Direction": "1" }], "MgoIsUnique": false } - }, - { - "IndexName": "wx_openid.mp", - "MgoKeySchema": { "MgoIndexKeys": [{ "Name": "wx_openid.mp", "Direction": "1" }], "MgoIsUnique": false } - }, - { - "IndexName": "wx_unionid", - "MgoKeySchema": { "MgoIndexKeys": [{ "Name": "wx_unionid", "Direction": "1" }], "MgoIsUnique": false } - }, - { - "IndexName": "ali_openid", - "MgoKeySchema": { "MgoIndexKeys": [{ "Name": "ali_openid", "Direction": "1" }], "MgoIsUnique": false } - }, - { - "IndexName": "my_invite_code", - "MgoKeySchema": { "MgoIndexKeys": [{ "Name": "my_invite_code", "Direction": "1" }], "MgoIsUnique": false } - }, - { - "IndexName": "inviter_uid", - "MgoKeySchema": { "MgoIndexKeys": [{ "Name": "inviter_uid", "Direction": "1", "Type": "array" }], "MgoIsUnique": false } - }, - { - "IndexName": "role", - "MgoKeySchema": { "MgoIndexKeys": [{ "Name": "role", "Direction": "1", "Type": "array" }], "MgoIsUnique": false } - }, - { - "IndexName": "tags", - "MgoKeySchema": { "MgoIndexKeys": [{ "Name": "tags", "Direction": "1", "Type": "array" }], "MgoIsUnique": false } - }, - { - "IndexName": "register_date", - "MgoKeySchema": { "MgoIndexKeys": [{ "Name": "register_date", "Direction": "-1", "Type": "long" }], "MgoIsUnique": false } - }, - { - "IndexName": "last_login_date", - "MgoKeySchema": { "MgoIndexKeys": [{ "Name": "last_login_date", "Direction": "-1", "Type": "long" }], "MgoIsUnique": false } - }, - { - "IndexName": "wx_openid.h5", - "MgoKeySchema": { - "MgoIndexKeys": [{ - "Name": "wx_openid.h5", - "Direction": "1" - }], - "MgoIsUnique": false - } - }, - { - "IndexName": "wx_openid.web", - "MgoKeySchema": { - "MgoIndexKeys": [{ - "Name": "wx_openid.web", - "Direction": "1" - }], - "MgoIsUnique": false - } - }, - { - "IndexName": "apple_openid", - "MgoKeySchema": { - "MgoIndexKeys": [{ - "Name": "apple_openid", - "Direction": "1" - }], - "MgoIsUnique": false - } - }, - { - "IndexName": "register_env_app_version_", - "MgoKeySchema": { - "MgoIndexKeys": [{ - "Name": "register_env.appVersion", - "Direction": "1" - }], - "MgoIsUnique": false - } - }, - { - "IndexName": "register_env_channel_", - "MgoKeySchema": { - "MgoIndexKeys": [{ - "Name": "register_env.channel", - "Direction": "1" - }], - "MgoIsUnique": false - } - } -] diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-id-users.init_data.json b/sport-erp-admin/uniCloud-alipay/database/uni-id-users.init_data.json deleted file mode 100644 index 2aef649..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-id-users.init_data.json +++ /dev/null @@ -1,10 +0,0 @@ -[ - { - "_id": "_uni_starter_test_user_id", - "username": "uni-starter预置用户名", - "nickname": "测试用户昵称", - "avatar": "https://unicloud.dcloud.net.cn/assets/logo.dca09351.png", - "mobile": "18888888888", - "mobile_confirmed": 1 - } -] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-pay-orders.index.json b/sport-erp-admin/uniCloud-alipay/database/uni-pay-orders.index.json deleted file mode 100644 index 6aaff20..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-pay-orders.index.json +++ /dev/null @@ -1,101 +0,0 @@ -[ - { - "IndexName": "order_no", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "order_no", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "out_trade_no", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "out_trade_no", - "Direction": "1" - } - ], - "MgoIsUnique": true - } - }, - { - "IndexName": "transaction_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "transaction_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "create_date", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "create_date", - "Direction": "1", - "Type": "long" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "pay_date", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "pay_date", - "Direction": "1", - "Type": "long" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "total_fee", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "total_fee", - "Direction": "1", - "Type": "int" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "user_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "user_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "appid", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "appid", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - } -] diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-pay-orders.init_data.json b/sport-erp-admin/uniCloud-alipay/database/uni-pay-orders.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-pay-orders.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-pay-orders.schema.json b/sport-erp-admin/uniCloud-alipay/database/uni-pay-orders.schema.json deleted file mode 100644 index 873ed48..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-pay-orders.schema.json +++ /dev/null @@ -1,252 +0,0 @@ -{ - "bsonType": "object", - "required": [], - "permission": { - "read": "'READ_UNI_STAT_PAY' in auth.permission", - "create": false, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "provider": { - "title": "支付供应商", - "bsonType": "string", - "enum": [{ - "text": "微信支付", - "value": "wxpay" - }, - { - "text": "支付宝", - "value": "alipay" - }, - { - "text": "苹果应用内支付", - "value": "appleiap" - } - ], - "description": "支付供应商 如 wxpay alipay 参考 https://uniapp.dcloud.net.cn/api/plugins/provider.html#" - }, - "provider_pay_type": { - "title": "支付方式", - "bsonType": "string", - "description": "支付供应商的支付类型(插件内部标记支付类型的标识,不需要用户传)", - "trim": "both" - }, - "uni_platform": { - "title": "应用平台", - "bsonType": "string", - "description": "uni客户端平台,如:web、mp-weixin、mp-alipay、app等", - "trim": "both" - }, - "status": { - "title": "订单状态", - "bsonType": "int", - "enum": [{ - "text": "已关闭", - "value": -1 - }, - { - "text": "未支付", - "value": 0 - }, - { - "text": "已支付", - "value": 1 - }, - { - "text": "已部分退款", - "value": 2 - }, - { - "text": "已全额退款", - "value": 3 - } - ], - "description": "订单状态 -1 已关闭 0:未支付 1:已支付 2:已部分退款 3:已全额退款", - "defaultValue": 0 - }, - "type": { - "title": "订单类型", - "bsonType": "string", - "description": "订单类型 goods:订单付款 recharge:余额充值付款 vip:vip充值付款 等等,可自定义", - "trim": "both" - }, - "order_no": { - "title": "业务系统订单号", - "bsonType": "string", - "minLength": 20, - "maxLength": 28, - "description": "业务系统订单号,控制在20-28位(不可以是24位,24位在阿里云空间可能会有问题,可重复,代表1个业务订单会有多次付款的情况)", - "trim": "both" - }, - "out_trade_no": { - "title": "支付插件订单号", - "bsonType": "string", - "description": "支付插件订单号(需控制唯一,不传则由插件自动生成)", - "trim": "both" - }, - "transaction_id": { - "title": "交易单号", - "bsonType": "string", - "description": "交易单号(支付平台订单号,由支付平台控制唯一)", - "trim": "both" - }, - "user_id": { - "title": "用户ID", - "bsonType": "string", - "description": "用户id,参考uni-id-users表", - "foreignKey": "uni-id-users._id" - }, - "nickname": { - "title": "用户昵称", - "bsonType": "string", - "description": "用户昵称冗余", - "trim": "both" - }, - "device_id": { - "bsonType": "string", - "description": "客户端设备ID" - }, - "client_ip": { - "title": "客户端IP", - "bsonType": "string", - "description": "创建支付的客户端ip", - "trim": "both" - }, - "openid": { - "title": "openid", - "bsonType": "string", - "description": "发起支付的用户openid", - "trim": "both" - }, - "description": { - "title": "支付描述", - "bsonType": "string", - "description": "支付描述,如:uniCloud个人版包月套餐", - "trim": "both" - }, - "err_msg": { - "title": "支付失败原因", - "bsonType": "string", - "description": "支付失败原因", - "trim": "both" - }, - "total_fee": { - "title": "订单总金额", - "bsonType": "int", - "description": "订单总金额,单位为分,100等于1元" - }, - "refund_fee": { - "title": "订单总退款金额", - "bsonType": "int", - "description": "订单总退款金额,单位为分,100等于1元" - }, - "refund_count": { - "title": "当前退款笔数", - "bsonType": "int", - "description": "当前退款笔数 (退款单号为 out_trade_no-refund_count)" - }, - "refund_list": { - "title": "退款详情", - "bsonType": "array", - "description": "退款详情" - }, - "provider_appid": { - "title": "开放平台appid", - "bsonType": "string", - "description": "公众号appid,小程序appid,app开放平台appid 等", - "trim": "both" - }, - "appid": { - "title": "DCloud AppId", - "bsonType": "string", - "description": "dcloud_appid", - "trim": "both" - }, - "user_order_success": { - "title": "回调状态", - "bsonType": "bool", - "description": "用户异步通知逻辑是否全部执行完成,且无异常(建议前端通过此参数是否为true来判断是否支付成功)" - }, - "custom": { - "title": "自定义数据", - "bsonType": "object", - "description": "自定义数据(用户自定义数据)" - }, - "original_data": { - "title": "异步通知原始数据", - "bsonType": "object", - "description": "异步回调通知返回的原始数据,微信v2是xml转json后的数据,微信v3和支付宝是原始json" - }, - "create_date": { - "title": "创建时间", - "bsonType": "timestamp", - "description": "创建时间", - "forceDefaultValue": { - "$env": "now" - } - }, - "pay_date": { - "title": "支付时间", - "bsonType": "timestamp", - "description": "支付时间" - }, - "notify_date": { - "title": "异步通知时间", - "bsonType": "timestamp", - "description": "订单通知支付成功时间" - }, - "cancel_date": { - "title": "取消时间", - "bsonType": "timestamp", - "description": "订单取消时间" - }, - "refund_date": { - "title": "最近退款时间", - "bsonType": "timestamp", - "description": "最近退款时间" - }, - "stat_data": { - "title": "uni统计相关数据", - "bsonType": "object", - "description": "uni统计相关数据", - "properties": { - "platform": { - "bsonType": "string", - "description": "与uni_platform唯一区别是APP区分 android 和 ios" - }, - "app_version": { - "bsonType": "string", - "description": "客户端版本号 (字符串形式)如1.0.0" - }, - "app_version_code": { - "bsonType": "string", - "description": "客户端版本号(数字形式) 如100" - }, - "app_wgt_version": { - "bsonType": "string", - "description": "客户端热更新版本号" - }, - "os": { - "bsonType": "string", - "description": "设备的操作系统 如 android ios" - }, - "ua": { - "bsonType": "string", - "description": "客户端userAgent" - }, - "channel": { - "bsonType": "string", - "description": "客户端渠道" - }, - "scene": { - "bsonType": "string", - "description": "小程序场景值" - } - } - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-active-devices.index.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-active-devices.index.json deleted file mode 100644 index 4169f7c..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-active-devices.index.json +++ /dev/null @@ -1,100 +0,0 @@ -[ - { - "IndexName": "create_time", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "create_time", - "Direction": "1", - "Type": "long" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "appid", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "appid", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "version_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "version_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "platform_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "platform_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "channel_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "channel_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "dimension", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "dimension", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "device_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "device_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "is_new", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "is_new", - "Direction": "1", - "Type": "int" - } - ], - "MgoIsUnique": false - } - } -] diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-active-devices.init_data.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-active-devices.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-active-devices.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-active-devices.schema.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-active-devices.schema.json deleted file mode 100644 index c3e2afe..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-active-devices.schema.json +++ /dev/null @@ -1,67 +0,0 @@ -// 活跃设备表 -{ - "bsonType": "object", - "description": "给周月维度的设备基础统计和留存统计提供数据,每日跑批合并,仅添加本周/本月首次访问的设备", - "required": [], - "permission": { - "read": false, - "create": false, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "appid": { - "bsonType": "string", - "description": "应用ID" - }, - "platform_id": { - "bsonType": "string", - "description": "应用平台ID,对应uni-stat-app-platforms._id", - "foreignKey": "uni-stat-app-platforms._id" - }, - "channel_id": { - "bsonType": "string", - "description": "渠道\/场景值ID,对应uni-stat-app-channels._id", - "foreignKey": "uni-stat-app-channels._id" - }, - "version_id": { - "bsonType": "string", - "description": "应用版本ID,对应opendb-app-versions._id", - "foreignKey": "opendb-app-versions._id" - }, - "device_id": { - "bsonType": "string", - "description": "客户端携带的设备标识" - }, - "is_new": { - "bsonType": "int", - "description": "是否为新设备", - "defaultValue": 0, - "enum": [{ - "text": "否", - "value": 0 - }, { - "text": "是", - "value": 1 - }] - }, - "dimension": { - "bsonType": "string", - "description": "时间范围 week:周,month:月", - "enum": [{ - "text": "月", - "value": "month" - }, { - "text": "周", - "value": "week" - }] - }, - "create_time": { - "bsonType": "timestamp", - "description": "创建时间" - } - } -} \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-active-users.index.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-active-users.index.json deleted file mode 100644 index cb36195..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-active-users.index.json +++ /dev/null @@ -1,75 +0,0 @@ -[ - { - "IndexName": "create_time", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "create_time", - "Direction": "1", - "Type": "long" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "appid", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "appid", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "version_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "version_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "platform_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "platform_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "channel_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "channel_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "dimension", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "dimension", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - } -] diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-active-users.init_data.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-active-users.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-active-users.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-active-users.schema.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-active-users.schema.json deleted file mode 100644 index 7c3f421..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-active-users.schema.json +++ /dev/null @@ -1,55 +0,0 @@ -// 活跃用户表 -{ - "bsonType": "object", - "description": "给周月维度的用户基础统计和留存统计提供数据,每日跑批合并,仅添加本周/本月首次访问的用户。", - "required": [], - "permission": { - "read": false, - "create": false, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "appid": { - "bsonType": "string", - "description": "应用ID" - }, - "platform_id": { - "bsonType": "string", - "description": "应用平台ID,对应uni-stat-app-platforms._id", - "foreignKey": "uni-stat-app-platforms._id" - }, - "channel_id": { - "bsonType": "string", - "description": "渠道\/场景值ID,对应uni-stat-app-channels._id", - "foreignKey": "uni-stat-app-channels._id" - }, - "version_id": { - "bsonType": "string", - "description": "应用版本ID,对应opendb-app-versions._id", - "foreignKey": "opendb-app-versions._id" - }, - "uid": { - "bsonType": "string", - "description": "用户编号, 对应uni-id-users._id" - }, - "dimension": { - "bsonType": "string", - "description": "时间范围 week:周,month:月", - "enum": [{ - "text": "月", - "value": "month" - }, { - "text": "周", - "value": "week" - }] - }, - "create_time": { - "bsonType": "timestamp", - "description": "创建时间" - } - } -} \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-channels.index.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-channels.index.json deleted file mode 100644 index d59944c..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-channels.index.json +++ /dev/null @@ -1,22 +0,0 @@ -[ - { - "IndexName": "index_search_channel", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "appid", - "Direction": "1" - }, - { - "Name": "platform_id", - "Direction": "1" - }, - { - "Name": "channel_code", - "Direction": "1" - } - ], - "MgoIsUnique": true - } - } -] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-channels.init_data.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-channels.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-channels.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-channels.schema.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-channels.schema.json deleted file mode 100644 index 2c352e1..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-channels.schema.json +++ /dev/null @@ -1,44 +0,0 @@ -// 应用渠道表 -{ - "bsonType": "object", - "description": "提供渠道和场景值数据", - "required": [], - "permission": { - "read": "'READ_UNI_STAT_APP_CHANNELS' in auth.permission", - "create": false, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "appid": { - "bsonType": "string", - "description": "统计应用ID,对应opendb-app-list.appid", - "foreignKey": "opendb-app-list.appid" - }, - "platform_id": { - "bsonType": "string", - "description": "应用平台,对应uni-stat-app-platforms._id", - "foreignKey": "uni-stat-app-platforms._id" - }, - "channel_code": { - "bsonType": "string", - "description": "客户端上报的渠道代码" - }, - "channel_name": { - "bsonType": "string", - "description": "渠道名称,用户可编辑" - }, - "create_time": { - "bsonType": "timestamp", - "description": "创建时间" - }, - "last_modify_time": { - "bsonType": "timestamp", - "description": "最后修改时间" - } - } -} - diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-crash-logs.index.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-crash-logs.index.json deleted file mode 100644 index 5fa2b1c..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-crash-logs.index.json +++ /dev/null @@ -1,63 +0,0 @@ -[ - { - "IndexName": "create_time", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "create_time", - "Direction": "1", - "Type": "long" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "appid", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "appid", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "version", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "version", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "platform", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "platform", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "channel", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "channel", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - } -] diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-crash-logs.init_data.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-crash-logs.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-crash-logs.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-crash-logs.schema.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-crash-logs.schema.json deleted file mode 100644 index 389e2f6..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-crash-logs.schema.json +++ /dev/null @@ -1,137 +0,0 @@ -// 原生应用崩溃日志表 -{ - "bsonType": "object", - "description": "记录原生应用的崩溃日志", - "required": [], - "permission": { - "read": "'READ_UNI_STAT_APP_CRASH_LOGS' in auth.permission", - "create": false, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "appid": { - "bsonType": "string", - "description": "用户端上报的应用ID" - }, - "version": { - "bsonType": "string", - "description": "用户端上报的应用版本号。manifest.json中的version->name的值" - }, - "platform": { - "bsonType": "string", - "description": "用户端上报的平台code" - }, - "channel": { - "bsonType": "string", - "description": "用户端上报的渠道code\/场景值" - }, - "sdk_version": { - "bsonType": "string", - "description": "基础库版本号" - }, - "device_id": { - "bsonType": "string", - "description": "客户端携带的设备标识" - }, - "device_net": { - "bsonType": "string", - "description": "设备网络型号wifi\/3G\/4G\/" - }, - "device_os": { - "bsonType": "string", - "description": "系统版本:iOS平台为系统版本号,如15.1;Android平台为API等级,如30" - }, - "device_os_version": { - "bsonType": "string", - "description": "系统版本名称:iOS平台与os字段一致;Android平台为版本名称,如5.1.1" - }, - "device_vendor": { - "bsonType": "string", - "description": "设备供应商 " - }, - "device_model": { - "bsonType": "string", - "description": "设备型号" - }, - "device_is_root": { - "bsonType": "int", - "description": "是否root:1表示root;0表示未root" - }, - "device_os_name": { - "bsonType": "string", - "description": "系统名称:用于区别Android和鸿蒙,仅Android支持" - }, - "device_batt_level": { - "bsonType": "int", - "description": "设备电池电量:取值范围0-100,仅Android支持" - }, - "device_batt_temp": { - "bsonType": "string", - "description": "电池温度,仅Android支持" - }, - "device_memory_use_size": { - "bsonType": "int", - "description": "系统已使用内存,单位为Byte,仅Android支持" - }, - "device_memory_total_size": { - "bsonType": "int", - "description": "系统总内存,单位为Byte,仅Android支持" - }, - "device_disk_use_size": { - "bsonType": "int", - "description": "系统磁盘已使用大小,单位为Byte,仅Android支持" - }, - "device_disk_total_size": { - "bsonType": "int", - "description": "系统磁盘总大小,单位为Byte,仅Android支持" - }, - "device_abis": { - "bsonType": "string", - "description": "设备支持的CPU架构:多个使用,分割,如arm64-v8a,armeabi-v7a,armeabi,仅Android支持" - }, - "app_count": { - "bsonType": "int", - "description": "运行的app个数:包括运行的uni小程序数目。独立App时值为1" - }, - "app_use_memory_size": { - "bsonType": "int", - "description": "APP使用的内存量,单位为Byte" - }, - "app_webview_count": { - "bsonType": "int", - "description": "打开Webview窗口的个数" - }, - "app_use_duration": { - "bsonType": "int", - "description": "APP使用时长:单位为s" - }, - "app_run_fore": { - "bsonType": "int", - "description": "是否前台运行:1表示前台运行,0表示后台运行" - }, - "package_name": { - "bsonType": "string", - "description": "原生应用包名" - }, - "package_version": { - "bsonType": "string", - "description": "Android的apk版本名称;iOS的ipa版本名称" - }, - "page_url": { - "bsonType": "string", - "description": "页面url" - }, - "error_msg": { - "bsonType": "string", - "description": "错误信息" - }, - "create_time": { - "bsonType": "timestamp", - "description": "客户端记录到的崩溃时间" - } - } -} \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-platforms.index.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-platforms.index.json deleted file mode 100644 index 0dfec62..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-platforms.index.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "IndexName": "index_search_platforms", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "code", - "Direction": "1" - } - ], - "MgoIsUnique": true - } - } -] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-platforms.init_data.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-platforms.init_data.json deleted file mode 100644 index 8741366..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-platforms.init_data.json +++ /dev/null @@ -1,114 +0,0 @@ -[ - { - "name":"App-Android", - "code":"android", - "order":1, - "enable":true, - "create_time":163998979103 - }, - { - "name":"App-iOS", - "code":"ios", - "order":2, - "enable":true, - "create_time":163998979103 - }, - { - "name":"App-Harmony", - "code":"harmony", - "order":3, - "enable":true, - "create_time":163998979103 - }, - { - "name":"Web", - "code":"web", - "order":4, - "enable":true, - "create_time":163998979103 - }, - { - "name":"微信小程序", - "code":"mp-weixin", - "order":5, - "enable":true, - "create_time":163998979103 - }, - { - "name":"百度小程序", - "code":"mp-baidu", - "order":6, - "enable":true, - "create_time":163998979103 - }, - { - "name":"支付宝小程序", - "code":"mp-alipay", - "order":7, - "enable":true, - "create_time":163998979103 - }, - { - "name":"字节跳动小程序", - "code":"mp-toutiao", - "order":8, - "enable":true, - "create_time":163998979103 - }, - { - "name":"qq小程序", - "code":"mp-qq", - "order":9, - "enable":true, - "create_time":163998979103 - }, - { - "name":"快应用联盟", - "code":"quickapp-webview-union", - "order":10, - "enable":true, - "create_time":163998979103 - }, - { - "name":"快应用华为", - "code":"quickapp-webview-huawei", - "order":11, - "enable":true, - "create_time":163998979103 - }, - { - "name":"钉钉小程序", - "code":"mp-dingtalk", - "order":12, - "enable":true, - "create_time":163998979103 - }, - { - "name":"快手小程序", - "code":"mp-kuaishou", - "order":13, - "enable":true, - "create_time":163998979103 - }, - { - "name":"飞书小程序", - "code":"mp-lark", - "order":14, - "enable":true, - "create_time":163998979103 - }, - { - "name":"京东小程序", - "code":"mp-jd", - "order":15, - "enable":true, - "create_time":163998979103 - }, - { - "name":"鸿蒙元服务", - "code":"mp-harmony", - "order":16, - "enable":true, - "create_time":163998979103 - } -] diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-platforms.schema.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-platforms.schema.json deleted file mode 100644 index 6c46b4f..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-platforms.schema.json +++ /dev/null @@ -1,46 +0,0 @@ -// 应用平台表 -{ - "bsonType": "object", - "description": "提供应用的平台字典", - "required": [], - "permission": { - "read": "'READ_UNI_STAT_APP_PLATFORMS' in auth.permission", - "create": false, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "code": { - "bsonType": "string", - "description": "平台代码,前端上报" - }, - "name": { - "bsonType": "string", - "description": "平台名称,管理端显示" - }, - "order": { - "bsonType": "int", - "description": "序号,前端页面排序使用", - "defaultValue": 0 - }, - "enable": { - "bsonType": "bool", - "description": "是否启动", - "defaultValue": true, - "enum": [{ - "text": "否", - "value": false - }, { - "text": "是", - "value": true - }] - }, - "create_time": { - "bsonType": "timestamp", - "description": "创建时间" - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-starttime-logs.index.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-starttime-logs.index.json deleted file mode 100644 index e9c1188..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-starttime-logs.index.json +++ /dev/null @@ -1,38 +0,0 @@ -[ - { - "IndexName": "date", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "date", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "appid", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "appid", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "platform", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "platform", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - } -] diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-starttime-logs.init_data.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-starttime-logs.init_data.json deleted file mode 100644 index fe51488..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-starttime-logs.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-starttime-logs.schema.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-starttime-logs.schema.json deleted file mode 100644 index 9cdcb52..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-starttime-logs.schema.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "bsonType": "object", - "required": [], - "description": "存储客户端上报的,应用在单位时间内的启动次数的数据", - "permission": { - "read": "'READ_UNI_STAT_EVENT_RESULT' in auth.permission", - "create": false, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "appid": { - "bsonType": "string", - "description": "用户端上报的应用ID" - }, - "platform": { - "bsonType": "string", - "description": "用户端上报的平台code" - }, - "date": { - "bsonType": "date", - "description": "日期" - }, - "st3": { - "bsonType": "int", - "description": "3秒内的启动次数" - }, - "st5": { - "bsonType": "int", - "description": "3-5秒内的启动次数" - }, - "st7": { - "bsonType": "int", - "description": "5-7秒内的启动次数" - }, - "st7m": { - "bsonType": "int", - "description": "7秒以上的启动次数" - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-versions.index.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-versions.index.json deleted file mode 100644 index 1e986cb..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-versions.index.json +++ /dev/null @@ -1,22 +0,0 @@ -[ - { - "IndexName": "index_search_version", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "appid", - "Direction": "1" - }, - { - "Name": "platform_id", - "Direction": "1" - }, - { - "Name": "version", - "Direction": "1" - } - ], - "MgoIsUnique": true - } - } -] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-versions.init_data.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-versions.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-versions.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-versions.schema.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-versions.schema.json deleted file mode 100644 index 3c7742f..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-app-versions.schema.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "bsonType": "object", - "description": "提供应用的版本号字典", - "required": [], - "permission": { - "read": false, - "create": false, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "appid": { - "bsonType": "string", - "description": "统计应用ID,对应opendb-app-list.appid", - "foreignKey": "opendb-app-list.appid" - }, - "platform_id": { - "bsonType": "string", - "description": "应用平台,对应uni-stat-app-platforms._id", - "foreignKey": "uni-stat-app-platforms._id" - }, - "version": { - "bsonType": "string", - "description": "应用版本" - }, - "create_time": { - "bsonType": "timestamp", - "description": "创建时间" - }, - "last_modify_time": { - "bsonType": "timestamp", - "description": "最后修改时间" - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-error-logs.index.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-error-logs.index.json deleted file mode 100644 index d322c99..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-error-logs.index.json +++ /dev/null @@ -1,75 +0,0 @@ -[ - { - "IndexName": "create_time", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "create_time", - "Direction": "1", - "Type": "long" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "appid", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "appid", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "version", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "version", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "platform", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "platform", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "channel", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "channel", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "error_hash", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "error_hash", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - } -] diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-error-logs.init_data.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-error-logs.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-error-logs.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-error-logs.schema.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-error-logs.schema.json deleted file mode 100644 index b117bec..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-error-logs.schema.json +++ /dev/null @@ -1,102 +0,0 @@ -// 应用错误日志表 -{ - "bsonType": "object", - "description": "记录上报的应用运行错误日志", - "required": [], - "permission": { - "read": "'READ_UNI_STAT_ERROR_LOGS' in auth.permission", - "create": false, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "appid": { - "bsonType": "string", - "description": "用户端上报的应用ID" - }, - "version": { - "bsonType": "string", - "description": "用户端上报的应用版本号" - }, - "platform": { - "bsonType": "string", - "description": "用户端上报的平台code" - }, - "channel": { - "bsonType": "string", - "description": "用户端上报的渠道code\/场景值" - }, - "error_type": { - "bsonType": "int", - "description": "错误类型", - "defaultValue": 0, - "enum": [{ - "text": "未知", - "value": 0 - }, { - "text": "表示webview页面js异常(uni-app项目对应vue页面)", - "value": 2 - }, { - "text": "表示uni框架js异常(仅uni-app项目)", - "value": 4 - }, { - "text": "表示控制页js异常(仅uni-app项目)", - "value": 5 - }, { - "text": "表示nvue页面js异常(仅uni-app项目)", - "value": 6 - }] - }, - "device_id": { - "bsonType": "string", - "description": "客户端携带的设备标识" - }, - "uid": { - "bsonType": "string", - "description": "用户编号, 对应uni-id-users._id" - }, - "os": { - "bsonType": "string", - "description": "客户端操作系统" - }, - "ua": { - "bsonType": "string", - "description": "客户端user-agent信息" - }, - "space_id": { - "bsonType": "string", - "description": "服务空间编号" - }, - "space_provider": { - "bsonType": "string", - "description": "服务空间提供商" - }, - "sdk_version": { - "bsonType": "string", - "description": "小程序基础库版本号" - }, - "platform_version": { - "bsonType": "string", - "description": "微信、支付宝宿主App的版本号" - }, - "error_msg": { - "bsonType": "string", - "description": "错误信息" - }, - "error_hash": { - "bsonType": "string", - "description": "错误hash码" - }, - "page_url": { - "bsonType": "string", - "description": "页面url" - }, - "create_time": { - "bsonType": "timestamp", - "description": "创建时间" - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-error-result.index.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-error-result.index.json deleted file mode 100644 index b793347..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-error-result.index.json +++ /dev/null @@ -1,75 +0,0 @@ -[ - { - "IndexName": "start_time", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "start_time", - "Direction": "1", - "Type": "long" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "appid", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "appid", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "version_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "version_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "platform_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "platform_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "channel_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "channel_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "dimension", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "dimension", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - } -] diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-error-result.init_data.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-error-result.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-error-result.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-error-result.schema.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-error-result.schema.json deleted file mode 100644 index 0bb60c2..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-error-result.schema.json +++ /dev/null @@ -1,96 +0,0 @@ -// 错误数据统计结果表 -{ - "bsonType": "object", - "description": "存储汇总的错误日志的数据", - "required": [], - "permission": { - "read": "'READ_UNI_STAT_ERROR_RESULT' in auth.permission", - "create": false, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "appid": { - "bsonType": "string", - "description": "应用ID" - }, - "platform_id": { - "bsonType": "string", - "description": "应用平台ID,对应uni-stat-app-platforms._id", - "foreignKey": "uni-stat-app-platforms._id" - }, - "channel_id": { - "bsonType": "string", - "description": "渠道\/场景值ID,对应uni-stat-app-channels._id", - "foreignKey": "uni-stat-app-channels._id" - }, - "version_id": { - "bsonType": "string", - "description": "应用版本ID,对应opendb-app-versions._id", - "foreignKey": "opendb-app-versions._id" - }, - "type": { - "bsonType": "string", - "description": "错误类型", - "enum": [{ - "text": "前端js错误", - "value": "js" - }, { - "text": "原生应用崩溃错误", - "value": "crash" - }] - }, - "hash": { - "bsonType": "string", - "description": "错误hash码" - }, - "msg": { - "bsonType": "string", - "description": "错误信息" - }, - "count": { - "bsonType":"int", - "description":"报错次数" - }, - "app_launch_count": { - "bsonType": "int", - "description": "本时间段App启动或从后台切到前台的次数" - }, - "last_time": { - "bsonType":"timestamp", - "description":"最近一次报错事件" - }, - "dimension": { - "bsonType": "string", - "description": "统计范围 day:按天统计,hour:按小时统计", - "enum": [{ - "text": "月", - "value": "month" - }, { - "text": "周", - "value": "week" - },{ - "text": "天", - "value": "day" - }, { - "text": "小时", - "value": "hour" - }] - }, - "stat_date":{ - "bsonType":"int", - "description":"统计日期,格式yyyymmdd,例:20211201" - }, - "start_time":{ - "bsonType":"timestamp", - "description":"开始时间" - }, - "end_time":{ - "bsonType":"timestamp", - "description":"结束时间" - } - } -} \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-error-source-map.index.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-error-source-map.index.json deleted file mode 100644 index 8b1e05b..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-error-source-map.index.json +++ /dev/null @@ -1,51 +0,0 @@ -[ - { - "IndexName": "appid", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "appid", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "base", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "base", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "cloud_path", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "cloud_path", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "create_time", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "create_time", - "Direction": "1", - "Type": "long" - } - ], - "MgoIsUnique": false - } - } -] diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-error-source-map.init_data.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-error-source-map.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-error-source-map.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-error-source-map.schema.ext.js b/sport-erp-admin/uniCloud-alipay/database/uni-stat-error-source-map.schema.ext.js deleted file mode 100644 index 556f31e..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-error-source-map.schema.ext.js +++ /dev/null @@ -1,29 +0,0 @@ -module.exports = { - trigger: { - // 监听 - 删除前 - beforeDelete: async function(obj = {}) { - let { - collection, - operation, - where, - field - } = obj; - // 删除表记录前先删除云存储内的文件 - const db = uniCloud.database(); - const _ = db.command; - let getRes = await db.collection("uni-stat-error-source-map").where(where).limit(1000).get(); - let list = getRes.data; - if (list && list.length > 0) { - let fileList = list.map((item, index) => { - return item.file_id; - }); - try { - let deleteFileRes = await uniCloud.deleteFile({ - fileList - }); - // console.log('deleteFileRes: ', deleteFileRes) - } catch (err) {} - } - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-error-source-map.schema.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-error-source-map.schema.json deleted file mode 100644 index 98b53ef..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-error-source-map.schema.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "bsonType": "object", - "description": "存储sourceMap文件资源地址", - "required": [], - "permission": { - "read": "'READ_UNI_STAT_ERROR_RESULT' in auth.permission", - "create": "'READ_UNI_STAT_ERROR_RESULT' in auth.permission", - "update": "'READ_UNI_STAT_ERROR_RESULT' in auth.permission", - "delete": "'READ_UNI_STAT_ERROR_RESULT' in auth.permission" - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "appid": { - "bsonType": "string", - "description": "应用ID" - }, - "uni_platform": { - "title": "应用平台", - "bsonType": "string", - "description": "uni客户端平台,如:web、mp-weixin、mp-alipay、app等", - "trim": "both" - }, - "version": { - "bsonType": "string", - "description": "客户端上报的应用版本号" - }, - "file_id": { - "bsonType": "string", - "description": "fileID" - }, - "url": { - "bsonType": "string", - "description": "文件外网url路径" - }, - "name": { - "bsonType": "string", - "description": "文件名" - }, - "size": { - "bsonType": "int", - "description": "文件大小" - }, - "cloud_path": { - "bsonType": "string", - "description": "云端路径,通过该值识别是否是同一个文件" - }, - "base": { - "bsonType": "string", - "description": "基础路径" - }, - "create_time": { - "bsonType": "timestamp", - "description": "上传时间", - "forceDefaultValue": { - "$env": "now" - } - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-event-logs.index.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-event-logs.index.json deleted file mode 100644 index f533d6f..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-event-logs.index.json +++ /dev/null @@ -1,87 +0,0 @@ -[ - { - "IndexName": "create_time", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "create_time", - "Direction": "1", - "Type": "long" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "appid", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "appid", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "version", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "version", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "platform", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "platform", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "channel", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "channel", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "event_key", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "event_key", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "uid", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "uid", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - } -] diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-event-logs.init_data.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-event-logs.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-event-logs.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-event-logs.schema.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-event-logs.schema.json deleted file mode 100644 index 2e109f0..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-event-logs.schema.json +++ /dev/null @@ -1,116 +0,0 @@ -// 应用事件日志表 -{ - "bsonType": "object", - "description": "记录上报的事件日志", - "required": [], - "permission": { - "read": "'READ_UNI_STAT_EVENT_LOGS' in auth.permission", - "create": false, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "appid": { - "bsonType": "string", - "description": "客户端上报的应用ID" - }, - "version": { - "bsonType": "string", - "description": "客户端上报的应用版本号" - }, - "platform": { - "bsonType": "string", - "foreignKey": "uni-stat-app-platforms.code", - "description": "客户端上报的平台code" - }, - "channel": { - "bsonType": "string", - "description": "客户端上报的渠道code\/场景值" - }, - "device_id": { - "bsonType": "string", - "description": "客户端携带的设备标识" - }, - "uid": { - "bsonType": "string", - "description": "用户编号, 对应uni-id-users._id" - }, - "session_id": { - "bsonType": "string", - "description": "访问会话日志ID,对应uni-stat-session-logs._id", - "foreignKey": "uni-stat-session-logs._id" - }, - "page_id": { - "bsonType": "string", - "description": "页面ID,对应uni-stat-pages._id", - "foreignKey": "uni-stat-pages._id" - }, - "event_key": { - "bsonType": "string", - "description": "客户端上报的key" - }, - "param": { - "bsonType": "string", - "description": "事件参数" - }, - "sdk_version": { - "bsonType": "string", - "description": "基础库版本号" - }, - "platform_version": { - "bsonType": "string", - "description": "平台版本,如微信、支付宝宿主App版本号" - }, - "device_os": { - "bsonType": "int", - "description": "设备系统编号,1:安卓,2:iOS,3:PC" - }, - "device_os_version": { - "bsonType": "string", - "description": "设备系统版本" - }, - "device_net": { - "bsonType": "string", - "description": "设备网络型号wifi\/3G\/4G\/" - }, - "device_vendor": { - "bsonType": "string", - "description": "设备供应商 " - }, - "device_model": { - "bsonType": "string", - "description": "设备型号" - }, - "device_language": { - "bsonType": "string", - "description": "设备语言包" - }, - "device_pixel_ratio": { - "bsonType": "string", - "description": "设备像素比 " - }, - "device_window_width": { - "bsonType": "string", - "description": "设备窗口宽度 " - }, - "device_window_height": { - "bsonType": "string", - "description": "设备窗口高度" - }, - "device_screen_width": { - "bsonType": "string", - "description": "设备屏幕宽度" - }, - "device_screen_height": { - "bsonType": "string", - "description": "设备屏幕高度" - }, - "create_time": { - "bsonType": "timestamp", - "description": "创建时间" - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-event-result.index.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-event-result.index.json deleted file mode 100644 index b793347..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-event-result.index.json +++ /dev/null @@ -1,75 +0,0 @@ -[ - { - "IndexName": "start_time", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "start_time", - "Direction": "1", - "Type": "long" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "appid", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "appid", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "version_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "version_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "platform_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "platform_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "channel_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "channel_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "dimension", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "dimension", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - } -] diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-event-result.init_data.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-event-result.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-event-result.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-event-result.schema.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-event-result.schema.json deleted file mode 100644 index c78dff7..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-event-result.schema.json +++ /dev/null @@ -1,82 +0,0 @@ -// 事件统计结果表 -{ - "bsonType": "object", - "description": "存储汇总的事件日志的数据", - "required": [], - "permission": { - "read": "'READ_UNI_STAT_EVENT_RESULT' in auth.permission", - "create": false, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "appid": { - "bsonType": "string", - "description": "应用ID" - }, - "platform_id": { - "bsonType": "string", - "description": "应用平台ID,对应uni-stat-app-platforms._id", - "foreignKey": "uni-stat-app-platforms._id" - }, - "channel_id": { - "bsonType": "string", - "description": "渠道\/场景值ID,对应uni-stat-app-channels._id", - "foreignKey": "uni-stat-app-channels._id" - }, - "version_id": { - "bsonType": "string", - "description": "应用版本ID,对应opendb-app-versions._id", - "foreignKey": "opendb-app-versions._id" - }, - "event_key": { - "bsonType": "string", - "description": "事件key,对应uni-stat-events.event_key", - "foreignKey": "uni-stat-events.event_key" - }, - "event_count": { - "bsonType": "int", - "description": "触发次数" - }, - "device_count": { - "bsonType": "int", - "description": "触发该事件的设备数" - }, - "user_count": { - "bsonType": "int", - "description": "触发该事件的用户数" - }, - "dimension": { - "bsonType": "string", - "description": "统计范围 day:按天统计,hour:按小时统计", - "enum": [{ - "text": "月", - "value": "month" - }, { - "text": "周", - "value": "week" - }, { - "text": "天", - "value": "day" - }, { - "text": "小时", - "value": "hour" - }] - }, - "stat_date": { - "bsonType": "int", - "description": "统计日期,格式yyyymmdd,例:20211201" - }, - "start_time": { - "bsonType": "timestamp", - "description": "开始时间" - }, - "end_time": { - "bsonType": "timestamp", - "description": "结束时间" - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-events.index.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-events.index.json deleted file mode 100644 index ab433d9..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-events.index.json +++ /dev/null @@ -1,18 +0,0 @@ -[ - { - "IndexName": "index_search_event", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "appid", - "Direction": "1" - }, - { - "Name": "event_key", - "Direction": "1" - } - ], - "MgoIsUnique": true - } - } -] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-events.init_data.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-events.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-events.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-events.schema.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-events.schema.json deleted file mode 100644 index f3c0d33..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-events.schema.json +++ /dev/null @@ -1,38 +0,0 @@ -// 应用事件表 -{ - "bsonType": "object", - "description": "提供应用的事件字典", - "required": [], - "permission": { - "read": "'READ_UNI_STAT_EVENTS' in auth.permission", - "create": false, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "appid": { - "bsonType": "string", - "description": "统计应用ID,对应opendb-app-list.appid", - "foreignKey": "opendb-app-list.appid" - }, - "event_key": { - "bsonType": "string", - "description": "事件键值" - }, - "event_name": { - "bsonType": "string", - "description": "事件名称" - }, - "create_time": { - "bsonType": "timestamp", - "description": "创建时间" - }, - "update_time": { - "bsonType": "timestamp", - "description": "last_modify_time" - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-loyalty-result.index.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-loyalty-result.index.json deleted file mode 100644 index b793347..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-loyalty-result.index.json +++ /dev/null @@ -1,75 +0,0 @@ -[ - { - "IndexName": "start_time", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "start_time", - "Direction": "1", - "Type": "long" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "appid", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "appid", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "version_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "version_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "platform_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "platform_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "channel_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "channel_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "dimension", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "dimension", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - } -] diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-loyalty-result.init_data.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-loyalty-result.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-loyalty-result.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-loyalty-result.schema.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-loyalty-result.schema.json deleted file mode 100644 index 37848b3..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-loyalty-result.schema.json +++ /dev/null @@ -1,84 +0,0 @@ -// 用户忠诚度统计表 -{ - "bsonType": "object", - "description": "存储汇总的设备/用户的粘性数据", - "required": [], - "permission": { - "read": "'READ_UNI_STAT_LOYALTY_RESULT' in auth.permission", - "create": false, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "appid": { - "bsonType": "string", - "description": "应用ID" - }, - "platform_id": { - "bsonType": "string", - "description": "应用平台ID,对应uni-stat-app-platforms._id", - "foreignKey": "uni-stat-app-platforms._id" - }, - "channel_id": { - "bsonType": "string", - "description": "渠道\/场景值ID,对应uni-stat-app-channels._id", - "foreignKey": "uni-stat-app-channels._id" - }, - "version_id": { - "bsonType": "string", - "description": "应用版本ID,对应opendb-app-versions._id", - "foreignKey": "opendb-app-versions._id" - }, - "visit_depth_data": { - "bsonType": "object", - "description": "访问深度数据", - "properties": { - "visit_users": { - "bsonType": "object", - "description": "访问用户数" - }, - "visit_devices": { - "bsonType": "object", - "description": "访问设备数" - }, - "visit_times": { - "bsonType": "object", - "description": "访问次数" - } - } - }, - "duration_data": { - "bsonType": "object", - "description": "访问时长数据", - "properties": { - "visit_users": { - "bsonType": "object", - "description": "访问用户数" - }, - "visit_devices": { - "bsonType": "object", - "description": "访问设备数" - }, - "visit_times": { - "bsonType": "object", - "description": "访问次数" - } - } - }, - "stat_date": { - "bsonType": "int", - "description": "统计日期,格式yyyymmdd,例:20211201" - }, - "start_time": { - "bsonType": "timestamp", - "description": "开始时间" - }, - "end_time": { - "bsonType": "timestamp", - "description": "结束时间" - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-mp-scenes.index.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-mp-scenes.index.json deleted file mode 100644 index f542bca..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-mp-scenes.index.json +++ /dev/null @@ -1,18 +0,0 @@ -[ - { - "IndexName": "index_search", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "platform", - "Direction": "1" - }, - { - "Name": "scene_code", - "Direction": "1" - } - ], - "MgoIsUnique": true - } - } -] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-mp-scenes.init_data.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-mp-scenes.init_data.json deleted file mode 100644 index 982124f..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-mp-scenes.init_data.json +++ /dev/null @@ -1,3246 +0,0 @@ -[{ - "platform": "android", - "scene_code": "1001", - "scene_name": "Android - 默认", - "create_time": 1726803752000 -}, { - "platform": "android", - "scene_code": "360", - "scene_name": "360应用市场", - "create_time": 1726803752000 -}, { - "platform": "android", - "scene_code": "google", - "scene_name": "GooglePlay", - "create_time": 1726803752000 -}, { - "platform": "android", - "scene_code": "huawei", - "scene_name": "华为应用商店", - "create_time": 1726803752000 -}, { - "platform": "android", - "scene_code": "oppo", - "scene_name": "oppo应用商店", - "create_time": 1726803752000 -}, { - "platform": "android", - "scene_code": "vivo", - "scene_name": "vivo应用商店", - "create_time": 1726803752000 -}, { - "platform": "android", - "scene_code": "xiaomi", - "scene_name": "小米应用商店", - "create_time": 1726803752000 -}, { - "platform": "android", - "scene_code": "yyb", - "scene_name": "应用宝", - "create_time": 1726803752000 -}, { - "platform": "ios", - "scene_code": "1001", - "scene_name": "iOS - 默认", - "create_time": 1726803752000 -}, { - "platform": "web", - "scene_code": "1001", - "scene_name": "Web - 默认", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1000", - "scene_name": "其他", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1001", - "scene_name": "发现页小程序「最近使用」列表(基础库2.2.4-2.29.0版本包含「我的小程序」列表,2.29.1版本起仅为「最近使用」列表)", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1005", - "scene_name": "微信首页顶部搜索框的搜索结果页", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1006", - "scene_name": "发现栏小程序主入口搜索框的搜索结果页", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1007", - "scene_name": "单人聊天会话中的小程序消息卡片", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1008", - "scene_name": "群聊会话中的小程序消息卡片", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1010", - "scene_name": "收藏夹", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1011", - "scene_name": "扫描二维码", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1012", - "scene_name": "长按图片识别二维码", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1013", - "scene_name": "扫描手机相册中选取的二维码", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1014", - "scene_name": "小程序订阅消息(与1107相同)", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1017", - "scene_name": "前往小程序体验版的入口页", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1019", - "scene_name": "微信钱包(微信客户端7.0.0版本改为支付入口)", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1020", - "scene_name": "公众号 profile 页相关小程序列表(已废弃)", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1022", - "scene_name": "聊天顶部置顶小程序入口(微信客户端6.6.1版本起废弃)", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1023", - "scene_name": "安卓系统桌面图标", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1024", - "scene_name": "小程序 profile 页", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1025", - "scene_name": "扫描一维码", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1026", - "scene_name": "发现栏小程序主入口,「附近的小程序」列表", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1027", - "scene_name": "微信首页顶部搜索框搜索结果页「使用过的小程序」列表", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1028", - "scene_name": "我的卡包", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1029", - "scene_name": "小程序中的卡券详情页", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1030", - "scene_name": "自动化测试下打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1031", - "scene_name": "长按图片识别一维码", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1032", - "scene_name": "扫描手机相册中选取的一维码", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1034", - "scene_name": "微信支付完成页", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1035", - "scene_name": "公众号自定义菜单", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1036", - "scene_name": "App 分享消息卡片", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1037", - "scene_name": "小程序打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1038", - "scene_name": "从另一个小程序返回", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1039", - "scene_name": "摇电视", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1042", - "scene_name": "添加好友搜索框的搜索结果页", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1043", - "scene_name": "公众号模板消息", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1044", - "scene_name": "带 shareTicket 的小程序消息卡片 详情", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1045", - "scene_name": "朋友圈广告", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1046", - "scene_name": "朋友圈广告详情页", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1047", - "scene_name": "扫描小程序码", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1048", - "scene_name": "长按图片识别小程序码", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1049", - "scene_name": "扫描手机相册中选取的小程序码", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1052", - "scene_name": "卡券的适用门店列表", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1053", - "scene_name": "搜一搜的结果页", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1054", - "scene_name": "顶部搜索框小程序快捷入口(微信客户端版本6.7.4起废弃)", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1056", - "scene_name": "聊天顶部音乐播放器右上角菜单", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1057", - "scene_name": "钱包中的银行卡详情页", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1058", - "scene_name": "公众号文章", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1059", - "scene_name": "体验版小程序绑定邀请页", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1060", - "scene_name": "微信支付完成页(与1034相同)", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1064", - "scene_name": "微信首页连Wi-Fi状态栏", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1065", - "scene_name": "URL scheme 详情", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1067", - "scene_name": "公众号文章广告", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1068", - "scene_name": "附近小程序列表广告(已废弃)", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1069", - "scene_name": "移动应用通过openSDK进入微信,打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1071", - "scene_name": "钱包中的银行卡列表页", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1072", - "scene_name": "二维码收款页面", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1073", - "scene_name": "客服消息列表下发的小程序消息卡片", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1074", - "scene_name": "公众号会话下发的小程序消息卡片", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1077", - "scene_name": "摇周边", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1078", - "scene_name": "微信连Wi-Fi成功提示页", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1079", - "scene_name": "微信游戏中心", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1081", - "scene_name": "客服消息下发的文字链", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1082", - "scene_name": "公众号会话下发的文字链", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1084", - "scene_name": "朋友圈广告原生页", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1088", - "scene_name": "会话中查看系统消息,打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1089", - "scene_name": "微信聊天主界面下拉,「最近使用」栏(基础库2.2.4-2.29.0版本包含「我的小程序」栏,2.29.1版本起仅为「最近使用」栏", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1090", - "scene_name": "长按小程序右上角菜单唤出最近使用历史", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1091", - "scene_name": "公众号文章商品卡片", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1092", - "scene_name": "城市服务入口", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1095", - "scene_name": "小程序广告组件", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1096", - "scene_name": "聊天记录,打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1097", - "scene_name": "微信支付签约原生页,打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1099", - "scene_name": "页面内嵌插件", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1100", - "scene_name": "红包封面详情页打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1101", - "scene_name": "远程调试热更新(开发者工具中,预览 -> 自动预览 -> 编译并预览)", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1102", - "scene_name": "公众号 profile 页服务预览", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1103", - "scene_name": "发现页小程序「我的小程序」列表(基础库2.2.4-2.29.0版本废弃,2.29.1版本起生效)", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1104", - "scene_name": "微信聊天主界面下拉,「我的小程序」栏(基础库2.2.4-2.29.0版本废弃,2.29.1版本起生效)", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1106", - "scene_name": "聊天主界面下拉,从顶部搜索结果页,打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1107", - "scene_name": "订阅消息,打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1113", - "scene_name": "安卓手机负一屏,打开小程序(三星)", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1114", - "scene_name": "安卓手机侧边栏,打开小程序(三星)", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1119", - "scene_name": "【企业微信】工作台内打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1120", - "scene_name": "【企业微信】个人资料页内打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1121", - "scene_name": "【企业微信】聊天加号附件框内打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1124", - "scene_name": "扫“一物一码”打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1125", - "scene_name": "长按图片识别“一物一码”", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1126", - "scene_name": "扫描手机相册中选取的“一物一码”", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1129", - "scene_name": "微信爬虫访问 详情", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1131", - "scene_name": "浮窗(8.0版本起仅包含被动浮窗)", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1133", - "scene_name": "硬件设备打开小程序 详情", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1135", - "scene_name": "小程序profile页相关小程序列表,打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1144", - "scene_name": "公众号文章 - 视频贴片", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1145", - "scene_name": "发现栏 - 发现小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1146", - "scene_name": "地理位置信息打开出行类小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1148", - "scene_name": "卡包-交通卡,打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1150", - "scene_name": "扫一扫商品条码结果页打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1151", - "scene_name": "发现栏 - 我的订单", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1152", - "scene_name": "订阅号视频打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1153", - "scene_name": "“识物”结果页打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1154", - "scene_name": "朋友圈内打开“单页模式”", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1155", - "scene_name": "“单页模式”打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1157", - "scene_name": "服务号会话页打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1158", - "scene_name": "群工具打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1160", - "scene_name": "群待办", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1167", - "scene_name": "H5 通过开放标签打开小程序 详情", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1168", - "scene_name": "移动", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1169", - "scene_name": "发现栏小程序主入口,各个生活服务入口(例如快递服务、出行服务等)", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1171", - "scene_name": "微信运动记录(仅安卓)", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1173", - "scene_name": "聊天素材用小程序打开 详情", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1175", - "scene_name": "视频号主页商店入口", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1176", - "scene_name": "视频号直播间主播打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1177", - "scene_name": "视频号直播商品", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1178", - "scene_name": "在电脑打开手机上打开的小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1179", - "scene_name": "话题页打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1181", - "scene_name": "网站应用打开PC小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1183", - "scene_name": "PC微信 - 小程序面板 - 发现小程序 - 搜索", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1184", - "scene_name": "视频号链接打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1185", - "scene_name": "群公告", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1186", - "scene_name": "收藏 - 笔记", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1187", - "scene_name": "浮窗(8.0版本起)", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1189", - "scene_name": "表情雨广告", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1191", - "scene_name": "视频号活动", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1192", - "scene_name": "企业微信联系人profile页", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1193", - "scene_name": "视频号主页服务菜单打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1194", - "scene_name": "URL Link 详情", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1195", - "scene_name": "视频号主页商品tab", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1196", - "scene_name": "个人状态打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1197", - "scene_name": "视频号主播从直播间返回小游戏", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1198", - "scene_name": "视频号开播界面打开小游戏", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1200", - "scene_name": "视频号广告打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1201", - "scene_name": "视频号广告详情页打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1202", - "scene_name": "企微客服号会话打开小程序卡片", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1203", - "scene_name": "微信小程序压测工具的请求", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1206", - "scene_name": "视频号小游戏直播间打开小游戏", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1207", - "scene_name": "企微客服号会话打开小程序文字链", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1208", - "scene_name": "聊天打开商品卡片", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1212", - "scene_name": "青少年模式申请页打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1215", - "scene_name": "广告预约打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1216", - "scene_name": "视频号订单中心打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1218", - "scene_name": "微信键盘预览打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1219", - "scene_name": "视频号直播间小游戏一键上车", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1220", - "scene_name": "发现页设备卡片打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1223", - "scene_name": "安卓桌面Widget打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1225", - "scene_name": "音视频通话打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1226", - "scene_name": "聊天消息在设备打开后打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1228", - "scene_name": "视频号原生广告组件打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1230", - "scene_name": "订阅号H5广告进入小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1231", - "scene_name": "动态消息提醒入口打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1232", - "scene_name": "搜一搜竞价广告打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1233", - "scene_name": "小程序搜索页人气游戏模块打开小游戏", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1238", - "scene_name": "看一看信息流广告打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1242", - "scene_name": "小程序发现页门店快送模块频道页进入小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1244", - "scene_name": "tag搜索结果页打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1245", - "scene_name": "小程序发现页门店快送搜索结果页进入小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1248", - "scene_name": "通过小程序账号迁移进入小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1252", - "scene_name": "搜一搜小程序搜索页「小功能」模块进入小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1254", - "scene_name": "发现页「动态」卡片 打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1255", - "scene_name": "发现页「我的」卡片 打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1256", - "scene_name": "pc端小程序面板「最近使用」列表", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1257", - "scene_name": "pc端小程序面板「我的小程序」列表", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1258", - "scene_name": "pc端小程序面板「为电脑端优化」模块", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1259", - "scene_name": "pc端小程序面板「小游戏专区」模块", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1260", - "scene_name": "pc端小程序面板「推荐在电脑端使用」列表", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1261", - "scene_name": "公众号返佣商品卡片", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1265", - "scene_name": "小程序图片详情页打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1266", - "scene_name": "小程序图片长按半屏入口打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1267", - "scene_name": "小程序图片会话角标打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1271", - "scene_name": "微信聊天主界面下拉,「我的常用小程序」栏 1272 发现页「游戏」服务tab打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1273", - "scene_name": "发现页「常用的小程序」列表", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1278", - "scene_name": "发现页「发现小程序」列表打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1279", - "scene_name": "发现页「发现小程序」合集页打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1280", - "scene_name": "下拉任务栏小程序垂搜「建议使用」打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1281", - "scene_name": "下拉任务栏小程序垂搜「发现小程序」打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1282", - "scene_name": "听一听播放器打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1285", - "scene_name": "发现页「发现小程序」短剧合集打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1286", - "scene_name": "明文scheme打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1287", - "scene_name": "公众号短剧贴片打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1292", - "scene_name": "发现页「发现小程序」poi 详情页打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1293", - "scene_name": "发现页短剧卡片追剧页打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1295", - "scene_name": "下拉任务栏小程序垂搜「发现小程序」广告打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1296", - "scene_name": "视频号付费短剧气泡打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1297", - "scene_name": "发现-小程序-搜索「发现小程序」打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1298", - "scene_name": "下拉任务栏小程序垂搜「发现小程序」打开的合集访问小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1299", - "scene_name": "下拉任务栏小程序垂搜「发现小程序」poi 详情页打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1300", - "scene_name": "发现-小程序-搜索「发现小程序」打开的合集访问小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1301", - "scene_name": "发现-小程序-搜索「发现小程序」poi 详情页打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1302", - "scene_name": "PC端面板「发现小程序」", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1303", - "scene_name": "发现页短剧卡片视频流打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1304", - "scene_name": "手机负一屏打开小程序(比如oppo手机)", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1305", - "scene_name": "公众号播放结束页打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1306", - "scene_name": "公众号短剧固定选集入口打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1307", - "scene_name": "发现页附近服务境外专区打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1308", - "scene_name": "PC端面板小游戏专区页面", - "create_time": 1726803752000 -}, { - "platform": "mp-weixin", - "scene_code": "1309", - "scene_name": "公众号文章打开小游戏CPS卡片", - "create_time": 1726803752000 -}, { - "platform": "mp-alipay", - "scene_code": "1000", - "scene_name": "首页十二宫格及更多", - "create_time": 1726803752000 -}, { - "platform": "mp-alipay", - "scene_code": "1002", - "scene_name": "我的小程序入口", - "create_time": 1726803752000 -}, { - "platform": "mp-alipay", - "scene_code": "1005", - "scene_name": "顶部搜索框的搜索结果页", - "create_time": 1726803752000 -}, { - "platform": "mp-alipay", - "scene_code": "1007", - "scene_name": "单人聊天会话中的小程序消息卡片(分享)", - "create_time": 1726803752000 -}, { - "platform": "mp-alipay", - "scene_code": "1011", - "scene_name": "扫描二维码", - "create_time": 1726803752000 -}, { - "platform": "mp-alipay", - "scene_code": "1014", - "scene_name": "小程序模版消息(服务提醒)", - "create_time": 1726803752000 -}, { - "platform": "mp-alipay", - "scene_code": "1020", - "scene_name": "生活号 profile 页相关小程序列表", - "create_time": 1726803752000 -}, { - "platform": "mp-alipay", - "scene_code": "1023", - "scene_name": "系统桌面图标", - "create_time": 1726803752000 -}, { - "platform": "mp-alipay", - "scene_code": "1037", - "scene_name": "小程序打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-alipay", - "scene_code": "1038", - "scene_name": "从另一个小程序返回", - "create_time": 1726803752000 -}, { - "platform": "mp-alipay", - "scene_code": "1200", - "scene_name": "市民中心(原城市服务频道)", - "create_time": 1726803752000 -}, { - "platform": "mp-alipay", - "scene_code": "1201", - "scene_name": "芝麻信用频道", - "create_time": 1726803752000 -}, { - "platform": "mp-alipay", - "scene_code": "1202", - "scene_name": "出行(原车主服务频道)", - "create_time": 1726803752000 -}, { - "platform": "mp-alipay", - "scene_code": "1209", - "scene_name": "支付宝会员频道", - "create_time": 1726803752000 -}, { - "platform": "mp-alipay", - "scene_code": "1400", - "scene_name": "付费流量(通过商家数字推广平台,灯火等投放的广告)", - "create_time": 1726803752000 -}, { - "platform": "mp-alipay", - "scene_code": "1401", - "scene_name": "卡包", - "create_time": 1726803752000 -}, { - "platform": "mp-alipay", - "scene_code": "1402", - "scene_name": "支付宝-我的", - "create_time": 1726803752000 -}, { - "platform": "mp-alipay", - "scene_code": "1403", - "scene_name": "支付成功页", - "create_time": 1726803752000 -}, { - "platform": "mp-alipay", - "scene_code": "1300", - "scene_name": "第三方 APP(如钉钉)打开,在跳转链接中传入访问来源参数:chInfo=ch_orderCenter,跳转链接拼接方法,参见小程序跳转 FAQ。", - "create_time": 1726803752000 -}, { - "platform": "mp-alipay", - "scene_code": "0", - "scene_name": "其他渠道场景渠道。", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "10810008", - "scene_name": "自然结果", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "10810009", - "scene_name": "阿拉丁", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "10810012", - "scene_name": "搜索词推荐直达", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "10810013", - "scene_name": "语音直达", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "10810014", - "scene_name": "小程序单卡", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "10810083", - "scene_name": "小程序 Tab", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "10810022", - "scene_name": "购物 Tab", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "10810023", - "scene_name": "职位 Tab", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "10810024", - "scene_name": "笔记 Tab", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "10910015", - "scene_name": "信息流直接推荐", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "10910016", - "scene_name": "落地页自动挂载", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "11110029", - "scene_name": "号文章挂载", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "11110030", - "scene_name": "号动态挂载", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "11110031", - "scene_name": "号动态挂载", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "11110032", - "scene_name": "号动态挂载", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "11410033", - "scene_name": "号个人主页", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "11410034", - "scene_name": "号个人主页", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "11410035", - "scene_name": "号个人主页", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "12010043", - "scene_name": "常用服务", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "12010044", - "scene_name": "顶部横划模块", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "12010045", - "scene_name": "历史", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "12010046", - "scene_name": "活动中心", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "12110047", - "scene_name": "推荐", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "12110048", - "scene_name": "历史", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "12300000", - "scene_name": "桌面快捷方式", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "12500000", - "scene_name": "系统多任务", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "11310021", - "scene_name": "服务消息", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "11310004", - "scene_name": "营销消息", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "11600000", - "scene_name": "分享", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "11700000", - "scene_name": "小程序打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "11800000", - "scene_name": "扫码", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "11010018", - "scene_name": "闪投", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "11010019", - "scene_name": "品专", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "11010072", - "scene_name": "品牌", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "11010020", - "scene_name": "原生", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "11010061", - "scene_name": "凤巢", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "11910037", - "scene_name": "各吧内挂载", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "11910038", - "scene_name": "贴吧内搜索结果", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "11910039", - "scene_name": "贴吧吧内分享", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "11910086", - "scene_name": "首页信息流", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "12410094", - "scene_name": "小程序游戏中心", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "12410095", - "scene_name": "NA 游戏中心", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "12410103", - "scene_name": "好看内游戏中心", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "12410104", - "scene_name": "全民内游戏中心", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "12410004", - "scene_name": "Lite 内游戏中心", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "12410005", - "scene_name": "贴吧内游戏中心", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "14010000", - "scene_name": "侃侃小游戏社区首页", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "14010001", - "scene_name": "游戏中心广场活动详情页", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "14010002", - "scene_name": "游戏中心广场热帖", - "create_time": 1726803752000 -}, { - "platform": "mp-baidu", - "scene_code": "NA", - "scene_name": "默认", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "1001", - "scene_name": "QQ主界面-下拉列表", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "1005", - "scene_name": "顶部搜索框搜索结果页「未使用过的小程序」列表", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "1007", - "scene_name": "单人聊天会话中的小程序消息卡片", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "1008", - "scene_name": "不带shareTicket的群聊会话中的小程序消息卡片", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "1011", - "scene_name": "扫描二维码", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "1012", - "scene_name": "长按图片识别二维码", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "1014", - "scene_name": "小程序模板消息", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "1023", - "scene_name": "安卓系统的桌面图标", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "1027", - "scene_name": "顶部搜索框搜索结果页「使用过的小程序」列表", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "1035", - "scene_name": "公众号自定义菜单", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "1036", - "scene_name": "App 分享消息卡片", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "1037", - "scene_name": "小程序打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "1038", - "scene_name": "从另一个小程序返回", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "1043", - "scene_name": "公众号模板消息", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "1044", - "scene_name": "带sharetTicket的群聊会话中的小程序消息卡片", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "1047", - "scene_name": "扫描小程序码", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "1048", - "scene_name": "长按图片识别小程序码", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "1069", - "scene_name": "移动应用", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "2001", - "scene_name": "应用中心", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "2003", - "scene_name": "打开分享在QQ空间中的小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "2005", - "scene_name": "垂直搜索", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "2010", - "scene_name": "群资料卡", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "2054", - "scene_name": "广告投放", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "2060", - "scene_name": "Qzone-说说列表页", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "2062", - "scene_name": "个人资料卡", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "2064", - "scene_name": "AIO-C2C亲密关系页", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "2076", - "scene_name": "Qzone-加号面板推荐", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "2080", - "scene_name": "手Qc2c场景(加号面板、灰条等)", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "2081", - "scene_name": "手Q群场景(加号面板、灰条等)", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "2085", - "scene_name": "长期订阅消息", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "2077", - "scene_name": "商店搜索", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "1131", - "scene_name": "普通彩签打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "2094", - "scene_name": "小游戏官方内页弹窗", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "2105", - "scene_name": "一次性订阅消息", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "3001", - "scene_name": "下拉桌面-最近在玩", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "3002", - "scene_name": "下拉桌面-好友在玩", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "3003", - "scene_name": "下拉桌面-我的小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "3008", - "scene_name": "下拉桌面-每日精品", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "3009", - "scene_name": "下拉桌面-好友pk榜", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "3016", - "scene_name": "下拉桌面-内容分发模块", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "4007", - "scene_name": "群左滑面板", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "4008", - "scene_name": "群aio快捷入口", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "4011", - "scene_name": "小游戏公众号", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "4012", - "scene_name": "小程序消息通过公众号下发", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "4013", - "scene_name": "在线状态面板", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "2113", - "scene_name": "小游戏关闭挽留弹窗", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "4014", - "scene_name": "AIO顶部title", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "4015", - "scene_name": "在线状态设置页", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "2009", - "scene_name": "QQ空间", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "2114", - "scene_name": "系统订阅消息", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "2065", - "scene_name": "扩列banner", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "3007", - "scene_name": "下拉桌面-大家在玩", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "3024", - "scene_name": "下拉桌面-搜索-大家在玩", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "1010", - "scene_name": "我的收藏", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "3015", - "scene_name": "下拉-猜你喜欢", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "3022", - "scene_name": "下拉桌面-好友PK(新)", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "4016", - "scene_name": "实时对战卡片-c2c场景", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "2072", - "scene_name": "实时对战ark邀约-群场景", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "4017", - "scene_name": "扩列aio快捷入口", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "3013", - "scene_name": "下拉-快速匹配", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "3026", - "scene_name": "下拉桌面-搜索-搜索结果", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "2102", - "scene_name": "QQ提醒", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "1132", - "scene_name": "最近浏览彩签打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "3030", - "scene_name": "下拉桌面-对战大厅", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "3010", - "scene_name": "下拉桌面-人气排行", - "create_time": 1726803752000 -}, { - "platform": "mp-qq", - "scene_code": "3012", - "scene_name": "下拉桌面-口碑最佳", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "场景值(字符串)​", - "scene_name": "入口概述​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "011004​", - "scene_name": "小程序中心-最近使用​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "011005​", - "scene_name": "小程序中心-收藏​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "011006​", - "scene_name": "小程序中心-发现​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "011007​", - "scene_name": "扫一扫​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "011008​", - "scene_name": "业务固定入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "011009​", - "scene_name": "小程序跳小程序​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "011010​", - "scene_name": "小程序返回小程序​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "011014​", - "scene_name": "我的-发现 12 宫格​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "011018​", - "scene_name": "音频入口浮窗​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "011019​", - "scene_name": "音频入口通知栏​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "011020​", - "scene_name": "小程序桌面快捷方式​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "011021​", - "scene_name": "我的-订单入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "012001​", - "scene_name": "小程序卡片搜索结果,直接搜索名字出来的结果​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "012002​", - "scene_name": "小程序中心搜索结果​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "012003​", - "scene_name": "搜索阿拉丁​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "012004​", - "scene_name": "自然搜索结果​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "012005​", - "scene_name": "搜索出 feed 中小程序内部文章​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "013001​", - "scene_name": "分享的微头条​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "013002​", - "scene_name": "小视频详情页入口-右侧 icon 样式​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "013003​", - "scene_name": "小视频详情页入口-左侧链接样式​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "013005​", - "scene_name": "文章详情页入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "013007​", - "scene_name": "话题详情页入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "013008​", - "scene_name": "头条号个人主页入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "013010​", - "scene_name": "发布的微头条​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "013013​", - "scene_name": "推荐-feed 流小程序卡片​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "014001​", - "scene_name": "微信对话​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "014002​", - "scene_name": "微信朋友圈​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "014003​", - "scene_name": "QQ 对话​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "014004​", - "scene_name": "Qzone​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "014005​", - "scene_name": "钉钉​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "014006​", - "scene_name": "系统分享​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "014007​", - "scene_name": "复制链接​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "014009​", - "scene_name": "口令分享​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "015001​", - "scene_name": "本地频道-频道顶部 widget​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "015002​", - "scene_name": "钱包入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "016001​", - "scene_name": "小程序广告入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "017001​", - "scene_name": "app 的推送​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "017002​", - "scene_name": "系统消息通知​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "017003​", - "scene_name": "客服能力;开发者与用户沟通​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "017004​", - "scene_name": "短信链接跳转小程序​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "场景值​", - "scene_name": "入口概述​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "021001​", - "scene_name": "我的-小程序​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "021002​", - "scene_name": "全局扫一扫​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "021003​", - "scene_name": "我的-收藏 tab 入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "021008​", - "scene_name": "业务固定入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "021009​", - "scene_name": "小程序跳小程序​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "021010​", - "scene_name": "小程序返回小程序​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "021013​", - "scene_name": "订单综合入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "021014​", - "scene_name": "发布页锚点入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "021017​", - "scene_name": "发布页入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "021018​", - "scene_name": "发布页添加团购组件入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "021020​", - "scene_name": "小程序桌面快捷方式​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "021025​", - "scene_name": "优惠券入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "021027​", - "scene_name": "钱包其他服务入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "021028​", - "scene_name": "钱包银行卡管理入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "021031​", - "scene_name": "福利中心​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "021036​", - "scene_name": "个人页搜索小程序入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "021037​", - "scene_name": "电影宣发工具​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "021039​", - "scene_name": "钱包福利专区入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "022001​", - "scene_name": "综合搜索-小程序入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "022002​", - "scene_name": "搜索阿拉丁​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "023001​", - "scene_name": "视频详情页​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "023002​", - "scene_name": "视频详情页评论区​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "023003​", - "scene_name": "企业号主页​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "023004​", - "scene_name": "垂直话题入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "023005​", - "scene_name": "POI 详情页入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "023006​", - "scene_name": "影视锚点详情页入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "023009​", - "scene_name": "直播间主播侧​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "023010​", - "scene_name": "直播间用户侧​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "023011​", - "scene_name": "直播间用户侧活动 banner 入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "023012​", - "scene_name": "直播间用户侧底部互动玩法入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "023014​", - "scene_name": "视频小说​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "023015​", - "scene_name": "视频文章​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "023016​", - "scene_name": "视频小程序卡片​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "023020​", - "scene_name": "POI 六分屏​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "023028​", - "scene_name": "城市POI入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "023029​", - "scene_name": "同城地图​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "023030​", - "scene_name": "关注页挂件​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "023040​", - "scene_name": "小程序异形卡​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "024001​", - "scene_name": "私信​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "024002​", - "scene_name": "微信对话​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "024003​", - "scene_name": "微信朋友圈​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "024004​", - "scene_name": "QQ 对话​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "024005​", - "scene_name": "Qzone​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "024007​", - "scene_name": "分享回流​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "024008​", - "scene_name": "口令分享​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "025001​", - "scene_name": "广告​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "026001​", - "scene_name": "banner​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "026002​", - "scene_name": "话题​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "026003​", - "scene_name": "push​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "026004​", - "scene_name": "notice,消息通知​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "026006​", - "scene_name": "企业号​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "026007​", - "scene_name": "我的 banner 入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "026018​", - "scene_name": "系统通知​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "027001​", - "scene_name": "种草页​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "027002​", - "scene_name": "橱窗入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "027003​", - "scene_name": "商品卡入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "027004​", - "scene_name": "直播间购物车商品​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "027005​", - "scene_name": "直播间购物车卡片​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "027006​", - "scene_name": "订单详情页​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "027007​", - "scene_name": "抖音商城​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "027008​", - "scene_name": "售后页入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "061001​", - "scene_name": "搜索页固定入口-上方最近使用​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "061002​", - "scene_name": "搜索页固定入口-上方推荐​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "061003​", - "scene_name": "搜索页固定入口-下方推荐​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "061004​", - "scene_name": "我的-小程序列表最近使用​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "061008​", - "scene_name": "业务固定入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "061009​", - "scene_name": "小程序跳小程序​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "061010​", - "scene_name": "小程序返回小程序​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "061020​", - "scene_name": "小程序桌面快捷方式​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "061021​", - "scene_name": "我的-订单入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "062001​", - "scene_name": "自然搜索结果,直接搜索名字出来的结果​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "062002​", - "scene_name": "小程序列表搜索结果 -> 小程序盒子搜索结果​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "062003​", - "scene_name": "搜索阿拉丁​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "062004​", - "scene_name": "站外搜索跳小程序​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "063012​", - "scene_name": "生活频道-小程序卡片​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "063013​", - "scene_name": "feed 流小程序卡片​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "065001​", - "scene_name": "频道顶部 widget​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "065002​", - "scene_name": "钱包入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "065003​", - "scene_name": "任务页-banner​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "067001​", - "scene_name": "​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "101001​", - "scene_name": "设置页面入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "101002​", - "scene_name": "扫一扫入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "101008​", - "scene_name": "售后页入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "101009​", - "scene_name": "小程序互跳​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "101010​", - "scene_name": "返回小程序​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "101020​", - "scene_name": "桌面图标​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "102005​", - "scene_name": "综合搜索​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "103001​", - "scene_name": "搜索视频-小程序锚点入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "103021​", - "scene_name": "同城顶部推荐入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "103025​", - "scene_name": "百科六分屏​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "104001​", - "scene_name": "微信分享​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "104007​", - "scene_name": "分享回流​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "105001​", - "scene_name": "激励广告​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "108013​", - "scene_name": "订单综合入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-toutiao", - "scene_code": "108014​", - "scene_name": "发布页锚点入口​", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011001", - "scene_name": "私信分享", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011002", - "scene_name": "小程序中心-最近使用", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011003", - "scene_name": "小程序中心-常用小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011004", - "scene_name": "搜索入口", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011005", - "scene_name": "扫一扫,可在开发者平台-设置 (opens new window)中获取小程序码", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011006", - "scene_name": "同城页信息流", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011007", - "scene_name": "发现页信息流", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011008", - "scene_name": "栏目信息流", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011009", - "scene_name": "视频左下角导流入口(短视频挂载)", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011010", - "scene_name": "模版消息", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011011", - "scene_name": "浮窗", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011012", - "scene_name": "profile 页", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011013", - "scene_name": "其他", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011014", - "scene_name": "开发者扫码预览", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011015", - "scene_name": "栏目作品专区", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011016", - "scene_name": "小程序 1 跳转至小程序 2", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011017", - "scene_name": "小程序中心-运营推荐", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011018", - "scene_name": "小程序广告投放", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011019", - "scene_name": "小程序中心我的收藏(页面)", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011020", - "scene_name": "聚星推广小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011021", - "scene_name": "桌面快捷方式", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011022", - "scene_name": "直播间小程序入口", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011023", - "scene_name": "侧边栏-稍后再看", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011024", - "scene_name": "POI详情页商品卡片", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011025", - "scene_name": "服务号页面", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011026", - "scene_name": "短信", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011028", - "scene_name": "直播间商品", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011029", - "scene_name": "放映厅", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011030", - "scene_name": "Push", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011031", - "scene_name": "订单通知", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011032", - "scene_name": "小程序中心-订单入口", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011033", - "scene_name": "运营活动", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011034", - "scene_name": "服务号", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011035", - "scene_name": "POI-附近团购", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011037", - "scene_name": "创作者中心", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011039", - "scene_name": "增长投放", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011040", - "scene_name": "发布短视频时,打开小程序添加PLC", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011041", - "scene_name": "直播开播前,打开小程序添加直播间入口", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011042", - "scene_name": "#话题标签页", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "011043", - "scene_name": "电商直播间", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021001", - "scene_name": "私信分享", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021002", - "scene_name": "小程序中心-最近使用", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021003", - "scene_name": "小程序中心-我的收藏", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021004", - "scene_name": "搜索入口", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021005", - "scene_name": "扫一扫,可在开发者平台-设置 (opens new window)中获取小程序码", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021006", - "scene_name": "同城页信息流", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021007", - "scene_name": "发现页信息流", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021009", - "scene_name": "视频左下角导流入口(短视频挂载)", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021010", - "scene_name": "模版消息", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021011", - "scene_name": "浮窗", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021012", - "scene_name": "profile 页", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021013", - "scene_name": "其他", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021014", - "scene_name": "开发者扫码预览", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021016", - "scene_name": "小程序 1 跳转至小程序 2", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021017", - "scene_name": "小程序中心-运营推荐", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021018", - "scene_name": "小程序广告投放", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021019", - "scene_name": "小程序中心我的收藏(页面)", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021020", - "scene_name": "聚星推广小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021021", - "scene_name": "桌面快捷方式", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021022", - "scene_name": "直播间小程序入口", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021023", - "scene_name": "侧边栏-稍后再看", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021024", - "scene_name": "POI详情页商品卡片", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021025", - "scene_name": "服务号页面", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021026", - "scene_name": "短信", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021028", - "scene_name": "直播间商品", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021029", - "scene_name": "放映厅", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021030", - "scene_name": "Push", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021031", - "scene_name": "订单通知", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021032", - "scene_name": "小程序中心-订单入口", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021033", - "scene_name": "运营活动", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021034", - "scene_name": "服务号", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021035", - "scene_name": "POI-附近团购", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021036", - "scene_name": "极速版金币活动固定资源位", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021037", - "scene_name": "创作者中心", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021039", - "scene_name": "增长投放", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021040", - "scene_name": "发布短视频时,打开小程序添加PLC", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021041", - "scene_name": "直播开播前,打开小程序添加直播间入口", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021042", - "scene_name": "#话题标签页", - "create_time": 1726803752000 -}, { - "platform": "mp-kuaishou", - "scene_code": "021043", - "scene_name": "电商直播间", - "create_time": 1726803752000 -}, { - "platform": "mp-lark", - "scene_code": "1000", - "scene_name": "尚未进行定义的场景", - "create_time": 1726803752000 -}, { - "platform": "mp-lark", - "scene_code": "1001", - "scene_name": "从应用中心主入口(应用中心首页和应用分类列表)打开", - "create_time": 1726803752000 -}, { - "platform": "mp-lark", - "scene_code": "1002", - "scene_name": "从会话列表的列表项打开", - "create_time": 1726803752000 -}, { - "platform": "mp-lark", - "scene_code": "1005", - "scene_name": "从全局搜索里搜出的结果卡片打开", - "create_time": 1726803752000 -}, { - "platform": "mp-lark", - "scene_code": "1007", - "scene_name": "从单人聊天会话中小程序消息卡片打开", - "create_time": 1726803752000 -}, { - "platform": "mp-lark", - "scene_code": "1008", - "scene_name": "从多人聊天会话中小程序消息卡片打开", - "create_time": 1726803752000 -}, { - "platform": "mp-lark", - "scene_code": "1009", - "scene_name": "从单人聊天会话里消息中链接或者按钮打开", - "create_time": 1726803752000 -}, { - "platform": "mp-lark", - "scene_code": "1010", - "scene_name": "从多人聊天会话里消息中链接或者按钮打开", - "create_time": 1726803752000 -}, { - "platform": "mp-lark", - "scene_code": "1011", - "scene_name": "通过扫描二维码打开", - "create_time": 1726803752000 -}, { - "platform": "mp-lark", - "scene_code": "1012", - "scene_name": "长按图片识别二维码", - "create_time": 1726803752000 -}, { - "platform": "mp-lark", - "scene_code": "1013", - "scene_name": "扫描手机相册中选取的二维码", - "create_time": 1726803752000 -}, { - "platform": "mp-lark", - "scene_code": "1024", - "scene_name": "从应用(小程序、机器人)profile 页打开", - "create_time": 1726803752000 -}, { - "platform": "mp-lark", - "scene_code": "1037", - "scene_name": "从一个小程序打开另一个小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-lark", - "scene_code": "1038", - "scene_name": "从另一个小程序返回", - "create_time": 1726803752000 -}, { - "platform": "mp-lark", - "scene_code": "1069", - "scene_name": "通过第三方应用打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-lark", - "scene_code": "1502", - "scene_name": "pc小程序的window模式中打开另一个小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-lark", - "scene_code": "1503", - "scene_name": "pc小程序的sidebar模式中打开另一个小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-lark", - "scene_code": "1504", - "scene_name": "通过IM的工具栏入口打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-lark", - "scene_code": "1505", - "scene_name": "在Mail打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-lark", - "scene_code": "1506", - "scene_name": "通过客户端的主导航入口打开小程序。注意:请在 Page 的生命周期获取该Scene。", - "create_time": 1726803752000 -}, { - "platform": "mp-lark", - "scene_code": "1507", - "scene_name": "通过客户端的快捷导航入口打开小程序。注意:请在 Page 的生命周期获取该Scene。", - "create_time": 1726803752000 -}, { - "platform": "mp-lark", - "scene_code": "1508", - "scene_name": "在一个小程序的主导航模式中操作打开另一个小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-lark", - "scene_code": "1509", - "scene_name": "从单聊的加号菜单中打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-lark", - "scene_code": "1510", - "scene_name": "从群聊的加号菜单中打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-lark", - "scene_code": "1511", - "scene_name": "消息卡片末尾应用标识链接打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-lark", - "scene_code": "1512", - "scene_name": "从appCenter模式切换至window模式", - "create_time": 1726803752000 -}, { - "platform": "mp-lark", - "scene_code": "1513", - "scene_name": "通过拦截web-url访问移动端小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-lark", - "scene_code": "1514", - "scene_name": "通过小组或小组详情页打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-lark", - "scene_code": "1515", - "scene_name": "移动端云空间打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-lark", - "scene_code": "1516", - "scene_name": "从消息快捷操作打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-lark", - "scene_code": "1517", - "scene_name": "从桌面快捷方式打开小程序", - "create_time": 1726803752000 -}, { - "platform": "mp-jd", - "scene_code": "001", - "scene_name": "首页焦点", - "create_time": 1726803752000 -}, { - "platform": "mp-jd", - "scene_code": "002", - "scene_name": "开屏页CPD", - "create_time": 1726803752000 -}, { - "platform": "mp-jd", - "scene_code": "003", - "scene_name": "首页推荐", - "create_time": 1726803752000 -}, { - "platform": "mp-jd", - "scene_code": "004", - "scene_name": "搜索结果SKU", - "create_time": 1726803752000 -}, { - "platform": "mp-jd", - "scene_code": "005", - "scene_name": "搜索结果顶部店铺", - "create_time": 1726803752000 -}, { - "platform": "mp-jd", - "scene_code": "006", - "scene_name": "搜索结果腰部店铺", - "create_time": 1726803752000 -}, { - "platform": "mp-jd", - "scene_code": "007", - "scene_name": "搜索直达CPD", - "create_time": 1726803752000 -}, { - "platform": "mp-jd", - "scene_code": "008", - "scene_name": "搜索霸屏CPD", - "create_time": 1726803752000 -}, { - "platform": "mp-jd", - "scene_code": "009", - "scene_name": "搜索浮层CPD", - "create_time": 1726803752000 -}, { - "platform": "mp-jd", - "scene_code": "010", - "scene_name": "首页焦点1固定位", - "create_time": 1726803752000 -}, { - "platform": "mp-jd", - "scene_code": "011", - "scene_name": "站内PUSH CPD", - "create_time": 1726803752000 -}, { - "platform": "mp-jd", - "scene_code": "051", - "scene_name": "搜索金刚", - "create_time": 1726803752000 -}, { - "platform": "mp-jd", - "scene_code": "1001", - "scene_name": "卡片", - "create_time": 1726803752000 -}, { - "platform": "mp-jd", - "scene_code": "1004", - "scene_name": "中心化入口-搜索结果", - "create_time": 1726803752000 -}, { - "platform": "mp-jd", - "scene_code": "1005", - "scene_name": "中心化入口-我的tab页-最近使用", - "create_time": 1726803752000 -}, { - "platform": "mp-jd", - "scene_code": "1006", - "scene_name": "中心化入口-我的tab页-我的关注", - "create_time": 1726803752000 -}, { - "platform": "mp-jd", - "scene_code": "1007", - "scene_name": "中心化入口-发现tab页-焦点图", - "create_time": 1726803752000 -}, { - "platform": "mp-jd", - "scene_code": "1012", - "scene_name": "中心化入口-发现tab页-精选推荐", - "create_time": 1726803752000 -}, { - "platform": "mp-jd", - "scene_code": "1013", - "scene_name": "开屏页", - "create_time": 1726803752000 -}, { - "platform": "mp-jd", - "scene_code": "1014", - "scene_name": "下拉二楼", - "create_time": 1726803752000 -}, { - "platform": "mp-jd", - "scene_code": "1015", - "scene_name": "搜索直达", - "create_time": 1726803752000 -}, { - "platform": "mp-jd", - "scene_code": "1016", - "scene_name": "默认搜索词", - "create_time": 1726803752000 -}, { - "platform": "mp-jd", - "scene_code": "1017", - "scene_name": "搜索结果", - "create_time": 1726803752000 -}, { - "platform": "mp-jd", - "scene_code": "1018", - "scene_name": "商详页-为你推荐", - "create_time": 1726803752000 -}, { - "platform": "mp-jd", - "scene_code": "1019", - "scene_name": "分类-图书文娱类目-热门推荐", - "create_time": 1726803752000 -}, { - "platform": "mp-jd", - "scene_code": "1020", - "scene_name": "购物车", - "create_time": 1726803752000 -}, { - "platform": "mp-jd", - "scene_code": "1021", - "scene_name": "订单列表页", - "create_time": 1726803752000 -}, { - "platform": "mp-jd", - "scene_code": "1022", - "scene_name": "首页焦点", - "create_time": 1726803752000 -}, { - "platform": "mp-jd", - "scene_code": "1023", - "scene_name": "店铺关注", - "create_time": 1726803752000 -}, { - "platform": "mp-jd", - "scene_code": "1024", - "scene_name": "首页通栏", - "create_time": 1726803752000 -}, { - "platform": "mp-jd", - "scene_code": "applets_share_back", - "scene_name": "分享中间页", - "create_time": 1726803752000 -}, { - "platform": "mp-360", - "scene_code": "1020", - "scene_name": "浏览器侧边栏", - "create_time": 1726803752000 -}, { - "platform": "mp-360", - "scene_code": "1030", - "scene_name": "桌面或消息推送", - "create_time": 1726803752000 -}, { - "platform": "mp-360", - "scene_code": "1053", - "scene_name": "商业化推广", - "create_time": 1726803752000 -}, { - "platform": "mp-360", - "scene_code": "1054", - "scene_name": "360搜索", - "create_time": 1726803752000 -}, { - "platform": "mp-360", - "scene_code": "1056", - "scene_name": "浏览器信息流", - "create_time": 1726803752000 -}, { - "platform": "mp-360", - "scene_code": "1057", - "scene_name": "小程序频道", - "create_time": 1726803752000 -}, { - "platform": "mp-360", - "scene_code": "1058", - "scene_name": "搜索问答频道", - "create_time": 1726803752000 -}, { - "platform": "mp-360", - "scene_code": "1010", - "scene_name": "小程序应用中心", - "create_time": 1726803752000 -}, { - "platform": "mp-360", - "scene_code": "1060", - "scene_name": "浏览器欢迎页", - "create_time": 1726803752000 -}, { - "platform": "mp-360", - "scene_code": "1061", - "scene_name": "小程序频道标题", - "create_time": 1726803752000 -}, { - "platform": "mp-360", - "scene_code": "1062", - "scene_name": "展示广告", - "create_time": 1726803752000 -}, { - "platform": "mp-360", - "scene_code": "1063", - "scene_name": "浏览器状态栏", - "create_time": 1726803752000 -}, { - "platform": "mp-360", - "scene_code": "1064", - "scene_name": "搜索广告", - "create_time": 1726803752000 -}, { - "platform": "mp-360", - "scene_code": "1065", - "scene_name": "新标签页内容", - "create_time": 1726803752000 -}, { - "platform": "mp-360", - "scene_code": "1066", - "scene_name": "新标签页名站", - "create_time": 1726803752000 -}, { - "platform": "mp-360", - "scene_code": "1067", - "scene_name": "浏览器搜索框", - "create_time": 1726803752000 -}, { - "platform": "mp-360", - "scene_code": "1069", - "scene_name": "游戏频道", - "create_time": 1726803752000 -}, { - "platform": "mp-360", - "scene_code": "2010", - "scene_name": "浏览器地址栏", - "create_time": 1726803752000 -}, { - "platform": "mp-360", - "scene_code": "1071", - "scene_name": "浏览器推广位1", - "create_time": 1726803752000 -}, { - "platform": "mp-360", - "scene_code": "1072", - "scene_name": "小程序分享", - "create_time": 1726803752000 -}, { - "platform": "mp-360", - "scene_code": "1074", - "scene_name": "360小贝", - "create_time": 1726803752000 -}, { - "platform": "mp-360", - "scene_code": "1075", - "scene_name": "360桌面助手", - "create_time": 1726803752000 -}, { - "platform": "mp-360", - "scene_code": "1076", - "scene_name": "搜索咨询频道", - "create_time": 1726803752000 -}, { - "platform": "mp-360", - "scene_code": "1078", - "scene_name": "锁屏画报", - "create_time": 1726803752000 -}, { - "platform": "mp-360", - "scene_code": "1079", - "scene_name": "智能推荐", - "create_time": 1726803752000 -}, { - "platform": "mp-360", - "scene_code": "1081", - "scene_name": "分享渠道", - "create_time": 1726803752000 -}, { - "platform": "mp-360", - "scene_code": "1082", - "scene_name": "浏览器推广位3", - "create_time": 1726803752000 -}, { - "platform": "mp-360", - "scene_code": "1083", - "scene_name": "浏览器推广位2", - "create_time": 1726803752000 -}, { - "platform": "mp-360", - "scene_code": "1090", - "scene_name": "QQ分享", - "create_time": 1726803752000 -}, { - "platform": "mp-360", - "scene_code": "1091", - "scene_name": "QQ空间分享", - "create_time": 1726803752000 -}, { - "platform": "mp-360", - "scene_code": "1092", - "scene_name": "微信分享", - "create_time": 1726803752000 -}, { - "platform": "mp-360", - "scene_code": "1093", - "scene_name": "口令分享", - "create_time": 1726803752000 -}] diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-mp-scenes.schema.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-mp-scenes.schema.json deleted file mode 100644 index c126cad..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-mp-scenes.schema.json +++ /dev/null @@ -1,34 +0,0 @@ -// 小程序场景值对照表 -{ - "bsonType": "object", - "description": "提供应用渠道和小程序场景值的数据字典", - "required": [], - "permission": { - "read": false, - "create": false, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "platform": { - "bsonType": "string", - "description": "应用平台,对应uni-stat-app-platforms.code", - "foreignKey": "uni-stat-app-platforms.code" - }, - "scene_code": { - "bsonType": "string", - "description": "场景代码" - }, - "scene_name": { - "bsonType": "string", - "description": "场景名称" - }, - "create_time": { - "bsonType": "timestamp", - "description": "创建时间" - } - } -} \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-detail-result.index.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-detail-result.index.json deleted file mode 100644 index d417de5..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-detail-result.index.json +++ /dev/null @@ -1,99 +0,0 @@ -[ - { - "IndexName": "start_time", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "start_time", - "Direction": "1", - "Type": "long" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "appid", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "appid", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "version_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "version_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "platform_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "platform_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "channel_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "channel_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "dimension", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "dimension", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "page_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "page_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "page_detail_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "page_detail_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - } -] diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-detail-result.init_data.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-detail-result.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-detail-result.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-detail-result.schema.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-detail-result.schema.json deleted file mode 100644 index 0f6d90b..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-detail-result.schema.json +++ /dev/null @@ -1,95 +0,0 @@ -// 页面内容统计结果表 -{ - "bsonType": "object", - "description": "存储汇总的页面内容访问数据", - "required": [], - "permission": { - "read": "'READ_UNI_STAT_PAGE_RESULT' in auth.permission", - "create": false, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "appid": { - "bsonType": "string", - "description": "应用ID" - }, - "platform_id": { - "bsonType": "string", - "description": "应用平台ID,对应uni-stat-app-platforms._id", - "foreignKey": "uni-stat-app-platforms._id" - }, - "channel_id": { - "bsonType": "string", - "description": "渠道\/场景值ID,对应uni-stat-app-channels._id", - "foreignKey": "uni-stat-app-channels._id" - }, - "version_id": { - "bsonType": "string", - "description": "应用版本ID,对应opendb-app-versions._id", - "foreignKey": "opendb-app-versions._id" - }, - "page_id": { - "bsonType": "string", - "description": "页面表ID,对应uni-stat-pages._id", - "foreignKey": "uni-stat-pages._id" - }, - "page_detail_id": { - "bsonType": "string", - "description": "页面详情表ID,对应uni-stat-page-details._id", - "foreignKey": "uni-stat-page-details._id" - }, - "visit_times": { - "bsonType": "int", - "description": "访问次数" - }, - "visit_devices": { - "bsonType": "int", - "description": "访问设备数" - }, - "visit_users": { - "bsonType": "int", - "description": "访问用户数" - }, - "duration": { - "bsonType": "int", - "description": "访问总时长,单位秒" - }, - "share_count": { - "bsonType": "int", - "description": "分享次数" - }, - "dimension": { - "bsonType": "string", - "description": "统计范围 day:按天统计,hour:按小时统计", - "enum": [{ - "text": "月", - "value": "month" - }, { - "text": "周", - "value": "week" - }, { - "text": "天", - "value": "day" - }, { - "text": "小时", - "value": "hour" - }] - }, - "stat_date": { - "bsonType": "int", - "description": "统计日期,格式yyyymmdd,例:20211201" - }, - "start_time": { - "bsonType": "timestamp", - "description": "开始时间" - }, - "end_time": { - "bsonType": "timestamp", - "description": "结束时间" - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-details.index.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-details.index.json deleted file mode 100644 index 6c007ec..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-details.index.json +++ /dev/null @@ -1,39 +0,0 @@ -[ - { - "IndexName": "create_time", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "create_time", - "Direction": "1", - "Type": "long" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "appid", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "appid", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "page_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "page_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - } -] diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-details.init_data.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-details.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-details.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-details.schema.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-details.schema.json deleted file mode 100644 index a0add8e..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-details.schema.json +++ /dev/null @@ -1,42 +0,0 @@ -// 应用页面详情表 -{ - "bsonType": "object", - "description": "记录上报的页面详情字典", - "required": [], - "permission": { - "read": "'READ_UNI_STAT_PAGE_LOGS' in auth.permission", - "create": false, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "appid": { - "bsonType": "string", - "description": "应用ID" - }, - "page_id": { - "bsonType": "string", - "description": "当前页面ID,对应uni-stat-pages._id", - "foreignKey": "uni-stat-pages._id" - }, - "page_link": { - "bsonType": "string", - "description": "页面链接,匹配并去除链接中无用参数后的url" - }, - "page_title": { - "bsonType": "string", - "description": "页面标题" - }, - "create_time": { - "bsonType": "timestamp", - "description": "创建时间" - }, - "update_time": { - "bsonType": "timestamp", - "description": "修改时间" - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-logs.index.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-logs.index.json deleted file mode 100644 index d0bd8a0..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-logs.index.json +++ /dev/null @@ -1,149 +0,0 @@ -[ - { - "IndexName": "create_time", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "create_time", - "Direction": "1", - "Type": "long" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "appid", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "appid", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "version", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "version", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "platform", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "platform", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "channel", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "channel", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "page_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "page_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "previous_page_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "previous_page_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "previous_page_is_entry", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "previous_page_is_entry", - "Direction": "1", - "Type": "int" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "uid", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "uid", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "page_detail_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "page_detail_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "previous_page_detail_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "previous_page_detail_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "previous_page_duration", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "previous_page_duration", - "Direction": "1", - "Type": "int" - } - ], - "MgoIsUnique": false - } - } -] diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-logs.init_data.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-logs.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-logs.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-logs.schema.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-logs.schema.json deleted file mode 100644 index fadd2a5..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-logs.schema.json +++ /dev/null @@ -1,90 +0,0 @@ -// 应用页面访问日志表 -{ - "bsonType": "object", - "description": "记录上报的页面访问日志", - "required": [], - "permission": { - "read": "'READ_UNI_STAT_PAGE_LOGS' in auth.permission", - "create": false, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "appid": { - "bsonType": "string", - "description": "应用ID" - }, - "version": { - "bsonType": "string", - "description": "用户端上报的应用版本号" - }, - "platform": { - "bsonType": "string", - "description": "用户端上报的平台code" - }, - "channel": { - "bsonType": "string", - "description": "用户端上报的渠道code\/场景值" - }, - "device_id": { - "bsonType": "string", - "description": "客户端携带的设备标识" - }, - "uid": { - "bsonType": "string", - "description": "用户编号, 对应uni-id-users._id" - }, - "session_id": { - "bsonType": "string", - "description": "访问会话日志ID,对应uni-stat-session-logs._id", - "foreignKey": "uni-stat-session-logs._id" - }, - "page_id": { - "bsonType": "string", - "description": "当前页面ID,对应uni-stat-pages._id", - "foreignKey": "uni-stat-pages._id" - }, - "page_detail_id": { - "bsonType": "string", - "description": "页面详情表ID,对应uni-stat-page-details._id", - "foreignKey": "uni-stat-page-details._id" - }, - "previous_page_id": { - "bsonType": "string", - "description": "上级页面ID,为空表示第一个页面, 对应uni-stat-pages._id", - "foreignKey": "uni-stat-pages._id" - }, - "previous_page_detail_id": { - "bsonType": "string", - "description": "上级页面详情表ID,对应uni-stat-page-details._id", - "foreignKey": "uni-stat-page-details._id" - }, - "previous_page_duration": { - "bsonType": "int", - "description": "上级页面停留时间,单位秒,前端上报" - }, - "previous_page_is_entry": { - "bsonType": "int", - "defaultValue": 0, - "description": " 上级页面是否为入口页, 0否 1是", - "enum": [{ - "text": "否", - "value": 0 - }, { - "text": "是", - "value": 1 - }] - }, - "query_string": { - "bsonType": "string", - "description": "页面参数" - }, - "create_time": { - "bsonType": "timestamp", - "description": "创建时间" - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-result.index.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-result.index.json deleted file mode 100644 index 59f5c34..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-result.index.json +++ /dev/null @@ -1,101 +0,0 @@ -[ - { - "IndexName": "start_time", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "start_time", - "Direction": "1", - "Type": "long" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "appid", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "appid", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "version_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "version_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "platform_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "platform_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "channel_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "channel_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "dimension", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "dimension", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "entry_count", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "entry_count", - "Direction": "1", - "Type": "int" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "visit_times", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "visit_times", - "Direction": "1", - "Type": "int" - } - ], - "MgoIsUnique": false - } - } -] diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-result.init_data.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-result.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-result.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-result.schema.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-result.schema.json deleted file mode 100644 index 72065c2..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-page-result.schema.json +++ /dev/null @@ -1,114 +0,0 @@ -// 页面统计结果表 -{ - "bsonType": "object", - "description": "存储汇总的页面访问日志的数据", - "required": [], - "permission": { - "read": "'READ_UNI_STAT_PAGE_RESULT' in auth.permission", - "create": false, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "appid": { - "bsonType": "string", - "description": "应用ID" - }, - "platform_id": { - "bsonType": "string", - "description": "应用平台ID,对应uni-stat-app-platforms._id", - "foreignKey": "uni-stat-app-platforms._id" - }, - "channel_id": { - "bsonType": "string", - "description": "渠道\/场景值ID,对应uni-stat-app-channels._id", - "foreignKey": "uni-stat-app-channels._id" - }, - "version_id": { - "bsonType": "string", - "description": "应用版本ID,对应opendb-app-versions._id", - "foreignKey": "opendb-app-versions._id" - }, - "page_id": { - "bsonType": "string", - "description": "页面表ID,对应页面表ID,对应uni-stat-pages._id", - "foreignKey": "uni-stat-pages._id" - }, - "visit_times": { - "bsonType": "int", - "description": "访问次数" - }, - "visit_devices": { - "bsonType": "int", - "description": "访问设备数" - }, - "exit_times": { - "bsonType": "int", - "description": "退出次数" - }, - "duration": { - "bsonType": "int", - "description": "访问总时长,单位秒" - }, - "share_count": { - "bsonType": "int", - "description": "分享次数" - }, - "entry_devices": { - "bsonType": "int", - "description": "当前页作为入口页的设备数" - }, - "entry_users": { - "bsonType": "int", - "description": "当前页作为入口页的用户数" - }, - "entry_count": { - "bsonType": "int", - "description": "当前页作为入口页的总次数" - }, - "entry_duration": { - "bsonType": "int", - "description": "当前页作为入口时,本页面的总访问时长,单位秒" - }, - "bounce_times": { - "bsonType": "int", - "description": "跳出次数" - }, - "bounce_rate": { - "bsonType": "double", - "description": "跳出率" - }, - "dimension": { - "bsonType": "string", - "description": "统计范围 day:按天统计,hour:按小时统计", - "enum": [{ - "text": "月", - "value": "month" - }, { - "text": "周", - "value": "week" - }, { - "text": "天", - "value": "day" - }, { - "text": "小时", - "value": "hour" - }] - }, - "stat_date": { - "bsonType": "int", - "description": "统计日期,格式yyyymmdd,例:20211201" - }, - "start_time": { - "bsonType": "timestamp", - "description": "开始时间" - }, - "end_time": { - "bsonType": "timestamp", - "description": "结束时间" - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-pages.index.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-pages.index.json deleted file mode 100644 index e799702..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-pages.index.json +++ /dev/null @@ -1,18 +0,0 @@ -[ - { - "IndexName": "index_search_page", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "appid", - "Direction": "1" - }, - { - "Name": "path", - "Direction": "1" - } - ], - "MgoIsUnique": true - } - } -] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-pages.init_data.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-pages.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-pages.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-pages.schema.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-pages.schema.json deleted file mode 100644 index b1c871b..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-pages.schema.json +++ /dev/null @@ -1,38 +0,0 @@ -// 应用页面表 -{ - "bsonType": "object", - "description": "提供应用的页面字典", - "required": [], - "permission": { - "read": "'READ_UNI_STAT_PAGES' in auth.permission", - "create": false, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "appid": { - "bsonType": "string", - "description": "统计应用ID,对应opendb-app-list.appid", - "foreignKey": "opendb-app-list.appid" - }, - "path": { - "bsonType": "string", - "description": "页面路径,如`\/pages\/index\/index`" - }, - "title": { - "bsonType": "string", - "description": "页面标题" - }, - "page_rules": { - "bsonType": "array", - "description": "页面规则,每个页面最多设置5个,例:[['id','page'],['sid']]" - }, - "create_time": { - "bsonType": "timestamp", - "description": "创建时间" - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-pay-result.index.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-pay-result.index.json deleted file mode 100644 index 3c0ca1f..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-pay-result.index.json +++ /dev/null @@ -1,113 +0,0 @@ -[ - { - "IndexName": "appid", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "appid", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "platform_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "platform_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "channel_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "channel_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "version_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "version_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "dimension", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "dimension", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "create_date", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "create_date", - "Direction": "1", - "Type": "long" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "start_time", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "start_time", - "Direction": "1", - "Type": "long" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "end_time", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "end_time", - "Direction": "1", - "Type": "long" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "stat_date.date_str", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "stat_date.date_str", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - } -] diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-pay-result.init_data.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-pay-result.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-pay-result.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-pay-result.schema.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-pay-result.schema.json deleted file mode 100644 index e7ef7bd..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-pay-result.schema.json +++ /dev/null @@ -1,169 +0,0 @@ -{ - "bsonType": "object", - "description": "存储统计汇总的支付数据", - "required": [], - "permission": { - "read": "'READ_UNI_STAT_PAY' in auth.permission", - "create": false, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "appid": { - "bsonType": "string", - "description": "应用ID,对应opendb-app-list.appid", - "foreignKey": "opendb-app-list.appid" - }, - "platform_id": { - "bsonType": "string", - "description": "应用平台ID,对应uni-stat-app-platforms._id", - "foreignKey": "uni-stat-app-platforms._id" - }, - "channel_id": { - "bsonType": "string", - "description": "渠道/场景值ID,对应uni-stat-app-channels._id", - "foreignKey": "uni-stat-app-channels._id" - }, - "version_id": { - "bsonType": "string", - "description": "应用版本ID,对应opendb-app-versions._id", - "foreignKey": "opendb-app-versions._id" - }, - "pay_total_amount": { - "bsonType": "int", - "description": "支付金额:统计时间内,成功支付的订单金额之和(不剔除退款订单)。单位分。" - }, - "pay_order_count": { - "bsonType": "int", - "description": "支付笔数:统计时间内,成功支付的订单数,一个订单对应唯一一个订单号。(不剔除退款订单。)" - }, - "pay_user_count": { - "bsonType": "int", - "description": "支付人数:统计时间内,成功支付的人数(不剔除退款订单)。" - }, - "pay_device_count": { - "bsonType": "int", - "description": "支付设备数:统计时间内,成功支付的设备数(不剔除退款订单)。" - }, - "create_total_amount": { - "bsonType": "int", - "description": "下单金额:统计时间内,成功下单的订单金额(不剔除退款订单)。单位分。" - }, - "create_order_count": { - "bsonType": "int", - "description": "下单笔数:统计时间内,成功下单的订单笔数(不剔除退款订单)。" - }, - "create_user_count": { - "bsonType": "int", - "description": "下单人数:统计时间内,成功下单的客户数,一人多次下单记为一人(不剔除退款订单)。" - }, - "create_device_count": { - "bsonType": "int", - "description": "下单设备数:统计时间内,成功下单的设备数,一台设备多次访问被计为一台(不剔除退款订单)。" - }, - "refund_total_amount": { - "bsonType": "int", - "description": "成功退款金额:统计时间内,成功退款的金额。以成功退款时间点为准。单位分。" - }, - "refund_order_count": { - "bsonType": "int", - "description": "成功退款订单数:统计时间内,成功退款的订单数。以成功退款时间点为准。" - }, - "refund_user_count": { - "bsonType": "int", - "description": "成功退款人数:统计时间内,成功退款的人数(不剔除退款订单)。" - }, - "refund_device_count": { - "bsonType": "int", - "description": "成功退款设备数:统计时间内,成功退款的设备数(不剔除退款订单)。" - }, - "activity_user_count": { - "bsonType": "int", - "description": "访问人数:统计时间内,访问人数,一人多次访问被计为一人(只统计已登录的用户)。" - }, - "activity_device_count": { - "bsonType": "int", - "description": "访问设备数:统计时间内,访问设备数,一台设备多次访问被计为一台(包含未登录的用户)。" - }, - "new_user_count": { - "bsonType": "int", - "description": "新增注册人数:统计时间内,注册人数。" - }, - "new_device_count": { - "bsonType": "int", - "description": "新增新设备数:统计时间内,新设备数。" - }, - "new_user_create_order_count": { - "bsonType": "int", - "description": "新用户下单人数:统计时间内,新增注册人数中下单的人数。" - }, - "new_user_pay_order_count": { - "bsonType": "int", - "description": "新用户支付人数:统计时间内,新增注册人数中下成功支付的人数。" - }, - "dimension": { - "bsonType": "string", - "description": "统计范围 hour:按小时统计,day:按天统计,week:按周统计,month:按月统计 quarter:按季度统计 year:按年统计", - "enum": [{ - "text": "年", - "value": "year" - }, { - "text": "季度", - "value": "quarter" - }, { - "text": "月", - "value": "month" - }, { - "text": "周", - "value": "week" - }, { - "text": "天", - "value": "day" - }, { - "text": "小时", - "value": "hour" - }] - }, - "create_date": { - "bsonType": "timestamp", - "description": "创建时间" - }, - "start_time": { - "bsonType": "timestamp", - "description": "统计开始时间" - }, - "end_time": { - "bsonType": "timestamp", - "description": "统计结束时间" - }, - "stat_date": { - "bsonType": "object", - "description": "统计日期参数", - "properties": { - "date_str": { - "bsonType": "string", - "description": "如:2021-07-27" - }, - "year": { - "bsonType": "int", - "description": "年" - }, - "month": { - "bsonType": "int", - "description": "月" - }, - "day": { - "bsonType": "int", - "description": "日" - }, - "hour": { - "bsonType": "int", - "description": "时" - } - } - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-result.index.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-result.index.json deleted file mode 100644 index b793347..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-result.index.json +++ /dev/null @@ -1,75 +0,0 @@ -[ - { - "IndexName": "start_time", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "start_time", - "Direction": "1", - "Type": "long" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "appid", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "appid", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "version_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "version_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "platform_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "platform_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "channel_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "channel_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "dimension", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "dimension", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - } -] diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-result.init_data.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-result.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-result.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-result.schema.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-result.schema.json deleted file mode 100644 index 53edd17..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-result.schema.json +++ /dev/null @@ -1,156 +0,0 @@ -// 应用统计结果表 -{ - "bsonType": "object", - "description": "存储统计汇总的会话数据包括不限于设备\/用户的数量、访问量、活跃度(日活、周活、月活)、留存率(日留存、周留存、月留存)、跳出率、访问时长等数据", - "required": [], - "permission": { - "read": "'READ_UNI_STAT_RESULT' in auth.permission", - "create": false, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "appid": { - "bsonType": "string", - "description": "应用ID,对应opendb-app-list.appid", - "foreignKey": "opendb-app-list.appid" - }, - "platform_id": { - "bsonType": "string", - "description": "应用平台ID,对应uni-stat-app-platforms._id", - "foreignKey": "uni-stat-app-platforms._id" - }, - "channel_id": { - "bsonType": "string", - "description": "渠道\/场景值ID,对应uni-stat-app-channels._id", - "foreignKey": "uni-stat-app-channels._id" - }, - "version_id": { - "bsonType": "string", - "description": "应用版本ID,对应opendb-app-versions._id", - "foreignKey": "opendb-app-versions._id" - }, - "total_users": { - "bsonType": "int", - "description": "历史累计总用户数" - }, - "new_user_count": { - "bsonType": "int", - "description": "本时间段新增用户数" - }, - "active_user_count": { - "bsonType": "int", - "description": "本时间段活跃用户数" - }, - "total_devices": { - "bsonType": "int", - "description": "历史累计总设备数" - }, - "new_device_count": { - "bsonType": "int", - "description": "本时间段新增设备数" - }, - "user_session_times": { - "bsonType": "int", - "description": "本时间段用户的会话次数" - }, - "active_device_count": { - "bsonType": "int", - "description": "本时间段活跃设备数" - }, - "app_launch_count": { - "bsonType": "int", - "description": "本时间段App启动或从后台切到前台的次数" - }, - "error_count": { - "bsonType": "int", - "description": "本时间段报错次数" - }, - "duration": { - "bsonType": "int", - "description": "时间段内,所有会话访问总时长,单位秒" - }, - "user_duration": { - "bsonType": "int", - "description": "本次登录用户的会话总时长,单位为秒" - }, - "avg_device_session_time": { - "bsonType": "int", - "description": "设备的次均停留时长,单位秒" - }, - "avg_device_time": { - "bsonType": "int", - "defaultValue": "设均停留时长(平均每台设备的停留时长),单位秒" - }, - "avg_user_session_time": { - "bsonType": "int", - "description": "用户的次均停留时长,单位秒" - }, - "avg_user_time": { - "bsonType": "int", - "defaultValue": "人均停留时长(平均每个登录用户的停留时长),单位秒" - }, - "bounce_times": { - "bsonType": "int", - "description": "跳出次数" - }, - "bounce_rate": { - "bsonType": "double", - "description": "跳出率" - }, - "retention": { - "bsonType": "object", - "description": "留存信息", - "properties": { - "active_user": { - "bsonType": "object", - "description": "活跃用户留存信息" - }, - "new_user": { - "bsonType": "object", - "description": "新增用户留存信息" - }, - "active_device": { - "bsonType": "object", - "description": "活跃设备留存信息" - }, - "new_device": { - "bsonType": "object", - "description": "新增设备留存信息" - } - } - }, - "dimension": { - "bsonType": "string", - "description": "统计范围 day:按天统计,hour:按小时统计", - "enum": [{ - "text": "月", - "value": "month" - }, { - "text": "周", - "value": "week" - }, { - "text": "天", - "value": "day" - }, { - "text": "小时", - "value": "hour" - }] - }, - "stat_date": { - "bsonType": "int", - "description": "统计日期,格式yyyymmdd,例:20211201" - }, - "start_time": { - "bsonType": "timestamp", - "description": "开始时间" - }, - "end_time": { - "bsonType": "timestamp", - "description": "结束时间" - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-run-errors.init_data.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-run-errors.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-run-errors.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-run-errors.schema.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-run-errors.schema.json deleted file mode 100644 index 8dfecb3..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-run-errors.schema.json +++ /dev/null @@ -1,33 +0,0 @@ -// 运行错误日志表 -{ - "bsonType": "object", - "description": "记录数据统计时运行出错的日志", - "required": [], - "permission": { - "read": false, - "create": false, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "mod": { - "bsonType": "string", - "description": "运行模块" - }, - "params": { - "bsonType": "object", - "description": "运行参数" - }, - "error": { - "bsonType": "string", - "description": "错误信息" - }, - "create_time": { - "bsonType": "timestamp", - "description": "创建时间" - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-session-logs.index.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-session-logs.index.json deleted file mode 100644 index 0386f5e..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-session-logs.index.json +++ /dev/null @@ -1,163 +0,0 @@ -[ - { - "IndexName": "create_time", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "create_time", - "Direction": "1", - "Type": "long" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "appid", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "appid", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "version", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "version", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "platform", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "platform", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "channel", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "channel", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "device_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "device_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "is_first_visit", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "is_first_visit", - "Direction": "1", - "Type": "int" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "page_count", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "page_count", - "Direction": "1", - "Type": "int" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "duration", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "duration", - "Direction": "1", - "Type": "int" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "old_device_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "old_device_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "is_finish", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "is_finish", - "Direction": "1", - "Type": "int" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "exit_page_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "exit_page_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "entry_page_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "entry_page_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - } -] diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-session-logs.init_data.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-session-logs.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-session-logs.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-session-logs.schema.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-session-logs.schema.json deleted file mode 100644 index 352c3f1..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-session-logs.schema.json +++ /dev/null @@ -1,192 +0,0 @@ -// 应用会话日志表 -{ - "bsonType": "object", - "description": "记录设备访问时产生的会话日志", - "required": [], - "permission": { - "read": false, - "create": false, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "appid": { - "bsonType": "string", - "description": "客户端上报的应用ID" - }, - "version": { - "bsonType": "string", - "description": "客户端上报的应用版本号" - }, - "platform": { - "bsonType": "string", - "description": "客户端上报的平台code" - }, - "channel": { - "bsonType": "string", - "description": "客户端上报的渠道code\/场景值" - }, - "type": { - "bsonType": "string", - "description": "会话类型", - "defaultValue": 1, - "enum": [{ - "text": "正常进入上报", - "value": 1 - }, { - "text": "后台进前台超时上报", - "value": 2 - }, { - "text": "页面停留超时上报", - "value": 3 - }] - }, - "device_id": { - "bsonType": "string", - "description": "客户端携带的设备标识" - }, - "last_visit_user_id": { - "bsonType": "string", - "description": "本次会话最终访问用户的ID, uni-id-users._id,客户端上报" - }, - "is_first_visit": { - "bsonType": "int", - "description": "是否为首次访问", - "defaultValue": 0, - "enum": [{ - "text": "否", - "value": 0 - }, { - "text": "是", - "value": 1 - }] - }, - "first_visit_time": { - "bsonType": "timestamp", - "description": "用户首次访问时间" - }, - "last_visit_time": { - "bsonType": "timestamp", - "description": "用户最后一次访问时间" - }, - "total_visit_count": { - "bsonType": "int", - "description": "用户累计访问次数,客户端上报" - }, - "entry_page_id": { - "bsonType": "string", - "description": "本次会话入口页面ID, 同uni-stat-pagesd" - }, - "exit_page_id": { - "bsonType": "string", - "description": "本次会话退出页面ID, 同uni-stat-pagesd" - }, - "page_count": { - "bsonType": "int", - "description": "本次会话浏览的页面数" - }, - "event_count": { - "bsonType": "int", - "description": "本次会话产生的事件数" - }, - "duration": { - "bsonType": "int", - "description": "本次会话时长,单位为秒,服务端计算" - }, - "sdk_version": { - "bsonType": "string", - "description": "基础库版本号" - }, - "platform_version": { - "bsonType": "string", - "description": "平台版本,如微信、支付宝宿主App版本号" - }, - "device_os": { - "bsonType": "int", - "description": "设备系统编号,1:安卓,2:iOS,3:PC" - }, - "device_os_version": { - "bsonType": "string", - "description": "设备系统版本" - }, - "device_net": { - "bsonType": "string", - "description": "设备网络型号wifi\/3G\/4G\/" - }, - "device_vendor": { - "bsonType": "string", - "description": "设备供应商 " - }, - "device_model": { - "bsonType": "string", - "description": "设备型号" - }, - "device_language": { - "bsonType": "string", - "description": "设备语言包" - }, - "device_pixel_ratio": { - "bsonType": "string", - "description": "设备像素比 " - }, - "device_window_width": { - "bsonType": "string", - "description": "设备窗口宽度 " - }, - "device_window_height": { - "bsonType": "string", - "description": "设备窗口高度" - }, - "device_screen_width": { - "bsonType": "string", - "description": "设备屏幕宽度" - }, - "device_screen_height": { - "bsonType": "string", - "description": "设备屏幕高度" - }, - "location_ip": { - "bsonType": "string", - "description": "ip" - }, - "location_latitude": { - "bsonType": "double", - "description": "纬度" - }, - "location_longitude": { - "bsonType": "double", - "description": "经度" - }, - "location_country": { - "bsonType": "string", - "description": "国家" - }, - "location_province": { - "bsonType": "string", - "description": "省份" - }, - "location_city": { - "bsonType": "string", - "description": "城市" - }, - "is_finish": { - "bsonType": "int", - "defaultValue": 0, - "description": "本次会话是否结束,0:否,1是", - "enum": [{ - "text": "否", - "value": 0 - }, { - "text": "是", - "value": 1 - }] - }, - "create_time": { - "bsonType": "timestamp", - "description": "创建时间" - } - } -} diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-share-logs.index.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-share-logs.index.json deleted file mode 100644 index ce40461..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-share-logs.index.json +++ /dev/null @@ -1,87 +0,0 @@ -[ - { - "IndexName": "create_time", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "create_time", - "Direction": "1", - "Type": "long" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "appid", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "appid", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "version", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "version", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "platform", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "platform", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "channel", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "channel", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "page_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "page_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "page_detail_id", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "page_detail_id", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - } -] diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-share-logs.init_data.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-share-logs.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-share-logs.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-share-logs.schema.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-share-logs.schema.json deleted file mode 100644 index 9a22acb..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-share-logs.schema.json +++ /dev/null @@ -1,60 +0,0 @@ -// 应用分享日志表 -{ - "bsonType": "object", - "description": "记录触发分享事件的日志", - "required": [], - "permission": { - "read": false, - "create": false, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "appid": { - "bsonType": "string", - "description": "客户端上报的应用ID" - }, - "version": { - "bsonType": "string", - "description": "客户端上报的应用版本号" - }, - "platform": { - "bsonType": "string", - "description": "客户端上报的平台code" - }, - "channel": { - "bsonType": "string", - "description": "客户端上报的渠道code\/场景值" - }, - "device_id": { - "bsonType": "string", - "description": "客户端携带的设备标识" - }, - "uid": { - "bsonType": "string", - "description": "用户编号, 对应uni-id-users._id" - }, - "session_id": { - "bsonType": "string", - "description": "访问会话日志ID,对应uni-stat-session-logs._id", - "foreignKey": "uni-stat-session-logs._id" - }, - "page_id": { - "bsonType": "string", - "description": "当前页面ID,对应uni-stat-pagesd", - "foreignKey": "uni-stat-pagesd" - }, - "page_detail_id": { - "bsonType": "string", - "description": "页面详情表ID,对应uni-stat-page-details._id", - "foreignKey": "uni-stat-page-details._id" - }, - "create_time": { - "bsonType": "timestamp", - "description": "创建时间" - } - } -} \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-user-session-logs.index.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-user-session-logs.index.json deleted file mode 100644 index fee48d1..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-user-session-logs.index.json +++ /dev/null @@ -1,88 +0,0 @@ -[ - { - "IndexName": "create_time", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "create_time", - "Direction": "1", - "Type": "long" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "appid", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "appid", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "version", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "version", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "platform", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "platform", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "channel", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "channel", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "uid", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "uid", - "Direction": "1" - } - ], - "MgoIsUnique": false - } - }, - { - "IndexName": "is_finish", - "MgoKeySchema": { - "MgoIndexKeys": [ - { - "Name": "is_finish", - "Direction": "1", - "Type": "int" - } - ], - "MgoIsUnique": false - } - } -] diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-user-session-logs.init_data.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-user-session-logs.init_data.json deleted file mode 100644 index 0637a08..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-user-session-logs.init_data.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/sport-erp-admin/uniCloud-alipay/database/uni-stat-user-session-logs.schema.json b/sport-erp-admin/uniCloud-alipay/database/uni-stat-user-session-logs.schema.json deleted file mode 100644 index 6af7353..0000000 --- a/sport-erp-admin/uniCloud-alipay/database/uni-stat-user-session-logs.schema.json +++ /dev/null @@ -1,82 +0,0 @@ -// 用户会话日志表 -{ - "bsonType": "object", - "description": "记录登录用户的会话日志", - "required": [], - "permission": { - "read": false, - "create": false, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "appid": { - "bsonType": "string", - "description": "客户端携带的应用ID" - }, - "version": { - "bsonType": "string", - "description": "客户端上报的应用版本号" - }, - "platform": { - "bsonType": "string", - "description": "客户端上报的平台code" - }, - "channel": { - "bsonType": "string", - "description": "客户端上报的渠道code\/场景值" - }, - "session_id": { - "bsonType": "string", - "description": "访问会话日志ID,对应uni-stat-session-logs._id", - "foreignKey": "uni-stat-session-logs._id" - }, - "uid": { - "bsonType": "string", - "description": "本次会话最终访问用户的ID, uni-id-users._id" - }, - "last_visit_time": { - "bsonType": "timestamp", - "description": "用户最后一次访问时间" - }, - "entry_page_id": { - "bsonType": "string", - "description": "本次会话入口页面ID, 同uni-stat-pagesd" - }, - "exit_page_id": { - "bsonType": "string", - "description": "本次会话退出页面ID, 同uni-stat-pagesd" - }, - "page_count": { - "bsonType": "int", - "description": "本次会话浏览的页面数" - }, - "event_count": { - "bsonType": "int", - "description": "本次会话产生的事件数" - }, - "duration": { - "bsonType": "int", - "description": "本次会话时长,单位为秒,服务端计算" - }, - "is_finish": { - "bsonType": "int", - "defaultValue": 0, - "description": "本次会话是否结束,0:否,1是", - "enum": [{ - "text": "否", - "value": 0 - }, { - "text": "是", - "value": 1 - }] - }, - "create_time": { - "bsonType": "timestamp", - "description": "创建时间" - } - } -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/qiun-data-charts/changelog.md b/sport-erp-admin/uni_modules/qiun-data-charts/changelog.md deleted file mode 100644 index 4d470a4..0000000 --- a/sport-erp-admin/uni_modules/qiun-data-charts/changelog.md +++ /dev/null @@ -1,320 +0,0 @@ -## 2.5.0-20230101(2023-01-01) -- 秋云图表组件 修改条件编译顺序,确保uniapp的cli方式的项目依赖不完整时可以正常显示 -- 秋云图表组件 恢复props属性directory的使用,以修复vue3项目中,开启echarts后,echarts目录识别错误的bug -- uCharts.js 修复区域图、混合图只有一个数据时图表显示不正确的bug -- uCharts.js 修复折线图、区域图中时间轴类别图表tooltip指示点显示不正确的bug -- uCharts.js 修复x轴使用labelCount时,并且boundaryGap = 'justify' 并且关闭Y轴显示的时候,最后一个坐标值不显示的bug -- uCharts.js 修复折线图只有一组数据时 ios16 渲染颜色不正确的bug -- uCharts.js 修复玫瑰图半径显示不正确的bug -- uCharts.js 柱状图、山峰图增加正负图功能,y轴网格如果需要显示0轴则由 min max 及 splitNumber 确定,后续版本优化自动显示0轴 -- uCharts.js 柱状图column增加 opts.extra.column.labelPosition,数据标签位置,有效值为 outside外部, insideTop内顶部, center内中间, bottom内底部 -- uCharts.js 雷达图radar增加 opts.extra.radar.labelShow,否显示各项标识文案是,默认true -- uCharts.js 提示窗tooltip增加 opts.extra.tooltip.boxPadding,提示窗边框填充距离,默认3px -- uCharts.js 提示窗tooltip增加 opts.extra.tooltip.fontSize,提示窗字体大小配置,默认13px -- uCharts.js 提示窗tooltip增加 opts.extra.tooltip.lineHeight,提示窗文字行高,默认20px -- uCharts.js 提示窗tooltip增加 opts.extra.tooltip.legendShow,是否显示左侧图例,默认true -- uCharts.js 提示窗tooltip增加 opts.extra.tooltip.legendShape,图例形状,图例标识样式,有效值为 auto自动跟随图例, diamond◆, circle●, triangle▲, square■, rect▬, line- -- uCharts.js 标记线markLine增加 opts.extra.markLine.labelFontSize,字体大小配置,默认13px -- uCharts.js 标记线markLine增加 opts.extra.markLine.labelPadding,标签边框内填充距离,默认6px -- uCharts.js 折线图line增加 opts.extra.line.linearType,渐变色类型,可选值 none关闭渐变色,custom 自定义渐变色。使用自定义渐变色时请赋值serie.linearColor作为颜色值 -- uCharts.js 折线图line增加 serie.linearColor,渐变色数组,格式为2维数组[起始位置,颜色值],例如[[0,'#0EE2F8'],[0.3,'#2BDCA8'],[0.6,'#1890FF'],[1,'#9A60B4']] -- uCharts.js 折线图line增加 opts.extra.line.onShadow,是否开启折线阴影,开启后请赋值serie.setShadow阴影设置 -- uCharts.js 折线图line增加 serie.setShadow,阴影配置,格式为4位数组:[offsetX,offsetY,blur,color] -- uCharts.js 折线图line增加 opts.extra.line.animation,动画效果方向,可选值为vertical 垂直动画效果,horizontal 水平动画效果 -- uCharts.js X轴xAxis增加 opts.xAxis.lineHeight,X轴字体行高,默认20px -- uCharts.js X轴xAxis增加 opts.xAxis.marginTop,X轴文字距离轴线的距离,默认0px -- uCharts.js X轴xAxis增加 opts.xAxis.title,当前X轴标题 -- uCharts.js X轴xAxis增加 opts.xAxis.titleFontSize,标题字体大小,默认13px -- uCharts.js X轴xAxis增加 opts.xAxis.titleOffsetY,标题纵向偏移距离,负数为向上偏移,正数向下偏移 -- uCharts.js X轴xAxis增加 opts.xAxis.titleOffsetX,标题横向偏移距离,负数为向左偏移,正数向右偏移 -- uCharts.js X轴xAxis增加 opts.xAxis.titleFontColor,标题字体颜色,默认#666666 - -## 报错TypeError: Cannot read properties of undefined (reading 'length') -- 如果是uni-modules版本组件,请先登录HBuilderX账号; -- 在HBuilderX中的manifest.json,点击重新获取uniapp的appid,或者删除appid重新粘贴,重新运行; -- 如果是cli项目请使用码云上的非uniCloud版本组件; -- 或者添加uniCloud的依赖; -- 或者使用原生uCharts; -## 2.4.5-20221130(2022-11-30) -- uCharts.js 优化tooltip当文字很多变为左侧显示时,如果画布仍显显示不下,提示框错位置变为以左侧0位置起画 -- uCharts.js 折线图修复特殊情况下只有单点数据,并改变线宽后点变为圆形的bug -- uCharts.js 修复Y轴disabled启用后无效并报错的bug -- uCharts.js 修复仪表盘起始结束角度特殊情况下显示不正确的bug -- uCharts.js 雷达图新增参数 opts.extra.radar.radius , 自定义雷达图半径 -- uCharts.js 折线图、区域图增加tooltip指示点,opts.extra.line.activeType/opts.extra.area.activeType,可选值"none"不启用激活指示点,"hollow"空心点模式,"solid"实心点模式 -## 2.4.4-20221102(2022-11-02) -- 秋云图表组件 修复使用echarts时reload、reshow无法调用重新渲染的bug,[详见码云PR](https://gitee.com/uCharts/uCharts/pulls/40) -- 秋云图表组件 修复使用echarts时,初始化时宽高不正确的bug,[详见码云PR](https://gitee.com/uCharts/uCharts/pulls/42) -- 秋云图表组件 修复uniapp的h5使用history模式时,无法加载echarts的bug -- 秋云图表组件 小程序端@complete、@scrollLeft、@scrollRight、@getTouchStart、@getTouchMove、@getTouchEnd事件增加opts参数传出,方便一些特殊需求的交互获取数据。 - -- uCharts.js 修复calTooltipYAxisData方法内formatter格式化方法未与y轴方法同步的问题,[详见码云PR](https://gitee.com/uCharts/uCharts/pulls/43) -- uCharts.js 地图新增参数opts.series[i].fillOpacity,以透明度方式来设置颜色过度效果,[详见码云PR](https://gitee.com/uCharts/uCharts/pulls/38) -- uCharts.js 地图新增参数opts.extra.map.active,是否启用点击激活变色 -- uCharts.js 地图新增参数opts.extra.map.activeTextColor,是否启用点击激活变色 -- uCharts.js 地图新增渲染完成事件renderComplete -- uCharts.js 漏斗图修复当部分数据相同时tooltip提示窗点击错误的bug -- uCharts.js 漏斗图新增参数series.data[i].centerText 居中标签文案 -- uCharts.js 漏斗图新增参数series.data[i].centerTextSize 居中标签文案字体大小,默认opts.fontSize -- uCharts.js 漏斗图新增参数series.data[i].centerTextColor 居中标签文案字体颜色,默认#FFFFFF -- uCharts.js 漏斗图新增参数opts.extra.funnel.minSize 最小值的最小宽度,默认0 -- uCharts.js 进度条新增参数opts.extra.arcbar.direction,动画方向,可选值为cw顺时针、ccw逆时针 -- uCharts.js 混合图新增参数opts.extra.mix.line.width,折线的宽度,默认2 -- uCharts.js 修复tooltip开启horizentalLine水平横线标注时,图表显示错位的bug -- uCharts.js 优化tooltip当文字很多变为左侧显示时,如果画布仍显显示不下,提示框错位置变为以左侧0位置起画 -- uCharts.js 修复开启滚动条后X轴文字超出绘图区域后的隐藏逻辑 -- uCharts.js 柱状图、条状图修复堆叠模式不能通过{value,color}赋值单个柱子颜色的问题 -- uCharts.js 气泡图修复不识别series.textSize和series.textColor的bug - -## 报错TypeError: Cannot read properties of undefined (reading 'length') -1. 如果是uni-modules版本组件,请先登录HBuilderX账号; -2. 在HBuilderX中的manifest.json,点击重新获取uniapp的appid,或者删除appid重新粘贴,重新运行; -3. 如果是cli项目请使用码云上的非uniCloud版本组件; -4. 或者添加uniCloud的依赖; -5. 或者使用原生uCharts; -## 2.4.3-20220505(2022-05-05) -- 秋云图表组件 修复开启canvas2d后将series赋值为空数组显示加载图标时,再次赋值后画布闪动的bug -- 秋云图表组件 修复升级hbx最新版后ECharts的highlight方法报错的bug -- uCharts.js 雷达图新增参数opts.extra.radar.gridEval,数据点位网格抽希,默认1 -- uCharts.js 雷达图新增参数opts.extra.radar.axisLabel, 是否显示刻度点值,默认false -- uCharts.js 雷达图新增参数opts.extra.radar.axisLabelTofix,刻度点值小数位数,默认0 -- uCharts.js 雷达图新增参数opts.extra.radar.labelPointShow,是否显示末端刻度圆点,默认false -- uCharts.js 雷达图新增参数opts.extra.radar.labelPointRadius,刻度圆点的半径,默认3 -- uCharts.js 雷达图新增参数opts.extra.radar.labelPointColor,刻度圆点的颜色,默认#cccccc -- uCharts.js 雷达图新增参数opts.extra.radar.linearType,渐变色类型,可选值"none"关闭渐变,"custom"开启渐变 -- uCharts.js 雷达图新增参数opts.extra.radar.customColor,自定义渐变颜色,数组类型对应series的数组长度以匹配不同series颜色的不同配色方案,例如["#FA7D8D", "#EB88E2"] -- uCharts.js 雷达图优化支持series.textColor、series.textSize属性 -- uCharts.js 柱状图中温度计式图标,优化支持全圆角类型,修复边框有缝隙的bug,详见官网【演示】中的温度计图表 -- uCharts.js 柱状图新增参数opts.extra.column.activeWidth,当前点击柱状图的背景宽度,默认一个单元格单位 -- uCharts.js 混合图增加opts.extra.mix.area.gradient 区域图是否开启渐变色 -- uCharts.js 混合图增加opts.extra.mix.area.opacity 区域图透明度,默认0.2 -- uCharts.js 饼图、圆环图、玫瑰图、漏斗图,增加opts.series[0].data[i].labelText,自定义标签文字,避免formatter格式化的繁琐,详见官网【演示】中的饼图 -- uCharts.js 饼图、圆环图、玫瑰图、漏斗图,增加opts.series[0].data[i].labelShow,自定义是否显示某一个指示标签,避免因饼图类别太多导致标签重复或者居多导致图形变形的问题,详见官网【演示】中的饼图 -- uCharts.js 增加opts.series[i].legendText/opts.series[0].data[i].legendText(与series.name同级)自定义图例显示文字的方法 -- uCharts.js 优化X轴、Y轴formatter格式化方法增加形参,统一为fromatter:function(value,index,opts){} -- uCharts.js 修复横屏模式下无法使用双指缩放方法的bug -- uCharts.js 修复当只有一条数据或者多条数据值相等的时候Y轴自动计算的最大值错误的bug -- 【官网模板】增加外部自定义图例与图表交互的例子,[点击跳转](https://www.ucharts.cn/v2/#/layout/info?id=2) - -## 注意:非unimodules 版本如因更新 hbx 至 3.4.7 导致报错如下,请到码云更新非 unimodules 版本组件,[点击跳转](https://gitee.com/uCharts/uCharts/tree/master/uni-app/uCharts-%E7%BB%84%E4%BB%B6) -> Error in callback for immediate watcher "uchartsOpts": "SyntaxError: Unexpected token u in JSON at position 0" -## 2.4.2-20220421(2022-04-21) -- 秋云图表组件 修复HBX升级3.4.6.20220420版本后echarts报错的问题 -## 2.4.2-20220420(2022-04-20) -## 重要!此版本uCharts新增了很多功能,修复了诸多已知问题 -- 秋云图表组件 新增onzoom开启双指缩放功能(仅uCharts),前提需要直角坐标系类图表类型,并且ontouch为true、opts.enableScroll为true,详见实例项目K线图 -- 秋云图表组件 新增optsWatch是否监听opts变化,关闭optsWatch后,动态修改opts不会触发图表重绘 -- 秋云图表组件 修复开启canvas2d功能后,动态更新数据后画布闪动的bug -- 秋云图表组件 去除directory属性,改为自动获取echarts.min.js路径(升级不受影响) -- 秋云图表组件 增加getImage()方法及@getImage事件,通过ref调用getImage()方法获,触发@getImage事件获取当前画布的base64图片文件流。 -- 秋云图表组件 支付宝、字节跳动、飞书、快手小程序支持开启canvas2d同层渲染设置。 -- 秋云图表组件 新增加【非uniCloud】版本组件,避免有些不需要uniCloud的使用组件发布至小程序需要提交隐私声明问题,请到码云[【非uniCloud版本】](https://gitee.com/uCharts/uCharts/tree/master/uni-app/uCharts-%E7%BB%84%E4%BB%B6),或npm[【非uniCloud版本】](https://www.npmjs.com/package/@qiun/uni-ucharts)下载使用。 -- uCharts.js 新增dobuleZoom双指缩放功能 -- uCharts.js 新增山峰图type="mount",数据格式为饼图类格式,不需要传入categories,具体详见新版官网在线演示 -- uCharts.js 修复折线图当数据中存在null时tooltip报错的bug -- uCharts.js 修复饼图类当画布比较小时自动计算的半径是负数报错的bug -- uCharts.js 统一各图表类型的series.formatter格式化方法的形参为(val, index, series, opts),方便格式化时有更多参数可用 -- uCharts.js 标记线功能增加labelText自定义显示文字,增加labelAlign标签显示位置(左侧或右侧),增加标签显示位置微调labelOffsetX、labelOffsetY -- uCharts.js 修复条状图当数值很小时开启圆角后样式错误的bug -- uCharts.js 修复X轴开启disabled后,X轴仍占用空间的bug -- uCharts.js 修复X轴开启滚动条并且开启rotateLabel后,X轴文字与滚动条重叠的bug -- uCharts.js 增加X轴rotateAngle文字旋转自定义角度,取值范围(-90至90) -- uCharts.js 修复地图文字标签层级显示不正确的bug -- uCharts.js 修复饼图、圆环图、玫瑰图当数据全部为0的时候不显示数据标签的bug -- uCharts.js 修复当opts.padding上边距为0时,Y轴顶部刻度标签位置不正确的bug - -## 另外我们还开发了各大原生小程序组件,已发布至码云和npm -[https://gitee.com/uCharts/uCharts](https://gitee.com/uCharts/uCharts) -[https://www.npmjs.com/~qiun](https://www.npmjs.com/~qiun) - -## 对于原生uCharts文档我们已上线新版官方网站,详情点击下面链接进入官网 -[https://www.uCharts.cn/v2/](https://www.ucharts.cn/v2/) -## 2.3.7-20220122(2022-01-22) -## 重要!使用vue3编译,请使用cli模式并升级至最新依赖,HbuilderX编译需要使用3.3.8以上版本 -- uCharts.js 修复uni-app平台组件模式使用vue3编译到小程序报错的bug。 -## 2.3.7-20220118(2022-01-18) -## 注意,使用vue3的前提是需要3.3.8.20220114-alpha版本的HBuilder! -## 2.3.67-20220118(2022-01-18) -- 秋云图表组件 组件初步支持vue3,全端编译会有些问题,具体详见下面修改: -1. 小程序端运行时,在uni_modules文件夹的qiun-data-charts.js中搜索 new uni_modules_qiunDataCharts_js_sdk_uCharts_uCharts.uCharts,将.uCharts去掉。 -2. 小程序端发行时,在uni_modules文件夹的qiun-data-charts.js中搜索 new e.uCharts,将.uCharts去掉,变为 new e。 -3. 如果觉得上述步骤比较麻烦,如果您的项目只编译到小程序端,可以修改u-charts.js最后一行导出方式,将 export default uCharts;变更为 export default { uCharts: uCharts }; 这样变更后,H5和App端的renderjs会有问题,请开发者自行选择。(此问题非组件问题,请等待DC官方修复Vue3的小程序端) -## 2.3.6-20220111(2022-01-11) -- 秋云图表组件 修改组件 props 属性中的 background 默认值为 rgba(0,0,0,0) -## 2.3.6-20211201(2021-12-01) -- uCharts.js 修复bar条状图开启圆角模式时,值很小时圆角渲染错误的bug -## 2.3.5-20211014(2021-10-15) -- uCharts.js 增加vue3的编译支持(仅原生uCharts,qiun-data-charts组件后续会支持,请关注更新) -## 2.3.4-20211012(2021-10-12) -- 秋云图表组件 修复 mac os x 系统 mouseover 事件丢失的 bug -## 2.3.3-20210706(2021-07-06) -- uCharts.js 增加雷达图开启数据点值(opts.dataLabel)的显示 -## 2.3.2-20210627(2021-06-27) -- 秋云图表组件 修复tooltipCustom个别情况下传值不正确报错TypeError: Cannot read property 'name' of undefined的bug -## 2.3.1-20210616(2021-06-16) -- uCharts.js 修复圆角柱状图使用4角圆角时,当数值过大时不正确的bug -## 2.3.0-20210612(2021-06-12) -- uCharts.js 【重要】uCharts增加nvue兼容,可在nvue项目中使用gcanvas组件渲染uCharts,[详见码云uCharts-demo-nvue](https://gitee.com/uCharts/uCharts) -- 秋云图表组件 增加tapLegend属性,是否开启图例点击交互事件 -- 秋云图表组件 getIndex事件中增加返回uCharts实例中的opts参数,以便在页面中调用参数 -- 示例项目 pages/other/other.vue增加app端自定义tooltip的方法,详见showOptsTooltip方法 -## 2.2.1-20210603(2021-06-03) -- uCharts.js 修复饼图、圆环图、玫瑰图,当起始角度不为0时,tooltip位置不准确的bug -- uCharts.js 增加温度计式柱状图开启顶部半圆形的配置 -## 2.2.0-20210529(2021-05-29) -- uCharts.js 增加条状图type="bar" -- 示例项目 pages/ucharts/ucharts.vue增加条状图的demo -## 2.1.7-20210524(2021-05-24) -- uCharts.js 修复大数据量模式下曲线图不平滑的bug -## 2.1.6-20210523(2021-05-23) -- 秋云图表组件 修复小程序端开启滚动条更新数据后滚动条位置不符合预期的bug -## 2.1.5-2021051702(2021-05-17) -- uCharts.js 修复自定义Y轴min和max值为0时不能正确显示的bug -## 2.1.5-20210517(2021-05-17) -- uCharts.js 修复Y轴自定义min和max时,未按指定的最大值最小值显示坐标轴刻度的bug -## 2.1.4-20210516(2021-05-16) -- 秋云图表组件 优化onWindowResize防抖方法 -- 秋云图表组件 修复APP端uCharts更新数据时,清空series显示loading图标后再显示图表,图表抖动的bug -- uCharts.js 修复开启canvas2d后,x轴、y轴、series自定义字体大小未按比例缩放的bug -- 示例项目 修复format-e.vue拼写错误导致app端使用uCharts渲染图表 -## 2.1.3-20210513(2021-05-13) -- 秋云图表组件 修改uCharts变更chartData数据为updateData方法,支持带滚动条的数据动态打点 -- 秋云图表组件 增加onWindowResize防抖方法 fix by ど誓言,如尘般染指流年づ -- 秋云图表组件 H5或者APP变更chartData数据显示loading图表时,原数据闪现的bug -- 秋云图表组件 props增加errorReload禁用错误点击重新加载的方法 -- uCharts.js 增加tooltip显示category(x轴对应点位)标题的功能,opts.extra.tooltip.showCategory,默认为false -- uCharts.js 修复mix混合图只有柱状图时,tooltip的分割线显示位置不正确的bug -- uCharts.js 修复开启滚动条,图表在拖动中动态打点,滚动条位置不正确的bug -- uCharts.js 修复饼图类数据格式为echarts数据格式,series为空数组报错的bug -- 示例项目 修改uCharts.js更新到v2.1.2版本后,@getIndex方法获取索引值变更为e.currentIndex.index -- 示例项目 pages/updata/updata.vue增加滚动条拖动更新(数据动态打点)的demo -- 示例项目 pages/other/other.vue增加errorReload禁用错误点击重新加载的demo -## 2.1.2-20210509(2021-05-09) -秋云图表组件 修复APP端初始化时就传入chartData或lacaldata不显示图表的bug -## 2.1.1-20210509(2021-05-09) -- 秋云图表组件 变更ECharts的eopts配置在renderjs内执行,支持在config-echarts.js配置文件内写function配置。 -- 秋云图表组件 修复APP端报错Prop being mutated: "onmouse"错误的bug。 -- 秋云图表组件 修复APP端报错Error: Not Found:Page[6][-1,27] at view.umd.min.js:1的bug。 -## 2.1.0-20210507(2021-05-07) -- 秋云图表组件 修复初始化时就有数据或者数据更新的时候loading加载动画闪动的bug -- uCharts.js 修复x轴format方法categories为字符串类型时返回NaN的bug -- uCharts.js 修复series.textColor、legend.fontColor未执行全局默认颜色的bug -## 2.1.0-20210506(2021-05-06) -- 秋云图表组件 修复极个别情况下报错item.properties undefined的bug -- 秋云图表组件 修复极个别情况下关闭加载动画reshow不起作用,无法显示图表的bug -- 示例项目 pages/ucharts/ucharts.vue 增加时间轴折线图(type="tline")、时间轴区域图(type="tarea")、散点图(type="scatter")、气泡图demo(type="bubble")、倒三角形漏斗图(opts.extra.funnel.type="triangle")、金字塔形漏斗图(opts.extra.funnel.type="pyramid") -- 示例项目 pages/format-u/format-u.vue 增加X轴format格式化示例 -- uCharts.js 升级至v2.1.0版本 -- uCharts.js 修复 玫瑰图面积模式点击tooltip位置不正确的bug -- uCharts.js 修复 玫瑰图点击图例,只剩一个类别显示空白的bug -- uCharts.js 修复 饼图类图点击图例,其他图表tooltip位置某些情况下不准的bug -- uCharts.js 修复 x轴为矢量轴(时间轴)情况下,点击tooltip位置不正确的bug -- uCharts.js 修复 词云图获取点击索引偶尔不准的bug -- uCharts.js 增加 直角坐标系图表X轴format格式化方法(原生uCharts.js用法请使用formatter) -- uCharts.js 增加 漏斗图扩展配置,倒三角形(opts.extra.funnel.type="triangle"),金字塔形(opts.extra.funnel.type="pyramid") -- uCharts.js 增加 散点图(opts.type="scatter")、气泡图(opts.type="bubble") -- 后期计划 完善散点图、气泡图,增加markPoints标记点,增加横向条状图。 -## 2.0.0-20210502(2021-05-02) -- uCharts.js 修复词云图获取点击索引不正确的bug -## 2.0.0-20210501(2021-05-01) -- 秋云图表组件 修复QQ小程序、百度小程序在关闭动画效果情况下,v-for循环使用图表,显示不正确的bug -## 2.0.0-20210426(2021-04-26) -- 秋云图表组件 修复QQ小程序不支持canvas2d的bug -- 秋云图表组件 修复钉钉小程序某些情况点击坐标计算错误的bug -- uCharts.js 增加 extra.column.categoryGap 参数,柱状图类每个category点位(X轴点)柱子组之间的间距 -- uCharts.js 增加 yAxis.data[i].titleOffsetY 参数,标题纵向偏移距离,负数为向上偏移,正数向下偏移 -- uCharts.js 增加 yAxis.data[i].titleOffsetX 参数,标题横向偏移距离,负数为向左偏移,正数向右偏移 -- uCharts.js 增加 extra.gauge.labelOffset 参数,仪表盘标签文字径向便宜距离,默认13px -## 2.0.0-20210422-2(2021-04-22) -秋云图表组件 修复 formatterAssign 未判断 args[key] == null 的情况导致栈溢出的 bug -## 2.0.0-20210422(2021-04-22) -- 秋云图表组件 修复H5、APP、支付宝小程序、微信小程序canvas2d模式下横屏模式的bug -## 2.0.0-20210421(2021-04-21) -- uCharts.js 修复多行图例的情况下,图例在上方或者下方时,图例float为左侧或者右侧时,第二行及以后的图例对齐方式不正确的bug -## 2.0.0-20210420(2021-04-20) -- 秋云图表组件 修复微信小程序开启canvas2d模式后,windows版微信小程序不支持canvas2d模式的bug -- 秋云图表组件 修改非uni_modules版本为v2.0版本qiun-data-charts组件 -## 2.0.0-20210419(2021-04-19) -## v1.0版本已停更,建议转uni_modules版本组件方式调用,点击右侧绿色【使用HBuilderX导入插件】即可使用,示例项目请点击右侧蓝色按钮【使用HBuilderX导入示例项目】。 -## 初次使用如果提示未注册<qiun-data-charts>组件,请重启HBuilderX,如仍不好用,请重启电脑; -## 如果是cli项目,请尝试清理node_modules,重新install,还不行就删除项目,再重新install。 -## 此问题已于DCloud官方确认,HBuilderX下个版本会修复。 -## 其他图表不显示问题详见[常见问题选项卡](https://demo.ucharts.cn) -## 新手请先完整阅读帮助文档及常见问题3遍,右侧蓝色按钮示例项目请看2遍! -## [DEMO演示及在线生成工具(v2.0文档)https://demo.ucharts.cn](https://demo.ucharts.cn) -## [图表组件在项目中的应用参见 UReport数据报表](https://ext.dcloud.net.cn/plugin?id=4651) -- uCharts.js 修复混合图中柱状图单独设置颜色不生效的bug -- uCharts.js 修复多Y轴单独设置fontSize时,开启canvas2d后,未对应放大字体的bug -## 2.0.0-20210418(2021-04-18) -- 秋云图表组件 增加directory配置,修复H5端history模式下如果发布到二级目录无法正确加载echarts.min.js的bug -## 2.0.0-20210416(2021-04-16) -## v1.0版本已停更,建议转uni_modules版本组件方式调用,点击右侧绿色【使用HBuilderX导入插件】即可使用,示例项目请点击右侧蓝色按钮【使用HBuilderX导入示例项目】。 -## 初次使用如果提示未注册<qiun-data-charts>组件,请重启HBuilderX,如仍不好用,请重启电脑; -## 如果是cli项目,请尝试清理node_modules,重新install,还不行就删除项目,再重新install。 -## 此问题已于DCloud官方确认,HBuilderX下个版本会修复。 -## 其他图表不显示问题详见[常见问题选项卡](https://demo.ucharts.cn) -## 新手请先完整阅读帮助文档及常见问题3遍,右侧蓝色按钮示例项目请看2遍! -## [DEMO演示及在线生成工具(v2.0文档)https://demo.ucharts.cn](https://demo.ucharts.cn) -## [图表组件在项目中的应用参见 UReport数据报表](https://ext.dcloud.net.cn/plugin?id=4651) -- 秋云图表组件 修复APP端某些情况下报错`Not Found Page`的bug,fix by 高级bug开发技术员 -- 示例项目 修复APP端v-for循环某些情况下报错`Not Found Page`的bug,fix by 高级bug开发技术员 -- uCharts.js 修复非直角坐标系tooltip提示窗右侧超出未变换方向显示的bug -## 2.0.0-20210415(2021-04-15) -- 秋云图表组件 修复H5端发布到二级目录下echarts无法加载的bug -- 秋云图表组件 修复某些情况下echarts.off('finished')移除监听事件报错的bug -## 2.0.0-20210414(2021-04-14) -## v1.0版本已停更,建议转uni_modules版本组件方式调用,点击右侧绿色【使用HBuilderX导入插件】即可使用,示例项目请点击右侧蓝色按钮【使用HBuilderX导入示例项目】。 -## 初次使用如果提示未注册<qiun-data-charts>组件,请重启HBuilderX,如仍不好用,请重启电脑; -## 如果是cli项目,请尝试清理node_modules,重新install,还不行就删除项目,再重新install。 -## 此问题已于DCloud官方确认,HBuilderX下个版本会修复。 -## 其他图表不显示问题详见[常见问题选项卡](https://demo.ucharts.cn) -## 新手请先完整阅读帮助文档及常见问题3遍,右侧蓝色按钮示例项目请看2遍! -## [DEMO演示及在线生成工具(v2.0文档)https://demo.ucharts.cn](https://demo.ucharts.cn) -## [图表组件在项目中的应用参见 UReport数据报表](https://ext.dcloud.net.cn/plugin?id=4651) -- 秋云图表组件 修复H5端在cli项目下ECharts引用地址错误的bug -- 示例项目 增加ECharts的formatter用法的示例(详见示例项目format-e.vue) -- uCharts.js 增加圆环图中心背景色的配置extra.ring.centerColor -- uCharts.js 修复微信小程序安卓端柱状图开启透明色后显示不正确的bug -## 2.0.0-20210413(2021-04-13) -- 秋云图表组件 修复百度小程序多个图表真机未能正确获取根元素dom尺寸的bug -- 秋云图表组件 修复百度小程序横屏模式方向不正确的bug -- 秋云图表组件 修改ontouch时,@getTouchStart@getTouchMove@getTouchEnd的触发条件 -- uCharts.js 修复饼图类数据格式series属性不生效的bug -- uCharts.js 增加时序区域图 详见示例项目中ucharts.vue -## 2.0.0-20210412-2(2021-04-12) -## v1.0版本已停更,建议转uni_modules版本组件方式调用,点击右侧绿色【使用HBuilderX导入插件】即可使用,示例项目请点击右侧蓝色按钮【使用HBuilderX导入示例项目】。 -## 初次使用如果提示未注册<qiun-data-charts>组件,请重启HBuilderX。如仍不好用,请重启电脑,此问题已于DCloud官方确认,HBuilderX下个版本会修复。 -## [DEMO演示及在线生成工具(v2.0文档)https://demo.ucharts.cn](https://demo.ucharts.cn) -## [图表组件在uniCloudAdmin中的应用 UReport数据报表](https://ext.dcloud.net.cn/plugin?id=4651) -- 秋云图表组件 修复uCharts在APP端横屏模式下不能正确渲染的bug -- 示例项目 增加ECharts柱状图渐变色、圆角柱状图、横向柱状图(条状图)的示例 -## 2.0.0-20210412(2021-04-12) -- 秋云图表组件 修复created中判断echarts导致APP端无法识别,改回mounted中判断echarts初始化 -- uCharts.js 修复2d模式下series.textOffset未乘像素比的bug -## 2.0.0-20210411(2021-04-11) -## v1.0版本已停更,建议转uni_modules版本组件方式调用,点击右侧绿色【使用HBuilderX导入插件】即可使用,示例项目请点击右侧蓝色按钮【使用HBuilderX导入示例项目】。 -## 初次使用如果提示未注册组件,请重启HBuilderX,并清空小程序开发者工具缓存。 -## [DEMO演示及在线生成工具(v2.0文档)https://demo.ucharts.cn](https://demo.ucharts.cn) -## [图表组件在uniCloudAdmin中的应用 UReport数据报表](https://ext.dcloud.net.cn/plugin?id=4651) -- uCharts.js 折线图区域图增加connectNulls断点续连的功能,详见示例项目中ucharts.vue -- 秋云图表组件 变更初始化方法为created,变更type2d默认值为true,优化2d模式下组件初始化后dom获取不到的bug -- 秋云图表组件 修复左右布局时,右侧图表点击坐标错误的bug,修复tooltip柱状图自定义颜色显示object的bug -## 2.0.0-20210410(2021-04-10) -- 修复左右布局时,右侧图表点击坐标错误的bug,修复柱状图自定义颜色tooltip显示object的bug -- 增加标记线及柱状图自定义颜色的demo -## 2.0.0-20210409(2021-04-08) -## v1.0版本已停更,建议转uni_modules版本组件方式调用,点击右侧【使用HBuilderX导入插件】即可体验,DEMO演示及在线生成工具(v2.0文档)[https://demo.ucharts.cn](https://demo.ucharts.cn) -## 图表组件在uniCloudAdmin中的应用 [UReport数据报表](https://ext.dcloud.net.cn/plugin?id=4651) -- uCharts.js 修复钉钉小程序百度小程序measureText不准确的bug,修复2d模式下饼图类activeRadius为按比例放大的bug -- 修复组件在支付宝小程序端点击位置不准确的bug -## 2.0.0-20210408(2021-04-07) -- 修复组件在支付宝小程序端不能显示的bug(目前支付宝小程不能点击交互,后续修复) -- uCharts.js 修复高分屏下柱状图类,圆弧进度条 自定义宽度不能按比例放大的bug -## 2.0.0-20210407(2021-04-06) -## v1.0版本已停更,建议转uni_modules版本组件方式调用,点击右侧【使用HBuilderX导入插件】即可体验,DEMO演示及在线生成工具(v2.0文档)[https://demo.ucharts.cn](https://demo.ucharts.cn) -## 增加 通过tofix和unit快速格式化y轴的demo add by `howcode` -## 增加 图表组件在uniCloudAdmin中的应用 [UReport数据报表](https://ext.dcloud.net.cn/plugin?id=4651) -## 2.0.0-20210406(2021-04-05) -# 秋云图表组件+uCharts v2.0版本同步上线,使用方法详见https://demo.ucharts.cn帮助页 -## 2.0.0(2021-04-05) -# 秋云图表组件+uCharts v2.0版本同步上线,使用方法详见https://demo.ucharts.cn帮助页 diff --git a/sport-erp-admin/uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue b/sport-erp-admin/uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue deleted file mode 100644 index c08a6d3..0000000 --- a/sport-erp-admin/uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue +++ /dev/null @@ -1,1625 +0,0 @@ - - - - - - - - - - diff --git a/sport-erp-admin/uni_modules/qiun-data-charts/components/qiun-error/qiun-error.vue b/sport-erp-admin/uni_modules/qiun-data-charts/components/qiun-error/qiun-error.vue deleted file mode 100644 index b15b19f..0000000 --- a/sport-erp-admin/uni_modules/qiun-data-charts/components/qiun-error/qiun-error.vue +++ /dev/null @@ -1,46 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/qiun-data-charts/components/qiun-loading/loading1.vue b/sport-erp-admin/uni_modules/qiun-data-charts/components/qiun-loading/loading1.vue deleted file mode 100644 index b701394..0000000 --- a/sport-erp-admin/uni_modules/qiun-data-charts/components/qiun-loading/loading1.vue +++ /dev/null @@ -1,162 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/qiun-data-charts/components/qiun-loading/loading2.vue b/sport-erp-admin/uni_modules/qiun-data-charts/components/qiun-loading/loading2.vue deleted file mode 100644 index 7541b31..0000000 --- a/sport-erp-admin/uni_modules/qiun-data-charts/components/qiun-loading/loading2.vue +++ /dev/null @@ -1,170 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/qiun-data-charts/components/qiun-loading/loading3.vue b/sport-erp-admin/uni_modules/qiun-data-charts/components/qiun-loading/loading3.vue deleted file mode 100644 index 8e14db3..0000000 --- a/sport-erp-admin/uni_modules/qiun-data-charts/components/qiun-loading/loading3.vue +++ /dev/null @@ -1,173 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/qiun-data-charts/components/qiun-loading/loading4.vue b/sport-erp-admin/uni_modules/qiun-data-charts/components/qiun-loading/loading4.vue deleted file mode 100644 index 77c55b7..0000000 --- a/sport-erp-admin/uni_modules/qiun-data-charts/components/qiun-loading/loading4.vue +++ /dev/null @@ -1,222 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/qiun-data-charts/components/qiun-loading/loading5.vue b/sport-erp-admin/uni_modules/qiun-data-charts/components/qiun-loading/loading5.vue deleted file mode 100644 index cb93a55..0000000 --- a/sport-erp-admin/uni_modules/qiun-data-charts/components/qiun-loading/loading5.vue +++ /dev/null @@ -1,229 +0,0 @@ - - - - diff --git a/sport-erp-admin/uni_modules/qiun-data-charts/components/qiun-loading/qiun-loading.vue b/sport-erp-admin/uni_modules/qiun-data-charts/components/qiun-loading/qiun-loading.vue deleted file mode 100644 index 7789060..0000000 --- a/sport-erp-admin/uni_modules/qiun-data-charts/components/qiun-loading/qiun-loading.vue +++ /dev/null @@ -1,36 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/qiun-data-charts/js_sdk/u-charts/config-echarts.js b/sport-erp-admin/uni_modules/qiun-data-charts/js_sdk/u-charts/config-echarts.js deleted file mode 100644 index 7682f4e..0000000 --- a/sport-erp-admin/uni_modules/qiun-data-charts/js_sdk/u-charts/config-echarts.js +++ /dev/null @@ -1,436 +0,0 @@ -/* - * uCharts® - * 高性能跨平台图表库,支持H5、APP、小程序(微信/支付宝/百度/头条/QQ/360)、Vue、Taro等支持canvas的框架平台 - * Copyright (c) 2021 QIUN®秋云 https://www.ucharts.cn All rights reserved. - * Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) - * 复制使用请保留本段注释,感谢支持开源! - * - * uCharts®官方网站 - * https://www.uCharts.cn - * - * 开源地址: - * https://gitee.com/uCharts/uCharts - * - * uni-app插件市场地址: - * http://ext.dcloud.net.cn/plugin?id=271 - * - */ - -// 通用配置项 - -// 主题颜色配置:如每个图表类型需要不同主题,请在对应图表类型上更改color属性 -const color = ['#1890FF', '#91CB74', '#FAC858', '#EE6666', '#73C0DE', '#3CA272', '#FC8452', '#9A60B4', '#ea7ccc']; - -const cfe = { - //demotype为自定义图表类型 - "type": ["pie", "ring", "rose", "funnel", "line", "column", "area", "radar", "gauge","candle","demotype"], - //增加自定义图表类型,如果需要categories,请在这里加入您的图表类型例如最后的"demotype" - "categories": ["line", "column", "area", "radar", "gauge", "candle","demotype"], - //instance为实例变量承载属性,option为eopts承载属性,不要删除 - "instance": {}, - "option": {}, - //下面是自定义format配置,因除H5端外的其他端无法通过props传递函数,只能通过此属性对应下标的方式来替换 - "formatter":{ - "tooltipDemo1":function(res){ - let result = '' - for (let i in res) { - if (i == 0) { - result += res[i].axisValueLabel + '年销售额' - } - let value = '--' - if (res[i].data !== null) { - value = res[i].data - } - // #ifdef H5 - result += '\n' + res[i].seriesName + ':' + value + ' 万元' - // #endif - - // #ifdef APP-PLUS - result += '
' + res[i].marker + res[i].seriesName + ':' + value + ' 万元' - // #endif - } - return result; - }, - platformTooltipCustom:function(res){ - let result = '' - for (let i in res) { - if (i == 0) { - result += res[i].axisValueLabel - } - let data = '--' - if (res[i].data !== null) { - data = res[i].data - } - result += ':\n' + '设备数量:'+data.value+'\n占比:'+(data.value/data.total*100).toFixed(2) +'%' - } - return result; - }, - legendFormat:function(name){ - return "自定义图例+"+name; - }, - yAxisFormatDemo:function (value, index) { - return value + '元'; - }, - seriesFormatDemo:function(res){ - return res.name + '年' + res.value + '元'; - } - }, - //这里演示了自定义您的图表类型的option,可以随意命名,之后在组件上 type="demotype" 后,组件会调用这个花括号里的option,如果组件上还存在eopts参数,会将demotype与eopts中option合并后渲染图表。 - "demotype":{ - "color": color, - //在这里填写echarts的option即可 - - }, - //下面是自定义配置,请添加项目所需的通用配置 - "column": { - "color": color, - "title": { - "text": '' - }, - "tooltip": { - "trigger": 'axis' - }, - "grid": { - "top": 30, - "bottom": 50, - "right": 15, - "left": 40 - }, - "legend": { - "bottom": 'left', - }, - "toolbox": { - "show": false, - }, - "xAxis": { - "type": 'category', - "axisLabel": { - "color": '#666666' - }, - "axisLine": { - "lineStyle": { - "color": '#CCCCCC' - } - }, - "boundaryGap": true, - "data": [] - }, - "yAxis": { - "type": 'value', - "axisTick": { - "show": false, - }, - "axisLabel": { - "color": '#666666' - }, - "axisLine": { - "lineStyle": { - "color": '#CCCCCC' - } - }, - }, - "seriesTemplate": { - "name": '', - "type": 'bar', - "data": [], - "barwidth": 20, - "label": { - "show": true, - "color": "#666666", - "position": 'top', - }, - }, - }, - "line": { - "color": color, - "title": { - "text": '' - }, - "tooltip": { - "trigger": 'axis' - }, - "grid": { - "top": 30, - "bottom": 50, - "right": 15, - "left": 40 - }, - "legend": { - "bottom": 'left', - }, - "toolbox": { - "show": false, - }, - "xAxis": { - "type": 'category', - "axisLabel": { - "color": '#666666' - }, - "axisLine": { - "lineStyle": { - "color": '#CCCCCC' - } - }, - "boundaryGap": true, - "data": [] - }, - "yAxis": { - "type": 'value', - "axisTick": { - "show": false, - }, - "axisLabel": { - "color": '#666666' - }, - "axisLine": { - "lineStyle": { - "color": '#CCCCCC' - } - }, - }, - "seriesTemplate": { - "name": '', - "type": 'line', - "data": [], - "barwidth": 20, - "label": { - "show": true, - "color": "#666666", - "position": 'top', - }, - }, - }, - "area": { - "color": color, - "title": { - "text": '' - }, - "tooltip": { - "trigger": 'axis' - }, - "grid": { - "top": 30, - "bottom": 50, - "right": 15, - "left": 40 - }, - "legend": { - "bottom": 'left', - }, - "toolbox": { - "show": false, - }, - "xAxis": { - "type": 'category', - "axisLabel": { - "color": '#666666' - }, - "axisLine": { - "lineStyle": { - "color": '#CCCCCC' - } - }, - "boundaryGap": true, - "data": [] - }, - "yAxis": { - "type": 'value', - "axisTick": { - "show": false, - }, - "axisLabel": { - "color": '#666666' - }, - "axisLine": { - "lineStyle": { - "color": '#CCCCCC' - } - }, - }, - "seriesTemplate": { - "name": '', - "type": 'line', - "data": [], - "areaStyle": {}, - "label": { - "show": true, - "color": "#666666", - "position": 'top', - }, - }, - }, - "pie": { - "color": color, - "title": { - "text": '' - }, - "tooltip": { - "trigger": 'item' - }, - "grid": { - "top": 40, - "bottom": 30, - "right": 15, - "left": 15 - }, - "legend": { - "bottom": 'left', - }, - "seriesTemplate": { - "name": '', - "type": 'pie', - "data": [], - "radius": '50%', - "label": { - "show": true, - "color": "#666666", - "position": 'top', - }, - }, - }, - "ring": { - "color": color, - "title": { - "text": '' - }, - "tooltip": { - "trigger": 'item' - }, - "grid": { - "top": 40, - "bottom": 30, - "right": 15, - "left": 15 - }, - "legend": { - "bottom": 'left', - }, - "seriesTemplate": { - "name": '', - "type": 'pie', - "data": [], - "radius": ['40%', '70%'], - "avoidLabelOverlap": false, - "label": { - "show": true, - "color": "#666666", - "position": 'top', - }, - "labelLine": { - "show": true - }, - }, - }, - "rose": { - "color": color, - "title": { - "text": '' - }, - "tooltip": { - "trigger": 'item' - }, - "legend": { - "top": 'bottom' - }, - "seriesTemplate": { - "name": '', - "type": 'pie', - "data": [], - "radius": "55%", - "center": ['50%', '50%'], - "roseType": 'area', - }, - }, - "funnel": { - "color": color, - "title": { - "text": '' - }, - "tooltip": { - "trigger": 'item', - "formatter": "{b} : {c}%" - }, - "legend": { - "top": 'bottom' - }, - "seriesTemplate": { - "name": '', - "type": 'funnel', - "left": '10%', - "top": 60, - "bottom": 60, - "width": '80%', - "min": 0, - "max": 100, - "minSize": '0%', - "maxSize": '100%', - "sort": 'descending', - "gap": 2, - "label": { - "show": true, - "position": 'inside' - }, - "labelLine": { - "length": 10, - "lineStyle": { - "width": 1, - "type": 'solid' - } - }, - "itemStyle": { - "bordercolor": '#fff', - "borderwidth": 1 - }, - "emphasis": { - "label": { - "fontSize": 20 - } - }, - "data": [], - }, - }, - "gauge": { - "color": color, - "tooltip": { - "formatter": '{a}
{b} : {c}%' - }, - "seriesTemplate": { - "name": '业务指标', - "type": 'gauge', - "detail": {"formatter": '{value}%'}, - "data": [{"value": 50, "name": '完成率'}] - }, - }, - "candle": { - "xAxis": { - "data": [] - }, - "yAxis": {}, - "color": color, - "title": { - "text": '' - }, - "dataZoom": [{ - "type": 'inside', - "xAxisIndex": [0, 1], - "start": 10, - "end": 100 - }, - { - "show": true, - "xAxisIndex": [0, 1], - "type": 'slider', - "bottom": 10, - "start": 10, - "end": 100 - } - ], - "seriesTemplate": { - "name": '', - "type": 'k', - "data": [], - }, - } -} - -export default cfe; diff --git a/sport-erp-admin/uni_modules/qiun-data-charts/js_sdk/u-charts/config-ucharts.js b/sport-erp-admin/uni_modules/qiun-data-charts/js_sdk/u-charts/config-ucharts.js deleted file mode 100644 index 2623a2e..0000000 --- a/sport-erp-admin/uni_modules/qiun-data-charts/js_sdk/u-charts/config-ucharts.js +++ /dev/null @@ -1,606 +0,0 @@ -/* - * uCharts® - * 高性能跨平台图表库,支持H5、APP、小程序(微信/支付宝/百度/头条/QQ/360)、Vue、Taro等支持canvas的框架平台 - * Copyright (c) 2021 QIUN®秋云 https://www.ucharts.cn All rights reserved. - * Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) - * 复制使用请保留本段注释,感谢支持开源! - * - * uCharts®官方网站 - * https://www.uCharts.cn - * - * 开源地址: - * https://gitee.com/uCharts/uCharts - * - * uni-app插件市场地址: - * http://ext.dcloud.net.cn/plugin?id=271 - * - */ - -// 主题颜色配置:如每个图表类型需要不同主题,请在对应图表类型上更改color属性 -const color = ['#1890FF', '#91CB74', '#FAC858', '#EE6666', '#73C0DE', '#3CA272', '#FC8452', '#9A60B4', '#ea7ccc']; - -//事件转换函数,主要用作格式化x轴为时间轴,根据需求自行修改 -const formatDateTime = (timeStamp, returnType)=>{ - let date = new Date(); - date.setTime(timeStamp * 1000); - let y = date.getFullYear(); - let m = date.getMonth() + 1; - m = m < 10 ? ('0' + m) : m; - let d = date.getDate(); - d = d < 10 ? ('0' + d) : d; - let h = date.getHours(); - h = h < 10 ? ('0' + h) : h; - let minute = date.getMinutes(); - let second = date.getSeconds(); - minute = minute < 10 ? ('0' + minute) : minute; - second = second < 10 ? ('0' + second) : second; - if(returnType == 'full'){return y + '-' + m + '-' + d + ' '+ h +':' + minute + ':' + second;} - if(returnType == 'y-m-d'){return y + '-' + m + '-' + d;} - if(returnType == 'h:m'){return h +':' + minute;} - if(returnType == 'h:m:s'){return h +':' + minute +':' + second;} - return [y, m, d, h, minute, second]; -} - -const cfu = { - //demotype为自定义图表类型,一般不需要自定义图表类型,只需要改根节点上对应的类型即可 - "type":["pie","ring","rose","word","funnel","map","arcbar","line","column","mount","bar","area","radar","gauge","candle","mix","tline","tarea","scatter","bubble","demotype"], - "range":["饼状图","圆环图","玫瑰图","词云图","漏斗图","地图","圆弧进度条","折线图","柱状图","山峰图","条状图","区域图","雷达图","仪表盘","K线图","混合图","时间轴折线","时间轴区域","散点图","气泡图","自定义类型"], - //增加自定义图表类型,如果需要categories,请在这里加入您的图表类型,例如最后的"demotype" - //自定义类型时需要注意"tline","tarea","scatter","bubble"等时间轴(矢量x轴)类图表,没有categories,不需要加入categories - "categories":["line","column","mount","bar","area","radar","gauge","candle","mix","demotype"], - //instance为实例变量承载属性,不要删除 - "instance":{}, - //option为opts及eopts承载属性,不要删除 - "option":{}, - //下面是自定义format配置,因除H5端外的其他端无法通过props传递函数,只能通过此属性对应下标的方式来替换 - "formatter":{ - "yAxisDemo1":function(val, index, opts){return val+'元'}, - "yAxisDemo2":function(val, index, opts){return val.toFixed(2)}, - "xAxisDemo1":function(val, index, opts){return val+'年';}, - "xAxisDemo2":function(val, index, opts){return formatDateTime(val,'h:m')}, - "seriesDemo1":function(val, index, series, opts){return val+'元'}, - "tooltipDemo1":function(item, category, index, opts){ - if(index==0){ - return '随便用'+item.data+'年' - }else{ - return '其他我没改'+item.data+'天' - } - }, - "pieDemo":function(val, index, series, opts){ - if(index !== undefined){ - return series[index].name+':'+series[index].data+'元' - } - }, - }, - //这里演示了自定义您的图表类型的option,可以随意命名,之后在组件上 type="demotype" 后,组件会调用这个花括号里的option,如果组件上还存在opts参数,会将demotype与opts中option合并后渲染图表。 - "demotype":{ - //我这里把曲线图当做了自定义图表类型,您可以根据需要随意指定类型或配置 - "type": "line", - "color": color, - "padding": [15,10,0,15], - "xAxis": { - "disableGrid": true, - }, - "yAxis": { - "gridType": "dash", - "dashLength": 2, - }, - "legend": { - }, - "extra": { - "line": { - "type": "curve", - "width": 2 - }, - } - }, - //下面是自定义配置,请添加项目所需的通用配置 - "pie":{ - "type": "pie", - "color": color, - "padding": [5,5,5,5], - "extra": { - "pie": { - "activeOpacity": 0.5, - "activeRadius": 10, - "offsetAngle": 0, - "labelWidth": 15, - "border": true, - "borderWidth": 3, - "borderColor": "#FFFFFF" - }, - } - }, - "ring":{ - "type": "ring", - "color": color, - "padding": [5,5,5,5], - "rotate": false, - "dataLabel": true, - "legend": { - "show": true, - "position": "right", - "lineHeight": 25, - }, - "title": { - "name": "收益率", - "fontSize": 15, - "color": "#666666" - }, - "subtitle": { - "name": "70%", - "fontSize": 25, - "color": "#7cb5ec" - }, - "extra": { - "ring": { - "ringWidth":30, - "activeOpacity": 0.5, - "activeRadius": 10, - "offsetAngle": 0, - "labelWidth": 15, - "border": true, - "borderWidth": 3, - "borderColor": "#FFFFFF" - }, - }, - }, - "rose":{ - "type": "rose", - "color": color, - "padding": [5,5,5,5], - "legend": { - "show": true, - "position": "left", - "lineHeight": 25, - }, - "extra": { - "rose": { - "type": "area", - "minRadius": 50, - "activeOpacity": 0.5, - "activeRadius": 10, - "offsetAngle": 0, - "labelWidth": 15, - "border": false, - "borderWidth": 2, - "borderColor": "#FFFFFF" - }, - } - }, - "word":{ - "type": "word", - "color": color, - "extra": { - "word": { - "type": "normal", - "autoColors": false - } - } - }, - "funnel":{ - "type": "funnel", - "color": color, - "padding": [15,15,0,15], - "extra": { - "funnel": { - "activeOpacity": 0.3, - "activeWidth": 10, - "border": true, - "borderWidth": 2, - "borderColor": "#FFFFFF", - "fillOpacity": 1, - "labelAlign": "right" - }, - } - }, - "map":{ - "type": "map", - "color": color, - "padding": [0,0,0,0], - "dataLabel": true, - "extra": { - "map": { - "border": true, - "borderWidth": 1, - "borderColor": "#666666", - "fillOpacity": 0.6, - "activeBorderColor": "#F04864", - "activeFillColor": "#FACC14", - "activeFillOpacity": 1 - }, - } - }, - "arcbar":{ - "type": "arcbar", - "color": color, - "title": { - "name": "百分比", - "fontSize": 25, - "color": "#00FF00" - }, - "subtitle": { - "name": "默认标题", - "fontSize": 15, - "color": "#666666" - }, - "extra": { - "arcbar": { - "type": "default", - "width": 12, - "backgroundColor": "#E9E9E9", - "startAngle": 0.75, - "endAngle": 0.25, - "gap": 2 - } - } - }, - "line":{ - "type": "line", - "color": color, - "padding": [15,10,0,15], - "xAxis": { - "disableGrid": true, - }, - "yAxis": { - "gridType": "dash", - "dashLength": 2, - }, - "legend": { - }, - "extra": { - "line": { - "type": "straight", - "width": 2, - "activeType": "hollow" - }, - } - }, - "tline":{ - "type": "line", - "color": color, - "padding": [15,10,0,15], - "xAxis": { - "disableGrid": false, - "boundaryGap":"justify", - }, - "yAxis": { - "gridType": "dash", - "dashLength": 2, - "data":[ - { - "min":0, - "max":80 - } - ] - }, - "legend": { - }, - "extra": { - "line": { - "type": "curve", - "width": 2, - "activeType": "hollow" - }, - } - }, - "tarea":{ - "type": "area", - "color": color, - "padding": [15,10,0,15], - "xAxis": { - "disableGrid": true, - "boundaryGap":"justify", - }, - "yAxis": { - "gridType": "dash", - "dashLength": 2, - "data":[ - { - "min":0, - "max":80 - } - ] - }, - "legend": { - }, - "extra": { - "area": { - "type": "curve", - "opacity": 0.2, - "addLine": true, - "width": 2, - "gradient": true, - "activeType": "hollow" - }, - } - }, - "column":{ - "type": "column", - "color": color, - "padding": [15,15,0,5], - "xAxis": { - "disableGrid": true, - }, - "yAxis": { - "data":[{"min":0}] - }, - "legend": { - }, - "extra": { - "column": { - "type": "group", - "width": 30, - "activeBgColor": "#000000", - "activeBgOpacity": 0.08 - }, - } - }, - "mount":{ - "type": "mount", - "color": color, - "padding": [15,15,0,5], - "xAxis": { - "disableGrid": true, - }, - "yAxis": { - "data":[{"min":0}] - }, - "legend": { - }, - "extra": { - "mount": { - "type": "mount", - "widthRatio": 1.5, - }, - } - }, - "bar":{ - "type": "bar", - "color": color, - "padding": [15,30,0,5], - "xAxis": { - "boundaryGap":"justify", - "disableGrid":false, - "min":0, - "axisLine":false - }, - "yAxis": { - }, - "legend": { - }, - "extra": { - "bar": { - "type": "group", - "width": 30, - "meterBorde": 1, - "meterFillColor": "#FFFFFF", - "activeBgColor": "#000000", - "activeBgOpacity": 0.08 - }, - } - }, - "area":{ - "type": "area", - "color": color, - "padding": [15,15,0,15], - "xAxis": { - "disableGrid": true, - }, - "yAxis": { - "gridType": "dash", - "dashLength": 2, - }, - "legend": { - }, - "extra": { - "area": { - "type": "straight", - "opacity": 0.2, - "addLine": true, - "width": 2, - "gradient": false, - "activeType": "hollow" - }, - } - }, - "radar":{ - "type": "radar", - "color": color, - "padding": [5,5,5,5], - "dataLabel": false, - "legend": { - "show": true, - "position": "right", - "lineHeight": 25, - }, - "extra": { - "radar": { - "gridType": "radar", - "gridColor": "#CCCCCC", - "gridCount": 3, - "opacity": 0.2, - "max": 200, - "labelShow": true - }, - } - }, - "gauge":{ - "type": "gauge", - "color": color, - "title": { - "name": "66Km/H", - "fontSize": 25, - "color": "#2fc25b", - "offsetY": 50 - }, - "subtitle": { - "name": "实时速度", - "fontSize": 15, - "color": "#1890ff", - "offsetY": -50 - }, - "extra": { - "gauge": { - "type": "default", - "width": 30, - "labelColor": "#666666", - "startAngle": 0.75, - "endAngle": 0.25, - "startNumber": 0, - "endNumber": 100, - "labelFormat": "", - "splitLine": { - "fixRadius": 0, - "splitNumber": 10, - "width": 30, - "color": "#FFFFFF", - "childNumber": 5, - "childWidth": 12 - }, - "pointer": { - "width": 24, - "color": "auto" - } - } - } - }, - "candle":{ - "type": "candle", - "color": color, - "padding": [15,15,0,15], - "enableScroll": true, - "enableMarkLine": true, - "dataLabel": false, - "xAxis": { - "labelCount": 4, - "itemCount": 40, - "disableGrid": true, - "gridColor": "#CCCCCC", - "gridType": "solid", - "dashLength": 4, - "scrollShow": true, - "scrollAlign": "left", - "scrollColor": "#A6A6A6", - "scrollBackgroundColor": "#EFEBEF" - }, - "yAxis": { - }, - "legend": { - }, - "extra": { - "candle": { - "color": { - "upLine": "#f04864", - "upFill": "#f04864", - "downLine": "#2fc25b", - "downFill": "#2fc25b" - }, - "average": { - "show": true, - "name": ["MA5","MA10","MA30"], - "day": [5,10,20], - "color": ["#1890ff","#2fc25b","#facc14"] - } - }, - "markLine": { - "type": "dash", - "dashLength": 5, - "data": [ - { - "value": 2150, - "lineColor": "#f04864", - "showLabel": true - }, - { - "value": 2350, - "lineColor": "#f04864", - "showLabel": true - } - ] - } - } - }, - "mix":{ - "type": "mix", - "color": color, - "padding": [15,15,0,15], - "xAxis": { - "disableGrid": true, - }, - "yAxis": { - "disabled": false, - "disableGrid": false, - "splitNumber": 5, - "gridType": "dash", - "dashLength": 4, - "gridColor": "#CCCCCC", - "padding": 10, - "showTitle": true, - "data": [] - }, - "legend": { - }, - "extra": { - "mix": { - "column": { - "width": 20 - } - }, - } - }, - "scatter":{ - "type": "scatter", - "color":color, - "padding":[15,15,0,15], - "dataLabel":false, - "xAxis": { - "disableGrid": false, - "gridType":"dash", - "splitNumber":5, - "boundaryGap":"justify", - "min":0 - }, - "yAxis": { - "disableGrid": false, - "gridType":"dash", - }, - "legend": { - }, - "extra": { - "scatter": { - }, - } - }, - "bubble":{ - "type": "bubble", - "color":color, - "padding":[15,15,0,15], - "xAxis": { - "disableGrid": false, - "gridType":"dash", - "splitNumber":5, - "boundaryGap":"justify", - "min":0, - "max":250 - }, - "yAxis": { - "disableGrid": false, - "gridType":"dash", - "data":[{ - "min":0, - "max":150 - }] - }, - "legend": { - }, - "extra": { - "bubble": { - "border":2, - "opacity": 0.5, - }, - } - } -} - -export default cfu; diff --git a/sport-erp-admin/uni_modules/qiun-data-charts/js_sdk/u-charts/readme.md b/sport-erp-admin/uni_modules/qiun-data-charts/js_sdk/u-charts/readme.md deleted file mode 100644 index d307ba3..0000000 --- a/sport-erp-admin/uni_modules/qiun-data-charts/js_sdk/u-charts/readme.md +++ /dev/null @@ -1,5 +0,0 @@ -# uCharts JSSDK说明 -1、如不使用uCharts组件,可直接引用u-charts.js,打包编译后会`自动压缩`,压缩后体积约为`120kb`。 -2、如果120kb的体积仍需压缩,请手到uCharts官网通过在线定制选择您需要的图表。 -3、config-ucharts.js为uCharts组件的用户配置文件,升级前请`自行备份config-ucharts.js`文件,以免被强制覆盖。 -4、config-echarts.js为ECharts组件的用户配置文件,升级前请`自行备份config-echarts.js`文件,以免被强制覆盖。 \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/qiun-data-charts/js_sdk/u-charts/u-charts.js b/sport-erp-admin/uni_modules/qiun-data-charts/js_sdk/u-charts/u-charts.js deleted file mode 100644 index f78bde5..0000000 --- a/sport-erp-admin/uni_modules/qiun-data-charts/js_sdk/u-charts/u-charts.js +++ /dev/null @@ -1,7706 +0,0 @@ -/* - * uCharts (R) - * 高性能跨平台图表库,支持H5、APP、小程序(微信/支付宝/百度/头条/QQ/360/快手)、Vue、Taro等支持canvas的框架平台 - * Copyright (C) 2018-2022 QIUN (R) 秋云 https://www.ucharts.cn All rights reserved. - * Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) - * 复制使用请保留本段注释,感谢支持开源! - * - * uCharts (R) 官方网站 - * https://www.uCharts.cn - * - * 开源地址: - * https://gitee.com/uCharts/uCharts - * - * uni-app插件市场地址: - * http://ext.dcloud.net.cn/plugin?id=271 - * - */ - -'use strict'; - -var config = { - version: 'v2.5.0-20230101', - yAxisWidth: 15, - xAxisHeight: 22, - padding: [10, 10, 10, 10], - rotate: false, - fontSize: 13, - fontColor: '#666666', - dataPointShape: ['circle', 'circle', 'circle', 'circle'], - color: ['#1890FF', '#91CB74', '#FAC858', '#EE6666', '#73C0DE', '#3CA272', '#FC8452', '#9A60B4', '#ea7ccc'], - linearColor: ['#0EE2F8', '#2BDCA8', '#FA7D8D', '#EB88E2', '#2AE3A0', '#0EE2F8', '#EB88E2', '#6773E3', '#F78A85'], - pieChartLinePadding: 15, - pieChartTextPadding: 5, - titleFontSize: 20, - subtitleFontSize: 15, - radarLabelTextMargin: 13, -}; - -var assign = function(target, ...varArgs) { - if (target == null) { - throw new TypeError('[uCharts] Cannot convert undefined or null to object'); - } - if (!varArgs || varArgs.length <= 0) { - return target; - } - // 深度合并对象 - function deepAssign(obj1, obj2) { - for (let key in obj2) { - obj1[key] = obj1[key] && obj1[key].toString() === "[object Object]" ? - deepAssign(obj1[key], obj2[key]) : obj1[key] = obj2[key]; - } - return obj1; - } - varArgs.forEach(val => { - target = deepAssign(target, val); - }); - return target; -}; - -var util = { - toFixed: function toFixed(num, limit) { - limit = limit || 2; - if (this.isFloat(num)) { - num = num.toFixed(limit); - } - return num; - }, - isFloat: function isFloat(num) { - return num % 1 !== 0; - }, - approximatelyEqual: function approximatelyEqual(num1, num2) { - return Math.abs(num1 - num2) < 1e-10; - }, - isSameSign: function isSameSign(num1, num2) { - return Math.abs(num1) === num1 && Math.abs(num2) === num2 || Math.abs(num1) !== num1 && Math.abs(num2) !== num2; - }, - isSameXCoordinateArea: function isSameXCoordinateArea(p1, p2) { - return this.isSameSign(p1.x, p2.x); - }, - isCollision: function isCollision(obj1, obj2) { - obj1.end = {}; - obj1.end.x = obj1.start.x + obj1.width; - obj1.end.y = obj1.start.y - obj1.height; - obj2.end = {}; - obj2.end.x = obj2.start.x + obj2.width; - obj2.end.y = obj2.start.y - obj2.height; - var flag = obj2.start.x > obj1.end.x || obj2.end.x < obj1.start.x || obj2.end.y > obj1.start.y || obj2.start.y < obj1.end.y; - return !flag; - } -}; - -//兼容H5点击事件 -function getH5Offset(e) { - e.mp = { - changedTouches: [] - }; - e.mp.changedTouches.push({ - x: e.offsetX, - y: e.offsetY - }); - return e; -} - -// hex 转 rgba -function hexToRgb(hexValue, opc) { - var rgx = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; - var hex = hexValue.replace(rgx, function(m, r, g, b) { - return r + r + g + g + b + b; - }); - var rgb = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); - var r = parseInt(rgb[1], 16); - var g = parseInt(rgb[2], 16); - var b = parseInt(rgb[3], 16); - return 'rgba(' + r + ',' + g + ',' + b + ',' + opc + ')'; -} - -function findRange(num, type, limit) { - if (isNaN(num)) { - throw new Error('[uCharts] series数据需为Number格式'); - } - limit = limit || 10; - type = type ? type : 'upper'; - var multiple = 1; - while (limit < 1) { - limit *= 10; - multiple *= 10; - } - if (type === 'upper') { - num = Math.ceil(num * multiple); - } else { - num = Math.floor(num * multiple); - } - while (num % limit !== 0) { - if (type === 'upper') { - if (num == num + 1) { //修复数据值过大num++无效的bug by 向日葵 @xrk_jy - break; - } - num++; - } else { - num--; - } - } - return num / multiple; -} - -function calCandleMA(dayArr, nameArr, colorArr, kdata) { - let seriesTemp = []; - for (let k = 0; k < dayArr.length; k++) { - let seriesItem = { - data: [], - name: nameArr[k], - color: colorArr[k] - }; - for (let i = 0, len = kdata.length; i < len; i++) { - if (i < dayArr[k]) { - seriesItem.data.push(null); - continue; - } - let sum = 0; - for (let j = 0; j < dayArr[k]; j++) { - sum += kdata[i - j][1]; - } - seriesItem.data.push(+(sum / dayArr[k]).toFixed(3)); - } - seriesTemp.push(seriesItem); - } - return seriesTemp; -} - -function calValidDistance(self, distance, chartData, config, opts) { - var dataChartAreaWidth = opts.width - opts.area[1] - opts.area[3]; - var dataChartWidth = chartData.eachSpacing * (opts.chartData.xAxisData.xAxisPoints.length - 1); - if(opts.type == 'mount' && opts.extra && opts.extra.mount && opts.extra.mount.widthRatio && opts.extra.mount.widthRatio > 1){ - if(opts.extra.mount.widthRatio>2) opts.extra.mount.widthRatio = 2 - dataChartWidth += (opts.extra.mount.widthRatio - 1)*chartData.eachSpacing; - } - var validDistance = distance; - if (distance >= 0) { - validDistance = 0; - self.uevent.trigger('scrollLeft'); - self.scrollOption.position = 'left' - opts.xAxis.scrollPosition = 'left'; - } else if (Math.abs(distance) >= dataChartWidth - dataChartAreaWidth) { - validDistance = dataChartAreaWidth - dataChartWidth; - self.uevent.trigger('scrollRight'); - self.scrollOption.position = 'right' - opts.xAxis.scrollPosition = 'right'; - } else { - self.scrollOption.position = distance - opts.xAxis.scrollPosition = distance; - } - return validDistance; -} - -function isInAngleRange(angle, startAngle, endAngle) { - function adjust(angle) { - while (angle < 0) { - angle += 2 * Math.PI; - } - while (angle > 2 * Math.PI) { - angle -= 2 * Math.PI; - } - return angle; - } - angle = adjust(angle); - startAngle = adjust(startAngle); - endAngle = adjust(endAngle); - if (startAngle > endAngle) { - endAngle += 2 * Math.PI; - if (angle < startAngle) { - angle += 2 * Math.PI; - } - } - return angle >= startAngle && angle <= endAngle; -} - -function createCurveControlPoints(points, i) { - function isNotMiddlePoint(points, i) { - if (points[i - 1] && points[i + 1]) { - return points[i].y >= Math.max(points[i - 1].y, points[i + 1].y) || points[i].y <= Math.min(points[i - 1].y, - points[i + 1].y); - } else { - return false; - } - } - function isNotMiddlePointX(points, i) { - if (points[i - 1] && points[i + 1]) { - return points[i].x >= Math.max(points[i - 1].x, points[i + 1].x) || points[i].x <= Math.min(points[i - 1].x, - points[i + 1].x); - } else { - return false; - } - } - var a = 0.2; - var b = 0.2; - var pAx = null; - var pAy = null; - var pBx = null; - var pBy = null; - if (i < 1) { - pAx = points[0].x + (points[1].x - points[0].x) * a; - pAy = points[0].y + (points[1].y - points[0].y) * a; - } else { - pAx = points[i].x + (points[i + 1].x - points[i - 1].x) * a; - pAy = points[i].y + (points[i + 1].y - points[i - 1].y) * a; - } - - if (i > points.length - 3) { - var last = points.length - 1; - pBx = points[last].x - (points[last].x - points[last - 1].x) * b; - pBy = points[last].y - (points[last].y - points[last - 1].y) * b; - } else { - pBx = points[i + 1].x - (points[i + 2].x - points[i].x) * b; - pBy = points[i + 1].y - (points[i + 2].y - points[i].y) * b; - } - if (isNotMiddlePoint(points, i + 1)) { - pBy = points[i + 1].y; - } - if (isNotMiddlePoint(points, i)) { - pAy = points[i].y; - } - if (isNotMiddlePointX(points, i + 1)) { - pBx = points[i + 1].x; - } - if (isNotMiddlePointX(points, i)) { - pAx = points[i].x; - } - if (pAy >= Math.max(points[i].y, points[i + 1].y) || pAy <= Math.min(points[i].y, points[i + 1].y)) { - pAy = points[i].y; - } - if (pBy >= Math.max(points[i].y, points[i + 1].y) || pBy <= Math.min(points[i].y, points[i + 1].y)) { - pBy = points[i + 1].y; - } - if (pAx >= Math.max(points[i].x, points[i + 1].x) || pAx <= Math.min(points[i].x, points[i + 1].x)) { - pAx = points[i].x; - } - if (pBx >= Math.max(points[i].x, points[i + 1].x) || pBx <= Math.min(points[i].x, points[i + 1].x)) { - pBx = points[i + 1].x; - } - return { - ctrA: { - x: pAx, - y: pAy - }, - ctrB: { - x: pBx, - y: pBy - } - }; -} - - -function convertCoordinateOrigin(x, y, center) { - return { - x: center.x + x, - y: center.y - y - }; -} - -function avoidCollision(obj, target) { - if (target) { - // is collision test - while (util.isCollision(obj, target)) { - if (obj.start.x > 0) { - obj.start.y--; - } else if (obj.start.x < 0) { - obj.start.y++; - } else { - if (obj.start.y > 0) { - obj.start.y++; - } else { - obj.start.y--; - } - } - } - } - return obj; -} - -function fixPieSeries(series, opts, config){ - let pieSeriesArr = []; - if(series.length>0 && series[0].data.constructor.toString().indexOf('Array') > -1){ - opts._pieSeries_ = series; - let oldseries = series[0].data; - for (var i = 0; i < oldseries.length; i++) { - oldseries[i].formatter = series[0].formatter; - oldseries[i].data = oldseries[i].value; - pieSeriesArr.push(oldseries[i]); - } - opts.series = pieSeriesArr; - }else{ - pieSeriesArr = series; - } - return pieSeriesArr; -} - -function fillSeries(series, opts, config) { - var index = 0; - for (var i = 0; i < series.length; i++) { - let item = series[i]; - if (!item.color) { - item.color = config.color[index]; - index = (index + 1) % config.color.length; - } - if (!item.linearIndex) { - item.linearIndex = i; - } - if (!item.index) { - item.index = 0; - } - if (!item.type) { - item.type = opts.type; - } - if (typeof item.show == "undefined") { - item.show = true; - } - if (!item.type) { - item.type = opts.type; - } - if (!item.pointShape) { - item.pointShape = "circle"; - } - if (!item.legendShape) { - switch (item.type) { - case 'line': - item.legendShape = "line"; - break; - case 'column': - case 'bar': - item.legendShape = "rect"; - break; - case 'area': - case 'mount': - item.legendShape = "triangle"; - break; - default: - item.legendShape = "circle"; - } - } - } - return series; -} - -function fillCustomColor(linearType, customColor, series, config) { - var newcolor = customColor || []; - if (linearType == 'custom' && newcolor.length == 0 ) { - newcolor = config.linearColor; - } - if (linearType == 'custom' && newcolor.length < series.length) { - let chazhi = series.length - newcolor.length; - for (var i = 0; i < chazhi; i++) { - newcolor.push(config.linearColor[(i + 1) % config.linearColor.length]); - } - } - return newcolor; -} - -function getDataRange(minData, maxData) { - var limit = 0; - var range = maxData - minData; - if (range >= 10000) { - limit = 1000; - } else if (range >= 1000) { - limit = 100; - } else if (range >= 100) { - limit = 10; - } else if (range >= 10) { - limit = 5; - } else if (range >= 1) { - limit = 1; - } else if (range >= 0.1) { - limit = 0.1; - } else if (range >= 0.01) { - limit = 0.01; - } else if (range >= 0.001) { - limit = 0.001; - } else if (range >= 0.0001) { - limit = 0.0001; - } else if (range >= 0.00001) { - limit = 0.00001; - } else { - limit = 0.000001; - } - return { - minRange: findRange(minData, 'lower', limit), - maxRange: findRange(maxData, 'upper', limit) - }; -} - -function measureText(text, fontSize, context) { - var width = 0; - text = String(text); - // #ifdef MP-ALIPAY || MP-BAIDU || APP-NVUE - context = false; - // #endif - if (context !== false && context !== undefined && context.setFontSize && context.measureText) { - context.setFontSize(fontSize); - return context.measureText(text).width; - } else { - var text = text.split(''); - for (let i = 0; i < text.length; i++) { - let item = text[i]; - if (/[a-zA-Z]/.test(item)) { - width += 7; - } else if (/[0-9]/.test(item)) { - width += 5.5; - } else if (/\./.test(item)) { - width += 2.7; - } else if (/-/.test(item)) { - width += 3.25; - } else if (/:/.test(item)) { - width += 2.5; - } else if (/[\u4e00-\u9fa5]/.test(item)) { - width += 10; - } else if (/\(|\)/.test(item)) { - width += 3.73; - } else if (/\s/.test(item)) { - width += 2.5; - } else if (/%/.test(item)) { - width += 8; - } else { - width += 10; - } - } - return width * fontSize / 10; - } -} - -function dataCombine(series) { - return series.reduce(function(a, b) { - return (a.data ? a.data : a).concat(b.data); - }, []); -} - -function dataCombineStack(series, len) { - var sum = new Array(len); - for (var j = 0; j < sum.length; j++) { - sum[j] = 0; - } - for (var i = 0; i < series.length; i++) { - for (var j = 0; j < sum.length; j++) { - sum[j] += series[i].data[j]; - } - } - return series.reduce(function(a, b) { - return (a.data ? a.data : a).concat(b.data).concat(sum); - }, []); -} - -function getTouches(touches, opts, e) { - let x, y; - if (touches.clientX) { - if (opts.rotate) { - y = opts.height - touches.clientX * opts.pix; - x = (touches.pageY - e.currentTarget.offsetTop - (opts.height / opts.pix / 2) * (opts.pix - 1)) * opts.pix; - } else { - x = touches.clientX * opts.pix; - y = (touches.pageY - e.currentTarget.offsetTop - (opts.height / opts.pix / 2) * (opts.pix - 1)) * opts.pix; - } - } else { - if (opts.rotate) { - y = opts.height - touches.x * opts.pix; - x = touches.y * opts.pix; - } else { - x = touches.x * opts.pix; - y = touches.y * opts.pix; - } - } - return { - x: x, - y: y - } -} - -function getSeriesDataItem(series, index, group) { - var data = []; - var newSeries = []; - var indexIsArr = index.constructor.toString().indexOf('Array') > -1; - if(indexIsArr){ - let tempSeries = filterSeries(series); - for (var i = 0; i < group.length; i++) { - newSeries.push(tempSeries[group[i]]); - } - }else{ - newSeries = series; - }; - for (let i = 0; i < newSeries.length; i++) { - let item = newSeries[i]; - let tmpindex = -1; - if(indexIsArr){ - tmpindex = index[i]; - }else{ - tmpindex = index; - } - if (item.data[tmpindex] !== null && typeof item.data[tmpindex] !== 'undefined' && item.show) { - let seriesItem = {}; - seriesItem.color = item.color; - seriesItem.type = item.type; - seriesItem.style = item.style; - seriesItem.pointShape = item.pointShape; - seriesItem.disableLegend = item.disableLegend; - seriesItem.legendShape = item.legendShape; - seriesItem.name = item.name; - seriesItem.show = item.show; - seriesItem.data = item.formatter ? item.formatter(item.data[tmpindex]) : item.data[tmpindex]; - data.push(seriesItem); - } - } - return data; -} - -function getMaxTextListLength(list, fontSize, context) { - var lengthList = list.map(function(item) { - return measureText(item, fontSize, context); - }); - return Math.max.apply(null, lengthList); -} - -function getRadarCoordinateSeries(length) { - var eachAngle = 2 * Math.PI / length; - var CoordinateSeries = []; - for (var i = 0; i < length; i++) { - CoordinateSeries.push(eachAngle * i); - } - return CoordinateSeries.map(function(item) { - return -1 * item + Math.PI / 2; - }); -} - -function getToolTipData(seriesData, opts, index, group, categories) { - var option = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {}; - var calPoints = opts.chartData.calPoints?opts.chartData.calPoints:[]; - let points = {}; - if(group.length > 0){ - let filterPoints = []; - for (let i = 0; i < group.length; i++) { - filterPoints.push(calPoints[group[i]]) - } - points = filterPoints[0][index[0]]; - }else{ - for (let i = 0; i < calPoints.length; i++) { - if(calPoints[i][index]){ - points = calPoints[i][index]; - break; - } - } - }; - var textList = seriesData.map(function(item) { - let titleText = null; - if (opts.categories && opts.categories.length>0) { - titleText = categories[index]; - }; - return { - text: option.formatter ? option.formatter(item, titleText, index, opts) : item.name + ': ' + item.data, - color: item.color, - legendShape: opts.extra.tooltip.legendShape == 'auto'? item.legendShape : opts.extra.tooltip.legendShape - }; - }); - var offset = { - x: Math.round(points.x), - y: Math.round(points.y) - }; - return { - textList: textList, - offset: offset - }; -} - -function getMixToolTipData(seriesData, opts, index, categories) { - var option = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {}; - var points = opts.chartData.xAxisPoints[index] + opts.chartData.eachSpacing / 2; - var textList = seriesData.map(function(item) { - return { - text: option.formatter ? option.formatter(item, categories[index], index, opts) : item.name + ': ' + item.data, - color: item.color, - disableLegend: item.disableLegend ? true : false, - legendShape: opts.extra.tooltip.legendShape == 'auto'? item.legendShape : opts.extra.tooltip.legendShape - }; - }); - textList = textList.filter(function(item) { - if (item.disableLegend !== true) { - return item; - } - }); - var offset = { - x: Math.round(points), - y: 0 - }; - return { - textList: textList, - offset: offset - }; -} - -function getCandleToolTipData(series, seriesData, opts, index, categories, extra) { - var option = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : {}; - var calPoints = opts.chartData.calPoints; - let upColor = extra.color.upFill; - let downColor = extra.color.downFill; - //颜色顺序为开盘,收盘,最低,最高 - let color = [upColor, upColor, downColor, upColor]; - var textList = []; - seriesData.map(function(item) { - if (index == 0) { - if (item.data[1] - item.data[0] < 0) { - color[1] = downColor; - } else { - color[1] = upColor; - } - } else { - if (item.data[0] < series[index - 1][1]) { - color[0] = downColor; - } - if (item.data[1] < item.data[0]) { - color[1] = downColor; - } - if (item.data[2] > series[index - 1][1]) { - color[2] = upColor; - } - if (item.data[3] < series[index - 1][1]) { - color[3] = downColor; - } - } - let text1 = { - text: '开盘:' + item.data[0], - color: color[0], - legendShape: opts.extra.tooltip.legendShape == 'auto'? item.legendShape : opts.extra.tooltip.legendShape - }; - let text2 = { - text: '收盘:' + item.data[1], - color: color[1], - legendShape: opts.extra.tooltip.legendShape == 'auto'? item.legendShape : opts.extra.tooltip.legendShape - }; - let text3 = { - text: '最低:' + item.data[2], - color: color[2], - legendShape: opts.extra.tooltip.legendShape == 'auto'? item.legendShape : opts.extra.tooltip.legendShape - }; - let text4 = { - text: '最高:' + item.data[3], - color: color[3], - legendShape: opts.extra.tooltip.legendShape == 'auto'? item.legendShape : opts.extra.tooltip.legendShape - }; - textList.push(text1, text2, text3, text4); - }); - var validCalPoints = []; - var offset = { - x: 0, - y: 0 - }; - for (let i = 0; i < calPoints.length; i++) { - let points = calPoints[i]; - if (typeof points[index] !== 'undefined' && points[index] !== null) { - validCalPoints.push(points[index]); - } - } - offset.x = Math.round(validCalPoints[0][0].x); - return { - textList: textList, - offset: offset - }; -} - -function filterSeries(series) { - let tempSeries = []; - for (let i = 0; i < series.length; i++) { - if (series[i].show == true) { - tempSeries.push(series[i]) - } - } - return tempSeries; -} - -function findCurrentIndex(currentPoints, calPoints, opts, config) { - var offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0; - var current={ index:-1, group:[] }; - var spacing = opts.chartData.eachSpacing / 2; - let xAxisPoints = []; - if (calPoints && calPoints.length > 0) { - if (!opts.categories) { - spacing = 0; - }else{ - for (let i = 1; i < opts.chartData.xAxisPoints.length; i++) { - xAxisPoints.push(opts.chartData.xAxisPoints[i] - spacing); - } - if ((opts.type == 'line' || opts.type == 'area') && opts.xAxis.boundaryGap == 'justify') { - xAxisPoints = opts.chartData.xAxisPoints; - } - } - if (isInExactChartArea(currentPoints, opts, config)) { - if (!opts.categories) { - let timePoints = Array(calPoints.length); - for (let i = 0; i < calPoints.length; i++) { - timePoints[i] = Array(calPoints[i].length) - for (let j = 0; j < calPoints[i].length; j++) { - timePoints[i][j] = (Math.abs(calPoints[i][j].x - currentPoints.x)); - } - }; - let pointValue = Array(timePoints.length); - let pointIndex = Array(timePoints.length); - for (let i = 0; i < timePoints.length; i++) { - pointValue[i] = Math.min.apply(null, timePoints[i]); - pointIndex[i] = timePoints[i].indexOf(pointValue[i]); - } - let minValue = Math.min.apply(null, pointValue); - current.index = []; - for (let i = 0; i < pointValue.length; i++) { - if(pointValue[i] == minValue){ - current.group.push(i); - current.index.push(pointIndex[i]); - } - }; - }else{ - xAxisPoints.forEach(function(item, index) { - if (currentPoints.x + offset + spacing > item) { - current.index = index; - } - }); - } - } - } - return current; -} - -function findBarChartCurrentIndex(currentPoints, calPoints, opts, config) { - var offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0; - var current={ index:-1, group:[] }; - var spacing = opts.chartData.eachSpacing / 2; - let yAxisPoints = opts.chartData.yAxisPoints; - if (calPoints && calPoints.length > 0) { - if (isInExactChartArea(currentPoints, opts, config)) { - yAxisPoints.forEach(function(item, index) { - if (currentPoints.y + offset + spacing > item) { - current.index = index; - } - }); - } - } - return current; -} - -function findLegendIndex(currentPoints, legendData, opts) { - let currentIndex = -1; - let gap = 0; - if (isInExactLegendArea(currentPoints, legendData.area)) { - let points = legendData.points; - let index = -1; - for (let i = 0, len = points.length; i < len; i++) { - let item = points[i]; - for (let j = 0; j < item.length; j++) { - index += 1; - let area = item[j]['area']; - if (area && currentPoints.x > area[0] - gap && currentPoints.x < area[2] + gap && currentPoints.y > area[1] - gap && currentPoints.y < area[3] + gap) { - currentIndex = index; - break; - } - } - } - return currentIndex; - } - return currentIndex; -} - -function isInExactLegendArea(currentPoints, area) { - return currentPoints.x > area.start.x && currentPoints.x < area.end.x && currentPoints.y > area.start.y && currentPoints.y < area.end.y; -} - -function isInExactChartArea(currentPoints, opts, config) { - return currentPoints.x <= opts.width - opts.area[1] + 10 && currentPoints.x >= opts.area[3] - 10 && currentPoints.y >= opts.area[0] && currentPoints.y <= opts.height - opts.area[2]; -} - -function findRadarChartCurrentIndex(currentPoints, radarData, count) { - var eachAngleArea = 2 * Math.PI / count; - var currentIndex = -1; - if (isInExactPieChartArea(currentPoints, radarData.center, radarData.radius)) { - var fixAngle = function fixAngle(angle) { - if (angle < 0) { - angle += 2 * Math.PI; - } - if (angle > 2 * Math.PI) { - angle -= 2 * Math.PI; - } - return angle; - }; - var angle = Math.atan2(radarData.center.y - currentPoints.y, currentPoints.x - radarData.center.x); - angle = -1 * angle; - if (angle < 0) { - angle += 2 * Math.PI; - } - var angleList = radarData.angleList.map(function(item) { - item = fixAngle(-1 * item); - return item; - }); - angleList.forEach(function(item, index) { - var rangeStart = fixAngle(item - eachAngleArea / 2); - var rangeEnd = fixAngle(item + eachAngleArea / 2); - if (rangeEnd < rangeStart) { - rangeEnd += 2 * Math.PI; - } - if (angle >= rangeStart && angle <= rangeEnd || angle + 2 * Math.PI >= rangeStart && angle + 2 * Math.PI <= rangeEnd) { - currentIndex = index; - } - }); - } - return currentIndex; -} - -function findFunnelChartCurrentIndex(currentPoints, funnelData) { - var currentIndex = -1; - for (var i = 0, len = funnelData.series.length; i < len; i++) { - var item = funnelData.series[i]; - if (currentPoints.x > item.funnelArea[0] && currentPoints.x < item.funnelArea[2] && currentPoints.y > item.funnelArea[1] && currentPoints.y < item.funnelArea[3]) { - currentIndex = i; - break; - } - } - return currentIndex; -} - -function findWordChartCurrentIndex(currentPoints, wordData) { - var currentIndex = -1; - for (var i = 0, len = wordData.length; i < len; i++) { - var item = wordData[i]; - if (currentPoints.x > item.area[0] && currentPoints.x < item.area[2] && currentPoints.y > item.area[1] && currentPoints.y < item.area[3]) { - currentIndex = i; - break; - } - } - return currentIndex; -} - -function findMapChartCurrentIndex(currentPoints, opts) { - var currentIndex = -1; - var cData = opts.chartData.mapData; - var data = opts.series; - var tmp = pointToCoordinate(currentPoints.y, currentPoints.x, cData.bounds, cData.scale, cData.xoffset, cData.yoffset); - var poi = [tmp.x, tmp.y]; - for (var i = 0, len = data.length; i < len; i++) { - var item = data[i].geometry.coordinates; - if (isPoiWithinPoly(poi, item, opts.chartData.mapData.mercator)) { - currentIndex = i; - break; - } - } - return currentIndex; -} - -function findRoseChartCurrentIndex(currentPoints, pieData, opts) { - var currentIndex = -1; - var series = getRoseDataPoints(opts._series_, opts.extra.rose.type, pieData.radius, pieData.radius); - if (pieData && pieData.center && isInExactPieChartArea(currentPoints, pieData.center, pieData.radius)) { - var angle = Math.atan2(pieData.center.y - currentPoints.y, currentPoints.x - pieData.center.x); - angle = -angle; - if(opts.extra.rose && opts.extra.rose.offsetAngle){ - angle = angle - opts.extra.rose.offsetAngle * Math.PI / 180; - } - for (var i = 0, len = series.length; i < len; i++) { - if (isInAngleRange(angle, series[i]._start_, series[i]._start_ + series[i]._rose_proportion_ * 2 * Math.PI)) { - currentIndex = i; - break; - } - } - } - return currentIndex; -} - -function findPieChartCurrentIndex(currentPoints, pieData, opts) { - var currentIndex = -1; - var series = getPieDataPoints(pieData.series); - if (pieData && pieData.center && isInExactPieChartArea(currentPoints, pieData.center, pieData.radius)) { - var angle = Math.atan2(pieData.center.y - currentPoints.y, currentPoints.x - pieData.center.x); - angle = -angle; - if(opts.extra.pie && opts.extra.pie.offsetAngle){ - angle = angle - opts.extra.pie.offsetAngle * Math.PI / 180; - } - if(opts.extra.ring && opts.extra.ring.offsetAngle){ - angle = angle - opts.extra.ring.offsetAngle * Math.PI / 180; - } - for (var i = 0, len = series.length; i < len; i++) { - if (isInAngleRange(angle, series[i]._start_, series[i]._start_ + series[i]._proportion_ * 2 * Math.PI)) { - currentIndex = i; - break; - } - } - } - return currentIndex; -} - -function isInExactPieChartArea(currentPoints, center, radius) { - return Math.pow(currentPoints.x - center.x, 2) + Math.pow(currentPoints.y - center.y, 2) <= Math.pow(radius, 2); -} - - -function splitPoints(points,eachSeries) { - var newPoints = []; - var items = []; - points.forEach(function(item, index) { - if(eachSeries.connectNulls){ - if (item !== null) { - items.push(item); - } - }else{ - if (item !== null) { - items.push(item); - } else { - if (items.length) { - newPoints.push(items); - } - items = []; - } - } - - }); - if (items.length) { - newPoints.push(items); - } - return newPoints; -} - - -function calLegendData(series, opts, config, chartData, context) { - let legendData = { - area: { - start: { - x: 0, - y: 0 - }, - end: { - x: 0, - y: 0 - }, - width: 0, - height: 0, - wholeWidth: 0, - wholeHeight: 0 - }, - points: [], - widthArr: [], - heightArr: [] - }; - if (opts.legend.show === false) { - chartData.legendData = legendData; - return legendData; - } - let padding = opts.legend.padding * opts.pix; - let margin = opts.legend.margin * opts.pix; - let fontSize = opts.legend.fontSize ? opts.legend.fontSize * opts.pix : config.fontSize; - let shapeWidth = 15 * opts.pix; - let shapeRight = 5 * opts.pix; - let lineHeight = Math.max(opts.legend.lineHeight * opts.pix, fontSize); - if (opts.legend.position == 'top' || opts.legend.position == 'bottom') { - let legendList = []; - let widthCount = 0; - let widthCountArr = []; - let currentRow = []; - for (let i = 0; i < series.length; i++) { - let item = series[i]; - const legendText = item.legendText ? item.legendText : item.name; - let itemWidth = shapeWidth + shapeRight + measureText(legendText || 'undefined', fontSize, context) + opts.legend.itemGap * opts.pix; - if (widthCount + itemWidth > opts.width - opts.area[1] - opts.area[3]) { - legendList.push(currentRow); - widthCountArr.push(widthCount - opts.legend.itemGap * opts.pix); - widthCount = itemWidth; - currentRow = [item]; - } else { - widthCount += itemWidth; - currentRow.push(item); - } - } - if (currentRow.length) { - legendList.push(currentRow); - widthCountArr.push(widthCount - opts.legend.itemGap * opts.pix); - legendData.widthArr = widthCountArr; - let legendWidth = Math.max.apply(null, widthCountArr); - switch (opts.legend.float) { - case 'left': - legendData.area.start.x = opts.area[3]; - legendData.area.end.x = opts.area[3] + legendWidth + 2 * padding; - break; - case 'right': - legendData.area.start.x = opts.width - opts.area[1] - legendWidth - 2 * padding; - legendData.area.end.x = opts.width - opts.area[1]; - break; - default: - legendData.area.start.x = (opts.width - legendWidth) / 2 - padding; - legendData.area.end.x = (opts.width + legendWidth) / 2 + padding; - } - legendData.area.width = legendWidth + 2 * padding; - legendData.area.wholeWidth = legendWidth + 2 * padding; - legendData.area.height = legendList.length * lineHeight + 2 * padding; - legendData.area.wholeHeight = legendList.length * lineHeight + 2 * padding + 2 * margin; - legendData.points = legendList; - } - } else { - let len = series.length; - let maxHeight = opts.height - opts.area[0] - opts.area[2] - 2 * margin - 2 * padding; - let maxLength = Math.min(Math.floor(maxHeight / lineHeight), len); - legendData.area.height = maxLength * lineHeight + padding * 2; - legendData.area.wholeHeight = maxLength * lineHeight + padding * 2; - switch (opts.legend.float) { - case 'top': - legendData.area.start.y = opts.area[0] + margin; - legendData.area.end.y = opts.area[0] + margin + legendData.area.height; - break; - case 'bottom': - legendData.area.start.y = opts.height - opts.area[2] - margin - legendData.area.height; - legendData.area.end.y = opts.height - opts.area[2] - margin; - break; - default: - legendData.area.start.y = (opts.height - legendData.area.height) / 2; - legendData.area.end.y = (opts.height + legendData.area.height) / 2; - } - let lineNum = len % maxLength === 0 ? len / maxLength : Math.floor((len / maxLength) + 1); - let currentRow = []; - for (let i = 0; i < lineNum; i++) { - let temp = series.slice(i * maxLength, i * maxLength + maxLength); - currentRow.push(temp); - } - legendData.points = currentRow; - if (currentRow.length) { - for (let i = 0; i < currentRow.length; i++) { - let item = currentRow[i]; - let maxWidth = 0; - for (let j = 0; j < item.length; j++) { - let itemWidth = shapeWidth + shapeRight + measureText(item[j].name || 'undefined', fontSize, context) + opts.legend.itemGap * opts.pix; - if (itemWidth > maxWidth) { - maxWidth = itemWidth; - } - } - legendData.widthArr.push(maxWidth); - legendData.heightArr.push(item.length * lineHeight + padding * 2); - } - let legendWidth = 0 - for (let i = 0; i < legendData.widthArr.length; i++) { - legendWidth += legendData.widthArr[i]; - } - legendData.area.width = legendWidth - opts.legend.itemGap * opts.pix + 2 * padding; - legendData.area.wholeWidth = legendData.area.width + padding; - } - } - switch (opts.legend.position) { - case 'top': - legendData.area.start.y = opts.area[0] + margin; - legendData.area.end.y = opts.area[0] + margin + legendData.area.height; - break; - case 'bottom': - legendData.area.start.y = opts.height - opts.area[2] - legendData.area.height - margin; - legendData.area.end.y = opts.height - opts.area[2] - margin; - break; - case 'left': - legendData.area.start.x = opts.area[3]; - legendData.area.end.x = opts.area[3] + legendData.area.width; - break; - case 'right': - legendData.area.start.x = opts.width - opts.area[1] - legendData.area.width; - legendData.area.end.x = opts.width - opts.area[1]; - break; - } - chartData.legendData = legendData; - return legendData; -} - -function calCategoriesData(categories, opts, config, eachSpacing, context) { - var result = { - angle: 0, - xAxisHeight: opts.xAxis.lineHeight * opts.pix + opts.xAxis.marginTop * opts.pix - }; - var fontSize = opts.xAxis.fontSize * opts.pix; - var categoriesTextLenth = categories.map(function(item,index) { - var xitem = opts.xAxis.formatter ? opts.xAxis.formatter(item,index,opts) : item; - return measureText(String(xitem), fontSize, context); - }); - var maxTextLength = Math.max.apply(this, categoriesTextLenth); - if (opts.xAxis.rotateLabel == true) { - result.angle = opts.xAxis.rotateAngle * Math.PI / 180; - let tempHeight = opts.xAxis.marginTop * opts.pix * 2 + Math.abs(maxTextLength * Math.sin(result.angle)) - tempHeight = tempHeight < fontSize + opts.xAxis.marginTop * opts.pix * 2 ? tempHeight + opts.xAxis.marginTop * opts.pix * 2 : tempHeight; - result.xAxisHeight = tempHeight; - } - if (opts.enableScroll && opts.xAxis.scrollShow) { - result.xAxisHeight += 6 * opts.pix; - } - if (opts.xAxis.disabled){ - result.xAxisHeight = 0; - } - return result; -} - -function getXAxisTextList(series, opts, config, stack) { - var index = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : -1; - var data; - if (stack == 'stack') { - data = dataCombineStack(series, opts.categories.length); - } else { - data = dataCombine(series); - } - var sorted = []; - // remove null from data - data = data.filter(function(item) { - //return item !== null; - if (typeof item === 'object' && item !== null) { - if (item.constructor.toString().indexOf('Array') > -1) { - return item !== null; - } else { - return item.value !== null; - } - } else { - return item !== null; - } - }); - data.map(function(item) { - if (typeof item === 'object') { - if (item.constructor.toString().indexOf('Array') > -1) { - if (opts.type == 'candle') { - item.map(function(subitem) { - sorted.push(subitem); - }) - } else { - sorted.push(item[0]); - } - } else { - sorted.push(item.value); - } - } else { - sorted.push(item); - } - }) - - var minData = 0; - var maxData = 0; - if (sorted.length > 0) { - minData = Math.min.apply(this, sorted); - maxData = Math.max.apply(this, sorted); - } - //为了兼容v1.9.0之前的项目 - if (index > -1) { - if (typeof opts.xAxis.data[index].min === 'number') { - minData = Math.min(opts.xAxis.data[index].min, minData); - } - if (typeof opts.xAxis.data[index].max === 'number') { - maxData = Math.max(opts.xAxis.data[index].max, maxData); - } - } else { - if (typeof opts.xAxis.min === 'number') { - minData = Math.min(opts.xAxis.min, minData); - } - if (typeof opts.xAxis.max === 'number') { - maxData = Math.max(opts.xAxis.max, maxData); - } - } - if (minData === maxData) { - var rangeSpan = maxData || 10; - maxData += rangeSpan; - } - //var dataRange = getDataRange(minData, maxData); - var minRange = minData; - var maxRange = maxData; - var range = []; - var eachRange = (maxRange - minRange) / opts.xAxis.splitNumber; - for (var i = 0; i <= opts.xAxis.splitNumber; i++) { - range.push(minRange + eachRange * i); - } - return range; -} - -function calXAxisData(series, opts, config, context) { - //堆叠图重算Y轴 - var columnstyle = assign({}, { - type: "" - }, opts.extra.bar); - var result = { - angle: 0, - xAxisHeight: opts.xAxis.lineHeight * opts.pix + opts.xAxis.marginTop * opts.pix - }; - result.ranges = getXAxisTextList(series, opts, config, columnstyle.type); - result.rangesFormat = result.ranges.map(function(item) { - //item = opts.xAxis.formatter ? opts.xAxis.formatter(item) : util.toFixed(item, 2); - item = util.toFixed(item, 2); - return item; - }); - var xAxisScaleValues = result.ranges.map(function(item) { - // 如果刻度值是浮点数,则保留两位小数 - item = util.toFixed(item, 2); - // 若有自定义格式则调用自定义的格式化函数 - //item = opts.xAxis.formatter ? opts.xAxis.formatter(Number(item)) : item; - return item; - }); - result = Object.assign(result, getXAxisPoints(xAxisScaleValues, opts, config)); - // 计算X轴刻度的属性譬如每个刻度的间隔,刻度的起始点\结束点以及总长 - var eachSpacing = result.eachSpacing; - var textLength = xAxisScaleValues.map(function(item) { - return measureText(item, opts.xAxis.fontSize * opts.pix, context); - }); - if (opts.xAxis.disabled === true) { - result.xAxisHeight = 0; - } - return result; -} - -function getRadarDataPoints(angleList, center, radius, series, opts) { - var process = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 1; - var radarOption = opts.extra.radar || {}; - radarOption.max = radarOption.max || 0; - var maxData = Math.max(radarOption.max, Math.max.apply(null, dataCombine(series))); - var data = []; - for (let i = 0; i < series.length; i++) { - let each = series[i]; - let listItem = {}; - listItem.color = each.color; - listItem.legendShape = each.legendShape; - listItem.pointShape = each.pointShape; - listItem.data = []; - each.data.forEach(function(item, index) { - let tmp = {}; - tmp.angle = angleList[index]; - tmp.proportion = item / maxData; - tmp.value = item; - tmp.position = convertCoordinateOrigin(radius * tmp.proportion * process * Math.cos(tmp.angle), radius * tmp.proportion * process * Math.sin(tmp.angle), center); - listItem.data.push(tmp); - }); - data.push(listItem); - } - return data; -} - -function getPieDataPoints(series, radius) { - var process = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; - var count = 0; - var _start_ = 0; - for (let i = 0; i < series.length; i++) { - let item = series[i]; - item.data = item.data === null ? 0 : item.data; - count += item.data; - } - for (let i = 0; i < series.length; i++) { - let item = series[i]; - item.data = item.data === null ? 0 : item.data; - if (count === 0) { - item._proportion_ = 1 / series.length * process; - } else { - item._proportion_ = item.data / count * process; - } - item._radius_ = radius; - } - for (let i = 0; i < series.length; i++) { - let item = series[i]; - item._start_ = _start_; - _start_ += 2 * item._proportion_ * Math.PI; - } - return series; -} - -function getFunnelDataPoints(series, radius, option, eachSpacing) { - var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1; - for (let i = 0; i < series.length; i++) { - if(option.type == 'funnel'){ - series[i].radius = series[i].data / series[0].data * radius * process; - }else{ - series[i].radius = (eachSpacing * (series.length - i)) / (eachSpacing * series.length) * radius * process; - } - series[i]._proportion_ = series[i].data / series[0].data; - } - // if(option.type !== 'pyramid'){ - // series.reverse(); - // } - return series; -} - -function getRoseDataPoints(series, type, minRadius, radius) { - var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1; - var count = 0; - var _start_ = 0; - var dataArr = []; - for (let i = 0; i < series.length; i++) { - let item = series[i]; - item.data = item.data === null ? 0 : item.data; - count += item.data; - dataArr.push(item.data); - } - var minData = Math.min.apply(null, dataArr); - var maxData = Math.max.apply(null, dataArr); - var radiusLength = radius - minRadius; - for (let i = 0; i < series.length; i++) { - let item = series[i]; - item.data = item.data === null ? 0 : item.data; - if (count === 0) { - item._proportion_ = 1 / series.length * process; - item._rose_proportion_ = 1 / series.length * process; - } else { - item._proportion_ = item.data / count * process; - if(type == 'area'){ - item._rose_proportion_ = 1 / series.length * process; - }else{ - item._rose_proportion_ = item.data / count * process; - } - } - item._radius_ = minRadius + radiusLength * ((item.data - minData) / (maxData - minData)) || radius; - } - for (let i = 0; i < series.length; i++) { - let item = series[i]; - item._start_ = _start_; - _start_ += 2 * item._rose_proportion_ * Math.PI; - } - return series; -} - -function getArcbarDataPoints(series, arcbarOption) { - var process = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; - if (process == 1) { - process = 0.999999; - } - for (let i = 0; i < series.length; i++) { - let item = series[i]; - item.data = item.data === null ? 0 : item.data; - let totalAngle; - if (arcbarOption.type == 'circle') { - totalAngle = 2; - } else { - if(arcbarOption.direction == 'ccw'){ - if (arcbarOption.startAngle < arcbarOption.endAngle) { - totalAngle = 2 + arcbarOption.startAngle - arcbarOption.endAngle; - } else { - totalAngle = arcbarOption.startAngle - arcbarOption.endAngle; - } - }else{ - if (arcbarOption.endAngle < arcbarOption.startAngle) { - totalAngle = 2 + arcbarOption.endAngle - arcbarOption.startAngle; - } else { - totalAngle = arcbarOption.startAngle - arcbarOption.endAngle; - } - } - } - item._proportion_ = totalAngle * item.data * process + arcbarOption.startAngle; - if(arcbarOption.direction == 'ccw'){ - item._proportion_ = arcbarOption.startAngle - totalAngle * item.data * process ; - } - if (item._proportion_ >= 2) { - item._proportion_ = item._proportion_ % 2; - } - } - return series; -} - -function getGaugeArcbarDataPoints(series, arcbarOption) { - var process = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; - if (process == 1) { - process = 0.999999; - } - for (let i = 0; i < series.length; i++) { - let item = series[i]; - item.data = item.data === null ? 0 : item.data; - let totalAngle; - if (arcbarOption.type == 'circle') { - totalAngle = 2; - } else { - if (arcbarOption.endAngle < arcbarOption.startAngle) { - totalAngle = 2 + arcbarOption.endAngle - arcbarOption.startAngle; - } else { - totalAngle = arcbarOption.startAngle - arcbarOption.endAngle; - } - } - item._proportion_ = totalAngle * item.data * process + arcbarOption.startAngle; - if (item._proportion_ >= 2) { - item._proportion_ = item._proportion_ % 2; - } - } - return series; -} - -function getGaugeAxisPoints(categories, startAngle, endAngle) { - let totalAngle; - if (endAngle < startAngle) { - totalAngle = 2 + endAngle - startAngle; - } else { - totalAngle = startAngle - endAngle; - } - let tempStartAngle = startAngle; - for (let i = 0; i < categories.length; i++) { - categories[i].value = categories[i].value === null ? 0 : categories[i].value; - categories[i]._startAngle_ = tempStartAngle; - categories[i]._endAngle_ = totalAngle * categories[i].value + startAngle; - if (categories[i]._endAngle_ >= 2) { - categories[i]._endAngle_ = categories[i]._endAngle_ % 2; - } - tempStartAngle = categories[i]._endAngle_; - } - return categories; -} - -function getGaugeDataPoints(series, categories, gaugeOption) { - let process = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1; - for (let i = 0; i < series.length; i++) { - let item = series[i]; - item.data = item.data === null ? 0 : item.data; - if (gaugeOption.pointer.color == 'auto') { - for (let i = 0; i < categories.length; i++) { - if (item.data <= categories[i].value) { - item.color = categories[i].color; - break; - } - } - } else { - item.color = gaugeOption.pointer.color; - } - let totalAngle; - if (gaugeOption.endAngle < gaugeOption.startAngle) { - totalAngle = 2 + gaugeOption.endAngle - gaugeOption.startAngle; - } else { - totalAngle = gaugeOption.startAngle - gaugeOption.endAngle; - } - item._endAngle_ = totalAngle * item.data + gaugeOption.startAngle; - item._oldAngle_ = gaugeOption.oldAngle; - if (gaugeOption.oldAngle < gaugeOption.endAngle) { - item._oldAngle_ += 2; - } - if (item.data >= gaugeOption.oldData) { - item._proportion_ = (item._endAngle_ - item._oldAngle_) * process + gaugeOption.oldAngle; - } else { - item._proportion_ = item._oldAngle_ - (item._oldAngle_ - item._endAngle_) * process; - } - if (item._proportion_ >= 2) { - item._proportion_ = item._proportion_ % 2; - } - } - return series; -} - -function getPieTextMaxLength(series, config, context, opts) { - series = getPieDataPoints(series); - let maxLength = 0; - for (let i = 0; i < series.length; i++) { - let item = series[i]; - let text = item.formatter ? item.formatter(+item._proportion_.toFixed(2)) : util.toFixed(item._proportion_ * 100) + '%'; - maxLength = Math.max(maxLength, measureText(text, item.textSize * opts.pix || config.fontSize, context)); - } - return maxLength; -} - -function fixColumeData(points, eachSpacing, columnLen, index, config, opts) { - return points.map(function(item) { - if (item === null) { - return null; - } - var seriesGap = 0; - var categoryGap = 0; - if (opts.type == 'mix') { - seriesGap = opts.extra.mix.column.seriesGap * opts.pix || 0; - categoryGap = opts.extra.mix.column.categoryGap * opts.pix || 0; - } else { - seriesGap = opts.extra.column.seriesGap * opts.pix || 0; - categoryGap = opts.extra.column.categoryGap * opts.pix || 0; - } - seriesGap = Math.min(seriesGap, eachSpacing / columnLen) - categoryGap = Math.min(categoryGap, eachSpacing / columnLen) - item.width = Math.ceil((eachSpacing - 2 * categoryGap - seriesGap * (columnLen - 1)) / columnLen); - if (opts.extra.mix && opts.extra.mix.column.width && +opts.extra.mix.column.width > 0) { - item.width = Math.min(item.width, +opts.extra.mix.column.width * opts.pix); - } - if (opts.extra.column && opts.extra.column.width && +opts.extra.column.width > 0) { - item.width = Math.min(item.width, +opts.extra.column.width * opts.pix); - } - if (item.width <= 0) { - item.width = 1; - } - item.x += (index + 0.5 - columnLen / 2) * (item.width + seriesGap); - return item; - }); -} - -function fixBarData(points, eachSpacing, columnLen, index, config, opts) { - return points.map(function(item) { - if (item === null) { - return null; - } - var seriesGap = 0; - var categoryGap = 0; - seriesGap = opts.extra.bar.seriesGap * opts.pix || 0; - categoryGap = opts.extra.bar.categoryGap * opts.pix || 0; - seriesGap = Math.min(seriesGap, eachSpacing / columnLen) - categoryGap = Math.min(categoryGap, eachSpacing / columnLen) - item.width = Math.ceil((eachSpacing - 2 * categoryGap - seriesGap * (columnLen - 1)) / columnLen); - if (opts.extra.bar && opts.extra.bar.width && +opts.extra.bar.width > 0) { - item.width = Math.min(item.width, +opts.extra.bar.width * opts.pix); - } - if (item.width <= 0) { - item.width = 1; - } - item.y += (index + 0.5 - columnLen / 2) * (item.width + seriesGap); - return item; - }); -} - -function fixColumeMeterData(points, eachSpacing, columnLen, index, config, opts, border) { - var categoryGap = opts.extra.column.categoryGap * opts.pix || 0; - return points.map(function(item) { - if (item === null) { - return null; - } - item.width = eachSpacing - 2 * categoryGap; - if (opts.extra.column && opts.extra.column.width && +opts.extra.column.width > 0) { - item.width = Math.min(item.width, +opts.extra.column.width * opts.pix); - } - if (index > 0) { - item.width -= border; - } - return item; - }); -} - -function fixColumeStackData(points, eachSpacing, columnLen, index, config, opts, series) { - var categoryGap = opts.extra.column.categoryGap * opts.pix || 0; - return points.map(function(item, indexn) { - if (item === null) { - return null; - } - item.width = Math.ceil(eachSpacing - 2 * categoryGap); - if (opts.extra.column && opts.extra.column.width && +opts.extra.column.width > 0) { - item.width = Math.min(item.width, +opts.extra.column.width * opts.pix); - } - if (item.width <= 0) { - item.width = 1; - } - return item; - }); -} - -function fixBarStackData(points, eachSpacing, columnLen, index, config, opts, series) { - var categoryGap = opts.extra.bar.categoryGap * opts.pix || 0; - return points.map(function(item, indexn) { - if (item === null) { - return null; - } - item.width = Math.ceil(eachSpacing - 2 * categoryGap); - if (opts.extra.bar && opts.extra.bar.width && +opts.extra.bar.width > 0) { - item.width = Math.min(item.width, +opts.extra.bar.width * opts.pix); - } - if (item.width <= 0) { - item.width = 1; - } - return item; - }); -} - -function getXAxisPoints(categories, opts, config) { - var spacingValid = opts.width - opts.area[1] - opts.area[3]; - var dataCount = opts.enableScroll ? Math.min(opts.xAxis.itemCount, categories.length) : categories.length; - if ((opts.type == 'line' || opts.type == 'area' || opts.type == 'scatter' || opts.type == 'bubble' || opts.type == 'bar') && dataCount > 1 && opts.xAxis.boundaryGap == 'justify') { - dataCount -= 1; - } - var widthRatio = 0; - if(opts.type == 'mount' && opts.extra && opts.extra.mount && opts.extra.mount.widthRatio && opts.extra.mount.widthRatio > 1){ - if(opts.extra.mount.widthRatio>2) opts.extra.mount.widthRatio = 2 - widthRatio = opts.extra.mount.widthRatio - 1; - dataCount += widthRatio; - } - var eachSpacing = spacingValid / dataCount; - var xAxisPoints = []; - var startX = opts.area[3]; - var endX = opts.width - opts.area[1]; - categories.forEach(function(item, index) { - xAxisPoints.push(startX + widthRatio / 2 * eachSpacing + index * eachSpacing); - }); - if (opts.xAxis.boundaryGap !== 'justify') { - if (opts.enableScroll === true) { - xAxisPoints.push(startX + widthRatio * eachSpacing + categories.length * eachSpacing); - } else { - xAxisPoints.push(endX); - } - } - return { - xAxisPoints: xAxisPoints, - startX: startX, - endX: endX, - eachSpacing: eachSpacing - }; -} - -function getCandleDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config) { - var process = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 1; - var points = []; - var validHeight = opts.height - opts.area[0] - opts.area[2]; - data.forEach(function(item, index) { - if (item === null) { - points.push(null); - } else { - var cPoints = []; - item.forEach(function(items, indexs) { - var point = {}; - point.x = xAxisPoints[index] + Math.round(eachSpacing / 2); - var value = items.value || items; - var height = validHeight * (value - minRange) / (maxRange - minRange); - height *= process; - point.y = opts.height - Math.round(height) - opts.area[2]; - cPoints.push(point); - }); - points.push(cPoints); - } - }); - return points; -} - -function getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config) { - var process = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 1; - var boundaryGap = 'center'; - if (opts.type == 'line' || opts.type == 'area' || opts.type == 'scatter' || opts.type == 'bubble' ) { - boundaryGap = opts.xAxis.boundaryGap; - } - var points = []; - var validHeight = opts.height - opts.area[0] - opts.area[2]; - var validWidth = opts.width - opts.area[1] - opts.area[3]; - data.forEach(function(item, index) { - if (item === null) { - points.push(null); - } else { - var point = {}; - point.color = item.color; - point.x = xAxisPoints[index]; - var value = item; - if (typeof item === 'object' && item !== null) { - if (item.constructor.toString().indexOf('Array') > -1) { - let xranges, xminRange, xmaxRange; - xranges = [].concat(opts.chartData.xAxisData.ranges); - xminRange = xranges.shift(); - xmaxRange = xranges.pop(); - value = item[1]; - point.x = opts.area[3] + validWidth * (item[0] - xminRange) / (xmaxRange - xminRange); - if(opts.type == 'bubble'){ - point.r = item[2]; - point.t = item[3]; - } - } else { - value = item.value; - } - } - if (boundaryGap == 'center') { - point.x += eachSpacing / 2; - } - var height = validHeight * (value - minRange) / (maxRange - minRange); - height *= process; - point.y = opts.height - height - opts.area[2]; - points.push(point); - } - }); - return points; -} - -function getLineDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, lineOption, process){ - var process = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1; - var boundaryGap = opts.xAxis.boundaryGap; - var points = []; - var validHeight = opts.height - opts.area[0] - opts.area[2]; - var validWidth = opts.width - opts.area[1] - opts.area[3]; - data.forEach(function(item, index) { - if (item === null) { - points.push(null); - } else { - var point = {}; - point.color = item.color; - if(lineOption.animation == 'vertical'){ - point.x = xAxisPoints[index]; - var value = item; - if (typeof item === 'object' && item !== null) { - if (item.constructor.toString().indexOf('Array') > -1) { - let xranges, xminRange, xmaxRange; - xranges = [].concat(opts.chartData.xAxisData.ranges); - xminRange = xranges.shift(); - xmaxRange = xranges.pop(); - value = item[1]; - point.x = opts.area[3] + validWidth * (item[0] - xminRange) / (xmaxRange - xminRange); - } else { - value = item.value; - } - } - if (boundaryGap == 'center') { - point.x += eachSpacing / 2; - } - var height = validHeight * (value - minRange) / (maxRange - minRange); - height *= process; - point.y = opts.height - height - opts.area[2]; - points.push(point); - }else{ - point.x = xAxisPoints[0] + eachSpacing * index * process; - var value = item; - if (boundaryGap == 'center') { - point.x += eachSpacing / 2; - } - var height = validHeight * (value - minRange) / (maxRange - minRange); - point.y = opts.height - height - opts.area[2]; - points.push(point); - } - } - }); - return points; -} - -function getColumnDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, zeroPoints, process){ - var process = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1; - var points = []; - var validHeight = opts.height - opts.area[0] - opts.area[2]; - var validWidth = opts.width - opts.area[1] - opts.area[3]; - data.forEach(function(item, index) { - if (item === null) { - points.push(null); - } else { - var point = {}; - point.color = item.color; - point.x = xAxisPoints[index]; - var value = item; - if (typeof item === 'object' && item !== null) { - if (item.constructor.toString().indexOf('Array') > -1) { - let xranges, xminRange, xmaxRange; - xranges = [].concat(opts.chartData.xAxisData.ranges); - xminRange = xranges.shift(); - xmaxRange = xranges.pop(); - value = item[1]; - point.x = opts.area[3] + validWidth * (item[0] - xminRange) / (xmaxRange - xminRange); - } else { - value = item.value; - } - } - point.x += eachSpacing / 2; - var height = validHeight * (value * process - minRange) / (maxRange - minRange); - point.y = opts.height - height - opts.area[2]; - points.push(point); - } - }); - return points; -} - -function getMountDataPoints(series, minRange, maxRange, xAxisPoints, eachSpacing, opts, mountOption, zeroPoints) { - var process = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1; - var points = []; - var validHeight = opts.height - opts.area[0] - opts.area[2]; - var validWidth = opts.width - opts.area[1] - opts.area[3]; - var mountWidth = eachSpacing * mountOption.widthRatio; - series.forEach(function(item, index) { - if (item === null) { - points.push(null); - } else { - var point = {}; - point.color = item.color; - point.x = xAxisPoints[index]; - point.x += eachSpacing / 2; - var value = item.data; - var height = validHeight * (value * process - minRange) / (maxRange - minRange); - point.y = opts.height - height - opts.area[2]; - point.value = value; - point.width = mountWidth; - points.push(point); - } - }); - return points; -} - -function getBarDataPoints(data, minRange, maxRange, yAxisPoints, eachSpacing, opts, config) { - var process = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 1; - var points = []; - var validHeight = opts.height - opts.area[0] - opts.area[2]; - var validWidth = opts.width - opts.area[1] - opts.area[3]; - data.forEach(function(item, index) { - if (item === null) { - points.push(null); - } else { - var point = {}; - point.color = item.color; - point.y = yAxisPoints[index]; - var value = item; - if (typeof item === 'object' && item !== null) { - value = item.value; - } - var height = validWidth * (value - minRange) / (maxRange - minRange); - height *= process; - point.height = height; - point.value = value; - point.x = height + opts.area[3]; - points.push(point); - } - }); - return points; -} - -function getStackDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, seriesIndex, stackSeries) { - var process = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : 1; - var points = []; - var validHeight = opts.height - opts.area[0] - opts.area[2]; - data.forEach(function(item, index) { - if (item === null) { - points.push(null); - } else { - var point = {}; - point.color = item.color; - point.x = xAxisPoints[index] + Math.round(eachSpacing / 2); - - if (seriesIndex > 0) { - var value = 0; - for (let i = 0; i <= seriesIndex; i++) { - value += stackSeries[i].data[index]; - } - var value0 = value - item; - var height = validHeight * (value - minRange) / (maxRange - minRange); - var height0 = validHeight * (value0 - minRange) / (maxRange - minRange); - } else { - var value = item; - if (typeof item === 'object' && item !== null) { - value = item.value; - } - var height = validHeight * (value - minRange) / (maxRange - minRange); - var height0 = 0; - } - var heightc = height0; - height *= process; - heightc *= process; - point.y = opts.height - Math.round(height) - opts.area[2]; - point.y0 = opts.height - Math.round(heightc) - opts.area[2]; - points.push(point); - } - }); - return points; -} - -function getBarStackDataPoints(data, minRange, maxRange, yAxisPoints, eachSpacing, opts, config, seriesIndex, stackSeries) { - var process = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : 1; - var points = []; - var validHeight = opts.width - opts.area[1] - opts.area[3]; - data.forEach(function(item, index) { - if (item === null) { - points.push(null); - } else { - var point = {}; - point.color = item.color; - point.y = yAxisPoints[index]; - if (seriesIndex > 0) { - var value = 0; - for (let i = 0; i <= seriesIndex; i++) { - value += stackSeries[i].data[index]; - } - var value0 = value - item; - var height = validHeight * (value - minRange) / (maxRange - minRange); - var height0 = validHeight * (value0 - minRange) / (maxRange - minRange); - } else { - var value = item; - if (typeof item === 'object' && item !== null) { - value = item.value; - } - var height = validHeight * (value - minRange) / (maxRange - minRange); - var height0 = 0; - } - var heightc = height0; - height *= process; - heightc *= process; - point.height = height - heightc; - point.x = opts.area[3] + height; - point.x0 = opts.area[3] + heightc; - points.push(point); - } - }); - return points; -} - -function getYAxisTextList(series, opts, config, stack, yData) { - var index = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : -1; - var data; - if (stack == 'stack') { - data = dataCombineStack(series, opts.categories.length); - } else { - data = dataCombine(series); - } - var sorted = []; - // remove null from data - data = data.filter(function(item) { - //return item !== null; - if (typeof item === 'object' && item !== null) { - if (item.constructor.toString().indexOf('Array') > -1) { - return item !== null; - } else { - return item.value !== null; - } - } else { - return item !== null; - } - }); - data.map(function(item) { - if (typeof item === 'object') { - if (item.constructor.toString().indexOf('Array') > -1) { - if (opts.type == 'candle') { - item.map(function(subitem) { - sorted.push(subitem); - }) - } else { - sorted.push(item[1]); - } - } else { - sorted.push(item.value); - } - } else { - sorted.push(item); - } - }) - var minData = yData.min || 0; - var maxData = yData.max || 0; - if (sorted.length > 0) { - minData = Math.min.apply(this, sorted); - maxData = Math.max.apply(this, sorted); - } - if (minData === maxData) { - if(maxData == 0){ - maxData = 10; - }else{ - minData = 0; - } - } - var dataRange = getDataRange(minData, maxData); - var minRange = (yData.min === undefined || yData.min === null) ? dataRange.minRange : yData.min; - var maxRange = (yData.max === undefined || yData.max === null) ? dataRange.maxRange : yData.max; - var eachRange = (maxRange - minRange) / opts.yAxis.splitNumber; - var range = []; - for (var i = 0; i <= opts.yAxis.splitNumber; i++) { - range.push(minRange + eachRange * i); - } - return range.reverse(); -} - -function calYAxisData(series, opts, config, context) { - //堆叠图重算Y轴 - var columnstyle = assign({}, { - type: "" - }, opts.extra.column); - //如果是多Y轴,重新计算 - var YLength = opts.yAxis.data.length; - var newSeries = new Array(YLength); - if (YLength > 0) { - for (let i = 0; i < YLength; i++) { - newSeries[i] = []; - for (let j = 0; j < series.length; j++) { - if (series[j].index == i) { - newSeries[i].push(series[j]); - } - } - } - var rangesArr = new Array(YLength); - var rangesFormatArr = new Array(YLength); - var yAxisWidthArr = new Array(YLength); - - for (let i = 0; i < YLength; i++) { - let yData = opts.yAxis.data[i]; - //如果总开关不显示,强制每个Y轴为不显示 - if (opts.yAxis.disabled == true) { - yData.disabled = true; - } - if(yData.type === 'categories'){ - if(!yData.formatter){ - yData.formatter = (val,index,opts) => {return val + (yData.unit || '')}; - } - yData.categories = yData.categories || opts.categories; - rangesArr[i] = yData.categories; - }else{ - if(!yData.formatter){ - yData.formatter = (val,index,opts) => {return util.toFixed(val, yData.tofix || 0) + (yData.unit || '')}; - } - rangesArr[i] = getYAxisTextList(newSeries[i], opts, config, columnstyle.type, yData, i); - } - let yAxisFontSizes = yData.fontSize * opts.pix || config.fontSize; - yAxisWidthArr[i] = { - position: yData.position ? yData.position : 'left', - width: 0 - }; - rangesFormatArr[i] = rangesArr[i].map(function(items,index) { - items = yData.formatter(items,index,opts); - yAxisWidthArr[i].width = Math.max(yAxisWidthArr[i].width, measureText(items, yAxisFontSizes, context) + 5); - return items; - }); - let calibration = yData.calibration ? 4 * opts.pix : 0; - yAxisWidthArr[i].width += calibration + 3 * opts.pix; - if (yData.disabled === true) { - yAxisWidthArr[i].width = 0; - } - } - } else { - var rangesArr = new Array(1); - var rangesFormatArr = new Array(1); - var yAxisWidthArr = new Array(1); - if(opts.type === 'bar'){ - rangesArr[0] = opts.categories; - if(!opts.yAxis.formatter){ - opts.yAxis.formatter = (val,index,opts) => {return val + (opts.yAxis.unit || '')} - } - }else{ - if(!opts.yAxis.formatter){ - opts.yAxis.formatter = (val,index,opts) => {return val.toFixed(opts.yAxis.tofix ) + (opts.yAxis.unit || '')} - } - rangesArr[0] = getYAxisTextList(series, opts, config, columnstyle.type, {}); - } - yAxisWidthArr[0] = { - position: 'left', - width: 0 - }; - var yAxisFontSize = opts.yAxis.fontSize * opts.pix || config.fontSize; - rangesFormatArr[0] = rangesArr[0].map(function(item,index) { - item = opts.yAxis.formatter(item,index,opts); - yAxisWidthArr[0].width = Math.max(yAxisWidthArr[0].width, measureText(item, yAxisFontSize, context) + 5); - return item; - }); - yAxisWidthArr[0].width += 3 * opts.pix; - if (opts.yAxis.disabled === true) { - yAxisWidthArr[0] = { - position: 'left', - width: 0 - }; - opts.yAxis.data[0] = { - disabled: true - }; - } else { - opts.yAxis.data[0] = { - disabled: false, - position: 'left', - max: opts.yAxis.max, - min: opts.yAxis.min, - formatter: opts.yAxis.formatter - }; - if(opts.type === 'bar'){ - opts.yAxis.data[0].categories = opts.categories; - opts.yAxis.data[0].type = 'categories'; - } - } - } - return { - rangesFormat: rangesFormatArr, - ranges: rangesArr, - yAxisWidth: yAxisWidthArr - }; -} - -function calTooltipYAxisData(point, series, opts, config, eachSpacing) { - let ranges = [].concat(opts.chartData.yAxisData.ranges); - let spacingValid = opts.height - opts.area[0] - opts.area[2]; - let minAxis = opts.area[0]; - let items = []; - for (let i = 0; i < ranges.length; i++) { - let maxVal = Math.max.apply(this, ranges[i]); - let minVal = Math.min.apply(this, ranges[i]); - let item = maxVal - (maxVal - minVal) * (point - minAxis) / spacingValid; - item = opts.yAxis.data && opts.yAxis.data[i].formatter ? opts.yAxis.data[i].formatter(item, i, opts) : item.toFixed(0); - items.push(String(item)) - } - return items; -} - -function calMarkLineData(points, opts) { - let minRange, maxRange; - let spacingValid = opts.height - opts.area[0] - opts.area[2]; - for (let i = 0; i < points.length; i++) { - points[i].yAxisIndex = points[i].yAxisIndex ? points[i].yAxisIndex : 0; - let range = [].concat(opts.chartData.yAxisData.ranges[points[i].yAxisIndex]); - minRange = range.pop(); - maxRange = range.shift(); - let height = spacingValid * (points[i].value - minRange) / (maxRange - minRange); - points[i].y = opts.height - Math.round(height) - opts.area[2]; - } - return points; -} - -function contextRotate(context, opts) { - if (opts.rotateLock !== true) { - context.translate(opts.height, 0); - context.rotate(90 * Math.PI / 180); - } else if (opts._rotate_ !== true) { - context.translate(opts.height, 0); - context.rotate(90 * Math.PI / 180); - opts._rotate_ = true; - } -} - -function drawPointShape(points, color, shape, context, opts) { - context.beginPath(); - if (opts.dataPointShapeType == 'hollow') { - context.setStrokeStyle(color); - context.setFillStyle(opts.background); - context.setLineWidth(2 * opts.pix); - } else { - context.setStrokeStyle("#ffffff"); - context.setFillStyle(color); - context.setLineWidth(1 * opts.pix); - } - if (shape === 'diamond') { - points.forEach(function(item, index) { - if (item !== null) { - context.moveTo(item.x, item.y - 4.5); - context.lineTo(item.x - 4.5, item.y); - context.lineTo(item.x, item.y + 4.5); - context.lineTo(item.x + 4.5, item.y); - context.lineTo(item.x, item.y - 4.5); - } - }); - } else if (shape === 'circle') { - points.forEach(function(item, index) { - if (item !== null) { - context.moveTo(item.x + 2.5 * opts.pix, item.y); - context.arc(item.x, item.y, 3 * opts.pix, 0, 2 * Math.PI, false); - } - }); - } else if (shape === 'square') { - points.forEach(function(item, index) { - if (item !== null) { - context.moveTo(item.x - 3.5, item.y - 3.5); - context.rect(item.x - 3.5, item.y - 3.5, 7, 7); - } - }); - } else if (shape === 'triangle') { - points.forEach(function(item, index) { - if (item !== null) { - context.moveTo(item.x, item.y - 4.5); - context.lineTo(item.x - 4.5, item.y + 4.5); - context.lineTo(item.x + 4.5, item.y + 4.5); - context.lineTo(item.x, item.y - 4.5); - } - }); - } else if (shape === 'none') { - return; - } - context.closePath(); - context.fill(); - context.stroke(); -} - -function drawActivePoint(points, color, shape, context, opts, option, seriesIndex) { - if(!opts.tooltip){ - return - } - if(opts.tooltip.group.length>0 && opts.tooltip.group.includes(seriesIndex) == false){ - return - } - var pointIndex = typeof opts.tooltip.index === 'number' ? opts.tooltip.index : opts.tooltip.index[opts.tooltip.group.indexOf(seriesIndex)]; - context.beginPath(); - if (option.activeType == 'hollow') { - context.setStrokeStyle(color); - context.setFillStyle(opts.background); - context.setLineWidth(2 * opts.pix); - } else { - context.setStrokeStyle("#ffffff"); - context.setFillStyle(color); - context.setLineWidth(1 * opts.pix); - } - if (shape === 'diamond') { - points.forEach(function(item, index) { - if (item !== null && pointIndex == index ) { - context.moveTo(item.x, item.y - 4.5); - context.lineTo(item.x - 4.5, item.y); - context.lineTo(item.x, item.y + 4.5); - context.lineTo(item.x + 4.5, item.y); - context.lineTo(item.x, item.y - 4.5); - } - }); - } else if (shape === 'circle') { - points.forEach(function(item, index) { - if (item !== null && pointIndex == index) { - context.moveTo(item.x + 2.5 * opts.pix, item.y); - context.arc(item.x, item.y, 3 * opts.pix, 0, 2 * Math.PI, false); - } - }); - } else if (shape === 'square') { - points.forEach(function(item, index) { - if (item !== null && pointIndex == index) { - context.moveTo(item.x - 3.5, item.y - 3.5); - context.rect(item.x - 3.5, item.y - 3.5, 7, 7); - } - }); - } else if (shape === 'triangle') { - points.forEach(function(item, index) { - if (item !== null && pointIndex == index) { - context.moveTo(item.x, item.y - 4.5); - context.lineTo(item.x - 4.5, item.y + 4.5); - context.lineTo(item.x + 4.5, item.y + 4.5); - context.lineTo(item.x, item.y - 4.5); - } - }); - } else if (shape === 'none') { - return; - } - context.closePath(); - context.fill(); - context.stroke(); -} - -function drawRingTitle(opts, config, context, center) { - var titlefontSize = opts.title.fontSize || config.titleFontSize; - var subtitlefontSize = opts.subtitle.fontSize || config.subtitleFontSize; - var title = opts.title.name || ''; - var subtitle = opts.subtitle.name || ''; - var titleFontColor = opts.title.color || opts.fontColor; - var subtitleFontColor = opts.subtitle.color || opts.fontColor; - var titleHeight = title ? titlefontSize : 0; - var subtitleHeight = subtitle ? subtitlefontSize : 0; - var margin = 5; - if (subtitle) { - var textWidth = measureText(subtitle, subtitlefontSize * opts.pix, context); - var startX = center.x - textWidth / 2 + (opts.subtitle.offsetX|| 0) * opts.pix ; - var startY = center.y + subtitlefontSize * opts.pix / 2 + (opts.subtitle.offsetY || 0) * opts.pix; - if (title) { - startY += (titleHeight * opts.pix + margin) / 2; - } - context.beginPath(); - context.setFontSize(subtitlefontSize * opts.pix); - context.setFillStyle(subtitleFontColor); - context.fillText(subtitle, startX, startY); - context.closePath(); - context.stroke(); - } - if (title) { - var _textWidth = measureText(title, titlefontSize * opts.pix, context); - var _startX = center.x - _textWidth / 2 + (opts.title.offsetX || 0); - var _startY = center.y + titlefontSize * opts.pix / 2 + (opts.title.offsetY || 0) * opts.pix; - if (subtitle) { - _startY -= (subtitleHeight * opts.pix + margin) / 2; - } - context.beginPath(); - context.setFontSize(titlefontSize * opts.pix); - context.setFillStyle(titleFontColor); - context.fillText(title, _startX, _startY); - context.closePath(); - context.stroke(); - } -} - -function drawPointText(points, series, config, context, opts) { - // 绘制数据文案 - var data = series.data; - var textOffset = series.textOffset ? series.textOffset : 0; - points.forEach(function(item, index) { - if (item !== null) { - context.beginPath(); - var fontSize = series.textSize ? series.textSize * opts.pix : config.fontSize; - context.setFontSize(fontSize); - context.setFillStyle(series.textColor || opts.fontColor); - var value = data[index] - if (typeof data[index] === 'object' && data[index] !== null) { - if (data[index].constructor.toString().indexOf('Array')>-1) { - value = data[index][1]; - } else { - value = data[index].value - } - } - var formatVal = series.formatter ? series.formatter(value,index,series,opts) : value; - context.setTextAlign('center'); - context.fillText(String(formatVal), item.x, item.y - 4 + textOffset * opts.pix); - context.closePath(); - context.stroke(); - context.setTextAlign('left'); - } - }); -} - -function drawColumePointText(points, series, config, context, opts) { - // 绘制数据文案 - var data = series.data; - var textOffset = series.textOffset ? series.textOffset : 0; - var Position = opts.extra.column.labelPosition; - points.forEach(function(item, index) { - if (item !== null) { - context.beginPath(); - var fontSize = series.textSize ? series.textSize * opts.pix : config.fontSize; - context.setFontSize(fontSize); - context.setFillStyle(series.textColor || opts.fontColor); - var value = data[index] - if (typeof data[index] === 'object' && data[index] !== null) { - if (data[index].constructor.toString().indexOf('Array')>-1) { - value = data[index][1]; - } else { - value = data[index].value - } - } - var formatVal = series.formatter ? series.formatter(value,index,series,opts) : value; - context.setTextAlign('center'); - var startY = item.y - 4 * opts.pix + textOffset * opts.pix; - if(item.y > series.zeroPoints){ - startY = item.y + textOffset * opts.pix + fontSize; - } - if(Position == 'insideTop'){ - startY = item.y + fontSize + textOffset * opts.pix; - if(item.y > series.zeroPoints){ - startY = item.y - textOffset * opts.pix - 4 * opts.pix; - } - } - if(Position == 'center'){ - startY = item.y + textOffset * opts.pix + (opts.height - opts.area[2] - item.y + fontSize)/2; - if(series.zeroPoints < opts.height - opts.area[2]){ - startY = item.y + textOffset * opts.pix + (series.zeroPoints - item.y + fontSize)/2; - } - if(item.y > series.zeroPoints){ - startY = item.y - textOffset * opts.pix - (item.y - series.zeroPoints - fontSize)/2; - } - if(opts.extra.column.type == 'stack'){ - startY = item.y + textOffset * opts.pix + (item.y0 - item.y + fontSize)/2; - } - } - if(Position == 'bottom'){ - startY = opts.height - opts.area[2] + textOffset * opts.pix - 4 * opts.pix; - if(series.zeroPoints < opts.height - opts.area[2]){ - startY = series.zeroPoints + textOffset * opts.pix - 4 * opts.pix; - } - if(item.y > series.zeroPoints){ - startY = series.zeroPoints - textOffset * opts.pix + fontSize + 2 * opts.pix; - } - if(opts.extra.column.type == 'stack'){ - startY = item.y0 + textOffset * opts.pix - 4 * opts.pix; - } - } - context.fillText(String(formatVal), item.x, startY); - context.closePath(); - context.stroke(); - context.setTextAlign('left'); - } - }); -} - -function drawMountPointText(points, series, config, context, opts, zeroPoints) { - // 绘制数据文案 - var data = series.data; - var textOffset = series.textOffset ? series.textOffset : 0; - var Position = opts.extra.mount.labelPosition; - points.forEach(function(item, index) { - if (item !== null) { - context.beginPath(); - var fontSize = series[index].textSize ? series[index].textSize * opts.pix : config.fontSize; - context.setFontSize(fontSize); - context.setFillStyle(series[index].textColor || opts.fontColor); - var value = item.value - var formatVal = series[index].formatter ? series[index].formatter(value,index,series,opts) : value; - context.setTextAlign('center'); - var startY = item.y - 4 * opts.pix + textOffset * opts.pix; - if(item.y > zeroPoints){ - startY = item.y + textOffset * opts.pix + fontSize; - } - context.fillText(String(formatVal), item.x, startY); - context.closePath(); - context.stroke(); - context.setTextAlign('left'); - } - }); -} - -function drawBarPointText(points, series, config, context, opts) { - // 绘制数据文案 - var data = series.data; - var textOffset = series.textOffset ? series.textOffset : 0; - points.forEach(function(item, index) { - if (item !== null) { - context.beginPath(); - var fontSize = series.textSize ? series.textSize * opts.pix : config.fontSize; - context.setFontSize(fontSize); - context.setFillStyle(series.textColor || opts.fontColor); - var value = data[index] - if (typeof data[index] === 'object' && data[index] !== null) { - value = data[index].value ; - } - var formatVal = series.formatter ? series.formatter(value,index,series,opts) : value; - context.setTextAlign('left'); - context.fillText(String(formatVal), item.x + 4 * opts.pix , item.y + fontSize / 2 - 3 ); - context.closePath(); - context.stroke(); - } - }); -} - -function drawGaugeLabel(gaugeOption, radius, centerPosition, opts, config, context) { - radius -= gaugeOption.width / 2 + gaugeOption.labelOffset * opts.pix; - radius = radius < 10 ? 10 : radius; - let totalAngle; - if (gaugeOption.endAngle < gaugeOption.startAngle) { - totalAngle = 2 + gaugeOption.endAngle - gaugeOption.startAngle; - } else { - totalAngle = gaugeOption.startAngle - gaugeOption.endAngle; - } - let splitAngle = totalAngle / gaugeOption.splitLine.splitNumber; - let totalNumber = gaugeOption.endNumber - gaugeOption.startNumber; - let splitNumber = totalNumber / gaugeOption.splitLine.splitNumber; - let nowAngle = gaugeOption.startAngle; - let nowNumber = gaugeOption.startNumber; - for (let i = 0; i < gaugeOption.splitLine.splitNumber + 1; i++) { - var pos = { - x: radius * Math.cos(nowAngle * Math.PI), - y: radius * Math.sin(nowAngle * Math.PI) - }; - var labelText = gaugeOption.formatter ? gaugeOption.formatter(nowNumber,i,opts) : nowNumber; - pos.x += centerPosition.x - measureText(labelText, config.fontSize, context) / 2; - pos.y += centerPosition.y; - var startX = pos.x; - var startY = pos.y; - context.beginPath(); - context.setFontSize(config.fontSize); - context.setFillStyle(gaugeOption.labelColor || opts.fontColor); - context.fillText(labelText, startX, startY + config.fontSize / 2); - context.closePath(); - context.stroke(); - nowAngle += splitAngle; - if (nowAngle >= 2) { - nowAngle = nowAngle % 2; - } - nowNumber += splitNumber; - } -} - -function drawRadarLabel(angleList, radius, centerPosition, opts, config, context) { - var radarOption = opts.extra.radar || {}; - angleList.forEach(function(angle, index) { - if(radarOption.labelPointShow === true && opts.categories[index] !== ''){ - var posPoint = { - x: radius * Math.cos(angle), - y: radius * Math.sin(angle) - }; - var posPointAxis = convertCoordinateOrigin(posPoint.x, posPoint.y, centerPosition); - context.setFillStyle(radarOption.labelPointColor); - context.beginPath(); - context.arc(posPointAxis.x, posPointAxis.y, radarOption.labelPointRadius * opts.pix, 0, 2 * Math.PI, false); - context.closePath(); - context.fill(); - } - if(radarOption.labelShow === true){ - var pos = { - x: (radius + config.radarLabelTextMargin * opts.pix) * Math.cos(angle), - y: (radius + config.radarLabelTextMargin * opts.pix) * Math.sin(angle) - }; - var posRelativeCanvas = convertCoordinateOrigin(pos.x, pos.y, centerPosition); - var startX = posRelativeCanvas.x; - var startY = posRelativeCanvas.y; - if (util.approximatelyEqual(pos.x, 0)) { - startX -= measureText(opts.categories[index] || '', config.fontSize, context) / 2; - } else if (pos.x < 0) { - startX -= measureText(opts.categories[index] || '', config.fontSize, context); - } - context.beginPath(); - context.setFontSize(config.fontSize); - context.setFillStyle(radarOption.labelColor || opts.fontColor); - context.fillText(opts.categories[index] || '', startX, startY + config.fontSize / 2); - context.closePath(); - context.stroke(); - } - }); - -} - -function drawPieText(series, opts, config, context, radius, center) { - var lineRadius = config.pieChartLinePadding; - var textObjectCollection = []; - var lastTextObject = null; - var seriesConvert = series.map(function(item,index) { - var text = item.formatter ? item.formatter(item,index,series,opts) : util.toFixed(item._proportion_.toFixed(4) * 100) + '%'; - text = item.labelText ? item.labelText : text; - var arc = 2 * Math.PI - (item._start_ + 2 * Math.PI * item._proportion_ / 2); - if (item._rose_proportion_) { - arc = 2 * Math.PI - (item._start_ + 2 * Math.PI * item._rose_proportion_ / 2); - } - var color = item.color; - var radius = item._radius_; - return { - arc: arc, - text: text, - color: color, - radius: radius, - textColor: item.textColor, - textSize: item.textSize, - labelShow: item.labelShow - }; - }); - for (let i = 0; i < seriesConvert.length; i++) { - let item = seriesConvert[i]; - // line end - let orginX1 = Math.cos(item.arc) * (item.radius + lineRadius); - let orginY1 = Math.sin(item.arc) * (item.radius + lineRadius); - // line start - let orginX2 = Math.cos(item.arc) * item.radius; - let orginY2 = Math.sin(item.arc) * item.radius; - // text start - let orginX3 = orginX1 >= 0 ? orginX1 + config.pieChartTextPadding : orginX1 - config.pieChartTextPadding; - let orginY3 = orginY1; - let textWidth = measureText(item.text, item.textSize * opts.pix || config.fontSize, context); - let startY = orginY3; - if (lastTextObject && util.isSameXCoordinateArea(lastTextObject.start, { - x: orginX3 - })) { - if (orginX3 > 0) { - startY = Math.min(orginY3, lastTextObject.start.y); - } else if (orginX1 < 0) { - startY = Math.max(orginY3, lastTextObject.start.y); - } else { - if (orginY3 > 0) { - startY = Math.max(orginY3, lastTextObject.start.y); - } else { - startY = Math.min(orginY3, lastTextObject.start.y); - } - } - } - if (orginX3 < 0) { - orginX3 -= textWidth; - } - let textObject = { - lineStart: { - x: orginX2, - y: orginY2 - }, - lineEnd: { - x: orginX1, - y: orginY1 - }, - start: { - x: orginX3, - y: startY - }, - width: textWidth, - height: config.fontSize, - text: item.text, - color: item.color, - textColor: item.textColor, - textSize: item.textSize - }; - lastTextObject = avoidCollision(textObject, lastTextObject); - textObjectCollection.push(lastTextObject); - } - for (let i = 0; i < textObjectCollection.length; i++) { - if(seriesConvert[i].labelShow === false){ - continue; - } - let item = textObjectCollection[i]; - let lineStartPoistion = convertCoordinateOrigin(item.lineStart.x, item.lineStart.y, center); - let lineEndPoistion = convertCoordinateOrigin(item.lineEnd.x, item.lineEnd.y, center); - let textPosition = convertCoordinateOrigin(item.start.x, item.start.y, center); - context.setLineWidth(1 * opts.pix); - context.setFontSize(item.textSize * opts.pix || config.fontSize); - context.beginPath(); - context.setStrokeStyle(item.color); - context.setFillStyle(item.color); - context.moveTo(lineStartPoistion.x, lineStartPoistion.y); - let curveStartX = item.start.x < 0 ? textPosition.x + item.width : textPosition.x; - let textStartX = item.start.x < 0 ? textPosition.x - 5 : textPosition.x + 5; - context.quadraticCurveTo(lineEndPoistion.x, lineEndPoistion.y, curveStartX, textPosition.y); - context.moveTo(lineStartPoistion.x, lineStartPoistion.y); - context.stroke(); - context.closePath(); - context.beginPath(); - context.moveTo(textPosition.x + item.width, textPosition.y); - context.arc(curveStartX, textPosition.y, 2 * opts.pix, 0, 2 * Math.PI); - context.closePath(); - context.fill(); - context.beginPath(); - context.setFontSize(item.textSize * opts.pix || config.fontSize); - context.setFillStyle(item.textColor || opts.fontColor); - context.fillText(item.text, textStartX, textPosition.y + 3); - context.closePath(); - context.stroke(); - context.closePath(); - } -} - -function drawToolTipSplitLine(offsetX, opts, config, context) { - var toolTipOption = opts.extra.tooltip || {}; - toolTipOption.gridType = toolTipOption.gridType == undefined ? 'solid' : toolTipOption.gridType; - toolTipOption.dashLength = toolTipOption.dashLength == undefined ? 4 : toolTipOption.dashLength; - var startY = opts.area[0]; - var endY = opts.height - opts.area[2]; - if (toolTipOption.gridType == 'dash') { - context.setLineDash([toolTipOption.dashLength, toolTipOption.dashLength]); - } - context.setStrokeStyle(toolTipOption.gridColor || '#cccccc'); - context.setLineWidth(1 * opts.pix); - context.beginPath(); - context.moveTo(offsetX, startY); - context.lineTo(offsetX, endY); - context.stroke(); - context.setLineDash([]); - if (toolTipOption.xAxisLabel) { - let labelText = opts.categories[opts.tooltip.index]; - context.setFontSize(config.fontSize); - let textWidth = measureText(labelText, config.fontSize, context); - let textX = offsetX - 0.5 * textWidth; - let textY = endY + 2 * opts.pix; - context.beginPath(); - context.setFillStyle(hexToRgb(toolTipOption.labelBgColor || config.toolTipBackground, toolTipOption.labelBgOpacity || config.toolTipOpacity)); - context.setStrokeStyle(toolTipOption.labelBgColor || config.toolTipBackground); - context.setLineWidth(1 * opts.pix); - context.rect(textX - toolTipOption.boxPadding * opts.pix, textY, textWidth + 2 * toolTipOption.boxPadding * opts.pix, config.fontSize + 2 * toolTipOption.boxPadding * opts.pix); - context.closePath(); - context.stroke(); - context.fill(); - context.beginPath(); - context.setFontSize(config.fontSize); - context.setFillStyle(toolTipOption.labelFontColor || opts.fontColor); - context.fillText(String(labelText), textX, textY + toolTipOption.boxPadding * opts.pix + config.fontSize); - context.closePath(); - context.stroke(); - } -} - -function drawMarkLine(opts, config, context) { - let markLineOption = assign({}, { - type: 'solid', - dashLength: 4, - data: [] - }, opts.extra.markLine); - let startX = opts.area[3]; - let endX = opts.width - opts.area[1]; - let points = calMarkLineData(markLineOption.data, opts); - for (let i = 0; i < points.length; i++) { - let item = assign({}, { - lineColor: '#DE4A42', - showLabel: false, - labelFontSize: 13, - labelPadding: 6, - labelFontColor: '#666666', - labelBgColor: '#DFE8FF', - labelBgOpacity: 0.8, - labelAlign: 'left', - labelOffsetX: 0, - labelOffsetY: 0, - }, points[i]); - if (markLineOption.type == 'dash') { - context.setLineDash([markLineOption.dashLength, markLineOption.dashLength]); - } - context.setStrokeStyle(item.lineColor); - context.setLineWidth(1 * opts.pix); - context.beginPath(); - context.moveTo(startX, item.y); - context.lineTo(endX, item.y); - context.stroke(); - context.setLineDash([]); - if (item.showLabel) { - let fontSize = item.labelFontSize * opts.pix; - let labelText = item.labelText ? item.labelText : item.value; - context.setFontSize(fontSize); - let textWidth = measureText(labelText, fontSize, context); - let bgWidth = textWidth + item.labelPadding * opts.pix * 2; - let bgStartX = item.labelAlign == 'left' ? opts.area[3] - bgWidth : opts.width - opts.area[1]; - bgStartX += item.labelOffsetX; - let bgStartY = item.y - 0.5 * fontSize - item.labelPadding * opts.pix; - bgStartY += item.labelOffsetY; - let textX = bgStartX + item.labelPadding * opts.pix; - let textY = item.y; - context.setFillStyle(hexToRgb(item.labelBgColor, item.labelBgOpacity)); - context.setStrokeStyle(item.labelBgColor); - context.setLineWidth(1 * opts.pix); - context.beginPath(); - context.rect(bgStartX, bgStartY, bgWidth, fontSize + 2 * item.labelPadding * opts.pix); - context.closePath(); - context.stroke(); - context.fill(); - context.setFontSize(fontSize); - context.setTextAlign('left'); - context.setFillStyle(item.labelFontColor); - context.fillText(String(labelText), textX, bgStartY + fontSize + item.labelPadding * opts.pix/2); - context.stroke(); - context.setTextAlign('left'); - } - } -} - -function drawToolTipHorizentalLine(opts, config, context, eachSpacing, xAxisPoints) { - var toolTipOption = assign({}, { - gridType: 'solid', - dashLength: 4 - }, opts.extra.tooltip); - var startX = opts.area[3]; - var endX = opts.width - opts.area[1]; - if (toolTipOption.gridType == 'dash') { - context.setLineDash([toolTipOption.dashLength, toolTipOption.dashLength]); - } - context.setStrokeStyle(toolTipOption.gridColor || '#cccccc'); - context.setLineWidth(1 * opts.pix); - context.beginPath(); - context.moveTo(startX, opts.tooltip.offset.y); - context.lineTo(endX, opts.tooltip.offset.y); - context.stroke(); - context.setLineDash([]); - if (toolTipOption.yAxisLabel) { - let boxPadding = toolTipOption.boxPadding * opts.pix; - let labelText = calTooltipYAxisData(opts.tooltip.offset.y, opts.series, opts, config, eachSpacing); - let widthArr = opts.chartData.yAxisData.yAxisWidth; - let tStartLeft = opts.area[3]; - let tStartRight = opts.width - opts.area[1]; - for (let i = 0; i < labelText.length; i++) { - context.setFontSize(toolTipOption.fontSize * opts.pix); - let textWidth = measureText(labelText[i], toolTipOption.fontSize * opts.pix, context); - let bgStartX, bgEndX, bgWidth; - if (widthArr[i].position == 'left') { - bgStartX = tStartLeft - (textWidth + boxPadding * 2) - 2 * opts.pix; - bgEndX = Math.max(bgStartX, bgStartX + textWidth + boxPadding * 2); - } else { - bgStartX = tStartRight + 2 * opts.pix; - bgEndX = Math.max(bgStartX + widthArr[i].width, bgStartX + textWidth + boxPadding * 2); - } - bgWidth = bgEndX - bgStartX; - let textX = bgStartX + (bgWidth - textWidth) / 2; - let textY = opts.tooltip.offset.y; - context.beginPath(); - context.setFillStyle(hexToRgb(toolTipOption.labelBgColor || config.toolTipBackground, toolTipOption.labelBgOpacity || config.toolTipOpacity)); - context.setStrokeStyle(toolTipOption.labelBgColor || config.toolTipBackground); - context.setLineWidth(1 * opts.pix); - context.rect(bgStartX, textY - 0.5 * config.fontSize - boxPadding, bgWidth, config.fontSize + 2 * boxPadding); - context.closePath(); - context.stroke(); - context.fill(); - context.beginPath(); - context.setFontSize(config.fontSize); - context.setFillStyle(toolTipOption.labelFontColor || opts.fontColor); - context.fillText(labelText[i], textX, textY + 0.5 * config.fontSize); - context.closePath(); - context.stroke(); - if (widthArr[i].position == 'left') { - tStartLeft -= (widthArr[i].width + opts.yAxis.padding * opts.pix); - } else { - tStartRight += widthArr[i].width + opts.yAxis.padding * opts.pix; - } - } - } -} - -function drawToolTipSplitArea(offsetX, opts, config, context, eachSpacing) { - var toolTipOption = assign({}, { - activeBgColor: '#000000', - activeBgOpacity: 0.08, - activeWidth: eachSpacing - }, opts.extra.column); - toolTipOption.activeWidth = toolTipOption.activeWidth > eachSpacing ? eachSpacing : toolTipOption.activeWidth; - var startY = opts.area[0]; - var endY = opts.height - opts.area[2]; - context.beginPath(); - context.setFillStyle(hexToRgb(toolTipOption.activeBgColor, toolTipOption.activeBgOpacity)); - context.rect(offsetX - toolTipOption.activeWidth / 2, startY, toolTipOption.activeWidth, endY - startY); - context.closePath(); - context.fill(); - context.setFillStyle("#FFFFFF"); -} - -function drawBarToolTipSplitArea(offsetX, opts, config, context, eachSpacing) { - var toolTipOption = assign({}, { - activeBgColor: '#000000', - activeBgOpacity: 0.08 - }, opts.extra.bar); - var startX = opts.area[3]; - var endX = opts.width - opts.area[1]; - context.beginPath(); - context.setFillStyle(hexToRgb(toolTipOption.activeBgColor, toolTipOption.activeBgOpacity)); - context.rect( startX ,offsetX - eachSpacing / 2 , endX - startX,eachSpacing); - context.closePath(); - context.fill(); - context.setFillStyle("#FFFFFF"); -} - - -function drawToolTip(textList, offset, opts, config, context, eachSpacing, xAxisPoints) { - var toolTipOption = assign({}, { - showBox: true, - showArrow: true, - showCategory: false, - bgColor: '#000000', - bgOpacity: 0.7, - borderColor: '#000000', - borderWidth: 0, - borderRadius: 0, - borderOpacity: 0.7, - boxPadding: 3, - fontColor: '#FFFFFF', - fontSize: 13, - lineHeight: 20, - legendShow: true, - legendShape: 'auto', - splitLine: true, - }, opts.extra.tooltip); - if(toolTipOption.showCategory==true && opts.categories){ - textList.unshift({text:opts.categories[opts.tooltip.index],color:null}) - } - var fontSize = toolTipOption.fontSize * opts.pix; - var lineHeight = toolTipOption.lineHeight * opts.pix; - var boxPadding = toolTipOption.boxPadding * opts.pix; - var legendWidth = fontSize; - var legendMarginRight = 5 * opts.pix; - if(toolTipOption.legendShow == false){ - legendWidth = 0; - legendMarginRight = 0; - } - var arrowWidth = toolTipOption.showArrow ? 8 * opts.pix : 0; - var isOverRightBorder = false; - if (opts.type == 'line' || opts.type == 'mount' || opts.type == 'area' || opts.type == 'candle' || opts.type == 'mix') { - if (toolTipOption.splitLine == true) { - drawToolTipSplitLine(opts.tooltip.offset.x, opts, config, context); - } - } - offset = assign({ - x: 0, - y: 0 - }, offset); - offset.y -= 8 * opts.pix; - var textWidth = textList.map(function(item) { - return measureText(item.text, fontSize, context); - }); - var toolTipWidth = legendWidth + legendMarginRight + 4 * boxPadding + Math.max.apply(null, textWidth); - var toolTipHeight = 2 * boxPadding + textList.length * lineHeight; - if (toolTipOption.showBox == false) { - return - } - // if beyond the right border - if (offset.x - Math.abs(opts._scrollDistance_ || 0) + arrowWidth + toolTipWidth > opts.width) { - isOverRightBorder = true; - } - if (toolTipHeight + offset.y > opts.height) { - offset.y = opts.height - toolTipHeight; - } - // draw background rect - context.beginPath(); - context.setFillStyle(hexToRgb(toolTipOption.bgColor, toolTipOption.bgOpacity)); - context.setLineWidth(toolTipOption.borderWidth * opts.pix); - context.setStrokeStyle(hexToRgb(toolTipOption.borderColor, toolTipOption.borderOpacity)); - var radius = toolTipOption.borderRadius; - if (isOverRightBorder) { - // 增加左侧仍然超出的判断 - if(toolTipWidth + arrowWidth > opts.width){ - offset.x = opts.width + Math.abs(opts._scrollDistance_ || 0) + arrowWidth + (toolTipWidth - opts.width) - } - if(toolTipWidth > offset.x){ - offset.x = opts.width + Math.abs(opts._scrollDistance_ || 0) + arrowWidth + (toolTipWidth - opts.width) - } - if (toolTipOption.showArrow) { - context.moveTo(offset.x, offset.y + 10 * opts.pix); - context.lineTo(offset.x - arrowWidth, offset.y + 10 * opts.pix + 5 * opts.pix); - } - context.arc(offset.x - arrowWidth - radius, offset.y + toolTipHeight - radius, radius, 0, Math.PI / 2, false); - context.arc(offset.x - arrowWidth - Math.round(toolTipWidth) + radius, offset.y + toolTipHeight - radius, radius, - Math.PI / 2, Math.PI, false); - context.arc(offset.x - arrowWidth - Math.round(toolTipWidth) + radius, offset.y + radius, radius, -Math.PI, -Math.PI / 2, false); - context.arc(offset.x - arrowWidth - radius, offset.y + radius, radius, -Math.PI / 2, 0, false); - if (toolTipOption.showArrow) { - context.lineTo(offset.x - arrowWidth, offset.y + 10 * opts.pix - 5 * opts.pix); - context.lineTo(offset.x, offset.y + 10 * opts.pix); - } - } else { - if (toolTipOption.showArrow) { - context.moveTo(offset.x, offset.y + 10 * opts.pix); - context.lineTo(offset.x + arrowWidth, offset.y + 10 * opts.pix - 5 * opts.pix); - } - context.arc(offset.x + arrowWidth + radius, offset.y + radius, radius, -Math.PI, -Math.PI / 2, false); - context.arc(offset.x + arrowWidth + Math.round(toolTipWidth) - radius, offset.y + radius, radius, -Math.PI / 2, 0, - false); - context.arc(offset.x + arrowWidth + Math.round(toolTipWidth) - radius, offset.y + toolTipHeight - radius, radius, 0, - Math.PI / 2, false); - context.arc(offset.x + arrowWidth + radius, offset.y + toolTipHeight - radius, radius, Math.PI / 2, Math.PI, false); - if (toolTipOption.showArrow) { - context.lineTo(offset.x + arrowWidth, offset.y + 10 * opts.pix + 5 * opts.pix); - context.lineTo(offset.x, offset.y + 10 * opts.pix); - } - } - context.closePath(); - context.fill(); - if (toolTipOption.borderWidth > 0) { - context.stroke(); - } - // draw legend - if(toolTipOption.legendShow){ - textList.forEach(function(item, index) { - if (item.color !== null) { - context.beginPath(); - context.setFillStyle(item.color); - var startX = offset.x + arrowWidth + 2 * boxPadding; - var startY = offset.y + (lineHeight - fontSize) / 2 + lineHeight * index + boxPadding + 1; - if (isOverRightBorder) { - startX = offset.x - toolTipWidth - arrowWidth + 2 * boxPadding; - } - switch (item.legendShape) { - case 'line': - context.moveTo(startX, startY + 0.5 * legendWidth - 2 * opts.pix); - context.fillRect(startX, startY + 0.5 * legendWidth - 2 * opts.pix, legendWidth, 4 * opts.pix); - break; - case 'triangle': - context.moveTo(startX + 7.5 * opts.pix, startY + 0.5 * legendWidth - 5 * opts.pix); - context.lineTo(startX + 2.5 * opts.pix, startY + 0.5 * legendWidth + 5 * opts.pix); - context.lineTo(startX + 12.5 * opts.pix, startY + 0.5 * legendWidth + 5 * opts.pix); - context.lineTo(startX + 7.5 * opts.pix, startY + 0.5 * legendWidth - 5 * opts.pix); - break; - case 'diamond': - context.moveTo(startX + 7.5 * opts.pix, startY + 0.5 * legendWidth - 5 * opts.pix); - context.lineTo(startX + 2.5 * opts.pix, startY + 0.5 * legendWidth); - context.lineTo(startX + 7.5 * opts.pix, startY + 0.5 * legendWidth + 5 * opts.pix); - context.lineTo(startX + 12.5 * opts.pix, startY + 0.5 * legendWidth); - context.lineTo(startX + 7.5 * opts.pix, startY + 0.5 * legendWidth - 5 * opts.pix); - break; - case 'circle': - context.moveTo(startX + 7.5 * opts.pix, startY + 0.5 * legendWidth); - context.arc(startX + 7.5 * opts.pix, startY + 0.5 * legendWidth, 5 * opts.pix, 0, 2 * Math.PI); - break; - case 'rect': - context.moveTo(startX, startY + 0.5 * legendWidth - 5 * opts.pix); - context.fillRect(startX, startY + 0.5 * legendWidth - 5 * opts.pix, 15 * opts.pix, 10 * opts.pix); - break; - case 'square': - context.moveTo(startX + 2 * opts.pix, startY + 0.5 * legendWidth - 5 * opts.pix); - context.fillRect(startX + 2 * opts.pix, startY + 0.5 * legendWidth - 5 * opts.pix, 10 * opts.pix, 10 * opts.pix); - break; - default: - context.moveTo(startX, startY + 0.5 * legendWidth - 5 * opts.pix); - context.fillRect(startX, startY + 0.5 * legendWidth - 5 * opts.pix, 15 * opts.pix, 10 * opts.pix); - } - context.closePath(); - context.fill(); - } - }); - } - - // draw text list - textList.forEach(function(item, index) { - var startX = offset.x + arrowWidth + 2 * boxPadding + legendWidth + legendMarginRight; - if (isOverRightBorder) { - startX = offset.x - toolTipWidth - arrowWidth + 2 * boxPadding + legendWidth + legendMarginRight; - } - var startY = offset.y + lineHeight * index + (lineHeight - fontSize)/2 - 1 + boxPadding + fontSize; - context.beginPath(); - context.setFontSize(fontSize); - context.setTextBaseline('normal'); - context.setFillStyle(toolTipOption.fontColor); - context.fillText(item.text, startX, startY); - context.closePath(); - context.stroke(); - }); -} - -function drawColumnDataPoints(series, opts, config, context) { - let process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1; - let xAxisData = opts.chartData.xAxisData, - xAxisPoints = xAxisData.xAxisPoints, - eachSpacing = xAxisData.eachSpacing; - let columnOption = assign({}, { - type: 'group', - width: eachSpacing / 2, - meterBorder: 4, - meterFillColor: '#FFFFFF', - barBorderCircle: false, - barBorderRadius: [], - seriesGap: 2, - linearType: 'none', - linearOpacity: 1, - customColor: [], - colorStop: 0, - labelPosition: 'outside' - }, opts.extra.column); - let calPoints = []; - context.save(); - let leftNum = -2; - let rightNum = xAxisPoints.length + 2; - if (opts._scrollDistance_ && opts._scrollDistance_ !== 0 && opts.enableScroll === true) { - context.translate(opts._scrollDistance_, 0); - leftNum = Math.floor(-opts._scrollDistance_ / eachSpacing) - 2; - rightNum = leftNum + opts.xAxis.itemCount + 4; - } - if (opts.tooltip && opts.tooltip.textList && opts.tooltip.textList.length && process === 1) { - drawToolTipSplitArea(opts.tooltip.offset.x, opts, config, context, eachSpacing); - } - columnOption.customColor = fillCustomColor(columnOption.linearType, columnOption.customColor, series, config); - series.forEach(function(eachSeries, seriesIndex) { - let ranges, minRange, maxRange; - ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]); - minRange = ranges.pop(); - maxRange = ranges.shift(); - - // 计算0轴坐标 - let spacingValid = opts.height - opts.area[0] - opts.area[2]; - let zeroHeight = spacingValid * (0 - minRange) / (maxRange - minRange); - let zeroPoints = opts.height - Math.round(zeroHeight) - opts.area[2]; - eachSeries.zeroPoints = zeroPoints; - var data = eachSeries.data; - switch (columnOption.type) { - case 'group': - var points = getColumnDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, zeroPoints, process); - var tooltipPoints = getStackDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, seriesIndex, series, process); - calPoints.push(tooltipPoints); - points = fixColumeData(points, eachSpacing, series.length, seriesIndex, config, opts); - for (let i = 0; i < points.length; i++) { - let item = points[i]; - //fix issues/I27B1N yyoinge & Joeshu - if (item !== null && i > leftNum && i < rightNum) { - var startX = item.x - item.width / 2; - var height = opts.height - item.y - opts.area[2]; - context.beginPath(); - var fillColor = item.color || eachSeries.color - var strokeColor = item.color || eachSeries.color - if (columnOption.linearType !== 'none') { - var grd = context.createLinearGradient(startX, item.y, startX, zeroPoints); - //透明渐变 - if (columnOption.linearType == 'opacity') { - grd.addColorStop(0, hexToRgb(fillColor, columnOption.linearOpacity)); - grd.addColorStop(1, hexToRgb(fillColor, 1)); - } else { - grd.addColorStop(0, hexToRgb(columnOption.customColor[eachSeries.linearIndex], columnOption.linearOpacity)); - grd.addColorStop(columnOption.colorStop, hexToRgb(columnOption.customColor[eachSeries.linearIndex],columnOption.linearOpacity)); - grd.addColorStop(1, hexToRgb(fillColor, 1)); - } - fillColor = grd - } - // 圆角边框 - if ((columnOption.barBorderRadius && columnOption.barBorderRadius.length === 4) || columnOption.barBorderCircle === true) { - const left = startX; - const top = item.y > zeroPoints ? zeroPoints : item.y; - const width = item.width; - const height = Math.abs(zeroPoints - item.y); - if (columnOption.barBorderCircle) { - columnOption.barBorderRadius = [width / 2, width / 2, 0, 0]; - } - if(item.y > zeroPoints){ - columnOption.barBorderRadius = [0, 0,width / 2, width / 2]; - } - let [r0, r1, r2, r3] = columnOption.barBorderRadius; - let minRadius = Math.min(width/2,height/2); - r0 = r0 > minRadius ? minRadius : r0; - r1 = r1 > minRadius ? minRadius : r1; - r2 = r2 > minRadius ? minRadius : r2; - r3 = r3 > minRadius ? minRadius : r3; - r0 = r0 < 0 ? 0 : r0; - r1 = r1 < 0 ? 0 : r1; - r2 = r2 < 0 ? 0 : r2; - r3 = r3 < 0 ? 0 : r3; - context.arc(left + r0, top + r0, r0, -Math.PI, -Math.PI / 2); - context.arc(left + width - r1, top + r1, r1, -Math.PI / 2, 0); - context.arc(left + width - r2, top + height - r2, r2, 0, Math.PI / 2); - context.arc(left + r3, top + height - r3, r3, Math.PI / 2, Math.PI); - } else { - context.moveTo(startX, item.y); - context.lineTo(startX + item.width, item.y); - context.lineTo(startX + item.width, zeroPoints); - context.lineTo(startX, zeroPoints); - context.lineTo(startX, item.y); - context.setLineWidth(1) - context.setStrokeStyle(strokeColor); - } - context.setFillStyle(fillColor); - context.closePath(); - //context.stroke(); - context.fill(); - } - }; - break; - case 'stack': - // 绘制堆叠数据图 - var points = getStackDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, seriesIndex, series, process); - calPoints.push(points); - points = fixColumeStackData(points, eachSpacing, series.length, seriesIndex, config, opts, series); - for (let i = 0; i < points.length; i++) { - let item = points[i]; - if (item !== null && i > leftNum && i < rightNum) { - context.beginPath(); - var fillColor = item.color || eachSeries.color; - var startX = item.x - item.width / 2 + 1; - var height = opts.height - item.y - opts.area[2]; - var height0 = opts.height - item.y0 - opts.area[2]; - if (seriesIndex > 0) { - height -= height0; - } - context.setFillStyle(fillColor); - context.moveTo(startX, item.y); - context.fillRect(startX, item.y, item.width, height); - context.closePath(); - context.fill(); - } - }; - break; - case 'meter': - // 绘制温度计数据图 - var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process); - calPoints.push(points); - points = fixColumeMeterData(points, eachSpacing, series.length, seriesIndex, config, opts, columnOption.meterBorder); - for (let i = 0; i < points.length; i++) { - let item = points[i]; - if (item !== null && i > leftNum && i < rightNum) { - //画背景颜色 - context.beginPath(); - if (seriesIndex == 0 && columnOption.meterBorder > 0) { - context.setStrokeStyle(eachSeries.color); - context.setLineWidth(columnOption.meterBorder * opts.pix); - } - if(seriesIndex == 0){ - context.setFillStyle(columnOption.meterFillColor); - }else{ - context.setFillStyle(item.color || eachSeries.color); - } - var startX = item.x - item.width / 2; - var height = opts.height - item.y - opts.area[2]; - if ((columnOption.barBorderRadius && columnOption.barBorderRadius.length === 4) || columnOption.barBorderCircle === true) { - const left = startX; - const top = item.y; - const width = item.width; - const height = zeroPoints - item.y; - if (columnOption.barBorderCircle) { - columnOption.barBorderRadius = [width / 2, width / 2, 0, 0]; - } - let [r0, r1, r2, r3] = columnOption.barBorderRadius; - let minRadius = Math.min(width/2,height/2); - r0 = r0 > minRadius ? minRadius : r0; - r1 = r1 > minRadius ? minRadius : r1; - r2 = r2 > minRadius ? minRadius : r2; - r3 = r3 > minRadius ? minRadius : r3; - r0 = r0 < 0 ? 0 : r0; - r1 = r1 < 0 ? 0 : r1; - r2 = r2 < 0 ? 0 : r2; - r3 = r3 < 0 ? 0 : r3; - context.arc(left + r0, top + r0, r0, -Math.PI, -Math.PI / 2); - context.arc(left + width - r1, top + r1, r1, -Math.PI / 2, 0); - context.arc(left + width - r2, top + height - r2, r2, 0, Math.PI / 2); - context.arc(left + r3, top + height - r3, r3, Math.PI / 2, Math.PI); - context.fill(); - }else{ - context.moveTo(startX, item.y); - context.lineTo(startX + item.width, item.y); - context.lineTo(startX + item.width, zeroPoints); - context.lineTo(startX, zeroPoints); - context.lineTo(startX, item.y); - context.fill(); - } - if (seriesIndex == 0 && columnOption.meterBorder > 0) { - context.closePath(); - context.stroke(); - } - } - } - break; - } - }); - - if (opts.dataLabel !== false && process === 1) { - series.forEach(function(eachSeries, seriesIndex) { - let ranges, minRange, maxRange; - ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]); - minRange = ranges.pop(); - maxRange = ranges.shift(); - var data = eachSeries.data; - switch (columnOption.type) { - case 'group': - var points = getColumnDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process); - points = fixColumeData(points, eachSpacing, series.length, seriesIndex, config, opts); - drawColumePointText(points, eachSeries, config, context, opts); - break; - case 'stack': - var points = getStackDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, seriesIndex, series, process); - drawColumePointText(points, eachSeries, config, context, opts); - break; - case 'meter': - var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process); - drawColumePointText(points, eachSeries, config, context, opts); - break; - } - }); - } - context.restore(); - return { - xAxisPoints: xAxisPoints, - calPoints: calPoints, - eachSpacing: eachSpacing - }; -} - -function drawMountDataPoints(series, opts, config, context) { - let process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1; - let xAxisData = opts.chartData.xAxisData, - xAxisPoints = xAxisData.xAxisPoints, - eachSpacing = xAxisData.eachSpacing; - let mountOption = assign({}, { - type: 'mount', - widthRatio: 1, - borderWidth: 1, - barBorderCircle: false, - barBorderRadius: [], - linearType: 'none', - linearOpacity: 1, - customColor: [], - colorStop: 0, - }, opts.extra.mount); - mountOption.widthRatio = mountOption.widthRatio <= 0 ? 0 : mountOption.widthRatio; - mountOption.widthRatio = mountOption.widthRatio >= 2 ? 2 : mountOption.widthRatio; - let calPoints = []; - context.save(); - let leftNum = -2; - let rightNum = xAxisPoints.length + 2; - if (opts._scrollDistance_ && opts._scrollDistance_ !== 0 && opts.enableScroll === true) { - context.translate(opts._scrollDistance_, 0); - leftNum = Math.floor(-opts._scrollDistance_ / eachSpacing) - 2; - rightNum = leftNum + opts.xAxis.itemCount + 4; - } - mountOption.customColor = fillCustomColor(mountOption.linearType, mountOption.customColor, series, config); - let ranges, minRange, maxRange; - ranges = [].concat(opts.chartData.yAxisData.ranges[0]); - minRange = ranges.pop(); - maxRange = ranges.shift(); - - // 计算0轴坐标 - let spacingValid = opts.height - opts.area[0] - opts.area[2]; - let zeroHeight = spacingValid * (0 - minRange) / (maxRange - minRange); - let zeroPoints = opts.height - Math.round(zeroHeight) - opts.area[2]; - - var points = getMountDataPoints(series, minRange, maxRange, xAxisPoints, eachSpacing, opts, mountOption, zeroPoints, process); - switch (mountOption.type) { - case 'bar': - for (let i = 0; i < points.length; i++) { - let item = points[i]; - if (item !== null && i > leftNum && i < rightNum) { - var startX = item.x - eachSpacing*mountOption.widthRatio/2; - var height = opts.height - item.y - opts.area[2]; - context.beginPath(); - var fillColor = item.color || series[i].color - var strokeColor = item.color || series[i].color - if (mountOption.linearType !== 'none') { - var grd = context.createLinearGradient(startX, item.y, startX, zeroPoints); - //透明渐变 - if (mountOption.linearType == 'opacity') { - grd.addColorStop(0, hexToRgb(fillColor, mountOption.linearOpacity)); - grd.addColorStop(1, hexToRgb(fillColor, 1)); - } else { - grd.addColorStop(0, hexToRgb(mountOption.customColor[series[i].linearIndex], mountOption.linearOpacity)); - grd.addColorStop(mountOption.colorStop, hexToRgb(mountOption.customColor[series[i].linearIndex],mountOption.linearOpacity)); - grd.addColorStop(1, hexToRgb(fillColor, 1)); - } - fillColor = grd - } - // 圆角边框 - if ((mountOption.barBorderRadius && mountOption.barBorderRadius.length === 4) || mountOption.barBorderCircle === true) { - const left = startX; - const top = item.y > zeroPoints ? zeroPoints : item.y; - const width = item.width; - const height = Math.abs(zeroPoints - item.y); - if (mountOption.barBorderCircle) { - mountOption.barBorderRadius = [width / 2, width / 2, 0, 0]; - } - if(item.y > zeroPoints){ - mountOption.barBorderRadius = [0, 0,width / 2, width / 2]; - } - let [r0, r1, r2, r3] = mountOption.barBorderRadius; - let minRadius = Math.min(width/2,height/2); - r0 = r0 > minRadius ? minRadius : r0; - r1 = r1 > minRadius ? minRadius : r1; - r2 = r2 > minRadius ? minRadius : r2; - r3 = r3 > minRadius ? minRadius : r3; - r0 = r0 < 0 ? 0 : r0; - r1 = r1 < 0 ? 0 : r1; - r2 = r2 < 0 ? 0 : r2; - r3 = r3 < 0 ? 0 : r3; - context.arc(left + r0, top + r0, r0, -Math.PI, -Math.PI / 2); - context.arc(left + width - r1, top + r1, r1, -Math.PI / 2, 0); - context.arc(left + width - r2, top + height - r2, r2, 0, Math.PI / 2); - context.arc(left + r3, top + height - r3, r3, Math.PI / 2, Math.PI); - } else { - context.moveTo(startX, item.y); - context.lineTo(startX + item.width, item.y); - context.lineTo(startX + item.width, zeroPoints); - context.lineTo(startX, zeroPoints); - context.lineTo(startX, item.y); - } - context.setStrokeStyle(strokeColor); - context.setFillStyle(fillColor); - if(mountOption.borderWidth > 0){ - context.setLineWidth(mountOption.borderWidth * opts.pix); - context.closePath(); - context.stroke(); - } - context.fill(); - } - }; - break; - case 'triangle': - for (let i = 0; i < points.length; i++) { - let item = points[i]; - if (item !== null && i > leftNum && i < rightNum) { - var startX = item.x - eachSpacing*mountOption.widthRatio/2; - var height = opts.height - item.y - opts.area[2]; - context.beginPath(); - var fillColor = item.color || series[i].color - var strokeColor = item.color || series[i].color - if (mountOption.linearType !== 'none') { - var grd = context.createLinearGradient(startX, item.y, startX, zeroPoints); - //透明渐变 - if (mountOption.linearType == 'opacity') { - grd.addColorStop(0, hexToRgb(fillColor, mountOption.linearOpacity)); - grd.addColorStop(1, hexToRgb(fillColor, 1)); - } else { - grd.addColorStop(0, hexToRgb(mountOption.customColor[series[i].linearIndex], mountOption.linearOpacity)); - grd.addColorStop(mountOption.colorStop, hexToRgb(mountOption.customColor[series[i].linearIndex],mountOption.linearOpacity)); - grd.addColorStop(1, hexToRgb(fillColor, 1)); - } - fillColor = grd - } - context.moveTo(startX, zeroPoints); - context.lineTo(item.x, item.y); - context.lineTo(startX + item.width, zeroPoints); - context.setStrokeStyle(strokeColor); - context.setFillStyle(fillColor); - if(mountOption.borderWidth > 0){ - context.setLineWidth(mountOption.borderWidth * opts.pix); - context.stroke(); - } - context.fill(); - } - }; - break; - case 'mount': - for (let i = 0; i < points.length; i++) { - let item = points[i]; - if (item !== null && i > leftNum && i < rightNum) { - var startX = item.x - eachSpacing*mountOption.widthRatio/2; - var height = opts.height - item.y - opts.area[2]; - context.beginPath(); - var fillColor = item.color || series[i].color - var strokeColor = item.color || series[i].color - if (mountOption.linearType !== 'none') { - var grd = context.createLinearGradient(startX, item.y, startX, zeroPoints); - //透明渐变 - if (mountOption.linearType == 'opacity') { - grd.addColorStop(0, hexToRgb(fillColor, mountOption.linearOpacity)); - grd.addColorStop(1, hexToRgb(fillColor, 1)); - } else { - grd.addColorStop(0, hexToRgb(mountOption.customColor[series[i].linearIndex], mountOption.linearOpacity)); - grd.addColorStop(mountOption.colorStop, hexToRgb(mountOption.customColor[series[i].linearIndex],mountOption.linearOpacity)); - grd.addColorStop(1, hexToRgb(fillColor, 1)); - } - fillColor = grd - } - context.moveTo(startX, zeroPoints); - context.bezierCurveTo(item.x - item.width/4, zeroPoints, item.x - item.width/4, item.y, item.x, item.y); - context.bezierCurveTo(item.x + item.width/4, item.y, item.x + item.width/4, zeroPoints, startX + item.width, zeroPoints); - context.setStrokeStyle(strokeColor); - context.setFillStyle(fillColor); - if(mountOption.borderWidth > 0){ - context.setLineWidth(mountOption.borderWidth * opts.pix); - context.stroke(); - } - context.fill(); - } - }; - break; - case 'sharp': - for (let i = 0; i < points.length; i++) { - let item = points[i]; - if (item !== null && i > leftNum && i < rightNum) { - var startX = item.x - eachSpacing*mountOption.widthRatio/2; - var height = opts.height - item.y - opts.area[2]; - context.beginPath(); - var fillColor = item.color || series[i].color - var strokeColor = item.color || series[i].color - if (mountOption.linearType !== 'none') { - var grd = context.createLinearGradient(startX, item.y, startX, zeroPoints); - //透明渐变 - if (mountOption.linearType == 'opacity') { - grd.addColorStop(0, hexToRgb(fillColor, mountOption.linearOpacity)); - grd.addColorStop(1, hexToRgb(fillColor, 1)); - } else { - grd.addColorStop(0, hexToRgb(mountOption.customColor[series[i].linearIndex], mountOption.linearOpacity)); - grd.addColorStop(mountOption.colorStop, hexToRgb(mountOption.customColor[series[i].linearIndex],mountOption.linearOpacity)); - grd.addColorStop(1, hexToRgb(fillColor, 1)); - } - fillColor = grd - } - context.moveTo(startX, zeroPoints); - context.quadraticCurveTo(item.x - 0, zeroPoints - height/4, item.x, item.y); - context.quadraticCurveTo(item.x + 0, zeroPoints - height/4, startX + item.width, zeroPoints) - context.setStrokeStyle(strokeColor); - context.setFillStyle(fillColor); - if(mountOption.borderWidth > 0){ - context.setLineWidth(mountOption.borderWidth * opts.pix); - context.stroke(); - } - context.fill(); - } - }; - break; - } - - if (opts.dataLabel !== false && process === 1) { - let ranges, minRange, maxRange; - ranges = [].concat(opts.chartData.yAxisData.ranges[0]); - minRange = ranges.pop(); - maxRange = ranges.shift(); - var points = getMountDataPoints(series, minRange, maxRange, xAxisPoints, eachSpacing, opts, mountOption, zeroPoints, process); - drawMountPointText(points, series, config, context, opts, zeroPoints); - } - context.restore(); - return { - xAxisPoints: xAxisPoints, - calPoints: points, - eachSpacing: eachSpacing - }; -} - -function drawBarDataPoints(series, opts, config, context) { - let process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1; - let yAxisPoints = []; - let eachSpacing = (opts.height - opts.area[0] - opts.area[2])/opts.categories.length; - for (let i = 0; i < opts.categories.length; i++) { - yAxisPoints.push(opts.area[0] + eachSpacing / 2 + eachSpacing * i); - } - let columnOption = assign({}, { - type: 'group', - width: eachSpacing / 2, - meterBorder: 4, - meterFillColor: '#FFFFFF', - barBorderCircle: false, - barBorderRadius: [], - seriesGap: 2, - linearType: 'none', - linearOpacity: 1, - customColor: [], - colorStop: 0, - }, opts.extra.bar); - let calPoints = []; - context.save(); - let leftNum = -2; - let rightNum = yAxisPoints.length + 2; - if (opts.tooltip && opts.tooltip.textList && opts.tooltip.textList.length && process === 1) { - drawBarToolTipSplitArea(opts.tooltip.offset.y, opts, config, context, eachSpacing); - } - columnOption.customColor = fillCustomColor(columnOption.linearType, columnOption.customColor, series, config); - series.forEach(function(eachSeries, seriesIndex) { - let ranges, minRange, maxRange; - ranges = [].concat(opts.chartData.xAxisData.ranges); - maxRange = ranges.pop(); - minRange = ranges.shift(); - var data = eachSeries.data; - switch (columnOption.type) { - case 'group': - var points = getBarDataPoints(data, minRange, maxRange, yAxisPoints, eachSpacing, opts, config, process); - var tooltipPoints = getBarStackDataPoints(data, minRange, maxRange, yAxisPoints, eachSpacing, opts, config, seriesIndex, series, process); - calPoints.push(tooltipPoints); - points = fixBarData(points, eachSpacing, series.length, seriesIndex, config, opts); - for (let i = 0; i < points.length; i++) { - let item = points[i]; - //fix issues/I27B1N yyoinge & Joeshu - if (item !== null && i > leftNum && i < rightNum) { - //var startX = item.x - item.width / 2; - var startX = opts.area[3]; - var startY = item.y - item.width / 2; - var height = item.height; - context.beginPath(); - var fillColor = item.color || eachSeries.color - var strokeColor = item.color || eachSeries.color - if (columnOption.linearType !== 'none') { - var grd = context.createLinearGradient(startX, item.y, item.x, item.y); - //透明渐变 - if (columnOption.linearType == 'opacity') { - grd.addColorStop(0, hexToRgb(fillColor, columnOption.linearOpacity)); - grd.addColorStop(1, hexToRgb(fillColor, 1)); - } else { - grd.addColorStop(0, hexToRgb(columnOption.customColor[eachSeries.linearIndex], columnOption.linearOpacity)); - grd.addColorStop(columnOption.colorStop, hexToRgb(columnOption.customColor[eachSeries.linearIndex],columnOption.linearOpacity)); - grd.addColorStop(1, hexToRgb(fillColor, 1)); - } - fillColor = grd - } - // 圆角边框 - if ((columnOption.barBorderRadius && columnOption.barBorderRadius.length === 4) || columnOption.barBorderCircle === true) { - const left = startX; - const width = item.width; - const top = item.y - item.width / 2; - const height = item.height; - if (columnOption.barBorderCircle) { - columnOption.barBorderRadius = [width / 2, width / 2, 0, 0]; - } - let [r0, r1, r2, r3] = columnOption.barBorderRadius; - let minRadius = Math.min(width/2,height/2); - r0 = r0 > minRadius ? minRadius : r0; - r1 = r1 > minRadius ? minRadius : r1; - r2 = r2 > minRadius ? minRadius : r2; - r3 = r3 > minRadius ? minRadius : r3; - r0 = r0 < 0 ? 0 : r0; - r1 = r1 < 0 ? 0 : r1; - r2 = r2 < 0 ? 0 : r2; - r3 = r3 < 0 ? 0 : r3; - - context.arc(left + r3, top + r3, r3, -Math.PI, -Math.PI / 2); - context.arc(item.x - r0, top + r0, r0, -Math.PI / 2, 0); - context.arc(item.x - r1, top + width - r1, r1, 0, Math.PI / 2); - context.arc(left + r2, top + width - r2, r2, Math.PI / 2, Math.PI); - } else { - context.moveTo(startX, startY); - context.lineTo(item.x, startY); - context.lineTo(item.x, startY + item.width); - context.lineTo(startX, startY + item.width); - context.lineTo(startX, startY); - context.setLineWidth(1) - context.setStrokeStyle(strokeColor); - } - context.setFillStyle(fillColor); - context.closePath(); - //context.stroke(); - context.fill(); - } - }; - break; - case 'stack': - // 绘制堆叠数据图 - var points = getBarStackDataPoints(data, minRange, maxRange, yAxisPoints, eachSpacing, opts, config, seriesIndex, series, process); - calPoints.push(points); - points = fixBarStackData(points, eachSpacing, series.length, seriesIndex, config, opts, series); - for (let i = 0; i < points.length; i++) { - let item = points[i]; - if (item !== null && i > leftNum && i < rightNum) { - context.beginPath(); - var fillColor = item.color || eachSeries.color; - var startX = item.x0; - context.setFillStyle(fillColor); - context.moveTo(startX, item.y - item.width/2); - context.fillRect(startX, item.y - item.width/2, item.height , item.width); - context.closePath(); - context.fill(); - } - }; - break; - } - }); - - if (opts.dataLabel !== false && process === 1) { - series.forEach(function(eachSeries, seriesIndex) { - let ranges, minRange, maxRange; - ranges = [].concat(opts.chartData.xAxisData.ranges); - maxRange = ranges.pop(); - minRange = ranges.shift(); - var data = eachSeries.data; - switch (columnOption.type) { - case 'group': - var points = getBarDataPoints(data, minRange, maxRange, yAxisPoints, eachSpacing, opts, config, process); - points = fixBarData(points, eachSpacing, series.length, seriesIndex, config, opts); - drawBarPointText(points, eachSeries, config, context, opts); - break; - case 'stack': - var points = getBarStackDataPoints(data, minRange, maxRange, yAxisPoints, eachSpacing, opts, config, seriesIndex, series, process); - drawBarPointText(points, eachSeries, config, context, opts); - break; - } - }); - } - return { - yAxisPoints: yAxisPoints, - calPoints: calPoints, - eachSpacing: eachSpacing - }; -} - -function drawCandleDataPoints(series, seriesMA, opts, config, context) { - var process = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 1; - var candleOption = assign({}, { - color: {}, - average: {} - }, opts.extra.candle); - candleOption.color = assign({}, { - upLine: '#f04864', - upFill: '#f04864', - downLine: '#2fc25b', - downFill: '#2fc25b' - }, candleOption.color); - candleOption.average = assign({}, { - show: false, - name: [], - day: [], - color: config.color - }, candleOption.average); - opts.extra.candle = candleOption; - let xAxisData = opts.chartData.xAxisData, - xAxisPoints = xAxisData.xAxisPoints, - eachSpacing = xAxisData.eachSpacing; - let calPoints = []; - context.save(); - let leftNum = -2; - let rightNum = xAxisPoints.length + 2; - let leftSpace = 0; - let rightSpace = opts.width + eachSpacing; - if (opts._scrollDistance_ && opts._scrollDistance_ !== 0 && opts.enableScroll === true) { - context.translate(opts._scrollDistance_, 0); - leftNum = Math.floor(-opts._scrollDistance_ / eachSpacing) - 2; - rightNum = leftNum + opts.xAxis.itemCount + 4; - leftSpace = -opts._scrollDistance_ - eachSpacing * 2 + opts.area[3]; - rightSpace = leftSpace + (opts.xAxis.itemCount + 4) * eachSpacing; - } - //画均线 - if (candleOption.average.show || seriesMA) { //Merge pull request !12 from 邱贵翔 - seriesMA.forEach(function(eachSeries, seriesIndex) { - let ranges, minRange, maxRange; - ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]); - minRange = ranges.pop(); - maxRange = ranges.shift(); - var data = eachSeries.data; - var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process); - var splitPointList = splitPoints(points,eachSeries); - for (let i = 0; i < splitPointList.length; i++) { - let points = splitPointList[i]; - context.beginPath(); - context.setStrokeStyle(eachSeries.color); - context.setLineWidth(1); - if (points.length === 1) { - context.moveTo(points[0].x, points[0].y); - context.arc(points[0].x, points[0].y, 1, 0, 2 * Math.PI); - } else { - context.moveTo(points[0].x, points[0].y); - let startPoint = 0; - for (let j = 0; j < points.length; j++) { - let item = points[j]; - if (startPoint == 0 && item.x > leftSpace) { - context.moveTo(item.x, item.y); - startPoint = 1; - } - if (j > 0 && item.x > leftSpace && item.x < rightSpace) { - var ctrlPoint = createCurveControlPoints(points, j - 1); - context.bezierCurveTo(ctrlPoint.ctrA.x, ctrlPoint.ctrA.y, ctrlPoint.ctrB.x, ctrlPoint.ctrB.y, item.x, - item.y); - } - } - context.moveTo(points[0].x, points[0].y); - } - context.closePath(); - context.stroke(); - } - }); - } - //画K线 - series.forEach(function(eachSeries, seriesIndex) { - let ranges, minRange, maxRange; - ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]); - minRange = ranges.pop(); - maxRange = ranges.shift(); - var data = eachSeries.data; - var points = getCandleDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process); - calPoints.push(points); - var splitPointList = splitPoints(points,eachSeries); - for (let i = 0; i < splitPointList[0].length; i++) { - if (i > leftNum && i < rightNum) { - let item = splitPointList[0][i]; - context.beginPath(); - //如果上涨 - if (data[i][1] - data[i][0] > 0) { - context.setStrokeStyle(candleOption.color.upLine); - context.setFillStyle(candleOption.color.upFill); - context.setLineWidth(1 * opts.pix); - context.moveTo(item[3].x, item[3].y); //顶点 - context.lineTo(item[1].x, item[1].y); //收盘中间点 - context.lineTo(item[1].x - eachSpacing / 4, item[1].y); //收盘左侧点 - context.lineTo(item[0].x - eachSpacing / 4, item[0].y); //开盘左侧点 - context.lineTo(item[0].x, item[0].y); //开盘中间点 - context.lineTo(item[2].x, item[2].y); //底点 - context.lineTo(item[0].x, item[0].y); //开盘中间点 - context.lineTo(item[0].x + eachSpacing / 4, item[0].y); //开盘右侧点 - context.lineTo(item[1].x + eachSpacing / 4, item[1].y); //收盘右侧点 - context.lineTo(item[1].x, item[1].y); //收盘中间点 - context.moveTo(item[3].x, item[3].y); //顶点 - } else { - context.setStrokeStyle(candleOption.color.downLine); - context.setFillStyle(candleOption.color.downFill); - context.setLineWidth(1 * opts.pix); - context.moveTo(item[3].x, item[3].y); //顶点 - context.lineTo(item[0].x, item[0].y); //开盘中间点 - context.lineTo(item[0].x - eachSpacing / 4, item[0].y); //开盘左侧点 - context.lineTo(item[1].x - eachSpacing / 4, item[1].y); //收盘左侧点 - context.lineTo(item[1].x, item[1].y); //收盘中间点 - context.lineTo(item[2].x, item[2].y); //底点 - context.lineTo(item[1].x, item[1].y); //收盘中间点 - context.lineTo(item[1].x + eachSpacing / 4, item[1].y); //收盘右侧点 - context.lineTo(item[0].x + eachSpacing / 4, item[0].y); //开盘右侧点 - context.lineTo(item[0].x, item[0].y); //开盘中间点 - context.moveTo(item[3].x, item[3].y); //顶点 - } - context.closePath(); - context.fill(); - context.stroke(); - } - } - }); - context.restore(); - return { - xAxisPoints: xAxisPoints, - calPoints: calPoints, - eachSpacing: eachSpacing - }; -} - -function drawAreaDataPoints(series, opts, config, context) { - var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1; - var areaOption = assign({}, { - type: 'straight', - opacity: 0.2, - addLine: false, - width: 2, - gradient: false, - activeType: 'none' - }, opts.extra.area); - let xAxisData = opts.chartData.xAxisData, - xAxisPoints = xAxisData.xAxisPoints, - eachSpacing = xAxisData.eachSpacing; - let endY = opts.height - opts.area[2]; - let calPoints = []; - context.save(); - let leftSpace = 0; - let rightSpace = opts.width + eachSpacing; - if (opts._scrollDistance_ && opts._scrollDistance_ !== 0 && opts.enableScroll === true) { - context.translate(opts._scrollDistance_, 0); - leftSpace = -opts._scrollDistance_ - eachSpacing * 2 + opts.area[3]; - rightSpace = leftSpace + (opts.xAxis.itemCount + 4) * eachSpacing; - } - series.forEach(function(eachSeries, seriesIndex) { - let ranges, minRange, maxRange; - ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]); - minRange = ranges.pop(); - maxRange = ranges.shift(); - let data = eachSeries.data; - let points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process); - calPoints.push(points); - let splitPointList = splitPoints(points,eachSeries); - for (let i = 0; i < splitPointList.length; i++) { - let points = splitPointList[i]; - // 绘制区域数 - context.beginPath(); - context.setStrokeStyle(hexToRgb(eachSeries.color, areaOption.opacity)); - if (areaOption.gradient) { - let gradient = context.createLinearGradient(0, opts.area[0], 0, opts.height - opts.area[2]); - gradient.addColorStop('0', hexToRgb(eachSeries.color, areaOption.opacity)); - gradient.addColorStop('1.0', hexToRgb("#FFFFFF", 0.1)); - context.setFillStyle(gradient); - } else { - context.setFillStyle(hexToRgb(eachSeries.color, areaOption.opacity)); - } - context.setLineWidth(areaOption.width * opts.pix); - if (points.length > 1) { - let firstPoint = points[0]; - let lastPoint = points[points.length - 1]; - context.moveTo(firstPoint.x, firstPoint.y); - let startPoint = 0; - if (areaOption.type === 'curve') { - for (let j = 0; j < points.length; j++) { - let item = points[j]; - if (startPoint == 0 && item.x > leftSpace) { - context.moveTo(item.x, item.y); - startPoint = 1; - } - if (j > 0 && item.x > leftSpace && item.x < rightSpace) { - let ctrlPoint = createCurveControlPoints(points, j - 1); - context.bezierCurveTo(ctrlPoint.ctrA.x, ctrlPoint.ctrA.y, ctrlPoint.ctrB.x, ctrlPoint.ctrB.y, item.x, item.y); - } - }; - } - if (areaOption.type === 'straight') { - for (let j = 0; j < points.length; j++) { - let item = points[j]; - if (startPoint == 0 && item.x > leftSpace) { - context.moveTo(item.x, item.y); - startPoint = 1; - } - if (j > 0 && item.x > leftSpace && item.x < rightSpace) { - context.lineTo(item.x, item.y); - } - }; - } - if (areaOption.type === 'step') { - for (let j = 0; j < points.length; j++) { - let item = points[j]; - if (startPoint == 0 && item.x > leftSpace) { - context.moveTo(item.x, item.y); - startPoint = 1; - } - if (j > 0 && item.x > leftSpace && item.x < rightSpace) { - context.lineTo(item.x, points[j - 1].y); - context.lineTo(item.x, item.y); - } - }; - } - context.lineTo(lastPoint.x, endY); - context.lineTo(firstPoint.x, endY); - context.lineTo(firstPoint.x, firstPoint.y); - } else { - let item = points[0]; - context.moveTo(item.x - eachSpacing / 2, item.y); - // context.lineTo(item.x + eachSpacing / 2, item.y); - // context.lineTo(item.x + eachSpacing / 2, endY); - // context.lineTo(item.x - eachSpacing / 2, endY); - // context.moveTo(item.x - eachSpacing / 2, item.y); - } - context.closePath(); - context.fill(); - //画连线 - if (areaOption.addLine) { - if (eachSeries.lineType == 'dash') { - let dashLength = eachSeries.dashLength ? eachSeries.dashLength : 8; - dashLength *= opts.pix; - context.setLineDash([dashLength, dashLength]); - } - context.beginPath(); - context.setStrokeStyle(eachSeries.color); - context.setLineWidth(areaOption.width * opts.pix); - if (points.length === 1) { - context.moveTo(points[0].x, points[0].y); - // context.arc(points[0].x, points[0].y, 1, 0, 2 * Math.PI); - } else { - context.moveTo(points[0].x, points[0].y); - let startPoint = 0; - if (areaOption.type === 'curve') { - for (let j = 0; j < points.length; j++) { - let item = points[j]; - if (startPoint == 0 && item.x > leftSpace) { - context.moveTo(item.x, item.y); - startPoint = 1; - } - if (j > 0 && item.x > leftSpace && item.x < rightSpace) { - let ctrlPoint = createCurveControlPoints(points, j - 1); - context.bezierCurveTo(ctrlPoint.ctrA.x, ctrlPoint.ctrA.y, ctrlPoint.ctrB.x, ctrlPoint.ctrB.y, item.x, item.y); - } - }; - } - if (areaOption.type === 'straight') { - for (let j = 0; j < points.length; j++) { - let item = points[j]; - if (startPoint == 0 && item.x > leftSpace) { - context.moveTo(item.x, item.y); - startPoint = 1; - } - if (j > 0 && item.x > leftSpace && item.x < rightSpace) { - context.lineTo(item.x, item.y); - } - }; - } - if (areaOption.type === 'step') { - for (let j = 0; j < points.length; j++) { - let item = points[j]; - if (startPoint == 0 && item.x > leftSpace) { - context.moveTo(item.x, item.y); - startPoint = 1; - } - if (j > 0 && item.x > leftSpace && item.x < rightSpace) { - context.lineTo(item.x, points[j - 1].y); - context.lineTo(item.x, item.y); - } - }; - } - context.moveTo(points[0].x, points[0].y); - } - context.stroke(); - context.setLineDash([]); - } - } - //画点 - if (opts.dataPointShape !== false) { - drawPointShape(points, eachSeries.color, eachSeries.pointShape, context, opts); - } - drawActivePoint(points, eachSeries.color, eachSeries.pointShape, context, opts, areaOption,seriesIndex); - }); - - if (opts.dataLabel !== false && process === 1) { - series.forEach(function(eachSeries, seriesIndex) { - let ranges, minRange, maxRange; - ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]); - minRange = ranges.pop(); - maxRange = ranges.shift(); - var data = eachSeries.data; - var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process); - drawPointText(points, eachSeries, config, context, opts); - }); - } - context.restore(); - return { - xAxisPoints: xAxisPoints, - calPoints: calPoints, - eachSpacing: eachSpacing - }; -} - -function drawScatterDataPoints(series, opts, config, context) { - var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1; - var scatterOption = assign({}, { - type: 'circle' - }, opts.extra.scatter); - let xAxisData = opts.chartData.xAxisData, - xAxisPoints = xAxisData.xAxisPoints, - eachSpacing = xAxisData.eachSpacing; - var calPoints = []; - context.save(); - let leftSpace = 0; - let rightSpace = opts.width + eachSpacing; - if (opts._scrollDistance_ && opts._scrollDistance_ !== 0 && opts.enableScroll === true) { - context.translate(opts._scrollDistance_, 0); - leftSpace = -opts._scrollDistance_ - eachSpacing * 2 + opts.area[3]; - rightSpace = leftSpace + (opts.xAxis.itemCount + 4) * eachSpacing; - } - series.forEach(function(eachSeries, seriesIndex) { - let ranges, minRange, maxRange; - ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]); - minRange = ranges.pop(); - maxRange = ranges.shift(); - var data = eachSeries.data; - var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process); - context.beginPath(); - context.setStrokeStyle(eachSeries.color); - context.setFillStyle(eachSeries.color); - context.setLineWidth(1 * opts.pix); - var shape = eachSeries.pointShape; - if (shape === 'diamond') { - points.forEach(function(item, index) { - if (item !== null) { - context.moveTo(item.x, item.y - 4.5); - context.lineTo(item.x - 4.5, item.y); - context.lineTo(item.x, item.y + 4.5); - context.lineTo(item.x + 4.5, item.y); - context.lineTo(item.x, item.y - 4.5); - } - }); - } else if (shape === 'circle') { - points.forEach(function(item, index) { - if (item !== null) { - context.moveTo(item.x + 2.5 * opts.pix, item.y); - context.arc(item.x, item.y, 3 * opts.pix, 0, 2 * Math.PI, false); - } - }); - } else if (shape === 'square') { - points.forEach(function(item, index) { - if (item !== null) { - context.moveTo(item.x - 3.5, item.y - 3.5); - context.rect(item.x - 3.5, item.y - 3.5, 7, 7); - } - }); - } else if (shape === 'triangle') { - points.forEach(function(item, index) { - if (item !== null) { - context.moveTo(item.x, item.y - 4.5); - context.lineTo(item.x - 4.5, item.y + 4.5); - context.lineTo(item.x + 4.5, item.y + 4.5); - context.lineTo(item.x, item.y - 4.5); - } - }); - } else if (shape === 'triangle') { - return; - } - context.closePath(); - context.fill(); - context.stroke(); - }); - if (opts.dataLabel !== false && process === 1) { - series.forEach(function(eachSeries, seriesIndex) { - let ranges, minRange, maxRange; - ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]); - minRange = ranges.pop(); - maxRange = ranges.shift(); - var data = eachSeries.data; - var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process); - drawPointText(points, eachSeries, config, context, opts); - }); - } - context.restore(); - return { - xAxisPoints: xAxisPoints, - calPoints: calPoints, - eachSpacing: eachSpacing - }; -} - -function drawBubbleDataPoints(series, opts, config, context) { - var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1; - var bubbleOption = assign({}, { - opacity: 1, - border:2 - }, opts.extra.bubble); - let xAxisData = opts.chartData.xAxisData, - xAxisPoints = xAxisData.xAxisPoints, - eachSpacing = xAxisData.eachSpacing; - var calPoints = []; - context.save(); - let leftSpace = 0; - let rightSpace = opts.width + eachSpacing; - if (opts._scrollDistance_ && opts._scrollDistance_ !== 0 && opts.enableScroll === true) { - context.translate(opts._scrollDistance_, 0); - leftSpace = -opts._scrollDistance_ - eachSpacing * 2 + opts.area[3]; - rightSpace = leftSpace + (opts.xAxis.itemCount + 4) * eachSpacing; - } - series.forEach(function(eachSeries, seriesIndex) { - let ranges, minRange, maxRange; - ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]); - minRange = ranges.pop(); - maxRange = ranges.shift(); - var data = eachSeries.data; - var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process); - context.beginPath(); - context.setStrokeStyle(eachSeries.color); - context.setLineWidth(bubbleOption.border * opts.pix); - context.setFillStyle(hexToRgb(eachSeries.color, bubbleOption.opacity)); - points.forEach(function(item, index) { - context.moveTo(item.x + item.r, item.y); - context.arc(item.x, item.y, item.r * opts.pix, 0, 2 * Math.PI, false); - }); - context.closePath(); - context.fill(); - context.stroke(); - - if (opts.dataLabel !== false && process === 1) { - points.forEach(function(item, index) { - context.beginPath(); - var fontSize = eachSeries.textSize * opts.pix || config.fontSize; - context.setFontSize(fontSize); - context.setFillStyle(eachSeries.textColor || "#FFFFFF"); - context.setTextAlign('center'); - context.fillText(String(item.t), item.x, item.y + fontSize/2); - context.closePath(); - context.stroke(); - context.setTextAlign('left'); - }); - } - }); - context.restore(); - return { - xAxisPoints: xAxisPoints, - calPoints: calPoints, - eachSpacing: eachSpacing - }; -} - -function drawLineDataPoints(series, opts, config, context) { - var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1; - var lineOption = assign({}, { - type: 'straight', - width: 2, - activeType: 'none', - linearType: 'none', - onShadow: false, - animation: 'vertical', - }, opts.extra.line); - lineOption.width *= opts.pix; - let xAxisData = opts.chartData.xAxisData, - xAxisPoints = xAxisData.xAxisPoints, - eachSpacing = xAxisData.eachSpacing; - var calPoints = []; - context.save(); - let leftSpace = 0; - let rightSpace = opts.width + eachSpacing; - if (opts._scrollDistance_ && opts._scrollDistance_ !== 0 && opts.enableScroll === true) { - context.translate(opts._scrollDistance_, 0); - leftSpace = -opts._scrollDistance_ - eachSpacing * 2 + opts.area[3]; - rightSpace = leftSpace + (opts.xAxis.itemCount + 4) * eachSpacing; - } - series.forEach(function(eachSeries, seriesIndex) { - // 这段很神奇的代码用于解决ios16的setStrokeStyle失效的bug - context.beginPath(); - context.setStrokeStyle(eachSeries.color); - context.moveTo(-10000, -10000); - context.lineTo(-10001, -10001); - context.stroke(); - let ranges, minRange, maxRange; - ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]); - minRange = ranges.pop(); - maxRange = ranges.shift(); - var data = eachSeries.data; - var points = getLineDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, lineOption, process); - calPoints.push(points); - var splitPointList = splitPoints(points,eachSeries); - if (eachSeries.lineType == 'dash') { - let dashLength = eachSeries.dashLength ? eachSeries.dashLength : 8; - dashLength *= opts.pix; - context.setLineDash([dashLength, dashLength]); - } - context.beginPath(); - var strokeColor = eachSeries.color; - if (lineOption.linearType !== 'none' && eachSeries.linearColor && eachSeries.linearColor.length > 0) { - var grd = context.createLinearGradient(opts.chartData.xAxisData.startX, opts.height/2, opts.chartData.xAxisData.endX, opts.height/2); - for (var i = 0; i < eachSeries.linearColor.length; i++) { - grd.addColorStop(eachSeries.linearColor[i][0], hexToRgb(eachSeries.linearColor[i][1], 1)); - } - strokeColor = grd - } - context.setStrokeStyle(strokeColor); - if (lineOption.onShadow == true && eachSeries.setShadow && eachSeries.setShadow.length > 0) { - context.setShadow(eachSeries.setShadow[0], eachSeries.setShadow[1], eachSeries.setShadow[2], eachSeries.setShadow[3]); - }else{ - context.setShadow(0, 0, 0, 'rgba(0,0,0,0)'); - } - context.setLineWidth(lineOption.width); - splitPointList.forEach(function(points, index) { - if (points.length === 1) { - context.moveTo(points[0].x, points[0].y); - // context.arc(points[0].x, points[0].y, 1, 0, 2 * Math.PI); - } else { - context.moveTo(points[0].x, points[0].y); - let startPoint = 0; - if (lineOption.type === 'curve') { - for (let j = 0; j < points.length; j++) { - let item = points[j]; - if (startPoint == 0 && item.x > leftSpace) { - context.moveTo(item.x, item.y); - startPoint = 1; - } - if (j > 0 && item.x > leftSpace && item.x < rightSpace) { - var ctrlPoint = createCurveControlPoints(points, j - 1); - context.bezierCurveTo(ctrlPoint.ctrA.x, ctrlPoint.ctrA.y, ctrlPoint.ctrB.x, ctrlPoint.ctrB.y, item.x, item.y); - } - }; - } - if (lineOption.type === 'straight') { - for (let j = 0; j < points.length; j++) { - let item = points[j]; - if (startPoint == 0 && item.x > leftSpace) { - context.moveTo(item.x, item.y); - startPoint = 1; - } - if (j > 0 && item.x > leftSpace && item.x < rightSpace) { - context.lineTo(item.x, item.y); - } - }; - } - if (lineOption.type === 'step') { - for (let j = 0; j < points.length; j++) { - let item = points[j]; - if (startPoint == 0 && item.x > leftSpace) { - context.moveTo(item.x, item.y); - startPoint = 1; - } - if (j > 0 && item.x > leftSpace && item.x < rightSpace) { - context.lineTo(item.x, points[j - 1].y); - context.lineTo(item.x, item.y); - } - }; - } - context.moveTo(points[0].x, points[0].y); - } - }); - context.stroke(); - context.setLineDash([]); - if (opts.dataPointShape !== false) { - drawPointShape(points, eachSeries.color, eachSeries.pointShape, context, opts); - } - drawActivePoint(points, eachSeries.color, eachSeries.pointShape, context, opts, lineOption); - }); - if (opts.dataLabel !== false && process === 1) { - series.forEach(function(eachSeries, seriesIndex) { - let ranges, minRange, maxRange; - ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]); - minRange = ranges.pop(); - maxRange = ranges.shift(); - var data = eachSeries.data; - var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process); - drawPointText(points, eachSeries, config, context, opts); - }); - } - context.restore(); - return { - xAxisPoints: xAxisPoints, - calPoints: calPoints, - eachSpacing: eachSpacing - }; -} - -function drawMixDataPoints(series, opts, config, context) { - let process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1; - let xAxisData = opts.chartData.xAxisData, - xAxisPoints = xAxisData.xAxisPoints, - eachSpacing = xAxisData.eachSpacing; - let columnOption = assign({}, { - width: eachSpacing / 2, - barBorderCircle: false, - barBorderRadius: [], - seriesGap: 2, - linearType: 'none', - linearOpacity: 1, - customColor: [], - colorStop: 0, - }, opts.extra.mix.column); - let areaOption = assign({}, { - opacity: 0.2, - gradient: false - }, opts.extra.mix.area); - let lineOption = assign({}, { - width: 2 - }, opts.extra.mix.line); - let endY = opts.height - opts.area[2]; - let calPoints = []; - var columnIndex = 0; - var columnLength = 0; - series.forEach(function(eachSeries, seriesIndex) { - if (eachSeries.type == 'column') { - columnLength += 1; - } - }); - context.save(); - let leftNum = -2; - let rightNum = xAxisPoints.length + 2; - let leftSpace = 0; - let rightSpace = opts.width + eachSpacing; - if (opts._scrollDistance_ && opts._scrollDistance_ !== 0 && opts.enableScroll === true) { - context.translate(opts._scrollDistance_, 0); - leftNum = Math.floor(-opts._scrollDistance_ / eachSpacing) - 2; - rightNum = leftNum + opts.xAxis.itemCount + 4; - leftSpace = -opts._scrollDistance_ - eachSpacing * 2 + opts.area[3]; - rightSpace = leftSpace + (opts.xAxis.itemCount + 4) * eachSpacing; - } - columnOption.customColor = fillCustomColor(columnOption.linearType, columnOption.customColor, series, config); - series.forEach(function(eachSeries, seriesIndex) { - let ranges, minRange, maxRange; - ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]); - minRange = ranges.pop(); - maxRange = ranges.shift(); - var data = eachSeries.data; - var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process); - calPoints.push(points); - // 绘制柱状数据图 - if (eachSeries.type == 'column') { - points = fixColumeData(points, eachSpacing, columnLength, columnIndex, config, opts); - for (let i = 0; i < points.length; i++) { - let item = points[i]; - if (item !== null && i > leftNum && i < rightNum) { - var startX = item.x - item.width / 2; - var height = opts.height - item.y - opts.area[2]; - context.beginPath(); - var fillColor = item.color || eachSeries.color - var strokeColor = item.color || eachSeries.color - if (columnOption.linearType !== 'none') { - var grd = context.createLinearGradient(startX, item.y, startX, opts.height - opts.area[2]); - //透明渐变 - if (columnOption.linearType == 'opacity') { - grd.addColorStop(0, hexToRgb(fillColor, columnOption.linearOpacity)); - grd.addColorStop(1, hexToRgb(fillColor, 1)); - } else { - grd.addColorStop(0, hexToRgb(columnOption.customColor[eachSeries.linearIndex], columnOption.linearOpacity)); - grd.addColorStop(columnOption.colorStop, hexToRgb(columnOption.customColor[eachSeries.linearIndex], columnOption.linearOpacity)); - grd.addColorStop(1, hexToRgb(fillColor, 1)); - } - fillColor = grd - } - // 圆角边框 - if ((columnOption.barBorderRadius && columnOption.barBorderRadius.length === 4) || columnOption.barBorderCircle) { - const left = startX; - const top = item.y; - const width = item.width; - const height = opts.height - opts.area[2] - item.y; - if (columnOption.barBorderCircle) { - columnOption.barBorderRadius = [width / 2, width / 2, 0, 0]; - } - let [r0, r1, r2, r3] = columnOption.barBorderRadius; - let minRadius = Math.min(width/2,height/2); - r0 = r0 > minRadius ? minRadius : r0; - r1 = r1 > minRadius ? minRadius : r1; - r2 = r2 > minRadius ? minRadius : r2; - r3 = r3 > minRadius ? minRadius : r3; - r0 = r0 < 0 ? 0 : r0; - r1 = r1 < 0 ? 0 : r1; - r2 = r2 < 0 ? 0 : r2; - r3 = r3 < 0 ? 0 : r3; - context.arc(left + r0, top + r0, r0, -Math.PI, -Math.PI / 2); - context.arc(left + width - r1, top + r1, r1, -Math.PI / 2, 0); - context.arc(left + width - r2, top + height - r2, r2, 0, Math.PI / 2); - context.arc(left + r3, top + height - r3, r3, Math.PI / 2, Math.PI); - } else { - context.moveTo(startX, item.y); - context.lineTo(startX + item.width, item.y); - context.lineTo(startX + item.width, opts.height - opts.area[2]); - context.lineTo(startX, opts.height - opts.area[2]); - context.lineTo(startX, item.y); - context.setLineWidth(1) - context.setStrokeStyle(strokeColor); - } - context.setFillStyle(fillColor); - context.closePath(); - context.fill(); - } - } - columnIndex += 1; - } - //绘制区域图数据 - if (eachSeries.type == 'area') { - let splitPointList = splitPoints(points,eachSeries); - for (let i = 0; i < splitPointList.length; i++) { - let points = splitPointList[i]; - // 绘制区域数据 - context.beginPath(); - context.setStrokeStyle(eachSeries.color); - context.setStrokeStyle(hexToRgb(eachSeries.color, areaOption.opacity)); - if (areaOption.gradient) { - let gradient = context.createLinearGradient(0, opts.area[0], 0, opts.height - opts.area[2]); - gradient.addColorStop('0', hexToRgb(eachSeries.color, areaOption.opacity)); - gradient.addColorStop('1.0', hexToRgb("#FFFFFF", 0.1)); - context.setFillStyle(gradient); - } else { - context.setFillStyle(hexToRgb(eachSeries.color, areaOption.opacity)); - } - context.setLineWidth(2 * opts.pix); - if (points.length > 1) { - var firstPoint = points[0]; - let lastPoint = points[points.length - 1]; - context.moveTo(firstPoint.x, firstPoint.y); - let startPoint = 0; - if (eachSeries.style === 'curve') { - for (let j = 0; j < points.length; j++) { - let item = points[j]; - if (startPoint == 0 && item.x > leftSpace) { - context.moveTo(item.x, item.y); - startPoint = 1; - } - if (j > 0 && item.x > leftSpace && item.x < rightSpace) { - var ctrlPoint = createCurveControlPoints(points, j - 1); - context.bezierCurveTo(ctrlPoint.ctrA.x, ctrlPoint.ctrA.y, ctrlPoint.ctrB.x, ctrlPoint.ctrB.y, item.x, item.y); - } - }; - } else { - for (let j = 0; j < points.length; j++) { - let item = points[j]; - if (startPoint == 0 && item.x > leftSpace) { - context.moveTo(item.x, item.y); - startPoint = 1; - } - if (j > 0 && item.x > leftSpace && item.x < rightSpace) { - context.lineTo(item.x, item.y); - } - }; - } - context.lineTo(lastPoint.x, endY); - context.lineTo(firstPoint.x, endY); - context.lineTo(firstPoint.x, firstPoint.y); - } else { - let item = points[0]; - context.moveTo(item.x - eachSpacing / 2, item.y); - // context.lineTo(item.x + eachSpacing / 2, item.y); - // context.lineTo(item.x + eachSpacing / 2, endY); - // context.lineTo(item.x - eachSpacing / 2, endY); - // context.moveTo(item.x - eachSpacing / 2, item.y); - } - context.closePath(); - context.fill(); - } - } - // 绘制折线数据图 - if (eachSeries.type == 'line') { - var splitPointList = splitPoints(points,eachSeries); - splitPointList.forEach(function(points, index) { - if (eachSeries.lineType == 'dash') { - let dashLength = eachSeries.dashLength ? eachSeries.dashLength : 8; - dashLength *= opts.pix; - context.setLineDash([dashLength, dashLength]); - } - context.beginPath(); - context.setStrokeStyle(eachSeries.color); - context.setLineWidth(lineOption.width * opts.pix); - if (points.length === 1) { - context.moveTo(points[0].x, points[0].y); - // context.arc(points[0].x, points[0].y, 1, 0, 2 * Math.PI); - } else { - context.moveTo(points[0].x, points[0].y); - let startPoint = 0; - if (eachSeries.style == 'curve') { - for (let j = 0; j < points.length; j++) { - let item = points[j]; - if (startPoint == 0 && item.x > leftSpace) { - context.moveTo(item.x, item.y); - startPoint = 1; - } - if (j > 0 && item.x > leftSpace && item.x < rightSpace) { - var ctrlPoint = createCurveControlPoints(points, j - 1); - context.bezierCurveTo(ctrlPoint.ctrA.x, ctrlPoint.ctrA.y, ctrlPoint.ctrB.x, ctrlPoint.ctrB.y, - item.x, item.y); - } - } - } else { - for (let j = 0; j < points.length; j++) { - let item = points[j]; - if (startPoint == 0 && item.x > leftSpace) { - context.moveTo(item.x, item.y); - startPoint = 1; - } - if (j > 0 && item.x > leftSpace && item.x < rightSpace) { - context.lineTo(item.x, item.y); - } - } - } - context.moveTo(points[0].x, points[0].y); - } - context.stroke(); - context.setLineDash([]); - }); - } - // 绘制点数据图 - if (eachSeries.type == 'point') { - eachSeries.addPoint = true; - } - if (eachSeries.addPoint == true && eachSeries.type !== 'column') { - drawPointShape(points, eachSeries.color, eachSeries.pointShape, context, opts); - } - }); - if (opts.dataLabel !== false && process === 1) { - var columnIndex = 0; - series.forEach(function(eachSeries, seriesIndex) { - let ranges, minRange, maxRange; - ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]); - minRange = ranges.pop(); - maxRange = ranges.shift(); - var data = eachSeries.data; - var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process); - if (eachSeries.type !== 'column') { - drawPointText(points, eachSeries, config, context, opts); - } else { - points = fixColumeData(points, eachSpacing, columnLength, columnIndex, config, opts); - drawPointText(points, eachSeries, config, context, opts); - columnIndex += 1; - } - }); - } - context.restore(); - return { - xAxisPoints: xAxisPoints, - calPoints: calPoints, - eachSpacing: eachSpacing, - } -} - - -function drawToolTipBridge(opts, config, context, process, eachSpacing, xAxisPoints) { - var toolTipOption = opts.extra.tooltip || {}; - if (toolTipOption.horizentalLine && opts.tooltip && process === 1 && (opts.type == 'line' || opts.type == 'area' || opts.type == 'column' || opts.type == 'mount' || opts.type == 'candle' || opts.type == 'mix')) { - drawToolTipHorizentalLine(opts, config, context, eachSpacing, xAxisPoints) - } - context.save(); - if (opts._scrollDistance_ && opts._scrollDistance_ !== 0 && opts.enableScroll === true) { - context.translate(opts._scrollDistance_, 0); - } - if (opts.tooltip && opts.tooltip.textList && opts.tooltip.textList.length && process === 1) { - drawToolTip(opts.tooltip.textList, opts.tooltip.offset, opts, config, context, eachSpacing, xAxisPoints); - } - context.restore(); - -} - -function drawXAxis(categories, opts, config, context) { - - let xAxisData = opts.chartData.xAxisData, - xAxisPoints = xAxisData.xAxisPoints, - startX = xAxisData.startX, - endX = xAxisData.endX, - eachSpacing = xAxisData.eachSpacing; - var boundaryGap = 'center'; - if (opts.type == 'bar' || opts.type == 'line' || opts.type == 'area'|| opts.type == 'scatter' || opts.type == 'bubble') { - boundaryGap = opts.xAxis.boundaryGap; - } - var startY = opts.height - opts.area[2]; - var endY = opts.area[0]; - - //绘制滚动条 - if (opts.enableScroll && opts.xAxis.scrollShow) { - var scrollY = opts.height - opts.area[2] + config.xAxisHeight; - var scrollScreenWidth = endX - startX; - var scrollTotalWidth = eachSpacing * (xAxisPoints.length - 1); - if(opts.type == 'mount' && opts.extra && opts.extra.mount && opts.extra.mount.widthRatio && opts.extra.mount.widthRatio > 1){ - if(opts.extra.mount.widthRatio>2) opts.extra.mount.widthRatio = 2 - scrollTotalWidth += (opts.extra.mount.widthRatio - 1)*eachSpacing; - } - var scrollWidth = scrollScreenWidth * scrollScreenWidth / scrollTotalWidth; - var scrollLeft = 0; - if (opts._scrollDistance_) { - scrollLeft = -opts._scrollDistance_ * (scrollScreenWidth) / scrollTotalWidth; - } - context.beginPath(); - context.setLineCap('round'); - context.setLineWidth(6 * opts.pix); - context.setStrokeStyle(opts.xAxis.scrollBackgroundColor || "#EFEBEF"); - context.moveTo(startX, scrollY); - context.lineTo(endX, scrollY); - context.stroke(); - context.closePath(); - context.beginPath(); - context.setLineCap('round'); - context.setLineWidth(6 * opts.pix); - context.setStrokeStyle(opts.xAxis.scrollColor || "#A6A6A6"); - context.moveTo(startX + scrollLeft, scrollY); - context.lineTo(startX + scrollLeft + scrollWidth, scrollY); - context.stroke(); - context.closePath(); - context.setLineCap('butt'); - } - context.save(); - if (opts._scrollDistance_ && opts._scrollDistance_ !== 0) { - context.translate(opts._scrollDistance_, 0); - } - //绘制X轴刻度线 - if (opts.xAxis.calibration === true) { - context.setStrokeStyle(opts.xAxis.gridColor || "#cccccc"); - context.setLineCap('butt'); - context.setLineWidth(1 * opts.pix); - xAxisPoints.forEach(function(item, index) { - if (index > 0) { - context.beginPath(); - context.moveTo(item - eachSpacing / 2, startY); - context.lineTo(item - eachSpacing / 2, startY + 3 * opts.pix); - context.closePath(); - context.stroke(); - } - }); - } - //绘制X轴网格 - if (opts.xAxis.disableGrid !== true) { - context.setStrokeStyle(opts.xAxis.gridColor || "#cccccc"); - context.setLineCap('butt'); - context.setLineWidth(1 * opts.pix); - if (opts.xAxis.gridType == 'dash') { - context.setLineDash([opts.xAxis.dashLength * opts.pix, opts.xAxis.dashLength * opts.pix]); - } - opts.xAxis.gridEval = opts.xAxis.gridEval || 1; - xAxisPoints.forEach(function(item, index) { - if (index % opts.xAxis.gridEval == 0) { - context.beginPath(); - context.moveTo(item, startY); - context.lineTo(item, endY); - context.stroke(); - } - }); - context.setLineDash([]); - } - //绘制X轴文案 - if (opts.xAxis.disabled !== true) { - // 对X轴列表做抽稀处理 - //默认全部显示X轴标签 - let maxXAxisListLength = categories.length; - //如果设置了X轴单屏数量 - if (opts.xAxis.labelCount) { - //如果设置X轴密度 - if (opts.xAxis.itemCount) { - maxXAxisListLength = Math.ceil(categories.length / opts.xAxis.itemCount * opts.xAxis.labelCount); - } else { - maxXAxisListLength = opts.xAxis.labelCount; - } - maxXAxisListLength -= 1; - } - - let ratio = Math.ceil(categories.length / maxXAxisListLength); - - let newCategories = []; - let cgLength = categories.length; - for (let i = 0; i < cgLength; i++) { - if (i % ratio !== 0) { - newCategories.push(""); - } else { - newCategories.push(categories[i]); - } - } - newCategories[cgLength - 1] = categories[cgLength - 1]; - var xAxisFontSize = opts.xAxis.fontSize * opts.pix || config.fontSize; - if (config._xAxisTextAngle_ === 0) { - newCategories.forEach(function(item, index) { - var xitem = opts.xAxis.formatter ? opts.xAxis.formatter(item,index,opts) : item; - var offset = -measureText(String(xitem), xAxisFontSize, context) / 2; - if (boundaryGap == 'center') { - offset += eachSpacing / 2; - } - var scrollHeight = 0; - if (opts.xAxis.scrollShow) { - scrollHeight = 6 * opts.pix; - } - // 如果在主视图区域内 - var _scrollDistance_ = opts._scrollDistance_ || 0; - var truePoints = boundaryGap == 'center' ? xAxisPoints[index] + eachSpacing / 2 : xAxisPoints[index]; - if((truePoints - Math.abs(_scrollDistance_)) >= (opts.area[3] - 1) && (truePoints - Math.abs(_scrollDistance_)) <= (opts.width - opts.area[1] + 1)){ - context.beginPath(); - context.setFontSize(xAxisFontSize); - context.setFillStyle(opts.xAxis.fontColor || opts.fontColor); - context.fillText(String(xitem), xAxisPoints[index] + offset, startY + opts.xAxis.marginTop * opts.pix + (opts.xAxis.lineHeight - opts.xAxis.fontSize) * opts.pix / 2 + opts.xAxis.fontSize * opts.pix); - context.closePath(); - context.stroke(); - } - }); - } else { - newCategories.forEach(function(item, index) { - var xitem = opts.xAxis.formatter ? opts.xAxis.formatter(item) : item; - // 如果在主视图区域内 - var _scrollDistance_ = opts._scrollDistance_ || 0; - var truePoints = boundaryGap == 'center' ? xAxisPoints[index] + eachSpacing / 2 : xAxisPoints[index]; - if((truePoints - Math.abs(_scrollDistance_)) >= (opts.area[3] - 1) && (truePoints - Math.abs(_scrollDistance_)) <= (opts.width - opts.area[1] + 1)){ - context.save(); - context.beginPath(); - context.setFontSize(xAxisFontSize); - context.setFillStyle(opts.xAxis.fontColor || opts.fontColor); - var textWidth = measureText(String(xitem), xAxisFontSize, context); - var offsetX = xAxisPoints[index]; - if (boundaryGap == 'center') { - offsetX = xAxisPoints[index] + eachSpacing / 2; - } - var scrollHeight = 0; - if (opts.xAxis.scrollShow) { - scrollHeight = 6 * opts.pix; - } - var offsetY = startY + opts.xAxis.marginTop * opts.pix + xAxisFontSize - xAxisFontSize * Math.abs(Math.sin(config._xAxisTextAngle_)); - if(opts.xAxis.rotateAngle < 0){ - offsetX -= xAxisFontSize / 2; - textWidth = 0; - }else{ - offsetX += xAxisFontSize / 2; - textWidth = -textWidth; - } - context.translate(offsetX, offsetY); - context.rotate(-1 * config._xAxisTextAngle_); - context.fillText(String(xitem), textWidth , 0 ); - context.closePath(); - context.stroke(); - context.restore(); - } - }); - } - } - context.restore(); - - //画X轴标题 - if (opts.xAxis.title) { - context.beginPath(); - context.setFontSize(opts.xAxis.titleFontSize * opts.pix); - context.setFillStyle(opts.xAxis.titleFontColor); - context.fillText(String(opts.xAxis.title), opts.width - opts.area[1] + opts.xAxis.titleOffsetX * opts.pix,opts.height - opts.area[2] + opts.xAxis.marginTop * opts.pix + (opts.xAxis.lineHeight - opts.xAxis.titleFontSize) * opts.pix / 2 + (opts.xAxis.titleFontSize + opts.xAxis.titleOffsetY) * opts.pix); - context.closePath(); - context.stroke(); - } - - //绘制X轴轴线 - if (opts.xAxis.axisLine) { - context.beginPath(); - context.setStrokeStyle(opts.xAxis.axisLineColor); - context.setLineWidth(1 * opts.pix); - context.moveTo(startX, opts.height - opts.area[2]); - context.lineTo(endX, opts.height - opts.area[2]); - context.stroke(); - } -} - -function drawYAxisGrid(categories, opts, config, context) { - if (opts.yAxis.disableGrid === true) { - return; - } - let spacingValid = opts.height - opts.area[0] - opts.area[2]; - let eachSpacing = spacingValid / opts.yAxis.splitNumber; - let startX = opts.area[3]; - let xAxisPoints = opts.chartData.xAxisData.xAxisPoints, - xAxiseachSpacing = opts.chartData.xAxisData.eachSpacing; - let TotalWidth = xAxiseachSpacing * (xAxisPoints.length - 1); - if(opts.type == 'mount' && opts.extra && opts.extra.mount && opts.extra.mount.widthRatio && opts.extra.mount.widthRatio > 1 ){ - if(opts.extra.mount.widthRatio>2) opts.extra.mount.widthRatio = 2 - TotalWidth += (opts.extra.mount.widthRatio - 1) * xAxiseachSpacing; - } - let endX = startX + TotalWidth; - let points = []; - let startY = 1 - if (opts.xAxis.axisLine === false) { - startY = 0 - } - for (let i = startY; i < opts.yAxis.splitNumber + 1; i++) { - points.push(opts.height - opts.area[2] - eachSpacing * i); - } - context.save(); - if (opts._scrollDistance_ && opts._scrollDistance_ !== 0) { - context.translate(opts._scrollDistance_, 0); - } - if (opts.yAxis.gridType == 'dash') { - context.setLineDash([opts.yAxis.dashLength * opts.pix, opts.yAxis.dashLength * opts.pix]); - } - context.setStrokeStyle(opts.yAxis.gridColor); - context.setLineWidth(1 * opts.pix); - points.forEach(function(item, index) { - context.beginPath(); - context.moveTo(startX, item); - context.lineTo(endX, item); - context.stroke(); - }); - context.setLineDash([]); - context.restore(); -} - -function drawYAxis(series, opts, config, context) { - if (opts.yAxis.disabled === true) { - return; - } - var spacingValid = opts.height - opts.area[0] - opts.area[2]; - var eachSpacing = spacingValid / opts.yAxis.splitNumber; - var startX = opts.area[3]; - var endX = opts.width - opts.area[1]; - var endY = opts.height - opts.area[2]; - // set YAxis background - context.beginPath(); - context.setFillStyle(opts.background); - if (opts.enableScroll == true && opts.xAxis.scrollPosition && opts.xAxis.scrollPosition !== 'left') { - context.fillRect(0, 0, startX, endY + 2 * opts.pix); - } - if (opts.enableScroll == true && opts.xAxis.scrollPosition && opts.xAxis.scrollPosition !== 'right') { - context.fillRect(endX, 0, opts.width, endY + 2 * opts.pix); - } - context.closePath(); - context.stroke(); - - let tStartLeft = opts.area[3]; - let tStartRight = opts.width - opts.area[1]; - let tStartCenter = opts.area[3] + (opts.width - opts.area[1] - opts.area[3]) / 2; - if (opts.yAxis.data) { - for (let i = 0; i < opts.yAxis.data.length; i++) { - let yData = opts.yAxis.data[i]; - var points = []; - if(yData.type === 'categories'){ - for (let i = 0; i <= yData.categories.length; i++) { - points.push(opts.area[0] + spacingValid / yData.categories.length / 2 + spacingValid / yData.categories.length * i); - } - }else{ - for (let i = 0; i <= opts.yAxis.splitNumber; i++) { - points.push(opts.area[0] + eachSpacing * i); - } - } - if (yData.disabled !== true) { - let rangesFormat = opts.chartData.yAxisData.rangesFormat[i]; - let yAxisFontSize = yData.fontSize ? yData.fontSize * opts.pix : config.fontSize; - let yAxisWidth = opts.chartData.yAxisData.yAxisWidth[i]; - let textAlign = yData.textAlign || "right"; - //画Y轴刻度及文案 - rangesFormat.forEach(function(item, index) { - var pos = points[index]; - context.beginPath(); - context.setFontSize(yAxisFontSize); - context.setLineWidth(1 * opts.pix); - context.setStrokeStyle(yData.axisLineColor || '#cccccc'); - context.setFillStyle(yData.fontColor || opts.fontColor); - let tmpstrat = 0; - let gapwidth = 4 * opts.pix; - if (yAxisWidth.position == 'left') { - //画刻度线 - if (yData.calibration == true) { - context.moveTo(tStartLeft, pos); - context.lineTo(tStartLeft - 3 * opts.pix, pos); - gapwidth += 3 * opts.pix; - } - //画文字 - switch (textAlign) { - case "left": - context.setTextAlign('left'); - tmpstrat = tStartLeft - yAxisWidth.width - break; - case "right": - context.setTextAlign('right'); - tmpstrat = tStartLeft - gapwidth - break; - default: - context.setTextAlign('center'); - tmpstrat = tStartLeft - yAxisWidth.width / 2 - } - context.fillText(String(item), tmpstrat, pos + yAxisFontSize / 2 - 3 * opts.pix); - - } else if (yAxisWidth.position == 'right') { - //画刻度线 - if (yData.calibration == true) { - context.moveTo(tStartRight, pos); - context.lineTo(tStartRight + 3 * opts.pix, pos); - gapwidth += 3 * opts.pix; - } - switch (textAlign) { - case "left": - context.setTextAlign('left'); - tmpstrat = tStartRight + gapwidth - break; - case "right": - context.setTextAlign('right'); - tmpstrat = tStartRight + yAxisWidth.width - break; - default: - context.setTextAlign('center'); - tmpstrat = tStartRight + yAxisWidth.width / 2 - } - context.fillText(String(item), tmpstrat, pos + yAxisFontSize / 2 - 3 * opts.pix); - } else if (yAxisWidth.position == 'center') { - //画刻度线 - if (yData.calibration == true) { - context.moveTo(tStartCenter, pos); - context.lineTo(tStartCenter - 3 * opts.pix, pos); - gapwidth += 3 * opts.pix; - } - //画文字 - switch (textAlign) { - case "left": - context.setTextAlign('left'); - tmpstrat = tStartCenter - yAxisWidth.width - break; - case "right": - context.setTextAlign('right'); - tmpstrat = tStartCenter - gapwidth - break; - default: - context.setTextAlign('center'); - tmpstrat = tStartCenter - yAxisWidth.width / 2 - } - context.fillText(String(item), tmpstrat, pos + yAxisFontSize / 2 - 3 * opts.pix); - } - context.closePath(); - context.stroke(); - context.setTextAlign('left'); - }); - //画Y轴轴线 - if (yData.axisLine !== false) { - context.beginPath(); - context.setStrokeStyle(yData.axisLineColor || '#cccccc'); - context.setLineWidth(1 * opts.pix); - if (yAxisWidth.position == 'left') { - context.moveTo(tStartLeft, opts.height - opts.area[2]); - context.lineTo(tStartLeft, opts.area[0]); - } else if (yAxisWidth.position == 'right') { - context.moveTo(tStartRight, opts.height - opts.area[2]); - context.lineTo(tStartRight, opts.area[0]); - } else if (yAxisWidth.position == 'center') { - context.moveTo(tStartCenter, opts.height - opts.area[2]); - context.lineTo(tStartCenter, opts.area[0]); - } - context.stroke(); - } - //画Y轴标题 - if (opts.yAxis.showTitle) { - let titleFontSize = yData.titleFontSize * opts.pix || config.fontSize; - let title = yData.title; - context.beginPath(); - context.setFontSize(titleFontSize); - context.setFillStyle(yData.titleFontColor || opts.fontColor); - if (yAxisWidth.position == 'left') { - context.fillText(title, tStartLeft - measureText(title, titleFontSize, context) / 2 + (yData.titleOffsetX || 0), opts.area[0] - (10 - (yData.titleOffsetY || 0)) * opts.pix); - } else if (yAxisWidth.position == 'right') { - context.fillText(title, tStartRight - measureText(title, titleFontSize, context) / 2 + (yData.titleOffsetX || 0), opts.area[0] - (10 - (yData.titleOffsetY || 0)) * opts.pix); - } else if (yAxisWidth.position == 'center') { - context.fillText(title, tStartCenter - measureText(title, titleFontSize, context) / 2 + (yData.titleOffsetX || 0), opts.area[0] - (10 - (yData.titleOffsetY || 0)) * opts.pix); - } - context.closePath(); - context.stroke(); - } - if (yAxisWidth.position == 'left') { - tStartLeft -= (yAxisWidth.width + opts.yAxis.padding * opts.pix); - } else { - tStartRight += yAxisWidth.width + opts.yAxis.padding * opts.pix; - } - } - } - } - -} - -function drawLegend(series, opts, config, context, chartData) { - if (opts.legend.show === false) { - return; - } - let legendData = chartData.legendData; - let legendList = legendData.points; - let legendArea = legendData.area; - let padding = opts.legend.padding * opts.pix; - let fontSize = opts.legend.fontSize * opts.pix; - let shapeWidth = 15 * opts.pix; - let shapeRight = 5 * opts.pix; - let itemGap = opts.legend.itemGap * opts.pix; - let lineHeight = Math.max(opts.legend.lineHeight * opts.pix, fontSize); - //画背景及边框 - context.beginPath(); - context.setLineWidth(opts.legend.borderWidth * opts.pix); - context.setStrokeStyle(opts.legend.borderColor); - context.setFillStyle(opts.legend.backgroundColor); - context.moveTo(legendArea.start.x, legendArea.start.y); - context.rect(legendArea.start.x, legendArea.start.y, legendArea.width, legendArea.height); - context.closePath(); - context.fill(); - context.stroke(); - legendList.forEach(function(itemList, listIndex) { - let width = 0; - let height = 0; - width = legendData.widthArr[listIndex]; - height = legendData.heightArr[listIndex]; - let startX = 0; - let startY = 0; - if (opts.legend.position == 'top' || opts.legend.position == 'bottom') { - switch (opts.legend.float) { - case 'left': - startX = legendArea.start.x + padding; - break; - case 'right': - startX = legendArea.start.x + legendArea.width - width; - break; - default: - startX = legendArea.start.x + (legendArea.width - width) / 2; - } - startY = legendArea.start.y + padding + listIndex * lineHeight; - } else { - if (listIndex == 0) { - width = 0; - } else { - width = legendData.widthArr[listIndex - 1]; - } - startX = legendArea.start.x + padding + width; - startY = legendArea.start.y + padding + (legendArea.height - height) / 2; - } - context.setFontSize(config.fontSize); - for (let i = 0; i < itemList.length; i++) { - let item = itemList[i]; - item.area = [0, 0, 0, 0]; - item.area[0] = startX; - item.area[1] = startY; - item.area[3] = startY + lineHeight; - context.beginPath(); - context.setLineWidth(1 * opts.pix); - context.setStrokeStyle(item.show ? item.color : opts.legend.hiddenColor); - context.setFillStyle(item.show ? item.color : opts.legend.hiddenColor); - switch (item.legendShape) { - case 'line': - context.moveTo(startX, startY + 0.5 * lineHeight - 2 * opts.pix); - context.fillRect(startX, startY + 0.5 * lineHeight - 2 * opts.pix, 15 * opts.pix, 4 * opts.pix); - break; - case 'triangle': - context.moveTo(startX + 7.5 * opts.pix, startY + 0.5 * lineHeight - 5 * opts.pix); - context.lineTo(startX + 2.5 * opts.pix, startY + 0.5 * lineHeight + 5 * opts.pix); - context.lineTo(startX + 12.5 * opts.pix, startY + 0.5 * lineHeight + 5 * opts.pix); - context.lineTo(startX + 7.5 * opts.pix, startY + 0.5 * lineHeight - 5 * opts.pix); - break; - case 'diamond': - context.moveTo(startX + 7.5 * opts.pix, startY + 0.5 * lineHeight - 5 * opts.pix); - context.lineTo(startX + 2.5 * opts.pix, startY + 0.5 * lineHeight); - context.lineTo(startX + 7.5 * opts.pix, startY + 0.5 * lineHeight + 5 * opts.pix); - context.lineTo(startX + 12.5 * opts.pix, startY + 0.5 * lineHeight); - context.lineTo(startX + 7.5 * opts.pix, startY + 0.5 * lineHeight - 5 * opts.pix); - break; - case 'circle': - context.moveTo(startX + 7.5 * opts.pix, startY + 0.5 * lineHeight); - context.arc(startX + 7.5 * opts.pix, startY + 0.5 * lineHeight, 5 * opts.pix, 0, 2 * Math.PI); - break; - case 'rect': - context.moveTo(startX, startY + 0.5 * lineHeight - 5 * opts.pix); - context.fillRect(startX, startY + 0.5 * lineHeight - 5 * opts.pix, 15 * opts.pix, 10 * opts.pix); - break; - case 'square': - context.moveTo(startX + 5 * opts.pix, startY + 0.5 * lineHeight - 5 * opts.pix); - context.fillRect(startX + 5 * opts.pix, startY + 0.5 * lineHeight - 5 * opts.pix, 10 * opts.pix, 10 * opts.pix); - break; - case 'none': - break; - default: - context.moveTo(startX, startY + 0.5 * lineHeight - 5 * opts.pix); - context.fillRect(startX, startY + 0.5 * lineHeight - 5 * opts.pix, 15 * opts.pix, 10 * opts.pix); - } - context.closePath(); - context.fill(); - context.stroke(); - startX += shapeWidth + shapeRight; - let fontTrans = 0.5 * lineHeight + 0.5 * fontSize - 2; - const legendText = item.legendText ? item.legendText : item.name; - context.beginPath(); - context.setFontSize(fontSize); - context.setFillStyle(item.show ? opts.legend.fontColor : opts.legend.hiddenColor); - context.fillText(legendText, startX, startY + fontTrans); - context.closePath(); - context.stroke(); - if (opts.legend.position == 'top' || opts.legend.position == 'bottom') { - startX += measureText(legendText, fontSize, context) + itemGap; - item.area[2] = startX; - } else { - item.area[2] = startX + measureText(legendText, fontSize, context) + itemGap;; - startX -= shapeWidth + shapeRight; - startY += lineHeight; - } - } - }); -} - -function drawPieDataPoints(series, opts, config, context) { - var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1; - var pieOption = assign({}, { - activeOpacity: 0.5, - activeRadius: 10, - offsetAngle: 0, - labelWidth: 15, - ringWidth: 30, - customRadius: 0, - border: false, - borderWidth: 2, - borderColor: '#FFFFFF', - centerColor: '#FFFFFF', - linearType: 'none', - customColor: [], - }, opts.type == "pie" ? opts.extra.pie : opts.extra.ring); - var centerPosition = { - x: opts.area[3] + (opts.width - opts.area[1] - opts.area[3]) / 2, - y: opts.area[0] + (opts.height - opts.area[0] - opts.area[2]) / 2 - }; - if (config.pieChartLinePadding == 0) { - config.pieChartLinePadding = pieOption.activeRadius * opts.pix; - } - - var radius = Math.min((opts.width - opts.area[1] - opts.area[3]) / 2 - config.pieChartLinePadding - config.pieChartTextPadding - config._pieTextMaxLength_, (opts.height - opts.area[0] - opts.area[2]) / 2 - config.pieChartLinePadding - config.pieChartTextPadding); - radius = radius < 10 ? 10 : radius; - if (pieOption.customRadius > 0) { - radius = pieOption.customRadius * opts.pix; - } - series = getPieDataPoints(series, radius, process); - var activeRadius = pieOption.activeRadius * opts.pix; - pieOption.customColor = fillCustomColor(pieOption.linearType, pieOption.customColor, series, config); - series = series.map(function(eachSeries) { - eachSeries._start_ += (pieOption.offsetAngle) * Math.PI / 180; - return eachSeries; - }); - series.forEach(function(eachSeries, seriesIndex) { - if (opts.tooltip) { - if (opts.tooltip.index == seriesIndex) { - context.beginPath(); - context.setFillStyle(hexToRgb(eachSeries.color, pieOption.activeOpacity || 0.5)); - context.moveTo(centerPosition.x, centerPosition.y); - context.arc(centerPosition.x, centerPosition.y, eachSeries._radius_ + activeRadius, eachSeries._start_, eachSeries._start_ + 2 * eachSeries._proportion_ * Math.PI); - context.closePath(); - context.fill(); - } - } - context.beginPath(); - context.setLineWidth(pieOption.borderWidth * opts.pix); - context.lineJoin = "round"; - context.setStrokeStyle(pieOption.borderColor); - var fillcolor = eachSeries.color; - if (pieOption.linearType == 'custom') { - var grd; - if(context.createCircularGradient){ - grd = context.createCircularGradient(centerPosition.x, centerPosition.y, eachSeries._radius_) - }else{ - grd = context.createRadialGradient(centerPosition.x, centerPosition.y, 0,centerPosition.x, centerPosition.y, eachSeries._radius_) - } - grd.addColorStop(0, hexToRgb(pieOption.customColor[eachSeries.linearIndex], 1)) - grd.addColorStop(1, hexToRgb(eachSeries.color, 1)) - fillcolor = grd - } - context.setFillStyle(fillcolor); - context.moveTo(centerPosition.x, centerPosition.y); - context.arc(centerPosition.x, centerPosition.y, eachSeries._radius_, eachSeries._start_, eachSeries._start_ + 2 * eachSeries._proportion_ * Math.PI); - context.closePath(); - context.fill(); - if (pieOption.border == true) { - context.stroke(); - } - }); - if (opts.type === 'ring') { - var innerPieWidth = radius * 0.6; - if (typeof pieOption.ringWidth === 'number' && pieOption.ringWidth > 0) { - innerPieWidth = Math.max(0, radius - pieOption.ringWidth * opts.pix); - } - context.beginPath(); - context.setFillStyle(pieOption.centerColor); - context.moveTo(centerPosition.x, centerPosition.y); - context.arc(centerPosition.x, centerPosition.y, innerPieWidth, 0, 2 * Math.PI); - context.closePath(); - context.fill(); - } - if (opts.dataLabel !== false && process === 1) { - drawPieText(series, opts, config, context, radius, centerPosition); - } - if (process === 1 && opts.type === 'ring') { - drawRingTitle(opts, config, context, centerPosition); - } - return { - center: centerPosition, - radius: radius, - series: series - }; -} - -function drawRoseDataPoints(series, opts, config, context) { - var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1; - var roseOption = assign({}, { - type: 'area', - activeOpacity: 0.5, - activeRadius: 10, - offsetAngle: 0, - labelWidth: 15, - border: false, - borderWidth: 2, - borderColor: '#FFFFFF', - linearType: 'none', - customColor: [], - }, opts.extra.rose); - if (config.pieChartLinePadding == 0) { - config.pieChartLinePadding = roseOption.activeRadius * opts.pix; - } - var centerPosition = { - x: opts.area[3] + (opts.width - opts.area[1] - opts.area[3]) / 2, - y: opts.area[0] + (opts.height - opts.area[0] - opts.area[2]) / 2 - }; - var radius = Math.min((opts.width - opts.area[1] - opts.area[3]) / 2 - config.pieChartLinePadding - config.pieChartTextPadding - config._pieTextMaxLength_, (opts.height - opts.area[0] - opts.area[2]) / 2 - config.pieChartLinePadding - config.pieChartTextPadding); - radius = radius < 10 ? 10 : radius; - var minRadius = roseOption.minRadius || radius * 0.5; - if(radius < minRadius){ - radius = minRadius + 10; - } - series = getRoseDataPoints(series, roseOption.type, minRadius, radius, process); - var activeRadius = roseOption.activeRadius * opts.pix; - roseOption.customColor = fillCustomColor(roseOption.linearType, roseOption.customColor, series, config); - series = series.map(function(eachSeries) { - eachSeries._start_ += (roseOption.offsetAngle || 0) * Math.PI / 180; - return eachSeries; - }); - series.forEach(function(eachSeries, seriesIndex) { - if (opts.tooltip) { - if (opts.tooltip.index == seriesIndex) { - context.beginPath(); - context.setFillStyle(hexToRgb(eachSeries.color, roseOption.activeOpacity || 0.5)); - context.moveTo(centerPosition.x, centerPosition.y); - context.arc(centerPosition.x, centerPosition.y, activeRadius + eachSeries._radius_, eachSeries._start_, eachSeries._start_ + 2 * eachSeries._rose_proportion_ * Math.PI); - context.closePath(); - context.fill(); - } - } - context.beginPath(); - context.setLineWidth(roseOption.borderWidth * opts.pix); - context.lineJoin = "round"; - context.setStrokeStyle(roseOption.borderColor); - var fillcolor = eachSeries.color; - if (roseOption.linearType == 'custom') { - var grd; - if(context.createCircularGradient){ - grd = context.createCircularGradient(centerPosition.x, centerPosition.y, eachSeries._radius_) - }else{ - grd = context.createRadialGradient(centerPosition.x, centerPosition.y, 0,centerPosition.x, centerPosition.y, eachSeries._radius_) - } - grd.addColorStop(0, hexToRgb(roseOption.customColor[eachSeries.linearIndex], 1)) - grd.addColorStop(1, hexToRgb(eachSeries.color, 1)) - fillcolor = grd - } - context.setFillStyle(fillcolor); - context.moveTo(centerPosition.x, centerPosition.y); - context.arc(centerPosition.x, centerPosition.y, eachSeries._radius_, eachSeries._start_, eachSeries._start_ + 2 * eachSeries._rose_proportion_ * Math.PI); - context.closePath(); - context.fill(); - if (roseOption.border == true) { - context.stroke(); - } - }); - - if (opts.dataLabel !== false && process === 1) { - drawPieText(series, opts, config, context, radius, centerPosition); - } - return { - center: centerPosition, - radius: radius, - series: series - }; -} - -function drawArcbarDataPoints(series, opts, config, context) { - var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1; - var arcbarOption = assign({}, { - startAngle: 0.75, - endAngle: 0.25, - type: 'default', - direction: 'cw', - lineCap: 'round', - width: 12 , - gap: 2 , - linearType: 'none', - customColor: [], - }, opts.extra.arcbar); - series = getArcbarDataPoints(series, arcbarOption, process); - var centerPosition; - if (arcbarOption.centerX || arcbarOption.centerY) { - centerPosition = { - x: arcbarOption.centerX ? arcbarOption.centerX : opts.width / 2, - y: arcbarOption.centerY ? arcbarOption.centerY : opts.height / 2 - }; - } else { - centerPosition = { - x: opts.width / 2, - y: opts.height / 2 - }; - } - var radius; - if (arcbarOption.radius) { - radius = arcbarOption.radius; - } else { - radius = Math.min(centerPosition.x, centerPosition.y); - radius -= 5 * opts.pix; - radius -= arcbarOption.width / 2; - } - radius = radius < 10 ? 10 : radius; - arcbarOption.customColor = fillCustomColor(arcbarOption.linearType, arcbarOption.customColor, series, config); - - for (let i = 0; i < series.length; i++) { - let eachSeries = series[i]; - //背景颜色 - context.setLineWidth(arcbarOption.width * opts.pix); - context.setStrokeStyle(arcbarOption.backgroundColor || '#E9E9E9'); - context.setLineCap(arcbarOption.lineCap); - context.beginPath(); - if (arcbarOption.type == 'default') { - context.arc(centerPosition.x, centerPosition.y, radius - (arcbarOption.width * opts.pix + arcbarOption.gap * opts.pix) * i, arcbarOption.startAngle * Math.PI, arcbarOption.endAngle * Math.PI, arcbarOption.direction == 'ccw'); - } else { - context.arc(centerPosition.x, centerPosition.y, radius - (arcbarOption.width * opts.pix + arcbarOption.gap * opts.pix) * i, 0, 2 * Math.PI, arcbarOption.direction == 'ccw'); - } - context.stroke(); - //进度条 - var fillColor = eachSeries.color - if(arcbarOption.linearType == 'custom'){ - var grd = context.createLinearGradient(centerPosition.x - radius, centerPosition.y, centerPosition.x + radius, centerPosition.y); - grd.addColorStop(1, hexToRgb(arcbarOption.customColor[eachSeries.linearIndex], 1)) - grd.addColorStop(0, hexToRgb(eachSeries.color, 1)) - fillColor = grd; - } - context.setLineWidth(arcbarOption.width * opts.pix); - context.setStrokeStyle(fillColor); - context.setLineCap(arcbarOption.lineCap); - context.beginPath(); - context.arc(centerPosition.x, centerPosition.y, radius - (arcbarOption.width * opts.pix + arcbarOption.gap * opts.pix) * i, arcbarOption.startAngle * Math.PI, eachSeries._proportion_ * Math.PI, arcbarOption.direction == 'ccw'); - context.stroke(); - } - drawRingTitle(opts, config, context, centerPosition); - return { - center: centerPosition, - radius: radius, - series: series - }; -} - -function drawGaugeDataPoints(categories, series, opts, config, context) { - var process = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 1; - var gaugeOption = assign({}, { - type: 'default', - startAngle: 0.75, - endAngle: 0.25, - width: 15, - labelOffset:13, - splitLine: { - fixRadius: 0, - splitNumber: 10, - width: 15, - color: '#FFFFFF', - childNumber: 5, - childWidth: 5 - }, - pointer: { - width: 15, - color: 'auto' - } - }, opts.extra.gauge); - if (gaugeOption.oldAngle == undefined) { - gaugeOption.oldAngle = gaugeOption.startAngle; - } - if (gaugeOption.oldData == undefined) { - gaugeOption.oldData = 0; - } - categories = getGaugeAxisPoints(categories, gaugeOption.startAngle, gaugeOption.endAngle); - var centerPosition = { - x: opts.width / 2, - y: opts.height / 2 - }; - var radius = Math.min(centerPosition.x, centerPosition.y); - radius -= 5 * opts.pix; - radius -= gaugeOption.width / 2; - radius = radius < 10 ? 10 : radius; - var innerRadius = radius - gaugeOption.width; - var totalAngle = 0; - //判断仪表盘的样式:default百度样式,progress新样式 - if (gaugeOption.type == 'progress') { - //## 第一步画中心圆形背景和进度条背景 - //中心圆形背景 - var pieRadius = radius - gaugeOption.width * 3; - context.beginPath(); - let gradient = context.createLinearGradient(centerPosition.x, centerPosition.y - pieRadius, centerPosition.x, centerPosition.y + pieRadius); - //配置渐变填充(起点:中心点向上减半径;结束点中心点向下加半径) - gradient.addColorStop('0', hexToRgb(series[0].color, 0.3)); - gradient.addColorStop('1.0', hexToRgb("#FFFFFF", 0.1)); - context.setFillStyle(gradient); - context.arc(centerPosition.x, centerPosition.y, pieRadius, 0, 2 * Math.PI, false); - context.fill(); - //画进度条背景 - context.setLineWidth(gaugeOption.width); - context.setStrokeStyle(hexToRgb(series[0].color, 0.3)); - context.setLineCap('round'); - context.beginPath(); - context.arc(centerPosition.x, centerPosition.y, innerRadius, gaugeOption.startAngle * Math.PI, gaugeOption.endAngle * Math.PI, false); - context.stroke(); - //## 第二步画刻度线 - if (gaugeOption.endAngle < gaugeOption.startAngle) { - totalAngle = 2 + gaugeOption.endAngle - gaugeOption.startAngle; - } else { - totalAngle = gaugeOption.startAngle - gaugeOption.endAngle; - } - let splitAngle = totalAngle / gaugeOption.splitLine.splitNumber; - let childAngle = totalAngle / gaugeOption.splitLine.splitNumber / gaugeOption.splitLine.childNumber; - let startX = -radius - gaugeOption.width * 0.5 - gaugeOption.splitLine.fixRadius; - let endX = -radius - gaugeOption.width - gaugeOption.splitLine.fixRadius + gaugeOption.splitLine.width; - context.save(); - context.translate(centerPosition.x, centerPosition.y); - context.rotate((gaugeOption.startAngle - 1) * Math.PI); - let len = gaugeOption.splitLine.splitNumber * gaugeOption.splitLine.childNumber + 1; - let proc = series[0].data * process; - for (let i = 0; i < len; i++) { - context.beginPath(); - //刻度线随进度变色 - if (proc > (i / len)) { - context.setStrokeStyle(hexToRgb(series[0].color, 1)); - } else { - context.setStrokeStyle(hexToRgb(series[0].color, 0.3)); - } - context.setLineWidth(3 * opts.pix); - context.moveTo(startX, 0); - context.lineTo(endX, 0); - context.stroke(); - context.rotate(childAngle * Math.PI); - } - context.restore(); - //## 第三步画进度条 - series = getGaugeArcbarDataPoints(series, gaugeOption, process); - context.setLineWidth(gaugeOption.width); - context.setStrokeStyle(series[0].color); - context.setLineCap('round'); - context.beginPath(); - context.arc(centerPosition.x, centerPosition.y, innerRadius, gaugeOption.startAngle * Math.PI, series[0]._proportion_ * Math.PI, false); - context.stroke(); - //## 第四步画指针 - let pointerRadius = radius - gaugeOption.width * 2.5; - context.save(); - context.translate(centerPosition.x, centerPosition.y); - context.rotate((series[0]._proportion_ - 1) * Math.PI); - context.beginPath(); - context.setLineWidth(gaugeOption.width / 3); - let gradient3 = context.createLinearGradient(0, -pointerRadius * 0.6, 0, pointerRadius * 0.6); - gradient3.addColorStop('0', hexToRgb('#FFFFFF', 0)); - gradient3.addColorStop('0.5', hexToRgb(series[0].color, 1)); - gradient3.addColorStop('1.0', hexToRgb('#FFFFFF', 0)); - context.setStrokeStyle(gradient3); - context.arc(0, 0, pointerRadius, 0.85 * Math.PI, 1.15 * Math.PI, false); - context.stroke(); - context.beginPath(); - context.setLineWidth(1); - context.setStrokeStyle(series[0].color); - context.setFillStyle(series[0].color); - context.moveTo(-pointerRadius - gaugeOption.width / 3 / 2, -4); - context.lineTo(-pointerRadius - gaugeOption.width / 3 / 2 - 4, 0); - context.lineTo(-pointerRadius - gaugeOption.width / 3 / 2, 4); - context.lineTo(-pointerRadius - gaugeOption.width / 3 / 2, -4); - context.stroke(); - context.fill(); - context.restore(); - //default百度样式 - } else { - //画背景 - context.setLineWidth(gaugeOption.width); - context.setLineCap('butt'); - for (let i = 0; i < categories.length; i++) { - let eachCategories = categories[i]; - context.beginPath(); - context.setStrokeStyle(eachCategories.color); - context.arc(centerPosition.x, centerPosition.y, radius, eachCategories._startAngle_ * Math.PI, eachCategories._endAngle_ * Math.PI, false); - context.stroke(); - } - context.save(); - //画刻度线 - if (gaugeOption.endAngle < gaugeOption.startAngle) { - totalAngle = 2 + gaugeOption.endAngle - gaugeOption.startAngle; - } else { - totalAngle = gaugeOption.startAngle - gaugeOption.endAngle; - } - let splitAngle = totalAngle / gaugeOption.splitLine.splitNumber; - let childAngle = totalAngle / gaugeOption.splitLine.splitNumber / gaugeOption.splitLine.childNumber; - let startX = -radius - gaugeOption.width * 0.5 - gaugeOption.splitLine.fixRadius; - let endX = -radius - gaugeOption.width * 0.5 - gaugeOption.splitLine.fixRadius + gaugeOption.splitLine.width; - let childendX = -radius - gaugeOption.width * 0.5 - gaugeOption.splitLine.fixRadius + gaugeOption.splitLine.childWidth; - context.translate(centerPosition.x, centerPosition.y); - context.rotate((gaugeOption.startAngle - 1) * Math.PI); - for (let i = 0; i < gaugeOption.splitLine.splitNumber + 1; i++) { - context.beginPath(); - context.setStrokeStyle(gaugeOption.splitLine.color); - context.setLineWidth(2 * opts.pix); - context.moveTo(startX, 0); - context.lineTo(endX, 0); - context.stroke(); - context.rotate(splitAngle * Math.PI); - } - context.restore(); - context.save(); - context.translate(centerPosition.x, centerPosition.y); - context.rotate((gaugeOption.startAngle - 1) * Math.PI); - for (let i = 0; i < gaugeOption.splitLine.splitNumber * gaugeOption.splitLine.childNumber + 1; i++) { - context.beginPath(); - context.setStrokeStyle(gaugeOption.splitLine.color); - context.setLineWidth(1 * opts.pix); - context.moveTo(startX, 0); - context.lineTo(childendX, 0); - context.stroke(); - context.rotate(childAngle * Math.PI); - } - context.restore(); - //画指针 - series = getGaugeDataPoints(series, categories, gaugeOption, process); - for (let i = 0; i < series.length; i++) { - let eachSeries = series[i]; - context.save(); - context.translate(centerPosition.x, centerPosition.y); - context.rotate((eachSeries._proportion_ - 1) * Math.PI); - context.beginPath(); - context.setFillStyle(eachSeries.color); - context.moveTo(gaugeOption.pointer.width, 0); - context.lineTo(0, -gaugeOption.pointer.width / 2); - context.lineTo(-innerRadius, 0); - context.lineTo(0, gaugeOption.pointer.width / 2); - context.lineTo(gaugeOption.pointer.width, 0); - context.closePath(); - context.fill(); - context.beginPath(); - context.setFillStyle('#FFFFFF'); - context.arc(0, 0, gaugeOption.pointer.width / 6, 0, 2 * Math.PI, false); - context.fill(); - context.restore(); - } - if (opts.dataLabel !== false) { - drawGaugeLabel(gaugeOption, radius, centerPosition, opts, config, context); - } - } - //画仪表盘标题,副标题 - drawRingTitle(opts, config, context, centerPosition); - if (process === 1 && opts.type === 'gauge') { - opts.extra.gauge.oldAngle = series[0]._proportion_; - opts.extra.gauge.oldData = series[0].data; - } - return { - center: centerPosition, - radius: radius, - innerRadius: innerRadius, - categories: categories, - totalAngle: totalAngle - }; -} - -function drawRadarDataPoints(series, opts, config, context) { - var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1; - var radarOption = assign({}, { - gridColor: '#cccccc', - gridType: 'radar', - gridEval:1, - axisLabel:false, - axisLabelTofix:0, - labelShow:true, - labelColor:'#666666', - labelPointShow:false, - labelPointRadius:3, - labelPointColor:'#cccccc', - opacity: 0.2, - gridCount: 3, - border:false, - borderWidth:2, - linearType: 'none', - customColor: [], - }, opts.extra.radar); - var coordinateAngle = getRadarCoordinateSeries(opts.categories.length); - var centerPosition = { - x: opts.area[3] + (opts.width - opts.area[1] - opts.area[3]) / 2, - y: opts.area[0] + (opts.height - opts.area[0] - opts.area[2]) / 2 - }; - var xr = (opts.width - opts.area[1] - opts.area[3]) / 2 - var yr = (opts.height - opts.area[0] - opts.area[2]) / 2 - var radius = Math.min(xr - (getMaxTextListLength(opts.categories, config.fontSize, context) + config.radarLabelTextMargin), yr - config.radarLabelTextMargin); - radius -= config.radarLabelTextMargin * opts.pix; - radius = radius < 10 ? 10 : radius; - radius = radarOption.radius ? radarOption.radius : radius; - // 画分割线 - context.beginPath(); - context.setLineWidth(1 * opts.pix); - context.setStrokeStyle(radarOption.gridColor); - coordinateAngle.forEach(function(angle,index) { - var pos = convertCoordinateOrigin(radius * Math.cos(angle), radius * Math.sin(angle), centerPosition); - context.moveTo(centerPosition.x, centerPosition.y); - if (index % radarOption.gridEval == 0) { - context.lineTo(pos.x, pos.y); - } - }); - context.stroke(); - context.closePath(); - - // 画背景网格 - var _loop = function _loop(i) { - var startPos = {}; - context.beginPath(); - context.setLineWidth(1 * opts.pix); - context.setStrokeStyle(radarOption.gridColor); - if (radarOption.gridType == 'radar') { - coordinateAngle.forEach(function(angle, index) { - var pos = convertCoordinateOrigin(radius / radarOption.gridCount * i * Math.cos(angle), radius / - radarOption.gridCount * i * Math.sin(angle), centerPosition); - if (index === 0) { - startPos = pos; - context.moveTo(pos.x, pos.y); - } else { - context.lineTo(pos.x, pos.y); - } - }); - context.lineTo(startPos.x, startPos.y); - } else { - var pos = convertCoordinateOrigin(radius / radarOption.gridCount * i * Math.cos(1.5), radius / radarOption.gridCount * i * Math.sin(1.5), centerPosition); - context.arc(centerPosition.x, centerPosition.y, centerPosition.y - pos.y, 0, 2 * Math.PI, false); - } - context.stroke(); - context.closePath(); - }; - for (var i = 1; i <= radarOption.gridCount; i++) { - _loop(i); - } - radarOption.customColor = fillCustomColor(radarOption.linearType, radarOption.customColor, series, config); - var radarDataPoints = getRadarDataPoints(coordinateAngle, centerPosition, radius, series, opts, process); - radarDataPoints.forEach(function(eachSeries, seriesIndex) { - // 绘制区域数据 - context.beginPath(); - context.setLineWidth(radarOption.borderWidth * opts.pix); - context.setStrokeStyle(eachSeries.color); - - var fillcolor = hexToRgb(eachSeries.color, radarOption.opacity); - if (radarOption.linearType == 'custom') { - var grd; - if(context.createCircularGradient){ - grd = context.createCircularGradient(centerPosition.x, centerPosition.y, radius) - }else{ - grd = context.createRadialGradient(centerPosition.x, centerPosition.y, 0,centerPosition.x, centerPosition.y, radius) - } - grd.addColorStop(0, hexToRgb(radarOption.customColor[series[seriesIndex].linearIndex], radarOption.opacity)) - grd.addColorStop(1, hexToRgb(eachSeries.color, radarOption.opacity)) - fillcolor = grd - } - - context.setFillStyle(fillcolor); - eachSeries.data.forEach(function(item, index) { - if (index === 0) { - context.moveTo(item.position.x, item.position.y); - } else { - context.lineTo(item.position.x, item.position.y); - } - }); - context.closePath(); - context.fill(); - if(radarOption.border === true){ - context.stroke(); - } - context.closePath(); - if (opts.dataPointShape !== false) { - var points = eachSeries.data.map(function(item) { - return item.position; - }); - drawPointShape(points, eachSeries.color, eachSeries.pointShape, context, opts); - } - }); - // 画刻度值 - if(radarOption.axisLabel === true){ - const maxData = Math.max(radarOption.max, Math.max.apply(null, dataCombine(series))); - const stepLength = radius / radarOption.gridCount; - const fontSize = opts.fontSize * opts.pix; - context.setFontSize(fontSize); - context.setFillStyle(opts.fontColor); - context.setTextAlign('left'); - for (var i = 0; i < radarOption.gridCount + 1; i++) { - let label = i * maxData / radarOption.gridCount; - label = label.toFixed(radarOption.axisLabelTofix); - context.fillText(String(label), centerPosition.x + 3 * opts.pix, centerPosition.y - i * stepLength + fontSize / 2); - } - } - - // draw label text - drawRadarLabel(coordinateAngle, radius, centerPosition, opts, config, context); - - // draw dataLabel - if (opts.dataLabel !== false && process === 1) { - radarDataPoints.forEach(function(eachSeries, seriesIndex) { - context.beginPath(); - var fontSize = eachSeries.textSize * opts.pix || config.fontSize; - context.setFontSize(fontSize); - context.setFillStyle(eachSeries.textColor || opts.fontColor); - eachSeries.data.forEach(function(item, index) { - //如果是中心点垂直的上下点位 - if(Math.abs(item.position.x - centerPosition.x)<2){ - //如果在上面 - if(item.position.y < centerPosition.y){ - context.setTextAlign('center'); - context.fillText(item.value, item.position.x, item.position.y - 4); - }else{ - context.setTextAlign('center'); - context.fillText(item.value, item.position.x, item.position.y + fontSize + 2); - } - }else{ - //如果在左侧 - if(item.position.x < centerPosition.x){ - context.setTextAlign('right'); - context.fillText(item.value, item.position.x - 4, item.position.y + fontSize / 2 - 2); - }else{ - context.setTextAlign('left'); - context.fillText(item.value, item.position.x + 4, item.position.y + fontSize / 2 - 2); - } - } - }); - context.closePath(); - context.stroke(); - }); - context.setTextAlign('left'); - } - - return { - center: centerPosition, - radius: radius, - angleList: coordinateAngle - }; -} - -// 经纬度转墨卡托 -function lonlat2mercator(longitude, latitude) { - var mercator = Array(2); - var x = longitude * 20037508.34 / 180; - var y = Math.log(Math.tan((90 + latitude) * Math.PI / 360)) / (Math.PI / 180); - y = y * 20037508.34 / 180; - mercator[0] = x; - mercator[1] = y; - return mercator; -} - -// 墨卡托转经纬度 -function mercator2lonlat(longitude, latitude) { - var lonlat = Array(2) - var x = longitude / 20037508.34 * 180; - var y = latitude / 20037508.34 * 180; - y = 180 / Math.PI * (2 * Math.atan(Math.exp(y * Math.PI / 180)) - Math.PI / 2); - lonlat[0] = x; - lonlat[1] = y; - return lonlat; -} - -function getBoundingBox(data) { - var bounds = {},coords; - bounds.xMin = 180; - bounds.xMax = 0; - bounds.yMin = 90; - bounds.yMax = 0 - for (var i = 0; i < data.length; i++) { - var coorda = data[i].geometry.coordinates - for (var k = 0; k < coorda.length; k++) { - coords = coorda[k]; - if (coords.length == 1) { - coords = coords[0] - } - for (var j = 0; j < coords.length; j++) { - var longitude = coords[j][0]; - var latitude = coords[j][1]; - var point = { - x: longitude, - y: latitude - } - bounds.xMin = bounds.xMin < point.x ? bounds.xMin : point.x; - bounds.xMax = bounds.xMax > point.x ? bounds.xMax : point.x; - bounds.yMin = bounds.yMin < point.y ? bounds.yMin : point.y; - bounds.yMax = bounds.yMax > point.y ? bounds.yMax : point.y; - } - } - } - return bounds; -} - -function coordinateToPoint(latitude, longitude, bounds, scale, xoffset, yoffset) { - return { - x: (longitude - bounds.xMin) * scale + xoffset, - y: (bounds.yMax - latitude) * scale + yoffset - }; -} - -function pointToCoordinate(pointY, pointX, bounds, scale, xoffset, yoffset) { - return { - x: (pointX - xoffset) / scale + bounds.xMin, - y: bounds.yMax - (pointY - yoffset) / scale - }; -} - -function isRayIntersectsSegment(poi, s_poi, e_poi) { - if (s_poi[1] == e_poi[1]) { - return false; - } - if (s_poi[1] > poi[1] && e_poi[1] > poi[1]) { - return false; - } - if (s_poi[1] < poi[1] && e_poi[1] < poi[1]) { - return false; - } - if (s_poi[1] == poi[1] && e_poi[1] > poi[1]) { - return false; - } - if (e_poi[1] == poi[1] && s_poi[1] > poi[1]) { - return false; - } - if (s_poi[0] < poi[0] && e_poi[1] < poi[1]) { - return false; - } - let xseg = e_poi[0] - (e_poi[0] - s_poi[0]) * (e_poi[1] - poi[1]) / (e_poi[1] - s_poi[1]); - if (xseg < poi[0]) { - return false; - } else { - return true; - } -} - -function isPoiWithinPoly(poi, poly, mercator) { - let sinsc = 0; - for (let i = 0; i < poly.length; i++) { - let epoly = poly[i][0]; - if (poly.length == 1) { - epoly = poly[i][0] - } - for (let j = 0; j < epoly.length - 1; j++) { - let s_poi = epoly[j]; - let e_poi = epoly[j + 1]; - if (mercator) { - s_poi = lonlat2mercator(epoly[j][0], epoly[j][1]); - e_poi = lonlat2mercator(epoly[j + 1][0], epoly[j + 1][1]); - } - if (isRayIntersectsSegment(poi, s_poi, e_poi)) { - sinsc += 1; - } - } - } - if (sinsc % 2 == 1) { - return true; - } else { - return false; - } -} - -function drawMapDataPoints(series, opts, config, context) { - var mapOption = assign({}, { - border: true, - mercator: false, - borderWidth: 1, - active:true, - borderColor: '#666666', - fillOpacity: 0.6, - activeBorderColor: '#f04864', - activeFillColor: '#facc14', - activeFillOpacity: 1 - }, opts.extra.map); - var coords, point; - var data = series; - var bounds = getBoundingBox(data); - if (mapOption.mercator) { - var max = lonlat2mercator(bounds.xMax, bounds.yMax) - var min = lonlat2mercator(bounds.xMin, bounds.yMin) - bounds.xMax = max[0] - bounds.yMax = max[1] - bounds.xMin = min[0] - bounds.yMin = min[1] - } - var xScale = opts.width / Math.abs(bounds.xMax - bounds.xMin); - var yScale = opts.height / Math.abs(bounds.yMax - bounds.yMin); - var scale = xScale < yScale ? xScale : yScale; - var xoffset = opts.width / 2 - Math.abs(bounds.xMax - bounds.xMin) / 2 * scale; - var yoffset = opts.height / 2 - Math.abs(bounds.yMax - bounds.yMin) / 2 * scale; - for (var i = 0; i < data.length; i++) { - context.beginPath(); - context.setLineWidth(mapOption.borderWidth * opts.pix); - context.setStrokeStyle(mapOption.borderColor); - context.setFillStyle(hexToRgb(series[i].color, series[i].fillOpacity||mapOption.fillOpacity)); - if (mapOption.active == true && opts.tooltip) { - if (opts.tooltip.index == i) { - context.setStrokeStyle(mapOption.activeBorderColor); - context.setFillStyle(hexToRgb(mapOption.activeFillColor, mapOption.activeFillOpacity)); - } - } - var coorda = data[i].geometry.coordinates - for (var k = 0; k < coorda.length; k++) { - coords = coorda[k]; - if (coords.length == 1) { - coords = coords[0] - } - for (var j = 0; j < coords.length; j++) { - var gaosi = Array(2); - if (mapOption.mercator) { - gaosi = lonlat2mercator(coords[j][0], coords[j][1]) - } else { - gaosi = coords[j] - } - point = coordinateToPoint(gaosi[1], gaosi[0], bounds, scale, xoffset, yoffset) - if (j === 0) { - context.beginPath(); - context.moveTo(point.x, point.y); - } else { - context.lineTo(point.x, point.y); - } - } - context.fill(); - if (mapOption.border == true) { - context.stroke(); - } - } - } - if (opts.dataLabel == true) { - for (var i = 0; i < data.length; i++) { - var centerPoint = data[i].properties.centroid; - if (centerPoint) { - if (mapOption.mercator) { - centerPoint = lonlat2mercator(data[i].properties.centroid[0], data[i].properties.centroid[1]) - } - point = coordinateToPoint(centerPoint[1], centerPoint[0], bounds, scale, xoffset, yoffset); - let fontSize = data[i].textSize * opts.pix || config.fontSize; - let fontColor = data[i].textColor || opts.fontColor; - if(mapOption.active && mapOption.activeTextColor && opts.tooltip && opts.tooltip.index == i){ - fontColor = mapOption.activeTextColor; - } - let text = data[i].properties.name; - context.beginPath(); - context.setFontSize(fontSize) - context.setFillStyle(fontColor) - context.fillText(text, point.x - measureText(text, fontSize, context) / 2, point.y + fontSize / 2); - context.closePath(); - context.stroke(); - } - } - } - opts.chartData.mapData = { - bounds: bounds, - scale: scale, - xoffset: xoffset, - yoffset: yoffset, - mercator: mapOption.mercator - } - drawToolTipBridge(opts, config, context, 1); - context.draw(); -} - -function normalInt(min, max, iter) { - iter = iter == 0 ? 1 : iter; - var arr = []; - for (var i = 0; i < iter; i++) { - arr[i] = Math.random(); - }; - return Math.floor(arr.reduce(function(i, j) { - return i + j - }) / iter * (max - min)) + min; -}; - -function collisionNew(area, points, width, height) { - var isIn = false; - for (let i = 0; i < points.length; i++) { - if (points[i].area) { - if (area[3] < points[i].area[1] || area[0] > points[i].area[2] || area[1] > points[i].area[3] || area[2] < points[i].area[0]) { - if (area[0] < 0 || area[1] < 0 || area[2] > width || area[3] > height) { - isIn = true; - break; - } else { - isIn = false; - } - } else { - isIn = true; - break; - } - } - } - return isIn; -}; - -function getWordCloudPoint(opts, type, context) { - let points = opts.series; - switch (type) { - case 'normal': - for (let i = 0; i < points.length; i++) { - let text = points[i].name; - let tHeight = points[i].textSize * opts.pix; - let tWidth = measureText(text, tHeight, context); - let x, y; - let area; - let breaknum = 0; - while (true) { - breaknum++; - x = normalInt(-opts.width / 2, opts.width / 2, 5) - tWidth / 2; - y = normalInt(-opts.height / 2, opts.height / 2, 5) + tHeight / 2; - area = [x - 5 + opts.width / 2, y - 5 - tHeight + opts.height / 2, x + tWidth + 5 + opts.width / 2, y + 5 + - opts.height / 2 - ]; - let isCollision = collisionNew(area, points, opts.width, opts.height); - if (!isCollision) break; - if (breaknum == 1000) { - area = [-100, -100, -100, -100]; - break; - } - }; - points[i].area = area; - } - break; - case 'vertical': - function Spin() { - //获取均匀随机值,是否旋转,旋转的概率为(1-0.5) - if (Math.random() > 0.7) { - return true; - } else { - return false - }; - }; - for (let i = 0; i < points.length; i++) { - let text = points[i].name; - let tHeight = points[i].textSize * opts.pix; - let tWidth = measureText(text, tHeight, context); - let isSpin = Spin(); - let x, y, area, areav; - let breaknum = 0; - while (true) { - breaknum++; - let isCollision; - if (isSpin) { - x = normalInt(-opts.width / 2, opts.width / 2, 5) - tWidth / 2; - y = normalInt(-opts.height / 2, opts.height / 2, 5) + tHeight / 2; - area = [y - 5 - tWidth + opts.width / 2, (-x - 5 + opts.height / 2), y + 5 + opts.width / 2, (-x + tHeight + 5 + opts.height / 2)]; - areav = [opts.width - (opts.width / 2 - opts.height / 2) - (-x + tHeight + 5 + opts.height / 2) - 5, (opts.height / 2 - opts.width / 2) + (y - 5 - tWidth + opts.width / 2) - 5, opts.width - (opts.width / 2 - opts.height / 2) - (-x + tHeight + 5 + opts.height / 2) + tHeight, (opts.height / 2 - opts.width / 2) + (y - 5 - tWidth + opts.width / 2) + tWidth + 5]; - isCollision = collisionNew(areav, points, opts.height, opts.width); - } else { - x = normalInt(-opts.width / 2, opts.width / 2, 5) - tWidth / 2; - y = normalInt(-opts.height / 2, opts.height / 2, 5) + tHeight / 2; - area = [x - 5 + opts.width / 2, y - 5 - tHeight + opts.height / 2, x + tWidth + 5 + opts.width / 2, y + 5 + opts.height / 2]; - isCollision = collisionNew(area, points, opts.width, opts.height); - } - if (!isCollision) break; - if (breaknum == 1000) { - area = [-1000, -1000, -1000, -1000]; - break; - } - }; - if (isSpin) { - points[i].area = areav; - points[i].areav = area; - } else { - points[i].area = area; - } - points[i].rotate = isSpin; - }; - break; - } - return points; -} - -function drawWordCloudDataPoints(series, opts, config, context) { - let process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1; - let wordOption = assign({}, { - type: 'normal', - autoColors: true - }, opts.extra.word); - if (!opts.chartData.wordCloudData) { - opts.chartData.wordCloudData = getWordCloudPoint(opts, wordOption.type, context); - } - context.beginPath(); - context.setFillStyle(opts.background); - context.rect(0, 0, opts.width, opts.height); - context.fill(); - context.save(); - let points = opts.chartData.wordCloudData; - context.translate(opts.width / 2, opts.height / 2); - for (let i = 0; i < points.length; i++) { - context.save(); - if (points[i].rotate) { - context.rotate(90 * Math.PI / 180); - } - let text = points[i].name; - let tHeight = points[i].textSize * opts.pix; - let tWidth = measureText(text, tHeight, context); - context.beginPath(); - context.setStrokeStyle(points[i].color); - context.setFillStyle(points[i].color); - context.setFontSize(tHeight); - if (points[i].rotate) { - if (points[i].areav[0] > 0) { - if (opts.tooltip) { - if (opts.tooltip.index == i) { - context.strokeText(text, (points[i].areav[0] + 5 - opts.width / 2) * process - tWidth * (1 - process) / 2, (points[i].areav[1] + 5 + tHeight - opts.height / 2) * process); - } else { - context.fillText(text, (points[i].areav[0] + 5 - opts.width / 2) * process - tWidth * (1 - process) / 2, (points[i].areav[1] + 5 + tHeight - opts.height / 2) * process); - } - } else { - context.fillText(text, (points[i].areav[0] + 5 - opts.width / 2) * process - tWidth * (1 - process) / 2, (points[i].areav[1] + 5 + tHeight - opts.height / 2) * process); - } - } - } else { - if (points[i].area[0] > 0) { - if (opts.tooltip) { - if (opts.tooltip.index == i) { - context.strokeText(text, (points[i].area[0] + 5 - opts.width / 2) * process - tWidth * (1 - process) / 2, (points[i].area[1] + 5 + tHeight - opts.height / 2) * process); - } else { - context.fillText(text, (points[i].area[0] + 5 - opts.width / 2) * process - tWidth * (1 - process) / 2, (points[i].area[1] + 5 + tHeight - opts.height / 2) * process); - } - } else { - context.fillText(text, (points[i].area[0] + 5 - opts.width / 2) * process - tWidth * (1 - process) / 2, (points[i].area[1] + 5 + tHeight - opts.height / 2) * process); - } - } - } - context.stroke(); - context.restore(); - } - context.restore(); -} - -function drawFunnelDataPoints(series, opts, config, context) { - let process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1; - let funnelOption = assign({}, { - type:'funnel', - activeWidth: 10, - activeOpacity: 0.3, - border: false, - borderWidth: 2, - borderColor: '#FFFFFF', - fillOpacity: 1, - minSize: 0, - labelAlign: 'right', - linearType: 'none', - customColor: [], - }, opts.extra.funnel); - let eachSpacing = (opts.height - opts.area[0] - opts.area[2]) / series.length; - let centerPosition = { - x: opts.area[3] + (opts.width - opts.area[1] - opts.area[3]) / 2, - y: opts.height - opts.area[2] - }; - let activeWidth = funnelOption.activeWidth * opts.pix; - let radius = Math.min((opts.width - opts.area[1] - opts.area[3]) / 2 - activeWidth, (opts.height - opts.area[0] - opts.area[2]) / 2 - activeWidth); - let seriesNew = getFunnelDataPoints(series, radius, funnelOption, eachSpacing, process); - context.save(); - context.translate(centerPosition.x, centerPosition.y); - funnelOption.customColor = fillCustomColor(funnelOption.linearType, funnelOption.customColor, series, config); - if(funnelOption.type == 'pyramid'){ - for (let i = 0; i < seriesNew.length; i++) { - if (i == seriesNew.length -1) { - if (opts.tooltip) { - if (opts.tooltip.index == i) { - context.beginPath(); - context.setFillStyle(hexToRgb(seriesNew[i].color, funnelOption.activeOpacity)); - context.moveTo(-activeWidth, -eachSpacing); - context.lineTo(-seriesNew[i].radius - activeWidth, 0); - context.lineTo(seriesNew[i].radius + activeWidth, 0); - context.lineTo(activeWidth, -eachSpacing); - context.lineTo(-activeWidth, -eachSpacing); - context.closePath(); - context.fill(); - } - } - seriesNew[i].funnelArea = [centerPosition.x - seriesNew[i].radius, centerPosition.y - eachSpacing * (i + 1), centerPosition.x + seriesNew[i].radius, centerPosition.y - eachSpacing * i]; - context.beginPath(); - context.setLineWidth(funnelOption.borderWidth * opts.pix); - context.setStrokeStyle(funnelOption.borderColor); - var fillColor = hexToRgb(seriesNew[i].color, funnelOption.fillOpacity); - if (funnelOption.linearType == 'custom') { - var grd = context.createLinearGradient(seriesNew[i].radius, -eachSpacing, -seriesNew[i].radius, -eachSpacing); - grd.addColorStop(0, hexToRgb(seriesNew[i].color, funnelOption.fillOpacity)); - grd.addColorStop(0.5, hexToRgb(funnelOption.customColor[seriesNew[i].linearIndex], funnelOption.fillOpacity)); - grd.addColorStop(1, hexToRgb(seriesNew[i].color, funnelOption.fillOpacity)); - fillColor = grd - } - context.setFillStyle(fillColor); - context.moveTo(0, -eachSpacing); - context.lineTo(-seriesNew[i].radius, 0); - context.lineTo(seriesNew[i].radius, 0); - context.lineTo(0, -eachSpacing); - context.closePath(); - context.fill(); - if (funnelOption.border == true) { - context.stroke(); - } - } else { - if (opts.tooltip) { - if (opts.tooltip.index == i) { - context.beginPath(); - context.setFillStyle(hexToRgb(seriesNew[i].color, funnelOption.activeOpacity)); - context.moveTo(0, 0); - context.lineTo(-seriesNew[i].radius - activeWidth, 0); - context.lineTo(-seriesNew[i + 1].radius - activeWidth, -eachSpacing); - context.lineTo(seriesNew[i + 1].radius + activeWidth, -eachSpacing); - context.lineTo(seriesNew[i].radius + activeWidth, 0); - context.lineTo(0, 0); - context.closePath(); - context.fill(); - } - } - seriesNew[i].funnelArea = [centerPosition.x - seriesNew[i].radius, centerPosition.y - eachSpacing * (i + 1), centerPosition.x + seriesNew[i].radius, centerPosition.y - eachSpacing * i]; - context.beginPath(); - context.setLineWidth(funnelOption.borderWidth * opts.pix); - context.setStrokeStyle(funnelOption.borderColor); - var fillColor = hexToRgb(seriesNew[i].color, funnelOption.fillOpacity); - if (funnelOption.linearType == 'custom') { - var grd = context.createLinearGradient(seriesNew[i].radius, -eachSpacing, -seriesNew[i].radius, -eachSpacing); - grd.addColorStop(0, hexToRgb(seriesNew[i].color, funnelOption.fillOpacity)); - grd.addColorStop(0.5, hexToRgb(funnelOption.customColor[seriesNew[i].linearIndex], funnelOption.fillOpacity)); - grd.addColorStop(1, hexToRgb(seriesNew[i].color, funnelOption.fillOpacity)); - fillColor = grd - } - context.setFillStyle(fillColor); - context.moveTo(0, 0); - context.lineTo(-seriesNew[i].radius, 0); - context.lineTo(-seriesNew[i + 1].radius, -eachSpacing); - context.lineTo(seriesNew[i + 1].radius, -eachSpacing); - context.lineTo(seriesNew[i].radius, 0); - context.lineTo(0, 0); - context.closePath(); - context.fill(); - if (funnelOption.border == true) { - context.stroke(); - } - } - context.translate(0, -eachSpacing) - } - }else{ - context.translate(0, - (seriesNew.length - 1) * eachSpacing); - for (let i = 0; i < seriesNew.length; i++) { - if (i == seriesNew.length - 1) { - if (opts.tooltip) { - if (opts.tooltip.index == i) { - context.beginPath(); - context.setFillStyle(hexToRgb(seriesNew[i].color, funnelOption.activeOpacity)); - context.moveTo(-activeWidth - funnelOption.minSize/2, 0); - context.lineTo(-seriesNew[i].radius - activeWidth, -eachSpacing); - context.lineTo(seriesNew[i].radius + activeWidth, -eachSpacing); - context.lineTo(activeWidth + funnelOption.minSize/2, 0); - context.lineTo(-activeWidth - funnelOption.minSize/2, 0); - context.closePath(); - context.fill(); - } - } - seriesNew[i].funnelArea = [centerPosition.x - seriesNew[i].radius, centerPosition.y - eachSpacing, centerPosition.x + seriesNew[i].radius, centerPosition.y ]; - context.beginPath(); - context.setLineWidth(funnelOption.borderWidth * opts.pix); - context.setStrokeStyle(funnelOption.borderColor); - var fillColor = hexToRgb(seriesNew[i].color, funnelOption.fillOpacity); - if (funnelOption.linearType == 'custom') { - var grd = context.createLinearGradient(seriesNew[i].radius, -eachSpacing, -seriesNew[i].radius, -eachSpacing); - grd.addColorStop(0, hexToRgb(seriesNew[i].color, funnelOption.fillOpacity)); - grd.addColorStop(0.5, hexToRgb(funnelOption.customColor[seriesNew[i].linearIndex], funnelOption.fillOpacity)); - grd.addColorStop(1, hexToRgb(seriesNew[i].color, funnelOption.fillOpacity)); - fillColor = grd - } - context.setFillStyle(fillColor); - context.moveTo(0, 0); - context.lineTo(-funnelOption.minSize/2, 0); - context.lineTo(-seriesNew[i].radius, -eachSpacing); - context.lineTo(seriesNew[i].radius, -eachSpacing); - context.lineTo(funnelOption.minSize/2, 0); - context.lineTo(0, 0); - context.closePath(); - context.fill(); - if (funnelOption.border == true) { - context.stroke(); - } - } else { - if (opts.tooltip) { - if (opts.tooltip.index == i) { - context.beginPath(); - context.setFillStyle(hexToRgb(seriesNew[i].color, funnelOption.activeOpacity)); - context.moveTo(0, 0); - context.lineTo(-seriesNew[i + 1].radius - activeWidth, 0); - context.lineTo(-seriesNew[i].radius - activeWidth, -eachSpacing); - context.lineTo(seriesNew[i].radius + activeWidth, -eachSpacing); - context.lineTo(seriesNew[i + 1].radius + activeWidth, 0); - context.lineTo(0, 0); - context.closePath(); - context.fill(); - } - } - seriesNew[i].funnelArea = [centerPosition.x - seriesNew[i].radius, centerPosition.y - eachSpacing * (seriesNew.length - i), centerPosition.x + seriesNew[i].radius, centerPosition.y - eachSpacing * (seriesNew.length - i - 1)]; - context.beginPath(); - context.setLineWidth(funnelOption.borderWidth * opts.pix); - context.setStrokeStyle(funnelOption.borderColor); - var fillColor = hexToRgb(seriesNew[i].color, funnelOption.fillOpacity); - if (funnelOption.linearType == 'custom') { - var grd = context.createLinearGradient(seriesNew[i].radius, -eachSpacing, -seriesNew[i].radius, -eachSpacing); - grd.addColorStop(0, hexToRgb(seriesNew[i].color, funnelOption.fillOpacity)); - grd.addColorStop(0.5, hexToRgb(funnelOption.customColor[seriesNew[i].linearIndex], funnelOption.fillOpacity)); - grd.addColorStop(1, hexToRgb(seriesNew[i].color, funnelOption.fillOpacity)); - fillColor = grd - } - context.setFillStyle(fillColor); - context.moveTo(0, 0); - context.lineTo(-seriesNew[i + 1].radius, 0); - context.lineTo(-seriesNew[i].radius, -eachSpacing); - context.lineTo(seriesNew[i].radius, -eachSpacing); - context.lineTo(seriesNew[i + 1].radius, 0); - context.lineTo(0, 0); - context.closePath(); - context.fill(); - if (funnelOption.border == true) { - context.stroke(); - } - } - context.translate(0, eachSpacing) - } - } - - context.restore(); - if (opts.dataLabel !== false && process === 1) { - drawFunnelText(seriesNew, opts, context, eachSpacing, funnelOption.labelAlign, activeWidth, centerPosition); - } - if (process === 1) { - drawFunnelCenterText(seriesNew, opts, context, eachSpacing, funnelOption.labelAlign, activeWidth, centerPosition); - } - return { - center: centerPosition, - radius: radius, - series: seriesNew - }; -} - -function drawFunnelText(series, opts, context, eachSpacing, labelAlign, activeWidth, centerPosition) { - for (let i = 0; i < series.length; i++) { - let item = series[i]; - if(item.labelShow === false){ - continue; - } - let startX, endX, startY, fontSize; - let text = item.formatter ? item.formatter(item,i,series,opts) : util.toFixed(item._proportion_ * 100) + '%'; - text = item.labelText ? item.labelText : text; - if (labelAlign == 'right') { - if (i == series.length -1) { - startX = (item.funnelArea[2] + centerPosition.x) / 2; - } else { - startX = (item.funnelArea[2] + series[i + 1].funnelArea[2]) / 2; - } - endX = startX + activeWidth * 2; - startY = item.funnelArea[1] + eachSpacing / 2; - fontSize = item.textSize * opts.pix || opts.fontSize * opts.pix; - context.setLineWidth(1 * opts.pix); - context.setStrokeStyle(item.color); - context.setFillStyle(item.color); - context.beginPath(); - context.moveTo(startX, startY); - context.lineTo(endX, startY); - context.stroke(); - context.closePath(); - context.beginPath(); - context.moveTo(endX, startY); - context.arc(endX, startY, 2 * opts.pix, 0, 2 * Math.PI); - context.closePath(); - context.fill(); - context.beginPath(); - context.setFontSize(fontSize); - context.setFillStyle(item.textColor || opts.fontColor); - context.fillText(text, endX + 5, startY + fontSize / 2 - 2); - context.closePath(); - context.stroke(); - context.closePath(); - } - if (labelAlign == 'left') { - if (i == series.length -1) { - startX = (item.funnelArea[0] + centerPosition.x) / 2; - } else { - startX = (item.funnelArea[0] + series[i + 1].funnelArea[0]) / 2; - } - endX = startX - activeWidth * 2; - startY = item.funnelArea[1] + eachSpacing / 2; - fontSize = item.textSize * opts.pix || opts.fontSize * opts.pix; - context.setLineWidth(1 * opts.pix); - context.setStrokeStyle(item.color); - context.setFillStyle(item.color); - context.beginPath(); - context.moveTo(startX, startY); - context.lineTo(endX, startY); - context.stroke(); - context.closePath(); - context.beginPath(); - context.moveTo(endX, startY); - context.arc(endX, startY, 2, 0, 2 * Math.PI); - context.closePath(); - context.fill(); - context.beginPath(); - context.setFontSize(fontSize); - context.setFillStyle(item.textColor || opts.fontColor); - context.fillText(text, endX - 5 - measureText(text, fontSize, context), startY + fontSize / 2 - 2); - context.closePath(); - context.stroke(); - context.closePath(); - } - } -} - -function drawFunnelCenterText(series, opts, context, eachSpacing, labelAlign, activeWidth, centerPosition) { - for (let i = 0; i < series.length; i++) { - let item = series[i]; - let startY, fontSize; - if (item.centerText) { - startY = item.funnelArea[1] + eachSpacing / 2; - fontSize = item.centerTextSize * opts.pix || opts.fontSize * opts.pix; - context.beginPath(); - context.setFontSize(fontSize); - context.setFillStyle(item.centerTextColor || "#FFFFFF"); - context.fillText(item.centerText, centerPosition.x - measureText(item.centerText, fontSize, context) / 2, startY + fontSize / 2 - 2); - context.closePath(); - context.stroke(); - context.closePath(); - } - } -} - - -function drawCanvas(opts, context) { - context.save(); - context.translate(0, 0.5); - context.restore(); - context.draw(); -} - -var Timing = { - easeIn: function easeIn(pos) { - return Math.pow(pos, 3); - }, - easeOut: function easeOut(pos) { - return Math.pow(pos - 1, 3) + 1; - }, - easeInOut: function easeInOut(pos) { - if ((pos /= 0.5) < 1) { - return 0.5 * Math.pow(pos, 3); - } else { - return 0.5 * (Math.pow(pos - 2, 3) + 2); - } - }, - linear: function linear(pos) { - return pos; - } -}; - -function Animation(opts) { - this.isStop = false; - opts.duration = typeof opts.duration === 'undefined' ? 1000 : opts.duration; - opts.timing = opts.timing || 'easeInOut'; - var delay = 17; - function createAnimationFrame() { - if (typeof setTimeout !== 'undefined') { - return function(step, delay) { - setTimeout(function() { - var timeStamp = +new Date(); - step(timeStamp); - }, delay); - }; - } else if (typeof requestAnimationFrame !== 'undefined') { - return requestAnimationFrame; - } else { - return function(step) { - step(null); - }; - } - }; - var animationFrame = createAnimationFrame(); - var startTimeStamp = null; - var _step = function step(timestamp) { - if (timestamp === null || this.isStop === true) { - opts.onProcess && opts.onProcess(1); - opts.onAnimationFinish && opts.onAnimationFinish(); - return; - } - if (startTimeStamp === null) { - startTimeStamp = timestamp; - } - if (timestamp - startTimeStamp < opts.duration) { - var process = (timestamp - startTimeStamp) / opts.duration; - var timingFunction = Timing[opts.timing]; - process = timingFunction(process); - opts.onProcess && opts.onProcess(process); - animationFrame(_step, delay); - } else { - opts.onProcess && opts.onProcess(1); - opts.onAnimationFinish && opts.onAnimationFinish(); - } - }; - _step = _step.bind(this); - animationFrame(_step, delay); -} - -Animation.prototype.stop = function() { - this.isStop = true; -}; - -function drawCharts(type, opts, config, context) { - var _this = this; - var series = opts.series; - //兼容ECharts饼图类数据格式 - if (type === 'pie' || type === 'ring' || type === 'mount' || type === 'rose' || type === 'funnel') { - series = fixPieSeries(series, opts, config); - } - var categories = opts.categories; - if (type === 'mount') { - categories = []; - for (let j = 0; j < series.length; j++) { - if(series[j].show !== false) categories.push(series[j].name) - } - opts.categories = categories; - } - series = fillSeries(series, opts, config); - var duration = opts.animation ? opts.duration : 0; - _this.animationInstance && _this.animationInstance.stop(); - var seriesMA = null; - if (type == 'candle') { - let average = assign({}, opts.extra.candle.average); - if (average.show) { - seriesMA = calCandleMA(average.day, average.name, average.color, series[0].data); - seriesMA = fillSeries(seriesMA, opts, config); - opts.seriesMA = seriesMA; - } else if (opts.seriesMA) { - seriesMA = opts.seriesMA = fillSeries(opts.seriesMA, opts, config); - } else { - seriesMA = series; - } - } else { - seriesMA = series; - } - /* 过滤掉show=false的series */ - opts._series_ = series = filterSeries(series); - //重新计算图表区域 - opts.area = new Array(4); - //复位绘图区域 - for (let j = 0; j < 4; j++) { - opts.area[j] = opts.padding[j] * opts.pix; - } - //通过计算三大区域:图例、X轴、Y轴的大小,确定绘图区域 - var _calLegendData = calLegendData(seriesMA, opts, config, opts.chartData, context), - legendHeight = _calLegendData.area.wholeHeight, - legendWidth = _calLegendData.area.wholeWidth; - - switch (opts.legend.position) { - case 'top': - opts.area[0] += legendHeight; - break; - case 'bottom': - opts.area[2] += legendHeight; - break; - case 'left': - opts.area[3] += legendWidth; - break; - case 'right': - opts.area[1] += legendWidth; - break; - } - - let _calYAxisData = {}, - yAxisWidth = 0; - if (opts.type === 'line' || opts.type === 'column'|| opts.type === 'mount' || opts.type === 'area' || opts.type === 'mix' || opts.type === 'candle' || opts.type === 'scatter' || opts.type === 'bubble' || opts.type === 'bar') { - _calYAxisData = calYAxisData(series, opts, config, context); - yAxisWidth = _calYAxisData.yAxisWidth; - //如果显示Y轴标题 - if (opts.yAxis.showTitle) { - let maxTitleHeight = 0; - for (let i = 0; i < opts.yAxis.data.length; i++) { - maxTitleHeight = Math.max(maxTitleHeight, opts.yAxis.data[i].titleFontSize ? opts.yAxis.data[i].titleFontSize * opts.pix : config.fontSize) - } - opts.area[0] += maxTitleHeight; - } - let rightIndex = 0, - leftIndex = 0; - //计算主绘图区域左右位置 - for (let i = 0; i < yAxisWidth.length; i++) { - if (yAxisWidth[i].position == 'left') { - if (leftIndex > 0) { - opts.area[3] += yAxisWidth[i].width + opts.yAxis.padding * opts.pix; - } else { - opts.area[3] += yAxisWidth[i].width; - } - leftIndex += 1; - } else if (yAxisWidth[i].position == 'right') { - if (rightIndex > 0) { - opts.area[1] += yAxisWidth[i].width + opts.yAxis.padding * opts.pix; - } else { - opts.area[1] += yAxisWidth[i].width; - } - rightIndex += 1; - } - } - } else { - config.yAxisWidth = yAxisWidth; - } - opts.chartData.yAxisData = _calYAxisData; - - if (opts.categories && opts.categories.length && opts.type !== 'radar' && opts.type !== 'gauge' && opts.type !== 'bar') { - opts.chartData.xAxisData = getXAxisPoints(opts.categories, opts, config); - let _calCategoriesData = calCategoriesData(opts.categories, opts, config, opts.chartData.xAxisData.eachSpacing, context), - xAxisHeight = _calCategoriesData.xAxisHeight, - angle = _calCategoriesData.angle; - config.xAxisHeight = xAxisHeight; - config._xAxisTextAngle_ = angle; - opts.area[2] += xAxisHeight; - opts.chartData.categoriesData = _calCategoriesData; - } else { - if (opts.type === 'line' || opts.type === 'area' || opts.type === 'scatter' || opts.type === 'bubble' || opts.type === 'bar') { - opts.chartData.xAxisData = calXAxisData(series, opts, config, context); - categories = opts.chartData.xAxisData.rangesFormat; - let _calCategoriesData = calCategoriesData(categories, opts, config, opts.chartData.xAxisData.eachSpacing, context), - xAxisHeight = _calCategoriesData.xAxisHeight, - angle = _calCategoriesData.angle; - config.xAxisHeight = xAxisHeight; - config._xAxisTextAngle_ = angle; - opts.area[2] += xAxisHeight; - opts.chartData.categoriesData = _calCategoriesData; - } else { - opts.chartData.xAxisData = { - xAxisPoints: [] - }; - } - } - - //计算右对齐偏移距离 - if (opts.enableScroll && opts.xAxis.scrollAlign == 'right' && opts._scrollDistance_ === undefined) { - let offsetLeft = 0, - xAxisPoints = opts.chartData.xAxisData.xAxisPoints, - startX = opts.chartData.xAxisData.startX, - endX = opts.chartData.xAxisData.endX, - eachSpacing = opts.chartData.xAxisData.eachSpacing; - let totalWidth = eachSpacing * (xAxisPoints.length - 1); - let screenWidth = endX - startX; - offsetLeft = screenWidth - totalWidth; - _this.scrollOption.currentOffset = offsetLeft; - _this.scrollOption.startTouchX = offsetLeft; - _this.scrollOption.distance = 0; - _this.scrollOption.lastMoveTime = 0; - opts._scrollDistance_ = offsetLeft; - } - - if (type === 'pie' || type === 'ring' || type === 'rose') { - config._pieTextMaxLength_ = opts.dataLabel === false ? 0 : getPieTextMaxLength(seriesMA, config, context, opts); - } - - switch (type) { - case 'word': - this.animationInstance = new Animation({ - timing: opts.timing, - duration: duration, - onProcess: function(process) { - context.clearRect(0, 0, opts.width, opts.height); - if (opts.rotate) { - contextRotate(context, opts); - } - drawWordCloudDataPoints(series, opts, config, context, process); - drawCanvas(opts, context); - }, - onAnimationFinish: function onAnimationFinish() { - _this.uevent.trigger('renderComplete'); - } - }); - break; - case 'map': - context.clearRect(0, 0, opts.width, opts.height); - drawMapDataPoints(series, opts, config, context); - setTimeout(()=>{ - this.uevent.trigger('renderComplete'); - },50) - break; - case 'funnel': - this.animationInstance = new Animation({ - timing: opts.timing, - duration: duration, - onProcess: function(process) { - context.clearRect(0, 0, opts.width, opts.height); - if (opts.rotate) { - contextRotate(context, opts); - } - opts.chartData.funnelData = drawFunnelDataPoints(series, opts, config, context, process); - drawLegend(opts.series, opts, config, context, opts.chartData); - drawToolTipBridge(opts, config, context, process); - drawCanvas(opts, context); - }, - onAnimationFinish: function onAnimationFinish() { - _this.uevent.trigger('renderComplete'); - } - }); - break; - case 'line': - this.animationInstance = new Animation({ - timing: opts.timing, - duration: duration, - onProcess: function onProcess(process) { - context.clearRect(0, 0, opts.width, opts.height); - if (opts.rotate) { - contextRotate(context, opts); - } - drawYAxisGrid(categories, opts, config, context); - drawXAxis(categories, opts, config, context); - var _drawLineDataPoints = drawLineDataPoints(series, opts, config, context, process), - xAxisPoints = _drawLineDataPoints.xAxisPoints, - calPoints = _drawLineDataPoints.calPoints, - eachSpacing = _drawLineDataPoints.eachSpacing; - opts.chartData.xAxisPoints = xAxisPoints; - opts.chartData.calPoints = calPoints; - opts.chartData.eachSpacing = eachSpacing; - drawYAxis(series, opts, config, context); - if (opts.enableMarkLine !== false && process === 1) { - drawMarkLine(opts, config, context); - } - drawLegend(opts.series, opts, config, context, opts.chartData); - drawToolTipBridge(opts, config, context, process, eachSpacing, xAxisPoints); - drawCanvas(opts, context); - }, - onAnimationFinish: function onAnimationFinish() { - _this.uevent.trigger('renderComplete'); - } - }); - break; - case 'scatter': - this.animationInstance = new Animation({ - timing: opts.timing, - duration: duration, - onProcess: function onProcess(process) { - context.clearRect(0, 0, opts.width, opts.height); - if (opts.rotate) { - contextRotate(context, opts); - } - drawYAxisGrid(categories, opts, config, context); - drawXAxis(categories, opts, config, context); - var _drawScatterDataPoints = drawScatterDataPoints(series, opts, config, context, process), - xAxisPoints = _drawScatterDataPoints.xAxisPoints, - calPoints = _drawScatterDataPoints.calPoints, - eachSpacing = _drawScatterDataPoints.eachSpacing; - opts.chartData.xAxisPoints = xAxisPoints; - opts.chartData.calPoints = calPoints; - opts.chartData.eachSpacing = eachSpacing; - drawYAxis(series, opts, config, context); - if (opts.enableMarkLine !== false && process === 1) { - drawMarkLine(opts, config, context); - } - drawLegend(opts.series, opts, config, context, opts.chartData); - drawToolTipBridge(opts, config, context, process, eachSpacing, xAxisPoints); - drawCanvas(opts, context); - }, - onAnimationFinish: function onAnimationFinish() { - _this.uevent.trigger('renderComplete'); - } - }); - break; - case 'bubble': - this.animationInstance = new Animation({ - timing: opts.timing, - duration: duration, - onProcess: function onProcess(process) { - context.clearRect(0, 0, opts.width, opts.height); - if (opts.rotate) { - contextRotate(context, opts); - } - drawYAxisGrid(categories, opts, config, context); - drawXAxis(categories, opts, config, context); - var _drawBubbleDataPoints = drawBubbleDataPoints(series, opts, config, context, process), - xAxisPoints = _drawBubbleDataPoints.xAxisPoints, - calPoints = _drawBubbleDataPoints.calPoints, - eachSpacing = _drawBubbleDataPoints.eachSpacing; - opts.chartData.xAxisPoints = xAxisPoints; - opts.chartData.calPoints = calPoints; - opts.chartData.eachSpacing = eachSpacing; - drawYAxis(series, opts, config, context); - if (opts.enableMarkLine !== false && process === 1) { - drawMarkLine(opts, config, context); - } - drawLegend(opts.series, opts, config, context, opts.chartData); - drawToolTipBridge(opts, config, context, process, eachSpacing, xAxisPoints); - drawCanvas(opts, context); - }, - onAnimationFinish: function onAnimationFinish() { - _this.uevent.trigger('renderComplete'); - } - }); - break; - case 'mix': - this.animationInstance = new Animation({ - timing: opts.timing, - duration: duration, - onProcess: function onProcess(process) { - context.clearRect(0, 0, opts.width, opts.height); - if (opts.rotate) { - contextRotate(context, opts); - } - drawYAxisGrid(categories, opts, config, context); - drawXAxis(categories, opts, config, context); - var _drawMixDataPoints = drawMixDataPoints(series, opts, config, context, process), - xAxisPoints = _drawMixDataPoints.xAxisPoints, - calPoints = _drawMixDataPoints.calPoints, - eachSpacing = _drawMixDataPoints.eachSpacing; - opts.chartData.xAxisPoints = xAxisPoints; - opts.chartData.calPoints = calPoints; - opts.chartData.eachSpacing = eachSpacing; - drawYAxis(series, opts, config, context); - if (opts.enableMarkLine !== false && process === 1) { - drawMarkLine(opts, config, context); - } - drawLegend(opts.series, opts, config, context, opts.chartData); - drawToolTipBridge(opts, config, context, process, eachSpacing, xAxisPoints); - drawCanvas(opts, context); - }, - onAnimationFinish: function onAnimationFinish() { - _this.uevent.trigger('renderComplete'); - } - }); - break; - case 'column': - this.animationInstance = new Animation({ - timing: opts.timing, - duration: duration, - onProcess: function onProcess(process) { - context.clearRect(0, 0, opts.width, opts.height); - if (opts.rotate) { - contextRotate(context, opts); - } - drawYAxisGrid(categories, opts, config, context); - drawXAxis(categories, opts, config, context); - var _drawColumnDataPoints = drawColumnDataPoints(series, opts, config, context, process), - xAxisPoints = _drawColumnDataPoints.xAxisPoints, - calPoints = _drawColumnDataPoints.calPoints, - eachSpacing = _drawColumnDataPoints.eachSpacing; - opts.chartData.xAxisPoints = xAxisPoints; - opts.chartData.calPoints = calPoints; - opts.chartData.eachSpacing = eachSpacing; - drawYAxis(series, opts, config, context); - if (opts.enableMarkLine !== false && process === 1) { - drawMarkLine(opts, config, context); - } - drawLegend(opts.series, opts, config, context, opts.chartData); - drawToolTipBridge(opts, config, context, process, eachSpacing, xAxisPoints); - drawCanvas(opts, context); - }, - onAnimationFinish: function onAnimationFinish() { - _this.uevent.trigger('renderComplete'); - } - }); - break; - case 'mount': - this.animationInstance = new Animation({ - timing: opts.timing, - duration: duration, - onProcess: function onProcess(process) { - context.clearRect(0, 0, opts.width, opts.height); - if (opts.rotate) { - contextRotate(context, opts); - } - drawYAxisGrid(categories, opts, config, context); - drawXAxis(categories, opts, config, context); - var _drawMountDataPoints = drawMountDataPoints(series, opts, config, context, process), - xAxisPoints = _drawMountDataPoints.xAxisPoints, - calPoints = _drawMountDataPoints.calPoints, - eachSpacing = _drawMountDataPoints.eachSpacing; - opts.chartData.xAxisPoints = xAxisPoints; - opts.chartData.calPoints = calPoints; - opts.chartData.eachSpacing = eachSpacing; - drawYAxis(series, opts, config, context); - if (opts.enableMarkLine !== false && process === 1) { - drawMarkLine(opts, config, context); - } - drawLegend(opts.series, opts, config, context, opts.chartData); - drawToolTipBridge(opts, config, context, process, eachSpacing, xAxisPoints); - drawCanvas(opts, context); - }, - onAnimationFinish: function onAnimationFinish() { - _this.uevent.trigger('renderComplete'); - } - }); - break; - case 'bar': - this.animationInstance = new Animation({ - timing: opts.timing, - duration: duration, - onProcess: function onProcess(process) { - context.clearRect(0, 0, opts.width, opts.height); - if (opts.rotate) { - contextRotate(context, opts); - } - drawXAxis(categories, opts, config, context); - var _drawBarDataPoints = drawBarDataPoints(series, opts, config, context, process), - yAxisPoints = _drawBarDataPoints.yAxisPoints, - calPoints = _drawBarDataPoints.calPoints, - eachSpacing = _drawBarDataPoints.eachSpacing; - opts.chartData.yAxisPoints = yAxisPoints; - opts.chartData.xAxisPoints = opts.chartData.xAxisData.xAxisPoints; - opts.chartData.calPoints = calPoints; - opts.chartData.eachSpacing = eachSpacing; - drawYAxis(series, opts, config, context); - if (opts.enableMarkLine !== false && process === 1) { - drawMarkLine(opts, config, context); - } - drawLegend(opts.series, opts, config, context, opts.chartData); - drawToolTipBridge(opts, config, context, process, eachSpacing, yAxisPoints); - drawCanvas(opts, context); - }, - onAnimationFinish: function onAnimationFinish() { - _this.uevent.trigger('renderComplete'); - } - }); - break; - case 'area': - this.animationInstance = new Animation({ - timing: opts.timing, - duration: duration, - onProcess: function onProcess(process) { - context.clearRect(0, 0, opts.width, opts.height); - if (opts.rotate) { - contextRotate(context, opts); - } - drawYAxisGrid(categories, opts, config, context); - drawXAxis(categories, opts, config, context); - var _drawAreaDataPoints = drawAreaDataPoints(series, opts, config, context, process), - xAxisPoints = _drawAreaDataPoints.xAxisPoints, - calPoints = _drawAreaDataPoints.calPoints, - eachSpacing = _drawAreaDataPoints.eachSpacing; - opts.chartData.xAxisPoints = xAxisPoints; - opts.chartData.calPoints = calPoints; - opts.chartData.eachSpacing = eachSpacing; - drawYAxis(series, opts, config, context); - if (opts.enableMarkLine !== false && process === 1) { - drawMarkLine(opts, config, context); - } - drawLegend(opts.series, opts, config, context, opts.chartData); - drawToolTipBridge(opts, config, context, process, eachSpacing, xAxisPoints); - drawCanvas(opts, context); - }, - onAnimationFinish: function onAnimationFinish() { - _this.uevent.trigger('renderComplete'); - } - }); - break; - case 'ring': - this.animationInstance = new Animation({ - timing: opts.timing, - duration: duration, - onProcess: function onProcess(process) { - context.clearRect(0, 0, opts.width, opts.height); - if (opts.rotate) { - contextRotate(context, opts); - } - opts.chartData.pieData = drawPieDataPoints(series, opts, config, context, process); - drawLegend(opts.series, opts, config, context, opts.chartData); - drawToolTipBridge(opts, config, context, process); - drawCanvas(opts, context); - }, - onAnimationFinish: function onAnimationFinish() { - _this.uevent.trigger('renderComplete'); - } - }); - break; - case 'pie': - this.animationInstance = new Animation({ - timing: opts.timing, - duration: duration, - onProcess: function onProcess(process) { - context.clearRect(0, 0, opts.width, opts.height); - if (opts.rotate) { - contextRotate(context, opts); - } - opts.chartData.pieData = drawPieDataPoints(series, opts, config, context, process); - drawLegend(opts.series, opts, config, context, opts.chartData); - drawToolTipBridge(opts, config, context, process); - drawCanvas(opts, context); - }, - onAnimationFinish: function onAnimationFinish() { - _this.uevent.trigger('renderComplete'); - } - }); - break; - case 'rose': - this.animationInstance = new Animation({ - timing: opts.timing, - duration: duration, - onProcess: function onProcess(process) { - context.clearRect(0, 0, opts.width, opts.height); - if (opts.rotate) { - contextRotate(context, opts); - } - opts.chartData.pieData = drawRoseDataPoints(series, opts, config, context, process); - drawLegend(opts.series, opts, config, context, opts.chartData); - drawToolTipBridge(opts, config, context, process); - drawCanvas(opts, context); - }, - onAnimationFinish: function onAnimationFinish() { - _this.uevent.trigger('renderComplete'); - } - }); - break; - case 'radar': - this.animationInstance = new Animation({ - timing: opts.timing, - duration: duration, - onProcess: function onProcess(process) { - context.clearRect(0, 0, opts.width, opts.height); - if (opts.rotate) { - contextRotate(context, opts); - } - opts.chartData.radarData = drawRadarDataPoints(series, opts, config, context, process); - drawLegend(opts.series, opts, config, context, opts.chartData); - drawToolTipBridge(opts, config, context, process); - drawCanvas(opts, context); - }, - onAnimationFinish: function onAnimationFinish() { - _this.uevent.trigger('renderComplete'); - } - }); - break; - case 'arcbar': - this.animationInstance = new Animation({ - timing: opts.timing, - duration: duration, - onProcess: function onProcess(process) { - context.clearRect(0, 0, opts.width, opts.height); - if (opts.rotate) { - contextRotate(context, opts); - } - opts.chartData.arcbarData = drawArcbarDataPoints(series, opts, config, context, process); - drawCanvas(opts, context); - }, - onAnimationFinish: function onAnimationFinish() { - _this.uevent.trigger('renderComplete'); - } - }); - break; - case 'gauge': - this.animationInstance = new Animation({ - timing: opts.timing, - duration: duration, - onProcess: function onProcess(process) { - context.clearRect(0, 0, opts.width, opts.height); - if (opts.rotate) { - contextRotate(context, opts); - } - opts.chartData.gaugeData = drawGaugeDataPoints(categories, series, opts, config, context, process); - drawCanvas(opts, context); - }, - onAnimationFinish: function onAnimationFinish() { - _this.uevent.trigger('renderComplete'); - } - }); - break; - case 'candle': - this.animationInstance = new Animation({ - timing: opts.timing, - duration: duration, - onProcess: function onProcess(process) { - context.clearRect(0, 0, opts.width, opts.height); - if (opts.rotate) { - contextRotate(context, opts); - } - drawYAxisGrid(categories, opts, config, context); - drawXAxis(categories, opts, config, context); - var _drawCandleDataPoints = drawCandleDataPoints(series, seriesMA, opts, config, context, process), - xAxisPoints = _drawCandleDataPoints.xAxisPoints, - calPoints = _drawCandleDataPoints.calPoints, - eachSpacing = _drawCandleDataPoints.eachSpacing; - opts.chartData.xAxisPoints = xAxisPoints; - opts.chartData.calPoints = calPoints; - opts.chartData.eachSpacing = eachSpacing; - drawYAxis(series, opts, config, context); - if (opts.enableMarkLine !== false && process === 1) { - drawMarkLine(opts, config, context); - } - if (seriesMA) { - drawLegend(seriesMA, opts, config, context, opts.chartData); - } else { - drawLegend(opts.series, opts, config, context, opts.chartData); - } - drawToolTipBridge(opts, config, context, process, eachSpacing, xAxisPoints); - drawCanvas(opts, context); - }, - onAnimationFinish: function onAnimationFinish() { - _this.uevent.trigger('renderComplete'); - } - }); - break; - } -} - -function uChartsEvent() { - this.events = {}; -} - -uChartsEvent.prototype.addEventListener = function(type, listener) { - this.events[type] = this.events[type] || []; - this.events[type].push(listener); -}; - -uChartsEvent.prototype.delEventListener = function(type) { - this.events[type] = []; -}; - -uChartsEvent.prototype.trigger = function() { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - var type = args[0]; - var params = args.slice(1); - if (!!this.events[type]) { - this.events[type].forEach(function(listener) { - try { - listener.apply(null, params); - } catch (e) { - //console.log('[uCharts] '+e); - } - }); - } -}; - -var uCharts = function uCharts(opts) { - opts.pix = opts.pixelRatio ? opts.pixelRatio : 1; - opts.fontSize = opts.fontSize ? opts.fontSize : 13; - opts.fontColor = opts.fontColor ? opts.fontColor : config.fontColor; - if (opts.background == "" || opts.background == "none") { - opts.background = "#FFFFFF" - } - opts.title = assign({}, opts.title); - opts.subtitle = assign({}, opts.subtitle); - opts.duration = opts.duration ? opts.duration : 1000; - opts.yAxis = assign({}, { - data: [], - showTitle: false, - disabled: false, - disableGrid: false, - gridSet: 'number', - splitNumber: 5, - gridType: 'solid', - dashLength: 4 * opts.pix, - gridColor: '#cccccc', - padding: 10, - fontColor: '#666666' - }, opts.yAxis); - opts.xAxis = assign({}, { - rotateLabel: false, - rotateAngle:45, - disabled: false, - disableGrid: false, - splitNumber: 5, - calibration:false, - fontColor: '#666666', - fontSize: 13, - lineHeight: 20, - marginTop: 0, - gridType: 'solid', - dashLength: 4, - scrollAlign: 'left', - boundaryGap: 'center', - axisLine: true, - axisLineColor: '#cccccc', - titleFontSize: 13, - titleOffsetY: 0, - titleOffsetX: 0, - titleFontColor: '#666666' - }, opts.xAxis); - opts.xAxis.scrollPosition = opts.xAxis.scrollAlign; - opts.legend = assign({}, { - show: true, - position: 'bottom', - float: 'center', - backgroundColor: 'rgba(0,0,0,0)', - borderColor: 'rgba(0,0,0,0)', - borderWidth: 0, - padding: 5, - margin: 5, - itemGap: 10, - fontSize: opts.fontSize, - lineHeight: opts.fontSize, - fontColor: opts.fontColor, - formatter: {}, - hiddenColor: '#CECECE' - }, opts.legend); - opts.extra = assign({ - tooltip:{ - legendShape: 'auto' - } - }, opts.extra); - opts.rotate = opts.rotate ? true : false; - opts.animation = opts.animation ? true : false; - opts.rotate = opts.rotate ? true : false; - opts.canvas2d = opts.canvas2d ? true : false; - - let config$$1 = assign({}, config); - config$$1.color = opts.color ? opts.color : config$$1.color; - if (opts.type == 'pie') { - config$$1.pieChartLinePadding = opts.dataLabel === false ? 0 : opts.extra.pie.labelWidth * opts.pix || config$$1.pieChartLinePadding * opts.pix; - } - if (opts.type == 'ring') { - config$$1.pieChartLinePadding = opts.dataLabel === false ? 0 : opts.extra.ring.labelWidth * opts.pix || config$$1.pieChartLinePadding * opts.pix; - } - if (opts.type == 'rose') { - config$$1.pieChartLinePadding = opts.dataLabel === false ? 0 : opts.extra.rose.labelWidth * opts.pix || config$$1.pieChartLinePadding * opts.pix; - } - config$$1.pieChartTextPadding = opts.dataLabel === false ? 0 : config$$1.pieChartTextPadding * opts.pix; - - //屏幕旋转 - config$$1.rotate = opts.rotate; - if (opts.rotate) { - let tempWidth = opts.width; - let tempHeight = opts.height; - opts.width = tempHeight; - opts.height = tempWidth; - } - - //适配高分屏 - opts.padding = opts.padding ? opts.padding : config$$1.padding; - config$$1.yAxisWidth = config.yAxisWidth * opts.pix; - config$$1.fontSize = opts.fontSize * opts.pix; - config$$1.titleFontSize = config.titleFontSize * opts.pix; - config$$1.subtitleFontSize = config.subtitleFontSize * opts.pix; - if(!opts.context){ - throw new Error('[uCharts] 未获取到context!注意:v2.0版本后,需要自行获取canvas的绘图上下文并传入opts.context!'); - } - this.context = opts.context; - if (!this.context.setTextAlign) { - this.context.setStrokeStyle = function(e) { - return this.strokeStyle = e; - } - this.context.setLineWidth = function(e) { - return this.lineWidth = e; - } - this.context.setLineCap = function(e) { - return this.lineCap = e; - } - this.context.setFontSize = function(e) { - return this.font = e + "px sans-serif"; - } - this.context.setFillStyle = function(e) { - return this.fillStyle = e; - } - this.context.setTextAlign = function(e) { - return this.textAlign = e; - } - this.context.setTextBaseline = function(e) { - return this.textBaseline = e; - } - this.context.setShadow = function(offsetX,offsetY,blur,color) { - this.shadowColor = color; - this.shadowOffsetX = offsetX; - this.shadowOffsetY = offsetY; - this.shadowBlur = blur; - } - this.context.draw = function() {} - } - //兼容NVUEsetLineDash - if(!this.context.setLineDash){ - this.context.setLineDash = function(e) {} - } - opts.chartData = {}; - this.uevent = new uChartsEvent(); - this.scrollOption = { - currentOffset: 0, - startTouchX: 0, - distance: 0, - lastMoveTime: 0 - }; - this.opts = opts; - this.config = config$$1; - drawCharts.call(this, opts.type, opts, config$$1, this.context); -}; - -uCharts.prototype.updateData = function() { - let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - this.opts = assign({}, this.opts, data); - this.opts.updateData = true; - let scrollPosition = data.scrollPosition || 'current'; - switch (scrollPosition) { - case 'current': - this.opts._scrollDistance_ = this.scrollOption.currentOffset; - break; - case 'left': - this.opts._scrollDistance_ = 0; - this.scrollOption = { - currentOffset: 0, - startTouchX: 0, - distance: 0, - lastMoveTime: 0 - }; - break; - case 'right': - let _calYAxisData = calYAxisData(this.opts.series, this.opts, this.config, this.context), yAxisWidth = _calYAxisData.yAxisWidth; - this.config.yAxisWidth = yAxisWidth; - let offsetLeft = 0; - let _getXAxisPoints0 = getXAxisPoints(this.opts.categories, this.opts, this.config), xAxisPoints = _getXAxisPoints0.xAxisPoints, - startX = _getXAxisPoints0.startX, - endX = _getXAxisPoints0.endX, - eachSpacing = _getXAxisPoints0.eachSpacing; - let totalWidth = eachSpacing * (xAxisPoints.length - 1); - let screenWidth = endX - startX; - offsetLeft = screenWidth - totalWidth; - this.scrollOption = { - currentOffset: offsetLeft, - startTouchX: offsetLeft, - distance: 0, - lastMoveTime: 0 - }; - this.opts._scrollDistance_ = offsetLeft; - break; - } - drawCharts.call(this, this.opts.type, this.opts, this.config, this.context); -}; - -uCharts.prototype.zoom = function() { - var val = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.opts.xAxis.itemCount; - if (this.opts.enableScroll !== true) { - console.log('[uCharts] 请启用滚动条后使用') - return; - } - //当前屏幕中间点 - let centerPoint = Math.round(Math.abs(this.scrollOption.currentOffset) / this.opts.chartData.eachSpacing) + Math.round(this.opts.xAxis.itemCount / 2); - this.opts.animation = false; - this.opts.xAxis.itemCount = val.itemCount; - //重新计算x轴偏移距离 - let _calYAxisData = calYAxisData(this.opts.series, this.opts, this.config, this.context), - yAxisWidth = _calYAxisData.yAxisWidth; - this.config.yAxisWidth = yAxisWidth; - let offsetLeft = 0; - let _getXAxisPoints0 = getXAxisPoints(this.opts.categories, this.opts, this.config), - xAxisPoints = _getXAxisPoints0.xAxisPoints, - startX = _getXAxisPoints0.startX, - endX = _getXAxisPoints0.endX, - eachSpacing = _getXAxisPoints0.eachSpacing; - let centerLeft = eachSpacing * centerPoint; - let screenWidth = endX - startX; - let MaxLeft = screenWidth - eachSpacing * (xAxisPoints.length - 1); - offsetLeft = screenWidth / 2 - centerLeft; - if (offsetLeft > 0) { - offsetLeft = 0; - } - if (offsetLeft < MaxLeft) { - offsetLeft = MaxLeft; - } - this.scrollOption = { - currentOffset: offsetLeft, - startTouchX: 0, - distance: 0, - lastMoveTime: 0 - }; - calValidDistance(this, offsetLeft, this.opts.chartData, this.config, this.opts); - this.opts._scrollDistance_ = offsetLeft; - drawCharts.call(this, this.opts.type, this.opts, this.config, this.context); -}; - -uCharts.prototype.dobuleZoom = function(e) { - if (this.opts.enableScroll !== true) { - console.log('[uCharts] 请启用滚动条后使用') - return; - } - const tcs = e.changedTouches; - if (tcs.length < 2) { - return; - } - for (var i = 0; i < tcs.length; i++) { - tcs[i].x = tcs[i].x ? tcs[i].x : tcs[i].clientX; - tcs[i].y = tcs[i].y ? tcs[i].y : tcs[i].clientY; - } - const ntcs = [getTouches(tcs[0], this.opts, e),getTouches(tcs[1], this.opts, e)]; - const xlength = Math.abs(ntcs[0].x - ntcs[1].x); - // 记录初始的两指之间的数据 - if(!this.scrollOption.moveCount){ - let cts0 = {changedTouches:[{x:tcs[0].x,y:this.opts.area[0] / this.opts.pix + 2}]}; - let cts1 = {changedTouches:[{x:tcs[1].x,y:this.opts.area[0] / this.opts.pix + 2}]}; - if(this.opts.rotate){ - cts0 = {changedTouches:[{x:this.opts.height / this.opts.pix - this.opts.area[0] / this.opts.pix - 2,y:tcs[0].y}]}; - cts1 = {changedTouches:[{x:this.opts.height / this.opts.pix - this.opts.area[0] / this.opts.pix - 2,y:tcs[1].y}]}; - } - const moveCurrent1 = this.getCurrentDataIndex(cts0).index; - const moveCurrent2 = this.getCurrentDataIndex(cts1).index; - const moveCount = Math.abs(moveCurrent1 - moveCurrent2); - this.scrollOption.moveCount = moveCount; - this.scrollOption.moveCurrent1 = Math.min(moveCurrent1, moveCurrent2); - this.scrollOption.moveCurrent2 = Math.max(moveCurrent1, moveCurrent2); - return; - } - - let currentEachSpacing = xlength / this.scrollOption.moveCount; - let itemCount = (this.opts.width - this.opts.area[1] - this.opts.area[3]) / currentEachSpacing; - itemCount = itemCount <= 2 ? 2 : itemCount; - itemCount = itemCount >= this.opts.categories.length ? this.opts.categories.length : itemCount; - this.opts.animation = false; - this.opts.xAxis.itemCount = itemCount; - // 重新计算滚动条偏移距离 - let offsetLeft = 0; - let _getXAxisPoints0 = getXAxisPoints(this.opts.categories, this.opts, this.config), - xAxisPoints = _getXAxisPoints0.xAxisPoints, - startX = _getXAxisPoints0.startX, - endX = _getXAxisPoints0.endX, - eachSpacing = _getXAxisPoints0.eachSpacing; - let currentLeft = eachSpacing * this.scrollOption.moveCurrent1; - let screenWidth = endX - startX; - let MaxLeft = screenWidth - eachSpacing * (xAxisPoints.length - 1); - offsetLeft = -currentLeft+Math.min(ntcs[0].x,ntcs[1].x)-this.opts.area[3]-eachSpacing; - if (offsetLeft > 0) { - offsetLeft = 0; - } - if (offsetLeft < MaxLeft) { - offsetLeft = MaxLeft; - } - this.scrollOption.currentOffset= offsetLeft; - this.scrollOption.startTouchX= 0; - this.scrollOption.distance=0; - calValidDistance(this, offsetLeft, this.opts.chartData, this.config, this.opts); - this.opts._scrollDistance_ = offsetLeft; - drawCharts.call(this, this.opts.type, this.opts, this.config, this.context); -} - -uCharts.prototype.stopAnimation = function() { - this.animationInstance && this.animationInstance.stop(); -}; - -uCharts.prototype.addEventListener = function(type, listener) { - this.uevent.addEventListener(type, listener); -}; - -uCharts.prototype.delEventListener = function(type) { - this.uevent.delEventListener(type); -}; - -uCharts.prototype.getCurrentDataIndex = function(e) { - var touches = null; - if (e.changedTouches) { - touches = e.changedTouches[0]; - } else { - touches = e.mp.changedTouches[0]; - } - if (touches) { - let _touches$ = getTouches(touches, this.opts, e); - if (this.opts.type === 'pie' || this.opts.type === 'ring') { - return findPieChartCurrentIndex({ - x: _touches$.x, - y: _touches$.y - }, this.opts.chartData.pieData, this.opts); - } else if (this.opts.type === 'rose') { - return findRoseChartCurrentIndex({ - x: _touches$.x, - y: _touches$.y - }, this.opts.chartData.pieData, this.opts); - } else if (this.opts.type === 'radar') { - return findRadarChartCurrentIndex({ - x: _touches$.x, - y: _touches$.y - }, this.opts.chartData.radarData, this.opts.categories.length); - } else if (this.opts.type === 'funnel') { - return findFunnelChartCurrentIndex({ - x: _touches$.x, - y: _touches$.y - }, this.opts.chartData.funnelData); - } else if (this.opts.type === 'map') { - return findMapChartCurrentIndex({ - x: _touches$.x, - y: _touches$.y - }, this.opts); - } else if (this.opts.type === 'word') { - return findWordChartCurrentIndex({ - x: _touches$.x, - y: _touches$.y - }, this.opts.chartData.wordCloudData); - } else if (this.opts.type === 'bar') { - return findBarChartCurrentIndex({ - x: _touches$.x, - y: _touches$.y - }, this.opts.chartData.calPoints, this.opts, this.config, Math.abs(this.scrollOption.currentOffset)); - } else { - return findCurrentIndex({ - x: _touches$.x, - y: _touches$.y - }, this.opts.chartData.calPoints, this.opts, this.config, Math.abs(this.scrollOption.currentOffset)); - } - } - return -1; -}; - -uCharts.prototype.getLegendDataIndex = function(e) { - var touches = null; - if (e.changedTouches) { - touches = e.changedTouches[0]; - } else { - touches = e.mp.changedTouches[0]; - } - if (touches) { - let _touches$ = getTouches(touches, this.opts, e); - return findLegendIndex({ - x: _touches$.x, - y: _touches$.y - }, this.opts.chartData.legendData); - } - return -1; -}; - -uCharts.prototype.touchLegend = function(e) { - var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var touches = null; - if (e.changedTouches) { - touches = e.changedTouches[0]; - } else { - touches = e.mp.changedTouches[0]; - } - if (touches) { - var _touches$ = getTouches(touches, this.opts, e); - var index = this.getLegendDataIndex(e); - if (index >= 0) { - if (this.opts.type == 'candle') { - this.opts.seriesMA[index].show = !this.opts.seriesMA[index].show; - } else { - this.opts.series[index].show = !this.opts.series[index].show; - } - this.opts.animation = option.animation ? true : false; - this.opts._scrollDistance_ = this.scrollOption.currentOffset; - drawCharts.call(this, this.opts.type, this.opts, this.config, this.context); - } - } - -}; - -uCharts.prototype.showToolTip = function(e) { - var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var touches = null; - if (e.changedTouches) { - touches = e.changedTouches[0]; - } else { - touches = e.mp.changedTouches[0]; - } - if (!touches) { - console.log("[uCharts] 未获取到event坐标信息"); - } - var _touches$ = getTouches(touches, this.opts, e); - var currentOffset = this.scrollOption.currentOffset; - var opts = assign({}, this.opts, { - _scrollDistance_: currentOffset, - animation: false - }); - if (this.opts.type === 'line' || this.opts.type === 'area' || this.opts.type === 'column' || this.opts.type === 'scatter' || this.opts.type === 'bubble') { - var current = this.getCurrentDataIndex(e); - var index = option.index == undefined ? current.index : option.index; - if (index > -1 || index.length>0) { - var seriesData = getSeriesDataItem(this.opts.series, index, current.group); - if (seriesData.length !== 0) { - var _getToolTipData = getToolTipData(seriesData, this.opts, index, current.group, this.opts.categories, option), - textList = _getToolTipData.textList, - offset = _getToolTipData.offset; - offset.y = _touches$.y; - opts.tooltip = { - textList: option.textList !== undefined ? option.textList : textList, - offset: option.offset !== undefined ? option.offset : offset, - option: option, - index: index, - group: current.group - }; - } - } - drawCharts.call(this, opts.type, opts, this.config, this.context); - } - if (this.opts.type === 'mount') { - var index = option.index == undefined ? this.getCurrentDataIndex(e).index : option.index; - if (index > -1) { - var opts = assign({}, this.opts, {animation: false}); - var seriesData = assign({}, opts._series_[index]); - var textList = [{ - text: option.formatter ? option.formatter(seriesData, undefined, index, opts) : seriesData.name + ': ' + seriesData.data, - color: seriesData.color, - legendShape: this.opts.extra.tooltip.legendShape == 'auto' ? seriesData.legendShape : this.opts.extra.tooltip.legendShape - }]; - var offset = { - x: opts.chartData.calPoints[index].x, - y: _touches$.y - }; - opts.tooltip = { - textList: option.textList ? option.textList : textList, - offset: option.offset !== undefined ? option.offset : offset, - option: option, - index: index - }; - } - - drawCharts.call(this, opts.type, opts, this.config, this.context); - } - if (this.opts.type === 'bar') { - var current = this.getCurrentDataIndex(e); - var index = option.index == undefined ? current.index : option.index; - if (index > -1 || index.length>0) { - var seriesData = getSeriesDataItem(this.opts.series, index, current.group); - if (seriesData.length !== 0) { - var _getToolTipData = getToolTipData(seriesData, this.opts, index, current.group, this.opts.categories, option), - textList = _getToolTipData.textList, - offset = _getToolTipData.offset; - offset.x = _touches$.x; - opts.tooltip = { - textList: option.textList !== undefined ? option.textList : textList, - offset: option.offset !== undefined ? option.offset : offset, - option: option, - index: index - }; - } - } - drawCharts.call(this, opts.type, opts, this.config, this.context); - } - if (this.opts.type === 'mix') { - var current = this.getCurrentDataIndex(e); - var index = option.index == undefined ? current.index : option.index; - if (index > -1) { - var currentOffset = this.scrollOption.currentOffset; - var opts = assign({}, this.opts, { - _scrollDistance_: currentOffset, - animation: false - }); - var seriesData = getSeriesDataItem(this.opts.series, index); - if (seriesData.length !== 0) { - var _getMixToolTipData = getMixToolTipData(seriesData, this.opts, index, this.opts.categories, option), - textList = _getMixToolTipData.textList, - offset = _getMixToolTipData.offset; - offset.y = _touches$.y; - opts.tooltip = { - textList: option.textList ? option.textList : textList, - offset: option.offset !== undefined ? option.offset : offset, - option: option, - index: index - }; - } - } - drawCharts.call(this, opts.type, opts, this.config, this.context); - } - if (this.opts.type === 'candle') { - var current = this.getCurrentDataIndex(e); - var index = option.index == undefined ? current.index : option.index; - if (index > -1) { - var currentOffset = this.scrollOption.currentOffset; - var opts = assign({}, this.opts, { - _scrollDistance_: currentOffset, - animation: false - }); - var seriesData = getSeriesDataItem(this.opts.series, index); - if (seriesData.length !== 0) { - var _getToolTipData = getCandleToolTipData(this.opts.series[0].data, seriesData, this.opts, index, this.opts.categories, this.opts.extra.candle, option), - textList = _getToolTipData.textList, - offset = _getToolTipData.offset; - offset.y = _touches$.y; - opts.tooltip = { - textList: option.textList ? option.textList : textList, - offset: option.offset !== undefined ? option.offset : offset, - option: option, - index: index - }; - } - } - drawCharts.call(this, opts.type, opts, this.config, this.context); - } - if (this.opts.type === 'pie' || this.opts.type === 'ring' || this.opts.type === 'rose' || this.opts.type === 'funnel') { - var index = option.index == undefined ? this.getCurrentDataIndex(e) : option.index; - if (index > -1) { - var opts = assign({}, this.opts, {animation: false}); - var seriesData = assign({}, opts._series_[index]); - var textList = [{ - text: option.formatter ? option.formatter(seriesData, undefined, index, opts) : seriesData.name + ': ' + seriesData.data, - color: seriesData.color, - legendShape: this.opts.extra.tooltip.legendShape == 'auto' ? seriesData.legendShape : this.opts.extra.tooltip.legendShape - }]; - var offset = { - x: _touches$.x, - y: _touches$.y - }; - opts.tooltip = { - textList: option.textList ? option.textList : textList, - offset: option.offset !== undefined ? option.offset : offset, - option: option, - index: index - }; - } - drawCharts.call(this, opts.type, opts, this.config, this.context); - } - if (this.opts.type === 'map') { - var index = option.index == undefined ? this.getCurrentDataIndex(e) : option.index; - if (index > -1) { - var opts = assign({}, this.opts, {animation: false}); - var seriesData = assign({}, this.opts.series[index]); - seriesData.name = seriesData.properties.name - var textList = [{ - text: option.formatter ? option.formatter(seriesData, undefined, index, this.opts) : seriesData.name, - color: seriesData.color, - legendShape: this.opts.extra.tooltip.legendShape == 'auto' ? seriesData.legendShape : this.opts.extra.tooltip.legendShape - }]; - var offset = { - x: _touches$.x, - y: _touches$.y - }; - opts.tooltip = { - textList: option.textList ? option.textList : textList, - offset: option.offset !== undefined ? option.offset : offset, - option: option, - index: index - }; - } - opts.updateData = false; - drawCharts.call(this, opts.type, opts, this.config, this.context); - } - if (this.opts.type === 'word') { - var index = option.index == undefined ? this.getCurrentDataIndex(e) : option.index; - if (index > -1) { - var opts = assign({}, this.opts, {animation: false}); - var seriesData = assign({}, this.opts.series[index]); - var textList = [{ - text: option.formatter ? option.formatter(seriesData, undefined, index, this.opts) : seriesData.name, - color: seriesData.color, - legendShape: this.opts.extra.tooltip.legendShape == 'auto' ? seriesData.legendShape : this.opts.extra.tooltip.legendShape - }]; - var offset = { - x: _touches$.x, - y: _touches$.y - }; - opts.tooltip = { - textList: option.textList ? option.textList : textList, - offset: option.offset !== undefined ? option.offset : offset, - option: option, - index: index - }; - } - opts.updateData = false; - drawCharts.call(this, opts.type, opts, this.config, this.context); - } - if (this.opts.type === 'radar') { - var index = option.index == undefined ? this.getCurrentDataIndex(e) : option.index; - if (index > -1) { - var opts = assign({}, this.opts, {animation: false}); - var seriesData = getSeriesDataItem(this.opts.series, index); - if (seriesData.length !== 0) { - var textList = seriesData.map((item) => { - return { - text: option.formatter ? option.formatter(item, this.opts.categories[index], index, this.opts) : item.name + ': ' + item.data, - color: item.color, - legendShape: this.opts.extra.tooltip.legendShape == 'auto' ? item.legendShape : this.opts.extra.tooltip.legendShape - }; - }); - var offset = { - x: _touches$.x, - y: _touches$.y - }; - opts.tooltip = { - textList: option.textList ? option.textList : textList, - offset: option.offset !== undefined ? option.offset : offset, - option: option, - index: index - }; - } - } - drawCharts.call(this, opts.type, opts, this.config, this.context); - } -}; - -uCharts.prototype.translate = function(distance) { - this.scrollOption = { - currentOffset: distance, - startTouchX: distance, - distance: 0, - lastMoveTime: 0 - }; - let opts = assign({}, this.opts, { - _scrollDistance_: distance, - animation: false - }); - drawCharts.call(this, this.opts.type, opts, this.config, this.context); -}; - -uCharts.prototype.scrollStart = function(e) { - var touches = null; - if (e.changedTouches) { - touches = e.changedTouches[0]; - } else { - touches = e.mp.changedTouches[0]; - } - var _touches$ = getTouches(touches, this.opts, e); - if (touches && this.opts.enableScroll === true) { - this.scrollOption.startTouchX = _touches$.x; - } -}; - -uCharts.prototype.scroll = function(e) { - if (this.scrollOption.lastMoveTime === 0) { - this.scrollOption.lastMoveTime = Date.now(); - } - let Limit = this.opts.touchMoveLimit || 60; - let currMoveTime = Date.now(); - let duration = currMoveTime - this.scrollOption.lastMoveTime; - if (duration < Math.floor(1000 / Limit)) return; - if (this.scrollOption.startTouchX == 0) return; - this.scrollOption.lastMoveTime = currMoveTime; - var touches = null; - if (e.changedTouches) { - touches = e.changedTouches[0]; - } else { - touches = e.mp.changedTouches[0]; - } - if (touches && this.opts.enableScroll === true) { - var _touches$ = getTouches(touches, this.opts, e); - var _distance; - _distance = _touches$.x - this.scrollOption.startTouchX; - var currentOffset = this.scrollOption.currentOffset; - var validDistance = calValidDistance(this, currentOffset + _distance, this.opts.chartData, this.config, this.opts); - this.scrollOption.distance = _distance = validDistance - currentOffset; - var opts = assign({}, this.opts, { - _scrollDistance_: currentOffset + _distance, - animation: false - }); - this.opts = opts; - drawCharts.call(this, opts.type, opts, this.config, this.context); - return currentOffset + _distance; - } -}; - -uCharts.prototype.scrollEnd = function(e) { - if (this.opts.enableScroll === true) { - var _scrollOption = this.scrollOption, - currentOffset = _scrollOption.currentOffset, - distance = _scrollOption.distance; - this.scrollOption.currentOffset = currentOffset + distance; - this.scrollOption.distance = 0; - this.scrollOption.moveCount = 0; - } -}; - -export default uCharts; \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/qiun-data-charts/js_sdk/u-charts/u-charts.min.js b/sport-erp-admin/uni_modules/qiun-data-charts/js_sdk/u-charts/u-charts.min.js deleted file mode 100644 index 0902ecd..0000000 --- a/sport-erp-admin/uni_modules/qiun-data-charts/js_sdk/u-charts/u-charts.min.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * uCharts (R) - * 高性能跨平台图表库,支持H5、APP、小程序(微信/支付宝/百度/头条/QQ/360/快手)、Vue、Taro等支持canvas的框架平台 - * Copyright (C) 2021 QIUN (R) 秋云 https://www.ucharts.cn All rights reserved. - * Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) - * 复制使用请保留本段注释,感谢支持开源! - * - * uCharts (R) 官方网站 - * https://www.uCharts.cn - * - * 开源地址: - * https://gitee.com/uCharts/uCharts - * - * uni-app插件市场地址: - * http://ext.dcloud.net.cn/plugin?id=271 - * - */ -"use strict";var config={version:"v2.5.0-20230101",yAxisWidth:15,xAxisHeight:22,padding:[10,10,10,10],rotate:false,fontSize:13,fontColor:"#666666",dataPointShape:["circle","circle","circle","circle"],color:["#1890FF","#91CB74","#FAC858","#EE6666","#73C0DE","#3CA272","#FC8452","#9A60B4","#ea7ccc"],linearColor:["#0EE2F8","#2BDCA8","#FA7D8D","#EB88E2","#2AE3A0","#0EE2F8","#EB88E2","#6773E3","#F78A85"],pieChartLinePadding:15,pieChartTextPadding:5,titleFontSize:20,subtitleFontSize:15,radarLabelTextMargin:13};var assign=function(e,...t){if(e==null){throw new TypeError("[uCharts] Cannot convert undefined or null to object")}if(!t||t.length<=0){return e}function i(e,a){for(let t in a){e[t]=e[t]&&e[t].toString()==="[object Object]"?i(e[t],a[t]):e[t]=a[t]}return e}t.forEach(t=>{e=i(e,t)});return e};var util={toFixed:function t(e,a){a=a||2;if(this.isFloat(e)){e=e.toFixed(a)}return e},isFloat:function t(e){return e%1!==0},approximatelyEqual:function t(e,a){return Math.abs(e-a)<1e-10},isSameSign:function t(e,a){return Math.abs(e)===e&&Math.abs(a)===a||Math.abs(e)!==e&&Math.abs(a)!==a},isSameXCoordinateArea:function t(e,a){return this.isSameSign(e.x,a.x)},isCollision:function t(e,a){e.end={};e.end.x=e.start.x+e.width;e.end.y=e.start.y-e.height;a.end={};a.end.x=a.start.x+a.width;a.end.y=a.start.y-a.height;var i=a.start.x>e.end.x||a.end.xe.start.y||a.start.y1){if(r.extra.mount.widthRatio>2)r.extra.mount.widthRatio=2;n+=(r.extra.mount.widthRatio-1)*a.eachSpacing}var l=e;if(e>=0){l=0;t.uevent.trigger("scrollLeft");t.scrollOption.position="left";r.xAxis.scrollPosition="left"}else if(Math.abs(e)>=n-o){l=o-n;t.uevent.trigger("scrollRight");t.scrollOption.position="right";r.xAxis.scrollPosition="right"}else{t.scrollOption.position=e;r.xAxis.scrollPosition=e}return l}function isInAngleRange(t,e,a){function i(t){while(t<0){t+=2*Math.PI}while(t>2*Math.PI){t-=2*Math.PI}return t}t=i(t);e=i(e);a=i(a);if(e>a){a+=2*Math.PI;if(t=e&&t<=a}function createCurveControlPoints(t,e){function a(t,e){if(t[e-1]&&t[e+1]){return t[e].y>=Math.max(t[e-1].y,t[e+1].y)||t[e].y<=Math.min(t[e-1].y,t[e+1].y)}else{return false}}function c(t,e){if(t[e-1]&&t[e+1]){return t[e].x>=Math.max(t[e-1].x,t[e+1].x)||t[e].x<=Math.min(t[e-1].x,t[e+1].x)}else{return false}}var i=.2;var r=.2;var o=null;var n=null;var l=null;var s=null;if(e<1){o=t[0].x+(t[1].x-t[0].x)*i;n=t[0].y+(t[1].y-t[0].y)*i}else{o=t[e].x+(t[e+1].x-t[e-1].x)*i;n=t[e].y+(t[e+1].y-t[e-1].y)*i}if(e>t.length-3){var h=t.length-1;l=t[h].x-(t[h].x-t[h-1].x)*r;s=t[h].y-(t[h].y-t[h-1].y)*r}else{l=t[e+1].x-(t[e+2].x-t[e].x)*r;s=t[e+1].y-(t[e+2].y-t[e].y)*r}if(a(t,e+1)){s=t[e+1].y}if(a(t,e)){n=t[e].y}if(c(t,e+1)){l=t[e+1].x}if(c(t,e)){o=t[e].x}if(n>=Math.max(t[e].y,t[e+1].y)||n<=Math.min(t[e].y,t[e+1].y)){n=t[e].y}if(s>=Math.max(t[e].y,t[e+1].y)||s<=Math.min(t[e].y,t[e+1].y)){s=t[e+1].y}if(o>=Math.max(t[e].x,t[e+1].x)||o<=Math.min(t[e].x,t[e+1].x)){o=t[e].x}if(l>=Math.max(t[e].x,t[e+1].x)||l<=Math.min(t[e].x,t[e+1].x)){l=t[e+1].x}return{ctrA:{x:o,y:n},ctrB:{x:l,y:s}}}function convertCoordinateOrigin(t,e,a){return{x:a.x+t,y:a.y-e}}function avoidCollision(t,e){if(e){while(util.isCollision(t,e)){if(t.start.x>0){t.start.y--}else if(t.start.x<0){t.start.y++}else{if(t.start.y>0){t.start.y++}else{t.start.y--}}}}return t}function fixPieSeries(e,a,t){let i=[];if(e.length>0&&e[0].data.constructor.toString().indexOf("Array")>-1){a._pieSeries_=e;let t=e[0].data;for(var r=0;r=1e4){a=1e3}else if(i>=1e3){a=100}else if(i>=100){a=10}else if(i>=10){a=5}else if(i>=1){a=1}else if(i>=.1){a=.1}else if(i>=.01){a=.01}else if(i>=.001){a=.001}else if(i>=1e-4){a=1e-4}else if(i>=1e-5){a=1e-5}else{a=1e-6}return{minRange:findRange(t,"lower",a),maxRange:findRange(e,"upper",a)}}function measureText(a,t,e){var i=0;a=String(a);e=false;if(e!==false&&e!==undefined&&e.setFontSize&&e.measureText){e.setFontSize(t);return e.measureText(a).width}else{var a=a.split("");for(let e=0;e-1;if(n){let t=filterSeries(e);for(var l=0;l5&&arguments[5]!==undefined?arguments[5]:{};var l=a.chartData.calPoints?a.chartData.calPoints:[];let s={};if(r.length>0){let e=[];for(let t=0;t0){e=o[i]}return{text:n.formatter?n.formatter(t,e,i,a):t.name+": "+t.data,color:t.color,legendShape:a.extra.tooltip.legendShape=="auto"?t.legendShape:a.extra.tooltip.legendShape}});var h={x:Math.round(s.x),y:Math.round(s.y)};return{textList:e,offset:h}}function getMixToolTipData(t,e,a,i){var r=arguments.length>4&&arguments[4]!==undefined?arguments[4]:{};var o=e.chartData.xAxisPoints[a]+e.chartData.eachSpacing/2;var n=t.map(function(t){return{text:r.formatter?r.formatter(t,i[a],a,e):t.name+": "+t.data,color:t.color,disableLegend:t.disableLegend?true:false,legendShape:e.extra.tooltip.legendShape=="auto"?t.legendShape:e.extra.tooltip.legendShape}});n=n.filter(function(t){if(t.disableLegend!==true){return t}});var l={x:Math.round(o),y:0};return{textList:n,offset:l}}function getCandleToolTipData(o,e,n,l,i,t){var r=arguments.length>6&&arguments[6]!==undefined?arguments[6]:{};var a=n.chartData.calPoints;let s=t.color.upFill;let h=t.color.downFill;let c=[s,s,h,s];var d=[];e.map(function(t){if(l==0){if(t.data[1]-t.data[0]<0){c[1]=h}else{c[1]=s}}else{if(t.data[0]o[l-1][1]){c[2]=s}if(t.data[3]4&&arguments[4]!==undefined?arguments[4]:0;var l={index:-1,group:[]};var i=e.chartData.eachSpacing/2;let r=[];if(n&&n.length>0){if(!e.categories){i=0}else{for(let t=1;tt){l.index=e}})}}}return l}function findBarChartCurrentIndex(a,t,e,i){var r=arguments.length>4&&arguments[4]!==undefined?arguments[4]:0;var o={index:-1,group:[]};var n=e.chartData.eachSpacing/2;let l=e.chartData.yAxisPoints;if(t&&t.length>0){if(isInExactChartArea(a,e,i)){l.forEach(function(t,e){if(a.y+r+n>t){o.index=e}})}}return o}function findLegendIndex(o,t,e){let n=-1;let l=0;if(isInExactLegendArea(o,t.area)){let i=t.points;let r=-1;for(let t=0,e=i.length;tt[0]-l&&o.xt[1]-l&&o.ye.start.x&&t.xe.start.y&&t.y=e.area[3]-10&&t.y>=e.area[0]&&t.y<=e.height-e.area[2]}function findRadarChartCurrentIndex(t,e,a){var r=2*Math.PI/a;var o=-1;if(isInExactPieChartArea(t,e.center,e.radius)){var n=function t(e){if(e<0){e+=2*Math.PI}if(e>2*Math.PI){e-=2*Math.PI}return e};var l=Math.atan2(e.center.y-t.y,t.x-e.center.x);l=-1*l;if(l<0){l+=2*Math.PI}var i=e.angleList.map(function(t){t=n(-1*t);return t});i.forEach(function(t,e){var a=n(t-r/2);var i=n(t+r/2);if(i=a&&l<=i||l+2*Math.PI>=a&&l+2*Math.PI<=i){o=e}})}return o}function findFunnelChartCurrentIndex(t,e){var a=-1;for(var i=0,r=e.series.length;io.funnelArea[0]&&t.xo.funnelArea[1]&&t.yo.area[0]&&t.xo.area[1]&&t.ys.width-s.area[1]-s.area[3]){i.push(n);o.push(r-s.legend.itemGap*s.pix);r=e;n=[t]}else{r+=e;n.push(t)}}if(n.length){i.push(n);o.push(r-s.legend.itemGap*s.pix);c.widthArr=o;let t=Math.max.apply(null,o);switch(s.legend.float){case"left":c.area.start.x=s.area[3];c.area.end.x=s.area[3]+t+2*d;break;case"right":c.area.start.x=s.width-s.area[1]-t-2*d;c.area.end.x=s.width-s.area[1];break;default:c.area.start.x=(s.width-t)/2-d;c.area.end.x=(s.width+t)/2+d}c.area.width=t+2*d;c.area.wholeWidth=t+2*d;c.area.height=i.length*u+2*d;c.area.wholeHeight=i.length*u+2*d+2*x;c.points=i}}else{let t=l.length;let e=s.height-s.area[0]-s.area[2]-2*x-2*d;let a=Math.min(Math.floor(e/u),t);c.area.height=a*u+d*2;c.area.wholeHeight=a*u+d*2;switch(s.legend.float){case"top":c.area.start.y=s.area[0]+x;c.area.end.y=s.area[0]+x+c.area.height;break;case"bottom":c.area.start.y=s.height-s.area[2]-x-c.area.height;c.area.end.y=s.height-s.area[2]-x;break;default:c.area.start.y=(s.height-c.area.height)/2;c.area.end.y=(s.height+c.area.height)/2}let i=t%a===0?t/a:Math.floor(t/a+1);let r=[];for(let e=0;ei){i=t}}c.widthArr.push(i);c.heightArr.push(a.length*u+d*2)}let e=0;for(let t=0;t4&&arguments[4]!==undefined?arguments[4]:-1;var i;if(c=="stack"){i=dataCombineStack(t,e.categories.length)}else{i=dataCombine(t)}var r=[];i=i.filter(function(t){if(typeof t==="object"&&t!==null){if(t.constructor.toString().indexOf("Array")>-1){return t!==null}else{return t.value!==null}}else{return t!==null}});i.map(function(t){if(typeof t==="object"){if(t.constructor.toString().indexOf("Array")>-1){if(e.type=="candle"){t.map(function(t){r.push(t)})}else{r.push(t[0])}}else{r.push(t.value)}}else{r.push(t)}});var o=0;var n=0;if(r.length>0){o=Math.min.apply(this,r);n=Math.max.apply(this,r)}if(a>-1){if(typeof e.xAxis.data[a].min==="number"){o=Math.min(e.xAxis.data[a].min,o)}if(typeof e.xAxis.data[a].max==="number"){n=Math.max(e.xAxis.data[a].max,n)}}else{if(typeof e.xAxis.min==="number"){o=Math.min(e.xAxis.min,o)}if(typeof e.xAxis.max==="number"){n=Math.max(e.xAxis.max,n)}}if(o===n){var d=n||10;n+=d}var l=o;var x=n;var f=[];var p=(x-l)/e.xAxis.splitNumber;for(var s=0;s<=e.xAxis.splitNumber;s++){f.push(l+p*s)}return f}function calXAxisData(t,e,a,i){var r=assign({},{type:""},e.extra.bar);var o={angle:0,xAxisHeight:e.xAxis.lineHeight*e.pix+e.xAxis.marginTop*e.pix};o.ranges=getXAxisTextList(t,e,a,r.type);o.rangesFormat=o.ranges.map(function(t){t=util.toFixed(t,2);return t});var n=o.ranges.map(function(t){t=util.toFixed(t,2);return t});o=Object.assign(o,getXAxisPoints(n,e,a));var l=o.eachSpacing;var s=n.map(function(t){return measureText(t,e.xAxis.fontSize*e.pix,i)});if(e.xAxis.disabled===true){o.xAxisHeight=0}return o}function getRadarDataPoints(r,o,n,a,t){var l=arguments.length>5&&arguments[5]!==undefined?arguments[5]:1;var e=t.extra.radar||{};e.max=e.max||0;var s=Math.max(e.max,Math.max.apply(null,dataCombine(a)));var h=[];for(let e=0;e2&&arguments[2]!==undefined?arguments[2]:1;var o=0;var n=0;for(let e=0;e4&&arguments[4]!==undefined?arguments[4]:1;for(let t=0;t4&&arguments[4]!==undefined?arguments[4]:1;var l=0;var s=0;var h=[];for(let e=0;e2&&arguments[2]!==undefined?arguments[2]:1;if(o==1){o=.999999}for(let a=0;a=2){t._proportion_=t._proportion_%2}}return i}function getGaugeArcbarDataPoints(i,r){var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;if(o==1){o=.999999}for(let a=0;a=2){t._proportion_=t._proportion_%2}}return i}function getGaugeAxisPoints(e,a,t){let i;if(t=2){e[t]._endAngle_=e[t]._endAngle_%2}r=e[t]._endAngle_}return e}function getGaugeDataPoints(i,r,o){let n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:1;for(let a=0;a=o.oldData){e._proportion_=(e._endAngle_-e._oldAngle_)*n+o.oldAngle}else{e._proportion_=e._oldAngle_-(e._oldAngle_-e._endAngle_)*n}if(e._proportion_>=2){e._proportion_=e._proportion_%2}}return i}function getPieTextMaxLength(i,r,o,n){i=getPieDataPoints(i);let l=0;for(let a=0;a0){t.width=Math.min(t.width,+n.extra.mix.column.width*n.pix)}if(n.extra.column&&n.extra.column.width&&+n.extra.column.width>0){t.width=Math.min(t.width,+n.extra.column.width*n.pix)}if(t.width<=0){t.width=1}t.x+=(o+.5-r/2)*(t.width+e);return t})}function fixBarData(t,i,r,o,e,n){return t.map(function(t){if(t===null){return null}var e=0;var a=0;e=n.extra.bar.seriesGap*n.pix||0;a=n.extra.bar.categoryGap*n.pix||0;e=Math.min(e,i/r);a=Math.min(a,i/r);t.width=Math.ceil((i-2*a-e*(r-1))/r);if(n.extra.bar&&n.extra.bar.width&&+n.extra.bar.width>0){t.width=Math.min(t.width,+n.extra.bar.width*n.pix)}if(t.width<=0){t.width=1}t.y+=(o+.5-r/2)*(t.width+e);return t})}function fixColumeMeterData(t,e,a,i,r,o,n){var l=o.extra.column.categoryGap*o.pix||0;return t.map(function(t){if(t===null){return null}t.width=e-2*l;if(o.extra.column&&o.extra.column.width&&+o.extra.column.width>0){t.width=Math.min(t.width,+o.extra.column.width*o.pix)}if(i>0){t.width-=n}return t})}function fixColumeStackData(t,a,e,i,r,o,n){var l=o.extra.column.categoryGap*o.pix||0;return t.map(function(t,e){if(t===null){return null}t.width=Math.ceil(a-2*l);if(o.extra.column&&o.extra.column.width&&+o.extra.column.width>0){t.width=Math.min(t.width,+o.extra.column.width*o.pix)}if(t.width<=0){t.width=1}return t})}function fixBarStackData(t,a,e,i,r,o,n){var l=o.extra.bar.categoryGap*o.pix||0;return t.map(function(t,e){if(t===null){return null}t.width=Math.ceil(a-2*l);if(o.extra.bar&&o.extra.bar.width&&+o.extra.bar.width>0){t.width=Math.min(t.width,+o.extra.bar.width*o.pix)}if(t.width<=0){t.width=1}return t})}function getXAxisPoints(t,e,h){var a=e.width-e.area[1]-e.area[3];var i=e.enableScroll?Math.min(e.xAxis.itemCount,t.length):t.length;if((e.type=="line"||e.type=="area"||e.type=="scatter"||e.type=="bubble"||e.type=="bar")&&i>1&&e.xAxis.boundaryGap=="justify"){i-=1}var r=0;if(e.type=="mount"&&e.extra&&e.extra.mount&&e.extra.mount.widthRatio&&e.extra.mount.widthRatio>1){if(e.extra.mount.widthRatio>2)e.extra.mount.widthRatio=2;r=e.extra.mount.widthRatio-1;i+=r}var o=a/i;var n=[];var l=e.area[3];var s=e.width-e.area[1];t.forEach(function(t,e){n.push(l+r/2*o+e*o)});if(e.xAxis.boundaryGap!=="justify"){if(e.enableScroll===true){n.push(l+r*o+t.length*o)}else{n.push(s)}}return{xAxisPoints:n,startX:l,endX:s,eachSpacing:o}}function getCandleDataPoints(t,l,s,h,c,d,a){var x=arguments.length>7&&arguments[7]!==undefined?arguments[7]:1;var e=[];var f=d.height-d.area[0]-d.area[2];t.forEach(function(t,o){if(t===null){e.push(null)}else{var n=[];t.forEach(function(t,e){var a={};a.x=h[o]+Math.round(c/2);var i=t.value||t;var r=f*(i-l)/(s-l);r*=x;a.y=d.height-Math.round(r)-d.area[2];n.push(a)});e.push(n)}});return e}function getDataPoints(t,a,n,l,s,h,e){var c=arguments.length>7&&arguments[7]!==undefined?arguments[7]:1;var d="center";if(h.type=="line"||h.type=="area"||h.type=="scatter"||h.type=="bubble"){d=h.xAxis.boundaryGap}var x=[];var f=h.height-h.area[0]-h.area[2];var p=h.width-h.area[1]-h.area[3];t.forEach(function(i,t){if(i===null){x.push(null)}else{var r={};r.color=i.color;r.x=l[t];var o=i;if(typeof i==="object"&&i!==null){if(i.constructor.toString().indexOf("Array")>-1){let t,e,a;t=[].concat(h.chartData.xAxisData.ranges);e=t.shift();a=t.pop();o=i[1];r.x=h.area[3]+p*(i[0]-e)/(a-e);if(h.type=="bubble"){r.r=i[2];r.t=i[3]}}else{o=i.value}}if(d=="center"){r.x+=s/2}var e=f*(o-a)/(n-a);e*=c;r.y=h.height-e-h.area[2];x.push(r)}});return x}function getLineDataPoints(t,a,n,l,s,h,e,p,c){var c=arguments.length>8&&arguments[8]!==undefined?arguments[8]:1;var d=h.xAxis.boundaryGap;var x=[];var f=h.height-h.area[0]-h.area[2];var u=h.width-h.area[1]-h.area[3];t.forEach(function(i,t){if(i===null){x.push(null)}else{var r={};r.color=i.color;if(p.animation=="vertical"){r.x=l[t];var o=i;if(typeof i==="object"&&i!==null){if(i.constructor.toString().indexOf("Array")>-1){let t,e,a;t=[].concat(h.chartData.xAxisData.ranges);e=t.shift();a=t.pop();o=i[1];r.x=h.area[3]+u*(i[0]-e)/(a-e)}else{o=i.value}}if(d=="center"){r.x+=s/2}var e=f*(o-a)/(n-a);e*=c;r.y=h.height-e-h.area[2];x.push(r)}else{r.x=l[0]+s*t*c;var o=i;if(d=="center"){r.x+=s/2}var e=f*(o-a)/(n-a);r.y=h.height-e-h.area[2];x.push(r)}}});return x}function getColumnDataPoints(t,a,n,l,s,h,e,i,c){var c=arguments.length>8&&arguments[8]!==undefined?arguments[8]:1;var d=[];var x=h.height-h.area[0]-h.area[2];var f=h.width-h.area[1]-h.area[3];t.forEach(function(i,t){if(i===null){d.push(null)}else{var r={};r.color=i.color;r.x=l[t];var o=i;if(typeof i==="object"&&i!==null){if(i.constructor.toString().indexOf("Array")>-1){let t,e,a;t=[].concat(h.chartData.xAxisData.ranges);e=t.shift();a=t.pop();o=i[1];r.x=h.area[3]+f*(i[0]-e)/(a-e)}else{o=i.value}}r.x+=s/2;var e=x*(o*c-a)/(n-a);r.y=h.height-e-h.area[2];d.push(r)}});return d}function getMountDataPoints(t,o,n,l,s,h,e,a){var c=arguments.length>8&&arguments[8]!==undefined?arguments[8]:1;var d=[];var x=h.height-h.area[0]-h.area[2];var i=h.width-h.area[1]-h.area[3];var f=s*e.widthRatio;t.forEach(function(t,e){if(t===null){d.push(null)}else{var a={};a.color=t.color;a.x=l[e];a.x+=s/2;var i=t.data;var r=x*(i*c-o)/(n-o);a.y=h.height-r-h.area[2];a.value=i;a.width=f;d.push(a)}});return d}function getBarDataPoints(t,o,n,l,e,s,a){var h=arguments.length>7&&arguments[7]!==undefined?arguments[7]:1;var c=[];var i=s.height-s.area[0]-s.area[2];var d=s.width-s.area[1]-s.area[3];t.forEach(function(t,e){if(t===null){c.push(null)}else{var a={};a.color=t.color;a.y=l[e];var i=t;if(typeof t==="object"&&t!==null){i=t.value}var r=d*(i-o)/(n-o);r*=h;a.height=r;a.value=i;a.x=r+s.area[3];c.push(a)}});return c}function getStackDataPoints(t,s,h,c,g,d,e,x,y){var f=arguments.length>9&&arguments[9]!==undefined?arguments[9]:1;var p=[];var u=d.height-d.area[0]-d.area[2];t.forEach(function(t,e){if(t===null){p.push(null)}else{var a={};a.color=t.color;a.x=c[e]+Math.round(g/2);if(x>0){var i=0;for(let t=0;t<=x;t++){i+=y[t].data[e]}var r=i-t;var o=u*(i-s)/(h-s);var n=u*(r-s)/(h-s)}else{var i=t;if(typeof t==="object"&&t!==null){i=t.value}var o=u*(i-s)/(h-s);var n=0}var l=n;o*=f;l*=f;a.y=d.height-Math.round(o)-d.area[2];a.y0=d.height-Math.round(l)-d.area[2];p.push(a)}});return p}function getBarStackDataPoints(t,s,h,c,e,d,a,x,g){var f=arguments.length>9&&arguments[9]!==undefined?arguments[9]:1;var p=[];var u=d.width-d.area[1]-d.area[3];t.forEach(function(t,e){if(t===null){p.push(null)}else{var a={};a.color=t.color;a.y=c[e];if(x>0){var i=0;for(let t=0;t<=x;t++){i+=g[t].data[e]}var r=i-t;var o=u*(i-s)/(h-s);var n=u*(r-s)/(h-s)}else{var i=t;if(typeof t==="object"&&t!==null){i=t.value}var o=u*(i-s)/(h-s);var n=0}var l=n;o*=f;l*=f;a.height=o-l;a.x=d.area[3]+o;a.x0=d.area[3]+l;p.push(a)}});return p}function getYAxisTextList(t,e,h,c,a){var d=arguments.length>5&&arguments[5]!==undefined?arguments[5]:-1;var i;if(c=="stack"){i=dataCombineStack(t,e.categories.length)}else{i=dataCombine(t)}var r=[];i=i.filter(function(t){if(typeof t==="object"&&t!==null){if(t.constructor.toString().indexOf("Array")>-1){return t!==null}else{return t.value!==null}}else{return t!==null}});i.map(function(t){if(typeof t==="object"){if(t.constructor.toString().indexOf("Array")>-1){if(e.type=="candle"){t.map(function(t){r.push(t)})}else{r.push(t[1])}}else{r.push(t.value)}}else{r.push(t)}});var o=a.min||0;var n=a.max||0;if(r.length>0){o=Math.min.apply(this,r);n=Math.max.apply(this,r)}if(o===n){if(n==0){n=10}else{o=0}}var l=getDataRange(o,n);var x=a.min===undefined||a.min===null?l.minRange:a.min;var f=a.max===undefined||a.max===null?l.maxRange:a.max;var p=(f-x)/e.yAxis.splitNumber;var u=[];for(var s=0;s<=e.yAxis.splitNumber;s++){u.push(x+p*s)}return u.reverse()}function calYAxisData(a,o,e,n){var l=assign({},{type:""},o.extra.column);var t=o.yAxis.data.length;var s=new Array(t);if(t>0){for(let e=0;e{return t+(i.unit||"")}}i.categories=i.categories||o.categories;h[r]=i.categories}else{if(!i.formatter){i.formatter=(t,e,a)=>{return util.toFixed(t,i.tofix||0)+(i.unit||"")}}h[r]=getYAxisTextList(s[r],o,e,l.type,i,r)}let a=i.fontSize*o.pix||e.fontSize;d[r]={position:i.position?i.position:"left",width:0};c[r]=h[r].map(function(t,e){t=i.formatter(t,e,o);d[r].width=Math.max(d[r].width,measureText(t,a,n)+5);return t});let t=i.calibration?4*o.pix:0;d[r].width+=t+3*o.pix;if(i.disabled===true){d[r].width=0}}}else{var h=new Array(1);var c=new Array(1);var d=new Array(1);if(o.type==="bar"){h[0]=o.categories;if(!o.yAxis.formatter){o.yAxis.formatter=(t,e,a)=>{return t+(a.yAxis.unit||"")}}}else{if(!o.yAxis.formatter){o.yAxis.formatter=(t,e,a)=>{return t.toFixed(a.yAxis.tofix)+(a.yAxis.unit||"")}}h[0]=getYAxisTextList(a,o,e,l.type,{})}d[0]={position:"left",width:0};var i=o.yAxis.fontSize*o.pix||e.fontSize;c[0]=h[0].map(function(t,e){t=o.yAxis.formatter(t,e,o);d[0].width=Math.max(d[0].width,measureText(t,i,n)+5);return t});d[0].width+=3*o.pix;if(o.yAxis.disabled===true){d[0]={position:"left",width:0};o.yAxis.data[0]={disabled:true}}else{o.yAxis.data[0]={disabled:false,position:"left",max:o.yAxis.max,min:o.yAxis.min,formatter:o.yAxis.formatter};if(o.type==="bar"){o.yAxis.data[0].categories=o.categories;o.yAxis.data[0].type="categories"}}}return{rangesFormat:c,ranges:h,yAxisWidth:d}}function calTooltipYAxisData(r,t,o,e,a){let n=[].concat(o.chartData.yAxisData.ranges);let l=o.height-o.area[0]-o.area[2];let s=o.area[0];let h=[];for(let i=0;i0&&r.tooltip.group.includes(n)==false){return}var l=typeof r.tooltip.index==="number"?r.tooltip.index:r.tooltip.index[r.tooltip.group.indexOf(n)];i.beginPath();if(o.activeType=="hollow"){i.setStrokeStyle(e);i.setFillStyle(r.background);i.setLineWidth(2*r.pix)}else{i.setStrokeStyle("#ffffff");i.setFillStyle(e);i.setLineWidth(1*r.pix)}if(a==="diamond"){t.forEach(function(t,e){if(t!==null&&l==e){i.moveTo(t.x,t.y-4.5);i.lineTo(t.x-4.5,t.y);i.lineTo(t.x,t.y+4.5);i.lineTo(t.x+4.5,t.y);i.lineTo(t.x,t.y-4.5)}})}else if(a==="circle"){t.forEach(function(t,e){if(t!==null&&l==e){i.moveTo(t.x+2.5*r.pix,t.y);i.arc(t.x,t.y,3*r.pix,0,2*Math.PI,false)}})}else if(a==="square"){t.forEach(function(t,e){if(t!==null&&l==e){i.moveTo(t.x-3.5,t.y-3.5);i.rect(t.x-3.5,t.y-3.5,7,7)}})}else if(a==="triangle"){t.forEach(function(t,e){if(t!==null&&l==e){i.moveTo(t.x,t.y-4.5);i.lineTo(t.x-4.5,t.y+4.5);i.lineTo(t.x+4.5,t.y+4.5);i.lineTo(t.x,t.y-4.5)}})}else if(a==="none"){return}i.closePath();i.fill();i.stroke()}function drawRingTitle(t,e,a,i){var r=t.title.fontSize||e.titleFontSize;var o=t.subtitle.fontSize||e.subtitleFontSize;var n=t.title.name||"";var l=t.subtitle.name||"";var c=t.title.color||t.fontColor;var d=t.subtitle.color||t.fontColor;var x=n?r:0;var f=l?o:0;var s=5;if(l){var p=measureText(l,o*t.pix,a);var u=i.x-p/2+(t.subtitle.offsetX||0)*t.pix;var h=i.y+o*t.pix/2+(t.subtitle.offsetY||0)*t.pix;if(n){h+=(x*t.pix+s)/2}a.beginPath();a.setFontSize(o*t.pix);a.setFillStyle(d);a.fillText(l,u,h);a.closePath();a.stroke()}if(n){var g=measureText(n,r*t.pix,a);var y=i.x-g/2+(t.title.offsetX||0);var v=i.y+r*t.pix/2+(t.title.offsetY||0)*t.pix;if(l){v-=(f*t.pix+s)/2}a.beginPath();a.setFontSize(r*t.pix);a.setFillStyle(c);a.fillText(n,y,v);a.closePath();a.stroke()}}function drawPointText(t,o,n,l,s){var h=o.data;var c=o.textOffset?o.textOffset:0;t.forEach(function(t,e){if(t!==null){l.beginPath();var a=o.textSize?o.textSize*s.pix:n.fontSize;l.setFontSize(a);l.setFillStyle(o.textColor||s.fontColor);var i=h[e];if(typeof h[e]==="object"&&h[e]!==null){if(h[e].constructor.toString().indexOf("Array")>-1){i=h[e][1]}else{i=h[e].value}}var r=o.formatter?o.formatter(i,e,o,s):i;l.setTextAlign("center");l.fillText(String(r),t.x,t.y-4+c*s.pix);l.closePath();l.stroke();l.setTextAlign("left")}})}function drawColumePointText(t,n,l,s,h){var c=n.data;var d=n.textOffset?n.textOffset:0;var x=h.extra.column.labelPosition;t.forEach(function(t,e){if(t!==null){s.beginPath();var a=n.textSize?n.textSize*h.pix:l.fontSize;s.setFontSize(a);s.setFillStyle(n.textColor||h.fontColor);var i=c[e];if(typeof c[e]==="object"&&c[e]!==null){if(c[e].constructor.toString().indexOf("Array")>-1){i=c[e][1]}else{i=c[e].value}}var r=n.formatter?n.formatter(i,e,n,h):i;s.setTextAlign("center");var o=t.y-4*h.pix+d*h.pix;if(t.y>n.zeroPoints){o=t.y+d*h.pix+a}if(x=="insideTop"){o=t.y+a+d*h.pix;if(t.y>n.zeroPoints){o=t.y-d*h.pix-4*h.pix}}if(x=="center"){o=t.y+d*h.pix+(h.height-h.area[2]-t.y+a)/2;if(n.zeroPointsn.zeroPoints){o=t.y-d*h.pix-(t.y-n.zeroPoints-a)/2}if(h.extra.column.type=="stack"){o=t.y+d*h.pix+(t.y0-t.y+a)/2}}if(x=="bottom"){o=h.height-h.area[2]+d*h.pix-4*h.pix;if(n.zeroPointsn.zeroPoints){o=n.zeroPoints-d*h.pix+a+2*h.pix}if(h.extra.column.type=="stack"){o=t.y0+d*h.pix-4*h.pix}}s.fillText(String(r),t.x,o);s.closePath();s.stroke();s.setTextAlign("left")}})}function drawMountPointText(t,n,l,s,h,c){var e=n.data;var d=n.textOffset?n.textOffset:0;var a=h.extra.mount.labelPosition;t.forEach(function(t,e){if(t!==null){s.beginPath();var a=n[e].textSize?n[e].textSize*h.pix:l.fontSize;s.setFontSize(a);s.setFillStyle(n[e].textColor||h.fontColor);var i=t.value;var r=n[e].formatter?n[e].formatter(i,e,n,h):i;s.setTextAlign("center");var o=t.y-4*h.pix+d*h.pix;if(t.y>c){o=t.y+d*h.pix+a}s.fillText(String(r),t.x,o);s.closePath();s.stroke();s.setTextAlign("left")}})}function drawBarPointText(t,o,n,l,s){var h=o.data;var e=o.textOffset?o.textOffset:0;t.forEach(function(t,e){if(t!==null){l.beginPath();var a=o.textSize?o.textSize*s.pix:n.fontSize;l.setFontSize(a);l.setFillStyle(o.textColor||s.fontColor);var i=h[e];if(typeof h[e]==="object"&&h[e]!==null){i=h[e].value}var r=o.formatter?o.formatter(i,e,o,s):i;l.setTextAlign("left");l.fillText(String(r),t.x+4*s.pix,t.y+a/2-3);l.closePath();l.stroke()}})}function drawGaugeLabel(e,a,i,r,o,n){a-=e.width/2+e.labelOffset*r.pix;a=a<10?10:a;let t;if(e.endAngle=2){l=l%2}s+=x}}function drawRadarLabel(t,s,h,c,d,x){var f=c.extra.radar||{};t.forEach(function(t,e){if(f.labelPointShow===true&&c.categories[e]!==""){var a={x:s*Math.cos(t),y:s*Math.sin(t)};var i=convertCoordinateOrigin(a.x,a.y,h);x.setFillStyle(f.labelPointColor);x.beginPath();x.arc(i.x,i.y,f.labelPointRadius*c.pix,0,2*Math.PI,false);x.closePath();x.fill()}if(f.labelShow===true){var r={x:(s+d.radarLabelTextMargin*c.pix)*Math.cos(t),y:(s+d.radarLabelTextMargin*c.pix)*Math.sin(t)};var o=convertCoordinateOrigin(r.x,r.y,h);var n=o.x;var l=o.y;if(util.approximatelyEqual(r.x,0)){n-=measureText(c.categories[e]||"",d.fontSize,x)/2}else if(r.x<0){n-=measureText(c.categories[e]||"",d.fontSize,x)}x.beginPath();x.setFontSize(d.fontSize);x.setFillStyle(f.labelColor||c.fontColor);x.fillText(c.categories[e]||"",n,l+d.fontSize/2);x.closePath();x.stroke()}})}function drawPieText(n,d,x,f,t,l){var p=x.pieChartLinePadding;var u=[];var g=null;var y=n.map(function(t,e){var a=t.formatter?t.formatter(t,e,n,d):util.toFixed(t._proportion_.toFixed(4)*100)+"%";a=t.labelText?t.labelText:a;var i=2*Math.PI-(t._start_+2*Math.PI*t._proportion_/2);if(t._rose_proportion_){i=2*Math.PI-(t._start_+2*Math.PI*t._rose_proportion_/2)}var r=t.color;var o=t._radius_;return{arc:i,text:a,color:r,radius:o,textColor:t.textColor,textSize:t.textSize,labelShow:t.labelShow}});for(let c=0;c=0?e+x.pieChartTextPadding:e-x.pieChartTextPadding;let n=a;let l=measureText(t.text,t.textSize*d.pix||x.fontSize,f);let s=n;if(g&&util.isSameXCoordinateArea(g.start,{x:o})){if(o>0){s=Math.min(n,g.start.y)}else if(e<0){s=Math.max(n,g.start.y)}else{if(n>0){s=Math.max(n,g.start.y)}else{s=Math.min(n,g.start.y)}}}if(o<0){o-=l}let h={lineStart:{x:i,y:r},lineEnd:{x:e,y:a},start:{x:o,y:s},width:l,height:x.fontSize,text:t.text,color:t.color,textColor:t.textColor,textSize:t.textSize};g=avoidCollision(h,g);u.push(g)}for(let n=0;nr?r:o.activeWidth;var n=e.area[0];var l=e.height-e.area[2];i.beginPath();i.setFillStyle(hexToRgb(o.activeBgColor,o.activeBgOpacity));i.rect(t-o.activeWidth/2,n,o.activeWidth,l-n);i.closePath();i.fill();i.setFillStyle("#FFFFFF")}function drawBarToolTipSplitArea(t,e,a,i,r){var o=assign({},{activeBgColor:"#000000",activeBgOpacity:.08},e.extra.bar);var n=e.area[3];var l=e.width-e.area[1];i.beginPath();i.setFillStyle(hexToRgb(o.activeBgColor,o.activeBgOpacity));i.rect(n,t-r/2,l-n,r);i.closePath();i.fill();i.setFillStyle("#FFFFFF")}function drawToolTip(e,r,o,a,n,i,f){var l=assign({},{showBox:true,showArrow:true,showCategory:false,bgColor:"#000000",bgOpacity:.7,borderColor:"#000000",borderWidth:0,borderRadius:0,borderOpacity:.7,boxPadding:3,fontColor:"#FFFFFF",fontSize:13,lineHeight:20,legendShow:true,legendShape:"auto",splitLine:true},o.extra.tooltip);if(l.showCategory==true&&o.categories){e.unshift({text:o.categories[o.tooltip.index],color:null})}var s=l.fontSize*o.pix;var p=l.lineHeight*o.pix;var h=l.boxPadding*o.pix;var c=s;var u=5*o.pix;if(l.legendShow==false){c=0;u=0}var d=l.showArrow?8*o.pix:0;var g=false;if(o.type=="line"||o.type=="mount"||o.type=="area"||o.type=="candle"||o.type=="mix"){if(l.splitLine==true){drawToolTipSplitLine(o.tooltip.offset.x,o,a,n)}}r=assign({x:0,y:0},r);r.y-=8*o.pix;var y=e.map(function(t){return measureText(t.text,s,n)});var x=c+u+4*h+Math.max.apply(null,y);var v=2*h+e.length*p;if(l.showBox==false){return}if(r.x-Math.abs(o._scrollDistance_||0)+d+x>o.width){g=true}if(v+r.y>o.height){r.y=o.height-v}n.beginPath();n.setFillStyle(hexToRgb(l.bgColor,l.bgOpacity));n.setLineWidth(l.borderWidth*o.pix);n.setStrokeStyle(hexToRgb(l.borderColor,l.borderOpacity));var t=l.borderRadius;if(g){if(x+d>o.width){r.x=o.width+Math.abs(o._scrollDistance_||0)+d+(x-o.width)}if(x>r.x){r.x=o.width+Math.abs(o._scrollDistance_||0)+d+(x-o.width)}if(l.showArrow){n.moveTo(r.x,r.y+10*o.pix);n.lineTo(r.x-d,r.y+10*o.pix+5*o.pix)}n.arc(r.x-d-t,r.y+v-t,t,0,Math.PI/2,false);n.arc(r.x-d-Math.round(x)+t,r.y+v-t,t,Math.PI/2,Math.PI,false);n.arc(r.x-d-Math.round(x)+t,r.y+t,t,-Math.PI,-Math.PI/2,false);n.arc(r.x-d-t,r.y+t,t,-Math.PI/2,0,false);if(l.showArrow){n.lineTo(r.x-d,r.y+10*o.pix-5*o.pix);n.lineTo(r.x,r.y+10*o.pix)}}else{if(l.showArrow){n.moveTo(r.x,r.y+10*o.pix);n.lineTo(r.x+d,r.y+10*o.pix-5*o.pix)}n.arc(r.x+d+t,r.y+t,t,-Math.PI,-Math.PI/2,false);n.arc(r.x+d+Math.round(x)-t,r.y+t,t,-Math.PI/2,0,false);n.arc(r.x+d+Math.round(x)-t,r.y+v-t,t,0,Math.PI/2,false);n.arc(r.x+d+t,r.y+v-t,t,Math.PI/2,Math.PI,false);if(l.showArrow){n.lineTo(r.x+d,r.y+10*o.pix+5*o.pix);n.lineTo(r.x,r.y+10*o.pix)}}n.closePath();n.fill();if(l.borderWidth>0){n.stroke()}if(l.legendShow){e.forEach(function(t,e){if(t.color!==null){n.beginPath();n.setFillStyle(t.color);var a=r.x+d+2*h;var i=r.y+(p-s)/2+p*e+h+1;if(g){a=r.x-x-d+2*h}switch(t.legendShape){case"line":n.moveTo(a,i+.5*c-2*o.pix);n.fillRect(a,i+.5*c-2*o.pix,c,4*o.pix);break;case"triangle":n.moveTo(a+7.5*o.pix,i+.5*c-5*o.pix);n.lineTo(a+2.5*o.pix,i+.5*c+5*o.pix);n.lineTo(a+12.5*o.pix,i+.5*c+5*o.pix);n.lineTo(a+7.5*o.pix,i+.5*c-5*o.pix);break;case"diamond":n.moveTo(a+7.5*o.pix,i+.5*c-5*o.pix);n.lineTo(a+2.5*o.pix,i+.5*c);n.lineTo(a+7.5*o.pix,i+.5*c+5*o.pix);n.lineTo(a+12.5*o.pix,i+.5*c);n.lineTo(a+7.5*o.pix,i+.5*c-5*o.pix);break;case"circle":n.moveTo(a+7.5*o.pix,i+.5*c);n.arc(a+7.5*o.pix,i+.5*c,5*o.pix,0,2*Math.PI);break;case"rect":n.moveTo(a,i+.5*c-5*o.pix);n.fillRect(a,i+.5*c-5*o.pix,15*o.pix,10*o.pix);break;case"square":n.moveTo(a+2*o.pix,i+.5*c-5*o.pix);n.fillRect(a+2*o.pix,i+.5*c-5*o.pix,10*o.pix,10*o.pix);break;default:n.moveTo(a,i+.5*c-5*o.pix);n.fillRect(a,i+.5*c-5*o.pix,15*o.pix,10*o.pix)}n.closePath();n.fill()}})}e.forEach(function(t,e){var a=r.x+d+2*h+c+u;if(g){a=r.x-x-d+2*h+c+u}var i=r.y+p*e+(p-s)/2-1+h+s;n.beginPath();n.setFontSize(s);n.setTextBaseline("normal");n.setFillStyle(l.fontColor);n.fillText(t.text,a,i);n.closePath();n.stroke()})}function drawColumnDataPoints(T,b,S,w){let A=arguments.length>4&&arguments[4]!==undefined?arguments[4]:1;let t=b.chartData.xAxisData,P=t.xAxisPoints,C=t.eachSpacing;let D=assign({},{type:"group",width:C/2,meterBorder:4,meterFillColor:"#FFFFFF",barBorderCircle:false,barBorderRadius:[],seriesGap:2,linearType:"none",linearOpacity:1,customColor:[],colorStop:0,labelPosition:"outside"},b.extra.column);let M=[];w.save();let L=-2;let F=P.length+2;if(b._scrollDistance_&&b._scrollDistance_!==0&&b.enableScroll===true){w.translate(b._scrollDistance_,0);L=Math.floor(-b._scrollDistance_/C)-2;F=L+b.xAxis.itemCount+4}if(b.tooltip&&b.tooltip.textList&&b.tooltip.textList.length&&A===1){drawToolTipSplitArea(b.tooltip.offset.x,b,S,w,C)}D.customColor=fillCustomColor(D.linearType,D.customColor,T,S);T.forEach(function(a,i){let e,t,o;e=[].concat(b.chartData.yAxisData.ranges[a.index]);t=e.pop();o=e.shift();let x=b.height-b.area[0]-b.area[2];let f=x*(0-t)/(o-t);let n=b.height-Math.round(f)-b.area[2];a.zeroPoints=n;var p=a.data;switch(D.type){case"group":var r=getColumnDataPoints(p,t,o,P,C,b,S,n,A);var u=getStackDataPoints(p,t,o,P,C,b,S,i,T,A);M.push(u);r=fixColumeData(r,C,T.length,i,S,b);for(let t=0;tL&&tn?n:o.y;const d=o.width;const s=Math.abs(n-o.y);if(D.barBorderCircle){D.barBorderRadius=[d/2,d/2,0,0]}if(o.y>n){D.barBorderRadius=[0,0,d/2,d/2]}let[t,e,a,i]=D.barBorderRadius;let r=Math.min(d/2,s/2);t=t>r?r:t;e=e>r?r:e;a=a>r?r:a;i=i>r?r:i;t=t<0?0:t;e=e<0?0:e;a=a<0?0:a;i=i<0?0:i;w.arc(h+t,c+t,t,-Math.PI,-Math.PI/2);w.arc(h+d-e,c+e,e,-Math.PI/2,0);w.arc(h+d-a,c+s-a,a,0,Math.PI/2);w.arc(h+i,c+s-i,i,Math.PI/2,Math.PI)}else{w.moveTo(l,o.y);w.lineTo(l+o.width,o.y);w.lineTo(l+o.width,n);w.lineTo(l,n);w.lineTo(l,o.y);w.setLineWidth(1);w.setStrokeStyle(y)}w.setFillStyle(g);w.closePath();w.fill()}};break;case"stack":var r=getStackDataPoints(p,t,o,P,C,b,S,i,T,A);M.push(r);r=fixColumeStackData(r,C,T.length,i,S,b,T);for(let e=0;eL&&e0){s-=m}w.setFillStyle(g);w.moveTo(l,t.y);w.fillRect(l,t.y,t.width,s);w.closePath();w.fill()}};break;case"meter":var r=getDataPoints(p,t,o,P,C,b,S,A);M.push(r);r=fixColumeMeterData(r,C,T.length,i,S,b,D.meterBorder);for(let t=0;tL&&t0){w.setStrokeStyle(a.color);w.setLineWidth(D.meterBorder*b.pix)}if(i==0){w.setFillStyle(D.meterFillColor)}else{w.setFillStyle(o.color||a.color)}var l=o.x-o.width/2;var s=b.height-o.y-b.area[2];if(D.barBorderRadius&&D.barBorderRadius.length===4||D.barBorderCircle===true){const h=l;const c=o.y;const d=o.width;const s=n-o.y;if(D.barBorderCircle){D.barBorderRadius=[d/2,d/2,0,0]}let[t,e,a,i]=D.barBorderRadius;let r=Math.min(d/2,s/2);t=t>r?r:t;e=e>r?r:e;a=a>r?r:a;i=i>r?r:i;t=t<0?0:t;e=e<0?0:e;a=a<0?0:a;i=i<0?0:i;w.arc(h+t,c+t,t,-Math.PI,-Math.PI/2);w.arc(h+d-e,c+e,e,-Math.PI/2,0);w.arc(h+d-a,c+s-a,a,0,Math.PI/2);w.arc(h+i,c+s-i,i,Math.PI/2,Math.PI);w.fill()}else{w.moveTo(l,o.y);w.lineTo(l+o.width,o.y);w.lineTo(l+o.width,n);w.lineTo(l,n);w.lineTo(l,o.y);w.fill()}if(i==0&&D.meterBorder>0){w.closePath();w.stroke()}}}break}});if(b.dataLabel!==false&&A===1){T.forEach(function(t,e){let a,i,r;a=[].concat(b.chartData.yAxisData.ranges[t.index]);i=a.pop();r=a.shift();var o=t.data;switch(D.type){case"group":var n=getColumnDataPoints(o,i,r,P,C,b,S,A);n=fixColumeData(n,C,T.length,e,S,b);drawColumePointText(n,t,S,w,b);break;case"stack":var n=getStackDataPoints(o,i,r,P,C,b,S,e,T,A);drawColumePointText(n,t,S,w,b);break;case"meter":var n=getDataPoints(o,i,r,P,C,b,S,A);drawColumePointText(n,t,S,w,b);break}})}w.restore();return{xAxisPoints:P,calPoints:M,eachSpacing:C}}function drawMountDataPoints(i,r,o,n){let f=arguments.length>4&&arguments[4]!==undefined?arguments[4]:1;let t=r.chartData.xAxisData,p=t.xAxisPoints,l=t.eachSpacing;let s=assign({},{type:"mount",widthRatio:1,borderWidth:1,barBorderCircle:false,barBorderRadius:[],linearType:"none",linearOpacity:1,customColor:[],colorStop:0},r.extra.mount);s.widthRatio=s.widthRatio<=0?0:s.widthRatio;s.widthRatio=s.widthRatio>=2?2:s.widthRatio;let e=[];n.save();let u=-2;let g=p.length+2;if(r._scrollDistance_&&r._scrollDistance_!==0&&r.enableScroll===true){n.translate(r._scrollDistance_,0);u=Math.floor(-r._scrollDistance_/l)-2;g=u+r.xAxis.itemCount+4}s.customColor=fillCustomColor(s.linearType,s.customColor,i,o);let y,v,m;y=[].concat(r.chartData.yAxisData.ranges[0]);v=y.pop();m=y.shift();let T=r.height-r.area[0]-r.area[2];let b=T*(0-v)/(m-v);let h=r.height-Math.round(b)-r.area[2];var c=getMountDataPoints(i,v,m,p,l,r,s,h,f);switch(s.type){case"bar":for(let t=0;tu&&th?h:o.y;const C=o.width;const S=Math.abs(h-o.y);if(s.barBorderCircle){s.barBorderRadius=[C/2,C/2,0,0]}if(o.y>h){s.barBorderRadius=[0,0,C/2,C/2]}let[t,e,a,i]=s.barBorderRadius;let r=Math.min(C/2,S/2);t=t>r?r:t;e=e>r?r:e;a=a>r?r:a;i=i>r?r:i;t=t<0?0:t;e=e<0?0:e;a=a<0?0:a;i=i<0?0:i;n.arc(A+t,P+t,t,-Math.PI,-Math.PI/2);n.arc(A+C-e,P+e,e,-Math.PI/2,0);n.arc(A+C-a,P+S-a,a,0,Math.PI/2);n.arc(A+i,P+S-i,i,Math.PI/2,Math.PI)}else{n.moveTo(d,o.y);n.lineTo(d+o.width,o.y);n.lineTo(d+o.width,h);n.lineTo(d,h);n.lineTo(d,o.y)}n.setStrokeStyle(w);n.setFillStyle(a);if(s.borderWidth>0){n.setLineWidth(s.borderWidth*r.pix);n.closePath();n.stroke()}n.fill()}};break;case"triangle":for(let e=0;eu&&e0){n.setLineWidth(s.borderWidth*r.pix);n.stroke()}n.fill()}};break;case"mount":for(let e=0;eu&&e0){n.setLineWidth(s.borderWidth*r.pix);n.stroke()}n.fill()}};break;case"sharp":for(let e=0;eu&&e0){n.setLineWidth(s.borderWidth*r.pix);n.stroke()}n.fill()}};break}if(r.dataLabel!==false&&f===1){let t,e,a;t=[].concat(r.chartData.yAxisData.ranges[0]);e=t.pop();a=t.shift();var c=getMountDataPoints(i,e,a,p,l,r,s,h,f);drawMountPointText(c,i,o,n,r,h)}n.restore();return{xAxisPoints:p,calPoints:c,eachSpacing:l}}function drawBarDataPoints(y,v,m,T){let b=arguments.length>4&&arguments[4]!==undefined?arguments[4]:1;let S=[];let w=(v.height-v.area[0]-v.area[2])/v.categories.length;for(let t=0;tC&&tr?r:t;e=e>r?r:e;a=a>r?r:a;i=i>r?r:i;t=t<0?0:t;e=e<0?0:e;a=a<0?0:a;i=i<0?0:i;T.arc(g+i,c+i,i,-Math.PI,-Math.PI/2);T.arc(o.x-t,c+t,t,-Math.PI/2,0);T.arc(o.x-e,c+h-e,e,0,Math.PI/2);T.arc(g+a,c+h-a,a,Math.PI/2,Math.PI)}else{T.moveTo(n,r);T.lineTo(o.x,r);T.lineTo(o.x,r+o.width);T.lineTo(n,r+o.width);T.lineTo(n,r);T.setLineWidth(1);T.setStrokeStyle(u)}T.setFillStyle(l);T.closePath();T.fill()}};break;case"stack":var i=getBarStackDataPoints(x,e,d,S,w,v,m,t,y,b);P.push(i);i=fixBarStackData(i,w,y.length,t,m,v,y);for(let e=0;eC&&e5&&arguments[5]!==undefined?arguments[5]:1;var s=assign({},{color:{},average:{}},h.extra.candle);s.color=assign({},{upLine:"#f04864",upFill:"#f04864",downLine:"#2fc25b",downFill:"#2fc25b"},s.color);s.average=assign({},{show:false,name:[],day:[],color:c.color},s.average);h.extra.candle=s;let a=h.chartData.xAxisData,x=a.xAxisPoints,f=a.eachSpacing;let y=[];d.save();let p=-2;let v=x.length+2;let u=0;let m=h.width+f;if(h._scrollDistance_&&h._scrollDistance_!==0&&h.enableScroll===true){d.translate(h._scrollDistance_,0);p=Math.floor(-h._scrollDistance_/f)-2;v=p+h.xAxis.itemCount+4;u=-h._scrollDistance_-f*2+h.area[3];m=u+(h.xAxis.itemCount+4)*f}if(s.average.show||t){t.forEach(function(e,t){let a,i,r;a=[].concat(h.chartData.yAxisData.ranges[e.index]);i=a.pop();r=a.shift();var o=e.data;var n=getDataPoints(o,i,r,x,f,h,c,g);var l=splitPoints(n,e);for(let t=0;tu){d.moveTo(t.x,t.y);a=1}if(e>0&&t.x>u&&t.xp&&e0){d.setStrokeStyle(s.color.upLine);d.setFillStyle(s.color.upFill);d.setLineWidth(1*h.pix);d.moveTo(t[3].x,t[3].y);d.lineTo(t[1].x,t[1].y);d.lineTo(t[1].x-f/4,t[1].y);d.lineTo(t[0].x-f/4,t[0].y);d.lineTo(t[0].x,t[0].y);d.lineTo(t[2].x,t[2].y);d.lineTo(t[0].x,t[0].y);d.lineTo(t[0].x+f/4,t[0].y);d.lineTo(t[1].x+f/4,t[1].y);d.lineTo(t[1].x,t[1].y);d.moveTo(t[3].x,t[3].y)}else{d.setStrokeStyle(s.color.downLine);d.setFillStyle(s.color.downFill);d.setLineWidth(1*h.pix);d.moveTo(t[3].x,t[3].y);d.lineTo(t[0].x,t[0].y);d.lineTo(t[0].x-f/4,t[0].y);d.lineTo(t[1].x-f/4,t[1].y);d.lineTo(t[1].x,t[1].y);d.lineTo(t[2].x,t[2].y);d.lineTo(t[1].x,t[1].y);d.lineTo(t[1].x+f/4,t[1].y);d.lineTo(t[0].x+f/4,t[0].y);d.lineTo(t[0].x,t[0].y);d.moveTo(t[3].x,t[3].y)}d.closePath();d.fill();d.stroke()}}});d.restore();return{xAxisPoints:x,calPoints:y,eachSpacing:f}}function drawAreaDataPoints(t,s,h,c){var d=arguments.length>4&&arguments[4]!==undefined?arguments[4]:1;var x=assign({},{type:"straight",opacity:.2,addLine:false,width:2,gradient:false,activeType:"none"},s.extra.area);let e=s.chartData.xAxisData,f=e.xAxisPoints,p=e.eachSpacing;let y=s.height-s.area[2];let v=[];c.save();let u=0;let g=s.width+p;if(s._scrollDistance_&&s._scrollDistance_!==0&&s.enableScroll===true){c.translate(s._scrollDistance_,0);u=-s._scrollDistance_-p*2+s.area[3];g=u+(s.xAxis.itemCount+4)*p}t.forEach(function(e,t){let a,i,r;a=[].concat(s.chartData.yAxisData.ranges[e.index]);i=a.pop();r=a.shift();let o=e.data;let n=getDataPoints(o,i,r,f,p,s,h,d);v.push(n);let l=splitPoints(n,e);for(let t=0;t1){let t=r[0];let e=r[r.length-1];c.moveTo(t.x,t.y);let i=0;if(x.type==="curve"){for(let a=0;au){c.moveTo(e.x,e.y);i=1}if(a>0&&e.x>u&&e.xu){c.moveTo(t.x,t.y);i=1}if(e>0&&t.x>u&&t.xu){c.moveTo(t.x,t.y);i=1}if(e>0&&t.x>u&&t.xu){c.moveTo(e.x,e.y);i=1}if(a>0&&e.x>u&&e.xu){c.moveTo(t.x,t.y);i=1}if(e>0&&t.x>u&&t.xu){c.moveTo(t.x,t.y);i=1}if(e>0&&t.x>u&&t.x4&&arguments[4]!==undefined?arguments[4]:1;var i=assign({},{type:"circle"},s.extra.scatter);let e=s.chartData.xAxisData,x=e.xAxisPoints,f=e.eachSpacing;var r=[];c.save();let a=0;let o=s.width+f;if(s._scrollDistance_&&s._scrollDistance_!==0&&s.enableScroll===true){c.translate(s._scrollDistance_,0);a=-s._scrollDistance_-f*2+s.area[3];o=a+(s.xAxis.itemCount+4)*f}t.forEach(function(t,e){let a,i,r;a=[].concat(s.chartData.yAxisData.ranges[t.index]);i=a.pop();r=a.shift();var o=t.data;var n=getDataPoints(o,i,r,x,f,s,h,d);c.beginPath();c.setStrokeStyle(t.color);c.setFillStyle(t.color);c.setLineWidth(1*s.pix);var l=t.pointShape;if(l==="diamond"){n.forEach(function(t,e){if(t!==null){c.moveTo(t.x,t.y-4.5);c.lineTo(t.x-4.5,t.y);c.lineTo(t.x,t.y+4.5);c.lineTo(t.x+4.5,t.y);c.lineTo(t.x,t.y-4.5)}})}else if(l==="circle"){n.forEach(function(t,e){if(t!==null){c.moveTo(t.x+2.5*s.pix,t.y);c.arc(t.x,t.y,3*s.pix,0,2*Math.PI,false)}})}else if(l==="square"){n.forEach(function(t,e){if(t!==null){c.moveTo(t.x-3.5,t.y-3.5);c.rect(t.x-3.5,t.y-3.5,7,7)}})}else if(l==="triangle"){n.forEach(function(t,e){if(t!==null){c.moveTo(t.x,t.y-4.5);c.lineTo(t.x-4.5,t.y+4.5);c.lineTo(t.x+4.5,t.y+4.5);c.lineTo(t.x,t.y-4.5)}})}else if(l==="triangle"){return}c.closePath();c.fill();c.stroke()});if(s.dataLabel!==false&&d===1){t.forEach(function(t,e){let a,i,r;a=[].concat(s.chartData.yAxisData.ranges[t.index]);i=a.pop();r=a.shift();var o=t.data;var n=getDataPoints(o,i,r,x,f,s,h,d);drawPointText(n,t,h,c,s)})}c.restore();return{xAxisPoints:x,calPoints:r,eachSpacing:f}}function drawBubbleDataPoints(a,l,s,h){var c=arguments.length>4&&arguments[4]!==undefined?arguments[4]:1;var d=assign({},{opacity:1,border:2},l.extra.bubble);let t=l.chartData.xAxisData,x=t.xAxisPoints,f=t.eachSpacing;var i=[];h.save();let e=0;let r=l.width+f;if(l._scrollDistance_&&l._scrollDistance_!==0&&l.enableScroll===true){h.translate(l._scrollDistance_,0);e=-l._scrollDistance_-f*2+l.area[3];r=e+(l.xAxis.itemCount+4)*f}a.forEach(function(i,t){let e,a,r;e=[].concat(l.chartData.yAxisData.ranges[i.index]);a=e.pop();r=e.shift();var o=i.data;var n=getDataPoints(o,a,r,x,f,l,s,c);h.beginPath();h.setStrokeStyle(i.color);h.setLineWidth(d.border*l.pix);h.setFillStyle(hexToRgb(i.color,d.opacity));n.forEach(function(t,e){h.moveTo(t.x+t.r,t.y);h.arc(t.x,t.y,t.r*l.pix,0,2*Math.PI,false)});h.closePath();h.fill();h.stroke();if(l.dataLabel!==false&&c===1){n.forEach(function(t,e){h.beginPath();var a=i.textSize*l.pix||s.fontSize;h.setFontSize(a);h.setFillStyle(i.textColor||"#FFFFFF");h.setTextAlign("center");h.fillText(String(t.t),t.x,t.y+a/2);h.closePath();h.stroke();h.setTextAlign("left")})}});h.restore();return{xAxisPoints:x,calPoints:i,eachSpacing:f}}function drawLineDataPoints(t,d,x,f){var p=arguments.length>4&&arguments[4]!==undefined?arguments[4]:1;var u=assign({},{type:"straight",width:2,activeType:"none",linearType:"none",onShadow:false,animation:"vertical"},d.extra.line);u.width*=d.pix;let e=d.chartData.xAxisData,g=e.xAxisPoints,y=e.eachSpacing;var T=[];f.save();let v=0;let m=d.width+y;if(d._scrollDistance_&&d._scrollDistance_!==0&&d.enableScroll===true){f.translate(d._scrollDistance_,0);v=-d._scrollDistance_-y*2+d.area[3];m=v+(d.xAxis.itemCount+4)*y}t.forEach(function(e,c){f.beginPath();f.setStrokeStyle(e.color);f.moveTo(-1e4,-1e4);f.lineTo(-10001,-10001);f.stroke();let t,a,i;t=[].concat(d.chartData.yAxisData.ranges[e.index]);a=t.pop();i=t.shift();var r=e.data;var o=getLineDataPoints(r,a,i,g,y,d,x,u,p);T.push(o);var n=splitPoints(o,e);if(e.lineType=="dash"){let t=e.dashLength?e.dashLength:8;t*=d.pix;f.setLineDash([t,t])}f.beginPath();var l=e.color;if(u.linearType!=="none"&&e.linearColor&&e.linearColor.length>0){var s=f.createLinearGradient(d.chartData.xAxisData.startX,d.height/2,d.chartData.xAxisData.endX,d.height/2);for(var h=0;h0){f.setShadow(e.setShadow[0],e.setShadow[1],e.setShadow[2],e.setShadow[3])}else{f.setShadow(0,0,0,"rgba(0,0,0,0)")}f.setLineWidth(u.width);n.forEach(function(i,t){if(i.length===1){f.moveTo(i[0].x,i[0].y)}else{f.moveTo(i[0].x,i[0].y);let a=0;if(u.type==="curve"){for(let e=0;ev){f.moveTo(t.x,t.y);a=1}if(e>0&&t.x>v&&t.xv){f.moveTo(t.x,t.y);a=1}if(e>0&&t.x>v&&t.xv){f.moveTo(t.x,t.y);a=1}if(e>0&&t.x>v&&t.x4&&arguments[4]!==undefined?arguments[4]:1;let e=v.chartData.xAxisData,b=e.xAxisPoints,S=e.eachSpacing;let w=assign({},{width:S/2,barBorderCircle:false,barBorderRadius:[],seriesGap:2,linearType:"none",linearOpacity:1,customColor:[],colorStop:0},v.extra.mix.column);let A=assign({},{opacity:.2,gradient:false},v.extra.mix.area);let M=assign({},{width:2},v.extra.mix.line);let L=v.height-v.area[2];let F=[];var _=0;var k=0;t.forEach(function(t,e){if(t.type=="column"){k+=1}});T.save();let R=-2;let I=b.length+2;let P=0;let C=v.width+S;if(v._scrollDistance_&&v._scrollDistance_!==0&&v.enableScroll===true){T.translate(v._scrollDistance_,0);R=Math.floor(-v._scrollDistance_/S)-2;I=R+v.xAxis.itemCount+4;P=-v._scrollDistance_-S*2+v.area[3];C=P+(v.xAxis.itemCount+4)*S}w.customColor=fillCustomColor(w.linearType,w.customColor,t,m);t.forEach(function(n,t){let o,x,f;o=[].concat(v.chartData.yAxisData.ranges[n.index]);x=o.pop();f=o.shift();var p=n.data;var a=getDataPoints(p,x,f,b,S,v,m,D);F.push(a);if(n.type=="column"){a=fixColumeData(a,S,k,_,m,v);for(let t=0;tR&&tr?r:t;e=e>r?r:e;a=a>r?r:a;i=i>r?r:i;t=t<0?0:t;e=e<0?0:e;a=a<0?0:a;i=i<0?0:i;T.arc(h+t,c+t,t,-Math.PI,-Math.PI/2);T.arc(h+d-e,c+e,e,-Math.PI/2,0);T.arc(h+d-a,c+s-a,a,0,Math.PI/2);T.arc(h+i,c+s-i,i,Math.PI/2,Math.PI)}else{T.moveTo(l,o.y);T.lineTo(l+o.width,o.y);T.lineTo(l+o.width,v.height-v.area[2]);T.lineTo(l,v.height-v.area[2]);T.lineTo(l,o.y);T.setLineWidth(1);T.setStrokeStyle(u)}T.setFillStyle(e);T.closePath();T.fill()}}_+=1}if(n.type=="area"){let e=splitPoints(a,n);for(let t=0;t1){var r=i[0];let t=i[i.length-1];T.moveTo(r.x,r.y);let a=0;if(n.style==="curve"){for(let e=0;eP){T.moveTo(t.x,t.y);a=1}if(e>0&&t.x>P&&t.xP){T.moveTo(t.x,t.y);a=1}if(e>0&&t.x>P&&t.xP){T.moveTo(t.x,t.y);a=1}if(e>0&&t.x>P&&t.xP){T.moveTo(t.x,t.y);a=1}if(e>0&&t.x>P&&t.x1){if(h.extra.mount.widthRatio>2)h.extra.mount.widthRatio=2;l+=(h.extra.mount.widthRatio-1)*f}var s=n*n/l;var y=0;if(h._scrollDistance_){y=-h._scrollDistance_*n/l}d.beginPath();d.setLineCap("round");d.setLineWidth(6*h.pix);d.setStrokeStyle(h.xAxis.scrollBackgroundColor||"#EFEBEF");d.moveTo(t,o);d.lineTo(a,o);d.stroke();d.closePath();d.beginPath();d.setLineCap("round");d.setLineWidth(6*h.pix);d.setStrokeStyle(h.xAxis.scrollColor||"#A6A6A6");d.moveTo(t+y,o);d.lineTo(t+y+s,o);d.stroke();d.closePath();d.setLineCap("butt")}d.save();if(h._scrollDistance_&&h._scrollDistance_!==0){d.translate(h._scrollDistance_,0)}if(h.xAxis.calibration===true){d.setStrokeStyle(h.xAxis.gridColor||"#cccccc");d.setLineCap("butt");d.setLineWidth(1*h.pix);x.forEach(function(t,e){if(e>0){d.beginPath();d.moveTo(t-f/2,u);d.lineTo(t-f/2,u+3*h.pix);d.closePath();d.stroke()}})}if(h.xAxis.disableGrid!==true){d.setStrokeStyle(h.xAxis.gridColor||"#cccccc");d.setLineCap("butt");d.setLineWidth(1*h.pix);if(h.xAxis.gridType=="dash"){d.setLineDash([h.xAxis.dashLength*h.pix,h.xAxis.dashLength*h.pix])}h.xAxis.gridEval=h.xAxis.gridEval||1;x.forEach(function(t,e){if(e%h.xAxis.gridEval==0){d.beginPath();d.moveTo(t,u);d.lineTo(t,i);d.stroke()}});d.setLineDash([])}if(h.xAxis.disabled!==true){let t=r.length;if(h.xAxis.labelCount){if(h.xAxis.itemCount){t=Math.ceil(r.length/h.xAxis.itemCount*h.xAxis.labelCount)}else{t=h.xAxis.labelCount}t-=1}let e=Math.ceil(r.length/t);let a=[];let i=r.length;for(let t=0;t=h.area[3]-1&&n-Math.abs(o)<=h.width-h.area[1]+1){d.beginPath();d.setFontSize(g);d.setFillStyle(h.xAxis.fontColor||h.fontColor);d.fillText(String(a),x[e]+i,u+h.xAxis.marginTop*h.pix+(h.xAxis.lineHeight-h.xAxis.fontSize)*h.pix/2+h.xAxis.fontSize*h.pix);d.closePath();d.stroke()}})}else{a.forEach(function(t,e){var a=h.xAxis.formatter?h.xAxis.formatter(t):t;var i=h._scrollDistance_||0;var r=p=="center"?x[e]+f/2:x[e];if(r-Math.abs(i)>=h.area[3]-1&&r-Math.abs(i)<=h.width-h.area[1]+1){d.save();d.beginPath();d.setFontSize(g);d.setFillStyle(h.xAxis.fontColor||h.fontColor);var o=measureText(String(a),g,d);var n=x[e];if(p=="center"){n=x[e]+f/2}var l=0;if(h.xAxis.scrollShow){l=6*h.pix}var s=u+h.xAxis.marginTop*h.pix+g-g*Math.abs(Math.sin(c._xAxisTextAngle_));if(h.xAxis.rotateAngle<0){n-=g/2;o=0}else{n+=g/2;o=-o}d.translate(n,s);d.rotate(-1*c._xAxisTextAngle_);d.fillText(String(a),o,0);d.closePath();d.stroke();d.restore()}})}}d.restore();if(h.xAxis.title){d.beginPath();d.setFontSize(h.xAxis.titleFontSize*h.pix);d.setFillStyle(h.xAxis.titleFontColor);d.fillText(String(h.xAxis.title),h.width-h.area[1]+h.xAxis.titleOffsetX*h.pix,h.height-h.area[2]+h.xAxis.marginTop*h.pix+(h.xAxis.lineHeight-h.xAxis.titleFontSize)*h.pix/2+(h.xAxis.titleFontSize+h.xAxis.titleOffsetY)*h.pix);d.closePath();d.stroke()}if(h.xAxis.axisLine){d.beginPath();d.setStrokeStyle(h.xAxis.axisLineColor);d.setLineWidth(1*h.pix);d.moveTo(t,h.height-h.area[2]);d.lineTo(a,h.height-h.area[2]);d.stroke()}}function drawYAxisGrid(c,e,d,a){if(e.yAxis.disableGrid===true){return}let t=e.height-e.area[0]-e.area[2];let i=t/e.yAxis.splitNumber;let r=e.area[3];let o=e.chartData.xAxisData.xAxisPoints,n=e.chartData.xAxisData.eachSpacing;let l=n*(o.length-1);if(e.type=="mount"&&e.extra&&e.extra.mount&&e.extra.mount.widthRatio&&e.extra.mount.widthRatio>1){if(e.extra.mount.widthRatio>2)e.extra.mount.widthRatio=2;l+=(e.extra.mount.widthRatio-1)*n}let x=r+l;let s=[];let h=1;if(e.xAxis.axisLine===false){h=0}for(let t=h;t4&&arguments[4]!==undefined?arguments[4]:1;var n=assign({},{activeOpacity:.5,activeRadius:10,offsetAngle:0,labelWidth:15,ringWidth:30,customRadius:0,border:false,borderWidth:2,borderColor:"#FFFFFF",centerColor:"#FFFFFF",linearType:"none",customColor:[]},r.type=="pie"?r.extra.pie:r.extra.ring);var l={x:r.area[3]+(r.width-r.area[1]-r.area[3])/2,y:r.area[0]+(r.height-r.area[0]-r.area[2])/2};if(e.pieChartLinePadding==0){e.pieChartLinePadding=n.activeRadius*r.pix}var i=Math.min((r.width-r.area[1]-r.area[3])/2-e.pieChartLinePadding-e.pieChartTextPadding-e._pieTextMaxLength_,(r.height-r.area[0]-r.area[2])/2-e.pieChartLinePadding-e.pieChartTextPadding);i=i<10?10:i;if(n.customRadius>0){i=n.customRadius*r.pix}t=getPieDataPoints(t,i,a);var h=n.activeRadius*r.pix;n.customColor=fillCustomColor(n.linearType,n.customColor,t,e);t=t.map(function(t){t._start_+=n.offsetAngle*Math.PI/180;return t});t.forEach(function(t,e){if(r.tooltip){if(r.tooltip.index==e){o.beginPath();o.setFillStyle(hexToRgb(t.color,n.activeOpacity||.5));o.moveTo(l.x,l.y);o.arc(l.x,l.y,t._radius_+h,t._start_,t._start_+2*t._proportion_*Math.PI);o.closePath();o.fill()}}o.beginPath();o.setLineWidth(n.borderWidth*r.pix);o.lineJoin="round";o.setStrokeStyle(n.borderColor);var a=t.color;if(n.linearType=="custom"){var i;if(o.createCircularGradient){i=o.createCircularGradient(l.x,l.y,t._radius_)}else{i=o.createRadialGradient(l.x,l.y,0,l.x,l.y,t._radius_)}i.addColorStop(0,hexToRgb(n.customColor[t.linearIndex],1));i.addColorStop(1,hexToRgb(t.color,1));a=i}o.setFillStyle(a);o.moveTo(l.x,l.y);o.arc(l.x,l.y,t._radius_,t._start_,t._start_+2*t._proportion_*Math.PI);o.closePath();o.fill();if(n.border==true){o.stroke()}});if(r.type==="ring"){var s=i*.6;if(typeof n.ringWidth==="number"&&n.ringWidth>0){s=Math.max(0,i-n.ringWidth*r.pix)}o.beginPath();o.setFillStyle(n.centerColor);o.moveTo(l.x,l.y);o.arc(l.x,l.y,s,0,2*Math.PI);o.closePath();o.fill()}if(r.dataLabel!==false&&a===1){drawPieText(t,r,e,o,i,l)}if(a===1&&r.type==="ring"){drawRingTitle(r,e,o,l)}return{center:l,radius:i,series:t}}function drawRoseDataPoints(t,r,e,o){var a=arguments.length>4&&arguments[4]!==undefined?arguments[4]:1;var n=assign({},{type:"area",activeOpacity:.5,activeRadius:10,offsetAngle:0,labelWidth:15,border:false,borderWidth:2,borderColor:"#FFFFFF",linearType:"none",customColor:[]},r.extra.rose);if(e.pieChartLinePadding==0){e.pieChartLinePadding=n.activeRadius*r.pix}var l={x:r.area[3]+(r.width-r.area[1]-r.area[3])/2,y:r.area[0]+(r.height-r.area[0]-r.area[2])/2};var i=Math.min((r.width-r.area[1]-r.area[3])/2-e.pieChartLinePadding-e.pieChartTextPadding-e._pieTextMaxLength_,(r.height-r.area[0]-r.area[2])/2-e.pieChartLinePadding-e.pieChartTextPadding);i=i<10?10:i;var s=n.minRadius||i*.5;if(i4&&arguments[4]!==undefined?arguments[4]:1;var o=assign({},{startAngle:.75,endAngle:.25,type:"default",direction:"cw",lineCap:"round",width:12,gap:2,linearType:"none",customColor:[]},i.extra.arcbar);a=getArcbarDataPoints(a,o,e);var n;if(o.centerX||o.centerY){n={x:o.centerX?o.centerX:i.width/2,y:o.centerY?o.centerY:i.height/2}}else{n={x:i.width/2,y:i.height/2}}var l;if(o.radius){l=o.radius}else{l=Math.min(n.x,n.y);l-=5*i.pix;l-=o.width/2}l=l<10?10:l;o.customColor=fillCustomColor(o.linearType,o.customColor,a,t);for(let e=0;e5&&arguments[5]!==undefined?arguments[5]:1;var f=assign({},{type:"default",startAngle:.75,endAngle:.25,width:15,labelOffset:13,splitLine:{fixRadius:0,splitNumber:10,width:15,color:"#FFFFFF",childNumber:5,childWidth:5},pointer:{width:15,color:"auto"}},c.extra.gauge);if(f.oldAngle==undefined){f.oldAngle=f.startAngle}if(f.oldData==undefined){f.oldData=0}n=getGaugeAxisPoints(n,f.startAngle,f.endAngle);var p={x:c.width/2,y:c.height/2};var u=Math.min(p.x,p.y);u-=5*c.pix;u-=f.width/2;u=u<10?10:u;var g=u-f.width;var y=0;if(f.type=="progress"){var v=u-f.width*3;d.beginPath();let t=d.createLinearGradient(p.x,p.y-v,p.x,p.y+v);t.addColorStop("0",hexToRgb(h[0].color,.3));t.addColorStop("1.0",hexToRgb("#FFFFFF",.1));d.setFillStyle(t);d.arc(p.x,p.y,v,0,2*Math.PI,false);d.fill();d.setLineWidth(f.width);d.setStrokeStyle(hexToRgb(h[0].color,.3));d.setLineCap("round");d.beginPath();d.arc(p.x,p.y,g,f.startAngle*Math.PI,f.endAngle*Math.PI,false);d.stroke();if(f.endAnglet/o){d.setStrokeStyle(hexToRgb(h[0].color,1))}else{d.setStrokeStyle(hexToRgb(h[0].color,.3))}d.setLineWidth(3*c.pix);d.moveTo(i,0);d.lineTo(r,0);d.stroke();d.rotate(a*Math.PI)}d.restore();h=getGaugeArcbarDataPoints(h,f,x);d.setLineWidth(f.width);d.setStrokeStyle(h[0].color);d.setLineCap("round");d.beginPath();d.arc(p.x,p.y,g,f.startAngle*Math.PI,h[0]._proportion_*Math.PI,false);d.stroke();let l=u-f.width*2.5;d.save();d.translate(p.x,p.y);d.rotate((h[0]._proportion_-1)*Math.PI);d.beginPath();d.setLineWidth(f.width/3);let s=d.createLinearGradient(0,-l*.6,0,l*.6);s.addColorStop("0",hexToRgb("#FFFFFF",0));s.addColorStop("0.5",hexToRgb(h[0].color,1));s.addColorStop("1.0",hexToRgb("#FFFFFF",0));d.setStrokeStyle(s);d.arc(0,0,l,.85*Math.PI,1.15*Math.PI,false);d.stroke();d.beginPath();d.setLineWidth(1);d.setStrokeStyle(h[0].color);d.setFillStyle(h[0].color);d.moveTo(-l-f.width/3/2,-4);d.lineTo(-l-f.width/3/2-4,0);d.lineTo(-l-f.width/3/2,4);d.lineTo(-l-f.width/3/2,-4);d.stroke();d.fill();d.restore()}else{d.setLineWidth(f.width);d.setLineCap("butt");for(let e=0;e4&&arguments[4]!==undefined?arguments[4]:1;var s=assign({},{gridColor:"#cccccc",gridType:"radar",gridEval:1,axisLabel:false,axisLabelTofix:0,labelShow:true,labelColor:"#666666",labelPointShow:false,labelPointRadius:3,labelPointColor:"#cccccc",opacity:.2,gridCount:3,border:false,borderWidth:2,linearType:"none",customColor:[]},n.extra.radar);var a=getRadarCoordinateSeries(n.categories.length);var h={x:n.area[3]+(n.width-n.area[1]-n.area[3])/2,y:n.area[0]+(n.height-n.area[0]-n.area[2])/2};var r=(n.width-n.area[1]-n.area[3])/2;var d=(n.height-n.area[0]-n.area[2])/2;var c=Math.min(r-(getMaxTextListLength(n.categories,i.fontSize,l)+i.radarLabelTextMargin),d-i.radarLabelTextMargin);c-=i.radarLabelTextMargin*n.pix;c=c<10?10:c;c=s.radius?s.radius:c;l.beginPath();l.setLineWidth(1*n.pix);l.setStrokeStyle(s.gridColor);a.forEach(function(t,e){var a=convertCoordinateOrigin(c*Math.cos(t),c*Math.sin(t),h);l.moveTo(h.x,h.y);if(e%s.gridEval==0){l.lineTo(a.x,a.y)}});l.stroke();l.closePath();var x=function t(i){var r={};l.beginPath();l.setLineWidth(1*n.pix);l.setStrokeStyle(s.gridColor);if(s.gridType=="radar"){a.forEach(function(t,e){var a=convertCoordinateOrigin(c/s.gridCount*i*Math.cos(t),c/s.gridCount*i*Math.sin(t),h);if(e===0){r=a;l.moveTo(a.x,a.y)}else{l.lineTo(a.x,a.y)}});l.lineTo(r.x,r.y)}else{var e=convertCoordinateOrigin(c/s.gridCount*i*Math.cos(1.5),c/s.gridCount*i*Math.sin(1.5),h);l.arc(h.x,h.y,h.y-e.y,0,2*Math.PI,false)}l.stroke();l.closePath()};for(var e=1;e<=s.gridCount;e++){x(e)}s.customColor=fillCustomColor(s.linearType,s.customColor,o,i);var f=getRadarDataPoints(a,h,c,o,n,t);f.forEach(function(t,e){l.beginPath();l.setLineWidth(s.borderWidth*n.pix);l.setStrokeStyle(t.color);var a=hexToRgb(t.color,s.opacity);if(s.linearType=="custom"){var i;if(l.createCircularGradient){i=l.createCircularGradient(h.x,h.y,c)}else{i=l.createRadialGradient(h.x,h.y,0,h.x,h.y,c)}i.addColorStop(0,hexToRgb(s.customColor[o[e].linearIndex],s.opacity));i.addColorStop(1,hexToRgb(t.color,s.opacity));a=i}l.setFillStyle(a);t.data.forEach(function(t,e){if(e===0){l.moveTo(t.position.x,t.position.y)}else{l.lineTo(t.position.x,t.position.y)}});l.closePath();l.fill();if(s.border===true){l.stroke()}l.closePath();if(n.dataPointShape!==false){var r=t.data.map(function(t){return t.position});drawPointShape(r,t.color,t.pointShape,l,n)}});if(s.axisLabel===true){const p=Math.max(s.max,Math.max.apply(null,dataCombine(o)));const u=c/s.gridCount;const g=n.fontSize*n.pix;l.setFontSize(g);l.setFillStyle(n.fontColor);l.setTextAlign("left");for(var e=0;eh.x?e.xMax:h.x;e.yMin=e.yMinh.y?e.yMax:h.y}}}return e}function coordinateToPoint(t,e,a,i,r,o){return{x:(e-a.xMin)*i+r,y:(a.yMax-t)*i+o}}function pointToCoordinate(t,e,a,i,r,o){return{x:(e-r)/i+a.xMin,y:a.yMax-(t-o)/i}}function isRayIntersectsSegment(t,e,a){if(e[1]==a[1]){return false}if(e[1]>t[1]&&a[1]>t[1]){return false}if(e[1]t[1]){return false}if(a[1]==t[1]&&e[1]>t[1]){return false}if(e[0]a[t].area[2]||e[1]>a[t].area[3]||e[2]i||e[3]>r){o=true;break}else{o=false}}else{o=true;break}}}return o}function getWordCloudPoint(c,t,d){let x=c.series;switch(t){case"normal":for(let l=0;l.7){return true}else{return false}};for(let h=0;h4&&arguments[4]!==undefined?arguments[4]:1;let a=assign({},{type:"normal",autoColors:true},r.extra.word);if(!r.chartData.wordCloudData){r.chartData.wordCloudData=getWordCloudPoint(r,a.type,o)}o.beginPath();o.setFillStyle(r.background);o.rect(0,0,r.width,r.height);o.fill();o.save();let l=r.chartData.wordCloudData;o.translate(r.width/2,r.height/2);for(let i=0;i0){if(r.tooltip){if(r.tooltip.index==i){o.strokeText(t,(l[i].areav[0]+5-r.width/2)*n-a*(1-n)/2,(l[i].areav[1]+5+e-r.height/2)*n)}else{o.fillText(t,(l[i].areav[0]+5-r.width/2)*n-a*(1-n)/2,(l[i].areav[1]+5+e-r.height/2)*n)}}else{o.fillText(t,(l[i].areav[0]+5-r.width/2)*n-a*(1-n)/2,(l[i].areav[1]+5+e-r.height/2)*n)}}}else{if(l[i].area[0]>0){if(r.tooltip){if(r.tooltip.index==i){o.strokeText(t,(l[i].area[0]+5-r.width/2)*n-a*(1-n)/2,(l[i].area[1]+5+e-r.height/2)*n)}else{o.fillText(t,(l[i].area[0]+5-r.width/2)*n-a*(1-n)/2,(l[i].area[1]+5+e-r.height/2)*n)}}else{o.fillText(t,(l[i].area[0]+5-r.width/2)*n-a*(1-n)/2,(l[i].area[1]+5+e-r.height/2)*n)}}}o.stroke();o.restore()}o.restore()}function drawFunnelDataPoints(t,e,c,a){let d=arguments.length>4&&arguments[4]!==undefined?arguments[4]:1;let i=assign({},{type:"funnel",activeWidth:10,activeOpacity:.3,border:false,borderWidth:2,borderColor:"#FFFFFF",fillOpacity:1,minSize:0,labelAlign:"right",linearType:"none",customColor:[]},e.extra.funnel);let r=(e.height-e.area[0]-e.area[2])/t.length;let o={x:e.area[3]+(e.width-e.area[1]-e.area[3])/2,y:e.height-e.area[2]};let n=i.activeWidth*e.pix;let x=Math.min((e.width-e.area[1]-e.area[3])/2-n,(e.height-e.area[0]-e.area[2])/2-n);let l=getFunnelDataPoints(t,x,i,r,d);a.save();a.translate(o.x,o.y);i.customColor=fillCustomColor(i.linearType,i.customColor,t,c);if(i.type=="pyramid"){for(let t=0;t0){l.area[3]+=i[t].width+l.yAxis.padding*l.pix}else{l.area[3]+=i[t].width}a+=1}else if(i[t].position=="right"){if(e>0){l.area[1]+=i[t].width+l.yAxis.padding*l.pix}else{l.area[1]+=i[t].width}e+=1}}}else{n.yAxisWidth=i}l.chartData.yAxisData=f;if(l.categories&&l.categories.length&&l.type!=="radar"&&l.type!=="gauge"&&l.type!=="bar"){l.chartData.xAxisData=getXAxisPoints(l.categories,l,n);let t=calCategoriesData(l.categories,l,n,l.chartData.xAxisData.eachSpacing,s),e=t.xAxisHeight,a=t.angle;n.xAxisHeight=e;n._xAxisTextAngle_=a;l.area[2]+=e;l.chartData.categoriesData=t}else{if(l.type==="line"||l.type==="area"||l.type==="scatter"||l.type==="bubble"||l.type==="bar"){l.chartData.xAxisData=calXAxisData(c,l,n,s);d=l.chartData.xAxisData.rangesFormat;let t=calCategoriesData(d,l,n,l.chartData.xAxisData.eachSpacing,s),e=t.xAxisHeight,a=t.angle;n.xAxisHeight=e;n._xAxisTextAngle_=a;l.area[2]+=e;l.chartData.categoriesData=t}else{l.chartData.xAxisData={xAxisPoints:[]}}}if(l.enableScroll&&l.xAxis.scrollAlign=="right"&&l._scrollDistance_===undefined){let t=0,e=l.chartData.xAxisData.xAxisPoints,a=l.chartData.xAxisData.startX,i=l.chartData.xAxisData.endX,r=l.chartData.xAxisData.eachSpacing;let o=r*(e.length-1);let n=i-a;t=n-o;h.scrollOption.currentOffset=t;h.scrollOption.startTouchX=t;h.scrollOption.distance=0;h.scrollOption.lastMoveTime=0;l._scrollDistance_=t}if(t==="pie"||t==="ring"||t==="rose"){n._pieTextMaxLength_=l.dataLabel===false?0:getPieTextMaxLength(x,n,s,l)}switch(t){case"word":this.animationInstance=new Animation({timing:l.timing,duration:e,onProcess:function(t){s.clearRect(0,0,l.width,l.height);if(l.rotate){contextRotate(s,l)}drawWordCloudDataPoints(c,l,n,s,t);drawCanvas(l,s)},onAnimationFinish:function t(){h.uevent.trigger("renderComplete")}});break;case"map":s.clearRect(0,0,l.width,l.height);drawMapDataPoints(c,l,n,s);setTimeout(()=>{this.uevent.trigger("renderComplete")},50);break;case"funnel":this.animationInstance=new Animation({timing:l.timing,duration:e,onProcess:function(t){s.clearRect(0,0,l.width,l.height);if(l.rotate){contextRotate(s,l)}l.chartData.funnelData=drawFunnelDataPoints(c,l,n,s,t);drawLegend(l.series,l,n,s,l.chartData);drawToolTipBridge(l,n,s,t);drawCanvas(l,s)},onAnimationFinish:function t(){h.uevent.trigger("renderComplete")}});break;case"line":this.animationInstance=new Animation({timing:l.timing,duration:e,onProcess:function t(e){s.clearRect(0,0,l.width,l.height);if(l.rotate){contextRotate(s,l)}drawYAxisGrid(d,l,n,s);drawXAxis(d,l,n,s);var a=drawLineDataPoints(c,l,n,s,e),i=a.xAxisPoints,r=a.calPoints,o=a.eachSpacing;l.chartData.xAxisPoints=i;l.chartData.calPoints=r;l.chartData.eachSpacing=o;drawYAxis(c,l,n,s);if(l.enableMarkLine!==false&&e===1){drawMarkLine(l,n,s)}drawLegend(l.series,l,n,s,l.chartData);drawToolTipBridge(l,n,s,e,o,i);drawCanvas(l,s)},onAnimationFinish:function t(){h.uevent.trigger("renderComplete")}});break;case"scatter":this.animationInstance=new Animation({timing:l.timing,duration:e,onProcess:function t(e){s.clearRect(0,0,l.width,l.height);if(l.rotate){contextRotate(s,l)}drawYAxisGrid(d,l,n,s);drawXAxis(d,l,n,s);var a=drawScatterDataPoints(c,l,n,s,e),i=a.xAxisPoints,r=a.calPoints,o=a.eachSpacing;l.chartData.xAxisPoints=i;l.chartData.calPoints=r;l.chartData.eachSpacing=o;drawYAxis(c,l,n,s);if(l.enableMarkLine!==false&&e===1){drawMarkLine(l,n,s)}drawLegend(l.series,l,n,s,l.chartData);drawToolTipBridge(l,n,s,e,o,i);drawCanvas(l,s)},onAnimationFinish:function t(){h.uevent.trigger("renderComplete")}});break;case"bubble":this.animationInstance=new Animation({timing:l.timing,duration:e,onProcess:function t(e){s.clearRect(0,0,l.width,l.height);if(l.rotate){contextRotate(s,l)}drawYAxisGrid(d,l,n,s);drawXAxis(d,l,n,s);var a=drawBubbleDataPoints(c,l,n,s,e),i=a.xAxisPoints,r=a.calPoints,o=a.eachSpacing;l.chartData.xAxisPoints=i;l.chartData.calPoints=r;l.chartData.eachSpacing=o;drawYAxis(c,l,n,s);if(l.enableMarkLine!==false&&e===1){drawMarkLine(l,n,s)}drawLegend(l.series,l,n,s,l.chartData);drawToolTipBridge(l,n,s,e,o,i);drawCanvas(l,s)},onAnimationFinish:function t(){h.uevent.trigger("renderComplete")}});break;case"mix":this.animationInstance=new Animation({timing:l.timing,duration:e,onProcess:function t(e){s.clearRect(0,0,l.width,l.height);if(l.rotate){contextRotate(s,l)}drawYAxisGrid(d,l,n,s);drawXAxis(d,l,n,s);var a=drawMixDataPoints(c,l,n,s,e),i=a.xAxisPoints,r=a.calPoints,o=a.eachSpacing;l.chartData.xAxisPoints=i;l.chartData.calPoints=r;l.chartData.eachSpacing=o;drawYAxis(c,l,n,s);if(l.enableMarkLine!==false&&e===1){drawMarkLine(l,n,s)}drawLegend(l.series,l,n,s,l.chartData);drawToolTipBridge(l,n,s,e,o,i);drawCanvas(l,s)},onAnimationFinish:function t(){h.uevent.trigger("renderComplete")}});break;case"column":this.animationInstance=new Animation({timing:l.timing,duration:e,onProcess:function t(e){s.clearRect(0,0,l.width,l.height);if(l.rotate){contextRotate(s,l)}drawYAxisGrid(d,l,n,s);drawXAxis(d,l,n,s);var a=drawColumnDataPoints(c,l,n,s,e),i=a.xAxisPoints,r=a.calPoints,o=a.eachSpacing;l.chartData.xAxisPoints=i;l.chartData.calPoints=r;l.chartData.eachSpacing=o;drawYAxis(c,l,n,s);if(l.enableMarkLine!==false&&e===1){drawMarkLine(l,n,s)}drawLegend(l.series,l,n,s,l.chartData);drawToolTipBridge(l,n,s,e,o,i);drawCanvas(l,s)},onAnimationFinish:function t(){h.uevent.trigger("renderComplete")}});break;case"mount":this.animationInstance=new Animation({timing:l.timing,duration:e,onProcess:function t(e){s.clearRect(0,0,l.width,l.height);if(l.rotate){contextRotate(s,l)}drawYAxisGrid(d,l,n,s);drawXAxis(d,l,n,s);var a=drawMountDataPoints(c,l,n,s,e),i=a.xAxisPoints,r=a.calPoints,o=a.eachSpacing;l.chartData.xAxisPoints=i;l.chartData.calPoints=r;l.chartData.eachSpacing=o;drawYAxis(c,l,n,s);if(l.enableMarkLine!==false&&e===1){drawMarkLine(l,n,s)}drawLegend(l.series,l,n,s,l.chartData);drawToolTipBridge(l,n,s,e,o,i);drawCanvas(l,s)},onAnimationFinish:function t(){h.uevent.trigger("renderComplete")}});break;case"bar":this.animationInstance=new Animation({timing:l.timing,duration:e,onProcess:function t(e){s.clearRect(0,0,l.width,l.height);if(l.rotate){contextRotate(s,l)}drawXAxis(d,l,n,s);var a=drawBarDataPoints(c,l,n,s,e),i=a.yAxisPoints,r=a.calPoints,o=a.eachSpacing;l.chartData.yAxisPoints=i;l.chartData.xAxisPoints=l.chartData.xAxisData.xAxisPoints;l.chartData.calPoints=r;l.chartData.eachSpacing=o;drawYAxis(c,l,n,s);if(l.enableMarkLine!==false&&e===1){drawMarkLine(l,n,s)}drawLegend(l.series,l,n,s,l.chartData);drawToolTipBridge(l,n,s,e,o,i);drawCanvas(l,s)},onAnimationFinish:function t(){h.uevent.trigger("renderComplete")}});break;case"area":this.animationInstance=new Animation({timing:l.timing,duration:e,onProcess:function t(e){s.clearRect(0,0,l.width,l.height);if(l.rotate){contextRotate(s,l)}drawYAxisGrid(d,l,n,s);drawXAxis(d,l,n,s);var a=drawAreaDataPoints(c,l,n,s,e),i=a.xAxisPoints,r=a.calPoints,o=a.eachSpacing;l.chartData.xAxisPoints=i;l.chartData.calPoints=r;l.chartData.eachSpacing=o;drawYAxis(c,l,n,s);if(l.enableMarkLine!==false&&e===1){drawMarkLine(l,n,s)}drawLegend(l.series,l,n,s,l.chartData);drawToolTipBridge(l,n,s,e,o,i);drawCanvas(l,s)},onAnimationFinish:function t(){h.uevent.trigger("renderComplete")}});break;case"ring":this.animationInstance=new Animation({timing:l.timing,duration:e,onProcess:function t(e){s.clearRect(0,0,l.width,l.height);if(l.rotate){contextRotate(s,l)}l.chartData.pieData=drawPieDataPoints(c,l,n,s,e);drawLegend(l.series,l,n,s,l.chartData);drawToolTipBridge(l,n,s,e);drawCanvas(l,s)},onAnimationFinish:function t(){h.uevent.trigger("renderComplete")}});break;case"pie":this.animationInstance=new Animation({timing:l.timing,duration:e,onProcess:function t(e){s.clearRect(0,0,l.width,l.height);if(l.rotate){contextRotate(s,l)}l.chartData.pieData=drawPieDataPoints(c,l,n,s,e);drawLegend(l.series,l,n,s,l.chartData);drawToolTipBridge(l,n,s,e);drawCanvas(l,s)},onAnimationFinish:function t(){h.uevent.trigger("renderComplete")}});break;case"rose":this.animationInstance=new Animation({timing:l.timing,duration:e,onProcess:function t(e){s.clearRect(0,0,l.width,l.height);if(l.rotate){contextRotate(s,l)}l.chartData.pieData=drawRoseDataPoints(c,l,n,s,e);drawLegend(l.series,l,n,s,l.chartData);drawToolTipBridge(l,n,s,e);drawCanvas(l,s)},onAnimationFinish:function t(){h.uevent.trigger("renderComplete")}});break;case"radar":this.animationInstance=new Animation({timing:l.timing,duration:e,onProcess:function t(e){s.clearRect(0,0,l.width,l.height);if(l.rotate){contextRotate(s,l)}l.chartData.radarData=drawRadarDataPoints(c,l,n,s,e);drawLegend(l.series,l,n,s,l.chartData);drawToolTipBridge(l,n,s,e);drawCanvas(l,s)},onAnimationFinish:function t(){h.uevent.trigger("renderComplete")}});break;case"arcbar":this.animationInstance=new Animation({timing:l.timing,duration:e,onProcess:function t(e){s.clearRect(0,0,l.width,l.height);if(l.rotate){contextRotate(s,l)}l.chartData.arcbarData=drawArcbarDataPoints(c,l,n,s,e);drawCanvas(l,s)},onAnimationFinish:function t(){h.uevent.trigger("renderComplete")}});break;case"gauge":this.animationInstance=new Animation({timing:l.timing,duration:e,onProcess:function t(e){s.clearRect(0,0,l.width,l.height);if(l.rotate){contextRotate(s,l)}l.chartData.gaugeData=drawGaugeDataPoints(d,c,l,n,s,e);drawCanvas(l,s)},onAnimationFinish:function t(){h.uevent.trigger("renderComplete")}});break;case"candle":this.animationInstance=new Animation({timing:l.timing,duration:e,onProcess:function t(e){s.clearRect(0,0,l.width,l.height);if(l.rotate){contextRotate(s,l)}drawYAxisGrid(d,l,n,s);drawXAxis(d,l,n,s);var a=drawCandleDataPoints(c,x,l,n,s,e),i=a.xAxisPoints,r=a.calPoints,o=a.eachSpacing;l.chartData.xAxisPoints=i;l.chartData.calPoints=r;l.chartData.eachSpacing=o;drawYAxis(c,l,n,s);if(l.enableMarkLine!==false&&e===1){drawMarkLine(l,n,s)}if(x){drawLegend(x,l,n,s,l.chartData)}else{drawLegend(l.series,l,n,s,l.chartData)}drawToolTipBridge(l,n,s,e,o,i);drawCanvas(l,s)},onAnimationFinish:function t(){h.uevent.trigger("renderComplete")}});break}}function uChartsEvent(){this.events={}}uChartsEvent.prototype.addEventListener=function(t,e){this.events[t]=this.events[t]||[];this.events[t].push(e)};uChartsEvent.prototype.delEventListener=function(t){this.events[t]=[]};uChartsEvent.prototype.trigger=function(){for(var t=arguments.length,e=Array(t),a=0;a0&&arguments[0]!==undefined?arguments[0]:{};this.opts=assign({},this.opts,t);this.opts.updateData=true;let c=t.scrollPosition||"current";switch(c){case"current":this.opts._scrollDistance_=this.scrollOption.currentOffset;break;case"left":this.opts._scrollDistance_=0;this.scrollOption={currentOffset:0,startTouchX:0,distance:0,lastMoveTime:0};break;case"right":let t=calYAxisData(this.opts.series,this.opts,this.config,this.context),e=t.yAxisWidth;this.config.yAxisWidth=e;let a=0;let i=getXAxisPoints(this.opts.categories,this.opts,this.config),r=i.xAxisPoints,o=i.startX,n=i.endX,l=i.eachSpacing;let s=l*(r.length-1);let h=n-o;a=h-s;this.scrollOption={currentOffset:a,startTouchX:a,distance:0,lastMoveTime:0};this.opts._scrollDistance_=a;break}drawCharts.call(this,this.opts.type,this.opts,this.config,this.context)};uCharts.prototype.zoom=function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.opts.xAxis.itemCount;if(this.opts.enableScroll!==true){console.log("[uCharts] 请启用滚动条后使用");return}let e=Math.round(Math.abs(this.scrollOption.currentOffset)/this.opts.chartData.eachSpacing)+Math.round(this.opts.xAxis.itemCount/2);this.opts.animation=false;this.opts.xAxis.itemCount=t.itemCount;let a=calYAxisData(this.opts.series,this.opts,this.config,this.context),i=a.yAxisWidth;this.config.yAxisWidth=i;let r=0;let o=getXAxisPoints(this.opts.categories,this.opts,this.config),h=o.xAxisPoints,c=o.startX,d=o.endX,n=o.eachSpacing;let x=n*e;let l=d-c;let s=l-n*(h.length-1);r=l/2-x;if(r>0){r=0}if(r=this.opts.categories.length?this.opts.categories.length:r;this.opts.animation=false;this.opts.xAxis.itemCount=r;let o=0;let n=getXAxisPoints(this.opts.categories,this.opts,this.config),x=n.xAxisPoints,f=n.startX,p=n.endX,l=n.eachSpacing;let u=l*this.scrollOption.moveCurrent1;let g=p-f;let y=g-l*(x.length-1);o=-u+Math.min(i[0].x,i[1].x)-this.opts.area[3]-l;if(o>0){o=0}if(o1&&arguments[1]!==undefined?arguments[1]:{};var a=null;if(t.changedTouches){a=t.changedTouches[0]}else{a=t.mp.changedTouches[0]}if(a){var i=getTouches(a,this.opts,t);var r=this.getLegendDataIndex(t);if(r>=0){if(this.opts.type=="candle"){this.opts.seriesMA[r].show=!this.opts.seriesMA[r].show}else{this.opts.series[r].show=!this.opts.series[r].show}this.opts.animation=e.animation?true:false;this.opts._scrollDistance_=this.scrollOption.currentOffset;drawCharts.call(this,this.opts.type,this.opts,this.config,this.context)}}};uCharts.prototype.showToolTip=function(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var c=null;if(t.changedTouches){c=t.changedTouches[0]}else{c=t.mp.changedTouches[0]}if(!c){console.log("[uCharts] 未获取到event坐标信息")}var a=getTouches(c,this.opts,t);var d=this.scrollOption.currentOffset;var i=assign({},this.opts,{_scrollDistance_:d,animation:false});if(this.opts.type==="line"||this.opts.type==="area"||this.opts.type==="column"||this.opts.type==="scatter"||this.opts.type==="bubble"){var r=this.getCurrentDataIndex(t);var o=e.index==undefined?r.index:e.index;if(o>-1||o.length>0){var n=getSeriesDataItem(this.opts.series,o,r.group);if(n.length!==0){var l=getToolTipData(n,this.opts,o,r.group,this.opts.categories,e),s=l.textList,h=l.offset;h.y=a.y;i.tooltip={textList:e.textList!==undefined?e.textList:s,offset:e.offset!==undefined?e.offset:h,option:e,index:o,group:r.group}}}drawCharts.call(this,i.type,i,this.config,this.context)}if(this.opts.type==="mount"){var o=e.index==undefined?this.getCurrentDataIndex(t).index:e.index;if(o>-1){var i=assign({},this.opts,{animation:false});var n=assign({},i._series_[o]);var s=[{text:e.formatter?e.formatter(n,undefined,o,i):n.name+": "+n.data,color:n.color,legendShape:this.opts.extra.tooltip.legendShape=="auto"?n.legendShape:this.opts.extra.tooltip.legendShape}];var h={x:i.chartData.calPoints[o].x,y:a.y};i.tooltip={textList:e.textList?e.textList:s,offset:e.offset!==undefined?e.offset:h,option:e,index:o}}drawCharts.call(this,i.type,i,this.config,this.context)}if(this.opts.type==="bar"){var r=this.getCurrentDataIndex(t);var o=e.index==undefined?r.index:e.index;if(o>-1||o.length>0){var n=getSeriesDataItem(this.opts.series,o,r.group);if(n.length!==0){var l=getToolTipData(n,this.opts,o,r.group,this.opts.categories,e),s=l.textList,h=l.offset;h.x=a.x;i.tooltip={textList:e.textList!==undefined?e.textList:s,offset:e.offset!==undefined?e.offset:h,option:e,index:o}}}drawCharts.call(this,i.type,i,this.config,this.context)}if(this.opts.type==="mix"){var r=this.getCurrentDataIndex(t);var o=e.index==undefined?r.index:e.index;if(o>-1){var d=this.scrollOption.currentOffset;var i=assign({},this.opts,{_scrollDistance_:d,animation:false});var n=getSeriesDataItem(this.opts.series,o);if(n.length!==0){var x=getMixToolTipData(n,this.opts,o,this.opts.categories,e),s=x.textList,h=x.offset;h.y=a.y;i.tooltip={textList:e.textList?e.textList:s,offset:e.offset!==undefined?e.offset:h,option:e,index:o}}}drawCharts.call(this,i.type,i,this.config,this.context)}if(this.opts.type==="candle"){var r=this.getCurrentDataIndex(t);var o=e.index==undefined?r.index:e.index;if(o>-1){var d=this.scrollOption.currentOffset;var i=assign({},this.opts,{_scrollDistance_:d,animation:false});var n=getSeriesDataItem(this.opts.series,o);if(n.length!==0){var l=getCandleToolTipData(this.opts.series[0].data,n,this.opts,o,this.opts.categories,this.opts.extra.candle,e),s=l.textList,h=l.offset;h.y=a.y;i.tooltip={textList:e.textList?e.textList:s,offset:e.offset!==undefined?e.offset:h,option:e,index:o}}}drawCharts.call(this,i.type,i,this.config,this.context)}if(this.opts.type==="pie"||this.opts.type==="ring"||this.opts.type==="rose"||this.opts.type==="funnel"){var o=e.index==undefined?this.getCurrentDataIndex(t):e.index;if(o>-1){var i=assign({},this.opts,{animation:false});var n=assign({},i._series_[o]);var s=[{text:e.formatter?e.formatter(n,undefined,o,i):n.name+": "+n.data,color:n.color,legendShape:this.opts.extra.tooltip.legendShape=="auto"?n.legendShape:this.opts.extra.tooltip.legendShape}];var h={x:a.x,y:a.y};i.tooltip={textList:e.textList?e.textList:s,offset:e.offset!==undefined?e.offset:h,option:e,index:o}}drawCharts.call(this,i.type,i,this.config,this.context)}if(this.opts.type==="map"){var o=e.index==undefined?this.getCurrentDataIndex(t):e.index;if(o>-1){var i=assign({},this.opts,{animation:false});var n=assign({},this.opts.series[o]);n.name=n.properties.name;var s=[{text:e.formatter?e.formatter(n,undefined,o,this.opts):n.name,color:n.color,legendShape:this.opts.extra.tooltip.legendShape=="auto"?n.legendShape:this.opts.extra.tooltip.legendShape}];var h={x:a.x,y:a.y};i.tooltip={textList:e.textList?e.textList:s,offset:e.offset!==undefined?e.offset:h,option:e,index:o}}i.updateData=false;drawCharts.call(this,i.type,i,this.config,this.context)}if(this.opts.type==="word"){var o=e.index==undefined?this.getCurrentDataIndex(t):e.index;if(o>-1){var i=assign({},this.opts,{animation:false});var n=assign({},this.opts.series[o]);var s=[{text:e.formatter?e.formatter(n,undefined,o,this.opts):n.name,color:n.color,legendShape:this.opts.extra.tooltip.legendShape=="auto"?n.legendShape:this.opts.extra.tooltip.legendShape}];var h={x:a.x,y:a.y};i.tooltip={textList:e.textList?e.textList:s,offset:e.offset!==undefined?e.offset:h,option:e,index:o}}i.updateData=false;drawCharts.call(this,i.type,i,this.config,this.context)}if(this.opts.type==="radar"){var o=e.index==undefined?this.getCurrentDataIndex(t):e.index;if(o>-1){var i=assign({},this.opts,{animation:false});var n=getSeriesDataItem(this.opts.series,o);if(n.length!==0){var s=n.map(t=>{return{text:e.formatter?e.formatter(t,this.opts.categories[o],o,this.opts):t.name+": "+t.data,color:t.color,legendShape:this.opts.extra.tooltip.legendShape=="auto"?t.legendShape:this.opts.extra.tooltip.legendShape}});var h={x:a.x,y:a.y};i.tooltip={textList:e.textList?e.textList:s,offset:e.offset!==undefined?e.offset:h,option:e,index:o}}}drawCharts.call(this,i.type,i,this.config,this.context)}};uCharts.prototype.translate=function(t){this.scrollOption={currentOffset:t,startTouchX:t,distance:0,lastMoveTime:0};let e=assign({},this.opts,{_scrollDistance_:t,animation:false});drawCharts.call(this,this.opts.type,e,this.config,this.context)};uCharts.prototype.scrollStart=function(t){var e=null;if(t.changedTouches){e=t.changedTouches[0]}else{e=t.mp.changedTouches[0]}var a=getTouches(e,this.opts,t);if(e&&this.opts.enableScroll===true){this.scrollOption.startTouchX=a.x}};uCharts.prototype.scroll=function(t){if(this.scrollOption.lastMoveTime===0){this.scrollOption.lastMoveTime=Date.now()}let e=this.opts.touchMoveLimit||60;let a=Date.now();let i=a-this.scrollOption.lastMoveTime;if(i=0){var o="touchend"!==n?e.targetTouches[0]:e.changedTouches[0];o&&st(t,o,e,i)}else st(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&&gw.test(e.type)&&(e.which=1&a?1:2&a?3:4&a?2:0),e}function ht(t,e,i){pw?t.addEventListener(e,i):t.attachEvent("on"+e,i)}function ct(t,e,i){pw?t.removeEventListener(e,i):t.detachEvent("on"+e,i)}function dt(t){return 2===t.which||3===t.which}function ft(t){var e=t[1][0]-t[0][0],i=t[1][1]-t[0][1];return Math.sqrt(e*e+i*i)}function pt(t){return[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]}function gt(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:mt}}function mt(t){mw(this.event)}function vt(){}function yt(t,e,i){if(t[t.rectHover?"rectContain":"contain"](e,i)){for(var n,o=t;o;){if(o.clipPath&&!o.clipPath.contain(e,i))return!1;o.silent&&(n=!0),o=o.parent}return!n||xw}return!1}function xt(){var t=new bw(6);return _t(t),t}function _t(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function wt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function bt(t,e,i){var n=e[0]*i[0]+e[2]*i[1],o=e[1]*i[0]+e[3]*i[1],a=e[0]*i[2]+e[2]*i[3],r=e[1]*i[2]+e[3]*i[3],s=e[0]*i[4]+e[2]*i[5]+e[4],l=e[1]*i[4]+e[3]*i[5]+e[5];return t[0]=n,t[1]=o,t[2]=a,t[3]=r,t[4]=s,t[5]=l,t}function St(t,e,i){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+i[0],t[5]=e[5]+i[1],t}function Mt(t,e,i){var n=e[0],o=e[2],a=e[4],r=e[1],s=e[3],l=e[5],u=Math.sin(i),h=Math.cos(i);return t[0]=n*h+r*u,t[1]=-n*u+r*h,t[2]=o*h+s*u,t[3]=-o*u+h*s,t[4]=h*a+u*l,t[5]=h*l-u*a,t}function It(t,e,i){var n=i[0],o=i[1];return t[0]=e[0]*n,t[1]=e[1]*o,t[2]=e[2]*n,t[3]=e[3]*o,t[4]=e[4]*n,t[5]=e[5]*o,t}function Tt(t,e){var i=e[0],n=e[2],o=e[4],a=e[1],r=e[3],s=e[5],l=i*r-a*n;return l?(l=1/l,t[0]=r*l,t[1]=-a*l,t[2]=-n*l,t[3]=i*l,t[4]=(n*s-r*o)*l,t[5]=(a*o-i*s)*l,t):null}function At(t){var e=xt();return wt(e,t),e}function Dt(t){return t>Iw||t<-Iw}function Ct(t){this._target=t.target,this._life=t.life||1e3,this._delay=t.delay||0,this._initialized=!1,this.loop=null!=t.loop&&t.loop,this.gap=t.gap||0,this.easing=t.easing||"Linear",this.onframe=t.onframe,this.ondestroy=t.ondestroy,this.onrestart=t.onrestart,this._pausedTime=0,this._paused=!1}function Lt(t){return(t=Math.round(t))<0?0:t>255?255:t}function kt(t){return(t=Math.round(t))<0?0:t>360?360:t}function Pt(t){return t<0?0:t>1?1:t}function Nt(t){return Lt(t.length&&"%"===t.charAt(t.length-1)?parseFloat(t)/100*255:parseInt(t,10))}function Ot(t){return Pt(t.length&&"%"===t.charAt(t.length-1)?parseFloat(t)/100:parseFloat(t))}function Et(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}function Rt(t,e,i){return t+(e-t)*i}function zt(t,e,i,n,o){return t[0]=e,t[1]=i,t[2]=n,t[3]=o,t}function Bt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function Vt(t,e){Vw&&Bt(Vw,e),Vw=Bw.put(t,Vw||e.slice())}function Gt(t,e){if(t){e=e||[];var i=Bw.get(t);if(i)return Bt(e,i);var n=(t+="").replace(/ /g,"").toLowerCase();if(n in zw)return Bt(e,zw[n]),Vt(t,e),e;if("#"!==n.charAt(0)){var o=n.indexOf("("),a=n.indexOf(")");if(-1!==o&&a+1===n.length){var r=n.substr(0,o),s=n.substr(o+1,a-(o+1)).split(","),l=1;switch(r){case"rgba":if(4!==s.length)return void zt(e,0,0,0,1);l=Ot(s.pop());case"rgb":return 3!==s.length?void zt(e,0,0,0,1):(zt(e,Nt(s[0]),Nt(s[1]),Nt(s[2]),l),Vt(t,e),e);case"hsla":return 4!==s.length?void zt(e,0,0,0,1):(s[3]=Ot(s[3]),Ft(s,e),Vt(t,e),e);case"hsl":return 3!==s.length?void zt(e,0,0,0,1):(Ft(s,e),Vt(t,e),e);default:return}}zt(e,0,0,0,1)}else{if(4===n.length)return(u=parseInt(n.substr(1),16))>=0&&u<=4095?(zt(e,(3840&u)>>4|(3840&u)>>8,240&u|(240&u)>>4,15&u|(15&u)<<4,1),Vt(t,e),e):void zt(e,0,0,0,1);if(7===n.length){var u=parseInt(n.substr(1),16);return u>=0&&u<=16777215?(zt(e,(16711680&u)>>16,(65280&u)>>8,255&u,1),Vt(t,e),e):void zt(e,0,0,0,1)}}}}function Ft(t,e){var i=(parseFloat(t[0])%360+360)%360/360,n=Ot(t[1]),o=Ot(t[2]),a=o<=.5?o*(n+1):o+n-o*n,r=2*o-a;return e=e||[],zt(e,Lt(255*Et(r,a,i+1/3)),Lt(255*Et(r,a,i)),Lt(255*Et(r,a,i-1/3)),1),4===t.length&&(e[3]=t[3]),e}function Wt(t){if(t){var e,i,n=t[0]/255,o=t[1]/255,a=t[2]/255,r=Math.min(n,o,a),s=Math.max(n,o,a),l=s-r,u=(s+r)/2;if(0===l)e=0,i=0;else{i=u<.5?l/(s+r):l/(2-s-r);var h=((s-n)/6+l/2)/l,c=((s-o)/6+l/2)/l,d=((s-a)/6+l/2)/l;n===s?e=d-c:o===s?e=1/3+h-d:a===s&&(e=2/3+c-h),e<0&&(e+=1),e>1&&(e-=1)}var f=[360*e,i,u];return null!=t[3]&&f.push(t[3]),f}}function Ht(t,e){var i=Gt(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,i[n]>255?i[n]=255:t[n]<0&&(i[n]=0);return qt(i,4===i.length?"rgba":"rgb")}}function Zt(t){var e=Gt(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)}function Ut(t,e,i){if(e&&e.length&&t>=0&&t<=1){i=i||[];var n=t*(e.length-1),o=Math.floor(n),a=Math.ceil(n),r=e[o],s=e[a],l=n-o;return i[0]=Lt(Rt(r[0],s[0],l)),i[1]=Lt(Rt(r[1],s[1],l)),i[2]=Lt(Rt(r[2],s[2],l)),i[3]=Pt(Rt(r[3],s[3],l)),i}}function Xt(t,e,i){if(e&&e.length&&t>=0&&t<=1){var n=t*(e.length-1),o=Math.floor(n),a=Math.ceil(n),r=Gt(e[o]),s=Gt(e[a]),l=n-o,u=qt([Lt(Rt(r[0],s[0],l)),Lt(Rt(r[1],s[1],l)),Lt(Rt(r[2],s[2],l)),Pt(Rt(r[3],s[3],l))],"rgba");return i?{color:u,leftIndex:o,rightIndex:a,value:n}:u}}function jt(t,e,i,n){if(t=Gt(t))return t=Wt(t),null!=e&&(t[0]=kt(e)),null!=i&&(t[1]=Ot(i)),null!=n&&(t[2]=Ot(n)),qt(Ft(t),"rgba")}function Yt(t,e){if((t=Gt(t))&&null!=e)return t[3]=Pt(e),qt(t,"rgba")}function qt(t,e){if(t&&t.length){var i=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(i+=","+t[3]),e+"("+i+")"}}function Kt(t,e){return t[e]}function $t(t,e,i){t[e]=i}function Jt(t,e,i){return(e-t)*i+t}function Qt(t,e,i){return i>.5?e:t}function te(t,e,i,n,o){var a=t.length;if(1===o)for(s=0;so)t.length=o;else for(r=n;r=0&&!(m[i]<=e);i--);i=Math.min(i,u-2)}else{for(i=L;ie);i++);i=Math.min(i-1,u-2)}L=i,k=e;var n=m[i+1]-m[i];if(0!==n)if(I=(e-m[i])/n,l)if(A=v[i],T=v[0===i?i:i-1],D=v[i>u-2?u-1:i+1],C=v[i>u-3?u-1:i+2],d)ne(T,A,D,C,I,I*I,I*I*I,r(t,o),g);else{if(f)a=ne(T,A,D,C,I,I*I,I*I*I,P,1),a=re(P);else{if(p)return Qt(A,D,I);a=oe(T,A,D,C,I,I*I,I*I*I)}s(t,o,a)}else if(d)te(v[i],v[i+1],I,r(t,o),g);else{var a;if(f)te(v[i],v[i+1],I,P,1),a=re(P);else{if(p)return Qt(v[i],v[i+1],I);a=Jt(v[i],v[i+1],I)}s(t,o,a)}},ondestroy:i});return e&&"spline"!==e&&(N.easing=e),N}}}function ue(t,e,i,n,o,a,r,s){_(n)?(a=o,o=n,n=0):x(o)?(a=o,o="linear",n=0):x(n)?(a=n,n=0):x(i)?(a=i,i=500):i||(i=500),t.stopAnimation(),he(t,"",t,e,i,n,s);var l=t.animators.slice(),u=l.length;u||a&&a();for(var h=0;h0&&t.animate(e,!1).when(null==o?500:o,s).delay(a||0)}function ce(t,e,i,n){if(e){var o={};o[e]={},o[e][i]=n,t.attr(o)}else t.attr(i,n)}function de(t,e,i,n){i<0&&(t+=i,i=-i),n<0&&(e+=n,n=-n),this.x=t,this.y=e,this.width=i,this.height=n}function fe(t){for(var e=0;t>=eb;)e|=1&t,t>>=1;return t+e}function pe(t,e,i,n){var o=e+1;if(o===i)return 1;if(n(t[o++],t[e])<0){for(;o=0;)o++;return o-e}function ge(t,e,i){for(i--;e>>1])<0?l=a:s=a+1;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(;u>0;)t[s+u]=t[s+u-1],u--}t[s]=r}}function ve(t,e,i,n,o,a){var r=0,s=0,l=1;if(a(t,e[i+o])>0){for(s=n-o;l0;)r=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),r+=o,l+=o}else{for(s=o+1;ls&&(l=s);var u=r;r=o-l,l=o-u}for(r++;r>>1);a(t,e[i+h])>0?r=h+1:l=h}return l}function ye(t,e,i,n,o,a){var r=0,s=0,l=1;if(a(t,e[i+o])<0){for(s=o+1;ls&&(l=s);var u=r;r=o-l,l=o-u}else{for(s=n-o;l=0;)r=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),r+=o,l+=o}for(r++;r>>1);a(t,e[i+h])<0?l=h:r=h+1}return l}function xe(t,e){function i(i){var s=a[i],u=r[i],h=a[i+1],c=r[i+1];r[i]=u+c,i===l-3&&(a[i+1]=a[i+2],r[i+1]=r[i+2]),l--;var d=ye(t[h],t,s,u,0,e);s+=d,0!==(u-=d)&&0!==(c=ve(t[s+u-1],t,h,c,c-1,e))&&(u<=c?n(s,u,h,c):o(s,u,h,c))}function n(i,n,o,a){var r=0;for(r=0;r=ib||f>=ib);if(p)break;g<0&&(g=0),g+=2}if((s=g)<1&&(s=1),1===n){for(r=0;r=0;r--)t[f+r]=t[d+r];if(0===n){v=!0;break}}if(t[c--]=u[h--],1==--a){v=!0;break}if(0!=(m=a-ve(t[l],u,0,a,a-1,e))){for(a-=m,f=(c-=m)+1,d=(h-=m)+1,r=0;r=ib||m>=ib);if(v)break;p<0&&(p=0),p+=2}if((s=p)<1&&(s=1),1===a){for(f=(c-=n)+1,d=(l-=n)+1,r=n-1;r>=0;r--)t[f+r]=t[d+r];t[c]=u[h]}else{if(0===a)throw new Error;for(d=c-(a-1),r=0;r=0;r--)t[f+r]=t[d+r];t[c]=u[h]}else for(d=c-(a-1),r=0;r1;){var t=l-2;if(t>=1&&r[t-1]<=r[t]+r[t+1]||t>=2&&r[t-2]<=r[t]+r[t-1])r[t-1]r[t+1])break;i(t)}},this.forceMergeRuns=function(){for(;l>1;){var t=l-2;t>0&&r[t-1]s&&(l=s),me(t,i,i+l,i+a,e),a=l}r.pushRun(i,a),r.mergeRuns(),o-=a,i+=a}while(0!==o);r.forceMergeRuns()}}function we(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}function be(t,e,i){var n=null==e.x?0:e.x,o=null==e.x2?1:e.x2,a=null==e.y?0:e.y,r=null==e.y2?0:e.y2;return e.global||(n=n*i.width+i.x,o=o*i.width+i.x,a=a*i.height+i.y,r=r*i.height+i.y),n=isNaN(n)?0:n,o=isNaN(o)?1:o,a=isNaN(a)?0:a,r=isNaN(r)?0:r,t.createLinearGradient(n,a,o,r)}function Se(t,e,i){var n=i.width,o=i.height,a=Math.min(n,o),r=null==e.x?.5:e.x,s=null==e.y?.5:e.y,l=null==e.r?.5:e.r;return e.global||(r=r*n+i.x,s=s*o+i.y,l*=a),t.createRadialGradient(r,s,0,r,s,l)}function Me(){return!1}function Ie(t,e,i){var n=iw(),o=e.getWidth(),a=e.getHeight(),r=n.style;return r&&(r.position="absolute",r.left=0,r.top=0,r.width=o+"px",r.height=a+"px",n.setAttribute("data-zr-dom-id",t)),n.width=o*i,n.height=a*i,n}function Te(t){if("string"==typeof t){var e=mb.get(t);return e&&e.image}return t}function Ae(t,e,i,n,o){if(t){if("string"==typeof t){if(e&&e.__zrImageSrc===t||!i)return e;var a=mb.get(t),r={hostEl:i,cb:n,cbPayload:o};return a?!Ce(e=a.image)&&a.pending.push(r):((e=new Image).onload=e.onerror=De,mb.put(t,e.__cachedImgObj={image:e,pending:[r]}),e.src=e.__zrImageSrc=t),e}return t}return e}function De(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;exb&&(yb=0,vb={}),yb++,vb[i]=o,o}function ke(t,e,i,n,o,a,r,s){return r?Ne(t,e,i,n,o,a,r,s):Pe(t,e,i,n,o,a,s)}function Pe(t,e,i,n,o,a,r){var s=He(t,e,o,a,r),l=Le(t,e);o&&(l+=o[1]+o[3]);var u=s.outerHeight,h=new de(Oe(0,l,i),Ee(0,u,n),l,u);return h.lineHeight=s.lineHeight,h}function Ne(t,e,i,n,o,a,r,s){var l=Ze(t,{rich:r,truncate:s,font:e,textAlign:i,textPadding:o,textLineHeight:a}),u=l.outerWidth,h=l.outerHeight;return new de(Oe(0,u,i),Ee(0,h,n),u,h)}function Oe(t,e,i){return"right"===i?t-=e:"center"===i&&(t-=e/2),t}function Ee(t,e,i){return"middle"===i?t-=e/2:"bottom"===i&&(t-=e),t}function Re(t,e,i){var n=e.x,o=e.y,a=e.height,r=e.width,s=a/2,l="left",u="top";switch(t){case"left":n-=i,o+=s,l="right",u="middle";break;case"right":n+=i+r,o+=s,u="middle";break;case"top":n+=r/2,o-=i,l="center",u="bottom";break;case"bottom":n+=r/2,o+=a+i,l="center";break;case"inside":n+=r/2,o+=s,l="center",u="middle";break;case"insideLeft":n+=i,o+=s,u="middle";break;case"insideRight":n+=r-i,o+=s,l="right",u="middle";break;case"insideTop":n+=r/2,o+=i,l="center";break;case"insideBottom":n+=r/2,o+=a-i,l="center",u="bottom";break;case"insideTopLeft":n+=i,o+=i;break;case"insideTopRight":n+=r-i,o+=i,l="right";break;case"insideBottomLeft":n+=i,o+=a-i,u="bottom";break;case"insideBottomRight":n+=r-i,o+=a-i,l="right",u="bottom"}return{x:n,y:o,textAlign:l,textVerticalAlign:u}}function ze(t,e,i,n,o){if(!e)return"";var a=(t+"").split("\n");o=Be(e,i,n,o);for(var r=0,s=a.length;r=r;l++)s-=r;var u=Le(i,e);return u>s&&(i="",u=0),s=t-u,n.ellipsis=i,n.ellipsisWidth=u,n.contentWidth=s,n.containerWidth=t,n}function Ve(t,e){var i=e.containerWidth,n=e.font,o=e.contentWidth;if(!i)return"";var a=Le(t,n);if(a<=i)return t;for(var r=0;;r++){if(a<=o||r>=e.maxIterations){t+=e.ellipsis;break}var s=0===r?Ge(t,o,e.ascCharWidth,e.cnCharWidth):a>0?Math.floor(t.length*o/a):0;a=Le(t=t.substr(0,s),n)}return""===t&&(t=e.placeholder),t}function Ge(t,e,i,n){for(var o=0,a=0,r=t.length;au)t="",r=[];else if(null!=h)for(var c=Be(h-(i?i[1]+i[3]:0),e,o.ellipsis,{minChar:o.minChar,placeholder:o.placeholder}),d=0,f=r.length;do&&Ue(i,t.substring(o,a)),Ue(i,n[2],n[1]),o=_b.lastIndex}of)return{lines:[],width:0,height:0};k.textWidth=Le(k.text,_);var b=y.textWidth,S=null==b||"auto"===b;if("string"==typeof b&&"%"===b.charAt(b.length-1))k.percentWidth=b,u.push(k),b=0;else{if(S){b=k.textWidth;var M=y.textBackgroundColor,I=M&&M.image;I&&Ce(I=Te(I))&&(b=Math.max(b,I.width*w/I.height))}var T=x?x[1]+x[3]:0;b+=T;var C=null!=d?d-m:null;null!=C&&Cl&&(i*=l/(c=i+n),n*=l/c),o+a>l&&(o*=l/(c=o+a),a*=l/c),n+o>u&&(n*=u/(c=n+o),o*=u/c),i+a>u&&(i*=u/(c=i+a),a*=u/c),t.moveTo(r+i,s),t.lineTo(r+l-n,s),0!==n&&t.arc(r+l-n,s+n,n,-Math.PI/2,0),t.lineTo(r+l,s+u-o),0!==o&&t.arc(r+l-o,s+u-o,o,0,Math.PI/2),t.lineTo(r+a,s+u),0!==a&&t.arc(r+a,s+u-a,a,Math.PI/2,Math.PI),t.lineTo(r,s+i),0!==i&&t.arc(r+i,s+i,i,Math.PI,1.5*Math.PI)}function Ye(t){return qe(t),d(t.rich,qe),t}function qe(t){if(t){t.font=Xe(t);var e=t.textAlign;"middle"===e&&(e="center"),t.textAlign=null==e||Mb[e]?e:"left";var i=t.textVerticalAlign||t.textBaseline;"center"===i&&(i="middle"),t.textVerticalAlign=null==i||Ib[i]?i:"top",t.textPadding&&(t.textPadding=L(t.textPadding))}}function Ke(t,e,i,n,o,a){n.rich?Je(t,e,i,n,o,a):$e(t,e,i,n,o,a)}function $e(t,e,i,n,o,a){var r,s=ii(n),l=!1,u=e.__attrCachedBy===rb.PLAIN_TEXT;a!==sb?(a&&(r=a.style,l=!s&&u&&r),e.__attrCachedBy=s?rb.NONE:rb.PLAIN_TEXT):u&&(e.__attrCachedBy=rb.NONE);var h=n.font||Sb;l&&h===(r.font||Sb)||(e.font=h);var c=t.__computedFont;t.__styleFont!==h&&(t.__styleFont=h,c=t.__computedFont=e.font);var d=n.textPadding,f=n.textLineHeight,p=t.__textCotentBlock;p&&!t.__dirtyText||(p=t.__textCotentBlock=He(i,c,d,f,n.truncate));var g=p.outerHeight,m=p.lines,v=p.lineHeight,y=ai(g,n,o),x=y.baseX,_=y.baseY,w=y.textAlign||"left",b=y.textVerticalAlign;ti(e,n,o,x,_);var S=Ee(_,g,b),M=x,I=S;if(s||d){var T=Le(i,c);d&&(T+=d[1]+d[3]);var A=Oe(x,T,w);s&&ni(t,e,n,A,S,T,g),d&&(M=hi(x,w,d),I+=d[0])}e.textAlign=w,e.textBaseline="middle",e.globalAlpha=n.opacity||1;for(B=0;B=0&&"right"===(_=b[C]).textAlign;)ei(t,e,_,n,M,v,D,"right"),I-=_.width,D-=_.width,C--;for(A+=(a-(A-m)-(y-D)-I)/2;T<=C;)ei(t,e,_=b[T],n,M,v,A+_.width/2,"center"),A+=_.width,T++;v+=M}}function ti(t,e,i,n,o){if(i&&e.textRotation){var a=e.textOrigin;"center"===a?(n=i.width/2+i.x,o=i.height/2+i.y):a&&(n=a[0]+i.x,o=a[1]+i.y),t.translate(n,o),t.rotate(-e.textRotation),t.translate(-n,-o)}}function ei(t,e,i,n,o,a,r,s){var l=n.rich[i.styleName]||{};l.text=i.text;var u=i.textVerticalAlign,h=a+o/2;"top"===u?h=a+i.height/2:"bottom"===u&&(h=a+o-i.height/2),!i.isLineHolder&&ii(l)&&ni(t,e,l,"right"===s?r-i.width:"center"===s?r-i.width/2:r,h-i.height/2,i.width,i.height);var c=i.textPadding;c&&(r=hi(r,s,c),h-=i.height/2-c[2]-i.textHeight/2),ri(e,"shadowBlur",D(l.textShadowBlur,n.textShadowBlur,0)),ri(e,"shadowColor",l.textShadowColor||n.textShadowColor||"transparent"),ri(e,"shadowOffsetX",D(l.textShadowOffsetX,n.textShadowOffsetX,0)),ri(e,"shadowOffsetY",D(l.textShadowOffsetY,n.textShadowOffsetY,0)),ri(e,"textAlign",s),ri(e,"textBaseline","middle"),ri(e,"font",i.font||Sb);var d=si(l.textStroke||n.textStroke,p),f=li(l.textFill||n.textFill),p=A(l.textStrokeWidth,n.textStrokeWidth);d&&(ri(e,"lineWidth",p),ri(e,"strokeStyle",d),e.strokeText(i.text,r,h)),f&&(ri(e,"fillStyle",f),e.fillText(i.text,r,h))}function ii(t){return!!(t.textBackgroundColor||t.textBorderWidth&&t.textBorderColor)}function ni(t,e,i,n,o,a,r){var s=i.textBackgroundColor,l=i.textBorderWidth,u=i.textBorderColor,h=_(s);if(ri(e,"shadowBlur",i.textBoxShadowBlur||0),ri(e,"shadowColor",i.textBoxShadowColor||"transparent"),ri(e,"shadowOffsetX",i.textBoxShadowOffsetX||0),ri(e,"shadowOffsetY",i.textBoxShadowOffsetY||0),h||l&&u){e.beginPath();var c=i.textBorderRadius;c?je(e,{x:n,y:o,width:a,height:r,r:c}):e.rect(n,o,a,r),e.closePath()}if(h)if(ri(e,"fillStyle",s),null!=i.fillOpacity){f=e.globalAlpha;e.globalAlpha=i.fillOpacity*i.opacity,e.fill(),e.globalAlpha=f}else e.fill();else if(w(s)){var d=s.image;(d=Ae(d,null,t,oi,s))&&Ce(d)&&e.drawImage(d,n,o,a,r)}if(l&&u)if(ri(e,"lineWidth",l),ri(e,"strokeStyle",u),null!=i.strokeOpacity){var f=e.globalAlpha;e.globalAlpha=i.strokeOpacity*i.opacity,e.stroke(),e.globalAlpha=f}else e.stroke()}function oi(t,e){e.image=t}function ai(t,e,i){var n=e.x||0,o=e.y||0,a=e.textAlign,r=e.textVerticalAlign;if(i){var s=e.textPosition;if(s instanceof Array)n=i.x+ui(s[0],i.width),o=i.y+ui(s[1],i.height);else{var l=Re(s,i,e.textDistance);n=l.x,o=l.y,a=a||l.textAlign,r=r||l.textVerticalAlign}var u=e.textOffset;u&&(n+=u[0],o+=u[1])}return{baseX:n,baseY:o,textAlign:a,textVerticalAlign:r}}function ri(t,e,i){return t[e]=ab(t,e,i),t[e]}function si(t,e){return null==t||e<=0||"transparent"===t||"none"===t?null:t.image||t.colorStops?"#000":t}function li(t){return null==t||"none"===t?null:t.image||t.colorStops?"#000":t}function ui(t,e){return"string"==typeof t?t.lastIndexOf("%")>=0?parseFloat(t)/100*e:parseFloat(t):t}function hi(t,e,i){return"right"===e?t-i[1]:"center"===e?t+i[3]/2-i[1]/2:t+i[3]}function ci(t,e){return null!=t&&(t||e.textBackgroundColor||e.textBorderWidth&&e.textBorderColor||e.textPadding)}function di(t){t=t||{},Kw.call(this,t);for(var e in t)t.hasOwnProperty(e)&&"style"!==e&&(this[e]=t[e]);this.style=new ub(t.style,this),this._rect=null,this.__clipPaths=[]}function fi(t){di.call(this,t)}function pi(t){return parseInt(t,10)}function gi(t){return!!t&&(!!t.__builtin__||"function"==typeof t.resize&&"function"==typeof t.refresh)}function mi(t,e,i){return Cb.copy(t.getBoundingRect()),t.transform&&Cb.applyTransform(t.transform),Lb.width=e,Lb.height=i,!Cb.intersect(Lb)}function vi(t,e){if(t===e)return!1;if(!t||!e||t.length!==e.length)return!0;for(var i=0;i=i.length&&i.push({option:t})}}),i}function Ni(t){var e=R();Zb(t,function(t,i){var n=t.exist;n&&e.set(n.id,t)}),Zb(t,function(t,i){var n=t.option;k(!n||null==n.id||!e.get(n.id)||e.get(n.id)===t,"id duplicates: "+(n&&n.id)),n&&null!=n.id&&e.set(n.id,t),!t.keyInfo&&(t.keyInfo={})}),Zb(t,function(t,i){var n=t.exist,o=t.option,a=t.keyInfo;if(Ub(o)){if(a.name=null!=o.name?o.name+"":n?n.name:jb+i,n)a.id=n.id;else if(null!=o.id)a.id=o.id+"";else{var r=0;do{a.id="\0"+a.name+"\0"+r++}while(e.get(a.id))}e.set(a.id,t)}})}function Oi(t){var e=t.name;return!(!e||!e.indexOf(jb))}function Ei(t){return Ub(t)&&t.id&&0===(t.id+"").indexOf("\0_ec_\0")}function Ri(t,e){function i(t,e,i){for(var n=0,o=t.length;n-rS&&trS||t<-rS}function tn(t,e,i,n,o){var a=1-o;return a*a*(a*t+3*o*e)+o*o*(o*n+3*a*i)}function en(t,e,i,n,o){var a=1-o;return 3*(((e-t)*a+2*(i-e)*o)*a+(n-i)*o*o)}function nn(t,e,i,n,o,a){var r=n+3*(e-i)-t,s=3*(i-2*e+t),l=3*(e-t),u=t-o,h=s*s-3*r*l,c=s*l-9*r*u,d=l*l-3*s*u,f=0;if(Ji(h)&&Ji(c))Ji(s)?a[0]=0:(M=-l/s)>=0&&M<=1&&(a[f++]=M);else{var p=c*c-4*h*d;if(Ji(p)){var g=c/h,m=-g/2;(M=-s/r+g)>=0&&M<=1&&(a[f++]=M),m>=0&&m<=1&&(a[f++]=m)}else if(p>0){var v=aS(p),y=h*s+1.5*r*(-c+v),x=h*s+1.5*r*(-c-v);(M=(-s-((y=y<0?-oS(-y,uS):oS(y,uS))+(x=x<0?-oS(-x,uS):oS(x,uS))))/(3*r))>=0&&M<=1&&(a[f++]=M)}else{var _=(2*h*s-3*r*c)/(2*aS(h*h*h)),w=Math.acos(_)/3,b=aS(h),S=Math.cos(w),M=(-s-2*b*S)/(3*r),m=(-s+b*(S+lS*Math.sin(w)))/(3*r),I=(-s+b*(S-lS*Math.sin(w)))/(3*r);M>=0&&M<=1&&(a[f++]=M),m>=0&&m<=1&&(a[f++]=m),I>=0&&I<=1&&(a[f++]=I)}}return f}function on(t,e,i,n,o){var a=6*i-12*e+6*t,r=9*e+3*n-3*t-9*i,s=3*e-3*t,l=0;if(Ji(r))Qi(a)&&(c=-s/a)>=0&&c<=1&&(o[l++]=c);else{var u=a*a-4*r*s;if(Ji(u))o[0]=-a/(2*r);else if(u>0){var h=aS(u),c=(-a+h)/(2*r),d=(-a-h)/(2*r);c>=0&&c<=1&&(o[l++]=c),d>=0&&d<=1&&(o[l++]=d)}}return l}function an(t,e,i,n,o,a){var r=(e-t)*o+t,s=(i-e)*o+e,l=(n-i)*o+i,u=(s-r)*o+r,h=(l-s)*o+s,c=(h-u)*o+u;a[0]=t,a[1]=r,a[2]=u,a[3]=c,a[4]=c,a[5]=h,a[6]=l,a[7]=n}function rn(t,e,i,n,o,a,r,s,l,u,h){var c,d,f,p,g,m=.005,v=1/0;hS[0]=l,hS[1]=u;for(var y=0;y<1;y+=.05)cS[0]=tn(t,i,o,r,y),cS[1]=tn(e,n,a,s,y),(p=hw(hS,cS))=0&&p=0&&c<=1&&(o[l++]=c);else{var u=r*r-4*a*s;if(Ji(u))(c=-r/(2*a))>=0&&c<=1&&(o[l++]=c);else if(u>0){var h=aS(u),c=(-r+h)/(2*a),d=(-r-h)/(2*a);c>=0&&c<=1&&(o[l++]=c),d>=0&&d<=1&&(o[l++]=d)}}return l}function hn(t,e,i){var n=t+i-2*e;return 0===n?.5:(t-e)/n}function cn(t,e,i,n,o){var a=(e-t)*n+t,r=(i-e)*n+e,s=(r-a)*n+a;o[0]=t,o[1]=a,o[2]=s,o[3]=s,o[4]=r,o[5]=i}function dn(t,e,i,n,o,a,r,s,l){var u,h=.005,c=1/0;hS[0]=r,hS[1]=s;for(var d=0;d<1;d+=.05)cS[0]=sn(t,i,o,d),cS[1]=sn(e,n,a,d),(m=hw(hS,cS))=0&&m1e-4)return s[0]=t-i,s[1]=e-n,l[0]=t+i,void(l[1]=e+n);if(yS[0]=mS(o)*i+t,yS[1]=gS(o)*n+e,xS[0]=mS(a)*i+t,xS[1]=gS(a)*n+e,u(s,yS,xS),h(l,yS,xS),(o%=vS)<0&&(o+=vS),(a%=vS)<0&&(a+=vS),o>a&&!r?a+=vS:oo&&(_S[0]=mS(f)*i+t,_S[1]=gS(f)*n+e,u(s,_S,s),h(l,_S,l))}function yn(t,e,i,n,o,a,r){if(0===o)return!1;var s=o,l=0,u=t;if(r>e+s&&r>n+s||rt+s&&a>i+s||ae+c&&h>n+c&&h>a+c&&h>s+c||ht+c&&u>i+c&&u>o+c&&u>r+c||ue+u&&l>n+u&&l>a+u||lt+u&&s>i+u&&s>o+u||si||h+uo&&(o+=zS);var d=Math.atan2(l,s);return d<0&&(d+=zS),d>=n&&d<=o||d+zS>=n&&d+zS<=o}function Sn(t,e,i,n,o,a){if(a>e&&a>n||ao?r:0}function Mn(t,e){return Math.abs(t-e)e&&u>n&&u>a&&u>s||u1&&In(),c=tn(e,n,a,s,WS[0]),p>1&&(d=tn(e,n,a,s,WS[1]))),2===p?me&&s>n&&s>a||s=0&&u<=1){for(var h=0,c=sn(e,n,a,u),d=0;di||s<-i)return 0;u=Math.sqrt(i*i-s*s);FS[0]=-u,FS[1]=u;var l=Math.abs(n-o);if(l<1e-4)return 0;if(l%VS<1e-4){n=0,o=VS;p=a?1:-1;return r>=FS[0]+t&&r<=FS[1]+t?p:0}if(a){var u=n;n=wn(o),o=wn(u)}else n=wn(n),o=wn(o);n>o&&(o+=VS);for(var h=0,c=0;c<2;c++){var d=FS[c];if(d+t>r){var f=Math.atan2(s,d),p=a?1:-1;f<0&&(f=VS+f),(f>=n&&f<=o||f+VS>=n&&f+VS<=o)&&(f>Math.PI/2&&f<1.5*Math.PI&&(p=-p),h+=p)}}return h}function Cn(t,e,i,n,o){for(var a=0,r=0,s=0,l=0,u=0,h=0;h1&&(i||(a+=Sn(r,s,l,u,n,o))),1===h&&(l=r=t[h],u=s=t[h+1]),c){case BS.M:r=l=t[h++],s=u=t[h++];break;case BS.L:if(i){if(yn(r,s,t[h],t[h+1],e,n,o))return!0}else a+=Sn(r,s,t[h],t[h+1],n,o)||0;r=t[h++],s=t[h++];break;case BS.C:if(i){if(xn(r,s,t[h++],t[h++],t[h++],t[h++],t[h],t[h+1],e,n,o))return!0}else a+=Tn(r,s,t[h++],t[h++],t[h++],t[h++],t[h],t[h+1],n,o)||0;r=t[h++],s=t[h++];break;case BS.Q:if(i){if(_n(r,s,t[h++],t[h++],t[h],t[h+1],e,n,o))return!0}else a+=An(r,s,t[h++],t[h++],t[h],t[h+1],n,o)||0;r=t[h++],s=t[h++];break;case BS.A:var d=t[h++],f=t[h++],p=t[h++],g=t[h++],m=t[h++],v=t[h++];h+=1;var y=1-t[h++],x=Math.cos(m)*p+d,_=Math.sin(m)*g+f;h>1?a+=Sn(r,s,x,_,n,o):(l=x,u=_);var w=(n-d)*g/p+d;if(i){if(bn(d,f,g,m,m+v,y,e,w,o))return!0}else a+=Dn(d,f,g,m,m+v,y,w,o);r=Math.cos(m+v)*p+d,s=Math.sin(m+v)*g+f;break;case BS.R:l=r=t[h++],u=s=t[h++];var x=l+t[h++],_=u+t[h++];if(i){if(yn(l,u,x,u,e,n,o)||yn(x,u,x,_,e,n,o)||yn(x,_,l,_,e,n,o)||yn(l,_,l,u,e,n,o))return!0}else a+=Sn(x,u,x,_,n,o),a+=Sn(l,_,l,u,n,o);break;case BS.Z:if(i){if(yn(r,s,l,u,e,n,o))return!0}else a+=Sn(r,s,l,u,n,o);r=l,s=u}}return i||Mn(s,u)||(a+=Sn(r,s,l,u,n,o)||0),0!==a}function Ln(t,e,i){return Cn(t,0,!1,e,i)}function kn(t,e,i,n){return Cn(t,e,!0,i,n)}function Pn(t){di.call(this,t),this.path=null}function Nn(t,e,i,n,o,a,r,s,l,u,h){var c=l*(tM/180),d=QS(c)*(t-i)/2+JS(c)*(e-n)/2,f=-1*JS(c)*(t-i)/2+QS(c)*(e-n)/2,p=d*d/(r*r)+f*f/(s*s);p>1&&(r*=$S(p),s*=$S(p));var g=(o===a?-1:1)*$S((r*r*(s*s)-r*r*(f*f)-s*s*(d*d))/(r*r*(f*f)+s*s*(d*d)))||0,m=g*r*f/s,v=g*-s*d/r,y=(t+i)/2+QS(c)*m-JS(c)*v,x=(e+n)/2+JS(c)*m+QS(c)*v,_=nM([1,0],[(d-m)/r,(f-v)/s]),w=[(d-m)/r,(f-v)/s],b=[(-1*d-m)/r,(-1*f-v)/s],S=nM(w,b);iM(w,b)<=-1&&(S=tM),iM(w,b)>=1&&(S=0),0===a&&S>0&&(S-=2*tM),1===a&&S<0&&(S+=2*tM),h.addData(u,y,x,r,s,_,S,c,a)}function On(t){if(!t)return new ES;for(var e,i=0,n=0,o=i,a=n,r=new ES,s=ES.CMD,l=t.match(oM),u=0;u=2){if(o&&"spline"!==o){var a=fM(n,o,i,e.smoothConstraint);t.moveTo(n[0][0],n[0][1]);for(var r=n.length,s=0;s<(i?r:r-1);s++){var l=a[2*s],u=a[2*s+1],h=n[(s+1)%r];t.bezierCurveTo(l[0],l[1],u[0],u[1],h[0],h[1])}}else{"spline"===o&&(n=dM(n,i)),t.moveTo(n[0][0],n[0][1]);for(var s=1,c=n.length;s=0)?(i={textFill:null,textStroke:t.textStroke,textStrokeWidth:t.textStrokeWidth},t.textFill="#fff",null==t.textStroke&&(t.textStroke=a,null==t.textStrokeWidth&&(t.textStrokeWidth=2))):null!=a&&(i={textFill:null},t.textFill=a),i&&(t.insideRollback=i)}}function bo(t){var e=t.insideRollback;e&&(t.textFill=e.textFill,t.textStroke=e.textStroke,t.textStrokeWidth=e.textStrokeWidth,t.insideRollback=null)}function So(t,e){var i=e||e.getModel("textStyle");return P([t.fontStyle||i&&i.getShallow("fontStyle")||"",t.fontWeight||i&&i.getShallow("fontWeight")||"",(t.fontSize||i&&i.getShallow("fontSize")||12)+"px",t.fontFamily||i&&i.getShallow("fontFamily")||"sans-serif"].join(" "))}function Mo(t,e,i,n,o,a){if("function"==typeof o&&(a=o,o=null),n&&n.isAnimationEnabled()){var r=t?"Update":"",s=n.getShallow("animationDuration"+r),l=n.getShallow("animationEasing"+r),u=n.getShallow("animationDelay"+r);"function"==typeof u&&(u=u(o,n.getAnimationDelayParams?n.getAnimationDelayParams(e,o):null)),"function"==typeof s&&(s=s(o)),s>0?e.animateTo(i,s,u||0,l,a,!!a):(e.stopAnimation(),e.attr(i),a&&a())}else e.stopAnimation(),e.attr(i),a&&a()}function Io(t,e,i,n,o){Mo(!0,t,e,i,n,o)}function To(t,e,i,n,o){Mo(!1,t,e,i,n,o)}function Ao(t,e){for(var i=_t([]);t&&t!==e;)bt(i,t.getLocalTransform(),i),t=t.parent;return i}function Do(t,e,i){return e&&!c(e)&&(e=Tw.getLocalTransform(e)),i&&(e=Tt([],e)),Q([],t,e)}function Co(t,e,i){var n=0===e[4]||0===e[5]||0===e[0]?1:Math.abs(2*e[4]/e[0]),o=0===e[4]||0===e[5]||0===e[2]?1:Math.abs(2*e[4]/e[2]),a=["left"===t?-n:"right"===t?n:0,"top"===t?-o:"bottom"===t?o:0];return a=Do(a,e,i),Math.abs(a[0])>Math.abs(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function Lo(t,e,i,n){function o(t){var e={position:F(t.position),rotation:t.rotation};return t.shape&&(e.shape=a({},t.shape)),e}if(t&&e){var r=function(t){var e={};return t.traverse(function(t){!t.isGroup&&t.anid&&(e[t.anid]=t)}),e}(t);e.traverse(function(t){if(!t.isGroup&&t.anid){var e=r[t.anid];if(e){var n=o(t);t.attr(o(e)),Io(t,n,i,t.dataIndex)}}})}}function ko(t,e){return f(t,function(t){var i=t[0];i=LM(i,e.x),i=kM(i,e.x+e.width);var n=t[1];return n=LM(n,e.y),n=kM(n,e.y+e.height),[i,n]})}function Po(t,e,i){var n=(e=a({rectHover:!0},e)).style={strokeNoScale:!0};if(i=i||{x:-1,y:-1,width:2,height:2},t)return 0===t.indexOf("image://")?(n.image=t.slice(8),r(n,i),new fi(e)):Xn(t.replace("path://",""),e,i,"center")}function No(t,e,i){this.parentModel=e,this.ecModel=i,this.option=t}function Oo(t,e,i){for(var n=0;n0){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]}else{if(t===e[0])return i[0];if(t===e[1])return i[1]}return(t-e[0])/o*a+i[0]}function Vo(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?zo(t).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):null==t?NaN:+t}function Go(t,e,i){return null==e&&(e=10),e=Math.min(Math.max(0,e),20),t=(+t).toFixed(e),i?t:+t}function Fo(t){return t.sort(function(t,e){return t-e}),t}function Wo(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 Ho(t){var e=t.toString(),i=e.indexOf("e");if(i>0){var n=+e.slice(i+1);return n<0?-n:0}var o=e.indexOf(".");return o<0?0:e.length-1-o}function Zo(t,e){var i=Math.log,n=Math.LN10,o=Math.floor(i(t[1]-t[0])/n),a=Math.round(i(Math.abs(e[1]-e[0]))/n),r=Math.min(Math.max(-o+a,0),20);return isFinite(r)?r:20}function Uo(t,e,i){if(!t[e])return 0;var n=p(t,function(t,e){return t+(isNaN(e)?0:e)},0);if(0===n)return 0;for(var o=Math.pow(10,i),a=f(t,function(t){return(isNaN(t)?0:t)/n*o*100}),r=100*o,s=f(a,function(t){return Math.floor(t)}),l=p(s,function(t,e){return t+e},0),u=f(a,function(t,e){return t-s[e]});lh&&(h=u[d],c=d);++s[c],u[c]=0,++l}return s[e]/o}function Xo(t){var e=2*Math.PI;return(t%e+e)%e}function jo(t){return t>-UM&&t=-20?+t.toFixed(n<0?-n:0):t}function Jo(t){function e(t,i,n){return t.interval[n]=0}function ta(t){return isNaN(t)?"-":(t=(t+"").split("."))[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")}function ea(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,function(t,e){return e.toUpperCase()}),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t}function ia(t){return null==t?"":(t+"").replace(KM,function(t,e){return $M[e]})}function na(t,e,i){y(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 ra(t,e){return t+="","0000".substr(0,e-t.length)+t}function sa(t,e,i){"week"!==t&&"month"!==t&&"quarter"!==t&&"half-year"!==t&&"year"!==t||(t="MM-dd\nyyyy");var n=Yo(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",ra(r,2)).replace("M",r).replace("yyyy",a).replace("yy",a%100).replace("dd",ra(s,2)).replace("d",s).replace("hh",ra(l,2)).replace("h",l).replace("mm",ra(u,2)).replace("m",u).replace("ss",ra(h,2)).replace("s",h).replace("SSS",ra(c,3))}function la(t){return t?t.charAt(0).toUpperCase()+t.substr(1):t}function ua(t,e,i,n,o){var a=0,r=0;null==n&&(n=1/0),null==o&&(o=1/0);var s=0;e.eachChild(function(l,u){var h,c,d=l.position,f=l.getBoundingRect(),p=e.childAt(u+1),g=p&&p.getBoundingRect();if("horizontal"===t){var m=f.width+(g?-g.x+f.x:0);(h=a+m)>n||l.newline?(a=0,h=m,r+=s+i,s=f.height):s=Math.max(s,f.height)}else{var v=f.height+(g?-g.y+f.y:0);(c=r+v)>o||l.newline?(a+=s+i,r=0,c=v,s=f.width):s=Math.max(s,f.width)}l.newline||(d[0]=a,d[1]=r,"horizontal"===t?a=h+i:r=c+i)})}function ha(t,e,i){var n=e.width,o=e.height,a=Vo(t.x,n),r=Vo(t.y,o),s=Vo(t.x2,n),l=Vo(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=qM(i||0),{width:Math.max(s-a-i[1]-i[3],0),height:Math.max(l-r-i[0]-i[2],0)}}function ca(t,e,i){i=qM(i||0);var n=e.width,o=e.height,a=Vo(t.left,n),r=Vo(t.top,o),s=Vo(t.right,n),l=Vo(t.bottom,o),u=Vo(t.width,n),h=Vo(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)&&(f>n/o?u=.8*n:h=.8*o),isNaN(u)&&(u=f*h),isNaN(h)&&(h=u/f)),isNaN(a)&&(a=n-s-u-d),isNaN(r)&&(r=o-l-h-c),t.left||t.right){case"center":a=n/2-u/2-i[3];break;case"right":a=n-u-d}switch(t.top||t.bottom){case"middle":case"center":r=o/2-h/2-i[0];break;case"bottom":r=o-h-c}a=a||0,r=r||0,isNaN(u)&&(u=n-d-a-(s||0)),isNaN(h)&&(h=o-c-r-(l||0));var p=new de(a+i[3],r+i[0],u,h);return p.margin=i,p}function da(t,e,i,n,o){var a=!o||!o.hv||o.hv[0],s=!o||!o.hv||o.hv[1],l=o&&o.boundingMode||"all";if(a||s){var u;if("raw"===l)u="group"===t.type?new de(0,0,+e.width||0,+e.height||0):t.getBoundingRect();else if(u=t.getBoundingRect(),t.needLocalTransform()){var h=t.getLocalTransform();(u=u.clone()).applyTransform(h)}e=ca(r({width:u.width,height:u.height},e),i,n);var c=t.position,d=a?e.x-u.x:0,f=s?e.y-u.y:0;t.attr("position","raw"===l?[d,f]:[c[0]+d,c[1]+f])}}function fa(t,e){return null!=t[oI[e][0]]||null!=t[oI[e][1]]&&null!=t[oI[e][2]]}function pa(t,e,i){function n(i,n){var r={},l=0,u={},h=0;if(iI(i,function(e){u[e]=t[e]}),iI(i,function(t){o(e,t)&&(r[t]=u[t]=e[t]),a(r,t)&&l++,a(u,t)&&h++}),s[n])return a(e,i[1])?u[i[2]]=null:a(e,i[2])&&(u[i[1]]=null),u;if(2!==h&&l){if(l>=2)return r;for(var c=0;ce)return t[n];return t[i-1]}function ya(t){var e=t.get("coordinateSystem"),i={coordSysName:e,coordSysDims:[],axisMap:R(),categoryAxisMap:R()},n=fI[e];if(n)return n(t,i,i.axisMap,i.categoryAxisMap),i}function xa(t){return"category"===t.get("type")}function _a(t){this.fromDataset=t.fromDataset,this.data=t.data||(t.sourceFormat===vI?{}:[]),this.sourceFormat=t.sourceFormat||yI,this.seriesLayoutBy=t.seriesLayoutBy||_I,this.dimensionsDefine=t.dimensionsDefine,this.encodeDefine=t.encodeDefine&&R(t.encodeDefine),this.startIndex=t.startIndex||0,this.dimensionsDetectCount=t.dimensionsDetectCount}function wa(t){var e=t.option.source,i=yI;if(S(e))i=xI;else if(y(e)){0===e.length&&(i=gI);for(var n=0,o=e.length;n=e:"max"===i?t<=e:t===e}function Xa(t,e){return t.join(",")===e.join(",")}function ja(t,e){AI(e=e||{},function(e,i){if(null!=e){var n=t[i];if(lI.hasClass(i)){e=Di(e);var o=Pi(n=Di(n),e);t[i]=CI(o,function(t){return t.option&&t.exist?LI(t.exist,t.option,!0):t.exist||t.option})}else t[i]=LI(n,e,!0)}})}function Ya(t){var e=t&&t.itemStyle;if(e)for(var i=0,o=OI.length;i=0;p--){var g=t[p];if(s||(d=g.data.rawIndexOf(g.stackedByDimension,c)),d>=0){var m=g.data.getByRawIndex(g.stackResultDimension,d);if(h>=0&&m>0||h<=0&&m<0){h+=m,f=m;break}}}return n[0]=h,n[1]=f,n});r.hostModel.setData(l),e.data=l})}function rr(t,e){_a.isInstance(t)||(t=_a.seriesDataToSource(t)),this._source=t;var i=this._data=t.data,n=t.sourceFormat;n===xI&&(this._offset=0,this._dimSize=e,this._data=i),a(this,GI[n===gI?n+"_"+t.seriesLayoutBy:n])}function sr(){return this._data.length}function lr(t){return this._data[t]}function ur(t){for(var e=0;ee.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function Mr(t,e){d(t.CHANGABLE_METHODS,function(i){t.wrapMethod(i,v(Ir,e))})}function Ir(t){var e=Tr(t);e&&e.setOutputEnd(this.count())}function Tr(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}}function Ar(){this.group=new tb,this.uid=Ro("viewChart"),this.renderTask=gr({plan:Lr,reset:kr}),this.renderTask.context={view:this}}function Dr(t,e){if(t&&(t.trigger(e),"group"===t.type))for(var i=0;i=0?n():c=setTimeout(n,-a),u=o};return d.clear=function(){c&&(clearTimeout(c),c=null)},d.debounceNextCall=function(t){l=t},d}function Nr(t,e,i,n){var o=t[e];if(o){var a=o[iT]||o,r=o[oT];if(o[nT]!==i||r!==n){if(null==i||!n)return t[e]=a;(o=t[e]=Pr(a,i,"debounce"===n))[iT]=a,o[oT]=n,o[nT]=i}return o}}function Or(t,e){var i=t[e];i&&i[iT]&&(t[e]=i[iT])}function Er(t,e,i,n){this.ecInstance=t,this.api=e,this.unfinished;var i=this._dataProcessorHandlers=i.slice(),n=this._visualHandlers=n.slice();this._allHandlers=i.concat(n),this._stageTaskMap=R()}function Rr(t,e,i,n,o){function a(t,e){return t.setDirty&&(!t.dirtyMap||t.dirtyMap.get(e.__pipeline.id))}o=o||{};var r;d(e,function(e,s){if(!o.visualType||o.visualType===e.visualType){var l=t._stageTaskMap.get(e.uid),u=l.seriesTaskMap,h=l.overallTask;if(h){var c,d=h.agentStubMap;d.each(function(t){a(o,t)&&(t.dirty(),c=!0)}),c&&h.dirty(),hT(h,n);var f=t.getPerformArgs(h,o.block);d.each(function(t){t.perform(f)}),r|=h.perform(f)}else u&&u.each(function(s,l){a(o,s)&&s.dirty();var u=t.getPerformArgs(s,o.block);u.skip=!e.performRawSeries&&i.isSeriesFiltered(s.context.model),hT(s,n),r|=s.perform(u)})}}),t.unfinished|=r}function zr(t,e,i,n,o){function a(i){var a=i.uid,s=r.get(a)||r.set(a,gr({plan:Hr,reset:Zr,count:Xr}));s.context={model:i,ecModel:n,api:o,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:t},jr(t,i,s)}var r=i.seriesTaskMap||(i.seriesTaskMap=R()),s=e.seriesType,l=e.getTargetSeries;e.createOnAllSeries?n.eachRawSeries(a):s?n.eachRawSeriesByType(s,a):l&&l(n,o).each(a);var u=t._pipelineMap;r.each(function(t,e){u.get(e)||(t.dispose(),r.removeKey(e))})}function Br(t,e,i,n,o){function a(e){var i=e.uid,n=s.get(i);n||(n=s.set(i,gr({reset:Gr,onDirty:Wr})),r.dirty()),n.context={model:e,overallProgress:h,modifyOutputEnd:c},n.agent=r,n.__block=h,jr(t,e,n)}var r=i.overallTask=i.overallTask||gr({reset:Vr});r.context={ecModel:n,api:o,overallReset:e.overallReset,scheduler:t};var s=r.agentStubMap=r.agentStubMap||R(),l=e.seriesType,u=e.getTargetSeries,h=!0,c=e.modifyOutputEnd;l?n.eachRawSeriesByType(l,a):u?u(n,o).each(a):(h=!1,d(n.getSeries(),a));var f=t._pipelineMap;s.each(function(t,e){f.get(e)||(t.dispose(),r.dirty(),s.removeKey(e))})}function Vr(t){t.overallReset(t.ecModel,t.api,t.payload)}function Gr(t,e){return t.overallProgress&&Fr}function Fr(){this.agent.dirty(),this.getDownstream().dirty()}function Wr(){this.agent&&this.agent.dirty()}function Hr(t){return t.plan&&t.plan(t.model,t.ecModel,t.api,t.payload)}function Zr(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=Di(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?f(e,function(t,e){return Ur(e)}):cT}function Ur(t){return function(e,i){var n=i.data,o=i.resetDefines[t];if(o&&o.dataEach)for(var a=e.start;a0?parseInt(n,10)/100:n?parseFloat(n):0;var o=i.getAttribute("stop-color")||"#000000";e.addColorStop(n,o)}i=i.nextSibling}}function Qr(t,e){t&&t.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),r(e.__inheritedStyle,t.__inheritedStyle))}function ts(t){for(var e=P(t).split(_T),i=[],n=0;n0;a-=2){var r=o[a],s=o[a-1];switch(n=n||xt(),s){case"translate":r=P(r).split(_T),St(n,n,[parseFloat(r[0]),parseFloat(r[1]||0)]);break;case"scale":r=P(r).split(_T),It(n,n,[parseFloat(r[0]),parseFloat(r[1]||r[0])]);break;case"rotate":r=P(r).split(_T),Mt(n,n,parseFloat(r[0]));break;case"skew":r=P(r).split(_T),console.warn("Skew transform is not supported yet");break;case"matrix":r=P(r).split(_T);n[0]=parseFloat(r[0]),n[1]=parseFloat(r[1]),n[2]=parseFloat(r[2]),n[3]=parseFloat(r[3]),n[4]=parseFloat(r[4]),n[5]=parseFloat(r[5])}}e.setLocalTransform(n)}}function os(t){var e=t.getAttribute("style"),i={};if(!e)return i;var n={};TT.lastIndex=0;for(var o;null!=(o=TT.exec(e));)n[o[1]]=o[2];for(var a in ST)ST.hasOwnProperty(a)&&null!=n[a]&&(i[ST[a]]=n[a]);return i}function as(t,e,i){var n=e/t.width,o=i/t.height,a=Math.min(n,o);return{scale:[a,a],position:[-(t.x+t.width/2)*a+e/2,-(t.y+t.height/2)*a+i/2]}}function rs(t,e){return(new $r).parse(t,e)}function ss(t){return function(e,i,n){e=e&&e.toLowerCase(),fw.prototype[t].call(this,e,i,n)}}function ls(){fw.call(this)}function us(t,e,n){function o(t,e){return t.__prio-e.__prio}n=n||{},"string"==typeof e&&(e=JT[e]),this.id,this.group,this._dom=t;var a=this._zr=Ii(t,{renderer:n.renderer||"canvas",devicePixelRatio:n.devicePixelRatio,width:n.width,height:n.height});this._throttledZrFlush=Pr(m(a.flush,a),17),(e=i(e))&&BI(e,!0),this._theme=e,this._chartsViews=[],this._chartsMap={},this._componentsViews=[],this._componentsMap={},this._coordSysMgr=new Fa;var r=this._api=As(this);_e($T,o),_e(YT,o),this._scheduler=new Er(this,r,YT,$T),fw.call(this,this._ecEventProcessor=new Ds),this._messageCenter=new ls,this._initEvents(),this.resize=m(this.resize,this),this._pendingActions=[],a.animation.on("frame",this._onframe,this),vs(a,this),N(this)}function hs(t,e,i){var n,o=this._model,a=this._coordSysMgr.getCoordinateSystems();e=Vi(o,e);for(var r=0;re.get("hoverLayerThreshold")&&!U_.node&&i.traverse(function(t){t.isGroup||(t.useHoverLayer=!0)})}function Is(t,e){var i=t.get("blendMode")||null;e.group.traverse(function(t){t.isGroup||t.style.blend!==i&&t.setStyle("blend",i),t.eachPendingDisplayable&&t.eachPendingDisplayable(function(t){t.setStyle("blend",i)})})}function Ts(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 As(t){var e=t._coordSysMgr;return a(new Ga(t),{getCoordinateSystems:m(e.getCoordinateSystems,e),getComponentByElement:function(e){for(;e;){var i=e.__ecComponentInfo;if(null!=i)return t._model.getComponent(i.mainType,i.index);e=e.parent}}})}function Ds(){this.eventInfo}function Cs(t){function e(t,e){for(var n=0;n65535?dA:pA}function Js(t){var e=t.constructor;return e===Array?t.slice():new e(t)}function Qs(t,e){d(gA.concat(e.__wrappedMethods||[]),function(i){e.hasOwnProperty(i)&&(t[i]=e[i])}),t.__wrappedMethods=e.__wrappedMethods,d(mA,function(n){t[n]=i(e[n])}),t._calculationInfo=a(e._calculationInfo)}function tl(t,e,i,n,o){var a=cA[e.type],r=n-1,s=e.name,l=t[s][r];if(l&&l.length=0?this._indices[t]:-1}function al(t,e){var i=t._idList[e];return null==i&&(i=il(t,t._idDimIdx,e)),null==i&&(i=hA+e),i}function rl(t){return y(t)||(t=[t]),t}function sl(t,e){var i=t.dimensions,n=new vA(f(i,t.getDimensionInfo,t),t.hostModel);Qs(n,t);for(var o=n._storage={},a=t._storage,r=0;r=0?(o[s]=ll(a[s]),n._rawExtent[s]=ul(),n._extent[s]=null):o[s]=a[s])}return n}function ll(t){for(var e=new Array(t.length),i=0;in&&(r=o.interval=n);var s=o.intervalPrecision=Ml(r);return Tl(o.niceTickExtent=[MA(Math.ceil(t[0]/r)*r,s),MA(Math.floor(t[1]/r)*r,s)],t),o}function Ml(t){return Ho(t)+2}function Il(t,e,i){t[e]=Math.max(Math.min(t[e],i[1]),i[0])}function Tl(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),Il(t,0,e),Il(t,1,e),t[0]>t[1]&&(t[0]=t[1])}function Al(t,e,i,n){var o=[];if(!t)return o;e[0]1e4)return[];return e[1]>(o.length?o[o.length-1]:i[1])&&o.push(e[1]),o}function Dl(t){return t.get("stack")||AA+t.seriesIndex}function Cl(t){return t.dim+t.index}function Ll(t){var e=[],i=t.axis;if("category"===i.type){for(var n=i.getBandWidth(),o=0;o=0?"p":"n",b=m;p&&(o[r][_]||(o[r][_]={p:m,n:m}),b=o[r][_][w]);var S,M,I,T;if(g)S=b,M=(A=i.dataToPoint([x,_]))[1]+l,I=A[0]-m,T=u,Math.abs(I)a[1]?(n=a[1],o=a[0]):(n=a[0],o=a[1]);var r=e.toGlobalCoord(e.dataToCoord(0));return ro&&(r=o),r}function Vl(t,e){return VA(t,BA(e))}function Gl(t,e){var i,n,o,a=t.type,r=e.getMin(),s=e.getMax(),l=null!=r,u=null!=s,h=t.getExtent();"ordinal"===a?i=e.getCategories().length:(y(n=e.get("boundaryGap"))||(n=[n||0,n||0]),"boolean"==typeof n[0]&&(n=[0,0]),n[0]=Vo(n[0],1),n[1]=Vo(n[1],1),o=h[1]-h[0]||Math.abs(h[0])),null==r&&(r="ordinal"===a?i?0:NaN:h[0]-n[0]*o),null==s&&(s="ordinal"===a?i?i-1:NaN:h[1]+n[1]*o),"dataMin"===r?r=h[0]:"function"==typeof r&&(r=r({min:h[0],max:h[1]})),"dataMax"===s?s=h[1]:"function"==typeof s&&(s=s({min:h[0],max:h[1]})),(null==r||!isFinite(r))&&(r=NaN),(null==s||!isFinite(s))&&(s=NaN),t.setBlank(I(r)||I(s)||"ordinal"===a&&!t.getOrdinalMeta().categories.length),e.getNeedCrossZero()&&(r>0&&s>0&&!l&&(r=0),r<0&&s<0&&!u&&(s=0));var c=e.ecModel;if(c&&"time"===a){var f,p=kl("bar",c);if(d(p,function(t){f|=t.getBaseAxis()===e.axis}),f){var g=Pl(p),m=Fl(r,s,e,g);r=m.min,s=m.max}}return[r,s]}function Fl(t,e,i,n){var o=i.axis.getExtent(),a=o[1]-o[0],r=Ol(n,i.axis);if(void 0===r)return{min:t,max:e};var s=1/0;d(r,function(t){s=Math.min(t.offset,s)});var l=-1/0;d(r,function(t){l=Math.max(t.offset+t.width,l)}),s=Math.abs(s),l=Math.abs(l);var u=s+l,h=e-t,c=h/(1-(s+l)/a)-h;return e+=c*(l/u),t-=c*(s/u),{min:t,max:e}}function Wl(t,e){var i=Gl(t,e),n=null!=e.getMin(),o=null!=e.getMax(),a=e.get("splitNumber");"log"===t.type&&(t.base=e.get("logBase"));var r=t.type;t.setExtent(i[0],i[1]),t.niceExtent({splitNumber:a,fixMin:n,fixMax:o,minInterval:"interval"===r||"time"===r?e.get("minInterval"):null,maxInterval:"interval"===r||"time"===r?e.get("maxInterval"):null});var s=e.get("interval");null!=s&&t.setInterval&&t.setInterval(s)}function Hl(t,e){if(e=e||t.get("type"))switch(e){case"category":return new SA(t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),[1/0,-1/0]);case"value":return new TA;default:return(xl.getClass(e)||TA).create(t)}}function Zl(t){var e=t.scale.getExtent(),i=e[0],n=e[1];return!(i>0&&n>0||i<0&&n<0)}function Ul(t){var e=t.getLabelModel().get("formatter"),i="category"===t.type?t.scale.getExtent()[0]:null;return"string"==typeof e?e=function(e){return function(i){return i=t.scale.getLabel(i),e.replace("{value}",null!=i?i:"")}}(e):"function"==typeof e?function(n,o){return null!=i&&(o=n-i),e(Xl(t,n),o)}:function(e){return t.scale.getLabel(e)}}function Xl(t,e){return"category"===t.type?t.scale.getLabel(e):e}function jl(t){var e=t.model,i=t.scale;if(e.get("axisLabel.show")&&!i.isBlank()){var n,o,a="category"===t.type,r=i.getExtent();o=a?i.count():(n=i.getTicks()).length;var s,l=t.getLabelModel(),u=Ul(t),h=1;o>40&&(h=Math.ceil(o/40));for(var c=0;c>1^-(1&s),l=l>>1^-(1&l),o=s+=o,a=l+=a,n.push([s/i,l/i])}return n}function ou(t){return"category"===t.type?ru(t):uu(t)}function au(t,e){return"category"===t.type?lu(t,e):{ticks:t.scale.getTicks()}}function ru(t){var e=t.getLabelModel(),i=su(t,e);return!e.get("show")||t.scale.isBlank()?{labels:[],labelCategoryInterval:i.labelCategoryInterval}:i}function su(t,e){var i=hu(t,"labels"),n=ql(e),o=cu(i,n);if(o)return o;var a,r;return a=x(n)?vu(t,n):mu(t,r="auto"===n?fu(t):n),du(i,n,{labels:a,labelCategoryInterval:r})}function lu(t,e){var i=hu(t,"ticks"),n=ql(e),o=cu(i,n);if(o)return o;var a,r;if(e.get("show")&&!t.scale.isBlank()||(a=[]),x(n))a=vu(t,n,!0);else if("auto"===n){var s=su(t,t.getLabelModel());r=s.labelCategoryInterval,a=f(s.labels,function(t){return t.tickValue})}else a=mu(t,r=n,!0);return du(i,n,{ticks:a,tickCategoryInterval:r})}function uu(t){var e=t.scale.getTicks(),i=Ul(t);return{labels:f(e,function(e,n){return{formattedLabel:i(e,n),rawLabel:t.scale.getLabel(e),tickValue:e}})}}function hu(t,e){return nD(t)[e]||(nD(t)[e]=[])}function cu(t,e){for(var i=0;i40&&(s=Math.max(1,Math.floor(r/40)));for(var l=a[0],u=t.dataToCoord(l+1)-t.dataToCoord(l),h=Math.abs(u*Math.cos(n)),c=Math.abs(u*Math.sin(n)),d=0,f=0;l<=a[1];l+=s){var p=0,g=0,m=ke(i(l),e.font,"center","top");p=1.3*m.width,g=1.3*m.height,d=Math.max(d,p,7),f=Math.max(f,g,7)}var v=d/h,y=f/c;isNaN(v)&&(v=1/0),isNaN(y)&&(y=1/0);var x=Math.max(0,Math.floor(Math.min(v,y))),_=nD(t.model),w=_.lastAutoInterval,b=_.lastTickCount;return null!=w&&null!=b&&Math.abs(w-x)<=1&&Math.abs(b-r)<=1&&w>x?x=w:(_.lastTickCount=r,_.lastAutoInterval=x),x}function gu(t){var e=t.getLabelModel();return{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}function mu(t,e,i){function n(t){l.push(i?t:{formattedLabel:o(t),rawLabel:a.getLabel(t),tickValue:t})}var o=Ul(t),a=t.scale,r=a.getExtent(),s=t.getLabelModel(),l=[],u=Math.max((e||0)+1,1),h=r[0],c=a.count();0!==h&&u>1&&c/u>2&&(h=Math.round(Math.ceil(h/u)*u));var d=Kl(t),f=s.get("showMinLabel")||d,p=s.get("showMaxLabel")||d;f&&h!==r[0]&&n(r[0]);for(var g=h;g<=r[1];g+=u)n(g);return p&&g!==r[1]&&n(r[1]),l}function vu(t,e,i){var n=t.scale,o=Ul(t),a=[];return d(n.getTicks(),function(t){var r=n.getLabel(t);e(t,r)&&a.push(i?t:{formattedLabel:o(t),rawLabel:r,tickValue:t})}),a}function yu(t,e){var i=(t[1]-t[0])/e/2;t[0]+=i,t[1]-=i}function xu(t,e,i,n,o){function a(t,e){return h?t>e:t0&&(t.coord-=u/(2*(e+1)))}),s={coord:e[r-1].coord+u},e.push(s)}var h=l[0]>l[1];a(e[0].coord,l[0])&&(o?e[0].coord=l[0]:e.shift()),o&&a(l[0],e[0].coord)&&e.unshift({coord:l[0]}),a(l[1],s.coord)&&(o?s.coord=l[1]:e.pop()),o&&a(s.coord,l[1])&&e.push({coord:l[1]})}}function _u(t,e){var i=t.mapDimension("defaultedLabel",!0),n=i.length;if(1===n)return fr(t,e,i[0]);if(n){for(var o=[],a=0;a0?i=n[0]:n[1]<0&&(i=n[1]),i}function Ou(t,e,i,n){var o=NaN;t.stacked&&(o=i.get(i.getCalculationInfo("stackedOverDimension"),n)),isNaN(o)&&(o=t.valueStart);var a=t.baseDataOffset,r=[];return r[a]=i.get(t.baseDim,n),r[1-a]=o,e.dataToPoint(r)}function Eu(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}function Ru(t){return isNaN(t[0])||isNaN(t[1])}function zu(t,e,i,n,o,a,r,s,l,u,h){return"none"!==u&&u?Bu.apply(this,arguments):Vu.apply(this,arguments)}function Bu(t,e,i,n,o,a,r,s,l,u,h){for(var c=0,d=i,f=0;f=o||d<0)break;if(Ru(p)){if(h){d+=a;continue}break}if(d===i)t[a>0?"moveTo":"lineTo"](p[0],p[1]);else if(l>0){var g=e[c],m="y"===u?1:0,v=(p[m]-g[m])*l;_D(bD,g),bD[m]=g[m]+v,_D(SD,p),SD[m]=p[m]-v,t.bezierCurveTo(bD[0],bD[1],SD[0],SD[1],p[0],p[1])}else t.lineTo(p[0],p[1]);c=d,d+=a}return f}function Vu(t,e,i,n,o,a,r,s,l,u,h){for(var c=0,d=i,f=0;f=o||d<0)break;if(Ru(p)){if(h){d+=a;continue}break}if(d===i)t[a>0?"moveTo":"lineTo"](p[0],p[1]),_D(bD,p);else if(l>0){var g=d+a,m=e[g];if(h)for(;m&&Ru(e[g]);)m=e[g+=a];var v=.5,y=e[c];if(!(m=e[g])||Ru(m))_D(SD,p);else{Ru(m)&&!h&&(m=p),U(wD,m,y);var x,_;if("x"===u||"y"===u){var w="x"===u?0:1;x=Math.abs(p[w]-y[w]),_=Math.abs(p[w]-m[w])}else x=uw(p,y),_=uw(p,m);xD(SD,p,wD,-l*(1-(v=_/(_+x))))}vD(bD,bD,s),yD(bD,bD,r),vD(SD,SD,s),yD(SD,SD,r),t.bezierCurveTo(bD[0],bD[1],SD[0],SD[1],p[0],p[1]),xD(bD,p,wD,l*v)}else t.lineTo(p[0],p[1]);c=d,d+=a}return f}function Gu(t,e){var i=[1/0,1/0],n=[-1/0,-1/0];if(e)for(var o=0;on[0]&&(n[0]=a[0]),a[1]>n[1]&&(n[1]=a[1])}return{min:e?i:n,max:e?n:i}}function Fu(t,e){if(t.length===e.length){for(var i=0;ie[0]?1:-1;e[0]+=n*i,e[1]-=n*i}return e}function Zu(t,e,i){if(!i.valueDim)return[];for(var n=[],o=0,a=e.count();oa[1]&&a.reverse();var r=o.getExtent(),s=Math.PI/180;i&&(a[0]-=.5,a[1]+=.5);var l=new hM({shape:{cx:Go(t.cx,1),cy:Go(t.cy,1),r0:Go(a[0],1),r:Go(a[1],1),startAngle:-r[0]*s,endAngle:-r[1]*s,clockwise:o.inverse}});return e&&(l.shape.endAngle=-r[0]*s,To(l,{shape:{endAngle:-r[1]*s}},n)),l}function ju(t,e,i,n){return"polar"===t.type?Xu(t,e,i,n):Uu(t,e,i,n)}function Yu(t,e,i){for(var n=e.getBaseAxis(),o="x"===n.dim||"radius"===n.dim?0:1,a=[],r=0;r=0;a--){var r=i[a].dimension,s=t.dimensions[r],l=t.getDimensionInfo(s);if("x"===(n=l&&l.coordDim)||"y"===n){o=i[a];break}}if(o){var u=e.getAxis(n),h=f(o.stops,function(t){return{coord:u.toGlobalCoord(u.dataToCoord(t.value)),color:t.color}}),c=h.length,p=o.outerColors.slice();c&&h[0].coord>h[c-1].coord&&(h.reverse(),p.reverse());var g=h[0].coord-10,m=h[c-1].coord+10,v=m-g;if(v<.001)return"transparent";d(h,function(t){t.offset=(t.coord-g)/v}),h.push({offset:c?h[c-1].offset:.5,color:p[1]||"transparent"}),h.unshift({offset:c?h[0].offset:.5,color:p[0]||"transparent"});var y=new TM(0,0,0,0,h,!0);return y[n]=g,y[n+"2"]=m,y}}}function Ku(t,e,i){var n=t.get("showAllSymbol"),o="auto"===n;if(!n||o){var a=i.getAxesByScale("ordinal")[0];if(a&&(!o||!$u(a,e))){var r=e.mapDimension(a.dim),s={};return d(a.getViewLabels(),function(t){s[t.tickValue]=1}),function(t){return!s.hasOwnProperty(e.get(r,t))}}}}function $u(t,e){var i=t.getExtent(),n=Math.abs(i[1]-i[0])/t.scale.count();isNaN(n)&&(n=0);for(var o=e.count(),a=Math.max(1,Math.round(o/5)),r=0;rn)return!1;return!0}function Ju(t){return this._axes[t]}function Qu(t){LD.call(this,t)}function th(t,e){return e.type||(e.data?"category":"value")}function eh(t,e,i){return t.getCoordSysModel()===e}function ih(t,e,i){this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this._initCartesian(t,e,i),this.model=t}function nh(t,e,i,n){function o(t){return t.dim+"_"+t.index}i.getAxesOnZeroOf=function(){return a?[a]:[]};var a,r=t[e],s=i.model,l=s.get("axisLine.onZero"),u=s.get("axisLine.onZeroAxisIndex");if(l){if(null!=u)oh(r[u])&&(a=r[u]);else for(var h in r)if(r.hasOwnProperty(h)&&oh(r[h])&&!n[o(r[h])]){a=r[h];break}a&&(n[o(a)]=!0)}}function oh(t){return t&&"category"!==t.type&&"time"!==t.type&&Zl(t)}function ah(t,e){var i=t.getExtent(),n=i[0]+i[1];t.toGlobalCoord="x"===t.dim?function(t){return t+e}:function(t){return n-t+e},t.toLocalCoord="x"===t.dim?function(t){return t-e}:function(t){return n-t+e}}function rh(t,e){return f(VD,function(e){return t.getReferringComponents(e)[0]})}function sh(t){return"cartesian2d"===t.get("coordinateSystem")}function lh(t){var e={componentType:t.mainType,componentIndex:t.componentIndex};return e[t.mainType+"Index"]=t.componentIndex,e}function uh(t,e,i,n){var o,a,r=Xo(i-t.rotation),s=n[0]>n[1],l="start"===e&&!s||"start"!==e&&s;return jo(r-GD/2)?(a=l?"bottom":"top",o="center"):jo(r-1.5*GD)?(a=l?"top":"bottom",o="center"):(a="middle",o=r<1.5*GD&&r>GD/2?l?"left":"right":l?"right":"left"),{rotation:r,textAlign:o,textVerticalAlign:a}}function hh(t){var e=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||e&&e.show)}function ch(t,e,i){if(!Kl(t.axis)){var n=t.get("axisLabel.showMinLabel"),o=t.get("axisLabel.showMaxLabel");e=e||[],i=i||[];var a=e[0],r=e[1],s=e[e.length-1],l=e[e.length-2],u=i[0],h=i[1],c=i[i.length-1],d=i[i.length-2];!1===n?(dh(a),dh(u)):fh(a,r)&&(n?(dh(r),dh(h)):(dh(a),dh(u))),!1===o?(dh(s),dh(c)):fh(l,s)&&(o?(dh(l),dh(d)):(dh(s),dh(c)))}}function dh(t){t&&(t.ignore=!0)}function fh(t,e,i){var n=t&&t.getBoundingRect().clone(),o=e&&e.getBoundingRect().clone();if(n&&o){var a=_t([]);return Mt(a,a,-t.rotation),n.applyTransform(bt([],a,t.getLocalTransform())),o.applyTransform(bt([],a,e.getLocalTransform())),n.intersect(o)}}function ph(t){return"middle"===t||"center"===t}function gh(t,e,i){var n=e.axis;if(e.get("axisTick.show")&&!n.scale.isBlank()){for(var o=e.getModel("axisTick"),a=o.getModel("lineStyle"),s=o.get("length"),l=n.getTicksCoords(),u=[],h=[],c=t._transform,d=[],f=0;f=0||t===e}function Sh(t){var e=Mh(t);if(e){var i=e.axisPointerModel,n=e.axis.scale,o=i.option,a=i.get("status"),r=i.get("value");null!=r&&(r=n.parse(r));var s=Th(i);null==a&&(o.status=s?"show":"hide");var l=n.getExtent().slice();l[0]>l[1]&&l.reverse(),(null==r||r>l[1])&&(r=l[1]),r0?"bottom":"top":o.width>0?"left":"right";l||kh(t.style,d,n,u,a,i,p),fo(t,d)}function Rh(t,e){var i=t.get(tC)||0;return Math.min(i,Math.abs(e.width),Math.abs(e.height))}function zh(t,e,i){var n=t.getData(),o=[],a=n.getLayout("valueAxisHorizontal")?1:0;o[1-a]=n.getLayout("valueAxisStart");var r=new nC({shape:{points:n.getLayout("largePoints")},incremental:!!i,__startPoint:o,__valueIdx:a});e.add(r),Bh(r,t,n)}function Bh(t,e,i){var n=i.getVisual("borderColor")||i.getVisual("color"),o=e.getModel("itemStyle").getItemStyle(["color","borderColor"]);t.useStyle(o),t.style.fill=null,t.style.stroke=n,t.style.lineWidth=i.getLayout("barWidth")}function Vh(t,e,i,n){var o=e.getData(),a=this.dataIndex,r=o.getName(a),s=e.get("selectedOffset");n.dispatchAction({type:"pieToggleSelect",from:t,name:r,seriesId:e.id}),o.each(function(t){Gh(o.getItemGraphicEl(t),o.getItemLayout(t),e.isSelected(o.getName(t)),s,i)})}function Gh(t,e,i,n,o){var a=(e.startAngle+e.endAngle)/2,r=Math.cos(a),s=Math.sin(a),l=i?n:0,u=[r*l,s*l];o?t.animate().when(200,{position:u}).start("bounceOut"):t.attr("position",u)}function Fh(t,e){function i(){a.ignore=a.hoverIgnore,r.ignore=r.hoverIgnore}function n(){a.ignore=a.normalIgnore,r.ignore=r.normalIgnore}tb.call(this);var o=new hM({z2:2}),a=new gM,r=new rM;this.add(o),this.add(a),this.add(r),this.updateData(t,e,!0),this.on("emphasis",i).on("normal",n).on("mouseover",i).on("mouseout",n)}function Wh(t,e,i,n,o,a,r){function s(e,i){for(var n=e;n>=0&&(t[n].y-=i,!(n>0&&t[n].y>t[n-1].y+t[n-1].height));n--);}function l(t,e,i,n,o,a){for(var r=e?Number.MAX_VALUE:0,s=0,l=t.length;s=r&&(d=r-10),!e&&d<=r&&(d=r+10),t[s].x=i+d*a,r=d}}t.sort(function(t,e){return t.y-e.y});for(var u,h=0,c=t.length,d=[],f=[],p=0;pe&&a+1t[a].y+t[a].height)return void s(a,n/2);s(i-1,n/2)}(p,c,-u),h=t[p].y+t[p].height;r-h<0&&s(c-1,h-r);for(p=0;p=i?f.push(t[p]):d.push(t[p]);l(d,!1,e,i,n,o),l(f,!0,e,i,n,o)}function Hh(t,e,i,n,o,a){for(var r=[],s=[],l=0;l3?1.4:o>1?1.2:1.1;hc(this,"zoom","zoomOnMouseWheel",t,{scale:n>0?s:1/s,originX:a,originY:r})}if(i){var l=Math.abs(n);hc(this,"scrollMove","moveOnMouseWheel",t,{scrollDelta:(n>0?1:-1)*(l>3?.4:l>1?.15:.05),originX:a,originY:r})}}}function uc(t){ic(this._zr,"globalPan")||hc(this,"zoom",null,t,{scale:t.pinchScale>1?1.1:1/1.1,originX:t.pinchX,originY:t.pinchY})}function hc(t,e,i,n,o){t.pointerChecker&&t.pointerChecker(n,o.originX,o.originY)&&(mw(n.event),cc(t,e,i,n,o))}function cc(t,e,i,n,o){o.isAvailableBehavior=m(dc,null,i,n),t.trigger(e,o)}function dc(t,e,i){var n=i[t];return!t||n&&(!_(n)||e.event[n+"Key"])}function fc(t,e,i){var n=t.target,o=n.position;o[0]+=e,o[1]+=i,n.dirty()}function pc(t,e,i,n){var o=t.target,a=t.zoomLimit,r=o.position,s=o.scale,l=t.zoom=t.zoom||1;if(l*=e,a){var u=a.min||0,h=a.max||1/0;l=Math.max(Math.min(h,l),u)}var c=l/t.zoom;t.zoom=l,r[0]-=(i-r[0])*(c-1),r[1]-=(n-r[1])*(c-1),s[0]*=c,s[1]*=c,o.dirty()}function gc(t,e,i){var n=e.getComponentByElement(t.topTarget),o=n&&n.coordinateSystem;return n&&n!==i&&!RC[n.mainType]&&o&&o.model!==i}function mc(t,e){var i=t.getItemStyle(),n=t.get("areaColor");return null!=n&&(i.fill=n),i}function vc(t,e,i,n,o){i.off("click"),i.off("mousedown"),e.get("selectedMode")&&(i.on("mousedown",function(){t._mouseDownFlag=!0}),i.on("click",function(a){if(t._mouseDownFlag){t._mouseDownFlag=!1;for(var r=a.target;!r.__regions;)r=r.parent;if(r){var s={type:("geo"===e.mainType?"geo":"map")+"ToggleSelect",batch:f(r.__regions,function(t){return{name:t.name,from:o.uid}})};s[e.mainType+"Id"]=e.id,n.dispatchAction(s),yc(e,i)}}}))}function yc(t,e){e.eachChild(function(e){d(e.__regions,function(i){e.trigger(t.isSelected(i.name)?"emphasis":"normal")})})}function xc(t,e){var i=new tb;this.uid=Ro("ec_map_draw"),this._controller=new oc(t.getZr()),this._controllerHost={target:e?i:null},this.group=i,this._updateGroup=e,this._mouseDownFlag,this._mapName,this._initialized,i.add(this._regionsGroup=new tb),i.add(this._backgroundGroup=new tb)}function _c(t){var e=this[zC];e&&e.recordVersion===this[BC]&&wc(e,t)}function wc(t,e){var i=t.circle,n=t.labelModel,o=t.hoverLabelModel,a=t.emphasisText,r=t.normalText;e?(i.style.extendFrom(mo({},o,{text:o.get("show")?a:null},{isRectText:!0,useInsideStyle:!1},!0)),i.__mapOriginalZ2=i.z2,i.z2+=NM):(mo(i.style,n,{text:n.get("show")?r:null,textPosition:n.getShallow("position")||"bottom"},{isRectText:!0,useInsideStyle:!1}),i.dirty(!1),null!=i.__mapOriginalZ2&&(i.z2=i.__mapOriginalZ2,i.__mapOriginalZ2=null))}function bc(t,e,i){var n=t.getZoom(),o=t.getCenter(),a=e.zoom,r=t.dataToPoint(o);if(null!=e.dx&&null!=e.dy){r[0]-=e.dx,r[1]-=e.dy;o=t.pointToData(r);t.setCenter(o)}if(null!=a){if(i){var s=i.min||0,l=i.max||1/0;a=Math.max(Math.min(n*a,l),s)/n}t.scale[0]*=a,t.scale[1]*=a;var u=t.position,h=(e.originX-u[0])*(a-1),c=(e.originY-u[1])*(a-1);u[0]-=h,u[1]-=c,t.updateTransform();o=t.pointToData(r);t.setCenter(o),t.setZoom(a*n)}return{center:t.getCenter(),zoom:t.getZoom()}}function Sc(){Tw.call(this)}function Mc(t){this.name=t,this.zoomLimit,Tw.call(this),this._roamTransformable=new Sc,this._rawTransformable=new Sc,this._center,this._zoom}function Ic(t,e,i,n){var o=i.seriesModel,a=o?o.coordinateSystem:null;return a===this?a[t](n):null}function Tc(t,e,i,n){Mc.call(this,t),this.map=e;var o=OC.load(e,i);this._nameCoordMap=o.nameCoordMap,this._regionsMap=o.regionsMap,this._invertLongitute=null==n||n,this.regions=o.regions,this._rect=o.boundingRect}function Ac(t,e,i,n){var o=i.geoModel,a=i.seriesModel,r=o?o.coordinateSystem:a?a.coordinateSystem||(a.getReferringComponents("geo")[0]||{}).coordinateSystem:null;return r===this?r[t](n):null}function Dc(t,e){var i=t.get("boundingCoords");if(null!=i){var n=i[0],o=i[1];isNaN(n[0])||isNaN(n[1])||isNaN(o[0])||isNaN(o[1])||this.setBoundingRect(n[0],n[1],o[0]-n[0],o[1]-n[1])}var a,r=this.getBoundingRect(),s=t.get("layoutCenter"),l=t.get("layoutSize"),u=e.getWidth(),h=e.getHeight(),c=r.width/r.height*this.aspectScale,d=!1;s&&l&&(s=[Vo(s[0],u),Vo(s[1],h)],l=Vo(l,Math.min(u,h)),isNaN(s[0])||isNaN(s[1])||isNaN(l)||(d=!0));if(d){var f={};c>1?(f.width=l,f.height=l/c):(f.height=l,f.width=l*c),f.y=s[1]-f.height/2,f.x=s[0]-f.width/2}else(a=t.getBoxLayoutParams()).aspect=c,f=ca(a,{width:u,height:h});this.setViewRect(f.x,f.y,f.width,f.height),this.setCenter(t.get("center")),this.setZoom(t.get("zoom"))}function Cc(t,e){d(e.get("geoCoord"),function(e,i){t.addGeoCoord(i,e)})}function Lc(t,e){var i={};return d(t,function(t){t.each(t.mapDimension("value"),function(e,n){var o="ec-"+t.getName(n);i[o]=i[o]||[],isNaN(e)||i[o].push(e)})}),t[0].map(t[0].mapDimension("value"),function(n,o){for(var a="ec-"+t[0].getName(o),r=0,s=1/0,l=-1/0,u=i[a].length,h=0;h=0;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)}}function Wc(t,e){var i=t.isExpand?t.children:[],n=t.parentNode.children,o=t.hierNode.i?n[t.hierNode.i-1]:null;if(i.length){jc(t);var a=(i[0].hierNode.prelim+i[i.length-1].hierNode.prelim)/2;o?(t.hierNode.prelim=o.hierNode.prelim+e(t,o),t.hierNode.modifier=t.hierNode.prelim-a):t.hierNode.prelim=a}else o&&(t.hierNode.prelim=o.hierNode.prelim+e(t,o));t.parentNode.hierNode.defaultAncestor=Yc(t,o,t.parentNode.hierNode.defaultAncestor||n[0],e)}function Hc(t){var e=t.hierNode.prelim+t.parentNode.hierNode.modifier;t.setLayout({x:e},!0),t.hierNode.modifier+=t.parentNode.hierNode.modifier}function Zc(t){return arguments.length?t:Qc}function Uc(t,e){var i={};return t-=Math.PI/2,i.x=e*Math.cos(t),i.y=e*Math.sin(t),i}function Xc(t,e){return ca(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function jc(t){for(var e=t.children,i=e.length,n=0,o=0;--i>=0;){var a=e[i];a.hierNode.prelim+=n,a.hierNode.modifier+=n,o+=a.hierNode.change,n+=a.hierNode.shift+o}}function Yc(t,e,i,n){if(e){for(var o=t,a=t,r=a.parentNode.children[0],s=e,l=o.hierNode.modifier,u=a.hierNode.modifier,h=r.hierNode.modifier,c=s.hierNode.modifier;s=qc(s),a=Kc(a),s&&a;){o=qc(o),r=Kc(r),o.hierNode.ancestor=t;var d=s.hierNode.prelim+c-a.hierNode.prelim-u+n(s,a);d>0&&(Jc($c(s,t,i),t,d),u+=d,l+=d),c+=s.hierNode.modifier,u+=a.hierNode.modifier,l+=o.hierNode.modifier,h+=r.hierNode.modifier}s&&!qc(o)&&(o.hierNode.thread=s,o.hierNode.modifier+=c-l),a&&!Kc(r)&&(r.hierNode.thread=a,r.hierNode.modifier+=u-h,i=t)}return i}function qc(t){var e=t.children;return e.length&&t.isExpand?e[e.length-1]:t.hierNode.thread}function Kc(t){var e=t.children;return e.length&&t.isExpand?e[0]:t.hierNode.thread}function $c(t,e,i){return t.hierNode.ancestor.parentNode===e.parentNode?t.hierNode.ancestor:i}function Jc(t,e,i){var n=i/(e.hierNode.i-t.hierNode.i);e.hierNode.change-=n,e.hierNode.shift+=i,e.hierNode.modifier+=i,e.hierNode.prelim+=i,t.hierNode.change+=n}function Qc(t,e){return t.parentNode===e.parentNode?1:2}function td(t,e){var i=t.getItemLayout(e);return i&&!isNaN(i.x)&&!isNaN(i.y)&&"none"!==t.getItemVisual(e,"symbol")}function ed(t,e,i){return i.itemModel=e,i.itemStyle=e.getModel("itemStyle").getItemStyle(),i.hoverItemStyle=e.getModel("emphasis.itemStyle").getItemStyle(),i.lineStyle=e.getModel("lineStyle").getLineStyle(),i.labelModel=e.getModel("label"),i.hoverLabelModel=e.getModel("emphasis.label"),!1===t.isExpand&&0!==t.children.length?i.symbolInnerColor=i.itemStyle.fill:i.symbolInnerColor="#fff",i}function id(t,e,i,n,o,a){var s=!i,l=t.tree.getNodeByDataIndex(e),a=ed(l,l.getModel(),a),u=t.tree.root,h=l.parentNode===u?l:l.parentNode||l,c=t.getItemGraphicEl(h.dataIndex),d=h.getLayout(),f=c?{x:c.position[0],y:c.position[1],rawX:c.__radialOldRawX,rawY:c.__radialOldRawY}:d,p=l.getLayout();s?(i=new wu(t,e,a)).attr("position",[f.x,f.y]):i.updateData(t,e,a),i.__radialOldRawX=i.__radialRawX,i.__radialOldRawY=i.__radialRawY,i.__radialRawX=p.rawX,i.__radialRawY=p.rawY,n.add(i),t.setItemGraphicEl(e,i),Io(i,{position:[p.x,p.y]},o);var g=i.getSymbolPath();if("radial"===a.layout){var m,v,y=u.children[0],x=y.getLayout(),_=y.children.length;if(p.x===x.x&&!0===l.isExpand){var w={};w.x=(y.children[0].getLayout().x+y.children[_-1].getLayout().x)/2,w.y=(y.children[0].getLayout().y+y.children[_-1].getLayout().y)/2,(m=Math.atan2(w.y-x.y,w.x-x.x))<0&&(m=2*Math.PI+m),(v=w.xx.x)||(m-=Math.PI);var b=v?"left":"right";g.setStyle({textPosition:b,textRotation:-m,textOrigin:"center",verticalAlign:"middle"})}if(l.parentNode&&l.parentNode!==u){var S=i.__edge;S||(S=i.__edge=new bM({shape:od(a,f,f),style:r({opacity:0,strokeNoScale:!0},a.lineStyle)})),Io(S,{shape:od(a,d,p),style:{opacity:1}},o),n.add(S)}}function nd(t,e,i,n,o,a){for(var r,s=t.tree.getNodeByDataIndex(e),l=t.tree.root,a=ed(s,s.getModel(),a),u=s.parentNode===l?s:s.parentNode||s;null==(r=u.getLayout());)u=u.parentNode===l?u:u.parentNode||u;Io(i,{position:[r.x+1,r.y+1]},o,function(){n.remove(i),t.setItemGraphicEl(e,null)}),i.fadeOut(null,{keepLabel:!0});var h=i.__edge;h&&Io(h,{shape:od(a,r,r),style:{opacity:0}},o,function(){n.remove(h)})}function od(t,e,i){var n,o,a,r,s,l,u,h,c=t.orient;if("radial"===t.layout){s=e.rawX,u=e.rawY,l=i.rawX,h=i.rawY;var d=Uc(s,u),f=Uc(s,u+(h-u)*t.curvature),p=Uc(l,h+(u-h)*t.curvature),g=Uc(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}}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}}function ad(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;s=0;a--)n.push(o[a])}}function sd(t,e){var i=Xc(t,e);t.layoutInfo=i;var n=t.get("layout"),o=0,a=0,r=null;"radial"===n?(o=2*Math.PI,a=Math.min(i.height,i.width)/2,r=Zc(function(t,e){return(t.parentNode===e.parentNode?1:2)/t.depth})):(o=i.width,a=i.height,r=Zc());var s=t.getData().tree.root,l=s.children[0];if(l){Fc(s),ad(l,Wc,r),s.hierNode.modifier=-l.hierNode.prelim,rd(l,Hc);var u=l,h=l,c=l;rd(l,function(t){var e=t.getLayout().x;eh.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),rd(l,function(t){m=(t.getLayout().x+f)*p,v=(t.depth-1)*g;var e=Uc(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),rd(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),rd(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)}))}}}function ld(t,e,i){if(t&&l(e,t.type)>=0){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 ud(t){for(var e=[];t;)(t=t.parentNode)&&e.push(t);return e.reverse()}function hd(t,e){return l(ud(t),e)>=0}function cd(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}function dd(t){var e=0;d(t.children,function(t){dd(t);var i=t.value;y(i)&&(i=i[0]),e+=i});var i=t.value;y(i)&&(i=i[0]),(null==i||isNaN(i))&&(i=e),i<0&&(i=0),y(t.value)?t.value[0]=i:t.value=i}function fd(t,e){var i=e.get("color");if(i){var n;return d(t=t||[],function(t){var e=new No(t),i=e.get("color");(e.get("itemStyle.color")||i&&"none"!==i)&&(n=!0)}),n||((t[0]||(t[0]={})).color=i.slice()),t}}function pd(t){this.group=new tb,t.add(this.group)}function gd(t,e,i,n,o,a){var r=[[o?t:t-UC,e],[t+i,e],[t+i,e+n],[o?t:t-UC,e+n]];return!a&&r.splice(2,0,[t+i+UC,e+n/2]),!o&&r.push([t,e+n/2]),r}function md(t,e,i){t.eventData={componentType:"series",componentSubType:"treemap",componentIndex:e.componentIndex,seriesIndex:e.componentIndex,seriesName:e.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:i&&i.dataIndex,name:i&&i.name},treePathInfo:i&&cd(i,e)}}function vd(){var t,e=[],i={};return{add:function(t,n,o,a,r){return _(a)&&(r=a,a=0),!i[t.id]&&(i[t.id]=1,e.push({el:t,target:n,time:o,delay:a,easing:r}),!0)},done:function(e){return t=e,this},start:function(){for(var n=e.length,o=0,a=e.length;o=0;a--)null==i[a]&&(delete n[e[a]],e.pop())}function bd(t,e){var i=t.visual,n=[];w(i)?sL(i,function(t){n.push(t)}):null!=i&&n.push(i);var o={color:1,symbol:1};e||1!==n.length||o.hasOwnProperty(t.type)||(n[1]=n[0]),Ld(t,n)}function Sd(t){return{applyVisual:function(e,i,n){e=this.mapValueToVisual(e),n("color",t(i("color"),e))},_doMap:Dd([0,1])}}function Md(t){var e=this.option.visual;return e[Math.round(Bo(t,[0,1],[0,e.length-1],!0))]||{}}function Id(t){return function(e,i,n){n(t,this.mapValueToVisual(e))}}function Td(t){var e=this.option.visual;return e[this.option.loop&&t!==uL?t%e.length:t]}function Ad(){return this.option.visual[0]}function Dd(t){return{linear:function(e){return Bo(e,t,this.option.visual,!0)},category:Td,piecewise:function(e,i){var n=Cd.call(this,i);return null==n&&(n=Bo(e,t,this.option.visual,!0)),n},fixed:Ad}}function Cd(t){var e=this.option,i=e.pieceList;if(e.hasSpecialVisual){var n=i[hL.findPieceIndex(t,i)];if(n&&n.visual)return n.visual[this.type]}}function Ld(t,e){return t.visual=e,"color"===t.type&&(t.parsedVisual=f(e,function(t){return Gt(t)})),e}function kd(t,e,i){return t?e<=i:e=o.length||t===o[t.depth])&&Pd(t,Vd(r,h,t,e,g,a),i,n,o,a)})}else l=Od(h),t.setVisual("color",l)}}function Nd(t,e,i,n){var o=a({},e);return d(["color","colorAlpha","colorSaturation"],function(a){var r=t.get(a,!0);null==r&&i&&(r=i[a]),null==r&&(r=e[a]),null==r&&(r=n.get(a)),null!=r&&(o[a]=r)}),o}function Od(t){var e=Rd(t,"color");if(e){var i=Rd(t,"colorAlpha"),n=Rd(t,"colorSaturation");return n&&(e=jt(e,null,null,n)),i&&(e=Yt(e,i)),e}}function Ed(t,e){return null!=e?jt(e,null,null,t):null}function Rd(t,e){var i=t[e];if(null!=i&&"none"!==i)return i}function zd(t,e,i,n,o,a){if(a&&a.length){var r=Bd(e,"color")||null!=o.color&&"none"!==o.color&&(Bd(e,"colorAlpha")||Bd(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 hL(c);return d.__drColorMappingBy=h,d}}}function Bd(t,e){var i=t.get(e);return fL(i)&&i.length?{name:e,range:i}:null}function Vd(t,e,i,n,o,r){var s=a({},e);if(o){var l=o.type,u="color"===l&&o.__drColorMappingBy,h="index"===u?n:"id"===u?r.mapIdToIndex(i.getId()):i.getValue(t.get("visualDimension"));s[l]=o.mapValueToVisual(h)}return s}function Gd(t,e,i,n){var o,a;if(!t.isRemoved()){var r=t.getLayout();o=r.width,a=r.height;var s=(f=t.getModel()).get(_L),l=f.get(wL)/2,u=Kd(f),h=Math.max(s,u),c=s-l,d=h-l,f=t.getModel();t.setLayout({borderWidth:s,upperHeight:h,upperLabelHeight:u},!0);var p=(o=mL(o-2*c,0))*(a=mL(a-c-d,0)),g=Fd(t,f,p,e,i,n);if(g.length){var m={x:c,y:d,width:o,height:a},v=vL(o,a),y=1/0,x=[];x.area=0;for(var _=0,w=g.length;_=0;l--){var u=o["asc"===n?r-l-1:l].getValue();u/i*es[1]&&(s[1]=e)})}else s=[NaN,NaN];return{sum:n,dataExtent:s}}function Ud(t,e,i){for(var n,o=0,a=1/0,r=0,s=t.length;ro&&(o=n));var l=t.area*t.area,u=e*e*i;return l?mL(u*o/l,l/(u*a)):1/0}function Xd(t,e,i,n,o){var a=e===i.width?0:1,r=1-a,s=["x","y"],l=["width","height"],u=i[s[a]],h=e?t.area/e:0;(o||h>i[l[r]])&&(h=i[l[r]]);for(var c=0,d=t.length;cXM&&(u=XM),a=s}u=0?n+=u:n-=u:p>=0?n-=u:n+=u}return n}function pf(t,e){return t.getVisual("opacity")||t.getModel().get(e)}function gf(t,e,i){var n=t.getGraphicEl(),o=pf(t,e);null!=i&&(null==o&&(o=1),o*=i),n.downplay&&n.downplay(),n.traverse(function(t){if("group"!==t.type){var e=t.lineLabelOriginalOpacity;null!=e&&null==i||(e=o),t.setStyle("opacity",e)}})}function mf(t,e){var i=pf(t,e),n=t.getGraphicEl();n.highlight&&n.highlight(),n.traverse(function(t){"group"!==t.type&&t.setStyle("opacity",i)})}function vf(t){return t instanceof Array||(t=[t,t]),t}function yf(t){var e=t.coordinateSystem;if(!e||"view"===e.type){var i=t.getGraph();i.eachNode(function(t){var e=t.getModel();t.setLayout([+e.get("x"),+e.get("y")])}),xf(i)}}function xf(t){t.eachEdge(function(t){var e=t.getModel().get("lineStyle.curveness")||0,i=F(t.node1.getLayout()),n=F(t.node2.getLayout()),o=[i,n];+e&&o.push([(i[0]+n[0])/2-(i[1]-n[1])*e,(i[1]+n[1])/2-(n[0]-i[0])*e]),t.setLayout(o)})}function _f(t){var e=t.coordinateSystem;if(!e||"view"===e.type){var i=e.getBoundingRect(),n=t.getData(),o=n.graph,a=0,r=n.getSum("value"),s=2*Math.PI/(r||n.count()),l=i.width/2+i.x,u=i.height/2+i.y,h=Math.min(i.width,i.height)/2;o.eachNode(function(t){var e=t.getValue("value");a+=s*(r?e:1)/2,t.setLayout([h*Math.cos(a)+l,h*Math.sin(a)+u]),a+=s*(r?e:1)/2}),n.setLayout({cx:l,cy:u}),o.eachEdge(function(t){var e,i=t.getModel().get("lineStyle.curveness")||0,n=F(t.node1.getLayout()),o=F(t.node2.getLayout()),a=(n[0]+o[0])/2,r=(n[1]+o[1])/2;+i&&(e=[l*(i*=3)+a*(1-i),u*i+r*(1-i)]),t.setLayout([n,o,e])})}}function wf(t,e,i){for(var n=i.rect,o=n.width,a=n.height,r=[n.x+o/2,n.y+a/2],s=null==i.gravity?.1:i.gravity,l=0;l0?-1:i<0?1:e?-1:1}}function Pf(t,e){return Math.min(e[1],Math.max(e[0],t))}function Nf(t,e,i){this._axesMap=R(),this._axesLayout={},this.dimensions=t.dimensions,this._rect,this._model=t,this._init(t,e,i)}function Of(t,e){return ek(ik(t,e[0]),e[1])}function Ef(t,e){var i=e.layoutLength/(e.axisCount-1);return{position:i*t,axisNameAvailableWidth:i,axisLabelShow:!0}}function Rf(t,e){var i,n,o=e.layoutLength,a=e.axisExpandWidth,r=e.axisCount,s=e.axisCollapseWidth,l=e.winInnerIndices,u=s,h=!1;return tmk}function $f(t){var e=t.length-1;return e<0&&(e=0),[t[0],t[e]]}function Jf(t,e,i,n){var o=new tb;return o.add(new yM({name:"main",style:ip(i),silent:!0,draggable:!0,cursor:"move",drift:uk(t,e,o,"nswe"),ondragend:uk(qf,e,{isEnd:!0})})),hk(n,function(i){o.add(new yM({name:i,style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:uk(t,e,o,i),ondragend:uk(qf,e,{isEnd:!0})}))}),o}function Qf(t,e,i,n){var o=n.brushStyle.lineWidth||0,a=fk(o,vk),r=i[0][0],s=i[1][0],l=r-o/2,u=s-o/2,h=i[0][1],c=i[1][1],d=h-a+o/2,f=c-a+o/2,p=h-r,g=c-s,m=p+o,v=g+o;ep(t,e,"main",r,s,p,g),n.transformable&&(ep(t,e,"w",l,u,a,v),ep(t,e,"e",d,u,a,v),ep(t,e,"n",l,u,m,a),ep(t,e,"s",l,f,m,a),ep(t,e,"nw",l,u,a,a),ep(t,e,"ne",d,u,a,a),ep(t,e,"sw",l,f,a,a),ep(t,e,"se",d,f,a,a))}function tp(t,e){var i=e.__brushOption,n=i.transformable,o=e.childAt(0);o.useStyle(ip(i)),o.attr({silent:!n,cursor:n?"move":"default"}),hk(["w","e","n","s","se","sw","ne","nw"],function(i){var o=e.childOfName(i),a=ap(t,i);o&&o.attr({silent:!n,invisible:!n,cursor:n?_k[a]+"-resize":null})})}function ep(t,e,i,n,o,a,r){var s=e.childOfName(i);s&&s.setShape(hp(up(t,e,[[n,o],[n+a,o+r]])))}function ip(t){return r({strokeNoScale:!0},t.brushStyle)}function np(t,e,i,n){var o=[dk(t,i),dk(e,n)],a=[fk(t,i),fk(e,n)];return[[o[0],a[0]],[o[1],a[1]]]}function op(t){return Ao(t.group)}function ap(t,e){if(e.length>1)return("e"===(n=[ap(t,(e=e.split(""))[0]),ap(t,e[1])])[0]||"w"===n[0])&&n.reverse(),n.join("");var i={left:"w",right:"e",top:"n",bottom:"s"},n=Co({w:"left",e:"right",n:"top",s:"bottom"}[e],op(t));return i[n]}function rp(t,e,i,n,o,a,r,s){var l=n.__brushOption,u=t(l.range),h=lp(i,a,r);hk(o.split(""),function(t){var e=xk[t];u[e[0]][e[1]]+=h[e[0]]}),l.range=e(np(u[0][0],u[1][0],u[0][1],u[1][1])),Zf(i,n),qf(i,{isEnd:!1})}function sp(t,e,i,n,o){var a=e.__brushOption.range,r=lp(t,i,n);hk(a,function(t){t[0]+=r[0],t[1]+=r[1]}),Zf(t,e),qf(t,{isEnd:!1})}function lp(t,e,i){var n=t.group,o=n.transformCoordToLocal(e,i),a=n.transformCoordToLocal(0,0);return[o[0]-a[0],o[1]-a[1]]}function up(t,e,n){var o=jf(t,e);return o&&!0!==o?o.clipPath(n,t._transform):i(n)}function hp(t){var e=dk(t[0][0],t[1][0]),i=dk(t[0][1],t[1][1]);return{x:e,y:i,width:fk(t[0][0],t[1][0])-e,height:fk(t[0][1],t[1][1])-i}}function cp(t,e,i){if(t._brushType){var n=t._zr,o=t._covers,a=Xf(t,e,i);if(!t._dragging)for(var r=0;r0;a--)Yp(s,l*=.99,r),jp(s,o,i,n,r),tg(s,l,r),jp(s,o,i,n,r)}function Up(t,e){var i=[],n="vertical"===e?"y":"x",o=Zi(t,function(t){return t.getLayout()[n]});return o.keys.sort(function(t,e){return t-e}),d(o.keys,function(t){i.push(o.buckets.get(t))}),i}function Xp(t,e,i,n,o,a,r){var s=[];d(e,function(t){var e=t.length,i=0,l=0;d(t,function(t){i+=t.getLayout().value}),l="vertical"===r?(o-(e-1)*a)/i:(n-(e-1)*a)/i,s.push(l)}),s.sort(function(t,e){return t-e});var l=s[0];d(e,function(t){d(t,function(t,e){var i=t.getLayout().value*l;"vertical"===r?(t.setLayout({x:e},!0),t.setLayout({dx:i},!0)):(t.setLayout({y:e},!0),t.setLayout({dy:i},!0))})}),d(i,function(t){var e=+t.getValue()*l;t.setLayout({dy:e},!0)})}function jp(t,e,i,n,o){d(t,function(t){var a,r,s,l=0,u=t.length;if("vertical"===o){var h;for(t.sort(function(t,e){return t.getLayout().x-e.getLayout().x}),s=0;s0&&(h=a.getLayout().x+r,a.setLayout({x:h},!0)),l=a.getLayout().x+a.getLayout().dx+e;if((r=l-e-n)>0)for(h=a.getLayout().x-r,a.setLayout({x:h},!0),l=h,s=u-2;s>=0;--s)(r=(a=t[s]).getLayout().x+a.getLayout().dx+e-l)>0&&(h=a.getLayout().x-r,a.setLayout({x:h},!0)),l=a.getLayout().x}else{var c;for(t.sort(function(t,e){return t.getLayout().y-e.getLayout().y}),s=0;s0&&(c=a.getLayout().y+r,a.setLayout({y:c},!0)),l=a.getLayout().y+a.getLayout().dy+e;if((r=l-e-i)>0)for(c=a.getLayout().y-r,a.setLayout({y:c},!0),l=c,s=u-2;s>=0;--s)(r=(a=t[s]).getLayout().y+a.getLayout().dy+e-l)>0&&(c=a.getLayout().y-r,a.setLayout({y:c},!0)),l=a.getLayout().y}})}function Yp(t,e,i){d(t.slice().reverse(),function(t){d(t,function(t){if(t.outEdges.length){var n=Qp(t.outEdges,qp,i)/Qp(t.outEdges,Jp,i);if("vertical"===i){var o=t.getLayout().x+(n-$p(t,i))*e;t.setLayout({x:o},!0)}else{var a=t.getLayout().y+(n-$p(t,i))*e;t.setLayout({y:a},!0)}}})})}function qp(t,e){return $p(t.node2,e)*t.getValue()}function Kp(t,e){return $p(t.node1,e)*t.getValue()}function $p(t,e){return"vertical"===e?t.getLayout().x+t.getLayout().dx/2:t.getLayout().y+t.getLayout().dy/2}function Jp(t){return t.getValue()}function Qp(t,e,i){for(var n=0,o=t.length,a=-1;++a0?"P":"N",a=n.getVisual("borderColor"+o)||n.getVisual("color"+o),r=i.getModel(Gk).getItemStyle(Wk);e.useStyle(r),e.style.fill=null,e.style.stroke=a}function fg(t,e,i,n,o){return i>n?-1:i0?t.get(o,e-1)<=n?1:-1:1}function pg(t,e){var i,n=t.getBaseAxis(),o="category"===n.type?n.getBandWidth():(i=n.getExtent(),Math.abs(i[1]-i[0])/e.count()),a=Vo(A(t.get("barMaxWidth"),o),o),r=Vo(A(t.get("barMinWidth"),1),o),s=t.get("barWidth");return null!=s?Vo(s,o):Math.max(Math.min(o/2,a),r)}function gg(t){return y(t)||(t=[+t,+t]),t}function mg(t,e){t.eachChild(function(t){t.attr({z:e.z,zlevel:e.zlevel,style:{stroke:"stroke"===e.brushType?e.color:null,fill:"fill"===e.brushType?e.color:null}})})}function vg(t,e){tb.call(this);var i=new wu(t,e),n=new tb;this.add(i),this.add(n),n.beforeUpdate=function(){this.attr(i.getScale())},this.updateData(t,e)}function yg(t){var e=t.data;e&&e[0]&&e[0][0]&&e[0][0].coord&&(t.data=f(e,function(t){var e={coords:[t[0].coord,t[1].coord]};return t[0].name&&(e.fromName=t[0].name),t[1].name&&(e.toName=t[1].name),o([e,t[0],t[1]])}))}function xg(t,e,i){tb.call(this),this.add(this.createLine(t,e,i)),this._updateEffectSymbol(t,e)}function _g(t,e,i){tb.call(this),this._createPolyline(t,e,i)}function wg(t,e,i){xg.call(this,t,e,i),this._lastFrame=0,this._lastFramePercent=0}function bg(){this.group=new tb}function Sg(t){return t instanceof Array||(t=[t,t]),t}function Mg(){var t=iw();this.canvas=t,this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={}}function Ig(t,e,i){var n=t[1]-t[0],o=(e=f(e,function(e){return{interval:[(e.interval[0]-t[0])/n,(e.interval[1]-t[0])/n]}})).length,a=0;return function(t){for(n=a;n=0;n--){var r=e[n].interval;if(r[0]<=t&&t<=r[1]){a=n;break}}return n>=0&&n=e[0]&&t<=e[1]}}function Ag(t){var e=t.dimensions;return"lng"===e[0]&&"lat"===e[1]}function Dg(t,e,i,n){var o=t.getItemLayout(e),a=i.get("symbolRepeat"),r=i.get("symbolClip"),s=i.get("symbolPosition")||"start",l=(i.get("symbolRotate")||0)*Math.PI/180||0,u=i.get("symbolPatternSize")||2,h=i.isAnimationEnabled(),c={dataIndex:e,layout:o,itemModel:i,symbolType:t.getItemVisual(e,"symbol")||"circle",color:t.getItemVisual(e,"color"),symbolClip:r,symbolRepeat:a,symbolRepeatDirection:i.get("symbolRepeatDirection"),symbolPatternSize:u,rotation:l,animationModel:h?i:null,hoverAnimation:h&&i.get("hoverAnimation"),z2:i.getShallow("z",!0)||0};Cg(i,a,o,n,c),kg(t,e,o,a,r,c.boundingLength,c.pxSign,u,n,c),Pg(i,c.symbolScale,l,n,c);var d=c.symbolSize,f=i.get("symbolOffset");return y(f)&&(f=[Vo(f[0],d[0]),Vo(f[1],d[1])]),Ng(i,d,o,a,r,f,s,c.valueLineWidth,c.boundingLength,c.repeatCutLength,n,c),c}function Cg(t,e,i,n,o){var a,r=n.valueDim,s=t.get("symbolBoundingData"),l=n.coordSys.getOtherAxis(n.coordSys.getBaseAxis()),u=l.toGlobalCoord(l.dataToCoord(0)),h=1-+(i[r.wh]<=0);if(y(s)){var c=[Lg(l,s[0])-u,Lg(l,s[1])-u];c[1]0?1:a<0?-1:0}function Lg(t,e){return t.toGlobalCoord(t.dataToCoord(t.scale.parse(e)))}function kg(t,e,i,n,o,a,r,s,l,u){var h=l.valueDim,c=l.categoryDim,d=Math.abs(i[c.wh]),f=t.getItemVisual(e,"symbolSize");y(f)?f=f.slice():(null==f&&(f="100%"),f=[f,f]),f[c.index]=Vo(f[c.index],d),f[h.index]=Vo(f[h.index],n?d:Math.abs(a)),u.symbolSize=f,(u.symbolScale=[f[0]/s,f[1]/s])[h.index]*=(l.isHorizontal?-1:1)*r}function Pg(t,e,i,n,o){var a=t.get(cP)||0;a&&(fP.attr({scale:e.slice(),rotation:i}),fP.updateTransform(),a/=fP.getLineScale(),a*=e[n.valueDim.index]),o.valueLineWidth=a}function Ng(t,e,i,n,o,r,s,l,u,h,c,d){var f=c.categoryDim,p=c.valueDim,g=d.pxSign,m=Math.max(e[p.index]+l,0),v=m;if(n){var y=Math.abs(u),x=T(t.get("symbolMargin"),"15%")+"",_=!1;x.lastIndexOf("!")===x.length-1&&(_=!0,x=x.slice(0,x.length-1)),x=Vo(x,e[p.index]);var w=Math.max(m+2*x,0),b=_?0:2*x,S=Qo(n),M=S?n:Kg((y+b)/w);w=m+2*(x=(y-M*m)/2/(_?M:M-1)),b=_?0:2*x,S||"fixed"===n||(M=h?Kg((Math.abs(h)+b)/w):0),v=M*w-b,d.repeatTimes=M,d.symbolMargin=x}var I=g*(v/2),A=d.pathPosition=[];A[f.index]=i[f.wh]/2,A[p.index]="start"===s?I:"end"===s?u-I:u/2,r&&(A[0]+=r[0],A[1]+=r[1]);var D=d.bundlePosition=[];D[f.index]=i[f.xy],D[p.index]=i[p.xy];var C=d.barRectShape=a({},i);C[p.wh]=g*Math.max(Math.abs(i[p.wh]),Math.abs(A[p.index]+I)),C[f.wh]=i[f.wh];var L=d.clipShape={};L[f.xy]=-i[f.xy],L[f.wh]=c.ecSize[f.wh],L[p.xy]=0,L[p.wh]=i[p.wh]}function Og(t){var e=t.symbolPatternSize,i=Jl(t.symbolType,-e/2,-e/2,e,e,t.color);return i.attr({culling:!0}),"image"!==i.type&&i.setStyle({strokeNoScale:!0}),i}function Eg(t,e,i,n){function o(t){var e=l.slice(),n=i.pxSign,o=t;return("start"===i.symbolRepeatDirection?n>0:n<0)&&(o=h-1-t),e[u.index]=d*(o-h/2+.5)+l[u.index],{position:e,scale:i.symbolScale.slice(),rotation:i.rotation}}var a=t.__pictorialBundle,r=i.symbolSize,s=i.valueLineWidth,l=i.pathPosition,u=e.valueDim,h=i.repeatTimes||0,c=0,d=r[e.valueDim.index]+s+2*i.symbolMargin;for(jg(t,function(t){t.__pictorialAnimationIndex=c,t.__pictorialRepeatTimes=h,c0)],d=t.__pictorialBarRect;kh(d.style,h,a,n,e.seriesModel,o,c),fo(d,h)}function Kg(t){var e=Math.round(t);return Math.abs(t-e)<1e-4?e:Math.ceil(t)}function $g(t,e,i){this.dimension="single",this.dimensions=["single"],this._axis=null,this._rect,this._init(t,e,i),this.model=t}function Jg(t,e){e=e||{};var i=t.coordinateSystem,n=t.axis,o={},a=n.position,r=n.orient,s=i.getRect(),l=[s.x,s.x+s.width,s.y,s.y+s.height],u={horizontal:{top:l[2],bottom:l[3]},vertical:{left:l[0],right:l[1]}};o.position=["vertical"===r?u.vertical[a]:l[0],"horizontal"===r?u.horizontal[a]:l[3]];var h={horizontal:0,vertical:1};o.rotation=Math.PI/2*h[r];var c={top:-1,bottom:1,right:1,left:-1};o.labelDirection=o.tickDirection=o.nameDirection=c[a],t.get("axisTick.inside")&&(o.tickDirection=-o.tickDirection),T(e.labelInside,t.get("axisLabel.inside"))&&(o.labelDirection=-o.labelDirection);var d=e.rotate;return null==d&&(d=t.get("axisLabel.rotate")),o.labelRotation="top"===a?-d:d,o.z2=1,o}function Qg(t,e,i,n,o){var r=t.axis;if(!r.scale.isBlank()&&r.containData(e))if(t.involveSeries){var s=tm(e,t),l=s.payloadBatch,u=s.snapToValue;l[0]&&null==o.seriesIndex&&a(o,l[0]),!n&&t.snap&&r.containData(u)&&null!=u&&(e=u),i.showPointer(t,e,l,o),i.showTooltip(t,s,u)}else i.showPointer(t,e)}function tm(t,e){var i=e.axis,n=i.dim,o=t,a=[],r=Number.MAX_VALUE,s=-1;return _P(e.seriesModels,function(e,l){var u,h,c=e.getData().mapDimension(n,!0);if(e.getAxisTooltipData){var d=e.getAxisTooltipData(c,t,i);h=d.dataIndices,u=d.nestestValue}else{if(!(h=e.getData().indicesOfNearest(c[0],t,"category"===i.type?.5:null)).length)return;u=e.getData().get(c[0],h[0])}if(null!=u&&isFinite(u)){var f=t-u,p=Math.abs(f);p<=r&&((p=0&&s<0)&&(r=p,s=f,o=u,a.length=0),_P(h,function(t){a.push({seriesIndex:e.seriesIndex,dataIndexInside:t,dataIndex:e.getData().getRawIndex(t)})}))}}),{payloadBatch:a,snapToValue:o}}function em(t,e,i,n){t[e.key]={value:i,payloadBatch:n}}function im(t,e,i,n){var o=i.payloadBatch,a=e.axis,r=a.model,s=e.axisPointerModel;if(e.triggerTooltip&&o.length){var l=e.coordSys.model,u=Ah(l),h=t.map[u];h||(h=t.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(h)),h.dataByAxis.push({axisDim:a.dim,axisIndex:r.componentIndex,axisType:r.type,axisId:r.id,value:n,valueLabelOpt:{precision:s.get("label.precision"),formatter:s.get("label.formatter")},seriesDataIndices:o.slice()})}}function nm(t,e,i){var n=i.axesInfo=[];_P(e,function(e,i){var o=e.axisPointerModel.option,a=t[i];a?(!e.useHandle&&(o.status="show"),o.value=a.value,o.seriesDataIndices=(a.payloadBatch||[]).slice()):!e.useHandle&&(o.status="hide"),"show"===o.status&&n.push({axisDim:e.axis.dim,axisIndex:e.axis.model.componentIndex,value:o.value})})}function om(t,e,i,n){if(!lm(e)&&t.list.length){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})}else n({type:"hideTip"})}function am(t,e,i){var n=i.getZr(),o=bP(n).axisPointerLastHighlights||{},a=bP(n).axisPointerLastHighlights={};_P(t,function(t,e){var i=t.axisPointerModel.option;"show"===i.status&&_P(i.seriesDataIndices,function(t){var e=t.seriesIndex+" | "+t.dataIndex;a[e]=t})});var r=[],s=[];d(o,function(t,e){!a[e]&&s.push(t)}),d(a,function(t,e){!o[e]&&r.push(t)}),s.length&&i.dispatchAction({type:"downplay",escapeConnect:!0,batch:s}),r.length&&i.dispatchAction({type:"highlight",escapeConnect:!0,batch:r})}function rm(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}}function sm(t){var e=t.axis.model,i={},n=i.axisDim=t.axis.dim;return i.axisIndex=i[n+"AxisIndex"]=e.componentIndex,i.axisName=i[n+"AxisName"]=e.name,i.axisId=i[n+"AxisId"]=e.id,i}function lm(t){return!t||null==t[0]||isNaN(t[0])||null==t[1]||isNaN(t[1])}function um(t,e,i){if(!U_.node){var n=e.getZr();SP(n).records||(SP(n).records={}),hm(n,e),(SP(n).records[t]||(SP(n).records[t]={})).handler=i}}function hm(t,e){function i(i,n){t.on(i,function(i){var o=pm(e);MP(SP(t).records,function(t){t&&n(t,i,o.dispatchAction)}),cm(o.pendings,e)})}SP(t).initialized||(SP(t).initialized=!0,i("click",v(fm,"click")),i("mousemove",v(fm,"mousemove")),i("globalout",dm))}function cm(t,e){var i,n=t.showTip.length,o=t.hideTip.length;n?i=t.showTip[n-1]:o&&(i=t.hideTip[o-1]),i&&(i.dispatchAction=null,e.dispatchAction(i))}function dm(t,e,i){t.handler("leave",null,i)}function fm(t,e,i,n){e.handler(t,i,n)}function pm(t){var e={showTip:[],hideTip:[]},i=function(n){var o=e[n.type];o?o.push(n):(n.dispatchAction=i,t.dispatchAction(n))};return{dispatchAction:i,pendings:e}}function gm(t,e){if(!U_.node){var i=e.getZr();(SP(i).records||{})[t]&&(SP(i).records[t]=null)}}function mm(){}function vm(t,e,i,n){ym(TP(i).lastProp,n)||(TP(i).lastProp=n,e?Io(i,n,t):(i.stopAnimation(),i.attr(n)))}function ym(t,e){if(w(t)&&w(e)){var i=!0;return d(e,function(e,n){i=i&&ym(t[n],e)}),!!i}return t===e}function xm(t,e){t[e.get("label.show")?"show":"hide"]()}function _m(t){return{position:t.position.slice(),rotation:t.rotation||0}}function wm(t,e,i){var n=e.get("z"),o=e.get("zlevel");t&&t.traverse(function(t){"group"!==t.type&&(null!=n&&(t.z=n),null!=o&&(t.zlevel=o),t.silent=i)})}function bm(t){var e,i=t.get("type"),n=t.getModel(i+"Style");return"line"===i?(e=n.getLineStyle()).fill=null:"shadow"===i&&((e=n.getAreaStyle()).stroke=null),e}function Sm(t,e,i,n,o){var a=Im(i.get("value"),e.axis,e.ecModel,i.get("seriesDataIndices"),{precision:i.get("label.precision"),formatter:i.get("label.formatter")}),r=i.getModel("label"),s=qM(r.get("padding")||0),l=r.getFont(),u=ke(a,l),h=o.position,c=u.width+s[1]+s[3],d=u.height+s[0]+s[2],f=o.align;"right"===f&&(h[0]-=c),"center"===f&&(h[0]-=c/2);var p=o.verticalAlign;"bottom"===p&&(h[1]-=d),"middle"===p&&(h[1]-=d/2),Mm(h,c,d,n);var g=r.get("backgroundColor");g&&"auto"!==g||(g=e.get("axisLine.lineStyle.color")),t.label={shape:{x:0,y:0,width:c,height:d,r:r.get("borderRadius")},position:h.slice(),style:{text:a,textFont:l,textFill:r.getTextColor(),textPosition:"inside",fill:g,stroke:r.get("borderColor")||"transparent",lineWidth:r.get("borderWidth")||0,shadowBlur:r.get("shadowBlur"),shadowColor:r.get("shadowColor"),shadowOffsetX:r.get("shadowOffsetX"),shadowOffsetY:r.get("shadowOffsetY")},z2:10}}function Mm(t,e,i,n){var o=n.getWidth(),a=n.getHeight();t[0]=Math.min(t[0]+e,o)-e,t[1]=Math.min(t[1]+i,a)-i,t[0]=Math.max(t[0],0),t[1]=Math.max(t[1],0)}function Im(t,e,i,n,o){t=e.scale.parse(t);var a=e.scale.getLabel(t,{precision:o.precision}),r=o.formatter;if(r){var s={value:Xl(e,t),seriesData:[]};d(n,function(t){var e=i.getSeriesByIndex(t.seriesIndex),n=t.dataIndexInside,o=e&&e.getDataParams(n);o&&s.seriesData.push(o)}),_(r)?a=r.replace("{value}",a):x(r)&&(a=r(s))}return a}function Tm(t,e,i){var n=xt();return Mt(n,n,i.rotation),St(n,n,i.position),Do([t.dataToCoord(e),(i.labelOffset||0)+(i.labelDirection||1)*(i.labelMargin||0)],n)}function Am(t,e,i,n,o,a){var r=FD.innerTextLayout(i.rotation,0,i.labelDirection);i.labelMargin=o.get("label.margin"),Sm(e,n,o,a,{position:Tm(n.axis,t,i),align:r.textAlign,verticalAlign:r.textVerticalAlign})}function Dm(t,e,i){return i=i||0,{x1:t[i],y1:t[1-i],x2:e[i],y2:e[1-i]}}function Cm(t,e,i){return i=i||0,{x:t[i],y:t[1-i],width:e[i],height:e[1-i]}}function Lm(t,e,i,n,o,a){return{cx:t,cy:e,r0:i,r:n,startAngle:o,endAngle:a,clockwise:!0}}function km(t,e){var i={};return i[e.dim+"AxisIndex"]=e.index,t.getCartesian(i)}function Pm(t){return"x"===t.dim?0:1}function Nm(t){return t.isHorizontal()?0:1}function Om(t,e){var i=t.getRect();return[i[kP[e]],i[kP[e]]+i[PP[e]]]}function Em(t,e,i){var n=new yM({shape:{x:t.x-10,y:t.y-10,width:0,height:t.height+20}});return To(n,{shape:{width:t.width+20,height:t.height+20}},e,i),n}function Rm(t,e,i){if(t.count())for(var n,o=e.coordinateSystem,a=e.getLayerSeries(),r=t.mapDimension("single"),s=t.mapDimension("value"),l=f(a,function(e){return f(e.indices,function(e){var i=o.dataToPoint(t.get(r,e));return i[1]=t.get(s,e),i})}),u=zm(l),h=u.y0,c=i/u.max,d=a.length,p=a[0].indices.length,g=0;ga&&(a=u),n.push(u)}for(var h=0;ha&&(a=d)}return r.y0=o,r.max=a,r}function Bm(t){var e=0;d(t.children,function(t){Bm(t);var i=t.value;y(i)&&(i=i[0]),e+=i});var i=t.value;y(i)&&(i=i[0]),(null==i||isNaN(i))&&(i=e),i<0&&(i=0),y(t.value)?t.value[0]=i:t.value=i}function Vm(t,e,i){function n(){r.ignore=r.hoverIgnore}function o(){r.ignore=r.normalIgnore}tb.call(this);var a=new hM({z2:zP});a.seriesIndex=e.seriesIndex;var r=new rM({z2:BP,silent:t.getModel("label").get("silent")});this.add(a),this.add(r),this.updateData(!0,t,"normal",e,i),this.on("emphasis",n).on("normal",o).on("mouseover",n).on("mouseout",o)}function Gm(t,e,i){var n=t.getVisual("color"),o=t.getVisual("visualMeta");o&&0!==o.length||(n=null);var a=t.getModel("itemStyle").get("color");if(a)return a;if(n)return n;if(0===t.depth)return i.option.color[0];var r=i.option.color.length;return a=i.option.color[Fm(t)%r]}function Fm(t){for(var e=t;e.depth>1;)e=e.parentNode;return l(t.getAncestors()[0].children,e)}function Wm(t,e,i){return i!==RP.NONE&&(i===RP.SELF?t===e:i===RP.ANCESTOR?t===e||t.isAncestorOf(e):t===e||t.isDescendantOf(e))}function Hm(t,e,i){e.getData().setItemVisual(t.dataIndex,"color",i)}function Zm(t,e){var i=t.children||[];t.children=Um(i,e),i.length&&d(t.children,function(t){Zm(t,e)})}function Um(t,e){if("function"==typeof e)return t.sort(e);var i="asc"===e;return t.sort(function(t,e){var n=(t.getValue()-e.getValue())*(i?1:-1);return 0===n?(t.dataIndex-e.dataIndex)*(i?-1:1):n})}function Xm(t,e){return e=e||[0,0],f(["x","y"],function(i,n){var o=this.getAxis(i),a=e[n],r=t[n]/2;return"category"===o.type?o.getBandWidth():Math.abs(o.dataToCoord(a-r)-o.dataToCoord(a+r))},this)}function jm(t,e){return e=e||[0,0],f([0,1],function(i){var n=e[i],o=t[i]/2,a=[],r=[];return a[i]=n-o,r[i]=n+o,a[1-i]=r[1-i]=e[1-i],Math.abs(this.dataToPoint(a)[i]-this.dataToPoint(r)[i])},this)}function Ym(t,e){var i=this.getAxis(),n=e instanceof Array?e[0]:e,o=(t instanceof Array?t[0]:t)/2;return"category"===i.type?i.getBandWidth():Math.abs(i.dataToCoord(n-o)-i.dataToCoord(n+o))}function qm(t,e){return f(["Radius","Angle"],function(i,n){var o=this["get"+i+"Axis"](),a=e[n],r=t[n]/2,s="dataTo"+i,l="category"===o.type?o.getBandWidth():Math.abs(o[s](a-r)-o[s](a+r));return"Angle"===i&&(l=l*Math.PI/180),l},this)}function Km(t){var e,i=t.type;if("path"===i){var n=t.shape,o=null!=n.width&&null!=n.height?{x:n.x||0,y:n.y||0,width:n.width,height:n.height}:null,a=lv(n);(e=Xn(a,null,o,n.layout||"center")).__customPathData=a}else"image"===i?(e=new fi({})).__customImagePath=t.style.image:"text"===i?(e=new rM({})).__customText=t.style.text:e=new(0,zM[i.charAt(0).toUpperCase()+i.slice(1)]);return e.__customGraphicType=i,e.name=t.name,e}function $m(t,e,n,o,a,r,s){var l={},u=n.style||{};if(n.shape&&(l.shape=i(n.shape)),n.position&&(l.position=n.position.slice()),n.scale&&(l.scale=n.scale.slice()),n.origin&&(l.origin=n.origin.slice()),n.rotation&&(l.rotation=n.rotation),"image"===t.type&&n.style){h=l.style={};d(["x","y","width","height"],function(e){Jm(e,h,u,t.style,r)})}if("text"===t.type&&n.style){var h=l.style={};d(["x","y"],function(e){Jm(e,h,u,t.style,r)}),!u.hasOwnProperty("textFill")&&u.fill&&(u.textFill=u.fill),!u.hasOwnProperty("textStroke")&&u.stroke&&(u.textStroke=u.stroke)}if("group"!==t.type&&(t.useStyle(u),r)){t.style.opacity=0;var c=u.opacity;null==c&&(c=1),To(t,{style:{opacity:c}},o,e)}r?t.attr(l):Io(t,l,o,e),n.hasOwnProperty("z2")&&t.attr("z2",n.z2||0),n.hasOwnProperty("silent")&&t.attr("silent",n.silent),n.hasOwnProperty("invisible")&&t.attr("invisible",n.invisible),n.hasOwnProperty("ignore")&&t.attr("ignore",n.ignore),n.hasOwnProperty("info")&&t.attr("info",n.info);var f=n.styleEmphasis,p=!1===f;t.__cusHasEmphStl&&null==f||!t.__cusHasEmphStl&&p||(ro(t,f),t.__cusHasEmphStl=!p),s&&po(t,!p)}function Jm(t,e,i,n,o){null==i[t]||o||(e[t]=i[t],i[t]=n[t])}function Qm(t,e,i,n){function o(t){null==t&&(t=h),v&&(c=e.getItemModel(t),d=c.getModel(UP),f=c.getModel(XP),p=e.getItemVisual(t,"color"),v=!1)}var s=t.get("renderItem"),l=t.coordinateSystem,u={};l&&(u=l.prepareCustoms?l.prepareCustoms():YP[l.type](l));var h,c,d,f,p,g=r({getWidth:n.getWidth,getHeight:n.getHeight,getZr:n.getZr,getDevicePixelRatio:n.getDevicePixelRatio,value:function(t,i){return null==i&&(i=h),e.get(e.getDimension(t||0),i)},style:function(i,n){null==n&&(n=h),o(n);var r=c.getModel(HP).getItemStyle();null!=p&&(r.fill=p);var s=e.getItemVisual(n,"opacity");return null!=s&&(r.opacity=s),mo(r,d,null,{autoColor:p,isRectText:!0}),r.text=d.getShallow("show")?A(t.getFormattedLabel(n,"normal"),_u(e,n)):null,i&&a(r,i),r},styleEmphasis:function(i,n){null==n&&(n=h),o(n);var r=c.getModel(ZP).getItemStyle();return mo(r,f,null,{isRectText:!0},!0),r.text=f.getShallow("show")?D(t.getFormattedLabel(n,"emphasis"),t.getFormattedLabel(n,"normal"),_u(e,n)):null,i&&a(r,i),r},visual:function(t,i){return null==i&&(i=h),e.getItemVisual(i,t)},barLayout:function(t){if(l.getBaseAxis)return Ll(r({axis:l.getBaseAxis()},t),n)},currentSeriesIndices:function(){return i.getCurrentSeriesIndices()},font:function(t){return So(t,i)}},u.api||{}),m={context:{},seriesId:t.id,seriesName:t.name,seriesIndex:t.seriesIndex,coordSys:u.coordSys,dataInsideLength:e.count(),encode:tv(t.getData())},v=!0;return function(t,i){return h=t,v=!0,s&&s(r({dataIndexInside:t,dataIndex:e.getRawIndex(t),actionType:i?i.type:null},m),g)}}function tv(t){var e={};return d(t.dimensions,function(i,n){var o=t.getDimensionInfo(i);if(!o.isExtraCoord){var a=o.coordDim;(e[a]=e[a]||[])[o.coordDimIndex]=n}}),e}function ev(t,e,i,n,o,a){return(t=iv(t,e,i,n,o,a,!0))&&a.setItemGraphicEl(e,t),t}function iv(t,e,i,n,o,a,r){var s=!i,l=(i=i||{}).type,u=i.shape,h=i.style;if(t&&(s||null!=l&&l!==t.__customGraphicType||"path"===l&&uv(u)&&lv(u)!==t.__customPathData||"image"===l&&hv(h,"image")&&h.image!==t.__customImagePath||"text"===l&&hv(u,"text")&&h.text!==t.__customText)&&(o.remove(t),t=null),!s){var c=!t;return!t&&(t=Km(i)),$m(t,e,i,n,a,c,r),"group"===l&&nv(t,e,i,n,a),o.add(t),t}}function nv(t,e,i,n,o){var a=i.children,r=a?a.length:0,s=i.$mergeChildren,l="byName"===s||i.diffChildrenByName,u=!1===s;if(r||l||u)if(l)ov({oldChildren:t.children()||[],newChildren:a||[],dataIndex:e,animatableModel:n,group:t,data:o});else{u&&t.removeAll();for(var h=0;hn?t-=l+a:t+=a),null!=r&&(e+u+r>o?e-=u+r:e+=r),[t,e]}function Ov(t,e,i,n,o){var a=i.getOuterSize(),r=a.width,s=a.height;return t=Math.min(t+r,n)-r,e=Math.min(e+s,o)-s,t=Math.max(t,0),e=Math.max(e,0),[t,e]}function Ev(t,e,i){var n=i[0],o=i[1],a=0,r=0,s=e.width,l=e.height;switch(t){case"inside":a=e.x+s/2-n/2,r=e.y+l/2-o/2;break;case"top":a=e.x+s/2-n/2,r=e.y-o-5;break;case"bottom":a=e.x+s/2-n/2,r=e.y+l+5;break;case"left":a=e.x-n-5,r=e.y+l/2-o/2;break;case"right":a=e.x+s+5,r=e.y+l/2-o/2}return[a,r]}function Rv(t){return"center"===t||"middle"===t}function zv(t){return t.get("stack")||"__ec_stack_"+t.seriesIndex}function Bv(t){return t.dim}function Vv(t,e){var i={};d(t,function(t,e){var n=t.getData(),o=t.coordinateSystem.getBaseAxis(),a=o.getExtent(),r="category"===o.type?o.getBandWidth():Math.abs(a[1]-a[0])/n.count(),s=i[Bv(o)]||{bandWidth:r,remainedWidth:r,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},l=s.stacks;i[Bv(o)]=s;var u=zv(t);l[u]||s.autoWidthCount++,l[u]=l[u]||{width:0,maxWidth:0};var h=Vo(t.get("barWidth"),r),c=Vo(t.get("barMaxWidth"),r),d=t.get("barGap"),f=t.get("barCategoryGap");h&&!l[u].width&&(h=Math.min(s.remainedWidth,h),l[u].width=h,s.remainedWidth-=h),c&&(l[u].maxWidth=c),null!=d&&(s.gap=d),null!=f&&(s.categoryGap=f)});var n={};return d(i,function(t,e){n[e]={};var i=t.stacks,o=t.bandWidth,a=Vo(t.categoryGap,o),r=Vo(t.gap,1),s=t.remainedWidth,l=t.autoWidthCount,u=(s-a)/(l+(l-1)*r);u=Math.max(u,0),d(i,function(t,e){var i=t.maxWidth;i&&ie[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 jv(t){return t.getRadiusAxis().inverse?0:1}function Yv(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()}function qv(t,e,i){return{position:[t.cx,t.cy],rotation:i/180*Math.PI,labelDirection:-1,tickDirection:-1,nameDirection:1,labelRotate:e.getModel("axisLabel").get("rotate"),z2:1}}function Kv(t,e,i,n,o){var a=e.axis,r=a.dataToCoord(t),s=n.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l,u,h,c=n.getRadiusAxis().getExtent();if("radius"===a.dim){var d=xt();Mt(d,d,s),St(d,d,[n.cx,n.cy]),l=Do([r,-o],d);var f=e.getModel("axisLabel").get("rotate")||0,p=FD.innerTextLayout(s,f*Math.PI/180,-1);u=p.textAlign,h=p.textVerticalAlign}else{var g=c[1];l=n.coordToPoint([g+o,r]);var m=n.cx,v=n.cy;u=Math.abs(l[0]-m)/g<.3?"center":l[0]>m?"left":"right",h=Math.abs(l[1]-v)/g<.3?"middle":l[1]>v?"top":"bottom"}return{position:l,align:u,verticalAlign:h}}function $v(t,e){e.update="updateView",Es(e,function(e,i){var n={};return i.eachComponent({mainType:"geo",query:e},function(i){i[t](e.name),d(i.coordinateSystem.regions,function(t){n[t.name]=i.isSelected(t.name)||!1})}),{selected:n,name:e.name}})}function Jv(t){var e={};d(t,function(t){e[t]=1}),t.length=0,d(e,function(e,i){t.push(i)})}function Qv(t){if(t)for(var e in t)if(t.hasOwnProperty(e))return!0}function ty(t,e,n){function o(){var t=function(){};return t.prototype.__hidden=t.prototype,new t}var a={};return MN(e,function(e){var r=a[e]=o();MN(t[e],function(t,o){if(hL.isValidType(o)){var a={type:o,visual:t};n&&n(a,e),r[o]=new hL(a),"opacity"===o&&((a=i(a)).type="colorAlpha",r.__hidden.__alphaForOpacity=new hL(a))}})}),a}function ey(t,e,n){var o;d(n,function(t){e.hasOwnProperty(t)&&Qv(e[t])&&(o=!0)}),o&&d(n,function(n){e.hasOwnProperty(n)&&Qv(e[n])?t[n]=i(e[n]):delete t[n]})}function iy(t,e,i,n,o,a){function r(t){return i.getItemVisual(h,t)}function s(t,e){i.setItemVisual(h,t,e)}function l(t,l){h=null==a?t:l;var c=i.getRawDataItem(h);if(!c||!1!==c.visualMap)for(var d=n.call(o,t),f=e[d],p=u[d],g=0,m=p.length;g1)return!1;var h=uy(i-t,o-t,n-e,a-e)/l;return!(h<0||h>1)}function ly(t){return t<=1e-6&&t>=-1e-6}function uy(t,e,i,n){return t*n-e*i}function hy(t,e,i){var n=this._targetInfoList=[],o={},a=dy(e,t);TN(PN,function(t,e){(!i||!i.include||AN(i.include,e)>=0)&&t(a,n,o)})}function cy(t){return t[0]>t[1]&&t.reverse(),t}function dy(t,e){return Vi(t,e,{includeMainTypes:LN})}function fy(t,e,i,n){var o=i.getAxis(["x","y"][t]),a=cy(f([0,1],function(t){return e?o.coordToData(o.toLocalCoord(n[t])):o.toGlobalCoord(o.dataToCoord(n[t]))})),r=[];return r[t]=a,r[1-t]=[NaN,NaN],{values:a,xyMinMax:r}}function py(t,e,i,n){return[e[0]-n[t]*i[0],e[1]-n[t]*i[1]]}function gy(t,e){var i=my(t),n=my(e),o=[i[0]/n[0],i[1]/n[1]];return isNaN(o[0])&&(o[0]=1),isNaN(o[1])&&(o[1]=1),o}function my(t){return t?[t[0][1]-t[0][0],t[1][1]-t[1][0]]:[NaN,NaN]}function vy(t,e,i,n,o){if(o){var a=t.getZr();a[VN]||(a[BN]||(a[BN]=yy),Nr(a,BN,i,e)(t,n))}}function yy(t,e){if(!t.isDisposed()){var i=t.getZr();i[VN]=!0,t.dispatchAction({type:"brushSelect",batch:e}),i[VN]=!1}}function xy(t,e,i,n){for(var o=0,a=e.length;o=0}function Ny(t,e,i){function n(t,e){return l(e.nodes,t)>=0}function o(t,n){var o=!1;return e(function(e){d(i(t,e)||[],function(t){n.records[e.name][t]&&(o=!0)})}),o}function a(t,n){n.nodes.push(t),e(function(e){d(i(t,e)||[],function(t){n.records[e.name][t]=!0})})}return function(i){var r={nodes:[],records:{}};if(e(function(t){r.records[t.name]={}}),!i)return r;a(i,r);var s;do{s=!1,t(function(t){!n(t,r)&&o(t,r)&&(a(t,r),s=!0)})}while(s);return r}}function Oy(t,e,i){var n=[1/0,-1/0];return $N(i,function(t){var i=t.getData();i&&$N(i.mapDimension(e,!0),function(t){var e=i.getApproximateExtent(t);e[0]n[1]&&(n[1]=e[1])})}),n[1]0?0:NaN);var r=i.getMax(!0);return null!=r&&"dataMax"!==r&&"function"!=typeof r?e[1]=r:o&&(e[1]=a>0?a-1:NaN),i.get("scale",!0)||(e[0]>0&&(e[0]=0),e[1]<0&&(e[1]=0)),e}function Ry(t,e){var i=t.getAxisModel(),n=t._percentWindow,o=t._valueWindow;if(n){var a=Zo(o,[0,500]);a=Math.min(a,20);var r=e||0===n[0]&&100===n[1];i.setRange(r?null:+o[0].toFixed(a),r?null:+o[1].toFixed(a))}}function zy(t){var e=t._minMaxSpan={},i=t._dataZoomModel;$N(["min","max"],function(n){e[n+"Span"]=i.get(n+"Span");var o=i.get(n+"ValueSpan");if(null!=o&&(e[n+"ValueSpan"]=o,null!=(o=t.getAxisModel().axis.scale.parse(o)))){var a=t._dataExtent;e[n+"Span"]=Bo(a[0]+o,a,[0,100],!0)}})}function By(t){var e={};return tO(["start","end","startValue","endValue","throttle"],function(i){t.hasOwnProperty(i)&&(e[i]=t[i])}),e}function Vy(t,e){var i=t._rangePropMode,n=t.get("rangeMode");tO([["start","startValue"],["end","endValue"]],function(t,o){var a=null!=e[t[0]],r=null!=e[t[1]];a&&!r?i[o]="percent":!a&&r?i[o]="value":n?i[o]=n[o]:a&&(i[o]="percent")})}function Gy(t){return{x:"y",y:"x",radius:"angle",angle:"radius"}[t]}function Fy(t){return"vertical"===t?"ns-resize":"ew-resize"}function Wy(t,e){var i=Uy(t),n=e.dataZoomId,o=e.coordId;d(i,function(t,i){var a=t.dataZoomInfos;a[n]&&l(e.allCoordIds,o)<0&&(delete a[n],t.count--)}),jy(i);var a=i[o];a||((a=i[o]={coordId:o,dataZoomInfos:{},count:0}).controller=Xy(t,a),a.dispatchAction=v(Yy,t)),!a.dataZoomInfos[n]&&a.count++,a.dataZoomInfos[n]=e;var r=qy(a.dataZoomInfos);a.controller.enable(r.controlType,r.opt),a.controller.setPointerChecker(e.containsPoint),Nr(a,"dispatchAction",e.dataZoomModel.get("throttle",!0),"fixRate")}function Hy(t,e){var i=Uy(t);d(i,function(t){t.controller.dispose();var i=t.dataZoomInfos;i[e]&&(delete i[e],t.count--)}),jy(i)}function Zy(t){return t.type+"\0_"+t.id}function Uy(t){var e=t.getZr();return e[fO]||(e[fO]={})}function Xy(t,e){var i=new oc(t.getZr());return d(["pan","zoom","scrollMove"],function(t){i.on(t,function(i){var n=[];d(e.dataZoomInfos,function(o){if(i.isAvailableBehavior(o.dataZoomModel.option)){var a=(o.getRange||{})[t],r=a&&a(e.controller,i);!o.dataZoomModel.get("disabled",!0)&&r&&n.push({dataZoomId:o.dataZoomId,start:r[0],end:r[1]})}}),n.length&&e.dispatchAction(n)})}),i}function jy(t){d(t,function(e,i){e.count||(e.controller.dispose(),delete t[i])})}function Yy(t,e){t.dispatchAction({type:"dataZoom",batch:e})}function qy(t){var e,i={type_true:2,type_move:1,type_false:0,type_undefined:-1},n=!0;return d(t,function(t){var o=t.dataZoomModel,a=!o.get("disabled",!0)&&(!o.get("zoomLock",!0)||"move");i["type_"+a]>i["type_"+e]&&(e=a),n&=o.get("preventDefaultMouseMove",!0)}),{controlType:e,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!n}}}function Ky(t){return function(e,i,n,o){var a=this._range,r=a.slice(),s=e.axisModels[0];if(s){var l=t(r,s,e,i,n,o);return QL(l,r,[0,100],"all"),this._range=r,a[0]!==r[0]||a[1]!==r[1]?r:void 0}}}function $y(t,e){return t&&t.hasOwnProperty&&t.hasOwnProperty(e)}function Jy(t,e,i,n){for(var o=e.targetVisuals[n],a=hL.prepareVisualTypes(o),r={color:t.getData().getVisual("color")},s=0,l=a.length;s=0&&(r[a]=+r[a].toFixed(h)),r}function fx(t,e){var n=t.getData(),o=t.coordinateSystem;if(e&&!cx(e)&&!y(e.coord)&&o){var a=o.dimensions,r=px(e,n,o,t);if((e=i(e)).type&&YO[e.type]&&r.baseAxis&&r.valueAxis){var s=XO(a,r.baseAxis.dim),l=XO(a,r.valueAxis.dim);e.coord=YO[e.type](n,r.baseDataDim,r.valueDataDim,s,l),e.value=e.coord[l]}else{for(var u=[null!=e.xAxis?e.xAxis:e.radiusAxis,null!=e.yAxis?e.yAxis:e.angleAxis],h=0;h<2;h++)YO[u[h]]&&(u[h]=yx(n,n.mapDimension(a[h]),u[h]));e.coord=u}}return e}function px(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(gx(n,o.valueDataDim)),o.baseAxis=i.getOtherAxis(o.valueAxis),o.baseDataDim=e.mapDimension(o.baseAxis.dim)):(o.baseAxis=n.getBaseAxis(),o.valueAxis=i.getOtherAxis(o.baseAxis),o.baseDataDim=e.mapDimension(o.baseAxis.dim),o.valueDataDim=e.mapDimension(o.valueAxis.dim)),o}function gx(t,e){var i=t.getData(),n=i.dimensions;e=i.getDimension(e);for(var o=0;o=0)return!0}function Yx(t){for(var e=t.split(/\n+/g),i=[],n=f(Xx(e.shift()).split(pE),function(t){return{name:t,data:[]}}),o=0;o=0&&!i[o][n];o--);if(o<0){var a=t.queryComponents({mainType:"dataZoom",subType:"select",id:n})[0];if(a){var r=a.getPercentRange();i[0][n]={dataZoomId:n,start:r[0],end:r[1]}}}}),i.push(e)}function t_(t){var e=n_(t),i=e[e.length-1];e.length>1&&e.pop();var n={};return gE(i,function(t,i){for(var o=e.length-1;o>=0;o--)if(t=e[o][i]){n[i]=t;break}}),n}function e_(t){t[mE]=null}function i_(t){return n_(t).length}function n_(t){var e=t[mE];return e||(e=t[mE]=[{}]),e}function o_(t,e,i){(this._brushController=new zf(i.getZr())).on("brush",m(this._onBrush,this)).mount(),this._isZoomActive}function a_(t){var e={};return d(["xAxisIndex","yAxisIndex"],function(i){e[i]=t[i],null==e[i]&&(e[i]="all"),(!1===e[i]||"none"===e[i])&&(e[i]=[])}),e}function r_(t,e){t.setIconStatus("back",i_(e)>1?"emphasis":"normal")}function s_(t,e,i,n,o){var a=i._isZoomActive;n&&"takeGlobalCursor"===n.type&&(a="dataZoomSelect"===n.key&&n.dataZoomSelectActive),i._isZoomActive=a,t.setIconStatus("zoom",a?"emphasis":"normal");var r=new hy(a_(t.option),e,{include:["grid"]});i._brushController.setPanels(r.makePanelOpts(o,function(t){return t.xAxisDeclared&&!t.yAxisDeclared?"lineX":!t.xAxisDeclared&&t.yAxisDeclared?"lineY":"rect"})).enableBrush(!!a&&{brushType:"auto",brushStyle:{lineWidth:0,fill:"rgba(0,0,0,0.2)"}})}function l_(t){this.model=t}function u_(t){return SE(t)}function h_(){if(!TE&&AE){TE=!0;var t=AE.styleSheets;t.length<31?AE.createStyleSheet().addRule(".zrvml","behavior:url(#default#VML)"):t[0].addRule(".zrvml","behavior:url(#default#VML)")}}function c_(t){return parseInt(t,10)}function d_(t,e){h_(),this.root=t,this.storage=e;var i=document.createElement("div"),n=document.createElement("div");i.style.cssText="display:inline-block;overflow:hidden;position:relative;width:300px;height:150px;",n.style.cssText="position:absolute;left:0;top:0;",t.appendChild(i),this._vmlRoot=n,this._vmlViewport=i,this.resize();var o=e.delFromStorage,a=e.addToStorage;e.delFromStorage=function(t){o.call(e,t),t&&t.onRemove&&t.onRemove(n)},e.addToStorage=function(t){t.onAdd&&t.onAdd(n),a.call(e,t)},this._firstPaint=!0}function f_(t){return function(){Yw('In IE8.0 VML mode painter not support method "'+t+'"')}}function p_(t){return document.createElementNS(sR,t)}function g_(t){return cR(1e4*t)/1e4}function m_(t){return t-vR}function v_(t,e){var i=e?t.textFill:t.fill;return null!=i&&i!==hR}function y_(t,e){var i=e?t.textStroke:t.stroke;return null!=i&&i!==hR}function x_(t,e){e&&__(t,"transform","matrix("+uR.call(e,",")+")")}function __(t,e,i){(!i||"linear"!==i.type&&"radial"!==i.type)&&t.setAttribute(e,i)}function w_(t,e,i){t.setAttributeNS("http://www.w3.org/1999/xlink",e,i)}function b_(t,e,i,n){if(v_(e,i)){var o=i?e.textFill:e.fill;o="transparent"===o?hR:o,"none"!==t.getAttribute("clip-path")&&o===hR&&(o="rgba(0, 0, 0, 0.002)"),__(t,"fill",o),__(t,"fill-opacity",null!=e.fillOpacity?e.fillOpacity*e.opacity:e.opacity)}else __(t,"fill",hR);if(y_(e,i)){var a=i?e.textStroke:e.stroke;__(t,"stroke",a="transparent"===a?hR:a),__(t,"stroke-width",(i?e.textStrokeWidth:e.lineWidth)/(!i&&e.strokeNoScale?n.getLineScale():1)),__(t,"paint-order",i?"stroke":"fill"),__(t,"stroke-opacity",null!=e.strokeOpacity?e.strokeOpacity:e.opacity),e.lineDash?(__(t,"stroke-dasharray",e.lineDash.join(",")),__(t,"stroke-dashoffset",cR(e.lineDashOffset||0))):__(t,"stroke-dasharray",""),e.lineCap&&__(t,"stroke-linecap",e.lineCap),e.lineJoin&&__(t,"stroke-linejoin",e.lineJoin),e.miterLimit&&__(t,"stroke-miterlimit",e.miterLimit)}else __(t,"stroke",hR)}function S_(t){for(var e=[],i=t.data,n=t.len(),o=0;o=gR||!m_(g)&&(d>-pR&&d<0||d>pR)==!!p;var y=g_(s+u*fR(c)),x=g_(l+h*dR(c));m&&(d=p?gR-1e-4:1e-4-gR,v=!0,9===o&&e.push("M",y,x));var _=g_(s+u*fR(c+d)),w=g_(l+h*dR(c+d));e.push("A",g_(u),g_(h),cR(f*mR),+v,+p,_,w);break;case lR.Z:a="Z";break;case lR.R:var _=g_(i[o++]),w=g_(i[o++]),b=g_(i[o++]),S=g_(i[o++]);e.push("M",_,w,"L",_+b,w,"L",_+b,w+S,"L",_,w+S,"L",_,w)}a&&e.push(a);for(var M=0;M=11),domSupported:"undefined"!=typeof document}}(navigator.userAgent),X_={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},j_={"[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},Y_=Object.prototype.toString,q_=Array.prototype,K_=q_.forEach,$_=q_.filter,J_=q_.slice,Q_=q_.map,tw=q_.reduce,ew={},iw=function(){return ew.createCanvas()};ew.createCanvas=function(){return document.createElement("canvas")};var nw,ow="__ec_primitive__";E.prototype={constructor:E,get:function(t){return this.data.hasOwnProperty(t)?this.data[t]:null},set:function(t,e){return this.data[t]=e},each:function(t,e){void 0!==e&&(t=m(t,e));for(var i in this.data)this.data.hasOwnProperty(i)&&t(this.data[i],i)},removeKey:function(t){delete this.data[t]}};var aw=(Object.freeze||Object)({$override:e,clone:i,merge:n,mergeAll:o,extend:a,defaults:r,createCanvas:iw,getContext:s,indexOf:l,inherits:u,mixin:h,isArrayLike:c,each:d,map:f,reduce:p,filter:g,find:function(t,e,i){if(t&&e)for(var n=0,o=t.length;n3&&(n=dw.call(n,1));for(var a=e.length,r=0;r4&&(n=dw.call(n,1,n.length-1));for(var a=n[n.length-1],r=e.length,s=0;s1&&n&&n.length>1){var a=ft(n)/ft(o);!isFinite(a)&&(a=1),e.pinchScale=a;var r=pt(n);return e.pinchX=r[0],e.pinchY=r[1],{type:"pinch",target:t[0].target,event:e}}}}},xw="silent";vt.prototype.dispose=function(){};var _w=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],ww=function(t,e,i,n){fw.call(this),this.storage=t,this.painter=e,this.painterRoot=n,i=i||new vt,this.proxy=null,this._hovered={},this._lastTouchMoment,this._lastX,this._lastY,this._gestureMgr,it.call(this),this.setHandlerProxy(i)};ww.prototype={constructor:ww,setHandlerProxy:function(t){this.proxy&&this.proxy.dispose(),t&&(d(_w,function(e){t.on&&t.on(e,this[e],this)},this),t.handler=this),this.proxy=t},mousemove:function(t){var e=t.zrX,i=t.zrY,n=this._hovered,o=n.target;o&&!o.__zr&&(o=(n=this.findHover(n.x,n.y)).target);var a=this._hovered=this.findHover(e,i),r=a.target,s=this.proxy;s.setCursor&&s.setCursor(r?r.cursor:"default"),o&&r!==o&&this.dispatchToElement(n,"mouseout",t),this.dispatchToElement(a,"mousemove",t),r&&r!==o&&this.dispatchToElement(a,"mouseover",t)},mouseout:function(t){this.dispatchToElement(this._hovered,"mouseout",t);var e,i=t.toElement||t.relatedTarget;do{i=i&&i.parentNode}while(i&&9!==i.nodeType&&!(e=i===this.painterRoot));!e&&this.trigger("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=gt(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;a>=0;a--){var r;if(n[a]!==i&&!n[a].ignore&&(r=yt(n[a],t,e))&&(!o.topTarget&&(o.topTarget=n[a]),r!==xw)){o.target=n[a];break}}return o},processGesture:function(t,e){this._gestureMgr||(this._gestureMgr=new vw);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)}}},d(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(t){ww.prototype[t]=function(e){var i=this.findHover(e.zrX,e.zrY),n=i.target;if("mousedown"===t)this._downEl=n,this._downPoint=[e.zrX,e.zrY],this._upEl=n;else if("mouseup"===t)this._upEl=n;else if("click"===t){if(this._downEl!==this._upEl||!this._downPoint||uw(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(i,t,e)}}),h(ww,fw),h(ww,it);var bw="undefined"==typeof Float32Array?Array:Float32Array,Sw=(Object.freeze||Object)({create:xt,identity:_t,copy:wt,mul:bt,translate:St,rotate:Mt,scale:It,invert:Tt,clone:At}),Mw=_t,Iw=5e-5,Tw=function(t){(t=t||{}).position||(this.position=[0,0]),null==t.rotation&&(this.rotation=0),t.scale||(this.scale=[1,1]),this.origin=this.origin||null},Aw=Tw.prototype;Aw.transform=null,Aw.needLocalTransform=function(){return Dt(this.rotation)||Dt(this.position[0])||Dt(this.position[1])||Dt(this.scale[0]-1)||Dt(this.scale[1]-1)};var Dw=[];Aw.updateTransform=function(){var t=this.parent,e=t&&t.transform,i=this.needLocalTransform(),n=this.transform;if(i||e){n=n||xt(),i?this.getLocalTransform(n):Mw(n),e&&(i?bt(n,t.transform,n):wt(n,t.transform)),this.transform=n;var o=this.globalScaleRatio;if(null!=o&&1!==o){this.getGlobalScale(Dw);var a=Dw[0]<0?-1:1,r=Dw[1]<0?-1:1,s=((Dw[0]-a)*o+a)/Dw[0]||0,l=((Dw[1]-r)*o+r)/Dw[1]||0;n[0]*=s,n[1]*=s,n[2]*=l,n[3]*=l}this.invTransform=this.invTransform||xt(),Tt(this.invTransform,n)}else n&&Mw(n)},Aw.getLocalTransform=function(t){return Tw.getLocalTransform(this,t)},Aw.setTransform=function(t){var e=this.transform,i=t.dpr||1;e?t.setTransform(i*e[0],i*e[1],i*e[2],i*e[3],i*e[4],i*e[5]):t.setTransform(i,0,0,i,0,0)},Aw.restoreTransform=function(t){var e=t.dpr||1;t.setTransform(e,0,0,e,0,0)};var Cw=[],Lw=xt();Aw.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],i=t[2]*t[2]+t[3]*t[3],n=this.position,o=this.scale;Dt(e-1)&&(e=Math.sqrt(e)),Dt(i-1)&&(i=Math.sqrt(i)),t[0]<0&&(e=-e),t[3]<0&&(i=-i),n[0]=t[4],n[1]=t[5],o[0]=e,o[1]=i,this.rotation=Math.atan2(-t[1]/i,t[0]/e)}},Aw.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(bt(Cw,t.invTransform,e),e=Cw);var i=this.origin;i&&(i[0]||i[1])&&(Lw[4]=i[0],Lw[5]=i[1],bt(Cw,e,Lw),Cw[4]-=i[0],Cw[5]-=i[1],e=Cw),this.setLocalTransform(e)}},Aw.getGlobalScale=function(t){var e=this.transform;return t=t||[],e?(t[0]=Math.sqrt(e[0]*e[0]+e[1]*e[1]),t[1]=Math.sqrt(e[2]*e[2]+e[3]*e[3]),e[0]<0&&(t[0]=-t[0]),e[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},Aw.transformCoordToLocal=function(t,e){var i=[t,e],n=this.invTransform;return n&&Q(i,i,n),i},Aw.transformCoordToGlobal=function(t,e){var i=[t,e],n=this.transform;return n&&Q(i,i,n),i},Tw.getLocalTransform=function(t,e){Mw(e=e||[]);var i=t.origin,n=t.scale||[1,1],o=t.rotation||0,a=t.position||[0,0];return i&&(e[4]-=i[0],e[5]-=i[1]),It(e,e,n),o&&Mt(e,e,o),i&&(e[4]+=i[0],e[5]+=i[1]),e[4]+=a[0],e[5]+=a[1],e};var kw={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return.5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return 0===t?0:Math.pow(1024,t-1)},exponentialOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},elasticOut:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},elasticInOut:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),(t*=2)<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-kw.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?.5*kw.bounceIn(2*t):.5*kw.bounceOut(2*t-1)+.5}};Ct.prototype={constructor:Ct,step:function(t,e){if(this._initialized||(this._startTime=t+this._delay,this._initialized=!0),this._paused)this._pausedTime+=e;else{var i=(t-this._startTime-this._pausedTime)/this._life;if(!(i<0)){i=Math.min(i,1);var n=this.easing,o="string"==typeof n?kw[n]:n,a="function"==typeof o?o(i):i;return this.fire("frame",a),1===i?this.loop?(this.restart(t),"restart"):(this._needsRemove=!0,"destroy"):null}}},restart:function(t){var e=(t-this._startTime-this._pausedTime)%this._life;this._startTime=t-e+this.gap,this._pausedTime=0,this._needsRemove=!1},fire:function(t,e){this[t="on"+t]&&this[t](this._target,e)},pause:function(){this._paused=!0},resume:function(){this._paused=!1}};var Pw=function(){this.head=null,this.tail=null,this._len=0},Nw=Pw.prototype;Nw.insert=function(t){var e=new Ow(t);return this.insertEntry(e),e},Nw.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},Nw.remove=function(t){var e=t.prev,i=t.next;e?e.next=i:this.head=i,i?i.prev=e:this.tail=e,t.next=t.prev=null,this._len--},Nw.len=function(){return this._len},Nw.clear=function(){this.head=this.tail=null,this._len=0};var Ow=function(t){this.value=t,this.next,this.prev},Ew=function(t){this._list=new Pw,this._map={},this._maxSize=t||10,this._lastRemovedEntry=null},Rw=Ew.prototype;Rw.put=function(t,e){var i=this._list,n=this._map,o=null;if(null==n[t]){var a=i.len(),r=this._lastRemovedEntry;if(a>=this._maxSize&&a>0){var s=i.head;i.remove(s),delete n[s.key],o=s.value,this._lastRemovedEntry=s}r?r.value=e:r=new Ow(e),r.key=t,i.insertEntry(r),n[t]=r}return o},Rw.get=function(t){var e=this._map[t],i=this._list;if(null!=e)return e!==i.tail&&(i.remove(e),i.insertEntry(e)),e.value},Rw.clear=function(){this._list.clear(),this._map={}};var zw={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]},Bw=new Ew(20),Vw=null,Gw=Ut,Fw=Xt,Ww=(Object.freeze||Object)({parse:Gt,lift:Ht,toHex:Zt,fastLerp:Ut,fastMapToColor:Gw,lerp:Xt,mapToColor:Fw,modifyHSL:jt,modifyAlpha:Yt,stringify:qt}),Hw=Array.prototype.slice,Zw=function(t,e,i,n){this._tracks={},this._target=t,this._loop=e||!1,this._getter=i||Kt,this._setter=n||$t,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};Zw.prototype={when:function(t,e){var i=this._tracks;for(var n in e)if(e.hasOwnProperty(n)){if(!i[n]){i[n]=[];var o=this._getter(this._target,n);if(null==o)continue;0!==t&&i[n].push({time:0,value:ae(o)})}i[n].push({time:t,value:e[n]})}return this},during:function(t){return this._onframeList.push(t),this},pause:function(){for(var t=0;t=i.x&&t<=i.x+i.width&&e>=i.y&&e<=i.y+i.height},clone:function(){return new de(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}}},de.create=function(t){return new de(t.x,t.y,t.width,t.height)};var tb=function(t){t=t||{},Kw.call(this,t);for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);this._children=[],this.__storage=null,this.__dirty=!0};tb.prototype={constructor:tb,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=0&&(i.splice(n,0,t),this._doAdd(t))}return this},_doAdd:function(t){t.parent&&t.parent.remove(t),t.parent=this;var e=this.__storage,i=this.__zr;e&&e!==t.__storage&&(e.addToStorage(t),t instanceof tb&&t.addChildrenToStorage(e)),i&&i.refresh()},remove:function(t){var e=this.__zr,i=this.__storage,n=this._children,o=l(n,t);return o<0?this:(n.splice(o,1),t.parent=null,i&&(i.delFromStorage(t),t instanceof tb&&t.delChildrenFromStorage(i)),e&&e.refresh(),this)},removeAll:function(){var t,e,i=this._children,n=this.__storage;for(e=0;e=0&&(this.delFromStorage(t),this._roots.splice(o,1),t instanceof tb&&t.delChildrenFromStorage(this))}},addToStorage:function(t){return t&&(t.__storage=this,t.dirty(!1)),this},delFromStorage:function(t){return t&&(t.__storage=null),this},dispose:function(){this._renderList=this._roots=null},displayableSortFunc:we};var ob={shadowBlur:1,shadowOffsetX:1,shadowOffsetY:1,textShadowBlur:1,textShadowOffsetX:1,textShadowOffsetY:1,textBoxShadowBlur:1,textBoxShadowOffsetX:1,textBoxShadowOffsetY:1},ab=function(t,e,i){return ob.hasOwnProperty(e)?i*=t.dpr:i},rb={NONE:0,STYLE_BIND:1,PLAIN_TEXT:2},sb=9,lb=[["shadowBlur",0],["shadowOffsetX",0],["shadowOffsetY",0],["shadowColor","#000"],["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]],ub=function(t){this.extendFrom(t,!1)};ub.prototype={constructor:ub,fill:"#000",stroke:null,opacity:1,fillOpacity:null,strokeOpacity:null,lineDash:null,lineDashOffset:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,lineWidth:1,strokeNoScale:!1,text:null,font:null,textFont:null,fontStyle:null,fontWeight:null,fontSize:null,fontFamily:null,textTag:null,textFill:"#000",textStroke:null,textWidth:null,textHeight:null,textStrokeWidth:0,textLineHeight:null,textPosition:"inside",textRect:null,textOffset:null,textAlign:null,textVerticalAlign:null,textDistance:5,textShadowColor:"transparent",textShadowBlur:0,textShadowOffsetX:0,textShadowOffsetY:0,textBoxShadowColor:"transparent",textBoxShadowBlur:0,textBoxShadowOffsetX:0,textBoxShadowOffsetY:0,transformText:!1,textRotation:0,textOrigin:null,textBackgroundColor:null,textBorderColor:null,textBorderWidth:0,textBorderRadius:0,textPadding:null,rich:null,truncate:null,blend:null,bind:function(t,e,i){var n=this,o=i&&i.style,a=!o||t.__attrCachedBy!==rb.STYLE_BIND;t.__attrCachedBy=rb.STYLE_BIND;for(var r=0;r0},extendFrom:function(t,e){if(t)for(var i in t)!t.hasOwnProperty(i)||!0!==e&&(!1===e?this.hasOwnProperty(i):null==t[i])||(this[i]=t[i])},set:function(t,e){"string"==typeof t?this[t]=e:this.extendFrom(t,!0)},clone:function(){var t=new this.constructor;return t.extendFrom(this,!0),t},getGradient:function(t,e,i){for(var n=("radial"===e.type?Se:be)(t,e,i),o=e.colorStops,a=0;a=0&&i.splice(n,1),t.__hoverMir=null},clearHover:function(t){for(var e=this._hoverElements,i=0;i15)break}s.__drawIndex=m,s.__drawIndex0&&t>n[0]){for(r=0;rt);r++);a=i[n[r]]}if(n.splice(r+1,0,t),i[t]=e,!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 Yw("Layer of zlevel "+t+" is not valid")},eachLayer:function(t,e){var i,n,o=this._zlevelList;for(n=0;n0?.01:0),this._needsManuallyCompositing),a.__builtin__||Yw("ZLevel "+s+" has been used by unkown layer "+a.id),a!==i&&(a.__used=!0,a.__startIndex!==o&&(a.__dirty=!0),a.__startIndex=o,a.incremental?a.__drawIndex=-1:a.__drawIndex=o,e(o),i=a),r.__dirty&&(a.__dirty=!0,a.incremental&&a.__drawIndex<0&&(a.__drawIndex=o))}e(o),this.eachBuiltinLayer(function(t,e){!t.__used&&t.getElementCount()>0&&(t.__dirty=!0,t.__startIndex=t.__endIndex=t.__drawIndex=0),t.__dirty&&t.__drawIndex<0&&(t.__drawIndex=t.__startIndex)})},clear:function(){return this.eachBuiltinLayer(this._clearLayer),this},_clearLayer:function(t){t.clear()},setBackgroundColor:function(t){this._backgroundColor=t},configLayer:function(t,e){if(e){var i=this._layerConfig;i[t]?n(i[t],e,!0):i[t]=e;for(var o=0;o=0&&this._clips.splice(e,1)},removeAnimator:function(t){for(var e=t.getClips(),i=0;i=0||n&&l(n,r)<0)){var s=e.getShallow(r);null!=s&&(o[t[a][0]]=s)}}return o}},tS=Qb([["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),eS={getLineStyle:function(t){var e=tS(this,t),i=this.getLineDash(e.lineWidth);return i&&(e.lineDash=i),e},getLineDash:function(t){null==t&&(t=1);var e=this.get("type"),i=Math.max(t,2),n=4*t;return"solid"===e||null==e?null:"dashed"===e?[n,n]:[i,i]}},iS=Qb([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),nS={getAreaStyle:function(t,e){return iS(this,t,e)}},oS=Math.pow,aS=Math.sqrt,rS=1e-8,sS=1e-4,lS=aS(3),uS=1/3,hS=V(),cS=V(),dS=V(),fS=Math.min,pS=Math.max,gS=Math.sin,mS=Math.cos,vS=2*Math.PI,yS=V(),xS=V(),_S=V(),wS=[],bS=[],SS={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},MS=[],IS=[],TS=[],AS=[],DS=Math.min,CS=Math.max,LS=Math.cos,kS=Math.sin,PS=Math.sqrt,NS=Math.abs,OS="undefined"!=typeof Float32Array,ES=function(t){this._saveData=!t,this._saveData&&(this.data=[]),this._ctx=null};ES.prototype={constructor:ES,_xi:0,_yi:0,_x0:0,_y0:0,_ux:0,_uy:0,_len:0,_lineDash:null,_dashOffset:0,_dashIdx:0,_dashSum:0,setScale:function(t,e){this._ux=NS(1/Xw/t)||0,this._uy=NS(1/Xw/e)||0},getContext:function(){return this._ctx},beginPath:function(t){return this._ctx=t,t&&t.beginPath(),t&&(this.dpr=t.dpr),this._saveData&&(this._len=0),this._lineDash&&(this._lineDash=null,this._dashOffset=0),this},moveTo:function(t,e){return this.addData(SS.M,t,e),this._ctx&&this._ctx.moveTo(t,e),this._x0=t,this._y0=e,this._xi=t,this._yi=e,this},lineTo:function(t,e){var i=NS(t-this._xi)>this._ux||NS(e-this._yi)>this._uy||this._len<5;return this.addData(SS.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(SS.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(SS.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(SS.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=LS(o)*i+t,this._yi=kS(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(SS.R,t,e,i,n),this},closePath:function(){this.addData(SS.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,this._dashIdx=0;for(var e=0,i=0;ie.length&&(this._expandData(),e=this.data);for(var i=0;i0&&f<=t||h<0&&f>=t||0===h&&(c>0&&p<=e||c<0&&p>=e);)f+=h*(i=r[n=this._dashIdx]),p+=c*i,this._dashIdx=(n+1)%g,h>0&&fl||c>0&&pu||s[n%2?"moveTo":"lineTo"](h>=0?DS(f,t):CS(f,t),c>=0?DS(p,e):CS(p,e));h=f-t,c=p-e,this._dashOffset=-PS(h*h+c*c)},_dashedBezierTo:function(t,e,i,n,o,a){var r,s,l,u,h,c=this._dashSum,d=this._dashOffset,f=this._lineDash,p=this._ctx,g=this._xi,m=this._yi,v=tn,y=0,x=this._dashIdx,_=f.length,w=0;for(d<0&&(d=c+d),d%=c,r=0;r<1;r+=.1)s=v(g,t,i,o,r+.1)-v(g,t,i,o,r),l=v(m,e,n,a,r+.1)-v(m,e,n,a,r),y+=PS(s*s+l*l);for(;x<_&&!((w+=f[x])>d);x++);for(r=(w-d)/y;r<=1;)u=v(g,t,i,o,r),h=v(m,e,n,a,r),x%2?p.moveTo(u,h):p.lineTo(u,h),r+=f[x]/y,x=(x+1)%_;x%2!=0&&p.lineTo(o,a),s=o-u,l=a-h,this._dashOffset=-PS(s*s+l*l)},_dashedQuadraticTo:function(t,e,i,n){var o=i,a=n;i=(i+2*t)/3,n=(n+2*e)/3,t=(this._xi+2*t)/3,e=(this._yi+2*e)/3,this._dashedBezierTo(t,e,i,n,o,a)},toStatic:function(){var t=this.data;t instanceof Array&&(t.length=this._len,OS&&(this.data=new Float32Array(t)))},getBoundingRect:function(){MS[0]=MS[1]=TS[0]=TS[1]=Number.MAX_VALUE,IS[0]=IS[1]=AS[0]=AS[1]=-Number.MAX_VALUE;for(var t=this.data,e=0,i=0,n=0,o=0,a=0;al||NS(r-o)>u||c===h-1)&&(t.lineTo(a,r),n=a,o=r);break;case SS.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 SS.Q:t.quadraticCurveTo(s[c++],s[c++],s[c++],s[c++]),n=s[c-2],o=s[c-1];break;case SS.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=g>m?g:m,b=g>m?1:g/m,S=g>m?m/g:1,M=v+y;Math.abs(g-m)>.001?(t.translate(f,p),t.rotate(x),t.scale(b,S),t.arc(0,0,w,v,M,1-_),t.scale(1/b,1/S),t.rotate(-x),t.translate(-f,-p)):t.arc(f,p,w,v,M,1-_),1===c&&(e=LS(v)*g+f,i=kS(v)*m+p),n=LS(M)*g+f,o=kS(M)*m+p;break;case SS.R:e=n=s[c],i=o=s[c+1],t.rect(s[c++],s[c++],s[c++],s[c++]);break;case SS.Z:t.closePath(),n=e,o=i}}}},ES.CMD=SS;var RS=2*Math.PI,zS=2*Math.PI,BS=ES.CMD,VS=2*Math.PI,GS=1e-4,FS=[-1,-1,-1],WS=[-1,-1],HS=fb.prototype.getCanvasPattern,ZS=Math.abs,US=new ES(!0);Pn.prototype={constructor:Pn,type:"path",__dirtyPath:!0,strokeContainThreshold:5,subPixelOptimize:!1,brush:function(t,e){var i=this.style,n=this.path||US,o=i.hasStroke(),a=i.hasFill(),r=i.fill,s=i.stroke,l=a&&!!r.colorStops,u=o&&!!s.colorStops,h=a&&!!r.image,c=o&&!!s.image;if(i.bind(t,this,e),this.setTransform(t),this.__dirty){var d;l&&(d=d||this.getBoundingRect(),this._fillGradient=i.getGradient(t,r,d)),u&&(d=d||this.getBoundingRect(),this._strokeGradient=i.getGradient(t,s,d))}l?t.fillStyle=this._fillGradient:h&&(t.fillStyle=HS.call(r,t)),u?t.strokeStyle=this._strokeGradient:c&&(t.strokeStyle=HS.call(s,t));var f=i.lineDash,p=i.lineDashOffset,g=!!t.setLineDash,m=this.getGlobalScale();if(n.setScale(m[0],m[1]),this.__dirtyPath||f&&!g&&o?(n.beginPath(t),f&&!g&&(n.setLineDash(f),n.setLineDashOffset(p)),this.buildPath(n,this.shape,!1),this.path&&(this.__dirtyPath=!1)):(t.beginPath(),this.path.rebuildPath(t)),a)if(null!=i.fillOpacity){v=t.globalAlpha;t.globalAlpha=i.fillOpacity*i.opacity,n.fill(t),t.globalAlpha=v}else n.fill(t);if(f&&g&&(t.setLineDash(f),t.lineDashOffset=p),o)if(null!=i.strokeOpacity){var v=t.globalAlpha;t.globalAlpha=i.strokeOpacity*i.opacity,n.stroke(t),t.globalAlpha=v}else n.stroke(t);f&&g&&t.setLineDash([]),null!=i.text&&(this.restoreTransform(t),this.drawRectText(t,this.getBoundingRect()))},buildPath:function(t,e,i){},createPathProxy:function(){this.path=new ES},getBoundingRect:function(){var t=this._rect,e=this.style,i=!t;if(i){var n=this.path;n||(n=this.path=new ES),this.__dirtyPath&&(n.beginPath(),this.buildPath(n,this.shape,!1)),t=n.getBoundingRect()}if(this._rect=t,e.hasStroke()){var o=this._rectWithStroke||(this._rectWithStroke=t.clone());if(this.__dirty||i){o.copy(t);var a=e.lineWidth,r=e.strokeNoScale?this.getLineScale():1;e.hasFill()||(a=Math.max(a,this.strokeContainThreshold||4)),r>1e-10&&(o.width+=a/r,o.height+=a/r,o.x-=a/r/2,o.y-=a/r/2)}return o}return t},contain:function(t,e){var i=this.transformCoordToLocal(t,e),n=this.getBoundingRect(),o=this.style;if(t=i[0],e=i[1],n.contain(t,e)){var a=this.path.data;if(o.hasStroke()){var r=o.lineWidth,s=o.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(o.hasFill()||(r=Math.max(r,this.strokeContainThreshold)),kn(a,r/s,t,e)))return!0}if(o.hasFill())return Ln(a,t,e)}return!1},dirty:function(t){null==t&&(t=!0),t&&(this.__dirtyPath=t,this._rect=null),this.__dirty=this.__dirtyText=!0,this.__zr&&this.__zr.refresh(),this.__clipTarget&&this.__clipTarget.dirty()},animateShape:function(t){return this.animate("shape",t)},attrKV:function(t,e){"shape"===t?(this.setShape(e),this.__dirtyPath=!0,this._rect=null):di.prototype.attrKV.call(this,t,e)},setShape:function(t,e){var i=this.shape;if(i){if(w(t))for(var n in t)t.hasOwnProperty(n)&&(i[n]=t[n]);else i[t]=e;this.dirty(!0)}return this},getLineScale:function(){var t=this.transform;return t&&ZS(t[0]-1)>1e-10&&ZS(t[3]-1)>1e-10?Math.sqrt(ZS(t[0]*t[3]-t[2]*t[1])):1}},Pn.extend=function(t){var e=function(e){Pn.call(this,e),t.style&&this.style.extendFrom(t.style,!1);var i=t.shape;if(i){this.shape=this.shape||{};var n=this.shape;for(var o in i)!n.hasOwnProperty(o)&&i.hasOwnProperty(o)&&(n[o]=i[o])}t.init&&t.init.call(this,e)};u(e,Pn);for(var i in t)"style"!==i&&"shape"!==i&&(e.prototype[i]=t[i]);return e},u(Pn,di);var XS=ES.CMD,jS=[[],[],[]],YS=Math.sqrt,qS=Math.atan2,KS=function(t,e){var i,n,o,a,r,s,l=t.data,u=XS.M,h=XS.C,c=XS.L,d=XS.R,f=XS.A,p=XS.Q;for(o=0,a=0;o=11?function(){var e,i=this.__clipPaths,n=this.style;if(i)for(var o=0;oi-2?i-1:c+1],u=t[c>i-3?i-1:c+2]);var p=d*d,g=d*p;n.push([Bn(s[0],f[0],l[0],u[0],d,p,g),Bn(s[1],f[1],l[1],u[1],d,p,g)])}return n},fM=function(t,e,i,n){var o,a,r,s,l=[],u=[],h=[],c=[];if(n){r=[1/0,1/0],s=[-1/0,-1/0];for(var d=0,f=t.length;d=i&&a>=o)return{x:i,y:o,width:n-i,height:a-o}},createIcon:Po,Group:tb,Image:fi,Text:rM,Circle:sM,Sector:hM,Ring:cM,Polygon:pM,Polyline:gM,Rect:yM,Line:_M,BezierCurve:bM,Arc:SM,IncrementalDisplayable:Zn,CompoundPath:MM,LinearGradient:TM,RadialGradient:AM,BoundingRect:de}),BM=["textStyle","color"],VM={getTextColor:function(t){var e=this.ecModel;return this.getShallow("color")||(!t&&e?e.get(BM):null)},getFont:function(){return So({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},getTextRect:function(t){return ke(t,this.getFont(),this.getShallow("align"),this.getShallow("verticalAlign")||this.getShallow("baseline"),this.getShallow("padding"),this.getShallow("lineHeight"),this.getShallow("rich"),this.getShallow("truncateText"))}},GM=Qb([["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["textPosition"],["textAlign"]]),FM={getItemStyle:function(t,e){var i=GM(this,t,e),n=this.getBorderLineDash();return n&&(i.lineDash=n),i},getBorderLineDash:function(){var t=this.get("borderType");return"solid"===t||null==t?null:"dashed"===t?[5,5]:[1,1]}},WM=h,HM=Bi();No.prototype={constructor:No,init:null,mergeOption:function(t){n(this.option,t,!0)},get:function(t,e){return null==t?this.option:Oo(this.option,this.parsePath(t),!e&&Eo(this,t))},getShallow:function(t,e){var i=this.option,n=null==i?i:i[t],o=!e&&Eo(this,t);return null==n&&o&&(n=o.getShallow(t)),n},getModel:function(t,e){var i,n=null==t?this.option:Oo(this.option,t=this.parsePath(t));return e=e||(i=Eo(this,t))&&i.getModel(t),new No(n,e,this.ecModel)},isEmpty:function(){return null==this.option},restoreData:function(){},clone:function(){return new(0,this.constructor)(i(this.option))},setReadOnly:function(t){},parsePath:function(t){return"string"==typeof t&&(t=t.split(".")),t},customizeGetParent:function(t){HM(this).getParent=t},isAnimationEnabled:function(){if(!U_.node){if(null!=this.option.animation)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}}},ji(No),Yi(No),WM(No,eS),WM(No,nS),WM(No,VM),WM(No,FM);var ZM=0,UM=1e-4,XM=9007199254740991,jM=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d\d)(?::(\d\d)(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/,YM=(Object.freeze||Object)({linearMap:Bo,parsePercent:Vo,round:Go,asc:Fo,getPrecision:Wo,getPrecisionSafe:Ho,getPixelPrecision:Zo,getPercentWithPrecision:Uo,MAX_SAFE_INTEGER:XM,remRadian:Xo,isRadianAroundZero:jo,parseDate:Yo,quantity:qo,nice:$o,quantile:function(t,e){var i=(t.length-1)*e+1,n=Math.floor(i),o=+t[n-1],a=i-n;return a?o+a*(t[n]-o):o},reformIntervals:Jo,isNumeric:Qo}),qM=L,KM=/([&<>"'])/g,$M={"&":"&","<":"<",">":">",'"':""","'":"'"},JM=["a","b","c","d","e","f","g"],QM=function(t,e){return"{"+t+(null==e?"":e)+"}"},tI=ze,eI=(Object.freeze||Object)({addCommas:ta,toCamelCase:ea,normalizeCssArray:qM,encodeHTML:ia,formatTpl:na,formatTplSimple:oa,getTooltipMarker:aa,formatTime:sa,capitalFirst:la,truncateText:tI,getTextBoundingRect:function(t){return ke(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 ke(t,e,i,n,o,s,a,r)}}),iI=d,nI=["left","right","top","bottom","width","height"],oI=[["width","left","right"],["height","top","bottom"]],aI=ua,rI=(v(ua,"vertical"),v(ua,"horizontal"),{getBoxLayoutParams:function(){return{left:this.get("left"),top:this.get("top"),right:this.get("right"),bottom:this.get("bottom"),width:this.get("width"),height:this.get("height")}}}),sI=Bi(),lI=No.extend({type:"component",id:"",name:"",mainType:"",subType:"",componentIndex:0,defaultOption:null,ecModel:null,dependentModels:[],uid:null,layoutMode:null,$constructor:function(t,e,i,n){No.call(this,t,e,i,n),this.uid=Ro("ec_cpt_model")},init:function(t,e,i,n){this.mergeDefaultAndTheme(t,i)},mergeDefaultAndTheme:function(t,e){var i=this.layoutMode,o=i?ga(t):{};n(t,e.getTheme().get(this.mainType)),n(t,this.getDefaultOption()),i&&pa(t,o,i)},mergeOption:function(t,e){n(this.option,t,!0);var i=this.layoutMode;i&&pa(this.option,t,i)},optionUpdated:function(t,e){},getDefaultOption:function(){var t=sI(this);if(!t.defaultOption){for(var e=[],i=this.constructor;i;){var o=i.prototype.defaultOption;o&&e.push(o),i=i.superClass}for(var a={},r=e.length-1;r>=0;r--)a=n(a,e[r],!0);t.defaultOption=a}return t.defaultOption},getReferringComponents:function(t){return this.ecModel.queryComponents({mainType:t,index:this.get(t+"Index",!0),id:this.get(t+"Id",!0)})}});$i(lI,{registerWhenExtend:!0}),function(t){var e={};t.registerSubTypeDefaulter=function(t,i){t=Ui(t),e[t.main]=i},t.determineSubType=function(i,n){var o=n.type;if(!o){var a=Ui(i).main;t.hasSubTypes(i)&&e[a]&&(o=e[a](n))}return o}}(lI),function(t,e){function i(t){var i={},a=[];return d(t,function(r){var s=n(i,r),u=o(s.originalDeps=e(r),t);s.entryCount=u.length,0===s.entryCount&&a.push(r),d(u,function(t){l(s.predecessor,t)<0&&s.predecessor.push(t);var e=n(i,t);l(e.successor,t)<0&&e.successor.push(r)})}),{graph:i,noEntryList:a}}function n(t,e){return t[e]||(t[e]={predecessor:[],successor:[]}),t[e]}function o(t,e){var i=[];return d(t,function(t){l(e,t)>=0&&i.push(t)}),i}t.topologicalTravel=function(t,e,n,o){function a(t){s[t].entryCount--,0===s[t].entryCount&&l.push(t)}if(t.length){var r=i(e),s=r.graph,l=r.noEntryList,u={};for(d(t,function(t){u[t]=!0});l.length;){var h=l.pop(),c=s[h],f=!!u[h];f&&(n.call(o,h,c.originalDeps.slice()),delete u[h]),d(c.successor,f?function(t){u[t]=!0,a(t)}:a)}d(u,function(){throw new Error("Circle dependency may exists")})}}}(lI,function(t){var e=[];return d(lI.getClassesByMainType(t),function(t){e=e.concat(t.prototype.dependencies||[])}),e=f(e,function(t){return Ui(t).main}),"dataset"!==t&&l(e,"dataset")<=0&&e.unshift("dataset"),e}),h(lI,rI);var uI="";"undefined"!=typeof navigator&&(uI=navigator.platform||"");var hI={color:["#c23531","#2f4554","#61a0a8","#d48265","#91c7ae","#749f83","#ca8622","#bda29a","#6e7074","#546570","#c4ccd3"],gradientColor:["#f6efa6","#d88273","#bf444c"],textStyle:{fontFamily:uI.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,animation:"auto",animationDuration:1e3,animationDurationUpdate:300,animationEasing:"exponentialOut",animationEasingUpdate:"cubicOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1},cI=Bi(),dI={clearColorPalette:function(){cI(this).colorIdx=0,cI(this).colorNameMap={}},getColorFromPalette:function(t,e,i){var n=cI(e=e||this),o=n.colorIdx||0,a=n.colorNameMap=n.colorNameMap||{};if(a.hasOwnProperty(t))return a[t];var r=Di(this.get("color",!0)),s=this.get("colorLayer",!0),l=null!=i&&s?va(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}}},fI={cartesian2d:function(t,e,i,n){var o=t.getReferringComponents("xAxis")[0],a=t.getReferringComponents("yAxis")[0];e.coordSysDims=["x","y"],i.set("x",o),i.set("y",a),xa(o)&&(n.set("x",o),e.firstCategoryDimIndex=0),xa(a)&&(n.set("y",a),e.firstCategoryDimIndex=1)},singleAxis:function(t,e,i,n){var o=t.getReferringComponents("singleAxis")[0];e.coordSysDims=["single"],i.set("single",o),xa(o)&&(n.set("single",o),e.firstCategoryDimIndex=0)},polar:function(t,e,i,n){var o=t.getReferringComponents("polar")[0],a=o.findAxisModel("radiusAxis"),r=o.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],i.set("radius",a),i.set("angle",r),xa(a)&&(n.set("radius",a),e.firstCategoryDimIndex=0),xa(r)&&(n.set("angle",r),e.firstCategoryDimIndex=1)},geo:function(t,e,i,n){e.coordSysDims=["lng","lat"]},parallel:function(t,e,i,n){var o=t.ecModel,a=o.getComponent("parallel",t.get("parallelIndex")),r=e.coordSysDims=a.dimensions.slice();d(a.parallelAxisIndex,function(t,a){var s=o.getComponent("parallelAxis",t),l=r[a];i.set(l,s),xa(s)&&null==e.firstCategoryDimIndex&&(n.set(l,s),e.firstCategoryDimIndex=a)})}},pI="original",gI="arrayRows",mI="objectRows",vI="keyedColumns",yI="unknown",xI="typedArray",_I="column",wI="row";_a.seriesDataToSource=function(t){return new _a({data:t,sourceFormat:S(t)?xI:pI,fromDataset:!1})},Yi(_a);var bI=Bi(),SI="\0_ec_inner",MI=No.extend({init:function(t,e,i,n){i=i||{},this.option=null,this._theme=new No(i),this._optionManager=n},setOption:function(t,e){k(!(SI in t),"please use chart.getOption()"),this._optionManager.setOption(t,e),this.resetOption(null)},resetOption:function(t){var e=!1,i=this._optionManager;if(!t||"recreate"===t){var n=i.mountOption("recreate"===t);this.option&&"recreate"!==t?(this.restoreData(),this.mergeOption(n)):Ea.call(this,n),e=!0}if("timeline"!==t&&"media"!==t||this.restoreData(),!t||"recreate"===t||"timeline"===t){var o=i.getTimelineOption(this);o&&(this.mergeOption(o),e=!0)}if(!t||"recreate"===t||"media"===t){var a=i.getMediaOption(this,this._api);a.length&&d(a,function(t){this.mergeOption(t,e=!0)},this)}return e},mergeOption:function(t){var e=this.option,o=this._componentsMap,r=[];Sa(this),d(t,function(t,o){null!=t&&(lI.hasClass(o)?o&&r.push(o):e[o]=null==e[o]?i(t):n(e[o],t,!0))}),lI.topologicalTravel(r,lI.getAllClassMainTypes(),function(i,n){var r=Di(t[i]),s=Pi(o.get(i),r);Ni(s),d(s,function(t,e){var n=t.option;w(n)&&(t.keyInfo.mainType=i,t.keyInfo.subType=za(i,n,t.exist))});var l=Ra(o,n);e[i]=[],o.set(i,[]),d(s,function(t,n){var r=t.exist,s=t.option;if(k(w(s)||r,"Empty component definition"),s){var u=lI.getClass(i,t.keyInfo.subType,!0);if(r&&r instanceof u)r.name=t.keyInfo.name,r.mergeOption(s,this),r.optionUpdated(s,!1);else{var h=a({dependentModels:l,componentIndex:n},t.keyInfo);a(r=new u(s,this,this,h),h),r.init(s,this,this,h),r.optionUpdated(null,!0)}}else r.mergeOption({},this),r.optionUpdated({},!1);o.get(i)[n]=r,e[i][n]=r.option},this),"series"===i&&Ba(this,o.get("series"))},this),this._seriesIndicesMap=R(this._seriesIndices=this._seriesIndices||[])},getOption:function(){var t=i(this.option);return d(t,function(e,i){if(lI.hasClass(i)){for(var n=(e=Di(e)).length-1;n>=0;n--)Ei(e[n])&&e.splice(n,1);t[i]=e}}),delete t[SI],t},getTheme:function(){return this._theme},getComponent:function(t,e){var i=this._componentsMap.get(t);if(i)return i[e||0]},queryComponents:function(t){var e=t.mainType;if(!e)return[];var i=t.index,n=t.id,o=t.name,a=this._componentsMap.get(e);if(!a||!a.length)return[];var r;if(null!=i)y(i)||(i=[i]),r=g(f(i,function(t){return a[t]}),function(t){return!!t});else if(null!=n){var s=y(n);r=g(a,function(t){return s&&l(n,t.id)>=0||!s&&t.id===n})}else if(null!=o){var u=y(o);r=g(a,function(t){return u&&l(o,t.name)>=0||!u&&t.name===o})}else r=a.slice();return Va(r,t)},findComponents:function(t){var e=t.query,i=t.mainType,n=function(t){var e=i+"Index",n=i+"Id",o=i+"Name";return!t||null==t[e]&&null==t[n]&&null==t[o]?null:{mainType:i,index:t[e],id:t[n],name:t[o]}}(e);return function(e){return t.filter?g(e,t.filter):e}(Va(n?this.queryComponents(n):this._componentsMap.get(i),t))},eachComponent:function(t,e,i){var n=this._componentsMap;"function"==typeof t?(i=e,e=t,n.each(function(t,n){d(t,function(t,o){e.call(i,n,t,o)})})):_(t)?d(n.get(t),e,i):w(t)&&d(this.findComponents(t),e,i)},getSeriesByName:function(t){return g(this._componentsMap.get("series"),function(e){return e.name===t})},getSeriesByIndex:function(t){return this._componentsMap.get("series")[t]},getSeriesByType:function(t){return g(this._componentsMap.get("series"),function(e){return e.subType===t})},getSeries:function(){return this._componentsMap.get("series").slice()},getSeriesCount:function(){return this._componentsMap.get("series").length},eachSeries:function(t,e){d(this._seriesIndices,function(i){var n=this._componentsMap.get("series")[i];t.call(e,n,i)},this)},eachRawSeries:function(t,e){d(this._componentsMap.get("series"),t,e)},eachSeriesByType:function(t,e,i){d(this._seriesIndices,function(n){var o=this._componentsMap.get("series")[n];o.subType===t&&e.call(i,o,n)},this)},eachRawSeriesByType:function(t,e,i){return d(this.getSeriesByType(t),e,i)},isSeriesFiltered:function(t){return null==this._seriesIndicesMap.get(t.componentIndex)},getCurrentSeriesIndices:function(){return(this._seriesIndices||[]).slice()},filterSeries:function(t,e){Ba(this,g(this._componentsMap.get("series"),t,e))},restoreData:function(t){var e=this._componentsMap;Ba(this,e.get("series"));var i=[];e.each(function(t,e){i.push(e)}),lI.topologicalTravel(i,lI.getAllClassMainTypes(),function(i,n){d(e.get(i),function(e){("series"!==i||!Na(e,t))&&e.restoreData()})})}});h(MI,dI);var II=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isDisposed","on","off","getDataURL","getConnectedDataURL","getModel","getOption","getViewOfComponentModel","getViewOfSeriesModel"],TI={};Fa.prototype={constructor:Fa,create:function(t,e){var i=[];d(TI,function(n,o){var a=n.create(t,e);i=i.concat(a||[])}),this._coordinateSystems=i},update:function(t,e){d(this._coordinateSystems,function(i){i.update&&i.update(t,e)})},getCoordinateSystems:function(){return this._coordinateSystems.slice()}},Fa.register=function(t,e){TI[t]=e},Fa.get=function(t){return TI[t]};var AI=d,DI=i,CI=f,LI=n,kI=/^(min|max)?(.+)$/;Wa.prototype={constructor:Wa,setOption:function(t,e){t&&d(Di(t.series),function(t){t&&t.data&&S(t.data)&&N(t.data)}),t=DI(t,!0);var i=this._optionBackup,n=Ha.call(this,t,e,!i);this._newBaseOption=n.baseOption,i?(ja(i.baseOption,n.baseOption),n.timelineOptions.length&&(i.timelineOptions=n.timelineOptions),n.mediaList.length&&(i.mediaList=n.mediaList),n.mediaDefault&&(i.mediaDefault=n.mediaDefault)):this._optionBackup=n},mountOption:function(t){var e=this._optionBackup;return this._timelineOptions=CI(e.timelineOptions,DI),this._mediaList=CI(e.mediaList,DI),this._mediaDefault=DI(e.mediaDefault),this._currentMediaIndices=[],DI(t?e.baseOption:this._newBaseOption)},getTimelineOption:function(t){var e,i=this._timelineOptions;if(i.length){var n=t.getComponent("timeline");n&&(e=DI(i[n.getCurrentIndex()],!0))}return e},getMediaOption:function(t){var e=this._api.getWidth(),i=this._api.getHeight(),n=this._mediaList,o=this._mediaDefault,a=[],r=[];if(!n.length&&!o)return r;for(var s=0,l=n.length;s=1)&&(t=1),t}var i=this._upstream,n=t&&t.skip;if(this._dirty&&i){var o=this.context;o.data=o.outputData=i.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var a;this._plan&&!n&&(a=this._plan(this.context));var r=e(this._modBy),s=this._modDataCount||0,l=e(t&&t.modBy),u=t&&t.modDataCount||0;r===l&&s===u||(a="reset");var h;(this._dirty||"reset"===a)&&(this._dirty=!1,h=yr(this,n)),this._modBy=l,this._modDataCount=u;var c=t&&t.step;if(this._dueEnd=i?i._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var d=this._dueIndex,f=Math.min(null!=c?this._dueIndex+c:1/0,this._dueEnd);if(!n&&(h||d=i?null:t1&&a>0?e:t}};return s}();UI.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},UI.unfinished=function(){return this._progress&&this._dueIndex":"\n",s="richText"===n,l={},u=0,h=this.getData(),c=h.mapDimension("defaultedTooltip",!0),f=c.length,g=this.getRawValue(t),m=y(g),v=h.getItemVisual(t,"color");w(v)&&v.colorStops&&(v=(v.colorStops[0]||{}).color),v=v||"transparent";var x=(f>1||m&&!f?function(i){function o(t,i){var o=h.getDimensionInfo(i);if(o&&!1!==o.otherDims.tooltip){var c=o.type,d="sub"+a.seriesIndex+"at"+u,p=aa({color:v,type:"subItem",renderMode:n,markerId:d}),g="string"==typeof p?p:p.content,m=(r?g+ia(o.displayName||"-")+": ":"")+ia("ordinal"===c?t+"":"time"===c?e?"":sa("yyyy/MM/dd hh:mm:ss",t):ta(t));m&&f.push(m),s&&(l[d]=v,++u)}}var r=p(i,function(t,e,i){var n=h.getDimensionInfo(i);return t|=n&&!1!==n.tooltip&&null!=n.displayName},0),f=[];c.length?d(c,function(e){o(fr(h,t,e),e)}):d(i,o);var g=r?s?"\n":"
":"",m=g+f.join(g||", ");return{renderMode:n,content:m,style:l}}(g):o(f?fr(h,t,c[0]):m?g[0]:g)).content,_=a.seriesIndex+"at"+u,b=aa({color:v,type:"item",renderMode:n,markerId:_});l[_]=v,++u;var S=h.getName(t),M=this.name;Oi(this)||(M=""),M=M?ia(M)+(e?": ":r):"";var I="string"==typeof b?b:b.content;return{html:e?I+M+x:M+I+(S?ia(S)+": "+x:x),markers:l}},isAnimationEnabled:function(){if(U_.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=dI.getColorFromPalette.call(this,t,e,i);return o||(o=n.getColorFromPalette(t,e,i)),o},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});h(YI,ZI),h(YI,dI);var qI=function(){this.group=new tb,this.uid=Ro("viewComponent")};qI.prototype={constructor:qI,init:function(t,e){},render:function(t,e,i,n){},dispose:function(){},filterForExposedEvent:null};var KI=qI.prototype;KI.updateView=KI.updateLayout=KI.updateVisual=function(t,e,i,n){},ji(qI),$i(qI,{registerWhenExtend:!0});var $I=function(){var t=Bi();return function(e){var i=t(e),n=e.pipelineContext,o=i.large,a=i.progressiveRender,r=i.large=n.large,s=i.progressiveRender=n.progressiveRender;return!!(o^r||a^s)&&"reset"}},JI=Bi(),QI=$I();Ar.prototype={type:"chart",init:function(t,e){},render:function(t,e,i,n){},highlight:function(t,e,i,n){Cr(t.getData(),n,"emphasis")},downplay:function(t,e,i,n){Cr(t.getData(),n,"normal")},remove:function(t,e){this.group.removeAll()},dispose:function(){},incrementalPrepareRender:null,incrementalRender:null,updateTransform:null,filterForExposedEvent:null};var tT=Ar.prototype;tT.updateView=tT.updateLayout=tT.updateVisual=function(t,e,i,n){this.render(t,e,i,n)},ji(Ar),$i(Ar,{registerWhenExtend:!0}),Ar.markUpdateMethod=function(t,e){JI(t).updateMethod=e};var eT={incrementalPrepareRender:{progress:function(t,e){e.view.incrementalRender(t,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(t,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}},iT="\0__throttleOriginMethod",nT="\0__throttleRate",oT="\0__throttleType",aT={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var i=t.getData(),n=(t.visualColorAccessPath||"itemStyle.color").split("."),o=t.get(n)||t.getColorFromPalette(t.name,null,e.getSeriesCount());if(i.setVisual("color",o),!e.isSeriesFiltered(t)){"function"!=typeof o||o instanceof IM||i.each(function(e){i.setItemVisual(e,"color",o(t.getDataParams(e)))});return{dataEach:i.hasItemOption?function(t,e){var i=t.getItemModel(e).get(n,!0);null!=i&&t.setItemVisual(e,"color",i)}:null}}}},rT={toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}},sT=function(t,e){function i(t,e){if("string"!=typeof t)return t;var i=t;return d(e,function(t,e){i=i.replace(new RegExp("\\{\\s*"+e+"\\s*\\}","g"),t)}),i}function n(t){var e=a.get(t);if(null==e){for(var i=t.split("."),n=rT.aria,o=0;o1?"series.multiple.prefix":"series.single.prefix"),{seriesCount:r}),e.eachSeries(function(t,e){if(e1?"multiple":"single")+".";a=i(a=n(s?u+"withName":u+"withoutName"),{seriesId:t.seriesIndex,seriesName:t.get("name"),seriesType:o(t.subType)});var c=t.getData();window.data=c,c.count()>l?a+=i(n("data.partialData"),{displayCnt:l}):a+=n("data.allData");for(var d=[],p=0;pi.blockIndex?i.step:null,a=n&&n.modDataCount;return{step:o,modBy:null!=a?Math.ceil(a/o):null,modDataCount:a}}},uT.getPipeline=function(t){return this._pipelineMap.get(t)},uT.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}},uT.restorePipelines=function(t){var e=this,i=e._pipelineMap=R();t.eachSeries(function(t){var n=t.getProgressive(),o=t.uid;i.set(o,{id:o,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:n&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(n||700),count:0}),jr(e,t,t.dataTask)})},uT.prepareStageTasks=function(){var t=this._stageTaskMap,e=this.ecInstance.getModel(),i=this.api;d(this._allHandlers,function(n){var o=t.get(n.uid)||t.set(n.uid,[]);n.reset&&zr(this,n,o,e,i),n.overallReset&&Br(this,n,o,e,i)},this)},uT.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,jr(this,e,o)},uT.performDataProcessorTasks=function(t,e){Rr(this,this._dataProcessorHandlers,t,e,{block:!0})},uT.performVisualTasks=function(t,e,i){Rr(this,this._visualHandlers,t,e,i)},uT.performSeriesTasks=function(t){var e;t.eachSeries(function(t){e|=t.dataTask.perform()}),this.unfinished|=e},uT.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 hT=uT.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)},cT=Ur(0);Er.wrapStageHandler=function(t,e){return x(t)&&(t={overallReset:t,seriesType:Yr(t)}),t.uid=Ro("stageHandler"),e&&(t.visualType=e),t};var dT,fT={},pT={};qr(fT,MI),qr(pT,Ga),fT.eachSeriesByType=fT.eachRawSeriesByType=function(t){dT=t},fT.eachComponent=function(t){"series"===t.mainType&&t.subType&&(dT=t.subType)};var gT=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"],mT={color:gT,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],gT]},vT=["#dd6b66","#759aa0","#e69d87","#8dc1a9","#ea7e53","#eedd78","#73a373","#73b9bc","#7289ab","#91ca8c","#f49f42"],yT={color:vT,backgroundColor:"#333",tooltip:{axisPointer:{lineStyle:{color:"#eee"},crossStyle:{color:"#eee"}}},legend:{textStyle:{color:"#eee"}},textStyle:{color:"#eee"},title:{textStyle:{color:"#eee"}},toolbox:{iconStyle:{normal:{borderColor:"#eee"}}},dataZoom:{textStyle:{color:"#eee"}},visualMap:{textStyle:{color:"#eee"}},timeline:{lineStyle:{color:"#eee"},itemStyle:{normal:{color:vT[1]}},label:{normal:{textStyle:{color:"#eee"}}},controlStyle:{normal:{color:"#eee",borderColor:"#eee"}}},timeAxis:{axisLine:{lineStyle:{color:"#eee"}},axisTick:{lineStyle:{color:"#eee"}},axisLabel:{textStyle:{color:"#eee"}},splitLine:{lineStyle:{type:"dashed",color:"#aaa"}},splitArea:{areaStyle:{color:"#eee"}}},logAxis:{axisLine:{lineStyle:{color:"#eee"}},axisTick:{lineStyle:{color:"#eee"}},axisLabel:{textStyle:{color:"#eee"}},splitLine:{lineStyle:{type:"dashed",color:"#aaa"}},splitArea:{areaStyle:{color:"#eee"}}},valueAxis:{axisLine:{lineStyle:{color:"#eee"}},axisTick:{lineStyle:{color:"#eee"}},axisLabel:{textStyle:{color:"#eee"}},splitLine:{lineStyle:{type:"dashed",color:"#aaa"}},splitArea:{areaStyle:{color:"#eee"}}},categoryAxis:{axisLine:{lineStyle:{color:"#eee"}},axisTick:{lineStyle:{color:"#eee"}},axisLabel:{textStyle:{color:"#eee"}},splitLine:{lineStyle:{type:"dashed",color:"#aaa"}},splitArea:{areaStyle:{color:"#eee"}}},line:{symbol:"circle"},graph:{color:vT},gauge:{title:{textStyle:{color:"#eee"}}},candlestick:{itemStyle:{normal:{color:"#FD1050",color0:"#0CF49B",borderColor:"#FD1050",borderColor0:"#0CF49B"}}}};yT.categoryAxis.splitLine.show=!1,lI.extend({type:"dataset",defaultOption:{seriesLayoutBy:_I,sourceHeader:null,dimensions:null,source:null},optionUpdated:function(){wa(this)}}),qI.extend({type:"dataset"});var xT=Pn.extend({type:"ellipse",shape:{cx:0,cy:0,rx:0,ry:0},buildPath:function(t,e){var i=.5522848,n=e.cx,o=e.cy,a=e.rx,r=e.ry,s=a*i,l=r*i;t.moveTo(n-a,o),t.bezierCurveTo(n-a,o-l,n-s,o-r,n,o-r),t.bezierCurveTo(n+s,o-r,n+a,o-l,n+a,o),t.bezierCurveTo(n+a,o+l,n+s,o+r,n,o+r),t.bezierCurveTo(n-s,o+r,n-a,o+l,n-a,o),t.closePath()}}),_T=/[\s,]+/;$r.prototype.parse=function(t,e){e=e||{};var i=Kr(t);if(!i)throw new Error("Illegal svg");var n=new tb;this._root=n;var o=i.getAttribute("viewBox")||"",a=parseFloat(i.getAttribute("width")||e.width),r=parseFloat(i.getAttribute("height")||e.height);isNaN(a)&&(a=null),isNaN(r)&&(r=null),es(i,n,null,!0);for(var s=i.firstChild;s;)this._parseNode(s,n),s=s.nextSibling;var l,u;if(o){var h=P(o).split(_T);h.length>=4&&(l={x:parseFloat(h[0]||0),y:parseFloat(h[1]||0),width:parseFloat(h[2]),height:parseFloat(h[3])})}if(l&&null!=a&&null!=r&&(u=as(l,a,r),!e.ignoreViewBox)){var c=n;(n=new tb).add(c),c.scale=u.scale.slice(),c.position=u.position.slice()}return e.ignoreRootClip||null==a||null==r||n.setClipPath(new yM({shape:{x:0,y:0,width:a,height:r}})),{root:n,width:a,height:r,viewBoxRect:l,viewBoxTransform:u}},$r.prototype._parseNode=function(t,e){var i=t.nodeName.toLowerCase();"defs"===i?this._isDefine=!0:"text"===i&&(this._isText=!0);var n;if(this._isDefine){if(r=bT[i]){var o=r.call(this,t),a=t.getAttribute("id");a&&(this._defs[a]=o)}}else{var r=wT[i];r&&(n=r.call(this,t,e),e.add(n))}for(var s=t.firstChild;s;)1===s.nodeType&&this._parseNode(s,n),3===s.nodeType&&this._isText&&this._parseText(s,n),s=s.nextSibling;"defs"===i?this._isDefine=!1:"text"===i&&(this._isText=!1)},$r.prototype._parseText=function(t,e){if(1===t.nodeType){var i=t.getAttribute("dx")||0,n=t.getAttribute("dy")||0;this._textX+=parseFloat(i),this._textY+=parseFloat(n)}var o=new rM({style:{text:t.textContent,transformText:!0},position:[this._textX||0,this._textY||0]});Qr(e,o),es(t,o,this._defs);var a=o.style.fontSize;a&&a<9&&(o.style.fontSize=9,o.scale=o.scale||[1,1],o.scale[0]*=a/9,o.scale[1]*=a/9);var r=o.getBoundingRect();return this._textX+=r.width,e.add(o),o};var wT={g:function(t,e){var i=new tb;return Qr(e,i),es(t,i,this._defs),i},rect:function(t,e){var i=new yM;return Qr(e,i),es(t,i,this._defs),i.setShape({x:parseFloat(t.getAttribute("x")||0),y:parseFloat(t.getAttribute("y")||0),width:parseFloat(t.getAttribute("width")||0),height:parseFloat(t.getAttribute("height")||0)}),i},circle:function(t,e){var i=new sM;return Qr(e,i),es(t,i,this._defs),i.setShape({cx:parseFloat(t.getAttribute("cx")||0),cy:parseFloat(t.getAttribute("cy")||0),r:parseFloat(t.getAttribute("r")||0)}),i},line:function(t,e){var i=new _M;return Qr(e,i),es(t,i,this._defs),i.setShape({x1:parseFloat(t.getAttribute("x1")||0),y1:parseFloat(t.getAttribute("y1")||0),x2:parseFloat(t.getAttribute("x2")||0),y2:parseFloat(t.getAttribute("y2")||0)}),i},ellipse:function(t,e){var i=new xT;return Qr(e,i),es(t,i,this._defs),i.setShape({cx:parseFloat(t.getAttribute("cx")||0),cy:parseFloat(t.getAttribute("cy")||0),rx:parseFloat(t.getAttribute("rx")||0),ry:parseFloat(t.getAttribute("ry")||0)}),i},polygon:function(t,e){var i=t.getAttribute("points");i&&(i=ts(i));var n=new pM({shape:{points:i||[]}});return Qr(e,n),es(t,n,this._defs),n},polyline:function(t,e){var i=new Pn;Qr(e,i),es(t,i,this._defs);var n=t.getAttribute("points");return n&&(n=ts(n)),new gM({shape:{points:n||[]}})},image:function(t,e){var i=new fi;return Qr(e,i),es(t,i,this._defs),i.setStyle({image:t.getAttribute("xlink:href"),x:t.getAttribute("x"),y:t.getAttribute("y"),width:t.getAttribute("width"),height:t.getAttribute("height")}),i},text:function(t,e){var i=t.getAttribute("x")||0,n=t.getAttribute("y")||0,o=t.getAttribute("dx")||0,a=t.getAttribute("dy")||0;this._textX=parseFloat(i)+parseFloat(o),this._textY=parseFloat(n)+parseFloat(a);var r=new tb;return Qr(e,r),es(t,r,this._defs),r},tspan:function(t,e){var i=t.getAttribute("x"),n=t.getAttribute("y");null!=i&&(this._textX=parseFloat(i)),null!=n&&(this._textY=parseFloat(n));var o=t.getAttribute("dx")||0,a=t.getAttribute("dy")||0,r=new tb;return Qr(e,r),es(t,r,this._defs),this._textX+=o,this._textY+=a,r},path:function(t,e){var i=Rn(t.getAttribute("d")||"");return Qr(e,i),es(t,i,this._defs),i}},bT={lineargradient:function(t){var e=parseInt(t.getAttribute("x1")||0,10),i=parseInt(t.getAttribute("y1")||0,10),n=parseInt(t.getAttribute("x2")||10,10),o=parseInt(t.getAttribute("y2")||0,10),a=new TM(e,i,n,o);return Jr(t,a),a},radialgradient:function(t){}},ST={fill:"fill",stroke:"stroke","stroke-width":"lineWidth",opacity:"opacity","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-miterlimit":"miterLimit","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","text-align":"textAlign","alignment-baseline":"textBaseline"},MT=/url\(\s*#(.*?)\)/,IT=/(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.e,]*)\)/g,TT=/([^\s:;]+)\s*:\s*([^:;]+)/g,AT=R(),DT={registerMap:function(t,e,i){var n;return y(e)?n=e:e.svg?n=[{type:"svg",source:e.svg,specialAreas:e.specialAreas}]:(e.geoJson&&!e.features&&(i=e.specialAreas,e=e.geoJson),n=[{type:"geoJSON",source:e,specialAreas:i}]),d(n,function(t){var e=t.type;"geoJson"===e&&(e=t.type="geoJSON"),(0,CT[e])(t)}),AT.set(t,n)},retrieveMap:function(t){return AT.get(t)}},CT={geoJSON:function(t){var e=t.source;t.geoJSON=_(e)?"undefined"!=typeof JSON&&JSON.parse?JSON.parse(e):new Function("return ("+e+");")():e},svg:function(t){t.svgXML=Kr(t.source)}},LT=k,kT=d,PT=x,NT=w,OT=lI.parseClassType,ET={zrender:"4.0.6"},RT=1e3,zT=1e3,BT=3e3,VT={PROCESSOR:{FILTER:RT,STATISTIC:5e3},VISUAL:{LAYOUT:zT,GLOBAL:2e3,CHART:BT,COMPONENT:4e3,BRUSH:5e3}},GT="__flagInMainProcess",FT="__optionUpdated",WT=/^[a-zA-Z0-9_]+$/;ls.prototype.on=ss("on"),ls.prototype.off=ss("off"),ls.prototype.one=ss("one"),h(ls,fw);var HT=us.prototype;HT._onframe=function(){if(!this._disposed){var t=this._scheduler;if(this[FT]){var e=this[FT].silent;this[GT]=!0,cs(this),ZT.update.call(this),this[GT]=!1,this[FT]=!1,gs.call(this,e),ms.call(this,e)}else if(t.unfinished){var i=1,n=this._model;this._api;t.unfinished=!1;do{var o=+new Date;t.performSeriesTasks(n),t.performDataProcessorTasks(n),fs(this,n),t.performVisualTasks(n),bs(this,this._model,0,"remain"),i-=+new Date-o}while(i>0&&t.unfinished);t.unfinished||this._zr.flush()}}},HT.getDom=function(){return this._dom},HT.getZr=function(){return this._zr},HT.setOption=function(t,e,i){var n;if(NT(e)&&(i=e.lazyUpdate,n=e.silent,e=e.notMerge),this[GT]=!0,!this._model||e){var o=new Wa(this._api),a=this._theme,r=this._model=new MI(null,null,a,o);r.scheduler=this._scheduler,r.init(null,null,a,o)}this._model.setOption(t,qT),i?(this[FT]={silent:n},this[GT]=!1):(cs(this),ZT.update.call(this),this._zr.flush(),this[FT]=!1,this[GT]=!1,gs.call(this,n),ms.call(this,n))},HT.setTheme=function(){console.error("ECharts#setTheme() is DEPRECATED in ECharts 3.0")},HT.getModel=function(){return this._model},HT.getOption=function(){return this._model&&this._model.getOption()},HT.getWidth=function(){return this._zr.getWidth()},HT.getHeight=function(){return this._zr.getHeight()},HT.getDevicePixelRatio=function(){return this._zr.painter.dpr||window.devicePixelRatio||1},HT.getRenderedCanvas=function(t){if(U_.canvasSupported)return(t=t||{}).pixelRatio=t.pixelRatio||1,t.backgroundColor=t.backgroundColor||this._model.get("backgroundColor"),this._zr.painter.getRenderedCanvas(t)},HT.getSvgDataUrl=function(){if(U_.svgSupported){var t=this._zr;return d(t.storage.getDisplayList(),function(t){t.stopAnimation(!0)}),t.painter.pathToDataUrl()}},HT.getDataURL=function(t){var e=(t=t||{}).excludeComponents,i=this._model,n=[],o=this;kT(e,function(t){i.eachComponent({mainType:t},function(t){var e=o._componentsMap[t.__viewId];e.group.ignore||(n.push(e),e.group.ignore=!0)})});var a="svg"===this._zr.painter.getType()?this.getSvgDataUrl():this.getRenderedCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return kT(n,function(t){t.group.ignore=!1}),a},HT.getConnectedDataURL=function(t){if(U_.canvasSupported){var e=this.group,n=Math.min,o=Math.max;if(eA[e]){var a=1/0,r=1/0,s=-1/0,l=-1/0,u=[],h=t&&t.pixelRatio||1;d(tA,function(h,c){if(h.group===e){var d=h.getRenderedCanvas(i(t)),f=h.getDom().getBoundingClientRect();a=n(f.left,a),r=n(f.top,r),s=o(f.right,s),l=o(f.bottom,l),u.push({dom:d,left:f.left,top:f.top})}});var c=(s*=h)-(a*=h),f=(l*=h)-(r*=h),p=iw();p.width=c,p.height=f;var g=Ii(p);return kT(u,function(t){var e=new fi({style:{x:t.left*h-a,y:t.top*h-r,image:t.dom}});g.add(e)}),g.refreshImmediately(),p.toDataURL("image/"+(t&&t.type||"png"))}return this.getDataURL(t)}},HT.convertToPixel=v(hs,"convertToPixel"),HT.convertFromPixel=v(hs,"convertFromPixel"),HT.containPixel=function(t,e){var i;return t=Vi(this._model,t),d(t,function(t,n){n.indexOf("Models")>=0&&d(t,function(t){var o=t.coordinateSystem;if(o&&o.containPoint)i|=!!o.containPoint(e);else if("seriesModels"===n){var a=this._chartsMap[t.__viewId];a&&a.containPoint&&(i|=a.containPoint(e,t))}},this)},this),!!i},HT.getVisual=function(t,e){var i=(t=Vi(this._model,t,{defaultMainType:"series"})).seriesModel.getData(),n=t.hasOwnProperty("dataIndexInside")?t.dataIndexInside:t.hasOwnProperty("dataIndex")?i.indexOfRawIndex(t.dataIndex):null;return null!=n?i.getItemVisual(n,e):i.getVisual(e)},HT.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},HT.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]};var ZT={prepareAndUpdate:function(t){cs(this),ZT.update.call(this,t)},update:function(t){var e=this._model,i=this._api,n=this._zr,o=this._coordSysMgr,a=this._scheduler;if(e){a.restoreData(e,t),a.performSeriesTasks(e),o.create(e,i),a.performDataProcessorTasks(e,t),fs(this,e),o.update(e,i),xs(e),a.performVisualTasks(e,t),_s(this,e,i,t);var r=e.get("backgroundColor")||"transparent";if(U_.canvasSupported)n.setBackgroundColor(r);else{var s=Gt(r);r=qt(s,"rgb"),0===s[3]&&(r="transparent")}Ss(e,i)}},updateTransform:function(t){var e=this._model,i=this,n=this._api;if(e){var o=[];e.eachComponent(function(a,r){var s=i.getViewOfComponentModel(r);if(s&&s.__alive)if(s.updateTransform){var l=s.updateTransform(r,e,n,t);l&&l.update&&o.push(s)}else o.push(s)});var a=R();e.eachSeries(function(o){var r=i._chartsMap[o.__viewId];if(r.updateTransform){var s=r.updateTransform(o,e,n,t);s&&s.update&&a.set(o.uid,1)}else a.set(o.uid,1)}),xs(e),this._scheduler.performVisualTasks(e,t,{setDirty:!0,dirtyMap:a}),bs(i,e,0,t,a),Ss(e,this._api)}},updateView:function(t){var e=this._model;e&&(Ar.markUpdateMethod(t,"updateView"),xs(e),this._scheduler.performVisualTasks(e,t,{setDirty:!0}),_s(this,this._model,this._api,t),Ss(e,this._api))},updateVisual:function(t){ZT.update.call(this,t)},updateLayout:function(t){ZT.update.call(this,t)}};HT.resize=function(t){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[GT]=!0,i&&cs(this),ZT.update.call(this),this[GT]=!1,gs.call(this,n),ms.call(this,n)}},HT.showLoading=function(t,e){if(NT(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),QT[t]){var i=QT[t](this._api,e),n=this._zr;this._loadingFX=i,n.add(i)}},HT.hideLoading=function(){this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},HT.makeActionFromEvent=function(t){var e=a({},t);return e.type=jT[t.type],e},HT.dispatchAction=function(t,e){NT(e)||(e={silent:!!e}),XT[t.type]&&this._model&&(this[GT]?this._pendingActions.push(t):(ps.call(this,t,e.silent),e.flush?this._zr.flush(!0):!1!==e.flush&&U_.browser.weChat&&this._throttledZrFlush(),gs.call(this,e.silent),ms.call(this,e.silent)))},HT.appendData=function(t){var e=t.seriesIndex;this.getModel().getSeriesByIndex(e).appendData(t),this._scheduler.unfinished=!0},HT.on=ss("on"),HT.off=ss("off"),HT.one=ss("one");var UT=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];HT._initEvents=function(){kT(UT,function(t){var e=function(e){var i,n=this.getModel(),o=e.target;if("globalout"===t)i={};else if(o&&null!=o.dataIndex){var r=o.dataModel||n.getSeriesByIndex(o.seriesIndex);i=r&&r.getDataParams(o.dataIndex,o.dataType,o)||{}}else o&&o.eventData&&(i=a({},o.eventData));if(i){var s=i.componentType,l=i.componentIndex;"markLine"!==s&&"markPoint"!==s&&"markArea"!==s||(s="series",l=i.seriesIndex);var u=s&&null!=l&&n.getComponent(s,l),h=u&&this["series"===u.mainType?"_chartsMap":"_componentsMap"][u.__viewId];i.event=e,i.type=t,this._ecEventProcessor.eventInfo={targetEl:o,packedEvent:i,model:u,view:h},this.trigger(t,i)}};e.zrEventfulCallAtLast=!0,this._zr.on(t,e,this)},this),kT(jT,function(t,e){this._messageCenter.on(e,function(t){this.trigger(e,t)},this)},this)},HT.isDisposed=function(){return this._disposed},HT.clear=function(){this.setOption({series:[]},!0)},HT.dispose=function(){if(!this._disposed){this._disposed=!0,Fi(this.getDom(),oA,"");var t=this._api,e=this._model;kT(this._componentsViews,function(i){i.dispose(e,t)}),kT(this._chartsViews,function(i){i.dispose(e,t)}),this._zr.dispose(),delete tA[this.id]}},h(us,fw),Ds.prototype={constructor:Ds,normalizeQuery:function(t){var e={},i={},n={};if(_(t)){var o=OT(t);e.mainType=o.main||null,e.subType=o.sub||null}else{var a=["Index","Name","Id"],r={name:1,dataIndex:1,dataType:1};d(t,function(t,o){for(var s=!1,l=0;l0&&h===o.length-u.length){var c=o.slice(0,h);"data"!==c&&(e.mainType=c,e[u.toLowerCase()]=t,s=!0)}}r.hasOwnProperty(o)&&(i[o]=t,s=!0),s||(n[o]=t)})}return{cptQuery:e,dataQuery:i,otherQuery:n}},filter:function(t,e,i){function n(t,e,i,n){return null==t[i]||e[n||i]===t[i]}var o=this.eventInfo;if(!o)return!0;var a=o.targetEl,r=o.packedEvent,s=o.model,l=o.view;if(!s||!l)return!0;var u=e.cptQuery,h=e.dataQuery;return n(u,s,"mainType")&&n(u,s,"subType")&&n(u,s,"index","componentIndex")&&n(u,s,"name")&&n(u,s,"id")&&n(h,r,"name")&&n(h,r,"dataIndex")&&n(h,r,"dataType")&&(!l.filterForExposedEvent||l.filterForExposedEvent(t,e.otherQuery,a,r))},afterTrigger:function(){this.eventInfo=null}};var XT={},jT={},YT=[],qT=[],KT=[],$T=[],JT={},QT={},tA={},eA={},iA=new Date-0,nA=new Date-0,oA="_echarts_instance_",aA=Ls;Bs(2e3,aT),Ns(BI),Os(5e3,function(t){var e=R();t.eachSeries(function(t){var i=t.get("stack");if(i){var n=e.get(i)||e.set(i,[]),o=t.getData(),a={stackResultDimension:o.getCalculationInfo("stackResultDimension"),stackedOverDimension:o.getCalculationInfo("stackedOverDimension"),stackedDimension:o.getCalculationInfo("stackedDimension"),stackedByDimension:o.getCalculationInfo("stackedByDimension"),isStackedByIndex:o.getCalculationInfo("isStackedByIndex"),data:o,seriesModel:t};if(!a.stackedDimension||!a.isStackedByIndex&&!a.stackedByDimension)return;n.length&&o.setCalculationInfo("stackedOnSeries",n[n.length-1].seriesModel),n.push(a)}}),e.each(ar)}),Gs("default",function(t,e){r(e=e||{},{text:"loading",color:"#c23531",textColor:"#000",maskColor:"rgba(255, 255, 255, 0.8)",zlevel:0});var i=new yM({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4}),n=new SM({shape:{startAngle:-lT/2,endAngle:-lT/2+.1,r:10},style:{stroke:e.color,lineCap:"round",lineWidth:5},zlevel:e.zlevel,z:10001}),o=new yM({style:{fill:"none",text:e.text,textPosition:"right",textDistance:10,textFill:e.textColor},zlevel:e.zlevel,z:10001});n.animateShape(!0).when(1e3,{endAngle:3*lT/2}).start("circularInOut"),n.animateShape(!0).when(1e3,{startAngle:3*lT/2}).delay(300).start("circularInOut");var a=new tb;return a.add(n),a.add(o),a.add(i),a.resize=function(){var e=t.getWidth()/2,a=t.getHeight()/2;n.setShape({cx:e,cy:a});var r=n.shape.r;o.setShape({x:e-r,y:a-r,width:2*r,height:2*r}),i.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},a.resize(),a}),Es({type:"highlight",event:"highlight",update:"highlight"},B),Es({type:"downplay",event:"downplay",update:"downplay"},B),Ps("light",mT),Ps("dark",yT);var rA={};Xs.prototype={constructor:Xs,add:function(t){return this._add=t,this},update:function(t){return this._update=t,this},remove:function(t){return this._remove=t,this},execute:function(){var t=this._old,e=this._new,i={},n=[],o=[];for(js(t,{},n,"_oldKeyGetter",this),js(e,i,o,"_newKeyGetter",this),a=0;ax[1]&&(x[1]=y)}e&&(this._nameList[d]=e[f])}this._rawCount=this._count=l,this._extent={},el(this)},yA._initDataFromProvider=function(t,e){if(!(t>=e)){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,C=I,d[I]>0&&(C+="__ec__"+d[I]),d[I]++),null!=C&&(h[v]=C)}}!o.persistent&&o.clean&&o.clean(),this._rawCount=this._count=e,this._extent={},el(this)}},yA.count=function(){return this._count},yA.getIndices=function(){var t=this._indices;if(t){var e=t.constructor,i=this._count;if(e===Array){n=new e(i);for(o=0;o=0&&e=0&&ea&&(a=s)}return i=[o,a],this._extent[t]=i,i},yA.getApproximateExtent=function(t){return t=this.getDimension(t),this._approximateExtent[t]||this.getDataExtent(t)},yA.setApproximateExtent=function(t,e){e=this.getDimension(e),this._approximateExtent[e]=t.slice()},yA.getCalculationInfo=function(t){return this._calculationInfo[t]},yA.setCalculationInfo=function(t,e){lA(t)?a(this._calculationInfo,t):this._calculationInfo[t]=e},yA.getSum=function(t){var e=0;if(this._storage[t])for(var i=0,n=this.count();i=this._rawCount||t<0)return-1;var e=this._indices,i=e[t];if(null!=i&&it))return a;o=a-1}}return-1},yA.indicesOfNearest=function(t,e,i){var n=[];if(!this._storage[t])return n;null==i&&(i=1/0);for(var o=Number.MAX_VALUE,a=-1,r=0,s=this.count();r=0&&a<0)&&(o=u,a=l,n.length=0),n.push(r))}return n},yA.getRawIndex=nl,yA.getRawDataItem=function(t){if(this._rawData.persistent)return this._rawData.getItem(this.getRawIndex(t));for(var e=[],i=0;i=l&&w<=u||isNaN(w))&&(a[r++]=c),c++;h=!0}else if(2===n){for(var d=this._storage[s],v=this._storage[e[1]],y=t[e[1]][0],x=t[e[1]][1],f=0;f=l&&w<=u||isNaN(w))&&(b>=y&&b<=x||isNaN(b))&&(a[r++]=c),c++}h=!0}}if(!h)if(1===n)for(m=0;m=l&&w<=u||isNaN(w))&&(a[r++]=M)}else for(m=0;mt[I][1])&&(S=!1)}S&&(a[r++]=this.getRawIndex(m))}return rb[1]&&(b[1]=w)}}}return o},yA.downSample=function(t,e,i,n){for(var o=sl(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($s(this))(u),f=0,p=0;pu-p&&(s=u-p,r.length=s);for(var g=0;gc[1]&&(c[1]=x),d[f++]=_}return o._count=f,o._indices=d,o.getRawIndex=ol,o},yA.getItemModel=function(t){var e=this.hostModel;return new No(this.getRawDataItem(t),e,e&&e.ecModel)},yA.diff=function(t){var e=this;return new Xs(t?t.getIndices():[],this.getIndices(),function(e){return al(t,e)},function(t){return al(e,t)})},yA.getVisual=function(t){var e=this._visual;return e&&e[t]},yA.setVisual=function(t,e){if(lA(t))for(var i in t)t.hasOwnProperty(i)&&this.setVisual(i,t[i]);else this._visual=this._visual||{},this._visual[t]=e},yA.setLayout=function(t,e){if(lA(t))for(var i in t)t.hasOwnProperty(i)&&this.setLayout(i,t[i]);else this._layout[t]=e},yA.getLayout=function(t){return this._layout[t]},yA.getItemLayout=function(t){return this._itemLayouts[t]},yA.setItemLayout=function(t,e,i){this._itemLayouts[t]=i?a(this._itemLayouts[t]||{},e):e},yA.clearItemLayouts=function(){this._itemLayouts.length=0},yA.getItemVisual=function(t,e,i){var n=this._itemVisuals[t],o=n&&n[e];return null!=o||i?o:this.getVisual(e)},yA.setItemVisual=function(t,e,i){var n=this._itemVisuals[t]||{},o=this.hasItemVisual;if(this._itemVisuals[t]=n,lA(e))for(var a in e)e.hasOwnProperty(a)&&(n[a]=e[a],o[a]=!0);else n[e]=i,o[e]=!0},yA.clearAllVisual=function(){this._visual={},this._itemVisuals=[],this.hasItemVisual={}};var xA=function(t){t.seriesIndex=this.seriesIndex,t.dataIndex=this.dataIndex,t.dataType=this.dataType};yA.setItemGraphicEl=function(t,e){var i=this.hostModel;e&&(e.dataIndex=t,e.dataType=this.dataType,e.seriesIndex=i&&i.seriesIndex,"group"===e.type&&e.traverse(xA,e)),this._graphicEls[t]=e},yA.getItemGraphicEl=function(t){return this._graphicEls[t]},yA.eachItemGraphicEl=function(t,e){d(this._graphicEls,function(i,n){i&&t&&t.call(e,i,n)})},yA.cloneShallow=function(t){if(!t){var e=f(this.dimensions,this.getDimensionInfo,this);t=new vA(e,this.hostModel)}if(t._storage=this._storage,Qs(t,this),this._indices){var i=this._indices.constructor;t._indices=new i(this._indices)}else t._indices=null;return t.getRawIndex=t._indices?ol:nl,t},yA.wrapMethod=function(t,e){var i=this[t];"function"==typeof i&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var t=i.apply(this,arguments);return e.apply(this,[t].concat(C(arguments)))})},yA.TRANSFERABLE_METHODS=["cloneShallow","downSample","map"],yA.CHANGABLE_METHODS=["filterSelf","selectRange"];var _A=function(t,e){return e=e||{},hl(e.coordDimensions||[],t,{dimsDef:e.dimensionsDefine||t.dimensionsDefine,encodeDef:e.encodeDefine||t.encodeDefine,dimCount:e.dimensionsCount,generateCoord:e.generateCoord,generateCoordCount:e.generateCoordCount})};xl.prototype.parse=function(t){return t},xl.prototype.getSetting=function(t){return this._setting[t]},xl.prototype.contain=function(t){var e=this._extent;return t>=e[0]&&t<=e[1]},xl.prototype.normalize=function(t){var e=this._extent;return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])},xl.prototype.scale=function(t){var e=this._extent;return t*(e[1]-e[0])+e[0]},xl.prototype.unionExtent=function(t){var e=this._extent;t[0]e[1]&&(e[1]=t[1])},xl.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},xl.prototype.getExtent=function(){return this._extent.slice()},xl.prototype.setExtent=function(t,e){var i=this._extent;isNaN(t)||(i[0]=t),isNaN(e)||(i[1]=e)},xl.prototype.isBlank=function(){return this._isBlank},xl.prototype.setBlank=function(t){this._isBlank=t},xl.prototype.getLabel=null,ji(xl),$i(xl,{registerWhenExtend:!0}),_l.createByAxisModel=function(t){var e=t.option,i=e.data,n=i&&f(i,bl);return new _l({categories:n,needCollect:!n,deduplication:!1!==e.dedplication})};var wA=_l.prototype;wA.getOrdinal=function(t){return wl(this).get(t)},wA.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=wl(this);return null==(e=n.get(t))&&(i?(e=this.categories.length,this.categories[e]=t,n.set(t,e)):e=NaN),e};var bA=xl.prototype,SA=xl.extend({type:"ordinal",init:function(t,e){t&&!y(t)||(t=new _l({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),bA.contain.call(this,t)&&null!=this._ordinalMeta.categories[t]},normalize:function(t){return bA.normalize.call(this,this.parse(t))},scale:function(t){return Math.round(bA.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:B,niceExtent:B});SA.create=function(){return new SA};var MA=Go,IA=Go,TA=xl.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]),TA.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=Ml(t)},getTicks:function(){return Al(this._interval,this._extent,this._niceExtent,this._intervalPrecision)},getLabel:function(t,e){if(null==t)return"";var i=e&&e.precision;return null==i?i=Ho(t)||0:"auto"===i&&(i=this._intervalPrecision),t=IA(t,i,!0),ta(t)},niceTicks:function(t,e,i){t=t||5;var n=this._extent,o=n[1]-n[0];if(isFinite(o)){o<0&&(o=-o,n.reverse());var a=Sl(n,t,e,i);this._intervalPrecision=a.intervalPrecision,this._interval=a.interval,this._niceExtent=a.niceTickExtent}},niceExtent:function(t){var e=this._extent;if(e[0]===e[1])if(0!==e[0]){var i=e[0];t.fixMax?e[0]-=i/2:(e[1]+=i/2,e[0]-=i/2)}else e[1]=1;var n=e[1]-e[0];isFinite(n)||(e[0]=0,e[1]=1),this.niceTicks(t.splitNumber,t.minInterval,t.maxInterval);var o=this._interval;t.fixMin||(e[0]=IA(Math.floor(e[0]/o)*o)),t.fixMax||(e[1]=IA(Math.ceil(e[1]/o)*o))}});TA.create=function(){return new TA};var AA="__ec_stack_",DA="undefined"!=typeof Float32Array?Float32Array:Array,CA={seriesType:"bar",plan:$I(),reset:function(t){if(Rl(t)&&zl(t)){var e=t.getData(),i=t.coordinateSystem,n=i.getBaseAxis(),o=i.getOtherAxis(n),a=e.mapDimension(o.dim),r=e.mapDimension(n.dim),s=o.isHorizontal(),l=s?0:1,u=Ol(Pl([t]),n,t).width;return u>.5||(u=.5),{progress:function(t,e){for(var n,h=new DA(2*t.count),c=[],d=[],f=0;null!=(n=t.next());)d[l]=e.get(a,n),d[1-l]=e.get(r,n),c=i.dataToPoint(d,null,c),h[f++]=c[0],h[f++]=c[1];e.setLayout({largePoints:h,barWidth:u,valueAxisStart:Bl(0,o),valueAxisHorizontal:s})}}}}},LA=TA.prototype,kA=Math.ceil,PA=Math.floor,NA=function(t,e,i,n){for(;i>>1;t[o][1]i&&(a=i);var r=EA.length,s=NA(EA,a,0,r),l=EA[Math.min(s,r-1)],u=l[1];"year"===l[0]&&(u*=$o(o/u/t,!0));var h=this.getSetting("useUTC")?0:60*new Date(+n[0]||+n[1]).getTimezoneOffset()*1e3,c=[Math.round(kA((n[0]-h)/u)*u+h),Math.round(PA((n[1]-h)/u)*u+h)];Tl(c,n),this._stepLvl=l,this._interval=u,this._niceExtent=c},parse:function(t){return+Yo(t)}});d(["contain","normalize"],function(t){OA.prototype[t]=function(e){return LA[t].call(this,this.parse(e))}});var EA=[["hh:mm:ss",1e3],["hh:mm:ss",5e3],["hh:mm:ss",1e4],["hh:mm:ss",15e3],["hh:mm:ss",3e4],["hh:mm\nMM-dd",6e4],["hh:mm\nMM-dd",3e5],["hh:mm\nMM-dd",6e5],["hh:mm\nMM-dd",9e5],["hh:mm\nMM-dd",18e5],["hh:mm\nMM-dd",36e5],["hh:mm\nMM-dd",72e5],["hh:mm\nMM-dd",216e5],["hh:mm\nMM-dd",432e5],["MM-dd\nyyyy",864e5],["MM-dd\nyyyy",1728e5],["MM-dd\nyyyy",2592e5],["MM-dd\nyyyy",3456e5],["MM-dd\nyyyy",432e6],["MM-dd\nyyyy",5184e5],["week",6048e5],["MM-dd\nyyyy",864e6],["week",12096e5],["week",18144e5],["month",26784e5],["week",36288e5],["month",53568e5],["week",6048e6],["quarter",8208e6],["month",107136e5],["month",13392e6],["half-year",16416e6],["month",214272e5],["month",26784e6],["year",32832e6]];OA.create=function(t){return new OA({useUTC:t.ecModel.get("useUTC")})};var RA=xl.prototype,zA=TA.prototype,BA=Ho,VA=Go,GA=Math.floor,FA=Math.ceil,WA=Math.pow,HA=Math.log,ZA=xl.extend({type:"log",base:10,$constructor:function(){xl.apply(this,arguments),this._originalScale=new TA},getTicks:function(){var t=this._originalScale,e=this._extent,i=t.getExtent();return f(zA.getTicks.call(this),function(n){var o=Go(WA(this.base,n));return o=n===e[0]&&t.__fixMin?Vl(o,i[0]):o,o=n===e[1]&&t.__fixMax?Vl(o,i[1]):o},this)},getLabel:zA.getLabel,scale:function(t){return t=RA.scale.call(this,t),WA(this.base,t)},setExtent:function(t,e){var i=this.base;t=HA(t)/HA(i),e=HA(e)/HA(i),zA.setExtent.call(this,t,e)},getExtent:function(){var t=this.base,e=RA.getExtent.call(this);e[0]=WA(t,e[0]),e[1]=WA(t,e[1]);var i=this._originalScale,n=i.getExtent();return i.__fixMin&&(e[0]=Vl(e[0],n[0])),i.__fixMax&&(e[1]=Vl(e[1],n[1])),e},unionExtent:function(t){this._originalScale.unionExtent(t);var e=this.base;t[0]=HA(t[0])/HA(e),t[1]=HA(t[1])/HA(e),RA.unionExtent.call(this,t)},unionExtentFromData:function(t,e){this.unionExtent(t.getApproximateExtent(e))},niceTicks:function(t){t=t||10;var e=this._extent,i=e[1]-e[0];if(!(i===1/0||i<=0)){var n=qo(i);for(t/i*n<=.5&&(n*=10);!isNaN(n)&&Math.abs(n)<1&&Math.abs(n)>0;)n*=10;var o=[Go(FA(e[0]/n)*n),Go(GA(e[1]/n)*n)];this._interval=n,this._niceExtent=o}},niceExtent:function(t){zA.niceExtent.call(this,t);var e=this._originalScale;e.__fixMin=t.fixMin,e.__fixMax=t.fixMax}});d(["contain","normalize"],function(t){ZA.prototype[t]=function(e){return e=HA(e)/HA(this.base),RA[t].call(this,e)}}),ZA.create=function(){return new ZA};var UA={getMin:function(t){var e=this.option,i=t||null==e.rangeStart?e.min:e.rangeStart;return this.axis&&null!=i&&"dataMin"!==i&&"function"!=typeof i&&!I(i)&&(i=this.axis.scale.parse(i)),i},getMax:function(t){var e=this.option,i=t||null==e.rangeEnd?e.max:e.rangeEnd;return this.axis&&null!=i&&"dataMax"!==i&&"function"!=typeof i&&!I(i)&&(i=this.axis.scale.parse(i)),i},getNeedCrossZero:function(){var t=this.option;return null==t.rangeStart&&null==t.rangeEnd&&!t.scale},getCoordSysModel:B,setRange:function(t,e){this.option.rangeStart=t,this.option.rangeEnd=e},resetRange:function(){this.option.rangeStart=this.option.rangeEnd=null}},XA=Un({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var i=e.cx,n=e.cy,o=e.width/2,a=e.height/2;t.moveTo(i,n-a),t.lineTo(i+o,n+a),t.lineTo(i-o,n+a),t.closePath()}}),jA=Un({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var i=e.cx,n=e.cy,o=e.width/2,a=e.height/2;t.moveTo(i,n-a),t.lineTo(i+o,n),t.lineTo(i,n+a),t.lineTo(i-o,n),t.closePath()}}),YA=Un({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var i=e.x,n=e.y,o=e.width/5*3,a=Math.max(o,e.height),r=o/2,s=r*r/(a-r),l=n-a+r+s,u=Math.asin(s/r),h=Math.cos(u)*r,c=Math.sin(u),d=Math.cos(u),f=.6*r,p=.7*r;t.moveTo(i-h,l+s),t.arc(i,l,r,Math.PI-u,2*Math.PI+u),t.bezierCurveTo(i+h-c*f,l+s+d*f,i,n-p,i,n),t.bezierCurveTo(i,n-p,i-h+c*f,l+s+d*f,i-h,l+s),t.closePath()}}),qA=Un({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var i=e.height,n=e.width,o=e.x,a=e.y,r=n/3*2;t.moveTo(o,a),t.lineTo(o+r,a+i),t.lineTo(o,a+i/4*3),t.lineTo(o-r,a+i),t.lineTo(o,a),t.closePath()}}),KA={line:function(t,e,i,n,o){o.x1=t,o.y1=e+n/2,o.x2=t+i,o.y2=e+n/2},rect:function(t,e,i,n,o){o.x=t,o.y=e,o.width=i,o.height=n},roundRect:function(t,e,i,n,o){o.x=t,o.y=e,o.width=i,o.height=n,o.r=Math.min(i,n)/4},square:function(t,e,i,n,o){var a=Math.min(i,n);o.x=t,o.y=e,o.width=a,o.height=a},circle:function(t,e,i,n,o){o.cx=t+i/2,o.cy=e+n/2,o.r=Math.min(i,n)/2},diamond:function(t,e,i,n,o){o.cx=t+i/2,o.cy=e+n/2,o.width=i,o.height=n},pin:function(t,e,i,n,o){o.x=t+i/2,o.y=e+n/2,o.width=i,o.height=n},arrow:function(t,e,i,n,o){o.x=t+i/2,o.y=e+n/2,o.width=i,o.height=n},triangle:function(t,e,i,n,o){o.cx=t+i/2,o.cy=e+n/2,o.width=i,o.height=n}},$A={};d({line:_M,rect:yM,roundRect:yM,square:yM,circle:sM,diamond:jA,pin:YA,arrow:qA,triangle:XA},function(t,e){$A[e]=new t});var JA=Un({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},beforeBrush:function(){var t=this.style;"pin"===this.shape.symbolType&&"inside"===t.textPosition&&(t.textPosition=["50%","40%"],t.textAlign="center",t.textVerticalAlign="middle")},buildPath:function(t,e,i){var n=e.symbolType,o=$A[n];"none"!==e.symbolType&&(o||(o=$A[n="rect"]),KA[n](e.x,e.y,e.width,e.height,o.shape),o.buildPath(t,o.shape,i))}}),QA={isDimensionStacked:pl,enableDataStack:fl,getStackedDimension:gl},tD=(Object.freeze||Object)({createList:function(t){return ml(t.getSource(),t)},getLayoutRect:ca,dataStack:QA,createScale:function(t,e){var i=e;No.isInstance(e)||h(i=new No(e),UA);var n=Hl(i);return n.setExtent(t[0],t[1]),Wl(n,i),n},mixinAxisModelCommonMethods:function(t){h(t,UA)},completeDimensions:hl,createDimensions:_A,createSymbol:Jl}),eD=1e-8;eu.prototype={constructor:eu,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;s0}),function(t){var e=t.properties,i=t.geometry,n=i.coordinates,o=[];"Polygon"===i.type&&o.push({type:"polygon",exterior:n[0],interiors:n.slice(1)}),"MultiPolygon"===i.type&&d(n,function(t){t[0]&&o.push({type:"polygon",exterior:t[0],interiors:t.slice(1)})});var a=new eu(e.name,o,e.cp);return a.properties=e,a})},nD=Bi(),oD=[0,1],aD=function(t,e,i){this.dim=t,this.scale=e,this._extent=i||[0,0],this.inverse=!1,this.onBand=!1};aD.prototype={constructor:aD,contain:function(t){var e=this._extent,i=Math.min(e[0],e[1]),n=Math.max(e[0],e[1]);return t>=i&&t<=n},containData:function(t){return this.contain(this.dataToCoord(t))},getExtent:function(){return this._extent.slice()},getPixelPrecision:function(t){return Zo(t||this.scale.getExtent(),this._extent)},setExtent:function(t,e){var i=this._extent;i[0]=t,i[1]=e},dataToCoord:function(t,e){var i=this._extent,n=this.scale;return t=n.normalize(t),this.onBand&&"ordinal"===n.type&&yu(i=i.slice(),n.count()),Bo(t,oD,i,e)},coordToData:function(t,e){var i=this._extent,n=this.scale;this.onBand&&"ordinal"===n.type&&yu(i=i.slice(),n.count());var o=Bo(t,i,oD,e);return this.scale.scale(o)},pointToData:function(t,e){},getTicksCoords:function(t){var e=(t=t||{}).tickModel||this.getTickModel(),i=au(this,e),n=f(i.ticks,function(t){return{coord:this.dataToCoord(t),tickValue:t}},this),o=e.get("alignWithLabel");return xu(this,n,i.tickCategoryInterval,o,t.clamp),n},getViewLabels:function(){return ou(this).labels},getLabelModel:function(){return this.model.getModel("axisLabel")},getTickModel:function(){return this.model.getModel("axisTick")},getBandWidth:function(){var t=this._extent,e=this.scale.getExtent(),i=e[1]-e[0]+(this.onBand?1:0);0===i&&(i=1);var n=Math.abs(t[1]-t[0]);return Math.abs(n)/i},isHorizontal:null,getRotate:null,calculateCategoryInterval:function(){return pu(this)}};var rD=iD,sD={};d(["map","each","filter","indexOf","inherits","reduce","filter","bind","curry","isArray","isString","isObject","isFunction","extend","defaults","clone","merge"],function(t){sD[t]=aw[t]});var lD={};d(["extendShape","extendPath","makePath","makeImage","mergePath","resizePath","createIcon","setHoverStyle","setLabelStyle","setTextStyle","setText","getFont","updateProps","initProps","getTransform","clipPointsByRect","clipRectByRect","Group","Image","Text","Circle","Sector","Ring","Polygon","Polyline","Rect","Line","BezierCurve","Arc","IncrementalDisplayable","CompoundPath","LinearGradient","RadialGradient","BoundingRect"],function(t){lD[t]=zM[t]}),YI.extend({type:"series.line",dependencies:["grid","polar"],getInitialData:function(t,e){return ml(this.getSource(),this)},defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,hoverAnimation:!0,clipOverflow:!0,label:{position:"top"},lineStyle:{width:2,type:"solid"},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0}});var uD=wu.prototype,hD=wu.getSymbolSize=function(t,e){var i=t.getItemVisual(e,"symbolSize");return i instanceof Array?i.slice():[+i,+i]};uD._createSymbol=function(t,e,i,n,o){this.removeAll();var a=Jl(t,-1,-1,2,2,e.getItemVisual(i,"color"),o);a.attr({z2:100,culling:!0,scale:bu(n)}),a.drift=Su,this._symbolType=t,this.add(a)},uD.stopSymbolAnimation=function(t){this.childAt(0).stopAnimation(t)},uD.getSymbolPath=function(){return this.childAt(0)},uD.getScale=function(){return this.childAt(0).scale},uD.highlight=function(){this.childAt(0).trigger("emphasis")},uD.downplay=function(){this.childAt(0).trigger("normal")},uD.setZ=function(t,e){var i=this.childAt(0);i.zlevel=t,i.z=e},uD.setDraggable=function(t){var e=this.childAt(0);e.draggable=t,e.cursor=t?"move":"pointer"},uD.updateData=function(t,e,i){this.silent=!1;var n=t.getItemVisual(e,"symbol")||"circle",o=t.hostModel,a=hD(t,e),r=n!==this._symbolType;if(r){var s=t.getItemVisual(e,"symbolKeepAspect");this._createSymbol(n,t,e,a,s)}else(l=this.childAt(0)).silent=!1,Io(l,{scale:bu(a)},o,e);if(this._updateCommon(t,e,a,i),r){var l=this.childAt(0),u=i&&i.fadeIn,h={scale:l.scale.slice()};u&&(h.style={opacity:l.style.opacity}),l.scale=[0,0],u&&(l.style.opacity=0),To(l,h,o,e)}this._seriesModel=o};var cD=["itemStyle"],dD=["emphasis","itemStyle"],fD=["label"],pD=["emphasis","label"];uD._updateCommon=function(t,e,i,n){var o=this.childAt(0),r=t.hostModel,s=t.getItemVisual(e,"color");"image"!==o.type&&o.useStyle({strokeNoScale:!0});var l=n&&n.itemStyle,u=n&&n.hoverItemStyle,h=n&&n.symbolRotate,c=n&&n.symbolOffset,d=n&&n.labelModel,f=n&&n.hoverLabelModel,p=n&&n.hoverAnimation,g=n&&n.cursorStyle;if(!n||t.hasItemOption){var m=n&&n.itemModel?n.itemModel:t.getItemModel(e);l=m.getModel(cD).getItemStyle(["color"]),u=m.getModel(dD).getItemStyle(),h=m.getShallow("symbolRotate"),c=m.getShallow("symbolOffset"),d=m.getModel(fD),f=m.getModel(pD),p=m.getShallow("hoverAnimation"),g=m.getShallow("cursor")}else u=a({},u);var v=o.style;o.attr("rotation",(h||0)*Math.PI/180||0),c&&o.attr("position",[Vo(c[0],i[0]),Vo(c[1],i[1])]),g&&o.attr("cursor",g),o.setColor(s,n&&n.symbolInnerColor),o.setStyle(l);var y=t.getItemVisual(e,"opacity");null!=y&&(v.opacity=y);var x=t.getItemVisual(e,"liftZ"),_=o.__z2Origin;null!=x?null==_&&(o.__z2Origin=o.z2,o.z2+=x):null!=_&&(o.z2=_,o.__z2Origin=null);var w=n&&n.useNameLabel;go(v,u,d,f,{labelFetcher:r,labelDataIndex:e,defaultText:function(e,i){return w?t.getName(e):_u(t,e)},isRectText:!0,autoColor:s}),o.off("mouseover").off("mouseout").off("emphasis").off("normal"),o.hoverStyle=u,fo(o),o.__symbolOriginalScale=bu(i),p&&r.isAnimationEnabled()&&o.on("mouseover",Mu).on("mouseout",Iu).on("emphasis",Tu).on("normal",Au)},uD.fadeOut=function(t,e){var i=this.childAt(0);this.silent=i.silent=!0,!(e&&e.keepLabel)&&(i.style.text=null),Io(i,{style:{opacity:0},scale:[0,0]},this._seriesModel,this.dataIndex,t)},u(wu,tb);var gD=Du.prototype;gD.updateData=function(t,e){e=Lu(e);var i=this.group,n=t.hostModel,o=this._data,a=this._symbolCtor,r=ku(t);o||i.removeAll(),t.diff(o).add(function(n){var o=t.getItemLayout(n);if(Cu(t,o,n,e)){var s=new a(t,n,r);s.attr("position",o),t.setItemGraphicEl(n,s),i.add(s)}}).update(function(s,l){var u=o.getItemGraphicEl(l),h=t.getItemLayout(s);Cu(t,h,s,e)?(u?(u.updateData(t,s,r),Io(u,{position:h},n)):(u=new a(t,s)).attr("position",h),i.add(u),t.setItemGraphicEl(s,u)):i.remove(u)}).remove(function(t){var e=o.getItemGraphicEl(t);e&&e.fadeOut(function(){i.remove(e)})}).execute(),this._data=t},gD.isPersistent=function(){return!0},gD.updateLayout=function(){var t=this._data;t&&t.eachItemGraphicEl(function(e,i){var n=t.getItemLayout(i);e.attr("position",n)})},gD.incrementalPrepareUpdate=function(t){this._seriesScope=ku(t),this._data=null,this.group.removeAll()},gD.incrementalUpdate=function(t,e,i){i=Lu(i);for(var n=t.start;n0&&Ru(i[o-1]);o--);for(;n0&&Ru(i[a-1]);a--);for(;o=0){var r=o.getItemGraphicEl(a);if(!r){var s=o.getItemLayout(a);if(!s)return;(r=new wu(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 Ar.prototype.highlight.call(this,t,e,i,n)},downplay:function(t,e,i,n){var o=t.getData(),a=zi(o,n);if(null!=a&&a>=0){var r=o.getItemGraphicEl(a);r&&(r.__temp?(o.setItemGraphicEl(a,null),this.group.remove(r)):r.downplay())}else Ar.prototype.downplay.call(this,t,e,i,n)},_newPolyline:function(t){var e=this._polyline;return e&&this._lineGroup.remove(e),e=new MD({shape:{points:t},silent:!0,z2:10}),this._lineGroup.add(e),this._polyline=e,e},_newPolygon:function(t,e){var i=this._polygon;return i&&this._lineGroup.remove(i),i=new ID({shape:{points:t,stackedOnPoints:e},silent:!0}),this._lineGroup.add(i),this._polygon=i,i},_updateAnimation:function(t,e,i,n,o,a){var r=this._polyline,s=this._polygon,l=t.hostModel,u=mD(this._data,t,this._stackedOnPoints,e,this._coordSys,i,this._valueOrigin,a),h=u.current,c=u.stackedOnCurrent,d=u.next,f=u.stackedOnNext;o&&(h=Yu(u.current,i,o),c=Yu(u.stackedOnCurrent,i,o),d=Yu(u.next,i,o),f=Yu(u.stackedOnNext,i,o)),r.shape.__points=u.current,r.shape.points=h,Io(r,{shape:{points:d}},l),s&&(s.setShape({points:h,stackedOnPoints:c}),Io(s,{shape:{points:d,stackedOnPoints:f}},l));for(var p=[],g=u.status,m=0;me&&(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},u(kD,aD);var PD={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)"]}}},ND={};ND.categoryAxis=n({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},PD),ND.valueAxis=n({boundaryGap:[0,0],splitNumber:5},PD),ND.timeAxis=r({scale:!0,min:"dataMin",max:"dataMax"},ND.valueAxis),ND.logAxis=r({scale:!0,logBase:10},ND.valueAxis);var OD=["value","category","time","log"],ED=function(t,e,i,a){d(OD,function(r){e.extend({type:t+"Axis."+r,mergeDefaultAndTheme:function(e,o){var a=this.layoutMode,s=a?ga(e):{};n(e,o.getTheme().get(r+"Axis")),n(e,this.getDefaultOption()),e.type=i(t,e),a&&pa(e,s,a)},optionUpdated:function(){"category"===this.option.type&&(this.__ordinalMeta=_l.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:o([{},ND[r+"Axis"],a],!0)})}),lI.registerSubTypeDefaulter(t+"Axis",v(i,t))},RD=lI.extend({type:"cartesian2dAxis",axis:null,init:function(){RD.superApply(this,"init",arguments),this.resetRange()},mergeOption:function(){RD.superApply(this,"mergeOption",arguments),this.resetRange()},restoreData:function(){RD.superApply(this,"restoreData",arguments),this.resetRange()},getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"grid",index:this.option.gridIndex,id:this.option.gridId})[0]}});n(RD.prototype,UA);var zD={offset:0};ED("x",RD,th,zD),ED("y",RD,th,zD),lI.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 BD=ih.prototype;BD.type="grid",BD.axisPointerEnabled=!0,BD.getRect=function(){return this._rect},BD.update=function(t,e){var i=this._axesMap;this._updateScale(t,this.model),d(i.x,function(t){Wl(t.scale,t.model)}),d(i.y,function(t){Wl(t.scale,t.model)});var n={};d(i.x,function(t){nh(i,"y",t,n)}),d(i.y,function(t){nh(i,"x",t,n)}),this.resize(this.model,e)},BD.resize=function(t,e,i){function n(){d(a,function(t){var e=t.isHorizontal(),i=e?[0,o.width]:[0,o.height],n=t.inverse?1:0;t.setExtent(i[n],i[1-n]),ah(t,e?o.x:o.y)})}var o=ca(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()});this._rect=o;var a=this._axesList;n(),!i&&t.get("containLabel")&&(d(a,function(t){if(!t.model.get("axisLabel.inside")){var e=jl(t);if(e){var i=t.isHorizontal()?"height":"width",n=t.model.get("axisLabel.margin");o[i]-=e[i]+n,"top"===t.position?o.y+=e.height+n:"left"===t.position&&(o.x+=e.width+n)}}}),n())},BD.getAxis=function(t,e){var i=this._axesMap[t];if(null!=i){if(null==e)for(var n in i)if(i.hasOwnProperty(n))return i[n];return i[e]}},BD.getAxes=function(){return this._axesList.slice()},BD.getCartesian=function(t,e){if(null!=t&&null!=e){var i="x"+t+"y"+e;return this._coordsMap[i]}w(t)&&(e=t.yAxisIndex,t=t.xAxisIndex);for(var n=0,o=this._coordsList;nu[1]?-1:1,c=["start"===o?u[0]-h*l:"end"===o?u[1]+h*l:(u[0]+u[1])/2,ph(o)?t.labelOffset+r*l:0],d=e.get("nameRotate");null!=d&&(d=d*GD/180);var f;ph(o)?n=HD(t.rotation,null!=d?d:t.rotation,r):(n=uh(t,o,d||0,u),null!=(f=t.axisNameAvailableWidth)&&(f=Math.abs(f/Math.sin(n.rotation)),!isFinite(f)&&(f=null)));var p=s.getFont(),g=e.get("nameTruncate",!0)||{},m=g.ellipsis,v=T(t.nameTruncateMaxWidth,g.maxWidth,f),y=null!=m&&null!=v?tI(i,v,p,m,{minChar:2,placeholder:g.placeholder}):i,x=e.get("tooltip",!0),_=e.mainType,w={componentType:_,name:i,$vars:["name"]};w[_+"Index"]=e.componentIndex;var b=new rM({anid:"name",__fullText:i,__truncatedText:y,position:c,rotation:n.rotation,silent:hh(e),z2:1,tooltip:x&&x.show?a({content:i,formatter:function(){return i},formatterParams:w},x):null});mo(b.style,s,{text:y,textFont:p,textFill:s.getTextColor()||e.get("axisLine.lineStyle.color"),textAlign:n.textAlign,textVerticalAlign:n.textVerticalAlign}),e.get("triggerEvent")&&(b.eventData=lh(e),b.eventData.targetType="axisName",b.eventData.name=i),this._dumbGroup.add(b),b.updateTransform(),this.group.add(b),b.decomposeTransform()}}},HD=FD.innerTextLayout=function(t,e,i){var n,o,a=Xo(e-t);return jo(a)?(o=i>0?"top":"bottom",n="center"):jo(a-GD)?(o=i>0?"bottom":"top",n="center"):(o="middle",n=a>0&&a0?"right":"left":i>0?"left":"right"),{rotation:a,textAlign:n,textVerticalAlign:o}},ZD=d,UD=v,XD=Ws({type:"axis",_axisPointer:null,axisPointerClass:null,render:function(t,e,i,n){this.axisPointerClass&&Sh(t),XD.superApply(this,"render",arguments),Dh(this,t,0,i,0,!0)},updateAxisPointer:function(t,e,i,n,o){Dh(this,t,0,i,0,!1)},remove:function(t,e){var i=this._axisPointer;i&&i.remove(e),XD.superApply(this,"remove",arguments)},dispose:function(t,e){Ch(this,e),XD.superApply(this,"dispose",arguments)}}),jD=[];XD.registerAxisPointerClass=function(t,e){jD[t]=e},XD.getAxisPointerClass=function(t){return t&&jD[t]};var YD=["axisLine","axisTickLabel","axisName"],qD=["splitArea","splitLine"],KD=XD.extend({type:"cartesianAxis",axisPointerClass:"CartesianAxisPointer",render:function(t,e,i,n){this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new tb,this.group.add(this._axisGroup),t.get("show")){var a=t.getCoordSysModel(),r=Lh(a,t),s=new FD(t,r);d(YD,s.add,s),this._axisGroup.add(s.getGroup()),d(qD,function(e){t.get(e+".show")&&this["_"+e](t,a)},this),Lo(o,this._axisGroup,t),KD.superCall(this,"render",t,e,i,n)}},remove:function(){this._splitAreaColors=null},_splitLine:function(t,e){var i=t.axis;if(!i.scale.isBlank()){var n=t.getModel("splitLine"),o=n.getModel("lineStyle"),a=o.get("color");a=y(a)?a:[a];for(var s=e.coordinateSystem.getRect(),l=i.isHorizontal(),u=0,h=i.getTicksCoords({tickModel:n}),c=[],d=[],f=o.getLineStyle(),p=0;p1){var c;"string"==typeof o?c=DD[o]:"function"==typeof o&&(c=o),c&&t.setData(n.downSample(n.mapDimension(s.dim),1/h,c,CD))}}}}}("line"));var $D=YI.extend({type:"series.__base_bar__",getInitialData:function(t,e){return ml(this.getSource(),this)},getMarkerPosition:function(t){var e=this.coordinateSystem;if(e){var i=e.dataToPoint(e.clampData(t)),n=this.getData(),o=n.getLayout("offset"),a=n.getLayout("size");return i[e.getBaseAxis().isHorizontal()?0:1]+=o+a/2,i}return[NaN,NaN]},defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod",itemStyle:{},emphasis:{}}});$D.extend({type:"series.bar",dependencies:["grid","polar"],brushSelector:"rect",getProgressive:function(){return!!this.get("large")&&this.get("progressive")},getProgressiveThreshold:function(){var t=this.get("progressiveThreshold"),e=this.get("largeThreshold");return e>t&&(t=e),t}});var JD=Qb([["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["stroke","barBorderColor"],["lineWidth","barBorderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),QD={getBarItemStyle:function(t){var e=JD(this,t);if(this.getBorderLineDash){var i=this.getBorderLineDash();i&&(e.lineDash=i)}return e}},tC=["itemStyle","barBorderWidth"];a(No.prototype,QD),Zs({type:"bar",render:function(t,e,i){this._updateDrawMode(t);var n=t.get("coordinateSystem");return"cartesian2d"!==n&&"polar"!==n||(this._isLargeDraw?this._renderLarge(t,e,i):this._renderNormal(t,e,i)),this.group},incrementalPrepareRender:function(t,e,i){this._clear(),this._updateDrawMode(t)},incrementalRender:function(t,e,i,n){this._incrementalRenderLarge(t,e)},_updateDrawMode:function(t){var e=t.pipelineContext.large;(null==this._isLargeDraw||e^this._isLargeDraw)&&(this._isLargeDraw=e,this._clear())},_renderNormal:function(t,e,i){var n,o=this.group,a=t.getData(),r=this._data,s=t.coordinateSystem,l=s.getBaseAxis();"cartesian2d"===s.type?n=l.isHorizontal():"polar"===s.type&&(n="angle"===l.dim);var u=t.isAnimationEnabled()?t:null;a.diff(r).add(function(e){if(a.hasValue(e)){var i=a.getItemModel(e),r=iC[s.type](a,e,i),l=eC[s.type](a,e,i,r,n,u);a.setItemGraphicEl(e,l),o.add(l),Eh(l,a,e,i,r,t,n,"polar"===s.type)}}).update(function(e,i){var l=r.getItemGraphicEl(i);if(a.hasValue(e)){var h=a.getItemModel(e),c=iC[s.type](a,e,h);l?Io(l,{shape:c},u,e):l=eC[s.type](a,e,h,c,n,u,!0),a.setItemGraphicEl(e,l),o.add(l),Eh(l,a,e,h,c,t,n,"polar"===s.type)}else o.remove(l)}).remove(function(t){var e=r.getItemGraphicEl(t);"cartesian2d"===s.type?e&&Nh(t,u,e):e&&Oh(t,u,e)}).execute(),this._data=a},_renderLarge:function(t,e,i){this._clear(),zh(t,this.group)},_incrementalRenderLarge:function(t,e){zh(e,this.group,!0)},dispose:B,remove:function(t){this._clear(t)},_clear:function(t){var e=this.group,i=this._data;t&&t.get("animation")&&i&&!this._isLargeDraw?i.eachItemGraphicEl(function(e){"sector"===e.type?Oh(e.dataIndex,t,e):Nh(e.dataIndex,t,e)}):e.removeAll(),this._data=null}});var eC={cartesian2d:function(t,e,i,n,o,r,s){var l=new yM({shape:a({},n)});if(r){var u=l.shape,h=o?"height":"width",c={};u[h]=0,c[h]=n[h],zM[s?"updateProps":"initProps"](l,{shape:c},r,e)}return l},polar:function(t,e,i,n,o,a,s){var l=n.startAngle0?1:-1,r=n.height>0?1:-1;return{x:n.x+a*o/2,y:n.y+r*o/2,width:n.width-a*o,height:n.height-r*o}},polar:function(t,e,i){var n=t.getItemLayout(e);return{cx:n.cx,cy:n.cy,r0:n.r0,r:n.r,startAngle:n.startAngle,endAngle:n.endAngle}}},nC=Pn.extend({type:"largeBar",shape:{points:[]},buildPath:function(t,e){for(var i=e.points,n=this.__startPoint,o=this.__valueIdx,a=0;a0&&"scale"!==u){var d=o.getItemLayout(0),f=Math.max(i.getWidth(),i.getHeight())/2,p=m(r.removeClipPath,r);r.setClipPath(this._createClipPath(d.cx,d.cy,f,d.startAngle,d.clockwise,p,t))}else r.removeClipPath();this._data=o}},dispose:function(){},_createClipPath:function(t,e,i,n,o,a,r){var s=new hM({shape:{cx:t,cy:e,r0:0,r:i,startAngle:n,endAngle:n,clockwise:o}});return To(s,{shape:{endAngle:n+(o?1:-1)*Math.PI*2}},r,a),s},containPoint:function(t,e){var i=e.getData().getItemLayout(0);if(i){var n=t[0]-i.cx,o=t[1]-i.cy,a=Math.sqrt(n*n+o*o);return a<=i.r&&a>=i.r0}}});var lC=function(t,e){d(e,function(e){e.update="updateView",Es(e,function(i,n){var o={};return n.eachComponent({mainType:"series",subType:t,query:i},function(t){t[e.method]&&t[e.method](i.name,i.dataIndex);var n=t.getData();n.each(function(e){var i=n.getName(e);o[i]=t.isSelected(i)||!1})}),{name:i.name,selected:o}})})},uC=function(t){return{getTargetSeries:function(e){var i={},n=R();return e.eachSeriesByType(t,function(t){t.__paletteScope=i,n.set(t.uid,t)}),n},reset:function(t,e){var i=t.getRawData(),n={},o=t.getData();o.each(function(t){var e=o.getRawIndex(t);n[e]=t}),i.each(function(e){var a=n[e],r=null!=a&&o.getItemVisual(a,"color",!0);if(r)i.setItemVisual(e,"color",r);else{var s=i.getItemModel(e).get("itemStyle.color")||t.getColorFromPalette(i.getName(e)||e+"",t.__paletteScope,i.count());i.setItemVisual(e,"color",s),null!=a&&o.setItemVisual(a,"color",s)}})}}},hC=function(t,e,i,n){var o,a,r=t.getData(),s=[],l=!1;r.each(function(i){var n,u,h,c,d=r.getItemLayout(i),f=r.getItemModel(i),p=f.getModel("label"),g=p.get("position")||f.get("emphasis.label.position"),m=f.getModel("labelLine"),v=m.get("length"),y=m.get("length2"),x=(d.startAngle+d.endAngle)/2,_=Math.cos(x),w=Math.sin(x);o=d.cx,a=d.cy;var b="inside"===g||"inner"===g;if("center"===g)n=d.cx,u=d.cy,c="center";else{var S=(b?(d.r+d.r0)/2*_:d.r*_)+o,M=(b?(d.r+d.r0)/2*w:d.r*w)+a;if(n=S+3*_,u=M+3*w,!b){var I=S+_*(v+e-d.r),T=M+w*(v+e-d.r),A=I+(_<0?-1:1)*y,D=T;n=A+(_<0?-5:5),u=D,h=[[S,M],[I,T],[A,D]]}c=b?"center":_>0?"left":"right"}var C=p.getFont(),L=p.get("rotate")?_<0?-x+Math.PI:-x:0,k=ke(t.getFormattedLabel(i,"normal")||r.getName(i),C,c,"top");l=!!L,d.label={x:n,y:u,position:g,height:k.height,len:v,len2:y,linePoints:h,textAlign:c,verticalAlign:"middle",rotation:L,inside:b},b||s.push(d.label)}),!l&&t.get("avoidLabelOverlap")&&Hh(s,o,a,e,i,n)},cC=2*Math.PI,dC=Math.PI/180,fC=function(t){return{seriesType:t,reset:function(t,e){var i=e.findComponents({mainType:"legend"});if(i&&i.length){var n=t.getData();n.filterSelf(function(t){for(var e=n.getName(t),o=0;o=0;s--){var l=2*s,u=n[l]-a/2,h=n[l+1]-r/2;if(t>=u&&e>=h&&t<=u+a&&e<=h+r)return s}return-1}}),gC=Uh.prototype;gC.isPersistent=function(){return!this._incremental},gC.updateData=function(t){this.group.removeAll();var e=new pC({rectHover:!0,cursor:"default"});e.setShape({points:t.getLayout("symbolPoints")}),this._setCommon(e,t),this.group.add(e),this._incremental=null},gC.updateLayout=function(t){if(!this._incremental){var e=t.getLayout("symbolPoints");this.group.eachChild(function(t){if(null!=t.startIndex){var i=2*(t.endIndex-t.startIndex),n=4*t.startIndex*2;e=new Float32Array(e.buffer,n,i)}t.setShape("points",e)})}},gC.incrementalPrepareUpdate=function(t){this.group.removeAll(),this._clearIncremental(),t.count()>2e6?(this._incremental||(this._incremental=new Zn({silent:!0})),this.group.add(this._incremental)):this._incremental=null},gC.incrementalUpdate=function(t,e){var i;this._incremental?(i=new pC,this._incremental.addDisplayable(i,!0)):((i=new pC({rectHover:!0,cursor:"default",startIndex:t.start,endIndex:t.end})).incremental=!0,this.group.add(i)),i.setShape({points:e.getLayout("symbolPoints")}),this._setCommon(i,e,!!this._incremental)},gC._setCommon=function(t,e,i){var n=e.hostModel,o=e.getVisual("symbolSize");t.setShape("size",o instanceof Array?o:[o,o]),t.symbolProxy=Jl(e.getVisual("symbol"),0,0,0,0),t.setColor=t.symbolProxy.setColor;var a=t.shape.size[0]<4;t.useStyle(n.getModel("itemStyle").getItemStyle(a?["color","shadowBlur","shadowColor"]:["color"]));var r=e.getVisual("color");r&&t.setColor(r),i||(t.seriesIndex=n.seriesIndex,t.on("mousemove",function(e){t.dataIndex=null;var i=t.findDataIndex(e.offsetX,e.offsetY);i>=0&&(t.dataIndex=i+(t.startIndex||0))}))},gC.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},gC._clearIncremental=function(){var t=this._incremental;t&&t.clearDisplaybles()},Zs({type:"scatter",render:function(t,e,i){var n=t.getData();this._updateSymbolDraw(n,t).updateData(n),this._finished=!0},incrementalPrepareRender:function(t,e,i){var n=t.getData();this._updateSymbolDraw(n,t).incrementalPrepareUpdate(n),this._finished=!1},incrementalRender:function(t,e,i){this._symbolDraw.incrementalUpdate(t,e.getData()),this._finished=t.end===e.getData().count()},updateTransform:function(t,e,i){var n=t.getData();if(this.group.dirty(),!this._finished||n.count()>1e4||!this._symbolDraw.isPersistent())return{update:!0};var o=AD().reset(t);o.progress&&o.progress({start:0,end:n.count()},n),this._symbolDraw.updateLayout(n)},_updateSymbolDraw:function(t,e){var i=this._symbolDraw,n=e.pipelineContext.large;return i&&n===this._isLargeDraw||(i&&i.remove(),i=this._symbolDraw=n?new Uh:new Du,this._isLargeDraw=n,this.group.removeAll()),this.group.add(i.group),i},remove:function(t,e){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},dispose:function(){}}),Bs(TD("scatter","circle")),zs(AD("scatter")),u(Xh,aD),jh.prototype.getIndicatorAxes=function(){return this._indicatorAxes},jh.prototype.dataToPoint=function(t,e){var i=this._indicatorAxes[e];return this.coordToPoint(i.dataToCoord(t),e)},jh.prototype.coordToPoint=function(t,e){var i=this._indicatorAxes[e].angle;return[this.cx+t*Math.cos(i),this.cy-t*Math.sin(i)]},jh.prototype.pointToData=function(t){var e=t[0]-this.cx,i=t[1]-this.cy,n=Math.sqrt(e*e+i*i);e/=n,i/=n;for(var o,a=Math.atan2(-i,e),r=1/0,s=-1,l=0;ln[0]&&isFinite(c)&&isFinite(n[0]))}else{r.getTicks().length-1>a&&(u=i(u));var d=Math.round((n[0]+n[1])/2/u)*u,f=Math.round(a/2);r.setExtent(Go(d-f*u),Go(d+(a-f)*u)),r.setInterval(u)}})},jh.dimensions=[],jh.create=function(t,e){var i=[];return t.eachComponent("radar",function(n){var o=new jh(n,t,e);i.push(o),n.coordinateSystem=o}),t.eachSeriesByType("radar",function(t){"radar"===t.get("coordinateSystem")&&(t.coordinateSystem=i[t.get("radarIndex")||0])}),i},Fa.register("radar",jh);var mC=ND.valueAxis,vC=(Fs({type:"radar",optionUpdated:function(){var t=this.get("boundaryGap"),e=this.get("splitNumber"),o=this.get("scale"),s=this.get("axisLine"),l=this.get("axisTick"),u=this.get("axisLabel"),h=this.get("name"),c=this.get("name.show"),d=this.get("name.formatter"),p=this.get("nameGap"),g=this.get("triggerEvent"),m=f(this.get("indicator")||[],function(f){null!=f.max&&f.max>0&&!f.min?f.min=0:null!=f.min&&f.min<0&&!f.max&&(f.max=0);var m=h;if(null!=f.color&&(m=r({color:f.color},h)),f=n(i(f),{boundaryGap:t,splitNumber:e,scale:o,axisLine:s,axisTick:l,axisLabel:u,name:f.text,nameLocation:"end",nameGap:p,nameTextStyle:m,triggerEvent:g},!1),c||(f.name=""),"string"==typeof d){var v=f.name;f.name=d.replace("{value}",null!=v?v:"")}else"function"==typeof d&&(f.name=d(f.name,f));var y=a(new No(f,null,this.ecModel),UA);return y.mainType="radar",y.componentIndex=this.componentIndex,y},this);this.getIndicatorModels=function(){return m}},defaultOption:{zlevel:0,z:0,center:["50%","50%"],radius:"75%",startAngle:90,name:{show:!0},boundaryGap:[0,0],splitNumber:5,nameGap:15,scale:!1,shape:"polygon",axisLine:n({lineStyle:{color:"#bbb"}},mC.axisLine),axisLabel:Yh(mC.axisLabel,!1),axisTick:Yh(mC.axisTick,!1),splitLine:Yh(mC.splitLine,!0),splitArea:Yh(mC.splitArea,!0),indicator:[]}}),["axisLine","axisTickLabel","axisName"]);Ws({type:"radar",render:function(t,e,i){this.group.removeAll(),this._buildAxes(t),this._buildSplitLineAndArea(t)},_buildAxes:function(t){var e=t.coordinateSystem;d(f(e.getIndicatorAxes(),function(t){return new FD(t.model,{position:[e.cx,e.cy],rotation:t.angle,labelDirection:-1,tickDirection:-1,nameDirection:1})}),function(t){d(vC,t.add,t),this.group.add(t.getGroup())},this)},_buildSplitLineAndArea:function(t){function e(t,e,i){var n=i%e.length;return t[n]=t[n]||[],n}var i=t.coordinateSystem,n=i.getIndicatorAxes();if(n.length){var o=t.get("shape"),a=t.getModel("splitLine"),s=t.getModel("splitArea"),l=a.getModel("lineStyle"),u=s.getModel("areaStyle"),h=a.get("show"),c=s.get("show"),p=l.get("color"),g=u.get("color");p=y(p)?p:[p],g=y(g)?g:[g];var m=[],v=[];if("circle"===o)for(var x=n[0].getTicksCoords(),_=i.cx,w=i.cy,b=0;b"+f(i,function(i,n){var o=e.get(e.mapDimension(i.dim),t);return ia(i.name+" : "+o)}).join("
")},defaultOption:{zlevel:0,z:2,coordinateSystem:"radar",legendHoverLink:!0,radarIndex:0,lineStyle:{width:2,type:"solid"},label:{position:"top"},symbol:"emptyCircle",symbolSize:4}});Zs({type:"radar",render:function(t,e,n){function o(t,e){var i=t.getItemVisual(e,"symbol")||"circle",n=t.getItemVisual(e,"color");if("none"!==i){var o=qh(t.getItemVisual(e,"symbolSize")),a=Jl(i,-1,-1,2,2,n);return a.attr({style:{strokeNoScale:!0},z2:100,scale:[o[0]/2,o[1]/2]}),a}}function a(e,i,n,a,r,s){n.removeAll();for(var l=0;l"+ia(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)"}}}}),aC);var EC="\0_ec_interaction_mutex";Es({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},function(){}),h(oc,fw);var RC={axisPointer:1,tooltip:1,brush:1};xc.prototype={constructor:xc,draw:function(t,e,i,n,o){var a="geo"===t.mainType,r=t.getData&&t.getData();a&&e.eachComponent({mainType:"series",subType:"map"},function(e){r||e.getHostGeoModel()!==t||(r=e.getData())});var s=t.coordinateSystem;this._updateBackground(s);var l=this._regionsGroup,u=this.group,h=s.scale,c={position:s.position,scale:h};!l.childAt(0)||o?u.attr(c):Io(u,c,t),l.removeAll();var f=["itemStyle"],p=["emphasis","itemStyle"],g=["label"],m=["emphasis","label"],v=R();d(s.regions,function(e){var i=v.get(e.name)||v.set(e.name,new tb),n=new MM({shape:{paths:[]}});i.add(n);var o,s=(C=t.getRegionModel(e.name)||t).getModel(f),u=C.getModel(p),c=mc(s),y=mc(u),x=C.getModel(g),_=C.getModel(m);if(r){o=r.indexOfName(e.name);var w=r.getItemVisual(o,"color",!0);w&&(c.fill=w)}d(e.geometries,function(t){if("polygon"===t.type){n.shape.paths.push(new pM({shape:{points:t.exterior}}));for(var e=0;e<(t.interiors?t.interiors.length:0);e++)n.shape.paths.push(new pM({shape:{points:t.interiors[e]}}))}}),n.setStyle(c),n.style.strokeNoScale=!0,n.culling=!0;var b=x.get("show"),S=_.get("show"),M=r&&isNaN(r.get(r.mapDimension("value"),o)),I=r&&r.getItemLayout(o);if(a||M&&(b||S)||I&&I.showLabel){var T,A=a?e.name:o;(!r||o>=0)&&(T=t);var D=new rM({position:e.center.slice(),scale:[1/h[0],1/h[1]],z2:10,silent:!0});go(D.style,D.hoverStyle={},x,_,{labelFetcher:T,labelDataIndex:A,defaultText:e.name,useInsideStyle:!1},{textAlign:"center",textVerticalAlign:"middle"}),i.add(D)}if(r)r.setItemGraphicEl(o,i);else{var C=t.getRegionModel(e.name);n.eventData={componentType:"geo",componentIndex:t.componentIndex,geoIndex:t.componentIndex,name:e.name,region:C&&C.option||{}}}(i.__regions||(i.__regions=[])).push(e),fo(i,y,{hoverSilentOnTouch:!!t.get("selectedMode")}),l.add(i)}),this._updateController(t,e,i),vc(this,t,l,i,n),yc(t,l)},remove:function(){this._regionsGroup.removeAll(),this._backgroundGroup.removeAll(),this._controller.dispose(),this._mapName&&OC.removeGraphic(this._mapName,this.uid),this._mapName=null,this._controllerHost={}},_updateBackground:function(t){var e=t.map;this._mapName!==e&&d(OC.makeGraphic(e,this.uid),function(t){this._backgroundGroup.add(t)},this),this._mapName=e},_updateController:function(t,e,i){function n(){var e={type:"geoRoam",componentType:l};return e[l+"Id"]=t.id,e}var o=t.coordinateSystem,r=this._controller,s=this._controllerHost;s.zoomLimit=t.get("scaleLimit"),s.zoom=o.getZoom(),r.enable(t.get("roam")||!1);var l=t.mainType;r.off("pan").on("pan",function(t){this._mouseDownFlag=!1,fc(s,t.dx,t.dy),i.dispatchAction(a(n(),{dx:t.dx,dy:t.dy}))},this),r.off("zoom").on("zoom",function(t){if(this._mouseDownFlag=!1,pc(s,t.scale,t.originX,t.originY),i.dispatchAction(a(n(),{zoom:t.scale,originX:t.originX,originY:t.originY})),this._updateGroup){var e=this.group.scale;this._regionsGroup.traverse(function(t){"text"===t.type&&t.attr("scale",[1/e[0],1/e[1]])})}},this),r.setPointerChecker(function(e,n,a){return o.getViewRectAfterRoam().contain(n,a)&&!gc(e,i,t)})}};var zC="__seriesMapHighDown",BC="__seriesMapCallKey";Zs({type:"map",render:function(t,e,i,n){if(!n||"mapToggleSelect"!==n.type||n.from!==this.uid){var o=this.group;if(o.removeAll(),!t.getHostGeoModel()){if(n&&"geoRoam"===n.type&&"series"===n.componentType&&n.seriesId===t.id)(a=this._mapDraw)&&o.add(a.group);else if(t.needsDrawMap){var a=this._mapDraw||new xc(i,!0);o.add(a.group),a.draw(t,e,i,this,n),this._mapDraw=a}else this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null;t.get("showLegendSymbol")&&e.getComponent("legend")&&this._renderSymbols(t,e,i)}}},remove:function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null,this.group.removeAll()},dispose:function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null},_renderSymbols:function(t,e,i){var n=t.originalData,o=this.group;n.each(n.mapDimension("value"),function(e,i){if(!isNaN(e)){var r=n.getItemLayout(i);if(r&&r.point){var s=r.point,l=r.offset,u=new sM({style:{fill:t.getData().getVisual("color")},shape:{cx:s[0]+9*l,cy:s[1],r:3},silent:!0,z2:8+(l?0:NM+1)});if(!l){var h=t.mainSeries.getData(),c=n.getName(i),d=h.indexOfName(c),f=n.getItemModel(i),p=f.getModel("label"),g=f.getModel("emphasis.label"),m=h.getItemGraphicEl(d),y=A(t.getFormattedLabel(d,"normal"),c),x=A(t.getFormattedLabel(d,"emphasis"),y),_=m[zC],w=Math.random();if(!_){_=m[zC]={};var b=v(_c,!0),S=v(_c,!1);m.on("mouseover",b).on("mouseout",S).on("emphasis",b).on("normal",S)}m[BC]=w,a(_,{recordVersion:w,circle:u,labelModel:p,hoverLabelModel:g,emphasisText:x,normalText:y}),wc(_,!1)}o.add(u)}}})}}),Es({type:"geoRoam",event:"geoRoam",update:"updateTransform"},function(t,e){var i=t.componentType||"series";e.eachComponent({mainType:i,query:t},function(e){var n=e.coordinateSystem;if("geo"===n.type){var o=bc(n,t,e.get("scaleLimit"));e.setCenter&&e.setCenter(o.center),e.setZoom&&e.setZoom(o.zoom),"series"===i&&d(e.seriesGroup,function(t){t.setCenter(o.center),t.setZoom(o.zoom)})}})});var VC=Q;h(Sc,Tw),Mc.prototype={constructor:Mc,type:"view",dimensions:["x","y"],setBoundingRect:function(t,e,i,n){return this._rect=new de(t,e,i,n),this._rect},getBoundingRect:function(){return this._rect},setViewRect:function(t,e,i,n){this.transformTo(t,e,i,n),this._viewRect=new de(t,e,i,n)},transformTo:function(t,e,i,n){var o=this.getBoundingRect(),a=this._rawTransformable;a.transform=o.calculateTransform(new de(t,e,i,n)),a.decomposeTransform(),this._updateTransform()},setCenter:function(t){t&&(this._center=t,this._updateCenterAndZoom())},setZoom:function(t){t=t||1;var e=this.zoomLimit;e&&(null!=e.max&&(t=Math.min(e.max,t)),null!=e.min&&(t=Math.max(e.min,t))),this._zoom=t,this._updateCenterAndZoom()},getDefaultCenter:function(){var t=this.getBoundingRect();return[t.x+t.width/2,t.y+t.height/2]},getCenter:function(){return this._center||this.getDefaultCenter()},getZoom:function(){return this._zoom||1},getRoamTransform:function(){return this._roamTransformable.getLocalTransform()},_updateCenterAndZoom:function(){var t=this._rawTransformable.getLocalTransform(),e=this._roamTransformable,i=this.getDefaultCenter(),n=this.getCenter(),o=this.getZoom();n=Q([],n,t),i=Q([],i,t),e.origin=n,e.position=[i[0]-n[0],i[1]-n[1]],e.scale=[o,o],this._updateTransform()},_updateTransform:function(){var t=this._roamTransformable,e=this._rawTransformable;e.parent=t,t.updateTransform(),e.updateTransform(),wt(this.transform||(this.transform=[]),e.transform||xt()),this._rawTransform=e.getLocalTransform(),this.invTransform=this.invTransform||[],Tt(this.invTransform,this.transform),this.decomposeTransform()},getViewRect:function(){return this._viewRect},getViewRectAfterRoam:function(){var t=this.getBoundingRect().clone();return t.applyTransform(this.transform),t},dataToPoint:function(t,e,i){var n=e?this._rawTransform:this.transform;return i=i||[],n?VC(i,t,n):G(i,t)},pointToData:function(t){var e=this.invTransform;return e?VC([],t,e):[t[0],t[1]]},convertToPixel:v(Ic,"dataToPoint"),convertFromPixel:v(Ic,"pointToData"),containPoint:function(t){return this.getViewRectAfterRoam().contain(t[0],t[1])}},h(Mc,Tw),Tc.prototype={constructor:Tc,type:"geo",dimensions:["lng","lat"],containCoord:function(t){for(var e=this.regions,i=0;ie&&(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;e=0&&this.hostTree.data.setItemLayout(this.dataIndex,t,e)},getLayout:function(){return this.hostTree.data.getItemLayout(this.dataIndex)},getModel:function(t){if(!(this.dataIndex<0)){var e,i=this.hostTree,n=i.data.getItemModel(this.dataIndex),o=this.getLevelModel();return o||0!==this.children.length&&(0===this.children.length||!1!==this.isExpand)||(e=this.getLeavesModel()),n.getModel(t,(o||e||i.hostModel).getModel(t))}},getLevelModel:function(){return(this.hostTree.levelModels||[])[this.depth]},getLeavesModel:function(){return this.hostTree.leavesModel},setVisual:function(t,e){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,t,e)},getVisual:function(t,e){return this.hostTree.data.getItemVisual(this.dataIndex,t,e)},getRawIndex:function(){return this.hostTree.data.getRawIndex(this.dataIndex)},getId:function(){return this.hostTree.data.getId(this.dataIndex)},isAncestorOf:function(t){for(var e=t.parentNode;e;){if(e===this)return!0;e=e.parentNode}return!1},isDescendantOf:function(t){return t!==this&&t.isAncestorOf(this)}},Vc.prototype={constructor:Vc,type:"tree",eachNode:function(t,e,i){this.root.eachNode(t,e,i)},getNodeByDataIndex:function(t){var e=this.data.getRawIndex(t);return this._nodes[e]},getNodeByName:function(t){return this.root.getNodeByName(t)},update:function(){for(var t=this.data,e=this._nodes,i=0,n=e.length;ia&&(a=t.depth)});var r=t.expandAndCollapse&&t.initialTreeDepth>=0?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 ia(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}}),Zs({type:"tree",init:function(t,e){this._oldTree,this._mainGroup=new tb,this._controller=new oc(e.getZr()),this._controllerHost={target:this.group},this.group.add(this._mainGroup)},render:function(t,e,i,n){var o=t.getData(),a=t.layoutInfo,r=this._mainGroup,s=t.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(t),this._updateController(t,e,i);var l=this._data,u={expandAndCollapse:t.get("expandAndCollapse"),layout:s,orient:t.getOrient(),curvature:t.get("lineStyle.curveness"),symbolRotate:t.get("symbolRotate"),symbolOffset:t.get("symbolOffset"),hoverAnimation:t.get("hoverAnimation"),useNameLabel:!0,fadeIn:!0};o.diff(l).add(function(e){td(o,e)&&id(o,e,null,r,t,u)}).update(function(e,i){var n=l.getItemGraphicEl(i);td(o,e)?id(o,e,n,r,t,u):n&&nd(l,i,n,r,t,u)}).remove(function(e){var i=l.getItemGraphicEl(e);i&&nd(l,e,i,r,t,u)}).execute(),this._nodeScaleRatio=t.get("nodeScaleRatio"),this._updateNodeAndLinkScale(t),!0===u.expandAndCollapse&&o.eachItemGraphicEl(function(e,n){e.off("click").on("click",function(){i.dispatchAction({type:"treeExpandAndCollapse",seriesId:t.id,dataIndex:n})})}),this._data=o},_updateViewCoordSys:function(t){var e=t.getData(),i=[];e.each(function(t){var n=e.getItemLayout(t);!n||isNaN(n.x)||isNaN(n.y)||i.push([+n.x,+n.y])});var n=[],o=[];fn(i,n,o),o[0]-n[0]==0&&(o[0]+=1,n[0]-=1),o[1]-n[1]==0&&(o[1]+=1,n[1]-=1);var a=t.coordinateSystem=new Mc;a.zoomLimit=t.get("scaleLimit"),a.setBoundingRect(n[0],n[1],o[0]-n[0],o[1]-n[1]),a.setCenter(t.get("center")),a.setZoom(t.get("zoom")),this.group.attr({position:a.position,scale:a.scale}),this._viewCoordSys=a},_updateController:function(t,e,i){var n=this._controller,o=this._controllerHost,a=this.group;n.setPointerChecker(function(e,n,o){var r=a.getBoundingRect();return r.applyTransform(a.transform),r.contain(n,o)&&!gc(e,i,t)}),n.enable(t.get("roam")),o.zoomLimit=t.get("scaleLimit"),o.zoom=t.coordinateSystem.getZoom(),n.off("pan").off("zoom").on("pan",function(e){fc(o,e.dx,e.dy),i.dispatchAction({seriesId:t.id,type:"treeRoam",dx:e.dx,dy:e.dy})},this).on("zoom",function(e){pc(o,e.scale,e.originX,e.originY),i.dispatchAction({seriesId:t.id,type:"treeRoam",zoom:e.scale,originX:e.originX,originY:e.originY}),this._updateNodeAndLinkScale(t)},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}}),Es({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(t,e){e.eachComponent({mainType:"series",subType:"tree",query:t},function(e){var i=t.dataIndex,n=e.getData().tree.getNodeByDataIndex(i);n.isExpand=!n.isExpand})}),Es({type:"treeRoam",event:"treeRoam",update:"none"},function(t,e){e.eachComponent({mainType:"series",subType:"tree",query:t},function(e){var i=bc(e.coordinateSystem,t);e.setCenter&&e.setCenter(i.center),e.setZoom&&e.setZoom(i.zoom)})});Bs(TD("tree","circle")),zs(function(t,e){t.eachSeriesByType("tree",function(t){sd(t,e)})}),YI.extend({type:"series.treemap",layoutMode:"box",dependencies:["grid","polar"],_viewRoot:null,defaultOption:{progressive:0,hoverLayerThreshold:1/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};dd(i);var n=t.levels||[];n=t.levels=fd(n,e);var o={};return o.levels=n,Vc.createTree(i,this,o).data},optionUpdated:function(){this.resetViewRoot()},formatTooltip:function(t){var e=this.getData(),i=this.getRawValue(t),n=ta(y(i)?i[0]:i);return ia(e.getName(t)+": "+n)},getDataParams:function(t){var e=YI.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return e.treePathInfo=cd(i,this),e},setLayoutInfo:function(t){this.layoutInfo=this.layoutInfo||{},a(this.layoutInfo,t)},mapIdToIndex:function(t){var e=this._idIndexMap;e||(e=this._idIndexMap=R(),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 UC=5;pd.prototype={constructor:pd,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),da(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=0,s=e.emptyItemWidth,l=t.get("breadcrumb.height"),u=ha(e.pos,e.box),h=e.totalWidth,c=e.renderList,d=c.length-1;d>=0;d--){var f=c[d],p=f.node,g=f.width,m=f.text;h>u.width&&(h-=g-s,g=s,m=null);var y=new pM({shape:{points:gd(a,0,g,l,d===c.length-1,0===d)},style:r(i.getItemStyle(),{lineJoin:"bevel",text:m,textFill:n.getTextColor(),textFont:n.getFont()}),z:10,onclick:v(o,p)});this.group.add(y),md(y,t,p),a+=g+8}},remove:function(){this.group.removeAll()}};var XC=m,jC=tb,YC=yM,qC=d,KC=["label"],$C=["emphasis","label"],JC=["upperLabel"],QC=["emphasis","upperLabel"],tL=10,eL=1,iL=2,nL=Qb([["fill","color"],["stroke","strokeColor"],["lineWidth","strokeWidth"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),oL=function(t){var e=nL(t);return e.stroke=e.fill=e.lineWidth=null,e};Zs({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(!(l(e.findComponents({mainType:"series",subType:"treemap",query:n}),t)<0)){this.seriesModel=t,this.api=i,this.ecModel=e;var o=ld(n,["treemapZoomToNode","treemapRootToNode"],t),a=n&&n.type,r=t.layoutInfo,s=!this._oldTree,u=this._storage,h="treemapRootToNode"===a&&o&&u?{rootNodeGroup:u.nodeGroup[o.node.getRawIndex()],direction:n.direction}:null,c=this._giveContainerGroup(r),d=this._doRender(c,t,h);s||a&&"treemapZoomToNode"!==a&&"treemapRootToNode"!==a?d.renderFinally():this._doAnimation(c,d,t,h),this._resetController(i),this._renderBreadcrumb(t,i,o)}},_giveContainerGroup:function(t){var e=this._containerGroup;return e||(e=this._containerGroup=new jC,this._initEvents(e),this.group.add(e)),e.attr("position",[t.x,t.y]),e},_doRender:function(t,e,i){function n(t,e,i,o,a){function r(t){return t.getId()}function s(r,s){var l=null!=r?t[r]:null,u=null!=s?e[s]:null,c=h(l,u,i,a);c&&n(l&&l.viewChildren||[],u&&u.viewChildren||[],c,o,a+1)}o?(e=t,qC(t,function(t,e){!t.isRemoved()&&s(e,e)})):new Xs(e,t,r,r).add(s).update(s).remove(v(s,null)).execute()}var o=e.getData().tree,a=this._oldTree,r={nodeGroup:[],background:[],content:[]},s={nodeGroup:[],background:[],content:[]},l=this._storage,u=[],h=v(yd,e,s,l,i,r,u);n(o.root?[o.root]:[],a&&a.root?[a.root]:[],t,o===a||!a,0);var c=function(t){var e={nodeGroup:[],background:[],content:[]};return t&&qC(t,function(t,i){var n=e[i];qC(t,function(t){t&&(n.push(t),t.__tmWillDelete=1)})}),e}(l);return this._oldTree=o,this._storage=s,{lastsForAnimation:r,willDeleteEls:c,renderFinally:function(){qC(c,function(t){qC(t,function(t){t.parent&&t.parent.remove(t)})}),qC(u,function(t){t.invisible=!0,t.dirty()})}}},_doAnimation:function(t,e,i,n){if(i.get("animation")){var o=i.get("animationDurationUpdate"),r=i.get("animationEasing"),s=vd();qC(e.willDeleteEls,function(t,e){qC(t,function(t,i){if(!t.invisible){var a,l=t.parent;if(n&&"drillDown"===n.direction)a=l===n.rootNodeGroup?{shape:{x:0,y:0,width:l.__tmNodeWidth,height:l.__tmNodeHeight},style:{opacity:0}}:{style:{opacity:0}};else{var u=0,h=0;l.__tmWillDelete||(u=l.__tmNodeWidth/2,h=l.__tmNodeHeight/2),a="nodeGroup"===e?{position:[u,h],style:{opacity:0}}:{shape:{x:u,y:h,width:0,height:0},style:{opacity:0}}}a&&s.add(t,a,o,r)}})}),qC(this._storage,function(t,i){qC(t,function(t,n){var l=e.lastsForAnimation[i][n],u={};l&&("nodeGroup"===i?l.old&&(u.position=t.position.slice(),t.attr("position",l.old)):(l.old&&(u.shape=a({},t.shape),t.setShape(l.old)),l.fadein?(t.setStyle("opacity",0),u.style={opacity:1}):1!==t.style.opacity&&(u.style={opacity:1})),s.add(t,u,o,r))})},this),this._state="animating",s.done(XC(function(){this._state="ready",e.renderFinally()},this)).start()}},_resetController:function(t){var e=this._controller;e||((e=this._controller=new oc(t.getZr())).enable(this.seriesModel.get("roam")),e.on("pan",XC(this._onPan,this)),e.on("zoom",XC(this._onZoom,this)));var i=new de(0,0,t.getWidth(),t.getHeight());e.setPointerChecker(function(t,e,n){return i.contain(e,n)})},_clearController:function(){var t=this._controller;t&&(t.dispose(),t=null)},_onPan:function(t){if("animating"!==this._state&&(Math.abs(t.dx)>3||Math.abs(t.dy)>3)){var e=this.seriesModel.getData().tree.root;if(!e)return;var i=e.getLayout();if(!i)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:i.x+t.dx,y:i.y+t.dy,width:i.width,height:i.height}})}},_onZoom:function(t){var e=t.originX,i=t.originY;if("animating"!==this._state){var n=this.seriesModel.getData().tree.root;if(!n)return;var o=n.getLayout();if(!o)return;var a=new de(o.x,o.y,o.width,o.height),r=this.seriesModel.layoutInfo;e-=r.x,i-=r.y;var s=xt();St(s,s,[-e,-i]),It(s,s,[t.scale,t.scale]),St(s,s,[e,i]),a.applyTransform(s),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:a.x,y:a.y,width:a.width,height:a.height}})}},_initEvents:function(t){t.on("click",function(t){if("ready"===this._state){var e=this.seriesModel.get("nodeClick",!0);if(e){var i=this.findTarget(t.offsetX,t.offsetY);if(i){var n=i.node;if(n.getLayout().isLeafRoot)this._rootToNode(i);else if("zoomToNode"===e)this._zoomToNode(i);else if("link"===e){var o=n.hostTree.data.getItemModel(n.dataIndex),a=o.get("link",!0),r=o.get("target",!0)||"blank";a&&window.open(a,r)}}}}},this)},_renderBreadcrumb:function(t,e,i){i||(i=null!=t.get("leafDepth",!0)?{node:t.getViewRoot()}:this.findTarget(e.getWidth()/2,e.getHeight()/2))||(i={node:t.getData().tree.root}),(this._breadcrumb||(this._breadcrumb=new pd(this.group))).render(t,e,i.node,XC(function(e){"animating"!==this._state&&(hd(t.getViewRoot(),e)?this._rootToNode({node:e}):this._zoomToNode({node:e}))},this))},remove:function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage={nodeGroup:[],background:[],content:[]},this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},dispose:function(){this._clearController()},_zoomToNode:function(t){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},_rootToNode:function(t){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},findTarget:function(t,e){var i;return this.seriesModel.getViewRoot().eachNode({attr:"viewChildren",order:"preorder"},function(n){var o=this._storage.background[n.getRawIndex()];if(o){var a=o.transformCoordToLocal(t,e),r=o.shape;if(!(r.x<=a[0]&&a[0]<=r.x+r.width&&r.y<=a[1]&&a[1]<=r.y+r.height))return!1;i={node:n,offsetX:a[0],offsetY:a[1]}}},this),i}});for(var aL=["treemapZoomToNode","treemapRender","treemapMove"],rL=0;rL=0&&t.call(e,i[o],o)},TL.eachEdge=function(t,e){for(var i=this.edges,n=i.length,o=0;o=0&&i[o].node1.dataIndex>=0&&i[o].node2.dataIndex>=0&&t.call(e,i[o],o)},TL.breadthFirstTraverse=function(t,e,i,n){if(Jd.isInstance(e)||(e=this._nodesMap[$d(e)]),e){for(var o="out"===i?"outEdges":"in"===i?"inEdges":"edges",a=0;a=0&&i.node2.dataIndex>=0});for(var o=0,a=n.length;o=0&&this[t][e].setItemVisual(this.dataIndex,i,n)},getVisual:function(i,n){return this[t][e].getItemVisual(this.dataIndex,i,n)},setLayout:function(i,n){this.dataIndex>=0&&this[t][e].setItemLayout(this.dataIndex,i,n)},getLayout:function(){return this[t][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[t][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[t][e].getRawIndex(this.dataIndex)}}};h(Jd,AL("hostGraph","data")),h(Qd,AL("hostGraph","edgeData")),IL.Node=Jd,IL.Edge=Qd,Yi(Jd),Yi(Qd);var DL=function(t,e,i,n,o){for(var a=new IL(n),r=0;r "+f)),h++)}var p,g=i.get("coordinateSystem");if("cartesian2d"===g||"polar"===g)p=ml(t,i);else{var m=Fa.get(g),v=m&&"view"!==m.type?m.dimensions||[]:[];l(v,"value")<0&&v.concat(["value"]);var y=_A(t,{coordDimensions:v});(p=new vA(y,i)).initData(t)}var x=new vA(["value"],i);return x.initData(u,s),o&&o(p,x),kc({mainData:p,struct:a,structAttr:"graph",datas:{node:p,edge:x},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a},CL=Hs({type:"series.graph",init:function(t){CL.superApply(this,"init",arguments),this.legendDataProvider=function(){return this._categoriesData},this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},mergeOption:function(t){CL.superApply(this,"mergeOption",arguments),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},mergeDefaultAndTheme:function(t){CL.superApply(this,"mergeDefaultAndTheme",arguments),Ci(t,["edgeLabel"],["show"])},getInitialData:function(t,e){var i=t.edges||t.links||[],n=t.data||t.nodes||[],o=this;if(n&&i)return DL(n,i,this,!0,function(t,i){function n(t){return(t=this.parsePath(t))&&"label"===t[0]?r:t&&"emphasis"===t[0]&&"label"===t[1]?l:this.parentModel}t.wrapMethod("getItemModel",function(t){var e=o._categoriesModels[t.getShallow("category")];return e&&(e.parentModel=t.parentModel,t.parentModel=e),t});var a=o.getModel("edgeLabel"),r=new No({label:a.option},a.parentModel,e),s=o.getModel("emphasis.edgeLabel"),l=new No({emphasis:{label:s.option}},s.parentModel,e);i.wrapMethod("getItemModel",function(t){return t.customizeGetParent(n),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){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=ia(l.join(" > ")),o.value&&(l+=" : "+ia(o.value)),l}return CL.superApply(this,"formatTooltip",arguments)},_updateCategoriesData:function(){var t=f(this.option.categories||[],function(t){return null!=t.value?t:a({value:0},t)}),e=new vA(["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 CL.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,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}}}}),LL=_M.prototype,kL=bM.prototype,PL=Un({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){(tf(e)?LL:kL).buildPath(t,e)},pointAt:function(t){return tf(this.shape)?LL.pointAt.call(this,t):kL.pointAt.call(this,t)},tangentAt:function(t){var e=this.shape,i=tf(e)?[e.x2-e.x1,e.y2-e.y1]:kL.tangentAt.call(this,t);return q(i,i)}}),NL=["fromSymbol","toSymbol"],OL=rf.prototype;OL.beforeUpdate=function(){var t=this,e=t.childOfName("fromSymbol"),i=t.childOfName("toSymbol"),n=t.childOfName("label");if(e||i||!n.ignore){for(var o=1,a=this.parent;a;)a.scale&&(o/=a.scale[0]),a=a.parent;var r=t.childOfName("line");if(this.__dirty||r.__dirty){var s=r.shape.percent,l=r.pointAt(0),u=r.pointAt(s),h=U([],u,l);if(q(h,h),e&&(e.attr("position",l),c=r.tangentAt(0),e.attr("rotation",Math.PI/2-Math.atan2(c[1],c[0])),e.attr("scale",[o*s,o*s])),i){i.attr("position",u);var c=r.tangentAt(1);i.attr("rotation",-Math.PI/2-Math.atan2(c[1],c[0])),i.attr("scale",[o*s,o*s])}if(!n.ignore){n.attr("position",u);var d,f,p,g=5*o;if("end"===n.__position)d=[h[0]*g+u[0],h[1]*g+u[1]],f=h[0]>.8?"left":h[0]<-.8?"right":"center",p=h[1]>.8?"top":h[1]<-.8?"bottom":"middle";else if("middle"===n.__position){var m=s/2,v=[(c=r.tangentAt(m))[1],-c[0]],y=r.pointAt(m);v[1]>0&&(v[0]=-v[0],v[1]=-v[1]),d=[y[0]+v[0]*g,y[1]+v[1]*g],f="center",p="bottom";var x=-Math.atan2(c[1],c[0]);u[0].8?"right":h[0]<-.8?"left":"center",p=h[1]>.8?"bottom":h[1]<-.8?"top":"middle";n.attr({style:{textVerticalAlign:n.__verticalAlign||p,textAlign:n.__textAlign||f},position:d,scale:[o,o]})}}}},OL._createLine=function(t,e,i){var n=t.hostModel,o=of(t.getItemLayout(e));o.shape.percent=0,To(o,{shape:{percent:1}},n,e),this.add(o);var a=new rM({name:"label",lineLabelOriginalOpacity:1});this.add(a),d(NL,function(i){var n=nf(i,t,e);this.add(n),this[ef(i)]=t.getItemVisual(e,i)},this),this._updateCommonStl(t,e,i)},OL.updateData=function(t,e,i){var n=t.hostModel,o=this.childOfName("line"),a=t.getItemLayout(e),r={shape:{}};af(r.shape,a),Io(o,r,n,e),d(NL,function(i){var n=t.getItemVisual(e,i),o=ef(i);if(this[o]!==n){this.remove(this.childOfName(i));var a=nf(i,t,e);this.add(a)}this[o]=n},this),this._updateCommonStl(t,e,i)},OL._updateCommonStl=function(t,e,i){var n=t.hostModel,o=this.childOfName("line"),a=i&&i.lineStyle,s=i&&i.hoverLineStyle,l=i&&i.labelModel,u=i&&i.hoverLabelModel;if(!i||t.hasItemOption){var h=t.getItemModel(e);a=h.getModel("lineStyle").getLineStyle(),s=h.getModel("emphasis.lineStyle").getLineStyle(),l=h.getModel("label"),u=h.getModel("emphasis.label")}var c=t.getItemVisual(e,"color"),f=D(t.getItemVisual(e,"opacity"),a.opacity,1);o.useStyle(r({strokeNoScale:!0,fill:"none",stroke:c,opacity:f},a)),o.hoverStyle=s,d(NL,function(t){var e=this.childOfName(t);e&&(e.setColor(c),e.setStyle({opacity:f}))},this);var p,g,m=l.getShallow("show"),v=u.getShallow("show"),y=this.childOfName("label");if((m||v)&&(p=c||"#000",null==(g=n.getFormattedLabel(e,"normal",t.dataType)))){var x=n.getRawValue(e);g=null==x?t.getName(e):isFinite(x)?Go(x):x}var _=m?g:null,w=v?A(n.getFormattedLabel(e,"emphasis",t.dataType),g):null,b=y.style;null==_&&null==w||(mo(y.style,l,{text:_},{autoColor:p}),y.__textAlign=b.textAlign,y.__verticalAlign=b.textVerticalAlign,y.__position=l.get("position")||"middle"),y.hoverStyle=null!=w?{text:w,textFill:u.getTextColor(!0),fontStyle:u.getShallow("fontStyle"),fontWeight:u.getShallow("fontWeight"),fontSize:u.getShallow("fontSize"),fontFamily:u.getShallow("fontFamily")}:{text:null},y.ignore=!m&&!v,fo(this)},OL.highlight=function(){this.trigger("emphasis")},OL.downplay=function(){this.trigger("normal")},OL.updateLayout=function(t,e){this.setLinePoints(t.getItemLayout(e))},OL.setLinePoints=function(t){var e=this.childOfName("line");af(e.shape,t),e.dirty()},u(rf,tb);var EL=sf.prototype;EL.isPersistent=function(){return!0},EL.updateData=function(t){var e=this,i=e.group,n=e._lineData;e._lineData=t,n||i.removeAll();var o=hf(t);t.diff(n).add(function(i){lf(e,t,i,o)}).update(function(i,a){uf(e,n,t,a,i,o)}).remove(function(t){i.remove(n.getItemGraphicEl(t))}).execute()},EL.updateLayout=function(){var t=this._lineData;t&&t.eachItemGraphicEl(function(e,i){e.updateLayout(t,i)},this)},EL.incrementalPrepareUpdate=function(t){this._seriesScope=hf(t),this._lineData=null,this.group.removeAll()},EL.incrementalUpdate=function(t,e){for(var i=t.start;i=o/3?1:2),l=e.y-n(r)*a*(a>=o/3?1:2);r=e.angle-Math.PI/2,t.moveTo(s,l),t.lineTo(e.x+i(r)*a,e.y+n(r)*a),t.lineTo(e.x+i(e.angle)*o,e.y+n(e.angle)*o),t.lineTo(e.x-i(r)*a,e.y-n(r)*a),t.lineTo(s,l)}}),YL=2*Math.PI,qL=(Ar.extend({type:"gauge",render:function(t,e,i){this.group.removeAll();var n=t.get("axisLine.lineStyle.color"),o=Sf(t,i);this._renderMain(t,e,i,n,o)},dispose:function(){},_renderMain:function(t,e,i,n,o){for(var a=this.group,r=t.getModel("axisLine").getModel("lineStyle"),s=t.get("clockwise"),l=-t.get("startAngle")/180*Math.PI,u=-t.get("endAngle")/180*Math.PI,h=(u-l)%YL,c=l,d=r.get("width"),f=0;f=t&&(0===e?0:n[e-1][0]).4?"bottom":"middle",textAlign:A<-.4?"left":A>.4?"right":"center"},{autoColor:P}),silent:!0}))}if(g.get("show")&&T!==v){for(var N=0;N<=y;N++){var A=Math.cos(w),D=Math.sin(w),O=new _M({shape:{x1:A*c+u,y1:D*c+h,x2:A*(c-_)+u,y2:D*(c-_)+h},silent:!0,style:I});"auto"===I.stroke&&O.setStyle({stroke:n((T+N/y)/v)}),l.add(O),w+=S}w-=S}else w+=b}},_renderPointer:function(t,e,i,n,o,a,r,s){var l=this.group,u=this._data;if(t.get("pointer.show")){var h=[+t.get("min"),+t.get("max")],c=[a,r],d=t.getData(),f=d.mapDimension("value");d.diff(u).add(function(e){var i=new jL({shape:{angle:a}});To(i,{shape:{angle:Bo(d.get(f,e),h,c,!0)}},t),l.add(i),d.setItemGraphicEl(e,i)}).update(function(e,i){var n=u.getItemGraphicEl(i);Io(n,{shape:{angle:Bo(d.get(f,e),h,c,!0)}},t),l.add(n),d.setItemGraphicEl(e,n)}).remove(function(t){var e=u.getItemGraphicEl(t);l.remove(e)}).execute(),d.eachItemGraphicEl(function(t,e){var i=d.getItemModel(e),a=i.getModel("pointer");t.setShape({x:o.cx,y:o.cy,width:Vo(a.get("width"),o.r),r:Vo(a.get("length"),o.r)}),t.useStyle(i.getModel("itemStyle").getItemStyle()),"auto"===t.style.fill&&t.setStyle("fill",n(Bo(d.get(f,e),h,[0,1],!0))),fo(t,i.getModel("emphasis.itemStyle").getItemStyle())}),this._data=d}else u&&u.eachItemGraphicEl(function(t){l.remove(t)})},_renderTitle:function(t,e,i,n,o){var a=t.getData(),r=a.mapDimension("value"),s=t.getModel("title");if(s.get("show")){var l=s.get("offsetCenter"),u=o.cx+Vo(l[0],o.r),h=o.cy+Vo(l[1],o.r),c=+t.get("min"),d=+t.get("max"),f=n(Bo(t.getData().get(r,0),[c,d],[0,1],!0));this.group.add(new rM({silent:!0,style:mo({},s,{x:u,y:h,text:a.getName(0),textAlign:"center",textVerticalAlign:"middle"},{autoColor:f,forceRich:!0})}))}},_renderDetail:function(t,e,i,n,o){var a=t.getModel("detail"),r=+t.get("min"),s=+t.get("max");if(a.get("show")){var l=a.get("offsetCenter"),u=o.cx+Vo(l[0],o.r),h=o.cy+Vo(l[1],o.r),c=Vo(a.get("width"),o.r),d=Vo(a.get("height"),o.r),f=t.getData(),p=f.get(f.mapDimension("value"),0),g=n(Bo(p,[r,s],[0,1],!0));this.group.add(new rM({silent:!0,style:mo({},a,{x:u,y:h,text:Mf(p,a.get("formatter")),textWidth:isNaN(c)?null:c,textHeight:isNaN(d)?null:d,textAlign:"center",textVerticalAlign:"middle"},{autoColor:g,forceRich:!0})}))}}}),Hs({type:"series.funnel",init:function(t){qL.superApply(this,"init",arguments),this.legendDataProvider=function(){return this.getRawData()},this._defaultLabelLine(t)},getInitialData:function(t,e){return oC(this,["value"])},_defaultLabelLine:function(t){Ci(t,"labelLine",["show"]);var e=t.labelLine,i=t.emphasis.labelLine;e.show=e.show&&t.label.show,i.show=i.show&&t.emphasis.label.show},getDataParams:function(t){var e=this.getData(),i=qL.superCall(this,"getDataParams",t),n=e.mapDimension("value"),o=e.getSum(n);return i.percent=o?+(e.get(n,t)/o*100).toFixed(2):0,i.$vars.push("percent"),i},defaultOption:{zlevel:0,z:2,legendHoverLink:!0,left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1,type:"solid"}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}}}})),KL=If.prototype,$L=["itemStyle","opacity"];KL.updateData=function(t,e,i){var n=this.childAt(0),o=t.hostModel,a=t.getItemModel(e),s=t.getItemLayout(e),l=t.getItemModel(e).get($L);l=null==l?1:l,n.useStyle({}),i?(n.setShape({points:s.points}),n.setStyle({opacity:0}),To(n,{style:{opacity:l}},o,e)):Io(n,{style:{opacity:l},shape:{points:s.points}},o,e);var u=a.getModel("itemStyle"),h=t.getItemVisual(e,"color");n.setStyle(r({lineJoin:"round",fill:h},u.getItemStyle(["opacity"]))),n.hoverStyle=u.getModel("emphasis").getItemStyle(),this._updateLabel(t,e),fo(this)},KL._updateLabel=function(t,e){var i=this.childAt(1),n=this.childAt(2),o=t.hostModel,a=t.getItemModel(e),r=t.getItemLayout(e).label,s=t.getItemVisual(e,"color");Io(i,{shape:{points:r.linePoints||r.linePoints}},o,e),Io(n,{style:{x:r.x,y:r.y}},o,e),n.attr({rotation:r.rotation,origin:[r.x,r.y],z2:10});var l=a.getModel("label"),u=a.getModel("emphasis.label"),h=a.getModel("labelLine"),c=a.getModel("emphasis.labelLine"),s=t.getItemVisual(e,"color");go(n.style,n.hoverStyle={},l,u,{labelFetcher:t.hostModel,labelDataIndex:e,defaultText:t.getName(e),autoColor:s,useInsideStyle:!!r.inside},{textAlign:r.textAlign,textVerticalAlign:r.verticalAlign}),n.ignore=n.normalIgnore=!l.get("show"),n.hoverIgnore=!u.get("show"),i.ignore=i.normalIgnore=!h.get("show"),i.hoverIgnore=!c.get("show"),i.setStyle({stroke:s}),i.setStyle(h.getModel("lineStyle").getLineStyle()),i.hoverStyle=c.getModel("lineStyle").getLineStyle()},u(If,tb);Ar.extend({type:"funnel",render:function(t,e,i){var n=t.getData(),o=this._data,a=this.group;n.diff(o).add(function(t){var e=new If(n,t);n.setItemGraphicEl(t,e),a.add(e)}).update(function(t,e){var i=o.getItemGraphicEl(e);i.updateData(n,t),a.add(i),n.setItemGraphicEl(t,i)}).remove(function(t){var e=o.getItemGraphicEl(t);a.remove(e)}).execute(),this._data=n},remove:function(){this.group.removeAll(),this._data=null},dispose:function(){}});Bs(uC("funnel")),zs(function(t,e,i){t.eachSeriesByType("funnel",function(t){var i=t.getData(),n=i.mapDimension("value"),o=t.get("sort"),a=Tf(t,e),r=Af(i,o),s=[Vo(t.get("minSize"),a.width),Vo(t.get("maxSize"),a.width)],l=i.getDataExtent(n),u=t.get("min"),h=t.get("max");null==u&&(u=Math.min(l[0],0)),null==h&&(h=l[1]);var c=t.get("funnelAlign"),d=t.get("gap"),f=(a.height-d*(i.count()-1))/i.count(),p=a.y,g=function(t,e){var o,r=Bo(i.get(n,t)||0,[u,h],s,!0);switch(c){case"left":o=a.x;break;case"center":o=a.x+(a.width-r)/2;break;case"right":o=a.x+a.width-r}return[[o,e],[o+r,e]]};"ascending"===o&&(f=-f,d=-d,p+=a.height,r=r.reverse());for(var m=0;ma&&(e[1-n]=e[n]+h.sign*a),e},tk=d,ek=Math.min,ik=Math.max,nk=Math.floor,ok=Math.ceil,ak=Go,rk=Math.PI;Nf.prototype={type:"parallel",constructor:Nf,_init:function(t,e,i){var n=t.dimensions,o=t.parallelAxisIndex;tk(n,function(t,i){var n=o[i],a=e.getComponent("parallelAxis",n),r=this._axesMap.set(t,new JL(t,Hl(a),[0,0],a.get("type"),n)),s="category"===r.type;r.onBand=s&&a.get("boundaryGap"),r.inverse=a.get("inverse"),a.axis=r,r.model=a,r.coordinateSystem=a.coordinateSystem=this},this)},update:function(t,e){this._updateAxesFromSeries(this._model,t)},containPoint:function(t){var e=this._makeLayoutInfo(),i=e.axisBase,n=e.layoutBase,o=e.pixelDimIndex,a=t[1-o],r=t[o];return a>=i&&a<=i+e.axisLength&&r>=n&&r<=n+e.layoutLength},getModel:function(){return this._model},_updateAxesFromSeries:function(t,e){e.eachSeries(function(i){if(t.contains(i,e)){var n=i.getData();tk(this.dimensions,function(t){var e=this._axesMap.get(t);e.scale.unionExtentFromData(n,n.mapDimension(t)),Wl(e.scale,e.model)},this)}},this)},resize:function(t,e){this._rect=ca(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()}),this._layoutAxes()},getRect:function(){return this._rect},_makeLayoutInfo:function(){var t,e=this._model,i=this._rect,n=["x","y"],o=["width","height"],a=e.get("layout"),r="horizontal"===a?0:1,s=i[o[r]],l=[0,s],u=this.dimensions.length,h=Of(e.get("axisExpandWidth"),l),c=Of(e.get("axisExpandCount")||0,[0,u]),d=e.get("axisExpandable")&&u>3&&u>c&&c>1&&h>0&&s>0,f=e.get("axisExpandWindow");f?(t=Of(f[1]-f[0],l),f[1]=f[0]+t):(t=Of(h*(c-1),l),(f=[h*(e.get("axisExpandCenter")||nk(u/2))-t/2])[1]=f[0]+t);var p=(s-t)/(u-c);p<3&&(p=0);var g=[nk(ak(f[0]/h,1))+1,ok(ak(f[1]/h,1))-1],m=p/h*f[0];return{layout:a,pixelDimIndex:r,layoutBase:i[n[r]],layoutLength:s,axisBase:i[n[1-r]],axisLength:i[o[1-r]],axisExpandable:d,axisExpandWidth:h,axisCollapseWidth:p,axisExpandWindow:f,axisCount:u,winInnerIndices:g,axisExpandWindow0Pos:m}},_layoutAxes:function(){var t=this._rect,e=this._axesMap,i=this.dimensions,n=this._makeLayoutInfo(),o=n.layout;e.each(function(t){var e=[0,n.axisLength],i=t.inverse?1:0;t.setExtent(e[i],e[1-i])}),tk(i,function(e,i){var a=(n.axisExpandable?Rf:Ef)(i,n),r={horizontal:{x:a.position,y:n.axisLength},vertical:{x:0,y:a.position}},s={horizontal:rk/2,vertical:0},l=[r[o].x+t.x,r[o].y+t.y],u=s[o],h=xt();Mt(h,h,u),St(h,h,l),this._axesLayout[e]={position:l,rotation:u,transform:h,axisNameAvailableWidth:a.axisNameAvailableWidth,axisLabelShow:a.axisLabelShow,nameTruncateMaxWidth:a.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}},this)},getAxis:function(t){return this._axesMap.get(t)},dataToPoint:function(t,e){return this.axisCoordToPoint(this._axesMap.get(e).dataToCoord(t),e)},eachActiveState:function(t,e,i,n){null==i&&(i=0),null==n&&(n=t.count());var o=this._axesMap,a=this.dimensions,r=[],s=[];d(a,function(e){r.push(t.mapDimension(e)),s.push(o.get(e).model)});for(var l=this.hasAxisBrushed(),u=i;uo*(1-h[0])?(l="jump",r=s-o*(1-h[2])):(r=s-o*h[1])>=0&&(r=s-o*(1-h[1]))<=0&&(r=0),(r*=e.axisExpandWidth/u)?QL(r,n,a,"all"):l="none";else{o=n[1]-n[0];(n=[ik(0,a[1]*s/o-o/2)])[1]=ek(a[1],n[0]+o),n[0]=n[1]-o}return{axisExpandWindow:n,behavior:l}}},Fa.register("parallel",{create:function(t,e){var i=[];return t.eachComponent("parallel",function(n,o){var a=new Nf(n,t,e);a.name="parallel_"+o,a.resize(n,e),n.coordinateSystem=a,a.model=n,i.push(a)}),t.eachSeries(function(e){if("parallel"===e.get("coordinateSystem")){var i=t.queryComponents({mainType:"parallel",index:e.get("parallelIndex"),id:e.get("parallelId")})[0];e.coordinateSystem=i.coordinateSystem}}),i}});var sk=lI.extend({type:"baseParallelAxis",axis:null,activeIntervals:[],getAreaSelectStyle:function(){return Qb([["fill","color"],["lineWidth","borderWidth"],["stroke","borderColor"],["width","width"],["opacity","opacity"]])(this.getModel("areaSelectStyle"))},setActiveIntervals:function(t){var e=this.activeIntervals=i(t);if(e)for(var n=e.length-1;n>=0;n--)Fo(e[n])},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;n5)return;var n=this._model.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]);"none"!==n.behavior&&this._dispatchExpand({axisExpandWindow:n.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(t){if(!this._mouseDownPoint&&Ip(this,"mousemove")){var e=this._model,i=e.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]),n=i.behavior;"jump"===n&&this._throttledDispatchExpand.debounceNextCall(e.get("axisExpandDebounce")),this._throttledDispatchExpand("none"===n?null:{axisExpandWindow:i.axisExpandWindow,animation:"jump"===n&&null})}}};Ns(function(t){Cf(t),Lf(t)}),YI.extend({type:"series.parallel",dependencies:["parallel"],visualColorAccessPath:"lineStyle.color",getInitialData:function(t,e){var i=this.getSource();return Tp(i,this),ml(i,this)},getRawIndicesByActiveState:function(t){var e=this.coordinateSystem,i=this.getData(),n=[];return e.eachActiveState(i,function(e,o){t===e&&n.push(i.getRawIndex(o))}),n},defaultOption:{zlevel:0,z:2,coordinateSystem:"parallel",parallelIndex:0,label:{show:!1},inactiveOpacity:.05,activeOpacity:1,lineStyle:{width:1,opacity:.45,type:"solid"},emphasis:{label:{show:!1}},progressive:500,smooth:!1,animationEasing:"linear"}});var Dk=.3,Ck=(Ar.extend({type:"parallel",init:function(){this._dataGroup=new tb,this.group.add(this._dataGroup),this._data,this._initialized},render:function(t,e,i,n){var o=this._dataGroup,a=t.getData(),r=this._data,s=t.coordinateSystem,l=s.dimensions,u=kp(t);if(a.diff(r).add(function(t){Pp(Lp(a,o,t,l,s),a,t,u)}).update(function(e,i){var o=r.getItemGraphicEl(i),h=Cp(a,e,l,s);a.setItemGraphicEl(e,o),Io(o,{shape:{points:h}},n&&!1===n.animation?null:t,e),Pp(o,a,e,u)}).remove(function(t){var e=r.getItemGraphicEl(t);o.remove(e)}).execute(),!this._initialized){this._initialized=!0;var h=Dp(s,t,function(){setTimeout(function(){o.removeClipPath()})});o.setClipPath(h)}this._data=a},incrementalPrepareRender:function(t,e,i){this._initialized=!0,this._data=null,this._dataGroup.removeAll()},incrementalRender:function(t,e,i){for(var n=e.getData(),o=e.coordinateSystem,a=o.dimensions,r=kp(e),s=t.start;sn&&(n=e)}),d(e,function(e){var o=new hL({type:"color",mappingMethod:"linear",dataExtent:[i,n],visual:t.get("color")}).mapValueToVisual(e.getLayout().value);e.setVisual("color",o);var a=e.getModel().get("itemStyle.color");null!=a&&e.setVisual("color",a)})}})});var Ok={_baseAxisDim:null,getInitialData:function(t,e){var i,n,o=e.getComponent("xAxis",this.get("xAxisIndex")),a=e.getComponent("yAxis",this.get("yAxisIndex")),r=o.get("type"),s=a.get("type");"category"===r?(t.layout="horizontal",i=o.getOrdinalMeta(),n=!0):"category"===s?(t.layout="vertical",i=a.getOrdinalMeta(),n=!0):t.layout=t.layout||"horizontal";var l=["x","y"],u="horizontal"===t.layout?0:1,h=this._baseAxisDim=l[u],c=l[1-u],f=[o,a],p=f[u].get("type"),g=f[1-u].get("type"),m=t.data;if(m&&n){var v=[];d(m,function(t,e){var i;t.value&&y(t.value)?(i=t.value.slice(),t.value.unshift(e)):y(t)?(i=t.slice(),t.unshift(e)):i=t,v.push(i)}),t.data=v}var x=this.defaultValueDimensions;return oC(this,{coordDimensions:[{name:h,type:qs(p),ordinalMeta:i,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:c,type:qs(g),dimsDef:x.slice()}],dimensionsCount:x.length+1})},getBaseAxis:function(){var t=this._baseAxisDim;return this.ecModel.getComponent(t+"Axis",this.get(t+"AxisIndex")).axis}};h(YI.extend({type:"series.boxplot",dependencies:["xAxis","yAxis","grid"],defaultValueDimensions:[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],dimensions:null,defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,hoverAnimation:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:2,shadowOffsetY:2,shadowColor:"rgba(0,0,0,0.4)"}},animationEasing:"elasticOut",animationDuration:800}}),Ok,!0);var Ek=["itemStyle"],Rk=["emphasis","itemStyle"],zk=(Ar.extend({type:"boxplot",render:function(t,e,i){var n=t.getData(),o=this.group,a=this._data;this._data||o.removeAll();var r="horizontal"===t.get("layout")?1:0;n.diff(a).add(function(t){if(n.hasValue(t)){var e=ig(n.getItemLayout(t),n,t,r,!0);n.setItemGraphicEl(t,e),o.add(e)}}).update(function(t,e){var i=a.getItemGraphicEl(e);if(n.hasValue(t)){var s=n.getItemLayout(t);i?ng(s,i,n,t):i=ig(s,n,t,r),o.add(i),n.setItemGraphicEl(t,i)}else o.remove(i)}).remove(function(t){var e=a.getItemGraphicEl(t);e&&o.remove(e)}).execute(),this._data=n},remove:function(t){var e=this.group,i=this._data;this._data=null,i&&i.eachItemGraphicEl(function(t){t&&e.remove(t)})},dispose:B}),Pn.extend({type:"boxplotBoxPath",shape:{},buildPath:function(t,e){var i=e.points,n=0;for(t.moveTo(i[n][0],i[n][1]),n++;n<4;n++)t.lineTo(i[n][0],i[n][1]);for(t.closePath();n0?jk:Yk)}function n(t,e){return e.get(t>0?Uk:Xk)}var o=t.getData(),a=t.pipelineContext.large;if(o.setVisual({legendSymbol:"roundRect",colorP:i(1,t),colorN:i(-1,t),borderColorP:n(1,t),borderColorN:n(-1,t)}),!e.isSeriesFiltered(t))return!a&&{progress:function(t,e){for(var o;null!=(o=t.next());){var a=e.getItemModel(o),r=e.getItemLayout(o).sign;e.setItemVisual(o,{color:i(r,a),borderColor:n(r,a)})}}}}},Kk="undefined"!=typeof Float32Array?Float32Array:Array,$k={seriesType:"candlestick",plan:$I(),reset:function(t){var e=t.coordinateSystem,i=t.getData(),n=pg(t,i),o=0,a=1,r=["x","y"],s=i.mapDimension(r[o]),l=i.mapDimension(r[a],!0),u=l[0],h=l[1],c=l[2],d=l[3];if(i.setLayout({candleWidth:n,isSimpleBox:n<=1.3}),!(null==s||l.length<4))return{progress:t.pipelineContext.large?function(t,i){for(var n,r,l=new Kk(5*t.count),f=0,p=[],g=[];null!=(r=t.next());){var m=i.get(s,r),v=i.get(u,r),y=i.get(h,r),x=i.get(c,r),_=i.get(d,r);isNaN(m)||isNaN(x)||isNaN(_)?(l[f++]=NaN,f+=4):(l[f++]=fg(i,r,v,y,h),p[o]=m,p[a]=x,n=e.dataToPoint(p,null,g),l[f++]=n?n[0]:NaN,l[f++]=n?n[1]:NaN,p[a]=_,n=e.dataToPoint(p,null,g),l[f++]=n?n[1]:NaN)}i.setLayout("largePoints",l)}:function(t,i){function r(t,i){var n=[];return n[o]=i,n[a]=t,isNaN(i)||isNaN(t)?[NaN,NaN]:e.dataToPoint(n)}function l(t,e,i){var a=e.slice(),r=e.slice();a[o]=Jn(a[o]+n/2,1,!1),r[o]=Jn(r[o]-n/2,1,!0),i?t.push(a,r):t.push(r,a)}function f(t){return t[o]=Jn(t[o],1),t}for(var p;null!=(p=t.next());){var g=i.get(s,p),m=i.get(u,p),v=i.get(h,p),y=i.get(c,p),x=i.get(d,p),_=Math.min(m,v),w=Math.max(m,v),b=r(_,g),S=r(w,g),M=r(y,g),I=r(x,g),T=[];l(T,S,0),l(T,b,1),T.push(f(I),f(S),f(M),f(b)),i.setItemLayout(p,{sign:fg(i,p,m,v,h),initBaseline:m>v?S[a]:b[a],ends:T,brushRect:function(t,e,i){var s=r(t,i),l=r(e,i);return s[o]-=n/2,l[o]-=n/2,{x:s[0],y:s[1],width:a?n:l[0]-s[0],height:a?l[1]-s[1]:n}}(y,x,g)})}}}}};Ns(function(t){t&&y(t.series)&&d(t.series,function(t){w(t)&&"k"===t.type&&(t.type="candlestick")})}),Bs(qk),zs($k),YI.extend({type:"series.effectScatter",dependencies:["grid","polar"],getInitialData:function(t,e){return ml(this.getSource(),this)},brushSelector:"point",defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,effectType:"ripple",progressive:0,showEffectOn:"render",rippleEffect:{period:4,scale:2.5,brushType:"fill"},symbolSize:10}});var Jk=vg.prototype;Jk.stopEffectAnimation=function(){this.childAt(1).removeAll()},Jk.startEffectAnimation=function(t){for(var e=t.symbolType,i=t.color,n=this.childAt(1),o=0;o<3;o++){var a=Jl(e,-1,-1,2,2,i);a.attr({style:{strokeNoScale:!0},z2:99,silent:!0,scale:[.5,.5]});var r=-o/3*t.period+t.effectOffset;a.animate("",!0).when(t.period,{scale:[t.rippleScale/2,t.rippleScale/2]}).delay(r).start(),a.animateStyle(!0).when(t.period,{opacity:0}).delay(r).start(),n.add(a)}mg(n,t)},Jk.updateEffectAnimation=function(t){for(var e=this._effectCfg,i=this.childAt(1),n=["symbolType","period","rippleScale"],o=0;o "))},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,label:{show:!1,position:"end"},lineStyle:{opacity:.5}}}),iP=xg.prototype;iP.createLine=function(t,e,i){return new rf(t,e,i)},iP._updateEffectSymbol=function(t,e){var i=t.getItemModel(e).getModel("effect"),n=i.get("symbolSize"),o=i.get("symbol");y(n)||(n=[n,n]);var a=i.get("color")||t.getItemVisual(e,"color"),r=this.childAt(1);this._symbolType!==o&&(this.remove(r),(r=Jl(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))},iP._updateEffectAnimation=function(t,e,i){var n=this.childAt(1);if(n){var o=this,a=t.getItemLayout(i),r=1e3*e.get("period"),s=e.get("loop"),l=e.get("constantSpeed"),u=T(e.get("delay"),function(e){return e/t.count()*r/3}),h="function"==typeof u;if(n.ignore=!0,this.updateAnimationPoints(n,a),l>0&&(r=this.getLineLength(n)/l*1e3),r!==this._period||s!==this._loop){n.stopAnimation();var c=u;h&&(c=u(i)),n.__t>0&&(c=-r*n.__t),n.__t=0;var d=n.animate("",s).when(r,{__t:1}).delay(c).during(function(){o.updateSymbolPosition(n)});s||d.done(function(){o.remove(n)}),d.start()}this._period=r,this._loop=s}},iP.getLineLength=function(t){return uw(t.__p1,t.__cp1)+uw(t.__cp1,t.__p2)},iP.updateAnimationPoints=function(t,e){t.__p1=e[0],t.__p2=e[1],t.__cp1=e[2]||[(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2]},iP.updateData=function(t,e,i){this.childAt(0).updateData(t,e,i),this._updateEffectSymbol(t,e)},iP.updateSymbolPosition=function(t){var e=t.__p1,i=t.__p2,n=t.__cp1,o=t.__t,a=t.position,r=sn,s=ln;a[0]=r(e[0],n[0],i[0],o),a[1]=r(e[1],n[1],i[1],o);var l=s(e[0],n[0],i[0],o),u=s(e[1],n[1],i[1],o);t.rotation=-Math.atan2(u,l)-Math.PI/2,t.ignore=!1},iP.updateLayout=function(t,e){this.childAt(0).updateLayout(t,e);var i=t.getItemModel(e).getModel("effect");this._updateEffectAnimation(t,i,e)},u(xg,tb);var nP=_g.prototype;nP._createPolyline=function(t,e,i){var n=t.getItemLayout(e),o=new gM({shape:{points:n}});this.add(o),this._updateCommonStl(t,e,i)},nP.updateData=function(t,e,i){var n=t.hostModel;Io(this.childAt(0),{shape:{points:t.getItemLayout(e)}},n,e),this._updateCommonStl(t,e,i)},nP._updateCommonStl=function(t,e,i){var n=this.childAt(0),o=t.getItemModel(e),a=t.getItemVisual(e,"color"),s=i&&i.lineStyle,l=i&&i.hoverLineStyle;i&&!t.hasItemOption||(s=o.getModel("lineStyle").getLineStyle(),l=o.getModel("emphasis.lineStyle").getLineStyle()),n.useStyle(r({strokeNoScale:!0,fill:"none",stroke:a},s)),n.hoverStyle=l,fo(this)},nP.updateLayout=function(t,e){this.childAt(0).setShape("points",t.getItemLayout(e))},u(_g,tb);var oP=wg.prototype;oP.createLine=function(t,e,i){return new _g(t,e,i)},oP.updateAnimationPoints=function(t,e){this._points=e;for(var i=[0],n=0,o=1;o=0&&!(n[r]<=e);r--);r=Math.min(r,o-2)}else{for(var r=a;re);r++);r=Math.min(r-1,o-2)}J(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}},u(wg,xg);var aP=Un({shape:{polyline:!1,curveness:0,segs:[]},buildPath:function(t,e){var i=e.segs,n=e.curveness;if(e.polyline)for(r=0;r0){t.moveTo(i[r++],i[r++]);for(var a=1;a0){var c=(s+u)/2-(l-h)*n,d=(l+h)/2-(u-s)*n;t.quadraticCurveTo(c,d,u,h)}else t.lineTo(u,h)}},findDataIndex:function(t,e){var i=this.shape,n=i.segs,o=i.curveness;if(i.polyline)for(var a=0,r=0;r0)for(var l=n[r++],u=n[r++],h=1;h0){if(_n(l,u,(l+c)/2-(u-d)*o,(u+d)/2-(c-l)*o,c,d))return a}else if(yn(l,u,c,d))return a;a++}return-1}}),rP=bg.prototype;rP.isPersistent=function(){return!this._incremental},rP.updateData=function(t){this.group.removeAll();var e=new aP({rectHover:!0,cursor:"default"});e.setShape({segs:t.getLayout("linesPoints")}),this._setCommon(e,t),this.group.add(e),this._incremental=null},rP.incrementalPrepareUpdate=function(t){this.group.removeAll(),this._clearIncremental(),t.count()>5e5?(this._incremental||(this._incremental=new Zn({silent:!0})),this.group.add(this._incremental)):this._incremental=null},rP.incrementalUpdate=function(t,e){var i=new aP;i.setShape({segs:e.getLayout("linesPoints")}),this._setCommon(i,e,!!this._incremental),this._incremental?this._incremental.addDisplayable(i,!0):(i.rectHover=!0,i.cursor="default",i.__startIndex=t.start,this.group.add(i))},rP.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},rP._setCommon=function(t,e,i){var n=e.hostModel;t.setShape({polyline:n.get("polyline"),curveness:n.get("lineStyle.curveness")}),t.useStyle(n.getModel("lineStyle").getLineStyle()),t.style.strokeNoScale=!0;var o=e.getVisual("color");o&&t.setStyle("stroke",o),t.setStyle("fill"),i||(t.seriesIndex=n.seriesIndex,t.on("mousemove",function(e){t.dataIndex=null;var i=t.findDataIndex(e.offsetX,e.offsetY);i>0&&(t.dataIndex=i+t.__startIndex)}))},rP._clearIncremental=function(){var t=this._incremental;t&&t.clearDisplaybles()};var sP={seriesType:"lines",plan:$I(),reset:function(t){var e=t.coordinateSystem,i=t.get("polyline"),n=t.pipelineContext.large;return{progress:function(o,a){var r=[];if(n){var s,l=o.end-o.start;if(i){for(var u=0,h=o.start;h0){var I=a(v)?s:l;v>0&&(v=v*S+b),x[_++]=I[M],x[_++]=I[M+1],x[_++]=I[M+2],x[_++]=I[M+3]*v*256}else _+=4}return c.putImageData(y,0,0),h},_getBrush:function(){var t=this._brushCanvas||(this._brushCanvas=iw()),e=this.pointSize+this.blurSize,i=2*e;t.width=i,t.height=i;var n=t.getContext("2d");return n.clearRect(0,0,i,i),n.shadowOffsetX=i,n.shadowBlur=this.blurSize,n.shadowColor="#000",n.beginPath(),n.arc(-e,e,this.pointSize,0,2*Math.PI,!0),n.closePath(),n.fill(),t},_getGradient:function(t,e,i){for(var n=this._gradientPixels,o=n[i]||(n[i]=new Uint8ClampedArray(1024)),a=[0,0,0,0],r=0,s=0;s<256;s++)e[i](s/255,!0,a),o[r++]=a[0],o[r++]=a[1],o[r++]=a[2],o[r++]=a[3];return o}},Zs({type:"heatmap",render:function(t,e,i){var n;e.eachComponent("visualMap",function(e){e.eachTargetSeries(function(i){i===t&&(n=e)})}),this.group.removeAll(),this._incrementalDisplayable=null;var o=t.coordinateSystem;"cartesian2d"===o.type||"calendar"===o.type?this._renderOnCartesianAndCalendar(t,i,0,t.getData().count()):Ag(o)&&this._renderOnGeo(o,t,n,i)},incrementalPrepareRender:function(t,e,i){this.group.removeAll()},incrementalRender:function(t,e,i,n){e.coordinateSystem&&this._renderOnCartesianAndCalendar(e,n,t.start,t.end,!0)},_renderOnCartesianAndCalendar:function(t,e,i,n,o){var r,s,l=t.coordinateSystem;if("cartesian2d"===l.type){var u=l.getAxis("x"),h=l.getAxis("y");r=u.getBandWidth(),s=h.getBandWidth()}for(var c=this.group,d=t.getData(),f=t.getModel("itemStyle").getItemStyle(["color"]),p=t.getModel("emphasis.itemStyle").getItemStyle(),g=t.getModel("label"),m=t.getModel("emphasis.label"),v=l.type,y="cartesian2d"===v?[d.mapDimension("x"),d.mapDimension("y"),d.mapDimension("value")]:[d.mapDimension("time"),d.mapDimension("value")],x=i;x=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}},Fa.register("single",{create:function(t,e){var i=[];return t.eachComponent("singleAxis",function(n,o){var a=new $g(n,t,e);a.name="single_"+o,a.resize(n,e),n.coordinateSystem=a,i.push(a)}),t.eachSeries(function(e){if("singleAxis"===e.get("coordinateSystem")){var i=t.queryComponents({mainType:"singleAxis",index:e.get("singleAxisIndex"),id:e.get("singleAxisId")})[0];e.coordinateSystem=i&&i.coordinateSystem}}),i},dimensions:$g.prototype.dimensions});var gP=["axisLine","axisTickLabel","axisName"],mP=XD.extend({type:"singleAxis",axisPointerClass:"SingleAxisPointer",render:function(t,e,i,n){var o=this.group;o.removeAll();var a=Jg(t),r=new FD(t,a);d(gP,r.add,r),o.add(r.getGroup()),t.get("splitLine.show")&&this._splitLine(t),mP.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;f=0)&&i({type:"updateAxisPointer",currTrigger:t,x:e&&e.offsetX,y:e&&e.offsetY})})},remove:function(t,e){gm(e.getZr(),"axisPointer"),IP.superApply(this._model,"remove",arguments)},dispose:function(t,e){gm("axisPointer",e),IP.superApply(this._model,"dispose",arguments)}}),TP=Bi(),AP=i,DP=m;(mm.prototype={_group:null,_lastGraphicKey:null,_handle:null,_dragging:!1,_lastValue:null,_lastStatus:null,_payloadInfo:null,animationThreshold:15,render:function(t,e,i,n){var o=e.get("value"),a=e.get("status");if(this._axisModel=t,this._axisPointerModel=e,this._api=i,n||this._lastValue!==o||this._lastStatus!==a){this._lastValue=o,this._lastStatus=a;var r=this._group,s=this._handle;if(!a||"hide"===a)return r&&r.hide(),void(s&&s.hide());r&&r.show(),s&&s.show();var l={};this.makeElOption(l,o,t,e,i);var u=l.graphicKey;u!==this._lastGraphicKey&&this.clear(i),this._lastGraphicKey=u;var h=this._moveAnimation=this.determineAnimation(t,e);if(r){var c=v(vm,e,h);this.updatePointerEl(r,l,c,e),this.updateLabelEl(r,l,c,e)}else r=this._group=new tb,this.createPointerEl(r,l,t,e),this.createLabelEl(r,l,t,e),i.getZr().add(r);wm(r,e,!0),this._renderHandle(o)}},remove:function(t){this.clear(t)},dispose:function(t){this.clear(t)},determineAnimation:function(t,e){var i=e.get("animation"),n=t.axis,o="category"===n.type,a=e.get("snap");if(!a&&!o)return!1;if("auto"===i||null==i){var r=this.animationThreshold;if(o&&n.getBandWidth()>r)return!0;if(a){var s=Mh(t).seriesDataCount,l=n.getExtent();return Math.abs(l[0]-l[1])/s>r}return!1}return!0===i},makeElOption:function(t,e,i,n,o){},createPointerEl:function(t,e,i,n){var o=e.pointer;if(o){var a=TP(t).pointerEl=new zM[o.type](AP(e.pointer));t.add(a)}},createLabelEl:function(t,e,i,n){if(e.label){var o=TP(t).labelEl=new yM(AP(e.label));t.add(o),xm(o,n)}},updatePointerEl:function(t,e,i){var n=TP(t).pointerEl;n&&(n.setStyle(e.pointer.style),i(n,{shape:e.pointer.shape}))},updateLabelEl:function(t,e,i,n){var o=TP(t).labelEl;o&&(o.setStyle(e.label.style),i(o,{shape:e.label.shape,position:e.label.position}),xm(o,n))},_renderHandle:function(t){if(!this._dragging&&this.updateHandleTransform){var e=this._axisPointerModel,i=this._api.getZr(),n=this._handle,o=e.getModel("handle"),a=e.get("status");if(!o.get("show")||!a||"hide"===a)return n&&i.remove(n),void(this._handle=null);var r;this._handle||(r=!0,n=this._handle=Po(o.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(t){mw(t.event)},onmousedown:DP(this._onHandleDragMove,this,0,0),drift:DP(this._onHandleDragMove,this),ondragend:DP(this._onHandleDragEnd,this)}),i.add(n)),wm(n,e,!1);var s=["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];n.setStyle(o.getItemStyle(null,s));var l=o.get("size");y(l)||(l=[l,l]),n.attr("scale",[l[0]/2,l[1]/2]),Nr(this,"_doDispatchAxisPointer",o.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,r)}},_moveHandleToValue:function(t,e){vm(this._axisPointerModel,!e&&this._moveAnimation,this._handle,_m(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},_onHandleDragMove:function(t,e){var i=this._handle;if(i){this._dragging=!0;var n=this.updateHandleTransform(_m(i),[t,e],this._axisModel,this._axisPointerModel);this._payloadInfo=n,i.stopAnimation(),i.attr(_m(n)),TP(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 i=i||0,{x:t[i],y:t[1-i],width:e[i],height:e[1-i]}}}).constructor=mm,ji(mm);var CP=mm.extend({makeElOption:function(t,e,i,n,o){var a=i.axis,r=a.grid,s=n.get("type"),l=km(r,a).getOtherAxis(a).getGlobalExtent(),u=a.toGlobalCoord(a.dataToCoord(e,!0));if(s&&"none"!==s){var h=bm(n),c=LP[s](a,u,l,h);c.style=h,t.graphicKey=c.type,t.pointer=c}Am(e,t,Lh(r.model,i),i,n,o)},getHandleTransform:function(t,e,i){var n=Lh(e.axis.grid.model,e,{labelInside:!1});return n.labelMargin=i.get("handle.margin"),{position:Tm(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=km(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];var d=[{verticalAlign:"middle"},{align:"center"}];return{position:u,rotation:t.rotation,cursorPoint:c,tooltipOption:d[l]}}}),LP={line:function(t,e,i,n){var o=Dm([e,i[0]],[e,i[1]],Pm(t));return Kn({shape:o,style:n}),{type:"Line",shape:o}},shadow:function(t,e,i,n){var o=Math.max(1,t.getBandWidth()),a=i[1]-i[0];return{type:"Rect",shape:Cm([e-o/2,i[0]],[o,a],Pm(t))}}};XD.registerAxisPointerClass("CartesianAxisPointer",CP),Ns(function(t){if(t){(!t.axisPointer||0===t.axisPointer.length)&&(t.axisPointer={});var e=t.axisPointer.link;e&&!y(e)&&(t.axisPointer.link=[e])}}),Os(VT.PROCESSOR.STATISTIC,function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=vh(t,e)}),Es({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},function(t,e,i){var n=t.currTrigger,o=[t.x,t.y],a=t,r=t.dispatchAction||m(i.dispatchAction,i),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){lm(o)&&(o=xP({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},e).point);var l=lm(o),u=a.axesInfo,h=s.axesInfo,c="leave"===n||lm(o),d={},f={},p={list:[],map:{}},g={showPointer:wP(em,f),showTooltip:wP(im,p)};_P(s.coordSysMap,function(t,e){var i=l||t.containPoint(o);_P(s.coordSysAxesInfo[e],function(t,e){var n=t.axis,a=rm(u,t);if(!c&&i&&(!u||a)){var r=a&&a.value;null!=r||l||(r=n.pointToData(o)),null!=r&&Qg(t,r,g,!1,d)}})});var v={};return _P(h,function(t,e){var i=t.linkGroup;i&&!f[e]&&_P(i.axesInfo,function(e,n){var o=f[n];if(e!==t&&o){var a=o.value;i.mapper&&(a=t.axis.scale.parse(i.mapper(a,sm(e),sm(t)))),v[t.key]=a}})}),_P(v,function(t,e){Qg(h[e],t,g,!0,d)}),nm(f,h,d),om(p,o,t,r),am(h,0,i),d}});var kP=["x","y"],PP=["width","height"],NP=mm.extend({makeElOption:function(t,e,i,n,o){var a=i.axis,r=a.coordinateSystem,s=Om(r,1-Nm(a)),l=r.dataToPoint(e)[0],u=n.get("type");if(u&&"none"!==u){var h=bm(n),c=OP[u](a,l,s,h);c.style=h,t.graphicKey=c.type,t.pointer=c}Am(e,t,Jg(i),i,n,o)},getHandleTransform:function(t,e,i){var n=Jg(e,{labelInside:!1});return n.labelMargin=i.get("handle.margin"),{position:Tm(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=Nm(o),s=Om(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=Om(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"}}}}),OP={line:function(t,e,i,n){var o=Dm([e,i[0]],[e,i[1]],Nm(t));return Kn({shape:o,style:n}),{type:"Line",shape:o}},shadow:function(t,e,i,n){var o=t.getBandWidth(),a=i[1]-i[0];return{type:"Rect",shape:Cm([e-o/2,i[0]],[o,a],Nm(t))}}};XD.registerAxisPointerClass("SingleAxisPointer",NP),Ws({type:"single"});var EP=YI.extend({type:"series.themeRiver",dependencies:["singleAxis"],nameMap:null,init:function(t){EP.superApply(this,"init",arguments),this.legendDataProvider=function(){return this.getRawData()}},fixData:function(t){var e=t.length,i=[];Zi(t,function(t){return t[2]}).buckets.each(function(t,e){i.push({name:e,dataList:t})});for(var n=i.length,o=-1,a=-1,r=0;ro&&(o=s,a=r)}for(var l=0;lMath.PI/2?"right":"left"):x&&"center"!==x?"left"===x?(f=u.r0+y,p>Math.PI/2&&(x="right")):"right"===x&&(f=u.r-y,p>Math.PI/2&&(x="left")):(f=(u.r+u.r0)/2,x="center"),d.attr("style",{text:l,textAlign:x,textVerticalAlign:n("verticalAlign")||"middle",opacity:n("opacity")});var _=f*g+u.cx,w=f*m+u.cy;d.attr("position",[_,w]);var b=n("rotate"),S=0;"radial"===b?(S=-p)<-Math.PI/2&&(S+=Math.PI):"tangential"===b?(S=Math.PI/2-p)>Math.PI/2?S-=Math.PI:S<-Math.PI/2&&(S+=Math.PI):"number"==typeof b&&(S=b*Math.PI/180),d.attr("rotation",S)},VP._initEvents=function(t,e,i,n){t.off("mouseover").off("mouseout").off("emphasis").off("normal");var o=this,a=function(){o.onEmphasis(n)},r=function(){o.onNormal()};i.isAnimationEnabled()&&t.on("mouseover",a).on("mouseout",r).on("emphasis",a).on("normal",r).on("downplay",function(){o.onDownplay()}).on("highlight",function(){o.onHighlight()})},u(Vm,tb);Ar.extend({type:"sunburst",init:function(){},render:function(t,e,i,n){function o(i,n){if(c||!i||i.getValue()||(i=null),i!==l&&n!==l)if(n&&n.piece)i?(n.piece.updateData(!1,i,"normal",t,e),s.setItemGraphicEl(i.dataIndex,n.piece)):a(n);else if(i){var o=new Vm(i,t,e);h.add(o),s.setItemGraphicEl(i.dataIndex,o)}}function a(t){t&&t.piece&&(h.remove(t.piece),t.piece=null)}var r=this;this.seriesModel=t,this.api=i,this.ecModel=e;var s=t.getData(),l=s.tree.root,u=t.getViewRoot(),h=this.group,c=t.get("renderLabelForZeroData"),d=[];u.eachNode(function(t){d.push(t)});var f=this._oldChildren||[];if(function(t,e){function i(t){return t.getId()}function n(i,n){o(null==i?null:t[i],null==n?null:e[n])}0===t.length&&0===e.length||new Xs(e,t,i,i).add(n).update(n).remove(v(n,null)).execute()}(d,f),function(i,n){if(n.depth>0){r.virtualPiece?r.virtualPiece.updateData(!1,i,"normal",t,e):(r.virtualPiece=new Vm(i,t,e),h.add(r.virtualPiece)),n.piece._onclickEvent&&n.piece.off("click",n.piece._onclickEvent);var o=function(t){r._rootToNode(n.parentNode)};n.piece._onclickEvent=o,r.virtualPiece.on("click",o)}else r.virtualPiece&&(h.remove(r.virtualPiece),r.virtualPiece=null)}(l,u),n&&n.highlight&&n.highlight.piece){var p=t.getShallow("highlightPolicy");n.highlight.piece.onEmphasis(p)}else if(n&&n.unhighlight){var g=this.virtualPiece;!g&&l.children.length&&(g=l.children[0].piece),g&&g.onNormal()}this._initEvents(),this._oldChildren=d},dispose:function(){},_initEvents:function(){var t=this,e=function(e){var i=!1;t.seriesModel.getViewRoot().eachNode(function(n){if(!i&&n.piece&&n.piece.childAt(0)===e.target){var o=n.getModel().get("nodeClick");if("rootToNode"===o)t._rootToNode(n);else if("link"===o){var a=n.getModel(),r=a.get("link");if(r){var s=a.get("target",!0)||"_blank";window.open(r,s)}}i=!0}})};this.group._onclickEvent&&this.group.off("click",this.group._onclickEvent),this.group.on("click",e),this.group._onclickEvent=e},_rootToNode:function(t){t!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:"sunburstRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t})},containPoint:function(t,e){var i=e.getData().getItemLayout(0);if(i){var n=t[0]-i.cx,o=t[1]-i.cy,a=Math.sqrt(n*n+o*o);return a<=i.r&&a>=i.r0}}});var GP="sunburstRootToNode";Es({type:GP,update:"updateView"},function(t,e){e.eachComponent({mainType:"series",subType:"sunburst",query:t},function(e,i){var n=ld(t,[GP],e);if(n){var o=e.getViewRoot();o&&(t.direction=hd(o,n.node)?"rollUp":"drillDown"),e.resetViewRoot(n.node)}})});var FP="sunburstHighlight";Es({type:FP,update:"updateView"},function(t,e){e.eachComponent({mainType:"series",subType:"sunburst",query:t},function(e,i){var n=ld(t,[FP],e);n&&(t.highlight=n.node)})});Es({type:"sunburstUnhighlight",update:"updateView"},function(t,e){e.eachComponent({mainType:"series",subType:"sunburst",query:t},function(e,i){t.unhighlight=!0})});var WP=Math.PI/180;Bs(v(uC,"sunburst")),zs(v(function(t,e,i,n){e.eachSeriesByType(t,function(t){var e=t.get("center"),n=t.get("radius");y(n)||(n=[0,n]),y(e)||(e=[e,e]);var o=i.getWidth(),a=i.getHeight(),r=Math.min(o,a),s=Vo(e[0],o),l=Vo(e[1],a),u=Vo(n[0],r/2),h=Vo(n[1],r/2),c=-t.get("startAngle")*WP,f=t.get("minAngle")*WP,p=t.getData().tree.root,g=t.getViewRoot(),m=g.depth,v=t.get("sort");null!=v&&Zm(g,v);var x=0;d(g.children,function(t){!isNaN(t.getValue())&&x++});var _=g.getValue(),w=Math.PI/(_||x)*2,b=g.depth>0,S=g.height-(b?-1:1),M=(h-u)/(S||1),I=t.get("clockwise"),T=t.get("stillShowZeroSum"),A=I?1:-1,D=function(t,e){if(t){var i=e;if(t!==p){var n=t.getValue(),o=0===_&&T?w:n*w;on[1]&&n.reverse(),{coordSys:{type:"polar",cx:t.cx,cy:t.cy,r:n[1],r0:n[0]},api:{coord:m(function(n){var o=e.dataToRadius(n[0]),a=i.dataToAngle(n[1]),r=t.coordToPoint([o,a]);return r.push(o,a*Math.PI/180),r}),size:m(qm,t)}}},calendar:function(t){var e=t.getRect(),i=t.getRangeInfo();return{coordSys:{type:"calendar",x:e.x,y:e.y,width:e.width,height:e.height,cellWidth:t.getCellWidth(),cellHeight:t.getCellHeight(),rangeInfo:{start:i.start,end:i.end,weeks:i.weeks,dayCount:i.allDay}},api:{coord:function(e,i){return t.dataToPoint(e,i)}}}}};YI.extend({type:"series.custom",dependencies:["grid","polar","geo","singleAxis","calendar"],defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,useTransform:!0},getInitialData:function(t,e){return ml(this.getSource(),this)},getDataParams:function(t,e,i){var n=YI.prototype.getDataParams.apply(this,arguments);return i&&(n.info=i.info),n}}),Ar.extend({type:"custom",_data:null,render:function(t,e,i,n){var o=this._data,a=t.getData(),r=this.group,s=Qm(t,a,e,i);a.diff(o).add(function(e){ev(null,e,s(e,n),t,r,a)}).update(function(e,i){ev(o.getItemGraphicEl(i),e,s(e,n),t,r,a)}).remove(function(t){var e=o.getItemGraphicEl(t);e&&r.remove(e)}).execute(),this._data=a},incrementalPrepareRender:function(t,e,i){this.group.removeAll(),this._data=null},incrementalRender:function(t,e,i,n,o){for(var a=e.getData(),r=Qm(e,a,i,n),s=t.start;s=0;l--)null==o[l]?o.splice(l,1):delete o[l].$action},_flatten:function(t,e,i){d(t,function(t){if(t){i&&(t.parentOption=i),e.push(t);var n=t.children;"group"===t.type&&n&&this._flatten(n,e,t),delete t.children}},this)},useElOptionsToUpdate:function(){var t=this._elOptionsToUpdate;return this._elOptionsToUpdate=null,t}});Ws({type:"graphic",init:function(t,e){this._elMap=R(),this._lastGraphicModel},render:function(t,e,i){t!==this._lastGraphicModel&&this._clear(),this._lastGraphicModel=t,this._updateElements(t),this._relocate(t,i)},_updateElements:function(t){var e=t.useElOptionsToUpdate();if(e){var i=this._elMap,n=this.group;d(e,function(e){var o=e.$action,a=e.id,r=i.get(a),s=e.parentId,l=null!=s?i.get(s):n,u=e.style;"text"===e.type&&u&&(e.hv&&e.hv[1]&&(u.textVerticalAlign=u.textBaseline=null),!u.hasOwnProperty("textFill")&&u.fill&&(u.textFill=u.fill),!u.hasOwnProperty("textStroke")&&u.stroke&&(u.textStroke=u.stroke));var h=fv(e);o&&"merge"!==o?"replace"===o?(dv(r,i),cv(a,l,h,i)):"remove"===o&&dv(r,i):r?r.attr(h):cv(a,l,h,i);var c=i.get(a);c&&(c.__ecGraphicWidth=e.width,c.__ecGraphicHeight=e.height,yv(c,t))})}},_relocate:function(t,e){for(var i=t.option.elements,n=this.group,o=this._elMap,a=i.length-1;a>=0;a--){var r=i[a],s=o.get(r.id);if(s){var l=s.parent;da(s,r,l===n?{width:e.getWidth(),height:e.getHeight()}:{width:l.__ecGraphicWidth||0,height:l.__ecGraphicHeight||0},null,{hv:r.hv,boundingMode:r.bounding})}}},_clear:function(){var t=this._elMap;t.each(function(e){dv(e,t)}),this._elMap=R()},dispose:function(){this._clear()}});var KP=Fs({type:"legend.plain",dependencies:["series"],layoutMode:{type:"box",ignoreSize:!0},init:function(t,e,i){this.mergeDefaultAndTheme(t,i),t.selected=t.selected||{}},mergeOption:function(t){KP.superCall(this,"mergeOption",t)},optionUpdated:function(){this._updateData(this.ecModel);var t=this._data;if(t[0]&&"single"===this.get("selectedMode")){for(var e=!1,i=0;i=0},defaultOption:{zlevel:0,z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,inactiveColor:"#ccc",textStyle:{color:"#333"},selectedMode:!0,tooltip:{show:!1}}});Es("legendToggleSelect","legendselectchanged",v(xv,"toggleSelected")),Es("legendSelect","legendselected",v(xv,"select")),Es("legendUnSelect","legendunselected",v(xv,"unSelect"));var $P=v,JP=d,QP=tb,tN=Ws({type:"legend.plain",newlineDisabled:!1,init:function(){this.group.add(this._contentGroup=new QP),this._backgroundEl,this._isFirstRender=!0},getContentGroup:function(){return this._contentGroup},render:function(t,e,i){var n=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),t.get("show",!0)){var o=t.get("align");o&&"auto"!==o||(o="right"===t.get("left")&&"vertical"===t.get("orient")?"right":"left"),this.renderInner(o,t,e,i);var a=t.getBoxLayoutParams(),s={width:i.getWidth(),height:i.getHeight()},l=t.get("padding"),u=ca(a,s,l),h=this.layoutInner(t,o,u,n),c=ca(r({width:h.width,height:h.height},a),s,l);this.group.attr("position",[c.x-h.x,c.y-h.y]),this.group.add(this._backgroundEl=wv(h,t))}},resetInner:function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl)},renderInner:function(t,e,i,n){var o=this.getContentGroup(),a=R(),r=e.get("selectedMode"),s=[];i.eachRawSeries(function(t){!t.get("legendHoverLink")&&s.push(t.id)}),JP(e.getData(),function(l,u){var h=l.get("name");if(this.newlineDisabled||""!==h&&"\n"!==h){var c=i.getSeriesByName(h)[0];if(!a.get(h))if(c){var d=c.getData(),f=d.getVisual("color");"function"==typeof f&&(f=f(c.getDataParams(0)));var p=d.getVisual("legendSymbol")||"roundRect",g=d.getVisual("symbol");this._createItem(h,u,l,e,p,g,t,f,r).on("click",$P(bv,h,n)).on("mouseover",$P(Sv,c.name,null,n,s)).on("mouseout",$P(Mv,c.name,null,n,s)),a.set(h,!0)}else i.eachRawSeries(function(i){if(!a.get(h)&&i.legendDataProvider){var o=i.legendDataProvider(),c=o.indexOfName(h);if(c<0)return;var d=o.getItemVisual(c,"color");this._createItem(h,u,l,e,"roundRect",null,t,d,r).on("click",$P(bv,h,n)).on("mouseover",$P(Sv,null,h,n,s)).on("mouseout",$P(Mv,null,h,n,s)),a.set(h,!0)}},this)}else o.add(new QP({newline:!0}))},this)},_createItem:function(t,e,i,n,o,r,s,l,u){var h=n.get("itemWidth"),c=n.get("itemHeight"),d=n.get("inactiveColor"),f=n.get("symbolKeepAspect"),p=n.isSelected(t),g=new QP,m=i.getModel("textStyle"),v=i.get("icon"),y=i.getModel("tooltip"),x=y.parentModel;if(o=v||o,g.add(Jl(o,0,0,h,c,p?l:d,null==f||f)),!v&&r&&(r!==o||"none"===r)){var _=.8*c;"none"===r&&(r="circle"),g.add(Jl(r,(h-_)/2,(c-_)/2,_,_,p?l:d,null==f||f))}var w="left"===s?h+5:-5,b=s,S=n.get("formatter"),M=t;"string"==typeof S&&S?M=S.replace("{name}",null!=t?t:""):"function"==typeof S&&(M=S(t)),g.add(new rM({style:mo({},m,{text:M,x:w,y:c/2,textFill:p?m.getTextColor():d,textAlign:b,textVerticalAlign:"middle"})}));var I=new yM({shape:g.getBoundingRect(),invisible:!0,tooltip:y.get("show")?a({content:t,formatter:x.get("formatter",!0)||function(){return t},formatterParams:{componentType:"legend",legendIndex:n.componentIndex,name:t,$vars:["name"]}},y.option):null});return g.add(I),g.eachChild(function(t){t.silent=!0}),I.silent=!u,this.getContentGroup().add(g),fo(g),g.__legendDataIndex=e,g},layoutInner:function(t,e,i){var n=this.getContentGroup();aI(t.get("orient"),n,t.get("itemGap"),i.width,i.height);var o=n.getBoundingRect();return n.attr("position",[-o.x,-o.y]),this.group.getBoundingRect()},remove:function(){this.getContentGroup().removeAll(),this._isFirstRender=!0}});Os(function(t){var e=t.findComponents({mainType:"legend"});e&&e.length&&t.filterSeries(function(t){for(var i=0;ii[l],p=[-c.x,-c.y];n||(p[s]=o.position[s]);var g=[0,0],m=[-d.x,-d.y],v=A(t.get("pageButtonGap",!0),t.get("itemGap",!0));f&&("end"===t.get("pageButtonPosition",!0)?m[s]+=i[l]-d[l]:g[s]+=d[l]+v),m[1-s]+=c[u]/2-d[u]/2,o.attr("position",p),a.attr("position",g),r.attr("position",m);var y=this.group.getBoundingRect();if((y={x:0,y:0})[l]=f?i[l]:c[l],y[u]=Math.max(c[u],d[u]),y[h]=Math.min(0,d[h]+m[1-s]),a.__rectSize=i[l],f){var x={x:0,y:0};x[l]=Math.max(i[l]-d[l]-v,0),x[u]=y[u],a.setClipPath(new yM({shape:x})),a.__rectSize=x[l]}else r.eachChild(function(t){t.attr({invisible:!0,silent:!0})});var _=this._getPageInfo(t);return null!=_.pageIndex&&Io(o,{position:_.contentPosition},!!f&&t),this._updatePageInfoView(t,_),y},_pageGo:function(t,e,i){var n=this._getPageInfo(e)[t];null!=n&&i.dispatchAction({type:"legendScroll",scrollDataIndex:n,legendId:e.id})},_updatePageInfoView:function(t,e){var i=this._controllerGroup;d(["pagePrev","pageNext"],function(n){var o=null!=e[n+"DataIndex"],a=i.childOfName(n);a&&(a.setStyle("fill",o?t.get("pageIconColor",!0):t.get("pageIconInactiveColor",!0)),a.cursor=o?"pointer":"default")});var n=i.childOfName("pageText"),o=t.get("pageFormatter"),a=e.pageIndex,r=null!=a?a+1:0,s=e.pageCount;n&&o&&n.setStyle("text",_(o)?o.replace("{current}",r).replace("{total}",s):o({current:r,total:s}))},_getPageInfo:function(t){function e(t){if(t){var e=t.getBoundingRect(),i=e[l]+t.position[r];return{s:i,e:i+e[s],i:t.__legendDataIndex}}}function i(t,e){return t.e>=e&&t.s<=e+a}var n=t.get("scrollDataIndex",!0),o=this.getContentGroup(),a=this._containerGroup.__rectSize,r=t.getOrient().index,s=nN[r],l=oN[r],u=this._findTargetItemIndex(n),h=o.children(),c=h[u],d=h.length,f=d?1:0,p={contentPosition:o.position.slice(),pageCount:f,pageIndex:f-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!c)return p;var g=e(c);p.contentPosition[r]=-g.s;for(var m=u+1,v=g,y=g,x=null;m<=d;++m)(!(x=e(h[m]))&&y.e>v.s+a||x&&!i(x,v.s))&&(v=y.i>v.i?y:x)&&(null==p.pageNextDataIndex&&(p.pageNextDataIndex=v.i),++p.pageCount),y=x;for(var m=u-1,v=g,y=g,x=null;m>=-1;--m)(x=e(h[m]))&&i(y,x.s)||!(v.i=0;){var r=o.indexOf("|}"),s=o.substr(a+"{marker".length,r-a-"{marker".length);s.indexOf("sub")>-1?n["marker"+s]={textWidth:4,textHeight:4,textBorderRadius:2,textBackgroundColor:e[s],textOffset:[3,0]}:n["marker"+s]={textWidth:10,textHeight:10,textBorderRadius:5,textBackgroundColor:e[s]},a=(o=o.substr(r+1)).indexOf("{marker")}this.el=new rM({style:{rich:n,text:t,textLineHeight:20,textBackgroundColor:i.get("backgroundColor"),textBorderRadius:i.get("borderRadius"),textFill:i.get("textStyle.color"),textPadding:i.get("padding")},z:i.get("z")}),this._zr.add(this.el);var l=this;this.el.on("mouseover",function(){l._enterable&&(clearTimeout(l._hideTimeout),l._show=!0),l._inContent=!0}),this.el.on("mouseout",function(){l._enterable&&l._show&&l.hideLater(l._hideDelay),l._inContent=!1})},setEnterable:function(t){this._enterable=t},getSize:function(){var t=this.el.getBoundingRect();return[t.width,t.height]},moveTo:function(t,e){this.el&&this.el.attr("position",[t,e])},hide:function(){this.el?this.el.hide():true,this._show=!1},hideLater:function(t){!this._show||this._inContent&&this._enterable||(t?(this._hideDelay=t,this._show=!1,this._hideTimeout=setTimeout(m(this.hide,this),t)):this.hide())},isShow:function(){return this._show},getOuterSize:function(){return this.getSize()}};var uN=m,hN=d,cN=Vo,dN=new yM({shape:{x:-1,y:-1,width:2,height:2}});Ws({type:"tooltip",init:function(t,e){if(!U_.node){var i=t.getComponent("tooltip").get("renderMode");this._renderMode=Hi(i);var n;"html"===this._renderMode?(n=new Cv(e.getDom(),e),this._newLine="
"):(n=new Lv(e),this._newLine="\n"),this._tooltipContent=n}},render:function(t,e,i){if(!U_.node){this.group.removeAll(),this._tooltipModel=t,this._ecModel=e,this._api=i,this._lastDataByCoordSys=null,this._alwaysShowContent=t.get("alwaysShowContent");var n=this._tooltipContent;n.update(),n.setEnterable(t.get("enterable")),this._initGlobalListener(),this._keepShow()}},_initGlobalListener:function(){var t=this._tooltipModel.get("triggerOn");um("itemTooltip",this._api,uN(function(e,i,n){"none"!==t&&(t.indexOf(e)>=0?this._tryShow(i,n):"leave"===e&&this._hide(n))},this))},_keepShow:function(){var t=this._tooltipModel,e=this._ecModel,i=this._api;if(null!=this._lastX&&null!=this._lastY&&"none"!==t.get("triggerOn")){var n=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){n.manuallyShowTip(t,e,i,{x:n._lastX,y:n._lastY})})}},manuallyShowTip:function(t,e,i,n){if(n.from!==this.uid&&!U_.node){var o=Pv(n,i);this._ticket="";var a=n.dataByCoordSys;if(n.tooltip&&null!=n.x&&null!=n.y){var r=dN;r.position=[n.x,n.y],r.update(),r.tooltip=n.tooltip,this._tryShow({offsetX:n.x,offsetY:n.y,target:r},o)}else if(a)this._tryShow({offsetX:n.x,offsetY:n.y,position:n.position,event:{},dataByCoordSys:n.dataByCoordSys,tooltipOption:n.tooltipOption},o);else if(null!=n.seriesIndex){if(this._manuallyAxisShowTip(t,e,i,n))return;var s=xP(n,e),l=s.point[0],u=s.point[1];null!=l&&null!=u&&this._tryShow({offsetX:l,offsetY:u,position:n.position,target:s.el,event:{}},o)}else null!=n.x&&null!=n.y&&(i.dispatchAction({type:"updateAxisPointer",x:n.x,y:n.y}),this._tryShow({offsetX:n.x,offsetY:n.y,position:n.position,target:i.getZr().findHover(n.x,n.y).target,event:{}},o))}},manuallyHideTip:function(t,e,i,n){var o=this._tooltipContent;!this._alwaysShowContent&&this._tooltipModel&&o.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=null,n.from!==this.uid&&this._hide(Pv(n,i))},_manuallyAxisShowTip:function(t,e,i,n){var o=n.seriesIndex,a=n.dataIndex,r=e.getComponent("axisPointer").coordSysAxesInfo;if(null!=o&&null!=a&&null!=r){var s=e.getSeriesByIndex(o);if(s&&"axis"===(t=kv([s.getData().getItemModel(a),s,(s.coordinateSystem||{}).model,t])).get("trigger"))return i.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:a,position:n.position}),!0}},_tryShow:function(t,e){var i=t.target;if(this._tooltipModel){this._lastX=t.offsetX,this._lastY=t.offsetY;var n=t.dataByCoordSys;n&&n.length?this._showAxisTooltip(n,t):i&&null!=i.dataIndex?(this._lastDataByCoordSys=null,this._showSeriesItemTooltip(t,i,e)):i&&i.tooltip?(this._lastDataByCoordSys=null,this._showComponentItemTooltip(t,i,e)):(this._lastDataByCoordSys=null,this._hide(e))}},_showOrMove:function(t,e){var i=t.get("showDelay");e=m(e,this),clearTimeout(this._showTimout),i>0?this._showTimout=setTimeout(e,i):e()},_showAxisTooltip:function(t,e){var i=this._ecModel,o=this._tooltipModel,a=[e.offsetX,e.offsetY],r=[],s=[],l=kv([e.tooltipOption,o]),u=this._renderMode,h=this._newLine,c={};hN(t,function(t){hN(t.dataByAxis,function(t){var e=i.getComponent(t.axisDim+"Axis",t.axisIndex),o=t.value,a=[];if(e&&null!=o){var l=Im(o,e.axis,i,t.seriesDataIndices,t.valueLabelOpt);d(t.seriesDataIndices,function(r){var h=i.getSeriesByIndex(r.seriesIndex),d=r.dataIndexInside,f=h&&h.getDataParams(d);if(f.axisDim=t.axisDim,f.axisIndex=t.axisIndex,f.axisType=t.axisType,f.axisId=t.axisId,f.axisValue=Xl(e.axis,o),f.axisValueLabel=l,f){s.push(f);var p,g=h.formatTooltip(d,!0,null,u);if(w(g)){p=g.html;var m=g.markers;n(c,m)}else p=g;a.push(p)}});var f=l;"html"!==u?r.push(a.join(h)):r.push((f?ia(f)+h:"")+a.join(h))}})},this),r.reverse(),r=r.join(this._newLine+this._newLine);var f=e.position;this._showOrMove(l,function(){this._updateContentNotChangedOnAxis(t)?this._updatePosition(l,f,a[0],a[1],this._tooltipContent,s):this._showTooltipContent(l,r,s,Math.random(),a[0],a[1],f,void 0,c)})},_showSeriesItemTooltip:function(t,e,i){var n=this._ecModel,o=e.seriesIndex,a=n.getSeriesByIndex(o),r=e.dataModel||a,s=e.dataIndex,l=e.dataType,u=r.getData(),h=kv([u.getItemModel(s),r,a&&(a.coordinateSystem||{}).model,this._tooltipModel]),c=h.get("trigger");if(null==c||"item"===c){var d,f,p=r.getDataParams(s,l),g=r.formatTooltip(s,!1,l,this._renderMode);w(g)?(d=g.html,f=g.markers):(d=g,f=null);var m="item_"+r.name+"_"+s;this._showOrMove(h,function(){this._showTooltipContent(h,d,p,m,t.offsetX,t.offsetY,t.position,t.target,f)}),i({type:"showTip",dataIndexInside:s,dataIndex:u.getRawIndex(s),seriesIndex:o,from:this.uid})}},_showComponentItemTooltip:function(t,e,i){var n=e.tooltip;if("string"==typeof n){var o=n;n={content:o,formatter:o}}var a=new No(n,this._tooltipModel,this._ecModel),r=a.get("content"),s=Math.random();this._showOrMove(a,function(){this._showTooltipContent(a,r,a.get("formatterParams")||{},s,t.offsetX,t.offsetY,t.position,e)}),i({type:"showTip",from:this.uid})},_showTooltipContent:function(t,e,i,n,o,a,r,s,l){if(this._ticket="",t.get("showContent")&&t.get("show")){var u=this._tooltipContent,h=t.get("formatter");r=r||t.get("position");var c=e;if(h&&"string"==typeof h)c=na(h,i,!0);else if("function"==typeof h){var d=uN(function(e,n){e===this._ticket&&(u.setContent(n,l,t),this._updatePosition(t,r,o,a,u,i,s))},this);this._ticket=n,c=h(i,n,d)}u.setContent(c,l,t),u.show(t),this._updatePosition(t,r,o,a,u,i,s)}},_updatePosition:function(t,e,i,n,o,a,r){var s=this._api.getWidth(),l=this._api.getHeight();e=e||t.get("position");var u=o.getSize(),h=t.get("align"),c=t.get("verticalAlign"),d=r&&r.getBoundingRect().clone();if(r&&d.applyTransform(r.transform),"function"==typeof e&&(e=e([i,n],a,o.el,d,{viewSize:[s,l],contentSize:u.slice()})),y(e))i=cN(e[0],s),n=cN(e[1],l);else if(w(e)){e.width=u[0],e.height=u[1];var f=ca(e,{width:s,height:l});i=f.x,n=f.y,h=null,c=null}else"string"==typeof e&&r?(i=(p=Ev(e,d,u))[0],n=p[1]):(i=(p=Nv(i,n,o,s,l,h?null:20,c?null:20))[0],n=p[1]);if(h&&(i-=Rv(h)?u[0]/2:"right"===h?u[0]:0),c&&(n-=Rv(c)?u[1]/2:"bottom"===c?u[1]:0),t.get("confine")){var p=Ov(i,n,o,s,l);i=p[0],n=p[1]}o.moveTo(i,n)},_updateContentNotChangedOnAxis:function(t){var e=this._lastDataByCoordSys,i=!!e&&e.length===t.length;return i&&hN(e,function(e,n){var o=e.dataByAxis||{},a=(t[n]||{}).dataByAxis||[];(i&=o.length===a.length)&&hN(o,function(t,e){var n=a[e]||{},o=t.seriesDataIndices||[],r=n.seriesDataIndices||[];(i&=t.value===n.value&&t.axisType===n.axisType&&t.axisId===n.axisId&&o.length===r.length)&&hN(o,function(t,e){var n=r[e];i&=t.seriesIndex===n.seriesIndex&&t.dataIndex===n.dataIndex})})}),this._lastDataByCoordSys=t,!!i},_hide:function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},dispose:function(t,e){U_.node||(this._tooltipContent.hide(),gm("itemTooltip",e))}}),Es({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},function(){}),Es({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},function(){}),Gv.prototype={constructor:Gv,pointToData:function(t,e){return this.polar.pointToData(t,e)["radius"===this.dim?0:1]},dataToRadius:aD.prototype.dataToCoord,radiusToData:aD.prototype.coordToData},u(Gv,aD);var fN=Bi();Fv.prototype={constructor:Fv,pointToData:function(t,e){return this.polar.pointToData(t,e)["radius"===this.dim?0:1]},dataToAngle:aD.prototype.dataToCoord,angleToData:aD.prototype.coordToData,calculateCategoryInterval:function(){var t=this,e=t.getLabelModel(),i=t.scale,n=i.getExtent(),o=i.count();if(n[1]-n[0]<1)return 0;var a=n[0],r=t.dataToCoord(a+1)-t.dataToCoord(a),s=Math.abs(r),l=ke(a,e.getFont(),"center","top"),u=Math.max(l.height,7)/s;isNaN(u)&&(u=1/0);var h=Math.max(0,Math.floor(u)),c=fN(t.model),d=c.lastAutoInterval,f=c.lastTickCount;return null!=d&&null!=f&&Math.abs(d-h)<=1&&Math.abs(f-o)<=1&&d>h?h=d:(c.lastTickCount=o,c.lastAutoInterval=h),h}},u(Fv,aD);var pN=function(t){this.name=t||"",this.cx=0,this.cy=0,this._radiusAxis=new Gv,this._angleAxis=new Fv,this._radiusAxis.polar=this._angleAxis.polar=this};pN.prototype={type:"polar",axisPointerEnabled:!0,constructor:pN,dimensions:["radius","angle"],model:null,containPoint:function(t){var e=this.pointToCoord(t);return this._radiusAxis.contain(e[0])&&this._angleAxis.contain(e[1])},containData:function(t){return this._radiusAxis.containData(t[0])&&this._angleAxis.containData(t[1])},getAxis:function(t){return this["_"+t+"Axis"]},getAxes:function(){return[this._radiusAxis,this._angleAxis]},getAxesByScale:function(t){var e=[],i=this._angleAxis,n=this._radiusAxis;return i.scale.type===t&&e.push(i),n.scale.type===t&&e.push(n),e},getAngleAxis:function(){return this._angleAxis},getRadiusAxis:function(){return this._radiusAxis},getOtherAxis:function(t){var e=this._angleAxis;return t===e?this._radiusAxis:e},getBaseAxis:function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},getTooltipAxes:function(t){var e=null!=t&&"auto"!==t?this.getAxis(t):this.getBaseAxis();return{baseAxes:[e],otherAxes:[this.getOtherAxis(e)]}},dataToPoint:function(t,e){return this.coordToPoint([this._radiusAxis.dataToRadius(t[0],e),this._angleAxis.dataToAngle(t[1],e)])},pointToData:function(t,e){var i=this.pointToCoord(t);return[this._radiusAxis.radiusToData(i[0],e),this._angleAxis.angleToData(i[1],e)]},pointToCoord:function(t){var e=t[0]-this.cx,i=t[1]-this.cy,n=this.getAngleAxis(),o=n.getExtent(),a=Math.min(o[0],o[1]),r=Math.max(o[0],o[1]);n.inverse?a=r-360:r=a+360;var s=Math.sqrt(e*e+i*i);e/=s,i/=s;for(var l=Math.atan2(-i,e)/Math.PI*180,u=lr;)l+=360*u;return[s,l]},coordToPoint:function(t){var e=t[0],i=t[1]/180*Math.PI;return[Math.cos(i)*e+this.cx,-Math.sin(i)*e+this.cy]}};var gN=lI.extend({type:"polarAxis",axis:null,getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"polar",index:this.option.polarIndex,id:this.option.polarId})[0]}});n(gN.prototype,UA);var mN={angle:{startAngle:90,clockwise:!0,splitNumber:12,axisLabel:{rotate:!1}},radius:{splitNumber:5}};ED("angle",gN,Wv,mN.angle),ED("radius",gN,Wv,mN.radius),Fs({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%"}});var vN={dimensions:pN.prototype.dimensions,create:function(t,e){var i=[];return t.eachComponent("polar",function(t,n){var o=new pN(n);o.update=Zv;var a=o.getRadiusAxis(),r=o.getAngleAxis(),s=t.findAxisModel("radiusAxis"),l=t.findAxisModel("angleAxis");Uv(a,s),Uv(r,l),Hv(o,t,e),i.push(o),t.coordinateSystem=o,o.model=t}),t.eachSeries(function(e){if("polar"===e.get("coordinateSystem")){var i=t.queryComponents({mainType:"polar",index:e.get("polarIndex"),id:e.get("polarId")})[0];e.coordinateSystem=i.coordinateSystem}}),i}};Fa.register("polar",vN);var yN=["axisLine","axisLabel","axisTick","splitLine","splitArea"];XD.extend({type:"angleAxis",axisPointerClass:"PolarAxisPointer",render:function(t,e){if(this.group.removeAll(),t.get("show")){var n=t.axis,o=n.polar,a=o.getRadiusAxis().getExtent(),r=n.getTicksCoords(),s=f(n.getViewLabels(),function(t){return(t=i(t)).coord=n.dataToCoord(t.tickValue),t});Yv(s),Yv(r),d(yN,function(e){!t.get(e+".show")||n.scale.isBlank()&&"axisLine"!==e||this["_"+e](t,o,r,a,s)},this)}},_axisLine:function(t,e,i,n){var o=t.getModel("axisLine.lineStyle"),a=new sM({shape:{cx:e.cx,cy:e.cy,r:n[jv(e)]},style:o.getLineStyle(),z2:1,silent:!0});a.style.fill=null,this.group.add(a)},_axisTick:function(t,e,i,n){var o=t.getModel("axisTick"),a=(o.get("inside")?-1:1)*o.get("length"),s=n[jv(e)],l=f(i,function(t){return new _M({shape:Xv(e,[s,s+a],t.coord)})});this.group.add(OM(l,{style:r(o.getModel("lineStyle").getLineStyle(),{stroke:t.get("axisLine.lineStyle.color")})}))},_axisLabel:function(t,e,i,n,o){var a=t.getCategories(!0),r=t.getModel("axisLabel"),s=r.get("margin");d(o,function(i,o){var l=r,u=i.tickValue,h=n[jv(e)],c=e.coordToPoint([h+s,i.coord]),d=e.cx,f=e.cy,p=Math.abs(c[0]-d)/h<.3?"center":c[0]>d?"left":"right",g=Math.abs(c[1]-f)/h<.3?"middle":c[1]>f?"top":"bottom";a&&a[u]&&a[u].textStyle&&(l=new No(a[u].textStyle,r,r.ecModel));var m=new rM({silent:!0});this.group.add(m),mo(m.style,l,{x:c[0],y:c[1],textFill:l.getTextColor()||t.get("axisLine.lineStyle.color"),text:i.formattedLabel,textAlign:p,textVerticalAlign:g})},this)},_splitLine:function(t,e,i,n){var o=t.getModel("splitLine").getModel("lineStyle"),a=o.get("color"),s=0;a=a instanceof Array?a:[a];for(var l=[],u=0;u=0?"p":"n",M=y;v&&(n[r][b]||(n[r][b]={p:y,n:y}),M=n[r][b][S]);var I,T,A,D;if("radius"===h.dim){var C=h.dataToRadius(w)-y,L=a.dataToAngle(b);Math.abs(C)=0},kN.findTargetInfo=function(t,e){for(var i=this._targetInfoList,n=dy(e,t),o=0;o=0||AN(n,t.getAxis("y").model)>=0)&&a.push(t)}),e.push({panelId:"grid--"+t.id,gridModel:t,coordSysModel:t,coordSys:a[0],coordSyses:a,getPanelRect:ON.grid,xAxisDeclared:r[t.id],yAxisDeclared:s[t.id]})}))},geo:function(t,e){TN(t.geoModels,function(t){var i=t.coordinateSystem;e.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:i,coordSyses:[i],getPanelRect:ON.geo})})}},NN=[function(t,e){var i=t.xAxisModel,n=t.yAxisModel,o=t.gridModel;return!o&&i&&(o=i.axis.grid.model),!o&&n&&(o=n.axis.grid.model),o&&o===e.gridModel},function(t,e){var i=t.geoModel;return i&&i===e.geoModel}],ON={grid:function(){return this.coordSys.grid.getRect().clone()},geo:function(){var t=this.coordSys,e=t.getBoundingRect().clone();return e.applyTransform(Ao(t)),e}},EN={lineX:DN(fy,0),lineY:DN(fy,1),rect:function(t,e,i){var n=e[CN[t]]([i[0][0],i[1][0]]),o=e[CN[t]]([i[0][1],i[1][1]]),a=[cy([n[0],o[0]]),cy([n[1],o[1]])];return{values:a,xyMinMax:a}},polygon:function(t,e,i){var n=[[1/0,-1/0],[1/0,-1/0]];return{values:f(i,function(i){var o=e[CN[t]](i);return n[0][0]=Math.min(n[0][0],o[0]),n[1][0]=Math.min(n[1][0],o[1]),n[0][1]=Math.max(n[0][1],o[0]),n[1][1]=Math.max(n[1][1],o[1]),o}),xyMinMax:n}}},RN={lineX:DN(py,0),lineY:DN(py,1),rect:function(t,e,i){return[[t[0][0]-i[0]*e[0][0],t[0][1]-i[0]*e[0][1]],[t[1][0]-i[1]*e[1][0],t[1][1]-i[1]*e[1][1]]]},polygon:function(t,e,i){return f(t,function(t,n){return[t[0]-i[0]*e[n][0],t[1]-i[1]*e[n][1]]})}},zN=["inBrush","outOfBrush"],BN="__ecBrushSelect",VN="__ecInBrushSelectEvent",GN=VT.VISUAL.BRUSH;zs(GN,function(t,e,i){t.eachComponent({mainType:"brush"},function(e){i&&"takeGlobalCursor"===i.type&&e.setBrushOption("brush"===i.key?i.brushOption:{brushType:!1}),(e.brushTargetManager=new hy(e.option,t)).setInputRanges(e.areas,t)})}),Bs(GN,function(t,e,n){var o,a,s=[];t.eachComponent({mainType:"brush"},function(e,n){function l(t){return"all"===m||v[t]}function u(t){return!!t.length}function h(t,e){var i=t.coordinateSystem;w|=i.hasAxisBrushed(),l(e)&&i.eachActiveState(t.getData(),function(t,e){"active"===t&&(x[e]=1)})}function c(i,n,o){var a=_y(i);if(a&&!wy(e,n)&&(d(b,function(n){a[n.brushType]&&e.brushTargetManager.controlSeries(n,i,t)&&o.push(n),w|=u(o)}),l(n)&&u(o))){var r=i.getData();r.each(function(t){xy(a,o,r,t)&&(x[t]=1)})}}var p={brushId:e.id,brushIndex:n,brushName:e.name,areas:i(e.areas),selected:[]};s.push(p);var g=e.option,m=g.brushLink,v=[],x=[],_=[],w=0;n||(o=g.throttleType,a=g.throttleDelay);var b=f(e.areas,function(t){return by(r({boundingRect:FN[t.brushType](t)},t))}),S=ty(e.option,zN,function(t){t.mappingMethod="fixed"});y(m)&&d(m,function(t){v[t]=1}),t.eachSeries(function(t,e){var i=_[e]=[];"parallel"===t.subType?h(t,e):c(t,e,i)}),t.eachSeries(function(t,e){var i={seriesId:t.id,seriesIndex:e,seriesName:t.name,dataIndex:[]};p.selected.push(i);var n=_y(t),o=_[e],a=t.getData(),r=l(e)?function(t){return x[t]?(i.dataIndex.push(a.getRawIndex(t)),"inBrush"):"outOfBrush"}:function(t){return xy(n,o,a,t)?(i.dataIndex.push(a.getRawIndex(t)),"inBrush"):"outOfBrush"};(l(e)?w:u(o))&&iy(zN,S,a,r)})}),vy(e,o,a,s,n)});var FN={lineX:B,lineY:B,rect:function(t){return Sy(t.range)},polygon:function(t){for(var e,i=t.range,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&&Sy(e)}},WN=["#ddd"];Fs({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&&ey(i,t,["inBrush","outOfBrush"]);var n=i.inBrush=i.inBrush||{};i.outOfBrush=i.outOfBrush||{color:WN},n.hasOwnProperty("liftZ")||(n.liftZ=5)},setAreas:function(t){t&&(this.areas=f(t,function(t){return My(this.option,t)},this))},setBrushOption:function(t){this.brushOption=My(this.option,t),this.brushType=this.brushOption.brushType}});Ws({type:"brush",init:function(t,e){this.ecModel=t,this.api=e,this.model,(this._brushController=new zf(e.getZr())).on("brush",m(this._onBrush,this)).mount()},render:function(t){return this.model=t,Iy.apply(this,arguments)},updateTransform:Iy,updateView:Iy,dispose:function(){this._brushController.dispose()},_onBrush:function(t,e){var n=this.model.id;this.model.brushTargetManager.setOutputRanges(t,this.ecModel),(!e.isEnd||e.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:n,areas:i(t),$from:n})}}),Es({type:"brush",event:"brush"},function(t,e){e.eachComponent({mainType:"brush",query:t},function(e){e.setAreas(t.areas)})}),Es({type:"brushSelect",event:"brushSelected",update:"none"},function(){});var HN={},ZN=rT.toolbox.brush;Dy.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:i(ZN.title)};var UN=Dy.prototype;UN.render=UN.updateView=function(t,e,i){var n,o,a;e.eachComponent({mainType:"brush"},function(t){n=t.brushType,o=t.brushOption.brushMode||"single",a|=t.areas.length}),this._brushType=n,this._brushMode=o,d(t.get("type",!0),function(e){t.setIconStatus(e,("keep"===e?"multiple"===o:"clear"===e?a:e===n)?"emphasis":"normal")})},UN.getIcons=function(){var t=this.model,e=t.get("icon",!0),i={};return d(t.get("type",!0),function(t){e[t]&&(i[t]=e[t])}),i},UN.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}})},Ty("brush",Dy),Ns(function(t,e){var i=t&&t.brush;if(y(i)||(i=i?[i]:[]),i.length){var n=[];d(i,function(t){var e=t.hasOwnProperty("toolbox")?t.toolbox:[];e instanceof Array&&(n=n.concat(e))});var o=t&&t.toolbox;y(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),Jv(s),e&&!s.length&&s.push.apply(s,SN)}});Cy.prototype={constructor:Cy,type:"calendar",dimensions:["time","value"],getDimensionsInfo:function(){return[{name:"time",type:"time"},"value"]},getRangeInfo:function(){return this._rangeInfo},getModel:function(){return this._model},getRect:function(){return this._rect},getCellWidth:function(){return this._sw},getCellHeight:function(){return this._sh},getOrient:function(){return this._orient},getFirstDayOfWeek:function(){return this._firstDayOfWeek},getDateInfo:function(t){var e=(t=Yo(t)).getFullYear(),i=t.getMonth()+1;i=i<10?"0"+i:i;var n=t.getDate();n=n<10?"0"+n:n;var o=t.getDay();return o=Math.abs((o+7-this.getFirstDayOfWeek())%7),{y:e,m:i,d:n,day:o,time:t.getTime(),formatedDate:e+"-"+i+"-"+n,date:t}},getNextNDay:function(t,e){return 0===(e=e||0)?this.getDateInfo(t):((t=new Date(this.getDateInfo(t).time)).setDate(t.getDate()+e),this.getDateInfo(t))},update:function(t,e){function i(t,e){return null!=t[e]&&"auto"!==t[e]}this._firstDayOfWeek=+this._model.getModel("dayLabel").get("firstDay"),this._orient=this._model.get("orient"),this._lineWidth=this._model.getModel("itemStyle").getItemStyle().lineWidth||0,this._rangeInfo=this._getRangeInfo(this._initRangeOption());var n=this._rangeInfo.weeks||1,o=["width","height"],a=this._model.get("cellSize").slice(),r=this._model.getBoxLayoutParams(),s="horizontal"===this._orient?[n,7]:[7,n];d([0,1],function(t){i(a,t)&&(r[o[t]]=a[t]*s[t])});var l={width:e.getWidth(),height:e.getHeight()},u=this._rect=ca(r,l);d([0,1],function(t){i(a,t)||(a[t]=u[o[t]]/s[t])}),this._sw=a[0],this._sh=a[1]},dataToPoint:function(t,e){y(t)&&(t=t[0]),null==e&&(e=!0);var i=this.getDateInfo(t),n=this._rangeInfo,o=i.formatedDate;if(e&&!(i.time>=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=n.getTime()-t[1].time>0?1:-1;n.getDate()!==a&&(n.getTime()-t[1].time)*r>0;)i-=r,n.setDate(o+i-1);var s=Math.floor((i+t[0].day+6)/7),l=e?1-s:s-1;return e&&t.reverse(),{range:[t[0].formatedDate,t[1].formatedDate],start:t[0],end:t[1],allDay:i,weeks:s,nthWeek:l,fweek:t[0].day,lweek:t[1].day}},_getDateByWeeksAndDay:function(t,e,i){var n=this._getRangeInfo(i);if(t>n.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)}},Cy.dimensions=Cy.prototype.dimensions,Cy.getDimensionsInfo=Cy.prototype.getDimensionsInfo,Cy.create=function(t,e){var i=[];return t.eachComponent("calendar",function(n){var o=new Cy(n,t,e);i.push(o),n.coordinateSystem=o}),t.eachSeries(function(t){"calendar"===t.get("coordinateSystem")&&(t.coordinateSystem=i[t.get("calendarIndex")||0])}),i},Fa.register("calendar",Cy);var XN=lI.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=ga(t);XN.superApply(this,"init",arguments),ky(t,o)},mergeOption:function(t,e){XN.superApply(this,"mergeOption",arguments),ky(this.option,t)}}),jN={EN:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],CN:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},YN={EN:["S","M","T","W","T","F","S"],CN:["日","一","二","三","四","五","六"]};Ws({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 yM({shape:{x:l[0],y:l[1],width:a,height:r},cursor:"default",style:o});i.add(u)}},_renderLines:function(t,e,i,n){function o(e){a._firstDayOfMonth.push(r.getDateInfo(e)),a._firstDayPoints.push(r.dataToRect([e],!1).tl);var o=a._getLinePointsOfOneWeek(t,e,i);a._tlpoints.push(o[0]),a._blpoints.push(o[o.length-1]),l&&a._drawSplitline(o,s,n)}var a=this,r=t.coordinateSystem,s=t.getModel("splitLine.lineStyle").getLineStyle(),l=t.get("splitLine.show"),u=s.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var h=e.start,c=0;h.time<=e.end.time;c++){o(h.formatedDate),0===c&&(h=r.getDateInfo(e.start.y+"-"+e.start.m));var d=h.date;d.setMonth(d.getMonth()+1),h=r.getDateInfo(d)}o(r.getNextNDay(e.end.time,1).formatedDate),l&&this._drawSplitline(a._getEdgesPoints(a._tlpoints,u,i),s,n),l&&this._drawSplitline(a._getEdgesPoints(a._blpoints,u,i),s,n)},_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 gM({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?oa(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 rM({z2:30});mo(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"),r=n.get("margin"),s=n.get("position"),l=n.get("align"),u=[this._tlpoints,this._blpoints];_(o)&&(o=jN[o.toUpperCase()]||[]);var h="start"===s?0:1,c="horizontal"===e?0:1;r="start"===s?-r:r;for(var d="center"===l,f=0;f=r[0]&&t<=r[1]}if(t===this._dataZoomModel){var n=this._dimName,o=this.getTargetSeriesModels(),a=t.get("filterMode"),r=this._valueWindow;"none"!==a&&$N(o,function(t){var e=t.getData(),o=e.mapDimension(n,!0);o.length&&("weakFilter"===a?e.filterSelf(function(t){for(var i,n,a,s=0;sr[1];if(u&&!h&&!c)return!0;u&&(a=!0),h&&(i=!0),c&&(n=!0)}return a&&i&&n}):$N(o,function(n){if("empty"===a)t.setData(e.map(n,function(t){return i(t)?t:NaN}));else{var o={};o[n]=r,e.selectRange(o)}}),$N(o,function(t){e.setApproximateExtent(r,t)}))})}}};var tO=d,eO=KN,iO=Fs({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=By(t);this.mergeDefaultAndTheme(t,i),this.doInit(n)},mergeOption:function(t){var e=By(t);n(this.option,t,!0),this.doInit(e)},doInit:function(t){var e=this.option;U_.canvasSupported||(e.realtime=!1),this._setDefaultThrottle(t),Vy(this,t),tO([["start","startValue"],["end","endValue"]],function(t,i){"value"===this._rangePropMode[i]&&(e[t[0]]=null)},this),this.textStyleModel=this.getModel("textStyle"),this._resetTarget(),this._giveAxisProxies()},_giveAxisProxies:function(){var t=this._axisProxies;this.eachTargetAxis(function(e,i,n,o){var a=this.dependentModels[e.axis][i],r=a.__dzAxisProxy||(a.__dzAxisProxy=new QN(e.name,i,this,o));t[e.name+"_"+i]=r},this)},_resetTarget:function(){var t=this.option,e=this._judgeAutoMode();eO(function(e){var i=e.axisIndex;t[i]=Di(t[i])},this),"axisIndex"===e?this._autoSetAxisIndex():"orient"===e&&this._autoSetOrient()},_judgeAutoMode:function(){var t=this.option,e=!1;eO(function(i){null!=t[i.axisIndex]&&(e=!0)},this);var i=t.orient;return null==i&&e?"orient":e?void 0:(null==i&&(t.orient="horizontal"),"axisIndex")},_autoSetAxisIndex:function(){var t=!0,e=this.get("orient",!0),i=this.option,n=this.dependentModels;if(t){var o="vertical"===e?"y":"x";n[o+"Axis"].length?(i[o+"AxisIndex"]=[0],t=!1):tO(n.singleAxis,function(n){t&&n.get("orient",!0)===e&&(i.singleAxisIndex=[n.componentIndex],t=!1)})}t&&eO(function(e){if(t){var n=[],o=this.dependentModels[e.axis];if(o.length&&!n.length)for(var a=0,r=o.length;a0?100:20}},getFirstTargetAxisModel:function(){var t;return eO(function(e){if(null==t){var i=this.get(e.axisIndex);i.length&&(t=this.dependentModels[e.axis][i[0]])}},this),t},eachTargetAxis:function(t,e){var i=this.ecModel;eO(function(n){tO(this.get(n.axisIndex),function(o){t.call(e,n,o,this,i)},this)},this)},getAxisProxy:function(t,e){return this._axisProxies[t+"_"+e]},getAxisModel:function(t,e){var i=this.getAxisProxy(t,e);return i&&i.getAxisModel()},setRawRange:function(t,e){var i=this.option;tO([["start","startValue"],["end","endValue"]],function(e){null==t[e[0]]&&null==t[e[1]]||(i[e[0]]=t[e[0]],i[e[1]]=t[e[1]])},this),!e&&Vy(this,t)},getPercentRange:function(){var t=this.findRepresentativeAxisProxy();if(t)return t.getDataPercentWindow()},getValueRange:function(t,e){if(null!=t||null!=e)return this.getAxisProxy(t,e).getDataValueWindow();var i=this.findRepresentativeAxisProxy();return i?i.getDataValueWindow():void 0},findRepresentativeAxisProxy:function(t){if(t)return t.__dzAxisProxy;var e=this._axisProxies;for(var i in e)if(e.hasOwnProperty(i)&&e[i].hostedBy(this))return e[i];for(var i in e)if(e.hasOwnProperty(i)&&!e[i].hostedBy(this))return e[i]},getRangePropMode:function(){return this._rangePropMode.slice()}}),nO=qI.extend({type:"dataZoom",render:function(t,e,i,n){this.dataZoomModel=t,this.ecModel=e,this.api=i},getTargetCoordInfo:function(){function t(t,e,i,n){for(var o,a=0;a0&&e%g)p+=f;else{var i=null==t||isNaN(t)||""===t,n=i?0:aO(t,a,u,!0);i&&!l&&e?(c.push([c[c.length-1][0],0]),d.push([d[d.length-1][0],0])):!i&&l&&(c.push([p,0]),d.push([p,0])),c.push([p,n]),d.push([p,n]),p+=f,l=i}});var m=this.dataZoomModel;this._displayables.barGroup.add(new pM({shape:{points:c},style:r({fill:m.get("dataBackgroundColor")},m.getModel("dataBackground.areaStyle").getAreaStyle()),silent:!0,z2:-20})),this._displayables.barGroup.add(new gM({shape:{points:d},style:m.getModel("dataBackground.lineStyle").getLineStyle(),silent:!0,z2:-19}))}}},_prepareDataShadowInfo:function(){var t=this.dataZoomModel,e=t.get("showDataShadow");if(!1!==e){var i,n=this.ecModel;return t.eachTargetAxis(function(o,a){d(t.getAxisProxy(o.name,a).getTargetSeriesModels(),function(t){if(!(i||!0!==e&&l(cO,t.get("type"))<0)){var r,s=n.getComponent(o.axis,a).axis,u=Gy(o.name),h=t.coordinateSystem;null!=u&&h.getOtherAxis&&(r=h.getOtherAxis(s).inverse),u=t.getData().mapDimension(u),i={thisAxis:s,series:t,thisDim:o.name,otherDim:u,otherAxisInverse:r}}},this)},this),i}},_renderHandle:function(){var t=this._displayables,e=t.handles=[],i=t.handleLabels=[],n=this._displayables.barGroup,o=this._size,a=this.dataZoomModel;n.add(t.filler=new oO({draggable:!0,cursor:Fy(this._orient),drift:sO(this._onDragMove,this,"all"),onmousemove:function(t){mw(t.event)},ondragstart:sO(this._showDataInfo,this,!0),ondragend:sO(this._onDragEnd,this),onmouseover:sO(this._showDataInfo,this,!0),onmouseout:sO(this._showDataInfo,this,!1),style:{fill:a.get("fillerColor"),textPosition:"inside"}})),n.add(new oO($n({silent:!0,shape:{x:0,y:0,width:o[0],height:o[1]},style:{stroke:a.get("dataBackgroundColor")||a.get("borderColor"),lineWidth:1,fill:"rgba(0,0,0,0)"}}))),lO([0,1],function(t){var o=Po(a.get("handleIcon"),{cursor:Fy(this._orient),draggable:!0,drift:sO(this._onDragMove,this,t),onmousemove:function(t){mw(t.event)},ondragend:sO(this._onDragEnd,this),onmouseover:sO(this._showDataInfo,this,!0),onmouseout:sO(this._showDataInfo,this,!1)},{x:-1,y:0,width:2,height:2}),r=o.getBoundingRect();this._handleHeight=Vo(a.get("handleSize"),this._size[1]),this._handleWidth=r.width/r.height*this._handleHeight,o.setStyle(a.getModel("handleStyle").getItemStyle());var s=a.get("handleColor");null!=s&&(o.style.fill=s),n.add(e[t]=o);var l=a.textStyleModel;this.group.add(i[t]=new rM({silent:!0,invisible:!0,style:{x:0,y:0,text:"",textVerticalAlign:"middle",textAlign:"center",textFill:l.getTextColor(),textFont:l.getFont()},z2:10}))},this)},_resetInterval:function(){var t=this._range=this.dataZoomModel.getPercentRange(),e=this._getViewExtent();this._handleEnds=[aO(t[0],[0,100],e,!0),aO(t[1],[0,100],e,!0)]},_updateInterval:function(t,e){var i=this.dataZoomModel,n=this._handleEnds,o=this._getViewExtent(),a=i.findRepresentativeAxisProxy().getMinMaxSpan(),r=[0,100];QL(e,n,o,i.get("zoomLock")?"all":t,null!=a.minSpan?aO(a.minSpan,r,o,!0):null,null!=a.maxSpan?aO(a.maxSpan,r,o,!0):null);var s=this._range,l=this._range=rO([aO(n[0],o,r,!0),aO(n[1],o,r,!0)]);return!s||s[0]!==l[0]||s[1]!==l[1]},_updateView:function(t){var e=this._displayables,i=this._handleEnds,n=rO(i.slice()),o=this._size;lO([0,1],function(t){var n=e.handles[t],a=this._handleHeight;n.attr({scale:[a/2,a/2],position:[i[t],o[1]/2-a/2]})},this),e.filler.setShape({x:n[0],y:0,width:n[1]-n[0],height:o[1]}),this._updateDataInfo(t)},_updateDataInfo:function(t){function e(t){var e=Ao(n.handles[t].parent,this.group),i=Co(0===t?"right":"left",e),s=this._handleWidth/2+hO,l=Do([c[t]+(0===t?-s:s),this._size[1]/2],e);o[t].setStyle({x:l[0],y:l[1],textVerticalAlign:a===uO?"middle":i,textAlign:a===uO?i:"center",text:r[t]})}var i=this.dataZoomModel,n=this._displayables,o=n.handleLabels,a=this._orient,r=["",""];if(i.get("showDetail")){var s=i.findRepresentativeAxisProxy();if(s){var l=s.getAxisModel().axis,u=this._range,h=t?s.calculateDataWindow({start:u[0],end:u[1]}).valueWindow:s.getDataValueWindow();r=[this._formatLabel(h[0],l),this._formatLabel(h[1],l)]}}var c=rO(this._handleEnds.slice());e.call(this,0),e.call(this,1)},_formatLabel:function(t,e){var i=this.dataZoomModel,n=i.get("labelFormatter"),o=i.get("labelPrecision");null!=o&&"auto"!==o||(o=e.getPixelPrecision());var a=null==t||isNaN(t)?"":"category"===e.type||"time"===e.type?e.scale.getLabel(Math.round(t)):t.toFixed(Math.min(o,20));return x(n)?n(t,a):_(n)?n.replace("{value}",a):a},_showDataInfo:function(t){t=this._dragging||t;var e=this._displayables.handleLabels;e[0].attr("invisible",!t),e[1].attr("invisible",!t)},_onDragMove:function(t,e,i){this._dragging=!0;var n=Do([e,i],this._displayables.barGroup.getLocalTransform(),!0),o=this._updateInterval(t,n[0]),a=this.dataZoomModel.get("realtime");this._updateView(!a),o&&a&&this._dispatchZoomAction()},_onDragEnd:function(){this._dragging=!1,this._showDataInfo(!1),!this.dataZoomModel.get("realtime")&&this._dispatchZoomAction()},_onClickPanelClick:function(t){var e=this._size,i=this._displayables.barGroup.transformCoordToLocal(t.offsetX,t.offsetY);if(!(i[0]<0||i[0]>e[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 t;if(lO(this.getTargetCoordInfo(),function(e){if(!t&&e.length){var i=e[0].model.coordinateSystem;t=i.getRect&&i.getRect()}}),!t){var e=this.api.getWidth(),i=this.api.getHeight();t={x:.2*e,y:.2*i,width:.6*e,height:.6*i}}return t}});iO.extend({type:"dataZoom.inside",defaultOption:{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}});var fO="\0_ec_dataZoom_roams",pO=m,gO=nO.extend({type:"dataZoom.inside",init:function(t,e){this._range},render:function(t,e,i,n){gO.superApply(this,"render",arguments),this._range=t.getPercentRange(),d(this.getTargetCoordInfo(),function(e,n){var o=f(e,function(t){return Zy(t.model)});d(e,function(e){var a=e.model,r={};d(["pan","zoom","scrollMove"],function(t){r[t]=pO(mO[t],this,e,n)},this),Wy(i,{coordId:Zy(a),allCoordIds:o,containsPoint:function(t,e,i){return a.coordinateSystem.containPoint([e,i])},dataZoomId:t.id,dataZoomModel:t,getRange:r})},this)},this)},dispose:function(){Hy(this.api,this.dataZoomModel.id),gO.superApply(this,"dispose",arguments),this._range=null}}),mO={zoom:function(t,e,i,n){var o=this._range,a=o.slice(),r=t.axisModels[0];if(r){var s=vO[e](null,[n.originX,n.originY],r,i,t),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],u=Math.max(1/n.scale,0);a[0]=(a[0]-l)*u+l,a[1]=(a[1]-l)*u+l;var h=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();return QL(0,a,[0,100],0,h.minSpan,h.maxSpan),this._range=a,o[0]!==a[0]||o[1]!==a[1]?a:void 0}},pan:Ky(function(t,e,i,n,o,a){var r=vO[n]([a.oldX,a.oldY],[a.newX,a.newY],e,o,i);return r.signal*(t[1]-t[0])*r.pixel/r.pixelLength}),scrollMove:Ky(function(t,e,i,n,o,a){return vO[n]([0,0],[a.scrollDelta,a.scrollDelta],e,o,i).signal*(t[1]-t[0])*a.scrollDelta})},vO={grid:function(t,e,i,n,o){var a=i.axis,r={},s=o.model.coordinateSystem.getRect();return t=t||[0,0],"x"===a.dim?(r.pixel=e[0]-t[0],r.pixelLength=s.width,r.pixelStart=s.x,r.signal=a.inverse?1:-1):(r.pixel=e[1]-t[1],r.pixelLength=s.height,r.pixelStart=s.y,r.signal=a.inverse?-1:1),r},polar:function(t,e,i,n,o){var a=i.axis,r={},s=o.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return t=t?s.pointToCoord(t):[0,0],e=s.pointToCoord(e),"radiusAxis"===i.mainType?(r.pixel=e[0]-t[0],r.pixelLength=l[1]-l[0],r.pixelStart=l[0],r.signal=a.inverse?1:-1):(r.pixel=e[1]-t[1],r.pixelLength=u[1]-u[0],r.pixelStart=u[0],r.signal=a.inverse?-1:1),r},singleAxis:function(t,e,i,n,o){var a=i.axis,r=o.model.coordinateSystem.getRect(),s={};return t=t||[0,0],"horizontal"===a.orient?(s.pixel=e[0]-t[0],s.pixelLength=r.width,s.pixelStart=r.x,s.signal=a.inverse?1:-1):(s.pixel=e[1]-t[1],s.pixelLength=r.height,s.pixelStart=r.y,s.signal=a.inverse?-1:1),s}};Os({getTargetSeries:function(t){var e=R();return t.eachComponent("dataZoom",function(t){t.eachTargetAxis(function(t,i,n){d(n.getAxisProxy(t.name,i).getTargetSeriesModels(),function(t){e.set(t.uid,t)})})}),e},modifyOutputEnd:!0,overallReset:function(t,e){t.eachComponent("dataZoom",function(t){t.eachTargetAxis(function(t,i,n){n.getAxisProxy(t.name,i).reset(n,e)}),t.eachTargetAxis(function(t,i,n){n.getAxisProxy(t.name,i).filterData(n,e)})}),t.eachComponent("dataZoom",function(t){var e=t.findRepresentativeAxisProxy(),i=e.getDataPercentWindow(),n=e.getDataValueWindow();t.setRawRange({start:i[0],end:i[1],startValue:n[0],endValue:n[1]},!0)})}}),Es("dataZoom",function(t,e){var i=Ny(m(e.eachComponent,e,"dataZoom"),KN,function(t,e){return t.get(e.axisIndex)}),n=[];e.eachComponent({mainType:"dataZoom",query:t},function(t,e){n.push.apply(n,i(t).nodes)}),d(n,function(e,i){e.setRawRange({start:t.start,end:t.end,startValue:t.startValue,endValue:t.endValue})})});var yO=d,xO=function(t){var e=t&&t.visualMap;y(e)||(e=e?[e]:[]),yO(e,function(t){if(t){$y(t,"splitList")&&!$y(t,"pieces")&&(t.pieces=t.splitList,delete t.splitList);var e=t.pieces;e&&y(e)&&yO(e,function(t){w(t)&&($y(t,"start")&&!$y(t,"min")&&(t.min=t.start),$y(t,"end")&&!$y(t,"max")&&(t.max=t.end))})}})};lI.registerSubTypeDefaulter("visualMap",function(t){return t.categories||(t.pieces?t.pieces.length>0:t.splitNumber>0)&&!t.calculable?"piecewise":"continuous"});var _O=VT.VISUAL.COMPONENT;Bs(_O,{createOnAllSeries:!0,reset:function(t,e){var i=[];return e.eachComponent("visualMap",function(e){var n=t.pipelineContext;!e.isTargetSeries(t)||n&&n.large||i.push(ny(e.stateList,e.targetVisuals,m(e.getValueState,e),e.getDataDimension(t.getData())))}),i}}),Bs(_O,{createOnAllSeries:!0,reset:function(t,e){var i=t.getData(),n=[];e.eachComponent("visualMap",function(e){if(e.isTargetSeries(t)){var o=e.getVisualMeta(m(Jy,null,t,e))||{stops:[],outerColors:[]},a=e.getDataDimension(i),r=i.getDimensionInfo(a);null!=r&&(o.dimension=r.index,n.push(o))}}),t.getData().setVisual("visualMeta",n)}});var wO={get:function(t,e,n){var o=i((bO[t]||{})[e]);return n&&y(o)?o[o.length-1]:o}},bO={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}},SO=hL.mapVisual,MO=hL.eachVisual,IO=y,TO=d,AO=Fo,DO=Bo,CO=B,LO=Fs({type:"visualMap",dependencies:["series"],stateList:["inRange","outOfRange"],replacableOptionKeys:["inRange","outOfRange","target","controller","color"],dataBound:[-1/0,1/0],layoutMode:{type:"box",ignoreSize:!0},defaultOption:{show:!0,zlevel:0,z:4,seriesIndex:"all",min:0,max:200,dimension:null,inRange:null,outOfRange:null,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,color:null,formatter:null,text:null,textStyle:{color:"#333"}},init:function(t,e,i){this._dataExtent,this.targetVisuals={},this.controllerVisuals={},this.textStyleModel,this.itemSize,this.mergeDefaultAndTheme(t,i)},optionUpdated:function(t,e){var i=this.option;U_.canvasSupported||(i.realtime=!1),!e&&ey(i,t,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},resetVisual:function(t){var e=this.stateList;t=m(t,this),this.controllerVisuals=ty(this.option.controller,e,t),this.targetVisuals=ty(this.option.target,e,t)},getTargetSeriesIndices:function(){var t=this.option.seriesIndex,e=[];return null==t||"all"===t?this.ecModel.eachSeries(function(t,i){e.push(i)}):e=Di(t),e},eachTargetSeries:function(t,e){d(this.getTargetSeriesIndices(),function(i){t.call(e,this.ecModel.getSeriesByIndex(i))},this)},isTargetSeries:function(t){var e=!1;return this.eachTargetSeries(function(i){i===t&&(e=!0)}),e},formatValueText:function(t,e,i){function n(t){return t===l[0]?"min":t===l[1]?"max":(+t).toFixed(Math.min(s,20))}var o,a,r=this.option,s=r.precision,l=this.dataBound,u=r.formatter;return i=i||["<",">"],y(t)&&(t=t.slice(),o=!0),a=e?t:o?[n(t[0]),n(t[1])]:n(t),_(u)?u.replace("{value}",o?a[0]:a).replace("{value2}",o?a[1]:a):x(u)?o?u(t[0],t[1]):u(t):o?t[0]===l[0]?i[0]+" "+a[1]:t[1]===l[1]?i[1]+" "+a[0]:a[0]+" - "+a[1]:a},resetExtent:function(){var t=this.option,e=AO([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;o>=0;o--){var a=n[o];if(!t.getDimensionInfo(a).isCalculationCoord)return a}}},getExtent:function(){return this._dataExtent.slice()},completeVisualOption:function(){function t(t){IO(o.color)&&!t.inRange&&(t.inRange={color:o.color.slice().reverse()}),t.inRange=t.inRange||{color:e.get("gradientColor")},TO(this.stateList,function(e){var i=t[e];if(_(i)){var n=wO.get(i,"active",l);n?(t[e]={},t[e][i]=n):delete t[e]}},this)}var e=this.ecModel,o=this.option,a={inRange:o.inRange,outOfRange:o.outOfRange},r=o.target||(o.target={}),s=o.controller||(o.controller={});n(r,a),n(s,a);var l=this.isCategory();t.call(this,r),t.call(this,s),function(t,e,i){var n=t[e],o=t[i];n&&!o&&(o=t[i]={},TO(n,function(t,e){if(hL.isValidType(e)){var i=wO.get(e,"inactive",l);null!=i&&(o[e]=i,"color"!==e||o.hasOwnProperty("opacity")||o.hasOwnProperty("colorAlpha")||(o.opacity=[0,0]))}}))}.call(this,r,"inRange","outOfRange"),function(t){var e=(t.inRange||{}).symbol||(t.outOfRange||{}).symbol,n=(t.inRange||{}).symbolSize||(t.outOfRange||{}).symbolSize,o=this.get("inactiveColor");TO(this.stateList,function(a){var r=this.itemSize,s=t[a];s||(s=t[a]={color:l?o:[o]}),null==s.symbol&&(s.symbol=e&&i(e)||(l?"roundRect":["roundRect"])),null==s.symbolSize&&(s.symbolSize=n&&i(n)||(l?r[0]:[r[0],r[0]])),s.symbol=SO(s.symbol,function(t){return"none"===t||"square"===t?"roundRect":t});var u=s.symbolSize;if(null!=u){var h=-1/0;MO(u,function(t){t>h&&(h=t)}),s.symbolSize=SO(u,function(t){return DO(t,[0,h],[0,r[0]],!0)})}},this)}.call(this,s)},resetItemSize:function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},isCategory:function(){return!!this.option.categories},setSelected:CO,getValueState:CO,getVisualMeta:CO}),kO=[20,140],PO=LO.extend({type:"visualMap.continuous",defaultOption:{align:"auto",calculable:!1,range:null,realtime:!0,itemHeight:null,itemWidth:null,hoverLink:!0,hoverLinkDataSize:null,hoverLinkOnHandle:null},optionUpdated:function(t,e){PO.superApply(this,"optionUpdated",arguments),this.resetExtent(),this.resetVisual(function(t){t.mappingMethod="linear",t.dataExtent=this.getExtent()}),this._resetRange()},resetItemSize:function(){PO.superApply(this,"resetItemSize",arguments);var t=this.itemSize;"horizontal"===this._orient&&t.reverse(),(null==t[0]||isNaN(t[0]))&&(t[0]=kO[0]),(null==t[1]||isNaN(t[1]))&&(t[1]=kO[1])},_resetRange:function(){var t=this.getExtent(),e=this.option.range;!e||e.auto?(t.auto=1,this.option.range=t):y(e)&&(e[0]>e[1]&&e.reverse(),e[0]=Math.max(e[0],t[0]),e[1]=Math.min(e[1],t[1]))},completeVisualOption:function(){LO.prototype.completeVisualOption.apply(this,arguments),d(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=Fo((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(t){var e=[];return this.eachTargetSeries(function(i){var n=[],o=i.getData();o.each(this.getDataDimension(o),function(e,i){t[0]<=e&&e<=t[1]&&n.push(i)},this),e.push({seriesId:i.id,dataIndex:n})},this),e},getVisualMeta:function(t){function e(e,i){o.push({value:e,color:t(e,i)})}for(var i=Qy(0,0,this.getExtent()),n=Qy(0,0,this.option.range.slice()),o=[],a=0,r=0,s=n.length,l=i.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 tb("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(t,e){if(this._useHandle){var i=this._shapes,n=this.visualMapModel,o=i.handleThumbs,a=i.handleLabels;EO([0,1],function(r){var s=o[r];s.setStyle("fill",e.handlesColor[r]),s.position[1]=t[r];var l=Do(i.handleLabelPoints[r],Ao(s,this.group));a[r].setStyle({x:l[0],y:l[1],text:n.formatValueText(this._dataInterval[r]),textVerticalAlign:"middle",textAlign:this._applyTransform("horizontal"===this._orient?0===r?"bottom":"top":"left",i.barGroup)})},this)}},_showIndicator:function(t,e,i,n){var o=this.visualMapModel,a=o.getExtent(),r=o.itemSize,s=[0,r[1]],l=OO(t,a,s,!0),u=this._shapes,h=u.indicator;if(h){h.position[1]=l,h.attr("invisible",!1),h.setShape("points",ox(!!i,n,l,r[1]));var c={convertOpacityToAlpha:!0},d=this.getControllerVisual(t,"color",c);h.setStyle("fill",d);var f=Do(u.indicatorLabelPoint,Ao(h,this.group)),p=u.indicatorLabel;p.attr("invisible",!1);var g=this._applyTransform("left",u.barGroup),m=this._orient;p.setStyle({text:(i||"")+o.formatValueText(e),textVerticalAlign:"horizontal"===m?g:"middle",textAlign:"horizontal"===m?"center":g,x:f[0],y:f[1]})}},_enableHoverLinkToSeries:function(){var t=this;this._shapes.barGroup.on("mousemove",function(e){if(t._hovering=!0,!t._dragging){var i=t.visualMapModel.itemSize,n=t._applyTransform([e.offsetX,e.offsetY],t._shapes.barGroup,!0,!0);n[1]=RO(zO(0,n[1]),i[1]),t._doHoverLinkToSeries(n[1],0<=n[0]&&n[0]<=i[0])}}).on("mouseout",function(){t._hovering=!1,!t._dragging&&t._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=RO(zO(o[0],t),o[1]);var r=ax(i,a,o),s=[t-r,t+r],l=OO(t,o,a,!0),u=[OO(s[0],o,a,!0),OO(s[1],o,a,!0)];s[0]o[1]&&(u[1]=1/0),e&&(u[0]===-1/0?this._showIndicator(l,u[1],"< ",r):u[1]===1/0?this._showIndicator(l,u[0],"> ",r):this._showIndicator(l,l,"≈ ",r));var h=this._hoverLinkDataIndices,c=[];(e||rx(i))&&(c=this._hoverLinkDataIndices=i.findTargetDataIndices(u));var d=Ri(h,c);this._dispatchHighDown("downplay",ex(d[0])),this._dispatchHighDown("highlight",ex(d[1]))}},_hoverLinkFromSeriesMouseOver:function(t){var e=t.target,i=this.visualMapModel;if(e&&null!=e.dataIndex){var n=this.ecModel.getSeriesByIndex(e.seriesIndex);if(i.isTargetSeries(n)){var o=n.getData(e.dataType),a=o.get(i.getDataDimension(o),e.dataIndex,!0);isNaN(a)||this._showIndicator(a,a)}}},_hideIndicator:function(){var t=this._shapes;t.indicator&&t.indicator.attr("invisible",!0),t.indicatorLabel&&t.indicatorLabel.attr("invisible",!0)},_clearHoverLinkToSeries:function(){this._hideIndicator();var t=this._hoverLinkDataIndices;this._dispatchHighDown("downplay",ex(t)),t.length=0},_clearHoverLinkFromSeries:function(){this._hideIndicator();var t=this.api.getZr();t.off("mouseover",this._hoverLinkFromSeriesMouseOver),t.off("mouseout",this._hideIndicator)},_applyTransform:function(t,e,i,n){var o=Ao(e,n?null:this.group);return zM[y(t)?"applyTransform":"transformDirection"](t,o,i)},_dispatchHighDown:function(t,e){e&&e.length&&this.api.dispatchAction({type:t,batch:e})},dispose:function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},remove:function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()}});Es({type:"selectDataRange",event:"dataRangeSelected",update:"update"},function(t,e){e.eachComponent({mainType:"visualMap",query:t},function(e){e.setSelected(t.selected)})}),Ns(xO);var FO=LO.extend({type:"visualMap.piecewise",defaultOption:{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieceList:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0,showLabel:null},optionUpdated:function(t,e){FO.superApply(this,"optionUpdated",arguments),this._pieceList=[],this.resetExtent();var n=this._mode=this._determineMode();WO[this._mode].call(this),this._resetSelected(t,e);var o=this.option.categories;this.resetVisual(function(t,e){"categories"===n?(t.mappingMethod="category",t.categories=i(o)):(t.dataExtent=this.getExtent(),t.mappingMethod="piecewise",t.pieceList=f(this._pieceList,function(t){var t=i(t);return"inRange"!==e&&(t.visual=null),t}))})},completeVisualOption:function(){function t(t,e,i){return t&&t[e]&&(w(t[e])?t[e].hasOwnProperty(i):t[e]===i)}var e=this.option,i={},n=hL.listVisualTypes(),o=this.isCategory();d(e.pieces,function(t){d(n,function(e){t.hasOwnProperty(e)&&(i[e]=1)})}),d(i,function(i,n){var a=0;d(this.stateList,function(i){a|=t(e,i,n)||t(e.target,i,n)},this),!a&&d(this.stateList,function(t){(e[t]||(e[t]={}))[n]=wO.get(n,"inRange"===t?"active":"inactive",o)})},this),LO.prototype.completeVisualOption.apply(this,arguments)},_resetSelected:function(t,e){var i=this.option,n=this._pieceList,o=(e?i:t).selected||{};if(i.selected=o,d(n,function(t,e){var i=this.getSelectedMapKey(t);o.hasOwnProperty(i)||(o[i]=!0)},this),"single"===i.selectedMode){var a=!1;d(n,function(t,e){var i=this.getSelectedMapKey(t);o[i]&&(a?o[i]=!1:a=!0)},this)}},getSelectedMapKey:function(t){return"categories"===this._mode?t.value+"":t.index+""},getPieceList:function(){return this._pieceList},_determineMode:function(){var t=this.option;return t.pieces&&t.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},setSelected:function(t){this.option.selected=i(t)},getValueState:function(t){var e=hL.findPieceIndex(t,this._pieceList);return null!=e&&this.option.selected[this.getSelectedMapKey(this._pieceList[e])]?"inRange":"outOfRange"},findTargetDataIndices:function(t){var e=[];return this.eachTargetSeries(function(i){var n=[],o=i.getData();o.each(this.getDataDimension(o),function(e,i){hL.findPieceIndex(e,this._pieceList)===t&&n.push(i)},this),e.push({seriesId:i.id,dataIndex:n})},this),e},getRepresentValue:function(t){var e;if(this.isCategory())e=t.value;else if(null!=t.value)e=t.value;else{var i=t.interval||[];e=i[0]===-1/0&&i[1]===1/0?0:(i[0]+i[1])/2}return e},getVisualMeta:function(t){function e(e,a){var r=o.getRepresentValue({interval:e});a||(a=o.getValueState(r));var s=t(r,a);e[0]===-1/0?n[0]=s:e[1]===1/0?n[1]=s:i.push({value:e[0],color:s},{value:e[1],color:s})}if(!this.isCategory()){var i=[],n=[],o=this,a=this._pieceList.slice();if(a.length){var r=a[0].interval[0];r!==-1/0&&a.unshift({interval:[-1/0,r]}),(r=a[a.length-1].interval[1])!==1/0&&a.push({interval:[r,1/0]})}else a.push({interval:[-1/0,1/0]});var s=-1/0;return d(a,function(t){var i=t.interval;i&&(i[0]>s&&e([s,i[0]],"outOfRange"),e(i.slice()),s=i[1])},this),{stops:i,outerColors:n}}}}),WO={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)}};NO.extend({type:"visualMap.piecewise",doRender:function(){var t=this.group;t.removeAll();var e=this.visualMapModel,i=e.get("textGap"),n=e.textStyleModel,o=n.getFont(),a=n.getTextColor(),r=this._getItemAlign(),s=e.itemSize,l=this._getViewData(),u=l.endsText,h=T(e.get("showLabel",!0),!u);u&&this._renderEndsText(t,u[0],s,h,r),d(l.viewPieceList,function(n){var l=n.piece,u=new tb;u.onclick=m(this._onItemClick,this,l),this._enableHoverLink(u,n.indexInModelPieceList);var c=e.getRepresentValue(l);if(this._createItemSymbol(u,c,[0,0,s[0],s[1]]),h){var d=this.visualMapModel.getValueState(c);u.add(new rM({style:{x:"right"===r?-i:s[0]+i,y:s[1]/2,text:l.text,textVerticalAlign:"middle",textAlign:r,textFont:o,textFill:a,opacity:"outOfRange"===d?.5:1}}))}t.add(u)},this),u&&this._renderEndsText(t,u[1],s,h,r),aI(e.get("orient"),t,e.get("itemGap")),this.renderBackground(t),this.positionGroup(t)},_enableHoverLink:function(t,e){function i(t){var i=this.visualMapModel;i.option.hoverLink&&this.api.dispatchAction({type:t,batch:ex(i.findTargetDataIndices(e))})}t.on("mouseover",m(i,this,"highlight")).on("mouseout",m(i,this,"downplay"))},_getItemAlign:function(){var t=this.visualMapModel,e=t.option;if("vertical"===e.orient)return tx(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 tb,r=this.visualMapModel.textStyleModel;a.add(new rM({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=f(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(Jl(this.getControllerVisual(e,"symbol"),i[0],i[1],i[2],i[3],this.getControllerVisual(e,"color")))},_onItemClick:function(t){var e=this.visualMapModel,n=e.option,o=i(n.selected),a=e.getSelectedMapKey(t);"single"===n.selectedMode?(o[a]=!0,d(o,function(t,e){o[e]=e===a})):o[a]=!o[a],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:o})}});Ns(xO);var HO=ta,ZO=ia,UO=Fs({type:"marker",dependencies:["series","grid","polar","geo"],init:function(t,e,i,n){this.mergeDefaultAndTheme(t,i),this.mergeOption(t,i,n.createdBySelf,!0)},isAnimationEnabled:function(){if(U_.node)return!1;var t=this.__hostSeries;return this.getShallow("animation")&&t&&t.isAnimationEnabled()},mergeOption:function(t,e,i,n){var o=this.constructor,r=this.mainType+"Model";i||e.eachSeries(function(t){var i=t.get(this.mainType,!0),s=t[r];i&&i.data?(s?s.mergeOption(i,e,!0):(n&&ux(i),d(i.data,function(t){t instanceof Array?(ux(t[0]),ux(t[1])):ux(t)}),a(s=new o(i,this,e),{mainType:this.mainType,seriesIndex:t.seriesIndex,name:t.name,createdBySelf:!0}),s.__hostSeries=t),t[r]=s):t[r]=null},this)},formatTooltip:function(t){var e=this.getData(),i=this.getRawValue(t),n=y(i)?f(i,HO).join(", "):HO(i),o=e.getName(t),a=ZO(this.name);return(null!=i||o)&&(a+="
"),o&&(a+=ZO(o),null!=i&&(a+=" : ")),null!=i&&(a+=ZO(n)),a},getData:function(){return this._data},setData:function(t){this._data=t}});h(UO,ZI),UO.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 XO=l,jO=v,YO={min:jO(dx,"min"),max:jO(dx,"max"),average:jO(dx,"average")},qO=Ws({type:"marker",init:function(){this.markerGroupMap=R()},render:function(t,e,i){var n=this.markerGroupMap;n.each(function(t){t.__keep=!1});var o=this.type+"Model";e.eachSeries(function(t){var n=t[o];n&&this.renderSeries(t,n,e,i)},this),n.each(function(t){!t.__keep&&this.group.remove(t.group)},this)},renderSeries:function(){}});qO.extend({type:"markPoint",updateTransform:function(t,e,i){e.eachSeries(function(t){var e=t.markPointModel;e&&(xx(e.getData(),t,i),this.markerGroupMap.get(t.id).updateLayout(e))},this)},renderSeries:function(t,e,i,n){var o=t.coordinateSystem,a=t.id,r=t.getData(),s=this.markerGroupMap,l=s.get(a)||s.set(a,new Du),u=_x(o,t,e);e.setData(u),xx(e.getData(),t,n),u.each(function(t){var i=u.getItemModel(t),n=i.getShallow("symbolSize");"function"==typeof n&&(n=n(e.getRawValue(t),e.getDataParams(t))),u.setItemVisual(t,{symbolSize:n,color:i.get("itemStyle.color")||r.getVisual("color"),symbol:i.getShallow("symbol")})}),l.updateData(u),this.group.add(l.group),u.eachItemGraphicEl(function(t){t.traverse(function(t){t.dataModel=e})}),l.__keep=!0,l.group.silent=e.get("silent")||t.get("silent")}}),Ns(function(t){t.markPoint=t.markPoint||{}}),UO.extend({type:"markLine",defaultOption:{zlevel:0,z:5,symbol:["circle","arrow"],symbolSize:[8,16],precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end"},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"}});var KO=function(t,e,o,r){var s=t.getData(),l=r.type;if(!y(r)&&("min"===l||"max"===l||"average"===l||"median"===l||null!=r.xAxis||null!=r.yAxis)){var u,h;if(null!=r.yAxis||null!=r.xAxis)u=null!=r.yAxis?"y":"x",e.getAxis(u),h=T(r.yAxis,r.xAxis);else{var c=px(r,s,e,t);u=c.valueDataDim,c.valueAxis,h=yx(s,u,l)}var d="x"===u?0:1,f=1-d,p=i(r),g={};p.type=null,p.coord=[],g.coord=[],p.coord[f]=-1/0,g.coord[f]=1/0;var m=o.get("precision");m>=0&&"number"==typeof h&&(h=+h.toFixed(Math.min(m,20))),p.coord[d]=g.coord[d]=h,r=[p,g,{type:l,valueIndex:r.valueIndex,value:h}]}return r=[fx(t,r[0]),fx(t,r[1]),a({},r[2])],r[2].type=r[2].type||"",n(r[2],r[0]),n(r[2],r[1]),r};qO.extend({type:"markLine",updateTransform:function(t,e,i){e.eachSeries(function(t){var e=t.markLineModel;if(e){var n=e.getData(),o=e.__from,a=e.__to;o.each(function(e){Ix(o,e,!0,t,i),Ix(a,e,!1,t,i)}),n.each(function(t){n.setItemLayout(t,[o.getItemLayout(t),a.getItemLayout(t)])}),this.markerGroupMap.get(t.id).updateLayout()}},this)},renderSeries:function(t,e,i,n){function o(e,i,o){var a=e.getItemModel(i);Ix(e,i,o,t,n),e.setItemVisual(i,{symbolSize:a.get("symbolSize")||g[o?0:1],symbol:a.get("symbol",!0)||p[o?0:1],color:a.get("itemStyle.color")||s.getVisual("color")})}var a=t.coordinateSystem,r=t.id,s=t.getData(),l=this.markerGroupMap,u=l.get(r)||l.set(r,new sf);this.group.add(u.group);var h=Tx(a,t,e),c=h.from,d=h.to,f=h.line;e.__from=c,e.__to=d,e.setData(f);var p=e.get("symbol"),g=e.get("symbolSize");y(p)||(p=[p,p]),"number"==typeof g&&(g=[g,g]),h.from.each(function(t){o(c,t,!0),o(d,t,!1)}),f.each(function(t){var e=f.getItemModel(t).get("lineStyle.color");f.setItemVisual(t,{color:e||c.getItemVisual(t,"color")}),f.setItemLayout(t,[c.getItemLayout(t),d.getItemLayout(t)]),f.setItemVisual(t,{fromSymbolSize:c.getItemVisual(t,"symbolSize"),fromSymbol:c.getItemVisual(t,"symbol"),toSymbolSize:d.getItemVisual(t,"symbolSize"),toSymbol:d.getItemVisual(t,"symbol")})}),u.updateData(f),h.line.eachItemGraphicEl(function(t,i){t.traverse(function(t){t.dataModel=e})}),u.__keep=!0,u.group.silent=e.get("silent")||t.get("silent")}}),Ns(function(t){t.markLine=t.markLine||{}}),UO.extend({type:"markArea",defaultOption:{zlevel:0,z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}}});var $O=function(t,e,i,n){var a=fx(t,n[0]),r=fx(t,n[1]),s=T,l=a.coord,u=r.coord;l[0]=s(l[0],-1/0),l[1]=s(l[1],-1/0),u[0]=s(u[0],1/0),u[1]=s(u[1],1/0);var h=o([{},a,r]);return h.coord=[a.coord,r.coord],h.x0=a.x,h.y0=a.y,h.x1=r.x,h.y1=r.y,h},JO=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]];qO.extend({type:"markArea",updateTransform:function(t,e,i){e.eachSeries(function(t){var e=t.markAreaModel;if(e){var n=e.getData();n.each(function(e){var o=f(JO,function(o){return Lx(n,e,o,t,i)});n.setItemLayout(e,o),n.getItemGraphicEl(e).setShape("points",o)})}},this)},renderSeries:function(t,e,i,n){var o=t.coordinateSystem,a=t.id,s=t.getData(),l=this.markerGroupMap,u=l.get(a)||l.set(a,{group:new tb});this.group.add(u.group),u.__keep=!0;var h=kx(o,t,e);e.setData(h),h.each(function(e){h.setItemLayout(e,f(JO,function(i){return Lx(h,e,i,t,n)})),h.setItemVisual(e,{color:s.getVisual("color")})}),h.diff(u.__data).add(function(t){var e=new pM({shape:{points:h.getItemLayout(t)}});h.setItemGraphicEl(t,e),u.group.add(e)}).update(function(t,i){var n=u.__data.getItemGraphicEl(i);Io(n,{shape:{points:h.getItemLayout(t)}},e,t),u.group.add(n),h.setItemGraphicEl(t,n)}).remove(function(t){var e=u.__data.getItemGraphicEl(t);u.group.remove(e)}).execute(),h.eachItemGraphicEl(function(t,i){var n=h.getItemModel(i),o=n.getModel("label"),a=n.getModel("emphasis.label"),s=h.getItemVisual(i,"color");t.useStyle(r(n.getModel("itemStyle").getItemStyle(),{fill:Yt(s,.4),stroke:s})),t.hoverStyle=n.getModel("emphasis.itemStyle").getItemStyle(),go(t.style,t.hoverStyle,o,a,{labelFetcher:e,labelDataIndex:i,defaultText:h.getName(i)||"",isRectText:!0,autoColor:s}),fo(t,{}),t.dataModel=e}),u.__data=h,u.group.silent=e.get("silent")||t.get("silent")}}),Ns(function(t){t.markArea=t.markArea||{}});lI.registerSubTypeDefaulter("timeline",function(){return"slider"}),Es({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"),r({currentIndex:i.option.currentIndex},t)}),Es({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},function(t,e){var i=e.getComponent("timeline");i&&null!=t.playState&&i.setPlayState(t.playState)});var QO=lI.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){QO.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:(t>=e&&(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||[],n=t.axisType,o=this._names=[];if("category"===n){var a=[];d(e,function(t,e){var n,r=Li(t);w(t)?(n=i(t)).value=e:n=e,a.push(n),_(r)||null!=r&&!isNaN(r)||(r=""),o.push(r+"")}),e=a}var r={category:"ordinal",time:"time"}[n]||"number";(this._data=new vA([{name:"value",type:r}],this)).initData(e,o)},getData:function(){return this._data},getCategories:function(){if("category"===this.get("axisType"))return this._names.slice()}});h(QO.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:[]}}),ZI);var tE=qI.extend({type:"timeline"}),eE=function(t,e,i,n){aD.call(this,t,e,i),this.type=n||"value",this.model=null};eE.prototype={constructor:eE,getLabelModel:function(){return this.model.getModel("label")},isHorizontal:function(){return"horizontal"===this.model.get("orient")}},u(eE,aD);var iE=m,nE=d,oE=Math.PI;tE.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(t,e,i,n){if(this.model=t,this.api=i,this.ecModel=e,this.group.removeAll(),t.get("show",!0)){var o=this._layout(t,i),a=this._createGroup("mainGroup"),r=this._createGroup("labelGroup"),s=this._axis=this._createAxis(o,t);t.formatTooltip=function(t){return ia(s.scale.getLabel(t))},nE(["AxisLine","AxisTick","Control","CurrentPointer"],function(e){this["_render"+e](o,a,s,t)},this),this._renderAxisLabel(o,r,s,t),this._position(o,t)}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=Ex(t,e);null==i||"auto"===i?i="horizontal"===n?o.y+o.height/2=0||"+"===i?"left":"right"},r={horizontal:i>=0||"+"===i?"top":"bottom",vertical:"middle"},s={horizontal:0,vertical:oE/2},l="vertical"===n?o.height:o.width,u=t.getModel("controlStyle"),h=u.get("show",!0),c=h?u.get("itemSize"):0,d=h?u.get("itemGap"):0,f=c+d,p=t.get("label.rotate")||0;p=p*oE/180;var g,m,v,y,x=u.get("position",!0),_=h&&u.get("showPlayBtn",!0),w=h&&u.get("showPrevBtn",!0),b=h&&u.get("showNextBtn",!0),S=0,M=l;return"left"===x||"bottom"===x?(_&&(g=[0,0],S+=f),w&&(m=[S,0],S+=f),b&&(v=[M-c,0],M-=f)):(_&&(g=[M-c,0],M-=f),w&&(m=[0,0],S+=f),b&&(v=[M-c,0],M-=f)),y=[S,M],t.get("inverse")&&y.reverse(),{viewRect:o,mainLength:l,orient:n,rotation:s[n],labelRotation:p,labelPosOpt:i,labelAlign:t.get("label.align")||a[n],labelBaseline:t.get("label.verticalAlign")||t.get("label.baseline")||r[n],playPosition:g,prevBtnPosition:m,nextBtnPosition:v,axisExtent:y,controlSize:c,controlGap:d}},_position:function(t,e){function i(t){var e=t.position;t.origin=[c[0][0]-e[0],c[1][0]-e[1]]}function n(t){return[[t.x,t.x+t.width],[t.y,t.y+t.height]]}function o(t,e,i,n,o){t[n]+=i[n][o]-e[n][o]}var a=this._mainGroup,r=this._labelGroup,s=t.viewRect;if("vertical"===t.orient){var l=xt(),u=s.x,h=s.y+s.height;St(l,l,[-u,-h]),Mt(l,l,-oE/2),St(l,l,[u,h]),(s=s.clone()).applyTransform(l)}var c=n(s),d=n(a.getBoundingRect()),f=n(r.getBoundingRect()),p=a.position,g=r.position;g[0]=p[0]=c[0][0];var m=t.labelPosOpt;if(isNaN(m))o(p,d,c,1,v="+"===m?0:1),o(g,f,c,1,1-v);else{var v=m>=0?0:1;o(p,d,c,1,v),g[1]=p[1]+m}a.attr("position",p),r.attr("position",g),a.rotation=r.rotation=t.rotation,i(a),i(r)},_createAxis:function(t,e){var i=e.getData(),n=e.get("axisType"),o=Hl(e,n);o.getTicks=function(){return i.mapArray(["value"],function(t){return t})};var a=i.getDataExtent("value");o.setExtent(a[0],a[1]),o.niceTicks();var r=new eE("value",o,t.axisExtent,n);return r.model=e,r},_createGroup:function(t){var e=this["_"+t]=new tb;return this.group.add(e),e},_renderAxisLine:function(t,e,i,n){var o=i.getExtent();n.get("lineStyle.show")&&e.add(new _M({shape:{x1:o[0],y1:0,x2:o[1],y2:0},style:a({lineCap:"round"},n.getModel("lineStyle").getLineStyle()),silent:!0,z2:1}))},_renderAxisTick:function(t,e,i,n){var o=n.getData(),a=i.scale.getTicks();nE(a,function(t){var a=i.dataToCoord(t),r=o.getItemModel(t),s=r.getModel("itemStyle"),l=r.getModel("emphasis.itemStyle"),u={position:[a,0],onclick:iE(this._changeTimeline,this,t)},h=zx(r,s,e,u);fo(h,l.getItemStyle()),r.get("tooltip")?(h.dataIndex=t,h.dataModel=n):h.dataIndex=h.dataModel=null},this)},_renderAxisLabel:function(t,e,i,n){if(i.getLabelModel().get("show")){var o=n.getData(),a=i.getViewLabels();nE(a,function(n){var a=n.tickValue,r=o.getItemModel(a),s=r.getModel("label"),l=r.getModel("emphasis.label"),u=i.dataToCoord(n.tickValue),h=new rM({position:[u,0],rotation:t.labelRotation-t.rotation,onclick:iE(this._changeTimeline,this,a),silent:!1});mo(h.style,s,{text:n.formattedLabel,textAlign:t.labelAlign,textVerticalAlign:t.labelBaseline}),e.add(h),fo(h,mo({},l))},this)}},_renderControl:function(t,e,i,n){function o(t,i,o,h){if(t){var c=Rx(n,i,u,{position:t,origin:[a/2,0],rotation:h?-r:0,rectHover:!0,style:s,onclick:o});e.add(c),fo(c,l)}}var a=t.controlSize,r=t.rotation,s=n.getModel("controlStyle").getItemStyle(),l=n.getModel("emphasis.controlStyle").getItemStyle(),u=[0,-a/2,a,a],h=n.getPlayState(),c=n.get("inverse",!0);o(t.nextBtnPosition,"controlStyle.nextIcon",iE(this._changeTimeline,this,c?"-":"+")),o(t.prevBtnPosition,"controlStyle.prevIcon",iE(this._changeTimeline,this,c?"+":"-")),o(t.playPosition,"controlStyle."+(h?"stopIcon":"playIcon"),iE(this._handlePlayClick,this,!h),!0)},_renderCurrentPointer:function(t,e,i,n){var o=n.getData(),a=n.getCurrentIndex(),r=o.getItemModel(a).getModel("checkpointStyle"),s=this,l={onCreate:function(t){t.draggable=!0,t.drift=iE(s._handlePointerDrag,s),t.ondragend=iE(s._handlePointerDragend,s),Bx(t,a,i,n,!0)},onUpdate:function(t){Bx(t,a,i,n)}};this._currentPointer=zx(r,r,this._mainGroup,{},this._currentPointer,l)},_handlePlayClick:function(t){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:t,from:this.uid})},_handlePointerDrag:function(t,e,i){this._clearTimer(),this._pointerChangeTimeline([i.offsetX,i.offsetY])},_handlePointerDragend:function(t){this._pointerChangeTimeline([t.offsetX,t.offsetY],!0)},_pointerChangeTimeline:function(t,e){var i=this._toAxisCoord(t)[0],n=Fo(this._axis.getExtent().slice());i>n[1]&&(i=n[1]),ii.getHeight()&&(n.textPosition="top",l=!0);var u=l?-5-o.height:s+8;a+o.width/2>i.getWidth()?(n.textPosition=["100%",u],n.textAlign="right"):a-o.width/2<0&&(n.textPosition=[0,u],n.textAlign="left")}})}},updateView:function(t,e,i,n){d(this._features,function(t){t.updateView&&t.updateView(t.model,e,i,n)})},remove:function(t,e){d(this._features,function(i){i.remove&&i.remove(t,e)}),this.group.removeAll()},dispose:function(t,e){d(this._features,function(i){i.dispose&&i.dispose(t,e)})}});var rE=rT.toolbox.saveAsImage;Gx.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:rE.title,type:"png",name:"",excludeComponents:["toolbox"],pixelRatio:1,lang:rE.lang.slice()},Gx.prototype.unusable=!U_.canvasSupported,Gx.prototype.onclick=function(t,e){var i=this.model,n=i.get("name")||t.get("title.0.text")||"echarts",o=document.createElement("a"),a=i.get("type",!0)||"png";o.download=n+"."+a,o.target="_blank";var r=e.getConnectedDataURL({type:a,backgroundColor:i.get("backgroundColor",!0)||t.get("backgroundColor")||"#fff",excludeComponents:i.get("excludeComponents"),pixelRatio:i.get("pixelRatio")});if(o.href=r,"function"!=typeof MouseEvent||U_.browser.ie||U_.browser.edge)if(window.navigator.msSaveOrOpenBlob){for(var s=atob(r.split(",")[1]),l=s.length,u=new Uint8Array(l);l--;)u[l]=s.charCodeAt(l);var h=new Blob([u]);window.navigator.msSaveOrOpenBlob(h,n+"."+a)}else{var c=i.get("lang"),d='';window.open().document.write(d)}else{var f=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!1});o.dispatchEvent(f)}},Ty("saveAsImage",Gx);var sE=rT.toolbox.magicType;Fx.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",tiled:"M2.3,2.2h22.8V25H2.3V2.2z M35,2.2h22.8V25H35V2.2zM2.3,35h22.8v22.8H2.3V35z M35,35h22.8v22.8H35V35z"},title:i(sE.title),option:{},seriesIndex:{}};var lE=Fx.prototype;lE.getIcons=function(){var t=this.model,e=t.get("icon"),i={};return d(t.get("type"),function(t){e[t]&&(i[t]=e[t])}),i};var uE={line:function(t,e,i,o){if("bar"===t)return n({id:e,type:"line",data:i.get("data"),stack:i.get("stack"),markPoint:i.get("markPoint"),markLine:i.get("markLine")},o.get("option.line")||{},!0)},bar:function(t,e,i,o){if("line"===t)return n({id:e,type:"bar",data:i.get("data"),stack:i.get("stack"),markPoint:i.get("markPoint"),markLine:i.get("markLine")},o.get("option.bar")||{},!0)},stack:function(t,e,i,o){if("line"===t||"bar"===t)return n({id:e,stack:"__ec_magicType_stack__"},o.get("option.stack")||{},!0)},tiled:function(t,e,i,o){if("line"===t||"bar"===t)return n({id:e,stack:""},o.get("option.tiled")||{},!0)}},hE=[["line","bar"],["stack","tiled"]];lE.onclick=function(t,e,i){var n=this.model,o=n.get("seriesIndex."+i);if(uE[i]){var a={series:[]};d(hE,function(t){l(t,i)>=0&&d(t,function(t){n.setIconStatus(t,"normal")})}),n.setIconStatus(i,"emphasis"),t.eachComponent({mainType:"series",query:null==o?null:{seriesIndex:o}},function(e){var o=e.subType,s=e.id,l=uE[i](o,s,e,n);l&&(r(l,e.option),a.series.push(l));var u=e.coordinateSystem;if(u&&"cartesian2d"===u.type&&("line"===i||"bar"===i)){var h=u.getAxesByScale("ordinal")[0];if(h){var c=h.dim+"Axis",d=t.queryComponents({mainType:c,index:e.get(name+"Index"),id:e.get(name+"Id")})[0].componentIndex;a[c]=a[c]||[];for(var f=0;f<=d;f++)a[c][d]=a[c][d]||{};a[c][d].boundaryGap="bar"===i}}}),e.dispatchAction({type:"changeMagicType",currentType:i,newOption:a})}},Es({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(t,e){e.mergeOption(t.newOption)}),Ty("magicType",Fx);var cE=rT.toolbox.dataView,dE=new Array(60).join("-"),fE="\t",pE=new RegExp("["+fE+"]+","g");$x.defaultOption={show:!0,readOnly:!1,optionToContent:null,contentToOption:null,icon:"M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",title:i(cE.title),lang:i(cE.lang),backgroundColor:"#fff",textColor:"#000",textareaColor:"#fff",textareaBorderColor:"#333",buttonColor:"#c23531",buttonTextColor:"#fff"},$x.prototype.onclick=function(t,e){function i(){n.removeChild(a),x._dom=null}var n=e.getDom(),o=this.model;this._dom&&n.removeChild(this._dom);var a=document.createElement("div");a.style.cssText="position:absolute;left:5px;top:5px;bottom:5px;right:5px;",a.style.backgroundColor=o.get("backgroundColor")||"#fff";var r=document.createElement("h4"),s=o.get("lang")||[];r.innerHTML=s[0]||o.get("title"),r.style.cssText="margin: 10px 20px;",r.style.color=o.get("textColor");var l=document.createElement("div"),u=document.createElement("textarea");l.style.cssText="display:block;width:100%;overflow:auto;";var h=o.get("optionToContent"),c=o.get("contentToOption"),d=Ux(t);if("function"==typeof h){var f=h(e.getOption());"string"==typeof f?l.innerHTML=f:M(f)&&l.appendChild(f)}else l.appendChild(u),u.readOnly=o.get("readOnly"),u.style.cssText="width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;",u.style.color=o.get("textColor"),u.style.borderColor=o.get("textareaBorderColor"),u.style.backgroundColor=o.get("textareaColor"),u.value=d.value;var p=d.meta,g=document.createElement("div");g.style.cssText="position:absolute;bottom:0;left:0;right:0;";var m="float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",v=document.createElement("div"),y=document.createElement("div");m+=";background-color:"+o.get("buttonColor"),m+=";color:"+o.get("buttonTextColor");var x=this;ht(v,"click",i),ht(y,"click",function(){var t;try{t="function"==typeof c?c(l,e.getOption()):Kx(u.value,p)}catch(t){throw i(),new Error("Data view format error "+t)}t&&e.dispatchAction({type:"changeDataView",newOption:t}),i()}),v.innerHTML=s[1],y.innerHTML=s[2],y.style.cssText=m,v.style.cssText=m,!o.get("readOnly")&&g.appendChild(y),g.appendChild(v),ht(u,"keydown",function(t){if(9===(t.keyCode||t.which)){var e=this.value,i=this.selectionStart,n=this.selectionEnd;this.value=e.substring(0,i)+fE+e.substring(n),this.selectionStart=this.selectionEnd=i+1,mw(t)}}),a.appendChild(r),a.appendChild(l),a.appendChild(g),l.style.height=n.clientHeight-80+"px",n.appendChild(a),this._dom=a},$x.prototype.remove=function(t,e){this._dom&&e.getDom().removeChild(this._dom)},$x.prototype.dispose=function(t,e){this.remove(t,e)},Ty("dataView",$x),Es({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},function(t,e){var i=[];d(t.newOption.series,function(t){var n=e.getSeriesByName(t.name)[0];if(n){var o=n.get("data");i.push({name:t.name,data:Jx(t.data,o)})}else i.push(a({type:"scatter"},t))}),e.mergeOption(r({series:i},t.newOption))});var gE=d,mE="\0_ec_hist_store";iO.extend({type:"dataZoom.select"}),nO.extend({type:"dataZoom.select"});var vE=rT.toolbox.dataZoom,yE=d,xE="\0_ec_\0toolbox-dataZoom_";o_.defaultOption={show:!0,icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:i(vE.title)};var _E=o_.prototype;_E.render=function(t,e,i,n){this.model=t,this.ecModel=e,this.api=i,s_(t,e,this,n,i),r_(t,e)},_E.onclick=function(t,e,i){wE[i].call(this)},_E.remove=function(t,e){this._brushController.unmount()},_E.dispose=function(t,e){this._brushController.dispose()};var wE={zoom:function(){var t=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:t})},back:function(){this._dispatchZoomAction(t_(this.ecModel))}};_E._onBrush=function(t,e){function i(t,e,i){var r=e.getAxis(t),s=r.model,l=n(t,s,a),u=l.findRepresentativeAxisProxy(s).getMinMaxSpan();null==u.minValueSpan&&null==u.maxValueSpan||(i=QL(0,i.slice(),r.scale.getExtent(),0,u.minValueSpan,u.maxValueSpan)),l&&(o[l.id]={dataZoomId:l.id,startValue:i[0],endValue:i[1]})}function n(t,e,i){var n;return i.eachComponent({mainType:"dataZoom",subType:"select"},function(i){i.getAxisModel(t,e.componentIndex)&&(n=i)}),n}if(e.isEnd&&t.length){var o={},a=this.ecModel;this._brushController.updateCovers([]),new hy(a_(this.model.option),a,{include:["grid"]}).matchOutputRanges(t,a,function(t,e,n){if("cartesian2d"===n.type){var o=t.brushType;"rect"===o?(i("x",n,e[0]),i("y",n,e[1])):i({lineX:"x",lineY:"y"}[o],n,e)}}),Qx(a,o),this._dispatchZoomAction(o)}},_E._dispatchZoomAction=function(t){var e=[];yE(t,function(t,n){e.push(i(t))}),e.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:e})},Ty("dataZoom",o_),Ns(function(t){function e(t,e){if(e){var o=t+"Index",a=e[o];null==a||"all"===a||y(a)||(a=!1===a||"none"===a?[]:[a]),i(t,function(e,i){if(null==a||"all"===a||-1!==l(a,i)){var r={type:"select",$fromToolbox:!0,id:xE+t+i};r[o]=i,n.push(r)}})}}function i(e,i){var n=t[e];y(n)||(n=n?[n]:[]),yE(n,i)}if(t){var n=t.dataZoom||(t.dataZoom=[]);y(n)||(t.dataZoom=n=[n]);var o=t.toolbox;if(o&&(y(o)&&(o=o[0]),o&&o.feature)){var a=o.feature.dataZoom;e("xAxis",a),e("yAxis",a)}}});var bE=rT.toolbox.restore;l_.defaultOption={show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:bE.title},l_.prototype.onclick=function(t,e,i){e_(t),e.dispatchAction({type:"restore",from:this.uid})},Ty("restore",l_),Es({type:"restore",event:"restore",update:"prepareAndUpdate"},function(t,e){e.resetOption("recreate")});var SE,ME="urn:schemas-microsoft-com:vml",IE="undefined"==typeof window?null:window,TE=!1,AE=IE&&IE.document;if(AE&&!U_.canvasSupported)try{!AE.namespaces.zrvml&&AE.namespaces.add("zrvml",ME),SE=function(t){return AE.createElement("')}}catch(t){SE=function(t){return AE.createElement("<"+t+' xmlns="'+ME+'" class="zrvml">')}}var DE=ES.CMD,CE=Math.round,LE=Math.sqrt,kE=Math.abs,PE=Math.cos,NE=Math.sin,OE=Math.max;if(!U_.canvasSupported){var EE=21600,RE=EE/2,zE=function(t){t.style.cssText="position:absolute;left:0;top:0;width:1px;height:1px;",t.coordsize=EE+","+EE,t.coordorigin="0,0"},BE=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""")},VE=function(t,e,i){return"rgb("+[t,e,i].join(",")+")"},GE=function(t,e){e&&t&&e.parentNode!==t&&t.appendChild(e)},FE=function(t,e){e&&t&&e.parentNode===t&&t.removeChild(e)},WE=function(t,e,i){return 1e5*(parseFloat(t)||0)+1e3*(parseFloat(e)||0)+i},HE=function(t,e){return"string"==typeof t?t.lastIndexOf("%")>=0?parseFloat(t)/100*e:parseFloat(t):t},ZE=function(t,e,i){var n=Gt(e);i=+i,isNaN(i)&&(i=1),n&&(t.color=VE(n[0],n[1],n[2]),t.opacity=i*n[3])},UE=function(t){var e=Gt(t);return[VE(e[0],e[1],e[2]),e[3]]},XE=function(t,e,i){var n=e.fill;if(null!=n)if(n instanceof IM){var o,a=0,r=[0,0],s=0,l=1,u=i.getBoundingRect(),h=u.width,c=u.height;if("linear"===n.type){o="gradient";var d=i.transform,f=[n.x*h,n.y*c],p=[n.x2*h,n.y2*c];d&&(Q(f,f,d),Q(p,p,d));var g=p[0]-f[0],m=p[1]-f[1];(a=180*Math.atan2(g,m)/Math.PI)<0&&(a+=360),a<1e-6&&(a=0)}else{o="gradientradial";var f=[n.x*h,n.y*c],d=i.transform,v=i.scale,y=h,x=c;r=[(f[0]-u.x)/y,(f[1]-u.y)/x],d&&Q(f,f,d),y/=v[0]*EE,x/=v[1]*EE;var _=OE(y,x);s=0/_,l=2*n.r/_-s}var w=n.colorStops.slice();w.sort(function(t,e){return t.offset-e.offset});for(var b=w.length,S=[],M=[],I=0;I=2){var D=S[0][0],C=S[1][0],L=S[0][1]*e.opacity,k=S[1][1]*e.opacity;t.type=o,t.method="none",t.focus="100%",t.angle=a,t.color=D,t.color2=C,t.colors=M.join(","),t.opacity=k,t.opacity2=L}"radial"===o&&(t.focusposition=r.join(","))}else ZE(t,n,e.opacity)},jE=function(t,e){null!=e.lineDash&&(t.dashstyle=e.lineDash.join(" ")),null==e.stroke||e.stroke instanceof IM||ZE(t,e.stroke,e.opacity)},YE=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 IM&&FE(t,a),a||(a=u_(e)),o?XE(a,i,n):jE(a,i),GE(t,a)):(t[o?"filled":"stroked"]="false",FE(t,a))},qE=[[],[],[]],KE=function(t,e){var i,n,o,a,r,s,l=DE.M,u=DE.C,h=DE.L,c=DE.A,d=DE.Q,f=[],p=t.data,g=t.len();for(a=0;a.01?N&&(O+=.0125):Math.abs(E-D)<1e-4?N&&OA?x-=.0125:x+=.0125:N&&ED?y+=.0125:y-=.0125),f.push(R,CE(((A-C)*M+b)*EE-RE),",",CE(((D-L)*I+S)*EE-RE),",",CE(((A+C)*M+b)*EE-RE),",",CE(((D+L)*I+S)*EE-RE),",",CE((O*M+b)*EE-RE),",",CE((E*I+S)*EE-RE),",",CE((y*M+b)*EE-RE),",",CE((x*I+S)*EE-RE)),r=y,s=x;break;case DE.R:var z=qE[0],B=qE[1];z[0]=p[a++],z[1]=p[a++],B[0]=z[0]+p[a++],B[1]=z[1]+p[a++],e&&(Q(z,z,e),Q(B,B,e)),z[0]=CE(z[0]*EE-RE),B[0]=CE(B[0]*EE-RE),z[1]=CE(z[1]*EE-RE),B[1]=CE(B[1]*EE-RE),f.push(" m ",z[0],",",z[1]," l ",B[0],",",z[1]," l ",B[0],",",B[1]," l ",z[0],",",B[1]);break;case DE.Z:f.push(" x ")}if(i>0){f.push(n);for(var V=0;V100&&(tR=0,QE={});var i,n=eR.style;try{n.font=t,i=n.fontFamily.split(",")[0]}catch(t){}e={style:n.fontStyle||"normal",variant:n.fontVariant||"normal",weight:n.fontWeight||"normal",size:0|parseFloat(n.fontSize||12),family:i||"Microsoft YaHei"},QE[t]=e,tR++}return e};!function(t,e){bb[t]=e}("measureText",function(t,e){var i=AE;JE||((JE=i.createElement("div")).style.cssText="position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;",AE.body.appendChild(JE));try{JE.style.font=e}catch(t){}return JE.innerHTML="",JE.appendChild(i.createTextNode(t)),{width:JE.offsetWidth}});for(var nR=new de,oR=[Db,di,fi,Pn,rM],aR=0;aR=o&&u+1>=a){for(var h=[],c=0;c=o&&c+1>=a)return T_(0,s.components);l[i]=s}else l[i]=void 0}r++}();if(d)return d}},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=0;--n)if(e[n]===t)return!0;return!1}),i):null:i[0]},D_.prototype.update=function(t,e){if(t){var i=this.getDefs(!1);if(t[this._domName]&&i.contains(t[this._domName]))"function"==typeof e&&e(t);else{var n=this.add(t);n&&(t[this._domName]=n)}}},D_.prototype.addDom=function(t){this.getDefs(!0).appendChild(t)},D_.prototype.removeDom=function(t){var e=this.getDefs(!1);e&&t[this._domName]&&(e.removeChild(t[this._domName]),t[this._domName]=null)},D_.prototype.getDoms=function(){var t=this.getDefs(!1);if(!t)return[];var e=[];return d(this._tagNames,function(i){var n=t.getElementsByTagName(i);e=e.concat([].slice.call(n))}),e},D_.prototype.markAllUnused=function(){var t=this;d(this.getDoms(),function(e){e[t._markLabel]="0"})},D_.prototype.markUsed=function(t){t&&(t[this._markLabel]="1")},D_.prototype.removeUnused=function(){var t=this.getDefs(!1);if(t){var e=this;d(this.getDoms(),function(i){"1"!==i[e._markLabel]&&t.removeChild(i)})}},D_.prototype.getSvgProxy=function(t){return t instanceof Pn?yR:t instanceof fi?xR:t instanceof rM?_R:yR},D_.prototype.getTextSvgElement=function(t){return t.__textSvgEl},D_.prototype.getSvgElement=function(t){return t.__svgEl},u(C_,D_),C_.prototype.addWithoutUpdate=function(t,e){if(e&&e.style){var i=this;d(["fill","stroke"],function(n){if(e.style[n]&&("linear"===e.style[n].type||"radial"===e.style[n].type)){var o,a=e.style[n],r=i.getDefs(!0);a._dom?(o=a._dom,r.contains(a._dom)||i.addDom(o)):o=i.add(a),i.markUsed(e);var s=o.getAttribute("id");t.setAttribute(n,"url(#"+s+")")}})}},C_.prototype.add=function(t){var e;if("linear"===t.type)e=this.createElement("linearGradient");else{if("radial"!==t.type)return Yw("Illegal gradient type."),null;e=this.createElement("radialGradient")}return t.id=t.id||this.nextId++,e.setAttribute("id","zr"+this._zrId+"-gradient-"+t.id),this.updateDom(t,e),this.addDom(e),e},C_.prototype.update=function(t){var e=this;D_.prototype.update.call(this,t,function(){var i=t.type,n=t._dom.tagName;"linear"===i&&"linearGradient"===n||"radial"===i&&"radialGradient"===n?e.updateDom(t,t._dom):(e.removeDom(t),e.add(t))})},C_.prototype.updateDom=function(t,e){if("linear"===t.type)e.setAttribute("x1",t.x),e.setAttribute("y1",t.y),e.setAttribute("x2",t.x2),e.setAttribute("y2",t.y2);else{if("radial"!==t.type)return void Yw("Illegal gradient type.");e.setAttribute("cx",t.x),e.setAttribute("cy",t.y),e.setAttribute("r",t.r)}t.global?e.setAttribute("gradientUnits","userSpaceOnUse"):e.setAttribute("gradientUnits","objectBoundingBox"),e.innerHTML="";for(var i=t.colorStops,n=0,o=i.length;n0){var n,o,a=this.getDefs(!0),r=e[0],s=i?"_textDom":"_dom";r[s]?(o=r[s].getAttribute("id"),n=r[s],a.contains(n)||a.appendChild(n)):(o="zr"+this._zrId+"-clip-"+this.nextId,++this.nextId,(n=this.createElement("clipPath")).setAttribute("id",o),a.appendChild(n),r[s]=n);var l=this.getSvgProxy(r);if(r.transform&&r.parent.invTransform&&!i){var u=Array.prototype.slice.call(r.transform);bt(r.transform,r.parent.invTransform,r.transform),l.brush(r),r.transform=u}else l.brush(r);var h=this.getSvgElement(r);n.innerHTML="",n.appendChild(h.cloneNode()),t.setAttribute("clip-path","url(#"+o+")"),e.length>1&&this.updateDom(n,e.slice(1),i)}else t&&t.setAttribute("clip-path","none")},L_.prototype.markUsed=function(t){var e=this;t.__clipPaths&&t.__clipPaths.length>0&&d(t.__clipPaths,function(t){t._dom&&D_.prototype.markUsed.call(e,t._dom),t._textDom&&D_.prototype.markUsed.call(e,t._textDom)})},u(k_,D_),k_.prototype.addWithoutUpdate=function(t,e){if(e&&P_(e.style)){var i,n=e.style;n._shadowDom?(i=n._shadowDom,this.getDefs(!0).contains(n._shadowDom)||this.addDom(i)):i=this.add(e),this.markUsed(e);var o=i.getAttribute("id");t.style.filter="url(#"+o+")"}},k_.prototype.add=function(t){var e=this.createElement("filter"),i=t.style;return i._shadowDomId=i._shadowDomId||this.nextId++,e.setAttribute("id","zr"+this._zrId+"-shadow-"+i._shadowDomId),this.updateDom(t,e),this.addDom(e),e},k_.prototype.update=function(t,e){var i=e.style;if(P_(i)){var n=this;D_.prototype.update.call(this,e,function(t){n.updateDom(e,t._shadowDom)})}else this.remove(t,i)},k_.prototype.remove=function(t,e){null!=e._shadowDomId&&(this.removeDom(e),t.style.filter="")},k_.prototype.updateDom=function(t,e){var i=e.getElementsByTagName("feDropShadow");i=0===i.length?this.createElement("feDropShadow"):i[0];var n,o,a,r,s=t.style,l=t.scale?t.scale[0]||1:1,u=t.scale?t.scale[1]||1:1;if(s.shadowBlur||s.shadowOffsetX||s.shadowOffsetY)n=s.shadowOffsetX||0,o=s.shadowOffsetY||0,a=s.shadowBlur,r=s.shadowColor;else{if(!s.textShadowBlur)return void this.removeDom(e,s);n=s.textShadowOffsetX||0,o=s.textShadowOffsetY||0,a=s.textShadowBlur,r=s.textShadowColor}i.setAttribute("dx",n/l),i.setAttribute("dy",o/u),i.setAttribute("flood-color",r);var h=a/2/l+" "+a/2/u;i.setAttribute("stdDeviation",h),e.setAttribute("x","-100%"),e.setAttribute("y","-100%"),e.setAttribute("width",Math.ceil(a/2*200)+"%"),e.setAttribute("height",Math.ceil(a/2*200)+"%"),e.appendChild(i),s._shadowDom=e},k_.prototype.markUsed=function(t){var e=t.style;e&&e._shadowDom&&D_.prototype.markUsed.call(this,e._shadowDom)};var IR=function(t,e,i,n){this.root=t,this.storage=e,this._opts=i=a({},i||{});var o=p_("svg");o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("version","1.1"),o.setAttribute("baseProfile","full"),o.style.cssText="user-select:none;position:absolute;left:0;top:0;",this.gradientManager=new C_(n,o),this.clipPathManager=new L_(n,o),this.shadowManager=new k_(n,o);var r=document.createElement("div");r.style.cssText="overflow:hidden;position:relative",this._svgRoot=o,this._viewport=r,t.appendChild(r),r.appendChild(o),this.resize(i.width,i.height),this._visibleList=[]};IR.prototype={constructor:IR,getType:function(){return"svg"},getViewportRoot:function(){return this._viewport},getViewportRootOffset:function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},refresh:function(){var t=this.storage.getDisplayList(!0);this._paintList(t)},setBackgroundColor:function(t){this._viewport.style.background=t},_paintList:function(t){this.gradientManager.markAllUnused(),this.clipPathManager.markAllUnused(),this.shadowManager.markAllUnused();var e,i=this._svgRoot,n=this._visibleList,o=t.length,a=[];for(e=0;e=0;--n)if(e[n]===t)return!0;return!1}),i):null:i[0]},resize:function(t,e){var i=this._viewport;i.style.display="none";var n=this._opts;if(null!=t&&(n.width=t),null!=e&&(n.height=e),t=this._getSize(0),e=this._getSize(1),i.style.display="",this._width!==t||this._height!==e){this._width=t,this._height=e;var o=i.style;o.width=t+"px",o.height=e+"px";var a=this._svgRoot;a.setAttribute("width",t),a.setAttribute("height",e)}},getWidth:function(){return this._width},getHeight:function(){return this._height},_getSize:function(t){var e=this._opts,i=["width","height"][t],n=["clientWidth","clientHeight"][t],o=["paddingLeft","paddingTop"][t],a=["paddingRight","paddingBottom"][t];if(null!=e[i]&&"auto"!==e[i])return parseFloat(e[i]);var r=this.root,s=document.defaultView.getComputedStyle(r);return(r[n]||N_(s[i])||N_(r.style[i]))-(N_(s[o])||0)-(N_(s[a])||0)|0},dispose:function(){this.root.innerHTML="",this._svgRoot=this._viewport=this.storage=null},clear:function(){this._viewport&&this.root.removeChild(this._viewport)},pathToDataUrl:function(){return this.refresh(),"data:image/svg+xml;charset=UTF-8,"+this._svgRoot.outerHTML}},d(["getLayer","insertLayer","eachLayer","eachBuiltinLayer","eachOtherLayer","getLayers","modLayer","delLayer","clearLayer","toDataURL","pathToImage"],function(t){IR.prototype[t]=F_(t)}),Ti("svg",IR),t.version="4.2.1",t.dependencies=ET,t.PRIORITY=VT,t.init=function(t,e,i){var n=ks(t);if(n)return n;var o=new us(t,e,i);return o.id="ec_"+iA++,tA[o.id]=o,Fi(t,oA,o.id),Cs(o),o},t.connect=function(t){if(y(t)){var e=t;t=null,kT(e,function(e){null!=e.group&&(t=e.group)}),t=t||"g_"+nA++,kT(e,function(e){e.group=t})}return eA[t]=!0,t},t.disConnect=Ls,t.disconnect=aA,t.dispose=function(t){"string"==typeof t?t=tA[t]:t instanceof us||(t=ks(t)),t instanceof us&&!t.isDisposed()&&t.dispose()},t.getInstanceByDom=ks,t.getInstanceById=function(t){return tA[t]},t.registerTheme=Ps,t.registerPreprocessor=Ns,t.registerProcessor=Os,t.registerPostUpdate=function(t){KT.push(t)},t.registerAction=Es,t.registerCoordinateSystem=Rs,t.getCoordinateSystemDimensions=function(t){var e=Fa.get(t);if(e)return e.getDimensionsInfo?e.getDimensionsInfo():e.dimensions.slice()},t.registerLayout=zs,t.registerVisual=Bs,t.registerLoading=Gs,t.extendComponentModel=Fs,t.extendComponentView=Ws,t.extendSeriesModel=Hs,t.extendChartView=Zs,t.setCanvasCreator=function(t){e("createCanvas",t)},t.registerMap=function(t,e,i){DT.registerMap(t,e,i)},t.getMap=function(t){var e=DT.retrieveMap(t);return e&&e[0]&&{geoJson:e[0].geoJSON,specialAreas:e[0].specialAreas}},t.dataTool=rA,t.zrender=Hb,t.number=YM,t.format=eI,t.throttle=Pr,t.helper=tD,t.matrix=Sw,t.vector=cw,t.color=Ww,t.parseGeoJSON=iD,t.parseGeoJson=rD,t.util=sD,t.graphic=lD,t.List=vA,t.Model=No,t.Axis=aD,t.env=U_}); \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/qiun-data-charts/static/h5/echarts.min.js b/sport-erp-admin/uni_modules/qiun-data-charts/static/h5/echarts.min.js deleted file mode 100644 index 5396a03..0000000 --- a/sport-erp-admin/uni_modules/qiun-data-charts/static/h5/echarts.min.js +++ /dev/null @@ -1,23 +0,0 @@ - -/* -* 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. -* 版本为4.2.1,修改一处源码:this.el.hide() 改为 this.el?this.el.hide():true -*/ - - -!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";function e(t,e){"createCanvas"===t&&(nw=null),ew[t]=e}function i(t){if(null==t||"object"!=typeof t)return t;var e=t,n=Y_.call(t);if("[object Array]"===n){if(!O(t)){e=[];for(var o=0,a=t.length;o=0){var o="touchend"!==n?e.targetTouches[0]:e.changedTouches[0];o&&st(t,o,e,i)}else st(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&&gw.test(e.type)&&(e.which=1&a?1:2&a?3:4&a?2:0),e}function ht(t,e,i){pw?t.addEventListener(e,i):t.attachEvent("on"+e,i)}function ct(t,e,i){pw?t.removeEventListener(e,i):t.detachEvent("on"+e,i)}function dt(t){return 2===t.which||3===t.which}function ft(t){var e=t[1][0]-t[0][0],i=t[1][1]-t[0][1];return Math.sqrt(e*e+i*i)}function pt(t){return[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]}function gt(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:mt}}function mt(t){mw(this.event)}function vt(){}function yt(t,e,i){if(t[t.rectHover?"rectContain":"contain"](e,i)){for(var n,o=t;o;){if(o.clipPath&&!o.clipPath.contain(e,i))return!1;o.silent&&(n=!0),o=o.parent}return!n||xw}return!1}function xt(){var t=new bw(6);return _t(t),t}function _t(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function wt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function bt(t,e,i){var n=e[0]*i[0]+e[2]*i[1],o=e[1]*i[0]+e[3]*i[1],a=e[0]*i[2]+e[2]*i[3],r=e[1]*i[2]+e[3]*i[3],s=e[0]*i[4]+e[2]*i[5]+e[4],l=e[1]*i[4]+e[3]*i[5]+e[5];return t[0]=n,t[1]=o,t[2]=a,t[3]=r,t[4]=s,t[5]=l,t}function St(t,e,i){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+i[0],t[5]=e[5]+i[1],t}function Mt(t,e,i){var n=e[0],o=e[2],a=e[4],r=e[1],s=e[3],l=e[5],u=Math.sin(i),h=Math.cos(i);return t[0]=n*h+r*u,t[1]=-n*u+r*h,t[2]=o*h+s*u,t[3]=-o*u+h*s,t[4]=h*a+u*l,t[5]=h*l-u*a,t}function It(t,e,i){var n=i[0],o=i[1];return t[0]=e[0]*n,t[1]=e[1]*o,t[2]=e[2]*n,t[3]=e[3]*o,t[4]=e[4]*n,t[5]=e[5]*o,t}function Tt(t,e){var i=e[0],n=e[2],o=e[4],a=e[1],r=e[3],s=e[5],l=i*r-a*n;return l?(l=1/l,t[0]=r*l,t[1]=-a*l,t[2]=-n*l,t[3]=i*l,t[4]=(n*s-r*o)*l,t[5]=(a*o-i*s)*l,t):null}function At(t){var e=xt();return wt(e,t),e}function Dt(t){return t>Iw||t<-Iw}function Ct(t){this._target=t.target,this._life=t.life||1e3,this._delay=t.delay||0,this._initialized=!1,this.loop=null!=t.loop&&t.loop,this.gap=t.gap||0,this.easing=t.easing||"Linear",this.onframe=t.onframe,this.ondestroy=t.ondestroy,this.onrestart=t.onrestart,this._pausedTime=0,this._paused=!1}function Lt(t){return(t=Math.round(t))<0?0:t>255?255:t}function kt(t){return(t=Math.round(t))<0?0:t>360?360:t}function Pt(t){return t<0?0:t>1?1:t}function Nt(t){return Lt(t.length&&"%"===t.charAt(t.length-1)?parseFloat(t)/100*255:parseInt(t,10))}function Ot(t){return Pt(t.length&&"%"===t.charAt(t.length-1)?parseFloat(t)/100:parseFloat(t))}function Et(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}function Rt(t,e,i){return t+(e-t)*i}function zt(t,e,i,n,o){return t[0]=e,t[1]=i,t[2]=n,t[3]=o,t}function Bt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function Vt(t,e){Vw&&Bt(Vw,e),Vw=Bw.put(t,Vw||e.slice())}function Gt(t,e){if(t){e=e||[];var i=Bw.get(t);if(i)return Bt(e,i);var n=(t+="").replace(/ /g,"").toLowerCase();if(n in zw)return Bt(e,zw[n]),Vt(t,e),e;if("#"!==n.charAt(0)){var o=n.indexOf("("),a=n.indexOf(")");if(-1!==o&&a+1===n.length){var r=n.substr(0,o),s=n.substr(o+1,a-(o+1)).split(","),l=1;switch(r){case"rgba":if(4!==s.length)return void zt(e,0,0,0,1);l=Ot(s.pop());case"rgb":return 3!==s.length?void zt(e,0,0,0,1):(zt(e,Nt(s[0]),Nt(s[1]),Nt(s[2]),l),Vt(t,e),e);case"hsla":return 4!==s.length?void zt(e,0,0,0,1):(s[3]=Ot(s[3]),Ft(s,e),Vt(t,e),e);case"hsl":return 3!==s.length?void zt(e,0,0,0,1):(Ft(s,e),Vt(t,e),e);default:return}}zt(e,0,0,0,1)}else{if(4===n.length)return(u=parseInt(n.substr(1),16))>=0&&u<=4095?(zt(e,(3840&u)>>4|(3840&u)>>8,240&u|(240&u)>>4,15&u|(15&u)<<4,1),Vt(t,e),e):void zt(e,0,0,0,1);if(7===n.length){var u=parseInt(n.substr(1),16);return u>=0&&u<=16777215?(zt(e,(16711680&u)>>16,(65280&u)>>8,255&u,1),Vt(t,e),e):void zt(e,0,0,0,1)}}}}function Ft(t,e){var i=(parseFloat(t[0])%360+360)%360/360,n=Ot(t[1]),o=Ot(t[2]),a=o<=.5?o*(n+1):o+n-o*n,r=2*o-a;return e=e||[],zt(e,Lt(255*Et(r,a,i+1/3)),Lt(255*Et(r,a,i)),Lt(255*Et(r,a,i-1/3)),1),4===t.length&&(e[3]=t[3]),e}function Wt(t){if(t){var e,i,n=t[0]/255,o=t[1]/255,a=t[2]/255,r=Math.min(n,o,a),s=Math.max(n,o,a),l=s-r,u=(s+r)/2;if(0===l)e=0,i=0;else{i=u<.5?l/(s+r):l/(2-s-r);var h=((s-n)/6+l/2)/l,c=((s-o)/6+l/2)/l,d=((s-a)/6+l/2)/l;n===s?e=d-c:o===s?e=1/3+h-d:a===s&&(e=2/3+c-h),e<0&&(e+=1),e>1&&(e-=1)}var f=[360*e,i,u];return null!=t[3]&&f.push(t[3]),f}}function Ht(t,e){var i=Gt(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,i[n]>255?i[n]=255:t[n]<0&&(i[n]=0);return qt(i,4===i.length?"rgba":"rgb")}}function Zt(t){var e=Gt(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)}function Ut(t,e,i){if(e&&e.length&&t>=0&&t<=1){i=i||[];var n=t*(e.length-1),o=Math.floor(n),a=Math.ceil(n),r=e[o],s=e[a],l=n-o;return i[0]=Lt(Rt(r[0],s[0],l)),i[1]=Lt(Rt(r[1],s[1],l)),i[2]=Lt(Rt(r[2],s[2],l)),i[3]=Pt(Rt(r[3],s[3],l)),i}}function Xt(t,e,i){if(e&&e.length&&t>=0&&t<=1){var n=t*(e.length-1),o=Math.floor(n),a=Math.ceil(n),r=Gt(e[o]),s=Gt(e[a]),l=n-o,u=qt([Lt(Rt(r[0],s[0],l)),Lt(Rt(r[1],s[1],l)),Lt(Rt(r[2],s[2],l)),Pt(Rt(r[3],s[3],l))],"rgba");return i?{color:u,leftIndex:o,rightIndex:a,value:n}:u}}function jt(t,e,i,n){if(t=Gt(t))return t=Wt(t),null!=e&&(t[0]=kt(e)),null!=i&&(t[1]=Ot(i)),null!=n&&(t[2]=Ot(n)),qt(Ft(t),"rgba")}function Yt(t,e){if((t=Gt(t))&&null!=e)return t[3]=Pt(e),qt(t,"rgba")}function qt(t,e){if(t&&t.length){var i=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(i+=","+t[3]),e+"("+i+")"}}function Kt(t,e){return t[e]}function $t(t,e,i){t[e]=i}function Jt(t,e,i){return(e-t)*i+t}function Qt(t,e,i){return i>.5?e:t}function te(t,e,i,n,o){var a=t.length;if(1===o)for(s=0;so)t.length=o;else for(r=n;r=0&&!(m[i]<=e);i--);i=Math.min(i,u-2)}else{for(i=L;ie);i++);i=Math.min(i-1,u-2)}L=i,k=e;var n=m[i+1]-m[i];if(0!==n)if(I=(e-m[i])/n,l)if(A=v[i],T=v[0===i?i:i-1],D=v[i>u-2?u-1:i+1],C=v[i>u-3?u-1:i+2],d)ne(T,A,D,C,I,I*I,I*I*I,r(t,o),g);else{if(f)a=ne(T,A,D,C,I,I*I,I*I*I,P,1),a=re(P);else{if(p)return Qt(A,D,I);a=oe(T,A,D,C,I,I*I,I*I*I)}s(t,o,a)}else if(d)te(v[i],v[i+1],I,r(t,o),g);else{var a;if(f)te(v[i],v[i+1],I,P,1),a=re(P);else{if(p)return Qt(v[i],v[i+1],I);a=Jt(v[i],v[i+1],I)}s(t,o,a)}},ondestroy:i});return e&&"spline"!==e&&(N.easing=e),N}}}function ue(t,e,i,n,o,a,r,s){_(n)?(a=o,o=n,n=0):x(o)?(a=o,o="linear",n=0):x(n)?(a=n,n=0):x(i)?(a=i,i=500):i||(i=500),t.stopAnimation(),he(t,"",t,e,i,n,s);var l=t.animators.slice(),u=l.length;u||a&&a();for(var h=0;h0&&t.animate(e,!1).when(null==o?500:o,s).delay(a||0)}function ce(t,e,i,n){if(e){var o={};o[e]={},o[e][i]=n,t.attr(o)}else t.attr(i,n)}function de(t,e,i,n){i<0&&(t+=i,i=-i),n<0&&(e+=n,n=-n),this.x=t,this.y=e,this.width=i,this.height=n}function fe(t){for(var e=0;t>=eb;)e|=1&t,t>>=1;return t+e}function pe(t,e,i,n){var o=e+1;if(o===i)return 1;if(n(t[o++],t[e])<0){for(;o=0;)o++;return o-e}function ge(t,e,i){for(i--;e>>1])<0?l=a:s=a+1;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(;u>0;)t[s+u]=t[s+u-1],u--}t[s]=r}}function ve(t,e,i,n,o,a){var r=0,s=0,l=1;if(a(t,e[i+o])>0){for(s=n-o;l0;)r=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),r+=o,l+=o}else{for(s=o+1;ls&&(l=s);var u=r;r=o-l,l=o-u}for(r++;r>>1);a(t,e[i+h])>0?r=h+1:l=h}return l}function ye(t,e,i,n,o,a){var r=0,s=0,l=1;if(a(t,e[i+o])<0){for(s=o+1;ls&&(l=s);var u=r;r=o-l,l=o-u}else{for(s=n-o;l=0;)r=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),r+=o,l+=o}for(r++;r>>1);a(t,e[i+h])<0?l=h:r=h+1}return l}function xe(t,e){function i(i){var s=a[i],u=r[i],h=a[i+1],c=r[i+1];r[i]=u+c,i===l-3&&(a[i+1]=a[i+2],r[i+1]=r[i+2]),l--;var d=ye(t[h],t,s,u,0,e);s+=d,0!==(u-=d)&&0!==(c=ve(t[s+u-1],t,h,c,c-1,e))&&(u<=c?n(s,u,h,c):o(s,u,h,c))}function n(i,n,o,a){var r=0;for(r=0;r=ib||f>=ib);if(p)break;g<0&&(g=0),g+=2}if((s=g)<1&&(s=1),1===n){for(r=0;r=0;r--)t[f+r]=t[d+r];if(0===n){v=!0;break}}if(t[c--]=u[h--],1==--a){v=!0;break}if(0!=(m=a-ve(t[l],u,0,a,a-1,e))){for(a-=m,f=(c-=m)+1,d=(h-=m)+1,r=0;r=ib||m>=ib);if(v)break;p<0&&(p=0),p+=2}if((s=p)<1&&(s=1),1===a){for(f=(c-=n)+1,d=(l-=n)+1,r=n-1;r>=0;r--)t[f+r]=t[d+r];t[c]=u[h]}else{if(0===a)throw new Error;for(d=c-(a-1),r=0;r=0;r--)t[f+r]=t[d+r];t[c]=u[h]}else for(d=c-(a-1),r=0;r1;){var t=l-2;if(t>=1&&r[t-1]<=r[t]+r[t+1]||t>=2&&r[t-2]<=r[t]+r[t-1])r[t-1]r[t+1])break;i(t)}},this.forceMergeRuns=function(){for(;l>1;){var t=l-2;t>0&&r[t-1]s&&(l=s),me(t,i,i+l,i+a,e),a=l}r.pushRun(i,a),r.mergeRuns(),o-=a,i+=a}while(0!==o);r.forceMergeRuns()}}function we(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}function be(t,e,i){var n=null==e.x?0:e.x,o=null==e.x2?1:e.x2,a=null==e.y?0:e.y,r=null==e.y2?0:e.y2;return e.global||(n=n*i.width+i.x,o=o*i.width+i.x,a=a*i.height+i.y,r=r*i.height+i.y),n=isNaN(n)?0:n,o=isNaN(o)?1:o,a=isNaN(a)?0:a,r=isNaN(r)?0:r,t.createLinearGradient(n,a,o,r)}function Se(t,e,i){var n=i.width,o=i.height,a=Math.min(n,o),r=null==e.x?.5:e.x,s=null==e.y?.5:e.y,l=null==e.r?.5:e.r;return e.global||(r=r*n+i.x,s=s*o+i.y,l*=a),t.createRadialGradient(r,s,0,r,s,l)}function Me(){return!1}function Ie(t,e,i){var n=iw(),o=e.getWidth(),a=e.getHeight(),r=n.style;return r&&(r.position="absolute",r.left=0,r.top=0,r.width=o+"px",r.height=a+"px",n.setAttribute("data-zr-dom-id",t)),n.width=o*i,n.height=a*i,n}function Te(t){if("string"==typeof t){var e=mb.get(t);return e&&e.image}return t}function Ae(t,e,i,n,o){if(t){if("string"==typeof t){if(e&&e.__zrImageSrc===t||!i)return e;var a=mb.get(t),r={hostEl:i,cb:n,cbPayload:o};return a?!Ce(e=a.image)&&a.pending.push(r):((e=new Image).onload=e.onerror=De,mb.put(t,e.__cachedImgObj={image:e,pending:[r]}),e.src=e.__zrImageSrc=t),e}return t}return e}function De(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;exb&&(yb=0,vb={}),yb++,vb[i]=o,o}function ke(t,e,i,n,o,a,r,s){return r?Ne(t,e,i,n,o,a,r,s):Pe(t,e,i,n,o,a,s)}function Pe(t,e,i,n,o,a,r){var s=He(t,e,o,a,r),l=Le(t,e);o&&(l+=o[1]+o[3]);var u=s.outerHeight,h=new de(Oe(0,l,i),Ee(0,u,n),l,u);return h.lineHeight=s.lineHeight,h}function Ne(t,e,i,n,o,a,r,s){var l=Ze(t,{rich:r,truncate:s,font:e,textAlign:i,textPadding:o,textLineHeight:a}),u=l.outerWidth,h=l.outerHeight;return new de(Oe(0,u,i),Ee(0,h,n),u,h)}function Oe(t,e,i){return"right"===i?t-=e:"center"===i&&(t-=e/2),t}function Ee(t,e,i){return"middle"===i?t-=e/2:"bottom"===i&&(t-=e),t}function Re(t,e,i){var n=e.x,o=e.y,a=e.height,r=e.width,s=a/2,l="left",u="top";switch(t){case"left":n-=i,o+=s,l="right",u="middle";break;case"right":n+=i+r,o+=s,u="middle";break;case"top":n+=r/2,o-=i,l="center",u="bottom";break;case"bottom":n+=r/2,o+=a+i,l="center";break;case"inside":n+=r/2,o+=s,l="center",u="middle";break;case"insideLeft":n+=i,o+=s,u="middle";break;case"insideRight":n+=r-i,o+=s,l="right",u="middle";break;case"insideTop":n+=r/2,o+=i,l="center";break;case"insideBottom":n+=r/2,o+=a-i,l="center",u="bottom";break;case"insideTopLeft":n+=i,o+=i;break;case"insideTopRight":n+=r-i,o+=i,l="right";break;case"insideBottomLeft":n+=i,o+=a-i,u="bottom";break;case"insideBottomRight":n+=r-i,o+=a-i,l="right",u="bottom"}return{x:n,y:o,textAlign:l,textVerticalAlign:u}}function ze(t,e,i,n,o){if(!e)return"";var a=(t+"").split("\n");o=Be(e,i,n,o);for(var r=0,s=a.length;r=r;l++)s-=r;var u=Le(i,e);return u>s&&(i="",u=0),s=t-u,n.ellipsis=i,n.ellipsisWidth=u,n.contentWidth=s,n.containerWidth=t,n}function Ve(t,e){var i=e.containerWidth,n=e.font,o=e.contentWidth;if(!i)return"";var a=Le(t,n);if(a<=i)return t;for(var r=0;;r++){if(a<=o||r>=e.maxIterations){t+=e.ellipsis;break}var s=0===r?Ge(t,o,e.ascCharWidth,e.cnCharWidth):a>0?Math.floor(t.length*o/a):0;a=Le(t=t.substr(0,s),n)}return""===t&&(t=e.placeholder),t}function Ge(t,e,i,n){for(var o=0,a=0,r=t.length;au)t="",r=[];else if(null!=h)for(var c=Be(h-(i?i[1]+i[3]:0),e,o.ellipsis,{minChar:o.minChar,placeholder:o.placeholder}),d=0,f=r.length;do&&Ue(i,t.substring(o,a)),Ue(i,n[2],n[1]),o=_b.lastIndex}of)return{lines:[],width:0,height:0};k.textWidth=Le(k.text,_);var b=y.textWidth,S=null==b||"auto"===b;if("string"==typeof b&&"%"===b.charAt(b.length-1))k.percentWidth=b,u.push(k),b=0;else{if(S){b=k.textWidth;var M=y.textBackgroundColor,I=M&&M.image;I&&Ce(I=Te(I))&&(b=Math.max(b,I.width*w/I.height))}var T=x?x[1]+x[3]:0;b+=T;var C=null!=d?d-m:null;null!=C&&Cl&&(i*=l/(c=i+n),n*=l/c),o+a>l&&(o*=l/(c=o+a),a*=l/c),n+o>u&&(n*=u/(c=n+o),o*=u/c),i+a>u&&(i*=u/(c=i+a),a*=u/c),t.moveTo(r+i,s),t.lineTo(r+l-n,s),0!==n&&t.arc(r+l-n,s+n,n,-Math.PI/2,0),t.lineTo(r+l,s+u-o),0!==o&&t.arc(r+l-o,s+u-o,o,0,Math.PI/2),t.lineTo(r+a,s+u),0!==a&&t.arc(r+a,s+u-a,a,Math.PI/2,Math.PI),t.lineTo(r,s+i),0!==i&&t.arc(r+i,s+i,i,Math.PI,1.5*Math.PI)}function Ye(t){return qe(t),d(t.rich,qe),t}function qe(t){if(t){t.font=Xe(t);var e=t.textAlign;"middle"===e&&(e="center"),t.textAlign=null==e||Mb[e]?e:"left";var i=t.textVerticalAlign||t.textBaseline;"center"===i&&(i="middle"),t.textVerticalAlign=null==i||Ib[i]?i:"top",t.textPadding&&(t.textPadding=L(t.textPadding))}}function Ke(t,e,i,n,o,a){n.rich?Je(t,e,i,n,o,a):$e(t,e,i,n,o,a)}function $e(t,e,i,n,o,a){var r,s=ii(n),l=!1,u=e.__attrCachedBy===rb.PLAIN_TEXT;a!==sb?(a&&(r=a.style,l=!s&&u&&r),e.__attrCachedBy=s?rb.NONE:rb.PLAIN_TEXT):u&&(e.__attrCachedBy=rb.NONE);var h=n.font||Sb;l&&h===(r.font||Sb)||(e.font=h);var c=t.__computedFont;t.__styleFont!==h&&(t.__styleFont=h,c=t.__computedFont=e.font);var d=n.textPadding,f=n.textLineHeight,p=t.__textCotentBlock;p&&!t.__dirtyText||(p=t.__textCotentBlock=He(i,c,d,f,n.truncate));var g=p.outerHeight,m=p.lines,v=p.lineHeight,y=ai(g,n,o),x=y.baseX,_=y.baseY,w=y.textAlign||"left",b=y.textVerticalAlign;ti(e,n,o,x,_);var S=Ee(_,g,b),M=x,I=S;if(s||d){var T=Le(i,c);d&&(T+=d[1]+d[3]);var A=Oe(x,T,w);s&&ni(t,e,n,A,S,T,g),d&&(M=hi(x,w,d),I+=d[0])}e.textAlign=w,e.textBaseline="middle",e.globalAlpha=n.opacity||1;for(B=0;B=0&&"right"===(_=b[C]).textAlign;)ei(t,e,_,n,M,v,D,"right"),I-=_.width,D-=_.width,C--;for(A+=(a-(A-m)-(y-D)-I)/2;T<=C;)ei(t,e,_=b[T],n,M,v,A+_.width/2,"center"),A+=_.width,T++;v+=M}}function ti(t,e,i,n,o){if(i&&e.textRotation){var a=e.textOrigin;"center"===a?(n=i.width/2+i.x,o=i.height/2+i.y):a&&(n=a[0]+i.x,o=a[1]+i.y),t.translate(n,o),t.rotate(-e.textRotation),t.translate(-n,-o)}}function ei(t,e,i,n,o,a,r,s){var l=n.rich[i.styleName]||{};l.text=i.text;var u=i.textVerticalAlign,h=a+o/2;"top"===u?h=a+i.height/2:"bottom"===u&&(h=a+o-i.height/2),!i.isLineHolder&&ii(l)&&ni(t,e,l,"right"===s?r-i.width:"center"===s?r-i.width/2:r,h-i.height/2,i.width,i.height);var c=i.textPadding;c&&(r=hi(r,s,c),h-=i.height/2-c[2]-i.textHeight/2),ri(e,"shadowBlur",D(l.textShadowBlur,n.textShadowBlur,0)),ri(e,"shadowColor",l.textShadowColor||n.textShadowColor||"transparent"),ri(e,"shadowOffsetX",D(l.textShadowOffsetX,n.textShadowOffsetX,0)),ri(e,"shadowOffsetY",D(l.textShadowOffsetY,n.textShadowOffsetY,0)),ri(e,"textAlign",s),ri(e,"textBaseline","middle"),ri(e,"font",i.font||Sb);var d=si(l.textStroke||n.textStroke,p),f=li(l.textFill||n.textFill),p=A(l.textStrokeWidth,n.textStrokeWidth);d&&(ri(e,"lineWidth",p),ri(e,"strokeStyle",d),e.strokeText(i.text,r,h)),f&&(ri(e,"fillStyle",f),e.fillText(i.text,r,h))}function ii(t){return!!(t.textBackgroundColor||t.textBorderWidth&&t.textBorderColor)}function ni(t,e,i,n,o,a,r){var s=i.textBackgroundColor,l=i.textBorderWidth,u=i.textBorderColor,h=_(s);if(ri(e,"shadowBlur",i.textBoxShadowBlur||0),ri(e,"shadowColor",i.textBoxShadowColor||"transparent"),ri(e,"shadowOffsetX",i.textBoxShadowOffsetX||0),ri(e,"shadowOffsetY",i.textBoxShadowOffsetY||0),h||l&&u){e.beginPath();var c=i.textBorderRadius;c?je(e,{x:n,y:o,width:a,height:r,r:c}):e.rect(n,o,a,r),e.closePath()}if(h)if(ri(e,"fillStyle",s),null!=i.fillOpacity){f=e.globalAlpha;e.globalAlpha=i.fillOpacity*i.opacity,e.fill(),e.globalAlpha=f}else e.fill();else if(w(s)){var d=s.image;(d=Ae(d,null,t,oi,s))&&Ce(d)&&e.drawImage(d,n,o,a,r)}if(l&&u)if(ri(e,"lineWidth",l),ri(e,"strokeStyle",u),null!=i.strokeOpacity){var f=e.globalAlpha;e.globalAlpha=i.strokeOpacity*i.opacity,e.stroke(),e.globalAlpha=f}else e.stroke()}function oi(t,e){e.image=t}function ai(t,e,i){var n=e.x||0,o=e.y||0,a=e.textAlign,r=e.textVerticalAlign;if(i){var s=e.textPosition;if(s instanceof Array)n=i.x+ui(s[0],i.width),o=i.y+ui(s[1],i.height);else{var l=Re(s,i,e.textDistance);n=l.x,o=l.y,a=a||l.textAlign,r=r||l.textVerticalAlign}var u=e.textOffset;u&&(n+=u[0],o+=u[1])}return{baseX:n,baseY:o,textAlign:a,textVerticalAlign:r}}function ri(t,e,i){return t[e]=ab(t,e,i),t[e]}function si(t,e){return null==t||e<=0||"transparent"===t||"none"===t?null:t.image||t.colorStops?"#000":t}function li(t){return null==t||"none"===t?null:t.image||t.colorStops?"#000":t}function ui(t,e){return"string"==typeof t?t.lastIndexOf("%")>=0?parseFloat(t)/100*e:parseFloat(t):t}function hi(t,e,i){return"right"===e?t-i[1]:"center"===e?t+i[3]/2-i[1]/2:t+i[3]}function ci(t,e){return null!=t&&(t||e.textBackgroundColor||e.textBorderWidth&&e.textBorderColor||e.textPadding)}function di(t){t=t||{},Kw.call(this,t);for(var e in t)t.hasOwnProperty(e)&&"style"!==e&&(this[e]=t[e]);this.style=new ub(t.style,this),this._rect=null,this.__clipPaths=[]}function fi(t){di.call(this,t)}function pi(t){return parseInt(t,10)}function gi(t){return!!t&&(!!t.__builtin__||"function"==typeof t.resize&&"function"==typeof t.refresh)}function mi(t,e,i){return Cb.copy(t.getBoundingRect()),t.transform&&Cb.applyTransform(t.transform),Lb.width=e,Lb.height=i,!Cb.intersect(Lb)}function vi(t,e){if(t===e)return!1;if(!t||!e||t.length!==e.length)return!0;for(var i=0;i=i.length&&i.push({option:t})}}),i}function Ni(t){var e=R();Zb(t,function(t,i){var n=t.exist;n&&e.set(n.id,t)}),Zb(t,function(t,i){var n=t.option;k(!n||null==n.id||!e.get(n.id)||e.get(n.id)===t,"id duplicates: "+(n&&n.id)),n&&null!=n.id&&e.set(n.id,t),!t.keyInfo&&(t.keyInfo={})}),Zb(t,function(t,i){var n=t.exist,o=t.option,a=t.keyInfo;if(Ub(o)){if(a.name=null!=o.name?o.name+"":n?n.name:jb+i,n)a.id=n.id;else if(null!=o.id)a.id=o.id+"";else{var r=0;do{a.id="\0"+a.name+"\0"+r++}while(e.get(a.id))}e.set(a.id,t)}})}function Oi(t){var e=t.name;return!(!e||!e.indexOf(jb))}function Ei(t){return Ub(t)&&t.id&&0===(t.id+"").indexOf("\0_ec_\0")}function Ri(t,e){function i(t,e,i){for(var n=0,o=t.length;n-rS&&trS||t<-rS}function tn(t,e,i,n,o){var a=1-o;return a*a*(a*t+3*o*e)+o*o*(o*n+3*a*i)}function en(t,e,i,n,o){var a=1-o;return 3*(((e-t)*a+2*(i-e)*o)*a+(n-i)*o*o)}function nn(t,e,i,n,o,a){var r=n+3*(e-i)-t,s=3*(i-2*e+t),l=3*(e-t),u=t-o,h=s*s-3*r*l,c=s*l-9*r*u,d=l*l-3*s*u,f=0;if(Ji(h)&&Ji(c))Ji(s)?a[0]=0:(M=-l/s)>=0&&M<=1&&(a[f++]=M);else{var p=c*c-4*h*d;if(Ji(p)){var g=c/h,m=-g/2;(M=-s/r+g)>=0&&M<=1&&(a[f++]=M),m>=0&&m<=1&&(a[f++]=m)}else if(p>0){var v=aS(p),y=h*s+1.5*r*(-c+v),x=h*s+1.5*r*(-c-v);(M=(-s-((y=y<0?-oS(-y,uS):oS(y,uS))+(x=x<0?-oS(-x,uS):oS(x,uS))))/(3*r))>=0&&M<=1&&(a[f++]=M)}else{var _=(2*h*s-3*r*c)/(2*aS(h*h*h)),w=Math.acos(_)/3,b=aS(h),S=Math.cos(w),M=(-s-2*b*S)/(3*r),m=(-s+b*(S+lS*Math.sin(w)))/(3*r),I=(-s+b*(S-lS*Math.sin(w)))/(3*r);M>=0&&M<=1&&(a[f++]=M),m>=0&&m<=1&&(a[f++]=m),I>=0&&I<=1&&(a[f++]=I)}}return f}function on(t,e,i,n,o){var a=6*i-12*e+6*t,r=9*e+3*n-3*t-9*i,s=3*e-3*t,l=0;if(Ji(r))Qi(a)&&(c=-s/a)>=0&&c<=1&&(o[l++]=c);else{var u=a*a-4*r*s;if(Ji(u))o[0]=-a/(2*r);else if(u>0){var h=aS(u),c=(-a+h)/(2*r),d=(-a-h)/(2*r);c>=0&&c<=1&&(o[l++]=c),d>=0&&d<=1&&(o[l++]=d)}}return l}function an(t,e,i,n,o,a){var r=(e-t)*o+t,s=(i-e)*o+e,l=(n-i)*o+i,u=(s-r)*o+r,h=(l-s)*o+s,c=(h-u)*o+u;a[0]=t,a[1]=r,a[2]=u,a[3]=c,a[4]=c,a[5]=h,a[6]=l,a[7]=n}function rn(t,e,i,n,o,a,r,s,l,u,h){var c,d,f,p,g,m=.005,v=1/0;hS[0]=l,hS[1]=u;for(var y=0;y<1;y+=.05)cS[0]=tn(t,i,o,r,y),cS[1]=tn(e,n,a,s,y),(p=hw(hS,cS))=0&&p=0&&c<=1&&(o[l++]=c);else{var u=r*r-4*a*s;if(Ji(u))(c=-r/(2*a))>=0&&c<=1&&(o[l++]=c);else if(u>0){var h=aS(u),c=(-r+h)/(2*a),d=(-r-h)/(2*a);c>=0&&c<=1&&(o[l++]=c),d>=0&&d<=1&&(o[l++]=d)}}return l}function hn(t,e,i){var n=t+i-2*e;return 0===n?.5:(t-e)/n}function cn(t,e,i,n,o){var a=(e-t)*n+t,r=(i-e)*n+e,s=(r-a)*n+a;o[0]=t,o[1]=a,o[2]=s,o[3]=s,o[4]=r,o[5]=i}function dn(t,e,i,n,o,a,r,s,l){var u,h=.005,c=1/0;hS[0]=r,hS[1]=s;for(var d=0;d<1;d+=.05)cS[0]=sn(t,i,o,d),cS[1]=sn(e,n,a,d),(m=hw(hS,cS))=0&&m1e-4)return s[0]=t-i,s[1]=e-n,l[0]=t+i,void(l[1]=e+n);if(yS[0]=mS(o)*i+t,yS[1]=gS(o)*n+e,xS[0]=mS(a)*i+t,xS[1]=gS(a)*n+e,u(s,yS,xS),h(l,yS,xS),(o%=vS)<0&&(o+=vS),(a%=vS)<0&&(a+=vS),o>a&&!r?a+=vS:oo&&(_S[0]=mS(f)*i+t,_S[1]=gS(f)*n+e,u(s,_S,s),h(l,_S,l))}function yn(t,e,i,n,o,a,r){if(0===o)return!1;var s=o,l=0,u=t;if(r>e+s&&r>n+s||rt+s&&a>i+s||ae+c&&h>n+c&&h>a+c&&h>s+c||ht+c&&u>i+c&&u>o+c&&u>r+c||ue+u&&l>n+u&&l>a+u||lt+u&&s>i+u&&s>o+u||si||h+uo&&(o+=zS);var d=Math.atan2(l,s);return d<0&&(d+=zS),d>=n&&d<=o||d+zS>=n&&d+zS<=o}function Sn(t,e,i,n,o,a){if(a>e&&a>n||ao?r:0}function Mn(t,e){return Math.abs(t-e)e&&u>n&&u>a&&u>s||u1&&In(),c=tn(e,n,a,s,WS[0]),p>1&&(d=tn(e,n,a,s,WS[1]))),2===p?me&&s>n&&s>a||s=0&&u<=1){for(var h=0,c=sn(e,n,a,u),d=0;di||s<-i)return 0;u=Math.sqrt(i*i-s*s);FS[0]=-u,FS[1]=u;var l=Math.abs(n-o);if(l<1e-4)return 0;if(l%VS<1e-4){n=0,o=VS;p=a?1:-1;return r>=FS[0]+t&&r<=FS[1]+t?p:0}if(a){var u=n;n=wn(o),o=wn(u)}else n=wn(n),o=wn(o);n>o&&(o+=VS);for(var h=0,c=0;c<2;c++){var d=FS[c];if(d+t>r){var f=Math.atan2(s,d),p=a?1:-1;f<0&&(f=VS+f),(f>=n&&f<=o||f+VS>=n&&f+VS<=o)&&(f>Math.PI/2&&f<1.5*Math.PI&&(p=-p),h+=p)}}return h}function Cn(t,e,i,n,o){for(var a=0,r=0,s=0,l=0,u=0,h=0;h1&&(i||(a+=Sn(r,s,l,u,n,o))),1===h&&(l=r=t[h],u=s=t[h+1]),c){case BS.M:r=l=t[h++],s=u=t[h++];break;case BS.L:if(i){if(yn(r,s,t[h],t[h+1],e,n,o))return!0}else a+=Sn(r,s,t[h],t[h+1],n,o)||0;r=t[h++],s=t[h++];break;case BS.C:if(i){if(xn(r,s,t[h++],t[h++],t[h++],t[h++],t[h],t[h+1],e,n,o))return!0}else a+=Tn(r,s,t[h++],t[h++],t[h++],t[h++],t[h],t[h+1],n,o)||0;r=t[h++],s=t[h++];break;case BS.Q:if(i){if(_n(r,s,t[h++],t[h++],t[h],t[h+1],e,n,o))return!0}else a+=An(r,s,t[h++],t[h++],t[h],t[h+1],n,o)||0;r=t[h++],s=t[h++];break;case BS.A:var d=t[h++],f=t[h++],p=t[h++],g=t[h++],m=t[h++],v=t[h++];h+=1;var y=1-t[h++],x=Math.cos(m)*p+d,_=Math.sin(m)*g+f;h>1?a+=Sn(r,s,x,_,n,o):(l=x,u=_);var w=(n-d)*g/p+d;if(i){if(bn(d,f,g,m,m+v,y,e,w,o))return!0}else a+=Dn(d,f,g,m,m+v,y,w,o);r=Math.cos(m+v)*p+d,s=Math.sin(m+v)*g+f;break;case BS.R:l=r=t[h++],u=s=t[h++];var x=l+t[h++],_=u+t[h++];if(i){if(yn(l,u,x,u,e,n,o)||yn(x,u,x,_,e,n,o)||yn(x,_,l,_,e,n,o)||yn(l,_,l,u,e,n,o))return!0}else a+=Sn(x,u,x,_,n,o),a+=Sn(l,_,l,u,n,o);break;case BS.Z:if(i){if(yn(r,s,l,u,e,n,o))return!0}else a+=Sn(r,s,l,u,n,o);r=l,s=u}}return i||Mn(s,u)||(a+=Sn(r,s,l,u,n,o)||0),0!==a}function Ln(t,e,i){return Cn(t,0,!1,e,i)}function kn(t,e,i,n){return Cn(t,e,!0,i,n)}function Pn(t){di.call(this,t),this.path=null}function Nn(t,e,i,n,o,a,r,s,l,u,h){var c=l*(tM/180),d=QS(c)*(t-i)/2+JS(c)*(e-n)/2,f=-1*JS(c)*(t-i)/2+QS(c)*(e-n)/2,p=d*d/(r*r)+f*f/(s*s);p>1&&(r*=$S(p),s*=$S(p));var g=(o===a?-1:1)*$S((r*r*(s*s)-r*r*(f*f)-s*s*(d*d))/(r*r*(f*f)+s*s*(d*d)))||0,m=g*r*f/s,v=g*-s*d/r,y=(t+i)/2+QS(c)*m-JS(c)*v,x=(e+n)/2+JS(c)*m+QS(c)*v,_=nM([1,0],[(d-m)/r,(f-v)/s]),w=[(d-m)/r,(f-v)/s],b=[(-1*d-m)/r,(-1*f-v)/s],S=nM(w,b);iM(w,b)<=-1&&(S=tM),iM(w,b)>=1&&(S=0),0===a&&S>0&&(S-=2*tM),1===a&&S<0&&(S+=2*tM),h.addData(u,y,x,r,s,_,S,c,a)}function On(t){if(!t)return new ES;for(var e,i=0,n=0,o=i,a=n,r=new ES,s=ES.CMD,l=t.match(oM),u=0;u=2){if(o&&"spline"!==o){var a=fM(n,o,i,e.smoothConstraint);t.moveTo(n[0][0],n[0][1]);for(var r=n.length,s=0;s<(i?r:r-1);s++){var l=a[2*s],u=a[2*s+1],h=n[(s+1)%r];t.bezierCurveTo(l[0],l[1],u[0],u[1],h[0],h[1])}}else{"spline"===o&&(n=dM(n,i)),t.moveTo(n[0][0],n[0][1]);for(var s=1,c=n.length;s=0)?(i={textFill:null,textStroke:t.textStroke,textStrokeWidth:t.textStrokeWidth},t.textFill="#fff",null==t.textStroke&&(t.textStroke=a,null==t.textStrokeWidth&&(t.textStrokeWidth=2))):null!=a&&(i={textFill:null},t.textFill=a),i&&(t.insideRollback=i)}}function bo(t){var e=t.insideRollback;e&&(t.textFill=e.textFill,t.textStroke=e.textStroke,t.textStrokeWidth=e.textStrokeWidth,t.insideRollback=null)}function So(t,e){var i=e||e.getModel("textStyle");return P([t.fontStyle||i&&i.getShallow("fontStyle")||"",t.fontWeight||i&&i.getShallow("fontWeight")||"",(t.fontSize||i&&i.getShallow("fontSize")||12)+"px",t.fontFamily||i&&i.getShallow("fontFamily")||"sans-serif"].join(" "))}function Mo(t,e,i,n,o,a){if("function"==typeof o&&(a=o,o=null),n&&n.isAnimationEnabled()){var r=t?"Update":"",s=n.getShallow("animationDuration"+r),l=n.getShallow("animationEasing"+r),u=n.getShallow("animationDelay"+r);"function"==typeof u&&(u=u(o,n.getAnimationDelayParams?n.getAnimationDelayParams(e,o):null)),"function"==typeof s&&(s=s(o)),s>0?e.animateTo(i,s,u||0,l,a,!!a):(e.stopAnimation(),e.attr(i),a&&a())}else e.stopAnimation(),e.attr(i),a&&a()}function Io(t,e,i,n,o){Mo(!0,t,e,i,n,o)}function To(t,e,i,n,o){Mo(!1,t,e,i,n,o)}function Ao(t,e){for(var i=_t([]);t&&t!==e;)bt(i,t.getLocalTransform(),i),t=t.parent;return i}function Do(t,e,i){return e&&!c(e)&&(e=Tw.getLocalTransform(e)),i&&(e=Tt([],e)),Q([],t,e)}function Co(t,e,i){var n=0===e[4]||0===e[5]||0===e[0]?1:Math.abs(2*e[4]/e[0]),o=0===e[4]||0===e[5]||0===e[2]?1:Math.abs(2*e[4]/e[2]),a=["left"===t?-n:"right"===t?n:0,"top"===t?-o:"bottom"===t?o:0];return a=Do(a,e,i),Math.abs(a[0])>Math.abs(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function Lo(t,e,i,n){function o(t){var e={position:F(t.position),rotation:t.rotation};return t.shape&&(e.shape=a({},t.shape)),e}if(t&&e){var r=function(t){var e={};return t.traverse(function(t){!t.isGroup&&t.anid&&(e[t.anid]=t)}),e}(t);e.traverse(function(t){if(!t.isGroup&&t.anid){var e=r[t.anid];if(e){var n=o(t);t.attr(o(e)),Io(t,n,i,t.dataIndex)}}})}}function ko(t,e){return f(t,function(t){var i=t[0];i=LM(i,e.x),i=kM(i,e.x+e.width);var n=t[1];return n=LM(n,e.y),n=kM(n,e.y+e.height),[i,n]})}function Po(t,e,i){var n=(e=a({rectHover:!0},e)).style={strokeNoScale:!0};if(i=i||{x:-1,y:-1,width:2,height:2},t)return 0===t.indexOf("image://")?(n.image=t.slice(8),r(n,i),new fi(e)):Xn(t.replace("path://",""),e,i,"center")}function No(t,e,i){this.parentModel=e,this.ecModel=i,this.option=t}function Oo(t,e,i){for(var n=0;n0){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]}else{if(t===e[0])return i[0];if(t===e[1])return i[1]}return(t-e[0])/o*a+i[0]}function Vo(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?zo(t).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):null==t?NaN:+t}function Go(t,e,i){return null==e&&(e=10),e=Math.min(Math.max(0,e),20),t=(+t).toFixed(e),i?t:+t}function Fo(t){return t.sort(function(t,e){return t-e}),t}function Wo(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 Ho(t){var e=t.toString(),i=e.indexOf("e");if(i>0){var n=+e.slice(i+1);return n<0?-n:0}var o=e.indexOf(".");return o<0?0:e.length-1-o}function Zo(t,e){var i=Math.log,n=Math.LN10,o=Math.floor(i(t[1]-t[0])/n),a=Math.round(i(Math.abs(e[1]-e[0]))/n),r=Math.min(Math.max(-o+a,0),20);return isFinite(r)?r:20}function Uo(t,e,i){if(!t[e])return 0;var n=p(t,function(t,e){return t+(isNaN(e)?0:e)},0);if(0===n)return 0;for(var o=Math.pow(10,i),a=f(t,function(t){return(isNaN(t)?0:t)/n*o*100}),r=100*o,s=f(a,function(t){return Math.floor(t)}),l=p(s,function(t,e){return t+e},0),u=f(a,function(t,e){return t-s[e]});lh&&(h=u[d],c=d);++s[c],u[c]=0,++l}return s[e]/o}function Xo(t){var e=2*Math.PI;return(t%e+e)%e}function jo(t){return t>-UM&&t=-20?+t.toFixed(n<0?-n:0):t}function Jo(t){function e(t,i,n){return t.interval[n]=0}function ta(t){return isNaN(t)?"-":(t=(t+"").split("."))[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")}function ea(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,function(t,e){return e.toUpperCase()}),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t}function ia(t){return null==t?"":(t+"").replace(KM,function(t,e){return $M[e]})}function na(t,e,i){y(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 ra(t,e){return t+="","0000".substr(0,e-t.length)+t}function sa(t,e,i){"week"!==t&&"month"!==t&&"quarter"!==t&&"half-year"!==t&&"year"!==t||(t="MM-dd\nyyyy");var n=Yo(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",ra(r,2)).replace("M",r).replace("yyyy",a).replace("yy",a%100).replace("dd",ra(s,2)).replace("d",s).replace("hh",ra(l,2)).replace("h",l).replace("mm",ra(u,2)).replace("m",u).replace("ss",ra(h,2)).replace("s",h).replace("SSS",ra(c,3))}function la(t){return t?t.charAt(0).toUpperCase()+t.substr(1):t}function ua(t,e,i,n,o){var a=0,r=0;null==n&&(n=1/0),null==o&&(o=1/0);var s=0;e.eachChild(function(l,u){var h,c,d=l.position,f=l.getBoundingRect(),p=e.childAt(u+1),g=p&&p.getBoundingRect();if("horizontal"===t){var m=f.width+(g?-g.x+f.x:0);(h=a+m)>n||l.newline?(a=0,h=m,r+=s+i,s=f.height):s=Math.max(s,f.height)}else{var v=f.height+(g?-g.y+f.y:0);(c=r+v)>o||l.newline?(a+=s+i,r=0,c=v,s=f.width):s=Math.max(s,f.width)}l.newline||(d[0]=a,d[1]=r,"horizontal"===t?a=h+i:r=c+i)})}function ha(t,e,i){var n=e.width,o=e.height,a=Vo(t.x,n),r=Vo(t.y,o),s=Vo(t.x2,n),l=Vo(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=qM(i||0),{width:Math.max(s-a-i[1]-i[3],0),height:Math.max(l-r-i[0]-i[2],0)}}function ca(t,e,i){i=qM(i||0);var n=e.width,o=e.height,a=Vo(t.left,n),r=Vo(t.top,o),s=Vo(t.right,n),l=Vo(t.bottom,o),u=Vo(t.width,n),h=Vo(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)&&(f>n/o?u=.8*n:h=.8*o),isNaN(u)&&(u=f*h),isNaN(h)&&(h=u/f)),isNaN(a)&&(a=n-s-u-d),isNaN(r)&&(r=o-l-h-c),t.left||t.right){case"center":a=n/2-u/2-i[3];break;case"right":a=n-u-d}switch(t.top||t.bottom){case"middle":case"center":r=o/2-h/2-i[0];break;case"bottom":r=o-h-c}a=a||0,r=r||0,isNaN(u)&&(u=n-d-a-(s||0)),isNaN(h)&&(h=o-c-r-(l||0));var p=new de(a+i[3],r+i[0],u,h);return p.margin=i,p}function da(t,e,i,n,o){var a=!o||!o.hv||o.hv[0],s=!o||!o.hv||o.hv[1],l=o&&o.boundingMode||"all";if(a||s){var u;if("raw"===l)u="group"===t.type?new de(0,0,+e.width||0,+e.height||0):t.getBoundingRect();else if(u=t.getBoundingRect(),t.needLocalTransform()){var h=t.getLocalTransform();(u=u.clone()).applyTransform(h)}e=ca(r({width:u.width,height:u.height},e),i,n);var c=t.position,d=a?e.x-u.x:0,f=s?e.y-u.y:0;t.attr("position","raw"===l?[d,f]:[c[0]+d,c[1]+f])}}function fa(t,e){return null!=t[oI[e][0]]||null!=t[oI[e][1]]&&null!=t[oI[e][2]]}function pa(t,e,i){function n(i,n){var r={},l=0,u={},h=0;if(iI(i,function(e){u[e]=t[e]}),iI(i,function(t){o(e,t)&&(r[t]=u[t]=e[t]),a(r,t)&&l++,a(u,t)&&h++}),s[n])return a(e,i[1])?u[i[2]]=null:a(e,i[2])&&(u[i[1]]=null),u;if(2!==h&&l){if(l>=2)return r;for(var c=0;ce)return t[n];return t[i-1]}function ya(t){var e=t.get("coordinateSystem"),i={coordSysName:e,coordSysDims:[],axisMap:R(),categoryAxisMap:R()},n=fI[e];if(n)return n(t,i,i.axisMap,i.categoryAxisMap),i}function xa(t){return"category"===t.get("type")}function _a(t){this.fromDataset=t.fromDataset,this.data=t.data||(t.sourceFormat===vI?{}:[]),this.sourceFormat=t.sourceFormat||yI,this.seriesLayoutBy=t.seriesLayoutBy||_I,this.dimensionsDefine=t.dimensionsDefine,this.encodeDefine=t.encodeDefine&&R(t.encodeDefine),this.startIndex=t.startIndex||0,this.dimensionsDetectCount=t.dimensionsDetectCount}function wa(t){var e=t.option.source,i=yI;if(S(e))i=xI;else if(y(e)){0===e.length&&(i=gI);for(var n=0,o=e.length;n=e:"max"===i?t<=e:t===e}function Xa(t,e){return t.join(",")===e.join(",")}function ja(t,e){AI(e=e||{},function(e,i){if(null!=e){var n=t[i];if(lI.hasClass(i)){e=Di(e);var o=Pi(n=Di(n),e);t[i]=CI(o,function(t){return t.option&&t.exist?LI(t.exist,t.option,!0):t.exist||t.option})}else t[i]=LI(n,e,!0)}})}function Ya(t){var e=t&&t.itemStyle;if(e)for(var i=0,o=OI.length;i=0;p--){var g=t[p];if(s||(d=g.data.rawIndexOf(g.stackedByDimension,c)),d>=0){var m=g.data.getByRawIndex(g.stackResultDimension,d);if(h>=0&&m>0||h<=0&&m<0){h+=m,f=m;break}}}return n[0]=h,n[1]=f,n});r.hostModel.setData(l),e.data=l})}function rr(t,e){_a.isInstance(t)||(t=_a.seriesDataToSource(t)),this._source=t;var i=this._data=t.data,n=t.sourceFormat;n===xI&&(this._offset=0,this._dimSize=e,this._data=i),a(this,GI[n===gI?n+"_"+t.seriesLayoutBy:n])}function sr(){return this._data.length}function lr(t){return this._data[t]}function ur(t){for(var e=0;ee.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function Mr(t,e){d(t.CHANGABLE_METHODS,function(i){t.wrapMethod(i,v(Ir,e))})}function Ir(t){var e=Tr(t);e&&e.setOutputEnd(this.count())}function Tr(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}}function Ar(){this.group=new tb,this.uid=Ro("viewChart"),this.renderTask=gr({plan:Lr,reset:kr}),this.renderTask.context={view:this}}function Dr(t,e){if(t&&(t.trigger(e),"group"===t.type))for(var i=0;i=0?n():c=setTimeout(n,-a),u=o};return d.clear=function(){c&&(clearTimeout(c),c=null)},d.debounceNextCall=function(t){l=t},d}function Nr(t,e,i,n){var o=t[e];if(o){var a=o[iT]||o,r=o[oT];if(o[nT]!==i||r!==n){if(null==i||!n)return t[e]=a;(o=t[e]=Pr(a,i,"debounce"===n))[iT]=a,o[oT]=n,o[nT]=i}return o}}function Or(t,e){var i=t[e];i&&i[iT]&&(t[e]=i[iT])}function Er(t,e,i,n){this.ecInstance=t,this.api=e,this.unfinished;var i=this._dataProcessorHandlers=i.slice(),n=this._visualHandlers=n.slice();this._allHandlers=i.concat(n),this._stageTaskMap=R()}function Rr(t,e,i,n,o){function a(t,e){return t.setDirty&&(!t.dirtyMap||t.dirtyMap.get(e.__pipeline.id))}o=o||{};var r;d(e,function(e,s){if(!o.visualType||o.visualType===e.visualType){var l=t._stageTaskMap.get(e.uid),u=l.seriesTaskMap,h=l.overallTask;if(h){var c,d=h.agentStubMap;d.each(function(t){a(o,t)&&(t.dirty(),c=!0)}),c&&h.dirty(),hT(h,n);var f=t.getPerformArgs(h,o.block);d.each(function(t){t.perform(f)}),r|=h.perform(f)}else u&&u.each(function(s,l){a(o,s)&&s.dirty();var u=t.getPerformArgs(s,o.block);u.skip=!e.performRawSeries&&i.isSeriesFiltered(s.context.model),hT(s,n),r|=s.perform(u)})}}),t.unfinished|=r}function zr(t,e,i,n,o){function a(i){var a=i.uid,s=r.get(a)||r.set(a,gr({plan:Hr,reset:Zr,count:Xr}));s.context={model:i,ecModel:n,api:o,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:t},jr(t,i,s)}var r=i.seriesTaskMap||(i.seriesTaskMap=R()),s=e.seriesType,l=e.getTargetSeries;e.createOnAllSeries?n.eachRawSeries(a):s?n.eachRawSeriesByType(s,a):l&&l(n,o).each(a);var u=t._pipelineMap;r.each(function(t,e){u.get(e)||(t.dispose(),r.removeKey(e))})}function Br(t,e,i,n,o){function a(e){var i=e.uid,n=s.get(i);n||(n=s.set(i,gr({reset:Gr,onDirty:Wr})),r.dirty()),n.context={model:e,overallProgress:h,modifyOutputEnd:c},n.agent=r,n.__block=h,jr(t,e,n)}var r=i.overallTask=i.overallTask||gr({reset:Vr});r.context={ecModel:n,api:o,overallReset:e.overallReset,scheduler:t};var s=r.agentStubMap=r.agentStubMap||R(),l=e.seriesType,u=e.getTargetSeries,h=!0,c=e.modifyOutputEnd;l?n.eachRawSeriesByType(l,a):u?u(n,o).each(a):(h=!1,d(n.getSeries(),a));var f=t._pipelineMap;s.each(function(t,e){f.get(e)||(t.dispose(),r.dirty(),s.removeKey(e))})}function Vr(t){t.overallReset(t.ecModel,t.api,t.payload)}function Gr(t,e){return t.overallProgress&&Fr}function Fr(){this.agent.dirty(),this.getDownstream().dirty()}function Wr(){this.agent&&this.agent.dirty()}function Hr(t){return t.plan&&t.plan(t.model,t.ecModel,t.api,t.payload)}function Zr(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=Di(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?f(e,function(t,e){return Ur(e)}):cT}function Ur(t){return function(e,i){var n=i.data,o=i.resetDefines[t];if(o&&o.dataEach)for(var a=e.start;a0?parseInt(n,10)/100:n?parseFloat(n):0;var o=i.getAttribute("stop-color")||"#000000";e.addColorStop(n,o)}i=i.nextSibling}}function Qr(t,e){t&&t.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),r(e.__inheritedStyle,t.__inheritedStyle))}function ts(t){for(var e=P(t).split(_T),i=[],n=0;n0;a-=2){var r=o[a],s=o[a-1];switch(n=n||xt(),s){case"translate":r=P(r).split(_T),St(n,n,[parseFloat(r[0]),parseFloat(r[1]||0)]);break;case"scale":r=P(r).split(_T),It(n,n,[parseFloat(r[0]),parseFloat(r[1]||r[0])]);break;case"rotate":r=P(r).split(_T),Mt(n,n,parseFloat(r[0]));break;case"skew":r=P(r).split(_T),console.warn("Skew transform is not supported yet");break;case"matrix":r=P(r).split(_T);n[0]=parseFloat(r[0]),n[1]=parseFloat(r[1]),n[2]=parseFloat(r[2]),n[3]=parseFloat(r[3]),n[4]=parseFloat(r[4]),n[5]=parseFloat(r[5])}}e.setLocalTransform(n)}}function os(t){var e=t.getAttribute("style"),i={};if(!e)return i;var n={};TT.lastIndex=0;for(var o;null!=(o=TT.exec(e));)n[o[1]]=o[2];for(var a in ST)ST.hasOwnProperty(a)&&null!=n[a]&&(i[ST[a]]=n[a]);return i}function as(t,e,i){var n=e/t.width,o=i/t.height,a=Math.min(n,o);return{scale:[a,a],position:[-(t.x+t.width/2)*a+e/2,-(t.y+t.height/2)*a+i/2]}}function rs(t,e){return(new $r).parse(t,e)}function ss(t){return function(e,i,n){e=e&&e.toLowerCase(),fw.prototype[t].call(this,e,i,n)}}function ls(){fw.call(this)}function us(t,e,n){function o(t,e){return t.__prio-e.__prio}n=n||{},"string"==typeof e&&(e=JT[e]),this.id,this.group,this._dom=t;var a=this._zr=Ii(t,{renderer:n.renderer||"canvas",devicePixelRatio:n.devicePixelRatio,width:n.width,height:n.height});this._throttledZrFlush=Pr(m(a.flush,a),17),(e=i(e))&&BI(e,!0),this._theme=e,this._chartsViews=[],this._chartsMap={},this._componentsViews=[],this._componentsMap={},this._coordSysMgr=new Fa;var r=this._api=As(this);_e($T,o),_e(YT,o),this._scheduler=new Er(this,r,YT,$T),fw.call(this,this._ecEventProcessor=new Ds),this._messageCenter=new ls,this._initEvents(),this.resize=m(this.resize,this),this._pendingActions=[],a.animation.on("frame",this._onframe,this),vs(a,this),N(this)}function hs(t,e,i){var n,o=this._model,a=this._coordSysMgr.getCoordinateSystems();e=Vi(o,e);for(var r=0;re.get("hoverLayerThreshold")&&!U_.node&&i.traverse(function(t){t.isGroup||(t.useHoverLayer=!0)})}function Is(t,e){var i=t.get("blendMode")||null;e.group.traverse(function(t){t.isGroup||t.style.blend!==i&&t.setStyle("blend",i),t.eachPendingDisplayable&&t.eachPendingDisplayable(function(t){t.setStyle("blend",i)})})}function Ts(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 As(t){var e=t._coordSysMgr;return a(new Ga(t),{getCoordinateSystems:m(e.getCoordinateSystems,e),getComponentByElement:function(e){for(;e;){var i=e.__ecComponentInfo;if(null!=i)return t._model.getComponent(i.mainType,i.index);e=e.parent}}})}function Ds(){this.eventInfo}function Cs(t){function e(t,e){for(var n=0;n65535?dA:pA}function Js(t){var e=t.constructor;return e===Array?t.slice():new e(t)}function Qs(t,e){d(gA.concat(e.__wrappedMethods||[]),function(i){e.hasOwnProperty(i)&&(t[i]=e[i])}),t.__wrappedMethods=e.__wrappedMethods,d(mA,function(n){t[n]=i(e[n])}),t._calculationInfo=a(e._calculationInfo)}function tl(t,e,i,n,o){var a=cA[e.type],r=n-1,s=e.name,l=t[s][r];if(l&&l.length=0?this._indices[t]:-1}function al(t,e){var i=t._idList[e];return null==i&&(i=il(t,t._idDimIdx,e)),null==i&&(i=hA+e),i}function rl(t){return y(t)||(t=[t]),t}function sl(t,e){var i=t.dimensions,n=new vA(f(i,t.getDimensionInfo,t),t.hostModel);Qs(n,t);for(var o=n._storage={},a=t._storage,r=0;r=0?(o[s]=ll(a[s]),n._rawExtent[s]=ul(),n._extent[s]=null):o[s]=a[s])}return n}function ll(t){for(var e=new Array(t.length),i=0;in&&(r=o.interval=n);var s=o.intervalPrecision=Ml(r);return Tl(o.niceTickExtent=[MA(Math.ceil(t[0]/r)*r,s),MA(Math.floor(t[1]/r)*r,s)],t),o}function Ml(t){return Ho(t)+2}function Il(t,e,i){t[e]=Math.max(Math.min(t[e],i[1]),i[0])}function Tl(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),Il(t,0,e),Il(t,1,e),t[0]>t[1]&&(t[0]=t[1])}function Al(t,e,i,n){var o=[];if(!t)return o;e[0]1e4)return[];return e[1]>(o.length?o[o.length-1]:i[1])&&o.push(e[1]),o}function Dl(t){return t.get("stack")||AA+t.seriesIndex}function Cl(t){return t.dim+t.index}function Ll(t){var e=[],i=t.axis;if("category"===i.type){for(var n=i.getBandWidth(),o=0;o=0?"p":"n",b=m;p&&(o[r][_]||(o[r][_]={p:m,n:m}),b=o[r][_][w]);var S,M,I,T;if(g)S=b,M=(A=i.dataToPoint([x,_]))[1]+l,I=A[0]-m,T=u,Math.abs(I)a[1]?(n=a[1],o=a[0]):(n=a[0],o=a[1]);var r=e.toGlobalCoord(e.dataToCoord(0));return ro&&(r=o),r}function Vl(t,e){return VA(t,BA(e))}function Gl(t,e){var i,n,o,a=t.type,r=e.getMin(),s=e.getMax(),l=null!=r,u=null!=s,h=t.getExtent();"ordinal"===a?i=e.getCategories().length:(y(n=e.get("boundaryGap"))||(n=[n||0,n||0]),"boolean"==typeof n[0]&&(n=[0,0]),n[0]=Vo(n[0],1),n[1]=Vo(n[1],1),o=h[1]-h[0]||Math.abs(h[0])),null==r&&(r="ordinal"===a?i?0:NaN:h[0]-n[0]*o),null==s&&(s="ordinal"===a?i?i-1:NaN:h[1]+n[1]*o),"dataMin"===r?r=h[0]:"function"==typeof r&&(r=r({min:h[0],max:h[1]})),"dataMax"===s?s=h[1]:"function"==typeof s&&(s=s({min:h[0],max:h[1]})),(null==r||!isFinite(r))&&(r=NaN),(null==s||!isFinite(s))&&(s=NaN),t.setBlank(I(r)||I(s)||"ordinal"===a&&!t.getOrdinalMeta().categories.length),e.getNeedCrossZero()&&(r>0&&s>0&&!l&&(r=0),r<0&&s<0&&!u&&(s=0));var c=e.ecModel;if(c&&"time"===a){var f,p=kl("bar",c);if(d(p,function(t){f|=t.getBaseAxis()===e.axis}),f){var g=Pl(p),m=Fl(r,s,e,g);r=m.min,s=m.max}}return[r,s]}function Fl(t,e,i,n){var o=i.axis.getExtent(),a=o[1]-o[0],r=Ol(n,i.axis);if(void 0===r)return{min:t,max:e};var s=1/0;d(r,function(t){s=Math.min(t.offset,s)});var l=-1/0;d(r,function(t){l=Math.max(t.offset+t.width,l)}),s=Math.abs(s),l=Math.abs(l);var u=s+l,h=e-t,c=h/(1-(s+l)/a)-h;return e+=c*(l/u),t-=c*(s/u),{min:t,max:e}}function Wl(t,e){var i=Gl(t,e),n=null!=e.getMin(),o=null!=e.getMax(),a=e.get("splitNumber");"log"===t.type&&(t.base=e.get("logBase"));var r=t.type;t.setExtent(i[0],i[1]),t.niceExtent({splitNumber:a,fixMin:n,fixMax:o,minInterval:"interval"===r||"time"===r?e.get("minInterval"):null,maxInterval:"interval"===r||"time"===r?e.get("maxInterval"):null});var s=e.get("interval");null!=s&&t.setInterval&&t.setInterval(s)}function Hl(t,e){if(e=e||t.get("type"))switch(e){case"category":return new SA(t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),[1/0,-1/0]);case"value":return new TA;default:return(xl.getClass(e)||TA).create(t)}}function Zl(t){var e=t.scale.getExtent(),i=e[0],n=e[1];return!(i>0&&n>0||i<0&&n<0)}function Ul(t){var e=t.getLabelModel().get("formatter"),i="category"===t.type?t.scale.getExtent()[0]:null;return"string"==typeof e?e=function(e){return function(i){return i=t.scale.getLabel(i),e.replace("{value}",null!=i?i:"")}}(e):"function"==typeof e?function(n,o){return null!=i&&(o=n-i),e(Xl(t,n),o)}:function(e){return t.scale.getLabel(e)}}function Xl(t,e){return"category"===t.type?t.scale.getLabel(e):e}function jl(t){var e=t.model,i=t.scale;if(e.get("axisLabel.show")&&!i.isBlank()){var n,o,a="category"===t.type,r=i.getExtent();o=a?i.count():(n=i.getTicks()).length;var s,l=t.getLabelModel(),u=Ul(t),h=1;o>40&&(h=Math.ceil(o/40));for(var c=0;c>1^-(1&s),l=l>>1^-(1&l),o=s+=o,a=l+=a,n.push([s/i,l/i])}return n}function ou(t){return"category"===t.type?ru(t):uu(t)}function au(t,e){return"category"===t.type?lu(t,e):{ticks:t.scale.getTicks()}}function ru(t){var e=t.getLabelModel(),i=su(t,e);return!e.get("show")||t.scale.isBlank()?{labels:[],labelCategoryInterval:i.labelCategoryInterval}:i}function su(t,e){var i=hu(t,"labels"),n=ql(e),o=cu(i,n);if(o)return o;var a,r;return a=x(n)?vu(t,n):mu(t,r="auto"===n?fu(t):n),du(i,n,{labels:a,labelCategoryInterval:r})}function lu(t,e){var i=hu(t,"ticks"),n=ql(e),o=cu(i,n);if(o)return o;var a,r;if(e.get("show")&&!t.scale.isBlank()||(a=[]),x(n))a=vu(t,n,!0);else if("auto"===n){var s=su(t,t.getLabelModel());r=s.labelCategoryInterval,a=f(s.labels,function(t){return t.tickValue})}else a=mu(t,r=n,!0);return du(i,n,{ticks:a,tickCategoryInterval:r})}function uu(t){var e=t.scale.getTicks(),i=Ul(t);return{labels:f(e,function(e,n){return{formattedLabel:i(e,n),rawLabel:t.scale.getLabel(e),tickValue:e}})}}function hu(t,e){return nD(t)[e]||(nD(t)[e]=[])}function cu(t,e){for(var i=0;i40&&(s=Math.max(1,Math.floor(r/40)));for(var l=a[0],u=t.dataToCoord(l+1)-t.dataToCoord(l),h=Math.abs(u*Math.cos(n)),c=Math.abs(u*Math.sin(n)),d=0,f=0;l<=a[1];l+=s){var p=0,g=0,m=ke(i(l),e.font,"center","top");p=1.3*m.width,g=1.3*m.height,d=Math.max(d,p,7),f=Math.max(f,g,7)}var v=d/h,y=f/c;isNaN(v)&&(v=1/0),isNaN(y)&&(y=1/0);var x=Math.max(0,Math.floor(Math.min(v,y))),_=nD(t.model),w=_.lastAutoInterval,b=_.lastTickCount;return null!=w&&null!=b&&Math.abs(w-x)<=1&&Math.abs(b-r)<=1&&w>x?x=w:(_.lastTickCount=r,_.lastAutoInterval=x),x}function gu(t){var e=t.getLabelModel();return{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}function mu(t,e,i){function n(t){l.push(i?t:{formattedLabel:o(t),rawLabel:a.getLabel(t),tickValue:t})}var o=Ul(t),a=t.scale,r=a.getExtent(),s=t.getLabelModel(),l=[],u=Math.max((e||0)+1,1),h=r[0],c=a.count();0!==h&&u>1&&c/u>2&&(h=Math.round(Math.ceil(h/u)*u));var d=Kl(t),f=s.get("showMinLabel")||d,p=s.get("showMaxLabel")||d;f&&h!==r[0]&&n(r[0]);for(var g=h;g<=r[1];g+=u)n(g);return p&&g!==r[1]&&n(r[1]),l}function vu(t,e,i){var n=t.scale,o=Ul(t),a=[];return d(n.getTicks(),function(t){var r=n.getLabel(t);e(t,r)&&a.push(i?t:{formattedLabel:o(t),rawLabel:r,tickValue:t})}),a}function yu(t,e){var i=(t[1]-t[0])/e/2;t[0]+=i,t[1]-=i}function xu(t,e,i,n,o){function a(t,e){return h?t>e:t0&&(t.coord-=u/(2*(e+1)))}),s={coord:e[r-1].coord+u},e.push(s)}var h=l[0]>l[1];a(e[0].coord,l[0])&&(o?e[0].coord=l[0]:e.shift()),o&&a(l[0],e[0].coord)&&e.unshift({coord:l[0]}),a(l[1],s.coord)&&(o?s.coord=l[1]:e.pop()),o&&a(s.coord,l[1])&&e.push({coord:l[1]})}}function _u(t,e){var i=t.mapDimension("defaultedLabel",!0),n=i.length;if(1===n)return fr(t,e,i[0]);if(n){for(var o=[],a=0;a0?i=n[0]:n[1]<0&&(i=n[1]),i}function Ou(t,e,i,n){var o=NaN;t.stacked&&(o=i.get(i.getCalculationInfo("stackedOverDimension"),n)),isNaN(o)&&(o=t.valueStart);var a=t.baseDataOffset,r=[];return r[a]=i.get(t.baseDim,n),r[1-a]=o,e.dataToPoint(r)}function Eu(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}function Ru(t){return isNaN(t[0])||isNaN(t[1])}function zu(t,e,i,n,o,a,r,s,l,u,h){return"none"!==u&&u?Bu.apply(this,arguments):Vu.apply(this,arguments)}function Bu(t,e,i,n,o,a,r,s,l,u,h){for(var c=0,d=i,f=0;f=o||d<0)break;if(Ru(p)){if(h){d+=a;continue}break}if(d===i)t[a>0?"moveTo":"lineTo"](p[0],p[1]);else if(l>0){var g=e[c],m="y"===u?1:0,v=(p[m]-g[m])*l;_D(bD,g),bD[m]=g[m]+v,_D(SD,p),SD[m]=p[m]-v,t.bezierCurveTo(bD[0],bD[1],SD[0],SD[1],p[0],p[1])}else t.lineTo(p[0],p[1]);c=d,d+=a}return f}function Vu(t,e,i,n,o,a,r,s,l,u,h){for(var c=0,d=i,f=0;f=o||d<0)break;if(Ru(p)){if(h){d+=a;continue}break}if(d===i)t[a>0?"moveTo":"lineTo"](p[0],p[1]),_D(bD,p);else if(l>0){var g=d+a,m=e[g];if(h)for(;m&&Ru(e[g]);)m=e[g+=a];var v=.5,y=e[c];if(!(m=e[g])||Ru(m))_D(SD,p);else{Ru(m)&&!h&&(m=p),U(wD,m,y);var x,_;if("x"===u||"y"===u){var w="x"===u?0:1;x=Math.abs(p[w]-y[w]),_=Math.abs(p[w]-m[w])}else x=uw(p,y),_=uw(p,m);xD(SD,p,wD,-l*(1-(v=_/(_+x))))}vD(bD,bD,s),yD(bD,bD,r),vD(SD,SD,s),yD(SD,SD,r),t.bezierCurveTo(bD[0],bD[1],SD[0],SD[1],p[0],p[1]),xD(bD,p,wD,l*v)}else t.lineTo(p[0],p[1]);c=d,d+=a}return f}function Gu(t,e){var i=[1/0,1/0],n=[-1/0,-1/0];if(e)for(var o=0;on[0]&&(n[0]=a[0]),a[1]>n[1]&&(n[1]=a[1])}return{min:e?i:n,max:e?n:i}}function Fu(t,e){if(t.length===e.length){for(var i=0;ie[0]?1:-1;e[0]+=n*i,e[1]-=n*i}return e}function Zu(t,e,i){if(!i.valueDim)return[];for(var n=[],o=0,a=e.count();oa[1]&&a.reverse();var r=o.getExtent(),s=Math.PI/180;i&&(a[0]-=.5,a[1]+=.5);var l=new hM({shape:{cx:Go(t.cx,1),cy:Go(t.cy,1),r0:Go(a[0],1),r:Go(a[1],1),startAngle:-r[0]*s,endAngle:-r[1]*s,clockwise:o.inverse}});return e&&(l.shape.endAngle=-r[0]*s,To(l,{shape:{endAngle:-r[1]*s}},n)),l}function ju(t,e,i,n){return"polar"===t.type?Xu(t,e,i,n):Uu(t,e,i,n)}function Yu(t,e,i){for(var n=e.getBaseAxis(),o="x"===n.dim||"radius"===n.dim?0:1,a=[],r=0;r=0;a--){var r=i[a].dimension,s=t.dimensions[r],l=t.getDimensionInfo(s);if("x"===(n=l&&l.coordDim)||"y"===n){o=i[a];break}}if(o){var u=e.getAxis(n),h=f(o.stops,function(t){return{coord:u.toGlobalCoord(u.dataToCoord(t.value)),color:t.color}}),c=h.length,p=o.outerColors.slice();c&&h[0].coord>h[c-1].coord&&(h.reverse(),p.reverse());var g=h[0].coord-10,m=h[c-1].coord+10,v=m-g;if(v<.001)return"transparent";d(h,function(t){t.offset=(t.coord-g)/v}),h.push({offset:c?h[c-1].offset:.5,color:p[1]||"transparent"}),h.unshift({offset:c?h[0].offset:.5,color:p[0]||"transparent"});var y=new TM(0,0,0,0,h,!0);return y[n]=g,y[n+"2"]=m,y}}}function Ku(t,e,i){var n=t.get("showAllSymbol"),o="auto"===n;if(!n||o){var a=i.getAxesByScale("ordinal")[0];if(a&&(!o||!$u(a,e))){var r=e.mapDimension(a.dim),s={};return d(a.getViewLabels(),function(t){s[t.tickValue]=1}),function(t){return!s.hasOwnProperty(e.get(r,t))}}}}function $u(t,e){var i=t.getExtent(),n=Math.abs(i[1]-i[0])/t.scale.count();isNaN(n)&&(n=0);for(var o=e.count(),a=Math.max(1,Math.round(o/5)),r=0;rn)return!1;return!0}function Ju(t){return this._axes[t]}function Qu(t){LD.call(this,t)}function th(t,e){return e.type||(e.data?"category":"value")}function eh(t,e,i){return t.getCoordSysModel()===e}function ih(t,e,i){this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this._initCartesian(t,e,i),this.model=t}function nh(t,e,i,n){function o(t){return t.dim+"_"+t.index}i.getAxesOnZeroOf=function(){return a?[a]:[]};var a,r=t[e],s=i.model,l=s.get("axisLine.onZero"),u=s.get("axisLine.onZeroAxisIndex");if(l){if(null!=u)oh(r[u])&&(a=r[u]);else for(var h in r)if(r.hasOwnProperty(h)&&oh(r[h])&&!n[o(r[h])]){a=r[h];break}a&&(n[o(a)]=!0)}}function oh(t){return t&&"category"!==t.type&&"time"!==t.type&&Zl(t)}function ah(t,e){var i=t.getExtent(),n=i[0]+i[1];t.toGlobalCoord="x"===t.dim?function(t){return t+e}:function(t){return n-t+e},t.toLocalCoord="x"===t.dim?function(t){return t-e}:function(t){return n-t+e}}function rh(t,e){return f(VD,function(e){return t.getReferringComponents(e)[0]})}function sh(t){return"cartesian2d"===t.get("coordinateSystem")}function lh(t){var e={componentType:t.mainType,componentIndex:t.componentIndex};return e[t.mainType+"Index"]=t.componentIndex,e}function uh(t,e,i,n){var o,a,r=Xo(i-t.rotation),s=n[0]>n[1],l="start"===e&&!s||"start"!==e&&s;return jo(r-GD/2)?(a=l?"bottom":"top",o="center"):jo(r-1.5*GD)?(a=l?"top":"bottom",o="center"):(a="middle",o=r<1.5*GD&&r>GD/2?l?"left":"right":l?"right":"left"),{rotation:r,textAlign:o,textVerticalAlign:a}}function hh(t){var e=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||e&&e.show)}function ch(t,e,i){if(!Kl(t.axis)){var n=t.get("axisLabel.showMinLabel"),o=t.get("axisLabel.showMaxLabel");e=e||[],i=i||[];var a=e[0],r=e[1],s=e[e.length-1],l=e[e.length-2],u=i[0],h=i[1],c=i[i.length-1],d=i[i.length-2];!1===n?(dh(a),dh(u)):fh(a,r)&&(n?(dh(r),dh(h)):(dh(a),dh(u))),!1===o?(dh(s),dh(c)):fh(l,s)&&(o?(dh(l),dh(d)):(dh(s),dh(c)))}}function dh(t){t&&(t.ignore=!0)}function fh(t,e,i){var n=t&&t.getBoundingRect().clone(),o=e&&e.getBoundingRect().clone();if(n&&o){var a=_t([]);return Mt(a,a,-t.rotation),n.applyTransform(bt([],a,t.getLocalTransform())),o.applyTransform(bt([],a,e.getLocalTransform())),n.intersect(o)}}function ph(t){return"middle"===t||"center"===t}function gh(t,e,i){var n=e.axis;if(e.get("axisTick.show")&&!n.scale.isBlank()){for(var o=e.getModel("axisTick"),a=o.getModel("lineStyle"),s=o.get("length"),l=n.getTicksCoords(),u=[],h=[],c=t._transform,d=[],f=0;f=0||t===e}function Sh(t){var e=Mh(t);if(e){var i=e.axisPointerModel,n=e.axis.scale,o=i.option,a=i.get("status"),r=i.get("value");null!=r&&(r=n.parse(r));var s=Th(i);null==a&&(o.status=s?"show":"hide");var l=n.getExtent().slice();l[0]>l[1]&&l.reverse(),(null==r||r>l[1])&&(r=l[1]),r0?"bottom":"top":o.width>0?"left":"right";l||kh(t.style,d,n,u,a,i,p),fo(t,d)}function Rh(t,e){var i=t.get(tC)||0;return Math.min(i,Math.abs(e.width),Math.abs(e.height))}function zh(t,e,i){var n=t.getData(),o=[],a=n.getLayout("valueAxisHorizontal")?1:0;o[1-a]=n.getLayout("valueAxisStart");var r=new nC({shape:{points:n.getLayout("largePoints")},incremental:!!i,__startPoint:o,__valueIdx:a});e.add(r),Bh(r,t,n)}function Bh(t,e,i){var n=i.getVisual("borderColor")||i.getVisual("color"),o=e.getModel("itemStyle").getItemStyle(["color","borderColor"]);t.useStyle(o),t.style.fill=null,t.style.stroke=n,t.style.lineWidth=i.getLayout("barWidth")}function Vh(t,e,i,n){var o=e.getData(),a=this.dataIndex,r=o.getName(a),s=e.get("selectedOffset");n.dispatchAction({type:"pieToggleSelect",from:t,name:r,seriesId:e.id}),o.each(function(t){Gh(o.getItemGraphicEl(t),o.getItemLayout(t),e.isSelected(o.getName(t)),s,i)})}function Gh(t,e,i,n,o){var a=(e.startAngle+e.endAngle)/2,r=Math.cos(a),s=Math.sin(a),l=i?n:0,u=[r*l,s*l];o?t.animate().when(200,{position:u}).start("bounceOut"):t.attr("position",u)}function Fh(t,e){function i(){a.ignore=a.hoverIgnore,r.ignore=r.hoverIgnore}function n(){a.ignore=a.normalIgnore,r.ignore=r.normalIgnore}tb.call(this);var o=new hM({z2:2}),a=new gM,r=new rM;this.add(o),this.add(a),this.add(r),this.updateData(t,e,!0),this.on("emphasis",i).on("normal",n).on("mouseover",i).on("mouseout",n)}function Wh(t,e,i,n,o,a,r){function s(e,i){for(var n=e;n>=0&&(t[n].y-=i,!(n>0&&t[n].y>t[n-1].y+t[n-1].height));n--);}function l(t,e,i,n,o,a){for(var r=e?Number.MAX_VALUE:0,s=0,l=t.length;s=r&&(d=r-10),!e&&d<=r&&(d=r+10),t[s].x=i+d*a,r=d}}t.sort(function(t,e){return t.y-e.y});for(var u,h=0,c=t.length,d=[],f=[],p=0;pe&&a+1t[a].y+t[a].height)return void s(a,n/2);s(i-1,n/2)}(p,c,-u),h=t[p].y+t[p].height;r-h<0&&s(c-1,h-r);for(p=0;p=i?f.push(t[p]):d.push(t[p]);l(d,!1,e,i,n,o),l(f,!0,e,i,n,o)}function Hh(t,e,i,n,o,a){for(var r=[],s=[],l=0;l3?1.4:o>1?1.2:1.1;hc(this,"zoom","zoomOnMouseWheel",t,{scale:n>0?s:1/s,originX:a,originY:r})}if(i){var l=Math.abs(n);hc(this,"scrollMove","moveOnMouseWheel",t,{scrollDelta:(n>0?1:-1)*(l>3?.4:l>1?.15:.05),originX:a,originY:r})}}}function uc(t){ic(this._zr,"globalPan")||hc(this,"zoom",null,t,{scale:t.pinchScale>1?1.1:1/1.1,originX:t.pinchX,originY:t.pinchY})}function hc(t,e,i,n,o){t.pointerChecker&&t.pointerChecker(n,o.originX,o.originY)&&(mw(n.event),cc(t,e,i,n,o))}function cc(t,e,i,n,o){o.isAvailableBehavior=m(dc,null,i,n),t.trigger(e,o)}function dc(t,e,i){var n=i[t];return!t||n&&(!_(n)||e.event[n+"Key"])}function fc(t,e,i){var n=t.target,o=n.position;o[0]+=e,o[1]+=i,n.dirty()}function pc(t,e,i,n){var o=t.target,a=t.zoomLimit,r=o.position,s=o.scale,l=t.zoom=t.zoom||1;if(l*=e,a){var u=a.min||0,h=a.max||1/0;l=Math.max(Math.min(h,l),u)}var c=l/t.zoom;t.zoom=l,r[0]-=(i-r[0])*(c-1),r[1]-=(n-r[1])*(c-1),s[0]*=c,s[1]*=c,o.dirty()}function gc(t,e,i){var n=e.getComponentByElement(t.topTarget),o=n&&n.coordinateSystem;return n&&n!==i&&!RC[n.mainType]&&o&&o.model!==i}function mc(t,e){var i=t.getItemStyle(),n=t.get("areaColor");return null!=n&&(i.fill=n),i}function vc(t,e,i,n,o){i.off("click"),i.off("mousedown"),e.get("selectedMode")&&(i.on("mousedown",function(){t._mouseDownFlag=!0}),i.on("click",function(a){if(t._mouseDownFlag){t._mouseDownFlag=!1;for(var r=a.target;!r.__regions;)r=r.parent;if(r){var s={type:("geo"===e.mainType?"geo":"map")+"ToggleSelect",batch:f(r.__regions,function(t){return{name:t.name,from:o.uid}})};s[e.mainType+"Id"]=e.id,n.dispatchAction(s),yc(e,i)}}}))}function yc(t,e){e.eachChild(function(e){d(e.__regions,function(i){e.trigger(t.isSelected(i.name)?"emphasis":"normal")})})}function xc(t,e){var i=new tb;this.uid=Ro("ec_map_draw"),this._controller=new oc(t.getZr()),this._controllerHost={target:e?i:null},this.group=i,this._updateGroup=e,this._mouseDownFlag,this._mapName,this._initialized,i.add(this._regionsGroup=new tb),i.add(this._backgroundGroup=new tb)}function _c(t){var e=this[zC];e&&e.recordVersion===this[BC]&&wc(e,t)}function wc(t,e){var i=t.circle,n=t.labelModel,o=t.hoverLabelModel,a=t.emphasisText,r=t.normalText;e?(i.style.extendFrom(mo({},o,{text:o.get("show")?a:null},{isRectText:!0,useInsideStyle:!1},!0)),i.__mapOriginalZ2=i.z2,i.z2+=NM):(mo(i.style,n,{text:n.get("show")?r:null,textPosition:n.getShallow("position")||"bottom"},{isRectText:!0,useInsideStyle:!1}),i.dirty(!1),null!=i.__mapOriginalZ2&&(i.z2=i.__mapOriginalZ2,i.__mapOriginalZ2=null))}function bc(t,e,i){var n=t.getZoom(),o=t.getCenter(),a=e.zoom,r=t.dataToPoint(o);if(null!=e.dx&&null!=e.dy){r[0]-=e.dx,r[1]-=e.dy;o=t.pointToData(r);t.setCenter(o)}if(null!=a){if(i){var s=i.min||0,l=i.max||1/0;a=Math.max(Math.min(n*a,l),s)/n}t.scale[0]*=a,t.scale[1]*=a;var u=t.position,h=(e.originX-u[0])*(a-1),c=(e.originY-u[1])*(a-1);u[0]-=h,u[1]-=c,t.updateTransform();o=t.pointToData(r);t.setCenter(o),t.setZoom(a*n)}return{center:t.getCenter(),zoom:t.getZoom()}}function Sc(){Tw.call(this)}function Mc(t){this.name=t,this.zoomLimit,Tw.call(this),this._roamTransformable=new Sc,this._rawTransformable=new Sc,this._center,this._zoom}function Ic(t,e,i,n){var o=i.seriesModel,a=o?o.coordinateSystem:null;return a===this?a[t](n):null}function Tc(t,e,i,n){Mc.call(this,t),this.map=e;var o=OC.load(e,i);this._nameCoordMap=o.nameCoordMap,this._regionsMap=o.regionsMap,this._invertLongitute=null==n||n,this.regions=o.regions,this._rect=o.boundingRect}function Ac(t,e,i,n){var o=i.geoModel,a=i.seriesModel,r=o?o.coordinateSystem:a?a.coordinateSystem||(a.getReferringComponents("geo")[0]||{}).coordinateSystem:null;return r===this?r[t](n):null}function Dc(t,e){var i=t.get("boundingCoords");if(null!=i){var n=i[0],o=i[1];isNaN(n[0])||isNaN(n[1])||isNaN(o[0])||isNaN(o[1])||this.setBoundingRect(n[0],n[1],o[0]-n[0],o[1]-n[1])}var a,r=this.getBoundingRect(),s=t.get("layoutCenter"),l=t.get("layoutSize"),u=e.getWidth(),h=e.getHeight(),c=r.width/r.height*this.aspectScale,d=!1;s&&l&&(s=[Vo(s[0],u),Vo(s[1],h)],l=Vo(l,Math.min(u,h)),isNaN(s[0])||isNaN(s[1])||isNaN(l)||(d=!0));if(d){var f={};c>1?(f.width=l,f.height=l/c):(f.height=l,f.width=l*c),f.y=s[1]-f.height/2,f.x=s[0]-f.width/2}else(a=t.getBoxLayoutParams()).aspect=c,f=ca(a,{width:u,height:h});this.setViewRect(f.x,f.y,f.width,f.height),this.setCenter(t.get("center")),this.setZoom(t.get("zoom"))}function Cc(t,e){d(e.get("geoCoord"),function(e,i){t.addGeoCoord(i,e)})}function Lc(t,e){var i={};return d(t,function(t){t.each(t.mapDimension("value"),function(e,n){var o="ec-"+t.getName(n);i[o]=i[o]||[],isNaN(e)||i[o].push(e)})}),t[0].map(t[0].mapDimension("value"),function(n,o){for(var a="ec-"+t[0].getName(o),r=0,s=1/0,l=-1/0,u=i[a].length,h=0;h=0;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)}}function Wc(t,e){var i=t.isExpand?t.children:[],n=t.parentNode.children,o=t.hierNode.i?n[t.hierNode.i-1]:null;if(i.length){jc(t);var a=(i[0].hierNode.prelim+i[i.length-1].hierNode.prelim)/2;o?(t.hierNode.prelim=o.hierNode.prelim+e(t,o),t.hierNode.modifier=t.hierNode.prelim-a):t.hierNode.prelim=a}else o&&(t.hierNode.prelim=o.hierNode.prelim+e(t,o));t.parentNode.hierNode.defaultAncestor=Yc(t,o,t.parentNode.hierNode.defaultAncestor||n[0],e)}function Hc(t){var e=t.hierNode.prelim+t.parentNode.hierNode.modifier;t.setLayout({x:e},!0),t.hierNode.modifier+=t.parentNode.hierNode.modifier}function Zc(t){return arguments.length?t:Qc}function Uc(t,e){var i={};return t-=Math.PI/2,i.x=e*Math.cos(t),i.y=e*Math.sin(t),i}function Xc(t,e){return ca(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function jc(t){for(var e=t.children,i=e.length,n=0,o=0;--i>=0;){var a=e[i];a.hierNode.prelim+=n,a.hierNode.modifier+=n,o+=a.hierNode.change,n+=a.hierNode.shift+o}}function Yc(t,e,i,n){if(e){for(var o=t,a=t,r=a.parentNode.children[0],s=e,l=o.hierNode.modifier,u=a.hierNode.modifier,h=r.hierNode.modifier,c=s.hierNode.modifier;s=qc(s),a=Kc(a),s&&a;){o=qc(o),r=Kc(r),o.hierNode.ancestor=t;var d=s.hierNode.prelim+c-a.hierNode.prelim-u+n(s,a);d>0&&(Jc($c(s,t,i),t,d),u+=d,l+=d),c+=s.hierNode.modifier,u+=a.hierNode.modifier,l+=o.hierNode.modifier,h+=r.hierNode.modifier}s&&!qc(o)&&(o.hierNode.thread=s,o.hierNode.modifier+=c-l),a&&!Kc(r)&&(r.hierNode.thread=a,r.hierNode.modifier+=u-h,i=t)}return i}function qc(t){var e=t.children;return e.length&&t.isExpand?e[e.length-1]:t.hierNode.thread}function Kc(t){var e=t.children;return e.length&&t.isExpand?e[0]:t.hierNode.thread}function $c(t,e,i){return t.hierNode.ancestor.parentNode===e.parentNode?t.hierNode.ancestor:i}function Jc(t,e,i){var n=i/(e.hierNode.i-t.hierNode.i);e.hierNode.change-=n,e.hierNode.shift+=i,e.hierNode.modifier+=i,e.hierNode.prelim+=i,t.hierNode.change+=n}function Qc(t,e){return t.parentNode===e.parentNode?1:2}function td(t,e){var i=t.getItemLayout(e);return i&&!isNaN(i.x)&&!isNaN(i.y)&&"none"!==t.getItemVisual(e,"symbol")}function ed(t,e,i){return i.itemModel=e,i.itemStyle=e.getModel("itemStyle").getItemStyle(),i.hoverItemStyle=e.getModel("emphasis.itemStyle").getItemStyle(),i.lineStyle=e.getModel("lineStyle").getLineStyle(),i.labelModel=e.getModel("label"),i.hoverLabelModel=e.getModel("emphasis.label"),!1===t.isExpand&&0!==t.children.length?i.symbolInnerColor=i.itemStyle.fill:i.symbolInnerColor="#fff",i}function id(t,e,i,n,o,a){var s=!i,l=t.tree.getNodeByDataIndex(e),a=ed(l,l.getModel(),a),u=t.tree.root,h=l.parentNode===u?l:l.parentNode||l,c=t.getItemGraphicEl(h.dataIndex),d=h.getLayout(),f=c?{x:c.position[0],y:c.position[1],rawX:c.__radialOldRawX,rawY:c.__radialOldRawY}:d,p=l.getLayout();s?(i=new wu(t,e,a)).attr("position",[f.x,f.y]):i.updateData(t,e,a),i.__radialOldRawX=i.__radialRawX,i.__radialOldRawY=i.__radialRawY,i.__radialRawX=p.rawX,i.__radialRawY=p.rawY,n.add(i),t.setItemGraphicEl(e,i),Io(i,{position:[p.x,p.y]},o);var g=i.getSymbolPath();if("radial"===a.layout){var m,v,y=u.children[0],x=y.getLayout(),_=y.children.length;if(p.x===x.x&&!0===l.isExpand){var w={};w.x=(y.children[0].getLayout().x+y.children[_-1].getLayout().x)/2,w.y=(y.children[0].getLayout().y+y.children[_-1].getLayout().y)/2,(m=Math.atan2(w.y-x.y,w.x-x.x))<0&&(m=2*Math.PI+m),(v=w.xx.x)||(m-=Math.PI);var b=v?"left":"right";g.setStyle({textPosition:b,textRotation:-m,textOrigin:"center",verticalAlign:"middle"})}if(l.parentNode&&l.parentNode!==u){var S=i.__edge;S||(S=i.__edge=new bM({shape:od(a,f,f),style:r({opacity:0,strokeNoScale:!0},a.lineStyle)})),Io(S,{shape:od(a,d,p),style:{opacity:1}},o),n.add(S)}}function nd(t,e,i,n,o,a){for(var r,s=t.tree.getNodeByDataIndex(e),l=t.tree.root,a=ed(s,s.getModel(),a),u=s.parentNode===l?s:s.parentNode||s;null==(r=u.getLayout());)u=u.parentNode===l?u:u.parentNode||u;Io(i,{position:[r.x+1,r.y+1]},o,function(){n.remove(i),t.setItemGraphicEl(e,null)}),i.fadeOut(null,{keepLabel:!0});var h=i.__edge;h&&Io(h,{shape:od(a,r,r),style:{opacity:0}},o,function(){n.remove(h)})}function od(t,e,i){var n,o,a,r,s,l,u,h,c=t.orient;if("radial"===t.layout){s=e.rawX,u=e.rawY,l=i.rawX,h=i.rawY;var d=Uc(s,u),f=Uc(s,u+(h-u)*t.curvature),p=Uc(l,h+(u-h)*t.curvature),g=Uc(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}}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}}function ad(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;s=0;a--)n.push(o[a])}}function sd(t,e){var i=Xc(t,e);t.layoutInfo=i;var n=t.get("layout"),o=0,a=0,r=null;"radial"===n?(o=2*Math.PI,a=Math.min(i.height,i.width)/2,r=Zc(function(t,e){return(t.parentNode===e.parentNode?1:2)/t.depth})):(o=i.width,a=i.height,r=Zc());var s=t.getData().tree.root,l=s.children[0];if(l){Fc(s),ad(l,Wc,r),s.hierNode.modifier=-l.hierNode.prelim,rd(l,Hc);var u=l,h=l,c=l;rd(l,function(t){var e=t.getLayout().x;eh.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),rd(l,function(t){m=(t.getLayout().x+f)*p,v=(t.depth-1)*g;var e=Uc(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),rd(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),rd(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)}))}}}function ld(t,e,i){if(t&&l(e,t.type)>=0){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 ud(t){for(var e=[];t;)(t=t.parentNode)&&e.push(t);return e.reverse()}function hd(t,e){return l(ud(t),e)>=0}function cd(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}function dd(t){var e=0;d(t.children,function(t){dd(t);var i=t.value;y(i)&&(i=i[0]),e+=i});var i=t.value;y(i)&&(i=i[0]),(null==i||isNaN(i))&&(i=e),i<0&&(i=0),y(t.value)?t.value[0]=i:t.value=i}function fd(t,e){var i=e.get("color");if(i){var n;return d(t=t||[],function(t){var e=new No(t),i=e.get("color");(e.get("itemStyle.color")||i&&"none"!==i)&&(n=!0)}),n||((t[0]||(t[0]={})).color=i.slice()),t}}function pd(t){this.group=new tb,t.add(this.group)}function gd(t,e,i,n,o,a){var r=[[o?t:t-UC,e],[t+i,e],[t+i,e+n],[o?t:t-UC,e+n]];return!a&&r.splice(2,0,[t+i+UC,e+n/2]),!o&&r.push([t,e+n/2]),r}function md(t,e,i){t.eventData={componentType:"series",componentSubType:"treemap",componentIndex:e.componentIndex,seriesIndex:e.componentIndex,seriesName:e.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:i&&i.dataIndex,name:i&&i.name},treePathInfo:i&&cd(i,e)}}function vd(){var t,e=[],i={};return{add:function(t,n,o,a,r){return _(a)&&(r=a,a=0),!i[t.id]&&(i[t.id]=1,e.push({el:t,target:n,time:o,delay:a,easing:r}),!0)},done:function(e){return t=e,this},start:function(){for(var n=e.length,o=0,a=e.length;o=0;a--)null==i[a]&&(delete n[e[a]],e.pop())}function bd(t,e){var i=t.visual,n=[];w(i)?sL(i,function(t){n.push(t)}):null!=i&&n.push(i);var o={color:1,symbol:1};e||1!==n.length||o.hasOwnProperty(t.type)||(n[1]=n[0]),Ld(t,n)}function Sd(t){return{applyVisual:function(e,i,n){e=this.mapValueToVisual(e),n("color",t(i("color"),e))},_doMap:Dd([0,1])}}function Md(t){var e=this.option.visual;return e[Math.round(Bo(t,[0,1],[0,e.length-1],!0))]||{}}function Id(t){return function(e,i,n){n(t,this.mapValueToVisual(e))}}function Td(t){var e=this.option.visual;return e[this.option.loop&&t!==uL?t%e.length:t]}function Ad(){return this.option.visual[0]}function Dd(t){return{linear:function(e){return Bo(e,t,this.option.visual,!0)},category:Td,piecewise:function(e,i){var n=Cd.call(this,i);return null==n&&(n=Bo(e,t,this.option.visual,!0)),n},fixed:Ad}}function Cd(t){var e=this.option,i=e.pieceList;if(e.hasSpecialVisual){var n=i[hL.findPieceIndex(t,i)];if(n&&n.visual)return n.visual[this.type]}}function Ld(t,e){return t.visual=e,"color"===t.type&&(t.parsedVisual=f(e,function(t){return Gt(t)})),e}function kd(t,e,i){return t?e<=i:e=o.length||t===o[t.depth])&&Pd(t,Vd(r,h,t,e,g,a),i,n,o,a)})}else l=Od(h),t.setVisual("color",l)}}function Nd(t,e,i,n){var o=a({},e);return d(["color","colorAlpha","colorSaturation"],function(a){var r=t.get(a,!0);null==r&&i&&(r=i[a]),null==r&&(r=e[a]),null==r&&(r=n.get(a)),null!=r&&(o[a]=r)}),o}function Od(t){var e=Rd(t,"color");if(e){var i=Rd(t,"colorAlpha"),n=Rd(t,"colorSaturation");return n&&(e=jt(e,null,null,n)),i&&(e=Yt(e,i)),e}}function Ed(t,e){return null!=e?jt(e,null,null,t):null}function Rd(t,e){var i=t[e];if(null!=i&&"none"!==i)return i}function zd(t,e,i,n,o,a){if(a&&a.length){var r=Bd(e,"color")||null!=o.color&&"none"!==o.color&&(Bd(e,"colorAlpha")||Bd(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 hL(c);return d.__drColorMappingBy=h,d}}}function Bd(t,e){var i=t.get(e);return fL(i)&&i.length?{name:e,range:i}:null}function Vd(t,e,i,n,o,r){var s=a({},e);if(o){var l=o.type,u="color"===l&&o.__drColorMappingBy,h="index"===u?n:"id"===u?r.mapIdToIndex(i.getId()):i.getValue(t.get("visualDimension"));s[l]=o.mapValueToVisual(h)}return s}function Gd(t,e,i,n){var o,a;if(!t.isRemoved()){var r=t.getLayout();o=r.width,a=r.height;var s=(f=t.getModel()).get(_L),l=f.get(wL)/2,u=Kd(f),h=Math.max(s,u),c=s-l,d=h-l,f=t.getModel();t.setLayout({borderWidth:s,upperHeight:h,upperLabelHeight:u},!0);var p=(o=mL(o-2*c,0))*(a=mL(a-c-d,0)),g=Fd(t,f,p,e,i,n);if(g.length){var m={x:c,y:d,width:o,height:a},v=vL(o,a),y=1/0,x=[];x.area=0;for(var _=0,w=g.length;_=0;l--){var u=o["asc"===n?r-l-1:l].getValue();u/i*es[1]&&(s[1]=e)})}else s=[NaN,NaN];return{sum:n,dataExtent:s}}function Ud(t,e,i){for(var n,o=0,a=1/0,r=0,s=t.length;ro&&(o=n));var l=t.area*t.area,u=e*e*i;return l?mL(u*o/l,l/(u*a)):1/0}function Xd(t,e,i,n,o){var a=e===i.width?0:1,r=1-a,s=["x","y"],l=["width","height"],u=i[s[a]],h=e?t.area/e:0;(o||h>i[l[r]])&&(h=i[l[r]]);for(var c=0,d=t.length;cXM&&(u=XM),a=s}u=0?n+=u:n-=u:p>=0?n-=u:n+=u}return n}function pf(t,e){return t.getVisual("opacity")||t.getModel().get(e)}function gf(t,e,i){var n=t.getGraphicEl(),o=pf(t,e);null!=i&&(null==o&&(o=1),o*=i),n.downplay&&n.downplay(),n.traverse(function(t){if("group"!==t.type){var e=t.lineLabelOriginalOpacity;null!=e&&null==i||(e=o),t.setStyle("opacity",e)}})}function mf(t,e){var i=pf(t,e),n=t.getGraphicEl();n.highlight&&n.highlight(),n.traverse(function(t){"group"!==t.type&&t.setStyle("opacity",i)})}function vf(t){return t instanceof Array||(t=[t,t]),t}function yf(t){var e=t.coordinateSystem;if(!e||"view"===e.type){var i=t.getGraph();i.eachNode(function(t){var e=t.getModel();t.setLayout([+e.get("x"),+e.get("y")])}),xf(i)}}function xf(t){t.eachEdge(function(t){var e=t.getModel().get("lineStyle.curveness")||0,i=F(t.node1.getLayout()),n=F(t.node2.getLayout()),o=[i,n];+e&&o.push([(i[0]+n[0])/2-(i[1]-n[1])*e,(i[1]+n[1])/2-(n[0]-i[0])*e]),t.setLayout(o)})}function _f(t){var e=t.coordinateSystem;if(!e||"view"===e.type){var i=e.getBoundingRect(),n=t.getData(),o=n.graph,a=0,r=n.getSum("value"),s=2*Math.PI/(r||n.count()),l=i.width/2+i.x,u=i.height/2+i.y,h=Math.min(i.width,i.height)/2;o.eachNode(function(t){var e=t.getValue("value");a+=s*(r?e:1)/2,t.setLayout([h*Math.cos(a)+l,h*Math.sin(a)+u]),a+=s*(r?e:1)/2}),n.setLayout({cx:l,cy:u}),o.eachEdge(function(t){var e,i=t.getModel().get("lineStyle.curveness")||0,n=F(t.node1.getLayout()),o=F(t.node2.getLayout()),a=(n[0]+o[0])/2,r=(n[1]+o[1])/2;+i&&(e=[l*(i*=3)+a*(1-i),u*i+r*(1-i)]),t.setLayout([n,o,e])})}}function wf(t,e,i){for(var n=i.rect,o=n.width,a=n.height,r=[n.x+o/2,n.y+a/2],s=null==i.gravity?.1:i.gravity,l=0;l0?-1:i<0?1:e?-1:1}}function Pf(t,e){return Math.min(e[1],Math.max(e[0],t))}function Nf(t,e,i){this._axesMap=R(),this._axesLayout={},this.dimensions=t.dimensions,this._rect,this._model=t,this._init(t,e,i)}function Of(t,e){return ek(ik(t,e[0]),e[1])}function Ef(t,e){var i=e.layoutLength/(e.axisCount-1);return{position:i*t,axisNameAvailableWidth:i,axisLabelShow:!0}}function Rf(t,e){var i,n,o=e.layoutLength,a=e.axisExpandWidth,r=e.axisCount,s=e.axisCollapseWidth,l=e.winInnerIndices,u=s,h=!1;return tmk}function $f(t){var e=t.length-1;return e<0&&(e=0),[t[0],t[e]]}function Jf(t,e,i,n){var o=new tb;return o.add(new yM({name:"main",style:ip(i),silent:!0,draggable:!0,cursor:"move",drift:uk(t,e,o,"nswe"),ondragend:uk(qf,e,{isEnd:!0})})),hk(n,function(i){o.add(new yM({name:i,style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:uk(t,e,o,i),ondragend:uk(qf,e,{isEnd:!0})}))}),o}function Qf(t,e,i,n){var o=n.brushStyle.lineWidth||0,a=fk(o,vk),r=i[0][0],s=i[1][0],l=r-o/2,u=s-o/2,h=i[0][1],c=i[1][1],d=h-a+o/2,f=c-a+o/2,p=h-r,g=c-s,m=p+o,v=g+o;ep(t,e,"main",r,s,p,g),n.transformable&&(ep(t,e,"w",l,u,a,v),ep(t,e,"e",d,u,a,v),ep(t,e,"n",l,u,m,a),ep(t,e,"s",l,f,m,a),ep(t,e,"nw",l,u,a,a),ep(t,e,"ne",d,u,a,a),ep(t,e,"sw",l,f,a,a),ep(t,e,"se",d,f,a,a))}function tp(t,e){var i=e.__brushOption,n=i.transformable,o=e.childAt(0);o.useStyle(ip(i)),o.attr({silent:!n,cursor:n?"move":"default"}),hk(["w","e","n","s","se","sw","ne","nw"],function(i){var o=e.childOfName(i),a=ap(t,i);o&&o.attr({silent:!n,invisible:!n,cursor:n?_k[a]+"-resize":null})})}function ep(t,e,i,n,o,a,r){var s=e.childOfName(i);s&&s.setShape(hp(up(t,e,[[n,o],[n+a,o+r]])))}function ip(t){return r({strokeNoScale:!0},t.brushStyle)}function np(t,e,i,n){var o=[dk(t,i),dk(e,n)],a=[fk(t,i),fk(e,n)];return[[o[0],a[0]],[o[1],a[1]]]}function op(t){return Ao(t.group)}function ap(t,e){if(e.length>1)return("e"===(n=[ap(t,(e=e.split(""))[0]),ap(t,e[1])])[0]||"w"===n[0])&&n.reverse(),n.join("");var i={left:"w",right:"e",top:"n",bottom:"s"},n=Co({w:"left",e:"right",n:"top",s:"bottom"}[e],op(t));return i[n]}function rp(t,e,i,n,o,a,r,s){var l=n.__brushOption,u=t(l.range),h=lp(i,a,r);hk(o.split(""),function(t){var e=xk[t];u[e[0]][e[1]]+=h[e[0]]}),l.range=e(np(u[0][0],u[1][0],u[0][1],u[1][1])),Zf(i,n),qf(i,{isEnd:!1})}function sp(t,e,i,n,o){var a=e.__brushOption.range,r=lp(t,i,n);hk(a,function(t){t[0]+=r[0],t[1]+=r[1]}),Zf(t,e),qf(t,{isEnd:!1})}function lp(t,e,i){var n=t.group,o=n.transformCoordToLocal(e,i),a=n.transformCoordToLocal(0,0);return[o[0]-a[0],o[1]-a[1]]}function up(t,e,n){var o=jf(t,e);return o&&!0!==o?o.clipPath(n,t._transform):i(n)}function hp(t){var e=dk(t[0][0],t[1][0]),i=dk(t[0][1],t[1][1]);return{x:e,y:i,width:fk(t[0][0],t[1][0])-e,height:fk(t[0][1],t[1][1])-i}}function cp(t,e,i){if(t._brushType){var n=t._zr,o=t._covers,a=Xf(t,e,i);if(!t._dragging)for(var r=0;r0;a--)Yp(s,l*=.99,r),jp(s,o,i,n,r),tg(s,l,r),jp(s,o,i,n,r)}function Up(t,e){var i=[],n="vertical"===e?"y":"x",o=Zi(t,function(t){return t.getLayout()[n]});return o.keys.sort(function(t,e){return t-e}),d(o.keys,function(t){i.push(o.buckets.get(t))}),i}function Xp(t,e,i,n,o,a,r){var s=[];d(e,function(t){var e=t.length,i=0,l=0;d(t,function(t){i+=t.getLayout().value}),l="vertical"===r?(o-(e-1)*a)/i:(n-(e-1)*a)/i,s.push(l)}),s.sort(function(t,e){return t-e});var l=s[0];d(e,function(t){d(t,function(t,e){var i=t.getLayout().value*l;"vertical"===r?(t.setLayout({x:e},!0),t.setLayout({dx:i},!0)):(t.setLayout({y:e},!0),t.setLayout({dy:i},!0))})}),d(i,function(t){var e=+t.getValue()*l;t.setLayout({dy:e},!0)})}function jp(t,e,i,n,o){d(t,function(t){var a,r,s,l=0,u=t.length;if("vertical"===o){var h;for(t.sort(function(t,e){return t.getLayout().x-e.getLayout().x}),s=0;s0&&(h=a.getLayout().x+r,a.setLayout({x:h},!0)),l=a.getLayout().x+a.getLayout().dx+e;if((r=l-e-n)>0)for(h=a.getLayout().x-r,a.setLayout({x:h},!0),l=h,s=u-2;s>=0;--s)(r=(a=t[s]).getLayout().x+a.getLayout().dx+e-l)>0&&(h=a.getLayout().x-r,a.setLayout({x:h},!0)),l=a.getLayout().x}else{var c;for(t.sort(function(t,e){return t.getLayout().y-e.getLayout().y}),s=0;s0&&(c=a.getLayout().y+r,a.setLayout({y:c},!0)),l=a.getLayout().y+a.getLayout().dy+e;if((r=l-e-i)>0)for(c=a.getLayout().y-r,a.setLayout({y:c},!0),l=c,s=u-2;s>=0;--s)(r=(a=t[s]).getLayout().y+a.getLayout().dy+e-l)>0&&(c=a.getLayout().y-r,a.setLayout({y:c},!0)),l=a.getLayout().y}})}function Yp(t,e,i){d(t.slice().reverse(),function(t){d(t,function(t){if(t.outEdges.length){var n=Qp(t.outEdges,qp,i)/Qp(t.outEdges,Jp,i);if("vertical"===i){var o=t.getLayout().x+(n-$p(t,i))*e;t.setLayout({x:o},!0)}else{var a=t.getLayout().y+(n-$p(t,i))*e;t.setLayout({y:a},!0)}}})})}function qp(t,e){return $p(t.node2,e)*t.getValue()}function Kp(t,e){return $p(t.node1,e)*t.getValue()}function $p(t,e){return"vertical"===e?t.getLayout().x+t.getLayout().dx/2:t.getLayout().y+t.getLayout().dy/2}function Jp(t){return t.getValue()}function Qp(t,e,i){for(var n=0,o=t.length,a=-1;++a0?"P":"N",a=n.getVisual("borderColor"+o)||n.getVisual("color"+o),r=i.getModel(Gk).getItemStyle(Wk);e.useStyle(r),e.style.fill=null,e.style.stroke=a}function fg(t,e,i,n,o){return i>n?-1:i0?t.get(o,e-1)<=n?1:-1:1}function pg(t,e){var i,n=t.getBaseAxis(),o="category"===n.type?n.getBandWidth():(i=n.getExtent(),Math.abs(i[1]-i[0])/e.count()),a=Vo(A(t.get("barMaxWidth"),o),o),r=Vo(A(t.get("barMinWidth"),1),o),s=t.get("barWidth");return null!=s?Vo(s,o):Math.max(Math.min(o/2,a),r)}function gg(t){return y(t)||(t=[+t,+t]),t}function mg(t,e){t.eachChild(function(t){t.attr({z:e.z,zlevel:e.zlevel,style:{stroke:"stroke"===e.brushType?e.color:null,fill:"fill"===e.brushType?e.color:null}})})}function vg(t,e){tb.call(this);var i=new wu(t,e),n=new tb;this.add(i),this.add(n),n.beforeUpdate=function(){this.attr(i.getScale())},this.updateData(t,e)}function yg(t){var e=t.data;e&&e[0]&&e[0][0]&&e[0][0].coord&&(t.data=f(e,function(t){var e={coords:[t[0].coord,t[1].coord]};return t[0].name&&(e.fromName=t[0].name),t[1].name&&(e.toName=t[1].name),o([e,t[0],t[1]])}))}function xg(t,e,i){tb.call(this),this.add(this.createLine(t,e,i)),this._updateEffectSymbol(t,e)}function _g(t,e,i){tb.call(this),this._createPolyline(t,e,i)}function wg(t,e,i){xg.call(this,t,e,i),this._lastFrame=0,this._lastFramePercent=0}function bg(){this.group=new tb}function Sg(t){return t instanceof Array||(t=[t,t]),t}function Mg(){var t=iw();this.canvas=t,this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={}}function Ig(t,e,i){var n=t[1]-t[0],o=(e=f(e,function(e){return{interval:[(e.interval[0]-t[0])/n,(e.interval[1]-t[0])/n]}})).length,a=0;return function(t){for(n=a;n=0;n--){var r=e[n].interval;if(r[0]<=t&&t<=r[1]){a=n;break}}return n>=0&&n=e[0]&&t<=e[1]}}function Ag(t){var e=t.dimensions;return"lng"===e[0]&&"lat"===e[1]}function Dg(t,e,i,n){var o=t.getItemLayout(e),a=i.get("symbolRepeat"),r=i.get("symbolClip"),s=i.get("symbolPosition")||"start",l=(i.get("symbolRotate")||0)*Math.PI/180||0,u=i.get("symbolPatternSize")||2,h=i.isAnimationEnabled(),c={dataIndex:e,layout:o,itemModel:i,symbolType:t.getItemVisual(e,"symbol")||"circle",color:t.getItemVisual(e,"color"),symbolClip:r,symbolRepeat:a,symbolRepeatDirection:i.get("symbolRepeatDirection"),symbolPatternSize:u,rotation:l,animationModel:h?i:null,hoverAnimation:h&&i.get("hoverAnimation"),z2:i.getShallow("z",!0)||0};Cg(i,a,o,n,c),kg(t,e,o,a,r,c.boundingLength,c.pxSign,u,n,c),Pg(i,c.symbolScale,l,n,c);var d=c.symbolSize,f=i.get("symbolOffset");return y(f)&&(f=[Vo(f[0],d[0]),Vo(f[1],d[1])]),Ng(i,d,o,a,r,f,s,c.valueLineWidth,c.boundingLength,c.repeatCutLength,n,c),c}function Cg(t,e,i,n,o){var a,r=n.valueDim,s=t.get("symbolBoundingData"),l=n.coordSys.getOtherAxis(n.coordSys.getBaseAxis()),u=l.toGlobalCoord(l.dataToCoord(0)),h=1-+(i[r.wh]<=0);if(y(s)){var c=[Lg(l,s[0])-u,Lg(l,s[1])-u];c[1]0?1:a<0?-1:0}function Lg(t,e){return t.toGlobalCoord(t.dataToCoord(t.scale.parse(e)))}function kg(t,e,i,n,o,a,r,s,l,u){var h=l.valueDim,c=l.categoryDim,d=Math.abs(i[c.wh]),f=t.getItemVisual(e,"symbolSize");y(f)?f=f.slice():(null==f&&(f="100%"),f=[f,f]),f[c.index]=Vo(f[c.index],d),f[h.index]=Vo(f[h.index],n?d:Math.abs(a)),u.symbolSize=f,(u.symbolScale=[f[0]/s,f[1]/s])[h.index]*=(l.isHorizontal?-1:1)*r}function Pg(t,e,i,n,o){var a=t.get(cP)||0;a&&(fP.attr({scale:e.slice(),rotation:i}),fP.updateTransform(),a/=fP.getLineScale(),a*=e[n.valueDim.index]),o.valueLineWidth=a}function Ng(t,e,i,n,o,r,s,l,u,h,c,d){var f=c.categoryDim,p=c.valueDim,g=d.pxSign,m=Math.max(e[p.index]+l,0),v=m;if(n){var y=Math.abs(u),x=T(t.get("symbolMargin"),"15%")+"",_=!1;x.lastIndexOf("!")===x.length-1&&(_=!0,x=x.slice(0,x.length-1)),x=Vo(x,e[p.index]);var w=Math.max(m+2*x,0),b=_?0:2*x,S=Qo(n),M=S?n:Kg((y+b)/w);w=m+2*(x=(y-M*m)/2/(_?M:M-1)),b=_?0:2*x,S||"fixed"===n||(M=h?Kg((Math.abs(h)+b)/w):0),v=M*w-b,d.repeatTimes=M,d.symbolMargin=x}var I=g*(v/2),A=d.pathPosition=[];A[f.index]=i[f.wh]/2,A[p.index]="start"===s?I:"end"===s?u-I:u/2,r&&(A[0]+=r[0],A[1]+=r[1]);var D=d.bundlePosition=[];D[f.index]=i[f.xy],D[p.index]=i[p.xy];var C=d.barRectShape=a({},i);C[p.wh]=g*Math.max(Math.abs(i[p.wh]),Math.abs(A[p.index]+I)),C[f.wh]=i[f.wh];var L=d.clipShape={};L[f.xy]=-i[f.xy],L[f.wh]=c.ecSize[f.wh],L[p.xy]=0,L[p.wh]=i[p.wh]}function Og(t){var e=t.symbolPatternSize,i=Jl(t.symbolType,-e/2,-e/2,e,e,t.color);return i.attr({culling:!0}),"image"!==i.type&&i.setStyle({strokeNoScale:!0}),i}function Eg(t,e,i,n){function o(t){var e=l.slice(),n=i.pxSign,o=t;return("start"===i.symbolRepeatDirection?n>0:n<0)&&(o=h-1-t),e[u.index]=d*(o-h/2+.5)+l[u.index],{position:e,scale:i.symbolScale.slice(),rotation:i.rotation}}var a=t.__pictorialBundle,r=i.symbolSize,s=i.valueLineWidth,l=i.pathPosition,u=e.valueDim,h=i.repeatTimes||0,c=0,d=r[e.valueDim.index]+s+2*i.symbolMargin;for(jg(t,function(t){t.__pictorialAnimationIndex=c,t.__pictorialRepeatTimes=h,c0)],d=t.__pictorialBarRect;kh(d.style,h,a,n,e.seriesModel,o,c),fo(d,h)}function Kg(t){var e=Math.round(t);return Math.abs(t-e)<1e-4?e:Math.ceil(t)}function $g(t,e,i){this.dimension="single",this.dimensions=["single"],this._axis=null,this._rect,this._init(t,e,i),this.model=t}function Jg(t,e){e=e||{};var i=t.coordinateSystem,n=t.axis,o={},a=n.position,r=n.orient,s=i.getRect(),l=[s.x,s.x+s.width,s.y,s.y+s.height],u={horizontal:{top:l[2],bottom:l[3]},vertical:{left:l[0],right:l[1]}};o.position=["vertical"===r?u.vertical[a]:l[0],"horizontal"===r?u.horizontal[a]:l[3]];var h={horizontal:0,vertical:1};o.rotation=Math.PI/2*h[r];var c={top:-1,bottom:1,right:1,left:-1};o.labelDirection=o.tickDirection=o.nameDirection=c[a],t.get("axisTick.inside")&&(o.tickDirection=-o.tickDirection),T(e.labelInside,t.get("axisLabel.inside"))&&(o.labelDirection=-o.labelDirection);var d=e.rotate;return null==d&&(d=t.get("axisLabel.rotate")),o.labelRotation="top"===a?-d:d,o.z2=1,o}function Qg(t,e,i,n,o){var r=t.axis;if(!r.scale.isBlank()&&r.containData(e))if(t.involveSeries){var s=tm(e,t),l=s.payloadBatch,u=s.snapToValue;l[0]&&null==o.seriesIndex&&a(o,l[0]),!n&&t.snap&&r.containData(u)&&null!=u&&(e=u),i.showPointer(t,e,l,o),i.showTooltip(t,s,u)}else i.showPointer(t,e)}function tm(t,e){var i=e.axis,n=i.dim,o=t,a=[],r=Number.MAX_VALUE,s=-1;return _P(e.seriesModels,function(e,l){var u,h,c=e.getData().mapDimension(n,!0);if(e.getAxisTooltipData){var d=e.getAxisTooltipData(c,t,i);h=d.dataIndices,u=d.nestestValue}else{if(!(h=e.getData().indicesOfNearest(c[0],t,"category"===i.type?.5:null)).length)return;u=e.getData().get(c[0],h[0])}if(null!=u&&isFinite(u)){var f=t-u,p=Math.abs(f);p<=r&&((p=0&&s<0)&&(r=p,s=f,o=u,a.length=0),_P(h,function(t){a.push({seriesIndex:e.seriesIndex,dataIndexInside:t,dataIndex:e.getData().getRawIndex(t)})}))}}),{payloadBatch:a,snapToValue:o}}function em(t,e,i,n){t[e.key]={value:i,payloadBatch:n}}function im(t,e,i,n){var o=i.payloadBatch,a=e.axis,r=a.model,s=e.axisPointerModel;if(e.triggerTooltip&&o.length){var l=e.coordSys.model,u=Ah(l),h=t.map[u];h||(h=t.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(h)),h.dataByAxis.push({axisDim:a.dim,axisIndex:r.componentIndex,axisType:r.type,axisId:r.id,value:n,valueLabelOpt:{precision:s.get("label.precision"),formatter:s.get("label.formatter")},seriesDataIndices:o.slice()})}}function nm(t,e,i){var n=i.axesInfo=[];_P(e,function(e,i){var o=e.axisPointerModel.option,a=t[i];a?(!e.useHandle&&(o.status="show"),o.value=a.value,o.seriesDataIndices=(a.payloadBatch||[]).slice()):!e.useHandle&&(o.status="hide"),"show"===o.status&&n.push({axisDim:e.axis.dim,axisIndex:e.axis.model.componentIndex,value:o.value})})}function om(t,e,i,n){if(!lm(e)&&t.list.length){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})}else n({type:"hideTip"})}function am(t,e,i){var n=i.getZr(),o=bP(n).axisPointerLastHighlights||{},a=bP(n).axisPointerLastHighlights={};_P(t,function(t,e){var i=t.axisPointerModel.option;"show"===i.status&&_P(i.seriesDataIndices,function(t){var e=t.seriesIndex+" | "+t.dataIndex;a[e]=t})});var r=[],s=[];d(o,function(t,e){!a[e]&&s.push(t)}),d(a,function(t,e){!o[e]&&r.push(t)}),s.length&&i.dispatchAction({type:"downplay",escapeConnect:!0,batch:s}),r.length&&i.dispatchAction({type:"highlight",escapeConnect:!0,batch:r})}function rm(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}}function sm(t){var e=t.axis.model,i={},n=i.axisDim=t.axis.dim;return i.axisIndex=i[n+"AxisIndex"]=e.componentIndex,i.axisName=i[n+"AxisName"]=e.name,i.axisId=i[n+"AxisId"]=e.id,i}function lm(t){return!t||null==t[0]||isNaN(t[0])||null==t[1]||isNaN(t[1])}function um(t,e,i){if(!U_.node){var n=e.getZr();SP(n).records||(SP(n).records={}),hm(n,e),(SP(n).records[t]||(SP(n).records[t]={})).handler=i}}function hm(t,e){function i(i,n){t.on(i,function(i){var o=pm(e);MP(SP(t).records,function(t){t&&n(t,i,o.dispatchAction)}),cm(o.pendings,e)})}SP(t).initialized||(SP(t).initialized=!0,i("click",v(fm,"click")),i("mousemove",v(fm,"mousemove")),i("globalout",dm))}function cm(t,e){var i,n=t.showTip.length,o=t.hideTip.length;n?i=t.showTip[n-1]:o&&(i=t.hideTip[o-1]),i&&(i.dispatchAction=null,e.dispatchAction(i))}function dm(t,e,i){t.handler("leave",null,i)}function fm(t,e,i,n){e.handler(t,i,n)}function pm(t){var e={showTip:[],hideTip:[]},i=function(n){var o=e[n.type];o?o.push(n):(n.dispatchAction=i,t.dispatchAction(n))};return{dispatchAction:i,pendings:e}}function gm(t,e){if(!U_.node){var i=e.getZr();(SP(i).records||{})[t]&&(SP(i).records[t]=null)}}function mm(){}function vm(t,e,i,n){ym(TP(i).lastProp,n)||(TP(i).lastProp=n,e?Io(i,n,t):(i.stopAnimation(),i.attr(n)))}function ym(t,e){if(w(t)&&w(e)){var i=!0;return d(e,function(e,n){i=i&&ym(t[n],e)}),!!i}return t===e}function xm(t,e){t[e.get("label.show")?"show":"hide"]()}function _m(t){return{position:t.position.slice(),rotation:t.rotation||0}}function wm(t,e,i){var n=e.get("z"),o=e.get("zlevel");t&&t.traverse(function(t){"group"!==t.type&&(null!=n&&(t.z=n),null!=o&&(t.zlevel=o),t.silent=i)})}function bm(t){var e,i=t.get("type"),n=t.getModel(i+"Style");return"line"===i?(e=n.getLineStyle()).fill=null:"shadow"===i&&((e=n.getAreaStyle()).stroke=null),e}function Sm(t,e,i,n,o){var a=Im(i.get("value"),e.axis,e.ecModel,i.get("seriesDataIndices"),{precision:i.get("label.precision"),formatter:i.get("label.formatter")}),r=i.getModel("label"),s=qM(r.get("padding")||0),l=r.getFont(),u=ke(a,l),h=o.position,c=u.width+s[1]+s[3],d=u.height+s[0]+s[2],f=o.align;"right"===f&&(h[0]-=c),"center"===f&&(h[0]-=c/2);var p=o.verticalAlign;"bottom"===p&&(h[1]-=d),"middle"===p&&(h[1]-=d/2),Mm(h,c,d,n);var g=r.get("backgroundColor");g&&"auto"!==g||(g=e.get("axisLine.lineStyle.color")),t.label={shape:{x:0,y:0,width:c,height:d,r:r.get("borderRadius")},position:h.slice(),style:{text:a,textFont:l,textFill:r.getTextColor(),textPosition:"inside",fill:g,stroke:r.get("borderColor")||"transparent",lineWidth:r.get("borderWidth")||0,shadowBlur:r.get("shadowBlur"),shadowColor:r.get("shadowColor"),shadowOffsetX:r.get("shadowOffsetX"),shadowOffsetY:r.get("shadowOffsetY")},z2:10}}function Mm(t,e,i,n){var o=n.getWidth(),a=n.getHeight();t[0]=Math.min(t[0]+e,o)-e,t[1]=Math.min(t[1]+i,a)-i,t[0]=Math.max(t[0],0),t[1]=Math.max(t[1],0)}function Im(t,e,i,n,o){t=e.scale.parse(t);var a=e.scale.getLabel(t,{precision:o.precision}),r=o.formatter;if(r){var s={value:Xl(e,t),seriesData:[]};d(n,function(t){var e=i.getSeriesByIndex(t.seriesIndex),n=t.dataIndexInside,o=e&&e.getDataParams(n);o&&s.seriesData.push(o)}),_(r)?a=r.replace("{value}",a):x(r)&&(a=r(s))}return a}function Tm(t,e,i){var n=xt();return Mt(n,n,i.rotation),St(n,n,i.position),Do([t.dataToCoord(e),(i.labelOffset||0)+(i.labelDirection||1)*(i.labelMargin||0)],n)}function Am(t,e,i,n,o,a){var r=FD.innerTextLayout(i.rotation,0,i.labelDirection);i.labelMargin=o.get("label.margin"),Sm(e,n,o,a,{position:Tm(n.axis,t,i),align:r.textAlign,verticalAlign:r.textVerticalAlign})}function Dm(t,e,i){return i=i||0,{x1:t[i],y1:t[1-i],x2:e[i],y2:e[1-i]}}function Cm(t,e,i){return i=i||0,{x:t[i],y:t[1-i],width:e[i],height:e[1-i]}}function Lm(t,e,i,n,o,a){return{cx:t,cy:e,r0:i,r:n,startAngle:o,endAngle:a,clockwise:!0}}function km(t,e){var i={};return i[e.dim+"AxisIndex"]=e.index,t.getCartesian(i)}function Pm(t){return"x"===t.dim?0:1}function Nm(t){return t.isHorizontal()?0:1}function Om(t,e){var i=t.getRect();return[i[kP[e]],i[kP[e]]+i[PP[e]]]}function Em(t,e,i){var n=new yM({shape:{x:t.x-10,y:t.y-10,width:0,height:t.height+20}});return To(n,{shape:{width:t.width+20,height:t.height+20}},e,i),n}function Rm(t,e,i){if(t.count())for(var n,o=e.coordinateSystem,a=e.getLayerSeries(),r=t.mapDimension("single"),s=t.mapDimension("value"),l=f(a,function(e){return f(e.indices,function(e){var i=o.dataToPoint(t.get(r,e));return i[1]=t.get(s,e),i})}),u=zm(l),h=u.y0,c=i/u.max,d=a.length,p=a[0].indices.length,g=0;ga&&(a=u),n.push(u)}for(var h=0;ha&&(a=d)}return r.y0=o,r.max=a,r}function Bm(t){var e=0;d(t.children,function(t){Bm(t);var i=t.value;y(i)&&(i=i[0]),e+=i});var i=t.value;y(i)&&(i=i[0]),(null==i||isNaN(i))&&(i=e),i<0&&(i=0),y(t.value)?t.value[0]=i:t.value=i}function Vm(t,e,i){function n(){r.ignore=r.hoverIgnore}function o(){r.ignore=r.normalIgnore}tb.call(this);var a=new hM({z2:zP});a.seriesIndex=e.seriesIndex;var r=new rM({z2:BP,silent:t.getModel("label").get("silent")});this.add(a),this.add(r),this.updateData(!0,t,"normal",e,i),this.on("emphasis",n).on("normal",o).on("mouseover",n).on("mouseout",o)}function Gm(t,e,i){var n=t.getVisual("color"),o=t.getVisual("visualMeta");o&&0!==o.length||(n=null);var a=t.getModel("itemStyle").get("color");if(a)return a;if(n)return n;if(0===t.depth)return i.option.color[0];var r=i.option.color.length;return a=i.option.color[Fm(t)%r]}function Fm(t){for(var e=t;e.depth>1;)e=e.parentNode;return l(t.getAncestors()[0].children,e)}function Wm(t,e,i){return i!==RP.NONE&&(i===RP.SELF?t===e:i===RP.ANCESTOR?t===e||t.isAncestorOf(e):t===e||t.isDescendantOf(e))}function Hm(t,e,i){e.getData().setItemVisual(t.dataIndex,"color",i)}function Zm(t,e){var i=t.children||[];t.children=Um(i,e),i.length&&d(t.children,function(t){Zm(t,e)})}function Um(t,e){if("function"==typeof e)return t.sort(e);var i="asc"===e;return t.sort(function(t,e){var n=(t.getValue()-e.getValue())*(i?1:-1);return 0===n?(t.dataIndex-e.dataIndex)*(i?-1:1):n})}function Xm(t,e){return e=e||[0,0],f(["x","y"],function(i,n){var o=this.getAxis(i),a=e[n],r=t[n]/2;return"category"===o.type?o.getBandWidth():Math.abs(o.dataToCoord(a-r)-o.dataToCoord(a+r))},this)}function jm(t,e){return e=e||[0,0],f([0,1],function(i){var n=e[i],o=t[i]/2,a=[],r=[];return a[i]=n-o,r[i]=n+o,a[1-i]=r[1-i]=e[1-i],Math.abs(this.dataToPoint(a)[i]-this.dataToPoint(r)[i])},this)}function Ym(t,e){var i=this.getAxis(),n=e instanceof Array?e[0]:e,o=(t instanceof Array?t[0]:t)/2;return"category"===i.type?i.getBandWidth():Math.abs(i.dataToCoord(n-o)-i.dataToCoord(n+o))}function qm(t,e){return f(["Radius","Angle"],function(i,n){var o=this["get"+i+"Axis"](),a=e[n],r=t[n]/2,s="dataTo"+i,l="category"===o.type?o.getBandWidth():Math.abs(o[s](a-r)-o[s](a+r));return"Angle"===i&&(l=l*Math.PI/180),l},this)}function Km(t){var e,i=t.type;if("path"===i){var n=t.shape,o=null!=n.width&&null!=n.height?{x:n.x||0,y:n.y||0,width:n.width,height:n.height}:null,a=lv(n);(e=Xn(a,null,o,n.layout||"center")).__customPathData=a}else"image"===i?(e=new fi({})).__customImagePath=t.style.image:"text"===i?(e=new rM({})).__customText=t.style.text:e=new(0,zM[i.charAt(0).toUpperCase()+i.slice(1)]);return e.__customGraphicType=i,e.name=t.name,e}function $m(t,e,n,o,a,r,s){var l={},u=n.style||{};if(n.shape&&(l.shape=i(n.shape)),n.position&&(l.position=n.position.slice()),n.scale&&(l.scale=n.scale.slice()),n.origin&&(l.origin=n.origin.slice()),n.rotation&&(l.rotation=n.rotation),"image"===t.type&&n.style){h=l.style={};d(["x","y","width","height"],function(e){Jm(e,h,u,t.style,r)})}if("text"===t.type&&n.style){var h=l.style={};d(["x","y"],function(e){Jm(e,h,u,t.style,r)}),!u.hasOwnProperty("textFill")&&u.fill&&(u.textFill=u.fill),!u.hasOwnProperty("textStroke")&&u.stroke&&(u.textStroke=u.stroke)}if("group"!==t.type&&(t.useStyle(u),r)){t.style.opacity=0;var c=u.opacity;null==c&&(c=1),To(t,{style:{opacity:c}},o,e)}r?t.attr(l):Io(t,l,o,e),n.hasOwnProperty("z2")&&t.attr("z2",n.z2||0),n.hasOwnProperty("silent")&&t.attr("silent",n.silent),n.hasOwnProperty("invisible")&&t.attr("invisible",n.invisible),n.hasOwnProperty("ignore")&&t.attr("ignore",n.ignore),n.hasOwnProperty("info")&&t.attr("info",n.info);var f=n.styleEmphasis,p=!1===f;t.__cusHasEmphStl&&null==f||!t.__cusHasEmphStl&&p||(ro(t,f),t.__cusHasEmphStl=!p),s&&po(t,!p)}function Jm(t,e,i,n,o){null==i[t]||o||(e[t]=i[t],i[t]=n[t])}function Qm(t,e,i,n){function o(t){null==t&&(t=h),v&&(c=e.getItemModel(t),d=c.getModel(UP),f=c.getModel(XP),p=e.getItemVisual(t,"color"),v=!1)}var s=t.get("renderItem"),l=t.coordinateSystem,u={};l&&(u=l.prepareCustoms?l.prepareCustoms():YP[l.type](l));var h,c,d,f,p,g=r({getWidth:n.getWidth,getHeight:n.getHeight,getZr:n.getZr,getDevicePixelRatio:n.getDevicePixelRatio,value:function(t,i){return null==i&&(i=h),e.get(e.getDimension(t||0),i)},style:function(i,n){null==n&&(n=h),o(n);var r=c.getModel(HP).getItemStyle();null!=p&&(r.fill=p);var s=e.getItemVisual(n,"opacity");return null!=s&&(r.opacity=s),mo(r,d,null,{autoColor:p,isRectText:!0}),r.text=d.getShallow("show")?A(t.getFormattedLabel(n,"normal"),_u(e,n)):null,i&&a(r,i),r},styleEmphasis:function(i,n){null==n&&(n=h),o(n);var r=c.getModel(ZP).getItemStyle();return mo(r,f,null,{isRectText:!0},!0),r.text=f.getShallow("show")?D(t.getFormattedLabel(n,"emphasis"),t.getFormattedLabel(n,"normal"),_u(e,n)):null,i&&a(r,i),r},visual:function(t,i){return null==i&&(i=h),e.getItemVisual(i,t)},barLayout:function(t){if(l.getBaseAxis)return Ll(r({axis:l.getBaseAxis()},t),n)},currentSeriesIndices:function(){return i.getCurrentSeriesIndices()},font:function(t){return So(t,i)}},u.api||{}),m={context:{},seriesId:t.id,seriesName:t.name,seriesIndex:t.seriesIndex,coordSys:u.coordSys,dataInsideLength:e.count(),encode:tv(t.getData())},v=!0;return function(t,i){return h=t,v=!0,s&&s(r({dataIndexInside:t,dataIndex:e.getRawIndex(t),actionType:i?i.type:null},m),g)}}function tv(t){var e={};return d(t.dimensions,function(i,n){var o=t.getDimensionInfo(i);if(!o.isExtraCoord){var a=o.coordDim;(e[a]=e[a]||[])[o.coordDimIndex]=n}}),e}function ev(t,e,i,n,o,a){return(t=iv(t,e,i,n,o,a,!0))&&a.setItemGraphicEl(e,t),t}function iv(t,e,i,n,o,a,r){var s=!i,l=(i=i||{}).type,u=i.shape,h=i.style;if(t&&(s||null!=l&&l!==t.__customGraphicType||"path"===l&&uv(u)&&lv(u)!==t.__customPathData||"image"===l&&hv(h,"image")&&h.image!==t.__customImagePath||"text"===l&&hv(u,"text")&&h.text!==t.__customText)&&(o.remove(t),t=null),!s){var c=!t;return!t&&(t=Km(i)),$m(t,e,i,n,a,c,r),"group"===l&&nv(t,e,i,n,a),o.add(t),t}}function nv(t,e,i,n,o){var a=i.children,r=a?a.length:0,s=i.$mergeChildren,l="byName"===s||i.diffChildrenByName,u=!1===s;if(r||l||u)if(l)ov({oldChildren:t.children()||[],newChildren:a||[],dataIndex:e,animatableModel:n,group:t,data:o});else{u&&t.removeAll();for(var h=0;hn?t-=l+a:t+=a),null!=r&&(e+u+r>o?e-=u+r:e+=r),[t,e]}function Ov(t,e,i,n,o){var a=i.getOuterSize(),r=a.width,s=a.height;return t=Math.min(t+r,n)-r,e=Math.min(e+s,o)-s,t=Math.max(t,0),e=Math.max(e,0),[t,e]}function Ev(t,e,i){var n=i[0],o=i[1],a=0,r=0,s=e.width,l=e.height;switch(t){case"inside":a=e.x+s/2-n/2,r=e.y+l/2-o/2;break;case"top":a=e.x+s/2-n/2,r=e.y-o-5;break;case"bottom":a=e.x+s/2-n/2,r=e.y+l+5;break;case"left":a=e.x-n-5,r=e.y+l/2-o/2;break;case"right":a=e.x+s+5,r=e.y+l/2-o/2}return[a,r]}function Rv(t){return"center"===t||"middle"===t}function zv(t){return t.get("stack")||"__ec_stack_"+t.seriesIndex}function Bv(t){return t.dim}function Vv(t,e){var i={};d(t,function(t,e){var n=t.getData(),o=t.coordinateSystem.getBaseAxis(),a=o.getExtent(),r="category"===o.type?o.getBandWidth():Math.abs(a[1]-a[0])/n.count(),s=i[Bv(o)]||{bandWidth:r,remainedWidth:r,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},l=s.stacks;i[Bv(o)]=s;var u=zv(t);l[u]||s.autoWidthCount++,l[u]=l[u]||{width:0,maxWidth:0};var h=Vo(t.get("barWidth"),r),c=Vo(t.get("barMaxWidth"),r),d=t.get("barGap"),f=t.get("barCategoryGap");h&&!l[u].width&&(h=Math.min(s.remainedWidth,h),l[u].width=h,s.remainedWidth-=h),c&&(l[u].maxWidth=c),null!=d&&(s.gap=d),null!=f&&(s.categoryGap=f)});var n={};return d(i,function(t,e){n[e]={};var i=t.stacks,o=t.bandWidth,a=Vo(t.categoryGap,o),r=Vo(t.gap,1),s=t.remainedWidth,l=t.autoWidthCount,u=(s-a)/(l+(l-1)*r);u=Math.max(u,0),d(i,function(t,e){var i=t.maxWidth;i&&ie[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 jv(t){return t.getRadiusAxis().inverse?0:1}function Yv(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()}function qv(t,e,i){return{position:[t.cx,t.cy],rotation:i/180*Math.PI,labelDirection:-1,tickDirection:-1,nameDirection:1,labelRotate:e.getModel("axisLabel").get("rotate"),z2:1}}function Kv(t,e,i,n,o){var a=e.axis,r=a.dataToCoord(t),s=n.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l,u,h,c=n.getRadiusAxis().getExtent();if("radius"===a.dim){var d=xt();Mt(d,d,s),St(d,d,[n.cx,n.cy]),l=Do([r,-o],d);var f=e.getModel("axisLabel").get("rotate")||0,p=FD.innerTextLayout(s,f*Math.PI/180,-1);u=p.textAlign,h=p.textVerticalAlign}else{var g=c[1];l=n.coordToPoint([g+o,r]);var m=n.cx,v=n.cy;u=Math.abs(l[0]-m)/g<.3?"center":l[0]>m?"left":"right",h=Math.abs(l[1]-v)/g<.3?"middle":l[1]>v?"top":"bottom"}return{position:l,align:u,verticalAlign:h}}function $v(t,e){e.update="updateView",Es(e,function(e,i){var n={};return i.eachComponent({mainType:"geo",query:e},function(i){i[t](e.name),d(i.coordinateSystem.regions,function(t){n[t.name]=i.isSelected(t.name)||!1})}),{selected:n,name:e.name}})}function Jv(t){var e={};d(t,function(t){e[t]=1}),t.length=0,d(e,function(e,i){t.push(i)})}function Qv(t){if(t)for(var e in t)if(t.hasOwnProperty(e))return!0}function ty(t,e,n){function o(){var t=function(){};return t.prototype.__hidden=t.prototype,new t}var a={};return MN(e,function(e){var r=a[e]=o();MN(t[e],function(t,o){if(hL.isValidType(o)){var a={type:o,visual:t};n&&n(a,e),r[o]=new hL(a),"opacity"===o&&((a=i(a)).type="colorAlpha",r.__hidden.__alphaForOpacity=new hL(a))}})}),a}function ey(t,e,n){var o;d(n,function(t){e.hasOwnProperty(t)&&Qv(e[t])&&(o=!0)}),o&&d(n,function(n){e.hasOwnProperty(n)&&Qv(e[n])?t[n]=i(e[n]):delete t[n]})}function iy(t,e,i,n,o,a){function r(t){return i.getItemVisual(h,t)}function s(t,e){i.setItemVisual(h,t,e)}function l(t,l){h=null==a?t:l;var c=i.getRawDataItem(h);if(!c||!1!==c.visualMap)for(var d=n.call(o,t),f=e[d],p=u[d],g=0,m=p.length;g1)return!1;var h=uy(i-t,o-t,n-e,a-e)/l;return!(h<0||h>1)}function ly(t){return t<=1e-6&&t>=-1e-6}function uy(t,e,i,n){return t*n-e*i}function hy(t,e,i){var n=this._targetInfoList=[],o={},a=dy(e,t);TN(PN,function(t,e){(!i||!i.include||AN(i.include,e)>=0)&&t(a,n,o)})}function cy(t){return t[0]>t[1]&&t.reverse(),t}function dy(t,e){return Vi(t,e,{includeMainTypes:LN})}function fy(t,e,i,n){var o=i.getAxis(["x","y"][t]),a=cy(f([0,1],function(t){return e?o.coordToData(o.toLocalCoord(n[t])):o.toGlobalCoord(o.dataToCoord(n[t]))})),r=[];return r[t]=a,r[1-t]=[NaN,NaN],{values:a,xyMinMax:r}}function py(t,e,i,n){return[e[0]-n[t]*i[0],e[1]-n[t]*i[1]]}function gy(t,e){var i=my(t),n=my(e),o=[i[0]/n[0],i[1]/n[1]];return isNaN(o[0])&&(o[0]=1),isNaN(o[1])&&(o[1]=1),o}function my(t){return t?[t[0][1]-t[0][0],t[1][1]-t[1][0]]:[NaN,NaN]}function vy(t,e,i,n,o){if(o){var a=t.getZr();a[VN]||(a[BN]||(a[BN]=yy),Nr(a,BN,i,e)(t,n))}}function yy(t,e){if(!t.isDisposed()){var i=t.getZr();i[VN]=!0,t.dispatchAction({type:"brushSelect",batch:e}),i[VN]=!1}}function xy(t,e,i,n){for(var o=0,a=e.length;o=0}function Ny(t,e,i){function n(t,e){return l(e.nodes,t)>=0}function o(t,n){var o=!1;return e(function(e){d(i(t,e)||[],function(t){n.records[e.name][t]&&(o=!0)})}),o}function a(t,n){n.nodes.push(t),e(function(e){d(i(t,e)||[],function(t){n.records[e.name][t]=!0})})}return function(i){var r={nodes:[],records:{}};if(e(function(t){r.records[t.name]={}}),!i)return r;a(i,r);var s;do{s=!1,t(function(t){!n(t,r)&&o(t,r)&&(a(t,r),s=!0)})}while(s);return r}}function Oy(t,e,i){var n=[1/0,-1/0];return $N(i,function(t){var i=t.getData();i&&$N(i.mapDimension(e,!0),function(t){var e=i.getApproximateExtent(t);e[0]n[1]&&(n[1]=e[1])})}),n[1]0?0:NaN);var r=i.getMax(!0);return null!=r&&"dataMax"!==r&&"function"!=typeof r?e[1]=r:o&&(e[1]=a>0?a-1:NaN),i.get("scale",!0)||(e[0]>0&&(e[0]=0),e[1]<0&&(e[1]=0)),e}function Ry(t,e){var i=t.getAxisModel(),n=t._percentWindow,o=t._valueWindow;if(n){var a=Zo(o,[0,500]);a=Math.min(a,20);var r=e||0===n[0]&&100===n[1];i.setRange(r?null:+o[0].toFixed(a),r?null:+o[1].toFixed(a))}}function zy(t){var e=t._minMaxSpan={},i=t._dataZoomModel;$N(["min","max"],function(n){e[n+"Span"]=i.get(n+"Span");var o=i.get(n+"ValueSpan");if(null!=o&&(e[n+"ValueSpan"]=o,null!=(o=t.getAxisModel().axis.scale.parse(o)))){var a=t._dataExtent;e[n+"Span"]=Bo(a[0]+o,a,[0,100],!0)}})}function By(t){var e={};return tO(["start","end","startValue","endValue","throttle"],function(i){t.hasOwnProperty(i)&&(e[i]=t[i])}),e}function Vy(t,e){var i=t._rangePropMode,n=t.get("rangeMode");tO([["start","startValue"],["end","endValue"]],function(t,o){var a=null!=e[t[0]],r=null!=e[t[1]];a&&!r?i[o]="percent":!a&&r?i[o]="value":n?i[o]=n[o]:a&&(i[o]="percent")})}function Gy(t){return{x:"y",y:"x",radius:"angle",angle:"radius"}[t]}function Fy(t){return"vertical"===t?"ns-resize":"ew-resize"}function Wy(t,e){var i=Uy(t),n=e.dataZoomId,o=e.coordId;d(i,function(t,i){var a=t.dataZoomInfos;a[n]&&l(e.allCoordIds,o)<0&&(delete a[n],t.count--)}),jy(i);var a=i[o];a||((a=i[o]={coordId:o,dataZoomInfos:{},count:0}).controller=Xy(t,a),a.dispatchAction=v(Yy,t)),!a.dataZoomInfos[n]&&a.count++,a.dataZoomInfos[n]=e;var r=qy(a.dataZoomInfos);a.controller.enable(r.controlType,r.opt),a.controller.setPointerChecker(e.containsPoint),Nr(a,"dispatchAction",e.dataZoomModel.get("throttle",!0),"fixRate")}function Hy(t,e){var i=Uy(t);d(i,function(t){t.controller.dispose();var i=t.dataZoomInfos;i[e]&&(delete i[e],t.count--)}),jy(i)}function Zy(t){return t.type+"\0_"+t.id}function Uy(t){var e=t.getZr();return e[fO]||(e[fO]={})}function Xy(t,e){var i=new oc(t.getZr());return d(["pan","zoom","scrollMove"],function(t){i.on(t,function(i){var n=[];d(e.dataZoomInfos,function(o){if(i.isAvailableBehavior(o.dataZoomModel.option)){var a=(o.getRange||{})[t],r=a&&a(e.controller,i);!o.dataZoomModel.get("disabled",!0)&&r&&n.push({dataZoomId:o.dataZoomId,start:r[0],end:r[1]})}}),n.length&&e.dispatchAction(n)})}),i}function jy(t){d(t,function(e,i){e.count||(e.controller.dispose(),delete t[i])})}function Yy(t,e){t.dispatchAction({type:"dataZoom",batch:e})}function qy(t){var e,i={type_true:2,type_move:1,type_false:0,type_undefined:-1},n=!0;return d(t,function(t){var o=t.dataZoomModel,a=!o.get("disabled",!0)&&(!o.get("zoomLock",!0)||"move");i["type_"+a]>i["type_"+e]&&(e=a),n&=o.get("preventDefaultMouseMove",!0)}),{controlType:e,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!n}}}function Ky(t){return function(e,i,n,o){var a=this._range,r=a.slice(),s=e.axisModels[0];if(s){var l=t(r,s,e,i,n,o);return QL(l,r,[0,100],"all"),this._range=r,a[0]!==r[0]||a[1]!==r[1]?r:void 0}}}function $y(t,e){return t&&t.hasOwnProperty&&t.hasOwnProperty(e)}function Jy(t,e,i,n){for(var o=e.targetVisuals[n],a=hL.prepareVisualTypes(o),r={color:t.getData().getVisual("color")},s=0,l=a.length;s=0&&(r[a]=+r[a].toFixed(h)),r}function fx(t,e){var n=t.getData(),o=t.coordinateSystem;if(e&&!cx(e)&&!y(e.coord)&&o){var a=o.dimensions,r=px(e,n,o,t);if((e=i(e)).type&&YO[e.type]&&r.baseAxis&&r.valueAxis){var s=XO(a,r.baseAxis.dim),l=XO(a,r.valueAxis.dim);e.coord=YO[e.type](n,r.baseDataDim,r.valueDataDim,s,l),e.value=e.coord[l]}else{for(var u=[null!=e.xAxis?e.xAxis:e.radiusAxis,null!=e.yAxis?e.yAxis:e.angleAxis],h=0;h<2;h++)YO[u[h]]&&(u[h]=yx(n,n.mapDimension(a[h]),u[h]));e.coord=u}}return e}function px(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(gx(n,o.valueDataDim)),o.baseAxis=i.getOtherAxis(o.valueAxis),o.baseDataDim=e.mapDimension(o.baseAxis.dim)):(o.baseAxis=n.getBaseAxis(),o.valueAxis=i.getOtherAxis(o.baseAxis),o.baseDataDim=e.mapDimension(o.baseAxis.dim),o.valueDataDim=e.mapDimension(o.valueAxis.dim)),o}function gx(t,e){var i=t.getData(),n=i.dimensions;e=i.getDimension(e);for(var o=0;o=0)return!0}function Yx(t){for(var e=t.split(/\n+/g),i=[],n=f(Xx(e.shift()).split(pE),function(t){return{name:t,data:[]}}),o=0;o=0&&!i[o][n];o--);if(o<0){var a=t.queryComponents({mainType:"dataZoom",subType:"select",id:n})[0];if(a){var r=a.getPercentRange();i[0][n]={dataZoomId:n,start:r[0],end:r[1]}}}}),i.push(e)}function t_(t){var e=n_(t),i=e[e.length-1];e.length>1&&e.pop();var n={};return gE(i,function(t,i){for(var o=e.length-1;o>=0;o--)if(t=e[o][i]){n[i]=t;break}}),n}function e_(t){t[mE]=null}function i_(t){return n_(t).length}function n_(t){var e=t[mE];return e||(e=t[mE]=[{}]),e}function o_(t,e,i){(this._brushController=new zf(i.getZr())).on("brush",m(this._onBrush,this)).mount(),this._isZoomActive}function a_(t){var e={};return d(["xAxisIndex","yAxisIndex"],function(i){e[i]=t[i],null==e[i]&&(e[i]="all"),(!1===e[i]||"none"===e[i])&&(e[i]=[])}),e}function r_(t,e){t.setIconStatus("back",i_(e)>1?"emphasis":"normal")}function s_(t,e,i,n,o){var a=i._isZoomActive;n&&"takeGlobalCursor"===n.type&&(a="dataZoomSelect"===n.key&&n.dataZoomSelectActive),i._isZoomActive=a,t.setIconStatus("zoom",a?"emphasis":"normal");var r=new hy(a_(t.option),e,{include:["grid"]});i._brushController.setPanels(r.makePanelOpts(o,function(t){return t.xAxisDeclared&&!t.yAxisDeclared?"lineX":!t.xAxisDeclared&&t.yAxisDeclared?"lineY":"rect"})).enableBrush(!!a&&{brushType:"auto",brushStyle:{lineWidth:0,fill:"rgba(0,0,0,0.2)"}})}function l_(t){this.model=t}function u_(t){return SE(t)}function h_(){if(!TE&&AE){TE=!0;var t=AE.styleSheets;t.length<31?AE.createStyleSheet().addRule(".zrvml","behavior:url(#default#VML)"):t[0].addRule(".zrvml","behavior:url(#default#VML)")}}function c_(t){return parseInt(t,10)}function d_(t,e){h_(),this.root=t,this.storage=e;var i=document.createElement("div"),n=document.createElement("div");i.style.cssText="display:inline-block;overflow:hidden;position:relative;width:300px;height:150px;",n.style.cssText="position:absolute;left:0;top:0;",t.appendChild(i),this._vmlRoot=n,this._vmlViewport=i,this.resize();var o=e.delFromStorage,a=e.addToStorage;e.delFromStorage=function(t){o.call(e,t),t&&t.onRemove&&t.onRemove(n)},e.addToStorage=function(t){t.onAdd&&t.onAdd(n),a.call(e,t)},this._firstPaint=!0}function f_(t){return function(){Yw('In IE8.0 VML mode painter not support method "'+t+'"')}}function p_(t){return document.createElementNS(sR,t)}function g_(t){return cR(1e4*t)/1e4}function m_(t){return t-vR}function v_(t,e){var i=e?t.textFill:t.fill;return null!=i&&i!==hR}function y_(t,e){var i=e?t.textStroke:t.stroke;return null!=i&&i!==hR}function x_(t,e){e&&__(t,"transform","matrix("+uR.call(e,",")+")")}function __(t,e,i){(!i||"linear"!==i.type&&"radial"!==i.type)&&t.setAttribute(e,i)}function w_(t,e,i){t.setAttributeNS("http://www.w3.org/1999/xlink",e,i)}function b_(t,e,i,n){if(v_(e,i)){var o=i?e.textFill:e.fill;o="transparent"===o?hR:o,"none"!==t.getAttribute("clip-path")&&o===hR&&(o="rgba(0, 0, 0, 0.002)"),__(t,"fill",o),__(t,"fill-opacity",null!=e.fillOpacity?e.fillOpacity*e.opacity:e.opacity)}else __(t,"fill",hR);if(y_(e,i)){var a=i?e.textStroke:e.stroke;__(t,"stroke",a="transparent"===a?hR:a),__(t,"stroke-width",(i?e.textStrokeWidth:e.lineWidth)/(!i&&e.strokeNoScale?n.getLineScale():1)),__(t,"paint-order",i?"stroke":"fill"),__(t,"stroke-opacity",null!=e.strokeOpacity?e.strokeOpacity:e.opacity),e.lineDash?(__(t,"stroke-dasharray",e.lineDash.join(",")),__(t,"stroke-dashoffset",cR(e.lineDashOffset||0))):__(t,"stroke-dasharray",""),e.lineCap&&__(t,"stroke-linecap",e.lineCap),e.lineJoin&&__(t,"stroke-linejoin",e.lineJoin),e.miterLimit&&__(t,"stroke-miterlimit",e.miterLimit)}else __(t,"stroke",hR)}function S_(t){for(var e=[],i=t.data,n=t.len(),o=0;o=gR||!m_(g)&&(d>-pR&&d<0||d>pR)==!!p;var y=g_(s+u*fR(c)),x=g_(l+h*dR(c));m&&(d=p?gR-1e-4:1e-4-gR,v=!0,9===o&&e.push("M",y,x));var _=g_(s+u*fR(c+d)),w=g_(l+h*dR(c+d));e.push("A",g_(u),g_(h),cR(f*mR),+v,+p,_,w);break;case lR.Z:a="Z";break;case lR.R:var _=g_(i[o++]),w=g_(i[o++]),b=g_(i[o++]),S=g_(i[o++]);e.push("M",_,w,"L",_+b,w,"L",_+b,w+S,"L",_,w+S,"L",_,w)}a&&e.push(a);for(var M=0;M=11),domSupported:"undefined"!=typeof document}}(navigator.userAgent),X_={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},j_={"[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},Y_=Object.prototype.toString,q_=Array.prototype,K_=q_.forEach,$_=q_.filter,J_=q_.slice,Q_=q_.map,tw=q_.reduce,ew={},iw=function(){return ew.createCanvas()};ew.createCanvas=function(){return document.createElement("canvas")};var nw,ow="__ec_primitive__";E.prototype={constructor:E,get:function(t){return this.data.hasOwnProperty(t)?this.data[t]:null},set:function(t,e){return this.data[t]=e},each:function(t,e){void 0!==e&&(t=m(t,e));for(var i in this.data)this.data.hasOwnProperty(i)&&t(this.data[i],i)},removeKey:function(t){delete this.data[t]}};var aw=(Object.freeze||Object)({$override:e,clone:i,merge:n,mergeAll:o,extend:a,defaults:r,createCanvas:iw,getContext:s,indexOf:l,inherits:u,mixin:h,isArrayLike:c,each:d,map:f,reduce:p,filter:g,find:function(t,e,i){if(t&&e)for(var n=0,o=t.length;n3&&(n=dw.call(n,1));for(var a=e.length,r=0;r4&&(n=dw.call(n,1,n.length-1));for(var a=n[n.length-1],r=e.length,s=0;s1&&n&&n.length>1){var a=ft(n)/ft(o);!isFinite(a)&&(a=1),e.pinchScale=a;var r=pt(n);return e.pinchX=r[0],e.pinchY=r[1],{type:"pinch",target:t[0].target,event:e}}}}},xw="silent";vt.prototype.dispose=function(){};var _w=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],ww=function(t,e,i,n){fw.call(this),this.storage=t,this.painter=e,this.painterRoot=n,i=i||new vt,this.proxy=null,this._hovered={},this._lastTouchMoment,this._lastX,this._lastY,this._gestureMgr,it.call(this),this.setHandlerProxy(i)};ww.prototype={constructor:ww,setHandlerProxy:function(t){this.proxy&&this.proxy.dispose(),t&&(d(_w,function(e){t.on&&t.on(e,this[e],this)},this),t.handler=this),this.proxy=t},mousemove:function(t){var e=t.zrX,i=t.zrY,n=this._hovered,o=n.target;o&&!o.__zr&&(o=(n=this.findHover(n.x,n.y)).target);var a=this._hovered=this.findHover(e,i),r=a.target,s=this.proxy;s.setCursor&&s.setCursor(r?r.cursor:"default"),o&&r!==o&&this.dispatchToElement(n,"mouseout",t),this.dispatchToElement(a,"mousemove",t),r&&r!==o&&this.dispatchToElement(a,"mouseover",t)},mouseout:function(t){this.dispatchToElement(this._hovered,"mouseout",t);var e,i=t.toElement||t.relatedTarget;do{i=i&&i.parentNode}while(i&&9!==i.nodeType&&!(e=i===this.painterRoot));!e&&this.trigger("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=gt(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;a>=0;a--){var r;if(n[a]!==i&&!n[a].ignore&&(r=yt(n[a],t,e))&&(!o.topTarget&&(o.topTarget=n[a]),r!==xw)){o.target=n[a];break}}return o},processGesture:function(t,e){this._gestureMgr||(this._gestureMgr=new vw);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)}}},d(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(t){ww.prototype[t]=function(e){var i=this.findHover(e.zrX,e.zrY),n=i.target;if("mousedown"===t)this._downEl=n,this._downPoint=[e.zrX,e.zrY],this._upEl=n;else if("mouseup"===t)this._upEl=n;else if("click"===t){if(this._downEl!==this._upEl||!this._downPoint||uw(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(i,t,e)}}),h(ww,fw),h(ww,it);var bw="undefined"==typeof Float32Array?Array:Float32Array,Sw=(Object.freeze||Object)({create:xt,identity:_t,copy:wt,mul:bt,translate:St,rotate:Mt,scale:It,invert:Tt,clone:At}),Mw=_t,Iw=5e-5,Tw=function(t){(t=t||{}).position||(this.position=[0,0]),null==t.rotation&&(this.rotation=0),t.scale||(this.scale=[1,1]),this.origin=this.origin||null},Aw=Tw.prototype;Aw.transform=null,Aw.needLocalTransform=function(){return Dt(this.rotation)||Dt(this.position[0])||Dt(this.position[1])||Dt(this.scale[0]-1)||Dt(this.scale[1]-1)};var Dw=[];Aw.updateTransform=function(){var t=this.parent,e=t&&t.transform,i=this.needLocalTransform(),n=this.transform;if(i||e){n=n||xt(),i?this.getLocalTransform(n):Mw(n),e&&(i?bt(n,t.transform,n):wt(n,t.transform)),this.transform=n;var o=this.globalScaleRatio;if(null!=o&&1!==o){this.getGlobalScale(Dw);var a=Dw[0]<0?-1:1,r=Dw[1]<0?-1:1,s=((Dw[0]-a)*o+a)/Dw[0]||0,l=((Dw[1]-r)*o+r)/Dw[1]||0;n[0]*=s,n[1]*=s,n[2]*=l,n[3]*=l}this.invTransform=this.invTransform||xt(),Tt(this.invTransform,n)}else n&&Mw(n)},Aw.getLocalTransform=function(t){return Tw.getLocalTransform(this,t)},Aw.setTransform=function(t){var e=this.transform,i=t.dpr||1;e?t.setTransform(i*e[0],i*e[1],i*e[2],i*e[3],i*e[4],i*e[5]):t.setTransform(i,0,0,i,0,0)},Aw.restoreTransform=function(t){var e=t.dpr||1;t.setTransform(e,0,0,e,0,0)};var Cw=[],Lw=xt();Aw.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],i=t[2]*t[2]+t[3]*t[3],n=this.position,o=this.scale;Dt(e-1)&&(e=Math.sqrt(e)),Dt(i-1)&&(i=Math.sqrt(i)),t[0]<0&&(e=-e),t[3]<0&&(i=-i),n[0]=t[4],n[1]=t[5],o[0]=e,o[1]=i,this.rotation=Math.atan2(-t[1]/i,t[0]/e)}},Aw.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(bt(Cw,t.invTransform,e),e=Cw);var i=this.origin;i&&(i[0]||i[1])&&(Lw[4]=i[0],Lw[5]=i[1],bt(Cw,e,Lw),Cw[4]-=i[0],Cw[5]-=i[1],e=Cw),this.setLocalTransform(e)}},Aw.getGlobalScale=function(t){var e=this.transform;return t=t||[],e?(t[0]=Math.sqrt(e[0]*e[0]+e[1]*e[1]),t[1]=Math.sqrt(e[2]*e[2]+e[3]*e[3]),e[0]<0&&(t[0]=-t[0]),e[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},Aw.transformCoordToLocal=function(t,e){var i=[t,e],n=this.invTransform;return n&&Q(i,i,n),i},Aw.transformCoordToGlobal=function(t,e){var i=[t,e],n=this.transform;return n&&Q(i,i,n),i},Tw.getLocalTransform=function(t,e){Mw(e=e||[]);var i=t.origin,n=t.scale||[1,1],o=t.rotation||0,a=t.position||[0,0];return i&&(e[4]-=i[0],e[5]-=i[1]),It(e,e,n),o&&Mt(e,e,o),i&&(e[4]+=i[0],e[5]+=i[1]),e[4]+=a[0],e[5]+=a[1],e};var kw={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return.5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return 0===t?0:Math.pow(1024,t-1)},exponentialOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},elasticOut:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},elasticInOut:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),(t*=2)<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-kw.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?.5*kw.bounceIn(2*t):.5*kw.bounceOut(2*t-1)+.5}};Ct.prototype={constructor:Ct,step:function(t,e){if(this._initialized||(this._startTime=t+this._delay,this._initialized=!0),this._paused)this._pausedTime+=e;else{var i=(t-this._startTime-this._pausedTime)/this._life;if(!(i<0)){i=Math.min(i,1);var n=this.easing,o="string"==typeof n?kw[n]:n,a="function"==typeof o?o(i):i;return this.fire("frame",a),1===i?this.loop?(this.restart(t),"restart"):(this._needsRemove=!0,"destroy"):null}}},restart:function(t){var e=(t-this._startTime-this._pausedTime)%this._life;this._startTime=t-e+this.gap,this._pausedTime=0,this._needsRemove=!1},fire:function(t,e){this[t="on"+t]&&this[t](this._target,e)},pause:function(){this._paused=!0},resume:function(){this._paused=!1}};var Pw=function(){this.head=null,this.tail=null,this._len=0},Nw=Pw.prototype;Nw.insert=function(t){var e=new Ow(t);return this.insertEntry(e),e},Nw.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},Nw.remove=function(t){var e=t.prev,i=t.next;e?e.next=i:this.head=i,i?i.prev=e:this.tail=e,t.next=t.prev=null,this._len--},Nw.len=function(){return this._len},Nw.clear=function(){this.head=this.tail=null,this._len=0};var Ow=function(t){this.value=t,this.next,this.prev},Ew=function(t){this._list=new Pw,this._map={},this._maxSize=t||10,this._lastRemovedEntry=null},Rw=Ew.prototype;Rw.put=function(t,e){var i=this._list,n=this._map,o=null;if(null==n[t]){var a=i.len(),r=this._lastRemovedEntry;if(a>=this._maxSize&&a>0){var s=i.head;i.remove(s),delete n[s.key],o=s.value,this._lastRemovedEntry=s}r?r.value=e:r=new Ow(e),r.key=t,i.insertEntry(r),n[t]=r}return o},Rw.get=function(t){var e=this._map[t],i=this._list;if(null!=e)return e!==i.tail&&(i.remove(e),i.insertEntry(e)),e.value},Rw.clear=function(){this._list.clear(),this._map={}};var zw={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]},Bw=new Ew(20),Vw=null,Gw=Ut,Fw=Xt,Ww=(Object.freeze||Object)({parse:Gt,lift:Ht,toHex:Zt,fastLerp:Ut,fastMapToColor:Gw,lerp:Xt,mapToColor:Fw,modifyHSL:jt,modifyAlpha:Yt,stringify:qt}),Hw=Array.prototype.slice,Zw=function(t,e,i,n){this._tracks={},this._target=t,this._loop=e||!1,this._getter=i||Kt,this._setter=n||$t,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};Zw.prototype={when:function(t,e){var i=this._tracks;for(var n in e)if(e.hasOwnProperty(n)){if(!i[n]){i[n]=[];var o=this._getter(this._target,n);if(null==o)continue;0!==t&&i[n].push({time:0,value:ae(o)})}i[n].push({time:t,value:e[n]})}return this},during:function(t){return this._onframeList.push(t),this},pause:function(){for(var t=0;t=i.x&&t<=i.x+i.width&&e>=i.y&&e<=i.y+i.height},clone:function(){return new de(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}}},de.create=function(t){return new de(t.x,t.y,t.width,t.height)};var tb=function(t){t=t||{},Kw.call(this,t);for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);this._children=[],this.__storage=null,this.__dirty=!0};tb.prototype={constructor:tb,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=0&&(i.splice(n,0,t),this._doAdd(t))}return this},_doAdd:function(t){t.parent&&t.parent.remove(t),t.parent=this;var e=this.__storage,i=this.__zr;e&&e!==t.__storage&&(e.addToStorage(t),t instanceof tb&&t.addChildrenToStorage(e)),i&&i.refresh()},remove:function(t){var e=this.__zr,i=this.__storage,n=this._children,o=l(n,t);return o<0?this:(n.splice(o,1),t.parent=null,i&&(i.delFromStorage(t),t instanceof tb&&t.delChildrenFromStorage(i)),e&&e.refresh(),this)},removeAll:function(){var t,e,i=this._children,n=this.__storage;for(e=0;e=0&&(this.delFromStorage(t),this._roots.splice(o,1),t instanceof tb&&t.delChildrenFromStorage(this))}},addToStorage:function(t){return t&&(t.__storage=this,t.dirty(!1)),this},delFromStorage:function(t){return t&&(t.__storage=null),this},dispose:function(){this._renderList=this._roots=null},displayableSortFunc:we};var ob={shadowBlur:1,shadowOffsetX:1,shadowOffsetY:1,textShadowBlur:1,textShadowOffsetX:1,textShadowOffsetY:1,textBoxShadowBlur:1,textBoxShadowOffsetX:1,textBoxShadowOffsetY:1},ab=function(t,e,i){return ob.hasOwnProperty(e)?i*=t.dpr:i},rb={NONE:0,STYLE_BIND:1,PLAIN_TEXT:2},sb=9,lb=[["shadowBlur",0],["shadowOffsetX",0],["shadowOffsetY",0],["shadowColor","#000"],["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]],ub=function(t){this.extendFrom(t,!1)};ub.prototype={constructor:ub,fill:"#000",stroke:null,opacity:1,fillOpacity:null,strokeOpacity:null,lineDash:null,lineDashOffset:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,lineWidth:1,strokeNoScale:!1,text:null,font:null,textFont:null,fontStyle:null,fontWeight:null,fontSize:null,fontFamily:null,textTag:null,textFill:"#000",textStroke:null,textWidth:null,textHeight:null,textStrokeWidth:0,textLineHeight:null,textPosition:"inside",textRect:null,textOffset:null,textAlign:null,textVerticalAlign:null,textDistance:5,textShadowColor:"transparent",textShadowBlur:0,textShadowOffsetX:0,textShadowOffsetY:0,textBoxShadowColor:"transparent",textBoxShadowBlur:0,textBoxShadowOffsetX:0,textBoxShadowOffsetY:0,transformText:!1,textRotation:0,textOrigin:null,textBackgroundColor:null,textBorderColor:null,textBorderWidth:0,textBorderRadius:0,textPadding:null,rich:null,truncate:null,blend:null,bind:function(t,e,i){var n=this,o=i&&i.style,a=!o||t.__attrCachedBy!==rb.STYLE_BIND;t.__attrCachedBy=rb.STYLE_BIND;for(var r=0;r0},extendFrom:function(t,e){if(t)for(var i in t)!t.hasOwnProperty(i)||!0!==e&&(!1===e?this.hasOwnProperty(i):null==t[i])||(this[i]=t[i])},set:function(t,e){"string"==typeof t?this[t]=e:this.extendFrom(t,!0)},clone:function(){var t=new this.constructor;return t.extendFrom(this,!0),t},getGradient:function(t,e,i){for(var n=("radial"===e.type?Se:be)(t,e,i),o=e.colorStops,a=0;a=0&&i.splice(n,1),t.__hoverMir=null},clearHover:function(t){for(var e=this._hoverElements,i=0;i15)break}s.__drawIndex=m,s.__drawIndex0&&t>n[0]){for(r=0;rt);r++);a=i[n[r]]}if(n.splice(r+1,0,t),i[t]=e,!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 Yw("Layer of zlevel "+t+" is not valid")},eachLayer:function(t,e){var i,n,o=this._zlevelList;for(n=0;n0?.01:0),this._needsManuallyCompositing),a.__builtin__||Yw("ZLevel "+s+" has been used by unkown layer "+a.id),a!==i&&(a.__used=!0,a.__startIndex!==o&&(a.__dirty=!0),a.__startIndex=o,a.incremental?a.__drawIndex=-1:a.__drawIndex=o,e(o),i=a),r.__dirty&&(a.__dirty=!0,a.incremental&&a.__drawIndex<0&&(a.__drawIndex=o))}e(o),this.eachBuiltinLayer(function(t,e){!t.__used&&t.getElementCount()>0&&(t.__dirty=!0,t.__startIndex=t.__endIndex=t.__drawIndex=0),t.__dirty&&t.__drawIndex<0&&(t.__drawIndex=t.__startIndex)})},clear:function(){return this.eachBuiltinLayer(this._clearLayer),this},_clearLayer:function(t){t.clear()},setBackgroundColor:function(t){this._backgroundColor=t},configLayer:function(t,e){if(e){var i=this._layerConfig;i[t]?n(i[t],e,!0):i[t]=e;for(var o=0;o=0&&this._clips.splice(e,1)},removeAnimator:function(t){for(var e=t.getClips(),i=0;i=0||n&&l(n,r)<0)){var s=e.getShallow(r);null!=s&&(o[t[a][0]]=s)}}return o}},tS=Qb([["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),eS={getLineStyle:function(t){var e=tS(this,t),i=this.getLineDash(e.lineWidth);return i&&(e.lineDash=i),e},getLineDash:function(t){null==t&&(t=1);var e=this.get("type"),i=Math.max(t,2),n=4*t;return"solid"===e||null==e?null:"dashed"===e?[n,n]:[i,i]}},iS=Qb([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),nS={getAreaStyle:function(t,e){return iS(this,t,e)}},oS=Math.pow,aS=Math.sqrt,rS=1e-8,sS=1e-4,lS=aS(3),uS=1/3,hS=V(),cS=V(),dS=V(),fS=Math.min,pS=Math.max,gS=Math.sin,mS=Math.cos,vS=2*Math.PI,yS=V(),xS=V(),_S=V(),wS=[],bS=[],SS={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},MS=[],IS=[],TS=[],AS=[],DS=Math.min,CS=Math.max,LS=Math.cos,kS=Math.sin,PS=Math.sqrt,NS=Math.abs,OS="undefined"!=typeof Float32Array,ES=function(t){this._saveData=!t,this._saveData&&(this.data=[]),this._ctx=null};ES.prototype={constructor:ES,_xi:0,_yi:0,_x0:0,_y0:0,_ux:0,_uy:0,_len:0,_lineDash:null,_dashOffset:0,_dashIdx:0,_dashSum:0,setScale:function(t,e){this._ux=NS(1/Xw/t)||0,this._uy=NS(1/Xw/e)||0},getContext:function(){return this._ctx},beginPath:function(t){return this._ctx=t,t&&t.beginPath(),t&&(this.dpr=t.dpr),this._saveData&&(this._len=0),this._lineDash&&(this._lineDash=null,this._dashOffset=0),this},moveTo:function(t,e){return this.addData(SS.M,t,e),this._ctx&&this._ctx.moveTo(t,e),this._x0=t,this._y0=e,this._xi=t,this._yi=e,this},lineTo:function(t,e){var i=NS(t-this._xi)>this._ux||NS(e-this._yi)>this._uy||this._len<5;return this.addData(SS.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(SS.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(SS.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(SS.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=LS(o)*i+t,this._yi=kS(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(SS.R,t,e,i,n),this},closePath:function(){this.addData(SS.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,this._dashIdx=0;for(var e=0,i=0;ie.length&&(this._expandData(),e=this.data);for(var i=0;i0&&f<=t||h<0&&f>=t||0===h&&(c>0&&p<=e||c<0&&p>=e);)f+=h*(i=r[n=this._dashIdx]),p+=c*i,this._dashIdx=(n+1)%g,h>0&&fl||c>0&&pu||s[n%2?"moveTo":"lineTo"](h>=0?DS(f,t):CS(f,t),c>=0?DS(p,e):CS(p,e));h=f-t,c=p-e,this._dashOffset=-PS(h*h+c*c)},_dashedBezierTo:function(t,e,i,n,o,a){var r,s,l,u,h,c=this._dashSum,d=this._dashOffset,f=this._lineDash,p=this._ctx,g=this._xi,m=this._yi,v=tn,y=0,x=this._dashIdx,_=f.length,w=0;for(d<0&&(d=c+d),d%=c,r=0;r<1;r+=.1)s=v(g,t,i,o,r+.1)-v(g,t,i,o,r),l=v(m,e,n,a,r+.1)-v(m,e,n,a,r),y+=PS(s*s+l*l);for(;x<_&&!((w+=f[x])>d);x++);for(r=(w-d)/y;r<=1;)u=v(g,t,i,o,r),h=v(m,e,n,a,r),x%2?p.moveTo(u,h):p.lineTo(u,h),r+=f[x]/y,x=(x+1)%_;x%2!=0&&p.lineTo(o,a),s=o-u,l=a-h,this._dashOffset=-PS(s*s+l*l)},_dashedQuadraticTo:function(t,e,i,n){var o=i,a=n;i=(i+2*t)/3,n=(n+2*e)/3,t=(this._xi+2*t)/3,e=(this._yi+2*e)/3,this._dashedBezierTo(t,e,i,n,o,a)},toStatic:function(){var t=this.data;t instanceof Array&&(t.length=this._len,OS&&(this.data=new Float32Array(t)))},getBoundingRect:function(){MS[0]=MS[1]=TS[0]=TS[1]=Number.MAX_VALUE,IS[0]=IS[1]=AS[0]=AS[1]=-Number.MAX_VALUE;for(var t=this.data,e=0,i=0,n=0,o=0,a=0;al||NS(r-o)>u||c===h-1)&&(t.lineTo(a,r),n=a,o=r);break;case SS.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 SS.Q:t.quadraticCurveTo(s[c++],s[c++],s[c++],s[c++]),n=s[c-2],o=s[c-1];break;case SS.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=g>m?g:m,b=g>m?1:g/m,S=g>m?m/g:1,M=v+y;Math.abs(g-m)>.001?(t.translate(f,p),t.rotate(x),t.scale(b,S),t.arc(0,0,w,v,M,1-_),t.scale(1/b,1/S),t.rotate(-x),t.translate(-f,-p)):t.arc(f,p,w,v,M,1-_),1===c&&(e=LS(v)*g+f,i=kS(v)*m+p),n=LS(M)*g+f,o=kS(M)*m+p;break;case SS.R:e=n=s[c],i=o=s[c+1],t.rect(s[c++],s[c++],s[c++],s[c++]);break;case SS.Z:t.closePath(),n=e,o=i}}}},ES.CMD=SS;var RS=2*Math.PI,zS=2*Math.PI,BS=ES.CMD,VS=2*Math.PI,GS=1e-4,FS=[-1,-1,-1],WS=[-1,-1],HS=fb.prototype.getCanvasPattern,ZS=Math.abs,US=new ES(!0);Pn.prototype={constructor:Pn,type:"path",__dirtyPath:!0,strokeContainThreshold:5,subPixelOptimize:!1,brush:function(t,e){var i=this.style,n=this.path||US,o=i.hasStroke(),a=i.hasFill(),r=i.fill,s=i.stroke,l=a&&!!r.colorStops,u=o&&!!s.colorStops,h=a&&!!r.image,c=o&&!!s.image;if(i.bind(t,this,e),this.setTransform(t),this.__dirty){var d;l&&(d=d||this.getBoundingRect(),this._fillGradient=i.getGradient(t,r,d)),u&&(d=d||this.getBoundingRect(),this._strokeGradient=i.getGradient(t,s,d))}l?t.fillStyle=this._fillGradient:h&&(t.fillStyle=HS.call(r,t)),u?t.strokeStyle=this._strokeGradient:c&&(t.strokeStyle=HS.call(s,t));var f=i.lineDash,p=i.lineDashOffset,g=!!t.setLineDash,m=this.getGlobalScale();if(n.setScale(m[0],m[1]),this.__dirtyPath||f&&!g&&o?(n.beginPath(t),f&&!g&&(n.setLineDash(f),n.setLineDashOffset(p)),this.buildPath(n,this.shape,!1),this.path&&(this.__dirtyPath=!1)):(t.beginPath(),this.path.rebuildPath(t)),a)if(null!=i.fillOpacity){v=t.globalAlpha;t.globalAlpha=i.fillOpacity*i.opacity,n.fill(t),t.globalAlpha=v}else n.fill(t);if(f&&g&&(t.setLineDash(f),t.lineDashOffset=p),o)if(null!=i.strokeOpacity){var v=t.globalAlpha;t.globalAlpha=i.strokeOpacity*i.opacity,n.stroke(t),t.globalAlpha=v}else n.stroke(t);f&&g&&t.setLineDash([]),null!=i.text&&(this.restoreTransform(t),this.drawRectText(t,this.getBoundingRect()))},buildPath:function(t,e,i){},createPathProxy:function(){this.path=new ES},getBoundingRect:function(){var t=this._rect,e=this.style,i=!t;if(i){var n=this.path;n||(n=this.path=new ES),this.__dirtyPath&&(n.beginPath(),this.buildPath(n,this.shape,!1)),t=n.getBoundingRect()}if(this._rect=t,e.hasStroke()){var o=this._rectWithStroke||(this._rectWithStroke=t.clone());if(this.__dirty||i){o.copy(t);var a=e.lineWidth,r=e.strokeNoScale?this.getLineScale():1;e.hasFill()||(a=Math.max(a,this.strokeContainThreshold||4)),r>1e-10&&(o.width+=a/r,o.height+=a/r,o.x-=a/r/2,o.y-=a/r/2)}return o}return t},contain:function(t,e){var i=this.transformCoordToLocal(t,e),n=this.getBoundingRect(),o=this.style;if(t=i[0],e=i[1],n.contain(t,e)){var a=this.path.data;if(o.hasStroke()){var r=o.lineWidth,s=o.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(o.hasFill()||(r=Math.max(r,this.strokeContainThreshold)),kn(a,r/s,t,e)))return!0}if(o.hasFill())return Ln(a,t,e)}return!1},dirty:function(t){null==t&&(t=!0),t&&(this.__dirtyPath=t,this._rect=null),this.__dirty=this.__dirtyText=!0,this.__zr&&this.__zr.refresh(),this.__clipTarget&&this.__clipTarget.dirty()},animateShape:function(t){return this.animate("shape",t)},attrKV:function(t,e){"shape"===t?(this.setShape(e),this.__dirtyPath=!0,this._rect=null):di.prototype.attrKV.call(this,t,e)},setShape:function(t,e){var i=this.shape;if(i){if(w(t))for(var n in t)t.hasOwnProperty(n)&&(i[n]=t[n]);else i[t]=e;this.dirty(!0)}return this},getLineScale:function(){var t=this.transform;return t&&ZS(t[0]-1)>1e-10&&ZS(t[3]-1)>1e-10?Math.sqrt(ZS(t[0]*t[3]-t[2]*t[1])):1}},Pn.extend=function(t){var e=function(e){Pn.call(this,e),t.style&&this.style.extendFrom(t.style,!1);var i=t.shape;if(i){this.shape=this.shape||{};var n=this.shape;for(var o in i)!n.hasOwnProperty(o)&&i.hasOwnProperty(o)&&(n[o]=i[o])}t.init&&t.init.call(this,e)};u(e,Pn);for(var i in t)"style"!==i&&"shape"!==i&&(e.prototype[i]=t[i]);return e},u(Pn,di);var XS=ES.CMD,jS=[[],[],[]],YS=Math.sqrt,qS=Math.atan2,KS=function(t,e){var i,n,o,a,r,s,l=t.data,u=XS.M,h=XS.C,c=XS.L,d=XS.R,f=XS.A,p=XS.Q;for(o=0,a=0;o=11?function(){var e,i=this.__clipPaths,n=this.style;if(i)for(var o=0;oi-2?i-1:c+1],u=t[c>i-3?i-1:c+2]);var p=d*d,g=d*p;n.push([Bn(s[0],f[0],l[0],u[0],d,p,g),Bn(s[1],f[1],l[1],u[1],d,p,g)])}return n},fM=function(t,e,i,n){var o,a,r,s,l=[],u=[],h=[],c=[];if(n){r=[1/0,1/0],s=[-1/0,-1/0];for(var d=0,f=t.length;d=i&&a>=o)return{x:i,y:o,width:n-i,height:a-o}},createIcon:Po,Group:tb,Image:fi,Text:rM,Circle:sM,Sector:hM,Ring:cM,Polygon:pM,Polyline:gM,Rect:yM,Line:_M,BezierCurve:bM,Arc:SM,IncrementalDisplayable:Zn,CompoundPath:MM,LinearGradient:TM,RadialGradient:AM,BoundingRect:de}),BM=["textStyle","color"],VM={getTextColor:function(t){var e=this.ecModel;return this.getShallow("color")||(!t&&e?e.get(BM):null)},getFont:function(){return So({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},getTextRect:function(t){return ke(t,this.getFont(),this.getShallow("align"),this.getShallow("verticalAlign")||this.getShallow("baseline"),this.getShallow("padding"),this.getShallow("lineHeight"),this.getShallow("rich"),this.getShallow("truncateText"))}},GM=Qb([["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["textPosition"],["textAlign"]]),FM={getItemStyle:function(t,e){var i=GM(this,t,e),n=this.getBorderLineDash();return n&&(i.lineDash=n),i},getBorderLineDash:function(){var t=this.get("borderType");return"solid"===t||null==t?null:"dashed"===t?[5,5]:[1,1]}},WM=h,HM=Bi();No.prototype={constructor:No,init:null,mergeOption:function(t){n(this.option,t,!0)},get:function(t,e){return null==t?this.option:Oo(this.option,this.parsePath(t),!e&&Eo(this,t))},getShallow:function(t,e){var i=this.option,n=null==i?i:i[t],o=!e&&Eo(this,t);return null==n&&o&&(n=o.getShallow(t)),n},getModel:function(t,e){var i,n=null==t?this.option:Oo(this.option,t=this.parsePath(t));return e=e||(i=Eo(this,t))&&i.getModel(t),new No(n,e,this.ecModel)},isEmpty:function(){return null==this.option},restoreData:function(){},clone:function(){return new(0,this.constructor)(i(this.option))},setReadOnly:function(t){},parsePath:function(t){return"string"==typeof t&&(t=t.split(".")),t},customizeGetParent:function(t){HM(this).getParent=t},isAnimationEnabled:function(){if(!U_.node){if(null!=this.option.animation)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}}},ji(No),Yi(No),WM(No,eS),WM(No,nS),WM(No,VM),WM(No,FM);var ZM=0,UM=1e-4,XM=9007199254740991,jM=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d\d)(?::(\d\d)(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/,YM=(Object.freeze||Object)({linearMap:Bo,parsePercent:Vo,round:Go,asc:Fo,getPrecision:Wo,getPrecisionSafe:Ho,getPixelPrecision:Zo,getPercentWithPrecision:Uo,MAX_SAFE_INTEGER:XM,remRadian:Xo,isRadianAroundZero:jo,parseDate:Yo,quantity:qo,nice:$o,quantile:function(t,e){var i=(t.length-1)*e+1,n=Math.floor(i),o=+t[n-1],a=i-n;return a?o+a*(t[n]-o):o},reformIntervals:Jo,isNumeric:Qo}),qM=L,KM=/([&<>"'])/g,$M={"&":"&","<":"<",">":">",'"':""","'":"'"},JM=["a","b","c","d","e","f","g"],QM=function(t,e){return"{"+t+(null==e?"":e)+"}"},tI=ze,eI=(Object.freeze||Object)({addCommas:ta,toCamelCase:ea,normalizeCssArray:qM,encodeHTML:ia,formatTpl:na,formatTplSimple:oa,getTooltipMarker:aa,formatTime:sa,capitalFirst:la,truncateText:tI,getTextBoundingRect:function(t){return ke(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 ke(t,e,i,n,o,s,a,r)}}),iI=d,nI=["left","right","top","bottom","width","height"],oI=[["width","left","right"],["height","top","bottom"]],aI=ua,rI=(v(ua,"vertical"),v(ua,"horizontal"),{getBoxLayoutParams:function(){return{left:this.get("left"),top:this.get("top"),right:this.get("right"),bottom:this.get("bottom"),width:this.get("width"),height:this.get("height")}}}),sI=Bi(),lI=No.extend({type:"component",id:"",name:"",mainType:"",subType:"",componentIndex:0,defaultOption:null,ecModel:null,dependentModels:[],uid:null,layoutMode:null,$constructor:function(t,e,i,n){No.call(this,t,e,i,n),this.uid=Ro("ec_cpt_model")},init:function(t,e,i,n){this.mergeDefaultAndTheme(t,i)},mergeDefaultAndTheme:function(t,e){var i=this.layoutMode,o=i?ga(t):{};n(t,e.getTheme().get(this.mainType)),n(t,this.getDefaultOption()),i&&pa(t,o,i)},mergeOption:function(t,e){n(this.option,t,!0);var i=this.layoutMode;i&&pa(this.option,t,i)},optionUpdated:function(t,e){},getDefaultOption:function(){var t=sI(this);if(!t.defaultOption){for(var e=[],i=this.constructor;i;){var o=i.prototype.defaultOption;o&&e.push(o),i=i.superClass}for(var a={},r=e.length-1;r>=0;r--)a=n(a,e[r],!0);t.defaultOption=a}return t.defaultOption},getReferringComponents:function(t){return this.ecModel.queryComponents({mainType:t,index:this.get(t+"Index",!0),id:this.get(t+"Id",!0)})}});$i(lI,{registerWhenExtend:!0}),function(t){var e={};t.registerSubTypeDefaulter=function(t,i){t=Ui(t),e[t.main]=i},t.determineSubType=function(i,n){var o=n.type;if(!o){var a=Ui(i).main;t.hasSubTypes(i)&&e[a]&&(o=e[a](n))}return o}}(lI),function(t,e){function i(t){var i={},a=[];return d(t,function(r){var s=n(i,r),u=o(s.originalDeps=e(r),t);s.entryCount=u.length,0===s.entryCount&&a.push(r),d(u,function(t){l(s.predecessor,t)<0&&s.predecessor.push(t);var e=n(i,t);l(e.successor,t)<0&&e.successor.push(r)})}),{graph:i,noEntryList:a}}function n(t,e){return t[e]||(t[e]={predecessor:[],successor:[]}),t[e]}function o(t,e){var i=[];return d(t,function(t){l(e,t)>=0&&i.push(t)}),i}t.topologicalTravel=function(t,e,n,o){function a(t){s[t].entryCount--,0===s[t].entryCount&&l.push(t)}if(t.length){var r=i(e),s=r.graph,l=r.noEntryList,u={};for(d(t,function(t){u[t]=!0});l.length;){var h=l.pop(),c=s[h],f=!!u[h];f&&(n.call(o,h,c.originalDeps.slice()),delete u[h]),d(c.successor,f?function(t){u[t]=!0,a(t)}:a)}d(u,function(){throw new Error("Circle dependency may exists")})}}}(lI,function(t){var e=[];return d(lI.getClassesByMainType(t),function(t){e=e.concat(t.prototype.dependencies||[])}),e=f(e,function(t){return Ui(t).main}),"dataset"!==t&&l(e,"dataset")<=0&&e.unshift("dataset"),e}),h(lI,rI);var uI="";"undefined"!=typeof navigator&&(uI=navigator.platform||"");var hI={color:["#c23531","#2f4554","#61a0a8","#d48265","#91c7ae","#749f83","#ca8622","#bda29a","#6e7074","#546570","#c4ccd3"],gradientColor:["#f6efa6","#d88273","#bf444c"],textStyle:{fontFamily:uI.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,animation:"auto",animationDuration:1e3,animationDurationUpdate:300,animationEasing:"exponentialOut",animationEasingUpdate:"cubicOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1},cI=Bi(),dI={clearColorPalette:function(){cI(this).colorIdx=0,cI(this).colorNameMap={}},getColorFromPalette:function(t,e,i){var n=cI(e=e||this),o=n.colorIdx||0,a=n.colorNameMap=n.colorNameMap||{};if(a.hasOwnProperty(t))return a[t];var r=Di(this.get("color",!0)),s=this.get("colorLayer",!0),l=null!=i&&s?va(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}}},fI={cartesian2d:function(t,e,i,n){var o=t.getReferringComponents("xAxis")[0],a=t.getReferringComponents("yAxis")[0];e.coordSysDims=["x","y"],i.set("x",o),i.set("y",a),xa(o)&&(n.set("x",o),e.firstCategoryDimIndex=0),xa(a)&&(n.set("y",a),e.firstCategoryDimIndex=1)},singleAxis:function(t,e,i,n){var o=t.getReferringComponents("singleAxis")[0];e.coordSysDims=["single"],i.set("single",o),xa(o)&&(n.set("single",o),e.firstCategoryDimIndex=0)},polar:function(t,e,i,n){var o=t.getReferringComponents("polar")[0],a=o.findAxisModel("radiusAxis"),r=o.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],i.set("radius",a),i.set("angle",r),xa(a)&&(n.set("radius",a),e.firstCategoryDimIndex=0),xa(r)&&(n.set("angle",r),e.firstCategoryDimIndex=1)},geo:function(t,e,i,n){e.coordSysDims=["lng","lat"]},parallel:function(t,e,i,n){var o=t.ecModel,a=o.getComponent("parallel",t.get("parallelIndex")),r=e.coordSysDims=a.dimensions.slice();d(a.parallelAxisIndex,function(t,a){var s=o.getComponent("parallelAxis",t),l=r[a];i.set(l,s),xa(s)&&null==e.firstCategoryDimIndex&&(n.set(l,s),e.firstCategoryDimIndex=a)})}},pI="original",gI="arrayRows",mI="objectRows",vI="keyedColumns",yI="unknown",xI="typedArray",_I="column",wI="row";_a.seriesDataToSource=function(t){return new _a({data:t,sourceFormat:S(t)?xI:pI,fromDataset:!1})},Yi(_a);var bI=Bi(),SI="\0_ec_inner",MI=No.extend({init:function(t,e,i,n){i=i||{},this.option=null,this._theme=new No(i),this._optionManager=n},setOption:function(t,e){k(!(SI in t),"please use chart.getOption()"),this._optionManager.setOption(t,e),this.resetOption(null)},resetOption:function(t){var e=!1,i=this._optionManager;if(!t||"recreate"===t){var n=i.mountOption("recreate"===t);this.option&&"recreate"!==t?(this.restoreData(),this.mergeOption(n)):Ea.call(this,n),e=!0}if("timeline"!==t&&"media"!==t||this.restoreData(),!t||"recreate"===t||"timeline"===t){var o=i.getTimelineOption(this);o&&(this.mergeOption(o),e=!0)}if(!t||"recreate"===t||"media"===t){var a=i.getMediaOption(this,this._api);a.length&&d(a,function(t){this.mergeOption(t,e=!0)},this)}return e},mergeOption:function(t){var e=this.option,o=this._componentsMap,r=[];Sa(this),d(t,function(t,o){null!=t&&(lI.hasClass(o)?o&&r.push(o):e[o]=null==e[o]?i(t):n(e[o],t,!0))}),lI.topologicalTravel(r,lI.getAllClassMainTypes(),function(i,n){var r=Di(t[i]),s=Pi(o.get(i),r);Ni(s),d(s,function(t,e){var n=t.option;w(n)&&(t.keyInfo.mainType=i,t.keyInfo.subType=za(i,n,t.exist))});var l=Ra(o,n);e[i]=[],o.set(i,[]),d(s,function(t,n){var r=t.exist,s=t.option;if(k(w(s)||r,"Empty component definition"),s){var u=lI.getClass(i,t.keyInfo.subType,!0);if(r&&r instanceof u)r.name=t.keyInfo.name,r.mergeOption(s,this),r.optionUpdated(s,!1);else{var h=a({dependentModels:l,componentIndex:n},t.keyInfo);a(r=new u(s,this,this,h),h),r.init(s,this,this,h),r.optionUpdated(null,!0)}}else r.mergeOption({},this),r.optionUpdated({},!1);o.get(i)[n]=r,e[i][n]=r.option},this),"series"===i&&Ba(this,o.get("series"))},this),this._seriesIndicesMap=R(this._seriesIndices=this._seriesIndices||[])},getOption:function(){var t=i(this.option);return d(t,function(e,i){if(lI.hasClass(i)){for(var n=(e=Di(e)).length-1;n>=0;n--)Ei(e[n])&&e.splice(n,1);t[i]=e}}),delete t[SI],t},getTheme:function(){return this._theme},getComponent:function(t,e){var i=this._componentsMap.get(t);if(i)return i[e||0]},queryComponents:function(t){var e=t.mainType;if(!e)return[];var i=t.index,n=t.id,o=t.name,a=this._componentsMap.get(e);if(!a||!a.length)return[];var r;if(null!=i)y(i)||(i=[i]),r=g(f(i,function(t){return a[t]}),function(t){return!!t});else if(null!=n){var s=y(n);r=g(a,function(t){return s&&l(n,t.id)>=0||!s&&t.id===n})}else if(null!=o){var u=y(o);r=g(a,function(t){return u&&l(o,t.name)>=0||!u&&t.name===o})}else r=a.slice();return Va(r,t)},findComponents:function(t){var e=t.query,i=t.mainType,n=function(t){var e=i+"Index",n=i+"Id",o=i+"Name";return!t||null==t[e]&&null==t[n]&&null==t[o]?null:{mainType:i,index:t[e],id:t[n],name:t[o]}}(e);return function(e){return t.filter?g(e,t.filter):e}(Va(n?this.queryComponents(n):this._componentsMap.get(i),t))},eachComponent:function(t,e,i){var n=this._componentsMap;"function"==typeof t?(i=e,e=t,n.each(function(t,n){d(t,function(t,o){e.call(i,n,t,o)})})):_(t)?d(n.get(t),e,i):w(t)&&d(this.findComponents(t),e,i)},getSeriesByName:function(t){return g(this._componentsMap.get("series"),function(e){return e.name===t})},getSeriesByIndex:function(t){return this._componentsMap.get("series")[t]},getSeriesByType:function(t){return g(this._componentsMap.get("series"),function(e){return e.subType===t})},getSeries:function(){return this._componentsMap.get("series").slice()},getSeriesCount:function(){return this._componentsMap.get("series").length},eachSeries:function(t,e){d(this._seriesIndices,function(i){var n=this._componentsMap.get("series")[i];t.call(e,n,i)},this)},eachRawSeries:function(t,e){d(this._componentsMap.get("series"),t,e)},eachSeriesByType:function(t,e,i){d(this._seriesIndices,function(n){var o=this._componentsMap.get("series")[n];o.subType===t&&e.call(i,o,n)},this)},eachRawSeriesByType:function(t,e,i){return d(this.getSeriesByType(t),e,i)},isSeriesFiltered:function(t){return null==this._seriesIndicesMap.get(t.componentIndex)},getCurrentSeriesIndices:function(){return(this._seriesIndices||[]).slice()},filterSeries:function(t,e){Ba(this,g(this._componentsMap.get("series"),t,e))},restoreData:function(t){var e=this._componentsMap;Ba(this,e.get("series"));var i=[];e.each(function(t,e){i.push(e)}),lI.topologicalTravel(i,lI.getAllClassMainTypes(),function(i,n){d(e.get(i),function(e){("series"!==i||!Na(e,t))&&e.restoreData()})})}});h(MI,dI);var II=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isDisposed","on","off","getDataURL","getConnectedDataURL","getModel","getOption","getViewOfComponentModel","getViewOfSeriesModel"],TI={};Fa.prototype={constructor:Fa,create:function(t,e){var i=[];d(TI,function(n,o){var a=n.create(t,e);i=i.concat(a||[])}),this._coordinateSystems=i},update:function(t,e){d(this._coordinateSystems,function(i){i.update&&i.update(t,e)})},getCoordinateSystems:function(){return this._coordinateSystems.slice()}},Fa.register=function(t,e){TI[t]=e},Fa.get=function(t){return TI[t]};var AI=d,DI=i,CI=f,LI=n,kI=/^(min|max)?(.+)$/;Wa.prototype={constructor:Wa,setOption:function(t,e){t&&d(Di(t.series),function(t){t&&t.data&&S(t.data)&&N(t.data)}),t=DI(t,!0);var i=this._optionBackup,n=Ha.call(this,t,e,!i);this._newBaseOption=n.baseOption,i?(ja(i.baseOption,n.baseOption),n.timelineOptions.length&&(i.timelineOptions=n.timelineOptions),n.mediaList.length&&(i.mediaList=n.mediaList),n.mediaDefault&&(i.mediaDefault=n.mediaDefault)):this._optionBackup=n},mountOption:function(t){var e=this._optionBackup;return this._timelineOptions=CI(e.timelineOptions,DI),this._mediaList=CI(e.mediaList,DI),this._mediaDefault=DI(e.mediaDefault),this._currentMediaIndices=[],DI(t?e.baseOption:this._newBaseOption)},getTimelineOption:function(t){var e,i=this._timelineOptions;if(i.length){var n=t.getComponent("timeline");n&&(e=DI(i[n.getCurrentIndex()],!0))}return e},getMediaOption:function(t){var e=this._api.getWidth(),i=this._api.getHeight(),n=this._mediaList,o=this._mediaDefault,a=[],r=[];if(!n.length&&!o)return r;for(var s=0,l=n.length;s=1)&&(t=1),t}var i=this._upstream,n=t&&t.skip;if(this._dirty&&i){var o=this.context;o.data=o.outputData=i.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var a;this._plan&&!n&&(a=this._plan(this.context));var r=e(this._modBy),s=this._modDataCount||0,l=e(t&&t.modBy),u=t&&t.modDataCount||0;r===l&&s===u||(a="reset");var h;(this._dirty||"reset"===a)&&(this._dirty=!1,h=yr(this,n)),this._modBy=l,this._modDataCount=u;var c=t&&t.step;if(this._dueEnd=i?i._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var d=this._dueIndex,f=Math.min(null!=c?this._dueIndex+c:1/0,this._dueEnd);if(!n&&(h||d=i?null:t1&&a>0?e:t}};return s}();UI.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},UI.unfinished=function(){return this._progress&&this._dueIndex":"\n",s="richText"===n,l={},u=0,h=this.getData(),c=h.mapDimension("defaultedTooltip",!0),f=c.length,g=this.getRawValue(t),m=y(g),v=h.getItemVisual(t,"color");w(v)&&v.colorStops&&(v=(v.colorStops[0]||{}).color),v=v||"transparent";var x=(f>1||m&&!f?function(i){function o(t,i){var o=h.getDimensionInfo(i);if(o&&!1!==o.otherDims.tooltip){var c=o.type,d="sub"+a.seriesIndex+"at"+u,p=aa({color:v,type:"subItem",renderMode:n,markerId:d}),g="string"==typeof p?p:p.content,m=(r?g+ia(o.displayName||"-")+": ":"")+ia("ordinal"===c?t+"":"time"===c?e?"":sa("yyyy/MM/dd hh:mm:ss",t):ta(t));m&&f.push(m),s&&(l[d]=v,++u)}}var r=p(i,function(t,e,i){var n=h.getDimensionInfo(i);return t|=n&&!1!==n.tooltip&&null!=n.displayName},0),f=[];c.length?d(c,function(e){o(fr(h,t,e),e)}):d(i,o);var g=r?s?"\n":"
":"",m=g+f.join(g||", ");return{renderMode:n,content:m,style:l}}(g):o(f?fr(h,t,c[0]):m?g[0]:g)).content,_=a.seriesIndex+"at"+u,b=aa({color:v,type:"item",renderMode:n,markerId:_});l[_]=v,++u;var S=h.getName(t),M=this.name;Oi(this)||(M=""),M=M?ia(M)+(e?": ":r):"";var I="string"==typeof b?b:b.content;return{html:e?I+M+x:M+I+(S?ia(S)+": "+x:x),markers:l}},isAnimationEnabled:function(){if(U_.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=dI.getColorFromPalette.call(this,t,e,i);return o||(o=n.getColorFromPalette(t,e,i)),o},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});h(YI,ZI),h(YI,dI);var qI=function(){this.group=new tb,this.uid=Ro("viewComponent")};qI.prototype={constructor:qI,init:function(t,e){},render:function(t,e,i,n){},dispose:function(){},filterForExposedEvent:null};var KI=qI.prototype;KI.updateView=KI.updateLayout=KI.updateVisual=function(t,e,i,n){},ji(qI),$i(qI,{registerWhenExtend:!0});var $I=function(){var t=Bi();return function(e){var i=t(e),n=e.pipelineContext,o=i.large,a=i.progressiveRender,r=i.large=n.large,s=i.progressiveRender=n.progressiveRender;return!!(o^r||a^s)&&"reset"}},JI=Bi(),QI=$I();Ar.prototype={type:"chart",init:function(t,e){},render:function(t,e,i,n){},highlight:function(t,e,i,n){Cr(t.getData(),n,"emphasis")},downplay:function(t,e,i,n){Cr(t.getData(),n,"normal")},remove:function(t,e){this.group.removeAll()},dispose:function(){},incrementalPrepareRender:null,incrementalRender:null,updateTransform:null,filterForExposedEvent:null};var tT=Ar.prototype;tT.updateView=tT.updateLayout=tT.updateVisual=function(t,e,i,n){this.render(t,e,i,n)},ji(Ar),$i(Ar,{registerWhenExtend:!0}),Ar.markUpdateMethod=function(t,e){JI(t).updateMethod=e};var eT={incrementalPrepareRender:{progress:function(t,e){e.view.incrementalRender(t,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(t,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}},iT="\0__throttleOriginMethod",nT="\0__throttleRate",oT="\0__throttleType",aT={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var i=t.getData(),n=(t.visualColorAccessPath||"itemStyle.color").split("."),o=t.get(n)||t.getColorFromPalette(t.name,null,e.getSeriesCount());if(i.setVisual("color",o),!e.isSeriesFiltered(t)){"function"!=typeof o||o instanceof IM||i.each(function(e){i.setItemVisual(e,"color",o(t.getDataParams(e)))});return{dataEach:i.hasItemOption?function(t,e){var i=t.getItemModel(e).get(n,!0);null!=i&&t.setItemVisual(e,"color",i)}:null}}}},rT={toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}},sT=function(t,e){function i(t,e){if("string"!=typeof t)return t;var i=t;return d(e,function(t,e){i=i.replace(new RegExp("\\{\\s*"+e+"\\s*\\}","g"),t)}),i}function n(t){var e=a.get(t);if(null==e){for(var i=t.split("."),n=rT.aria,o=0;o1?"series.multiple.prefix":"series.single.prefix"),{seriesCount:r}),e.eachSeries(function(t,e){if(e1?"multiple":"single")+".";a=i(a=n(s?u+"withName":u+"withoutName"),{seriesId:t.seriesIndex,seriesName:t.get("name"),seriesType:o(t.subType)});var c=t.getData();window.data=c,c.count()>l?a+=i(n("data.partialData"),{displayCnt:l}):a+=n("data.allData");for(var d=[],p=0;pi.blockIndex?i.step:null,a=n&&n.modDataCount;return{step:o,modBy:null!=a?Math.ceil(a/o):null,modDataCount:a}}},uT.getPipeline=function(t){return this._pipelineMap.get(t)},uT.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}},uT.restorePipelines=function(t){var e=this,i=e._pipelineMap=R();t.eachSeries(function(t){var n=t.getProgressive(),o=t.uid;i.set(o,{id:o,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:n&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(n||700),count:0}),jr(e,t,t.dataTask)})},uT.prepareStageTasks=function(){var t=this._stageTaskMap,e=this.ecInstance.getModel(),i=this.api;d(this._allHandlers,function(n){var o=t.get(n.uid)||t.set(n.uid,[]);n.reset&&zr(this,n,o,e,i),n.overallReset&&Br(this,n,o,e,i)},this)},uT.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,jr(this,e,o)},uT.performDataProcessorTasks=function(t,e){Rr(this,this._dataProcessorHandlers,t,e,{block:!0})},uT.performVisualTasks=function(t,e,i){Rr(this,this._visualHandlers,t,e,i)},uT.performSeriesTasks=function(t){var e;t.eachSeries(function(t){e|=t.dataTask.perform()}),this.unfinished|=e},uT.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 hT=uT.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)},cT=Ur(0);Er.wrapStageHandler=function(t,e){return x(t)&&(t={overallReset:t,seriesType:Yr(t)}),t.uid=Ro("stageHandler"),e&&(t.visualType=e),t};var dT,fT={},pT={};qr(fT,MI),qr(pT,Ga),fT.eachSeriesByType=fT.eachRawSeriesByType=function(t){dT=t},fT.eachComponent=function(t){"series"===t.mainType&&t.subType&&(dT=t.subType)};var gT=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"],mT={color:gT,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],gT]},vT=["#dd6b66","#759aa0","#e69d87","#8dc1a9","#ea7e53","#eedd78","#73a373","#73b9bc","#7289ab","#91ca8c","#f49f42"],yT={color:vT,backgroundColor:"#333",tooltip:{axisPointer:{lineStyle:{color:"#eee"},crossStyle:{color:"#eee"}}},legend:{textStyle:{color:"#eee"}},textStyle:{color:"#eee"},title:{textStyle:{color:"#eee"}},toolbox:{iconStyle:{normal:{borderColor:"#eee"}}},dataZoom:{textStyle:{color:"#eee"}},visualMap:{textStyle:{color:"#eee"}},timeline:{lineStyle:{color:"#eee"},itemStyle:{normal:{color:vT[1]}},label:{normal:{textStyle:{color:"#eee"}}},controlStyle:{normal:{color:"#eee",borderColor:"#eee"}}},timeAxis:{axisLine:{lineStyle:{color:"#eee"}},axisTick:{lineStyle:{color:"#eee"}},axisLabel:{textStyle:{color:"#eee"}},splitLine:{lineStyle:{type:"dashed",color:"#aaa"}},splitArea:{areaStyle:{color:"#eee"}}},logAxis:{axisLine:{lineStyle:{color:"#eee"}},axisTick:{lineStyle:{color:"#eee"}},axisLabel:{textStyle:{color:"#eee"}},splitLine:{lineStyle:{type:"dashed",color:"#aaa"}},splitArea:{areaStyle:{color:"#eee"}}},valueAxis:{axisLine:{lineStyle:{color:"#eee"}},axisTick:{lineStyle:{color:"#eee"}},axisLabel:{textStyle:{color:"#eee"}},splitLine:{lineStyle:{type:"dashed",color:"#aaa"}},splitArea:{areaStyle:{color:"#eee"}}},categoryAxis:{axisLine:{lineStyle:{color:"#eee"}},axisTick:{lineStyle:{color:"#eee"}},axisLabel:{textStyle:{color:"#eee"}},splitLine:{lineStyle:{type:"dashed",color:"#aaa"}},splitArea:{areaStyle:{color:"#eee"}}},line:{symbol:"circle"},graph:{color:vT},gauge:{title:{textStyle:{color:"#eee"}}},candlestick:{itemStyle:{normal:{color:"#FD1050",color0:"#0CF49B",borderColor:"#FD1050",borderColor0:"#0CF49B"}}}};yT.categoryAxis.splitLine.show=!1,lI.extend({type:"dataset",defaultOption:{seriesLayoutBy:_I,sourceHeader:null,dimensions:null,source:null},optionUpdated:function(){wa(this)}}),qI.extend({type:"dataset"});var xT=Pn.extend({type:"ellipse",shape:{cx:0,cy:0,rx:0,ry:0},buildPath:function(t,e){var i=.5522848,n=e.cx,o=e.cy,a=e.rx,r=e.ry,s=a*i,l=r*i;t.moveTo(n-a,o),t.bezierCurveTo(n-a,o-l,n-s,o-r,n,o-r),t.bezierCurveTo(n+s,o-r,n+a,o-l,n+a,o),t.bezierCurveTo(n+a,o+l,n+s,o+r,n,o+r),t.bezierCurveTo(n-s,o+r,n-a,o+l,n-a,o),t.closePath()}}),_T=/[\s,]+/;$r.prototype.parse=function(t,e){e=e||{};var i=Kr(t);if(!i)throw new Error("Illegal svg");var n=new tb;this._root=n;var o=i.getAttribute("viewBox")||"",a=parseFloat(i.getAttribute("width")||e.width),r=parseFloat(i.getAttribute("height")||e.height);isNaN(a)&&(a=null),isNaN(r)&&(r=null),es(i,n,null,!0);for(var s=i.firstChild;s;)this._parseNode(s,n),s=s.nextSibling;var l,u;if(o){var h=P(o).split(_T);h.length>=4&&(l={x:parseFloat(h[0]||0),y:parseFloat(h[1]||0),width:parseFloat(h[2]),height:parseFloat(h[3])})}if(l&&null!=a&&null!=r&&(u=as(l,a,r),!e.ignoreViewBox)){var c=n;(n=new tb).add(c),c.scale=u.scale.slice(),c.position=u.position.slice()}return e.ignoreRootClip||null==a||null==r||n.setClipPath(new yM({shape:{x:0,y:0,width:a,height:r}})),{root:n,width:a,height:r,viewBoxRect:l,viewBoxTransform:u}},$r.prototype._parseNode=function(t,e){var i=t.nodeName.toLowerCase();"defs"===i?this._isDefine=!0:"text"===i&&(this._isText=!0);var n;if(this._isDefine){if(r=bT[i]){var o=r.call(this,t),a=t.getAttribute("id");a&&(this._defs[a]=o)}}else{var r=wT[i];r&&(n=r.call(this,t,e),e.add(n))}for(var s=t.firstChild;s;)1===s.nodeType&&this._parseNode(s,n),3===s.nodeType&&this._isText&&this._parseText(s,n),s=s.nextSibling;"defs"===i?this._isDefine=!1:"text"===i&&(this._isText=!1)},$r.prototype._parseText=function(t,e){if(1===t.nodeType){var i=t.getAttribute("dx")||0,n=t.getAttribute("dy")||0;this._textX+=parseFloat(i),this._textY+=parseFloat(n)}var o=new rM({style:{text:t.textContent,transformText:!0},position:[this._textX||0,this._textY||0]});Qr(e,o),es(t,o,this._defs);var a=o.style.fontSize;a&&a<9&&(o.style.fontSize=9,o.scale=o.scale||[1,1],o.scale[0]*=a/9,o.scale[1]*=a/9);var r=o.getBoundingRect();return this._textX+=r.width,e.add(o),o};var wT={g:function(t,e){var i=new tb;return Qr(e,i),es(t,i,this._defs),i},rect:function(t,e){var i=new yM;return Qr(e,i),es(t,i,this._defs),i.setShape({x:parseFloat(t.getAttribute("x")||0),y:parseFloat(t.getAttribute("y")||0),width:parseFloat(t.getAttribute("width")||0),height:parseFloat(t.getAttribute("height")||0)}),i},circle:function(t,e){var i=new sM;return Qr(e,i),es(t,i,this._defs),i.setShape({cx:parseFloat(t.getAttribute("cx")||0),cy:parseFloat(t.getAttribute("cy")||0),r:parseFloat(t.getAttribute("r")||0)}),i},line:function(t,e){var i=new _M;return Qr(e,i),es(t,i,this._defs),i.setShape({x1:parseFloat(t.getAttribute("x1")||0),y1:parseFloat(t.getAttribute("y1")||0),x2:parseFloat(t.getAttribute("x2")||0),y2:parseFloat(t.getAttribute("y2")||0)}),i},ellipse:function(t,e){var i=new xT;return Qr(e,i),es(t,i,this._defs),i.setShape({cx:parseFloat(t.getAttribute("cx")||0),cy:parseFloat(t.getAttribute("cy")||0),rx:parseFloat(t.getAttribute("rx")||0),ry:parseFloat(t.getAttribute("ry")||0)}),i},polygon:function(t,e){var i=t.getAttribute("points");i&&(i=ts(i));var n=new pM({shape:{points:i||[]}});return Qr(e,n),es(t,n,this._defs),n},polyline:function(t,e){var i=new Pn;Qr(e,i),es(t,i,this._defs);var n=t.getAttribute("points");return n&&(n=ts(n)),new gM({shape:{points:n||[]}})},image:function(t,e){var i=new fi;return Qr(e,i),es(t,i,this._defs),i.setStyle({image:t.getAttribute("xlink:href"),x:t.getAttribute("x"),y:t.getAttribute("y"),width:t.getAttribute("width"),height:t.getAttribute("height")}),i},text:function(t,e){var i=t.getAttribute("x")||0,n=t.getAttribute("y")||0,o=t.getAttribute("dx")||0,a=t.getAttribute("dy")||0;this._textX=parseFloat(i)+parseFloat(o),this._textY=parseFloat(n)+parseFloat(a);var r=new tb;return Qr(e,r),es(t,r,this._defs),r},tspan:function(t,e){var i=t.getAttribute("x"),n=t.getAttribute("y");null!=i&&(this._textX=parseFloat(i)),null!=n&&(this._textY=parseFloat(n));var o=t.getAttribute("dx")||0,a=t.getAttribute("dy")||0,r=new tb;return Qr(e,r),es(t,r,this._defs),this._textX+=o,this._textY+=a,r},path:function(t,e){var i=Rn(t.getAttribute("d")||"");return Qr(e,i),es(t,i,this._defs),i}},bT={lineargradient:function(t){var e=parseInt(t.getAttribute("x1")||0,10),i=parseInt(t.getAttribute("y1")||0,10),n=parseInt(t.getAttribute("x2")||10,10),o=parseInt(t.getAttribute("y2")||0,10),a=new TM(e,i,n,o);return Jr(t,a),a},radialgradient:function(t){}},ST={fill:"fill",stroke:"stroke","stroke-width":"lineWidth",opacity:"opacity","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-miterlimit":"miterLimit","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","text-align":"textAlign","alignment-baseline":"textBaseline"},MT=/url\(\s*#(.*?)\)/,IT=/(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.e,]*)\)/g,TT=/([^\s:;]+)\s*:\s*([^:;]+)/g,AT=R(),DT={registerMap:function(t,e,i){var n;return y(e)?n=e:e.svg?n=[{type:"svg",source:e.svg,specialAreas:e.specialAreas}]:(e.geoJson&&!e.features&&(i=e.specialAreas,e=e.geoJson),n=[{type:"geoJSON",source:e,specialAreas:i}]),d(n,function(t){var e=t.type;"geoJson"===e&&(e=t.type="geoJSON"),(0,CT[e])(t)}),AT.set(t,n)},retrieveMap:function(t){return AT.get(t)}},CT={geoJSON:function(t){var e=t.source;t.geoJSON=_(e)?"undefined"!=typeof JSON&&JSON.parse?JSON.parse(e):new Function("return ("+e+");")():e},svg:function(t){t.svgXML=Kr(t.source)}},LT=k,kT=d,PT=x,NT=w,OT=lI.parseClassType,ET={zrender:"4.0.6"},RT=1e3,zT=1e3,BT=3e3,VT={PROCESSOR:{FILTER:RT,STATISTIC:5e3},VISUAL:{LAYOUT:zT,GLOBAL:2e3,CHART:BT,COMPONENT:4e3,BRUSH:5e3}},GT="__flagInMainProcess",FT="__optionUpdated",WT=/^[a-zA-Z0-9_]+$/;ls.prototype.on=ss("on"),ls.prototype.off=ss("off"),ls.prototype.one=ss("one"),h(ls,fw);var HT=us.prototype;HT._onframe=function(){if(!this._disposed){var t=this._scheduler;if(this[FT]){var e=this[FT].silent;this[GT]=!0,cs(this),ZT.update.call(this),this[GT]=!1,this[FT]=!1,gs.call(this,e),ms.call(this,e)}else if(t.unfinished){var i=1,n=this._model;this._api;t.unfinished=!1;do{var o=+new Date;t.performSeriesTasks(n),t.performDataProcessorTasks(n),fs(this,n),t.performVisualTasks(n),bs(this,this._model,0,"remain"),i-=+new Date-o}while(i>0&&t.unfinished);t.unfinished||this._zr.flush()}}},HT.getDom=function(){return this._dom},HT.getZr=function(){return this._zr},HT.setOption=function(t,e,i){var n;if(NT(e)&&(i=e.lazyUpdate,n=e.silent,e=e.notMerge),this[GT]=!0,!this._model||e){var o=new Wa(this._api),a=this._theme,r=this._model=new MI(null,null,a,o);r.scheduler=this._scheduler,r.init(null,null,a,o)}this._model.setOption(t,qT),i?(this[FT]={silent:n},this[GT]=!1):(cs(this),ZT.update.call(this),this._zr.flush(),this[FT]=!1,this[GT]=!1,gs.call(this,n),ms.call(this,n))},HT.setTheme=function(){console.error("ECharts#setTheme() is DEPRECATED in ECharts 3.0")},HT.getModel=function(){return this._model},HT.getOption=function(){return this._model&&this._model.getOption()},HT.getWidth=function(){return this._zr.getWidth()},HT.getHeight=function(){return this._zr.getHeight()},HT.getDevicePixelRatio=function(){return this._zr.painter.dpr||window.devicePixelRatio||1},HT.getRenderedCanvas=function(t){if(U_.canvasSupported)return(t=t||{}).pixelRatio=t.pixelRatio||1,t.backgroundColor=t.backgroundColor||this._model.get("backgroundColor"),this._zr.painter.getRenderedCanvas(t)},HT.getSvgDataUrl=function(){if(U_.svgSupported){var t=this._zr;return d(t.storage.getDisplayList(),function(t){t.stopAnimation(!0)}),t.painter.pathToDataUrl()}},HT.getDataURL=function(t){var e=(t=t||{}).excludeComponents,i=this._model,n=[],o=this;kT(e,function(t){i.eachComponent({mainType:t},function(t){var e=o._componentsMap[t.__viewId];e.group.ignore||(n.push(e),e.group.ignore=!0)})});var a="svg"===this._zr.painter.getType()?this.getSvgDataUrl():this.getRenderedCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return kT(n,function(t){t.group.ignore=!1}),a},HT.getConnectedDataURL=function(t){if(U_.canvasSupported){var e=this.group,n=Math.min,o=Math.max;if(eA[e]){var a=1/0,r=1/0,s=-1/0,l=-1/0,u=[],h=t&&t.pixelRatio||1;d(tA,function(h,c){if(h.group===e){var d=h.getRenderedCanvas(i(t)),f=h.getDom().getBoundingClientRect();a=n(f.left,a),r=n(f.top,r),s=o(f.right,s),l=o(f.bottom,l),u.push({dom:d,left:f.left,top:f.top})}});var c=(s*=h)-(a*=h),f=(l*=h)-(r*=h),p=iw();p.width=c,p.height=f;var g=Ii(p);return kT(u,function(t){var e=new fi({style:{x:t.left*h-a,y:t.top*h-r,image:t.dom}});g.add(e)}),g.refreshImmediately(),p.toDataURL("image/"+(t&&t.type||"png"))}return this.getDataURL(t)}},HT.convertToPixel=v(hs,"convertToPixel"),HT.convertFromPixel=v(hs,"convertFromPixel"),HT.containPixel=function(t,e){var i;return t=Vi(this._model,t),d(t,function(t,n){n.indexOf("Models")>=0&&d(t,function(t){var o=t.coordinateSystem;if(o&&o.containPoint)i|=!!o.containPoint(e);else if("seriesModels"===n){var a=this._chartsMap[t.__viewId];a&&a.containPoint&&(i|=a.containPoint(e,t))}},this)},this),!!i},HT.getVisual=function(t,e){var i=(t=Vi(this._model,t,{defaultMainType:"series"})).seriesModel.getData(),n=t.hasOwnProperty("dataIndexInside")?t.dataIndexInside:t.hasOwnProperty("dataIndex")?i.indexOfRawIndex(t.dataIndex):null;return null!=n?i.getItemVisual(n,e):i.getVisual(e)},HT.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},HT.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]};var ZT={prepareAndUpdate:function(t){cs(this),ZT.update.call(this,t)},update:function(t){var e=this._model,i=this._api,n=this._zr,o=this._coordSysMgr,a=this._scheduler;if(e){a.restoreData(e,t),a.performSeriesTasks(e),o.create(e,i),a.performDataProcessorTasks(e,t),fs(this,e),o.update(e,i),xs(e),a.performVisualTasks(e,t),_s(this,e,i,t);var r=e.get("backgroundColor")||"transparent";if(U_.canvasSupported)n.setBackgroundColor(r);else{var s=Gt(r);r=qt(s,"rgb"),0===s[3]&&(r="transparent")}Ss(e,i)}},updateTransform:function(t){var e=this._model,i=this,n=this._api;if(e){var o=[];e.eachComponent(function(a,r){var s=i.getViewOfComponentModel(r);if(s&&s.__alive)if(s.updateTransform){var l=s.updateTransform(r,e,n,t);l&&l.update&&o.push(s)}else o.push(s)});var a=R();e.eachSeries(function(o){var r=i._chartsMap[o.__viewId];if(r.updateTransform){var s=r.updateTransform(o,e,n,t);s&&s.update&&a.set(o.uid,1)}else a.set(o.uid,1)}),xs(e),this._scheduler.performVisualTasks(e,t,{setDirty:!0,dirtyMap:a}),bs(i,e,0,t,a),Ss(e,this._api)}},updateView:function(t){var e=this._model;e&&(Ar.markUpdateMethod(t,"updateView"),xs(e),this._scheduler.performVisualTasks(e,t,{setDirty:!0}),_s(this,this._model,this._api,t),Ss(e,this._api))},updateVisual:function(t){ZT.update.call(this,t)},updateLayout:function(t){ZT.update.call(this,t)}};HT.resize=function(t){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[GT]=!0,i&&cs(this),ZT.update.call(this),this[GT]=!1,gs.call(this,n),ms.call(this,n)}},HT.showLoading=function(t,e){if(NT(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),QT[t]){var i=QT[t](this._api,e),n=this._zr;this._loadingFX=i,n.add(i)}},HT.hideLoading=function(){this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},HT.makeActionFromEvent=function(t){var e=a({},t);return e.type=jT[t.type],e},HT.dispatchAction=function(t,e){NT(e)||(e={silent:!!e}),XT[t.type]&&this._model&&(this[GT]?this._pendingActions.push(t):(ps.call(this,t,e.silent),e.flush?this._zr.flush(!0):!1!==e.flush&&U_.browser.weChat&&this._throttledZrFlush(),gs.call(this,e.silent),ms.call(this,e.silent)))},HT.appendData=function(t){var e=t.seriesIndex;this.getModel().getSeriesByIndex(e).appendData(t),this._scheduler.unfinished=!0},HT.on=ss("on"),HT.off=ss("off"),HT.one=ss("one");var UT=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];HT._initEvents=function(){kT(UT,function(t){var e=function(e){var i,n=this.getModel(),o=e.target;if("globalout"===t)i={};else if(o&&null!=o.dataIndex){var r=o.dataModel||n.getSeriesByIndex(o.seriesIndex);i=r&&r.getDataParams(o.dataIndex,o.dataType,o)||{}}else o&&o.eventData&&(i=a({},o.eventData));if(i){var s=i.componentType,l=i.componentIndex;"markLine"!==s&&"markPoint"!==s&&"markArea"!==s||(s="series",l=i.seriesIndex);var u=s&&null!=l&&n.getComponent(s,l),h=u&&this["series"===u.mainType?"_chartsMap":"_componentsMap"][u.__viewId];i.event=e,i.type=t,this._ecEventProcessor.eventInfo={targetEl:o,packedEvent:i,model:u,view:h},this.trigger(t,i)}};e.zrEventfulCallAtLast=!0,this._zr.on(t,e,this)},this),kT(jT,function(t,e){this._messageCenter.on(e,function(t){this.trigger(e,t)},this)},this)},HT.isDisposed=function(){return this._disposed},HT.clear=function(){this.setOption({series:[]},!0)},HT.dispose=function(){if(!this._disposed){this._disposed=!0,Fi(this.getDom(),oA,"");var t=this._api,e=this._model;kT(this._componentsViews,function(i){i.dispose(e,t)}),kT(this._chartsViews,function(i){i.dispose(e,t)}),this._zr.dispose(),delete tA[this.id]}},h(us,fw),Ds.prototype={constructor:Ds,normalizeQuery:function(t){var e={},i={},n={};if(_(t)){var o=OT(t);e.mainType=o.main||null,e.subType=o.sub||null}else{var a=["Index","Name","Id"],r={name:1,dataIndex:1,dataType:1};d(t,function(t,o){for(var s=!1,l=0;l0&&h===o.length-u.length){var c=o.slice(0,h);"data"!==c&&(e.mainType=c,e[u.toLowerCase()]=t,s=!0)}}r.hasOwnProperty(o)&&(i[o]=t,s=!0),s||(n[o]=t)})}return{cptQuery:e,dataQuery:i,otherQuery:n}},filter:function(t,e,i){function n(t,e,i,n){return null==t[i]||e[n||i]===t[i]}var o=this.eventInfo;if(!o)return!0;var a=o.targetEl,r=o.packedEvent,s=o.model,l=o.view;if(!s||!l)return!0;var u=e.cptQuery,h=e.dataQuery;return n(u,s,"mainType")&&n(u,s,"subType")&&n(u,s,"index","componentIndex")&&n(u,s,"name")&&n(u,s,"id")&&n(h,r,"name")&&n(h,r,"dataIndex")&&n(h,r,"dataType")&&(!l.filterForExposedEvent||l.filterForExposedEvent(t,e.otherQuery,a,r))},afterTrigger:function(){this.eventInfo=null}};var XT={},jT={},YT=[],qT=[],KT=[],$T=[],JT={},QT={},tA={},eA={},iA=new Date-0,nA=new Date-0,oA="_echarts_instance_",aA=Ls;Bs(2e3,aT),Ns(BI),Os(5e3,function(t){var e=R();t.eachSeries(function(t){var i=t.get("stack");if(i){var n=e.get(i)||e.set(i,[]),o=t.getData(),a={stackResultDimension:o.getCalculationInfo("stackResultDimension"),stackedOverDimension:o.getCalculationInfo("stackedOverDimension"),stackedDimension:o.getCalculationInfo("stackedDimension"),stackedByDimension:o.getCalculationInfo("stackedByDimension"),isStackedByIndex:o.getCalculationInfo("isStackedByIndex"),data:o,seriesModel:t};if(!a.stackedDimension||!a.isStackedByIndex&&!a.stackedByDimension)return;n.length&&o.setCalculationInfo("stackedOnSeries",n[n.length-1].seriesModel),n.push(a)}}),e.each(ar)}),Gs("default",function(t,e){r(e=e||{},{text:"loading",color:"#c23531",textColor:"#000",maskColor:"rgba(255, 255, 255, 0.8)",zlevel:0});var i=new yM({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4}),n=new SM({shape:{startAngle:-lT/2,endAngle:-lT/2+.1,r:10},style:{stroke:e.color,lineCap:"round",lineWidth:5},zlevel:e.zlevel,z:10001}),o=new yM({style:{fill:"none",text:e.text,textPosition:"right",textDistance:10,textFill:e.textColor},zlevel:e.zlevel,z:10001});n.animateShape(!0).when(1e3,{endAngle:3*lT/2}).start("circularInOut"),n.animateShape(!0).when(1e3,{startAngle:3*lT/2}).delay(300).start("circularInOut");var a=new tb;return a.add(n),a.add(o),a.add(i),a.resize=function(){var e=t.getWidth()/2,a=t.getHeight()/2;n.setShape({cx:e,cy:a});var r=n.shape.r;o.setShape({x:e-r,y:a-r,width:2*r,height:2*r}),i.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},a.resize(),a}),Es({type:"highlight",event:"highlight",update:"highlight"},B),Es({type:"downplay",event:"downplay",update:"downplay"},B),Ps("light",mT),Ps("dark",yT);var rA={};Xs.prototype={constructor:Xs,add:function(t){return this._add=t,this},update:function(t){return this._update=t,this},remove:function(t){return this._remove=t,this},execute:function(){var t=this._old,e=this._new,i={},n=[],o=[];for(js(t,{},n,"_oldKeyGetter",this),js(e,i,o,"_newKeyGetter",this),a=0;ax[1]&&(x[1]=y)}e&&(this._nameList[d]=e[f])}this._rawCount=this._count=l,this._extent={},el(this)},yA._initDataFromProvider=function(t,e){if(!(t>=e)){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,C=I,d[I]>0&&(C+="__ec__"+d[I]),d[I]++),null!=C&&(h[v]=C)}}!o.persistent&&o.clean&&o.clean(),this._rawCount=this._count=e,this._extent={},el(this)}},yA.count=function(){return this._count},yA.getIndices=function(){var t=this._indices;if(t){var e=t.constructor,i=this._count;if(e===Array){n=new e(i);for(o=0;o=0&&e=0&&ea&&(a=s)}return i=[o,a],this._extent[t]=i,i},yA.getApproximateExtent=function(t){return t=this.getDimension(t),this._approximateExtent[t]||this.getDataExtent(t)},yA.setApproximateExtent=function(t,e){e=this.getDimension(e),this._approximateExtent[e]=t.slice()},yA.getCalculationInfo=function(t){return this._calculationInfo[t]},yA.setCalculationInfo=function(t,e){lA(t)?a(this._calculationInfo,t):this._calculationInfo[t]=e},yA.getSum=function(t){var e=0;if(this._storage[t])for(var i=0,n=this.count();i=this._rawCount||t<0)return-1;var e=this._indices,i=e[t];if(null!=i&&it))return a;o=a-1}}return-1},yA.indicesOfNearest=function(t,e,i){var n=[];if(!this._storage[t])return n;null==i&&(i=1/0);for(var o=Number.MAX_VALUE,a=-1,r=0,s=this.count();r=0&&a<0)&&(o=u,a=l,n.length=0),n.push(r))}return n},yA.getRawIndex=nl,yA.getRawDataItem=function(t){if(this._rawData.persistent)return this._rawData.getItem(this.getRawIndex(t));for(var e=[],i=0;i=l&&w<=u||isNaN(w))&&(a[r++]=c),c++;h=!0}else if(2===n){for(var d=this._storage[s],v=this._storage[e[1]],y=t[e[1]][0],x=t[e[1]][1],f=0;f=l&&w<=u||isNaN(w))&&(b>=y&&b<=x||isNaN(b))&&(a[r++]=c),c++}h=!0}}if(!h)if(1===n)for(m=0;m=l&&w<=u||isNaN(w))&&(a[r++]=M)}else for(m=0;mt[I][1])&&(S=!1)}S&&(a[r++]=this.getRawIndex(m))}return rb[1]&&(b[1]=w)}}}return o},yA.downSample=function(t,e,i,n){for(var o=sl(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($s(this))(u),f=0,p=0;pu-p&&(s=u-p,r.length=s);for(var g=0;gc[1]&&(c[1]=x),d[f++]=_}return o._count=f,o._indices=d,o.getRawIndex=ol,o},yA.getItemModel=function(t){var e=this.hostModel;return new No(this.getRawDataItem(t),e,e&&e.ecModel)},yA.diff=function(t){var e=this;return new Xs(t?t.getIndices():[],this.getIndices(),function(e){return al(t,e)},function(t){return al(e,t)})},yA.getVisual=function(t){var e=this._visual;return e&&e[t]},yA.setVisual=function(t,e){if(lA(t))for(var i in t)t.hasOwnProperty(i)&&this.setVisual(i,t[i]);else this._visual=this._visual||{},this._visual[t]=e},yA.setLayout=function(t,e){if(lA(t))for(var i in t)t.hasOwnProperty(i)&&this.setLayout(i,t[i]);else this._layout[t]=e},yA.getLayout=function(t){return this._layout[t]},yA.getItemLayout=function(t){return this._itemLayouts[t]},yA.setItemLayout=function(t,e,i){this._itemLayouts[t]=i?a(this._itemLayouts[t]||{},e):e},yA.clearItemLayouts=function(){this._itemLayouts.length=0},yA.getItemVisual=function(t,e,i){var n=this._itemVisuals[t],o=n&&n[e];return null!=o||i?o:this.getVisual(e)},yA.setItemVisual=function(t,e,i){var n=this._itemVisuals[t]||{},o=this.hasItemVisual;if(this._itemVisuals[t]=n,lA(e))for(var a in e)e.hasOwnProperty(a)&&(n[a]=e[a],o[a]=!0);else n[e]=i,o[e]=!0},yA.clearAllVisual=function(){this._visual={},this._itemVisuals=[],this.hasItemVisual={}};var xA=function(t){t.seriesIndex=this.seriesIndex,t.dataIndex=this.dataIndex,t.dataType=this.dataType};yA.setItemGraphicEl=function(t,e){var i=this.hostModel;e&&(e.dataIndex=t,e.dataType=this.dataType,e.seriesIndex=i&&i.seriesIndex,"group"===e.type&&e.traverse(xA,e)),this._graphicEls[t]=e},yA.getItemGraphicEl=function(t){return this._graphicEls[t]},yA.eachItemGraphicEl=function(t,e){d(this._graphicEls,function(i,n){i&&t&&t.call(e,i,n)})},yA.cloneShallow=function(t){if(!t){var e=f(this.dimensions,this.getDimensionInfo,this);t=new vA(e,this.hostModel)}if(t._storage=this._storage,Qs(t,this),this._indices){var i=this._indices.constructor;t._indices=new i(this._indices)}else t._indices=null;return t.getRawIndex=t._indices?ol:nl,t},yA.wrapMethod=function(t,e){var i=this[t];"function"==typeof i&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var t=i.apply(this,arguments);return e.apply(this,[t].concat(C(arguments)))})},yA.TRANSFERABLE_METHODS=["cloneShallow","downSample","map"],yA.CHANGABLE_METHODS=["filterSelf","selectRange"];var _A=function(t,e){return e=e||{},hl(e.coordDimensions||[],t,{dimsDef:e.dimensionsDefine||t.dimensionsDefine,encodeDef:e.encodeDefine||t.encodeDefine,dimCount:e.dimensionsCount,generateCoord:e.generateCoord,generateCoordCount:e.generateCoordCount})};xl.prototype.parse=function(t){return t},xl.prototype.getSetting=function(t){return this._setting[t]},xl.prototype.contain=function(t){var e=this._extent;return t>=e[0]&&t<=e[1]},xl.prototype.normalize=function(t){var e=this._extent;return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])},xl.prototype.scale=function(t){var e=this._extent;return t*(e[1]-e[0])+e[0]},xl.prototype.unionExtent=function(t){var e=this._extent;t[0]e[1]&&(e[1]=t[1])},xl.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},xl.prototype.getExtent=function(){return this._extent.slice()},xl.prototype.setExtent=function(t,e){var i=this._extent;isNaN(t)||(i[0]=t),isNaN(e)||(i[1]=e)},xl.prototype.isBlank=function(){return this._isBlank},xl.prototype.setBlank=function(t){this._isBlank=t},xl.prototype.getLabel=null,ji(xl),$i(xl,{registerWhenExtend:!0}),_l.createByAxisModel=function(t){var e=t.option,i=e.data,n=i&&f(i,bl);return new _l({categories:n,needCollect:!n,deduplication:!1!==e.dedplication})};var wA=_l.prototype;wA.getOrdinal=function(t){return wl(this).get(t)},wA.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=wl(this);return null==(e=n.get(t))&&(i?(e=this.categories.length,this.categories[e]=t,n.set(t,e)):e=NaN),e};var bA=xl.prototype,SA=xl.extend({type:"ordinal",init:function(t,e){t&&!y(t)||(t=new _l({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),bA.contain.call(this,t)&&null!=this._ordinalMeta.categories[t]},normalize:function(t){return bA.normalize.call(this,this.parse(t))},scale:function(t){return Math.round(bA.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:B,niceExtent:B});SA.create=function(){return new SA};var MA=Go,IA=Go,TA=xl.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]),TA.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=Ml(t)},getTicks:function(){return Al(this._interval,this._extent,this._niceExtent,this._intervalPrecision)},getLabel:function(t,e){if(null==t)return"";var i=e&&e.precision;return null==i?i=Ho(t)||0:"auto"===i&&(i=this._intervalPrecision),t=IA(t,i,!0),ta(t)},niceTicks:function(t,e,i){t=t||5;var n=this._extent,o=n[1]-n[0];if(isFinite(o)){o<0&&(o=-o,n.reverse());var a=Sl(n,t,e,i);this._intervalPrecision=a.intervalPrecision,this._interval=a.interval,this._niceExtent=a.niceTickExtent}},niceExtent:function(t){var e=this._extent;if(e[0]===e[1])if(0!==e[0]){var i=e[0];t.fixMax?e[0]-=i/2:(e[1]+=i/2,e[0]-=i/2)}else e[1]=1;var n=e[1]-e[0];isFinite(n)||(e[0]=0,e[1]=1),this.niceTicks(t.splitNumber,t.minInterval,t.maxInterval);var o=this._interval;t.fixMin||(e[0]=IA(Math.floor(e[0]/o)*o)),t.fixMax||(e[1]=IA(Math.ceil(e[1]/o)*o))}});TA.create=function(){return new TA};var AA="__ec_stack_",DA="undefined"!=typeof Float32Array?Float32Array:Array,CA={seriesType:"bar",plan:$I(),reset:function(t){if(Rl(t)&&zl(t)){var e=t.getData(),i=t.coordinateSystem,n=i.getBaseAxis(),o=i.getOtherAxis(n),a=e.mapDimension(o.dim),r=e.mapDimension(n.dim),s=o.isHorizontal(),l=s?0:1,u=Ol(Pl([t]),n,t).width;return u>.5||(u=.5),{progress:function(t,e){for(var n,h=new DA(2*t.count),c=[],d=[],f=0;null!=(n=t.next());)d[l]=e.get(a,n),d[1-l]=e.get(r,n),c=i.dataToPoint(d,null,c),h[f++]=c[0],h[f++]=c[1];e.setLayout({largePoints:h,barWidth:u,valueAxisStart:Bl(0,o),valueAxisHorizontal:s})}}}}},LA=TA.prototype,kA=Math.ceil,PA=Math.floor,NA=function(t,e,i,n){for(;i>>1;t[o][1]i&&(a=i);var r=EA.length,s=NA(EA,a,0,r),l=EA[Math.min(s,r-1)],u=l[1];"year"===l[0]&&(u*=$o(o/u/t,!0));var h=this.getSetting("useUTC")?0:60*new Date(+n[0]||+n[1]).getTimezoneOffset()*1e3,c=[Math.round(kA((n[0]-h)/u)*u+h),Math.round(PA((n[1]-h)/u)*u+h)];Tl(c,n),this._stepLvl=l,this._interval=u,this._niceExtent=c},parse:function(t){return+Yo(t)}});d(["contain","normalize"],function(t){OA.prototype[t]=function(e){return LA[t].call(this,this.parse(e))}});var EA=[["hh:mm:ss",1e3],["hh:mm:ss",5e3],["hh:mm:ss",1e4],["hh:mm:ss",15e3],["hh:mm:ss",3e4],["hh:mm\nMM-dd",6e4],["hh:mm\nMM-dd",3e5],["hh:mm\nMM-dd",6e5],["hh:mm\nMM-dd",9e5],["hh:mm\nMM-dd",18e5],["hh:mm\nMM-dd",36e5],["hh:mm\nMM-dd",72e5],["hh:mm\nMM-dd",216e5],["hh:mm\nMM-dd",432e5],["MM-dd\nyyyy",864e5],["MM-dd\nyyyy",1728e5],["MM-dd\nyyyy",2592e5],["MM-dd\nyyyy",3456e5],["MM-dd\nyyyy",432e6],["MM-dd\nyyyy",5184e5],["week",6048e5],["MM-dd\nyyyy",864e6],["week",12096e5],["week",18144e5],["month",26784e5],["week",36288e5],["month",53568e5],["week",6048e6],["quarter",8208e6],["month",107136e5],["month",13392e6],["half-year",16416e6],["month",214272e5],["month",26784e6],["year",32832e6]];OA.create=function(t){return new OA({useUTC:t.ecModel.get("useUTC")})};var RA=xl.prototype,zA=TA.prototype,BA=Ho,VA=Go,GA=Math.floor,FA=Math.ceil,WA=Math.pow,HA=Math.log,ZA=xl.extend({type:"log",base:10,$constructor:function(){xl.apply(this,arguments),this._originalScale=new TA},getTicks:function(){var t=this._originalScale,e=this._extent,i=t.getExtent();return f(zA.getTicks.call(this),function(n){var o=Go(WA(this.base,n));return o=n===e[0]&&t.__fixMin?Vl(o,i[0]):o,o=n===e[1]&&t.__fixMax?Vl(o,i[1]):o},this)},getLabel:zA.getLabel,scale:function(t){return t=RA.scale.call(this,t),WA(this.base,t)},setExtent:function(t,e){var i=this.base;t=HA(t)/HA(i),e=HA(e)/HA(i),zA.setExtent.call(this,t,e)},getExtent:function(){var t=this.base,e=RA.getExtent.call(this);e[0]=WA(t,e[0]),e[1]=WA(t,e[1]);var i=this._originalScale,n=i.getExtent();return i.__fixMin&&(e[0]=Vl(e[0],n[0])),i.__fixMax&&(e[1]=Vl(e[1],n[1])),e},unionExtent:function(t){this._originalScale.unionExtent(t);var e=this.base;t[0]=HA(t[0])/HA(e),t[1]=HA(t[1])/HA(e),RA.unionExtent.call(this,t)},unionExtentFromData:function(t,e){this.unionExtent(t.getApproximateExtent(e))},niceTicks:function(t){t=t||10;var e=this._extent,i=e[1]-e[0];if(!(i===1/0||i<=0)){var n=qo(i);for(t/i*n<=.5&&(n*=10);!isNaN(n)&&Math.abs(n)<1&&Math.abs(n)>0;)n*=10;var o=[Go(FA(e[0]/n)*n),Go(GA(e[1]/n)*n)];this._interval=n,this._niceExtent=o}},niceExtent:function(t){zA.niceExtent.call(this,t);var e=this._originalScale;e.__fixMin=t.fixMin,e.__fixMax=t.fixMax}});d(["contain","normalize"],function(t){ZA.prototype[t]=function(e){return e=HA(e)/HA(this.base),RA[t].call(this,e)}}),ZA.create=function(){return new ZA};var UA={getMin:function(t){var e=this.option,i=t||null==e.rangeStart?e.min:e.rangeStart;return this.axis&&null!=i&&"dataMin"!==i&&"function"!=typeof i&&!I(i)&&(i=this.axis.scale.parse(i)),i},getMax:function(t){var e=this.option,i=t||null==e.rangeEnd?e.max:e.rangeEnd;return this.axis&&null!=i&&"dataMax"!==i&&"function"!=typeof i&&!I(i)&&(i=this.axis.scale.parse(i)),i},getNeedCrossZero:function(){var t=this.option;return null==t.rangeStart&&null==t.rangeEnd&&!t.scale},getCoordSysModel:B,setRange:function(t,e){this.option.rangeStart=t,this.option.rangeEnd=e},resetRange:function(){this.option.rangeStart=this.option.rangeEnd=null}},XA=Un({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var i=e.cx,n=e.cy,o=e.width/2,a=e.height/2;t.moveTo(i,n-a),t.lineTo(i+o,n+a),t.lineTo(i-o,n+a),t.closePath()}}),jA=Un({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var i=e.cx,n=e.cy,o=e.width/2,a=e.height/2;t.moveTo(i,n-a),t.lineTo(i+o,n),t.lineTo(i,n+a),t.lineTo(i-o,n),t.closePath()}}),YA=Un({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var i=e.x,n=e.y,o=e.width/5*3,a=Math.max(o,e.height),r=o/2,s=r*r/(a-r),l=n-a+r+s,u=Math.asin(s/r),h=Math.cos(u)*r,c=Math.sin(u),d=Math.cos(u),f=.6*r,p=.7*r;t.moveTo(i-h,l+s),t.arc(i,l,r,Math.PI-u,2*Math.PI+u),t.bezierCurveTo(i+h-c*f,l+s+d*f,i,n-p,i,n),t.bezierCurveTo(i,n-p,i-h+c*f,l+s+d*f,i-h,l+s),t.closePath()}}),qA=Un({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var i=e.height,n=e.width,o=e.x,a=e.y,r=n/3*2;t.moveTo(o,a),t.lineTo(o+r,a+i),t.lineTo(o,a+i/4*3),t.lineTo(o-r,a+i),t.lineTo(o,a),t.closePath()}}),KA={line:function(t,e,i,n,o){o.x1=t,o.y1=e+n/2,o.x2=t+i,o.y2=e+n/2},rect:function(t,e,i,n,o){o.x=t,o.y=e,o.width=i,o.height=n},roundRect:function(t,e,i,n,o){o.x=t,o.y=e,o.width=i,o.height=n,o.r=Math.min(i,n)/4},square:function(t,e,i,n,o){var a=Math.min(i,n);o.x=t,o.y=e,o.width=a,o.height=a},circle:function(t,e,i,n,o){o.cx=t+i/2,o.cy=e+n/2,o.r=Math.min(i,n)/2},diamond:function(t,e,i,n,o){o.cx=t+i/2,o.cy=e+n/2,o.width=i,o.height=n},pin:function(t,e,i,n,o){o.x=t+i/2,o.y=e+n/2,o.width=i,o.height=n},arrow:function(t,e,i,n,o){o.x=t+i/2,o.y=e+n/2,o.width=i,o.height=n},triangle:function(t,e,i,n,o){o.cx=t+i/2,o.cy=e+n/2,o.width=i,o.height=n}},$A={};d({line:_M,rect:yM,roundRect:yM,square:yM,circle:sM,diamond:jA,pin:YA,arrow:qA,triangle:XA},function(t,e){$A[e]=new t});var JA=Un({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},beforeBrush:function(){var t=this.style;"pin"===this.shape.symbolType&&"inside"===t.textPosition&&(t.textPosition=["50%","40%"],t.textAlign="center",t.textVerticalAlign="middle")},buildPath:function(t,e,i){var n=e.symbolType,o=$A[n];"none"!==e.symbolType&&(o||(o=$A[n="rect"]),KA[n](e.x,e.y,e.width,e.height,o.shape),o.buildPath(t,o.shape,i))}}),QA={isDimensionStacked:pl,enableDataStack:fl,getStackedDimension:gl},tD=(Object.freeze||Object)({createList:function(t){return ml(t.getSource(),t)},getLayoutRect:ca,dataStack:QA,createScale:function(t,e){var i=e;No.isInstance(e)||h(i=new No(e),UA);var n=Hl(i);return n.setExtent(t[0],t[1]),Wl(n,i),n},mixinAxisModelCommonMethods:function(t){h(t,UA)},completeDimensions:hl,createDimensions:_A,createSymbol:Jl}),eD=1e-8;eu.prototype={constructor:eu,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;s0}),function(t){var e=t.properties,i=t.geometry,n=i.coordinates,o=[];"Polygon"===i.type&&o.push({type:"polygon",exterior:n[0],interiors:n.slice(1)}),"MultiPolygon"===i.type&&d(n,function(t){t[0]&&o.push({type:"polygon",exterior:t[0],interiors:t.slice(1)})});var a=new eu(e.name,o,e.cp);return a.properties=e,a})},nD=Bi(),oD=[0,1],aD=function(t,e,i){this.dim=t,this.scale=e,this._extent=i||[0,0],this.inverse=!1,this.onBand=!1};aD.prototype={constructor:aD,contain:function(t){var e=this._extent,i=Math.min(e[0],e[1]),n=Math.max(e[0],e[1]);return t>=i&&t<=n},containData:function(t){return this.contain(this.dataToCoord(t))},getExtent:function(){return this._extent.slice()},getPixelPrecision:function(t){return Zo(t||this.scale.getExtent(),this._extent)},setExtent:function(t,e){var i=this._extent;i[0]=t,i[1]=e},dataToCoord:function(t,e){var i=this._extent,n=this.scale;return t=n.normalize(t),this.onBand&&"ordinal"===n.type&&yu(i=i.slice(),n.count()),Bo(t,oD,i,e)},coordToData:function(t,e){var i=this._extent,n=this.scale;this.onBand&&"ordinal"===n.type&&yu(i=i.slice(),n.count());var o=Bo(t,i,oD,e);return this.scale.scale(o)},pointToData:function(t,e){},getTicksCoords:function(t){var e=(t=t||{}).tickModel||this.getTickModel(),i=au(this,e),n=f(i.ticks,function(t){return{coord:this.dataToCoord(t),tickValue:t}},this),o=e.get("alignWithLabel");return xu(this,n,i.tickCategoryInterval,o,t.clamp),n},getViewLabels:function(){return ou(this).labels},getLabelModel:function(){return this.model.getModel("axisLabel")},getTickModel:function(){return this.model.getModel("axisTick")},getBandWidth:function(){var t=this._extent,e=this.scale.getExtent(),i=e[1]-e[0]+(this.onBand?1:0);0===i&&(i=1);var n=Math.abs(t[1]-t[0]);return Math.abs(n)/i},isHorizontal:null,getRotate:null,calculateCategoryInterval:function(){return pu(this)}};var rD=iD,sD={};d(["map","each","filter","indexOf","inherits","reduce","filter","bind","curry","isArray","isString","isObject","isFunction","extend","defaults","clone","merge"],function(t){sD[t]=aw[t]});var lD={};d(["extendShape","extendPath","makePath","makeImage","mergePath","resizePath","createIcon","setHoverStyle","setLabelStyle","setTextStyle","setText","getFont","updateProps","initProps","getTransform","clipPointsByRect","clipRectByRect","Group","Image","Text","Circle","Sector","Ring","Polygon","Polyline","Rect","Line","BezierCurve","Arc","IncrementalDisplayable","CompoundPath","LinearGradient","RadialGradient","BoundingRect"],function(t){lD[t]=zM[t]}),YI.extend({type:"series.line",dependencies:["grid","polar"],getInitialData:function(t,e){return ml(this.getSource(),this)},defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,hoverAnimation:!0,clipOverflow:!0,label:{position:"top"},lineStyle:{width:2,type:"solid"},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0}});var uD=wu.prototype,hD=wu.getSymbolSize=function(t,e){var i=t.getItemVisual(e,"symbolSize");return i instanceof Array?i.slice():[+i,+i]};uD._createSymbol=function(t,e,i,n,o){this.removeAll();var a=Jl(t,-1,-1,2,2,e.getItemVisual(i,"color"),o);a.attr({z2:100,culling:!0,scale:bu(n)}),a.drift=Su,this._symbolType=t,this.add(a)},uD.stopSymbolAnimation=function(t){this.childAt(0).stopAnimation(t)},uD.getSymbolPath=function(){return this.childAt(0)},uD.getScale=function(){return this.childAt(0).scale},uD.highlight=function(){this.childAt(0).trigger("emphasis")},uD.downplay=function(){this.childAt(0).trigger("normal")},uD.setZ=function(t,e){var i=this.childAt(0);i.zlevel=t,i.z=e},uD.setDraggable=function(t){var e=this.childAt(0);e.draggable=t,e.cursor=t?"move":"pointer"},uD.updateData=function(t,e,i){this.silent=!1;var n=t.getItemVisual(e,"symbol")||"circle",o=t.hostModel,a=hD(t,e),r=n!==this._symbolType;if(r){var s=t.getItemVisual(e,"symbolKeepAspect");this._createSymbol(n,t,e,a,s)}else(l=this.childAt(0)).silent=!1,Io(l,{scale:bu(a)},o,e);if(this._updateCommon(t,e,a,i),r){var l=this.childAt(0),u=i&&i.fadeIn,h={scale:l.scale.slice()};u&&(h.style={opacity:l.style.opacity}),l.scale=[0,0],u&&(l.style.opacity=0),To(l,h,o,e)}this._seriesModel=o};var cD=["itemStyle"],dD=["emphasis","itemStyle"],fD=["label"],pD=["emphasis","label"];uD._updateCommon=function(t,e,i,n){var o=this.childAt(0),r=t.hostModel,s=t.getItemVisual(e,"color");"image"!==o.type&&o.useStyle({strokeNoScale:!0});var l=n&&n.itemStyle,u=n&&n.hoverItemStyle,h=n&&n.symbolRotate,c=n&&n.symbolOffset,d=n&&n.labelModel,f=n&&n.hoverLabelModel,p=n&&n.hoverAnimation,g=n&&n.cursorStyle;if(!n||t.hasItemOption){var m=n&&n.itemModel?n.itemModel:t.getItemModel(e);l=m.getModel(cD).getItemStyle(["color"]),u=m.getModel(dD).getItemStyle(),h=m.getShallow("symbolRotate"),c=m.getShallow("symbolOffset"),d=m.getModel(fD),f=m.getModel(pD),p=m.getShallow("hoverAnimation"),g=m.getShallow("cursor")}else u=a({},u);var v=o.style;o.attr("rotation",(h||0)*Math.PI/180||0),c&&o.attr("position",[Vo(c[0],i[0]),Vo(c[1],i[1])]),g&&o.attr("cursor",g),o.setColor(s,n&&n.symbolInnerColor),o.setStyle(l);var y=t.getItemVisual(e,"opacity");null!=y&&(v.opacity=y);var x=t.getItemVisual(e,"liftZ"),_=o.__z2Origin;null!=x?null==_&&(o.__z2Origin=o.z2,o.z2+=x):null!=_&&(o.z2=_,o.__z2Origin=null);var w=n&&n.useNameLabel;go(v,u,d,f,{labelFetcher:r,labelDataIndex:e,defaultText:function(e,i){return w?t.getName(e):_u(t,e)},isRectText:!0,autoColor:s}),o.off("mouseover").off("mouseout").off("emphasis").off("normal"),o.hoverStyle=u,fo(o),o.__symbolOriginalScale=bu(i),p&&r.isAnimationEnabled()&&o.on("mouseover",Mu).on("mouseout",Iu).on("emphasis",Tu).on("normal",Au)},uD.fadeOut=function(t,e){var i=this.childAt(0);this.silent=i.silent=!0,!(e&&e.keepLabel)&&(i.style.text=null),Io(i,{style:{opacity:0},scale:[0,0]},this._seriesModel,this.dataIndex,t)},u(wu,tb);var gD=Du.prototype;gD.updateData=function(t,e){e=Lu(e);var i=this.group,n=t.hostModel,o=this._data,a=this._symbolCtor,r=ku(t);o||i.removeAll(),t.diff(o).add(function(n){var o=t.getItemLayout(n);if(Cu(t,o,n,e)){var s=new a(t,n,r);s.attr("position",o),t.setItemGraphicEl(n,s),i.add(s)}}).update(function(s,l){var u=o.getItemGraphicEl(l),h=t.getItemLayout(s);Cu(t,h,s,e)?(u?(u.updateData(t,s,r),Io(u,{position:h},n)):(u=new a(t,s)).attr("position",h),i.add(u),t.setItemGraphicEl(s,u)):i.remove(u)}).remove(function(t){var e=o.getItemGraphicEl(t);e&&e.fadeOut(function(){i.remove(e)})}).execute(),this._data=t},gD.isPersistent=function(){return!0},gD.updateLayout=function(){var t=this._data;t&&t.eachItemGraphicEl(function(e,i){var n=t.getItemLayout(i);e.attr("position",n)})},gD.incrementalPrepareUpdate=function(t){this._seriesScope=ku(t),this._data=null,this.group.removeAll()},gD.incrementalUpdate=function(t,e,i){i=Lu(i);for(var n=t.start;n0&&Ru(i[o-1]);o--);for(;n0&&Ru(i[a-1]);a--);for(;o=0){var r=o.getItemGraphicEl(a);if(!r){var s=o.getItemLayout(a);if(!s)return;(r=new wu(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 Ar.prototype.highlight.call(this,t,e,i,n)},downplay:function(t,e,i,n){var o=t.getData(),a=zi(o,n);if(null!=a&&a>=0){var r=o.getItemGraphicEl(a);r&&(r.__temp?(o.setItemGraphicEl(a,null),this.group.remove(r)):r.downplay())}else Ar.prototype.downplay.call(this,t,e,i,n)},_newPolyline:function(t){var e=this._polyline;return e&&this._lineGroup.remove(e),e=new MD({shape:{points:t},silent:!0,z2:10}),this._lineGroup.add(e),this._polyline=e,e},_newPolygon:function(t,e){var i=this._polygon;return i&&this._lineGroup.remove(i),i=new ID({shape:{points:t,stackedOnPoints:e},silent:!0}),this._lineGroup.add(i),this._polygon=i,i},_updateAnimation:function(t,e,i,n,o,a){var r=this._polyline,s=this._polygon,l=t.hostModel,u=mD(this._data,t,this._stackedOnPoints,e,this._coordSys,i,this._valueOrigin,a),h=u.current,c=u.stackedOnCurrent,d=u.next,f=u.stackedOnNext;o&&(h=Yu(u.current,i,o),c=Yu(u.stackedOnCurrent,i,o),d=Yu(u.next,i,o),f=Yu(u.stackedOnNext,i,o)),r.shape.__points=u.current,r.shape.points=h,Io(r,{shape:{points:d}},l),s&&(s.setShape({points:h,stackedOnPoints:c}),Io(s,{shape:{points:d,stackedOnPoints:f}},l));for(var p=[],g=u.status,m=0;me&&(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},u(kD,aD);var PD={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)"]}}},ND={};ND.categoryAxis=n({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},PD),ND.valueAxis=n({boundaryGap:[0,0],splitNumber:5},PD),ND.timeAxis=r({scale:!0,min:"dataMin",max:"dataMax"},ND.valueAxis),ND.logAxis=r({scale:!0,logBase:10},ND.valueAxis);var OD=["value","category","time","log"],ED=function(t,e,i,a){d(OD,function(r){e.extend({type:t+"Axis."+r,mergeDefaultAndTheme:function(e,o){var a=this.layoutMode,s=a?ga(e):{};n(e,o.getTheme().get(r+"Axis")),n(e,this.getDefaultOption()),e.type=i(t,e),a&&pa(e,s,a)},optionUpdated:function(){"category"===this.option.type&&(this.__ordinalMeta=_l.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:o([{},ND[r+"Axis"],a],!0)})}),lI.registerSubTypeDefaulter(t+"Axis",v(i,t))},RD=lI.extend({type:"cartesian2dAxis",axis:null,init:function(){RD.superApply(this,"init",arguments),this.resetRange()},mergeOption:function(){RD.superApply(this,"mergeOption",arguments),this.resetRange()},restoreData:function(){RD.superApply(this,"restoreData",arguments),this.resetRange()},getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"grid",index:this.option.gridIndex,id:this.option.gridId})[0]}});n(RD.prototype,UA);var zD={offset:0};ED("x",RD,th,zD),ED("y",RD,th,zD),lI.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 BD=ih.prototype;BD.type="grid",BD.axisPointerEnabled=!0,BD.getRect=function(){return this._rect},BD.update=function(t,e){var i=this._axesMap;this._updateScale(t,this.model),d(i.x,function(t){Wl(t.scale,t.model)}),d(i.y,function(t){Wl(t.scale,t.model)});var n={};d(i.x,function(t){nh(i,"y",t,n)}),d(i.y,function(t){nh(i,"x",t,n)}),this.resize(this.model,e)},BD.resize=function(t,e,i){function n(){d(a,function(t){var e=t.isHorizontal(),i=e?[0,o.width]:[0,o.height],n=t.inverse?1:0;t.setExtent(i[n],i[1-n]),ah(t,e?o.x:o.y)})}var o=ca(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()});this._rect=o;var a=this._axesList;n(),!i&&t.get("containLabel")&&(d(a,function(t){if(!t.model.get("axisLabel.inside")){var e=jl(t);if(e){var i=t.isHorizontal()?"height":"width",n=t.model.get("axisLabel.margin");o[i]-=e[i]+n,"top"===t.position?o.y+=e.height+n:"left"===t.position&&(o.x+=e.width+n)}}}),n())},BD.getAxis=function(t,e){var i=this._axesMap[t];if(null!=i){if(null==e)for(var n in i)if(i.hasOwnProperty(n))return i[n];return i[e]}},BD.getAxes=function(){return this._axesList.slice()},BD.getCartesian=function(t,e){if(null!=t&&null!=e){var i="x"+t+"y"+e;return this._coordsMap[i]}w(t)&&(e=t.yAxisIndex,t=t.xAxisIndex);for(var n=0,o=this._coordsList;nu[1]?-1:1,c=["start"===o?u[0]-h*l:"end"===o?u[1]+h*l:(u[0]+u[1])/2,ph(o)?t.labelOffset+r*l:0],d=e.get("nameRotate");null!=d&&(d=d*GD/180);var f;ph(o)?n=HD(t.rotation,null!=d?d:t.rotation,r):(n=uh(t,o,d||0,u),null!=(f=t.axisNameAvailableWidth)&&(f=Math.abs(f/Math.sin(n.rotation)),!isFinite(f)&&(f=null)));var p=s.getFont(),g=e.get("nameTruncate",!0)||{},m=g.ellipsis,v=T(t.nameTruncateMaxWidth,g.maxWidth,f),y=null!=m&&null!=v?tI(i,v,p,m,{minChar:2,placeholder:g.placeholder}):i,x=e.get("tooltip",!0),_=e.mainType,w={componentType:_,name:i,$vars:["name"]};w[_+"Index"]=e.componentIndex;var b=new rM({anid:"name",__fullText:i,__truncatedText:y,position:c,rotation:n.rotation,silent:hh(e),z2:1,tooltip:x&&x.show?a({content:i,formatter:function(){return i},formatterParams:w},x):null});mo(b.style,s,{text:y,textFont:p,textFill:s.getTextColor()||e.get("axisLine.lineStyle.color"),textAlign:n.textAlign,textVerticalAlign:n.textVerticalAlign}),e.get("triggerEvent")&&(b.eventData=lh(e),b.eventData.targetType="axisName",b.eventData.name=i),this._dumbGroup.add(b),b.updateTransform(),this.group.add(b),b.decomposeTransform()}}},HD=FD.innerTextLayout=function(t,e,i){var n,o,a=Xo(e-t);return jo(a)?(o=i>0?"top":"bottom",n="center"):jo(a-GD)?(o=i>0?"bottom":"top",n="center"):(o="middle",n=a>0&&a0?"right":"left":i>0?"left":"right"),{rotation:a,textAlign:n,textVerticalAlign:o}},ZD=d,UD=v,XD=Ws({type:"axis",_axisPointer:null,axisPointerClass:null,render:function(t,e,i,n){this.axisPointerClass&&Sh(t),XD.superApply(this,"render",arguments),Dh(this,t,0,i,0,!0)},updateAxisPointer:function(t,e,i,n,o){Dh(this,t,0,i,0,!1)},remove:function(t,e){var i=this._axisPointer;i&&i.remove(e),XD.superApply(this,"remove",arguments)},dispose:function(t,e){Ch(this,e),XD.superApply(this,"dispose",arguments)}}),jD=[];XD.registerAxisPointerClass=function(t,e){jD[t]=e},XD.getAxisPointerClass=function(t){return t&&jD[t]};var YD=["axisLine","axisTickLabel","axisName"],qD=["splitArea","splitLine"],KD=XD.extend({type:"cartesianAxis",axisPointerClass:"CartesianAxisPointer",render:function(t,e,i,n){this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new tb,this.group.add(this._axisGroup),t.get("show")){var a=t.getCoordSysModel(),r=Lh(a,t),s=new FD(t,r);d(YD,s.add,s),this._axisGroup.add(s.getGroup()),d(qD,function(e){t.get(e+".show")&&this["_"+e](t,a)},this),Lo(o,this._axisGroup,t),KD.superCall(this,"render",t,e,i,n)}},remove:function(){this._splitAreaColors=null},_splitLine:function(t,e){var i=t.axis;if(!i.scale.isBlank()){var n=t.getModel("splitLine"),o=n.getModel("lineStyle"),a=o.get("color");a=y(a)?a:[a];for(var s=e.coordinateSystem.getRect(),l=i.isHorizontal(),u=0,h=i.getTicksCoords({tickModel:n}),c=[],d=[],f=o.getLineStyle(),p=0;p1){var c;"string"==typeof o?c=DD[o]:"function"==typeof o&&(c=o),c&&t.setData(n.downSample(n.mapDimension(s.dim),1/h,c,CD))}}}}}("line"));var $D=YI.extend({type:"series.__base_bar__",getInitialData:function(t,e){return ml(this.getSource(),this)},getMarkerPosition:function(t){var e=this.coordinateSystem;if(e){var i=e.dataToPoint(e.clampData(t)),n=this.getData(),o=n.getLayout("offset"),a=n.getLayout("size");return i[e.getBaseAxis().isHorizontal()?0:1]+=o+a/2,i}return[NaN,NaN]},defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod",itemStyle:{},emphasis:{}}});$D.extend({type:"series.bar",dependencies:["grid","polar"],brushSelector:"rect",getProgressive:function(){return!!this.get("large")&&this.get("progressive")},getProgressiveThreshold:function(){var t=this.get("progressiveThreshold"),e=this.get("largeThreshold");return e>t&&(t=e),t}});var JD=Qb([["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["stroke","barBorderColor"],["lineWidth","barBorderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),QD={getBarItemStyle:function(t){var e=JD(this,t);if(this.getBorderLineDash){var i=this.getBorderLineDash();i&&(e.lineDash=i)}return e}},tC=["itemStyle","barBorderWidth"];a(No.prototype,QD),Zs({type:"bar",render:function(t,e,i){this._updateDrawMode(t);var n=t.get("coordinateSystem");return"cartesian2d"!==n&&"polar"!==n||(this._isLargeDraw?this._renderLarge(t,e,i):this._renderNormal(t,e,i)),this.group},incrementalPrepareRender:function(t,e,i){this._clear(),this._updateDrawMode(t)},incrementalRender:function(t,e,i,n){this._incrementalRenderLarge(t,e)},_updateDrawMode:function(t){var e=t.pipelineContext.large;(null==this._isLargeDraw||e^this._isLargeDraw)&&(this._isLargeDraw=e,this._clear())},_renderNormal:function(t,e,i){var n,o=this.group,a=t.getData(),r=this._data,s=t.coordinateSystem,l=s.getBaseAxis();"cartesian2d"===s.type?n=l.isHorizontal():"polar"===s.type&&(n="angle"===l.dim);var u=t.isAnimationEnabled()?t:null;a.diff(r).add(function(e){if(a.hasValue(e)){var i=a.getItemModel(e),r=iC[s.type](a,e,i),l=eC[s.type](a,e,i,r,n,u);a.setItemGraphicEl(e,l),o.add(l),Eh(l,a,e,i,r,t,n,"polar"===s.type)}}).update(function(e,i){var l=r.getItemGraphicEl(i);if(a.hasValue(e)){var h=a.getItemModel(e),c=iC[s.type](a,e,h);l?Io(l,{shape:c},u,e):l=eC[s.type](a,e,h,c,n,u,!0),a.setItemGraphicEl(e,l),o.add(l),Eh(l,a,e,h,c,t,n,"polar"===s.type)}else o.remove(l)}).remove(function(t){var e=r.getItemGraphicEl(t);"cartesian2d"===s.type?e&&Nh(t,u,e):e&&Oh(t,u,e)}).execute(),this._data=a},_renderLarge:function(t,e,i){this._clear(),zh(t,this.group)},_incrementalRenderLarge:function(t,e){zh(e,this.group,!0)},dispose:B,remove:function(t){this._clear(t)},_clear:function(t){var e=this.group,i=this._data;t&&t.get("animation")&&i&&!this._isLargeDraw?i.eachItemGraphicEl(function(e){"sector"===e.type?Oh(e.dataIndex,t,e):Nh(e.dataIndex,t,e)}):e.removeAll(),this._data=null}});var eC={cartesian2d:function(t,e,i,n,o,r,s){var l=new yM({shape:a({},n)});if(r){var u=l.shape,h=o?"height":"width",c={};u[h]=0,c[h]=n[h],zM[s?"updateProps":"initProps"](l,{shape:c},r,e)}return l},polar:function(t,e,i,n,o,a,s){var l=n.startAngle0?1:-1,r=n.height>0?1:-1;return{x:n.x+a*o/2,y:n.y+r*o/2,width:n.width-a*o,height:n.height-r*o}},polar:function(t,e,i){var n=t.getItemLayout(e);return{cx:n.cx,cy:n.cy,r0:n.r0,r:n.r,startAngle:n.startAngle,endAngle:n.endAngle}}},nC=Pn.extend({type:"largeBar",shape:{points:[]},buildPath:function(t,e){for(var i=e.points,n=this.__startPoint,o=this.__valueIdx,a=0;a0&&"scale"!==u){var d=o.getItemLayout(0),f=Math.max(i.getWidth(),i.getHeight())/2,p=m(r.removeClipPath,r);r.setClipPath(this._createClipPath(d.cx,d.cy,f,d.startAngle,d.clockwise,p,t))}else r.removeClipPath();this._data=o}},dispose:function(){},_createClipPath:function(t,e,i,n,o,a,r){var s=new hM({shape:{cx:t,cy:e,r0:0,r:i,startAngle:n,endAngle:n,clockwise:o}});return To(s,{shape:{endAngle:n+(o?1:-1)*Math.PI*2}},r,a),s},containPoint:function(t,e){var i=e.getData().getItemLayout(0);if(i){var n=t[0]-i.cx,o=t[1]-i.cy,a=Math.sqrt(n*n+o*o);return a<=i.r&&a>=i.r0}}});var lC=function(t,e){d(e,function(e){e.update="updateView",Es(e,function(i,n){var o={};return n.eachComponent({mainType:"series",subType:t,query:i},function(t){t[e.method]&&t[e.method](i.name,i.dataIndex);var n=t.getData();n.each(function(e){var i=n.getName(e);o[i]=t.isSelected(i)||!1})}),{name:i.name,selected:o}})})},uC=function(t){return{getTargetSeries:function(e){var i={},n=R();return e.eachSeriesByType(t,function(t){t.__paletteScope=i,n.set(t.uid,t)}),n},reset:function(t,e){var i=t.getRawData(),n={},o=t.getData();o.each(function(t){var e=o.getRawIndex(t);n[e]=t}),i.each(function(e){var a=n[e],r=null!=a&&o.getItemVisual(a,"color",!0);if(r)i.setItemVisual(e,"color",r);else{var s=i.getItemModel(e).get("itemStyle.color")||t.getColorFromPalette(i.getName(e)||e+"",t.__paletteScope,i.count());i.setItemVisual(e,"color",s),null!=a&&o.setItemVisual(a,"color",s)}})}}},hC=function(t,e,i,n){var o,a,r=t.getData(),s=[],l=!1;r.each(function(i){var n,u,h,c,d=r.getItemLayout(i),f=r.getItemModel(i),p=f.getModel("label"),g=p.get("position")||f.get("emphasis.label.position"),m=f.getModel("labelLine"),v=m.get("length"),y=m.get("length2"),x=(d.startAngle+d.endAngle)/2,_=Math.cos(x),w=Math.sin(x);o=d.cx,a=d.cy;var b="inside"===g||"inner"===g;if("center"===g)n=d.cx,u=d.cy,c="center";else{var S=(b?(d.r+d.r0)/2*_:d.r*_)+o,M=(b?(d.r+d.r0)/2*w:d.r*w)+a;if(n=S+3*_,u=M+3*w,!b){var I=S+_*(v+e-d.r),T=M+w*(v+e-d.r),A=I+(_<0?-1:1)*y,D=T;n=A+(_<0?-5:5),u=D,h=[[S,M],[I,T],[A,D]]}c=b?"center":_>0?"left":"right"}var C=p.getFont(),L=p.get("rotate")?_<0?-x+Math.PI:-x:0,k=ke(t.getFormattedLabel(i,"normal")||r.getName(i),C,c,"top");l=!!L,d.label={x:n,y:u,position:g,height:k.height,len:v,len2:y,linePoints:h,textAlign:c,verticalAlign:"middle",rotation:L,inside:b},b||s.push(d.label)}),!l&&t.get("avoidLabelOverlap")&&Hh(s,o,a,e,i,n)},cC=2*Math.PI,dC=Math.PI/180,fC=function(t){return{seriesType:t,reset:function(t,e){var i=e.findComponents({mainType:"legend"});if(i&&i.length){var n=t.getData();n.filterSelf(function(t){for(var e=n.getName(t),o=0;o=0;s--){var l=2*s,u=n[l]-a/2,h=n[l+1]-r/2;if(t>=u&&e>=h&&t<=u+a&&e<=h+r)return s}return-1}}),gC=Uh.prototype;gC.isPersistent=function(){return!this._incremental},gC.updateData=function(t){this.group.removeAll();var e=new pC({rectHover:!0,cursor:"default"});e.setShape({points:t.getLayout("symbolPoints")}),this._setCommon(e,t),this.group.add(e),this._incremental=null},gC.updateLayout=function(t){if(!this._incremental){var e=t.getLayout("symbolPoints");this.group.eachChild(function(t){if(null!=t.startIndex){var i=2*(t.endIndex-t.startIndex),n=4*t.startIndex*2;e=new Float32Array(e.buffer,n,i)}t.setShape("points",e)})}},gC.incrementalPrepareUpdate=function(t){this.group.removeAll(),this._clearIncremental(),t.count()>2e6?(this._incremental||(this._incremental=new Zn({silent:!0})),this.group.add(this._incremental)):this._incremental=null},gC.incrementalUpdate=function(t,e){var i;this._incremental?(i=new pC,this._incremental.addDisplayable(i,!0)):((i=new pC({rectHover:!0,cursor:"default",startIndex:t.start,endIndex:t.end})).incremental=!0,this.group.add(i)),i.setShape({points:e.getLayout("symbolPoints")}),this._setCommon(i,e,!!this._incremental)},gC._setCommon=function(t,e,i){var n=e.hostModel,o=e.getVisual("symbolSize");t.setShape("size",o instanceof Array?o:[o,o]),t.symbolProxy=Jl(e.getVisual("symbol"),0,0,0,0),t.setColor=t.symbolProxy.setColor;var a=t.shape.size[0]<4;t.useStyle(n.getModel("itemStyle").getItemStyle(a?["color","shadowBlur","shadowColor"]:["color"]));var r=e.getVisual("color");r&&t.setColor(r),i||(t.seriesIndex=n.seriesIndex,t.on("mousemove",function(e){t.dataIndex=null;var i=t.findDataIndex(e.offsetX,e.offsetY);i>=0&&(t.dataIndex=i+(t.startIndex||0))}))},gC.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},gC._clearIncremental=function(){var t=this._incremental;t&&t.clearDisplaybles()},Zs({type:"scatter",render:function(t,e,i){var n=t.getData();this._updateSymbolDraw(n,t).updateData(n),this._finished=!0},incrementalPrepareRender:function(t,e,i){var n=t.getData();this._updateSymbolDraw(n,t).incrementalPrepareUpdate(n),this._finished=!1},incrementalRender:function(t,e,i){this._symbolDraw.incrementalUpdate(t,e.getData()),this._finished=t.end===e.getData().count()},updateTransform:function(t,e,i){var n=t.getData();if(this.group.dirty(),!this._finished||n.count()>1e4||!this._symbolDraw.isPersistent())return{update:!0};var o=AD().reset(t);o.progress&&o.progress({start:0,end:n.count()},n),this._symbolDraw.updateLayout(n)},_updateSymbolDraw:function(t,e){var i=this._symbolDraw,n=e.pipelineContext.large;return i&&n===this._isLargeDraw||(i&&i.remove(),i=this._symbolDraw=n?new Uh:new Du,this._isLargeDraw=n,this.group.removeAll()),this.group.add(i.group),i},remove:function(t,e){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},dispose:function(){}}),Bs(TD("scatter","circle")),zs(AD("scatter")),u(Xh,aD),jh.prototype.getIndicatorAxes=function(){return this._indicatorAxes},jh.prototype.dataToPoint=function(t,e){var i=this._indicatorAxes[e];return this.coordToPoint(i.dataToCoord(t),e)},jh.prototype.coordToPoint=function(t,e){var i=this._indicatorAxes[e].angle;return[this.cx+t*Math.cos(i),this.cy-t*Math.sin(i)]},jh.prototype.pointToData=function(t){var e=t[0]-this.cx,i=t[1]-this.cy,n=Math.sqrt(e*e+i*i);e/=n,i/=n;for(var o,a=Math.atan2(-i,e),r=1/0,s=-1,l=0;ln[0]&&isFinite(c)&&isFinite(n[0]))}else{r.getTicks().length-1>a&&(u=i(u));var d=Math.round((n[0]+n[1])/2/u)*u,f=Math.round(a/2);r.setExtent(Go(d-f*u),Go(d+(a-f)*u)),r.setInterval(u)}})},jh.dimensions=[],jh.create=function(t,e){var i=[];return t.eachComponent("radar",function(n){var o=new jh(n,t,e);i.push(o),n.coordinateSystem=o}),t.eachSeriesByType("radar",function(t){"radar"===t.get("coordinateSystem")&&(t.coordinateSystem=i[t.get("radarIndex")||0])}),i},Fa.register("radar",jh);var mC=ND.valueAxis,vC=(Fs({type:"radar",optionUpdated:function(){var t=this.get("boundaryGap"),e=this.get("splitNumber"),o=this.get("scale"),s=this.get("axisLine"),l=this.get("axisTick"),u=this.get("axisLabel"),h=this.get("name"),c=this.get("name.show"),d=this.get("name.formatter"),p=this.get("nameGap"),g=this.get("triggerEvent"),m=f(this.get("indicator")||[],function(f){null!=f.max&&f.max>0&&!f.min?f.min=0:null!=f.min&&f.min<0&&!f.max&&(f.max=0);var m=h;if(null!=f.color&&(m=r({color:f.color},h)),f=n(i(f),{boundaryGap:t,splitNumber:e,scale:o,axisLine:s,axisTick:l,axisLabel:u,name:f.text,nameLocation:"end",nameGap:p,nameTextStyle:m,triggerEvent:g},!1),c||(f.name=""),"string"==typeof d){var v=f.name;f.name=d.replace("{value}",null!=v?v:"")}else"function"==typeof d&&(f.name=d(f.name,f));var y=a(new No(f,null,this.ecModel),UA);return y.mainType="radar",y.componentIndex=this.componentIndex,y},this);this.getIndicatorModels=function(){return m}},defaultOption:{zlevel:0,z:0,center:["50%","50%"],radius:"75%",startAngle:90,name:{show:!0},boundaryGap:[0,0],splitNumber:5,nameGap:15,scale:!1,shape:"polygon",axisLine:n({lineStyle:{color:"#bbb"}},mC.axisLine),axisLabel:Yh(mC.axisLabel,!1),axisTick:Yh(mC.axisTick,!1),splitLine:Yh(mC.splitLine,!0),splitArea:Yh(mC.splitArea,!0),indicator:[]}}),["axisLine","axisTickLabel","axisName"]);Ws({type:"radar",render:function(t,e,i){this.group.removeAll(),this._buildAxes(t),this._buildSplitLineAndArea(t)},_buildAxes:function(t){var e=t.coordinateSystem;d(f(e.getIndicatorAxes(),function(t){return new FD(t.model,{position:[e.cx,e.cy],rotation:t.angle,labelDirection:-1,tickDirection:-1,nameDirection:1})}),function(t){d(vC,t.add,t),this.group.add(t.getGroup())},this)},_buildSplitLineAndArea:function(t){function e(t,e,i){var n=i%e.length;return t[n]=t[n]||[],n}var i=t.coordinateSystem,n=i.getIndicatorAxes();if(n.length){var o=t.get("shape"),a=t.getModel("splitLine"),s=t.getModel("splitArea"),l=a.getModel("lineStyle"),u=s.getModel("areaStyle"),h=a.get("show"),c=s.get("show"),p=l.get("color"),g=u.get("color");p=y(p)?p:[p],g=y(g)?g:[g];var m=[],v=[];if("circle"===o)for(var x=n[0].getTicksCoords(),_=i.cx,w=i.cy,b=0;b"+f(i,function(i,n){var o=e.get(e.mapDimension(i.dim),t);return ia(i.name+" : "+o)}).join("
")},defaultOption:{zlevel:0,z:2,coordinateSystem:"radar",legendHoverLink:!0,radarIndex:0,lineStyle:{width:2,type:"solid"},label:{position:"top"},symbol:"emptyCircle",symbolSize:4}});Zs({type:"radar",render:function(t,e,n){function o(t,e){var i=t.getItemVisual(e,"symbol")||"circle",n=t.getItemVisual(e,"color");if("none"!==i){var o=qh(t.getItemVisual(e,"symbolSize")),a=Jl(i,-1,-1,2,2,n);return a.attr({style:{strokeNoScale:!0},z2:100,scale:[o[0]/2,o[1]/2]}),a}}function a(e,i,n,a,r,s){n.removeAll();for(var l=0;l"+ia(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)"}}}}),aC);var EC="\0_ec_interaction_mutex";Es({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},function(){}),h(oc,fw);var RC={axisPointer:1,tooltip:1,brush:1};xc.prototype={constructor:xc,draw:function(t,e,i,n,o){var a="geo"===t.mainType,r=t.getData&&t.getData();a&&e.eachComponent({mainType:"series",subType:"map"},function(e){r||e.getHostGeoModel()!==t||(r=e.getData())});var s=t.coordinateSystem;this._updateBackground(s);var l=this._regionsGroup,u=this.group,h=s.scale,c={position:s.position,scale:h};!l.childAt(0)||o?u.attr(c):Io(u,c,t),l.removeAll();var f=["itemStyle"],p=["emphasis","itemStyle"],g=["label"],m=["emphasis","label"],v=R();d(s.regions,function(e){var i=v.get(e.name)||v.set(e.name,new tb),n=new MM({shape:{paths:[]}});i.add(n);var o,s=(C=t.getRegionModel(e.name)||t).getModel(f),u=C.getModel(p),c=mc(s),y=mc(u),x=C.getModel(g),_=C.getModel(m);if(r){o=r.indexOfName(e.name);var w=r.getItemVisual(o,"color",!0);w&&(c.fill=w)}d(e.geometries,function(t){if("polygon"===t.type){n.shape.paths.push(new pM({shape:{points:t.exterior}}));for(var e=0;e<(t.interiors?t.interiors.length:0);e++)n.shape.paths.push(new pM({shape:{points:t.interiors[e]}}))}}),n.setStyle(c),n.style.strokeNoScale=!0,n.culling=!0;var b=x.get("show"),S=_.get("show"),M=r&&isNaN(r.get(r.mapDimension("value"),o)),I=r&&r.getItemLayout(o);if(a||M&&(b||S)||I&&I.showLabel){var T,A=a?e.name:o;(!r||o>=0)&&(T=t);var D=new rM({position:e.center.slice(),scale:[1/h[0],1/h[1]],z2:10,silent:!0});go(D.style,D.hoverStyle={},x,_,{labelFetcher:T,labelDataIndex:A,defaultText:e.name,useInsideStyle:!1},{textAlign:"center",textVerticalAlign:"middle"}),i.add(D)}if(r)r.setItemGraphicEl(o,i);else{var C=t.getRegionModel(e.name);n.eventData={componentType:"geo",componentIndex:t.componentIndex,geoIndex:t.componentIndex,name:e.name,region:C&&C.option||{}}}(i.__regions||(i.__regions=[])).push(e),fo(i,y,{hoverSilentOnTouch:!!t.get("selectedMode")}),l.add(i)}),this._updateController(t,e,i),vc(this,t,l,i,n),yc(t,l)},remove:function(){this._regionsGroup.removeAll(),this._backgroundGroup.removeAll(),this._controller.dispose(),this._mapName&&OC.removeGraphic(this._mapName,this.uid),this._mapName=null,this._controllerHost={}},_updateBackground:function(t){var e=t.map;this._mapName!==e&&d(OC.makeGraphic(e,this.uid),function(t){this._backgroundGroup.add(t)},this),this._mapName=e},_updateController:function(t,e,i){function n(){var e={type:"geoRoam",componentType:l};return e[l+"Id"]=t.id,e}var o=t.coordinateSystem,r=this._controller,s=this._controllerHost;s.zoomLimit=t.get("scaleLimit"),s.zoom=o.getZoom(),r.enable(t.get("roam")||!1);var l=t.mainType;r.off("pan").on("pan",function(t){this._mouseDownFlag=!1,fc(s,t.dx,t.dy),i.dispatchAction(a(n(),{dx:t.dx,dy:t.dy}))},this),r.off("zoom").on("zoom",function(t){if(this._mouseDownFlag=!1,pc(s,t.scale,t.originX,t.originY),i.dispatchAction(a(n(),{zoom:t.scale,originX:t.originX,originY:t.originY})),this._updateGroup){var e=this.group.scale;this._regionsGroup.traverse(function(t){"text"===t.type&&t.attr("scale",[1/e[0],1/e[1]])})}},this),r.setPointerChecker(function(e,n,a){return o.getViewRectAfterRoam().contain(n,a)&&!gc(e,i,t)})}};var zC="__seriesMapHighDown",BC="__seriesMapCallKey";Zs({type:"map",render:function(t,e,i,n){if(!n||"mapToggleSelect"!==n.type||n.from!==this.uid){var o=this.group;if(o.removeAll(),!t.getHostGeoModel()){if(n&&"geoRoam"===n.type&&"series"===n.componentType&&n.seriesId===t.id)(a=this._mapDraw)&&o.add(a.group);else if(t.needsDrawMap){var a=this._mapDraw||new xc(i,!0);o.add(a.group),a.draw(t,e,i,this,n),this._mapDraw=a}else this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null;t.get("showLegendSymbol")&&e.getComponent("legend")&&this._renderSymbols(t,e,i)}}},remove:function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null,this.group.removeAll()},dispose:function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null},_renderSymbols:function(t,e,i){var n=t.originalData,o=this.group;n.each(n.mapDimension("value"),function(e,i){if(!isNaN(e)){var r=n.getItemLayout(i);if(r&&r.point){var s=r.point,l=r.offset,u=new sM({style:{fill:t.getData().getVisual("color")},shape:{cx:s[0]+9*l,cy:s[1],r:3},silent:!0,z2:8+(l?0:NM+1)});if(!l){var h=t.mainSeries.getData(),c=n.getName(i),d=h.indexOfName(c),f=n.getItemModel(i),p=f.getModel("label"),g=f.getModel("emphasis.label"),m=h.getItemGraphicEl(d),y=A(t.getFormattedLabel(d,"normal"),c),x=A(t.getFormattedLabel(d,"emphasis"),y),_=m[zC],w=Math.random();if(!_){_=m[zC]={};var b=v(_c,!0),S=v(_c,!1);m.on("mouseover",b).on("mouseout",S).on("emphasis",b).on("normal",S)}m[BC]=w,a(_,{recordVersion:w,circle:u,labelModel:p,hoverLabelModel:g,emphasisText:x,normalText:y}),wc(_,!1)}o.add(u)}}})}}),Es({type:"geoRoam",event:"geoRoam",update:"updateTransform"},function(t,e){var i=t.componentType||"series";e.eachComponent({mainType:i,query:t},function(e){var n=e.coordinateSystem;if("geo"===n.type){var o=bc(n,t,e.get("scaleLimit"));e.setCenter&&e.setCenter(o.center),e.setZoom&&e.setZoom(o.zoom),"series"===i&&d(e.seriesGroup,function(t){t.setCenter(o.center),t.setZoom(o.zoom)})}})});var VC=Q;h(Sc,Tw),Mc.prototype={constructor:Mc,type:"view",dimensions:["x","y"],setBoundingRect:function(t,e,i,n){return this._rect=new de(t,e,i,n),this._rect},getBoundingRect:function(){return this._rect},setViewRect:function(t,e,i,n){this.transformTo(t,e,i,n),this._viewRect=new de(t,e,i,n)},transformTo:function(t,e,i,n){var o=this.getBoundingRect(),a=this._rawTransformable;a.transform=o.calculateTransform(new de(t,e,i,n)),a.decomposeTransform(),this._updateTransform()},setCenter:function(t){t&&(this._center=t,this._updateCenterAndZoom())},setZoom:function(t){t=t||1;var e=this.zoomLimit;e&&(null!=e.max&&(t=Math.min(e.max,t)),null!=e.min&&(t=Math.max(e.min,t))),this._zoom=t,this._updateCenterAndZoom()},getDefaultCenter:function(){var t=this.getBoundingRect();return[t.x+t.width/2,t.y+t.height/2]},getCenter:function(){return this._center||this.getDefaultCenter()},getZoom:function(){return this._zoom||1},getRoamTransform:function(){return this._roamTransformable.getLocalTransform()},_updateCenterAndZoom:function(){var t=this._rawTransformable.getLocalTransform(),e=this._roamTransformable,i=this.getDefaultCenter(),n=this.getCenter(),o=this.getZoom();n=Q([],n,t),i=Q([],i,t),e.origin=n,e.position=[i[0]-n[0],i[1]-n[1]],e.scale=[o,o],this._updateTransform()},_updateTransform:function(){var t=this._roamTransformable,e=this._rawTransformable;e.parent=t,t.updateTransform(),e.updateTransform(),wt(this.transform||(this.transform=[]),e.transform||xt()),this._rawTransform=e.getLocalTransform(),this.invTransform=this.invTransform||[],Tt(this.invTransform,this.transform),this.decomposeTransform()},getViewRect:function(){return this._viewRect},getViewRectAfterRoam:function(){var t=this.getBoundingRect().clone();return t.applyTransform(this.transform),t},dataToPoint:function(t,e,i){var n=e?this._rawTransform:this.transform;return i=i||[],n?VC(i,t,n):G(i,t)},pointToData:function(t){var e=this.invTransform;return e?VC([],t,e):[t[0],t[1]]},convertToPixel:v(Ic,"dataToPoint"),convertFromPixel:v(Ic,"pointToData"),containPoint:function(t){return this.getViewRectAfterRoam().contain(t[0],t[1])}},h(Mc,Tw),Tc.prototype={constructor:Tc,type:"geo",dimensions:["lng","lat"],containCoord:function(t){for(var e=this.regions,i=0;ie&&(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;e=0&&this.hostTree.data.setItemLayout(this.dataIndex,t,e)},getLayout:function(){return this.hostTree.data.getItemLayout(this.dataIndex)},getModel:function(t){if(!(this.dataIndex<0)){var e,i=this.hostTree,n=i.data.getItemModel(this.dataIndex),o=this.getLevelModel();return o||0!==this.children.length&&(0===this.children.length||!1!==this.isExpand)||(e=this.getLeavesModel()),n.getModel(t,(o||e||i.hostModel).getModel(t))}},getLevelModel:function(){return(this.hostTree.levelModels||[])[this.depth]},getLeavesModel:function(){return this.hostTree.leavesModel},setVisual:function(t,e){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,t,e)},getVisual:function(t,e){return this.hostTree.data.getItemVisual(this.dataIndex,t,e)},getRawIndex:function(){return this.hostTree.data.getRawIndex(this.dataIndex)},getId:function(){return this.hostTree.data.getId(this.dataIndex)},isAncestorOf:function(t){for(var e=t.parentNode;e;){if(e===this)return!0;e=e.parentNode}return!1},isDescendantOf:function(t){return t!==this&&t.isAncestorOf(this)}},Vc.prototype={constructor:Vc,type:"tree",eachNode:function(t,e,i){this.root.eachNode(t,e,i)},getNodeByDataIndex:function(t){var e=this.data.getRawIndex(t);return this._nodes[e]},getNodeByName:function(t){return this.root.getNodeByName(t)},update:function(){for(var t=this.data,e=this._nodes,i=0,n=e.length;ia&&(a=t.depth)});var r=t.expandAndCollapse&&t.initialTreeDepth>=0?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 ia(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}}),Zs({type:"tree",init:function(t,e){this._oldTree,this._mainGroup=new tb,this._controller=new oc(e.getZr()),this._controllerHost={target:this.group},this.group.add(this._mainGroup)},render:function(t,e,i,n){var o=t.getData(),a=t.layoutInfo,r=this._mainGroup,s=t.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(t),this._updateController(t,e,i);var l=this._data,u={expandAndCollapse:t.get("expandAndCollapse"),layout:s,orient:t.getOrient(),curvature:t.get("lineStyle.curveness"),symbolRotate:t.get("symbolRotate"),symbolOffset:t.get("symbolOffset"),hoverAnimation:t.get("hoverAnimation"),useNameLabel:!0,fadeIn:!0};o.diff(l).add(function(e){td(o,e)&&id(o,e,null,r,t,u)}).update(function(e,i){var n=l.getItemGraphicEl(i);td(o,e)?id(o,e,n,r,t,u):n&&nd(l,i,n,r,t,u)}).remove(function(e){var i=l.getItemGraphicEl(e);i&&nd(l,e,i,r,t,u)}).execute(),this._nodeScaleRatio=t.get("nodeScaleRatio"),this._updateNodeAndLinkScale(t),!0===u.expandAndCollapse&&o.eachItemGraphicEl(function(e,n){e.off("click").on("click",function(){i.dispatchAction({type:"treeExpandAndCollapse",seriesId:t.id,dataIndex:n})})}),this._data=o},_updateViewCoordSys:function(t){var e=t.getData(),i=[];e.each(function(t){var n=e.getItemLayout(t);!n||isNaN(n.x)||isNaN(n.y)||i.push([+n.x,+n.y])});var n=[],o=[];fn(i,n,o),o[0]-n[0]==0&&(o[0]+=1,n[0]-=1),o[1]-n[1]==0&&(o[1]+=1,n[1]-=1);var a=t.coordinateSystem=new Mc;a.zoomLimit=t.get("scaleLimit"),a.setBoundingRect(n[0],n[1],o[0]-n[0],o[1]-n[1]),a.setCenter(t.get("center")),a.setZoom(t.get("zoom")),this.group.attr({position:a.position,scale:a.scale}),this._viewCoordSys=a},_updateController:function(t,e,i){var n=this._controller,o=this._controllerHost,a=this.group;n.setPointerChecker(function(e,n,o){var r=a.getBoundingRect();return r.applyTransform(a.transform),r.contain(n,o)&&!gc(e,i,t)}),n.enable(t.get("roam")),o.zoomLimit=t.get("scaleLimit"),o.zoom=t.coordinateSystem.getZoom(),n.off("pan").off("zoom").on("pan",function(e){fc(o,e.dx,e.dy),i.dispatchAction({seriesId:t.id,type:"treeRoam",dx:e.dx,dy:e.dy})},this).on("zoom",function(e){pc(o,e.scale,e.originX,e.originY),i.dispatchAction({seriesId:t.id,type:"treeRoam",zoom:e.scale,originX:e.originX,originY:e.originY}),this._updateNodeAndLinkScale(t)},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}}),Es({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(t,e){e.eachComponent({mainType:"series",subType:"tree",query:t},function(e){var i=t.dataIndex,n=e.getData().tree.getNodeByDataIndex(i);n.isExpand=!n.isExpand})}),Es({type:"treeRoam",event:"treeRoam",update:"none"},function(t,e){e.eachComponent({mainType:"series",subType:"tree",query:t},function(e){var i=bc(e.coordinateSystem,t);e.setCenter&&e.setCenter(i.center),e.setZoom&&e.setZoom(i.zoom)})});Bs(TD("tree","circle")),zs(function(t,e){t.eachSeriesByType("tree",function(t){sd(t,e)})}),YI.extend({type:"series.treemap",layoutMode:"box",dependencies:["grid","polar"],_viewRoot:null,defaultOption:{progressive:0,hoverLayerThreshold:1/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};dd(i);var n=t.levels||[];n=t.levels=fd(n,e);var o={};return o.levels=n,Vc.createTree(i,this,o).data},optionUpdated:function(){this.resetViewRoot()},formatTooltip:function(t){var e=this.getData(),i=this.getRawValue(t),n=ta(y(i)?i[0]:i);return ia(e.getName(t)+": "+n)},getDataParams:function(t){var e=YI.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return e.treePathInfo=cd(i,this),e},setLayoutInfo:function(t){this.layoutInfo=this.layoutInfo||{},a(this.layoutInfo,t)},mapIdToIndex:function(t){var e=this._idIndexMap;e||(e=this._idIndexMap=R(),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 UC=5;pd.prototype={constructor:pd,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),da(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=0,s=e.emptyItemWidth,l=t.get("breadcrumb.height"),u=ha(e.pos,e.box),h=e.totalWidth,c=e.renderList,d=c.length-1;d>=0;d--){var f=c[d],p=f.node,g=f.width,m=f.text;h>u.width&&(h-=g-s,g=s,m=null);var y=new pM({shape:{points:gd(a,0,g,l,d===c.length-1,0===d)},style:r(i.getItemStyle(),{lineJoin:"bevel",text:m,textFill:n.getTextColor(),textFont:n.getFont()}),z:10,onclick:v(o,p)});this.group.add(y),md(y,t,p),a+=g+8}},remove:function(){this.group.removeAll()}};var XC=m,jC=tb,YC=yM,qC=d,KC=["label"],$C=["emphasis","label"],JC=["upperLabel"],QC=["emphasis","upperLabel"],tL=10,eL=1,iL=2,nL=Qb([["fill","color"],["stroke","strokeColor"],["lineWidth","strokeWidth"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),oL=function(t){var e=nL(t);return e.stroke=e.fill=e.lineWidth=null,e};Zs({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(!(l(e.findComponents({mainType:"series",subType:"treemap",query:n}),t)<0)){this.seriesModel=t,this.api=i,this.ecModel=e;var o=ld(n,["treemapZoomToNode","treemapRootToNode"],t),a=n&&n.type,r=t.layoutInfo,s=!this._oldTree,u=this._storage,h="treemapRootToNode"===a&&o&&u?{rootNodeGroup:u.nodeGroup[o.node.getRawIndex()],direction:n.direction}:null,c=this._giveContainerGroup(r),d=this._doRender(c,t,h);s||a&&"treemapZoomToNode"!==a&&"treemapRootToNode"!==a?d.renderFinally():this._doAnimation(c,d,t,h),this._resetController(i),this._renderBreadcrumb(t,i,o)}},_giveContainerGroup:function(t){var e=this._containerGroup;return e||(e=this._containerGroup=new jC,this._initEvents(e),this.group.add(e)),e.attr("position",[t.x,t.y]),e},_doRender:function(t,e,i){function n(t,e,i,o,a){function r(t){return t.getId()}function s(r,s){var l=null!=r?t[r]:null,u=null!=s?e[s]:null,c=h(l,u,i,a);c&&n(l&&l.viewChildren||[],u&&u.viewChildren||[],c,o,a+1)}o?(e=t,qC(t,function(t,e){!t.isRemoved()&&s(e,e)})):new Xs(e,t,r,r).add(s).update(s).remove(v(s,null)).execute()}var o=e.getData().tree,a=this._oldTree,r={nodeGroup:[],background:[],content:[]},s={nodeGroup:[],background:[],content:[]},l=this._storage,u=[],h=v(yd,e,s,l,i,r,u);n(o.root?[o.root]:[],a&&a.root?[a.root]:[],t,o===a||!a,0);var c=function(t){var e={nodeGroup:[],background:[],content:[]};return t&&qC(t,function(t,i){var n=e[i];qC(t,function(t){t&&(n.push(t),t.__tmWillDelete=1)})}),e}(l);return this._oldTree=o,this._storage=s,{lastsForAnimation:r,willDeleteEls:c,renderFinally:function(){qC(c,function(t){qC(t,function(t){t.parent&&t.parent.remove(t)})}),qC(u,function(t){t.invisible=!0,t.dirty()})}}},_doAnimation:function(t,e,i,n){if(i.get("animation")){var o=i.get("animationDurationUpdate"),r=i.get("animationEasing"),s=vd();qC(e.willDeleteEls,function(t,e){qC(t,function(t,i){if(!t.invisible){var a,l=t.parent;if(n&&"drillDown"===n.direction)a=l===n.rootNodeGroup?{shape:{x:0,y:0,width:l.__tmNodeWidth,height:l.__tmNodeHeight},style:{opacity:0}}:{style:{opacity:0}};else{var u=0,h=0;l.__tmWillDelete||(u=l.__tmNodeWidth/2,h=l.__tmNodeHeight/2),a="nodeGroup"===e?{position:[u,h],style:{opacity:0}}:{shape:{x:u,y:h,width:0,height:0},style:{opacity:0}}}a&&s.add(t,a,o,r)}})}),qC(this._storage,function(t,i){qC(t,function(t,n){var l=e.lastsForAnimation[i][n],u={};l&&("nodeGroup"===i?l.old&&(u.position=t.position.slice(),t.attr("position",l.old)):(l.old&&(u.shape=a({},t.shape),t.setShape(l.old)),l.fadein?(t.setStyle("opacity",0),u.style={opacity:1}):1!==t.style.opacity&&(u.style={opacity:1})),s.add(t,u,o,r))})},this),this._state="animating",s.done(XC(function(){this._state="ready",e.renderFinally()},this)).start()}},_resetController:function(t){var e=this._controller;e||((e=this._controller=new oc(t.getZr())).enable(this.seriesModel.get("roam")),e.on("pan",XC(this._onPan,this)),e.on("zoom",XC(this._onZoom,this)));var i=new de(0,0,t.getWidth(),t.getHeight());e.setPointerChecker(function(t,e,n){return i.contain(e,n)})},_clearController:function(){var t=this._controller;t&&(t.dispose(),t=null)},_onPan:function(t){if("animating"!==this._state&&(Math.abs(t.dx)>3||Math.abs(t.dy)>3)){var e=this.seriesModel.getData().tree.root;if(!e)return;var i=e.getLayout();if(!i)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:i.x+t.dx,y:i.y+t.dy,width:i.width,height:i.height}})}},_onZoom:function(t){var e=t.originX,i=t.originY;if("animating"!==this._state){var n=this.seriesModel.getData().tree.root;if(!n)return;var o=n.getLayout();if(!o)return;var a=new de(o.x,o.y,o.width,o.height),r=this.seriesModel.layoutInfo;e-=r.x,i-=r.y;var s=xt();St(s,s,[-e,-i]),It(s,s,[t.scale,t.scale]),St(s,s,[e,i]),a.applyTransform(s),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:a.x,y:a.y,width:a.width,height:a.height}})}},_initEvents:function(t){t.on("click",function(t){if("ready"===this._state){var e=this.seriesModel.get("nodeClick",!0);if(e){var i=this.findTarget(t.offsetX,t.offsetY);if(i){var n=i.node;if(n.getLayout().isLeafRoot)this._rootToNode(i);else if("zoomToNode"===e)this._zoomToNode(i);else if("link"===e){var o=n.hostTree.data.getItemModel(n.dataIndex),a=o.get("link",!0),r=o.get("target",!0)||"blank";a&&window.open(a,r)}}}}},this)},_renderBreadcrumb:function(t,e,i){i||(i=null!=t.get("leafDepth",!0)?{node:t.getViewRoot()}:this.findTarget(e.getWidth()/2,e.getHeight()/2))||(i={node:t.getData().tree.root}),(this._breadcrumb||(this._breadcrumb=new pd(this.group))).render(t,e,i.node,XC(function(e){"animating"!==this._state&&(hd(t.getViewRoot(),e)?this._rootToNode({node:e}):this._zoomToNode({node:e}))},this))},remove:function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage={nodeGroup:[],background:[],content:[]},this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},dispose:function(){this._clearController()},_zoomToNode:function(t){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},_rootToNode:function(t){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},findTarget:function(t,e){var i;return this.seriesModel.getViewRoot().eachNode({attr:"viewChildren",order:"preorder"},function(n){var o=this._storage.background[n.getRawIndex()];if(o){var a=o.transformCoordToLocal(t,e),r=o.shape;if(!(r.x<=a[0]&&a[0]<=r.x+r.width&&r.y<=a[1]&&a[1]<=r.y+r.height))return!1;i={node:n,offsetX:a[0],offsetY:a[1]}}},this),i}});for(var aL=["treemapZoomToNode","treemapRender","treemapMove"],rL=0;rL=0&&t.call(e,i[o],o)},TL.eachEdge=function(t,e){for(var i=this.edges,n=i.length,o=0;o=0&&i[o].node1.dataIndex>=0&&i[o].node2.dataIndex>=0&&t.call(e,i[o],o)},TL.breadthFirstTraverse=function(t,e,i,n){if(Jd.isInstance(e)||(e=this._nodesMap[$d(e)]),e){for(var o="out"===i?"outEdges":"in"===i?"inEdges":"edges",a=0;a=0&&i.node2.dataIndex>=0});for(var o=0,a=n.length;o=0&&this[t][e].setItemVisual(this.dataIndex,i,n)},getVisual:function(i,n){return this[t][e].getItemVisual(this.dataIndex,i,n)},setLayout:function(i,n){this.dataIndex>=0&&this[t][e].setItemLayout(this.dataIndex,i,n)},getLayout:function(){return this[t][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[t][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[t][e].getRawIndex(this.dataIndex)}}};h(Jd,AL("hostGraph","data")),h(Qd,AL("hostGraph","edgeData")),IL.Node=Jd,IL.Edge=Qd,Yi(Jd),Yi(Qd);var DL=function(t,e,i,n,o){for(var a=new IL(n),r=0;r "+f)),h++)}var p,g=i.get("coordinateSystem");if("cartesian2d"===g||"polar"===g)p=ml(t,i);else{var m=Fa.get(g),v=m&&"view"!==m.type?m.dimensions||[]:[];l(v,"value")<0&&v.concat(["value"]);var y=_A(t,{coordDimensions:v});(p=new vA(y,i)).initData(t)}var x=new vA(["value"],i);return x.initData(u,s),o&&o(p,x),kc({mainData:p,struct:a,structAttr:"graph",datas:{node:p,edge:x},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a},CL=Hs({type:"series.graph",init:function(t){CL.superApply(this,"init",arguments),this.legendDataProvider=function(){return this._categoriesData},this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},mergeOption:function(t){CL.superApply(this,"mergeOption",arguments),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},mergeDefaultAndTheme:function(t){CL.superApply(this,"mergeDefaultAndTheme",arguments),Ci(t,["edgeLabel"],["show"])},getInitialData:function(t,e){var i=t.edges||t.links||[],n=t.data||t.nodes||[],o=this;if(n&&i)return DL(n,i,this,!0,function(t,i){function n(t){return(t=this.parsePath(t))&&"label"===t[0]?r:t&&"emphasis"===t[0]&&"label"===t[1]?l:this.parentModel}t.wrapMethod("getItemModel",function(t){var e=o._categoriesModels[t.getShallow("category")];return e&&(e.parentModel=t.parentModel,t.parentModel=e),t});var a=o.getModel("edgeLabel"),r=new No({label:a.option},a.parentModel,e),s=o.getModel("emphasis.edgeLabel"),l=new No({emphasis:{label:s.option}},s.parentModel,e);i.wrapMethod("getItemModel",function(t){return t.customizeGetParent(n),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){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=ia(l.join(" > ")),o.value&&(l+=" : "+ia(o.value)),l}return CL.superApply(this,"formatTooltip",arguments)},_updateCategoriesData:function(){var t=f(this.option.categories||[],function(t){return null!=t.value?t:a({value:0},t)}),e=new vA(["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 CL.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,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}}}}),LL=_M.prototype,kL=bM.prototype,PL=Un({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){(tf(e)?LL:kL).buildPath(t,e)},pointAt:function(t){return tf(this.shape)?LL.pointAt.call(this,t):kL.pointAt.call(this,t)},tangentAt:function(t){var e=this.shape,i=tf(e)?[e.x2-e.x1,e.y2-e.y1]:kL.tangentAt.call(this,t);return q(i,i)}}),NL=["fromSymbol","toSymbol"],OL=rf.prototype;OL.beforeUpdate=function(){var t=this,e=t.childOfName("fromSymbol"),i=t.childOfName("toSymbol"),n=t.childOfName("label");if(e||i||!n.ignore){for(var o=1,a=this.parent;a;)a.scale&&(o/=a.scale[0]),a=a.parent;var r=t.childOfName("line");if(this.__dirty||r.__dirty){var s=r.shape.percent,l=r.pointAt(0),u=r.pointAt(s),h=U([],u,l);if(q(h,h),e&&(e.attr("position",l),c=r.tangentAt(0),e.attr("rotation",Math.PI/2-Math.atan2(c[1],c[0])),e.attr("scale",[o*s,o*s])),i){i.attr("position",u);var c=r.tangentAt(1);i.attr("rotation",-Math.PI/2-Math.atan2(c[1],c[0])),i.attr("scale",[o*s,o*s])}if(!n.ignore){n.attr("position",u);var d,f,p,g=5*o;if("end"===n.__position)d=[h[0]*g+u[0],h[1]*g+u[1]],f=h[0]>.8?"left":h[0]<-.8?"right":"center",p=h[1]>.8?"top":h[1]<-.8?"bottom":"middle";else if("middle"===n.__position){var m=s/2,v=[(c=r.tangentAt(m))[1],-c[0]],y=r.pointAt(m);v[1]>0&&(v[0]=-v[0],v[1]=-v[1]),d=[y[0]+v[0]*g,y[1]+v[1]*g],f="center",p="bottom";var x=-Math.atan2(c[1],c[0]);u[0].8?"right":h[0]<-.8?"left":"center",p=h[1]>.8?"bottom":h[1]<-.8?"top":"middle";n.attr({style:{textVerticalAlign:n.__verticalAlign||p,textAlign:n.__textAlign||f},position:d,scale:[o,o]})}}}},OL._createLine=function(t,e,i){var n=t.hostModel,o=of(t.getItemLayout(e));o.shape.percent=0,To(o,{shape:{percent:1}},n,e),this.add(o);var a=new rM({name:"label",lineLabelOriginalOpacity:1});this.add(a),d(NL,function(i){var n=nf(i,t,e);this.add(n),this[ef(i)]=t.getItemVisual(e,i)},this),this._updateCommonStl(t,e,i)},OL.updateData=function(t,e,i){var n=t.hostModel,o=this.childOfName("line"),a=t.getItemLayout(e),r={shape:{}};af(r.shape,a),Io(o,r,n,e),d(NL,function(i){var n=t.getItemVisual(e,i),o=ef(i);if(this[o]!==n){this.remove(this.childOfName(i));var a=nf(i,t,e);this.add(a)}this[o]=n},this),this._updateCommonStl(t,e,i)},OL._updateCommonStl=function(t,e,i){var n=t.hostModel,o=this.childOfName("line"),a=i&&i.lineStyle,s=i&&i.hoverLineStyle,l=i&&i.labelModel,u=i&&i.hoverLabelModel;if(!i||t.hasItemOption){var h=t.getItemModel(e);a=h.getModel("lineStyle").getLineStyle(),s=h.getModel("emphasis.lineStyle").getLineStyle(),l=h.getModel("label"),u=h.getModel("emphasis.label")}var c=t.getItemVisual(e,"color"),f=D(t.getItemVisual(e,"opacity"),a.opacity,1);o.useStyle(r({strokeNoScale:!0,fill:"none",stroke:c,opacity:f},a)),o.hoverStyle=s,d(NL,function(t){var e=this.childOfName(t);e&&(e.setColor(c),e.setStyle({opacity:f}))},this);var p,g,m=l.getShallow("show"),v=u.getShallow("show"),y=this.childOfName("label");if((m||v)&&(p=c||"#000",null==(g=n.getFormattedLabel(e,"normal",t.dataType)))){var x=n.getRawValue(e);g=null==x?t.getName(e):isFinite(x)?Go(x):x}var _=m?g:null,w=v?A(n.getFormattedLabel(e,"emphasis",t.dataType),g):null,b=y.style;null==_&&null==w||(mo(y.style,l,{text:_},{autoColor:p}),y.__textAlign=b.textAlign,y.__verticalAlign=b.textVerticalAlign,y.__position=l.get("position")||"middle"),y.hoverStyle=null!=w?{text:w,textFill:u.getTextColor(!0),fontStyle:u.getShallow("fontStyle"),fontWeight:u.getShallow("fontWeight"),fontSize:u.getShallow("fontSize"),fontFamily:u.getShallow("fontFamily")}:{text:null},y.ignore=!m&&!v,fo(this)},OL.highlight=function(){this.trigger("emphasis")},OL.downplay=function(){this.trigger("normal")},OL.updateLayout=function(t,e){this.setLinePoints(t.getItemLayout(e))},OL.setLinePoints=function(t){var e=this.childOfName("line");af(e.shape,t),e.dirty()},u(rf,tb);var EL=sf.prototype;EL.isPersistent=function(){return!0},EL.updateData=function(t){var e=this,i=e.group,n=e._lineData;e._lineData=t,n||i.removeAll();var o=hf(t);t.diff(n).add(function(i){lf(e,t,i,o)}).update(function(i,a){uf(e,n,t,a,i,o)}).remove(function(t){i.remove(n.getItemGraphicEl(t))}).execute()},EL.updateLayout=function(){var t=this._lineData;t&&t.eachItemGraphicEl(function(e,i){e.updateLayout(t,i)},this)},EL.incrementalPrepareUpdate=function(t){this._seriesScope=hf(t),this._lineData=null,this.group.removeAll()},EL.incrementalUpdate=function(t,e){for(var i=t.start;i=o/3?1:2),l=e.y-n(r)*a*(a>=o/3?1:2);r=e.angle-Math.PI/2,t.moveTo(s,l),t.lineTo(e.x+i(r)*a,e.y+n(r)*a),t.lineTo(e.x+i(e.angle)*o,e.y+n(e.angle)*o),t.lineTo(e.x-i(r)*a,e.y-n(r)*a),t.lineTo(s,l)}}),YL=2*Math.PI,qL=(Ar.extend({type:"gauge",render:function(t,e,i){this.group.removeAll();var n=t.get("axisLine.lineStyle.color"),o=Sf(t,i);this._renderMain(t,e,i,n,o)},dispose:function(){},_renderMain:function(t,e,i,n,o){for(var a=this.group,r=t.getModel("axisLine").getModel("lineStyle"),s=t.get("clockwise"),l=-t.get("startAngle")/180*Math.PI,u=-t.get("endAngle")/180*Math.PI,h=(u-l)%YL,c=l,d=r.get("width"),f=0;f=t&&(0===e?0:n[e-1][0]).4?"bottom":"middle",textAlign:A<-.4?"left":A>.4?"right":"center"},{autoColor:P}),silent:!0}))}if(g.get("show")&&T!==v){for(var N=0;N<=y;N++){var A=Math.cos(w),D=Math.sin(w),O=new _M({shape:{x1:A*c+u,y1:D*c+h,x2:A*(c-_)+u,y2:D*(c-_)+h},silent:!0,style:I});"auto"===I.stroke&&O.setStyle({stroke:n((T+N/y)/v)}),l.add(O),w+=S}w-=S}else w+=b}},_renderPointer:function(t,e,i,n,o,a,r,s){var l=this.group,u=this._data;if(t.get("pointer.show")){var h=[+t.get("min"),+t.get("max")],c=[a,r],d=t.getData(),f=d.mapDimension("value");d.diff(u).add(function(e){var i=new jL({shape:{angle:a}});To(i,{shape:{angle:Bo(d.get(f,e),h,c,!0)}},t),l.add(i),d.setItemGraphicEl(e,i)}).update(function(e,i){var n=u.getItemGraphicEl(i);Io(n,{shape:{angle:Bo(d.get(f,e),h,c,!0)}},t),l.add(n),d.setItemGraphicEl(e,n)}).remove(function(t){var e=u.getItemGraphicEl(t);l.remove(e)}).execute(),d.eachItemGraphicEl(function(t,e){var i=d.getItemModel(e),a=i.getModel("pointer");t.setShape({x:o.cx,y:o.cy,width:Vo(a.get("width"),o.r),r:Vo(a.get("length"),o.r)}),t.useStyle(i.getModel("itemStyle").getItemStyle()),"auto"===t.style.fill&&t.setStyle("fill",n(Bo(d.get(f,e),h,[0,1],!0))),fo(t,i.getModel("emphasis.itemStyle").getItemStyle())}),this._data=d}else u&&u.eachItemGraphicEl(function(t){l.remove(t)})},_renderTitle:function(t,e,i,n,o){var a=t.getData(),r=a.mapDimension("value"),s=t.getModel("title");if(s.get("show")){var l=s.get("offsetCenter"),u=o.cx+Vo(l[0],o.r),h=o.cy+Vo(l[1],o.r),c=+t.get("min"),d=+t.get("max"),f=n(Bo(t.getData().get(r,0),[c,d],[0,1],!0));this.group.add(new rM({silent:!0,style:mo({},s,{x:u,y:h,text:a.getName(0),textAlign:"center",textVerticalAlign:"middle"},{autoColor:f,forceRich:!0})}))}},_renderDetail:function(t,e,i,n,o){var a=t.getModel("detail"),r=+t.get("min"),s=+t.get("max");if(a.get("show")){var l=a.get("offsetCenter"),u=o.cx+Vo(l[0],o.r),h=o.cy+Vo(l[1],o.r),c=Vo(a.get("width"),o.r),d=Vo(a.get("height"),o.r),f=t.getData(),p=f.get(f.mapDimension("value"),0),g=n(Bo(p,[r,s],[0,1],!0));this.group.add(new rM({silent:!0,style:mo({},a,{x:u,y:h,text:Mf(p,a.get("formatter")),textWidth:isNaN(c)?null:c,textHeight:isNaN(d)?null:d,textAlign:"center",textVerticalAlign:"middle"},{autoColor:g,forceRich:!0})}))}}}),Hs({type:"series.funnel",init:function(t){qL.superApply(this,"init",arguments),this.legendDataProvider=function(){return this.getRawData()},this._defaultLabelLine(t)},getInitialData:function(t,e){return oC(this,["value"])},_defaultLabelLine:function(t){Ci(t,"labelLine",["show"]);var e=t.labelLine,i=t.emphasis.labelLine;e.show=e.show&&t.label.show,i.show=i.show&&t.emphasis.label.show},getDataParams:function(t){var e=this.getData(),i=qL.superCall(this,"getDataParams",t),n=e.mapDimension("value"),o=e.getSum(n);return i.percent=o?+(e.get(n,t)/o*100).toFixed(2):0,i.$vars.push("percent"),i},defaultOption:{zlevel:0,z:2,legendHoverLink:!0,left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1,type:"solid"}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}}}})),KL=If.prototype,$L=["itemStyle","opacity"];KL.updateData=function(t,e,i){var n=this.childAt(0),o=t.hostModel,a=t.getItemModel(e),s=t.getItemLayout(e),l=t.getItemModel(e).get($L);l=null==l?1:l,n.useStyle({}),i?(n.setShape({points:s.points}),n.setStyle({opacity:0}),To(n,{style:{opacity:l}},o,e)):Io(n,{style:{opacity:l},shape:{points:s.points}},o,e);var u=a.getModel("itemStyle"),h=t.getItemVisual(e,"color");n.setStyle(r({lineJoin:"round",fill:h},u.getItemStyle(["opacity"]))),n.hoverStyle=u.getModel("emphasis").getItemStyle(),this._updateLabel(t,e),fo(this)},KL._updateLabel=function(t,e){var i=this.childAt(1),n=this.childAt(2),o=t.hostModel,a=t.getItemModel(e),r=t.getItemLayout(e).label,s=t.getItemVisual(e,"color");Io(i,{shape:{points:r.linePoints||r.linePoints}},o,e),Io(n,{style:{x:r.x,y:r.y}},o,e),n.attr({rotation:r.rotation,origin:[r.x,r.y],z2:10});var l=a.getModel("label"),u=a.getModel("emphasis.label"),h=a.getModel("labelLine"),c=a.getModel("emphasis.labelLine"),s=t.getItemVisual(e,"color");go(n.style,n.hoverStyle={},l,u,{labelFetcher:t.hostModel,labelDataIndex:e,defaultText:t.getName(e),autoColor:s,useInsideStyle:!!r.inside},{textAlign:r.textAlign,textVerticalAlign:r.verticalAlign}),n.ignore=n.normalIgnore=!l.get("show"),n.hoverIgnore=!u.get("show"),i.ignore=i.normalIgnore=!h.get("show"),i.hoverIgnore=!c.get("show"),i.setStyle({stroke:s}),i.setStyle(h.getModel("lineStyle").getLineStyle()),i.hoverStyle=c.getModel("lineStyle").getLineStyle()},u(If,tb);Ar.extend({type:"funnel",render:function(t,e,i){var n=t.getData(),o=this._data,a=this.group;n.diff(o).add(function(t){var e=new If(n,t);n.setItemGraphicEl(t,e),a.add(e)}).update(function(t,e){var i=o.getItemGraphicEl(e);i.updateData(n,t),a.add(i),n.setItemGraphicEl(t,i)}).remove(function(t){var e=o.getItemGraphicEl(t);a.remove(e)}).execute(),this._data=n},remove:function(){this.group.removeAll(),this._data=null},dispose:function(){}});Bs(uC("funnel")),zs(function(t,e,i){t.eachSeriesByType("funnel",function(t){var i=t.getData(),n=i.mapDimension("value"),o=t.get("sort"),a=Tf(t,e),r=Af(i,o),s=[Vo(t.get("minSize"),a.width),Vo(t.get("maxSize"),a.width)],l=i.getDataExtent(n),u=t.get("min"),h=t.get("max");null==u&&(u=Math.min(l[0],0)),null==h&&(h=l[1]);var c=t.get("funnelAlign"),d=t.get("gap"),f=(a.height-d*(i.count()-1))/i.count(),p=a.y,g=function(t,e){var o,r=Bo(i.get(n,t)||0,[u,h],s,!0);switch(c){case"left":o=a.x;break;case"center":o=a.x+(a.width-r)/2;break;case"right":o=a.x+a.width-r}return[[o,e],[o+r,e]]};"ascending"===o&&(f=-f,d=-d,p+=a.height,r=r.reverse());for(var m=0;ma&&(e[1-n]=e[n]+h.sign*a),e},tk=d,ek=Math.min,ik=Math.max,nk=Math.floor,ok=Math.ceil,ak=Go,rk=Math.PI;Nf.prototype={type:"parallel",constructor:Nf,_init:function(t,e,i){var n=t.dimensions,o=t.parallelAxisIndex;tk(n,function(t,i){var n=o[i],a=e.getComponent("parallelAxis",n),r=this._axesMap.set(t,new JL(t,Hl(a),[0,0],a.get("type"),n)),s="category"===r.type;r.onBand=s&&a.get("boundaryGap"),r.inverse=a.get("inverse"),a.axis=r,r.model=a,r.coordinateSystem=a.coordinateSystem=this},this)},update:function(t,e){this._updateAxesFromSeries(this._model,t)},containPoint:function(t){var e=this._makeLayoutInfo(),i=e.axisBase,n=e.layoutBase,o=e.pixelDimIndex,a=t[1-o],r=t[o];return a>=i&&a<=i+e.axisLength&&r>=n&&r<=n+e.layoutLength},getModel:function(){return this._model},_updateAxesFromSeries:function(t,e){e.eachSeries(function(i){if(t.contains(i,e)){var n=i.getData();tk(this.dimensions,function(t){var e=this._axesMap.get(t);e.scale.unionExtentFromData(n,n.mapDimension(t)),Wl(e.scale,e.model)},this)}},this)},resize:function(t,e){this._rect=ca(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()}),this._layoutAxes()},getRect:function(){return this._rect},_makeLayoutInfo:function(){var t,e=this._model,i=this._rect,n=["x","y"],o=["width","height"],a=e.get("layout"),r="horizontal"===a?0:1,s=i[o[r]],l=[0,s],u=this.dimensions.length,h=Of(e.get("axisExpandWidth"),l),c=Of(e.get("axisExpandCount")||0,[0,u]),d=e.get("axisExpandable")&&u>3&&u>c&&c>1&&h>0&&s>0,f=e.get("axisExpandWindow");f?(t=Of(f[1]-f[0],l),f[1]=f[0]+t):(t=Of(h*(c-1),l),(f=[h*(e.get("axisExpandCenter")||nk(u/2))-t/2])[1]=f[0]+t);var p=(s-t)/(u-c);p<3&&(p=0);var g=[nk(ak(f[0]/h,1))+1,ok(ak(f[1]/h,1))-1],m=p/h*f[0];return{layout:a,pixelDimIndex:r,layoutBase:i[n[r]],layoutLength:s,axisBase:i[n[1-r]],axisLength:i[o[1-r]],axisExpandable:d,axisExpandWidth:h,axisCollapseWidth:p,axisExpandWindow:f,axisCount:u,winInnerIndices:g,axisExpandWindow0Pos:m}},_layoutAxes:function(){var t=this._rect,e=this._axesMap,i=this.dimensions,n=this._makeLayoutInfo(),o=n.layout;e.each(function(t){var e=[0,n.axisLength],i=t.inverse?1:0;t.setExtent(e[i],e[1-i])}),tk(i,function(e,i){var a=(n.axisExpandable?Rf:Ef)(i,n),r={horizontal:{x:a.position,y:n.axisLength},vertical:{x:0,y:a.position}},s={horizontal:rk/2,vertical:0},l=[r[o].x+t.x,r[o].y+t.y],u=s[o],h=xt();Mt(h,h,u),St(h,h,l),this._axesLayout[e]={position:l,rotation:u,transform:h,axisNameAvailableWidth:a.axisNameAvailableWidth,axisLabelShow:a.axisLabelShow,nameTruncateMaxWidth:a.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}},this)},getAxis:function(t){return this._axesMap.get(t)},dataToPoint:function(t,e){return this.axisCoordToPoint(this._axesMap.get(e).dataToCoord(t),e)},eachActiveState:function(t,e,i,n){null==i&&(i=0),null==n&&(n=t.count());var o=this._axesMap,a=this.dimensions,r=[],s=[];d(a,function(e){r.push(t.mapDimension(e)),s.push(o.get(e).model)});for(var l=this.hasAxisBrushed(),u=i;uo*(1-h[0])?(l="jump",r=s-o*(1-h[2])):(r=s-o*h[1])>=0&&(r=s-o*(1-h[1]))<=0&&(r=0),(r*=e.axisExpandWidth/u)?QL(r,n,a,"all"):l="none";else{o=n[1]-n[0];(n=[ik(0,a[1]*s/o-o/2)])[1]=ek(a[1],n[0]+o),n[0]=n[1]-o}return{axisExpandWindow:n,behavior:l}}},Fa.register("parallel",{create:function(t,e){var i=[];return t.eachComponent("parallel",function(n,o){var a=new Nf(n,t,e);a.name="parallel_"+o,a.resize(n,e),n.coordinateSystem=a,a.model=n,i.push(a)}),t.eachSeries(function(e){if("parallel"===e.get("coordinateSystem")){var i=t.queryComponents({mainType:"parallel",index:e.get("parallelIndex"),id:e.get("parallelId")})[0];e.coordinateSystem=i.coordinateSystem}}),i}});var sk=lI.extend({type:"baseParallelAxis",axis:null,activeIntervals:[],getAreaSelectStyle:function(){return Qb([["fill","color"],["lineWidth","borderWidth"],["stroke","borderColor"],["width","width"],["opacity","opacity"]])(this.getModel("areaSelectStyle"))},setActiveIntervals:function(t){var e=this.activeIntervals=i(t);if(e)for(var n=e.length-1;n>=0;n--)Fo(e[n])},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;n5)return;var n=this._model.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]);"none"!==n.behavior&&this._dispatchExpand({axisExpandWindow:n.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(t){if(!this._mouseDownPoint&&Ip(this,"mousemove")){var e=this._model,i=e.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]),n=i.behavior;"jump"===n&&this._throttledDispatchExpand.debounceNextCall(e.get("axisExpandDebounce")),this._throttledDispatchExpand("none"===n?null:{axisExpandWindow:i.axisExpandWindow,animation:"jump"===n&&null})}}};Ns(function(t){Cf(t),Lf(t)}),YI.extend({type:"series.parallel",dependencies:["parallel"],visualColorAccessPath:"lineStyle.color",getInitialData:function(t,e){var i=this.getSource();return Tp(i,this),ml(i,this)},getRawIndicesByActiveState:function(t){var e=this.coordinateSystem,i=this.getData(),n=[];return e.eachActiveState(i,function(e,o){t===e&&n.push(i.getRawIndex(o))}),n},defaultOption:{zlevel:0,z:2,coordinateSystem:"parallel",parallelIndex:0,label:{show:!1},inactiveOpacity:.05,activeOpacity:1,lineStyle:{width:1,opacity:.45,type:"solid"},emphasis:{label:{show:!1}},progressive:500,smooth:!1,animationEasing:"linear"}});var Dk=.3,Ck=(Ar.extend({type:"parallel",init:function(){this._dataGroup=new tb,this.group.add(this._dataGroup),this._data,this._initialized},render:function(t,e,i,n){var o=this._dataGroup,a=t.getData(),r=this._data,s=t.coordinateSystem,l=s.dimensions,u=kp(t);if(a.diff(r).add(function(t){Pp(Lp(a,o,t,l,s),a,t,u)}).update(function(e,i){var o=r.getItemGraphicEl(i),h=Cp(a,e,l,s);a.setItemGraphicEl(e,o),Io(o,{shape:{points:h}},n&&!1===n.animation?null:t,e),Pp(o,a,e,u)}).remove(function(t){var e=r.getItemGraphicEl(t);o.remove(e)}).execute(),!this._initialized){this._initialized=!0;var h=Dp(s,t,function(){setTimeout(function(){o.removeClipPath()})});o.setClipPath(h)}this._data=a},incrementalPrepareRender:function(t,e,i){this._initialized=!0,this._data=null,this._dataGroup.removeAll()},incrementalRender:function(t,e,i){for(var n=e.getData(),o=e.coordinateSystem,a=o.dimensions,r=kp(e),s=t.start;sn&&(n=e)}),d(e,function(e){var o=new hL({type:"color",mappingMethod:"linear",dataExtent:[i,n],visual:t.get("color")}).mapValueToVisual(e.getLayout().value);e.setVisual("color",o);var a=e.getModel().get("itemStyle.color");null!=a&&e.setVisual("color",a)})}})});var Ok={_baseAxisDim:null,getInitialData:function(t,e){var i,n,o=e.getComponent("xAxis",this.get("xAxisIndex")),a=e.getComponent("yAxis",this.get("yAxisIndex")),r=o.get("type"),s=a.get("type");"category"===r?(t.layout="horizontal",i=o.getOrdinalMeta(),n=!0):"category"===s?(t.layout="vertical",i=a.getOrdinalMeta(),n=!0):t.layout=t.layout||"horizontal";var l=["x","y"],u="horizontal"===t.layout?0:1,h=this._baseAxisDim=l[u],c=l[1-u],f=[o,a],p=f[u].get("type"),g=f[1-u].get("type"),m=t.data;if(m&&n){var v=[];d(m,function(t,e){var i;t.value&&y(t.value)?(i=t.value.slice(),t.value.unshift(e)):y(t)?(i=t.slice(),t.unshift(e)):i=t,v.push(i)}),t.data=v}var x=this.defaultValueDimensions;return oC(this,{coordDimensions:[{name:h,type:qs(p),ordinalMeta:i,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:c,type:qs(g),dimsDef:x.slice()}],dimensionsCount:x.length+1})},getBaseAxis:function(){var t=this._baseAxisDim;return this.ecModel.getComponent(t+"Axis",this.get(t+"AxisIndex")).axis}};h(YI.extend({type:"series.boxplot",dependencies:["xAxis","yAxis","grid"],defaultValueDimensions:[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],dimensions:null,defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,hoverAnimation:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:2,shadowOffsetY:2,shadowColor:"rgba(0,0,0,0.4)"}},animationEasing:"elasticOut",animationDuration:800}}),Ok,!0);var Ek=["itemStyle"],Rk=["emphasis","itemStyle"],zk=(Ar.extend({type:"boxplot",render:function(t,e,i){var n=t.getData(),o=this.group,a=this._data;this._data||o.removeAll();var r="horizontal"===t.get("layout")?1:0;n.diff(a).add(function(t){if(n.hasValue(t)){var e=ig(n.getItemLayout(t),n,t,r,!0);n.setItemGraphicEl(t,e),o.add(e)}}).update(function(t,e){var i=a.getItemGraphicEl(e);if(n.hasValue(t)){var s=n.getItemLayout(t);i?ng(s,i,n,t):i=ig(s,n,t,r),o.add(i),n.setItemGraphicEl(t,i)}else o.remove(i)}).remove(function(t){var e=a.getItemGraphicEl(t);e&&o.remove(e)}).execute(),this._data=n},remove:function(t){var e=this.group,i=this._data;this._data=null,i&&i.eachItemGraphicEl(function(t){t&&e.remove(t)})},dispose:B}),Pn.extend({type:"boxplotBoxPath",shape:{},buildPath:function(t,e){var i=e.points,n=0;for(t.moveTo(i[n][0],i[n][1]),n++;n<4;n++)t.lineTo(i[n][0],i[n][1]);for(t.closePath();n0?jk:Yk)}function n(t,e){return e.get(t>0?Uk:Xk)}var o=t.getData(),a=t.pipelineContext.large;if(o.setVisual({legendSymbol:"roundRect",colorP:i(1,t),colorN:i(-1,t),borderColorP:n(1,t),borderColorN:n(-1,t)}),!e.isSeriesFiltered(t))return!a&&{progress:function(t,e){for(var o;null!=(o=t.next());){var a=e.getItemModel(o),r=e.getItemLayout(o).sign;e.setItemVisual(o,{color:i(r,a),borderColor:n(r,a)})}}}}},Kk="undefined"!=typeof Float32Array?Float32Array:Array,$k={seriesType:"candlestick",plan:$I(),reset:function(t){var e=t.coordinateSystem,i=t.getData(),n=pg(t,i),o=0,a=1,r=["x","y"],s=i.mapDimension(r[o]),l=i.mapDimension(r[a],!0),u=l[0],h=l[1],c=l[2],d=l[3];if(i.setLayout({candleWidth:n,isSimpleBox:n<=1.3}),!(null==s||l.length<4))return{progress:t.pipelineContext.large?function(t,i){for(var n,r,l=new Kk(5*t.count),f=0,p=[],g=[];null!=(r=t.next());){var m=i.get(s,r),v=i.get(u,r),y=i.get(h,r),x=i.get(c,r),_=i.get(d,r);isNaN(m)||isNaN(x)||isNaN(_)?(l[f++]=NaN,f+=4):(l[f++]=fg(i,r,v,y,h),p[o]=m,p[a]=x,n=e.dataToPoint(p,null,g),l[f++]=n?n[0]:NaN,l[f++]=n?n[1]:NaN,p[a]=_,n=e.dataToPoint(p,null,g),l[f++]=n?n[1]:NaN)}i.setLayout("largePoints",l)}:function(t,i){function r(t,i){var n=[];return n[o]=i,n[a]=t,isNaN(i)||isNaN(t)?[NaN,NaN]:e.dataToPoint(n)}function l(t,e,i){var a=e.slice(),r=e.slice();a[o]=Jn(a[o]+n/2,1,!1),r[o]=Jn(r[o]-n/2,1,!0),i?t.push(a,r):t.push(r,a)}function f(t){return t[o]=Jn(t[o],1),t}for(var p;null!=(p=t.next());){var g=i.get(s,p),m=i.get(u,p),v=i.get(h,p),y=i.get(c,p),x=i.get(d,p),_=Math.min(m,v),w=Math.max(m,v),b=r(_,g),S=r(w,g),M=r(y,g),I=r(x,g),T=[];l(T,S,0),l(T,b,1),T.push(f(I),f(S),f(M),f(b)),i.setItemLayout(p,{sign:fg(i,p,m,v,h),initBaseline:m>v?S[a]:b[a],ends:T,brushRect:function(t,e,i){var s=r(t,i),l=r(e,i);return s[o]-=n/2,l[o]-=n/2,{x:s[0],y:s[1],width:a?n:l[0]-s[0],height:a?l[1]-s[1]:n}}(y,x,g)})}}}}};Ns(function(t){t&&y(t.series)&&d(t.series,function(t){w(t)&&"k"===t.type&&(t.type="candlestick")})}),Bs(qk),zs($k),YI.extend({type:"series.effectScatter",dependencies:["grid","polar"],getInitialData:function(t,e){return ml(this.getSource(),this)},brushSelector:"point",defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,effectType:"ripple",progressive:0,showEffectOn:"render",rippleEffect:{period:4,scale:2.5,brushType:"fill"},symbolSize:10}});var Jk=vg.prototype;Jk.stopEffectAnimation=function(){this.childAt(1).removeAll()},Jk.startEffectAnimation=function(t){for(var e=t.symbolType,i=t.color,n=this.childAt(1),o=0;o<3;o++){var a=Jl(e,-1,-1,2,2,i);a.attr({style:{strokeNoScale:!0},z2:99,silent:!0,scale:[.5,.5]});var r=-o/3*t.period+t.effectOffset;a.animate("",!0).when(t.period,{scale:[t.rippleScale/2,t.rippleScale/2]}).delay(r).start(),a.animateStyle(!0).when(t.period,{opacity:0}).delay(r).start(),n.add(a)}mg(n,t)},Jk.updateEffectAnimation=function(t){for(var e=this._effectCfg,i=this.childAt(1),n=["symbolType","period","rippleScale"],o=0;o "))},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,label:{show:!1,position:"end"},lineStyle:{opacity:.5}}}),iP=xg.prototype;iP.createLine=function(t,e,i){return new rf(t,e,i)},iP._updateEffectSymbol=function(t,e){var i=t.getItemModel(e).getModel("effect"),n=i.get("symbolSize"),o=i.get("symbol");y(n)||(n=[n,n]);var a=i.get("color")||t.getItemVisual(e,"color"),r=this.childAt(1);this._symbolType!==o&&(this.remove(r),(r=Jl(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))},iP._updateEffectAnimation=function(t,e,i){var n=this.childAt(1);if(n){var o=this,a=t.getItemLayout(i),r=1e3*e.get("period"),s=e.get("loop"),l=e.get("constantSpeed"),u=T(e.get("delay"),function(e){return e/t.count()*r/3}),h="function"==typeof u;if(n.ignore=!0,this.updateAnimationPoints(n,a),l>0&&(r=this.getLineLength(n)/l*1e3),r!==this._period||s!==this._loop){n.stopAnimation();var c=u;h&&(c=u(i)),n.__t>0&&(c=-r*n.__t),n.__t=0;var d=n.animate("",s).when(r,{__t:1}).delay(c).during(function(){o.updateSymbolPosition(n)});s||d.done(function(){o.remove(n)}),d.start()}this._period=r,this._loop=s}},iP.getLineLength=function(t){return uw(t.__p1,t.__cp1)+uw(t.__cp1,t.__p2)},iP.updateAnimationPoints=function(t,e){t.__p1=e[0],t.__p2=e[1],t.__cp1=e[2]||[(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2]},iP.updateData=function(t,e,i){this.childAt(0).updateData(t,e,i),this._updateEffectSymbol(t,e)},iP.updateSymbolPosition=function(t){var e=t.__p1,i=t.__p2,n=t.__cp1,o=t.__t,a=t.position,r=sn,s=ln;a[0]=r(e[0],n[0],i[0],o),a[1]=r(e[1],n[1],i[1],o);var l=s(e[0],n[0],i[0],o),u=s(e[1],n[1],i[1],o);t.rotation=-Math.atan2(u,l)-Math.PI/2,t.ignore=!1},iP.updateLayout=function(t,e){this.childAt(0).updateLayout(t,e);var i=t.getItemModel(e).getModel("effect");this._updateEffectAnimation(t,i,e)},u(xg,tb);var nP=_g.prototype;nP._createPolyline=function(t,e,i){var n=t.getItemLayout(e),o=new gM({shape:{points:n}});this.add(o),this._updateCommonStl(t,e,i)},nP.updateData=function(t,e,i){var n=t.hostModel;Io(this.childAt(0),{shape:{points:t.getItemLayout(e)}},n,e),this._updateCommonStl(t,e,i)},nP._updateCommonStl=function(t,e,i){var n=this.childAt(0),o=t.getItemModel(e),a=t.getItemVisual(e,"color"),s=i&&i.lineStyle,l=i&&i.hoverLineStyle;i&&!t.hasItemOption||(s=o.getModel("lineStyle").getLineStyle(),l=o.getModel("emphasis.lineStyle").getLineStyle()),n.useStyle(r({strokeNoScale:!0,fill:"none",stroke:a},s)),n.hoverStyle=l,fo(this)},nP.updateLayout=function(t,e){this.childAt(0).setShape("points",t.getItemLayout(e))},u(_g,tb);var oP=wg.prototype;oP.createLine=function(t,e,i){return new _g(t,e,i)},oP.updateAnimationPoints=function(t,e){this._points=e;for(var i=[0],n=0,o=1;o=0&&!(n[r]<=e);r--);r=Math.min(r,o-2)}else{for(var r=a;re);r++);r=Math.min(r-1,o-2)}J(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}},u(wg,xg);var aP=Un({shape:{polyline:!1,curveness:0,segs:[]},buildPath:function(t,e){var i=e.segs,n=e.curveness;if(e.polyline)for(r=0;r0){t.moveTo(i[r++],i[r++]);for(var a=1;a0){var c=(s+u)/2-(l-h)*n,d=(l+h)/2-(u-s)*n;t.quadraticCurveTo(c,d,u,h)}else t.lineTo(u,h)}},findDataIndex:function(t,e){var i=this.shape,n=i.segs,o=i.curveness;if(i.polyline)for(var a=0,r=0;r0)for(var l=n[r++],u=n[r++],h=1;h0){if(_n(l,u,(l+c)/2-(u-d)*o,(u+d)/2-(c-l)*o,c,d))return a}else if(yn(l,u,c,d))return a;a++}return-1}}),rP=bg.prototype;rP.isPersistent=function(){return!this._incremental},rP.updateData=function(t){this.group.removeAll();var e=new aP({rectHover:!0,cursor:"default"});e.setShape({segs:t.getLayout("linesPoints")}),this._setCommon(e,t),this.group.add(e),this._incremental=null},rP.incrementalPrepareUpdate=function(t){this.group.removeAll(),this._clearIncremental(),t.count()>5e5?(this._incremental||(this._incremental=new Zn({silent:!0})),this.group.add(this._incremental)):this._incremental=null},rP.incrementalUpdate=function(t,e){var i=new aP;i.setShape({segs:e.getLayout("linesPoints")}),this._setCommon(i,e,!!this._incremental),this._incremental?this._incremental.addDisplayable(i,!0):(i.rectHover=!0,i.cursor="default",i.__startIndex=t.start,this.group.add(i))},rP.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},rP._setCommon=function(t,e,i){var n=e.hostModel;t.setShape({polyline:n.get("polyline"),curveness:n.get("lineStyle.curveness")}),t.useStyle(n.getModel("lineStyle").getLineStyle()),t.style.strokeNoScale=!0;var o=e.getVisual("color");o&&t.setStyle("stroke",o),t.setStyle("fill"),i||(t.seriesIndex=n.seriesIndex,t.on("mousemove",function(e){t.dataIndex=null;var i=t.findDataIndex(e.offsetX,e.offsetY);i>0&&(t.dataIndex=i+t.__startIndex)}))},rP._clearIncremental=function(){var t=this._incremental;t&&t.clearDisplaybles()};var sP={seriesType:"lines",plan:$I(),reset:function(t){var e=t.coordinateSystem,i=t.get("polyline"),n=t.pipelineContext.large;return{progress:function(o,a){var r=[];if(n){var s,l=o.end-o.start;if(i){for(var u=0,h=o.start;h0){var I=a(v)?s:l;v>0&&(v=v*S+b),x[_++]=I[M],x[_++]=I[M+1],x[_++]=I[M+2],x[_++]=I[M+3]*v*256}else _+=4}return c.putImageData(y,0,0),h},_getBrush:function(){var t=this._brushCanvas||(this._brushCanvas=iw()),e=this.pointSize+this.blurSize,i=2*e;t.width=i,t.height=i;var n=t.getContext("2d");return n.clearRect(0,0,i,i),n.shadowOffsetX=i,n.shadowBlur=this.blurSize,n.shadowColor="#000",n.beginPath(),n.arc(-e,e,this.pointSize,0,2*Math.PI,!0),n.closePath(),n.fill(),t},_getGradient:function(t,e,i){for(var n=this._gradientPixels,o=n[i]||(n[i]=new Uint8ClampedArray(1024)),a=[0,0,0,0],r=0,s=0;s<256;s++)e[i](s/255,!0,a),o[r++]=a[0],o[r++]=a[1],o[r++]=a[2],o[r++]=a[3];return o}},Zs({type:"heatmap",render:function(t,e,i){var n;e.eachComponent("visualMap",function(e){e.eachTargetSeries(function(i){i===t&&(n=e)})}),this.group.removeAll(),this._incrementalDisplayable=null;var o=t.coordinateSystem;"cartesian2d"===o.type||"calendar"===o.type?this._renderOnCartesianAndCalendar(t,i,0,t.getData().count()):Ag(o)&&this._renderOnGeo(o,t,n,i)},incrementalPrepareRender:function(t,e,i){this.group.removeAll()},incrementalRender:function(t,e,i,n){e.coordinateSystem&&this._renderOnCartesianAndCalendar(e,n,t.start,t.end,!0)},_renderOnCartesianAndCalendar:function(t,e,i,n,o){var r,s,l=t.coordinateSystem;if("cartesian2d"===l.type){var u=l.getAxis("x"),h=l.getAxis("y");r=u.getBandWidth(),s=h.getBandWidth()}for(var c=this.group,d=t.getData(),f=t.getModel("itemStyle").getItemStyle(["color"]),p=t.getModel("emphasis.itemStyle").getItemStyle(),g=t.getModel("label"),m=t.getModel("emphasis.label"),v=l.type,y="cartesian2d"===v?[d.mapDimension("x"),d.mapDimension("y"),d.mapDimension("value")]:[d.mapDimension("time"),d.mapDimension("value")],x=i;x=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}},Fa.register("single",{create:function(t,e){var i=[];return t.eachComponent("singleAxis",function(n,o){var a=new $g(n,t,e);a.name="single_"+o,a.resize(n,e),n.coordinateSystem=a,i.push(a)}),t.eachSeries(function(e){if("singleAxis"===e.get("coordinateSystem")){var i=t.queryComponents({mainType:"singleAxis",index:e.get("singleAxisIndex"),id:e.get("singleAxisId")})[0];e.coordinateSystem=i&&i.coordinateSystem}}),i},dimensions:$g.prototype.dimensions});var gP=["axisLine","axisTickLabel","axisName"],mP=XD.extend({type:"singleAxis",axisPointerClass:"SingleAxisPointer",render:function(t,e,i,n){var o=this.group;o.removeAll();var a=Jg(t),r=new FD(t,a);d(gP,r.add,r),o.add(r.getGroup()),t.get("splitLine.show")&&this._splitLine(t),mP.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;f=0)&&i({type:"updateAxisPointer",currTrigger:t,x:e&&e.offsetX,y:e&&e.offsetY})})},remove:function(t,e){gm(e.getZr(),"axisPointer"),IP.superApply(this._model,"remove",arguments)},dispose:function(t,e){gm("axisPointer",e),IP.superApply(this._model,"dispose",arguments)}}),TP=Bi(),AP=i,DP=m;(mm.prototype={_group:null,_lastGraphicKey:null,_handle:null,_dragging:!1,_lastValue:null,_lastStatus:null,_payloadInfo:null,animationThreshold:15,render:function(t,e,i,n){var o=e.get("value"),a=e.get("status");if(this._axisModel=t,this._axisPointerModel=e,this._api=i,n||this._lastValue!==o||this._lastStatus!==a){this._lastValue=o,this._lastStatus=a;var r=this._group,s=this._handle;if(!a||"hide"===a)return r&&r.hide(),void(s&&s.hide());r&&r.show(),s&&s.show();var l={};this.makeElOption(l,o,t,e,i);var u=l.graphicKey;u!==this._lastGraphicKey&&this.clear(i),this._lastGraphicKey=u;var h=this._moveAnimation=this.determineAnimation(t,e);if(r){var c=v(vm,e,h);this.updatePointerEl(r,l,c,e),this.updateLabelEl(r,l,c,e)}else r=this._group=new tb,this.createPointerEl(r,l,t,e),this.createLabelEl(r,l,t,e),i.getZr().add(r);wm(r,e,!0),this._renderHandle(o)}},remove:function(t){this.clear(t)},dispose:function(t){this.clear(t)},determineAnimation:function(t,e){var i=e.get("animation"),n=t.axis,o="category"===n.type,a=e.get("snap");if(!a&&!o)return!1;if("auto"===i||null==i){var r=this.animationThreshold;if(o&&n.getBandWidth()>r)return!0;if(a){var s=Mh(t).seriesDataCount,l=n.getExtent();return Math.abs(l[0]-l[1])/s>r}return!1}return!0===i},makeElOption:function(t,e,i,n,o){},createPointerEl:function(t,e,i,n){var o=e.pointer;if(o){var a=TP(t).pointerEl=new zM[o.type](AP(e.pointer));t.add(a)}},createLabelEl:function(t,e,i,n){if(e.label){var o=TP(t).labelEl=new yM(AP(e.label));t.add(o),xm(o,n)}},updatePointerEl:function(t,e,i){var n=TP(t).pointerEl;n&&(n.setStyle(e.pointer.style),i(n,{shape:e.pointer.shape}))},updateLabelEl:function(t,e,i,n){var o=TP(t).labelEl;o&&(o.setStyle(e.label.style),i(o,{shape:e.label.shape,position:e.label.position}),xm(o,n))},_renderHandle:function(t){if(!this._dragging&&this.updateHandleTransform){var e=this._axisPointerModel,i=this._api.getZr(),n=this._handle,o=e.getModel("handle"),a=e.get("status");if(!o.get("show")||!a||"hide"===a)return n&&i.remove(n),void(this._handle=null);var r;this._handle||(r=!0,n=this._handle=Po(o.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(t){mw(t.event)},onmousedown:DP(this._onHandleDragMove,this,0,0),drift:DP(this._onHandleDragMove,this),ondragend:DP(this._onHandleDragEnd,this)}),i.add(n)),wm(n,e,!1);var s=["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];n.setStyle(o.getItemStyle(null,s));var l=o.get("size");y(l)||(l=[l,l]),n.attr("scale",[l[0]/2,l[1]/2]),Nr(this,"_doDispatchAxisPointer",o.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,r)}},_moveHandleToValue:function(t,e){vm(this._axisPointerModel,!e&&this._moveAnimation,this._handle,_m(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},_onHandleDragMove:function(t,e){var i=this._handle;if(i){this._dragging=!0;var n=this.updateHandleTransform(_m(i),[t,e],this._axisModel,this._axisPointerModel);this._payloadInfo=n,i.stopAnimation(),i.attr(_m(n)),TP(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 i=i||0,{x:t[i],y:t[1-i],width:e[i],height:e[1-i]}}}).constructor=mm,ji(mm);var CP=mm.extend({makeElOption:function(t,e,i,n,o){var a=i.axis,r=a.grid,s=n.get("type"),l=km(r,a).getOtherAxis(a).getGlobalExtent(),u=a.toGlobalCoord(a.dataToCoord(e,!0));if(s&&"none"!==s){var h=bm(n),c=LP[s](a,u,l,h);c.style=h,t.graphicKey=c.type,t.pointer=c}Am(e,t,Lh(r.model,i),i,n,o)},getHandleTransform:function(t,e,i){var n=Lh(e.axis.grid.model,e,{labelInside:!1});return n.labelMargin=i.get("handle.margin"),{position:Tm(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=km(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];var d=[{verticalAlign:"middle"},{align:"center"}];return{position:u,rotation:t.rotation,cursorPoint:c,tooltipOption:d[l]}}}),LP={line:function(t,e,i,n){var o=Dm([e,i[0]],[e,i[1]],Pm(t));return Kn({shape:o,style:n}),{type:"Line",shape:o}},shadow:function(t,e,i,n){var o=Math.max(1,t.getBandWidth()),a=i[1]-i[0];return{type:"Rect",shape:Cm([e-o/2,i[0]],[o,a],Pm(t))}}};XD.registerAxisPointerClass("CartesianAxisPointer",CP),Ns(function(t){if(t){(!t.axisPointer||0===t.axisPointer.length)&&(t.axisPointer={});var e=t.axisPointer.link;e&&!y(e)&&(t.axisPointer.link=[e])}}),Os(VT.PROCESSOR.STATISTIC,function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=vh(t,e)}),Es({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},function(t,e,i){var n=t.currTrigger,o=[t.x,t.y],a=t,r=t.dispatchAction||m(i.dispatchAction,i),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){lm(o)&&(o=xP({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},e).point);var l=lm(o),u=a.axesInfo,h=s.axesInfo,c="leave"===n||lm(o),d={},f={},p={list:[],map:{}},g={showPointer:wP(em,f),showTooltip:wP(im,p)};_P(s.coordSysMap,function(t,e){var i=l||t.containPoint(o);_P(s.coordSysAxesInfo[e],function(t,e){var n=t.axis,a=rm(u,t);if(!c&&i&&(!u||a)){var r=a&&a.value;null!=r||l||(r=n.pointToData(o)),null!=r&&Qg(t,r,g,!1,d)}})});var v={};return _P(h,function(t,e){var i=t.linkGroup;i&&!f[e]&&_P(i.axesInfo,function(e,n){var o=f[n];if(e!==t&&o){var a=o.value;i.mapper&&(a=t.axis.scale.parse(i.mapper(a,sm(e),sm(t)))),v[t.key]=a}})}),_P(v,function(t,e){Qg(h[e],t,g,!0,d)}),nm(f,h,d),om(p,o,t,r),am(h,0,i),d}});var kP=["x","y"],PP=["width","height"],NP=mm.extend({makeElOption:function(t,e,i,n,o){var a=i.axis,r=a.coordinateSystem,s=Om(r,1-Nm(a)),l=r.dataToPoint(e)[0],u=n.get("type");if(u&&"none"!==u){var h=bm(n),c=OP[u](a,l,s,h);c.style=h,t.graphicKey=c.type,t.pointer=c}Am(e,t,Jg(i),i,n,o)},getHandleTransform:function(t,e,i){var n=Jg(e,{labelInside:!1});return n.labelMargin=i.get("handle.margin"),{position:Tm(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=Nm(o),s=Om(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=Om(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"}}}}),OP={line:function(t,e,i,n){var o=Dm([e,i[0]],[e,i[1]],Nm(t));return Kn({shape:o,style:n}),{type:"Line",shape:o}},shadow:function(t,e,i,n){var o=t.getBandWidth(),a=i[1]-i[0];return{type:"Rect",shape:Cm([e-o/2,i[0]],[o,a],Nm(t))}}};XD.registerAxisPointerClass("SingleAxisPointer",NP),Ws({type:"single"});var EP=YI.extend({type:"series.themeRiver",dependencies:["singleAxis"],nameMap:null,init:function(t){EP.superApply(this,"init",arguments),this.legendDataProvider=function(){return this.getRawData()}},fixData:function(t){var e=t.length,i=[];Zi(t,function(t){return t[2]}).buckets.each(function(t,e){i.push({name:e,dataList:t})});for(var n=i.length,o=-1,a=-1,r=0;ro&&(o=s,a=r)}for(var l=0;lMath.PI/2?"right":"left"):x&&"center"!==x?"left"===x?(f=u.r0+y,p>Math.PI/2&&(x="right")):"right"===x&&(f=u.r-y,p>Math.PI/2&&(x="left")):(f=(u.r+u.r0)/2,x="center"),d.attr("style",{text:l,textAlign:x,textVerticalAlign:n("verticalAlign")||"middle",opacity:n("opacity")});var _=f*g+u.cx,w=f*m+u.cy;d.attr("position",[_,w]);var b=n("rotate"),S=0;"radial"===b?(S=-p)<-Math.PI/2&&(S+=Math.PI):"tangential"===b?(S=Math.PI/2-p)>Math.PI/2?S-=Math.PI:S<-Math.PI/2&&(S+=Math.PI):"number"==typeof b&&(S=b*Math.PI/180),d.attr("rotation",S)},VP._initEvents=function(t,e,i,n){t.off("mouseover").off("mouseout").off("emphasis").off("normal");var o=this,a=function(){o.onEmphasis(n)},r=function(){o.onNormal()};i.isAnimationEnabled()&&t.on("mouseover",a).on("mouseout",r).on("emphasis",a).on("normal",r).on("downplay",function(){o.onDownplay()}).on("highlight",function(){o.onHighlight()})},u(Vm,tb);Ar.extend({type:"sunburst",init:function(){},render:function(t,e,i,n){function o(i,n){if(c||!i||i.getValue()||(i=null),i!==l&&n!==l)if(n&&n.piece)i?(n.piece.updateData(!1,i,"normal",t,e),s.setItemGraphicEl(i.dataIndex,n.piece)):a(n);else if(i){var o=new Vm(i,t,e);h.add(o),s.setItemGraphicEl(i.dataIndex,o)}}function a(t){t&&t.piece&&(h.remove(t.piece),t.piece=null)}var r=this;this.seriesModel=t,this.api=i,this.ecModel=e;var s=t.getData(),l=s.tree.root,u=t.getViewRoot(),h=this.group,c=t.get("renderLabelForZeroData"),d=[];u.eachNode(function(t){d.push(t)});var f=this._oldChildren||[];if(function(t,e){function i(t){return t.getId()}function n(i,n){o(null==i?null:t[i],null==n?null:e[n])}0===t.length&&0===e.length||new Xs(e,t,i,i).add(n).update(n).remove(v(n,null)).execute()}(d,f),function(i,n){if(n.depth>0){r.virtualPiece?r.virtualPiece.updateData(!1,i,"normal",t,e):(r.virtualPiece=new Vm(i,t,e),h.add(r.virtualPiece)),n.piece._onclickEvent&&n.piece.off("click",n.piece._onclickEvent);var o=function(t){r._rootToNode(n.parentNode)};n.piece._onclickEvent=o,r.virtualPiece.on("click",o)}else r.virtualPiece&&(h.remove(r.virtualPiece),r.virtualPiece=null)}(l,u),n&&n.highlight&&n.highlight.piece){var p=t.getShallow("highlightPolicy");n.highlight.piece.onEmphasis(p)}else if(n&&n.unhighlight){var g=this.virtualPiece;!g&&l.children.length&&(g=l.children[0].piece),g&&g.onNormal()}this._initEvents(),this._oldChildren=d},dispose:function(){},_initEvents:function(){var t=this,e=function(e){var i=!1;t.seriesModel.getViewRoot().eachNode(function(n){if(!i&&n.piece&&n.piece.childAt(0)===e.target){var o=n.getModel().get("nodeClick");if("rootToNode"===o)t._rootToNode(n);else if("link"===o){var a=n.getModel(),r=a.get("link");if(r){var s=a.get("target",!0)||"_blank";window.open(r,s)}}i=!0}})};this.group._onclickEvent&&this.group.off("click",this.group._onclickEvent),this.group.on("click",e),this.group._onclickEvent=e},_rootToNode:function(t){t!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:"sunburstRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t})},containPoint:function(t,e){var i=e.getData().getItemLayout(0);if(i){var n=t[0]-i.cx,o=t[1]-i.cy,a=Math.sqrt(n*n+o*o);return a<=i.r&&a>=i.r0}}});var GP="sunburstRootToNode";Es({type:GP,update:"updateView"},function(t,e){e.eachComponent({mainType:"series",subType:"sunburst",query:t},function(e,i){var n=ld(t,[GP],e);if(n){var o=e.getViewRoot();o&&(t.direction=hd(o,n.node)?"rollUp":"drillDown"),e.resetViewRoot(n.node)}})});var FP="sunburstHighlight";Es({type:FP,update:"updateView"},function(t,e){e.eachComponent({mainType:"series",subType:"sunburst",query:t},function(e,i){var n=ld(t,[FP],e);n&&(t.highlight=n.node)})});Es({type:"sunburstUnhighlight",update:"updateView"},function(t,e){e.eachComponent({mainType:"series",subType:"sunburst",query:t},function(e,i){t.unhighlight=!0})});var WP=Math.PI/180;Bs(v(uC,"sunburst")),zs(v(function(t,e,i,n){e.eachSeriesByType(t,function(t){var e=t.get("center"),n=t.get("radius");y(n)||(n=[0,n]),y(e)||(e=[e,e]);var o=i.getWidth(),a=i.getHeight(),r=Math.min(o,a),s=Vo(e[0],o),l=Vo(e[1],a),u=Vo(n[0],r/2),h=Vo(n[1],r/2),c=-t.get("startAngle")*WP,f=t.get("minAngle")*WP,p=t.getData().tree.root,g=t.getViewRoot(),m=g.depth,v=t.get("sort");null!=v&&Zm(g,v);var x=0;d(g.children,function(t){!isNaN(t.getValue())&&x++});var _=g.getValue(),w=Math.PI/(_||x)*2,b=g.depth>0,S=g.height-(b?-1:1),M=(h-u)/(S||1),I=t.get("clockwise"),T=t.get("stillShowZeroSum"),A=I?1:-1,D=function(t,e){if(t){var i=e;if(t!==p){var n=t.getValue(),o=0===_&&T?w:n*w;on[1]&&n.reverse(),{coordSys:{type:"polar",cx:t.cx,cy:t.cy,r:n[1],r0:n[0]},api:{coord:m(function(n){var o=e.dataToRadius(n[0]),a=i.dataToAngle(n[1]),r=t.coordToPoint([o,a]);return r.push(o,a*Math.PI/180),r}),size:m(qm,t)}}},calendar:function(t){var e=t.getRect(),i=t.getRangeInfo();return{coordSys:{type:"calendar",x:e.x,y:e.y,width:e.width,height:e.height,cellWidth:t.getCellWidth(),cellHeight:t.getCellHeight(),rangeInfo:{start:i.start,end:i.end,weeks:i.weeks,dayCount:i.allDay}},api:{coord:function(e,i){return t.dataToPoint(e,i)}}}}};YI.extend({type:"series.custom",dependencies:["grid","polar","geo","singleAxis","calendar"],defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,useTransform:!0},getInitialData:function(t,e){return ml(this.getSource(),this)},getDataParams:function(t,e,i){var n=YI.prototype.getDataParams.apply(this,arguments);return i&&(n.info=i.info),n}}),Ar.extend({type:"custom",_data:null,render:function(t,e,i,n){var o=this._data,a=t.getData(),r=this.group,s=Qm(t,a,e,i);a.diff(o).add(function(e){ev(null,e,s(e,n),t,r,a)}).update(function(e,i){ev(o.getItemGraphicEl(i),e,s(e,n),t,r,a)}).remove(function(t){var e=o.getItemGraphicEl(t);e&&r.remove(e)}).execute(),this._data=a},incrementalPrepareRender:function(t,e,i){this.group.removeAll(),this._data=null},incrementalRender:function(t,e,i,n,o){for(var a=e.getData(),r=Qm(e,a,i,n),s=t.start;s=0;l--)null==o[l]?o.splice(l,1):delete o[l].$action},_flatten:function(t,e,i){d(t,function(t){if(t){i&&(t.parentOption=i),e.push(t);var n=t.children;"group"===t.type&&n&&this._flatten(n,e,t),delete t.children}},this)},useElOptionsToUpdate:function(){var t=this._elOptionsToUpdate;return this._elOptionsToUpdate=null,t}});Ws({type:"graphic",init:function(t,e){this._elMap=R(),this._lastGraphicModel},render:function(t,e,i){t!==this._lastGraphicModel&&this._clear(),this._lastGraphicModel=t,this._updateElements(t),this._relocate(t,i)},_updateElements:function(t){var e=t.useElOptionsToUpdate();if(e){var i=this._elMap,n=this.group;d(e,function(e){var o=e.$action,a=e.id,r=i.get(a),s=e.parentId,l=null!=s?i.get(s):n,u=e.style;"text"===e.type&&u&&(e.hv&&e.hv[1]&&(u.textVerticalAlign=u.textBaseline=null),!u.hasOwnProperty("textFill")&&u.fill&&(u.textFill=u.fill),!u.hasOwnProperty("textStroke")&&u.stroke&&(u.textStroke=u.stroke));var h=fv(e);o&&"merge"!==o?"replace"===o?(dv(r,i),cv(a,l,h,i)):"remove"===o&&dv(r,i):r?r.attr(h):cv(a,l,h,i);var c=i.get(a);c&&(c.__ecGraphicWidth=e.width,c.__ecGraphicHeight=e.height,yv(c,t))})}},_relocate:function(t,e){for(var i=t.option.elements,n=this.group,o=this._elMap,a=i.length-1;a>=0;a--){var r=i[a],s=o.get(r.id);if(s){var l=s.parent;da(s,r,l===n?{width:e.getWidth(),height:e.getHeight()}:{width:l.__ecGraphicWidth||0,height:l.__ecGraphicHeight||0},null,{hv:r.hv,boundingMode:r.bounding})}}},_clear:function(){var t=this._elMap;t.each(function(e){dv(e,t)}),this._elMap=R()},dispose:function(){this._clear()}});var KP=Fs({type:"legend.plain",dependencies:["series"],layoutMode:{type:"box",ignoreSize:!0},init:function(t,e,i){this.mergeDefaultAndTheme(t,i),t.selected=t.selected||{}},mergeOption:function(t){KP.superCall(this,"mergeOption",t)},optionUpdated:function(){this._updateData(this.ecModel);var t=this._data;if(t[0]&&"single"===this.get("selectedMode")){for(var e=!1,i=0;i=0},defaultOption:{zlevel:0,z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,inactiveColor:"#ccc",textStyle:{color:"#333"},selectedMode:!0,tooltip:{show:!1}}});Es("legendToggleSelect","legendselectchanged",v(xv,"toggleSelected")),Es("legendSelect","legendselected",v(xv,"select")),Es("legendUnSelect","legendunselected",v(xv,"unSelect"));var $P=v,JP=d,QP=tb,tN=Ws({type:"legend.plain",newlineDisabled:!1,init:function(){this.group.add(this._contentGroup=new QP),this._backgroundEl,this._isFirstRender=!0},getContentGroup:function(){return this._contentGroup},render:function(t,e,i){var n=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),t.get("show",!0)){var o=t.get("align");o&&"auto"!==o||(o="right"===t.get("left")&&"vertical"===t.get("orient")?"right":"left"),this.renderInner(o,t,e,i);var a=t.getBoxLayoutParams(),s={width:i.getWidth(),height:i.getHeight()},l=t.get("padding"),u=ca(a,s,l),h=this.layoutInner(t,o,u,n),c=ca(r({width:h.width,height:h.height},a),s,l);this.group.attr("position",[c.x-h.x,c.y-h.y]),this.group.add(this._backgroundEl=wv(h,t))}},resetInner:function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl)},renderInner:function(t,e,i,n){var o=this.getContentGroup(),a=R(),r=e.get("selectedMode"),s=[];i.eachRawSeries(function(t){!t.get("legendHoverLink")&&s.push(t.id)}),JP(e.getData(),function(l,u){var h=l.get("name");if(this.newlineDisabled||""!==h&&"\n"!==h){var c=i.getSeriesByName(h)[0];if(!a.get(h))if(c){var d=c.getData(),f=d.getVisual("color");"function"==typeof f&&(f=f(c.getDataParams(0)));var p=d.getVisual("legendSymbol")||"roundRect",g=d.getVisual("symbol");this._createItem(h,u,l,e,p,g,t,f,r).on("click",$P(bv,h,n)).on("mouseover",$P(Sv,c.name,null,n,s)).on("mouseout",$P(Mv,c.name,null,n,s)),a.set(h,!0)}else i.eachRawSeries(function(i){if(!a.get(h)&&i.legendDataProvider){var o=i.legendDataProvider(),c=o.indexOfName(h);if(c<0)return;var d=o.getItemVisual(c,"color");this._createItem(h,u,l,e,"roundRect",null,t,d,r).on("click",$P(bv,h,n)).on("mouseover",$P(Sv,null,h,n,s)).on("mouseout",$P(Mv,null,h,n,s)),a.set(h,!0)}},this)}else o.add(new QP({newline:!0}))},this)},_createItem:function(t,e,i,n,o,r,s,l,u){var h=n.get("itemWidth"),c=n.get("itemHeight"),d=n.get("inactiveColor"),f=n.get("symbolKeepAspect"),p=n.isSelected(t),g=new QP,m=i.getModel("textStyle"),v=i.get("icon"),y=i.getModel("tooltip"),x=y.parentModel;if(o=v||o,g.add(Jl(o,0,0,h,c,p?l:d,null==f||f)),!v&&r&&(r!==o||"none"===r)){var _=.8*c;"none"===r&&(r="circle"),g.add(Jl(r,(h-_)/2,(c-_)/2,_,_,p?l:d,null==f||f))}var w="left"===s?h+5:-5,b=s,S=n.get("formatter"),M=t;"string"==typeof S&&S?M=S.replace("{name}",null!=t?t:""):"function"==typeof S&&(M=S(t)),g.add(new rM({style:mo({},m,{text:M,x:w,y:c/2,textFill:p?m.getTextColor():d,textAlign:b,textVerticalAlign:"middle"})}));var I=new yM({shape:g.getBoundingRect(),invisible:!0,tooltip:y.get("show")?a({content:t,formatter:x.get("formatter",!0)||function(){return t},formatterParams:{componentType:"legend",legendIndex:n.componentIndex,name:t,$vars:["name"]}},y.option):null});return g.add(I),g.eachChild(function(t){t.silent=!0}),I.silent=!u,this.getContentGroup().add(g),fo(g),g.__legendDataIndex=e,g},layoutInner:function(t,e,i){var n=this.getContentGroup();aI(t.get("orient"),n,t.get("itemGap"),i.width,i.height);var o=n.getBoundingRect();return n.attr("position",[-o.x,-o.y]),this.group.getBoundingRect()},remove:function(){this.getContentGroup().removeAll(),this._isFirstRender=!0}});Os(function(t){var e=t.findComponents({mainType:"legend"});e&&e.length&&t.filterSeries(function(t){for(var i=0;ii[l],p=[-c.x,-c.y];n||(p[s]=o.position[s]);var g=[0,0],m=[-d.x,-d.y],v=A(t.get("pageButtonGap",!0),t.get("itemGap",!0));f&&("end"===t.get("pageButtonPosition",!0)?m[s]+=i[l]-d[l]:g[s]+=d[l]+v),m[1-s]+=c[u]/2-d[u]/2,o.attr("position",p),a.attr("position",g),r.attr("position",m);var y=this.group.getBoundingRect();if((y={x:0,y:0})[l]=f?i[l]:c[l],y[u]=Math.max(c[u],d[u]),y[h]=Math.min(0,d[h]+m[1-s]),a.__rectSize=i[l],f){var x={x:0,y:0};x[l]=Math.max(i[l]-d[l]-v,0),x[u]=y[u],a.setClipPath(new yM({shape:x})),a.__rectSize=x[l]}else r.eachChild(function(t){t.attr({invisible:!0,silent:!0})});var _=this._getPageInfo(t);return null!=_.pageIndex&&Io(o,{position:_.contentPosition},!!f&&t),this._updatePageInfoView(t,_),y},_pageGo:function(t,e,i){var n=this._getPageInfo(e)[t];null!=n&&i.dispatchAction({type:"legendScroll",scrollDataIndex:n,legendId:e.id})},_updatePageInfoView:function(t,e){var i=this._controllerGroup;d(["pagePrev","pageNext"],function(n){var o=null!=e[n+"DataIndex"],a=i.childOfName(n);a&&(a.setStyle("fill",o?t.get("pageIconColor",!0):t.get("pageIconInactiveColor",!0)),a.cursor=o?"pointer":"default")});var n=i.childOfName("pageText"),o=t.get("pageFormatter"),a=e.pageIndex,r=null!=a?a+1:0,s=e.pageCount;n&&o&&n.setStyle("text",_(o)?o.replace("{current}",r).replace("{total}",s):o({current:r,total:s}))},_getPageInfo:function(t){function e(t){if(t){var e=t.getBoundingRect(),i=e[l]+t.position[r];return{s:i,e:i+e[s],i:t.__legendDataIndex}}}function i(t,e){return t.e>=e&&t.s<=e+a}var n=t.get("scrollDataIndex",!0),o=this.getContentGroup(),a=this._containerGroup.__rectSize,r=t.getOrient().index,s=nN[r],l=oN[r],u=this._findTargetItemIndex(n),h=o.children(),c=h[u],d=h.length,f=d?1:0,p={contentPosition:o.position.slice(),pageCount:f,pageIndex:f-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!c)return p;var g=e(c);p.contentPosition[r]=-g.s;for(var m=u+1,v=g,y=g,x=null;m<=d;++m)(!(x=e(h[m]))&&y.e>v.s+a||x&&!i(x,v.s))&&(v=y.i>v.i?y:x)&&(null==p.pageNextDataIndex&&(p.pageNextDataIndex=v.i),++p.pageCount),y=x;for(var m=u-1,v=g,y=g,x=null;m>=-1;--m)(x=e(h[m]))&&i(y,x.s)||!(v.i=0;){var r=o.indexOf("|}"),s=o.substr(a+"{marker".length,r-a-"{marker".length);s.indexOf("sub")>-1?n["marker"+s]={textWidth:4,textHeight:4,textBorderRadius:2,textBackgroundColor:e[s],textOffset:[3,0]}:n["marker"+s]={textWidth:10,textHeight:10,textBorderRadius:5,textBackgroundColor:e[s]},a=(o=o.substr(r+1)).indexOf("{marker")}this.el=new rM({style:{rich:n,text:t,textLineHeight:20,textBackgroundColor:i.get("backgroundColor"),textBorderRadius:i.get("borderRadius"),textFill:i.get("textStyle.color"),textPadding:i.get("padding")},z:i.get("z")}),this._zr.add(this.el);var l=this;this.el.on("mouseover",function(){l._enterable&&(clearTimeout(l._hideTimeout),l._show=!0),l._inContent=!0}),this.el.on("mouseout",function(){l._enterable&&l._show&&l.hideLater(l._hideDelay),l._inContent=!1})},setEnterable:function(t){this._enterable=t},getSize:function(){var t=this.el.getBoundingRect();return[t.width,t.height]},moveTo:function(t,e){this.el&&this.el.attr("position",[t,e])},hide:function(){this.el?this.el.hide():true,this._show=!1},hideLater:function(t){!this._show||this._inContent&&this._enterable||(t?(this._hideDelay=t,this._show=!1,this._hideTimeout=setTimeout(m(this.hide,this),t)):this.hide())},isShow:function(){return this._show},getOuterSize:function(){return this.getSize()}};var uN=m,hN=d,cN=Vo,dN=new yM({shape:{x:-1,y:-1,width:2,height:2}});Ws({type:"tooltip",init:function(t,e){if(!U_.node){var i=t.getComponent("tooltip").get("renderMode");this._renderMode=Hi(i);var n;"html"===this._renderMode?(n=new Cv(e.getDom(),e),this._newLine="
"):(n=new Lv(e),this._newLine="\n"),this._tooltipContent=n}},render:function(t,e,i){if(!U_.node){this.group.removeAll(),this._tooltipModel=t,this._ecModel=e,this._api=i,this._lastDataByCoordSys=null,this._alwaysShowContent=t.get("alwaysShowContent");var n=this._tooltipContent;n.update(),n.setEnterable(t.get("enterable")),this._initGlobalListener(),this._keepShow()}},_initGlobalListener:function(){var t=this._tooltipModel.get("triggerOn");um("itemTooltip",this._api,uN(function(e,i,n){"none"!==t&&(t.indexOf(e)>=0?this._tryShow(i,n):"leave"===e&&this._hide(n))},this))},_keepShow:function(){var t=this._tooltipModel,e=this._ecModel,i=this._api;if(null!=this._lastX&&null!=this._lastY&&"none"!==t.get("triggerOn")){var n=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){n.manuallyShowTip(t,e,i,{x:n._lastX,y:n._lastY})})}},manuallyShowTip:function(t,e,i,n){if(n.from!==this.uid&&!U_.node){var o=Pv(n,i);this._ticket="";var a=n.dataByCoordSys;if(n.tooltip&&null!=n.x&&null!=n.y){var r=dN;r.position=[n.x,n.y],r.update(),r.tooltip=n.tooltip,this._tryShow({offsetX:n.x,offsetY:n.y,target:r},o)}else if(a)this._tryShow({offsetX:n.x,offsetY:n.y,position:n.position,event:{},dataByCoordSys:n.dataByCoordSys,tooltipOption:n.tooltipOption},o);else if(null!=n.seriesIndex){if(this._manuallyAxisShowTip(t,e,i,n))return;var s=xP(n,e),l=s.point[0],u=s.point[1];null!=l&&null!=u&&this._tryShow({offsetX:l,offsetY:u,position:n.position,target:s.el,event:{}},o)}else null!=n.x&&null!=n.y&&(i.dispatchAction({type:"updateAxisPointer",x:n.x,y:n.y}),this._tryShow({offsetX:n.x,offsetY:n.y,position:n.position,target:i.getZr().findHover(n.x,n.y).target,event:{}},o))}},manuallyHideTip:function(t,e,i,n){var o=this._tooltipContent;!this._alwaysShowContent&&this._tooltipModel&&o.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=null,n.from!==this.uid&&this._hide(Pv(n,i))},_manuallyAxisShowTip:function(t,e,i,n){var o=n.seriesIndex,a=n.dataIndex,r=e.getComponent("axisPointer").coordSysAxesInfo;if(null!=o&&null!=a&&null!=r){var s=e.getSeriesByIndex(o);if(s&&"axis"===(t=kv([s.getData().getItemModel(a),s,(s.coordinateSystem||{}).model,t])).get("trigger"))return i.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:a,position:n.position}),!0}},_tryShow:function(t,e){var i=t.target;if(this._tooltipModel){this._lastX=t.offsetX,this._lastY=t.offsetY;var n=t.dataByCoordSys;n&&n.length?this._showAxisTooltip(n,t):i&&null!=i.dataIndex?(this._lastDataByCoordSys=null,this._showSeriesItemTooltip(t,i,e)):i&&i.tooltip?(this._lastDataByCoordSys=null,this._showComponentItemTooltip(t,i,e)):(this._lastDataByCoordSys=null,this._hide(e))}},_showOrMove:function(t,e){var i=t.get("showDelay");e=m(e,this),clearTimeout(this._showTimout),i>0?this._showTimout=setTimeout(e,i):e()},_showAxisTooltip:function(t,e){var i=this._ecModel,o=this._tooltipModel,a=[e.offsetX,e.offsetY],r=[],s=[],l=kv([e.tooltipOption,o]),u=this._renderMode,h=this._newLine,c={};hN(t,function(t){hN(t.dataByAxis,function(t){var e=i.getComponent(t.axisDim+"Axis",t.axisIndex),o=t.value,a=[];if(e&&null!=o){var l=Im(o,e.axis,i,t.seriesDataIndices,t.valueLabelOpt);d(t.seriesDataIndices,function(r){var h=i.getSeriesByIndex(r.seriesIndex),d=r.dataIndexInside,f=h&&h.getDataParams(d);if(f.axisDim=t.axisDim,f.axisIndex=t.axisIndex,f.axisType=t.axisType,f.axisId=t.axisId,f.axisValue=Xl(e.axis,o),f.axisValueLabel=l,f){s.push(f);var p,g=h.formatTooltip(d,!0,null,u);if(w(g)){p=g.html;var m=g.markers;n(c,m)}else p=g;a.push(p)}});var f=l;"html"!==u?r.push(a.join(h)):r.push((f?ia(f)+h:"")+a.join(h))}})},this),r.reverse(),r=r.join(this._newLine+this._newLine);var f=e.position;this._showOrMove(l,function(){this._updateContentNotChangedOnAxis(t)?this._updatePosition(l,f,a[0],a[1],this._tooltipContent,s):this._showTooltipContent(l,r,s,Math.random(),a[0],a[1],f,void 0,c)})},_showSeriesItemTooltip:function(t,e,i){var n=this._ecModel,o=e.seriesIndex,a=n.getSeriesByIndex(o),r=e.dataModel||a,s=e.dataIndex,l=e.dataType,u=r.getData(),h=kv([u.getItemModel(s),r,a&&(a.coordinateSystem||{}).model,this._tooltipModel]),c=h.get("trigger");if(null==c||"item"===c){var d,f,p=r.getDataParams(s,l),g=r.formatTooltip(s,!1,l,this._renderMode);w(g)?(d=g.html,f=g.markers):(d=g,f=null);var m="item_"+r.name+"_"+s;this._showOrMove(h,function(){this._showTooltipContent(h,d,p,m,t.offsetX,t.offsetY,t.position,t.target,f)}),i({type:"showTip",dataIndexInside:s,dataIndex:u.getRawIndex(s),seriesIndex:o,from:this.uid})}},_showComponentItemTooltip:function(t,e,i){var n=e.tooltip;if("string"==typeof n){var o=n;n={content:o,formatter:o}}var a=new No(n,this._tooltipModel,this._ecModel),r=a.get("content"),s=Math.random();this._showOrMove(a,function(){this._showTooltipContent(a,r,a.get("formatterParams")||{},s,t.offsetX,t.offsetY,t.position,e)}),i({type:"showTip",from:this.uid})},_showTooltipContent:function(t,e,i,n,o,a,r,s,l){if(this._ticket="",t.get("showContent")&&t.get("show")){var u=this._tooltipContent,h=t.get("formatter");r=r||t.get("position");var c=e;if(h&&"string"==typeof h)c=na(h,i,!0);else if("function"==typeof h){var d=uN(function(e,n){e===this._ticket&&(u.setContent(n,l,t),this._updatePosition(t,r,o,a,u,i,s))},this);this._ticket=n,c=h(i,n,d)}u.setContent(c,l,t),u.show(t),this._updatePosition(t,r,o,a,u,i,s)}},_updatePosition:function(t,e,i,n,o,a,r){var s=this._api.getWidth(),l=this._api.getHeight();e=e||t.get("position");var u=o.getSize(),h=t.get("align"),c=t.get("verticalAlign"),d=r&&r.getBoundingRect().clone();if(r&&d.applyTransform(r.transform),"function"==typeof e&&(e=e([i,n],a,o.el,d,{viewSize:[s,l],contentSize:u.slice()})),y(e))i=cN(e[0],s),n=cN(e[1],l);else if(w(e)){e.width=u[0],e.height=u[1];var f=ca(e,{width:s,height:l});i=f.x,n=f.y,h=null,c=null}else"string"==typeof e&&r?(i=(p=Ev(e,d,u))[0],n=p[1]):(i=(p=Nv(i,n,o,s,l,h?null:20,c?null:20))[0],n=p[1]);if(h&&(i-=Rv(h)?u[0]/2:"right"===h?u[0]:0),c&&(n-=Rv(c)?u[1]/2:"bottom"===c?u[1]:0),t.get("confine")){var p=Ov(i,n,o,s,l);i=p[0],n=p[1]}o.moveTo(i,n)},_updateContentNotChangedOnAxis:function(t){var e=this._lastDataByCoordSys,i=!!e&&e.length===t.length;return i&&hN(e,function(e,n){var o=e.dataByAxis||{},a=(t[n]||{}).dataByAxis||[];(i&=o.length===a.length)&&hN(o,function(t,e){var n=a[e]||{},o=t.seriesDataIndices||[],r=n.seriesDataIndices||[];(i&=t.value===n.value&&t.axisType===n.axisType&&t.axisId===n.axisId&&o.length===r.length)&&hN(o,function(t,e){var n=r[e];i&=t.seriesIndex===n.seriesIndex&&t.dataIndex===n.dataIndex})})}),this._lastDataByCoordSys=t,!!i},_hide:function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},dispose:function(t,e){U_.node||(this._tooltipContent.hide(),gm("itemTooltip",e))}}),Es({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},function(){}),Es({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},function(){}),Gv.prototype={constructor:Gv,pointToData:function(t,e){return this.polar.pointToData(t,e)["radius"===this.dim?0:1]},dataToRadius:aD.prototype.dataToCoord,radiusToData:aD.prototype.coordToData},u(Gv,aD);var fN=Bi();Fv.prototype={constructor:Fv,pointToData:function(t,e){return this.polar.pointToData(t,e)["radius"===this.dim?0:1]},dataToAngle:aD.prototype.dataToCoord,angleToData:aD.prototype.coordToData,calculateCategoryInterval:function(){var t=this,e=t.getLabelModel(),i=t.scale,n=i.getExtent(),o=i.count();if(n[1]-n[0]<1)return 0;var a=n[0],r=t.dataToCoord(a+1)-t.dataToCoord(a),s=Math.abs(r),l=ke(a,e.getFont(),"center","top"),u=Math.max(l.height,7)/s;isNaN(u)&&(u=1/0);var h=Math.max(0,Math.floor(u)),c=fN(t.model),d=c.lastAutoInterval,f=c.lastTickCount;return null!=d&&null!=f&&Math.abs(d-h)<=1&&Math.abs(f-o)<=1&&d>h?h=d:(c.lastTickCount=o,c.lastAutoInterval=h),h}},u(Fv,aD);var pN=function(t){this.name=t||"",this.cx=0,this.cy=0,this._radiusAxis=new Gv,this._angleAxis=new Fv,this._radiusAxis.polar=this._angleAxis.polar=this};pN.prototype={type:"polar",axisPointerEnabled:!0,constructor:pN,dimensions:["radius","angle"],model:null,containPoint:function(t){var e=this.pointToCoord(t);return this._radiusAxis.contain(e[0])&&this._angleAxis.contain(e[1])},containData:function(t){return this._radiusAxis.containData(t[0])&&this._angleAxis.containData(t[1])},getAxis:function(t){return this["_"+t+"Axis"]},getAxes:function(){return[this._radiusAxis,this._angleAxis]},getAxesByScale:function(t){var e=[],i=this._angleAxis,n=this._radiusAxis;return i.scale.type===t&&e.push(i),n.scale.type===t&&e.push(n),e},getAngleAxis:function(){return this._angleAxis},getRadiusAxis:function(){return this._radiusAxis},getOtherAxis:function(t){var e=this._angleAxis;return t===e?this._radiusAxis:e},getBaseAxis:function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},getTooltipAxes:function(t){var e=null!=t&&"auto"!==t?this.getAxis(t):this.getBaseAxis();return{baseAxes:[e],otherAxes:[this.getOtherAxis(e)]}},dataToPoint:function(t,e){return this.coordToPoint([this._radiusAxis.dataToRadius(t[0],e),this._angleAxis.dataToAngle(t[1],e)])},pointToData:function(t,e){var i=this.pointToCoord(t);return[this._radiusAxis.radiusToData(i[0],e),this._angleAxis.angleToData(i[1],e)]},pointToCoord:function(t){var e=t[0]-this.cx,i=t[1]-this.cy,n=this.getAngleAxis(),o=n.getExtent(),a=Math.min(o[0],o[1]),r=Math.max(o[0],o[1]);n.inverse?a=r-360:r=a+360;var s=Math.sqrt(e*e+i*i);e/=s,i/=s;for(var l=Math.atan2(-i,e)/Math.PI*180,u=lr;)l+=360*u;return[s,l]},coordToPoint:function(t){var e=t[0],i=t[1]/180*Math.PI;return[Math.cos(i)*e+this.cx,-Math.sin(i)*e+this.cy]}};var gN=lI.extend({type:"polarAxis",axis:null,getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"polar",index:this.option.polarIndex,id:this.option.polarId})[0]}});n(gN.prototype,UA);var mN={angle:{startAngle:90,clockwise:!0,splitNumber:12,axisLabel:{rotate:!1}},radius:{splitNumber:5}};ED("angle",gN,Wv,mN.angle),ED("radius",gN,Wv,mN.radius),Fs({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%"}});var vN={dimensions:pN.prototype.dimensions,create:function(t,e){var i=[];return t.eachComponent("polar",function(t,n){var o=new pN(n);o.update=Zv;var a=o.getRadiusAxis(),r=o.getAngleAxis(),s=t.findAxisModel("radiusAxis"),l=t.findAxisModel("angleAxis");Uv(a,s),Uv(r,l),Hv(o,t,e),i.push(o),t.coordinateSystem=o,o.model=t}),t.eachSeries(function(e){if("polar"===e.get("coordinateSystem")){var i=t.queryComponents({mainType:"polar",index:e.get("polarIndex"),id:e.get("polarId")})[0];e.coordinateSystem=i.coordinateSystem}}),i}};Fa.register("polar",vN);var yN=["axisLine","axisLabel","axisTick","splitLine","splitArea"];XD.extend({type:"angleAxis",axisPointerClass:"PolarAxisPointer",render:function(t,e){if(this.group.removeAll(),t.get("show")){var n=t.axis,o=n.polar,a=o.getRadiusAxis().getExtent(),r=n.getTicksCoords(),s=f(n.getViewLabels(),function(t){return(t=i(t)).coord=n.dataToCoord(t.tickValue),t});Yv(s),Yv(r),d(yN,function(e){!t.get(e+".show")||n.scale.isBlank()&&"axisLine"!==e||this["_"+e](t,o,r,a,s)},this)}},_axisLine:function(t,e,i,n){var o=t.getModel("axisLine.lineStyle"),a=new sM({shape:{cx:e.cx,cy:e.cy,r:n[jv(e)]},style:o.getLineStyle(),z2:1,silent:!0});a.style.fill=null,this.group.add(a)},_axisTick:function(t,e,i,n){var o=t.getModel("axisTick"),a=(o.get("inside")?-1:1)*o.get("length"),s=n[jv(e)],l=f(i,function(t){return new _M({shape:Xv(e,[s,s+a],t.coord)})});this.group.add(OM(l,{style:r(o.getModel("lineStyle").getLineStyle(),{stroke:t.get("axisLine.lineStyle.color")})}))},_axisLabel:function(t,e,i,n,o){var a=t.getCategories(!0),r=t.getModel("axisLabel"),s=r.get("margin");d(o,function(i,o){var l=r,u=i.tickValue,h=n[jv(e)],c=e.coordToPoint([h+s,i.coord]),d=e.cx,f=e.cy,p=Math.abs(c[0]-d)/h<.3?"center":c[0]>d?"left":"right",g=Math.abs(c[1]-f)/h<.3?"middle":c[1]>f?"top":"bottom";a&&a[u]&&a[u].textStyle&&(l=new No(a[u].textStyle,r,r.ecModel));var m=new rM({silent:!0});this.group.add(m),mo(m.style,l,{x:c[0],y:c[1],textFill:l.getTextColor()||t.get("axisLine.lineStyle.color"),text:i.formattedLabel,textAlign:p,textVerticalAlign:g})},this)},_splitLine:function(t,e,i,n){var o=t.getModel("splitLine").getModel("lineStyle"),a=o.get("color"),s=0;a=a instanceof Array?a:[a];for(var l=[],u=0;u=0?"p":"n",M=y;v&&(n[r][b]||(n[r][b]={p:y,n:y}),M=n[r][b][S]);var I,T,A,D;if("radius"===h.dim){var C=h.dataToRadius(w)-y,L=a.dataToAngle(b);Math.abs(C)=0},kN.findTargetInfo=function(t,e){for(var i=this._targetInfoList,n=dy(e,t),o=0;o=0||AN(n,t.getAxis("y").model)>=0)&&a.push(t)}),e.push({panelId:"grid--"+t.id,gridModel:t,coordSysModel:t,coordSys:a[0],coordSyses:a,getPanelRect:ON.grid,xAxisDeclared:r[t.id],yAxisDeclared:s[t.id]})}))},geo:function(t,e){TN(t.geoModels,function(t){var i=t.coordinateSystem;e.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:i,coordSyses:[i],getPanelRect:ON.geo})})}},NN=[function(t,e){var i=t.xAxisModel,n=t.yAxisModel,o=t.gridModel;return!o&&i&&(o=i.axis.grid.model),!o&&n&&(o=n.axis.grid.model),o&&o===e.gridModel},function(t,e){var i=t.geoModel;return i&&i===e.geoModel}],ON={grid:function(){return this.coordSys.grid.getRect().clone()},geo:function(){var t=this.coordSys,e=t.getBoundingRect().clone();return e.applyTransform(Ao(t)),e}},EN={lineX:DN(fy,0),lineY:DN(fy,1),rect:function(t,e,i){var n=e[CN[t]]([i[0][0],i[1][0]]),o=e[CN[t]]([i[0][1],i[1][1]]),a=[cy([n[0],o[0]]),cy([n[1],o[1]])];return{values:a,xyMinMax:a}},polygon:function(t,e,i){var n=[[1/0,-1/0],[1/0,-1/0]];return{values:f(i,function(i){var o=e[CN[t]](i);return n[0][0]=Math.min(n[0][0],o[0]),n[1][0]=Math.min(n[1][0],o[1]),n[0][1]=Math.max(n[0][1],o[0]),n[1][1]=Math.max(n[1][1],o[1]),o}),xyMinMax:n}}},RN={lineX:DN(py,0),lineY:DN(py,1),rect:function(t,e,i){return[[t[0][0]-i[0]*e[0][0],t[0][1]-i[0]*e[0][1]],[t[1][0]-i[1]*e[1][0],t[1][1]-i[1]*e[1][1]]]},polygon:function(t,e,i){return f(t,function(t,n){return[t[0]-i[0]*e[n][0],t[1]-i[1]*e[n][1]]})}},zN=["inBrush","outOfBrush"],BN="__ecBrushSelect",VN="__ecInBrushSelectEvent",GN=VT.VISUAL.BRUSH;zs(GN,function(t,e,i){t.eachComponent({mainType:"brush"},function(e){i&&"takeGlobalCursor"===i.type&&e.setBrushOption("brush"===i.key?i.brushOption:{brushType:!1}),(e.brushTargetManager=new hy(e.option,t)).setInputRanges(e.areas,t)})}),Bs(GN,function(t,e,n){var o,a,s=[];t.eachComponent({mainType:"brush"},function(e,n){function l(t){return"all"===m||v[t]}function u(t){return!!t.length}function h(t,e){var i=t.coordinateSystem;w|=i.hasAxisBrushed(),l(e)&&i.eachActiveState(t.getData(),function(t,e){"active"===t&&(x[e]=1)})}function c(i,n,o){var a=_y(i);if(a&&!wy(e,n)&&(d(b,function(n){a[n.brushType]&&e.brushTargetManager.controlSeries(n,i,t)&&o.push(n),w|=u(o)}),l(n)&&u(o))){var r=i.getData();r.each(function(t){xy(a,o,r,t)&&(x[t]=1)})}}var p={brushId:e.id,brushIndex:n,brushName:e.name,areas:i(e.areas),selected:[]};s.push(p);var g=e.option,m=g.brushLink,v=[],x=[],_=[],w=0;n||(o=g.throttleType,a=g.throttleDelay);var b=f(e.areas,function(t){return by(r({boundingRect:FN[t.brushType](t)},t))}),S=ty(e.option,zN,function(t){t.mappingMethod="fixed"});y(m)&&d(m,function(t){v[t]=1}),t.eachSeries(function(t,e){var i=_[e]=[];"parallel"===t.subType?h(t,e):c(t,e,i)}),t.eachSeries(function(t,e){var i={seriesId:t.id,seriesIndex:e,seriesName:t.name,dataIndex:[]};p.selected.push(i);var n=_y(t),o=_[e],a=t.getData(),r=l(e)?function(t){return x[t]?(i.dataIndex.push(a.getRawIndex(t)),"inBrush"):"outOfBrush"}:function(t){return xy(n,o,a,t)?(i.dataIndex.push(a.getRawIndex(t)),"inBrush"):"outOfBrush"};(l(e)?w:u(o))&&iy(zN,S,a,r)})}),vy(e,o,a,s,n)});var FN={lineX:B,lineY:B,rect:function(t){return Sy(t.range)},polygon:function(t){for(var e,i=t.range,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&&Sy(e)}},WN=["#ddd"];Fs({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&&ey(i,t,["inBrush","outOfBrush"]);var n=i.inBrush=i.inBrush||{};i.outOfBrush=i.outOfBrush||{color:WN},n.hasOwnProperty("liftZ")||(n.liftZ=5)},setAreas:function(t){t&&(this.areas=f(t,function(t){return My(this.option,t)},this))},setBrushOption:function(t){this.brushOption=My(this.option,t),this.brushType=this.brushOption.brushType}});Ws({type:"brush",init:function(t,e){this.ecModel=t,this.api=e,this.model,(this._brushController=new zf(e.getZr())).on("brush",m(this._onBrush,this)).mount()},render:function(t){return this.model=t,Iy.apply(this,arguments)},updateTransform:Iy,updateView:Iy,dispose:function(){this._brushController.dispose()},_onBrush:function(t,e){var n=this.model.id;this.model.brushTargetManager.setOutputRanges(t,this.ecModel),(!e.isEnd||e.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:n,areas:i(t),$from:n})}}),Es({type:"brush",event:"brush"},function(t,e){e.eachComponent({mainType:"brush",query:t},function(e){e.setAreas(t.areas)})}),Es({type:"brushSelect",event:"brushSelected",update:"none"},function(){});var HN={},ZN=rT.toolbox.brush;Dy.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:i(ZN.title)};var UN=Dy.prototype;UN.render=UN.updateView=function(t,e,i){var n,o,a;e.eachComponent({mainType:"brush"},function(t){n=t.brushType,o=t.brushOption.brushMode||"single",a|=t.areas.length}),this._brushType=n,this._brushMode=o,d(t.get("type",!0),function(e){t.setIconStatus(e,("keep"===e?"multiple"===o:"clear"===e?a:e===n)?"emphasis":"normal")})},UN.getIcons=function(){var t=this.model,e=t.get("icon",!0),i={};return d(t.get("type",!0),function(t){e[t]&&(i[t]=e[t])}),i},UN.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}})},Ty("brush",Dy),Ns(function(t,e){var i=t&&t.brush;if(y(i)||(i=i?[i]:[]),i.length){var n=[];d(i,function(t){var e=t.hasOwnProperty("toolbox")?t.toolbox:[];e instanceof Array&&(n=n.concat(e))});var o=t&&t.toolbox;y(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),Jv(s),e&&!s.length&&s.push.apply(s,SN)}});Cy.prototype={constructor:Cy,type:"calendar",dimensions:["time","value"],getDimensionsInfo:function(){return[{name:"time",type:"time"},"value"]},getRangeInfo:function(){return this._rangeInfo},getModel:function(){return this._model},getRect:function(){return this._rect},getCellWidth:function(){return this._sw},getCellHeight:function(){return this._sh},getOrient:function(){return this._orient},getFirstDayOfWeek:function(){return this._firstDayOfWeek},getDateInfo:function(t){var e=(t=Yo(t)).getFullYear(),i=t.getMonth()+1;i=i<10?"0"+i:i;var n=t.getDate();n=n<10?"0"+n:n;var o=t.getDay();return o=Math.abs((o+7-this.getFirstDayOfWeek())%7),{y:e,m:i,d:n,day:o,time:t.getTime(),formatedDate:e+"-"+i+"-"+n,date:t}},getNextNDay:function(t,e){return 0===(e=e||0)?this.getDateInfo(t):((t=new Date(this.getDateInfo(t).time)).setDate(t.getDate()+e),this.getDateInfo(t))},update:function(t,e){function i(t,e){return null!=t[e]&&"auto"!==t[e]}this._firstDayOfWeek=+this._model.getModel("dayLabel").get("firstDay"),this._orient=this._model.get("orient"),this._lineWidth=this._model.getModel("itemStyle").getItemStyle().lineWidth||0,this._rangeInfo=this._getRangeInfo(this._initRangeOption());var n=this._rangeInfo.weeks||1,o=["width","height"],a=this._model.get("cellSize").slice(),r=this._model.getBoxLayoutParams(),s="horizontal"===this._orient?[n,7]:[7,n];d([0,1],function(t){i(a,t)&&(r[o[t]]=a[t]*s[t])});var l={width:e.getWidth(),height:e.getHeight()},u=this._rect=ca(r,l);d([0,1],function(t){i(a,t)||(a[t]=u[o[t]]/s[t])}),this._sw=a[0],this._sh=a[1]},dataToPoint:function(t,e){y(t)&&(t=t[0]),null==e&&(e=!0);var i=this.getDateInfo(t),n=this._rangeInfo,o=i.formatedDate;if(e&&!(i.time>=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=n.getTime()-t[1].time>0?1:-1;n.getDate()!==a&&(n.getTime()-t[1].time)*r>0;)i-=r,n.setDate(o+i-1);var s=Math.floor((i+t[0].day+6)/7),l=e?1-s:s-1;return e&&t.reverse(),{range:[t[0].formatedDate,t[1].formatedDate],start:t[0],end:t[1],allDay:i,weeks:s,nthWeek:l,fweek:t[0].day,lweek:t[1].day}},_getDateByWeeksAndDay:function(t,e,i){var n=this._getRangeInfo(i);if(t>n.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)}},Cy.dimensions=Cy.prototype.dimensions,Cy.getDimensionsInfo=Cy.prototype.getDimensionsInfo,Cy.create=function(t,e){var i=[];return t.eachComponent("calendar",function(n){var o=new Cy(n,t,e);i.push(o),n.coordinateSystem=o}),t.eachSeries(function(t){"calendar"===t.get("coordinateSystem")&&(t.coordinateSystem=i[t.get("calendarIndex")||0])}),i},Fa.register("calendar",Cy);var XN=lI.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=ga(t);XN.superApply(this,"init",arguments),ky(t,o)},mergeOption:function(t,e){XN.superApply(this,"mergeOption",arguments),ky(this.option,t)}}),jN={EN:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],CN:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},YN={EN:["S","M","T","W","T","F","S"],CN:["日","一","二","三","四","五","六"]};Ws({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 yM({shape:{x:l[0],y:l[1],width:a,height:r},cursor:"default",style:o});i.add(u)}},_renderLines:function(t,e,i,n){function o(e){a._firstDayOfMonth.push(r.getDateInfo(e)),a._firstDayPoints.push(r.dataToRect([e],!1).tl);var o=a._getLinePointsOfOneWeek(t,e,i);a._tlpoints.push(o[0]),a._blpoints.push(o[o.length-1]),l&&a._drawSplitline(o,s,n)}var a=this,r=t.coordinateSystem,s=t.getModel("splitLine.lineStyle").getLineStyle(),l=t.get("splitLine.show"),u=s.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var h=e.start,c=0;h.time<=e.end.time;c++){o(h.formatedDate),0===c&&(h=r.getDateInfo(e.start.y+"-"+e.start.m));var d=h.date;d.setMonth(d.getMonth()+1),h=r.getDateInfo(d)}o(r.getNextNDay(e.end.time,1).formatedDate),l&&this._drawSplitline(a._getEdgesPoints(a._tlpoints,u,i),s,n),l&&this._drawSplitline(a._getEdgesPoints(a._blpoints,u,i),s,n)},_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 gM({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?oa(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 rM({z2:30});mo(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"),r=n.get("margin"),s=n.get("position"),l=n.get("align"),u=[this._tlpoints,this._blpoints];_(o)&&(o=jN[o.toUpperCase()]||[]);var h="start"===s?0:1,c="horizontal"===e?0:1;r="start"===s?-r:r;for(var d="center"===l,f=0;f=r[0]&&t<=r[1]}if(t===this._dataZoomModel){var n=this._dimName,o=this.getTargetSeriesModels(),a=t.get("filterMode"),r=this._valueWindow;"none"!==a&&$N(o,function(t){var e=t.getData(),o=e.mapDimension(n,!0);o.length&&("weakFilter"===a?e.filterSelf(function(t){for(var i,n,a,s=0;sr[1];if(u&&!h&&!c)return!0;u&&(a=!0),h&&(i=!0),c&&(n=!0)}return a&&i&&n}):$N(o,function(n){if("empty"===a)t.setData(e.map(n,function(t){return i(t)?t:NaN}));else{var o={};o[n]=r,e.selectRange(o)}}),$N(o,function(t){e.setApproximateExtent(r,t)}))})}}};var tO=d,eO=KN,iO=Fs({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=By(t);this.mergeDefaultAndTheme(t,i),this.doInit(n)},mergeOption:function(t){var e=By(t);n(this.option,t,!0),this.doInit(e)},doInit:function(t){var e=this.option;U_.canvasSupported||(e.realtime=!1),this._setDefaultThrottle(t),Vy(this,t),tO([["start","startValue"],["end","endValue"]],function(t,i){"value"===this._rangePropMode[i]&&(e[t[0]]=null)},this),this.textStyleModel=this.getModel("textStyle"),this._resetTarget(),this._giveAxisProxies()},_giveAxisProxies:function(){var t=this._axisProxies;this.eachTargetAxis(function(e,i,n,o){var a=this.dependentModels[e.axis][i],r=a.__dzAxisProxy||(a.__dzAxisProxy=new QN(e.name,i,this,o));t[e.name+"_"+i]=r},this)},_resetTarget:function(){var t=this.option,e=this._judgeAutoMode();eO(function(e){var i=e.axisIndex;t[i]=Di(t[i])},this),"axisIndex"===e?this._autoSetAxisIndex():"orient"===e&&this._autoSetOrient()},_judgeAutoMode:function(){var t=this.option,e=!1;eO(function(i){null!=t[i.axisIndex]&&(e=!0)},this);var i=t.orient;return null==i&&e?"orient":e?void 0:(null==i&&(t.orient="horizontal"),"axisIndex")},_autoSetAxisIndex:function(){var t=!0,e=this.get("orient",!0),i=this.option,n=this.dependentModels;if(t){var o="vertical"===e?"y":"x";n[o+"Axis"].length?(i[o+"AxisIndex"]=[0],t=!1):tO(n.singleAxis,function(n){t&&n.get("orient",!0)===e&&(i.singleAxisIndex=[n.componentIndex],t=!1)})}t&&eO(function(e){if(t){var n=[],o=this.dependentModels[e.axis];if(o.length&&!n.length)for(var a=0,r=o.length;a0?100:20}},getFirstTargetAxisModel:function(){var t;return eO(function(e){if(null==t){var i=this.get(e.axisIndex);i.length&&(t=this.dependentModels[e.axis][i[0]])}},this),t},eachTargetAxis:function(t,e){var i=this.ecModel;eO(function(n){tO(this.get(n.axisIndex),function(o){t.call(e,n,o,this,i)},this)},this)},getAxisProxy:function(t,e){return this._axisProxies[t+"_"+e]},getAxisModel:function(t,e){var i=this.getAxisProxy(t,e);return i&&i.getAxisModel()},setRawRange:function(t,e){var i=this.option;tO([["start","startValue"],["end","endValue"]],function(e){null==t[e[0]]&&null==t[e[1]]||(i[e[0]]=t[e[0]],i[e[1]]=t[e[1]])},this),!e&&Vy(this,t)},getPercentRange:function(){var t=this.findRepresentativeAxisProxy();if(t)return t.getDataPercentWindow()},getValueRange:function(t,e){if(null!=t||null!=e)return this.getAxisProxy(t,e).getDataValueWindow();var i=this.findRepresentativeAxisProxy();return i?i.getDataValueWindow():void 0},findRepresentativeAxisProxy:function(t){if(t)return t.__dzAxisProxy;var e=this._axisProxies;for(var i in e)if(e.hasOwnProperty(i)&&e[i].hostedBy(this))return e[i];for(var i in e)if(e.hasOwnProperty(i)&&!e[i].hostedBy(this))return e[i]},getRangePropMode:function(){return this._rangePropMode.slice()}}),nO=qI.extend({type:"dataZoom",render:function(t,e,i,n){this.dataZoomModel=t,this.ecModel=e,this.api=i},getTargetCoordInfo:function(){function t(t,e,i,n){for(var o,a=0;a0&&e%g)p+=f;else{var i=null==t||isNaN(t)||""===t,n=i?0:aO(t,a,u,!0);i&&!l&&e?(c.push([c[c.length-1][0],0]),d.push([d[d.length-1][0],0])):!i&&l&&(c.push([p,0]),d.push([p,0])),c.push([p,n]),d.push([p,n]),p+=f,l=i}});var m=this.dataZoomModel;this._displayables.barGroup.add(new pM({shape:{points:c},style:r({fill:m.get("dataBackgroundColor")},m.getModel("dataBackground.areaStyle").getAreaStyle()),silent:!0,z2:-20})),this._displayables.barGroup.add(new gM({shape:{points:d},style:m.getModel("dataBackground.lineStyle").getLineStyle(),silent:!0,z2:-19}))}}},_prepareDataShadowInfo:function(){var t=this.dataZoomModel,e=t.get("showDataShadow");if(!1!==e){var i,n=this.ecModel;return t.eachTargetAxis(function(o,a){d(t.getAxisProxy(o.name,a).getTargetSeriesModels(),function(t){if(!(i||!0!==e&&l(cO,t.get("type"))<0)){var r,s=n.getComponent(o.axis,a).axis,u=Gy(o.name),h=t.coordinateSystem;null!=u&&h.getOtherAxis&&(r=h.getOtherAxis(s).inverse),u=t.getData().mapDimension(u),i={thisAxis:s,series:t,thisDim:o.name,otherDim:u,otherAxisInverse:r}}},this)},this),i}},_renderHandle:function(){var t=this._displayables,e=t.handles=[],i=t.handleLabels=[],n=this._displayables.barGroup,o=this._size,a=this.dataZoomModel;n.add(t.filler=new oO({draggable:!0,cursor:Fy(this._orient),drift:sO(this._onDragMove,this,"all"),onmousemove:function(t){mw(t.event)},ondragstart:sO(this._showDataInfo,this,!0),ondragend:sO(this._onDragEnd,this),onmouseover:sO(this._showDataInfo,this,!0),onmouseout:sO(this._showDataInfo,this,!1),style:{fill:a.get("fillerColor"),textPosition:"inside"}})),n.add(new oO($n({silent:!0,shape:{x:0,y:0,width:o[0],height:o[1]},style:{stroke:a.get("dataBackgroundColor")||a.get("borderColor"),lineWidth:1,fill:"rgba(0,0,0,0)"}}))),lO([0,1],function(t){var o=Po(a.get("handleIcon"),{cursor:Fy(this._orient),draggable:!0,drift:sO(this._onDragMove,this,t),onmousemove:function(t){mw(t.event)},ondragend:sO(this._onDragEnd,this),onmouseover:sO(this._showDataInfo,this,!0),onmouseout:sO(this._showDataInfo,this,!1)},{x:-1,y:0,width:2,height:2}),r=o.getBoundingRect();this._handleHeight=Vo(a.get("handleSize"),this._size[1]),this._handleWidth=r.width/r.height*this._handleHeight,o.setStyle(a.getModel("handleStyle").getItemStyle());var s=a.get("handleColor");null!=s&&(o.style.fill=s),n.add(e[t]=o);var l=a.textStyleModel;this.group.add(i[t]=new rM({silent:!0,invisible:!0,style:{x:0,y:0,text:"",textVerticalAlign:"middle",textAlign:"center",textFill:l.getTextColor(),textFont:l.getFont()},z2:10}))},this)},_resetInterval:function(){var t=this._range=this.dataZoomModel.getPercentRange(),e=this._getViewExtent();this._handleEnds=[aO(t[0],[0,100],e,!0),aO(t[1],[0,100],e,!0)]},_updateInterval:function(t,e){var i=this.dataZoomModel,n=this._handleEnds,o=this._getViewExtent(),a=i.findRepresentativeAxisProxy().getMinMaxSpan(),r=[0,100];QL(e,n,o,i.get("zoomLock")?"all":t,null!=a.minSpan?aO(a.minSpan,r,o,!0):null,null!=a.maxSpan?aO(a.maxSpan,r,o,!0):null);var s=this._range,l=this._range=rO([aO(n[0],o,r,!0),aO(n[1],o,r,!0)]);return!s||s[0]!==l[0]||s[1]!==l[1]},_updateView:function(t){var e=this._displayables,i=this._handleEnds,n=rO(i.slice()),o=this._size;lO([0,1],function(t){var n=e.handles[t],a=this._handleHeight;n.attr({scale:[a/2,a/2],position:[i[t],o[1]/2-a/2]})},this),e.filler.setShape({x:n[0],y:0,width:n[1]-n[0],height:o[1]}),this._updateDataInfo(t)},_updateDataInfo:function(t){function e(t){var e=Ao(n.handles[t].parent,this.group),i=Co(0===t?"right":"left",e),s=this._handleWidth/2+hO,l=Do([c[t]+(0===t?-s:s),this._size[1]/2],e);o[t].setStyle({x:l[0],y:l[1],textVerticalAlign:a===uO?"middle":i,textAlign:a===uO?i:"center",text:r[t]})}var i=this.dataZoomModel,n=this._displayables,o=n.handleLabels,a=this._orient,r=["",""];if(i.get("showDetail")){var s=i.findRepresentativeAxisProxy();if(s){var l=s.getAxisModel().axis,u=this._range,h=t?s.calculateDataWindow({start:u[0],end:u[1]}).valueWindow:s.getDataValueWindow();r=[this._formatLabel(h[0],l),this._formatLabel(h[1],l)]}}var c=rO(this._handleEnds.slice());e.call(this,0),e.call(this,1)},_formatLabel:function(t,e){var i=this.dataZoomModel,n=i.get("labelFormatter"),o=i.get("labelPrecision");null!=o&&"auto"!==o||(o=e.getPixelPrecision());var a=null==t||isNaN(t)?"":"category"===e.type||"time"===e.type?e.scale.getLabel(Math.round(t)):t.toFixed(Math.min(o,20));return x(n)?n(t,a):_(n)?n.replace("{value}",a):a},_showDataInfo:function(t){t=this._dragging||t;var e=this._displayables.handleLabels;e[0].attr("invisible",!t),e[1].attr("invisible",!t)},_onDragMove:function(t,e,i){this._dragging=!0;var n=Do([e,i],this._displayables.barGroup.getLocalTransform(),!0),o=this._updateInterval(t,n[0]),a=this.dataZoomModel.get("realtime");this._updateView(!a),o&&a&&this._dispatchZoomAction()},_onDragEnd:function(){this._dragging=!1,this._showDataInfo(!1),!this.dataZoomModel.get("realtime")&&this._dispatchZoomAction()},_onClickPanelClick:function(t){var e=this._size,i=this._displayables.barGroup.transformCoordToLocal(t.offsetX,t.offsetY);if(!(i[0]<0||i[0]>e[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 t;if(lO(this.getTargetCoordInfo(),function(e){if(!t&&e.length){var i=e[0].model.coordinateSystem;t=i.getRect&&i.getRect()}}),!t){var e=this.api.getWidth(),i=this.api.getHeight();t={x:.2*e,y:.2*i,width:.6*e,height:.6*i}}return t}});iO.extend({type:"dataZoom.inside",defaultOption:{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}});var fO="\0_ec_dataZoom_roams",pO=m,gO=nO.extend({type:"dataZoom.inside",init:function(t,e){this._range},render:function(t,e,i,n){gO.superApply(this,"render",arguments),this._range=t.getPercentRange(),d(this.getTargetCoordInfo(),function(e,n){var o=f(e,function(t){return Zy(t.model)});d(e,function(e){var a=e.model,r={};d(["pan","zoom","scrollMove"],function(t){r[t]=pO(mO[t],this,e,n)},this),Wy(i,{coordId:Zy(a),allCoordIds:o,containsPoint:function(t,e,i){return a.coordinateSystem.containPoint([e,i])},dataZoomId:t.id,dataZoomModel:t,getRange:r})},this)},this)},dispose:function(){Hy(this.api,this.dataZoomModel.id),gO.superApply(this,"dispose",arguments),this._range=null}}),mO={zoom:function(t,e,i,n){var o=this._range,a=o.slice(),r=t.axisModels[0];if(r){var s=vO[e](null,[n.originX,n.originY],r,i,t),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],u=Math.max(1/n.scale,0);a[0]=(a[0]-l)*u+l,a[1]=(a[1]-l)*u+l;var h=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();return QL(0,a,[0,100],0,h.minSpan,h.maxSpan),this._range=a,o[0]!==a[0]||o[1]!==a[1]?a:void 0}},pan:Ky(function(t,e,i,n,o,a){var r=vO[n]([a.oldX,a.oldY],[a.newX,a.newY],e,o,i);return r.signal*(t[1]-t[0])*r.pixel/r.pixelLength}),scrollMove:Ky(function(t,e,i,n,o,a){return vO[n]([0,0],[a.scrollDelta,a.scrollDelta],e,o,i).signal*(t[1]-t[0])*a.scrollDelta})},vO={grid:function(t,e,i,n,o){var a=i.axis,r={},s=o.model.coordinateSystem.getRect();return t=t||[0,0],"x"===a.dim?(r.pixel=e[0]-t[0],r.pixelLength=s.width,r.pixelStart=s.x,r.signal=a.inverse?1:-1):(r.pixel=e[1]-t[1],r.pixelLength=s.height,r.pixelStart=s.y,r.signal=a.inverse?-1:1),r},polar:function(t,e,i,n,o){var a=i.axis,r={},s=o.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return t=t?s.pointToCoord(t):[0,0],e=s.pointToCoord(e),"radiusAxis"===i.mainType?(r.pixel=e[0]-t[0],r.pixelLength=l[1]-l[0],r.pixelStart=l[0],r.signal=a.inverse?1:-1):(r.pixel=e[1]-t[1],r.pixelLength=u[1]-u[0],r.pixelStart=u[0],r.signal=a.inverse?-1:1),r},singleAxis:function(t,e,i,n,o){var a=i.axis,r=o.model.coordinateSystem.getRect(),s={};return t=t||[0,0],"horizontal"===a.orient?(s.pixel=e[0]-t[0],s.pixelLength=r.width,s.pixelStart=r.x,s.signal=a.inverse?1:-1):(s.pixel=e[1]-t[1],s.pixelLength=r.height,s.pixelStart=r.y,s.signal=a.inverse?-1:1),s}};Os({getTargetSeries:function(t){var e=R();return t.eachComponent("dataZoom",function(t){t.eachTargetAxis(function(t,i,n){d(n.getAxisProxy(t.name,i).getTargetSeriesModels(),function(t){e.set(t.uid,t)})})}),e},modifyOutputEnd:!0,overallReset:function(t,e){t.eachComponent("dataZoom",function(t){t.eachTargetAxis(function(t,i,n){n.getAxisProxy(t.name,i).reset(n,e)}),t.eachTargetAxis(function(t,i,n){n.getAxisProxy(t.name,i).filterData(n,e)})}),t.eachComponent("dataZoom",function(t){var e=t.findRepresentativeAxisProxy(),i=e.getDataPercentWindow(),n=e.getDataValueWindow();t.setRawRange({start:i[0],end:i[1],startValue:n[0],endValue:n[1]},!0)})}}),Es("dataZoom",function(t,e){var i=Ny(m(e.eachComponent,e,"dataZoom"),KN,function(t,e){return t.get(e.axisIndex)}),n=[];e.eachComponent({mainType:"dataZoom",query:t},function(t,e){n.push.apply(n,i(t).nodes)}),d(n,function(e,i){e.setRawRange({start:t.start,end:t.end,startValue:t.startValue,endValue:t.endValue})})});var yO=d,xO=function(t){var e=t&&t.visualMap;y(e)||(e=e?[e]:[]),yO(e,function(t){if(t){$y(t,"splitList")&&!$y(t,"pieces")&&(t.pieces=t.splitList,delete t.splitList);var e=t.pieces;e&&y(e)&&yO(e,function(t){w(t)&&($y(t,"start")&&!$y(t,"min")&&(t.min=t.start),$y(t,"end")&&!$y(t,"max")&&(t.max=t.end))})}})};lI.registerSubTypeDefaulter("visualMap",function(t){return t.categories||(t.pieces?t.pieces.length>0:t.splitNumber>0)&&!t.calculable?"piecewise":"continuous"});var _O=VT.VISUAL.COMPONENT;Bs(_O,{createOnAllSeries:!0,reset:function(t,e){var i=[];return e.eachComponent("visualMap",function(e){var n=t.pipelineContext;!e.isTargetSeries(t)||n&&n.large||i.push(ny(e.stateList,e.targetVisuals,m(e.getValueState,e),e.getDataDimension(t.getData())))}),i}}),Bs(_O,{createOnAllSeries:!0,reset:function(t,e){var i=t.getData(),n=[];e.eachComponent("visualMap",function(e){if(e.isTargetSeries(t)){var o=e.getVisualMeta(m(Jy,null,t,e))||{stops:[],outerColors:[]},a=e.getDataDimension(i),r=i.getDimensionInfo(a);null!=r&&(o.dimension=r.index,n.push(o))}}),t.getData().setVisual("visualMeta",n)}});var wO={get:function(t,e,n){var o=i((bO[t]||{})[e]);return n&&y(o)?o[o.length-1]:o}},bO={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}},SO=hL.mapVisual,MO=hL.eachVisual,IO=y,TO=d,AO=Fo,DO=Bo,CO=B,LO=Fs({type:"visualMap",dependencies:["series"],stateList:["inRange","outOfRange"],replacableOptionKeys:["inRange","outOfRange","target","controller","color"],dataBound:[-1/0,1/0],layoutMode:{type:"box",ignoreSize:!0},defaultOption:{show:!0,zlevel:0,z:4,seriesIndex:"all",min:0,max:200,dimension:null,inRange:null,outOfRange:null,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,color:null,formatter:null,text:null,textStyle:{color:"#333"}},init:function(t,e,i){this._dataExtent,this.targetVisuals={},this.controllerVisuals={},this.textStyleModel,this.itemSize,this.mergeDefaultAndTheme(t,i)},optionUpdated:function(t,e){var i=this.option;U_.canvasSupported||(i.realtime=!1),!e&&ey(i,t,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},resetVisual:function(t){var e=this.stateList;t=m(t,this),this.controllerVisuals=ty(this.option.controller,e,t),this.targetVisuals=ty(this.option.target,e,t)},getTargetSeriesIndices:function(){var t=this.option.seriesIndex,e=[];return null==t||"all"===t?this.ecModel.eachSeries(function(t,i){e.push(i)}):e=Di(t),e},eachTargetSeries:function(t,e){d(this.getTargetSeriesIndices(),function(i){t.call(e,this.ecModel.getSeriesByIndex(i))},this)},isTargetSeries:function(t){var e=!1;return this.eachTargetSeries(function(i){i===t&&(e=!0)}),e},formatValueText:function(t,e,i){function n(t){return t===l[0]?"min":t===l[1]?"max":(+t).toFixed(Math.min(s,20))}var o,a,r=this.option,s=r.precision,l=this.dataBound,u=r.formatter;return i=i||["<",">"],y(t)&&(t=t.slice(),o=!0),a=e?t:o?[n(t[0]),n(t[1])]:n(t),_(u)?u.replace("{value}",o?a[0]:a).replace("{value2}",o?a[1]:a):x(u)?o?u(t[0],t[1]):u(t):o?t[0]===l[0]?i[0]+" "+a[1]:t[1]===l[1]?i[1]+" "+a[0]:a[0]+" - "+a[1]:a},resetExtent:function(){var t=this.option,e=AO([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;o>=0;o--){var a=n[o];if(!t.getDimensionInfo(a).isCalculationCoord)return a}}},getExtent:function(){return this._dataExtent.slice()},completeVisualOption:function(){function t(t){IO(o.color)&&!t.inRange&&(t.inRange={color:o.color.slice().reverse()}),t.inRange=t.inRange||{color:e.get("gradientColor")},TO(this.stateList,function(e){var i=t[e];if(_(i)){var n=wO.get(i,"active",l);n?(t[e]={},t[e][i]=n):delete t[e]}},this)}var e=this.ecModel,o=this.option,a={inRange:o.inRange,outOfRange:o.outOfRange},r=o.target||(o.target={}),s=o.controller||(o.controller={});n(r,a),n(s,a);var l=this.isCategory();t.call(this,r),t.call(this,s),function(t,e,i){var n=t[e],o=t[i];n&&!o&&(o=t[i]={},TO(n,function(t,e){if(hL.isValidType(e)){var i=wO.get(e,"inactive",l);null!=i&&(o[e]=i,"color"!==e||o.hasOwnProperty("opacity")||o.hasOwnProperty("colorAlpha")||(o.opacity=[0,0]))}}))}.call(this,r,"inRange","outOfRange"),function(t){var e=(t.inRange||{}).symbol||(t.outOfRange||{}).symbol,n=(t.inRange||{}).symbolSize||(t.outOfRange||{}).symbolSize,o=this.get("inactiveColor");TO(this.stateList,function(a){var r=this.itemSize,s=t[a];s||(s=t[a]={color:l?o:[o]}),null==s.symbol&&(s.symbol=e&&i(e)||(l?"roundRect":["roundRect"])),null==s.symbolSize&&(s.symbolSize=n&&i(n)||(l?r[0]:[r[0],r[0]])),s.symbol=SO(s.symbol,function(t){return"none"===t||"square"===t?"roundRect":t});var u=s.symbolSize;if(null!=u){var h=-1/0;MO(u,function(t){t>h&&(h=t)}),s.symbolSize=SO(u,function(t){return DO(t,[0,h],[0,r[0]],!0)})}},this)}.call(this,s)},resetItemSize:function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},isCategory:function(){return!!this.option.categories},setSelected:CO,getValueState:CO,getVisualMeta:CO}),kO=[20,140],PO=LO.extend({type:"visualMap.continuous",defaultOption:{align:"auto",calculable:!1,range:null,realtime:!0,itemHeight:null,itemWidth:null,hoverLink:!0,hoverLinkDataSize:null,hoverLinkOnHandle:null},optionUpdated:function(t,e){PO.superApply(this,"optionUpdated",arguments),this.resetExtent(),this.resetVisual(function(t){t.mappingMethod="linear",t.dataExtent=this.getExtent()}),this._resetRange()},resetItemSize:function(){PO.superApply(this,"resetItemSize",arguments);var t=this.itemSize;"horizontal"===this._orient&&t.reverse(),(null==t[0]||isNaN(t[0]))&&(t[0]=kO[0]),(null==t[1]||isNaN(t[1]))&&(t[1]=kO[1])},_resetRange:function(){var t=this.getExtent(),e=this.option.range;!e||e.auto?(t.auto=1,this.option.range=t):y(e)&&(e[0]>e[1]&&e.reverse(),e[0]=Math.max(e[0],t[0]),e[1]=Math.min(e[1],t[1]))},completeVisualOption:function(){LO.prototype.completeVisualOption.apply(this,arguments),d(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=Fo((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(t){var e=[];return this.eachTargetSeries(function(i){var n=[],o=i.getData();o.each(this.getDataDimension(o),function(e,i){t[0]<=e&&e<=t[1]&&n.push(i)},this),e.push({seriesId:i.id,dataIndex:n})},this),e},getVisualMeta:function(t){function e(e,i){o.push({value:e,color:t(e,i)})}for(var i=Qy(0,0,this.getExtent()),n=Qy(0,0,this.option.range.slice()),o=[],a=0,r=0,s=n.length,l=i.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 tb("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(t,e){if(this._useHandle){var i=this._shapes,n=this.visualMapModel,o=i.handleThumbs,a=i.handleLabels;EO([0,1],function(r){var s=o[r];s.setStyle("fill",e.handlesColor[r]),s.position[1]=t[r];var l=Do(i.handleLabelPoints[r],Ao(s,this.group));a[r].setStyle({x:l[0],y:l[1],text:n.formatValueText(this._dataInterval[r]),textVerticalAlign:"middle",textAlign:this._applyTransform("horizontal"===this._orient?0===r?"bottom":"top":"left",i.barGroup)})},this)}},_showIndicator:function(t,e,i,n){var o=this.visualMapModel,a=o.getExtent(),r=o.itemSize,s=[0,r[1]],l=OO(t,a,s,!0),u=this._shapes,h=u.indicator;if(h){h.position[1]=l,h.attr("invisible",!1),h.setShape("points",ox(!!i,n,l,r[1]));var c={convertOpacityToAlpha:!0},d=this.getControllerVisual(t,"color",c);h.setStyle("fill",d);var f=Do(u.indicatorLabelPoint,Ao(h,this.group)),p=u.indicatorLabel;p.attr("invisible",!1);var g=this._applyTransform("left",u.barGroup),m=this._orient;p.setStyle({text:(i||"")+o.formatValueText(e),textVerticalAlign:"horizontal"===m?g:"middle",textAlign:"horizontal"===m?"center":g,x:f[0],y:f[1]})}},_enableHoverLinkToSeries:function(){var t=this;this._shapes.barGroup.on("mousemove",function(e){if(t._hovering=!0,!t._dragging){var i=t.visualMapModel.itemSize,n=t._applyTransform([e.offsetX,e.offsetY],t._shapes.barGroup,!0,!0);n[1]=RO(zO(0,n[1]),i[1]),t._doHoverLinkToSeries(n[1],0<=n[0]&&n[0]<=i[0])}}).on("mouseout",function(){t._hovering=!1,!t._dragging&&t._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=RO(zO(o[0],t),o[1]);var r=ax(i,a,o),s=[t-r,t+r],l=OO(t,o,a,!0),u=[OO(s[0],o,a,!0),OO(s[1],o,a,!0)];s[0]o[1]&&(u[1]=1/0),e&&(u[0]===-1/0?this._showIndicator(l,u[1],"< ",r):u[1]===1/0?this._showIndicator(l,u[0],"> ",r):this._showIndicator(l,l,"≈ ",r));var h=this._hoverLinkDataIndices,c=[];(e||rx(i))&&(c=this._hoverLinkDataIndices=i.findTargetDataIndices(u));var d=Ri(h,c);this._dispatchHighDown("downplay",ex(d[0])),this._dispatchHighDown("highlight",ex(d[1]))}},_hoverLinkFromSeriesMouseOver:function(t){var e=t.target,i=this.visualMapModel;if(e&&null!=e.dataIndex){var n=this.ecModel.getSeriesByIndex(e.seriesIndex);if(i.isTargetSeries(n)){var o=n.getData(e.dataType),a=o.get(i.getDataDimension(o),e.dataIndex,!0);isNaN(a)||this._showIndicator(a,a)}}},_hideIndicator:function(){var t=this._shapes;t.indicator&&t.indicator.attr("invisible",!0),t.indicatorLabel&&t.indicatorLabel.attr("invisible",!0)},_clearHoverLinkToSeries:function(){this._hideIndicator();var t=this._hoverLinkDataIndices;this._dispatchHighDown("downplay",ex(t)),t.length=0},_clearHoverLinkFromSeries:function(){this._hideIndicator();var t=this.api.getZr();t.off("mouseover",this._hoverLinkFromSeriesMouseOver),t.off("mouseout",this._hideIndicator)},_applyTransform:function(t,e,i,n){var o=Ao(e,n?null:this.group);return zM[y(t)?"applyTransform":"transformDirection"](t,o,i)},_dispatchHighDown:function(t,e){e&&e.length&&this.api.dispatchAction({type:t,batch:e})},dispose:function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},remove:function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()}});Es({type:"selectDataRange",event:"dataRangeSelected",update:"update"},function(t,e){e.eachComponent({mainType:"visualMap",query:t},function(e){e.setSelected(t.selected)})}),Ns(xO);var FO=LO.extend({type:"visualMap.piecewise",defaultOption:{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieceList:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0,showLabel:null},optionUpdated:function(t,e){FO.superApply(this,"optionUpdated",arguments),this._pieceList=[],this.resetExtent();var n=this._mode=this._determineMode();WO[this._mode].call(this),this._resetSelected(t,e);var o=this.option.categories;this.resetVisual(function(t,e){"categories"===n?(t.mappingMethod="category",t.categories=i(o)):(t.dataExtent=this.getExtent(),t.mappingMethod="piecewise",t.pieceList=f(this._pieceList,function(t){var t=i(t);return"inRange"!==e&&(t.visual=null),t}))})},completeVisualOption:function(){function t(t,e,i){return t&&t[e]&&(w(t[e])?t[e].hasOwnProperty(i):t[e]===i)}var e=this.option,i={},n=hL.listVisualTypes(),o=this.isCategory();d(e.pieces,function(t){d(n,function(e){t.hasOwnProperty(e)&&(i[e]=1)})}),d(i,function(i,n){var a=0;d(this.stateList,function(i){a|=t(e,i,n)||t(e.target,i,n)},this),!a&&d(this.stateList,function(t){(e[t]||(e[t]={}))[n]=wO.get(n,"inRange"===t?"active":"inactive",o)})},this),LO.prototype.completeVisualOption.apply(this,arguments)},_resetSelected:function(t,e){var i=this.option,n=this._pieceList,o=(e?i:t).selected||{};if(i.selected=o,d(n,function(t,e){var i=this.getSelectedMapKey(t);o.hasOwnProperty(i)||(o[i]=!0)},this),"single"===i.selectedMode){var a=!1;d(n,function(t,e){var i=this.getSelectedMapKey(t);o[i]&&(a?o[i]=!1:a=!0)},this)}},getSelectedMapKey:function(t){return"categories"===this._mode?t.value+"":t.index+""},getPieceList:function(){return this._pieceList},_determineMode:function(){var t=this.option;return t.pieces&&t.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},setSelected:function(t){this.option.selected=i(t)},getValueState:function(t){var e=hL.findPieceIndex(t,this._pieceList);return null!=e&&this.option.selected[this.getSelectedMapKey(this._pieceList[e])]?"inRange":"outOfRange"},findTargetDataIndices:function(t){var e=[];return this.eachTargetSeries(function(i){var n=[],o=i.getData();o.each(this.getDataDimension(o),function(e,i){hL.findPieceIndex(e,this._pieceList)===t&&n.push(i)},this),e.push({seriesId:i.id,dataIndex:n})},this),e},getRepresentValue:function(t){var e;if(this.isCategory())e=t.value;else if(null!=t.value)e=t.value;else{var i=t.interval||[];e=i[0]===-1/0&&i[1]===1/0?0:(i[0]+i[1])/2}return e},getVisualMeta:function(t){function e(e,a){var r=o.getRepresentValue({interval:e});a||(a=o.getValueState(r));var s=t(r,a);e[0]===-1/0?n[0]=s:e[1]===1/0?n[1]=s:i.push({value:e[0],color:s},{value:e[1],color:s})}if(!this.isCategory()){var i=[],n=[],o=this,a=this._pieceList.slice();if(a.length){var r=a[0].interval[0];r!==-1/0&&a.unshift({interval:[-1/0,r]}),(r=a[a.length-1].interval[1])!==1/0&&a.push({interval:[r,1/0]})}else a.push({interval:[-1/0,1/0]});var s=-1/0;return d(a,function(t){var i=t.interval;i&&(i[0]>s&&e([s,i[0]],"outOfRange"),e(i.slice()),s=i[1])},this),{stops:i,outerColors:n}}}}),WO={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)}};NO.extend({type:"visualMap.piecewise",doRender:function(){var t=this.group;t.removeAll();var e=this.visualMapModel,i=e.get("textGap"),n=e.textStyleModel,o=n.getFont(),a=n.getTextColor(),r=this._getItemAlign(),s=e.itemSize,l=this._getViewData(),u=l.endsText,h=T(e.get("showLabel",!0),!u);u&&this._renderEndsText(t,u[0],s,h,r),d(l.viewPieceList,function(n){var l=n.piece,u=new tb;u.onclick=m(this._onItemClick,this,l),this._enableHoverLink(u,n.indexInModelPieceList);var c=e.getRepresentValue(l);if(this._createItemSymbol(u,c,[0,0,s[0],s[1]]),h){var d=this.visualMapModel.getValueState(c);u.add(new rM({style:{x:"right"===r?-i:s[0]+i,y:s[1]/2,text:l.text,textVerticalAlign:"middle",textAlign:r,textFont:o,textFill:a,opacity:"outOfRange"===d?.5:1}}))}t.add(u)},this),u&&this._renderEndsText(t,u[1],s,h,r),aI(e.get("orient"),t,e.get("itemGap")),this.renderBackground(t),this.positionGroup(t)},_enableHoverLink:function(t,e){function i(t){var i=this.visualMapModel;i.option.hoverLink&&this.api.dispatchAction({type:t,batch:ex(i.findTargetDataIndices(e))})}t.on("mouseover",m(i,this,"highlight")).on("mouseout",m(i,this,"downplay"))},_getItemAlign:function(){var t=this.visualMapModel,e=t.option;if("vertical"===e.orient)return tx(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 tb,r=this.visualMapModel.textStyleModel;a.add(new rM({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=f(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(Jl(this.getControllerVisual(e,"symbol"),i[0],i[1],i[2],i[3],this.getControllerVisual(e,"color")))},_onItemClick:function(t){var e=this.visualMapModel,n=e.option,o=i(n.selected),a=e.getSelectedMapKey(t);"single"===n.selectedMode?(o[a]=!0,d(o,function(t,e){o[e]=e===a})):o[a]=!o[a],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:o})}});Ns(xO);var HO=ta,ZO=ia,UO=Fs({type:"marker",dependencies:["series","grid","polar","geo"],init:function(t,e,i,n){this.mergeDefaultAndTheme(t,i),this.mergeOption(t,i,n.createdBySelf,!0)},isAnimationEnabled:function(){if(U_.node)return!1;var t=this.__hostSeries;return this.getShallow("animation")&&t&&t.isAnimationEnabled()},mergeOption:function(t,e,i,n){var o=this.constructor,r=this.mainType+"Model";i||e.eachSeries(function(t){var i=t.get(this.mainType,!0),s=t[r];i&&i.data?(s?s.mergeOption(i,e,!0):(n&&ux(i),d(i.data,function(t){t instanceof Array?(ux(t[0]),ux(t[1])):ux(t)}),a(s=new o(i,this,e),{mainType:this.mainType,seriesIndex:t.seriesIndex,name:t.name,createdBySelf:!0}),s.__hostSeries=t),t[r]=s):t[r]=null},this)},formatTooltip:function(t){var e=this.getData(),i=this.getRawValue(t),n=y(i)?f(i,HO).join(", "):HO(i),o=e.getName(t),a=ZO(this.name);return(null!=i||o)&&(a+="
"),o&&(a+=ZO(o),null!=i&&(a+=" : ")),null!=i&&(a+=ZO(n)),a},getData:function(){return this._data},setData:function(t){this._data=t}});h(UO,ZI),UO.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 XO=l,jO=v,YO={min:jO(dx,"min"),max:jO(dx,"max"),average:jO(dx,"average")},qO=Ws({type:"marker",init:function(){this.markerGroupMap=R()},render:function(t,e,i){var n=this.markerGroupMap;n.each(function(t){t.__keep=!1});var o=this.type+"Model";e.eachSeries(function(t){var n=t[o];n&&this.renderSeries(t,n,e,i)},this),n.each(function(t){!t.__keep&&this.group.remove(t.group)},this)},renderSeries:function(){}});qO.extend({type:"markPoint",updateTransform:function(t,e,i){e.eachSeries(function(t){var e=t.markPointModel;e&&(xx(e.getData(),t,i),this.markerGroupMap.get(t.id).updateLayout(e))},this)},renderSeries:function(t,e,i,n){var o=t.coordinateSystem,a=t.id,r=t.getData(),s=this.markerGroupMap,l=s.get(a)||s.set(a,new Du),u=_x(o,t,e);e.setData(u),xx(e.getData(),t,n),u.each(function(t){var i=u.getItemModel(t),n=i.getShallow("symbolSize");"function"==typeof n&&(n=n(e.getRawValue(t),e.getDataParams(t))),u.setItemVisual(t,{symbolSize:n,color:i.get("itemStyle.color")||r.getVisual("color"),symbol:i.getShallow("symbol")})}),l.updateData(u),this.group.add(l.group),u.eachItemGraphicEl(function(t){t.traverse(function(t){t.dataModel=e})}),l.__keep=!0,l.group.silent=e.get("silent")||t.get("silent")}}),Ns(function(t){t.markPoint=t.markPoint||{}}),UO.extend({type:"markLine",defaultOption:{zlevel:0,z:5,symbol:["circle","arrow"],symbolSize:[8,16],precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end"},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"}});var KO=function(t,e,o,r){var s=t.getData(),l=r.type;if(!y(r)&&("min"===l||"max"===l||"average"===l||"median"===l||null!=r.xAxis||null!=r.yAxis)){var u,h;if(null!=r.yAxis||null!=r.xAxis)u=null!=r.yAxis?"y":"x",e.getAxis(u),h=T(r.yAxis,r.xAxis);else{var c=px(r,s,e,t);u=c.valueDataDim,c.valueAxis,h=yx(s,u,l)}var d="x"===u?0:1,f=1-d,p=i(r),g={};p.type=null,p.coord=[],g.coord=[],p.coord[f]=-1/0,g.coord[f]=1/0;var m=o.get("precision");m>=0&&"number"==typeof h&&(h=+h.toFixed(Math.min(m,20))),p.coord[d]=g.coord[d]=h,r=[p,g,{type:l,valueIndex:r.valueIndex,value:h}]}return r=[fx(t,r[0]),fx(t,r[1]),a({},r[2])],r[2].type=r[2].type||"",n(r[2],r[0]),n(r[2],r[1]),r};qO.extend({type:"markLine",updateTransform:function(t,e,i){e.eachSeries(function(t){var e=t.markLineModel;if(e){var n=e.getData(),o=e.__from,a=e.__to;o.each(function(e){Ix(o,e,!0,t,i),Ix(a,e,!1,t,i)}),n.each(function(t){n.setItemLayout(t,[o.getItemLayout(t),a.getItemLayout(t)])}),this.markerGroupMap.get(t.id).updateLayout()}},this)},renderSeries:function(t,e,i,n){function o(e,i,o){var a=e.getItemModel(i);Ix(e,i,o,t,n),e.setItemVisual(i,{symbolSize:a.get("symbolSize")||g[o?0:1],symbol:a.get("symbol",!0)||p[o?0:1],color:a.get("itemStyle.color")||s.getVisual("color")})}var a=t.coordinateSystem,r=t.id,s=t.getData(),l=this.markerGroupMap,u=l.get(r)||l.set(r,new sf);this.group.add(u.group);var h=Tx(a,t,e),c=h.from,d=h.to,f=h.line;e.__from=c,e.__to=d,e.setData(f);var p=e.get("symbol"),g=e.get("symbolSize");y(p)||(p=[p,p]),"number"==typeof g&&(g=[g,g]),h.from.each(function(t){o(c,t,!0),o(d,t,!1)}),f.each(function(t){var e=f.getItemModel(t).get("lineStyle.color");f.setItemVisual(t,{color:e||c.getItemVisual(t,"color")}),f.setItemLayout(t,[c.getItemLayout(t),d.getItemLayout(t)]),f.setItemVisual(t,{fromSymbolSize:c.getItemVisual(t,"symbolSize"),fromSymbol:c.getItemVisual(t,"symbol"),toSymbolSize:d.getItemVisual(t,"symbolSize"),toSymbol:d.getItemVisual(t,"symbol")})}),u.updateData(f),h.line.eachItemGraphicEl(function(t,i){t.traverse(function(t){t.dataModel=e})}),u.__keep=!0,u.group.silent=e.get("silent")||t.get("silent")}}),Ns(function(t){t.markLine=t.markLine||{}}),UO.extend({type:"markArea",defaultOption:{zlevel:0,z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}}});var $O=function(t,e,i,n){var a=fx(t,n[0]),r=fx(t,n[1]),s=T,l=a.coord,u=r.coord;l[0]=s(l[0],-1/0),l[1]=s(l[1],-1/0),u[0]=s(u[0],1/0),u[1]=s(u[1],1/0);var h=o([{},a,r]);return h.coord=[a.coord,r.coord],h.x0=a.x,h.y0=a.y,h.x1=r.x,h.y1=r.y,h},JO=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]];qO.extend({type:"markArea",updateTransform:function(t,e,i){e.eachSeries(function(t){var e=t.markAreaModel;if(e){var n=e.getData();n.each(function(e){var o=f(JO,function(o){return Lx(n,e,o,t,i)});n.setItemLayout(e,o),n.getItemGraphicEl(e).setShape("points",o)})}},this)},renderSeries:function(t,e,i,n){var o=t.coordinateSystem,a=t.id,s=t.getData(),l=this.markerGroupMap,u=l.get(a)||l.set(a,{group:new tb});this.group.add(u.group),u.__keep=!0;var h=kx(o,t,e);e.setData(h),h.each(function(e){h.setItemLayout(e,f(JO,function(i){return Lx(h,e,i,t,n)})),h.setItemVisual(e,{color:s.getVisual("color")})}),h.diff(u.__data).add(function(t){var e=new pM({shape:{points:h.getItemLayout(t)}});h.setItemGraphicEl(t,e),u.group.add(e)}).update(function(t,i){var n=u.__data.getItemGraphicEl(i);Io(n,{shape:{points:h.getItemLayout(t)}},e,t),u.group.add(n),h.setItemGraphicEl(t,n)}).remove(function(t){var e=u.__data.getItemGraphicEl(t);u.group.remove(e)}).execute(),h.eachItemGraphicEl(function(t,i){var n=h.getItemModel(i),o=n.getModel("label"),a=n.getModel("emphasis.label"),s=h.getItemVisual(i,"color");t.useStyle(r(n.getModel("itemStyle").getItemStyle(),{fill:Yt(s,.4),stroke:s})),t.hoverStyle=n.getModel("emphasis.itemStyle").getItemStyle(),go(t.style,t.hoverStyle,o,a,{labelFetcher:e,labelDataIndex:i,defaultText:h.getName(i)||"",isRectText:!0,autoColor:s}),fo(t,{}),t.dataModel=e}),u.__data=h,u.group.silent=e.get("silent")||t.get("silent")}}),Ns(function(t){t.markArea=t.markArea||{}});lI.registerSubTypeDefaulter("timeline",function(){return"slider"}),Es({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"),r({currentIndex:i.option.currentIndex},t)}),Es({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},function(t,e){var i=e.getComponent("timeline");i&&null!=t.playState&&i.setPlayState(t.playState)});var QO=lI.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){QO.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:(t>=e&&(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||[],n=t.axisType,o=this._names=[];if("category"===n){var a=[];d(e,function(t,e){var n,r=Li(t);w(t)?(n=i(t)).value=e:n=e,a.push(n),_(r)||null!=r&&!isNaN(r)||(r=""),o.push(r+"")}),e=a}var r={category:"ordinal",time:"time"}[n]||"number";(this._data=new vA([{name:"value",type:r}],this)).initData(e,o)},getData:function(){return this._data},getCategories:function(){if("category"===this.get("axisType"))return this._names.slice()}});h(QO.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:[]}}),ZI);var tE=qI.extend({type:"timeline"}),eE=function(t,e,i,n){aD.call(this,t,e,i),this.type=n||"value",this.model=null};eE.prototype={constructor:eE,getLabelModel:function(){return this.model.getModel("label")},isHorizontal:function(){return"horizontal"===this.model.get("orient")}},u(eE,aD);var iE=m,nE=d,oE=Math.PI;tE.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(t,e,i,n){if(this.model=t,this.api=i,this.ecModel=e,this.group.removeAll(),t.get("show",!0)){var o=this._layout(t,i),a=this._createGroup("mainGroup"),r=this._createGroup("labelGroup"),s=this._axis=this._createAxis(o,t);t.formatTooltip=function(t){return ia(s.scale.getLabel(t))},nE(["AxisLine","AxisTick","Control","CurrentPointer"],function(e){this["_render"+e](o,a,s,t)},this),this._renderAxisLabel(o,r,s,t),this._position(o,t)}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=Ex(t,e);null==i||"auto"===i?i="horizontal"===n?o.y+o.height/2=0||"+"===i?"left":"right"},r={horizontal:i>=0||"+"===i?"top":"bottom",vertical:"middle"},s={horizontal:0,vertical:oE/2},l="vertical"===n?o.height:o.width,u=t.getModel("controlStyle"),h=u.get("show",!0),c=h?u.get("itemSize"):0,d=h?u.get("itemGap"):0,f=c+d,p=t.get("label.rotate")||0;p=p*oE/180;var g,m,v,y,x=u.get("position",!0),_=h&&u.get("showPlayBtn",!0),w=h&&u.get("showPrevBtn",!0),b=h&&u.get("showNextBtn",!0),S=0,M=l;return"left"===x||"bottom"===x?(_&&(g=[0,0],S+=f),w&&(m=[S,0],S+=f),b&&(v=[M-c,0],M-=f)):(_&&(g=[M-c,0],M-=f),w&&(m=[0,0],S+=f),b&&(v=[M-c,0],M-=f)),y=[S,M],t.get("inverse")&&y.reverse(),{viewRect:o,mainLength:l,orient:n,rotation:s[n],labelRotation:p,labelPosOpt:i,labelAlign:t.get("label.align")||a[n],labelBaseline:t.get("label.verticalAlign")||t.get("label.baseline")||r[n],playPosition:g,prevBtnPosition:m,nextBtnPosition:v,axisExtent:y,controlSize:c,controlGap:d}},_position:function(t,e){function i(t){var e=t.position;t.origin=[c[0][0]-e[0],c[1][0]-e[1]]}function n(t){return[[t.x,t.x+t.width],[t.y,t.y+t.height]]}function o(t,e,i,n,o){t[n]+=i[n][o]-e[n][o]}var a=this._mainGroup,r=this._labelGroup,s=t.viewRect;if("vertical"===t.orient){var l=xt(),u=s.x,h=s.y+s.height;St(l,l,[-u,-h]),Mt(l,l,-oE/2),St(l,l,[u,h]),(s=s.clone()).applyTransform(l)}var c=n(s),d=n(a.getBoundingRect()),f=n(r.getBoundingRect()),p=a.position,g=r.position;g[0]=p[0]=c[0][0];var m=t.labelPosOpt;if(isNaN(m))o(p,d,c,1,v="+"===m?0:1),o(g,f,c,1,1-v);else{var v=m>=0?0:1;o(p,d,c,1,v),g[1]=p[1]+m}a.attr("position",p),r.attr("position",g),a.rotation=r.rotation=t.rotation,i(a),i(r)},_createAxis:function(t,e){var i=e.getData(),n=e.get("axisType"),o=Hl(e,n);o.getTicks=function(){return i.mapArray(["value"],function(t){return t})};var a=i.getDataExtent("value");o.setExtent(a[0],a[1]),o.niceTicks();var r=new eE("value",o,t.axisExtent,n);return r.model=e,r},_createGroup:function(t){var e=this["_"+t]=new tb;return this.group.add(e),e},_renderAxisLine:function(t,e,i,n){var o=i.getExtent();n.get("lineStyle.show")&&e.add(new _M({shape:{x1:o[0],y1:0,x2:o[1],y2:0},style:a({lineCap:"round"},n.getModel("lineStyle").getLineStyle()),silent:!0,z2:1}))},_renderAxisTick:function(t,e,i,n){var o=n.getData(),a=i.scale.getTicks();nE(a,function(t){var a=i.dataToCoord(t),r=o.getItemModel(t),s=r.getModel("itemStyle"),l=r.getModel("emphasis.itemStyle"),u={position:[a,0],onclick:iE(this._changeTimeline,this,t)},h=zx(r,s,e,u);fo(h,l.getItemStyle()),r.get("tooltip")?(h.dataIndex=t,h.dataModel=n):h.dataIndex=h.dataModel=null},this)},_renderAxisLabel:function(t,e,i,n){if(i.getLabelModel().get("show")){var o=n.getData(),a=i.getViewLabels();nE(a,function(n){var a=n.tickValue,r=o.getItemModel(a),s=r.getModel("label"),l=r.getModel("emphasis.label"),u=i.dataToCoord(n.tickValue),h=new rM({position:[u,0],rotation:t.labelRotation-t.rotation,onclick:iE(this._changeTimeline,this,a),silent:!1});mo(h.style,s,{text:n.formattedLabel,textAlign:t.labelAlign,textVerticalAlign:t.labelBaseline}),e.add(h),fo(h,mo({},l))},this)}},_renderControl:function(t,e,i,n){function o(t,i,o,h){if(t){var c=Rx(n,i,u,{position:t,origin:[a/2,0],rotation:h?-r:0,rectHover:!0,style:s,onclick:o});e.add(c),fo(c,l)}}var a=t.controlSize,r=t.rotation,s=n.getModel("controlStyle").getItemStyle(),l=n.getModel("emphasis.controlStyle").getItemStyle(),u=[0,-a/2,a,a],h=n.getPlayState(),c=n.get("inverse",!0);o(t.nextBtnPosition,"controlStyle.nextIcon",iE(this._changeTimeline,this,c?"-":"+")),o(t.prevBtnPosition,"controlStyle.prevIcon",iE(this._changeTimeline,this,c?"+":"-")),o(t.playPosition,"controlStyle."+(h?"stopIcon":"playIcon"),iE(this._handlePlayClick,this,!h),!0)},_renderCurrentPointer:function(t,e,i,n){var o=n.getData(),a=n.getCurrentIndex(),r=o.getItemModel(a).getModel("checkpointStyle"),s=this,l={onCreate:function(t){t.draggable=!0,t.drift=iE(s._handlePointerDrag,s),t.ondragend=iE(s._handlePointerDragend,s),Bx(t,a,i,n,!0)},onUpdate:function(t){Bx(t,a,i,n)}};this._currentPointer=zx(r,r,this._mainGroup,{},this._currentPointer,l)},_handlePlayClick:function(t){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:t,from:this.uid})},_handlePointerDrag:function(t,e,i){this._clearTimer(),this._pointerChangeTimeline([i.offsetX,i.offsetY])},_handlePointerDragend:function(t){this._pointerChangeTimeline([t.offsetX,t.offsetY],!0)},_pointerChangeTimeline:function(t,e){var i=this._toAxisCoord(t)[0],n=Fo(this._axis.getExtent().slice());i>n[1]&&(i=n[1]),ii.getHeight()&&(n.textPosition="top",l=!0);var u=l?-5-o.height:s+8;a+o.width/2>i.getWidth()?(n.textPosition=["100%",u],n.textAlign="right"):a-o.width/2<0&&(n.textPosition=[0,u],n.textAlign="left")}})}},updateView:function(t,e,i,n){d(this._features,function(t){t.updateView&&t.updateView(t.model,e,i,n)})},remove:function(t,e){d(this._features,function(i){i.remove&&i.remove(t,e)}),this.group.removeAll()},dispose:function(t,e){d(this._features,function(i){i.dispose&&i.dispose(t,e)})}});var rE=rT.toolbox.saveAsImage;Gx.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:rE.title,type:"png",name:"",excludeComponents:["toolbox"],pixelRatio:1,lang:rE.lang.slice()},Gx.prototype.unusable=!U_.canvasSupported,Gx.prototype.onclick=function(t,e){var i=this.model,n=i.get("name")||t.get("title.0.text")||"echarts",o=document.createElement("a"),a=i.get("type",!0)||"png";o.download=n+"."+a,o.target="_blank";var r=e.getConnectedDataURL({type:a,backgroundColor:i.get("backgroundColor",!0)||t.get("backgroundColor")||"#fff",excludeComponents:i.get("excludeComponents"),pixelRatio:i.get("pixelRatio")});if(o.href=r,"function"!=typeof MouseEvent||U_.browser.ie||U_.browser.edge)if(window.navigator.msSaveOrOpenBlob){for(var s=atob(r.split(",")[1]),l=s.length,u=new Uint8Array(l);l--;)u[l]=s.charCodeAt(l);var h=new Blob([u]);window.navigator.msSaveOrOpenBlob(h,n+"."+a)}else{var c=i.get("lang"),d='';window.open().document.write(d)}else{var f=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!1});o.dispatchEvent(f)}},Ty("saveAsImage",Gx);var sE=rT.toolbox.magicType;Fx.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",tiled:"M2.3,2.2h22.8V25H2.3V2.2z M35,2.2h22.8V25H35V2.2zM2.3,35h22.8v22.8H2.3V35z M35,35h22.8v22.8H35V35z"},title:i(sE.title),option:{},seriesIndex:{}};var lE=Fx.prototype;lE.getIcons=function(){var t=this.model,e=t.get("icon"),i={};return d(t.get("type"),function(t){e[t]&&(i[t]=e[t])}),i};var uE={line:function(t,e,i,o){if("bar"===t)return n({id:e,type:"line",data:i.get("data"),stack:i.get("stack"),markPoint:i.get("markPoint"),markLine:i.get("markLine")},o.get("option.line")||{},!0)},bar:function(t,e,i,o){if("line"===t)return n({id:e,type:"bar",data:i.get("data"),stack:i.get("stack"),markPoint:i.get("markPoint"),markLine:i.get("markLine")},o.get("option.bar")||{},!0)},stack:function(t,e,i,o){if("line"===t||"bar"===t)return n({id:e,stack:"__ec_magicType_stack__"},o.get("option.stack")||{},!0)},tiled:function(t,e,i,o){if("line"===t||"bar"===t)return n({id:e,stack:""},o.get("option.tiled")||{},!0)}},hE=[["line","bar"],["stack","tiled"]];lE.onclick=function(t,e,i){var n=this.model,o=n.get("seriesIndex."+i);if(uE[i]){var a={series:[]};d(hE,function(t){l(t,i)>=0&&d(t,function(t){n.setIconStatus(t,"normal")})}),n.setIconStatus(i,"emphasis"),t.eachComponent({mainType:"series",query:null==o?null:{seriesIndex:o}},function(e){var o=e.subType,s=e.id,l=uE[i](o,s,e,n);l&&(r(l,e.option),a.series.push(l));var u=e.coordinateSystem;if(u&&"cartesian2d"===u.type&&("line"===i||"bar"===i)){var h=u.getAxesByScale("ordinal")[0];if(h){var c=h.dim+"Axis",d=t.queryComponents({mainType:c,index:e.get(name+"Index"),id:e.get(name+"Id")})[0].componentIndex;a[c]=a[c]||[];for(var f=0;f<=d;f++)a[c][d]=a[c][d]||{};a[c][d].boundaryGap="bar"===i}}}),e.dispatchAction({type:"changeMagicType",currentType:i,newOption:a})}},Es({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(t,e){e.mergeOption(t.newOption)}),Ty("magicType",Fx);var cE=rT.toolbox.dataView,dE=new Array(60).join("-"),fE="\t",pE=new RegExp("["+fE+"]+","g");$x.defaultOption={show:!0,readOnly:!1,optionToContent:null,contentToOption:null,icon:"M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",title:i(cE.title),lang:i(cE.lang),backgroundColor:"#fff",textColor:"#000",textareaColor:"#fff",textareaBorderColor:"#333",buttonColor:"#c23531",buttonTextColor:"#fff"},$x.prototype.onclick=function(t,e){function i(){n.removeChild(a),x._dom=null}var n=e.getDom(),o=this.model;this._dom&&n.removeChild(this._dom);var a=document.createElement("div");a.style.cssText="position:absolute;left:5px;top:5px;bottom:5px;right:5px;",a.style.backgroundColor=o.get("backgroundColor")||"#fff";var r=document.createElement("h4"),s=o.get("lang")||[];r.innerHTML=s[0]||o.get("title"),r.style.cssText="margin: 10px 20px;",r.style.color=o.get("textColor");var l=document.createElement("div"),u=document.createElement("textarea");l.style.cssText="display:block;width:100%;overflow:auto;";var h=o.get("optionToContent"),c=o.get("contentToOption"),d=Ux(t);if("function"==typeof h){var f=h(e.getOption());"string"==typeof f?l.innerHTML=f:M(f)&&l.appendChild(f)}else l.appendChild(u),u.readOnly=o.get("readOnly"),u.style.cssText="width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;",u.style.color=o.get("textColor"),u.style.borderColor=o.get("textareaBorderColor"),u.style.backgroundColor=o.get("textareaColor"),u.value=d.value;var p=d.meta,g=document.createElement("div");g.style.cssText="position:absolute;bottom:0;left:0;right:0;";var m="float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",v=document.createElement("div"),y=document.createElement("div");m+=";background-color:"+o.get("buttonColor"),m+=";color:"+o.get("buttonTextColor");var x=this;ht(v,"click",i),ht(y,"click",function(){var t;try{t="function"==typeof c?c(l,e.getOption()):Kx(u.value,p)}catch(t){throw i(),new Error("Data view format error "+t)}t&&e.dispatchAction({type:"changeDataView",newOption:t}),i()}),v.innerHTML=s[1],y.innerHTML=s[2],y.style.cssText=m,v.style.cssText=m,!o.get("readOnly")&&g.appendChild(y),g.appendChild(v),ht(u,"keydown",function(t){if(9===(t.keyCode||t.which)){var e=this.value,i=this.selectionStart,n=this.selectionEnd;this.value=e.substring(0,i)+fE+e.substring(n),this.selectionStart=this.selectionEnd=i+1,mw(t)}}),a.appendChild(r),a.appendChild(l),a.appendChild(g),l.style.height=n.clientHeight-80+"px",n.appendChild(a),this._dom=a},$x.prototype.remove=function(t,e){this._dom&&e.getDom().removeChild(this._dom)},$x.prototype.dispose=function(t,e){this.remove(t,e)},Ty("dataView",$x),Es({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},function(t,e){var i=[];d(t.newOption.series,function(t){var n=e.getSeriesByName(t.name)[0];if(n){var o=n.get("data");i.push({name:t.name,data:Jx(t.data,o)})}else i.push(a({type:"scatter"},t))}),e.mergeOption(r({series:i},t.newOption))});var gE=d,mE="\0_ec_hist_store";iO.extend({type:"dataZoom.select"}),nO.extend({type:"dataZoom.select"});var vE=rT.toolbox.dataZoom,yE=d,xE="\0_ec_\0toolbox-dataZoom_";o_.defaultOption={show:!0,icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:i(vE.title)};var _E=o_.prototype;_E.render=function(t,e,i,n){this.model=t,this.ecModel=e,this.api=i,s_(t,e,this,n,i),r_(t,e)},_E.onclick=function(t,e,i){wE[i].call(this)},_E.remove=function(t,e){this._brushController.unmount()},_E.dispose=function(t,e){this._brushController.dispose()};var wE={zoom:function(){var t=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:t})},back:function(){this._dispatchZoomAction(t_(this.ecModel))}};_E._onBrush=function(t,e){function i(t,e,i){var r=e.getAxis(t),s=r.model,l=n(t,s,a),u=l.findRepresentativeAxisProxy(s).getMinMaxSpan();null==u.minValueSpan&&null==u.maxValueSpan||(i=QL(0,i.slice(),r.scale.getExtent(),0,u.minValueSpan,u.maxValueSpan)),l&&(o[l.id]={dataZoomId:l.id,startValue:i[0],endValue:i[1]})}function n(t,e,i){var n;return i.eachComponent({mainType:"dataZoom",subType:"select"},function(i){i.getAxisModel(t,e.componentIndex)&&(n=i)}),n}if(e.isEnd&&t.length){var o={},a=this.ecModel;this._brushController.updateCovers([]),new hy(a_(this.model.option),a,{include:["grid"]}).matchOutputRanges(t,a,function(t,e,n){if("cartesian2d"===n.type){var o=t.brushType;"rect"===o?(i("x",n,e[0]),i("y",n,e[1])):i({lineX:"x",lineY:"y"}[o],n,e)}}),Qx(a,o),this._dispatchZoomAction(o)}},_E._dispatchZoomAction=function(t){var e=[];yE(t,function(t,n){e.push(i(t))}),e.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:e})},Ty("dataZoom",o_),Ns(function(t){function e(t,e){if(e){var o=t+"Index",a=e[o];null==a||"all"===a||y(a)||(a=!1===a||"none"===a?[]:[a]),i(t,function(e,i){if(null==a||"all"===a||-1!==l(a,i)){var r={type:"select",$fromToolbox:!0,id:xE+t+i};r[o]=i,n.push(r)}})}}function i(e,i){var n=t[e];y(n)||(n=n?[n]:[]),yE(n,i)}if(t){var n=t.dataZoom||(t.dataZoom=[]);y(n)||(t.dataZoom=n=[n]);var o=t.toolbox;if(o&&(y(o)&&(o=o[0]),o&&o.feature)){var a=o.feature.dataZoom;e("xAxis",a),e("yAxis",a)}}});var bE=rT.toolbox.restore;l_.defaultOption={show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:bE.title},l_.prototype.onclick=function(t,e,i){e_(t),e.dispatchAction({type:"restore",from:this.uid})},Ty("restore",l_),Es({type:"restore",event:"restore",update:"prepareAndUpdate"},function(t,e){e.resetOption("recreate")});var SE,ME="urn:schemas-microsoft-com:vml",IE="undefined"==typeof window?null:window,TE=!1,AE=IE&&IE.document;if(AE&&!U_.canvasSupported)try{!AE.namespaces.zrvml&&AE.namespaces.add("zrvml",ME),SE=function(t){return AE.createElement("')}}catch(t){SE=function(t){return AE.createElement("<"+t+' xmlns="'+ME+'" class="zrvml">')}}var DE=ES.CMD,CE=Math.round,LE=Math.sqrt,kE=Math.abs,PE=Math.cos,NE=Math.sin,OE=Math.max;if(!U_.canvasSupported){var EE=21600,RE=EE/2,zE=function(t){t.style.cssText="position:absolute;left:0;top:0;width:1px;height:1px;",t.coordsize=EE+","+EE,t.coordorigin="0,0"},BE=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""")},VE=function(t,e,i){return"rgb("+[t,e,i].join(",")+")"},GE=function(t,e){e&&t&&e.parentNode!==t&&t.appendChild(e)},FE=function(t,e){e&&t&&e.parentNode===t&&t.removeChild(e)},WE=function(t,e,i){return 1e5*(parseFloat(t)||0)+1e3*(parseFloat(e)||0)+i},HE=function(t,e){return"string"==typeof t?t.lastIndexOf("%")>=0?parseFloat(t)/100*e:parseFloat(t):t},ZE=function(t,e,i){var n=Gt(e);i=+i,isNaN(i)&&(i=1),n&&(t.color=VE(n[0],n[1],n[2]),t.opacity=i*n[3])},UE=function(t){var e=Gt(t);return[VE(e[0],e[1],e[2]),e[3]]},XE=function(t,e,i){var n=e.fill;if(null!=n)if(n instanceof IM){var o,a=0,r=[0,0],s=0,l=1,u=i.getBoundingRect(),h=u.width,c=u.height;if("linear"===n.type){o="gradient";var d=i.transform,f=[n.x*h,n.y*c],p=[n.x2*h,n.y2*c];d&&(Q(f,f,d),Q(p,p,d));var g=p[0]-f[0],m=p[1]-f[1];(a=180*Math.atan2(g,m)/Math.PI)<0&&(a+=360),a<1e-6&&(a=0)}else{o="gradientradial";var f=[n.x*h,n.y*c],d=i.transform,v=i.scale,y=h,x=c;r=[(f[0]-u.x)/y,(f[1]-u.y)/x],d&&Q(f,f,d),y/=v[0]*EE,x/=v[1]*EE;var _=OE(y,x);s=0/_,l=2*n.r/_-s}var w=n.colorStops.slice();w.sort(function(t,e){return t.offset-e.offset});for(var b=w.length,S=[],M=[],I=0;I=2){var D=S[0][0],C=S[1][0],L=S[0][1]*e.opacity,k=S[1][1]*e.opacity;t.type=o,t.method="none",t.focus="100%",t.angle=a,t.color=D,t.color2=C,t.colors=M.join(","),t.opacity=k,t.opacity2=L}"radial"===o&&(t.focusposition=r.join(","))}else ZE(t,n,e.opacity)},jE=function(t,e){null!=e.lineDash&&(t.dashstyle=e.lineDash.join(" ")),null==e.stroke||e.stroke instanceof IM||ZE(t,e.stroke,e.opacity)},YE=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 IM&&FE(t,a),a||(a=u_(e)),o?XE(a,i,n):jE(a,i),GE(t,a)):(t[o?"filled":"stroked"]="false",FE(t,a))},qE=[[],[],[]],KE=function(t,e){var i,n,o,a,r,s,l=DE.M,u=DE.C,h=DE.L,c=DE.A,d=DE.Q,f=[],p=t.data,g=t.len();for(a=0;a.01?N&&(O+=.0125):Math.abs(E-D)<1e-4?N&&OA?x-=.0125:x+=.0125:N&&ED?y+=.0125:y-=.0125),f.push(R,CE(((A-C)*M+b)*EE-RE),",",CE(((D-L)*I+S)*EE-RE),",",CE(((A+C)*M+b)*EE-RE),",",CE(((D+L)*I+S)*EE-RE),",",CE((O*M+b)*EE-RE),",",CE((E*I+S)*EE-RE),",",CE((y*M+b)*EE-RE),",",CE((x*I+S)*EE-RE)),r=y,s=x;break;case DE.R:var z=qE[0],B=qE[1];z[0]=p[a++],z[1]=p[a++],B[0]=z[0]+p[a++],B[1]=z[1]+p[a++],e&&(Q(z,z,e),Q(B,B,e)),z[0]=CE(z[0]*EE-RE),B[0]=CE(B[0]*EE-RE),z[1]=CE(z[1]*EE-RE),B[1]=CE(B[1]*EE-RE),f.push(" m ",z[0],",",z[1]," l ",B[0],",",z[1]," l ",B[0],",",B[1]," l ",z[0],",",B[1]);break;case DE.Z:f.push(" x ")}if(i>0){f.push(n);for(var V=0;V100&&(tR=0,QE={});var i,n=eR.style;try{n.font=t,i=n.fontFamily.split(",")[0]}catch(t){}e={style:n.fontStyle||"normal",variant:n.fontVariant||"normal",weight:n.fontWeight||"normal",size:0|parseFloat(n.fontSize||12),family:i||"Microsoft YaHei"},QE[t]=e,tR++}return e};!function(t,e){bb[t]=e}("measureText",function(t,e){var i=AE;JE||((JE=i.createElement("div")).style.cssText="position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;",AE.body.appendChild(JE));try{JE.style.font=e}catch(t){}return JE.innerHTML="",JE.appendChild(i.createTextNode(t)),{width:JE.offsetWidth}});for(var nR=new de,oR=[Db,di,fi,Pn,rM],aR=0;aR=o&&u+1>=a){for(var h=[],c=0;c=o&&c+1>=a)return T_(0,s.components);l[i]=s}else l[i]=void 0}r++}();if(d)return d}},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=0;--n)if(e[n]===t)return!0;return!1}),i):null:i[0]},D_.prototype.update=function(t,e){if(t){var i=this.getDefs(!1);if(t[this._domName]&&i.contains(t[this._domName]))"function"==typeof e&&e(t);else{var n=this.add(t);n&&(t[this._domName]=n)}}},D_.prototype.addDom=function(t){this.getDefs(!0).appendChild(t)},D_.prototype.removeDom=function(t){var e=this.getDefs(!1);e&&t[this._domName]&&(e.removeChild(t[this._domName]),t[this._domName]=null)},D_.prototype.getDoms=function(){var t=this.getDefs(!1);if(!t)return[];var e=[];return d(this._tagNames,function(i){var n=t.getElementsByTagName(i);e=e.concat([].slice.call(n))}),e},D_.prototype.markAllUnused=function(){var t=this;d(this.getDoms(),function(e){e[t._markLabel]="0"})},D_.prototype.markUsed=function(t){t&&(t[this._markLabel]="1")},D_.prototype.removeUnused=function(){var t=this.getDefs(!1);if(t){var e=this;d(this.getDoms(),function(i){"1"!==i[e._markLabel]&&t.removeChild(i)})}},D_.prototype.getSvgProxy=function(t){return t instanceof Pn?yR:t instanceof fi?xR:t instanceof rM?_R:yR},D_.prototype.getTextSvgElement=function(t){return t.__textSvgEl},D_.prototype.getSvgElement=function(t){return t.__svgEl},u(C_,D_),C_.prototype.addWithoutUpdate=function(t,e){if(e&&e.style){var i=this;d(["fill","stroke"],function(n){if(e.style[n]&&("linear"===e.style[n].type||"radial"===e.style[n].type)){var o,a=e.style[n],r=i.getDefs(!0);a._dom?(o=a._dom,r.contains(a._dom)||i.addDom(o)):o=i.add(a),i.markUsed(e);var s=o.getAttribute("id");t.setAttribute(n,"url(#"+s+")")}})}},C_.prototype.add=function(t){var e;if("linear"===t.type)e=this.createElement("linearGradient");else{if("radial"!==t.type)return Yw("Illegal gradient type."),null;e=this.createElement("radialGradient")}return t.id=t.id||this.nextId++,e.setAttribute("id","zr"+this._zrId+"-gradient-"+t.id),this.updateDom(t,e),this.addDom(e),e},C_.prototype.update=function(t){var e=this;D_.prototype.update.call(this,t,function(){var i=t.type,n=t._dom.tagName;"linear"===i&&"linearGradient"===n||"radial"===i&&"radialGradient"===n?e.updateDom(t,t._dom):(e.removeDom(t),e.add(t))})},C_.prototype.updateDom=function(t,e){if("linear"===t.type)e.setAttribute("x1",t.x),e.setAttribute("y1",t.y),e.setAttribute("x2",t.x2),e.setAttribute("y2",t.y2);else{if("radial"!==t.type)return void Yw("Illegal gradient type.");e.setAttribute("cx",t.x),e.setAttribute("cy",t.y),e.setAttribute("r",t.r)}t.global?e.setAttribute("gradientUnits","userSpaceOnUse"):e.setAttribute("gradientUnits","objectBoundingBox"),e.innerHTML="";for(var i=t.colorStops,n=0,o=i.length;n0){var n,o,a=this.getDefs(!0),r=e[0],s=i?"_textDom":"_dom";r[s]?(o=r[s].getAttribute("id"),n=r[s],a.contains(n)||a.appendChild(n)):(o="zr"+this._zrId+"-clip-"+this.nextId,++this.nextId,(n=this.createElement("clipPath")).setAttribute("id",o),a.appendChild(n),r[s]=n);var l=this.getSvgProxy(r);if(r.transform&&r.parent.invTransform&&!i){var u=Array.prototype.slice.call(r.transform);bt(r.transform,r.parent.invTransform,r.transform),l.brush(r),r.transform=u}else l.brush(r);var h=this.getSvgElement(r);n.innerHTML="",n.appendChild(h.cloneNode()),t.setAttribute("clip-path","url(#"+o+")"),e.length>1&&this.updateDom(n,e.slice(1),i)}else t&&t.setAttribute("clip-path","none")},L_.prototype.markUsed=function(t){var e=this;t.__clipPaths&&t.__clipPaths.length>0&&d(t.__clipPaths,function(t){t._dom&&D_.prototype.markUsed.call(e,t._dom),t._textDom&&D_.prototype.markUsed.call(e,t._textDom)})},u(k_,D_),k_.prototype.addWithoutUpdate=function(t,e){if(e&&P_(e.style)){var i,n=e.style;n._shadowDom?(i=n._shadowDom,this.getDefs(!0).contains(n._shadowDom)||this.addDom(i)):i=this.add(e),this.markUsed(e);var o=i.getAttribute("id");t.style.filter="url(#"+o+")"}},k_.prototype.add=function(t){var e=this.createElement("filter"),i=t.style;return i._shadowDomId=i._shadowDomId||this.nextId++,e.setAttribute("id","zr"+this._zrId+"-shadow-"+i._shadowDomId),this.updateDom(t,e),this.addDom(e),e},k_.prototype.update=function(t,e){var i=e.style;if(P_(i)){var n=this;D_.prototype.update.call(this,e,function(t){n.updateDom(e,t._shadowDom)})}else this.remove(t,i)},k_.prototype.remove=function(t,e){null!=e._shadowDomId&&(this.removeDom(e),t.style.filter="")},k_.prototype.updateDom=function(t,e){var i=e.getElementsByTagName("feDropShadow");i=0===i.length?this.createElement("feDropShadow"):i[0];var n,o,a,r,s=t.style,l=t.scale?t.scale[0]||1:1,u=t.scale?t.scale[1]||1:1;if(s.shadowBlur||s.shadowOffsetX||s.shadowOffsetY)n=s.shadowOffsetX||0,o=s.shadowOffsetY||0,a=s.shadowBlur,r=s.shadowColor;else{if(!s.textShadowBlur)return void this.removeDom(e,s);n=s.textShadowOffsetX||0,o=s.textShadowOffsetY||0,a=s.textShadowBlur,r=s.textShadowColor}i.setAttribute("dx",n/l),i.setAttribute("dy",o/u),i.setAttribute("flood-color",r);var h=a/2/l+" "+a/2/u;i.setAttribute("stdDeviation",h),e.setAttribute("x","-100%"),e.setAttribute("y","-100%"),e.setAttribute("width",Math.ceil(a/2*200)+"%"),e.setAttribute("height",Math.ceil(a/2*200)+"%"),e.appendChild(i),s._shadowDom=e},k_.prototype.markUsed=function(t){var e=t.style;e&&e._shadowDom&&D_.prototype.markUsed.call(this,e._shadowDom)};var IR=function(t,e,i,n){this.root=t,this.storage=e,this._opts=i=a({},i||{});var o=p_("svg");o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("version","1.1"),o.setAttribute("baseProfile","full"),o.style.cssText="user-select:none;position:absolute;left:0;top:0;",this.gradientManager=new C_(n,o),this.clipPathManager=new L_(n,o),this.shadowManager=new k_(n,o);var r=document.createElement("div");r.style.cssText="overflow:hidden;position:relative",this._svgRoot=o,this._viewport=r,t.appendChild(r),r.appendChild(o),this.resize(i.width,i.height),this._visibleList=[]};IR.prototype={constructor:IR,getType:function(){return"svg"},getViewportRoot:function(){return this._viewport},getViewportRootOffset:function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},refresh:function(){var t=this.storage.getDisplayList(!0);this._paintList(t)},setBackgroundColor:function(t){this._viewport.style.background=t},_paintList:function(t){this.gradientManager.markAllUnused(),this.clipPathManager.markAllUnused(),this.shadowManager.markAllUnused();var e,i=this._svgRoot,n=this._visibleList,o=t.length,a=[];for(e=0;e=0;--n)if(e[n]===t)return!0;return!1}),i):null:i[0]},resize:function(t,e){var i=this._viewport;i.style.display="none";var n=this._opts;if(null!=t&&(n.width=t),null!=e&&(n.height=e),t=this._getSize(0),e=this._getSize(1),i.style.display="",this._width!==t||this._height!==e){this._width=t,this._height=e;var o=i.style;o.width=t+"px",o.height=e+"px";var a=this._svgRoot;a.setAttribute("width",t),a.setAttribute("height",e)}},getWidth:function(){return this._width},getHeight:function(){return this._height},_getSize:function(t){var e=this._opts,i=["width","height"][t],n=["clientWidth","clientHeight"][t],o=["paddingLeft","paddingTop"][t],a=["paddingRight","paddingBottom"][t];if(null!=e[i]&&"auto"!==e[i])return parseFloat(e[i]);var r=this.root,s=document.defaultView.getComputedStyle(r);return(r[n]||N_(s[i])||N_(r.style[i]))-(N_(s[o])||0)-(N_(s[a])||0)|0},dispose:function(){this.root.innerHTML="",this._svgRoot=this._viewport=this.storage=null},clear:function(){this._viewport&&this.root.removeChild(this._viewport)},pathToDataUrl:function(){return this.refresh(),"data:image/svg+xml;charset=UTF-8,"+this._svgRoot.outerHTML}},d(["getLayer","insertLayer","eachLayer","eachBuiltinLayer","eachOtherLayer","getLayers","modLayer","delLayer","clearLayer","toDataURL","pathToImage"],function(t){IR.prototype[t]=F_(t)}),Ti("svg",IR),t.version="4.2.1",t.dependencies=ET,t.PRIORITY=VT,t.init=function(t,e,i){var n=ks(t);if(n)return n;var o=new us(t,e,i);return o.id="ec_"+iA++,tA[o.id]=o,Fi(t,oA,o.id),Cs(o),o},t.connect=function(t){if(y(t)){var e=t;t=null,kT(e,function(e){null!=e.group&&(t=e.group)}),t=t||"g_"+nA++,kT(e,function(e){e.group=t})}return eA[t]=!0,t},t.disConnect=Ls,t.disconnect=aA,t.dispose=function(t){"string"==typeof t?t=tA[t]:t instanceof us||(t=ks(t)),t instanceof us&&!t.isDisposed()&&t.dispose()},t.getInstanceByDom=ks,t.getInstanceById=function(t){return tA[t]},t.registerTheme=Ps,t.registerPreprocessor=Ns,t.registerProcessor=Os,t.registerPostUpdate=function(t){KT.push(t)},t.registerAction=Es,t.registerCoordinateSystem=Rs,t.getCoordinateSystemDimensions=function(t){var e=Fa.get(t);if(e)return e.getDimensionsInfo?e.getDimensionsInfo():e.dimensions.slice()},t.registerLayout=zs,t.registerVisual=Bs,t.registerLoading=Gs,t.extendComponentModel=Fs,t.extendComponentView=Ws,t.extendSeriesModel=Hs,t.extendChartView=Zs,t.setCanvasCreator=function(t){e("createCanvas",t)},t.registerMap=function(t,e,i){DT.registerMap(t,e,i)},t.getMap=function(t){var e=DT.retrieveMap(t);return e&&e[0]&&{geoJson:e[0].geoJSON,specialAreas:e[0].specialAreas}},t.dataTool=rA,t.zrender=Hb,t.number=YM,t.format=eI,t.throttle=Pr,t.helper=tD,t.matrix=Sw,t.vector=cw,t.color=Ww,t.parseGeoJSON=iD,t.parseGeoJson=rD,t.util=sD,t.graphic=lD,t.List=vA,t.Model=No,t.Axis=aD,t.env=U_}); \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-badge/changelog.md b/sport-erp-admin/uni_modules/uni-badge/changelog.md deleted file mode 100644 index e352c60..0000000 --- a/sport-erp-admin/uni_modules/uni-badge/changelog.md +++ /dev/null @@ -1,33 +0,0 @@ -## 1.2.2(2023-01-28) -- 修复 运行/打包 控制台警告问题 -## 1.2.1(2022-09-05) -- 修复 当 text 超过 max-num 时,badge 的宽度计算是根据 text 的长度计算,更改为 css 计算实际展示宽度,详见:[https://ask.dcloud.net.cn/question/150473](https://ask.dcloud.net.cn/question/150473) -## 1.2.0(2021-11-19) -- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) -- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-badge](https://uniapp.dcloud.io/component/uniui/uni-badge) -## 1.1.7(2021-11-08) -- 优化 升级ui -- 修改 size 属性默认值调整为 small -- 修改 type 属性,默认值调整为 error,info 替换 default -## 1.1.6(2021-09-22) -- 修复 在字节小程序上样式不生效的 bug -## 1.1.5(2021-07-30) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 1.1.4(2021-07-29) -- 修复 去掉 nvue 不支持css 的 align-self 属性,nvue 下不暂支持 absolute 属性 -## 1.1.3(2021-06-24) -- 优化 示例项目 -## 1.1.1(2021-05-12) -- 新增 组件示例地址 -## 1.1.0(2021-05-12) -- 新增 uni-badge 的 absolute 属性,支持定位 -- 新增 uni-badge 的 offset 属性,支持定位偏移 -- 新增 uni-badge 的 is-dot 属性,支持仅显示有一个小点 -- 新增 uni-badge 的 max-num 属性,支持自定义封顶的数字值,超过 99 显示99+ -- 优化 uni-badge 属性 custom-style, 支持以对象形式自定义样式 -## 1.0.7(2021-05-07) -- 修复 uni-badge 在 App 端,数字小于10时不是圆形的bug -- 修复 uni-badge 在父元素不是 flex 布局时,宽度缩小的bug -- 新增 uni-badge 属性 custom-style, 支持自定义样式 -## 1.0.6(2021-02-04) -- 调整为uni_modules目录规范 diff --git a/sport-erp-admin/uni_modules/uni-badge/components/uni-badge/uni-badge.vue b/sport-erp-admin/uni_modules/uni-badge/components/uni-badge/uni-badge.vue deleted file mode 100644 index 956354b..0000000 --- a/sport-erp-admin/uni_modules/uni-badge/components/uni-badge/uni-badge.vue +++ /dev/null @@ -1,268 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-badge/package.json b/sport-erp-admin/uni_modules/uni-badge/package.json deleted file mode 100644 index b0bac93..0000000 --- a/sport-erp-admin/uni_modules/uni-badge/package.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "id": "uni-badge", - "displayName": "uni-badge 数字角标", - "version": "1.2.2", - "description": "数字角标(徽章)组件,在元素周围展示消息提醒,一般用于列表、九宫格、按钮等地方。", - "keywords": [ - "", - "badge", - "uni-ui", - "uniui", - "数字角标", - "徽章" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, -"dcloudext": { - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", - "type": "component-vue" - }, - "uni_modules": { - "dependencies": ["uni-scss"], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "y" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y" - }, - "快应用": { - "华为": "y", - "联盟": "y" - }, - "Vue": { - "vue2": "y", - "vue3": "y" - } - } - } - } -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-badge/readme.md b/sport-erp-admin/uni_modules/uni-badge/readme.md deleted file mode 100644 index bdf175d..0000000 --- a/sport-erp-admin/uni_modules/uni-badge/readme.md +++ /dev/null @@ -1,10 +0,0 @@ -## Badge 数字角标 -> **组件名:uni-badge** -> 代码块: `uBadge` - -数字角标一般和其它控件(列表、9宫格等)配合使用,用于进行数量提示,默认为实心灰色背景, - -### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-badge) -#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 - - diff --git a/sport-erp-admin/uni_modules/uni-breadcrumb/changelog.md b/sport-erp-admin/uni_modules/uni-breadcrumb/changelog.md deleted file mode 100644 index 016e6ce..0000000 --- a/sport-erp-admin/uni_modules/uni-breadcrumb/changelog.md +++ /dev/null @@ -1,6 +0,0 @@ -## 0.1.2(2022-06-08) -- 修复 微信小程序 separator 不显示问题 -## 0.1.1(2022-06-02) -- 新增 支持 uni.scss 修改颜色 -## 0.1.0(2022-04-21) -- 初始化 diff --git a/sport-erp-admin/uni_modules/uni-breadcrumb/components/uni-breadcrumb-item/uni-breadcrumb-item.vue b/sport-erp-admin/uni_modules/uni-breadcrumb/components/uni-breadcrumb-item/uni-breadcrumb-item.vue deleted file mode 100644 index d8fba84..0000000 --- a/sport-erp-admin/uni_modules/uni-breadcrumb/components/uni-breadcrumb-item/uni-breadcrumb-item.vue +++ /dev/null @@ -1,121 +0,0 @@ - - - diff --git a/sport-erp-admin/uni_modules/uni-breadcrumb/components/uni-breadcrumb/uni-breadcrumb.vue b/sport-erp-admin/uni_modules/uni-breadcrumb/components/uni-breadcrumb/uni-breadcrumb.vue deleted file mode 100644 index 94493a2..0000000 --- a/sport-erp-admin/uni_modules/uni-breadcrumb/components/uni-breadcrumb/uni-breadcrumb.vue +++ /dev/null @@ -1,41 +0,0 @@ - - - diff --git a/sport-erp-admin/uni_modules/uni-breadcrumb/package.json b/sport-erp-admin/uni_modules/uni-breadcrumb/package.json deleted file mode 100644 index e5f33e8..0000000 --- a/sport-erp-admin/uni_modules/uni-breadcrumb/package.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "id": "uni-breadcrumb", - "displayName": "uni-breadcrumb 面包屑", - "version": "0.1.2", - "description": "Breadcrumb 面包屑", - "keywords": [ - "uni-breadcrumb", - "breadcrumb", - "uni-ui", - "面包屑导航", - "面包屑" -], - "repository": "", - "engines": { - "HBuilderX": "^3.1.0" - }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ], - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "" - }, - "uni_modules": { - "dependencies": [], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y" - }, - "client": { - "Vue": { - "vue2": "y", - "vue3": "y" - }, - "App": { - "app-vue": "y", - "app-nvue": "n" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "u", - "百度": "u", - "字节跳动": "u", - "QQ": "u", - "京东": "u" - }, - "快应用": { - "华为": "u", - "联盟": "u" - } - } - } - } -} diff --git a/sport-erp-admin/uni_modules/uni-breadcrumb/readme.md b/sport-erp-admin/uni_modules/uni-breadcrumb/readme.md deleted file mode 100644 index 6976b8d..0000000 --- a/sport-erp-admin/uni_modules/uni-breadcrumb/readme.md +++ /dev/null @@ -1,66 +0,0 @@ - -## breadcrumb 面包屑导航 -> **组件名:uni-breadcrumb** -> 代码块: `ubreadcrumb` - -显示当前页面的路径,快速返回之前的任意页面。 - -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -### 基本用法 - -在 ``template`` 中使用组件 - -```html - - {{route.name}} - -``` - -```js -export default { - name: "uni-stat-breadcrumb", - data() { - return { - routes: [{ - to: '/A', - name: 'A页面' - }, { - to: '/B', - name: 'B页面' - }, { - to: '/C', - name: 'C页面' - }] - }; - } - } -``` - - -## API - -### Breadcrumb Props - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|separator |String |斜杠'/' |分隔符 | -|separatorClass |String | |图标分隔符 class | - -### Breadcrumb Item Props - -|属性名 |类型 |默认值 |说明 | -|:-: |:-: |:-: |:-: | -|to |String | |路由跳转页面路径 | -|replace|Boolean | |在使用 to 进行路由跳转时,启用 replace 将不会向 history 添加新记录(仅 h5 支持) | - - - - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/breadcrumb/breadcrumb](https://hellouniapp.dcloud.net.cn/pages/extUI/breadcrumb/breadcrumb) \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-captcha/changelog.md b/sport-erp-admin/uni_modules/uni-captcha/changelog.md deleted file mode 100644 index af26e0f..0000000 --- a/sport-erp-admin/uni_modules/uni-captcha/changelog.md +++ /dev/null @@ -1,49 +0,0 @@ -## 0.7.5(2023-12-18) -- 修复 在uni-app x项目,部分情况下,执行uni-captcha组件的setFocus无效的问题 -## 0.7.4(2023-12-18) -- 更新 `package.json` -> `dependencies` 增加 `uni-popup` -## 0.7.3(2023-11-15) -- 更新 uni-popup-captcha.uvue依赖的popup组件,直接使用uni_modules下的uni-popup组件 -## 0.7.2(2023-11-07) -- 新增 前端组件:uni-captcha.uvue、uni-popup-captcha -## 0.7.1(2023-11-07) -- 新增 前端组件:uni-captcha.uvue、uni-popup-captcha -## 0.7.0(2023-10-10) -- 新增 支持在`uni-config-center`中配置mode,可选值为svg和bmp,配置成bmp后可以在uniappx的uvue页面正常显示验证码(uvue不支持显示svg验证码) -## 0.6.4(2023-01-16) -- 修复 部分情况下APP端无法获取验证码的问题 -## 0.6.3(2023-01-11) -- 修复 抖音小程序无法显示的Bug -- 修复 刷新时兼容 device_uuid -## 0.6.1(2022-06-23) -- 修复:部分返回值,不符合响应体规范的问题 -## 0.6.0(2022-05-27) -- 新增:支持在`uni-config-center`中根据场景值配置 -- 修复:弹窗式验证码,输入内容后点击取消,重新打开验证码的值仍然存在的问题 -## 0.5.2(2022-05-19) -- 修复在Vue3的兼容问题 -## 0.5.1(2022-05-18) -- 修复在某些情况下微信小程序端验证码显示错误的问题 -## 0.5.0(2022-05-17) -- 新增支持在`uni-captcha-co`->`config`配置验证码 -## 0.4.1(2022-05-16) -- 新增示例项目 -## 0.4.0(2022-05-16) -- 集成创建、刷新、显示验证码的云端一体验证码组件 -- 云对象`uni-captcha-co`集成获取验证码的api,`getImageCaptcha` -## 0.3.1(2022-05-13) -- 新增 返回值符合响应体规范 -## 0.3.0(2022-05-13) -- 新增 支持 uni-config-center 配置 -## 0.2.2(2022-04-25) -- 修复 0.2.1 版本引起的使用 image 组件验证码不显示的Bug -## 0.2.1(2022-04-18) -- 更新 优化字体 -## 0.2.0(2022-04-14) -- 新增 使用 svg 表现形式更好 -- 新增 使用字体,可以任意替换默认字体 -- 新增 支持设置字体大小 -- 新增 支持忽略某些字符 -- 注意 更新之后请重新上传公共模块 -## 0.1.0(2021-03-01) -- 调整为uni_modules目录规范 diff --git a/sport-erp-admin/uni_modules/uni-captcha/components/uni-captcha/uni-captcha.uvue b/sport-erp-admin/uni_modules/uni-captcha/components/uni-captcha/uni-captcha.uvue deleted file mode 100644 index 62ef42a..0000000 --- a/sport-erp-admin/uni_modules/uni-captcha/components/uni-captcha/uni-captcha.uvue +++ /dev/null @@ -1,180 +0,0 @@ - - - - - \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-captcha/components/uni-captcha/uni-captcha.vue b/sport-erp-admin/uni_modules/uni-captcha/components/uni-captcha/uni-captcha.vue deleted file mode 100644 index 3d33343..0000000 --- a/sport-erp-admin/uni_modules/uni-captcha/components/uni-captcha/uni-captcha.vue +++ /dev/null @@ -1,167 +0,0 @@ - - - - - \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-captcha/components/uni-popup-captcha/uni-popup-captcha.uvue b/sport-erp-admin/uni_modules/uni-captcha/components/uni-popup-captcha/uni-popup-captcha.uvue deleted file mode 100644 index d26537c..0000000 --- a/sport-erp-admin/uni_modules/uni-captcha/components/uni-popup-captcha/uni-popup-captcha.uvue +++ /dev/null @@ -1,130 +0,0 @@ - - - - - \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-captcha/components/uni-popup-captcha/uni-popup-captcha.vue b/sport-erp-admin/uni_modules/uni-captcha/components/uni-popup-captcha/uni-popup-captcha.vue deleted file mode 100644 index b89b003..0000000 --- a/sport-erp-admin/uni_modules/uni-captcha/components/uni-popup-captcha/uni-popup-captcha.vue +++ /dev/null @@ -1,140 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-captcha/package.json b/sport-erp-admin/uni_modules/uni-captcha/package.json deleted file mode 100644 index 0e83356..0000000 --- a/sport-erp-admin/uni_modules/uni-captcha/package.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "id": "uni-captcha", - "displayName": "uni-captcha", - "version": "0.7.5", - "description": "云端一体图形验证码组件", - "keywords": [ - "captcha", - "图形验证码", - "人机验证", - "防刷", - "防脚本" -], - "repository": "https://gitee.com/dcloud/uni-captcha", - "engines": { - "HBuilderX": "^3.1.0" - }, - "dcloudext": { - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "", - "type": "unicloud-template-function" - }, - "uni_modules": { - "dependencies": [ - "uni-popup" - ], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y" - }, - "client": { - "App": { - "app-vue": "u", - "app-nvue": "u" - }, - "H5-mobile": { - "Safari": "u", - "Android Browser": "u", - "微信浏览器(Android)": "u", - "QQ浏览器(Android)": "u" - }, - "H5-pc": { - "Chrome": "u", - "IE": "u", - "Edge": "u", - "Firefox": "u", - "Safari": "u" - }, - "小程序": { - "微信": "u", - "阿里": "u", - "百度": "u", - "字节跳动": "u", - "QQ": "u" - }, - "快应用": { - "华为": "u", - "联盟": "u" - }, - "Vue": { - "vue2": "y", - "vue3": "u" - } - } - } - } -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-captcha/readme.md b/sport-erp-admin/uni_modules/uni-captcha/readme.md deleted file mode 100644 index d929f63..0000000 --- a/sport-erp-admin/uni_modules/uni-captcha/readme.md +++ /dev/null @@ -1,3 +0,0 @@ -

-文档已移至 uni-captcha文档 -

\ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-captcha/static/run.gif b/sport-erp-admin/uni_modules/uni-captcha/static/run.gif deleted file mode 100644 index 6d164f2..0000000 Binary files a/sport-erp-admin/uni_modules/uni-captcha/static/run.gif and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/LICENSE.md b/sport-erp-admin/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/LICENSE.md deleted file mode 100644 index 261eeb9..0000000 --- a/sport-erp-admin/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed 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. diff --git a/sport-erp-admin/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/fonts/font.ttf b/sport-erp-admin/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/fonts/font.ttf deleted file mode 100644 index a60ce88..0000000 Binary files a/sport-erp-admin/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/fonts/font.ttf and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/index.js b/sport-erp-admin/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/index.js deleted file mode 100644 index 8ad32e0..0000000 --- a/sport-erp-admin/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/index.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e=require("assert"),t=require("path");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(e),r=n(t);const s={10001:"uni-captcha-create-fail",10002:"uni-captcha-verify-fail",10003:"uni-captcha-refresh-fail",10101:"uni-captcha-deviceId-required",10102:"uni-captcha-text-required",10103:"uni-captcha-verify-overdue",10104:"uni-captcha-verify-fail",50403:"uni-captcha-interior-fail"};function a(e){const t=.2*Math.random()-.1;switch(e.type){case"M":case"L":e.x+=t,e.y+=t;break;case"Q":case"C":e.x+=t,e.y+=t,e.x1+=t,e.y1+=t}return e}function i(e,t,n,o,r,s,a){let i,l,c,u,p,h;if(e<=0||e>=1)throw RangeError("spliteCurveAt requires position > 0 && position < 1");return u=[],p=0,i={},l={},c={},i.x=t,i.y=n,l.x=o,l.y=r,c.x=s,c.y=a,h=e,u[p++]=i.x,u[p++]=i.y,u[p++]=i.x+=(l.x-i.x)*h,u[p++]=i.y+=(l.y-i.y)*h,l.x+=(c.x-l.x)*h,l.y+=(c.y-l.y)*h,u[p++]=i.x+(l.x-i.x)*h,u[p++]=i.y+(l.y-i.y)*h,u[p++]=l.x,u[p++]=l.y,u[p++]=c.x,u[p++]=c.y,u}function l(e,t){return Math.random()*(t-e)+e}var c=function(e,t){const n=e[0];o.default(n,"expect a string");const r=t.fontSize,s=r/t.font.unitsPerEm,c=t.font.charToGlyph(n),u=c.advanceWidth?c.advanceWidth*s:0,p=t.x-u/2,h=(t.ascender+t.descender)*s,f=t.y+h/2,d=c.getPath(p,f,r);d.commands.forEach(a),d.commands=function(e,t){const n=[];for(let o=0;ot.truncateLineProbability){const e=l(-.1,.1);n.push(r),n.push({type:"L",x:(r.x+s.x)/2+e,y:(r.y+s.y)/2+e})}else n.push(r)}else if("Q"===r.type&&o>=1){const s=e[o-1];if(("L"===s.type||"M"===s.type)&&Math.random()>t.truncateCurveProbability){const e=s.x,o=s.y,a=l(-.1,.1),c=r.x1+a,u=r.y1+a,p=r.x+a,h=r.y+a,f=i(l(t.truncateCurvePositionMin,t.truncateCurvePositionMax),e,o,c,u,p,h),d={type:"Q",x1:f[2],y1:f[3],x:f[4],y:f[5]},g={type:"L",x:f[4],y:f[5]},m={type:"Q",x1:f[6],y1:f[7],x:f[8],y:f[9]},y={type:"L",x:f[8],y:f[9]};n.push(d),n.push(g),n.push(m),n.push(y)}}else n.push(r)}return n}(d.commands,t);return d.toPathData()};function u(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function p(e,t){this.source=e,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=t,this.destLen=0,this.ltree=new u,this.dtree=new u}var h=new u,f=new u,d=new Uint8Array(30),g=new Uint16Array(30),m=new Uint8Array(30),y=new Uint16Array(30),v=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),b=new u,x=new Uint8Array(320);function S(e,t,n,o){var r,s;for(r=0;r>>=1,t}function E(e,t,n){if(!t)return n;for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>16-t;return e.tag>>>=t,e.bitcount-=t,o+n}function O(e,t){for(;e.bitcount<24;)e.tag|=e.source[e.sourceIndex++]<>>=1,++r,n+=t.table[r],o-=t.table[r]}while(o>=0);return e.tag=s,e.bitcount-=r,t.trans[n+o]}function L(e,t,n){var o,r,s,a,i,l;for(o=E(e,5,257),r=E(e,5,1),s=E(e,4,4),a=0;a<19;++a)x[a]=0;for(a=0;a8;)e.sourceIndex--,e.bitcount-=8;if((t=256*(t=e.source[e.sourceIndex+1])+e.source[e.sourceIndex])!==(65535&~(256*e.source[e.sourceIndex+3]+e.source[e.sourceIndex+2])))return-3;for(e.sourceIndex+=4,n=t;n;--n)e.dest[e.destLen++]=e.source[e.sourceIndex++];return e.bitcount=0,0}!function(e,t){var n;for(n=0;n<7;++n)e.table[n]=0;for(e.table[7]=24,e.table[8]=152,e.table[9]=112,n=0;n<24;++n)e.trans[n]=256+n;for(n=0;n<144;++n)e.trans[24+n]=n;for(n=0;n<8;++n)e.trans[168+n]=280+n;for(n=0;n<112;++n)e.trans[176+n]=144+n;for(n=0;n<5;++n)t.table[n]=0;for(t.table[5]=32,n=0;n<32;++n)t.trans[n]=n}(h,f),S(d,g,4,3),S(m,y,2,1),d[28]=0,g[28]=258;var D=function(e,t){var n,o,r=new p(e,t);do{switch(n=w(r),E(r,2,0)){case 0:o=R(r);break;case 1:o=k(r,h,f);break;case 2:L(r,r.ltree,r.dtree),o=k(r,r.ltree,r.dtree);break;default:o=-3}if(0!==o)throw new Error("Data error")}while(!n);return r.destLenthis.x2&&(this.x2=e)),"number"==typeof t&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),tthis.y2&&(this.y2=t))},M.prototype.addX=function(e){this.addPoint(e,null)},M.prototype.addY=function(e){this.addPoint(null,e)},M.prototype.addBezier=function(e,t,n,o,r,s,a,i){const l=[e,t],c=[n,o],u=[r,s],p=[a,i];this.addPoint(e,t),this.addPoint(a,i);for(let e=0;e<=1;e++){const t=6*l[e]-12*c[e]+6*u[e],n=-3*l[e]+9*c[e]-9*u[e]+3*p[e],o=3*c[e]-3*l[e];if(0===n){if(0===t)continue;const n=-o/t;0=0&&n>0&&(e+=" "),e+=t(o)}return e}e=void 0!==e?e:2;let o="";for(let e=0;e=0&&e<=255,"Byte value should be between 0 and 255."),[e]},F.BYTE=H(1),A.CHAR=function(e){return[e.charCodeAt(0)]},F.CHAR=H(1),A.CHARARRAY=function(e){const t=[];for(let n=0;n>8&255,255&e]},F.USHORT=H(2),A.SHORT=function(e){return e>=32768&&(e=-(65536-e)),[e>>8&255,255&e]},F.SHORT=H(2),A.UINT24=function(e){return[e>>16&255,e>>8&255,255&e]},F.UINT24=H(3),A.ULONG=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},F.ULONG=H(4),A.LONG=function(e){return e>=2147483648&&(e=-(4294967296-e)),[e>>24&255,e>>16&255,e>>8&255,255&e]},F.LONG=H(4),A.FIXED=A.ULONG,F.FIXED=F.ULONG,A.FWORD=A.SHORT,F.FWORD=F.SHORT,A.UFWORD=A.USHORT,F.UFWORD=F.USHORT,A.LONGDATETIME=function(e){return[0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e]},F.LONGDATETIME=H(8),A.TAG=function(e){return G.argument(4===e.length,"Tag should be exactly 4 ASCII characters."),[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]},F.TAG=H(4),A.Card8=A.BYTE,F.Card8=F.BYTE,A.Card16=A.USHORT,F.Card16=F.USHORT,A.OffSize=A.BYTE,F.OffSize=F.BYTE,A.SID=A.USHORT,F.SID=F.USHORT,A.NUMBER=function(e){return e>=-107&&e<=107?[e+139]:e>=108&&e<=1131?[247+((e-=108)>>8),255&e]:e>=-1131&&e<=-108?[251+((e=-e-108)>>8),255&e]:e>=-32768&&e<=32767?A.NUMBER16(e):A.NUMBER32(e)},F.NUMBER=function(e){return A.NUMBER(e).length},A.NUMBER16=function(e){return[28,e>>8&255,255&e]},F.NUMBER16=H(3),A.NUMBER32=function(e){return[29,e>>24&255,e>>16&255,e>>8&255,255&e]},F.NUMBER32=H(5),A.REAL=function(e){let t=e.toString();const n=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(n){const o=parseFloat("1e"+((n[2]?+n[2]:0)+n[1].length));t=(Math.round(e*o)/o).toString()}let o="";for(let e=0,n=t.length;e>8&255,t[t.length]=255&o}return t},F.UTF16=function(e){return 2*e.length};const z={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};P.MACSTRING=function(e,t,n,o){const r=z[o];if(void 0===r)return;let s="";for(let o=0;o=-128&&e<=127}function X(e,t,n){let o=0;const r=e.length;for(;t>8&255,t+256&255)}return s}A.MACSTRING=function(e,t){const n=function(e){if(!_){_={};for(let e in z)_[e]=new String(e)}const t=_[e];if(void 0===t)return;if(W){const e=W.get(t);if(void 0!==e)return e}const n=z[e];if(void 0===n)return;const o={};for(let e=0;e=128&&(r=n[r],void 0===r))return;o[t]=r}return o},F.MACSTRING=function(e,t){const n=A.MACSTRING(e,t);return void 0!==n?n.length:0},A.VARDELTAS=function(e){let t=0;const n=[];for(;t=-128&&o<=127?V(e,t,n):j(e,t,n)}return n},A.INDEX=function(e){let t=1;const n=[t],o=[];for(let r=0;r>8,t[s+1]=255&a,t=t.concat(o[n])}return t},F.TABLE=function(e){let t=0;const n=e.fields.length;for(let o=0;o0)return new ce(this.data,this.offset+t).parseStruct(e)},ce.prototype.parseListOfLists=function(e){const t=this.parseOffset16List(),n=t.length,o=this.relativeOffset,r=new Array(n);for(let o=0;o=0;r-=1){const n=pe.getUShort(e,t+4+8*r),s=pe.getUShort(e,t+4+8*r+2);if(3===n&&(0===s||1===s||10===s)){o=pe.getULong(e,t+4+8*r+4);break}}if(-1===o)throw new Error("No valid cmap sub-tables found.");const r=new pe.Parser(e,t+o);if(n.format=r.parseUShort(),12===n.format)!function(e,t){let n;t.parseUShort(),e.length=t.parseULong(),e.language=t.parseULong(),e.groupCount=n=t.parseULong(),e.glyphIndexMap={};for(let o=0;o>1,t.skip("uShort",3),e.glyphIndexMap={};const a=new pe.Parser(n,o+r+14),i=new pe.Parser(n,o+r+16+2*s),l=new pe.Parser(n,o+r+16+4*s),c=new pe.Parser(n,o+r+16+6*s);let u=o+r+16+8*s;for(let t=0;t0?(s=e.parseByte(),0==(t&r)&&(s=-s),s=n+s):s=(t&r)>0?n:n+e.parseShort(),s}function we(e,t,n){const o=new pe.Parser(t,n);let r,s;if(e.numberOfContours=o.parseShort(),e._xMin=o.parseShort(),e._yMin=o.parseShort(),e._xMax=o.parseShort(),e._yMax=o.parseShort(),e.numberOfContours>0){const t=e.endPointIndices=[];for(let n=0;n0){const t=o.parseByte();for(let n=0;n0){const a=[];let i;if(n>0){for(let e=0;e=0,a.push(i);let e=0;for(let t=0;t0?(2&r)>0?(n.dx=o.parseShort(),n.dy=o.parseShort()):n.matchedPoints=[o.parseUShort(),o.parseUShort()]:(2&r)>0?(n.dx=o.parseChar(),n.dy=o.parseChar()):n.matchedPoints=[o.parseByte(),o.parseByte()],(8&r)>0?n.xScale=n.yScale=o.parseF2Dot14():(64&r)>0?(n.xScale=o.parseF2Dot14(),n.yScale=o.parseF2Dot14()):(128&r)>0&&(n.xScale=o.parseF2Dot14(),n.scale01=o.parseF2Dot14(),n.scale10=o.parseF2Dot14(),n.yScale=o.parseF2Dot14()),e.components.push(n),t=!!(32&r)}if(256&r){e.instructionLength=o.parseUShort(),e.instructions=[];for(let t=0;tt.points.length-1||o.matchedPoints[1]>r.points.length-1)throw Error("Matched points out of range in "+t.name);const n=t.points[o.matchedPoints[0]];let s=r.points[o.matchedPoints[1]];const a={xScale:o.xScale,scale01:o.scale01,scale10:o.scale10,yScale:o.yScale,dx:0,dy:0};s=Ee([s],a)[0],a.dx=n.x-s.x,a.dy=n.y-s.y,e=Ee(r.points,a)}t.points=t.points.concat(e)}}return Oe(t.points)}var ke={getPath:Oe,parse:function(e,t,n,o){const r=new Me.GlyphSet(o);for(let s=0;s>4,s=15&o;if(15===r)break;if(t+=n[r],15===s)break;t+=n[s]}return parseFloat(t)}(e);if(t>=32&&t<=246)return t-139;if(t>=247&&t<=250)return n=e.parseByte(),256*(t-247)+n+108;if(t>=251&&t<=254)return n=e.parseByte(),256*-(t-251)-n-108;throw new Error("Invalid b0 "+t)}function Pe(e,t,n){t=void 0!==t?t:0;const o=new pe.Parser(e,t),r=[];let s=[];for(n=void 0!==n?n:e.length;o.relativeOffset>1,l.length=0,d=!0}return function n(p){let S,U,T,w,E,O,L,k,R,D,C,M,I=0;for(;I1&&!d&&(v=l.shift()+h,d=!0),y+=l.pop(),b(m,y);break;case 5:for(;l.length>0;)m+=l.shift(),y+=l.shift(),i.lineTo(m,y);break;case 6:for(;l.length>0&&(m+=l.shift(),i.lineTo(m,y),0!==l.length);)y+=l.shift(),i.lineTo(m,y);break;case 7:for(;l.length>0&&(y+=l.shift(),i.lineTo(m,y),0!==l.length);)m+=l.shift(),i.lineTo(m,y);break;case 8:for(;l.length>0;)o=m+l.shift(),r=y+l.shift(),s=o+l.shift(),a=r+l.shift(),m=s+l.shift(),y=a+l.shift(),i.curveTo(o,r,s,a,m,y);break;case 10:E=l.pop()+u,O=c[E],O&&n(O);break;case 11:return;case 12:switch(B=p[I],I+=1,B){case 35:o=m+l.shift(),r=y+l.shift(),s=o+l.shift(),a=r+l.shift(),L=s+l.shift(),k=a+l.shift(),R=L+l.shift(),D=k+l.shift(),C=R+l.shift(),M=D+l.shift(),m=C+l.shift(),y=M+l.shift(),l.shift(),i.curveTo(o,r,s,a,L,k),i.curveTo(R,D,C,M,m,y);break;case 34:o=m+l.shift(),r=y,s=o+l.shift(),a=r+l.shift(),L=s+l.shift(),k=a,R=L+l.shift(),D=a,C=R+l.shift(),M=y,m=C+l.shift(),i.curveTo(o,r,s,a,L,k),i.curveTo(R,D,C,M,m,y);break;case 36:o=m+l.shift(),r=y+l.shift(),s=o+l.shift(),a=r+l.shift(),L=s+l.shift(),k=a,R=L+l.shift(),D=a,C=R+l.shift(),M=D+l.shift(),m=C+l.shift(),i.curveTo(o,r,s,a,L,k),i.curveTo(R,D,C,M,m,y);break;case 37:o=m+l.shift(),r=y+l.shift(),s=o+l.shift(),a=r+l.shift(),L=s+l.shift(),k=a+l.shift(),R=L+l.shift(),D=k+l.shift(),C=R+l.shift(),M=D+l.shift(),Math.abs(C-m)>Math.abs(M-y)?m=C+l.shift():y=M+l.shift(),i.curveTo(o,r,s,a,L,k),i.curveTo(R,D,C,M,m,y);break;default:console.log("Glyph "+t.index+": unknown operator 1200"+B),l.length=0}break;case 14:l.length>0&&!d&&(v=l.shift()+h,d=!0),g&&(i.closePath(),g=!1);break;case 18:x();break;case 19:case 20:x(),I+=f+7>>3;break;case 21:l.length>2&&!d&&(v=l.shift()+h,d=!0),y+=l.pop(),m+=l.pop(),b(m,y);break;case 22:l.length>1&&!d&&(v=l.shift()+h,d=!0),m+=l.pop(),b(m,y);break;case 23:x();break;case 24:for(;l.length>2;)o=m+l.shift(),r=y+l.shift(),s=o+l.shift(),a=r+l.shift(),m=s+l.shift(),y=a+l.shift(),i.curveTo(o,r,s,a,m,y);m+=l.shift(),y+=l.shift(),i.lineTo(m,y);break;case 25:for(;l.length>6;)m+=l.shift(),y+=l.shift(),i.lineTo(m,y);o=m+l.shift(),r=y+l.shift(),s=o+l.shift(),a=r+l.shift(),m=s+l.shift(),y=a+l.shift(),i.curveTo(o,r,s,a,m,y);break;case 26:for(l.length%2&&(m+=l.shift());l.length>0;)o=m,r=y+l.shift(),s=o+l.shift(),a=r+l.shift(),m=s,y=a+l.shift(),i.curveTo(o,r,s,a,m,y);break;case 27:for(l.length%2&&(y+=l.shift());l.length>0;)o=m+l.shift(),r=y,s=o+l.shift(),a=r+l.shift(),m=s+l.shift(),y=a,i.curveTo(o,r,s,a,m,y);break;case 28:S=p[I],U=p[I+1],l.push((S<<24|U<<16)>>16),I+=2;break;case 29:E=l.pop()+e.gsubrsBias,O=e.gsubrs[E],O&&n(O);break;case 30:for(;l.length>0&&(o=m,r=y+l.shift(),s=o+l.shift(),a=r+l.shift(),m=s+l.shift(),y=a+(1===l.length?l.shift():0),i.curveTo(o,r,s,a,m,y),0!==l.length);)o=m+l.shift(),r=y,s=o+l.shift(),a=r+l.shift(),y=a+l.shift(),m=s+(1===l.length?l.shift():0),i.curveTo(o,r,s,a,m,y);break;case 31:for(;l.length>0&&(o=m+l.shift(),r=y,s=o+l.shift(),a=r+l.shift(),y=a+l.shift(),m=s+(1===l.length?l.shift():0),i.curveTo(o,r,s,a,m,y),0!==l.length);)o=m,r=y+l.shift(),s=o+l.shift(),a=r+l.shift(),m=s+l.shift(),y=a+(1===l.length?l.shift():0),i.curveTo(o,r,s,a,m,y);break;default:B<32?console.log("Glyph "+t.index+": unknown operator "+B):B<247?l.push(B-139):B<251?(S=p[I],I+=1,l.push(256*(B-247)+S+108)):B<255?(S=p[I],I+=1,l.push(256*-(B-251)-S-108)):(S=p[I],U=p[I+1],T=p[I+2],w=p[I+3],I+=4,l.push((S<<24|U<<16|T<<8|w)/65536))}}}(n),t.advanceWidth=v,i}function Ve(e,t){let n,o=de.indexOf(e);return o>=0&&(n=o),o=t.indexOf(e),o>=0?n=o+de.length:(n=de.length+t.length,t.push(e)),n}function je(e,t,n){const o={};for(let r=0;r=o)throw new Error("CFF table CID Font FDSelect has bad FD index value "+s+" (FD count "+o+")");r.push(s)}else{if(3!==i)throw new Error("CFF Table CID Font FDSelect table has unsupported format "+i);{const e=a.parseCard16();let t,i=a.parseCard16();if(0!==i)throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID "+i);for(let l=0;l=o)throw new Error("CFF table CID Font FDSelect has bad FD index value "+s+" (FD count "+o+")");if(t>n)throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID "+t);for(;i=1&&(n.ulCodePageRange1=o.parseULong(),n.ulCodePageRange2=o.parseULong()),n.version>=2&&(n.sxHeight=o.parseShort(),n.sCapHeight=o.parseShort(),n.usDefaultChar=o.parseUShort(),n.usBreakChar=o.parseUShort(),n.usMaxContent=o.parseUShort()),n},make:function(e){return new oe.Table("OS/2",[{name:"version",type:"USHORT",value:3},{name:"xAvgCharWidth",type:"SHORT",value:0},{name:"usWeightClass",type:"USHORT",value:0},{name:"usWidthClass",type:"USHORT",value:0},{name:"fsType",type:"USHORT",value:0},{name:"ySubscriptXSize",type:"SHORT",value:650},{name:"ySubscriptYSize",type:"SHORT",value:699},{name:"ySubscriptXOffset",type:"SHORT",value:0},{name:"ySubscriptYOffset",type:"SHORT",value:140},{name:"ySuperscriptXSize",type:"SHORT",value:650},{name:"ySuperscriptYSize",type:"SHORT",value:699},{name:"ySuperscriptXOffset",type:"SHORT",value:0},{name:"ySuperscriptYOffset",type:"SHORT",value:479},{name:"yStrikeoutSize",type:"SHORT",value:49},{name:"yStrikeoutPosition",type:"SHORT",value:258},{name:"sFamilyClass",type:"SHORT",value:0},{name:"bFamilyType",type:"BYTE",value:0},{name:"bSerifStyle",type:"BYTE",value:0},{name:"bWeight",type:"BYTE",value:0},{name:"bProportion",type:"BYTE",value:0},{name:"bContrast",type:"BYTE",value:0},{name:"bStrokeVariation",type:"BYTE",value:0},{name:"bArmStyle",type:"BYTE",value:0},{name:"bLetterform",type:"BYTE",value:0},{name:"bMidline",type:"BYTE",value:0},{name:"bXHeight",type:"BYTE",value:0},{name:"ulUnicodeRange1",type:"ULONG",value:0},{name:"ulUnicodeRange2",type:"ULONG",value:0},{name:"ulUnicodeRange3",type:"ULONG",value:0},{name:"ulUnicodeRange4",type:"ULONG",value:0},{name:"achVendID",type:"CHARARRAY",value:"XXXX"},{name:"fsSelection",type:"USHORT",value:0},{name:"usFirstCharIndex",type:"USHORT",value:0},{name:"usLastCharIndex",type:"USHORT",value:0},{name:"sTypoAscender",type:"SHORT",value:0},{name:"sTypoDescender",type:"SHORT",value:0},{name:"sTypoLineGap",type:"SHORT",value:0},{name:"usWinAscent",type:"USHORT",value:0},{name:"usWinDescent",type:"USHORT",value:0},{name:"ulCodePageRange1",type:"ULONG",value:0},{name:"ulCodePageRange2",type:"ULONG",value:0},{name:"sxHeight",type:"SHORT",value:0},{name:"sCapHeight",type:"SHORT",value:0},{name:"usDefaultChar",type:"USHORT",value:0},{name:"usBreakChar",type:"USHORT",value:0},{name:"usMaxContext",type:"USHORT",value:0}],e)},unicodeRanges:gt,getUnicodeRange:function(e){for(let t=0;t=n.begin&&e=ye.length){const e=o.parseChar();n.names.push(o.parseString(e))}break;case 2.5:n.numberOfGlyphs=o.parseUShort(),n.offset=new Array(n.numberOfGlyphs);for(let e=0;et.value.tag?1:-1})),t.fields=t.fields.concat(o),t.fields=t.fields.concat(r),t}function Lt(e,t,n){for(let n=0;n0){return e.glyphs.get(o).getMetrics()}}return n}function kt(e){let t=0;for(let n=0;nm||void 0===l)&&m>0&&(l=m),c 123 are reserved for internal usage");f|=1<0?tt.make(O):void 0,R=yt.make(),D=Qe.make(e.glyphs,{version:e.getEnglishName("version"),fullName:T,familyName:S,weightName:U,postScriptName:w,unitsPerEm:e.unitsPerEm,fontBBox:[0,d.yMin,d.ascender,d.advanceWidthMax]}),C=e.metas&&Object.keys(e.metas).length>0?Ut.make(e.metas):void 0,M=[g,m,y,v,L,x,R,D,b];k&&M.push(k),e.tables.gsub&&M.push(St.make(e.tables.gsub)),C&&M.push(C);const I=Ot(M),B=wt(I.encode()),N=I.fields;let G=!1;for(let e=0;e>>1,s=e[r].tag;if(s===t)return r;s>>1,s=e[r];if(s===t)return r;s=0)return o[r].script;if(t){const t={tag:e,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return o.splice(-1-r,0,t),t.script}}},getLangSysTable:function(e,t,n){const o=this.getScriptTable(e,n);if(o){if(!t||"dflt"===t||"DFLT"===t)return o.defaultLangSys;const e=Dt(o.langSysRecords,t);if(e>=0)return o.langSysRecords[e].langSys;if(n){const n={tag:t,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return o.langSysRecords.splice(-1-e,0,n),n.langSys}}},getFeatureTable:function(e,t,n,o){const r=this.getLangSysTable(e,t,o);if(r){let e;const t=r.featureIndexes,s=this.font.tables[this.tableName].features;for(let o=0;o=s[o-1].tag,"Features must be added in alphabetical order."),e={tag:n,feature:{params:0,lookupListIndexes:[]}},s.push(e),t.push(o),e.feature}}},getLookupTables:function(e,t,n,o,r){const s=this.getFeatureTable(e,t,n,r),a=[];if(s){let e;const t=s.lookupListIndexes,n=this.font.tables[this.tableName].lookups;for(let r=0;r=0){const e=s.ligatureSets[c];for(let t=0;t0&&e<0?n:o<0&&e>0?-n:e*o},Zt={x:1,y:0,axis:"x",distance:function(e,t,n,o){return(n?e.xo:e.x)-(o?t.xo:t.x)},interpolate:function(e,t,n,o){let r,s,a,i,l,c,u;if(!o||o===this)return r=e.xo-t.xo,s=e.xo-n.xo,l=t.x-t.xo,c=n.x-n.xo,a=Math.abs(r),i=Math.abs(s),u=a+i,0===u?void(e.x=e.xo+(l+c)/2):void(e.x=e.xo+(l*i+c*a)/u);r=o.distance(e,t,!0,!0),s=o.distance(e,n,!0,!0),l=o.distance(t,t,!1,!0),c=o.distance(n,n,!1,!0),a=Math.abs(r),i=Math.abs(s),u=a+i,0!==u?Zt.setRelative(e,e,(l*i+c*a)/u,o,!0):Zt.setRelative(e,e,(l+c)/2,o,!0)},normalSlope:Number.NEGATIVE_INFINITY,setRelative:function(e,t,n,o,r){if(!o||o===this)return void(e.x=(r?t.xo:t.x)+n);const s=r?t.xo:t.x,a=r?t.yo:t.y,i=s+n*o.x,l=a+n*o.y;e.x=i+(e.y-l)/o.normalSlope},slope:0,touch:function(e){e.xTouched=!0},touched:function(e){return e.xTouched},untouch:function(e){e.xTouched=!1}},$t={x:0,y:1,axis:"y",distance:function(e,t,n,o){return(n?e.yo:e.y)-(o?t.yo:t.y)},interpolate:function(e,t,n,o){let r,s,a,i,l,c,u;if(!o||o===this)return r=e.yo-t.yo,s=e.yo-n.yo,l=t.y-t.yo,c=n.y-n.yo,a=Math.abs(r),i=Math.abs(s),u=a+i,0===u?void(e.y=e.yo+(l+c)/2):void(e.y=e.yo+(l*i+c*a)/u);r=o.distance(e,t,!0,!0),s=o.distance(e,n,!0,!0),l=o.distance(t,t,!1,!0),c=o.distance(n,n,!1,!0),a=Math.abs(r),i=Math.abs(s),u=a+i,0!==u?$t.setRelative(e,e,(l*i+c*a)/u,o,!0):$t.setRelative(e,e,(l+c)/2,o,!0)},normalSlope:0,setRelative:function(e,t,n,o,r){if(!o||o===this)return void(e.y=(r?t.yo:t.y)+n);const s=r?t.xo:t.x,a=r?t.yo:t.y,i=s+n*o.x,l=a+n*o.y;e.y=l+o.normalSlope*(e.x-i)},slope:Number.POSITIVE_INFINITY,touch:function(e){e.yTouched=!0},touched:function(e){return e.yTouched},untouch:function(e){e.yTouched=!1}};function Qt(e,t){this.x=e,this.y=t,this.axis=void 0,this.slope=t/e,this.normalSlope=-e/t,Object.freeze(this)}function Kt(e,t){const n=Math.sqrt(e*e+t*t);return t/=n,1===(e/=n)&&0===t?Zt:0===e&&1===t?$t:new Qt(e,t)}function Jt(e,t,n,o){this.x=this.xo=Math.round(64*e)/64,this.y=this.yo=Math.round(64*t)/64,this.lastPointOfContour=n,this.onCurve=o,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}Object.freeze(Zt),Object.freeze($t),Qt.prototype.distance=function(e,t,n,o){return this.x*Zt.distance(e,t,n,o)+this.y*$t.distance(e,t,n,o)},Qt.prototype.interpolate=function(e,t,n,o){let r,s,a,i,l,c,u;a=o.distance(e,t,!0,!0),i=o.distance(e,n,!0,!0),r=o.distance(t,t,!1,!0),s=o.distance(n,n,!1,!0),l=Math.abs(a),c=Math.abs(i),u=l+c,0!==u?this.setRelative(e,e,(r*c+s*l)/u,o,!0):this.setRelative(e,e,(r+s)/2,o,!0)},Qt.prototype.setRelative=function(e,t,n,o,r){o=o||this;const s=r?t.xo:t.x,a=r?t.yo:t.y,i=s+n*o.x,l=a+n*o.y,c=o.normalSlope,u=this.slope,p=e.x,h=e.y;e.x=(u*p-c*i+l-h)/(u-c),e.y=u*(e.x-p)+h},Qt.prototype.touch=function(e){e.xTouched=!0,e.yTouched=!0},Jt.prototype.nextTouched=function(e){let t=this.nextPointOnContour;for(;!e.touched(t)&&t!==this;)t=t.nextPointOnContour;return t},Jt.prototype.prevTouched=function(e){let t=this.prevPointOnContour;for(;!e.touched(t)&&t!==this;)t=t.prevPointOnContour;return t};const en=Object.freeze(new Jt(0,0)),tn={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};function nn(e,t){switch(this.env=e,this.stack=[],this.prog=t,e){case"glyf":this.zp0=this.zp1=this.zp2=1,this.rp0=this.rp1=this.rp2=0;case"prep":this.fv=this.pv=this.dpv=Zt,this.round=_t}}function on(e){const t=e.tZone=new Array(e.gZone.length);for(let e=0;e=176&&o<=183)r+=o-176+1;else if(o>=184&&o<=191)r+=2*(o-184+1);else if(t&&1===s&&27===o)break}while(s>0);e.ip=r}function sn(e,t){exports.DEBUG&&console.log(t.step,"SVTCA["+e.axis+"]"),t.fv=t.pv=t.dpv=e}function an(e,t){exports.DEBUG&&console.log(t.step,"SPVTCA["+e.axis+"]"),t.pv=t.dpv=e}function ln(e,t){exports.DEBUG&&console.log(t.step,"SFVTCA["+e.axis+"]"),t.fv=e}function cn(e,t){const n=t.stack,o=n.pop(),r=n.pop(),s=t.z2[o],a=t.z1[r];let i,l;exports.DEBUG&&console.log("SPVTL["+e+"]",o,r),e?(i=s.y-a.y,l=a.x-s.x):(i=a.x-s.x,l=a.y-s.y),t.pv=t.dpv=Kt(i,l)}function un(e,t){const n=t.stack,o=n.pop(),r=n.pop(),s=t.z2[o],a=t.z1[r];let i,l;exports.DEBUG&&console.log("SFVTL["+e+"]",o,r),e?(i=s.y-a.y,l=a.x-s.x):(i=a.x-s.x,l=a.y-s.y),t.fv=Kt(i,l)}function pn(e){exports.DEBUG&&console.log(e.step,"POP[]"),e.stack.pop()}function hn(e,t){const n=t.stack.pop(),o=t.z0[n],r=t.fv,s=t.pv;exports.DEBUG&&console.log(t.step,"MDAP["+e+"]",n);let a=s.distance(o,en);e&&(a=t.round(a)),r.setRelative(o,en,a,s),r.touch(o),t.rp0=t.rp1=n}function fn(e,t){const n=t.z2,o=n.length-2;let r,s,a;exports.DEBUG&&console.log(t.step,"IUP["+e.axis+"]");for(let t=0;t1?"loop "+(t.loop-i)+": ":"")+"SHP["+(e?"rp1":"rp2")+"]",o)}t.loop=1}function gn(e,t){const n=t.stack,o=e?t.rp1:t.rp2,r=(e?t.z0:t.z1)[o],s=t.fv,a=t.pv,i=n.pop(),l=t.z2[t.contours[i]];let c=l;exports.DEBUG&&console.log(t.step,"SHC["+e+"]",i);const u=a.distance(r,r,!1,!0);do{c!==r&&s.setRelative(c,c,u,a),c=c.nextPointOnContour}while(c!==l)}function mn(e,t){const n=t.stack,o=e?t.rp1:t.rp2,r=(e?t.z0:t.z1)[o],s=t.fv,a=t.pv,i=n.pop();let l,c;switch(exports.DEBUG&&console.log(t.step,"SHZ["+e+"]",i),i){case 0:l=t.tZone;break;case 1:l=t.gZone;break;default:throw new Error("Invalid zone")}const u=a.distance(r,r,!1,!0),p=l.length-2;for(let e=0;e",i),t.stack.push(Math.round(64*i))}function Sn(e,t){const n=t.stack,o=n.pop(),r=t.fv,s=t.pv,a=t.ppem,i=t.deltaBase+16*(e-1),l=t.deltaShift,c=t.z0;exports.DEBUG&&console.log(t.step,"DELTAP["+e+"]",o,n);for(let e=0;e>4)!==a)continue;let u=(15&o)-8;u>=0&&u++,exports.DEBUG&&console.log(t.step,"DELTAPFIX",e,"by",u*l);const p=c[e];r.setRelative(p,p,u*l,s)}}function Un(e,t){const n=t.stack,o=n.pop();exports.DEBUG&&console.log(t.step,"ROUND[]"),n.push(64*t.round(o/64))}function Tn(e,t){const n=t.stack,o=n.pop(),r=t.ppem,s=t.deltaBase+16*(e-1),a=t.deltaShift;exports.DEBUG&&console.log(t.step,"DELTAC["+e+"]",o,n);for(let e=0;e>4)!==r)continue;let i=(15&o)-8;i>=0&&i++;const l=i*a;exports.DEBUG&&console.log(t.step,"DELTACFIX",e,"by",l),t.cvt[e]+=l}}function wn(e,t){const n=t.stack,o=n.pop(),r=n.pop(),s=t.z2[o],a=t.z1[r];let i,l;exports.DEBUG&&console.log("SDPVTL["+e+"]",o,r),e?(i=s.y-a.y,l=a.x-s.x):(i=a.x-s.x,l=a.y-s.y),t.dpv=Kt(i,l)}function En(e,t){const n=t.stack,o=t.prog;let r=t.ip;exports.DEBUG&&console.log(t.step,"PUSHB["+e+"]");for(let t=0;t=0?1:-1,m=Math.abs(m),e&&(v=s.cvt[i],o&&Math.abs(m-v)":"_")+(o?"R":"_")+(0===r?"Gr":1===r?"Bl":2===r?"Wh":"")+"]",e?i+"("+s.cvt[i]+","+v+")":"",l,"(d =",g,"->",y*m,")"),s.rp1=s.rp0,s.rp2=l,t&&(s.rp0=l)}function kn(e){(e=e||{}).empty||(Gt(e.familyName,"When creating a new Font object, familyName is required."),Gt(e.styleName,"When creating a new Font object, styleName is required."),Gt(e.unitsPerEm,"When creating a new Font object, unitsPerEm is required."),Gt(e.ascender,"When creating a new Font object, ascender is required."),Gt(e.descender,"When creating a new Font object, descender is required."),Gt(e.descender<0,"Descender should be negative (e.g. -512)."),this.names={fontFamily:{en:e.familyName||" "},fontSubfamily:{en:e.styleName||" "},fullName:{en:e.fullName||e.familyName+" "+e.styleName},postScriptName:{en:e.postScriptName||e.familyName+e.styleName},designer:{en:e.designer||" "},designerURL:{en:e.designerURL||" "},manufacturer:{en:e.manufacturer||" "},manufacturerURL:{en:e.manufacturerURL||" "},license:{en:e.license||" "},licenseURL:{en:e.licenseURL||" "},version:{en:e.version||"Version 0.1"},description:{en:e.description||" "},copyright:{en:e.copyright||" "},trademark:{en:e.trademark||" "}},this.unitsPerEm=e.unitsPerEm||1e3,this.ascender=e.ascender,this.descender=e.descender,this.createdTimestamp=e.createdTimestamp,this.tables={os2:{usWeightClass:e.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:e.widthClass||this.usWidthClasses.MEDIUM,fsSelection:e.fsSelection||this.fsSelectionValues.REGULAR}}),this.supported=!0,this.glyphs=new Me.GlyphSet(this,e.glyphs||[]),this.encoding=new ve(this),this.substitution=new Mt(this),this.tables=this.tables||{},Object.defineProperty(this,"hinting",{get:function(){return this._hinting?this._hinting:"truetype"===this.outlinesFormat?this._hinting=new zt(this):void 0}})}function Rn(e,t){const n=JSON.stringify(e);let o=256;for(let e in t){let r=parseInt(e);if(r&&!(r<256)){if(JSON.stringify(t[e])===n)return r;o<=r&&(o=r+1)}}return t[o]=e,o}function Dn(e,t,n){const o=Rn(t.name,n);return[{name:"tag_"+e,type:"TAG",value:t.tag},{name:"minValue_"+e,type:"FIXED",value:t.minValue<<16},{name:"defaultValue_"+e,type:"FIXED",value:t.defaultValue<<16},{name:"maxValue_"+e,type:"FIXED",value:t.maxValue<<16},{name:"flags_"+e,type:"USHORT",value:0},{name:"nameID_"+e,type:"USHORT",value:o}]}function Cn(e,t,n){const o={},r=new pe.Parser(e,t);return o.tag=r.parseTag(),o.minValue=r.parseFixed(),o.defaultValue=r.parseFixed(),o.maxValue=r.parseFixed(),r.skip("uShort",1),o.name=n[r.parseUShort()]||{},o}function Mn(e,t,n,o){const r=[{name:"nameID_"+e,type:"USHORT",value:Rn(t.name,o)},{name:"flags_"+e,type:"USHORT",value:0}];for(let o=0;o2)return;const n=this.font;let o=this._prepState;if(!o||o.ppem!==t){let e=this._fpgmState;if(!e){nn.prototype=tn,e=this._fpgmState=new nn("fpgm",n.tables.fpgm),e.funcs=[],e.font=n,exports.DEBUG&&(console.log("---EXEC FPGM---"),e.step=-1);try{At(e)}catch(e){return console.log("Hinting error in FPGM:"+e),void(this._errorState=3)}}nn.prototype=e,o=this._prepState=new nn("prep",n.tables.prep),o.ppem=t;const r=n.tables.cvt;if(r){const e=o.cvt=new Array(r.length),s=t/n.unitsPerEm;for(let t=0;t1))try{return Ft(e,o)}catch(e){return this._errorState<1&&(console.log("Hinting error:"+e),console.log("Note: further hinting errors are silenced")),void(this._errorState=1)}},Ft=function(e,t){const n=t.ppem/t.font.unitsPerEm,o=n;let r,s,a,i=e.components;if(nn.prototype=t,i){const l=t.font;s=[],r=[];for(let e=0;e1?"loop "+(e.loop-n)+": ":"")+"SHPIX[]",a,r),o.setRelative(i,i,r),o.touch(i)}e.loop=1},function(e){const t=e.stack,n=e.rp1,o=e.rp2;let r=e.loop;const s=e.z0[n],a=e.z1[o],i=e.fv,l=e.dpv,c=e.z2;for(;r--;){const u=t.pop(),p=c[u];exports.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-r)+": ":"")+"IP[]",u,n,"<->",o),i.interpolate(p,s,a,l),i.touch(p)}e.loop=1},yn.bind(void 0,0),yn.bind(void 0,1),function(e){const t=e.stack,n=e.rp0,o=e.z0[n];let r=e.loop;const s=e.fv,a=e.pv,i=e.z1;for(;r--;){const n=t.pop(),l=i[n];exports.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-r)+": ":"")+"ALIGNRP[]",n),s.setRelative(l,o,0,a),s.touch(l)}e.loop=1},function(e){exports.DEBUG&&console.log(e.step,"RTDG[]"),e.round=qt},vn.bind(void 0,0),vn.bind(void 0,1),function(e){const t=e.prog;let n=e.ip;const o=e.stack,r=t[++n];exports.DEBUG&&console.log(e.step,"NPUSHB[]",r);for(let e=0;en?1:0)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"GTEQ[]",n,o),t.push(o>=n?1:0)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"EQ[]",n,o),t.push(n===o?1:0)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"NEQ[]",n,o),t.push(n!==o?1:0)},function(e){const t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"ODD[]",n),t.push(Math.trunc(n)%2?1:0)},function(e){const t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"EVEN[]",n),t.push(Math.trunc(n)%2?0:1)},function(e){let t=e.stack.pop();exports.DEBUG&&console.log(e.step,"IF[]",t),t||(rn(e,!0),exports.DEBUG&&console.log(e.step,"EIF[]"))},function(e){exports.DEBUG&&console.log(e.step,"EIF[]")},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"AND[]",n,o),t.push(n&&o?1:0)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"OR[]",n,o),t.push(n||o?1:0)},function(e){const t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"NOT[]",n),t.push(n?0:1)},Sn.bind(void 0,1),function(e){const t=e.stack.pop();exports.DEBUG&&console.log(e.step,"SDB[]",t),e.deltaBase=t},function(e){const t=e.stack.pop();exports.DEBUG&&console.log(e.step,"SDS[]",t),e.deltaShift=Math.pow(.5,t)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"ADD[]",n,o),t.push(o+n)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"SUB[]",n,o),t.push(o-n)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"DIV[]",n,o),t.push(64*o/n)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"MUL[]",n,o),t.push(o*n/64)},function(e){const t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"ABS[]",n),t.push(Math.abs(n))},function(e){const t=e.stack;let n=t.pop();exports.DEBUG&&console.log(e.step,"NEG[]",n),t.push(-n)},function(e){const t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"FLOOR[]",n),t.push(64*Math.floor(n/64))},function(e){const t=e.stack,n=t.pop();exports.DEBUG&&console.log(e.step,"CEILING[]",n),t.push(64*Math.ceil(n/64))},Un.bind(void 0,0),Un.bind(void 0,1),Un.bind(void 0,2),Un.bind(void 0,3),void 0,void 0,void 0,void 0,function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"WCVTF[]",n,o),e.cvt[o]=n*e.ppem/e.font.unitsPerEm},Sn.bind(void 0,2),Sn.bind(void 0,3),Tn.bind(void 0,1),Tn.bind(void 0,2),Tn.bind(void 0,3),function(e){let t,n=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"SROUND[]",n),e.round=Yt,192&n){case 0:t=.5;break;case 64:t=1;break;case 128:t=2;break;default:throw new Error("invalid SROUND value")}switch(e.srPeriod=t,48&n){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*t;break;case 32:e.srPhase=.5*t;break;case 48:e.srPhase=.75*t;break;default:throw new Error("invalid SROUND value")}n&=15,e.srThreshold=0===n?0:(n/8-.5)*t},function(e){let t,n=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"S45ROUND[]",n),e.round=Yt,192&n){case 0:t=Math.sqrt(2)/2;break;case 64:t=Math.sqrt(2);break;case 128:t=2*Math.sqrt(2);break;default:throw new Error("invalid S45ROUND value")}switch(e.srPeriod=t,48&n){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*t;break;case 32:e.srPhase=.5*t;break;case 48:e.srPhase=.75*t;break;default:throw new Error("invalid S45ROUND value")}n&=15,e.srThreshold=0===n?0:(n/8-.5)*t},void 0,void 0,function(e){exports.DEBUG&&console.log(e.step,"ROFF[]"),e.round=Wt},void 0,function(e){exports.DEBUG&&console.log(e.step,"RUTG[]"),e.round=Vt},function(e){exports.DEBUG&&console.log(e.step,"RDTG[]"),e.round=jt},pn,pn,void 0,void 0,void 0,void 0,void 0,function(e){const t=e.stack.pop();exports.DEBUG&&console.log(e.step,"SCANCTRL[]",t)},wn.bind(void 0,0),wn.bind(void 0,1),function(e){const t=e.stack,n=t.pop();let o=0;exports.DEBUG&&console.log(e.step,"GETINFO[]",n),1&n&&(o=35),32&n&&(o|=4096),t.push(o)},void 0,function(e){const t=e.stack,n=t.pop(),o=t.pop(),r=t.pop();exports.DEBUG&&console.log(e.step,"ROLL[]"),t.push(o),t.push(n),t.push(r)},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"MAX[]",n,o),t.push(Math.max(o,n))},function(e){const t=e.stack,n=t.pop(),o=t.pop();exports.DEBUG&&console.log(e.step,"MIN[]",n,o),t.push(Math.min(o,n))},function(e){const t=e.stack.pop();exports.DEBUG&&console.log(e.step,"SCANTYPE[]",t)},function(e){const t=e.stack.pop();let n=e.stack.pop();switch(exports.DEBUG&&console.log(e.step,"INSTCTRL[]",t,n),t){case 1:return void(e.inhibitGridFit=!!n);case 2:return void(e.ignoreCvt=!!n);default:throw new Error("invalid INSTCTRL[] selector")}},void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,En.bind(void 0,1),En.bind(void 0,2),En.bind(void 0,3),En.bind(void 0,4),En.bind(void 0,5),En.bind(void 0,6),En.bind(void 0,7),En.bind(void 0,8),On.bind(void 0,1),On.bind(void 0,2),On.bind(void 0,3),On.bind(void 0,4),On.bind(void 0,5),On.bind(void 0,6),On.bind(void 0,7),On.bind(void 0,8),Ln.bind(void 0,0,0,0,0,0),Ln.bind(void 0,0,0,0,0,1),Ln.bind(void 0,0,0,0,0,2),Ln.bind(void 0,0,0,0,0,3),Ln.bind(void 0,0,0,0,1,0),Ln.bind(void 0,0,0,0,1,1),Ln.bind(void 0,0,0,0,1,2),Ln.bind(void 0,0,0,0,1,3),Ln.bind(void 0,0,0,1,0,0),Ln.bind(void 0,0,0,1,0,1),Ln.bind(void 0,0,0,1,0,2),Ln.bind(void 0,0,0,1,0,3),Ln.bind(void 0,0,0,1,1,0),Ln.bind(void 0,0,0,1,1,1),Ln.bind(void 0,0,0,1,1,2),Ln.bind(void 0,0,0,1,1,3),Ln.bind(void 0,0,1,0,0,0),Ln.bind(void 0,0,1,0,0,1),Ln.bind(void 0,0,1,0,0,2),Ln.bind(void 0,0,1,0,0,3),Ln.bind(void 0,0,1,0,1,0),Ln.bind(void 0,0,1,0,1,1),Ln.bind(void 0,0,1,0,1,2),Ln.bind(void 0,0,1,0,1,3),Ln.bind(void 0,0,1,1,0,0),Ln.bind(void 0,0,1,1,0,1),Ln.bind(void 0,0,1,1,0,2),Ln.bind(void 0,0,1,1,0,3),Ln.bind(void 0,0,1,1,1,0),Ln.bind(void 0,0,1,1,1,1),Ln.bind(void 0,0,1,1,1,2),Ln.bind(void 0,0,1,1,1,3),Ln.bind(void 0,1,0,0,0,0),Ln.bind(void 0,1,0,0,0,1),Ln.bind(void 0,1,0,0,0,2),Ln.bind(void 0,1,0,0,0,3),Ln.bind(void 0,1,0,0,1,0),Ln.bind(void 0,1,0,0,1,1),Ln.bind(void 0,1,0,0,1,2),Ln.bind(void 0,1,0,0,1,3),Ln.bind(void 0,1,0,1,0,0),Ln.bind(void 0,1,0,1,0,1),Ln.bind(void 0,1,0,1,0,2),Ln.bind(void 0,1,0,1,0,3),Ln.bind(void 0,1,0,1,1,0),Ln.bind(void 0,1,0,1,1,1),Ln.bind(void 0,1,0,1,1,2),Ln.bind(void 0,1,0,1,1,3),Ln.bind(void 0,1,1,0,0,0),Ln.bind(void 0,1,1,0,0,1),Ln.bind(void 0,1,1,0,0,2),Ln.bind(void 0,1,1,0,0,3),Ln.bind(void 0,1,1,0,1,0),Ln.bind(void 0,1,1,0,1,1),Ln.bind(void 0,1,1,0,1,2),Ln.bind(void 0,1,1,0,1,3),Ln.bind(void 0,1,1,1,0,0),Ln.bind(void 0,1,1,1,0,1),Ln.bind(void 0,1,1,1,0,2),Ln.bind(void 0,1,1,1,0,3),Ln.bind(void 0,1,1,1,1,0),Ln.bind(void 0,1,1,1,1,1),Ln.bind(void 0,1,1,1,1,2),Ln.bind(void 0,1,1,1,1,3)],kn.prototype.hasChar=function(e){return null!==this.encoding.charToGlyphIndex(e)},kn.prototype.charToGlyphIndex=function(e){return this.encoding.charToGlyphIndex(e)},kn.prototype.charToGlyph=function(e){const t=this.charToGlyphIndex(e);let n=this.glyphs.get(t);return n||(n=this.glyphs.get(0)),n},kn.prototype.stringToGlyphs=function(e,t){t=t||this.defaultRenderOptions;const n=[];for(let t=0;t>1;e1&&console.warn("Only the first kern subtable is supported."),e.skip("uLong");const n=255&e.parseUShort();if(e.skip("uShort"),0===n){const n=e.parseUShort();e.skip("uShort",3);for(let o=0;o{const t=jn.loadSync(e);$n.font=t,$n.ascender=t.ascender,$n.descender=t.descender}};const Kn=Qn.options,Jn=function(e,t){return Math.round(e+Math.random()*(t-e))};const eo=function(e,t){return{text:(e+t).toString(),equation:e+"+"+t}},to=function(e,t){return{text:(e-t).toString(),equation:e+"-"+t}};function no(e,t,n){return 6*(n=(n+1)%1)<1?e+(t-e)*n*6:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}var oo={int:Jn,greyColor:function(e,t){const n=Jn(e=e||1,t=t||9).toString(16);return`#${n}${n}${n}`},captchaText:function(e){"number"==typeof e&&(e={size:e});const t=(e=e||{}).size||4,n=e.ignoreChars||"";let o=-1,r="",s=e.charPreset||Kn.charPreset;n&&(s=function(e,t){return e.split("").filter(e=>-1===t.indexOf(e))}(s,n));const a=s.length-1;for(;++o>16,o=t>>8&255,r=255&t,s=Math.max(n,o,r),a=Math.min(n,o,r);return(s+a)/510}(e):1;let r,s;o>=.5?(r=Math.round(100*o)-45,s=Math.round(100*o)-25):(r=Math.round(100*o)+25,s=Math.round(100*o)+45);const a=Jn(r,s)/100,i=a<.5?a*(a+n):a+n-a*n,l=2*a-i,c=Math.floor(255*no(l,i,t+1/3)),u=Math.floor(255*no(l,i,t));return"#"+(Math.floor(255*no(l,i,t-1/3))|u<<8|c<<16|1<<24).toString(16).slice(1)}};const ro=Qn.options,so=function(e,t){e=e||oo.captchaText();const n=(t=Object.assign({},ro,t)).width,o=t.height,r=t.background||t.backgroundColor;r&&(t.color=!0);const s=r?``:"",a=[].concat(function(e,t,n){const o=n.color,r=[],s=n.inverse?7:1,a=n.inverse?15:9;let i=-1;for(;++i`)}return r}(n,o,t)).concat(function(e,t,n,o,r){const s=e.length,a=(t-2)/(s+1),i=o.inverse?10:0,l=o.inverse?14:4;let u=-1;const p=[],h=r||o.color?oo.color(o.background):oo.greyColor(i,l);for(;++u`)}return p}(e,n,o,t)).sort(()=>Math.random()-.5).join("");return`${``}${s}${a}`};var ao=so,io=oo.captchaText,lo=function(e){const t=e.text||oo.captchaText(e);return{text:t,data:so(t,e)}},co=function(e){const t=oo.mathExpr(e.mathMin,e.mathMax,e.mathOperator);return{text:t.text,data:so(t.equation,e)}},uo=ro,po=Qn.loadFont;ao.randomText=io,ao.create=lo,ao.createMathExpr=co,ao.options=uo,ao.loadFont=po;var ho=ao;var fo=class{constructor(e={}){let{level:t=2,...n}=e;this.width=300,this.height=100;const o=[Math.floor(256*Math.random()),Math.floor(256*Math.random()),Math.floor(256*Math.random())];-1===[1,2,3,4].indexOf(t)&&(t=2);const r={};1===t?Object.assign(r,{lineWidth:5,textColor:o,textLength:4,lineOffset:0,background:[255,250,232],randomLineNum:5},n):2===t?Object.assign(r,{lineWidth:5,textColor:o,textLength:4,lineOffset:0,background:[255,250,232],randomLineNum:10},n):3===t?Object.assign(r,{lineWidth:5,textColor:o,textLength:4,lineOffset:1,background:[255,250,232],randomLineNum:15},n):4===t&&(Object.assign(r,{lineWidth:5,textColor:o,textLength:4,lineOffset:1,background:[255,250,232],randomLineNum:15},n),r.textColor=function(){return[Math.floor(256*Math.random()),Math.floor(256*Math.random()),Math.floor(256*Math.random())]}),this.config=r,this.data=Buffer.alloc(9e4)}setPixel(e,t,n){const o=3*(t*this.width+e);this.data[o]=n.b,this.data[o+1]=n.g,this.data[o+2]=n.r}getFileBuffer(e){const t=54+this.data.length,n=Buffer.alloc(t);return n.write("BM",0),n.writeUInt32LE(t,2),n.writeUInt32LE(0,6),n.writeUInt32LE(54,10),n.writeUInt32LE(40,14),n.writeInt32LE(this.width,18),n.writeInt32LE(-this.height,22),n.writeUInt16LE(1,26),n.writeUInt16LE(24,28),n.writeUInt32LE(0,30),n.writeUInt32LE(this.data.length,34),this.data.copy(n,54),n}setImageBackground(e,t,n){for(let o=0;o=3?Math.floor(11*Math.random())-6:0}getTextOffset(e=0){const t=this.config.textLength,n=Math.round((300-50*t)/2/t);return{x:e*(300/this.config.textLength)+n,y:0}}drawRandomLinesWithVaryingWidth(e){const t=this.width,n=this.height;for(let o=0;o-i&&(u-=i,e+=l),p0){const e=s.data[0];if(e.expired_date{e.scene&&delete e.scene,this.pluginConfig.scene[n]=Object.assign({},t,e[n])})}}}{constructor(){super(),this.DEVICEID2opts={}}mergeConfig(e){const t=yo(this.pluginConfig.scene)?this.pluginConfig.scene[e.scene]:e.scene;return Object.assign({},yo(t)?t:this.pluginConfig,e)}async create(e={}){if(!e.scene)throw new Error("scene验证码场景不可为空");e=this.mergeConfig(e);let{scene:t,expiresDate:n,deviceId:o,clientIP:r,...s}=e;if(o=o||__ctx__.DEVICEID,r=r||__ctx__.CLIENTIP,!o)throw new Error("deviceId不可为空");const a=new To;try{const{text:i,base64:l}=function(e={}){const{uniPlatform:t="",mode:n="svg"}=e;if("svg"===n){let n;n=e.mathExpr?ho.createMathExpr(e):ho.create(e);let o="data:image/svg+xml;utf8,"+n.data.replace(/#/g,"%23");return(!t||["mp-toutiao","h5","web","app","app-plus"].indexOf(t)>-1)&&(o=o.replace(/"/g,"'").replace(//g,"%3E")),{text:n.text,base64:o}}{const t=new fo(JSON.parse(JSON.stringify({...e,textLength:e.size?Number(e.size):void 0,textColor:go(e.color),background:go(e.background)}))),{text:n,base64:o}=t.draw();return{text:n,base64:o}}}(s),c=await a.setVerifyCode({clientIP:r,deviceId:o,code:i,expiresDate:n,scene:t});return c.code>0?{...c,code:10001}:(this.DEVICEID2opts[o]=e,{code:0,msg:"验证码获取成功",captchaBase64:l})}catch(e){return{code:10001,msg:"验证码生成失败:"+e.message}}}async verify({deviceId:e,captcha:t,scene:n}){if(!(e=e||__ctx__.DEVICEID))throw new Error("deviceId不可为空");if(!n)throw new Error("scene验证码场景不可为空");const o=new To;try{const r=await o.verifyCode({deviceId:e,code:t,scene:n});return r.code>0?r:{code:0,msg:"验证码通过"}}catch(e){return{code:10002,msg:"验证码校验失败:"+e.message}}}async refresh(e={}){let{scene:t,expiresDate:n,deviceId:o,...r}=e;if(o=o||__ctx__.DEVICEID,!o)throw new Error("deviceId不可为空");if(!t)throw new Error("scene验证码场景不可为空");const s=await Uo.where(So.command.or([{device_uuid:o,scene:t},{deviceId:o,scene:t}])).orderBy("created_date","desc").limit(1).get();if(s&&s.data&&s.data.length>0){const e=s.data[0];await Uo.doc(e._id).update({state:2}),Object.keys(r).length>0&&(this.DEVICEID2opts[o]=Object.assign({},this.DEVICEID2opts[o],r));let a={};try{a=await this.create(Object.assign({},this.DEVICEID2opts[o],{deviceId:o,scene:t,expiresDate:n}))}catch(e){return{code:50403,msg:e.message}}return a.code>0?{...a,code:50403}:{code:0,msg:"验证码刷新成功",captchaBase64:a.captchaBase64}}return{code:10003,msg:`验证码刷新失败:无此设备在 ${t} 场景信息,请重新获取`}}}const Oo=new To;Object.keys(Oo).forEach(e=>{Eo.prototype[e]=xo(Oo[e])});const Lo=new Eo,ko=new Proxy(Lo,{get(e,t){if(t in e)return"function"==typeof e[t]?xo(e[t]).bind(ko):e[t]}});module.exports=ko; diff --git a/sport-erp-admin/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/package.json b/sport-erp-admin/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/package.json deleted file mode 100644 index 10e3e48..0000000 --- a/sport-erp-admin/uni_modules/uni-captcha/uniCloud/cloudfunctions/common/uni-captcha/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "uni-captcha", - "version": "0.7.0", - "description": "uni-captcha", - "main": "index.js", - "homepage": "https:\/\/ext.dcloud.net.cn\/plugin?id=4048", - "repository": { - "type": "git", - "url": "git+https:\/\/gitee.com\/dcloud\/uni-captcha" - }, - "author": "DCloud", - "license": "Apache-2.0", - "dependencies": { - "uni-config-center": "file:..\/..\/..\/..\/..\/uni-config-center\/uniCloud\/cloudfunctions\/common\/uni-config-center" - }, - "origin-plugin-dev-name": "uni-template-admin", - "origin-plugin-version": "2.5.13", - "plugin-dev-name": "uni-template-admin", - "plugin-version": "2.5.13" -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-captcha/uniCloud/cloudfunctions/uni-captcha-co/index.obj.js b/sport-erp-admin/uni_modules/uni-captcha/uniCloud/cloudfunctions/uni-captcha-co/index.obj.js deleted file mode 100644 index 186e82c..0000000 --- a/sport-erp-admin/uni_modules/uni-captcha/uniCloud/cloudfunctions/uni-captcha-co/index.obj.js +++ /dev/null @@ -1,35 +0,0 @@ -// 开发文档: https://uniapp.dcloud.net.cn/uniCloud/cloud-obj -//导入验证码公共模块 -const uniCaptcha = require('uni-captcha') -//获取数据库对象 -const db = uniCloud.database(); -//获取数据表opendb-verify-codes对象 -const verifyCodes = db.collection('opendb-verify-codes') -module.exports = { - async getImageCaptcha({ - scene,isUniAppX - }) { - //获取设备id - let { - deviceId, - platform - } = this.getClientInfo(); - //根据:设备id、场景值、状态,查找记录是否存在 - let res = await verifyCodes.where({ - scene, - deviceId, - state: 0 - }).limit(1).get() - //如果已存在则调用刷新接口,反之调用插件接口 - let action = res.data.length ? 'refresh' : 'create' - //执行并返回结果 - let option = { - scene, //来源客户端传递,表示:使用场景值,用于防止不同功能的验证码混用 - uniPlatform: platform - } - if(isUniAppX){ - option.mode = "bmp" - } - return await uniCaptcha[action](option) - } -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-captcha/uniCloud/cloudfunctions/uni-captcha-co/package.json b/sport-erp-admin/uni_modules/uni-captcha/uniCloud/cloudfunctions/uni-captcha-co/package.json deleted file mode 100644 index 1399093..0000000 --- a/sport-erp-admin/uni_modules/uni-captcha/uniCloud/cloudfunctions/uni-captcha-co/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "uni-captcha-co", - "dependencies": { - "uni-captcha": "file:..\/common\/uni-captcha", - "uni-config-center": "file:..\/..\/..\/..\/uni-config-center\/uniCloud\/cloudfunctions\/common\/uni-config-center" - }, - "extensions": { - "uni-cloud-jql": {} - }, - "origin-plugin-dev-name": "uni-template-admin", - "origin-plugin-version": "2.5.13", - "plugin-dev-name": "uni-template-admin", - "plugin-version": "2.5.13" -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-captcha/uniCloud/database/opendb-verify-codes.schema.json b/sport-erp-admin/uni_modules/uni-captcha/uniCloud/database/opendb-verify-codes.schema.json deleted file mode 100644 index 1f3be59..0000000 --- a/sport-erp-admin/uni_modules/uni-captcha/uniCloud/database/opendb-verify-codes.schema.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "bsonType": "object", - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "code": { - "bsonType": "string", - "description": "验证码" - }, - "create_date": { - "bsonType": "timestamp", - "description": "创建时间" - }, - "device_uuid": { - "bsonType": "string", - "description": "设备UUID,常用于图片验证码" - }, - "email": { - "bsonType": "string", - "description": "邮箱" - }, - "expired_date": { - "bsonType": "timestamp", - "description": "过期时间" - }, - "ip": { - "bsonType": "string", - "description": "请求时客户端IP地址" - }, - "mobile": { - "bsonType": "string", - "description": "手机号码" - }, - "scene": { - "bsonType": "string", - "description": "使用验证码的场景,如:login, bind, unbind, pay" - }, - "state": { - "bsonType": "int", - "description": "验证状态:0 未验证、1 已验证、2 已作废" - } - }, - "required": [] -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-card/changelog.md b/sport-erp-admin/uni_modules/uni-card/changelog.md deleted file mode 100644 index c3cd8c4..0000000 --- a/sport-erp-admin/uni_modules/uni-card/changelog.md +++ /dev/null @@ -1,26 +0,0 @@ -## 1.3.1(2021-12-20) -- 修复 在vue页面下略缩图显示不正常的bug -## 1.3.0(2021-11-19) -- 重构插槽的用法 ,header 替换为 title -- 新增 actions 插槽 -- 新增 cover 封面图属性和插槽 -- 新增 padding 内容默认内边距离 -- 新增 margin 卡片默认外边距离 -- 新增 spacing 卡片默认内边距 -- 新增 shadow 卡片阴影属性 -- 取消 mode 属性,可使用组合插槽代替 -- 取消 note 属性 ,使用actions插槽代替 -- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) -- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-card](https://uniapp.dcloud.io/component/uniui/uni-card) -## 1.2.1(2021-07-30) -- 优化 vue3下事件警告的问题 -## 1.2.0(2021-07-13) -- 组件兼容 vue3,如何创建vue3项目详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 1.1.8(2021-07-01) -- 优化 图文卡片无图片加载时,提供占位图标 -- 新增 header 插槽,自定义卡片头部( 图文卡片 mode="style" 时,不支持) -- 修复 thumbnail 不存在仍然占位的 bug -## 1.1.7(2021-05-12) -- 新增 组件示例地址 -## 1.1.6(2021-02-04) -- 调整为uni_modules目录规范 diff --git a/sport-erp-admin/uni_modules/uni-card/components/uni-card/uni-card.vue b/sport-erp-admin/uni_modules/uni-card/components/uni-card/uni-card.vue deleted file mode 100644 index 38cf594..0000000 --- a/sport-erp-admin/uni_modules/uni-card/components/uni-card/uni-card.vue +++ /dev/null @@ -1,270 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-card/package.json b/sport-erp-admin/uni_modules/uni-card/package.json deleted file mode 100644 index f16224d..0000000 --- a/sport-erp-admin/uni_modules/uni-card/package.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "id": "uni-card", - "displayName": "uni-card 卡片", - "version": "1.3.1", - "description": "Card 组件,提供常见的卡片样式。", - "keywords": [ - "uni-ui", - "uniui", - "card", - "", - "卡片" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ], - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" - }, - "uni_modules": { - "dependencies": [ - "uni-icons", - "uni-scss" - ], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "y" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y" - }, - "快应用": { - "华为": "u", - "联盟": "u" - }, - "Vue": { - "vue2": "y", - "vue3": "y" - } - } - } - } -} diff --git a/sport-erp-admin/uni_modules/uni-card/readme.md b/sport-erp-admin/uni_modules/uni-card/readme.md deleted file mode 100644 index 7434e71..0000000 --- a/sport-erp-admin/uni_modules/uni-card/readme.md +++ /dev/null @@ -1,12 +0,0 @@ - - -## Card 卡片 -> **组件名:uni-card** -> 代码块: `uCard` - -卡片视图组件。 - -### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-card) -#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 - - diff --git a/sport-erp-admin/uni_modules/uni-cloud-router/changelog.md b/sport-erp-admin/uni_modules/uni-cloud-router/changelog.md deleted file mode 100644 index e3ff73b..0000000 --- a/sport-erp-admin/uni_modules/uni-cloud-router/changelog.md +++ /dev/null @@ -1,4 +0,0 @@ -## 1.0.3(2021-02-02) -- 修复 package.json 丢失 -## 1.0.2(2021-02-02) -- 支持 uni_modules diff --git a/sport-erp-admin/uni_modules/uni-cloud-router/package.json b/sport-erp-admin/uni_modules/uni-cloud-router/package.json deleted file mode 100644 index 8609e8f..0000000 --- a/sport-erp-admin/uni_modules/uni-cloud-router/package.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "id": "uni-cloud-router", - "name": "uni-cloud-router", - "displayName": "uni-cloud-router", - "version": "1.0.3", - "description": " 基于 koa 风格的 uniCloud 云函数路由库,同时支持 uniCloud 客户端及 URL", - "keywords": [ - "云函数路由", - "uniCloud", - "uni-cloud-router" - ], - "repository": "https://gitee.com/dcloud/uni-cloud-router", - "engines": { - "HBuilderX": "^3.1.0" - }, - "files": ["uniCloud", "changelog.md", "readme.md"], - "dcloudext": { - "category": [ - "uniCloud", - "云函数模板" - ], - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/uni-cloud-router" - }, - "uni_modules": { - "dependencies": [], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y" - }, - "client": { - "App": { - "app-vue": "u", - "app-nvue": "u" - }, - "H5-mobile": { - "Safari": "u", - "Android Browser": "u", - "微信浏览器(Android)": "u", - "QQ浏览器(Android)": "u" - }, - "H5-pc": { - "Chrome": "u", - "IE": "u", - "Edge": "u", - "Firefox": "u", - "Safari": "u" - }, - "小程序": { - "微信": "u", - "阿里": "u", - "百度": "u", - "字节跳动": "u", - "QQ": "u" - }, - "快应用": { - "华为": "u", - "联盟": "u" - } - } - } - } -} diff --git a/sport-erp-admin/uni_modules/uni-cloud-router/readme.md b/sport-erp-admin/uni_modules/uni-cloud-router/readme.md deleted file mode 100644 index 0bf1eda..0000000 --- a/sport-erp-admin/uni_modules/uni-cloud-router/readme.md +++ /dev/null @@ -1 +0,0 @@ -## 文档已迁移至[uni-cloud-router 文档](https://uniapp.dcloud.net.cn/uniCloud/uni-cloud-router) \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-cloud-s2s/changelog.md b/sport-erp-admin/uni_modules/uni-cloud-s2s/changelog.md deleted file mode 100644 index 727d5b2..0000000 --- a/sport-erp-admin/uni_modules/uni-cloud-s2s/changelog.md +++ /dev/null @@ -1,2 +0,0 @@ -## 1.0.1(2023-03-02) -- 修复 方法名错误 diff --git a/sport-erp-admin/uni_modules/uni-cloud-s2s/package.json b/sport-erp-admin/uni_modules/uni-cloud-s2s/package.json deleted file mode 100644 index 339d219..0000000 --- a/sport-erp-admin/uni_modules/uni-cloud-s2s/package.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "id": "uni-cloud-s2s", - "displayName": "服务空间与服务器安全通讯模块", - "version": "1.0.1", - "description": "用于解决服务空间与服务器通讯时互相信任问题", - "keywords": [ - "安全通讯", - "服务器请求云函数", - "云函数请求服务器" -], - "repository": "", - "engines": { - "HBuilderX": "^3.1.0" - }, - "dcloudext": { - "type": "unicloud-template-function", - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "" - }, - "uni_modules": { - "dependencies": [], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y" - }, - "client": { - "Vue": { - "vue2": "u", - "vue3": "u" - }, - "App": { - "app-vue": "u", - "app-nvue": "u" - }, - "H5-mobile": { - "Safari": "u", - "Android Browser": "u", - "微信浏览器(Android)": "u", - "QQ浏览器(Android)": "u" - }, - "H5-pc": { - "Chrome": "u", - "IE": "u", - "Edge": "u", - "Firefox": "u", - "Safari": "u" - }, - "小程序": { - "微信": "u", - "阿里": "u", - "百度": "u", - "字节跳动": "u", - "QQ": "u", - "钉钉": "u", - "快手": "u", - "飞书": "u", - "京东": "u" - }, - "快应用": { - "华为": "u", - "联盟": "u" - } - } - } - } -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-cloud-s2s/readme.md b/sport-erp-admin/uni_modules/uni-cloud-s2s/readme.md deleted file mode 100644 index 3c8ed0c..0000000 --- a/sport-erp-admin/uni_modules/uni-cloud-s2s/readme.md +++ /dev/null @@ -1,3 +0,0 @@ -# uni-cloud-s2s - -文档见:[外部服务器如何与uniCloud安全通讯](https://uniapp.dcloud.net.cn/uniCloud/uni-cloud-s2s.html) \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-cloud-s2s/uniCloud/cloudfunctions/common/uni-cloud-s2s/index.js b/sport-erp-admin/uni_modules/uni-cloud-s2s/uniCloud/cloudfunctions/common/uni-cloud-s2s/index.js deleted file mode 100644 index da9a36c..0000000 --- a/sport-erp-admin/uni_modules/uni-cloud-s2s/uniCloud/cloudfunctions/common/uni-cloud-s2s/index.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("crypto"),t=require("path");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("fs");var o=s(e),n=s(t);const i="uni-cloud-s2s",r={code:5e4,message:"Config error"},c={code:51e3,message:"Access denied"};class a extends Error{constructor(e){super(e.message),this.errMsg=e.message||"",this.code=this.errCode=e.code,this.errSubject=e.subject,this.forceReturn=e.forceReturn||!1,this.cause=e.cause,Object.defineProperties(this,{message:{get(){return this.errMsg},set(e){this.errMsg=e}}})}toJSON(e=0){if(!(e>=10))return e++,{errCode:this.errCode,errMsg:this.errMsg,errSubject:this.errSubject,cause:this.cause&&this.cause.toJSON?this.cause.toJSON(e):this.cause}}}const d=Object.prototype.toString;const h=50002,u=Object.create(null);["string","boolean","number","null"].forEach((e=>{u[e]=function(t,s){if(function(e){return d.call(e).slice(8,-1).toLowerCase()}(t)!==e)return{code:h,message:`${s} is invalid`}}}));const f="Unicloud-S2s-Authorization";class g{constructor(e){const{config:t}=e||{};this.config=t;const{connectCode:s}=t||{};if(this.connectCode=s,!s||"string"!=typeof s)throw new a({subject:i,code:r.code,message:"Invalid connectCode in config"})}getHeadersValue(e={},t,s){const o=Object.keys(e||{}).find((e=>e.toLowerCase()===t.toLowerCase()));return o?e[o]:s}verifyHttpInfo(e){const t=this.getHeadersValue(e.headers,f,""),[s="",o=""]=t.split(" ");if(s.toLowerCase()==="CONNECTCODE".toLowerCase()&&o===this.config.connectCode)return!0;throw new a({subject:i,code:c.code,message:`Invalid CONNECTCODE in headers['${f}']`})}getSecureHeaders(e){return{[f]:`CONNECTCODE ${this.config.connectCode}`}}}function l(e){return function(t){const{content:s,signKey:n}=t||{};return o.default.createHash(e).update(s+"\n"+n).digest("hex")}}const p={md5:l("md5"),sha1:l("sha1"),sha256:l("md5"),"hmac-sha256":function(e){const{content:t,signKey:s}=e||{};return o.default.createHmac("sha256",s).update(t).digest("hex")}};function m(e){const{timestamp:t,data:s={},signKey:o,hashMethod:n="hmac-sha256"}=e||{},i=p[n],r=["number","string","boolean"],c=Object.keys(s).sort(),a=[];for(let e=0;ee.toLowerCase()===t.toLowerCase()));return o?e[o]:s}getHttpData(e){const t=e.httpMethod.toLowerCase(),s=this.getHttpHeaders(e),o=this.getHeadersValue(s,"Content-Type","");if("get"===t)return e.queryStringParameters;if("post"!==t)throw new a({subject:i,code:c.code,message:`Invalid http method, expected "POST" or "get", got "${t}"`});if(0===o.indexOf("application/json"))return JSON.parse(e.body);if(0===o.indexOf("application/x-www-form-urlencoded"))return require("querystring").parse(e.body);throw new a({subject:i,code:c.code,message:`Invalid content type of POST method, expected "application/json" or "application/x-www-form-urlencoded", got "${o}"`})}verifyHttpInfo(e){const t=e.headers||{},s=this.getHeadersValue(t,"Unicloud-S2s-Timestamp","0");let[o,n]=this.getHeadersValue(t,"Unicloud-S2s-Signature","").split(" ");if(o=o.toLowerCase(),o!==this.hashMethod)throw new a({subject:i,code:c.code,message:`Invalid hash method, expected "${this.hashMethod}", got "${o}"`});const r=parseInt(s),d=Date.now();if(Math.abs(d-r)>1e3*this.timeDiffTolerance)throw new a({subject:i,code:c.code,message:`Invalid timestamp, server timestamp is ${d}, ${r} exceed max timeDiffTolerance(${this.timeDiffTolerance} seconds)`});return m({timestamp:r,data:this.getHttpData(e),signKey:this.signKey,hashMethod:this.hashMethod})===n}getSecureHeaders(e){const{data:t}=e||{},s=Date.now(),o=m({timestamp:s,data:t,signKey:this.signKey,hashMethod:this.hashMethod});return{"Unicloud-S2s-Timestamp":s+"","Unicloud-S2s-Signature":this.hashMethod+" "+o}}}const y=require("uni-config-center")({pluginId:i});class b{constructor(){this.config=y.config();const e=n.default.resolve(require.resolve("uni-config-center"),i,"config.json");if(!this.config)throw new a({subject:i,code:r.code,message:`${i} config required, please check your config file: ${e}`});if("connectCode"===this.config.type)this.verifier=new g({config:this.config});else{if(!function(e){return"sign"===e.type}(this.config))throw new a({subject:i,code:r.code,message:`Invalid ${i} config, expected policy is "code" or "sign", got ${this.config.policy}`});this.verifier=new w({config:this.config})}}verifyHttpInfo(e){if(!e)throw new a({subject:i,code:c.code,message:"Access denied, httpInfo required"});return this.verifier.verifyHttpInfo(e)}getSecureHeaders(e){return this.verifier.getSecureHeaders(e)}}exports.getSecureHeaders=function(e){return(new b).getSecureHeaders(e)},exports.verifyHttpInfo=function(e){const t=(new b).verifyHttpInfo(e);if(!t)throw new a({subject:i,code:c.code,message:c.message});return t}; diff --git a/sport-erp-admin/uni_modules/uni-cloud-s2s/uniCloud/cloudfunctions/common/uni-cloud-s2s/package.json b/sport-erp-admin/uni_modules/uni-cloud-s2s/uniCloud/cloudfunctions/common/uni-cloud-s2s/package.json deleted file mode 100644 index 7f4c455..0000000 --- a/sport-erp-admin/uni_modules/uni-cloud-s2s/uniCloud/cloudfunctions/common/uni-cloud-s2s/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "uni-cloud-s2s", - "version": "1.0.1", - "description": "", - "keywords": [], - "author": "DCloud", - "main": "index.js", - "dependencies": { - "uni-config-center": "file:..\/..\/..\/..\/..\/uni-config-center\/uniCloud\/cloudfunctions\/common\/uni-config-center" - }, - "origin-plugin-dev-name": "uni-template-admin", - "origin-plugin-version": "2.5.13", - "plugin-dev-name": "uni-template-admin", - "plugin-version": "2.5.13" -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-combox/changelog.md b/sport-erp-admin/uni_modules/uni-combox/changelog.md deleted file mode 100644 index 23c2748..0000000 --- a/sport-erp-admin/uni_modules/uni-combox/changelog.md +++ /dev/null @@ -1,15 +0,0 @@ -## 1.0.1(2021-11-23) -- 优化 label、label-width 属性 -## 1.0.0(2021-11-19) -- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) -- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-combox](https://uniapp.dcloud.io/component/uniui/uni-combox) -## 0.1.0(2021-07-30) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 0.0.6(2021-05-12) -- 新增 组件示例地址 -## 0.0.5(2021-04-21) -- 优化 添加依赖 uni-icons, 导入后自动下载依赖 -## 0.0.4(2021-02-05) -- 优化 组件引用关系,通过uni_modules引用组件 -## 0.0.3(2021-02-04) -- 调整为uni_modules目录规范 diff --git a/sport-erp-admin/uni_modules/uni-combox/components/uni-combox/uni-combox.vue b/sport-erp-admin/uni_modules/uni-combox/components/uni-combox/uni-combox.vue deleted file mode 100644 index 3d70647..0000000 --- a/sport-erp-admin/uni_modules/uni-combox/components/uni-combox/uni-combox.vue +++ /dev/null @@ -1,282 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-combox/package.json b/sport-erp-admin/uni_modules/uni-combox/package.json deleted file mode 100644 index 4a05c3f..0000000 --- a/sport-erp-admin/uni_modules/uni-combox/package.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "id": "uni-combox", - "displayName": "uni-combox 组合框", - "version": "1.0.1", - "description": "可以选择也可以输入的表单项 ", - "keywords": [ - "uni-ui", - "uniui", - "combox", - "组合框", - "select" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ], - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" - }, - "uni_modules": { - "dependencies": [ - "uni-scss", - "uni-icons" - ], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "n" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y" - }, - "快应用": { - "华为": "u", - "联盟": "u" - }, - "Vue": { - "vue2": "y", - "vue3": "y" - } - } - } - } -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-combox/readme.md b/sport-erp-admin/uni_modules/uni-combox/readme.md deleted file mode 100644 index ffa2cc8..0000000 --- a/sport-erp-admin/uni_modules/uni-combox/readme.md +++ /dev/null @@ -1,11 +0,0 @@ - - -## Combox 组合框 -> **组件名:uni-combox** -> 代码块: `uCombox` - - -组合框组件。 - -### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-combox) -#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-config-center/changelog.md b/sport-erp-admin/uni_modules/uni-config-center/changelog.md deleted file mode 100644 index 57dbcb5..0000000 --- a/sport-erp-admin/uni_modules/uni-config-center/changelog.md +++ /dev/null @@ -1,6 +0,0 @@ -## 0.0.3(2022-11-11) -- 修复 config 方法获取根节点为数组格式配置时错误的转化为了对象的Bug -## 0.0.2(2021-04-16) -- 修改插件package信息 -## 0.0.1(2021-03-15) -- 初始化项目 diff --git a/sport-erp-admin/uni_modules/uni-config-center/package.json b/sport-erp-admin/uni_modules/uni-config-center/package.json deleted file mode 100644 index bace866..0000000 --- a/sport-erp-admin/uni_modules/uni-config-center/package.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "id": "uni-config-center", - "displayName": "uni-config-center", - "version": "0.0.3", - "description": "uniCloud 配置中心", - "keywords": [ - "配置", - "配置中心" -], - "repository": "", - "engines": { - "HBuilderX": "^3.1.0" - }, -"dcloudext": { - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "", - "type": "unicloud-template-function" - }, - "directories": { - "example": "../../../scripts/dist" - }, - "uni_modules": { - "dependencies": [], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y" - }, - "client": { - "App": { - "app-vue": "u", - "app-nvue": "u" - }, - "H5-mobile": { - "Safari": "u", - "Android Browser": "u", - "微信浏览器(Android)": "u", - "QQ浏览器(Android)": "u" - }, - "H5-pc": { - "Chrome": "u", - "IE": "u", - "Edge": "u", - "Firefox": "u", - "Safari": "u" - }, - "小程序": { - "微信": "u", - "阿里": "u", - "百度": "u", - "字节跳动": "u", - "QQ": "u" - }, - "快应用": { - "华为": "u", - "联盟": "u" - }, - "Vue": { - "vue2": "y", - "vue3": "u" - } - } - } - } -} diff --git a/sport-erp-admin/uni_modules/uni-config-center/readme.md b/sport-erp-admin/uni_modules/uni-config-center/readme.md deleted file mode 100644 index 03f7fc2..0000000 --- a/sport-erp-admin/uni_modules/uni-config-center/readme.md +++ /dev/null @@ -1,93 +0,0 @@ -# 为什么使用uni-config-center - -实际开发中很多插件需要配置文件才可以正常运行,如果每个插件都单独进行配置的话就会产生下面这样的目录结构 - -```bash -cloudfunctions -└─────common 公共模块 - ├─plugin-a // 插件A对应的目录 - │ ├─index.js - │ ├─config.json // plugin-a对应的配置文件 - │ └─other-file.cert // plugin-a依赖的其他文件 - └─plugin-b // plugin-b对应的目录 - ├─index.js - └─config.json // plugin-b对应的配置文件 -``` - -假设插件作者要发布一个项目模板,里面使用了很多需要配置的插件,无论是作者发布还是用户使用都是一个大麻烦。 - -uni-config-center就是用了统一管理这些配置文件的,使用uni-config-center后的目录结构如下 - -```bash -cloudfunctions -└─────common 公共模块 - ├─plugin-a // 插件A对应的目录 - │ └─index.js - ├─plugin-b // plugin-b对应的目录 - │ └─index.js - └─uni-config-center - ├─index.js // config-center入口文件 - ├─plugin-a - │ ├─config.json // plugin-a对应的配置文件 - │ └─other-file.cert // plugin-a依赖的其他文件 - └─plugin-b - └─config.json // plugin-b对应的配置文件 -``` - -使用uni-config-center后的优势 - -- 配置文件统一管理,分离插件主体和配置信息,更新插件更方便 -- 支持对config.json设置schema,插件使用者在HBuilderX内编写config.json文件时会有更好的提示(后续HBuilderX会提供支持) - -# 用法 - -在要使用uni-config-center的公共模块或云函数内引入uni-config-center依赖,请参考:[使用公共模块](https://uniapp.dcloud.net.cn/uniCloud/cf-common) - -```js -const createConfig = require('uni-config-center') - -const uniIdConfig = createConfig({ - pluginId: 'uni-id', // 插件id - defaultConfig: { // 默认配置 - tokenExpiresIn: 7200, - tokenExpiresThreshold: 600, - }, - customMerge: function(defaultConfig, userConfig) { // 自定义默认配置和用户配置的合并规则,不设置的情况侠会对默认配置和用户配置进行深度合并 - // defaudltConfig 默认配置 - // userConfig 用户配置 - return Object.assign(defaultConfig, userConfig) - } -}) - - -// 以如下配置为例 -// { -// "tokenExpiresIn": 7200, -// "passwordErrorLimit": 6, -// "bindTokenToDevice": false, -// "passwordErrorRetryTime": 3600, -// "app-plus": { -// "tokenExpiresIn": 2592000 -// }, -// "service": { -// "sms": { -// "codeExpiresIn": 300 -// } -// } -// } - -// 获取配置 -uniIdConfig.config() // 获取全部配置,注意:uni-config-center内不存在对应插件目录时会返回空对象 -uniIdConfig.config('tokenExpiresIn') // 指定键值获取配置,返回:7200 -uniIdConfig.config('service.sms.codeExpiresIn') // 指定键值获取配置,返回:300 -uniIdConfig.config('tokenExpiresThreshold', 600) // 指定键值获取配置,如果不存在则取传入的默认值,返回:600 - -// 获取文件绝对路径 -uniIdConfig.resolve('custom-token.js') // 获取uni-config-center/uni-id/custom-token.js文件的路径 - -// 引用文件(require) -uniIDConfig.requireFile('custom-token.js') // 使用require方式引用uni-config-center/uni-id/custom-token.js文件。文件不存在时返回undefined,文件内有其他错误导致require失败时会抛出错误。 - -// 判断是否包含某文件 -uniIDConfig.hasFile('custom-token.js') // 配置目录是否包含某文件,true: 文件存在,false: 文件不存在 -``` \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/index.js b/sport-erp-admin/uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/index.js deleted file mode 100644 index 00ba62f..0000000 --- a/sport-erp-admin/uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/index.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";var t=require("fs"),r=require("path");function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=e(t),o=e(r),i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var u=function(t){var r={exports:{}};return t(r,r.exports),r.exports}((function(t,r){var e="__lodash_hash_undefined__",n=9007199254740991,o="[object Arguments]",u="[object Function]",c="[object Object]",a=/^\[object .+?Constructor\]$/,f=/^(?:0|[1-9]\d*)$/,s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s[o]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s[u]=s["[object Map]"]=s["[object Number]"]=s[c]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1;var l="object"==typeof i&&i&&i.Object===Object&&i,h="object"==typeof self&&self&&self.Object===Object&&self,p=l||h||Function("return this")(),_=r&&!r.nodeType&&r,v=_&&t&&!t.nodeType&&t,d=v&&v.exports===_,y=d&&l.process,g=function(){try{var t=v&&v.require&&v.require("util").types;return t||y&&y.binding&&y.binding("util")}catch(t){}}(),b=g&&g.isTypedArray;function j(t,r,e){switch(e.length){case 0:return t.call(r);case 1:return t.call(r,e[0]);case 2:return t.call(r,e[0],e[1]);case 3:return t.call(r,e[0],e[1],e[2])}return t.apply(r,e)}var w,O,m,A=Array.prototype,z=Function.prototype,M=Object.prototype,x=p["__core-js_shared__"],C=z.toString,F=M.hasOwnProperty,U=(w=/[^.]+$/.exec(x&&x.keys&&x.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"",S=M.toString,I=C.call(Object),P=RegExp("^"+C.call(F).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),T=d?p.Buffer:void 0,q=p.Symbol,E=p.Uint8Array,$=T?T.allocUnsafe:void 0,D=(O=Object.getPrototypeOf,m=Object,function(t){return O(m(t))}),k=Object.create,B=M.propertyIsEnumerable,N=A.splice,L=q?q.toStringTag:void 0,R=function(){try{var t=vt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),G=T?T.isBuffer:void 0,V=Math.max,W=Date.now,H=vt(p,"Map"),J=vt(Object,"create"),K=function(){function t(){}return function(r){if(!xt(r))return{};if(k)return k(r);t.prototype=r;var e=new t;return t.prototype=void 0,e}}();function Q(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r-1},X.prototype.set=function(t,r){var e=this.__data__,n=nt(e,t);return n<0?(++this.size,e.push([t,r])):e[n][1]=r,this},Y.prototype.clear=function(){this.size=0,this.__data__={hash:new Q,map:new(H||X),string:new Q}},Y.prototype.delete=function(t){var r=_t(this,t).delete(t);return this.size-=r?1:0,r},Y.prototype.get=function(t){return _t(this,t).get(t)},Y.prototype.has=function(t){return _t(this,t).has(t)},Y.prototype.set=function(t,r){var e=_t(this,t),n=e.size;return e.set(t,r),this.size+=e.size==n?0:1,this},Z.prototype.clear=function(){this.__data__=new X,this.size=0},Z.prototype.delete=function(t){var r=this.__data__,e=r.delete(t);return this.size=r.size,e},Z.prototype.get=function(t){return this.__data__.get(t)},Z.prototype.has=function(t){return this.__data__.has(t)},Z.prototype.set=function(t,r){var e=this.__data__;if(e instanceof X){var n=e.__data__;if(!H||n.length<199)return n.push([t,r]),this.size=++e.size,this;e=this.__data__=new Y(n)}return e.set(t,r),this.size=e.size,this};var it,ut=function(t,r,e){for(var n=-1,o=Object(t),i=e(t),u=i.length;u--;){var c=i[it?u:++n];if(!1===r(o[c],c,o))break}return t};function ct(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":L&&L in Object(t)?function(t){var r=F.call(t,L),e=t[L];try{t[L]=void 0;var n=!0}catch(t){}var o=S.call(t);n&&(r?t[L]=e:delete t[L]);return o}(t):function(t){return S.call(t)}(t)}function at(t){return Ct(t)&&ct(t)==o}function ft(t){return!(!xt(t)||function(t){return!!U&&U in t}(t))&&(zt(t)?P:a).test(function(t){if(null!=t){try{return C.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function st(t){if(!xt(t))return function(t){var r=[];if(null!=t)for(var e in Object(t))r.push(e);return r}(t);var r=yt(t),e=[];for(var n in t)("constructor"!=n||!r&&F.call(t,n))&&e.push(n);return e}function lt(t,r,e,n,o){t!==r&&ut(r,(function(i,u){if(o||(o=new Z),xt(i))!function(t,r,e,n,o,i,u){var a=gt(t,e),f=gt(r,e),s=u.get(f);if(s)return void rt(t,e,s);var l=i?i(a,f,e+"",t,r,u):void 0,h=void 0===l;if(h){var p=Ot(f),_=!p&&At(f),v=!p&&!_&&Ft(f);l=f,p||_||v?Ot(a)?l=a:Ct(j=a)&&mt(j)?l=function(t,r){var e=-1,n=t.length;r||(r=Array(n));for(;++e-1&&t%1==0&&t0){if(++r>=800)return arguments[0]}else r=0;return t.apply(void 0,arguments)}}(pt);function jt(t,r){return t===r||t!=t&&r!=r}var wt=at(function(){return arguments}())?at:function(t){return Ct(t)&&F.call(t,"callee")&&!B.call(t,"callee")},Ot=Array.isArray;function mt(t){return null!=t&&Mt(t.length)&&!zt(t)}var At=G||function(){return!1};function zt(t){if(!xt(t))return!1;var r=ct(t);return r==u||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r}function Mt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}function xt(t){var r=typeof t;return null!=t&&("object"==r||"function"==r)}function Ct(t){return null!=t&&"object"==typeof t}var Ft=b?function(t){return function(r){return t(r)}}(b):function(t){return Ct(t)&&Mt(t.length)&&!!s[ct(t)]};function Ut(t){return mt(t)?tt(t,!0):st(t)}var St,It=(St=function(t,r,e){lt(t,r,e)},ht((function(t,r){var e=-1,n=r.length,o=n>1?r[n-1]:void 0,i=n>2?r[2]:void 0;for(o=St.length>3&&"function"==typeof o?(n--,o):void 0,i&&function(t,r,e){if(!xt(e))return!1;var n=typeof r;return!!("number"==n?mt(e)&&dt(r,e.length):"string"==n&&r in e)&&jt(e[r],t)}(r[0],r[1],i)&&(o=n<3?void 0:o,n=1),t=Object(t);++ec.call(t,r);class f{constructor({pluginId:t,defaultConfig:r={},customMerge:e,root:n}){this.pluginId=t,this.defaultConfig=r,this.pluginConfigPath=o.default.resolve(n||__dirname,t),this.customMerge=e,this._config=void 0}resolve(t){return o.default.resolve(this.pluginConfigPath,t)}hasFile(t){return n.default.existsSync(this.resolve(t))}requireFile(t){try{return require(this.resolve(t))}catch(t){if("MODULE_NOT_FOUND"===t.code)return;throw t}}_getUserConfig(){return this.requireFile("config.json")}config(t,r){if(!this._config){const t=this._getUserConfig();this._config=Array.isArray(t)?t:(this.customMerge||u)(this.defaultConfig,t)}let e=this._config;return t?function(t,r,e){if("number"==typeof r)return t[r];if("symbol"==typeof r)return a(t,r)?t[r]:e;const n="string"!=typeof(o=r)?o:o.split(".").reduce(((t,r)=>(r.split(/\[([^}]+)\]/g).forEach((r=>r&&t.push(r))),t)),[]);var o;let i=t;for(let t=0;t { - let al = [] - attrs.forEach(key => { - al.push(this[key]) - }) - return al - }, (newValue, oldValue) => { - this.paginationInternal.pageSize = this.pageSize - - let needReset = false - for (let i = 2; i < newValue.length; i++) { - if (newValue[i] != oldValue[i]) { - needReset = true - break - } - } - if (needReset) { - this.clear() - this.reset() - } - if (newValue[0] != oldValue[0]) { - this.paginationInternal.current = this.pageCurrent - } - - this._execLoadData() - }) - - // #ifdef H5 - if (process.env.NODE_ENV === 'development') { - this._debugDataList = [] - if (!window.unidev) { - window.unidev = { - clientDB: { - data: [] - } - } - } - unidev.clientDB.data.push(this._debugDataList) - } - // #endif - - // #ifdef MP-TOUTIAO - let changeName - let events = this.$scope.dataset.eventOpts - for (let i = 0; i < events.length; i++) { - let event = events[i] - if (event[0].includes('^load')) { - changeName = event[1][0][0] - } - } - if (changeName) { - let parent = this.$parent - let maxDepth = 16 - this._changeDataFunction = null - while (parent && maxDepth > 0) { - let fun = parent[changeName] - if (fun && typeof fun === 'function') { - this._changeDataFunction = fun - maxDepth = 0 - break - } - parent = parent.$parent - maxDepth--; - } - } - // #endif - - // if (!this.manual) { - // this.loadData() - // } - }, - // #ifdef H5 - beforeDestroy() { - if (process.env.NODE_ENV === 'development' && window.unidev) { - let cd = this._debugDataList - let dl = unidev.clientDB.data - for (let i = dl.length - 1; i >= 0; i--) { - if (dl[i] === cd) { - dl.splice(i, 1) - break - } - } - } - }, - // #endif - methods: { - loadData(args1, args2) { - let callback = null - if (typeof args1 === 'object') { - if (args1.clear) { - this.clear() - this.reset() - } - if (args1.current !== undefined) { - this.paginationInternal.current = args1.current - } - if (typeof args2 === 'function') { - callback = args2 - } - } else if (typeof args1 === 'function') { - callback = args1 - } - - this._execLoadData(callback) - }, - loadMore() { - if (this._isEnded) { - return - } - this._execLoadData() - }, - refresh() { - this.clear() - this._execLoadData() - }, - clear() { - this._isEnded = false - this.listData = [] - }, - reset() { - this.paginationInternal.current = 1 - }, - remove(id, { - action, - callback, - confirmTitle, - confirmContent - } = {}) { - if (!id || !id.length) { - return - } - uni.showModal({ - title: confirmTitle || '提示', - content: confirmContent || '是否删除该数据', - showCancel: true, - success: (res) => { - if (!res.confirm) { - return - } - this._execRemove(id, action, callback) - } - }) - }, - _execLoadData(callback) { - if (this.loading) { - return - } - this.loading = true - this.errorMessage = '' - - this._getExec().then((res) => { - this.loading = false - const { - data, - count - } = res.result - this._isEnded = data.length < this.pageSize - - callback && callback(data, this._isEnded) - this._dispatchEvent(events.load, data) - - if (this.getone) { - this.listData = data.length ? data[0] : undefined - } else if (this.pageData === pageMode.add) { - this.listData.push(...data) - if (this.listData.length) { - this.paginationInternal.current++ - } - } else if (this.pageData === pageMode.replace) { - this.listData = data - this.paginationInternal.count = count - } - - // #ifdef H5 - if (process.env.NODE_ENV === 'development') { - this._debugDataList.length = 0 - this._debugDataList.push(...JSON.parse(JSON.stringify(this.listData))) - } - // #endif - }).catch((err) => { - this.loading = false - this.errorMessage = err - callback && callback() - this.$emit(events.error, err) - }) - }, - _getExec() { - let exec = this.db - if (this.action) { - exec = exec.action(this.action) - } - - exec = exec.collection(this.collection) - - if (!(!this.where || !Object.keys(this.where).length)) { - exec = exec.where(this.where) - } - if (this.field) { - exec = exec.field(this.field) - } - if (this.orderby) { - exec = exec.orderBy(this.orderby) - } - - const { - current, - size - } = this.paginationInternal - exec = exec.skip(size * (current - 1)).limit(size).get({ - getCount: this.getcount - }) - - return exec - }, - _execRemove(id, action, callback) { - if (!this.collection || !id) { - return - } - - const ids = Array.isArray(id) ? id : [id] - if (!ids.length) { - return - } - - uni.showLoading({ - mask: true - }) - - let exec = this.db - if (action) { - exec = exec.action(action) - } - - exec.collection(this.collection).where({ - _id: dbCmd.in(ids) - }).remove().then((res) => { - callback && callback(res.result) - if (this.pageData === pageMode.replace) { - this.refresh() - } else { - this.removeData(ids) - } - }).catch((err) => { - uni.showModal({ - content: err.message, - showCancel: false - }) - }).finally(() => { - uni.hideLoading() - }) - }, - removeData(ids) { - let il = ids.slice(0) - let dl = this.listData - for (let i = dl.length - 1; i >= 0; i--) { - let index = il.indexOf(dl[i]._id) - if (index >= 0) { - dl.splice(i, 1) - il.splice(index, 1) - } - } - }, - _dispatchEvent(type, data) { - if (this._changeDataFunction) { - this._changeDataFunction(data, this._isEnded) - } else { - this.$emit(type, data, this._isEnded) - } - } - } -} diff --git a/sport-erp-admin/uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue b/sport-erp-admin/uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue deleted file mode 100644 index 4da7bbe..0000000 --- a/sport-erp-admin/uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue +++ /dev/null @@ -1,853 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-data-checkbox/package.json b/sport-erp-admin/uni_modules/uni-data-checkbox/package.json deleted file mode 100644 index f823e8b..0000000 --- a/sport-erp-admin/uni_modules/uni-data-checkbox/package.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "id": "uni-data-checkbox", - "displayName": "uni-data-checkbox 数据选择器", - "version": "1.0.6", - "description": "通过数据驱动的单选框和复选框", - "keywords": [ - "uni-ui", - "checkbox", - "单选", - "多选", - "单选多选" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "^3.1.1" - }, - "directories": { - "example": "../../temps/example_temps" - }, -"dcloudext": { - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", - "type": "component-vue" - }, - "uni_modules": { - "dependencies": ["uni-load-more","uni-scss"], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y", - "alipay": "n" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "y", - "app-harmony": "u", - "app-uvue": "u" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y" - }, - "快应用": { - "华为": "u", - "联盟": "u" - }, - "Vue": { - "vue2": "y", - "vue3": "y" - } - } - } - } -} diff --git a/sport-erp-admin/uni_modules/uni-data-checkbox/readme.md b/sport-erp-admin/uni_modules/uni-data-checkbox/readme.md deleted file mode 100644 index 6eb253d..0000000 --- a/sport-erp-admin/uni_modules/uni-data-checkbox/readme.md +++ /dev/null @@ -1,18 +0,0 @@ - - -## DataCheckbox 数据驱动的单选复选框 -> **组件名:uni-data-checkbox** -> 代码块: `uDataCheckbox` - - -本组件是基于uni-app基础组件checkbox的封装。本组件要解决问题包括: - -1. 数据绑定型组件:给本组件绑定一个data,会自动渲染一组候选内容。再以往,开发者需要编写不少代码实现类似功能 -2. 自动的表单校验:组件绑定了data,且符合[uni-forms](https://ext.dcloud.net.cn/plugin?id=2773)组件的表单校验规范,搭配使用会自动实现表单校验 -3. 本组件合并了单选多选 -4. 本组件有若干风格选择,如普通的单选多选框、并列button风格、tag风格。开发者可以快速选择需要的风格。但作为一个封装组件,样式代码虽然不用自己写了,却会牺牲一定的样式自定义性 - -在uniCloud开发中,`DB Schema`中配置了enum枚举等类型后,在web控制台的[自动生成表单](https://uniapp.dcloud.io/uniCloud/schema?id=autocode)功能中,会自动生成``uni-data-checkbox``组件并绑定好data - -### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-data-checkbox) -#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-data-picker/changelog.md b/sport-erp-admin/uni_modules/uni-data-picker/changelog.md deleted file mode 100644 index 8aaad24..0000000 --- a/sport-erp-admin/uni_modules/uni-data-picker/changelog.md +++ /dev/null @@ -1,77 +0,0 @@ -## 2.0.0(2023-12-14) -- 新增 支持 uni-app-x -## 1.1.2(2023-04-11) -- 修复 更改 modelValue 报错的 bug -- 修复 v-for 未使用 key 值控制台 warning -## 1.1.1(2023-02-21) -- 修复代码合并时引发 value 属性为空时不渲染数据的问题 -## 1.1.0(2023-02-15) -- 修复 localdata 不支持动态更新的bug -## 1.0.9(2023-02-15) -- 修复 localdata 不支持动态更新的bug -## 1.0.8(2022-09-16) -- 可以使用 uni-scss 控制主题色 -## 1.0.7(2022-07-06) -- 优化 pc端图标位置不正确的问题 -## 1.0.6(2022-07-05) -- 优化 显示样式 -## 1.0.5(2022-07-04) -- 修复 uni-data-picker 在 uni-forms-item 中宽度不正确的bug -## 1.0.4(2022-04-19) -- 修复 字节小程序 本地数据无法选择下一级的Bug -## 1.0.3(2022-02-25) -- 修复 nvue 不支持的 v-show 的 bug -## 1.0.2(2022-02-25) -- 修复 条件编译 nvue 不支持的 css 样式 -## 1.0.1(2021-11-23) -- 修复 由上个版本引发的map、v-model等属性不生效的bug -## 1.0.0(2021-11-19) -- 优化 组件 UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) -- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-data-picker](https://uniapp.dcloud.io/component/uniui/uni-data-picker) -## 0.4.9(2021-10-28) -- 修复 VUE2 v-model 概率无效的 bug -## 0.4.8(2021-10-27) -- 修复 v-model 概率无效的 bug -## 0.4.7(2021-10-25) -- 新增 属性 spaceInfo 服务空间配置 HBuilderX 3.2.11+ -- 修复 树型 uniCloud 数据类型为 int 时报错的 bug -## 0.4.6(2021-10-19) -- 修复 非 VUE3 v-model 为 0 时无法选中的 bug -## 0.4.5(2021-09-26) -- 新增 清除已选项的功能(通过 clearIcon 属性配置是否显示按钮),同时提供 clear 方法以供调用,二者等效 -- 修复 readonly 为 true 时报错的 bug -## 0.4.4(2021-09-26) -- 修复 上一版本造成的 map 属性失效的 bug -- 新增 ellipsis 属性,支持配置 tab 选项长度过长时是否自动省略 -## 0.4.3(2021-09-24) -- 修复 某些情况下级联未触发的 bug -## 0.4.2(2021-09-23) -- 新增 提供 show 和 hide 方法,开发者可以通过 ref 调用 -- 新增 选项内容过长自动添加省略号 -## 0.4.1(2021-09-15) -- 新增 map 属性 字段映射,将 text/value 映射到数据中的其他字段 -## 0.4.0(2021-07-13) -- 组件兼容 vue3,如何创建 vue3 项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 0.3.5(2021-06-04) -- 修复 无法加载云端数据的问题 -## 0.3.4(2021-05-28) -- 修复 v-model 无效问题 -- 修复 loaddata 为空数据组时加载时间过长问题 -- 修复 上个版本引出的本地数据无法选择带有 children 的 2 级节点 -## 0.3.3(2021-05-12) -- 新增 组件示例地址 -## 0.3.2(2021-04-22) -- 修复 非树形数据有 where 属性查询报错的问题 -## 0.3.1(2021-04-15) -- 修复 本地数据概率无法回显时问题 -## 0.3.0(2021-04-07) -- 新增 支持云端非树形表结构数据 -- 修复 根节点 parent_field 字段等于 null 时选择界面错乱问题 -## 0.2.0(2021-03-15) -- 修复 nodeclick、popupopened、popupclosed 事件无法触发的问题 -## 0.1.9(2021-03-09) -- 修复 微信小程序某些情况下无法选择的问题 -## 0.1.8(2021-02-05) -- 优化 部分样式在 nvue 上的兼容表现 -## 0.1.7(2021-02-05) -- 调整为 uni_modules 目录规范 diff --git a/sport-erp-admin/uni_modules/uni-data-picker/components/uni-data-picker/keypress.js b/sport-erp-admin/uni_modules/uni-data-picker/components/uni-data-picker/keypress.js deleted file mode 100644 index 6ef26a2..0000000 --- a/sport-erp-admin/uni_modules/uni-data-picker/components/uni-data-picker/keypress.js +++ /dev/null @@ -1,45 +0,0 @@ -// #ifdef H5 -export default { - name: 'Keypress', - props: { - disable: { - type: Boolean, - default: false - } - }, - mounted () { - const keyNames = { - esc: ['Esc', 'Escape'], - tab: 'Tab', - enter: 'Enter', - space: [' ', 'Spacebar'], - up: ['Up', 'ArrowUp'], - left: ['Left', 'ArrowLeft'], - right: ['Right', 'ArrowRight'], - down: ['Down', 'ArrowDown'], - delete: ['Backspace', 'Delete', 'Del'] - } - const listener = ($event) => { - if (this.disable) { - return - } - const keyName = Object.keys(keyNames).find(key => { - const keyName = $event.key - const value = keyNames[key] - return value === keyName || (Array.isArray(value) && value.includes(keyName)) - }) - if (keyName) { - // 避免和其他按键事件冲突 - setTimeout(() => { - this.$emit(keyName, {}) - }, 0) - } - } - document.addEventListener('keyup', listener) - this.$once('hook:beforeDestroy', () => { - document.removeEventListener('keyup', listener) - }) - }, - render: () => {} -} -// #endif diff --git a/sport-erp-admin/uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.uvue b/sport-erp-admin/uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.uvue deleted file mode 100644 index 82031e1..0000000 --- a/sport-erp-admin/uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.uvue +++ /dev/null @@ -1,380 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue b/sport-erp-admin/uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue deleted file mode 100644 index 179a4e0..0000000 --- a/sport-erp-admin/uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue +++ /dev/null @@ -1,551 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-data-picker/components/uni-data-pickerview/loading.uts b/sport-erp-admin/uni_modules/uni-data-picker/components/uni-data-pickerview/loading.uts deleted file mode 100644 index baa0dff..0000000 --- a/sport-erp-admin/uni_modules/uni-data-picker/components/uni-data-pickerview/loading.uts +++ /dev/null @@ -1 +0,0 @@ -export const imgbase : string = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QzlBMzU3OTlEOUM0MTFFOUI0NTZDNERBQURBQzI4RkUiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QzlBMzU3OUFEOUM0MTFFOUI0NTZDNERBQURBQzI4RkUiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpDOUEzNTc5N0Q5QzQxMUU5QjQ1NkM0REFBREFDMjhGRSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpDOUEzNTc5OEQ5QzQxMUU5QjQ1NkM0REFBREFDMjhGRSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pt+ALSwAAA6CSURBVHja1FsLkFZVHb98LM+F5bHL8khA1iSeiyQBCRM+YGqKUnnJTDLGI0BGZlKDIU2MMglUiDApEZvSsZnQtBRJtKwQNKQMFYeRDR10WOLd8ljYXdh+v8v5fR3Od+797t1dnOnO/Ofce77z+J//+b/P+ZqtXbs2sJ9MJhNUV1cHJ06cCJo3bx7EPc2aNcvpy7pWrVoF+/fvDyoqKoI2bdoE9fX1F7TjN8a+EXBn/fkfvw942Tf+wYMHg9mzZwfjxo0LDhw4EPa1x2MbFw/fOGfPng1qa2tzcCkILsLDydq2bRsunpOTMM7TD/W/tZDZhPdeKD+yGxHhdu3aBV27dg3OnDlzMVANMheLAO3btw8KCwuDmpoaX5OxbgUIMEq7K8IcPnw4KCsrC/r37x8cP378/4cAXAB3vqSkJMuiDhTkw+XcuXNhOWbMmKBly5YhUT8xArhyFvP0BfwRsAuwxJZJsm/nzp2DTp06he/OU+cZ64K6o0ePBkOHDg2GDx8e6gEbJ5Q/NHNuAJQ1hgBeHUDlR7nVTkY8rQAvAi4z34vR/mPs1FoRsaCgIJThI0eOBC1atEiFGGV+5MiRoS45efJkqFjJFXV1dQuA012m2WcwTw98fy6CqBdsaiIO4CScrGPHjvk4odhavPquRtFWXEC25VgkREKOCh/qDSq+vn37htzD/mZTOmOc5U7zKzBPEedygWshcDyWvs30igAbU+6oyMgJBCFhwQE0fccxN60Ay9iebbjoDh06hMowjQxT4fXq1SskArmHZpkArvixp/kWzHdMeArExSJEaiXIjjRjRJ4DaAGWpibLzXN3Fm1vA5teBgh3j1Rv3bp1YgKwPdmf2p9zcyNYYgPKMfY0T5f5nNYdw158nJ8QawW4CLKwiOBSEgO/hok2eBydR+3dYH+PLxA5J8Vv0KBBwenTp0P2JWAx6+yFEBfs8lMY+y0SWMBNI9E4ThKi58VKTg3FQZS1RQF1cz27eC0QHMu+3E0SkUowjhVt5VdaWhp07949ZHv2Qd1EjDXM2cla1M0nl3GxAs3J9yREzyTdFVKVFOaE9qRA8GM0WebRuo9JGZKA7Mv2SeS/Z8+eoQ9BArMfFrLGo6jvxbhHbJZnKX2Rzz1O7QhJJ9Cs2ZMaWIyq/zhdeqPNfIoHd58clIQD+JSXl4dKlyIAuBdVXZwFVWKspSSoxE++h8x4k3uCnEhE4I5KwRiFWGOU0QWKiCYLbdoRMRKAu2kQ9vkfLU6dOhX06NEjlH+yMRZSinnuyWnYosVcji8CEA/6Cg2JF+IIUBqnGKUTCNwtwBN4f89RiK1R96DEgO2o0NDmtEdvVFdVVYV+P3UAPUEs6GFwV3PHmXkD4vh74iDFJysVI/MlaQhwKeBNTLYX5VuA8T4/gZxA4MRGFxDB6R7OmYPfyykGRJbyie+XnGYnQIC/coH9+vULiYrxrkL9ZA9+0ykaHIfEpM7ge8TiJ2CsHYwyMfafAF1yCGBHYIbCVDjDjKt7BeB51D+LgQa6OkG7IDYEEtvQ7lnXLKLtLdLuJBpE4gPUXcW2+PkZwOex+4cGDhwYDBkyRL7/HFcEwUGPo/8uWRUpYnfxGHco8HkewLHLyYmAawAPuIFZxhOpDfJQ8gbUv41yORAptMWBNr6oqMhWird5+u+iHmBb2nhjDV7HWBNQTgK8y11l5NetWzc5ULscAtSj7nbNI0skhWeUZCc0W4nyH/jO4Vz0u1IeYhbk4AiwM6tjxIWByHsoZ9qcIBPJd/y+DwPfBESOmCa/QF3WiZHucLlEDpNxcNhmheEOPgdQNx6/VZFQzFZ5TN08AHXQt2Ii3EdyFuUsPtTcGPhW5iMiCNELvz+Gdn9huG4HUJaW/w3g0wxV0XaG7arG2WeKiUWYM4Y7GO5ezshTARbbWGw/DvXkpp/ivVvE0JVoMxN4rpGzJMhE5Pl+xlATsDIqikP9F9D2z3h9nOksEUFhK+qO4rcPkoalMQ/HqJLIyb3F3JdjrCcw1yZ8joyJLR5gCo54etlag7qIoeNh1N1BRYj3DTFJ0elotxPlVzkGuYAmL0VSJVGAJA41c4Z6A3BzTLfn0HYwYKEI6CUAMzZEWvLsIcQOo1AmmyyM72nHJCfYsogflGV6jEk9vyQZXSuq6w4c16NsGcGZbwOPr+H1RkOk2LEzjNepxQkihHSCQ4ynAYNRx2zMKV92CQMWqj8J0BRE8EShxRFN6YrfCRhC0x3r/Zm4IbQCcmJoV0kMamllccR6FjHqUC5F2R/wS2dcymOlfAKOS4KmzQb5cpNC2MC7JhVn5wjXoJ44rYhLh8n0eXOCorJxa7POjbSlCGVczr34/RsAmrcvo9s+wGp3tzVhntxiXiJ4nvEYb4FJkf0O8HocAePmLvCxnL0AORraVekJk6TYjDabRVXfRE2lCN1h6ZQRN1+InUbsCpKwoBZHh0dODN9JBCUffItXxEavTQkUtnfTVAplCWL3JISz29h4NjotnuSsQKJCk8dF+kJR6RARjrqFVmfPnj3ZbK8cIJ0msd6jgHPGtfVTQ8VLmlvh4mct9sobRmPic0DyDQQnx/NlfYUgyz59+oScsH379pAwXABD32nTpoUHIToESeI5mnbE/UqDdyLcafEBf2MCqgC7NwxIbMREJQ0g4D4sfJwnD+AmRrII05cfMWJE+L1169bQr+fip06dGp4oJ83lmYd5wj/EmMa4TaHivo4EeCguYZBnkB5g2aWA69OIEnUHOaGysjIYMGBAMGnSpODYsWPZwCpFmm4lNq+4gSLQA7jcX8DwtjEyRC8wjabnXEx9kfWnTJkSJkAo90xpJVV+FmcVNeYAF5zWngS4C4O91MBxmAv8blLEpbjI5sz9MTdAhcgkCT1RO8mZkAjfiYpTEvStAS53Uw1vAiUGgZ3GpuQEYvoiBqlIan7kSDHnTwJQFNiPu0+5VxCVYhcZIjNrdXUDdp+Eq5AZ3Gkg8QAyVZRZIk4Tl4QAbF9cXJxNYZMAtAokgs4BrNxEpCtteXg7DDTMDKYNSuQdKsnJBek7HxewvxaosWxLYXtw+cJp18217wql4aKCfBNoEu0O5VU+PhctJ0YeXD4C6JQpyrlpSLTojpGGGN5YwNziChdIZLk4lvLcFJ9jMX3QdiImY9bmGQU+TRUL5CHITTRlgF8D9ouD1MfmLoEPl5xokIumZ2cfgMpHt47IW9N64Hsh7wQYYjyIugWuF5fCqYncXRd5vPMWyizzvhi/32+nvG0dZc9vR6fZOu0md5e+uC408FvKSIOZwXlGvxPv95izA2Vtvg1xKFWARI+vMX66HUhpQQb643uW1bSjuTWyw2SBvDrBvjFic1eGGlz5esq3ko9uSIlBRqPuFcCv8F4WIcN12nVaBd0SaYwI6PDDImR11JkqgHcPmQssjxIn6bUshygDFJUTxPMpHk+jfjPgupgdnYV2R/g7xSjtpah8RJBewhwf0gGK6XI92u4wXFEU40afJ4DN4h5LcAd+40HI3JgJecuT0c062W0i2hQJUTcxan3/CMW1PF2K6bbA+Daz4xRs1D3Br1Cm0OihKCqizW78/nXAF/G5TXrEcVzaNMH6CyMswqsAHqDyDLEyou8lwOXnKF8DjI6KjV3KzMBiXkDH8ij/H214J5A596ekrZ3F0zXlWeL7+P5eUrNo3/QwC15uxthuzidy7DzKRwEDaAViiDgKbTbz7CJnzo0bN7pIfIiid8SuPwn25o3QCmpnyjlZkyxPP8EomCJzrGb7GJMx7tNsq4MT2xMUYaiErZOluTzKsnz3gwCeCZyVRZJfYplNEokEjwrPtxlxjeYAk+F1F74VAzPxQRNYYdtpOUvWs8J1sGhBJMNsb7igN8plJs1eSmLIhLKE4rvaCX27gOhLpLOsIzJ7qn/i+wZzcvSOZ23/du8TZjwV8zHIXoP4R3ifBxiFz1dcVpa3aPntPE+c6TmIWE9EtcMmAcPdWAhYhAXxcLOQi9L1WhD1Sc8p1d2oL7XGiRKp8F4A2i8K/nfI+y/gsTDJ/YC/8+AD5Uh04KHiGl+cIFPnBDDrPMjwRGkLXyxO4VGbfQWnDH2v0bVWE3C9QOXlepbgjEfIJQI6XDG3z5ahD9cw2pS78ipB85wyScNTvsVzlzzhL8/jRrnmVjfFJK/m3m4nj9vbgQTguT8XZTjsm672R5uJKEaQmBI/c58gyus8ZDagLpEVSJBIyHp4jn++xqPV71OgQgJYEWOtZ/haxRtKmWOBu8xdBLftWltsY84zE6WIEy/eIOWL+BaayMx+KHtL7EAkqdNDLiEXmEMUHniedtJqg9HmZtfvt26vNi0BdG3Ft3g8ZOf7PAu59TxtzivLNIekyi+wD1i8CuUiD9FXAa8C+/xS3JPmZnomyc7H+fb4/Se0bk41Fel621r4cgVxbq91V4jVqwB7HTe2M7jgB+QWHavZkDRPmZcASoZEmBx6i75bGjPcMdL4/VKGFAGWZkGzPG0XAbdL9A81G5LOmUnC9hHKJeO7dcUMjblSl12867ElFTtaGl20xvvLGPdVz/8TVuU7y0x1PG7vtNg24oz9Uo/Z412++VFWI7Fcog9tu9Lm6gvRmIPv9x1xmQAu6RDkXtbOtlGEmpgD5Nvnyc0dcv0EE6cfdi1HmhMf9wDF3k3gtRvEedhxjpgfqPb9PU9iEJHnyOUA7bQUXh6kq/D7l2iTjWv7XOD530BDr8jIrus+srXjt4MzumJMHuTsBa63YKE1+RR5lBjEikCCnWKWiHdzOgKO+nRIBAF88za/IFmJ3eMZov4CYxGBabcpGL8EYx+SeMXJeRwHNsV/h+vdxeuhEpN3ZyNY78Gm2fknJxVGhyjixPiQvVkNzT1elD9Py/aTAL64Hb9vcYmC9zfdXdT/C1LeGbg4rnBaAihDFJH12W5ulfNCNe/xTsP3bp8ikzJs5BF+5PNfAQYAPaseTdsEcaYAAAAASUVORK5CYII=' \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-picker.js b/sport-erp-admin/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-picker.js deleted file mode 100644 index cfae22a..0000000 --- a/sport-erp-admin/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-picker.js +++ /dev/null @@ -1,622 +0,0 @@ -export default { - props: { - localdata: { - type: [Array, Object], - default () { - return [] - } - }, - spaceInfo: { - type: Object, - default () { - return {} - } - }, - collection: { - type: String, - default: '' - }, - action: { - type: String, - default: '' - }, - field: { - type: String, - default: '' - }, - orderby: { - type: String, - default: '' - }, - where: { - type: [String, Object], - default: '' - }, - pageData: { - type: String, - default: 'add' - }, - pageCurrent: { - type: Number, - default: 1 - }, - pageSize: { - type: Number, - default: 500 - }, - getcount: { - type: [Boolean, String], - default: false - }, - getone: { - type: [Boolean, String], - default: false - }, - gettree: { - type: [Boolean, String], - default: false - }, - manual: { - type: Boolean, - default: false - }, - value: { - type: [Array, String, Number], - default () { - return [] - } - }, - modelValue: { - type: [Array, String, Number], - default () { - return [] - } - }, - preload: { - type: Boolean, - default: false - }, - stepSearh: { - type: Boolean, - default: true - }, - selfField: { - type: String, - default: '' - }, - parentField: { - type: String, - default: '' - }, - multiple: { - type: Boolean, - default: false - }, - map: { - type: Object, - default () { - return { - text: "text", - value: "value" - } - } - } - }, - data() { - return { - loading: false, - errorMessage: '', - loadMore: { - contentdown: '', - contentrefresh: '', - contentnomore: '' - }, - dataList: [], - selected: [], - selectedIndex: 0, - page: { - current: this.pageCurrent, - size: this.pageSize, - count: 0 - } - } - }, - computed: { - isLocalData() { - return !this.collection.length; - }, - isCloudData() { - return this.collection.length > 0; - }, - isCloudDataList() { - return (this.isCloudData && (!this.parentField && !this.selfField)); - }, - isCloudDataTree() { - return (this.isCloudData && this.parentField && this.selfField); - }, - dataValue() { - let isModelValue = Array.isArray(this.modelValue) ? (this.modelValue.length > 0) : (this.modelValue !== null || - this.modelValue !== undefined); - return isModelValue ? this.modelValue : this.value; - }, - hasValue() { - if (typeof this.dataValue === 'number') { - return true - } - return (this.dataValue != null) && (this.dataValue.length > 0) - } - }, - created() { - this.$watch(() => { - var al = []; - ['pageCurrent', - 'pageSize', - 'spaceInfo', - 'value', - 'modelValue', - 'localdata', - 'collection', - 'action', - 'field', - 'orderby', - 'where', - 'getont', - 'getcount', - 'gettree' - ].forEach(key => { - al.push(this[key]) - }); - return al - }, (newValue, oldValue) => { - let needReset = false - for (let i = 2; i < newValue.length; i++) { - if (newValue[i] != oldValue[i]) { - needReset = true - break - } - } - if (newValue[0] != oldValue[0]) { - this.page.current = this.pageCurrent - } - this.page.size = this.pageSize - - this.onPropsChange() - }) - this._treeData = [] - }, - methods: { - onPropsChange() { - this._treeData = []; - }, - - // 填充 pickview 数据 - async loadData() { - if (this.isLocalData) { - this.loadLocalData(); - } else if (this.isCloudDataList) { - this.loadCloudDataList(); - } else if (this.isCloudDataTree) { - this.loadCloudDataTree(); - } - }, - - // 加载本地数据 - async loadLocalData() { - this._treeData = []; - this._extractTree(this.localdata, this._treeData); - - let inputValue = this.dataValue; - if (inputValue === undefined) { - return; - } - - if (Array.isArray(inputValue)) { - inputValue = inputValue[inputValue.length - 1]; - if (typeof inputValue === 'object' && inputValue[this.map.value]) { - inputValue = inputValue[this.map.value]; - } - } - - this.selected = this._findNodePath(inputValue, this.localdata); - }, - - // 加载 Cloud 数据 (单列) - async loadCloudDataList() { - if (this.loading) { - return; - } - this.loading = true; - - try { - let response = await this.getCommand(); - let responseData = response.result.data; - - this._treeData = responseData; - - this._updateBindData(); - this._updateSelected(); - - this.onDataChange(); - } catch (e) { - this.errorMessage = e; - } finally { - this.loading = false; - } - }, - - // 加载 Cloud 数据 (树形) - async loadCloudDataTree() { - if (this.loading) { - return; - } - this.loading = true; - - try { - let commandOptions = { - field: this._cloudDataPostField(), - where: this._cloudDataTreeWhere() - }; - if (this.gettree) { - commandOptions.startwith = `${this.selfField}=='${this.dataValue}'`; - } - - let response = await this.getCommand(commandOptions); - let responseData = response.result.data; - - this._treeData = responseData; - this._updateBindData(); - this._updateSelected(); - - this.onDataChange(); - } catch (e) { - this.errorMessage = e; - } finally { - this.loading = false; - } - }, - - // 加载 Cloud 数据 (节点) - async loadCloudDataNode(callback) { - if (this.loading) { - return; - } - this.loading = true; - - try { - let commandOptions = { - field: this._cloudDataPostField(), - where: this._cloudDataNodeWhere() - }; - - let response = await this.getCommand(commandOptions); - let responseData = response.result.data; - - callback(responseData); - } catch (e) { - this.errorMessage = e; - } finally { - this.loading = false; - } - }, - - // 回显 Cloud 数据 - getCloudDataValue() { - if (this.isCloudDataList) { - return this.getCloudDataListValue(); - } - - if (this.isCloudDataTree) { - return this.getCloudDataTreeValue(); - } - }, - - // 回显 Cloud 数据 (单列) - getCloudDataListValue() { - // 根据 field's as value标识匹配 where 条件 - let where = []; - let whereField = this._getForeignKeyByField(); - if (whereField) { - where.push(`${whereField} == '${this.dataValue}'`) - } - - where = where.join(' || '); - - if (this.where) { - where = `(${this.where}) && (${where})` - } - - return this.getCommand({ - field: this._cloudDataPostField(), - where - }).then((res) => { - this.selected = res.result.data; - return res.result.data; - }); - }, - - // 回显 Cloud 数据 (树形) - getCloudDataTreeValue() { - return this.getCommand({ - field: this._cloudDataPostField(), - getTreePath: { - startWith: `${this.selfField}=='${this.dataValue}'` - } - }).then((res) => { - let treePath = []; - this._extractTreePath(res.result.data, treePath); - this.selected = treePath; - return treePath; - }); - }, - - getCommand(options = {}) { - /* eslint-disable no-undef */ - let db = uniCloud.database(this.spaceInfo) - - const action = options.action || this.action - if (action) { - db = db.action(action) - } - - const collection = options.collection || this.collection - db = db.collection(collection) - - const where = options.where || this.where - if (!(!where || !Object.keys(where).length)) { - db = db.where(where) - } - - const field = options.field || this.field - if (field) { - db = db.field(field) - } - - const orderby = options.orderby || this.orderby - if (orderby) { - db = db.orderBy(orderby) - } - - const current = options.pageCurrent !== undefined ? options.pageCurrent : this.page.current - const size = options.pageSize !== undefined ? options.pageSize : this.page.size - const getCount = options.getcount !== undefined ? options.getcount : this.getcount - const getTree = options.gettree !== undefined ? options.gettree : this.gettree - - const getOptions = { - getCount, - getTree - } - if (options.getTreePath) { - getOptions.getTreePath = options.getTreePath - } - - db = db.skip(size * (current - 1)).limit(size).get(getOptions) - - return db - }, - - _cloudDataPostField() { - let fields = [this.field]; - if (this.parentField) { - fields.push(`${this.parentField} as parent_value`); - } - return fields.join(','); - }, - - _cloudDataTreeWhere() { - let result = [] - let selected = this.selected - let parentField = this.parentField - if (parentField) { - result.push(`${parentField} == null || ${parentField} == ""`) - } - if (selected.length) { - for (var i = 0; i < selected.length - 1; i++) { - result.push(`${parentField} == '${selected[i].value}'`) - } - } - - let where = [] - if (this.where) { - where.push(`(${this.where})`) - } - - if (result.length) { - where.push(`(${result.join(' || ')})`) - } - - return where.join(' && ') - }, - - _cloudDataNodeWhere() { - let where = [] - let selected = this.selected; - if (selected.length) { - where.push(`${this.parentField} == '${selected[selected.length - 1].value}'`); - } - - where = where.join(' || '); - - if (this.where) { - return `(${this.where}) && (${where})` - } - - return where - }, - - _getWhereByForeignKey() { - let result = [] - let whereField = this._getForeignKeyByField(); - if (whereField) { - result.push(`${whereField} == '${this.dataValue}'`) - } - - if (this.where) { - return `(${this.where}) && (${result.join(' || ')})` - } - - return result.join(' || ') - }, - - _getForeignKeyByField() { - let fields = this.field.split(','); - let whereField = null; - for (let i = 0; i < fields.length; i++) { - const items = fields[i].split('as'); - if (items.length < 2) { - continue; - } - if (items[1].trim() === 'value') { - whereField = items[0].trim(); - break; - } - } - return whereField; - }, - - _updateBindData(node) { - const { - dataList, - hasNodes - } = this._filterData(this._treeData, this.selected) - - let isleaf = this._stepSearh === false && !hasNodes - - if (node) { - node.isleaf = isleaf - } - - this.dataList = dataList - this.selectedIndex = dataList.length - 1 - - if (!isleaf && this.selected.length < dataList.length) { - this.selected.push({ - value: null, - text: "请选择" - }) - } - - return { - isleaf, - hasNodes - } - }, - - _updateSelected() { - let dl = this.dataList - let sl = this.selected - let textField = this.map.text - let valueField = this.map.value - for (let i = 0; i < sl.length; i++) { - let value = sl[i].value - let dl2 = dl[i] - for (let j = 0; j < dl2.length; j++) { - let item2 = dl2[j] - if (item2[valueField] === value) { - sl[i].text = item2[textField] - break - } - } - } - }, - - _filterData(data, paths) { - let dataList = [] - let hasNodes = true - - dataList.push(data.filter((item) => { - return (item.parent_value === null || item.parent_value === undefined || item.parent_value === '') - })) - for (let i = 0; i < paths.length; i++) { - let value = paths[i].value - let nodes = data.filter((item) => { - return item.parent_value === value - }) - - if (nodes.length) { - dataList.push(nodes) - } else { - hasNodes = false - } - } - - return { - dataList, - hasNodes - } - }, - - _extractTree(nodes, result, parent_value) { - let list = result || [] - let valueField = this.map.value - for (let i = 0; i < nodes.length; i++) { - let node = nodes[i] - - let child = {} - for (let key in node) { - if (key !== 'children') { - child[key] = node[key] - } - } - if (parent_value !== null && parent_value !== undefined && parent_value !== '') { - child.parent_value = parent_value - } - result.push(child) - - let children = node.children - if (children) { - this._extractTree(children, result, node[valueField]) - } - } - }, - - _extractTreePath(nodes, result) { - let list = result || [] - for (let i = 0; i < nodes.length; i++) { - let node = nodes[i] - - let child = {} - for (let key in node) { - if (key !== 'children') { - child[key] = node[key] - } - } - result.push(child) - - let children = node.children - if (children) { - this._extractTreePath(children, result) - } - } - }, - - _findNodePath(key, nodes, path = []) { - let textField = this.map.text - let valueField = this.map.value - for (let i = 0; i < nodes.length; i++) { - let node = nodes[i] - let children = node.children - let text = node[textField] - let value = node[valueField] - - path.push({ - value, - text - }) - - if (value === key) { - return path - } - - if (children) { - const p = this._findNodePath(key, children, path) - if (p.length) { - return p - } - } - - path.pop() - } - return [] - } - } -} diff --git a/sport-erp-admin/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-picker.uts b/sport-erp-admin/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-picker.uts deleted file mode 100644 index 372795d..0000000 --- a/sport-erp-admin/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-picker.uts +++ /dev/null @@ -1,693 +0,0 @@ -export type PaginationType = { - current : number, - size : number, - count : number -} - -export type LoadMoreType = { - contentdown : string, - contentrefresh : string, - contentnomore : string -} - -export type SelectedItemType = { - name : string, - value : string, -} - -export type GetCommandOptions = { - collection ?: UTSJSONObject, - field ?: string, - orderby ?: string, - where ?: any, - pageData ?: string, - pageCurrent ?: number, - pageSize ?: number, - getCount ?: boolean, - getTree ?: any, - getTreePath ?: UTSJSONObject, - startwith ?: string, - limitlevel ?: number, - groupby ?: string, - groupField ?: string, - distinct ?: boolean, - pageIndistinct ?: boolean, - foreignKey ?: string, - loadtime ?: string, - manual ?: boolean -} - -const DefaultSelectedNode = { - text: '请选择', - value: '' -} - -export const dataPicker = defineMixin({ - props: { - localdata: { - type: Array as PropType>, - default: [] as Array - }, - collection: { - type: Object, - default: '' - }, - field: { - type: String, - default: '' - }, - orderby: { - type: String, - default: '' - }, - where: { - type: Object, - default: '' - }, - pageData: { - type: String, - default: 'add' - }, - pageCurrent: { - type: Number, - default: 1 - }, - pageSize: { - type: Number, - default: 20 - }, - getcount: { - type: Boolean, - default: false - }, - gettree: { - type: Object, - default: '' - }, - gettreepath: { - type: Object, - default: '' - }, - startwith: { - type: String, - default: '' - }, - limitlevel: { - type: Number, - default: 10 - }, - groupby: { - type: String, - default: '' - }, - groupField: { - type: String, - default: '' - }, - distinct: { - type: Boolean, - default: false - }, - pageIndistinct: { - type: Boolean, - default: false - }, - foreignKey: { - type: String, - default: '' - }, - loadtime: { - type: String, - default: 'auto' - }, - manual: { - type: Boolean, - default: false - }, - preload: { - type: Boolean, - default: false - }, - stepSearh: { - type: Boolean, - default: true - }, - selfField: { - type: String, - default: '' - }, - parentField: { - type: String, - default: '' - }, - multiple: { - type: Boolean, - default: false - }, - value: { - type: Object, - default: '' - }, - modelValue: { - type: Object, - default: '' - }, - defaultProps: { - type: Object as PropType, - } - }, - data() { - return { - loading: false, - error: null as UniCloudError | null, - treeData: [] as Array, - selectedIndex: 0, - selectedNodes: [] as Array, - selectedPages: [] as Array[], - selectedValue: '', - selectedPaths: [] as Array, - pagination: { - current: 1, - size: 20, - count: 0 - } as PaginationType - } - }, - computed: { - mappingTextName() : string { - // TODO - return (this.defaultProps != null) ? this.defaultProps!.getString('text', 'text') : 'text' - }, - mappingValueName() : string { - // TODO - return (this.defaultProps != null) ? this.defaultProps!.getString('value', 'value') : 'value' - }, - currentDataList() : Array { - if (this.selectedIndex > this.selectedPages.length - 1) { - return [] as Array - } - return this.selectedPages[this.selectedIndex] - }, - isLocalData() : boolean { - return this.localdata.length > 0 - }, - isCloudData() : boolean { - return this._checkIsNotNull(this.collection) - }, - isCloudDataList() : boolean { - return (this.isCloudData && (this.parentField.length == 0 && this.selfField.length == 0)) - }, - isCloudDataTree() : boolean { - return (this.isCloudData && this.parentField.length > 0 && this.selfField.length > 0) - }, - dataValue() : any { - return this.hasModelValue ? this.modelValue : this.value - }, - hasCloudTreeData() : boolean { - return this.treeData.length > 0 - }, - hasModelValue() : boolean { - if (typeof this.modelValue == 'string') { - const valueString = this.modelValue as string - return (valueString.length > 0) - } else if (Array.isArray(this.modelValue)) { - const valueArray = this.modelValue as Array - return (valueArray.length > 0) - } - return false - }, - hasCloudDataValue() : boolean { - if (typeof this.dataValue == 'string') { - const valueString = this.dataValue as string - return (valueString.length > 0) - } - return false - } - }, - created() { - this.pagination.current = this.pageCurrent - this.pagination.size = this.pageSize - - this.$watch( - () : any => [ - this.pageCurrent, - this.pageSize, - this.localdata, - this.value, - this.collection, - this.field, - this.getcount, - this.orderby, - this.where, - this.groupby, - this.groupField, - this.distinct - ], - (newValue : Array, oldValue : Array) => { - this.pagination.size = this.pageSize - if (newValue[0] !== oldValue[0]) { - this.pagination.current = this.pageCurrent - } - - this.onPropsChange() - } - ) - }, - methods: { - onPropsChange() { - this.selectedIndex = 0 - this.treeData.length = 0 - this.selectedNodes.length = 0 - this.selectedPages.length = 0 - this.selectedPaths.length = 0 - - // 加载数据 - this.$nextTick(() => { - this.loadData() - }) - }, - - onTabSelect(index : number) { - this.selectedIndex = index - }, - - onNodeClick(nodeData : UTSJSONObject) { - if (nodeData.getBoolean('disable', false)) { - return - } - - const isLeaf = this._checkIsLeafNode(nodeData) - - this._trimSelectedNodes(nodeData) - - this.$emit('nodeclick', nodeData) - - if (this.isLocalData) { - if (isLeaf || !this._checkHasChildren(nodeData)) { - this.onFinish() - } - } else if (this.isCloudDataList) { - this.onFinish() - } else if (this.isCloudDataTree) { - if (isLeaf) { - this.onFinish() - } else if (!this._checkHasChildren(nodeData)) { - // 尝试请求一次,如果没有返回数据标记为叶子节点 - this.loadCloudDataNode(nodeData) - } - } - }, - - getChangeNodes(): Array { - const nodes: Array = [] - this.selectedNodes.forEach((node : UTSJSONObject) => { - const newNode: UTSJSONObject = {} - newNode[this.mappingTextName] = node.getString(this.mappingTextName) - newNode[this.mappingValueName] = node.getString(this.mappingValueName) - nodes.push(newNode) - }) - return nodes - }, - - onFinish() { }, - - // 加载数据(自动判定环境) - loadData() { - if (this.isLocalData) { - this.loadLocalData() - } else if (this.isCloudDataList) { - this.loadCloudDataList() - } else if (this.isCloudDataTree) { - this.loadCloudDataTree() - } - }, - - // 加载本地数据 - loadLocalData() { - this.treeData = this.localdata - if (Array.isArray(this.dataValue)) { - const value = this.dataValue as Array - this.selectedPaths = value.slice(0) - this._pushSelectedTreeNodes(value, this.localdata) - } else { - this._pushSelectedNodes(this.localdata) - } - }, - - // 加载 Cloud 数据 (单列) - loadCloudDataList() { - this._loadCloudData(null, (data : Array) => { - this.treeData = data - this._pushSelectedNodes(data) - }) - }, - - // 加载 Cloud 数据 (树形) - loadCloudDataTree() { - let commandOptions = { - field: this._cloudDataPostField(), - where: this._cloudDataTreeWhere(), - getTree: true - } as GetCommandOptions - if (this._checkIsNotNull(this.gettree)) { - commandOptions.startwith = `${this.selfField}=='${this.dataValue as string}'` - } - this._loadCloudData(commandOptions, (data : Array) => { - this.treeData = data - if (this.selectedPaths.length > 0) { - this._pushSelectedTreeNodes(this.selectedPaths, data) - } else { - this._pushSelectedNodes(data) - } - }) - }, - - // 加载 Cloud 数据 (节点) - loadCloudDataNode(nodeData : UTSJSONObject) { - const commandOptions = { - field: this._cloudDataPostField(), - where: this._cloudDataNodeWhere() - } as GetCommandOptions - this._loadCloudData(commandOptions, (data : Array) => { - nodeData['children'] = data - if (data.length == 0) { - nodeData['isleaf'] = true - this.onFinish() - } else { - this._pushSelectedNodes(data) - } - }) - }, - - // 回显 Cloud Tree Path - loadCloudDataPath() { - if (!this.hasCloudDataValue) { - return - } - - const command : GetCommandOptions = {} - - // 单列 - if (this.isCloudDataList) { - // 根据 field's as value标识匹配 where 条件 - let where : Array = []; - let whereField = this._getForeignKeyByField(); - if (whereField.length > 0) { - where.push(`${whereField} == '${this.dataValue as string}'`) - } - - let whereString = where.join(' || ') - if (this._checkIsNotNull(this.where)) { - whereString = `(${this.where}) && (${whereString})` - } - - command.field = this._cloudDataPostField() - command.where = whereString - } - - // 树形 - if (this.isCloudDataTree) { - command.field = this._cloudDataPostField() - command.getTreePath = { - startWith: `${this.selfField}=='${this.dataValue as string}'` - } - } - - this._loadCloudData(command, (data : Array) => { - this._extractTreePath(data, this.selectedPaths) - }) - }, - - _loadCloudData(options ?: GetCommandOptions, callback ?: ((data : Array) => void)) { - if (this.loading) { - return - } - this.loading = true - - this.error = null - - this._getCommand(options).then((response : UniCloudDBGetResult) => { - callback?.(response.data) - }).catch((err : any | null) => { - this.error = err as UniCloudError - }).finally(() => { - this.loading = false - }) - }, - - _cloudDataPostField() : string { - let fields = [this.field]; - if (this.parentField.length > 0) { - fields.push(`${this.parentField} as parent_value`) - } - return fields.join(',') - }, - - _cloudDataTreeWhere() : string { - let result : Array = [] - let selectedNodes = this.selectedNodes.length > 0 ? this.selectedNodes : this.selectedPaths - let parentField = this.parentField - if (parentField.length > 0) { - result.push(`${parentField} == null || ${parentField} == ""`) - } - if (selectedNodes.length > 0) { - for (var i = 0; i < selectedNodes.length - 1; i++) { - const parentFieldValue = selectedNodes[i].getString('value', '') - result.push(`${parentField} == '${parentFieldValue}'`) - } - } - - let where : Array = [] - if (this._checkIsNotNull(this.where)) { - where.push(`(${this.where as string})`) - } - - if (result.length > 0) { - where.push(`(${result.join(' || ')})`) - } - - return where.join(' && ') - }, - - _cloudDataNodeWhere() : string { - const where : Array = [] - if (this.selectedNodes.length > 0) { - const value = this.selectedNodes[this.selectedNodes.length - 1].getString('value', '') - where.push(`${this.parentField} == '${value}'`) - } - - let whereString = where.join(' || ') - if (this._checkIsNotNull(this.where)) { - return `(${this.where as string}) && (${whereString})` - } - - return whereString - }, - - _getWhereByForeignKey() : string { - let result : Array = [] - let whereField = this._getForeignKeyByField(); - if (whereField.length > 0) { - result.push(`${whereField} == '${this.dataValue as string}'`) - } - - if (this._checkIsNotNull(this.where)) { - return `(${this.where}) && (${result.join(' || ')})` - } - - return result.join(' || ') - }, - - _getForeignKeyByField() : string { - const fields = this.field.split(',') - let whereField = '' - for (let i = 0; i < fields.length; i++) { - const items = fields[i].split('as') - if (items.length < 2) { - continue - } - if (items[1].trim() === 'value') { - whereField = items[0].trim() - break - } - } - return whereField - }, - - _getCommand(options ?: GetCommandOptions) : Promise { - let db = uniCloud.databaseForJQL() - - let collection = Array.isArray(this.collection) ? db.collection(...(this.collection as Array)) : db.collection(this.collection) - - let filter : UniCloudDBFilter | null = null - if (this.foreignKey.length > 0) { - filter = collection.foreignKey(this.foreignKey) - } - - const where : any = options?.where ?? this.where - if (typeof where == 'string') { - const whereString = where as string - if (whereString.length > 0) { - filter = (filter != null) ? filter.where(where) : collection.where(where) - } - } else { - filter = (filter != null) ? filter.where(where) : collection.where(where) - } - - let query : UniCloudDBQuery | null = null - if (this.field.length > 0) { - query = (filter != null) ? filter.field(this.field) : collection.field(this.field) - } - if (this.groupby.length > 0) { - if (query != null) { - query = query.groupBy(this.groupby) - } else if (filter != null) { - query = filter.groupBy(this.groupby) - } - } - if (this.groupField.length > 0) { - if (query != null) { - query = query.groupField(this.groupField) - } else if (filter != null) { - query = filter.groupField(this.groupField) - } - } - if (this.distinct == true) { - if (query != null) { - query = query.distinct(this.field) - } else if (filter != null) { - query = filter.distinct(this.field) - } - } - if (this.orderby.length > 0) { - if (query != null) { - query = query.orderBy(this.orderby) - } else if (filter != null) { - query = filter.orderBy(this.orderby) - } - } - - const size = this.pagination.size - const current = this.pagination.current - if (query != null) { - query = query.skip(size * (current - 1)).limit(size) - } else if (filter != null) { - query = filter.skip(size * (current - 1)).limit(size) - } else { - query = collection.skip(size * (current - 1)).limit(size) - } - - const getOptions = {} - const treeOptions = { - limitLevel: this.limitlevel, - startWith: this.startwith - } - if (this.getcount == true) { - getOptions['getCount'] = this.getcount - } - - const getTree : any = options?.getTree ?? this.gettree - if (typeof getTree == 'string') { - const getTreeString = getTree as string - if (getTreeString.length > 0) { - getOptions['getTree'] = treeOptions - } - } else if (typeof getTree == 'object') { - getOptions['getTree'] = treeOptions - } else { - getOptions['getTree'] = getTree - } - - const getTreePath = options?.getTreePath ?? this.gettreepath - if (typeof getTreePath == 'string') { - const getTreePathString = getTreePath as string - if (getTreePathString.length > 0) { - getOptions['getTreePath'] = getTreePath - } - } else { - getOptions['getTreePath'] = getTreePath - } - - return query.get(getOptions) - }, - - _checkIsNotNull(value : any) : boolean { - if (typeof value == 'string') { - const valueString = value as string - return (valueString.length > 0) - } else if (value instanceof UTSJSONObject) { - return true - } - return false - }, - - _checkIsLeafNode(nodeData : UTSJSONObject) : boolean { - if (this.selectedIndex >= this.limitlevel) { - return true - } - - if (nodeData.getBoolean('isleaf', false)) { - return true - } - - return false - }, - - _checkHasChildren(nodeData : UTSJSONObject) : boolean { - const children = nodeData.getArray('children') ?? ([] as Array) - return children.length > 0 - }, - - _pushSelectedNodes(nodes : Array) { - this.selectedNodes.push(DefaultSelectedNode) - this.selectedPages.push(nodes) - this.selectedIndex = this.selectedPages.length - 1 - }, - - _trimSelectedNodes(nodeData : UTSJSONObject) { - this.selectedNodes.splice(this.selectedIndex) - this.selectedNodes.push(nodeData) - - if (this.selectedPages.length > 0) { - this.selectedPages.splice(this.selectedIndex + 1) - } - - const children = nodeData.getArray('children') ?? ([] as Array) - if (children.length > 0) { - this.selectedNodes.push(DefaultSelectedNode) - this.selectedPages.push(children) - } - - this.selectedIndex = this.selectedPages.length - 1 - }, - - _pushSelectedTreeNodes(paths : Array, nodes : Array) { - let children : Array = nodes - paths.forEach((node : UTSJSONObject) => { - const findNode = children.find((item : UTSJSONObject) : boolean => { - return (item.getString(this.mappingValueName) == node.getString(this.mappingValueName)) - }) - if (findNode != null) { - this.selectedPages.push(children) - this.selectedNodes.push(node) - children = findNode.getArray('children') ?? ([] as Array) - } - }) - this.selectedIndex = this.selectedPages.length - 1 - }, - - _extractTreePath(nodes : Array, result : Array) { - if (nodes.length == 0) { - return - } - - const node = nodes[0] - result.push(node) - - const children = node.getArray('children') - if (Array.isArray(children) && children!.length > 0) { - this._extractTreePath(children, result) - } - } - } -}) diff --git a/sport-erp-admin/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.css b/sport-erp-admin/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.css deleted file mode 100644 index 39fe1c3..0000000 --- a/sport-erp-admin/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.css +++ /dev/null @@ -1,76 +0,0 @@ -.uni-data-pickerview { - position: relative; - flex-direction: column; - overflow: hidden; -} - -.loading-cover { - position: absolute; - left: 0; - top: 0; - right: 0; - bottom: 0; - align-items: center; - justify-content: center; - background-color: rgba(150, 150, 150, .1); -} - -.error { - background-color: #fff; - padding: 15px; -} - -.error-text { - color: #DD524D; -} - -.selected-node-list { - flex-direction: row; - flex-wrap: nowrap; -} - -.selected-node-item { - margin-left: 10px; - margin-right: 10px; - padding: 8px 10px 8px 10px; - border-bottom: 2px solid transparent; -} - -.selected-node-item-active { - color: #007aff; - border-bottom-color: #007aff; -} - -.list-view { - flex: 1; -} - -.list-item { - flex-direction: row; - justify-content: space-between; - padding: 12px 15px; - border-bottom: 1px solid #f0f0f0; -} - -.item-text { - color: #333333; -} - -.item-text-disabled { - opacity: .5; -} - -.item-text-overflow { - overflow: hidden; -} - -.check { - margin-right: 5px; - border: 2px solid #007aff; - border-left: 0; - border-top: 0; - height: 12px; - width: 6px; - transform-origin: center; - transform: rotate(45deg); -} diff --git a/sport-erp-admin/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.uvue b/sport-erp-admin/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.uvue deleted file mode 100644 index f4780f3..0000000 --- a/sport-erp-admin/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.uvue +++ /dev/null @@ -1,69 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.vue b/sport-erp-admin/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.vue deleted file mode 100644 index 6ebced9..0000000 --- a/sport-erp-admin/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.vue +++ /dev/null @@ -1,323 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-data-picker/package.json b/sport-erp-admin/uni_modules/uni-data-picker/package.json deleted file mode 100644 index a508162..0000000 --- a/sport-erp-admin/uni_modules/uni-data-picker/package.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "id": "uni-data-picker", - "displayName": "uni-data-picker 数据驱动的picker选择器", - "version": "2.0.0", - "description": "单列、多列级联选择器,常用于省市区城市选择、公司部门选择、多级分类等场景", - "keywords": [ - "uni-ui", - "uniui", - "picker", - "级联", - "省市区", - "" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, -"dcloudext": { - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", - "type": "component-vue" - }, - "uni_modules": { - "dependencies": [ - "uni-load-more", - "uni-icons", - "uni-scss" - ], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "y", - "app-uvue": "y" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y", - "京东": "u" - }, - "快应用": { - "华为": "u", - "联盟": "u" - }, - "Vue": { - "vue2": "y", - "vue3": "y" - } - } - } - } -} diff --git a/sport-erp-admin/uni_modules/uni-data-picker/readme.md b/sport-erp-admin/uni_modules/uni-data-picker/readme.md deleted file mode 100644 index 19dd0e8..0000000 --- a/sport-erp-admin/uni_modules/uni-data-picker/readme.md +++ /dev/null @@ -1,22 +0,0 @@ -## DataPicker 级联选择 -> **组件名:uni-data-picker** -> 代码块: `uDataPicker` -> 关联组件:`uni-data-pickerview`、`uni-load-more`。 - - -`` 是一个选择类[datacom组件](https://uniapp.dcloud.net.cn/component/datacom)。 - -支持单列、和多列级联选择。列数没有限制,如果屏幕显示不全,顶部tab区域会左右滚动。 - -候选数据支持一次性加载完毕,也支持懒加载,比如示例图中,选择了“北京”后,动态加载北京的区县数据。 - -`` 组件尤其适用于地址选择、分类选择等选择类。 - -`` 支持本地数据、云端静态数据(json),uniCloud云数据库数据。 - -`` 可以通过JQL直连uniCloud云数据库,配套[DB Schema](https://uniapp.dcloud.net.cn/uniCloud/schema),可在schema2code中自动生成前端页面,还支持服务器端校验。 - -在uniCloud数据表中新建表“uni-id-address”和“opendb-city-china”,这2个表的schema自带foreignKey关联。在“uni-id-address”表的表结构页面使用schema2code生成前端页面,会自动生成地址管理的维护页面,自动从“opendb-city-china”表包含的中国所有省市区信息里选择地址。 - -### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-data-picker) -#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-data-select/changelog.md b/sport-erp-admin/uni_modules/uni-data-select/changelog.md deleted file mode 100644 index 016e3d2..0000000 --- a/sport-erp-admin/uni_modules/uni-data-select/changelog.md +++ /dev/null @@ -1,39 +0,0 @@ -## 1.0.8(2024-03-28) -- 修复 在vue2下:style动态绑定导致编译失败的bug -## 1.0.7(2024-01-20) -- 修复 长文本回显超过容器的bug,超过容器部分显示省略号 -## 1.0.6(2023-04-12) -- 修复 微信小程序点击时会改变背景颜色的 bug -## 1.0.5(2023-02-03) -- 修复 禁用时会显示清空按钮 -## 1.0.4(2023-02-02) -- 优化 查询条件短期内多次变更只查询最后一次变更后的结果 -- 调整 内部缓存键名调整为 uni-data-select-lastSelectedValue -## 1.0.3(2023-01-16) -- 修复 不关联服务空间报错的问题 -## 1.0.2(2023-01-14) -- 新增 属性 `format` 可用于格式化显示选项内容 -## 1.0.1(2022-12-06) -- 修复 当where变化时,数据不会自动更新的问题 -## 0.1.9(2022-09-05) -- 修复 微信小程序下拉框出现后选择会点击到蒙板后面的输入框 -## 0.1.8(2022-08-29) -- 修复 点击的位置不准确 -## 0.1.7(2022-08-12) -- 新增 支持 disabled 属性 -## 0.1.6(2022-07-06) -- 修复 pc端宽度异常的bug -## 0.1.5 -- 修复 pc端宽度异常的bug -## 0.1.4(2022-07-05) -- 优化 显示样式 -## 0.1.3(2022-06-02) -- 修复 localdata 赋值不生效的 bug -- 新增 支持 uni.scss 修改颜色 -- 新增 支持选项禁用(数据选项设置 disabled: true 即禁用) -## 0.1.2(2022-05-08) -- 修复 当 value 为 0 时选择不生效的 bug -## 0.1.1(2022-05-07) -- 新增 记住上次的选项(仅 collection 存在时有效) -## 0.1.0(2022-04-22) -- 初始化 diff --git a/sport-erp-admin/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue b/sport-erp-admin/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue deleted file mode 100644 index edab65a..0000000 --- a/sport-erp-admin/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue +++ /dev/null @@ -1,562 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-data-select/package.json b/sport-erp-admin/uni_modules/uni-data-select/package.json deleted file mode 100644 index 5864594..0000000 --- a/sport-erp-admin/uni_modules/uni-data-select/package.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "id": "uni-data-select", - "displayName": "uni-data-select 下拉框选择器", - "version": "1.0.8", - "description": "通过数据驱动的下拉框选择器", - "keywords": [ - "uni-ui", - "select", - "uni-data-select", - "下拉框", - "下拉选" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "^3.1.1" - }, - "directories": { - "example": "../../temps/example_temps" - }, -"dcloudext": { - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", - "type": "component-vue" - }, - "uni_modules": { - "dependencies": ["uni-load-more"], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y", - "alipay": "n" - }, - "client": { - "App": { - "app-vue": "u", - "app-nvue": "n" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "u", - "百度": "u", - "字节跳动": "u", - "QQ": "u", - "京东": "u" - }, - "快应用": { - "华为": "u", - "联盟": "u" - }, - "Vue": { - "vue2": "y", - "vue3": "y" - } - } - } - } -} diff --git a/sport-erp-admin/uni_modules/uni-data-select/readme.md b/sport-erp-admin/uni_modules/uni-data-select/readme.md deleted file mode 100644 index eb58de3..0000000 --- a/sport-erp-admin/uni_modules/uni-data-select/readme.md +++ /dev/null @@ -1,8 +0,0 @@ -## DataSelect 下拉框选择器 -> **组件名:uni-data-select** -> 代码块: `uDataSelect` - -当选项过多时,使用下拉菜单展示并选择内容 - -### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-data-select) -#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 diff --git a/sport-erp-admin/uni_modules/uni-dateformat/changelog.md b/sport-erp-admin/uni_modules/uni-dateformat/changelog.md deleted file mode 100644 index d551d7b..0000000 --- a/sport-erp-admin/uni_modules/uni-dateformat/changelog.md +++ /dev/null @@ -1,10 +0,0 @@ -## 1.0.0(2021-11-19) -- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) -- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-dateformat](https://uniapp.dcloud.io/component/uniui/uni-dateformat) -## 0.0.5(2021-07-08) -- 调整 默认时间不再是当前时间,而是显示'-'字符 -## 0.0.4(2021-05-12) -- 新增 组件示例地址 -## 0.0.3(2021-02-04) -- 调整为uni_modules目录规范 -- 修复 iOS 平台日期格式化出错的问题 diff --git a/sport-erp-admin/uni_modules/uni-dateformat/components/uni-dateformat/date-format.js b/sport-erp-admin/uni_modules/uni-dateformat/components/uni-dateformat/date-format.js deleted file mode 100644 index e00d559..0000000 --- a/sport-erp-admin/uni_modules/uni-dateformat/components/uni-dateformat/date-format.js +++ /dev/null @@ -1,200 +0,0 @@ -// yyyy-MM-dd hh:mm:ss.SSS 所有支持的类型 -function pad(str, length = 2) { - str += '' - while (str.length < length) { - str = '0' + str - } - return str.slice(-length) -} - -const parser = { - yyyy: (dateObj) => { - return pad(dateObj.year, 4) - }, - yy: (dateObj) => { - return pad(dateObj.year) - }, - MM: (dateObj) => { - return pad(dateObj.month) - }, - M: (dateObj) => { - return dateObj.month - }, - dd: (dateObj) => { - return pad(dateObj.day) - }, - d: (dateObj) => { - return dateObj.day - }, - hh: (dateObj) => { - return pad(dateObj.hour) - }, - h: (dateObj) => { - return dateObj.hour - }, - mm: (dateObj) => { - return pad(dateObj.minute) - }, - m: (dateObj) => { - return dateObj.minute - }, - ss: (dateObj) => { - return pad(dateObj.second) - }, - s: (dateObj) => { - return dateObj.second - }, - SSS: (dateObj) => { - return pad(dateObj.millisecond, 3) - }, - S: (dateObj) => { - return dateObj.millisecond - }, -} - -// 这都n年了iOS依然不认识2020-12-12,需要转换为2020/12/12 -function getDate(time) { - if (time instanceof Date) { - return time - } - switch (typeof time) { - case 'string': - { - // 2020-12-12T12:12:12.000Z、2020-12-12T12:12:12.000 - if (time.indexOf('T') > -1) { - return new Date(time) - } - return new Date(time.replace(/-/g, '/')) - } - default: - return new Date(time) - } -} - -export function formatDate(date, format = 'yyyy/MM/dd hh:mm:ss') { - if (!date && date !== 0) { - return '' - } - date = getDate(date) - const dateObj = { - year: date.getFullYear(), - month: date.getMonth() + 1, - day: date.getDate(), - hour: date.getHours(), - minute: date.getMinutes(), - second: date.getSeconds(), - millisecond: date.getMilliseconds() - } - const tokenRegExp = /yyyy|yy|MM|M|dd|d|hh|h|mm|m|ss|s|SSS|SS|S/ - let flag = true - let result = format - while (flag) { - flag = false - result = result.replace(tokenRegExp, function(matched) { - flag = true - return parser[matched](dateObj) - }) - } - return result -} - -export function friendlyDate(time, { - locale = 'zh', - threshold = [60000, 3600000], - format = 'yyyy/MM/dd hh:mm:ss' -}) { - if (time === '-') { - return time - } - if (!time && time !== 0) { - return '' - } - const localeText = { - zh: { - year: '年', - month: '月', - day: '天', - hour: '小时', - minute: '分钟', - second: '秒', - ago: '前', - later: '后', - justNow: '刚刚', - soon: '马上', - template: '{num}{unit}{suffix}' - }, - en: { - year: 'year', - month: 'month', - day: 'day', - hour: 'hour', - minute: 'minute', - second: 'second', - ago: 'ago', - later: 'later', - justNow: 'just now', - soon: 'soon', - template: '{num} {unit} {suffix}' - } - } - const text = localeText[locale] || localeText.zh - let date = getDate(time) - let ms = date.getTime() - Date.now() - let absMs = Math.abs(ms) - if (absMs < threshold[0]) { - return ms < 0 ? text.justNow : text.soon - } - if (absMs >= threshold[1]) { - return formatDate(date, format) - } - let num - let unit - let suffix = text.later - if (ms < 0) { - suffix = text.ago - ms = -ms - } - const seconds = Math.floor((ms) / 1000) - const minutes = Math.floor(seconds / 60) - const hours = Math.floor(minutes / 60) - const days = Math.floor(hours / 24) - const months = Math.floor(days / 30) - const years = Math.floor(months / 12) - switch (true) { - case years > 0: - num = years - unit = text.year - break - case months > 0: - num = months - unit = text.month - break - case days > 0: - num = days - unit = text.day - break - case hours > 0: - num = hours - unit = text.hour - break - case minutes > 0: - num = minutes - unit = text.minute - break - default: - num = seconds - unit = text.second - break - } - - if (locale === 'en') { - if (num === 1) { - num = 'a' - } else { - unit += 's' - } - } - - return text.template.replace(/{\s*num\s*}/g, num + '').replace(/{\s*unit\s*}/g, unit).replace(/{\s*suffix\s*}/g, - suffix) -} diff --git a/sport-erp-admin/uni_modules/uni-dateformat/components/uni-dateformat/uni-dateformat.vue b/sport-erp-admin/uni_modules/uni-dateformat/components/uni-dateformat/uni-dateformat.vue deleted file mode 100644 index c5ed030..0000000 --- a/sport-erp-admin/uni_modules/uni-dateformat/components/uni-dateformat/uni-dateformat.vue +++ /dev/null @@ -1,88 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-dateformat/package.json b/sport-erp-admin/uni_modules/uni-dateformat/package.json deleted file mode 100644 index 786a670..0000000 --- a/sport-erp-admin/uni_modules/uni-dateformat/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "id": "uni-dateformat", - "displayName": "uni-dateformat 日期格式化", - "version": "1.0.0", - "description": "日期格式化组件,可以将日期格式化为1分钟前、刚刚等形式", - "keywords": [ - "uni-ui", - "uniui", - "日期格式化", - "时间格式化", - "格式化时间", - "" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ], - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" - }, - "uni_modules": { - "dependencies": ["uni-scss"], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "y" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y" - }, - "快应用": { - "华为": "y", - "联盟": "y" - }, - "Vue": { - "vue2": "y", - "vue3": "y" - } - } - } - } -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-dateformat/readme.md b/sport-erp-admin/uni_modules/uni-dateformat/readme.md deleted file mode 100644 index 37ddb6e..0000000 --- a/sport-erp-admin/uni_modules/uni-dateformat/readme.md +++ /dev/null @@ -1,11 +0,0 @@ - - -### DateFormat 日期格式化 -> **组件名:uni-dateformat** -> 代码块: `uDateformat` - - -日期格式化组件。 - -### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-dateformat) -#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-datetime-picker/changelog.md b/sport-erp-admin/uni_modules/uni-datetime-picker/changelog.md deleted file mode 100644 index 8798e93..0000000 --- a/sport-erp-admin/uni_modules/uni-datetime-picker/changelog.md +++ /dev/null @@ -1,160 +0,0 @@ -## 2.2.34(2024-04-24) -- 新增 日期点击事件,在点击日期时会触发该事件。 -## 2.2.33(2024-04-15) -- 修复 抖音小程序事件传递失效bug -## 2.2.32(2024-02-20) -- 修复 日历的close事件触发异常的bug [详情](https://github.com/dcloudio/uni-ui/issues/844) -## 2.2.31(2024-02-20) -- 修复 h5平台 右边日历的月份默认+1的bug [详情](https://github.com/dcloudio/uni-ui/issues/841) -## 2.2.30(2024-01-31) -- 修复 隐藏“秒”时,在IOS15及以下版本时出现 结束时间在开始时间之前 的bug [详情](https://github.com/dcloudio/uni-ui/issues/788) -## 2.2.29(2024-01-20) -- 新增 show事件,弹窗弹出时触发该事件 [详情](https://github.com/dcloudio/uni-app/issues/4694) -## 2.2.28(2024-01-18) -- 去除 noChange事件,当进行日期范围选择时,若只选了一天,则开始结束日期都为同一天 [详情](https://github.com/dcloudio/uni-ui/issues/815) -## 2.2.27(2024-01-10) -- 优化 增加noChange事件,当进行日期范围选择时,若有空值,则触发该事件 [详情](https://github.com/dcloudio/uni-ui/issues/815) -## 2.2.26(2024-01-08) -- 修复 字节小程序时间选择范围器失效问题 [详情](https://github.com/dcloudio/uni-ui/issues/834) -## 2.2.25(2023-10-18) -- 修复 PC端初次修改时间,开始时间未更新的Bug [详情](https://github.com/dcloudio/uni-ui/issues/737) -## 2.2.24(2023-06-02) -- 修复 部分情况修改时间,开始、结束时间显示异常的Bug [详情](https://ask.dcloud.net.cn/question/171146) -- 优化 当前月可以选择上月、下月的日期的Bug -## 2.2.23(2023-05-02) -- 修复 部分情况修改时间,开始时间未更新的Bug [详情](https://github.com/dcloudio/uni-ui/issues/737) -- 修复 部分平台及设备第一次点击无法显示弹框的Bug -- 修复 ios 日期格式未补零显示及使用异常的Bug [详情](https://ask.dcloud.net.cn/question/162979) -## 2.2.22(2023-03-30) -- 修复 日历 picker 修改年月后,自动选中当月1日的Bug [详情](https://ask.dcloud.net.cn/question/165937) -- 修复 小程序端 低版本 ios NaN的Bug [详情](https://ask.dcloud.net.cn/question/162979) -## 2.2.21(2023-02-20) -- 修复 firefox 浏览器显示区域点击无法拉起日历弹框的Bug [详情](https://ask.dcloud.net.cn/question/163362) -## 2.2.20(2023-02-17) -- 优化 值为空依然选中当天问题 -- 优化 提供 default-value 属性支持配置选择器打开时默认显示的时间 -- 优化 非范围选择未选择日期时间,点击确认按钮选中当前日期时间 -- 优化 字节小程序日期时间范围选择,底部日期换行的Bug -## 2.2.19(2023-02-09) -- 修复 2.2.18 引起范围选择配置 end 选择无效的Bug [详情](https://github.com/dcloudio/uni-ui/issues/686) -## 2.2.18(2023-02-08) -- 修复 移动端范围选择change事件触发异常的Bug [详情](https://github.com/dcloudio/uni-ui/issues/684) -- 优化 PC端输入日期格式错误时返回当前日期时间 -- 优化 PC端输入日期时间超出 start、end 限制的Bug -- 优化 移动端日期时间范围用法时间展示不完整问题 -## 2.2.17(2023-02-04) -- 修复 小程序端绑定 Date 类型报错的Bug [详情](https://github.com/dcloudio/uni-ui/issues/679) -- 修复 vue3 time-picker 无法显示绑定时分秒的Bug -## 2.2.16(2023-02-02) -- 修复 字节小程序报错的Bug -## 2.2.15(2023-02-02) -- 修复 某些情况切换月份错误的Bug -## 2.2.14(2023-01-30) -- 修复 某些情况切换月份错误的Bug [详情](https://ask.dcloud.net.cn/question/162033) -## 2.2.13(2023-01-10) -- 修复 多次加载组件造成内存占用的Bug -## 2.2.12(2022-12-01) -- 修复 vue3 下 i18n 国际化初始值不正确的Bug -## 2.2.11(2022-09-19) -- 修复 支付宝小程序样式错乱的Bug [详情](https://github.com/dcloudio/uni-app/issues/3861) -## 2.2.10(2022-09-19) -- 修复 反向选择日期范围,日期显示异常的Bug [详情](https://ask.dcloud.net.cn/question/153401?item_id=212892&rf=false) -## 2.2.9(2022-09-16) -- 可以使用 uni-scss 控制主题色 -## 2.2.8(2022-09-08) -- 修复 close事件无效的Bug -## 2.2.7(2022-09-05) -- 修复 移动端 maskClick 无效的Bug [详情](https://ask.dcloud.net.cn/question/140824) -## 2.2.6(2022-06-30) -- 优化 组件样式,调整了组件图标大小、高度、颜色等,与uni-ui风格保持一致 -## 2.2.5(2022-06-24) -- 修复 日历顶部年月及底部确认未国际化的Bug -## 2.2.4(2022-03-31) -- 修复 Vue3 下动态赋值,单选类型未响应的Bug -## 2.2.3(2022-03-28) -- 修复 Vue3 下动态赋值未响应的Bug -## 2.2.2(2021-12-10) -- 修复 clear-icon 属性在小程序平台不生效的Bug -## 2.2.1(2021-12-10) -- 修复 日期范围选在小程序平台,必须多点击一次才能取消选中状态的Bug -## 2.2.0(2021-11-19) -- 优化 组件UI,并提供设计资源 [详情](https://uniapp.dcloud.io/component/uniui/resource) -- 文档迁移 [https://uniapp.dcloud.io/component/uniui/uni-datetime-picker](https://uniapp.dcloud.io/component/uniui/uni-datetime-picker) -## 2.1.5(2021-11-09) -- 新增 提供组件设计资源,组件样式调整 -## 2.1.4(2021-09-10) -- 修复 hide-second 在移动端的Bug -- 修复 单选赋默认值时,赋值日期未高亮的Bug -- 修复 赋默认值时,移动端未正确显示时间的Bug -## 2.1.3(2021-09-09) -- 新增 hide-second 属性,支持只使用时分,隐藏秒 -## 2.1.2(2021-09-03) -- 优化 取消选中时(范围选)直接开始下一次选择, 避免多点一次 -- 优化 移动端支持清除按钮,同时支持通过 ref 调用组件的 clear 方法 -- 优化 调整字号大小,美化日历界面 -- 修复 因国际化导致的 placeholder 失效的Bug -## 2.1.1(2021-08-24) -- 新增 支持国际化 -- 优化 范围选择器在 pc 端过宽的问题 -## 2.1.0(2021-08-09) -- 新增 适配 vue3 -## 2.0.19(2021-08-09) -- 新增 支持作为 uni-forms 子组件相关功能 -- 修复 在 uni-forms 中使用时,选择时间报 NAN 错误的Bug -## 2.0.18(2021-08-05) -- 修复 type 属性动态赋值无效的Bug -- 修复 ‘确认’按钮被 tabbar 遮盖 bug -- 修复 组件未赋值时范围选左、右日历相同的Bug -## 2.0.17(2021-08-04) -- 修复 范围选未正确显示当前值的Bug -- 修复 h5 平台(移动端)报错 'cale' of undefined 的Bug -## 2.0.16(2021-07-21) -- 新增 return-type 属性支持返回 date 日期对象 -## 2.0.15(2021-07-14) -- 修复 单选日期类型,初始赋值后不在当前日历的Bug -- 新增 clearIcon 属性,显示框的清空按钮可配置显示隐藏(仅 pc 有效) -- 优化 移动端移除显示框的清空按钮,无实际用途 -## 2.0.14(2021-07-14) -- 修复 组件赋值为空,界面未更新的Bug -- 修复 start 和 end 不能动态赋值的Bug -- 修复 范围选类型,用户选择后再次选择右侧日历(结束日期)显示不正确的Bug -## 2.0.13(2021-07-08) -- 修复 范围选择不能动态赋值的Bug -## 2.0.12(2021-07-08) -- 修复 范围选择的初始时间在一个月内时,造成无法选择的bug -## 2.0.11(2021-07-08) -- 优化 弹出层在超出视窗边缘定位不准确的问题 -## 2.0.10(2021-07-08) -- 修复 范围起始点样式的背景色与今日样式的字体前景色融合,导致日期字体看不清的Bug -- 优化 弹出层在超出视窗边缘被遮盖的问题 -## 2.0.9(2021-07-07) -- 新增 maskClick 事件 -- 修复 特殊情况日历 rpx 布局错误的Bug,rpx -> px -- 修复 范围选择时清空返回值不合理的bug,['', ''] -> [] -## 2.0.8(2021-07-07) -- 新增 日期时间显示框支持插槽 -## 2.0.7(2021-07-01) -- 优化 添加 uni-icons 依赖 -## 2.0.6(2021-05-22) -- 修复 图标在小程序上不显示的Bug -- 优化 重命名引用组件,避免潜在组件命名冲突 -## 2.0.5(2021-05-20) -- 优化 代码目录扁平化 -## 2.0.4(2021-05-12) -- 新增 组件示例地址 -## 2.0.3(2021-05-10) -- 修复 ios 下不识别 '-' 日期格式的Bug -- 优化 pc 下弹出层添加边框和阴影 -## 2.0.2(2021-05-08) -- 修复 在 admin 中获取弹出层定位错误的bug -## 2.0.1(2021-05-08) -- 修复 type 属性向下兼容,默认值从 date 变更为 datetime -## 2.0.0(2021-04-30) -- 支持日历形式的日期+时间的范围选择 - > 注意:此版本不向后兼容,不再支持单独时间选择(type=time)及相关的 hide-second 属性(时间选可使用内置组件 picker) -## 1.0.6(2021-03-18) -- 新增 hide-second 属性,时间支持仅选择时、分 -- 修复 选择跟显示的日期不一样的Bug -- 修复 chang事件触发2次的Bug -- 修复 分、秒 end 范围错误的Bug -- 优化 更好的 nvue 适配 diff --git a/sport-erp-admin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar-item.vue b/sport-erp-admin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar-item.vue deleted file mode 100644 index dba9887..0000000 --- a/sport-erp-admin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar-item.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.js b/sport-erp-admin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.js deleted file mode 100644 index 5b78e86..0000000 --- a/sport-erp-admin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.js +++ /dev/null @@ -1,546 +0,0 @@ -/** -* @1900-2100区间内的公历、农历互转 -* @charset UTF-8 -* @github https://github.com/jjonline/calendar.js -* @Author Jea杨(JJonline@JJonline.Cn) -* @Time 2014-7-21 -* @Time 2016-8-13 Fixed 2033hex、Attribution Annals -* @Time 2016-9-25 Fixed lunar LeapMonth Param Bug -* @Time 2017-7-24 Fixed use getTerm Func Param Error.use solar year,NOT lunar year -* @Version 1.0.3 -* @公历转农历:calendar.solar2lunar(1987,11,01); //[you can ignore params of prefix 0] -* @农历转公历:calendar.lunar2solar(1987,09,10); //[you can ignore params of prefix 0] -*/ -/* eslint-disable */ -let calendar = { - - /** - * 农历1900-2100的润大小信息表 - * @Array Of Property - * @return Hex - */ - lunarInfo: [0x04bd8, 0x04ae0, 0x0a570, 0x054d5, 0x0d260, 0x0d950, 0x16554, 0x056a0, 0x09ad0, 0x055d2, // 1900-1909 - 0x04ae0, 0x0a5b6, 0x0a4d0, 0x0d250, 0x1d255, 0x0b540, 0x0d6a0, 0x0ada2, 0x095b0, 0x14977, // 1910-1919 - 0x04970, 0x0a4b0, 0x0b4b5, 0x06a50, 0x06d40, 0x1ab54, 0x02b60, 0x09570, 0x052f2, 0x04970, // 1920-1929 - 0x06566, 0x0d4a0, 0x0ea50, 0x06e95, 0x05ad0, 0x02b60, 0x186e3, 0x092e0, 0x1c8d7, 0x0c950, // 1930-1939 - 0x0d4a0, 0x1d8a6, 0x0b550, 0x056a0, 0x1a5b4, 0x025d0, 0x092d0, 0x0d2b2, 0x0a950, 0x0b557, // 1940-1949 - 0x06ca0, 0x0b550, 0x15355, 0x04da0, 0x0a5b0, 0x14573, 0x052b0, 0x0a9a8, 0x0e950, 0x06aa0, // 1950-1959 - 0x0aea6, 0x0ab50, 0x04b60, 0x0aae4, 0x0a570, 0x05260, 0x0f263, 0x0d950, 0x05b57, 0x056a0, // 1960-1969 - 0x096d0, 0x04dd5, 0x04ad0, 0x0a4d0, 0x0d4d4, 0x0d250, 0x0d558, 0x0b540, 0x0b6a0, 0x195a6, // 1970-1979 - 0x095b0, 0x049b0, 0x0a974, 0x0a4b0, 0x0b27a, 0x06a50, 0x06d40, 0x0af46, 0x0ab60, 0x09570, // 1980-1989 - 0x04af5, 0x04970, 0x064b0, 0x074a3, 0x0ea50, 0x06b58, 0x05ac0, 0x0ab60, 0x096d5, 0x092e0, // 1990-1999 - 0x0c960, 0x0d954, 0x0d4a0, 0x0da50, 0x07552, 0x056a0, 0x0abb7, 0x025d0, 0x092d0, 0x0cab5, // 2000-2009 - 0x0a950, 0x0b4a0, 0x0baa4, 0x0ad50, 0x055d9, 0x04ba0, 0x0a5b0, 0x15176, 0x052b0, 0x0a930, // 2010-2019 - 0x07954, 0x06aa0, 0x0ad50, 0x05b52, 0x04b60, 0x0a6e6, 0x0a4e0, 0x0d260, 0x0ea65, 0x0d530, // 2020-2029 - 0x05aa0, 0x076a3, 0x096d0, 0x04afb, 0x04ad0, 0x0a4d0, 0x1d0b6, 0x0d250, 0x0d520, 0x0dd45, // 2030-2039 - 0x0b5a0, 0x056d0, 0x055b2, 0x049b0, 0x0a577, 0x0a4b0, 0x0aa50, 0x1b255, 0x06d20, 0x0ada0, // 2040-2049 - /** Add By JJonline@JJonline.Cn**/ - 0x14b63, 0x09370, 0x049f8, 0x04970, 0x064b0, 0x168a6, 0x0ea50, 0x06b20, 0x1a6c4, 0x0aae0, // 2050-2059 - 0x0a2e0, 0x0d2e3, 0x0c960, 0x0d557, 0x0d4a0, 0x0da50, 0x05d55, 0x056a0, 0x0a6d0, 0x055d4, // 2060-2069 - 0x052d0, 0x0a9b8, 0x0a950, 0x0b4a0, 0x0b6a6, 0x0ad50, 0x055a0, 0x0aba4, 0x0a5b0, 0x052b0, // 2070-2079 - 0x0b273, 0x06930, 0x07337, 0x06aa0, 0x0ad50, 0x14b55, 0x04b60, 0x0a570, 0x054e4, 0x0d160, // 2080-2089 - 0x0e968, 0x0d520, 0x0daa0, 0x16aa6, 0x056d0, 0x04ae0, 0x0a9d4, 0x0a2d0, 0x0d150, 0x0f252, // 2090-2099 - 0x0d520], // 2100 - - /** - * 公历每个月份的天数普通表 - * @Array Of Property - * @return Number - */ - solarMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], - - /** - * 天干地支之天干速查表 - * @Array Of Property trans["甲","乙","丙","丁","戊","己","庚","辛","壬","癸"] - * @return Cn string - */ - Gan: ['\u7532', '\u4e59', '\u4e19', '\u4e01', '\u620a', '\u5df1', '\u5e9a', '\u8f9b', '\u58ec', '\u7678'], - - /** - * 天干地支之地支速查表 - * @Array Of Property - * @trans["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"] - * @return Cn string - */ - Zhi: ['\u5b50', '\u4e11', '\u5bc5', '\u536f', '\u8fb0', '\u5df3', '\u5348', '\u672a', '\u7533', '\u9149', '\u620c', '\u4ea5'], - - /** - * 天干地支之地支速查表<=>生肖 - * @Array Of Property - * @trans["鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"] - * @return Cn string - */ - Animals: ['\u9f20', '\u725b', '\u864e', '\u5154', '\u9f99', '\u86c7', '\u9a6c', '\u7f8a', '\u7334', '\u9e21', '\u72d7', '\u732a'], - - /** - * 24节气速查表 - * @Array Of Property - * @trans["小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至"] - * @return Cn string - */ - solarTerm: ['\u5c0f\u5bd2', '\u5927\u5bd2', '\u7acb\u6625', '\u96e8\u6c34', '\u60ca\u86f0', '\u6625\u5206', '\u6e05\u660e', '\u8c37\u96e8', '\u7acb\u590f', '\u5c0f\u6ee1', '\u8292\u79cd', '\u590f\u81f3', '\u5c0f\u6691', '\u5927\u6691', '\u7acb\u79cb', '\u5904\u6691', '\u767d\u9732', '\u79cb\u5206', '\u5bd2\u9732', '\u971c\u964d', '\u7acb\u51ac', '\u5c0f\u96ea', '\u5927\u96ea', '\u51ac\u81f3'], - - /** - * 1900-2100各年的24节气日期速查表 - * @Array Of Property - * @return 0x string For splice - */ - sTermInfo: ['9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bcf97c3598082c95f8c965cc920f', - '97bd0b06bdb0722c965ce1cfcc920f', 'b027097bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', - '97bcf97c359801ec95f8c965cc920f', '97bd0b06bdb0722c965ce1cfcc920f', 'b027097bd097c36b0b6fc9274c91aa', - '97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f', '97bd0b06bdb0722c965ce1cfcc920f', - 'b027097bd097c36b0b6fc9274c91aa', '9778397bd19801ec9210c965cc920e', '97b6b97bd19801ec95f8c965cc920f', - '97bd09801d98082c95f8e1cfcc920f', '97bd097bd097c36b0b6fc9210c8dc2', '9778397bd197c36c9210c9274c91aa', - '97b6b97bd19801ec95f8c965cc920e', '97bd09801d98082c95f8e1cfcc920f', '97bd097bd097c36b0b6fc9210c8dc2', - '9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec95f8c965cc920e', '97bcf97c3598082c95f8e1cfcc920f', - '97bd097bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec9210c965cc920e', - '97bcf97c3598082c95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', - '97b6b97bd19801ec9210c965cc920e', '97bcf97c3598082c95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722', - '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f', - '97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', - '97bcf97c359801ec95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', - '97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f', '97bd097bd07f595b0b6fc920fb0722', - '9778397bd097c36b0b6fc9210c8dc2', '9778397bd19801ec9210c9274c920e', '97b6b97bd19801ec95f8c965cc920f', - '97bd07f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c920e', - '97b6b97bd19801ec95f8c965cc920f', '97bd07f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2', - '9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bd07f1487f595b0b0bc920fb0722', - '7f0e397bd097c36b0b6fc9210c8dc2', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', - '97bcf7f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', - '97b6b97bd19801ec9210c965cc920e', '97bcf7f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', - '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bcf7f1487f531b0b0bb0b6fb0722', - '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', - '97bcf7f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', - '97b6b97bd19801ec9210c9274c920e', '97bcf7f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', - '9778397bd097c36b0b6fc9210c91aa', '97b6b97bd197c36c9210c9274c920e', '97bcf7f0e47f531b0b0bb0b6fb0722', - '7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c920e', - '97b6b7f0e47f531b0723b0b6fb0722', '7f0e37f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2', - '9778397bd097c36b0b70c9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721', '7f0e37f1487f595b0b0bb0b6fb0722', - '7f0e397bd097c35b0b6fc9210c8dc2', '9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721', - '7f0e27f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', - '97b6b7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', - '9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', - '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721', - '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9274c91aa', - '97b6b7f0e47f531b0723b0787b0721', '7f0e27f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', - '9778397bd097c36b0b6fc9210c91aa', '97b6b7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722', - '7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9210c8dc2', '977837f0e37f149b0723b0787b0721', - '7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f5307f595b0b0bc920fb0722', '7f0e397bd097c35b0b6fc9210c8dc2', - '977837f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e37f1487f595b0b0bb0b6fb0722', - '7f0e397bd097c35b0b6fc9210c8dc2', '977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', - '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '977837f0e37f14998082b0787b06bd', - '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', - '977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', - '7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', - '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14998082b0787b06bd', - '7f07e7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', - '977837f0e37f14998082b0723b06bd', '7f07e7f0e37f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722', - '7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b0721', - '7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f1487f595b0b0bb0b6fb0722', '7f0e37f0e37f14898082b0723b02d5', - '7ec967f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f1487f531b0b0bb0b6fb0722', - '7f0e37f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', - '7f0e37f1487f531b0b0bb0b6fb0722', '7f0e37f0e37f14898082b072297c35', '7ec967f0e37f14998082b0787b06bd', - '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e37f0e37f14898082b072297c35', - '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', - '7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f149b0723b0787b0721', - '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14998082b0723b06bd', - '7f07e7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722', '7f0e37f0e366aa89801eb072297c35', - '7ec967f0e37f14998082b0723b06bd', '7f07e7f0e37f14998083b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722', - '7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14898082b0723b02d5', '7f07e7f0e37f14998082b0787b0721', - '7f07e7f0e47f531b0723b0b6fb0722', '7f0e36665b66aa89801e9808297c35', '665f67f0e37f14898082b0723b02d5', - '7ec967f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0722', '7f0e36665b66a449801e9808297c35', - '665f67f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', - '7f0e36665b66a449801e9808297c35', '665f67f0e37f14898082b072297c35', '7ec967f0e37f14998082b0787b06bd', - '7f07e7f0e47f531b0723b0b6fb0721', '7f0e26665b66a449801e9808297c35', '665f67f0e37f1489801eb072297c35', - '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722'], - - /** - * 数字转中文速查表 - * @Array Of Property - * @trans ['日','一','二','三','四','五','六','七','八','九','十'] - * @return Cn string - */ - nStr1: ['\u65e5', '\u4e00', '\u4e8c', '\u4e09', '\u56db', '\u4e94', '\u516d', '\u4e03', '\u516b', '\u4e5d', '\u5341'], - - /** - * 日期转农历称呼速查表 - * @Array Of Property - * @trans ['初','十','廿','卅'] - * @return Cn string - */ - nStr2: ['\u521d', '\u5341', '\u5eff', '\u5345'], - - /** - * 月份转农历称呼速查表 - * @Array Of Property - * @trans ['正','一','二','三','四','五','六','七','八','九','十','冬','腊'] - * @return Cn string - */ - nStr3: ['\u6b63', '\u4e8c', '\u4e09', '\u56db', '\u4e94', '\u516d', '\u4e03', '\u516b', '\u4e5d', '\u5341', '\u51ac', '\u814a'], - - /** - * 返回农历y年一整年的总天数 - * @param lunar Year - * @return Number - * @eg:let count = calendar.lYearDays(1987) ;//count=387 - */ - lYearDays: function (y) { - let i; let sum = 348 - for (i = 0x8000; i > 0x8; i >>= 1) { sum += (this.lunarInfo[y - 1900] & i) ? 1 : 0 } - return (sum + this.leapDays(y)) - }, - - /** - * 返回农历y年闰月是哪个月;若y年没有闰月 则返回0 - * @param lunar Year - * @return Number (0-12) - * @eg:let leapMonth = calendar.leapMonth(1987) ;//leapMonth=6 - */ - leapMonth: function (y) { // 闰字编码 \u95f0 - return (this.lunarInfo[y - 1900] & 0xf) - }, - - /** - * 返回农历y年闰月的天数 若该年没有闰月则返回0 - * @param lunar Year - * @return Number (0、29、30) - * @eg:let leapMonthDay = calendar.leapDays(1987) ;//leapMonthDay=29 - */ - leapDays: function (y) { - if (this.leapMonth(y)) { - return ((this.lunarInfo[y - 1900] & 0x10000) ? 30 : 29) - } - return (0) - }, - - /** - * 返回农历y年m月(非闰月)的总天数,计算m为闰月时的天数请使用leapDays方法 - * @param lunar Year - * @return Number (-1、29、30) - * @eg:let MonthDay = calendar.monthDays(1987,9) ;//MonthDay=29 - */ - monthDays: function (y, m) { - if (m > 12 || m < 1) { return -1 }// 月份参数从1至12,参数错误返回-1 - return ((this.lunarInfo[y - 1900] & (0x10000 >> m)) ? 30 : 29) - }, - - /** - * 返回公历(!)y年m月的天数 - * @param solar Year - * @return Number (-1、28、29、30、31) - * @eg:let solarMonthDay = calendar.leapDays(1987) ;//solarMonthDay=30 - */ - solarDays: function (y, m) { - if (m > 12 || m < 1) { return -1 } // 若参数错误 返回-1 - let ms = m - 1 - if (ms == 1) { // 2月份的闰平规律测算后确认返回28或29 - return (((y % 4 == 0) && (y % 100 != 0) || (y % 400 == 0)) ? 29 : 28) - } else { - return (this.solarMonth[ms]) - } - }, - - /** - * 农历年份转换为干支纪年 - * @param lYear 农历年的年份数 - * @return Cn string - */ - toGanZhiYear: function (lYear) { - let ganKey = (lYear - 3) % 10 - let zhiKey = (lYear - 3) % 12 - if (ganKey == 0) ganKey = 10// 如果余数为0则为最后一个天干 - if (zhiKey == 0) zhiKey = 12// 如果余数为0则为最后一个地支 - return this.Gan[ganKey - 1] + this.Zhi[zhiKey - 1] - }, - - /** - * 公历月、日判断所属星座 - * @param cMonth [description] - * @param cDay [description] - * @return Cn string - */ - toAstro: function (cMonth, cDay) { - let s = '\u9b54\u7faf\u6c34\u74f6\u53cc\u9c7c\u767d\u7f8a\u91d1\u725b\u53cc\u5b50\u5de8\u87f9\u72ee\u5b50\u5904\u5973\u5929\u79e4\u5929\u874e\u5c04\u624b\u9b54\u7faf' - let arr = [20, 19, 21, 21, 21, 22, 23, 23, 23, 23, 22, 22] - return s.substr(cMonth * 2 - (cDay < arr[cMonth - 1] ? 2 : 0), 2) + '\u5ea7'// 座 - }, - - /** - * 传入offset偏移量返回干支 - * @param offset 相对甲子的偏移量 - * @return Cn string - */ - toGanZhi: function (offset) { - return this.Gan[offset % 10] + this.Zhi[offset % 12] - }, - - /** - * 传入公历(!)y年获得该年第n个节气的公历日期 - * @param y公历年(1900-2100);n二十四节气中的第几个节气(1~24);从n=1(小寒)算起 - * @return day Number - * @eg:let _24 = calendar.getTerm(1987,3) ;//_24=4;意即1987年2月4日立春 - */ - getTerm: function (y, n) { - if (y < 1900 || y > 2100) { return -1 } - if (n < 1 || n > 24) { return -1 } - let _table = this.sTermInfo[y - 1900] - let _info = [ - parseInt('0x' + _table.substr(0, 5)).toString(), - parseInt('0x' + _table.substr(5, 5)).toString(), - parseInt('0x' + _table.substr(10, 5)).toString(), - parseInt('0x' + _table.substr(15, 5)).toString(), - parseInt('0x' + _table.substr(20, 5)).toString(), - parseInt('0x' + _table.substr(25, 5)).toString() - ] - let _calday = [ - _info[0].substr(0, 1), - _info[0].substr(1, 2), - _info[0].substr(3, 1), - _info[0].substr(4, 2), - - _info[1].substr(0, 1), - _info[1].substr(1, 2), - _info[1].substr(3, 1), - _info[1].substr(4, 2), - - _info[2].substr(0, 1), - _info[2].substr(1, 2), - _info[2].substr(3, 1), - _info[2].substr(4, 2), - - _info[3].substr(0, 1), - _info[3].substr(1, 2), - _info[3].substr(3, 1), - _info[3].substr(4, 2), - - _info[4].substr(0, 1), - _info[4].substr(1, 2), - _info[4].substr(3, 1), - _info[4].substr(4, 2), - - _info[5].substr(0, 1), - _info[5].substr(1, 2), - _info[5].substr(3, 1), - _info[5].substr(4, 2) - ] - return parseInt(_calday[n - 1]) - }, - - /** - * 传入农历数字月份返回汉语通俗表示法 - * @param lunar month - * @return Cn string - * @eg:let cnMonth = calendar.toChinaMonth(12) ;//cnMonth='腊月' - */ - toChinaMonth: function (m) { // 月 => \u6708 - if (m > 12 || m < 1) { return -1 } // 若参数错误 返回-1 - let s = this.nStr3[m - 1] - s += '\u6708'// 加上月字 - return s - }, - - /** - * 传入农历日期数字返回汉字表示法 - * @param lunar day - * @return Cn string - * @eg:let cnDay = calendar.toChinaDay(21) ;//cnMonth='廿一' - */ - toChinaDay: function (d) { // 日 => \u65e5 - let s - switch (d) { - case 10: - s = '\u521d\u5341'; break - case 20: - s = '\u4e8c\u5341'; break - break - case 30: - s = '\u4e09\u5341'; break - break - default : - s = this.nStr2[Math.floor(d / 10)] - s += this.nStr1[d % 10] - } - return (s) - }, - - /** - * 年份转生肖[!仅能大致转换] => 精确划分生肖分界线是“立春” - * @param y year - * @return Cn string - * @eg:let animal = calendar.getAnimal(1987) ;//animal='兔' - */ - getAnimal: function (y) { - return this.Animals[(y - 4) % 12] - }, - - /** - * 传入阳历年月日获得详细的公历、农历object信息 <=>JSON - * @param y solar year - * @param m solar month - * @param d solar day - * @return JSON object - * @eg:console.log(calendar.solar2lunar(1987,11,01)); - */ - solar2lunar: function (y, m, d) { // 参数区间1900.1.31~2100.12.31 - // 年份限定、上限 - if (y < 1900 || y > 2100) { - return -1// undefined转换为数字变为NaN - } - // 公历传参最下限 - if (y == 1900 && m == 1 && d < 31) { - return -1 - } - // 未传参 获得当天 - if (!y) { - let objDate = new Date() - } else { - let objDate = new Date(y, parseInt(m) - 1, d) - } - let i; let leap = 0; let temp = 0 - // 修正ymd参数 - let y = objDate.getFullYear() - let m = objDate.getMonth() + 1 - let d = objDate.getDate() - let offset = (Date.UTC(objDate.getFullYear(), objDate.getMonth(), objDate.getDate()) - Date.UTC(1900, 0, 31)) / 86400000 - for (i = 1900; i < 2101 && offset > 0; i++) { - temp = this.lYearDays(i) - offset -= temp - } - if (offset < 0) { - offset += temp; i-- - } - - // 是否今天 - let isTodayObj = new Date() - let isToday = false - if (isTodayObj.getFullYear() == y && isTodayObj.getMonth() + 1 == m && isTodayObj.getDate() == d) { - isToday = true - } - // 星期几 - let nWeek = objDate.getDay() - let cWeek = this.nStr1[nWeek] - // 数字表示周几顺应天朝周一开始的惯例 - if (nWeek == 0) { - nWeek = 7 - } - // 农历年 - let year = i - let leap = this.leapMonth(i) // 闰哪个月 - let isLeap = false - - // 效验闰月 - for (i = 1; i < 13 && offset > 0; i++) { - // 闰月 - if (leap > 0 && i == (leap + 1) && isLeap == false) { - --i - isLeap = true; temp = this.leapDays(year) // 计算农历闰月天数 - } else { - temp = this.monthDays(year, i)// 计算农历普通月天数 - } - // 解除闰月 - if (isLeap == true && i == (leap + 1)) { isLeap = false } - offset -= temp - } - // 闰月导致数组下标重叠取反 - if (offset == 0 && leap > 0 && i == leap + 1) { - if (isLeap) { - isLeap = false - } else { - isLeap = true; --i - } - } - if (offset < 0) { - offset += temp; --i - } - // 农历月 - let month = i - // 农历日 - let day = offset + 1 - // 天干地支处理 - let sm = m - 1 - let gzY = this.toGanZhiYear(year) - - // 当月的两个节气 - // bugfix-2017-7-24 11:03:38 use lunar Year Param `y` Not `year` - let firstNode = this.getTerm(y, (m * 2 - 1))// 返回当月「节」为几日开始 - let secondNode = this.getTerm(y, (m * 2))// 返回当月「节」为几日开始 - - // 依据12节气修正干支月 - let gzM = this.toGanZhi((y - 1900) * 12 + m + 11) - if (d >= firstNode) { - gzM = this.toGanZhi((y - 1900) * 12 + m + 12) - } - - // 传入的日期的节气与否 - let isTerm = false - let Term = null - if (firstNode == d) { - isTerm = true - Term = this.solarTerm[m * 2 - 2] - } - if (secondNode == d) { - isTerm = true - Term = this.solarTerm[m * 2 - 1] - } - // 日柱 当月一日与 1900/1/1 相差天数 - let dayCyclical = Date.UTC(y, sm, 1, 0, 0, 0, 0) / 86400000 + 25567 + 10 - let gzD = this.toGanZhi(dayCyclical + d - 1) - // 该日期所属的星座 - let astro = this.toAstro(m, d) - - return { 'lYear': year, 'lMonth': month, 'lDay': day, 'Animal': this.getAnimal(year), 'IMonthCn': (isLeap ? '\u95f0' : '') + this.toChinaMonth(month), 'IDayCn': this.toChinaDay(day), 'cYear': y, 'cMonth': m, 'cDay': d, 'gzYear': gzY, 'gzMonth': gzM, 'gzDay': gzD, 'isToday': isToday, 'isLeap': isLeap, 'nWeek': nWeek, 'ncWeek': '\u661f\u671f' + cWeek, 'isTerm': isTerm, 'Term': Term, 'astro': astro } - }, - - /** - * 传入农历年月日以及传入的月份是否闰月获得详细的公历、农历object信息 <=>JSON - * @param y lunar year - * @param m lunar month - * @param d lunar day - * @param isLeapMonth lunar month is leap or not.[如果是农历闰月第四个参数赋值true即可] - * @return JSON object - * @eg:console.log(calendar.lunar2solar(1987,9,10)); - */ - lunar2solar: function (y, m, d, isLeapMonth) { // 参数区间1900.1.31~2100.12.1 - let isLeapMonth = !!isLeapMonth - let leapOffset = 0 - let leapMonth = this.leapMonth(y) - let leapDay = this.leapDays(y) - if (isLeapMonth && (leapMonth != m)) { return -1 }// 传参要求计算该闰月公历 但该年得出的闰月与传参的月份并不同 - if (y == 2100 && m == 12 && d > 1 || y == 1900 && m == 1 && d < 31) { return -1 }// 超出了最大极限值 - let day = this.monthDays(y, m) - let _day = day - // bugFix 2016-9-25 - // if month is leap, _day use leapDays method - if (isLeapMonth) { - _day = this.leapDays(y, m) - } - if (y < 1900 || y > 2100 || d > _day) { return -1 }// 参数合法性效验 - - // 计算农历的时间差 - let offset = 0 - for (let i = 1900; i < y; i++) { - offset += this.lYearDays(i) - } - let leap = 0; let isAdd = false - for (let i = 1; i < m; i++) { - leap = this.leapMonth(y) - if (!isAdd) { // 处理闰月 - if (leap <= i && leap > 0) { - offset += this.leapDays(y); isAdd = true - } - } - offset += this.monthDays(y, i) - } - // 转换闰月农历 需补充该年闰月的前一个月的时差 - if (isLeapMonth) { offset += day } - // 1900年农历正月一日的公历时间为1900年1月30日0时0分0秒(该时间也是本农历的最开始起始点) - let stmap = Date.UTC(1900, 1, 30, 0, 0, 0) - let calObj = new Date((offset + d - 31) * 86400000 + stmap) - let cY = calObj.getUTCFullYear() - let cM = calObj.getUTCMonth() + 1 - let cD = calObj.getUTCDate() - - return this.solar2lunar(cY, cM, cD) - } -} - -export default calendar diff --git a/sport-erp-admin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue b/sport-erp-admin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue deleted file mode 100644 index 0f9e121..0000000 --- a/sport-erp-admin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue +++ /dev/null @@ -1,947 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/en.json b/sport-erp-admin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/en.json deleted file mode 100644 index 024f22f..0000000 --- a/sport-erp-admin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/en.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "uni-datetime-picker.selectDate": "select date", - "uni-datetime-picker.selectTime": "select time", - "uni-datetime-picker.selectDateTime": "select date and time", - "uni-datetime-picker.startDate": "start date", - "uni-datetime-picker.endDate": "end date", - "uni-datetime-picker.startTime": "start time", - "uni-datetime-picker.endTime": "end time", - "uni-datetime-picker.ok": "ok", - "uni-datetime-picker.clear": "clear", - "uni-datetime-picker.cancel": "cancel", - "uni-datetime-picker.year": "-", - "uni-datetime-picker.month": "", - "uni-calender.MON": "MON", - "uni-calender.TUE": "TUE", - "uni-calender.WED": "WED", - "uni-calender.THU": "THU", - "uni-calender.FRI": "FRI", - "uni-calender.SAT": "SAT", - "uni-calender.SUN": "SUN", - "uni-calender.confirm": "confirm" -} diff --git a/sport-erp-admin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/index.js b/sport-erp-admin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/index.js deleted file mode 100644 index de7509c..0000000 --- a/sport-erp-admin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/index.js +++ /dev/null @@ -1,8 +0,0 @@ -import en from './en.json' -import zhHans from './zh-Hans.json' -import zhHant from './zh-Hant.json' -export default { - en, - 'zh-Hans': zhHans, - 'zh-Hant': zhHant -} diff --git a/sport-erp-admin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hans.json b/sport-erp-admin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hans.json deleted file mode 100644 index d2df5e7..0000000 --- a/sport-erp-admin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hans.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "uni-datetime-picker.selectDate": "选择日期", - "uni-datetime-picker.selectTime": "选择时间", - "uni-datetime-picker.selectDateTime": "选择日期时间", - "uni-datetime-picker.startDate": "开始日期", - "uni-datetime-picker.endDate": "结束日期", - "uni-datetime-picker.startTime": "开始时间", - "uni-datetime-picker.endTime": "结束时间", - "uni-datetime-picker.ok": "确定", - "uni-datetime-picker.clear": "清除", - "uni-datetime-picker.cancel": "取消", - "uni-datetime-picker.year": "年", - "uni-datetime-picker.month": "月", - "uni-calender.SUN": "日", - "uni-calender.MON": "一", - "uni-calender.TUE": "二", - "uni-calender.WED": "三", - "uni-calender.THU": "四", - "uni-calender.FRI": "五", - "uni-calender.SAT": "六", - "uni-calender.confirm": "确认" -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hant.json b/sport-erp-admin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hant.json deleted file mode 100644 index d23fa3c..0000000 --- a/sport-erp-admin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/zh-Hant.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "uni-datetime-picker.selectDate": "選擇日期", - "uni-datetime-picker.selectTime": "選擇時間", - "uni-datetime-picker.selectDateTime": "選擇日期時間", - "uni-datetime-picker.startDate": "開始日期", - "uni-datetime-picker.endDate": "結束日期", - "uni-datetime-picker.startTime": "開始时间", - "uni-datetime-picker.endTime": "結束时间", - "uni-datetime-picker.ok": "確定", - "uni-datetime-picker.clear": "清除", - "uni-datetime-picker.cancel": "取消", - "uni-datetime-picker.year": "年", - "uni-datetime-picker.month": "月", - "uni-calender.SUN": "日", - "uni-calender.MON": "一", - "uni-calender.TUE": "二", - "uni-calender.WED": "三", - "uni-calender.THU": "四", - "uni-calender.FRI": "五", - "uni-calender.SAT": "六", - "uni-calender.confirm": "確認" -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/keypress.js b/sport-erp-admin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/keypress.js deleted file mode 100644 index 9601aba..0000000 --- a/sport-erp-admin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/keypress.js +++ /dev/null @@ -1,45 +0,0 @@ -// #ifdef H5 -export default { - name: 'Keypress', - props: { - disable: { - type: Boolean, - default: false - } - }, - mounted () { - const keyNames = { - esc: ['Esc', 'Escape'], - tab: 'Tab', - enter: 'Enter', - space: [' ', 'Spacebar'], - up: ['Up', 'ArrowUp'], - left: ['Left', 'ArrowLeft'], - right: ['Right', 'ArrowRight'], - down: ['Down', 'ArrowDown'], - delete: ['Backspace', 'Delete', 'Del'] - } - const listener = ($event) => { - if (this.disable) { - return - } - const keyName = Object.keys(keyNames).find(key => { - const keyName = $event.key - const value = keyNames[key] - return value === keyName || (Array.isArray(value) && value.includes(keyName)) - }) - if (keyName) { - // 避免和其他按键事件冲突 - setTimeout(() => { - this.$emit(keyName, {}) - }, 0) - } - } - document.addEventListener('keyup', listener) - this.$once('hook:beforeDestroy', () => { - document.removeEventListener('keyup', listener) - }) - }, - render: () => {} -} -// #endif \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/time-picker.vue b/sport-erp-admin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/time-picker.vue deleted file mode 100644 index 1817692..0000000 --- a/sport-erp-admin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/time-picker.vue +++ /dev/null @@ -1,940 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue b/sport-erp-admin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue deleted file mode 100644 index 11fc45a..0000000 --- a/sport-erp-admin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue +++ /dev/null @@ -1,1057 +0,0 @@ - - - - diff --git a/sport-erp-admin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/util.js b/sport-erp-admin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/util.js deleted file mode 100644 index 01802fa..0000000 --- a/sport-erp-admin/uni_modules/uni-datetime-picker/components/uni-datetime-picker/util.js +++ /dev/null @@ -1,421 +0,0 @@ -class Calendar { - constructor({ - selected, - startDate, - endDate, - range, - } = {}) { - // 当前日期 - this.date = this.getDateObj(new Date()) // 当前初入日期 - // 打点信息 - this.selected = selected || []; - // 起始时间 - this.startDate = startDate - // 终止时间 - this.endDate = endDate - // 是否范围选择 - this.range = range - // 多选状态 - this.cleanMultipleStatus() - // 每周日期 - this.weeks = {} - this.lastHover = false - } - /** - * 设置日期 - * @param {Object} date - */ - setDate(date) { - const selectDate = this.getDateObj(date) - this.getWeeks(selectDate.fullDate) - } - - /** - * 清理多选状态 - */ - cleanMultipleStatus() { - this.multipleStatus = { - before: '', - after: '', - data: [] - } - } - - setStartDate(startDate) { - this.startDate = startDate - } - - setEndDate(endDate) { - this.endDate = endDate - } - - getPreMonthObj(date) { - date = fixIosDateFormat(date) - date = new Date(date) - - const oldMonth = date.getMonth() - date.setMonth(oldMonth - 1) - const newMonth = date.getMonth() - if (oldMonth !== 0 && newMonth - oldMonth === 0) { - date.setMonth(newMonth - 1) - } - return this.getDateObj(date) - } - getNextMonthObj(date) { - date = fixIosDateFormat(date) - date = new Date(date) - - const oldMonth = date.getMonth() - date.setMonth(oldMonth + 1) - const newMonth = date.getMonth() - if (newMonth - oldMonth > 1) { - date.setMonth(newMonth - 1) - } - return this.getDateObj(date) - } - - /** - * 获取指定格式Date对象 - */ - getDateObj(date) { - date = fixIosDateFormat(date) - date = new Date(date) - - return { - fullDate: getDate(date), - year: date.getFullYear(), - month: addZero(date.getMonth() + 1), - date: addZero(date.getDate()), - day: date.getDay() - } - } - - /** - * 获取上一个月日期集合 - */ - getPreMonthDays(amount, dateObj) { - const result = [] - for (let i = amount - 1; i >= 0; i--) { - const month = dateObj.month - 1 - result.push({ - date: new Date(dateObj.year, month, -i).getDate(), - month, - disable: true - }) - } - return result - } - /** - * 获取本月日期集合 - */ - getCurrentMonthDays(amount, dateObj) { - const result = [] - const fullDate = this.date.fullDate - for (let i = 1; i <= amount; i++) { - const currentDate = `${dateObj.year}-${dateObj.month}-${addZero(i)}` - const isToday = fullDate === currentDate - // 获取打点信息 - const info = this.selected && this.selected.find((item) => { - if (this.dateEqual(currentDate, item.date)) { - return item - } - }) - - // 日期禁用 - let disableBefore = true - let disableAfter = true - if (this.startDate) { - disableBefore = dateCompare(this.startDate, currentDate) - } - - if (this.endDate) { - disableAfter = dateCompare(currentDate, this.endDate) - } - - let multiples = this.multipleStatus.data - let multiplesStatus = -1 - if (this.range && multiples) { - multiplesStatus = multiples.findIndex((item) => { - return this.dateEqual(item, currentDate) - }) - } - const checked = multiplesStatus !== -1 - - result.push({ - fullDate: currentDate, - year: dateObj.year, - date: i, - multiple: this.range ? checked : false, - beforeMultiple: this.isLogicBefore(currentDate, this.multipleStatus.before, this.multipleStatus.after), - afterMultiple: this.isLogicAfter(currentDate, this.multipleStatus.before, this.multipleStatus.after), - month: dateObj.month, - disable: (this.startDate && !dateCompare(this.startDate, currentDate)) || (this.endDate && !dateCompare( - currentDate, this.endDate)), - isToday, - userChecked: false, - extraInfo: info - }) - } - return result - } - /** - * 获取下一个月日期集合 - */ - _getNextMonthDays(amount, dateObj) { - const result = [] - const month = dateObj.month + 1 - for (let i = 1; i <= amount; i++) { - result.push({ - date: i, - month, - disable: true - }) - } - return result - } - - /** - * 获取当前日期详情 - * @param {Object} date - */ - getInfo(date) { - if (!date) { - date = new Date() - } - - return this.calendar.find(item => item.fullDate === this.getDateObj(date).fullDate) - } - - /** - * 比较时间是否相等 - */ - dateEqual(before, after) { - before = new Date(fixIosDateFormat(before)) - after = new Date(fixIosDateFormat(after)) - return before.valueOf() === after.valueOf() - } - - /** - * 比较真实起始日期 - */ - - isLogicBefore(currentDate, before, after) { - let logicBefore = before - if (before && after) { - logicBefore = dateCompare(before, after) ? before : after - } - return this.dateEqual(logicBefore, currentDate) - } - - isLogicAfter(currentDate, before, after) { - let logicAfter = after - if (before && after) { - logicAfter = dateCompare(before, after) ? after : before - } - return this.dateEqual(logicAfter, currentDate) - } - - /** - * 获取日期范围内所有日期 - * @param {Object} begin - * @param {Object} end - */ - geDateAll(begin, end) { - var arr = [] - var ab = begin.split('-') - var ae = end.split('-') - var db = new Date() - db.setFullYear(ab[0], ab[1] - 1, ab[2]) - var de = new Date() - de.setFullYear(ae[0], ae[1] - 1, ae[2]) - var unixDb = db.getTime() - 24 * 60 * 60 * 1000 - var unixDe = de.getTime() - 24 * 60 * 60 * 1000 - for (var k = unixDb; k <= unixDe;) { - k = k + 24 * 60 * 60 * 1000 - arr.push(this.getDateObj(new Date(parseInt(k))).fullDate) - } - return arr - } - - /** - * 获取多选状态 - */ - setMultiple(fullDate) { - if (!this.range) return - - let { - before, - after - } = this.multipleStatus - if (before && after) { - if (!this.lastHover) { - this.lastHover = true - return - } - this.multipleStatus.before = fullDate - this.multipleStatus.after = '' - this.multipleStatus.data = [] - this.multipleStatus.fulldate = '' - this.lastHover = false - } else { - if (!before) { - this.multipleStatus.before = fullDate - this.multipleStatus.after = undefined; - this.lastHover = false - } else { - this.multipleStatus.after = fullDate - if (dateCompare(this.multipleStatus.before, this.multipleStatus.after)) { - this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus - .after); - } else { - this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus - .before); - } - this.lastHover = true - } - } - this.getWeeks(fullDate) - } - - /** - * 鼠标 hover 更新多选状态 - */ - setHoverMultiple(fullDate) { - //抖音小程序点击会触发hover事件,需要避免一下 - // #ifndef MP-TOUTIAO - if (!this.range || this.lastHover) return - const { - before - } = this.multipleStatus - - if (!before) { - this.multipleStatus.before = fullDate - } else { - this.multipleStatus.after = fullDate - if (dateCompare(this.multipleStatus.before, this.multipleStatus.after)) { - this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus.after); - } else { - this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus.before); - } - } - this.getWeeks(fullDate) - // #endif - - } - - /** - * 更新默认值多选状态 - */ - setDefaultMultiple(before, after) { - this.multipleStatus.before = before - this.multipleStatus.after = after - if (before && after) { - if (dateCompare(before, after)) { - this.multipleStatus.data = this.geDateAll(before, after); - this.getWeeks(after) - } else { - this.multipleStatus.data = this.geDateAll(after, before); - this.getWeeks(before) - } - } - } - - /** - * 获取每周数据 - * @param {Object} dateData - */ - getWeeks(dateData) { - const { - year, - month, - } = this.getDateObj(dateData) - - const preMonthDayAmount = new Date(year, month - 1, 1).getDay() - const preMonthDays = this.getPreMonthDays(preMonthDayAmount, this.getDateObj(dateData)) - - const currentMonthDayAmount = new Date(year, month, 0).getDate() - const currentMonthDays = this.getCurrentMonthDays(currentMonthDayAmount, this.getDateObj(dateData)) - - const nextMonthDayAmount = 42 - preMonthDayAmount - currentMonthDayAmount - const nextMonthDays = this._getNextMonthDays(nextMonthDayAmount, this.getDateObj(dateData)) - - const calendarDays = [...preMonthDays, ...currentMonthDays, ...nextMonthDays] - - const weeks = new Array(6) - for (let i = 0; i < calendarDays.length; i++) { - const index = Math.floor(i / 7) - if (!weeks[index]) { - weeks[index] = new Array(7) - } - weeks[index][i % 7] = calendarDays[i] - } - - this.calendar = calendarDays - this.weeks = weeks - } -} - -function getDateTime(date, hideSecond) { - return `${getDate(date)} ${getTime(date, hideSecond)}` -} - -function getDate(date) { - date = fixIosDateFormat(date) - date = new Date(date) - const year = date.getFullYear() - const month = date.getMonth() + 1 - const day = date.getDate() - return `${year}-${addZero(month)}-${addZero(day)}` -} - -function getTime(date, hideSecond) { - date = fixIosDateFormat(date) - date = new Date(date) - const hour = date.getHours() - const minute = date.getMinutes() - const second = date.getSeconds() - return hideSecond ? `${addZero(hour)}:${addZero(minute)}` : `${addZero(hour)}:${addZero(minute)}:${addZero(second)}` -} - -function addZero(num) { - if (num < 10) { - num = `0${num}` - } - return num -} - -function getDefaultSecond(hideSecond) { - return hideSecond ? '00:00' : '00:00:00' -} - -function dateCompare(startDate, endDate) { - startDate = new Date(fixIosDateFormat(startDate)) - endDate = new Date(fixIosDateFormat(endDate)) - return startDate <= endDate -} - -function checkDate(date) { - const dateReg = /((19|20)\d{2})(-|\/)\d{1,2}(-|\/)\d{1,2}/g - return date.match(dateReg) -} -//ios低版本15及以下,无法匹配 没有 ’秒‘ 时的情况,所以需要在末尾 秒 加上 问号 -const dateTimeReg = /^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])( [0-5]?[0-9]:[0-5]?[0-9](:[0-5]?[0-9])?)?$/; - -function fixIosDateFormat(value) { - if (typeof value === 'string' && dateTimeReg.test(value)) { - value = value.replace(/-/g, '/') - } - return value -} - -export { - Calendar, - getDateTime, - getDate, - getTime, - addZero, - getDefaultSecond, - dateCompare, - checkDate, - fixIosDateFormat -} diff --git a/sport-erp-admin/uni_modules/uni-datetime-picker/package.json b/sport-erp-admin/uni_modules/uni-datetime-picker/package.json deleted file mode 100644 index 4d1b05c..0000000 --- a/sport-erp-admin/uni_modules/uni-datetime-picker/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "id": "uni-datetime-picker", - "displayName": "uni-datetime-picker 日期选择器", - "version": "2.2.34", - "description": "uni-datetime-picker 日期时间选择器,支持日历,支持范围选择", - "keywords": [ - "uni-datetime-picker", - "uni-ui", - "uniui", - "日期时间选择器", - "日期时间" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, -"dcloudext": { - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", - "type": "component-vue" - }, - "uni_modules": { - "dependencies": [ - "uni-scss", - "uni-icons" - ], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y", - "alipay": "n" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "n" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y" - }, - "快应用": { - "华为": "u", - "联盟": "u" - }, - "Vue": { - "vue2": "y", - "vue3": "y" - } - } - } - } -} diff --git a/sport-erp-admin/uni_modules/uni-datetime-picker/readme.md b/sport-erp-admin/uni_modules/uni-datetime-picker/readme.md deleted file mode 100644 index 162fbef..0000000 --- a/sport-erp-admin/uni_modules/uni-datetime-picker/readme.md +++ /dev/null @@ -1,21 +0,0 @@ - - -> `重要通知:组件升级更新 2.0.0 后,支持日期+时间范围选择,组件 ui 将使用日历选择日期,ui 变化较大,同时支持 PC 和 移动端。此版本不向后兼容,不再支持单独的时间选择(type=time)及相关的 hide-second 属性(时间选可使用内置组件 picker)。若仍需使用旧版本,可在插件市场下载*非uni_modules版本*,旧版本将不再维护` - -## DatetimePicker 时间选择器 - -> **组件名:uni-datetime-picker** -> 代码块: `uDatetimePicker` - - -该组件的优势是,支持**时间戳**输入和输出(起始时间、终止时间也支持时间戳),可**同时选择**日期和时间。 - -若只是需要单独选择日期和时间,不需要时间戳输入和输出,可使用原生的 picker 组件。 - -**_点击 picker 默认值规则:_** - -- 若设置初始值 value, 会显示在 picker 显示框中 -- 若无初始值 value,则初始值 value 为当前本地时间 Date.now(), 但不会显示在 picker 显示框中 - -### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-datetime-picker) -#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-drawer/changelog.md b/sport-erp-admin/uni_modules/uni-drawer/changelog.md deleted file mode 100644 index 6d2488c..0000000 --- a/sport-erp-admin/uni_modules/uni-drawer/changelog.md +++ /dev/null @@ -1,13 +0,0 @@ -## 1.2.1(2021-11-22) -- 修复 vue3中个别scss变量无法找到的问题 -## 1.2.0(2021-11-19) -- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) -- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-drawer](https://uniapp.dcloud.io/component/uniui/uni-drawer) -## 1.1.1(2021-07-30) -- 优化 vue3下事件警告的问题 -## 1.1.0(2021-07-13) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 1.0.7(2021-05-12) -- 新增 组件示例地址 -## 1.0.6(2021-02-04) -- 调整为uni_modules目录规范 diff --git a/sport-erp-admin/uni_modules/uni-drawer/components/uni-drawer/keypress.js b/sport-erp-admin/uni_modules/uni-drawer/components/uni-drawer/keypress.js deleted file mode 100644 index 62dda46..0000000 --- a/sport-erp-admin/uni_modules/uni-drawer/components/uni-drawer/keypress.js +++ /dev/null @@ -1,45 +0,0 @@ -// #ifdef H5 -export default { - name: 'Keypress', - props: { - disable: { - type: Boolean, - default: false - } - }, - mounted () { - const keyNames = { - esc: ['Esc', 'Escape'], - tab: 'Tab', - enter: 'Enter', - space: [' ', 'Spacebar'], - up: ['Up', 'ArrowUp'], - left: ['Left', 'ArrowLeft'], - right: ['Right', 'ArrowRight'], - down: ['Down', 'ArrowDown'], - delete: ['Backspace', 'Delete', 'Del'] - } - const listener = ($event) => { - if (this.disable) { - return - } - const keyName = Object.keys(keyNames).find(key => { - const keyName = $event.key - const value = keyNames[key] - return value === keyName || (Array.isArray(value) && value.includes(keyName)) - }) - if (keyName) { - // 避免和其他按键事件冲突 - setTimeout(() => { - this.$emit(keyName, {}) - }, 0) - } - } - document.addEventListener('keyup', listener) - // this.$once('hook:beforeDestroy', () => { - // document.removeEventListener('keyup', listener) - // }) - }, - render: () => {} -} -// #endif diff --git a/sport-erp-admin/uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue b/sport-erp-admin/uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue deleted file mode 100644 index 2471521..0000000 --- a/sport-erp-admin/uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue +++ /dev/null @@ -1,183 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-drawer/package.json b/sport-erp-admin/uni_modules/uni-drawer/package.json deleted file mode 100644 index dd056e4..0000000 --- a/sport-erp-admin/uni_modules/uni-drawer/package.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "id": "uni-drawer", - "displayName": "uni-drawer 抽屉", - "version": "1.2.1", - "description": "抽屉式导航,用于展示侧滑菜单,侧滑导航。", - "keywords": [ - "uni-ui", - "uniui", - "drawer", - "抽屉", - "侧滑导航" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ], - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" - }, - "uni_modules": { - "dependencies": ["uni-scss"], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "y" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y" - }, - "快应用": { - "华为": "u", - "联盟": "u" - }, - "Vue": { - "vue2": "y", - "vue3": "y" - } - } - } - } -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-drawer/readme.md b/sport-erp-admin/uni_modules/uni-drawer/readme.md deleted file mode 100644 index dcf6e6b..0000000 --- a/sport-erp-admin/uni_modules/uni-drawer/readme.md +++ /dev/null @@ -1,10 +0,0 @@ - - -## Drawer 抽屉 -> **组件名:uni-drawer** -> 代码块: `uDrawer` - -抽屉侧滑菜单。 - -### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-drawer) -#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-easyinput/changelog.md b/sport-erp-admin/uni_modules/uni-easyinput/changelog.md deleted file mode 100644 index 84c72eb..0000000 --- a/sport-erp-admin/uni_modules/uni-easyinput/changelog.md +++ /dev/null @@ -1,115 +0,0 @@ -## 1.1.19(2024-07-18) -- 修复 初始值传入 null 导致input报错的bug -## 1.1.18(2024-04-11) -- 修复 easyinput组件双向绑定问题 -## 1.1.17(2024-03-28) -- 修复 在头条小程序下丢失事件绑定的问题 -## 1.1.16(2024-03-20) -- 修复 在密码输入情况下 清除和小眼睛覆盖bug 在edge浏览器下显示双眼睛bug -## 1.1.15(2024-02-21) -- 新增 左侧插槽:left -## 1.1.14(2024-02-19) -- 修复 onBlur的emit传值错误 -## 1.1.12(2024-01-29) -- 补充 adjust-position文档属性补充 -## 1.1.11(2024-01-29) -- 补充 adjust-position属性传递值:(Boolean)当键盘弹起时,是否自动上推页面 -## 1.1.10(2024-01-22) -- 去除 移除无用的log输出 -## 1.1.9(2023-04-11) -- 修复 vue3 下 keyboardheightchange 事件报错的bug -## 1.1.8(2023-03-29) -- 优化 trim 属性默认值 -## 1.1.7(2023-03-29) -- 新增 cursor-spacing 属性 -## 1.1.6(2023-01-28) -- 新增 keyboardheightchange 事件,可监听键盘高度变化 -## 1.1.5(2022-11-29) -- 优化 主题样式 -## 1.1.4(2022-10-27) -- 修复 props 中背景颜色无默认值的bug -## 1.1.0(2022-06-30) - -- 新增 在 uni-forms 1.4.0 中使用可以在 blur 时校验内容 -- 新增 clear 事件,点击右侧叉号图标触发 -- 新增 change 事件 ,仅在输入框失去焦点或用户按下回车时触发 -- 优化 组件样式,组件获取焦点时高亮显示,图标颜色调整等 - -## 1.0.5(2022-06-07) - -- 优化 clearable 显示策略 - -## 1.0.4(2022-06-07) - -- 优化 clearable 显示策略 - -## 1.0.3(2022-05-20) - -- 修复 关闭图标某些情况下无法取消的 bug - -## 1.0.2(2022-04-12) - -- 修复 默认值不生效的 bug - -## 1.0.1(2022-04-02) - -- 修复 value 不能为 0 的 bug - -## 1.0.0(2021-11-19) - -- 优化 组件 UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) -- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-easyinput](https://uniapp.dcloud.io/component/uniui/uni-easyinput) - -## 0.1.4(2021-08-20) - -- 修复 在 uni-forms 的动态表单中默认值校验不通过的 bug - -## 0.1.3(2021-08-11) - -- 修复 在 uni-forms 中重置表单,错误信息无法清除的问题 - -## 0.1.2(2021-07-30) - -- 优化 vue3 下事件警告的问题 - -## 0.1.1 - -- 优化 errorMessage 属性支持 Boolean 类型 - -## 0.1.0(2021-07-13) - -- 组件兼容 vue3,如何创建 vue3 项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) - -## 0.0.16(2021-06-29) - -- 修复 confirmType 属性(仅 type="text" 生效)导致多行文本框无法换行的 bug - -## 0.0.15(2021-06-21) - -- 修复 passwordIcon 属性拼写错误的 bug - -## 0.0.14(2021-06-18) - -- 新增 passwordIcon 属性,当 type=password 时是否显示小眼睛图标 -- 修复 confirmType 属性不生效的问题 - -## 0.0.13(2021-06-04) - -- 修复 disabled 状态可清出内容的 bug - -## 0.0.12(2021-05-12) - -- 新增 组件示例地址 - -## 0.0.11(2021-05-07) - -- 修复 input-border 属性不生效的问题 - -## 0.0.10(2021-04-30) - -- 修复 ios 遮挡文字、显示一半的问题 - -## 0.0.9(2021-02-05) - -- 调整为 uni_modules 目录规范 -- 优化 兼容 nvue 页面 diff --git a/sport-erp-admin/uni_modules/uni-easyinput/components/uni-easyinput/common.js b/sport-erp-admin/uni_modules/uni-easyinput/components/uni-easyinput/common.js deleted file mode 100644 index fde8d3c..0000000 --- a/sport-erp-admin/uni_modules/uni-easyinput/components/uni-easyinput/common.js +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @desc 函数防抖 - * @param func 目标函数 - * @param wait 延迟执行毫秒数 - * @param immediate true - 立即执行, false - 延迟执行 - */ -export const debounce = function(func, wait = 1000, immediate = true) { - let timer; - return function() { - let context = this, - args = arguments; - if (timer) clearTimeout(timer); - if (immediate) { - let callNow = !timer; - timer = setTimeout(() => { - timer = null; - }, wait); - if (callNow) func.apply(context, args); - } else { - timer = setTimeout(() => { - func.apply(context, args); - }, wait) - } - } -} -/** - * @desc 函数节流 - * @param func 函数 - * @param wait 延迟执行毫秒数 - * @param type 1 使用表时间戳,在时间段开始的时候触发 2 使用表定时器,在时间段结束的时候触发 - */ -export const throttle = (func, wait = 1000, type = 1) => { - let previous = 0; - let timeout; - return function() { - let context = this; - let args = arguments; - if (type === 1) { - let now = Date.now(); - - if (now - previous > wait) { - func.apply(context, args); - previous = now; - } - } else if (type === 2) { - if (!timeout) { - timeout = setTimeout(() => { - timeout = null; - func.apply(context, args) - }, wait) - } - } - } -} diff --git a/sport-erp-admin/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue b/sport-erp-admin/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue deleted file mode 100644 index 93506d6..0000000 --- a/sport-erp-admin/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue +++ /dev/null @@ -1,676 +0,0 @@ - - - - - \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-easyinput/package.json b/sport-erp-admin/uni_modules/uni-easyinput/package.json deleted file mode 100644 index 2939256..0000000 --- a/sport-erp-admin/uni_modules/uni-easyinput/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "id": "uni-easyinput", - "displayName": "uni-easyinput 增强输入框", - "version": "1.1.19", - "description": "Easyinput 组件是对原生input组件的增强", - "keywords": [ - "uni-ui", - "uniui", - "input", - "uni-easyinput", - "输入框" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, -"dcloudext": { - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", - "type": "component-vue" - }, - "uni_modules": { - "dependencies": [ - "uni-scss", - "uni-icons" - ], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y", - "alipay": "n" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "y" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y" - }, - "快应用": { - "华为": "u", - "联盟": "u" - }, - "Vue": { - "vue2": "y", - "vue3": "y" - } - } - } - } -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-easyinput/readme.md b/sport-erp-admin/uni_modules/uni-easyinput/readme.md deleted file mode 100644 index f1faf8f..0000000 --- a/sport-erp-admin/uni_modules/uni-easyinput/readme.md +++ /dev/null @@ -1,11 +0,0 @@ - - -### Easyinput 增强输入框 -> **组件名:uni-easyinput** -> 代码块: `uEasyinput` - - -easyinput 组件是对原生input组件的增强 ,是专门为配合表单组件[uni-forms](https://ext.dcloud.net.cn/plugin?id=2773)而设计的,easyinput 内置了边框,图标等,同时包含 input 所有功能 - -### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-easyinput) -#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-fab/changelog.md b/sport-erp-admin/uni_modules/uni-fab/changelog.md deleted file mode 100644 index 9bd4729..0000000 --- a/sport-erp-admin/uni_modules/uni-fab/changelog.md +++ /dev/null @@ -1,23 +0,0 @@ -## 1.2.5(2023-03-29) -- 新增 pattern.icon 属性,可自定义图标 -## 1.2.4(2022-09-07) -小程序端由于 style 使用了对象导致报错,[详情](https://ask.dcloud.net.cn/question/152790?item_id=211778&rf=false) -## 1.2.3(2022-09-05) -- 修复 nvue 环境下,具有 tabBar 时,fab 组件下部位置无法正常获取 --window-bottom 的bug,详见:[https://ask.dcloud.net.cn/question/110638?notification_id=826310](https://ask.dcloud.net.cn/question/110638?notification_id=826310) -## 1.2.2(2021-12-29) -- 更新 组件依赖 -## 1.2.1(2021-11-19) -- 修复 阴影颜色不正确的bug -## 1.2.0(2021-11-19) -- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) -- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-fab](https://uniapp.dcloud.io/component/uniui/uni-fab) -## 1.1.1(2021-11-09) -- 新增 提供组件设计资源,组件样式调整 -## 1.1.0(2021-07-30) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 1.0.7(2021-05-12) -- 新增 组件示例地址 -## 1.0.6(2021-02-05) -- 调整为uni_modules目录规范 -- 优化 按钮背景色调整 -- 优化 兼容pc端 diff --git a/sport-erp-admin/uni_modules/uni-fab/components/uni-fab/uni-fab.vue b/sport-erp-admin/uni_modules/uni-fab/components/uni-fab/uni-fab.vue deleted file mode 100644 index dfa65c1..0000000 --- a/sport-erp-admin/uni_modules/uni-fab/components/uni-fab/uni-fab.vue +++ /dev/null @@ -1,491 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-fab/package.json b/sport-erp-admin/uni_modules/uni-fab/package.json deleted file mode 100644 index 18c0810..0000000 --- a/sport-erp-admin/uni_modules/uni-fab/package.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "id": "uni-fab", - "displayName": "uni-fab 悬浮按钮", - "version": "1.2.5", - "description": "悬浮按钮 fab button ,点击可展开一个图标按钮菜单。", - "keywords": [ - "uni-ui", - "uniui", - "按钮", - "悬浮按钮", - "fab" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, -"dcloudext": { - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", - "type": "component-vue" - }, - "uni_modules": { - "dependencies": ["uni-scss","uni-icons"], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "y" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y" - }, - "快应用": { - "华为": "u", - "联盟": "u" - }, - "Vue": { - "vue2": "y", - "vue3": "y" - } - } - } - } -} diff --git a/sport-erp-admin/uni_modules/uni-fab/readme.md b/sport-erp-admin/uni_modules/uni-fab/readme.md deleted file mode 100644 index 9a444e8..0000000 --- a/sport-erp-admin/uni_modules/uni-fab/readme.md +++ /dev/null @@ -1,9 +0,0 @@ -## Fab 悬浮按钮 -> **组件名:uni-fab** -> 代码块: `uFab` - - -点击可展开一个图形按钮菜单 - -### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-fab) -#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-feedback/changelog.md b/sport-erp-admin/uni_modules/uni-feedback/changelog.md deleted file mode 100644 index a2decbb..0000000 --- a/sport-erp-admin/uni_modules/uni-feedback/changelog.md +++ /dev/null @@ -1,10 +0,0 @@ -## 1.1.1(2024-03-26) -支持支付宝小程序云 -## 1.1.0(2022-07-13) -新增,应用[pages_init](https://uniapp.dcloud.io/plugin/publish.html#pages-init)当导入插件到项目工程时,自动合并本插件的页面路由到项目的pages.json -## 1.0.5(2022-07-13) -新增,应用[pages_init](https://uniapp.dcloud.io/plugin/publish.html#pages-init)当导入插件到项目工程时,自动合并本插件的页面路由到项目的pages.json -## 1.0.4(2021-09-26) -为了数据安全,`opendb-feedback`表的`permission`中`delete`,`update`的值默认为`false` -## 1.0.3(2021-08-26) -删除多余的云函数test2 \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-feedback/js_sdk/validator/opendb-feedback.js b/sport-erp-admin/uni_modules/uni-feedback/js_sdk/validator/opendb-feedback.js deleted file mode 100644 index be3d330..0000000 --- a/sport-erp-admin/uni_modules/uni-feedback/js_sdk/validator/opendb-feedback.js +++ /dev/null @@ -1,98 +0,0 @@ -// 表单校验规则由 schema2code 生成,不建议直接修改校验规则,而建议通过 schema2code 生成, 详情: https://uniapp.dcloud.net.cn/uniCloud/schema - - -const validator = { - "content": { - "rules": [ - { - "required": true - }, - { - "format": "string" - } - ], - "label": "留言内容/回复内容" - }, - "imgs": { - "rules": [ - { - "format": "array" - }, - { - "arrayType": "file" - }, - { - "maxLength": 6 - } - ], - "label": "图片列表" - }, - "contact": { - "rules": [ - { - "format": "string" - } - ], - "label": "联系人" - }, - "mobile": { - "rules": [ - { - "format": "string" - }, - { - "pattern": "^\\+?[0-9-]{3,20}$" - } - ], - "label": "联系电话" - } -} - -const enumConverter = {} - -function filterToWhere(filter, command) { - let where = {} - for (let field in filter) { - let { type, value } = filter[field] - switch (type) { - case "search": - if (typeof value === 'string' && value.length) { - where[field] = new RegExp(value) - } - break; - case "select": - if (value.length) { - let selectValue = [] - for (let s of value) { - selectValue.push(command.eq(s)) - } - where[field] = command.or(selectValue) - } - break; - case "range": - if (value.length) { - let gt = value[0] - let lt = value[1] - where[field] = command.and([command.gte(gt), command.lte(lt)]) - } - break; - case "date": - if (value.length) { - let [s, e] = value - let startDate = new Date(s) - let endDate = new Date(e) - where[field] = command.and([command.gte(startDate), command.lte(endDate)]) - } - break; - case "timestamp": - if (value.length) { - let [startDate, endDate] = value - where[field] = command.and([command.gte(startDate), command.lte(endDate)]) - } - break; - } - } - return where -} - -export { validator, enumConverter, filterToWhere } diff --git a/sport-erp-admin/uni_modules/uni-feedback/package.json b/sport-erp-admin/uni_modules/uni-feedback/package.json deleted file mode 100644 index 090a704..0000000 --- a/sport-erp-admin/uni_modules/uni-feedback/package.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "id": "uni-feedback", - "displayName": "问题反馈页面模板", - "version": "1.1.1", - "description": "问题反馈页面模板,方便开发者快速搭建问题反馈界面", - "keywords": [ - "问题反馈页面模板" -], - "repository": "", - "engines": { - "HBuilderX": "^3.1.0" - }, -"dcloudext": { - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "", - "type": "unicloud-template-page" - }, - "uni_modules": { - "dependencies": [ - "uni-forms", - "uni-file-picker", - "uni-easyinput", - "uni-load-more", - "uni-list", - "uni-fab", - "uni-link" - ], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y", - "alipay": "y" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "u" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "u", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y", - "钉钉": "u", - "快手": "u", - "飞书": "u", - "京东": "u" - }, - "快应用": { - "华为": "u", - "联盟": "u" - }, - "Vue": { - "vue2": "y", - "vue3": "y" - } - } - } - } -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-feedback/pages/opendb-feedback/detail.vue b/sport-erp-admin/uni_modules/uni-feedback/pages/opendb-feedback/detail.vue deleted file mode 100644 index fa28fca..0000000 --- a/sport-erp-admin/uni_modules/uni-feedback/pages/opendb-feedback/detail.vue +++ /dev/null @@ -1,113 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-feedback/pages/opendb-feedback/edit.vue b/sport-erp-admin/uni_modules/uni-feedback/pages/opendb-feedback/edit.vue deleted file mode 100644 index bd65125..0000000 --- a/sport-erp-admin/uni_modules/uni-feedback/pages/opendb-feedback/edit.vue +++ /dev/null @@ -1,167 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-feedback/pages/opendb-feedback/list.vue b/sport-erp-admin/uni_modules/uni-feedback/pages/opendb-feedback/list.vue deleted file mode 100644 index 1131edb..0000000 --- a/sport-erp-admin/uni_modules/uni-feedback/pages/opendb-feedback/list.vue +++ /dev/null @@ -1,70 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-feedback/pages/opendb-feedback/opendb-feedback.vue b/sport-erp-admin/uni_modules/uni-feedback/pages/opendb-feedback/opendb-feedback.vue deleted file mode 100644 index f8bc77e..0000000 --- a/sport-erp-admin/uni_modules/uni-feedback/pages/opendb-feedback/opendb-feedback.vue +++ /dev/null @@ -1,141 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-feedback/readme.md b/sport-erp-admin/uni_modules/uni-feedback/readme.md deleted file mode 100644 index 65d9192..0000000 --- a/sport-erp-admin/uni_modules/uni-feedback/readme.md +++ /dev/null @@ -1 +0,0 @@ -这是一个问题反馈客户端插件,admin端插件:[https://ext.dcloud.net.cn/plugin?id=4992](https://ext.dcloud.net.cn/plugin?id=4992) \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-feedback/uniCloud/database/opendb-feedback.schema.json b/sport-erp-admin/uni_modules/uni-feedback/uniCloud/database/opendb-feedback.schema.json deleted file mode 100644 index e13d874..0000000 --- a/sport-erp-admin/uni_modules/uni-feedback/uniCloud/database/opendb-feedback.schema.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "bsonType": "object", - "required": ["content"], - "permission": { - "create": "auth.uid != null", - "read": true, - "delete": false, - "update": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "user_id": { - "bsonType": "string", - "description": "留言反馈用户ID\/回复留言用户ID,参考uni-id-users表", - "foreignKey": "uni-id-users._id", - "forceDefaultValue": { - "$env": "uid" - } - }, - "create_date": { - "bsonType": "timestamp", - "title": "留言时间\/回复留言时间", - "forceDefaultValue": { - "$env": "now" - } - }, - "content": { - "bsonType": "string", - "title": "留言内容\/回复内容", - "componentForEdit": { - "name": "textarea" - }, - "trim": "right" - }, - "imgs": { - "bsonType": "array", - "arrayType": "file", - "maxLength": 6, - "fileMediaType": "image", - "title": "图片列表" - }, - "is_reply": { - "bsonType": "bool", - "title": "是否是回复类型" - }, - "feedback_id": { - "bsonType": "string", - "title": "被回复留言ID" - }, - "contact": { - "bsonType": "string", - "title": "联系人", - "trim": "both" - }, - "mobile": { - "bsonType": "string", - "title": "联系电话", - "pattern": "^\\+?[0-9-]{3,20}$", - "trim": "both" - }, - "reply_count": { - "permission": { - "write": false - }, - "bsonType": "int", - "title": "被回复条数", - "defaultValue": 0 - } - } -} diff --git a/sport-erp-admin/uni_modules/uni-file-picker/changelog.md b/sport-erp-admin/uni_modules/uni-file-picker/changelog.md deleted file mode 100644 index b81e7f9..0000000 --- a/sport-erp-admin/uni_modules/uni-file-picker/changelog.md +++ /dev/null @@ -1,81 +0,0 @@ -## 1.0.11(2024-07-19) -- 修复 vue3 使用value报错的bug -## 1.0.10(2024-07-09) -- 优化 vue3兼容性 -## 1.0.9(2024-07-09) -- 修复 value 属性不兼容vue3的bug -## 1.0.8(2024-03-20) -- 补充 删除文件时返回文件下标 -## 1.0.7(2024-02-21) -- 新增 微信小程序选择视频时改用chooseMedia,并返回视频缩略图 -## 1.0.6(2024-01-06) -- 新增 微信小程序不再调用chooseImage,而是调用chooseMedia -## 1.0.5(2024-01-03) -- 新增 上传文件至云存储携带本地文件名称 -## 1.0.4(2023-03-29) -- 修复 手动上传删除一个文件后不能再上传的bug -## 1.0.3(2022-12-19) -- 新增 sourceType 属性, 可以自定义图片和视频选择的来源 -## 1.0.2(2022-07-04) -- 修复 在uni-forms下样式不生效的bug -## 1.0.1(2021-11-23) -- 修复 参数为对象的情况下,url在某些情况显示错误的bug -## 1.0.0(2021-11-19) -- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) -- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-file-picker](https://uniapp.dcloud.io/component/uniui/uni-file-picker) -## 0.2.16(2021-11-08) -- 修复 传入空对象 ,显示错误的Bug -## 0.2.15(2021-08-30) -- 修复 return-type="object" 时且存在v-model时,无法删除文件的Bug -## 0.2.14(2021-08-23) -- 新增 参数中返回 fileID 字段 -## 0.2.13(2021-08-23) -- 修复 腾讯云传入fileID 不能回显的bug -- 修复 选择图片后,不能放大的问题 -## 0.2.12(2021-08-17) -- 修复 由于 0.2.11 版本引起的不能回显图片的Bug -## 0.2.11(2021-08-16) -- 新增 clearFiles(index) 方法,可以手动删除指定文件 -- 修复 v-model 值设为 null 报错的Bug -## 0.2.10(2021-08-13) -- 修复 return-type="object" 时,无法删除文件的Bug -## 0.2.9(2021-08-03) -- 修复 auto-upload 属性失效的Bug -## 0.2.8(2021-07-31) -- 修复 fileExtname属性不指定值报错的Bug -## 0.2.7(2021-07-31) -- 修复 在某种场景下图片不回显的Bug -## 0.2.6(2021-07-30) -- 修复 return-type为object下,返回值不正确的Bug -## 0.2.5(2021-07-30) -- 修复(重要) H5 平台下如果和uni-forms组件一同使用导致页面卡死的问题 -## 0.2.3(2021-07-28) -- 优化 调整示例代码 -## 0.2.2(2021-07-27) -- 修复 vue3 下赋值错误的Bug -- 优化 h5平台下上传文件导致页面卡死的问题 -## 0.2.0(2021-07-13) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 0.1.1(2021-07-02) -- 修复 sourceType 缺少默认值导致 ios 无法选择文件 -## 0.1.0(2021-06-30) -- 优化 解耦与uniCloud的强绑定关系 ,如不绑定服务空间,默认autoUpload为false且不可更改 -## 0.0.11(2021-06-30) -- 修复 由 0.0.10 版本引发的 returnType 属性失效的问题 -## 0.0.10(2021-06-29) -- 优化 文件上传后进度条消失时机 -## 0.0.9(2021-06-29) -- 修复 在uni-forms 中,删除文件 ,获取的值不对的Bug -## 0.0.8(2021-06-15) -- 修复 删除文件时无法触发 v-model 的Bug -## 0.0.7(2021-05-12) -- 新增 组件示例地址 -## 0.0.6(2021-04-09) -- 修复 选择的文件非 file-extname 字段指定的扩展名报错的Bug -## 0.0.5(2021-04-09) -- 优化 更新组件示例 -## 0.0.4(2021-04-09) -- 优化 file-extname 字段支持字符串写法,多个扩展名需要用逗号分隔 -## 0.0.3(2021-02-05) -- 调整为uni_modules目录规范 -- 修复 微信小程序不指定 fileExtname 属性选择失败的Bug diff --git a/sport-erp-admin/uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js b/sport-erp-admin/uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js deleted file mode 100644 index 9c6bcdf..0000000 --- a/sport-erp-admin/uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js +++ /dev/null @@ -1,287 +0,0 @@ -'use strict'; - -const ERR_MSG_OK = 'chooseAndUploadFile:ok'; -const ERR_MSG_FAIL = 'chooseAndUploadFile:fail'; - -function chooseImage(opts) { - const { - count, - sizeType = ['original', 'compressed'], - sourceType, - extension - } = opts - return new Promise((resolve, reject) => { - // 微信由于旧接口不再维护,针对微信小程序平台改用chooseMedia接口 - // #ifdef MP-WEIXIN - uni.chooseMedia({ - count, - sizeType, - sourceType, - mediaType: ['image'], - extension, - success(res) { - res.tempFiles.forEach(item => { - item.path = item.tempFilePath; - }) - resolve(normalizeChooseAndUploadFileRes(res, 'image')); - }, - fail(res) { - reject({ - errMsg: res.errMsg.replace('chooseImage:fail', ERR_MSG_FAIL), - }); - }, - }) - // #endif - // #ifndef MP-WEIXIN - uni.chooseImage({ - count, - sizeType, - sourceType, - extension, - success(res) { - resolve(normalizeChooseAndUploadFileRes(res, 'image')); - }, - fail(res) { - reject({ - errMsg: res.errMsg.replace('chooseImage:fail', ERR_MSG_FAIL), - }); - }, - }); - // #endif - - }); -} - -function chooseVideo(opts) { - const { - count, - camera, - compressed, - maxDuration, - sourceType, - extension - } = opts; - return new Promise((resolve, reject) => { - // 微信由于旧接口不再维护,针对微信小程序平台改用chooseMedia接口 - // #ifdef MP-WEIXIN - uni.chooseMedia({ - count, - compressed, - maxDuration, - sourceType, - extension, - mediaType: ['video'], - success(res) { - const { - tempFiles, - } = res; - resolve(normalizeChooseAndUploadFileRes({ - errMsg: 'chooseVideo:ok', - tempFiles: tempFiles.map(item => { - return { - name: item.name || '', - path: item.tempFilePath, - thumbTempFilePath: item.thumbTempFilePath, - size:item.size, - type: (res.tempFile && res.tempFile.type) || '', - width:item.width, - height:item.height, - duration:item.duration, - fileType: 'video', - cloudPath: '', - } - }), - }, 'video')); - }, - fail(res) { - reject({ - errMsg: res.errMsg.replace('chooseVideo:fail', ERR_MSG_FAIL), - }); - }, - }) - // #endif - // #ifndef MP-WEIXIN - uni.chooseVideo({ - camera, - compressed, - maxDuration, - sourceType, - extension, - success(res) { - const { - tempFilePath, - duration, - size, - height, - width - } = res; - resolve(normalizeChooseAndUploadFileRes({ - errMsg: 'chooseVideo:ok', - tempFilePaths: [tempFilePath], - tempFiles: [{ - name: (res.tempFile && res.tempFile.name) || '', - path: tempFilePath, - size, - type: (res.tempFile && res.tempFile.type) || '', - width, - height, - duration, - fileType: 'video', - cloudPath: '', - }, ], - }, 'video')); - }, - fail(res) { - reject({ - errMsg: res.errMsg.replace('chooseVideo:fail', ERR_MSG_FAIL), - }); - }, - }); - // #endif - }); -} - -function chooseAll(opts) { - const { - count, - extension - } = opts; - return new Promise((resolve, reject) => { - let chooseFile = uni.chooseFile; - if (typeof wx !== 'undefined' && - typeof wx.chooseMessageFile === 'function') { - chooseFile = wx.chooseMessageFile; - } - if (typeof chooseFile !== 'function') { - return reject({ - errMsg: ERR_MSG_FAIL + ' 请指定 type 类型,该平台仅支持选择 image 或 video。', - }); - } - chooseFile({ - type: 'all', - count, - extension, - success(res) { - resolve(normalizeChooseAndUploadFileRes(res)); - }, - fail(res) { - reject({ - errMsg: res.errMsg.replace('chooseFile:fail', ERR_MSG_FAIL), - }); - }, - }); - }); -} - -function normalizeChooseAndUploadFileRes(res, fileType) { - res.tempFiles.forEach((item, index) => { - if (!item.name) { - item.name = item.path.substring(item.path.lastIndexOf('/') + 1); - } - if (fileType) { - item.fileType = fileType; - } - item.cloudPath = - Date.now() + '_' + index + item.name.substring(item.name.lastIndexOf('.')); - }); - if (!res.tempFilePaths) { - res.tempFilePaths = res.tempFiles.map((file) => file.path); - } - return res; -} - -function uploadCloudFiles(files, max = 5, onUploadProgress) { - files = JSON.parse(JSON.stringify(files)) - const len = files.length - let count = 0 - let self = this - return new Promise(resolve => { - while (count < max) { - next() - } - - function next() { - let cur = count++ - if (cur >= len) { - !files.find(item => !item.url && !item.errMsg) && resolve(files) - return - } - const fileItem = files[cur] - const index = self.files.findIndex(v => v.uuid === fileItem.uuid) - fileItem.url = '' - delete fileItem.errMsg - - uniCloud - .uploadFile({ - filePath: fileItem.path, - cloudPath: fileItem.cloudPath, - fileType: fileItem.fileType, - onUploadProgress: res => { - res.index = index - onUploadProgress && onUploadProgress(res) - } - }) - .then(res => { - fileItem.url = res.fileID - fileItem.index = index - if (cur < len) { - next() - } - }) - .catch(res => { - fileItem.errMsg = res.errMsg || res.message - fileItem.index = index - if (cur < len) { - next() - } - }) - } - }) -} - - - - - -function uploadFiles(choosePromise, { - onChooseFile, - onUploadProgress -}) { - return choosePromise - .then((res) => { - if (onChooseFile) { - const customChooseRes = onChooseFile(res); - if (typeof customChooseRes !== 'undefined') { - return Promise.resolve(customChooseRes).then((chooseRes) => typeof chooseRes === 'undefined' ? - res : chooseRes); - } - } - return res; - }) - .then((res) => { - if (res === false) { - return { - errMsg: ERR_MSG_OK, - tempFilePaths: [], - tempFiles: [], - }; - } - return res - }) -} - -function chooseAndUploadFile(opts = { - type: 'all' -}) { - if (opts.type === 'image') { - return uploadFiles(chooseImage(opts), opts); - } else if (opts.type === 'video') { - return uploadFiles(chooseVideo(opts), opts); - } - return uploadFiles(chooseAll(opts), opts); -} - -export { - chooseAndUploadFile, - uploadCloudFiles -}; diff --git a/sport-erp-admin/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue b/sport-erp-admin/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue deleted file mode 100644 index 785c7eb..0000000 --- a/sport-erp-admin/uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue +++ /dev/null @@ -1,668 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-file-picker/components/uni-file-picker/upload-file.vue b/sport-erp-admin/uni_modules/uni-file-picker/components/uni-file-picker/upload-file.vue deleted file mode 100644 index 625d92e..0000000 --- a/sport-erp-admin/uni_modules/uni-file-picker/components/uni-file-picker/upload-file.vue +++ /dev/null @@ -1,325 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.vue b/sport-erp-admin/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.vue deleted file mode 100644 index 2a29bc2..0000000 --- a/sport-erp-admin/uni_modules/uni-file-picker/components/uni-file-picker/upload-image.vue +++ /dev/null @@ -1,292 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-file-picker/components/uni-file-picker/utils.js b/sport-erp-admin/uni_modules/uni-file-picker/components/uni-file-picker/utils.js deleted file mode 100644 index 1bc9259..0000000 --- a/sport-erp-admin/uni_modules/uni-file-picker/components/uni-file-picker/utils.js +++ /dev/null @@ -1,110 +0,0 @@ -/** - * 获取文件名和后缀 - * @param {String} name - */ -export const get_file_ext = (name) => { - const last_len = name.lastIndexOf('.') - const len = name.length - return { - name: name.substring(0, last_len), - ext: name.substring(last_len + 1, len) - } -} - -/** - * 获取扩展名 - * @param {Array} fileExtname - */ -export const get_extname = (fileExtname) => { - if (!Array.isArray(fileExtname)) { - let extname = fileExtname.replace(/(\[|\])/g, '') - return extname.split(',') - } else { - return fileExtname - } - return [] -} - -/** - * 获取文件和检测是否可选 - */ -export const get_files_and_is_max = (res, _extname) => { - let filePaths = [] - let files = [] - if(!_extname || _extname.length === 0){ - return { - filePaths, - files - } - } - res.tempFiles.forEach(v => { - let fileFullName = get_file_ext(v.name) - const extname = fileFullName.ext.toLowerCase() - if (_extname.indexOf(extname) !== -1) { - files.push(v) - filePaths.push(v.path) - } - }) - if (files.length !== res.tempFiles.length) { - uni.showToast({ - title: `当前选择了${res.tempFiles.length}个文件 ,${res.tempFiles.length - files.length} 个文件格式不正确`, - icon: 'none', - duration: 5000 - }) - } - - return { - filePaths, - files - } -} - - -/** - * 获取图片信息 - * @param {Object} filepath - */ -export const get_file_info = (filepath) => { - return new Promise((resolve, reject) => { - uni.getImageInfo({ - src: filepath, - success(res) { - resolve(res) - }, - fail(err) { - reject(err) - } - }) - }) -} -/** - * 获取封装数据 - */ -export const get_file_data = async (files, type = 'image') => { - // 最终需要上传数据库的数据 - let fileFullName = get_file_ext(files.name) - const extname = fileFullName.ext.toLowerCase() - let filedata = { - name: files.name, - uuid: files.uuid, - extname: extname || '', - cloudPath: files.cloudPath, - fileType: files.fileType, - thumbTempFilePath: files.thumbTempFilePath, - url: files.path || files.path, - size: files.size, //单位是字节 - image: {}, - path: files.path, - video: {} - } - if (type === 'image') { - const imageinfo = await get_file_info(files.path) - delete filedata.video - filedata.image.width = imageinfo.width - filedata.image.height = imageinfo.height - filedata.image.location = imageinfo.path - } else { - delete filedata.image - } - return filedata -} diff --git a/sport-erp-admin/uni_modules/uni-file-picker/package.json b/sport-erp-admin/uni_modules/uni-file-picker/package.json deleted file mode 100644 index 34bb18f..0000000 --- a/sport-erp-admin/uni_modules/uni-file-picker/package.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "id": "uni-file-picker", - "displayName": "uni-file-picker 文件选择上传", - "version": "1.0.11", - "description": "文件选择上传组件,可以选择图片、视频等任意文件并上传到当前绑定的服务空间", - "keywords": [ - "uni-ui", - "uniui", - "图片上传", - "文件上传" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, -"dcloudext": { - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", - "type": "component-vue" - }, - "uni_modules": { - "dependencies": ["uni-scss"], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y", - "alipay": "n" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "n" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y" - }, - "快应用": { - "华为": "u", - "联盟": "u" - }, - "Vue": { - "vue2": "y", - "vue3": "y" - } - } - } - } -} diff --git a/sport-erp-admin/uni_modules/uni-file-picker/readme.md b/sport-erp-admin/uni_modules/uni-file-picker/readme.md deleted file mode 100644 index c8399a5..0000000 --- a/sport-erp-admin/uni_modules/uni-file-picker/readme.md +++ /dev/null @@ -1,11 +0,0 @@ - -## FilePicker 文件选择上传 - -> **组件名:uni-file-picker** -> 代码块: `uFilePicker` - - -文件选择上传组件,可以选择图片、视频等任意文件并上传到当前绑定的服务空间 - -### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-file-picker) -#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-forms/changelog.md b/sport-erp-admin/uni_modules/uni-forms/changelog.md deleted file mode 100644 index aa11f02..0000000 --- a/sport-erp-admin/uni_modules/uni-forms/changelog.md +++ /dev/null @@ -1,98 +0,0 @@ -## 1.4.12(2024-09-21) -- 修复 form上次修改的问题 -## 1.4.11 (2024-9-14) -- 修复 binddata的兼容性问题 -## 1.4.10(2023-11-03) -- 优化 labelWidth 描述错误 -## 1.4.9(2023-02-10) -- 修复 required 参数无法动态绑定 -## 1.4.8(2022-08-23) -- 优化 根据 rules 自动添加 required 的问题 -## 1.4.7(2022-08-22) -- 修复 item 未设置 require 属性,rules 设置 require 后,星号也显示的 bug,详见:[https://ask.dcloud.net.cn/question/151540](https://ask.dcloud.net.cn/question/151540) -## 1.4.6(2022-07-13) -- 修复 model 需要校验的值没有声明对应字段时,导致第一次不触发校验的bug -## 1.4.5(2022-07-05) -- 新增 更多表单示例 -- 优化 子表单组件过期提示的问题 -- 优化 子表单组件uni-datetime-picker、uni-data-select、uni-data-picker的显示样式 -## 1.4.4(2022-07-04) -- 更新 删除组件日志 -## 1.4.3(2022-07-04) -- 修复 由 1.4.0 引发的 label 插槽不生效的bug -## 1.4.2(2022-07-04) -- 修复 子组件找不到 setValue 报错的bug -## 1.4.1(2022-07-04) -- 修复 uni-data-picker 在 uni-forms-item 中报错的bug -- 修复 uni-data-picker 在 uni-forms-item 中宽度不正确的bug -## 1.4.0(2022-06-30) -- 【重要】组件逻辑重构,部分用法用旧版本不兼容,请注意兼容问题 -- 【重要】组件使用 Provide/Inject 方式注入依赖,提供了自定义表单组件调用 uni-forms 校验表单的能力 -- 新增 model 属性,等同于原 value/modelValue 属性,旧属性即将废弃 -- 新增 validateTrigger 属性的 blur 值,仅 uni-easyinput 生效 -- 新增 onFieldChange 方法,可以对子表单进行校验,可替代binddata方法 -- 新增 子表单的 setRules 方法,配合自定义校验函数使用 -- 新增 uni-forms-item 的 setRules 方法,配置动态表单使用可动态更新校验规则 -- 优化 动态表单校验方式,废弃拼接name的方式 -## 1.3.3(2022-06-22) -- 修复 表单校验顺序无序问题 -## 1.3.2(2021-12-09) -- -## 1.3.1(2021-11-19) -- 修复 label 插槽不生效的bug -## 1.3.0(2021-11-19) -- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) -- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-forms](https://uniapp.dcloud.io/component/uniui/uni-forms) -## 1.2.7(2021-08-13) -- 修复 没有添加校验规则的字段依然报错的Bug -## 1.2.6(2021-08-11) -- 修复 重置表单错误信息无法清除的问题 -## 1.2.5(2021-08-11) -- 优化 组件文档 -## 1.2.4(2021-08-11) -- 修复 表单验证只生效一次的问题 -## 1.2.3(2021-07-30) -- 优化 vue3下事件警告的问题 -## 1.2.2(2021-07-26) -- 修复 vue2 下条件编译导致destroyed生命周期失效的Bug -- 修复 1.2.1 引起的示例在小程序平台报错的Bug -## 1.2.1(2021-07-22) -- 修复 动态校验表单,默认值为空的情况下校验失效的Bug -- 修复 不指定name属性时,运行报错的Bug -- 优化 label默认宽度从65调整至70,使required为true且四字时不换行 -- 优化 组件示例,新增动态校验示例代码 -- 优化 组件文档,使用方式更清晰 -## 1.2.0(2021-07-13) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 1.1.2(2021-06-25) -- 修复 pattern 属性在微信小程序平台无效的问题 -## 1.1.1(2021-06-22) -- 修复 validate-trigger属性为submit且err-show-type属性为toast时不能弹出的Bug -## 1.1.0(2021-06-22) -- 修复 只写setRules方法而导致校验不生效的Bug -- 修复 由上个办法引发的错误提示文字错位的Bug -## 1.0.48(2021-06-21) -- 修复 不设置 label 属性 ,无法设置label插槽的问题 -## 1.0.47(2021-06-21) -- 修复 不设置label属性,label-width属性不生效的bug -- 修复 setRules 方法与rules属性冲突的问题 -## 1.0.46(2021-06-04) -- 修复 动态删减数据导致报错的问题 -## 1.0.45(2021-06-04) -- 新增 modelValue 属性 ,value 即将废弃 -## 1.0.44(2021-06-02) -- 新增 uni-forms-item 可以设置单独的 rules -- 新增 validate 事件增加 keepitem 参数,可以选择那些字段不过滤 -- 优化 submit 事件重命名为 validate -## 1.0.43(2021-05-12) -- 新增 组件示例地址 -## 1.0.42(2021-04-30) -- 修复 自定义检验器失效的问题 -## 1.0.41(2021-03-05) -- 更新 校验器 -- 修复 表单规则设置类型为 number 的情况下,值为0校验失败的Bug -## 1.0.40(2021-03-04) -- 修复 动态显示uni-forms-item的情况下,submit 方法获取值错误的Bug -## 1.0.39(2021-02-05) -- 调整为uni_modules目录规范 -- 修复 校验器传入 int 等类型 ,返回String类型的Bug diff --git a/sport-erp-admin/uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue b/sport-erp-admin/uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue deleted file mode 100644 index c924882..0000000 --- a/sport-erp-admin/uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue +++ /dev/null @@ -1,632 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-forms/components/uni-forms/uni-forms.vue b/sport-erp-admin/uni_modules/uni-forms/components/uni-forms/uni-forms.vue deleted file mode 100644 index d061313..0000000 --- a/sport-erp-admin/uni_modules/uni-forms/components/uni-forms/uni-forms.vue +++ /dev/null @@ -1,404 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-forms/components/uni-forms/utils.js b/sport-erp-admin/uni_modules/uni-forms/components/uni-forms/utils.js deleted file mode 100644 index 6da2421..0000000 --- a/sport-erp-admin/uni_modules/uni-forms/components/uni-forms/utils.js +++ /dev/null @@ -1,293 +0,0 @@ -/** - * 简单处理对象拷贝 - * @param {Obejct} 被拷贝对象 - * @@return {Object} 拷贝对象 - */ -export const deepCopy = (val) => { - return JSON.parse(JSON.stringify(val)) -} -/** - * 过滤数字类型 - * @param {String} format 数字类型 - * @@return {Boolean} 返回是否为数字类型 - */ -export const typeFilter = (format) => { - return format === 'int' || format === 'double' || format === 'number' || format === 'timestamp'; -} - -/** - * 把 value 转换成指定的类型,用于处理初始值,原因是初始值需要入库不能为 undefined - * @param {String} key 字段名 - * @param {any} value 字段值 - * @param {Object} rules 表单校验规则 - */ -export const getValue = (key, value, rules) => { - const isRuleNumType = rules.find(val => val.format && typeFilter(val.format)); - const isRuleBoolType = rules.find(val => (val.format && val.format === 'boolean') || val.format === 'bool'); - // 输入类型为 number - if (!!isRuleNumType) { - if (!value && value !== 0) { - value = null - } else { - value = isNumber(Number(value)) ? Number(value) : value - } - } - - // 输入类型为 boolean - if (!!isRuleBoolType) { - value = isBoolean(value) ? value : false - } - - return value; -} - -/** - * 获取表单数据 - * @param {String|Array} name 真实名称,需要使用 realName 获取 - * @param {Object} data 原始数据 - * @param {any} value 需要设置的值 - */ -export const setDataValue = (field, formdata, value) => { - formdata[field] = value - return value || '' -} - -/** - * 获取表单数据 - * @param {String|Array} field 真实名称,需要使用 realName 获取 - * @param {Object} data 原始数据 - */ -export const getDataValue = (field, data) => { - return objGet(data, field) -} - -/** - * 获取表单类型 - * @param {String|Array} field 真实名称,需要使用 realName 获取 - */ -export const getDataValueType = (field, data) => { - const value = getDataValue(field, data) - return { - type: type(value), - value - } -} - -/** - * 获取表单可用的真实name - * @param {String|Array} name 表单name - * @@return {String} 表单可用的真实name - */ -export const realName = (name, data = {}) => { - const base_name = _basePath(name) - if (typeof base_name === 'object' && Array.isArray(base_name) && base_name.length > 1) { - const realname = base_name.reduce((a, b) => a += `#${b}`, '_formdata_') - return realname - } - return base_name[0] || name -} - -/** - * 判断是否表单可用的真实name - * @param {String|Array} name 表单name - * @@return {String} 表单可用的真实name - */ -export const isRealName = (name) => { - const reg = /^_formdata_#*/ - return reg.test(name) -} - -/** - * 获取表单数据的原始格式 - * @@return {Object|Array} object 需要解析的数据 - */ -export const rawData = (object = {}, name) => { - let newData = JSON.parse(JSON.stringify(object)) - let formData = {} - for(let i in newData){ - let path = name2arr(i) - objSet(formData,path,newData[i]) - } - return formData -} - -/** - * 真实name还原为 array - * @param {*} name - */ -export const name2arr = (name) => { - let field = name.replace('_formdata_#', '') - field = field.split('#').map(v => (isNumber(v) ? Number(v) : v)) - return field -} - -/** - * 对象中设置值 - * @param {Object|Array} object 源数据 - * @param {String| Array} path 'a.b.c' 或 ['a',0,'b','c'] - * @param {String} value 需要设置的值 - */ -export const objSet = (object, path, value) => { - if (typeof object !== 'object') return object; - _basePath(path).reduce((o, k, i, _) => { - if (i === _.length - 1) { - // 若遍历结束直接赋值 - o[k] = value - return null - } else if (k in o) { - // 若存在对应路径,则返回找到的对象,进行下一次遍历 - return o[k] - } else { - // 若不存在对应路径,则创建对应对象,若下一路径是数字,新对象赋值为空数组,否则赋值为空对象 - o[k] = /^[0-9]{1,}$/.test(_[i + 1]) ? [] : {} - return o[k] - } - }, object) - // 返回object - return object; -} - -// 处理 path, path有三种形式:'a[0].b.c'、'a.0.b.c' 和 ['a','0','b','c'],需要统一处理成数组,便于后续使用 -function _basePath(path) { - // 若是数组,则直接返回 - if (Array.isArray(path)) return path - // 若有 '[',']',则替换成将 '[' 替换成 '.',去掉 ']' - return path.replace(/\[/g, '.').replace(/\]/g, '').split('.') -} - -/** - * 从对象中获取值 - * @param {Object|Array} object 源数据 - * @param {String| Array} path 'a.b.c' 或 ['a',0,'b','c'] - * @param {String} defaultVal 如果无法从调用链中获取值的默认值 - */ -export const objGet = (object, path, defaultVal = 'undefined') => { - // 先将path处理成统一格式 - let newPath = _basePath(path) - // 递归处理,返回最后结果 - let val = newPath.reduce((o, k) => { - return (o || {})[k] - }, object); - return !val || val !== undefined ? val : defaultVal -} - - -/** - * 是否为 number 类型 - * @param {any} num 需要判断的值 - * @return {Boolean} 是否为 number - */ -export const isNumber = (num) => { - return !isNaN(Number(num)) -} - -/** - * 是否为 boolean 类型 - * @param {any} bool 需要判断的值 - * @return {Boolean} 是否为 boolean - */ -export const isBoolean = (bool) => { - return (typeof bool === 'boolean') -} -/** - * 是否有必填字段 - * @param {Object} rules 规则 - * @return {Boolean} 是否有必填字段 - */ -export const isRequiredField = (rules) => { - let isNoField = false; - for (let i = 0; i < rules.length; i++) { - const ruleData = rules[i]; - if (ruleData.required) { - isNoField = true; - break; - } - } - return isNoField; -} - - -/** - * 获取数据类型 - * @param {Any} obj 需要获取数据类型的值 - */ -export const type = (obj) => { - var class2type = {}; - - // 生成class2type映射 - "Boolean Number String Function Array Date RegExp Object Error".split(" ").map(function(item, index) { - class2type["[object " + item + "]"] = item.toLowerCase(); - }) - if (obj == null) { - return obj + ""; - } - return typeof obj === "object" || typeof obj === "function" ? - class2type[Object.prototype.toString.call(obj)] || "object" : - typeof obj; -} - -/** - * 判断两个值是否相等 - * @param {any} a 值 - * @param {any} b 值 - * @return {Boolean} 是否相等 - */ -export const isEqual = (a, b) => { - //如果a和b本来就全等 - if (a === b) { - //判断是否为0和-0 - return a !== 0 || 1 / a === 1 / b; - } - //判断是否为null和undefined - if (a == null || b == null) { - return a === b; - } - //接下来判断a和b的数据类型 - var classNameA = toString.call(a), - classNameB = toString.call(b); - //如果数据类型不相等,则返回false - if (classNameA !== classNameB) { - return false; - } - //如果数据类型相等,再根据不同数据类型分别判断 - switch (classNameA) { - case '[object RegExp]': - case '[object String]': - //进行字符串转换比较 - return '' + a === '' + b; - case '[object Number]': - //进行数字转换比较,判断是否为NaN - if (+a !== +a) { - return +b !== +b; - } - //判断是否为0或-0 - return +a === 0 ? 1 / +a === 1 / b : +a === +b; - case '[object Date]': - case '[object Boolean]': - return +a === +b; - } - //如果是对象类型 - if (classNameA == '[object Object]') { - //获取a和b的属性长度 - var propsA = Object.getOwnPropertyNames(a), - propsB = Object.getOwnPropertyNames(b); - if (propsA.length != propsB.length) { - return false; - } - for (var i = 0; i < propsA.length; i++) { - var propName = propsA[i]; - //如果对应属性对应值不相等,则返回false - if (a[propName] !== b[propName]) { - return false; - } - } - return true; - } - //如果是数组类型 - if (classNameA == '[object Array]') { - if (a.toString() == b.toString()) { - return true; - } - return false; - } -} diff --git a/sport-erp-admin/uni_modules/uni-forms/components/uni-forms/validate.js b/sport-erp-admin/uni_modules/uni-forms/components/uni-forms/validate.js deleted file mode 100644 index 1834c6c..0000000 --- a/sport-erp-admin/uni_modules/uni-forms/components/uni-forms/validate.js +++ /dev/null @@ -1,486 +0,0 @@ -var pattern = { - email: /^\S+?@\S+?\.\S+?$/, - idcard: /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/, - url: new RegExp( - "^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$", - 'i') -}; - -const FORMAT_MAPPING = { - "int": 'integer', - "bool": 'boolean', - "double": 'number', - "long": 'number', - "password": 'string' - // "fileurls": 'array' -} - -function formatMessage(args, resources = '') { - var defaultMessage = ['label'] - defaultMessage.forEach((item) => { - if (args[item] === undefined) { - args[item] = '' - } - }) - - let str = resources - for (let key in args) { - let reg = new RegExp('{' + key + '}') - str = str.replace(reg, args[key]) - } - return str -} - -function isEmptyValue(value, type) { - if (value === undefined || value === null) { - return true; - } - - if (typeof value === 'string' && !value) { - return true; - } - - if (Array.isArray(value) && !value.length) { - return true; - } - - if (type === 'object' && !Object.keys(value).length) { - return true; - } - - return false; -} - -const types = { - integer(value) { - return types.number(value) && parseInt(value, 10) === value; - }, - string(value) { - return typeof value === 'string'; - }, - number(value) { - if (isNaN(value)) { - return false; - } - return typeof value === 'number'; - }, - "boolean": function(value) { - return typeof value === 'boolean'; - }, - "float": function(value) { - return types.number(value) && !types.integer(value); - }, - array(value) { - return Array.isArray(value); - }, - object(value) { - return typeof value === 'object' && !types.array(value); - }, - date(value) { - return value instanceof Date; - }, - timestamp(value) { - if (!this.integer(value) || Math.abs(value).toString().length > 16) { - return false - } - return true; - }, - file(value) { - return typeof value.url === 'string'; - }, - email(value) { - return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255; - }, - url(value) { - return typeof value === 'string' && !!value.match(pattern.url); - }, - pattern(reg, value) { - try { - return new RegExp(reg).test(value); - } catch (e) { - return false; - } - }, - method(value) { - return typeof value === 'function'; - }, - idcard(value) { - return typeof value === 'string' && !!value.match(pattern.idcard); - }, - 'url-https'(value) { - return this.url(value) && value.startsWith('https://'); - }, - 'url-scheme'(value) { - return value.startsWith('://'); - }, - 'url-web'(value) { - return false; - } -} - -class RuleValidator { - - constructor(message) { - this._message = message - } - - async validateRule(fieldKey, fieldValue, value, data, allData) { - var result = null - - let rules = fieldValue.rules - - let hasRequired = rules.findIndex((item) => { - return item.required - }) - if (hasRequired < 0) { - if (value === null || value === undefined) { - return result - } - if (typeof value === 'string' && !value.length) { - return result - } - } - - var message = this._message - - if (rules === undefined) { - return message['default'] - } - - for (var i = 0; i < rules.length; i++) { - let rule = rules[i] - let vt = this._getValidateType(rule) - - Object.assign(rule, { - label: fieldValue.label || `["${fieldKey}"]` - }) - - if (RuleValidatorHelper[vt]) { - result = RuleValidatorHelper[vt](rule, value, message) - if (result != null) { - break - } - } - - if (rule.validateExpr) { - let now = Date.now() - let resultExpr = rule.validateExpr(value, allData, now) - if (resultExpr === false) { - result = this._getMessage(rule, rule.errorMessage || this._message['default']) - break - } - } - - if (rule.validateFunction) { - result = await this.validateFunction(rule, value, data, allData, vt) - if (result !== null) { - break - } - } - } - - if (result !== null) { - result = message.TAG + result - } - - return result - } - - async validateFunction(rule, value, data, allData, vt) { - let result = null - try { - let callbackMessage = null - const res = await rule.validateFunction(rule, value, allData || data, (message) => { - callbackMessage = message - }) - if (callbackMessage || (typeof res === 'string' && res) || res === false) { - result = this._getMessage(rule, callbackMessage || res, vt) - } - } catch (e) { - result = this._getMessage(rule, e.message, vt) - } - return result - } - - _getMessage(rule, message, vt) { - return formatMessage(rule, message || rule.errorMessage || this._message[vt] || message['default']) - } - - _getValidateType(rule) { - var result = '' - if (rule.required) { - result = 'required' - } else if (rule.format) { - result = 'format' - } else if (rule.arrayType) { - result = 'arrayTypeFormat' - } else if (rule.range) { - result = 'range' - } else if (rule.maximum !== undefined || rule.minimum !== undefined) { - result = 'rangeNumber' - } else if (rule.maxLength !== undefined || rule.minLength !== undefined) { - result = 'rangeLength' - } else if (rule.pattern) { - result = 'pattern' - } else if (rule.validateFunction) { - result = 'validateFunction' - } - return result - } -} - -const RuleValidatorHelper = { - required(rule, value, message) { - if (rule.required && isEmptyValue(value, rule.format || typeof value)) { - return formatMessage(rule, rule.errorMessage || message.required); - } - - return null - }, - - range(rule, value, message) { - const { - range, - errorMessage - } = rule; - - let list = new Array(range.length); - for (let i = 0; i < range.length; i++) { - const item = range[i]; - if (types.object(item) && item.value !== undefined) { - list[i] = item.value; - } else { - list[i] = item; - } - } - - let result = false - if (Array.isArray(value)) { - result = (new Set(value.concat(list)).size === list.length); - } else { - if (list.indexOf(value) > -1) { - result = true; - } - } - - if (!result) { - return formatMessage(rule, errorMessage || message['enum']); - } - - return null - }, - - rangeNumber(rule, value, message) { - if (!types.number(value)) { - return formatMessage(rule, rule.errorMessage || message.pattern.mismatch); - } - - let { - minimum, - maximum, - exclusiveMinimum, - exclusiveMaximum - } = rule; - let min = exclusiveMinimum ? value <= minimum : value < minimum; - let max = exclusiveMaximum ? value >= maximum : value > maximum; - - if (minimum !== undefined && min) { - return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMinimum ? - 'exclusiveMinimum' : 'minimum' - ]) - } else if (maximum !== undefined && max) { - return formatMessage(rule, rule.errorMessage || message['number'][exclusiveMaximum ? - 'exclusiveMaximum' : 'maximum' - ]) - } else if (minimum !== undefined && maximum !== undefined && (min || max)) { - return formatMessage(rule, rule.errorMessage || message['number'].range) - } - - return null - }, - - rangeLength(rule, value, message) { - if (!types.string(value) && !types.array(value)) { - return formatMessage(rule, rule.errorMessage || message.pattern.mismatch); - } - - let min = rule.minLength; - let max = rule.maxLength; - let val = value.length; - - if (min !== undefined && val < min) { - return formatMessage(rule, rule.errorMessage || message['length'].minLength) - } else if (max !== undefined && val > max) { - return formatMessage(rule, rule.errorMessage || message['length'].maxLength) - } else if (min !== undefined && max !== undefined && (val < min || val > max)) { - return formatMessage(rule, rule.errorMessage || message['length'].range) - } - - return null - }, - - pattern(rule, value, message) { - if (!types['pattern'](rule.pattern, value)) { - return formatMessage(rule, rule.errorMessage || message.pattern.mismatch); - } - - return null - }, - - format(rule, value, message) { - var customTypes = Object.keys(types); - var format = FORMAT_MAPPING[rule.format] ? FORMAT_MAPPING[rule.format] : (rule.format || rule.arrayType); - - if (customTypes.indexOf(format) > -1) { - if (!types[format](value)) { - return formatMessage(rule, rule.errorMessage || message.typeError); - } - } - - return null - }, - - arrayTypeFormat(rule, value, message) { - if (!Array.isArray(value)) { - return formatMessage(rule, rule.errorMessage || message.typeError); - } - - for (let i = 0; i < value.length; i++) { - const element = value[i]; - let formatResult = this.format(rule, element, message) - if (formatResult !== null) { - return formatResult - } - } - - return null - } -} - -class SchemaValidator extends RuleValidator { - - constructor(schema, options) { - super(SchemaValidator.message); - - this._schema = schema - this._options = options || null - } - - updateSchema(schema) { - this._schema = schema - } - - async validate(data, allData) { - let result = this._checkFieldInSchema(data) - if (!result) { - result = await this.invokeValidate(data, false, allData) - } - return result.length ? result[0] : null - } - - async validateAll(data, allData) { - let result = this._checkFieldInSchema(data) - if (!result) { - result = await this.invokeValidate(data, true, allData) - } - return result - } - - async validateUpdate(data, allData) { - let result = this._checkFieldInSchema(data) - if (!result) { - result = await this.invokeValidateUpdate(data, false, allData) - } - return result.length ? result[0] : null - } - - async invokeValidate(data, all, allData) { - let result = [] - let schema = this._schema - for (let key in schema) { - let value = schema[key] - let errorMessage = await this.validateRule(key, value, data[key], data, allData) - if (errorMessage != null) { - result.push({ - key, - errorMessage - }) - if (!all) break - } - } - return result - } - - async invokeValidateUpdate(data, all, allData) { - let result = [] - for (let key in data) { - let errorMessage = await this.validateRule(key, this._schema[key], data[key], data, allData) - if (errorMessage != null) { - result.push({ - key, - errorMessage - }) - if (!all) break - } - } - return result - } - - _checkFieldInSchema(data) { - var keys = Object.keys(data) - var keys2 = Object.keys(this._schema) - if (new Set(keys.concat(keys2)).size === keys2.length) { - return '' - } - - var noExistFields = keys.filter((key) => { - return keys2.indexOf(key) < 0; - }) - var errorMessage = formatMessage({ - field: JSON.stringify(noExistFields) - }, SchemaValidator.message.TAG + SchemaValidator.message['defaultInvalid']) - return [{ - key: 'invalid', - errorMessage - }] - } -} - -function Message() { - return { - TAG: "", - default: '验证错误', - defaultInvalid: '提交的字段{field}在数据库中并不存在', - validateFunction: '验证无效', - required: '{label}必填', - 'enum': '{label}超出范围', - timestamp: '{label}格式无效', - whitespace: '{label}不能为空', - typeError: '{label}类型无效', - date: { - format: '{label}日期{value}格式无效', - parse: '{label}日期无法解析,{value}无效', - invalid: '{label}日期{value}无效' - }, - length: { - minLength: '{label}长度不能少于{minLength}', - maxLength: '{label}长度不能超过{maxLength}', - range: '{label}必须介于{minLength}和{maxLength}之间' - }, - number: { - minimum: '{label}不能小于{minimum}', - maximum: '{label}不能大于{maximum}', - exclusiveMinimum: '{label}不能小于等于{minimum}', - exclusiveMaximum: '{label}不能大于等于{maximum}', - range: '{label}必须介于{minimum}and{maximum}之间' - }, - pattern: { - mismatch: '{label}格式不匹配' - } - }; -} - - -SchemaValidator.message = new Message(); - -export default SchemaValidator diff --git a/sport-erp-admin/uni_modules/uni-forms/package.json b/sport-erp-admin/uni_modules/uni-forms/package.json deleted file mode 100644 index 755becf..0000000 --- a/sport-erp-admin/uni_modules/uni-forms/package.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "id": "uni-forms", - "displayName": "uni-forms 表单", - "version": "1.4.12", - "description": "由输入框、选择器、单选框、多选框等控件组成,用以收集、校验、提交数据", - "keywords": [ - "uni-ui", - "表单", - "校验", - "表单校验", - "表单验证" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, -"dcloudext": { - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", - "type": "component-vue" - }, - "uni_modules": { - "dependencies": [ - "uni-scss", - "uni-icons" - ], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y", - "alipay": "n" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "y" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y", - "京东": "u" - }, - "快应用": { - "华为": "u", - "联盟": "u" - }, - "Vue": { - "vue2": "y", - "vue3": "y" - } - } - } - } -} diff --git a/sport-erp-admin/uni_modules/uni-forms/readme.md b/sport-erp-admin/uni_modules/uni-forms/readme.md deleted file mode 100644 index 63d5a04..0000000 --- a/sport-erp-admin/uni_modules/uni-forms/readme.md +++ /dev/null @@ -1,23 +0,0 @@ - - -## Forms 表单 - -> **组件名:uni-forms** -> 代码块: `uForms`、`uni-forms-item` -> 关联组件:`uni-forms-item`、`uni-easyinput`、`uni-data-checkbox`、`uni-group`。 - - -uni-app的内置组件已经有了 `
`组件,用于提交表单内容。 - -然而几乎每个表单都需要做表单验证,为了方便做表单验证,减少重复开发,`uni ui` 又基于 ``组件封装了 ``组件,内置了表单验证功能。 - -`` 提供了 `rules`属性来描述校验规则、``子组件来包裹具体的表单项,以及给原生或三方组件提供了 `binddata()` 来设置表单值。 - -每个要校验的表单项,不管input还是checkbox,都必须放在``组件中,且一个``组件只能放置一个表单项。 - -``组件内部预留了显示error message的区域,默认是在表单项的底部。 - -另外,``组件下面的各个表单项,可以通过``包裹为不同的分组。同一``下的不同表单项目将聚拢在一起,同其他group保持垂直间距。``仅影响视觉效果。 - -### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-forms) -#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-group/changelog.md b/sport-erp-admin/uni_modules/uni-group/changelog.md deleted file mode 100644 index a7024fd..0000000 --- a/sport-erp-admin/uni_modules/uni-group/changelog.md +++ /dev/null @@ -1,16 +0,0 @@ -## 1.2.2(2022-05-30) -- 新增 stat属性,是否开启uni统计功能 -## 1.2.1(2021-11-22) -- 修复 vue3中某些scss变量无法找到的问题 -## 1.2.0(2021-11-19) -- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) -- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-group](https://uniapp.dcloud.io/component/uniui/uni-group) -## 1.1.7(2021-11-08) -## 1.1.0(2021-07-30) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -- 优化 组件文档 -## 1.0.3(2021-05-12) -- 新增 组件示例地址 -## 1.0.2(2021-02-05) -- 调整为uni_modules目录规范 -- 优化 兼容 nvue 页面 diff --git a/sport-erp-admin/uni_modules/uni-group/components/uni-group/uni-group.vue b/sport-erp-admin/uni_modules/uni-group/components/uni-group/uni-group.vue deleted file mode 100644 index 3425ecd..0000000 --- a/sport-erp-admin/uni_modules/uni-group/components/uni-group/uni-group.vue +++ /dev/null @@ -1,134 +0,0 @@ - - - - diff --git a/sport-erp-admin/uni_modules/uni-group/package.json b/sport-erp-admin/uni_modules/uni-group/package.json deleted file mode 100644 index ea00a08..0000000 --- a/sport-erp-admin/uni_modules/uni-group/package.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "id": "uni-group", - "displayName": "uni-group 分组", - "version": "1.2.2", - "description": "分组组件可用于将组件用于分组,添加间隔,以产生明显的区块", - "keywords": [ - "uni-ui", - "uniui", - "group", - "分组", - "" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ], - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" - }, - "uni_modules": { - "dependencies": ["uni-scss"], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "y" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y" - }, - "快应用": { - "华为": "u", - "联盟": "u" - }, - "Vue": { - "vue2": "y", - "vue3": "y" - } - } - } - } -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-group/readme.md b/sport-erp-admin/uni_modules/uni-group/readme.md deleted file mode 100644 index bae67f4..0000000 --- a/sport-erp-admin/uni_modules/uni-group/readme.md +++ /dev/null @@ -1,9 +0,0 @@ - -## Group 分组 -> **组件名:uni-group** -> 代码块: `uGroup` - -分组组件可用于将组件分组,添加间隔,以产生明显的区块。 - -### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-group) -#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-icons/changelog.md b/sport-erp-admin/uni_modules/uni-icons/changelog.md deleted file mode 100644 index 0261131..0000000 --- a/sport-erp-admin/uni_modules/uni-icons/changelog.md +++ /dev/null @@ -1,42 +0,0 @@ -## 2.0.10(2024-06-07) -- 优化 uni-app x 中,size 属性的类型 -## 2.0.9(2024-01-12) -fix: 修复图标大小默认值错误的问题 -## 2.0.8(2023-12-14) -- 修复 项目未使用 ts 情况下,打包报错的bug -## 2.0.7(2023-12-14) -- 修复 size 属性为 string 时,不加单位导致尺寸异常的bug -## 2.0.6(2023-12-11) -- 优化 兼容老版本icon类型,如 top ,bottom 等 -## 2.0.5(2023-12-11) -- 优化 兼容老版本icon类型,如 top ,bottom 等 -## 2.0.4(2023-12-06) -- 优化 uni-app x 下示例项目图标排序 -## 2.0.3(2023-12-06) -- 修复 nvue下引入组件报错的bug -## 2.0.2(2023-12-05) --优化 size 属性支持单位 -## 2.0.1(2023-12-05) -- 新增 uni-app x 支持定义图标 -## 1.3.5(2022-01-24) -- 优化 size 属性可以传入不带单位的字符串数值 -## 1.3.4(2022-01-24) -- 优化 size 支持其他单位 -## 1.3.3(2022-01-17) -- 修复 nvue 有些图标不显示的bug,兼容老版本图标 -## 1.3.2(2021-12-01) -- 优化 示例可复制图标名称 -## 1.3.1(2021-11-23) -- 优化 兼容旧组件 type 值 -## 1.3.0(2021-11-19) -- 新增 更多图标 -- 优化 自定义图标使用方式 -- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) -- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-icons](https://uniapp.dcloud.io/component/uniui/uni-icons) -## 1.1.7(2021-11-08) -## 1.2.0(2021-07-30) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 1.1.5(2021-05-12) -- 新增 组件示例地址 -## 1.1.4(2021-02-05) -- 调整为uni_modules目录规范 diff --git a/sport-erp-admin/uni_modules/uni-icons/components/uni-icons/icons.js b/sport-erp-admin/uni_modules/uni-icons/components/uni-icons/icons.js deleted file mode 100644 index 7889936..0000000 --- a/sport-erp-admin/uni_modules/uni-icons/components/uni-icons/icons.js +++ /dev/null @@ -1,1169 +0,0 @@ -export default { - "id": "2852637", - "name": "uniui图标库", - "font_family": "uniicons", - "css_prefix_text": "uniui-", - "description": "", - "glyphs": [ - { - "icon_id": "25027049", - "name": "yanse", - "font_class": "color", - "unicode": "e6cf", - "unicode_decimal": 59087 - }, - { - "icon_id": "25027048", - "name": "wallet", - "font_class": "wallet", - "unicode": "e6b1", - "unicode_decimal": 59057 - }, - { - "icon_id": "25015720", - "name": "settings-filled", - "font_class": "settings-filled", - "unicode": "e6ce", - "unicode_decimal": 59086 - }, - { - "icon_id": "25015434", - "name": "shimingrenzheng-filled", - "font_class": "auth-filled", - "unicode": "e6cc", - "unicode_decimal": 59084 - }, - { - "icon_id": "24934246", - "name": "shop-filled", - "font_class": "shop-filled", - "unicode": "e6cd", - "unicode_decimal": 59085 - }, - { - "icon_id": "24934159", - "name": "staff-filled-01", - "font_class": "staff-filled", - "unicode": "e6cb", - "unicode_decimal": 59083 - }, - { - "icon_id": "24932461", - "name": "VIP-filled", - "font_class": "vip-filled", - "unicode": "e6c6", - "unicode_decimal": 59078 - }, - { - "icon_id": "24932462", - "name": "plus_circle_fill", - "font_class": "plus-filled", - "unicode": "e6c7", - "unicode_decimal": 59079 - }, - { - "icon_id": "24932463", - "name": "folder_add-filled", - "font_class": "folder-add-filled", - "unicode": "e6c8", - "unicode_decimal": 59080 - }, - { - "icon_id": "24932464", - "name": "yanse-filled", - "font_class": "color-filled", - "unicode": "e6c9", - "unicode_decimal": 59081 - }, - { - "icon_id": "24932465", - "name": "tune-filled", - "font_class": "tune-filled", - "unicode": "e6ca", - "unicode_decimal": 59082 - }, - { - "icon_id": "24932455", - "name": "a-rilidaka-filled", - "font_class": "calendar-filled", - "unicode": "e6c0", - "unicode_decimal": 59072 - }, - { - "icon_id": "24932456", - "name": "notification-filled", - "font_class": "notification-filled", - "unicode": "e6c1", - "unicode_decimal": 59073 - }, - { - "icon_id": "24932457", - "name": "wallet-filled", - "font_class": "wallet-filled", - "unicode": "e6c2", - "unicode_decimal": 59074 - }, - { - "icon_id": "24932458", - "name": "paihangbang-filled", - "font_class": "medal-filled", - "unicode": "e6c3", - "unicode_decimal": 59075 - }, - { - "icon_id": "24932459", - "name": "gift-filled", - "font_class": "gift-filled", - "unicode": "e6c4", - "unicode_decimal": 59076 - }, - { - "icon_id": "24932460", - "name": "fire-filled", - "font_class": "fire-filled", - "unicode": "e6c5", - "unicode_decimal": 59077 - }, - { - "icon_id": "24928001", - "name": "refreshempty", - "font_class": "refreshempty", - "unicode": "e6bf", - "unicode_decimal": 59071 - }, - { - "icon_id": "24926853", - "name": "location-ellipse", - "font_class": "location-filled", - "unicode": "e6af", - "unicode_decimal": 59055 - }, - { - "icon_id": "24926735", - "name": "person-filled", - "font_class": "person-filled", - "unicode": "e69d", - "unicode_decimal": 59037 - }, - { - "icon_id": "24926703", - "name": "personadd-filled", - "font_class": "personadd-filled", - "unicode": "e698", - "unicode_decimal": 59032 - }, - { - "icon_id": "24923351", - "name": "back", - "font_class": "back", - "unicode": "e6b9", - "unicode_decimal": 59065 - }, - { - "icon_id": "24923352", - "name": "forward", - "font_class": "forward", - "unicode": "e6ba", - "unicode_decimal": 59066 - }, - { - "icon_id": "24923353", - "name": "arrowthinright", - "font_class": "arrow-right", - "unicode": "e6bb", - "unicode_decimal": 59067 - }, - { - "icon_id": "24923353", - "name": "arrowthinright", - "font_class": "arrowthinright", - "unicode": "e6bb", - "unicode_decimal": 59067 - }, - { - "icon_id": "24923354", - "name": "arrowthinleft", - "font_class": "arrow-left", - "unicode": "e6bc", - "unicode_decimal": 59068 - }, - { - "icon_id": "24923354", - "name": "arrowthinleft", - "font_class": "arrowthinleft", - "unicode": "e6bc", - "unicode_decimal": 59068 - }, - { - "icon_id": "24923355", - "name": "arrowthinup", - "font_class": "arrow-up", - "unicode": "e6bd", - "unicode_decimal": 59069 - }, - { - "icon_id": "24923355", - "name": "arrowthinup", - "font_class": "arrowthinup", - "unicode": "e6bd", - "unicode_decimal": 59069 - }, - { - "icon_id": "24923356", - "name": "arrowthindown", - "font_class": "arrow-down", - "unicode": "e6be", - "unicode_decimal": 59070 - },{ - "icon_id": "24923356", - "name": "arrowthindown", - "font_class": "arrowthindown", - "unicode": "e6be", - "unicode_decimal": 59070 - }, - { - "icon_id": "24923349", - "name": "arrowdown", - "font_class": "bottom", - "unicode": "e6b8", - "unicode_decimal": 59064 - },{ - "icon_id": "24923349", - "name": "arrowdown", - "font_class": "arrowdown", - "unicode": "e6b8", - "unicode_decimal": 59064 - }, - { - "icon_id": "24923346", - "name": "arrowright", - "font_class": "right", - "unicode": "e6b5", - "unicode_decimal": 59061 - }, - { - "icon_id": "24923346", - "name": "arrowright", - "font_class": "arrowright", - "unicode": "e6b5", - "unicode_decimal": 59061 - }, - { - "icon_id": "24923347", - "name": "arrowup", - "font_class": "top", - "unicode": "e6b6", - "unicode_decimal": 59062 - }, - { - "icon_id": "24923347", - "name": "arrowup", - "font_class": "arrowup", - "unicode": "e6b6", - "unicode_decimal": 59062 - }, - { - "icon_id": "24923348", - "name": "arrowleft", - "font_class": "left", - "unicode": "e6b7", - "unicode_decimal": 59063 - }, - { - "icon_id": "24923348", - "name": "arrowleft", - "font_class": "arrowleft", - "unicode": "e6b7", - "unicode_decimal": 59063 - }, - { - "icon_id": "24923334", - "name": "eye", - "font_class": "eye", - "unicode": "e651", - "unicode_decimal": 58961 - }, - { - "icon_id": "24923335", - "name": "eye-filled", - "font_class": "eye-filled", - "unicode": "e66a", - "unicode_decimal": 58986 - }, - { - "icon_id": "24923336", - "name": "eye-slash", - "font_class": "eye-slash", - "unicode": "e6b3", - "unicode_decimal": 59059 - }, - { - "icon_id": "24923337", - "name": "eye-slash-filled", - "font_class": "eye-slash-filled", - "unicode": "e6b4", - "unicode_decimal": 59060 - }, - { - "icon_id": "24923305", - "name": "info-filled", - "font_class": "info-filled", - "unicode": "e649", - "unicode_decimal": 58953 - }, - { - "icon_id": "24923299", - "name": "reload-01", - "font_class": "reload", - "unicode": "e6b2", - "unicode_decimal": 59058 - }, - { - "icon_id": "24923195", - "name": "mic_slash_fill", - "font_class": "micoff-filled", - "unicode": "e6b0", - "unicode_decimal": 59056 - }, - { - "icon_id": "24923165", - "name": "map-pin-ellipse", - "font_class": "map-pin-ellipse", - "unicode": "e6ac", - "unicode_decimal": 59052 - }, - { - "icon_id": "24923166", - "name": "map-pin", - "font_class": "map-pin", - "unicode": "e6ad", - "unicode_decimal": 59053 - }, - { - "icon_id": "24923167", - "name": "location", - "font_class": "location", - "unicode": "e6ae", - "unicode_decimal": 59054 - }, - { - "icon_id": "24923064", - "name": "starhalf", - "font_class": "starhalf", - "unicode": "e683", - "unicode_decimal": 59011 - }, - { - "icon_id": "24923065", - "name": "star", - "font_class": "star", - "unicode": "e688", - "unicode_decimal": 59016 - }, - { - "icon_id": "24923066", - "name": "star-filled", - "font_class": "star-filled", - "unicode": "e68f", - "unicode_decimal": 59023 - }, - { - "icon_id": "24899646", - "name": "a-rilidaka", - "font_class": "calendar", - "unicode": "e6a0", - "unicode_decimal": 59040 - }, - { - "icon_id": "24899647", - "name": "fire", - "font_class": "fire", - "unicode": "e6a1", - "unicode_decimal": 59041 - }, - { - "icon_id": "24899648", - "name": "paihangbang", - "font_class": "medal", - "unicode": "e6a2", - "unicode_decimal": 59042 - }, - { - "icon_id": "24899649", - "name": "font", - "font_class": "font", - "unicode": "e6a3", - "unicode_decimal": 59043 - }, - { - "icon_id": "24899650", - "name": "gift", - "font_class": "gift", - "unicode": "e6a4", - "unicode_decimal": 59044 - }, - { - "icon_id": "24899651", - "name": "link", - "font_class": "link", - "unicode": "e6a5", - "unicode_decimal": 59045 - }, - { - "icon_id": "24899652", - "name": "notification", - "font_class": "notification", - "unicode": "e6a6", - "unicode_decimal": 59046 - }, - { - "icon_id": "24899653", - "name": "staff", - "font_class": "staff", - "unicode": "e6a7", - "unicode_decimal": 59047 - }, - { - "icon_id": "24899654", - "name": "VIP", - "font_class": "vip", - "unicode": "e6a8", - "unicode_decimal": 59048 - }, - { - "icon_id": "24899655", - "name": "folder_add", - "font_class": "folder-add", - "unicode": "e6a9", - "unicode_decimal": 59049 - }, - { - "icon_id": "24899656", - "name": "tune", - "font_class": "tune", - "unicode": "e6aa", - "unicode_decimal": 59050 - }, - { - "icon_id": "24899657", - "name": "shimingrenzheng", - "font_class": "auth", - "unicode": "e6ab", - "unicode_decimal": 59051 - }, - { - "icon_id": "24899565", - "name": "person", - "font_class": "person", - "unicode": "e699", - "unicode_decimal": 59033 - }, - { - "icon_id": "24899566", - "name": "email-filled", - "font_class": "email-filled", - "unicode": "e69a", - "unicode_decimal": 59034 - }, - { - "icon_id": "24899567", - "name": "phone-filled", - "font_class": "phone-filled", - "unicode": "e69b", - "unicode_decimal": 59035 - }, - { - "icon_id": "24899568", - "name": "phone", - "font_class": "phone", - "unicode": "e69c", - "unicode_decimal": 59036 - }, - { - "icon_id": "24899570", - "name": "email", - "font_class": "email", - "unicode": "e69e", - "unicode_decimal": 59038 - }, - { - "icon_id": "24899571", - "name": "personadd", - "font_class": "personadd", - "unicode": "e69f", - "unicode_decimal": 59039 - }, - { - "icon_id": "24899558", - "name": "chatboxes-filled", - "font_class": "chatboxes-filled", - "unicode": "e692", - "unicode_decimal": 59026 - }, - { - "icon_id": "24899559", - "name": "contact", - "font_class": "contact", - "unicode": "e693", - "unicode_decimal": 59027 - }, - { - "icon_id": "24899560", - "name": "chatbubble-filled", - "font_class": "chatbubble-filled", - "unicode": "e694", - "unicode_decimal": 59028 - }, - { - "icon_id": "24899561", - "name": "contact-filled", - "font_class": "contact-filled", - "unicode": "e695", - "unicode_decimal": 59029 - }, - { - "icon_id": "24899562", - "name": "chatboxes", - "font_class": "chatboxes", - "unicode": "e696", - "unicode_decimal": 59030 - }, - { - "icon_id": "24899563", - "name": "chatbubble", - "font_class": "chatbubble", - "unicode": "e697", - "unicode_decimal": 59031 - }, - { - "icon_id": "24881290", - "name": "upload-filled", - "font_class": "upload-filled", - "unicode": "e68e", - "unicode_decimal": 59022 - }, - { - "icon_id": "24881292", - "name": "upload", - "font_class": "upload", - "unicode": "e690", - "unicode_decimal": 59024 - }, - { - "icon_id": "24881293", - "name": "weixin", - "font_class": "weixin", - "unicode": "e691", - "unicode_decimal": 59025 - }, - { - "icon_id": "24881274", - "name": "compose", - "font_class": "compose", - "unicode": "e67f", - "unicode_decimal": 59007 - }, - { - "icon_id": "24881275", - "name": "qq", - "font_class": "qq", - "unicode": "e680", - "unicode_decimal": 59008 - }, - { - "icon_id": "24881276", - "name": "download-filled", - "font_class": "download-filled", - "unicode": "e681", - "unicode_decimal": 59009 - }, - { - "icon_id": "24881277", - "name": "pengyouquan", - "font_class": "pyq", - "unicode": "e682", - "unicode_decimal": 59010 - }, - { - "icon_id": "24881279", - "name": "sound", - "font_class": "sound", - "unicode": "e684", - "unicode_decimal": 59012 - }, - { - "icon_id": "24881280", - "name": "trash-filled", - "font_class": "trash-filled", - "unicode": "e685", - "unicode_decimal": 59013 - }, - { - "icon_id": "24881281", - "name": "sound-filled", - "font_class": "sound-filled", - "unicode": "e686", - "unicode_decimal": 59014 - }, - { - "icon_id": "24881282", - "name": "trash", - "font_class": "trash", - "unicode": "e687", - "unicode_decimal": 59015 - }, - { - "icon_id": "24881284", - "name": "videocam-filled", - "font_class": "videocam-filled", - "unicode": "e689", - "unicode_decimal": 59017 - }, - { - "icon_id": "24881285", - "name": "spinner-cycle", - "font_class": "spinner-cycle", - "unicode": "e68a", - "unicode_decimal": 59018 - }, - { - "icon_id": "24881286", - "name": "weibo", - "font_class": "weibo", - "unicode": "e68b", - "unicode_decimal": 59019 - }, - { - "icon_id": "24881288", - "name": "videocam", - "font_class": "videocam", - "unicode": "e68c", - "unicode_decimal": 59020 - }, - { - "icon_id": "24881289", - "name": "download", - "font_class": "download", - "unicode": "e68d", - "unicode_decimal": 59021 - }, - { - "icon_id": "24879601", - "name": "help", - "font_class": "help", - "unicode": "e679", - "unicode_decimal": 59001 - }, - { - "icon_id": "24879602", - "name": "navigate-filled", - "font_class": "navigate-filled", - "unicode": "e67a", - "unicode_decimal": 59002 - }, - { - "icon_id": "24879603", - "name": "plusempty", - "font_class": "plusempty", - "unicode": "e67b", - "unicode_decimal": 59003 - }, - { - "icon_id": "24879604", - "name": "smallcircle", - "font_class": "smallcircle", - "unicode": "e67c", - "unicode_decimal": 59004 - }, - { - "icon_id": "24879605", - "name": "minus-filled", - "font_class": "minus-filled", - "unicode": "e67d", - "unicode_decimal": 59005 - }, - { - "icon_id": "24879606", - "name": "micoff", - "font_class": "micoff", - "unicode": "e67e", - "unicode_decimal": 59006 - }, - { - "icon_id": "24879588", - "name": "closeempty", - "font_class": "closeempty", - "unicode": "e66c", - "unicode_decimal": 58988 - }, - { - "icon_id": "24879589", - "name": "clear", - "font_class": "clear", - "unicode": "e66d", - "unicode_decimal": 58989 - }, - { - "icon_id": "24879590", - "name": "navigate", - "font_class": "navigate", - "unicode": "e66e", - "unicode_decimal": 58990 - }, - { - "icon_id": "24879591", - "name": "minus", - "font_class": "minus", - "unicode": "e66f", - "unicode_decimal": 58991 - }, - { - "icon_id": "24879592", - "name": "image", - "font_class": "image", - "unicode": "e670", - "unicode_decimal": 58992 - }, - { - "icon_id": "24879593", - "name": "mic", - "font_class": "mic", - "unicode": "e671", - "unicode_decimal": 58993 - }, - { - "icon_id": "24879594", - "name": "paperplane", - "font_class": "paperplane", - "unicode": "e672", - "unicode_decimal": 58994 - }, - { - "icon_id": "24879595", - "name": "close", - "font_class": "close", - "unicode": "e673", - "unicode_decimal": 58995 - }, - { - "icon_id": "24879596", - "name": "help-filled", - "font_class": "help-filled", - "unicode": "e674", - "unicode_decimal": 58996 - }, - { - "icon_id": "24879597", - "name": "plus-filled", - "font_class": "paperplane-filled", - "unicode": "e675", - "unicode_decimal": 58997 - }, - { - "icon_id": "24879598", - "name": "plus", - "font_class": "plus", - "unicode": "e676", - "unicode_decimal": 58998 - }, - { - "icon_id": "24879599", - "name": "mic-filled", - "font_class": "mic-filled", - "unicode": "e677", - "unicode_decimal": 58999 - }, - { - "icon_id": "24879600", - "name": "image-filled", - "font_class": "image-filled", - "unicode": "e678", - "unicode_decimal": 59000 - }, - { - "icon_id": "24855900", - "name": "locked-filled", - "font_class": "locked-filled", - "unicode": "e668", - "unicode_decimal": 58984 - }, - { - "icon_id": "24855901", - "name": "info", - "font_class": "info", - "unicode": "e669", - "unicode_decimal": 58985 - }, - { - "icon_id": "24855903", - "name": "locked", - "font_class": "locked", - "unicode": "e66b", - "unicode_decimal": 58987 - }, - { - "icon_id": "24855884", - "name": "camera-filled", - "font_class": "camera-filled", - "unicode": "e658", - "unicode_decimal": 58968 - }, - { - "icon_id": "24855885", - "name": "chat-filled", - "font_class": "chat-filled", - "unicode": "e659", - "unicode_decimal": 58969 - }, - { - "icon_id": "24855886", - "name": "camera", - "font_class": "camera", - "unicode": "e65a", - "unicode_decimal": 58970 - }, - { - "icon_id": "24855887", - "name": "circle", - "font_class": "circle", - "unicode": "e65b", - "unicode_decimal": 58971 - }, - { - "icon_id": "24855888", - "name": "checkmarkempty", - "font_class": "checkmarkempty", - "unicode": "e65c", - "unicode_decimal": 58972 - }, - { - "icon_id": "24855889", - "name": "chat", - "font_class": "chat", - "unicode": "e65d", - "unicode_decimal": 58973 - }, - { - "icon_id": "24855890", - "name": "circle-filled", - "font_class": "circle-filled", - "unicode": "e65e", - "unicode_decimal": 58974 - }, - { - "icon_id": "24855891", - "name": "flag", - "font_class": "flag", - "unicode": "e65f", - "unicode_decimal": 58975 - }, - { - "icon_id": "24855892", - "name": "flag-filled", - "font_class": "flag-filled", - "unicode": "e660", - "unicode_decimal": 58976 - }, - { - "icon_id": "24855893", - "name": "gear-filled", - "font_class": "gear-filled", - "unicode": "e661", - "unicode_decimal": 58977 - }, - { - "icon_id": "24855894", - "name": "home", - "font_class": "home", - "unicode": "e662", - "unicode_decimal": 58978 - }, - { - "icon_id": "24855895", - "name": "home-filled", - "font_class": "home-filled", - "unicode": "e663", - "unicode_decimal": 58979 - }, - { - "icon_id": "24855896", - "name": "gear", - "font_class": "gear", - "unicode": "e664", - "unicode_decimal": 58980 - }, - { - "icon_id": "24855897", - "name": "smallcircle-filled", - "font_class": "smallcircle-filled", - "unicode": "e665", - "unicode_decimal": 58981 - }, - { - "icon_id": "24855898", - "name": "map-filled", - "font_class": "map-filled", - "unicode": "e666", - "unicode_decimal": 58982 - }, - { - "icon_id": "24855899", - "name": "map", - "font_class": "map", - "unicode": "e667", - "unicode_decimal": 58983 - }, - { - "icon_id": "24855825", - "name": "refresh-filled", - "font_class": "refresh-filled", - "unicode": "e656", - "unicode_decimal": 58966 - }, - { - "icon_id": "24855826", - "name": "refresh", - "font_class": "refresh", - "unicode": "e657", - "unicode_decimal": 58967 - }, - { - "icon_id": "24855808", - "name": "cloud-upload", - "font_class": "cloud-upload", - "unicode": "e645", - "unicode_decimal": 58949 - }, - { - "icon_id": "24855809", - "name": "cloud-download-filled", - "font_class": "cloud-download-filled", - "unicode": "e646", - "unicode_decimal": 58950 - }, - { - "icon_id": "24855810", - "name": "cloud-download", - "font_class": "cloud-download", - "unicode": "e647", - "unicode_decimal": 58951 - }, - { - "icon_id": "24855811", - "name": "cloud-upload-filled", - "font_class": "cloud-upload-filled", - "unicode": "e648", - "unicode_decimal": 58952 - }, - { - "icon_id": "24855813", - "name": "redo", - "font_class": "redo", - "unicode": "e64a", - "unicode_decimal": 58954 - }, - { - "icon_id": "24855814", - "name": "images-filled", - "font_class": "images-filled", - "unicode": "e64b", - "unicode_decimal": 58955 - }, - { - "icon_id": "24855815", - "name": "undo-filled", - "font_class": "undo-filled", - "unicode": "e64c", - "unicode_decimal": 58956 - }, - { - "icon_id": "24855816", - "name": "more", - "font_class": "more", - "unicode": "e64d", - "unicode_decimal": 58957 - }, - { - "icon_id": "24855817", - "name": "more-filled", - "font_class": "more-filled", - "unicode": "e64e", - "unicode_decimal": 58958 - }, - { - "icon_id": "24855818", - "name": "undo", - "font_class": "undo", - "unicode": "e64f", - "unicode_decimal": 58959 - }, - { - "icon_id": "24855819", - "name": "images", - "font_class": "images", - "unicode": "e650", - "unicode_decimal": 58960 - }, - { - "icon_id": "24855821", - "name": "paperclip", - "font_class": "paperclip", - "unicode": "e652", - "unicode_decimal": 58962 - }, - { - "icon_id": "24855822", - "name": "settings", - "font_class": "settings", - "unicode": "e653", - "unicode_decimal": 58963 - }, - { - "icon_id": "24855823", - "name": "search", - "font_class": "search", - "unicode": "e654", - "unicode_decimal": 58964 - }, - { - "icon_id": "24855824", - "name": "redo-filled", - "font_class": "redo-filled", - "unicode": "e655", - "unicode_decimal": 58965 - }, - { - "icon_id": "24841702", - "name": "list", - "font_class": "list", - "unicode": "e644", - "unicode_decimal": 58948 - }, - { - "icon_id": "24841489", - "name": "mail-open-filled", - "font_class": "mail-open-filled", - "unicode": "e63a", - "unicode_decimal": 58938 - }, - { - "icon_id": "24841491", - "name": "hand-thumbsdown-filled", - "font_class": "hand-down-filled", - "unicode": "e63c", - "unicode_decimal": 58940 - }, - { - "icon_id": "24841492", - "name": "hand-thumbsdown", - "font_class": "hand-down", - "unicode": "e63d", - "unicode_decimal": 58941 - }, - { - "icon_id": "24841493", - "name": "hand-thumbsup-filled", - "font_class": "hand-up-filled", - "unicode": "e63e", - "unicode_decimal": 58942 - }, - { - "icon_id": "24841494", - "name": "hand-thumbsup", - "font_class": "hand-up", - "unicode": "e63f", - "unicode_decimal": 58943 - }, - { - "icon_id": "24841496", - "name": "heart-filled", - "font_class": "heart-filled", - "unicode": "e641", - "unicode_decimal": 58945 - }, - { - "icon_id": "24841498", - "name": "mail-open", - "font_class": "mail-open", - "unicode": "e643", - "unicode_decimal": 58947 - }, - { - "icon_id": "24841488", - "name": "heart", - "font_class": "heart", - "unicode": "e639", - "unicode_decimal": 58937 - }, - { - "icon_id": "24839963", - "name": "loop", - "font_class": "loop", - "unicode": "e633", - "unicode_decimal": 58931 - }, - { - "icon_id": "24839866", - "name": "pulldown", - "font_class": "pulldown", - "unicode": "e632", - "unicode_decimal": 58930 - }, - { - "icon_id": "24813798", - "name": "scan", - "font_class": "scan", - "unicode": "e62a", - "unicode_decimal": 58922 - }, - { - "icon_id": "24813786", - "name": "bars", - "font_class": "bars", - "unicode": "e627", - "unicode_decimal": 58919 - }, - { - "icon_id": "24813788", - "name": "cart-filled", - "font_class": "cart-filled", - "unicode": "e629", - "unicode_decimal": 58921 - }, - { - "icon_id": "24813790", - "name": "checkbox", - "font_class": "checkbox", - "unicode": "e62b", - "unicode_decimal": 58923 - }, - { - "icon_id": "24813791", - "name": "checkbox-filled", - "font_class": "checkbox-filled", - "unicode": "e62c", - "unicode_decimal": 58924 - }, - { - "icon_id": "24813794", - "name": "shop", - "font_class": "shop", - "unicode": "e62f", - "unicode_decimal": 58927 - }, - { - "icon_id": "24813795", - "name": "headphones", - "font_class": "headphones", - "unicode": "e630", - "unicode_decimal": 58928 - }, - { - "icon_id": "24813796", - "name": "cart", - "font_class": "cart", - "unicode": "e631", - "unicode_decimal": 58929 - } - ] -} diff --git a/sport-erp-admin/uni_modules/uni-icons/components/uni-icons/uni-icons.uvue b/sport-erp-admin/uni_modules/uni-icons/components/uni-icons/uni-icons.uvue deleted file mode 100644 index 8740559..0000000 --- a/sport-erp-admin/uni_modules/uni-icons/components/uni-icons/uni-icons.uvue +++ /dev/null @@ -1,91 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-icons/components/uni-icons/uni-icons.vue b/sport-erp-admin/uni_modules/uni-icons/components/uni-icons/uni-icons.vue deleted file mode 100644 index 7da5356..0000000 --- a/sport-erp-admin/uni_modules/uni-icons/components/uni-icons/uni-icons.vue +++ /dev/null @@ -1,110 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-icons/components/uni-icons/uni.ttf b/sport-erp-admin/uni_modules/uni-icons/components/uni-icons/uni.ttf deleted file mode 100644 index 60a1968..0000000 Binary files a/sport-erp-admin/uni_modules/uni-icons/components/uni-icons/uni.ttf and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-icons/components/uni-icons/uniicons.css b/sport-erp-admin/uni_modules/uni-icons/components/uni-icons/uniicons.css deleted file mode 100644 index 0a6b6fe..0000000 --- a/sport-erp-admin/uni_modules/uni-icons/components/uni-icons/uniicons.css +++ /dev/null @@ -1,664 +0,0 @@ - -.uniui-cart-filled:before { - content: "\e6d0"; -} - -.uniui-gift-filled:before { - content: "\e6c4"; -} - -.uniui-color:before { - content: "\e6cf"; -} - -.uniui-wallet:before { - content: "\e6b1"; -} - -.uniui-settings-filled:before { - content: "\e6ce"; -} - -.uniui-auth-filled:before { - content: "\e6cc"; -} - -.uniui-shop-filled:before { - content: "\e6cd"; -} - -.uniui-staff-filled:before { - content: "\e6cb"; -} - -.uniui-vip-filled:before { - content: "\e6c6"; -} - -.uniui-plus-filled:before { - content: "\e6c7"; -} - -.uniui-folder-add-filled:before { - content: "\e6c8"; -} - -.uniui-color-filled:before { - content: "\e6c9"; -} - -.uniui-tune-filled:before { - content: "\e6ca"; -} - -.uniui-calendar-filled:before { - content: "\e6c0"; -} - -.uniui-notification-filled:before { - content: "\e6c1"; -} - -.uniui-wallet-filled:before { - content: "\e6c2"; -} - -.uniui-medal-filled:before { - content: "\e6c3"; -} - -.uniui-fire-filled:before { - content: "\e6c5"; -} - -.uniui-refreshempty:before { - content: "\e6bf"; -} - -.uniui-location-filled:before { - content: "\e6af"; -} - -.uniui-person-filled:before { - content: "\e69d"; -} - -.uniui-personadd-filled:before { - content: "\e698"; -} - -.uniui-arrowthinleft:before { - content: "\e6d2"; -} - -.uniui-arrowthinup:before { - content: "\e6d3"; -} - -.uniui-arrowthindown:before { - content: "\e6d4"; -} - -.uniui-back:before { - content: "\e6b9"; -} - -.uniui-forward:before { - content: "\e6ba"; -} - -.uniui-arrow-right:before { - content: "\e6bb"; -} - -.uniui-arrow-left:before { - content: "\e6bc"; -} - -.uniui-arrow-up:before { - content: "\e6bd"; -} - -.uniui-arrow-down:before { - content: "\e6be"; -} - -.uniui-arrowthinright:before { - content: "\e6d1"; -} - -.uniui-down:before { - content: "\e6b8"; -} - -.uniui-bottom:before { - content: "\e6b8"; -} - -.uniui-arrowright:before { - content: "\e6d5"; -} - -.uniui-right:before { - content: "\e6b5"; -} - -.uniui-up:before { - content: "\e6b6"; -} - -.uniui-top:before { - content: "\e6b6"; -} - -.uniui-left:before { - content: "\e6b7"; -} - -.uniui-arrowup:before { - content: "\e6d6"; -} - -.uniui-eye:before { - content: "\e651"; -} - -.uniui-eye-filled:before { - content: "\e66a"; -} - -.uniui-eye-slash:before { - content: "\e6b3"; -} - -.uniui-eye-slash-filled:before { - content: "\e6b4"; -} - -.uniui-info-filled:before { - content: "\e649"; -} - -.uniui-reload:before { - content: "\e6b2"; -} - -.uniui-micoff-filled:before { - content: "\e6b0"; -} - -.uniui-map-pin-ellipse:before { - content: "\e6ac"; -} - -.uniui-map-pin:before { - content: "\e6ad"; -} - -.uniui-location:before { - content: "\e6ae"; -} - -.uniui-starhalf:before { - content: "\e683"; -} - -.uniui-star:before { - content: "\e688"; -} - -.uniui-star-filled:before { - content: "\e68f"; -} - -.uniui-calendar:before { - content: "\e6a0"; -} - -.uniui-fire:before { - content: "\e6a1"; -} - -.uniui-medal:before { - content: "\e6a2"; -} - -.uniui-font:before { - content: "\e6a3"; -} - -.uniui-gift:before { - content: "\e6a4"; -} - -.uniui-link:before { - content: "\e6a5"; -} - -.uniui-notification:before { - content: "\e6a6"; -} - -.uniui-staff:before { - content: "\e6a7"; -} - -.uniui-vip:before { - content: "\e6a8"; -} - -.uniui-folder-add:before { - content: "\e6a9"; -} - -.uniui-tune:before { - content: "\e6aa"; -} - -.uniui-auth:before { - content: "\e6ab"; -} - -.uniui-person:before { - content: "\e699"; -} - -.uniui-email-filled:before { - content: "\e69a"; -} - -.uniui-phone-filled:before { - content: "\e69b"; -} - -.uniui-phone:before { - content: "\e69c"; -} - -.uniui-email:before { - content: "\e69e"; -} - -.uniui-personadd:before { - content: "\e69f"; -} - -.uniui-chatboxes-filled:before { - content: "\e692"; -} - -.uniui-contact:before { - content: "\e693"; -} - -.uniui-chatbubble-filled:before { - content: "\e694"; -} - -.uniui-contact-filled:before { - content: "\e695"; -} - -.uniui-chatboxes:before { - content: "\e696"; -} - -.uniui-chatbubble:before { - content: "\e697"; -} - -.uniui-upload-filled:before { - content: "\e68e"; -} - -.uniui-upload:before { - content: "\e690"; -} - -.uniui-weixin:before { - content: "\e691"; -} - -.uniui-compose:before { - content: "\e67f"; -} - -.uniui-qq:before { - content: "\e680"; -} - -.uniui-download-filled:before { - content: "\e681"; -} - -.uniui-pyq:before { - content: "\e682"; -} - -.uniui-sound:before { - content: "\e684"; -} - -.uniui-trash-filled:before { - content: "\e685"; -} - -.uniui-sound-filled:before { - content: "\e686"; -} - -.uniui-trash:before { - content: "\e687"; -} - -.uniui-videocam-filled:before { - content: "\e689"; -} - -.uniui-spinner-cycle:before { - content: "\e68a"; -} - -.uniui-weibo:before { - content: "\e68b"; -} - -.uniui-videocam:before { - content: "\e68c"; -} - -.uniui-download:before { - content: "\e68d"; -} - -.uniui-help:before { - content: "\e679"; -} - -.uniui-navigate-filled:before { - content: "\e67a"; -} - -.uniui-plusempty:before { - content: "\e67b"; -} - -.uniui-smallcircle:before { - content: "\e67c"; -} - -.uniui-minus-filled:before { - content: "\e67d"; -} - -.uniui-micoff:before { - content: "\e67e"; -} - -.uniui-closeempty:before { - content: "\e66c"; -} - -.uniui-clear:before { - content: "\e66d"; -} - -.uniui-navigate:before { - content: "\e66e"; -} - -.uniui-minus:before { - content: "\e66f"; -} - -.uniui-image:before { - content: "\e670"; -} - -.uniui-mic:before { - content: "\e671"; -} - -.uniui-paperplane:before { - content: "\e672"; -} - -.uniui-close:before { - content: "\e673"; -} - -.uniui-help-filled:before { - content: "\e674"; -} - -.uniui-paperplane-filled:before { - content: "\e675"; -} - -.uniui-plus:before { - content: "\e676"; -} - -.uniui-mic-filled:before { - content: "\e677"; -} - -.uniui-image-filled:before { - content: "\e678"; -} - -.uniui-locked-filled:before { - content: "\e668"; -} - -.uniui-info:before { - content: "\e669"; -} - -.uniui-locked:before { - content: "\e66b"; -} - -.uniui-camera-filled:before { - content: "\e658"; -} - -.uniui-chat-filled:before { - content: "\e659"; -} - -.uniui-camera:before { - content: "\e65a"; -} - -.uniui-circle:before { - content: "\e65b"; -} - -.uniui-checkmarkempty:before { - content: "\e65c"; -} - -.uniui-chat:before { - content: "\e65d"; -} - -.uniui-circle-filled:before { - content: "\e65e"; -} - -.uniui-flag:before { - content: "\e65f"; -} - -.uniui-flag-filled:before { - content: "\e660"; -} - -.uniui-gear-filled:before { - content: "\e661"; -} - -.uniui-home:before { - content: "\e662"; -} - -.uniui-home-filled:before { - content: "\e663"; -} - -.uniui-gear:before { - content: "\e664"; -} - -.uniui-smallcircle-filled:before { - content: "\e665"; -} - -.uniui-map-filled:before { - content: "\e666"; -} - -.uniui-map:before { - content: "\e667"; -} - -.uniui-refresh-filled:before { - content: "\e656"; -} - -.uniui-refresh:before { - content: "\e657"; -} - -.uniui-cloud-upload:before { - content: "\e645"; -} - -.uniui-cloud-download-filled:before { - content: "\e646"; -} - -.uniui-cloud-download:before { - content: "\e647"; -} - -.uniui-cloud-upload-filled:before { - content: "\e648"; -} - -.uniui-redo:before { - content: "\e64a"; -} - -.uniui-images-filled:before { - content: "\e64b"; -} - -.uniui-undo-filled:before { - content: "\e64c"; -} - -.uniui-more:before { - content: "\e64d"; -} - -.uniui-more-filled:before { - content: "\e64e"; -} - -.uniui-undo:before { - content: "\e64f"; -} - -.uniui-images:before { - content: "\e650"; -} - -.uniui-paperclip:before { - content: "\e652"; -} - -.uniui-settings:before { - content: "\e653"; -} - -.uniui-search:before { - content: "\e654"; -} - -.uniui-redo-filled:before { - content: "\e655"; -} - -.uniui-list:before { - content: "\e644"; -} - -.uniui-mail-open-filled:before { - content: "\e63a"; -} - -.uniui-hand-down-filled:before { - content: "\e63c"; -} - -.uniui-hand-down:before { - content: "\e63d"; -} - -.uniui-hand-up-filled:before { - content: "\e63e"; -} - -.uniui-hand-up:before { - content: "\e63f"; -} - -.uniui-heart-filled:before { - content: "\e641"; -} - -.uniui-mail-open:before { - content: "\e643"; -} - -.uniui-heart:before { - content: "\e639"; -} - -.uniui-loop:before { - content: "\e633"; -} - -.uniui-pulldown:before { - content: "\e632"; -} - -.uniui-scan:before { - content: "\e62a"; -} - -.uniui-bars:before { - content: "\e627"; -} - -.uniui-checkbox:before { - content: "\e62b"; -} - -.uniui-checkbox-filled:before { - content: "\e62c"; -} - -.uniui-shop:before { - content: "\e62f"; -} - -.uniui-headphones:before { - content: "\e630"; -} - -.uniui-cart:before { - content: "\e631"; -} diff --git a/sport-erp-admin/uni_modules/uni-icons/components/uni-icons/uniicons.ttf b/sport-erp-admin/uni_modules/uni-icons/components/uni-icons/uniicons.ttf deleted file mode 100644 index 14696d0..0000000 Binary files a/sport-erp-admin/uni_modules/uni-icons/components/uni-icons/uniicons.ttf and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-icons/components/uni-icons/uniicons_file.ts b/sport-erp-admin/uni_modules/uni-icons/components/uni-icons/uniicons_file.ts deleted file mode 100644 index 98e93aa..0000000 --- a/sport-erp-admin/uni_modules/uni-icons/components/uni-icons/uniicons_file.ts +++ /dev/null @@ -1,664 +0,0 @@ - -export type IconsData = { - id : string - name : string - font_family : string - css_prefix_text : string - description : string - glyphs : Array -} - -export type IconsDataItem = { - font_class : string - unicode : string -} - - -export const fontData = [ - { - "font_class": "arrow-down", - "unicode": "\ue6be" - }, - { - "font_class": "arrow-left", - "unicode": "\ue6bc" - }, - { - "font_class": "arrow-right", - "unicode": "\ue6bb" - }, - { - "font_class": "arrow-up", - "unicode": "\ue6bd" - }, - { - "font_class": "auth", - "unicode": "\ue6ab" - }, - { - "font_class": "auth-filled", - "unicode": "\ue6cc" - }, - { - "font_class": "back", - "unicode": "\ue6b9" - }, - { - "font_class": "bars", - "unicode": "\ue627" - }, - { - "font_class": "calendar", - "unicode": "\ue6a0" - }, - { - "font_class": "calendar-filled", - "unicode": "\ue6c0" - }, - { - "font_class": "camera", - "unicode": "\ue65a" - }, - { - "font_class": "camera-filled", - "unicode": "\ue658" - }, - { - "font_class": "cart", - "unicode": "\ue631" - }, - { - "font_class": "cart-filled", - "unicode": "\ue6d0" - }, - { - "font_class": "chat", - "unicode": "\ue65d" - }, - { - "font_class": "chat-filled", - "unicode": "\ue659" - }, - { - "font_class": "chatboxes", - "unicode": "\ue696" - }, - { - "font_class": "chatboxes-filled", - "unicode": "\ue692" - }, - { - "font_class": "chatbubble", - "unicode": "\ue697" - }, - { - "font_class": "chatbubble-filled", - "unicode": "\ue694" - }, - { - "font_class": "checkbox", - "unicode": "\ue62b" - }, - { - "font_class": "checkbox-filled", - "unicode": "\ue62c" - }, - { - "font_class": "checkmarkempty", - "unicode": "\ue65c" - }, - { - "font_class": "circle", - "unicode": "\ue65b" - }, - { - "font_class": "circle-filled", - "unicode": "\ue65e" - }, - { - "font_class": "clear", - "unicode": "\ue66d" - }, - { - "font_class": "close", - "unicode": "\ue673" - }, - { - "font_class": "closeempty", - "unicode": "\ue66c" - }, - { - "font_class": "cloud-download", - "unicode": "\ue647" - }, - { - "font_class": "cloud-download-filled", - "unicode": "\ue646" - }, - { - "font_class": "cloud-upload", - "unicode": "\ue645" - }, - { - "font_class": "cloud-upload-filled", - "unicode": "\ue648" - }, - { - "font_class": "color", - "unicode": "\ue6cf" - }, - { - "font_class": "color-filled", - "unicode": "\ue6c9" - }, - { - "font_class": "compose", - "unicode": "\ue67f" - }, - { - "font_class": "contact", - "unicode": "\ue693" - }, - { - "font_class": "contact-filled", - "unicode": "\ue695" - }, - { - "font_class": "down", - "unicode": "\ue6b8" - }, - { - "font_class": "bottom", - "unicode": "\ue6b8" - }, - { - "font_class": "download", - "unicode": "\ue68d" - }, - { - "font_class": "download-filled", - "unicode": "\ue681" - }, - { - "font_class": "email", - "unicode": "\ue69e" - }, - { - "font_class": "email-filled", - "unicode": "\ue69a" - }, - { - "font_class": "eye", - "unicode": "\ue651" - }, - { - "font_class": "eye-filled", - "unicode": "\ue66a" - }, - { - "font_class": "eye-slash", - "unicode": "\ue6b3" - }, - { - "font_class": "eye-slash-filled", - "unicode": "\ue6b4" - }, - { - "font_class": "fire", - "unicode": "\ue6a1" - }, - { - "font_class": "fire-filled", - "unicode": "\ue6c5" - }, - { - "font_class": "flag", - "unicode": "\ue65f" - }, - { - "font_class": "flag-filled", - "unicode": "\ue660" - }, - { - "font_class": "folder-add", - "unicode": "\ue6a9" - }, - { - "font_class": "folder-add-filled", - "unicode": "\ue6c8" - }, - { - "font_class": "font", - "unicode": "\ue6a3" - }, - { - "font_class": "forward", - "unicode": "\ue6ba" - }, - { - "font_class": "gear", - "unicode": "\ue664" - }, - { - "font_class": "gear-filled", - "unicode": "\ue661" - }, - { - "font_class": "gift", - "unicode": "\ue6a4" - }, - { - "font_class": "gift-filled", - "unicode": "\ue6c4" - }, - { - "font_class": "hand-down", - "unicode": "\ue63d" - }, - { - "font_class": "hand-down-filled", - "unicode": "\ue63c" - }, - { - "font_class": "hand-up", - "unicode": "\ue63f" - }, - { - "font_class": "hand-up-filled", - "unicode": "\ue63e" - }, - { - "font_class": "headphones", - "unicode": "\ue630" - }, - { - "font_class": "heart", - "unicode": "\ue639" - }, - { - "font_class": "heart-filled", - "unicode": "\ue641" - }, - { - "font_class": "help", - "unicode": "\ue679" - }, - { - "font_class": "help-filled", - "unicode": "\ue674" - }, - { - "font_class": "home", - "unicode": "\ue662" - }, - { - "font_class": "home-filled", - "unicode": "\ue663" - }, - { - "font_class": "image", - "unicode": "\ue670" - }, - { - "font_class": "image-filled", - "unicode": "\ue678" - }, - { - "font_class": "images", - "unicode": "\ue650" - }, - { - "font_class": "images-filled", - "unicode": "\ue64b" - }, - { - "font_class": "info", - "unicode": "\ue669" - }, - { - "font_class": "info-filled", - "unicode": "\ue649" - }, - { - "font_class": "left", - "unicode": "\ue6b7" - }, - { - "font_class": "link", - "unicode": "\ue6a5" - }, - { - "font_class": "list", - "unicode": "\ue644" - }, - { - "font_class": "location", - "unicode": "\ue6ae" - }, - { - "font_class": "location-filled", - "unicode": "\ue6af" - }, - { - "font_class": "locked", - "unicode": "\ue66b" - }, - { - "font_class": "locked-filled", - "unicode": "\ue668" - }, - { - "font_class": "loop", - "unicode": "\ue633" - }, - { - "font_class": "mail-open", - "unicode": "\ue643" - }, - { - "font_class": "mail-open-filled", - "unicode": "\ue63a" - }, - { - "font_class": "map", - "unicode": "\ue667" - }, - { - "font_class": "map-filled", - "unicode": "\ue666" - }, - { - "font_class": "map-pin", - "unicode": "\ue6ad" - }, - { - "font_class": "map-pin-ellipse", - "unicode": "\ue6ac" - }, - { - "font_class": "medal", - "unicode": "\ue6a2" - }, - { - "font_class": "medal-filled", - "unicode": "\ue6c3" - }, - { - "font_class": "mic", - "unicode": "\ue671" - }, - { - "font_class": "mic-filled", - "unicode": "\ue677" - }, - { - "font_class": "micoff", - "unicode": "\ue67e" - }, - { - "font_class": "micoff-filled", - "unicode": "\ue6b0" - }, - { - "font_class": "minus", - "unicode": "\ue66f" - }, - { - "font_class": "minus-filled", - "unicode": "\ue67d" - }, - { - "font_class": "more", - "unicode": "\ue64d" - }, - { - "font_class": "more-filled", - "unicode": "\ue64e" - }, - { - "font_class": "navigate", - "unicode": "\ue66e" - }, - { - "font_class": "navigate-filled", - "unicode": "\ue67a" - }, - { - "font_class": "notification", - "unicode": "\ue6a6" - }, - { - "font_class": "notification-filled", - "unicode": "\ue6c1" - }, - { - "font_class": "paperclip", - "unicode": "\ue652" - }, - { - "font_class": "paperplane", - "unicode": "\ue672" - }, - { - "font_class": "paperplane-filled", - "unicode": "\ue675" - }, - { - "font_class": "person", - "unicode": "\ue699" - }, - { - "font_class": "person-filled", - "unicode": "\ue69d" - }, - { - "font_class": "personadd", - "unicode": "\ue69f" - }, - { - "font_class": "personadd-filled", - "unicode": "\ue698" - }, - { - "font_class": "personadd-filled-copy", - "unicode": "\ue6d1" - }, - { - "font_class": "phone", - "unicode": "\ue69c" - }, - { - "font_class": "phone-filled", - "unicode": "\ue69b" - }, - { - "font_class": "plus", - "unicode": "\ue676" - }, - { - "font_class": "plus-filled", - "unicode": "\ue6c7" - }, - { - "font_class": "plusempty", - "unicode": "\ue67b" - }, - { - "font_class": "pulldown", - "unicode": "\ue632" - }, - { - "font_class": "pyq", - "unicode": "\ue682" - }, - { - "font_class": "qq", - "unicode": "\ue680" - }, - { - "font_class": "redo", - "unicode": "\ue64a" - }, - { - "font_class": "redo-filled", - "unicode": "\ue655" - }, - { - "font_class": "refresh", - "unicode": "\ue657" - }, - { - "font_class": "refresh-filled", - "unicode": "\ue656" - }, - { - "font_class": "refreshempty", - "unicode": "\ue6bf" - }, - { - "font_class": "reload", - "unicode": "\ue6b2" - }, - { - "font_class": "right", - "unicode": "\ue6b5" - }, - { - "font_class": "scan", - "unicode": "\ue62a" - }, - { - "font_class": "search", - "unicode": "\ue654" - }, - { - "font_class": "settings", - "unicode": "\ue653" - }, - { - "font_class": "settings-filled", - "unicode": "\ue6ce" - }, - { - "font_class": "shop", - "unicode": "\ue62f" - }, - { - "font_class": "shop-filled", - "unicode": "\ue6cd" - }, - { - "font_class": "smallcircle", - "unicode": "\ue67c" - }, - { - "font_class": "smallcircle-filled", - "unicode": "\ue665" - }, - { - "font_class": "sound", - "unicode": "\ue684" - }, - { - "font_class": "sound-filled", - "unicode": "\ue686" - }, - { - "font_class": "spinner-cycle", - "unicode": "\ue68a" - }, - { - "font_class": "staff", - "unicode": "\ue6a7" - }, - { - "font_class": "staff-filled", - "unicode": "\ue6cb" - }, - { - "font_class": "star", - "unicode": "\ue688" - }, - { - "font_class": "star-filled", - "unicode": "\ue68f" - }, - { - "font_class": "starhalf", - "unicode": "\ue683" - }, - { - "font_class": "trash", - "unicode": "\ue687" - }, - { - "font_class": "trash-filled", - "unicode": "\ue685" - }, - { - "font_class": "tune", - "unicode": "\ue6aa" - }, - { - "font_class": "tune-filled", - "unicode": "\ue6ca" - }, - { - "font_class": "undo", - "unicode": "\ue64f" - }, - { - "font_class": "undo-filled", - "unicode": "\ue64c" - }, - { - "font_class": "up", - "unicode": "\ue6b6" - }, - { - "font_class": "top", - "unicode": "\ue6b6" - }, - { - "font_class": "upload", - "unicode": "\ue690" - }, - { - "font_class": "upload-filled", - "unicode": "\ue68e" - }, - { - "font_class": "videocam", - "unicode": "\ue68c" - }, - { - "font_class": "videocam-filled", - "unicode": "\ue689" - }, - { - "font_class": "vip", - "unicode": "\ue6a8" - }, - { - "font_class": "vip-filled", - "unicode": "\ue6c6" - }, - { - "font_class": "wallet", - "unicode": "\ue6b1" - }, - { - "font_class": "wallet-filled", - "unicode": "\ue6c2" - }, - { - "font_class": "weibo", - "unicode": "\ue68b" - }, - { - "font_class": "weixin", - "unicode": "\ue691" - } -] as IconsDataItem[] - -// export const fontData = JSON.parse(fontDataJson) diff --git a/sport-erp-admin/uni_modules/uni-icons/components/uni-icons/uniicons_file_vue.js b/sport-erp-admin/uni_modules/uni-icons/components/uni-icons/uniicons_file_vue.js deleted file mode 100644 index 1cd11e1..0000000 --- a/sport-erp-admin/uni_modules/uni-icons/components/uni-icons/uniicons_file_vue.js +++ /dev/null @@ -1,649 +0,0 @@ - -export const fontData = [ - { - "font_class": "arrow-down", - "unicode": "\ue6be" - }, - { - "font_class": "arrow-left", - "unicode": "\ue6bc" - }, - { - "font_class": "arrow-right", - "unicode": "\ue6bb" - }, - { - "font_class": "arrow-up", - "unicode": "\ue6bd" - }, - { - "font_class": "auth", - "unicode": "\ue6ab" - }, - { - "font_class": "auth-filled", - "unicode": "\ue6cc" - }, - { - "font_class": "back", - "unicode": "\ue6b9" - }, - { - "font_class": "bars", - "unicode": "\ue627" - }, - { - "font_class": "calendar", - "unicode": "\ue6a0" - }, - { - "font_class": "calendar-filled", - "unicode": "\ue6c0" - }, - { - "font_class": "camera", - "unicode": "\ue65a" - }, - { - "font_class": "camera-filled", - "unicode": "\ue658" - }, - { - "font_class": "cart", - "unicode": "\ue631" - }, - { - "font_class": "cart-filled", - "unicode": "\ue6d0" - }, - { - "font_class": "chat", - "unicode": "\ue65d" - }, - { - "font_class": "chat-filled", - "unicode": "\ue659" - }, - { - "font_class": "chatboxes", - "unicode": "\ue696" - }, - { - "font_class": "chatboxes-filled", - "unicode": "\ue692" - }, - { - "font_class": "chatbubble", - "unicode": "\ue697" - }, - { - "font_class": "chatbubble-filled", - "unicode": "\ue694" - }, - { - "font_class": "checkbox", - "unicode": "\ue62b" - }, - { - "font_class": "checkbox-filled", - "unicode": "\ue62c" - }, - { - "font_class": "checkmarkempty", - "unicode": "\ue65c" - }, - { - "font_class": "circle", - "unicode": "\ue65b" - }, - { - "font_class": "circle-filled", - "unicode": "\ue65e" - }, - { - "font_class": "clear", - "unicode": "\ue66d" - }, - { - "font_class": "close", - "unicode": "\ue673" - }, - { - "font_class": "closeempty", - "unicode": "\ue66c" - }, - { - "font_class": "cloud-download", - "unicode": "\ue647" - }, - { - "font_class": "cloud-download-filled", - "unicode": "\ue646" - }, - { - "font_class": "cloud-upload", - "unicode": "\ue645" - }, - { - "font_class": "cloud-upload-filled", - "unicode": "\ue648" - }, - { - "font_class": "color", - "unicode": "\ue6cf" - }, - { - "font_class": "color-filled", - "unicode": "\ue6c9" - }, - { - "font_class": "compose", - "unicode": "\ue67f" - }, - { - "font_class": "contact", - "unicode": "\ue693" - }, - { - "font_class": "contact-filled", - "unicode": "\ue695" - }, - { - "font_class": "down", - "unicode": "\ue6b8" - }, - { - "font_class": "bottom", - "unicode": "\ue6b8" - }, - { - "font_class": "download", - "unicode": "\ue68d" - }, - { - "font_class": "download-filled", - "unicode": "\ue681" - }, - { - "font_class": "email", - "unicode": "\ue69e" - }, - { - "font_class": "email-filled", - "unicode": "\ue69a" - }, - { - "font_class": "eye", - "unicode": "\ue651" - }, - { - "font_class": "eye-filled", - "unicode": "\ue66a" - }, - { - "font_class": "eye-slash", - "unicode": "\ue6b3" - }, - { - "font_class": "eye-slash-filled", - "unicode": "\ue6b4" - }, - { - "font_class": "fire", - "unicode": "\ue6a1" - }, - { - "font_class": "fire-filled", - "unicode": "\ue6c5" - }, - { - "font_class": "flag", - "unicode": "\ue65f" - }, - { - "font_class": "flag-filled", - "unicode": "\ue660" - }, - { - "font_class": "folder-add", - "unicode": "\ue6a9" - }, - { - "font_class": "folder-add-filled", - "unicode": "\ue6c8" - }, - { - "font_class": "font", - "unicode": "\ue6a3" - }, - { - "font_class": "forward", - "unicode": "\ue6ba" - }, - { - "font_class": "gear", - "unicode": "\ue664" - }, - { - "font_class": "gear-filled", - "unicode": "\ue661" - }, - { - "font_class": "gift", - "unicode": "\ue6a4" - }, - { - "font_class": "gift-filled", - "unicode": "\ue6c4" - }, - { - "font_class": "hand-down", - "unicode": "\ue63d" - }, - { - "font_class": "hand-down-filled", - "unicode": "\ue63c" - }, - { - "font_class": "hand-up", - "unicode": "\ue63f" - }, - { - "font_class": "hand-up-filled", - "unicode": "\ue63e" - }, - { - "font_class": "headphones", - "unicode": "\ue630" - }, - { - "font_class": "heart", - "unicode": "\ue639" - }, - { - "font_class": "heart-filled", - "unicode": "\ue641" - }, - { - "font_class": "help", - "unicode": "\ue679" - }, - { - "font_class": "help-filled", - "unicode": "\ue674" - }, - { - "font_class": "home", - "unicode": "\ue662" - }, - { - "font_class": "home-filled", - "unicode": "\ue663" - }, - { - "font_class": "image", - "unicode": "\ue670" - }, - { - "font_class": "image-filled", - "unicode": "\ue678" - }, - { - "font_class": "images", - "unicode": "\ue650" - }, - { - "font_class": "images-filled", - "unicode": "\ue64b" - }, - { - "font_class": "info", - "unicode": "\ue669" - }, - { - "font_class": "info-filled", - "unicode": "\ue649" - }, - { - "font_class": "left", - "unicode": "\ue6b7" - }, - { - "font_class": "link", - "unicode": "\ue6a5" - }, - { - "font_class": "list", - "unicode": "\ue644" - }, - { - "font_class": "location", - "unicode": "\ue6ae" - }, - { - "font_class": "location-filled", - "unicode": "\ue6af" - }, - { - "font_class": "locked", - "unicode": "\ue66b" - }, - { - "font_class": "locked-filled", - "unicode": "\ue668" - }, - { - "font_class": "loop", - "unicode": "\ue633" - }, - { - "font_class": "mail-open", - "unicode": "\ue643" - }, - { - "font_class": "mail-open-filled", - "unicode": "\ue63a" - }, - { - "font_class": "map", - "unicode": "\ue667" - }, - { - "font_class": "map-filled", - "unicode": "\ue666" - }, - { - "font_class": "map-pin", - "unicode": "\ue6ad" - }, - { - "font_class": "map-pin-ellipse", - "unicode": "\ue6ac" - }, - { - "font_class": "medal", - "unicode": "\ue6a2" - }, - { - "font_class": "medal-filled", - "unicode": "\ue6c3" - }, - { - "font_class": "mic", - "unicode": "\ue671" - }, - { - "font_class": "mic-filled", - "unicode": "\ue677" - }, - { - "font_class": "micoff", - "unicode": "\ue67e" - }, - { - "font_class": "micoff-filled", - "unicode": "\ue6b0" - }, - { - "font_class": "minus", - "unicode": "\ue66f" - }, - { - "font_class": "minus-filled", - "unicode": "\ue67d" - }, - { - "font_class": "more", - "unicode": "\ue64d" - }, - { - "font_class": "more-filled", - "unicode": "\ue64e" - }, - { - "font_class": "navigate", - "unicode": "\ue66e" - }, - { - "font_class": "navigate-filled", - "unicode": "\ue67a" - }, - { - "font_class": "notification", - "unicode": "\ue6a6" - }, - { - "font_class": "notification-filled", - "unicode": "\ue6c1" - }, - { - "font_class": "paperclip", - "unicode": "\ue652" - }, - { - "font_class": "paperplane", - "unicode": "\ue672" - }, - { - "font_class": "paperplane-filled", - "unicode": "\ue675" - }, - { - "font_class": "person", - "unicode": "\ue699" - }, - { - "font_class": "person-filled", - "unicode": "\ue69d" - }, - { - "font_class": "personadd", - "unicode": "\ue69f" - }, - { - "font_class": "personadd-filled", - "unicode": "\ue698" - }, - { - "font_class": "personadd-filled-copy", - "unicode": "\ue6d1" - }, - { - "font_class": "phone", - "unicode": "\ue69c" - }, - { - "font_class": "phone-filled", - "unicode": "\ue69b" - }, - { - "font_class": "plus", - "unicode": "\ue676" - }, - { - "font_class": "plus-filled", - "unicode": "\ue6c7" - }, - { - "font_class": "plusempty", - "unicode": "\ue67b" - }, - { - "font_class": "pulldown", - "unicode": "\ue632" - }, - { - "font_class": "pyq", - "unicode": "\ue682" - }, - { - "font_class": "qq", - "unicode": "\ue680" - }, - { - "font_class": "redo", - "unicode": "\ue64a" - }, - { - "font_class": "redo-filled", - "unicode": "\ue655" - }, - { - "font_class": "refresh", - "unicode": "\ue657" - }, - { - "font_class": "refresh-filled", - "unicode": "\ue656" - }, - { - "font_class": "refreshempty", - "unicode": "\ue6bf" - }, - { - "font_class": "reload", - "unicode": "\ue6b2" - }, - { - "font_class": "right", - "unicode": "\ue6b5" - }, - { - "font_class": "scan", - "unicode": "\ue62a" - }, - { - "font_class": "search", - "unicode": "\ue654" - }, - { - "font_class": "settings", - "unicode": "\ue653" - }, - { - "font_class": "settings-filled", - "unicode": "\ue6ce" - }, - { - "font_class": "shop", - "unicode": "\ue62f" - }, - { - "font_class": "shop-filled", - "unicode": "\ue6cd" - }, - { - "font_class": "smallcircle", - "unicode": "\ue67c" - }, - { - "font_class": "smallcircle-filled", - "unicode": "\ue665" - }, - { - "font_class": "sound", - "unicode": "\ue684" - }, - { - "font_class": "sound-filled", - "unicode": "\ue686" - }, - { - "font_class": "spinner-cycle", - "unicode": "\ue68a" - }, - { - "font_class": "staff", - "unicode": "\ue6a7" - }, - { - "font_class": "staff-filled", - "unicode": "\ue6cb" - }, - { - "font_class": "star", - "unicode": "\ue688" - }, - { - "font_class": "star-filled", - "unicode": "\ue68f" - }, - { - "font_class": "starhalf", - "unicode": "\ue683" - }, - { - "font_class": "trash", - "unicode": "\ue687" - }, - { - "font_class": "trash-filled", - "unicode": "\ue685" - }, - { - "font_class": "tune", - "unicode": "\ue6aa" - }, - { - "font_class": "tune-filled", - "unicode": "\ue6ca" - }, - { - "font_class": "undo", - "unicode": "\ue64f" - }, - { - "font_class": "undo-filled", - "unicode": "\ue64c" - }, - { - "font_class": "up", - "unicode": "\ue6b6" - }, - { - "font_class": "top", - "unicode": "\ue6b6" - }, - { - "font_class": "upload", - "unicode": "\ue690" - }, - { - "font_class": "upload-filled", - "unicode": "\ue68e" - }, - { - "font_class": "videocam", - "unicode": "\ue68c" - }, - { - "font_class": "videocam-filled", - "unicode": "\ue689" - }, - { - "font_class": "vip", - "unicode": "\ue6a8" - }, - { - "font_class": "vip-filled", - "unicode": "\ue6c6" - }, - { - "font_class": "wallet", - "unicode": "\ue6b1" - }, - { - "font_class": "wallet-filled", - "unicode": "\ue6c2" - }, - { - "font_class": "weibo", - "unicode": "\ue68b" - }, - { - "font_class": "weixin", - "unicode": "\ue691" - } -] - -// export const fontData = JSON.parse(fontDataJson) diff --git a/sport-erp-admin/uni_modules/uni-icons/package.json b/sport-erp-admin/uni_modules/uni-icons/package.json deleted file mode 100644 index 6b681b4..0000000 --- a/sport-erp-admin/uni_modules/uni-icons/package.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "id": "uni-icons", - "displayName": "uni-icons 图标", - "version": "2.0.10", - "description": "图标组件,用于展示移动端常见的图标,可自定义颜色、大小。", - "keywords": [ - "uni-ui", - "uniui", - "icon", - "图标" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "^3.2.14" - }, - "directories": { - "example": "../../temps/example_temps" - }, -"dcloudext": { - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", - "type": "component-vue" - }, - "uni_modules": { - "dependencies": ["uni-scss"], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y", - "alipay": "n" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "y", - "app-uvue": "y" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y", - "钉钉": "y", - "快手": "y", - "飞书": "y", - "京东": "y" - }, - "快应用": { - "华为": "y", - "联盟": "y" - }, - "Vue": { - "vue2": "y", - "vue3": "y" - } - } - } - } -} diff --git a/sport-erp-admin/uni_modules/uni-icons/readme.md b/sport-erp-admin/uni_modules/uni-icons/readme.md deleted file mode 100644 index 86234ba..0000000 --- a/sport-erp-admin/uni_modules/uni-icons/readme.md +++ /dev/null @@ -1,8 +0,0 @@ -## Icons 图标 -> **组件名:uni-icons** -> 代码块: `uIcons` - -用于展示 icons 图标 。 - -### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-icons) -#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 diff --git a/sport-erp-admin/uni_modules/uni-id-common/changelog.md b/sport-erp-admin/uni_modules/uni-id-common/changelog.md deleted file mode 100644 index 1ef0882..0000000 --- a/sport-erp-admin/uni_modules/uni-id-common/changelog.md +++ /dev/null @@ -1,36 +0,0 @@ -## 1.0.18(2024-07-08) -- checkToken时如果传入的token为空则返回uni-id-check-token-failed错误码以便uniIdRouter能正常跳转 -## 1.0.17(2024-04-26) -- 兼容uni-app-x对客户端uniPlatform的调整(uni-app-x内uniPlatform区分app-android、app-ios) -## 1.0.16(2023-04-25) -- 新增maxTokenLength配置,用于限制数据库用户记录token数组的最大长度 -## 1.0.15(2023-04-06) -- 修复部分语言国际化出错的Bug -## 1.0.14(2023-03-07) -- 修复 admin用户包含其他角色时未包含在token的Bug -## 1.0.13(2022-07-21) -- 修复 创建token时未传角色权限信息生成的token不正确的bug -## 1.0.12(2022-07-15) -- 提升与旧版本uni-id的兼容性(补充读取配置文件时回退平台app-plus、h5),但是仍推荐使用新平台名进行配置(app、web) -## 1.0.11(2022-07-14) -- 修复 部分情况下报`read property 'reduce' of undefined`的错误 -## 1.0.10(2022-07-11) -- 将token存储在用户表的token字段内,与旧版本uni-id保持一致 -## 1.0.9(2022-07-01) -- checkToken兼容token内未缓存角色权限的情况,此时将查库获取角色权限 -## 1.0.8(2022-07-01) -- 修复clientDB默认依赖时部分情况下获取不到uni-id配置的Bug -## 1.0.7(2022-06-30) -- 修复config文件不合法时未抛出具体错误的Bug -## 1.0.6(2022-06-28) -- 移除插件内的数据表schema -## 1.0.5(2022-06-27) -- 修复使用多应用配置时报`Cannot read property 'appId' of undefined`的Bug -## 1.0.4(2022-06-27) -- 修复使用自定义token内容功能报错的Bug [详情](https://ask.dcloud.net.cn/question/147945) -## 1.0.2(2022-06-23) -- 对齐旧版本uni-id默认配置 -## 1.0.1(2022-06-22) -- 补充对uni-config-center的依赖 -## 1.0.0(2022-06-21) -- 提供uni-id token创建、校验、刷新接口,简化旧版uni-id公共模块 diff --git a/sport-erp-admin/uni_modules/uni-id-common/package.json b/sport-erp-admin/uni_modules/uni-id-common/package.json deleted file mode 100644 index 3f77a7f..0000000 --- a/sport-erp-admin/uni_modules/uni-id-common/package.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "id": "uni-id-common", - "displayName": "uni-id-common", - "version": "1.0.18", - "description": "包含uni-id token生成、校验、刷新功能的云函数公共模块", - "keywords": [ - "uni-id-common", - "uniCloud", - "token", - "权限" - ], - "repository": "https://gitcode.net/dcloud/uni-id-common", - "engines": { - "HBuilderX": "^3.1.0" - }, - "dcloudext": { - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "", - "type": "unicloud-template-function" - }, - "uni_modules": { - "dependencies": ["uni-config-center"], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y", - "alipay": "n" - }, - "client": { - "Vue": { - "vue2": "u", - "vue3": "u" - }, - "App": { - "app-vue": "u", - "app-nvue": "u" - }, - "H5-mobile": { - "Safari": "u", - "Android Browser": "u", - "微信浏览器(Android)": "u", - "QQ浏览器(Android)": "u" - }, - "H5-pc": { - "Chrome": "u", - "IE": "u", - "Edge": "u", - "Firefox": "u", - "Safari": "u" - }, - "小程序": { - "微信": "u", - "阿里": "u", - "百度": "u", - "字节跳动": "u", - "QQ": "u", - "钉钉": "u", - "快手": "u", - "飞书": "u", - "京东": "u" - }, - "快应用": { - "华为": "u", - "联盟": "u" - } - } - } - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-common/readme.md b/sport-erp-admin/uni_modules/uni-id-common/readme.md deleted file mode 100644 index 5f6a37a..0000000 --- a/sport-erp-admin/uni_modules/uni-id-common/readme.md +++ /dev/null @@ -1,3 +0,0 @@ -# uni-id-common - -文档请参考:[uni-id-common](https://uniapp.dcloud.net.cn/uniCloud/uni-id-common.html) \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-id-common/uniCloud/cloudfunctions/common/uni-id-common/index.js b/sport-erp-admin/uni_modules/uni-id-common/uniCloud/cloudfunctions/common/uni-id-common/index.js deleted file mode 100644 index a8b99d0..0000000 --- a/sport-erp-admin/uni_modules/uni-id-common/uniCloud/cloudfunctions/common/uni-id-common/index.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";var e,t=(e=require("crypto"))&&"object"==typeof e&&"default"in e?e.default:e;const n={TOKEN_EXPIRED:"uni-id-token-expired",CHECK_TOKEN_FAILED:"uni-id-check-token-failed",PARAM_REQUIRED:"uni-id-param-required",ACCOUNT_EXISTS:"uni-id-account-exists",ACCOUNT_NOT_EXISTS:"uni-id-account-not-exists",ACCOUNT_CONFLICT:"uni-id-account-conflict",ACCOUNT_BANNED:"uni-id-account-banned",ACCOUNT_AUDITING:"uni-id-account-auditing",ACCOUNT_AUDIT_FAILED:"uni-id-account-audit-failed",ACCOUNT_CLOSED:"uni-id-account-closed"};function i(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}function r(e){if(!e)return;const t=e.match(/^(\d+).(\d+).(\d+)/);return t?t.slice(1,4).map(e=>parseInt(e)):void 0}function o(e,t){const n=r(e),i=r(t);return n?i?function(e,t){const n=Math.max(e.length,t.length);for(let i=0;ir)return 1;if(n=e)throw new Error("Config error, tokenExpiresThreshold should be less than tokenExpiresIn");t>e/2&&console.warn(`Please check whether the tokenExpiresThreshold configuration is set too large, tokenExpiresThreshold: ${t}, tokenExpiresIn: ${e}`)}get customToken(){return this.uniId.interceptorMap.get("customToken")}isTokenInDb(e){return o(e,"1.0.10")>=0}async getUserRecord(){if(this.userRecord)return this.userRecord;const e=await C.doc(this.uid).get();if(this.userRecord=e.data[0],!this.userRecord)throw{errCode:n.ACCOUNT_NOT_EXISTS};switch(this.userRecord.status){case void 0:case 0:break;case 1:throw{errCode:n.ACCOUNT_BANNED};case 2:throw{errCode:n.ACCOUNT_AUDITING};case 3:throw{errCode:n.ACCOUNT_AUDIT_FAILED};case 4:throw{errCode:n.ACCOUNT_CLOSED}}if(this.oldTokenPayload){if(this.isTokenInDb(this.oldTokenPayload.uniIdVersion)){if(-1===(this.userRecord.token||[]).indexOf(this.oldToken))throw{errCode:n.CHECK_TOKEN_FAILED}}if(this.userRecord.valid_token_date&&this.userRecord.valid_token_date>1e3*this.oldTokenPayload.iat)throw{errCode:n.TOKEN_EXPIRED}}return this.userRecord}async updateUserRecord(e){await C.doc(this.uid).update(e)}async getUserPermission(){if(this.userPermission)return this.userPermission;const e=(await this.getUserRecord()).role||[];if(0===e.length)return this.userPermission={role:[],permission:[]},this.userPermission;if(e.includes("admin"))return this.userPermission={role:e,permission:[]},this.userPermission;const t=await T.where({role_id:I.in(e)}).get(),n=(i=t.data.reduce((e,t)=>(t.permission&&e.push(...t.permission),e),[]),Array.from(new Set(i)));var i;return this.userPermission={role:e,permission:n},this.userPermission}async _createToken({uid:e,role:t,permission:i}={}){if(!t||!i){const e=await this.getUserPermission();t=e.role,i=e.permission}let r={uid:e,role:t,permission:i};if(this.uniId.interceptorMap.has("customToken")){const n=this.uniId.interceptorMap.get("customToken");if("function"!=typeof n)throw new Error("Invalid custom token file");r=await n({uid:e,role:t,permission:i})}const o=Date.now(),{tokenSecret:s,tokenExpiresIn:c,maxTokenLength:a=10}=this.config,u=g({...r,uniIdVersion:"1.0.18"},s,{expiresIn:c}),d=await this.getUserRecord(),l=(d.token||[]).filter(e=>{try{const t=this._checkToken(e);if(d.valid_token_date&&d.valid_token_date>1e3*t.iat)return!1}catch(e){if(e.errCode===n.TOKEN_EXPIRED)return!1}return!0});return l.push(u),l.length>a&&l.splice(0,l.length-a),await this.updateUserRecord({last_login_ip:this.clientInfo.clientIP,last_login_date:o,token:l}),{token:u,tokenExpired:o+1e3*c}}async createToken({uid:e,role:t,permission:i}={}){if(!e)throw{errCode:n.PARAM_REQUIRED,errMsgValue:{param:"uid"}};this.uid=e;const{token:r,tokenExpired:o}=await this._createToken({uid:e,role:t,permission:i});return{errCode:0,token:r,tokenExpired:o}}async refreshToken({token:e}={}){if(!e)throw{errCode:n.PARAM_REQUIRED,errMsgValue:{param:"token"}};this.oldToken=e;const t=this._checkToken(e);this.uid=t.uid,this.oldTokenPayload=t;const{uid:i}=t,{role:r,permission:o}=await this.getUserPermission(),{token:s,tokenExpired:c}=await this._createToken({uid:i,role:r,permission:o});return{errCode:0,token:s,tokenExpired:c}}_checkToken(e){const{tokenSecret:t}=this.config;let i;try{i=k(e,t)}catch(e){if("TokenExpiredError"===e.name)throw{errCode:n.TOKEN_EXPIRED};throw{errCode:n.CHECK_TOKEN_FAILED}}return i}async checkToken(e,{autoRefresh:t=!0}={}){if(!e)throw{errCode:n.CHECK_TOKEN_FAILED};this.oldToken=e;const i=this._checkToken(e);this.uid=i.uid,this.oldTokenPayload=i;const{tokenExpiresThreshold:r}=this.config,{uid:o,role:s,permission:c}=i,a={role:s,permission:c};if(!s&&!c){const{role:e,permission:t}=await this.getUserPermission();a.role=e,a.permission=t}if(!r||!t){const e={code:0,errCode:0,...i,...a};return delete e.uniIdVersion,e}const u=Date.now();let d={};1e3*i.exp-u<1e3*r&&(d=await this._createToken({uid:o}));const l={code:0,errCode:0,...i,...a,...d};return delete l.uniIdVersion,l}}var m=Object.freeze({__proto__:null,checkToken:async function(e,{autoRefresh:t=!0}={}){return new E({uniId:this}).checkToken(e,{autoRefresh:t})},createToken:async function({uid:e,role:t,permission:n}={}){return new E({uniId:this}).createToken({uid:e,role:t,permission:n})},refreshToken:async function({token:e}={}){return new E({uniId:this}).refreshToken({token:e})}});const w=require("uni-config-center")({pluginId:"uni-id"});class x{constructor({context:e,clientInfo:t,config:n}={}){this._clientInfo=e?function(e){return{appId:e.APPID,platform:e.PLATFORM,locale:e.LOCALE,clientIP:e.CLIENTIP,deviceId:e.DEVICEID}}(e):t,this._config=n,this.config=this._getOriginConfig(),this.interceptorMap=new Map,w.hasFile("custom-token.js")&&this.setInterceptor("customToken",require(w.resolve("custom-token.js")));this._i18n=uniCloud.initI18n({locale:this._clientInfo.locale,fallbackLocale:"zh-Hans",messages:JSON.parse(JSON.stringify(d))}),d[this._i18n.locale]||this._i18n.setLocale("zh-Hans")}setInterceptor(e,t){this.interceptorMap.set(e,t)}_t(...e){return this._i18n.t(...e)}_parseOriginConfig(e){return Array.isArray(e)?e:e[0]?Object.values(e):e}_getOriginConfig(){if(this._config)return this._config;if(w.hasFile("config.json")){let e;try{e=w.config()}catch(e){throw new Error("Invalid uni-id config file\n"+e.message)}return this._parseOriginConfig(e)}try{return this._parseOriginConfig(require("uni-id/config.json"))}catch(e){throw new Error("Invalid uni-id config file")}}_getAppConfig(){const e=this._getOriginConfig();return Array.isArray(e)?e.find(e=>e.dcloudAppid===this._clientInfo.appId)||e.find(e=>e.isDefaultConfig):e}_getPlatformConfig(){const e=this._getAppConfig();if(!e)throw new Error(`Config for current app (${this._clientInfo.appId}) was not found, please check your config file or client appId`);let t;switch(["app-plus","app-android","app-ios"].indexOf(this._clientInfo.platform)>-1&&(this._clientInfo.platform="app"),"h5"===this._clientInfo.platform&&(this._clientInfo.platform="web"),this._clientInfo.platform){case"web":t="h5";break;case"app":t="app-plus"}const n=[{tokenExpiresIn:7200,tokenExpiresThreshold:1200,passwordErrorLimit:6,passwordErrorRetryTime:3600},e];t&&e[t]&&n.push(e[t]),n.push(e[this._clientInfo.platform]);const i=Object.assign(...n);return["tokenSecret","tokenExpiresIn"].forEach(e=>{if(!i||!i[e])throw new Error(`Config parameter missing, ${e} is required`)}),i}_getConfig(){return this._getPlatformConfig()}}for(const e in m)x.prototype[e]=m[e];function y(e){const t=new x(e);return new Proxy(t,{get(e,t){if(t in e&&0!==t.indexOf("_")){if("function"==typeof e[t])return(n=e[t],function(){let e;try{e=n.apply(this,arguments)}catch(e){if(a(e))return c.call(this,e),e;throw e}return i(e)?e.then(e=>(a(e)&&c.call(this,e),e),e=>{if(a(e))return c.call(this,e),e;throw e}):(a(e)&&c.call(this,e),e)}).bind(e);if("context"!==t&&"config"!==t)return e[t]}var n}})}x.prototype.createInstance=y;const O={createInstance:y};module.exports=O; diff --git a/sport-erp-admin/uni_modules/uni-id-common/uniCloud/cloudfunctions/common/uni-id-common/package.json b/sport-erp-admin/uni_modules/uni-id-common/uniCloud/cloudfunctions/common/uni-id-common/package.json deleted file mode 100644 index 8a3fbd8..0000000 --- a/sport-erp-admin/uni_modules/uni-id-common/uniCloud/cloudfunctions/common/uni-id-common/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "uni-id-common", - "version": "1.0.18", - "description": "uni-id token生成、校验、刷新", - "main": "index.js", - "homepage": "https:\/\/uniapp.dcloud.io\/uniCloud\/uni-id-common.html", - "repository": { - "type": "git", - "url": "git+https:\/\/gitee.com\/dcloud\/uni-id-common.git" - }, - "author": "DCloud", - "license": "Apache-2.0", - "dependencies": { - "uni-config-center": "file:..\/..\/..\/..\/..\/uni-config-center\/uniCloud\/cloudfunctions\/common\/uni-config-center" - }, - "origin-plugin-dev-name": "uni-template-admin", - "origin-plugin-version": "2.5.13", - "plugin-dev-name": "uni-template-admin", - "plugin-version": "2.5.13" -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-id-pages/changelog.md b/sport-erp-admin/uni_modules/uni-id-pages/changelog.md deleted file mode 100644 index b0646d7..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/changelog.md +++ /dev/null @@ -1,181 +0,0 @@ -## 1.1.20(2024-04-28) -- uni-id-co 兼容uni-app-x对客户端uniPlatform的调整(uni-app-x内uniPlatform区分app-android、app-ios) -## 1.1.19(2024-03-20) -- uni-id-co 修复 实人认证的认证照片在阿里云服务空间没有保存到指定路径下的Bug -- uni-id-co 修复 云对象开发依赖未移除的Bug -## 1.1.18(2024-02-20) -- 修复 PC设置头像无效的问题 -## 1.1.17(2023-12-14) -- uni-id-co 移除一键登录、短信的调用凭据 -## 1.1.16(2023-10-18) -- 修复 当不满足一键登录时页面回退无法继续登录的问题 -## 1.1.15(2023-07-13) -- uni-id-co 修复 QQ登录时不存在头像时报错的问题 -## 1.1.14(2023-05-19) -- 修复 退出登录不会跳转至登录页的问题 -## 1.1.13(2023-05-10) -- 修复 启用摇树优化 报错的问题 -## 1.1.12(2023-05-05) -- uni-id-co 新增 调用 add-user 接口创建用户时允许触发 beforeRegister 钩子方法,beforeRegister 钩子[详见](https://uniapp.dcloud.net.cn/uniCloud/uni-id-summary.html#before-register) -- uni-id-co 新增 自无 unionid 到有 unionid 状态进行登录时为用户补充 unionid 字段 -- uni-id-co 修复 i18n 在特定场景下报错的 bug -- uni-id-co 修复 跨平台解绑微信/QQ时无法解绑的 bug -- uni-id-co 修复 微信小程序等平台创建验证码时无法展示的 bug -- uni-id-co 修复 更新 push_clientid 时因 device_id 没有变化导致无法更新 -## 1.1.11(2023-03-24) -- 修复 tabbar页面因为token无效而强制跳转至登录页面(url参数包含`uniIdRedirectUrl`)后无法返回的问题 -## 1.1.10(2023-03-24) -- 修复 PC微信扫码登录跳转地址错误 -- uni-id-co 新增 请求鉴权支持 uni-cloud-s2s 模块验证签名 [uni-cloud-s2s文档](https://uniapp.dcloud.net.cn/uniCloud/uni-cloud-s2s.html) -## 1.1.9(2023-03-24) -- 修复 跳转至登录页面的url参数包含`uniIdRedirectUrl`后无法返回的问题 -## 1.1.8(2023-03-02) -- 修复 调试模式下没有对微信授权手机号登录方式进行配置检测 -## 1.1.7(2023-02-27) -- 【重要】新增 实名认证功能 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-summary.html#frv) -## 1.1.6(2023-02-24) -- uni-id-co 新增 注册用户时允许配置默认角色 [文档](https://uniapp.dcloud.net.cn/uniCloud/uni-id-summary.html#config-defult-role) -- uni-id-co 优化 `updateUserInfoByExternal`接口,允许修改头像、性别 -- uni-id-co 修复 请求签名密钥字段 `requestAuthSecret` 缺少为空判断 -- uni-id-co 修复 `externalRegister`接口头像未使用`avatar_file`字段保存 -- 修复 web微信登录回调地址不正确 -## 1.1.5(2023-02-23) -- 更新 微信小程序端 更新头像信息,如果是使用微信的头像则不再调用裁剪接口 -## 1.1.4(2023-02-21) -- 修复 部分情况下 `uniIdRedirectUrl` 参数无效的问题 -## 1.1.3(2023-02-20) -- 修复 非微信小程序端报`TypeError: uni.hideHomeButton is not a function`的问题 -## 1.1.2(2023-02-10) -- 新增 微信小程序端 首页需强制登录时,隐藏返回首页按钮 -- uni-id-co 新增 外部联登后修改用户信息接口(updateUserInfoByExternal) [文档](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#external-update-userinfo) -- uni-id-co 优化外部联登接口(登录、注册)逻辑 -## 1.1.1(2023-02-02) -- 新增 微信小程序端 支持选择使用微信资料的“头像”和“昵称” 设置用户资料 [详情参考](https://wdoc-76491.picgzc.qpic.cn/MTY4ODg1MDUyNzQyMDUxNw_21263_rTNhg68FTngQGdvQ_1647431233?w=1280&h=695.7176470588236) -## 1.1.0(2023-01-31) -- 【重要】优化 小程序端资源包大小(运行时大小为:731KB,发行后为:583KB;注:可以直接将本插件作为分包使用) -- 更新 微信小程序端 上传头像功能 用`wx.cropImage`实现图片裁剪 -- 修复 选择一键登录时会先显示 非密码登录页面的问题 -- 修复 一键登录 点击右上角的关闭按钮没有返回上一页的问题 -## 1.0.41(2023-01-16) -- 优化 压缩依赖的文件资源大小 -## 1.0.40(2023-01-16) -- 更新依赖的 验证码插件`uni-captcha`版本的版本为 0.6.4 修复 部分情况下APP端无法获取验证码的问题 [详情参考](https://ext.dcloud.net.cn/plugin?id=4048) -- 修复 客户端token过期后,点击退出登录按钮报错的问题 -- uni-id-co 修复 updateUser 接口`手机号`和`邮箱`参数值为空字符串时,修改无效的问题 -## 1.0.39(2022-12-28) -- uni-id-co 修复 URL化时第三方登录无法获取 uniPlatform 参数 -- uni-id-co 修复 validator error -## 1.0.38(2022-12-26) -- uni-id-co 优化 手机号与邮箱验证规则为空字符串时不校验 -## 1.0.37(2022-12-09) -- 优化admin端样式 -## 1.0.36(2022-12-08) -- uni-id-co 修复 `updateUser` 接口部分参数为空时数据修改异常 -## 1.0.35(2022-11-30) -- uni-id-co 新增 匹配到的用户不可在当前应用登录时的错误码 `uni-id-account-not-exists-in-current-app` [错误码说明](https://uniapp.dcloud.net.cn/uniCloud/uni-id-summary.html#errcode) -## 1.0.34(2022-11-29) -- 优化 toast 错误提示时间为3秒 -- uni-id-co 修复 无法从 clientInfo 中获取 uniIdToken -## 1.0.33(2022-11-25) -- uni-id-co 新增 外部系统联登接口,可为外部系统创建与uni-id相对应的账号,使该账号可以使用依赖uniId的系统及功能 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#external) -- uni-id-co 新增 URL化请求时鉴权签名验证 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#http-reqeust-auth) -- uni-id-co 修复 微信登录时用户未设置头像的报错问题 -## 1.0.32(2022-11-21) -- 新增 设置密码页面 -- 新增 登录后跳转设置密码页面配置项`setPasswordAfterLogin` [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#set-pwd-after-login) -- uni-id-co 新增 设置密码接口 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#set-pwd) -## 1.0.31(2022-11-16) -- uni-id-co 修复 验证码可能无法收到的bug -## 1.0.30(2022-11-11) -- uni-id-co 修复 用户只有openid时绑定微信/QQ报错 -## 1.0.29(2022-11-10) -- uni-id-co 支持URL化方式请求 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#adapter-http) -## 1.0.28(2022-11-09) -- uni-id-co 升级密码加密算法,支持hmac-sha256加密 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-summary.html#password-safe) -- uni-id-co 新增 开发者可以自定义密码加密规则 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-summary.html#custom-password-encrypt) -- uni-id-co 新增 支持将其他系统用户迁移至uni-id [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-summary.html#move-users-to-uni-id) -## 1.0.27(2022-10-26) -- uni-id-co 新增 secureNetworkHandshakeByWeixin 接口,用于建立和微信小程序的安全网络连接 -## 1.0.26(2022-10-18) -- 修复 uni-id-pages 导入时异常的Bug -## 1.0.25(2022-10-14) -- uni-id-co 增加 微信授权手机号登录方式 [文档](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#login-by-weixin-mobile) -- uni-id-co 增加 解绑第三方平台账号 [文档](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#unbind-third-account) -- uni-id-co 微信绑定手机号支持通过`getPhoneNumber`事件回调的`code`绑定 [文档](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#bind-mobile-by-mp-weixin) -- 修复 sendSmsCode 接口未在参数内传递 templateId 时 未能从配置文件读取 templateId 的Bug -## 1.0.24(2022-10-08) -- 修复 报uni-id-users表schema内错误的bug -## 1.0.23(2022-10-08) -- 修复 vue3下vite编译发行打包失败 -- 修复 某些情况下注册账号,报TypeErroe:Cannot read properties of undefined (reading ’showToast‘)的错误 -## 1.0.22(2022-09-23) -- 修复 某些情况下,修改密码报“两次输入密码不一致”的bug -## 1.0.21(2022-09-21) -- 修复 store.hasLogin的值在某些情况下会出错的bug -## 1.0.20(2022-09-21) -- 新增 store 账号信息状态管理,详情:用户中心页面 路径:`/uni_modules/uni-id-pages/pages/userinfo/userinfo` -## 1.0.19(2022-09-20) -- 修复 小程序端,使用将自定义节点设置成[虚拟节点](https://uniapp.dcloud.net.cn/tutorial/vue-api.html#%E5%85%B6%E4%BB%96%E9%85%8D%E7%BD%AE)的uni-ui组件,样式错乱的问题 -## 1.0.18(2022-09-20) -- 修复 微信小程序端 WXSS 编译报错的bug -## 1.0.17(2022.09-19) -- 修复 无法退出登录的bug -## 1.0.16(2022-09-19) -- 修复 在 Edge 浏览器下 input[type="password"] 会出现浏览器自带的密码查看按钮 -- 优化 退出登录重定向页面为 uniIdRouter.loginPage -- 新增 注册账号页面支持返回登录页面 -## 1.0.15(2022-09-19) -- 更新表结构,解决在uni-admin中部分clientDB操作没有权限的问题 -## 1.0.14(2022-09-16) -- 修改 配置项`isAdmin`默认值为`false` -## 1.0.13(2022-09-16) -- 新增 管理员注册页面 -- 新增 配置项`isAdmin`区分是否为管理端 -- 新增 登录成功后自动跳转;跳转优先级:路由携带(`uniIdRedirectUrl`参数) > 返回上一路由 > 跳转首页 -- uni-id-co 优化 注册管理员时管理员存在提示文案 -## 1.0.12(2022-09-07) -- 修复 getSupportedLoginType判断是否支持微信公众号、PC网页微信扫码登录方式报错的Bug -- 优化 适配pc端样式 -- 新增 邮箱验证码注册 -- 新增 邮箱验证码找回密码 -- 新增 退出登录(全局)回调事件:`uni-id-pages-logout`,支持通过[uni.$on](https://uniapp.dcloud.net.cn/api/window/communication.html#on)监听; -- 调整 抽离退出登录方法至`/uni_modules/uni-id-pages/common/common.js`中,方便在项目其他页面中调用 -- 调整 用户中心(路径:`/uni_modules/uni-id-pages/pages/userinfo/userinfo`)默认不再显示退出登录按钮。支持页面传参数`showLoginManage=true`恢复显示 -## 1.0.11(2022-09-01) -- 修复 iOS端,一键登录功能卡在showLoading的问题 -- 更新 合并密码强度与长度配置 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#config) -- uni-id-co 修复 调用 removeAuthorizedApp 接口报错的Bug -- uni-id-co 新增 管理端接口 updateUser [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#update-user) -- uni-id-co 调整 为兼容旧版本,未配置密码强度时提供最简单的密码规则校验(长度大于6即可) -- uni-id-co 调整 注册、登录时如果携带了token则尝试对此token进行登出操作 -- uni-id-co 调整 管理端接口 addUser 增加 mobile、email等参数 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#add-user) -## 1.0.10(2022-08-25) -- 修复 导入uni-id-pages插件时未自动导入uni-open-bridge-common的Bug -## 1.0.9(2022-08-23) -- 修复 uni-id-co 缺失uni-open-bridge-common依赖的Bug -## 1.0.8(2022-08-23) -- 新增 H5端支持微信登录(含微信公众号内的网页授权登录 和 普通浏览器内网页生成二维码,实现手机微信扫码登录)[详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#weixinlogin) -- 新增 登录成功(全局)回调事件:`uni-id-pages-login-success`,支持通过[uni.$on](https://uniapp.dcloud.net.cn/api/window/communication.html#on)监听; -- 新增 密码强度(是否必须包含大小写字母、数字和特殊符号以及长度)配置 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#config) -- 调整 uni-id-co 密码规则调整,废除之前的简单校验,允许配置密码强度 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-summary.html#password-strength) -- 调整 uni-id-co 存储用户 openid 时同时以客户端 AppId 为 Key 的副本,参考:[微信登录](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#login-by-weixin)、[QQ登录](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#login-by-qq) -- 调整 uni-id-co 依赖 uni-open-bridge-common 存储用户 session_key、access_token 等信息 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-summary.html#save-user-token) -- 新增 uni-id-co 增加 beforeRegister 钩子用户在注册前向用户记录内添加一些数据 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-summary.html#before-register) -## 1.0.7(2022-07-19) -- 修复 uni-id-co接口 logout时没有删除token的Bug -## 1.0.6(2022-07-13) -- 新增 允许覆盖内置校验规则 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#custom-validator) -- 修复 app端clientInfo.appVersionCode为数字导致校验无法通过的Bug -## 1.0.5(2022-07-11) -修复 微信小程序调用uni-id-co接口报错的Bug [详情](https://ask.dcloud.net.cn/question/148877) -## 1.0.4(2022-07-06) -- uni-id-co增加clientInfo字段类型校验 -- 监听token更新时机,同步客户端push_clientid至uni-id-device表,改为:同步客户端push_clientid至uni-id-device表和opendb-device表 -## 1.0.3(2022-07-05) -新增监听token更新时机,同步客户端push_clientid至uni-id-device表 -## 1.0.2(2022-07-04) -修复微信小程序登录时无unionid报错的Bug [详情](https://ask.dcloud.net.cn/question/148016) -## 1.0.1(2022-06-28) -添加相关uni-id表 -## 1.0.0(2022-06-23) -正式版 diff --git a/sport-erp-admin/uni_modules/uni-id-pages/common/check-id-card.js b/sport-erp-admin/uni_modules/uni-id-pages/common/check-id-card.js deleted file mode 100644 index b3ca0c3..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/common/check-id-card.js +++ /dev/null @@ -1,16 +0,0 @@ -function checkIdCard (idCardNumber) { - if (!idCardNumber || typeof idCardNumber !== 'string' || idCardNumber.length !== 18) return false - - const coefficient = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2] - const checkCode = [1, 0, 'x', 9, 8, 7, 6, 5, 4, 3, 2] - const code = idCardNumber.substring(17) - - let sum = 0 - for (let i = 0; i < 17; i++) { - sum += Number(idCardNumber.charAt(i)) * coefficient[i] - } - - return checkCode[sum % 11].toString() === code.toLowerCase() -} - -export default checkIdCard diff --git a/sport-erp-admin/uni_modules/uni-id-pages/common/common.js b/sport-erp-admin/uni_modules/uni-id-pages/common/common.js deleted file mode 100644 index a672660..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/common/common.js +++ /dev/null @@ -1,13 +0,0 @@ -import pagesJson from '@/pages.json' -const uniIdCo = uniCloud.importObject("uni-id-co") -export default { - async logout() { - await uniIdCo.logout() - uni.removeStorageSync('uni_id_token'); - uni.setStorageSync('uni_id_token_expired', 0) - uni.redirectTo({ - url: `/${pagesJson.uniIdRouter?.loginPage ?? 'uni_modules/uni-id-pages/pages/login/login-withoutpwd'}`, - }); - uni.$emit('uni-id-pages-logout') - }, -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/common/login-page.mixin.js b/sport-erp-admin/uni_modules/uni-id-pages/common/login-page.mixin.js deleted file mode 100644 index 2a26f7e..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/common/login-page.mixin.js +++ /dev/null @@ -1,95 +0,0 @@ -import { - mutations -} from '@/uni_modules/uni-id-pages/common/store.js' -import config from '@/uni_modules/uni-id-pages/config.js' -const mixin = { - data() { - return { - config, - uniIdRedirectUrl: '', - isMounted: false - } - }, - onUnload() { - // #ifdef H5 - document.onkeydown = false - // #endif - }, - mounted() { - this.isMounted = true - }, - onLoad(e) { - if (e.is_weixin_redirect) { - uni.showLoading({ - mask: true - }) - - if (window.location.href.includes('#')) { - // 将url通过 ? 分割获取后面的参数字符串 再通过 & 将每一个参数单独分割出来 - const paramsArr = window.location.href.split('?')[1].split('&') - paramsArr.forEach(item => { - const arr = item.split('=') - if (arr[0] == 'code') { - e.code = arr[1] - } - }) - } - this.$nextTick(n => { - // console.log(this.$refs.uniFabLogin); - this.$refs.uniFabLogin.login({ - code: e.code - }, 'weixin') - }) - } - - if (e.uniIdRedirectUrl) { - this.uniIdRedirectUrl = decodeURIComponent(e.uniIdRedirectUrl) - } - - // #ifdef MP-WEIXIN - if (getCurrentPages().length === 1) { - uni.hideHomeButton() - console.log('已隐藏:返回首页按钮'); - } - // #endif - }, - computed: { - needAgreements() { - if (this.isMounted) { - if (this.$refs.agreements) { - return this.$refs.agreements.needAgreements - } else { - return false - } - } - }, - agree: { - get() { - if (this.isMounted) { - if (this.$refs.agreements) { - return this.$refs.agreements.isAgree - } else { - return true - } - } - }, - set(agree) { - if (this.$refs.agreements) { - this.$refs.agreements.isAgree = agree - } else { - console.log('不存在 隐私政策协议组件'); - } - } - } - }, - methods: { - loginSuccess(e) { - mutations.loginSuccess({ - ...e, - uniIdRedirectUrl: this.uniIdRedirectUrl - }) - } - } -} - -export default mixin diff --git a/sport-erp-admin/uni_modules/uni-id-pages/common/login-page.scss b/sport-erp-admin/uni_modules/uni-id-pages/common/login-page.scss deleted file mode 100644 index 5de6899..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/common/login-page.scss +++ /dev/null @@ -1,126 +0,0 @@ -// 隐藏 edge 浏览器的密码查看按钮 - -/* #ifdef H5 */ -.input-box ::v-deep{ - .uni-input-input[type="password"] { - &::-ms-reveal { - display: none; - } - } -} -/* #endif */ - -.uni-content { - padding: 0 60rpx; -} - -.login-logo { - display: none; -} - -/* #ifndef APP-NVUE */ -@media screen and (min-width: 690px) { - .uni-content { - /* #ifndef H5 */ - padding: 0; - max-width: 300px; - margin-left: calc(50% - 200px); - /* #endif */ - /* #ifdef H5 */ - margin: 0 auto; - position: relative; - top: 100px; - padding: 30px 40px 80px 40px; - max-width: 450px; - max-height: 450px; - border-radius: 10px; - box-shadow: 0 0 20px #efefef; - background-color: #FFF; - /* #endif */ - } - /* #ifdef H5 */ - .login-logo { - display: flex; - justify-content: center; - } - - .login-logo image { - width: 60px; - height: 60px; - } - - .register-back{ - display: none; - } - - uni-button{ - padding-bottom: 1px; - } - - /* #endif */ -} - -.uni-content view { - box-sizing: border-box; -} -/* #endif */ - - - -.title { - /* #ifndef APP-NVUE */ - display: flex; - /* #endif */ - padding: 18px 0; - font-weight: 800; - flex-direction: column; -} - -.tip { - /* #ifndef APP-NVUE */ - display: flex; - /* #endif */ - color: #BDBDC0; - font-size: 11px; - margin: 6px 0; -} - - -/* #ifndef APP-NVUE */ -// 解决小程序端开启虚拟节点virtualHost引起的 class = input-box丢失的问题 [详情参考](https://uniapp.dcloud.net.cn/matter.html#%E5%90%84%E5%AE%B6%E5%B0%8F%E7%A8%8B%E5%BA%8F%E5%AE%9E%E7%8E%B0%E6%9C%BA%E5%88%B6%E4%B8%8D%E5%90%8C-%E5%8F%AF%E8%83%BD%E5%AD%98%E5%9C%A8%E7%9A%84%E5%B9%B3%E5%8F%B0%E5%85%BC%E5%AE%B9%E9%97%AE%E9%A2%98) -.uni-content ::v-deep .uni-easyinput__content, -/* #endif */ - -.input-box { - height: 44px; - background-color: #F8F8F8 !important; - border-radius: 0; - font-size: 14px; - /* #ifndef APP-NVUE */ - display: flex; - /* #endif */ - flex: 1; -} - -.link { - color: #04498c; - cursor: pointer; -} - -.uni-content ::v-deep .uni-forms-item__inner { - padding-bottom: 8px; -} - -.uni-btn { - text-align: center; - height: 40px; - line-height: 40px; - margin: 15px 0 10px 0; - color: #FFF !important; - border-radius: 5px; - font-size: 16px; -} - -.uni-body.uni_modules-uni-id-pages-pages-login-login-withoutpwd{ - height: auto !important; -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/common/loginSuccess.js b/sport-erp-admin/uni_modules/uni-id-pages/common/loginSuccess.js deleted file mode 100644 index 48dac11..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/common/loginSuccess.js +++ /dev/null @@ -1,45 +0,0 @@ -import pagesJson from '@/pages.json' - -export default function(e = {}) { - const { - showToast = true, toastText = '登录成功', autoBack = true, uniIdRedirectUrl = '' - } = e - - if (showToast) { - uni.showToast({ - title: toastText, - icon: 'none' - }); - } - if (autoBack) { - let delta = 0; //判断需要返回几层 - let pages = getCurrentPages(); - uni.$emit('uni-id-pages-login-success',pages) - pages.forEach((page, index) => { - if (pages[pages.length - index - 1].route.split('/')[3] == 'login') { - delta++ - } - }) - if (uniIdRedirectUrl) { - return uni.reLaunch({ - url: uniIdRedirectUrl - }) - } - // #ifdef H5 - if(e.loginType == 'weixin'){ - return window.history.go(-3) - } - // #endif - - if (delta) { - const page = pagesJson.pages[0] - return uni.reLaunch({ - url: `/${page.path}` - }) - } - - uni.navigateBack({ - delta - }) - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/common/password.js b/sport-erp-admin/uni_modules/uni-id-pages/common/password.js deleted file mode 100644 index 196c240..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/common/password.js +++ /dev/null @@ -1,85 +0,0 @@ -// 导入配置 -import config from '@/uni_modules/uni-id-pages/config.js' - -const {passwordStrength} = config - -// 密码强度表达式 -const passwordRules = { - // 密码必须包含大小写字母、数字和特殊符号 - super: /^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[~!@#$%^&*_\-+=`|\\(){}[\]:;"'<>,.?/])[0-9a-zA-Z~!@#$%^&*_\-+=`|\\(){}[\]:;"'<>,.?/]{8,16}$/, - // 密码必须包含字母、数字和特殊符号 - strong: /^(?=.*[0-9])(?=.*[a-zA-Z])(?=.*[~!@#$%^&*_\-+=`|\\(){}[\]:;"'<>,.?/])[0-9a-zA-Z~!@#$%^&*_\-+=`|\\(){}[\]:;"'<>,.?/]{8,16}$/, - // 密码必须为字母、数字和特殊符号任意两种的组合 - medium: /^(?![0-9]+$)(?![a-zA-Z]+$)(?![~!@#$%^&*_\-+=`|\\(){}[\]:;"'<>,.?/]+$)[0-9a-zA-Z~!@#$%^&*_\-+=`|\\(){}[\]:;"'<>,.?/]{8,16}$/, - // 密码必须包含字母和数字 - weak: /^(?=.*[0-9])(?=.*[a-zA-Z])[0-9a-zA-Z~!@#$%^&*_\-+=`|\\(){}[\]:;"'<>,.?/]{6,16}$/ -} - -const ERROR = { - normal: { - noPwd: '请输入密码', - noRePwd: '再次输入密码', - rePwdErr: '两次输入密码不一致' - }, - passwordStrengthError: { - super: '密码必须包含大小写字母、数字和特殊符号,密码长度必须在8-16位之间', - strong: '密码必须包含字母、数字和特殊符号,密码长度必须在8-16位之间', - medium: '密码必须为字母、数字和特殊符号任意两种的组合,密码长度必须在8-16位之间', - weak: '密码必须包含字母,密码长度必须在6-16位之间' - } -} - -function validPwd(password) { - //强度校验 - if (passwordStrength && passwordRules[passwordStrength]) { - if (!new RegExp(passwordRules[passwordStrength]).test(password)) { - return ERROR.passwordStrengthError[passwordStrength] - } - } - return true -} - -function getPwdRules(pwdName = 'password', rePwdName = 'password2') { - const rules = {} - rules[pwdName] = { - rules: [{ - required: true, - errorMessage: ERROR.normal.noPwd, - }, - { - validateFunction: function(rule, value, data, callback) { - const checkRes = validPwd(value) - if (checkRes !== true) { - callback(checkRes) - } - return true - } - } - ] - } - - if (rePwdName) { - rules[rePwdName] = { - rules: [{ - required: true, - errorMessage: ERROR.normal.noRePwd, - }, - { - validateFunction: function(rule, value, data, callback) { - if (value != data[pwdName]) { - callback(ERROR.normal.rePwdErr) - } - return true - } - } - ] - } - } - return rules -} - -export default { - ERROR, - validPwd, - getPwdRules -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/common/store.js b/sport-erp-admin/uni_modules/uni-id-pages/common/store.js deleted file mode 100644 index 83fdd1e..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/common/store.js +++ /dev/null @@ -1,174 +0,0 @@ -import pagesJson from '@/pages.json' -import config from '@/uni_modules/uni-id-pages/config.js' - -const uniIdCo = uniCloud.importObject("uni-id-co") -const db = uniCloud.database(); -const usersTable = db.collection('uni-id-users') - -let hostUserInfo = uni.getStorageSync('uni-id-pages-userInfo')||{} -// console.log( hostUserInfo); -const data = { - userInfo: hostUserInfo, - hasLogin: Object.keys(hostUserInfo).length != 0 -} - -// console.log('data', data); -// 定义 mutations, 修改属性 -export const mutations = { - // data不为空,表示传递要更新的值(注意不是覆盖是合并),什么也不传时,直接查库获取更新 - async updateUserInfo(data = false) { - if (data) { - usersTable.where('_id==$env.uid').update(data).then(e => { - // console.log(e); - if (e.result.updated) { - uni.showToast({ - title: "更新成功", - icon: 'none', - duration: 3000 - }); - this.setUserInfo(data) - } else { - uni.showToast({ - title: "没有改变", - icon: 'none', - duration: 3000 - }); - } - }) - - } else { - const uniIdCo = uniCloud.importObject("uni-id-co", { - customUI: true - }) - try { - let res = await usersTable.where("'_id' == $cloudEnv_uid") - .field('mobile,nickname,username,email,avatar_file') - .get() - - const realNameRes = await uniIdCo.getRealNameInfo() - - // console.log('fromDbData',res.result.data); - this.setUserInfo({ - ...res.result.data[0], - realNameAuth: realNameRes - }) - } catch (e) { - this.setUserInfo({},{cover:true}) - console.error(e.message, e.errCode); - } - } - }, - async setUserInfo(data, {cover}={cover:false}) { - // console.log('set-userInfo', data); - let userInfo = cover?data:Object.assign(store.userInfo,data) - store.userInfo = Object.assign({},userInfo) - store.hasLogin = Object.keys(store.userInfo).length != 0 - // console.log('store.userInfo', store.userInfo); - uni.setStorageSync('uni-id-pages-userInfo', store.userInfo) - return data - }, - async logout() { - // 1. 已经过期就不需要调用服务端的注销接口 2.即使调用注销接口失败,不能阻塞客户端 - if(uniCloud.getCurrentUserInfo().tokenExpired > Date.now()){ - try{ - await uniIdCo.logout() - }catch(e){ - console.error(e); - } - } - uni.removeStorageSync('uni_id_token'); - uni.setStorageSync('uni_id_token_expired', 0) - uni.redirectTo({ - url: `/${pagesJson.uniIdRouter && pagesJson.uniIdRouter.loginPage ? pagesJson.uniIdRouter.loginPage: 'uni_modules/uni-id-pages/pages/login/login-withoutpwd'}`, - }); - uni.$emit('uni-id-pages-logout') - this.setUserInfo({},{cover:true}) - }, - - loginBack (e = {}) { - const {uniIdRedirectUrl = ''} = e - let delta = 0; //判断需要返回几层 - let pages = getCurrentPages(); - // console.log(pages); - pages.forEach((page, index) => { - if (pages[pages.length - index - 1].route.split('/')[3] == 'login') { - delta++ - } - }) - // console.log('判断需要返回几层:', delta); - if (uniIdRedirectUrl) { - return uni.redirectTo({ - url: uniIdRedirectUrl, - fail: (err1) => { - uni.switchTab({ - url:uniIdRedirectUrl, - fail: (err2) => { - console.log(err1,err2) - } - }) - } - }) - } - // #ifdef H5 - if (e.loginType == 'weixin') { - // console.log('window.history', window.history); - return window.history.go(-3) - } - // #endif - - if (delta) { - const page = pagesJson.pages[0] - return uni.reLaunch({ - url: `/${page.path}` - }) - } - - uni.navigateBack({ - delta - }) - }, - loginSuccess(e = {}){ - const { - showToast = true, toastText = '登录成功', autoBack = true, uniIdRedirectUrl = '', passwordConfirmed - } = e - // console.log({toastText,autoBack}); - if (showToast) { - uni.showToast({ - title: toastText, - icon: 'none', - duration: 3000 - }); - } - this.updateUserInfo() - - uni.$emit('uni-id-pages-login-success') - - if (config.setPasswordAfterLogin && !passwordConfirmed) { - return uni.redirectTo({ - url: uniIdRedirectUrl ? `/uni_modules/uni-id-pages/pages/userinfo/set-pwd/set-pwd?uniIdRedirectUrl=${uniIdRedirectUrl}&loginType=${e.loginType}`: `/uni_modules/uni-id-pages/pages/userinfo/set-pwd/set-pwd?loginType=${e.loginType}`, - fail: (err) => { - console.log(err) - } - }) - } - - if (autoBack) { - this.loginBack({uniIdRedirectUrl}) - } - } - -} - -// #ifdef VUE2 -import Vue from 'vue' -// 通过Vue.observable创建一个可响应的对象 -export const store = Vue.observable(data) -// #endif - -// #ifdef VUE3 -import { - reactive -} from 'vue' -// 通过Vue.observable创建一个可响应的对象 -export const store = reactive(data) -// #endif diff --git a/sport-erp-admin/uni_modules/uni-id-pages/components/cloud-image/cloud-image.vue b/sport-erp-admin/uni_modules/uni-id-pages/components/cloud-image/cloud-image.vue deleted file mode 100644 index d714a3a..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/components/cloud-image/cloud-image.vue +++ /dev/null @@ -1,73 +0,0 @@ - - - \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-id-pages/components/uni-id-pages-agreements/uni-id-pages-agreements.vue b/sport-erp-admin/uni_modules/uni-id-pages/components/uni-id-pages-agreements/uni-id-pages-agreements.vue deleted file mode 100644 index 31ab0b7..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/components/uni-id-pages-agreements/uni-id-pages-agreements.vue +++ /dev/null @@ -1,167 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-id-pages/components/uni-id-pages-avatar/uni-id-pages-avatar.vue b/sport-erp-admin/uni_modules/uni-id-pages/components/uni-id-pages-avatar/uni-id-pages-avatar.vue deleted file mode 100644 index a5d73d1..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/components/uni-id-pages-avatar/uni-id-pages-avatar.vue +++ /dev/null @@ -1,198 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-id-pages/components/uni-id-pages-bind-mobile/uni-id-pages-bind-mobile.vue b/sport-erp-admin/uni_modules/uni-id-pages/components/uni-id-pages-bind-mobile/uni-id-pages-bind-mobile.vue deleted file mode 100644 index 56edaec..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/components/uni-id-pages-bind-mobile/uni-id-pages-bind-mobile.vue +++ /dev/null @@ -1,160 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-id-pages/components/uni-id-pages-email-form/uni-id-pages-email-form.vue b/sport-erp-admin/uni_modules/uni-id-pages/components/uni-id-pages-email-form/uni-id-pages-email-form.vue deleted file mode 100644 index b10d7dc..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/components/uni-id-pages-email-form/uni-id-pages-email-form.vue +++ /dev/null @@ -1,248 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-id-pages/components/uni-id-pages-fab-login/uni-id-pages-fab-login.vue b/sport-erp-admin/uni_modules/uni-id-pages/components/uni-id-pages-fab-login/uni-id-pages-fab-login.vue deleted file mode 100644 index 9688abf..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/components/uni-id-pages-fab-login/uni-id-pages-fab-login.vue +++ /dev/null @@ -1,568 +0,0 @@ - - - - diff --git a/sport-erp-admin/uni_modules/uni-id-pages/components/uni-id-pages-sms-form/uni-id-pages-sms-form.vue b/sport-erp-admin/uni_modules/uni-id-pages/components/uni-id-pages-sms-form/uni-id-pages-sms-form.vue deleted file mode 100644 index 1d38b87..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/components/uni-id-pages-sms-form/uni-id-pages-sms-form.vue +++ /dev/null @@ -1,242 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-id-pages/components/uni-id-pages-user-profile/uni-id-pages-user-profile.vue b/sport-erp-admin/uni_modules/uni-id-pages/components/uni-id-pages-user-profile/uni-id-pages-user-profile.vue deleted file mode 100644 index 5443be0..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/components/uni-id-pages-user-profile/uni-id-pages-user-profile.vue +++ /dev/null @@ -1,171 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-id-pages/config.js b/sport-erp-admin/uni_modules/uni-id-pages/config.js deleted file mode 100644 index 2ecffb9..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/config.js +++ /dev/null @@ -1,56 +0,0 @@ -export default { - //调试模式 - "debug": false, - /* - 登录类型 未列举到的或运行环境不支持的,将被自动隐藏。 - 如果需要在不同平台有不同的配置,直接用条件编译即可 - */ - "isAdmin": true, // 区分管理端与用户端 - "loginTypes": [ - // "qq", - // "xiaomi", - // "sinaweibo", - // "taobao", - // "facebook", - // "google", - // "alipay", - // "douyin", - - // #ifdef APP - "univerify", - // #endif - // "weixin", - "username", - // #ifdef APP - "apple", - // #endif - // "smsCode" - ], - //政策协议 - // "agreements": { - // "serviceUrl": "https://xxx", //用户服务协议链接 - // "privacyUrl": "https://xxx", //隐私政策条款链接 - // // 哪些场景下显示,1.注册(包括登录并注册,如:微信登录、苹果登录、短信验证码登录)、2.登录(如:用户名密码登录) - // "scope": [ - // 'register', 'login' - // ] - // }, - // 提供各类服务接入(如微信登录服务)的应用id - "appid": { - "weixin": { - // 微信公众号的appid,来源:登录微信公众号(https://mp.weixin.qq.com)-> 设置与开发 -> 基本配置 -> 公众号开发信息 -> AppID - "h5": "xxxxxx", - // 微信开放平台的appid,来源:登录微信开放平台(https://open.weixin.qq.com) -> 管理中心 -> 网站应用 -> 选择对应的应用名称,点击查看 -> AppID - "web": "xxxxxx" - } - }, - /** - * 密码强度 - * super(超强:密码必须包含大小写字母、数字和特殊符号,长度范围:8-16位之间) - * strong(强: 密密码必须包含字母、数字和特殊符号,长度范围:8-16位之间) - * medium (中:密码必须为字母、数字和特殊符号任意两种的组合,长度范围:8-16位之间) - * weak(弱:密码必须包含字母和数字,长度范围:6-16位之间) - * 为空或false则不验证密码强度 - */ - "passwordStrength":"medium" -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/init.js b/sport-erp-admin/uni_modules/uni-id-pages/init.js deleted file mode 100644 index 6fd6297..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/init.js +++ /dev/null @@ -1,95 +0,0 @@ -// 导入配置 -import config from '@/uni_modules/uni-id-pages/config.js' -// uni-id的云对象 -const uniIdCo = uniCloud.importObject('uni-id-co', { - customUI: true -}) -// 用户配置的登录方式、是否打开调试模式 -const { - loginTypes, - debug -} = config - -export default async function () { - // 有打开调试模式的情况下 - if (debug) { - // 1. 检查本地uni-id-pages中配置的登录方式,服务器端是否已经配置正确。否则提醒并引导去配置 - // 调用云对象,获取服务端已正确配置的登录方式 - const { - supportedLoginType - } = await uniIdCo.getSupportedLoginType() - // console.log('supportedLoginType: ' + JSON.stringify(supportedLoginType)) - // 登录方式,服务端和客户端的映射关系 - const data = { - smsCode: 'mobile-code', - univerify: 'univerify', - username: 'username-password', - weixin: 'weixin', - qq: 'qq', - xiaomi: 'xiaomi', - sinaweibo: 'sinaweibo', - taobao: 'taobao', - facebook: 'facebook', - google: 'google', - alipay: 'alipay', - apple: 'apple', - weixinMobile: 'weixin' - } - // 遍历客户端配置的登录方式,与服务端比对。并在错误时抛出错误提示 - const list = loginTypes.filter(type => !supportedLoginType.includes(data[type])) - if (list.length) { - console.error( - `错误:前端启用的登录方式:${list.join(',')};没有在服务端完成配置。配置文件路径:"/uni_modules/uni-config-center/uniCloud/cloudfunctions/common/uni-config-center/uni-id/config.json"` - ) - } - } - - // #ifdef APP-PLUS - // 如果uni-id-pages配置的登录功能有一键登录,有则执行预登录(异步) - if (loginTypes.includes('univerify')) { - uni.preLogin({ - provider: 'univerify', - complete: e => { - // console.log(e); - } - }) - } - // #endif - - // 3. 绑定clientDB错误事件 - // clientDB对象 - const db = uniCloud.database() - db.on('error', onDBError) - // clientDB的错误提示 - function onDBError ({ - code, // 错误码详见https://uniapp.dcloud.net.cn/uniCloud/clientdb?id=returnvalue - message - }) { - // console.error('onDBError', {code,message}); - } - // 解绑clientDB错误事件 - // db.off('error', onDBError) - - // 4. 同步客户端push_clientid至device表 - if (uniCloud.onRefreshToken) { - uniCloud.onRefreshToken(() => { - // console.log('onRefreshToken'); - if (uni.getPushClientId) { - uni.getPushClientId({ - success: async function (e) { - // console.log(e) - const pushClientId = e.cid - // console.log(pushClientId); - const res = await uniIdCo.setPushCid({ - pushClientId - }) - // console.log('getPushClientId', res); - }, - fail (e) { - // console.log(e) - } - }) - } - }) - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/package.json b/sport-erp-admin/uni_modules/uni-id-pages/package.json deleted file mode 100644 index bac7d60..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/package.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "id": "uni-id-pages", - "displayName": "uni-id-pages", - "version": "1.1.20", - "description": "云端一体简单、统一、可扩展的用户中心页面模版", - "keywords": [ - "用户管理", - "用户中心", - "短信验证码", - "login", - "登录" - ], - "repository": "https://gitcode.net/dcloud/hello_uni-id-pages", - "engines": { - "HBuilderX": "^3.4.17" - }, - "dcloudext": { - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "", - "type": "unicloud-template-page" - }, - "uni_modules": { - "dependencies": [ - "uni-captcha", - "uni-config-center", - "uni-data-checkbox", - "uni-easyinput", - "uni-forms", - "uni-icons", - "uni-id-common", - "uni-list", - "uni-load-more", - "uni-popup", - "uni-scss", - "uni-transition", - "uni-open-bridge-common", - "uni-cloud-s2s" - ], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y", - "alipay": "y" - }, - "client": { - "Vue": { - "vue2": "y", - "vue3": "y" - }, - "App": { - "app-vue": "y", - "app-nvue": "u" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "u", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "u", - "百度": "u", - "字节跳动": "u", - "QQ": "u", - "钉钉": "u", - "快手": "u", - "飞书": "u", - "京东": "u" - }, - "快应用": { - "华为": "u", - "联盟": "u" - } - } - } - }, - "dependencies": { - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/pages/common/webview/webview.vue b/sport-erp-admin/uni_modules/uni-id-pages/pages/common/webview/webview.vue deleted file mode 100644 index 71ff55c..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/pages/common/webview/webview.vue +++ /dev/null @@ -1,35 +0,0 @@ - - - - diff --git a/sport-erp-admin/uni_modules/uni-id-pages/pages/login/login-smscode.vue b/sport-erp-admin/uni_modules/uni-id-pages/pages/login/login-smscode.vue deleted file mode 100644 index cf10b73..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/pages/login/login-smscode.vue +++ /dev/null @@ -1,120 +0,0 @@ - - - - diff --git a/sport-erp-admin/uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue b/sport-erp-admin/uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue deleted file mode 100644 index 16479e4..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/pages/login/login-withoutpwd.vue +++ /dev/null @@ -1,241 +0,0 @@ - - - - - - diff --git a/sport-erp-admin/uni_modules/uni-id-pages/pages/login/login-withpwd.vue b/sport-erp-admin/uni_modules/uni-id-pages/pages/login/login-withpwd.vue deleted file mode 100644 index c4fe85a..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/pages/login/login-withpwd.vue +++ /dev/null @@ -1,189 +0,0 @@ - - - - - - diff --git a/sport-erp-admin/uni_modules/uni-id-pages/pages/register/register-admin.vue b/sport-erp-admin/uni_modules/uni-id-pages/pages/register/register-admin.vue deleted file mode 100644 index 30a7e2d..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/pages/register/register-admin.vue +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - diff --git a/sport-erp-admin/uni_modules/uni-id-pages/pages/register/register-by-email.vue b/sport-erp-admin/uni_modules/uni-id-pages/pages/register/register-by-email.vue deleted file mode 100644 index 6bf9f7d..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/pages/register/register-by-email.vue +++ /dev/null @@ -1,216 +0,0 @@ - - - - - - diff --git a/sport-erp-admin/uni_modules/uni-id-pages/pages/register/register.vue b/sport-erp-admin/uni_modules/uni-id-pages/pages/register/register.vue deleted file mode 100644 index 172ba77..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/pages/register/register.vue +++ /dev/null @@ -1,181 +0,0 @@ - - - - - - diff --git a/sport-erp-admin/uni_modules/uni-id-pages/pages/register/validator.js b/sport-erp-admin/uni_modules/uni-id-pages/pages/register/validator.js deleted file mode 100644 index 3c39c76..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/pages/register/validator.js +++ /dev/null @@ -1,56 +0,0 @@ -import passwordMod from '@/uni_modules/uni-id-pages/common/password.js' -export default { - "username": { - "rules": [{ - required: true, - errorMessage: '请输入用户名', - }, - { - minLength: 3, - maxLength: 32, - errorMessage: '用户名长度在 {minLength} 到 {maxLength} 个字符', - }, - { - validateFunction: function(rule, value, data, callback) { - // console.log(value); - if (/^1\d{10}$/.test(value) || /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/.test(value)) { - callback('用户名不能是:手机号或邮箱') - }; - if (/^\d+$/.test(value)) { - callback('用户名不能为纯数字') - }; - if(/[\u4E00-\u9FA5\uF900-\uFA2D]{1,}/.test(value)){ - callback('用户名不能包含中文') - } - return true - } - } - ], - "label": "用户名" - }, - "nickname": { - "rules": [{ - minLength: 3, - maxLength: 32, - errorMessage: '昵称长度在 {minLength} 到 {maxLength} 个字符', - }, - { - validateFunction: function(rule, value, data, callback) { - // console.log(value); - if (/^1\d{10}$/.test(value) || /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/.test(value)) { - callback('昵称不能是:手机号或邮箱') - }; - if (/^\d+$/.test(value)) { - callback('昵称不能为纯数字') - }; - // if(/[\u4E00-\u9FA5\uF900-\uFA2D]{1,}/.test(value)){ - // callback('昵称不能包含中文') - // } - return true - } - } - ], - "label": "昵称" - }, - ...passwordMod.getPwdRules() -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/pages/retrieve/retrieve-by-email.vue b/sport-erp-admin/uni_modules/uni-id-pages/pages/retrieve/retrieve-by-email.vue deleted file mode 100644 index 9d9cef5..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/pages/retrieve/retrieve-by-email.vue +++ /dev/null @@ -1,218 +0,0 @@ - - - - - - diff --git a/sport-erp-admin/uni_modules/uni-id-pages/pages/retrieve/retrieve.vue b/sport-erp-admin/uni_modules/uni-id-pages/pages/retrieve/retrieve.vue deleted file mode 100644 index f3b3dc3..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/pages/retrieve/retrieve.vue +++ /dev/null @@ -1,241 +0,0 @@ - - - - - - diff --git a/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/bind-mobile/bind-mobile.vue b/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/bind-mobile/bind-mobile.vue deleted file mode 100644 index a6b2b1f..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/bind-mobile/bind-mobile.vue +++ /dev/null @@ -1,131 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/change_pwd/change_pwd.vue b/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/change_pwd/change_pwd.vue deleted file mode 100644 index b6badde..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/change_pwd/change_pwd.vue +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - diff --git a/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/cropImage/cropImage.vue b/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/cropImage/cropImage.vue deleted file mode 100644 index 2317b9b..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/cropImage/cropImage.vue +++ /dev/null @@ -1,39 +0,0 @@ - - - - - \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/README.md b/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/README.md deleted file mode 100644 index 9219f81..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/README.md +++ /dev/null @@ -1,227 +0,0 @@ -> 插件来源:[https://ext.dcloud.net.cn/plugin?id=3594](https://ext.dcloud.net.cn/plugin?id=3594) -##### 以下是作者写的插件介绍: - -# Clipper 图片裁剪 -> uniapp 图片裁剪,可用于图片头像等裁剪处理 -> [查看更多](http://liangei.gitee.io/limeui/#/clipper)
-> Q群:458377637 - - -## 平台兼容 - -| H5 | 微信小程序 | 支付宝小程序 | 百度小程序 | 头条小程序 | QQ 小程序 | App | -| --- | ---------- | ------------ | ---------- | ---------- | --------- | --- | -| √ | √ | √ | 未测 | √ | √ | √ | - - -## 代码演示 -### 基本用法 -`@success` 事件点击 👉 **确定** 后会返回生成的图片信息,包含 `url`、`width`、`height` - -```html - - - -``` - -```js -// 非uni_modules引入 -import lClipper from '@/components/lime-clipper/' -// uni_modules引入 -import lClipper from '@/uni_modules/lime-clipper/components/lime-clipper/' -export default { - components: {lClipper}, - data() { - return { - show: false, - url: '', - } - } -} -``` - - -### 传入图片 -`image-url`可传入**相对路径**、**临时路径**、**本地路径**、**网络图片**
- -* **当为网络地址时** -* H5:👉 需要解决跨域问题。
-* 小程序:👉 需要配置 downloadFile 域名
- - -```html - - - -``` - -```js -export default { - components: {lClipper}, - data() { - return { - imageUrl: 'https://img12.360buyimg.com/pop/s1180x940_jfs/t1/97205/26/1142/87801/5dbac55aEf795d962/48a4d7a63ff80b8b.jpg', - show: false, - url: '', - } - } -} -``` - - -### 确定按钮颜色 -样式变量名:`--l-clipper-confirm-color` -可放到全局样式的 `page` 里或节点的 `style` -```html - -``` -```css -// css 中为组件设置 CSS 变量 -.clipper { - --l-clipper-confirm-color: linear-gradient(to right, #ff6034, #ee0a24) -} -// 全局 -page { - --l-clipper-confirm-color: linear-gradient(to right, #ff6034, #ee0a24) -} -``` - - -### 使用插槽 -共五个插槽 `cancel` 取消按钮、 `photo` 选择图片按钮、 `rotate` 旋转按钮、 `confirm` 确定按钮和默认插槽。 - -```html - - - - 取消 - 选择图片 - 旋转 - 确定 - - - 显示取消按钮 - - - 显示选择图片按钮 - - - 显示旋转按钮 - - - 显示确定按钮 - - - 锁定裁剪框宽度 - - - 锁定裁剪框高度 - - - 锁定裁剪框比例 - - - 限制移动范围 - - - 禁止缩放 - - - 禁止旋转 - - - - - -``` - -```js -export default { - components: {lClipper}, - data() { - return { - show: false, - url: '', - isLockWidth: false, - isLockHeight: false, - isLockRatio: true, - isLimitMove: false, - isDisableScale: false, - isDisableRotate: false, - isShowCancelBtn: true, - isShowPhotoBtn: true, - isShowRotateBtn: true, - isShowConfirmBtn: true - } - } -} -``` - - -## API - -### Props - -| 参数 | 说明 | 类型 | 默认值 | -| ------------- | ------------ | ---------------- | ------------ | -| image-url | 图片路径 | string | | -| quality | 图片的质量,取值范围为 [0, 1],不在范围内时当作1处理 | number | `1` | -| source | `{album: '从相册中选择'}`key为图片来源类型,value为选项说明 | Object | | -| width | 裁剪框宽度,单位为 `rpx` | number | `400` | -| height | 裁剪框高度 | number | `400` | -| min-width | 裁剪框最小宽度 | number | `200` | -| min-height |裁剪框最小高度 | number | `200` | -| max-width | 裁剪框最大宽度 | number | `600` | -| max-height | 裁剪框最大宽度 | number | `600` | -| min-ratio | 图片最小缩放比 | number | `0.5` | -| max-ratio | 图片最大缩放比 | number | `2` | -| rotate-angle | 旋转按钮每次旋转的角度 | number | `90` | -| scale-ratio | 生成图片相对于裁剪框的比例, **比例越高生成图片越清晰** | number | `1` | -| is-lock-width | 是否锁定裁剪框宽度 | boolean | `false` | -| is-lock-height | 是否锁定裁剪框高度上 | boolean | `false` | -| is-lock-ratio | 是否锁定裁剪框比例 | boolean | `true` | -| is-disable-scale | 是否禁止缩放 | boolean | `false` | -| is-disable-rotate | 是否禁止旋转 | boolean | `false` | -| is-limit-move | 是否限制移动范围 | boolean | `false` | -| is-show-photo-btn | 是否显示选择图片按钮 | boolean | `true` | -| is-show-rotate-btn | 是否显示转按钮 | boolean | `true` | -| is-show-confirm-btn | 是否显示确定按钮 | boolean | `true` | -| is-show-cancel-btn | 是否显示关闭按钮 | boolean | `true` | - - - -### 事件 Events - -| 事件名 | 说明 | 回调 | -| ------- | ------------ | -------------- | -| success | 生成图片成功 | {`width`, `height`, `url`} | -| fail | 生成图片失败 | `error` | -| cancel | 关闭 | `false` | -| ready | 图片加载完成 | {`width`, `height`, `path`, `orientation`, `type`} | -| change | 图片大小改变时触发 | {`width`, `height`} | -| rotate | 图片旋转时触发 | `angle` | - -## 常见问题 -> 1、H5端使用网络图片需要解决跨域问题。
-> 2、小程序使用网络图片需要去公众平台增加下载白名单!二级域名也需要配!
-> 3、H5端生成图片是base64,有时显示只有一半可以使用原生标签``
-> 4、IOS APP 请勿使用HBX2.9.3.20201014的版本!这个版本无法生成图片。
-> 5、APP端无成功反馈、也无失败反馈时,请更新基座和HBX。
- - -## 打赏 -如果你觉得本插件,解决了你的问题,赠人玫瑰,手留余香。
-![输入图片说明](https://images.gitee.com/uploads/images/2020/1122/222521_bb543f96_518581.jpeg "微信图片编辑_20201122220352.jpg") \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/images/photo.svg b/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/images/photo.svg deleted file mode 100644 index 7b4b590..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/images/photo.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - diff --git a/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/images/rotate.svg b/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/images/rotate.svg deleted file mode 100644 index 0143706..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/images/rotate.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - diff --git a/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/index.css b/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/index.css deleted file mode 100644 index ce542bf..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/index.css +++ /dev/null @@ -1,160 +0,0 @@ -.flex-auto { - flex: auto; -} -.bg-transparent { - background-color: rgba(0,0,0,0.9); - transition-duration: 0.35s; -} -.l-clipper { - width: 100vw; - height: calc(100vh - var(--window-top)); - background-color: rgba(0,0,0,0.9); - position: fixed; - top: var(--window-top); - left: 0; - z-index: 1; -} -.l-clipper-mask { - position: relative; - z-index: 2; - pointer-events: none; -} -.l-clipper__content { - pointer-events: none; - position: absolute; - border: 1rpx solid rgba(255,255,255,0.3); - box-sizing: border-box; - box-shadow: rgba(0,0,0,0.5) 0 0 0 80vh; - background: transparent; -} -.l-clipper__content::before, -.l-clipper__content::after { - content: ''; - position: absolute; - border: 1rpx dashed rgba(255,255,255,0.3); -} -.l-clipper__content::before { - width: 100%; - top: 33.33%; - height: 33.33%; - border-left: none; - border-right: none; -} -.l-clipper__content::after { - width: 33.33%; - left: 33.33%; - height: 100%; - border-top: none; - border-bottom: none; -} -.l-clipper__edge { - position: absolute; - width: 34rpx; - height: 34rpx; - border: 6rpx solid #fff; - pointer-events: auto; -} -.l-clipper__edge::before { - content: ''; - position: absolute; - width: 40rpx; - height: 40rpx; - background-color: transparent; -} -.l-clipper__edge:nth-child(1) { - left: -6rpx; - top: -6rpx; - border-bottom-width: 0 !important; - border-right-width: 0 !important; -} -.l-clipper__edge:nth-child(1):before { - top: -50%; - left: -50%; -} -.l-clipper__edge:nth-child(2) { - right: -6rpx; - top: -6rpx; - border-bottom-width: 0 !important; - border-left-width: 0 !important; -} -.l-clipper__edge:nth-child(2):before { - top: -50%; - left: 50%; -} -.l-clipper__edge:nth-child(3) { - left: -6rpx; - bottom: -6rpx; - border-top-width: 0 !important; - border-right-width: 0 !important; -} -.l-clipper__edge:nth-child(3):before { - bottom: -50%; - left: -50%; -} -.l-clipper__edge:nth-child(4) { - right: -6rpx; - bottom: -6rpx; - border-top-width: 0 !important; - border-left-width: 0 !important; -} -.l-clipper__edge:nth-child(4):before { - bottom: -50%; - left: 50%; -} -.l-clipper-image { - width: 100%; - border-style: none; - position: absolute; - top: 0; - left: 0; - z-index: 1; - -webkit-backface-visibility: hidden; - backface-visibility: hidden; - transform-origin: center; -} -.l-clipper-canvas { - position: fixed; - z-index: 10; - left: -200vw; - top: -200vw; - pointer-events: none; -} -.l-clipper-tools { - position: fixed; - left: 0; - bottom: 10px; - width: 100%; - z-index: 99; - color: #fff; -} -.l-clipper-tools__btns { - font-weight: bold; - display: flex; - align-items: center; - justify-content: space-between; - width: 100%; - padding: 20rpx 40rpx; - box-sizing: border-box; -} -.l-clipper-tools__btns .cancel { - width: 112rpx; - height: 60rpx; - text-align: center; - line-height: 60rpx; -} -.l-clipper-tools__btns .confirm { - width: 112rpx; - height: 60rpx; - line-height: 60rpx; - background-color: #07c160; - border-radius: 6rpx; - text-align: center; -} -.l-clipper-tools__btns image { - display: block; - width: 60rpx; - height: 60rpx; -} -.l-clipper-tools__btns { - flex-direction: row; -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/limeClipper.vue b/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/limeClipper.vue deleted file mode 100644 index 4fc62b3..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/limeClipper.vue +++ /dev/null @@ -1,820 +0,0 @@ - - - - - \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/utils.js b/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/utils.js deleted file mode 100644 index 980c439..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/cropImage/limeClipper/utils.js +++ /dev/null @@ -1,244 +0,0 @@ -/** - * 判断手指触摸位置 - */ -export function determineDirection(clipX, clipY, clipWidth, clipHeight, currentX, currentY) { - /* - * (右下>>1 右上>>2 左上>>3 左下>>4) - */ - let corner; - /** - * 思路:(利用直角坐标系) - * 1.找出裁剪框中心点 - * 2.如点击坐标在上方点与左方点区域内,则点击为左上角 - * 3.如点击坐标在下方点与右方点区域内,则点击为右下角 - * 4.其他角同理 - */ - const mainPoint = [clipX + clipWidth / 2, clipY + clipHeight / 2]; // 中心点 - const currentPoint = [currentX, currentY]; // 触摸点 - - if (currentPoint[0] <= mainPoint[0] && currentPoint[1] <= mainPoint[1]) { - corner = 3; // 左上 - } else if (currentPoint[0] >= mainPoint[0] && currentPoint[1] <= mainPoint[1]) { - corner = 2; // 右上 - } else if (currentPoint[0] <= mainPoint[0] && currentPoint[1] >= mainPoint[1]) { - corner = 4; // 左下 - } else if (currentPoint[0] >= mainPoint[0] && currentPoint[1] >= mainPoint[1]) { - corner = 1; // 右下 - } - - return corner; -} - -/** - * 图片边缘检测检测时,计算图片偏移量 - */ -export function calcImageOffset(data, scale) { - let left = data.imageLeft; - let top = data.imageTop; - scale = scale || data.scale; - - let imageWidth = data.imageWidth; - let imageHeight = data.imageHeight; - if ((data.angle / 90) % 2) { - imageWidth = data.imageHeight; - imageHeight = data.imageWidth; - } - const { - clipX, - clipWidth, - clipY, - clipHeight - } = data; - - // 当前图片宽度/高度 - const currentImageSize = (size) => (size * scale) / 2; - const currentImageWidth = currentImageSize(imageWidth); - const currentImageHeight = currentImageSize(imageHeight); - - left = clipX + currentImageWidth >= left ? left : clipX + currentImageWidth; - left = clipX + clipWidth - currentImageWidth <= left ? left : clipX + clipWidth - currentImageWidth; - top = clipY + currentImageHeight >= top ? top : clipY + currentImageHeight; - top = clipY + clipHeight - currentImageHeight <= top ? top : clipY + clipHeight - currentImageHeight; - return { - left, - top, - scale - }; -} - -/** - * 图片边缘检测时,计算图片缩放比例 - */ -export function calcImageScale(data, scale) { - scale = scale || data.scale; - let { - imageWidth, - imageHeight, - clipWidth, - clipHeight, - angle - } = data - if ((angle / 90) % 2) { - imageWidth = imageHeight; - imageHeight = imageWidth; - } - if (imageWidth * scale < clipWidth) { - scale = clipWidth / imageWidth; - } - if (imageHeight * scale < clipHeight) { - scale = Math.max(scale, clipHeight / imageHeight); - } - return scale; -} - -/** - * 计算图片尺寸 - */ -export function calcImageSize(width, height, data) { - let imageWidth = width, - imageHeight = height; - let { - clipWidth, - clipHeight, - sysinfo, - width: originWidth, - height: originHeight - } = data - if (imageWidth && imageHeight) { - if (imageWidth / imageHeight > (clipWidth || originWidth) / (clipWidth || originHeight)) { - imageHeight = clipHeight || originHeight; - imageWidth = (width / height) * imageHeight; - } else { - imageWidth = clipWidth || originWidth; - imageHeight = (height / width) * imageWidth; - } - } else { - let sys = sysinfo || uni.getSystemInfoSync(); - imageWidth = sys.windowWidth; - imageHeight = 0; - } - return { - imageWidth, - imageHeight - }; -} - -/** - * 勾股定理求斜边 - */ -export function calcPythagoreanTheorem(width, height) { - return Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2)); -} - -/** - * 拖动裁剪框时计算 - */ -export function clipTouchMoveOfCalculate(data, event) { - const clientX = event.touches[0].clientX; - const clientY = event.touches[0].clientY; - - let { - clipWidth, - clipHeight, - clipY: oldClipY, - clipX: oldClipX, - clipStart, - isLockRatio, - maxWidth, - minWidth, - maxHeight, - minHeight - } = data; - maxWidth = maxWidth / 2; - minWidth = minWidth / 2; - minHeight = minHeight / 2; - maxHeight = maxHeight / 2; - - let width = clipWidth, - height = clipHeight, - clipY = oldClipY, - clipX = oldClipX, - // 获取裁剪框实际宽度/高度 - // 如果大于最大值则使用最大值 - // 如果小于最小值则使用最小值 - sizecorrect = () => { - width = width <= maxWidth ? (width >= minWidth ? width : minWidth) : maxWidth; - height = height <= maxHeight ? (height >= minHeight ? height : minHeight) : maxHeight; - }, - sizeinspect = () => { - sizecorrect(); - if ((width > maxWidth || width < minWidth || height > maxHeight || height < minHeight) && isLockRatio) { - return false; - } else { - return true; - } - }; - //if (clipStart.corner) { - height = clipStart.height + (clipStart.corner > 1 && clipStart.corner < 4 ? 1 : -1) * (clipStart.y - clientY); - //} - switch (clipStart.corner) { - case 1: - width = clipStart.width - clipStart.x + clientX; - if (isLockRatio) { - height = width / (clipWidth / clipHeight); - } - if (!sizeinspect()) return; - break; - case 2: - width = clipStart.width - clipStart.x + clientX; - if (isLockRatio) { - height = width / (clipWidth / clipHeight); - } - if (!sizeinspect()) { - return; - } else { - clipY = clipStart.clipY - (height - clipStart.height); - } - - break; - case 3: - width = clipStart.width + clipStart.x - clientX; - if (isLockRatio) { - height = width / (clipWidth / clipHeight); - } - if (!sizeinspect()) { - return; - } else { - clipY = clipStart.clipY - (height - clipStart.height); - clipX = clipStart.clipX - (width - clipStart.width); - } - - break; - case 4: - width = clipStart.width + clipStart.x - clientX; - if (isLockRatio) { - height = width / (clipWidth / clipHeight); - } - if (!sizeinspect()) { - return; - } else { - clipX = clipStart.clipX - (width - clipStart.width); - } - break; - default: - break; - } - return { - width, - height, - clipX, - clipY - }; -} - -/** - * 单指拖动图片计算偏移 - */ -export function imageTouchMoveOfCalcOffset(data, clientXForLeft, clientYForLeft) { - let left = clientXForLeft - data.touchRelative[0].x, - top = clientYForLeft - data.touchRelative[0].y; - return { - left, - top - }; -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/deactivate/deactivate.vue b/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/deactivate/deactivate.vue deleted file mode 100644 index 1b666de..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/deactivate/deactivate.vue +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - diff --git a/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/realname-verify/face-verify-icon.svg b/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/realname-verify/face-verify-icon.svg deleted file mode 100644 index df30eb4..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/realname-verify/face-verify-icon.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/realname-verify/realname-verify.vue b/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/realname-verify/realname-verify.vue deleted file mode 100644 index cefbb23..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/realname-verify/realname-verify.vue +++ /dev/null @@ -1,314 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/set-pwd/set-pwd.vue b/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/set-pwd/set-pwd.vue deleted file mode 100644 index 94ed02a..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/set-pwd/set-pwd.vue +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - diff --git a/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/userinfo.vue b/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/userinfo.vue deleted file mode 100644 index 729484a..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/pages/userinfo/userinfo.vue +++ /dev/null @@ -1,272 +0,0 @@ - - - - diff --git a/sport-erp-admin/uni_modules/uni-id-pages/readme.md b/sport-erp-admin/uni_modules/uni-id-pages/readme.md deleted file mode 100644 index 1650e45..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# 文档已移至uni-id-pages文档[https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html](https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html) - - - -关于插件更新的说明: - -所有uni_modules,在HBuilderX里点右键都可以直接升级。或者在插件市场导入覆盖。 - -覆盖时HBuilderX会弹出代码差异比对,可以决定接受哪些更改、拒绝哪些更改。 - -当拒绝局部修改时,注意可能产生兼容性问题。 - -你需要二次开发uni-id-pages的前端页面, -- 如果改动不大,那么每次更新uni-id-pages时,在HBuilderX的对比界面对比一下就好 -- 如果改动较大,建议复制一套前端页面到自己工程的pages目录下,pages.json里只引用根目录pages下的页面,不引用uni_modules下的页面。然后每次uni-id-pages更新,你对比下比上一版uni-id-pages改了什么,看你是否需要再合并到你自己的pages里。pages.json里不引用uni_modules里的页面的话,打包时不会把这些页面打包进去,不影响发行后的包体积 \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-id-pages/static/app-plus/apple.png b/sport-erp-admin/uni_modules/uni-id-pages/static/app-plus/apple.png deleted file mode 100644 index 556f686..0000000 Binary files a/sport-erp-admin/uni_modules/uni-id-pages/static/app-plus/apple.png and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/alipay.png b/sport-erp-admin/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/alipay.png deleted file mode 100644 index 5256d7a..0000000 Binary files a/sport-erp-admin/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/alipay.png and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/apple.png b/sport-erp-admin/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/apple.png deleted file mode 100644 index 99082a7..0000000 Binary files a/sport-erp-admin/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/apple.png and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/douyin.png b/sport-erp-admin/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/douyin.png deleted file mode 100644 index f218f68..0000000 Binary files a/sport-erp-admin/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/douyin.png and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/facebook.png b/sport-erp-admin/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/facebook.png deleted file mode 100644 index 1331b61..0000000 Binary files a/sport-erp-admin/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/facebook.png and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/google.png b/sport-erp-admin/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/google.png deleted file mode 100644 index 9155046..0000000 Binary files a/sport-erp-admin/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/google.png and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/qq.png b/sport-erp-admin/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/qq.png deleted file mode 100644 index f170691..0000000 Binary files a/sport-erp-admin/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/qq.png and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/sinaweibo.png b/sport-erp-admin/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/sinaweibo.png deleted file mode 100644 index 12cd038..0000000 Binary files a/sport-erp-admin/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/sinaweibo.png and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/taobao.png b/sport-erp-admin/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/taobao.png deleted file mode 100644 index 1837f71..0000000 Binary files a/sport-erp-admin/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/taobao.png and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/univerify.png b/sport-erp-admin/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/univerify.png deleted file mode 100644 index aa0b9f5..0000000 Binary files a/sport-erp-admin/uni_modules/uni-id-pages/static/app-plus/uni-fab-login/univerify.png and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-id-pages/static/limeClipper/photo.svg b/sport-erp-admin/uni_modules/uni-id-pages/static/limeClipper/photo.svg deleted file mode 100644 index 7b4b590..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/static/limeClipper/photo.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - diff --git a/sport-erp-admin/uni_modules/uni-id-pages/static/limeClipper/rotate.svg b/sport-erp-admin/uni_modules/uni-id-pages/static/limeClipper/rotate.svg deleted file mode 100644 index 0143706..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/static/limeClipper/rotate.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - diff --git a/sport-erp-admin/uni_modules/uni-id-pages/static/login/apple.png b/sport-erp-admin/uni_modules/uni-id-pages/static/login/apple.png deleted file mode 100644 index 04a3579..0000000 Binary files a/sport-erp-admin/uni_modules/uni-id-pages/static/login/apple.png and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-id-pages/static/login/uni-fab-login/sms.png b/sport-erp-admin/uni_modules/uni-id-pages/static/login/uni-fab-login/sms.png deleted file mode 100644 index 5533743..0000000 Binary files a/sport-erp-admin/uni_modules/uni-id-pages/static/login/uni-fab-login/sms.png and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-id-pages/static/login/uni-fab-login/user.png b/sport-erp-admin/uni_modules/uni-id-pages/static/login/uni-fab-login/user.png deleted file mode 100644 index 268420b..0000000 Binary files a/sport-erp-admin/uni_modules/uni-id-pages/static/login/uni-fab-login/user.png and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-id-pages/static/login/uni-fab-login/weixin.png b/sport-erp-admin/uni_modules/uni-id-pages/static/login/uni-fab-login/weixin.png deleted file mode 100644 index af7175b..0000000 Binary files a/sport-erp-admin/uni_modules/uni-id-pages/static/login/uni-fab-login/weixin.png and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-id-pages/static/login/weixin.png b/sport-erp-admin/uni_modules/uni-id-pages/static/login/weixin.png deleted file mode 100644 index df70aac..0000000 Binary files a/sport-erp-admin/uni_modules/uni-id-pages/static/login/weixin.png and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-id-pages/static/uni-center/defaultAvatarUrl.png b/sport-erp-admin/uni_modules/uni-id-pages/static/uni-center/defaultAvatarUrl.png deleted file mode 100644 index c3d3318..0000000 Binary files a/sport-erp-admin/uni_modules/uni-id-pages/static/uni-center/defaultAvatarUrl.png and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-id-pages/static/uni-center/grey.png b/sport-erp-admin/uni_modules/uni-id-pages/static/uni-center/grey.png deleted file mode 100644 index 2aae15a..0000000 Binary files a/sport-erp-admin/uni_modules/uni-id-pages/static/uni-center/grey.png and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-id-pages/static/uni-center/headers.png b/sport-erp-admin/uni_modules/uni-id-pages/static/uni-center/headers.png deleted file mode 100644 index 4233e82..0000000 Binary files a/sport-erp-admin/uni_modules/uni-id-pages/static/uni-center/headers.png and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/alipay.png b/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/alipay.png deleted file mode 100644 index adc0417..0000000 Binary files a/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/alipay.png and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/apple.png b/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/apple.png deleted file mode 100644 index 4f0840f..0000000 Binary files a/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/apple.png and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/douyin.png b/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/douyin.png deleted file mode 100644 index dc9f299..0000000 Binary files a/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/douyin.png and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/facebook.png b/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/facebook.png deleted file mode 100644 index ec418a5..0000000 Binary files a/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/facebook.png and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/google.png b/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/google.png deleted file mode 100644 index 2262f87..0000000 Binary files a/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/google.png and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/qq.png b/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/qq.png deleted file mode 100644 index 33c8505..0000000 Binary files a/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/qq.png and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/sinaweibo.png b/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/sinaweibo.png deleted file mode 100644 index 4424c7e..0000000 Binary files a/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/sinaweibo.png and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/sms.png b/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/sms.png deleted file mode 100644 index 4488c56..0000000 Binary files a/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/sms.png and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/taobao.png b/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/taobao.png deleted file mode 100644 index 8f09440..0000000 Binary files a/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/taobao.png and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/univerify.png b/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/univerify.png deleted file mode 100644 index 75778d3..0000000 Binary files a/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/univerify.png and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/user.png b/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/user.png deleted file mode 100644 index 5f330e7..0000000 Binary files a/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/user.png and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/weixin.png b/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/weixin.png deleted file mode 100644 index 26e85c1..0000000 Binary files a/sport-erp-admin/uni_modules/uni-id-pages/static/uni-fab-login/weixin.png and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/common/constants.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/common/constants.js deleted file mode 100644 index afce8b8..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/common/constants.js +++ /dev/null @@ -1,108 +0,0 @@ -const db = uniCloud.database() -const dbCmd = db.command -const userCollectionName = 'uni-id-users' -const userCollection = db.collection(userCollectionName) -const verifyCollectionName = 'opendb-verify-codes' -const verifyCollection = db.collection(verifyCollectionName) -const deviceCollectionName = 'uni-id-device' -const deviceCollection = db.collection(deviceCollectionName) -const openDataCollectionName = 'opendb-open-data' -const openDataCollection = db.collection(openDataCollectionName) -const frvLogsCollectionName = 'opendb-frv-logs' -const frvLogsCollection = db.collection(frvLogsCollectionName) - -const USER_IDENTIFIER = { - _id: 'uid', - username: 'username', - mobile: 'mobile', - email: 'email', - wx_unionid: 'wechat-account', - 'wx_openid.app': 'wechat-account', - 'wx_openid.mp': 'wechat-account', - 'wx_openid.h5': 'wechat-account', - 'wx_openid.web': 'wechat-account', - qq_unionid: 'qq-account', - 'qq_openid.app': 'qq-account', - 'qq_openid.mp': 'qq-account', - ali_openid: 'alipay-account', - apple_openid: 'alipay-account', - identities: 'idp' -} - -const USER_STATUS = { - NORMAL: 0, - BANNED: 1, - AUDITING: 2, - AUDIT_FAILED: 3, - CLOSED: 4 -} - -const CAPTCHA_SCENE = { - REGISTER: 'register', - LOGIN_BY_PWD: 'login-by-pwd', - LOGIN_BY_SMS: 'login-by-sms', - RESET_PWD_BY_SMS: 'reset-pwd-by-sms', - RESET_PWD_BY_EMAIL: 'reset-pwd-by-email', - SEND_SMS_CODE: 'send-sms-code', - SEND_EMAIL_CODE: 'send-email-code', - BIND_MOBILE_BY_SMS: 'bind-mobile-by-sms', - SET_PWD_BY_SMS: 'set-pwd-by-sms' -} - -const LOG_TYPE = { - LOGOUT: 'logout', - LOGIN: 'login', - REGISTER: 'register', - RESET_PWD_BY_SMS: 'reset-pwd', - RESET_PWD_BY_EMAIL: 'reset-pwd', - BIND_MOBILE: 'bind-mobile', - BIND_WEIXIN: 'bind-weixin', - BIND_QQ: 'bind-qq', - BIND_APPLE: 'bind-apple', - BIND_ALIPAY: 'bind-alipay', - UNBIND_WEIXIN: 'unbind-weixin', - UNBIND_QQ: 'unbind-qq', - UNBIND_ALIPAY: 'unbind-alipay', - UNBIND_APPLE: 'unbind-apple' -} - -const SMS_SCENE = { - LOGIN_BY_SMS: 'login-by-sms', - RESET_PWD_BY_SMS: 'reset-pwd-by-sms', - BIND_MOBILE_BY_SMS: 'bind-mobile-by-sms', - SET_PWD_BY_SMS: 'set-pwd-by-sms' -} - -const EMAIL_SCENE = { - REGISTER: 'register', - LOGIN_BY_EMAIL: 'login-by-email', - RESET_PWD_BY_EMAIL: 'reset-pwd-by-email', - BIND_EMAIL: 'bind-email' -} - -const REAL_NAME_STATUS = { - NOT_CERTIFIED: 0, - WAITING_CERTIFIED: 1, - CERTIFIED: 2, - CERTIFY_FAILED: 3 -} - -const EXTERNAL_DIRECT_CONNECT_PROVIDER = 'externalDirectConnect' - -module.exports = { - db, - dbCmd, - userCollection, - verifyCollection, - deviceCollection, - openDataCollection, - frvLogsCollection, - USER_IDENTIFIER, - USER_STATUS, - CAPTCHA_SCENE, - LOG_TYPE, - SMS_SCENE, - EMAIL_SCENE, - REAL_NAME_STATUS, - EXTERNAL_DIRECT_CONNECT_PROVIDER -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/common/error.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/common/error.js deleted file mode 100644 index 1e33845..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/common/error.js +++ /dev/null @@ -1,70 +0,0 @@ -const ERROR = { - ACCOUNT_EXISTS: 'uni-id-account-exists', - ACCOUNT_NOT_EXISTS: 'uni-id-account-not-exists', - ACCOUNT_NOT_EXISTS_IN_CURRENT_APP: 'uni-id-account-not-exists-in-current-app', - ACCOUNT_CONFLICT: 'uni-id-account-conflict', - ACCOUNT_BANNED: 'uni-id-account-banned', - ACCOUNT_AUDITING: 'uni-id-account-auditing', - ACCOUNT_AUDIT_FAILED: 'uni-id-account-audit-failed', - ACCOUNT_CLOSED: 'uni-id-account-closed', - CAPTCHA_REQUIRED: 'uni-id-captcha-required', - PASSWORD_ERROR: 'uni-id-password-error', - PASSWORD_ERROR_EXCEED_LIMIT: 'uni-id-password-error-exceed-limit', - INVALID_USERNAME: 'uni-id-invalid-username', - INVALID_PASSWORD: 'uni-id-invalid-password', - INVALID_PASSWORD_SUPER: 'uni-id-invalid-password-super', - INVALID_PASSWORD_STRONG: 'uni-id-invalid-password-strong', - INVALID_PASSWORD_MEDIUM: 'uni-id-invalid-password-medium', - INVALID_PASSWORD_WEAK: 'uni-id-invalid-password-weak', - INVALID_MOBILE: 'uni-id-invalid-mobile', - INVALID_EMAIL: 'uni-id-invalid-email', - INVALID_NICKNAME: 'uni-id-invalid-nickname', - INVALID_PARAM: 'uni-id-invalid-param', - PARAM_REQUIRED: 'uni-id-param-required', - GET_THIRD_PARTY_ACCOUNT_FAILED: 'uni-id-get-third-party-account-failed', - GET_THIRD_PARTY_USER_INFO_FAILED: 'uni-id-get-third-party-user-info-failed', - MOBILE_VERIFY_CODE_ERROR: 'uni-id-mobile-verify-code-error', - EMAIL_VERIFY_CODE_ERROR: 'uni-id-email-verify-code-error', - ADMIN_EXISTS: 'uni-id-admin-exists', - PERMISSION_ERROR: 'uni-id-permission-error', - SYSTEM_ERROR: 'uni-id-system-error', - SET_INVITE_CODE_FAILED: 'uni-id-set-invite-code-failed', - INVALID_INVITE_CODE: 'uni-id-invalid-invite-code', - CHANGE_INVITER_FORBIDDEN: 'uni-id-change-inviter-forbidden', - BIND_CONFLICT: 'uni-id-bind-conflict', - UNBIND_FAIL: 'uni-id-unbind-failed', - UNBIND_NOT_SUPPORTED: 'uni-id-unbind-not-supported', - UNBIND_UNIQUE_LOGIN: 'uni-id-unbind-unique-login', - UNBIND_PASSWORD_NOT_EXISTS: 'uni-id-unbind-password-not-exists', - UNBIND_MOBILE_NOT_EXISTS: 'uni-id-unbind-mobile-not-exists', - UNSUPPORTED_REQUEST: 'uni-id-unsupported-request', - ILLEGAL_REQUEST: 'uni-id-illegal-request', - CONFIG_FIELD_REQUIRED: 'uni-id-config-field-required', - CONFIG_FIELD_INVALID: 'uni-id-config-field-invalid', - FRV_FAIL: 'uni-id-frv-fail', - FRV_PROCESSING: 'uni-id-frv-processing', - REAL_NAME_VERIFIED: 'uni-id-realname-verified', - ID_CARD_EXISTS: 'uni-id-idcard-exists', - INVALID_ID_CARD: 'uni-id-invalid-idcard', - INVALID_REAL_NAME: 'uni-id-invalid-realname', - UNKNOWN_ERROR: 'uni-id-unknown-error', - REAL_NAME_VERIFY_UPPER_LIMIT: 'uni-id-realname-verify-upper-limit' -} - -function isUniIdError (errCode) { - return Object.values(ERROR).includes(errCode) -} - -class UniCloudError extends Error { - constructor (options) { - super(options.message) - this.errMsg = options.message || '' - this.errCode = options.code - } -} - -module.exports = { - ERROR, - isUniIdError, - UniCloudError -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/common/sensitive-aes-cipher.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/common/sensitive-aes-cipher.js deleted file mode 100644 index b2d6d95..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/common/sensitive-aes-cipher.js +++ /dev/null @@ -1,64 +0,0 @@ -const crypto = require('crypto') -const { ERROR } = require('./error') - -function checkSecret (secret) { - if (!secret) { - throw { - errCode: ERROR.CONFIG_FIELD_REQUIRED, - errMsgValue: { - field: 'sensitiveInfoEncryptSecret' - } - } - } - - if (secret.length !== 32) { - throw { - errCode: ERROR.CONFIG_FIELD_INVALID, - errMsgValue: { - field: 'sensitiveInfoEncryptSecret' - } - } - } -} -function encryptData (text = '') { - if (!text) return text - - const encryptSecret = this.config.sensitiveInfoEncryptSecret - - checkSecret(encryptSecret) - - const iv = encryptSecret.slice(-16) - - const cipher = crypto.createCipheriv('aes-256-cbc', encryptSecret, iv) - - const encrypted = Buffer.concat([ - cipher.update(Buffer.from(text, 'utf-8')), - cipher.final() - ]) - - return encrypted.toString('base64') -} - -function decryptData (text = '') { - if (!text) return text - - const encryptSecret = this.config.sensitiveInfoEncryptSecret - - checkSecret(encryptSecret) - - const iv = encryptSecret.slice(-16) - - const cipher = crypto.createDecipheriv('aes-256-cbc', encryptSecret, iv) - - const decrypted = Buffer.concat([ - cipher.update(Buffer.from(text, 'base64')), - cipher.final() - ]) - - return decrypted.toString('utf-8') -} - -module.exports = { - encryptData, - decryptData -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/common/universal.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/common/universal.js deleted file mode 100644 index 4bf46a0..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/common/universal.js +++ /dev/null @@ -1,47 +0,0 @@ -const { ERROR } = require('./error') - -function getHttpClientInfo () { - const requestId = this.getUniCloudRequestId() - const { clientIP, userAgent, source, secretType = 'none' } = this.getClientInfo() - const { clientInfo = {} } = JSON.parse(this.getHttpInfo().body) - - return { - ...clientInfo, - clientIP, - userAgent, - source, - secretType, - requestId - } -} - -function getHttpUniIdToken () { - const { uniIdToken = '' } = JSON.parse(this.getHttpInfo().body) - - return uniIdToken -} - -function verifyHttpMethod () { - const { headers, httpMethod } = this.getHttpInfo() - - if (!/^application\/json/.test(headers['content-type']) || httpMethod.toUpperCase() !== 'POST') { - throw { - errCode: ERROR.UNSUPPORTED_REQUEST, - errMsg: 'unsupported request' - } - } -} - -function universal () { - if (this.getClientInfo().source === 'http') { - verifyHttpMethod.call(this) - this.getParams()[0] = JSON.parse(this.getHttpInfo().body).params - this.getUniversalClientInfo = getHttpClientInfo.bind(this) - this.getUniversalUniIdToken = getHttpUniIdToken.bind(this) - } else { - this.getUniversalClientInfo = this.getClientInfo - this.getUniversalUniIdToken = this.getUniIdToken - } -} - -module.exports = universal diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/common/utils.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/common/utils.js deleted file mode 100644 index 6360d83..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/common/utils.js +++ /dev/null @@ -1,263 +0,0 @@ -function batchFindObjctValue (obj = {}, keys = []) { - const values = {} - for (let i = 0; i < keys.length; i++) { - const key = keys[i] - const keyPath = key.split('.') - let currentKey = keyPath.shift() - let result = obj - while (currentKey) { - if (!result) { - break - } - result = result[currentKey] - currentKey = keyPath.shift() - } - values[key] = result - } - return values -} - -function getType (val) { - return Object.prototype.toString.call(val).slice(8, -1).toLowerCase() -} - -function hasOwn (obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key) -} - -function isValidString (val) { - return val && getType(val) === 'string' -} - -function isPlainObject (obj) { - return getType(obj) === 'object' -} - -function isFn (fn) { - // 务必注意AsyncFunction - return typeof fn === 'function' -} - -// 获取文件后缀,只添加几种图片类型供客服消息接口使用 -const mime2ext = { - 'image/png': 'png', - 'image/jpeg': 'jpg', - 'image/gif': 'gif', - 'image/svg+xml': 'svg', - 'image/bmp': 'bmp', - 'image/webp': 'webp' -} - -function getExtension (contentType) { - return mime2ext[contentType] -} - -const isSnakeCase = /_(\w)/g -const isCamelCase = /[A-Z]/g - -function snake2camel (value) { - return value.replace(isSnakeCase, (_, c) => (c ? c.toUpperCase() : '')) -} - -function camel2snake (value) { - return value.replace(isCamelCase, str => '_' + str.toLowerCase()) -} - -function parseObjectKeys (obj, type) { - let parserReg, parser - switch (type) { - case 'snake2camel': - parser = snake2camel - parserReg = isSnakeCase - break - case 'camel2snake': - parser = camel2snake - parserReg = isCamelCase - break - } - for (const key in obj) { - if (hasOwn(obj, key)) { - if (parserReg.test(key)) { - const keyCopy = parser(key) - obj[keyCopy] = obj[key] - delete obj[key] - if (isPlainObject(obj[keyCopy])) { - obj[keyCopy] = parseObjectKeys(obj[keyCopy], type) - } else if (Array.isArray(obj[keyCopy])) { - obj[keyCopy] = obj[keyCopy].map((item) => { - return parseObjectKeys(item, type) - }) - } - } - } - } - return obj -} - -function snake2camelJson (obj) { - return parseObjectKeys(obj, 'snake2camel') -} - -function camel2snakeJson (obj) { - return parseObjectKeys(obj, 'camel2snake') -} - -function getOffsetDate (offset) { - return new Date( - Date.now() + (new Date().getTimezoneOffset() + (offset || 0) * 60) * 60000 - ) -} - -function getDateStr (date, separator = '-') { - date = date || new Date() - const dateArr = [] - dateArr.push(date.getFullYear()) - dateArr.push(('00' + (date.getMonth() + 1)).substr(-2)) - dateArr.push(('00' + date.getDate()).substr(-2)) - return dateArr.join(separator) -} - -function getTimeStr (date, separator = ':') { - date = date || new Date() - const timeArr = [] - timeArr.push(('00' + date.getHours()).substr(-2)) - timeArr.push(('00' + date.getMinutes()).substr(-2)) - timeArr.push(('00' + date.getSeconds()).substr(-2)) - return timeArr.join(separator) -} - -function getFullTimeStr (date) { - date = date || new Date() - return getDateStr(date) + ' ' + getTimeStr(date) -} - -function getDistinctArray (arr) { - return Array.from(new Set(arr)) -} - -/** - * 拼接url - * @param {string} base 基础路径 - * @param {string} path 在基础路径上拼接的路径 - * @returns - */ -function resolveUrl (base, path) { - if (/^https?:/.test(path)) { - return path - } - return base + path -} - -function getVerifyCode (len = 6) { - let code = '' - for (let i = 0; i < len; i++) { - code += Math.floor(Math.random() * 10) - } - return code -} - -function coverMobile (mobile) { - if (typeof mobile !== 'string') { - return mobile - } - return mobile.slice(0, 3) + '****' + mobile.slice(7) -} - -function getNonceStr (length = 16) { - let str = '' - while (str.length < length) { - str += Math.random().toString(32).substring(2) - } - return str.substring(0, length) -} - -function isMatchUserApp (userAppList, matchAppList) { - if (userAppList === undefined || userAppList === null) { - return true - } - if (getType(userAppList) !== 'array') { - return false - } - if (userAppList.includes('*')) { - return true - } - if (getType(matchAppList) === 'string') { - matchAppList = [matchAppList] - } - return userAppList.some(item => matchAppList.includes(item)) -} - -function checkIdCard (idCardNumber) { - if (!idCardNumber || typeof idCardNumber !== 'string' || idCardNumber.length !== 18) return false - - const coefficient = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2] - const checkCode = [1, 0, 'x', 9, 8, 7, 6, 5, 4, 3, 2] - const code = idCardNumber.substring(17) - - let sum = 0 - for (let i = 0; i < 17; i++) { - sum += Number(idCardNumber.charAt(i)) * coefficient[i] - } - - return checkCode[sum % 11].toString() === code.toLowerCase() -} - -function catchAwait (fn, finallyFn) { - if (!fn) return [new Error('no function')] - - if (Promise.prototype.finally === undefined) { - // eslint-disable-next-line no-extend-native - Promise.prototype.finally = function (finallyFn) { - return this.then( - res => Promise.resolve(finallyFn()).then(() => res), - error => Promise.resolve(finallyFn()).then(() => { throw error }) - ) - } - } - - return fn - .then((data) => [undefined, data]) - .catch((error) => [error]) - .finally(() => typeof finallyFn === 'function' && finallyFn()) -} - -function dataDesensitization (value = '', options = {}) { - const { onlyLast = false } = options - const [firstIndex, middleIndex, lastIndex] = onlyLast ? [0, 0, -1] : [0, 1, -1] - - if (!value) return value - const first = value.slice(firstIndex, middleIndex) - const middle = value.slice(middleIndex, lastIndex) - const last = value.slice(lastIndex) - const star = Array.from(new Array(middle.length), (v) => '*').join('') - - return first + star + last -} - -function getCurrentDateTimestamp (date = Date.now(), targetTimezone = 8) { - const oneHour = 60 * 60 * 1000 - return parseInt((date + targetTimezone * oneHour) / (24 * oneHour)) * (24 * oneHour) - targetTimezone * oneHour -} - -module.exports = { - getType, - isValidString, - batchFindObjctValue, - isPlainObject, - isFn, - getDistinctArray, - getFullTimeStr, - resolveUrl, - getOffsetDate, - camel2snakeJson, - snake2camelJson, - getExtension, - getVerifyCode, - coverMobile, - getNonceStr, - isMatchUserApp, - checkIdCard, - catchAwait, - dataDesensitization, - getCurrentDateTimestamp -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/common/validator.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/common/validator.js deleted file mode 100644 index 4b02104..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/common/validator.js +++ /dev/null @@ -1,443 +0,0 @@ -const { - isValidString, - getType -} = require('./utils.js') -const { - ERROR -} = require('./error') - -const baseValidator = Object.create(null) - -baseValidator.username = function (username) { - const errCode = ERROR.INVALID_USERNAME - if (!isValidString(username)) { - return { - errCode - } - } - if (/^\d+$/.test(username)) { - // 用户名不能为纯数字 - return { - errCode - } - }; - if (!/^[a-zA-Z0-9_-]+$/.test(username)) { - // 用户名仅能使用数字、字母、“_”及“-” - return { - errCode - } - } -} - -baseValidator.password = function (password) { - const errCode = ERROR.INVALID_PASSWORD - if (!isValidString(password)) { - return { - errCode - } - } - if (password.length < 6) { - // 密码长度不能小于6 - return { - errCode - } - } -} - -baseValidator.mobile = function (mobile) { - const errCode = ERROR.INVALID_MOBILE - if (getType(mobile) !== 'string') { - return { - errCode - } - } - if (mobile && !/^1\d{10}$/.test(mobile)) { - return { - errCode - } - } -} - -baseValidator.email = function (email) { - const errCode = ERROR.INVALID_EMAIL - if (getType(email) !== 'string') { - return { - errCode - } - } - if (email && !/@/.test(email)) { - return { - errCode - } - } -} - -baseValidator.nickname = function (nickname) { - const errCode = ERROR.INVALID_NICKNAME - if (nickname.indexOf('@') !== -1) { - // 昵称不允许含@ - return { - errCode - } - }; - if (/^\d+$/.test(nickname)) { - // 昵称不能为纯数字 - return { - errCode - } - }; - if (nickname.length > 100) { - // 昵称不可超过100字符 - return { - errCode - } - } -} - -const baseType = ['string', 'boolean', 'number', 'null'] // undefined不会由客户端提交上来 - -baseType.forEach((type) => { - baseValidator[type] = function (val) { - if (getType(val) === type) { - return - } - return { - errCode: ERROR.INVALID_PARAM - } - } -}) - -function tokenize(name) { - let i = 0 - const result = [] - let token = '' - while (i < name.length) { - const char = name[i] - switch (char) { - case '|': - case '<': - case '>': - token && result.push(token) - result.push(char) - token = '' - break - default: - token += char - break - } - i++ - if (i === name.length && token) { - result.push(token) - } - } - return result -} - -/** - * 处理validator名 - * @param {string} name - */ -function parseValidatorName(name) { - const tokenList = tokenize(name) - let i = 0 - let currentToken = tokenList[i] - const result = { - type: 'root', - children: [], - parent: null - } - let lastRealm = result - while (currentToken) { - switch (currentToken) { - case 'array': { - const currentRealm = { - type: 'array', - children: [], - parent: lastRealm - } - lastRealm.children.push(currentRealm) - lastRealm = currentRealm - break - } - case '<': - if (lastRealm.type !== 'array') { - throw new Error('Invalid validator token "<"') - } - break - case '>': - if (lastRealm.type !== 'array') { - throw new Error('Invalid validator token ">"') - } - lastRealm = lastRealm.parent - break - case '|': - if (lastRealm.type !== 'array' && lastRealm.type !== 'root') { - throw new Error('Invalid validator token "|"') - } - break - default: - lastRealm.children.push({ - type: currentToken - }) - break - } - i++ - currentToken = tokenList[i] - } - return result -} - -function getRuleCategory(rule) { - switch (rule.type) { - case 'array': - return 'array' - case 'root': - return 'root' - default: - return 'base' - } -} - - -// 特殊符号 https://www.ibm.com/support/pages/password-strength-rules ~!@#$%^&*_-+=`|\(){}[]:;"'<>,.?/ -// const specialChar = '~!@#$%^&*_-+=`|\(){}[]:;"\'<>,.?/' -// const specialCharRegExp = /^[~!@#$%^&*_\-+=`|\\(){}[\]:;"'<>,.?/]$/ -// for (let i = 0, arr = specialChar.split(''); i < arr.length; i++) { -// const char = arr[i] -// if (!specialCharRegExp.test(char)) { -// throw new Error('check special character error: ' + char) -// } -// } - -// 密码强度表达式 -const passwordRules = { - // 密码必须包含大小写字母、数字和特殊符号 - super: /^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[~!@#$%^&*_\-+=`|\\(){}[\]:;"'<>,.?/])[0-9a-zA-Z~!@#$%^&*_\-+=`|\\(){}[\]:;"'<>,.?/]{8,16}$/, - // 密码必须包含字母、数字和特殊符号 - strong: /^(?=.*[0-9])(?=.*[a-zA-Z])(?=.*[~!@#$%^&*_\-+=`|\\(){}[\]:;"'<>,.?/])[0-9a-zA-Z~!@#$%^&*_\-+=`|\\(){}[\]:;"'<>,.?/]{8,16}$/, - // 密码必须为字母、数字和特殊符号任意两种的组合 - medium: /^(?![0-9]+$)(?![a-zA-Z]+$)(?![~!@#$%^&*_\-+=`|\\(){}[\]:;"'<>,.?/]+$)[0-9a-zA-Z~!@#$%^&*_\-+=`|\\(){}[\]:;"'<>,.?/]{8,16}$/, - // 密码必须包含字母和数字 - weak: /^(?=.*[0-9])(?=.*[a-zA-Z])[0-9a-zA-Z~!@#$%^&*_\-+=`|\\(){}[\]:;"'<>,.?/]{6,16}$/, - -} - -function createPasswordVerifier({ - passwordStrength = '' -} = {}) { - return function (password) { - const passwordRegExp = passwordRules[passwordStrength] - if (!passwordRegExp) { - throw new Error('Invalid password strength config: ' + passwordStrength) - } - const errCode = ERROR.INVALID_PASSWORD - if (!isValidString(password)) { - return { - errCode - } - } - if (!passwordRegExp.test(password)) { - return { - errCode: errCode + '-' + passwordStrength - } - } - } -} - -function isEmpty(value) { - return value === undefined || - value === null || - (typeof value === 'string' && value.trim() === '') -} - -class Validator { - constructor({ - passwordStrength = '' - } = {}) { - this.baseValidator = baseValidator - this.customValidator = Object.create(null) - if (passwordStrength) { - this.mixin( - 'password', - createPasswordVerifier({ - passwordStrength - }) - ) - } - } - - mixin(type, handler) { - this.customValidator[type] = handler - } - - getRealBaseValidator(type) { - return this.customValidator[type] || this.baseValidator[type] - } - - - _isMatchUnionType(val, rule) { - if (!rule.children || rule.children.length === 0) { - return true - } - const children = rule.children - for (let i = 0; i < children.length; i++) { - const child = children[i] - const category = getRuleCategory(child) - let pass = false - switch (category) { - case 'base': - pass = this._isMatchBaseType(val, child) - break - case 'array': - pass = this._isMatchArrayType(val, child) - break - default: - break - } - if (pass) { - return true - } - } - return false - } - - _isMatchBaseType(val, rule) { - const method = this.getRealBaseValidator(rule.type) - if (typeof method !== 'function') { - throw new Error(`invalid schema type: ${rule.type}`) - } - const validateRes = method(val) - if (validateRes && validateRes.errCode) { - return false - } - return true - } - - _isMatchArrayType(arr, rule) { - if (getType(arr) !== 'array') { - return false - } - if (rule.children && rule.children.length && arr.some(item => !this._isMatchUnionType(item, rule))) { - return false - } - return true - } - - get validator() { - const _this = this - return new Proxy({}, { - get: (_, prop) => { - if (typeof prop !== 'string') { - return - } - const realBaseValidator = this.getRealBaseValidator(prop) - if (realBaseValidator) { - return realBaseValidator - } - const rule = parseValidatorName(prop) - return function (val) { - if (!_this._isMatchUnionType(val, rule)) { - return { - errCode: ERROR.INVALID_PARAM - } - } - } - } - }) - } - - validate(value = {}, schema = {}) { - for (const schemaKey in schema) { - let schemaValue = schema[schemaKey] - if (getType(schemaValue) === 'string') { - schemaValue = { - required: true, - type: schemaValue - } - } - const { - required, - type - } = schemaValue - // value内未传入了schemaKey或对应值为undefined - if (isEmpty(value[schemaKey])) { - if (required) { - return { - errCode: ERROR.PARAM_REQUIRED, - errMsgValue: { - param: schemaKey - }, - schemaKey - } - } else { - //delete value[schemaKey] - continue - } - } - const validateMethod = this.validator[type] - if (!validateMethod) { - throw new Error(`invalid schema type: ${type}`) - } - const validateRes = validateMethod(value[schemaKey]) - if (validateRes) { - validateRes.schemaKey = schemaKey - return validateRes - } - } - } -} - -function checkClientInfo(clientInfo) { - const stringNotRequired = { - required: false, - type: 'string' - } - const numberNotRequired = { - required: false, - type: 'number' - } - const numberOrStringNotRequired = { - required: false, - type: 'number|string' - } - const schema = { - uniPlatform: 'string', - appId: 'string', - deviceId: stringNotRequired, - osName: stringNotRequired, - locale: stringNotRequired, - clientIP: stringNotRequired, - appName: stringNotRequired, - appVersion: stringNotRequired, - appVersionCode: numberOrStringNotRequired, - channel: numberOrStringNotRequired, - userAgent: stringNotRequired, - uniIdToken: stringNotRequired, - deviceBrand: stringNotRequired, - deviceModel: stringNotRequired, - osVersion: stringNotRequired, - osLanguage: stringNotRequired, - osTheme: stringNotRequired, - romName: stringNotRequired, - romVersion: stringNotRequired, - devicePixelRatio: numberNotRequired, - windowWidth: numberNotRequired, - windowHeight: numberNotRequired, - screenWidth: numberNotRequired, - screenHeight: numberNotRequired - } - const validateRes = new Validator().validate(clientInfo, schema) - if (validateRes) { - if (validateRes.errCode === ERROR.PARAM_REQUIRED) { - console.warn('- 如果使用HBuilderX运行本地云函数/云对象功能时出现此提示,请改为使用客户端调用本地云函数方式调试,或更新HBuilderX到3.4.12及以上版本。\n- 如果是缺少clientInfo.appId,请检查项目manifest.json内是否配置了DCloud AppId') - throw new Error(`"clientInfo.${validateRes.schemaKey}" is required.`) - } else { - throw new Error(`Invalid client info: clienInfo.${validateRes.schemaKey}`) - } - } -} - -module.exports = { - Validator, - checkClientInfo -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/config/permission.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/config/permission.js deleted file mode 100644 index 229a264..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/config/permission.js +++ /dev/null @@ -1,90 +0,0 @@ -// 各接口权限配置,未配置接口表示允许任何用户访问(包括未登录用户) -module.exports = { - // 管理接口 - addUser: { - // auth: true // 已登录用户方可操作,配置角色或权限时此项可不写 - role: ['admin'] // 允许进行此操作的角色,包含任一角色均可操作。 - // permission: [] // 允许进行此操作的权限,包含任一权限均可操作。 - // 权限角色均配置时,用户拥有任一权限或任一角色均可操作 - }, - updateUser: { - role: ['admin'] - }, - authorizeAppLogin: { - role: ['admin'] - }, - removeAuthorizedApp: { - role: ['admin'] - }, - setAuthorizedApp: { - role: ['admin'] - }, - - // 用户接口 - closeAccount: { - auth: true - }, - updatePwd: { - auth: true - }, - logout: { - auth: true - }, - bindMobileBySms: { - auth: true - }, - bindMobileByUniverify: { - auth: true - }, - bindMobileByMpWeixin: { - auth: true - }, - bindAlipay: { - auth: true - }, - bindApple: { - auth: true - }, - bindQQ: { - auth: true - }, - bindWeixin: { - auth: true - }, - acceptInvite: { - auth: true - }, - getInvitedUser: { - auth: true - }, - setPushCid: { - auth: true - }, - getAccountInfo: { - auth: true - }, - unbindWeixin: { - auth: true - }, - unbindAlipay: { - auth: true - }, - unbindQQ: { - auth: true - }, - unbindApple: { - auth: true - }, - setPwd: { - auth: true - }, - getFrvCertifyId: { - auth: true - }, - getFrvAuthResult: { - auth: true - }, - getRealNameInfo: { - auth: true - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/index.obj.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/index.obj.js deleted file mode 100644 index 6f1a5f7..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/index.obj.js +++ /dev/null @@ -1,696 +0,0 @@ -const uniIdCommon = require('uni-id-common') -const uniCaptcha = require('uni-captcha') -const { - getType, - checkIdCard -} = require('./common/utils') -const { - checkClientInfo, - Validator -} = require('./common/validator') -const ConfigUtils = require('./lib/utils/config') -const { - isUniIdError, - ERROR -} = require('./common/error') -const middleware = require('./middleware/index') -const universal = require('./common/universal') - -const { - registerAdmin, - registerUser, - registerUserByEmail -} = require('./module/register/index') -const { - addUser, - updateUser -} = require('./module/admin/index') -const { - login, - loginBySms, - loginByUniverify, - loginByWeixin, - loginByAlipay, - loginByQQ, - loginByApple, - loginByWeixinMobile -} = require('./module/login/index') -const { - logout -} = require('./module/logout/index') -const { - bindMobileBySms, - bindMobileByUniverify, - bindMobileByMpWeixin, - bindAlipay, - bindApple, - bindQQ, - bindWeixin, - unbindWeixin, - unbindAlipay, - unbindQQ, - unbindApple -} = require('./module/relate/index') -const { - setPwd, - updatePwd, - resetPwdBySms, - resetPwdByEmail, - closeAccount, - getAccountInfo, - getRealNameInfo -} = require('./module/account/index') -const { - createCaptcha, - refreshCaptcha, - sendSmsCode, - sendEmailCode -} = require('./module/verify/index') -const { - refreshToken, - setPushCid, - secureNetworkHandshakeByWeixin -} = require('./module/utils/index') -const { - getInvitedUser, - acceptInvite -} = require('./module/fission') -const { - authorizeAppLogin, - removeAuthorizedApp, - setAuthorizedApp -} = require('./module/multi-end') -const { - getSupportedLoginType -} = require('./module/dev/index') -const { - externalRegister, - externalLogin, - updateUserInfoByExternal -} = require('./module/external') -const { - getFrvCertifyId, - getFrvAuthResult -} = require('./module/facial-recognition-verify') - -module.exports = { - async _before () { - // 支持 callFunction 与 URL化 - universal.call(this) - - const clientInfo = this.getUniversalClientInfo() - /** - * 检查clientInfo,无appId和uniPlatform时本云对象无法正常运行 - * 此外需要保证用到的clientInfo字段均经过类型检查 - * clientInfo由客户端上传并非完全可信,clientInfo内除clientIP、userAgent、source外均为客户端上传参数 - * 否则可能会出现一些意料外的情况 - */ - checkClientInfo(clientInfo) - let clientPlatform = clientInfo.uniPlatform - // 统一platform名称 - switch (clientPlatform) { - case 'app': - case 'app-plus': - case 'app-android': - case 'app-ios': - clientPlatform = 'app' - break - case 'web': - case 'h5': - clientPlatform = 'web' - break - default: - break - } - - this.clientPlatform = clientPlatform - - // 挂载uni-id实例到this上,方便后续调用 - this.uniIdCommon = uniIdCommon.createInstance({ - clientInfo - }) - - // 包含uni-id配置合并等功能的工具集 - this.configUtils = new ConfigUtils({ - context: this - }) - this.config = this.configUtils.getPlatformConfig() - this.hooks = this.configUtils.getHooks() - - this.validator = new Validator({ - passwordStrength: this.config.passwordStrength - }) - - // 扩展 validator 增加 验证身份证号码合法性 - this.validator.mixin('idCard', function (idCard) { - if (!checkIdCard(idCard)) { - return { - errCode: ERROR.INVALID_ID_CARD - } - } - }) - this.validator.mixin('realName', function (realName) { - if ( - typeof realName !== 'string' || - realName.length < 2 || - !/^[\u4e00-\u9fa5]{1,10}(·?[\u4e00-\u9fa5]{1,10}){0,5}$/.test(realName) - ) { - return { - errCode: ERROR.INVALID_REAL_NAME - } - } - }) - /** - * 示例:覆盖密码验证规则 - */ - // this.validator.mixin('password', function (password) { - // if (typeof password !== 'string' || password.length < 10) { - // // 调整为密码长度不能小于10 - // return { - // errCode: ERROR.INVALID_PASSWORD - // } - // } - // }) - /** - * 示例:新增验证规则 - */ - // this.validator.mixin('timestamp', function (timestamp) { - // if (typeof timestamp !== 'number' || timestamp > Date.now()) { - // return { - // errCode: ERROR.INVALID_PARAM - // } - // } - // }) - // // 新增规则同样可以在数组验证规则中使用 - // this.validator.validate({ - // timestamp: 123456789 - // }, { - // timestamp: 'timestamp' - // }) - // this.validator.validate({ - // timestampList: [123456789, 123123123123] - // }, { - // timestampList: 'array' - // }) - // // 甚至更复杂的写法 - // this.validator.validate({ - // timestamp: [123456789123123123, 123123123123] - // }, { - // timestamp: 'timestamp|array' - // }) - - // 挂载uni-captcha到this上,方便后续调用 - this.uniCaptcha = uniCaptcha - Object.defineProperty(this, 'uniOpenBridge', { - get () { - return require('uni-open-bridge-common') - } - }) - - // 挂载中间件 - this.middleware = {} - for (const mwName in middleware) { - this.middleware[mwName] = middleware[mwName].bind(this) - } - - // 国际化 - const messages = require('./lang/index') - const fallbackLocale = 'zh-Hans' - const i18n = uniCloud.initI18n({ - locale: clientInfo.locale, - fallbackLocale, - messages: JSON.parse(JSON.stringify(messages)) - }) - if (!messages[i18n.locale]) { - i18n.setLocale(fallbackLocale) - } - this.t = i18n.t.bind(i18n) - - this.response = {} - - // 请求鉴权验证 - await this.middleware.verifyRequestSign() - - // 通用权限校验模块 - await this.middleware.accessControl() - }, - _after (error, result) { - if (error) { - // 处理中间件内抛出的标准响应对象 - if (error.errCode && getType(error) === 'object') { - const errCode = error.errCode - if (!isUniIdError(errCode)) { - return error - } - return { - errCode, - errMsg: error.errMsg || this.t(errCode, error.errMsgValue) - } - } - throw error - } - return Object.assign(this.response, result) - }, - /** - * 注册管理员 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#register-admin - * @param {Object} params - * @param {String} params.username 用户名 - * @param {String} params.password 密码 - * @param {String} params.nickname 昵称 - * @returns - */ - registerAdmin, - /** - * 新增用户 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#add-user - * @param {Object} params - * @param {String} params.username 用户名 - * @param {String} params.password 密码 - * @param {String} params.nickname 昵称 - * @param {Array} params.authorizedApp 允许登录的AppID列表 - * @param {Array} params.role 用户角色列表 - * @param {String} params.mobile 手机号 - * @param {String} params.email 邮箱 - * @param {Array} params.tags 用户标签 - * @param {Number} params.status 用户状态 - * @returns - */ - addUser, - /** - * 修改用户 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#update-user - * @param {Object} params - * @param {String} params.id 要更新的用户id - * @param {String} params.username 用户名 - * @param {String} params.password 密码 - * @param {String} params.nickname 昵称 - * @param {Array} params.authorizedApp 允许登录的AppID列表 - * @param {Array} params.role 用户角色列表 - * @param {String} params.mobile 手机号 - * @param {String} params.email 邮箱 - * @param {Array} params.tags 用户标签 - * @param {Number} params.status 用户状态 - * @returns - */ - updateUser, - /** - * 授权用户登录应用 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#authorize-app-login - * @param {Object} params - * @param {String} params.uid 用户id - * @param {String} params.appId 授权的应用的AppId - * @returns - */ - authorizeAppLogin, - /** - * 移除用户登录授权 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#remove-authorized-app - * @param {Object} params - * @param {String} params.uid 用户id - * @param {String} params.appId 取消授权的应用的AppId - * @returns - */ - removeAuthorizedApp, - /** - * 设置用户允许登录的应用列表 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#set-authorized-app - * @param {Object} params - * @param {String} params.uid 用户id - * @param {Array} params.appIdList 允许登录的应用AppId列表 - * @returns - */ - setAuthorizedApp, - /** - * 注册普通用户 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#register-user - * @param {Object} params - * @param {String} params.username 用户名 - * @param {String} params.password 密码 - * @param {String} params.captcha 图形验证码 - * @param {String} params.nickname 昵称 - * @param {String} params.inviteCode 邀请码 - * @returns - */ - registerUser, - /** - * 通过邮箱+验证码注册用户 - * @param {Object} params - * @param {String} params.email 邮箱 - * @param {String} params.password 密码 - * @param {String} params.nickname 昵称 - * @param {String} params.code 邮箱验证码 - * @param {String} params.inviteCode 邀请码 - * @returns - */ - registerUserByEmail, - /** - * 用户名密码登录 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#login - * @param {Object} params - * @param {String} params.username 用户名 - * @param {String} params.mobile 手机号 - * @param {String} params.email 邮箱 - * @param {String} params.password 密码 - * @param {String} params.captcha 图形验证码 - * @returns - */ - login, - /** - * 短信验证码登录 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#login-by-sms - * @param {Object} params - * @param {String} params.mobile 手机号 - * @param {String} params.code 短信验证码 - * @param {String} params.captcha 图形验证码 - * @param {String} params.inviteCode 邀请码 - * @returns - */ - loginBySms, - /** - * App端一键登录 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#login-by-univerify - * @param {Object} params - * @param {String} params.access_token APP端一键登录返回的access_token - * @param {String} params.openid APP端一键登录返回的openid - * @param {String} params.inviteCode 邀请码 - * @returns - */ - loginByUniverify, - /** - * 微信登录 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#login-by-weixin - * @param {Object} params - * @param {String} params.code 微信登录返回的code - * @param {String} params.inviteCode 邀请码 - * @returns - */ - loginByWeixin, - /** - * 支付宝登录 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#login-by-alipay - * @param {Object} params - * @param {String} params.code 支付宝小程序客户端登录返回的code - * @param {String} params.inviteCode 邀请码 - * @returns - */ - loginByAlipay, - /** - * QQ登录 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#login-by-qq - * @param {Object} params - * @param {String} params.code QQ小程序登录返回的code参数 - * @param {String} params.accessToken App端QQ登录返回的accessToken参数 - * @param {String} params.accessTokenExpired accessToken过期时间,由App端QQ登录返回的expires_in参数计算而来,单位:毫秒 - * @param {String} params.inviteCode 邀请码 - * @returns - */ - loginByQQ, - /** - * 苹果登录 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#login-by-apple - * @param {Object} params - * @param {String} params.identityToken 苹果登录返回的identityToken - * @param {String} params.nickname 用户昵称 - * @param {String} params.inviteCode 邀请码 - * @returns - */ - loginByApple, - loginByWeixinMobile, - /** - * 用户退出登录 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#logout - * @returns - */ - logout, - /** - * 通过短信验证码绑定手机号 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#bind-mobile-by-sms - * @param {Object} params - * @param {String} params.mobile 手机号 - * @param {String} params.code 短信验证码 - * @param {String} params.captcha 图形验证码 - * @returns - */ - bindMobileBySms, - /** - * 通过一键登录绑定手机号 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#bind-mobile-by-univerify - * @param {Object} params - * @param {String} params.openid APP端一键登录返回的openid - * @param {String} params.access_token APP端一键登录返回的access_token - * @returns - */ - bindMobileByUniverify, - /** - * 通过微信绑定手机号 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#bind-mobile-by-mp-weixin - * @param {Object} params - * @param {String} params.encryptedData 微信获取手机号返回的加密信息 - * @param {String} params.iv 微信获取手机号返回的初始向量 - * @returns - */ - bindMobileByMpWeixin, - /** - * 绑定微信 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#bind-weixin - * @param {Object} params - * @param {String} params.code 微信登录返回的code - * @returns - */ - bindWeixin, - /** - * 绑定QQ - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#bind-qq - * @param {Object} params - * @param {String} params.code 小程序端QQ登录返回的code - * @param {String} params.accessToken APP端QQ登录返回的accessToken - * @param {String} params.accessTokenExpired accessToken过期时间,由App端QQ登录返回的expires_in参数计算而来,单位:毫秒 - * @returns - */ - bindQQ, - /** - * 绑定支付宝账号 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#bind-alipay - * @param {Object} params - * @param {String} params.code 支付宝小程序登录返回的code参数 - * @returns - */ - bindAlipay, - /** - * 绑定苹果账号 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#bind-apple - * @param {Object} params - * @param {String} params.identityToken 苹果登录返回identityToken - * @returns - */ - bindApple, - /** - * 更新密码 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#update-pwd - * @param {object} params - * @param {string} params.oldPassword 旧密码 - * @param {string} params.newPassword 新密码 - * @returns {object} - */ - updatePwd, - /** - * 通过短信验证码重置密码 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#reset-pwd-by-sms - * @param {object} params - * @param {string} params.mobile 手机号 - * @param {string} params.mobile 短信验证码 - * @param {string} params.password 密码 - * @param {string} params.captcha 图形验证码 - * @returns {object} - */ - resetPwdBySms, - /** - * 通过邮箱验证码重置密码 - * @param {object} params - * @param {string} params.email 邮箱 - * @param {string} params.code 邮箱验证码 - * @param {string} params.password 密码 - * @param {string} params.captcha 图形验证码 - * @returns {object} - */ - resetPwdByEmail, - /** - * 注销账户 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#close-account - * @returns - */ - closeAccount, - /** - * 获取账户账户简略信息 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#get-account-info - */ - getAccountInfo, - /** - * 创建图形验证码 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#create-captcha - * @param {Object} params - * @param {String} params.scene 图形验证码使用场景 - * @returns - */ - createCaptcha, - /** - * 刷新图形验证码 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#refresh-captcha - * @param {Object} params - * @param {String} params.scene 图形验证码使用场景 - * @returns - */ - refreshCaptcha, - /** - * 发送短信验证码 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#send-sms-code - * @param {Object} params - * @param {String} params.mobile 手机号 - * @param {String} params.captcha 图形验证码 - * @param {String} params.scene 短信验证码使用场景 - * @returns - */ - sendSmsCode, - /** - * 发送邮箱验证码 - * @tutorial 需自行实现功能 - * @param {Object} params - * @param {String} params.email 邮箱 - * @param {String} params.captcha 图形验证码 - * @param {String} params.scene 短信验证码使用场景 - * @returns - */ - sendEmailCode, - /** - * 刷新token - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#refresh-token - */ - refreshToken, - /** - * 接受邀请 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#accept-invite - * @param {Object} params - * @param {String} params.inviteCode 邀请码 - * @returns - */ - acceptInvite, - /** - * 获取受邀用户 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#get-invited-user - * @param {Object} params - * @param {Number} params.level 获取受邀用户的级数,1表示直接邀请的用户 - * @param {Number} params.limit 返回数据大小 - * @param {Number} params.offset 返回数据偏移 - * @param {Boolean} params.needTotal 是否需要返回总数 - * @returns - */ - getInvitedUser, - /** - * 更新device表的push_clien_id - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#set-push-cid - * @param {object} params - * @param {string} params.pushClientId 客户端pushClientId - * @returns - */ - setPushCid, - /** - * 获取支持的登录方式 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#get-supported-login-type - * @returns - */ - getSupportedLoginType, - - /** - * 解绑微信 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#unbind-weixin - * @returns - */ - unbindWeixin, - /** - * 解绑支付宝 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#unbind-alipay - * @returns - */ - unbindAlipay, - /** - * 解绑QQ - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#unbind-qq - * @returns - */ - unbindQQ, - /** - * 解绑Apple - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#unbind-apple - * @returns - */ - unbindApple, - /** - * 安全网络握手,目前仅处理微信小程序安全网络握手 - */ - secureNetworkHandshakeByWeixin, - /** - * 设置密码 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#set-pwd - * @returns - */ - setPwd, - /** - * 外部注册用户 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#external-register - * @param {object} params - * @param {string} params.externalUid 业务系统的用户id - * @param {string} params.nickname 昵称 - * @param {string} params.gender 性别 - * @param {string} params.avatar 头像 - * @returns {object} - */ - externalRegister, - /** - * 外部用户登录 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#external-login - * @param {object} params - * @param {string} params.userId uni-id体系用户id - * @param {string} params.externalUid 业务系统的用户id - * @returns {object} - */ - externalLogin, - /** - * 使用 userId 或 externalUid 获取用户信息 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#external-update-userinfo - * @param {object} params - * @param {string} params.userId uni-id体系的用户id - * @param {string} params.externalUid 业务系统的用户id - * @param {string} params.nickname 昵称 - * @param {string} params.gender 性别 - * @param {string} params.avatar 头像 - * @returns {object} - */ - updateUserInfoByExternal, - /** - * 获取认证ID - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#get-frv-certify-id - * @param {Object} params - * @param {String} params.realName 真实姓名 - * @param {String} params.idCard 身份证号码 - * @returns - */ - getFrvCertifyId, - /** - * 查询认证结果 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#get-frv-auth-result - * @param {Object} params - * @param {String} params.certifyId 认证ID - * @param {String} params.needAlivePhoto 是否获取认证照片,Y_O (原始图片)、Y_M(虚化,背景马赛克)、N(不返图) - * @returns - */ - getFrvAuthResult, - /** - * 获取实名信息 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#get-realname-info - * @param {Object} params - * @param {Boolean} params.decryptData 是否解密数据 - * @returns - */ - getRealNameInfo -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lang/en.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lang/en.js deleted file mode 100644 index 6825461..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lang/en.js +++ /dev/null @@ -1,62 +0,0 @@ -const word = { - login: 'login', - 'verify-mobile': 'verify phone number' -} - -const sentence = { - 'uni-id-account-exists': 'Account exists', - 'uni-id-account-not-exists': 'Account does not exists', - 'uni-id-account-not-exists-in-current-app': 'Account does not exists in current app', - 'uni-id-account-conflict': 'User account conflict', - 'uni-id-account-banned': 'Account has been banned', - 'uni-id-account-auditing': 'Account audit in progress', - 'uni-id-account-audit-failed': 'Account audit failed', - 'uni-id-account-closed': 'Account has been closed', - 'uni-id-captcha-required': 'Captcha required', - 'uni-id-password-error': 'Password error', - 'uni-id-password-error-exceed-limit': 'The number of password errors is excessive', - 'uni-id-invalid-username': 'Invalid username', - 'uni-id-invalid-password': 'invalid password', - 'uni-id-invalid-password-super': 'Passwords must have 8-16 characters and contain uppercase letters, lowercase letters, numbers, and symbols.', - 'uni-id-invalid-password-strong': 'Passwords must have 8-16 characters and contain letters, numbers and symbols.', - 'uni-id-invalid-password-medium': 'Passwords must have 8-16 characters and contain at least two of the following: letters, numbers, and symbols.', - 'uni-id-invalid-password-weak': 'Passwords must have 6-16 characters and contain letters and numbers.', - 'uni-id-invalid-mobile': 'Invalid mobile phone number', - 'uni-id-invalid-email': 'Invalid email address', - 'uni-id-invalid-nickname': 'Invalid nickname', - 'uni-id-invalid-param': 'Invalid parameter', - 'uni-id-param-required': 'Parameter required: {param}', - 'uni-id-get-third-party-account-failed': 'Get third party account failed', - 'uni-id-get-third-party-user-info-failed': 'Get third party user info failed', - 'uni-id-mobile-verify-code-error': 'Verify code error or expired', - 'uni-id-email-verify-code-error': 'Verify code error or expired', - 'uni-id-admin-exists': 'Administrator exists', - 'uni-id-permission-error': 'Permission denied', - 'uni-id-system-error': 'System error', - 'uni-id-set-invite-code-failed': 'Set invite code failed', - 'uni-id-invalid-invite-code': 'Invalid invite code', - 'uni-id-change-inviter-forbidden': 'Change inviter is not allowed', - 'uni-id-bind-conflict': 'This account has been bound', - 'uni-id-admin-exist-in-other-apps': 'Administrator is registered in other consoles', - 'uni-id-unbind-failed': 'Please bind first and then unbind', - 'uni-id-unbind-not-supported': 'Unbinding is not supported', - 'uni-id-unbind-mobile-not-exists': 'This is the only way to login at the moment, please bind your phone number and then try to unbind', - 'uni-id-unbind-password-not-exists': 'Please set a password first', - 'uni-id-unsupported-request': 'Unsupported request', - 'uni-id-illegal-request': 'Illegal request', - 'uni-id-config-field-required': 'Config field required: {field}', - 'uni-id-config-field-invalid': 'Config field: {field} is invalid', - 'uni-id-frv-fail': 'Real name certify failed', - 'uni-id-frv-processing': 'Waiting for face recognition', - 'uni-id-realname-verified': 'This account has been verified', - 'uni-id-idcard-exists': 'The ID number has been bound to the account', - 'uni-id-invalid-idcard': 'ID number is invalid', - 'uni-id-invalid-realname': 'The name can only be Chinese characters', - 'uni-id-unknown-error': 'unknown error', - 'uni-id-realname-verify-upper-limit': 'The number of real-name certify on the day has reached the upper limit' -} - -module.exports = { - ...word, - ...sentence -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lang/index.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lang/index.js deleted file mode 100644 index 1f22998..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lang/index.js +++ /dev/null @@ -1,22 +0,0 @@ -let lang = { - 'zh-Hans': require('./zh-hans'), - en: require('./en') -} - -function mergeLanguage (lang1, lang2) { - const localeList = Object.keys(lang1) - localeList.push(...Object.keys(lang2)) - const result = {} - for (let i = 0; i < localeList.length; i++) { - const locale = localeList[i] - result[locale] = Object.assign({}, lang1[locale], lang2[locale]) - } - return result -} - -try { - const langPath = require.resolve('uni-config-center/uni-id/lang/index.js') - lang = mergeLanguage(lang, require(langPath)) -} catch (error) { } - -module.exports = lang diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lang/zh-hans.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lang/zh-hans.js deleted file mode 100644 index 911ce20..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lang/zh-hans.js +++ /dev/null @@ -1,64 +0,0 @@ -const word = { - login: '登录', - 'verify-mobile': '验证手机号' -} - -const sentence = { - 'uni-id-token-expired': '登录状态失效,token已过期', - 'uni-id-check-token-failed': 'token校验未通过', - 'uni-id-account-exists': '此账号已注册', - 'uni-id-account-not-exists': '此账号未注册', - 'uni-id-account-not-exists-in-current-app': '此账号未在该应用注册', - 'uni-id-account-conflict': '用户账号冲突', - 'uni-id-account-banned': '此账号已封禁', - 'uni-id-account-auditing': '此账号正在审核中', - 'uni-id-account-audit-failed': '此账号审核失败', - 'uni-id-account-closed': '此账号已注销', - 'uni-id-captcha-required': '请输入图形验证码', - 'uni-id-password-error': '密码错误', - 'uni-id-password-error-exceed-limit': '密码错误次数过多,请稍后再试', - 'uni-id-invalid-username': '用户名不合法', - 'uni-id-invalid-password': '密码不合法', - 'uni-id-invalid-password-super': '密码必须包含大小写字母、数字和特殊符号,长度8-16位', - 'uni-id-invalid-password-strong': '密码必须包含字母、数字和特殊符号,长度8-16位不合法', - 'uni-id-invalid-password-medium': '密码必须为字母、数字和特殊符号任意两种的组合,长度8-16位', - 'uni-id-invalid-password-weak': '密码必须包含字母和数字,长度6-16位', - 'uni-id-invalid-mobile': '手机号码不合法', - 'uni-id-invalid-email': '邮箱不合法', - 'uni-id-invalid-nickname': '昵称不合法', - 'uni-id-invalid-param': '参数错误', - 'uni-id-param-required': '缺少参数: {param}', - 'uni-id-get-third-party-account-failed': '获取第三方账号失败', - 'uni-id-get-third-party-user-info-failed': '获取用户信息失败', - 'uni-id-mobile-verify-code-error': '手机验证码错误或已过期', - 'uni-id-email-verify-code-error': '邮箱验证码错误或已过期', - 'uni-id-admin-exists': '超级管理员已存在', - 'uni-id-permission-error': '权限错误', - 'uni-id-system-error': '系统错误', - 'uni-id-set-invite-code-failed': '设置邀请码失败', - 'uni-id-invalid-invite-code': '邀请码不可用', - 'uni-id-change-inviter-forbidden': '禁止修改邀请人', - 'uni-id-bind-conflict': '此账号已被绑定', - 'uni-id-admin-exist-in-other-apps': '超级管理员已在其他控制台注册', - 'uni-id-unbind-failed': '请先绑定后再解绑', - 'uni-id-unbind-not-supported': '不支持解绑', - 'uni-id-unbind-mobile-not-exists': '这是当前唯一登录方式,请绑定手机号后再尝试解绑', - 'uni-id-unbind-password-not-exists': '请先设置密码在尝试解绑', - 'uni-id-unsupported-request': '不支持的请求方式', - 'uni-id-illegal-request': '非法请求', - 'uni-id-frv-fail': '实名认证失败', - 'uni-id-frv-processing': '等待人脸识别', - 'uni-id-realname-verified': '该账号已实名认证', - 'uni-id-idcard-exists': '该证件号码已绑定账号', - 'uni-id-invalid-idcard': '身份证号码不合法', - 'uni-id-invalid-realname': '姓名只能是汉字', - 'uni-id-unknown-error': '未知错误', - 'uni-id-realname-verify-upper-limit': '当日实名认证次数已达上限', - 'uni-id-config-field-required': '缺少配置项: {field}', - 'uni-id-config-field-invalid': '配置项: {field}无效' -} - -module.exports = { - ...word, - ...sentence -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/README.md b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/README.md deleted file mode 100644 index 47d8c4c..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# 说明 - -此目录内为uni-id-co基础能力,不建议直接修改。如果你发现有些逻辑加入会更好,或者此部分代码有Bug可以向我们提交PR,仓库地址:[]()。如果有特殊的需求也可以在[论坛](https://ask.dcloud.net.cn/)提出,我们可以讨论下如何实现。 \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/npm/index.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/npm/index.js deleted file mode 100644 index 0edfaf4..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/npm/index.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict";var e=require("buffer"),r=require("stream"),t=require("util"),n=require("crypto"),o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var a={},s={exports:{}}; -/*! safe-buffer. MIT License. Feross Aboukhadijeh */ -!function(r,t){var n=e,o=n.Buffer;function i(e,r){for(var t in e)r[t]=e[t]}function a(e,r,t){return o(e,r,t)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?r.exports=n:(i(n,t),t.Buffer=a),a.prototype=Object.create(o.prototype),i(o,a),a.from=function(e,r,t){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,r,t)},a.alloc=function(e,r,t){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=o(e);return void 0!==r?"string"==typeof t?n.fill(r,t):n.fill(r):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}}(s,s.exports);var u=s.exports,c=u.Buffer,f=r;function l(e){if(this.buffer=null,this.writable=!0,this.readable=!0,!e)return this.buffer=c.alloc(0),this;if("function"==typeof e.pipe)return this.buffer=c.alloc(0),e.pipe(this),this;if(e.length||"object"==typeof e)return this.buffer=e,this.writable=!1,process.nextTick(function(){this.emit("end",e),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof e+")")}t.inherits(l,f),l.prototype.write=function(e){this.buffer=c.concat([this.buffer,c.from(e)]),this.emit("data",e)},l.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1};var p=l,h=e.Buffer,v=e.SlowBuffer,d=y;function y(e,r){if(!h.isBuffer(e)||!h.isBuffer(r))return!1;if(e.length!==r.length)return!1;for(var t=0,n=0;n=E&&--n,n}var A={derToJose:function(e,r){e=x(e);var t=_(r),n=t+1,o=e.length,i=0;if(48!==e[i++])throw new Error('Could not find expected "seq"');var a=e[i++];if(a===(1|E)&&(a=e[i++]),o-i=1.5*t;return Math.round(e/t)+" "+n+(o?"s":"")}var Le=function(e,r){r=r||{};var t=typeof e;if("string"===t&&e.length>0)return function(e){if((e=String(e)).length>100)return;var r=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!r)return;var t=parseFloat(r[1]);switch((r[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return t*He;case"weeks":case"week":case"w":return t*Ce;case"days":case"day":case"d":return t*qe;case"hours":case"hour":case"hrs":case"hr":case"h":return t*De;case"minutes":case"minute":case"mins":case"min":case"m":return t*ze;case"seconds":case"second":case"secs":case"sec":case"s":return t*Me;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}(e);if("number"===t&&isFinite(e))return r.long?function(e){var r=Math.abs(e);if(r>=qe)return Ue(e,r,qe,"day");if(r>=De)return Ue(e,r,De,"hour");if(r>=ze)return Ue(e,r,ze,"minute");if(r>=Me)return Ue(e,r,Me,"second");return e+" ms"}(e):function(e){var r=Math.abs(e);if(r>=qe)return Math.round(e/qe)+"d";if(r>=De)return Math.round(e/De)+"h";if(r>=ze)return Math.round(e/ze)+"m";if(r>=Me)return Math.round(e/Me)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))},Ge=function(e,r){var t=r||Math.floor(Date.now()/1e3);if("string"==typeof e){var n=Le(e);if(void 0===n)return;return Math.floor(t+n/1e3)}return"number"==typeof e?t+e:void 0},Ke={exports:{}};!function(e,r){var t;r=Ke.exports=Y,t="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},r.SEMVER_SPEC_VERSION="2.0.0";var n=256,o=Number.MAX_SAFE_INTEGER||9007199254740991,i=n-6,a=r.re=[],s=r.safeRe=[],u=r.src=[],c=0,f="[a-zA-Z0-9-]",l=[["\\s",1],["\\d",n],[f,i]];function p(e){for(var r=0;r)?=?)";var k=c++;u[k]=u[v]+"|x|X|\\*";var P=c++;u[P]=u[h]+"|x|X|\\*";var R=c++;u[R]="[v=\\s]*("+u[P]+")(?:\\.("+u[P]+")(?:\\.("+u[P]+")(?:"+u[w]+")?"+u[_]+"?)?)?";var B=c++;u[B]="[v=\\s]*("+u[k]+")(?:\\.("+u[k]+")(?:\\.("+u[k]+")(?:"+u[j]+")?"+u[_]+"?)?)?";var $=c++;u[$]="^"+u[T]+"\\s*"+u[R]+"$";var I=c++;u[I]="^"+u[T]+"\\s*"+u[B]+"$";var V=c++;u[V]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var N=c++;u[N]="(?:~>?)";var M=c++;u[M]="(\\s*)"+u[N]+"\\s+",a[M]=new RegExp(u[M],"g"),s[M]=new RegExp(p(u[M]),"g");var z=c++;u[z]="^"+u[N]+u[R]+"$";var D=c++;u[D]="^"+u[N]+u[B]+"$";var q=c++;u[q]="(?:\\^)";var C=c++;u[C]="(\\s*)"+u[q]+"\\s+",a[C]=new RegExp(u[C],"g"),s[C]=new RegExp(p(u[C]),"g");var H=c++;u[H]="^"+u[q]+u[R]+"$";var U=c++;u[U]="^"+u[q]+u[B]+"$";var L=c++;u[L]="^"+u[T]+"\\s*("+O+")$|^$";var G=c++;u[G]="^"+u[T]+"\\s*("+x+")$|^$";var K=c++;u[K]="(\\s*)"+u[T]+"\\s*("+O+"|"+u[R]+")",a[K]=new RegExp(u[K],"g"),s[K]=new RegExp(p(u[K]),"g");var F=c++;u[F]="^\\s*("+u[R]+")\\s+-\\s+("+u[R]+")\\s*$";var J=c++;u[J]="^\\s*("+u[B]+")\\s+-\\s+("+u[B]+")\\s*$";var W=c++;u[W]="(<|>)?=?\\s*\\*";for(var Z=0;Z<35;Z++)t(Z,u[Z]),a[Z]||(a[Z]=new RegExp(u[Z]),s[Z]=new RegExp(p(u[Z])));function X(e,r){if(r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),e instanceof Y)return e;if("string"!=typeof e)return null;if(e.length>n)return null;if(!(r.loose?s[A]:s[E]).test(e))return null;try{return new Y(e,r)}catch(e){return null}}function Y(e,r){if(r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),e instanceof Y){if(e.loose===r.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>n)throw new TypeError("version is longer than "+n+" characters");if(!(this instanceof Y))return new Y(e,r);t("SemVer",e,r),this.options=r,this.loose=!!r.loose;var i=e.trim().match(r.loose?s[A]:s[E]);if(!i)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var r=+e;if(r>=0&&r=0;)"number"==typeof this.prerelease[t]&&(this.prerelease[t]++,t=-2);-1===t&&this.prerelease.push(0)}r&&(this.prerelease[0]===r?isNaN(this.prerelease[1])&&(this.prerelease=[r,0]):this.prerelease=[r,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},r.inc=function(e,r,t,n){"string"==typeof t&&(n=t,t=void 0);try{return new Y(e,t).inc(r,n).version}catch(e){return null}},r.diff=function(e,r){if(oe(e,r))return null;var t=X(e),n=X(r),o="";if(t.prerelease.length||n.prerelease.length){o="pre";var i="prerelease"}for(var a in t)if(("major"===a||"minor"===a||"patch"===a)&&t[a]!==n[a])return o+a;return i},r.compareIdentifiers=ee;var Q=/^[0-9]+$/;function ee(e,r){var t=Q.test(e),n=Q.test(r);return t&&n&&(e=+e,r=+r),e===r?0:t&&!n?-1:n&&!t?1:e0}function ne(e,r,t){return re(e,r,t)<0}function oe(e,r,t){return 0===re(e,r,t)}function ie(e,r,t){return 0!==re(e,r,t)}function ae(e,r,t){return re(e,r,t)>=0}function se(e,r,t){return re(e,r,t)<=0}function ue(e,r,t,n){switch(r){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof t&&(t=t.version),e===t;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof t&&(t=t.version),e!==t;case"":case"=":case"==":return oe(e,t,n);case"!=":return ie(e,t,n);case">":return te(e,t,n);case">=":return ae(e,t,n);case"<":return ne(e,t,n);case"<=":return se(e,t,n);default:throw new TypeError("Invalid operator: "+r)}}function ce(e,r){if(r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),e instanceof ce){if(e.loose===!!r.loose)return e;e=e.value}if(!(this instanceof ce))return new ce(e,r);e=e.trim().split(/\s+/).join(" "),t("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===fe?this.value="":this.value=this.operator+this.semver.version,t("comp",this)}r.rcompareIdentifiers=function(e,r){return ee(r,e)},r.major=function(e,r){return new Y(e,r).major},r.minor=function(e,r){return new Y(e,r).minor},r.patch=function(e,r){return new Y(e,r).patch},r.compare=re,r.compareLoose=function(e,r){return re(e,r,!0)},r.rcompare=function(e,r,t){return re(r,e,t)},r.sort=function(e,t){return e.sort((function(e,n){return r.compare(e,n,t)}))},r.rsort=function(e,t){return e.sort((function(e,n){return r.rcompare(e,n,t)}))},r.gt=te,r.lt=ne,r.eq=oe,r.neq=ie,r.gte=ae,r.lte=se,r.cmp=ue,r.Comparator=ce;var fe={};function le(e,r){if(r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),e instanceof le)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new le(e.raw,r);if(e instanceof ce)return new le(e.value,r);if(!(this instanceof le))return new le(e,r);if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}function pe(e){return!e||"x"===e.toLowerCase()||"*"===e}function he(e,r,t,n,o,i,a,s,u,c,f,l,p){return((r=pe(t)?"":pe(n)?">="+t+".0.0":pe(o)?">="+t+"."+n+".0":">="+r)+" "+(s=pe(u)?"":pe(c)?"<"+(+u+1)+".0.0":pe(f)?"<"+u+"."+(+c+1)+".0":l?"<="+u+"."+c+"."+f+"-"+l:"<="+s)).trim()}function ve(e,r,n){for(var o=0;o0){var i=e[o].semver;if(i.major===r.major&&i.minor===r.minor&&i.patch===r.patch)return!0}return!1}return!0}function de(e,r,t){try{r=new le(r,t)}catch(e){return!1}return r.test(e)}function ye(e,r,t,n){var o,i,a,s,u;switch(e=new Y(e,n),r=new le(r,n),t){case">":o=te,i=se,a=ne,s=">",u=">=";break;case"<":o=ne,i=ae,a=te,s="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(de(e,r,n))return!1;for(var c=0;c=0.0.0")),l=l||e,p=p||e,o(e.semver,l.semver,n)?l=e:a(e.semver,p.semver,n)&&(p=e)})),l.operator===s||l.operator===u)return!1;if((!p.operator||p.operator===s)&&i(e,p.semver))return!1;if(p.operator===u&&a(e,p.semver))return!1}return!0}ce.prototype.parse=function(e){var r=this.options.loose?s[L]:s[G],t=e.match(r);if(!t)throw new TypeError("Invalid comparator: "+e);this.operator=t[1],"="===this.operator&&(this.operator=""),t[2]?this.semver=new Y(t[2],this.options.loose):this.semver=fe},ce.prototype.toString=function(){return this.value},ce.prototype.test=function(e){return t("Comparator.test",e,this.options.loose),this.semver===fe||("string"==typeof e&&(e=new Y(e,this.options)),ue(e,this.operator,this.semver,this.options))},ce.prototype.intersects=function(e,r){if(!(e instanceof ce))throw new TypeError("a Comparator is required");var t;if(r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),""===this.operator)return t=new le(e.value,r),de(this.value,t,r);if(""===e.operator)return t=new le(this.value,r),de(e.semver,t,r);var n=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,a=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),s=ue(this.semver,"<",e.semver,r)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),u=ue(this.semver,">",e.semver,r)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return n||o||i&&a||s||u},r.Range=le,le.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},le.prototype.toString=function(){return this.range},le.prototype.parseRange=function(e){var r=this.options.loose,n=r?s[J]:s[F];e=e.replace(n,he),t("hyphen replace",e),e=e.replace(s[K],"$1$2$3"),t("comparator trim",e,s[K]),e=(e=e.replace(s[M],"$1~")).replace(s[C],"$1^");var o=r?s[L]:s[G],i=e.split(" ").map((function(e){return function(e,r){return t("comp",e,r),e=function(e,r){return e.trim().split(/\s+/).map((function(e){return function(e,r){t("caret",e,r);var n=r.loose?s[U]:s[H];return e.replace(n,(function(r,n,o,i,a){var s;return t("caret",e,r,n,o,i,a),pe(n)?s="":pe(o)?s=">="+n+".0.0 <"+(+n+1)+".0.0":pe(i)?s="0"===n?">="+n+"."+o+".0 <"+n+"."+(+o+1)+".0":">="+n+"."+o+".0 <"+(+n+1)+".0.0":a?(t("replaceCaret pr",a),s="0"===n?"0"===o?">="+n+"."+o+"."+i+"-"+a+" <"+n+"."+o+"."+(+i+1):">="+n+"."+o+"."+i+"-"+a+" <"+n+"."+(+o+1)+".0":">="+n+"."+o+"."+i+"-"+a+" <"+(+n+1)+".0.0"):(t("no pr"),s="0"===n?"0"===o?">="+n+"."+o+"."+i+" <"+n+"."+o+"."+(+i+1):">="+n+"."+o+"."+i+" <"+n+"."+(+o+1)+".0":">="+n+"."+o+"."+i+" <"+(+n+1)+".0.0"),t("caret return",s),s}))}(e,r)})).join(" ")}(e,r),t("caret",e),e=function(e,r){return e.trim().split(/\s+/).map((function(e){return function(e,r){var n=r.loose?s[D]:s[z];return e.replace(n,(function(r,n,o,i,a){var s;return t("tilde",e,r,n,o,i,a),pe(n)?s="":pe(o)?s=">="+n+".0.0 <"+(+n+1)+".0.0":pe(i)?s=">="+n+"."+o+".0 <"+n+"."+(+o+1)+".0":a?(t("replaceTilde pr",a),s=">="+n+"."+o+"."+i+"-"+a+" <"+n+"."+(+o+1)+".0"):s=">="+n+"."+o+"."+i+" <"+n+"."+(+o+1)+".0",t("tilde return",s),s}))}(e,r)})).join(" ")}(e,r),t("tildes",e),e=function(e,r){return t("replaceXRanges",e,r),e.split(/\s+/).map((function(e){return function(e,r){e=e.trim();var n=r.loose?s[I]:s[$];return e.replace(n,(function(r,n,o,i,a,s){t("xRange",e,r,n,o,i,a,s);var u=pe(o),c=u||pe(i),f=c||pe(a);return"="===n&&f&&(n=""),u?r=">"===n||"<"===n?"<0.0.0":"*":n&&f?(c&&(i=0),a=0,">"===n?(n=">=",c?(o=+o+1,i=0,a=0):(i=+i+1,a=0)):"<="===n&&(n="<",c?o=+o+1:i=+i+1),r=n+o+"."+i+"."+a):c?r=">="+o+".0.0 <"+(+o+1)+".0.0":f&&(r=">="+o+"."+i+".0 <"+o+"."+(+i+1)+".0"),t("xRange return",r),r}))}(e,r)})).join(" ")}(e,r),t("xrange",e),e=function(e,r){return t("replaceStars",e,r),e.trim().replace(s[W],"")}(e,r),t("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(i=i.filter((function(e){return!!e.match(o)}))),i=i.map((function(e){return new ce(e,this.options)}),this)},le.prototype.intersects=function(e,r){if(!(e instanceof le))throw new TypeError("a Range is required");return this.set.some((function(t){return t.every((function(t){return e.set.some((function(e){return e.every((function(e){return t.intersects(e,r)}))}))}))}))},r.toComparators=function(e,r){return new le(e,r).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},le.prototype.test=function(e){if(!e)return!1;"string"==typeof e&&(e=new Y(e,this.options));for(var r=0;r":0===r.prerelease.length?r.patch++:r.prerelease.push(0),r.raw=r.format();case"":case">=":t&&!te(t,r)||(t=r);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}))}if(t&&e.test(t))return t;return null},r.validRange=function(e,r){try{return new le(e,r).range||"*"}catch(e){return null}},r.ltr=function(e,r,t){return ye(e,r,"<",t)},r.gtr=function(e,r,t){return ye(e,r,">",t)},r.outside=ye,r.prerelease=function(e,r){var t=X(e,r);return t&&t.prerelease.length?t.prerelease:null},r.intersects=function(e,r,t){return e=new le(e,t),r=new le(r,t),e.intersects(r)},r.coerce=function(e){if(e instanceof Y)return e;if("string"!=typeof e)return null;var r=e.match(s[V]);if(null==r)return null;return X(r[1]+"."+(r[2]||"0")+"."+(r[3]||"0"))}}(0,Ke.exports);var Fe=Ke.exports.satisfies(process.version,"^6.12.0 || >=8.0.0"),Je=Pe,We=$e,Ze=Ne,Xe=Te,Ye=Ge,Qe=a,er=["RS256","RS384","RS512","ES256","ES384","ES512"],rr=["RS256","RS384","RS512"],tr=["HS256","HS384","HS512"];Fe&&(er.splice(3,0,"PS256","PS384","PS512"),rr.splice(3,0,"PS256","PS384","PS512"));var nr=1/0,or=9007199254740991,ir=17976931348623157e292,ar=NaN,sr="[object Arguments]",ur="[object Function]",cr="[object GeneratorFunction]",fr="[object String]",lr="[object Symbol]",pr=/^\s+|\s+$/g,hr=/^[-+]0x[0-9a-f]+$/i,vr=/^0b[01]+$/i,dr=/^0o[0-7]+$/i,yr=/^(?:0|[1-9]\d*)$/,mr=parseInt;function gr(e){return e!=e}function br(e,r){return function(e,r){for(var t=-1,n=e?e.length:0,o=Array(n);++t-1&&e%1==0&&e-1&&e%1==0&&e<=or}(e.length)&&!function(e){var r=$r(e)?Er.call(e):"";return r==ur||r==cr}(e)}function $r(e){var r=typeof e;return!!e&&("object"==r||"function"==r)}function Ir(e){return!!e&&"object"==typeof e}var Vr=function(e,r,t,n){var o;e=Br(e)?e:(o=e)?br(o,function(e){return Br(e)?Tr(e):kr(e)}(o)):[],t=t&&!n?function(e){var r=function(e){if(!e)return 0===e?e:0;if(e=function(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||Ir(e)&&Er.call(e)==lr}(e))return ar;if($r(e)){var r="function"==typeof e.valueOf?e.valueOf():e;e=$r(r)?r+"":r}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(pr,"");var t=vr.test(e);return t||dr.test(e)?mr(e.slice(2),t?2:8):hr.test(e)?ar:+e}(e),e===nr||e===-nr){return(e<0?-1:1)*ir}return e==e?e:0}(e),t=r%1;return r==r?t?r-t:r:0}(t):0;var i=e.length;return t<0&&(t=Ar(i+t,0)),function(e){return"string"==typeof e||!Rr(e)&&Ir(e)&&Er.call(e)==fr}(e)?t<=i&&e.indexOf(r,t)>-1:!!i&&function(e,r,t){if(r!=r)return function(e,r,t,n){for(var o=e.length,i=t+(n?1:-1);n?i--:++i-1},Nr=Object.prototype.toString;var Mr=function(e){return!0===e||!1===e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Boolean]"==Nr.call(e)},zr=1/0,Dr=17976931348623157e292,qr=NaN,Cr="[object Symbol]",Hr=/^\s+|\s+$/g,Ur=/^[-+]0x[0-9a-f]+$/i,Lr=/^0b[01]+$/i,Gr=/^0o[0-7]+$/i,Kr=parseInt,Fr=Object.prototype.toString;function Jr(e){var r=typeof e;return!!e&&("object"==r||"function"==r)}var Wr=function(e){return"number"==typeof e&&e==function(e){var r=function(e){if(!e)return 0===e?e:0;if(e=function(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&Fr.call(e)==Cr}(e))return qr;if(Jr(e)){var r="function"==typeof e.valueOf?e.valueOf():e;e=Jr(r)?r+"":r}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(Hr,"");var t=Lr.test(e);return t||Gr.test(e)?Kr(e.slice(2),t?2:8):Ur.test(e)?qr:+e}(e),e===zr||e===-zr){return(e<0?-1:1)*Dr}return e==e?e:0}(e),t=r%1;return r==r?t?r-t:r:0}(e)},Zr=Object.prototype.toString;var Xr=function(e){return"number"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Number]"==Zr.call(e)};var Yr=Function.prototype,Qr=Object.prototype,et=Yr.toString,rt=Qr.hasOwnProperty,tt=et.call(Object),nt=Qr.toString,ot=function(e,r){return function(t){return e(r(t))}}(Object.getPrototypeOf,Object);var it=function(e){if(!function(e){return!!e&&"object"==typeof e}(e)||"[object Object]"!=nt.call(e)||function(e){var r=!1;if(null!=e&&"function"!=typeof e.toString)try{r=!!(e+"")}catch(e){}return r}(e))return!1;var r=ot(e);if(null===r)return!0;var t=rt.call(r,"constructor")&&r.constructor;return"function"==typeof t&&t instanceof t&&et.call(t)==tt},at=Object.prototype.toString,st=Array.isArray;var ut=function(e){return"string"==typeof e||!st(e)&&function(e){return!!e&&"object"==typeof e}(e)&&"[object String]"==at.call(e)},ct="Expected a function",ft=1/0,lt=17976931348623157e292,pt=NaN,ht="[object Symbol]",vt=/^\s+|\s+$/g,dt=/^[-+]0x[0-9a-f]+$/i,yt=/^0b[01]+$/i,mt=/^0o[0-7]+$/i,gt=parseInt,bt=Object.prototype.toString;function wt(e,r){var t;if("function"!=typeof r)throw new TypeError(ct);return e=function(e){var r=function(e){if(!e)return 0===e?e:0;if(e=function(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&bt.call(e)==ht}(e))return pt;if(jt(e)){var r="function"==typeof e.valueOf?e.valueOf():e;e=jt(r)?r+"":r}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(vt,"");var t=yt.test(e);return t||mt.test(e)?gt(e.slice(2),t?2:8):dt.test(e)?pt:+e}(e),e===ft||e===-ft){return(e<0?-1:1)*lt}return e==e?e:0}(e),t=r%1;return r==r?t?r-t:r:0}(e),function(){return--e>0&&(t=r.apply(this,arguments)),e<=1&&(r=void 0),t}}function jt(e){var r=typeof e;return!!e&&("object"==r||"function"==r)}var St=function(e){return wt(2,e)},_t=Ge,Et=a,xt=Vr,Ot=Mr,At=Wr,Tt=Xr,kt=it,Pt=ut,Rt=St,Bt=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];Fe&&Bt.splice(3,0,"PS256","PS384","PS512");var $t={expiresIn:{isValid:function(e){return At(e)||Pt(e)&&e},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(e){return At(e)||Pt(e)&&e},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(e){return Pt(e)||Array.isArray(e)},message:'"audience" must be a string or array'},algorithm:{isValid:xt.bind(null,Bt),message:'"algorithm" must be a valid string enum value'},header:{isValid:kt,message:'"header" must be an object'},encoding:{isValid:Pt,message:'"encoding" must be a string'},issuer:{isValid:Pt,message:'"issuer" must be a string'},subject:{isValid:Pt,message:'"subject" must be a string'},jwtid:{isValid:Pt,message:'"jwtid" must be a string'},noTimestamp:{isValid:Ot,message:'"noTimestamp" must be a boolean'},keyid:{isValid:Pt,message:'"keyid" must be a string'},mutatePayload:{isValid:Ot,message:'"mutatePayload" must be a boolean'}},It={iat:{isValid:Tt,message:'"iat" should be a number of seconds'},exp:{isValid:Tt,message:'"exp" should be a number of seconds'},nbf:{isValid:Tt,message:'"nbf" should be a number of seconds'}};function Vt(e,r,t,n){if(!kt(t))throw new Error('Expected "'+n+'" to be a plain object.');Object.keys(t).forEach((function(o){var i=e[o];if(i){if(!i.isValid(t[o]))throw new Error(i.message)}else if(!r)throw new Error('"'+o+'" is not allowed in "'+n+'"')}))}var Nt={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},Mt=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"],zt={decode:Te,verify:function(e,r,t,n){var o;if("function"!=typeof t||n||(n=t,t={}),t||(t={}),t=Object.assign({},t),o=n||function(e,r){if(e)throw e;return r},t.clockTimestamp&&"number"!=typeof t.clockTimestamp)return o(new Je("clockTimestamp must be a number"));if(void 0!==t.nonce&&("string"!=typeof t.nonce||""===t.nonce.trim()))return o(new Je("nonce must be a non-empty string"));var i=t.clockTimestamp||Math.floor(Date.now()/1e3);if(!e)return o(new Je("jwt must be provided"));if("string"!=typeof e)return o(new Je("jwt must be a string"));var a,s=e.split(".");if(3!==s.length)return o(new Je("jwt malformed"));try{a=Xe(e,{complete:!0})}catch(e){return o(e)}if(!a)return o(new Je("invalid token"));var u,c=a.header;if("function"==typeof r){if(!n)return o(new Je("verify must be called asynchronous if secret or public key is provided as a callback"));u=r}else u=function(e,t){return t(null,r)};return u(c,(function(r,n){if(r)return o(new Je("error in secret or public key callback: "+r.message));var u,f=""!==s[2].trim();if(!f&&n)return o(new Je("jwt signature is required"));if(f&&!n)return o(new Je("secret or public key must be provided"));if(f||t.algorithms||(t.algorithms=["none"]),t.algorithms||(t.algorithms=~n.toString().indexOf("BEGIN CERTIFICATE")||~n.toString().indexOf("BEGIN PUBLIC KEY")?er:~n.toString().indexOf("BEGIN RSA PUBLIC KEY")?rr:tr),!~t.algorithms.indexOf(a.header.alg))return o(new Je("invalid algorithm"));try{u=Qe.verify(e,a.header.alg,n)}catch(e){return o(e)}if(!u)return o(new Je("invalid signature"));var l=a.payload;if(void 0!==l.nbf&&!t.ignoreNotBefore){if("number"!=typeof l.nbf)return o(new Je("invalid nbf value"));if(l.nbf>i+(t.clockTolerance||0))return o(new We("jwt not active",new Date(1e3*l.nbf)))}if(void 0!==l.exp&&!t.ignoreExpiration){if("number"!=typeof l.exp)return o(new Je("invalid exp value"));if(i>=l.exp+(t.clockTolerance||0))return o(new Ze("jwt expired",new Date(1e3*l.exp)))}if(t.audience){var p=Array.isArray(t.audience)?t.audience:[t.audience];if(!(Array.isArray(l.aud)?l.aud:[l.aud]).some((function(e){return p.some((function(r){return r instanceof RegExp?r.test(e):r===e}))})))return o(new Je("jwt audience invalid. expected: "+p.join(" or ")))}if(t.issuer&&("string"==typeof t.issuer&&l.iss!==t.issuer||Array.isArray(t.issuer)&&-1===t.issuer.indexOf(l.iss)))return o(new Je("jwt issuer invalid. expected: "+t.issuer));if(t.subject&&l.sub!==t.subject)return o(new Je("jwt subject invalid. expected: "+t.subject));if(t.jwtid&&l.jti!==t.jwtid)return o(new Je("jwt jwtid invalid. expected: "+t.jwtid));if(t.nonce&&l.nonce!==t.nonce)return o(new Je("jwt nonce invalid. expected: "+t.nonce));if(t.maxAge){if("number"!=typeof l.iat)return o(new Je("iat required when maxAge is specified"));var h=Ye(t.maxAge,l.iat);if(void 0===h)return o(new Je('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(i>=h+(t.clockTolerance||0))return o(new Ze("maxAge exceeded",new Date(1e3*h)))}if(!0===t.complete){var v=a.signature;return o(null,{header:c,payload:l,signature:v})}return o(null,l)}))},sign:function(e,r,t,n){"function"==typeof t?(n=t,t={}):t=t||{};var o="object"==typeof e&&!Buffer.isBuffer(e),i=Object.assign({alg:t.algorithm||"HS256",typ:o?"JWT":void 0,kid:t.keyid},t.header);function a(e){if(n)return n(e);throw e}if(!r&&"none"!==t.algorithm)return a(new Error("secretOrPrivateKey must have a value"));if(void 0===e)return a(new Error("payload is required"));if(o){try{!function(e){Vt(It,!0,e,"payload")}(e)}catch(e){return a(e)}t.mutatePayload||(e=Object.assign({},e))}else{var s=Mt.filter((function(e){return void 0!==t[e]}));if(s.length>0)return a(new Error("invalid "+s.join(",")+" option for "+typeof e+" payload"))}if(void 0!==e.exp&&void 0!==t.expiresIn)return a(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(void 0!==e.nbf&&void 0!==t.notBefore)return a(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{!function(e){Vt($t,!1,e,"options")}(t)}catch(e){return a(e)}var u=e.iat||Math.floor(Date.now()/1e3);if(t.noTimestamp?delete e.iat:o&&(e.iat=u),void 0!==t.notBefore){try{e.nbf=_t(t.notBefore,u)}catch(e){return a(e)}if(void 0===e.nbf)return a(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(void 0!==t.expiresIn&&"object"==typeof e){try{e.exp=_t(t.expiresIn,u)}catch(e){return a(e)}if(void 0===e.exp)return a(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(Nt).forEach((function(r){var n=Nt[r];if(void 0!==t[r]){if(void 0!==e[n])return a(new Error('Bad "options.'+r+'" option. The payload already has an "'+n+'" property.'));e[n]=t[r]}}));var c=t.encoding||"utf8";if("function"!=typeof n)return Et.sign({header:i,payload:e,secret:r,encoding:c});n=n&&Rt(n),Et.createSign({header:i,privateKey:r,payload:e,encoding:c}).once("error",n).once("done",(function(e){n(null,e)}))},JsonWebTokenError:Pe,NotBeforeError:$e,TokenExpiredError:Ne},Dt={exports:{}};!function(e,r){var t="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",a="[object AsyncFunction]",s="[object Function]",u="[object GeneratorFunction]",c="[object Null]",f="[object Object]",l="[object Proxy]",p="[object Undefined]",h=/^\[object .+?Constructor\]$/,v=/^(?:0|[1-9]\d*)$/,d={};d["[object Float32Array]"]=d["[object Float64Array]"]=d["[object Int8Array]"]=d["[object Int16Array]"]=d["[object Int32Array]"]=d["[object Uint8Array]"]=d["[object Uint8ClampedArray]"]=d["[object Uint16Array]"]=d["[object Uint32Array]"]=!0,d[i]=d["[object Array]"]=d["[object ArrayBuffer]"]=d["[object Boolean]"]=d["[object DataView]"]=d["[object Date]"]=d["[object Error]"]=d[s]=d["[object Map]"]=d["[object Number]"]=d[f]=d["[object RegExp]"]=d["[object Set]"]=d["[object String]"]=d["[object WeakMap]"]=!1;var y="object"==typeof o&&o&&o.Object===Object&&o,m="object"==typeof self&&self&&self.Object===Object&&self,g=y||m||Function("return this")(),b=r&&!r.nodeType&&r,w=b&&e&&!e.nodeType&&e,j=w&&w.exports===b,S=j&&y.process,_=function(){try{var e=w&&w.require&&w.require("util").types;return e||S&&S.binding&&S.binding("util")}catch(e){}}(),E=_&&_.isTypedArray;var x,O=Array.prototype,A=Function.prototype,T=Object.prototype,k=g["__core-js_shared__"],P=A.toString,R=T.hasOwnProperty,B=(x=/[^.]+$/.exec(k&&k.keys&&k.keys.IE_PROTO||""))?"Symbol(src)_1."+x:"",$=T.toString,I=P.call(Object),V=RegExp("^"+P.call(R).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),N=j?g.Buffer:void 0,M=g.Symbol,z=g.Uint8Array,D=N?N.allocUnsafe:void 0,q=function(e,r){return function(t){return e(r(t))}}(Object.getPrototypeOf,Object),C=Object.create,H=T.propertyIsEnumerable,U=O.splice,L=M?M.toStringTag:void 0,G=function(){try{var e=me(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),K=N?N.isBuffer:void 0,F=Math.max,J=Date.now,W=me(g,"Map"),Z=me(Object,"create"),X=function(){function e(){}return function(r){if(!ke(r))return{};if(C)return C(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}();function Y(e){var r=-1,t=null==e?0:e.length;for(this.clear();++r-1},Q.prototype.set=function(e,r){var t=this.__data__,n=ie(t,e);return n<0?(++this.size,t.push([e,r])):t[n][1]=r,this},ee.prototype.clear=function(){this.size=0,this.__data__={hash:new Y,map:new(W||Q),string:new Y}},ee.prototype.delete=function(e){var r=ye(this,e).delete(e);return this.size-=r?1:0,r},ee.prototype.get=function(e){return ye(this,e).get(e)},ee.prototype.has=function(e){return ye(this,e).has(e)},ee.prototype.set=function(e,r){var t=ye(this,e),n=t.size;return t.set(e,r),this.size+=t.size==n?0:1,this},re.prototype.clear=function(){this.__data__=new Q,this.size=0},re.prototype.delete=function(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t},re.prototype.get=function(e){return this.__data__.get(e)},re.prototype.has=function(e){return this.__data__.has(e)},re.prototype.set=function(e,r){var t=this.__data__;if(t instanceof Q){var n=t.__data__;if(!W||n.length<199)return n.push([e,r]),this.size=++t.size,this;t=this.__data__=new ee(n)}return t.set(e,r),this.size=t.size,this};var se,ue=function(e,r,t){for(var n=-1,o=Object(e),i=t(e),a=i.length;a--;){var s=i[se?a:++n];if(!1===r(o[s],s,o))break}return e};function ce(e){return null==e?void 0===e?p:c:L&&L in Object(e)?function(e){var r=R.call(e,L),t=e[L];try{e[L]=void 0;var n=!0}catch(e){}var o=$.call(e);n&&(r?e[L]=t:delete e[L]);return o}(e):function(e){return $.call(e)}(e)}function fe(e){return Pe(e)&&ce(e)==i}function le(e){return!(!ke(e)||function(e){return!!B&&B in e}(e))&&(Ae(e)?V:h).test(function(e){if(null!=e){try{return P.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function pe(e){if(!ke(e))return function(e){var r=[];if(null!=e)for(var t in Object(e))r.push(t);return r}(e);var r=be(e),t=[];for(var n in e)("constructor"!=n||!r&&R.call(e,n))&&t.push(n);return t}function he(e,r,t,n,o){e!==r&&ue(r,(function(i,a){if(o||(o=new re),ke(i))!function(e,r,t,n,o,i,a){var s=we(e,t),u=we(r,t),c=a.get(u);if(c)return void ne(e,t,c);var l=i?i(s,u,t+"",e,r,a):void 0,p=void 0===l;if(p){var h=Ee(u),v=!h&&Oe(u),d=!h&&!v&&Re(u);l=u,h||v||d?Ee(s)?l=s:Pe(w=s)&&xe(w)?l=function(e,r){var t=-1,n=e.length;r||(r=Array(n));for(;++t-1&&e%1==0&&e0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}(de);function Se(e,r){return e===r||e!=e&&r!=r}var _e=fe(function(){return arguments}())?fe:function(e){return Pe(e)&&R.call(e,"callee")&&!H.call(e,"callee")},Ee=Array.isArray;function xe(e){return null!=e&&Te(e.length)&&!Ae(e)}var Oe=K||function(){return!1};function Ae(e){if(!ke(e))return!1;var r=ce(e);return r==s||r==u||r==a||r==l}function Te(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}function ke(e){var r=typeof e;return null!=e&&("object"==r||"function"==r)}function Pe(e){return null!=e&&"object"==typeof e}var Re=E?function(e){return function(r){return e(r)}}(E):function(e){return Pe(e)&&Te(e.length)&&!!d[ce(e)]};function Be(e){return xe(e)?te(e,!0):pe(e)}var $e,Ie=($e=function(e,r,t){he(e,r,t)},ve((function(e,r){var t=-1,n=r.length,o=n>1?r[n-1]:void 0,i=n>2?r[2]:void 0;for(o=$e.length>3&&"function"==typeof o?(n--,o):void 0,i&&function(e,r,t){if(!ke(t))return!1;var n=typeof r;return!!("number"==n?xe(t)&&ge(r,t.length):"string"==n&&r in t)&&Se(t[r],e)}(r[0],r[1],i)&&(o=n<3?void 0:o,n=1),e=Object(e);++t -1) { - const val = encodeURIComponent(params[key]) - requestUrl = `${requestUrl}${requestUrl.includes('?') ? '&' : '?' - }${key}=${val}` - // 删除 postData 中对应的数据 - delete params[key] - } - } - - return { execParams: params, url: requestUrl } - } - - _getSign (method, params) { - const bizContent = params.bizContent || null - delete params.bizContent - - const signParams = Object.assign({ - method, - appId: this.options.appId, - charset: this.options.charset, - version: this.options.version, - signType: this.options.signType, - timestamp: getFullTimeStr(getOffsetDate(this.options.timeOffset)) - }, params) - - if (bizContent) { - signParams.bizContent = JSON.stringify(camel2snakeJson(bizContent)) - } - - // params key 驼峰转下划线 - const decamelizeParams = camel2snakeJson(signParams) - - // 排序 - const signStr = Object.keys(decamelizeParams) - .sort() - .map((key) => { - let data = decamelizeParams[key] - if (Array.prototype.toString.call(data) !== '[object String]') { - data = JSON.stringify(data) - } - return `${key}=${data}` - }) - .join('&') - - // 计算签名 - const sign = crypto - .createSign(ALIPAY_ALGORITHM_MAPPING[this.options.signType]) - .update(signStr, 'utf8') - .sign(this.options.privateKey, 'base64') - - return Object.assign(decamelizeParams, { sign }) - } - - async _exec (method, params = {}, option = {}) { - // 计算签名 - const signData = this._getSign(method, params) - const { url, execParams } = this._formatUrl(this.options.gateway, signData) - const { status, data } = await uniCloud.httpclient.request(url, { - method: 'POST', - data: execParams, - // 按 text 返回(为了验签) - dataType: 'text', - timeout: this.options.timeout - }) - if (status !== 200) throw new Error('request fail') - /** - * 示例响应格式 - * {"alipay_trade_precreate_response": - * {"code": "10000","msg": "Success","out_trade_no": "111111","qr_code": "https:\/\/"}, - * "sign": "abcde=" - * } - * 或者 - * {"error_response": - * {"code":"40002","msg":"Invalid Arguments","sub_code":"isv.code-invalid","sub_msg":"授权码code无效"}, - * } - */ - const result = JSON.parse(data) - const responseKey = `${method.replace(/\./g, '_')}_response` - const response = result[responseKey] - const errorResponse = result.error_response - if (response) { - // 按字符串验签 - const validateSuccess = option.validateSign ? this._checkResponseSign(data, responseKey) : true - if (validateSuccess) { - if (!response.code || response.code === '10000') { - const errCode = 0 - const errMsg = response.msg || '' - return { - errCode, - errMsg, - ...snake2camelJson(response) - } - } - const msg = response.sub_code ? `${response.sub_code} ${response.sub_msg}` : `${response.msg || 'unkonwn error'}` - throw new Error(msg) - } else { - throw new Error('check sign error') - } - } else if (errorResponse) { - throw new Error(errorResponse.sub_msg || errorResponse.msg || 'request fail') - } - - throw new Error('request fail') - } - - _checkResponseSign (signStr, responseKey) { - if (!this.options.alipayPublicKey || this.options.alipayPublicKey === '') { - console.warn('options.alipayPublicKey is empty') - // 支付宝公钥不存在时不做验签 - return true - } - - // 带验签的参数不存在时返回失败 - if (!signStr) { return false } - - // 根据服务端返回的结果截取需要验签的目标字符串 - const validateStr = this._getSignStr(signStr, responseKey) - // 服务端返回的签名 - const serverSign = JSON.parse(signStr).sign - - // 参数存在,并且是正常的结果(不包含 sub_code)时才验签 - const verifier = crypto.createVerify(ALIPAY_ALGORITHM_MAPPING[this.options.signType]) - verifier.update(validateStr, 'utf8') - return verifier.verify(this.options.alipayPublicKey, serverSign, 'base64') - } - - _getSignStr (originStr, responseKey) { - // 待签名的字符串 - let validateStr = originStr.trim() - // 找到 xxx_response 开始的位置 - const startIndex = originStr.indexOf(`${responseKey}"`) - // 找到最后一个 “"sign"” 字符串的位置(避免) - const lastIndex = originStr.lastIndexOf('"sign"') - - /** - * 删除 xxx_response 及之前的字符串 - * 假设原始字符串为 - * {"xxx_response":{"code":"10000"},"sign":"jumSvxTKwn24G5sAIN"} - * 删除后变为 - * :{"code":"10000"},"sign":"jumSvxTKwn24G5sAIN"} - */ - validateStr = validateStr.substr(startIndex + responseKey.length + 1) - - /** - * 删除最后一个 "sign" 及之后的字符串 - * 删除后变为 - * :{"code":"10000"}, - * {} 之间就是待验签的字符串 - */ - validateStr = validateStr.substr(0, lastIndex) - - // 删除第一个 { 之前的任何字符 - validateStr = validateStr.replace(/^[^{]*{/g, '{') - - // 删除最后一个 } 之后的任何字符 - validateStr = validateStr.replace(/\}([^}]*)$/g, '}') - - return validateStr - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/third-party/apple/account/index.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/third-party/apple/account/index.js deleted file mode 100644 index 52edc01..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/third-party/apple/account/index.js +++ /dev/null @@ -1,79 +0,0 @@ -const rsaPublicKeyPem = require('../rsa-public-key-pem') -const { - jwtVerify -} = require('../../../npm/index') -let authKeysCache = null - -module.exports = class Auth { - constructor (options) { - this.options = Object.assign({ - baseUrl: 'https://appleid.apple.com', - timeout: 10000 - }, options) - } - - async _fetch (url, options) { - const { baseUrl } = this.options - return uniCloud.httpclient.request(baseUrl + url, options) - } - - async verifyIdentityToken (identityToken) { - // 解密出kid,拿取key - const jwtHeader = identityToken.split('.')[0] - const { kid } = JSON.parse(Buffer.from(jwtHeader, 'base64').toString()) - let authKeys - if (authKeysCache) { - authKeys = authKeysCache - } else { - authKeys = await this.getAuthKeys() - authKeysCache = authKeys - } - const usedKey = authKeys.find(item => item.kid === kid) - - /** - * identityToken 格式 - * - * { - * iss: 'https://appleid.apple.com', - * aud: 'io.dcloud.hellouniapp', - * exp: 1610626724, - * iat: 1610540324, - * sub: '000628.30119d332d9b45a3be4a297f9391fd5c.0403', - * c_hash: 'oFfgewoG36cJX00KUbj45A', - * email: 'x2awmap99s@privaterelay.appleid.com', - * email_verified: 'true', - * is_private_email: 'true', - * auth_time: 1610540324, - * nonce_supported: true - * } - */ - const payload = jwtVerify( - identityToken, - rsaPublicKeyPem(usedKey.n, usedKey.e), - { - algorithms: usedKey.alg - } - ) - - if (payload.iss !== 'https://appleid.apple.com' || payload.aud !== this.options.bundleId) { - throw new Error('Invalid identity token') - } - - return { - openid: payload.sub, - email: payload.email, - emailVerified: payload.email_verified === 'true', - isPrivateEmail: payload.is_private_email === 'true' - } - } - - async getAuthKeys () { - const { status, data } = await this._fetch('/auth/keys', { - method: 'GET', - dataType: 'json', - timeout: this.options.timeout - }) - if (status !== 200) throw new Error('request https://appleid.apple.com/auth/keys fail') - return data.keys - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/third-party/apple/rsa-public-key-pem.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/third-party/apple/rsa-public-key-pem.js deleted file mode 100644 index e1dbb31..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/third-party/apple/rsa-public-key-pem.js +++ /dev/null @@ -1,64 +0,0 @@ -// http://stackoverflow.com/questions/18835132/xml-to-pem-in-node-js -/* eslint-disable camelcase */ -function rsaPublicKeyPem (modulus_b64, exponent_b64) { - const modulus = Buffer.from(modulus_b64, 'base64') - const exponent = Buffer.from(exponent_b64, 'base64') - - let modulus_hex = modulus.toString('hex') - let exponent_hex = exponent.toString('hex') - - modulus_hex = prepadSigned(modulus_hex) - exponent_hex = prepadSigned(exponent_hex) - - const modlen = modulus_hex.length / 2 - const explen = exponent_hex.length / 2 - - const encoded_modlen = encodeLengthHex(modlen) - const encoded_explen = encodeLengthHex(explen) - const encoded_pubkey = '30' + - encodeLengthHex( - modlen + - explen + - encoded_modlen.length / 2 + - encoded_explen.length / 2 + 2 - ) + - '02' + encoded_modlen + modulus_hex + - '02' + encoded_explen + exponent_hex - - const der_b64 = Buffer.from(encoded_pubkey, 'hex').toString('base64') - - const pem = '-----BEGIN RSA PUBLIC KEY-----\n' + - der_b64.match(/.{1,64}/g).join('\n') + - '\n-----END RSA PUBLIC KEY-----\n' - - return pem -} - -function prepadSigned (hexStr) { - const msb = hexStr[0] - if (msb < '0' || msb > '7') { - return '00' + hexStr - } else { - return hexStr - } -} - -function toHex (number) { - const nstr = number.toString(16) - if (nstr.length % 2) return '0' + nstr - return nstr -} - -// encode ASN.1 DER length field -// if <=127, short form -// if >=128, long form -function encodeLengthHex (n) { - if (n <= 127) return toHex(n) - else { - const n_hex = toHex(n) - const length_of_length_byte = 128 + n_hex.length / 2 // 0x80+numbytes - return toHex(length_of_length_byte) + n_hex - } -} - -module.exports = rsaPublicKeyPem diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/third-party/index.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/third-party/index.js deleted file mode 100644 index 149c7de..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/third-party/index.js +++ /dev/null @@ -1,36 +0,0 @@ -const WxAccount = require('./weixin/account/index') -const QQAccount = require('./qq/account/index') -const AliAccount = require('./alipay/account/index') -const AppleAccount = require('./apple/account/index') - -const createApi = require('./share/create-api') - -module.exports = { - initWeixin: function () { - const oauthConfig = this.configUtils.getOauthConfig({ provider: 'weixin' }) - return createApi(WxAccount, { - appId: oauthConfig.appid, - secret: oauthConfig.appsecret - }) - }, - initQQ: function () { - const oauthConfig = this.configUtils.getOauthConfig({ provider: 'qq' }) - return createApi(QQAccount, { - appId: oauthConfig.appid, - secret: oauthConfig.appsecret - }) - }, - initAlipay: function () { - const oauthConfig = this.configUtils.getOauthConfig({ provider: 'alipay' }) - return createApi(AliAccount, { - appId: oauthConfig.appid, - privateKey: oauthConfig.privateKey - }) - }, - initApple: function () { - const oauthConfig = this.configUtils.getOauthConfig({ provider: 'apple' }) - return createApi(AppleAccount, { - bundleId: oauthConfig.bundleId - }) - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/third-party/qq/account/index.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/third-party/qq/account/index.js deleted file mode 100644 index 9b4879a..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/third-party/qq/account/index.js +++ /dev/null @@ -1,97 +0,0 @@ -const { - UniCloudError -} = require('../../../../common/error') -const { - resolveUrl -} = require('../../../../common/utils') -const { - callQQOpenApi -} = require('../normalize') - -module.exports = class Auth { - constructor (options) { - this.options = Object.assign({ - baseUrl: 'https://graph.qq.com', - timeout: 5000 - }, options) - } - - async _requestQQOpenapi ({ name, url, data, options }) { - const defaultOptions = { - method: 'GET', - dataType: 'json', - dataAsQueryString: true, - timeout: this.options.timeout - } - const result = await callQQOpenApi({ - name: `auth.${name}`, - url: resolveUrl(this.options.baseUrl, url), - data, - options, - defaultOptions - }) - return result - } - - async getUserInfo ({ - accessToken, - openid - } = {}) { - const url = '/user/get_user_info' - const result = await this._requestQQOpenapi({ - name: 'getUserInfo', - url, - data: { - oauthConsumerKey: this.options.appId, - accessToken, - openid - } - }) - return { - nickname: result.nickname, - avatar: result.figureurl_qq_1 - } - } - - async getOpenidByToken ({ - accessToken - } = {}) { - const url = '/oauth2.0/me' - const result = await this._requestQQOpenapi({ - name: 'getOpenidByToken', - url, - data: { - accessToken, - unionid: 1, - fmt: 'json' - } - }) - if (result.clientId !== this.options.appId) { - throw new UniCloudError({ - code: 'APPID_NOT_MATCH', - message: 'appid not match' - }) - } - return { - openid: result.openid, - unionid: result.unionid - } - } - - async code2Session ({ - code - } = {}) { - const url = 'https://api.q.qq.com/sns/jscode2session' - const result = await this._requestQQOpenapi({ - name: 'getOpenidByToken', - url, - data: { - grant_type: 'authorization_code', - appid: this.options.appId, - secret: this.options.secret, - js_code: code - } - }) - return result - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/third-party/qq/normalize.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/third-party/qq/normalize.js deleted file mode 100644 index fcfdc1e..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/third-party/qq/normalize.js +++ /dev/null @@ -1,85 +0,0 @@ -const { - UniCloudError -} = require('../../../common/error') -const { - camel2snakeJson, - snake2camelJson -} = require('../../../common/utils') - -function generateApiResult (apiName, data) { - if (data.ret || data.error) { - // 这三种都是qq的错误码规范 - const code = data.ret || data.error || data.errcode || -2 - const message = data.msg || data.error_description || data.errmsg || `${apiName} fail` - throw new UniCloudError({ - code, - message - }) - } else { - delete data.ret - delete data.msg - delete data.error - delete data.error_description - delete data.errcode - delete data.errmsg - return { - ...data, - errMsg: `${apiName} ok`, - errCode: 0 - } - } -} - -function nomalizeError (apiName, error) { - throw new UniCloudError({ - code: error.code || -2, - message: error.message || `${apiName} fail` - }) -} - -async function callQQOpenApi ({ - name, - url, - data, - options, - defaultOptions -}) { - options = Object.assign({}, defaultOptions, options, { data: camel2snakeJson(Object.assign({}, data)) }) - let result - try { - result = await uniCloud.httpclient.request(url, options) - } catch (e) { - return nomalizeError(name, e) - } - let resData = result.data - const contentType = result.headers['content-type'] - if ( - Buffer.isBuffer(resData) && - (contentType.indexOf('text/plain') === 0 || - contentType.indexOf('application/json') === 0) - ) { - try { - resData = JSON.parse(resData.toString()) - } catch (e) { - resData = resData.toString() - } - } else if (Buffer.isBuffer(resData)) { - resData = { - buffer: resData, - contentType - } - } - return snake2camelJson( - generateApiResult( - name, - resData || { - errCode: -2, - errMsg: 'Request failed' - } - ) - ) -} - -module.exports = { - callQQOpenApi -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/third-party/share/create-api.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/third-party/share/create-api.js deleted file mode 100644 index c58f1e8..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/third-party/share/create-api.js +++ /dev/null @@ -1,73 +0,0 @@ -const { - isFn, - isPlainObject -} = require('../../../common/utils') - -// 注意:不进行递归处理 -function parseParams (params = {}, rule) { - if (!rule || !params) { - return params - } - const internalKeys = ['_pre', '_purify', '_post'] - // 转换之前的处理 - if (rule._pre) { - params = rule._pre(params) - } - // 净化参数 - let purify = { shouldDelete: new Set([]) } - if (rule._purify) { - const _purify = rule._purify - for (const purifyKey in _purify) { - _purify[purifyKey] = new Set(_purify[purifyKey]) - } - purify = Object.assign(purify, _purify) - } - if (isPlainObject(rule)) { - for (const key in rule) { - const parser = rule[key] - if (isFn(parser) && internalKeys.indexOf(key) === -1) { - params[key] = parser(params) - } else if (typeof parser === 'string' && internalKeys.indexOf(key) === -1) { - // 直接转换属性名称的删除旧属性名 - params[key] = params[parser] - purify.shouldDelete.add(parser) - } - } - } else if (isFn(rule)) { - params = rule(params) - } - - if (purify.shouldDelete) { - for (const item of purify.shouldDelete) { - delete params[item] - } - } - - // 转换之后的处理 - if (rule._post) { - params = rule._post(params) - } - - return params -} - -function createApi (ApiClass, options) { - const apiInstance = new ApiClass(options) - return new Proxy(apiInstance, { - get: function (obj, prop) { - if (typeof obj[prop] === 'function' && prop.indexOf('_') !== 0 && obj._protocols && obj._protocols[prop]) { - const protocol = obj._protocols[prop] - return async function (params) { - params = parseParams(params, protocol.args) - let result = await obj[prop](params) - result = parseParams(result, protocol.returnValue) - return result - } - } else { - return obj[prop] - } - } - }) -} - -module.exports = createApi diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/third-party/weixin/account/index.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/third-party/weixin/account/index.js deleted file mode 100644 index 7ecea84..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/third-party/weixin/account/index.js +++ /dev/null @@ -1,111 +0,0 @@ -const { - callWxOpenApi, - buildUrl -} = require('../normalize') - -module.exports = class Auth { - constructor (options) { - this.options = Object.assign({ - baseUrl: 'https://api.weixin.qq.com', - timeout: 5000 - }, options) - } - - async _requestWxOpenapi ({ name, url, data, options }) { - const defaultOptions = { - method: 'GET', - dataType: 'json', - dataAsQueryString: true, - timeout: this.options.timeout - } - const result = await callWxOpenApi({ - name: `auth.${name}`, - url: `${this.options.baseUrl}${buildUrl(url, data)}`, - data, - options, - defaultOptions - }) - return result - } - - async code2Session (code) { - const url = '/sns/jscode2session' - const result = await this._requestWxOpenapi({ - name: 'code2Session', - url, - data: { - grant_type: 'authorization_code', - appid: this.options.appId, - secret: this.options.secret, - js_code: code - } - }) - return result - } - - async getOauthAccessToken (code) { - const url = '/sns/oauth2/access_token' - const result = await this._requestWxOpenapi({ - name: 'getOauthAccessToken', - url, - data: { - grant_type: 'authorization_code', - appid: this.options.appId, - secret: this.options.secret, - code - } - }) - if (result.expiresIn) { - result.expired = Date.now() + result.expiresIn * 1000 - // delete result.expiresIn - } - return result - } - - async getUserInfo ({ - accessToken, - openid - } = {}) { - const url = '/sns/userinfo' - const { - nickname, - headimgurl: avatar - } = await this._requestWxOpenapi({ - name: 'getUserInfo', - url, - data: { - accessToken, - openid, - appid: this.options.appId, - secret: this.options.secret, - scope: 'snsapi_userinfo' - } - }) - return { - nickname, - avatar - } - } - - async getPhoneNumber (accessToken, code) { - const url = `/wxa/business/getuserphonenumber?access_token=${accessToken}` - const { phoneInfo } = await this._requestWxOpenapi({ - name: 'getPhoneNumber', - url, - data: { - code - }, - options: { - method: 'POST', - dataAsQueryString: false, - headers: { - 'content-type': 'application/json' - } - } - }) - - return { - purePhoneNumber: phoneInfo.purePhoneNumber - } - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/third-party/weixin/normalize.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/third-party/weixin/normalize.js deleted file mode 100644 index 908d916..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/third-party/weixin/normalize.js +++ /dev/null @@ -1,95 +0,0 @@ -const { - UniCloudError -} = require('../../../common/error') -const { - camel2snakeJson, snake2camelJson -} = require('../../../common/utils') - -function generateApiResult (apiName, data) { - if (data.errcode) { - throw new UniCloudError({ - code: data.errcode || -2, - message: data.errmsg || `${apiName} fail` - }) - } else { - delete data.errcode - delete data.errmsg - return { - ...data, - errMsg: `${apiName} ok`, - errCode: 0 - } - } -} - -function nomalizeError (apiName, error) { - throw new UniCloudError({ - code: error.code || -2, - message: error.message || `${apiName} fail` - }) -} - -// 微信openapi接口接收蛇形(snake case)参数返回蛇形参数,这里进行转化,如果是formdata里面的参数需要在对应api实现时就转为蛇形 -async function callWxOpenApi ({ - name, - url, - data, - options, - defaultOptions -}) { - let result = {} - // 获取二维码的接口wxacode.get和wxacode.getUnlimited不可以传入access_token(可能有其他接口也不可以),否则会返回data format error - const dataCopy = camel2snakeJson(Object.assign({}, data)) - if (dataCopy && dataCopy.access_token) { - delete dataCopy.access_token - } - try { - options = Object.assign({}, defaultOptions, options, { data: dataCopy }) - result = await uniCloud.httpclient.request(url, options) - } catch (e) { - return nomalizeError(name, e) - } - - // 有几个接口成功返回buffer失败返回json,对这些接口统一成返回buffer,然后分别解析 - let resData = result.data - const contentType = result.headers['content-type'] - if ( - Buffer.isBuffer(resData) && - (contentType.indexOf('text/plain') === 0 || - contentType.indexOf('application/json') === 0) - ) { - try { - resData = JSON.parse(resData.toString()) - } catch (e) { - resData = resData.toString() - } - } else if (Buffer.isBuffer(resData)) { - resData = { - buffer: resData, - contentType - } - } - return snake2camelJson( - generateApiResult( - name, - resData || { - errCode: -2, - errMsg: 'Request failed' - } - ) - ) -} - -function buildUrl (url, data) { - let query = '' - if (data && data.accessToken) { - const divider = url.indexOf('?') > -1 ? '&' : '?' - query = `${divider}access_token=${data.accessToken}` - } - return `${url}${query}` -} - -module.exports = { - callWxOpenApi, - buildUrl -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/third-party/weixin/utils.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/third-party/weixin/utils.js deleted file mode 100644 index c141016..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/third-party/weixin/utils.js +++ /dev/null @@ -1,87 +0,0 @@ -const crypto = require('crypto') -const { - isPlainObject -} = require('../../../common/utils') - -// 退款通知解密key=md5(key) -function decryptData (encryptedData, key, iv = '') { - // 解密 - const decipher = crypto.createDecipheriv('aes-128-cbc', key, iv) - // 设置自动 padding 为 true,删除填充补位 - decipher.setAutoPadding(true) - let decoded = decipher.update(encryptedData, 'base64', 'utf8') - decoded += decipher.final('utf8') - return decoded -} - -function md5 (str, encoding = 'utf8') { - return crypto - .createHash('md5') - .update(str, encoding) - .digest('hex') -} - -function sha256 (str, key, encoding = 'utf8') { - return crypto - .createHmac('sha256', key) - .update(str, encoding) - .digest('hex') -} - -function getSignStr (obj) { - return Object.keys(obj) - .filter(key => key !== 'sign' && obj[key] !== undefined && obj[key] !== '') - .sort() - .map(key => key + '=' + obj[key]) - .join('&') -} - -function getNonceStr (length = 16) { - let str = '' - while (str.length < length) { - str += Math.random().toString(32).substring(2) - } - return str.substring(0, length) -} - -// 简易版Object转XML,只可在微信支付时使用,不支持嵌套 -function buildXML (obj, rootName = 'xml') { - const content = Object.keys(obj).map(item => { - if (isPlainObject(obj[item])) { - return `<${item}>` - } else { - return `<${item}>` - } - }) - return `<${rootName}>${content.join('')}` -} - -function isXML (str) { - const reg = /^(<\?xml.*\?>)?(\r?\n)*(.|\r?\n)*<\/xml>$/i - return reg.test(str.trim()) -}; - -// 简易版XML转Object,只可在微信支付时使用,不支持嵌套 -function parseXML (xml) { - const xmlReg = /<(?:xml|root).*?>([\s|\S]*)<\/(?:xml|root)>/ - const str = xmlReg.exec(xml)[1] - const obj = {} - const nodeReg = /<(.*?)>(?:){0,1}<\/.*?>/g - let matches = null - // eslint-disable-next-line no-cond-assign - while ((matches = nodeReg.exec(str))) { - obj[matches[1]] = matches[2] - } - return obj -} - -module.exports = { - decryptData, - md5, - sha256, - getSignStr, - getNonceStr, - buildXML, - parseXML, - isXML -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/account.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/account.js deleted file mode 100644 index 1fd25f0..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/account.js +++ /dev/null @@ -1,98 +0,0 @@ -const { - dbCmd, - userCollection -} = require('../../common/constants') -const { - USER_IDENTIFIER -} = require('../../common/constants') -const { - batchFindObjctValue, - getType, - isMatchUserApp -} = require('../../common/utils') - -/** - * 查询满足条件的用户 - * @param {Object} params - * @param {Object} params.userQuery 用户唯一标识组成的查询条件 - * @param {Object} params.authorizedApp 用户允许登录的应用 - * @returns userMatched 满足条件的用户列表 - */ -async function findUser (params = {}) { - const { - userQuery, - authorizedApp = [] - } = params - const condition = getUserQueryCondition(userQuery) - if (condition.length === 0) { - throw new Error('Invalid user query') - } - const authorizedAppType = getType(authorizedApp) - if (authorizedAppType !== 'string' && authorizedAppType !== 'array') { - throw new Error('Invalid authorized app') - } - - let finalQuery - - if (condition.length === 1) { - finalQuery = condition[0] - } else { - finalQuery = dbCmd.or(condition) - } - const userQueryRes = await userCollection.where(finalQuery).get() - return { - total: userQueryRes.data.length, - userMatched: userQueryRes.data.filter(item => { - return isMatchUserApp(item.dcloud_appid, authorizedApp) - }) - } -} - -function getUserIdentifier (userRecord = {}) { - const keys = Object.keys(USER_IDENTIFIER) - return batchFindObjctValue(userRecord, keys) -} - -function getUserQueryCondition (userRecord = {}) { - const userIdentifier = getUserIdentifier(userRecord) - const condition = [] - for (const key in userIdentifier) { - const value = userIdentifier[key] - if (!value) { - // 过滤所有value为假值的条件,在查询用户时没有意义 - continue - } - const queryItem = { - [key]: value - } - // 为兼容用户老数据用户名及邮箱需要同时查小写及原始大小写数据 - if (key === 'mobile') { - queryItem.mobile_confirmed = 1 - } else if (key === 'email') { - queryItem.email_confirmed = 1 - const email = userIdentifier.email - if (email.toLowerCase() !== email) { - condition.push({ - email: email.toLowerCase(), - email_confirmed: 1 - }) - } - } else if (key === 'username') { - const username = userIdentifier.username - if (username.toLowerCase() !== username) { - condition.push({ - username: username.toLowerCase() - }) - } - } else if (key === 'identities') { - queryItem.identities = dbCmd.elemMatch(value) - } - condition.push(queryItem) - } - return condition -} - -module.exports = { - findUser, - getUserIdentifier -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/captcha.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/captcha.js deleted file mode 100644 index 0dd620e..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/captcha.js +++ /dev/null @@ -1,76 +0,0 @@ -const { - ERROR -} = require('../../common/error') - -async function getNeedCaptcha ({ - uid, - username, - mobile, - email, - type = 'login', - limitDuration = 7200000, // 两小时 - limitTimes = 3 // 记录次数 -} = {}) { - const db = uniCloud.database() - const dbCmd = db.command - // 当用户最近“2小时内(limitDuration)”登录失败达到3次(limitTimes)时。要求用户提交验证码 - const now = Date.now() - const uniIdLogCollection = db.collection('uni-id-log') - const userIdentifier = { - user_id: uid, - username, - mobile, - email - } - - let totalKey = 0; let deleteKey = 0 - for (const key in userIdentifier) { - totalKey++ - if (!userIdentifier[key] || typeof userIdentifier[key] !== 'string') { - deleteKey++ - delete userIdentifier[key] - } - } - - if (deleteKey === totalKey) { - throw new Error('System error') // 正常情况下不会进入此条件,但是考虑到后续会有其他开发者修改此云对象,在此处做一个判断 - } - - const { - data: recentRecord - } = await uniIdLogCollection.where({ - ip: this.getUniversalClientInfo().clientIP, - ...userIdentifier, - type, - create_date: dbCmd.gt(now - limitDuration) - }) - .orderBy('create_date', 'desc') - .limit(limitTimes) - .get() - return recentRecord.length === limitTimes && recentRecord.every(item => item.state === 0) -} - -async function verifyCaptcha (params = {}) { - const { - captcha, - scene - } = params - if (!captcha) { - throw { - errCode: ERROR.CAPTCHA_REQUIRED - } - } - const payload = await this.uniCaptcha.verify({ - deviceId: this.getUniversalClientInfo().deviceId, - captcha, - scene - }) - if (payload.errCode) { - throw payload - } -} - -module.exports = { - getNeedCaptcha, - verifyCaptcha -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/config.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/config.js deleted file mode 100644 index 5526081..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/config.js +++ /dev/null @@ -1,137 +0,0 @@ -const { - getWeixinPlatform -} = require('./weixin') -const createConfig = require('uni-config-center') - -const requiredConfig = { - 'web.weixin-h5': ['appid', 'appsecret'], - 'web.weixin-web': ['appid', 'appsecret'], - 'app.weixin': ['appid', 'appsecret'], - 'mp-weixin.weixin': ['appid', 'appsecret'], - 'app.qq': ['appid', 'appsecret'], - 'mp-alipay.alipay': ['appid', 'privateKey'], - 'app.apple': ['bundleId'] -} - -const uniIdConfig = createConfig({ - pluginId: 'uni-id' -}) - -class ConfigUtils { - constructor({ - context - } = {}) { - this.context = context - this.clientInfo = context.getUniversalClientInfo() - const { - appId, - uniPlatform - } = this.clientInfo - this.appId = appId - switch (uniPlatform) { - case 'app': - case 'app-plus': - case 'app-android': - case 'app-ios': - this.platform = 'app' - break - case 'web': - case 'h5': - this.platform = 'web' - break - default: - this.platform = uniPlatform - break - } - } - - getConfigArray() { - let configContent - try { - configContent = require('uni-config-center/uni-id/config.json') - } catch (error) { - throw new Error('Invalid config file\n' + error.message) - } - if (configContent[0]) { - return Object.values(configContent) - } - configContent.isDefaultConfig = true - return [configContent] - } - - getAppConfig() { - const configArray = this.getConfigArray() - return configArray.find(item => item.dcloudAppid === this.appId) || configArray.find(item => item.isDefaultConfig) - } - - getPlatformConfig() { - const appConfig = this.getAppConfig() - if (!appConfig) { - throw new Error( - `Config for current app (${this.appId}) was not found, please check your config file or client appId`) - } - const platform = this.platform - if ( - (this.platform === 'app' && appConfig['app-plus']) || - (this.platform === 'web' && appConfig.h5) - ) { - throw new Error( - `Client platform is ${this.platform}, but ${this.platform === 'web' ? 'h5' : 'app-plus'} was found in config. Please refer to: https://uniapp.dcloud.net.cn/uniCloud/uni-id-summary?id=m-to-co` - ) - } - - const defaultConfig = { - tokenExpiresIn: 7200, - tokenExpiresThreshold: 1200, - passwordErrorLimit: 6, - passwordErrorRetryTime: 3600 - } - return Object.assign(defaultConfig, appConfig, appConfig[platform]) - } - - getOauthProvider({ - provider - } = {}) { - const clientPlatform = this.platform - let oatuhProivder = provider - if (provider === 'weixin' && clientPlatform === 'web') { - const weixinPlatform = getWeixinPlatform.call(this.context) - if (weixinPlatform === 'h5' || weixinPlatform === 'web') { - oatuhProivder = 'weixin-' + weixinPlatform // weixin-h5 公众号,weixin-web pc端 - } - } - return oatuhProivder - } - - getOauthConfig({ - provider - } = {}) { - const config = this.getPlatformConfig() - const clientPlatform = this.platform - const oatuhProivder = this.getOauthProvider({ - provider - }) - const requireConfigKey = requiredConfig[`${clientPlatform}.${oatuhProivder}`] || [] - if (!config.oauth || !config.oauth[oatuhProivder]) { - throw new Error(`Config param required: ${clientPlatform}.oauth.${oatuhProivder}`) - } - const oauthConfig = config.oauth[oatuhProivder] - requireConfigKey.forEach((item) => { - if (!oauthConfig[item]) { - throw new Error(`Config param required: ${clientPlatform}.oauth.${oatuhProivder}.${item}`) - } - }) - return oauthConfig - } - - getHooks() { - if (uniIdConfig.hasFile('hooks/index.js')) { - return require( - uniIdConfig.resolve('hooks/index.js') - ) - } - return {} - } -} - -module.exports = ConfigUtils \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/fission.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/fission.js deleted file mode 100644 index 84233c3..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/fission.js +++ /dev/null @@ -1,192 +0,0 @@ -const { - dbCmd, - userCollection -} = require('../../common/constants') -const { - ERROR -} = require('../../common/error') -/** - * 获取随机邀请码,邀请码由大写字母加数字组成,由于存在手动输入邀请码的场景,从可选字符中去除 0、1、I、O - * @param {number} len 邀请码长度,默认6位 - * @returns {string} 随机邀请码 - */ -function getRandomInviteCode (len = 6) { - const charArr = ['2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] - let code = '' - for (let i = 0; i < len; i++) { - code += charArr[Math.floor(Math.random() * charArr.length)] - } - return code -} - -/** - * 获取可用的邀请码,至多尝试十次以获取可用邀请码。从10亿可选值中随机,碰撞概率较低 - * 也有其他方案可以尝试,比如在数据库内设置一个从0开始计数的数字,每次调用此方法时使用updateAndReturn使数字加1并返回加1后的值,根据这个值生成对应的邀请码,比如(22222A + 1 == 22222B),此方式性能理论更好,但是不适用于旧项目 - * @param {object} param - * @param {string} param.inviteCode 初始随机邀请码 - */ -async function getValidInviteCode () { - let retry = 10 - let code - let codeValid = false - while (retry > 0 && !codeValid) { - retry-- - code = getRandomInviteCode() - const getUserRes = await userCollection.where({ - my_invite_code: code - }).limit(1).get() - if (getUserRes.data.length === 0) { - codeValid = true - break - } - } - if (!codeValid) { - throw { - errCode: ERROR.SET_INVITE_CODE_FAILED - } - } - return code -} - -/** - * 根据邀请码查询邀请人 - * @param {object} param - * @param {string} param.inviteCode 邀请码 - * @param {string} param.queryUid 受邀人id,非空时校验不可被下家或自己邀请 - * @returns - */ -async function findUserByInviteCode ({ - inviteCode, - queryUid -} = {}) { - if (typeof inviteCode !== 'string') { - throw { - errCode: ERROR.SYSTEM_ERROR - } - } - // 根据邀请码查询邀请人 - let getInviterRes - if (queryUid) { - getInviterRes = await userCollection.where({ - _id: dbCmd.neq(queryUid), - inviter_uid: dbCmd.not(dbCmd.all([queryUid])), - my_invite_code: inviteCode - }).get() - } else { - getInviterRes = await userCollection.where({ - my_invite_code: inviteCode - }).get() - } - if (getInviterRes.data.length > 1) { - // 正常情况下不可能进入此条件,以防用户自行修改数据库出错,在此做出判断 - throw { - errCode: ERROR.SYSTEM_ERROR - } - } - const inviterRecord = getInviterRes.data[0] - if (!inviterRecord) { - throw { - errCode: ERROR.INVALID_INVITE_CODE - } - } - return inviterRecord -} - -/** - * 根据邀请码生成邀请信息 - * @param {object} param - * @param {string} param.inviteCode 邀请码 - * @param {string} param.queryUid 受邀人id,非空时校验不可被下家或自己邀请 - * @returns - */ -async function generateInviteInfo ({ - inviteCode, - queryUid -} = {}) { - const inviterRecord = await findUserByInviteCode({ - inviteCode, - queryUid - }) - // 倒叙拼接当前用户邀请链 - const inviterUid = inviterRecord.inviter_uid || [] - inviterUid.unshift(inviterRecord._id) - return { - inviterUid, - inviteTime: Date.now() - } -} - -/** - * 检查当前用户是否可以接受邀请,如果可以返回用户记录 - * @param {string} uid - */ -async function checkInviteInfo (uid) { - // 检查当前用户是否已有邀请人 - const getUserRes = await userCollection.doc(uid).field({ - my_invite_code: true, - inviter_uid: true - }).get() - const userRecord = getUserRes.data[0] - if (!userRecord) { - throw { - errCode: ERROR.ACCOUNT_NOT_EXISTS - } - } - if (userRecord.inviter_uid && userRecord.inviter_uid.length > 0) { - throw { - errCode: ERROR.CHANGE_INVITER_FORBIDDEN - } - } - return userRecord -} - -/** - * 指定用户接受邀请码邀请 - * @param {object} param - * @param {string} param.uid 用户uid - * @param {string} param.inviteCode 邀请人的邀请码 - * @returns - */ -async function acceptInvite ({ - uid, - inviteCode -} = {}) { - await checkInviteInfo(uid) - const { - inviterUid, - inviteTime - } = await generateInviteInfo({ - inviteCode, - queryUid: uid - }) - - if (inviterUid === uid) { - throw { - errCode: ERROR.INVALID_INVITE_CODE - } - } - - // 更新当前用户的邀请人信息 - await userCollection.doc(uid).update({ - inviter_uid: inviterUid, - invite_time: inviteTime - }) - - // 更新当前用户邀请的用户的邀请人信息,这步可能较为耗时 - await userCollection.where({ - inviter_uid: uid - }).update({ - inviter_uid: dbCmd.push(inviterUid) - }) - - return { - errCode: 0, - errMsg: '' - } -} - -module.exports = { - acceptInvite, - generateInviteInfo, - getValidInviteCode -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/login.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/login.js deleted file mode 100644 index ea8532d..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/login.js +++ /dev/null @@ -1,246 +0,0 @@ -const { - findUser -} = require('./account') -const { - userCollection, - LOG_TYPE -} = require('../../common/constants') -const { - ERROR -} = require('../../common/error') -const { - logout -} = require('./logout') -const PasswordUtils = require('./password') - -async function realPreLogin (params = {}) { - const { - user - } = params - const appId = this.getUniversalClientInfo().appId - const { - total, - userMatched - } = await findUser({ - userQuery: user, - authorizedApp: appId - }) - if (userMatched.length === 0) { - if (total > 0) { - throw { - errCode: ERROR.ACCOUNT_NOT_EXISTS_IN_CURRENT_APP - } - } - throw { - errCode: ERROR.ACCOUNT_NOT_EXISTS - } - } else if (userMatched.length > 1) { - throw { - errCode: ERROR.ACCOUNT_CONFLICT - } - } - const userRecord = userMatched[0] - checkLoginUserRecord(userRecord) - return userRecord -} - -async function preLogin (params = {}) { - const { - user - } = params - try { - const user = await realPreLogin.call(this, params) - return user - } catch (error) { - await this.middleware.uniIdLog({ - success: false, - data: user, - type: LOG_TYPE.LOGIN - }) - throw error - } -} - -async function preLoginWithPassword (params = {}) { - const { - user, - password - } = params - try { - const userRecord = await realPreLogin.call(this, params) - const { - passwordErrorLimit, - passwordErrorRetryTime - } = this.config - const { - clientIP - } = this.getUniversalClientInfo() - // 根据ip地址,密码错误次数过多,锁定登录 - let loginIPLimit = userRecord.login_ip_limit || [] - // 清理无用记录 - loginIPLimit = loginIPLimit.filter(item => item.last_error_time > Date.now() - passwordErrorRetryTime * 1000) - let currentIPLimit = loginIPLimit.find(item => item.ip === clientIP) - if (currentIPLimit && currentIPLimit.error_times >= passwordErrorLimit) { - throw { - errCode: ERROR.PASSWORD_ERROR_EXCEED_LIMIT - } - } - const passwordUtils = new PasswordUtils({ - userRecord, - clientInfo: this.getUniversalClientInfo(), - passwordSecret: this.config.passwordSecret - }) - - const { - success: checkPasswordSuccess, - refreshPasswordInfo - } = passwordUtils.checkUserPassword({ - password - }) - if (!checkPasswordSuccess) { - // 更新用户ip对应的密码错误记录 - if (!currentIPLimit) { - currentIPLimit = { - ip: clientIP, - error_times: 1, - last_error_time: Date.now() - } - loginIPLimit.push(currentIPLimit) - } else { - currentIPLimit.error_times++ - currentIPLimit.last_error_time = Date.now() - } - await userCollection.doc(userRecord._id).update({ - login_ip_limit: loginIPLimit - }) - throw { - errCode: ERROR.PASSWORD_ERROR - } - } - const extraData = {} - if (refreshPasswordInfo) { - extraData.password = refreshPasswordInfo.passwordHash - extraData.password_secret_version = refreshPasswordInfo.version - } - - const currentIPLimitIndex = loginIPLimit.indexOf(currentIPLimit) - if (currentIPLimitIndex > -1) { - loginIPLimit.splice(currentIPLimitIndex, 1) - } - extraData.login_ip_limit = loginIPLimit - return { - user: userRecord, - extraData - } - } catch (error) { - await this.middleware.uniIdLog({ - success: false, - data: user, - type: LOG_TYPE.LOGIN - }) - throw error - } -} - -function checkLoginUserRecord (user) { - switch (user.status) { - case undefined: - case 0: - break - case 1: - throw { - errCode: ERROR.ACCOUNT_BANNED - } - case 2: - throw { - errCode: ERROR.ACCOUNT_AUDITING - } - case 3: - throw { - errCode: ERROR.ACCOUNT_AUDIT_FAILED - } - case 4: - throw { - errCode: ERROR.ACCOUNT_CLOSED - } - default: - break - } -} - -async function thirdPartyLogin (params = {}) { - const { - user - } = params - return { - mobileConfirmed: !!user.mobile_confirmed, - emailConfirmed: !!user.email_confirmed - } -} - -async function postLogin (params = {}) { - const { - user, - extraData, - isThirdParty = false - } = params - const { - clientIP - } = this.getUniversalClientInfo() - const uniIdToken = this.getUniversalUniIdToken() - const uid = user._id - const updateData = { - last_login_date: Date.now(), - last_login_ip: clientIP, - ...extraData - } - const createTokenRes = await this.uniIdCommon.createToken({ - uid - }) - - const { - errCode, - token, - tokenExpired - } = createTokenRes - if (errCode) { - throw createTokenRes - } - - if (uniIdToken) { - try { - await logout.call(this) - } catch (error) {} - } - - await userCollection.doc(uid).update(updateData) - await this.middleware.uniIdLog({ - data: { - user_id: uid - }, - type: LOG_TYPE.LOGIN - }) - return { - errCode: 0, - newToken: { - token, - tokenExpired - }, - uid, - ...( - isThirdParty - ? thirdPartyLogin({ - user - }) - : {} - ), - passwordConfirmed: !!user.password - } -} - -module.exports = { - preLogin, - postLogin, - checkLoginUserRecord, - preLoginWithPassword -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/logout.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/logout.js deleted file mode 100644 index ddcbb97..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/logout.js +++ /dev/null @@ -1,49 +0,0 @@ -const { - dbCmd, - LOG_TYPE, - deviceCollection, - userCollection -} = require('../../common/constants') - -async function logout () { - const { - deviceId - } = this.getUniversalClientInfo() - const uniIdToken = this.getUniversalUniIdToken() - const payload = await this.uniIdCommon.checkToken( - uniIdToken, - { - autoRefresh: false - } - ) - if (payload.errCode) { - throw payload - } - const uid = payload.uid - - // 删除token - await userCollection.doc(uid).update({ - token: dbCmd.pull(uniIdToken) - }) - - // 仅当device表的device_id和user_id均对应时才进行更新 - await deviceCollection.where({ - device_id: deviceId, - user_id: uid - }).update({ - token_expired: 0 - }) - await this.middleware.uniIdLog({ - data: { - user_id: uid - }, - type: LOG_TYPE.LOGOUT - }) - return { - errCode: 0 - } -} - -module.exports = { - logout -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/password.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/password.js deleted file mode 100644 index 0e46757..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/password.js +++ /dev/null @@ -1,261 +0,0 @@ -const { - getType -} = require('../../common/utils') -const crypto = require('crypto') -const createConfig = require('uni-config-center') -const shareConfig = createConfig({ - pluginId: 'uni-id' -}) -let customPassword = {} -if (shareConfig.hasFile('custom-password.js')) { - customPassword = shareConfig.requireFile('custom-password.js') || {} -} - -const passwordAlgorithmMap = { - UNI_ID_HMAC_SHA1: 'hmac-sha1', - UNI_ID_HMAC_SHA256: 'hmac-sha256', - UNI_ID_CUSTOM: 'custom' -} - -const passwordAlgorithmKeyMap = Object.keys(passwordAlgorithmMap).reduce((res, item) => { - res[passwordAlgorithmMap[item]] = item - return res -}, {}) - -const passwordExtMethod = { - [passwordAlgorithmMap.UNI_ID_HMAC_SHA1]: { - verify ({ password }) { - const { password_secret_version: passwordSecretVersion } = this.userRecord - - const passwordSecret = this._getSecretByVersion({ - version: passwordSecretVersion - }) - - const { passwordHash } = this.encrypt({ - password, - passwordSecret - }) - - return passwordHash === this.userRecord.password - }, - encrypt ({ password, passwordSecret }) { - const { value: secret, version } = passwordSecret - const hmac = crypto.createHmac('sha1', secret.toString('ascii')) - - hmac.update(password) - - return { - passwordHash: hmac.digest('hex'), - version - } - } - }, - [passwordAlgorithmMap.UNI_ID_HMAC_SHA256]: { - verify ({ password }) { - const parse = this._parsePassword() - const passwordHash = crypto.createHmac(parse.algorithm, parse.salt).update(password).digest('hex') - - return passwordHash === parse.hash - }, - encrypt ({ password, passwordSecret }) { - const { version } = passwordSecret - - // 默认使用 sha256 加密算法 - const salt = crypto.randomBytes(10).toString('hex') - const sha256Hash = crypto.createHmac(passwordAlgorithmMap.UNI_ID_HMAC_SHA256.substring(5), salt).update(password).digest('hex') - const algorithm = passwordAlgorithmKeyMap[passwordAlgorithmMap.UNI_ID_HMAC_SHA256] - // B 为固定值,对应 PasswordMethodMaps 中的 sha256算法 - // hash 格式 $[PasswordMethodFlagMapsKey]$[salt size]$[salt][Hash] - const passwordHash = `$${algorithm}$${salt.length}$${salt}${sha256Hash}` - - return { - passwordHash, - version - } - } - }, - [passwordAlgorithmMap.UNI_ID_CUSTOM]: { - verify ({ password, passwordSecret }) { - if (!customPassword.verifyPassword) throw new Error('verifyPassword method not found in custom password file') - - // return true or false - return customPassword.verifyPassword({ - password, - passwordSecret, - userRecord: this.userRecord, - clientInfo: this.clientInfo - }) - }, - encrypt ({ password, passwordSecret }) { - if (!customPassword.encryptPassword) throw new Error('encryptPassword method not found in custom password file') - - // return object<{passwordHash: string, version: number}> - return customPassword.encryptPassword({ - password, - passwordSecret, - clientInfo: this.clientInfo - }) - } - } -} - -class PasswordUtils { - constructor ({ - userRecord = {}, - clientInfo, - passwordSecret - } = {}) { - if (!clientInfo) throw new Error('Invalid clientInfo') - if (!passwordSecret) throw new Error('Invalid password secret') - - this.clientInfo = clientInfo - this.userRecord = userRecord - this.passwordSecret = this.prePasswordSecret(passwordSecret) - } - - /** - * passwordSecret 预处理 - * @param passwordSecret - * @return {*[]} - */ - prePasswordSecret (passwordSecret) { - const newPasswordSecret = [] - if (getType(passwordSecret) === 'string') { - newPasswordSecret.push({ - value: passwordSecret, - type: passwordAlgorithmMap.UNI_ID_HMAC_SHA1 - }) - } else if (getType(passwordSecret) === 'array') { - for (const secret of passwordSecret.sort((a, b) => a.version - b.version)) { - newPasswordSecret.push({ - ...secret, - // 没有 type 设置默认 type hmac-sha1 - type: secret.type || passwordAlgorithmMap.UNI_ID_HMAC_SHA1 - }) - } - } else { - throw new Error('Invalid password secret') - } - - return newPasswordSecret - } - - /** - * 获取最新加密密钥 - * @return {*} - * @private - */ - _getLastestSecret () { - return this.passwordSecret[this.passwordSecret.length - 1] - } - - _getOldestSecret () { - return this.passwordSecret[0] - } - - _getSecretByVersion ({ version } = {}) { - if (!version && version !== 0) { - return this._getOldestSecret() - } - if (this.passwordSecret.length === 1) { - return this.passwordSecret[0] - } - return this.passwordSecret.find(item => item.version === version) - } - - /** - * 获取密码的验证/加密方法 - * @param passwordSecret - * @return {*[]} - * @private - */ - _getPasswordExt (passwordSecret) { - const ext = passwordExtMethod[passwordSecret.type] - if (!ext) { - throw new Error(`暂不支持 ${passwordSecret.type} 类型的加密算法`) - } - - const passwordExt = Object.create(null) - - for (const key in ext) { - passwordExt[key] = ext[key].bind(Object.assign(this, Object.keys(ext).reduce((res, item) => { - if (item !== key) { - res[item] = ext[item].bind(this) - } - return res - }, {}))) - } - - return passwordExt - } - - _parsePassword () { - const [algorithmKey = '', cost = 0, hashStr = ''] = this.userRecord.password.split('$').filter(key => key) - const algorithm = passwordAlgorithmMap[algorithmKey] ? passwordAlgorithmMap[algorithmKey].substring(5) : null - const salt = hashStr.substring(0, Number(cost)) - const hash = hashStr.substring(Number(cost)) - - return { - algorithm, - salt, - hash - } - } - - /** - * 生成加密后的密码 - * @param {String} password 密码 - */ - generatePasswordHash ({ password }) { - if (!password) throw new Error('Invalid password') - - const passwordSecret = this._getLastestSecret() - const ext = this._getPasswordExt(passwordSecret) - - const { passwordHash, version } = ext.encrypt({ - password, - passwordSecret - }) - - return { - passwordHash, - version - } - } - - /** - * 密码校验 - * @param {String} password - * @param {Boolean} autoRefresh - * @return {{refreshPasswordInfo: {version: *, passwordHash: *}, success: boolean}|{success: boolean}} - */ - checkUserPassword ({ password, autoRefresh = true }) { - if (!password) throw new Error('Invalid password') - - const { password_secret_version: passwordSecretVersion } = this.userRecord - const passwordSecret = this._getSecretByVersion({ - version: passwordSecretVersion - }) - const ext = this._getPasswordExt(passwordSecret) - - const success = ext.verify({ password, passwordSecret }) - - if (!success) { - return { - success: false - } - } - - let refreshPasswordInfo - if (autoRefresh && passwordSecretVersion !== this._getLastestSecret().version) { - refreshPasswordInfo = this.generatePasswordHash({ password }) - } - - return { - success: true, - refreshPasswordInfo - } - } -} - -module.exports = PasswordUtils diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/qq.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/qq.js deleted file mode 100644 index 5a73218..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/qq.js +++ /dev/null @@ -1,154 +0,0 @@ -const { - userCollection -} = require('../../common/constants') -const { - ERROR -} = require('../../common/error') - -function getQQPlatform () { - const platform = this.clientPlatform - switch (platform) { - case 'app': - case 'app-plus': - case 'app-android': - case 'app-ios': - return 'app' - case 'mp-qq': - return 'mp' - default: - throw new Error('Unsupported qq platform') - } -} - -async function saveQQUserKey ({ - openid, - sessionKey, // QQ小程序用户sessionKey - accessToken, // App端QQ用户accessToken - accessTokenExpired // App端QQ用户accessToken过期时间 -} = {}) { - // 微信公众平台、开放平台refreshToken有效期均为30天(微信没有在网络请求里面返回30天这个值,务必注意未来可能出现调整,需及时更新此处逻辑)。 - // 此前QQ开放平台有调整过accessToken的过期时间:[access_token有效期由90天缩短至30天](https://wiki.connect.qq.com/%E3%80%90qq%E4%BA%92%E8%81%94%E3%80%91access_token%E6%9C%89%E6%95%88%E6%9C%9F%E8%B0%83%E6%95%B4) - const appId = this.getUniversalClientInfo().appId - const qqPlatform = getQQPlatform.call(this) - const keyObj = { - dcloudAppid: appId, - openid, - platform: 'qq-' + qqPlatform - } - switch (qqPlatform) { - case 'mp': - await this.uniOpenBridge.setSessionKey(keyObj, { - session_key: sessionKey - }, 30 * 24 * 60 * 60) - break - case 'app': - case 'h5': - case 'web': - await this.uniOpenBridge.setUserAccessToken(keyObj, { - access_token: accessToken, - access_token_expired: accessTokenExpired - }, accessTokenExpired - ? Math.floor((accessTokenExpired - Date.now()) / 1000) - : 30 * 24 * 60 * 60 - ) - break - default: - break - } -} - -function generateQQCache ({ - sessionKey, // QQ小程序用户sessionKey - accessToken, // App端QQ用户accessToken - accessTokenExpired // App端QQ用户accessToken过期时间 -} = {}) { - const platform = getQQPlatform.call(this) - let cache - switch (platform) { - case 'app': - cache = { - access_token: accessToken, - access_token_expired: accessTokenExpired - } - break - case 'mp': - cache = { - session_key: sessionKey - } - break - default: - throw new Error('Unsupported qq platform') - } - return { - third_party: { - [`${platform}_qq`]: cache - } - } -} - -function getQQOpenid ({ - userRecord -} = {}) { - const qqPlatform = getQQPlatform.call(this) - const appId = this.getUniversalClientInfo().appId - const qqOpenidObj = userRecord.qq_openid - if (!qqOpenidObj) { - return - } - return qqOpenidObj[`${qqPlatform}_${appId}`] || qqOpenidObj[qqPlatform] -} - -async function getQQCacheFallback ({ - userRecord, - key -} = {}) { - const platform = getQQPlatform.call(this) - const thirdParty = userRecord && userRecord.third_party - if (!thirdParty) { - return - } - const qqCache = thirdParty[`${platform}_qq`] - return qqCache && qqCache[key] -} - -async function getQQCache ({ - uid, - userRecord, - key -} = {}) { - const qqPlatform = getQQPlatform.call(this) - const appId = this.getUniversalClientInfo().appId - - if (!userRecord) { - const getUserRes = await userCollection.doc(uid).get() - userRecord = getUserRes.data[0] - } - if (!userRecord) { - throw { - errCode: ERROR.ACCOUNT_NOT_EXISTS - } - } - const openid = getQQOpenid.call(this, { - userRecord - }) - const getCacheMethod = qqPlatform === 'mp' ? 'getSessionKey' : 'getUserAccessToken' - const userKey = await this.uniOpenBridge[getCacheMethod]({ - dcloudAppid: appId, - platform: 'qq-' + qqPlatform, - openid - }) - if (userKey) { - return userKey[key] - } - return getQQCacheFallback({ - userRecord, - key - }) -} - -module.exports = { - getQQPlatform, - generateQQCache, - getQQCache, - saveQQUserKey -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/register.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/register.js deleted file mode 100644 index 0fd8641..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/register.js +++ /dev/null @@ -1,231 +0,0 @@ -const { - userCollection, - LOG_TYPE -} = require('../../common/constants') -const { - ERROR -} = require('../../common/error') -const { - findUser -} = require('./account') -const { - getValidInviteCode, - generateInviteInfo -} = require('./fission') -const { - logout -} = require('./logout') -const PasswordUtils = require('./password') -const { - merge -} = require('../npm/index') - -async function realPreRegister (params = {}) { - const { - user - } = params - const { - userMatched - } = await findUser({ - userQuery: user, - authorizedApp: this.getUniversalClientInfo().appId - }) - if (userMatched.length > 0) { - throw { - errCode: ERROR.ACCOUNT_EXISTS - } - } -} - -async function preRegister (params = {}) { - try { - await realPreRegister.call(this, params) - } catch (error) { - await this.middleware.uniIdLog({ - success: false, - type: LOG_TYPE.REGISTER - }) - throw error - } -} - -async function preRegisterWithPassword (params = {}) { - const { - user, - password - } = params - await preRegister.call(this, { - user - }) - const passwordUtils = new PasswordUtils({ - clientInfo: this.getUniversalClientInfo(), - passwordSecret: this.config.passwordSecret - }) - const { - passwordHash, - version - } = passwordUtils.generatePasswordHash({ - password - }) - const extraData = { - password: passwordHash, - password_secret_version: version - } - return { - user, - extraData - } -} - -async function thirdPartyRegister ({ - user = {} -} = {}) { - return { - mobileConfirmed: !!(user.mobile && user.mobile_confirmed) || false, - emailConfirmed: !!(user.email && user.email_confirmed) || false - } -} - -async function postRegister (params = {}) { - const { - user, - extraData = {}, - isThirdParty = false, - inviteCode - } = params - const { - appId, - appName, - appVersion, - appVersionCode, - channel, - scene, - clientIP, - osName - } = this.getUniversalClientInfo() - const uniIdToken = this.getUniversalUniIdToken() - - merge(user, extraData) - - const registerChannel = channel || scene - user.register_env = { - appid: appId || '', - uni_platform: this.clientPlatform || '', - os_name: osName || '', - app_name: appName || '', - app_version: appVersion || '', - app_version_code: appVersionCode || '', - channel: registerChannel ? registerChannel + '' : '', // channel可能为数字,统一存为字符串 - client_ip: clientIP || '' - } - - user.register_date = Date.now() - user.dcloud_appid = [appId] - - if (user.username) { - user.username = user.username.toLowerCase() - } - if (user.email) { - user.email = user.email.toLowerCase() - } - - const { - autoSetInviteCode, // 注册时自动设置邀请码 - forceInviteCode, // 必须有邀请码才允许注册,注意此逻辑不可对admin生效 - userRegisterDefaultRole // 用户注册时配置的默认角色 - } = this.config - if (autoSetInviteCode) { - user.my_invite_code = await getValidInviteCode() - } - - // 如果用户注册默认角色配置存在且不为空数组 - if (userRegisterDefaultRole && userRegisterDefaultRole.length) { - // 将用户已有的角色和配置的默认角色合并成一个数组,并去重 - user.role = Array.from(new Set([...(user.role || []), ...userRegisterDefaultRole])) - } - - const isAdmin = user.role && user.role.includes('admin') - - if (forceInviteCode && !isAdmin && !inviteCode) { - throw { - errCode: ERROR.INVALID_INVITE_CODE - } - } - - if (inviteCode) { - const { - inviterUid, - inviteTime - } = await generateInviteInfo({ - inviteCode - }) - user.inviter_uid = inviterUid - user.invite_time = inviteTime - } - - if (uniIdToken) { - try { - await logout.call(this) - } catch (error) { } - } - - const beforeRegister = this.hooks.beforeRegister - let userRecord = user - if (beforeRegister) { - userRecord = await beforeRegister({ - userRecord, - clientInfo: this.getUniversalClientInfo() - }) - } - - const { - id: uid - } = await userCollection.add(userRecord) - - const createTokenRes = await this.uniIdCommon.createToken({ - uid - }) - - const { - errCode, - token, - tokenExpired - } = createTokenRes - - if (errCode) { - throw createTokenRes - } - - await this.middleware.uniIdLog({ - data: { - user_id: uid - }, - type: LOG_TYPE.REGISTER - }) - - return { - errCode: 0, - uid, - newToken: { - token, - tokenExpired - }, - ...( - isThirdParty - ? thirdPartyRegister({ - user: { - ...userRecord, - _id: uid - } - }) - : {} - ), - passwordConfirmed: !!userRecord.password - } -} - -module.exports = { - preRegister, - preRegisterWithPassword, - postRegister -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/relate.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/relate.js deleted file mode 100644 index f855422..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/relate.js +++ /dev/null @@ -1,166 +0,0 @@ -const { - findUser -} = require('./account') -const { - ERROR -} = require('../../common/error') -const { - userCollection, dbCmd, USER_IDENTIFIER -} = require('../../common/constants') -const { - getUserIdentifier -} = require('../../lib/utils/account') - -const { - batchFindObjctValue -} = require('../../common/utils') -const { - merge -} = require('../npm/index') - -/** - * - * @param {object} param - * @param {string} param.uid 用户id - * @param {string} param.bindAccount 要绑定的三方账户、手机号或邮箱 - */ -async function preBind ({ - uid, - bindAccount, - logType -} = {}) { - const { - userMatched - } = await findUser({ - userQuery: bindAccount, - authorizedApp: this.getUniversalClientInfo().appId - }) - if (userMatched.length > 0) { - await this.middleware.uniIdLog({ - data: { - user_id: uid - }, - type: logType, - success: false - }) - throw { - errCode: ERROR.BIND_CONFLICT - } - } -} - -async function postBind ({ - uid, - extraData = {}, - bindAccount, - logType -} = {}) { - await userCollection.doc(uid).update(merge(bindAccount, extraData)) - await this.middleware.uniIdLog({ - data: { - user_id: uid - }, - type: logType - }) - return { - errCode: 0 - } -} - -async function preUnBind ({ - uid, - unBindAccount, - logType -}) { - const notUnBind = ['username', 'mobile', 'email'] - const userIdentifier = getUserIdentifier(unBindAccount) - const condition = Object.keys(userIdentifier).reduce((res, key) => { - if (userIdentifier[key]) { - if (notUnBind.includes(key)) { - throw { - errCode: ERROR.UNBIND_NOT_SUPPORTED - } - } - - res.push({ - [key]: userIdentifier[key] - }) - } - - return res - }, []) - const currentUnBindAccount = Object.keys(userIdentifier).reduce((res, key) => { - if (userIdentifier[key]) { - res.push(key) - } - return res - }, []) - const { data: users } = await userCollection.where(dbCmd.and( - { _id: uid }, - dbCmd.or(condition) - )).get() - - if (users.length <= 0) { - await this.middleware.uniIdLog({ - data: { - user_id: uid - }, - type: logType, - success: false - }) - throw { - errCode: ERROR.UNBIND_FAIL - } - } - - const [user] = users - const otherAccounts = batchFindObjctValue(user, Object.keys(USER_IDENTIFIER).filter(key => !notUnBind.includes(key) && !currentUnBindAccount.includes(key))) - let hasOtherAccountBind = false - - for (const key in otherAccounts) { - if (otherAccounts[key]) { - hasOtherAccountBind = true - break - } - } - - // 如果没有其他第三方登录方式 - if (!hasOtherAccountBind) { - // 存在用户名或者邮箱但是没有设置过没密码就提示设置密码 - if ((user.username || user.email) && !user.password) { - throw { - errCode: ERROR.UNBIND_PASSWORD_NOT_EXISTS - } - } - // 账号任何登录方式都没有就优先绑定手机号 - if (!user.mobile) { - throw { - errCode: ERROR.UNBIND_MOBILE_NOT_EXISTS - } - } - } -} - -async function postUnBind ({ - uid, - unBindAccount, - logType -}) { - await userCollection.doc(uid).update(unBindAccount) - await this.middleware.uniIdLog({ - data: { - user_id: uid - }, - type: logType - }) - return { - errCode: 0 - } -} - -module.exports = { - preBind, - postBind, - preUnBind, - postUnBind -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/sms.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/sms.js deleted file mode 100644 index ae9b7af..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/sms.js +++ /dev/null @@ -1,79 +0,0 @@ -const { - setMobileVerifyCode -} = require('./verify-code') -const { - getVerifyCode -} = require('../../common/utils') - -/** - * 发送短信 - * @param {object} param - * @param {string} param.mobile 手机号 - * @param {object} param.code 可选,验证码 - * @param {object} param.scene 短信场景 - * @param {object} param.templateId 可选,短信模板id - * @returns - */ -async function sendSmsCode ({ - mobile, - code, - scene, - templateId -} = {}) { - const requiredParams = [ - 'name', - 'codeExpiresIn' - ] - const smsConfig = (this.config.service && this.config.service.sms) || {} - for (let i = 0; i < requiredParams.length; i++) { - const key = requiredParams[i] - if (!smsConfig[key]) { - throw new Error(`Missing config param: service.sms.${key}`) - } - } - if (!code) { - code = getVerifyCode() - } - let action - switch (scene) { - case 'login-by-sms': - action = this.t('login') - break - default: - action = this.t('verify-mobile') - break - } - const sceneConfig = (smsConfig.scene || {})[scene] || {} - if (!templateId) { - templateId = sceneConfig.templateId - } - if (!templateId) { - throw new Error('"templateId" is required') - } - const codeExpiresIn = sceneConfig.codeExpiresIn || smsConfig.codeExpiresIn - await setMobileVerifyCode.call(this, { - mobile, - code, - expiresIn: codeExpiresIn, - scene - }) - await uniCloud.sendSms({ - smsKey: smsConfig.smsKey, - smsSecret: smsConfig.smsSecret, - phone: mobile, - templateId, - data: { - name: smsConfig.name, - code, - action, - expMinute: '' + Math.round(codeExpiresIn / 60) - } - }) - return { - errCode: 0 - } -} - -module.exports = { - sendSmsCode -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/unified-login.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/unified-login.js deleted file mode 100644 index eac7a51..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/unified-login.js +++ /dev/null @@ -1,106 +0,0 @@ -const { - checkLoginUserRecord, - postLogin -} = require('./login') -const { - postRegister -} = require('./register') -const { - findUser -} = require('./account') -const { - ERROR -} = require('../../common/error') - -async function realPreUnifiedLogin (params = {}) { - const { - user, - type - } = params - const appId = this.getUniversalClientInfo().appId - const { - total, - userMatched - } = await findUser({ - userQuery: user, - authorizedApp: appId - }) - if (userMatched.length === 0) { - if (type === 'login') { - if (total > 0) { - throw { - errCode: ERROR.ACCOUNT_NOT_EXISTS_IN_CURRENT_APP - } - } - throw { - errCode: ERROR.ACCOUNT_NOT_EXISTS - } - } - return { - type: 'register', - user - } - } if (userMatched.length === 1) { - if (type === 'register') { - throw { - errCode: ERROR.ACCOUNT_EXISTS - } - } - const userRecord = userMatched[0] - checkLoginUserRecord(userRecord) - return { - type: 'login', - user: userRecord - } - } else if (userMatched.length > 1) { - throw { - errCode: ERROR.ACCOUNT_CONFLICT - } - } -} - -async function preUnifiedLogin (params = {}) { - try { - const result = await realPreUnifiedLogin.call(this, params) - return result - } catch (error) { - await this.middleware.uniIdLog({ - success: false - }) - throw error - } -} - -async function postUnifiedLogin (params = {}) { - const { - user, - extraData = {}, - isThirdParty = false, - type, - inviteCode - } = params - let result - if (type === 'login') { - result = await postLogin.call(this, { - user, - extraData, - isThirdParty - }) - } else if (type === 'register') { - result = await postRegister.call(this, { - user, - extraData, - isThirdParty, - inviteCode - }) - } - return { - ...result, - type - } -} - -module.exports = { - preUnifiedLogin, - postUnifiedLogin -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/univerify.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/univerify.js deleted file mode 100644 index b64bef9..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/univerify.js +++ /dev/null @@ -1,27 +0,0 @@ -async function getPhoneNumber ({ - // eslint-disable-next-line camelcase - access_token, - openid -} = {}) { - const requiredParams = [] - const univerifyConfig = (this.config.service && this.config.service.univerify) || {} - for (let i = 0; i < requiredParams.length; i++) { - const key = requiredParams[i] - if (!univerifyConfig[key]) { - throw new Error(`Missing config param: service.univerify.${key}`) - } - } - return uniCloud.getPhoneNumber({ - provider: 'univerify', - appid: this.getUniversalClientInfo().appId, - apiKey: univerifyConfig.apiKey, - apiSecret: univerifyConfig.apiSecret, - // eslint-disable-next-line camelcase - access_token, - openid - }) -} - -module.exports = { - getPhoneNumber -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/update-user-info.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/update-user-info.js deleted file mode 100644 index ced33b9..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/update-user-info.js +++ /dev/null @@ -1,25 +0,0 @@ -const { - userCollection -} = require('../../common/constants') -const { - USER_STATUS -} = require('../../common/constants') -async function setUserStatus (uid, status) { - const updateData = { - status - } - if (status !== USER_STATUS.NORMAL) { - updateData.valid_token_date = Date.now() - } - await userCollection.doc(uid).update({ - status - }) - // TODO 此接口尚不完善,例如注销后其他客户端可能存在有效token,支持Redis后此处会补充额外逻辑 - return { - errCode: 0 - } -} - -module.exports = { - setUserStatus -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/utils.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/utils.js deleted file mode 100644 index 7d3e0f3..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/utils.js +++ /dev/null @@ -1,18 +0,0 @@ -let redisEnable = null -function getRedisEnable() { - // 未用到的时候不调用redis接口,节省一些连接数 - if (redisEnable !== null) { - return redisEnable - } - try { - uniCloud.redis() - redisEnable = true - } catch (error) { - redisEnable = false - } - return redisEnable -} - -module.exports = { - getRedisEnable -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/verify-code.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/verify-code.js deleted file mode 100644 index b11bc02..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/verify-code.js +++ /dev/null @@ -1,152 +0,0 @@ -const { - dbCmd, - verifyCollection -} = require('../../common/constants') -const { - ERROR -} = require('../../common/error') -const { - getVerifyCode -} = require('../../common/utils') - -async function setVerifyCode ({ - mobile, - email, - code, - expiresIn, - scene -} = {}) { - const now = Date.now() - const record = { - mobile, - email, - scene, - code: code || getVerifyCode(), - state: 0, - ip: this.getUniversalClientInfo().clientIP, - created_date: now, - expired_date: now + expiresIn * 1000 - } - await verifyCollection.add(record) - return { - errCode: 0 - } -} - -async function setEmailVerifyCode ({ - email, - code, - expiresIn, - scene -} = {}) { - email = email && email.trim() - if (!email) { - throw { - errCode: ERROR.INVALID_EMAIL - } - } - email = email.toLowerCase() - return setVerifyCode.call(this, { - email, - code, - expiresIn, - scene - }) -} - -async function setMobileVerifyCode ({ - mobile, - code, - expiresIn, - scene -} = {}) { - mobile = mobile && mobile.trim() - if (!mobile) { - throw { - errCode: ERROR.INVALID_MOBILE - } - } - return setVerifyCode.call(this, { - mobile, - code, - expiresIn, - scene - }) -} - -async function verifyEmailCode ({ - email, - code, - scene -} = {}) { - email = email && email.trim() - if (!email) { - throw { - errCode: ERROR.INVALID_EMAIL - } - } - email = email.toLowerCase() - const { - data: codeRecord - } = await verifyCollection.where({ - email, - scene, - code, - state: 0, - expired_date: dbCmd.gt(Date.now()) - }).limit(1).get() - - if (codeRecord.length === 0) { - throw { - errCode: ERROR.EMAIL_VERIFY_CODE_ERROR - } - } - await verifyCollection.doc(codeRecord[0]._id).update({ - state: 1 - }) - return { - errCode: 0 - } -} - -async function verifyMobileCode ({ - mobile, - code, - scene -} = {}) { - mobile = mobile && mobile.trim() - if (!mobile) { - throw { - errCode: ERROR.INVALID_MOBILE - } - } - const { - data: codeRecord - } = await verifyCollection.where({ - mobile, - scene, - code, - state: 0, - expired_date: dbCmd.gt(Date.now()) - }).limit(1).get() - - if (codeRecord.length === 0) { - throw { - errCode: ERROR.MOBILE_VERIFY_CODE_ERROR - } - } - - await verifyCollection.doc(codeRecord[0]._id).update({ - state: 1 - }) - return { - errCode: 0 - } -} - -module.exports = { - verifyEmailCode, - verifyMobileCode, - setEmailVerifyCode, - setMobileVerifyCode -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/weixin.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/weixin.js deleted file mode 100644 index 8ab34b1..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/lib/utils/weixin.js +++ /dev/null @@ -1,236 +0,0 @@ -const crypto = require('crypto') -const { - userCollection -} = require('../../common/constants') -const { - ERROR -} = require('../../common/error') -const { - getRedisEnable -} = require('./utils') -const { - openDataCollection -} = require('../../common/constants') - -function decryptWeixinData ({ - encryptedData, - sessionKey, - iv -} = {}) { - const oauthConfig = this.configUtils.getOauthConfig({ - provider: 'weixin' - }) - const decipher = crypto.createDecipheriv( - 'aes-128-cbc', - Buffer.from(sessionKey, 'base64'), - Buffer.from(iv, 'base64') - ) - // 设置自动 padding 为 true,删除填充补位 - decipher.setAutoPadding(true) - let decoded - decoded = decipher.update(encryptedData, 'base64', 'utf8') - decoded += decipher.final('utf8') - decoded = JSON.parse(decoded) - if (decoded.watermark.appid !== oauthConfig.appid) { - throw new Error('Invalid wechat appid in decode content') - } - return decoded -} - -function getWeixinPlatform () { - const platform = this.clientPlatform - const userAgent = this.getUniversalClientInfo().userAgent - switch (platform) { - case 'app': - case 'app-plus': - case 'app-android': - case 'app-ios': - return 'app' - case 'mp-weixin': - return 'mp' - case 'h5': - case 'web': - return userAgent.indexOf('MicroMessenger') > -1 ? 'h5' : 'web' - default: - throw new Error('Unsupported weixin platform') - } -} - -async function saveWeixinUserKey ({ - openid, - sessionKey, // 微信小程序用户sessionKey - accessToken, // App端微信用户accessToken - refreshToken, // App端微信用户refreshToken - accessTokenExpired // App端微信用户accessToken过期时间 -} = {}) { - // 微信公众平台、开放平台refreshToken有效期均为30天(微信没有在网络请求里面返回30天这个值,务必注意未来可能出现调整,需及时更新此处逻辑)。 - // 此前QQ开放平台有调整过accessToken的过期时间:[access_token有效期由90天缩短至30天](https://wiki.connect.qq.com/%E3%80%90qq%E4%BA%92%E8%81%94%E3%80%91access_token%E6%9C%89%E6%95%88%E6%9C%9F%E8%B0%83%E6%95%B4) - - const appId = this.getUniversalClientInfo().appId - const weixinPlatform = getWeixinPlatform.call(this) - const keyObj = { - dcloudAppid: appId, - openid, - platform: 'weixin-' + weixinPlatform - } - switch (weixinPlatform) { - case 'mp': - await this.uniOpenBridge.setSessionKey(keyObj, { - session_key: sessionKey - }, 30 * 24 * 60 * 60) - break - case 'app': - case 'h5': - case 'web': - await this.uniOpenBridge.setUserAccessToken(keyObj, { - access_token: accessToken, - refresh_token: refreshToken, - access_token_expired: accessTokenExpired - }, 30 * 24 * 60 * 60) - break - default: - break - } -} - -async function saveSecureNetworkCache ({ - code, - openid, - unionid, - sessionKey -}) { - const { - appId - } = this.getUniversalClientInfo() - const key = `uni-id:${appId}:weixin-mp:code:${code}:secure-network-cache` - const value = JSON.stringify({ - openid, - unionid, - session_key: sessionKey - }) - // 此处存储的是code的缓存,设置有效期和token一致 - const expiredSeconds = this.config.tokenExpiresIn || 3 * 24 * 60 * 60 - - await openDataCollection.doc(key).set({ - value, - expired: Date.now() + expiredSeconds * 1000 - }) - const isRedisEnable = getRedisEnable() - if (isRedisEnable) { - const redis = uniCloud.redis() - await redis.set(key, value, 'EX', expiredSeconds) - } -} - -function generateWeixinCache ({ - sessionKey, // 微信小程序用户sessionKey - accessToken, // App端微信用户accessToken - refreshToken, // App端微信用户refreshToken - accessTokenExpired // App端微信用户accessToken过期时间 -} = {}) { - const platform = getWeixinPlatform.call(this) - let cache - switch (platform) { - case 'app': - case 'h5': - case 'web': - cache = { - access_token: accessToken, - refresh_token: refreshToken, - access_token_expired: accessTokenExpired - } - break - case 'mp': - cache = { - session_key: sessionKey - } - break - default: - throw new Error('Unsupported weixin platform') - } - return { - third_party: { - [`${platform}_weixin`]: cache - } - } -} - -function getWeixinOpenid ({ - userRecord -} = {}) { - const weixinPlatform = getWeixinPlatform.call(this) - const appId = this.getUniversalClientInfo().appId - const wxOpenidObj = userRecord.wx_openid - if (!wxOpenidObj) { - return - } - return wxOpenidObj[`${weixinPlatform}_${appId}`] || wxOpenidObj[weixinPlatform] -} - -async function getWeixinCacheFallback ({ - userRecord, - key -} = {}) { - const platform = getWeixinPlatform.call(this) - const thirdParty = userRecord && userRecord.third_party - if (!thirdParty) { - return - } - const weixinCache = thirdParty[`${platform}_weixin`] - return weixinCache && weixinCache[key] -} - -async function getWeixinCache ({ - uid, - userRecord, - key -} = {}) { - const weixinPlatform = getWeixinPlatform.call(this) - const appId = this.getUniversalClientInfo().appId - if (!userRecord) { - const getUserRes = await userCollection.doc(uid).get() - userRecord = getUserRes.data[0] - } - if (!userRecord) { - throw { - errCode: ERROR.ACCOUNT_NOT_EXISTS - } - } - const openid = getWeixinOpenid.call(this, { - userRecord - }) - const getCacheMethod = weixinPlatform === 'mp' ? 'getSessionKey' : 'getUserAccessToken' - const userKey = await this.uniOpenBridge[getCacheMethod]({ - dcloudAppid: appId, - platform: 'weixin-' + weixinPlatform, - openid - }) - if (userKey) { - return userKey[key] - } - return getWeixinCacheFallback({ - userRecord, - key - }) -} - -async function getWeixinAccessToken () { - const weixinPlatform = getWeixinPlatform.call(this) - const appId = this.getUniversalClientInfo().appId - - const cache = await this.uniOpenBridge.getAccessToken({ - dcloudAppid: appId, - platform: 'weixin-' + weixinPlatform - }) - - return cache.access_token -} -module.exports = { - decryptWeixinData, - getWeixinPlatform, - generateWeixinCache, - getWeixinCache, - saveWeixinUserKey, - getWeixinAccessToken, - saveSecureNetworkCache -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/middleware/access-control.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/middleware/access-control.js deleted file mode 100644 index e333fe0..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/middleware/access-control.js +++ /dev/null @@ -1,59 +0,0 @@ -const methodPermission = require('../config/permission') -const { - ERROR -} = require('../common/error') - -function isAccessAllowed (user, setting) { - const { - role: userRole = [], - permission: userPermission = [] - } = user - const { - role: settingRole = [], - permission: settingPermission = [] - } = setting - if (userRole.includes('admin')) { - return - } - if ( - settingRole.length > 0 && - settingRole.every(item => !userRole.includes(item)) - ) { - throw { - errCode: ERROR.PERMISSION_ERROR - } - } - if ( - settingPermission.length > 0 && - settingPermission.every(item => !userPermission.includes(item)) - ) { - throw { - errCode: ERROR.PERMISSION_ERROR - } - } -} - -module.exports = async function () { - const methodName = this.getMethodName() - if (!(methodName in methodPermission)) { - return - } - const { - auth, - role, - permission - } = methodPermission[methodName] - if (auth || role || permission) { - await this.middleware.auth() - } - if (role && role.length === 0) { - throw new Error('[AccessControl]Empty role array is not supported') - } - if (permission && permission.length === 0) { - throw new Error('[AccessControl]Empty permission array is not supported') - } - return isAccessAllowed(this.authInfo, { - role, - permission - }) -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/middleware/auth.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/middleware/auth.js deleted file mode 100644 index 1915335..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/middleware/auth.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = async function () { - if (this.authInfo) { // 多次执行auth时如果第一次成功后续不再执行 - return - } - const token = this.getUniversalUniIdToken() - const payload = await this.uniIdCommon.checkToken(token) - if (payload.errCode) { - throw payload - } - this.authInfo = payload - if (payload.token) { - this.response.newToken = { - token: payload.token, - tokenExpired: payload.tokenExpired - } - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/middleware/index.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/middleware/index.js deleted file mode 100644 index 9f7c958..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/middleware/index.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - auth: require('./auth'), - uniIdLog: require('./uni-id-log'), - validate: require('./validate'), - accessControl: require('./access-control'), - verifyRequestSign: require('./verify-request-sign'), - ...require('./rbac') -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/middleware/rbac.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/middleware/rbac.js deleted file mode 100644 index f42ef8d..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/middleware/rbac.js +++ /dev/null @@ -1,39 +0,0 @@ -const { - ERROR -} = require('../common/error') - -function hasRole (...roleList) { - const userRole = this.authInfo.role || [] - if (userRole.includes('admin')) { - return - } - const isMatch = roleList.every(roleItem => { - return userRole.includes(roleItem) - }) - if (!isMatch) { - throw { - errCode: ERROR.PERMISSION_ERROR - } - } -} - -function hasPermission (...permissionList) { - const userRole = this.authInfo.role || [] - const userPermission = this.authInfo.permission || [] - if (userRole.includes('admin')) { - return - } - const isMatch = permissionList.every(permissionItem => { - return userPermission.includes(permissionItem) - }) - if (!isMatch) { - throw { - errCode: ERROR.PERMISSION_ERROR - } - } -} - -module.exports = { - hasRole, - hasPermission -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/middleware/uni-id-log.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/middleware/uni-id-log.js deleted file mode 100644 index ca6927d..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/middleware/uni-id-log.js +++ /dev/null @@ -1,39 +0,0 @@ -const db = uniCloud.database() -module.exports = async function ({ - data = {}, - success = true, - type = 'login' -} = {}) { - const now = Date.now() - const uniIdLogCollection = db.collection('uni-id-log') - const requiredDataKeyList = ['user_id', 'username', 'email', 'mobile'] - const dataCopy = {} - for (let i = 0; i < requiredDataKeyList.length; i++) { - const key = requiredDataKeyList[i] - if (key in data && typeof data[key] === 'string') { - dataCopy[key] = data[key] - } - } - const { - appId, - clientIP, - deviceId, - userAgent - } = this.getUniversalClientInfo() - const logData = { - appid: appId, - device_id: deviceId, - ip: clientIP, - type, - ua: userAgent, - create_date: now, - ...dataCopy - } - - if (success) { - logData.state = 1 - } else { - logData.state = 0 - } - return uniIdLogCollection.add(logData) -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/middleware/validate.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/middleware/validate.js deleted file mode 100644 index 52ff047..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/middleware/validate.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = function (value = {}, schema = {}) { - const validateRes = this.validator.validate(value, schema) - if (validateRes) { - delete validateRes.schemaKey - throw validateRes - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/middleware/verify-request-sign.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/middleware/verify-request-sign.js deleted file mode 100644 index 56e421a..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/middleware/verify-request-sign.js +++ /dev/null @@ -1,85 +0,0 @@ -const crypto = require('crypto') -const createConfig = require('uni-config-center') -const { verifyHttpInfo } = require('uni-cloud-s2s') - -const { ERROR } = require('../common/error') -const s2sConfig = createConfig({ - pluginId: 'uni-cloud-s2s' -}) -const needSignFunctions = new Set([ - 'externalRegister', - 'externalLogin', - 'updateUserInfoByExternal' -]) - -module.exports = function () { - const methodName = this.getMethodName() - const { source } = this.getUniversalClientInfo() - - // 指定接口需要鉴权 - if (!needSignFunctions.has(methodName)) return - - // 非 HTTP 方式请求拒绝访问 - if (source !== 'http') { - throw { - errCode: ERROR.ILLEGAL_REQUEST - } - } - - // 支持 uni-cloud-s2s 验证请求 - if (s2sConfig.hasFile('config.json')) { - try { - if (!verifyHttpInfo(this.getHttpInfo())) { - throw { - errCode: ERROR.ILLEGAL_REQUEST - } - } - } catch (e) { - if (e.errSubject === 'uni-cloud-s2s') { - throw { - errCode: ERROR.ILLEGAL_REQUEST, - errMsg: e.errMsg - } - } - throw e - } - - return - } - - if (!this.config.requestAuthSecret || typeof this.config.requestAuthSecret !== 'string') { - throw { - errCode: ERROR.CONFIG_FIELD_REQUIRED, - errMsgValue: { - field: 'requestAuthSecret' - } - } - } - - const timeout = 20 * 1000 // 请求超过20秒不能再请求,防止重放攻击 - const { headers, body: _body } = this.getHttpInfo() - const { 'uni-id-nonce': nonce, 'uni-id-timestamp': timestamp, 'uni-id-signature': signature } = headers - const body = JSON.parse(_body).params || {} - const bodyStr = Object.keys(body) - .sort() - .filter(item => typeof body[item] !== 'object') - .map(item => `${item}=${body[item]}`) - .join('&') - - if (isNaN(Number(timestamp)) || (Number(timestamp) + timeout) < Date.now()) { - console.error('[timestamp error], timestamp:', timestamp, 'timeout:', timeout) - - throw { - errCode: ERROR.ILLEGAL_REQUEST - } - } - - const reSignature = crypto.createHmac('sha256', `${this.config.requestAuthSecret + nonce}`).update(`${timestamp}${bodyStr}`).digest('hex') - - if (signature !== reSignature.toUpperCase()) { - console.error('[signature error], signature:', signature, 'reSignature:', reSignature.toUpperCase(), 'requestAuthSecret:', this.config.requestAuthSecret) - throw { - errCode: ERROR.ILLEGAL_REQUEST - } - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/close-account.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/close-account.js deleted file mode 100644 index f1bdf96..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/close-account.js +++ /dev/null @@ -1,16 +0,0 @@ -const { - setUserStatus -} = require('../../lib/utils/update-user-info') -const { - USER_STATUS -} = require('../../common/constants') - -/** - * 注销账户 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#close-account - * @returns - */ -module.exports = async function () { - const { uid } = this.authInfo - return setUserStatus(uid, USER_STATUS.CLOSED) -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/get-account-info.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/get-account-info.js deleted file mode 100644 index 7b8599a..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/get-account-info.js +++ /dev/null @@ -1,69 +0,0 @@ -const { - userCollection -} = require('../../common/constants') -const { - ERROR -} = require('../../common/error') - -function isUsernameSet (userRecord) { - return !!userRecord.username -} -function isNicknameSet (userRecord) { - return !!userRecord.nickname -} -function isPasswordSet (userRecord) { - return !!userRecord.password -} -function isMobileBound (userRecord) { - return !!(userRecord.mobile && userRecord.mobile_confirmed) -} -function isEmailBound (userRecord) { - return !!(userRecord.email && userRecord.email_confirmed) -} -function isWeixinBound (userRecord) { - return !!( - userRecord.wx_unionid || - Object.keys(userRecord.wx_openid || {}).length - ) -} -function isQQBound (userRecord) { - return !!( - userRecord.qq_unionid || - Object.keys(userRecord.qq_openid || {}).length - ) -} -function isAlipayBound (userRecord) { - return !!userRecord.ali_openid -} -function isAppleBound (userRecord) { - return !!userRecord.apple_openid -} - -/** - * 获取账户账户简略信息 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#get-account-info - */ -module.exports = async function () { - const { - uid - } = this.authInfo - const getUserRes = await userCollection.doc(uid).get() - const userRecord = getUserRes && getUserRes.data && getUserRes.data[0] - if (!userRecord) { - throw { - errCode: ERROR.ACCOUNT_NOT_EXISTS - } - } - return { - errCode: 0, - isUsernameSet: isUsernameSet(userRecord), - isNicknameSet: isNicknameSet(userRecord), - isPasswordSet: isPasswordSet(userRecord), - isMobileBound: isMobileBound(userRecord), - isEmailBound: isEmailBound(userRecord), - isWeixinBound: isWeixinBound(userRecord), - isQQBound: isQQBound(userRecord), - isAlipayBound: isAlipayBound(userRecord), - isAppleBound: isAppleBound(userRecord) - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/get-realname-info.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/get-realname-info.js deleted file mode 100644 index 0ea8f05..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/get-realname-info.js +++ /dev/null @@ -1,45 +0,0 @@ -const { userCollection } = require('../../common/constants') -const { ERROR } = require('../../common/error') -const { decryptData } = require('../../common/sensitive-aes-cipher') -const { dataDesensitization } = require('../../common/utils') - -/** - * 获取实名信息 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#get-realname-info - * @param {Object} params - * @param {Boolean} params.decryptData 是否解密数据 - * @returns - */ -module.exports = async function (params = {}) { - const schema = { - decryptData: { - required: false, - type: 'boolean' - } - } - - this.middleware.validate(params, schema) - - const { decryptData: isDecryptData = true } = params - - const { - uid - } = this.authInfo - const getUserRes = await userCollection.doc(uid).get() - const userRecord = getUserRes && getUserRes.data && getUserRes.data[0] - if (!userRecord) { - throw { - errCode: ERROR.ACCOUNT_NOT_EXISTS - } - } - - const { realname_auth: realNameAuth = {} } = userRecord - - return { - errCode: 0, - type: realNameAuth.type, - authStatus: realNameAuth.auth_status, - realName: isDecryptData ? dataDesensitization(decryptData.call(this, realNameAuth.real_name), { onlyLast: true }) : realNameAuth.real_name, - identity: isDecryptData ? dataDesensitization(decryptData.call(this, realNameAuth.identity)) : realNameAuth.identity - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/index.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/index.js deleted file mode 100644 index 0e55385..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/index.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = { - setPwd: require('./set-pwd'), - updatePwd: require('./update-pwd'), - resetPwdBySms: require('./reset-pwd-by-sms'), - resetPwdByEmail: require('./reset-pwd-by-email'), - closeAccount: require('./close-account'), - getAccountInfo: require('./get-account-info'), - getRealNameInfo: require('./get-realname-info') -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/reset-pwd-by-email.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/reset-pwd-by-email.js deleted file mode 100644 index 20c6219..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/reset-pwd-by-email.js +++ /dev/null @@ -1,128 +0,0 @@ -const { - ERROR -} = require('../../common/error') -const { - getNeedCaptcha, - verifyCaptcha -} = require('../../lib/utils/captcha') -const { - verifyEmailCode -} = require('../../lib/utils/verify-code') -const { - userCollection, - EMAIL_SCENE, - CAPTCHA_SCENE, - LOG_TYPE -} = require('../../common/constants') -const { - findUser -} = require('../../lib/utils/account') -const PasswordUtils = require('../../lib/utils/password') - -/** - * 通过邮箱验证码重置密码 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#reset-pwd-by-email - * @param {object} params - * @param {string} params.email 邮箱 - * @param {string} params.code 邮箱验证码 - * @param {string} params.password 密码 - * @param {string} params.captcha 图形验证码 - * @returns {object} - */ -module.exports = async function (params = {}) { - const schema = { - email: 'email', - code: 'string', - password: 'password', - captcha: { - required: false, - type: 'string' - } - } - this.middleware.validate(params, schema) - const { - email, - code, - password, - captcha - } = params - - const needCaptcha = await getNeedCaptcha.call(this, { - email, - type: LOG_TYPE.RESET_PWD_BY_EMAIL - }) - if (needCaptcha) { - await verifyCaptcha.call(this, { - captcha, - scene: CAPTCHA_SCENE.RESET_PWD_BY_EMAIL - }) - } - try { - // 验证手机号验证码,验证不通过时写入失败日志 - await verifyEmailCode({ - email, - code, - scene: EMAIL_SCENE.RESET_PWD_BY_EMAIL - }) - } catch (error) { - await this.middleware.uniIdLog({ - data: { - email - }, - type: LOG_TYPE.RESET_PWD_BY_EMAIL, - success: false - }) - throw error - } - // 根据手机号查找匹配的用户 - const { - total, - userMatched - } = await findUser.call(this, { - userQuery: { - email - }, - authorizedApp: [this.getUniversalClientInfo().appId] - }) - if (userMatched.length === 0) { - if (total > 0) { - throw { - errCode: ERROR.ACCOUNT_NOT_EXISTS_IN_CURRENT_APP - } - } - throw { - errCode: ERROR.ACCOUNT_NOT_EXISTS - } - } else if (userMatched.length > 1) { - throw { - errCode: ERROR.ACCOUNT_CONFLICT - } - } - const { _id: uid } = userMatched[0] - const { - passwordHash, - version - } = new PasswordUtils({ - clientInfo: this.getUniversalClientInfo(), - passwordSecret: this.config.passwordSecret - }).generatePasswordHash({ - password - }) - // 更新用户密码 - await userCollection.doc(uid).update({ - password: passwordHash, - password_secret_version: version, - valid_token_date: Date.now() - }) - - // 写入成功日志 - await this.middleware.uniIdLog({ - data: { - email - }, - type: LOG_TYPE.RESET_PWD_BY_SMS - }) - return { - errCode: 0 - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/reset-pwd-by-sms.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/reset-pwd-by-sms.js deleted file mode 100644 index bc10dc8..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/reset-pwd-by-sms.js +++ /dev/null @@ -1,128 +0,0 @@ -const { - ERROR -} = require('../../common/error') -const { - getNeedCaptcha, - verifyCaptcha -} = require('../../lib/utils/captcha') -const { - verifyMobileCode -} = require('../../lib/utils/verify-code') -const { - userCollection, - SMS_SCENE, - CAPTCHA_SCENE, - LOG_TYPE -} = require('../../common/constants') -const { - findUser -} = require('../../lib/utils/account') -const PasswordUtils = require('../../lib/utils/password') - -/** - * 通过短信验证码重置密码 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#reset-pwd-by-sms - * @param {object} params - * @param {string} params.mobile 手机号 - * @param {string} params.mobile 短信验证码 - * @param {string} params.password 密码 - * @param {string} params.captcha 图形验证码 - * @returns {object} - */ -module.exports = async function (params = {}) { - const schema = { - mobile: 'mobile', - code: 'string', - password: 'password', - captcha: { - required: false, - type: 'string' - } - } - this.middleware.validate(params, schema) - const { - mobile, - code, - password, - captcha - } = params - - const needCaptcha = await getNeedCaptcha.call(this, { - mobile, - type: LOG_TYPE.RESET_PWD_BY_SMS - }) - if (needCaptcha) { - await verifyCaptcha.call(this, { - captcha, - scene: CAPTCHA_SCENE.RESET_PWD_BY_SMS - }) - } - try { - // 验证手机号验证码,验证不通过时写入失败日志 - await verifyMobileCode({ - mobile, - code, - scene: SMS_SCENE.RESET_PWD_BY_SMS - }) - } catch (error) { - await this.middleware.uniIdLog({ - data: { - mobile - }, - type: LOG_TYPE.RESET_PWD_BY_SMS, - success: false - }) - throw error - } - // 根据手机号查找匹配的用户 - const { - total, - userMatched - } = await findUser.call(this, { - userQuery: { - mobile - }, - authorizedApp: [this.getUniversalClientInfo().appId] - }) - if (userMatched.length === 0) { - if (total > 0) { - throw { - errCode: ERROR.ACCOUNT_NOT_EXISTS_IN_CURRENT_APP - } - } - throw { - errCode: ERROR.ACCOUNT_NOT_EXISTS - } - } else if (userMatched.length > 1) { - throw { - errCode: ERROR.ACCOUNT_CONFLICT - } - } - const { _id: uid } = userMatched[0] - const { - passwordHash, - version - } = new PasswordUtils({ - clientInfo: this.getUniversalClientInfo(), - passwordSecret: this.config.passwordSecret - }).generatePasswordHash({ - password - }) - // 更新用户密码 - await userCollection.doc(uid).update({ - password: passwordHash, - password_secret_version: version, - valid_token_date: Date.now() - }) - - // 写入成功日志 - await this.middleware.uniIdLog({ - data: { - mobile - }, - type: LOG_TYPE.RESET_PWD_BY_SMS - }) - return { - errCode: 0 - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/set-pwd.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/set-pwd.js deleted file mode 100644 index f33c6f4..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/set-pwd.js +++ /dev/null @@ -1,83 +0,0 @@ -const { userCollection, SMS_SCENE, LOG_TYPE, CAPTCHA_SCENE } = require('../../common/constants') -const { ERROR } = require('../../common/error') -const { verifyMobileCode } = require('../../lib/utils/verify-code') -const PasswordUtils = require('../../lib/utils/password') -const { getNeedCaptcha, verifyCaptcha } = require('../../lib/utils/captcha') - -module.exports = async function (params = {}) { - const schema = { - password: 'password', - code: 'string', - captcha: { - required: false, - type: 'string' - } - } - this.middleware.validate(params, schema) - - const { password, code, captcha } = params - const uid = this.authInfo.uid - const getUserRes = await userCollection.doc(uid).get() - const userRecord = getUserRes.data[0] - if (!userRecord) { - throw { - errCode: ERROR.ACCOUNT_NOT_EXISTS - } - } - - const needCaptcha = await getNeedCaptcha.call(this, { - mobile: userRecord.mobile - }) - - if (needCaptcha) { - await verifyCaptcha.call(this, { - captcha, - scene: CAPTCHA_SCENE.SET_PWD_BY_SMS - }) - } - - try { - // 验证手机号验证码,验证不通过时写入失败日志 - await verifyMobileCode({ - mobile: userRecord.mobile, - code, - scene: SMS_SCENE.SET_PWD_BY_SMS - }) - } catch (error) { - await this.middleware.uniIdLog({ - data: { - mobile: userRecord.mobile - }, - type: LOG_TYPE.SET_PWD_BY_SMS, - success: false - }) - throw error - } - - const { - passwordHash, - version - } = new PasswordUtils({ - clientInfo: this.getUniversalClientInfo(), - passwordSecret: this.config.passwordSecret - }).generatePasswordHash({ - password - }) - - // 更新用户密码 - await userCollection.doc(uid).update({ - password: passwordHash, - password_secret_version: version - }) - - await this.middleware.uniIdLog({ - data: { - mobile: userRecord.mobile - }, - type: LOG_TYPE.SET_PWD_BY_SMS - }) - - return { - errCode: 0 - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/update-pwd.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/update-pwd.js deleted file mode 100644 index 97fd1be..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/account/update-pwd.js +++ /dev/null @@ -1,69 +0,0 @@ -const { - userCollection -} = require('../../common/constants') -const { - ERROR -} = require('../../common/error') -const PasswordUtils = require('../../lib/utils/password') -/** - * 更新密码 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#update-pwd - * @param {object} params - * @param {string} params.oldPassword 旧密码 - * @param {string} params.newPassword 新密码 - * @returns {object} - */ -module.exports = async function (params = {}) { - const schema = { - oldPassword: 'string', // 防止密码规则调整导致旧密码无法更新 - newPassword: 'password' - } - this.middleware.validate(params, schema) - const uid = this.authInfo.uid - const getUserRes = await userCollection.doc(uid).get() - const userRecord = getUserRes.data[0] - if (!userRecord) { - throw { - errCode: ERROR.ACCOUNT_NOT_EXISTS - } - } - const { - oldPassword, - newPassword - } = params - const passwordUtils = new PasswordUtils({ - userRecord, - clientInfo: this.getUniversalClientInfo(), - passwordSecret: this.config.passwordSecret - }) - - const { - success: checkPasswordSuccess - } = passwordUtils.checkUserPassword({ - password: oldPassword, - autoRefresh: false - }) - - if (!checkPasswordSuccess) { - throw { - errCode: ERROR.PASSWORD_ERROR - } - } - - const { - passwordHash, - version - } = passwordUtils.generatePasswordHash({ - password: newPassword - }) - - await userCollection.doc(uid).update({ - password: passwordHash, - password_secret_version: version, - valid_token_date: Date.now() // refreshToken时会校验,如果创建token时间在此时间点之前,则拒绝下发新token,返回token失效错误码 - }) - // 执行更新密码操作后客户端应将用户退出重新登录 - return { - errCode: 0 - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/admin/add-user.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/admin/add-user.js deleted file mode 100644 index 330fd37..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/admin/add-user.js +++ /dev/null @@ -1,131 +0,0 @@ -const { - findUser -} = require('../../lib/utils/account') -const { - ERROR -} = require('../../common/error') -const { - userCollection -} = require('../../common/constants') -const PasswordUtils = require('../../lib/utils/password') - -/** - * 新增用户 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#add-user - * @param {Object} params - * @param {String} params.username 用户名 - * @param {String} params.password 密码 - * @param {String} params.nickname 昵称 - * @param {Array} params.authorizedApp 允许登录的AppID列表 - * @param {Array} params.role 用户角色列表 - * @param {String} params.mobile 手机号 - * @param {String} params.email 邮箱 - * @param {Array} params.tags 用户标签 - * @param {Number} params.status 用户状态 - * @returns - */ -module.exports = async function (params = {}) { - const schema = { - username: 'username', - password: 'password', - authorizedApp: { - required: false, - type: 'array' - }, // 指定允许登录的app,传空数组或不传时表示可以不可以在任何端登录 - nickname: { - required: false, - type: 'nickname' - }, - role: { - require: false, - type: 'array' - }, - mobile: { - required: false, - type: 'mobile' - }, - email: { - required: false, - type: 'email' - }, - tags: { - required: false, - type: 'array' - }, - status: { - required: false, - type: 'number' - } - } - this.middleware.validate(params, schema) - const { - username, - password, - authorizedApp, - nickname, - role, - mobile, - email, - tags, - status - } = params - const { - userMatched - } = await findUser({ - userQuery: { - username, - mobile, - email - }, - authorizedApp - }) - if (userMatched.length) { - throw { - errCode: ERROR.ACCOUNT_EXISTS - } - } - const passwordUtils = new PasswordUtils({ - clientInfo: this.getUniversalClientInfo(), - passwordSecret: this.config.passwordSecret - }) - const { - passwordHash, - version - } = passwordUtils.generatePasswordHash({ - password - }) - const data = { - username, - password: passwordHash, - password_secret_version: version, - dcloud_appid: authorizedApp || [], - nickname, - role: role || [], - mobile, - email, - tags: tags || [], - status - } - if (email) { - data.email_confirmed = 1 - } - if (mobile) { - data.mobile_confirmed = 1 - } - - // 触发 beforeRegister 钩子 - const beforeRegister = this.hooks.beforeRegister - let userRecord = data - if (beforeRegister) { - userRecord = await beforeRegister({ - userRecord, - clientInfo: this.getUniversalClientInfo() - }) - } - - await userCollection.add(userRecord) - return { - errCode: 0, - errMsg: '' - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/admin/index.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/admin/index.js deleted file mode 100644 index c8830f5..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/admin/index.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - addUser: require('./add-user'), - updateUser: require('./update-user') -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/admin/update-user.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/admin/update-user.js deleted file mode 100644 index ed2f7b6..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/admin/update-user.js +++ /dev/null @@ -1,138 +0,0 @@ -const { - findUser -} = require('../../lib/utils/account') -const { - ERROR -} = require('../../common/error') -const { - userCollection -} = require('../../common/constants') -const PasswordUtils = require('../../lib/utils/password') - -/** - * 修改用户 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#update-user - * @param {Object} params - * @param {String} params.uid 要更新的用户id - * @param {String} params.username 用户名 - * @param {String} params.password 密码 - * @param {String} params.nickname 昵称 - * @param {Array} params.authorizedApp 允许登录的AppID列表 - * @param {Array} params.role 用户角色列表 - * @param {String} params.mobile 手机号 - * @param {String} params.email 邮箱 - * @param {Array} params.tags 用户标签 - * @param {Number} params.status 用户状态 - * @returns - */ -module.exports = async function (params = {}) { - const schema = { - uid: 'string', - username: 'username', - password: { - required: false, - type: 'password' - }, - authorizedApp: { - required: false, - type: 'array' - }, // 指定允许登录的app,传空数组或不传时表示可以不可以在任何端登录 - nickname: { - required: false, - type: 'nickname' - }, - role: { - require: false, - type: 'array' - }, - mobile: { - required: false, - type: 'mobile' - }, - email: { - required: false, - type: 'email' - }, - tags: { - required: false, - type: 'array' - }, - status: { - required: false, - type: 'number' - } - } - - this.middleware.validate(params, schema) - - const { - uid, - username, - password, - authorizedApp, - nickname, - role, - mobile, - email, - tags, - status - } = params - - // 更新的用户数据字段 - const data = { - username, - dcloud_appid: authorizedApp, - nickname, - role, - mobile, - email, - tags, - status - } - - const realData = Object.keys(data).reduce((res, key) => { - const item = data[key] - if (item !== undefined) { - res[key] = item - } - return res - }, {}) - - // 更新用户名时验证用户名是否重新 - if (username) { - const { - userMatched - } = await findUser({ - userQuery: { - username - }, - authorizedApp - }) - if (userMatched.filter(user => user._id !== uid).length) { - throw { - errCode: ERROR.ACCOUNT_EXISTS - } - } - } - if (password) { - const passwordUtils = new PasswordUtils({ - clientInfo: this.getUniversalClientInfo(), - passwordSecret: this.config.passwordSecret - }) - const { - passwordHash, - version - } = passwordUtils.generatePasswordHash({ - password - }) - - realData.password = passwordHash - realData.password_secret_version = version - } - - await userCollection.doc(uid).update(realData) - - return { - errCode: 0 - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/dev/get-supported-login-type.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/dev/get-supported-login-type.js deleted file mode 100644 index c28f3bd..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/dev/get-supported-login-type.js +++ /dev/null @@ -1,70 +0,0 @@ -function isMobileCodeSupported () { - const config = this.config - return !!(config.service && config.service.sms && config.service.sms.smsKey) -} - -function isUniverifySupport () { - return true -} - -function isWeixinSupported () { - this.configUtils.getOauthConfig({ - provider: 'weixin' - }) - return true -} - -function isQQSupported () { - this.configUtils.getOauthConfig({ - provider: 'qq' - }) - return true -} - -function isAppleSupported () { - this.configUtils.getOauthConfig({ - provider: 'apple' - }) - return true -} - -function isAlipaySupported () { - this.configUtils.getOauthConfig({ - provider: 'alipay' - }) - return true -} - -const loginTypeTester = { - 'mobile-code': isMobileCodeSupported, - univerify: isUniverifySupport, - weixin: isWeixinSupported, - qq: isQQSupported, - apple: isAppleSupported, - alipay: isAlipaySupported -} - -/** - * 获取支持的登录方式 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#get-supported-login-type - * @returns - */ -module.exports = async function () { - const supportedLoginType = [ - 'username-password', - 'mobile-password', - 'email-password' - ] - for (const type in loginTypeTester) { - try { - if (loginTypeTester[type].call(this)) { - supportedLoginType.push(type) - } - } catch (error) { } - } - return { - errCode: 0, - errMsg: '', - supportedLoginType - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/dev/index.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/dev/index.js deleted file mode 100644 index e22f9f2..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/dev/index.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - getSupportedLoginType: require('./get-supported-login-type') -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/external/index.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/external/index.js deleted file mode 100644 index 6fa597f..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/external/index.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - externalRegister: require('./register'), - externalLogin: require('./login'), - updateUserInfoByExternal: require('./update-user-info') -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/external/login.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/external/login.js deleted file mode 100644 index af13013..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/external/login.js +++ /dev/null @@ -1,68 +0,0 @@ -const { preLogin, postLogin } = require('../../lib/utils/login') -const { EXTERNAL_DIRECT_CONNECT_PROVIDER } = require('../../common/constants') -const { ERROR } = require('../../common/error') - -/** - * 外部用户登录 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#external-login - * @param {object} params - * @param {string} params.uid uni-id体系用户id - * @param {string} params.externalUid 业务系统的用户id - * @returns {object} - */ -module.exports = async function (params = {}) { - const schema = { - uid: { - required: false, - type: 'string' - }, - externalUid: { - required: false, - type: 'string' - } - } - - this.middleware.validate(params, schema) - - const { - uid, - externalUid - } = params - - if (!uid && !externalUid) { - throw { - errCode: ERROR.PARAM_REQUIRED, - errMsgValue: { - param: 'uid or externalUid' - } - } - } - - let query - if (uid) { - query = { - _id: uid - } - } else { - query = { - identities: { - provider: EXTERNAL_DIRECT_CONNECT_PROVIDER, - uid: externalUid - } - } - } - - const user = await preLogin.call(this, { - user: query - }) - - const result = await postLogin.call(this, { - user - }) - - return { - errCode: result.errCode, - newToken: result.newToken, - uid: result.uid - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/external/register.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/external/register.js deleted file mode 100644 index 1b2279c..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/external/register.js +++ /dev/null @@ -1,93 +0,0 @@ -const url = require('url') -const { preRegister, postRegister } = require('../../lib/utils/register') -const { EXTERNAL_DIRECT_CONNECT_PROVIDER } = require('../../common/constants') - -/** - * 外部注册用户 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#external-register - * @param {object} params - * @param {string} params.externalUid 业务系统的用户id - * @param {string} params.nickname 昵称 - * @param {number} params.gender 性别 - * @param {string} params.avatar 头像 - * @returns {object} - */ -module.exports = async function (params = {}) { - const schema = { - externalUid: 'string', - nickname: { - required: false, - type: 'nickname' - }, - gender: { - required: false, - type: 'number' - }, - avatar: { - required: false, - type: 'string' - } - } - - this.middleware.validate(params, schema) - - const { - externalUid, - avatar, - gender, - nickname - } = params - - await preRegister.call(this, { - user: { - identities: { - provider: EXTERNAL_DIRECT_CONNECT_PROVIDER, - uid: externalUid - } - } - }) - - const extraData = {} - - if (avatar) { - // eslint-disable-next-line n/no-deprecated-api - const avatarPath = url.parse(avatar).pathname - const extName = avatarPath.indexOf('.') > -1 ? avatarPath.split('.').pop() : '' - - extraData.avatar_file = { - name: avatarPath, - extname: extName, - url: avatar - } - } - - const result = await postRegister.call(this, { - user: { - avatar, - gender, - nickname, - identities: [ - { - provider: EXTERNAL_DIRECT_CONNECT_PROVIDER, - userInfo: { - avatar, - gender, - nickname - }, - uid: externalUid - } - ] - }, - extraData - }) - - return { - errCode: result.errCode, - newToken: result.newToken, - externalUid, - avatar, - gender, - nickname, - uid: result.uid - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/external/update-user-info.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/external/update-user-info.js deleted file mode 100644 index a91fe9f..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/external/update-user-info.js +++ /dev/null @@ -1,208 +0,0 @@ -const url = require('url') -const { userCollection, EXTERNAL_DIRECT_CONNECT_PROVIDER } = require('../../common/constants') -const { ERROR } = require('../../common/error') -const { findUser } = require('../../lib/utils/account') -const PasswordUtils = require('../../lib/utils/password') - -/** - * 使用 uid 或 externalUid 获取用户信息 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#external-update-userinfo - * @param {object} params - * @param {string} params.uid uni-id体系的用户id - * @param {string} params.externalUid 业务系统的用户id - * @param {string} params.nickname 昵称 - * @param {string} params.gender 性别 - * @param {string} params.avatar 头像 - * @returns {object} - */ -module.exports = async function (params = {}) { - const schema = { - uid: { - required: false, - type: 'string' - }, - externalUid: { - required: false, - type: 'string' - }, - username: { - required: false, - type: 'string' - }, - password: { - required: false, - type: 'password' - }, - authorizedApp: { - required: false, - type: 'array' - }, // 指定允许登录的app,传空数组或不传时表示可以不可以在任何端登录 - nickname: { - required: false, - type: 'nickname' - }, - role: { - require: false, - type: 'array' - }, - mobile: { - required: false, - type: 'mobile' - }, - email: { - required: false, - type: 'email' - }, - tags: { - required: false, - type: 'array' - }, - status: { - required: false, - type: 'number' - }, - gender: { - required: false, - type: 'number' - }, - avatar: { - required: false, - type: 'string' - } - } - - this.middleware.validate(params, schema) - - const { - uid, - externalUid, - username, - password, - authorizedApp, - nickname, - role, - mobile, - email, - tags, - status, - avatar, - gender - } = params - - if (!uid && !externalUid) { - throw { - errCode: ERROR.PARAM_REQUIRED, - errMsgValue: { - param: 'uid or externalUid' - } - } - } - - let query - if (uid) { - query = { - _id: uid - } - } else { - query = { - identities: { - provider: EXTERNAL_DIRECT_CONNECT_PROVIDER, - uid: externalUid - } - } - } - - const users = await userCollection.where(query).get() - const user = users.data && users.data[0] - if (!user) { - throw { - errCode: ERROR.ACCOUNT_NOT_EXISTS - } - } - - // 更新的用户数据字段 - const data = { - username, - dcloud_appid: authorizedApp, - nickname, - role, - mobile, - email, - tags, - status, - avatar, - gender - } - - const realData = Object.keys(data).reduce((res, key) => { - const item = data[key] - if (item !== undefined) { - res[key] = item - } - return res - }, {}) - - // 更新用户名时验证用户名是否重新 - if (username) { - const { - userMatched - } = await findUser({ - userQuery: { - username - }, - authorizedApp - }) - if (userMatched.filter(user => user._id !== uid).length) { - throw { - errCode: ERROR.ACCOUNT_EXISTS - } - } - } - if (password) { - const passwordUtils = new PasswordUtils({ - clientInfo: this.getUniversalClientInfo(), - passwordSecret: this.config.passwordSecret - }) - const { - passwordHash, - version - } = passwordUtils.generatePasswordHash({ - password - }) - - realData.password = passwordHash - realData.password_secret_version = version - } - - if (avatar) { - // eslint-disable-next-line n/no-deprecated-api - const avatarPath = url.parse(avatar).pathname - const extName = avatarPath.indexOf('.') > -1 ? avatarPath.split('.').pop() : '' - - realData.avatar_file = { - name: avatarPath, - extname: extName, - url: avatar - } - } - - if (user.identities.length) { - const identity = user.identities.find(item => item.provider === EXTERNAL_DIRECT_CONNECT_PROVIDER) - - if (identity) { - identity.userInfo = { - avatar, - gender, - nickname - } - } - - realData.identities = user.identities - } - - await userCollection.where(query).update(realData) - - return { - errCode: 0 - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/facial-recognition-verify/get-auth-result.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/facial-recognition-verify/get-auth-result.js deleted file mode 100644 index 7017c33..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/facial-recognition-verify/get-auth-result.js +++ /dev/null @@ -1,136 +0,0 @@ -const { userCollection, REAL_NAME_STATUS, frvLogsCollection } = require('../../common/constants') -const { dataDesensitization, catchAwait } = require('../../common/utils') -const { encryptData, decryptData } = require('../../common/sensitive-aes-cipher') -const { ERROR } = require('../../common/error') - -/** - * 查询认证结果 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#get-frv-auth-result - * @param {Object} params - * @param {String} params.certifyId 认证ID - * @returns - */ -module.exports = async function (params) { - const schema = { - certifyId: 'string' - } - - this.middleware.validate(params, schema) - - const { uid } = this.authInfo // 从authInfo中取出uid属性 - const { certifyId } = params // 从params中取出certifyId属性 - - const user = await userCollection.doc(uid).get() // 根据uid查询用户信息 - const userInfo = user.data && user.data[0] // 从查询结果中获取userInfo对象 - - // 如果用户不存在,抛出账户不存在的错误 - if (!userInfo) { - throw { - errCode: ERROR.ACCOUNT_NOT_EXISTS - } - } - - const { realname_auth: realNameAuth = {} } = userInfo - - // 如果用户已经实名认证,抛出已实名认证的错误 - if (realNameAuth.auth_status === REAL_NAME_STATUS.CERTIFIED) { - throw { - errCode: ERROR.REAL_NAME_VERIFIED - } - } - - // 初始化实人认证服务 - const frvManager = uniCloud.getFacialRecognitionVerifyManager({ - requestId: this.getUniCloudRequestId() - }) - - // 调用frvManager的getAuthResult方法,获取认证结果 - const [error, res] = await catchAwait(frvManager.getAuthResult({ - certifyId - })) - - // 如果出现错误,抛出未知错误并打印日志 - if (error) { - console.log(ERROR.UNKNOWN_ERROR, 'error: ', error) - throw error - } - - // 如果认证状态为“PROCESSING”,抛出认证正在处理中的错误 - if (res.authState === 'PROCESSING') { - throw { - errCode: ERROR.FRV_PROCESSING - } - } - - // 如果认证状态为“FAIL”,更新认证日志的状态并抛出认证失败的错误 - if (res.authState === 'FAIL') { - await frvLogsCollection.where({ - certify_id: certifyId - }).update({ - status: REAL_NAME_STATUS.CERTIFY_FAILED - }) - - console.log(ERROR.FRV_FAIL, 'error: ', res) - throw { - errCode: ERROR.FRV_FAIL - } - } - - // 如果认证状态不为“SUCCESS”,抛出未知错误并打印日志 - if (res.authState !== 'SUCCESS') { - console.log(ERROR.UNKNOWN_ERROR, 'source res: ', res) - throw { - errCode: ERROR.UNKNOWN_ERROR - } - } - - // 根据certifyId查询认证记录 - const frvLogs = await frvLogsCollection.where({ - certify_id: certifyId - }).get() - - const log = frvLogs.data && frvLogs.data[0] - - const updateData = { - realname_auth: { - auth_status: REAL_NAME_STATUS.CERTIFIED, - real_name: log.real_name, - identity: log.identity, - auth_date: Date.now(), - type: 0 - } - } - - // 如果获取到了认证照片的地址,则会对其进行下载,并使用uniCloud.uploadFile方法将其上传到云存储,并将上传后的fileID保存起来。 - if (res.pictureUrl) { - const pictureRes = await uniCloud.httpclient.request(res.pictureUrl) - if (pictureRes.status < 400) { - const { - fileID - } = await uniCloud.uploadFile({ - cloudPath: `user/id-card/${uid}.b64`, - cloudPathAsRealPath: true, - fileContent: Buffer.from(encryptData.call(this, pictureRes.data.toString('base64'))) - }) - updateData.realname_auth.in_hand = fileID - } - } - - await Promise.all([ - // 更新用户认证状态 - userCollection.doc(uid).update(updateData), - // 更新实人认证记录状态 - frvLogsCollection.where({ - certify_id: certifyId - }).update({ - status: REAL_NAME_STATUS.CERTIFIED - }) - ]) - - return { - errCode: 0, - authStatus: REAL_NAME_STATUS.CERTIFIED, - realName: dataDesensitization(decryptData.call(this, log.real_name), { onlyLast: true }), // 对姓名进行脱敏处理 - identity: dataDesensitization(decryptData.call(this, log.identity)) // 对身份证号进行脱敏处理 - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/facial-recognition-verify/get-certify-id.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/facial-recognition-verify/get-certify-id.js deleted file mode 100644 index cb8b48b..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/facial-recognition-verify/get-certify-id.js +++ /dev/null @@ -1,99 +0,0 @@ -const { userCollection, REAL_NAME_STATUS, frvLogsCollection, dbCmd } = require('../../common/constants') -const { ERROR } = require('../../common/error') -const { encryptData } = require('../../common/sensitive-aes-cipher') -const { getCurrentDateTimestamp } = require('../../common/utils') - -// const CertifyIdExpired = 25 * 60 * 1000 // certifyId 过期时间为30分钟,在25分时置为过期 - -/** - * 获取认证ID - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#get-frv-certify-id - * @param {Object} params - * @param {String} params.realName 真实姓名 - * @param {String} params.idCard 身份证号码 - * @param {String} params.metaInfo 客户端初始化时返回的metaInfo - * @returns - */ -module.exports = async function (params) { - const schema = { - realName: 'realName', - idCard: 'idCard', - metaInfo: 'string' - } - - this.middleware.validate(params, schema) - - const { realName: originalRealName, idCard: originalIdCard, metaInfo } = params // 解构出传入参数的真实姓名、身份证号码、其他元数据 - const realName = encryptData.call(this, originalRealName) // 对真实姓名进行加密处理 - const idCard = encryptData.call(this, originalIdCard) // 对身份证号码进行加密处理 - - const { uid } = this.authInfo // 获取当前用户的 ID - const idCardCertifyLimit = this.config.idCardCertifyLimit || 1 // 获取身份证认证限制次数,默认为1次 - const realNameCertifyLimit = this.config.realNameCertifyLimit || 5 // 获取实名认证限制次数,默认为5次 - const frvNeedAlivePhoto = this.config.frvNeedAlivePhoto || false // 是否需要拍摄活体照片,默认为 false - - const user = await userCollection.doc(uid).get() // 获取用户信息 - const userInfo = user.data && user.data[0] // 获取用户信息对象中的实名认证信息 - const { realname_auth: realNameAuth = {} } = userInfo // 解构出实名认证信息中的认证状态对象,默认为空对象 - - // 如果用户已经实名认证过,不能再次认证 - if (realNameAuth.auth_status === REAL_NAME_STATUS.CERTIFIED) { - throw { - errCode: ERROR.REAL_NAME_VERIFIED - } - } - - // 查询已经使用同一个身份证认证的账号数量,如果超过限制则不能认证 - const idCardAccount = await userCollection.where({ - realname_auth: { - type: 0, // 用户认证状态是个人 - auth_status: REAL_NAME_STATUS.CERTIFIED, // 认证状态为已认证 - identity: idCard // 身份证号码和传入参数的身份证号码相同 - } - }).get() - if (idCardAccount.data.length >= idCardCertifyLimit) { - throw { - errCode: ERROR.ID_CARD_EXISTS - } - } - - // 查询用户今天已经进行的实名认证次数,如果超过限制则不能认证 - const userFrvLogs = await frvLogsCollection.where({ - user_id: uid, - created_date: dbCmd.gt(getCurrentDateTimestamp()) // 查询今天的认证记录 - }).get() - - // 限制用户每日认证次数 - if (userFrvLogs.data && userFrvLogs.data.length >= realNameCertifyLimit) { - throw { - errCode: ERROR.REAL_NAME_VERIFY_UPPER_LIMIT - } - } - - // 初始化实人认证服务 - const frvManager = uniCloud.getFacialRecognitionVerifyManager({ - requestId: this.getUniCloudRequestId() // 获取当前 - }) - // 调用实人认证服务,获取认证 ID - const res = await frvManager.getCertifyId({ - realName: originalRealName, - idCard: originalIdCard, - needPicture: frvNeedAlivePhoto, - metaInfo - }) - - // 将认证记录插入到实名认证日志中 - await frvLogsCollection.add({ - user_id: uid, - certify_id: res.certifyId, - real_name: realName, - identity: idCard, - status: REAL_NAME_STATUS.WAITING_CERTIFIED, - created_date: Date.now() - }) - - // 返回认证ID - return { - certifyId: res.certifyId - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/facial-recognition-verify/index.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/facial-recognition-verify/index.js deleted file mode 100644 index 63f6b1f..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/facial-recognition-verify/index.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - getFrvCertifyId: require('./get-certify-id'), - getFrvAuthResult: require('./get-auth-result') -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/fission/accept-invite.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/fission/accept-invite.js deleted file mode 100644 index 2461e06..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/fission/accept-invite.js +++ /dev/null @@ -1,25 +0,0 @@ -const { - acceptInvite -} = require('../../lib/utils/fission') - -/** - * 接受邀请 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#accept-invite - * @param {Object} params - * @param {String} params.inviteCode 邀请码 - * @returns - */ -module.exports = async function (params = {}) { - const schema = { - inviteCode: 'string' - } - this.middleware.validate(params, schema) - const { - inviteCode - } = params - const uid = this.authInfo.uid - return acceptInvite({ - uid, - inviteCode - }) -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/fission/get-invited-user.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/fission/get-invited-user.js deleted file mode 100644 index 93d4671..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/fission/get-invited-user.js +++ /dev/null @@ -1,80 +0,0 @@ -const { - userCollection -} = require('../../common/constants') -const { - coverMobile -} = require('../../common/utils') - -/** - * 获取受邀用户 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#get-invited-user - * @param {Object} params - * @param {Number} params.level 获取受邀用户的级数,1表示直接邀请的用户 - * @param {Number} params.limit 返回数据大小 - * @param {Number} params.offset 返回数据偏移 - * @param {Boolean} params.needTotal 是否需要返回总数 - * @returns - */ -module.exports = async function (params = {}) { - const schema = { - level: 'number', - limit: { - required: false, - type: 'number' - }, - offset: { - required: false, - type: 'number' - }, - needTotal: { - required: false, - type: 'boolean' - } - } - this.middleware.validate(params, schema) - const { - level, - limit = 20, - offset = 0, - needTotal = false - } = params - const uid = this.authInfo.uid - const query = { - [`inviter_uid.${level - 1}`]: uid - } - const getUserRes = await userCollection.where(query) - .field({ - _id: true, - avatar: true, - avatar_file: true, - username: true, - nickname: true, - mobile: true, - invite_time: true - }) - .orderBy('invite_time', 'desc') - .skip(offset) - .limit(limit) - .get() - - const invitedUser = getUserRes.data.map(item => { - return { - uid: item._id, - username: item.username, - nickname: item.nickname, - mobile: coverMobile(item.mobile), - inviteTime: item.invite_time, - avatar: item.avatar, - avatarFile: item.avatar_file - } - }) - const result = { - errCode: 0, - invitedUser - } - if (needTotal) { - const getTotalRes = await userCollection.where(query).count() - result.total = getTotalRes.total - } - return result -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/fission/index.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/fission/index.js deleted file mode 100644 index 4a9bee1..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/fission/index.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - acceptInvite: require('./accept-invite'), - getInvitedUser: require('./get-invited-user') -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/index.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/index.js deleted file mode 100644 index f65f58b..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/index.js +++ /dev/null @@ -1,20 +0,0 @@ -module.exports = { - login: require('./login'), - loginBySms: require('./login-by-sms'), - loginByUniverify: require('./login-by-univerify'), - loginByWeixin: require('./login-by-weixin'), - loginByAlipay: require('./login-by-alipay'), - loginByQQ: require('./login-by-qq'), - loginByApple: require('./login-by-apple'), - loginByBaidu: require('./login-by-baidu'), - loginByDingtalk: require('./login-by-dingtalk'), - loginByToutiao: require('./login-by-toutiao'), - loginByDouyin: require('./login-by-douyin'), - loginByWeibo: require('./login-by-weibo'), - loginByTaobao: require('./login-by-taobao'), - loginByEmailLink: require('./login-by-email-link'), - loginByEmailCode: require('./login-by-email-code'), - loginByFacebook: require('./login-by-facebook'), - loginByGoogle: require('./login-by-google'), - loginByWeixinMobile: require('./login-by-weixin-mobile') -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-alipay.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-alipay.js deleted file mode 100644 index d5d4631..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-alipay.js +++ /dev/null @@ -1,70 +0,0 @@ -const { - initAlipay -} = require('../../lib/third-party/index') -const { - ERROR -} = require('../../common/error') -const { - preUnifiedLogin, - postUnifiedLogin -} = require('../../lib/utils/unified-login') -const { - LOG_TYPE -} = require('../../common/constants') - -/** - * 支付宝登录 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#login-by-alipay - * @param {Object} params - * @param {String} params.code 支付宝小程序客户端登录返回的code - * @param {String} params.inviteCode 邀请码 - * @returns - */ -module.exports = async function (params = {}) { - const schema = { - code: 'string', - inviteCode: { - type: 'string', - required: false - } - } - this.middleware.validate(params, schema) - const { - code, - inviteCode - } = params - const alipayApi = initAlipay.call(this) - let getAlipayAccountResult - try { - getAlipayAccountResult = await alipayApi.code2Session(code) - } catch (error) { - console.error(error) - await this.middleware.uniIdLog({ - success: false, - type: LOG_TYPE.LOGIN - }) - throw { - errCode: ERROR.GET_THIRD_PARTY_ACCOUNT_FAILED - } - } - - const { - openid - } = getAlipayAccountResult - - const { - type, - user - } = await preUnifiedLogin.call(this, { - user: { - ali_openid: openid - } - }) - return postUnifiedLogin.call(this, { - user, - extraData: {}, - isThirdParty: true, - type, - inviteCode - }) -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-apple.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-apple.js deleted file mode 100644 index 5f39e62..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-apple.js +++ /dev/null @@ -1,77 +0,0 @@ -const { - initApple -} = require('../../lib/third-party/index') -const { - ERROR -} = require('../../common/error') -const { - preUnifiedLogin, - postUnifiedLogin -} = require('../../lib/utils/unified-login') -const { - LOG_TYPE -} = require('../../common/constants') - -/** - * 苹果登录 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#login-by-apple - * @param {Object} params - * @param {String} params.identityToken 苹果登录返回的identityToken - * @param {String} params.nickname 用户昵称 - * @param {String} params.inviteCode 邀请码 - * @returns - */ -module.exports = async function (params = {}) { - const schema = { - identityToken: 'string', - nickname: { - required: false, - type: 'nickname' - }, - inviteCode: { - required: false, - type: 'string' - } - } - this.middleware.validate(params, schema) - const { - identityToken, - nickname, - inviteCode - } = params - const appleApi = initApple.call(this) - let verifyResult - try { - verifyResult = await appleApi.verifyIdentityToken(identityToken) - } catch (error) { - console.error(error) - await this.middleware.uniIdLog({ - success: false, - type: LOG_TYPE.LOGIN - }) - throw { - errCode: ERROR.GET_THIRD_PARTY_ACCOUNT_FAILED - } - } - const { - openid - } = verifyResult - - const { - type, - user - } = await preUnifiedLogin.call(this, { - user: { - apple_openid: openid - } - }) - return postUnifiedLogin.call(this, { - user, - extraData: { - nickname - }, - isThirdParty: true, - type, - inviteCode - }) -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-baidu.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-baidu.js deleted file mode 100644 index 856449d..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-baidu.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * 百度登录 - * @param {Object} params - * @returns - */ -module.exports = async function (params = {}) { - // 此接口暂未实现,欢迎向我们提交pr - throw new Error('api[loginByBaidu] is not yet implemented') -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-dingtalk.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-dingtalk.js deleted file mode 100644 index afe1f01..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-dingtalk.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * 钉钉登录 - * @param {Object} params - * @returns - */ -module.exports = async function (params = {}) { - // 此接口暂未实现,欢迎向我们提交pr - throw new Error('api[loginByDingtalk] is not yet implemented') -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-douyin.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-douyin.js deleted file mode 100644 index 8cd4ab5..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-douyin.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * 抖音登录 - * @param {Object} params - * @returns - */ -module.exports = async function (params = {}) { - // 此接口暂未实现,欢迎向我们提交pr - throw new Error('api[loginByDouyin] is not yet implemented') -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-email-code.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-email-code.js deleted file mode 100644 index c3af08f..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-email-code.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * 邮箱验证码登录 - * @param {Object} params - * @returns - */ -module.exports = async function (params = {}) { - // 此接口暂未实现,欢迎向我们提交pr - throw new Error('api[loginByEmailCode] is not yet implemented') -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-email-link.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-email-link.js deleted file mode 100644 index 0ebbf3a..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-email-link.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * 邮箱点击链接登录 - * @param {Object} params - * @returns - */ -module.exports = async function (params = {}) { - // 此接口暂未实现,欢迎向我们提交pr - throw new Error('api[loginByEmailLink] is not yet implemented') -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-facebook.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-facebook.js deleted file mode 100644 index 5c93bd4..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-facebook.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Facebook登录 - * @param {Object} params - * @returns - */ -module.exports = async function (params = {}) { - // 此接口暂未实现,欢迎向我们提交pr - throw new Error('api[loginByFacebook] is not yet implemented') -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-google.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-google.js deleted file mode 100644 index 8054ece..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-google.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Google登录 - * @param {Object} params - * @returns - */ -module.exports = async function (params = {}) { - // 此接口暂未实现,欢迎向我们提交pr - throw new Error('api[loginByGoogle] is not yet implemented') -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-qq.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-qq.js deleted file mode 100644 index 1eaa7ba..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-qq.js +++ /dev/null @@ -1,167 +0,0 @@ -const { - initQQ -} = require('../../lib/third-party/index') -const { - ERROR -} = require('../../common/error') -const { - preUnifiedLogin, - postUnifiedLogin -} = require('../../lib/utils/unified-login') -const { - LOG_TYPE -} = require('../../common/constants') -const { - getQQPlatform, - generateQQCache, - saveQQUserKey -} = require('../../lib/utils/qq') -const url = require('url') - -/** - * QQ登录 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#login-by-qq - * @param {Object} params - * @param {String} params.code QQ小程序登录返回的code参数 - * @param {String} params.accessToken App端QQ登录返回的accessToken参数 - * @param {String} params.accessTokenExpired accessToken过期时间,由App端QQ登录返回的expires_in参数计算而来,单位:毫秒 - * @param {String} params.inviteCode 邀请码 - * @returns - */ -module.exports = async function (params = {}) { - const schema = { - code: { - type: 'string', - required: false - }, - accessToken: { - type: 'string', - required: false - }, - accessTokenExpired: { - type: 'number', - required: false - }, - inviteCode: { - type: 'string', - required: false - } - } - this.middleware.validate(params, schema) - const { - code, - accessToken, - accessTokenExpired, - inviteCode - } = params - const { - appId - } = this.getUniversalClientInfo() - const qqApi = initQQ.call(this) - const qqPlatform = getQQPlatform.call(this) - let apiName - switch (qqPlatform) { - case 'mp': - apiName = 'code2Session' - break - case 'app': - apiName = 'getOpenidByToken' - break - default: - throw new Error('Unsupported qq platform') - } - let getQQAccountResult - try { - getQQAccountResult = await qqApi[apiName]({ - code, - accessToken - }) - } catch (error) { - console.error(error) - await this.middleware.uniIdLog({ - success: false, - type: LOG_TYPE.LOGIN - }) - throw { - errCode: ERROR.GET_THIRD_PARTY_ACCOUNT_FAILED - } - } - - const { - openid, - unionid, - // 保存下面的字段 - sessionKey // QQ小程序用户sessionKey - } = getQQAccountResult - - const { - type, - user - } = await preUnifiedLogin.call(this, { - user: { - qq_openid: { - [qqPlatform]: openid - }, - qq_unionid: unionid - } - }) - const extraData = { - qq_openid: { - [`${qqPlatform}_${appId}`]: openid - }, - qq_unionid: unionid - } - if (type === 'register' && qqPlatform !== 'mp') { - const { - nickname, - avatar - } = await qqApi.getUserInfo({ - accessToken, - openid - }) - if (avatar) { - // eslint-disable-next-line n/no-deprecated-api - const extName = url.parse(avatar).pathname.split('.').pop() - const cloudPath = `user/avatar/${openid.slice(-8) + Date.now()}-avatar.${extName}` - const getAvatarRes = await uniCloud.httpclient.request(avatar) - if (getAvatarRes.status >= 400) { - throw { - errCode: ERROR.GET_THIRD_PARTY_USER_INFO_FAILED - } - } - const { - fileID - } = await uniCloud.uploadFile({ - cloudPath, - fileContent: getAvatarRes.data - }) - extraData.avatar_file = { - name: cloudPath, - extname: extName, - url: fileID - } - } - extraData.nickname = nickname - } - await saveQQUserKey.call(this, { - openid, - sessionKey, - accessToken, - accessTokenExpired - }) - return postUnifiedLogin.call(this, { - user, - extraData: { - ...extraData, - ...generateQQCache.call(this, { - openid, - sessionKey, // QQ小程序用户sessionKey - accessToken, // App端QQ用户accessToken - accessTokenExpired // App端QQ用户accessToken过期时间 - }) - }, - isThirdParty: true, - type, - inviteCode - }) -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-sms.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-sms.js deleted file mode 100644 index 915e9b6..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-sms.js +++ /dev/null @@ -1,99 +0,0 @@ -const { - getNeedCaptcha, - verifyCaptcha -} = require('../../lib/utils/captcha') -const { - verifyMobileCode -} = require('../../lib/utils/verify-code') -const { - preUnifiedLogin, - postUnifiedLogin -} = require('../../lib/utils/unified-login') -const { - CAPTCHA_SCENE, - SMS_SCENE, - LOG_TYPE -} = require('../../common/constants') - -/** - * 短信验证码登录 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#login-by-sms - * @param {Object} params - * @param {String} params.mobile 手机号 - * @param {String} params.code 短信验证码 - * @param {String} params.captcha 图形验证码 - * @param {String} params.inviteCode 邀请码 - * @returns - */ -module.exports = async function (params = {}) { - const schema = { - mobile: 'mobile', - code: 'string', - captcha: { - required: false, - type: 'string' - }, - inviteCode: { - required: false, - type: 'string' - } - } - this.middleware.validate(params, schema) - const { - mobile, - code, - captcha, - inviteCode - } = params - - const needCaptcha = await getNeedCaptcha.call(this, { - mobile - }) - - if (needCaptcha) { - await verifyCaptcha.call(this, { - captcha, - scene: CAPTCHA_SCENE.LOGIN_BY_SMS - }) - } - - try { - await verifyMobileCode({ - mobile, - code, - scene: SMS_SCENE.LOGIN_BY_SMS - }) - } catch (error) { - console.log(error, { - mobile, - code, - type: SMS_SCENE.LOGIN_BY_SMS - }) - await this.middleware.uniIdLog({ - success: false, - data: { - mobile - }, - type: LOG_TYPE.LOGIN - }) - throw error - } - - const { - type, - user - } = await preUnifiedLogin.call(this, { - user: { - mobile - } - }) - return postUnifiedLogin.call(this, { - user, - extraData: { - mobile_confirmed: 1 - }, - isThirdParty: false, - type, - inviteCode - }) -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-taobao.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-taobao.js deleted file mode 100644 index 6a6d599..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-taobao.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * 淘宝登录 - * @param {Object} params - * @returns - */ -module.exports = async function (params = {}) { - // 此接口暂未实现,欢迎向我们提交pr - throw new Error('api[loginByTaobao] is not yet implemented') -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-toutiao.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-toutiao.js deleted file mode 100644 index 133aadb..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-toutiao.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * 头条登录 - * @param {Object} params - * @returns - */ -module.exports = async function (params = {}) { - // 此接口暂未实现,欢迎向我们提交pr - throw new Error('api[loginByToutiao] is not yet implemented') -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-univerify.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-univerify.js deleted file mode 100644 index 53e681c..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-univerify.js +++ /dev/null @@ -1,69 +0,0 @@ -const { - getPhoneNumber -} = require('../../lib/utils/univerify') -const { - preUnifiedLogin, - postUnifiedLogin -} = require('../../lib/utils/unified-login') -const { - LOG_TYPE -} = require('../../common/constants') - -/** - * App端一键登录 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#login-by-univerify - * @param {Object} params - * @param {String} params.access_token APP端一键登录返回的access_token - * @param {String} params.openid APP端一键登录返回的openid - * @param {String} params.inviteCode 邀请码 - * @returns - */ -module.exports = async function (params = {}) { - const schema = { - access_token: 'string', - openid: 'string', - inviteCode: { - required: false, - type: 'string' - } - } - this.middleware.validate(params, schema) - const { - // eslint-disable-next-line camelcase - access_token, - openid, - inviteCode - } = params - - let mobile - try { - const phoneInfo = await getPhoneNumber.call(this, { - // eslint-disable-next-line camelcase - access_token, - openid - }) - mobile = phoneInfo.phoneNumber - } catch (error) { - await this.middleware.uniIdLog({ - success: false, - type: LOG_TYPE.LOGIN - }) - throw error - } - const { - user, - type - } = await preUnifiedLogin.call(this, { - user: { - mobile - } - }) - return postUnifiedLogin.call(this, { - user, - extraData: { - mobile_confirmed: 1 - }, - type, - inviteCode - }) -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-weibo.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-weibo.js deleted file mode 100644 index 496cdb4..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-weibo.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * 微博登录 - * @param {Object} params - * @returns - */ -module.exports = async function (params = {}) { - // 此接口暂未实现,欢迎向我们提交pr - throw new Error('api[loginByWeibo] is not yet implemented') -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-weixin-mobile.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-weixin-mobile.js deleted file mode 100644 index c27c2b2..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-weixin-mobile.js +++ /dev/null @@ -1,106 +0,0 @@ -const { - initWeixin -} = require('../../lib/third-party/index') -const { - getWeixinAccessToken -} = require('../../lib/utils/weixin') -const { - ERROR -} = require('../../common/error') -const { - preUnifiedLogin, - postUnifiedLogin -} = require('../../lib/utils/unified-login') -const { - LOG_TYPE -} = require('../../common/constants') -const { - preBind, - postBind -} = require('../../lib/utils/relate') - -/** - * 微信授权手机号登录 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#login-by-weixin-mobile - * @param {Object} params - * @param {String} params.phoneCode 微信手机号返回的code - * @param {String} params.inviteCode 邀请码 - * @returns - */ -module.exports = async function (params = {}) { - const schema = { - phoneCode: 'string', - inviteCode: { - type: 'string', - required: false - } - } - - this.middleware.validate(params, schema) - - const { phoneCode, inviteCode } = params - - const weixinApi = initWeixin.call(this) - let mobile - - try { - const accessToken = await getWeixinAccessToken.call(this) - const mobileRes = await weixinApi.getPhoneNumber(accessToken, phoneCode) - mobile = mobileRes.purePhoneNumber - } catch (error) { - console.error(error) - await this.middleware.uniIdLog({ - success: false, - type: LOG_TYPE.LOGIN - }) - throw { - errCode: ERROR.GET_THIRD_PARTY_ACCOUNT_FAILED - } - } - - const { type, user } = await preUnifiedLogin.call(this, { - user: { - mobile - } - }) - - let extraData = { - mobile_confirmed: 1 - } - - if (type === 'login') { - // 绑定手机号 - if (!user.mobile_confirmed) { - const bindAccount = { - mobile - } - await preBind.call(this, { - uid: user._id, - bindAccount, - logType: LOG_TYPE.BIND_MOBILE - }) - await postBind.call(this, { - uid: user._id, - bindAccount, - extraData: { - mobile_confirmed: 1 - }, - logType: LOG_TYPE.BIND_MOBILE - }) - extraData = { - ...extraData, - ...bindAccount - } - } - } - - return postUnifiedLogin.call(this, { - user, - extraData: { - ...extraData - }, - isThirdParty: false, - type, - inviteCode - }) -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-weixin.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-weixin.js deleted file mode 100644 index b50f9a5..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login-by-weixin.js +++ /dev/null @@ -1,176 +0,0 @@ -const { - initWeixin -} = require('../../lib/third-party/index') -const { - ERROR -} = require('../../common/error') -const { - preUnifiedLogin, - postUnifiedLogin -} = require('../../lib/utils/unified-login') -const { - generateWeixinCache, - getWeixinPlatform, - saveWeixinUserKey, - saveSecureNetworkCache -} = require('../../lib/utils/weixin') -const { - LOG_TYPE -} = require('../../common/constants') -const url = require('url') - -/** - * 微信登录 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#login-by-weixin - * @param {Object} params - * @param {String} params.code 微信登录返回的code - * @param {String} params.inviteCode 邀请码 - * @returns - */ -module.exports = async function (params = {}) { - const schema = { - code: 'string', - inviteCode: { - type: 'string', - required: false - } - } - this.middleware.validate(params, schema) - const { - code, - inviteCode, - // 内部参数,暂不暴露 - secureNetworkCache = false - } = params - const { - appId - } = this.getUniversalClientInfo() - const weixinApi = initWeixin.call(this) - const weixinPlatform = getWeixinPlatform.call(this) - let apiName - switch (weixinPlatform) { - case 'mp': - apiName = 'code2Session' - break - case 'app': - case 'h5': - case 'web': - apiName = 'getOauthAccessToken' - break - default: - throw new Error('Unsupported weixin platform') - } - let getWeixinAccountResult - try { - getWeixinAccountResult = await weixinApi[apiName](code) - } catch (error) { - console.error(error) - await this.middleware.uniIdLog({ - success: false, - type: LOG_TYPE.LOGIN - }) - throw { - errCode: ERROR.GET_THIRD_PARTY_ACCOUNT_FAILED - } - } - - const { - openid, - unionid, - // 保存下面四个字段 - sessionKey, // 微信小程序用户sessionKey - accessToken, // App端微信用户accessToken - refreshToken, // App端微信用户refreshToken - expired: accessTokenExpired // App端微信用户accessToken过期时间 - } = getWeixinAccountResult - - if (secureNetworkCache) { - if (weixinPlatform !== 'mp') { - throw new Error('Unsupported weixin platform, expect mp-weixin') - } - await saveSecureNetworkCache.call(this, { - code, - openid, - unionid, - sessionKey - }) - } - - const { - type, - user - } = await preUnifiedLogin.call(this, { - user: { - wx_openid: { - [weixinPlatform]: openid - }, - wx_unionid: unionid - } - }) - const extraData = { - wx_openid: { - [`${weixinPlatform}_${appId}`]: openid - }, - wx_unionid: unionid - } - if (type === 'register' && weixinPlatform !== 'mp') { - const { - nickname, - avatar - } = await weixinApi.getUserInfo({ - accessToken, - openid - }) - - if (avatar) { - // eslint-disable-next-line n/no-deprecated-api - const avatarPath = url.parse(avatar).pathname - const extName = avatarPath.indexOf('.') > -1 ? url.parse(avatar).pathname.split('.').pop() : 'jpg' - const cloudPath = `user/avatar/${openid.slice(-8) + Date.now()}-avatar.${extName}` - const getAvatarRes = await uniCloud.httpclient.request(avatar) - if (getAvatarRes.status >= 400) { - throw { - errCode: ERROR.GET_THIRD_PARTY_USER_INFO_FAILED - } - } - - const { - fileID - } = await uniCloud.uploadFile({ - cloudPath, - fileContent: getAvatarRes.data - }) - - extraData.avatar_file = { - name: cloudPath, - extname: extName, - url: fileID - } - } - - extraData.nickname = nickname - } - await saveWeixinUserKey.call(this, { - openid, - sessionKey, - accessToken, - refreshToken, - accessTokenExpired - }) - return postUnifiedLogin.call(this, { - user, - extraData: { - ...extraData, - ...generateWeixinCache.call(this, { - openid, - sessionKey, // 微信小程序用户sessionKey - accessToken, // App端微信用户accessToken - refreshToken, // App端微信用户refreshToken - accessTokenExpired // App端微信用户accessToken过期时间 - }) - }, - isThirdParty: true, - type, - inviteCode - }) -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login.js deleted file mode 100644 index 97e9cfe..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/login/login.js +++ /dev/null @@ -1,94 +0,0 @@ -const { - preLoginWithPassword, - postLogin -} = require('../../lib/utils/login') -const { - getNeedCaptcha, - verifyCaptcha -} = require('../../lib/utils/captcha') -const { - CAPTCHA_SCENE -} = require('../../common/constants') -const { - ERROR -} = require('../../common/error') - -/** - * 用户名密码登录 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#login - * @param {Object} params - * @param {String} params.username 用户名 - * @param {String} params.mobile 手机号 - * @param {String} params.email 邮箱 - * @param {String} params.password 密码 - * @param {String} params.captcha 图形验证码 - * @returns - */ -module.exports = async function (params = {}) { - const schema = { - username: { - required: false, - type: 'username' - }, - mobile: { - required: false, - type: 'mobile' - }, - email: { - required: false, - type: 'email' - }, - password: 'password', - captcha: { - required: false, - type: 'string' - } - } - this.middleware.validate(params, schema) - const { - username, - mobile, - email, - password, - captcha - } = params - if (!username && !mobile && !email) { - throw { - errCode: ERROR.INVALID_USERNAME - } - } else if ( - (username && email) || - (username && mobile) || - (email && mobile) - ) { - throw { - errCode: ERROR.INVALID_PARAM - } - } - const needCaptcha = await getNeedCaptcha.call(this, { - username, - mobile, - email - }) - if (needCaptcha) { - await verifyCaptcha.call(this, { - captcha, - scene: CAPTCHA_SCENE.LOGIN_BY_PWD - }) - } - const { - user, - extraData - } = await preLoginWithPassword.call(this, { - user: { - username, - mobile, - email - }, - password - }) - return postLogin.call(this, { - user, - extraData - }) -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/logout/index.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/logout/index.js deleted file mode 100644 index 544be2b..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/logout/index.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - logout: require('./logout') -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/logout/logout.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/logout/logout.js deleted file mode 100644 index 7d491c6..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/logout/logout.js +++ /dev/null @@ -1,15 +0,0 @@ -const { - logout -} = require('../../lib/utils/logout') - -/** - * 用户退出登录 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#logout - * @returns - */ -module.exports = async function () { - await logout.call(this) - return { - errCode: 0 - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/multi-end/authorize-app-login.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/multi-end/authorize-app-login.js deleted file mode 100644 index 8f8a167..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/multi-end/authorize-app-login.js +++ /dev/null @@ -1,37 +0,0 @@ -const { - isAuthorizeApproved -} = require('./utils') -const { - dbCmd, - userCollection -} = require('../../common/constants') - -/** - * 授权用户登录应用 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#authorize-app-login - * @param {Object} params - * @param {String} params.uid 用户id - * @param {String} params.appId 授权的应用的AppId - * @returns - */ -module.exports = async function (params = {}) { - const schema = { - uid: 'string', - appId: 'string' - } - this.middleware.validate(params, schema) - const { - uid, - appId - } = params - await isAuthorizeApproved({ - uid, - appIdList: [appId] - }) - await userCollection.doc(uid).update({ - dcloud_appid: dbCmd.push(appId) - }) - return { - errCode: 0 - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/multi-end/index.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/multi-end/index.js deleted file mode 100644 index ce9cc7b..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/multi-end/index.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - authorizeAppLogin: require('./authorize-app-login'), - removeAuthorizedApp: require('./remove-authorized-app'), - setAuthorizedApp: require('./set-authorized-app') -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/multi-end/remove-authorized-app.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/multi-end/remove-authorized-app.js deleted file mode 100644 index df82184..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/multi-end/remove-authorized-app.js +++ /dev/null @@ -1,30 +0,0 @@ -const { - dbCmd, - userCollection -} = require('../../common/constants') - -/** - * 移除用户登录授权 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#remove-authorized-app - * @param {Object} params - * @param {String} params.uid 用户id - * @param {String} params.appId 取消授权的应用的AppId - * @returns - */ -module.exports = async function (params = {}) { - const schema = { - uid: 'string', - appId: 'string' - } - this.middleware.validate(params, schema) - const { - uid, - appId - } = params - await userCollection.doc(uid).update({ - dcloud_appid: dbCmd.pull(appId) - }) - return { - errCode: 0 - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/multi-end/set-authorized-app.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/multi-end/set-authorized-app.js deleted file mode 100644 index a438ef9..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/multi-end/set-authorized-app.js +++ /dev/null @@ -1,36 +0,0 @@ -const { - isAuthorizeApproved -} = require('./utils') -const { - userCollection -} = require('../../common/constants') - -/** - * 设置用户允许登录的应用列表 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#set-authorized-app - * @param {Object} params - * @param {String} params.uid 用户id - * @param {Array} params.appIdList 允许登录的应用AppId列表 - * @returns - */ -module.exports = async function (params = {}) { - const schema = { - uid: 'string', - appIdList: 'array' - } - this.middleware.validate(params, schema) - const { - uid, - appIdList - } = params - await isAuthorizeApproved({ - uid, - appIdList - }) - await userCollection.doc(uid).update({ - dcloud_appid: appIdList - }) - return { - errCode: 0 - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/multi-end/utils.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/multi-end/utils.js deleted file mode 100644 index 4ee4e26..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/multi-end/utils.js +++ /dev/null @@ -1,38 +0,0 @@ -const { - userCollection -} = require('../../common/constants') -const { - ERROR -} = require('../../common/error') -const { - findUser -} = require('../../lib/utils/account') - -async function isAuthorizeApproved ({ - uid, - appIdList -} = {}) { - const getUserRes = await userCollection.doc(uid).get() - const userRecord = getUserRes.data[0] - if (!userRecord) { - throw { - errCode: ERROR.ACCOUNT_NOT_EXISTS - } - } - const { - userMatched - } = await findUser({ - userQuery: userRecord, - authorizedApp: appIdList - }) - - if (userMatched.some(item => item._id !== uid)) { - throw { - errCode: ERROR.ACCOUNT_CONFLICT - } - } -} - -module.exports = { - isAuthorizeApproved -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/register/index.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/register/index.js deleted file mode 100644 index 64ff603..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/register/index.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - registerUser: require('./register-user'), - registerAdmin: require('./register-admin'), - registerUserByEmail: require('./register-user-by-email') -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/register/register-admin.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/register/register-admin.js deleted file mode 100644 index 5e122ab..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/register/register-admin.js +++ /dev/null @@ -1,72 +0,0 @@ -const { - userCollection -} = require('../../common/constants') -const { - ERROR -} = require('../../common/error') -const { - preRegisterWithPassword, - postRegister -} = require('../../lib/utils/register') - -/** - * 注册管理员 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#register-admin - * @param {Object} params - * @param {String} params.username 用户名 - * @param {String} params.password 密码 - * @param {String} params.nickname 昵称 - * @returns - */ -module.exports = async function (params = {}) { - const schema = { - username: 'username', - password: 'password', - nickname: { - type: 'nickname', - required: false - } - } - this.middleware.validate(params, schema) - const { - username, - password, - nickname - } = params - const getAdminRes = await userCollection.where({ - role: 'admin' - }).limit(1).get() - if (getAdminRes.data.length > 0) { - const [admin] = getAdminRes.data - const appId = this.getUniversalClientInfo().appId - - if (!admin.dcloud_appid || (admin.dcloud_appid && admin.dcloud_appid.includes(appId))) { - return { - errCode: ERROR.ADMIN_EXISTS, - errMsg: this.t('uni-id-admin-exists') - } - } else { - return { - errCode: ERROR.ADMIN_EXISTS, - errMsg: this.t('uni-id-admin-exist-in-other-apps') - } - } - } - const { - user, - extraData - } = await preRegisterWithPassword.call(this, { - user: { - username - }, - password - }) - return postRegister.call(this, { - user, - extraData: { - ...extraData, - nickname, - role: ['admin'] - } - }) -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/register/register-user-by-email.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/register/register-user-by-email.js deleted file mode 100644 index b52c1d2..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/register/register-user-by-email.js +++ /dev/null @@ -1,87 +0,0 @@ -const { - postRegister, - preRegisterWithPassword -} = require('../../lib/utils/register') -const { - verifyCaptcha -} = require('../../lib/utils/captcha') -const { - CAPTCHA_SCENE, - EMAIL_SCENE, - LOG_TYPE -} = require('../../common/constants') -const { - verifyEmailCode -} = require('../../lib/utils/verify-code') - -/** - * 通过邮箱+验证码注册普通用户 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#register-user-by-email - * @param {Object} params - * @param {String} params.email 邮箱 - * @param {String} params.password 密码 - * @param {String} params.nickname 昵称 - * @param {String} params.code 邮箱验证码 - * @param {String} params.inviteCode 邀请码 - * @returns - */ -module.exports = async function (params = {}) { - const schema = { - email: 'email', - password: 'password', - nickname: { - required: false, - type: 'nickname' - }, - code: 'string', - inviteCode: { - required: false, - type: 'string' - } - } - this.middleware.validate(params, schema) - const { - email, - password, - nickname, - code, - inviteCode - } = params - - try { - // 验证邮箱验证码,验证不通过时写入失败日志 - await verifyEmailCode({ - email, - code, - scene: EMAIL_SCENE.REGISTER - }) - } catch (error) { - await this.middleware.uniIdLog({ - data: { - email - }, - type: LOG_TYPE.REGISTER, - success: false - }) - throw error - } - - const { - user, - extraData - } = await preRegisterWithPassword.call(this, { - user: { - email - }, - password - }) - return postRegister.call(this, { - user, - extraData: { - ...extraData, - nickname, - email_confirmed: 1 - }, - inviteCode - }) -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/register/register-user.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/register/register-user.js deleted file mode 100644 index 130dece..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/register/register-user.js +++ /dev/null @@ -1,68 +0,0 @@ -const { - postRegister, - preRegisterWithPassword -} = require('../../lib/utils/register') -const { - verifyCaptcha -} = require('../../lib/utils/captcha') -const { - CAPTCHA_SCENE -} = require('../../common/constants') - -/** - * 注册普通用户 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#register-user - * @param {Object} params - * @param {String} params.username 用户名 - * @param {String} params.password 密码 - * @param {String} params.captcha 图形验证码 - * @param {String} params.nickname 昵称 - * @param {String} params.inviteCode 邀请码 - * @returns - */ -module.exports = async function (params = {}) { - const schema = { - username: 'username', - password: 'password', - captcha: 'string', - nickname: { - required: false, - type: 'nickname' - }, - inviteCode: { - required: false, - type: 'string' - } - } - this.middleware.validate(params, schema) - const { - username, - password, - nickname, - captcha, - inviteCode - } = params - - await verifyCaptcha.call(this, { - captcha, - scene: CAPTCHA_SCENE.REGISTER - }) - - const { - user, - extraData - } = await preRegisterWithPassword.call(this, { - user: { - username - }, - password - }) - return postRegister.call(this, { - user, - extraData: { - ...extraData, - nickname - }, - inviteCode - }) -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/bind-alipay.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/bind-alipay.js deleted file mode 100644 index bdb451b..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/bind-alipay.js +++ /dev/null @@ -1,63 +0,0 @@ -const { - preBind, - postBind -} = require('../../lib/utils/relate') -const { - LOG_TYPE -} = require('../../common/constants') -const { - ERROR -} = require('../../common/error') -const { - initAlipay -} = require('../../lib/third-party/index') - -/** - * 绑定支付宝账号 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#bind-alipay - * @param {Object} params - * @param {String} params.code 支付宝小程序登录返回的code参数 - * @returns - */ -module.exports = async function (params = {}) { - const schema = { - code: 'string' - } - this.middleware.validate(params, schema) - const uid = this.authInfo.uid - const { - code - } = params - const alipayApi = initAlipay.call(this) - let getAlipayAccountResult - try { - getAlipayAccountResult = await alipayApi().code2Session(code) - } catch (error) { - await this.middleware.uniIdLog({ - success: false, - type: LOG_TYPE.BIND_ALIPAY - }) - throw { - errCode: ERROR.GET_THIRD_PARTY_ACCOUNT_FAILED - } - } - - const { - openid - } = getAlipayAccountResult - - const bindAccount = { - ali_openid: openid - } - await preBind.call(this, { - uid, - bindAccount, - logType: LOG_TYPE.BIND_APPLE - }) - return postBind.call(this, { - uid, - bindAccount, - extraData: {}, - logType: LOG_TYPE.BIND_APPLE - }) -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/bind-apple.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/bind-apple.js deleted file mode 100644 index eb87f8b..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/bind-apple.js +++ /dev/null @@ -1,62 +0,0 @@ -const { - preBind, - postBind -} = require('../../lib/utils/relate') -const { - LOG_TYPE -} = require('../../common/constants') -const { - ERROR -} = require('../../common/error') -const { - initApple -} = require('../../lib/third-party/index') - -/** - * 绑定苹果账号 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#bind-apple - * @param {Object} params - * @param {String} params.identityToken 苹果登录返回identityToken - * @returns - */ -module.exports = async function (params = {}) { - const schema = { - identityToken: 'string' - } - this.middleware.validate(params, schema) - const uid = this.authInfo.uid - const { - identityToken - } = params - const appleApi = initApple.call(this) - let verifyResult - try { - verifyResult = await appleApi.verifyIdentityToken(identityToken) - } catch (error) { - await this.middleware.uniIdLog({ - success: false, - type: LOG_TYPE.BIND_APPLE - }) - throw { - errCode: ERROR.GET_THIRD_PARTY_ACCOUNT_FAILED - } - } - const { - openid - } = verifyResult - - const bindAccount = { - apple_openid: openid - } - await preBind.call(this, { - uid, - bindAccount, - logType: LOG_TYPE.BIND_APPLE - }) - return postBind.call(this, { - uid, - bindAccount, - extraData: {}, - logType: LOG_TYPE.BIND_APPLE - }) -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/bind-mobile-by-mp-weixin.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/bind-mobile-by-mp-weixin.js deleted file mode 100644 index f4c2bd0..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/bind-mobile-by-mp-weixin.js +++ /dev/null @@ -1,104 +0,0 @@ -const { - preBind, - postBind -} = require('../../lib/utils/relate') -const { - LOG_TYPE -} = require('../../common/constants') -const { - decryptWeixinData, - getWeixinCache, getWeixinAccessToken -} = require('../../lib/utils/weixin') -const { initWeixin } = require('../../lib/third-party') -const { ERROR } = require('../../common/error') - -/** - * 通过微信绑定手机号 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#bind-mobile-by-mp-weixin - * @param {Object} params - * @param {String} params.encryptedData 微信获取手机号返回的加密信息 - * @param {String} params.iv 微信获取手机号返回的初始向量 - * @param {String} params.code 微信获取手机号返回的code - * @returns - */ -module.exports = async function (params = {}) { - /** - * 微信小程序的规则是客户端应先使用checkSession接口检测上次获取的sessionKey是否仍有效 - * 如果有效则直接使用上次存储的sessionKey即可 - * 如果无效应重新调用login接口再次刷新sessionKey - * 因此此接口不应直接使用客户端login获取的code,只能使用缓存的sessionKey - */ - const schema = { - encryptedData: { - required: false, - type: 'string' - }, - iv: { - required: false, - type: 'string' - }, - code: { - required: false, - type: 'string' - } - } - const { - encryptedData, - iv, - code - } = params - this.middleware.validate(params, schema) - - if ((!encryptedData && !iv) && !code) { - return { - errCode: ERROR.INVALID_PARAM - } - } - - const uid = this.authInfo.uid - - let mobile - if (code) { - // 区分客户端类型 小程序还是App - const accessToken = await getWeixinAccessToken.call(this) - const weixinApi = initWeixin.call(this) - const res = await weixinApi.getPhoneNumber(accessToken, code) - - mobile = res.purePhoneNumber - } else { - const sessionKey = await getWeixinCache.call(this, { - uid, - key: 'session_key' - }) - if (!sessionKey) { - throw new Error('Session key not found') - } - const res = decryptWeixinData.call(this, { - encryptedData, - sessionKey, - iv - }) - - mobile = res.purePhoneNumber - } - - const bindAccount = { - mobile - } - await preBind.call(this, { - uid, - bindAccount, - logType: LOG_TYPE.BIND_MOBILE - }) - await postBind.call(this, { - uid, - bindAccount, - extraData: { - mobile_confirmed: 1 - }, - logType: LOG_TYPE.BIND_MOBILE - }) - return { - errCode: 0 - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/bind-mobile-by-sms.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/bind-mobile-by-sms.js deleted file mode 100644 index 1640c2d..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/bind-mobile-by-sms.js +++ /dev/null @@ -1,92 +0,0 @@ -const { - getNeedCaptcha, - verifyCaptcha -} = require('../../lib/utils/captcha') -const { - LOG_TYPE, - SMS_SCENE, - CAPTCHA_SCENE -} = require('../../common/constants') -const { - verifyMobileCode -} = require('../../lib/utils/verify-code') -const { - preBind, - postBind -} = require('../../lib/utils/relate') - -/** - * 通过短信验证码绑定手机号 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#bind-mobile-by-sms - * @param {Object} params - * @param {String} params.mobile 手机号 - * @param {String} params.code 短信验证码 - * @param {String} params.captcha 图形验证码 - * @returns - */ -module.exports = async function (params = {}) { - const schema = { - mobile: 'mobile', - code: 'string', - captcha: { - type: 'string', - required: false - } - } - const { - mobile, - code, - captcha - } = params - this.middleware.validate(params, schema) - const uid = this.authInfo.uid - - // 判断是否需要验证码 - const needCaptcha = await getNeedCaptcha.call(this, { - uid, - type: LOG_TYPE.BIND_MOBILE - }) - if (needCaptcha) { - await verifyCaptcha.call(this, { - captcha, - scene: CAPTCHA_SCENE.BIND_MOBILE_BY_SMS - }) - } - - try { - // 验证手机号验证码,验证不通过时写入失败日志 - await verifyMobileCode({ - mobile, - code, - scene: SMS_SCENE.BIND_MOBILE_BY_SMS - }) - } catch (error) { - await this.middleware.uniIdLog({ - data: { - user_id: uid - }, - type: LOG_TYPE.BIND_MOBILE, - success: false - }) - throw error - } - const bindAccount = { - mobile - } - await preBind.call(this, { - uid, - bindAccount, - logType: LOG_TYPE.BIND_MOBILE - }) - await postBind.call(this, { - uid, - bindAccount, - extraData: { - mobile_confirmed: 1 - }, - logType: LOG_TYPE.BIND_MOBILE - }) - return { - errCode: 0 - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/bind-mobile-by-univerify.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/bind-mobile-by-univerify.js deleted file mode 100644 index 2970c61..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/bind-mobile-by-univerify.js +++ /dev/null @@ -1,70 +0,0 @@ -const { - getPhoneNumber -} = require('../../lib/utils/univerify') -const { - LOG_TYPE -} = require('../../common/constants') -const { - preBind, - postBind -} = require('../../lib/utils/relate') - -/** - * 通过一键登录绑定手机号 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#bind-mobile-by-univerify - * @param {Object} params - * @param {String} params.openid APP端一键登录返回的openid - * @param {String} params.access_token APP端一键登录返回的access_token - * @returns - */ -module.exports = async function (params = {}) { - const schema = { - openid: 'string', - access_token: 'string' - } - const { - openid, - // eslint-disable-next-line camelcase - access_token - } = params - this.middleware.validate(params, schema) - const uid = this.authInfo.uid - let mobile - try { - const phoneInfo = await getPhoneNumber.call(this, { - // eslint-disable-next-line camelcase - access_token, - openid - }) - mobile = phoneInfo.phoneNumber - } catch (error) { - await this.middleware.uniIdLog({ - success: false, - data: { - user_id: uid - }, - type: LOG_TYPE.BIND_MOBILE - }) - throw error - } - - const bindAccount = { - mobile - } - await preBind.call(this, { - uid, - bindAccount, - logType: LOG_TYPE.BIND_MOBILE - }) - await postBind.call(this, { - uid, - bindAccount, - extraData: { - mobile_confirmed: 1 - }, - logType: LOG_TYPE.BIND_MOBILE - }) - return { - errCode: 0 - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/bind-qq.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/bind-qq.js deleted file mode 100644 index 574f917..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/bind-qq.js +++ /dev/null @@ -1,110 +0,0 @@ -const { - preBind, - postBind -} = require('../../lib/utils/relate') -const { - LOG_TYPE -} = require('../../common/constants') -const { - ERROR -} = require('../../common/error') -const { - initQQ -} = require('../../lib/third-party/index') -const { - generateQQCache, - getQQPlatform, - saveQQUserKey -} = require('../../lib/utils/qq') - -/** - * 绑定QQ - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#bind-qq - * @param {Object} params - * @param {String} params.code 小程序端QQ登录返回的code - * @param {String} params.accessToken APP端QQ登录返回的accessToken - * @param {String} params.accessTokenExpired accessToken过期时间,由App端QQ登录返回的expires_in参数计算而来,单位:毫秒 - * @returns - */ -module.exports = async function (params = {}) { - const schema = { - code: { - type: 'string', - required: false - }, - accessToken: { - type: 'string', - required: false - }, - accessTokenExpired: { - type: 'number', - required: false - } - } - this.middleware.validate(params, schema) - const uid = this.authInfo.uid - const { - code, - accessToken, - accessTokenExpired - } = params - const qqPlatform = getQQPlatform.call(this) - const appId = this.getUniversalClientInfo().appId - const qqApi = initQQ.call(this) - const clientPlatform = this.clientPlatform - const apiName = clientPlatform === 'mp-qq' ? 'code2Session' : 'getOpenidByToken' - let getQQAccountResult - try { - getQQAccountResult = await qqApi[apiName]({ - code, - accessToken - }) - } catch (error) { - await this.middleware.uniIdLog({ - success: false, - type: LOG_TYPE.BIND_QQ - }) - throw { - errCode: ERROR.GET_THIRD_PARTY_ACCOUNT_FAILED - } - } - - const { - openid, - unionid, - // 保存下面四个字段 - sessionKey // 微信小程序用户sessionKey - } = getQQAccountResult - - const bindAccount = { - qq_openid: { - [qqPlatform]: openid - }, - qq_unionid: unionid - } - await preBind.call(this, { - uid, - bindAccount, - logType: LOG_TYPE.BIND_QQ - }) - await saveQQUserKey.call(this, { - openid, - sessionKey, - accessToken, - accessTokenExpired - }) - return postBind.call(this, { - uid, - bindAccount, - extraData: { - qq_openid: { - [`${qqPlatform}_${appId}`]: openid - }, - ...generateQQCache.call(this, { - openid, - sessionKey - }) - }, - logType: LOG_TYPE.BIND_QQ - }) -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/bind-weixin.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/bind-weixin.js deleted file mode 100644 index d649478..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/bind-weixin.js +++ /dev/null @@ -1,100 +0,0 @@ -const { - preBind, - postBind -} = require('../../lib/utils/relate') -const { - LOG_TYPE -} = require('../../common/constants') -const { - generateWeixinCache, - saveWeixinUserKey, - getWeixinPlatform -} = require('../../lib/utils/weixin') -const { - initWeixin -} = require('../../lib/third-party/index') -const { - ERROR -} = require('../../common/error') - -/** - * 绑定微信 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#bind-weixin - * @param {Object} params - * @param {String} params.code 微信登录返回的code - * @returns - */ -module.exports = async function (params = {}) { - const schema = { - code: 'string' - } - this.middleware.validate(params, schema) - const uid = this.authInfo.uid - const { - code - } = params - const weixinPlatform = getWeixinPlatform.call(this) - const appId = this.getUniversalClientInfo().appId - - const weixinApi = initWeixin.call(this) - const clientPlatform = this.clientPlatform - const apiName = clientPlatform === 'mp-weixin' ? 'code2Session' : 'getOauthAccessToken' - let getWeixinAccountResult - try { - getWeixinAccountResult = await weixinApi[apiName](code) - } catch (error) { - await this.middleware.uniIdLog({ - success: false, - type: LOG_TYPE.BIND_WEIXIN - }) - throw { - errCode: ERROR.GET_THIRD_PARTY_ACCOUNT_FAILED - } - } - - const { - openid, - unionid, - // 保存下面四个字段 - sessionKey, // 微信小程序用户sessionKey - accessToken, // App端微信用户accessToken - refreshToken, // App端微信用户refreshToken - expired: accessTokenExpired // App端微信用户accessToken过期时间 - } = getWeixinAccountResult - - const bindAccount = { - wx_openid: { - [weixinPlatform]: openid - }, - wx_unionid: unionid - } - await preBind.call(this, { - uid, - bindAccount, - logType: LOG_TYPE.BIND_WEIXIN - }) - await saveWeixinUserKey.call(this, { - openid, - sessionKey, - accessToken, - refreshToken, - accessTokenExpired - }) - return postBind.call(this, { - uid, - bindAccount, - extraData: { - wx_openid: { - [`${weixinPlatform}_${appId}`]: openid - }, - ...generateWeixinCache.call(this, { - openid, - sessionKey, // 微信小程序用户sessionKey - accessToken, // App端微信用户accessToken - refreshToken, // App端微信用户refreshToken - accessTokenExpired // App端微信用户accessToken过期时间 - }) - }, - logType: LOG_TYPE.BIND_WEIXIN - }) -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/index.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/index.js deleted file mode 100644 index 4d99c02..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/index.js +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = { - bindMobileBySms: require('./bind-mobile-by-sms'), - bindMobileByUniverify: require('./bind-mobile-by-univerify'), - bindMobileByMpWeixin: require('./bind-mobile-by-mp-weixin'), - bindAlipay: require('./bind-alipay'), - bindApple: require('./bind-apple'), - bindQQ: require('./bind-qq'), - bindWeixin: require('./bind-weixin'), - unbindWeixin: require('./unbind-weixin'), - unbindAlipay: require('./unbind-alipay'), - unbindQQ: require('./unbind-qq'), - unbindApple: require('./unbind-apple') -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/unbind-alipay.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/unbind-alipay.js deleted file mode 100644 index 67bb43b..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/unbind-alipay.js +++ /dev/null @@ -1,32 +0,0 @@ -const { - preUnBind, - postUnBind -} = require('../../lib/utils/relate') -const { - LOG_TYPE, dbCmd -} = require('../../common/constants') - -/** - * 解绑支付宝 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#unbind-alipay - * @returns - */ -module.exports = async function () { - const { uid } = this.authInfo - - await preUnBind.call(this, { - uid, - unBindAccount: { - ali_openid: dbCmd.exists(true) - }, - logType: LOG_TYPE.UNBIND_ALIPAY - }) - - return await postUnBind.call(this, { - uid, - unBindAccount: { - ali_openid: dbCmd.remove() - }, - logType: LOG_TYPE.UNBIND_ALIPAY - }) -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/unbind-apple.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/unbind-apple.js deleted file mode 100644 index 111c1bf..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/unbind-apple.js +++ /dev/null @@ -1,32 +0,0 @@ -const { - preUnBind, - postUnBind -} = require('../../lib/utils/relate') -const { - LOG_TYPE, dbCmd -} = require('../../common/constants') - -/** - * 解绑apple - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#unbind-apple - * @returns - */ -module.exports = async function () { - const { uid } = this.authInfo - - await preUnBind.call(this, { - uid, - unBindAccount: { - apple_openid: dbCmd.exists(true) - }, - logType: LOG_TYPE.UNBIND_APPLE - }) - - return await postUnBind.call(this, { - uid, - unBindAccount: { - apple_openid: dbCmd.remove() - }, - logType: LOG_TYPE.UNBIND_APPLE - }) -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/unbind-qq.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/unbind-qq.js deleted file mode 100644 index 0c9704c..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/unbind-qq.js +++ /dev/null @@ -1,33 +0,0 @@ -const { - preUnBind, - postUnBind -} = require('../../lib/utils/relate') -const { - LOG_TYPE, dbCmd -} = require('../../common/constants') -/** - * 解绑QQ - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#unbind-qq - * @returns - */ -module.exports = async function () { - const { uid } = this.authInfo - - await preUnBind.call(this, { - uid, - unBindAccount: { - qq_openid: dbCmd.exists(true), - qq_unionid: dbCmd.exists(true) - }, - logType: LOG_TYPE.UNBIND_QQ - }) - - return await postUnBind.call(this, { - uid, - unBindAccount: { - qq_openid: dbCmd.remove(), - qq_unionid: dbCmd.remove() - }, - logType: LOG_TYPE.UNBIND_QQ - }) -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/unbind-weixin.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/unbind-weixin.js deleted file mode 100644 index 2248327..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/relate/unbind-weixin.js +++ /dev/null @@ -1,38 +0,0 @@ -const { - preUnBind, - postUnBind -} = require('../../lib/utils/relate') -const { - LOG_TYPE, dbCmd -} = require('../../common/constants') -const { - getWeixinPlatform -} = require('../../lib/utils/weixin') - -/** - * 解绑微信 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#unbind-weixin - * @returns - */ -module.exports = async function () { - const { uid } = this.authInfo - // const weixinPlatform = getWeixinPlatform.call(this) - - await preUnBind.call(this, { - uid, - unBindAccount: { - wx_openid: dbCmd.exists(true), - wx_unionid: dbCmd.exists(true) - }, - logType: LOG_TYPE.UNBIND_WEIXIN - }) - - return await postUnBind.call(this, { - uid, - unBindAccount: { - wx_openid: dbCmd.remove(), - wx_unionid: dbCmd.remove() - }, - logType: LOG_TYPE.UNBIND_WEIXIN - }) -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/utils/index.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/utils/index.js deleted file mode 100644 index 0ec67a5..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/utils/index.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - refreshToken: require('./refresh-token'), - setPushCid: require('./set-push-cid'), - secureNetworkHandshakeByWeixin: require('./secure-network-handshake-by-weixin') -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/utils/refresh-token.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/utils/refresh-token.js deleted file mode 100644 index b12f1f0..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/utils/refresh-token.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * 刷新token - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#refresh-token - */ -module.exports = async function () { - const refreshTokenRes = await this.uniIdCommon.refreshToken({ - token: this.getUniversalUniIdToken() - }) - const { - errCode, - token, - tokenExpired - } = refreshTokenRes - if (errCode) { - throw refreshTokenRes - } - return { - errCode: 0, - newToken: { - token, - tokenExpired - } - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/utils/secure-network-handshake-by-weixin.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/utils/secure-network-handshake-by-weixin.js deleted file mode 100644 index 82ea0b3..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/utils/secure-network-handshake-by-weixin.js +++ /dev/null @@ -1,73 +0,0 @@ -const { - ERROR -} = require('../../common/error') -const { - initWeixin -} = require('../../lib/third-party/index') -const { - saveWeixinUserKey, - saveSecureNetworkCache -} = require('../../lib/utils/weixin') -const loginByWeixin = require('../login/login-by-weixin') -/** - * 微信安全网络握手 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#set-push-cid - * @param {object} params - * @param {string} params.code 微信登录返回的code - * @param {boolean} params.callLoginByWeixin 是否同时调用一次微信登录 - * @returns - */ -module.exports = async function (params = {}) { - const schema = { - code: 'string', - callLoginByWeixin: { - type: 'boolean', - required: false - } - } - this.middleware.validate(params, schema) - let platform = this.clientPlatform - if (platform !== 'mp-weixin') { - throw new Error(`[secureNetworkHandshake] platform ${platform} is not supported`) - } - const { - code, - callLoginByWeixin = false - } = params - if (callLoginByWeixin) { - return loginByWeixin.call(this, { - code, - secureNetworkCache: true - }) - } - - const weixinApi = initWeixin.call(this) - let getWeixinAccountResult - try { - getWeixinAccountResult = await weixinApi.code2Session(code) - } catch (error) { - console.error(error) - throw { - errCode: ERROR.GET_THIRD_PARTY_ACCOUNT_FAILED - } - } - const { - openid, - unionid, - sessionKey // 微信小程序用户sessionKey - } = getWeixinAccountResult - await saveSecureNetworkCache.call(this, { - code, - openid, - unionid, - sessionKey - }) - await saveWeixinUserKey.call(this, { - openid, - sessionKey - }) - - return { - errCode: 0 - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/utils/set-push-cid.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/utils/set-push-cid.js deleted file mode 100644 index 9e08183..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/utils/set-push-cid.js +++ /dev/null @@ -1,132 +0,0 @@ -const { - deviceCollection -} = require('../../common/constants') -const { - ERROR -} = require('../../common/error') - -async function setOpendbDevice ({ - pushClientId -} = {}) { - // 仅新增,如果存在进行更新操作 - const { - appId, - deviceId, - deviceBrand, - deviceModel, - osName, - osVersion, - osLanguage, - osTheme, - devicePixelRatio, - windowWidth, - windowHeight, - screenWidth, - screenHeight, - romName, - romVersion - } = this.getUniversalClientInfo() - const platform = this.clientPlatform - const now = Date.now() - - const db = uniCloud.database() - const opendbDeviceCollection = db.collection('opendb-device') - const getDeviceRes = await opendbDeviceCollection.where({ - device_id: deviceId - }).get() - const data = { - appid: appId, - device_id: deviceId, - vendor: deviceBrand, - model: deviceModel, - uni_platform: platform, - os_name: osName, - os_version: osVersion, - os_language: osLanguage, - os_theme: osTheme, - pixel_ratio: devicePixelRatio, - window_width: windowWidth, - window_height: windowHeight, - screen_width: screenWidth, - screen_height: screenHeight, - rom_name: romName, - rom_version: romVersion, - last_update_date: now, - push_clientid: pushClientId - } - if (getDeviceRes.data.length > 0) { - await opendbDeviceCollection.where({ - device_id: deviceId - }).update(data) - return - } - data.create_date = now - await opendbDeviceCollection.add(data) -} - -/** - * 更新device表的push_clien_id - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#set-push-cid - * @param {object} params - * @param {string} params.pushClientId 客户端pushClientId - * @returns - */ -module.exports = async function (params = {}) { - const schema = { - pushClientId: 'string' - } - this.middleware.validate(params, schema) - const { - deviceId, - appId, - osName - } = this.getUniversalClientInfo() - let platform = this.clientPlatform - if (platform === 'app') { - platform += osName - } - - const { - uid, - exp - } = this.authInfo - const { pushClientId } = params - const tokenExpired = exp * 1000 - const getDeviceRes = await deviceCollection.where({ - device_id: deviceId - }).get() - // console.log(getDeviceRes) - if (getDeviceRes.data.length > 1) { - return { - errCode: ERROR.SYSTEM_ERROR - } - } - const deviceRecord = getDeviceRes.data[0] - await setOpendbDevice.call(this, { - pushClientId - }) - if (!deviceRecord) { - await deviceCollection.add({ - user_id: uid, - device_id: deviceId, - token_expired: tokenExpired, - push_clientid: pushClientId, - appid: appId - }) - return { - errCode: 0 - } - } - - await deviceCollection.where({ - device_id: deviceId - }).update({ - user_id: uid, - token_expired: tokenExpired, - push_clientid: pushClientId, - appid: appId - }) - return { - errCode: 0 - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/verify/create-captcha.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/verify/create-captcha.js deleted file mode 100644 index c3f7d81..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/verify/create-captcha.js +++ /dev/null @@ -1,35 +0,0 @@ -const { - CAPTCHA_SCENE -} = require('../../common/constants') -const { - ERROR -} = require('../../common/error') - -/** - * 创建图形验证码 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#create-captcha - * @param {Object} params - * @param {String} params.scene 图形验证码使用场景 - * @returns - */ -module.exports = async function (params = {}) { - const schema = { - scene: 'string' - } - this.middleware.validate(params, schema) - - const { deviceId, platform } = this.getUniversalClientInfo() - const { - scene - } = params - if (!(Object.values(CAPTCHA_SCENE).includes(scene))) { - throw { - errCode: ERROR.INVALID_PARAM - } - } - return this.uniCaptcha.create({ - deviceId, - scene, - uniPlatform: platform - }) -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/verify/index.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/verify/index.js deleted file mode 100644 index fba3524..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/verify/index.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - createCaptcha: require('./create-captcha'), - refreshCaptcha: require('./refresh-captcha'), - sendSmsCode: require('./send-sms-code'), - sendEmailLink: require('./send-email-link'), - sendEmailCode: require('./send-email-code') -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/verify/refresh-captcha.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/verify/refresh-captcha.js deleted file mode 100644 index fafdc6b..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/verify/refresh-captcha.js +++ /dev/null @@ -1,36 +0,0 @@ -const { - CAPTCHA_SCENE -} = require('../../common/constants') -const { - ERROR -} = require('../../common/error') - -/** - * 刷新图形验证码 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#refresh-captcha - * @param {Object} params - * @param {String} params.scene 图形验证码使用场景 - * @returns - */ -module.exports = async function (params = {}) { - const schema = { - scene: 'string' - } - this.middleware.validate(params, schema) - - const { deviceId, platform } = this.getUniversalClientInfo() - - const { - scene - } = params - if (!(Object.values(CAPTCHA_SCENE).includes(scene))) { - throw { - errCode: ERROR.INVALID_PARAM - } - } - return this.uniCaptcha.refresh({ - deviceId, - scene, - uniPlatform: platform - }) -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/verify/send-email-code.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/verify/send-email-code.js deleted file mode 100644 index 1a6304d..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/verify/send-email-code.js +++ /dev/null @@ -1,60 +0,0 @@ -const { - verifyCaptcha -} = require('../../lib/utils/captcha') -const { - EMAIL_SCENE -} = require('../../common/constants') -const { - ERROR -} = require('../../common/error') -/** - * 发送邮箱验证码,可用于登录、注册、绑定邮箱、修改密码等操作 - * @tutorial - * @param {Object} params - * @param {String} params.email 邮箱 - * @param {String} params.captcha 图形验证码 - * @param {String} params.scene 使用场景 - * @returns - */ -module.exports = async function (params = {}) { - const schema = { - email: 'email', - captcha: 'string', - scene: 'string' - } - this.middleware.validate(params, schema) - - const { - email, - captcha, - scene - } = params - - if (!(Object.values(EMAIL_SCENE).includes(scene))) { - throw { - errCode: ERROR.INVALID_PARAM - } - } - - await verifyCaptcha.call(this, { - scene: 'send-email-code', - captcha - }) - - // -- 测试代码 - await require('../../lib/utils/verify-code') - .setEmailVerifyCode.call(this, { - email, - code: '123456', - expiresIn: 180, - scene - }) - return { - errCode: 'uni-id-invalid-mail-template', - errMsg: `已启动测试模式,直接使用:123456作为邮箱验证码即可。\n如果是正式项目,需自行实现发送邮件的相关功能` - } - // -- 测试代码 - - - //发送邮件--需自行实现 -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/verify/send-email-link.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/verify/send-email-link.js deleted file mode 100644 index f643434..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/verify/send-email-link.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 发送邮箱链接,可用于登录、注册、绑定邮箱、修改密码等操作 - * @tutorial - * @param {Object} params - * @param {String} params.email 邮箱 - * @param {String} params.scene 使用场景 - * @returns - */ -module.exports = async function (params = {}) { - // 此接口暂未实现,欢迎向我们提交pr - throw new Error('api[sendEmailLink] is not yet implemented') -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/verify/send-sms-code.js b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/verify/send-sms-code.js deleted file mode 100644 index 6525276..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/module/verify/send-sms-code.js +++ /dev/null @@ -1,71 +0,0 @@ -const { - sendSmsCode -} = require('../../lib/utils/sms') -const { - verifyCaptcha -} = require('../../lib/utils/captcha') -const { - SMS_SCENE -} = require('../../common/constants') -const { - ERROR -} = require('../../common/error') - -/** - * 发送短信验证码 - * @tutorial https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#send-sms-code - * @param {Object} params - * @param {String} params.mobile 手机号 - * @param {String} params.captcha 图形验证码 - * @param {String} params.scene 短信验证码使用场景 - * @returns - */ -module.exports = async function (params = {}) { - const schema = { - mobile: 'mobile', - captcha: 'string', - scene: 'string' - } - this.middleware.validate(params, schema) - const { - mobile, - captcha, - scene - } = params - if (!(Object.values(SMS_SCENE).includes(scene))) { - throw { - errCode: ERROR.INVALID_PARAM - } - } - await verifyCaptcha.call(this, { - scene: 'send-sms-code', - captcha - }) - - // -- 测试代码 - const { - templateId - } = (this.config.service && - this.config.service.sms && - this.config.service.sms.scene && - this.config.service.sms.scene[scene]) || {} - if (!templateId || !templateId.replace(/[^0-9a-zA-Z]/g, '')) { - await require('../../lib/utils/verify-code') - .setMobileVerifyCode.call(this, { - mobile: params.mobile, - code: '123456', - expiresIn: 180, - scene - }) - return { - errCode: 'uni-id-invalid-sms-template-id', - errMsg: `未找到scene=${scene},的短信模版templateId。\n已启动测试模式,直接使用:123456作为短信验证码即可。\n如果是正式项目,请在路径:/common/uni-config-center/uni-id/config.json中service->sms中配置密钥等信息\n更多详情:https://uniapp.dcloud.io/uniCloud/uni-id.html#config` - } - } - // -- 测试代码 - - return sendSmsCode.call(this, { - mobile, - scene - }) -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/package.json b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/package.json deleted file mode 100644 index ee93e4e..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/cloudfunctions/uni-id-co/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "uni-id-co", - "version": "1.1.20", - "description": "", - "main": "index.js", - "keywords": [], - "author": "DCloud", - "dependencies": { - "uni-captcha": "file:..\/..\/..\/..\/uni-captcha\/uniCloud\/cloudfunctions\/common\/uni-captcha", - "uni-config-center": "file:..\/..\/..\/..\/uni-config-center\/uniCloud\/cloudfunctions\/common\/uni-config-center", - "uni-id-common": "file:..\/..\/..\/..\/uni-id-common\/uniCloud\/cloudfunctions\/common\/uni-id-common", - "uni-open-bridge-common": "file:..\/..\/..\/..\/uni-open-bridge-common\/uniCloud\/cloudfunctions\/common\/uni-open-bridge-common", - "uni-cloud-s2s": "file:..\/..\/..\/..\/uni-cloud-s2s\/uniCloud\/cloudfunctions\/common\/uni-cloud-s2s" - }, - "extensions": { - "uni-cloud-redis": {}, - "uni-cloud-sms": {}, - "uni-cloud-verify": {} - }, - "cloudfunction-config": { - "keepRunningAfterReturn": false - }, - "origin-plugin-dev-name": "uni-template-admin", - "origin-plugin-version": "2.5.13", - "plugin-dev-name": "uni-template-admin", - "plugin-version": "2.5.13" -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/database/opendb-department.schema.json b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/database/opendb-department.schema.json deleted file mode 100644 index 000112c..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/database/opendb-department.schema.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "bsonType": "object", - "required": [ - "name" - ], - "permission": { - "read": true, - "create": false, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "parent_id": { - "bsonType": "string", - "description": "父级部门ID", - "parentKey": "_id" - }, - "name": { - "bsonType": "string", - "description": "部门名称", - "title": "部门名称", - "trim": "both" - }, - "level": { - "bsonType": "int", - "description": "部门层级,为提升检索效率而作的冗余设计" - }, - "sort": { - "bsonType": "int", - "description": "部门在当前层级下的顺序,由小到大", - "title": "显示顺序" - }, - "manager_uid": { - "bsonType": "string", - "description": "部门主管的userid, 参考`uni-id-users` 表", - "foreignKey": "uni-id-users._id" - }, - "create_date": { - "bsonType": "timestamp", - "description": "部门创建时间", - "forceDefaultValue": { - "$env": "now" - } - } - }, - "version": "0.1.0" -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/database/opendb-device.schema.json b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/database/opendb-device.schema.json deleted file mode 100644 index c3591cc..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/database/opendb-device.schema.json +++ /dev/null @@ -1,142 +0,0 @@ -{ - "bsonType": "object", - "required": [], - "permission": { - "read": false, - "create": true, - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "appid": { - "bsonType": "string", - "description": "DCloud appid" - }, - "device_id": { - "bsonType": "string", - "description": "设备唯一标识" - }, - "vendor": { - "bsonType": "string", - "description": "设备厂商" - }, - "push_clientid": { - "bsonType": "string", - "description": "推送设备客户端标识" - }, - "imei": { - "bsonType": "string", - "description": "国际移动设备识别码IMEI(International Mobile Equipment Identity)" - }, - "oaid": { - "bsonType": "string", - "description": "移动智能设备标识公共服务平台提供的匿名设备标识符(OAID)" - }, - "idfa": { - "bsonType": "string", - "description": "iOS平台配置应用使用广告标识(IDFA)" - }, - "imsi": { - "bsonType": "string", - "description": "国际移动用户识别码(International Mobile Subscriber Identification Number)" - }, - "model": { - "bsonType": "string", - "description": "设备型号" - }, - "platform": { - "bsonType": "string", - "description": "平台类型" - }, - "uni_platform": { - "bsonType": "string", - "description": "uni-app 运行平台,与条件编译平台相同。" - }, - "os_name": { - "bsonType": "string", - "description": "ios|android|windows|mac|linux " - }, - "os_version": { - "bsonType": "string", - "description": "操作系统版本号 " - }, - "os_language": { - "bsonType": "string", - "description": "操作系统语言 " - }, - "os_theme": { - "bsonType": "string", - "description": "操作系统主题 light|dark" - }, - "pixel_ratio": { - "bsonType": "string", - "description": "设备像素比 " - }, - "network_model": { - "bsonType": "string", - "description": "设备网络型号wifi\/3G\/4G\/" - }, - "window_width": { - "bsonType": "string", - "description": "设备窗口宽度 " - }, - "window_height": { - "bsonType": "string", - "description": "设备窗口高度" - }, - "screen_width": { - "bsonType": "string", - "description": "设备屏幕宽度" - }, - "screen_height": { - "bsonType": "string", - "description": "设备屏幕高度" - }, - "rom_name": { - "bsonType": "string", - "description": "rom 名称" - }, - "rom_version": { - "bsonType": "string", - "description": "rom 版本" - }, - "location_latitude": { - "bsonType": "double", - "description": "纬度" - }, - "location_longitude": { - "bsonType": "double", - "description": "经度" - }, - "location_country": { - "bsonType": "string", - "description": "国家" - }, - "location_province": { - "bsonType": "string", - "description": "省份" - }, - "location_city": { - "bsonType": "string", - "description": "城市" - }, - "create_date": { - "bsonType": "timestamp", - "description": "创建时间", - "forceDefaultValue": { - "$env": "now" - } - }, - "last_update_date": { - "bsonType": "timestamp", - "description": "最后一次修改时间", - "forceDefaultValue": { - "$env": "now" - } - } - }, - "version": "0.0.1" -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/database/opendb-frv-logs.schema.json b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/database/opendb-frv-logs.schema.json deleted file mode 100644 index 239fd82..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/database/opendb-frv-logs.schema.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "bsonType": "object", - "permission": { - "read": "doc._id == auth.uid || 'CREATE_UNI_ID_USERS' in auth.permission", - "create": "'CREATE_UNI_ID_USERS' in auth.permission", - "update": "doc._id == auth.uid || 'UPDATE_UNI_ID_USERS' in auth.permission", - "delete": "'DELETE_UNI_ID_USERS' in auth.permission" - }, - "properties": { - "_id": { - "description": "存储文档 ID(用户 ID),系统自动生成" - }, - "certify_id": { - "bsonType": "string", - "description": "认证id" - }, - "user_id": { - "bsonType": "string", - "description": "用户id" - }, - "real_name": { - "bsonType": "string", - "description": "姓名" - }, - "identity": { - "bsonType": "string", - "description": "身份证号码" - }, - "status": { - "bsonType": "int", - "description": "认证状态:0 未认证 1 等待认证 2 认证通过 3 认证失败", - "maximum": 3, - "minimum": 0 - }, - "created_date": { - "bsonType": "timestamp", - "description": "创建时间", - "forceDefaultValue": { - "$env": "now" - } - } - }, - "required": [] -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/database/uni-id-device.schema.json b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/database/uni-id-device.schema.json deleted file mode 100644 index 4981d75..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/database/uni-id-device.schema.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "bsonType": "object", - "required": [ - "user_id" - ], - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "user_id": { - "bsonType": "string", - "description": "用户id,参考uni-id-users表" - }, - "ua": { - "bsonType": "string", - "description": "userAgent" - }, - "uuid": { - "bsonType": "string", - "description": "设备唯一标识(需要加密存储)" - }, - "os_name": { - "bsonType": "string", - "description": "ios|android|windows|mac|linux " - }, - "os_version": { - "bsonType": "string", - "description": "操作系统版本号 " - }, - "os_language": { - "bsonType": "string", - "description": "操作系统语言 " - }, - "os_theme": { - "bsonType": "string", - "description": "操作系统主题 light|dark" - }, - "vendor": { - "bsonType": "string", - "description": "设备厂商" - }, - "push_clientid": { - "bsonType": "string", - "description": "推送设备客户端标识" - }, - "imei": { - "bsonType": "string", - "description": "国际移动设备识别码IMEI(International Mobile Equipment Identity)" - }, - "oaid": { - "bsonType": "string", - "description": "移动智能设备标识公共服务平台提供的匿名设备标识符(OAID)" - }, - "idfa": { - "bsonType": "string", - "description": "iOS平台配置应用使用广告标识(IDFA)" - }, - "model": { - "bsonType": "string", - "description": "设备型号" - }, - "platform": { - "bsonType": "string", - "description": "平台类型" - }, - "create_date": { - "bsonType": "timestamp", - "description": "创建时间", - "forceDefaultValue": { - "$env": "now" - } - }, - "last_active_date": { - "bsonType": "timestamp", - "description": "最后登录时间" - }, - "last_active_ip": { - "bsonType": "string", - "description": "最后登录IP" - } - }, - "version": "0.0.1" -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/database/uni-id-log.schema.json b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/database/uni-id-log.schema.json deleted file mode 100644 index ff4f797..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/database/uni-id-log.schema.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "bsonType": "object", - "required": ["user_id"], - "permission": { - "read": "'READ_UNI_ID_LOG' in auth.permission" - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "create_date": { - "bsonType": "timestamp", - "description": "创建时间", - "forceDefaultValue": { - "$env": "now" - } - }, - "device_uuid": { - "bsonType": "string", - "description": "设备唯一标识" - }, - "ip": { - "bsonType": "string", - "description": "ip地址" - }, - "state": { - "bsonType": "int", - "description": "结果:0 失败、1 成功" - }, - "type": { - "bsonType": "string", - "description": "操作类型", - "enum": [ - "logout", - "login", - "register", - "reset-pwd", - "bind-mobile", - "bind-weixin", - "bind-qq", - "bind-apple", - "bind-alipay" - ] - }, - "ua": { - "bsonType": "string", - "description": "userAgent" - }, - "user_id": { - "bsonType": "string", - "foreignKey": "uni-id-users._id", - "description": "用户id,参考uni-id-users表" - }, - "username": { - "bsonType": "string", - "description": "用户名" - }, - "email": { - "bsonType": "string", - "description": "邮箱" - }, - "mobile": { - "bsonType": "string", - "description": "手机号" - }, - "appid": { - "bsonType": "string", - "description": "客户端DCloud AppId" - } - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/database/uni-id-permissions.schema.json b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/database/uni-id-permissions.schema.json deleted file mode 100644 index 25209cb..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/database/uni-id-permissions.schema.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "bsonType": "object", - "required": ["permission_id", "permission_name"], - "permission": { - "read": "'READ_UNI_ID_PERMISSIONS' in auth.permission", - "create": "'CREATE_UNI_ID_PERMISSIONS' in auth.permission", - "update": "'UPDATE_UNI_ID_PERMISSIONS' in auth.permission", - "delete": "'DELETE_UNI_ID_PERMISSIONS' in auth.permission" - }, - "properties": { - "_id": { - "description": "存储文档 ID,系统自动生成" - }, - "comment": { - "bsonType": "string", - "component": { - "name": "textarea" - }, - "description": "备注", - "label": "备注", - "title": "备注", - "trim": "both" - }, - "create_date": { - "bsonType": "timestamp", - "description": "创建时间", - "forceDefaultValue": { - "$env": "now" - } - }, - "permission_id": { - "bsonType": "string", - "component": { - "name": "input" - }, - "description": "权限唯一标识,不可修改,不允许重复", - "label": "权限标识", - "title": "权限ID", - "trim": "both" - }, - "permission_name": { - "bsonType": "string", - "component": { - "name": "input" - }, - "description": "权限名称", - "label": "权限名称", - "title": "权限名称", - "trim": "both" - } - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/database/uni-id-roles.schema.json b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/database/uni-id-roles.schema.json deleted file mode 100644 index e2fe322..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/database/uni-id-roles.schema.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "bsonType": "object", - "required": ["role_id", "role_name"], - "permission": { - "read": "'READ_UNI_ID_ROLES' in auth.permission", - "create": "'CREATE_UNI_ID_ROLES' in auth.permission", - "update": "'UPDATE_UNI_ID_ROLES' in auth.permission", - "delete": "'DELETE_UNI_ID_ROLES' in auth.permission" - }, - "properties": { - "_id": { - "description": "存储文档 ID,系统自动生成" - }, - "comment": { - "title": "备注", - "bsonType": "string", - "description": "备注", - "trim": "both" - }, - "create_date": { - "bsonType": "timestamp", - "description": "创建时间", - "forceDefaultValue": { - "$env": "now" - } - }, - "permission": { - "title": "权限", - "bsonType": "array", - "foreignKey": "uni-id-permissions.permission_id", - "description": "角色拥有的权限列表", - "enum": { - "collection": "uni-id-permissions", - "field": "permission_name as text, permission_id as value" - } - }, - "role_id": { - "title": "唯一ID", - "bsonType": "string", - "description": "角色唯一标识,不可修改,不允许重复", - "trim": "both" - }, - "role_name": { - "title": "名称", - "bsonType": "string", - "description": "角色名称", - "trim": "both" - } - } -} diff --git a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/database/uni-id-users.schema.json b/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/database/uni-id-users.schema.json deleted file mode 100644 index 5945e46..0000000 --- a/sport-erp-admin/uni_modules/uni-id-pages/uniCloud/database/uni-id-users.schema.json +++ /dev/null @@ -1,477 +0,0 @@ -{ - "bsonType": "object", - "permission": { - "read": true, - "create": "'CREATE_UNI_ID_USERS' in auth.permission", - "update": "doc._id == auth.uid || 'UPDATE_UNI_ID_USERS' in auth.permission", - "delete": "'DELETE_UNI_ID_USERS' in auth.permission" - }, - "properties": { - "_id": { - "description": "存储文档 ID(用户 ID),系统自动生成" - }, - "ali_openid": { - "bsonType": "string", - "description": "支付宝平台openid", - "permission": { - "read": "'READ_UNI_ID_USERS' in auth.permission", - "write": "'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission" - } - }, - "apple_openid": { - "bsonType": "string", - "description": "苹果登录openid", - "permission": { - "read": "'READ_UNI_ID_USERS' in auth.permission", - "write": "'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission" - } - }, - "avatar": { - "bsonType": "string", - "description": "头像地址", - "title": "头像地址", - "trim": "both", - "permission": { - "read": true, - "write": "doc._id == auth.uid || 'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission" - } - }, - "avatar_file": { - "bsonType": "file", - "description": "用file类型方便使用uni-file-picker组件", - "title": "头像文件", - "permission": { - "read": true, - "write": "doc._id == auth.uid || 'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission" - } - }, - "comment": { - "bsonType": "string", - "description": "备注", - "title": "备注", - "trim": "both", - "permission": { - "read": "'READ_UNI_ID_USERS' in auth.permission", - "write": "'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission" - } - }, - "dcloud_appid": { - "bsonType": "array", - "description": "允许登录的客户端的appid列表", - "foreignKey": "opendb-app-list.appid", - "permission": { - "read": "'READ_UNI_ID_USERS' in auth.permission", - "write": "'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission" - } - }, - "department_id": { - "bsonType": "array", - "description": "部门ID", - "enum": { - "collection": "opendb-department", - "field": "_id as value, name as text", - "orderby": "name asc" - }, - "enumType": "tree", - "title": "部门", - "permission": { - "read": "doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission", - "write": "'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission" - } - }, - "email": { - "bsonType": "string", - "description": "邮箱地址", - "format": "email", - "title": "邮箱", - "trim": "both", - "permission": { - "read": "doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission", - "write": "'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission" - } - }, - "email_confirmed": { - "bsonType": "int", - "defaultValue": 0, - "description": "邮箱验证状态:0 未验证 1 已验证", - "enum": [{ - "text": "未验证", - "value": 0 - }, - { - "text": "已验证", - "value": 1 - } - ], - "title": "邮箱验证状态", - "permission": { - "read": "doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission", - "write": "'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission" - } - }, - "gender": { - "bsonType": "int", - "defaultValue": 0, - "description": "用户性别:0 未知 1 男性 2 女性", - "enum": [{ - "text": "未知", - "value": 0 - }, - { - "text": "男", - "value": 1 - }, - { - "text": "女", - "value": 2 - } - ], - "title": "性别", - "permission": { - "read": "doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission", - "write": "'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission" - } - }, - "invite_time": { - "bsonType": "timestamp", - "description": "受邀时间", - "permission": { - "read": "doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission", - "write": "'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission" - } - }, - "inviter_uid": { - "bsonType": "array", - "description": "用户全部上级邀请者", - "trim": "both", - "permission": { - "read": "doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission", - "write": "'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission" - } - }, - "last_login_date": { - "bsonType": "timestamp", - "description": "最后登录时间", - "permission": { - "read": "doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission", - "write": "'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission" - } - }, - "last_login_ip": { - "bsonType": "string", - "description": "最后登录时 IP 地址", - "permission": { - "read": "doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission", - "write": "'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission" - } - }, - "mobile": { - "bsonType": "string", - "description": "手机号码", - "pattern": "^\\+?[0-9-]{3,20}$", - "title": "手机号码", - "trim": "both", - "permission": { - "read": "doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission", - "write": "'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission" - } - }, - "mobile_confirmed": { - "bsonType": "int", - "defaultValue": 0, - "description": "手机号验证状态:0 未验证 1 已验证", - "enum": [{ - "text": "未验证", - "value": 0 - }, - { - "text": "已验证", - "value": 1 - } - ], - "title": "手机号验证状态", - "permission": { - "read": "doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission", - "write": "'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission" - } - }, - "my_invite_code": { - "bsonType": "string", - "description": "用户自身邀请码", - "permission": { - "read": "doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission", - "write": "'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission" - } - }, - "nickname": { - "bsonType": "string", - "description": "用户昵称", - "title": "昵称", - "trim": "both", - "permission": { - "read": true, - "write": "doc._id == auth.uid || 'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission" - } - }, - "password": { - "bsonType": "password", - "description": "密码,加密存储", - "title": "密码", - "trim": "both" - }, - "password_secret_version": { - "bsonType": "int", - "description": "密码使用的passwordSecret版本", - "title": "passwordSecret", - "permission": { - "read": false, - "write": false - } - }, - "realname_auth": { - "bsonType": "object", - "description": "实名认证信息", - "permission": { - "read": "doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission", - "write": "'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission" - }, - "properties": { - "auth_date": { - "bsonType": "timestamp", - "description": "认证通过时间" - }, - "auth_status": { - "bsonType": "int", - "description": "认证状态:0 未认证 1 等待认证 2 认证通过 3 认证失败", - "maximum": 3, - "minimum": 0 - }, - "contact_email": { - "bsonType": "string", - "description": "联系人邮箱" - }, - "contact_mobile": { - "bsonType": "string", - "description": "联系人手机号码" - }, - "contact_person": { - "bsonType": "string", - "description": "联系人姓名" - }, - "id_card_back": { - "bsonType": "string", - "description": "身份证反面照 URL" - }, - "id_card_front": { - "bsonType": "string", - "description": "身份证正面照 URL" - }, - "identity": { - "bsonType": "string", - "description": "身份证号码/营业执照号码" - }, - "in_hand": { - "bsonType": "string", - "description": "手持身份证照片 URL" - }, - "license": { - "bsonType": "string", - "description": "营业执照 URL" - }, - "real_name": { - "bsonType": "string", - "description": "真实姓名/企业名称" - }, - "type": { - "bsonType": "int", - "description": "用户类型:0 个人用户 1 企业用户", - "maximum": 1, - "minimum": 0 - } - }, - "required": [ - "type", - "auth_status" - ] - }, - "register_date": { - "bsonType": "timestamp", - "description": "注册时间", - "forceDefaultValue": { - "$env": "now" - }, - "permission": { - "read": "doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission", - "write": "'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission" - } - }, - "register_ip": { - "bsonType": "string", - "description": "注册时 IP 地址", - "forceDefaultValue": { - "$env": "clientIP" - }, - "permission": { - "read": "doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission", - "write": "'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission" - } - }, - "role": { - "bsonType": "array", - "description": "用户角色", - "enum": { - "collection": "uni-id-roles", - "field": "role_id as value, role_name as text" - }, - "foreignKey": "uni-id-roles.role_id", - "permission": { - "read": "doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission", - "write": "'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission" - }, - "title": "角色" - }, - "tags":{ - "bsonType": "array", - "description": "用户标签", - "permission": { - "read": "doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission", - "write": "'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission" - }, - "title": "标签" - }, - "score": { - "bsonType": "int", - "description": "用户积分,积分变更记录可参考:uni-id-scores表定义", - "permission": { - "read": "doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission", - "write": "'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission" - } - }, - "status": { - "bsonType": "int", - "defaultValue": 0, - "description": "用户状态:0 正常 1 禁用 2 审核中 3 审核拒绝 4 已注销", - "permission": { - "read": "doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission", - "write": "'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission" - }, - "enum": [{ - "text": "正常", - "value": 0 - }, - { - "text": "禁用", - "value": 1 - }, - { - "text": "审核中", - "value": 2 - }, - { - "text": "审核拒绝", - "value": 3 - }, - { - "text": "已注销", - "value": 4 - } - ], - "title": "用户状态" - }, - "token": { - "bsonType": "array", - "description": "用户token", - "permission": { - "read": false, - "write": "'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission" - } - }, - "username": { - "bsonType": "string", - "description": "用户名,不允许重复", - "title": "用户名", - "trim": "both", - "permission": { - "read": "doc._id == auth.uid || 'READ_UNI_ID_USERS' in auth.permission", - "write": "'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission" - } - }, - "wx_openid": { - "bsonType": "object", - "description": "微信各个平台openid", - "properties": { - "app": { - "bsonType": "string", - "description": "app平台微信openid" - }, - "mp": { - "bsonType": "string", - "description": "微信小程序平台openid" - }, - "h5": { - "bsonType": "string", - "description": "微信公众号登录openid" - }, - "web": { - "bsonType": "string", - "description": "PC页面扫码登录openid" - } - }, - "permission": { - "read": "'READ_UNI_ID_USERS' in auth.permission", - "write": "'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission" - } - }, - "wx_unionid": { - "bsonType": "string", - "description": "微信unionid", - "permission": { - "read": "'READ_UNI_ID_USERS' in auth.permission", - "write": "'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission" - } - }, - "qq_openid": { - "bsonType": "object", - "description": "QQ各个平台openid", - "properties": { - "app": { - "bsonType": "string", - "description": "app平台QQ openid" - }, - "mp": { - "bsonType": "string", - "description": "QQ小程序平台openid" - } - }, - "permission": { - "read": "'READ_UNI_ID_USERS' in auth.permission", - "write": "'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission" - } - }, - "qq_unionid": { - "bsonType": "string", - "description": "QQ unionid", - "permission": { - "read": "'READ_UNI_ID_USERS' in auth.permission", - "write": "'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission" - } - }, - "third_party": { - "bsonType": "object", - "description": "三方平台凭证", - "permission": { - "read": false, - "write": false - } - }, - "identities": { - "bsonType": "array", - "description": "三方平台身份信息;一个对象代表一个身份,参数支持: provider 身份源, userInfo 三方用户信息, openid 三方openid, unionid 三方unionid, uid 三方uid", - "permission": { - "read": "'READ_UNI_ID_USERS' in auth.permission", - "write": "'CREATE_UNI_ID_USERS' in auth.permission || 'UPDATE_UNI_ID_USERS' in auth.permission" - } - } - }, - "required": [] -} diff --git a/sport-erp-admin/uni_modules/uni-link/changelog.md b/sport-erp-admin/uni_modules/uni-link/changelog.md deleted file mode 100644 index 2cfbf59..0000000 --- a/sport-erp-admin/uni_modules/uni-link/changelog.md +++ /dev/null @@ -1,17 +0,0 @@ -## 1.0.0(2021-11-19) -- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) -- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-link](https://uniapp.dcloud.io/component/uniui/uni-link) -## 1.1.7(2021-11-08) -## 0.0.7(2021-09-03) -- 修复 在 nvue 下不显示的 bug -## 0.0.6(2021-07-30) -- 新增 支持自定义插槽 -## 0.0.5(2021-06-21) -- 新增 download 属性,H5平台下载文件名 -## 0.0.4(2021-05-12) -- 新增 组件示例地址 -## 0.0.3(2021-03-09) -- 新增 href 属性支持 tel:|mailto: - -## 0.0.2(2021-02-05) -- 调整为uni_modules目录规范 diff --git a/sport-erp-admin/uni_modules/uni-link/components/uni-link/uni-link.vue b/sport-erp-admin/uni_modules/uni-link/components/uni-link/uni-link.vue deleted file mode 100644 index 27c5468..0000000 --- a/sport-erp-admin/uni_modules/uni-link/components/uni-link/uni-link.vue +++ /dev/null @@ -1,128 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-link/package.json b/sport-erp-admin/uni_modules/uni-link/package.json deleted file mode 100644 index 77b1986..0000000 --- a/sport-erp-admin/uni_modules/uni-link/package.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "id": "uni-link", - "displayName": "uni-link 超链接", - "version": "1.0.0", - "description": "uni-link是一个外部网页超链接组件,在小程序内复制url,在app内打开外部浏览器,在h5端打", - "keywords": [ - "uni-ui", - "uniui", - "link", - "超链接", - "" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ], - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" - }, - "uni_modules": { - "dependencies": ["uni-scss"], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "y" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y" - }, - "快应用": { - "华为": "y", - "联盟": "y" - }, - "Vue": { - "vue2": "y", - "vue3": "y" - } - } - } - } -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-link/readme.md b/sport-erp-admin/uni_modules/uni-link/readme.md deleted file mode 100644 index 7f09e94..0000000 --- a/sport-erp-admin/uni_modules/uni-link/readme.md +++ /dev/null @@ -1,11 +0,0 @@ - - -## Link 链接 -> **组件名:uni-link** -> 代码块: `uLink` - - -uni-link是一个外部网页超链接组件,在小程序内复制url,在app内打开外部浏览器,在h5端打开新网页。 - -### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-link) -#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-list/changelog.md b/sport-erp-admin/uni_modules/uni-list/changelog.md deleted file mode 100644 index 8254a18..0000000 --- a/sport-erp-admin/uni_modules/uni-list/changelog.md +++ /dev/null @@ -1,46 +0,0 @@ -## 1.2.14(2023-04-14) -- 优化 uni-list-chat 具名插槽`header` 非app端套一层元素,方便使用时通过外层元素定位实现样式修改 -## 1.2.13(2023-03-03) -- uni-list-chat 新增 支持具名插槽`header` -## 1.2.12(2023-02-01) -- 新增 列表图标新增 customPrefix 属性 ,用法 [详见](https://uniapp.dcloud.net.cn/component/uniui/uni-icons.html#icons-props) -## 1.2.11(2023-01-31) -- 修复 无反馈效果呈现的bug -## 1.2.9(2022-11-22) -- 修复 uni-list-chat 在vue3下跳转报错的bug -## 1.2.8(2022-11-21) -- 修复 uni-list-chat avatar属性 值为本地路径时错误的问题 -## 1.2.7(2022-11-21) -- 修复 uni-list-chat avatar属性 在腾讯云版uniCloud下错误的问题 -## 1.2.6(2022-11-18) -- 修复 uni-list-chat note属性 支持:“草稿”字样功能 文本少1位的问题 -## 1.2.5(2022-11-15) -- 修复 uni-list-item 的 customStyle 属性 padding值在 H5端 无效的bug -## 1.2.4(2022-11-15) -- 修复 uni-list-item 的 customStyle 属性 padding值在nvue(vue2)下无效的bug -## 1.2.3(2022-11-14) -- uni-list-chat 新增 avatar 支持 fileId -## 1.2.2(2022-11-11) -- uni-list 新增属性 render-reverse 详情参考:[https://uniapp.dcloud.net.cn/component/list.html](https://uniapp.dcloud.net.cn/component/list.html) -- uni-list-chat note属性 支持:“草稿”字样 加红显示 详情参考uni-im:[https://ext.dcloud.net.cn/plugin?name=uni-im](https://ext.dcloud.net.cn/plugin?name=uni-im) -- uni-list-item 新增属性 customStyle 支持设置padding、backgroundColor -## 1.2.1(2022-03-30) -- 删除无用文件 -## 1.2.0(2021-11-23) -- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) -- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-list](https://uniapp.dcloud.io/component/uniui/uni-list) -## 1.1.3(2021-08-30) -- 修复 在vue3中to属性在发行应用的时候报错的bug -## 1.1.2(2021-07-30) -- 优化 vue3下事件警告的问题 -## 1.1.1(2021-07-21) -- 修复 与其他组件嵌套使用时,点击失效的Bug -## 1.1.0(2021-07-13) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 1.0.17(2021-05-12) -- 新增 组件示例地址 -## 1.0.16(2021-02-05) -- 优化 组件引用关系,通过uni_modules引用组件 -## 1.0.15(2021-02-05) -- 调整为uni_modules目录规范 -- 修复 uni-list-chat 角标显示不正常的问题 diff --git a/sport-erp-admin/uni_modules/uni-list/components/uni-list-ad/uni-list-ad.vue b/sport-erp-admin/uni_modules/uni-list/components/uni-list-ad/uni-list-ad.vue deleted file mode 100644 index b9349c2..0000000 --- a/sport-erp-admin/uni_modules/uni-list/components/uni-list-ad/uni-list-ad.vue +++ /dev/null @@ -1,107 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.scss b/sport-erp-admin/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.scss deleted file mode 100644 index 311f8d9..0000000 --- a/sport-erp-admin/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.scss +++ /dev/null @@ -1,58 +0,0 @@ -/** - * 这里是 uni-list 组件内置的常用样式变量 - * 如果需要覆盖样式,这里提供了基本的组件样式变量,您可以尝试修改这里的变量,去完成样式替换,而不用去修改源码 - * - */ - -// 背景色 -$background-color : #fff; -// 分割线颜色 -$divide-line-color : #e5e5e5; - -// 默认头像大小,如需要修改此值,注意同步修改 js 中的值 const avatarWidth = xx ,目前只支持方形头像 -// nvue 页面不支持修改头像大小 -$avatar-width : 45px ; - -// 头像边框 -$avatar-border-radius: 5px; -$avatar-border-color: #eee; -$avatar-border-width: 1px; - -// 标题文字样式 -$title-size : 16px; -$title-color : #3b4144; -$title-weight : normal; - -// 描述文字样式 -$note-size : 12px; -$note-color : #999; -$note-weight : normal; - -// 右侧额外内容默认样式 -$right-text-size : 12px; -$right-text-color : #999; -$right-text-weight : normal; - -// 角标样式 -// nvue 页面不支持修改圆点位置以及大小 -// 角标在左侧时,角标的位置,默认为 0 ,负数左/下移动,正数右/上移动 -$badge-left: 0px; -$badge-top: 0px; - -// 显示圆点时,圆点大小 -$dot-width: 10px; -$dot-height: 10px; - -// 显示角标时,角标大小和字体大小 -$badge-size : 18px; -$badge-font : 12px; -// 显示角标时,角标前景色 -$badge-color : #fff; -// 显示角标时,角标背景色 -$badge-background-color : #ff5a5f; -// 显示角标时,角标左右间距 -$badge-space : 6px; - -// 状态样式 -// 选中颜色 -$hover : #f5f5f5; diff --git a/sport-erp-admin/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.vue b/sport-erp-admin/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.vue deleted file mode 100644 index d49fd7c..0000000 --- a/sport-erp-admin/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.vue +++ /dev/null @@ -1,593 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue b/sport-erp-admin/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue deleted file mode 100644 index a274ac8..0000000 --- a/sport-erp-admin/uni_modules/uni-list/components/uni-list-item/uni-list-item.vue +++ /dev/null @@ -1,534 +0,0 @@ - - - - - \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-list/components/uni-list/uni-list.vue b/sport-erp-admin/uni_modules/uni-list/components/uni-list/uni-list.vue deleted file mode 100644 index 6ef5972..0000000 --- a/sport-erp-admin/uni_modules/uni-list/components/uni-list/uni-list.vue +++ /dev/null @@ -1,123 +0,0 @@ - - - - diff --git a/sport-erp-admin/uni_modules/uni-list/components/uni-list/uni-refresh.vue b/sport-erp-admin/uni_modules/uni-list/components/uni-list/uni-refresh.vue deleted file mode 100644 index 3b4c5a2..0000000 --- a/sport-erp-admin/uni_modules/uni-list/components/uni-list/uni-refresh.vue +++ /dev/null @@ -1,65 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-list/components/uni-list/uni-refresh.wxs b/sport-erp-admin/uni_modules/uni-list/components/uni-list/uni-refresh.wxs deleted file mode 100644 index 818a6b7..0000000 --- a/sport-erp-admin/uni_modules/uni-list/components/uni-list/uni-refresh.wxs +++ /dev/null @@ -1,87 +0,0 @@ -var pullDown = { - threshold: 95, - maxHeight: 200, - callRefresh: 'onrefresh', - callPullingDown: 'onpullingdown', - refreshSelector: '.uni-refresh' -}; - -function ready(newValue, oldValue, ownerInstance, instance) { - var state = instance.getState() - state.canPullDown = newValue; - // console.log(newValue); -} - -function touchStart(e, instance) { - var state = instance.getState(); - state.refreshInstance = instance.selectComponent(pullDown.refreshSelector); - state.canPullDown = (state.refreshInstance != null && state.refreshInstance != undefined); - if (!state.canPullDown) { - return - } - - // console.log("touchStart"); - - state.height = 0; - state.touchStartY = e.touches[0].pageY || e.changedTouches[0].pageY; - state.refreshInstance.setStyle({ - 'height': 0 - }); - state.refreshInstance.callMethod("onchange", true); -} - -function touchMove(e, ownerInstance) { - var instance = e.instance; - var state = instance.getState(); - if (!state.canPullDown) { - return - } - - var oldHeight = state.height; - var endY = e.touches[0].pageY || e.changedTouches[0].pageY; - var height = endY - state.touchStartY; - if (height > pullDown.maxHeight) { - return; - } - - var refreshInstance = state.refreshInstance; - refreshInstance.setStyle({ - 'height': height + 'px' - }); - - height = height < pullDown.maxHeight ? height : pullDown.maxHeight; - state.height = height; - refreshInstance.callMethod(pullDown.callPullingDown, { - height: height - }); -} - -function touchEnd(e, ownerInstance) { - var state = e.instance.getState(); - if (!state.canPullDown) { - return - } - - state.refreshInstance.callMethod("onchange", false); - - var refreshInstance = state.refreshInstance; - if (state.height > pullDown.threshold) { - refreshInstance.callMethod(pullDown.callRefresh); - return; - } - - refreshInstance.setStyle({ - 'height': 0 - }); -} - -function propObserver(newValue, oldValue, instance) { - pullDown = newValue; -} - -module.exports = { - touchmove: touchMove, - touchstart: touchStart, - touchend: touchEnd, - propObserver: propObserver -} diff --git a/sport-erp-admin/uni_modules/uni-list/package.json b/sport-erp-admin/uni_modules/uni-list/package.json deleted file mode 100644 index 8350efc..0000000 --- a/sport-erp-admin/uni_modules/uni-list/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "id": "uni-list", - "displayName": "uni-list 列表", - "version": "1.2.14", - "description": "List 组件 ,帮助使用者快速构建列表。", - "keywords": [ - "", - "uni-ui", - "uniui", - "列表", - "", - "list" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, -"dcloudext": { - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", - "type": "component-vue" - }, - "uni_modules": { - "dependencies": [ - "uni-badge", - "uni-icons" - ], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "y" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y" - }, - "快应用": { - "华为": "u", - "联盟": "u" - }, - "Vue": { - "vue2": "y", - "vue3": "y" - } - } - } - } -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-list/readme.md b/sport-erp-admin/uni_modules/uni-list/readme.md deleted file mode 100644 index 32c2865..0000000 --- a/sport-erp-admin/uni_modules/uni-list/readme.md +++ /dev/null @@ -1,346 +0,0 @@ -## List 列表 -> **组件名:uni-list** -> 代码块: `uList`、`uListItem` -> 关联组件:`uni-list-item`、`uni-badge`、`uni-icons`、`uni-list-chat`、`uni-list-ad` - - -List 列表组件,包含基本列表样式、可扩展插槽机制、长列表性能优化、多端兼容。 - -在vue页面里,它默认使用页面级滚动。在app-nvue页面里,它默认使用原生list组件滚动。这样的长列表,在滚动出屏幕外后,系统会回收不可见区域的渲染内存资源,不会造成滚动越长手机越卡的问题。 - -uni-list组件是父容器,里面的核心是uni-list-item子组件,它代表列表中的一个可重复行,子组件可以无限循环。 - -uni-list-item有很多风格,uni-list-item组件通过内置的属性,满足一些常用的场景。当内置属性不满足需求时,可以通过扩展插槽来自定义列表内容。 - -内置属性可以覆盖的场景包括:导航列表、设置列表、小图标列表、通信录列表、聊天记录列表。 - -涉及很多大图或丰富内容的列表,比如类今日头条的新闻列表、类淘宝的电商列表,需要通过扩展插槽实现。 - -下文均有样例给出。 - -uni-list不包含下拉刷新和上拉翻页。上拉翻页另见组件:[uni-load-more](https://ext.dcloud.net.cn/plugin?id=29) - - -### 安装方式 - -本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。 - -如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55) - -> **注意事项** -> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。 -> - 组件需要依赖 `sass` 插件 ,请自行手动安装 -> - 组件内部依赖 `'uni-icons'` 、`uni-badge` 组件 -> - `uni-list` 和 `uni-list-item` 需要配套使用,暂不支持单独使用 `uni-list-item` -> - 只有开启点击反馈后,会有点击选中效果 -> - 使用插槽时,可以完全自定义内容 -> - note 、rightText 属性暂时没做限制,不支持文字溢出隐藏,使用时应该控制长度显示或通过默认插槽自行扩展 -> - 支付宝小程序平台需要在支付宝小程序开发者工具里开启 component2 编译模式,开启方式: 详情 --> 项目配置 --> 启用 component2 编译 -> - 如果需要修改 `switch`、`badge` 样式,请使用插槽自定义 -> - 在 `HBuilderX` 低版本中,可能会出现组件显示 `undefined` 的问题,请升级最新的 `HBuilderX` 或者 `cli` -> - 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 - - -### 基本用法 - -- 设置 `title` 属性,可以显示列表标题 -- 设置 `disabled` 属性,可以禁用当前项 - -```html - - - - - -``` - -### 多行内容显示 - -- 设置 `note` 属性 ,可以在第二行显示描述文本信息 - -```html - - - - - -``` - -### 右侧显示角标、switch - -- 设置 `show-badge` 属性 ,可以显示角标内容 -- 设置 `show-switch` 属性,可以显示 switch 开关 - -```html - - - - - -``` - -### 左侧显示略缩图、图标 - -- 设置 `thumb` 属性 ,可以在列表左侧显示略缩图 -- 设置 `show-extra-icon` 属性,并指定 `extra-icon` 可以在左侧显示图标 - -```html - - - - -``` - -### 开启点击反馈和右侧箭头 -- 设置 `clickable` 为 `true` ,则表示这是一个可点击的列表,会默认给一个点击效果,并可以监听 `click` 事件 -- 设置 `link` 属性,会自动开启点击反馈,并给列表右侧添加一个箭头 -- 设置 `to` 属性,可以跳转页面,`link` 的值表示跳转方式,如果不指定,默认为 `navigateTo` - -```html - - - - - - - -``` - - -### 聊天列表示例 -- 设置 `clickable` 为 `true` ,则表示这是一个可点击的列表,会默认给一个点击效果,并可以监听 `click` 事件 -- 设置 `link` 属性,会自动开启点击反馈,`link` 的值表示跳转方式,如果不指定,默认为 `navigateTo` -- 设置 `to` 属性,可以跳转页面 -- `time` 属性,通常会设置成时间显示,但是这个属性不仅仅可以设置时间,你可以传入任何文本,注意文本长度可能会影响显示 -- `avatar` 和 `avatarList` 属性同时只会有一个生效,同时设置的话,`avatarList` 属性的长度大于1 ,`avatar` 属性将失效 -- 可以通过默认插槽自定义列表右侧内容 - -```html - - - - - - - - - - - - - - - - - 刚刚 - - - - - - - -``` - -```javascript - -export default { - components: {}, - data() { - return { - avatarList: [{ - url: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png' - }, { - url: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png' - }, { - url: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png' - }] - } - } -} - -``` - - -```css - -.chat-custom-right { - flex: 1; - /* #ifndef APP-NVUE */ - display: flex; - /* #endif */ - flex-direction: column; - justify-content: space-between; - align-items: flex-end; -} - -.chat-custom-text { - font-size: 12px; - color: #999; -} - -``` - -## API - -### List Props - -属性名 |类型 |默认值 | 说明 -:-: |:-: |:-: | :-: -border |Boolean |true | 是否显示边框 - - -### ListItem Props - -属性名 |类型 |默认值 | 说明 -:-: |:-: |:-: | :-: -title |String |- | 标题 -note |String |- | 描述 -ellipsis |Number |0 | title 是否溢出隐藏,可选值,0:默认; 1:显示一行; 2:显示两行;【nvue 暂不支持】 -thumb |String |- | 左侧缩略图,若thumb有值,则不会显示扩展图标 -thumbSize |String |medium | 略缩图尺寸,可选值,lg:大图; medium:一般; sm:小图; -showBadge |Boolean |false | 是否显示数字角标 -badgeText |String |- | 数字角标内容 -badgeType |String |- | 数字角标类型,参考[uni-icons](https://ext.dcloud.net.cn/plugin?id=21) -badgeStyle |Object |- | 数字角标样式,使用uni-badge的custom-style参数 -rightText |String |- | 右侧文字内容 -disabled |Boolean |false | 是否禁用 -showArrow |Boolean |true | 是否显示箭头图标 -link |String |navigateTo | 新页面跳转方式,可选值见下表 -to |String |- | 新页面跳转地址,如填写此属性,click 会返回页面是否跳转成功 -clickable |Boolean |false | 是否开启点击反馈 -showSwitch |Boolean |false | 是否显示Switch -switchChecked |Boolean |false | Switch是否被选中 -showExtraIcon |Boolean |false | 左侧是否显示扩展图标 -extraIcon |Object |- | 扩展图标参数,格式为 ``{color: '#4cd964',size: '22',type: 'spinner'}``,参考 [uni-icons](https://ext.dcloud.net.cn/plugin?id=28) -direction | String |row | 排版方向,可选值,row:水平排列; column:垂直排列; 3个插槽是水平排还是垂直排,也受此属性控制 - - -#### Link Options - -属性名 | 说明 -:-: | :-: -navigateTo | 同 uni.navigateTo() -redirectTo | 同 uni.reLaunch() -reLaunch | 同 uni.reLaunch() -switchTab | 同 uni.switchTab() - -### ListItem Events - -事件称名 |说明 |返回参数 -:-: |:-: |:-: -click |点击 uniListItem 触发事件,需开启点击反馈 |- -switchChange |点击切换 Switch 时触发,需显示 switch |e={value:checked} - - - -### ListItem Slots - -名称 | 说明 -:-: | :-: -header | 左/上内容插槽,可完全自定义默认显示 -body | 中间内容插槽,可完全自定义中间内容 -footer | 右/下内容插槽,可完全自定义右侧内容 - - -> **通过插槽扩展** -> 需要注意的是当使用插槽时,内置样式将会失效,只保留排版样式,此时的样式需要开发者自己实现 -> 如果 `uni-list-item` 组件内置属性样式无法满足需求,可以使用插槽来自定义uni-list-item里的内容。 -> uni-list-item提供了3个可扩展的插槽:`header`、`body`、`footer` -> - 当 `direction` 属性为 `row` 时表示水平排列,此时 `header` 表示列表的左边部分,`body` 表示列表的中间部分,`footer` 表示列表的右边部分 -> - 当 `direction` 属性为 `column` 时表示垂直排列,此时 `header` 表示列表的上边部分,`body` 表示列表的中间部分,`footer` 表示列表的下边部分 -> 开发者可以只用1个插槽,也可以3个一起使用。在插槽中可自主编写view标签,实现自己所需的效果。 - - -**示例** - -```html - - - - - - - - - 自定义插槽 - - - - -``` - - - - - -### ListItemChat Props - -属性名 |类型 |默认值 | 说明 -:-: |:-: |:-: | :-: -title |String |- | 标题 -note |String |- | 描述 -clickable |Boolean |false | 是否开启点击反馈 -badgeText |String |- | 数字角标内容,设置为 `dot` 将显示圆点 -badgePositon |String |right | 角标位置 -link |String |navigateTo | 是否展示右侧箭头并开启点击反馈,可选值见下表 -clickable |Boolean |false | 是否开启点击反馈 -to |String |- | 跳转页面地址,如填写此属性,click 会返回页面是否跳转成功 -time |String |- | 右侧时间显示 -avatarCircle |Boolean |false | 是否显示圆形头像 -avatar |String |- | 头像地址,avatarCircle 不填时生效 -avatarList |Array |- | 头像组,格式为 [{url:''}] - -#### Link Options - -属性名 | 说明 -:-: | :-: -navigateTo | 同 uni.navigateTo() -redirectTo | 同 uni.reLaunch() -reLaunch | 同 uni.reLaunch() -switchTab | 同 uni.switchTab() - -### ListItemChat Slots - -名称 | 说明 -:- | :- -default | 自定义列表右侧内容(包括时间和角标显示) - -### ListItemChat Events -事件称名 | 说明 | 返回参数 -:-: | :-: | :-: -@click | 点击 uniListChat 触发事件 | {data:{}} ,如有 to 属性,会返回页面跳转信息 - - - - - - -## 基于uni-list扩展的页面模板 - -通过扩展插槽,可实现多种常见样式的列表 - -**新闻列表类** - -1. 云端一体混合布局:[https://ext.dcloud.net.cn/plugin?id=2546](https://ext.dcloud.net.cn/plugin?id=2546) -2. 云端一体垂直布局,大图模式:[https://ext.dcloud.net.cn/plugin?id=2583](https://ext.dcloud.net.cn/plugin?id=2583) -3. 云端一体垂直布局,多行图文混排:[https://ext.dcloud.net.cn/plugin?id=2584](https://ext.dcloud.net.cn/plugin?id=2584) -4. 云端一体垂直布局,多图模式:[https://ext.dcloud.net.cn/plugin?id=2585](https://ext.dcloud.net.cn/plugin?id=2585) -5. 云端一体水平布局,左图右文:[https://ext.dcloud.net.cn/plugin?id=2586](https://ext.dcloud.net.cn/plugin?id=2586) -6. 云端一体水平布局,左文右图:[https://ext.dcloud.net.cn/plugin?id=2587](https://ext.dcloud.net.cn/plugin?id=2587) -7. 云端一体垂直布局,无图模式,主标题+副标题:[https://ext.dcloud.net.cn/plugin?id=2588](https://ext.dcloud.net.cn/plugin?id=2588) - -**商品列表类** - -1. 云端一体列表/宫格视图互切:[https://ext.dcloud.net.cn/plugin?id=2651](https://ext.dcloud.net.cn/plugin?id=2651) -2. 云端一体列表(宫格模式):[https://ext.dcloud.net.cn/plugin?id=2671](https://ext.dcloud.net.cn/plugin?id=2671) -3. 云端一体列表(列表模式):[https://ext.dcloud.net.cn/plugin?id=2672](https://ext.dcloud.net.cn/plugin?id=2672) - -## 组件示例 - -点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/list/list](https://hellouniapp.dcloud.net.cn/pages/extUI/list/list) \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-load-more/changelog.md b/sport-erp-admin/uni_modules/uni-load-more/changelog.md deleted file mode 100644 index 8f03f1d..0000000 --- a/sport-erp-admin/uni_modules/uni-load-more/changelog.md +++ /dev/null @@ -1,19 +0,0 @@ -## 1.3.3(2022-01-20) -- 新增 showText属性 ,是否显示文本 -## 1.3.2(2022-01-19) -- 修复 nvue 平台下不显示文本的bug -## 1.3.1(2022-01-19) -- 修复 微信小程序平台样式选择器报警告的问题 -## 1.3.0(2021-11-19) -- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) -- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-load-more](https://uniapp.dcloud.io/component/uniui/uni-load-more) -## 1.2.1(2021-08-24) -- 新增 支持国际化 -## 1.2.0(2021-07-30) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 1.1.8(2021-05-12) -- 新增 组件示例地址 -## 1.1.7(2021-03-30) -- 修复 uni-load-more 在首页使用时,h5 平台报 'uni is not defined' 的 bug -## 1.1.6(2021-02-05) -- 调整为uni_modules目录规范 diff --git a/sport-erp-admin/uni_modules/uni-load-more/components/uni-load-more/i18n/en.json b/sport-erp-admin/uni_modules/uni-load-more/components/uni-load-more/i18n/en.json deleted file mode 100644 index a4f14a5..0000000 --- a/sport-erp-admin/uni_modules/uni-load-more/components/uni-load-more/i18n/en.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "uni-load-more.contentdown": "Pull up to show more", - "uni-load-more.contentrefresh": "loading...", - "uni-load-more.contentnomore": "No more data" -} diff --git a/sport-erp-admin/uni_modules/uni-load-more/components/uni-load-more/i18n/index.js b/sport-erp-admin/uni_modules/uni-load-more/components/uni-load-more/i18n/index.js deleted file mode 100644 index de7509c..0000000 --- a/sport-erp-admin/uni_modules/uni-load-more/components/uni-load-more/i18n/index.js +++ /dev/null @@ -1,8 +0,0 @@ -import en from './en.json' -import zhHans from './zh-Hans.json' -import zhHant from './zh-Hant.json' -export default { - en, - 'zh-Hans': zhHans, - 'zh-Hant': zhHant -} diff --git a/sport-erp-admin/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hans.json b/sport-erp-admin/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hans.json deleted file mode 100644 index f15d510..0000000 --- a/sport-erp-admin/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hans.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "uni-load-more.contentdown": "上拉显示更多", - "uni-load-more.contentrefresh": "正在加载...", - "uni-load-more.contentnomore": "没有更多数据了" -} diff --git a/sport-erp-admin/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hant.json b/sport-erp-admin/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hant.json deleted file mode 100644 index a255c6d..0000000 --- a/sport-erp-admin/uni_modules/uni-load-more/components/uni-load-more/i18n/zh-Hant.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "uni-load-more.contentdown": "上拉顯示更多", - "uni-load-more.contentrefresh": "正在加載...", - "uni-load-more.contentnomore": "沒有更多數據了" -} diff --git a/sport-erp-admin/uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue b/sport-erp-admin/uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue deleted file mode 100644 index e5eff4d..0000000 --- a/sport-erp-admin/uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue +++ /dev/null @@ -1,399 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-load-more/package.json b/sport-erp-admin/uni_modules/uni-load-more/package.json deleted file mode 100644 index 2fa6f04..0000000 --- a/sport-erp-admin/uni_modules/uni-load-more/package.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "id": "uni-load-more", - "displayName": "uni-load-more 加载更多", - "version": "1.3.3", - "description": "LoadMore 组件,常用在列表里面,做滚动加载使用。", - "keywords": [ - "uni-ui", - "uniui", - "加载更多", - "load-more" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ], - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" - }, - "uni_modules": { - "dependencies": ["uni-scss"], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "y" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y" - }, - "快应用": { - "华为": "u", - "联盟": "u" - }, - "Vue": { - "vue2": "y", - "vue3": "y" - } - } - } - } -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-load-more/readme.md b/sport-erp-admin/uni_modules/uni-load-more/readme.md deleted file mode 100644 index 54dc1fa..0000000 --- a/sport-erp-admin/uni_modules/uni-load-more/readme.md +++ /dev/null @@ -1,14 +0,0 @@ - - -### LoadMore 加载更多 -> **组件名:uni-load-more** -> 代码块: `uLoadMore` - - -用于列表中,做滚动加载使用,展示 loading 的各种状态。 - - -### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-load-more) -#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 - - diff --git a/sport-erp-admin/uni_modules/uni-notice-bar/changelog.md b/sport-erp-admin/uni_modules/uni-notice-bar/changelog.md deleted file mode 100644 index ce50674..0000000 --- a/sport-erp-admin/uni_modules/uni-notice-bar/changelog.md +++ /dev/null @@ -1,20 +0,0 @@ -## 1.2.2(2023-12-20) -- 修复动态绑定title时,滚动速度不一致的问题 -## 1.2.1(2022-09-05) -- 新增 属性 fontSize,可修改文字大小。 -## 1.2.0(2021-11-19) -- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) -- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-notice-bar](https://uniapp.dcloud.io/component/uniui/uni-notice-bar) -## 1.1.1(2021-11-09) -- 新增 提供组件设计资源,组件样式调整 -## 1.1.0(2021-07-30) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 1.0.9(2021-05-12) -- 新增 组件示例地址 -## 1.0.8(2021-04-21) -- 优化 添加依赖 uni-icons, 导入后自动下载依赖 -## 1.0.7(2021-02-05) -- 优化 组件引用关系,通过uni_modules引用组件 - -## 1.0.6(2021-02-05) -- 调整为uni_modules目录规范 diff --git a/sport-erp-admin/uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar.vue b/sport-erp-admin/uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar.vue deleted file mode 100644 index 47fb9b3..0000000 --- a/sport-erp-admin/uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar.vue +++ /dev/null @@ -1,431 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-notice-bar/package.json b/sport-erp-admin/uni_modules/uni-notice-bar/package.json deleted file mode 100644 index 1e9762c..0000000 --- a/sport-erp-admin/uni_modules/uni-notice-bar/package.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "id": "uni-notice-bar", - "displayName": "uni-notice-bar 通告栏", - "version": "1.2.2", - "description": "NoticeBar 通告栏组件,常用于展示公告信息,可设为滚动公告", - "keywords": [ - "uni-ui", - "uniui", - "通告栏", - "公告", - "跑马灯" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, -"dcloudext": { - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", - "type": "component-vue" - }, - "uni_modules": { - "dependencies": [ - "uni-scss", - "uni-icons" - ], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "y" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y" - }, - "快应用": { - "华为": "u", - "联盟": "u" - }, - "Vue": { - "vue2": "y", - "vue3": "y" - } - } - } - } -} diff --git a/sport-erp-admin/uni_modules/uni-notice-bar/readme.md b/sport-erp-admin/uni_modules/uni-notice-bar/readme.md deleted file mode 100644 index fb2ede2..0000000 --- a/sport-erp-admin/uni_modules/uni-notice-bar/readme.md +++ /dev/null @@ -1,13 +0,0 @@ - - -## NoticeBar 通告栏 -> **组件名:uni-notice-bar** -> 代码块: `uNoticeBar` - - -通告栏组件 。 - -### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-notice-bar) -#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 - - diff --git a/sport-erp-admin/uni_modules/uni-number-box/changelog.md b/sport-erp-admin/uni_modules/uni-number-box/changelog.md deleted file mode 100644 index adf9221..0000000 --- a/sport-erp-admin/uni_modules/uni-number-box/changelog.md +++ /dev/null @@ -1,39 +0,0 @@ -## 1.2.8(2024-04-26) -- 修复 在vue2下H5黑边的bug -## 1.2.7(2024-04-26) -- 修复 在vue2手动输入后失焦导致清空数值的严重bug -## 1.2.6(2024-02-22) -- 新增 设置宽度属性width(单位:px) -## 1.2.5(2024-02-21) -- 修复 step步长小于1时,键盘类型为number的bug -## 1.2.4(2024-02-02) -- 修复 加减号垂直位置偏移样式问题 -## 1.2.3(2023-05-23) -- 更新示例工程 -## 1.2.2(2023-05-08) -- 修复 change 事件执行顺序错误的问题 -## 1.2.1(2021-11-22) -- 修复 vue3中某些scss变量无法找到的问题 -## 1.2.0(2021-11-19) -- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) -- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-number-box](https://uniapp.dcloud.io/component/uniui/uni-number-box) -## 1.1.2(2021-11-09) -- 新增 提供组件设计资源,组件样式调整 -## 1.1.1(2021-07-30) -- 优化 vue3下事件警告的问题 -## 1.1.0(2021-07-13) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 1.0.7(2021-05-12) -- 新增 组件示例地址 -## 1.0.6(2021-04-20) -- 修复 uni-number-box 浮点数运算不精确的 bug -- 修复 uni-number-box change 事件触发不正确的 bug -- 新增 uni-number-box v-model 双向绑定 -## 1.0.5(2021-02-05) -- 调整为uni_modules目录规范 - -## 1.0.7(2021-02-05) -- 调整为uni_modules目录规范 -- 新增 支持 v-model -- 新增 支持 focus、blur 事件 -- 新增 支持 PC 端 diff --git a/sport-erp-admin/uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue b/sport-erp-admin/uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue deleted file mode 100644 index 4e203cc..0000000 --- a/sport-erp-admin/uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue +++ /dev/null @@ -1,232 +0,0 @@ - - - diff --git a/sport-erp-admin/uni_modules/uni-number-box/package.json b/sport-erp-admin/uni_modules/uni-number-box/package.json deleted file mode 100644 index 4ac9047..0000000 --- a/sport-erp-admin/uni_modules/uni-number-box/package.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "id": "uni-number-box", - "displayName": "uni-number-box 数字输入框", - "version": "1.2.8", - "description": "NumberBox 带加减按钮的数字输入框组件,用户可以控制每次点击增加的数值,支持小数。", - "keywords": [ - "uni-ui", - "uniui", - "数字输入框" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, -"dcloudext": { - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", - "type": "component-vue" - }, - "uni_modules": { - "dependencies": ["uni-scss"], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y", - "alipay": "n" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "y" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y" - }, - "快应用": { - "华为": "u", - "联盟": "u" - }, - "Vue": { - "vue2": "y", - "vue3": "y" - } - } - } - } -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-number-box/readme.md b/sport-erp-admin/uni_modules/uni-number-box/readme.md deleted file mode 100644 index affc56f..0000000 --- a/sport-erp-admin/uni_modules/uni-number-box/readme.md +++ /dev/null @@ -1,13 +0,0 @@ - - -## NumberBox 数字输入框 -> **组件名:uni-number-box** -> 代码块: `uNumberBox` - - -带加减按钮的数字输入框。 - -### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-number-box) -#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 - - diff --git a/sport-erp-admin/uni_modules/uni-open-bridge-common/changelog.md b/sport-erp-admin/uni_modules/uni-open-bridge-common/changelog.md deleted file mode 100644 index e97c535..0000000 --- a/sport-erp-admin/uni_modules/uni-open-bridge-common/changelog.md +++ /dev/null @@ -1,25 +0,0 @@ -## 1.2.0(2023-04-27) -- 优化 微信小程序平台 使用微信新增 API getStableAccessToken 获取 access_token, access_token 有效期内重复调用该接口不会更新 access_token, [详情](https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/mp-access-token/getStableAccessToken.html) -## 1.1.5(2023-03-27) -- 修复 微信小程序平台 某些情况下 encrypt_key 插入错误的问题 -## 1.1.4(2023-03-13) -- 修复 平台 weixin-web -## 1.1.3(2023-03-13) -- 新增 支持旧版本 uni-id 配置 -- 新增 支持平台 weixin-app|qq-mp|qq-app -## 1.1.2(2023-02-28) -- 新增 config 配置错误提示语 -## 1.1.1(2023-02-28) -- 新增 支持 provider 参数,和 platform 保持一致 -## 1.1.0(2023-02-27) -- 重要更新 调整数据库key格式,兼容旧版本API,如果开发者通过手动拼接key查询数据库需要修改现有逻辑 - + 原格式: uni-id:[dcloudAppid]:[platform]:[openid]:[access-token|user-access-token|session-key|encrypt-key-version|ticket] - + 新格式: uni-id:[provider]:[appid]:[openid]:[access-token|user-access-token|session-key|encrypt-key-version|ticket] -## 1.0.4(2022-09-21) -- 新增 支持使用阿里云固定IP获取微信公众号H5凭据 access_token、ticket,开发者需要在微信公众平台配置阿里云固定IP,[固定IP详情](https://uniapp.dcloud.net.cn/uniCloud/cf-functions.html#aliyun-eip) -## 1.0.3(2022-09-06) -- 修复 过期时间问题,容错 AccessToken 默认 fallback 逻辑,当微信服务器没有返回过期时间时设置为2小时后过期 -## 1.0.2(2022-09-02) -- 新增 依赖数据表schema opendb-open-data -## 1.0.0(2022-08-22) -- 首次发布 diff --git a/sport-erp-admin/uni_modules/uni-open-bridge-common/package.json b/sport-erp-admin/uni_modules/uni-open-bridge-common/package.json deleted file mode 100644 index 30f2620..0000000 --- a/sport-erp-admin/uni_modules/uni-open-bridge-common/package.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "id": "uni-open-bridge-common", - "displayName": "uni-open-bridge-common", - "version": "1.2.0", - "description": "统一接管微信等三方平台认证凭据", - "keywords": [ - "uni-open-bridge-common", - "access_token", - "session_key", - "ticket" -], - "repository": "", - "engines": { - "HBuilderX": "^3.5.2" - }, - "dcloudext": { - "type": "unicloud-template-function", - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "" - }, - "uni_modules": { - "dependencies": [], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y" - }, - "client": { - "Vue": { - "vue2": "u", - "vue3": "u" - }, - "App": { - "app-vue": "u", - "app-nvue": "u" - }, - "H5-mobile": { - "Safari": "u", - "Android Browser": "u", - "微信浏览器(Android)": "u", - "QQ浏览器(Android)": "u" - }, - "H5-pc": { - "Chrome": "u", - "IE": "u", - "Edge": "u", - "Firefox": "u", - "Safari": "u" - }, - "小程序": { - "微信": "u", - "阿里": "u", - "百度": "u", - "字节跳动": "u", - "QQ": "u", - "钉钉": "u", - "快手": "u", - "飞书": "u", - "京东": "u" - }, - "快应用": { - "华为": "u", - "联盟": "u" - } - } - } - } -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-open-bridge-common/readme.md b/sport-erp-admin/uni_modules/uni-open-bridge-common/readme.md deleted file mode 100644 index 3892384..0000000 --- a/sport-erp-admin/uni_modules/uni-open-bridge-common/readme.md +++ /dev/null @@ -1,5 +0,0 @@ -# uni-open-bridge-common - -`uni-open-bridge-common` 是统一接管微信等三方平台认证凭据(包括但不限于`access_token`、`session_key`、`encrypt_key`、`ticket`)的开源库。 - -文档链接 [https://uniapp.dcloud.net.cn/uniCloud/uni-open-bridge#common](https://uniapp.dcloud.net.cn/uniCloud/uni-open-bridge#common) diff --git a/sport-erp-admin/uni_modules/uni-open-bridge-common/uniCloud/cloudfunctions/common/uni-open-bridge-common/bridge-error.js b/sport-erp-admin/uni_modules/uni-open-bridge-common/uniCloud/cloudfunctions/common/uni-open-bridge-common/bridge-error.js deleted file mode 100644 index 95160a4..0000000 --- a/sport-erp-admin/uni_modules/uni-open-bridge-common/uniCloud/cloudfunctions/common/uni-open-bridge-common/bridge-error.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; - -class BridgeError extends Error { - - constructor(code, message) { - super(message) - - this._code = code - } - - get code() { - return this._code - } - - get errCode() { - return this._code - } - - get errMsg() { - return this.message - } -} - -module.exports = { - BridgeError -} diff --git a/sport-erp-admin/uni_modules/uni-open-bridge-common/uniCloud/cloudfunctions/common/uni-open-bridge-common/config.js b/sport-erp-admin/uni_modules/uni-open-bridge-common/uniCloud/cloudfunctions/common/uni-open-bridge-common/config.js deleted file mode 100644 index d083f00..0000000 --- a/sport-erp-admin/uni_modules/uni-open-bridge-common/uniCloud/cloudfunctions/common/uni-open-bridge-common/config.js +++ /dev/null @@ -1,124 +0,0 @@ -'use strict'; - -const { - ProviderType -} = require('./consts.js') - -const configCenter = require('uni-config-center') - -// 多维数据为兼容uni-id以前版本配置 -const OauthConfig = { - 'weixin-app': [ - ['app', 'oauth', 'weixin'], - ['app-plus', 'oauth', 'weixin'] - ], - 'weixin-mp': [ - ['mp-weixin', 'oauth', 'weixin'] - ], - 'weixin-h5': [ - ['web', 'oauth', 'weixin-h5'], - ['h5-weixin', 'oauth', 'weixin'], - ['h5', 'oauth', 'weixin'] - ], - 'weixin-web': [ - ['web', 'oauth', 'weixin-web'] - ], - 'qq-app': [ - ['app', 'oauth', 'qq'], - ['app-plus', 'oauth', 'qq'] - ], - 'qq-mp': [ - ['mp-qq', 'oauth', 'qq'] - ] -} - -const Support_Platforms = [ - ProviderType.WEIXIN_MP, - ProviderType.WEIXIN_H5, - ProviderType.WEIXIN_APP, - ProviderType.WEIXIN_WEB, - ProviderType.QQ_MP, - ProviderType.QQ_APP -] - -class ConfigBase { - - constructor() { - const uniIdConfigCenter = configCenter({ - pluginId: 'uni-id' - }) - - this._uniIdConfig = uniIdConfigCenter.config() - } - - getAppConfig(appid) { - if (Array.isArray(this._uniIdConfig)) { - return this._uniIdConfig.find((item) => { - return (item.dcloudAppid === appid) - }) - } - return this._uniIdConfig - } -} - -class AppConfig extends ConfigBase { - - constructor() { - super() - } - - get(appid, platform) { - if (!this.isSupport(platform)) { - return null - } - - let appConfig = this.getAppConfig(appid) - if (!appConfig) { - return null - } - - return this.getOauthConfig(appConfig, platform) - } - - isSupport(platformName) { - return (Support_Platforms.indexOf(platformName) >= 0) - } - - getOauthConfig(appConfig, platformName) { - let treePath = OauthConfig[platformName] - let node = this.findNode(appConfig, treePath) - if (node && node.appid && node.appsecret) { - return { - appid: node.appid, - secret: node.appsecret - } - } - return null - } - - findNode(treeNode, arrayPath) { - let node = treeNode - for (let treePath of arrayPath) { - for (let name of treePath) { - const currentNode = node[name] - if (currentNode) { - node = currentNode - } else { - node = null - break - } - } - if (node === null) { - node = treeNode - } else { - break - } - } - return node - } -} - - -module.exports = { - AppConfig -}; \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-open-bridge-common/uniCloud/cloudfunctions/common/uni-open-bridge-common/consts.js b/sport-erp-admin/uni_modules/uni-open-bridge-common/uniCloud/cloudfunctions/common/uni-open-bridge-common/consts.js deleted file mode 100644 index 4c666e9..0000000 --- a/sport-erp-admin/uni_modules/uni-open-bridge-common/uniCloud/cloudfunctions/common/uni-open-bridge-common/consts.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; - -const TAG = "UNI_OPEN_BRIDGE" - -const HTTP_STATUS = { - SUCCESS: 200 -} - -const ProviderType = { - WEIXIN_MP: 'weixin-mp', - WEIXIN_H5: 'weixin-h5', - WEIXIN_APP: 'weixin-app', - WEIXIN_WEB: 'weixin-web', - QQ_MP: 'qq-mp', - QQ_APP: 'qq-app' -} - -// old -const PlatformType = ProviderType - -const ErrorCodeType = { - SYSTEM_ERROR: TAG + "_SYSTEM_ERROR" -} - -module.exports = { - HTTP_STATUS, - ProviderType, - PlatformType, - ErrorCodeType -} diff --git a/sport-erp-admin/uni_modules/uni-open-bridge-common/uniCloud/cloudfunctions/common/uni-open-bridge-common/index.js b/sport-erp-admin/uni_modules/uni-open-bridge-common/uniCloud/cloudfunctions/common/uni-open-bridge-common/index.js deleted file mode 100644 index fc23cd9..0000000 --- a/sport-erp-admin/uni_modules/uni-open-bridge-common/uniCloud/cloudfunctions/common/uni-open-bridge-common/index.js +++ /dev/null @@ -1,317 +0,0 @@ -'use strict'; - -const { - PlatformType, - ProviderType, - ErrorCodeType -} = require('./consts.js') - -const { - AppConfig -} = require('./config.js') - -const { - Storage -} = require('./storage.js') - -const { - BridgeError -} = require('./bridge-error.js') - -const { - WeixinServer -} = require('./weixin-server.js') - -const appConfig = new AppConfig() - -class AccessToken extends Storage { - - constructor() { - super('access-token', ['provider', 'appid']) - } - - async update(key) { - super.update(key) - - const result = await this.getByWeixinServer(key) - - return this.set(key, result.value, result.duration) - } - - async fallback(key) { - return this.getByWeixinServer(key) - } - - async getByWeixinServer(key) { - const oauthConfig = appConfig.get(key.dcloudAppid, key.provider) - let methodName - if (key.provider === ProviderType.WEIXIN_MP) { - methodName = 'GetMPAccessTokenData' - } else if (key.provider === ProviderType.WEIXIN_H5) { - methodName = 'GetH5AccessTokenData' - } else { - throw new BridgeError(ErrorCodeType.SYSTEM_ERROR, "provider invalid") - } - - const responseData = await WeixinServer[methodName](oauthConfig) - - const duration = responseData.expires_in || (60 * 60 * 2) - delete responseData.expires_in - - return { - value: responseData, - duration - } - } -} - -class UserAccessToken extends Storage { - - constructor() { - super('user-access-token', ['provider', 'appid', 'openid']) - } -} - -class SessionKey extends Storage { - - constructor() { - super('session-key', ['provider', 'appid', 'openid']) - } -} - -class Encryptkey extends Storage { - - constructor() { - super('encrypt-key', ['provider', 'appid', 'openid']) - } - - async update(key) { - super.update(key) - - const result = await this.getByWeixinServer(key) - - return this.set(key, result.value, result.duration) - } - - getKeyString(key) { - return `${super.getKeyString(key)}-${key.version}` - } - - getExpiresIn(value) { - if (value <= 0) { - return 60 - } - return value - } - - async fallback(key) { - return this.getByWeixinServer(key) - } - - async getByWeixinServer(key) { - const accessToken = await Factory.Get(AccessToken, key) - const userSession = await Factory.Get(SessionKey, key) - - const responseData = await WeixinServer.GetUserEncryptKeyData({ - openid: key.openid, - access_token: accessToken.access_token, - session_key: userSession.session_key - }) - - const keyInfo = responseData.key_info_list.find((item) => { - return item.version === key.version - }) - - if (!keyInfo) { - throw new BridgeError(ErrorCodeType.SYSTEM_ERROR, 'key version invalid') - } - - const value = { - encrypt_key: keyInfo.encrypt_key, - iv: keyInfo.iv - } - - return { - value, - duration: keyInfo.expire_in - } - } -} - -class Ticket extends Storage { - - constructor() { - super('ticket', ['provider', 'appid']) - } - - async update(key) { - super.update(key) - - const result = await this.getByWeixinServer(key) - - return this.set(key, result.value, result.duration) - } - - async fallback(key) { - return this.getByWeixinServer(key) - } - - async getByWeixinServer(key) { - const accessToken = await Factory.Get(AccessToken, { - dcloudAppid: key.dcloudAppid, - provider: ProviderType.WEIXIN_H5 - }) - - const responseData = await WeixinServer.GetH5TicketData(accessToken) - - const duration = responseData.expires_in || (60 * 60 * 2) - delete responseData.expires_in - delete responseData.errcode - delete responseData.errmsg - - return { - value: responseData, - duration - } - } -} - - -const Factory = { - - async Get(T, key, fallback) { - Factory.FixOldKey(key) - return Factory.MakeUnique(T).get(key, fallback) - }, - - async Set(T, key, value, expiresIn) { - Factory.FixOldKey(key) - return Factory.MakeUnique(T).set(key, value, expiresIn) - }, - - async Remove(T, key) { - Factory.FixOldKey(key) - return Factory.MakeUnique(T).remove(key) - }, - - async Update(T, key) { - Factory.FixOldKey(key) - return Factory.MakeUnique(T).update(key) - }, - - FixOldKey(key) { - if (!key.provider) { - key.provider = key.platform - } - - const configData = appConfig.get(key.dcloudAppid, key.provider) - if (!configData) { - throw new BridgeError(ErrorCodeType.SYSTEM_ERROR, 'appid or provider invalid') - } - key.appid = configData.appid - }, - - MakeUnique(T) { - return new T() - } -} - - -// exports - -async function getAccessToken(key, fallback) { - return Factory.Get(AccessToken, key, fallback) -} - -async function setAccessToken(key, value, expiresIn) { - return Factory.Set(AccessToken, key, value, expiresIn) -} - -async function removeAccessToken(key) { - return Factory.Remove(AccessToken, key) -} - -async function updateAccessToken(key) { - return Factory.Update(AccessToken, key) -} - -async function getUserAccessToken(key, fallback) { - return Factory.Get(UserAccessToken, key, fallback) -} - -async function setUserAccessToken(key, value, expiresIn) { - return Factory.Set(UserAccessToken, key, value, expiresIn) -} - -async function removeUserAccessToken(key) { - return Factory.Remove(UserAccessToken, key) -} - -async function getSessionKey(key, fallback) { - return Factory.Get(SessionKey, key, fallback) -} - -async function setSessionKey(key, value, expiresIn) { - return Factory.Set(SessionKey, key, value, expiresIn) -} - -async function removeSessionKey(key) { - return Factory.Remove(SessionKey, key) -} - -async function getEncryptKey(key, fallback) { - return Factory.Get(Encryptkey, key, fallback) -} - -async function setEncryptKey(key, value, expiresIn) { - return Factory.Set(Encryptkey, key, value, expiresIn) -} - -async function removeEncryptKey(key) { - return Factory.Remove(Encryptkey, key) -} - -async function updateEncryptKey(key) { - return Factory.Update(Encryptkey, key) -} - -async function getTicket(key, fallback) { - return Factory.Get(Ticket, key, fallback) -} - -async function setTicket(key, value, expiresIn) { - return Factory.Set(Ticket, key, value, expiresIn) -} - -async function removeTicket(key) { - return Factory.Remove(Ticket, key) -} - -async function updateTicket(key) { - return Factory.Update(Ticket, key) -} - -module.exports = { - getAccessToken, - setAccessToken, - removeAccessToken, - updateAccessToken, - getUserAccessToken, - setUserAccessToken, - removeUserAccessToken, - getSessionKey, - setSessionKey, - removeSessionKey, - getEncryptKey, - setEncryptKey, - removeEncryptKey, - updateEncryptKey, - getTicket, - setTicket, - removeTicket, - updateTicket, - ProviderType, - PlatformType, - WeixinServer, - ErrorCodeType -} diff --git a/sport-erp-admin/uni_modules/uni-open-bridge-common/uniCloud/cloudfunctions/common/uni-open-bridge-common/package.json b/sport-erp-admin/uni_modules/uni-open-bridge-common/uniCloud/cloudfunctions/common/uni-open-bridge-common/package.json deleted file mode 100644 index 7f4c08a..0000000 --- a/sport-erp-admin/uni_modules/uni-open-bridge-common/uniCloud/cloudfunctions/common/uni-open-bridge-common/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "uni-open-bridge-common", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "keywords": [], - "author": "", - "license": "ISC", - "dependencies": { - "uni-config-center": "file:..\/..\/..\/..\/..\/uni-config-center\/uniCloud\/cloudfunctions\/common\/uni-config-center" - }, - "origin-plugin-dev-name": "uni-template-admin", - "origin-plugin-version": "2.5.13", - "plugin-dev-name": "uni-template-admin", - "plugin-version": "2.5.13" -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-open-bridge-common/uniCloud/cloudfunctions/common/uni-open-bridge-common/storage.js b/sport-erp-admin/uni_modules/uni-open-bridge-common/uniCloud/cloudfunctions/common/uni-open-bridge-common/storage.js deleted file mode 100644 index bfb13a1..0000000 --- a/sport-erp-admin/uni_modules/uni-open-bridge-common/uniCloud/cloudfunctions/common/uni-open-bridge-common/storage.js +++ /dev/null @@ -1,111 +0,0 @@ -'use strict'; - -const { - Validator -} = require('./validator.js') - -const { - CacheKeyCascade -} = require('./uni-cloud-cache.js') - -const { - BridgeError -} = require('./bridge-error.js') - -class Storage { - - constructor(type, keys) { - this._type = type || null - this._keys = keys || [] - } - - async get(key, fallback) { - this.validateKey(key) - const result = await this.create(key, fallback).get() - return result.value - } - - async set(key, value, expiresIn) { - this.validateKey(key) - this.validateValue(value) - const expires_in = this.getExpiresIn(expiresIn) - if (expires_in !== 0) { - await this.create(key).set(this.getValue(value), expires_in) - } - } - - async remove(key) { - this.validateKey(key) - await this.create(key).remove() - } - - // virtual - async update(key) { - this.validateKey(key) - } - - async ttl(key) { - this.validateKey(key) - // 后续考虑支持 - } - - async fallback(key) {} - - getKeyString(key) { - const keyArray = [Storage.Prefix] - this._keys.forEach((name) => { - keyArray.push(key[name]) - }) - keyArray.push(this._type) - return keyArray.join(':') - } - - getValue(value) { - return value - } - - getExpiresIn(value) { - if (value !== undefined) { - return value - } - return -1 - } - - validateKey(key) { - Validator.Key(this._keys, key) - } - - validateValue(value) { - Validator.Value(value) - } - - create(key, fallback) { - const keyString = this.getKeyString(key) - const options = { - layers: [{ - type: 'database', - key: keyString - }, { - type: 'redis', - key: keyString - }] - } - - const _this = this - return new CacheKeyCascade({ - ...options, - fallback: async function() { - if (fallback) { - return fallback(key) - } else if (_this.fallback) { - return _this.fallback(key) - } - } - }) - } -} -Storage.Prefix = "uni-id" - -module.exports = { - Storage -}; diff --git a/sport-erp-admin/uni_modules/uni-open-bridge-common/uniCloud/cloudfunctions/common/uni-open-bridge-common/uni-cloud-cache.js b/sport-erp-admin/uni_modules/uni-open-bridge-common/uniCloud/cloudfunctions/common/uni-open-bridge-common/uni-cloud-cache.js deleted file mode 100644 index 2e4286b..0000000 --- a/sport-erp-admin/uni_modules/uni-open-bridge-common/uniCloud/cloudfunctions/common/uni-open-bridge-common/uni-cloud-cache.js +++ /dev/null @@ -1,324 +0,0 @@ -const db = uniCloud.database() - -function getType(value) { - return Object.prototype.toString.call(value).slice(8, -1).toLowerCase() -} - -const validator = { - key: function(value) { - const err = new Error('Invalid key') - if (typeof value !== 'string') { - throw err - } - const valueTrim = value.trim() - if (!valueTrim || valueTrim !== value) { - throw err - } - }, - value: function(value) { - // 仅作简单校验 - const type = getType(value) - const validValueType = ['null', 'number', 'string', 'array', 'object'] - if (validValueType.indexOf(type) === -1) { - throw new Error('Invalid value type') - } - }, - duration: function(value) { - const err = new Error('Invalid duration') - if (value === undefined) { - return - } - if (typeof value !== 'number' || value === 0) { - throw err - } - } -} - -/** - * 入库时 expired 为过期时间对应的时间戳,永不过期用-1表示 - * 返回结果时 与redis对齐,-1表示永不过期,-2表示已过期或不存在 - */ -class DatabaseCache { - constructor({ - collection = 'opendb-open-data' - } = {}) { - this.type = 'db' - this.collection = db.collection(collection) - } - - _serializeValue(value) { - return value === undefined ? null : JSON.stringify(value) - } - - _deserializeValue(value) { - return value ? JSON.parse(value) : value - } - - async set(key, value, duration) { - validator.key(key) - validator.value(value) - validator.duration(duration) - value = this._serializeValue(value) - await this.collection.doc(key).set({ - value, - expired: duration && duration !== -1 ? Date.now() + (duration * 1000) : -1 - }) - } - - async _getWithDuration(key) { - const getKeyRes = await this.collection.doc(key).get() - const record = getKeyRes.data[0] - if (!record) { - return { - value: null, - duration: -2 - } - } - const value = this._deserializeValue(record.value) - const expired = record.expired - if (expired === -1) { - return { - value, - duration: -1 - } - } - const duration = expired - Date.now() - if (duration <= 0) { - await this.remove(key) - return { - value: null, - duration: -2 - } - } - return { - value, - duration: Math.floor(duration / 1000) - } - } - - async get(key, { - withDuration = true - } = {}) { - const result = await this._getWithDuration(key) - if (!withDuration) { - delete result.duration - } - return result - } - - async remove(key) { - await this.collection.doc(key).remove() - } -} - -class RedisCache { - constructor() { - this.type = 'redis' - this.redis = uniCloud.redis() - } - - _serializeValue(value) { - return value === undefined ? null : JSON.stringify(value) - } - - _deserializeValue(value) { - return value ? JSON.parse(value) : value - } - - async set(key, value, duration) { - validator.key(key) - validator.value(value) - validator.duration(duration) - value = this._serializeValue(value) - if (!duration || duration === -1) { - await this.redis.set(key, value) - } else { - await this.redis.set(key, value, 'EX', duration) - } - } - - async get(key, { - withDuration = false - } = {}) { - let value = await this.redis.get(key) - value = this._deserializeValue(value) - if (!withDuration) { - return { - value - } - } - const durationSecond = await this.redis.ttl(key) - let duration - switch (durationSecond) { - case -1: - duration = -1 - break - case -2: - duration = -2 - break - default: - duration = durationSecond - break - } - return { - value, - duration - } - } - - async remove(key) { - await this.redis.del(key) - } -} - -class Cache { - constructor({ - type, - collection - } = {}) { - if (type === 'database') { - return new DatabaseCache({ - collection - }) - } else if (type === 'redis') { - return new RedisCache() - } else { - throw new Error('Invalid cache type') - } - } -} - -class CacheKey { - constructor({ - type, - collection, - cache, - key, - fallback - } = {}) { - this.cache = cache || new Cache({ - type, - collection - }) - this.key = key - this.fallback = fallback - } - - async set(value, duration) { - await this.cache.set(this.key, value, duration) - } - - async setWithSync(value, duration, syncMethod) { - await Promise.all([ - this.set(this.key, value, duration), - syncMethod(value, duration) - ]) - } - - async get() { - let { - value, - duration - } = await this.cache.get(this.key) - if (value !== null && value !== undefined) { - return { - value, - duration - } - } - if (!this.fallback) { - return { - value: null, - duration: -2 - } - } - const fallbackResult = await this.fallback() - value = fallbackResult.value - duration = fallbackResult.duration - if (value !== null && duration !== undefined) { - await this.cache.set(this.key, value, duration) - } - return { - value, - duration - } - } - - async remove() { - await this.cache.remove(this.key) - } -} - -class CacheKeyCascade { - constructor({ - layers, // [{cache, type, collection, key}] 从低级到高级排序,[DbCacheKey, RedisCacheKey] - fallback - } = {}) { - this.layers = layers - this.cacheLayers = [] - let lastCacheKey - for (let i = 0; i < layers.length; i++) { - const { - type, - cache, - collection, - key - } = layers[i] - const lastCacheKeyTemp = lastCacheKey - try { - const currentCacheKey = new CacheKey({ - type, - collection, - cache, - key, - fallback: i === 0 ? fallback : function() { - return lastCacheKeyTemp.get() - } - }) - this.cacheLayers.push(currentCacheKey) - lastCacheKey = currentCacheKey - } catch (e) {} - } - this.highLevelCache = lastCacheKey - } - - async set(value, duration) { - return Promise.all( - this.cacheLayers.map(item => { - return item.set(value, duration) - }) - ) - } - - async setWithSync(value, duration, syncMethod) { - const setPromise = this.cacheLayers.map(item => { - return item.set(value, duration) - }) - return Promise.all( - [ - ...setPromise, - syncMethod(value, duration) - ] - ) - } - - async get() { - return this.highLevelCache.get() - } - - async remove() { - await Promise.all( - this.cacheLayers.map(cacheKeyItem => { - return cacheKeyItem.remove() - }) - ) - } -} - -module.exports = { - Cache, - DatabaseCache, - RedisCache, - CacheKey, - CacheKeyCascade -} diff --git a/sport-erp-admin/uni_modules/uni-open-bridge-common/uniCloud/cloudfunctions/common/uni-open-bridge-common/validator.js b/sport-erp-admin/uni_modules/uni-open-bridge-common/uniCloud/cloudfunctions/common/uni-open-bridge-common/validator.js deleted file mode 100644 index 47a455b..0000000 --- a/sport-erp-admin/uni_modules/uni-open-bridge-common/uniCloud/cloudfunctions/common/uni-open-bridge-common/validator.js +++ /dev/null @@ -1,31 +0,0 @@ -const Validator = { - - Key(keyArray, parameters) { - for (let i = 0; i < keyArray.length; i++) { - const keyName = keyArray[i] - if (typeof parameters[keyName] !== 'string') { - Validator.ThrowNewError(`Invalid ${keyName}`) - } - if (parameters[keyName].length < 1) { - Validator.ThrowNewError(`Invalid ${keyName}`) - } - } - }, - - Value(value) { - if (value === undefined) { - Validator.ThrowNewError('Invalid Value') - } - if (typeof value !== 'object') { - Validator.ThrowNewError('Invalid Value Type') - } - }, - - ThrowNewError(message) { - throw new Error(message) - } -} - -module.exports = { - Validator -} diff --git a/sport-erp-admin/uni_modules/uni-open-bridge-common/uniCloud/cloudfunctions/common/uni-open-bridge-common/weixin-server.js b/sport-erp-admin/uni_modules/uni-open-bridge-common/uniCloud/cloudfunctions/common/uni-open-bridge-common/weixin-server.js deleted file mode 100644 index ef476f1..0000000 --- a/sport-erp-admin/uni_modules/uni-open-bridge-common/uniCloud/cloudfunctions/common/uni-open-bridge-common/weixin-server.js +++ /dev/null @@ -1,203 +0,0 @@ -'use strict'; - -const crypto = require('crypto') - -const { - HTTP_STATUS -} = require('./consts.js') - -const { - BridgeError -} = require('./bridge-error.js') - -class WeixinServer { - - constructor(options = {}) { - this._appid = options.appid - this._secret = options.secret - } - - getAccessToken() { - return uniCloud.httpclient.request(WeixinServer.AccessToken_Url, { - dataType: 'json', - method: 'POST', - contentType: 'json', - data: { - appid: this._appid, - secret: this._secret, - grant_type: "client_credential" - } - }) - } - - // 使用客户端获取的 code 从微信服务器换取 openid,code 仅可使用一次 - codeToSession(code) { - return uniCloud.httpclient.request(WeixinServer.Code2Session_Url, { - dataType: 'json', - data: { - appid: this._appid, - secret: this._secret, - js_code: code, - grant_type: 'authorization_code' - } - }) - } - - getUserEncryptKey({ - access_token, - openid, - session_key - }) { - console.log(access_token, openid, session_key); - const signature = crypto.createHmac('sha256', session_key).update('').digest('hex') - return uniCloud.httpclient.request(WeixinServer.User_Encrypt_Key_Url, { - dataType: 'json', - method: 'POST', - dataAsQueryString: true, - data: { - access_token, - openid: openid, - signature: signature, - sig_method: 'hmac_sha256' - } - }) - } - - getH5AccessToken() { - return uniCloud.httpclient.request(WeixinServer.AccessToken_H5_Url, { - dataType: 'json', - method: 'GET', - data: { - appid: this._appid, - secret: this._secret, - grant_type: "client_credential" - } - }) - } - - getH5Ticket(access_token) { - return uniCloud.httpclient.request(WeixinServer.Ticket_Url, { - dataType: 'json', - dataAsQueryString: true, - method: 'POST', - data: { - access_token - } - }) - } - - getH5AccessTokenForEip() { - return uniCloud.httpProxyForEip.postForm(WeixinServer.AccessToken_H5_Url, { - appid: this._appid, - secret: this._secret, - grant_type: "client_credential" - }, { - dataType: 'json' - }) - } - - getH5TicketForEip(access_token) { - return uniCloud.httpProxyForEip.postForm(WeixinServer.Ticket_Url, { - access_token - }, { - dataType: 'json', - dataAsQueryString: true - }) - } -} - -WeixinServer.AccessToken_Url = 'https://api.weixin.qq.com/cgi-bin/stable_token' -WeixinServer.Code2Session_Url = 'https://api.weixin.qq.com/sns/jscode2session' -WeixinServer.User_Encrypt_Key_Url = 'https://api.weixin.qq.com/wxa/business/getuserencryptkey' -WeixinServer.AccessToken_H5_Url = 'https://api.weixin.qq.com/cgi-bin/token' -WeixinServer.Ticket_Url = 'https://api.weixin.qq.com/cgi-bin/ticket/getticket?type=jsapi' - -WeixinServer.GetMPAccessToken = function(options) { - return new WeixinServer(options).getAccessToken() -} - -WeixinServer.GetCodeToSession = function(options) { - return new WeixinServer(options).codeToSession(options.code) -} - -WeixinServer.GetUserEncryptKey = function(options) { - return new WeixinServer(options).getUserEncryptKey(options) -} - -WeixinServer.GetH5AccessToken = function(options) { - return new WeixinServer(options).getH5AccessToken() -} - -WeixinServer.GetH5Ticket = function(options) { - return new WeixinServer(options).getH5Ticket(options.access_token) -} - -//////////////////////////////////////////////////////////////// - -function isAliyun() { - return (uniCloud.getCloudInfos()[0].provider === 'aliyun') -} - -WeixinServer.GetResponseData = function(response) { - console.log("WeixinServer::response", response) - - if (!(response.status === HTTP_STATUS.SUCCESS || response.statusCodeValue === HTTP_STATUS.SUCCESS)) { - throw new BridgeError(response.status || response.statusCodeValue, response.status || response.statusCodeValue) - } - - const responseData = response.data || response.body - - if (responseData.errcode !== undefined && responseData.errcode !== 0) { - throw new BridgeError(responseData.errcode, responseData.errmsg) - } - - return responseData -} - -WeixinServer.GetMPAccessTokenData = async function(options) { - const response = await new WeixinServer(options).getAccessToken() - return WeixinServer.GetResponseData(response) -} - -WeixinServer.GetCodeToSessionData = async function(options) { - const response = await new WeixinServer(options).codeToSession(options.code) - return WeixinServer.GetResponseData(response) -} - -WeixinServer.GetUserEncryptKeyData = async function(options) { - const response = await new WeixinServer(options).getUserEncryptKey(options) - return WeixinServer.GetResponseData(response) -} - -WeixinServer.GetH5AccessTokenData = async function(options) { - const ws = new WeixinServer(options) - let response - if (isAliyun()) { - response = await ws.getH5AccessTokenForEip() - if (typeof response === 'string') { - response = JSON.parse(response) - } - } else { - response = await ws.getH5AccessToken() - } - return WeixinServer.GetResponseData(response) -} - -WeixinServer.GetH5TicketData = async function(options) { - const ws = new WeixinServer(options) - let response - if (isAliyun()) { - response = await ws.getH5TicketForEip(options.access_token) - if (typeof response === 'string') { - response = JSON.parse(response) - } - } else { - response = await ws.getH5Ticket(options.access_token) - } - return WeixinServer.GetResponseData(response) -} - - -module.exports = { - WeixinServer -} diff --git a/sport-erp-admin/uni_modules/uni-open-bridge-common/uniCloud/database/opendb-open-data.schema.json b/sport-erp-admin/uni_modules/uni-open-bridge-common/uniCloud/database/opendb-open-data.schema.json deleted file mode 100644 index bc25098..0000000 --- a/sport-erp-admin/uni_modules/uni-open-bridge-common/uniCloud/database/opendb-open-data.schema.json +++ /dev/null @@ -1,19 +0,0 @@ -// 文档教程: https://uniapp.dcloud.net.cn/uniCloud/schema -{ - "bsonType": "object", - "required": ["_id", "value"], - "properties": { - "_id": { - "bsonType": "string", - "description": "key,格式:uni-id:[provider]:[appid]:[openid]:[access-token|user-access-token|session-key|encrypt-key-version|ticket]" - }, - "value": { - "bsonType": "object", - "description": "字段_id对应的值" - }, - "expired": { - "bsonType": "date", - "description": "过期时间" - } - } -} diff --git a/sport-erp-admin/uni_modules/uni-pagination/changelog.md b/sport-erp-admin/uni_modules/uni-pagination/changelog.md deleted file mode 100644 index 2e94adc..0000000 --- a/sport-erp-admin/uni_modules/uni-pagination/changelog.md +++ /dev/null @@ -1,27 +0,0 @@ -## 1.2.4(2022-09-19) -- 修复,未对主题色设置默认色,导致未引入 uni-scss 变量文件报错。 -- 修复,未对移动端当前页文字做主题色适配。 -## 1.2.3(2022-09-15) -- 修复未使用 uni-scss 主题色的 bug。 -## 1.2.2(2022-07-06) -- 修复 es 语言 i18n 错误 -## 1.2.1(2021-11-22) -- 修复 vue3中某些scss变量无法找到的问题 -## 1.2.0(2021-11-19) -- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) -- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-pagination](https://uniapp.dcloud.io/component/uniui/uni-pagination) -## 1.1.2(2021-10-08) -- 修复 current 、value 属性未监听,导致高亮样式失效的 bug -## 1.1.1(2021-08-20) -- 新增 支持国际化 -## 1.1.0(2021-07-30) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 1.0.7(2021-05-12) -- 新增 组件示例地址 -## 1.0.6(2021-04-12) -- 新增 PC 和 移动端适配不同的 ui -## 1.0.5(2021-02-05) -- 优化 组件引用关系,通过uni_modules引用组件 - -## 1.0.4(2021-02-05) -- 调整为uni_modules目录规范 diff --git a/sport-erp-admin/uni_modules/uni-pagination/components/uni-pagination/i18n/en.json b/sport-erp-admin/uni_modules/uni-pagination/components/uni-pagination/i18n/en.json deleted file mode 100644 index d6e2897..0000000 --- a/sport-erp-admin/uni_modules/uni-pagination/components/uni-pagination/i18n/en.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "uni-pagination.prevText": "prev", - "uni-pagination.nextText": "next", - "uni-pagination.piecePerPage": "piece/page" -} diff --git a/sport-erp-admin/uni_modules/uni-pagination/components/uni-pagination/i18n/es.json b/sport-erp-admin/uni_modules/uni-pagination/components/uni-pagination/i18n/es.json deleted file mode 100644 index 604a113..0000000 --- a/sport-erp-admin/uni_modules/uni-pagination/components/uni-pagination/i18n/es.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "uni-pagination.prevText": "anterior", - "uni-pagination.nextText": "prxima", - "uni-pagination.piecePerPage": "Artculo/Pgina" -} diff --git a/sport-erp-admin/uni_modules/uni-pagination/components/uni-pagination/i18n/fr.json b/sport-erp-admin/uni_modules/uni-pagination/components/uni-pagination/i18n/fr.json deleted file mode 100644 index a7a0c77..0000000 --- a/sport-erp-admin/uni_modules/uni-pagination/components/uni-pagination/i18n/fr.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "uni-pagination.prevText": "précédente", - "uni-pagination.nextText": "suivante", - "uni-pagination.piecePerPage": "Articles/Pages" -} diff --git a/sport-erp-admin/uni_modules/uni-pagination/components/uni-pagination/i18n/index.js b/sport-erp-admin/uni_modules/uni-pagination/components/uni-pagination/i18n/index.js deleted file mode 100644 index 2469dd0..0000000 --- a/sport-erp-admin/uni_modules/uni-pagination/components/uni-pagination/i18n/index.js +++ /dev/null @@ -1,12 +0,0 @@ -import en from './en.json' -import es from './es.json' -import fr from './fr.json' -import zhHans from './zh-Hans.json' -import zhHant from './zh-Hant.json' -export default { - en, - es, - fr, - 'zh-Hans': zhHans, - 'zh-Hant': zhHant -} diff --git a/sport-erp-admin/uni_modules/uni-pagination/components/uni-pagination/i18n/zh-Hans.json b/sport-erp-admin/uni_modules/uni-pagination/components/uni-pagination/i18n/zh-Hans.json deleted file mode 100644 index 782bbe4..0000000 --- a/sport-erp-admin/uni_modules/uni-pagination/components/uni-pagination/i18n/zh-Hans.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "uni-pagination.prevText": "上一页", - "uni-pagination.nextText": "下一页", - "uni-pagination.piecePerPage": "条/页" -} diff --git a/sport-erp-admin/uni_modules/uni-pagination/components/uni-pagination/i18n/zh-Hant.json b/sport-erp-admin/uni_modules/uni-pagination/components/uni-pagination/i18n/zh-Hant.json deleted file mode 100644 index 180fddb..0000000 --- a/sport-erp-admin/uni_modules/uni-pagination/components/uni-pagination/i18n/zh-Hant.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "uni-pagination.prevText": "上一頁", - "uni-pagination.nextText": "下一頁", - "uni-pagination.piecePerPage": "條/頁" -} diff --git a/sport-erp-admin/uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue b/sport-erp-admin/uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue deleted file mode 100644 index e7e529f..0000000 --- a/sport-erp-admin/uni_modules/uni-pagination/components/uni-pagination/uni-pagination.vue +++ /dev/null @@ -1,464 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-pagination/package.json b/sport-erp-admin/uni_modules/uni-pagination/package.json deleted file mode 100644 index 862d5ab..0000000 --- a/sport-erp-admin/uni_modules/uni-pagination/package.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "id": "uni-pagination", - "displayName": "uni-pagination 分页器", - "version": "1.2.4", - "description": "Pagination 分页器组件,用于展示页码、请求数据等。", - "keywords": [ - "uni-ui", - "uniui", - "分页器", - "页码" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, -"dcloudext": { - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", - "type": "component-vue" - }, - "uni_modules": { - "dependencies": ["uni-scss","uni-icons"], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "y" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y" - }, - "快应用": { - "华为": "u", - "联盟": "u" - }, - "Vue": { - "vue2": "y", - "vue3": "y" - } - } - } - } -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-pagination/readme.md b/sport-erp-admin/uni_modules/uni-pagination/readme.md deleted file mode 100644 index 97ea1d6..0000000 --- a/sport-erp-admin/uni_modules/uni-pagination/readme.md +++ /dev/null @@ -1,11 +0,0 @@ - - -## Pagination 分页器 -> **组件名:uni-pagination** -> 代码块: `uPagination` - - -分页器组件,用于展示页码、请求数据等。 - -### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-pagination) -#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 diff --git a/sport-erp-admin/uni_modules/uni-popup/changelog.md b/sport-erp-admin/uni_modules/uni-popup/changelog.md deleted file mode 100644 index decd775..0000000 --- a/sport-erp-admin/uni_modules/uni-popup/changelog.md +++ /dev/null @@ -1,84 +0,0 @@ -## 1.9.1(2024-04-02) -- 修复 uni-popup-dialog vue3下使用value无法进行绑定的bug(双向绑定兼容旧写法) -## 1.9.0(2024-03-28) -- 修复 uni-popup-dialog 双向绑定时初始化逻辑修正 -## 1.8.9(2024-03-20) -- 修复 uni-popup-dialog 数据输入时修正为双向绑定 -## 1.8.8(2024-02-20) -- 修复 uni-popup 在微信小程序下出现文字向上闪动的bug -## 1.8.7(2024-02-02) -- 新增 uni-popup-dialog 新增属性focus:input模式下,是否自动自动聚焦 -## 1.8.6(2024-01-30) -- 新增 uni-popup-dialog 新增属性maxLength:限制输入框字数 -## 1.8.5(2024-01-26) -- 新增 uni-popup-dialog 新增属性showClose:控制关闭按钮的显示 -## 1.8.4(2023-11-15) -- 新增 uni-popup 支持uni-app-x 注意暂时仅支持 `maskClick` `@open` `@close` -## 1.8.3(2023-04-17) -- 修复 uni-popup 重复打开时的 bug -## 1.8.2(2023-02-02) -- uni-popup-dialog 组件新增 inputType 属性 -## 1.8.1(2022-12-01) -- 修复 nvue 下 v-show 报错 -## 1.8.0(2022-11-29) -- 优化 主题样式 -## 1.7.9(2022-04-02) -- 修复 弹出层内部无法滚动的bug -## 1.7.8(2022-03-28) -- 修复 小程序中高度错误的bug -## 1.7.7(2022-03-17) -- 修复 快速调用open出现问题的Bug -## 1.7.6(2022-02-14) -- 修复 safeArea 属性不能设置为false的bug -## 1.7.5(2022-01-19) -- 修复 isMaskClick 失效的bug -## 1.7.4(2022-01-19) -- 新增 cancelText \ confirmText 属性 ,可自定义文本 -- 新增 maskBackgroundColor 属性 ,可以修改蒙版颜色 -- 优化 maskClick属性 更新为 isMaskClick ,解决微信小程序警告的问题 -## 1.7.3(2022-01-13) -- 修复 设置 safeArea 属性不生效的bug -## 1.7.2(2021-11-26) -- 优化 组件示例 -## 1.7.1(2021-11-26) -- 修复 vuedoc 文字错误 -## 1.7.0(2021-11-19) -- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) -- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-popup](https://uniapp.dcloud.io/component/uniui/uni-popup) -## 1.6.2(2021-08-24) -- 新增 支持国际化 -## 1.6.1(2021-07-30) -- 优化 vue3下事件警告的问题 -## 1.6.0(2021-07-13) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 1.5.0(2021-06-23) -- 新增 mask-click 遮罩层点击事件 -## 1.4.5(2021-06-22) -- 修复 nvue 平台中间弹出后,点击内容,再点击遮罩无法关闭的Bug -## 1.4.4(2021-06-18) -- 修复 H5平台中间弹出后,点击内容,再点击遮罩无法关闭的Bug -## 1.4.3(2021-06-08) -- 修复 错误的 watch 字段 -- 修复 safeArea 属性不生效的问题 -- 修复 点击内容,再点击遮罩无法关闭的Bug -## 1.4.2(2021-05-12) -- 新增 组件示例地址 -## 1.4.1(2021-04-29) -- 修复 组件内放置 input 、textarea 组件,无法聚焦的问题 -## 1.4.0 (2021-04-29) -- 新增 type 属性的 left\right 值,支持左右弹出 -- 新增 open(String:type) 方法参数 ,可以省略 type 属性 ,直接传入类型打开指定弹窗 -- 新增 backgroundColor 属性,可定义主窗口背景色,默认不显示背景色 -- 新增 safeArea 属性,是否适配底部安全区 -- 修复 App\h5\微信小程序底部安全区占位不对的Bug -- 修复 App 端弹出等待的Bug -- 优化 提升低配设备性能,优化动画卡顿问题 -- 优化 更简单的组件自定义方式 -## 1.2.9(2021-02-05) -- 优化 组件引用关系,通过uni_modules引用组件 -## 1.2.8(2021-02-05) -- 调整为uni_modules目录规范 -## 1.2.7(2021-02-05) -- 调整为uni_modules目录规范 -- 新增 支持 PC 端 -- 新增 uni-popup-message 、uni-popup-dialog扩展组件支持 PC 端 diff --git a/sport-erp-admin/uni_modules/uni-popup/components/uni-popup-dialog/keypress.js b/sport-erp-admin/uni_modules/uni-popup/components/uni-popup-dialog/keypress.js deleted file mode 100644 index 6ef26a2..0000000 --- a/sport-erp-admin/uni_modules/uni-popup/components/uni-popup-dialog/keypress.js +++ /dev/null @@ -1,45 +0,0 @@ -// #ifdef H5 -export default { - name: 'Keypress', - props: { - disable: { - type: Boolean, - default: false - } - }, - mounted () { - const keyNames = { - esc: ['Esc', 'Escape'], - tab: 'Tab', - enter: 'Enter', - space: [' ', 'Spacebar'], - up: ['Up', 'ArrowUp'], - left: ['Left', 'ArrowLeft'], - right: ['Right', 'ArrowRight'], - down: ['Down', 'ArrowDown'], - delete: ['Backspace', 'Delete', 'Del'] - } - const listener = ($event) => { - if (this.disable) { - return - } - const keyName = Object.keys(keyNames).find(key => { - const keyName = $event.key - const value = keyNames[key] - return value === keyName || (Array.isArray(value) && value.includes(keyName)) - }) - if (keyName) { - // 避免和其他按键事件冲突 - setTimeout(() => { - this.$emit(keyName, {}) - }, 0) - } - } - document.addEventListener('keyup', listener) - this.$once('hook:beforeDestroy', () => { - document.removeEventListener('keyup', listener) - }) - }, - render: () => {} -} -// #endif diff --git a/sport-erp-admin/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue b/sport-erp-admin/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue deleted file mode 100644 index 08707d4..0000000 --- a/sport-erp-admin/uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue +++ /dev/null @@ -1,316 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-popup/components/uni-popup-message/uni-popup-message.vue b/sport-erp-admin/uni_modules/uni-popup/components/uni-popup-message/uni-popup-message.vue deleted file mode 100644 index 91370a8..0000000 --- a/sport-erp-admin/uni_modules/uni-popup/components/uni-popup-message/uni-popup-message.vue +++ /dev/null @@ -1,143 +0,0 @@ - - - - diff --git a/sport-erp-admin/uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue b/sport-erp-admin/uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue deleted file mode 100644 index f7e667c..0000000 --- a/sport-erp-admin/uni_modules/uni-popup/components/uni-popup-share/uni-popup-share.vue +++ /dev/null @@ -1,187 +0,0 @@ - - - - diff --git a/sport-erp-admin/uni_modules/uni-popup/components/uni-popup/i18n/en.json b/sport-erp-admin/uni_modules/uni-popup/components/uni-popup/i18n/en.json deleted file mode 100644 index 7f1bd06..0000000 --- a/sport-erp-admin/uni_modules/uni-popup/components/uni-popup/i18n/en.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "uni-popup.cancel": "cancel", - "uni-popup.ok": "ok", - "uni-popup.placeholder": "pleace enter", - "uni-popup.title": "Hint", - "uni-popup.shareTitle": "Share to" -} diff --git a/sport-erp-admin/uni_modules/uni-popup/components/uni-popup/i18n/index.js b/sport-erp-admin/uni_modules/uni-popup/components/uni-popup/i18n/index.js deleted file mode 100644 index de7509c..0000000 --- a/sport-erp-admin/uni_modules/uni-popup/components/uni-popup/i18n/index.js +++ /dev/null @@ -1,8 +0,0 @@ -import en from './en.json' -import zhHans from './zh-Hans.json' -import zhHant from './zh-Hant.json' -export default { - en, - 'zh-Hans': zhHans, - 'zh-Hant': zhHant -} diff --git a/sport-erp-admin/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hans.json b/sport-erp-admin/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hans.json deleted file mode 100644 index 5e3003c..0000000 --- a/sport-erp-admin/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hans.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "uni-popup.cancel": "取消", - "uni-popup.ok": "确定", - "uni-popup.placeholder": "请输入", - "uni-popup.title": "提示", - "uni-popup.shareTitle": "分享到" -} diff --git a/sport-erp-admin/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hant.json b/sport-erp-admin/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hant.json deleted file mode 100644 index 13e39eb..0000000 --- a/sport-erp-admin/uni_modules/uni-popup/components/uni-popup/i18n/zh-Hant.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "uni-popup.cancel": "取消", - "uni-popup.ok": "確定", - "uni-popup.placeholder": "請輸入", - "uni-popup.title": "提示", - "uni-popup.shareTitle": "分享到" -} diff --git a/sport-erp-admin/uni_modules/uni-popup/components/uni-popup/keypress.js b/sport-erp-admin/uni_modules/uni-popup/components/uni-popup/keypress.js deleted file mode 100644 index 62dda46..0000000 --- a/sport-erp-admin/uni_modules/uni-popup/components/uni-popup/keypress.js +++ /dev/null @@ -1,45 +0,0 @@ -// #ifdef H5 -export default { - name: 'Keypress', - props: { - disable: { - type: Boolean, - default: false - } - }, - mounted () { - const keyNames = { - esc: ['Esc', 'Escape'], - tab: 'Tab', - enter: 'Enter', - space: [' ', 'Spacebar'], - up: ['Up', 'ArrowUp'], - left: ['Left', 'ArrowLeft'], - right: ['Right', 'ArrowRight'], - down: ['Down', 'ArrowDown'], - delete: ['Backspace', 'Delete', 'Del'] - } - const listener = ($event) => { - if (this.disable) { - return - } - const keyName = Object.keys(keyNames).find(key => { - const keyName = $event.key - const value = keyNames[key] - return value === keyName || (Array.isArray(value) && value.includes(keyName)) - }) - if (keyName) { - // 避免和其他按键事件冲突 - setTimeout(() => { - this.$emit(keyName, {}) - }, 0) - } - } - document.addEventListener('keyup', listener) - // this.$once('hook:beforeDestroy', () => { - // document.removeEventListener('keyup', listener) - // }) - }, - render: () => {} -} -// #endif diff --git a/sport-erp-admin/uni_modules/uni-popup/components/uni-popup/message.js b/sport-erp-admin/uni_modules/uni-popup/components/uni-popup/message.js deleted file mode 100644 index 0ff9a02..0000000 --- a/sport-erp-admin/uni_modules/uni-popup/components/uni-popup/message.js +++ /dev/null @@ -1,22 +0,0 @@ -export default { - created() { - if (this.type === 'message') { - // 不显示遮罩 - this.maskShow = false - // 获取子组件对象 - this.childrenMsg = null - } - }, - methods: { - customOpen() { - if (this.childrenMsg) { - this.childrenMsg.open() - } - }, - customClose() { - if (this.childrenMsg) { - this.childrenMsg.close() - } - } - } -} diff --git a/sport-erp-admin/uni_modules/uni-popup/components/uni-popup/popup.js b/sport-erp-admin/uni_modules/uni-popup/components/uni-popup/popup.js deleted file mode 100644 index c4e5781..0000000 --- a/sport-erp-admin/uni_modules/uni-popup/components/uni-popup/popup.js +++ /dev/null @@ -1,26 +0,0 @@ - -export default { - data() { - return { - - } - }, - created(){ - this.popup = this.getParent() - }, - methods:{ - /** - * 获取父元素实例 - */ - getParent(name = 'uniPopup') { - let parent = this.$parent; - let parentName = parent.$options.name; - while (parentName !== name) { - parent = parent.$parent; - if (!parent) return false - parentName = parent.$options.name; - } - return parent; - }, - } -} diff --git a/sport-erp-admin/uni_modules/uni-popup/components/uni-popup/share.js b/sport-erp-admin/uni_modules/uni-popup/components/uni-popup/share.js deleted file mode 100644 index 462bb83..0000000 --- a/sport-erp-admin/uni_modules/uni-popup/components/uni-popup/share.js +++ /dev/null @@ -1,16 +0,0 @@ -export default { - created() { - if (this.type === 'share') { - // 关闭点击 - this.mkclick = false - } - }, - methods: { - customOpen() { - console.log('share 打开了'); - }, - customClose() { - console.log('share 关闭了'); - } - } -} diff --git a/sport-erp-admin/uni_modules/uni-popup/components/uni-popup/uni-popup.uvue b/sport-erp-admin/uni_modules/uni-popup/components/uni-popup/uni-popup.uvue deleted file mode 100644 index 5eb8d5b..0000000 --- a/sport-erp-admin/uni_modules/uni-popup/components/uni-popup/uni-popup.uvue +++ /dev/null @@ -1,90 +0,0 @@ - - - - - \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-popup/components/uni-popup/uni-popup.vue b/sport-erp-admin/uni_modules/uni-popup/components/uni-popup/uni-popup.vue deleted file mode 100644 index 8349e99..0000000 --- a/sport-erp-admin/uni_modules/uni-popup/components/uni-popup/uni-popup.vue +++ /dev/null @@ -1,503 +0,0 @@ - - - - diff --git a/sport-erp-admin/uni_modules/uni-popup/package.json b/sport-erp-admin/uni_modules/uni-popup/package.json deleted file mode 100644 index 3cfa384..0000000 --- a/sport-erp-admin/uni_modules/uni-popup/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "id": "uni-popup", - "displayName": "uni-popup 弹出层", - "version": "1.9.1", - "description": " Popup 组件,提供常用的弹层", - "keywords": [ - "uni-ui", - "弹出层", - "弹窗", - "popup", - "弹框" - ], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, - "dcloudext": { - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", - "type": "component-vue" - }, - "uni_modules": { - "dependencies": [ - "uni-scss", - "uni-transition" - ], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y", - "alipay": "n" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "y" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y" - }, - "快应用": { - "华为": "u", - "联盟": "u" - }, - "Vue": { - "vue2": "y", - "vue3": "y" - } - } - } - } -} diff --git a/sport-erp-admin/uni_modules/uni-popup/readme.md b/sport-erp-admin/uni_modules/uni-popup/readme.md deleted file mode 100644 index fdad4b3..0000000 --- a/sport-erp-admin/uni_modules/uni-popup/readme.md +++ /dev/null @@ -1,17 +0,0 @@ - - -## Popup 弹出层 -> **组件名:uni-popup** -> 代码块: `uPopup` -> 关联组件:`uni-transition` - - -弹出层组件,在应用中弹出一个消息提示窗口、提示框等 - -### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-popup) -#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 - - - - - diff --git a/sport-erp-admin/uni_modules/uni-scss/changelog.md b/sport-erp-admin/uni_modules/uni-scss/changelog.md deleted file mode 100644 index b863bb0..0000000 --- a/sport-erp-admin/uni_modules/uni-scss/changelog.md +++ /dev/null @@ -1,8 +0,0 @@ -## 1.0.3(2022-01-21) -- 优化 组件示例 -## 1.0.2(2021-11-22) -- 修复 / 符号在 vue 不同版本兼容问题引起的报错问题 -## 1.0.1(2021-11-22) -- 修复 vue3中scss语法兼容问题 -## 1.0.0(2021-11-18) -- init diff --git a/sport-erp-admin/uni_modules/uni-scss/index.scss b/sport-erp-admin/uni_modules/uni-scss/index.scss deleted file mode 100644 index 1744a5f..0000000 --- a/sport-erp-admin/uni_modules/uni-scss/index.scss +++ /dev/null @@ -1 +0,0 @@ -@import './styles/index.scss'; diff --git a/sport-erp-admin/uni_modules/uni-scss/package.json b/sport-erp-admin/uni_modules/uni-scss/package.json deleted file mode 100644 index 7cc0ccb..0000000 --- a/sport-erp-admin/uni_modules/uni-scss/package.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "id": "uni-scss", - "displayName": "uni-scss 辅助样式", - "version": "1.0.3", - "description": "uni-sass是uni-ui提供的一套全局样式 ,通过一些简单的类名和sass变量,实现简单的页面布局操作,比如颜色、边距、圆角等。", - "keywords": [ - "uni-scss", - "uni-ui", - "辅助样式" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "^3.1.0" - }, - "dcloudext": { - "category": [ - "JS SDK", - "通用 SDK" - ], - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" - }, - "uni_modules": { - "dependencies": [], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "u" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y" - }, - "快应用": { - "华为": "n", - "联盟": "n" - }, - "Vue": { - "vue2": "y", - "vue3": "y" - } - } - } - } -} diff --git a/sport-erp-admin/uni_modules/uni-scss/readme.md b/sport-erp-admin/uni_modules/uni-scss/readme.md deleted file mode 100644 index b7d1c25..0000000 --- a/sport-erp-admin/uni_modules/uni-scss/readme.md +++ /dev/null @@ -1,4 +0,0 @@ -`uni-sass` 是 `uni-ui`提供的一套全局样式 ,通过一些简单的类名和`sass`变量,实现简单的页面布局操作,比如颜色、边距、圆角等。 - -### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-sass) -#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-scss/styles/index.scss b/sport-erp-admin/uni_modules/uni-scss/styles/index.scss deleted file mode 100644 index ffac4fe..0000000 --- a/sport-erp-admin/uni_modules/uni-scss/styles/index.scss +++ /dev/null @@ -1,7 +0,0 @@ -@import './setting/_variables.scss'; -@import './setting/_border.scss'; -@import './setting/_color.scss'; -@import './setting/_space.scss'; -@import './setting/_radius.scss'; -@import './setting/_text.scss'; -@import './setting/_styles.scss'; diff --git a/sport-erp-admin/uni_modules/uni-scss/styles/setting/_border.scss b/sport-erp-admin/uni_modules/uni-scss/styles/setting/_border.scss deleted file mode 100644 index 12a11c3..0000000 --- a/sport-erp-admin/uni_modules/uni-scss/styles/setting/_border.scss +++ /dev/null @@ -1,3 +0,0 @@ -.uni-border { - border: 1px $uni-border-1 solid; -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-scss/styles/setting/_color.scss b/sport-erp-admin/uni_modules/uni-scss/styles/setting/_color.scss deleted file mode 100644 index 1ededd9..0000000 --- a/sport-erp-admin/uni_modules/uni-scss/styles/setting/_color.scss +++ /dev/null @@ -1,66 +0,0 @@ - -// TODO 暂时不需要 class ,需要用户使用变量实现 ,如果使用类名其实并不推荐 -// @mixin get-styles($k,$c) { -// @if $k == size or $k == weight{ -// font-#{$k}:#{$c} -// }@else{ -// #{$k}:#{$c} -// } -// } -$uni-ui-color:( - // 主色 - primary: $uni-primary, - primary-disable: $uni-primary-disable, - primary-light: $uni-primary-light, - // 辅助色 - success: $uni-success, - success-disable: $uni-success-disable, - success-light: $uni-success-light, - warning: $uni-warning, - warning-disable: $uni-warning-disable, - warning-light: $uni-warning-light, - error: $uni-error, - error-disable: $uni-error-disable, - error-light: $uni-error-light, - info: $uni-info, - info-disable: $uni-info-disable, - info-light: $uni-info-light, - // 中性色 - main-color: $uni-main-color, - base-color: $uni-base-color, - secondary-color: $uni-secondary-color, - extra-color: $uni-extra-color, - // 背景色 - bg-color: $uni-bg-color, - // 边框颜色 - border-1: $uni-border-1, - border-2: $uni-border-2, - border-3: $uni-border-3, - border-4: $uni-border-4, - // 黑色 - black:$uni-black, - // 白色 - white:$uni-white, - // 透明 - transparent:$uni-transparent -) !default; -@each $key, $child in $uni-ui-color { - .uni-#{"" + $key} { - color: $child; - } - .uni-#{"" + $key}-bg { - background-color: $child; - } -} -.uni-shadow-sm { - box-shadow: $uni-shadow-sm; -} -.uni-shadow-base { - box-shadow: $uni-shadow-base; -} -.uni-shadow-lg { - box-shadow: $uni-shadow-lg; -} -.uni-mask { - background-color:$uni-mask; -} diff --git a/sport-erp-admin/uni_modules/uni-scss/styles/setting/_radius.scss b/sport-erp-admin/uni_modules/uni-scss/styles/setting/_radius.scss deleted file mode 100644 index 9a0428b..0000000 --- a/sport-erp-admin/uni_modules/uni-scss/styles/setting/_radius.scss +++ /dev/null @@ -1,55 +0,0 @@ -@mixin radius($r,$d:null ,$important: false){ - $radius-value:map-get($uni-radius, $r) if($important, !important, null); - // Key exists within the $uni-radius variable - @if (map-has-key($uni-radius, $r) and $d){ - @if $d == t { - border-top-left-radius:$radius-value; - border-top-right-radius:$radius-value; - }@else if $d == r { - border-top-right-radius:$radius-value; - border-bottom-right-radius:$radius-value; - }@else if $d == b { - border-bottom-left-radius:$radius-value; - border-bottom-right-radius:$radius-value; - }@else if $d == l { - border-top-left-radius:$radius-value; - border-bottom-left-radius:$radius-value; - }@else if $d == tl { - border-top-left-radius:$radius-value; - }@else if $d == tr { - border-top-right-radius:$radius-value; - }@else if $d == br { - border-bottom-right-radius:$radius-value; - }@else if $d == bl { - border-bottom-left-radius:$radius-value; - } - }@else{ - border-radius:$radius-value; - } -} - -@each $key, $child in $uni-radius { - @if($key){ - .uni-radius-#{"" + $key} { - @include radius($key) - } - }@else{ - .uni-radius { - @include radius($key) - } - } -} - -@each $direction in t, r, b, l,tl, tr, br, bl { - @each $key, $child in $uni-radius { - @if($key){ - .uni-radius-#{"" + $direction}-#{"" + $key} { - @include radius($key,$direction,false) - } - }@else{ - .uni-radius-#{$direction} { - @include radius($key,$direction,false) - } - } - } -} diff --git a/sport-erp-admin/uni_modules/uni-scss/styles/setting/_space.scss b/sport-erp-admin/uni_modules/uni-scss/styles/setting/_space.scss deleted file mode 100644 index 3c89528..0000000 --- a/sport-erp-admin/uni_modules/uni-scss/styles/setting/_space.scss +++ /dev/null @@ -1,56 +0,0 @@ - -@mixin fn($space,$direction,$size,$n) { - @if $n { - #{$space}-#{$direction}: #{$size*$uni-space-root}px - } @else { - #{$space}-#{$direction}: #{-$size*$uni-space-root}px - } -} -@mixin get-styles($direction,$i,$space,$n){ - @if $direction == t { - @include fn($space, top,$i,$n); - } - @if $direction == r { - @include fn($space, right,$i,$n); - } - @if $direction == b { - @include fn($space, bottom,$i,$n); - } - @if $direction == l { - @include fn($space, left,$i,$n); - } - @if $direction == x { - @include fn($space, left,$i,$n); - @include fn($space, right,$i,$n); - } - @if $direction == y { - @include fn($space, top,$i,$n); - @include fn($space, bottom,$i,$n); - } - @if $direction == a { - @if $n { - #{$space}:#{$i*$uni-space-root}px; - } @else { - #{$space}:#{-$i*$uni-space-root}px; - } - } -} - -@each $orientation in m,p { - $space: margin; - @if $orientation == m { - $space: margin; - } @else { - $space: padding; - } - @for $i from 0 through 16 { - @each $direction in t, r, b, l, x, y, a { - .uni-#{$orientation}#{$direction}-#{$i} { - @include get-styles($direction,$i,$space,true); - } - .uni-#{$orientation}#{$direction}-n#{$i} { - @include get-styles($direction,$i,$space,false); - } - } - } -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-scss/styles/setting/_styles.scss b/sport-erp-admin/uni_modules/uni-scss/styles/setting/_styles.scss deleted file mode 100644 index 689afec..0000000 --- a/sport-erp-admin/uni_modules/uni-scss/styles/setting/_styles.scss +++ /dev/null @@ -1,167 +0,0 @@ -/* #ifndef APP-NVUE */ - -$-color-white:#fff; -$-color-black:#000; -@mixin base-style($color) { - color: #fff; - background-color: $color; - border-color: mix($-color-black, $color, 8%); - &:not([hover-class]):active { - background: mix($-color-black, $color, 10%); - border-color: mix($-color-black, $color, 20%); - color: $-color-white; - outline: none; - } -} -@mixin is-color($color) { - @include base-style($color); - &[loading] { - @include base-style($color); - &::before { - margin-right:5px; - } - } - &[disabled] { - &, - &[loading], - &:not([hover-class]):active { - color: $-color-white; - border-color: mix(darken($color,10%), $-color-white); - background-color: mix($color, $-color-white); - } - } - -} -@mixin base-plain-style($color) { - color:$color; - background-color: mix($-color-white, $color, 90%); - border-color: mix($-color-white, $color, 70%); - &:not([hover-class]):active { - background: mix($-color-white, $color, 80%); - color: $color; - outline: none; - border-color: mix($-color-white, $color, 50%); - } -} -@mixin is-plain($color){ - &[plain] { - @include base-plain-style($color); - &[loading] { - @include base-plain-style($color); - &::before { - margin-right:5px; - } - } - &[disabled] { - &, - &:active { - color: mix($-color-white, $color, 40%); - background-color: mix($-color-white, $color, 90%); - border-color: mix($-color-white, $color, 80%); - } - } - } -} - - -.uni-btn { - margin: 5px; - color: #393939; - border:1px solid #ccc; - font-size: 16px; - font-weight: 200; - background-color: #F9F9F9; - // TODO 暂时处理边框隐藏一边的问题 - overflow: visible; - &::after{ - border: none; - } - - &:not([type]),&[type=default] { - color: #999; - &[loading] { - background: none; - &::before { - margin-right:5px; - } - } - - - - &[disabled]{ - color: mix($-color-white, #999, 60%); - &, - &[loading], - &:active { - color: mix($-color-white, #999, 60%); - background-color: mix($-color-white,$-color-black , 98%); - border-color: mix($-color-white, #999, 85%); - } - } - - &[plain] { - color: #999; - background: none; - border-color: $uni-border-1; - &:not([hover-class]):active { - background: none; - color: mix($-color-white, $-color-black, 80%); - border-color: mix($-color-white, $-color-black, 90%); - outline: none; - } - &[disabled]{ - &, - &[loading], - &:active { - background: none; - color: mix($-color-white, #999, 60%); - border-color: mix($-color-white, #999, 85%); - } - } - } - } - - &:not([hover-class]):active { - color: mix($-color-white, $-color-black, 50%); - } - - &[size=mini] { - font-size: 16px; - font-weight: 200; - border-radius: 8px; - } - - - - &.uni-btn-small { - font-size: 14px; - } - &.uni-btn-mini { - font-size: 12px; - } - - &.uni-btn-radius { - border-radius: 999px; - } - &[type=primary] { - @include is-color($uni-primary); - @include is-plain($uni-primary) - } - &[type=success] { - @include is-color($uni-success); - @include is-plain($uni-success) - } - &[type=error] { - @include is-color($uni-error); - @include is-plain($uni-error) - } - &[type=warning] { - @include is-color($uni-warning); - @include is-plain($uni-warning) - } - &[type=info] { - @include is-color($uni-info); - @include is-plain($uni-info) - } -} -/* #endif */ diff --git a/sport-erp-admin/uni_modules/uni-scss/styles/setting/_text.scss b/sport-erp-admin/uni_modules/uni-scss/styles/setting/_text.scss deleted file mode 100644 index a34d08f..0000000 --- a/sport-erp-admin/uni_modules/uni-scss/styles/setting/_text.scss +++ /dev/null @@ -1,24 +0,0 @@ -@mixin get-styles($k,$c) { - @if $k == size or $k == weight{ - font-#{$k}:#{$c} - }@else{ - #{$k}:#{$c} - } -} - -@each $key, $child in $uni-headings { - /* #ifndef APP-NVUE */ - .uni-#{$key} { - @each $k, $c in $child { - @include get-styles($k,$c) - } - } - /* #endif */ - /* #ifdef APP-NVUE */ - .container .uni-#{$key} { - @each $k, $c in $child { - @include get-styles($k,$c) - } - } - /* #endif */ -} diff --git a/sport-erp-admin/uni_modules/uni-scss/styles/setting/_variables.scss b/sport-erp-admin/uni_modules/uni-scss/styles/setting/_variables.scss deleted file mode 100644 index 557d3d7..0000000 --- a/sport-erp-admin/uni_modules/uni-scss/styles/setting/_variables.scss +++ /dev/null @@ -1,146 +0,0 @@ -// @use "sass:math"; -@import '../tools/functions.scss'; -// 间距基础倍数 -$uni-space-root: 2 !default; -// 边框半径默认值 -$uni-radius-root:5px !default; -$uni-radius: () !default; -// 边框半径断点 -$uni-radius: map-deep-merge( - ( - 0: 0, - // TODO 当前版本暂时不支持 sm 属性 - // 'sm': math.div($uni-radius-root, 2), - null: $uni-radius-root, - 'lg': $uni-radius-root * 2, - 'xl': $uni-radius-root * 6, - 'pill': 9999px, - 'circle': 50% - ), - $uni-radius -); -// 字体家族 -$body-font-family: 'Roboto', sans-serif !default; -// 文本 -$heading-font-family: $body-font-family !default; -$uni-headings: () !default; -$letterSpacing: -0.01562em; -$uni-headings: map-deep-merge( - ( - 'h1': ( - size: 32px, - weight: 300, - line-height: 50px, - // letter-spacing:-0.01562em - ), - 'h2': ( - size: 28px, - weight: 300, - line-height: 40px, - // letter-spacing: -0.00833em - ), - 'h3': ( - size: 24px, - weight: 400, - line-height: 32px, - // letter-spacing: normal - ), - 'h4': ( - size: 20px, - weight: 400, - line-height: 30px, - // letter-spacing: 0.00735em - ), - 'h5': ( - size: 16px, - weight: 400, - line-height: 24px, - // letter-spacing: normal - ), - 'h6': ( - size: 14px, - weight: 500, - line-height: 18px, - // letter-spacing: 0.0125em - ), - 'subtitle': ( - size: 12px, - weight: 400, - line-height: 20px, - // letter-spacing: 0.00937em - ), - 'body': ( - font-size: 14px, - font-weight: 400, - line-height: 22px, - // letter-spacing: 0.03125em - ), - 'caption': ( - 'size': 12px, - 'weight': 400, - 'line-height': 20px, - // 'letter-spacing': 0.03333em, - // 'text-transform': false - ) - ), - $uni-headings -); - - - -// 主色 -$uni-primary: #2979ff !default; -$uni-primary-disable:lighten($uni-primary,20%) !default; -$uni-primary-light: lighten($uni-primary,25%) !default; - -// 辅助色 -// 除了主色外的场景色,需要在不同的场景中使用(例如危险色表示危险的操作)。 -$uni-success: #18bc37 !default; -$uni-success-disable:lighten($uni-success,20%) !default; -$uni-success-light: lighten($uni-success,25%) !default; - -$uni-warning: #f3a73f !default; -$uni-warning-disable:lighten($uni-warning,20%) !default; -$uni-warning-light: lighten($uni-warning,25%) !default; - -$uni-error: #e43d33 !default; -$uni-error-disable:lighten($uni-error,20%) !default; -$uni-error-light: lighten($uni-error,25%) !default; - -$uni-info: #8f939c !default; -$uni-info-disable:lighten($uni-info,20%) !default; -$uni-info-light: lighten($uni-info,25%) !default; - -// 中性色 -// 中性色用于文本、背景和边框颜色。通过运用不同的中性色,来表现层次结构。 -$uni-main-color: #3a3a3a !default; // 主要文字 -$uni-base-color: #6a6a6a !default; // 常规文字 -$uni-secondary-color: #909399 !default; // 次要文字 -$uni-extra-color: #c7c7c7 !default; // 辅助说明 - -// 边框颜色 -$uni-border-1: #F0F0F0 !default; -$uni-border-2: #EDEDED !default; -$uni-border-3: #DCDCDC !default; -$uni-border-4: #B9B9B9 !default; - -// 常规色 -$uni-black: #000000 !default; -$uni-white: #ffffff !default; -$uni-transparent: rgba($color: #000000, $alpha: 0) !default; - -// 背景色 -$uni-bg-color: #f7f7f7 !default; - -/* 水平间距 */ -$uni-spacing-sm: 8px !default; -$uni-spacing-base: 15px !default; -$uni-spacing-lg: 30px !default; - -// 阴影 -$uni-shadow-sm:0 0 5px rgba($color: #d8d8d8, $alpha: 0.5) !default; -$uni-shadow-base:0 1px 8px 1px rgba($color: #a5a5a5, $alpha: 0.2) !default; -$uni-shadow-lg:0px 1px 10px 2px rgba($color: #a5a4a4, $alpha: 0.5) !default; - -// 蒙版 -$uni-mask: rgba($color: #000000, $alpha: 0.4) !default; diff --git a/sport-erp-admin/uni_modules/uni-scss/styles/tools/functions.scss b/sport-erp-admin/uni_modules/uni-scss/styles/tools/functions.scss deleted file mode 100644 index ac6f63e..0000000 --- a/sport-erp-admin/uni_modules/uni-scss/styles/tools/functions.scss +++ /dev/null @@ -1,19 +0,0 @@ -// 合并 map -@function map-deep-merge($parent-map, $child-map){ - $result: $parent-map; - @each $key, $child in $child-map { - $parent-has-key: map-has-key($result, $key); - $parent-value: map-get($result, $key); - $parent-type: type-of($parent-value); - $child-type: type-of($child); - $parent-is-map: $parent-type == map; - $child-is-map: $child-type == map; - - @if (not $parent-has-key) or ($parent-type != $child-type) or (not ($parent-is-map and $child-is-map)){ - $result: map-merge($result, ( $key: $child )); - }@else { - $result: map-merge($result, ( $key: map-deep-merge($parent-value, $child) )); - } - } - @return $result; -}; diff --git a/sport-erp-admin/uni_modules/uni-scss/theme.scss b/sport-erp-admin/uni_modules/uni-scss/theme.scss deleted file mode 100644 index 80ee62f..0000000 --- a/sport-erp-admin/uni_modules/uni-scss/theme.scss +++ /dev/null @@ -1,31 +0,0 @@ -// 间距基础倍数 -$uni-space-root: 2; -// 边框半径默认值 -$uni-radius-root:5px; -// 主色 -$uni-primary: #2979ff; -// 辅助色 -$uni-success: #4cd964; -// 警告色 -$uni-warning: #f0ad4e; -// 错误色 -$uni-error: #dd524d; -// 描述色 -$uni-info: #909399; -// 中性色 -$uni-main-color: #303133; -$uni-base-color: #606266; -$uni-secondary-color: #909399; -$uni-extra-color: #C0C4CC; -// 背景色 -$uni-bg-color: #f5f5f5; -// 边框颜色 -$uni-border-1: #DCDFE6; -$uni-border-2: #E4E7ED; -$uni-border-3: #EBEEF5; -$uni-border-4: #F2F6FC; - -// 常规色 -$uni-black: #000000; -$uni-white: #ffffff; -$uni-transparent: rgba($color: #000000, $alpha: 0); diff --git a/sport-erp-admin/uni_modules/uni-scss/variables.scss b/sport-erp-admin/uni_modules/uni-scss/variables.scss deleted file mode 100644 index 1c062d4..0000000 --- a/sport-erp-admin/uni_modules/uni-scss/variables.scss +++ /dev/null @@ -1,62 +0,0 @@ -@import './styles/setting/_variables.scss'; -// 间距基础倍数 -$uni-space-root: 2; -// 边框半径默认值 -$uni-radius-root:5px; - -// 主色 -$uni-primary: #2979ff; -$uni-primary-disable:mix(#fff,$uni-primary,50%); -$uni-primary-light: mix(#fff,$uni-primary,80%); - -// 辅助色 -// 除了主色外的场景色,需要在不同的场景中使用(例如危险色表示危险的操作)。 -$uni-success: #18bc37; -$uni-success-disable:mix(#fff,$uni-success,50%); -$uni-success-light: mix(#fff,$uni-success,80%); - -$uni-warning: #f3a73f; -$uni-warning-disable:mix(#fff,$uni-warning,50%); -$uni-warning-light: mix(#fff,$uni-warning,80%); - -$uni-error: #e43d33; -$uni-error-disable:mix(#fff,$uni-error,50%); -$uni-error-light: mix(#fff,$uni-error,80%); - -$uni-info: #8f939c; -$uni-info-disable:mix(#fff,$uni-info,50%); -$uni-info-light: mix(#fff,$uni-info,80%); - -// 中性色 -// 中性色用于文本、背景和边框颜色。通过运用不同的中性色,来表现层次结构。 -$uni-main-color: #3a3a3a; // 主要文字 -$uni-base-color: #6a6a6a; // 常规文字 -$uni-secondary-color: #909399; // 次要文字 -$uni-extra-color: #c7c7c7; // 辅助说明 - -// 边框颜色 -$uni-border-1: #F0F0F0; -$uni-border-2: #EDEDED; -$uni-border-3: #DCDCDC; -$uni-border-4: #B9B9B9; - -// 常规色 -$uni-black: #000000; -$uni-white: #ffffff; -$uni-transparent: rgba($color: #000000, $alpha: 0); - -// 背景色 -$uni-bg-color: #f7f7f7; - -/* 水平间距 */ -$uni-spacing-sm: 8px; -$uni-spacing-base: 15px; -$uni-spacing-lg: 30px; - -// 阴影 -$uni-shadow-sm:0 0 5px rgba($color: #d8d8d8, $alpha: 0.5); -$uni-shadow-base:0 1px 8px 1px rgba($color: #a5a5a5, $alpha: 0.2); -$uni-shadow-lg:0px 1px 10px 2px rgba($color: #a5a4a4, $alpha: 0.5); - -// 蒙版 -$uni-mask: rgba($color: #000000, $alpha: 0.4); diff --git a/sport-erp-admin/uni_modules/uni-segmented-control/changelog.md b/sport-erp-admin/uni_modules/uni-segmented-control/changelog.md deleted file mode 100644 index 02d0c8a..0000000 --- a/sport-erp-admin/uni_modules/uni-segmented-control/changelog.md +++ /dev/null @@ -1,15 +0,0 @@ -## 1.2.3(2024-04-02) -- 修复 修复在微信小程序下inactiveColor失效bug -## 1.2.2(2024-03-28) -- 修复 在vue2下:style动态绑定导致编译失败的bug -## 1.2.1(2024-03-20) -- 新增 inActiveColor属性,可供配置未激活时的颜色 -## 1.2.0(2021-11-19) -- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) -- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-segmented-control](https://uniapp.dcloud.io/component/uniui/uni-segmented-control) -## 1.1.0(2021-07-30) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 1.0.5(2021-05-12) -- 新增 项目示例地址 -## 1.0.4(2021-02-05) -- 调整为uni_modules目录规范 diff --git a/sport-erp-admin/uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.vue b/sport-erp-admin/uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.vue deleted file mode 100644 index a69366a..0000000 --- a/sport-erp-admin/uni_modules/uni-segmented-control/components/uni-segmented-control/uni-segmented-control.vue +++ /dev/null @@ -1,146 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-segmented-control/package.json b/sport-erp-admin/uni_modules/uni-segmented-control/package.json deleted file mode 100644 index 49f9eff..0000000 --- a/sport-erp-admin/uni_modules/uni-segmented-control/package.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "id": "uni-segmented-control", - "displayName": "uni-segmented-control 分段器", - "version": "1.2.3", - "description": "分段器由至少 2 个分段控件组成,用作不同视图的显示", - "keywords": [ - "uni-ui", - "uniui", - "分段器", - "segement", - "顶部选择" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, -"dcloudext": { - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", - "type": "component-vue" - }, - "uni_modules": { - "dependencies": ["uni-scss"], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y", - "alipay": "n" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "y" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y" - }, - "快应用": { - "华为": "u", - "联盟": "u" - }, - "Vue": { - "vue2": "y", - "vue3": "y" - } - } - } - } -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-segmented-control/readme.md b/sport-erp-admin/uni_modules/uni-segmented-control/readme.md deleted file mode 100644 index 3527b03..0000000 --- a/sport-erp-admin/uni_modules/uni-segmented-control/readme.md +++ /dev/null @@ -1,13 +0,0 @@ - - -## SegmentedControl 分段器 -> **组件名:uni-segmented-control** -> 代码块: `uSegmentedControl` - - -用作不同视图的显示 - -### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-segmented-control) -#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 - - diff --git a/sport-erp-admin/uni_modules/uni-sign-in/changelog.md b/sport-erp-admin/uni_modules/uni-sign-in/changelog.md deleted file mode 100644 index 5a0c9bb..0000000 --- a/sport-erp-admin/uni_modules/uni-sign-in/changelog.md +++ /dev/null @@ -1,16 +0,0 @@ -## 1.0.7(2024-04-30) -更新 组件uni-sign-in的style添加scoped -## 1.0.6(2024-03-26) -支持支付宝小程序云 -## 1.0.5(2021-12-09) -修复插件没自动安装依赖的`uni-popup`和`uni-icons`组件的问题 -## 1.0.4(2021-11-29) -修复在某些情况下,签到不连续7天,也获得60积分的问题 -## 1.0.3(2021-11-20) -新增支持看激励视频广告签到 -## 1.0.2(2021-08-25) -修复时区问题 -## 1.0.1(2021-08-23) -调整签到逻辑,支持查出积分的收入支出历史记录 -## 1.0.0(2021-08-05) -1.0.0版本发布 diff --git a/sport-erp-admin/uni_modules/uni-sign-in/components/uni-sign-in/uni-sign-in.vue b/sport-erp-admin/uni_modules/uni-sign-in/components/uni-sign-in/uni-sign-in.vue deleted file mode 100644 index ffda7a5..0000000 --- a/sport-erp-admin/uni_modules/uni-sign-in/components/uni-sign-in/uni-sign-in.vue +++ /dev/null @@ -1,310 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-sign-in/package.json b/sport-erp-admin/uni_modules/uni-sign-in/package.json deleted file mode 100644 index f55cdc0..0000000 --- a/sport-erp-admin/uni_modules/uni-sign-in/package.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "id": "uni-sign-in", - "displayName": "uni-starter签到插件 提升留存,激励视频变现", - "version": "1.0.7", - "description": "培养用户习惯,提升用户粘性,支持广告流量变现的签到得积分功能", - "keywords": [ - "uni-sign-in", - "签到", - "营销", - "变现", - "积分" -], - "repository": "", - "engines": { - "HBuilderX": "^3.1.0" - }, -"dcloudext": { - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "", - "type": "unicloud-template-page" - }, - "uni_modules": { - "dependencies": ["uni-popup","uni-icons"], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y", - "alipay": "y" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "u" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "u", - "微信浏览器(Android)": "u", - "QQ浏览器(Android)": "u" - }, - "H5-pc": { - "Chrome": "y", - "IE": "u", - "Edge": "u", - "Firefox": "u", - "Safari": "u" - }, - "小程序": { - "微信": "y", - "阿里": "u", - "百度": "u", - "字节跳动": "u", - "QQ": "u" - }, - "快应用": { - "华为": "u", - "联盟": "u" - }, - "Vue": { - "vue2": "y", - "vue3": "y" - } - } - } - } -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-sign-in/pages/demo/demo.vue b/sport-erp-admin/uni_modules/uni-sign-in/pages/demo/demo.vue deleted file mode 100644 index 1131d3c..0000000 --- a/sport-erp-admin/uni_modules/uni-sign-in/pages/demo/demo.vue +++ /dev/null @@ -1,15 +0,0 @@ - - \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-sign-in/readme.md b/sport-erp-admin/uni_modules/uni-sign-in/readme.md deleted file mode 100644 index 98225a1..0000000 --- a/sport-erp-admin/uni_modules/uni-sign-in/readme.md +++ /dev/null @@ -1,80 +0,0 @@ -#### 简介:培养用户习惯,提升用户粘性,支持广告流量变现的签到得积分功能。 -#### 功能支持: -1. 每日签到奖励 (支持:普通签到、看广告签到) -2. 周期性连续7日签到,奖励翻倍 - -### 使用看广告签到功能必读 -1.`普通签到`是通过clientDb实现,如果你要使用`看广告签到`的方式, - 为了防止刷量需要修改`opendb-sign-in.schema`中`permission` -> `create` 的值设置为`false` - -> 文件路径 :`uni_modules/uni-sign-in/uniCloud/database/opendb-sign-in.schema.json` - -示例: - -```javascript -{ - "bsonType": "object", - "required": [], - "permission": { - "read": "auth.uid == doc.user_id", - "create": false, - "update": false, - "delete": false - } -} -``` - -2. 你需要看激励视频广告相关文档 -详情:[https://uniapp.dcloud.net.cn/api/a-d/rewarded-video](https://uniapp.dcloud.net.cn/api/a-d/rewarded-video) - -##### 使用方式 - -```js - - -``` - -> 详情参考[uni-starter](https://ext.dcloud.net.cn/plugin?id=5057) - - -##### 插件组成 -1. 前端组件 - - - -2. `DB Schema`表结构, - - 描述签到表字段及含义以及读写权限。 - - 路径:`/uniCloud/database/opendb-sign-in.schema.json` -> 更多表结构说明详情:[https://uniapp.dcloud.io/uniCloud/schema](https://uniapp.dcloud.io/uniCloud/schema) - -3. `uni-clientDB-actions` 一个可编程的 `clientDB` 前置后置操作 - - 前置操作,添加操作时检查今日是否未签到,否则拦截 - - 后置操作,判断是否已经连续签到7天,决定本次签到用户可得积分 - - 后置操作,输出本轮已签到几天,当前积分,已签到的日期数组,本轮签到可得多少分 -4. 两个api接口 - 普通签到`this.$refs.signIn.open()` - 看激励视频广告签到`this.$refs.signIn.showRewardedVideoAd()` - -#### 常见问题 -1. 是否支持配置积分数 - - 答:暂不支持,今后的版本有计划支持 - -2. 有没有更多玩法 - - 答:计划今后推出 - (2.1)需要看广告才能签到 --- 已支持 - (2.2)补签的玩法 \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-sign-in/static/background.png b/sport-erp-admin/uni_modules/uni-sign-in/static/background.png deleted file mode 100644 index c17b7ee..0000000 Binary files a/sport-erp-admin/uni_modules/uni-sign-in/static/background.png and /dev/null differ diff --git a/sport-erp-admin/uni_modules/uni-sign-in/uniCloud/cloudfunctions/common/sign-in/index.js b/sport-erp-admin/uni_modules/uni-sign-in/uniCloud/cloudfunctions/common/sign-in/index.js deleted file mode 100644 index 1cd87bd..0000000 --- a/sport-erp-admin/uni_modules/uni-sign-in/uniCloud/cloudfunctions/common/sign-in/index.js +++ /dev/null @@ -1,106 +0,0 @@ -// 开发文档:https://uniapp.dcloud.io/uniCloud/clientdb?id=action -const db = uniCloud.database(); -const dbCmd = db.command -const signInTable = db.collection('opendb-sign-in'); -const scoresTable = db.collection('uni-id-scores'); -module.exports = async function({user_id,ip}) { - let date = todayTimestamp() - let { - total - } = await signInTable.where({ - user_id, - date, - isDelete: false - }).count() - console.log(total); - if (total) { - throw new Error("今天已经签到") - } - // state.newData.date = date - // state.newData.isDelete = false - - await signInTable.add({ - ip, - date, - user_id, - create_date:Date.now(), - isDelete:false, - }) - - - // after ------------------------- - //查最近7天的签到情况 - let { - data: signInData - } = await signInTable.where({ - user_id, - date: dbCmd.gte(date - 3600 * 24 * 6 * 1000), - isDelete: false - }).get() - - let allDate = signInData.map(item => item.date) - - //今天是本轮签到的第几天 - const n = (date - Math.min(...allDate)) / 3600 / 24 / 1000 + 1; - //换成数字--第几天 - let days = signInData.map(item => { - return (n * 10000 - (date - item.date) / 3600 / 24 / 1000 * 10000) / 10000 - 1 - }) - - //查出来用户当前有多少积分 - let { - data: [userScore] - } = await scoresTable - .where({ - user_id - }) - .orderBy("create_date", "desc") - .limit(1) - .get() - let balance = 0 - if (userScore) { - balance = userScore.balance - } - - if (n == 7) { //如果已经满一轮就软删除之前的内容 - let setIsDeleteRes = await signInTable.where({ - user_id, - date: dbCmd.neq(date) - }).update({ - isDelete: true - }) - console.log({ - setIsDeleteRes - }); - } - //给加积分 - let score = n+days.length==14?60:10 //如果连续签到7天就多加50分,也就是60分 - balance += score - let addScores = await scoresTable.add({ - user_id, - balance, - score, - type: 1, - create_date: Date.now() - }) - console.log({ - addScores - }); - return { - score: balance, - signInData, - n, - days - } -} - -function todayTimestamp() { - //时区 - let timeZone = new Date().getTimezoneOffset() / 60 - //获得相对于北京时间的时间戳 - let timestamp = Date.now() + 3600 * 1000 * (8 + timeZone) - //一天一共多少毫秒 - const D = 3600 * 24 * 1000 - //去掉余数,再减去东8区的8小时 得到当天凌晨的时间戳 - return parseInt(timestamp / D) * D - 3600 * 1000 * 8 -} diff --git a/sport-erp-admin/uni_modules/uni-sign-in/uniCloud/cloudfunctions/common/sign-in/package.json b/sport-erp-admin/uni_modules/uni-sign-in/uniCloud/cloudfunctions/common/sign-in/package.json deleted file mode 100644 index 1e43ddb..0000000 --- a/sport-erp-admin/uni_modules/uni-sign-in/uniCloud/cloudfunctions/common/sign-in/package.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "sign-in", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "keywords": [], - "author": "", - "license": "ISC", - "origin-plugin-dev-name": "uni-template-admin", - "origin-plugin-version": "2.5.13", - "plugin-dev-name": "uni-template-admin", - "plugin-version": "2.5.13" -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-sign-in/uniCloud/cloudfunctions/rewarded-video-ad-notify-url/index.js b/sport-erp-admin/uni_modules/uni-sign-in/uniCloud/cloudfunctions/rewarded-video-ad-notify-url/index.js deleted file mode 100644 index 969eef5..0000000 --- a/sport-erp-admin/uni_modules/uni-sign-in/uniCloud/cloudfunctions/rewarded-video-ad-notify-url/index.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict'; -const uniADConfig = require('uni-config-center')({ - pluginId: 'uni-ad' -}).config() -const signIn = require('sign-in') -let ip = null -async function nextFn(data) { - //写自己的业务逻辑 - switch (data.extra) { - case "uniSignIn": //签到 - let { - user_id - } = data; - await signIn({ - user_id, - ip - }) - break; - default: - break; - } - return { - "isValid": true //如果不返回,广点通会2次调用本云函数 - } -} - -const crypto = require('crypto'); -const db = uniCloud.database(); -exports.main = async (event, context) => { - ip = context.CLIENTIP; - //event为客户端上传的参数 - console.log('event : ', event); - const { - path, - queryStringParameters - } = event; - const data = { - adpid: event.adpid, - platform: event.platform, - provider: event.provider, - trans_id: event.trans_id, - sign: event.sign, - user_id: event.user_id, - extra: event.extra, - } - // 注意::必须验签请求来源 - const trans_id = event.trans_id; - //去uni-config-center通过adpid获取secret - const secret = uniADConfig[event.adpid] - const sign2 = crypto.createHash('sha256').update(`${secret}:${trans_id}`).digest('hex'); - if (event.sign !== sign2) { - console.log('验签失败'); - return null; - } - //自己的逻辑 - try { - return await nextFn(data) - } catch (e) { - console.error(e) - return { - "isValid": false - } - } -}; \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-sign-in/uniCloud/cloudfunctions/rewarded-video-ad-notify-url/package.json b/sport-erp-admin/uni_modules/uni-sign-in/uniCloud/cloudfunctions/rewarded-video-ad-notify-url/package.json deleted file mode 100644 index 0872017..0000000 --- a/sport-erp-admin/uni_modules/uni-sign-in/uniCloud/cloudfunctions/rewarded-video-ad-notify-url/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "rewarded-video-ad-notify-url", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC", - "dependencies": { - "sign-in": "file:..\/common\/sign-in", - "uni-config-center": "file:..\/..\/..\/..\/uni-config-center\/uniCloud\/cloudfunctions\/common\/uni-config-center" - }, - "origin-plugin-dev-name": "uni-template-admin", - "origin-plugin-version": "2.5.13", - "plugin-dev-name": "uni-template-admin", - "plugin-version": "2.5.13" -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-sign-in/uniCloud/cloudfunctions/uni-clientDB-actions/signIn.js b/sport-erp-admin/uni_modules/uni-sign-in/uniCloud/cloudfunctions/uni-clientDB-actions/signIn.js deleted file mode 100644 index adf56bc..0000000 --- a/sport-erp-admin/uni_modules/uni-sign-in/uniCloud/cloudfunctions/uni-clientDB-actions/signIn.js +++ /dev/null @@ -1,90 +0,0 @@ -// 开发文档:https://uniapp.dcloud.io/uniCloud/clientdb?id=action -const db = uniCloud.database(); -const dbCmd = db.command -const signInTable = db.collection('opendb-sign-in'); -const scoresTable = db.collection('uni-id-scores'); -module.exports = { - before: async (state, event) => { - // console.log({state}); - if(state.type == 'create'){ - let date = todayTimestamp() - let {total} = await signInTable.where({ - user_id:state.auth.uid, - date, - isDelete:false - }).count() - console.log(total); - if(total){ - throw new Error("今天已经签到") - } - state.newData.date = date - state.newData.isDelete = false - } - }, - after: async (state, event, error, result) => { - if (error) { - throw error - } - let date = todayTimestamp() - //查最近7天的签到情况 - let {data:signInData} = await signInTable.where({ - user_id:state.auth.uid, - date:dbCmd.gte(date-3600*24*6*1000), - isDelete:false - }).get() - - let allDate = signInData.map(item=>item.date) - - //今天是本轮签到的第几天 - const n = ( date - Math.min(...allDate) )/3600/24/1000+1; - //换成数字--第几天 - let days = signInData.map(item=>{ - return (n*10000 - (date - item.date)/3600/24/1000*10000)/10000 -1 - }) - - //查出来用户当前有多少积分 - let {data: [userScore]} = await scoresTable - .where({user_id:state.auth.uid}) - .orderBy("create_date", "desc") - .limit(1) - .get() - let balance = 0 - if(userScore){ - balance = userScore.balance - } - - if(state.type == 'create'){ - if(n == 7){ //如果已经满一轮就软删除之前的内容 - let setIsDeleteRes = await signInTable.where({ - user_id:state.auth.uid, - date:dbCmd.neq(date) - }).update({isDelete:true}) - console.log({setIsDeleteRes}); - } - //给加积分 - let score = n+days.length==14?60:10 //如果连续签到7天就多加50分,也就是60分 - balance += score - let addScores = await scoresTable.add({ - user_id:state.auth.uid, - balance, - score, - type:1, - create_date:Date.now() - }) - console.log({addScores}); - } - return {...result,score:balance,signInData,n,days} - } -} - - -function todayTimestamp(){ - //时区 - let timeZone = new Date().getTimezoneOffset()/60 - //获得相对于北京时间的时间戳 - let timestamp = Date.now()+3600*1000*(8+timeZone) - //一天一共多少毫秒 - const D = 3600*24*1000 - //去掉余数,再减去东8区的8小时 得到当天凌晨的时间戳 - return parseInt(timestamp/D)*D - 3600*1000*8 -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-sign-in/uniCloud/database/opendb-sign-in.schema.json b/sport-erp-admin/uni_modules/uni-sign-in/uniCloud/database/opendb-sign-in.schema.json deleted file mode 100644 index d70fb39..0000000 --- a/sport-erp-admin/uni_modules/uni-sign-in/uniCloud/database/opendb-sign-in.schema.json +++ /dev/null @@ -1,41 +0,0 @@ -// 文档教程: https://uniapp.dcloud.net.cn/uniCloud/schema -{ - "bsonType": "object", - "required": [], - "permission": { - "read": "auth.uid == doc.user_id", - "create": "auth.uid != null && 'signIn' in action", //如果你要使用`看广告签到`的方式请将这里的值改为:false - "update": false, - "delete": false - }, - "properties": { - "_id": { - "description": "ID,系统自动生成" - }, - "user_id":{ - "forceDefaultValue":{ - "$env":"uid" - } - }, - "date":{ - "bsonType":"timestamp", - "description":"签到的日期时间戳", - "permission":{ - "write":false - } - }, - "create_date":{ - "bsonType":"timestamp", - "description":"签到的时间戳", - "forceDefaultValue":{ - "$env":"now" - } - }, - "ip":{ - "bsonType":"string", - "forceDefaultValue":{ - "$env":"clientIP" - } - } - } -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-sign-in/utils/ad.js b/sport-erp-admin/uni_modules/uni-sign-in/utils/ad.js deleted file mode 100644 index 7a77ca5..0000000 --- a/sport-erp-admin/uni_modules/uni-sign-in/utils/ad.js +++ /dev/null @@ -1,253 +0,0 @@ -// ad.js -const ADType = { - RewardedVideo: "RewardedVideo", - FullScreenVideo: "FullScreenVideo" -} - -class AdHelper { - - constructor() { - this._ads = {} - } - - load(options, onload, onerror) { - let ops = this._fixOldOptions(options) - let { - adpid - } = ops - - if (!adpid || this.isBusy(adpid)) { - return - } - - this.get(ops).load(onload, onerror) - } - - show(options, onsuccess, onfail) { - let ops = this._fixOldOptions(options) - let { - adpid - } = ops - - if (!adpid) { - return - } - - uni.showLoading({ - mask: true - }) - - var ad = this.get(ops) - - ad.load(() => { - uni.hideLoading() - ad.show((e) => { - onsuccess && onsuccess(e) - }) - }, (err) => { - uni.hideLoading() - onfail && onfail(err) - }) - } - - isBusy(adpid) { - return (this._ads[adpid] && this._ads[adpid].isLoading) - } - - get(options) { - const { - adpid, - singleton = true - } = options - if (singleton === false) { - if (this._ads[adpid]) { - this._ads[adpid].destroy() - delete this._ads[adpid] - } - } - delete options.singleton - if (!this._ads[adpid]) { - this._ads[adpid] = this._createAdInstance(options) - } - - return this._ads[adpid] - } - - _createAdInstance(options) { - const adType = options.adType || ADType.RewardedVideo - delete options.adType - - let ad = null; - if (adType === ADType.RewardedVideo) { - ad = new RewardedVideo(options) - } else if (adType === ADType.FullScreenVideo) { - ad = new FullScreenVideo(options) - } - - return ad - } - - _fixOldOptions(options) { - return (typeof options === "string") ? { - adpid: options - } : options - } -} - -const EXPIRED_TIME = 1000 * 60 * 30 -const ProviderType = { - CSJ: 'csj', - GDT: 'gdt' -} - -const RETRY_COUNT = 1 - -class AdBase { - constructor(adInstance, options = {}) { - this._isLoad = false - this._isLoading = false - this._lastLoadTime = 0 - this._lastError = null - this._retryCount = 0 - - this._loadCallback = null - this._closeCallback = null - this._errorCallback = null - - const ad = this._ad = adInstance - ad.onLoad((e) => { - this._isLoading = false - this._isLoad = true - this._lastLoadTime = Date.now() - - this.onLoad() - }) - ad.onClose((e) => { - this._isLoad = false - this.onClose(e) - }) - ad.onVerify && ad.onVerify((e) => { - // e.isValid - }) - ad.onError(({ - code, - message - }) => { - this._isLoading = false - const data = { - code: code, - errMsg: message - } - - if (code === -5008) { - this._loadAd() - return - } - - if (this._retryCount < RETRY_COUNT) { - this._retryCount += 1 - this._loadAd() - return - } - - this._lastError = data - this.onError(data) - }) - } - - get isExpired() { - return (this._lastLoadTime !== 0 && (Math.abs(Date.now() - this._lastLoadTime) > EXPIRED_TIME)) - } - - get isLoading() { - return this._isLoading - } - - getProvider() { - return this._ad.getProvider() - } - - load(onload, onerror) { - this._loadCallback = onload - this._errorCallback = onerror - - if (this._isLoading) { - return - } - - if (this._isLoad) { - this.onLoad() - return - } - - this._retryCount = 0 - - this._loadAd() - } - - show(onclose) { - this._closeCallback = onclose - - if (this._isLoading || !this._isLoad) { - return - } - - if (this._lastError !== null) { - this.onError(this._lastError) - return - } - - const provider = this.getProvider() - if (provider === ProviderType.CSJ && this.isExpired) { - this._loadAd() - return - } - - this._ad.show() - } - - onLoad(e) { - if (this._loadCallback != null) { - this._loadCallback() - } - } - - onClose(e) { - if (this._closeCallback != null) { - this._closeCallback({ - isEnded: e.isEnded - }) - } - } - - onError(e) { - if (this._errorCallback != null) { - this._errorCallback(e) - } - } - - destroy() { - this._ad.destroy() - } - - _loadAd() { - this._isLoad = false - this._isLoading = true - this._lastError = null - this._ad.load() - } -} - -class RewardedVideo extends AdBase { - constructor(options = {}) { - super(plus.ad.createRewardedVideoAd(options), options) - } -} - -class FullScreenVideo extends AdBase { - constructor(options = {}) { - super(plus.ad.createFullScreenVideoAd(options), options) - } -} - -export default new AdHelper() \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-table/changelog.md b/sport-erp-admin/uni_modules/uni-table/changelog.md deleted file mode 100644 index 842211c..0000000 --- a/sport-erp-admin/uni_modules/uni-table/changelog.md +++ /dev/null @@ -1,29 +0,0 @@ -## 1.2.4(2023-12-19) -- 修复 uni-tr只有一列时minWidth计算错误,列变化实时计算更新 -## 1.2.3(2023-03-28) -- 修复 在vue3模式下可能会出现错误的问题 -## 1.2.2(2022-11-29) -- 优化 主题样式 -## 1.2.1(2022-06-06) -- 修复 微信小程序存在无使用组件的问题 -## 1.2.0(2021-11-19) -- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) -- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-table](https://uniapp.dcloud.io/component/uniui/uni-table) -## 1.1.0(2021-07-30) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 1.0.7(2021-07-08) -- 新增 uni-th 支持 date 日期筛选范围 -## 1.0.6(2021-07-05) -- 新增 uni-th 支持 range 筛选范围 -## 1.0.5(2021-06-28) -- 新增 uni-th 筛选功能 -## 1.0.4(2021-05-12) -- 新增 示例地址 -- 修复 示例项目缺少组件的Bug -## 1.0.3(2021-04-16) -- 新增 sortable 属性,是否开启单列排序 -- 优化 表格多选逻辑 -## 1.0.2(2021-03-22) -- uni-tr 添加 disabled 属性,用于 type=selection 时,设置某行是否可由全选按钮控制 -## 1.0.1(2021-02-05) -- 调整为uni_modules目录规范 diff --git a/sport-erp-admin/uni_modules/uni-table/components/uni-table/uni-table.vue b/sport-erp-admin/uni_modules/uni-table/components/uni-table/uni-table.vue deleted file mode 100644 index 21d9527..0000000 --- a/sport-erp-admin/uni_modules/uni-table/components/uni-table/uni-table.vue +++ /dev/null @@ -1,455 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-table/components/uni-tbody/uni-tbody.vue b/sport-erp-admin/uni_modules/uni-table/components/uni-tbody/uni-tbody.vue deleted file mode 100644 index fbe1bdc..0000000 --- a/sport-erp-admin/uni_modules/uni-table/components/uni-tbody/uni-tbody.vue +++ /dev/null @@ -1,29 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-table/components/uni-td/uni-td.vue b/sport-erp-admin/uni_modules/uni-table/components/uni-td/uni-td.vue deleted file mode 100644 index 9ce93e9..0000000 --- a/sport-erp-admin/uni_modules/uni-table/components/uni-td/uni-td.vue +++ /dev/null @@ -1,90 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-table/components/uni-th/filter-dropdown.vue b/sport-erp-admin/uni_modules/uni-table/components/uni-th/filter-dropdown.vue deleted file mode 100644 index df22a71..0000000 --- a/sport-erp-admin/uni_modules/uni-table/components/uni-th/filter-dropdown.vue +++ /dev/null @@ -1,511 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-table/components/uni-th/uni-th.vue b/sport-erp-admin/uni_modules/uni-table/components/uni-th/uni-th.vue deleted file mode 100644 index 14889dd..0000000 --- a/sport-erp-admin/uni_modules/uni-table/components/uni-th/uni-th.vue +++ /dev/null @@ -1,285 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-table/components/uni-thead/uni-thead.vue b/sport-erp-admin/uni_modules/uni-table/components/uni-thead/uni-thead.vue deleted file mode 100644 index 0dd18cd..0000000 --- a/sport-erp-admin/uni_modules/uni-table/components/uni-thead/uni-thead.vue +++ /dev/null @@ -1,129 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-table/components/uni-tr/table-checkbox.vue b/sport-erp-admin/uni_modules/uni-table/components/uni-tr/table-checkbox.vue deleted file mode 100644 index 1089187..0000000 --- a/sport-erp-admin/uni_modules/uni-table/components/uni-tr/table-checkbox.vue +++ /dev/null @@ -1,179 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-table/components/uni-tr/uni-tr.vue b/sport-erp-admin/uni_modules/uni-table/components/uni-tr/uni-tr.vue deleted file mode 100644 index 60219d3..0000000 --- a/sport-erp-admin/uni_modules/uni-table/components/uni-tr/uni-tr.vue +++ /dev/null @@ -1,179 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-table/i18n/en.json b/sport-erp-admin/uni_modules/uni-table/i18n/en.json deleted file mode 100644 index e32023c..0000000 --- a/sport-erp-admin/uni_modules/uni-table/i18n/en.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "filter-dropdown.reset": "Reset", - "filter-dropdown.search": "Search", - "filter-dropdown.submit": "Submit", - "filter-dropdown.filter": "Filter", - "filter-dropdown.gt": "Greater or equal to", - "filter-dropdown.lt": "Less than or equal to", - "filter-dropdown.date": "Date" -} diff --git a/sport-erp-admin/uni_modules/uni-table/i18n/es.json b/sport-erp-admin/uni_modules/uni-table/i18n/es.json deleted file mode 100644 index 9afd04b..0000000 --- a/sport-erp-admin/uni_modules/uni-table/i18n/es.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "filter-dropdown.reset": "Reiniciar", - "filter-dropdown.search": "Búsqueda", - "filter-dropdown.submit": "Entregar", - "filter-dropdown.filter": "Filtrar", - "filter-dropdown.gt": "Mayor o igual a", - "filter-dropdown.lt": "Menos que o igual a", - "filter-dropdown.date": "Fecha" -} diff --git a/sport-erp-admin/uni_modules/uni-table/i18n/fr.json b/sport-erp-admin/uni_modules/uni-table/i18n/fr.json deleted file mode 100644 index b006237..0000000 --- a/sport-erp-admin/uni_modules/uni-table/i18n/fr.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "filter-dropdown.reset": "Réinitialiser", - "filter-dropdown.search": "Chercher", - "filter-dropdown.submit": "Soumettre", - "filter-dropdown.filter": "Filtre", - "filter-dropdown.gt": "Supérieur ou égal à", - "filter-dropdown.lt": "Inférieur ou égal à", - "filter-dropdown.date": "Date" -} diff --git a/sport-erp-admin/uni_modules/uni-table/i18n/index.js b/sport-erp-admin/uni_modules/uni-table/i18n/index.js deleted file mode 100644 index 2469dd0..0000000 --- a/sport-erp-admin/uni_modules/uni-table/i18n/index.js +++ /dev/null @@ -1,12 +0,0 @@ -import en from './en.json' -import es from './es.json' -import fr from './fr.json' -import zhHans from './zh-Hans.json' -import zhHant from './zh-Hant.json' -export default { - en, - es, - fr, - 'zh-Hans': zhHans, - 'zh-Hant': zhHant -} diff --git a/sport-erp-admin/uni_modules/uni-table/i18n/zh-Hans.json b/sport-erp-admin/uni_modules/uni-table/i18n/zh-Hans.json deleted file mode 100644 index 862af17..0000000 --- a/sport-erp-admin/uni_modules/uni-table/i18n/zh-Hans.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "filter-dropdown.reset": "重置", - "filter-dropdown.search": "搜索", - "filter-dropdown.submit": "确定", - "filter-dropdown.filter": "筛选", - "filter-dropdown.gt": "大于等于", - "filter-dropdown.lt": "小于等于", - "filter-dropdown.date": "日期范围" -} diff --git a/sport-erp-admin/uni_modules/uni-table/i18n/zh-Hant.json b/sport-erp-admin/uni_modules/uni-table/i18n/zh-Hant.json deleted file mode 100644 index 64f8061..0000000 --- a/sport-erp-admin/uni_modules/uni-table/i18n/zh-Hant.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "filter-dropdown.reset": "重置", - "filter-dropdown.search": "搜索", - "filter-dropdown.submit": "確定", - "filter-dropdown.filter": "篩選", - "filter-dropdown.gt": "大於等於", - "filter-dropdown.lt": "小於等於", - "filter-dropdown.date": "日期範圍" -} diff --git a/sport-erp-admin/uni_modules/uni-table/package.json b/sport-erp-admin/uni_modules/uni-table/package.json deleted file mode 100644 index a52821b..0000000 --- a/sport-erp-admin/uni_modules/uni-table/package.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "id": "uni-table", - "displayName": "uni-table 表格", - "version": "1.2.4", - "description": "表格组件,多用于展示多条结构类似的数据,如", - "keywords": [ - "uni-ui", - "uniui", - "table", - "表格" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, -"dcloudext": { - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", - "type": "component-vue" - }, - "uni_modules": { - "dependencies": ["uni-scss","uni-datetime-picker"], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "n" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "n", - "QQ": "y" - }, - "快应用": { - "华为": "n", - "联盟": "n" - }, - "Vue": { - "vue2": "y", - "vue3": "y" - } - } - } - } -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-table/readme.md b/sport-erp-admin/uni_modules/uni-table/readme.md deleted file mode 100644 index bb08c79..0000000 --- a/sport-erp-admin/uni_modules/uni-table/readme.md +++ /dev/null @@ -1,13 +0,0 @@ - - -## Table 表单 -> 组件名:``uni-table``,代码块: `uTable`。 - -用于展示多条结构类似的数据 - -### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-table) -#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 - - - - diff --git a/sport-erp-admin/uni_modules/uni-tag/changelog.md b/sport-erp-admin/uni_modules/uni-tag/changelog.md deleted file mode 100644 index ddee87a..0000000 --- a/sport-erp-admin/uni_modules/uni-tag/changelog.md +++ /dev/null @@ -1,23 +0,0 @@ -## 2.1.1(2024-03-20) -- 优化 app下边框过窄导致不显示的bug -## 2.1.0(2021-11-19) -- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) -- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-tag](https://uniapp.dcloud.io/component/uniui/uni-tag) -## 2.0.0(2021-11-09) -- 新增 提供组件设计资源,组件样式调整 -- 移除 插槽 -- 移除 type 属性的 royal 选项 -## 1.1.1(2021-08-11) -- type 不是 default 时,size 为 small 字体大小显示不正确 -## 1.1.0(2021-07-30) -- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 1.0.7(2021-06-18) -- 修复 uni-tag 在字节跳动小程序上 css 类名编译错误的 bug -## 1.0.6(2021-06-04) -- 修复 未定义 sass 变量 "$uni-color-royal" 的bug -## 1.0.5(2021-05-10) -- 修复 royal 类型无效的bug -- 修复 uni-tag 宽度不自适应的bug -- 新增 uni-tag 支持属性 custom-style 自定义样式 -## 1.0.4(2021-02-05) -- 调整为uni_modules目录规范 diff --git a/sport-erp-admin/uni_modules/uni-tag/components/uni-tag/uni-tag.vue b/sport-erp-admin/uni_modules/uni-tag/components/uni-tag/uni-tag.vue deleted file mode 100644 index 7274436..0000000 --- a/sport-erp-admin/uni_modules/uni-tag/components/uni-tag/uni-tag.vue +++ /dev/null @@ -1,252 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-tag/package.json b/sport-erp-admin/uni_modules/uni-tag/package.json deleted file mode 100644 index 71b41eb..0000000 --- a/sport-erp-admin/uni_modules/uni-tag/package.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "id": "uni-tag", - "displayName": "uni-tag 标签", - "version": "2.1.1", - "description": "Tag 组件,用于展示1个或多个文字标签,可点击切换选中、不选中的状态。", - "keywords": [ - "uni-ui", - "uniui", - "", - "tag", - "标签" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, -"dcloudext": { - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", - "type": "component-vue" - }, - "uni_modules": { - "dependencies": ["uni-scss"], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "y" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y" - }, - "快应用": { - "华为": "u", - "联盟": "u" - }, - "Vue": { - "vue2": "y", - "vue3": "y" - } - } - } - } -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-tag/readme.md b/sport-erp-admin/uni_modules/uni-tag/readme.md deleted file mode 100644 index 6e78ff5..0000000 --- a/sport-erp-admin/uni_modules/uni-tag/readme.md +++ /dev/null @@ -1,13 +0,0 @@ - - -## Tag 标签 -> **组件名:uni-tag** -> 代码块: `uTag` - - -用于展示1个或多个文字标签,可点击切换选中、不选中的状态 。 - -### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-tag) -#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 - - diff --git a/sport-erp-admin/uni_modules/uni-tooltip/changelog.md b/sport-erp-admin/uni_modules/uni-tooltip/changelog.md deleted file mode 100644 index 285b676..0000000 --- a/sport-erp-admin/uni_modules/uni-tooltip/changelog.md +++ /dev/null @@ -1,16 +0,0 @@ -## 0.2.4(2024-04-23) -- 修复 弹出位置默认值不一致导致的错位 -## 0.2.3(2024-03-20) -- 修复 弹出位置修正 -## 0.2.2(2024-01-15) -- 新增 placement支持设置四个方向:top bottom left right -## 0.2.1(2022-05-09) -- 修复 content 为空时仍然弹出的bug -## 0.2.0(2022-05-07) -**注意:破坏性更新** -- 更新 text 属性变更为 content -- 更新 移除 width 属性 -## 0.1.1(2022-04-27) -- 修复 组件根 text 嵌套组件 warning -## 0.1.0(2022-04-21) -- 初始化 diff --git a/sport-erp-admin/uni_modules/uni-tooltip/components/uni-tooltip/uni-tooltip.vue b/sport-erp-admin/uni_modules/uni-tooltip/components/uni-tooltip/uni-tooltip.vue deleted file mode 100644 index 476a7dd..0000000 --- a/sport-erp-admin/uni_modules/uni-tooltip/components/uni-tooltip/uni-tooltip.vue +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - diff --git a/sport-erp-admin/uni_modules/uni-tooltip/package.json b/sport-erp-admin/uni_modules/uni-tooltip/package.json deleted file mode 100644 index 44158e1..0000000 --- a/sport-erp-admin/uni_modules/uni-tooltip/package.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "id": "uni-tooltip", - "displayName": "uni-tooltip 提示文字", - "version": "0.2.4", - "description": "Tooltip 提示文字", - "keywords": [ - "uni-tooltip", - "uni-ui", - "tooltip", - "tip", - "文字提示" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, -"dcloudext": { - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无 ", - "data": "无", - "permissions": "无" - }, - "npmurl": "", - "type": "component-vue" - }, - "uni_modules": { - "dependencies": [], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y", - "alipay": "n" - }, - "client": { - "Vue": { - "vue2": "y", - "vue3": "y" - }, - "App": { - "app-vue": "y", - "app-nvue": "u" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "u", - "百度": "u", - "字节跳动": "u", - "QQ": "u", - "京东": "u" - }, - "快应用": { - "华为": "u", - "联盟": "u" - } - } - } - } -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-tooltip/readme.md b/sport-erp-admin/uni_modules/uni-tooltip/readme.md deleted file mode 100644 index faafa2e..0000000 --- a/sport-erp-admin/uni_modules/uni-tooltip/readme.md +++ /dev/null @@ -1,8 +0,0 @@ -## Badge 数字角标 -> **组件名:uni-tooltip** -> 代码块: `uTooltip` - -数字角标一般和其它控件(列表、9宫格等)配合使用,用于进行数量提示,默认为实心灰色背景, - -### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-tooltip) -#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 diff --git a/sport-erp-admin/uni_modules/uni-transition/changelog.md b/sport-erp-admin/uni_modules/uni-transition/changelog.md deleted file mode 100644 index faaf336..0000000 --- a/sport-erp-admin/uni_modules/uni-transition/changelog.md +++ /dev/null @@ -1,24 +0,0 @@ -## 1.3.3(2024-04-23) -- 修复 当元素会受变量影响自动隐藏的bug -## 1.3.2(2023-05-04) -- 修复 NVUE 平台报错的问题 -## 1.3.1(2021-11-23) -- 修复 init 方法初始化问题 -## 1.3.0(2021-11-19) -- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) -- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-transition](https://uniapp.dcloud.io/component/uniui/uni-transition) -## 1.2.1(2021-09-27) -- 修复 init 方法不生效的 Bug -## 1.2.0(2021-07-30) -- 组件兼容 vue3,如何创建 vue3 项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) -## 1.1.1(2021-05-12) -- 新增 示例地址 -- 修复 示例项目缺少组件的 Bug -## 1.1.0(2021-04-22) -- 新增 通过方法自定义动画 -- 新增 custom-class 非 NVUE 平台支持自定义 class 定制样式 -- 优化 动画触发逻辑,使动画更流畅 -- 优化 支持单独的动画类型 -- 优化 文档示例 -## 1.0.2(2021-02-05) -- 调整为 uni_modules 目录规范 diff --git a/sport-erp-admin/uni_modules/uni-transition/components/uni-transition/createAnimation.js b/sport-erp-admin/uni_modules/uni-transition/components/uni-transition/createAnimation.js deleted file mode 100644 index 8f89b18..0000000 --- a/sport-erp-admin/uni_modules/uni-transition/components/uni-transition/createAnimation.js +++ /dev/null @@ -1,131 +0,0 @@ -// const defaultOption = { -// duration: 300, -// timingFunction: 'linear', -// delay: 0, -// transformOrigin: '50% 50% 0' -// } -// #ifdef APP-NVUE -const nvueAnimation = uni.requireNativePlugin('animation') -// #endif -class MPAnimation { - constructor(options, _this) { - this.options = options - // 在iOS10+QQ小程序平台下,传给原生的对象一定是个普通对象而不是Proxy对象,否则会报parameter should be Object instead of ProxyObject的错误 - this.animation = uni.createAnimation({ - ...options - }) - this.currentStepAnimates = {} - this.next = 0 - this.$ = _this - - } - - _nvuePushAnimates(type, args) { - let aniObj = this.currentStepAnimates[this.next] - let styles = {} - if (!aniObj) { - styles = { - styles: {}, - config: {} - } - } else { - styles = aniObj - } - if (animateTypes1.includes(type)) { - if (!styles.styles.transform) { - styles.styles.transform = '' - } - let unit = '' - if(type === 'rotate'){ - unit = 'deg' - } - styles.styles.transform += `${type}(${args+unit}) ` - } else { - styles.styles[type] = `${args}` - } - this.currentStepAnimates[this.next] = styles - } - _animateRun(styles = {}, config = {}) { - let ref = this.$.$refs['ani'].ref - if (!ref) return - return new Promise((resolve, reject) => { - nvueAnimation.transition(ref, { - styles, - ...config - }, res => { - resolve() - }) - }) - } - - _nvueNextAnimate(animates, step = 0, fn) { - let obj = animates[step] - if (obj) { - let { - styles, - config - } = obj - this._animateRun(styles, config).then(() => { - step += 1 - this._nvueNextAnimate(animates, step, fn) - }) - } else { - this.currentStepAnimates = {} - typeof fn === 'function' && fn() - this.isEnd = true - } - } - - step(config = {}) { - // #ifndef APP-NVUE - this.animation.step(config) - // #endif - // #ifdef APP-NVUE - this.currentStepAnimates[this.next].config = Object.assign({}, this.options, config) - this.currentStepAnimates[this.next].styles.transformOrigin = this.currentStepAnimates[this.next].config.transformOrigin - this.next++ - // #endif - return this - } - - run(fn) { - // #ifndef APP-NVUE - this.$.animationData = this.animation.export() - this.$.timer = setTimeout(() => { - typeof fn === 'function' && fn() - }, this.$.durationTime) - // #endif - // #ifdef APP-NVUE - this.isEnd = false - let ref = this.$.$refs['ani'] && this.$.$refs['ani'].ref - if(!ref) return - this._nvueNextAnimate(this.currentStepAnimates, 0, fn) - this.next = 0 - // #endif - } -} - - -const animateTypes1 = ['matrix', 'matrix3d', 'rotate', 'rotate3d', 'rotateX', 'rotateY', 'rotateZ', 'scale', 'scale3d', - 'scaleX', 'scaleY', 'scaleZ', 'skew', 'skewX', 'skewY', 'translate', 'translate3d', 'translateX', 'translateY', - 'translateZ' -] -const animateTypes2 = ['opacity', 'backgroundColor'] -const animateTypes3 = ['width', 'height', 'left', 'right', 'top', 'bottom'] -animateTypes1.concat(animateTypes2, animateTypes3).forEach(type => { - MPAnimation.prototype[type] = function(...args) { - // #ifndef APP-NVUE - this.animation[type](...args) - // #endif - // #ifdef APP-NVUE - this._nvuePushAnimates(type, args) - // #endif - return this - } -}) - -export function createAnimation(option, _this) { - if(!_this) return - clearTimeout(_this.timer) - return new MPAnimation(option, _this) -} diff --git a/sport-erp-admin/uni_modules/uni-transition/components/uni-transition/uni-transition.vue b/sport-erp-admin/uni_modules/uni-transition/components/uni-transition/uni-transition.vue deleted file mode 100644 index f3ddd1f..0000000 --- a/sport-erp-admin/uni_modules/uni-transition/components/uni-transition/uni-transition.vue +++ /dev/null @@ -1,286 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-transition/package.json b/sport-erp-admin/uni_modules/uni-transition/package.json deleted file mode 100644 index d5c20e1..0000000 --- a/sport-erp-admin/uni_modules/uni-transition/package.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "id": "uni-transition", - "displayName": "uni-transition 过渡动画", - "version": "1.3.3", - "description": "元素的简单过渡动画", - "keywords": [ - "uni-ui", - "uniui", - "动画", - "过渡", - "过渡动画" -], - "repository": "https://github.com/dcloudio/uni-ui", - "engines": { - "HBuilderX": "" - }, - "directories": { - "example": "../../temps/example_temps" - }, -"dcloudext": { - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "无", - "permissions": "无" - }, - "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui", - "type": "component-vue" - }, - "uni_modules": { - "dependencies": ["uni-scss"], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y", - "alipay": "n" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "y" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y" - }, - "快应用": { - "华为": "u", - "联盟": "u" - }, - "Vue": { - "vue2": "y", - "vue3": "y" - } - } - } - } -} \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-transition/readme.md b/sport-erp-admin/uni_modules/uni-transition/readme.md deleted file mode 100644 index 2f8a77e..0000000 --- a/sport-erp-admin/uni_modules/uni-transition/readme.md +++ /dev/null @@ -1,11 +0,0 @@ - - -## Transition 过渡动画 -> **组件名:uni-transition** -> 代码块: `uTransition` - - -元素过渡动画 - -### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-transition) -#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 \ No newline at end of file diff --git a/sport-erp-admin/uni_modules/uni-upgrade-center/changelog.md b/sport-erp-admin/uni_modules/uni-upgrade-center/changelog.md deleted file mode 100644 index 1f01bc0..0000000 --- a/sport-erp-admin/uni_modules/uni-upgrade-center/changelog.md +++ /dev/null @@ -1,57 +0,0 @@ -## 0.7.0(2024-11-01) -- 更新 支持 HarmonyOS Next -## 0.6.2(2024-04-11) -- 更新 支持支付宝小程序云 -## 0.6.1(2023-11-02) -- 修复 输入更新内容时有长度限制的Bug -## 0.6.0(2023-02-24) -- 修复 升级中心安卓应用市场不显示的Bug -## 0.5.1(2022-07-06) -- 修复 上版带出云函数不存在的Bug -- 升级 uni-admin 大于等于 1.9.0 务必更新至此版本。uni-admin 版本小于 1.9.0 请不要更新,历史版本在 Gitee 有发行版。后续 uni-admin 会集成升级中心 -## 0.5.0(2022-07-05) -- 修复 版本列表默认显示全部版本的Bug -- 升级 uni-admin 1.9.0 务必更新至此版本。uni-admin 版本小于 1.9.0 请不要更新,后续 uni-admin 会集成升级中心 - -## 0.4.2(2021-12-07) -- 更新 优化 list 页面显示,修复 list 页面报错 -## 0.4.1(2021-12-01) -- 修复 0.4.0版本带出来,发布新版时 appid、name 不会自动填充的Bug -## 0.4.0(2021-11-26) -- 更新 升级中心移除应用管理,现在由uni-admin接管。旧版本若没有应用管理请做升级处理 -## 0.3.0(2021-11-18) -- 兼容 uni-admin 新版内置 $request 函数改动 -## 0.2.2(2021-09-06) -- 解决 opendb-app-list表对应的schema名称冲突的问题 -## 0.2.1(2021-09-03) -- 修复 一个在添加菜单时报错,createdate不与默认值匹配 的Bug -## 0.2.0(2021-08-25) -- 兼容vue3.0 -## 0.1.9(2021-08-13) -- 更新 uni-forms使用validate校验字段 -- 修复 报错dirty_data、create_date在数据库中并不存在 -## 0.1.8(2021-08-09) -- 修复 默认配置项配置错误 -## 0.1.7(2021-08-09) -- 移除测试时配置项 -## 0.1.6(2021-08-09) -- 修复 修改版本信息时,上传时间丢失问题 -## 0.1.5(2021-07-21) -- 更新 :value.sync 改为 :value 和 @update:value -## 0.1.4(2021-07-13) -- 修复 uni-easyinput去除输入字符长度限制 -- 更新文档 关于 uni-id缺少配置信息 错误。请查看安装指引第13条 -## 0.1.3(2021-06-15) -- 修复 wgt更新某些情况下获取数据错误 -## 0.1.2(2021-06-04) -- 修复 上传包时根据平台筛选文件 -- 更新 文档 -## 0.1.1(2021-05-18) -- 更新uni-table中uni-tr组件的selectable属性为disabled -## 0.1.0(2021-04-07) -- 更新版本对比函数 compare -## 0.0.6(2021-04-01) -- 调整db_init.json -## 0.0.5(2021-03-25) -- 调整为uni_modules目录 -- 升级中心后台管理系统拆分为 Admin 后台管理 和 前台检查更新(uni-upgrade-center-app) diff --git a/sport-erp-admin/uni_modules/uni-upgrade-center/package.json b/sport-erp-admin/uni_modules/uni-upgrade-center/package.json deleted file mode 100644 index 025470b..0000000 --- a/sport-erp-admin/uni_modules/uni-upgrade-center/package.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "id": "uni-upgrade-center", - "displayName": "升级中心 uni-upgrade-center - Admin", - "version": "0.7.0", - "description": "uni升级中心 - 后台管理系统", - "keywords": [ - "uniCloud", - "admin", - "update", - "升级", - "wgt" -], - "repository": "https://gitee.com/dcloud/uni-upgrade-center/tree/master/uni_modules/uni-upgrade-center", - "engines": { - "HBuilderX": "^3.3.10" - }, -"dcloudext": { - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无", - "data": "插件不采集任何数据", - "permissions": "无" - }, - "npmurl": "", - "type": "unicloud-admin" - }, - "uni_modules": { - "dependencies": [ - "uni-data-checkbox", - "uni-data-picker", - "uni-dateformat", - "uni-easyinput", - "uni-file-picker", - "uni-forms", - "uni-icons", - "uni-pagination", - "uni-table" - ], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y", - "alipay": "y" - }, - "client": { - "App": { - "app-vue": "y", - "app-nvue": "y" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y" - }, - "快应用": { - "华为": "y", - "联盟": "y" - }, - "Vue": { - "vue2": "y", - "vue3": "y" - } - } - } - } -} diff --git a/sport-erp-admin/uni_modules/uni-upgrade-center/pages/components/show-info.vue b/sport-erp-admin/uni_modules/uni-upgrade-center/pages/components/show-info.vue deleted file mode 100644 index 459eda6..0000000 --- a/sport-erp-admin/uni_modules/uni-upgrade-center/pages/components/show-info.vue +++ /dev/null @@ -1,52 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-upgrade-center/pages/mixin/version_add_detail_mixin.js b/sport-erp-admin/uni_modules/uni-upgrade-center/pages/mixin/version_add_detail_mixin.js deleted file mode 100644 index a841c1a..0000000 --- a/sport-erp-admin/uni_modules/uni-upgrade-center/pages/mixin/version_add_detail_mixin.js +++ /dev/null @@ -1,243 +0,0 @@ -import { - validator, - enumConverter -} from '@/js_sdk/validator/opendb-app-versions.js'; - -export const platform_iOS = 'iOS'; -export const platform_Android = 'Android'; -export const platform_Harmony = 'Harmony' -const db = uniCloud.database(); - -function getValidator(fields) { - let reuslt = {} - for (let key in validator) { - if (fields.includes(key)) { - reuslt[key] = validator[key] - } - } - return reuslt -} - -export const fields = - 'appid,name,title,contents,platform,type,version,min_uni_version,url,stable_publish,is_silently,is_mandatory,create_date,store_list' - -export default { - data() { - return { - labelWidth: '100px', - enableiOSWgt: true, // 是否开启iOS的wgt更新 - silentlyContent: '静默更新:App升级时会在后台下载wgt包并自行安装。新功能在下次启动App时生效', - mandatoryContent: '强制更新:App升级弹出框不可取消', - stablePublishContent: '同时只可有一个线上发行版,线上发行不可更设为下线。\n未上线可以设为上线发行并自动替换当前线上发行版', - stablePublishContent2: '使用本包替换当前线上发行版', - uploadFileContent: '可下载安装包地址。上传文件到云存储自动填写,也可以手动填写', - minUniVersionContent: '上次使用新Api或打包新模块的App版本', - priorityContent: '检查更新时,按照优先级从大到小依次尝试跳转商店。如果都跳转失败,则会打开浏览器使用下载链接下载apk安装包', - latestStableData: [], // 库中最新已上线版 - appFileList: null, // 上传包 - type_valuetotext: enumConverter.type_valuetotext, - preUrl: '', - formData: { - "appid": "", - "name": "", - "title": "", - "contents": "", - "platform": [], - "store_list": [], - "type": "", - "version": "", - "min_uni_version": "", - "url": "", - "stable_publish": false, - "create_date": null - }, - formOptions: { - "platform_localdata": [ - { - "value": "Android", - "text": "安卓" - }, - { - "value": "iOS", - "text": "苹果" - }, - { - "value": "Harmony", - "text": "鸿蒙 Next" - } - ], - "type_localdata": [ - { - "value": "native_app", - "text": "原生App安装包" - }, - { - "value": "wgt", - "text": "App资源包" - } - ] - }, - rules: { - ...getValidator([ - "appid", "contents", "platform", "type", - "version", "min_uni_version", "url", "stable_publish", - "title", "name", "is_silently", "is_mandatory", "store_list" - ]) - } - } - }, - onReady() { - this.$refs.form.setRules(this.rules) - }, - computed: { - isWGT() { - return this.formData.type === 'wgt' - }, - isNativeApp() { - return this.formData.type === 'native_app' - }, - isiOS() { - return this.formData.platform.includes(platform_iOS); - }, - isAndroid() { - return this.formData.platform.includes(platform_Android) - }, - isHarmony() { - return this.formData.platform.includes(platform_Harmony) - }, - hasPackage() { - return this.appFileList && !!Object.keys(this.appFileList).length - }, - fileExtname() { - return this.isWGT ? ['wgt'] : ['apk'] - }, - platformLocaldata() { - return !this.isWGT ? this.formOptions.platform_localdata : this.enableiOSWgt ? this.formOptions - .platform_localdata : [this.formOptions.platform_localdata[0], this.formOptions.platform_localdata[2]] - }, - uni_platform() { - if (this.isiOS) return platform_iOS.toLocaleLowerCase() - else if (this.isAndroid) return platform_Android.toLocaleLowerCase() - return platform_Harmony.toLocaleLowerCase() - }, - enableUploadPackage() { - return this.isWGT || !(this.isiOS || this.isHarmony) - }, - urlLabel() { - if (this.isWGT || this.isAndroid) return '下载链接' - if (this.isiOS) return 'AppStore' - else if (this.isHarmony) return '应用商店' - }, - isApk() { - const apkIndex = this.formData.url.indexOf('apk') - return this.formData.url && (apkIndex > -1 && apkIndex === this.formData.url.length - 3) - } - }, - methods: { - getStoreList(appid) { - return db.collection('opendb-app-list') - .where({ - appid - }) - .get() - .then(res => { - const data = res.result.data[0] - return data ? data.store_list || [] : [] - }) - }, - packageUploadSuccess(res) { - uni.showToast({ - icon: 'success', - title: '上传成功', - duration: 800 - }) - this.preUrl = this.formData.url - this.formData.url = res.tempFilePaths[0] - }, - deleteFile(fileList) { - return this.$request('deleteFile', { - fileList - }, { - functionName: 'uni-upgrade-center' - }) - }, - async packageDelete(res) { - if (!this.hasPackage) return; - await this.deleteFile([res.tempFilePath]) - uni.showToast({ - icon: 'success', - title: '删除成功', - duration: 800 - }) - this.formData.url = this.preUrl - this.$refs.form.clearValidate('url') - }, - selectFile() { - if (this.hasPackage) { - uni.showToast({ - icon: 'none', - title: '只可上传一个文件,请删除已上传后重试', - duration: 1000 - }); - } - }, - createCenterRecord(value) { - return { - ...value, - uni_platform: this.uni_platform, - create_env: 'upgrade-center' - } - }, - createCenterQuery({ - appid - }) { - return { - appid, - create_env: 'upgrade-center' - } - }, - createStatQuery({ - appid, - type, - version, - uni_platform - }) { - return { - appid, - type, - version, - uni_platform: uni_platform ? uni_platform : this.uni_platform, - create_env: 'uni-stat', - stable_publish: false - } - }, - async toUrl(url){ - if (/^cloud:\/\//.test(url)) { - const tcbRes = await uniCloud.getTempFileURL({ fileList: [url] }); - if (typeof tcbRes.fileList[0].tempFileURL !== 'undefined') url = tcbRes.fileList[0].tempFileURL; - } - // #ifdef H5 - window.open(url); - // #endif - // #ifndef H5 - uni.showToast({ - title: '请在浏览器中打开', - icon: 'none' - }); - // #endif - }, - getCloudStorageConfig(){ - return uni.getStorageSync('uni-admin-cloud-storage-config') || {}; - }, - setCloudStorageConfig(data={}){ - uni.setStorageSync('uni-admin-cloud-storage-config', data); - }, - // 临时方法,后面会优化 - setCloudStorage(data){ - // uniCloud.setCloudStorage 不是标准的API,临时挂载在uniCloud对象上的,后面会优化 - if (typeof uniCloud.setCloudStorage === "function") { - uniCloud.setCloudStorage(data); - } - } - } -} diff --git a/sport-erp-admin/uni_modules/uni-upgrade-center/pages/utils.js b/sport-erp-admin/uni_modules/uni-upgrade-center/pages/utils.js deleted file mode 100644 index 93e6bba..0000000 --- a/sport-erp-admin/uni_modules/uni-upgrade-center/pages/utils.js +++ /dev/null @@ -1,70 +0,0 @@ -// 判断arr是否为一个数组,返回一个bool值 -function isArray(arr) { - return Object.prototype.toString.call(arr) === '[object Array]'; -} - -// 深度克隆 -export function deepClone(obj) { - // 对常见的“非”值,直接返回原来值 - if ([null, undefined, NaN, false].includes(obj)) return obj; - if (typeof obj !== "object" && typeof obj !== 'function') { - //原始类型直接返回 - return obj; - } - let o = isArray(obj) ? [] : {}; - for (let i in obj) { - if (obj.hasOwnProperty(i)) { - o[i] = typeof obj[i] === "object" ? deepClone(obj[i]) : obj[i]; - } - } - return o; -} - -export const appListDbName = 'opendb-app-list' -export const appVersionListDbName = 'opendb-app-versions' -// 版本列表默认显示应用Appid -export const defaultDisplayApp = '' - - -/** - * 对比版本号,如需要,请自行修改判断规则 - * 支持比对 ("3.0.0.0.0.1.0.1", "3.0.0.0.0.1") ("3.0.0.1", "3.0") ("3.1.1", "3.1.1.1") 之类的 - * @param {Object} v1 - * @param {Object} v2 - * v1 > v2 return 1 - * v1 < v2 return -1 - * v1 == v2 return 0 - */ -export function compare(v1 = '0', v2 = '0') { - v1 = String(v1).split('.') - v2 = String(v2).split('.') - const minVersionLens = Math.min(v1.length, v2.length); - - let result = 0; - for (let i = 0; i < minVersionLens; i++) { - const curV1 = Number(v1[i]) - const curV2 = Number(v2[i]) - - if (curV1 > curV2) { - result = 1 - break; - } else if (curV1 < curV2) { - result = -1 - break; - } - } - - if (result === 0 && (v1.length !== v2.length)) { - const v1BiggerThenv2 = v1.length > v2.length; - const maxLensVersion = v1BiggerThenv2 ? v1 : v2; - for (let i = minVersionLens; i < maxLensVersion.length; i++) { - const curVersion = Number(maxLensVersion[i]) - if (curVersion > 0) { - v1BiggerThenv2 ? result = 1 : result = -1 - break; - } - } - } - - return result; - } diff --git a/sport-erp-admin/uni_modules/uni-upgrade-center/pages/version/add.vue b/sport-erp-admin/uni_modules/uni-upgrade-center/pages/version/add.vue deleted file mode 100644 index 70efb10..0000000 --- a/sport-erp-admin/uni_modules/uni-upgrade-center/pages/version/add.vue +++ /dev/null @@ -1,436 +0,0 @@ - - - - - diff --git a/sport-erp-admin/uni_modules/uni-upgrade-center/pages/version/detail.vue b/sport-erp-admin/uni_modules/uni-upgrade-center/pages/version/detail.vue deleted file mode 100644 index 28fadeb..0000000 --- a/sport-erp-admin/uni_modules/uni-upgrade-center/pages/version/detail.vue +++ /dev/null @@ -1,404 +0,0 @@ - - - - diff --git a/sport-erp-admin/uni_modules/uni-upgrade-center/pages/version/list.vue b/sport-erp-admin/uni_modules/uni-upgrade-center/pages/version/list.vue deleted file mode 100644 index fbc344e..0000000 --- a/sport-erp-admin/uni_modules/uni-upgrade-center/pages/version/list.vue +++ /dev/null @@ -1,364 +0,0 @@ - - - - diff --git a/sport-erp-admin/uni_modules/uni-upgrade-center/readme.md b/sport-erp-admin/uni_modules/uni-upgrade-center/readme.md deleted file mode 100644 index 46ec891..0000000 --- a/sport-erp-admin/uni_modules/uni-upgrade-center/readme.md +++ /dev/null @@ -1,233 +0,0 @@ -## uni-admin 1.9.3+ 已内置,此插件不再维护 [点击查看文档](https://uniapp.dcloud.net.cn/uniCloud/upgrade-center.html) - -- `uni-admin < 1.9.0`:请前往 [Gitee](https://gitee.com/dcloud/uni-upgrade-center/releases) 下载 `tag v0.4.2` 版本使用 --`1.9.0 <= uni-admin < 1.9.2` :请前往 [Gitee](https://gitee.com/dcloud/uni-upgrade-center/releases) 下载 `tag v0.5.1` 版本使用 -- `uni-admin >= 1.9.3` :uni-admin 已内置 升级中心,直接使用即可 [详情](https://uniapp.dcloud.io/uniCloud/admin.html#app-manager)。并且云函数 `upgrade-center` 废弃,使用 `uni-upgrade-center` 云函数。 - -# uni-upgrade-center - Admin - -### 概述 - -> 统一管理App及App在`Android`、`iOS`平台上`App安装包`和`wgt资源包`的发布升级 - -> 本插件为uni升级中心后台管理系统,客户端检查更新插件请点击查看 [uni-upgrade-center-app](https://ext.dcloud.net.cn/plugin?id=4542) - -### 基于uniCloud的App升级中心,本插件具有如下特征: - - 云端基于uniCloud云函数实现 - - 数据库遵循opendb规范 - - 遵循uni-Admin框架规范,可直接导入uni-admin项目中 - - 支持App整包升级及wgt资源包升级 - -## 升级中心解决了什么问题? - -升级中心是一款uni-admin插件,负责App版本更新业务。包含后台管理界面、更新检查逻辑,App内只要调用弹出提示即可。 - -升级中心有以下功能点: - -- 应用管理,对App的信息记录和应用版本管理 -- 版本管理,可以发布新版,也可方便直观的对当前App历史版本以及线上发行版本进行查看、编辑和删除操作 -- 版本发布信息管理,包括 更新标题,更新内容,版本号,静默更新,强制更新,灵活上线发行 的设置和修改 -- 原生App安装包,发布Apk更新,用于App的整包更新,可设置是否强制更新 -- wgt资源包,发布wgt更新,用于App的热更新,可设置是否强制更新,静默更新 -- App管理列表及App版本记录列表搜索 - -只需导入插件,初始化数据库即可拥有上述功能。 - -您也可以自己修改逻辑自定义数据库字段,和随意定制 UI 样式。 - -## 安装指引 - -1. 使用`HBuilderX 3.1.0+`,因为要使用到`uni_modules` - -2. 使用已有`uniCloud-admin`项目或新建项目:`打开HBuilderX` -> `文件` -> `新建` -> `项目` -> `uni-app` 选择 `uniCloud admin`模板,键入一个名字,确定 - -3. 鼠标右键选择`关联云服务空间`和`运行云服务空间初始化向导` - -3. 在插件市场打开本插件页面,在右侧点击`使用 HBuilderX 导入插件`,选择 `uniCloud admin` 项目点击确定 - -4. 等待下载安装完毕。由于本插件依赖一些uni-ui插件,下载完成后会显示合并插件页面,自行选择即可 - -5. 找到`/uni_modules/uni-upgrade-center/uniCloud/cloudfunctions/upgrade-center`,右键上传部署 - -7. 在`pages.json`中添加页面路径 -```json -//此结构与uniCloud admin中的pages.json结构一致 -{ - "pages": [ - // ……其他页面配置 - { - "path": "uni_modules/uni-upgrade-center/pages/version/list", - "style": { - "navigationBarTitleText": "版本列表" - } - }, { - "path": "uni_modules/uni-upgrade-center/pages/version/add", - "style": { - "navigationBarTitleText": "新版发布" - } - }, { - "path": "uni_modules/uni-upgrade-center/pages/version/detail", - "style": { - "navigationBarTitleText": "版本信息查看" - } - } - ] -} -``` - -8. 在`manifest.json -> 源码视图`中添加以下配置: - ```js - "networkTimeout":{ - "uploadFile":1200000 //ms, 如果不配置,上传大文件可能会超时 - } - ``` - -9. 运行项目到`Chrome` - -10. 添加菜单 - - `vue2` - - 运行起来uniCloud admin,菜单管理模块会自动读取`/uni_modules/uni-upgrade-center/menu.json`文件中的菜单配置,生成【待添加菜单】,选中升级中心,点击`添加选中的菜单`即可 -
- -
- - `vue3` - - 可将 `/uni_modules/uni-upgrade-center/menu.json` 拷贝至 `uniCloud/database/db_init.json` 中的 `opendb-admin-menus` 节点下,并右键初始化数据库即可。 -11. 添加成功后,就可以在左侧的菜单栏中找到`升级中心`菜单 - -
- -
- -12. 在进入`升级中心`之前: - 1. 需要到`uni-admin`的`应用管理`中添加一个应用,才可以在`升级中心`中发布对应应用的版本。 - 2. 当你有多个应用时,可以在`/uni_modules/uni-upgrade-center/pages/utils.js`中修改`defaultDisplayApp`字段来设置默认显示应用的`appid`。 - 3. 如果不设置或设置应用不存在则默认从数据库中查出来的第一个应用。 - -13. 由于插件依赖的uni-ui的一些组件,建议右键`/uni_modules/uni-upgrade-center`安装一下第三方依赖,否则可能会出现一些问题 - -14. 运行在`uniCloud`,由于本插件使用了`clientDB`,因此可能需要配置一下`uni-config-center插件`关于`uni-id`的配置信息。如提示`公用模块uni-id缺少配置信息`请这样做: - 1. 点击[uni-config-center](https://ext.dcloud.net.cn/plugin?id=4425)导入插件 - 2. 在`/uniCloud/cloudfunctions/common/uni-config-center/`下创建`uni-id`文件夹,文件夹内创建`config.json`文件。 - 3. 点击[config.json默认配置](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=start)。将内容拷贝至`config.json`中。**注:一定要把注释去除!** - -## 使用指南 - -### 升级中心 - -#### 应用列表 - -1. 点击菜单 `应用管理`,这里展示你所添加的 App,点击右上角 `新增` 可以新增一个 App - -
- -
- -2. 将App的信息都填写完善后,你可以在列表的操作列进行`修改`应用信息或者`删除`该应用。 - -**Tips** -- 删除应用会把该应用的所有版本记录同时删除 - -#### 版本管理 -1. 在版本管理list的右上角点击`发布新版`,可以发布`原生App安装包`和`wgt资源包`。在左上角点击`下拉列表`,可以切换展示应用。 - -
- -
- -- #### 发布原生App安装包 - 1. 在上传安装包界面填写此次发版信息 - -
- -
- - 2. `包地址` - - 可以选择手动上传一个文件到 `云存储`,会自动将地址填入该项 - - - 也可以手动填写一个地址,就可以不用再上传文件 - - - 如果是发布`苹果`版本,包地址则为 应用在`AppStore的链接` - - 3. `强制更新` - - 如果使用强制更新,App端接收到该字段后,App升级弹出框不可取消 - - 4. `上线发行` - - 可设置当前包是否上线发行,只有已上线才会进行更新检测 - - - 同时只可有一个线上发行版,线上发行不可更设为下线。未上线可以设为上线发行并自动替换当前线上发行版 - - - 修改当前包为上线发行,自动替换当前线上发行版 - - **注:版本号请填写以`.`分隔字符串,例如:`0.0.1`** -- #### 发布wgt资源包 - 1. 大部分配置与发布 `原生App安装包` 一致 - -
- -
- - 2. `原生App最低版本` - - 上次使用新Api或打包新模块的App版本 - - - 如果此次打包wgt使用了`新的api`或者打包了`新的模块`,则在发布 `wgt资源包` 的时候,将此版本更新为本次版本 - - - 如果已有正式版`wgt资源包`,则本次新增会自动带出 - - 2. `静默更新` - - App升级时会在后台下载wgt包并自行安装。新功能在下次启动App时生效 - - **静默更新后不重启应用,可能会导致正在访问的应用的页面数据错乱,请谨慎使用!** - - **注:版本号请填写以`.`分隔字符串,例如:`0.0.1`** - -- #### 发布完成页面 - -
- -
- -**Tips** - -1. `pages/system/upgradecenter/version/add.vue`中有版本对比函数(compare)。 - - 使用多段式版本格式(如:"3.0.0.0.0.1.0.1", "3.0.0.0.0.1")。如果不满足对比规则,请自行修改。 - -## 项目代码说明 - -### uniCloud 数据表 - -数据表基于 [openDB](https://gitee.com/dcloud/opendb/tree/master) 规范,它约定了一个标准用户表的表名和字段定义,并且基于 nosql 的特性,可以由开发者自行扩展字段。 - -本项目用到了 2 个表: - -- opendb-app-list:app管理列表。记录应用的 appid、name、description 用于展示。[详见](https://gitee.com/dcloud/opendb/tree/master/collection/opendb-app-list) -- opendb-app-versions:应用版本管理表。记录管理应用的版本信息。[详见](https://gitee.com/dcloud/opendb/tree/master/collection/opendb-app-versions) - -### 前端页面 - -点击`升级中心`,会进入应用管理列表,在这里你可以新增应用,或者在`应用详情`中查看、修改或删除一个已经录入的应用。 - -在应用管理列表中点击某个应用的`版本管理`,进入该应用的所有版本记录。列表排序为:先排序已上线版本,剩下已下线版本根据创建时间排列。 - -在应用版本列表中点击`详情`,即可进入该版本的信息详情中查看、修改或删除该记录。 - -**Tips** -- 升级中心设计之初就支持iOS的wgt更新 -- iOS的wgt更新肯定是违反apple政策的,注意事项: - - 审核期间请不要弹窗升级 - - 升级完后尽量不要自行重启 - - 尽量使用静默更新 -- 可以通过以下修改支持iOS的wgt更新: - > \uni_modules\uni-upgrade-center\pages\mixin\version_add_detail_mixin.js - > - > 将 `data` 中的 `enableiOSWgt: false` 中 改为 `enableiOSWgt: true` - -**常见问题** -- 以下问题可以通过升级插件版本解决: - - createdate不与默认值匹配 - - ["create_date"]在数据库中并不存在 - - 提交的字段["dirty_data"]在数据库中并不存在 - - 集合[opendb-app-list]对应的schema内存在错误,详细信息:opendb-app-list表对应的schema名称冲突,这是什么意思呢 - -- 没有/找不到 [opendb-app-list] 集合/表。**解决方案:**升级 admin 至 1.6.0+ 即可 -- 测试时发布了高版本的包,测试完了发布包提示需要大于版本号 (x.x.x)。**解决方案:**直接在控制台修改数据库 \ No newline at end of file diff --git a/sport-erp-admin/vue.config.js b/sport-erp-admin/vue.config.js deleted file mode 100644 index 5e35df0..0000000 --- a/sport-erp-admin/vue.config.js +++ /dev/null @@ -1,28 +0,0 @@ -const ignored = ['**/uni_modules/**/*.md', '**/uni_modules/**/package.json', '**/uni_modules/*/uniCloud/**/*', '**/.git'] -module.exports = { - chainWebpack: (config) => { - // 发行或运行时启用了压缩时会生效 - config.optimization.minimizer('terser').tap((args) => { - const compress = args[0].terserOptions.compress - // 非 App 平台移除 console 代码(包含所有 console 方法,如 log,debug,info...) - compress.drop_console = true - compress.pure_funcs = [ - '__f__', // App 平台 vue 移除日志代码 - // 'console.debug' // 可移除指定的 console 方法 - ] - return args - }) - }, - configureWebpack() { - return { - watchOptions: { - ignored - }, - devServer: { - watchOptions: { - ignored - } - } - } - } -} diff --git a/sport-erp-admin/windows/components/error-log.vue b/sport-erp-admin/windows/components/error-log.vue deleted file mode 100644 index 68b5cd3..0000000 --- a/sport-erp-admin/windows/components/error-log.vue +++ /dev/null @@ -1,62 +0,0 @@ - - - - - diff --git a/sport-erp-admin/windows/leftWindow.vue b/sport-erp-admin/windows/leftWindow.vue deleted file mode 100644 index e021063..0000000 --- a/sport-erp-admin/windows/leftWindow.vue +++ /dev/null @@ -1,130 +0,0 @@ - - - - - diff --git a/sport-erp-admin/windows/topWindow.vue b/sport-erp-admin/windows/topWindow.vue deleted file mode 100644 index 3e70062..0000000 --- a/sport-erp-admin/windows/topWindow.vue +++ /dev/null @@ -1,621 +0,0 @@ - - - - - diff --git a/业务进度管理.md b/业务进度管理.md index 4371cce..3d9a38d 100644 --- a/业务进度管理.md +++ b/业务进度管理.md @@ -1,94 +1,422 @@ -# 涓氬姟杩涘害绠$悊 +# 业务进度管理 -> 鏈枃浠剁敤浜庤窡韪?Sport Era 椤圭洰鎵€鏈夊姛鑳芥ā鍧楃殑寮€鍙戠姸鎬併€佸緟鍔炰簨椤逛笌閬垮潙璁板綍銆傛瘡瀹屾垚涓€涓姛鑳芥垨鍙戠幇涓€涓潙锛屽強鏃跺湪瀵瑰簲绔犺妭杩藉姞銆? -## 鐩綍 +> 本文档用于跟踪 Sport Era 项目所有功能模块的开发状态、待办事项与避坑记录。每完成一个功能或发现一个坑,及时在对应章节追加。 -- [涓€銆佸凡瀹屾垚浜嬮」](#涓€宸插畬鎴愪簨椤? -- [浜屻€佽繘琛屼腑浜嬮」](#浜岃繘琛屼腑浜嬮」) -- [涓夈€佸緟鍔炰簨椤筣(#涓夊緟鍔炰簨椤? -- [鍥涖€侀伩鍧戣褰昡(#鍥涢伩鍧戣褰? +## 目录 + +- [一、已完成事项](#一已完成事项) +- [二、进行中事项](#二进行中事项) +- [三、待办事项](#三待办事项) +- [四、避坑记录](#四避坑记录) --- -## 涓€銆佸凡瀹屾垚浜嬮」 +## 一、已完成事项 -### 1. 椤圭洰鍩虹鏂囨。涓庡崗浣滃崗璁? -- 鐘舵€侊細宸插畬鎴?- 鏃堕棿锛?026-05-07 +### 25. 社区帖子 RAG 生成模型切换到 Qwen3.7 -瀹屾垚鍐呭锛? -- 鍒涘缓鏍圭洰褰?`AGENTS.md`锛岃褰曢」鐩妧鏈爤銆佸瓙妯″潡鍒嗗伐銆佹暟鎹簱鍩哄噯涓庡崗浣滆鑼冦€?- 鍒涘缓 `server/AGENTS.md`銆乣admin/AGENTS.md`銆乣uniapp/AGENTS.md`銆乣pc/AGENTS.md`銆乣qa/AGENTS.md`銆?- 鍒涘缓 `涓氬姟杩涘害绠$悊.md` 鍜?`璁捐绋挎槧灏?md`锛屼綔涓哄悗缁繘搴︿笌璁捐绋挎槧灏勭淮鎶ゅ叆鍙c€? -娑夊強妯″潡锛? +- 状态:已完成 - 时间:2026-06-10 + +完成内容: +- 排查 `/api/community/aiAnalysis` 仍返回 `DeepSeek 返回异常: Insufficient Balance` 的原因,确认图片识别已走 DashScope Qwen,但帖子 RAG 最终 JSON 生成仍复用默认 DeepSeek 配置。 +- 已将 `KbRagService::analyzePost()` 的最终生成阶段改为 DashScope OpenAI 兼容接口,模型固定为 `qwen3.7-plus`,使用 `server/.env` 的 `DASHSCOPE_API_KEY`。 +- `DeepSeekClient` 作为 OpenAI 兼容 HTTP 客户端保留,但现在会按调用方传入的 `provider_label` 返回错误提示;帖子分析失败时将显示 `DashScope(Qwen)`,不再误导为 DeepSeek。 +- `AiService::saveResult()` 已改为记录下游返回的真实模型名,帖子 AI 日志会写入 `qwen3.7-plus`。 + +涉及模块: +- `server/app/common/service/ai/KbRagService.php` +- `server/app/common/service/ai/DeepSeekClient.php` +- `server/app/common/service/ai/AiService.php` + +### 24. 社区帖子 AI 分析改为统一分析页并显示分析计时 + +- 状态:已完成 - 时间:2026-06-10 + +完成内容: +- 社区列表页与首页社区流中的六合彩帖子 `AI分析` 入口已改为直接跳转统一分析页 `/pages/ai_analysis/ai_analysis?type=post&id=...`,不再先进帖子详情页再等待页内分析。 +- 帖子详情页中的 `AI分析` 按钮也已切换为直接跳统一分析页;旧的 `show_ai=1` 链路改为兼容重定向,避免历史入口失效。 +- 统一分析页已新增 `post` 类型支持,接入 `/api/community/aiAnalysis`,并展示帖子卡片、综合结论、下期预测、可信线索、风险提示、相似历史和知识库证据。 +- AI 分析加载阶段新增“分析用时 `0m1s`”计时显示;赛事分段分析的后续阶段 loading 也会继续显示累计分析时长,避免长耗时场景下用户无感等待。 + +涉及模块: +- `uniapp/src/pages/ai_analysis/ai_analysis.vue` +- `uniapp/src/packages_community/pages/post_detail.vue` +- `uniapp/src/packages_community/pages/index.vue` +- `uniapp/src/pages/empty/empty.vue` + +### 23. 六合图片分析升级到 Qwen3.7 并移除代码内密钥 + +- 状态:已完成 - 时间:2026-06-10 + +完成内容: +- `AiService::analyzeLotteryPostImages()` 已将 DashScope 视觉模型从旧版 `qwen-vl-max-latest` 切换为新版统一多模态模型 `qwen3.7-plus`,继续沿用 OpenAI 兼容接口 `https://dashscope.aliyuncs.com/compatible-mode`。 +- 移除了 `AiService` 中硬编码的 DashScope API Key,改为统一从 `server/.env` 的 `DASHSCOPE_API_KEY` 读取,避免密钥继续直接写入代码文件。 +- 同步补充 `server/.example.env` 的 DashScope Key 占位配置,便于后续环境初始化和部署时对齐。 + +涉及模块: +- `server/app/common/service/ai/AiService.php` +- `server/.env` +- `server/.example.env` + +### 22. 六合图片分析 404 链路修复 + +- 状态:已完成 - 时间:2026-06-09 + +完成内容: +- 排查 `/api/community/translatePost` 在 `旧澳六合/新澳六合` 图片分析分支返回 `HTTP 404` 的问题,确认不是帖子不存在,而是 Qwen 视觉模型请求地址被拼成了 `.../v1/v1/chat/completions`。 +- 已将 `AiService` 中 DashScope 兼容接口基地址收敛为 `https://dashscope.aliyuncs.com/compatible-mode`,并在 `DeepSeekClient` 中补充聊天接口地址规范化,兼容 `base_url` 传入根地址、`/v1` 地址或完整 `/chat/completions` 地址,避免后续再次重复拼接。 +- 同步把多模型错误提示统一改为带 provider 名称返回,后续如果 DashScope/Qwen 鉴权或模型权限异常,接口会更容易直接看出来自哪个下游。 + +涉及模块: +- `server/app/common/service/ai/AiService.php` +- `server/app/common/service/ai/DeepSeekClient.php` + +### 21. 六合图片分析切换到 DashScope Qwen 视觉模型 + +- 状态:已完成 - 时间:2026-06-09 + +完成内容: +- `AiService::analyzeLotteryPostImages()` 已按当前需求固定改为调用阿里云 DashScope OpenAI 兼容接口,不再读取后台 `lottery_image_analysis_*` 或 `deepseek_vision_model` 配置。 +- 当前六合彩图片分析分支硬编码使用 `Qwen` 视觉模型 `qwen-vl-max-latest`,兼容接口基地址统一为 `https://dashscope.aliyuncs.com/compatible-mode`,由客户端自动补齐聊天接口路径,并使用指定的 DashScope API Key。 +- 错误提示中的 provider 标识已改为 `DashScope(Qwen)`,方便后续定位图片分析失败是否来自 Qwen 视觉链路。 +- 同步收紧图片分析提示词,新增“先过滤噪音再逐项分析”的规则,只保留当期号码、图表结论、推荐组合等有效信息,忽略水印、口号、装饰边框、重复标题和低置信度杂讯。 + +涉及模块: +- `server/app/common/service/ai/AiService.php` + +### 20. 六合帖子 `translatePost` 收紧为纯图片分析 + +- 状态:已完成 - 时间:2026-06-09 + +完成内容: +- `/api/community/translatePost` 对 `新澳六合 / 旧澳六合` 已改为只走当前帖子图片分析,不再接受旧版六合彩分析缓存直接命中。 +- 新增 `lottery_analysis_source=image_only` 与 `lottery_analysis_images_hash` 标记,只有明确由当前帖子图片生成的分析结果才会复用;旧缓存或图片已变更时会重新按图片分析。 +- 移除了六合彩图片分析失败时写入“虚拟历史分析文案”的兜底逻辑,当前图片无法识别时接口会直接返回失败,避免返回看似真实、实则并非基于当前图片的内容。 +- 同步收紧图片分析提示词,明确禁止引用往期内容、历史期数、知识库信息或模型记忆;社区列表侧也只展示 `image_only` 来源的六合彩分析结果。 + +涉及模块: +- `server/app/api/controller/CommunityController.php` +- `server/app/api/lists/community/CommunityPostLists.php` +- `server/app/common/service/ai/AiService.php` + +### 19. 社区帖子分支链路收紧为“普通/特朗普/六合”三类 + +- 状态:已完成 - 时间:2026-06-09 + +完成内容: +- 重新梳理社区帖子链路后,已将普通帖子、特朗普帖子、`新澳六合/旧澳六合` 帖子的入口分支彻底拆开:普通帖子不再显示或触发 AI 分析;特朗普帖子只保留本地 `MTranServer` 翻译链路;六合帖子才显示 AI 入口。 +- `post-card`、`/pages/empty/empty`、社区分包列表页、帖子详情页已统一按 `旧澳六合/新澳六合` 标签控制 `AI` 按钮和 `show_ai=1` 跳转,避免普通帖误入 `/api/community/aiAnalysis`。 +- 后端 `CommunityController::aiAnalysis()` 已改为只接受六合帖,并在进入知识库分析前先确保 `lottery_analysis_content` 已由视觉模型完成图片识别;`translatePost()` 的彩票图片分析分支也同步从泛 `彩票` 收紧为 `a6/xa6`。 +- `KbRagService::analyzePost()` 与 `AiService::analyzePost()` 已补强:当前帖子本身只要识别为 `a6/xa6` 就稳定输出 `next_prediction`,并跳过缺少预测字段的旧缓存,避免仍回落到历史错误结果。 + +涉及模块: +- `uniapp/src/pages/empty/empty.vue` +- `uniapp/src/packages_community/pages/index.vue` +- `uniapp/src/packages_community/components/post-card.vue` +- `uniapp/src/packages_community/pages/post_detail.vue` +- `server/app/api/controller/CommunityController.php` +- `server/app/api/lists/community/CommunityPostLists.php` +- `server/app/common/service/ai/AiService.php` +- `server/app/common/service/ai/KbRagService.php` + +### 18. 世界杯资讯与特朗普帖子翻译切换 GPT-4o + +- 状态:已完成 - 时间:2026-06-09 + +完成内容: +- 世界杯资讯翻译链路已改为按文章分类识别:当资讯属于“世界杯”分类时,`ArticleLogic::translate()` 与 `autoTranslateArticle()` 会优先走 `GPT-4o` 翻译,不影响其他资讯仍沿用原有翻译模型。 +- 特朗普帖子翻译链路已改为按帖子标签识别:社区列表自动预热、帖子详情自动补翻译、`/api/community/translatePost` 手动翻译这 3 条路径,命中“特朗普”标签时统一走 `GPT-4o`。 +- 在 AI 配置层新增 `openai_api_key / openai_base_url / openai_translation_model` 约定,并补充幂等 SQL `docs/sql/insert_ai_translation_gpt4o_config.sql`;后台知识库配置列表已放开 `openai_%` 配置项,便于直接维护 `GPT-4o` 翻译参数。 +- 同步把 OpenAI 兼容翻译调用的错误文案改成按 provider 显示,避免 `GPT-4o` 未配置时仍提示成 `DeepSeek API Key未配置`。 + +涉及模块: +- `server/app/common/service/ai/DeepSeekClient.php` +- `server/app/common/service/ai/AiService.php` +- `server/app/api/logic/ArticleLogic.php` +- `server/app/api/controller/CommunityController.php` +- `server/app/api/lists/community/CommunityPostLists.php` +- `server/app/adminapi/lists/ai/KbConfigLists.php` +- `docs/sql/insert_ai_translation_gpt4o_config.sql` + +### 17. 定时任务企业微信告警接入 + +- 状态:已完成 - 时间:2026-06-08 + +完成内容: +- 为 crawler 本地配置增加 `alert.dispatch_enabled / alert.wecom_webhook / alert.cooldown_seconds`,企业微信告警改走固定群机器人 Webhook,本地维护,不做后台配置页。 +- 新增统一告警表 `la_crontab_alert`,并在 Python `Database` 与 PHP `CrontabAlertService` 中同时补上建表与读写逻辑,支持告警创建、30 分钟冷却、成功恢复后自动关闭。 +- `main.py` 已增加 `TASK_ALERT_POLICY` 与标准化运行摘要;已启用的 `crawler` 任务按“采集型 saved_required / 维护型 saved_if_candidates / error_report 跳过自告警”规则统一落库告警。 +- `ErrorCollector` 已扩展为记录单次运行的 `404 / 5xx / 网络异常` 统计;`error_report` 任务已改为读取 `la_crontab_alert` 并尝试分发企业微信消息。 +- 非 `crawler` 的 PHP 定时任务(如 `sms_verify`、`worldcup_article_translate`)已通过 `Crontab.php` 接入同一张告警表,仅在执行异常时产生 `command_exception` 告警。 +- 已新增幂等 SQL `server/public/dongqiudi-crawler/update_crontab_error_report.sql`,并已把测试服现有 `error_report` 任务频率从 `*/5 * * * *` 调整为 `*/1 * * * *`。 + +涉及模块: +- `server/public/dongqiudi-crawler/config/settings.yaml` +- `server/public/dongqiudi-crawler/main.py` +- `server/public/dongqiudi-crawler/src/core/error_collector.py` +- `server/public/dongqiudi-crawler/src/core/alert_manager.py` +- `server/public/dongqiudi-crawler/src/storage/database.py` +- `server/public/dongqiudi-crawler/src/scheduler/task_runner.py` +- `server/app/common/command/Crontab.php` +- `server/app/common/service/crontab/CrontabAlertService.php` +- `server/public/dongqiudi-crawler/update_crontab_error_report.sql` + +### 16. 资讯无正文默认稿子并禁止发布 + +- 状态:已完成 - 时间:2026-06-07 + +完成内容: +- 为爬虫侧新增 `article_publish_helper.py`,统一判断资讯正文是否达到可发布标准;没有拉到正文、只有 RSS 摘要或占位文本的文章,采集入库时默认写成稿子状态(`is_show=0`)。 +- `article_fetcher.py` 已调整为优先处理稿子状态或正文明显不足的资讯;抓到真实正文后会自动写回 `content`,同时将文章切回发布状态并重置 `content_retry`。 +- `nba_news.py`、`cba_news.py`、`crypto_news.py`、`lottery_news.py`、`hkjc_lottery_news.py`、`taiwan_lottery_news.py`、`fifa_worldcup_news.py` 已统一接入该规则,避免后续新采文章在正文未完成时直接暴露到前台。 +- 后台 `ArticleLogic` / `ArticleController` 已增加发布拦截:手动新增、编辑或切换状态时,如果正文未达到发布标准,会直接返回“暂不能发布,请先保存为稿子”。 +- 已在测试服先行回退当前可见的 NBA / CBA 占位稿:示例 `1903906`、`1915226` 的公开详情现已返回空数据,不再继续对前台暴露无正文资讯。 + +涉及模块: +- `server/public/dongqiudi-crawler/article_publish_helper.py` +- `server/public/dongqiudi-crawler/article_fetcher.py` +- `server/public/dongqiudi-crawler/nba_news.py` +- `server/public/dongqiudi-crawler/cba_news.py` +- `server/public/dongqiudi-crawler/crypto_news.py` +- `server/public/dongqiudi-crawler/lottery_news.py` +- `server/public/dongqiudi-crawler/hkjc_lottery_news.py` +- `server/public/dongqiudi-crawler/taiwan_lottery_news.py` +- `server/public/dongqiudi-crawler/fifa_worldcup_news.py` +- `server/app/common/model/article/Article.php` +- `server/app/adminapi/logic/article/ArticleLogic.php` +- `server/app/adminapi/controller/article/ArticleController.php` + +### 15. NBA / CBA 资讯正文抓取补回退链路 + +- 状态:已完成 - 时间:2026-06-07 + +完成内容: +- 继续排查发现,NBA / CBA 资讯列表入库后,详情正文并不是完全没跑,而是由 `article_content_fetch` 每轮按分类各抓 `3` 条慢慢补;因此刚采集完的一大批文章会先以 RSS 摘要占位,随后逐轮补正文。 +- 测试服执行日志确认 `article_content_fetch` 一直在跑,但部分 Google News 解码后的真实地址(如 `m.sohu.com`、`sports.sina.cn`、`sports.cctv.com`)在 `scrapling Fetcher` 路径下会返回 `HTTP 403`,导致正文抓取失败并累计 `content_retry`。 +- 已为 `server/public/dongqiudi-crawler/article_fetcher.py` 增加 `requests + BeautifulSoup` 回退抓取链路:当 `scrapling` 返回 `403` 或抛异常时,改用普通请求抓页面并复用同一套正文抽取规则,降低这类站点的正文缺失率。 +- 同步补充 `server/public/dongqiudi-crawler/requirements.txt` 的 `beautifulsoup4` 依赖声明,避免后续环境重装时漏掉回退解析库。 + +涉及模块: +- `server/public/dongqiudi-crawler/article_fetcher.py` +- `server/public/dongqiudi-crawler/requirements.txt` + +### 14. NBA / CBA 资讯定时任务补注册与恢复拉取 + +- 状态:已完成 - 时间:2026-06-07 + +完成内容: +- 排查发现 `server/public/dongqiudi-crawler/main.py`、`nba_news.py`、`cba_news.py` 代码入口都已存在,`article_content_fetch` 也已覆盖 `cid=17/18` 的正文补全,但测试服 `la_dev_crontab` 中缺少 `nba_news`、`cba_news` 两个定时任务,所以后台从未自动触发 NBA / CBA 资讯采集。 +- 已补充幂等 SQL `insert_crontab_nba_news.sql`、`insert_crontab_cba_news.sql`,分别注册 `crawler nba_news` 和 `crawler cba_news`。 +- 已在测试服后台实际创建两条任务,当前执行规则分别为 `10 * * * *`(NBA)和 `20 * * * *`(CBA),状态均为“运行”。 +- 已手动验证一次:NBA 任务成功抓取 100 条,新增 99 条;CBA 任务成功抓取 169 条,新增 152 条。 +- 已继续验证正文抓取链路:`article_content_fetch` 在 2026-06-07 00:50 自动处理了新入库的 NBA / CBA 文章,成功补全 4 篇正文;另有 2 篇源站返回 HTTP 403,已按现有 `content_retry` 机制记录重试。 + +涉及模块: +- `server/public/dongqiudi-crawler/main.py` +- `server/public/dongqiudi-crawler/nba_news.py` +- `server/public/dongqiudi-crawler/cba_news.py` +- `server/public/dongqiudi-crawler/article_fetcher.py` +- `server/public/dongqiudi-crawler/insert_crontab_nba_news.sql` +- `server/public/dongqiudi-crawler/insert_crontab_cba_news.sql` + +### 13. 赛事 AI 分段分析接入知识库召回 + +- 状态:已完成 - 时间:2026-06-06 + +完成内容: +- 排查发现 `/api/ai/matchPredictSection` 原链路只会组装 `match_info / head_to_head / home_recent / away_recent` 后直接调用 `DeepSeekClient::chatJson()`,并不会进入知识库检索层。 +- 现已为赛事分析补充 `KbRagService::analyzeMatch()` 与 `analyzeMatchSection()`,先根据主队、客队、联赛名到知识库中召回相关资讯/帖子,再把召回证据与结构化交手记录、近期战绩、赔率一起交给 LLM。 +- `AiService::predictMatch()` 与 `predictMatchSection()` 已切换到赛事专用 RAG 链路,返回结果增加 `evidence_list / similar_history / from_kb / retrieval_meta` 等知识库增强字段。 +- 为避免旧的赛事分段缓存继续短路新链路,当前逻辑只接受带知识库字段痕迹的新缓存;老缓存会自动跳过并重新走 RAG 生成。 +- 当前赛事 RAG 仍未把 `match_event / match_history / match_recent` 建成独立知识库 domain,交手记录和近期战绩继续直接从业务表读取;知识库侧主要召回相关资讯与帖子。 + +涉及模块: +- `server/app/common/service/ai/AiService.php` +- `server/app/common/service/ai/KbRagService.php` +- `server/app/common/service/ai/KbService.php` +- `server/app/api/controller/AiController.php` + +### 12. 全站 AI 知识库与 RAG 分析底座 + +- 状态:已完成 - 时间:2026-06-06 + +完成内容: +- 新增 AI 知识库底座表设计与 SQL:`la_ai_kb_document`、`la_ai_kb_chunk`、`la_ai_kb_sync_job`、`la_ai_kb_query_log`,并补充知识库菜单与 Embedding / KB 配置初始化 SQL。 +- 后端新增 `KbService / KbSyncService / EmbeddingClient / KbRagService`,支持资讯、帖子、彩票历史内容统一建档、切片、Embedding、全文候选、向量重排、规则混排和查询日志记录。 +- 新增控制台命令 `php think kb:rebuild` 与 `php think kb:consume`,支持全量回填与增量消费;文章新增/编辑/上下架、帖子发布/删除/翻译缓存更新已接入同步任务队列,彩票历史通过消费命令补录扫描。 +- 现有 `AiService` 已接入知识库增强分析:资讯分析、彩票总分析、彩票分模块分析统一增加 `from_kb / evidence_list / similar_history / retrieval_meta`;新增帖子专属接口 `GET /api/community/aiAnalysis?post_id={id}`。 +- 管理后台新增知识库配置、知识文档、同步任务、查询日志页面与对应 API,且扩展了 AI 分析记录 / AI 日志类型展示。 +- 新增 `qa/backend/test_kb_article_analysis.py` 与 `qa/backend/test_kb_post_analysis.py` 作为知识库增强接口的最小冒烟脚本。 + +涉及模块: +- `server/app/common/model/ai/*` +- `server/app/common/service/ai/*` +- `server/app/common/command/KbRebuild.php` +- `server/app/common/command/KbConsume.php` +- `server/app/api/controller/CommunityController.php` +- `server/app/common/service/ai/AiService.php` +- `server/app/adminapi/controller/ai/*` +- `admin/src/views/ai/*` +- `docs/sql/create_ai_kb_tables.sql` +- `docs/sql/insert_ai_kb_config.sql` +- `docs/sql/insert_menu_ai_kb.sql` +- `qa/backend/test_kb_article_analysis.py` +- `qa/backend/test_kb_post_analysis.py` + +### 11. 彩票资讯远程图片代理中转 + +- 状态:已完成 - 时间:2026-06-03 + +完成内容: +- 为前台资讯接口补充 `ArticleImageProxyService`,对白名单内的香港赛马会与台湾彩券远程图片生成站内代理地址。 +- 新增公开接口 `/api/article/imageProxy`,由服务器代拉 `res.hkjc.com`、`cdn.taiwanlottery.com.tw` 等远程图片并回传,规避国内客户端无法直连的问题。 +- `ArticleLogic::detail()` 与 `ArticleLists::lists()` 已统一接入代理改写,老文章无需重采即可让详情正文图片和列表封面图走服务器中转。 +- 代理按 `ext.source` 白名单控制,仅对 `hkjc_racingnews`、`taiwan_lottery` 两类彩票资讯生效,降低 SSRF 风险。 + +涉及模块: +- `server/app/common/service/article/ArticleImageProxyService.php` +- `server/app/api/controller/ArticleController.php` +- `server/app/api/logic/ArticleLogic.php` +- `server/app/api/lists/article/ArticleLists.php` + +### 1. 项目基础文档与协作协议 +- 状态:已完成 - 时间:2026-05-07 + +完成内容: +- 创建根目录 `AGENTS.md`,记录项目技术栈、子模块分工、数据库基准与协作规范。 +- 创建 `server/AGENTS.md`、`admin/AGENTS.md`、`uniapp/AGENTS.md`、`pc/AGENTS.md`、`qa/AGENTS.md`。 +- 创建 `业务进度管理.md` 和 `设计稿映射.md`,作为后续进度与设计稿映射维护入口。 +涉及模块: - `AGENTS.md` - `server/AGENTS.md` - `admin/AGENTS.md` - `uniapp/AGENTS.md` - `pc/AGENTS.md` - `qa/AGENTS.md` -- `涓氬姟杩涘害绠$悊.md` -- `璁捐绋挎槧灏?md` +- `业务进度管理.md` +- `设计稿映射.md` -### 2. 鏂伴椈鐖櫕鏂囩珷鍏ュ簱鍘婚噸 +### 2. 新闻爬虫文章入库去重 -- 鐘舵€侊細宸插畬鎴?- 鏃堕棿锛?026-05-09 +- 状态:已完成 - 时间:2026-05-09 -瀹屾垚鍐呭锛? -- 鍦ㄦ噦鐞冨笣鐖櫕鍏叡鍏ュ簱鏂规硶 `upsert_articles` 涓鍔犲悓鍒嗙被鏍囬鍘婚噸锛岄樆姝笉鍚?`article_id` 鐨勫悓鏍囬鏂囩珷閲嶅鍐欏叆銆?- 鏂伴椈鍜岃棰戦噰闆嗕换鍔℃寜宸茬煡棰戦亾浼犲叆瀵瑰簲鏂囩珷鍒嗙被 `cid`锛屽噺灏戞柊澧?`cid=0` 鏁版嵁銆?- 瀵瑰凡瀛樺湪 `article_id` 涓旀棫鍒嗙被涓?`cid=0` 鐨勬暟鎹紝鍚庣画甯︽纭垎绫诲啀娆″叆搴撴椂鍙縼绉诲埌姝g‘鍒嗙被銆? -娑夊強妯″潡锛? +完成内容: +- 在懂球帝爬虫公共入库方法 `upsert_articles` 中增加同分类标题去重,阻止不同 `article_id` 的同标题文章重复写入。 +- 新闻和视频采集任务按已知频道传入对应文章分类 `cid`,减少新增 `cid=0` 数据。 +- 对已存在 `article_id` 且旧分类为 `cid=0` 的数据,后续带正确分类再次入库时可迁移到正确分类。 +涉及模块: - `server/public/dongqiudi-crawler/src/storage/database.py` - `server/public/dongqiudi-crawler/src/scheduler/task_runner.py` -### 3. Truth Social 瀹氭椂浠诲姟鍏ュ彛鏁寸悊 +### 3. Truth Social 定时任务入口整理 -- 鐘舵€侊細宸插畬鎴?- 鏃堕棿锛?026-05-09 +- 状态:已完成 - 时间:2026-05-09 -瀹屾垚鍐呭锛? -- 鍚庡彴瀹氭椂浠诲姟 `truth_social` 鏀逛负鎵ц `public/dongqiudi-crawler/main.py truth_social`銆?- 绉婚櫎鏃х殑 `server/public/truth-social` 鐙珛閲囬泦鐩綍锛岄伩鍏嶇户缁淮鎶や袱濂楃壒鏈楁櫘娑堟伅閲囬泦浠g爜銆? -娑夊強妯″潡锛? +完成内容: +- 后台定时任务 `truth_social` 改为执行 `public/dongqiudi-crawler/main.py truth_social`。 +- 移除旧的 `server/public/truth-social` 独立采集目录,避免继续维护两套特朗普消息采集代码。 +涉及模块: - `server/app/adminapi/logic/crontab/CrontabLogic.php` - `server/public/dongqiudi-crawler/truth_social.py` -### 4. 49瀹濆吀褰╃エ绀惧尯鐖櫕鎺ュ叆 +### 4. 49宝典彩票社区爬虫接入 -- 鐘舵€侊細宸插畬鎴?- 鏃堕棿锛?026-05-11 +- 状态:已完成 - 时间:2026-05-11 -瀹屾垚鍐呭锛? -- 鏂板 `lottery_community` 鐖櫕鍏ュ彛锛屾媺鍙?49瀹濆吀棣栭〉 Astro props 鏁版嵁骞惰В鏋愬紑濂栦笌鍥惧簱璧勬枡銆?- 鑷姩鍒涘缓鎴栧鐢ㄧぞ鍖烘爣绛?`褰╃エ`锛岃嚜鍔ㄥ垱寤烘垨澶嶇敤鍙戝竷鐢ㄦ埛 `lottery_publisher`銆?- 鎸?`origin_id` 瀵瑰僵绁ㄧぞ鍖哄笘瀛愬仛骞傜瓑鏂板/鏇存柊锛屽苟鍚屾甯栧瓙鍥剧墖鍜屾爣绛惧叧鑱斻€?- 鎺ュ叆 ThinkPHP `crawler` 鍛戒护鐧藉悕鍗曞拰 Python 涓诲叆鍙e懡浠ゆ槧灏勩€?- 鎻愪緵骞傜瓑 SQL 娉ㄥ唽瀹氭椂浠诲姟 `crawler lottery_community`銆?- 淇 49瀹濆吀鍝嶅簲涓枃瑙g爜鍜屽浘搴撳浘鐗囧煙鍚嶈鍒欙紝`prod/` 鍥剧墖璧勬簮鏀圭敤鍙洿鎺ヨ闂殑 `tk2cdn-ali.tprswe.com`銆? -娑夊強妯″潡锛? +完成内容: +- 新增 `lottery_community` 爬虫入口,拉取 49宝典首页 Astro props 数据并解析开奖与图库资料。 +- 自动创建或复用社区标签 `彩票`,自动创建或复用发布用户 `lottery_publisher`。 +- 按 `origin_id` 对彩票社区帖子做幂等新增/更新,并同步帖子图片和标签关联。 +- 接入 ThinkPHP `crawler` 命令白名单和 Python 主入口命令映射。 +- 提供幂等 SQL 注册定时任务 `crawler lottery_community`。 +- 修复 49宝典响应中文解码和图库图片域名规则,`prod/` 图片资源改用可直接访问的 `tk2cdn-ali.tprswe.com`。 +涉及模块: - `server/public/dongqiudi-crawler/lottery_community.py` + +### 10. 彩票 AI 趋势分析坏缓存容错 + +- 状态:已完成 - 时间:2026-06-03 + +完成内容: +- 排查 `/api/lottery/aiTrend?code=XOMLHC` 时发现,当前问题不是彩种不存在,也不是当前 DeepSeek key 鉴权失败,而是命中了 `la_ai_analysis` 中一条 `type=4` 的成功缓存,但该缓存 `result` 实际是 JSON 字符串 `\"\"`,`json_decode(..., true)` 后得到的是字符串而不是数组。 +- `server/app/common/service/ai/AiService.php` 的 `analyzeLotteryModule()` 已补充防守:彩票 AI 模块缓存只有在解码后为非空数组时才视为有效;若模型返回的 `parsed` 不是数组或为空,也不再写入“成功缓存”,而是按格式异常处理。 +- 这样可以避免旧的坏缓存继续让 `LotteryController::aiTrend()`、`aiHotCold()`、`aiStats()`、`aiColorZodiac()` 走到 `$this->data(string)` 并触发类型错误。 + +涉及模块: +- `server/app/common/service/ai/AiService.php` + +### 9. 世界杯资讯翻译预热限制为列表前 50 条 + +- 状态:已完成 - 时间:2026-06-03 + +完成内容: +- 调整 `server/app/common/command/WorldcupArticleTranslate.php`,世界杯英文资讯翻译预热不再全量扫描全部文章。 +- 预热范围改为按前台资讯列表同口径排序:`published_at desc, id desc`,仅处理用户当前最先看到的前 50 条世界杯资讯。 +- 这样可以在 AI key 恢复后优先补齐前台首屏和专题页最靠前文章的翻译缓存,避免一次性处理历史文章拖慢恢复。 + +涉及模块: +- `server/app/common/command/WorldcupArticleTranslate.php` + +### 9. 世界杯比赛详情接口默认直播链接 + +- 状态:已完成 - 时间:2026-06-03 + +完成内容: +- `server/app/api/controller/MatchController.php` 在前台 `/api/match/detail` 接口中为世界杯比赛补充默认直播链接。 +- 当赛事 `league_name=世界杯` 或 `competition_id=61` 且数据库 `live_url` 为空时,接口响应中的 `live_url` 默认返回 `https://sports.cctv.com/?spm=C28340.P9mj1V5B06xk.E2XVQsMhlk44.7`。 +- 默认值仅在接口响应层兜底,不写回数据库;后台已维护的 `live_url` 仍优先返回,用户端继续只消费接口返回字段。 + +涉及模块: +- `server/app/api/controller/MatchController.php` +- `admin/src/views/match/lists/index.vue` +- `uniapp/src/pages/match_detail/match_detail.vue` - `server/public/dongqiudi-crawler/main.py` - `server/app/common/command/CrawlerCommand.php` - `server/public/dongqiudi-crawler/insert_crontab_lottery_community.sql` -### 5. 椤圭洰绾ф枃妗e綊妗e埌鏍圭洰褰? -- 鐘舵€侊細宸插畬鎴?- 鏃堕棿锛?026-05-14 +### 5. 项目级文档归档到根目录 +- 状态:已完成 - 时间:2026-05-14 -瀹屾垚鍐呭锛? -- 灏嗛」鐩骇鏂囨。 `01-浜у搧鏂规鏂囨。.md`銆乣02-瀹炵幇娴佺▼鏂囨。.md`銆乣鐖櫕浠诲姟鑴氭湰鏂囨。.md` 浠?`docs/` 鐩綍绉诲姩鍒伴」鐩牴鐩綍缁熶竴缁存姢銆?- 鍦ㄦ牴鐩綍 `AGENTS.md` 涓ˉ鍏呴」鐩骇鏂囨。瀛樻斁瑙勫垯锛屾槑纭崗浣滅被涓庝笟鍔$被鎬绘枃妗i粯璁ゆ斁鏍圭洰褰曘€?- 鍚屾淇鏂囨。寮曠敤璺緞锛岄伩鍏嶅悗缁户缁紩鐢ㄦ棫鐨?`docs/` 璺緞銆? -娑夊強妯″潡锛? +完成内容: +- 将项目级文档 `01-产品方案文档.md`、`02-实现流程文档.md`、`爬虫任务脚本文档.md` 从 `docs/` 目录移动到项目根目录统一维护。 +- 在根目录 `AGENTS.md` 中补充项目级文档存放规则,明确协作类与业务类总文档默认放根目录。 +- 同步修正文档引用路径,避免后续继续引用旧的 `docs/` 路径。 +涉及模块: - `AGENTS.md` -- `涓氬姟杩涘害绠$悊.md` -- `01-浜у搧鏂规鏂囨。.md` -- `02-瀹炵幇娴佺▼鏂囨。.md` -- `鐖櫕浠诲姟鑴氭湰鏂囨。.md` +- `业务进度管理.md` +- `01-产品方案文档.md` +- `02-实现流程文档.md` +- `爬虫任务脚本文档.md` -### 6. FIFA 涓栫晫鏉祫璁畾鏃堕噰闆嗘帴鍏? -- 鐘舵€侊細宸插畬鎴?- 鏃堕棿锛?026-05-15 +### 6. FIFA 世界杯资讯定时采集接入 +- 状态:已完成 - 时间:2026-05-15 -瀹屾垚鍐呭锛? -- 鏂板 FIFA 涓栫晫鏉祫璁埇铏叆鍙?`fifa_worldcup_news`锛岄€氳繃 FIFA CXM API 鎷夊彇涓栫晫鏉〉闈㈡柊闂诲尯鍧楁暟鎹€?- 澧炲姞涓栫晫鏉枃绔犲垎绫诲箓绛夊垱寤?澶嶇敤閫昏緫锛岄粯璁ゅ垎绫诲悕涓?`涓栫晫鏉痐锛屽苟鑷姩鍚敤鏄剧ず銆?- 鏂板瀹氭椂浠诲姟娉ㄥ唽 SQL `insert_crontab_fifa_worldcup_news.sql`锛岄噰鐢?`crawler fifa_worldcup_news` 鍔ㄤ綔骞舵寜 10 鍒嗛挓鎵ц銆?- 灏嗗悗绔畾鏃朵换鍔¤皟搴﹂摼璺墿灞曞埌 `fifa_worldcup_news`锛屾部鐢ㄧ幇鏈?crawler 寮傛鎵ц妯″紡銆?- 宸查獙璇?FIFA API 鍙繑鍥?20 鏉′笘鐣屾澂璧勮锛涙湰鍦板畬鏁村啓搴撻獙璇佸洜 crawler 褰撳墠鏁版嵁搴撻厤缃寚鍚?`127.0.0.1` 涓?MySQL 鎷掔粷杩炴帴锛岄渶鍦ㄦ湇鍔″櫒/鍙敤鏁版嵁搴撶幆澧冩墽琛屻€? -娑夊強妯″潡锛? +完成内容: +- 新增 FIFA 世界杯资讯爬虫入口 `fifa_worldcup_news`,通过 FIFA CXM API 拉取世界杯页面新闻区块数据。 +- 增加世界杯文章分类幂等创建/复用逻辑,默认分类名为 `世界杯`,并自动启用显示。 +- 新增定时任务注册 SQL `insert_crontab_fifa_worldcup_news.sql`,采用 `crawler fifa_worldcup_news` 动作并按 10 分钟执行。 +- 将后端定时任务调度链路扩展到 `fifa_worldcup_news`,沿用现有 crawler 异步执行模式。 +- 已验证 FIFA API 可返回 20 条世界杯资讯;本地完整写库验证因 crawler 当前数据库配置指向 `127.0.0.1` 而 MySQL 拒绝连接,需在服务器/可用数据库环境执行。 +涉及模块: - `server/public/dongqiudi-crawler/fifa_worldcup_news.py` - `server/public/dongqiudi-crawler/main.py` - `server/public/dongqiudi-crawler/insert_crontab_fifa_worldcup_news.sql` - `server/app/common/command/CrawlerCommand.php` - `server/app/adminapi/logic/crontab/CrontabLogic.php` -### 7. 鎳傜悆甯濅笘鐣屾澂涓撳睘閲囬泦涓庣敤鎴风涓栫晫鏉腑蹇? -- 鐘舵€侊細宸插畬鎴?- 鏃堕棿锛?026-05-15 +### 7. 懂球帝世界杯专属采集与用户端世界杯中心 +- 状态:已完成 - 时间:2026-05-15 -瀹屾垚鍐呭锛? -- 鏂板 `dqd_worldcup` 涓撳睘閲囬泦浠诲姟锛屽浐瀹氭姄鍙栨噦鐞冨笣 2026 涓栫晫鏉?`standing / schedule / person_ranking(goals|assists)`銆?- 涓栫晫鏉禌绋嬪啓鍏?`la_match`锛岀粺涓€浣跨敤 `league_name=涓栫晫鏉痐銆乣competition_id=61`銆乣sport_type=1`锛屽苟淇濈暀 `round_name` 涓?`stage`銆?- 鏂板涓栫晫鏉紦瀛樿〃 `la_worldcup_standing`銆乣la_worldcup_person_ranking`锛屼繚鐣欏皬缁勭Н鍒嗘鍜岀悆鍛樻缁撴瀯銆?- 鏂板骞傜瓑 SQL `insert_crontab_dqd_worldcup.sql`锛岃嚜鍔ㄥ垱寤哄苟鍚敤瓒崇悆浜岀骇鍒嗙被鈥滀笘鐣屾澂鈥濓紝鍚屾椂娉ㄥ唽 `crawler dqd_worldcup` 瀹氭椂浠诲姟銆?- `MatchController` 鏂板 `worldCupStandings`銆乣worldCupRankings`銆乣worldCupSchedule` 3 涓墠鍙版帴鍙o紝渚涚敤鎴风涓栫晫鏉腑蹇冧娇鐢ㄣ€?- 鐢ㄦ埛绔?`pages/match/match` 鍦ㄢ€滆冻鐞?> 涓栫晫鏉€濆垎绫讳笅鏂板鈥滆禌绋嬪闃靛浘鈥濋《閮ㄥ叆鍙e崱锛屽苟鏂板 `packages_match/pages/worldcup` 涓栫晫鏉笓灞為〉锛屾彁渚涒€滃闃靛浘 / 绉垎姒?/ 灏勬墜姒?/ 鍔╂敾姒?/ 璧涚▼鈥? 涓?tab銆?- 宸插湪娴嬭瘯搴撴墽琛?SQL 骞舵墜鍔ㄨ窇閫氫竴娆¢噰闆嗭紝褰撳墠鍐欏叆缁撴灉涓猴細`la_match` 104 鍦恒€乣la_worldcup_standing` 48 鏉°€乣la_worldcup_person_ranking` 鐨?`goals/assists` 鏆備负绌恒€?- 宸查獙璇佹祴璇曟湇 `/api/match/leagues` 鍜?`/api/match/lists?league_name=涓栫晫鏉痐 鍙繑鍥炰笘鐣屾澂鍒嗙被涓庤禌绋嬶紱`worldCupStandings / worldCupRankings / worldCupSchedule` 浠嶉渶绛夊緟鍚庣鑷姩鍚屾鍒版祴璇曟湇鍚庡啀鍋氭渶缁堣仈璋冦€? -娑夊強妯″潡锛? +完成内容: +- 新增 `dqd_worldcup` 专属采集任务,固定抓取懂球帝 2026 世界杯 `standing / schedule / person_ranking(goals|assists)`。 +- 世界杯赛程写入 `la_match`,统一使用 `league_name=世界杯`、`competition_id=61`、`sport_type=1`,并保留 `round_name` 为 `stage`。 +- 新增世界杯缓存表 `la_worldcup_standing`、`la_worldcup_person_ranking`,保留小组积分榜和球员榜结构。 +- 新增幂等 SQL `insert_crontab_dqd_worldcup.sql`,自动创建并启用足球二级分类"世界杯",同时注册 `crawler dqd_worldcup` 定时任务。 +- `MatchController` 新增 `worldCupStandings`、`worldCupRankings`、`worldCupSchedule` 3 个前台接口,供用户端世界杯中心使用。 +- 用户端 `pages/match/match` 在"足球 > 世界杯"分类下新增"赛程对阵图"顶部入口卡,并新增 `packages_match/pages/worldcup` 世界杯专属页,提供"对阵图 / 积分榜 / 射手榜 / 助攻榜 / 赛程" 5 个 tab。 +- 已在测试库执行 SQL 并手动跑通一次采集,当前写入结果为:`la_match` 104 场、`la_worldcup_standing` 48 条、`la_worldcup_person_ranking` 的 `goals/assists` 暂为空。 +- 已验证测试服 `/api/match/leagues` 和 `/api/match/lists?league_name=世界杯` 可返回世界杯分类与赛程;`worldCupStandings / worldCupRankings / worldCupSchedule` 仍需等待后端自动同步到测试服后再做最终联调。 +涉及模块: - `server/public/dongqiudi-crawler/dqd_worldcup.py` - `server/public/dongqiudi-crawler/main.py` - `server/public/dongqiudi-crawler/insert_crontab_dqd_worldcup.sql` @@ -98,171 +426,19 @@ - `server/app/api/controller/MatchController.php` - `uniapp/src/api/match.ts` - `uniapp/src/pages/match/match.vue` -- `uniapp/src/packages_match/pages/worldcup.vue` -- `uniapp/src/pages.json` -### 8. 璧涗簨涓績椤堕儴涓栫晫鏉笓棰樺叆鍙d紭鍖? -- 鐘舵€侊細宸插畬鎴?- 鏃堕棿锛?026-05-20 +### 8. 49宝典新澳六合/旧奥六合爬取 API 格式适配修复 -瀹屾垚鍐呭锛? -- 鍙傝€冧笘鐣屾澂涓撻璁捐绋匡紝灏嗙敤鎴风 `pages/match/match` 鐨勪笘鐣屾澂鍏ュ彛浠庤禌浜嬪垪琛ㄥ尯涓婄Щ鍒伴〉闈㈠ご閮紝鏀惧湪鏍囬涓庤繍鍔ㄥ垎绫讳箣闂淬€?- 鏂板叆鍙f敼涓鸿摑鑹蹭笓棰樺崱鏍峰紡锛屽睍绀?`2026骞村浗闄呰冻鑱斾笘鐣屾澂` 涓庤禌浜嬫椂闂村尯闂达紝鐐瑰嚮缁х画璺宠浆鐜版湁涓栫晫鏉笓灞為〉銆?- 绉婚櫎鍘熷厛浠呭湪鈥滆冻鐞?> 涓栫晫鏉€濆垎绫讳笅鏄剧ず鐨勫垪琛ㄥ唴鍏ュ彛锛岄伩鍏嶅悓椤甸噸澶嶅嚭鐜颁袱涓笘鐣屾澂鍏ュ彛銆?- 璋冩暣璧涗簨椤靛垪琛ㄩ珮搴﹁绠楅€昏緫锛屾敼涓烘寜瀹為檯澶撮儴楂樺害鍥炵畻锛岄伩鍏嶆柊澧炰笓棰樺崱鍚庨伄鎸″垎绫绘潯鎴栧帇缂╁垪琛ㄥ尯鍩熴€?- 宸插畬鎴?`npm run build:h5` 鏋勫缓锛屽苟閫氳繃娴忚鍣ㄥ湪鏈湴 H5 楠岃瘉涓撻鍏ュ彛宸插嚭鐜板湪璧涗簨椤甸《閮ㄣ€? -娑夊強妯″潡锛? -- `uniapp/src/pages/match/match.vue` -- `涓氬姟杩涘害绠$悊.md` -- `璁捐绋挎槧灏?md` +- 状态:已完成 - 时间:2026-06-01 -### 9. 涓栫晫鏉笓棰橀〉鎺掑悕瀵艰埅缁勪欢鍖? -- 鐘舵€侊細宸插畬鎴?- 鏃堕棿锛?026-05-20 - -瀹屾垚鍐呭锛? -- 鍙傝€冧笘鐣屾澂涓撻椤碘€滄帓鍚嶁€濊璁$锛屽皢鎺掑悕鍖轰粠 `worldcup.vue` 椤甸潰鍐呰仈缁撴瀯鎷嗗垎涓虹嫭绔嬬粍浠躲€?- 鏂板鎺掑悕瀵艰埅缁勪欢 `RankingNav.vue`锛岀粺涓€鎵胯浇 `绉垎姒?/ 灏勬墜姒?/ 鍔╂敾姒渀 鍒囨崲銆?- 鏂板绉垎姒滅粍浠?`StandingsPanel.vue`锛屽崟鐙礋璐e垎缁勬爣棰樸€佽〃澶翠笌鐞冮槦绉垎琛ㄦ牸娓叉煋銆?- 鏂板鐞冨憳姒滅粍浠?`PlayerRankingPanel.vue`锛屽崟鐙礋璐e皠鎵嬫涓庡姪鏀绘鍒楄〃娓叉煋銆?- 绉垎姒滃竷灞€鎸変笓棰樿璁$缁嗗寲涓衡€滅悆闃熷浐瀹氬湪宸︺€佸満娆?鑳滃钩璐?杩涘け/绉垎闆嗕腑鍦ㄥ彸鈥濈殑鍙屽尯鍧楄〃鏍肩粨鏋勶紝绉诲姩绔〃澶翠笌鏁版嵁鍒椾繚鎸佸榻愩€?- `worldcup.vue` 鍙繚鐣欎笓棰樹富瀵艰埅銆佹暟鎹姞杞戒笌 ranking 缁勪欢璋冨害锛岄檷浣庨〉闈㈣€﹀悎锛屼究浜庡悗缁户缁寜璁捐绋跨粏鍖栨鍗曟牱寮忋€?- 宸叉墽琛?`npm run build:h5` 骞堕€氳繃鏈湴 H5 鏍¢獙鈥滄帓鍚嶁€濋〉鍙甯稿睍绀虹粍浠跺寲鍚庣殑瀵艰埅涓庣Н鍒嗘鍐呭銆? -娑夊強妯″潡锛? -- `uniapp/src/packages_match/pages/worldcup.vue` -- `uniapp/src/packages_match/pages/worldcup/components/ranking/RankingNav.vue` -- `uniapp/src/packages_match/pages/worldcup/components/ranking/StandingsPanel.vue` -- `uniapp/src/packages_match/pages/worldcup/components/ranking/PlayerRankingPanel.vue` -- `涓氬姟杩涘害绠$悊.md` - -### 10. 涓栫晫鏉笓棰橀〉瀵归樀鍥炬寜鐪熷疄鐞冮槦鏄犲皠 -- 鐘舵€侊細宸插畬鎴?- 鏃堕棿锛?026-05-20 - -瀹屾垚鍐呭锛?- 鐢ㄦ埛绔?`packages_match/pages/worldcup` 瀵归樀鍥鹃〉鏂板鍩轰簬 `worldCupStandings` 鐨勫垎缁勫悕娆$储寮曪紝灏?`A1/A2/.../L4` 鐩存帴鏄犲皠涓哄綋鍓嶇Н鍒嗘涓殑鐪熷疄鐞冮槦鍚嶇О涓庨槦寰姐€?- `1/16鍐宠禌` 涓殑绗笁鍚嶇粍鍚堝崰浣嶇锛堝 `A3/B3/C3/D3/F3`锛夋敼涓洪€愰」鏇挎崲鍚庡啀鎷兼帴灞曠ず锛岄伩鍏嶇户缁樉绀哄瓧姣嶅崰浣嶇銆?- 瀵逛粛鐒舵槸鈥滅X鍦鸿儨鑰?璐ヨ€呪€濈殑鍚庣画杞鍗犱綅淇濇寔鍘熸牱锛屼笉浼€犳湭浜х敓鐨勬檵绾х粨鏋滐紱瀵规棤娉曠‘瀹氱湡瀹為槦寰界殑缁勫悎鍗犱綅涓嶅啀鏄剧ず榛樿鍗犱綅鍥俱€?- 涓哄鐞冮槦缁勫悎鍚嶇О澧炲姞涓よ灞曠ず鏍峰紡锛岄伩鍏嶉暱鏂囨湰鍦ㄤ笓棰樺闃靛崱鐗囦腑琚崟琛屾埅鏂€?- 宸叉墽琛?`uniapp` 鏋勫缓楠岃瘉锛歚npm run build:h5` 閫氳繃銆? -娑夊強妯″潡锛?- `uniapp/src/packages_match/pages/worldcup.vue` -- `涓氬姟杩涘害绠$悊.md` - -### 11. 鐭俊鍔╂墜鍚屾鐭俊涓庢潵鐢佃褰曞叆搴? -- 鐘舵€侊細宸插畬鎴?- 鏃堕棿锛?026-05-22 - -瀹屾垚鍐呭锛? -- 鎵╁睍 `/api/sms/uploadSms`锛屽悓鏃舵帴鏀舵墜鏈虹涓婁紶鐨?`smsList` 涓?`callList`锛岀粺涓€鍐欏叆 `la_sms_upload`銆?- 淇濇寔鐭俊楠岃瘉鐮侀摼璺吋瀹癸細鐭俊璁板綍浠嶆部鐢?`type=1/2`銆乣status=0/1`锛涙潵鐢佃褰曚娇鐢?`type=11/13/15` 鍖哄垎鈥滃凡鎺?鏈帴/鎷掓帴鈥濓紝骞朵娇鐢?`status=2` 琛ㄧず鈥滀笉閫傜敤鈥濄€?- 鐧诲綍/缁戞墜鏈哄彿鐨勭煭淇¢獙璇佺爜鏍¢獙瑙勫垯璋冩暣涓猴細鍙 `la_sms_upload` 涓瓨鍦ㄨ鎵嬫満鍙风殑浠绘剰涓婁紶璁板綍锛屽嵆瑙嗕负楠岃瘉閫氳繃锛屼笉鍐嶈姹傜煭淇″唴瀹逛笌杈撳叆楠岃瘉鐮佸畬鍏ㄥ尮閰嶏紝涔熶笉鍐嶉檺鍒?7 澶╁唴鎴栫煭淇$被鍨嬨€?- 鍔╂墜绔噰闆嗚寖鍥存敹绱т负锛氱煭淇″彧涓婁紶鏀跺埌鐨勭煭淇★紝鏉ョ數鍙笂浼犳墦杩涙潵鐨勫彿鐮侊紝杩囨护鑷繁鍙戝嚭鍘荤殑鐭俊鍜屼富鍔ㄦ嫧鍑虹殑閫氳瘽璁板綍銆?- 鍔╂墜绔仮澶嶆潵鐢电湡瀹炰笂浼狅紝涓嶅啀灏嗘潵鐢佃姹傛寜鈥滅煭淇″垪琛ㄤ负绌衡€濊浣滆烦杩囷紝骞跺鍔犲姪鎵嬬璇锋眰/鍝嶅簲鎵撳嵃锛屼究浜庢帓鏌ュ疄闄呬笂浼犲唴瀹广€?- 绠$悊绔€滅郴缁熻缃?-> 绯荤粺缁存姢 -> 楠岃瘉鐮佲€濆垪琛ㄥ悓姝ユ敮鎸佸睍绀烘潵鐢佃褰曪紝鏂板鈥滆褰曠被鍨嬧€濆垪锛屽苟琛ュ厖鈥滀笉閫傜敤鈥濈姸鎬佸睍绀恒€?- 鏂板 SQL 鑴氭湰 `docs/sql/alter_la_sms_upload_for_call_records.sql`锛岀敤浜庡皢 `la_sms_upload.status` 娉ㄩ噴鎵╁睍涓?`0=寰呴獙璇?1=宸蹭娇鐢?2=涓嶉€傜敤`銆? -娑夊強鏁版嵁搴撳彉鏇达細 - -- `la_sms_upload.status` - -娑夊強妯″潡锛? -- `server/app/api/controller/SmsController.php` -- `server/app/api/logic/LoginLogic.php` -- `server/app/api/logic/UserLogic.php` -- `server/app/adminapi/lists/setting/SmsUploadLists.php` -- `admin/src/views/setting/system/sms_upload.vue` -- `sport-era-msg/pages/index/index.vue` -- `sport-era-msg/pages/logs/logs.vue` -- `docs/sql/alter_la_sms_upload_for_call_records.sql` -- `涓氬姟杩涘害绠$悊.md` - ---- - -### 12. 鐢ㄦ埛椤垫湭璁惧瘑鐮佹彁绀?- 2026-05-23锛歚uniapp/src/pages/user/user.vue` 鍦ㄨ繘鍏モ€滄垜鐨勨€濋〉闈㈡椂琛ュ厖鏈缃瘑鐮佹彁绀哄脊绐楋紱褰?`has_password` 涓?`0` 鏃讹紝鎻愮ず鐢ㄦ埛灏藉揩淇敼鐧诲綍瀵嗙爜锛屽苟灞曠ず鎵嬫満鍙峰悗 6 浣嶄綔涓哄垵濮嬪瘑鐮佽鏄庛€?- 2026-05-23锛歚server/app/api/validate/LoginAccountValidate.php` 鏀寔绌哄瘑鐮佺敤鎴蜂娇鐢ㄦ墜鏈哄彿鍚?6 浣嶇洿鎺ョ櫥褰曪紝閬垮厤鍒濆鍖栬处鍙疯璇垽涓衡€滅敤鎴蜂笉瀛樺湪鈥濄€? -### 13. 涓栫晫鏉〉闈富瀵艰埅榛樿绱㈠紩 -- 2026-05-23锛歚uniapp/src/packages_match/pages/worldcup.vue` 鐨勪富瀵艰埅榛樿绱㈠紩璋冩暣涓虹 0 椤癸紝椤甸潰杩涘叆鏃堕粯璁ゅ仠鐣欏湪棣栦釜 tab銆? -### 14. 涓栫晫鏉笓棰樻柊闂绘潵婧愬悓姝ラ椤靛垎绫?- 2026-05-23锛歚uniapp/src/pages/match/match.vue` 璺宠浆涓栫晫鏉笓棰橀〉鏃舵惡甯﹂椤佃В鏋愬埌鐨?`涓栫晫鏉痐 鍒嗙被 `cid`锛宍uniapp/src/packages_match/pages/worldcup.vue` 浼樺厛浣跨敤璇?`cid` 鎷夊彇鏂伴椈锛屼繚璇佷笓棰樻柊闂绘潵婧愪笌棣栭〉涓栫晫鏉垎绫讳竴鑷淬€? -### 15. 鏂伴椈璧勮 AI 缈昏瘧 -- 2026-05-23锛歚server/app/api/controller/ArticleController.php` 鏂板 `/article/translate` 缈昏瘧鎺ュ彛锛宍server/app/api/logic/ArticleLogic.php` 澶嶇敤 `AiService` 鐢熸垚骞剁紦瀛樻枃绔犵炕璇戠粨鏋滃埌 `ext`銆?- 2026-05-23锛歚uniapp/src/pages/news_detail/news_detail.vue` 鍦ㄦ柊闂昏鎯呴〉鏂板 AI 缈昏瘧鍏ュ彛銆佸姞杞芥€佷笌缈昏瘧缁撴灉灞曠ず鍖猴紝`uniapp/src/api/news.ts` 琛ュ厖瀵瑰簲璇锋眰灏佽銆? -### 16. 涓栫晫鏉笓棰樻柊闂诲垪琛?AI 缈昏瘧 -- 2026-05-23锛歚uniapp/src/components/news-card/news-card.vue` 澧炲姞鍙€?AI 缈昏瘧瑙﹀彂鍏ュ彛锛屼笘鐣屾澂涓撻鏂伴椈鍒楄〃鍙湪鍗$墖鍐呯偣鎸夌炕璇戞寜閽€?- 2026-05-23锛歚uniapp/src/packages_match/pages/worldcup.vue` 鎺ユ敹缈昏瘧浜嬩欢骞朵互寮圭獥灞曠ず缈昏瘧缁撴灉锛屼繚鎸佸叾浠栨柊闂诲垪琛ㄩ粯璁や笉鍙樸€?### 17. 绀惧尯棣栭〉鐗规湕鏅垎绫?AI 缈昏瘧澶嶇敤 -- 2026-05-23锛歚uniapp/src/packages_community/pages/index.vue` 缁х画澶嶇敤 `post-card` 鍗$墖娓叉煋锛岀ぞ鍖洪椤垫棤闇€鍗曠嫭鎷嗗垎 AI 鍏ュ彛閫昏緫銆?- 2026-05-23锛歚uniapp/src/packages_community/components/post-card.vue` 灏?`鐗规湕鏅甡 鏍囩绾冲叆 AI 缈昏瘧鍏ュ彛鍒ゆ柇锛屾部鐢ㄥ笘瀛愮炕璇戝脊绐楀睍绀烘柟寮忋€?### 18. 璧勮 AI 缈昏瘧鏀逛负绉垎纭娴佺▼ -- 2026-05-23锛歚server/app/api/controller/ArticleController.php` 鐨?`/article/translate` 鏀逛负鐧诲綍鍚庡彲鐢紝骞舵敮鎸?`article_id/id + confirm` 鐨勭Н鍒嗙‘璁ゅ弬鏁般€?- 2026-05-23锛歚server/app/api/logic/ArticleLogic.php` 涓鸿祫璁炕璇戣ˉ榻?`needs_payment` 鎺㈡祴銆佺Н鍒嗘墸鍑忋€佺炕璇戠紦瀛樺鐢ㄤ笌宸蹭粯璐圭敤鎴风紦瀛樿鍙栥€?- 2026-05-23锛歚uniapp/src/api/news.ts`銆乣uniapp/src/pages/news_detail/news_detail.vue`銆乣uniapp/src/packages_match/pages/worldcup.vue` 鏀逛负涓庣ぞ鍖虹炕璇戜竴鑷寸殑 `POST + confirm` 璋冪敤鏂瑰紡锛岀炕璇戝墠鍏堟彁绀虹櫥褰曞苟鍦ㄧ‘璁ゅ悗鎵gН鍒嗐€?### 19. 璧涗簨璇︽儏鏂板绗笁鏂圭洿鎾叆鍙?- 2026-05-23锛歚server/app/api/controller/MatchController.php` 澶嶇敤 `la_match_data.raw_data` 涓殑鐩存挱婧愭枃鏈紝鍚戣鎯呮帴鍙hˉ鍏?`living_tv` 瀛楁锛屼究浜庡墠绔睍绀虹洿鎾潵婧愯鏄庛€?- 2026-05-23锛歚uniapp/src/pages/match_detail/match_detail.vue` 鏂板鈥滅洿鎾€濆叆鍙e崱鐗囷紝鐐瑰嚮鍚庨€氳繃鐜版湁 `webview` 椤甸潰璺宠浆鍒版噦鐞冨笣绗笁鏂圭洿鎾鎯呴〉銆? -### 20. 绠$悊绔禌浜嬬洿鎾摼鎺ョ紪杈?- 2026-05-23锛歚admin/src/views/match/lists/index.vue` 鍦ㄨ禌浜嬬紪杈戝脊绐椾腑鏂板 `live_url` 杈撳叆椤癸紝鐢ㄤ簬缁存姢绗笁鏂圭洿鎾摼鎺ャ€?- 2026-05-23锛歚server/app/adminapi/logic/match/MatchLogic.php` 鍏佽璧涗簨缂栬緫鍐欏叆 `live_url`锛宍uniapp/src/pages/match_detail/match_detail.vue` 浼樺厛璇诲彇璇ュ瓧娈典綔涓虹洿鎾叆鍙h烦杞湴鍧€銆?- 2026-05-23锛氭柊澧?`docs/sql/alter_la_match_add_live_url.sql`锛岀敤浜庣粰 `la_match` 琛ュ厖 `live_url` 瀛楁銆?- 2026-05-23锛氬凡鍚屾娴嬭瘯搴?`sbnews.la_match.live_url` 瀛楁锛岀‘璁?`/adminapi/match.match/edit` 鍙甯歌惤搴撱€? -### 21. 璧涗簨璇︽儏鐩存挱鍏ュ彛浠呭湪鏈夐摼鎺ユ椂灞曠ず -- 2026-05-23锛歚uniapp/src/pages/match_detail/match_detail.vue` 灏嗙洿鎾叆鍙f敹鏁涗负浠呭湪 `match.live_url` 瀛樺湪鏃跺睍绀猴紝涓嶅啀涓烘棤閾炬帴璧涗簨鑷姩鍏滃簳绗笁鏂圭洿鎾湴鍧€銆? -### 22. 涓栫晫鏉笓棰樻瘮璧涘崱鐗囪烦杞鎯?- 2026-05-23锛歚uniapp/src/packages_match/pages/worldcup.vue` 鐨勮禌绋嬪崱鐗囧拰瀵归樀鍥惧崱鐗囩粺涓€鏀寔鐐瑰嚮璺宠浆 `pages/match_detail/match_detail`锛屾柟渚夸粠涓栫晫鏉笓棰樼洿鎺ヨ繘鍏ユ瘮璧涜鎯呴〉銆? -### 23. 杩戞湡韪╁潙涓庢枃妗e悓姝?- 2026-05-24锛氬皢鏈璋冭瘯杩囩▼涓‘璁ょ殑鍧戠偣鍚屾鍒?`sport-era-project-dev` 鎶€鑳芥枃妗e拰鍚勭骇 `AGENTS.md`锛岃ˉ鍏?`Validate::only()` 涓嶈繃婊よ姹傚弬鏁般€乣la_match.live_url` 蹇呴』鍏堣ˉ搴撱€佷笘鐣屾澂涓撻椤靛叆鍙d竴鑷存€т互鍙婃瀯寤轰骇鐗╀笉瑕佹贩鍏ユ彁浜ょ瓑娉ㄦ剰浜嬮」銆? -## 浜屻€佽繘琛屼腑浜嬮」 - -鏆傛棤銆? ---- - -## 涓夈€佸緟鍔炰簨椤? -### 1. 涓氬姟妯″潡杩涘害琛ュ綍 - -- 浼樺厛绾э細涓?- 鍒涘缓鏃堕棿锛?026-05-07 - -寰呯‘璁わ細 - -- 鏍规嵁鐜版湁 `01-浜у搧鏂规鏂囨。.md`銆乣02-瀹炵幇娴佺▼鏂囨。.md` 鍜屽綋鍓嶄唬鐮佺姸鎬侊紝琛ュ綍宸插畬鎴愪笟鍔℃ā鍧椼€?- 鎸夋ā鍧楁⒊鐞嗗悗绔帴鍙c€佺鐞嗗悗鍙伴〉闈€乽niapp 椤甸潰銆丳C 椤甸潰褰撳墠瀹屾垚搴︺€? -### 2. 璁捐绋挎槧灏勮ˉ褰? -- 浼樺厛绾э細涓?- 鍒涘缓鏃堕棿锛?026-05-07 - -寰呯‘璁わ細 - -- 纭褰撳墠璁捐绋垮钩鍙般€侀」鐩摼鎺ュ拰椤甸潰鑺傜偣鍚嶇О銆?- 灏嗛椤点€佹柊闂诲垪琛ㄣ€佹柊闂昏鎯呫€佷釜浜轰腑蹇冦€丄I 鍒嗘瀽绛夐〉闈笌瀹炵幇璺緞寤虹珛鏄犲皠銆? ---- - -## 鍥涖€侀伩鍧戣褰? -### 1. ThinkPHP 鏃堕棿瀛楁鑷姩杞崲 - -- BaseModel 瀛愮被鏌ヨ鍚?`create_time` / `update_time` 宸叉寜閰嶇疆杞负鏃ユ湡瀛楃涓层€?- 涓嶈瀵硅繖浜涘瓧娈靛啀娆℃墜鍔?`date()` 杞崲锛岄伩鍏嶅瓧绗︿覆寮鸿浆鏁存暟瀵艰嚧鏄剧ず涓?1970-01-01銆? -### 2. MySQL 淇濈暀瀛? -- 鍘熺敓 SQL 涓?`system`銆乣order`銆乣group`銆乣key` 绛夊瓧娈靛繀椤讳娇鐢ㄥ弽寮曞彿鍖呰9銆? -### 3. 閫楀彿鍒嗛殧杈撳叆娓呯悊 - -- 鎵嬫満鍙枫€佸叧閿瘝绛夐€楀彿鍒嗛殧杈撳叆锛屾彁浜ゅ墠蹇呴』鎵ц `split 鈫?trim 鈫?filter(Boolean) 鈫?join`銆? -### 4. 澶栫珯鍥剧墖闃茬洍閾? -- 鏂伴椈璇︽儏绛夊瘜鏂囨湰涓殑澶栫珯鍥剧墖濡傚嚭鐜?403锛屼紭鍏堝湪鍓嶇娓叉煋灞傝缃?`referrerpolicy="no-referrer"`銆?- 涓嶆搮鑷竻娲楀浘鐗?URL 鍙傛暟鎴栨敼鍐欏師濮嬭矾寰勩€? -### 5. 娴嬭瘯鏈嶅姟鍣ㄤ唬鐮佸悓姝? -- 涓嶉€氳繃 WSL `sshpass` / `scp` 涓婁紶涓氬姟浠g爜銆?- 椤圭洰浠g爜鏇存柊鐢辩敤鎴烽€氳繃 SFTP 绛夋柟寮忓鐞嗐€? -### 6. 鏂板瀛楁涓庤仈鍔ㄥ叆鍙f帓鏌? -- `Validate::only()` 鍙檺鍒舵牎楠屽瓧娈碉紝涓嶄細杩囨护璇锋眰鍙傛暟锛涙柊澧炲瓧娈靛繀椤诲悓鏃舵牳瀵?validate銆乴ogic銆乵odel銆佷繚瀛樼櫧鍚嶅崟鍜屾暟鎹簱鍒椼€?- `adminapi/match.match/edit` 鍐欏叆澶辫触鍏堢湅琛ㄧ粨鏋勶紝涓嶈鎶婃祴璇曞簱缂哄垪璇垽鎴愪笟鍔¢€昏緫閿欒銆?- 涓栫晫鏉笓棰橀〉銆佹瘮璧涜鎯呴〉鐨勫叆鍙e拰鏄剧ず瑙勫垯瑕佷竴璧锋敼锛岀洿鎾叆鍙e彧鍦?`match.live_url` 鏈夊€兼椂灞曠ず銆?- 鏋勫缓浜х墿濡?`server/public/admin`銆乣server/public/mobile` 涓嶈娣疯繘鎻愪氦锛屾彁浜ゅ墠鍏堟竻鐞嗕复鏃舵埅鍥惧拰鐢熸垚鏂囦欢銆? ---- - -## 鏂囨。缁存姢瑙勮寖 - -1. **姣忓畬鎴愪竴涓?issue / 鍔熻兘鐐?鈫?绔嬪嵆杩藉姞鍒般€屽凡瀹屾垚浜嬮」銆?*銆?2. **姣忓彂鐜颁竴涓潙 鈫?绔嬪嵆杩藉姞鍒般€岄伩鍧戣褰曘€?*銆?3. **姣忓懆娓呯悊涓€娆°€岃繘琛屼腑銆嶄笌銆屽緟鍔炪€嶇姸鎬?*銆?4. **绔犺妭搴忓彿杩炵画閫掑锛屼笉閲嶆帓**锛屼繚鐣欏巻鍙插彲杩芥函銆?5. **娑夊強鏁版嵁搴撳彉鏇村繀椤诲垪鍑鸿〃鍚嶅拰瀛楁**銆? -### 24. 涓栫晫鏉笓棰樻柊闂昏嚜鍔ㄧ炕璇戝睍绀?- 2026-05-28锛歚uniapp/src/packages_match/pages/worldcup.vue` 鐨勬柊闂诲尯鏀逛负鑷姩璇锋眰 `/article/translate` 骞剁洿鎺ュ睍绀轰腑鏂囩炕璇戯紝涓撻椤典笉鍐嶅睍绀烘樉寮?AI 缈昏瘧鍏ュ彛锛屼粎淇濈暀缈昏瘧缁撴灉灞曠ず銆? - -### 25. 鏂囩珷鍒楄〃鎺ュ彛鑷姩缈昏瘧鍥炰紶 -- 2026-05-28锛歚/api/article/lists` 鍦?`cid=22` 鏃朵細鑷姩璇诲彇鎴栫敓鎴愭枃绔犺瘧鏂囧苟鍐欏叆 `ext.translated_content`锛屾帴鍙g洿鎺ュ洖浼犱腑鏂囩炕璇戯紱`packages_match/pages/worldcup` 鍙栨秷鍓嶇浜屾缈昏瘧璇锋眰锛屽彧娑堣垂鍚庣杩斿洖缁撴灉銆? - -### 26. 棣栭〉涓庢枃绔犺鎯呯洿鎺ュ睍绀轰腑鏂囩炕璇? -- 2026-05-28锛歚server/app/api/logic/ArticleLogic.php 琛ュ厖璇︽儏鎺ュ彛鐨? ranslated_content 鏈敤鎴风墝鏈熷叆鍙岀洿鎺ュ洖浼犵紦瀛樼粨鏋滐紝棣栭〉鍒楄〃鍗$墖缁х画澶嶇敤 ranslated_content 鏄剧ず涓枃缈昏瘧銆? -- 2026-05-28锛歚uniapp/src/pages/news_detail/news_detail.vue 鍘绘帀鎵嬪姩缈昏瘧鎸夐挳鍜屽弽澶嶈姹傛祦绋嬶紝鏀逛负鐩存帴灞曠ず鎺ュ彛杩斿洖鐨勪腑鏂囩炕璇戝唴瀹癸紝涓栫晫鏉垪琛ㄥ崱鐗囧悓姝ョ粦瀹? ranslated_content銆? - -### 27. 首页资讯卡片翻译块独立成行 -- 2026-05-28锛歚uniapp/src/components/feed-card/feed-card.vue鍜?uniapp/src/components/feed-video-card/feed-video-card.vue 灏? ranslated_content 绉诲埌鍥剧墖/瑙嗛鍖哄潡涔嬩笅鐨勭嫭绔嬪叏瀹藉埗琛岋紝閬垮厤缈昏瘧鍐呭鍗犳帀宸﹀彸鍒楀鑷村浘鐗囪鍘嬬缉鍒颁竴渚э紝鍚屾椂淇濇寔鍗$墖绮惧捐灞曠ず銆? - -### 28. 世界杯英文资讯定时翻译预热 -- 2026-05-28:新增 server/app/common/command/WorldcupArticleTranslate.php,用于定时扫描世界杯分类文章并仅在疑似英文且未缓存翻译时调用 ArticleLogic::autoTranslateArticle() 落库。 -- 2026-05-28:将命令注册到 server/config/console.php,并新增 docs/sql/insert_crontab_worldcup_article_translate.sql,可将任务加入 la_dev_crontab 统一调度。 -- 2026-05-28:翻译判定会先排除包含中文字符的内容,避免非英文资讯误入 AI 翻译流程。 - -### 29. 世界杯社区内容精选区 -- 2026-05-28:曾在 uniapp/src/packages_community/pages/index.vue 顶部新增世界杯精选社区区块,用于预热世界杯社区内容。 -- 2026-05-28:已根据最新需求撤回顶部精选区,首页恢复为原先的分类流展示。 -- 2026-05-28:新增 docs/sql/seed_worldcup_community_posts.sql,可快速插入 3 条世界杯社区种子帖子并关联 世界杯 标签。 - -### 30. 世界杯英文文章翻译定时任务入库 -- 2026-05-28:已将 `worldcup_article_translate` 预热命令写入远端 `la_dev_crontab`,表达式为 `*/10 * * * *`,用于定时补齐世界杯英文文章的翻译缓存。 -- 2026-05-28:已移除命令内的 50 条限制,避免只覆盖最新内容导致旧文章长期未翻译。 - -### 31. 赛事详情页头部优化 -- 2026-05-29:将 `uniapp/src/pages/match_detail/match_detail.vue` 顶部导航抽离为 `uniapp/src/components/match-detail-header/match-detail-header.vue`,页面只保留返回、标题、副标题和分享入口。 -- 2026-05-29:移除了赛事详情页顶部的 hero 摘要区,保留比赛信息卡、直播、阵容和 AI 分析主体内容不变。 - -### 32. 非 TabBar 页自定义底栏白屏修复 -- 2026-05-29:修正 `uniapp/src/components/tabbar/tabbar.vue` 对 `hide-tab-bar` 的使用,仅在原生 TabBar 页启用,避免在 `packages_match/pages/index` 这类普通页面触发 `hideTabBar:fail not TabBar page`。 -- 2026-05-29:该问题会在赛事入口页产生未处理 rejection,表现为点击赛事后页面白屏或异常闪烁,现已收敛。 - -### 33. iOS 赛事入口兼容修复 -- 2026-05-29:将 `uniapp/src/packages_match/components/MatchCenterPanel.vue` 的 `Object.values(...).flat()` 改为手动合并数组,避免老版本 iOS WebView 不支持 `flat()` 时在赛事入口直接白屏。 -- 2026-05-29:同步将 `uniapp/src/packages_match/pages/index.vue` 与 `uniapp/src/packages_match/pages/worldcup.vue` 的壳组件导入统一为绝对路径,减少子包页面在 App/iOS 端的解析歧义。 - -### 34. 赛事详情页返回赛事中心浮动入口 -- 2026-05-29:在 `uniapp/src/pages/match_detail/match_detail.vue` 右下角新增“赛事中心”浮动圆圈,点击后优先 `switchTab` 返回 `pages/match/match`,失败时回退 `reLaunch`。 - -### 35. 世界杯英文翻译预热容错调整 -- 2026-05-29:将 `server/app/common/command/WorldcupArticleTranslate.php` 的英文判定阈值放宽,并改为按文章 `id` 升序处理,减少正常英文世界杯稿件被误判为“非英文”而跳过的情况。 -- 2026-05-29:世界杯文章列表页本身只读取 `ext.translated_content`,如果宿主机没有持续运行 `php think crontab` 或 `/crontab` 调度入口,未触发预热的文章就会一直保持空翻译状态。 - -### 36. 世界杯专题新闻翻译摘要预览 -- 2026-05-29:`uniapp/src/components/feed-card/feed-card.vue` 与 `uniapp/src/components/feed-video-card/feed-video-card.vue` 的首页世界杯翻译区改为摘要预览,不再全量展开正文。 -- 2026-05-29:`uniapp/src/packages_match/components/WorldCupPanel.vue` 的世界杯专题新闻列表翻译块同步改为摘要预览,保持卡片高度稳定,避免整段译文撑开列表。 - -### 37. 世界杯翻译展示纯文本换行化 -- 2026-05-29:将世界杯专题右上角入口调整为“其他赛事”,点击后回到赛事中心视图,并移除原右下角悬浮返回按钮。 -- 2026-05-29:`uniapp/src/components/feed-card/feed-card.vue`、`uniapp/src/components/feed-video-card/feed-video-card.vue`、`uniapp/src/pages/news_detail/news_detail.vue`、`uniapp/src/packages_community/components/post-card.vue`、`uniapp/src/packages_community/pages/post_detail.vue` 的翻译展示统一改为原文后换行的纯文本译文,去掉独立 AI 翻译框/卡片。 -- 2026-05-29:`server/app/api/controller/CommunityController.php` 补充了特朗普帖子详情的翻译缓存兜底,确保列表与详情都能直接拿到 `translated_content`。 - -### 38. 资讯 AI 评论任务入库 -- 2026-05-29:新增 `article_ai_comment` 控制台命令、`la_article_ai_comment_task` 任务队列表以及 `docs/sql/insert_crontab_article_ai_comment.sql`,用于轮询并投放资讯 AI 评论。 -- 2026-05-29:新增虚拟账号池复用逻辑,账号使用 `ai_comment_` 前缀、昵称使用 `AI评论员` 前缀,避免额外扩张用户表结构。 -- 2026-05-29:AI 评论内容通过 `AiService::generateArticleComment()` 基于标题、摘要和正文生成专业评论,到点后再落库到 `la_article_comment` 并同步评论数。 +完成内容: +- 发现新澳六合(xa6)和旧奥六合(a6)的 draw 类型帖子自 2026-05-29 起停止更新,根源为第三方 API 变更响应格式。 +- 字段变更:开奖号码数组从 `openCode` 迁移到 `currentResult`,期号从 `issue` 迁移到 `currentCompleteIssue`/`currentIssue`。 +- 字段编码:五行由中文(金木水火土)变为字母编码(j/m/s/h/t),单双由中文(单双)变为字母编码(o/e),大小由中文(大小)变为字母编码(b/s),颜色新增 R/G/B 编码。 +- 时间格式:开奖时间从时间戳变为 `"Y-m-d H:i:s"` 字符串格式。 +- 修复 `lottery_community.py` 的 `build_draw_post` 函数,添加 `WUXING_MAP`、`ODD_EVEN_MAP`、`SIZE_MAP` 等映射表,增强 `color_text` 函数支持 R/G/B 编码,增强 `format_time` 函数支持字符串时间格式。 +- 修复后的代码在 2026-05-31 18:10 的执行中成功同步:xa6 新增 92 条(含 1 条 draw + 91 条 gallery),a6 更新 101 条。 +- 数据库验证:xa6 和 a6 的 draw 类型均已同步到最新 2026151 期,gallery 类型同步到最新数据。 +- 注意:2026149-2026150 期因 API 格式变更期间不可回溯(API 只返回当前期),已无法补回。 +涉及模块: +- `server/public/dongqiudi-crawler/lottery_community.py`