diff --git a/pom.xml b/pom.xml index d5b93127..9425a2df 100644 --- a/pom.xml +++ b/pom.xml @@ -35,6 +35,7 @@ 8.2.2 4.1.2 2.5.1 + 2.7.0 2.14.2 @@ -151,6 +152,13 @@ ${pinyin4j.version} + + + com.github.binarywang + weixin-java-mp + ${weixin.version} + + com.yanzhu diff --git a/yanzhu-auth/src/main/java/com/yanzhu/auth/controller/TokenController.java b/yanzhu-auth/src/main/java/com/yanzhu/auth/controller/TokenController.java index e749911c..020a1350 100644 --- a/yanzhu-auth/src/main/java/com/yanzhu/auth/controller/TokenController.java +++ b/yanzhu-auth/src/main/java/com/yanzhu/auth/controller/TokenController.java @@ -2,6 +2,7 @@ package com.yanzhu.auth.controller; import com.yanzhu.auth.form.LoginBody; import com.yanzhu.auth.form.RegisterBody; +import com.yanzhu.auth.form.WxLoginBody; import com.yanzhu.auth.service.SysLoginService; import com.yanzhu.common.core.constant.SecurityConstants; import com.yanzhu.common.core.domain.R; @@ -51,6 +52,15 @@ public class TokenController return R.ok(tokenService.createToken(userInfo)); } + @PostMapping("wxLogin") + public R wxLogin(@RequestBody WxLoginBody form) + { + // 用户登录 + LoginUser userInfo = sysLoginService.wxLogin(form.getCode(), form.getAppId()); + // 获取登录token + return R.ok(tokenService.createToken(userInfo)); + } + /** * 切换项目登录 * @param proId 切换项目登录 diff --git a/yanzhu-auth/src/main/java/com/yanzhu/auth/form/WxLoginBody.java b/yanzhu-auth/src/main/java/com/yanzhu/auth/form/WxLoginBody.java new file mode 100644 index 00000000..d3a5133d --- /dev/null +++ b/yanzhu-auth/src/main/java/com/yanzhu/auth/form/WxLoginBody.java @@ -0,0 +1,35 @@ +package com.yanzhu.auth.form; + +/** + * 微信登录对象 + * + * @author ruoyi + */ +public class WxLoginBody { + + /** + * 用户代码 + */ + private String code; + + /** + * 应用代码 + */ + private String appId; + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } +} diff --git a/yanzhu-auth/src/main/java/com/yanzhu/auth/service/SysLoginService.java b/yanzhu-auth/src/main/java/com/yanzhu/auth/service/SysLoginService.java index aa35ad39..3b3b6960 100644 --- a/yanzhu-auth/src/main/java/com/yanzhu/auth/service/SysLoginService.java +++ b/yanzhu-auth/src/main/java/com/yanzhu/auth/service/SysLoginService.java @@ -119,6 +119,84 @@ public class SysLoginService return userInfo; } + /** + * 登录 + */ + public LoginUser wxLogin(String code, String appId) + { + + // 用户名或密码为空 错误 + if (StringUtils.isAnyBlank(username, password)) + { + recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "用户/密码必须填写"); + throw new ServiceException("用户/密码必须填写"); + } + // 密码如果不在指定范围内 错误 + if (password.length() < UserConstants.PASSWORD_MIN_LENGTH + || password.length() > UserConstants.PASSWORD_MAX_LENGTH) + { + recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "用户密码不在指定范围"); + throw new ServiceException("用户密码不在指定范围"); + } + // 用户名不在指定范围内 错误 + if (username.length() < UserConstants.USERNAME_MIN_LENGTH + || username.length() > UserConstants.USERNAME_MAX_LENGTH) + { + recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "用户名不在指定范围"); + throw new ServiceException("用户名不在指定范围"); + } + // IP黑名单校验 + String blackStr = Convert.toStr(redisService.getCacheObject(CacheConstants.SYS_LOGIN_BLACKIPLIST)); + if (IpUtils.isMatchedIp(blackStr, IpUtils.getIpAddr())) + { + recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "很遗憾,访问IP已被列入系统黑名单"); + throw new ServiceException("很遗憾,访问IP已被列入系统黑名单"); + } + // 查询用户信息 + R userResult = remoteUserService.getUserInfo(username, SecurityConstants.INNER); + + if (StringUtils.isNull(userResult) || StringUtils.isNull(userResult.getData())) + { + recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "登录用户不存在"); + throw new ServiceException("登录用户:" + username + " 不存在"); + } + + if (R.FAIL == userResult.getCode()) + { + throw new ServiceException(userResult.getMsg()); + } + + LoginUser userInfo = userResult.getData(); + SysUser user = userResult.getData().getSysUser(); + if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) + { + recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "对不起,您的账号已被删除"); + throw new ServiceException("对不起,您的账号:" + username + " 已被删除"); + } + if (UserStatus.DISABLE.getCode().equals(user.getStatus())) + { + recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "用户已停用,请联系管理员"); + throw new ServiceException("对不起,您的账号:" + username + " 已停用"); + } + passwordService.validate(user, password); + recordLogService.recordLogininfor(username, Constants.LOGIN_SUCCESS, "登录成功"); + + // 补充用户项目信息 + if(Objects.nonNull(user.getActiveComId())){ + userInfo.setProjectDeptId(user.getActiveComId()); + } + if(Objects.nonNull(user.getActiveComName())){ + userInfo.setProjectDeptName(user.getActiveComName()); + } + if(Objects.nonNull(user.getActiveProjectId())){ + userInfo.setProjectId(user.getActiveProjectId()); + } + if(Objects.nonNull(user.getActiveProjectName())){ + userInfo.setProjectName(user.getActiveProjectName()); + } + return userInfo; + } + public void logout(String loginName) { recordLogService.recordLogininfor(loginName, Constants.LOGOUT, "退出成功"); diff --git a/yanzhu-common/yanzhu-common-core/pom.xml b/yanzhu-common/yanzhu-common-core/pom.xml index 2cfbb8b1..41c376f9 100644 --- a/yanzhu-common/yanzhu-common-core/pom.xml +++ b/yanzhu-common/yanzhu-common-core/pom.xml @@ -119,5 +119,11 @@ pinyin4j + + + com.github.binarywang + weixin-java-mp + + diff --git a/yanzhu-modules/yanzhu-manage/pom.xml b/yanzhu-modules/yanzhu-manage/pom.xml index 9ce725b9..66c7ca47 100644 --- a/yanzhu-modules/yanzhu-manage/pom.xml +++ b/yanzhu-modules/yanzhu-manage/pom.xml @@ -83,12 +83,6 @@ provided - - com.github.binarywang - weixin-java-mp - 2.7.0 - - com.yanzhu diff --git a/yanzhu-ui-app/.gitignore b/yanzhu-ui-app/.gitignore index cbbe6114..9154f4c7 100644 --- a/yanzhu-ui-app/.gitignore +++ b/yanzhu-ui-app/.gitignore @@ -1,8 +1,26 @@ -node_modules/ -dist/** -.project -unpackage/ -.DS_Store -wxcomponents/**/*.vue -wxcomponents/**/*.css -.hbuilderx/ \ No newline at end of file +# ---> Java +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* +replay_pid* + diff --git a/yanzhu-ui-app/App.vue b/yanzhu-ui-app/App.vue deleted file mode 100644 index 95bb2f22..00000000 --- a/yanzhu-ui-app/App.vue +++ /dev/null @@ -1,28 +0,0 @@ - - - - \ No newline at end of file diff --git a/yanzhu-ui-app/LICENSE b/yanzhu-ui-app/LICENSE deleted file mode 100644 index 2c46dbaf..00000000 --- a/yanzhu-ui-app/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2022 若依 - -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/yanzhu-ui-app/README.md b/yanzhu-ui-app/README.md index 95b2ab4f..cc281552 100644 --- a/yanzhu-ui-app/README.md +++ b/yanzhu-ui-app/README.md @@ -1,52 +1,40 @@ + +

研筑-临时工程项目管理App

+

基于RuoYi+Flowable 6.x的工作流管理平台

- logo -

-

RuoYi v1.1.0

-

基于UniApp开发的轻量级移动端框架

-

- - - +

## 平台简介 -RuoYi App 移动解决方案,采用uniapp框架,一份代码多终端适配,同时支持APP、小程序、H5!实现了与[RuoYi-Vue](https://gitee.com/y_project/RuoYi-Vue)、[RuoYi-Cloud](https://gitee.com/y_project/RuoYi-Cloud)完美对接的移动解决方案!目前已经实现登录、我的、工作台、编辑资料、头像修改、密码修改、常见问题、关于我们等基础功能。 +基于RuoYi-vue + Flowable 6.x 的工作流管理平台 ~ -* 配套后端代码仓库地址[RuoYi-Vue](https://gitee.com/y_project/RuoYi-Vue) 或 [RuoYi-Cloud](https://github.com/yangzongzhuan/RuoYi-Cloud) 版本。 -* 应用框架基于[uniapp](https://uniapp.dcloud.net.cn/),支持小程序、H5、Android和IOS。 -* 前端组件采用[uni-ui](https://github.com/dcloudio/uni-ui),全端兼容的高性能UI框架。 -* 阿里云折扣场:[点我进入](http://aly.ruoyi.vip),腾讯云秒杀场:[点我进入](http://txy.ruoyi.vip)   -* 阿里云优惠券:[点我领取](https://www.aliyun.com/minisite/goods?userCode=brki8iof&share_source=copy_link),腾讯云优惠券:[点我领取](https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=//console)   +- 不定时同步[RuoYi-Vue](https://gitee.com/y_project/RuoYi-Vue)至最新版本。 +- 前端采用Vue、Element UI。 +- 后端采用Spring Boot、Spring Security、Redis & Jwt。 +- 权限认证使用Jwt,支持多终端认证系统。 +- 支持加载动态权限菜单,多方式轻松权限控制. +- 项目地址:[Gitee](https://gitee.com/tony2y/RuoYi-flowable.git)   [Github](https://github.com/tony2y/RuoYi-flowable.git) +- 阿里云折扣场:[点我进入](https://www.aliyun.com/activity/daily/bestoffer?userCode=q2b8atsa),腾讯云秒杀场:[点我进入](https://curl.qcloud.com/W5KFkBG4)   +- 阿里云优惠券:[点我领取](https://www.aliyun.com/daily-act/ecs/activity_selection?userCode=q2b8atsa),腾讯云优惠券:[点我领取](https://curl.qcloud.com/AacfyRxq)   +- 特别鸣谢:[RuoYi-Vue](https://gitee.com/y_project/RuoYi-Vue) +## 内置功能 +- 在线流程设计器 +- 在线流程表单设计器 +- 单节点配置表单 +- 多实例会签任务 +- 任务节点配置任务/执行监听器 +- 动态配置任务候选人 +- 其它流程相关功能点 -## 技术文档 +## 演示地址 -- 官网网站:[http://ruoyi.vip](http://ruoyi.vip) -- 文档地址:[http://doc.ruoyi.vip](http://doc.ruoyi.vip) -- H5页体验:[http://h5.ruoyi.vip](http://h5.ruoyi.vip) -- QQ交流群: ①133713780(满)、②146013835 -- 小程序体验 +- 开源版演示地址:http://open.tony2y.top +- Vue2 / Vue3 演示地址(付费版):http://vue3.tony2y.top +- 使用文档:https://www.yuque.com/u1024153/icipor -小程序演示 - +## 其它业务系统 -## 演示图 - - - - - - - - - - - - - - - - - -
+- [[ 智慧农业认养系统 ]](https://gitee.com/tony2y/smart-breed):基于Java + SpringBoot + Mybatis Plus + Redis + Vue + antdv,支持认养、商城、营销、会员、进销存、多租户等功能,包含小程序,系统管理后台。 +- [[ 智慧景区管理系统 ]](https://gitee.com/tony2y/scenic-spot):基于Java + SpringBoot + Mybatis Plus + Redis + Vue + antdv,支持景区管理、售票、地块管理、认养、商城、农资管理、积分兑换等功能,包含小程序,系统管理后台。 \ No newline at end of file diff --git a/yanzhu-ui-app/api/callup.js b/yanzhu-ui-app/api/callup.js deleted file mode 100644 index 7f18bf68..00000000 --- a/yanzhu-ui-app/api/callup.js +++ /dev/null @@ -1,71 +0,0 @@ -import request from '@/utils/request' -import upload from '@/utils/upload' - -// 上传文件 -export function saveFileManagement(data) { - return request({ - url: '/apiwork/fileApi/saveFileManagement', - method: 'post', - data:data - }) -} - -// 下载文件时调用 -export function countLikeNum(val) { - return request({ - url: '/apiwork/fileApi/countLikeNum/' + val, - method: 'get', - }) -} - -// 点赞/取消点赞 -export function fileApilike(val) { - return request({ - url: '/apiwork/fileApi/like/' + val, - method: 'get', - }) -} - -// 宣传资料列表 -export function findAll(data) { - return request({ - url: '/apiwork/fileApi/findAll', - method: 'get', - data: data, - }) -} - -// 工單提交 -export function submitWork(data) { - return request({ - 'url': '/apiwork/work/tzzrz/createTzzWork', - method: 'post', - data: data, - }) -} -// 文件上传 -export function uploadFile(data) { - return upload({ - url: '/common/upload', - method:'PUT', - name: data.name, - filePath: data.filePath - }) -} - -// 查询意见反馈类型列表 -export function ideaType(data) { - return request({ - 'url': '/apiwork/tyPublicApi/idea/v1/ideaType', - method: 'get' - }) -} - -// 提交反馈 -export function feedbackSub(data) { - return request({ - 'url': '/apiwork/tyPublicApi/idea/v1/add', - method: 'post', - data: data, - }) -} \ No newline at end of file diff --git a/yanzhu-ui-app/api/index.js b/yanzhu-ui-app/api/index.js deleted file mode 100644 index 3c36f0de..00000000 --- a/yanzhu-ui-app/api/index.js +++ /dev/null @@ -1,71 +0,0 @@ -import request from '@/utils/request' - -// 预警消息 -export function update(data) { - return request({ - url: '/system/warning', - method: 'put', - data:data - }) -} - -// 预警消息 -export function warningList(query) { - return request({ - url: '/system/warning/list', - method: 'get', - params: query - }) -} - -// 新增投诉工单 -export function addOrder(data) { - return request({ - url: '/system/order', - method: 'post', - data: data - }) -} - -// 查询投诉列表 -export function listuser(query) { - return request({ - url: '/system/order/listuser', - method: 'get', - params: query - }) -} - -// 查询工单列表 -export function listOrder(query) { - return request({ - url: '/system/order/list', - method: 'get', - params: query - }) -} - -// 查询工单列表 -export function recordOrder(id) { - return request({ - url: '/system/record/list?workOrderId=' + id, - method: 'get' - }) -} - -// 签到/完成任务 -export function record(query) { - return request({ - url: '/system/order/task/record', - method: 'post', - data: query - }) -} - -// 查询工单详情 -export function getOrder(id) { - return request({ - url: '/system/order/' + id, - method: 'get' - }) -} \ No newline at end of file diff --git a/yanzhu-ui-app/api/login.js b/yanzhu-ui-app/api/login.js deleted file mode 100644 index 4705475f..00000000 --- a/yanzhu-ui-app/api/login.js +++ /dev/null @@ -1,50 +0,0 @@ -import request from '@/utils/request' - -// 获取用户详细信息 -export function getInfo() { - return request({ - 'url': '/wechat/userinfo/getUserInfo', - 'method': 'get' - }) -} - -// 退出方法 -export function logout() { - return request({ - 'url': '/auth/logout', - 'method': 'delete' - }) -} - -//手机号登陆 -export function phoneLogin(data) { - return request({ - url: '/auth/phoneLogin', - headers: { - isToken: false - }, - method: 'post', - data: data - }) -} - -//获取OPENID 存sessionkey -export function getOpenIdByCode(data) { - return request({ - url: '/auth/getOpenIdByCode', - headers: { - isToken: false - }, - method: 'post', - data: data - }) -} - -//获取微信手机号 -export function getWxUserPhone(data) { - return request({ - url: '/auth/getWxUserPhone', - method: 'post', - data: data - }) -} diff --git a/yanzhu-ui-app/components/navbar/Navbar.vue b/yanzhu-ui-app/components/navbar/Navbar.vue deleted file mode 100644 index 28bc775b..00000000 --- a/yanzhu-ui-app/components/navbar/Navbar.vue +++ /dev/null @@ -1,83 +0,0 @@ - - - - - \ No newline at end of file diff --git a/yanzhu-ui-app/components/navbar/homebar.vue b/yanzhu-ui-app/components/navbar/homebar.vue deleted file mode 100644 index 7ab3c4d5..00000000 --- a/yanzhu-ui-app/components/navbar/homebar.vue +++ /dev/null @@ -1,16 +0,0 @@ - - - - - \ No newline at end of file diff --git a/yanzhu-ui-app/components/tabbar.vue b/yanzhu-ui-app/components/tabbar.vue deleted file mode 100644 index e417830d..00000000 --- a/yanzhu-ui-app/components/tabbar.vue +++ /dev/null @@ -1,99 +0,0 @@ - - - - \ No newline at end of file diff --git a/yanzhu-ui-app/components/uni-section/uni-section.vue b/yanzhu-ui-app/components/uni-section/uni-section.vue deleted file mode 100644 index 9a52e0b8..00000000 --- a/yanzhu-ui-app/components/uni-section/uni-section.vue +++ /dev/null @@ -1,167 +0,0 @@ - - - - diff --git a/yanzhu-ui-app/config.js b/yanzhu-ui-app/config.js deleted file mode 100644 index fffa5bc4..00000000 --- a/yanzhu-ui-app/config.js +++ /dev/null @@ -1,27 +0,0 @@ -// 应用全局配置 -module.exports = { - // test - baseUrl: 'http://192.168.16.104:8080', - // baseUrl: 'http://192.168.16.104:8080', - // 应用信息 - appInfo: { - // 应用名称 - name: "ruoyi-app", - // 应用版本 - version: "1.1.0", - // 应用logo - logo: "/static/logo.png", - // 官方网站 - site_url: "http://ruoyi.vip", - // 政策协议 - agreements: [{ - title: "隐私政策", - url: "" - }, - { - title: "用户服务协议", - url: "" - } - ] - } -} \ No newline at end of file diff --git a/yanzhu-ui-app/main.js b/yanzhu-ui-app/main.js deleted file mode 100644 index a682b47a..00000000 --- a/yanzhu-ui-app/main.js +++ /dev/null @@ -1,26 +0,0 @@ -import Vue from 'vue' -import App from './App' -import store from './store' // store -import plugins from './plugins' // plugins -import uView from '@/uview-ui' //uview -import './permission' // permission -import homebar from "@/components/navbar/homebar.vue" -import navbar from "@/components/navbar/Navbar.vue" -// import Vconsole from 'vconsole' -// let vConsole = new Vconsole(); - -Vue.use(plugins) -Vue.use(uView) -Vue.config.productionTip = false -Vue.prototype.$store = store -Vue.component('homebar', homebar) -Vue.component('navbar', navbar) -App.mpType = 'app' - -const app = new Vue({ - ...App -}) - -app.$mount() - -// export default vConsole \ No newline at end of file diff --git a/yanzhu-ui-app/manifest.json b/yanzhu-ui-app/manifest.json deleted file mode 100644 index a3f137b7..00000000 --- a/yanzhu-ui-app/manifest.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "name" : "移动端", - "appid" : "__UNI__A076EAE", - "description" : "", - "versionName" : "1.1.0", - "versionCode" : "100", - "transformPx" : false, - "app-plus" : { - "usingComponents" : true, - "nvueCompiler" : "急用工", - "splashscreen" : { - "alwaysShowBeforeRender" : true, - "waiting" : true, - "autoclose" : true, - "delay" : 0 - }, - "modules" : {}, - "distribute" : { - "android" : { - "permissions" : [ - "", - "", - "", - "", - "", - "", - "", - "" - ] - }, - "ios" : {}, - "sdkConfigs" : { - "maps" : { - "amap" : { - "appkey_ios" : "", - "appkey_android" : "" - } - } - } - } - }, - "quickapp" : {}, - "mp-weixin" : { - "appid" : "wxbde64edd3cb15f72", - "setting" : { - "urlCheck" : false, - "es6" : true, - "minified" : true, - "postcss" : true - }, - "optimization" : { - "subPackages" : true - }, - "usingComponents" : true, - "permission" : { - "scope.userLocation" : { - "desc" : "你的位置信息将用于小程序位置接口的效果展示" - } - }, - "requiredPrivateInfos" : [ "chooseAddress", "chooseLocation", "getLocation" ], - "unipush" : { - "enable" : false - } - }, - "vueVersion" : "2", - "h5" : { - "template" : "static/index.html", - "devServer" : { - "port" : 9090, - "https" : false - }, - "title" : "水务投诉平台", - "router" : { - "mode" : "hash", - "base" : "./" - }, - "sdkConfigs" : { - "maps" : { - "qqmap" : { - "key" : "IO6BZ-EJALJ-PXDF5-XOVE6-VRWPO-DUFTO" - } - } - } - } -} diff --git a/yanzhu-ui-app/miniprogram/api/flowable.js b/yanzhu-ui-app/miniprogram/api/flowable.js new file mode 100644 index 00000000..a311cd8b --- /dev/null +++ b/yanzhu-ui-app/miniprogram/api/flowable.js @@ -0,0 +1,169 @@ +import {request} from '../utils/request' + +// 获取流程申请类型 +export function myDefinitionList(data) { + return request({ + url: '/wxApi/flowTask/myDefinitionList', + method: 'get', + data: data + }) +} + +// 启动流程实例 +export function startProcessInstance(data) { + return request({ + url: '/wxApi/flowTask/startProcessInstance', + method: 'post', + data: data + }) +} + +// 查询流程节点 +export function readNotes(deployId) { + return request({ + url: '/wxApi/flowTask/readNotes/'+deployId, + method: 'get' + }) +} + +// 查询流程节点 +export function readDeployNotes(deployId) { + return request({ + url: '/wxApi/flowTask/readDeployNotes/'+deployId, + method: 'get' + }) +} + +// 取消流程申请 +export function stopProcess(data) { + return request({ + url: '/wxApi/flowTask/stopProcess', + method: 'post', + data: data + }) +} + +// 撤回流程办理 +export function revokeProcess(data) { + return request({ + url: '/wxApi/flowTask/revokeProcess', + method: 'post', + data: data + }) +} + +// 审批任务流程 +export function complete(data) { + return request({ + url: '/wxApi/flowTask/complete', + method: 'post', + data: data + }) +} + +// 驳回任务流程 +export function reject(data) { + return request({ + url: '/wxApi/flowTask/reject', + method: 'post', + data: data + }) +} + +// 退回任务流程 +export function returnTask(data) { + return request({ + url: '/wxApi/flowTask/return', + method: 'post', + data: data + }) +} + +// 委派任务流程 +export function delegateTask(data) { + return request({ + url: '/wxApi/flowTask/delegateTask', + method: 'post', + data: data + }) +} + +// 转办任务流程 +export function assignTask(data) { + return request({ + url: '/wxApi/flowTask/assignTask', + method: 'post', + data: data + }) +} + +// 删除流程实例 +export function deleteInstance(instanceId) { + return request({ + url: '/wxApi/flowTask/delete/'+instanceId, + method: 'get' + }) +} + +// 获取所有可回退的节点 +export function returnList(data) { + return request({ + url: '/wxApi/flowTask/returnList', + method: 'post', + data: data + }) +} + +// 根据流程Id查询操作日志 +export function findCommentByProcInsId(data) { + return request({ + url: '/wxApi/flowTask/findCommentByProcInsId', + method: 'get', + data: data + }) +} + +// 根据条件查询我的代办任务 +export function myAwaitFlowTaskList(data) { + return request({ + url: '/wxApi/flowTask/myAwaitFlowTaskList', + method: 'post', + data: data + }) +} + +// 根据条件查询我的已办任务 +export function myFinishedFlowTaskList(query) { + return request({ + url: '/wxApi/flowTask/myFinishedFlowTaskList', + method: 'get', + params: query + }) +} + +// 根据条件查询所有流申请 +export function allInstanceList(data) { + return request({ + url: '/wxApi/flowTask/allList', + method: 'get', + data: data + }) +} + +// 根据条件查询所有流申请 +export function myInstanceList(data) { + return request({ + url: '/wxApi/flowTask/myList', + method: 'get', + data: data + }) +} + +// 根据条件统计所有流程任务 +export function queryTaskCount(data) { + return request({ + url: '/wxApi/flowTask/queryCount', + method: 'get', + data: data + }) +} \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/api/login.js b/yanzhu-ui-app/miniprogram/api/login.js new file mode 100644 index 00000000..167a0ffb --- /dev/null +++ b/yanzhu-ui-app/miniprogram/api/login.js @@ -0,0 +1,44 @@ +import {request} from '../utils/request' + +// 获取验证码 +export function getCodeImg() { + return request({ + url: '/captchaImage', + method: 'get', + }) +} + +// 登录方法 +export function login(data) { + return request({ + url: '/wxApi/login', + method: 'post', + data: data, + }) +} + +// 登录方法 +export function updatePwd(data) { + return request({ + url: '/wxApi/updatePwd', + method: 'post', + data: data, + }) +} + +// 用户退出方法 +export function loginOut() { + return request({ + 'url': '/wxApi/loginOut', + 'method': 'get' + }) +} + +// 刷线用户信息 +export function refreshUser() { + return request({ + 'url': '/wxApi/refreshUserInfo', + 'method': 'get' + }) +} + diff --git a/yanzhu-ui-app/miniprogram/api/project.js b/yanzhu-ui-app/miniprogram/api/project.js new file mode 100644 index 00000000..5d5610a2 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/api/project.js @@ -0,0 +1,60 @@ +import {request} from '../utils/request' + +// 获取项目编号 +export function getProjectNo() { + return request({ + url: '/project/projectInfo/findMyDeptProjectNo', + method: 'get' + }) +} + +// 查询项目信息列表 +export function listProjectInfo(query) { + return request({ + url: '/project/projectInfo/list', + method: 'get', + params: query + }) + } + + // 查询项目信息详细 + export function getProjectInfo(id) { + return request({ + url: '/project/projectInfo/' + id, + method: 'get' + }) + } + + // 新增项目信息 + export function addProjectInfo(data) { + return request({ + url: '/project/projectInfo', + method: 'post', + data: data + }) + } + + // 修改项目信息 + export function updateProjectInfo(data) { + return request({ + url: '/project/projectInfo', + method: 'put', + data: data + }) + } + + // 删除项目信息 + export function delProjectInfo(id) { + return request({ + url: '/project/projectInfo/' + id, + method: 'delete' + }) + } + + // 我的部门项目 + export function findMyDeptProject() { + return request({ + url: '/project/projectInfo/findMyDeptProject', + method: 'get' + }) + } \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/api/projectApply.js b/yanzhu-ui-app/miniprogram/api/projectApply.js new file mode 100644 index 00000000..7e5e1c44 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/api/projectApply.js @@ -0,0 +1,72 @@ +import { + request +} from '../utils/request' + +// 修改项目申请信息 +export function updateProjectApply(data) { + return request({ + url: '/project/projectApply', + method: 'put', + data: data + }) +} + +// 验收申请列表 +export function checkApplyList(query) { + return request({ + url: '/project/projectApply/checkApplyList', + method: 'get', + params: query + }) +} + +// 验收申请列表 +export function findGroupCountByStatus(query) { + return request({ + url: '/project/projectApply/findGroupCountByStatus', + method: 'get', + params: query + }) +} + +// 创建二维码 +export function createQr(id) { + return request({ + url: '/project/projectApply/createQr/'+id, + method: 'get' + }) +} + +// 保存验收 +export function editApplyChecked(data) { + return request({ + url: '/project/projectApply/editApplyChecked', + method: 'put', + data: data + }) +} + +// 验收详情 +export function findApplyDetailAllCheck(detailId) { + return request({ + url: '/manage/proProjectApplyDetailCheck/findAll/'+detailId, + method: 'get' + }) +} + +export function addApplyDetail(data) { + return request({ + url: '/project/projectApply/addApplyDetail', + method: 'post', + data: data + }) +} + +// 添加验收 +export function addApplyDetailCheck(data) { + return request({ + url: '/manage/proProjectApplyDetailCheck', + method: 'post', + data: data + }) +} \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/api/publics.js b/yanzhu-ui-app/miniprogram/api/publics.js new file mode 100644 index 00000000..ba00d996 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/api/publics.js @@ -0,0 +1,59 @@ +import {request} from '../utils/request' + +// 获取用户详细信息 +export function getUserInfo() { + return request({ + url: '/wxApi/publics/user/info', + method: 'get' + }) +} + +// 查询用户菜单信息 +export function selectRoleMenuList(data) { + return request({ + url: '/wxApi/publics/v1/selectRoleMenuList', + method: 'get', + data: data + }) +} + +// 查询用户待办信息 +export function findMyTask(data) { + return request({ + url: '/wxApi/flowTask/myAwaitFlowTaskListCount', + method: 'post', + data:data + }) +} + +// 查询用户部门信息 +export function findMyDeptList(){ + return request({ + url: '/wxApi/publics/v1/findMyDeptList', + method: 'get' + }) +} + +// 查询用户项目信息 +export function findMyProjectList(){ + return request({ + url: '/wxApi/publics/v1/findMyProjectList', + method: 'get' + }) +} + +// 查询部门资产列表信息 +export function findAllByCategory(category){ + return request({ + url: '/wxApi/publics/v1/findAllByCategory/'+category, + method: 'get' + }) +} + +// 获取项目申请详细信息 +export function findProjectApplyData(id){ + return request({ + url: '/wxApi/publics/projectApply/'+id, + method: 'get' + }) +} \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/app.js b/yanzhu-ui-app/miniprogram/app.js new file mode 100644 index 00000000..61939bb4 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/app.js @@ -0,0 +1,181 @@ +import { + getToken +} from '/utils/auth' + +//全局分享 +! function () { + var PageTmp = Page; + Page = function (pageConfig) { + // 设置全局默认分享 + pageConfig = Object.assign({ + //右上角分享功能 + onShareAppMessage() { + return { + title: '智慧工地优管', //分享标题 + path: '/pages/login/login', //分享用户点开后页面 + success(res) { + console.log('分享成功!') + } + } + } + }, pageConfig); + PageTmp(pageConfig); + }; +}(); + +App({ + globalData: { + userData: null, + paramDeptId: '', + useProjectId: '', + useProjectName: '', + searchProject: { + id: "", + text: "全部临时项目", + projectId: "", + projectName: "全部临时项目" + }, + projectInfoList: [], + }, + + onLaunch: function () { + if (!wx.cloud) { + console.error('请使用 2.2.3 或以上的基础库以使用云能力') + } else { + wx.cloud.init({ + // env 参数说明: + // env 参数决定接下来小程序发起的云开发调用(wx.cloud.xxx)会默认请求到哪个云环境的资源 + // 此处请填入环境 ID, 环境 ID 可打开云控制台查看 + // 如不填则使用默认环境(第一个创建的环境) + // env: 'my-env-id', + traceUser: true, + }) + } + this.autoUpdate(); + + /** + * 初始化页面未登录时跳转到登录页 + */ + if (!getToken()) { + setTimeout(() => { + this.toast("请使用手机号码登录"); + }, 1000); + wx.redirectTo({ + url: '/pages/login/index', + }); + return false; + } + }, + + onLoad() { + + }, + + //页面弹窗 + toast: function (msg, type) { + wx.showToast({ + title: msg, + icon: type === undefined ? 'none' : type, + duration: 1000, + mask: true + }); + }, + + /** + * 计算时差 + * @param {*} val + */ + getDurationDate: function (val) { + // 计算出相差天数 + let days = Math.floor(val / (24 * 3600 * 1000)) + // 计算出小时数 + let leave1 = val % (24 * 3600 * 1000) // 计算天数后剩余的毫秒数 + let hours = Math.floor(leave1 / (3600 * 1000)) + // 计算相差分钟数 + let leave2 = leave1 % (3600 * 1000) // 计算小时数后剩余的毫秒数 + let minutes = Math.floor(leave2 / (60 * 1000)) + // 计算相差秒数 + let leave3 = leave2 % (60 * 1000) // 计算分钟数后剩余的毫秒数 + let seconds = Math.round(leave3 / 1000) + if (days > 0) { + if (days < 10) days = "0" + days; + if (hours < 10) hours = "0" + hours; + if (minutes < 10) minutes = "0" + minutes; + if (seconds < 10) seconds = "0" + seconds; + return days + '天' + hours + '小时' + minutes + '分钟' + seconds + '秒'; + } + if (hours > 0) { + if (hours < 10) hours = "0" + hours; + if (minutes < 10) minutes = "0" + minutes; + if (seconds < 10) seconds = "0" + seconds; + return hours + '小时' + minutes + '分钟' + seconds + '秒'; + } + if (minutes > 0) { + if (minutes < 10) minutes = "0" + minutes; + if (seconds < 10) seconds = "0" + seconds; + return minutes + '分钟' + seconds + '秒'; + } + if (seconds > 0) { + if (seconds < 10) seconds = "0" + seconds; + return seconds + '秒'; + } + }, + + //版本自动更新 + autoUpdate: function () { + var self = this + // 获取小程序更新机制兼容 + if (wx.canIUse('getUpdateManager')) { + const updateManager = wx.getUpdateManager() + //1. 检查小程序是否有新版本发布 + updateManager.onCheckForUpdate(function (res) { + // 请求完新版本信息的回调 + if (res.hasUpdate) { + //2. 小程序有新版本,则静默下载新版本,做好更新准备 + updateManager.onUpdateReady(function () { + wx.showModal({ + title: '更新提示', + content: '新版本已经准备好,是否重启应用?', + success: function (res) { + if (res.confirm) { + //3. 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 + updateManager.applyUpdate() + } else if (res.cancel) { + //如果需要强制更新,则给出二次弹窗,如果不需要,则这里的代码都可以删掉了 + wx.showModal({ + title: '温馨提示~', + content: '本次更新可能会导致旧版本无法正常访问,请使用新版本', + success: function (res) { + self.autoUpdate() + //第二次提示后,强制更新 + // if (res.confirm) { + // // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 + // updateManager.applyUpdate() + // } else if (res.cancel) { + // //重新回到版本更新提示 + // self.autoUpdate() + // } + } + }) + } + } + }) + }) + updateManager.onUpdateFailed(function () { + // 新的版本下载失败 + wx.showModal({ + title: '已经有新版本了哟~', + content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~', + }) + }) + } + }) + } else { + // 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示 + wx.showModal({ + title: '提示', + content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。' + }) + } + } +}) \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/app.json b/yanzhu-ui-app/miniprogram/app.json new file mode 100644 index 00000000..6b398117 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/app.json @@ -0,0 +1,81 @@ +{ + "pages": [ + "pages/login/login", + "pages/index/index", + "pages/updatePwd/index", + "pages/project_flowable/initTask/index", + "pages/project_flowable/myFlowDefinition/index", + "pages/project_flowable/await/index", + "pages/project_flowable/approveTask/index", + "pages/project_flowable/finished/index", + "pages/project_flowable/detailTask/index", + "pages/project_flowable/editTask/index", + "pages/project_flowable/myProcessIns/index", + "pages/project_info/list/index", + "pages/project_info/add/index", + "pages/project_info/edit/index", + "pages/project_check/list/index", + "pages/project_check/edit/index", + "pages/project_check/info/index" + ], + "usingComponents": { + "van-row": "@vant/weapp/row", + "van-col": "@vant/weapp/col", + "van-popup": "@vant/weapp/popup/index", + "van-picker": "@vant/weapp/picker/index", + "van-datetime-picker": "@vant/weapp/datetime-picker/index", + "van-radio": "@vant/weapp/radio/index", + "van-radio-group": "@vant/weapp/radio-group/index", + "van-toast": "@vant/weapp/toast/index", + "ec-canvas": "ec-canvas/ec-canvas", + "van-sticky": "@vant/weapp/sticky", + "van-calendar": "@vant/weapp/calendar/index", + "van-icon": "@vant/weapp/icon/index", + "van-image": "@vant/weapp/image/index", + "pie-chart": "pages/components/pie-chart/index", + "deep-select": "pages/components/deep-select/index", + "select-btn": "pages/components/select-btn/index", + "bar-chart": "pages/components/bar-chart/index", + "bar-chart-warning": "pages/components/bar-chart-warning/index", + "pz-screen": "pages/components/pz-screen/index", + "pz-screen-training": "pages/components/pz-screen-training/index", + "pz-screen-training-index": "pages/components/pz-screen-training-index/index", + "select-date": "pages/components/select-date/index", + "voucher-select": "pages/components/voucher-select/index", + "voucher-selects": "pages/components/voucher-selects/index", + "voucher-selected": "pages/components/voucher-selected/index", + "voucher-date": "pages/components/voucher-date/index", + "voucher-datetime": "pages/components/voucher-datetime/index", + "file-uploader": "pages/components/file-uploader/index", + "file-uploader-all":"pages/components/file-uploader-all/index", + "project-select": "pages/components/project-select/index", + "safety-pie-chart": "./components/safety-pie-chart/index", + "safety-pie-charts": "./components/safety-pie-charts/index", + "safety-bar-chart": "./components/safety-bar-chart/index", + "safety-bar-charts": "./components/safety-bar-charts/index", + "safety-bar-chartss": "./components/safety-bar-chartss/index", + "voucher-many-select": "pages/components/voucher-many-select/index", + "sign": "pages/components/sign/sign", + "safety-number": "./components/number/index", + "select-person": "./components/select-person/index", + "select-group-person": "./components/select-group-person/index", + "van-dropdown-menu": "@vant/weapp/dropdown-menu/index", + "van-dropdown-item": "@vant/weapp/dropdown-item/index", + "curve-echarts": "pages/components/curve-echarts/index" + }, + "window": { + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#191d28", + "navigationBarTextStyle": "white" + }, + "style": "v2", + "sitemapLocation": "sitemap.json", + "permission": { + "scope.userLocation": { + "desc": "你的位置信息将用于小程序位置接口的效果展示" + } + }, + "requiredPrivateInfos": [ + "getLocation" + ] +} \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/app.wxss b/yanzhu-ui-app/miniprogram/app.wxss new file mode 100644 index 00000000..1797ce22 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/app.wxss @@ -0,0 +1,2000 @@ +/**app.wxss**/ +.container { + height: 100%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: space-between; + padding: 200rpx 0; + box-sizing: border-box; + +} + +page { + background: #191d28; + color: #ffffff; + font-size: 30rpx; + height: 100vh; +} + +/* 自定义顶部样式 */ +.header_title { + position: fixed; + width: 100%; + z-index: 5; + margin: 0; + padding: 85rpx 0 30rpx; + background: #191d28; +} + +/* 自定义顶部样式 */ +.header_title_saft { + width: 100%; + z-index: 5; + margin: 0; + padding: 85rpx 0 30rpx; + background: #191d28; +} + +.header_name { + text-align: center; +} + +.header_img { + padding-left: 30rpx; + padding-top: 10rpx; +} + +.header_fh { + font-size: 28rpx; + position: relative; + top: -5rpx; +} + +.header_img image { + width: 30rpx; + height: 30rpx; +} + +/* 中间内容用含有max_content 的 view 包起来 */ +.max_content { + padding: 166rpx 0 180rpx; +} + +.max_content_scroll { + padding: 166rpx 0 10rpx; +} + +.min_content { + padding: 166rpx 0 20rpx; +} + +.max_new_content { + padding: 0 0 120rpx; +} + +/* 左侧菜单 */ +.left_max { + padding-top: 180rpx; +} + +.left_head { + width: 140rpx; + height: 140rpx; + margin: auto; + background: #2b345b; + border-radius: 50%; +} + +.left_head image { + width: 140rpx; + height: 140rpx; + border-radius: 50%; +} + +.left_info { + font-size: 28rpx; + padding-top: 10rpx; +} + +.left_info_name { + padding: 10rpx; +} + +.left_info_dept { + text-align: center; + margin-bottom: 40rpx; +} + +.left_manage_max { + padding: 50rpx 0; +} + +.left_manage_min { + padding: 0 5%; + margin-top: 40rpx; +} + +.left_manage { + padding: 20rpx 20rpx 15rpx; + background: #2b345b; + border-radius: 100rpx; + font-size: 28rpx; + text-align: center; +} + +.left_manage:active { + background: #232a4a; +} + +.left_pro { + position: relative; + top: -10rpx; + padding-left: 20rpx; +} + +.left_icon { + width: 40rpx; + height: 40rpx; + float: left; +} + +.left_flaot { + width: 40rpx; + height: 40rpx; + float: right; +} + +.left_password { + text-align: center; + padding-bottom: 5rpx; +} + +.left_sign { + text-align: center; + padding-bottom: 5rpx; + color: #F56C6C; +} + +.left_begin { + text-align: center; + padding-bottom: 5rpx; + color: #faf8ff; +} + +.left_manage2 { + float: left; + width: 50%; + margin-bottom: 35rpx; + color: #ffffff; +} + +/* 底部导航 */ +.van-tabbar.van-tabbar--fixed { + background-image: linear-gradient(#33426b, #202b47); +} + +.van-tabbar.van-tabbar--fixed:after { + border-width: 0px 0; +} + +/* 页面公用部分样式 */ +.video_add { + padding: 20rpx 30rpx; +} + +.video_address { + background: #30343f; + padding: 0 20rpx; + border-radius: 50rpx; + font-size: 28rpx; +} + +.video_address_min { + background: url("http://fileimg.makalu.cc/CORE_B1C818B4CF2C44FE9D96624589329EBC.png") no-repeat left/40rpx; + height: 80rpx; + line-height: 80rpx; + padding-left: 50rpx; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + word-break: break-all; +} + +/* 清除上浮 */ +.clearfix:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} + +.gif { + margin: 400rpx auto 0; + text-align: center; +} + +.gif image { + width: 60rpx; + height: 60rpx; +} + +.gif view { + padding-top: 20rpx; +} + +/* 建安公司新页面 */ +.modify_video_nav { + background: #32416a; + margin-top: 20rpx; + display: flex; + align-items: center; + justify-content: space-evenly; + padding: 25rpx 0; + color: #7c95d7; +} + +.modify_video_nav .active { + color: #ffffff; +} + +.modify_video_nav .active text { + padding: 15rpx 0; + border-bottom: 3px solid #5c9efe; +} + +.modify_echarts_max { + margin-top: 30rpx; + padding: 0 20rpx; +} + +.modify_echarts_min { + background: #1e2336; + font-size: 28rpx; + padding: 30rpx; +} + +.modify_echarts_title_min { + padding: 10rpx; + display: flex; + justify-content: space-between; + align-items: center; +} + +.modify_eharts_title { + height: 40rpx; + line-height: 40rpx; + padding-left: 40rpx; + background: url("http://fileimg.makalu.cc/CORE_52887EE6A33042408E11C2174974ABA1.png") no-repeat left/35rpx; +} + +.modify_list_btn { + font-size: 28rpx; + color: #7a8fce; +} + +.modify_video_work_area { + margin-top: 20rpx; + padding: 10rpx 30rpx; +} + +.modify_video_work_area { + height: 40rpx; + line-height: 40rpx; + padding-left: 40rpx; + font-size: 28rpx; + background: url("http://fileimg.makalu.cc/CORE_52887EE6A33042408E11C2174974ABA1.png") no-repeat left/35rpx; +} + +.video_ai_survey { + padding: 15rpx; +} + +.ai_video_con { + display: flex; + justify-content: space-between; + align-items: center; + padding: 30rpx 0 30rpx 30rpx; + color: #ffffff; +} + +.ai_video_con_title { + display: flex; + align-items: center; +} + +.ai_video_con_title image { + width: 40rpx; + height: 40rpx; +} + +.ai_video_con_title text { + padding-left: 15rpx; +} + +.ai_video_con_number text { + font-size: 35rpx; + font-weight: bold; + color: #00ecfe; +} + +.video_list_max { + padding: 15rpx; +} + +.ai_warning_list { + padding: 30rpx 0; + border-bottom: 1px solid #404a74; + display: flex; + align-items: center; +} + +.ai_warning_list_img { + width: 220rpx; + height: 180rpx; + border-radius: 8rpx; +} + +.ai_warning_list_con { + padding-left: 20rpx; + font-size: 30rpx; + width: calc(100% - 240rpx); +} + +.ai_warning_list_con .ai_warning_list_project { + padding: 5rpx 0; + color: #ffffff; + font-weight: bold; +} + +.ai_warning_list_con view { + padding: 7rpx 0; + +} + +.ai_warning_list_reason text { + color: #ff8909; +} + +.ai_warning_list_position text { + color: #00a8ff; +} + +.ai_warning_list_time { + font-size: 26rpx; + display: flex; + align-items: center; + justify-content: space-between; +} + +.ai_warning_list_time_date { + color: #89a3ed; +} + +.ai_warning_list_video_btn { + background: #404a74; + font-size: 22rpx; + border-radius: 5rpx; + color: #ffffff; + padding: 5rpx 10rpx !important; + display: flex; + align-items: center; +} + +.ai_warning_list_video_btn image { + width: 22rpx; + height: 22rpx; + margin-right: 10rpx; +} + +.video_icon text { + font-size: 36rpx; + color: #00a8ff; +} + +.video_num { + padding: 0 30rpx; + height: 120rpx; +} + +.video_icon { + font-size: 28rpx; + text-align: center; + padding: 30rpx 0; +} + +.video_icon image { + width: 40rpx; + height: 40rpx; + position: relative; + top: 10rpx; +} + +.vehicle_video_nav_max { + padding: 10rpx 20rpx; +} + +.vehicle_video_nav_min { + background: #1c2232; + display: flex; + align-items: center; +} + +.vehicle_video_nav { + padding: 20rpx; + font-size: 28rpx; +} + +.vehicle_video_nav.active { + background: #2b345b; + border-radius: 10rpx; +} + +.modify_vehicle_video { + padding: 30rpx 10rpx 0; +} + +.modify_vehicle_video video { + width: 100%; + height: 350rpx; + border-radius: 10rpx; +} + +.modify_list_license_plate_max { + padding: 30rpx 5rpx; +} + +.modify_list_license_plate { + border: 2px solid #2b4169; + text-align: center; + padding: 10rpx 0; + background: #1f253b; +} + +.modify_list_license_direction { + padding: 30rpx 10rpx 10rpx; + font-size: 28rpx; + color: #8ba3ed; +} + +.modify_list_photos_max { + padding: 20rpx 10rpx; +} + +.modify_list_photos_min { + width: 100%; + height: 220rpx; + background: #232943 url("http://fileimg.makalu.cc/WEB_6F3E3915E1A44AF6BE55F4B1BE0E277F.png") no-repeat center/130rpx 130rpx; + border-radius: 10rpx; +} + +.modify_list_photos_min image { + width: 100%; + height: 100%; + border-radius: 10rpx; +} + +.modify_list_photos_time { + padding: 20rpx 0 0; + font-size: 28rpx; + text-align: center; +} + +/* 安全管控 */ +.deep_select { + padding: 15rpx; +} + +.deep_select_padding { + padding: 15rpx; +} + +.deep_point_position { + display: flex; + justify-content: space-evenly; + align-items: center; + font-size: 28rpx; + color: #737478; + padding: 20rpx 0; + margin-bottom: 30rpx; +} + +.deep_point_position .active { + color: #88a2ec; +} + +.deep_point_position .active text { + color: #08d6eb; +} + +.deep_modular_max { + padding: 50rpx 30rpx; +} + +.deep_modular_min { + background: #1e2336; + margin-bottom: 30rpx; +} + +.deep_modular_title { + padding: 20rpx 20rpx; + display: flex; + align-items: center; + justify-content: space-between; + font-size: 28rpx; +} + +.deep_qingxie { + background: url("http://fileimg.makalu.cc/WEB_EE67AE44D92E4894AEF2AAD8A511CFE1.png") no-repeat left/30rpx 30rpx; + padding-left: 40rpx; +} + +.deep_weiyi { + background: url("http://fileimg.makalu.cc/WEB_80265DAD5962462DA855FE1E6E735650.png") no-repeat left/30rpx 30rpx; + padding-left: 40rpx; +} + +.modify_video_nav_af { + margin: 0; +} + +.modify_video_add { + margin-bottom: 30rpx; +} + +.dangerous_node { + display: flex; + align-items: center; + justify-content: space-evenly; + padding: 40rpx 0; +} + +.dangerous_node_min { + text-align: center; +} + +.dangerous_node_number { + font-size: 38rpx; + padding: 15rpx 0; +} + +.cyan { + color: #08d6ed; +} + +.blue { + color: #1879da; +} + +.orange { + color: #fd9729; +} + +.dangerous_node_title { + display: flex; + align-items: center; + justify-content: center; + padding-top: 15rpx; +} + +.dangerous_node_title image { + width: 40rpx; + height: 40rpx; + margin-right: 15rpx; +} + +.timeline_max { + padding: 30rpx 30rpx 30rpx 40rpx; +} + +.timeline_for { + padding-bottom: 50rpx; + border-left: 1px solid #1d2b52; +} + +.timeline_for_title { + padding-bottom: 20rpx; + display: flex; + align-items: center; + position: relative; +} + +.timeline_for_dot { + width: 20rpx; + height: 20rpx; + background: #ff0000; + position: absolute; + left: -10rpx; + border-radius: 50%; +} + +.timeline_for_text { + padding-left: 40rpx; +} + +.timeline_for_list { + padding: 10rpx 0 10rpx 40rpx; + display: flex; + align-items: center; + color: #d4d9ec; +} + +.timeline_for_time { + color: #43aeff; +} + +.timeline_for_state_1 { + padding: 2px 24rpx; + height: 40rpx; + width: 120rpx; + text-align: center; + line-height: 40rpx; + font-size: 26rpx; + background: url("http://fileimg.makalu.cc/WEB_F5E44186F6C44161B99491284E33EEE6.png") no-repeat center/100% 100%; +} + +.timeline_for_state_2 { + padding: 2px 24rpx; + height: 40rpx; + width: 120rpx; + text-align: center; + line-height: 40rpx; + font-size: 26rpx; + background: url("http://fileimg.makalu.cc/WEB_345B9059DAD1492EB37EC4814EB340F0.png") no-repeat center/100% 100%; +} + +.timeline_for_file { + padding: 10rpx 0 10rpx 40rpx; + font-size: 28rpx; + color: #d4d9ec; + display: flex; +} + +.timeline_for_list_title { + width: 140rpx; + padding-top: 10rpx; +} + +.timeline_for_list_file { + padding-top: 10rpx; + width: calc(100% - 140rpx); +} + +.zs_level_list_label { + padding: 0 10rpx; +} + +.zs_level_list_label view { + padding: 10rpx 0; + color: #7f91f5; + text-decoration: underline; +} + +.zs_level_list_label view:active { + color: #4f6aff; +} + +.pz_list_max { + padding: 30rpx 10rpx; +} + +.pz_list_for { + padding: 30rpx; + background: #1e2336; + margin-bottom: 30rpx; +} + +.pz_list_for_list { + padding: 10rpx 0; +} + + +.modify_video_add { + margin-bottom: 30rpx; +} + +.dangerous_node { + display: flex; + align-items: center; + justify-content: space-evenly; + padding: 40rpx 0; +} + +.dangerous_node_min { + text-align: center; +} + +.dangerous_node_number { + font-size: 38rpx; + padding: 15rpx 0; +} + +.cyan { + color: #08d6ed; +} + +.blue { + color: #1879da; +} + +.orange { + color: #fd9729; +} + +.dangerous_node_title { + display: flex; + align-items: center; + justify-content: center; + padding-top: 15rpx; +} + +.dangerous_node_title image { + width: 40rpx; + height: 40rpx; + margin-right: 15rpx; +} + +.timeline_max { + padding: 30rpx 30rpx 30rpx 40rpx; +} + +.timeline_for { + padding-bottom: 50rpx; + border-left: 2px solid #3c59a8; +} + +.timeline_for_title { + padding-bottom: 20rpx; + display: flex; + align-items: center; + position: relative; +} + +.timeline_for_dot { + width: 20rpx; + height: 20rpx; + border: 1px solid #b2badf; + background: #191d28; + position: absolute; + left: -14rpx; + border-radius: 50%; +} + +.dot_blue { + border: 1px solid #1680d6; + background: #1680d6; +} + +.dot_red { + border: 1px solid #ff0000; + background: #ff0000; +} + +.timeline_for_time { + color: #43aeff; +} + +.timeline_for_file { + padding: 10rpx 0 10rpx 40rpx; + font-size: 28rpx; + color: #d4d9ec; + display: flex; +} + +.timeline_for_list_title { + width: 140rpx; + padding-top: 10rpx; +} + +.timeline_for_list_file { + padding-top: 10rpx; + width: calc(100% - 140rpx); +} + +.zs_level_list_label { + padding: 0 10rpx; +} + +.zs_level_list_label view { + padding: 10rpx 0; + color: #7f91f5; + text-decoration: underline; +} + +.zs_level_list_label view:active { + color: #4f6aff; +} + + + + +.timeline_for_text { + padding-left: 40rpx; +} + +.timeline_for_list { + padding: 10rpx 0 10rpx 40rpx; + display: flex; + align-items: center; + font-size: 28rpx; + color: #d4d9ec; +} + + + +.pz_list_max { + padding: 30rpx 10rpx; +} + +.pz_list_for { + padding: 30rpx; + background: #1e2336; + margin-bottom: 30rpx; +} + +.pz_list_for_list { + padding: 10rpx 0; +} + + + + + + +/* 2022-12-22 新增样式 */ +.add_to_btn { + position: fixed; + width: 100%; + height: 100%; + bottom: 0; + left: 0; + background: #212737; + height: 100rpx; + display: flex; + align-items: center; + justify-content: center; + font-size: 32rpx; +} + +.add_to_btn image { + width: 36rpx; + height: 36rpx; + margin-right: 15rpx; +} + +.add_to_btn:active { + background: #1e2336; +} + +.ai_video_popup video { + height: 500rpx; + width: 100%; +} + +/* 凭证管理新增 */ +.add_max { + padding: 30rpx 40rpx; +} + +.add_title { + color: #8ca0e7; + padding: 0 15rpx 30rpx; +} + +.add_textarea { + height: 150rpx; + width: calc(100% - 40rpx); + background: #212737; + border-radius: 10rpx; + padding: 20rpx; +} + +.add_btn { + padding-top: 100rpx; + display: flex; + justify-content: space-evenly; + align-items: center; +} + +.add_btn_qx { + background: #3f424b; + height: 80rpx; + width: 250rpx; + text-align: center; + line-height: 80rpx; + border-radius: 10rpx; +} + +.add_btn_qx:active { + background: #3a3e49; +} + +.add_btn_bc { + background: #523fa8; + height: 80rpx; + width: 250rpx; + text-align: center; + line-height: 80rpx; + border-radius: 10rpx; +} + +.add_btn_bc:active { + background: #4a35aa; +} + + +.van-picker__mask { + background-image: none !important; +} + +.van-hairline--top-bottom:after { + border-top: 1px solid #3a4c8b !important; + border-bottom: 1px solid #3a4c8b !important; +} + + + +.van-picker { + background: none !important; +} + + + + + +/* 2023-5-4 新样式 */ +.module_max { + margin-top: 30rpx; + padding: 0 30rpx; +} + +.module_min { + background: #1e2336; + font-size: 30rpx; + padding: 30rpx 20rpx; + border-radius: 15rpx; +} + +.module_title { + height: 40rpx; + line-height: 40rpx; + padding-left: 40rpx; + background: url("http://fileimg.makalu.cc/CORE_52887EE6A33042408E11C2174974ABA1.png") no-repeat left/35rpx; +} + +.module_title_2 { + height: 40rpx; + line-height: 40rpx; + padding-left: 40rpx; + background: url("http://fileimg.makalu.cc/CORE_B1C818B4CF2C44FE9D96624589329EBC.png") no-repeat left/35rpx; +} + +.safety_inspect { + padding: 30rpx 20rpx; +} + +.safety_inspect_title { + color: #e9fbf9; + font-size: 26rpx; + padding: 20rpx; + background: url("http://fileimg.makalu.cc/WEB_F9046A91C12646ECAEB6024455C35F15.png") no-repeat left/15rpx 30rpx; +} + +.safety_prop { + display: flex; + align-items: center; + padding: 20rpx 0 20rpx 20rpx; + color: #cbdaff; + background: url("http://fileimg.makalu.cc/WEB_23ADD5DCCD3C42BA9FF57BE9838766B4.png") no-repeat left/15rpx 25rpx; +} + +.safety_prop_val { + color: #687a92; +} + +.safety_prop_val text { + color: #ffffff; + font-size: 32rpx; +} + +.safety_issue { + padding-top: 20rpx; +} + +.safety_issue_number { + padding: 0 20rpx; + height: 50rpx; + display: flex; + align-items: center; + background: url("http://fileimg.makalu.cc/WEB_FD18DB06491847FA913067FF7B812FBA.png") no-repeat left/100% 100%; +} + +.safety_deep { + display: flex; + align-items: center; + justify-content: space-around; +} + +.safety_deep_row { + display: flex; + align-items: center; + padding: 40rpx 0; +} + +.safety_deep_img { + height: 110rpx; + width: 110rpx; + text-align: center; + line-height: 140rpx; +} + +.safety_deep_img_1 { + background: url("http://fileimg.makalu.cc/WEB_F2CA2559EEB9456791461DBC9F8026C8.png") no-repeat center/100rpx 100rpx; +} + +.safety_deep_img_2 { + background: url("http://fileimg.makalu.cc/WEB_93D3C5384E774B77AA5B105BE448F2D8.png") no-repeat center/100rpx 100rpx; +} + +.safety_deep_img image { + width: 50rpx; + height: 50rpx; +} + +.safety_deep_col { + padding-left: 10rpx; + color: #cbdaff; +} + +.safety_deep_col_text { + padding: 10rpx 0; +} + +.safety_deep_col_number text { + font-size: 34rpx; + color: #80cefc; + font-weight: bold; +} + +.safety_deep_col_green text { + color: #62efbb; +} + + +.safety_electric { + color: #cbdaff; + display: flex; + align-items: center; + justify-content: center; + padding: 20rpx 0; + font-size: 26rpx; +} + +.safety_electric_threshold { + color: #ff0000; + font-size: 26rpx; +} + +.safety_electric_row { + display: flex; + align-items: center; + padding: 30rpx 0 30rpx 10rpx; +} + +.safety_electric_threshold text { + padding-right: 5rpx; + font-size: 32rpx; +} + +.safety_electric_img { + height: 110rpx; + width: 110rpx; + text-align: center; + line-height: 140rpx; + background: url("http://fileimg.makalu.cc/WEB_2FECA878591045B39AEBB41FE248C97B.png") no-repeat center/100rpx 100rpx; +} + +.safety_electric_img image { + height: 50rpx; + width: 50rpx; +} + +.safety_electric_col { + padding-left: 15rpx; + color: #cbdaff; +} + +.safety_electric_number text { + font-size: 34rpx; + color: #80cefc; + font-weight: bold; +} + +.safety_deep_col_blue text { + color: #028ffb; +} + +.module_title_flex { + display: flex; + align-items: center; + justify-content: space-between; +} + +.module_see_info { + font-size: 26rpx; + color: #028ffb; + display: flex; + align-items: center; +} + +.module_see_info:active { + color: #39a6fa; +} + +.safety_highlights { + padding: 30rpx 0; +} + +.safety_highlights_img { + padding: 20rpx 10rpx; + text-align: center; +} + +.safety_highlights_img image { + width: 270rpx; + height: 270rpx; +} + + +/* 施工安全交底学习 */ +.study_min { + font-size: 30rpx; + padding: 30rpx; + +} + +.study_video { + width: 100%; +} + +swiper-item video { + width: 100%; + height: 100%; +} + +.study_examination_questions { + padding: 15rpx 30rpx; +} + +.study_examination_questions_con { + display: inline-table; + width: 100%; + +} + +.study_examination_questions_topic { + white-space: normal; +} + +.study_examination_questions_radio { + padding: 30rpx 15rpx; +} + +.study_examination_questions_list { + padding: 20rpx 0; + display: flex; + color: #69709a; +} + +.study_examination_questions_list.active { + color: #899ef1; +} + +.study_examination_questions_list.error { + color: #ff0000; +} + +.study_radio { + width: 30rpx; + height: 30rpx; + border: 1px solid #69709a; + border-radius: 3rpx; + color: #171e28; + position: relative; + top: 7rpx; +} + +.study_examination_questions_list.active .study_radio { + border: 1px solid #899ef1; + color: #899ef1; +} + +.study_examination_questions_list.error .study_radio { + border: 1px solid #ff0000; + color: #ff0000; +} + +.study_radio_subject { + width: calc(100% - 50rpx); + padding-left: 20rpx; + white-space: normal; +} + +.study_video_tips { + padding: 30rpx; + font-size: 28rpx; + color: #028ffb; +} + +.answer_result { + background: #232e49; + padding: 30rpx; + font-size: 35rpx; + border-radius: 10rpx +} + +.switch_button { + padding: 50rpx 30rpx; + display: flex; + align-items: center; + justify-content: space-around; +} + +.switch_button button { + width: 250rpx !important; + font-weight: 400 !important; + background: #3f424b; + color: #ffffff; +} + +.switch_button_to { + background: #5140a6 !important; +} + +/* 承诺书 */ +.cns_rich_text_title { + padding: 30rpx 50rpx; + color: #00a8ff; +} + +.cns_rich_content { + padding: 30rpx 30rpx 0; +} + +.cns_rich_text { + padding: 0 20rpx; + background: #1e2336; + color: #cdd9ff; +} + +.cns_confirm { + padding: 30rpx; +} + +.cns_confirm_title { + padding: 20rpx; + color: #00a8ff; +} + +.cns_confirm_text { + padding: 20rpx; +} + +.cns_confirm_sign { + padding: 20rpx 0; +} + +.cns_confirm_sign_case { + height: 300rpx; + background: rgba(255, 255, 255, 0.1); +} + + +/* 安全管理 安全检查 */ +.inspect_max { + padding: 10rpx 30rpx; +} + +.inspect_list { + padding: 10rpx 0; +} + +.inspect_max_scroll { + height: 82vh; +} + +.inspect_list_scroll { + padding: 10rpx 0; +} + +.inspect_for { + padding: 20rpx 0; + font-size: 30rpx; +} + +.inspect_for_scroll { + padding: 20rpx 30rpx; + font-size: 30rpx; +} + +.inspect_for_bgd { + background: #1e2336; + padding: 0 30rpx; + border-radius: 10rpx 10rpx 0 0; +} + +.inspect_list_title { + border-bottom: 1px solid #323b86; + height: 80rpx; + display: flex; + justify-content: space-between; + align-items: center; +} + +.inspect_list_title_label { + display: flex; + align-items: center; + width: calc(100% - 150rpx); +} + +.inspect_list_title_width { + width: 100%; +} + +.module_title_text { + width: calc(100% - 150rpx); + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} + +.inspect_list_title_state { + width: 150rpx; + font-size: 26rpx; + text-align: right; +} + +.inspect_list_title_state text { + padding: 5rpx 10rpx; + border-radius: 20rpx 0 20rpx 0; +} + +.state_colour_0 { + background: #f3642a; +} + +.state_colour_1 { + background: #359a00; +} + +.state_colour_2 { + background: #404a6d; + color: #8aa4ee; +} + +.inspect_list_title_number { + width: 80rpx; + height: 80rpx; + border-bottom: 1px solid #6879fd; + text-align: center; + line-height: 80rpx; + color: #6879fd; +} + +.inspect_list_title_text { + width: calc(100% - 80rpx); + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} + +.inspect_list_title_text_2 { + width: calc(100% - 240rpx); + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} + +.inspect_list_info { + padding: 30rpx 5rpx; + color: #d5dbeb; +} + +.inspect_list_info_details { + display: flex; + align-items: center; +} + +.inspect_list_info_img { + width: 150rpx; +} + +.inspect_list_info_img_text { + text-align: center; + color: #89a3ee; + padding-top: 5rpx; + padding-right: 20rpx; +} + +.inspect_list_info_data { + width: calc(100% - 150rpx); +} + +.inspect_list_info_data_num { + display: flex; + align-items: center; + padding: 10rpx 0; +} + +.inspect_list_info_data_rec { + width: calc(100% - 300rpx); +} + +.inspect_list_info_data_prop_rec { + padding: 5rpx 0; + color: #d5dbeb; +} + +.inspect_list_info_padding { + padding: 6px 0; + color: #d5dbeb; +} + +.inspect_list_info_flex { + display: flex; + justify-content: space-between; + align-items: center; +} + +.inspect_list_info_upload { + background-image: linear-gradient(to right, #884cf9, #7457ff); + padding: 2rpx 15rpx; + border-radius: 30rpx; +} + +.inspect_list_info_data_num_option { + width: 50%; +} + +.inspect_list_info_data_prop { + padding: 10rpx 0; + word-break: break-all; +} + +.color_orange { + color: #fd8401; +} + +.color_green { + color: #1ab400; +} + +.color_blue { + color: #45affb; +} + +.color_purple { + color: #89a3ee; +} + +.color_type { + color: #65779b; +} + +.inspect_list_info_position { + padding-top: 20rpx; +} + +.inspect_list_info_data_bgd { + padding: 20rpx 30rpx; + background: #313a57; + border-radius: 0 0 10rpx 10rpx; + color: #d5dbeb; +} + +.inspect_add_to { + position: fixed; + right: 30rpx; + bottom: 50rpx; + width: 120rpx; + height: 120rpx; + border-radius: 50%; + background: #273252; + text-align: center; + font-size: 26rpx; + color: #b0ccf5 +} + +.inspect_add_to image { + width: 40rpx; + height: 40rpx; +} + +.inspect_add_to_darft { + position: fixed; + left: 30rpx; + bottom: 50rpx; + width: 120rpx; + height: 120rpx; + border-radius: 50%; + background: #273252; + text-align: center; + font-size: 26rpx; + color: #b0ccf5 +} + +.inspect_add_to_darft image { + width: 40rpx; + height: 40rpx; +} + +.add_to_font_size { + font-size: 50rpx !important; +} + +/* 问题整改 */ +.inspect_overview_max { + background: #191d28; + padding-bottom: 30rpx; +} + +.inspect_overview { + background: #1e222e; + padding: 0 30rpx; +} + +.module_title_padding { + padding: 30rpx 0 30rpx 40rpx; + border-bottom: 1px solid #303c84; +} + +.inspect_overview_list_max { + padding: 20rpx 0 20rpx 20rpx; +} + +.inspect_overview_list { + padding: 20rpx 0; +} + +.problem_list_max { + padding-bottom: 50rpx; +} + +.problem_list_for { + margin-bottom: 25rpx; +} + +.problem_list_title { + padding: 30rpx; + background: #313b56; +} + +.problem_list_title:active { + background: #29375e +} + +.problem_list_content { + padding: 0 30rpx; + background: #1d212d; +} + +.problem_list_content_title { + background: url("http://fileimg.makalu.cc/WEB_80CDF4BF20E1432EAB6469D9E0252224.png") no-repeat left/7rpx 30rpx; + padding: 30rpx 20rpx; +} + +.problem_list_info { + padding: 10rpx 20rpx; +} + +.problem_list_info_title { + color: #83a5ef +} + +.problem_list_info_con { + padding: 12rpx 10rpx; +} + +.problem_list_img { + padding: 15rpx 0; +} + +.problem_list_module_border { + border-top: 1px solid #343a86; +} + +.problem_list_btn_max { + padding: 30rpx; + display: flex; + justify-content: flex-end; + align-items: center; +} + +.problem_list_btn { + background: #30384b; + padding: 13rpx 40rpx; + margin: 0 10rpx; + border-radius: 6rpx; + color: #879ff9; +} + +.problem_list_btn:active { + background: #384461; +} + +.problem_list_btn_confirm { + color: #ffffff; + background: #495679; +} + +.problem_list_btn_confirm:active { + background: rgb(61, 76, 124); +} + +.problem_list_info_input { + padding: 20rpx 0; +} + +.problem_submit_to { + padding: 40rpx; + display: flex; + align-items: center; + justify-content: space-around; +} + +.problem_submit_to_btn { + padding: 20rpx 0; + width: 220rpx; + text-align: center; + border-radius: 10rpx; + background: #3e4148; +} + +.problem_submit_to_btn:active { + background: #292d35; +} + +.problem_submit_to_save { + background: #513ea7; +} + +.problem_submit_to_save:active { + background: #372a70; +} + +.problem_submit_to_delete { + border-bottom: 1px solid #ff6d6d; + background-color: #ff6d6d; +} + +.problem_submit_to_warning { + border-bottom: 1px solid #E6A23C; + background-color: #E6A23C; +} + +.problem_submit_to_warning:active { + background: #f0bf75; +} + +.problem_submit_to_blue { + border-bottom: 1px solid #32b7d8; + background-color: #32b7d8; +} + +.problem_submit_to_blue:active { + background: #66d6f1; +} + +.problem_submit_to_eq { + border-bottom: 1px solid #3f76eb; + background-color: #3f76eb; +} + +.problem_submit_to_eq:active { + background: #6492f5; +} + +.problem_submit_to_view { + padding: 20rpx; + display: flex; + align-items: center; + justify-content: space-around; +} + +.problem_submit_to_view_btn { + padding: 10rpx 0; + width: 160rpx; + text-align: center; + border-radius: 10rpx; + background: #3e4148; +} + +.problem_submit_to_view_btn:active { + background: #292d35; +} + +.problem_submit_to_view_save { + background: #513ea7; +} + +.problem_submit_to_view_save:active { + background: #372a70; +} + +.problem_submit_to_view_delete { + border-bottom: 1px solid #ff6d6d; + background-color: #ff6d6d; +} + +.problem_submit_to_view_warning { + border-bottom: 1px solid #E6A23C; + background-color: #E6A23C; +} + +.problem_submit_to_view_warning:active { + background: #f0bf75; +} + +.problem_submit_to_view_blue { + border-bottom: 1px solid #32b7d8; + background-color: #32b7d8; +} + +.problem_submit_to_view_blue:active { + background: #66d6f1; +} + +.problem_submit_to_view_eq { + border-bottom: 1px solid #3f76eb; + background-color: #3f76eb; +} + +.problem_submit_to_view_eq:active { + background: #6492f5; +} + +/* 新增安全检查 */ +.inspect_info { + padding: 30rpx; + background: #1e222e; + margin-bottom: 30rpx; +} + +.inspect_info_list { + padding: 10rpx 0; +} + +.inspect_info_title { + padding: 10rpx 0; + color: #83a5ef +} + +.inspect_info_type { + padding: 20rpx 0; + display: flex; + justify-content: space-around; +} + +.inspect_info_type view { + width: 30%; + padding: 18rpx 0; + background: #262c3c; + text-align: center; + border-radius: 10rpx; + color: #6a77a3; +} + +.inspect_info_type .active { + color: #ffffff; + background: #576691; +} + +.inspect_input_fill_in { + height: 90rpx; + background: #212737; + border-radius: 10rpx; + padding: 0 30rpx; +} + +.inspect_info_content { + padding: 20rpx 0; +} + +.module_see_info_delete { + font-size: 26rpx; + color: #ef4a4a; + display: flex; + align-items: center; +} + +.inspect_new_issues_max { + padding: 30rpx 0; +} + +.inspect_new_issues { + width: 300rpx; + border-radius: 100rpx; + padding: 20rpx 0; + background: #252d41; + margin: auto; + text-align: center; + color: #89a3ed; + font-size: 34rpx; +} + +.check_issue_finish_btn { + position: relative; + top: 10rpx; + right: 0rpx; + text-align: center; + line-height: 100rpx; + width: 230rpx; + color: #fff; + height: 100rpx; + background-color: #495679; +} + +.voucher_select_max { + padding: 0 25rpx; + display: flex; + align-items: center; + background: #212737; + height: 90rpx; + border-radius: 10rpx; +} + +.voucher_select_min { + width: calc(100% - 30rpx); + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.result_project_name { + padding: 50rpx 0; + text-align: center; +} + +/* 全部下拉选择器 */ +.hj_float { + float: right; + padding: 5rpx 50rpx 5rpx 20rpx; + background: #2e355f url("http://fileimg.makalu.cc/CORE_5F23F4664AAE44A0BD72BE4BB4C66083.png") no-repeat right/35rpx; + border-radius: 40rpx; +} + +.hj_float:active { + background: #2e355f url("http://fileimg.makalu.cc/CORE_5F23F4664AAE44A0BD72BE4BB4C66083.png") no-repeat right/35rpx; +} + +.van-popup--bottom.van-popup--round { + border-radius: 0 !important +} + +.van-popup { + background-color: var(--popup-background-color, #232a44) !important +} + +.van-action-sheet__cancel, +.van-action-sheet__item { + background-color: var(--popup-background-color, #232a44) !important; + color: #0ad7ec; +} + +.code_label { + font-size: 0.6rem; + width: 120rpx; + margin: auto; + text-align: center; + padding: 0.1rem; + border-radius: 0.5rem 0 0.5rem 0; + margin-bottom: 15rpx; + margin-left: -3rpx; +} + +.code_label_2 { + font-size: 0.8rem; + width: 120rpx; + margin: auto; + text-align: center; + padding: 0.1rem; + border-radius: 0.5rem 0 0.5rem 0; + margin-left: -1rpx; + margin-bottom: 10rpx; +} + +.code_label_3 { + font-size: 0.8rem; + width: 120rpx; + margin: auto; + text-align: center; + padding: 0.1rem; + border-radius: 0.5rem 0 0.5rem 0; +} + +.code_label_green { + background: green; + color: #FFFFFF; +} + +.code_label_red { + background: red; + color: #FFFFFF; +} + +.code_label_blueviolet { + background: blueviolet; + color: #FFFFFF; +} + +.code_label_yellow { + background: #ff9800; + color: #FFFFFF; +} + +.file { + width: auto; + zoom: 1; +} + +.files { + word-break: break-all; + text-decoration: underline; + padding-bottom: 20rpx; +} + +.zxjc { + border: 5rpx solid #3fabb7; + border-radius: 12px; + margin-bottom: 12rpx; +} + +.tabNum { + position: absolute; + background-color: #f56c6c; + border-radius: 10px; + color: #fff; + display: inline-block; + font-size: 12px; + height: 18px; + line-height: 18px; + padding: 0 6px; + text-align: center; + white-space: nowrap; + margin-top: -50rpx; + margin-left: -15rpx; +} + +.tabNum_active { + position: absolute; + background-color: #f56c6c; + border-radius: 10px; + color: #fff; + display: inline-block; + font-size: 12px; + height: 18px; + line-height: 18px; + padding: 0 6px; + text-align: center; + white-space: nowrap; + margin-left: 110rpx; + margin-top: 16rpx; +} + +.van-col--18 { + word-wrap: break-word; +} + +.inspect_list_info_data_2 { + width: 100%; +} + +.top-5 { + margin-top: -5rpx; +} +.in-img-div image{ + width: 180rpx; + height: 180rpx; + padding-right: 15rpx; +} \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/cell/index.d.ts b/yanzhu-ui-app/miniprogram/components/@mkl/cell/index.d.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/cell/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/cell/index.js b/yanzhu-ui-app/miniprogram/components/@mkl/cell/index.js new file mode 100644 index 00000000..b55b75c2 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/cell/index.js @@ -0,0 +1,37 @@ +import { link } from '../mixins/link'; +import { VantComponent } from '../common/component'; +VantComponent({ + classes: [ + 'title-class', + 'label-class', + 'value-class', + 'right-icon-class', + 'hover-class', + ], + mixins: [link], + props: { + title: null, + value: null, + icon: String, + size: String, + label: String, + center: Boolean, + isLink: Boolean, + required: Boolean, + clickable: Boolean, + titleWidth: String, + customStyle: String, + arrowDirection: String, + useLabelSlot: Boolean, + border: { + type: Boolean, + value: true, + }, + }, + methods: { + onClick(event) { + this.$emit('click', event.detail); + this.jumpLink(); + }, + }, +}); diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/cell/index.json b/yanzhu-ui-app/miniprogram/components/@mkl/cell/index.json new file mode 100644 index 00000000..0a336c08 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/cell/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-icon": "../icon/index" + } +} diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/cell/index.wxml b/yanzhu-ui-app/miniprogram/components/@mkl/cell/index.wxml new file mode 100644 index 00000000..afaaaf86 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/cell/index.wxml @@ -0,0 +1,45 @@ + + + + + + + + {{ title }} + + + + + {{ label }} + + + + + {{ value }} + + + + + + + + diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/cell/index.wxss b/yanzhu-ui-app/miniprogram/components/@mkl/cell/index.wxss new file mode 100644 index 00000000..7afd1c4f --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/cell/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-cell{position:relative;display:-webkit-flex;display:flex;box-sizing:border-box;width:100%;padding:10px 16px;padding:var(--cell-vertical-padding,10px) var(--cell-horizontal-padding,16px);font-size:14px;font-size:var(--cell-font-size,14px);line-height:24px;line-height:var(--cell-line-height,24px);color:#323233;color:var(--cell-text-color,#323233);background-color:#fff;background-color:var(--cell-background-color,#fff)}.van-cell:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;top:auto;right:0;bottom:0;left:16px;border-bottom:1px solid #ebedf0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.van-cell--borderless:after{display:none}.van-cell-group{background-color:#fff;background-color:var(--cell-background-color,#fff)}.van-cell__label{margin-top:3px;margin-top:var(--cell-label-margin-top,3px);font-size:12px;font-size:var(--cell-label-font-size,12px);line-height:18px;line-height:var(--cell-label-line-height,18px);color:#969799;color:var(--cell-label-color,#969799)}.van-cell__value{overflow:hidden;text-align:right;vertical-align:middle;color:#969799;color:var(--cell-value-color,#969799)}.van-cell__title,.van-cell__value{-webkit-flex:1;flex:1}.van-cell__title:empty,.van-cell__value:empty{display:none}.van-cell__left-icon-wrap,.van-cell__right-icon-wrap{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;height:24px;height:var(--cell-line-height,24px);font-size:16px;font-size:var(--cell-icon-size,16px)}.van-cell__left-icon-wrap{margin-right:5px}.van-cell__right-icon-wrap{margin-left:5px;color:#969799;color:var(--cell-right-icon-color,#969799)}.van-cell__left-icon{vertical-align:middle}.van-cell__left-icon,.van-cell__right-icon{line-height:24px;line-height:var(--cell-line-height,24px)}.van-cell--clickable.van-cell--hover{background-color:#f2f3f5;background-color:var(--cell-active-color,#f2f3f5)}.van-cell--required{overflow:visible}.van-cell--required:before{position:absolute;content:"*";left:8px;left:var(--padding-xs,8px);font-size:14px;font-size:var(--cell-font-size,14px);color:#ee0a24;color:var(--cell-required-color,#ee0a24)}.van-cell--center{-webkit-align-items:center;align-items:center}.van-cell--large{padding-top:12px;padding-top:var(--cell-large-vertical-padding,12px);padding-bottom:12px;padding-bottom:var(--cell-large-vertical-padding,12px)}.van-cell--large .van-cell__title{font-size:16px;font-size:var(--cell-large-title-font-size,16px)}.van-cell--large .van-cell__value{font-size:16px;font-size:var(--cell-large-value-font-size,16px)}.van-cell--large .van-cell__label{font-size:14px;font-size:var(--cell-large-label-font-size,14px)} \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/collapse-item/index.d.ts b/yanzhu-ui-app/miniprogram/components/@mkl/collapse-item/index.d.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/collapse-item/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/collapse-item/index.js b/yanzhu-ui-app/miniprogram/components/@mkl/collapse-item/index.js new file mode 100644 index 00000000..6f7de46a --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/collapse-item/index.js @@ -0,0 +1,92 @@ +import { VantComponent } from "../common/component"; +const nextTick = () => new Promise((resolve) => setTimeout(resolve, 20)); +VantComponent({ + classes: ["title-class", "content-class"], + relation: { + name: "collapse", + type: "ancestor", + current: "collapse-item", + }, + props: { + name: null, + title: null, + value: null, + icon: String, + label: String, + disabled: Boolean, + clickable: Boolean, + border: { + type: Boolean, + value: true, + }, + isLink: { + type: Boolean, + value: true, + }, + }, + data: { + contentHeight: 0, + expanded: false, + transition: false, + }, + mounted() { + this.updateExpanded() + .then(nextTick) + .then(() => { + const data = { transition: true }; + if (this.data.expanded) { + data.contentHeight = "auto"; + } + this.setData(data); + }); + }, + methods: { + updateExpanded() { + if (!this.parent) { + return Promise.resolve(); + } + const { value, accordion } = this.parent.data; + const { children = [] } = this.parent; + const { name } = this.data; + const index = children.indexOf(this); + const currentName = name == null ? index : name; + const expanded = accordion ? value === currentName : (value || []).some((name) => name === currentName); + const stack = []; + if (expanded !== this.data.expanded) { + stack.push(this.updateStyle(expanded)); + } + stack.push(this.set({ index, expanded })); + return Promise.all(stack); + }, + updateStyle(expanded) { + return this.getRect(".van-collapse-item__content") + .then((rect) => rect.height) + .then((height) => { + if (expanded) { + return this.set({ + contentHeight: height ? `${height}px` : "auto", + }); + } + return this.set({ contentHeight: `${height}px` }) + .then(nextTick) + .then(() => this.set({ contentHeight: 0 })); + }); + }, + onClick() { + if (this.data.disabled) { + return; + } + const { name, expanded } = this.data; + const index = this.parent.children.indexOf(this); + const currentName = name == null ? index : name; + this.parent.switch(currentName, !expanded); + }, + onTransitionEnd() { + if (this.data.expanded) { + this.setData({ + contentHeight: "auto", + }); + } + }, + }, +}); diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/collapse-item/index.json b/yanzhu-ui-app/miniprogram/components/@mkl/collapse-item/index.json new file mode 100644 index 00000000..0e5425cd --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/collapse-item/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-cell": "../cell/index" + } +} diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/collapse-item/index.wxml b/yanzhu-ui-app/miniprogram/components/@mkl/collapse-item/index.wxml new file mode 100644 index 00000000..9d813f50 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/collapse-item/index.wxml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/collapse-item/index.wxss b/yanzhu-ui-app/miniprogram/components/@mkl/collapse-item/index.wxss new file mode 100644 index 00000000..bdcf6c20 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/collapse-item/index.wxss @@ -0,0 +1,60 @@ +@import "../common/index.wxss"; +.van-collapse-item__title .van-cell__right-icon { + -webkit-transform: rotate(90deg); + transform: rotate(90deg); + transition: -webkit-transform 0.3s; + transition: transform 0.3s; + transition: transform 0.3s, -webkit-transform 0.3s; +} +.van-collapse-item__title--expanded .van-cell__right-icon { + -webkit-transform: rotate(-90deg); + transform: rotate(-90deg); +} +.van-collapse-item__title--disabled .van-cell, +.van-collapse-item__title--disabled .van-cell__right-icon { + color: #c8c9cc !important; +} +.van-collapse-item__title--disabled .van-cell--hover { + background-color: #fff !important; +} +.van-collapse-item__wrapper { + overflow: hidden; +} +.van-collapse-item__wrapper--transition { + transition: height 0.3s ease-in-out; +} +.van-collapse-item__content { + padding: 0 25rpx; + color: #969799; + font-size: 13px; + line-height: 1.5; +} + +.mkl-collapse { + padding: 0 25rpx; + margin-bottom: 40rpx; +} + +.mkl-cell { + background: #fff; + padding: 25rpx; + border-radius: 20rpx; + /* border-top-left-radius: 20rpx; + border-top-right-radius: 20rpx; */ + box-shadow: 0px 0px 10px #ddd; + /* margin-bottom: 40rpx; */ +} + +.mkl-cell__expanded { + border-radius: 20rpx 20rpx 0 0; +} + +.mkl-cell__bottom { + height: 40rpx; +} +.mkl-collapse-container { + box-shadow: 0px 0px 10px #ddd; + transition: height 0.2s; + border-radius: 0 0 20rpx 20rpx; + background: #f5f5f5; +} diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/collapse/index.d.ts b/yanzhu-ui-app/miniprogram/components/@mkl/collapse/index.d.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/collapse/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/collapse/index.js b/yanzhu-ui-app/miniprogram/components/@mkl/collapse/index.js new file mode 100644 index 00000000..33dae31e --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/collapse/index.js @@ -0,0 +1,47 @@ +import { VantComponent } from '../common/component'; +VantComponent({ + relation: { + name: 'collapse-item', + type: 'descendant', + current: 'collapse', + }, + props: { + value: { + type: null, + observer: 'updateExpanded', + }, + accordion: { + type: Boolean, + observer: 'updateExpanded', + }, + border: { + type: Boolean, + value: true, + }, + }, + methods: { + updateExpanded() { + this.children.forEach((child) => { + child.updateExpanded(); + }); + }, + switch(name, expanded) { + const { accordion, value } = this.data; + const changeItem = name; + if (!accordion) { + name = expanded + ? (value || []).concat(name) + : (value || []).filter((activeName) => activeName !== name); + } else { + name = expanded ? name : ''; + } + if (expanded) { + this.$emit('open', changeItem); + } else { + this.$emit('close', changeItem); + } + this.$emit('change', name); + this.$emit('input', name); + }, + }, +}); diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/collapse/index.json b/yanzhu-ui-app/miniprogram/components/@mkl/collapse/index.json new file mode 100644 index 00000000..467ce294 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/collapse/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/collapse/index.wxml b/yanzhu-ui-app/miniprogram/components/@mkl/collapse/index.wxml new file mode 100644 index 00000000..7ea46bc3 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/collapse/index.wxml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/collapse/index.wxss b/yanzhu-ui-app/miniprogram/components/@mkl/collapse/index.wxss new file mode 100644 index 00000000..1bd831fe --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/collapse/index.wxss @@ -0,0 +1 @@ +@import "../common/index.wxss"; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/common/color.d.ts b/yanzhu-ui-app/miniprogram/components/@mkl/common/color.d.ts new file mode 100644 index 00000000..386f3077 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/common/color.d.ts @@ -0,0 +1,7 @@ +export declare const RED = "#ee0a24"; +export declare const BLUE = "#1989fa"; +export declare const WHITE = "#fff"; +export declare const GREEN = "#07c160"; +export declare const ORANGE = "#ff976a"; +export declare const GRAY = "#323233"; +export declare const GRAY_DARK = "#969799"; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/common/color.js b/yanzhu-ui-app/miniprogram/components/@mkl/common/color.js new file mode 100644 index 00000000..6b285bd6 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/common/color.js @@ -0,0 +1,7 @@ +export const RED = '#ee0a24'; +export const BLUE = '#1989fa'; +export const WHITE = '#fff'; +export const GREEN = '#07c160'; +export const ORANGE = '#ff976a'; +export const GRAY = '#323233'; +export const GRAY_DARK = '#969799'; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/common/component.d.ts b/yanzhu-ui-app/miniprogram/components/@mkl/common/component.d.ts new file mode 100644 index 00000000..307a96cc --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/common/component.d.ts @@ -0,0 +1,3 @@ +import { VantComponentOptions, CombinedComponentInstance } from '../definitions/index'; +declare function VantComponent(vantOptions?: VantComponentOptions>): void; +export { VantComponent }; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/common/component.js b/yanzhu-ui-app/miniprogram/components/@mkl/common/component.js new file mode 100644 index 00000000..4868a064 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/common/component.js @@ -0,0 +1,101 @@ +import { basic } from '../mixins/basic'; +const relationFunctions = { + ancestor: { + linked(parent) { + this.parent = parent; + }, + unlinked() { + this.parent = null; + }, + }, + descendant: { + linked(child) { + this.children = this.children || []; + this.children.push(child); + }, + unlinked(child) { + this.children = (this.children || []).filter((it) => it !== child); + }, + }, +}; +function mapKeys(source, target, map) { + Object.keys(map).forEach((key) => { + if (source[key]) { + target[map[key]] = source[key]; + } + }); +} +function makeRelation(options, vantOptions, relation) { + const { type, name, linked, unlinked, linkChanged } = relation; + const { beforeCreate, destroyed } = vantOptions; + if (type === 'descendant') { + options.created = function () { + beforeCreate && beforeCreate.bind(this)(); + this.children = this.children || []; + }; + options.detached = function () { + this.children = []; + destroyed && destroyed.bind(this)(); + }; + } + options.relations = Object.assign(options.relations || {}, { + [`../${name}/index`]: { + type, + linked(node) { + relationFunctions[type].linked.bind(this)(node); + linked && linked.bind(this)(node); + }, + linkChanged(node) { + linkChanged && linkChanged.bind(this)(node); + }, + unlinked(node) { + relationFunctions[type].unlinked.bind(this)(node); + unlinked && unlinked.bind(this)(node); + }, + }, + }); +} +function VantComponent(vantOptions = {}) { + const options = {}; + mapKeys(vantOptions, options, { + data: 'data', + props: 'properties', + mixins: 'behaviors', + methods: 'methods', + beforeCreate: 'created', + created: 'attached', + mounted: 'ready', + relations: 'relations', + destroyed: 'detached', + classes: 'externalClasses', + }); + const { relation } = vantOptions; + if (relation) { + makeRelation(options, vantOptions, relation); + } + // add default externalClasses + options.externalClasses = options.externalClasses || []; + options.externalClasses.push('custom-class'); + // add default behaviors + options.behaviors = options.behaviors || []; + options.behaviors.push(basic); + // map field to form-field behavior + if (vantOptions.field) { + options.behaviors.push('wx://form-field'); + } + if (options.properties) { + Object.keys(options.properties).forEach((name) => { + if (Array.isArray(options.properties[name])) { + // miniprogram do not allow multi type + options.properties[name] = null; + } + }); + } + // add default options + options.options = { + multipleSlots: true, + addGlobalClass: true, + }; + Component(options); +} +export { VantComponent }; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/common/index.wxss b/yanzhu-ui-app/miniprogram/components/@mkl/common/index.wxss new file mode 100644 index 00000000..6e6891ff --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/common/index.wxss @@ -0,0 +1 @@ +.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{-webkit-line-clamp:3}.van-clearfix:after{display:table;clear:both;content:""}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #eee;-webkit-transform:scale(.5);transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px} \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/common/style/clearfix.wxss b/yanzhu-ui-app/miniprogram/components/@mkl/common/style/clearfix.wxss new file mode 100644 index 00000000..a0ca8384 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/common/style/clearfix.wxss @@ -0,0 +1 @@ +.van-clearfix:after{display:table;clear:both;content:""} \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/common/style/ellipsis.wxss b/yanzhu-ui-app/miniprogram/components/@mkl/common/style/ellipsis.wxss new file mode 100644 index 00000000..1e9dbc9e --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/common/style/ellipsis.wxss @@ -0,0 +1 @@ +.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{-webkit-line-clamp:3} \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/common/style/hairline.wxss b/yanzhu-ui-app/miniprogram/components/@mkl/common/style/hairline.wxss new file mode 100644 index 00000000..f64e2f83 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/common/style/hairline.wxss @@ -0,0 +1 @@ +.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #eee;-webkit-transform:scale(.5);transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px} \ No newline at end of file diff --git a/yanzhu-ui-app/uview-ui/components/u-scroll-list/other.js b/yanzhu-ui-app/miniprogram/components/@mkl/common/style/mixins/clearfix.wxss similarity index 100% rename from yanzhu-ui-app/uview-ui/components/u-scroll-list/other.js rename to yanzhu-ui-app/miniprogram/components/@mkl/common/style/mixins/clearfix.wxss diff --git a/yanzhu-ui-app/uview-ui/libs/css/h5.scss b/yanzhu-ui-app/miniprogram/components/@mkl/common/style/mixins/ellipsis.wxss similarity index 100% rename from yanzhu-ui-app/uview-ui/libs/css/h5.scss rename to yanzhu-ui-app/miniprogram/components/@mkl/common/style/mixins/ellipsis.wxss diff --git a/yanzhu-ui-app/uview-ui/libs/css/mp.scss b/yanzhu-ui-app/miniprogram/components/@mkl/common/style/mixins/hairline.wxss similarity index 100% rename from yanzhu-ui-app/uview-ui/libs/css/mp.scss rename to yanzhu-ui-app/miniprogram/components/@mkl/common/style/mixins/hairline.wxss diff --git a/yanzhu-ui-app/uview-ui/libs/css/nvue.scss b/yanzhu-ui-app/miniprogram/components/@mkl/common/style/theme.wxss similarity index 100% rename from yanzhu-ui-app/uview-ui/libs/css/nvue.scss rename to yanzhu-ui-app/miniprogram/components/@mkl/common/style/theme.wxss diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/common/style/var.wxss b/yanzhu-ui-app/miniprogram/components/@mkl/common/style/var.wxss new file mode 100644 index 00000000..e69de29b diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/common/utils.d.ts b/yanzhu-ui-app/miniprogram/components/@mkl/common/utils.d.ts new file mode 100644 index 00000000..411e4aa9 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/common/utils.d.ts @@ -0,0 +1,8 @@ +/// +export declare function isDef(value: any): boolean; +export declare function isObj(x: any): boolean; +export declare function isNumber(value: any): boolean; +export declare function range(num: number, min: number, max: number): number; +export declare function nextTick(fn: Function): void; +export declare function getSystemInfoSync(): WechatMiniprogram.GetSystemInfoSyncResult; +export declare function addUnit(value?: string | number): string | undefined; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/common/utils.js b/yanzhu-ui-app/miniprogram/components/@mkl/common/utils.js new file mode 100644 index 00000000..cc0f8f11 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/common/utils.js @@ -0,0 +1,32 @@ +export function isDef(value) { + return value !== undefined && value !== null; +} +export function isObj(x) { + const type = typeof x; + return x !== null && (type === 'object' || type === 'function'); +} +export function isNumber(value) { + return /^\d+(\.\d+)?$/.test(value); +} +export function range(num, min, max) { + return Math.min(Math.max(num, min), max); +} +export function nextTick(fn) { + setTimeout(() => { + fn(); + }, 1000 / 30); +} +let systemInfo = null; +export function getSystemInfoSync() { + if (systemInfo == null) { + systemInfo = wx.getSystemInfoSync(); + } + return systemInfo; +} +export function addUnit(value) { + if (!isDef(value)) { + return undefined; + } + value = String(value); + return isNumber(value) ? `${value}px` : value; +} diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/common/version.d.ts b/yanzhu-ui-app/miniprogram/components/@mkl/common/version.d.ts new file mode 100644 index 00000000..d4c6fe24 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/common/version.d.ts @@ -0,0 +1,2 @@ +export declare function canIUseModel(): boolean; +export declare function canIUseFormFieldButton(): boolean; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/common/version.js b/yanzhu-ui-app/miniprogram/components/@mkl/common/version.js new file mode 100644 index 00000000..01f24f88 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/common/version.js @@ -0,0 +1,31 @@ +import { getSystemInfoSync } from './utils'; +function compareVersion(v1, v2) { + v1 = v1.split('.'); + v2 = v2.split('.'); + const len = Math.max(v1.length, v2.length); + while (v1.length < len) { + v1.push('0'); + } + while (v2.length < len) { + v2.push('0'); + } + for (let i = 0; i < len; i++) { + const num1 = parseInt(v1[i], 10); + const num2 = parseInt(v2[i], 10); + if (num1 > num2) { + return 1; + } + if (num1 < num2) { + return -1; + } + } + return 0; +} +export function canIUseModel() { + const system = getSystemInfoSync(); + return compareVersion(system.SDKVersion, '2.9.3') >= 0; +} +export function canIUseFormFieldButton() { + const system = getSystemInfoSync(); + return compareVersion(system.SDKVersion, '2.10.3') >= 0; +} diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/icon/index.d.ts b/yanzhu-ui-app/miniprogram/components/@mkl/icon/index.d.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/icon/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/icon/index.js b/yanzhu-ui-app/miniprogram/components/@mkl/icon/index.js new file mode 100644 index 00000000..bee576cb --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/icon/index.js @@ -0,0 +1,27 @@ +import { VantComponent } from '../common/component'; +VantComponent({ + props: { + dot: Boolean, + info: null, + size: null, + color: String, + customStyle: String, + classPrefix: { + type: String, + value: 'van-icon', + }, + name: { + type: String, + observer(val) { + this.setData({ + isImageName: val.indexOf('/') !== -1, + }); + }, + }, + }, + methods: { + onClick() { + this.$emit('click'); + }, + }, +}); diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/icon/index.json b/yanzhu-ui-app/miniprogram/components/@mkl/icon/index.json new file mode 100644 index 00000000..bf0ebe00 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/icon/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-info": "../info/index" + } +} diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/icon/index.wxml b/yanzhu-ui-app/miniprogram/components/@mkl/icon/index.wxml new file mode 100644 index 00000000..fe4065a4 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/icon/index.wxml @@ -0,0 +1,20 @@ + + + + + + diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/icon/index.wxss b/yanzhu-ui-app/miniprogram/components/@mkl/icon/index.wxss new file mode 100644 index 00000000..cf2c506c --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/icon/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';@font-face{font-weight:400;font-family:vant-icon;font-style:normal;font-display:auto;src:url(https://img.yzcdn.cn/vant/vant-icon-d3825a.woff2) format("woff2"),url(https://img.yzcdn.cn/vant/vant-icon-d3825a.woff) format("woff"),url(https://img.yzcdn.cn/vant/vant-icon-d3825a.ttf) format("truetype")}.van-icon{position:relative;font:normal normal normal 14px/1 vant-icon;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased}.van-icon,.van-icon:before{display:inline-block}.van-icon-add-o:before{content:"\F000"}.van-icon-add-square:before{content:"\F001"}.van-icon-add:before{content:"\F002"}.van-icon-after-sale:before{content:"\F003"}.van-icon-aim:before{content:"\F004"}.van-icon-alipay:before{content:"\F005"}.van-icon-apps-o:before{content:"\F006"}.van-icon-arrow-down:before{content:"\F007"}.van-icon-arrow-left:before{content:"\F008"}.van-icon-arrow-up:before{content:"\F009"}.van-icon-arrow:before{content:"\F00A"}.van-icon-ascending:before{content:"\F00B"}.van-icon-audio:before{content:"\F00C"}.van-icon-award-o:before{content:"\F00D"}.van-icon-award:before{content:"\F00E"}.van-icon-bag-o:before{content:"\F00F"}.van-icon-bag:before{content:"\F010"}.van-icon-balance-list-o:before{content:"\F011"}.van-icon-balance-list:before{content:"\F012"}.van-icon-balance-o:before{content:"\F013"}.van-icon-balance-pay:before{content:"\F014"}.van-icon-bar-chart-o:before{content:"\F015"}.van-icon-bars:before{content:"\F016"}.van-icon-bell:before{content:"\F017"}.van-icon-bill-o:before{content:"\F018"}.van-icon-bill:before{content:"\F019"}.van-icon-birthday-cake-o:before{content:"\F01A"}.van-icon-bookmark-o:before{content:"\F01B"}.van-icon-bookmark:before{content:"\F01C"}.van-icon-browsing-history-o:before{content:"\F01D"}.van-icon-browsing-history:before{content:"\F01E"}.van-icon-brush-o:before{content:"\F01F"}.van-icon-bulb-o:before{content:"\F020"}.van-icon-bullhorn-o:before{content:"\F021"}.van-icon-calender-o:before{content:"\F022"}.van-icon-card:before{content:"\F023"}.van-icon-cart-circle-o:before{content:"\F024"}.van-icon-cart-circle:before{content:"\F025"}.van-icon-cart-o:before{content:"\F026"}.van-icon-cart:before{content:"\F027"}.van-icon-cash-back-record:before{content:"\F028"}.van-icon-cash-on-deliver:before{content:"\F029"}.van-icon-cashier-o:before{content:"\F02A"}.van-icon-certificate:before{content:"\F02B"}.van-icon-chart-trending-o:before{content:"\F02C"}.van-icon-chat-o:before{content:"\F02D"}.van-icon-chat:before{content:"\F02E"}.van-icon-checked:before{content:"\F02F"}.van-icon-circle:before{content:"\F030"}.van-icon-clear:before{content:"\F031"}.van-icon-clock-o:before{content:"\F032"}.van-icon-clock:before{content:"\F033"}.van-icon-close:before{content:"\F034"}.van-icon-closed-eye:before{content:"\F035"}.van-icon-cluster-o:before{content:"\F036"}.van-icon-cluster:before{content:"\F037"}.van-icon-column:before{content:"\F038"}.van-icon-comment-circle-o:before{content:"\F039"}.van-icon-comment-circle:before{content:"\F03A"}.van-icon-comment-o:before{content:"\F03B"}.van-icon-comment:before{content:"\F03C"}.van-icon-completed:before{content:"\F03D"}.van-icon-contact:before{content:"\F03E"}.van-icon-coupon-o:before{content:"\F03F"}.van-icon-coupon:before{content:"\F040"}.van-icon-credit-pay:before{content:"\F041"}.van-icon-cross:before{content:"\F042"}.van-icon-debit-pay:before{content:"\F043"}.van-icon-delete:before{content:"\F044"}.van-icon-descending:before{content:"\F045"}.van-icon-description:before{content:"\F046"}.van-icon-desktop-o:before{content:"\F047"}.van-icon-diamond-o:before{content:"\F048"}.van-icon-diamond:before{content:"\F049"}.van-icon-discount:before{content:"\F04A"}.van-icon-down:before{content:"\F04B"}.van-icon-ecard-pay:before{content:"\F04C"}.van-icon-edit:before{content:"\F04D"}.van-icon-ellipsis:before{content:"\F04E"}.van-icon-empty:before{content:"\F04F"}.van-icon-envelop-o:before{content:"\F050"}.van-icon-exchange:before{content:"\F051"}.van-icon-expand-o:before{content:"\F052"}.van-icon-expand:before{content:"\F053"}.van-icon-eye-o:before{content:"\F054"}.van-icon-eye:before{content:"\F055"}.van-icon-fail:before{content:"\F056"}.van-icon-failure:before{content:"\F057"}.van-icon-filter-o:before{content:"\F058"}.van-icon-fire-o:before{content:"\F059"}.van-icon-fire:before{content:"\F05A"}.van-icon-flag-o:before{content:"\F05B"}.van-icon-flower-o:before{content:"\F05C"}.van-icon-free-postage:before{content:"\F05D"}.van-icon-friends-o:before{content:"\F05E"}.van-icon-friends:before{content:"\F05F"}.van-icon-gem-o:before{content:"\F060"}.van-icon-gem:before{content:"\F061"}.van-icon-gift-card-o:before{content:"\F062"}.van-icon-gift-card:before{content:"\F063"}.van-icon-gift-o:before{content:"\F064"}.van-icon-gift:before{content:"\F065"}.van-icon-gold-coin-o:before{content:"\F066"}.van-icon-gold-coin:before{content:"\F067"}.van-icon-good-job-o:before{content:"\F068"}.van-icon-good-job:before{content:"\F069"}.van-icon-goods-collect-o:before{content:"\F06A"}.van-icon-goods-collect:before{content:"\F06B"}.van-icon-graphic:before{content:"\F06C"}.van-icon-home-o:before{content:"\F06D"}.van-icon-hot-o:before{content:"\F06E"}.van-icon-hot-sale-o:before{content:"\F06F"}.van-icon-hot-sale:before{content:"\F070"}.van-icon-hot:before{content:"\F071"}.van-icon-hotel-o:before{content:"\F072"}.van-icon-idcard:before{content:"\F073"}.van-icon-info-o:before{content:"\F074"}.van-icon-info:before{content:"\F075"}.van-icon-invition:before{content:"\F076"}.van-icon-label-o:before{content:"\F077"}.van-icon-label:before{content:"\F078"}.van-icon-like-o:before{content:"\F079"}.van-icon-like:before{content:"\F07A"}.van-icon-live:before{content:"\F07B"}.van-icon-location-o:before{content:"\F07C"}.van-icon-location:before{content:"\F07D"}.van-icon-lock:before{content:"\F07E"}.van-icon-logistics:before{content:"\F07F"}.van-icon-manager-o:before{content:"\F080"}.van-icon-manager:before{content:"\F081"}.van-icon-map-marked:before{content:"\F082"}.van-icon-medal-o:before{content:"\F083"}.van-icon-medal:before{content:"\F084"}.van-icon-more-o:before{content:"\F085"}.van-icon-more:before{content:"\F086"}.van-icon-music-o:before{content:"\F087"}.van-icon-music:before{content:"\F088"}.van-icon-new-arrival-o:before{content:"\F089"}.van-icon-new-arrival:before{content:"\F08A"}.van-icon-new-o:before{content:"\F08B"}.van-icon-new:before{content:"\F08C"}.van-icon-newspaper-o:before{content:"\F08D"}.van-icon-notes-o:before{content:"\F08E"}.van-icon-orders-o:before{content:"\F08F"}.van-icon-other-pay:before{content:"\F090"}.van-icon-paid:before{content:"\F091"}.van-icon-passed:before{content:"\F092"}.van-icon-pause-circle-o:before{content:"\F093"}.van-icon-pause-circle:before{content:"\F094"}.van-icon-pause:before{content:"\F095"}.van-icon-peer-pay:before{content:"\F096"}.van-icon-pending-payment:before{content:"\F097"}.van-icon-phone-circle-o:before{content:"\F098"}.van-icon-phone-circle:before{content:"\F099"}.van-icon-phone-o:before{content:"\F09A"}.van-icon-phone:before{content:"\F09B"}.van-icon-photo-o:before{content:"\F09C"}.van-icon-photo:before{content:"\F09D"}.van-icon-photograph:before{content:"\F09E"}.van-icon-play-circle-o:before{content:"\F09F"}.van-icon-play-circle:before{content:"\F0A0"}.van-icon-play:before{content:"\F0A1"}.van-icon-plus:before{content:"\F0A2"}.van-icon-point-gift-o:before{content:"\F0A3"}.van-icon-point-gift:before{content:"\F0A4"}.van-icon-points:before{content:"\F0A5"}.van-icon-printer:before{content:"\F0A6"}.van-icon-qr-invalid:before{content:"\F0A7"}.van-icon-qr:before{content:"\F0A8"}.van-icon-question-o:before{content:"\F0A9"}.van-icon-question:before{content:"\F0AA"}.van-icon-records:before{content:"\F0AB"}.van-icon-refund-o:before{content:"\F0AC"}.van-icon-replay:before{content:"\F0AD"}.van-icon-scan:before{content:"\F0AE"}.van-icon-search:before{content:"\F0AF"}.van-icon-send-gift-o:before{content:"\F0B0"}.van-icon-send-gift:before{content:"\F0B1"}.van-icon-service-o:before{content:"\F0B2"}.van-icon-service:before{content:"\F0B3"}.van-icon-setting-o:before{content:"\F0B4"}.van-icon-setting:before{content:"\F0B5"}.van-icon-share:before{content:"\F0B6"}.van-icon-shop-collect-o:before{content:"\F0B7"}.van-icon-shop-collect:before{content:"\F0B8"}.van-icon-shop-o:before{content:"\F0B9"}.van-icon-shop:before{content:"\F0BA"}.van-icon-shopping-cart-o:before{content:"\F0BB"}.van-icon-shopping-cart:before{content:"\F0BC"}.van-icon-shrink:before{content:"\F0BD"}.van-icon-sign:before{content:"\F0BE"}.van-icon-smile-comment-o:before{content:"\F0BF"}.van-icon-smile-comment:before{content:"\F0C0"}.van-icon-smile-o:before{content:"\F0C1"}.van-icon-smile:before{content:"\F0C2"}.van-icon-star-o:before{content:"\F0C3"}.van-icon-star:before{content:"\F0C4"}.van-icon-stop-circle-o:before{content:"\F0C5"}.van-icon-stop-circle:before{content:"\F0C6"}.van-icon-stop:before{content:"\F0C7"}.van-icon-success:before{content:"\F0C8"}.van-icon-thumb-circle-o:before{content:"\F0C9"}.van-icon-thumb-circle:before{content:"\F0CA"}.van-icon-todo-list-o:before{content:"\F0CB"}.van-icon-todo-list:before{content:"\F0CC"}.van-icon-tosend:before{content:"\F0CD"}.van-icon-tv-o:before{content:"\F0CE"}.van-icon-umbrella-circle:before{content:"\F0CF"}.van-icon-underway-o:before{content:"\F0D0"}.van-icon-underway:before{content:"\F0D1"}.van-icon-upgrade:before{content:"\F0D2"}.van-icon-user-circle-o:before{content:"\F0D3"}.van-icon-user-o:before{content:"\F0D4"}.van-icon-video-o:before{content:"\F0D5"}.van-icon-video:before{content:"\F0D6"}.van-icon-vip-card-o:before{content:"\F0D7"}.van-icon-vip-card:before{content:"\F0D8"}.van-icon-volume-o:before{content:"\F0D9"}.van-icon-volume:before{content:"\F0DA"}.van-icon-wap-home-o:before{content:"\F0DB"}.van-icon-wap-home:before{content:"\F0DC"}.van-icon-wap-nav:before{content:"\F0DD"}.van-icon-warn-o:before{content:"\F0DE"}.van-icon-warning-o:before{content:"\F0DF"}.van-icon-warning:before{content:"\F0E0"}.van-icon-weapp-nav:before{content:"\F0E1"}.van-icon-wechat:before{content:"\F0E2"}.van-icon-youzan-shield:before{content:"\F0E3"}:host{display:-webkit-inline-flex;display:inline-flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.van-icon--image{width:1em;height:1em}.van-icon__image{width:100%;height:100%}.van-icon__info{z-index:1} \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/info/index.d.ts b/yanzhu-ui-app/miniprogram/components/@mkl/info/index.d.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/info/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/info/index.js b/yanzhu-ui-app/miniprogram/components/@mkl/info/index.js new file mode 100644 index 00000000..489f39cb --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/info/index.js @@ -0,0 +1,8 @@ +import { VantComponent } from '../common/component'; +VantComponent({ + props: { + dot: Boolean, + info: null, + customStyle: String, + }, +}); diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/info/index.json b/yanzhu-ui-app/miniprogram/components/@mkl/info/index.json new file mode 100644 index 00000000..467ce294 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/info/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/info/index.wxml b/yanzhu-ui-app/miniprogram/components/@mkl/info/index.wxml new file mode 100644 index 00000000..3112dfc9 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/info/index.wxml @@ -0,0 +1,7 @@ + + +{{ dot ? '' : info }} diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/info/index.wxss b/yanzhu-ui-app/miniprogram/components/@mkl/info/index.wxss new file mode 100644 index 00000000..6d44b8ef --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/info/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-info{position:absolute;top:0;right:0;box-sizing:border-box;white-space:nowrap;text-align:center;-webkit-transform:translate(50%,-50%);transform:translate(50%,-50%);-webkit-transform-origin:100%;transform-origin:100%;min-width:16px;min-width:var(--info-size,16px);padding:0 3px;padding:var(--info-padding,0 3px);color:#fff;color:var(--info-color,#fff);font-weight:500;font-weight:var(--info-font-weight,500);font-size:12px;font-size:var(--info-font-size,12px);font-family:Avenir-Heavy,PingFang SC,Helvetica Neue,Arial,sans-serif;font-family:var(--info-font-family,Avenir-Heavy,PingFang SC,Helvetica Neue,Arial,sans-serif);line-height:14px;line-height:calc(var(--info-size, 16px) - var(--info-border-width, 1px)*2);background-color:#ee0a24;background-color:var(--info-background-color,#ee0a24);border:1px solid #fff;border:var(--info-border-width,1px) solid var(--white,#fff);border-radius:16px;border-radius:var(--info-size,16px)}.van-info--dot{min-width:0;border-radius:100%;width:8px;width:var(--info-dot-size,8px);height:8px;height:var(--info-dot-size,8px);background-color:#ee0a24;background-color:var(--info-dot-color,#ee0a24)} \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/loading/index.d.ts b/yanzhu-ui-app/miniprogram/components/@mkl/loading/index.d.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/loading/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/loading/index.js b/yanzhu-ui-app/miniprogram/components/@mkl/loading/index.js new file mode 100644 index 00000000..2049447c --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/loading/index.js @@ -0,0 +1,16 @@ +import { VantComponent } from '../common/component'; +VantComponent({ + props: { + color: String, + vertical: Boolean, + type: { + type: String, + value: 'circular', + }, + size: String, + textSize: String, + }, + data: { + array12: Array.from({ length: 12 }), + }, +}); diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/loading/index.json b/yanzhu-ui-app/miniprogram/components/@mkl/loading/index.json new file mode 100644 index 00000000..467ce294 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/loading/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/loading/index.wxml b/yanzhu-ui-app/miniprogram/components/@mkl/loading/index.wxml new file mode 100644 index 00000000..e934288b --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/loading/index.wxml @@ -0,0 +1,18 @@ + + + + + + + + + + diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/loading/index.wxss b/yanzhu-ui-app/miniprogram/components/@mkl/loading/index.wxss new file mode 100644 index 00000000..f28a6b46 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/loading/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';:host{font-size:0;line-height:1}.van-loading{display:-webkit-inline-flex;display:inline-flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;color:#c8c9cc;color:var(--loading-spinner-color,#c8c9cc)}.van-loading__spinner{position:relative;box-sizing:border-box;width:30px;width:var(--loading-spinner-size,30px);max-width:100%;max-height:100%;height:30px;height:var(--loading-spinner-size,30px);-webkit-animation:van-rotate .8s linear infinite;animation:van-rotate .8s linear infinite;-webkit-animation:van-rotate var(--loading-spinner-animation-duration,.8s) linear infinite;animation:van-rotate var(--loading-spinner-animation-duration,.8s) linear infinite}.van-loading__spinner--spinner{-webkit-animation-timing-function:steps(12);animation-timing-function:steps(12)}.van-loading__spinner--circular{border:1px solid transparent;border-top-color:initial;border-radius:100%}.van-loading__text{margin-left:8px;margin-left:var(--padding-xs,8px);color:#969799;color:var(--loading-text-color,#969799);font-size:14px;font-size:var(--loading-text-font-size,14px);line-height:20px;line-height:var(--loading-text-line-height,20px)}.van-loading__text:empty{display:none}.van-loading--vertical{-webkit-flex-direction:column;flex-direction:column}.van-loading--vertical .van-loading__text{margin:8px 0 0;margin:var(--padding-xs,8px) 0 0}.van-loading__dot{position:absolute;top:0;left:0;width:100%;height:100%}.van-loading__dot:before{display:block;width:2px;height:25%;margin:0 auto;background-color:currentColor;border-radius:40%;content:" "}.van-loading__dot:first-of-type{-webkit-transform:rotate(30deg);transform:rotate(30deg);opacity:1}.van-loading__dot:nth-of-type(2){-webkit-transform:rotate(60deg);transform:rotate(60deg);opacity:.9375}.van-loading__dot:nth-of-type(3){-webkit-transform:rotate(90deg);transform:rotate(90deg);opacity:.875}.van-loading__dot:nth-of-type(4){-webkit-transform:rotate(120deg);transform:rotate(120deg);opacity:.8125}.van-loading__dot:nth-of-type(5){-webkit-transform:rotate(150deg);transform:rotate(150deg);opacity:.75}.van-loading__dot:nth-of-type(6){-webkit-transform:rotate(180deg);transform:rotate(180deg);opacity:.6875}.van-loading__dot:nth-of-type(7){-webkit-transform:rotate(210deg);transform:rotate(210deg);opacity:.625}.van-loading__dot:nth-of-type(8){-webkit-transform:rotate(240deg);transform:rotate(240deg);opacity:.5625}.van-loading__dot:nth-of-type(9){-webkit-transform:rotate(270deg);transform:rotate(270deg);opacity:.5}.van-loading__dot:nth-of-type(10){-webkit-transform:rotate(300deg);transform:rotate(300deg);opacity:.4375}.van-loading__dot:nth-of-type(11){-webkit-transform:rotate(330deg);transform:rotate(330deg);opacity:.375}.van-loading__dot:nth-of-type(12){-webkit-transform:rotate(1turn);transform:rotate(1turn);opacity:.3125}@-webkit-keyframes van-rotate{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes van-rotate{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}} \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/mixins/basic.d.ts b/yanzhu-ui-app/miniprogram/components/@mkl/mixins/basic.d.ts new file mode 100644 index 00000000..b2733690 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/mixins/basic.d.ts @@ -0,0 +1 @@ +export declare const basic: string; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/mixins/basic.js b/yanzhu-ui-app/miniprogram/components/@mkl/mixins/basic.js new file mode 100644 index 00000000..8a25f166 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/mixins/basic.js @@ -0,0 +1,27 @@ +export const basic = Behavior({ + methods: { + $emit(...args) { + this.triggerEvent(...args); + }, + set(data, callback) { + this.setData(data, callback); + return new Promise((resolve) => wx.nextTick(resolve)); + }, + getRect(selector, all) { + return new Promise((resolve) => { + wx.createSelectorQuery() + .in(this) + [all ? 'selectAll' : 'select'](selector) + .boundingClientRect((rect) => { + if (all && Array.isArray(rect) && rect.length) { + resolve(rect); + } + if (!all && rect) { + resolve(rect); + } + }) + .exec(); + }); + }, + }, +}); diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/mixins/button.d.ts b/yanzhu-ui-app/miniprogram/components/@mkl/mixins/button.d.ts new file mode 100644 index 00000000..b51db875 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/mixins/button.d.ts @@ -0,0 +1 @@ +export declare const button: string; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/mixins/button.js b/yanzhu-ui-app/miniprogram/components/@mkl/mixins/button.js new file mode 100644 index 00000000..732fa5cf --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/mixins/button.js @@ -0,0 +1,15 @@ +export const button = Behavior({ + externalClasses: ['hover-class'], + properties: { + id: String, + lang: String, + businessId: Number, + sessionFrom: String, + sendMessageTitle: String, + sendMessagePath: String, + sendMessageImg: String, + showMessageCard: Boolean, + appParameter: String, + ariaLabel: String, + }, +}); diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/mixins/link.d.ts b/yanzhu-ui-app/miniprogram/components/@mkl/mixins/link.d.ts new file mode 100644 index 00000000..d58043bc --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/mixins/link.d.ts @@ -0,0 +1 @@ +export declare const link: string; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/mixins/link.js b/yanzhu-ui-app/miniprogram/components/@mkl/mixins/link.js new file mode 100644 index 00000000..f215742e --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/mixins/link.js @@ -0,0 +1,17 @@ +export const link = Behavior({ + properties: { + url: String, + linkType: { + type: String, + value: 'navigateTo', + }, + }, + methods: { + jumpLink(urlKey = 'url') { + const url = this.data[urlKey]; + if (url) { + wx[this.data.linkType]({ url }); + } + }, + }, +}); diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/mixins/open-type.d.ts b/yanzhu-ui-app/miniprogram/components/@mkl/mixins/open-type.d.ts new file mode 100644 index 00000000..64b023d7 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/mixins/open-type.d.ts @@ -0,0 +1 @@ +export declare const openType: string; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/mixins/open-type.js b/yanzhu-ui-app/miniprogram/components/@mkl/mixins/open-type.js new file mode 100644 index 00000000..454c9371 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/mixins/open-type.js @@ -0,0 +1,25 @@ +export const openType = Behavior({ + properties: { + openType: String, + }, + methods: { + bindGetUserInfo(event) { + this.$emit('getuserinfo', event.detail); + }, + bindContact(event) { + this.$emit('contact', event.detail); + }, + bindGetPhoneNumber(event) { + this.$emit('getphonenumber', event.detail); + }, + bindError(event) { + this.$emit('error', event.detail); + }, + bindLaunchApp(event) { + this.$emit('launchapp', event.detail); + }, + bindOpenSetting(event) { + this.$emit('opensetting', event.detail); + }, + }, +}); diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/mixins/page-scroll.d.ts b/yanzhu-ui-app/miniprogram/components/@mkl/mixins/page-scroll.d.ts new file mode 100644 index 00000000..7e9a80f1 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/mixins/page-scroll.d.ts @@ -0,0 +1,5 @@ +/// +declare type IPageScrollOption = WechatMiniprogram.Page.IPageScrollOption; +declare type Scroller = (event: IPageScrollOption) => void; +export declare const pageScrollMixin: (scroller: Scroller) => string; +export {}; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/mixins/page-scroll.js b/yanzhu-ui-app/miniprogram/components/@mkl/mixins/page-scroll.js new file mode 100644 index 00000000..d4e9199d --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/mixins/page-scroll.js @@ -0,0 +1,33 @@ +function getCurrentPage() { + const pages = getCurrentPages(); + return pages[pages.length - 1] || {}; +} +function onPageScroll(event) { + const { vanPageScroller = [] } = getCurrentPage(); + vanPageScroller.forEach((scroller) => { + if (typeof scroller === 'function') { + scroller(event); + } + }); +} +export const pageScrollMixin = (scroller) => + Behavior({ + attached() { + const page = getCurrentPage(); + if (Array.isArray(page.vanPageScroller)) { + page.vanPageScroller.push(scroller.bind(this)); + } else { + page.vanPageScroller = + typeof page.onPageScroll === 'function' + ? [page.onPageScroll.bind(page), scroller.bind(this)] + : [scroller.bind(this)]; + } + page.onPageScroll = onPageScroll; + }, + detached() { + const page = getCurrentPage(); + page.vanPageScroller = (page.vanPageScroller || []).filter( + (item) => item !== scroller + ); + }, + }); diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/mixins/touch.d.ts b/yanzhu-ui-app/miniprogram/components/@mkl/mixins/touch.d.ts new file mode 100644 index 00000000..35ee831d --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/mixins/touch.d.ts @@ -0,0 +1 @@ +export declare const touch: string; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/mixins/touch.js b/yanzhu-ui-app/miniprogram/components/@mkl/mixins/touch.js new file mode 100644 index 00000000..f29a92d9 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/mixins/touch.js @@ -0,0 +1,36 @@ +const MIN_DISTANCE = 10; +function getDirection(x, y) { + if (x > y && x > MIN_DISTANCE) { + return 'horizontal'; + } + if (y > x && y > MIN_DISTANCE) { + return 'vertical'; + } + return ''; +} +export const touch = Behavior({ + methods: { + resetTouchStatus() { + this.direction = ''; + this.deltaX = 0; + this.deltaY = 0; + this.offsetX = 0; + this.offsetY = 0; + }, + touchStart(event) { + this.resetTouchStatus(); + const touch = event.touches[0]; + this.startX = touch.clientX; + this.startY = touch.clientY; + }, + touchMove(event) { + const touch = event.touches[0]; + this.deltaX = touch.clientX - this.startX; + this.deltaY = touch.clientY - this.startY; + this.offsetX = Math.abs(this.deltaX); + this.offsetY = Math.abs(this.deltaY); + this.direction = + this.direction || getDirection(this.offsetX, this.offsetY); + }, + }, +}); diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/mixins/transition.d.ts b/yanzhu-ui-app/miniprogram/components/@mkl/mixins/transition.d.ts new file mode 100644 index 00000000..d735ac92 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/mixins/transition.d.ts @@ -0,0 +1 @@ +export declare const transition: (showDefaultValue: boolean) => string; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/mixins/transition.js b/yanzhu-ui-app/miniprogram/components/@mkl/mixins/transition.js new file mode 100644 index 00000000..0285058b --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/mixins/transition.js @@ -0,0 +1,118 @@ +import { isObj } from '../common/utils'; +const getClassNames = (name) => ({ + enter: `van-${name}-enter van-${name}-enter-active enter-class enter-active-class`, + 'enter-to': `van-${name}-enter-to van-${name}-enter-active enter-to-class enter-active-class`, + leave: `van-${name}-leave van-${name}-leave-active leave-class leave-active-class`, + 'leave-to': `van-${name}-leave-to van-${name}-leave-active leave-to-class leave-active-class`, +}); +const nextTick = () => new Promise((resolve) => setTimeout(resolve, 1000 / 30)); +export const transition = function (showDefaultValue) { + return Behavior({ + properties: { + customStyle: String, + // @ts-ignore + show: { + type: Boolean, + value: showDefaultValue, + observer: 'observeShow', + }, + // @ts-ignore + duration: { + type: null, + value: 300, + observer: 'observeDuration', + }, + name: { + type: String, + value: 'fade', + }, + }, + data: { + type: '', + inited: false, + display: false, + }, + methods: { + observeShow(value, old) { + if (value === old) { + return; + } + value ? this.enter() : this.leave(); + }, + enter() { + const { duration, name } = this.data; + const classNames = getClassNames(name); + const currentDuration = isObj(duration) ? duration.enter : duration; + this.status = 'enter'; + this.$emit('before-enter'); + Promise.resolve() + .then(nextTick) + .then(() => { + this.checkStatus('enter'); + this.$emit('enter'); + this.setData({ + inited: true, + display: true, + classes: classNames.enter, + currentDuration, + }); + }) + .then(nextTick) + .then(() => { + this.checkStatus('enter'); + this.transitionEnded = false; + this.setData({ + classes: classNames['enter-to'], + }); + }) + .catch(() => {}); + }, + leave() { + if (!this.data.display) { + return; + } + const { duration, name } = this.data; + const classNames = getClassNames(name); + const currentDuration = isObj(duration) ? duration.leave : duration; + this.status = 'leave'; + this.$emit('before-leave'); + Promise.resolve() + .then(nextTick) + .then(() => { + this.checkStatus('leave'); + this.$emit('leave'); + this.setData({ + classes: classNames.leave, + currentDuration, + }); + }) + .then(nextTick) + .then(() => { + this.checkStatus('leave'); + this.transitionEnded = false; + setTimeout(() => this.onTransitionEnd(), currentDuration); + this.setData({ + classes: classNames['leave-to'], + }); + }) + .catch(() => {}); + }, + checkStatus(status) { + if (status !== this.status) { + throw new Error(`incongruent status: ${status}`); + } + }, + onTransitionEnd() { + if (this.transitionEnded) { + return; + } + this.transitionEnded = true; + this.$emit(`after-${this.status}`); + const { show, display } = this.data; + if (!show && display) { + this.setData({ display: false }); + } + }, + }, + }); +}; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/multi-select/index.d.ts b/yanzhu-ui-app/miniprogram/components/@mkl/multi-select/index.d.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/multi-select/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/multi-select/index.js b/yanzhu-ui-app/miniprogram/components/@mkl/multi-select/index.js new file mode 100644 index 00000000..55b7c32c --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/multi-select/index.js @@ -0,0 +1,145 @@ +import { VantComponent } from "../common/component"; +import { pickerProps } from "../picker/shared"; +const COLUMNSPLACEHOLDERCODE = "000000"; +VantComponent({ + classes: ["active-class", "toolbar-class", "column-class"], + props: Object.assign(Object.assign({}, pickerProps), { + value: { + type: Array, + observer(value) { + this.value = value; + this.getSelect(); + this.setValues(); + }, + }, + columns: { + type: Array, + value: [], + observer(value) { + this.getSelect(); + this.setValues(); + }, + }, + }), + + data: { + displayColumns: [], + typeToColumnsPlaceholder: {}, + }, + mounted() { + // setTimeout(() => { + // this.setValues(); + // }, 0); + }, + methods: { + getPicker() { + if (this.picker == null) { + this.picker = this.selectComponent(".van-multi-select__picker"); + } + return this.picker; + }, + onCancel(event) { + this.emit("cancel", event.detail); + }, + onConfirm(event) { + const detail = event.detail; + const values = this.parseOutputValues(detail.value); + this.emit("confirm", {text:values.map((x) => x.text),value: values.map((x) => x.key), index:detail.index }); + }, + emit(type, detail) { + detail.values = detail.value; + delete detail.value; + this.$emit(type, detail); + }, + // parse output columns data + parseOutputValues(values) { + return values.map((value, index) => { + return { + key: value.key, + text: value.text, + }; + }); + }, + onChange(event) { + const { index, picker, value } = event.detail; + this.select = { value, index }; + this.setValues(); + const values = this.parseOutputValues(value); + this.$emit("change", { + picker, + values: values, + value: values.map((x) => x.key), + text: values.map((x) => x.text), + index, + }); + }, + //初始化赋值核心方法 + getSelect(columns = this.data.columns, index = 0, displayColumns = []) { + if (this.value && this.value.length > 0) { + const key = this.value[index]; + + if (columns && columns.length > 0) { + let selectColumn = columns.find((x) => key == x.key); + if (selectColumn) { + displayColumns.push(selectColumn); + if (selectColumn.childs && selectColumn.childs.length > 0) { + this.getSelect(selectColumn.childs, index + 1, displayColumns); + } + } + } + this.select = { + index: this.value.length - 1, + value: displayColumns, + }; + + } + }, + getColumns(columns = this.data.columns, index = 0, displayColumns = [], select) { + if (columns && columns.length > 0) { + let defaultIndex = 0; + if (select) { + if (index <= select.index) { + const val = select.value[index]; + if(val&&val.key){ + columns.forEach((x, i) => { + if (x.key == val.key) { + defaultIndex = i; + } + }); + } + } + } + displayColumns.push({ + values: columns, + defaultIndex: defaultIndex, + }); + let firstColumn = columns[defaultIndex]; + if (firstColumn.childs && firstColumn.childs.length > 0) { + index++; + this.getColumns(firstColumn.childs, index, displayColumns, select); + } + } + return displayColumns; + }, + setValues() { + // const picker = this.getPicker(); + // if (!picker) { + // return; + // } + + let { select } = this; + const stack = this.getColumns(undefined, undefined, undefined, select); + this.setData({ + displayColumns: stack, + }); + }, + getValues() { + const picker = this.getPicker(); + return picker ? picker.getValues().filter((value) => !!value) : []; + }, + reset(value) { + this.value = value || []; + return this.setValues(); + }, + }, +}); diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/multi-select/index.json b/yanzhu-ui-app/miniprogram/components/@mkl/multi-select/index.json new file mode 100644 index 00000000..a778e91c --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/multi-select/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-picker": "../picker/index" + } +} diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/multi-select/index.wxml b/yanzhu-ui-app/miniprogram/components/@mkl/multi-select/index.wxml new file mode 100644 index 00000000..c27f388d --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/multi-select/index.wxml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/multi-select/index.wxss b/yanzhu-ui-app/miniprogram/components/@mkl/multi-select/index.wxss new file mode 100644 index 00000000..99694d60 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/multi-select/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss'; \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/picker-column/index.d.ts b/yanzhu-ui-app/miniprogram/components/@mkl/picker-column/index.d.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/picker-column/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/picker-column/index.js b/yanzhu-ui-app/miniprogram/components/@mkl/picker-column/index.js new file mode 100644 index 00000000..5ea335fc --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/picker-column/index.js @@ -0,0 +1,123 @@ +import { VantComponent } from '../common/component'; +import { isObj, range } from '../common/utils'; +const DEFAULT_DURATION = 200; +VantComponent({ + classes: ['active-class'], + props: { + valueKey: String, + className: String, + itemHeight: Number, + visibleItemCount: Number, + initialOptions: { + type: Array, + value: [], + }, + defaultIndex: { + type: Number, + value: 0, + observer(value) { + this.setIndex(value); + }, + }, + }, + data: { + startY: 0, + offset: 0, + duration: 0, + startOffset: 0, + options: [], + currentIndex: 0, + }, + created() { + const { defaultIndex, initialOptions } = this.data; + this.set({ + currentIndex: defaultIndex, + options: initialOptions, + }).then(() => { + this.setIndex(defaultIndex); + }); + }, + methods: { + getCount() { + return this.data.options.length; + }, + onTouchStart(event) { + this.setData({ + startY: event.touches[0].clientY, + startOffset: this.data.offset, + duration: 0, + }); + }, + onTouchMove(event) { + const { data } = this; + const deltaY = event.touches[0].clientY - data.startY; + this.setData({ + offset: range( + data.startOffset + deltaY, + -(this.getCount() * data.itemHeight), + data.itemHeight + ), + }); + }, + onTouchEnd() { + const { data } = this; + if (data.offset !== data.startOffset) { + this.setData({ duration: DEFAULT_DURATION }); + const index = range( + Math.round(-data.offset / data.itemHeight), + 0, + this.getCount() - 1 + ); + this.setIndex(index, true); + } + }, + onClickItem(event) { + const { index } = event.currentTarget.dataset; + this.setIndex(index, true); + }, + adjustIndex(index) { + const { data } = this; + const count = this.getCount(); + index = range(index, 0, count); + for (let i = index; i < count; i++) { + if (!this.isDisabled(data.options[i])) return i; + } + for (let i = index - 1; i >= 0; i--) { + if (!this.isDisabled(data.options[i])) return i; + } + }, + isDisabled(option) { + return isObj(option) && option.disabled; + }, + getOptionText(option) { + const { data } = this; + return isObj(option) && data.valueKey in option + ? option[data.valueKey] + : option; + }, + setIndex(index, userAction) { + const { data } = this; + index = this.adjustIndex(index) || 0; + const offset = -index * data.itemHeight; + if (index !== data.currentIndex) { + return this.set({ offset, currentIndex: index }).then(() => { + userAction && this.$emit('change', index); + }); + } + return this.set({ offset }); + }, + setValue(value) { + const { options } = this.data; + for (let i = 0; i < options.length; i++) { + if (this.getOptionText(options[i]) === value) { + return this.setIndex(i); + } + } + return Promise.resolve(); + }, + getValue() { + const { data } = this; + return data.options[data.currentIndex]; + }, + }, +}); diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/picker-column/index.json b/yanzhu-ui-app/miniprogram/components/@mkl/picker-column/index.json new file mode 100644 index 00000000..467ce294 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/picker-column/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/picker-column/index.wxml b/yanzhu-ui-app/miniprogram/components/@mkl/picker-column/index.wxml new file mode 100644 index 00000000..f052ed99 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/picker-column/index.wxml @@ -0,0 +1,22 @@ + + + + + {{ getOptionText(option, valueKey) }} + + diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/picker-column/index.wxs b/yanzhu-ui-app/miniprogram/components/@mkl/picker-column/index.wxs new file mode 100644 index 00000000..3c8fc681 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/picker-column/index.wxs @@ -0,0 +1,8 @@ +function isObj(x) { + var type = typeof x; + return x !== null && (type === 'object' || type === 'function'); +} + +module.exports = function (option, valueKey) { + return isObj(option) && option[valueKey] != null ? option[valueKey] : option; +} diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/picker-column/index.wxss b/yanzhu-ui-app/miniprogram/components/@mkl/picker-column/index.wxss new file mode 100644 index 00000000..c5c69100 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/picker-column/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-picker-column{overflow:hidden;text-align:center;color:#000;color:var(--picker-option-text-color,#000);font-size:16px;font-size:var(--picker-option-font-size,16px)}.van-picker-column__item{padding:0 5px}.van-picker-column__item--selected{font-weight:500;font-weight:var(--font-weight-bold,500);color:#323233;color:var(--picker-option-selected-text-color,#323233)}.van-picker-column__item--disabled{opacity:.3;opacity:var(--picker-option-disabled-opacity,.3)} \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/picker/index.d.ts b/yanzhu-ui-app/miniprogram/components/@mkl/picker/index.d.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/picker/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/picker/index.js b/yanzhu-ui-app/miniprogram/components/@mkl/picker/index.js new file mode 100644 index 00000000..e1b3541f --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/picker/index.js @@ -0,0 +1,145 @@ +import { VantComponent } from '../common/component'; +import { pickerProps } from './shared'; +VantComponent({ + classes: ['active-class', 'toolbar-class', 'column-class'], + props: Object.assign(Object.assign({}, pickerProps), { + valueKey: { + type: String, + value: 'text', + }, + toolbarPosition: { + type: String, + value: 'top', + }, + defaultIndex: { + type: Number, + value: 0, + }, + columns: { + type: Array, + value: [], + observer(columns = []) { + this.simple = columns.length && !columns[0].values; + this.children = this.selectAllComponents('.van-picker__column'); + if (Array.isArray(this.children) && this.children.length) { + this.setColumns().catch(() => {}); + } + }, + }, + }), + beforeCreate() { + this.children = []; + }, + methods: { + noop() {}, + setColumns() { + const { data } = this; + const columns = this.simple ? [{ values: data.columns }] : data.columns; + const stack = columns.map((column, index) => + this.setColumnValues(index, column.values) + ); + return Promise.all(stack); + }, + emit(event) { + const { type } = event.currentTarget.dataset; + if (this.simple) { + this.$emit(type, { + value: this.getColumnValue(0), + index: this.getColumnIndex(0), + }); + } else { + this.$emit(type, { + value: this.getValues(), + index: this.getIndexes(), + }); + } + }, + onChange(event) { + if (this.simple) { + this.$emit('change', { + picker: this, + value: this.getColumnValue(0), + index: this.getColumnIndex(0), + }); + } else { + this.$emit('change', { + picker: this, + value: this.getValues(), + index: event.currentTarget.dataset.index, + }); + } + }, + // get column instance by index + getColumn(index) { + return this.children[index]; + }, + // get column value by index + getColumnValue(index) { + const column = this.getColumn(index); + return column && column.getValue(); + }, + // set column value by index + setColumnValue(index, value) { + const column = this.getColumn(index); + if (column == null) { + return Promise.reject(new Error('setColumnValue: 对应列不存在')); + } + return column.setValue(value); + }, + // get column option index by column index + getColumnIndex(columnIndex) { + return (this.getColumn(columnIndex) || {}).data.currentIndex; + }, + // set column option index by column index + setColumnIndex(columnIndex, optionIndex) { + const column = this.getColumn(columnIndex); + if (column == null) { + return Promise.reject(new Error('setColumnIndex: 对应列不存在')); + } + return column.setIndex(optionIndex); + }, + // get options of column by index + getColumnValues(index) { + return (this.children[index] || {}).data.options; + }, + // set options of column by index + setColumnValues(index, options, needReset = true) { + const column = this.children[index]; + if (column == null) { + return Promise.reject(new Error('setColumnValues: 对应列不存在')); + } + const isSame = + JSON.stringify(column.data.options) === JSON.stringify(options); + if (isSame) { + return Promise.resolve(); + } + return column.set({ options }).then(() => { + if (needReset) { + column.setIndex(0); + } + }); + }, + // get values of all columns + getValues() { + return this.children.map((child) => child.getValue()); + }, + // set values of all columns + setValues(values) { + const stack = values.map((value, index) => + this.setColumnValue(index, value) + ); + return Promise.all(stack); + }, + // get indexes of all columns + getIndexes() { + return this.children.map((child) => child.data.currentIndex); + }, + // set indexes of all columns + setIndexes(indexes) { + const stack = indexes.map((optionIndex, columnIndex) => + this.setColumnIndex(columnIndex, optionIndex) + ); + return Promise.all(stack); + }, + }, +}); diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/picker/index.json b/yanzhu-ui-app/miniprogram/components/@mkl/picker/index.json new file mode 100644 index 00000000..2fcec899 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/picker/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": { + "picker-column": "../picker-column/index", + "loading": "../loading/index" + } +} diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/picker/index.wxml b/yanzhu-ui-app/miniprogram/components/@mkl/picker/index.wxml new file mode 100644 index 00000000..21b6999a --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/picker/index.wxml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + function isSimple(columns) { + return columns.length && !columns[0].values; + } + module.exports = isSimple; + \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/picker/index.wxss b/yanzhu-ui-app/miniprogram/components/@mkl/picker/index.wxss new file mode 100644 index 00000000..784c2b02 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/picker/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-picker{position:relative;overflow:hidden;-webkit-text-size-adjust:100%;-webkit-user-select:none;user-select:none;background-color:#fff;background-color:var(--picker-background-color,#fff)}.van-picker__toolbar{display:-webkit-flex;display:flex;-webkit-justify-content:space-between;justify-content:space-between;height:44px;height:var(--picker-toolbar-height,44px);line-height:44px;line-height:var(--picker-toolbar-height,44px)}.van-picker__cancel,.van-picker__confirm{padding:0 16px;padding:var(--picker-action-padding,0 16px);font-size:14px;font-size:var(--picker-action-font-size,14px);color:#1989fa;color:var(--picker-action-text-color,#1989fa)}.van-picker__cancel--hover,.van-picker__confirm--hover{background-color:#f2f3f5;background-color:var(--picker-action-active-color,#f2f3f5)}.van-picker__title{max-width:50%;text-align:center;font-weight:500;font-weight:var(--font-weight-bold,500);font-size:16px;font-size:var(--picker-option-font-size,16px)}.van-picker__columns{position:relative;display:-webkit-flex;display:flex}.van-picker__column{-webkit-flex:1 1;flex:1 1;width:0}.van-picker__loading{position:absolute;top:0;right:0;bottom:0;left:0;z-index:4;display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;background-color:hsla(0,0%,100%,.9);background-color:var(--picker-loading-mask-color,hsla(0,0%,100%,.9))}.van-picker__mask{position:absolute;top:0;left:0;z-index:2;width:100%;height:100%;background-image:linear-gradient(180deg,hsla(0,0%,100%,.9),hsla(0,0%,100%,.4)),linear-gradient(0deg,hsla(0,0%,100%,.9),hsla(0,0%,100%,.4));background-repeat:no-repeat;background-position:top,bottom;-webkit-backface-visibility:hidden;backface-visibility:hidden;pointer-events:none}.van-picker__frame,.van-picker__loading .van-loading{position:absolute;top:50%;left:0;z-index:1;width:100%;-webkit-transform:translateY(-50%);transform:translateY(-50%);pointer-events:none} \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/picker/shared.d.ts b/yanzhu-ui-app/miniprogram/components/@mkl/picker/shared.d.ts new file mode 100644 index 00000000..c5480459 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/picker/shared.d.ts @@ -0,0 +1,21 @@ +export declare const pickerProps: { + title: StringConstructor; + loading: BooleanConstructor; + showToolbar: BooleanConstructor; + cancelButtonText: { + type: StringConstructor; + value: string; + }; + confirmButtonText: { + type: StringConstructor; + value: string; + }; + visibleItemCount: { + type: NumberConstructor; + value: number; + }; + itemHeight: { + type: NumberConstructor; + value: number; + }; +}; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/picker/shared.js b/yanzhu-ui-app/miniprogram/components/@mkl/picker/shared.js new file mode 100644 index 00000000..a8c96a8b --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/picker/shared.js @@ -0,0 +1,21 @@ +export const pickerProps = { + title: String, + loading: Boolean, + showToolbar: Boolean, + cancelButtonText: { + type: String, + value: '取消', + }, + confirmButtonText: { + type: String, + value: '确认', + }, + visibleItemCount: { + type: Number, + value: 5, + }, + itemHeight: { + type: Number, + value: 44, + }, +}; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/picker/toolbar.wxml b/yanzhu-ui-app/miniprogram/components/@mkl/picker/toolbar.wxml new file mode 100644 index 00000000..4fa9db50 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/picker/toolbar.wxml @@ -0,0 +1,28 @@ + diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/sticky/index.d.ts b/yanzhu-ui-app/miniprogram/components/@mkl/sticky/index.d.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/sticky/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/sticky/index.js b/yanzhu-ui-app/miniprogram/components/@mkl/sticky/index.js new file mode 100644 index 00000000..7333995f --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/sticky/index.js @@ -0,0 +1,105 @@ +import { VantComponent } from "../common/component"; +import { pageScrollMixin } from "../mixins/page-scroll"; +const ROOT_ELEMENT = ".van-sticky"; +VantComponent({ + props: { + zIndex: { + type: Number, + value: 99, + }, + offsetTop: { + type: Number, + value: 0, + observer: "onScroll", + }, + disabled: { + type: Boolean, + observer: "onScroll", + }, + container: { + type: null, + observer: "onScroll", + }, + scrollTop: { + type: null, + observer(val) { + this.onScroll({ scrollTop: val }); + }, + }, + }, + mixins: [ + pageScrollMixin(function (event) { + if (this.data.scrollTop != null) { + return; + } + this.onScroll(event); + }), + ], + data: { + height: 0, + fixed: false, + transform: 0, + }, + mounted() { + this.onScroll(); + }, + methods: { + onScroll({ scrollTop } = {}) { + const { container, offsetTop, disabled } = this.data; + if (disabled) { + this.setDataAfterDiff({ + fixed: false, + transform: 0, + }); + return; + } + this.scrollTop = scrollTop || this.scrollTop; + if (typeof container === "function") { + Promise.all([this.getRect(ROOT_ELEMENT), this.getContainerRect()]).then(([root, container]) => { + if (offsetTop + root.height > container.height + container.top) { + this.setDataAfterDiff({ + fixed: false, + transform: container.height - root.height, + }); + } else if (offsetTop >= root.top) { + this.setDataAfterDiff({ + fixed: true, + height: root.height, + transform: 0, + }); + } else { + this.setDataAfterDiff({ fixed: false, transform: 0 }); + } + }); + return; + } + this.getRect(ROOT_ELEMENT).then((root) => { + if (offsetTop >= root.top) { + this.setDataAfterDiff({ fixed: true, height: root.height }); + this.transform = 0; + } else { + this.setDataAfterDiff({ fixed: false }); + } + }); + }, + setDataAfterDiff(data) { + wx.nextTick(() => { + const diff = Object.keys(data).reduce((prev, key) => { + if (data[key] !== this.data[key]) { + prev[key] = data[key]; + } + return prev; + }, {}); + this.setData(diff); + this.$emit("scroll", { + scrollTop: this.scrollTop, + isFixed: data.fixed || this.data.fixed, + }); + }); + }, + getContainerRect() { + const nodesRef = this.data.container(); + return new Promise((resolve) => nodesRef.boundingClientRect(resolve).exec()); + }, + }, +}); diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/sticky/index.json b/yanzhu-ui-app/miniprogram/components/@mkl/sticky/index.json new file mode 100644 index 00000000..467ce294 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/sticky/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/sticky/index.wxml b/yanzhu-ui-app/miniprogram/components/@mkl/sticky/index.wxml new file mode 100644 index 00000000..0a26c7c4 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/sticky/index.wxml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/sticky/index.wxs b/yanzhu-ui-app/miniprogram/components/@mkl/sticky/index.wxs new file mode 100644 index 00000000..18efe147 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/sticky/index.wxs @@ -0,0 +1,37 @@ +/* eslint-disable */ +function wrapStyle(data) { + var style = ''; + + if (data.transform) { + style += 'transform: translate3d(0, ' + data.transform + 'px, 0);'; + } + + if (data.fixed) { + style += 'top: ' + data.offsetTop + 'px;'; + } + + if (data.zIndex) { + style += 'z-index: ' + data.zIndex + ';'; + } + + return style; +} + +function containerStyle(data) { + var style = ''; + + if (data.fixed) { + style += 'height: ' + data.height + 'px;'; + } + + if (data.zIndex) { + style += 'z-index: ' + data.zIndex + ';'; + } + + return style; +} + +module.exports = { + wrapStyle: wrapStyle, + containerStyle: containerStyle +}; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/sticky/index.wxss b/yanzhu-ui-app/miniprogram/components/@mkl/sticky/index.wxss new file mode 100644 index 00000000..52693875 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/sticky/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-sticky{position:relative}.van-sticky-wrap--fixed{position:fixed;right:0;left:0} \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/tab/index.d.ts b/yanzhu-ui-app/miniprogram/components/@mkl/tab/index.d.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/tab/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/tab/index.js b/yanzhu-ui-app/miniprogram/components/@mkl/tab/index.js new file mode 100644 index 00000000..ed8fffb2 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/tab/index.js @@ -0,0 +1,59 @@ +import { VantComponent } from "../common/component"; +VantComponent({ + relation: { + name: "tabs", + type: "ancestor", + current: "tab", + }, + props: { + dot: { + type: Boolean, + observer: "update", + }, + info: { + type: null, + observer: "update", + }, + title: { + type: String, + observer: "update", + }, + disabled: { + type: Boolean, + observer: "update", + }, + titleStyle: { + type: String, + observer: "update", + }, + name: { + type: [Number, String], + value: "", + }, + }, + data: { + active: false, + }, + methods: { + getComputedName() { + if (this.data.name !== "") { + return this.data.name; + } + return this.index; + }, + updateRender(active, parent) { + const { data: parentData } = parent; + this.inited = this.inited || active; + this.setData({ + active, + shouldRender: this.inited || !parentData.lazyRender, + shouldShow: active || parentData.animated, + }); + }, + update() { + if (this.parent) { + this.parent.updateTabs(); + } + }, + }, +}); diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/tab/index.json b/yanzhu-ui-app/miniprogram/components/@mkl/tab/index.json new file mode 100644 index 00000000..467ce294 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/tab/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/tab/index.wxml b/yanzhu-ui-app/miniprogram/components/@mkl/tab/index.wxml new file mode 100644 index 00000000..71e56c94 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/tab/index.wxml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/tab/index.wxss b/yanzhu-ui-app/miniprogram/components/@mkl/tab/index.wxss new file mode 100644 index 00000000..55af244e --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/tab/index.wxss @@ -0,0 +1,21 @@ +/* @import "../common/index.wxss"; */ +:host { + -webkit-flex-shrink: 0; + flex-shrink: 0; + width: 100%; +} +.van-tab__pane, +:host { + box-sizing: border-box; +} +.van-tab__pane { + overflow-y: auto; + -webkit-overflow-scrolling: touch; +} +.van-tab__pane--active { + height: auto; +} +.van-tab__pane--inactive { + height: 0; + overflow: visible; +} diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/tabs/index.d.ts b/yanzhu-ui-app/miniprogram/components/@mkl/tabs/index.d.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/tabs/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/tabs/index.js b/yanzhu-ui-app/miniprogram/components/@mkl/tabs/index.js new file mode 100644 index 00000000..2e58faef --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/tabs/index.js @@ -0,0 +1,255 @@ +import { VantComponent } from "../common/component"; +import { touch } from "../mixins/touch"; +import { isDef, addUnit } from "../common/utils"; +VantComponent({ + mixins: [touch], + classes: ["nav-class", "tab-class", "tab-active-class", "line-class"], + relation: { + name: "tab", + type: "descendant", + current: "tabs", + linked(target) { + target.index = this.children.length - 1; + this.updateTabs(); + }, + unlinked() { + this.children = this.children.map((child, index) => { + child.index = index; + return child; + }); + this.updateTabs(); + }, + }, + props: { + color: { + type: String, + observer: "setLine", + }, + sticky: Boolean, + animated: { + type: Boolean, + observer() { + this.children.forEach((child, index) => child.updateRender(index === this.data.currentIndex, this)); + }, + }, + swipeable: Boolean, + lineWidth: { + type: [String, Number], + value: -1, + observer: "setLine", + }, + lineHeight: { + type: [String, Number], + value: -1, + observer: "setLine", + }, + titleActiveColor: String, + titleInactiveColor: String, + active: { + type: [String, Number], + value: 0, + observer(name) { + if (name !== this.getCurrentName()) { + this.setCurrentIndexByName(name); + } + }, + }, + type: { + type: String, + value: "line", + }, + border: { + type: Boolean, + value: true, + }, + ellipsis: { + type: Boolean, + value: true, + }, + duration: { + type: Number, + value: 0.3, + }, + zIndex: { + type: Number, + value: 1, + }, + swipeThreshold: { + type: Number, + value: 4, + observer(value) { + this.setData({ + scrollable: this.children.length > value || !this.data.ellipsis, + }); + }, + }, + offsetTop: { + type: Number, + value: 0, + }, + lazyRender: { + type: Boolean, + value: true, + }, + }, + data: { + tabs: [], + lineStyle: "", + scrollLeft: 0, + scrollable: false, + trackStyle: "", + currentIndex: null, + container: null, + }, + mounted() { + wx.nextTick(() => { + this.setLine(true); + this.scrollIntoView(); + }); + }, + methods: { + updateContainer() { + this.setData({ + container: () => this.createSelectorQuery().select(".van-tabs"), + }); + }, + updateTabs() { + const { children = [], data } = this; + this.setData({ + tabs: children.map((child) => child.data), + scrollable: this.children.length > data.swipeThreshold || !data.ellipsis, + }); + this.setCurrentIndexByName(this.getCurrentName() || data.active); + }, + trigger(eventName, child) { + const { currentIndex } = this.data; + const currentChild = child || this.children[currentIndex]; + if (!isDef(currentChild)) { + return; + } + this.$emit(eventName, { + index: currentChild.index, + name: currentChild.getComputedName(), + title: currentChild.data.title, + }); + }, + onTap(event) { + const { index } = event.currentTarget.dataset; + const child = this.children[index]; + if (child.data.disabled) { + this.trigger("disabled", child); + } else { + this.setCurrentIndex(index); + wx.nextTick(() => { + this.trigger("click"); + }); + } + }, + // correct the index of active tab + setCurrentIndexByName(name) { + const { children = [] } = this; + const matched = children.filter((child) => child.getComputedName() === name); + if (matched.length) { + this.setCurrentIndex(matched[0].index); + } + }, + setCurrentIndex(currentIndex) { + const { data, children = [] } = this; + if (!isDef(currentIndex) || currentIndex >= children.length || currentIndex < 0) { + return; + } + children.forEach((item, index) => { + const active = index === currentIndex; + if (active !== item.data.active || !item.inited) { + item.updateRender(active, this); + } + }); + if (currentIndex === data.currentIndex) { + return; + } + const shouldEmitChange = data.currentIndex !== null; + this.setData({ currentIndex }); + wx.nextTick(() => { + this.setLine(); + this.scrollIntoView(); + this.updateContainer(); + this.trigger("input"); + if (shouldEmitChange) { + this.trigger("change"); + } + }); + }, + getCurrentName() { + const activeTab = this.children[this.data.currentIndex]; + if (activeTab) { + return activeTab.getComputedName(); + } + }, + setLine(skipTransition) { + if (this.data.type !== "line") { + return; + } + const { color, duration, currentIndex, lineWidth, lineHeight } = this.data; + this.getRect(".van-tab", true).then((rects = []) => { + const rect = rects[currentIndex]; + if (rect == null) { + return; + } + const width = lineWidth !== -1 ? lineWidth : rect.width / 2; + const height = lineHeight !== -1 ? `height: ${addUnit(lineHeight)}; border-radius: ${addUnit(lineHeight)};` : ""; + let left = rects.slice(0, currentIndex).reduce((prev, curr) => prev + curr.width, 0); + left += (rect.width - width) / 2; + const transition = skipTransition ? "" : `transition-duration: ${duration}s; -webkit-transition-duration: ${duration}s;`; + this.setData({ + lineStyle: ` + ${height} + width: ${addUnit(width)}; + background-color: ${color}; + -webkit-transform: translateX(${left}px); + transform: translateX(${left}px); + ${transition} + `, + }); + }); + }, + // scroll active tab into view + scrollIntoView() { + const { currentIndex, scrollable } = this.data; + if (!scrollable) { + return; + } + Promise.all([this.getRect(".van-tab", true), this.getRect(".van-tabs__nav")]).then(([tabRects, navRect]) => { + const tabRect = tabRects[currentIndex]; + const offsetLeft = tabRects.slice(0, currentIndex).reduce((prev, curr) => prev + curr.width, 0); + this.setData({ + scrollLeft: offsetLeft - (navRect.width - tabRect.width) / 2, + }); + }); + }, + onTouchScroll(event) { + this.$emit("scroll", event.detail); + }, + onTouchStart(event) { + if (!this.data.swipeable) return; + this.touchStart(event); + }, + onTouchMove(event) { + if (!this.data.swipeable) return; + this.touchMove(event); + }, + // watch swipe touch end + onTouchEnd() { + if (!this.data.swipeable) return; + const { tabs, currentIndex } = this.data; + const { direction, deltaX, offsetX } = this; + const minSwipeDistance = 50; + if (direction === "horizontal" && offsetX >= minSwipeDistance) { + if (deltaX > 0 && currentIndex !== 0) { + this.setCurrentIndex(currentIndex - 1); + } else if (deltaX < 0 && currentIndex !== tabs.length - 1) { + this.setCurrentIndex(currentIndex + 1); + } + } + }, + }, +}); diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/tabs/index.json b/yanzhu-ui-app/miniprogram/components/@mkl/tabs/index.json new file mode 100644 index 00000000..19c0bc3a --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/tabs/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": { + "van-info": "../info/index", + "van-sticky": "../sticky/index" + } +} diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/tabs/index.wxml b/yanzhu-ui-app/miniprogram/components/@mkl/tabs/index.wxml new file mode 100644 index 00000000..150c9dd4 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/tabs/index.wxml @@ -0,0 +1,26 @@ + + + + + + + + + + + + {{ item.title }} + + + + + + + + + + + + + + \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/tabs/index.wxs b/yanzhu-ui-app/miniprogram/components/@mkl/tabs/index.wxs new file mode 100644 index 00000000..eeed7fc9 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/tabs/index.wxs @@ -0,0 +1,64 @@ +/* eslint-disable */ +function tabClass(active, ellipsis) { + var classes = ["tab-class"]; + + if (active) { + classes.push("tab-active-class"); + } + + if (ellipsis) { + classes.push("van-ellipsis"); + } + + return classes.join(" "); +} + +function tabStyle(active, ellipsis, color, type, disabled, activeColor, inactiveColor, swipeThreshold, scrollable) { + var styles = []; + var isCard = type === "card"; + // card theme color + if (color && isCard) { + styles.push("border-color:" + color); + + if (!disabled) { + if (active) { + styles.push("background-color:" + color); + } else { + styles.push("color:" + color); + } + } + } + + var titleColor = active ? activeColor : inactiveColor; + if (titleColor) { + styles.push("color:" + titleColor); + } + + if (scrollable && ellipsis) { + styles.push("flex-basis:" + 88 / swipeThreshold + "%"); + } + + return styles.join(";"); +} + +function tabCardTypeBorderStyle(color, type) { + var isCard = type === "card"; + var styles = []; + if (isCard && color) { + styles.push("border-color:" + color); + } + return styles.join(";"); +} + +function trackStyle(data) { + if (!data.animated) { + return ""; + } + + return ["transform: translate3d(" + -100 * data.currentIndex + "%, 0, 0)", "-webkit-transition-duration: " + data.duration + "s", "transition-duration: " + data.duration + "s"].join(";"); +} + +module.exports.tabClass = tabClass; +module.exports.tabStyle = tabStyle; +module.exports.trackStyle = trackStyle; +module.exports.tabCardTypeBorderStyle = tabCardTypeBorderStyle; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/tabs/index.wxss b/yanzhu-ui-app/miniprogram/components/@mkl/tabs/index.wxss new file mode 100644 index 00000000..9de53250 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/tabs/index.wxss @@ -0,0 +1,134 @@ +/* @import "../common/index.wxss"; */ +.van-tabs { + position: relative; + -webkit-tap-highlight-color: transparent; +} +.van-tabs__wrap { + display: -webkit-flex; + display: flex; + overflow: hidden; +} +.van-tabs__wrap--scrollable .van-tab { + -webkit-flex: 0 0 22%; + flex: 0 0 22%; +} +.van-tabs__scroll { + background-color: #fff; +} +.van-tabs__scroll--line { + box-sizing: initial; + height: calc(100% + 15px); +} +.van-tabs__scroll--card { + margin: 0 16px; +} +.van-tabs__scroll::-webkit-scrollbar { + display: none; +} +.van-tabs__nav { + position: relative; + display: -webkit-flex; + display: flex; + -webkit-user-select: none; + user-select: none; +} +.van-tabs__nav--card { + box-sizing: border-box; + height: 30px; + border: 1px solid #ee0a24; + border-radius: 2px; +} +.van-tabs__nav--card .van-tab { + color: #ee0a24; + line-height: 28px; + border-right: 1px solid #ee0a24; +} +.van-tabs__nav--card .van-tab:last-child { + border-right: none; +} +.van-tabs__nav--card .van-tab.van-tab--active { + color: #fff; + background-color: #ee0a24; +} +.van-tabs__nav--card .van-tab--disabled { + color: #c8c9cc; +} +.van-tabs__line { + position: absolute; + bottom: 0; + left: 0; + z-index: 1; + height: 3px; + border-radius: 3px; + background-color: #ee0a24; +} +.van-tabs__track { + position: relative; + width: 100%; + height: 100%; +} +.van-tabs__track--animated { + display: -webkit-flex; + display: flex; + transition-property: -webkit-transform; + transition-property: transform; + transition-property: transform, -webkit-transform; +} +.van-tabs__content { + overflow: hidden; +} +.van-tabs--line .van-tabs__wrap { + height: 44px; +} +.van-tabs--card .van-tabs__wrap { + height: 30px; +} +.van-tab { + position: relative; + -webkit-flex: 1; + flex: 1; + box-sizing: border-box; + min-width: 0; + padding: 0 5px; + text-align: center; + cursor: pointer; + /* color: #646566; + font-size: 14px; + line-height: 44px; */ +} +/* .van-tab--active { + font-weight: 500; + color: #323233; +} */ +.mkl-ellipsis { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + font-size: 30rpx; + color: #999; + background: #ffffff; + height: 100rpx; + line-height: 100rpx; +} +.van-tab--active .mkl-ellipsis .mkl-active { + /* font-weight: 500; + color: #323233; */ + background: url("http://fileimg.makalu.cc/CORE_38D582DD840F4816B1F14D964F0046E9.png") no-repeat bottom/100% 15rpx; + font-size: 30rpx; + color: #000; + font-weight: bold; +} +.van-tab--disabled { + color: #c8c9cc; +} +.van-tab--complete { + -webkit-flex: 1 0 auto !important; + flex: 1 0 auto !important; +} +.van-tab__title__info { + position: relative !important; + top: -1px !important; + display: inline-block; + -webkit-transform: translateX(0) !important; + transform: translateX(0) !important; +} diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/wxs/add-unit.wxs b/yanzhu-ui-app/miniprogram/components/@mkl/wxs/add-unit.wxs new file mode 100644 index 00000000..27a22d82 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/wxs/add-unit.wxs @@ -0,0 +1,14 @@ +/* eslint-disable */ +var REGEXP = getRegExp('^\d+(\.\d+)?$'); + +function addUnit(value) { + if (value == null) { + return undefined; + } + + return REGEXP.test('' + value) ? value + 'px' : value; +} + +module.exports = { + addUnit: addUnit +}; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/wxs/array.wxs b/yanzhu-ui-app/miniprogram/components/@mkl/wxs/array.wxs new file mode 100644 index 00000000..610089cd --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/wxs/array.wxs @@ -0,0 +1,5 @@ +function isArray(array) { + return array && array.constructor === 'Array'; +} + +module.exports.isArray = isArray; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/wxs/bem.wxs b/yanzhu-ui-app/miniprogram/components/@mkl/wxs/bem.wxs new file mode 100644 index 00000000..93b2777b --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/wxs/bem.wxs @@ -0,0 +1,38 @@ +var array = require('./array.wxs'); +var object = require('./object.wxs'); +var PREFIX = 'van-'; + +function join(name, mods) { + name = PREFIX + name; + mods = mods.map(function(mod) { + return name + '--' + mod; + }); + mods.unshift(name); + return mods.join(' '); +} + +function traversing(mods, conf) { + if (!conf) { + return; + } + + if (typeof conf === 'string' || typeof conf === 'number') { + mods.push(conf); + } else if (array.isArray(conf)) { + conf.forEach(function(item) { + traversing(mods, item); + }); + } else if (typeof conf === 'object') { + object.keys(conf).forEach(function(key) { + conf[key] && mods.push(key); + }); + } +} + +function bem(name, conf) { + var mods = []; + traversing(mods, conf); + return join(name, mods); +} + +module.exports.bem = bem; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/wxs/memoize.wxs b/yanzhu-ui-app/miniprogram/components/@mkl/wxs/memoize.wxs new file mode 100644 index 00000000..261ae67d --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/wxs/memoize.wxs @@ -0,0 +1,54 @@ +/** + * Simple memoize + * wxs doesn't support fn.apply, so this memoize only support up to 2 args + */ + +function isPrimitive(value) { + var type = typeof value; + return ( + type === 'boolean' || + type === 'number' || + type === 'string' || + type === 'undefined' || + value === null + ); +} + +// mock simple fn.call in wxs +function call(fn, args) { + if (args.length === 2) { + return fn(args[0], args[1]); + } + + if (args.length === 1) { + return fn(args[0]); + } + + return fn(); +} + +function serializer(args) { + if (args.length === 1 && isPrimitive(args[0])) { + return args[0]; + } + var obj = {}; + for (var i = 0; i < args.length; i++) { + obj['key' + i] = args[i]; + } + return JSON.stringify(obj); +} + +function memoize(fn) { + var cache = {}; + + return function() { + var key = serializer(arguments); + if (cache[key] === undefined) { + cache[key] = call(fn, arguments); + } + + return cache[key]; + }; +} + +module.exports.memoize = memoize; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/wxs/object.wxs b/yanzhu-ui-app/miniprogram/components/@mkl/wxs/object.wxs new file mode 100644 index 00000000..e0771077 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/wxs/object.wxs @@ -0,0 +1,13 @@ +/* eslint-disable */ +var REGEXP = getRegExp('{|}|"', 'g'); + +function keys(obj) { + return JSON.stringify(obj) + .replace(REGEXP, '') + .split(',') + .map(function(item) { + return item.split(':')[0]; + }); +} + +module.exports.keys = keys; diff --git a/yanzhu-ui-app/miniprogram/components/@mkl/wxs/utils.wxs b/yanzhu-ui-app/miniprogram/components/@mkl/wxs/utils.wxs new file mode 100644 index 00000000..d5c9d8c2 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/@mkl/wxs/utils.wxs @@ -0,0 +1,10 @@ +/* eslint-disable */ +var bem = require('./bem.wxs').bem; +var memoize = require('./memoize.wxs').memoize; +var addUnit = require('./add-unit.wxs').addUnit; + +module.exports = { + bem: memoize(bem), + memoize: memoize, + addUnit: addUnit +}; diff --git a/yanzhu-ui-app/miniprogram/components/chatroom/chatroom.js b/yanzhu-ui-app/miniprogram/components/chatroom/chatroom.js new file mode 100644 index 00000000..5e716b02 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/chatroom/chatroom.js @@ -0,0 +1,336 @@ +const FATAL_REBUILD_TOLERANCE = 10 +const SETDATA_SCROLL_TO_BOTTOM = { + scrollTop: 100000, + scrollWithAnimation: true, +} + +Component({ + properties: { + envId: String, + collection: String, + groupId: String, + groupName: String, + userInfo: Object, + onGetUserInfo: { + type: Function, + }, + getOpenID: { + type: Function, + }, + }, + + data: { + chats: [], + textInputValue: '', + openId: '', + scrollTop: 0, + scrollToMessage: '', + hasKeyboard: false, + }, + + methods: { + onGetUserInfo(e) { + this.properties.onGetUserInfo(e) + }, + + getOpenID() { + return this.properties.getOpenID() + }, + + mergeCommonCriteria(criteria) { + return { + groupId: this.data.groupId, + ...criteria, + } + }, + + async initRoom() { + this.try(async () => { + await this.initOpenID() + + const { envId, collection } = this.properties + const db = this.db = wx.cloud.database({ + env: envId, + }) + const _ = db.command + + const { data: initList } = await db.collection(collection).where(this.mergeCommonCriteria()).orderBy('sendTimeTS', 'desc').get() + + console.log('init query chats', initList) + + this.setData({ + chats: initList.reverse(), + scrollTop: 10000, + }) + + this.initWatch(initList.length ? { + sendTimeTS: _.gt(initList[initList.length - 1].sendTimeTS), + } : {}) + }, '初始化失败') + }, + + async initOpenID() { + return this.try(async () => { + const openId = await this.getOpenID() + + this.setData({ + openId, + }) + }, '初始化 openId 失败') + }, + + async initWatch(criteria) { + this.try(() => { + const { collection } = this.properties + const db = this.db + const _ = db.command + + console.warn(`开始监听`, criteria) + this.messageListener = db.collection(collection).where(this.mergeCommonCriteria(criteria)).watch({ + onChange: this.onRealtimeMessageSnapshot.bind(this), + onError: e => { + if (!this.inited || this.fatalRebuildCount >= FATAL_REBUILD_TOLERANCE) { + this.showError(this.inited ? '监听错误,已断开' : '初始化监听失败', e, '重连', () => { + this.initWatch(this.data.chats.length ? { + sendTimeTS: _.gt(this.data.chats[this.data.chats.length - 1].sendTimeTS), + } : {}) + }) + } else { + this.initWatch(this.data.chats.length ? { + sendTimeTS: _.gt(this.data.chats[this.data.chats.length - 1].sendTimeTS), + } : {}) + } + }, + }) + }, '初始化监听失败') + }, + + onRealtimeMessageSnapshot(snapshot) { + console.warn(`收到消息`, snapshot) + + if (snapshot.type === 'init') { + this.setData({ + chats: [ + ...this.data.chats, + ...[...snapshot.docs].sort((x, y) => x.sendTimeTS - y.sendTimeTS), + ], + }) + this.scrollToBottom() + this.inited = true + } else { + let hasNewMessage = false + let hasOthersMessage = false + const chats = [...this.data.chats] + for (const docChange of snapshot.docChanges) { + switch (docChange.queueType) { + case 'enqueue': { + hasOthersMessage = docChange.doc._openid !== this.data.openId + const ind = chats.findIndex(chat => chat._id === docChange.doc._id) + if (ind > -1) { + if (chats[ind].msgType === 'image' && chats[ind].tempFilePath) { + chats.splice(ind, 1, { + ...docChange.doc, + tempFilePath: chats[ind].tempFilePath, + }) + } else chats.splice(ind, 1, docChange.doc) + } else { + hasNewMessage = true + chats.push(docChange.doc) + } + break + } + } + } + this.setData({ + chats: chats.sort((x, y) => x.sendTimeTS - y.sendTimeTS), + }) + if (hasOthersMessage || hasNewMessage) { + this.scrollToBottom() + } + } + }, + + async onConfirmSendText(e) { + this.try(async () => { + if (!e.detail.value) { + return + } + + const { collection } = this.properties + const db = this.db + const _ = db.command + + const doc = { + _id: `${Math.random()}_${Date.now()}`, + groupId: this.data.groupId, + avatar: this.data.userInfo.avatarUrl, + nickName: this.data.userInfo.nickName, + msgType: 'text', + textContent: e.detail.value, + sendTime: new Date(), + sendTimeTS: Date.now(), // fallback + } + + this.setData({ + textInputValue: '', + chats: [ + ...this.data.chats, + { + ...doc, + _openid: this.data.openId, + writeStatus: 'pending', + }, + ], + }) + this.scrollToBottom(true) + + await db.collection(collection).add({ + data: doc, + }) + + this.setData({ + chats: this.data.chats.map(chat => { + if (chat._id === doc._id) { + return { + ...chat, + writeStatus: 'written', + } + } else return chat + }), + }) + }, '发送文字失败') + }, + + async onChooseImage(e) { + wx.chooseImage({ + count: 1, + sourceType: ['album', 'camera'], + success: async res => { + const { envId, collection } = this.properties + const doc = { + _id: `${Math.random()}_${Date.now()}`, + groupId: this.data.groupId, + avatar: this.data.userInfo.avatarUrl, + nickName: this.data.userInfo.nickName, + msgType: 'image', + sendTime: new Date(), + sendTimeTS: Date.now(), // fallback + } + + this.setData({ + chats: [ + ...this.data.chats, + { + ...doc, + _openid: this.data.openId, + tempFilePath: res.tempFilePaths[0], + writeStatus: 0, + }, + ] + }) + this.scrollToBottom(true) + + const uploadTask = wx.cloud.uploadFile({ + cloudPath: `${this.data.openId}/${Math.random()}_${Date.now()}.${res.tempFilePaths[0].match(/\.(\w+)$/)[1]}`, + filePath: res.tempFilePaths[0], + config: { + env: envId, + }, + success: res => { + this.try(async () => { + await this.db.collection(collection).add({ + data: { + ...doc, + imgFileID: res.fileID, + }, + }) + }, '发送图片失败') + }, + fail: e => { + this.showError('发送图片失败', e) + }, + }) + + uploadTask.onProgressUpdate(({ progress }) => { + this.setData({ + chats: this.data.chats.map(chat => { + if (chat._id === doc._id) { + return { + ...chat, + writeStatus: progress, + } + } else return chat + }) + }) + }) + }, + }) + }, + + onMessageImageTap(e) { + wx.previewImage({ + urls: [e.target.dataset.fileid], + }) + }, + + scrollToBottom(force) { + if (force) { + console.log('force scroll to bottom') + this.setData(SETDATA_SCROLL_TO_BOTTOM) + return + } + + this.createSelectorQuery().select('.body').boundingClientRect(bodyRect => { + this.createSelectorQuery().select(`.body`).scrollOffset(scroll => { + if (scroll.scrollTop + bodyRect.height * 3 > scroll.scrollHeight) { + console.log('should scroll to bottom') + this.setData(SETDATA_SCROLL_TO_BOTTOM) + } + }).exec() + }).exec() + }, + + async onScrollToUpper() { + if (this.db && this.data.chats.length) { + const { collection } = this.properties + const _ = this.db.command + const { data } = await this.db.collection(collection).where(this.mergeCommonCriteria({ + sendTimeTS: _.lt(this.data.chats[0].sendTimeTS), + })).orderBy('sendTimeTS', 'desc').get() + this.data.chats.unshift(...data.reverse()) + this.setData({ + chats: this.data.chats, + scrollToMessage: `item-${data.length}`, + scrollWithAnimation: false, + }) + } + }, + + async try(fn, title) { + try { + await fn() + } catch (e) { + this.showError(title, e) + } + }, + + showError(title, content, confirmText, confirmCallback) { + console.error(title, content) + wx.showModal({ + title, + content: content.toString(), + showCancel: confirmText ? true : false, + confirmText, + success: res => { + res.confirm && confirmCallback() + }, + }) + }, + }, + + ready() { + global.chatroom = this + this.initRoom() + this.fatalRebuildCount = 0 + }, +}) diff --git a/yanzhu-ui-app/miniprogram/components/chatroom/chatroom.json b/yanzhu-ui-app/miniprogram/components/chatroom/chatroom.json new file mode 100644 index 00000000..e8cfaaf8 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/chatroom/chatroom.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/components/chatroom/chatroom.wxml b/yanzhu-ui-app/miniprogram/components/chatroom/chatroom.wxml new file mode 100644 index 00000000..056a44ca --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/chatroom/chatroom.wxml @@ -0,0 +1,85 @@ + + + + + + {{groupName}} + + + + + + + + + + {{item.nickName}} + + + {{item.writeStatus}}% + + + + + + ··· + {{item.textContent}} + + + + + + + + + + + + + + + + + + + + + diff --git a/yanzhu-ui-app/miniprogram/components/chatroom/chatroom.wxss b/yanzhu-ui-app/miniprogram/components/chatroom/chatroom.wxss new file mode 100644 index 00000000..d7261275 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/chatroom/chatroom.wxss @@ -0,0 +1,161 @@ +.chatroom { + width: 100%; + height: 100%; + display: flex; + flex-direction: column; +} + +.chatroom .header { + flex-basis: fit-content; + display: flex; + flex-direction: row; + border-bottom: 1px solid #ddd; + padding: 20rpx 0 30rpx; + font-size: 30rpx; + /* background: rgb(34, 187, 47); + color: rgba(255, 255, 255, 1) */ + /* font-family: 'Microsoft YaHei' */ +} + +.chatroom .header .left { + flex: 1; +} + +.chatroom .header .middle { + flex: 2; + text-align: center; +} + +.chatroom .header .right { + flex: 1; +} + +.chatroom .body { + flex: 2; + display: flex; + flex-direction: column; + background: rgb(237,237,237); + padding-bottom: 16rpx; +} + +.body .message { + display: flex; + flex-direction: row; + position: relative; + margin: 12rpx 0; +} + +.body .message.message__self { + flex-direction: row-reverse; +} + +.body .message .avatar { + position: relative; + top: 5rpx; + width: 60rpx; + height: 60rpx; + border-radius: 5rpx; + margin: 15rpx; +} + +.body .message .main { + flex: 1; + display: flex; + flex-direction: column; + align-items: flex-start; +} + +.body .message.message__self .main { + align-items: flex-end; +} + +.body .message .nickname { + font-size: 24rpx; + color: #444; +} + +.body .message .text-content { + border: 1px solid transparent; + border-radius: 3px; + background-color: #fff; + margin: 2px 0 0 0; + padding: 4px 10px; + font-size: 30rpx; + display: inline-block; +} + +.body .message.message__self .text-content { + background-color: paleturquoise; +} + +.body .message .text-wrapper { + display: flex; + flex-direction: row; + align-items: center; + max-width: 80%; +} + +.body .message.message__self .text-wrapper .loading{ + font-size: 16rpx; + margin-right: 18rpx; +} + +.body .message .image-wrapper { + display: flex; + flex-direction: row; + align-items: center; +} + +.body .message .image-content { + max-width: 240rpx; + max-height: 240rpx; +} + +.body .message.message__self .image-wrapper .loading { + font-size: 20rpx; + margin-right: 18rpx; +} + +.chatroom .footer { + flex-basis: fit-content; + display: flex; + flex-direction: row; + border-top: 1px solid #ddd; + font-size: 10rpx; + padding: 20rpx 30rpx; + background: rgb(246,246,246); +} + +.chatroom .footer .message-sender { + flex: 1; + display: flex; + flex-direction: row; +} + +.message-sender .text-input { + flex: 1; + font-size: 16px; + border: 1px solid transparent; + border-radius: 5px; + padding: 3px 6px; + margin: 0 10px 0 5px; + background: #fff; +} + +.message-sender .btn-send-image { + width: 50rpx; + height: 50rpx; + align-self: center; +} + +button { + font-size: 30rpx; +} + +button.userinfo { + background: darkturquoise; + color: aliceblue; + padding: 0 100rpx; + border: 1px solid #ddd; + border-radius: 20px; +} diff --git a/yanzhu-ui-app/miniprogram/components/chatroom/photo.png b/yanzhu-ui-app/miniprogram/components/chatroom/photo.png new file mode 100644 index 00000000..ddc4f34e Binary files /dev/null and b/yanzhu-ui-app/miniprogram/components/chatroom/photo.png differ diff --git a/yanzhu-ui-app/miniprogram/components/number/index.js b/yanzhu-ui-app/miniprogram/components/number/index.js new file mode 100644 index 00000000..8652f718 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/number/index.js @@ -0,0 +1,55 @@ +// newComponents/number/index.js +Component({ + /** + * 组件的属性列表 + */ + properties: { + number: { + type: Number, + }, + }, + observers: { + number:function(val){ + this.numberArr() + } + }, + lifetimes: { + created: function(){ + //在组件实例刚刚被创建时执行,注意此时不能调用 setData + + }, + attached: function () { + //在组件实例进入页面节点树时执行 + + }, + ready: function () { + // 在组件在视图层布局完成后执行 + this.numberArr(); + }, + detached: function () { + // 在组件实例被从页面节点树移除时执行 + }, + +}, + + /** + * 组件的初始数据 + */ + data: { + people:[] + }, + + /** + * 组件的方法列表 + */ + + methods: { + numberArr(){ + var n = this.data.number.toString().split('') + this.setData({ + people:n + }) + + } + } +}) diff --git a/yanzhu-ui-app/miniprogram/components/number/index.json b/yanzhu-ui-app/miniprogram/components/number/index.json new file mode 100644 index 00000000..e8cfaaf8 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/number/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/components/number/index.wxml b/yanzhu-ui-app/miniprogram/components/number/index.wxml new file mode 100644 index 00000000..21179b60 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/number/index.wxml @@ -0,0 +1,6 @@ + + + + {{item}} + + diff --git a/yanzhu-ui-app/miniprogram/components/number/index.wxss b/yanzhu-ui-app/miniprogram/components/number/index.wxss new file mode 100644 index 00000000..821ae20e --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/number/index.wxss @@ -0,0 +1,46 @@ +/* newComponents/number/index.wxss */ +/* @font-face { + font-family: "numberfont"; + src: url("../../fonts/PUTHIAfont.eot"); + src:url("../../fonts/PUTHIAfont.eot") format("embedded-opentype"), + url("../../fonts/PUTHIAfont.svg") format("svg"), + url("../../fonts/PUTHIAfont.ttf") format("truetype"), + url("../../fonts/PUTHIAfont.woff") format("woff"), +} */ +.number_max{ + padding: 20rpx 0; +} +.number_min{ + display: flex; + align-items: center; + +} +.number_con{ + width: 40rpx; + height: 70rpx; + background: url("http://fileimg.makalu.cc/WEB_3976596DEC1B4726BDDB70F17DC3D58D.png") no-repeat center/100% 100%; + font-family: 'numberfont' !important; + text-align: center; + line-height: 70rpx; + font-size: 35rpx; + margin-right: 10rpx; +} + + + + + + + + + + + + + + + + + + + diff --git a/yanzhu-ui-app/miniprogram/components/safety-bar-chart/index.js b/yanzhu-ui-app/miniprogram/components/safety-bar-chart/index.js new file mode 100644 index 00000000..b651c2fd --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/safety-bar-chart/index.js @@ -0,0 +1,264 @@ +// components/safety-pie-chart/index.js +import * as echarts from '../../ec-canvas/echarts' + +Component({ + /** + * 组件的属性列表 + */ + properties: { + chartId:{ + type: String + }, + data:{ + type: Array + }, + height:{ + type: Number + } + + }, + observers: { + data: function (val) { + console.log(val) + this.initChart() + }, + }, + /** + * 组件的初始数据 + */ + data: { + ec: { + lazyLoad: true + }, + chart:undefined, + }, + lifetimes: { + created: function(){ + //在组件实例刚刚被创建时执行,注意此时不能调用 setData + }, + attached: function () { + //在组件实例进入页面节点树时执行 + + }, + ready: function () { + // 在组件在视图层布局完成后执行 + this.initChart(); + }, + detached: function () { + // 在组件实例被从页面节点树移除时执行 + }, + + }, + /** + * 组件的方法列表 + */ + methods: { + initChart(){ + var id ='#' + this.data.chartId; + this.component = this.selectComponent(id); + this.component.init((canvas, width, height, dpr) => { + let chart = echarts.init(canvas, null, { + width: width, + height: height, + devicePixelRatio: dpr + }) + chart.setOption(this.getData()); + return chart; + }) + }, + getData() { + var data = this.data.data + + var max = data[0].total + var nameData = []; + var totalData = [] + var background = [] + var yesMonitor = [] + var notMonitor = [] + var yesProp = [] + var notProp = [] + var unitData = [] + + for (let i = data.length-1; i >=0 ; i--) { + nameData.push(data[i].name); + totalData.push(data[i].total) + unitData.push(data[i].unit) + background.push(100); + yesMonitor.push(data[i].yesMonitor); + notMonitor.push(data[i].notMonitor); + yesProp.push((data[i].yesMonitor/max)*100) + notProp.push((data[i].notMonitor/max)*100) + } + + var legend = ["已监控", "未监控"] + + var option = { + grid: { + //图表的位置 + top: "8%", + left: "3%", + right: "5%", + bottom: "-12%", + containLabel: true, + }, + legend: { + top: "0", + //icon: "circle", + itemWidth: 10, + itemHeight:10, + itemGap: 8, + textStyle: { + fontSize: 12, + color:'#c6d9fa' + }, + data: legend, + }, + xAxis: [{ + show: false, + }, + //由于下边X轴已经是百分比刻度了,所以需要在顶部加一个X轴,刻度是金额,也隐藏掉 + { + show: false, + } + ], + yAxis: [ + { + type: 'category', + axisLabel: { + show: false, //让Y轴数据不显示 + }, + itemStyle: { + + }, + axisTick: { + show: false, //隐藏Y轴刻度 + }, + axisLine: { + show: false, //隐藏Y轴线段 + }, + data: [], + },{ + show: false, + data: [], + axisLine: { + show: false + } + }], + series: [ + //数据条--------------------我是分割线君------------------------------// + { + show: true, + type: 'bar', + xAxisIndex: 1, //代表使用第二个X轴刻度!!!!!!!!!!!!!!!!!!!!!!!! + barGap: '-100%', + barWidth: '6', //统计条宽度 + itemStyle: { + normal: { + color: 'rgba(22,203,115,0.05)' + }, + }, + label: { + normal: { + show: true, + //label 的position位置可以是top bottom left,right,也可以是固定值 + //在这里需要上下统一对齐,所以用固定值 + position: [0, '-20'], + rich: { //富文本 + prop: { //自定义颜色 + color: '#c6d9fa', + fontSize:'14', + }, + unit:{ + color: '#6c829a', + fontSize:'12', + }, + yes:{ + color: '#55adf7', + fontSize:'14', + }, + not:{ + color: '#4677fa', + fontSize:'14', + }, + index:{ + color: '#fcbc02', + fontStyle: 'italic', + padding:[0,0,0,5], + fontSize:'14', + }, + name: { + width: 120, + color: '#c6d9fa', + padding:[0,0,0,10], + fontSize:'14', + }, + color:{ + color: '#8ca2be', + fontSize:'14', + }, + + + }, + formatter: function(data) { + //富文本固定格式{colorName|这里填你想要写的内容} + //return '{arrow|}' + return '{index|No.'+(nameData.length-data.dataIndex)+'}{name|' + nameData[data.dataIndex] + '}{prop|' + totalData[data.dataIndex] + '}{unit| '+unitData[data.dataIndex]+'}{prop|(} {yes|'+yesMonitor[data.dataIndex]+'}{unit| '+unitData[data.dataIndex]+'/}{not|'+notMonitor[data.dataIndex]+'}{unit| '+unitData[data.dataIndex]+'}{prop|)} '; + }, + } + }, + data: background + }, + { + type: 'bar', + + silent: true, + yAxisIndex: 1, + barWidth: 6, + itemStyle: { + normal: { + color: 'rgba(0,82,198,0.3)' + }, + emphasis: { + color: 'rgba(0,82,198,0.3)' + } + }, + data: background + }, + { + type: 'bar', + name:legend[0], + + stack: '1', + legendHoverLink: false, + barWidth: 6, + itemStyle: { + normal: { + color: '#52adf4' + }, + emphasis: { + color: '#52adf4' + } + }, + data: yesProp + }, { + type: 'bar', + name:legend[1], + stack: '1', + legendHoverLink: false, + barWidth: 6, + itemStyle: { + normal: { + color: '#4677ff' + }, + emphasis: { + color: '#4677ff' + } + }, + data: notProp + }] + }; + + return option; + } + } +}) diff --git a/yanzhu-ui-app/miniprogram/components/safety-bar-chart/index.json b/yanzhu-ui-app/miniprogram/components/safety-bar-chart/index.json new file mode 100644 index 00000000..b11802ea --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/safety-bar-chart/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + + } +} \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/components/safety-bar-chart/index.wxml b/yanzhu-ui-app/miniprogram/components/safety-bar-chart/index.wxml new file mode 100644 index 00000000..d56ac15d --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/safety-bar-chart/index.wxml @@ -0,0 +1,4 @@ + + + + diff --git a/yanzhu-ui-app/miniprogram/components/safety-bar-chart/index.wxss b/yanzhu-ui-app/miniprogram/components/safety-bar-chart/index.wxss new file mode 100644 index 00000000..e14d6ee3 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/safety-bar-chart/index.wxss @@ -0,0 +1,5 @@ +/* components/bar-chart/index.wxss */ +.chart_canvas{ + width: 100%; + position: relative; +} diff --git a/yanzhu-ui-app/miniprogram/components/safety-bar-charts/index.js b/yanzhu-ui-app/miniprogram/components/safety-bar-charts/index.js new file mode 100644 index 00000000..c2c592dc --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/safety-bar-charts/index.js @@ -0,0 +1,273 @@ +// components/safety-pie-chart/index.js +import * as echarts from '../../ec-canvas/echarts' + +Component({ + /** + * 组件的属性列表 + */ + properties: { + chartId:{ + type: String + }, + data:{ + type: Array + }, + height:{ + type: Number + } + + }, + observers: { + data: function (val) { + this.initChart() + }, + }, + /** + * 组件的初始数据 + */ + data: { + ec: { + lazyLoad: true + }, + chart:undefined, + }, + lifetimes: { + created: function(){ + //在组件实例刚刚被创建时执行,注意此时不能调用 setData + }, + attached: function () { + //在组件实例进入页面节点树时执行 + + }, + ready: function () { + // 在组件在视图层布局完成后执行 + this.initChart(); + }, + detached: function () { + // 在组件实例被从页面节点树移除时执行 + }, + + }, + /** + * 组件的方法列表 + */ + methods: { + initChart(){ + var id ='#' + this.data.chartId; + this.component = this.selectComponent(id); + if(this.component){ + this.component.init((canvas, width, height, dpr) => { + let chart = echarts.init(canvas, null, { + width: width, + height: height, + devicePixelRatio: dpr + }) + chart.setOption(this.getData()); + return chart; + }) + } + + }, + getData() { + var data = this.data.data + + var max = data[0].total + var nameData = []; + var totalData = [] + var background = [] + var yesMonitor = [] + var notMonitor = [] + var yesProp = [] + var notProp = [] + var unitData = [] + + for (let i = data.length-1; i >=0 ; i--) { + nameData.push(data[i].name); + totalData.push(data[i].total) + unitData.push(data[i].unit) + background.push(100); + yesMonitor.push(data[i].yesMonitor); + notMonitor.push(data[i].notMonitor); + yesProp.push((data[i].yesMonitor/max)*100) + notProp.push((data[i].notMonitor/max)*100) + } + + var legend = ["已监控", "未监控"] + + var option = { + grid: { + //图表的位置 + top: "8%", + left: "3%", + right: "5%", + bottom: "-12%", + containLabel: true, + }, + // legend: { + // top: "0", + // //icon: "circle", + // itemWidth: 10, + // itemHeight:10, + // itemGap: 8, + // textStyle: { + // fontSize: 12, + // color:'#c6d9fa' + // }, + // // data: legend, + // }, + xAxis: [{ + show: false, + }, + //由于下边X轴已经是百分比刻度了,所以需要在顶部加一个X轴,刻度是金额,也隐藏掉 + { + show: false, + } + ], + yAxis: [ + { + type: 'category', + axisLabel: { + show: false, //让Y轴数据不显示 + }, + itemStyle: { + + }, + axisTick: { + show: false, //隐藏Y轴刻度 + }, + axisLine: { + show: false, //隐藏Y轴线段 + }, + data: [], + },{ + show: false, + data: [], + axisLine: { + show: false + } + }], + series: [ + //数据条--------------------我是分割线君------------------------------// + { + show: true, + type: 'bar', + xAxisIndex: 1, //代表使用第二个X轴刻度!!!!!!!!!!!!!!!!!!!!!!!! + barGap: '-100%', + barWidth: '6', //统计条宽度 + itemStyle: { + normal: { + color: 'rgba(22,203,115,0.05)' + }, + }, + label: { + normal: { + show: true, + //label 的position位置可以是top bottom left,right,也可以是固定值 + //在这里需要上下统一对齐,所以用固定值 + position: [0, '-20'], + rich: { //富文本 + prop: { //自定义颜色 + color: '#c6d9fa', + fontSize:'14', + }, + unit:{ + color: '#6c829a', + fontSize:'12', + }, + yes:{ + color: '#55adf7', + fontSize:'14', + }, + // not:{ + // color: '#4677fa', + // fontSize:'14', + // }, + index:{ + color: '#fcbc02', + fontStyle: 'italic', + padding:[0,0,0,5], + fontSize:'14', + }, + name: { + width: 120, + color: '#c6d9fa', + padding:[0,0,0,10], + fontSize:'14', + }, + color:{ + color: '#8ca2be', + fontSize:'14', + }, + // arrow:{ + // width:20, + // height:15, + // backgroundColor: { + // image: "http://fileimg.makalu.cc/WEB_2B7C06210CD44D55BFEE6205A35DE4A7.png", + // }, + // }, + + }, + formatter: function(data) { + //富文本固定格式{colorName|这里填你想要写的内容} + //return '{arrow|}' + // return '{arrow|}{name|' + text[data.dataIndex] + '}{prop|' + value[data.dataIndex] + '}{color| 人} {prop|'+prop[data.dataIndex]+'}{color| %} '; + return '{index|No.'+(nameData.length-data.dataIndex)+'}{name|' + nameData[data.dataIndex] + '} {prop|} {yes|'+((Number(yesMonitor[data.dataIndex] / totalData[data.dataIndex]) * 100).toFixed(1))+'}{unit| '+unitData[data.dataIndex]+'}'; + }, + } + }, + data: background + }, + { + type: 'bar', + + silent: true, + yAxisIndex: 1, + barWidth: 6, + itemStyle: { + normal: { + color: 'rgba(0,82,198,0.3)' + }, + emphasis: { + color: 'rgba(0,82,198,0.3)' + } + }, + data: background + }, + { + type: 'bar', + name:legend[0], + + stack: '1', + legendHoverLink: false, + barWidth: 6, + itemStyle: { + normal: { + color: '#52adf4' + }, + emphasis: { + color: '#52adf4' + } + }, + data: yesProp + }, { + type: 'bar', + name:legend[1], + stack: '1', + legendHoverLink: false, + barWidth: 6, + itemStyle: { + normal: { + color: '#4677ff' + }, + emphasis: { + color: '#4677ff' + } + }, + data: notProp + }] + }; + + return option; + } + } +}) diff --git a/yanzhu-ui-app/miniprogram/components/safety-bar-charts/index.json b/yanzhu-ui-app/miniprogram/components/safety-bar-charts/index.json new file mode 100644 index 00000000..b11802ea --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/safety-bar-charts/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + + } +} \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/components/safety-bar-charts/index.wxml b/yanzhu-ui-app/miniprogram/components/safety-bar-charts/index.wxml new file mode 100644 index 00000000..d56ac15d --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/safety-bar-charts/index.wxml @@ -0,0 +1,4 @@ + + + + diff --git a/yanzhu-ui-app/miniprogram/components/safety-bar-charts/index.wxss b/yanzhu-ui-app/miniprogram/components/safety-bar-charts/index.wxss new file mode 100644 index 00000000..e14d6ee3 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/safety-bar-charts/index.wxss @@ -0,0 +1,5 @@ +/* components/bar-chart/index.wxss */ +.chart_canvas{ + width: 100%; + position: relative; +} diff --git a/yanzhu-ui-app/miniprogram/components/safety-bar-chartss/index.js b/yanzhu-ui-app/miniprogram/components/safety-bar-chartss/index.js new file mode 100644 index 00000000..3215086e --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/safety-bar-chartss/index.js @@ -0,0 +1,230 @@ +// components/safety-pie-chart/index.js +import * as echarts from '../../ec-canvas/echarts' + +Component({ + /** + * 组件的属性列表 + */ + properties: { + chartId:{ + type: String + }, + data:{ + type: Array + }, + height:{ + type: Number + } + + }, + observers: { + data: function (val) { + this.initChart() + this.setData({ + chartData:val + }) + + }, + }, + /** + * 组件的初始数据 + */ + data: { + ec: { + lazyLoad: true + }, + chart:undefined, + chartData:[] + }, + lifetimes: { + created: function(){ + //在组件实例刚刚被创建时执行,注意此时不能调用 setData + }, + attached: function () { + //在组件实例进入页面节点树时执行 + + }, + ready: function () { + // 在组件在视图层布局完成后执行 + this.initChart(); + }, + detached: function () { + // 在组件实例被从页面节点树移除时执行 + }, + + }, + /** + * 组件的方法列表 + */ + methods: { + initChart(){ + var id ='#' + this.data.chartId; + this.component = this.selectComponent(id); + if(this.component){ + this.component.init((canvas, width, height, dpr) => { + let chart = echarts.init(canvas, null, { + width: width, + height: height, + devicePixelRatio: dpr + }) + chart.setOption(this.getData()); + return chart; + }) + } + + }, + getData() { + var data = this.data.chartData + console.log(data) + var yData_1 = [] + var yData_2 = [] + var xData = [] + var legend = ['设计量','应耗量'] + var unit = '单位:m³' + + data.forEach(item =>{ + yData_1.push(item.sjQuantity) + yData_2.push(item.yesMonitor) + xData.push(item.name) + }) + var option = { + tooltip: { + trigger: "axis", + axisPointer: { + type: "shadow", + label: { + show: true, + }, + }, + }, + grid:{ + left: "15%", + top: "25%", + right: "5%", + bottom: "12%", + }, + legend: { + data: legend, + right: 10, + top: 12, + textStyle: { + color: "#fff", + }, + itemWidth: 12, + itemHeight: 10, + // itemGap: 35 + }, + xAxis: { + data: xData, + axisLine: { + show: true, //隐藏X轴轴线 + lineStyle: { + color: "#2f4472", + width: 1, + }, + }, + axisTick: { + show: true, //隐藏X轴刻度 + alignWithLabel: true, + }, + axisLabel: { + show: true, + textStyle: { + color: "#cbdaff", //X轴文字颜色 + fontSize: 12, + }, + interval: 0, + + }, + }, + yAxis: { + name:unit, + nameTextStyle: { //Y轴那么的样式 + color: '#42d0ff', + fontSize: 12, + }, + type: "value", + axisLabel: { + textStyle: { + color: "#cbdaff", + }, + formatter: "{value}", + }, + splitLine: { + lineStyle: { + type: "dashed", + color: "#2f4472", + }, + }, + axisLine: { + show: true, + lineStyle: { + color: "#2f4472", + }, + }, + }, + series: [ + { + name: legend[0], + type: "bar", + barWidth: 8, + barGap: 2, + label: { + normal: { + show: true, + position: "top", + color:"#fff" + }, + }, + itemStyle: { + normal: { + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + { + offset: 0, + color: "rgba(64,124,254,1)", + }, + { + offset: 1, + color: "rgba(64,124,254,0.2)", + }, + ]), + }, + }, + data: yData_1, + }, + { + name: legend[1], + type: "bar", + barWidth: 8, + barGap: 2, + label: { + normal: { + show: true, + position: "inside", + color:"#fff" + }, + }, + itemStyle: { + normal: { + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + { + offset: 0, + color: "rgba(25,210,204,1)", + }, + { + offset: 1, + color: "rgba(25,210,204,0.2)", + }, + ]), + }, + }, + data: yData_2, + }, + + ], + }; + + return option; + } + } +}) diff --git a/yanzhu-ui-app/miniprogram/components/safety-bar-chartss/index.json b/yanzhu-ui-app/miniprogram/components/safety-bar-chartss/index.json new file mode 100644 index 00000000..b11802ea --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/safety-bar-chartss/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + + } +} \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/components/safety-bar-chartss/index.wxml b/yanzhu-ui-app/miniprogram/components/safety-bar-chartss/index.wxml new file mode 100644 index 00000000..d56ac15d --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/safety-bar-chartss/index.wxml @@ -0,0 +1,4 @@ + + + + diff --git a/yanzhu-ui-app/miniprogram/components/safety-bar-chartss/index.wxss b/yanzhu-ui-app/miniprogram/components/safety-bar-chartss/index.wxss new file mode 100644 index 00000000..e14d6ee3 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/safety-bar-chartss/index.wxss @@ -0,0 +1,5 @@ +/* components/bar-chart/index.wxss */ +.chart_canvas{ + width: 100%; + position: relative; +} diff --git a/yanzhu-ui-app/miniprogram/components/safety-pie-chart/index.js b/yanzhu-ui-app/miniprogram/components/safety-pie-chart/index.js new file mode 100644 index 00000000..7329cfe9 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/safety-pie-chart/index.js @@ -0,0 +1,179 @@ +// components/safety-pie-chart/index.js +import * as echarts from '../../ec-canvas/echarts' + +Component({ + /** + * 组件的属性列表 + */ + properties: { + chartId:{ + type: String + }, + chartData:{ + type: Array + }, + title:{ + type: String + } + }, + observers: { + chartData: function (val) { + console.log(val) + this.initChart() + }, + }, + /** + * 组件的初始数据 + */ + data: { + ec: { + lazyLoad: true + }, + chart:undefined, + }, + lifetimes: { + created: function(){ + //在组件实例刚刚被创建时执行,注意此时不能调用 setData + }, + attached: function () { + //在组件实例进入页面节点树时执行 + + }, + ready: function () { + // 在组件在视图层布局完成后执行 + + this.initChart(); + }, + detached: function () { + // 在组件实例被从页面节点树移除时执行 + }, + + }, + /** + * 组件的方法列表 + */ + methods: { + initChart(){ + var id ='#' + this.data.chartId; + this.component = this.selectComponent(id); + if(this.component!=null){ + this.component.init((canvas, width, height, dpr) => { + let chart = echarts.init(canvas, null, { + width: width, + height: height, + devicePixelRatio: dpr + }) + chart.setOption(this.getData()); + return chart; + }) + } + }, + getData() { + var data = this.data.chartData + var legendData = [] + var total = 0 + for(var i=0;i v.name === name); + return "{uname| " + name + "}{unum|" + res[0].value + "}{unum|" + res[0].prop + "%}" + //return `{uname|${name}}{unum|1132}`; + }, + }, + color: ['#4775ff','#55adf7','#6662da','#1f6086'], + series: [ + { + name: "", + type: "pie", + radius: ['38%', '55%'], + center: ["20%", "50%"], + label: { + show: false, + }, + labelLine: { + show: false, + }, + itemStyle: { + borderWidth: 5, + borderColor: "#1e2336", + }, + data: data + }, + { + name: "外边框", + type: "pie", + clockWise: false, //顺时加载 + hoverAnimation: false, //鼠标移入变大 + center: ["20%", "50%"], + radius: ["63%", "63%"], + label: { + normal: { + show: false, + }, + }, + data: [ + { + value: 9, + name: "", + itemStyle: { + normal: { + borderWidth: 3, + borderColor: "#152c65", + }, + }, + }, + ], + }, + ], + }; + + return option; + } + } +}) diff --git a/yanzhu-ui-app/miniprogram/components/safety-pie-chart/index.json b/yanzhu-ui-app/miniprogram/components/safety-pie-chart/index.json new file mode 100644 index 00000000..b11802ea --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/safety-pie-chart/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + + } +} \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/components/safety-pie-chart/index.wxml b/yanzhu-ui-app/miniprogram/components/safety-pie-chart/index.wxml new file mode 100644 index 00000000..ec79a903 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/safety-pie-chart/index.wxml @@ -0,0 +1,4 @@ + + + + diff --git a/yanzhu-ui-app/miniprogram/components/safety-pie-chart/index.wxss b/yanzhu-ui-app/miniprogram/components/safety-pie-chart/index.wxss new file mode 100644 index 00000000..34e3afa5 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/safety-pie-chart/index.wxss @@ -0,0 +1,6 @@ +/* components/bar-chart/index.wxss */ +.chart_canvas{ + height: 400rpx; + width: 100%; + position: relative; +} diff --git a/yanzhu-ui-app/miniprogram/components/safety-pie-charts/index.js b/yanzhu-ui-app/miniprogram/components/safety-pie-charts/index.js new file mode 100644 index 00000000..2f61ebe5 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/safety-pie-charts/index.js @@ -0,0 +1,191 @@ +// components/safety-pie-chart/index.js +import * as echarts from '../../ec-canvas/echarts' + +Component({ + /** + * 组件的属性列表 + */ + properties: { + chartId:{ + type: String + }, + chartData:{ + type: Array + }, + title:{ + type: String + } + }, + observers: { + chartData: function (val) { + this.initChart() + }, + }, + /** + * 组件的初始数据 + */ + data: { + ec: { + lazyLoad: true + }, + chart:undefined, + }, + lifetimes: { + created: function(){ + //在组件实例刚刚被创建时执行,注意此时不能调用 setData + }, + attached: function () { + //在组件实例进入页面节点树时执行 + + }, + ready: function () { + // 在组件在视图层布局完成后执行 + + this.initChart(); + }, + detached: function () { + // 在组件实例被从页面节点树移除时执行 + }, + + }, + /** + * 组件的方法列表 + */ + methods: { + initChart(){ + var id ='#' + this.data.chartId; + this.component = this.selectComponent(id); + if(this.component){ + this.component.init((canvas, width, height, dpr) => { + let chart = echarts.init(canvas, null, { + width: width, + height: height, + devicePixelRatio: dpr + }) + chart.setOption(this.getData()); + return chart; + }) + } + + }, + getData() { + var data = this.data.chartData + var legendData = [] + var total = 0 + for(var i=0;i v.name === name); + return "{uname| " + name + "}\n{unum|" + Number(res[0].value).toFixed(1) + "}{unum|" + res[0].prop + "%}" + //return `{uname|${name}}{unum|1132}`; + }, + }, + color: ['#4775ff','#55adf7','#6662da','#1f6086'], + series: [ + { + name: "", + type: "pie", + radius: ['38%', '55%'], + center: ["22%", "50%"], + label: { + show: false, + }, + labelLine: { + show: false, + }, + itemStyle: { + borderWidth: 5, + borderColor: "#1e2336", + }, + data: data + }, + { + name: "外边框", + type: "pie", + clockWise: false, //顺时加载 + hoverAnimation: false, //鼠标移入变大 + center: ["22%", "50%"], + radius: ["63%", "63%"], + label: { + normal: { + show: false, + }, + }, + data: [ + { + value: 9, + name: "", + itemStyle: { + normal: { + borderWidth: 3, + borderColor: "#152c65", + }, + }, + }, + ], + }, + ], + }; + + return option; + } + } +}) diff --git a/yanzhu-ui-app/miniprogram/components/safety-pie-charts/index.json b/yanzhu-ui-app/miniprogram/components/safety-pie-charts/index.json new file mode 100644 index 00000000..b11802ea --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/safety-pie-charts/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + + } +} \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/components/safety-pie-charts/index.wxml b/yanzhu-ui-app/miniprogram/components/safety-pie-charts/index.wxml new file mode 100644 index 00000000..ec79a903 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/safety-pie-charts/index.wxml @@ -0,0 +1,4 @@ + + + + diff --git a/yanzhu-ui-app/miniprogram/components/safety-pie-charts/index.wxss b/yanzhu-ui-app/miniprogram/components/safety-pie-charts/index.wxss new file mode 100644 index 00000000..34e3afa5 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/safety-pie-charts/index.wxss @@ -0,0 +1,6 @@ +/* components/bar-chart/index.wxss */ +.chart_canvas{ + height: 400rpx; + width: 100%; + position: relative; +} diff --git a/yanzhu-ui-app/miniprogram/components/select-group-person/index.js b/yanzhu-ui-app/miniprogram/components/select-group-person/index.js new file mode 100644 index 00000000..cdf70fd9 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/select-group-person/index.js @@ -0,0 +1,122 @@ +// newComponents/select-group-person/index.js +Component({ + /** + * 组件的属性列表 + */ + properties: { + title:{ + type:String + }, + index:{ + type:String + }, + choose:{ + type:String + }, + multiple:{ + type:Boolean, + value:true + }, + rectifierData:{ + type:Array, + value:[] + } + }, + observers: { + + }, + lifetimes: { + created: function(){ + //在组件实例刚刚被创建时执行,注意此时不能调用 setData + }, + attached: function () { + //在组件实例进入页面节点树时执行 + }, + ready: function () { + // 在组件在视图层布局完成后执行 + }, + detached: function () { + // 在组件实例被从页面节点树移除时执行 + }, + }, + + /** + * 组件的初始数据 + */ + data: { + show:false, + gridData:[], + selectedIndex:[] + }, + + /** + * 组件的方法列表 + */ + methods: { + onAddResponsible(){ + this.setData({ + show:true + }) + }, + onClose(){ + this.setData({ + show:false + }) + }, + onSelected(e){ + var data = this.data.rectifierData; + let ei = e.currentTarget.dataset.index; + let index = ei.split('_'); + let userdata = data[index[0]].userinfoList[index[1]]; + let of = this.data.selectedIndex.indexOf(ei); + if(of>-1){ + this.data.selectedIndex.splice(of, 1); + userdata.state = false; + }else{ + this.data.selectedIndex.push(ei); + userdata.state = true; + } + if(!this.data.multiple && this.data.selectedIndex.length>0){ + if(this.data.selectedIndex.length>1){ + this.data.selectedIndex.forEach((item) =>{ + let _indexs = item.split('_'); + data[_indexs[0]].userinfoList[_indexs[1]].state = false; + }); + userdata.state = true; + this.data.selectedIndex=[]; + this.data.selectedIndex.push(ei); + } + let _gridData=[{userName:userdata.nickName+" ["+userdata.jobTypeName+"]",phoneNumber:userdata.phonenumber}]; + this.triggerEvent('selected',_gridData) + this.setData({ + choose:_gridData[0].userName, + rectifierData:data, + show:false + }) + }else{ + this.setData({ + rectifierData : data + }) + } + }, + onConfirm(){ + var data = this.data.rectifierData; + let _gridData=[]; + let chooses=""; + if(this.data.selectedIndex.length>0){ + this.data.selectedIndex.forEach((item) =>{ + let _indexs = item.split('_'); + let name = data[_indexs[0]].userinfoList[_indexs[1]].nickName+" ["+data[_indexs[0]].userinfoList[_indexs[1]].jobTypeName+"]"; + _gridData.push({userName:name,phoneNumber:data[_indexs[0]].userinfoList[_indexs[1]].phonenumber}); + chooses+=","+name; + }); + } + this.triggerEvent('selected',_gridData) + this.setData({ + choose:chooses.substring(1), + show:false + }) + } + + } +}) diff --git a/yanzhu-ui-app/miniprogram/components/select-group-person/index.json b/yanzhu-ui-app/miniprogram/components/select-group-person/index.json new file mode 100644 index 00000000..7e37c035 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/select-group-person/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/components/select-group-person/index.wxml b/yanzhu-ui-app/miniprogram/components/select-group-person/index.wxml new file mode 100644 index 00000000..ae6e349a --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/select-group-person/index.wxml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + {{title}} + + + + + + [{{item.unitTypeName}}] {{item.unitName}} + + + + + + + {{items.phonenumber}} + {{items.nickName}} [{{items.jobTypeName}}] + + + + + + 取消 + 确认 + + + \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/components/select-group-person/index.wxss b/yanzhu-ui-app/miniprogram/components/select-group-person/index.wxss new file mode 100644 index 00000000..3c4d8af0 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/select-group-person/index.wxss @@ -0,0 +1,129 @@ +/* newComponents/select-person/index.wxss */ +page{ + height:100% +} +.rectifier_add_to{ + width: 100rpx; + height: 100rpx; + margin: auto; + background: #252d41; + text-align: center; + line-height: 110rpx; + font-size: 50rpx; + color: #57668f; + font-weight: bold; + border-radius: 5rpx; +} +.rectifier_max{ + width: 100%; + background: #232a44; + border-radius: 15rpx; + position: relative; + height: 100%; +} +.rectifier_title{ + position: relative; + background: #27304f; + border-radius: 15rpx; + text-align: center; + padding:20rpx 15rpx; +} +.rectifier_close{ + position: absolute; + width: 50rpx; + height: 50rpx; + right: 20rpx; + top: 12rpx; + line-height: 60rpx; + text-align: center; +} +.rectifier_list{ + padding:20rpx 40rpx; +} +.rectifier_list_height{ + height: 990rpx; + overflow: auto; +} +.rectifier_list_for{ + display: flex; + align-items: center; + padding: 18rpx 15rpx; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.rectifier_list_radio{ + width: 70rpx; +} +.rectifier_list_radio_circle{ + width: 30rpx; + height: 30rpx; + border-radius: 50%; + border: 1px solid #6576a2; +} +.rectifier_list_radio_circle.active{ + background: #8262f3; + border: 1px solid #8262f3; +} +.rectifier_list_name{ + padding-left: 10rpx; + color: #6576a2; +} +.rectifier_list_name.active{ + color: #ffffff; +} +.rectifier_btn{ + display: flex; + align-items: center; + background: #27304f; + border-radius: 0 0 15rpx 15rpx; +} +.rectifier_btn view{ + width: 50%; + text-align: center; + height: 80rpx; + line-height: 80rpx; + color:#6874a4; +} +.rectifier_btn view:last-child{ + border-left: 1px solid #6874a4; + color: #ffffff; +} +.rectifier_list-group_for{ + height: 65rpx; + background-color: #879ff97d; + line-height: 65rpx; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.inspect_input_fill_in { + height: 90rpx; + background: #212737; + border-radius: 10rpx; + padding: 0 30rpx; +} + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/yanzhu-ui-app/miniprogram/components/select-person/index.js b/yanzhu-ui-app/miniprogram/components/select-person/index.js new file mode 100644 index 00000000..03040ab2 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/select-person/index.js @@ -0,0 +1,116 @@ +// newComponents/select-person/index.js +Component({ + /** + * 组件的属性列表 + */ + properties: { + title:{ + type:String + }, + choose:{ + type:Array + }, + multiple:{ + type:Boolean, + value:true + }, + rectifierData:{ + type:Array, + value:[ + {state:false,name:'党鹏',url:'http://fileimg.makalu.cc/WEB_44D7C71ACA8E4D40B323AC929315045B.jpg'}, + {state:false,name:'董超',url:'http://fileimg.makalu.cc/WEB_B3F05B5BC25C452F90EAA2347833D228.jpg'}, + {state:false,name:'黄海军',url:'http://fileimg.makalu.cc/WEB_08FE97020FBD49C3A775B97B5FAA05DF.jpg'}, + {state:false,name:'黄嘉伟',url:'http://fileimg.makalu.cc/WEB_65398BB3CB5A4098B5D222AFB6C286EF.jpg'}, + {state:false,name:'李鑫',url:'http://fileimg.makalu.cc/WEB_F62AAB25BA4946BB8CC406BA2AAF4CA7.jpg'}, + {state:false,name:'聂少刚',url:'http://fileimg.makalu.cc/WEB_9D3E6D980B2A4B57AC4A32C16CB384A0.jpg'}, + {state:false,name:'王晨',url:'http://fileimg.makalu.cc/WEB_E8BD336312324B69924D7264AC726D65.jpg'}, + {state:false,name:'王程',url:'http://fileimg.makalu.cc/WEB_F5E8BF2385E747AA8D9FD328A413E021.jpg'}, + {state:false,name:'王国雄',url:'http://fileimg.makalu.cc/WEB_37C63EB77EC240598C72979582273990.jpg'}, + {state:false,name:'杨启明',url:'http://fileimg.makalu.cc/WEB_A09316E46D1C4A1AB558258918740247.jpg'}, + {state:false,name:'赵平印',url:'http://fileimg.makalu.cc/WEB_CA897DDFF6294940ADB187099F77F6FE.jpg'}, + {state:false,name:'张明亮',url:'http://fileimg.makalu.cc/WEB_B2C7971895B74BA6B33A6D17F132E86E.jpg'}, + {state:false,name:'张露露',url:'http://fileimg.makalu.cc/WEB_0185D8D49A00474D8058A9651E96506A.jpg'} + ] + } + }, + observers: { + choose: function (val) { + this.setData({ + gridData : val + }) + }, + }, + lifetimes: { + created: function(){ + //在组件实例刚刚被创建时执行,注意此时不能调用 setData + }, + attached: function () { + //在组件实例进入页面节点树时执行 + + }, + ready: function () { + // 在组件在视图层布局完成后执行 + + }, + detached: function () { + // 在组件实例被从页面节点树移除时执行 + }, + + }, + + /** + * 组件的初始数据 + */ + data: { + show:false, + gridData:[] + }, + + /** + * 组件的方法列表 + */ + methods: { + onAddResponsible(){ + this.setData({ + show:true + }) + }, + onClose(){ + this.setData({ + show:false + }) + }, + onSelected(e){ + if(!this.data.multiple){ + let tempData = JSON.parse(JSON.stringify(this.data.rectifierData)) + tempData.forEach(item=>item.state = false) + this.setData({ + rectifierData:tempData + }) + } + + var index = e.currentTarget.dataset.index + var data = this.data.rectifierData + + + if(data[index].state == false){ + data[index].state = true + }else{ + data[index].state = false + } + this.setData({ + rectifierData : data + }) + }, + onConfirm(){ + var data = this.data.rectifierData + let gridData = data.filter(x => x.state == true); + this.triggerEvent('selected',gridData) + this.setData({ + gridData:gridData, + show:false + }) + } + + } +}) diff --git a/yanzhu-ui-app/miniprogram/components/select-person/index.json b/yanzhu-ui-app/miniprogram/components/select-person/index.json new file mode 100644 index 00000000..7e37c035 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/select-person/index.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/components/select-person/index.wxml b/yanzhu-ui-app/miniprogram/components/select-person/index.wxml new file mode 100644 index 00000000..6b07e67b --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/select-person/index.wxml @@ -0,0 +1,41 @@ + + + + + + {{item.name}} + + + + + + + + + + + + {{title}} + + + + + + + + + + + + + + {{item.name}} + + + + + 取消 + 确认 + + + \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/components/select-person/index.wxss b/yanzhu-ui-app/miniprogram/components/select-person/index.wxss new file mode 100644 index 00000000..d9dd9656 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/components/select-person/index.wxss @@ -0,0 +1,108 @@ +/* newComponents/select-person/index.wxss */ +.rectifier_add_to{ + width: 100rpx; + height: 100rpx; + margin: auto; + background: #252d41; + text-align: center; + line-height: 110rpx; + font-size: 50rpx; + color: #57668f; + font-weight: bold; + border-radius: 5rpx; +} +.rectifier_max{ + width: 600rpx; + background: #232a44; + border-radius: 15rpx; +} +.rectifier_title{ + position: relative; + background: #27304f; + border-radius: 15rpx; + text-align: center; + padding:20rpx 15rpx; +} +.rectifier_close{ + position: absolute; + width: 50rpx; + height: 50rpx; + right: 20rpx; + top: 12rpx; + line-height: 60rpx; + text-align: center; +} +.rectifier_list{ + padding:20rpx 40rpx; +} +.rectifier_list_height{ + height: 580rpx; + overflow: auto; +} +.rectifier_list_for{ + display: flex; + align-items: center; + padding: 5rpx 0; +} +.rectifier_list_radio{ + width: 70rpx; +} +.rectifier_list_radio_circle{ + width: 30rpx; + height: 30rpx; + border-radius: 50%; + border: 1px solid #6576a2; +} +.rectifier_list_radio_circle.active{ + background: #8262f3; + border: 1px solid #8262f3; +} +.rectifier_list_name{ + padding-left: 30rpx; + color: #6576a2; +} +.rectifier_list_name.active{ + color: #ffffff; +} +.rectifier_btn{ + display: flex; + align-items: center; + background: #27304f; + border-radius: 0 0 15rpx 15rpx; +} +.rectifier_btn view{ + width: 50%; + text-align: center; + height: 80rpx; + line-height: 80rpx; + color:#6874a4; +} +.rectifier_btn view:last-child{ + border-left: 1px solid #6874a4; + color: #ffffff; +} + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/yanzhu-ui-app/miniprogram/config.js b/yanzhu-ui-app/miniprogram/config.js new file mode 100644 index 00000000..2a0ae6b4 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/config.js @@ -0,0 +1,8 @@ +// 应用全局配置 +module.exports = { + timeout: 60000, + appId: "wx2350a5efb3f28e66", + baseUrl: 'https://guangzhou.sxyanzhu.com/YZLJXM', + //baseUrl: 'http://127.0.0.1:8080/yanZhuProject', + noSecuritys:['/captchaImage','/wxApi/login'] +}; \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/ec-canvas/ec-canvas.js b/yanzhu-ui-app/miniprogram/ec-canvas/ec-canvas.js new file mode 100644 index 00000000..37ff834f --- /dev/null +++ b/yanzhu-ui-app/miniprogram/ec-canvas/ec-canvas.js @@ -0,0 +1,250 @@ +import WxCanvas from './wx-canvas'; +import * as echarts from './echarts'; + +let ctx; + +function compareVersion(v1, v2) { + v1 = v1.split('.') + v2 = v2.split('.') + const len = Math.max(v1.length, v2.length) + + while (v1.length < len) { + v1.push('0') + } + while (v2.length < len) { + v2.push('0') + } + + for (let i = 0; i < len; i++) { + const num1 = parseInt(v1[i]) + const num2 = parseInt(v2[i]) + + if (num1 > num2) { + return 1 + } else if (num1 < num2) { + return -1 + } + } + return 0 +} + +Component({ + properties: { + canvasId: { + type: String, + value: 'ec-canvas' + }, + + ec: { + type: Object + }, + + forceUseOldCanvas: { + type: Boolean, + value: false + } + }, + + data: { + isUseNewCanvas: false + }, + + ready: function () { + // Disable prograssive because drawImage doesn't support DOM as parameter + // See https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.drawImage.html + echarts.registerPreprocessor(option => { + if (option && option.series) { + if (option.series.length > 0) { + option.series.forEach(series => { + series.progressive = 0; + }); + } + else if (typeof option.series === 'object') { + option.series.progressive = 0; + } + } + }); + + if (!this.data.ec) { + console.warn('组件需绑定 ec 变量,例:'); + return; + } + + if (!this.data.ec.lazyLoad) { + this.init(); + } + }, + + methods: { + init: function (callback) { + const version = wx.getSystemInfoSync().SDKVersion + + const canUseNewCanvas = compareVersion(version, '2.9.0') >= 0; + const forceUseOldCanvas = this.data.forceUseOldCanvas; + const isUseNewCanvas = canUseNewCanvas && !forceUseOldCanvas; + this.setData({ isUseNewCanvas }); + + if (forceUseOldCanvas && canUseNewCanvas) { + console.warn('开发者强制使用旧canvas,建议关闭'); + } + + if (isUseNewCanvas) { + // console.log('微信基础库版本大于2.9.0,开始使用'); + // 2.9.0 可以使用 + this.initByNewWay(callback); + } else { + const isValid = compareVersion(version, '1.9.91') >= 0 + if (!isValid) { + console.error('微信基础库版本过低,需大于等于 1.9.91。' + + '参见:https://github.com/ecomfe/echarts-for-weixin' + + '#%E5%BE%AE%E4%BF%A1%E7%89%88%E6%9C%AC%E8%A6%81%E6%B1%82'); + return; + } else { + console.warn('建议将微信基础库调整大于等于2.9.0版本。升级后绘图将有更好性能'); + this.initByOldWay(callback); + } + } + }, + + initByOldWay(callback) { + // 1.9.91 <= version < 2.9.0:原来的方式初始化 + ctx = wx.createCanvasContext(this.data.canvasId, this); + const canvas = new WxCanvas(ctx, this.data.canvasId, false); + + echarts.setCanvasCreator(() => { + return canvas; + }); + // const canvasDpr = wx.getSystemInfoSync().pixelRatio // 微信旧的canvas不能传入dpr + const canvasDpr = 1 + var query = wx.createSelectorQuery().in(this); + query.select('.ec-canvas').boundingClientRect(res => { + if (typeof callback === 'function') { + this.chart = callback(canvas, res.width, res.height, canvasDpr); + } + else if (this.data.ec && typeof this.data.ec.onInit === 'function') { + this.chart = this.data.ec.onInit(canvas, res.width, res.height, canvasDpr); + } + else { + this.triggerEvent('init', { + canvas: canvas, + width: res.width, + height: res.height, + canvasDpr: canvasDpr // 增加了dpr,可方便外面echarts.init + }); + } + }).exec(); + }, + + initByNewWay(callback) { + // version >= 2.9.0:使用新的方式初始化 + const query = wx.createSelectorQuery().in(this) + query + .select('.ec-canvas') + .fields({ node: true, size: true }) + .exec(res => { + const canvasNode = res[0].node + this.canvasNode = canvasNode + + const canvasDpr = wx.getSystemInfoSync().pixelRatio + const canvasWidth = res[0].width + const canvasHeight = res[0].height + + const ctx = canvasNode.getContext('2d') + + const canvas = new WxCanvas(ctx, this.data.canvasId, true, canvasNode) + echarts.setCanvasCreator(() => { + return canvas + }) + + if (typeof callback === 'function') { + this.chart = callback(canvas, canvasWidth, canvasHeight, canvasDpr) + } else if (this.data.ec && typeof this.data.ec.onInit === 'function') { + this.chart = this.data.ec.onInit(canvas, canvasWidth, canvasHeight, canvasDpr) + } else { + this.triggerEvent('init', { + canvas: canvas, + width: canvasWidth, + height: canvasHeight, + dpr: canvasDpr + }) + } + }) + }, + canvasToTempFilePath(opt) { + if (this.data.isUseNewCanvas) { + // 新版 + const query = wx.createSelectorQuery().in(this) + query + .select('.ec-canvas') + .fields({ node: true, size: true }) + .exec(res => { + const canvasNode = res[0].node + opt.canvas = canvasNode + wx.canvasToTempFilePath(opt) + }) + } else { + // 旧的 + if (!opt.canvasId) { + opt.canvasId = this.data.canvasId; + } + ctx.draw(true, () => { + wx.canvasToTempFilePath(opt, this); + }); + } + }, + + touchStart(e) { + if (this.chart && e.touches.length > 0) { + var touch = e.touches[0]; + var handler = this.chart.getZr().handler; + handler.dispatch('mousedown', { + zrX: touch.x, + zrY: touch.y + }); + handler.dispatch('mousemove', { + zrX: touch.x, + zrY: touch.y + }); + handler.processGesture(wrapTouch(e), 'start'); + } + }, + + touchMove(e) { + if (this.chart && e.touches.length > 0) { + var touch = e.touches[0]; + var handler = this.chart.getZr().handler; + handler.dispatch('mousemove', { + zrX: touch.x, + zrY: touch.y + }); + handler.processGesture(wrapTouch(e), 'change'); + } + }, + + touchEnd(e) { + if (this.chart) { + const touch = e.changedTouches ? e.changedTouches[0] : {}; + var handler = this.chart.getZr().handler; + handler.dispatch('mouseup', { + zrX: touch.x, + zrY: touch.y + }); + handler.dispatch('click', { + zrX: touch.x, + zrY: touch.y + }); + handler.processGesture(wrapTouch(e), 'end'); + } + } + } +}); + +function wrapTouch(event) { + for (let i = 0; i < event.touches.length; ++i) { + const touch = event.touches[i]; + touch.offsetX = touch.x; + touch.offsetY = touch.y; + } + return event; +} diff --git a/yanzhu-ui-app/miniprogram/ec-canvas/ec-canvas.json b/yanzhu-ui-app/miniprogram/ec-canvas/ec-canvas.json new file mode 100644 index 00000000..e8cfaaf8 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/ec-canvas/ec-canvas.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/ec-canvas/ec-canvas.wxml b/yanzhu-ui-app/miniprogram/ec-canvas/ec-canvas.wxml new file mode 100644 index 00000000..88826d90 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/ec-canvas/ec-canvas.wxml @@ -0,0 +1,4 @@ + + + + diff --git a/yanzhu-ui-app/miniprogram/ec-canvas/ec-canvas.wxss b/yanzhu-ui-app/miniprogram/ec-canvas/ec-canvas.wxss new file mode 100644 index 00000000..0d64b10c --- /dev/null +++ b/yanzhu-ui-app/miniprogram/ec-canvas/ec-canvas.wxss @@ -0,0 +1,4 @@ +.ec-canvas { + width: 100%; + height: 100%; +} diff --git a/yanzhu-ui-app/miniprogram/ec-canvas/echarts.js b/yanzhu-ui-app/miniprogram/ec-canvas/echarts.js new file mode 100644 index 00000000..68264a54 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/ec-canvas/echarts.js @@ -0,0 +1,22 @@ + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + + +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.echarts={})}(this,function(t){"use strict";var e=2311,n=function(){return e++},v="object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?{browser:{},os:{},node:!1,wxa:!0,canvasSupported:!0,svgSupported:!1,touchEventsSupported:!0,domSupported:!1}:"undefined"==typeof document&&"undefined"!=typeof self?{browser:{},os:{},node:!1,worker:!0,canvasSupported:!0,domSupported:!1}:"undefined"==typeof navigator?{browser:{},os:{},node:!0,worker:!1,canvasSupported:!0,svgSupported:!0,domSupported:!1}:function(t){var e={},i=t.match(/Firefox\/([\d.]+)/),n=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),o=t.match(/Edge\/([\d.]+)/),a=/micromessenger/i.test(t);i&&(e.firefox=!0,e.version=i[1]);n&&(e.ie=!0,e.version=n[1]);o&&(e.edge=!0,e.version=o[1]);a&&(e.weChat=!0);return{browser:e,os:{},node:!1,canvasSupported:!!document.createElement("canvas").getContext,svgSupported:"undefined"!=typeof SVGRect,touchEventsSupported:"ontouchstart"in window&&!e.ie&&!e.edge,pointerEventsSupported:"onpointerdown"in window&&(e.edge||e.ie&&11<=e.version),domSupported:"undefined"!=typeof document}}(navigator.userAgent);var s={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},l={"[object Int8Array]":1,"[object Uint8Array]":1,"[object Uint8ClampedArray]":1,"[object Int16Array]":1,"[object Uint16Array]":1,"[object Int32Array]":1,"[object Uint32Array]":1,"[object Float32Array]":1,"[object Float64Array]":1},u=Object.prototype.toString,i=Array.prototype,r=i.forEach,h=i.filter,o=i.slice,c=i.map,d=i.reduce,a={};function f(t,e){"createCanvas"===t&&(y=null),a[t]=e}function D(t){if(null==t||"object"!=typeof t)return t;var e=t,i=u.call(t);if("[object Array]"===i){if(!$(t)){e=[];for(var n=0,o=t.length;n>1)%2;s.cssText=["position:absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","width:0","height:0",n[l]+":0",o[u]+":0",n[1-l]+":auto",o[1-u]+":auto",""].join("!important;"),t.appendChild(r),i.push(r)}return i}(t,r),r);if(s)return s(zt,n,o),i.zrX=zt[0],void(i.zrY=zt[1])}i.zrX=i.zrY=0}function Vt(t){return t||window.event}function Gt(t,e,i){if(null!=(e=Vt(e)).zrX)return e;var n=e.type;if(n&&0<=n.indexOf("touch")){var o="touchend"!==n?e.targetTouches[0]:e.changedTouches[0];o&&Rt(t,o,e,i)}else Rt(t,e,e,i),e.zrDelta=e.wheelDelta?e.wheelDelta/120:-(e.detail||0)/3;var a=e.button;return null==e.which&&void 0!==a&&Ot.test(e.type)&&(e.which=1&a?1:2&a?3:4&a?2:0),e}function Ft(t,e,i,n){Nt?t.addEventListener(e,i,n):t.attachEvent("on"+e,i)}var Wt=Nt?function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0}:function(t){t.returnValue=!1,t.cancelBubble=!0};function Ht(t){return 2===t.which||3===t.which}function Zt(){this._track=[]}function Ut(t){var e=t[1][0]-t[0][0],i=t[1][1]-t[0][1];return Math.sqrt(e*e+i*i)}Zt.prototype={constructor:Zt,recognize:function(t,e,i){return this._doTrack(t,e,i),this._recognize(t)},clear:function(){return this._track.length=0,this},_doTrack:function(t,e,i){var n=t.touches;if(n){for(var o={points:[],touches:[],target:e,event:t},a=0,r=n.length;an.getWidth()||i<0||i>n.getHeight()}Kt.prototype={constructor:Kt,setHandlerProxy:function(e){this.proxy&&this.proxy.dispose(),e&&(E($t,function(t){e.on&&e.on(t,this[t],this)},this),e.handler=this),this.proxy=e},mousemove:function(t){var e=t.zrX,i=t.zrY,n=Qt(this,e,i),o=this._hovered,a=o.target;a&&!a.__zr&&(a=(o=this.findHover(o.x,o.y)).target);var r=this._hovered=n?{x:e,y:i}:this.findHover(e,i),s=r.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),a&&s!==a&&this.dispatchToElement(o,"mouseout",t),this.dispatchToElement(r,"mousemove",t),s&&s!==a&&this.dispatchToElement(r,"mouseover",t)},mouseout:function(t){var e=t.zrEventControl,i=t.zrIsToLocalDOM;"only_globalout"!==e&&this.dispatchToElement(this._hovered,"mouseout",t),"no_globalout"!==e&&(i||this.trigger("globalout",{type:"globalout",event:t}))},resize:function(t){this._hovered={}},dispatch:function(t,e){var i=this[t];i&&i.call(this,e)},dispose:function(){this.proxy.dispose(),this.storage=this.proxy=this.painter=null},setCursorStyle:function(t){var e=this.proxy;e.setCursor&&e.setCursor(t)},dispatchToElement:function(t,e,i){var n=(t=t||{}).target;if(!n||!n.silent){for(var o="on"+e,a=function(t,e,i){return{type:t,event:i,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:i.zrX,offsetY:i.zrY,gestureEvent:i.gestureEvent,pinchX:i.pinchX,pinchY:i.pinchY,pinchScale:i.pinchScale,wheelDelta:i.zrDelta,zrByTouch:i.zrByTouch,which:i.which,stop:jt}}(e,t,i);n&&(n[o]&&(a.cancelBubble=n[o].call(n,a)),n.trigger(e,a),n=n.parent,!a.cancelBubble););a.cancelBubble||(this.trigger(e,a),this.painter&&this.painter.eachOtherLayer(function(t){"function"==typeof t[o]&&t[o].call(t,a),t.trigger&&t.trigger(e,a)}))}},findHover:function(t,e,i){for(var n=this.storage.getDisplayList(),o={x:t,y:e},a=n.length-1;0<=a;a--){var r;if(n[a]!==i&&!n[a].ignore&&(r=Jt(n[a],t,e))&&(o.topTarget||(o.topTarget=n[a]),r!==Yt)){o.target=n[a];break}}return o},processGesture:function(t,e){this._gestureMgr||(this._gestureMgr=new Zt);var i=this._gestureMgr;"start"===e&&i.clear();var n=i.recognize(t,this.findHover(t.zrX,t.zrY,null).target,this.proxy.dom);if("end"===e&&i.clear(),n){var o=n.type;t.gestureEvent=o,this.dispatchToElement({target:n.target},o,n.event)}}},E(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(r){Kt.prototype[r]=function(t){var e,i,n=t.zrX,o=t.zrY,a=Qt(this,n,o);if("mouseup"===r&&a||(i=(e=this.findHover(n,o)).target),"mousedown"===r)this._downEl=i,this._downPoint=[t.zrX,t.zrY],this._upEl=i;else if("mouseup"===r)this._upEl=i;else if("click"===r){if(this._downEl!==this._upEl||!this._downPoint||4=this._maxSize&&0>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,1),ze(t,e),e):void Pe(e,0,0,0,1):7===o.length?0<=(n=parseInt(o.substr(1),16))&&n<=16777215?(Pe(e,(16711680&n)>>16,(65280&n)>>8,255&n,1),ze(t,e),e):void Pe(e,0,0,0,1):void 0;var a=o.indexOf("("),r=o.indexOf(")");if(-1!==a&&r+1===o.length){var s=o.substr(0,a),l=o.substr(a+1,r-(a+1)).split(","),u=1;switch(s){case"rgba":if(4!==l.length)return void Pe(e,0,0,0,1);u=Ce(l.pop());case"rgb":return 3!==l.length?void Pe(e,0,0,0,1):(Pe(e,De(l[0]),De(l[1]),De(l[2]),u),ze(t,e),e);case"hsla":return 4!==l.length?void Pe(e,0,0,0,1):(l[3]=Ce(l[3]),Be(l,e),ze(t,e),e);case"hsl":return 3!==l.length?void Pe(e,0,0,0,1):(Be(l,e),ze(t,e),e);default:return}}Pe(e,0,0,0,1)}}function Be(t,e){var i=(parseFloat(t[0])%360+360)%360/360,n=Ce(t[1]),o=Ce(t[2]),a=o<=.5?o*(n+1):o+n-o*n,r=2*o-a;return Pe(e=e||[],Te(255*Le(r,a,i+1/3)),Te(255*Le(r,a,i)),Te(255*Le(r,a,i-1/3)),1),4===t.length&&(e[3]=t[3]),e}function Ve(t,e){var i=Re(t);if(i){for(var n=0;n<3;n++)i[n]=e<0?i[n]*(1-e)|0:(255-i[n])*e+i[n]|0,255e);i++);i=Math.min(i-1,u-2)}C=e;var n=g[(D=i)+1]-g[i];if(0!=n)if(S=(e-g[i])/n,l)if(I=m[i],M=m[0===i?i:i-1],T=m[u-2=i.x&&t<=i.x+i.width&&e>=i.y&&e<=i.y+i.height},clone:function(){return new Mi(this.x,this.y,this.width,this.height)},copy:function(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height},plain:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},Mi.create=function(t){return new Mi(t.x,t.y,t.width,t.height)};var Ii=function(t){for(var e in t=t||{},mi.call(this,t),t)t.hasOwnProperty(e)&&(this[e]=t[e]);this._children=[],this.__storage=null,this.__dirty=!0};Ii.prototype={constructor:Ii,isGroup:!0,type:"group",silent:!1,children:function(){return this._children.slice()},childAt:function(t){return this._children[t]},childOfName:function(t){for(var e=this._children,i=0;i>>1])<0?l=a:s=1+a;var u=n-s;switch(u){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;0>>1);0>>1);a(t,e[i+h])<0?l=h:r=h+1}return l}function Pi(p,g){var r,s,m=Ai,l=0,v=[];function e(t){var e=r[t],i=s[t],n=r[t+1],o=s[t+1];s[t]=i+o,t===l-3&&(r[t+1]=r[t+2],s[t+1]=s[t+2]),l--;var a=ki(p[n],p,e,i,0,g);e+=a,0!==(i-=a)&&0!==(o=Li(p[e+i-1],p,n,o,o-1,g))&&(i<=o?function(t,e,i,n){var o=0;for(o=0;os[t+1])break;e(t)}},this.forceMergeRuns=function(){for(;1>=1;return t+e}(o);do{if((a=Di(t,i,n,e))=e.maxIterations){t+=e.ellipsis;break}var s=0===r?yn(t,o,e.ascCharWidth,e.cnCharWidth):0f)return{lines:[],width:0,height:0};C.textWidth=hn(C.text,w);var S=x.textWidth,M=null==S||"auto"===S;if("string"==typeof S&&"%"===S.charAt(S.length-1))C.percentWidth=S,u.push(C),S=0;else{if(M){S=C.textWidth;var I=x.textBackgroundColor,T=I&&I.image;T&&nn(T=Qi(T))&&(S=Math.max(S,T.width*b/T.height))}var A=_?_[1]+_[3]:0;S+=A;var D=null!=d?d-v:null;null!=D&&Dn[0]){for(r=0;rt);r++);a=i[n[r]]}if(n.splice(r+1,0,t),!(i[t]=e).virtual)if(a){var l=a.dom;l.nextSibling?s.insertBefore(e.dom,l.nextSibling):s.appendChild(e.dom)}else s.firstChild?s.insertBefore(e.dom,s.firstChild):s.appendChild(e.dom)}else fi("Layer of zlevel "+t+" is not valid")},eachLayer:function(t,e){var i,n,o=this._zlevelList;for(n=0;n=a.length&&a.push({option:t})}}),a}function Go(t){var r=Q();ko(t,function(t,e){var i=t.exist;i&&r.set(i.id,t)}),ko(t,function(t,e){var i=t.option;Y(!i||null==i.id||!r.get(i.id)||r.get(i.id)===t,"id duplicates: "+(i&&i.id)),i&&null!=i.id&&r.set(i.id,t),t.keyInfo||(t.keyInfo={})}),ko(t,function(t,e){var i=t.exist,n=t.option,o=t.keyInfo;if(Po(n)){if(o.name=null!=n.name?n.name+"":i?i.name:Oo+e,i)o.id=i.id;else if(null!=n.id)o.id=n.id+"";else for(var a=0;o.id="\0"+o.name+"\0"+a++,r.get(o.id););r.set(o.id,t)}})}function Fo(t){var e=t.name;return!(!e||!e.indexOf(Oo))}function Wo(t){return Po(t)&&t.id&&0===(t.id+"").indexOf("\0_ec_\0")}function Ho(e,t){return null!=t.dataIndexInside?t.dataIndexInside:null!=t.dataIndex?k(t.dataIndex)?N(t.dataIndex,function(t){return e.indexOfRawIndex(t)}):e.indexOfRawIndex(t.dataIndex):null!=t.name?k(t.name)?N(t.name,function(t){return e.indexOfName(t)}):e.indexOfName(t.name):void 0}function Zo(){var e="__\0ec_inner_"+Uo+++"_"+Math.random().toFixed(5);return function(t){return t[e]||(t[e]={})}}var Uo=0;function Xo(s,l,u){if(z(l)){var t={};t[l+"Index"]=0,l=t}var e=u&&u.defaultMainType;!e||Yo(l,e+"Index")||Yo(l,e+"Id")||Yo(l,e+"Name")||(l[e+"Index"]=0);var h={};return ko(l,function(t,e){t=l[e];if("dataIndex"!==e&&"dataIndexInside"!==e){var i=e.match(/^(\w+)(Index|Id|Name)$/)||[],n=i[1],o=(i[2]||"").toLowerCase();if(!(!n||!o||null==t||"index"===o&&"none"===t||u&&u.includeMainTypes&&_(u.includeMainTypes,n)<0)){var a={mainType:n};"index"===o&&"all"===t||(a[o]=t);var r=s.queryComponents(a);h[n+"Models"]=r,h[n+"Model"]=r[0]}}else h[e]=t}),h}function Yo(t,e){return t&&t.hasOwnProperty(e)}function jo(t,e,i){t.setAttribute?t.setAttribute(e,i):t[e]=i}function qo(t){return"auto"===t?v.domSupported?"html":"richText":t||"html"}function Ko(t,i){var n=Q(),o=[];return E(t,function(t){var e=i(t);(n.get(e)||(o.push(e),n.set(e,[]))).push(t)}),{keys:o,buckets:n}}var $o=".",Jo="___EC__COMPONENT__CONTAINER___";function Qo(t){var e={main:"",sub:""};return t&&(t=t.split($o),e.main=t[0]||"",e.sub=t[1]||""),e}function ta(t){(t.$constructor=t).extend=function(t){function e(){t.$constructor?t.$constructor.apply(this,arguments):i.apply(this,arguments)}var i=this;return L(e.prototype,t),e.extend=this.extend,e.superCall=na,e.superApply=oa,w(e,this),e.superClass=i,e}}var ea=0;function ia(t){var e=["__\0is_clz",ea++,Math.random().toFixed(3)].join("_");t.prototype[e]=!0,t.isInstance=function(t){return!(!t||!t[e])}}function na(t,e){var i=U(arguments,2);return this.superClass.prototype[e].apply(t,i)}function oa(t,e,i){return this.superClass.prototype[e].apply(t,i)}function aa(i,t){t=t||{};var o={};if(i.registerClass=function(t,e){if(e)if(function(t){Y(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(t),'componentType "'+t+'" illegal')}(e),(e=Qo(e)).sub){if(e.sub!==Jo){(function(t){var e=o[t.main];e&&e[Jo]||((e=o[t.main]={})[Jo]=!0);return e})(e)[e.sub]=t}}else o[e.main]=t;return t},i.getClass=function(t,e,i){var n=o[t];if(n&&n[Jo]&&(n=e?n[e]:null),i&&!n)throw new Error(e?"Component "+t+"."+(e||"")+" not exists. Load it first.":t+".type should be specified.");return n},i.getClassesByMainType=function(t){t=Qo(t);var i=[],e=o[t.main];return e&&e[Jo]?E(e,function(t,e){e!==Jo&&i.push(t)}):i.push(e),i},i.hasClass=function(t){return t=Qo(t),!!o[t.main]},i.getAllClassMainTypes=function(){var i=[];return E(o,function(t,e){i.push(e)}),i},i.hasSubTypes=function(t){t=Qo(t);var e=o[t.main];return e&&e[Jo]},i.parseClassType=Qo,t.registerWhenExtend){var n=i.extend;n&&(i.extend=function(t){var e=n.call(this,t);return i.registerClass(e,t.type)})}return i}function ra(s){for(var t=0;tthis._ux||tr(e-this._yi)>this._uy||this._len<5;return this.addData(Za.L,t,e),this._ctx&&i&&(this._needsDash()?this._dashedLineTo(t,e):this._ctx.lineTo(t,e)),i&&(this._xi=t,this._yi=e),this},bezierCurveTo:function(t,e,i,n,o,a){return this.addData(Za.C,t,e,i,n,o,a),this._ctx&&(this._needsDash()?this._dashedBezierTo(t,e,i,n,o,a):this._ctx.bezierCurveTo(t,e,i,n,o,a)),this._xi=o,this._yi=a,this},quadraticCurveTo:function(t,e,i,n){return this.addData(Za.Q,t,e,i,n),this._ctx&&(this._needsDash()?this._dashedQuadraticTo(t,e,i,n):this._ctx.quadraticCurveTo(t,e,i,n)),this._xi=i,this._yi=n,this},arc:function(t,e,i,n,o,a){return this.addData(Za.A,t,e,i,i,n,o-n,0,a?0:1),this._ctx&&this._ctx.arc(t,e,i,n,o,a),this._xi=$a(o)*i+t,this._yi=Ja(o)*i+e,this},arcTo:function(t,e,i,n,o){return this._ctx&&this._ctx.arcTo(t,e,i,n,o),this},rect:function(t,e,i,n){return this._ctx&&this._ctx.rect(t,e,i,n),this.addData(Za.R,t,e,i,n),this},closePath:function(){this.addData(Za.Z);var t=this._ctx,e=this._x0,i=this._y0;return t&&(this._needsDash()&&this._dashedLineTo(e,i),t.closePath()),this._xi=e,this._yi=i,this},fill:function(t){t&&t.fill(),this.toStatic()},stroke:function(t){t&&t.stroke(),this.toStatic()},setLineDash:function(t){if(t instanceof Array){this._lineDash=t;for(var e=this._dashIdx=0,i=0;ie.length&&(this._expandData(),e=this.data);for(var i=0;il||tr(r-o)>u||c===h-1)&&(t.lineTo(a,r),n=a,o=r);break;case Za.C:t.bezierCurveTo(s[c++],s[c++],s[c++],s[c++],s[c++],s[c++]),n=s[c-2],o=s[c-1];break;case Za.Q:t.quadraticCurveTo(s[c++],s[c++],s[c++],s[c++]),n=s[c-2],o=s[c-1];break;case Za.A:var f=s[c++],p=s[c++],g=s[c++],m=s[c++],v=s[c++],y=s[c++],x=s[c++],_=s[c++],w=m=pr[n=0]+t&&r<=pr[1]+t?h:0}if(a){l=n;n=sr(o),o=sr(l)}else n=sr(n),o=sr(o);oMath.PI/2&&p<1.5*Math.PI&&(h=-h),c+=h)}}return c}function xr(t,e,i,n,o){for(var a=0,r=0,s=0,l=0,u=0,h=0;hMath.abs(a[1])?0=e[1])return i[1]}else{if(t>=e[0])return i[0];if(t<=e[1])return i[1]}else{if(t===e[0])return i[0];if(t===e[1])return i[1]}return(t-e[0])/o*a+i[0]}function Pl(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%"}return"string"==typeof t?function(t){return t.replace(/^\s+|\s+$/g,"")}(t).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):null==t?NaN:+t}function Nl(t,e,i){return null==e&&(e=10),e=Math.min(Math.max(0,e),20),t=(+t).toFixed(e),i?t:+t}function Ol(t){return t.sort(function(t,e){return t-e}),t}function El(t){if(t=+t,isNaN(t))return 0;for(var e=1,i=0;Math.round(t*e)/e!==t;)e*=10,i++;return i}function zl(t){var e=t.toString(),i=e.indexOf("e");if(0h&&(h=u[d],c=d);++s[c],u[c]=0,++l}return s[e]/o}var Vl=9007199254740991;function Gl(t){var e=2*Math.PI;return(t%e+e)%e}function Fl(t){return-Ll"'])/g,tu={"&":"&","<":"<",">":">",'"':""","'":"'"};function eu(t){return null==t?"":(t+"").replace(Ql,function(t,e){return tu[e]})}function iu(t,e){return"{"+t+(null==e?"":e)+"}"}var nu=["a","b","c","d","e","f","g"];function ou(t,e,i){k(e)||(e=[e]);var n=e.length;if(!n)return"";for(var o=e[0].$vars||[],a=0;a':'':{renderMode:o,content:"{marker"+a+"|} ",style:{color:i}}:""}function su(t,e){return"0000".substr(0,e-(t+="").length)+t}function lu(t,e,i){"week"!==t&&"month"!==t&&"quarter"!==t&&"half-year"!==t&&"year"!==t||(t="MM-dd\nyyyy");var n=Hl(e),o=i?"UTC":"",a=n["get"+o+"FullYear"](),r=n["get"+o+"Month"]()+1,s=n["get"+o+"Date"](),l=n["get"+o+"Hours"](),u=n["get"+o+"Minutes"](),h=n["get"+o+"Seconds"](),c=n["get"+o+"Milliseconds"]();return t=t.replace("MM",su(r,2)).replace("M",r).replace("yyyy",a).replace("yy",a%100).replace("dd",su(s,2)).replace("d",s).replace("hh",su(l,2)).replace("h",l).replace("mm",su(u,2)).replace("m",u).replace("ss",su(h,2)).replace("s",h).replace("SSS",su(c,3))}function uu(t){return t?t.charAt(0).toUpperCase()+t.substr(1):t}var hu=gn;var cu=(Object.freeze||Object)({addCommas:Kl,toCamelCase:$l,normalizeCssArray:Jl,encodeHTML:eu,formatTpl:ou,formatTplSimple:au,getTooltipMarker:ru,formatTime:lu,capitalFirst:uu,truncateText:hu,getTextBoundingRect:function(t){return cn(t.text,t.font,t.textAlign,t.textVerticalAlign,t.textPadding,t.textLineHeight,t.rich,t.truncate)},getTextRect:function(t,e,i,n,o,a,r,s){return cn(t,e,i,n,o,s,a,r)}}),du=E,fu=["left","right","top","bottom","width","height"],pu=[["width","left","right"],["height","top","bottom"]];function gu(h,c,d,f,p){var g=0,m=0;null==f&&(f=1/0),null==p&&(p=1/0);var v=0;c.eachChild(function(t,e){var i,n,o=t.position,a=t.getBoundingRect(),r=c.childAt(e+1),s=r&&r.getBoundingRect();if("horizontal"===h){var l=a.width+(s?-s.x+a.x:0);v=f<(i=g+l)||t.newline?(g=0,i=l,m+=v+d,a.height):Math.max(v,a.height)}else{var u=a.height+(s?-s.y+a.y:0);v=p<(n=m+u)||t.newline?(g+=v+d,m=0,n=u,a.width):Math.max(v,a.width)}t.newline||(o[0]=g,o[1]=m,"horizontal"===h?g=i+d:m=n+d)})}var mu=gu;T(gu,"vertical"),T(gu,"horizontal");function vu(t,e,i){i=Jl(i||0);var n=e.width,o=e.height,a=Pl(t.left,n),r=Pl(t.top,o),s=Pl(t.right,n),l=Pl(t.bottom,o),u=Pl(t.width,n),h=Pl(t.height,o),c=i[2]+i[0],d=i[1]+i[3],f=t.aspect;switch(isNaN(u)&&(u=n-s-d-a),isNaN(h)&&(h=o-l-c-r),null!=f&&(isNaN(u)&&isNaN(h)&&(n/oe)return t[n];return t[i-1]}(s,i):r;if((l=l||r)&&l.length){var u=l[o];return t&&(a[t]=u),n.colorIdx=(o+1)%l.length,u}}},Pu="original",Nu="arrayRows",Ou="objectRows",Eu="keyedColumns",zu="unknown",Ru="typedArray",Bu="column",Vu="row";function Gu(t){this.fromDataset=t.fromDataset,this.data=t.data||(t.sourceFormat===Eu?{}:[]),this.sourceFormat=t.sourceFormat||zu,this.seriesLayoutBy=t.seriesLayoutBy||Bu,this.dimensionsDefine=t.dimensionsDefine,this.encodeDefine=t.encodeDefine&&Q(t.encodeDefine),this.startIndex=t.startIndex||0,this.dimensionsDetectCount=t.dimensionsDetectCount}Gu.seriesDataToSource=function(t){return new Gu({data:t,sourceFormat:V(t)?Ru:Pu,fromDataset:!1})},ia(Gu);var Fu={Must:1,Might:2,Not:3},Wu=Zo();function Hu(t){var e=t.option,i=e.data,n=V(i)?Ru:Pu,o=!1,a=e.seriesLayoutBy,r=e.sourceHeader,s=e.dimensions,l=ju(t);if(l){var u=l.option;i=u.source,n=Wu(l).sourceFormat,o=!0,a=a||u.seriesLayoutBy,null==r&&(r=u.sourceHeader),s=s||u.dimensions}var h=function(t,e,i,n,o){if(!t)return{dimensionsDefine:Zu(o)};var a,r;if(e===Nu)"auto"===n||null==n?Uu(function(t){null!=t&&"-"!==t&&(z(t)?null==r&&(r=1):r=0)},i,t,10):r=n?1:0,o||1!==r||(o=[],Uu(function(t,e){o[e]=null!=t?t:""},i,t)),a=o?o.length:i===Vu?t.length:t[0]?t[0].length:null;else if(e===Ou)o=o||function(t){var e,i=0;for(;i":"\n",f="richText"===c,p={},g=0;function i(t){return{renderMode:c,content:eu(Kl(t)),style:p}}var m=this.getData(),a=m.mapDimension("defaultedTooltip",!0),n=a.length,r=this.getRawValue(o),s=k(r),v=m.getItemVisual(o,"color");R(v)&&v.colorStops&&(v=(v.colorStops[0]||{}).color),v=v||"transparent";var l=(1":"",n=i+u.join(i||", ");return{renderMode:c,content:n,style:p}}(r):i(n?Bh(m,o,a[0]):s?r[0]:r)).content,u=d.seriesIndex+"at"+g,y=ru({color:v,type:"item",renderMode:c,markerId:u});p[u]=v,++g;var x=m.getName(o),_=this.name;Fo(this)||(_=""),_=_?eu(_)+(h?": ":e):"";var w="string"==typeof y?y:y.content;return{html:h?w+_+l:_+w+(x?eu(x)+": "+l:l),markers:p}},isAnimationEnabled:function(){if(v.node)return!1;var t=this.getShallow("animation");return t&&this.getData().count()>this.getShallow("animationThreshold")&&(t=!1),t},restoreData:function(){this.dataTask.dirty()},getColorFromPalette:function(t,e,i){var n=this.ecModel,o=ku.getColorFromPalette.call(this,t,e,i);return o=o||n.getColorFromPalette(t,e,i)},coordDimToDataDim:function(t){return this.getRawData().mapDimension(t,!0)},getProgressive:function(){return this.get("progressive")},getProgressiveThreshold:function(){return this.get("progressiveThreshold")},getAxisTooltipData:null,getTooltipPosition:null,pipeTask:null,preventIncremental:null,pipelineContext:null});function nc(t){var e=t.name;Fo(t)||(t.name=function(t){var i=t.getRawData(),e=i.mapDimension("seriesName",!0),n=[];return E(e,function(t){var e=i.getDimensionInfo(t);e.displayName&&n.push(e.displayName)}),n.join(" ")}(t)||e)}function oc(t){return t.model.getRawData().count()}function ac(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),rc}function rc(t,e){t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function sc(e,i){E(e.CHANGABLE_METHODS,function(t){e.wrapMethod(t,T(lc,i))})}function lc(t){var e=uc(t);e&&e.setOutputEnd(this.count())}function uc(t){var e=(t.ecModel||{}).scheduler,i=e&&e.getPipeline(t.uid);if(i){var n=i.currentTask;if(n){var o=n.agentStubMap;o&&(n=o.get(t.uid))}return n}}b(ic,Fh),b(ic,ku);var hc=function(){this.group=new Ii,this.uid=Cl("viewComponent")};hc.prototype={constructor:hc,init:function(t,e){},render:function(t,e,i,n){},dispose:function(){},filterForExposedEvent:null};var cc=hc.prototype;cc.updateView=cc.updateLayout=cc.updateVisual=function(t,e,i,n){},ta(hc),aa(hc,{registerWhenExtend:!0});function dc(){var s=Zo();return function(t){var e=s(t),i=t.pipelineContext,n=e.large,o=e.progressiveRender,a=e.large=i.large,r=e.progressiveRender=i.progressiveRender;return!!(n^a||o^r)&&"reset"}}var fc=Zo(),pc=dc();function gc(){this.group=new Ii,this.uid=Cl("viewChart"),this.renderTask=Wh({plan:xc,reset:_c}),this.renderTask.context={view:this}}var mc=gc.prototype={type:"chart",init:function(t,e){},render:function(t,e,i,n){},highlight:function(t,e,i,n){yc(t.getData(),n,"emphasis")},downplay:function(t,e,i,n){yc(t.getData(),n,"normal")},remove:function(t,e){this.group.removeAll()},dispose:function(){},incrementalPrepareRender:null,incrementalRender:null,updateTransform:null,filterForExposedEvent:null};function vc(t,e,i){if(t&&(t.trigger(e,i),t.isGroup&&!qs(t)))for(var n=0,o=t.childCount();nc?i+=p(g("data.partialData"),{displayCnt:c}):i+=g("data.allData");for(var r=[],s=0;si.blockIndex?i.step:null,a=n&&n.modDataCount;return{step:o,modBy:null!=a?Math.ceil(a/o):null,modDataCount:a}}},Nc.getPipeline=function(t){return this._pipelineMap.get(t)},Nc.updateStreamModes=function(t,e){var i=this._pipelineMap.get(t.uid),n=t.getData().count(),o=i.progressiveEnabled&&e.incrementalPrepareRender&&n>=i.threshold,a=t.get("large")&&n>=t.get("largeThreshold"),r="mod"===t.get("progressiveChunkMode")?n:null;t.pipelineContext=i.context={progressiveRender:o,modDataCount:r,large:a}},Nc.restorePipelines=function(t){var n=this,o=n._pipelineMap=Q();t.eachSeries(function(t){var e=t.getProgressive(),i=t.uid;o.set(i,{id:i,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:e&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(e||700),count:0}),Uc(n,t,t.dataTask)})},Nc.prepareStageTasks=function(){var i=this._stageTaskMap,n=this.ecInstance.getModel(),o=this.api;E(this._allHandlers,function(t){var e=i.get(t.uid)||i.set(t.uid,[]);t.reset&&function(n,o,t,a,r){var s=t.seriesTaskMap||(t.seriesTaskMap=Q()),e=o.seriesType,i=o.getTargetSeries;o.createOnAllSeries?a.eachRawSeries(l):e?a.eachRawSeriesByType(e,l):i&&i(a,r).each(l);function l(t){var e=t.uid,i=s.get(e)||s.set(e,Wh({plan:Gc,reset:Fc,count:Zc}));i.context={model:t,ecModel:a,api:r,useClearVisual:o.isVisual&&!o.isLayout,plan:o.plan,reset:o.reset,scheduler:n},Uc(n,t,i)}var u=n._pipelineMap;s.each(function(t,e){u.get(e)||(t.dispose(),s.removeKey(e))})}(this,t,e,n,o),t.overallReset&&function(n,t,e,i,o){var a=e.overallTask=e.overallTask||Wh({reset:zc});a.context={ecModel:i,api:o,overallReset:t.overallReset,scheduler:n};var r=a.agentStubMap=a.agentStubMap||Q(),s=t.seriesType,l=t.getTargetSeries,u=!0,h=t.modifyOutputEnd;s?i.eachRawSeriesByType(s,c):l?l(i,o).each(c):(u=!1,E(i.getSeries(),c));function c(t){var e=t.uid,i=r.get(e);i||(i=r.set(e,Wh({reset:Rc,onDirty:Vc})),a.dirty()),i.context={model:t,overallProgress:u,modifyOutputEnd:h},i.agent=a,i.__block=u,Uc(n,t,i)}var d=n._pipelineMap;r.each(function(t,e){d.get(e)||(t.dispose(),a.dirty(),r.removeKey(e))})}(this,t,e,n,o)},this)},Nc.prepareView=function(t,e,i,n){var o=t.renderTask,a=o.context;a.model=e,a.ecModel=i,a.api=n,o.__block=!t.incrementalPrepareRender,Uc(this,e,o)},Nc.performDataProcessorTasks=function(t,e){Oc(this,this._dataProcessorHandlers,t,e,{block:!0})},Nc.performVisualTasks=function(t,e,i){Oc(this,this._visualHandlers,t,e,i)},Nc.performSeriesTasks=function(t){var e;t.eachSeries(function(t){e|=t.dataTask.perform()}),this.unfinished|=e},Nc.plan=function(){this._pipelineMap.each(function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}e=e.getUpstream()}while(e)})};var Ec=Nc.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)};function zc(t){t.overallReset(t.ecModel,t.api,t.payload)}function Rc(t,e){return t.overallProgress&&Bc}function Bc(){this.agent.dirty(),this.getDownstream().dirty()}function Vc(){this.agent&&this.agent.dirty()}function Gc(t){return t.plan&&t.plan(t.model,t.ecModel,t.api,t.payload)}function Fc(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=Eo(t.reset(t.model,t.ecModel,t.api,t.payload));return 1t.get("hoverLayerThreshold")&&!v.node&&t.eachSeries(function(t){if(!t.preventUsingHoverLayer){var e=i._chartsMap[t.__viewId];e.__alive&&e.group.traverse(function(t){t.useHoverLayer=!0})}})}(n,t),Lc(n._zr.dom,t)}function Ud(e,i){wd(Qd,function(t){t(e,i)})}Pd.resize=function(t){if(!this._disposed){this._zr.resize(t);var e=this._model;if(this._loadingFX&&this._loadingFX.resize(),e){var i=e.resetOption("media"),n=t&&t.silent;this[Td]=!0,i&&Ed(this),Od.update.call(this),this[Td]=!1,Vd.call(this,n),Gd.call(this,n)}}},Pd.showLoading=function(t,e){if(!this._disposed&&(Sd(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),nf[t])){var i=nf[t](this._api,e),n=this._zr;this._loadingFX=i,n.add(i)}},Pd.hideLoading=function(){this._disposed||(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},Pd.makeActionFromEvent=function(t){var e=L({},t);return e.type=Kd[t.type],e},Pd.dispatchAction=function(t,e){this._disposed||(Sd(e)||(e={silent:!!e}),qd[t.type]&&this._model&&(this[Td]?this._pendingActions.push(t):(Bd.call(this,t,e.silent),e.flush?this._zr.flush(!0):!1!==e.flush&&v.browser.weChat&&this._throttledZrFlush(),Vd.call(this,e.silent),Gd.call(this,e.silent))))},Pd.appendData=function(t){if(!this._disposed){var e=t.seriesIndex;this.getModel().getSeriesByIndex(e).appendData(t),this._scheduler.unfinished=!0}},Pd.on=Cd("on",!1),Pd.off=Cd("off",!1),Pd.one=Cd("one",!1);var Xd=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];function Yd(t,e){var i=t.get("z"),n=t.get("zlevel");e.group.traverse(function(t){"group"!==t.type&&(null!=i&&(t.z=i),null!=n&&(t.zlevel=n))})}function jd(){this.eventInfo}Pd._initEvents=function(){wd(Xd,function(u){function t(t){var e,i=this.getModel(),n=t.target;if("globalout"===u)e={};else if(n&&null!=n.dataIndex){var o=n.dataModel||i.getSeriesByIndex(n.seriesIndex);e=o&&o.getDataParams(n.dataIndex,n.dataType,n)||{}}else n&&n.eventData&&(e=L({},n.eventData));if(e){var a=e.componentType,r=e.componentIndex;"markLine"!==a&&"markPoint"!==a&&"markArea"!==a||(a="series",r=e.seriesIndex);var s=a&&null!=r&&i.getComponent(a,r),l=s&&this["series"===s.mainType?"_chartsMap":"_componentsMap"][s.__viewId];e.event=t,e.type=u,this._ecEventProcessor.eventInfo={targetEl:n,packedEvent:e,model:s,view:l},this.trigger(u,e)}}t.zrEventfulCallAtLast=!0,this._zr.on(u,t,this)},this),wd(Kd,function(t,e){this._messageCenter.on(e,function(t){this.trigger(e,t)},this)},this)},Pd.isDisposed=function(){return this._disposed},Pd.clear=function(){this._disposed||this.setOption({series:[]},!0)},Pd.dispose=function(){if(!this._disposed){this._disposed=!0,jo(this.getDom(),lf,"");var e=this._api,i=this._model;wd(this._componentsViews,function(t){t.dispose(i,e)}),wd(this._chartsViews,function(t){t.dispose(i,e)}),this._zr.dispose(),delete of[this.id]}},b(kd,Ct),jd.prototype={constructor:jd,normalizeQuery:function(t){var s={},l={},u={};if(z(t)){var e=Md(t);s.mainType=e.main||null,s.subType=e.sub||null}else{var h=["Index","Name","Id"],c={name:1,dataIndex:1,dataType:1};E(t,function(t,e){for(var i=!1,n=0;nx[1]&&(x[1]=y)}e&&(this._nameList[d]=e[f])}this._rawCount=this._count=l,this._extent={},Uf(this)},Hf._initDataFromProvider=function(t,e){if(!(e<=t)){for(var i,n=this._chunkSize,o=this._rawData,a=this._storage,r=this.dimensions,s=r.length,l=this._dimensionInfos,u=this._nameList,h=this._idList,c=this._rawExtent,d=this._nameRepeatCount={},f=this._chunkCount,p=0;pM[1]&&(M[1]=S)}if(!o.pure){var I=u[v];if(m&&null==I)if(null!=m.name)u[v]=I=m.name;else if(null!=i){var T=r[i],A=a[T][y];if(A){I=A[x];var D=l[T].ordinalMeta;D&&D.categories.length&&(I=D.categories[I])}}var C=null==m?null:m.id;null==C&&null!=I&&(d[I]=d[I]||0,0=this._rawCount||t<0)return-1;if(!this._indices)return t;var e=this._indices,i=e[t];if(null!=i&&it))return a;o=a-1}}return-1},Hf.indicesOfNearest=function(t,e,i){var n=[];if(!this._storage[t])return n;null==i&&(i=1/0);for(var o=1/0,a=-1,r=0,s=0,l=this.count();st[I][1])&&(M=!1)}M&&(a[r++]=this.getRawIndex(m))}return rw[1]&&(w[1]=_)}}}return o},Hf.downSample=function(t,e,i,n){for(var o=$f(this,[t]),a=o._storage,r=[],s=Math.floor(1/e),l=a[t],u=this.count(),h=this._chunkSize,c=o._rawExtent[t],d=new(Bf(this))(u),f=0,p=0;pc[1]&&(c[1]=x),d[f++]=_}return o._count=f,o._indices=d,o.getRawIndex=jf,o},Hf.getItemModel=function(t){var e=this.hostModel;return new Il(this.getRawDataItem(t),e,e&&e.ecModel)},Hf.diff=function(e){var i=this;return new Tf(e?e.getIndices():[],this.getIndices(),function(t){return qf(e,t)},function(t){return qf(i,t)})},Hf.getVisual=function(t){var e=this._visual;return e&&e[t]},Hf.setVisual=function(t,e){if(Pf(t))for(var i in t)t.hasOwnProperty(i)&&this.setVisual(i,t[i]);else this._visual=this._visual||{},this._visual[t]=e},Hf.setLayout=function(t,e){if(Pf(t))for(var i in t)t.hasOwnProperty(i)&&this.setLayout(i,t[i]);else this._layout[t]=e},Hf.getLayout=function(t){return this._layout[t]},Hf.getItemLayout=function(t){return this._itemLayouts[t]},Hf.setItemLayout=function(t,e,i){this._itemLayouts[t]=i?L(this._itemLayouts[t]||{},e):e},Hf.clearItemLayouts=function(){this._itemLayouts.length=0},Hf.getItemVisual=function(t,e,i){var n=this._itemVisuals[t],o=n&&n[e];return null!=o||i?o:this.getVisual(e)},Hf.setItemVisual=function(t,e,i){var n=this._itemVisuals[t]||{},o=this.hasItemVisual;if(this._itemVisuals[t]=n,Pf(e))for(var a in e)e.hasOwnProperty(a)&&(n[a]=e[a],o[a]=!0);else n[e]=i,o[e]=!0},Hf.clearAllVisual=function(){this._visual={},this._itemVisuals=[],this.hasItemVisual={}};function tp(t){t.seriesIndex=this.seriesIndex,t.dataIndex=this.dataIndex,t.dataType=this.dataType}function ep(t,e,i){Gu.isInstance(e)||(e=Gu.seriesDataToSource(e)),i=i||{},t=(t||[]).slice();for(var n=(i.dimsDef||[]).slice(),o=Q(),a=Q(),l=[],r=function(t,e,i,n){var o=Math.max(t.dimensionsDetectCount||1,e.length,i.length,n||0);return E(e,function(t){var e=t.dimsDef;e&&(o=Math.max(o,e.length))}),o}(e,t,n,i.dimCount),s=0;s=e[0]&&t<=e[1]},cp.prototype.normalize=function(t){var e=this._extent;return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])},cp.prototype.scale=function(t){var e=this._extent;return t*(e[1]-e[0])+e[0]},cp.prototype.unionExtent=function(t){var e=this._extent;t[0]e[1]&&(e[1]=t[1])},cp.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},cp.prototype.getExtent=function(){return this._extent.slice()},cp.prototype.setExtent=function(t,e){var i=this._extent;isNaN(t)||(i[0]=t),isNaN(e)||(i[1]=e)},cp.prototype.isBlank=function(){return this._isBlank},cp.prototype.setBlank=function(t){this._isBlank=t},cp.prototype.getLabel=null,ta(cp),aa(cp,{registerWhenExtend:!0}),dp.createByAxisModel=function(t){var e=t.option,i=e.data,n=i&&N(i,gp);return new dp({categories:n,needCollect:!n,deduplication:!1!==e.dedplication})};var fp=dp.prototype;function pp(t){return t._map||(t._map=Q(t.categories))}function gp(t){return R(t)&&null!=t.value?t.value:t+""}fp.getOrdinal=function(t){return pp(this).get(t)},fp.parseAndCollect=function(t){var e,i=this._needCollect;if("string"!=typeof t&&!i)return t;if(i&&!this._deduplication)return e=this.categories.length,this.categories[e]=t,e;var n=pp(this);return null==(e=n.get(t))&&(i?(e=this.categories.length,this.categories[e]=t,n.set(t,e)):e=NaN),e};var mp=cp.prototype,vp=cp.extend({type:"ordinal",init:function(t,e){t&&!k(t)||(t=new dp({categories:t})),this._ordinalMeta=t,this._extent=e||[0,t.categories.length-1]},parse:function(t){return"string"==typeof t?this._ordinalMeta.getOrdinal(t):Math.round(t)},contain:function(t){return t=this.parse(t),mp.contain.call(this,t)&&null!=this._ordinalMeta.categories[t]},normalize:function(t){return mp.normalize.call(this,this.parse(t))},scale:function(t){return Math.round(mp.scale.call(this,t))},getTicks:function(){for(var t=[],e=this._extent,i=e[0];i<=e[1];)t.push(i),i++;return t},getLabel:function(t){if(!this.isBlank())return this._ordinalMeta.categories[t]},count:function(){return this._extent[1]-this._extent[0]+1},unionExtentFromData:function(t,e){this.unionExtent(t.getApproximateExtent(e))},getOrdinalMeta:function(){return this._ordinalMeta},niceTicks:et,niceExtent:et});vp.create=function(){return new vp};var yp=Nl;function xp(t){return zl(t)+2}function _p(t,e,i){t[e]=Math.max(Math.min(t[e],i[1]),i[0])}function wp(t,e){isFinite(t[0])||(t[0]=e[0]),isFinite(t[1])||(t[1]=e[1]),_p(t,0,e),_p(t,1,e),t[0]>t[1]&&(t[0]=t[1])}var bp=Nl,Sp=cp.extend({type:"interval",_interval:0,_intervalPrecision:2,setExtent:function(t,e){var i=this._extent;isNaN(t)||(i[0]=parseFloat(t)),isNaN(e)||(i[1]=parseFloat(e))},unionExtent:function(t){var e=this._extent;t[0]e[1]&&(e[1]=t[1]),Sp.prototype.setExtent.call(this,e[0],e[1])},getInterval:function(){return this._interval},setInterval:function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=xp(t)},getTicks:function(t){var e=this._interval,i=this._extent,n=this._niceExtent,o=this._intervalPrecision,a=[];if(!e)return a;i[0]s&&(t?a.push(s+e):a.push(i[1])),a},getMinorTicks:function(t){for(var e=this.getTicks(!0),i=[],n=this.getExtent(),o=1;on[0]&&h>>1;t[o][1]>1^-(1&s),l=l>>1^-(1&l),o=s+=o,a=l+=a,n.push([s/i,l/i])}return n}bg.prototype={constructor:bg,properties:null,getBoundingRect:function(){var t=this._rect;if(t)return t;for(var e=Number.MAX_VALUE,i=[e,e],n=[-e,-e],o=[],a=[],r=this.geometries,s=0;ss[1];d(e[0].coord,s[0])&&(n?e[0].coord=s[0]:e.shift());n&&d(s[0],e[0].coord)&&e.unshift({coord:s[0]});d(s[1],a.coord)&&(n?a.coord=s[1]:e.pop());n&&d(a.coord,s[1])&&e.push({coord:s[1]});function d(t,e){return t=Nl(t),e=Nl(e),c?en[0]&&(n[0]=a[0]),a[1]>n[1]&&(n[1]=a[1])}return{min:e?i:n,max:e?n:i}}var pm=Sr.extend({type:"ec-polyline",shape:{points:[],smooth:0,smoothConstraint:!0,smoothMonotone:null,connectNulls:!1},style:{fill:null,stroke:"#000"},brush:Wr(Sr.prototype.brush),buildPath:function(t,e){var i=e.points,n=0,o=i.length,a=fm(i,e.smoothConstraint);if(e.connectNulls){for(;0n)return!1;return!0}(a,e))){var r=e.mapDimension(a.dim),s={};return E(a.getViewLabels(),function(t){s[t.tickValue]=1}),function(t){return!s.hasOwnProperty(e.get(r,t))}}}}function Sm(t,e,i){if("cartesian2d"!==t.type)return vm(t,e,i);var n=t.getBaseAxis().isHorizontal(),o=mm(t,e,i);if(!i.get("clip",!0)){var a=o.shape,r=Math.max(a.width,a.height);n?(a.y-=r,a.height+=2*r):(a.x-=r,a.width+=2*r)}return o}gc.extend({type:"line",init:function(){var t=new Ii,e=new $g;this.group.add(e.group),this._symbolDraw=e,this._lineGroup=t},render:function(t,e,i){var n=t.coordinateSystem,o=this.group,a=t.getData(),r=t.getModel("lineStyle"),s=t.getModel("areaStyle"),l=a.mapArray(a.getItemLayout),u="polar"===n.type,h=this._coordSys,c=this._symbolDraw,d=this._polyline,f=this._polygon,p=this._lineGroup,g=t.get("animation"),m=!s.isEmpty(),v=s.get("origin"),y=function(t,e,i){if(!i.valueDim)return[];for(var n=[],o=0,a=e.count();oh[c-1].coord&&(h.reverse(),d.reverse());var f=h[0].coord-10,p=h[c-1].coord+10,g=p-f;if(g<.001)return"transparent";E(h,function(t){t.offset=(t.coord-f)/g}),h.push({offset:c?h[c-1].offset:.5,color:d[1]||"transparent"}),h.unshift({offset:c?h[0].offset:.5,color:d[0]||"transparent"});var m=new cs(0,0,0,0,h,!0);return m[n]=f,m[n+"2"]=p,m}}}(a,n)||a.getVisual("color");d.useStyle(C(r.getLineStyle(),{fill:"none",stroke:M,lineJoin:"bevel"}));var I=t.get("smooth");if(I=_m(t.get("smooth")),d.setShape({smooth:I,smoothMonotone:t.get("smoothMonotone"),connectNulls:t.get("connectNulls")}),f){var T=a.getCalculationInfo("stackedOnSeries"),A=0;f.useStyle(C(s.getAreaStyle(),{fill:M,opacity:.7,lineJoin:"bevel"})),T&&(A=_m(T.get("smooth"))),f.setShape({smooth:I,stackedOnSmooth:A,smoothMonotone:t.get("smoothMonotone"),connectNulls:t.get("connectNulls")})}this._data=a,this._coordSys=n,this._stackedOnPoints=y,this._points=l,this._step=S,this._valueOrigin=v},dispose:function(){},highlight:function(t,e,i,n){var o=t.getData(),a=Ho(o,n);if(!(a instanceof Array)&&null!=a&&0<=a){var r=o.getItemGraphicEl(a);if(!r){var s=o.getItemLayout(a);if(!s)return;if(this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(s[0],s[1]))return;(r=new Fg(o,a)).position=s,r.setZ(t.get("zlevel"),t.get("z")),r.ignore=isNaN(s[0])||isNaN(s[1]),r.__temp=!0,o.setItemGraphicEl(a,r),r.stopSymbolAnimation(!0),this.group.add(r)}r.highlight()}else gc.prototype.highlight.call(this,t,e,i,n)},downplay:function(t,e,i,n){var o=t.getData(),a=Ho(o,n);if(null!=a&&0<=a){var r=o.getItemGraphicEl(a);r&&(r.__temp?(o.setItemGraphicEl(a,null),this.group.remove(r)):r.downplay())}else gc.prototype.downplay.call(this,t,e,i,n)},_newPolyline:function(t){var e=this._polyline;return e&&this._lineGroup.remove(e),e=new pm({shape:{points:t},silent:!0,z2:10}),this._lineGroup.add(e),this._polyline=e},_newPolygon:function(t,e){var i=this._polygon;return i&&this._lineGroup.remove(i),i=new gm({shape:{points:t,stackedOnPoints:e},silent:!0}),this._lineGroup.add(i),this._polygon=i},_updateAnimation:function(t,e,i,n,o,a){var r=this._polyline,s=this._polygon,l=t.hostModel,u=function(t,e,i,n,o,a,r,s){for(var l=function(t,e){var i=[];return e.diff(t).add(function(t){i.push({cmd:"+",idx:t})}).update(function(t,e){i.push({cmd:"=",idx:e,idx1:t})}).remove(function(t){i.push({cmd:"-",idx:t})}).execute(),i}(t,e),u=[],h=[],c=[],d=[],f=[],p=[],g=[],m=im(o,e,r),v=im(a,t,s),y=0;ye&&(e=t[i]);return isFinite(e)?e:NaN},min:function(t){for(var e=1/0,i=0;ie[1]&&e.reverse(),e},getOtherAxis:function(){this.grid.getOtherAxis()},pointToData:function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},toLocalCoord:null,toGlobalCoord:null},w(km,Eg);var Pm={show:!0,zlevel:0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#333",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}},Nm={};Nm.categoryAxis=m({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},Pm),Nm.valueAxis=m({boundaryGap:[0,0],splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#eee",width:1}}},Pm),Nm.timeAxis=C({scale:!0,min:"dataMin",max:"dataMax"},Nm.valueAxis),Nm.logAxis=C({scale:!0,logBase:10},Nm.valueAxis);function Om(a,t,r,e){E(Em,function(o){t.extend({type:a+"Axis."+o,mergeDefaultAndTheme:function(t,e){var i=this.layoutMode,n=i?_u(t):{};m(t,e.getTheme().get(o+"Axis")),m(t,this.getDefaultOption()),t.type=r(a,t),i&&xu(t,n,i)},optionUpdated:function(){"category"===this.option.type&&(this.__ordinalMeta=dp.createByAxisModel(this))},getCategories:function(t){var e=this.option;if("category"===e.type)return t?e.data:this.__ordinalMeta.categories},getOrdinalMeta:function(){return this.__ordinalMeta},defaultOption:p([{},Nm[o+"Axis"],e],!0)})}),Tu.registerSubTypeDefaulter(a+"Axis",T(r,a))}var Em=["value","category","time","log"],zm=Tu.extend({type:"cartesian2dAxis",axis:null,init:function(){zm.superApply(this,"init",arguments),this.resetRange()},mergeOption:function(){zm.superApply(this,"mergeOption",arguments),this.resetRange()},restoreData:function(){zm.superApply(this,"restoreData",arguments),this.resetRange()},getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"grid",index:this.option.gridIndex,id:this.option.gridId})[0]}});function Rm(t,e){return e.type||(e.data?"category":"value")}m(zm.prototype,sg);var Bm={offset:0};function Vm(t,e){return t.getCoordSysModel()===e}function Gm(t,e,i){this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this._initCartesian(t,e,i),this.model=t}Om("x",zm,Rm,Bm),Om("y",zm,Rm,Bm),Tu.extend({type:"grid",dependencies:["xAxis","yAxis"],layoutMode:"box",coordinateSystem:null,defaultOption:{show:!1,zlevel:0,z:0,left:"10%",top:60,right:"10%",bottom:60,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"}});var Fm=Gm.prototype;function Wm(t,e,i,n){i.getAxesOnZeroOf=function(){return o?[o]:[]};var o,a=t[e],r=i.model,s=r.get("axisLine.onZero"),l=r.get("axisLine.onZeroAxisIndex");if(s){if(null!=l)Hm(a[l])&&(o=a[l]);else for(var u in a)if(a.hasOwnProperty(u)&&Hm(a[u])&&!n[h(a[u])]){o=a[u];break}o&&(n[h(o)]=!0)}function h(t){return t.dim+"_"+t.index}}function Hm(t){return t&&"category"!==t.type&&"time"!==t.type&&function(t){var e=t.scale.getExtent(),i=e[0],n=e[1];return!(0u[1]?-1:1,c=["start"===a?u[0]-h*l:"end"===a?u[1]+h*l:(u[0]+u[1])/2,ev(a)?t.labelOffset+r*l:0],d=e.get("nameRotate");null!=d&&(d=d*jm/180),ev(a)?n=$m(t.rotation,null!=d?d:t.rotation,r):(n=function(t,e,i,n){var o,a,r=Gl(i-t.rotation),s=n[0]>n[1],l="start"===e&&!s||"start"!==e&&s;o=Fl(r-jm/2)?(a=l?"bottom":"top","center"):Fl(r-1.5*jm)?(a=l?"top":"bottom","center"):(a="middle",r<1.5*jm&&jm/2l[1]&&l.reverse(),(null==r||r>l[1])&&(r=l[1]),r=i.r0}}});var jv=Math.PI/180;function qv(o,t,e,i,n,a,r,s,l,u){function h(t,e,i){for(var n=t;nl+r);n++)if(o[n].y+=i,to[n].y+o[n].height)return void c(n,i/2);c(e-1,i/2)}function c(t,e){for(var i=t;0<=i&&!(o[i].y-eo[i-1].y+o[i-1].height));i--);}function d(t,e,i,n,o,a){for(var r=e?Number.MAX_VALUE:0,s=0,l=t.length;s=e?v.push(o[y]):m.push(o[y]);d(m,!1,t,e,i,n),d(v,!0,t,e,i,n)}function Kv(t){return"center"===t.position}function $v(L,k,P,t,N,e){var O,E,z=L.getData(),R=[],B=!1,V=(L.get("minShowLabelAngle")||0)*jv;z.each(function(t){var e=z.getItemLayout(t),i=z.getItemModel(t),n=i.getModel("label"),o=n.get("position")||i.get("emphasis.label.position"),a=n.get("distanceToLabelLine"),r=n.get("alignTo"),s=Pl(n.get("margin"),P),l=n.get("bleedMargin"),u=n.getFont(),h=i.getModel("labelLine"),c=h.get("length");c=Pl(c,P);var d=h.get("length2");if(d=Pl(d,P),!(e.anglei[0]&&isFinite(u)&&isFinite(i[0]););else{var h=o.getTicks().length-1;f"+N(t,function(t,e){var i=o.get(o.mapDimension(t.dim),n);return eu(t.name+" : "+i)}).join("
")},defaultOption:{zlevel:0,z:2,coordinateSystem:"radar",legendHoverLink:!0,radarIndex:0,lineStyle:{width:2,type:"solid"},label:{position:"top"},symbol:"emptyCircle",symbolSize:4}});Mf({type:"radar",render:function(l,t,e){var i=l.coordinateSystem,g=this.group,m=l.getData(),s=this._data;function u(t,e){var i=t.getItemVisual(e,"symbol")||"circle",n=t.getItemVisual(e,"color");if("none"!==i){var o=function(t){return k(t)||(t=[+t,+t]),t}(t.getItemVisual(e,"symbolSize")),a=mg(i,-1,-1,2,2,n);return a.attr({style:{strokeNoScale:!0},z2:100,scale:[o[0]/2,o[1]/2]}),a}}function h(t,e,i,n,o,a){i.removeAll();for(var r=0;r"+eu(n+" : "+i)},getTooltipPosition:function(t){if(null!=t){var e=this.getData().getName(t),i=this.coordinateSystem,n=i.getRegion(e);return n&&i.dataToPoint(n.center)}},setZoom:function(t){this.option.zoom=t},setCenter:function(t){this.option.center=t},defaultOption:{zlevel:0,z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:.75,showLegendSymbol:!0,dataRangeHoverLink:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}}}}),Vv);var Ay="\0_ec_interaction_mutex";function Dy(t,e){return!!Cy(t)[e]}function Cy(t){return t[Ay]||(t[Ay]={})}function Ly(i){this.pointerChecker,this._zr=i,this._opt={};var t=A,n=t(ky,this),o=t(Py,this),a=t(Ny,this),r=t(Oy,this),s=t(Ey,this);Ct.call(this),this.setPointerChecker=function(t){this.pointerChecker=t},this.enable=function(t,e){this.disable(),this._opt=C(D(e)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),null==t&&(t=!0),!0!==t&&"move"!==t&&"pan"!==t||(i.on("mousedown",n),i.on("mousemove",o),i.on("mouseup",a)),!0!==t&&"scale"!==t&&"zoom"!==t||(i.on("mousewheel",r),i.on("pinch",s))},this.disable=function(){i.off("mousedown",n),i.off("mousemove",o),i.off("mouseup",a),i.off("mousewheel",r),i.off("pinch",s)},this.dispose=this.disable,this.isDragging=function(){return this._dragging},this.isPinching=function(){return this._pinching}}function ky(t){if(!(Ht(t)||t.target&&t.target.draggable)){var e=t.offsetX,i=t.offsetY;this.pointerChecker&&this.pointerChecker(t,e,i)&&(this._x=e,this._y=i,this._dragging=!0)}}function Py(t){if(this._dragging&&By("moveOnMouseMove",t,this._opt)&&"pinch"!==t.gestureEvent&&!Dy(this._zr,"globalPan")){var e=t.offsetX,i=t.offsetY,n=this._x,o=this._y,a=e-n,r=i-o;this._x=e,this._y=i,this._opt.preventDefaultMouseMove&&Wt(t.event),Ry(this,"pan","moveOnMouseMove",t,{dx:a,dy:r,oldX:n,oldY:o,newX:e,newY:i})}}function Ny(t){Ht(t)||(this._dragging=!1)}function Oy(t){var e=By("zoomOnMouseWheel",t,this._opt),i=By("moveOnMouseWheel",t,this._opt),n=t.wheelDelta,o=Math.abs(n),a=t.offsetX,r=t.offsetY;if(0!==n&&(e||i)){if(e){var s=3x.x)||(m-=Math.PI);var b=v?"left":"right",S=a.labelModel.get("rotate"),M=S*(Math.PI/180);g.setStyle({textPosition:a.labelModel.get("position")||b,textRotation:null==S?-m:M,textOrigin:"center",verticalAlign:"middle"})}if(s.parentNode&&s.parentNode!==u){var I=i.__edge;sl(I=I||(i.__edge=new ls({shape:Px(a,f,f),style:C({opacity:0,strokeNoScale:!0},a.lineStyle)})),{shape:Px(a,d,p),style:{opacity:1}},o),n.add(I)}}function kx(t,e,i,n,o,a){for(var r,s=t.tree.getNodeByDataIndex(e),l=t.tree.root,u=s.getModel(),h=(a=Cx(s,u,a),s.parentNode===l?s:s.parentNode||s);null==(r=h.getLayout());)h=h.parentNode===l?h:h.parentNode||h;sl(i,{position:[r.x+1,r.y+1]},o,function(){n.remove(i),t.setItemGraphicEl(e,null)}),i.fadeOut(null,{keepLabel:!0});var c=i.__edge;c&&sl(c,{shape:Px(a,r,r),style:{opacity:0}},o,function(){n.remove(c)})}function Px(t,e,i){var n,o,a,r,s,l,u,h,c=t.orient;if("radial"!==t.layout)return s=e.x,u=e.y,l=i.x,h=i.y,"LR"!==c&&"RL"!==c||(n=s+(l-s)*t.curvature,o=u,a=l+(s-l)*t.curvature,r=h),"TB"!==c&&"BT"!==c||(n=s,o=u+(h-u)*t.curvature,a=l,r=h+(u-h)*t.curvature),{x1:s,y1:u,x2:l,y2:h,cpx1:n,cpy1:o,cpx2:a,cpy2:r};s=e.rawX,u=e.rawY,l=i.rawX,h=i.rawY;var d=Sx(s,u),f=Sx(s,u+(h-u)*t.curvature),p=Sx(l,h+(u-h)*t.curvature),g=Sx(l,h);return{x1:d.x,y1:d.y,x2:g.x,y2:g.y,cpx1:f.x,cpy1:f.y,cpx2:p.x,cpy2:p.y}}function Nx(t,e){for(var i,n=[t];i=n.pop();)if(e(i),i.isExpand){var o=i.children;if(o.length)for(var a=o.length-1;0<=a;a--)n.push(o[a])}}mx.prototype={constructor:mx,isRemoved:function(){return this.dataIndex<0},eachNode:function(t,e,i){"function"==typeof t&&(i=e,e=t,t=null),z(t=t||{})&&(t={order:t});var n,o=t.order||"preorder",a=this[t.attr||"children"];"preorder"===o&&(n=e.call(i,this));for(var r=0;!n&&re&&(e=n.height)}this.height=e+1},getNodeById:function(t){if(this.getId()===t)return this;for(var e=0,i=this.children,n=i.length;ea&&(a=t.depth)});var r=t.expandAndCollapse&&0<=t.initialTreeDepth?t.initialTreeDepth:a;return o.root.eachNode("preorder",function(t){var e=t.hostTree.data.getRawDataItem(t.dataIndex);t.isExpand=e&&null!=e.collapsed?!e.collapsed:t.depth<=r}),o.data},getOrient:function(){var t=this.get("orient");return"horizontal"===t?t="LR":"vertical"===t&&(t="TB"),t},setZoom:function(t){this.option.zoom=t},setCenter:function(t){this.option.center=t},formatTooltip:function(t){for(var e=this.getData().tree,i=e.root.children[0],n=e.getNodeByDataIndex(t),o=n.getValue(),a=n.name;n&&n!==i;)a=n.parentNode.name+"."+a,n=n.parentNode;return eu(a+(isNaN(o)||null==o?"":" : "+o))},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderColor:"#c23531",borderWidth:1.5},label:{show:!0,color:"#555"},leaves:{label:{show:!0}},animationEasing:"linear",animationDuration:700,animationDurationUpdate:1e3}}),Mf({type:"tree",init:function(t,e){this._oldTree,this._mainGroup=new Ii,this._controller=new Ly(e.getZr()),this._controllerHost={target:this.group},this.group.add(this._mainGroup)},render:function(n,t,i,e){var o=n.getData(),a=n.layoutInfo,r=this._mainGroup,s=n.get("layout");"radial"===s?r.attr("position",[a.x+a.width/2,a.y+a.height/2]):r.attr("position",[a.x,a.y]),this._updateViewCoordSys(n,a,s),this._updateController(n,t,i);var l=this._data,u={expandAndCollapse:n.get("expandAndCollapse"),layout:s,orient:n.getOrient(),curvature:n.get("lineStyle.curveness"),symbolRotate:n.get("symbolRotate"),symbolOffset:n.get("symbolOffset"),hoverAnimation:n.get("hoverAnimation"),useNameLabel:!0,fadeIn:!0};o.diff(l).add(function(t){Dx(o,t)&&Lx(o,t,null,r,n,u)}).update(function(t,e){var i=l.getItemGraphicEl(e);Dx(o,t)?Lx(o,t,i,r,n,u):i&&kx(l,e,i,r,n,u)}).remove(function(t){var e=l.getItemGraphicEl(t);e&&kx(l,t,e,r,n,u)}).execute(),this._nodeScaleRatio=n.get("nodeScaleRatio"),this._updateNodeAndLinkScale(n),!0===u.expandAndCollapse&&o.eachItemGraphicEl(function(t,e){t.off("click").on("click",function(){i.dispatchAction({type:"treeExpandAndCollapse",seriesId:n.id,dataIndex:e})})}),this._data=o},_updateViewCoordSys:function(t){var i=t.getData(),n=[];i.each(function(t){var e=i.getItemLayout(t);!e||isNaN(e.x)||isNaN(e.y)||n.push([+e.x,+e.y])});var e=[],o=[];Ba(n,e,o);var a=this._min,r=this._max;o[0]-e[0]==0&&(e[0]=a?a[0]:e[0]-1,o[0]=r?r[0]:o[0]+1),o[1]-e[1]==0&&(e[1]=a?a[1]:e[1]-1,o[1]=r?r[1]:o[1]+1);var s=t.coordinateSystem=new Qy;s.zoomLimit=t.get("scaleLimit"),s.setBoundingRect(e[0],e[1],o[0]-e[0],o[1]-e[1]),s.setCenter(t.get("center")),s.setZoom(t.get("zoom")),this.group.attr({position:s.position,scale:s.scale}),this._viewCoordSys=s,this._min=e,this._max=o},_updateController:function(o,t,a){var e=this._controller,i=this._controllerHost,r=this.group;e.setPointerChecker(function(t,e,i){var n=r.getBoundingRect();return n.applyTransform(r.transform),n.contain(e,i)&&!Wy(t,a,o)}),e.enable(o.get("roam")),i.zoomLimit=o.get("scaleLimit"),i.zoom=o.coordinateSystem.getZoom(),e.off("pan").off("zoom").on("pan",function(t){Vy(i,t.dx,t.dy),a.dispatchAction({seriesId:o.id,type:"treeRoam",dx:t.dx,dy:t.dy})},this).on("zoom",function(t){Gy(i,t.scale,t.originX,t.originY),a.dispatchAction({seriesId:o.id,type:"treeRoam",zoom:t.scale,originX:t.originX,originY:t.originY}),this._updateNodeAndLinkScale(o)},this)},_updateNodeAndLinkScale:function(t){var e=t.getData(),i=this._getNodeGlobalScale(t),n=[i,i];e.eachItemGraphicEl(function(t,e){t.attr("scale",n)})},_getNodeGlobalScale:function(t){var e=t.coordinateSystem;if("view"!==e.type)return 1;var i=this._nodeScaleRatio,n=e.scale,o=n&&n[0]||1;return((e.getZoom()-1)*i+1)/o},dispose:function(){this._controller&&this._controller.dispose(),this._controllerHost={}},remove:function(){this._mainGroup.removeAll(),this._data=null}}),gf({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(n,t){t.eachComponent({mainType:"series",subType:"tree",query:n},function(t){var e=n.dataIndex,i=t.getData().tree.getNodeByDataIndex(e);i.isExpand=!i.isExpand})}),gf({type:"treeRoam",event:"treeRoam",update:"none"},function(i,t){t.eachComponent({mainType:"series",subType:"tree",query:i},function(t){var e=Ky(t.coordinateSystem,i);t.setCenter&&t.setCenter(e.center),t.setZoom&&t.setZoom(e.zoom)})});function Ox(t,e,i){if(t&&0<=_(e,t.type)){var n=i.getData().tree.root,o=t.targetNode;if("string"==typeof o&&(o=n.getNodeById(o)),o&&n.contains(o))return{node:o};var a=t.targetNodeId;if(null!=a&&(o=n.getNodeById(a)))return{node:o}}}function Ex(t){for(var e=[];t;)(t=t.parentNode)&&e.push(t);return e.reverse()}function zx(t,e){return 0<=_(Ex(t),e)}function Rx(t,e){for(var i=[];t;){var n=t.dataIndex;i.push({name:t.name,dataIndex:n,value:e.getRawValue(n)}),t=t.parentNode}return i.reverse(),i}yf(Mm("tree","circle")),vf(function(t,e){t.eachSeriesByType("tree",function(t){!function(t,e){var i=function(t,e){return vu(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}(t,e);t.layoutInfo=i;var n=t.get("layout"),o=0,a=0,r=null;r="radial"===n?(o=2*Math.PI,a=Math.min(i.height,i.width)/2,bx(function(t,e){return(t.parentNode===e.parentNode?1:2)/t.depth})):(o=i.width,a=i.height,bx());var s=t.getData().tree.root,l=s.children[0];if(l){!function(t){t.hierNode={defaultAncestor:null,ancestor:t,prelim:0,modifier:0,change:0,shift:0,i:0,thread:null};for(var e,i,n=[t];e=n.pop();)if(i=e.children,e.isExpand&&i.length)for(var o=i.length-1;0<=o;o--){var a=i[o];a.hierNode={defaultAncestor:null,ancestor:a,prelim:0,modifier:0,change:0,shift:0,i:o,thread:null},n.push(a)}}(s),function(t,e,i){for(var n,o=[t],a=[];n=o.pop();)if(a.push(n),n.isExpand){var r=n.children;if(r.length)for(var s=0;sh.getLayout().x&&(h=t),t.depth>c.depth&&(c=t)});var d=u===h?1:r(u,h)/2,f=d-u.getLayout().x,p=0,g=0,m=0,v=0;if("radial"===n)p=o/(h.getLayout().x+d+f),g=a/(c.depth-1||1),Nx(l,function(t){m=(t.getLayout().x+f)*p,v=(t.depth-1)*g;var e=Sx(m,v);t.setLayout({x:e.x,y:e.y,rawX:m,rawY:v},!0)});else{var y=t.getOrient();"RL"===y||"LR"===y?(g=a/(h.getLayout().x+d+f),p=o/(c.depth-1||1),Nx(l,function(t){v=(t.getLayout().x+f)*g,m="LR"===y?(t.depth-1)*p:o-(t.depth-1)*p,t.setLayout({x:m,y:v},!0)})):"TB"!==y&&"BT"!==y||(p=o/(h.getLayout().x+d+f),g=a/(c.depth-1||1),Nx(l,function(t){m=(t.getLayout().x+f)*p,v="TB"===y?(t.depth-1)*g:a-(t.depth-1)*g,t.setLayout({x:m,y:v},!0)}))}}}(t,e)})}),ic.extend({type:"series.treemap",layoutMode:"box",dependencies:["grid","polar"],preventUsingHoverLayer:!0,_viewRoot:null,defaultOption:{progressive:0,left:"center",top:"middle",right:null,bottom:null,width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.1024,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",borderColor:"rgba(255,255,255,0.7)",borderWidth:1,shadowColor:"rgba(150,150,150,1)",shadowBlur:3,shadowOffsetX:0,shadowOffsetY:0,textStyle:{color:"#fff"}},emphasis:{textStyle:{}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",ellipsis:!0},upperLabel:{show:!1,position:[0,"50%"],height:20,color:"#fff",ellipsis:!0,verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],color:"#fff",ellipsis:!0,verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},getInitialData:function(t,e){var i={name:t.name,children:t.data};!function i(t){var n=0;E(t.children,function(t){i(t);var e=t.value;k(e)&&(e=e[0]),n+=e});var e=t.value;k(e)&&(e=e[0]);null!=e&&!isNaN(e)||(e=n);e<0&&(e=0);k(t.value)?t.value[0]=e:t.value=e}(i);var n=t.levels||[];n=t.levels=function(t,e){var n,i=e.get("color");if(!i)return;if(E(t=t||[],function(t){var e=new Il(t),i=e.get("color");(e.get("itemStyle.color")||i&&"none"!==i)&&(n=!0)}),!n){(t[0]||(t[0]={})).color=i.slice()}return t}(n,e);var o={};return o.levels=n,vx.createTree(i,this,o).data},optionUpdated:function(){this.resetViewRoot()},formatTooltip:function(t){var e=this.getData(),i=this.getRawValue(t),n=k(i)?Kl(i[0]):Kl(i);return eu(e.getName(t)+": "+n)},getDataParams:function(t){var e=ic.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return e.treePathInfo=Rx(i,this),e},setLayoutInfo:function(t){this.layoutInfo=this.layoutInfo||{},L(this.layoutInfo,t)},mapIdToIndex:function(t){var e=this._idIndexMap;e||(e=this._idIndexMap=Q(),this._idIndexMapCount=0);var i=e.get(t);return null==i&&e.set(t,i=this._idIndexMapCount++),i},getViewRoot:function(){return this._viewRoot},resetViewRoot:function(t){t?this._viewRoot=t:t=this._viewRoot;var e=this.getRawData().tree.root;t&&(t===e||e.contains(t))||(this._viewRoot=e)}});var Bx=5;function Vx(t){this.group=new Ii,t.add(this.group)}function Gx(t,e,i,n,o,a){var r=[[o?t:t-Bx,e],[t+i,e],[t+i,e+n],[o?t:t-Bx,e+n]];return a||r.splice(2,0,[t+i+Bx,e+n/2]),o||r.push([t,e+n/2]),r}Vx.prototype={constructor:Vx,render:function(t,e,i,n){var o=t.getModel("breadcrumb"),a=this.group;if(a.removeAll(),o.get("show")&&i){var r=o.getModel("itemStyle"),s=r.getModel("textStyle"),l={pos:{left:o.get("left"),right:o.get("right"),top:o.get("top"),bottom:o.get("bottom")},box:{width:e.getWidth(),height:e.getHeight()},emptyItemWidth:o.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(i,l,s),this._renderContent(t,l,r,s,n),yu(a,l.pos,l.box)}},_prepare:function(t,e,i){for(var n=t;n;n=n.parentNode){var o=n.getModel().get("name"),a=i.getTextRect(o),r=Math.max(a.width+16,e.emptyItemWidth);e.totalWidth+=r+8,e.renderList.push({node:n,text:o,width:r})}},_renderContent:function(t,e,i,n,o){for(var a,r,s=0,l=e.emptyItemWidth,u=t.get("breadcrumb.height"),h=function(t,e,i){var n=e.width,o=e.height,a=Pl(t.x,n),r=Pl(t.y,o),s=Pl(t.x2,n),l=Pl(t.y2,o);return(isNaN(a)||isNaN(parseFloat(t.x)))&&(a=0),(isNaN(s)||isNaN(parseFloat(t.x2)))&&(s=n),(isNaN(r)||isNaN(parseFloat(t.y)))&&(r=0),(isNaN(l)||isNaN(parseFloat(t.y2)))&&(l=o),i=Jl(i||0),{width:Math.max(s-a-i[1]-i[3],0),height:Math.max(l-r-i[0]-i[2],0)}}(e.pos,e.box),c=e.totalWidth,d=e.renderList,f=d.length-1;0<=f;f--){var p=d[f],g=p.node,m=p.width,v=p.text;c>h.width&&(c-=m-l,m=l,v=null);var y=new qr({shape:{points:Gx(s,0,m,u,f===d.length-1,0===f)},style:C(i.getItemStyle(),{lineJoin:"bevel",text:v,textFill:n.getTextColor(),textFont:n.getFont()}),z:10,onclick:T(o,g)});this.group.add(y),a=t,r=g,y.eventData={componentType:"series",componentSubType:"treemap",componentIndex:a.componentIndex,seriesIndex:a.componentIndex,seriesName:a.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:r&&r.dataIndex,name:r&&r.name},treePathInfo:r&&Rx(r,a)},s+=m+8}},remove:function(){this.group.removeAll()}};function Fx(t){var e=$x(t);return e.stroke=e.fill=e.lineWidth=null,e}var Wx=A,Hx=Ii,Zx=is,Ux=E,Xx=["label"],Yx=["emphasis","label"],jx=["upperLabel"],qx=["emphasis","upperLabel"],Kx=10,$x=ra([["fill","color"],["stroke","strokeColor"],["lineWidth","strokeWidth"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]);function Jx(d,r,s,l,u,i,f,t,e,n){if(f){var p=f.getLayout();if(p&&p.isInView){var h=p.width,c=p.height,g=p.borderWidth,m=p.invisible,v=f.getRawIndex(),y=t&&t.getRawIndex(),o=f.viewChildren,x=p.upperHeight,a=o&&o.length,_=f.getModel("itemStyle"),w=f.getModel("emphasis.itemStyle"),b=A("nodeGroup",Hx);if(b){if(e.add(b),b.attr("position",[p.x||0,p.y||0]),b.__tmNodeWidth=h,b.__tmNodeHeight=c,p.isAboveViewRoot)return b;var S=A("background",Zx,n,1);if(S&&function(t,n,o){n.dataIndex=f.dataIndex,n.seriesIndex=d.seriesIndex,n.setShape({x:0,y:0,width:h,height:c});var a=f.getVisual("borderColor",!0),r=w.get("borderColor");I(n,function(){var t=Fx(_);t.fill=a;var e=$x(w);if(e.fill=r,o){var i=h-2*g;T(t,e,a,i,x,{x:g,y:0,width:i,height:x})}else t.text=e.text=null;n.setStyle(t),Ys(n,e)}),t.add(n)}(b,S,a&&p.upperHeight),!a){var M=A("content",Zx,n,2);M&&function(t,i){i.dataIndex=f.dataIndex,i.seriesIndex=d.seriesIndex;var n=Math.max(h-2*g,0),o=Math.max(c-2*g,0);i.culling=!0,i.setShape({x:g,y:g,width:n,height:o});var a=f.getVisual("color",!0);I(i,function(){var t=Fx(_);t.fill=a;var e=$x(w);T(t,e,a,n,o),i.setStyle(t),Ys(i,e)}),t.add(i)}(b,M)}return b}}}function I(t,e){m?t.invisible||i.push(t):(e(),t.__tmWillVisible||(t.invisible=!1))}function T(t,e,i,n,o,a){var r=f.getModel(),s=W(d.getFormattedLabel(f.dataIndex,"normal",null,null,a?"upperLabel":"label"),r.get("name"));if(!a&&p.isLeafRoot){var l=d.get("drillDownIcon",!0);s=l?l+" "+s:s}var u=r.getModel(a?jx:Xx),h=r.getModel(a?qx:Yx),c=u.getShallow("show");$s(t,e,u,h,{defaultText:c?s:null,autoColor:i,isRectText:!0}),a&&(t.textRect=D(a)),t.truncate=c&&u.get("ellipsis")?{outerWidth:n,outerHeight:o,minChar:2}:null}function A(t,e,i,n){var o=null!=y&&s[t][y],a=u[t];return o?(s[t][y]=null,function(t,e,i){(t[v]={}).old="nodeGroup"===i?e.position.slice():L({},e.shape)}(a,o,t)):m||((o=new e({z:function(t,e){var i=t*Kx+e;return(i-1)/i}(i,n)})).__tmDepth=i,function(t,e,i){var n=t[v]={},o=f.parentNode;if(o&&(!l||"drillDown"===l.direction)){var a=0,r=0,s=u.background[o.getRawIndex()];!l&&s&&s.old&&(a=s.old.width,r=s.old.height),n.old="nodeGroup"===i?[0,r]:{x:a,y:r,width:0,height:0}}n.fadein="nodeGroup"!==i}(a,0,o.__tmStorageName=t)),r[t][v]=o}}Mf({type:"treemap",init:function(t,e){this._containerGroup,this._storage={nodeGroup:[],background:[],content:[]},this._oldTree,this._breadcrumb,this._controller,this._state="ready"},render:function(t,e,i,n){if(!(_(e.findComponents({mainType:"series",subType:"treemap",query:n}),t)<0)){this.seriesModel=t,this.api=i,this.ecModel=e;var o=Ox(n,["treemapZoomToNode","treemapRootToNode"],t),a=n&&n.type,r=t.layoutInfo,s=!this._oldTree,l=this._storage,u="treemapRootToNode"===a&&o&&l?{rootNodeGroup:l.nodeGroup[o.node.getRawIndex()],direction:n.direction}:null,h=this._giveContainerGroup(r),c=this._doRender(h,t,u);s||a&&"treemapZoomToNode"!==a&&"treemapRootToNode"!==a?c.renderFinally():this._doAnimation(h,c,t,u),this._resetController(i),this._renderBreadcrumb(t,i,o)}},_giveContainerGroup:function(t){var e=this._containerGroup;return e||(e=this._containerGroup=new Hx,this._initEvents(e),this.group.add(e)),e.attr("position",[t.x,t.y]),e},_doRender:function(t,e,i){var n=e.getData().tree,o=this._oldTree,a={nodeGroup:[],background:[],content:[]},r={nodeGroup:[],background:[],content:[]},s=this._storage,l=[],c=T(Jx,e,r,s,i,a,l);!function a(r,s,l,u,h){u?Ux(s=r,function(t,e){t.isRemoved()||i(e,e)}):new Tf(s,r,t,t).add(i).update(i).remove(T(i,null)).execute();function t(t){return t.getId()}function i(t,e){var i=null!=t?r[t]:null,n=null!=e?s[e]:null,o=c(i,n,l,h);o&&a(i&&i.viewChildren||[],n&&n.viewChildren||[],o,u,h+1)}}(n.root?[n.root]:[],o&&o.root?[o.root]:[],t,n===o||!o,0);var u,h,d=(h={nodeGroup:[],background:[],content:[]},(u=s)&&Ux(u,function(t,e){var i=h[e];Ux(t,function(t){t&&(i.push(t),t.__tmWillDelete=1)})}),h);return this._oldTree=n,this._storage=r,{lastsForAnimation:a,willDeleteEls:d,renderFinally:function(){Ux(d,function(t){Ux(t,function(t){t.parent&&t.parent.remove(t)})}),Ux(l,function(t){t.invisible=!0,t.dirty()})}}},_doAnimation:function(t,a,e,s){if(e.get("animation")){var l=e.get("animationDurationUpdate"),u=e.get("animationEasing"),h=function(){var a,r=[],s={};return{add:function(t,e,i,n,o){return z(n)&&(o=n,n=0),!s[t.id]&&(s[t.id]=1,r.push({el:t,target:e,time:i,delay:n,easing:o}),!0)},done:function(t){return a=t,this},start:function(){for(var t=r.length,e=0,i=r.length;e=r.length||t===r[t.depth]){var i=T_(l,c,t,e,y,s);n(t,i,o,a,r,s)}})}else p=b_(c),t.setVisual("color",p)}(a,{},N(o.levelModels,function(t){return t?t.get(x_):null}),r,t.getViewRoot().getAncestors(),t)}};function w_(i,n,o,a){var r=L({},n);return E(["color","colorAlpha","colorSaturation"],function(t){var e=i.get(t,!0);null==e&&o&&(e=o[t]),null==e&&(e=n[t]),null==e&&(e=a.get(t)),null!=e&&(r[t]=e)}),r}function b_(t){var e=S_(t,"color");if(e){var i=S_(t,"colorAlpha"),n=S_(t,"colorSaturation");return n&&(e=Ue(e,null,null,n)),i&&(e=Xe(e,i)),e}}function S_(t,e){var i=t[e];if(null!=i&&"none"!==i)return i}function M_(t,e,i,n,o,a){if(a&&a.length){var r=I_(e,"color")||null!=o.color&&"none"!==o.color&&(I_(e,"colorAlpha")||I_(e,"colorSaturation"));if(r){var s=e.get("visualMin"),l=e.get("visualMax"),u=i.dataExtent.slice();null!=s&&su[1]&&(u[1]=l);var h=e.get("colorMappingBy"),c={type:r.name,dataExtent:u,visual:r.range};"color"!==c.type||"index"!==h&&"id"!==h?c.mappingMethod="linear":(c.mappingMethod="category",c.loop=!0);var d=new a_(c);return d.__drColorMappingBy=h,d}}}function I_(t,e){var i=t.get(e);return y_(i)&&i.length?{name:e,range:i}:null}function T_(t,e,i,n,o,a){var r=L({},e);if(o){var s=o.type,l="color"===s&&o.__drColorMappingBy,u="index"===l?n:"id"===l?a.mapIdToIndex(i.getId()):i.getValue(t.get("visualDimension"));r[s]=o.mapValueToVisual(u)}return r}var A_=Math.max,D_=Math.min,C_=W,L_=E,k_=["itemStyle","borderWidth"],P_=["itemStyle","gapWidth"],N_=["upperLabel","show"],O_=["upperLabel","height"],E_={seriesType:"treemap",reset:function(t,e,i,n){var o=i.getWidth(),a=i.getHeight(),r=t.option,s=vu(t.getBoxLayoutParams(),{width:i.getWidth(),height:i.getHeight()}),l=r.size||[],u=Pl(C_(s.width,l[0]),o),h=Pl(C_(s.height,l[1]),a),c=n&&n.type,d=Ox(n,["treemapZoomToNode","treemapRootToNode"],t),f="treemapRender"===c||"treemapMove"===c?n.rootRect:null,p=t.getViewRoot(),g=Ex(p);if("treemapMove"!==c){var m="treemapZoomToNode"===c?function(t,e,i,n,o){var a,r=(e||{}).node,s=[n,o];if(!r||r===i)return s;var l=n*o,u=l*t.option.zoomToNodeRatio;for(;a=r.parentNode;){for(var h=0,c=a.children,d=0,f=c.length;ds[1]&&(s[1]=e)})}else s=[NaN,NaN];return{sum:n,dataExtent:s}}(e,r,s);if(0===u.sum)return t.viewChildren=[];if(u.sum=function(t,e,i,n,o){if(!n)return i;for(var a=t.get("visibleMin"),r=o.length,s=r,l=r-1;0<=l;l--){var u=o["asc"===n?r-l-1:l].getValue();u/i*ei[l[r]])&&(h=i[l[r]]);for(var c=0,d=t.length;c "+d)),u++)}var f,p=i.get("coordinateSystem");if("cartesian2d"===p||"polar"===p)f=hp(t,i);else{var g=nh.get(p),m=g&&"view"!==g.type&&g.dimensions||[];_(m,"value")<0&&m.concat(["value"]);var v=np(t,{coordDimensions:m});(f=new Wf(v,i)).initData(t)}var y=new Wf(["value"],i);return y.initData(l,s),o&&o(f,y),ux({mainData:f,struct:a,structAttr:"graph",datas:{node:f,edge:y},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}var Y_=Sf({type:"series.graph",init:function(t){Y_.superApply(this,"init",arguments);var e=this;function i(){return e._categoriesData}this.legendVisualProvider=new Gv(i,i),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},mergeOption:function(t){Y_.superApply(this,"mergeOption",arguments),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},mergeDefaultAndTheme:function(t){Y_.superApply(this,"mergeDefaultAndTheme",arguments),zo(t,["edgeLabel"],["show"])},getInitialData:function(t,s){var e=t.edges||t.links||[],i=t.data||t.nodes||[],l=this;if(i&&e)return X_(i,e,this,!0,function(t,e){t.wrapMethod("getItemModel",function(t){var e=l._categoriesModels[t.getShallow("category")];return e&&(e.parentModel=t.parentModel,t.parentModel=e),t});var i=l.getModel("edgeLabel"),n=new Il({label:i.option},i.parentModel,s),o=l.getModel("emphasis.edgeLabel"),a=new Il({emphasis:{label:o.option}},o.parentModel,s);function r(t){return(t=this.parsePath(t))&&"label"===t[0]?n:t&&"emphasis"===t[0]&&"label"===t[1]?a:this.parentModel}e.wrapMethod("getItemModel",function(t){return t.customizeGetParent(r),t})}).data},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},getCategoriesData:function(){return this._categoriesData},formatTooltip:function(t,e,i){if("edge"!==i)return Y_.superApply(this,"formatTooltip",arguments);var n=this.getData(),o=this.getDataParams(t,i),a=n.graph.getEdgeByIndex(t),r=n.getName(a.node1.dataIndex),s=n.getName(a.node2.dataIndex),l=[];return null!=r&&l.push(r),null!=s&&l.push(s),l=eu(l.join(" > ")),o.value&&(l+=" : "+eu(o.value)),l},_updateCategoriesData:function(){var t=N(this.option.categories||[],function(t){return null!=t.value?t:L({value:0},t)}),e=new Wf(["value"],this);e.initData(t),this._categoriesData=e,this._categoriesModels=e.mapArray(function(t){return e.getItemModel(t,!0)})},setZoom:function(t){this.option.zoom=t},setCenter:function(t){this.option.center=t},isAnimationEnabled:function(){return Y_.superCall(this,"isAnimationEnabled")&&!("force"===this.get("layout")&&this.get("force.layoutAnimation"))},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",legendHoverLink:!0,hoverAnimation:!0,layout:null,focusNodeAdjacency:!1,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle"},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,curveness:0,opacity:.5},emphasis:{label:{show:!0}}}}),j_=os.prototype,q_=ls.prototype;function K_(t){return isNaN(+t.cpx1)||isNaN(+t.cpy1)}var $_=Is({type:"ec-line",style:{stroke:"#000",fill:null},shape:{x1:0,y1:0,x2:0,y2:0,percent:1,cpx1:null,cpy1:null},buildPath:function(t,e){this[K_(e)?"_buildPathLine":"_buildPathCurve"](t,e)},_buildPathLine:j_.buildPath,_buildPathCurve:q_.buildPath,pointAt:function(t){return this[K_(this.shape)?"_pointAtLine":"_pointAtCurve"](t)},_pointAtLine:j_.pointAt,_pointAtCurve:q_.pointAt,tangentAt:function(t){var e=this.shape,i=K_(e)?[e.x2-e.x1,e.y2-e.y1]:this._tangentAtCurve(t);return mt(i,i)},_tangentAtCurve:q_.tangentAt}),J_=["fromSymbol","toSymbol"];function Q_(t){return"_"+t+"Type"}function tw(t,e,i){var n=e.getItemVisual(i,"color"),o=e.getItemVisual(i,t),a=e.getItemVisual(i,t+"Size");if(o&&"none"!==o){k(a)||(a=[a,a]);var r=mg(o,-a[0]/2,-a[1]/2,a[0],a[1],n);return r.name=t,r}}function ew(t,e){t.x1=e[0][0],t.y1=e[0][1],t.x2=e[1][0],t.y2=e[1][1],t.percent=1;var i=e[2];i?(t.cpx1=i[0],t.cpy1=i[1]):(t.cpx1=NaN,t.cpy1=NaN)}function iw(t,e,i){Ii.call(this),this._createLine(t,e,i)}var nw=iw.prototype;function ow(t){this._ctor=t||iw,this.group=new Ii}nw.beforeUpdate=function(){var t=this.childOfName("fromSymbol"),e=this.childOfName("toSymbol"),i=this.childOfName("label");if(t||e||!i.ignore){for(var n=1,o=this.parent;o;)o.scale&&(n/=o.scale[0]),o=o.parent;var a=this.childOfName("line");if(this.__dirty||a.__dirty){var r=a.shape.percent,s=a.pointAt(0),l=a.pointAt(r),u=ht([],l,s);if(mt(u,u),t){t.attr("position",s);var h=a.tangentAt(0);t.attr("rotation",Math.PI/2-Math.atan2(h[1],h[0])),t.attr("scale",[n*r,n*r])}if(e){e.attr("position",l);h=a.tangentAt(1);e.attr("rotation",-Math.PI/2-Math.atan2(h[1],h[0])),e.attr("scale",[n*r,n*r])}if(!i.ignore){var c,d,f;i.attr("position",l);var p=5*n;if("end"===i.__position)c=[u[0]*p+l[0],u[1]*p+l[1]],d=.8=t&&(0===e?0:n[e-1][0])a&&(e[1-n]=e[n]+c.sign*a),e}function Hw(t,e){var i=t[e]-t[1-e];return{span:Math.abs(i),sign:0o*(1-h[0])?(l="jump",r=s-o*(1-h[2])):0<=(r=s-o*h[1])&&(r=s-o*(1-h[1]))<=0&&(r=0),(r*=e.axisExpandWidth/u)?Ww(r,n,a,"all"):l="none";else{o=n[1]-n[0];(n=[Yw(0,a[1]*s/o-o/2)])[1]=Xw(a[1],n[0]+o),n[0]=n[1]-o}return{axisExpandWindow:n,behavior:l}}},nh.register("parallel",{create:function(n,o){var a=[];return n.eachComponent("parallel",function(t,e){var i=new Jw(t,n,o);i.name="parallel_"+e,i.resize(t,o),(t.coordinateSystem=i).model=t,a.push(i)}),n.eachSeries(function(t){if("parallel"===t.get("coordinateSystem")){var e=n.queryComponents({mainType:"parallel",index:t.get("parallelIndex"),id:t.get("parallelId")})[0];t.coordinateSystem=e.coordinateSystem}}),a}});var tb=Tu.extend({type:"baseParallelAxis",axis:null,activeIntervals:[],getAreaSelectStyle:function(){return ra([["fill","color"],["lineWidth","borderWidth"],["stroke","borderColor"],["width","width"],["opacity","opacity"]])(this.getModel("areaSelectStyle"))},setActiveIntervals:function(t){var e=this.activeIntervals=D(t);if(e)for(var i=e.length-1;0<=i;i--)Ol(e[i])},getActiveState:function(t){var e=this.activeIntervals;if(!e.length)return"normal";if(null==t||isNaN(t))return"inactive";if(1===e.length){var i=e[0];if(i[0]<=t&&t<=i[1])return"active"}else for(var n=0,o=e.length;nn.getWidth()||i<0||i>n.getHeight()}(t,e)){var n=t._zr,o=t._covers,a=bb(t,e,i);if(!t._dragging)for(var r=0;rf&&(f=m.depth),g.setLayout({depth:v?m.depth:c},!0),"vertical"===a?g.setLayout({dy:i},!0):g.setLayout({dx:i},!0);for(var y=0;y "))},preventIncremental:function(){return!!this.get("effect.show")},getProgressive:function(){var t=this.option.progressive;return null==t?this.option.large?1e4:this.get("progressive"):t},getProgressiveThreshold:function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?2e4:this.get("progressiveThreshold"):t},defaultOption:{coordinateSystem:"geo",zlevel:0,z:2,legendHoverLink:!0,hoverAnimation:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}}});function QS(t,e,i){Ii.call(this),this.add(this.createLine(t,e,i)),this._updateEffectSymbol(t,e)}var tM=QS.prototype;function eM(t,e,i){Ii.call(this),this._createPolyline(t,e,i)}tM.createLine=function(t,e,i){return new iw(t,e,i)},tM._updateEffectSymbol=function(t,e){var i=t.getItemModel(e).getModel("effect"),n=i.get("symbolSize"),o=i.get("symbol");k(n)||(n=[n,n]);var a=i.get("color")||t.getItemVisual(e,"color"),r=this.childAt(1);this._symbolType!==o&&(this.remove(r),(r=mg(o,-.5,-.5,1,1,a)).z2=100,r.culling=!0,this.add(r)),r&&(r.setStyle("shadowColor",a),r.setStyle(i.getItemStyle(["color"])),r.attr("scale",n),r.setColor(a),r.attr("scale",n),this._symbolType=o,this._updateEffectAnimation(t,i,e))},tM._updateEffectAnimation=function(e,t,i){var n=this.childAt(1);if(n){var o=this,a=e.getItemLayout(i),r=1e3*t.get("period"),s=t.get("loop"),l=t.get("constantSpeed"),u=W(t.get("delay"),function(t){return t/e.count()*r/3}),h="function"==typeof u;if(n.ignore=!0,this.updateAnimationPoints(n,a),0e);r++);r=Math.min(r-1,o-2)}wt(t.position,i[r],i[r+1],(e-n[r])/(n[r+1]-n[r]));var s=i[r+1][0]-i[r][0],l=i[r+1][1]-i[r][1];t.rotation=-Math.atan2(l,s)-Math.PI/2,this._lastFrame=r,this._lastFramePercent=e,t.ignore=!1}},w(nM,QS);var aM=Is({shape:{polyline:!1,curveness:0,segs:[]},buildPath:function(t,e){var i=e.segs,n=e.curveness;if(e.polyline)for(var o=0;o=e[0]&&t<=e[1]}}(y,e.option.range):function(e,n,o){var i=e[1]-e[0],a=(n=N(n,function(t){return{interval:[(t.interval[0]-e[0])/i,(t.interval[1]-e[0])/i]}})).length,r=0;return function(t){for(var e=r;e=e.y&&t[1]<=e.y+e.height:i.contain(i.toLocalCoord(t[1]))&&t[0]>=e.y&&t[0]<=e.y+e.height},pointToData:function(t){var e=this.getAxis();return[e.coordToData(e.toLocalCoord(t["horizontal"===e.orient?0:1]))]},dataToPoint:function(t){var e=this.getAxis(),i=this.getRect(),n=[],o="horizontal"===e.orient?0:1;return t instanceof Array&&(t=t[0]),n[o]=e.toGlobalCoord(e.dataToCoord(+t)),n[1-o]=0==o?i.y+i.height/2:i.x+i.width/2,n}}).dimensions});var BM=["axisLine","axisTickLabel","axisName"],VM="splitLine",GM=hv.extend({type:"singleAxis",axisPointerClass:"SingleAxisPointer",render:function(t,e,i,n){var o=this.group;o.removeAll();var a=RM(t),r=new Ym(t,a);E(BM,r.add,r),o.add(r.getGroup()),t.get(VM+".show")&&this["_"+VM](t),GM.superCall(this,"render",t,e,i,n)},_splitLine:function(t){var e=t.axis;if(!e.scale.isBlank()){var i=t.getModel("splitLine"),n=i.getModel("lineStyle"),o=n.get("width"),a=n.get("color");a=a instanceof Array?a:[a];for(var r=t.coordinateSystem.getRect(),s=e.isHorizontal(),l=[],u=0,h=e.getTicksCoords({tickModel:i}),c=[],d=[],f=0;fr)return!0;if(a){var s=sv(t).seriesDataCount,l=n.getExtent();return Math.abs(l[0]-l[1])/s>r}return!1},makeElOption:function(t,e,i,n,o){},createPointerEl:function(t,e,i,n){var o=e.pointer;if(o){var a=oI(t).pointerEl=new yl[o.type](aI(e.pointer));t.add(a)}},createLabelEl:function(t,e,i,n){if(e.label){var o=oI(t).labelEl=new is(aI(e.label));t.add(o),uI(o,n)}},updatePointerEl:function(t,e,i){var n=oI(t).pointerEl;n&&e.pointer&&(n.setStyle(e.pointer.style),i(n,{shape:e.pointer.shape}))},updateLabelEl:function(t,e,i,n){var o=oI(t).labelEl;o&&(o.setStyle(e.label.style),i(o,{shape:e.label.shape,position:e.label.position}),uI(o,n))},_renderHandle:function(t){if(!this._dragging&&this.updateHandleTransform){var e,i=this._axisPointerModel,n=this._api.getZr(),o=this._handle,a=i.getModel("handle"),r=i.get("status");if(!a.get("show")||!r||"hide"===r)return o&&n.remove(o),void(this._handle=null);this._handle||(e=!0,o=this._handle=pl(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(t){Wt(t.event)},onmousedown:rI(this._onHandleDragMove,this,0,0),drift:rI(this._onHandleDragMove,this),ondragend:rI(this._onHandleDragEnd,this)}),n.add(o)),cI(o,i,!1);o.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=a.get("size");k(s)||(s=[s,s]),o.attr("scale",[s[0]/2,s[1]/2]),Tc(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,e)}},_moveHandleToValue:function(t,e){lI(this._axisPointerModel,!e&&this._moveAnimation,this._handle,hI(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},_onHandleDragMove:function(t,e){var i=this._handle;if(i){this._dragging=!0;var n=this.updateHandleTransform(hI(i),[t,e],this._axisModel,this._axisPointerModel);this._payloadInfo=n,i.stopAnimation(),i.attr(hI(n)),oI(i).lastProp=null,this._doDispatchAxisPointer()}},_doDispatchAxisPointer:function(){if(this._handle){var t=this._payloadInfo,e=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:e.axis.dim,axisIndex:e.componentIndex}]})}},_onHandleDragEnd:function(t){if(this._dragging=!1,this._handle){var e=this._axisPointerModel.get("value");this._moveHandleToValue(e),this._api.dispatchAction({type:"hideTip"})}},getHandleTransform:null,updateHandleTransform:null,clear:function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),i=this._group,n=this._handle;e&&i&&(this._lastGraphicKey=null,i&&e.remove(i),n&&e.remove(n),this._group=null,this._handle=null,this._payloadInfo=null)},doClear:function(){},buildLabel:function(t,e,i){return{x:t[i=i||0],y:t[1-i],width:e[i],height:e[1-i]}}}).constructor=sI);var _I=sI.extend({makeElOption:function(t,e,i,n,o){var a=i.axis,r=a.grid,s=n.get("type"),l=wI(r,a).getOtherAxis(a).getGlobalExtent(),u=a.toGlobalCoord(a.dataToCoord(e,!0));if(s&&"none"!==s){var h=dI(n),c=bI[s](a,u,l);c.style=h,t.graphicKey=c.type,t.pointer=c}mI(e,t,pv(r.model,i),i,n,o)},getHandleTransform:function(t,e,i){var n=pv(e.axis.grid.model,e,{labelInside:!1});return n.labelMargin=i.get("handle.margin"),{position:gI(e.axis,t,n),rotation:n.rotation+(n.labelDirection<0?Math.PI:0)}},updateHandleTransform:function(t,e,i,n){var o=i.axis,a=o.grid,r=o.getGlobalExtent(!0),s=wI(a,o).getOtherAxis(o).getGlobalExtent(),l="x"===o.dim?0:1,u=t.position;u[l]+=e[l],u[l]=Math.min(r[1],u[l]),u[l]=Math.max(r[0],u[l]);var h=(s[1]+s[0])/2,c=[h,h];c[l]=u[l];return{position:u,rotation:t.rotation,cursorPoint:c,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][l]}}});function wI(t,e){var i={};return i[e.dim+"AxisIndex"]=e.index,t.getCartesian(i)}var bI={line:function(t,e,i){return{type:"Line",subPixelOptimize:!0,shape:vI([e,i[0]],[e,i[1]],SI(t))}},shadow:function(t,e,i){var n=Math.max(1,t.getBandWidth()),o=i[1]-i[0];return{type:"Rect",shape:yI([e-n/2,i[0]],[n,o],SI(t))}}};function SI(t){return"x"===t.dim?0:1}hv.registerAxisPointerClass("CartesianAxisPointer",_I),ff(function(t){if(t){t.axisPointer&&0!==t.axisPointer.length||(t.axisPointer={});var e=t.axisPointer.link;e&&!k(e)&&(t.axisPointer.link=[e])}}),pf(Id.PROCESSOR.STATISTIC,function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=av(t,e)}),gf({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},function(t,e,i){var n=t.currTrigger,r=[t.x,t.y],o=t,a=t.dispatchAction||A(i.dispatchAction,i),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){KM(r)&&(r=WM({seriesIndex:o.seriesIndex,dataIndex:o.dataIndex},e).point);var l=KM(r),u=o.axesInfo,h=s.axesInfo,c="leave"===n||KM(r),d={},f={},p={list:[],map:{}},g={showPointer:ZM(YM,f),showTooltip:ZM(jM,p)};HM(s.coordSysMap,function(t,e){var a=l||t.containPoint(r);HM(s.coordSysAxesInfo[e],function(t,e){var i=t.axis,n=function(t,e){for(var i=0;i<(t||[]).length;i++){var n=t[i];if(e.axis.dim===n.axisDim&&e.axis.model.componentIndex===n.axisIndex)return n}}(u,t);if(!c&&a&&(!u||n)){var o=n&&n.value;null!=o||l||(o=i.pointToData(r)),null!=o&&XM(t,o,g,!1,d)}})});var m={};return HM(h,function(o,t){var a=o.linkGroup;a&&!f[t]&&HM(a.axesInfo,function(t,e){var i=f[e];if(t!==o&&i){var n=i.value;a.mapper&&(n=o.axis.scale.parse(a.mapper(n,qM(t),qM(o)))),m[o.key]=n}})}),HM(m,function(t,e){XM(h[e],t,g,!0,d)}),function(o,t,e){var a=e.axesInfo=[];HM(t,function(t,e){var i=t.axisPointerModel.option,n=o[e];n?(t.useHandle||(i.status="show"),i.value=n.value,i.seriesDataIndices=(n.payloadBatch||[]).slice()):t.useHandle||(i.status="hide"),"show"===i.status&&a.push({axisDim:t.axis.dim,axisIndex:t.axis.model.componentIndex,value:i.value})})}(f,h,d),function(t,e,i,n){if(KM(e)||!t.list.length)return n({type:"hideTip"});var o=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};n({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:i.tooltipOption,position:i.position,dataIndexInside:o.dataIndexInside,dataIndex:o.dataIndex,seriesIndex:o.seriesIndex,dataByCoordSys:t.list})}(p,r,t,a),function(t,e,i){var n=i.getZr(),o="axisPointerLastHighlights",a=UM(n)[o]||{},r=UM(n)[o]={};HM(t,function(t,e){var i=t.axisPointerModel.option;"show"===i.status&&HM(i.seriesDataIndices,function(t){var e=t.seriesIndex+" | "+t.dataIndex;r[e]=t})});var s=[],l=[];E(a,function(t,e){r[e]||l.push(t)}),E(r,function(t,e){a[e]||s.push(t)}),l.length&&i.dispatchAction({type:"downplay",escapeConnect:!0,batch:l}),s.length&&i.dispatchAction({type:"highlight",escapeConnect:!0,batch:s})}(h,0,i),d}});var MI=["x","y"],II=["width","height"],TI=sI.extend({makeElOption:function(t,e,i,n,o){var a=i.axis,r=a.coordinateSystem,s=CI(r,1-DI(a)),l=r.dataToPoint(e)[0],u=n.get("type");if(u&&"none"!==u){var h=dI(n),c=AI[u](a,l,s);c.style=h,t.graphicKey=c.type,t.pointer=c}mI(e,t,RM(i),i,n,o)},getHandleTransform:function(t,e,i){var n=RM(e,{labelInside:!1});return n.labelMargin=i.get("handle.margin"),{position:gI(e.axis,t,n),rotation:n.rotation+(n.labelDirection<0?Math.PI:0)}},updateHandleTransform:function(t,e,i,n){var o=i.axis,a=o.coordinateSystem,r=DI(o),s=CI(a,r),l=t.position;l[r]+=e[r],l[r]=Math.min(s[1],l[r]),l[r]=Math.max(s[0],l[r]);var u=CI(a,1-r),h=(u[1]+u[0])/2,c=[h,h];return c[r]=l[r],{position:l,rotation:t.rotation,cursorPoint:c,tooltipOption:{verticalAlign:"middle"}}}}),AI={line:function(t,e,i){return{type:"Line",subPixelOptimize:!0,shape:vI([e,i[0]],[e,i[1]],DI(t))}},shadow:function(t,e,i){var n=t.getBandWidth(),o=i[1]-i[0];return{type:"Rect",shape:yI([e-n/2,i[0]],[n,o],DI(t))}}};function DI(t){return t.isHorizontal()?0:1}function CI(t,e){var i=t.getRect();return[i[MI[e]],i[MI[e]]+i[II[e]]]}hv.registerAxisPointerClass("SingleAxisPointer",TI),bf({type:"single"});var LI=ic.extend({type:"series.themeRiver",dependencies:["singleAxis"],nameMap:null,init:function(t){LI.superApply(this,"init",arguments),this.legendVisualProvider=new Gv(A(this.getData,this),A(this.getRawData,this))},fixData:function(t){var e=t.length,i=Ko(t,function(t){return t[2]}),n=[];i.buckets.each(function(t,e){n.push({name:e,dataList:t})});for(var o=n.length,a=-1,r=-1,s=0;sMath.PI/2?"right":"left"):y&&"center"!==y?"left"===y?(d=l.r0+v,f>Math.PI/2&&(y="right")):"right"===y&&(d=l.r-v,f>Math.PI/2&&(y="left")):(d=(l.r+l.r0)/2,y="center"),c.attr("style",{text:s,textAlign:y,textVerticalAlign:S("verticalAlign")||"middle",opacity:S("opacity")});var x=d*p+l.cx,_=d*g+l.cy;c.attr("position",[x,_]);var w=S("rotate"),b=0;function S(t){var e=a.get(t);return null==e?o.get(t):e}"radial"===w?(b=-f)<-Math.PI/2&&(b+=Math.PI):"tangential"===w?(b=Math.PI/2-f)>Math.PI/2?b-=Math.PI:b<-Math.PI/2&&(b+=Math.PI):"number"==typeof w&&(b=w*Math.PI/180),c.attr("rotation",b)},BI._initEvents=function(t,e,i,n){t.off("mouseover").off("mouseout").off("emphasis").off("normal");function o(){r.onEmphasis(n)}function a(){r.onNormal()}var r=this;i.isAnimationEnabled()&&t.on("mouseover",o).on("mouseout",a).on("emphasis",o).on("normal",a).on("downplay",function(){r.onDownplay()}).on("highlight",function(){r.onHighlight()})},w(RI,Ii);gc.extend({type:"sunburst",init:function(){},render:function(o,a,t,e){var n=this;this.seriesModel=o,this.api=t,this.ecModel=a;var r=o.getData(),s=r.tree.root,i=o.getViewRoot(),l=this.group,u=o.get("renderLabelForZeroData"),h=[];i.eachNode(function(t){h.push(t)});var c=this._oldChildren||[];if(function(i,n){if(0===i.length&&0===n.length)return;function t(t){return t.getId()}function e(t,e){!function(t,e){u||!t||t.getValue()||(t=null);if(t!==s&&e!==s)if(e&&e.piece)t?(e.piece.updateData(!1,t,"normal",o,a),r.setItemGraphicEl(t.dataIndex,e.piece)):function(t){if(!t)return;t.piece&&(l.remove(t.piece),t.piece=null)}(e);else if(t){var i=new RI(t,o,a);l.add(i),r.setItemGraphicEl(t.dataIndex,i)}}(null==t?null:i[t],null==e?null:n[e])}new Tf(n,i,t,t).add(e).update(e).remove(T(e,null)).execute()}(h,c),function(t,e){if(0=i.r0}}});var VI="sunburstRootToNode";gf({type:VI,update:"updateView"},function(o,t){t.eachComponent({mainType:"series",subType:"sunburst",query:o},function(t,e){var i=Ox(o,[VI],t);if(i){var n=t.getViewRoot();n&&(o.direction=zx(n,i.node)?"rollUp":"drillDown"),t.resetViewRoot(i.node)}})});var GI="sunburstHighlight";gf({type:GI,update:"updateView"},function(n,t){t.eachComponent({mainType:"series",subType:"sunburst",query:n},function(t,e){var i=Ox(n,[GI],t);i&&(n.highlight=i.node)})});gf({type:"sunburstUnhighlight",update:"updateView"},function(i,t){t.eachComponent({mainType:"series",subType:"sunburst",query:i},function(t,e){i.unhighlight=!0})});var FI=Math.PI/180;function WI(t,e){if("function"==typeof e)return t.sort(e);var n="asc"===e;return t.sort(function(t,e){var i=(t.getValue()-e.getValue())*(n?1:-1);return 0==i?(t.dataIndex-e.dataIndex)*(n?-1:1):i})}function HI(a,r){return r=r||[0,0],N(["x","y"],function(t,e){var i=this.getAxis(t),n=r[e],o=a[e]/2;return"category"===i.type?i.getBandWidth():Math.abs(i.dataToCoord(n-o)-i.dataToCoord(n+o))},this)}yf(T(Yv,"sunburst")),vf(T(function(t,e,C,i){e.eachSeriesByType(t,function(t){var e=t.get("center"),i=t.get("radius");k(i)||(i=[0,i]),k(e)||(e=[e,e]);var n=C.getWidth(),o=C.getHeight(),h=Math.min(n,o),c=Pl(e[0],n),d=Pl(e[1],o),f=Pl(i[0],h/2),a=Pl(i[1],h/2),r=-t.get("startAngle")*FI,p=t.get("minAngle")*FI,g=t.getData().tree.root,s=t.getViewRoot(),m=s.depth,l=t.get("sort");null!=l&&!function e(t,i){var n=t.children||[];t.children=WI(n,i);n.length&&E(t.children,function(t){e(t,i)})}(s,l);var u=0;E(s.children,function(t){isNaN(t.getValue())||u++});var v=s.getValue(),y=Math.PI/(v||u)*2,x=0t[1]&&t.reverse(),{coordSys:{type:"polar",cx:o.cx,cy:o.cy,r:t[1],r0:t[0]},api:{coord:A(function(t){var e=a.dataToRadius(t[0]),i=r.dataToAngle(t[1]),n=o.coordToPoint([e,i]);return n.push(e,i*Math.PI/180),n}),size:A(XI,o)}}},calendar:function(i){var t=i.getRect(),e=i.getRangeInfo();return{coordSys:{type:"calendar",x:t.x,y:t.y,width:t.width,height:t.height,cellWidth:i.getCellWidth(),cellHeight:i.getCellHeight(),rangeInfo:{start:e.start,end:e.end,weeks:e.weeks,dayCount:e.allDay}},api:{coord:function(t,e){return i.dataToPoint(t,e)}}}}};function tT(t,e,i,n,o){null==i[t]||o||(e[t]=i[t],i[t]=n[t])}function eT(a,r,e,t){var i=a.get("renderItem"),n=a.coordinateSystem,o={};n&&(o=n.prepareCustoms?n.prepareCustoms():QI[n.type](n));var s,l,u,h,c,d=C({getWidth:t.getWidth,getHeight:t.getHeight,getZr:t.getZr,getDevicePixelRatio:t.getDevicePixelRatio,value:function(t,e){return null==e&&(e=s),r.get(r.getDimension(t||0),e)},style:function(t,e){null==e&&(e=s),g(e);var i=l.getModel(jI).getItemStyle();null!=c&&(i.fill=c);var n=r.getItemVisual(e,"opacity");null!=n&&(i.opacity=n);var o=t?rT(t,u):u;return Qs(i,o,null,{autoColor:c,isRectText:!0}),i.text=o.getShallow("show")?H(a.getFormattedLabel(e,"normal"),Gg(r,e)):null,t&&sT(i,t),i},styleEmphasis:function(t,e){null==e&&(e=s),g(e);var i=l.getModel(qI).getItemStyle(),n=t?rT(t,h):h;return Qs(i,n,null,{isRectText:!0},!0),i.text=n.getShallow("show")?Z(a.getFormattedLabel(e,"emphasis"),a.getFormattedLabel(e,"normal"),Gg(r,e)):null,t&&sT(i,t),i},visual:function(t,e){return null==e&&(e=s),r.getItemVisual(e,t)},barLayout:function(t){if(n.getBaseAxis){return function(t){var e=[],i=t.axis;if("category"===i.type){for(var n=i.getBandWidth(),o=0;oe[1]&&e.reverse();var i=t.getExtent(),n=Math.PI/180;return{cx:this.cx,cy:this.cy,r0:e[0],r:e[1],startAngle:-i[0]*n,endAngle:-i[1]*n,clockwise:t.inverse,contain:function(t,e){var i=t-this.cx,n=e-this.cy,o=i*i+n*n,a=this.r,r=this.r0;return o<=a*a&&r*r<=o}}}};var vT=Tu.extend({type:"polarAxis",axis:null,getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"polar",index:this.option.polarIndex,id:this.option.polarId})[0]}});m(vT.prototype,sg);var yT={splitNumber:5};function xT(t,e){return e.type||(e.data?"category":"value")}function _T(t,e){var i=this,n=i.getAngleAxis(),o=i.getRadiusAxis();if(n.scale.setExtent(1/0,-1/0),o.scale.setExtent(1/0,-1/0),t.eachSeries(function(t){if(t.coordinateSystem===i){var e=t.getData();E(e.mapDimension("radius",!0),function(t){o.scale.unionExtentFromData(e,up(e,t))}),E(e.mapDimension("angle",!0),function(t){n.scale.unionExtentFromData(e,up(e,t))})}}),eg(n.scale,n.model),eg(o.scale,o.model),"category"===n.type&&!n.onBand){var a=n.getExtent(),r=360/n.scale.count();n.inverse?a[1]+=r:a[1]-=r,n.setExtent(a[0],a[1])}}function wT(t,e){if(t.type=e.get("type"),t.scale=ig(e),t.onBand=e.get("boundaryGap")&&"category"===t.type,t.inverse=e.get("inverse"),"angleAxis"===e.mainType){t.inverse^=e.get("clockwise");var i=e.get("startAngle");t.setExtent(i,i+(t.inverse?-360:360))}(e.axis=t).model=e}Om("angle",vT,xT,{startAngle:90,clockwise:!0,splitNumber:12,axisLabel:{rotate:!1}}),Om("radius",vT,xT,yT),wf({type:"polar",dependencies:["polarAxis","angleAxis"],coordinateSystem:null,findAxisModel:function(t){var e;return this.ecModel.eachComponent(t,function(t){t.getCoordSysModel()===this&&(e=t)},this),e},defaultOption:{zlevel:0,z:0,center:["50%","50%"],radius:"80%"}}),nh.register("polar",{dimensions:mT.prototype.dimensions,create:function(i,s){var l=[];return i.eachComponent("polar",function(t,e){var i=new mT(e);i.update=_T;var n=i.getRadiusAxis(),o=i.getAngleAxis(),a=t.findAxisModel("radiusAxis"),r=t.findAxisModel("angleAxis");wT(n,a),wT(o,r),function(t,e,i){var n=e.get("center"),o=i.getWidth(),a=i.getHeight();t.cx=Pl(n[0],o),t.cy=Pl(n[1],a);var r=t.getRadiusAxis(),s=Math.min(o,a)/2,l=e.get("radius");null==l?l=[0,"100%"]:k(l)||(l=[0,l]),l=[Pl(l[0],s),Pl(l[1],s)],r.inverse?r.setExtent(l[1],l[0]):r.setExtent(l[0],l[1])}(i,t,s),l.push(i),(t.coordinateSystem=i).model=t}),i.eachSeries(function(t){if("polar"===t.get("coordinateSystem")){var e=i.queryComponents({mainType:"polar",index:t.get("polarIndex"),id:t.get("polarId")})[0];t.coordinateSystem=e.coordinateSystem}}),l}});var bT=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function ST(t,e,i){e[1]>e[0]&&(e=e.slice().reverse());var n=t.coordToPoint([e[0],i]),o=t.coordToPoint([e[1],i]);return{x1:n[0],y1:n[1],x2:o[0],y2:o[1]}}function MT(t){return t.getRadiusAxis().inverse?0:1}function IT(t){var e=t[0],i=t[t.length-1];e&&i&&Math.abs(Math.abs(e.coord-i.coord)-360)<1e-4&&t.pop()}hv.extend({type:"angleAxis",axisPointerClass:"PolarAxisPointer",render:function(e,t){if(this.group.removeAll(),e.get("show")){var i=e.axis,n=i.polar,o=n.getRadiusAxis().getExtent(),a=i.getTicksCoords(),r=i.getMinorTicksCoords(),s=N(i.getViewLabels(),function(t){return(t=D(t)).coord=i.dataToCoord(t.tickValue),t});IT(s),IT(a),E(bT,function(t){!e.get(t+".show")||i.scale.isBlank()&&"axisLine"!==t||this["_"+t](e,n,a,r,o,s)},this)}},_axisLine:function(t,e,i,n,o){var a,r=t.getModel("axisLine.lineStyle"),s=MT(e),l=s?0:1;(a=0===o[l]?new Hr({shape:{cx:e.cx,cy:e.cy,r:o[s]},style:r.getLineStyle(),z2:1,silent:!0}):new Xr({shape:{cx:e.cx,cy:e.cy,r:o[s],r0:o[l]},style:r.getLineStyle(),z2:1,silent:!0})).style.fill=null,this.group.add(a)},_axisTick:function(t,e,i,n,o){var a=t.getModel("axisTick"),r=(a.get("inside")?-1:1)*a.get("length"),s=o[MT(e)],l=N(i,function(t){return new os({shape:ST(e,[s,s+r],t.coord)})});this.group.add(ks(l,{style:C(a.getModel("lineStyle").getLineStyle(),{stroke:t.get("axisLine.lineStyle.color")})}))},_minorTick:function(t,e,i,n,o){if(n.length){for(var a=t.getModel("axisTick"),r=t.getModel("minorTick"),s=(a.get("inside")?-1:1)*r.get("length"),l=o[MT(e)],u=[],h=0;hr?"left":"right",u=Math.abs(a[1]-s)/o<.3?"middle":a[1]>s?"top":"bottom";p&&p[n]&&p[n].textStyle&&(i=new Il(p[n].textStyle,g,g.ecModel));var h=new Fr({silent:Ym.isLabelSilent(c)});this.group.add(h),Qs(h.style,i,{x:a[0],y:a[1],textFill:i.getTextColor()||c.get("axisLine.lineStyle.color"),text:t.formattedLabel,textAlign:l,textVerticalAlign:u}),v&&(h.eventData=Ym.makeAxisEventDataBase(c),h.eventData.targetType="axisLabel",h.eventData.value=t.rawLabel)},this)},_splitLine:function(t,e,i,n,o){var a=t.getModel("splitLine").getModel("lineStyle"),r=a.get("color"),s=0;r=r instanceof Array?r:[r];for(var l=[],u=0;um?"left":"right",h=Math.abs(l[1]-v)/g<.3?"middle":l[1]>v?"top":"bottom"}return{position:l,align:u,verticalAlign:h}}(e,i,0,s,d))}});var CT={line:function(t,e,i,n,o){return"angle"===t.dim?{type:"Line",shape:vI(e.coordToPoint([n[0],i]),e.coordToPoint([n[1],i]))}:{type:"Circle",shape:{cx:e.cx,cy:e.cy,r:i}}},shadow:function(t,e,i,n,o){var a=Math.max(1,t.getBandWidth()),r=Math.PI/180;return"angle"===t.dim?{type:"Sector",shape:xI(e.cx,e.cy,n[0],n[1],(-i-a/2)*r,(a/2-i)*r)}:{type:"Sector",shape:xI(e.cx,e.cy,i-a/2,i+a/2,0,2*Math.PI)}}};function LT(n,t){t.update="updateView",gf(t,function(t,e){var i={};return e.eachComponent({mainType:"geo",query:t},function(e){e[n](t.name),E(e.coordinateSystem.regions,function(t){i[t.name]=e.isSelected(t.name)||!1})}),{selected:i,name:t.name}})}hv.registerAxisPointerClass("PolarAxisPointer",DT),vf(T(function(t,e,i){var N={},O=function(t){var g={};E(t,function(t,e){var i=t.getData(),n=t.coordinateSystem,o=n.getBaseAxis(),a=dT(n,o),r=o.getExtent(),s="category"===o.type?o.getBandWidth():Math.abs(r[1]-r[0])/i.count(),l=g[a]||{bandWidth:s,remainedWidth:s,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},u=l.stacks;g[a]=l;var h=cT(t);u[h]||l.autoWidthCount++,u[h]=u[h]||{width:0,maxWidth:0};var c=Pl(t.get("barWidth"),s),d=Pl(t.get("barMaxWidth"),s),f=t.get("barGap"),p=t.get("barCategoryGap");c&&!u[h].width&&(c=Math.min(l.remainedWidth,c),u[h].width=c,l.remainedWidth-=c),d&&(u[h].maxWidth=d),null!=f&&(l.gap=f),null!=p&&(l.categoryGap=p)});var d={};return E(g,function(t,i){d[i]={};var e=t.stacks,n=t.bandWidth,o=Pl(t.categoryGap,n),a=Pl(t.gap,1),r=t.remainedWidth,s=t.autoWidthCount,l=(r-o)/(s+(s-1)*a);l=Math.max(l,0),E(e,function(t,e){var i=t.maxWidth;i&&i=n.start.time&&i.timea.end.time&&t.reverse(),t},_getRangeInfo:function(t){var e;(t=[this.getDateInfo(t[0]),this.getDateInfo(t[1])])[0].time>t[1].time&&(e=!0,t.reverse());var i=Math.floor(t[1].time/864e5)-Math.floor(t[0].time/864e5)+1,n=new Date(t[0].time),o=n.getDate(),a=t[1].date.getDate();if(n.setDate(o+i-1),n.getDate()!==a)for(var r=0n.weeks||0===t&&en.lweek)return!1;var o=7*(t-1)-n.fweek+e,a=new Date(n.start.time);return a.setDate(n.start.d+o),this.getDateInfo(a)}},kT.dimensions=kT.prototype.dimensions,kT.getDimensionsInfo=kT.prototype.getDimensionsInfo,kT.create=function(i,n){var o=[];return i.eachComponent("calendar",function(t){var e=new kT(t,i,n);o.push(e),t.coordinateSystem=e}),i.eachSeries(function(t){"calendar"===t.get("coordinateSystem")&&(t.coordinateSystem=o[t.get("calendarIndex")||0])}),o},nh.register("calendar",kT);var NT=Tu.extend({type:"calendar",coordinateSystem:null,defaultOption:{zlevel:0,z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",nameMap:"en",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",nameMap:"en",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},init:function(t,e,i,n){var o=_u(t);NT.superApply(this,"init",arguments),OT(t,o)},mergeOption:function(t,e){NT.superApply(this,"mergeOption",arguments),OT(this.option,t)}});function OT(t,e){var i=t.cellSize;k(i)?1===i.length&&(i[1]=i[0]):i=t.cellSize=[i,i];var n=N([0,1],function(t){return function(t,e){return null!=t[pu[e][0]]||null!=t[pu[e][1]]&&null!=t[pu[e][2]]}(e,t)&&(i[t]="auto"),null!=i[t]&&"auto"!==i[t]});xu(t,e,{type:"box",ignoreSize:n})}var ET={EN:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],CN:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},zT={EN:["S","M","T","W","T","F","S"],CN:["日","一","二","三","四","五","六"]};bf({type:"calendar",_tlpoints:null,_blpoints:null,_firstDayOfMonth:null,_firstDayPoints:null,render:function(t,e,i){var n=this.group;n.removeAll();var o=t.coordinateSystem,a=o.getRangeInfo(),r=o.getOrient();this._renderDayRect(t,a,n),this._renderLines(t,a,r,n),this._renderYearText(t,a,r,n),this._renderMonthText(t,r,n),this._renderWeekText(t,a,r,n)},_renderDayRect:function(t,e,i){for(var n=t.coordinateSystem,o=t.getModel("itemStyle").getItemStyle(),a=n.getCellWidth(),r=n.getCellHeight(),s=e.start.time;s<=e.end.time;s=n.getNextNDay(s,1).time){var l=n.dataToRect([s],!1).tl,u=new is({shape:{x:l[0],y:l[1],width:a,height:r},cursor:"default",style:o});i.add(u)}},_renderLines:function(i,t,n,o){var a=this,r=i.coordinateSystem,s=i.getModel("splitLine.lineStyle").getLineStyle(),l=i.get("splitLine.show"),e=s.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var u=t.start,h=0;u.time<=t.end.time;h++){d(u.formatedDate),0===h&&(u=r.getDateInfo(t.start.y+"-"+t.start.m));var c=u.date;c.setMonth(c.getMonth()+1),u=r.getDateInfo(c)}function d(t){a._firstDayOfMonth.push(r.getDateInfo(t)),a._firstDayPoints.push(r.dataToRect([t],!1).tl);var e=a._getLinePointsOfOneWeek(i,t,n);a._tlpoints.push(e[0]),a._blpoints.push(e[e.length-1]),l&&a._drawSplitline(e,s,o)}d(r.getNextNDay(t.end.time,1).formatedDate),l&&this._drawSplitline(a._getEdgesPoints(a._tlpoints,e,n),s,o),l&&this._drawSplitline(a._getEdgesPoints(a._blpoints,e,n),s,o)},_getEdgesPoints:function(t,e,i){var n=[t[0].slice(),t[t.length-1].slice()],o="horizontal"===i?0:1;return n[0][o]=n[0][o]-e/2,n[1][o]=n[1][o]+e/2,n},_drawSplitline:function(t,e,i){var n=new Kr({z2:20,shape:{points:t},style:e});i.add(n)},_getLinePointsOfOneWeek:function(t,e,i){var n=t.coordinateSystem;e=n.getDateInfo(e);for(var o=[],a=0;a<7;a++){var r=n.getNextNDay(e.time,a),s=n.dataToRect([r.time],!1);o[2*r.day]=s.tl,o[2*r.day+1]=s["horizontal"===i?"bl":"tr"]}return o},_formatterLabel:function(t,e){return"string"==typeof t&&t?au(t,e):"function"==typeof t?t(e):e.nameMap},_yearTextPositionControl:function(t,e,i,n,o){e=e.slice();var a=["center","bottom"];"bottom"===n?(e[1]+=o,a=["center","top"]):"left"===n?e[0]-=o:"right"===n?(e[0]+=o,a=["center","top"]):e[1]-=o;var r=0;return"left"!==n&&"right"!==n||(r=Math.PI/2),{rotation:r,position:e,style:{textAlign:a[0],textVerticalAlign:a[1]}}},_renderYearText:function(t,e,i,n){var o=t.getModel("yearLabel");if(o.get("show")){var a=o.get("margin"),r=o.get("position");r=r||("horizontal"!==i?"top":"left");var s=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],l=(s[0][0]+s[1][0])/2,u=(s[0][1]+s[1][1])/2,h="horizontal"===i?0:1,c={top:[l,s[h][1]],bottom:[l,s[1-h][1]],left:[s[1-h][0],u],right:[s[h][0],u]},d=e.start.y;+e.end.y>+e.start.y&&(d=d+"-"+e.end.y);var f=o.get("formatter"),p={start:e.start.y,end:e.end.y,nameMap:d},g=this._formatterLabel(f,p),m=new Fr({z2:30});Qs(m.style,o,{text:g}),m.attr(this._yearTextPositionControl(m,c[r],i,r,a)),n.add(m)}},_monthTextPositionControl:function(t,e,i,n,o){var a="left",r="top",s=t[0],l=t[1];return"horizontal"===i?(l+=o,e&&(a="center"),"start"===n&&(r="bottom")):(s+=o,e&&(r="middle"),"start"===n&&(a="right")),{x:s,y:l,textAlign:a,textVerticalAlign:r}},_renderMonthText:function(t,e,i){var n=t.getModel("monthLabel");if(n.get("show")){var o=n.get("nameMap"),a=n.get("margin"),r=n.get("position"),s=n.get("align"),l=[this._tlpoints,this._blpoints];z(o)&&(o=ET[o.toUpperCase()]||[]);var u="start"===r?0:1,h="horizontal"===e?0:1;a="start"===r?-a:a;for(var c="center"===s,d=0;dd.getHeight()&&(i.textPosition="top",a=!0);var r=a?-5-n.height:p+8;o+n.width/2>d.getWidth()?(i.textPosition=["100%",r],i.textAlign="right"):o-n.width/2<0&&(i.textPosition=[0,r],i.textAlign="left")}})}function t(t,e){var i,n=m[t],o=m[e],a=u[n],r=new Il(a,h,h.ecModel);if(l&&null!=l.newTitle&&(a.title=l.newTitle),n&&!o){if(function(t){return 0===t.indexOf("my")}(n))i={model:r,onclick:r.option.onclick,featureName:n};else{var s=ZT(n);if(!s)return;i=new s(r,c,d)}g[n]=i}else{if(!(i=g[o]))return;i.model=r,i.ecModel=c,i.api=d}n||!o?r.get("show")&&!i.unusable?(function(o,a,t){var r=o.getModel("iconStyle"),s=o.getModel("emphasis.iconStyle"),e=a.getIcons?a.getIcons():o.get("icon"),l=o.get("title")||{};if("string"==typeof e){var i=e,n=l;l={},(e={})[t]=i,l[t]=n}var u=o.iconPaths={};E(e,function(t,e){var i=pl(t,{},{x:-p/2,y:-p/2,width:p,height:p});i.setStyle(r.getItemStyle()),i.hoverStyle=s.getItemStyle(),i.setStyle({text:l[e],textAlign:s.get("textAlign"),textBorderRadius:s.get("textBorderRadius"),textPadding:s.get("textPadding"),textFill:null});var n=h.getModel("tooltip");n&&n.get("show")&&i.attr("tooltip",L({content:l[e],formatter:n.get("formatter",!0)||function(){return l[e]},formatterParams:{componentType:"toolbox",name:e,title:l[e],$vars:["name","title"]},position:n.get("position",!0)||"bottom"},n.option)),Ys(i),h.get("showTitle")&&(i.__title=l[e],i.on("mouseover",function(){var t=s.getItemStyle(),e="vertical"===h.get("orient")?null==h.get("right")?"right":"left":null==h.get("bottom")?"bottom":"top";i.setStyle({textFill:s.get("textFill")||t.fill||t.stroke||"#000",textBackgroundColor:s.get("textBackgroundColor"),textPosition:s.get("textPosition")||e})}).on("mouseout",function(){i.setStyle({textFill:null,textBackgroundColor:null})})),i.trigger(o.get("iconStatus."+e)||"normal"),f.add(i),i.on("click",A(a.onclick,a,c,d,e)),u[e]=i})}(r,i,n),r.setIconStatus=function(t,e){var i=this.option,n=this.iconPaths;i.iconStatus=i.iconStatus||{},i.iconStatus[t]=e,n[t]&&n[t].trigger(e)},i.render&&i.render(r,c,d,l)):i.remove&&i.remove(c,d):i.dispose&&i.dispose(c,d)}},updateView:function(t,e,i,n){E(this._features,function(t){t.updateView&&t.updateView(t.model,e,i,n)})},remove:function(e,i){E(this._features,function(t){t.remove&&t.remove(e,i)}),this.group.removeAll()},dispose:function(e,i){E(this._features,function(t){t.dispose&&t.dispose(e,i)})}});var YT=Cc.toolbox.saveAsImage;function jT(t){this.model=t}jT.defaultOption={show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:YT.title,type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],pixelRatio:1,lang:YT.lang.slice()},jT.prototype.unusable=!v.canvasSupported,jT.prototype.onclick=function(t,e){var i=this.model,n=i.get("name")||t.get("title.0.text")||"echarts",o=i.get("type",!0)||"png",a=e.getConnectedDataURL({type:o,backgroundColor:i.get("backgroundColor",!0)||t.get("backgroundColor")||"#fff",connectedBackgroundColor:i.get("connectedBackgroundColor"),excludeComponents:i.get("excludeComponents"),pixelRatio:i.get("pixelRatio")});if("function"!=typeof MouseEvent||v.browser.ie||v.browser.edge)if(window.navigator.msSaveOrOpenBlob){for(var r=atob(a.split(",")[1]),s=r.length,l=new Uint8Array(s);s--;)l[s]=r.charCodeAt(s);var u=new Blob([l]);window.navigator.msSaveOrOpenBlob(u,n+"."+o)}else{var h=i.get("lang"),c='';window.open().document.write(c)}else{var d=document.createElement("a");d.download=n+"."+o,d.target="_blank",d.href=a;var f=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!1});d.dispatchEvent(f)}},HT("saveAsImage",jT);var qT=Cc.toolbox.magicType,KT="__ec_magicType_stack__";function $T(t){this.model=t}$T.defaultOption={show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:D(qT.title),option:{},seriesIndex:{}};var JT=$T.prototype;JT.getIcons=function(){var t=this.model,e=t.get("icon"),i={};return E(t.get("type"),function(t){e[t]&&(i[t]=e[t])}),i};var QT={line:function(t,e,i,n){if("bar"===t)return m({id:e,type:"line",data:i.get("data"),stack:i.get("stack"),markPoint:i.get("markPoint"),markLine:i.get("markLine")},n.get("option.line")||{},!0)},bar:function(t,e,i,n){if("line"===t)return m({id:e,type:"bar",data:i.get("data"),stack:i.get("stack"),markPoint:i.get("markPoint"),markLine:i.get("markLine")},n.get("option.bar")||{},!0)},stack:function(t,e,i,n){var o=i.get("stack")===KT;if("line"===t||"bar"===t)return n.setIconStatus("stack",o?"normal":"emphasis"),m({id:e,stack:o?"":KT},n.get("option.stack")||{},!0)}},tA=[["line","bar"],["stack"]];JT.onclick=function(u,t,h){var c=this.model,e=c.get("seriesIndex."+h);if(QT[h]){var i,d={series:[]};if(E(tA,function(t){0<=_(t,h)&&E(t,function(t){c.setIconStatus(t,"normal")})}),c.setIconStatus(h,"emphasis"),u.eachComponent({mainType:"series",query:null==e?null:{seriesIndex:e}},function(t){var e=t.subType,i=t.id,n=QT[h](e,i,t,c);n&&(C(n,t.option),d.series.push(n));var o=t.coordinateSystem;if(o&&"cartesian2d"===o.type&&("line"===h||"bar"===h)){var a=o.getAxesByScale("ordinal")[0];if(a){var r=a.dim+"Axis",s=u.queryComponents({mainType:r,index:t.get(name+"Index"),id:t.get(name+"Id")})[0].componentIndex;d[r]=d[r]||[];for(var l=0;l<=s;l++)d[r][s]=d[r][s]||{};d[r][s].boundaryGap="bar"===h}}}),"stack"===h)i=d.series&&d.series[0]&&d.series[0].stack===KT?m({stack:qT.title.tiled},qT.title):D(qT.title);t.dispatchAction({type:"changeMagicType",currentType:h,newOption:d,newTitle:i})}},gf({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(t,e){e.mergeOption(t.newOption)}),HT("magicType",$T);var eA=Cc.toolbox.dataView,iA=new Array(60).join("-"),nA="\t";function oA(t){var e=function(t){var o={},a=[],r=[];return t.eachRawSeries(function(t){var e=t.coordinateSystem;if(!e||"cartesian2d"!==e.type&&"polar"!==e.type)a.push(t);else{var i=e.getBaseAxis();if("category"===i.type){var n=i.dim+"_"+i.index;o[n]||(o[n]={categoryAxis:i,valueAxis:e.getOtherAxis(i),series:[]},r.push({axisDim:i.dim,axisIndex:i.index})),o[n].series.push(t)}else a.push(t)}}),{seriesGroupByCategoryAxis:o,other:a,meta:r}}(t);return{value:M([function(t){var h=[];return E(t,function(t,e){var i=t.categoryAxis,n=t.valueAxis.dim,o=[" "].concat(N(t.series,function(t){return t.name})),a=[i.model.getCategories()];E(t.series,function(t){a.push(t.getRawData().mapArray(n,function(t){return t}))});for(var r=[o.join(nA)],s=0;st[1]&&t.reverse(),t}function vA(t,e){return Xo(t,e,{includeMainTypes:fA})}gA.setOutputRanges=function(t,e){this.matchOutputRanges(t,e,function(t,e,i){if((t.coordRanges||(t.coordRanges=[])).push(e),!t.coordRange){t.coordRange=e;var n=wA[t.brushType](0,i,e);t.__rangeOffset={offset:SA[t.brushType](n.values,t.range,[1,1]),xyMinMax:n.xyMinMax}}})},gA.matchOutputRanges=function(t,n,o){uA(t,function(i){var t=this.findTargetInfo(i,n);t&&!0!==t&&E(t.coordSyses,function(t){var e=wA[i.brushType](1,t,i.range);o(i,e.values,t,n)})},this)},gA.setInputRanges=function(t,o){uA(t,function(t){var e=this.findTargetInfo(t,o);if(t.range=t.range||[],e&&!0!==e){t.panelId=e.panelId;var i=wA[t.brushType](0,e.coordSys,t.coordRange),n=t.__rangeOffset;t.range=n?SA[t.brushType](i.values,n.offset,function(t,e){var i=IA(t),n=IA(e),o=[i[0]/n[0],i[1]/n[1]];return isNaN(o[0])&&(o[0]=1),isNaN(o[1])&&(o[1]=1),o}(i.xyMinMax,n.xyMinMax)):i.values}},this)},gA.makePanelOpts=function(i,n){return N(this._targetInfoList,function(t){var e=t.getPanelRect();return{panelId:t.panelId,defaultBrushType:n&&n(t),clipPath:Ub(e),isTargetByCursor:Yb(e,i,t.coordSysModel),getLinearBrushOtherExtent:Xb(e)}})},gA.controlSeries=function(t,e,i){var n=this.findTargetInfo(t,i);return!0===n||n&&0<=hA(n.coordSyses,e.coordinateSystem)},gA.findTargetInfo=function(t,e){for(var i=this._targetInfoList,n=vA(e,t),o=0;on[1]&&(n[1]=e[1])})}),n[1]c[1];if(r&&!s&&!l)return!0;r&&(n=!0),s&&(e=!0),l&&(i=!0)}return n&&e&&i}):RA(h,function(t){if("empty"===o)i.setData(u=u.map(t,function(t){return function(t){return t>=c[0]&&t<=c[1]}(t)?t:NaN}));else{var e={};e[t]=c,u.selectRange(e)}}),RA(h,function(t){u.setApproximateExtent(c,t)}))})}}};var GA=E,FA=OA,WA=wf({type:"dataZoom",dependencies:["xAxis","yAxis","zAxis","radiusAxis","angleAxis","singleAxis","series"],defaultOption:{zlevel:0,z:4,orient:null,xAxisIndex:null,yAxisIndex:null,filterMode:"filter",throttle:null,start:0,end:100,startValue:null,endValue:null,minSpan:null,maxSpan:null,minValueSpan:null,maxValueSpan:null,rangeMode:null},init:function(t,e,i){this._dataIntervalByAxis={},this._dataInfo={},this._axisProxies={},this.textStyleModel,this._autoThrottle=!0,this._rangePropMode=["percent","percent"];var n=HA(t);this.settledOption=n,this.mergeDefaultAndTheme(t,i),this.doInit(n)},mergeOption:function(t){var e=HA(t);m(this.option,t,!0),m(this.settledOption,e,!0),this.doInit(e)},doInit:function(t){var i=this.option;v.canvasSupported||(i.realtime=!1),this._setDefaultThrottle(t),ZA(this,t);var n=this.settledOption;GA([["start","startValue"],["end","endValue"]],function(t,e){"value"===this._rangePropMode[e]&&(i[t[0]]=n[t[0]]=null)},this),this.textStyleModel=this.getModel("textStyle"),this._resetTarget(),this._giveAxisProxies()},_giveAxisProxies:function(){var r=this._axisProxies;this.eachTargetAxis(function(t,e,i,n){var o=this.dependentModels[t.axis][e],a=o.__dzAxisProxy||(o.__dzAxisProxy=new zA(t.name,e,this,n));r[t.name+"_"+e]=a},this)},_resetTarget:function(){var i=this.option,t=this._judgeAutoMode();FA(function(t){var e=t.axisIndex;i[e]=Eo(i[e])},this),"axisIndex"===t?this._autoSetAxisIndex():"orient"===t&&this._autoSetOrient()},_judgeAutoMode:function(){var e=this.option,i=!1;FA(function(t){null!=e[t.axisIndex]&&(i=!0)},this);var t=e.orient;return null==t&&i?"orient":i?void 0:(null==t&&(e.orient="horizontal"),"axisIndex")},_autoSetAxisIndex:function(){var a=!0,e=this.get("orient",!0),r=this.option,t=this.dependentModels;if(a){var i="vertical"===e?"y":"x";t[i+"Axis"].length?(r[i+"AxisIndex"]=[0],a=!1):GA(t.singleAxis,function(t){a&&t.get("orient",!0)===e&&(r.singleAxisIndex=[t.componentIndex],a=!1)})}a&&FA(function(t){if(a){var e=[],i=this.dependentModels[t.axis];if(i.length&&!e.length)for(var n=0,o=i.length;ne[0][1]&&(e[0][1]=a[0]),a[1]e[1][1]&&(e[1][1]=a[1])}return e&&CD(e)}};function CD(t){return new Mi(t[0][0],t[1][0],t[0][1]-t[0][0],t[1][1]-t[1][0])}var LD=["#ddd"];wf({type:"brush",dependencies:["geo","grid","xAxis","yAxis","parallel","series"],defaultOption:{toolbox:null,brushLink:null,seriesIndex:"all",geoIndex:null,xAxisIndex:null,yAxisIndex:null,brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(120,140,180,0.3)",borderColor:"rgba(120,140,180,0.8)"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},areas:[],brushType:null,brushOption:{},coordInfoList:[],optionUpdated:function(t,e){var i=this.option;e||vD(i,t,["inBrush","outOfBrush"]);var n=i.inBrush=i.inBrush||{};i.outOfBrush=i.outOfBrush||{color:LD},n.hasOwnProperty("liftZ")||(n.liftZ=5)},setAreas:function(t){t&&(this.areas=N(t,function(t){return kD(this.option,t)},this))},setBrushOption:function(t){this.brushOption=kD(this.option,t),this.brushType=this.brushOption.brushType}});function kD(t,e){return m({brushType:t.brushType,brushMode:t.brushMode,transformable:t.transformable,brushStyle:new Il(t.brushStyle).getItemStyle(),removeOnClick:t.removeOnClick,z:t.z},e,!0)}function PD(t,e,i,n){n&&n.$from===t.id||this._brushController.setPanels(t.brushTargetManager.makePanelOpts(i)).enableBrush(t.brushOption).updateCovers(t.areas.slice())}bf({type:"brush",init:function(t,e){this.ecModel=t,this.api=e,this.model,(this._brushController=new gb(e.getZr())).on("brush",A(this._onBrush,this)).mount()},render:function(t){return this.model=t,PD.apply(this,arguments)},updateTransform:PD,updateView:PD,dispose:function(){this._brushController.dispose()},_onBrush:function(t,e){var i=this.model.id;this.model.brushTargetManager.setOutputRanges(t,this.ecModel),e.isEnd&&!e.removeOnClick||this.api.dispatchAction({type:"brush",brushId:i,areas:D(t),$from:i}),e.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:i,areas:D(t),$from:i})}}),gf({type:"brush",event:"brush"},function(e,t){t.eachComponent({mainType:"brush",query:e},function(t){t.setAreas(e.areas)})}),gf({type:"brushSelect",event:"brushSelected",update:"none"},function(){}),gf({type:"brushEnd",event:"brushEnd",update:"none"},function(){});var ND=Cc.toolbox.brush;function OD(t,e,i){this.model=t,this.ecModel=e,this.api=i,this._brushType,this._brushMode}OD.defaultOption={show:!0,type:["rect","polygon","lineX","lineY","keep","clear"],icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:D(ND.title)};var ED=OD.prototype;ED.render=ED.updateView=function(e,t,i){var n,o,a;t.eachComponent({mainType:"brush"},function(t){n=t.brushType,o=t.brushOption.brushMode||"single",a|=t.areas.length}),this._brushType=n,this._brushMode=o,E(e.get("type",!0),function(t){e.setIconStatus(t,("keep"===t?"multiple"===o:"clear"===t?a:t===n)?"emphasis":"normal")})},ED.getIcons=function(){var t=this.model,e=t.get("icon",!0),i={};return E(t.get("type",!0),function(t){e[t]&&(i[t]=e[t])}),i},ED.onclick=function(t,e,i){var n=this._brushType,o=this._brushMode;"clear"===i?(e.dispatchAction({type:"axisAreaSelect",intervals:[]}),e.dispatchAction({type:"brush",command:"clear",areas:[]})):e.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:"keep"===i?n:n!==i&&i,brushMode:"keep"===i?"multiple"===o?"single":"multiple":o}})},HT("brush",OD),ff(function(t,e){var i=t&&t.brush;if(k(i)||(i=i?[i]:[]),i.length){var n=[];E(i,function(t){var e=t.hasOwnProperty("toolbox")?t.toolbox:[];e instanceof Array&&(n=n.concat(e))});var o=t&&t.toolbox;k(o)&&(o=o[0]),o||(o={feature:{}},t.toolbox=[o]);var a=o.feature||(o.feature={}),r=a.brush||(a.brush={}),s=r.type||(r.type=[]);s.push.apply(s,n),function(i){var e={};E(i,function(t){e[t]=1}),i.length=0,E(e,function(t,e){i.push(e)})}(s),e&&!s.length&&s.push.apply(s,fD)}}),wf({type:"title",layoutMode:{type:"box",ignoreSize:!0},defaultOption:{zlevel:0,z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bolder",color:"#333"},subtextStyle:{color:"#aaa"}}}),bf({type:"title",render:function(t,e,i){if(this.group.removeAll(),t.get("show")){var n=this.group,o=t.getModel("textStyle"),a=t.getModel("subtextStyle"),r=t.get("textAlign"),s=H(t.get("textBaseline"),t.get("textVerticalAlign")),l=new Fr({style:Qs({},o,{text:t.get("text"),textFill:o.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),h=t.get("subtext"),c=new Fr({style:Qs({},a,{text:h,textFill:a.getTextColor(),y:u.height+t.get("itemGap"),textVerticalAlign:"top"},{disableBox:!0}),z2:10}),d=t.get("link"),f=t.get("sublink"),p=t.get("triggerEvent",!0);l.silent=!d&&!p,c.silent=!f&&!p,d&&l.on("click",function(){window.open(d,"_"+t.get("target"))}),f&&c.on("click",function(){window.open(f,"_"+t.get("subtarget"))}),l.eventData=c.eventData=p?{componentType:"title",componentIndex:t.componentIndex}:null,n.add(l),h&&n.add(c);var g=n.getBoundingRect(),m=t.getBoxLayoutParams();m.width=g.width,m.height=g.height;var v=vu(m,{width:i.getWidth(),height:i.getHeight()},t.get("padding"));r||("middle"===(r=t.get("left")||t.get("right"))&&(r="center"),"right"===r?v.x+=v.width:"center"===r&&(v.x+=v.width/2)),s||("center"===(s=t.get("top")||t.get("bottom"))&&(s="middle"),"bottom"===s?v.y+=v.height:"middle"===s&&(v.y+=v.height/2),s=s||"top"),n.attr("position",[v.x,v.y]);var y={textAlign:r,textVerticalAlign:s};l.setStyle(y),c.setStyle(y),g=n.getBoundingRect();var x=v.margin,_=t.getItemStyle(["color","opacity"]);_.fill=t.get("backgroundColor");var w=new is({shape:{x:g.x-x[3],y:g.y-x[0],width:g.width+x[1]+x[3],height:g.height+x[0]+x[2],r:t.get("borderRadius")},style:_,subPixelOptimize:!0,silent:!0});n.add(w)}}});function zD(t){var e=t.itemStyle||(t.itemStyle={}),i=e.emphasis||(e.emphasis={}),n=t.label||t.label||{},o=n.normal||(n.normal={}),a={normal:1,emphasis:1};E(n,function(t,e){a[e]||RD(o,e)||(o[e]=t)}),i.label&&!RD(n,"emphasis")&&(n.emphasis=i.label,delete i.label)}function RD(t,e){return t.hasOwnProperty(e)}Tu.registerSubTypeDefaulter("timeline",function(){return"slider"}),gf({type:"timelineChange",event:"timelineChanged",update:"prepareAndUpdate"},function(t,e){var i=e.getComponent("timeline");return i&&null!=t.currentIndex&&(i.setCurrentIndex(t.currentIndex),!i.get("loop",!0)&&i.isIndexMax()&&i.setPlayState(!1)),e.resetOption("timeline"),C({currentIndex:i.option.currentIndex},t)}),gf({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},function(t,e){var i=e.getComponent("timeline");i&&null!=t.playState&&i.setPlayState(t.playState)});var BD=Tu.extend({type:"timeline",layoutMode:"box",defaultOption:{zlevel:0,z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},init:function(t,e,i){this._data,this._names,this.mergeDefaultAndTheme(t,i),this._initData()},mergeOption:function(t){BD.superApply(this,"mergeOption",arguments),this._initData()},setCurrentIndex:function(t){null==t&&(t=this.option.currentIndex);var e=this._data.count();this.option.loop?t=(t%e+e)%e:(e<=t&&(t=e-1),t<0&&(t=0)),this.option.currentIndex=t},getCurrentIndex:function(){return this.option.currentIndex},isIndexMax:function(){return this.getCurrentIndex()>=this._data.count()-1},setPlayState:function(t){this.option.autoPlay=!!t},getPlayState:function(){return!!this.option.autoPlay},_initData:function(){var t=this.option,e=t.data||[],i=t.axisType,o=this._names=[];if("category"===i){var a=[];E(e,function(t,e){var i,n=Bo(t);R(t)?(i=D(t)).value=e:i=e,a.push(i),z(n)||null!=n&&!isNaN(n)||(n=""),o.push(n+"")}),e=a}var n={category:"ordinal",time:"time"}[i]||"number";(this._data=new Wf([{name:"value",type:n}],this)).initData(e,o)},getData:function(){return this._data},getCategories:function(){if("category"===this.get("axisType"))return this._names.slice()}});b(BD.extend({type:"timeline.slider",defaultOption:{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"emptyCircle",symbolSize:10,lineStyle:{show:!0,width:2,color:"#304654"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#304654"},itemStyle:{color:"#304654",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:13,color:"#c23531",borderWidth:5,borderColor:"rgba(194,53,49, 0.5)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:22,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"path://M18.6,50.8l22.5-22.5c0.2-0.2,0.3-0.4,0.3-0.7c0-0.3-0.1-0.5-0.3-0.7L18.7,4.4c-0.1-0.1-0.2-0.3-0.2-0.5 c0-0.4,0.3-0.8,0.8-0.8c0.2,0,0.5,0.1,0.6,0.3l23.5,23.5l0,0c0.2,0.2,0.3,0.4,0.3,0.7c0,0.3-0.1,0.5-0.3,0.7l-0.1,0.1L19.7,52 c-0.1,0.1-0.3,0.2-0.5,0.2c-0.4,0-0.8-0.3-0.8-0.8C18.4,51.2,18.5,51,18.6,50.8z",prevIcon:"path://M43,52.8L20.4,30.3c-0.2-0.2-0.3-0.4-0.3-0.7c0-0.3,0.1-0.5,0.3-0.7L42.9,6.4c0.1-0.1,0.2-0.3,0.2-0.5 c0-0.4-0.3-0.8-0.8-0.8c-0.2,0-0.5,0.1-0.6,0.3L18.3,28.8l0,0c-0.2,0.2-0.3,0.4-0.3,0.7c0,0.3,0.1,0.5,0.3,0.7l0.1,0.1L41.9,54 c0.1,0.1,0.3,0.2,0.5,0.2c0.4,0,0.8-0.3,0.8-0.8C43.2,53.2,43.1,53,43,52.8z",color:"#304654",borderColor:"#304654",borderWidth:1},emphasis:{label:{show:!0,color:"#c23531"},itemStyle:{color:"#c23531"},controlStyle:{color:"#c23531",borderColor:"#c23531",borderWidth:2}},data:[]}}),Fh);function VD(t,e,i,n){Eg.call(this,t,e,i),this.type=n||"value",this.model=null}var GD=hc.extend({type:"timeline"});VD.prototype={constructor:VD,getLabelModel:function(){return this.model.getModel("label")},isHorizontal:function(){return"horizontal"===this.model.get("orient")}},w(VD,Eg);var FD=A,WD=E,HD=Math.PI;function ZD(t,e,i,n,o,a){var r=e.get("color");o?(o.setColor(r),i.add(o),a&&a.onUpdate(o)):((o=mg(t.get("symbol"),-1,-1,2,2,r)).setStyle("strokeNoScale",!0),i.add(o),a&&a.onCreate(o));var s=e.getItemStyle(["color","symbol","symbolSize"]);o.setStyle(s),n=m({rectHover:!0,z2:100},n,!0);var l=t.get("symbolSize");(l=l instanceof Array?l.slice():[+l,+l])[0]/=2,l[1]/=2,n.scale=l;var u=t.get("symbolOffset");if(u){var h=n.position=n.position||[0,0];h[0]+=Pl(u[0],l[0]),h[1]+=Pl(u[1],l[1])}var c=t.get("symbolRotate");return n.rotation=(c||0)*Math.PI/180||0,o.attr(n),o.updateTransform(),o}function UD(t,e,i,n,o){if(!t.dragging){var a=n.getModel("checkpointStyle"),r=i.dataToCoord(n.getData().get(["value"],e));o||!a.get("animation",!0)?t.attr({position:[r,0]}):(t.stopAnimation(!0),t.animateTo({position:[r,0]},a.get("animationDuration",!0),a.get("animationEasing",!0)))}}GD.extend({type:"timeline.slider",init:function(t,e){this.api=e,this._axis,this._viewRect,this._timer,this._currentPointer,this._mainGroup,this._labelGroup},render:function(e,t,i,n){if(this.model=e,this.api=i,this.ecModel=t,this.group.removeAll(),e.get("show",!0)){var o=this._layout(e,i),a=this._createGroup("mainGroup"),r=this._createGroup("labelGroup"),s=this._axis=this._createAxis(o,e);e.formatTooltip=function(t){return eu(s.scale.getLabel(t))},WD(["AxisLine","AxisTick","Control","CurrentPointer"],function(t){this["_render"+t](o,a,s,e)},this),this._renderAxisLabel(o,r,s,e),this._position(o,e)}this._doPlayStop()},remove:function(){this._clearTimer(),this.group.removeAll()},dispose:function(){this._clearTimer()},_layout:function(t,e){var i=t.get("label.position"),n=t.get("orient"),o=function(t,e){return vu(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()},t.get("padding"))}(t,e);null==i||"auto"===i?i="horizontal"===n?o.y+o.height/2n[1]&&(i=n[1]),i"),o&&(a+=YD(o),null!=i&&(a+=" : ")),null!=i&&(a+=YD(n)),a},getData:function(){return this._data},setData:function(t){this._data=t}});b(qD,Fh),qD.extend({type:"markPoint",defaultOption:{zlevel:0,z:5,symbol:"pin",symbolSize:50,tooltip:{trigger:"item"},label:{show:!0,position:"inside"},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}}});var KD=_;function $D(t,e,i,n,o,a){var r=[],s=lp(e,n)?e.getCalculationInfo("stackResultDimension"):n,l=oC(e,s,t),u=e.indicesOfNearest(s,l)[0];r[o]=e.get(i,u),r[a]=e.get(n,u);var h=El(e.get(n,u));return 0<=(h=Math.min(h,20))&&(r[a]=+r[a].toFixed(h)),r}var JD=T,QD={min:JD($D,"min"),max:JD($D,"max"),average:JD($D,"average")};function tC(t,e){var i=t.getData(),n=t.coordinateSystem;if(e&&!function(t){return!isNaN(parseFloat(t.x))&&!isNaN(parseFloat(t.y))}(e)&&!k(e.coord)&&n){var o=n.dimensions,a=eC(e,i,n,t);if((e=D(e)).type&&QD[e.type]&&a.baseAxis&&a.valueAxis){var r=KD(o,a.baseAxis.dim),s=KD(o,a.valueAxis.dim);e.coord=QD[e.type](i,a.baseDataDim,a.valueDataDim,r,s),e.value=e.coord[s]}else{for(var l=[null!=e.xAxis?e.xAxis:e.radiusAxis,null!=e.yAxis?e.yAxis:e.angleAxis],u=0;u<2;u++)QD[l[u]]&&(l[u]=oC(i,i.mapDimension(o[u]),l[u]));e.coord=l}}return e}function eC(t,e,i,n){var o={};return null!=t.valueIndex||null!=t.valueDim?(o.valueDataDim=null!=t.valueIndex?e.getDimension(t.valueIndex):t.valueDim,o.valueAxis=i.getAxis(function(t,e){var i=t.getData(),n=i.dimensions;e=i.getDimension(e);for(var o=0;oi[o],f=[-h.x,-h.y];e||(f[n]=s.position[n]);var p=[0,0],g=[-c.x,-c.y],m=H(t.get("pageButtonGap",!0),t.get("itemGap",!0));d&&("end"===t.get("pageButtonPosition",!0)?g[n]+=i[o]-c[o]:p[n]+=c[o]+m);g[1-n]+=h[a]/2-c[a]/2,s.attr("position",f),l.attr("position",p),u.attr("position",g);var v={x:0,y:0};if(v[o]=d?i[o]:h[o],v[a]=Math.max(h[a],c[a]),v[r]=Math.min(0,c[r]+g[1-n]),l.__rectSize=i[o],d){var y={x:0,y:0};y[o]=Math.max(i[o]-c[o]-m,0),y[a]=v[a],l.setClipPath(new is({shape:y})),l.__rectSize=y[o]}else u.eachChild(function(t){t.attr({invisible:!0,silent:!0})});var x=this._getPageInfo(t);return null!=x.pageIndex&&sl(s,{position:x.contentPosition},d&&t),this._updatePageInfoView(t,x),v},_pageGo:function(t,e,i){var n=this._getPageInfo(e)[t];null!=n&&i.dispatchAction({type:"legendScroll",scrollDataIndex:n,legendId:e.id})},_updatePageInfoView:function(n,o){var a=this._controllerGroup;E(["pagePrev","pageNext"],function(t){var e=null!=o[t+"DataIndex"],i=a.childOfName(t);i&&(i.setStyle("fill",e?n.get("pageIconColor",!0):n.get("pageIconInactiveColor",!0)),i.cursor=e?"pointer":"default")});var t=a.childOfName("pageText"),e=n.get("pageFormatter"),i=o.pageIndex,r=null!=i?i+1:0,s=o.pageCount;t&&e&&t.setStyle("text",z(e)?e.replace("{current}",r).replace("{total}",s):e({current:r,total:s}))},_getPageInfo:function(t){var e=t.get("scrollDataIndex",!0),i=this.getContentGroup(),n=this._containerGroup.__rectSize,o=t.getOrient().index,a=NC[o],r=OC[o],s=this._findTargetItemIndex(e),l=i.children(),u=l[s],h=l.length,c=h?1:0,d={contentPosition:i.position.slice(),pageCount:c,pageIndex:c-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!u)return d;var f=y(u);d.contentPosition[o]=-f.s;for(var p=s+1,g=f,m=f,v=null;p<=h;++p)(!(v=y(l[p]))&&m.e>g.s+n||v&&!x(v,g.s))&&(g=m.i>g.i?m:v)&&(null==d.pageNextDataIndex&&(d.pageNextDataIndex=g.i),++d.pageCount),m=v;for(p=s-1,g=f,m=f,v=null;-1<=p;--p)(v=y(l[p]))&&x(m,v.s)||!(g.i=e&&t.s<=e+n}},_findTargetItemIndex:function(n){var o,a,t=this.getContentGroup();return this._showController&&t.eachChild(function(t,e){var i=t.__legendDataIndex;null==a&&null!=i&&(a=e),i===n&&(o=e)}),null!=o?o:a}});gf("legendScroll","legendscroll",function(t,e){var i=t.scrollDataIndex;null!=i&&e.eachComponent({mainType:"legend",subType:"scroll",query:t},function(t){t.setScrollDataIndex(i)})});WA.extend({type:"dataZoom.slider",layoutMode:"box",defaultOption:{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#2f4554",width:.5,opacity:.3},areaStyle:{color:"rgba(47,69,84,0.3)",opacity:.3}},borderColor:"#ddd",fillerColor:"rgba(167,183,204,0.4)",handleIcon:"M8.2,13.6V3.9H6.3v9.7H3.1v14.9h3.3v9.7h1.8v-9.7h3.3V13.6H8.2z M9.7,24.4H4.8v-1.4h4.9V24.4z M9.7,19.1H4.8v-1.4h4.9V19.1z",handleSize:"100%",handleStyle:{color:"#a7b7cc"},labelPrecision:null,labelFormatter:null,showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#333"}}});var zC=is,RC=kl,BC=Ol,VC=A,GC=E,FC="horizontal",WC="vertical",HC=["line","bar","candlestick","scatter"],ZC=UA.extend({type:"dataZoom.slider",init:function(t,e){this._displayables={},this._orient,this._range,this._handleEnds,this._size,this._handleWidth,this._handleHeight,this._location,this._dragging,this._dataShadowInfo,this.api=e},render:function(t,e,i,n){ZC.superApply(this,"render",arguments),Tc(this,"_dispatchZoomAction",this.dataZoomModel.get("throttle"),"fixRate"),this._orient=t.get("orient"),!1!==this.dataZoomModel.get("show")?(n&&"dataZoom"===n.type&&n.from===this.uid||this._buildView(),this._updateView()):this.group.removeAll()},remove:function(){ZC.superApply(this,"remove",arguments),Ac(this,"_dispatchZoomAction")},dispose:function(){ZC.superApply(this,"dispose",arguments),Ac(this,"_dispatchZoomAction")},_buildView:function(){var t=this.group;t.removeAll(),this._resetLocation(),this._resetInterval();var e=this._displayables.barGroup=new Ii;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),t.add(e),this._positionGroup()},_resetLocation:function(){var t=this.dataZoomModel,e=this.api,i=this._findCoordRect(),n={width:e.getWidth(),height:e.getHeight()},o=this._orient===FC?{right:n.width-i.x-i.width,top:n.height-30-7,width:i.width,height:30}:{right:7,top:i.y,width:30,height:i.height},a=_u(t.option);E(["right","top","width","height"],function(t){"ph"===a[t]&&(a[t]=o[t])});var r=vu(a,n,t.padding);this._location={x:r.x,y:r.y},this._size=[r.width,r.height],this._orient===WC&&this._size.reverse()},_positionGroup:function(){var t=this.group,e=this._location,i=this._orient,n=this.dataZoomModel.getFirstTargetAxisModel(),o=n&&n.get("inverse"),a=this._displayables.barGroup,r=(this._dataShadowInfo||{}).otherAxisInverse;a.attr(i!==FC||o?i===FC&&o?{scale:r?[-1,1]:[-1,-1]}:i!==WC||o?{scale:r?[-1,-1]:[-1,1],rotation:Math.PI/2}:{scale:r?[1,-1]:[1,1],rotation:Math.PI/2}:{scale:r?[1,1]:[1,-1]});var s=t.getBoundingRect([a]);t.attr("position",[e.x-s.x,e.y-s.y])},_getViewExtent:function(){return[0,this._size[0]]},_renderBackground:function(){var t=this.dataZoomModel,e=this._size,i=this._displayables.barGroup;i.add(new zC({silent:!0,shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:t.get("backgroundColor")},z2:-40})),i.add(new zC({shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:"transparent"},z2:0,onclick:A(this._onClickPanelClick,this)}))},_renderDataShadow:function(){var t=this._dataShadowInfo=this._prepareDataShadowInfo();if(t){var e=this._size,i=t.series,n=i.getRawData(),o=i.getShadowDim?i.getShadowDim():t.otherDim;if(null!=o){var a=n.getDataExtent(o),r=.3*(a[1]-a[0]);a=[a[0]-r,a[1]+r];var s,l=[0,e[1]],u=[0,e[0]],h=[[e[0],0],[0,0]],c=[],d=u[1]/(n.count()-1),f=0,p=Math.round(n.count()/e[0]);n.each([o],function(t,e){if(0e[0]||i[1]<0||i[1]>e[1])){var n=this._handleEnds,o=(n[0]+n[1])/2,a=this._updateInterval("all",i[0]-o);this._updateView(),a&&this._dispatchZoomAction()}},_dispatchZoomAction:function(){var t=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,start:t[0],end:t[1]})},_findCoordRect:function(){var i;if(GC(this.getTargetCoordInfo(),function(t){if(!i&&t.length){var e=t[0].model.coordinateSystem;i=e.getRect&&e.getRect()}}),!i){var t=this.api.getWidth(),e=this.api.getHeight();i={x:.2*t,y:.2*e,width:.6*t,height:.6*e}}return i}});function UC(t){return"vertical"===t?"ns-resize":"ew-resize"}WA.extend({type:"dataZoom.inside",defaultOption:{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}});var XC="\0_ec_dataZoom_roams";function YC(t,n){var e=qC(t),o=n.dataZoomId,a=n.coordId;E(e,function(t,e){var i=t.dataZoomInfos;i[o]&&_(n.allCoordIds,a)<0&&(delete i[o],t.count--)}),KC(e);var i=e[a];i||((i=e[a]={coordId:a,dataZoomInfos:{},count:0}).controller=function(t,r){var e=new Ly(t.getZr());return E(["pan","zoom","scrollMove"],function(a){e.on(a,function(n){var o=[];E(r.dataZoomInfos,function(t){if(n.isAvailableBehavior(t.dataZoomModel.option)){var e=(t.getRange||{})[a],i=e&&e(r.controller,n);!t.dataZoomModel.get("disabled",!0)&&i&&o.push({dataZoomId:t.dataZoomId,start:i[0],end:i[1]})}}),o.length&&r.dispatchAction(o)})}),e}(t,i),i.dispatchAction=T($C,t)),i.dataZoomInfos[o]||i.count++,i.dataZoomInfos[o]=n;var r=function(t){var n,o={type_true:2,type_move:1,type_false:0,type_undefined:-1},a=!0;return E(t,function(t){var e=t.dataZoomModel,i=!e.get("disabled",!0)&&(!e.get("zoomLock",!0)||"move");o["type_"+n]"],k(t)&&(t=t.slice(),n=!0),o=e?t:n?[u(t[0]),u(t[1])]:u(t),z(l)?l.replace("{value}",n?o[0]:o).replace("{value2}",n?o[1]:o):O(l)?n?l(t[0],t[1]):l(t):n?t[0]===s[0]?i[0]+" "+o[1]:t[1]===s[1]?i[1]+" "+o[0]:o[0]+" - "+o[1]:o;function u(t){return t===s[0]?"min":t===s[1]?"max":(+t).toFixed(Math.min(r,20))}},resetExtent:function(){var t=this.option,e=pL([t.min,t.max]);this._dataExtent=e},getDataDimension:function(t){var e=this.option.dimension,i=t.dimensions;if(null!=e||i.length){if(null!=e)return t.getDimension(e);for(var n=t.dimensions,o=n.length-1;0<=o;o--){var a=n[o];if(!t.getDimensionInfo(a).isCalculationCoord)return a}}},getExtent:function(){return this._dataExtent.slice()},completeVisualOption:function(){var t=this.ecModel,e=this.option,i={inRange:e.inRange,outOfRange:e.outOfRange},n=e.target||(e.target={}),o=e.controller||(e.controller={});m(n,i),m(o,i);var u=this.isCategory();function a(n){dL(e.color)&&!n.inRange&&(n.inRange={color:e.color.slice().reverse()}),n.inRange=n.inRange||{color:t.get("gradientColor")},fL(this.stateList,function(t){var e=n[t];if(z(e)){var i=lL(e,"active",u);i?(n[t]={},n[t][e]=i):delete n[t]}},this)}a.call(this,n),a.call(this,o),function(t,e,i){var n=t[e],o=t[i];n&&!o&&(o=t[i]={},fL(n,function(t,e){if(a_.isValidType(e)){var i=lL(e,"inactive",u);null!=i&&(o[e]=i,"color"!==e||o.hasOwnProperty("opacity")||o.hasOwnProperty("colorAlpha")||(o.opacity=[0,0]))}}))}.call(this,n,"inRange","outOfRange"),function(a){var r=(a.inRange||{}).symbol||(a.outOfRange||{}).symbol,s=(a.inRange||{}).symbolSize||(a.outOfRange||{}).symbolSize,l=this.get("inactiveColor");fL(this.stateList,function(t){var e=this.itemSize,i=a[t];null==(i=i||(a[t]={color:u?l:[l]})).symbol&&(i.symbol=r&&D(r)||(u?"roundRect":["roundRect"])),null==i.symbolSize&&(i.symbolSize=s&&D(s)||(u?e[0]:[e[0],e[0]])),i.symbol=hL(i.symbol,function(t){return"none"===t||"square"===t?"roundRect":t});var n=i.symbolSize;if(null!=n){var o=-1/0;cL(n,function(t){oe[1]&&e.reverse(),e[0]=Math.max(e[0],t[0]),e[1]=Math.min(e[1],t[1]))},completeVisualOption:function(){mL.prototype.completeVisualOption.apply(this,arguments),E(this.stateList,function(t){var e=this.option.controller[t].symbolSize;e&&e[0]!==e[1]&&(e[0]=0)},this)},setSelected:function(t){this.option.range=t.slice(),this._resetRange()},getSelected:function(){var t=this.getExtent(),e=Ol((this.get("range")||[]).slice());return e[0]>t[1]&&(e[0]=t[1]),e[1]>t[1]&&(e[1]=t[1]),e[0]=i[1]||t<=e[1])?"inRange":"outOfRange"},findTargetDataIndices:function(n){var o=[];return this.eachTargetSeries(function(t){var i=[],e=t.getData();e.each(this.getDataDimension(e),function(t,e){n[0]<=t&&t<=n[1]&&i.push(e)},this),o.push({seriesId:t.id,dataIndex:i})},this),o},getVisualMeta:function(i){var t=xL(this,"outOfRange",this.getExtent()),e=xL(this,"inRange",this.option.range.slice()),n=[];function o(t,e){n.push({value:t,color:i(t,e)})}for(var a=0,r=0,s=e.length,l=t.length;rt[1])break;i.push({color:this.getControllerVisual(a,"color",e),offset:o/100})}return i.push({color:this.getControllerVisual(t[1],"color",e),offset:1}),i},_createBarPoints:function(t,e){var i=this.visualMapModel.itemSize;return[[i[0]-e[0],t[0]],[i[0],t[0]],[i[0],t[1]],[i[0]-e[1],t[1]]]},_createBarGroup:function(t){var e=this._orient,i=this.visualMapModel.get("inverse");return new Ii("horizontal"!==e||i?"horizontal"===e&&i?{scale:"bottom"===t?[-1,1]:[1,1],rotation:-Math.PI/2}:"vertical"!==e||i?{scale:"left"===t?[1,1]:[-1,1]}:{scale:"left"===t?[1,-1]:[-1,-1]}:{scale:"bottom"===t?[1,1]:[-1,1],rotation:Math.PI/2})},_updateHandle:function(n,o){if(this._useHandle){var a=this._shapes,r=this.visualMapModel,s=a.handleThumbs,l=a.handleLabels;ML([0,1],function(t){var e=s[t];e.setStyle("fill",o.handlesColor[t]),e.position[1]=n[t];var i=hl(a.handleLabelPoints[t],ul(e,this.group));l[t].setStyle({x:i[0],y:i[1],text:r.formatValueText(this._dataInterval[t]),textVerticalAlign:"middle",textAlign:this._applyTransform("horizontal"===this._orient?0===t?"bottom":"top":"left",a.barGroup)})},this)}},_showIndicator:function(t,e,i,n){var o=this.visualMapModel,a=o.getExtent(),r=o.itemSize,s=[0,r[1]],l=SL(t,a,s,!0),u=this._shapes,h=u.indicator;if(h){h.position[1]=l,h.attr("invisible",!1),h.setShape("points",function(t,e,i,n){return t?[[0,-IL(e,TL(i,0))],[6,0],[0,IL(e,TL(n-i,0))]]:[[0,0],[5,-5],[5,5]]}(!!i,n,l,r[1]));var c=this.getControllerVisual(t,"color",{convertOpacityToAlpha:!0});h.setStyle("fill",c);var d=hl(u.indicatorLabelPoint,ul(h,this.group)),f=u.indicatorLabel;f.attr("invisible",!1);var p=this._applyTransform("left",u.barGroup),g=this._orient;f.setStyle({text:(i||"")+o.formatValueText(e),textVerticalAlign:"horizontal"===g?p:"middle",textAlign:"horizontal"===g?"center":p,x:d[0],y:d[1]})}},_enableHoverLinkToSeries:function(){var n=this;this._shapes.barGroup.on("mousemove",function(t){if(n._hovering=!0,!n._dragging){var e=n.visualMapModel.itemSize,i=n._applyTransform([t.offsetX,t.offsetY],n._shapes.barGroup,!0,!0);i[1]=IL(TL(0,i[1]),e[1]),n._doHoverLinkToSeries(i[1],0<=i[0]&&i[0]<=e[0])}}).on("mouseout",function(){n._hovering=!1,n._dragging||n._clearHoverLinkToSeries()})},_enableHoverLinkFromSeries:function(){var t=this.api.getZr();this.visualMapModel.option.hoverLink?(t.on("mouseover",this._hoverLinkFromSeriesMouseOver,this),t.on("mouseout",this._hideIndicator,this)):this._clearHoverLinkFromSeries()},_doHoverLinkToSeries:function(t,e){var i=this.visualMapModel,n=i.itemSize;if(i.option.hoverLink){var o=[0,n[1]],a=i.getExtent();t=IL(TL(o[0],t),o[1]);var r=function(t,e,i){var n=6,o=t.get("hoverLinkDataSize");o&&(n=SL(o,e,i,!0)/2);return n}(i,a,o),s=[t-r,t+r],l=SL(t,o,a,!0),u=[SL(s[0],o,a,!0),SL(s[1],o,a,!0)];s[0] ",r):this._showIndicator(l,l,"≈ ",r));var h=this._hoverLinkDataIndices,c=[];(e||CL(i))&&(c=this._hoverLinkDataIndices=i.findTargetDataIndices(u));var d=function(t,e){var i={},n={};return o(t||[],i),o(e||[],n,i),[a(i),a(n)];function o(t,e,i){for(var n=0,o=t.length;ni&&n([i,e[0]],"outOfRange"),n(e.slice()),i=e[1])},this),{stops:a,outerColors:r}}function n(t,e){var i=s.getRepresentValue({interval:t});e=e||s.getValueState(i);var n=o(i,e);t[0]===-1/0?r[0]=n:t[1]===1/0?r[1]=n:a.push({value:t[0],color:n},{value:t[1],color:n})}}}),PL={splitNumber:function(){var t=this.option,e=this._pieceList,i=Math.min(t.precision,20),n=this.getExtent(),o=t.splitNumber;o=Math.max(parseInt(o,10),1),t.splitNumber=o;for(var a=(n[1]-n[0])/o;+a.toFixed(i)!==a&&i<5;)i++;t.precision=i,a=+a.toFixed(i);var r=0;t.minOpen&&e.push({index:r++,interval:[-1/0,n[0]],close:[0,0]});for(var s=n[0],l=r+o;r","≥"][e[0]]];t.text=t.text||this.formatValueText(null!=t.value?t.value:t.interval,!1,i)},this)}};function NL(t,e){var i=t.inverse;("vertical"===t.orient?!i:i)&&e.reverse()}_L.extend({type:"visualMap.piecewise",doRender:function(){var a=this.group;a.removeAll();var r=this.visualMapModel,s=r.get("textGap"),t=r.textStyleModel,l=t.getFont(),u=t.getTextColor(),h=this._getItemAlign(),c=r.itemSize,e=this._getViewData(),i=e.endsText,d=W(r.get("showLabel",!0),!i);i&&this._renderEndsText(a,i[0],c,d,h),E(e.viewPieceList,function(t){var e=t.piece,i=new Ii;i.onclick=A(this._onItemClick,this,e),this._enableHoverLink(i,t.indexInModelPieceList);var n=r.getRepresentValue(e);if(this._createItemSymbol(i,n,[0,0,c[0],c[1]]),d){var o=this.visualMapModel.getValueState(n);i.add(new Fr({style:{x:"right"===h?-s:c[0]+s,y:c[1]/2,text:e.text,textVerticalAlign:"middle",textAlign:h,textFont:l,textFill:u,opacity:"outOfRange"===o?.5:1}}))}a.add(i)},this),i&&this._renderEndsText(a,i[1],c,d,h),mu(r.get("orient"),a,r.get("itemGap")),this.renderBackground(a),this.positionGroup(a)},_enableHoverLink:function(t,i){function e(t){var e=this.visualMapModel;e.option.hoverLink&&this.api.dispatchAction({type:t,batch:bL(e.findTargetDataIndices(i),e)})}t.on("mouseover",A(e,this,"highlight")).on("mouseout",A(e,this,"downplay"))},_getItemAlign:function(){var t=this.visualMapModel,e=t.option;if("vertical"===e.orient)return wL(t,this.api,t.itemSize);var i=e.align;return i&&"auto"!==i||(i="left"),i},_renderEndsText:function(t,e,i,n,o){if(e){var a=new Ii,r=this.visualMapModel.textStyleModel;a.add(new Fr({style:{x:n?"right"===o?i[0]:0:i[0]/2,y:i[1]/2,textVerticalAlign:"middle",textAlign:n?o:"center",text:e,textFont:r.getFont(),textFill:r.getTextColor()}})),t.add(a)}},_getViewData:function(){var t=this.visualMapModel,e=N(t.getPieceList(),function(t,e){return{piece:t,indexInModelPieceList:e}}),i=t.get("text"),n=t.get("orient"),o=t.get("inverse");return("horizontal"===n?o:!o)?e.reverse():i=i&&i.slice().reverse(),{viewPieceList:e,endsText:i}},_createItemSymbol:function(t,e,i){t.add(mg(this.getControllerVisual(e,"symbol"),i[0],i[1],i[2],i[3],this.getControllerVisual(e,"color")))},_onItemClick:function(t){var e=this.visualMapModel,i=e.option,n=D(i.selected),o=e.getSelectedMapKey(t);"single"===i.selectedMode?(n[o]=!0,E(n,function(t,e){n[e]=e===o})):n[o]=!n[o],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:n})}});ff(iL);var OL,EL="urn:schemas-microsoft-com:vml",zL="undefined"==typeof window?null:window,RL=!1,BL=zL&&zL.document;function VL(t){return OL(t)}if(BL&&!v.canvasSupported)try{BL.namespaces.zrvml||BL.namespaces.add("zrvml",EL),OL=function(t){return BL.createElement("')}}catch(t){OL=function(t){return BL.createElement("<"+t+' xmlns="'+EL+'" class="zrvml">')}}var GL,FL=ir.CMD,WL=Math.round,HL=Math.sqrt,ZL=Math.abs,UL=Math.cos,XL=Math.sin,YL=Math.max;if(!v.canvasSupported){var jL=",",qL="progid:DXImageTransform.Microsoft",KL=21600,$L=KL/2,JL=function(t){t.style.cssText="position:absolute;left:0;top:0;width:1px;height:1px;",t.coordsize=KL+","+KL,t.coordorigin="0,0"},QL=function(t,e,i){return"rgb("+[t,e,i].join(",")+")"},tk=function(t,e){e&&t&&e.parentNode!==t&&t.appendChild(e)},ek=function(t,e){e&&t&&e.parentNode===t&&t.removeChild(e)},ik=function(t,e,i){return 1e5*(parseFloat(t)||0)+1e3*(parseFloat(e)||0)+i},nk=Hn,ok=function(t,e,i){var n=Re(e);i=+i,isNaN(i)&&(i=1),n&&(t.color=QL(n[0],n[1],n[2]),t.opacity=i*n[3])},ak=function(t,e,i,n){var o="fill"===e,a=t.getElementsByTagName(e)[0];null!=i[e]&&"none"!==i[e]&&(o||!o&&i.lineWidth)?(t[o?"filled":"stroked"]="true",i[e]instanceof ss&&ek(t,a),a=a||VL(e),o?function(t,e,i){var n,o,a=e.fill;if(null!=a)if(a instanceof ss){var r,s=0,l=[0,0],u=0,h=1,c=i.getBoundingRect(),d=c.width,f=c.height;if("linear"===a.type){r="gradient";var p=i.transform,g=[a.x*d,a.y*f],m=[a.x2*d,a.y2*f];p&&(bt(g,g,p),bt(m,m,p));var v=m[0]-g[0],y=m[1]-g[1];(s=180*Math.atan2(v,y)/Math.PI)<0&&(s+=360),s<1e-6&&(s=0)}else{r="gradientradial";g=[a.x*d,a.y*f],p=i.transform;var x=i.scale,_=d,w=f;l=[(g[0]-c.x)/_,(g[1]-c.y)/w],p&&bt(g,g,p),_/=x[0]*KL,w/=x[1]*KL;var b=YL(_,w);u=0/b,h=2*a.r/b-u}var S=a.colorStops.slice();S.sort(function(t,e){return t.offset-e.offset});for(var M=S.length,I=[],T=[],A=0;A=c&&d<=i+1){for(var n=[],o=0;o=c&&d<=o+1)return jk(h,e.components,u,l);p[t]=e}else p[t]=void 0}var s;f++}for(;f<=e;){var r=a();if(r)return r}},pushComponent:function(t,e,i){var n=t[t.length-1];n&&n.added===e&&n.removed===i?t[t.length-1]={count:n.count+1,added:e,removed:i}:t.push({count:1,added:e,removed:i})},extractCommon:function(t,e,i,n){for(var o=e.length,a=i.length,r=t.newPos,s=r-n,l=0;r+1 { + Object.defineProperty(ctx, style, { + set: value => { + if (style !== 'fillStyle' && style !== 'strokeStyle' + || value !== 'none' && value !== null + ) { + ctx['set' + style.charAt(0).toUpperCase() + style.slice(1)](value); + } + } + }); + }); + + ctx.createRadialGradient = () => { + return ctx.createCircularGradient(arguments); + }; + } + + _initEvent() { + this.event = {}; + const eventNames = [{ + wxName: 'touchStart', + ecName: 'mousedown' + }, { + wxName: 'touchMove', + ecName: 'mousemove' + }, { + wxName: 'touchEnd', + ecName: 'mouseup' + }, { + wxName: 'touchEnd', + ecName: 'click' + }]; + + eventNames.forEach(name => { + this.event[name.wxName] = e => { + const touch = e.touches[0]; + this.chart.getZr().handler.dispatch(name.ecName, { + zrX: name.wxName === 'tap' ? touch.clientX : touch.x, + zrY: name.wxName === 'tap' ? touch.clientY : touch.y + }); + }; + }); + } + + set width(w) { + if (this.canvasNode) this.canvasNode.width = w + } + set height(h) { + if (this.canvasNode) this.canvasNode.height = h + } + + get width() { + if (this.canvasNode) + return this.canvasNode.width + return 0 + } + get height() { + if (this.canvasNode) + return this.canvasNode.height + return 0 + } +} diff --git a/yanzhu-ui-app/miniprogram/images/biyan.png b/yanzhu-ui-app/miniprogram/images/biyan.png new file mode 100644 index 00000000..ce424972 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/biyan.png differ diff --git a/yanzhu-ui-app/miniprogram/images/bottom.png b/yanzhu-ui-app/miniprogram/images/bottom.png new file mode 100644 index 00000000..4fbe5f46 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/bottom.png differ diff --git a/yanzhu-ui-app/miniprogram/images/core.png b/yanzhu-ui-app/miniprogram/images/core.png new file mode 100644 index 00000000..3b89e0b6 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/core.png differ diff --git a/yanzhu-ui-app/miniprogram/images/cz_1.png b/yanzhu-ui-app/miniprogram/images/cz_1.png new file mode 100644 index 00000000..9922e2cc Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/cz_1.png differ diff --git a/yanzhu-ui-app/miniprogram/images/cz_2.png b/yanzhu-ui-app/miniprogram/images/cz_2.png new file mode 100644 index 00000000..ab101562 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/cz_2.png differ diff --git a/yanzhu-ui-app/miniprogram/images/dingwei.png b/yanzhu-ui-app/miniprogram/images/dingwei.png new file mode 100644 index 00000000..9fb08c30 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/dingwei.png differ diff --git a/yanzhu-ui-app/miniprogram/images/early.png b/yanzhu-ui-app/miniprogram/images/early.png new file mode 100644 index 00000000..ca7aca0c Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/early.png differ diff --git a/yanzhu-ui-app/miniprogram/images/fanhui.png b/yanzhu-ui-app/miniprogram/images/fanhui.png new file mode 100644 index 00000000..aa8bdaa3 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/fanhui.png differ diff --git a/yanzhu-ui-app/miniprogram/images/foot_1.png b/yanzhu-ui-app/miniprogram/images/foot_1.png new file mode 100644 index 00000000..5b00a21c Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/foot_1.png differ diff --git a/yanzhu-ui-app/miniprogram/images/foot_2.png b/yanzhu-ui-app/miniprogram/images/foot_2.png new file mode 100644 index 00000000..908ddb87 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/foot_2.png differ diff --git a/yanzhu-ui-app/miniprogram/images/foot_3.png b/yanzhu-ui-app/miniprogram/images/foot_3.png new file mode 100644 index 00000000..cf61a264 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/foot_3.png differ diff --git a/yanzhu-ui-app/miniprogram/images/foot_4.png b/yanzhu-ui-app/miniprogram/images/foot_4.png new file mode 100644 index 00000000..32d0110f Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/foot_4.png differ diff --git a/yanzhu-ui-app/miniprogram/images/foot_5.png b/yanzhu-ui-app/miniprogram/images/foot_5.png new file mode 100644 index 00000000..6cd39b0a Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/foot_5.png differ diff --git a/yanzhu-ui-app/miniprogram/images/foot_6.png b/yanzhu-ui-app/miniprogram/images/foot_6.png new file mode 100644 index 00000000..20917a91 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/foot_6.png differ diff --git a/yanzhu-ui-app/miniprogram/images/foot_7.png b/yanzhu-ui-app/miniprogram/images/foot_7.png new file mode 100644 index 00000000..6f34a65c Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/foot_7.png differ diff --git a/yanzhu-ui-app/miniprogram/images/footer_1.png b/yanzhu-ui-app/miniprogram/images/footer_1.png new file mode 100644 index 00000000..f75dcc18 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/footer_1.png differ diff --git a/yanzhu-ui-app/miniprogram/images/footer_2.png b/yanzhu-ui-app/miniprogram/images/footer_2.png new file mode 100644 index 00000000..4a640566 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/footer_2.png differ diff --git a/yanzhu-ui-app/miniprogram/images/footer_3.png b/yanzhu-ui-app/miniprogram/images/footer_3.png new file mode 100644 index 00000000..82321d04 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/footer_3.png differ diff --git a/yanzhu-ui-app/miniprogram/images/footer_4.png b/yanzhu-ui-app/miniprogram/images/footer_4.png new file mode 100644 index 00000000..40b28bc7 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/footer_4.png differ diff --git a/yanzhu-ui-app/miniprogram/images/footer_5.png b/yanzhu-ui-app/miniprogram/images/footer_5.png new file mode 100644 index 00000000..e00b504c Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/footer_5.png differ diff --git a/yanzhu-ui-app/miniprogram/images/footer_6.png b/yanzhu-ui-app/miniprogram/images/footer_6.png new file mode 100644 index 00000000..0cad69b4 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/footer_6.png differ diff --git a/yanzhu-ui-app/miniprogram/images/footer_7.png b/yanzhu-ui-app/miniprogram/images/footer_7.png new file mode 100644 index 00000000..a6aed484 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/footer_7.png differ diff --git a/yanzhu-ui-app/miniprogram/images/guodu.gif b/yanzhu-ui-app/miniprogram/images/guodu.gif new file mode 100644 index 00000000..2c0238a1 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/guodu.gif differ diff --git a/yanzhu-ui-app/miniprogram/images/i_location.png b/yanzhu-ui-app/miniprogram/images/i_location.png new file mode 100644 index 00000000..5ef39fec Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/i_location.png differ diff --git a/yanzhu-ui-app/miniprogram/images/i_mechanics.png b/yanzhu-ui-app/miniprogram/images/i_mechanics.png new file mode 100644 index 00000000..957fa4ab Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/i_mechanics.png differ diff --git a/yanzhu-ui-app/miniprogram/images/i_personnel.png b/yanzhu-ui-app/miniprogram/images/i_personnel.png new file mode 100644 index 00000000..216695bc Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/i_personnel.png differ diff --git a/yanzhu-ui-app/miniprogram/images/icon_1.png b/yanzhu-ui-app/miniprogram/images/icon_1.png new file mode 100644 index 00000000..17a62909 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/icon_1.png differ diff --git a/yanzhu-ui-app/miniprogram/images/icon_2.png b/yanzhu-ui-app/miniprogram/images/icon_2.png new file mode 100644 index 00000000..d46f8f4f Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/icon_2.png differ diff --git a/yanzhu-ui-app/miniprogram/images/icon_3.png b/yanzhu-ui-app/miniprogram/images/icon_3.png new file mode 100644 index 00000000..7b59453d Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/icon_3.png differ diff --git a/yanzhu-ui-app/miniprogram/images/icon_4.png b/yanzhu-ui-app/miniprogram/images/icon_4.png new file mode 100644 index 00000000..c682c6e0 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/icon_4.png differ diff --git a/yanzhu-ui-app/miniprogram/images/icon_5.png b/yanzhu-ui-app/miniprogram/images/icon_5.png new file mode 100644 index 00000000..f7015031 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/icon_5.png differ diff --git a/yanzhu-ui-app/miniprogram/images/icons_1.png b/yanzhu-ui-app/miniprogram/images/icons_1.png new file mode 100644 index 00000000..4a01a1e5 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/icons_1.png differ diff --git a/yanzhu-ui-app/miniprogram/images/icons_2.png b/yanzhu-ui-app/miniprogram/images/icons_2.png new file mode 100644 index 00000000..22f8ff27 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/icons_2.png differ diff --git a/yanzhu-ui-app/miniprogram/images/icons_3.png b/yanzhu-ui-app/miniprogram/images/icons_3.png new file mode 100644 index 00000000..81e04f9c Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/icons_3.png differ diff --git a/yanzhu-ui-app/miniprogram/images/icons_4.png b/yanzhu-ui-app/miniprogram/images/icons_4.png new file mode 100644 index 00000000..e71a7505 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/icons_4.png differ diff --git a/yanzhu-ui-app/miniprogram/images/icons_5.png b/yanzhu-ui-app/miniprogram/images/icons_5.png new file mode 100644 index 00000000..cd75a414 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/icons_5.png differ diff --git a/yanzhu-ui-app/miniprogram/images/img_1.png b/yanzhu-ui-app/miniprogram/images/img_1.png new file mode 100644 index 00000000..6bf5dc50 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/img_1.png differ diff --git a/yanzhu-ui-app/miniprogram/images/img_10.png b/yanzhu-ui-app/miniprogram/images/img_10.png new file mode 100644 index 00000000..8298f45a Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/img_10.png differ diff --git a/yanzhu-ui-app/miniprogram/images/img_11.png b/yanzhu-ui-app/miniprogram/images/img_11.png new file mode 100644 index 00000000..1cc4db5a Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/img_11.png differ diff --git a/yanzhu-ui-app/miniprogram/images/img_12.png b/yanzhu-ui-app/miniprogram/images/img_12.png new file mode 100644 index 00000000..adca3507 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/img_12.png differ diff --git a/yanzhu-ui-app/miniprogram/images/img_2.png b/yanzhu-ui-app/miniprogram/images/img_2.png new file mode 100644 index 00000000..d7598e52 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/img_2.png differ diff --git a/yanzhu-ui-app/miniprogram/images/img_3.png b/yanzhu-ui-app/miniprogram/images/img_3.png new file mode 100644 index 00000000..adbaadc5 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/img_3.png differ diff --git a/yanzhu-ui-app/miniprogram/images/img_4.png b/yanzhu-ui-app/miniprogram/images/img_4.png new file mode 100644 index 00000000..0e34b20e Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/img_4.png differ diff --git a/yanzhu-ui-app/miniprogram/images/img_5.png b/yanzhu-ui-app/miniprogram/images/img_5.png new file mode 100644 index 00000000..635aa8d6 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/img_5.png differ diff --git a/yanzhu-ui-app/miniprogram/images/img_6.png b/yanzhu-ui-app/miniprogram/images/img_6.png new file mode 100644 index 00000000..c67e2e77 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/img_6.png differ diff --git a/yanzhu-ui-app/miniprogram/images/img_7.png b/yanzhu-ui-app/miniprogram/images/img_7.png new file mode 100644 index 00000000..6c247af3 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/img_7.png differ diff --git a/yanzhu-ui-app/miniprogram/images/img_8.png b/yanzhu-ui-app/miniprogram/images/img_8.png new file mode 100644 index 00000000..1025c198 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/img_8.png differ diff --git a/yanzhu-ui-app/miniprogram/images/img_9.png b/yanzhu-ui-app/miniprogram/images/img_9.png new file mode 100644 index 00000000..c5bbf838 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/img_9.png differ diff --git a/yanzhu-ui-app/miniprogram/images/info_title_0.png b/yanzhu-ui-app/miniprogram/images/info_title_0.png new file mode 100644 index 00000000..0ee281f2 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/info_title_0.png differ diff --git a/yanzhu-ui-app/miniprogram/images/jt.png b/yanzhu-ui-app/miniprogram/images/jt.png new file mode 100644 index 00000000..1340ac78 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/jt.png differ diff --git a/yanzhu-ui-app/miniprogram/images/left.png b/yanzhu-ui-app/miniprogram/images/left.png new file mode 100644 index 00000000..ab354850 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/left.png differ diff --git a/yanzhu-ui-app/miniprogram/images/loding.gif b/yanzhu-ui-app/miniprogram/images/loding.gif new file mode 100644 index 00000000..d9bb3c55 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/loding.gif differ diff --git a/yanzhu-ui-app/miniprogram/images/lw_1.png b/yanzhu-ui-app/miniprogram/images/lw_1.png new file mode 100644 index 00000000..5a54cbdc Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/lw_1.png differ diff --git a/yanzhu-ui-app/miniprogram/images/lw_2.png b/yanzhu-ui-app/miniprogram/images/lw_2.png new file mode 100644 index 00000000..52388b10 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/lw_2.png differ diff --git a/yanzhu-ui-app/miniprogram/images/lw_3.png b/yanzhu-ui-app/miniprogram/images/lw_3.png new file mode 100644 index 00000000..d73d1c31 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/lw_3.png differ diff --git a/yanzhu-ui-app/miniprogram/images/lw_4.png b/yanzhu-ui-app/miniprogram/images/lw_4.png new file mode 100644 index 00000000..a177e21c Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/lw_4.png differ diff --git a/yanzhu-ui-app/miniprogram/images/lw_5.png b/yanzhu-ui-app/miniprogram/images/lw_5.png new file mode 100644 index 00000000..3e9545e4 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/lw_5.png differ diff --git a/yanzhu-ui-app/miniprogram/images/lw_6.png b/yanzhu-ui-app/miniprogram/images/lw_6.png new file mode 100644 index 00000000..aa68320c Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/lw_6.png differ diff --git a/yanzhu-ui-app/miniprogram/images/lw_7.png b/yanzhu-ui-app/miniprogram/images/lw_7.png new file mode 100644 index 00000000..b06c5261 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/lw_7.png differ diff --git a/yanzhu-ui-app/miniprogram/images/lw_8.png b/yanzhu-ui-app/miniprogram/images/lw_8.png new file mode 100644 index 00000000..1927a100 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/lw_8.png differ diff --git a/yanzhu-ui-app/miniprogram/images/middl_right.png b/yanzhu-ui-app/miniprogram/images/middl_right.png new file mode 100644 index 00000000..ec22d605 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/middl_right.png differ diff --git a/yanzhu-ui-app/miniprogram/images/middle_left.png b/yanzhu-ui-app/miniprogram/images/middle_left.png new file mode 100644 index 00000000..5c7e05fc Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/middle_left.png differ diff --git a/yanzhu-ui-app/miniprogram/images/new_add.png b/yanzhu-ui-app/miniprogram/images/new_add.png new file mode 100644 index 00000000..5f11ed2d Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/new_add.png differ diff --git a/yanzhu-ui-app/miniprogram/images/nodata.png b/yanzhu-ui-app/miniprogram/images/nodata.png new file mode 100644 index 00000000..17d832cc Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/nodata.png differ diff --git a/yanzhu-ui-app/miniprogram/images/quanping.png b/yanzhu-ui-app/miniprogram/images/quanping.png new file mode 100644 index 00000000..7dc54d9c Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/quanping.png differ diff --git a/yanzhu-ui-app/miniprogram/images/right.png b/yanzhu-ui-app/miniprogram/images/right.png new file mode 100644 index 00000000..f09a421d Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/right.png differ diff --git a/yanzhu-ui-app/miniprogram/images/s_1.png b/yanzhu-ui-app/miniprogram/images/s_1.png new file mode 100644 index 00000000..4475e32c Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/s_1.png differ diff --git a/yanzhu-ui-app/miniprogram/images/s_10.png b/yanzhu-ui-app/miniprogram/images/s_10.png new file mode 100644 index 00000000..a5720ae0 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/s_10.png differ diff --git a/yanzhu-ui-app/miniprogram/images/s_11.png b/yanzhu-ui-app/miniprogram/images/s_11.png new file mode 100644 index 00000000..31523ab3 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/s_11.png differ diff --git a/yanzhu-ui-app/miniprogram/images/s_12.png b/yanzhu-ui-app/miniprogram/images/s_12.png new file mode 100644 index 00000000..83a890b5 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/s_12.png differ diff --git a/yanzhu-ui-app/miniprogram/images/s_13.png b/yanzhu-ui-app/miniprogram/images/s_13.png new file mode 100644 index 00000000..df8d7441 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/s_13.png differ diff --git a/yanzhu-ui-app/miniprogram/images/s_14.png b/yanzhu-ui-app/miniprogram/images/s_14.png new file mode 100644 index 00000000..36e170b4 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/s_14.png differ diff --git a/yanzhu-ui-app/miniprogram/images/s_15.png b/yanzhu-ui-app/miniprogram/images/s_15.png new file mode 100644 index 00000000..9cfa9793 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/s_15.png differ diff --git a/yanzhu-ui-app/miniprogram/images/s_16.png b/yanzhu-ui-app/miniprogram/images/s_16.png new file mode 100644 index 00000000..d044e624 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/s_16.png differ diff --git a/yanzhu-ui-app/miniprogram/images/s_17.png b/yanzhu-ui-app/miniprogram/images/s_17.png new file mode 100644 index 00000000..192f1c04 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/s_17.png differ diff --git a/yanzhu-ui-app/miniprogram/images/s_18.png b/yanzhu-ui-app/miniprogram/images/s_18.png new file mode 100644 index 00000000..4c8abeb7 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/s_18.png differ diff --git a/yanzhu-ui-app/miniprogram/images/s_2.png b/yanzhu-ui-app/miniprogram/images/s_2.png new file mode 100644 index 00000000..3717e33e Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/s_2.png differ diff --git a/yanzhu-ui-app/miniprogram/images/s_3.png b/yanzhu-ui-app/miniprogram/images/s_3.png new file mode 100644 index 00000000..cf16c0b1 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/s_3.png differ diff --git a/yanzhu-ui-app/miniprogram/images/s_4.png b/yanzhu-ui-app/miniprogram/images/s_4.png new file mode 100644 index 00000000..222a809e Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/s_4.png differ diff --git a/yanzhu-ui-app/miniprogram/images/s_5.png b/yanzhu-ui-app/miniprogram/images/s_5.png new file mode 100644 index 00000000..fab5f4fd Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/s_5.png differ diff --git a/yanzhu-ui-app/miniprogram/images/s_6.png b/yanzhu-ui-app/miniprogram/images/s_6.png new file mode 100644 index 00000000..a8bced08 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/s_6.png differ diff --git a/yanzhu-ui-app/miniprogram/images/s_7.png b/yanzhu-ui-app/miniprogram/images/s_7.png new file mode 100644 index 00000000..f391ae41 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/s_7.png differ diff --git a/yanzhu-ui-app/miniprogram/images/s_8.png b/yanzhu-ui-app/miniprogram/images/s_8.png new file mode 100644 index 00000000..a86d30cc Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/s_8.png differ diff --git a/yanzhu-ui-app/miniprogram/images/s_9.png b/yanzhu-ui-app/miniprogram/images/s_9.png new file mode 100644 index 00000000..fc2acbaa Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/s_9.png differ diff --git a/yanzhu-ui-app/miniprogram/images/set.png b/yanzhu-ui-app/miniprogram/images/set.png new file mode 100644 index 00000000..a505b6f0 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/set.png differ diff --git a/yanzhu-ui-app/miniprogram/images/sliding_up.png b/yanzhu-ui-app/miniprogram/images/sliding_up.png new file mode 100644 index 00000000..5ba6954d Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/sliding_up.png differ diff --git a/yanzhu-ui-app/miniprogram/images/user_3.png b/yanzhu-ui-app/miniprogram/images/user_3.png new file mode 100644 index 00000000..cc37d238 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/user_3.png differ diff --git a/yanzhu-ui-app/miniprogram/images/video.png b/yanzhu-ui-app/miniprogram/images/video.png new file mode 100644 index 00000000..a14c8c7e Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/video.png differ diff --git a/yanzhu-ui-app/miniprogram/images/warning.png b/yanzhu-ui-app/miniprogram/images/warning.png new file mode 100644 index 00000000..773f8a86 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/warning.png differ diff --git a/yanzhu-ui-app/miniprogram/images/web_select_date.png b/yanzhu-ui-app/miniprogram/images/web_select_date.png new file mode 100644 index 00000000..9e308420 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/web_select_date.png differ diff --git a/yanzhu-ui-app/miniprogram/images/wl_fg.png b/yanzhu-ui-app/miniprogram/images/wl_fg.png new file mode 100644 index 00000000..9d4e45c3 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/wl_fg.png differ diff --git a/yanzhu-ui-app/miniprogram/images/yj_01.png b/yanzhu-ui-app/miniprogram/images/yj_01.png new file mode 100644 index 00000000..489d04a4 Binary files /dev/null and b/yanzhu-ui-app/miniprogram/images/yj_01.png differ diff --git a/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/action-sheet/index.js b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/action-sheet/index.js new file mode 100644 index 00000000..a9e4b076 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/action-sheet/index.js @@ -0,0 +1,64 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../common/component'); +var button_1 = require('../mixins/button'); +var open_type_1 = require('../mixins/open-type'); +component_1.VantComponent({ + mixins: [button_1.button, open_type_1.openType], + props: { + show: Boolean, + title: String, + cancelText: String, + description: String, + round: { + type: Boolean, + value: true, + }, + zIndex: { + type: Number, + value: 100, + }, + actions: { + type: Array, + value: [], + }, + overlay: { + type: Boolean, + value: true, + }, + closeOnClickOverlay: { + type: Boolean, + value: true, + }, + closeOnClickAction: { + type: Boolean, + value: true, + }, + safeAreaInsetBottom: { + type: Boolean, + value: true, + }, + }, + methods: { + onSelect: function (event) { + var index = event.currentTarget.dataset.index; + var item = this.data.actions[index]; + if (item && !item.disabled && !item.loading) { + this.$emit('select', item); + if (this.data.closeOnClickAction) { + this.onClose(); + } + } + }, + onCancel: function () { + this.$emit('cancel'); + }, + onClose: function () { + this.$emit('close'); + }, + onClickOverlay: function () { + this.$emit('click-overlay'); + this.onClose(); + }, + }, +}); diff --git a/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/action-sheet/index.json b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/action-sheet/index.json new file mode 100644 index 00000000..19bf9891 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/action-sheet/index.json @@ -0,0 +1,8 @@ +{ + "component": true, + "usingComponents": { + "van-icon": "../icon/index", + "van-popup": "../popup/index", + "van-loading": "../loading/index" + } +} diff --git a/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/action-sheet/index.wxml b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/action-sheet/index.wxml new file mode 100644 index 00000000..7ed28196 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/action-sheet/index.wxml @@ -0,0 +1,67 @@ + + + + + {{ title }} + + + + {{ description }} + + + + + + + + {{ cancelText }} + + diff --git a/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/action-sheet/index.wxss b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/action-sheet/index.wxss new file mode 100644 index 00000000..dc54840c --- /dev/null +++ b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/action-sheet/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-action-sheet{max-height:90%!important;max-height:var(--action-sheet-max-height,90%)!important;color:#323233;color:var(--action-sheet-item-text-color,#323233)}.van-action-sheet__cancel,.van-action-sheet__item{text-align:center;font-size:16px;font-size:var(--action-sheet-item-font-size,16px);line-height:50px;line-height:var(--action-sheet-item-height,50px);background-color:#fff;background-color:var(--action-sheet-item-background,#fff)}.van-action-sheet__cancel--hover,.van-action-sheet__item--hover{background-color:#f2f3f5;background-color:var(--active-color,#f2f3f5)}.van-action-sheet__cancel:before{display:block;content:" ";height:8px;height:var(--action-sheet-cancel-padding-top,8px);background-color:#f7f8fa;background-color:var(--action-sheet-cancel-padding-color,#f7f8fa)}.van-action-sheet__item--disabled{color:#c8c9cc;color:var(--action-sheet-item-disabled-text-color,#c8c9cc)}.van-action-sheet__item--disabled.van-action-sheet__item--hover{background-color:#fff;background-color:var(--action-sheet-item-background,#fff)}.van-action-sheet__subname{margin-left:4px;margin-left:var(--padding-base,4px);font-size:12px;font-size:var(--action-sheet-subname-font-size,12px);color:#646566;color:var(--action-sheet-subname-color,#646566)}.van-action-sheet__header{text-align:center;font-weight:500;font-weight:var(--font-weight-bold,500);font-size:16px;font-size:var(--action-sheet-header-font-size,16px);line-height:44px;line-height:var(--action-sheet-header-height,44px)}.van-action-sheet__description{text-align:center;padding:16px;padding:var(--padding-md,16px);color:#646566;color:var(--action-sheet-description-color,#646566);font-size:14px;font-size:var(--action-sheet-description-font-size,14px);line-height:20px;line-height:var(--action-sheet-description-line-height,20px)}.van-action-sheet__close{position:absolute!important;top:0;right:0;line-height:inherit!important;padding:0 12px;padding:var(--action-sheet-close-icon-padding,0 12px);font-size:18px!important;font-size:var(--action-sheet-close-icon-size,18px)!important;color:#969799;color:var(--action-sheet-close-icon-color,#969799)}.van-action-sheet__loading{display:-webkit-flex!important;display:flex!important;height:50px;height:var(--action-sheet-item-height,50px)} \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/area/index.js b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/area/index.js new file mode 100644 index 00000000..ed80e4c1 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/area/index.js @@ -0,0 +1,257 @@ +'use strict'; +var __assign = + (this && this.__assign) || + function () { + __assign = + Object.assign || + function (t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); + }; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../common/component'); +var shared_1 = require('../picker/shared'); +var COLUMNSPLACEHOLDERCODE = '000000'; +component_1.VantComponent({ + classes: ['active-class', 'toolbar-class', 'column-class'], + props: __assign(__assign({}, shared_1.pickerProps), { + value: { + type: String, + observer: function (value) { + this.code = value; + this.setValues(); + }, + }, + areaList: { + type: Object, + value: {}, + observer: 'setValues', + }, + columnsNum: { + type: null, + value: 3, + observer: function (value) { + this.setData({ + displayColumns: this.data.columns.slice(0, +value), + }); + }, + }, + columnsPlaceholder: { + type: Array, + observer: function (val) { + this.setData({ + typeToColumnsPlaceholder: { + province: val[0] || '', + city: val[1] || '', + county: val[2] || '', + }, + }); + }, + }, + }), + data: { + columns: [{ values: [] }, { values: [] }, { values: [] }], + displayColumns: [{ values: [] }, { values: [] }, { values: [] }], + typeToColumnsPlaceholder: {}, + }, + mounted: function () { + var _this = this; + setTimeout(function () { + _this.setValues(); + }, 0); + }, + methods: { + getPicker: function () { + if (this.picker == null) { + this.picker = this.selectComponent('.van-area__picker'); + } + return this.picker; + }, + onCancel: function (event) { + this.emit('cancel', event.detail); + }, + onConfirm: function (event) { + var index = event.detail.index; + var value = event.detail.value; + value = this.parseOutputValues(value); + this.emit('confirm', { value: value, index: index }); + }, + emit: function (type, detail) { + detail.values = detail.value; + delete detail.value; + this.$emit(type, detail); + }, + // parse output columns data + parseOutputValues: function (values) { + var columnsPlaceholder = this.data.columnsPlaceholder; + return values.map(function (value, index) { + // save undefined value + if (!value) return value; + value = JSON.parse(JSON.stringify(value)); + if (!value.code || value.name === columnsPlaceholder[index]) { + value.code = ''; + value.name = ''; + } + return value; + }); + }, + onChange: function (event) { + var _this = this; + var _a = event.detail, + index = _a.index, + picker = _a.picker, + value = _a.value; + this.code = value[index].code; + this.setValues().then(function () { + _this.$emit('change', { + picker: picker, + values: _this.parseOutputValues(picker.getValues()), + index: index, + }); + }); + }, + getConfig: function (type) { + var areaList = this.data.areaList; + return (areaList && areaList[type + '_list']) || {}; + }, + getList: function (type, code) { + var typeToColumnsPlaceholder = this.data.typeToColumnsPlaceholder; + var result = []; + if (type !== 'province' && !code) { + return result; + } + var list = this.getConfig(type); + result = Object.keys(list).map(function (code) { + return { + code: code, + name: list[code], + }; + }); + if (code) { + // oversea code + if (code[0] === '9' && type === 'city') { + code = '9'; + } + result = result.filter(function (item) { + return item.code.indexOf(code) === 0; + }); + } + if (typeToColumnsPlaceholder[type] && result.length) { + // set columns placeholder + var codeFill = + type === 'province' + ? '' + : type === 'city' + ? COLUMNSPLACEHOLDERCODE.slice(2, 4) + : COLUMNSPLACEHOLDERCODE.slice(4, 6); + result.unshift({ + code: '' + code + codeFill, + name: typeToColumnsPlaceholder[type], + }); + } + return result; + }, + getIndex: function (type, code) { + var compareNum = type === 'province' ? 2 : type === 'city' ? 4 : 6; + var list = this.getList(type, code.slice(0, compareNum - 2)); + // oversea code + if (code[0] === '9' && type === 'province') { + compareNum = 1; + } + code = code.slice(0, compareNum); + for (var i = 0; i < list.length; i++) { + if (list[i].code.slice(0, compareNum) === code) { + return i; + } + } + return 0; + }, + setValues: function () { + var _this = this; + var county = this.getConfig('county'); + var code = this.code; + if (!code) { + if (this.data.columnsPlaceholder.length) { + code = COLUMNSPLACEHOLDERCODE; + } else if (Object.keys(county)[0]) { + code = Object.keys(county)[0]; + } else { + code = ''; + } + } + var province = this.getList('province'); + var city = this.getList('city', code.slice(0, 2)); + var picker = this.getPicker(); + if (!picker) { + return; + } + var stack = []; + stack.push(picker.setColumnValues(0, province, false)); + stack.push(picker.setColumnValues(1, city, false)); + if (city.length && code.slice(2, 4) === '00') { + code = city[0].code; + } + stack.push( + picker.setColumnValues( + 2, + this.getList('county', code.slice(0, 4)), + false + ) + ); + return Promise.all(stack) + .catch(function () {}) + .then(function () { + return picker.setIndexes([ + _this.getIndex('province', code), + _this.getIndex('city', code), + _this.getIndex('county', code), + ]); + }) + .catch(function () {}); + }, + getValues: function () { + var picker = this.getPicker(); + return picker + ? picker.getValues().filter(function (value) { + return !!value; + }) + : []; + }, + getDetail: function () { + var values = this.getValues(); + var area = { + code: '', + country: '', + province: '', + city: '', + county: '', + }; + if (!values.length) { + return area; + } + var names = values.map(function (item) { + return item.name; + }); + area.code = values[values.length - 1].code; + if (area.code[0] === '9') { + area.country = names[1] || ''; + area.province = names[2] || ''; + } else { + area.province = names[0] || ''; + area.city = names[1] || ''; + area.county = names[2] || ''; + } + return area; + }, + reset: function (code) { + this.code = code || ''; + return this.setValues(); + }, + }, +}); diff --git a/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/area/index.json b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/area/index.json new file mode 100644 index 00000000..a778e91c --- /dev/null +++ b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/area/index.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-picker": "../picker/index" + } +} diff --git a/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/area/index.wxml b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/area/index.wxml new file mode 100644 index 00000000..60757941 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/area/index.wxml @@ -0,0 +1,18 @@ + diff --git a/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/area/index.wxss b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/area/index.wxss new file mode 100644 index 00000000..99694d60 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/area/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss'; \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/button/index.js b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/button/index.js new file mode 100644 index 00000000..d38d35db --- /dev/null +++ b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/button/index.js @@ -0,0 +1,81 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../common/component'); +var button_1 = require('../mixins/button'); +var open_type_1 = require('../mixins/open-type'); +var version_1 = require('../common/version'); +var mixins = [button_1.button, open_type_1.openType]; +if (version_1.canIUseFormFieldButton()) { + mixins.push('wx://form-field-button'); +} +component_1.VantComponent({ + mixins: mixins, + classes: ['hover-class', 'loading-class'], + data: { + baseStyle: '', + }, + props: { + formType: String, + icon: String, + classPrefix: { + type: String, + value: 'van-icon', + }, + plain: Boolean, + block: Boolean, + round: Boolean, + square: Boolean, + loading: Boolean, + hairline: Boolean, + disabled: Boolean, + loadingText: String, + customStyle: String, + loadingType: { + type: String, + value: 'circular', + }, + type: { + type: String, + value: 'default', + }, + dataset: null, + size: { + type: String, + value: 'normal', + }, + loadingSize: { + type: String, + value: '20px', + }, + color: { + type: String, + observer: function (color) { + var style = ''; + if (color) { + style += 'color: ' + (this.data.plain ? color : 'white') + ';'; + if (!this.data.plain) { + // Use background instead of backgroundColor to make linear-gradient work + style += 'background: ' + color + ';'; + } + // hide border when color is linear-gradient + if (color.indexOf('gradient') !== -1) { + style += 'border: 0;'; + } else { + style += 'border-color: ' + color + ';'; + } + } + if (style !== this.data.baseStyle) { + this.setData({ baseStyle: style }); + } + }, + }, + }, + methods: { + onClick: function () { + if (!this.data.loading) { + this.$emit('click'); + } + }, + noop: function () {}, + }, +}); diff --git a/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/button/index.json b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/button/index.json new file mode 100644 index 00000000..e00a5887 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/button/index.json @@ -0,0 +1,7 @@ +{ + "component": true, + "usingComponents": { + "van-icon": "../icon/index", + "van-loading": "../loading/index" + } +} diff --git a/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/button/index.wxml b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/button/index.wxml new file mode 100644 index 00000000..ab393e8f --- /dev/null +++ b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/button/index.wxml @@ -0,0 +1,68 @@ + + + + + + +function get(type, color,plain) { + if(plain) { + return color ? color: '#c9c9c9'; + } + + if(type === 'default') { + return '#c9c9c9'; + } + return 'white'; +} + +module.exports = get; + diff --git a/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/button/index.wxss b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/button/index.wxss new file mode 100644 index 00000000..5a591fbd --- /dev/null +++ b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/button/index.wxss @@ -0,0 +1 @@ +@import '../common/index.wxss';.van-button{position:relative;display:-webkit-inline-flex;display:inline-flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;padding:0;text-align:center;vertical-align:middle;-webkit-appearance:none;-webkit-text-size-adjust:100%;height:44px;height:var(--button-default-height,44px);line-height:20px;line-height:var(--button-line-height,20px);font-size:16px;font-size:var(--button-default-font-size,16px);transition:opacity .2s;transition:opacity var(--animation-duration-fast,.2s);border-radius:2px;border-radius:var(--button-border-radius,2px)}.van-button:before{position:absolute;top:50%;left:50%;width:100%;height:100%;border:inherit;border-radius:inherit;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);opacity:0;content:" ";background-color:#000;background-color:var(--black,#000);border-color:#000;border-color:var(--black,#000)}.van-button:after{border-width:0}.van-button--active:before{opacity:.15}.van-button--unclickable:after{display:none}.van-button--default{color:#323233;color:var(--button-default-color,#323233);background:#fff;background:var(--button-default-background-color,#fff);border:1px solid #ebedf0;border:var(--button-border-width,1px) solid var(--button-default-border-color,#ebedf0)}.van-button--primary{color:#fff;color:var(--button-primary-color,#fff);background:#07c160;background:var(--button-primary-background-color,#07c160);border:1px solid #07c160;border:var(--button-border-width,1px) solid var(--button-primary-border-color,#07c160)}.van-button--info{color:#fff;color:var(--button-info-color,#fff);background:#1989fa;background:var(--button-info-background-color,#1989fa);border:1px solid #1989fa;border:var(--button-border-width,1px) solid var(--button-info-border-color,#1989fa)}.van-button--danger{color:#fff;color:var(--button-danger-color,#fff);background:#ee0a24;background:var(--button-danger-background-color,#ee0a24);border:1px solid #ee0a24;border:var(--button-border-width,1px) solid var(--button-danger-border-color,#ee0a24)}.van-button--warning{color:#fff;color:var(--button-warning-color,#fff);background:#ff976a;background:var(--button-warning-background-color,#ff976a);border:1px solid #ff976a;border:var(--button-border-width,1px) solid var(--button-warning-border-color,#ff976a)}.van-button--plain{background:#fff;background:var(--button-plain-background-color,#fff)}.van-button--plain.van-button--primary{color:#07c160;color:var(--button-primary-background-color,#07c160)}.van-button--plain.van-button--info{color:#1989fa;color:var(--button-info-background-color,#1989fa)}.van-button--plain.van-button--danger{color:#ee0a24;color:var(--button-danger-background-color,#ee0a24)}.van-button--plain.van-button--warning{color:#ff976a;color:var(--button-warning-background-color,#ff976a)}.van-button--large{width:100%;height:50px;height:var(--button-large-height,50px)}.van-button--normal{padding:0 15px;font-size:14px;font-size:var(--button-normal-font-size,14px)}.van-button--small{min-width:60px;min-width:var(--button-small-min-width,60px);height:30px;height:var(--button-small-height,30px);padding:0 8px;padding:0 var(--padding-xs,8px);font-size:12px;font-size:var(--button-small-font-size,12px)}.van-button--mini{display:inline-block;min-width:50px;min-width:var(--button-mini-min-width,50px);height:22px;height:var(--button-mini-height,22px);font-size:10px;font-size:var(--button-mini-font-size,10px)}.van-button--mini+.van-button--mini{margin-left:5px}.van-button--block{display:-webkit-flex;display:flex;width:100%}.van-button--round{border-radius:999px;border-radius:var(--button-round-border-radius,999px)}.van-button--square{border-radius:0}.van-button--disabled{opacity:.5;opacity:var(--button-disabled-opacity,.5)}.van-button__text{display:inline}.van-button__icon+.van-button__text:not(:empty),.van-button__loading-text{margin-left:4px}.van-button__icon{min-width:1em;line-height:inherit!important;vertical-align:top}.van-button--hairline{padding-top:1px;border-width:0}.van-button--hairline:after{border-color:inherit;border-width:1px;border-radius:4px;border-radius:calc(var(--button-border-radius, 2px)*2)}.van-button--hairline.van-button--round:after{border-radius:999px;border-radius:var(--button-round-border-radius,999px)}.van-button--hairline.van-button--square:after{border-radius:0} \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/calendar.wxml b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/calendar.wxml new file mode 100644 index 00000000..09a60b3e --- /dev/null +++ b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/calendar.wxml @@ -0,0 +1,57 @@ + + + diff --git a/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/components/header/index.js b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/components/header/index.js new file mode 100644 index 00000000..cf725aec --- /dev/null +++ b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/components/header/index.js @@ -0,0 +1,18 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../../../common/component'); +component_1.VantComponent({ + props: { + title: { + type: String, + value: '日期选择', + }, + subtitle: String, + showTitle: Boolean, + showSubtitle: Boolean, + }, + data: { + weekdays: ['日', '一', '二', '三', '四', '五', '六'], + }, + methods: {}, +}); diff --git a/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/components/header/index.json b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/components/header/index.json new file mode 100644 index 00000000..467ce294 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/components/header/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxml b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxml new file mode 100644 index 00000000..eb8e4b47 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxml @@ -0,0 +1,16 @@ + + + + {{ title }} + + + + {{ subtitle }} + + + + + {{ item }} + + + diff --git a/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxss b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxss new file mode 100644 index 00000000..4075e48f --- /dev/null +++ b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/components/header/index.wxss @@ -0,0 +1 @@ +@import '../../../common/index.wxss';.van-calendar__header{-webkit-flex-shrink:0;flex-shrink:0;box-shadow:0 2px 10px rgba(125,126,128,.16);box-shadow:var(--calendar-header-box-shadow,0 2px 10px rgba(125,126,128,.16))}.van-calendar__header-subtitle,.van-calendar__header-title{text-align:center;height:44px;height:var(--calendar-header-title-height,44px);font-weight:500;font-weight:var(--font-weight-bold,500);line-height:44px;line-height:var(--calendar-header-title-height,44px)}.van-calendar__header-title+.van-calendar__header-title,.van-calendar__header-title:empty{display:none}.van-calendar__header-title:empty+.van-calendar__header-title{display:block!important}.van-calendar__weekdays{display:-webkit-flex;display:flex}.van-calendar__weekday{-webkit-flex:1;flex:1;text-align:center;font-size:12px;font-size:var(--calendar-weekdays-font-size,12px);line-height:30px;line-height:var(--calendar-weekdays-height,30px)} \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/components/month/index.js b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/components/month/index.js new file mode 100644 index 00000000..1950c6c1 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/components/month/index.js @@ -0,0 +1,167 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../../../common/component'); +var utils_1 = require('../../utils'); +component_1.VantComponent({ + props: { + date: { + type: null, + observer: 'setDays', + }, + type: { + type: String, + observer: 'setDays', + }, + color: String, + minDate: { + type: null, + observer: 'setDays', + }, + maxDate: { + type: null, + observer: 'setDays', + }, + showMark: Boolean, + rowHeight: [Number, String], + formatter: { + type: null, + observer: 'setDays', + }, + currentDate: { + type: [null, Array], + observer: 'setDays', + }, + allowSameDay: Boolean, + showSubtitle: Boolean, + showMonthTitle: Boolean, + }, + data: { + visible: true, + days: [], + }, + methods: { + onClick: function (event) { + var index = event.currentTarget.dataset.index; + var item = this.data.days[index]; + if (item.type !== 'disabled') { + this.$emit('click', item); + } + }, + setDays: function () { + var days = []; + var startDate = new Date(this.data.date); + var year = startDate.getFullYear(); + var month = startDate.getMonth(); + var totalDay = utils_1.getMonthEndDay( + startDate.getFullYear(), + startDate.getMonth() + 1 + ); + for (var day = 1; day <= totalDay; day++) { + var date = new Date(year, month, day); + var type = this.getDayType(date); + var config = { + date: date, + type: type, + text: day, + bottomInfo: this.getBottomInfo(type), + }; + if (this.data.formatter) { + config = this.data.formatter(config); + } + days.push(config); + } + this.setData({ days: days }); + }, + getMultipleDayType: function (day) { + var currentDate = this.data.currentDate; + if (!Array.isArray(currentDate)) { + return ''; + } + var isSelected = function (date) { + return currentDate.some(function (item) { + return utils_1.compareDay(item, date) === 0; + }); + }; + if (isSelected(day)) { + var prevDay = utils_1.getPrevDay(day); + var nextDay = utils_1.getNextDay(day); + var prevSelected = isSelected(prevDay); + var nextSelected = isSelected(nextDay); + if (prevSelected && nextSelected) { + return 'multiple-middle'; + } + if (prevSelected) { + return 'end'; + } + return nextSelected ? 'start' : 'multiple-selected'; + } + return ''; + }, + getRangeDayType: function (day) { + var _a = this.data, + currentDate = _a.currentDate, + allowSameDay = _a.allowSameDay; + if (!Array.isArray(currentDate)) { + return; + } + var startDay = currentDate[0], + endDay = currentDate[1]; + if (!startDay) { + return; + } + var compareToStart = utils_1.compareDay(day, startDay); + if (!endDay) { + return compareToStart === 0 ? 'start' : ''; + } + var compareToEnd = utils_1.compareDay(day, endDay); + if (compareToStart === 0 && compareToEnd === 0 && allowSameDay) { + return 'start-end'; + } + if (compareToStart === 0) { + return 'start'; + } + if (compareToEnd === 0) { + return 'end'; + } + if (compareToStart > 0 && compareToEnd < 0) { + return 'middle'; + } + }, + getDayType: function (day) { + var _a = this.data, + type = _a.type, + minDate = _a.minDate, + maxDate = _a.maxDate, + currentDate = _a.currentDate; + if ( + utils_1.compareDay(day, minDate) < 0 || + utils_1.compareDay(day, maxDate) > 0 + ) { + return 'disabled'; + } + if (type === 'single') { + return utils_1.compareDay(day, currentDate) === 0 ? 'selected' : ''; + } + if (type === 'multiple') { + return this.getMultipleDayType(day); + } + /* istanbul ignore else */ + if (type === 'range') { + return this.getRangeDayType(day); + } + }, + getBottomInfo: function (type) { + if (this.data.type === 'range') { + if (type === 'start') { + return '开始'; + } + if (type === 'end') { + return '结束'; + } + if (type === 'start-end') { + return '开始/结束'; + } + } + }, + }, +}); diff --git a/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/components/month/index.json b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/components/month/index.json new file mode 100644 index 00000000..467ce294 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/components/month/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} diff --git a/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxml b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxml new file mode 100644 index 00000000..55bab83f --- /dev/null +++ b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxml @@ -0,0 +1,39 @@ + + + + + + {{ computed.formatMonthTitle(date) }} + + + + + {{ computed.getMark(date) }} + + + + + {{ item.topInfo }} + {{ item.text }} + + {{ item.bottomInfo }} + + + + + {{ item.topInfo }} + {{ item.text }} + + {{ item.bottomInfo }} + + + + + diff --git a/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxs b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxs new file mode 100644 index 00000000..a0570798 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxs @@ -0,0 +1,67 @@ +/* eslint-disable */ +var utils = require('../../utils.wxs'); + +function getMark(date) { + return getDate(date).getMonth() + 1; +} + +var ROW_HEIGHT = 64; + +function getDayStyle(type, index, date, rowHeight, color) { + var style = []; + var offset = getDate(date).getDay(); + + if (index === 0) { + style.push(['margin-left', (100 * offset) / 7 + '%']); + } + + if (rowHeight !== ROW_HEIGHT) { + style.push(['height', rowHeight + 'px']); + } + + if (color) { + if ( + type === 'start' || + type === 'end' || + type === 'multiple-selected' || + type === 'multiple-middle' + ) { + style.push(['background', color]); + } else if (type === 'middle') { + style.push(['color', color]); + } + } + + return style + .map(function(item) { + return item.join(':'); + }) + .join(';'); +} + +function formatMonthTitle(date) { + date = getDate(date); + return date.getFullYear() + '年' + (date.getMonth() + 1) + '月'; +} + +function getMonthStyle(visible, date, rowHeight) { + if (!visible) { + date = getDate(date); + + var totalDay = utils.getMonthEndDay( + date.getFullYear(), + date.getMonth() + 1 + ); + var offset = getDate(date).getDay(); + var padding = Math.ceil((totalDay + offset) / 7) * rowHeight; + + return 'padding-bottom:' + padding + 'px'; + } +} + +module.exports = { + getMark: getMark, + getDayStyle: getDayStyle, + formatMonthTitle: formatMonthTitle, + getMonthStyle: getMonthStyle +}; diff --git a/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxss b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxss new file mode 100644 index 00000000..17c12f4e --- /dev/null +++ b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/components/month/index.wxss @@ -0,0 +1 @@ +@import '../../../common/index.wxss';.van-calendar{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;height:100%;background-color:#fff;background-color:var(--calendar-background-color,#fff)}.van-calendar__month-title{text-align:center;height:44px;height:var(--calendar-header-title-height,44px);font-weight:500;font-weight:var(--font-weight-bold,500);font-size:14px;font-size:var(--calendar-month-title-font-size,14px);line-height:44px;line-height:var(--calendar-header-title-height,44px)}.van-calendar__days{position:relative;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;-webkit-user-select:none;user-select:none}.van-calendar__month-mark{position:absolute;top:50%;left:50%;z-index:0;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);pointer-events:none;color:rgba(242,243,245,.8);color:var(--calendar-month-mark-color,rgba(242,243,245,.8));font-size:160px;font-size:var(--calendar-month-mark-font-size,160px)}.van-calendar__day,.van-calendar__selected-day{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;text-align:center}.van-calendar__day{position:relative;width:14.285%;height:64px;height:var(--calendar-day-height,64px);font-size:16px;font-size:var(--calendar-day-font-size,16px)}.van-calendar__day--end,.van-calendar__day--multiple-middle,.van-calendar__day--multiple-selected,.van-calendar__day--start,.van-calendar__day--start-end{color:#fff;color:var(--calendar-range-edge-color,#fff);background-color:#ee0a24;background-color:var(--calendar-range-edge-background-color,#ee0a24)}.van-calendar__day--start{border-radius:4px 0 0 4px;border-radius:var(--border-radius-md,4px) 0 0 var(--border-radius-md,4px)}.van-calendar__day--end{border-radius:0 4px 4px 0;border-radius:0 var(--border-radius-md,4px) var(--border-radius-md,4px) 0}.van-calendar__day--multiple-selected,.van-calendar__day--start-end{border-radius:4px;border-radius:var(--border-radius-md,4px)}.van-calendar__day--middle{color:#ee0a24;color:var(--calendar-range-middle-color,#ee0a24)}.van-calendar__day--middle:after{position:absolute;top:0;right:0;bottom:0;left:0;background-color:currentColor;content:"";opacity:.1;opacity:var(--calendar-range-middle-background-opacity,.1)}.van-calendar__day--disabled{cursor:default;color:#c8c9cc;color:var(--calendar-day-disabled-color,#c8c9cc)}.van-calendar__bottom-info,.van-calendar__top-info{position:absolute;right:0;left:0;font-size:10px;font-size:var(--calendar-info-font-size,10px);line-height:14px;line-height:var(--calendar-info-line-height,14px)}@media (max-width:350px){.van-calendar__bottom-info,.van-calendar__top-info{font-size:9px}}.van-calendar__top-info{top:6px}.van-calendar__bottom-info{bottom:6px}.van-calendar__selected-day{width:54px;width:var(--calendar-selected-day-size,54px);height:54px;height:var(--calendar-selected-day-size,54px);color:#fff;color:var(--calendar-selected-day-color,#fff);background-color:#ee0a24;background-color:var(--calendar-selected-day-background-color,#ee0a24);border-radius:4px;border-radius:var(--border-radius-md,4px)} \ No newline at end of file diff --git a/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/index.js b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/index.js new file mode 100644 index 00000000..e2b2ce13 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/index.js @@ -0,0 +1,318 @@ +'use strict'; +var __spreadArrays = + (this && this.__spreadArrays) || + function () { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) + s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; + }; +var __importDefault = + (this && this.__importDefault) || + function (mod) { + return mod && mod.__esModule ? mod : { default: mod }; + }; +Object.defineProperty(exports, '__esModule', { value: true }); +var component_1 = require('../common/component'); +var utils_1 = require('./utils'); +var toast_1 = __importDefault(require('../toast/toast')); +component_1.VantComponent({ + props: { + title: { + type: String, + value: '日期选择', + }, + color: String, + show: { + type: Boolean, + observer: function (val) { + if (val) { + this.initRect(); + this.scrollIntoView(); + } + }, + }, + formatter: null, + confirmText: { + type: String, + value: '确定', + }, + rangePrompt: String, + defaultDate: { + type: [Number, Array], + observer: function (val) { + this.setData({ currentDate: val }); + this.scrollIntoView(); + }, + }, + allowSameDay: Boolean, + confirmDisabledText: String, + type: { + type: String, + value: 'single', + observer: 'reset', + }, + minDate: { + type: null, + value: Date.now(), + }, + maxDate: { + type: null, + value: new Date( + new Date().getFullYear(), + new Date().getMonth() + 6, + new Date().getDate() + ).getTime(), + }, + position: { + type: String, + value: 'bottom', + }, + rowHeight: { + type: [Number, String], + value: utils_1.ROW_HEIGHT, + }, + round: { + type: Boolean, + value: true, + }, + poppable: { + type: Boolean, + value: true, + }, + showMark: { + type: Boolean, + value: true, + }, + showTitle: { + type: Boolean, + value: true, + }, + showConfirm: { + type: Boolean, + value: true, + }, + showSubtitle: { + type: Boolean, + value: true, + }, + safeAreaInsetBottom: { + type: Boolean, + value: true, + }, + closeOnClickOverlay: { + type: Boolean, + value: true, + }, + maxRange: { + type: [Number, String], + value: null, + }, + }, + data: { + subtitle: '', + currentDate: null, + scrollIntoView: '', + }, + created: function () { + this.setData({ + currentDate: this.getInitialDate(), + }); + }, + mounted: function () { + if (this.data.show || !this.data.poppable) { + this.initRect(); + this.scrollIntoView(); + } + }, + methods: { + reset: function () { + this.setData({ currentDate: this.getInitialDate() }); + this.scrollIntoView(); + }, + initRect: function () { + var _this = this; + if (this.contentObserver != null) { + this.contentObserver.disconnect(); + } + var contentObserver = this.createIntersectionObserver({ + thresholds: [0, 0.1, 0.9, 1], + observeAll: true, + }); + this.contentObserver = contentObserver; + contentObserver.relativeTo('.van-calendar__body'); + contentObserver.observe('.month', function (res) { + if (res.boundingClientRect.top <= res.relativeRect.top) { + // @ts-ignore + _this.setData({ + subtitle: utils_1.formatMonthTitle(res.dataset.date), + }); + } + }); + }, + getInitialDate: function () { + var _a = this.data, + type = _a.type, + defaultDate = _a.defaultDate, + minDate = _a.minDate; + if (type === 'range') { + var _b = defaultDate || [], + startDay = _b[0], + endDay = _b[1]; + return [ + startDay || minDate, + endDay || utils_1.getNextDay(new Date(minDate)).getTime(), + ]; + } + if (type === 'multiple') { + return defaultDate || [minDate]; + } + return defaultDate || minDate; + }, + scrollIntoView: function () { + var _this = this; + setTimeout(function () { + var _a = _this.data, + currentDate = _a.currentDate, + type = _a.type, + show = _a.show, + poppable = _a.poppable, + minDate = _a.minDate, + maxDate = _a.maxDate; + var targetDate = type === 'single' ? currentDate : currentDate[0]; + var displayed = show || !poppable; + if (!targetDate || !displayed) { + return; + } + var months = utils_1.getMonths(minDate, maxDate); + months.some(function (month, index) { + if (utils_1.compareMonth(month, targetDate) === 0) { + _this.setData({ scrollIntoView: 'month' + index }); + return true; + } + return false; + }); + }, 100); + }, + onOpen: function () { + this.$emit('open'); + }, + onOpened: function () { + this.$emit('opened'); + }, + onClose: function () { + this.$emit('close'); + }, + onClosed: function () { + this.$emit('closed'); + }, + onClickDay: function (event) { + var date = event.detail.date; + var _a = this.data, + type = _a.type, + currentDate = _a.currentDate, + allowSameDay = _a.allowSameDay; + if (type === 'range') { + var startDay = currentDate[0], + endDay = currentDate[1]; + if (startDay && !endDay) { + var compareToStart = utils_1.compareDay(date, startDay); + if (compareToStart === 1) { + this.select([startDay, date], true); + } else if (compareToStart === -1) { + this.select([date, null]); + } else if (allowSameDay) { + this.select([date, date]); + } + } else { + this.select([date, null]); + } + } else if (type === 'multiple') { + var selectedIndex_1; + var selected = currentDate.some(function (dateItem, index) { + var equal = utils_1.compareDay(dateItem, date) === 0; + if (equal) { + selectedIndex_1 = index; + } + return equal; + }); + if (selected) { + var cancelDate = currentDate.splice(selectedIndex_1, 1); + this.setData({ currentDate: currentDate }); + this.unselect(cancelDate); + } else { + this.select(__spreadArrays(currentDate, [date])); + } + } else { + this.select(date, true); + } + }, + unselect: function (dateArray) { + var date = dateArray[0]; + if (date) { + this.$emit('unselect', utils_1.copyDates(date)); + } + }, + select: function (date, complete) { + if (complete && this.data.type === 'range') { + var valid = this.checkRange(date); + if (!valid) { + // auto selected to max range if showConfirm + if (this.data.showConfirm) { + this.emit([ + date[0], + utils_1.getDayByOffset(date[0], this.data.maxRange - 1), + ]); + } else { + this.emit(date); + } + return; + } + } + this.emit(date); + if (complete && !this.data.showConfirm) { + this.onConfirm(); + } + }, + emit: function (date) { + var getTime = function (date) { + return date instanceof Date ? date.getTime() : date; + }; + this.setData({ + currentDate: Array.isArray(date) ? date.map(getTime) : getTime(date), + }); + this.$emit('select', utils_1.copyDates(date)); + }, + checkRange: function (date) { + var _a = this.data, + maxRange = _a.maxRange, + rangePrompt = _a.rangePrompt; + if (maxRange && utils_1.calcDateNum(date) > maxRange) { + toast_1.default({ + context: this, + message: + rangePrompt || + '\u9009\u62E9\u5929\u6570\u4E0D\u80FD\u8D85\u8FC7 ' + + maxRange + + ' \u5929', + }); + return false; + } + return true; + }, + onConfirm: function () { + var _this = this; + if ( + this.data.type === 'range' && + !this.checkRange(this.data.currentDate) + ) { + return; + } + wx.nextTick(function () { + _this.$emit('confirm', utils_1.copyDates(_this.data.currentDate)); + }); + }, + }, +}); diff --git a/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/index.json b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/index.json new file mode 100644 index 00000000..61dec086 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/index.json @@ -0,0 +1,9 @@ +{ + "component": true, + "usingComponents": { + "header": "./components/header/index", + "month": "./components/month/index", + "van-button": "../button/index", + "van-popup": "../popup/index" + } +} diff --git a/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/index.wxml b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/index.wxml new file mode 100644 index 00000000..d4849cc7 --- /dev/null +++ b/yanzhu-ui-app/miniprogram/miniprogram_npm/@vant/weapp/calendar/index.wxml @@ -0,0 +1,31 @@ + + + + + +