From 6f156df9a87cde0ac128c0df8ceb3bc956c81521 Mon Sep 17 00:00:00 2001 From: fhysy <1149505133@qq.com> Date: Wed, 12 Mar 2025 10:47:31 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=88=A0=E9=99=A4=E6=9C=AA?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=9A=84=E7=BB=84=E4=BB=B6=E5=92=8C=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 2 - common/app-config.js | 99 - common/script/allNavList.js | 57 - common/script/homeNavList.js | 164 - components/electricalSafe/bottomSelect.vue | 96 - components/electricalSafe/headerSelect.vue | 97 - components/electricalSafe/pickerGroup.vue | 207 - components/headerBg/headerBg.vue | 33 - components/historyCmp/table.vue | 108 - components/icon/icon.vue | 554 -- components/ly-tree/components/ly-checkbox.vue | 200 - components/ly-tree/ly-tree-node.vue | 424 -- components/ly-tree/ly-tree.vue | 605 -- components/ly-tree/model/node.js | 538 -- components/ly-tree/model/tree-store.js | 419 -- components/ly-tree/tool/util.js | 115 - components/signal/signal.vue | 77 - components/tki-tree/style.css | 151 - components/tki-tree/tki-tree.vue | 302 - components/u-charts/component.vue | 165 - components/u-charts/u-charts.js | 5662 ----------------- components/u-charts/u-charts.min.js | 1 - components/uchartComponents/Arcbar.vue | 121 - components/uchartComponents/area-scroll.vue | 143 - components/uchartComponents/column-scroll.vue | 177 - components/uchartComponents/line-scroll.vue | 175 - components/uchartComponents/ring.vue | 123 - components/uchartComponents/rotate-scroll.vue | 131 - components/uni-ui/signal/signal.vue | 77 - components/uni-ui/uni-icons/icons.js | 96 - components/uni-ui/uni-icons/uni-icons.vue | 57 - main.js | 8 - pages.json | 686 +- pages/auth/companyRegister.vue | 184 - pages/auth/defalut.vue | 666 -- pages/auth/forgotPassword.vue | 270 - pages/auth/login.vue | 431 -- pages/auth/registerGuide.vue | 73 - pages/auth/registerLoading.vue | 63 - pages/auth/userRegister.vue | 234 - pages/battery/battery-info.vue | 393 -- pages/home/electricalFire/alarmCenter.vue | 170 - pages/home/electricalFire/alarmDetail.vue | 142 - pages/home/electricalFire/cameraDetail.vue | 48 - pages/home/electricalFire/device.vue | 165 - pages/home/electricalFire/index.vue | 173 - pages/home/electricalFire/placeDetail.vue | 118 - pages/home/electricalFire/placeManage.vue | 107 - pages/home/electricalFire/runingRecord.vue | 91 - pages/home/electricalFire/smokeDetail.vue | 220 - pages/home/more/moreNavBar.vue | 74 - pages/home/smoke/index.vue | 172 - pages/home/temperature/alarmCenter.vue | 170 - pages/home/temperature/device.vue | 119 - pages/home/temperature/deviceDetail.vue | 53 - pages/home/temperature/index.vue | 146 - pages/home/temperature/placeDetail.vue | 118 - pages/home/temperature/placeManage.vue | 107 - pages/home/warnAnalysis/index.vue | 573 -- pages/home/waterLevel/alarmCenter.vue | 170 - pages/home/waterLevel/device.vue | 119 - pages/home/waterLevel/deviceDetail.vue | 53 - pages/home/waterLevel/index.vue | 148 - pages/home/waterLevel/placeDetail.vue | 118 - pages/home/waterLevel/placeManage.vue | 107 - pages/home/waterLevel/realTime.vue | 458 -- pages/home/wisdomElectricity/alarmRecord.vue | 433 -- .../wisdomElectricity/electricityDetail.vue | 732 --- .../energyAnalysis/index.vue | 657 -- .../energyAnalysis/monthDetail.vue | 154 - .../home/wisdomElectricity/historyCurve--.vue | 645 -- .../historyCurve/common/common.scss | 48 - .../historyCurve/common/mixins.js | 45 - .../historyCurve/components/electric.vue | 37 - .../historyCurve/components/leakage.vue | 37 - .../historyCurve/components/temperature.vue | 262 - .../historyCurve/components/voltage.vue | 38 - .../wisdomElectricity/historyCurve/index.vue | 351 - pages/home/wisdomElectricity/index.vue | 267 - pages/home/wisdomElectricity/lineRoadList.vue | 275 - .../realTime/alarmConfig.vue | 211 - .../realTime/deviceDataKey.js | 129 - .../home/wisdomElectricity/realTime/index.vue | 1045 --- .../realTime/parameterField.js | 12 - .../realTime/parameterSetup.vue | 455 -- pages/home/wisdomElectricity/switchWarn.vue | 390 -- .../wisdomElectricity/timerSetting/edit.vue | 19 - .../wisdomElectricity/timerSetting/index.vue | 64 - .../home/wisdomElectricity/wbjl/addRecord.vue | 165 - .../wbjl/maintenanceDetail.vue | 153 - .../wbjl/maintenanceRecord.vue | 276 - pages/index/enter.vue | 78 - pages/index/guidePage.vue | 69 - pages/my/helpCenter.vue | 11 - pages/oneselfUser/alarm.vue | 445 -- pages/oneselfUser/home.vue | 440 -- pages/oneselfUser/home.vueBF | 27 - pages/oneselfUser/index.vue | 80 - pages/oneselfUser/myCenter.vue | 203 - pages/oneselfUser/relationDevice/index.vue | 150 - pages/oneselfUser/wisdomElectricity.vue | 260 - pages/oneselfUser/workOrder/index.vue | 15 - pages/project/alarmTrend.vue | 155 - pages/project/deviceGroup/deviceList.vue | 369 -- pages/project/deviceGroup/index.vue | 318 - .../project/electricalSafeMange/allAlarm.vue | 629 -- .../electricalSafeMange/allAlarmMixins.js | 50 - pages/project/electricalSafeMange/index.vue | 152 - .../electricalSafeMange/leakage-detail.vue | 303 - .../electricalSafeMange/leakageAlarm.vue | 253 - .../electricalSafeMange/leakageCurrent.vue | 141 - .../leakageSelfChecking.vue | 253 - .../electricalSafeMange/otherAlarm.vue | 440 -- .../project/electricalSafeMange/overload.vue | 266 - .../temperature-detail.vue | 303 - .../electricalSafeMange/temperature.vue | 338 - .../electricalSafeMange/temperatureAlarm.vue | 251 - pages/project/equipmentStatus/status.vue | 695 -- pages/project/index.vue | 748 --- pages/project/projectCmp.vue | 276 - pages/project/projectMap.nvue | 291 - pages/project/projectMap.vue | 277 - pages/project/projectUser.vue | 365 -- pages/project/smartEnergy/control.vue | 94 - .../smartEnergy/electricity-detail.vue | 151 - pages/project/smartEnergy/electricity.vue | 510 -- pages/project/smartEnergy/index.vue | 75 - pages/project/smartEnergy/iotBreaker.vue | 326 - pages/project/smartEnergy/lineRoadNaming.vue | 253 - pages/project/smartEnergy/load.vue | 189 - pages/project/space/addDeviceList.vue | 247 - pages/project/space/deviceList.vue | 304 - pages/project/space/index.vue | 460 -- pages/tabBar/alarm.vue | 706 -- pages/tabBar/home.vue | 461 -- pages/tabBar/my.vue | 4 - pages/tabBar/my/about.vue | 121 - pages/tabBar/my/aboutUs.vue | 32 - pages/tabBar/my/addMaintenancePeople.vue | 68 - pages/tabBar/my/help.vue | 50 - pages/tabBar/my/maintenanceRecord.vue | 170 - pages/tabBar/my/newAlarmRemind.vue | 168 - pages/tabBar/my/onlineServe.vue | 168 - pages/tabBar/my/passwordModify.vue | 166 - pages/tabBar/my/privacyPolicy.vue | 113 - pages/tabBar/my/projectServe.vue | 203 - pages/tabBar/my/setup.vue | 59 - pages/tabBar/my/userPolicy.vue | 217 - pages/tabBar/project.vue | 774 --- pages/tabBar/scan.vue | 300 - pages/user/equipmentManage.vue | 323 - pages/user/equipmentSetting.vue | 182 - pages/user/instructRecord.vue | 44 - pages/user/renew.vue | 51 - static/images/toolbar/alarm-active.png | Bin 1018 -> 0 bytes static/images/toolbar/alarm.png | Bin 970 -> 0 bytes static/images/toolbar/home-active.png | Bin 600 -> 0 bytes static/images/toolbar/home.png | Bin 583 -> 0 bytes static/images/toolbar/project-active.png | Bin 795 -> 0 bytes static/images/toolbar/project.png | Bin 779 -> 0 bytes static/images/toolbar/scan-active.png | Bin 1020 -> 0 bytes static/images/toolbar/scan.png | Bin 1048 -> 0 bytes store/index--.js | 34 - store/modules/alarm.js | 1 - uni_modules/m-tree/changelog.md | 31 - .../m-tree/components/m-tree/m-tree.vue | 270 - .../m-tree/tree-node/neil-modal.vue | 260 - .../components/m-tree/tree-node/tree-node.vue | 353 - uni_modules/m-tree/package.json | 83 - uni_modules/m-tree/readme.md | 242 - uni_modules/m-tree/static/add.png | Bin 1476 -> 0 bytes uni_modules/m-tree/static/addblue.png | Bin 1995 -> 0 bytes uni_modules/m-tree/static/down-rect.png | Bin 611 -> 0 bytes uni_modules/m-tree/static/edit.png | Bin 879 -> 0 bytes uni_modules/m-tree/static/editBlue1.png | Bin 1109 -> 0 bytes uni_modules/m-tree/static/editblue.png | Bin 1134 -> 0 bytes uni_modules/m-tree/static/falling.png | Bin 746 -> 0 bytes uni_modules/m-tree/static/reeor.png | Bin 1649 -> 0 bytes uni_modules/m-tree/static/reeorblue.png | Bin 2248 -> 0 bytes uni_modules/m-tree/static/rising.png | Bin 853 -> 0 bytes utils/dataDictionary.js | 24 - utils/mapCalculate.js | 8 - utils/publicMethods.js | 32 - utils/qqmap-wx-jssdk.min.js | 3 - utils/tools.js | 22 - utils/utils.js | 12 - 186 files changed, 8 insertions(+), 42030 deletions(-) delete mode 100644 common/app-config.js delete mode 100644 common/script/allNavList.js delete mode 100644 common/script/homeNavList.js delete mode 100644 components/electricalSafe/bottomSelect.vue delete mode 100644 components/electricalSafe/headerSelect.vue delete mode 100644 components/electricalSafe/pickerGroup.vue delete mode 100644 components/headerBg/headerBg.vue delete mode 100644 components/historyCmp/table.vue delete mode 100644 components/icon/icon.vue delete mode 100644 components/ly-tree/components/ly-checkbox.vue delete mode 100644 components/ly-tree/ly-tree-node.vue delete mode 100644 components/ly-tree/ly-tree.vue delete mode 100644 components/ly-tree/model/node.js delete mode 100644 components/ly-tree/model/tree-store.js delete mode 100644 components/ly-tree/tool/util.js delete mode 100644 components/signal/signal.vue delete mode 100644 components/tki-tree/style.css delete mode 100644 components/tki-tree/tki-tree.vue delete mode 100644 components/u-charts/component.vue delete mode 100644 components/u-charts/u-charts.js delete mode 100644 components/u-charts/u-charts.min.js delete mode 100644 components/uchartComponents/Arcbar.vue delete mode 100644 components/uchartComponents/area-scroll.vue delete mode 100644 components/uchartComponents/column-scroll.vue delete mode 100644 components/uchartComponents/line-scroll.vue delete mode 100644 components/uchartComponents/ring.vue delete mode 100644 components/uchartComponents/rotate-scroll.vue delete mode 100644 components/uni-ui/signal/signal.vue delete mode 100644 components/uni-ui/uni-icons/icons.js delete mode 100644 components/uni-ui/uni-icons/uni-icons.vue delete mode 100644 pages/auth/companyRegister.vue delete mode 100644 pages/auth/defalut.vue delete mode 100644 pages/auth/forgotPassword.vue delete mode 100644 pages/auth/login.vue delete mode 100644 pages/auth/registerGuide.vue delete mode 100644 pages/auth/registerLoading.vue delete mode 100644 pages/auth/userRegister.vue delete mode 100644 pages/battery/battery-info.vue delete mode 100644 pages/home/electricalFire/alarmCenter.vue delete mode 100644 pages/home/electricalFire/alarmDetail.vue delete mode 100644 pages/home/electricalFire/cameraDetail.vue delete mode 100644 pages/home/electricalFire/device.vue delete mode 100644 pages/home/electricalFire/index.vue delete mode 100644 pages/home/electricalFire/placeDetail.vue delete mode 100644 pages/home/electricalFire/placeManage.vue delete mode 100644 pages/home/electricalFire/runingRecord.vue delete mode 100644 pages/home/electricalFire/smokeDetail.vue delete mode 100644 pages/home/more/moreNavBar.vue delete mode 100644 pages/home/smoke/index.vue delete mode 100644 pages/home/temperature/alarmCenter.vue delete mode 100644 pages/home/temperature/device.vue delete mode 100644 pages/home/temperature/deviceDetail.vue delete mode 100644 pages/home/temperature/index.vue delete mode 100644 pages/home/temperature/placeDetail.vue delete mode 100644 pages/home/temperature/placeManage.vue delete mode 100644 pages/home/warnAnalysis/index.vue delete mode 100644 pages/home/waterLevel/alarmCenter.vue delete mode 100644 pages/home/waterLevel/device.vue delete mode 100644 pages/home/waterLevel/deviceDetail.vue delete mode 100644 pages/home/waterLevel/index.vue delete mode 100644 pages/home/waterLevel/placeDetail.vue delete mode 100644 pages/home/waterLevel/placeManage.vue delete mode 100644 pages/home/waterLevel/realTime.vue delete mode 100644 pages/home/wisdomElectricity/alarmRecord.vue delete mode 100644 pages/home/wisdomElectricity/electricityDetail.vue delete mode 100644 pages/home/wisdomElectricity/energyAnalysis/index.vue delete mode 100644 pages/home/wisdomElectricity/energyAnalysis/monthDetail.vue delete mode 100644 pages/home/wisdomElectricity/historyCurve--.vue delete mode 100644 pages/home/wisdomElectricity/historyCurve/common/common.scss delete mode 100644 pages/home/wisdomElectricity/historyCurve/common/mixins.js delete mode 100644 pages/home/wisdomElectricity/historyCurve/components/electric.vue delete mode 100644 pages/home/wisdomElectricity/historyCurve/components/leakage.vue delete mode 100644 pages/home/wisdomElectricity/historyCurve/components/temperature.vue delete mode 100644 pages/home/wisdomElectricity/historyCurve/components/voltage.vue delete mode 100644 pages/home/wisdomElectricity/historyCurve/index.vue delete mode 100644 pages/home/wisdomElectricity/index.vue delete mode 100644 pages/home/wisdomElectricity/lineRoadList.vue delete mode 100644 pages/home/wisdomElectricity/realTime/alarmConfig.vue delete mode 100644 pages/home/wisdomElectricity/realTime/deviceDataKey.js delete mode 100644 pages/home/wisdomElectricity/realTime/index.vue delete mode 100644 pages/home/wisdomElectricity/realTime/parameterField.js delete mode 100644 pages/home/wisdomElectricity/realTime/parameterSetup.vue delete mode 100644 pages/home/wisdomElectricity/switchWarn.vue delete mode 100644 pages/home/wisdomElectricity/timerSetting/edit.vue delete mode 100644 pages/home/wisdomElectricity/timerSetting/index.vue delete mode 100644 pages/home/wisdomElectricity/wbjl/addRecord.vue delete mode 100644 pages/home/wisdomElectricity/wbjl/maintenanceDetail.vue delete mode 100644 pages/home/wisdomElectricity/wbjl/maintenanceRecord.vue delete mode 100644 pages/index/enter.vue delete mode 100644 pages/index/guidePage.vue delete mode 100644 pages/my/helpCenter.vue delete mode 100644 pages/oneselfUser/alarm.vue delete mode 100644 pages/oneselfUser/home.vue delete mode 100644 pages/oneselfUser/home.vueBF delete mode 100644 pages/oneselfUser/index.vue delete mode 100644 pages/oneselfUser/myCenter.vue delete mode 100644 pages/oneselfUser/relationDevice/index.vue delete mode 100644 pages/oneselfUser/wisdomElectricity.vue delete mode 100644 pages/oneselfUser/workOrder/index.vue delete mode 100644 pages/project/alarmTrend.vue delete mode 100644 pages/project/deviceGroup/deviceList.vue delete mode 100644 pages/project/deviceGroup/index.vue delete mode 100644 pages/project/electricalSafeMange/allAlarm.vue delete mode 100644 pages/project/electricalSafeMange/allAlarmMixins.js delete mode 100644 pages/project/electricalSafeMange/index.vue delete mode 100644 pages/project/electricalSafeMange/leakage-detail.vue delete mode 100644 pages/project/electricalSafeMange/leakageAlarm.vue delete mode 100644 pages/project/electricalSafeMange/leakageCurrent.vue delete mode 100644 pages/project/electricalSafeMange/leakageSelfChecking.vue delete mode 100644 pages/project/electricalSafeMange/otherAlarm.vue delete mode 100644 pages/project/electricalSafeMange/overload.vue delete mode 100644 pages/project/electricalSafeMange/temperature-detail.vue delete mode 100644 pages/project/electricalSafeMange/temperature.vue delete mode 100644 pages/project/electricalSafeMange/temperatureAlarm.vue delete mode 100644 pages/project/equipmentStatus/status.vue delete mode 100644 pages/project/index.vue delete mode 100644 pages/project/projectCmp.vue delete mode 100644 pages/project/projectMap.nvue delete mode 100644 pages/project/projectMap.vue delete mode 100644 pages/project/projectUser.vue delete mode 100644 pages/project/smartEnergy/control.vue delete mode 100644 pages/project/smartEnergy/electricity-detail.vue delete mode 100644 pages/project/smartEnergy/electricity.vue delete mode 100644 pages/project/smartEnergy/index.vue delete mode 100644 pages/project/smartEnergy/iotBreaker.vue delete mode 100644 pages/project/smartEnergy/lineRoadNaming.vue delete mode 100644 pages/project/smartEnergy/load.vue delete mode 100644 pages/project/space/addDeviceList.vue delete mode 100644 pages/project/space/deviceList.vue delete mode 100644 pages/project/space/index.vue delete mode 100644 pages/tabBar/alarm.vue delete mode 100644 pages/tabBar/home.vue delete mode 100644 pages/tabBar/my/about.vue delete mode 100644 pages/tabBar/my/aboutUs.vue delete mode 100644 pages/tabBar/my/addMaintenancePeople.vue delete mode 100644 pages/tabBar/my/help.vue delete mode 100644 pages/tabBar/my/maintenanceRecord.vue delete mode 100644 pages/tabBar/my/newAlarmRemind.vue delete mode 100644 pages/tabBar/my/onlineServe.vue delete mode 100644 pages/tabBar/my/passwordModify.vue delete mode 100644 pages/tabBar/my/privacyPolicy.vue delete mode 100644 pages/tabBar/my/projectServe.vue delete mode 100644 pages/tabBar/my/setup.vue delete mode 100644 pages/tabBar/my/userPolicy.vue delete mode 100644 pages/tabBar/project.vue delete mode 100644 pages/tabBar/scan.vue delete mode 100644 pages/user/equipmentManage.vue delete mode 100644 pages/user/equipmentSetting.vue delete mode 100644 pages/user/instructRecord.vue delete mode 100644 pages/user/renew.vue delete mode 100644 static/images/toolbar/alarm-active.png delete mode 100644 static/images/toolbar/alarm.png delete mode 100644 static/images/toolbar/home-active.png delete mode 100644 static/images/toolbar/home.png delete mode 100644 static/images/toolbar/project-active.png delete mode 100644 static/images/toolbar/project.png delete mode 100644 static/images/toolbar/scan-active.png delete mode 100644 static/images/toolbar/scan.png delete mode 100644 store/index--.js delete mode 100644 store/modules/alarm.js delete mode 100644 uni_modules/m-tree/changelog.md delete mode 100644 uni_modules/m-tree/components/m-tree/m-tree.vue delete mode 100644 uni_modules/m-tree/components/m-tree/tree-node/neil-modal.vue delete mode 100644 uni_modules/m-tree/components/m-tree/tree-node/tree-node.vue delete mode 100644 uni_modules/m-tree/package.json delete mode 100644 uni_modules/m-tree/readme.md delete mode 100644 uni_modules/m-tree/static/add.png delete mode 100644 uni_modules/m-tree/static/addblue.png delete mode 100644 uni_modules/m-tree/static/down-rect.png delete mode 100644 uni_modules/m-tree/static/edit.png delete mode 100644 uni_modules/m-tree/static/editBlue1.png delete mode 100644 uni_modules/m-tree/static/editblue.png delete mode 100644 uni_modules/m-tree/static/falling.png delete mode 100644 uni_modules/m-tree/static/reeor.png delete mode 100644 uni_modules/m-tree/static/reeorblue.png delete mode 100644 uni_modules/m-tree/static/rising.png delete mode 100644 utils/dataDictionary.js delete mode 100644 utils/mapCalculate.js delete mode 100644 utils/publicMethods.js delete mode 100644 utils/qqmap-wx-jssdk.min.js delete mode 100644 utils/tools.js delete mode 100644 utils/utils.js diff --git a/App.vue b/App.vue index f52a0e5..52887c6 100644 --- a/App.vue +++ b/App.vue @@ -6,10 +6,8 @@ /* #endif */ diff --git a/components/electricalSafe/headerSelect.vue b/components/electricalSafe/headerSelect.vue deleted file mode 100644 index 56d9345..0000000 --- a/components/electricalSafe/headerSelect.vue +++ /dev/null @@ -1,97 +0,0 @@ - - - diff --git a/components/electricalSafe/pickerGroup.vue b/components/electricalSafe/pickerGroup.vue deleted file mode 100644 index 3af1b83..0000000 --- a/components/electricalSafe/pickerGroup.vue +++ /dev/null @@ -1,207 +0,0 @@ - - - diff --git a/components/headerBg/headerBg.vue b/components/headerBg/headerBg.vue deleted file mode 100644 index d9771d1..0000000 --- a/components/headerBg/headerBg.vue +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - diff --git a/components/historyCmp/table.vue b/components/historyCmp/table.vue deleted file mode 100644 index 58f5d20..0000000 --- a/components/historyCmp/table.vue +++ /dev/null @@ -1,108 +0,0 @@ - - - diff --git a/components/icon/icon.vue b/components/icon/icon.vue deleted file mode 100644 index 1fc1aaf..0000000 --- a/components/icon/icon.vue +++ /dev/null @@ -1,554 +0,0 @@ - - - - - diff --git a/components/ly-tree/components/ly-checkbox.vue b/components/ly-tree/components/ly-checkbox.vue deleted file mode 100644 index 94a37ed..0000000 --- a/components/ly-tree/components/ly-checkbox.vue +++ /dev/null @@ -1,200 +0,0 @@ - - - - - \ No newline at end of file diff --git a/components/ly-tree/ly-tree-node.vue b/components/ly-tree/ly-tree-node.vue deleted file mode 100644 index d4ce1bf..0000000 --- a/components/ly-tree/ly-tree-node.vue +++ /dev/null @@ -1,424 +0,0 @@ - - - - - \ No newline at end of file diff --git a/components/ly-tree/ly-tree.vue b/components/ly-tree/ly-tree.vue deleted file mode 100644 index 2470f2f..0000000 --- a/components/ly-tree/ly-tree.vue +++ /dev/null @@ -1,605 +0,0 @@ - - - - - diff --git a/components/ly-tree/model/node.js b/components/ly-tree/model/node.js deleted file mode 100644 index 8d5e7e8..0000000 --- a/components/ly-tree/model/node.js +++ /dev/null @@ -1,538 +0,0 @@ -import { - markNodeData, - objectAssign, - arrayFindIndex, - getChildState, - reInitChecked, - getPropertyFromData, - isNull, - NODE_KEY -} from '../tool/util'; - -const getStore = function(store) { - let thisStore = store; - - return function() { - return thisStore; - } -} - -let nodeIdSeed = 0; - -export default class Node { - constructor(options) { - this.time = new Date().getTime(); - this.id = nodeIdSeed++; - this.text = null; - this.checked = false; - this.indeterminate = false; - this.data = null; - this.expanded = false; - this.parentId = null; - this.visible = true; - this.isCurrent = false; - - for (let name in options) { - if (options.hasOwnProperty(name)) { - if (name === 'store') { - this.store = getStore(options[name]); - } else { - this[name] = options[name]; - } - } - } - - if (!this.store()) { - throw new Error('[Node]store is required!'); - } - - // internal - this.level = 0; - this.loaded = false; - this.childNodesId = []; - this.loading = false; - this.label = getPropertyFromData(this, 'label'); - this.key = this._getKey(); - this.disabled = getPropertyFromData(this, 'disabled'); - this.nextSibling = null; - this.previousSibling = null; - this.icon = ''; - - this._handleParentAndLevel(); - this._handleProps(); - this._handleExpand(); - this._handleCurrent(); - - if (this.store().lazy) { - this.store()._initDefaultCheckedNode(this); - } - - this.updateLeafState(); - } - - _getKey() { - if (!this.data || Array.isArray(this.data)) return null; - - if (typeof this.data === 'object') { - const nodeKey = this.store().key; - const key = this.data[nodeKey]; - - if (typeof key === 'undefined') { - throw new Error(`您配置的node-key为"${nodeKey}",但数据中并未找到对应"${nodeKey}"属性的值,请检查node-key的配置是否合理`) - } - - return key; - } - - throw new Error('不合法的data数据'); - } - - _handleParentAndLevel() { - if (this.parentId !== null) { - let parent = this.getParent(this.parentId); - - if (this.store().isInjectParentInNode) { - this.parent = parent; - } - - // 由于这里做了修改,默认第一个对象不会被注册到nodesMap中,所以找不到parent会报错,所以默认parent的level是0 - if (!parent) { - parent = { - level: 0 - } - } else { - const parentChildNodes = parent.getChildNodes(parent.childNodesId); - const index = parent.childNodesId.indexOf(this.key); - this.nextSibling = index > -1 ? parentChildNodes[index + 1] : null; - this.previousSibling = index > 0 ? parentChildNodes[index - 1] : null; - } - this.level = parent.level + 1; - } - } - - _handleProps() { - const props = this.store().props; - - if (this.store().showNodeIcon) { - if (props && typeof props.icon !== 'undefined') { - this.icon = getPropertyFromData(this, 'icon'); - } else { - console.warn('请配置props属性中的"icon"字段') - } - } - - this.store().registerNode(this); - - if (props && typeof props.isLeaf !== 'undefined') { - const isLeaf = getPropertyFromData(this, 'isLeaf'); - if (typeof isLeaf === 'boolean') { - this.isLeafByUser = isLeaf; - } - } - } - - _handleExpand() { - if (this.store().lazy !== true && this.data) { - this.setData(this.data); - - if (this.store().defaultExpandAll) { - this.expanded = true; - } - } else if (this.level > 0 && this.store().lazy && this.store().defaultExpandAll) { - this.expand(); - } - - if (!Array.isArray(this.data)) { - markNodeData(this, this.data); - } - - if (!this.data) return; - - const defaultExpandedKeys = this.store().defaultExpandedKeys; - const key = this.store().key; - if (key && defaultExpandedKeys && defaultExpandedKeys.indexOf(this.key) !== -1) { - this.expand(null, this.store().autoExpandparent); - } - } - - _handleCurrent() { - const key = this.store().key; - - if (key && this.store().currentNodeKey !== undefined && this.key === this.store().currentNodeKey) { - this.store().currentNode = this; - this.store().currentNode.isCurrent = true; - } - } - - destroyStore() { - getStore(null) - } - - setData(data) { - if (!Array.isArray(data)) { - markNodeData(this, data); - } - - this.data = data; - this.childNodesId = []; - - let children; - if (this.level === 0 && Array.isArray(this.data)) { - children = this.data; - } else { - children = getPropertyFromData(this, 'children') || []; - } - - for (let i = 0, j = children.length; i < j; i++) { - this.insertChild({ - data: children[i] - }); - } - } - - contains(target, deep = true) { - const walk = function(parent) { - const children = parent.getChildNodes(parent.childNodesId) || []; - let result = false; - for (let i = 0, j = children.length; i < j; i++) { - const child = children[i]; - if (child === target || (deep && walk(child))) { - result = true; - break; - } - } - return result; - }; - - return walk(this); - } - - remove() { - if (this.parentId !== null) { - const parent = this.getParent(this.parentId); - parent.removeChild(this); - } - } - - insertChild(child, index, batch) { - if (!child) throw new Error('insertChild error: child is required.'); - - if (!(child instanceof Node)) { - if (!batch) { - const children = this.getChildren(true); - if (children.indexOf(child.data) === -1) { - if (typeof index === 'undefined' || index < 0) { - children.push(child.data); - } else { - children.splice(index, 0, child.data); - } - } - } - - objectAssign(child, { - parentId: isNull(this.key) ? '' : this.key, - store: this.store() - }); - child = new Node(child); - } - - child.level = this.level + 1; - - if (typeof index === 'undefined' || index < 0) { - this.childNodesId.push(child.key); - } else { - this.childNodesId.splice(index, 0, child.key); - } - - this.updateLeafState(); - } - - insertBefore(child, ref) { - let index; - if (ref) { - index = this.childNodesId.indexOf(ref.id); - } - this.insertChild(child, index); - } - - insertAfter(child, ref) { - let index; - if (ref) { - index = this.childNodesId.indexOf(ref.id); - if (index !== -1) index += 1; - } - this.insertChild(child, index); - } - - removeChild(child) { - const children = this.getChildren() || []; - const dataIndex = children.indexOf(child.data); - if (dataIndex > -1) { - children.splice(dataIndex, 1); - } - - const index = this.childNodesId.indexOf(child.key); - - if (index > -1) { - this.store() && this.store().deregisterNode(child); - child.parentId = null; - this.childNodesId.splice(index, 1); - } - - this.updateLeafState(); - } - - removeChildByData(data) { - let targetNode = null; - - for (let i = 0; i < this.childNodesId.length; i++) { - let node = this.getChildNodes(this.childNodesId); - if (node[i].data === data) { - targetNode = node[i]; - break; - } - } - - if (targetNode) { - this.removeChild(targetNode); - } - } - - // 为了避免APP端parent嵌套结构导致报错,这里parent需要从nodesMap中获取 - getParent(parentId) { - try { - if (!parentId.toString()) return null; - return this.store().nodesMap[parentId]; - } catch (error) { - return null; - } - } - - // 为了避免APP端childNodes嵌套结构导致报错,这里childNodes需要从nodesMap中获取 - getChildNodes(childNodesId) { - let childNodes = []; - if (childNodesId.length === 0) return childNodes; - childNodesId.forEach((key) => { - childNodes.push(this.store().nodesMap[key]); - }) - return childNodes; - } - - expand(callback, expandparent) { - const done = () => { - if (expandparent) { - let parent = this.getParent(this.parentId); - while (parent && parent.level > 0) { - parent.expanded = true; - parent = this.getParent(parent.parentId); - } - } - this.expanded = true; - if (callback) callback(); - }; - - if (this.shouldLoadData()) { - this.loadData(function(data) { - if (Array.isArray(data)) { - if (this.checked) { - this.setChecked(true, true); - } else if (!this.store().checkStrictly) { - reInitChecked(this); - } - done(); - } - }); - } else { - done(); - } - } - - doCreateChildren(array, defaultProps = {}) { - array.forEach((item) => { - this.insertChild(objectAssign({ - data: item - }, defaultProps), undefined, true); - }); - } - - collapse() { - this.expanded = false; - } - - shouldLoadData() { - return this.store().lazy === true && this.store().load && !this.loaded; - } - - updateLeafState() { - if (this.store().lazy === true && this.loaded !== true && typeof this.isLeafByUser !== 'undefined') { - this.isLeaf = this.isLeafByUser; - return; - } - const childNodesId = this.childNodesId; - if (!this.store().lazy || (this.store().lazy === true && this.loaded === true)) { - this.isLeaf = !childNodesId || childNodesId.length === 0; - return; - } - this.isLeaf = false; - } - - setChecked(value, deep, recursion, passValue) { - this.indeterminate = value === 'half'; - this.checked = value === true; - - if (this.checked && this.store().expandOnCheckNode) { - this.expand(null, true) - } - - if (this.store().checkStrictly) return; - if (this.store().showRadio) return; - - if (!(this.shouldLoadData() && !this.store().checkDescendants)) { - let childNodes = this.getChildNodes(this.childNodesId); - let { - all, - allWithoutDisable - } = getChildState(childNodes); - - if (!this.isLeaf && (!all && allWithoutDisable)) { - this.checked = false; - value = false; - } - - const handleDescendants = () => { - if (deep) { - let childNodes = this.getChildNodes(this.childNodesId) - for (let i = 0, j = childNodes.length; i < j; i++) { - const child = childNodes[i]; - passValue = passValue || value !== false; - const isCheck = child.disabled ? child.checked : passValue; - child.setChecked(isCheck, deep, true, passValue); - } - const { - half, - all - } = getChildState(childNodes); - - if (!all) { - this.checked = all; - this.indeterminate = half; - } - } - }; - - if (this.shouldLoadData()) { - this.loadData(() => { - handleDescendants(); - reInitChecked(this); - }, { - checked: value !== false - }); - return; - } else { - handleDescendants(); - } - } - - if (!this.parentId) return; - - let parent = this.getParent(this.parentId); - if (parent && parent.level === 0) return; - - if (!recursion) { - reInitChecked(parent); - } - } - - setRadioChecked(value) { - const allNodes = this.store()._getAllNodes().sort((a, b) => b.level - a.level); - allNodes.forEach(node => node.setChecked(false, false)); - this.checked = value === true; - } - - getChildren(forceInit = false) { - if (this.level === 0) return this.data; - const data = this.data; - if (!data) return null; - - const props = this.store().props; - let children = 'children'; - if (props) { - children = props.children || 'children'; - } - - if (data[children] === undefined) { - data[children] = null; - } - - if (forceInit && !data[children]) { - data[children] = []; - } - - return data[children]; - } - - updateChildren() { - let childNodes = this.getChildNodes(this.childNodesId); - const newData = this.getChildren() || []; - const oldData = childNodes.map((node) => node.data); - - const newDataMap = {}; - const newNodes = []; - - newData.forEach((item, index) => { - const key = item[NODE_KEY]; - const isNodeExists = !!key && arrayFindIndex(oldData, data => data[NODE_KEY] === key) >= 0; - if (isNodeExists) { - newDataMap[key] = { - index, - data: item - }; - } else { - newNodes.push({ - index, - data: item - }); - } - }); - - if (!this.store().lazy) { - oldData.forEach((item) => { - if (!newDataMap[item[NODE_KEY]]) this.removeChildByData(item); - }); - } - - newNodes.forEach(({ - index, - data - }) => { - this.insertChild({ - data - }, index); - }); - - this.updateLeafState(); - } - - loadData(callback, defaultProps = {}) { - if (this.store().lazy === true && - this.store().load && !this.loaded && - (!this.loading || Object.keys(defaultProps).length) - ) { - this.loading = true; - - const resolve = (children) => { - this.loaded = true; - this.loading = false; - this.childNodesId = []; - this.doCreateChildren(children, defaultProps); - this.updateLeafState(); - - callback && callback.call(this,children); - }; - - this.store().load(this, resolve); - } else { - callback && callback.call(this); - } - } -} diff --git a/components/ly-tree/model/tree-store.js b/components/ly-tree/model/tree-store.js deleted file mode 100644 index 5424cd8..0000000 --- a/components/ly-tree/model/tree-store.js +++ /dev/null @@ -1,419 +0,0 @@ -import Node from './node'; -import { - getNodeKey, - getPropertyFromData -} from '../tool/util'; - -export default class TreeStore { - constructor(options) { - this.ready = false; - this.currentNode = null; - this.currentNodeKey = null; - - Object.assign(this, options); - - if (!this.key) { - throw new Error('[Tree] nodeKey is required'); - } - - this.nodesMap = {}; - this.root = new Node({ - data: this.data, - store: this - }); - - if (this.lazy && this.load) { - const loadFn = this.load; - loadFn(this.root, (data) => { - this.root.doCreateChildren(data); - this._initDefaultCheckedNodes(); - this.ready = true; - }); - } else { - this._initDefaultCheckedNodes(); - this.ready = true; - } - } - - filter(value, data) { - const filterNodeMethod = this.filterNodeMethod; - const lazy = this.lazy; - const _self = this; - const traverse = function(node) { - const childNodes = node.root ? node.root.getChildNodes(node.root.childNodesId) : node.getChildNodes(node.childNodesId); - - childNodes.forEach((child) => { - if (data && typeof data === 'object') { - let nodePath = _self.getNodePath(child.data); - if (!nodePath.some(pathItem => pathItem[_self.key] === data[_self.key])) { - child.visible = false; - traverse(child); - return; - } - } - - if (_self.childVisibleForFilterNode) { - let parent = child.getParent(child.parentId); - child.visible = filterNodeMethod.call(child, value, child.data, child) || (parent && parent.visible); - } else { - child.visible = filterNodeMethod.call(child, value, child.data, child); - } - - traverse(child); - }); - - if (!node.visible && childNodes.length) { - let allHidden = true; - allHidden = !childNodes.some(child => child.visible); - - if (node.root) { - node.root.visible = allHidden === false; - } else { - node.visible = allHidden === false; - } - } - - if (!value) return; - - if (node.visible && !node.isLeaf && !lazy) node.expand(); - }; - - traverse(this); - } - - setData(newVal) { - const instanceChanged = newVal !== this.root.data; - if (instanceChanged) { - this.root.setData(newVal); - this._initDefaultCheckedNodes(); - } else { - this.root.updateChildren(); - } - } - - getNode(data) { - if (data instanceof Node) return data; - const key = typeof data !== 'object' ? data : getNodeKey(this.key, data); - if (!key) return null; - return this.nodesMap[key] || null; - } - - insertBefore(data, refData) { - const refNode = this.getNode(refData); - let parent = refNode.getParent(refNode.parentId); - parent.insertBefore({ - data - }, refNode); - } - - insertAfter(data, refData) { - const refNode = this.getNode(refData); - let parent = refNode.getParent(refNode.parentId); - parent.insertAfter({ - data - }, refNode); - } - - remove(data) { - const node = this.getNode(data); - - if (node && node.parentId !== null) { - let parent = node.getParent(node.parentId); - if (node === this.currentNode) { - this.currentNode = null; - } - parent.removeChild(node); - } - } - - append(data, parentData) { - const parentNode = parentData ? this.getNode(parentData) : this.root; - - if (parentNode) { - parentNode.insertChild({ - data - }); - } - } - - _initDefaultCheckedNodes() { - const defaultCheckedKeys = this.defaultCheckedKeys || []; - const nodesMap = this.nodesMap; - let checkedKeyfromData = []; - let totalCheckedKeys = [] - - for (let key in nodesMap) { - let checked = getPropertyFromData(nodesMap[key], 'checked') || false; - checked && checkedKeyfromData.push(key); - } - - totalCheckedKeys = Array.from(new Set([...defaultCheckedKeys, ...checkedKeyfromData])); - totalCheckedKeys.forEach((checkedKey) => { - const node = nodesMap[checkedKey]; - - if (node) { - node.setChecked(true, !this.checkStrictly); - } - }); - } - - _initDefaultCheckedNode(node) { - const defaultCheckedKeys = this.defaultCheckedKeys || []; - - if (defaultCheckedKeys.indexOf(node.key) !== -1) { - node.setChecked(true, !this.checkStrictly); - } - } - - toggleExpendAll(isExpandAll) { - const allNodes = this._getAllNodes(); - - allNodes.forEach(item => { - const node = this.getNode(item.key); - - if (node) isExpandAll ? node.expand() : node.collapse(); - }); - } - - setCheckAll(isCkeckAll) { - const allNodes = this._getAllNodes(); - - allNodes.forEach(item => { - item.setChecked(isCkeckAll, false); - }); - } - - setDefaultCheckedKey(newVal) { - if (newVal !== this.defaultCheckedKeys) { - this.defaultCheckedKeys = newVal; - this._initDefaultCheckedNodes(); - } - } - - registerNode(node) { - - const key = this.key; - if (!key || !node || !node.data) return; - - const nodeKey = node.key; - if (nodeKey !== undefined) this.nodesMap[node.key] = node; - } - - deregisterNode(node) { - const key = this.key; - if (!key || !node || !node.data) return; - - let childNodes = node.getChildNodes(node.childNodesId); - childNodes.forEach(child => { - this.deregisterNode(child); - }); - - delete this.nodesMap[node.key]; - } - - getNodePath(data) { - if (!this.key) throw new Error('[Tree] nodeKey is required in getNodePath'); - const node = this.getNode(data); - if (!node) return []; - - const path = [node.data]; - let parent = node.getParent(node.parentId); - while (parent && parent !== this.root) { - path.push(parent.data); - parent = parent.getParent(parent.parentId); - } - return path.reverse(); - } - - getCheckedNodes(leafOnly = false, includeHalfChecked = false) { - const checkedNodes = []; - const traverse = function(node) { - const childNodes = node.root ? node.root.getChildNodes(node.root.childNodesId) : node.getChildNodes(node.childNodesId); - - childNodes.forEach((child) => { - if ((child.checked || (includeHalfChecked && child.indeterminate)) && (!leafOnly || (leafOnly && child.isLeaf))) { - checkedNodes.push(child.data); - } - - traverse(child); - }); - }; - - traverse(this); - - return checkedNodes; - } - - getCheckedKeys(leafOnly = false, includeHalfChecked = false) { - return this.getCheckedNodes(leafOnly, includeHalfChecked).map((data) => (data || {})[this.key]); - } - - getHalfCheckedNodes() { - const nodes = []; - const traverse = function(node) { - const childNodes = node.root ? node.root.getChildNodes(node.root.childNodesId) : node.getChildNodes(node.childNodesId); - - childNodes.forEach((child) => { - if (child.indeterminate) { - nodes.push(child.data); - } - - traverse(child); - }); - }; - - traverse(this); - - return nodes; - } - - getHalfCheckedKeys() { - return this.getHalfCheckedNodes().map((data) => (data || {})[this.key]); - } - - _getAllNodes() { - const allNodes = []; - const nodesMap = this.nodesMap; - for (let nodeKey in nodesMap) { - if (nodesMap.hasOwnProperty(nodeKey)) { - allNodes.push(nodesMap[nodeKey]); - } - } - - return allNodes; - } - - updateChildren(key, data) { - const node = this.nodesMap[key]; - if (!node) return; - const childNodes = node.getChildNodes(node.childNodesId); - for (let i = childNodes.length - 1; i >= 0; i--) { - const child = childNodes[i]; - this.remove(child.data); - } - for (let i = 0, j = data.length; i < j; i++) { - const child = data[i]; - this.append(child, node.data); - } - } - - _setCheckedKeys(key, leafOnly = false, checkedKeys) { - const allNodes = this._getAllNodes().sort((a, b) => b.level - a.level); - const cache = Object.create(null); - const keys = Object.keys(checkedKeys); - allNodes.forEach(node => node.setChecked(false, false)); - for (let i = 0, j = allNodes.length; i < j; i++) { - const node = allNodes[i]; - let nodeKey = node.data[key]; - - if (typeof nodeKey === 'undefined') continue; - - nodeKey = nodeKey.toString(); - let checked = keys.indexOf(nodeKey) > -1; - if (!checked) { - if (node.checked && !cache[nodeKey]) { - node.setChecked(false, false); - } - continue; - } - - let parent = node.getParent(node.parentId); - while (parent && parent.level > 0) { - cache[parent.data[key]] = true; - parent = parent.getParent(parent.parentId); - } - - if (node.isLeaf || this.checkStrictly) { - node.setChecked(true, false); - continue; - } - node.setChecked(true, true); - - if (leafOnly) { - node.setChecked(false, false); - const traverse = function(node) { - const childNodes = node.getChildNodes(node.childNodesId); - childNodes.forEach((child) => { - if (!child.isLeaf) { - child.setChecked(false, false); - } - traverse(child); - }); - }; - traverse(node); - } - } - } - - setCheckedNodes(array, leafOnly = false) { - const key = this.key; - const checkedKeys = {}; - array.forEach((item) => { - checkedKeys[(item || {})[key]] = true; - }); - - this._setCheckedKeys(key, leafOnly, checkedKeys); - } - - setCheckedKeys(keys, leafOnly = false) { - this.defaultCheckedKeys = keys; - const key = this.key; - const checkedKeys = {}; - keys.forEach((key) => { - checkedKeys[key] = true; - }); - - this._setCheckedKeys(key, leafOnly, checkedKeys); - } - - setDefaultExpandedKeys(keys) { - keys = keys || []; - this.defaultExpandedKeys = keys; - - keys.forEach((key) => { - const node = this.getNode(key); - if (node) node.expand(null, this.autoExpandParent); - }); - } - - setChecked(data, checked, deep) { - const node = this.getNode(data); - - if (node) { - node.setChecked(!!checked, deep); - } - } - - getCurrentNode() { - return this.currentNode; - } - - setCurrentNode(currentNode) { - const prevCurrentNode = this.currentNode; - if (prevCurrentNode) { - prevCurrentNode.isCurrent = false; - } - this.currentNode = currentNode; - this.currentNode.isCurrent = true; - - this.expandCurrentNodeParent && this.currentNode.expand(null, true) - } - - setUserCurrentNode(node) { - const key = node[this.key]; - const currNode = this.nodesMap[key]; - this.setCurrentNode(currNode); - } - - setCurrentNodeKey(key) { - if (key === null || key === undefined) { - this.currentNode && (this.currentNode.isCurrent = false); - this.currentNode = null; - return; - } - const node = this.getNode(key); - if (node) { - this.setCurrentNode(node); - } - } -}; diff --git a/components/ly-tree/tool/util.js b/components/ly-tree/tool/util.js deleted file mode 100644 index 1118c5c..0000000 --- a/components/ly-tree/tool/util.js +++ /dev/null @@ -1,115 +0,0 @@ -export const NODE_KEY = '$treeNodeId'; - -export const markNodeData = function(node, data) { - if (!data || data[NODE_KEY]) return; - Object.defineProperty(data, NODE_KEY, { - value: node.id, - enumerable: false, - configurable: false, - writable: false - }); -}; - -export const getNodeKey = function(key, data) { - if (!data) return null; - if (!key) return data[NODE_KEY]; - return data[key]; -}; - -export const objectAssign = function(target) { - for (let i = 1, j = arguments.length; i < j; i++) { - let source = arguments[i] || {}; - for (let prop in source) { - if (source.hasOwnProperty(prop)) { - let value = source[prop]; - if (value !== undefined) { - target[prop] = value; - } - } - } - } - - return target; -}; - -// TODO: use native Array.find, Array.findIndex when IE support is dropped -export const arrayFindIndex = function(arr, pred) { - for (let i = 0; i !== arr.length; ++i) { - if (pred(arr[i])) { - return i; - } - } - return -1; -}; - -export const getChildState = function(node) { - let all = true; - let none = true; - let allWithoutDisable = true; - for (let i = 0, j = node.length; i < j; i++) { - const n = node[i]; - if (n.checked !== true || n.indeterminate) { - all = false; - if (!n.disabled) { - allWithoutDisable = false; - } - } - if (n.checked !== false || n.indeterminate) { - none = false; - } - } - - return { - all, - none, - allWithoutDisable, - half: !all && !none - }; -}; - -export const reInitChecked = function(node) { - if (!node || node.childNodesId.length === 0) return; - - let childNodes = node.getChildNodes(node.childNodesId); - const { - all, - none, - half - } = getChildState(childNodes); - if (all) { - node.checked = true; - node.indeterminate = false; - } else if (half) { - node.checked = false; - node.indeterminate = true; - } else if (none) { - node.checked = false; - node.indeterminate = false; - } - - let parent = node.getParent(node.parentId); - if (!parent || parent.level === 0) return; - - if (!node.store().checkStrictly) { - reInitChecked(parent); - } -}; - -export const getPropertyFromData = function(node, prop) { - const props = node.store().props; - const data = node.data || {}; - const config = props[prop]; - - if (typeof config === 'function') { - return config(data, node); - } else if (typeof config === 'string') { - return data[config]; - } else if (typeof config === 'undefined') { - const dataProp = data[prop]; - return dataProp === undefined ? '' : dataProp; - } -}; - -export const isNull = function(v) { - return v === undefined || v === null || v === ''; -} diff --git a/components/signal/signal.vue b/components/signal/signal.vue deleted file mode 100644 index 7f459bd..0000000 --- a/components/signal/signal.vue +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - diff --git a/components/tki-tree/style.css b/components/tki-tree/style.css deleted file mode 100644 index cb997b8..0000000 --- a/components/tki-tree/style.css +++ /dev/null @@ -1,151 +0,0 @@ -.tki-tree-mask { - position: fixed; - top: 0rpx; - right: 0rpx; - bottom: 0rpx; - left: 0rpx; - z-index: 9998; - background-color: rgba(0, 0, 0, 0.6); - opacity: 0; - transition: all 0.3s ease; - visibility: hidden; -} -.tki-tree-mask.show { - visibility: visible; - opacity: 1; -} -.tki-tree-cnt { - position: fixed; - top: 0rpx; - right: 0rpx; - bottom: 0rpx; - left: 0rpx; - z-index: 9999; - top: 160rpx; - transition: all 0.3s ease; - transform: translateY(100%); -} -.tki-tree-cnt.show { - transform: translateY(0); -} -.tki-tree-bar { - background-color: #fff; - height: 72rpx; - padding-left: 20rpx; - padding-right: 20rpx; - display: flex; - justify-content: space-between; - align-items: center; - box-sizing: border-box; - border-bottom-width: 1rpx !important; - border-bottom-style: solid; - border-bottom-color: #f5f5f5; - font-size: 32rpx; - color: #757575; - line-height: 1; -} -.tki-tree-bar-confirm { - color: #07bb07; -} -.tki-tree-view { - position: absolute; - top: 0rpx; - right: 0rpx; - bottom: 0rpx; - left: 0rpx; - top: 72rpx; - background-color: #fff; - padding-top: 20rpx; - padding-right: 20rpx; - padding-bottom: 20rpx; - padding-left: 20rpx; -} -.tki-tree-view-sc { - height: 100%; - overflow: hidden; -} -.tki-tree-item { - display: flex; - justify-content: space-between; - align-items: center; - font-size: 26rpx; - color: #757575; - line-height: 1; - height: 0; - opacity: 0; - transition: 0.2s; - position: relative; - overflow: hidden; -} -.tki-tree-item.show { - height: 80rpx; - opacity: 1; -} -.tki-tree-item.showchild:before { - transform: rotate(90deg); -} -.tki-tree-item.last:before { - opacity: 0; -} -.tki-tree-icon { - width: 26rpx; - height: 26rpx; - margin-right: 8rpx; -} -.tki-tree-label { - flex: 1; - display: flex; - align-items: center; - height: 100%; - line-height: 1.2; -} -.tki-tree-check { - width: 40px; - height: 40px; - display: flex; - justify-content: center; - align-items: center; -} -.tki-tree-check-yes, -.tki-tree-check-no { - width: 20px; - height: 20px; - border-top-left-radius: 20%; - border-top-right-radius: 20%; - border-bottom-right-radius: 20%; - border-bottom-left-radius: 20%; - border-top-width: 1rpx; - border-left-width: 1rpx; - border-bottom-width: 1rpx; - border-right-width: 1rpx; - border-style: solid; - border-color: #07bb07; - display: flex; - justify-content: center; - align-items: center; - box-sizing: border-box; -} -.tki-tree-check-yes-b { - width: 12px; - height: 12px; - border-top-left-radius: 20%; - border-top-right-radius: 20%; - border-bottom-right-radius: 20%; - border-bottom-left-radius: 20%; - background-color: #07bb07; -} -.tki-tree-check .radio { - border-top-left-radius: 50%; - border-top-right-radius: 50%; - border-bottom-right-radius: 50%; - border-bottom-left-radius: 50%; -} -.tki-tree-check .radio .tki-tree-check-yes-b { - border-top-left-radius: 50%; - border-top-right-radius: 50%; - border-bottom-right-radius: 50%; - border-bottom-left-radius: 50%; -} -.hover-c { - opacity: 0.6; -} diff --git a/components/tki-tree/tki-tree.vue b/components/tki-tree/tki-tree.vue deleted file mode 100644 index b3905f2..0000000 --- a/components/tki-tree/tki-tree.vue +++ /dev/null @@ -1,302 +0,0 @@ - - - - - diff --git a/components/u-charts/component.vue b/components/u-charts/component.vue deleted file mode 100644 index 413c360..0000000 --- a/components/u-charts/component.vue +++ /dev/null @@ -1,165 +0,0 @@ - - - - - diff --git a/components/u-charts/u-charts.js b/components/u-charts/u-charts.js deleted file mode 100644 index 06d190b..0000000 --- a/components/u-charts/u-charts.js +++ /dev/null @@ -1,5662 +0,0 @@ -/* - * uCharts v1.9.4.20200331 - * uni-app平台高性能跨全端图表,支持H5、APP、小程序(微信/支付宝/百度/头条/QQ/360) - * Copyright (c) 2019 QIUN秋云 https://www.ucharts.cn All rights reserved. - * Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) - * - * uCharts官方网站 - * https://www.uCharts.cn - * - * 开源地址: - * https://gitee.com/uCharts/uCharts - * - * uni-app插件市场地址: - * http://ext.dcloud.net.cn/plugin?id=271 - * - */ - -'use strict'; - -var config = { - yAxisWidth: 15, - yAxisSplit: 5, - xAxisHeight: 15, - xAxisLineHeight: 15, - legendHeight: 15, - yAxisTitleWidth: 15, - padding: [10, 10, 10, 10], - pixelRatio: 1, - rotate: false, - columePadding: 3, - fontSize: 13, - //dataPointShape: ['diamond', 'circle', 'triangle', 'rect'], - dataPointShape: ['circle', 'circle', 'circle', 'circle'], - colors: ['#1890ff', '#2fc25b', '#facc14', '#f04864', '#8543e0', '#90ed7d'], - pieChartLinePadding: 15, - pieChartTextPadding: 5, - xAxisTextPadding: 3, - titleColor: '#333333', - titleFontSize: 20, - subtitleColor: '#999999', - subtitleFontSize: 15, - toolTipPadding: 3, - toolTipBackground: '#000000', - toolTipOpacity: 0.7, - toolTipLineHeight: 20, - radarLabelTextMargin: 15, - gaugeLabelTextMargin: 15 -}; - -let assign = function (target, ...varArgs) { - if (target == null) { - throw new TypeError('Cannot convert undefined or null to object'); - } - if (!varArgs || varArgs.length <= 0) { - return target; - } - // 深度合并对象 - function deepAssign(obj1, obj2) { - for (let key in obj2) { - obj1[key] = obj1[key] && obj1[key].toString() === "[object Object]" ? - deepAssign(obj1[key], obj2[key]) : obj1[key] = obj2[key]; - } - return obj1; - } - - varArgs.forEach(val => { - target = deepAssign(target, val); - }); - return target; -}; - -var util = { - toFixed: function toFixed(num, limit) { - limit = limit || 2; - if (this.isFloat(num)) { - num = num.toFixed(limit); - } - return num; - }, - isFloat: function isFloat(num) { - return num % 1 !== 0; - }, - approximatelyEqual: function approximatelyEqual(num1, num2) { - return Math.abs(num1 - num2) < 1e-10; - }, - isSameSign: function isSameSign(num1, num2) { - return Math.abs(num1) === num1 && Math.abs(num2) === num2 || Math.abs(num1) !== num1 && Math.abs(num2) !== num2; - }, - isSameXCoordinateArea: function isSameXCoordinateArea(p1, p2) { - return this.isSameSign(p1.x, p2.x); - }, - isCollision: function isCollision(obj1, obj2) { - obj1.end = {}; - obj1.end.x = obj1.start.x + obj1.width; - obj1.end.y = obj1.start.y - obj1.height; - obj2.end = {}; - obj2.end.x = obj2.start.x + obj2.width; - obj2.end.y = obj2.start.y - obj2.height; - var flag = obj2.start.x > obj1.end.x || obj2.end.x < obj1.start.x || obj2.end.y > obj1.start.y || obj2.start.y < obj1.end.y; - return !flag; - } -}; - -//兼容H5点击事件 -function getH5Offset(e) { - e.mp = { - changedTouches: [] - }; - e.mp.changedTouches.push({ - x: e.offsetX, - y: e.offsetY - }); - return e; -} - -// hex 转 rgba -function hexToRgb(hexValue, opc) { - var rgx = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; - var hex = hexValue.replace(rgx, function(m, r, g, b) { - return r + r + g + g + b + b; - }); - var rgb = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); - var r = parseInt(rgb[1], 16); - var g = parseInt(rgb[2], 16); - var b = parseInt(rgb[3], 16); - return 'rgba(' + r + ',' + g + ',' + b + ',' + opc + ')'; -} - -function findRange(num, type, limit) { - if (isNaN(num)) { - throw new Error('[uCharts] unvalid series data!'); - } - limit = limit || 10; - type = type ? type : 'upper'; - var multiple = 1; - while (limit < 1) { - limit *= 10; - multiple *= 10; - } - if (type === 'upper') { - num = Math.ceil(num * multiple); - } else { - num = Math.floor(num * multiple); - } - while (num % limit !== 0) { - if (type === 'upper') { - num++; - } else { - num--; - } - } - return num / multiple; -} - -function calCandleMA(dayArr, nameArr, colorArr, kdata) { - let seriesTemp = []; - for (let k = 0; k < dayArr.length; k++) { - let seriesItem = { - data: [], - name: nameArr[k], - color: colorArr[k] - }; - for (let i = 0, len = kdata.length; i < len; i++) { - if (i < dayArr[k]) { - seriesItem.data.push(null); - continue; - } - let sum = 0; - for (let j = 0; j < dayArr[k]; j++) { - sum += kdata[i - j][1]; - } - seriesItem.data.push(+(sum / dayArr[k]).toFixed(3)); - } - seriesTemp.push(seriesItem); - } - return seriesTemp; -} - -function calValidDistance(self,distance, chartData, config, opts) { - var dataChartAreaWidth = opts.width - opts.area[1] - opts.area[3]; - var dataChartWidth = chartData.eachSpacing * (opts.chartData.xAxisData.xAxisPoints.length-1); - var validDistance = distance; - if (distance >= 0) { - validDistance = 0; - self.event.trigger('scrollLeft'); - } else if (Math.abs(distance) >= dataChartWidth - dataChartAreaWidth) { - validDistance = dataChartAreaWidth - dataChartWidth; - self.event.trigger('scrollRight'); - } - return validDistance; -} - -function isInAngleRange(angle, startAngle, endAngle) { - function adjust(angle) { - while (angle < 0) { - angle += 2 * Math.PI; - } - while (angle > 2 * Math.PI) { - angle -= 2 * Math.PI; - } - return angle; - } - angle = adjust(angle); - startAngle = adjust(startAngle); - endAngle = adjust(endAngle); - if (startAngle > endAngle) { - endAngle += 2 * Math.PI; - if (angle < startAngle) { - angle += 2 * Math.PI; - } - } - return angle >= startAngle && angle <= endAngle; -} - -function calRotateTranslate(x, y, h) { - var xv = x; - var yv = h - y; - var transX = xv + (h - yv - xv) / Math.sqrt(2); - transX *= -1; - var transY = (h - yv) * (Math.sqrt(2) - 1) - (h - yv - xv) / Math.sqrt(2); - return { - transX: transX, - transY: transY - }; -} - -function createCurveControlPoints(points, i) { - - function isNotMiddlePoint(points, i) { - if (points[i - 1] && points[i + 1]) { - return points[i].y >= Math.max(points[i - 1].y, points[i + 1].y) || points[i].y <= Math.min(points[i - 1].y,points[i + 1].y); - } else { - return false; - } - } - function isNotMiddlePointX(points, i) { - if (points[i - 1] && points[i + 1]) { - return points[i].x >= Math.max(points[i - 1].x, points[i + 1].x) || points[i].x <= Math.min(points[i - 1].x,points[i + 1].x); - } else { - return false; - } - } - var a = 0.2; - var b = 0.2; - var pAx = null; - var pAy = null; - var pBx = null; - var pBy = null; - if (i < 1) { - pAx = points[0].x + (points[1].x - points[0].x) * a; - pAy = points[0].y + (points[1].y - points[0].y) * a; - } else { - pAx = points[i].x + (points[i + 1].x - points[i - 1].x) * a; - pAy = points[i].y + (points[i + 1].y - points[i - 1].y) * a; - } - - if (i > points.length - 3) { - var last = points.length - 1; - pBx = points[last].x - (points[last].x - points[last - 1].x) * b; - pBy = points[last].y - (points[last].y - points[last - 1].y) * b; - } else { - pBx = points[i + 1].x - (points[i + 2].x - points[i].x) * b; - pBy = points[i + 1].y - (points[i + 2].y - points[i].y) * b; - } - if (isNotMiddlePoint(points, i + 1)) { - pBy = points[i + 1].y; - } - if (isNotMiddlePoint(points, i)) { - pAy = points[i].y; - } - if (isNotMiddlePointX(points, i + 1)) { - pBx = points[i + 1].x; - } - if (isNotMiddlePointX(points, i)) { - pAx = points[i].x; - } - if (pAy >= Math.max(points[i].y, points[i + 1].y) || pAy <= Math.min(points[i].y, points[i + 1].y)) { - pAy = points[i].y; - } - if (pBy >= Math.max(points[i].y, points[i + 1].y) || pBy <= Math.min(points[i].y, points[i + 1].y)) { - pBy = points[i + 1].y; - } - if (pAx >= Math.max(points[i].x, points[i + 1].x) || pAx <= Math.min(points[i].x, points[i + 1].x)) { - pAx = points[i].x; - } - if (pBx >= Math.max(points[i].x, points[i + 1].x) || pBx <= Math.min(points[i].x, points[i + 1].x)) { - pBx = points[i + 1].x; - } - return { - ctrA: { - x: pAx, - y: pAy - }, - ctrB: { - x: pBx, - y: pBy - } - }; -} - -function convertCoordinateOrigin(x, y, center) { - return { - x: center.x + x, - y: center.y - y - }; -} - -function avoidCollision(obj, target) { - if (target) { - // is collision test - while (util.isCollision(obj, target)) { - if (obj.start.x > 0) { - obj.start.y--; - } else if (obj.start.x < 0) { - obj.start.y++; - } else { - if (obj.start.y > 0) { - obj.start.y++; - } else { - obj.start.y--; - } - } - } - } - return obj; -} - -function fillSeries(series, opts, config) { - var index = 0; - return series.map(function(item) { - if (!item.color) { - item.color = config.colors[index]; - index = (index + 1) % config.colors.length; - } - if (!item.index) { - item.index = 0; - } - if (!item.type) { - item.type = opts.type; - } - if (typeof item.show == "undefined") { - item.show = true; - } - if (!item.type) { - item.type = opts.type; - } - if (!item.pointShape) { - item.pointShape = "circle"; - } - if (!item.legendShape) { - switch (item.type) { - case 'line': - item.legendShape = "line"; - break; - case 'column': - item.legendShape = "rect"; - break; - case 'area': - item.legendShape = "triangle"; - break; - default: - item.legendShape = "circle"; - } - } - return item; - }); -} - -function getDataRange(minData, maxData) { - var limit = 0; - var range = maxData - minData; - if (range >= 10000) { - limit = 1000; - } else if (range >= 1000) { - limit = 100; - } else if (range >= 100) { - limit = 10; - } else if (range >= 10) { - limit = 5; - } else if (range >= 1) { - limit = 1; - } else if (range >= 0.1) { - limit = 0.1; - } else if (range >= 0.01) { - limit = 0.01; - } else if (range >= 0.001) { - limit = 0.001; - } else if (range >= 0.0001) { - limit = 0.0001; - } else if (range >= 0.00001) { - limit = 0.00001; - } else { - limit = 0.000001; - } - return { - minRange: findRange(minData, 'lower', limit), - maxRange: findRange(maxData, 'upper', limit) - }; -} - -function measureText(text) { - var fontSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : config.fontSize; - text = String(text); - var text = text.split(''); - var width = 0; - for (let i = 0; i < text.length; i++) { - let item = text[i]; - if (/[a-zA-Z]/.test(item)) { - width += 7; - } else if (/[0-9]/.test(item)) { - width += 5.5; - } else if (/\./.test(item)) { - width += 2.7; - } else if (/-/.test(item)) { - width += 3.25; - } else if (/[\u4e00-\u9fa5]/.test(item)) { - width += 10; - } else if (/\(|\)/.test(item)) { - width += 3.73; - } else if (/\s/.test(item)) { - width += 2.5; - } else if (/%/.test(item)) { - width += 8; - } else { - width += 10; - } - } - return width * fontSize / 10; -} - -function dataCombine(series) { - return series.reduce(function(a, b) { - return (a.data ? a.data : a).concat(b.data); - }, []); -} - -function dataCombineStack(series, len) { - var sum = new Array(len); - for (var j = 0; j < sum.length; j++) { - sum[j] = 0; - } - for (var i = 0; i < series.length; i++) { - for (var j = 0; j < sum.length; j++) { - sum[j] += series[i].data[j]; - } - } - return series.reduce(function(a, b) { - return (a.data ? a.data : a).concat(b.data).concat(sum); - }, []); -} - -function getTouches(touches, opts, e) { - let x, y; - if (touches.clientX) { - if (opts.rotate) { - y = opts.height - touches.clientX * opts.pixelRatio; - x = (touches.pageY - e.currentTarget.offsetTop - (opts.height / opts.pixelRatio / 2) * (opts.pixelRatio - 1)) * - opts.pixelRatio; - } else { - x = touches.clientX * opts.pixelRatio; - y = (touches.pageY - e.currentTarget.offsetTop - (opts.height / opts.pixelRatio / 2) * (opts.pixelRatio - 1)) * - opts.pixelRatio; - } - } else { - if (opts.rotate) { - y = opts.height - touches.x * opts.pixelRatio; - x = touches.y * opts.pixelRatio; - } else { - x = touches.x * opts.pixelRatio; - y = touches.y * opts.pixelRatio; - } - } - return { - x: x, - y: y - } -} - -function getSeriesDataItem(series, index) { - var data = []; - for (let i = 0; i < series.length; i++) { - let item = series[i]; - if (item.data[index] !== null && typeof item.data[index] !== 'undefined' && item.show) { - let seriesItem = {}; - seriesItem.color = item.color; - seriesItem.type = item.type; - seriesItem.style = item.style; - seriesItem.pointShape = item.pointShape; - seriesItem.disableLegend = item.disableLegend; - seriesItem.name = item.name; - seriesItem.show = item.show; - seriesItem.data = item.format ? item.format(item.data[index]) : item.data[index]; - data.push(seriesItem); - } - } - return data; -} - -function getMaxTextListLength(list) { - var lengthList = list.map(function(item) { - return measureText(item); - }); - return Math.max.apply(null, lengthList); -} - -function getRadarCoordinateSeries(length) { - var eachAngle = 2 * Math.PI / length; - var CoordinateSeries = []; - for (var i = 0; i < length; i++) { - CoordinateSeries.push(eachAngle * i); - } - - return CoordinateSeries.map(function(item) { - return -1 * item + Math.PI / 2; - }); -} - -function getToolTipData(seriesData, calPoints, index, categories) { - var option = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {}; - - var textList = seriesData.map(function(item) { - let titleText=[]; - if(categories){ - titleText=categories; - }else{ - titleText=item.data; - } - return { - text: option.format ? option.format(item, titleText[index]) : item.name + ': ' + item.data, - color: item.color - }; - }); - var validCalPoints = []; - var offset = { - x: 0, - y: 0 - }; - for (let i = 0; i < calPoints.length; i++) { - let points = calPoints[i]; - if (typeof points[index] !== 'undefined' && points[index] !== null) { - validCalPoints.push(points[index]); - } - } - for (let i = 0; i < validCalPoints.length; i++) { - let item = validCalPoints[i]; - offset.x = Math.round(item.x); - offset.y += item.y; - } - offset.y /= validCalPoints.length; - return { - textList: textList, - offset: offset - }; -} - -function getMixToolTipData(seriesData, calPoints, index, categories) { - var option = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {}; - var textList = seriesData.map(function(item) { - return { - text: option.format ? option.format(item, categories[index]) : item.name + ': ' + item.data, - color: item.color, - disableLegend: item.disableLegend ? true : false - }; - }); - textList = textList.filter(function(item) { - if (item.disableLegend !== true) { - return item; - } - }); - var validCalPoints = []; - var offset = { - x: 0, - y: 0 - }; - for (let i = 0; i < calPoints.length; i++) { - let points = calPoints[i]; - if (typeof points[index] !== 'undefined' && points[index] !== null) { - validCalPoints.push(points[index]); - } - } - for (let i = 0; i < validCalPoints.length; i++) { - let item = validCalPoints[i]; - offset.x = Math.round(item.x); - offset.y += item.y; - } - offset.y /= validCalPoints.length; - return { - textList: textList, - offset: offset - }; -} - -function getCandleToolTipData(series, seriesData, calPoints, index, categories, extra) { - var option = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : {}; - let upColor = extra.color.upFill; - let downColor = extra.color.downFill; - //颜色顺序为开盘,收盘,最低,最高 - let color = [upColor, upColor, downColor, upColor]; - var textList = []; - let text0 = { - text: categories[index], - color: null - }; - textList.push(text0); - seriesData.map(function(item) { - if (index == 0) { - if(item.data[1] - item.data[0] < 0){ - color[1] = downColor; - }else{ - color[1] = upColor; - } - } else { - if (item.data[0] < series[index - 1][1]) { - color[0] = downColor; - } - if (item.data[1] < item.data[0]) { - color[1] = downColor; - } - if (item.data[2] > series[index - 1][1]) { - color[2] = upColor; - } - if (item.data[3] < series[index - 1][1]) { - color[3] = downColor; - } - } - let text1 = { - text: '开盘:' + item.data[0], - color: color[0] - }; - let text2 = { - text: '收盘:' + item.data[1], - color: color[1] - }; - let text3 = { - text: '最低:' + item.data[2], - color: color[2] - }; - let text4 = { - text: '最高:' + item.data[3], - color: color[3] - }; - textList.push(text1, text2, text3, text4); - }); - var validCalPoints = []; - var offset = { - x: 0, - y: 0 - }; - for (let i = 0; i < calPoints.length; i++) { - let points = calPoints[i]; - if (typeof points[index] !== 'undefined' && points[index] !== null) { - validCalPoints.push(points[index]); - } - } - offset.x = Math.round(validCalPoints[0][0].x); - return { - textList: textList, - offset: offset - }; -} - -function filterSeries(series) { - let tempSeries = []; - for (let i = 0; i < series.length; i++) { - if (series[i].show == true) { - tempSeries.push(series[i]) - } - } - return tempSeries; -} - -function findCurrentIndex(currentPoints, calPoints, opts, config) { - var offset = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0; - var currentIndex = -1; - var spacing = opts.chartData.eachSpacing/2; - let xAxisPoints=[]; - if(calPoints.length>0){ - if(opts.type=='candle'){ - for(let i=0;i item) { - currentIndex = index; - } - }); - } - } - return currentIndex; -} - -function findLegendIndex(currentPoints, legendData, opts) { - let currentIndex = -1; - if (isInExactLegendArea(currentPoints, legendData.area)) { - let points = legendData.points; - let index = -1; - for (let i = 0, len = points.length; i < len; i++) { - let item = points[i]; - for (let j = 0; j < item.length; j++) { - index += 1; - let area = item[j]['area']; - if (currentPoints.x > area[0] && currentPoints.x < area[2] && currentPoints.y > area[1] && currentPoints.y < area[3]) { - currentIndex = index; - break; - } - } - } - return currentIndex; - } - return currentIndex; -} - -function isInExactLegendArea(currentPoints, area) { - return currentPoints.x > area.start.x && currentPoints.x < area.end.x && currentPoints.y > area.start.y && - currentPoints.y < area.end.y; -} - -function isInExactChartArea(currentPoints, opts, config) { - return currentPoints.x <= opts.width - opts.area[1] + 10 && currentPoints.x >= opts.area[3] -10 && currentPoints.y >= opts.area[0] && currentPoints.y <= opts.height - opts.area[2]; -} - -function findRadarChartCurrentIndex(currentPoints, radarData, count) { - var eachAngleArea = 2 * Math.PI / count; - var currentIndex = -1; - if (isInExactPieChartArea(currentPoints, radarData.center, radarData.radius)) { - var fixAngle = function fixAngle(angle) { - if (angle < 0) { - angle += 2 * Math.PI; - } - if (angle > 2 * Math.PI) { - angle -= 2 * Math.PI; - } - return angle; - }; - - var angle = Math.atan2(radarData.center.y - currentPoints.y, currentPoints.x - radarData.center.x); - angle = -1 * angle; - if (angle < 0) { - angle += 2 * Math.PI; - } - - var angleList = radarData.angleList.map(function(item) { - item = fixAngle(-1 * item); - - return item; - }); - - angleList.forEach(function(item, index) { - var rangeStart = fixAngle(item - eachAngleArea / 2); - var rangeEnd = fixAngle(item + eachAngleArea / 2); - if (rangeEnd < rangeStart) { - rangeEnd += 2 * Math.PI; - } - if (angle >= rangeStart && angle <= rangeEnd || angle + 2 * Math.PI >= rangeStart && angle + 2 * Math.PI <= - rangeEnd) { - currentIndex = index; - } - }); - } - - return currentIndex; -} - -function findFunnelChartCurrentIndex(currentPoints, funnelData) { - var currentIndex = -1; - for (var i = 0, len = funnelData.series.length; i < len; i++) { - var item = funnelData.series[i]; - if (currentPoints.x > item.funnelArea[0] && currentPoints.x < item.funnelArea[2] && currentPoints.y > item.funnelArea[1] && currentPoints.y < item.funnelArea[3]) { - currentIndex = i; - break; - } - } - return currentIndex; -} - -function findWordChartCurrentIndex(currentPoints, wordData) { - var currentIndex = -1; - for (var i = 0, len = wordData.length; i < len; i++) { - var item = wordData[i]; - if (currentPoints.x > item.area[0] && currentPoints.x < item.area[2] && currentPoints.y > item.area[1] && currentPoints.y < item.area[3]) { - currentIndex = i; - break; - } - } - return currentIndex; -} - -function findMapChartCurrentIndex(currentPoints, opts) { - var currentIndex = -1; - var cData=opts.chartData.mapData; - var data=opts.series; - var tmp=pointToCoordinate(currentPoints.y, currentPoints.x,cData.bounds,cData.scale,cData.xoffset,cData.yoffset); - var poi=[tmp.x, tmp.y]; - for (var i = 0, len = data.length; i < len; i++) { - var item = data[i].geometry.coordinates; - if(isPoiWithinPoly(poi,item)){ - currentIndex = i; - break; - } - } - return currentIndex; -} - -function findPieChartCurrentIndex(currentPoints, pieData) { - var currentIndex = -1; - if (isInExactPieChartArea(currentPoints, pieData.center, pieData.radius)) { - var angle = Math.atan2(pieData.center.y - currentPoints.y, currentPoints.x - pieData.center.x); - angle = -angle; - for (var i = 0, len = pieData.series.length; i < len; i++) { - var item = pieData.series[i]; - if (isInAngleRange(angle, item._start_, item._start_ + item._proportion_ * 2 * Math.PI)) { - currentIndex = i; - break; - } - } - } - - return currentIndex; -} - -function isInExactPieChartArea(currentPoints, center, radius) { - return Math.pow(currentPoints.x - center.x, 2) + Math.pow(currentPoints.y - center.y, 2) <= Math.pow(radius, 2); -} - -function splitPoints(points) { - var newPoints = []; - var items = []; - points.forEach(function(item, index) { - if (item !== null) { - items.push(item); - } else { - if (items.length) { - newPoints.push(items); - } - items = []; - } - }); - if (items.length) { - newPoints.push(items); - } - - return newPoints; -} - -function calLegendData(series, opts, config, chartData) { - let legendData = { - area: { - start: { - x: 0, - y: 0 - }, - end: { - x: 0, - y: 0 - }, - width: 0, - height: 0, - wholeWidth: 0, - wholeHeight: 0 - }, - points: [], - widthArr: [], - heightArr: [] - }; - if (opts.legend.show === false) { - chartData.legendData = legendData; - return legendData; - } - - let padding = opts.legend.padding; - let margin = opts.legend.margin; - let fontSize = opts.legend.fontSize; - let shapeWidth = 15 * opts.pixelRatio; - let shapeRight = 5 * opts.pixelRatio; - let lineHeight = Math.max(opts.legend.lineHeight * opts.pixelRatio, fontSize); - if (opts.legend.position == 'top' || opts.legend.position == 'bottom') { - let legendList = []; - let widthCount = 0; - let widthCountArr = []; - let currentRow = []; - for (let i = 0; i < series.length; i++) { - let item = series[i]; - let itemWidth = shapeWidth + shapeRight + measureText(item.name || 'undefined', fontSize) + opts.legend.itemGap; - if (widthCount + itemWidth > opts.width - opts.padding[1] - opts.padding[3]) { - legendList.push(currentRow); - widthCountArr.push(widthCount - opts.legend.itemGap); - widthCount = itemWidth; - currentRow = [item]; - } else { - widthCount += itemWidth; - currentRow.push(item); - } - } - if (currentRow.length) { - legendList.push(currentRow); - widthCountArr.push(widthCount - opts.legend.itemGap); - legendData.widthArr = widthCountArr; - let legendWidth = Math.max.apply(null, widthCountArr); - switch (opts.legend.float) { - case 'left': - legendData.area.start.x = opts.padding[3]; - legendData.area.end.x = opts.padding[3] + 2 * padding; - break; - case 'right': - legendData.area.start.x = opts.width - opts.padding[1] - legendWidth - 2 * padding; - legendData.area.end.x = opts.width - opts.padding[1]; - break; - default: - legendData.area.start.x = (opts.width - legendWidth) / 2 - padding; - legendData.area.end.x = (opts.width + legendWidth) / 2 + padding; - } - legendData.area.width = legendWidth + 2 * padding; - legendData.area.wholeWidth = legendWidth + 2 * padding; - legendData.area.height = legendList.length * lineHeight + 2 * padding; - legendData.area.wholeHeight = legendList.length * lineHeight + 2 * padding + 2 * margin; - legendData.points = legendList; - } - } else { - let len = series.length; - let maxHeight = opts.height - opts.padding[0] - opts.padding[2] - 2 * margin - 2 * padding; - let maxLength = Math.min(Math.floor(maxHeight / lineHeight), len); - legendData.area.height = maxLength * lineHeight + padding * 2; - legendData.area.wholeHeight = maxLength * lineHeight + padding * 2; - switch (opts.legend.float) { - case 'top': - legendData.area.start.y = opts.padding[0] + margin; - legendData.area.end.y = opts.padding[0] + margin + legendData.area.height; - break; - case 'bottom': - legendData.area.start.y = opts.height - opts.padding[2] - margin - legendData.area.height; - legendData.area.end.y = opts.height - opts.padding[2] - margin; - break; - default: - legendData.area.start.y = (opts.height - legendData.area.height) / 2; - legendData.area.end.y = (opts.height + legendData.area.height) / 2; - } - let lineNum = len % maxLength === 0 ? len / maxLength : Math.floor((len / maxLength) + 1); - let currentRow = []; - for (let i = 0; i < lineNum; i++) { - let temp = series.slice(i * maxLength, i * maxLength + maxLength); - currentRow.push(temp); - } - - legendData.points = currentRow; - - if (currentRow.length) { - for (let i = 0; i < currentRow.length; i++) { - let item = currentRow[i]; - let maxWidth = 0; - for (let j = 0; j < item.length; j++) { - let itemWidth = shapeWidth + shapeRight + measureText(item[j].name || 'undefined', fontSize) + opts.legend.itemGap; - if (itemWidth > maxWidth) { - maxWidth = itemWidth; - } - } - legendData.widthArr.push(maxWidth); - legendData.heightArr.push(item.length * lineHeight + padding * 2); - } - let legendWidth = 0 - for (let i = 0; i < legendData.widthArr.length; i++) { - legendWidth += legendData.widthArr[i]; - } - legendData.area.width = legendWidth - opts.legend.itemGap + 2 * padding; - legendData.area.wholeWidth = legendData.area.width + padding; - } - } - - switch (opts.legend.position) { - case 'top': - legendData.area.start.y = opts.padding[0] + margin; - legendData.area.end.y = opts.padding[0] + margin + legendData.area.height; - break; - case 'bottom': - legendData.area.start.y = opts.height - opts.padding[2] - legendData.area.height - margin; - legendData.area.end.y = opts.height - opts.padding[2] - margin; - break; - case 'left': - legendData.area.start.x = opts.padding[3]; - legendData.area.end.x = opts.padding[3] + legendData.area.width; - break; - case 'right': - legendData.area.start.x = opts.width - opts.padding[1] - legendData.area.width; - legendData.area.end.x = opts.width - opts.padding[1]; - break; - } - chartData.legendData = legendData; - return legendData; -} - -function calCategoriesData(categories, opts, config, eachSpacing) { - var result = { - angle: 0, - xAxisHeight: config.xAxisHeight - }; - var categoriesTextLenth = categories.map(function(item) { - return measureText(item,opts.xAxis.fontSize||config.fontSize); - }); - var maxTextLength = Math.max.apply(this, categoriesTextLenth); - - if (opts.xAxis.rotateLabel == true && maxTextLength + 2 * config.xAxisTextPadding > eachSpacing) { - result.angle = 45 * Math.PI / 180; - result.xAxisHeight = 2 * config.xAxisTextPadding + maxTextLength * Math.sin(result.angle); - } - return result; -} - -function getXAxisTextList(series, opts, config) { - var index = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : -1; - var data = dataCombine(series); - var sorted = []; - // remove null from data - data = data.filter(function(item) { - //return item !== null; - if (typeof item === 'object' && item !== null) { - if (item.constructor.toString().indexOf('Array')>-1) { - return item !== null; - } else { - return item.value !== null; - } - } else { - return item !== null; - } - }); - data.map(function(item) { - if (typeof item === 'object') { - if (item.constructor.toString().indexOf('Array')>-1) { - if(opts.type=='candle'){ - item.map(function(subitem) { - sorted.push(subitem); - }) - }else{ - sorted.push(item[0]); - } - } else { - sorted.push(item.value); - } - } else { - sorted.push(item); - } - }) - - var minData = 0; - var maxData = 0; - if (sorted.length > 0) { - minData = Math.min.apply(this, sorted); - maxData = Math.max.apply(this, sorted); - } - //为了兼容v1.9.0之前的项目 - if(index>-1){ - if (typeof opts.xAxis.data[index].min === 'number') { - minData = Math.min(opts.xAxis.data[index].min, minData); - } - if (typeof opts.xAxis.data[index].max === 'number') { - maxData = Math.max(opts.xAxis.data[index].max, maxData); - } - }else{ - if (typeof opts.xAxis.min === 'number') { - minData = Math.min(opts.xAxis.min, minData); - } - if (typeof opts.xAxis.max === 'number') { - maxData = Math.max(opts.xAxis.max, maxData); - } - } - - - if (minData === maxData) { - var rangeSpan = maxData || 10; - maxData += rangeSpan; - } - - //var dataRange = getDataRange(minData, maxData); - var minRange = minData; - var maxRange = maxData; - - var range = []; - var eachRange = (maxRange - minRange) / opts.xAxis.splitNumber; - - for (var i = 0; i <= opts.xAxis.splitNumber; i++) { - range.push(minRange + eachRange * i); - } - return range; -} - -function calXAxisData(series, opts, config){ - var result = { - angle: 0, - xAxisHeight: config.xAxisHeight - }; - - result.ranges = getXAxisTextList(series, opts, config); - result.rangesFormat = result.ranges.map(function(item){ - item = opts.xAxis.format? opts.xAxis.format(item):util.toFixed(item, 2); - return item; - }); - - var xAxisScaleValues = result.ranges.map(function (item) { - // 如果刻度值是浮点数,则保留两位小数 - item = util.toFixed(item, 2); - // 若有自定义格式则调用自定义的格式化函数 - item = opts.xAxis.format ? opts.xAxis.format(Number(item)) : item; - return item; - }); - - result = Object.assign(result,getXAxisPoints(xAxisScaleValues, opts, config)); - // 计算X轴刻度的属性譬如每个刻度的间隔,刻度的起始点\结束点以及总长 - var eachSpacing = result.eachSpacing; - - var textLength = xAxisScaleValues.map(function (item) { - return measureText(item); - }); - - // get max length of categories text - var maxTextLength = Math.max.apply(this, textLength); - - // 如果刻度值文本内容过长,则将其逆时针旋转45° - if (maxTextLength + 2 * config.xAxisTextPadding > eachSpacing) { - result.angle = 45 * Math.PI / 180; - result.xAxisHeight = 2 * config.xAxisTextPadding + maxTextLength * Math.sin(result.angle); - } - - if (opts.xAxis.disabled === true) { - result.xAxisHeight = 0; - } - - return result; -} - -function getRadarDataPoints(angleList, center, radius, series, opts) { - var process = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 1; - - var radarOption = opts.extra.radar || {}; - radarOption.max = radarOption.max || 0; - var maxData = Math.max(radarOption.max, Math.max.apply(null, dataCombine(series))); - - var data = []; - for (let i = 0; i < series.length; i++) { - let each = series[i]; - let listItem = {}; - listItem.color = each.color; - listItem.legendShape = each.legendShape; - listItem.pointShape = each.pointShape; - listItem.data = []; - each.data.forEach(function(item, index) { - let tmp = {}; - tmp.angle = angleList[index]; - - tmp.proportion = item / maxData; - tmp.position = convertCoordinateOrigin(radius * tmp.proportion * process * Math.cos(tmp.angle), radius * tmp.proportion * - process * Math.sin(tmp.angle), center); - listItem.data.push(tmp); - }); - - data.push(listItem); - } - - return data; -} - -function getPieDataPoints(series, radius) { - var process = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; - - var count = 0; - var _start_ = 0; - for (let i = 0; i < series.length; i++) { - let item = series[i]; - item.data = item.data === null ? 0 : item.data; - count += item.data; - } - for (let i = 0; i < series.length; i++) { - let item = series[i]; - item.data = item.data === null ? 0 : item.data; - if (count === 0) { - item._proportion_ = 1 / series.length * process; - } else { - item._proportion_ = item.data / count * process; - } - item._radius_ = radius; - } - for (let i = 0; i < series.length; i++) { - let item = series[i]; - item._start_ = _start_; - _start_ += 2 * item._proportion_ * Math.PI; - } - - return series; -} - -function getFunnelDataPoints(series, radius) { - var process = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; - series = series.sort(function(a,b){return parseInt(b.data)-parseInt(a.data);}); - for (let i = 0; i < series.length; i++) { - series[i].radius = series[i].data/series[0].data*radius*process; - series[i]._proportion_ = series[i].data/series[0].data; - } - return series.reverse(); -} - -function getRoseDataPoints(series, type, minRadius, radius) { - var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1; - var count = 0; - var _start_ = 0; - - var dataArr = []; - for (let i = 0; i < series.length; i++) { - let item = series[i]; - item.data = item.data === null ? 0 : item.data; - count += item.data; - dataArr.push(item.data); - } - - var minData = Math.min.apply(null, dataArr); - var maxData = Math.max.apply(null, dataArr); - var radiusLength = radius - minRadius; - - for (let i = 0; i < series.length; i++) { - let item = series[i]; - item.data = item.data === null ? 0 : item.data; - if (count === 0 || type == 'area') { - item._proportion_ = item.data / count * process; - item._rose_proportion_ = 1 / series.length * process; - } else { - item._proportion_ = item.data / count * process; - item._rose_proportion_ = item.data / count * process; - } - item._radius_ = minRadius + radiusLength * ((item.data - minData) / (maxData - minData)); - } - for (let i = 0; i < series.length; i++) { - let item = series[i]; - item._start_ = _start_; - _start_ += 2 * item._rose_proportion_ * Math.PI; - } - - return series; -} - -function getArcbarDataPoints(series, arcbarOption) { - var process = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; - if (process == 1) { - process = 0.999999; - } - for (let i = 0; i < series.length; i++) { - let item = series[i]; - item.data = item.data === null ? 0 : item.data; - let totalAngle; - if (arcbarOption.type == 'circle') { - totalAngle = 2; - } else { - if (arcbarOption.endAngle < arcbarOption.startAngle) { - totalAngle = 2 + arcbarOption.endAngle - arcbarOption.startAngle; - } else{ - totalAngle = arcbarOption.startAngle - arcbarOption.endAngle; - } - } - item._proportion_ = totalAngle * item.data * process + arcbarOption.startAngle; - if (item._proportion_ >= 2) { - item._proportion_ = item._proportion_ % 2; - } - } - return series; -} - -function getGaugeAxisPoints(categories, startAngle, endAngle) { - let totalAngle = startAngle - endAngle + 1; - let tempStartAngle = startAngle; - for (let i = 0; i < categories.length; i++) { - categories[i].value = categories[i].value === null ? 0 : categories[i].value; - categories[i]._startAngle_ = tempStartAngle; - categories[i]._endAngle_ = totalAngle * categories[i].value + startAngle; - if (categories[i]._endAngle_ >= 2) { - categories[i]._endAngle_ = categories[i]._endAngle_ % 2; - } - tempStartAngle = categories[i]._endAngle_; - } - return categories; -} - -function getGaugeDataPoints(series, categories, gaugeOption) { - let process = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1; - for (let i = 0; i < series.length; i++) { - let item = series[i]; - item.data = item.data === null ? 0 : item.data; - if (gaugeOption.pointer.color == 'auto') { - for (let i = 0; i < categories.length; i++) { - if (item.data <= categories[i].value) { - item.color = categories[i].color; - break; - } - } - } else { - item.color = gaugeOption.pointer.color; - } - let totalAngle = gaugeOption.startAngle - gaugeOption.endAngle + 1; - item._endAngle_ = totalAngle * item.data + gaugeOption.startAngle; - item._oldAngle_ = gaugeOption.oldAngle; - if (gaugeOption.oldAngle < gaugeOption.endAngle) { - item._oldAngle_ += 2; - } - if (item.data >= gaugeOption.oldData) { - item._proportion_ = (item._endAngle_ - item._oldAngle_) * process + gaugeOption.oldAngle; - } else { - item._proportion_ = item._oldAngle_ - (item._oldAngle_ - item._endAngle_) * process; - } - if (item._proportion_ >= 2) { - item._proportion_ = item._proportion_ % 2; - } - } - return series; -} - -function getPieTextMaxLength(series) { - series = getPieDataPoints(series); - let maxLength = 0; - for (let i = 0; i < series.length; i++) { - let item = series[i]; - let text = item.format ? item.format(+item._proportion_.toFixed(2)) : util.toFixed(item._proportion_ * 100) + '%'; - maxLength = Math.max(maxLength, measureText(text)); - } - - return maxLength; -} - -function fixColumeData(points, eachSpacing, columnLen, index, config, opts) { - return points.map(function(item) { - if (item === null) { - return null; - } - item.width = Math.ceil((eachSpacing - 2 * config.columePadding) / columnLen); - - if (opts.extra.column && opts.extra.column.width && +opts.extra.column.width > 0) { - item.width = Math.min(item.width, +opts.extra.column.width); - } - if (item.width <= 0) { - item.width = 1; - } - item.x += (index + 0.5 - columnLen / 2) * item.width; - return item; - }); -} - -function fixColumeMeterData(points, eachSpacing, columnLen, index, config, opts, border) { - return points.map(function(item) { - if (item === null) { - return null; - } - item.width = Math.ceil((eachSpacing - 2 * config.columePadding) / 2); - - if (opts.extra.column && opts.extra.column.width && +opts.extra.column.width > 0) { - item.width = Math.min(item.width, +opts.extra.column.width); - } - - if (index > 0) { - item.width -= 2 * border; - } - return item; - }); -} - -function fixColumeStackData(points, eachSpacing, columnLen, index, config, opts, series) { - - return points.map(function(item, indexn) { - - if (item === null) { - return null; - } - item.width = Math.ceil((eachSpacing - 2 * config.columePadding) / 2); - - if (opts.extra.column && opts.extra.column.width && +opts.extra.column.width > 0) { - item.width = Math.min(item.width, +opts.extra.column.width); - } - return item; - }); -} - -function getXAxisPoints(categories, opts, config) { - var spacingValid = opts.width - opts.area[1] - opts.area[3]; - var dataCount = opts.enableScroll ? Math.min(opts.xAxis.itemCount, categories.length) : categories.length; - if((opts.type=='line' || opts.type=='area') && dataCount>1 && opts.xAxis.boundaryGap=='justify'){ - dataCount -=1; - } - var eachSpacing = spacingValid / dataCount; - - var xAxisPoints = []; - var startX = opts.area[3]; - var endX = opts.width - opts.area[1]; - categories.forEach(function(item, index) { - xAxisPoints.push(startX + index * eachSpacing); - }); - if(opts.xAxis.boundaryGap !=='justify'){ - if (opts.enableScroll === true) { - xAxisPoints.push(startX + categories.length * eachSpacing); - } else { - xAxisPoints.push(endX); - } - } - return { - xAxisPoints: xAxisPoints, - startX: startX, - endX: endX, - eachSpacing: eachSpacing - }; -} - -function getCandleDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config) { - var process = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 1; - var points = []; - var validHeight = opts.height - opts.area[0] - opts.area[2]; - data.forEach(function(item, index) { - if (item === null) { - points.push(null); - } else { - var cPoints = []; - item.forEach(function(items, indexs) { - var point = {}; - point.x = xAxisPoints[index] + Math.round(eachSpacing / 2); - var value = items.value || items; - var height = validHeight * (value - minRange) / (maxRange - minRange); - height *= process; - point.y = opts.height - Math.round(height) - opts.area[2]; - cPoints.push(point); - }); - points.push(cPoints); - } - }); - - return points; -} - -function getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config) { - var process = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 1; - var boundaryGap='center'; - if (opts.type == 'line'||opts.type == 'area'){ - boundaryGap=opts.xAxis.boundaryGap; - } - var points = []; - var validHeight = opts.height - opts.area[0] - opts.area[2]; - var validWidth = opts.width - opts.area[1] - opts.area[3]; - data.forEach(function(item, index) { - if (item === null) { - points.push(null); - } else { - var point = {}; - point.color = item.color; - point.x = xAxisPoints[index]; - var value = item; - if (typeof item === 'object' && item !== null) { - if (item.constructor.toString().indexOf('Array')>-1) { - let xranges,xminRange,xmaxRange; - xranges = [].concat(opts.chartData.xAxisData.ranges); - xminRange = xranges.shift(); - xmaxRange = xranges.pop(); - value = item[1]; - point.x = opts.area[3]+ validWidth * (item[0] - xminRange) / (xmaxRange - xminRange); - } else { - value = item.value; - } - } - if(boundaryGap=='center'){ - point.x += Math.round(eachSpacing / 2); - } - var height = validHeight * (value - minRange) / (maxRange - minRange); - height *= process; - point.y = opts.height - Math.round(height) - opts.area[2]; - points.push(point); - } - }); - - return points; -} - -function getStackDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, seriesIndex, stackSeries) { - var process = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : 1; - var points = []; - var validHeight = opts.height - opts.area[0] - opts.area[2]; - - data.forEach(function(item, index) { - if (item === null) { - points.push(null); - } else { - var point = {}; - point.color = item.color; - point.x = xAxisPoints[index] + Math.round(eachSpacing / 2); - - if (seriesIndex > 0) { - var value = 0; - for (let i = 0; i <= seriesIndex; i++) { - value += stackSeries[i].data[index]; - } - var value0 = value - item; - var height = validHeight * (value - minRange) / (maxRange - minRange); - var height0 = validHeight * (value0 - minRange) / (maxRange - minRange); - } else { - var value = item; - var height = validHeight * (value - minRange) / (maxRange - minRange); - var height0 = 0; - } - var heightc = height0; - height *= process; - heightc *= process; - point.y = opts.height - Math.round(height) - opts.area[2]; - point.y0 = opts.height - Math.round(heightc) - opts.area[2]; - points.push(point); - } - }); - - return points; -} - -function getYAxisTextList(series, opts, config, stack) { - var index = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : -1; - var data; - if (stack == 'stack') { - data = dataCombineStack(series, opts.categories.length); - } else { - data = dataCombine(series); - } - var sorted = []; - // remove null from data - data = data.filter(function(item) { - //return item !== null; - if (typeof item === 'object' && item !== null) { - if (item.constructor.toString().indexOf('Array')>-1) { - return item !== null; - } else { - return item.value !== null; - } - } else { - return item !== null; - } - }); - data.map(function(item) { - if (typeof item === 'object') { - if (item.constructor.toString().indexOf('Array')>-1) { - if(opts.type=='candle'){ - item.map(function(subitem) { - sorted.push(subitem); - }) - }else{ - sorted.push(item[1]); - } - } else { - sorted.push(item.value); - } - } else { - sorted.push(item); - } - }) - - var minData = 0; - var maxData = 0; - if (sorted.length > 0) { - minData = Math.min.apply(this, sorted); - maxData = Math.max.apply(this, sorted); - } - //为了兼容v1.9.0之前的项目 - if(index>-1){ - if (typeof opts.yAxis.data[index].min === 'number') { - minData = Math.min(opts.yAxis.data[index].min, minData); - } - if (typeof opts.yAxis.data[index].max === 'number') { - maxData = Math.max(opts.yAxis.data[index].max, maxData); - } - }else{ - if (typeof opts.yAxis.min === 'number') { - minData = Math.min(opts.yAxis.min, minData); - } - if (typeof opts.yAxis.max === 'number') { - maxData = Math.max(opts.yAxis.max, maxData); - } - } - - - if (minData === maxData) { - var rangeSpan = maxData || 10; - maxData += rangeSpan; - } - - var dataRange = getDataRange(minData, maxData); - var minRange = dataRange.minRange; - var maxRange = dataRange.maxRange; - - var range = []; - var eachRange = (maxRange - minRange) / opts.yAxis.splitNumber; - - for (var i = 0; i <= opts.yAxis.splitNumber; i++) { - range.push(minRange + eachRange * i); - } - return range.reverse(); -} - -function calYAxisData(series, opts, config) { - //堆叠图重算Y轴 - var columnstyle = assign({}, { - type: "" - }, opts.extra.column); - //如果是多Y轴,重新计算 - var YLength = opts.yAxis.data.length; - var newSeries=new Array(YLength); - if(YLength>0){ - for(let i=0;i= 2) { - nowAngle = nowAngle % 2; - } - nowNumber += splitNumber; - } - -} - -function drawRadarLabel(angleList, radius, centerPosition, opts, config, context) { - var radarOption = opts.extra.radar || {}; - radius += config.radarLabelTextMargin; - - angleList.forEach(function(angle, index) { - var pos = { - x: radius * Math.cos(angle), - y: radius * Math.sin(angle) - }; - var posRelativeCanvas = convertCoordinateOrigin(pos.x, pos.y, centerPosition); - var startX = posRelativeCanvas.x; - var startY = posRelativeCanvas.y; - if (util.approximatelyEqual(pos.x, 0)) { - startX -= measureText(opts.categories[index] || '') / 2; - } else if (pos.x < 0) { - startX -= measureText(opts.categories[index] || ''); - } - context.beginPath(); - context.setFontSize(config.fontSize); - context.setFillStyle(radarOption.labelColor || '#666666'); - context.fillText(opts.categories[index] || '', startX, startY + config.fontSize / 2); - context.closePath(); - context.stroke(); - }); - -} - -function drawPieText(series, opts, config, context, radius, center) { - var lineRadius = config.pieChartLinePadding; - var textObjectCollection = []; - var lastTextObject = null; - - var seriesConvert = series.map(function(item) { - var text = item.format ? item.format(+item._proportion_.toFixed(2)) : util.toFixed(item._proportion_.toFixed(4) * 100) +'%'; - if(item._rose_proportion_) item._proportion_=item._rose_proportion_; - var arc = 2 * Math.PI - (item._start_ + 2 * Math.PI * item._proportion_ / 2); - var color = item.color; - var radius = item._radius_; - return { - arc: arc, - text: text, - color: color, - radius: radius, - textColor: item.textColor, - textSize: item.textSize, - }; - }); - for (let i = 0; i < seriesConvert.length; i++) { - let item = seriesConvert[i]; - // line end - let orginX1 = Math.cos(item.arc) * (item.radius + lineRadius); - let orginY1 = Math.sin(item.arc) * (item.radius + lineRadius); - - // line start - let orginX2 = Math.cos(item.arc) * item.radius; - let orginY2 = Math.sin(item.arc) * item.radius; - - // text start - let orginX3 = orginX1 >= 0 ? orginX1 + config.pieChartTextPadding : orginX1 - config.pieChartTextPadding; - let orginY3 = orginY1; - let textWidth = measureText(item.text,item.textSize||config.fontSize); - let startY = orginY3; - - if (lastTextObject && util.isSameXCoordinateArea(lastTextObject.start, { - x: orginX3 - })) { - if (orginX3 > 0) { - startY = Math.min(orginY3, lastTextObject.start.y); - } else if (orginX1 < 0) { - startY = Math.max(orginY3, lastTextObject.start.y); - } else { - if (orginY3 > 0) { - startY = Math.max(orginY3, lastTextObject.start.y); - } else { - startY = Math.min(orginY3, lastTextObject.start.y); - } - } - } - if (orginX3 < 0) { - orginX3 -= textWidth; - } - - let textObject = { - lineStart: { - x: orginX2, - y: orginY2 - }, - lineEnd: { - x: orginX1, - y: orginY1 - }, - start: { - x: orginX3, - y: startY - }, - width: textWidth, - height: config.fontSize, - text: item.text, - color: item.color, - textColor: item.textColor, - textSize: item.textSize - }; - lastTextObject = avoidCollision(textObject, lastTextObject); - textObjectCollection.push(lastTextObject); - } - - for (let i = 0; i < textObjectCollection.length; i++) { - let item = textObjectCollection[i]; - let lineStartPoistion = convertCoordinateOrigin(item.lineStart.x, item.lineStart.y, center); - let lineEndPoistion = convertCoordinateOrigin(item.lineEnd.x, item.lineEnd.y, center); - let textPosition = convertCoordinateOrigin(item.start.x, item.start.y, center); - context.setLineWidth(1 * opts.pixelRatio); - context.setFontSize(config.fontSize); - context.beginPath(); - context.setStrokeStyle(item.color); - context.setFillStyle(item.color); - context.moveTo(lineStartPoistion.x, lineStartPoistion.y); - let curveStartX = item.start.x < 0 ? textPosition.x + item.width : textPosition.x; - let textStartX = item.start.x < 0 ? textPosition.x - 5 : textPosition.x + 5; - context.quadraticCurveTo(lineEndPoistion.x, lineEndPoistion.y, curveStartX, textPosition.y); - context.moveTo(lineStartPoistion.x, lineStartPoistion.y); - context.stroke(); - context.closePath(); - context.beginPath(); - context.moveTo(textPosition.x + item.width, textPosition.y); - context.arc(curveStartX, textPosition.y, 2, 0, 2 * Math.PI); - context.closePath(); - context.fill(); - context.beginPath(); - context.setFontSize(item.textSize || config.fontSize); - context.setFillStyle(item.textColor || '#666666'); - context.fillText(item.text, textStartX, textPosition.y + 3); - context.closePath(); - context.stroke(); - context.closePath(); - } -} - -function drawToolTipSplitLine(offsetX, opts, config, context) { - var toolTipOption = opts.extra.tooltip || {}; - toolTipOption.gridType = toolTipOption.gridType == undefined ? 'solid' : toolTipOption.gridType; - toolTipOption.dashLength = toolTipOption.dashLength == undefined ? 4 : toolTipOption.dashLength; - var startY = opts.area[0]; - var endY = opts.height - opts.area[2]; - - if (toolTipOption.gridType == 'dash') { - context.setLineDash([toolTipOption.dashLength, toolTipOption.dashLength]); - } - context.setStrokeStyle(toolTipOption.gridColor || '#cccccc'); - context.setLineWidth(1 * opts.pixelRatio); - context.beginPath(); - context.moveTo(offsetX, startY); - context.lineTo(offsetX, endY); - context.stroke(); - context.setLineDash([]); - - if (toolTipOption.xAxisLabel) { - let labelText = opts.categories[opts.tooltip.index]; - context.setFontSize(config.fontSize); - let textWidth = measureText(labelText, config.fontSize); - - let textX = offsetX - 0.5 * textWidth; - let textY = endY; - context.beginPath(); - context.setFillStyle(hexToRgb(toolTipOption.labelBgColor || config.toolTipBackground, toolTipOption.labelBgOpacity || config.toolTipOpacity)); - context.setStrokeStyle(toolTipOption.labelBgColor || config.toolTipBackground); - context.setLineWidth(1 * opts.pixelRatio); - context.rect(textX - config.toolTipPadding, textY, textWidth + 2 * config.toolTipPadding, config.fontSize + 2 * config.toolTipPadding); - context.closePath(); - context.stroke(); - context.fill(); - - context.beginPath(); - context.setFontSize(config.fontSize); - context.setFillStyle(toolTipOption.labelFontColor || config.fontColor); - context.fillText(String(labelText), textX, textY + config.toolTipPadding + config.fontSize); - context.closePath(); - context.stroke(); - } -} - -function drawMarkLine(opts, config, context) { - let markLineOption = assign({}, { - type: 'solid', - dashLength: 4, - data: [] - }, opts.extra.markLine); - let startX = opts.area[3]; - let endX = opts.width - opts.area[1]; - let points = calMarkLineData(markLineOption.data, opts); - - for (let i = 0; i < points.length; i++) { - let item = assign({}, { - lineColor: '#DE4A42', - showLabel: false, - labelFontColor: '#666666', - labelBgColor: '#DFE8FF', - labelBgOpacity: 0.8, - yAxisIndex: 0 - }, points[i]); - - if (markLineOption.type == 'dash') { - context.setLineDash([markLineOption.dashLength, markLineOption.dashLength]); - } - context.setStrokeStyle(item.lineColor); - context.setLineWidth(1 * opts.pixelRatio); - context.beginPath(); - context.moveTo(startX, item.y); - context.lineTo(endX, item.y); - context.stroke(); - context.setLineDash([]); - if (item.showLabel) { - let labelText = opts.yAxis.format ? opts.yAxis.format(Number(item.value)) : item.value; - context.setFontSize(config.fontSize); - let textWidth = measureText(labelText, config.fontSize); - let bgStartX = opts.padding[3] + config.yAxisTitleWidth - config.toolTipPadding; - let bgEndX = Math.max(opts.area[3], textWidth + config.toolTipPadding * 2); - let bgWidth = bgEndX - bgStartX; - - let textX = bgStartX + (bgWidth - textWidth) / 2; - let textY = item.y; - context.setFillStyle(hexToRgb(item.labelBgColor, item.labelBgOpacity)); - context.setStrokeStyle(item.labelBgColor); - context.setLineWidth(1 * opts.pixelRatio); - context.beginPath(); - context.rect(bgStartX, textY - 0.5 * config.fontSize - config.toolTipPadding, bgWidth, config.fontSize + 2 * config.toolTipPadding); - context.closePath(); - context.stroke(); - context.fill(); - - context.beginPath(); - context.setFontSize(config.fontSize); - context.setFillStyle(item.labelFontColor); - context.fillText(String(labelText), textX, textY + 0.5 * config.fontSize); - context.stroke(); - } - } -} - -function drawToolTipHorizentalLine(opts, config, context, eachSpacing, xAxisPoints) { - var toolTipOption = assign({}, { - gridType: 'solid', - dashLength: 4 - }, opts.extra.tooltip); - - var startX = opts.area[3]; - var endX = opts.width - opts.area[1]; - - if (toolTipOption.gridType == 'dash') { - context.setLineDash([toolTipOption.dashLength, toolTipOption.dashLength]); - } - context.setStrokeStyle(toolTipOption.gridColor || '#cccccc'); - context.setLineWidth(1 * opts.pixelRatio); - context.beginPath(); - context.moveTo(startX, opts.tooltip.offset.y); - context.lineTo(endX, opts.tooltip.offset.y); - context.stroke(); - context.setLineDash([]); - - if (toolTipOption.yAxisLabel) { - let labelText = calTooltipYAxisData(opts.tooltip.offset.y, opts.series, opts, config, eachSpacing); - let widthArr = opts.chartData.yAxisData.yAxisWidth; - let tStartLeft=opts.area[3]; - let tStartRight=opts.width-opts.area[1]; - for(let i=0;i opts.width) { - isOverRightBorder = true; - } - if (toolTipHeight + offset.y > opts.height) { - offset.y = opts.height - toolTipHeight; - } - // draw background rect - context.beginPath(); - context.setFillStyle(hexToRgb(toolTipOption.bgColor || config.toolTipBackground, toolTipOption.bgOpacity || config.toolTipOpacity)); - if (isOverRightBorder) { - context.moveTo(offset.x, offset.y + 10 * opts.pixelRatio); - context.lineTo(offset.x - arrowWidth, offset.y + 10 * opts.pixelRatio - 5 * opts.pixelRatio); - context.lineTo(offset.x - arrowWidth, offset.y); - context.lineTo(offset.x - arrowWidth - Math.round(toolTipWidth), offset.y); - context.lineTo(offset.x - arrowWidth - Math.round(toolTipWidth), offset.y + toolTipHeight); - context.lineTo(offset.x - arrowWidth, offset.y + toolTipHeight); - context.lineTo(offset.x - arrowWidth, offset.y + 10 * opts.pixelRatio + 5 * opts.pixelRatio); - context.lineTo(offset.x, offset.y + 10 * opts.pixelRatio); - } else { - context.moveTo(offset.x, offset.y + 10 * opts.pixelRatio); - context.lineTo(offset.x + arrowWidth, offset.y + 10 * opts.pixelRatio - 5 * opts.pixelRatio); - context.lineTo(offset.x + arrowWidth, offset.y); - context.lineTo(offset.x + arrowWidth + Math.round(toolTipWidth), offset.y); - context.lineTo(offset.x + arrowWidth + Math.round(toolTipWidth), offset.y + toolTipHeight); - context.lineTo(offset.x + arrowWidth, offset.y + toolTipHeight); - context.lineTo(offset.x + arrowWidth, offset.y + 10 * opts.pixelRatio + 5 * opts.pixelRatio); - context.lineTo(offset.x, offset.y + 10 * opts.pixelRatio); - } - - context.closePath(); - context.fill(); - - // draw legend - textList.forEach(function(item, index) { - if (item.color !== null) { - context.beginPath(); - context.setFillStyle(item.color); - var startX = offset.x + arrowWidth + 2 * config.toolTipPadding; - var startY = offset.y + (config.toolTipLineHeight - config.fontSize) / 2 + config.toolTipLineHeight * index + - config.toolTipPadding + 1; - if (isOverRightBorder) { - startX = offset.x - toolTipWidth - arrowWidth + 2 * config.toolTipPadding; - } - context.fillRect(startX, startY, legendWidth, config.fontSize); - context.closePath(); - } - }); - - // draw text list - - textList.forEach(function(item, index) { - var startX = offset.x + arrowWidth + 2 * config.toolTipPadding + legendWidth + legendMarginRight; - if (isOverRightBorder) { - startX = offset.x - toolTipWidth - arrowWidth + 2 * config.toolTipPadding + +legendWidth + legendMarginRight; - } - var startY = offset.y + (config.toolTipLineHeight - config.fontSize) / 2 + config.toolTipLineHeight * index + - config.toolTipPadding; - context.beginPath(); - context.setFontSize(config.fontSize); - context.setFillStyle(toolTipOption.fontColor); - context.fillText(item.text, startX, startY + config.fontSize); - context.closePath(); - context.stroke(); - }); -} - -function drawYAxisTitle(title, opts, config, context) { - var startX = config.xAxisHeight + (opts.height - config.xAxisHeight - measureText(title)) / 2; - context.save(); - context.beginPath(); - context.setFontSize(config.fontSize); - context.setFillStyle(opts.yAxis.titleFontColor || '#333333'); - context.translate(0, opts.height); - context.rotate(-90 * Math.PI / 180); - context.fillText(title, startX, opts.padding[3] + 0.5 * config.fontSize); - context.closePath(); - context.stroke(); - context.restore(); -} - -function drawColumnDataPoints(series, opts, config, context) { - let process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1; - let xAxisData = opts.chartData.xAxisData, - xAxisPoints = xAxisData.xAxisPoints, - eachSpacing = xAxisData.eachSpacing; - let columnOption = assign({}, { - type: 'group', - width: eachSpacing / 2, - meter: { - border: 4, - fillColor: '#FFFFFF' - } - }, opts.extra.column); - - let calPoints = []; - context.save(); - - let leftNum=-2; - let rightNum=xAxisPoints.length+2; - - if (opts._scrollDistance_ && opts._scrollDistance_ !== 0 && opts.enableScroll === true) { - context.translate(opts._scrollDistance_, 0); - leftNum=Math.floor(-opts._scrollDistance_/eachSpacing)-2; - rightNum=leftNum+opts.xAxis.itemCount+4; - } - if (opts.tooltip && opts.tooltip.textList && opts.tooltip.textList.length && process === 1) { - drawToolTipSplitArea(opts.tooltip.offset.x, opts, config, context, eachSpacing); - } - - series.forEach(function(eachSeries, seriesIndex) { - let ranges,minRange,maxRange; - ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]); - minRange = ranges.pop(); - maxRange = ranges.shift(); - - var data = eachSeries.data; - switch (columnOption.type) { - case 'group': - var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process); - var tooltipPoints = getStackDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, seriesIndex, series, process); - calPoints.push(tooltipPoints); - points = fixColumeData(points, eachSpacing, series.length, seriesIndex, config, opts); - for(let i=0;ileftNum && ileftNum && i 0) { - height -= height0; - } - context.moveTo(startX, item.y); - context.fillRect(startX, item.y, item.width - 2, height); - context.closePath(); - context.fill(); - } - }; - break; - case 'meter': - // 绘制温度计数据图 - var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process); - calPoints.push(points); - points = fixColumeMeterData(points, eachSpacing, series.length, seriesIndex, config, opts, columnOption.meter.border); - if (seriesIndex == 0) { - for(let i=0;ileftNum && i 0) { - context.beginPath(); - context.setStrokeStyle(eachSeries.color); - context.setLineWidth(columnOption.meter.border * opts.pixelRatio); - context.moveTo(startX + columnOption.meter.border * 0.5, item.y + height); - context.lineTo(startX + columnOption.meter.border * 0.5, item.y + columnOption.meter.border * 0.5); - context.lineTo(startX + item.width - columnOption.meter.border * 0.5, item.y + columnOption.meter.border * 0.5); - context.lineTo(startX + item.width - columnOption.meter.border * 0.5, item.y + height); - context.stroke(); - } - } - }; - } else { - for(let i=0;ileftNum && i 5 && arguments[5] !== undefined ? arguments[5] : 1; - var candleOption = assign({}, { - color: {}, - average: {} - }, opts.extra.candle); - candleOption.color = assign({}, { - upLine: '#f04864', - upFill: '#f04864', - downLine: '#2fc25b', - downFill: '#2fc25b' - }, candleOption.color); - candleOption.average = assign({}, { - show: false, - name: [], - day: [], - color: config.colors - }, candleOption.average); - opts.extra.candle = candleOption; - - let xAxisData = opts.chartData.xAxisData, - xAxisPoints = xAxisData.xAxisPoints, - eachSpacing = xAxisData.eachSpacing; - - let calPoints = []; - - context.save(); - - let leftNum=-2; - let rightNum=xAxisPoints.length+2; - let leftSpace=0; - let rightSpace=opts.width+eachSpacing; - - if (opts._scrollDistance_ && opts._scrollDistance_ !== 0 && opts.enableScroll === true) { - context.translate(opts._scrollDistance_, 0); - leftNum=Math.floor(-opts._scrollDistance_/eachSpacing)-2; - rightNum=leftNum+opts.xAxis.itemCount+4; - leftSpace=-opts._scrollDistance_-eachSpacing+opts.area[3]; - rightSpace=leftSpace+(opts.xAxis.itemCount+4)*eachSpacing; - } - - //画均线 - if (candleOption.average.show) { - seriesMA.forEach(function(eachSeries, seriesIndex) { - let ranges,minRange,maxRange; - ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]); - minRange = ranges.pop(); - maxRange = ranges.shift(); - - var data = eachSeries.data; - var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process); - var splitPointList = splitPoints(points); - - for(let i=0;i leftSpace){ - context.moveTo(item.x, item.y); - startPoint=1; - } - if (j > 0 && item.x > leftSpace && item.x < rightSpace) { - var ctrlPoint = createCurveControlPoints(points, j - 1); - context.bezierCurveTo(ctrlPoint.ctrA.x, ctrlPoint.ctrA.y, ctrlPoint.ctrB.x, ctrlPoint.ctrB.y,item.x, item.y); - } - } - context.moveTo(points[0].x, points[0].y); - } - context.closePath(); - context.stroke(); - } - }); - } - //画K线 - series.forEach(function(eachSeries, seriesIndex) { - let ranges,minRange,maxRange; - ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]); - minRange = ranges.pop(); - maxRange = ranges.shift(); - var data = eachSeries.data; - var points = getCandleDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process); - calPoints.push(points); - var splitPointList = splitPoints(points); - - for(let i=0;ileftNum && i 0) { - context.setStrokeStyle(candleOption.color.upLine); - context.setFillStyle(candleOption.color.upFill); - context.setLineWidth(1 * opts.pixelRatio); - context.moveTo(item[3].x, item[3].y); //顶点 - context.lineTo(item[1].x, item[1].y); //收盘中间点 - context.lineTo(item[1].x - eachSpacing / 4, item[1].y); //收盘左侧点 - context.lineTo(item[0].x - eachSpacing / 4, item[0].y); //开盘左侧点 - context.lineTo(item[0].x, item[0].y); //开盘中间点 - context.lineTo(item[2].x, item[2].y); //底点 - context.lineTo(item[0].x, item[0].y); //开盘中间点 - context.lineTo(item[0].x + eachSpacing / 4, item[0].y); //开盘右侧点 - context.lineTo(item[1].x + eachSpacing / 4, item[1].y); //收盘右侧点 - context.lineTo(item[1].x, item[1].y); //收盘中间点 - context.moveTo(item[3].x, item[3].y); //顶点 - } else { - context.setStrokeStyle(candleOption.color.downLine); - context.setFillStyle(candleOption.color.downFill); - context.setLineWidth(1 * opts.pixelRatio); - context.moveTo(item[3].x, item[3].y); //顶点 - context.lineTo(item[0].x, item[0].y); //开盘中间点 - context.lineTo(item[0].x - eachSpacing / 4, item[0].y); //开盘左侧点 - context.lineTo(item[1].x - eachSpacing / 4, item[1].y); //收盘左侧点 - context.lineTo(item[1].x, item[1].y); //收盘中间点 - context.lineTo(item[2].x, item[2].y); //底点 - context.lineTo(item[1].x, item[1].y); //收盘中间点 - context.lineTo(item[1].x + eachSpacing / 4, item[1].y); //收盘右侧点 - context.lineTo(item[0].x + eachSpacing / 4, item[0].y); //开盘右侧点 - context.lineTo(item[0].x, item[0].y); //开盘中间点 - context.moveTo(item[3].x, item[3].y); //顶点 - } - context.closePath(); - context.fill(); - context.stroke(); - } - } - }); - - context.restore(); - - return { - xAxisPoints: xAxisPoints, - calPoints: calPoints, - eachSpacing: eachSpacing - }; -} - -function drawAreaDataPoints(series, opts, config, context) { - var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1; - var areaOption = assign({},{ - type: 'straight', - opacity: 0.2, - addLine: false, - width: 2, - gradient:false - },opts.extra.area); - - let xAxisData = opts.chartData.xAxisData, - xAxisPoints = xAxisData.xAxisPoints, - eachSpacing = xAxisData.eachSpacing; - - let endY = opts.height - opts.area[2]; - let calPoints = []; - - context.save(); - let leftSpace=0; - let rightSpace=opts.width+eachSpacing; - if (opts._scrollDistance_ && opts._scrollDistance_ !== 0 && opts.enableScroll === true) { - context.translate(opts._scrollDistance_, 0); - leftSpace=-opts._scrollDistance_-eachSpacing+opts.area[3]; - rightSpace=leftSpace+(opts.xAxis.itemCount+4)*eachSpacing; - } - - series.forEach(function(eachSeries, seriesIndex) { - let ranges,minRange,maxRange; - ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]); - minRange = ranges.pop(); - maxRange = ranges.shift(); - let data = eachSeries.data; - let points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process); - calPoints.push(points); - - let splitPointList = splitPoints(points); - for (let i = 0; i < splitPointList.length; i++) { - let points = splitPointList[i]; - // 绘制区域数 - context.beginPath(); - context.setStrokeStyle(hexToRgb(eachSeries.color, areaOption.opacity)); - if(areaOption.gradient){ - let gradient = context.createLinearGradient(0, opts.area[0], 0, opts.height-opts.area[2]); - gradient.addColorStop('0', hexToRgb(eachSeries.color, areaOption.opacity)); - gradient.addColorStop('1.0',hexToRgb("#FFFFFF", 0.1)); - context.setFillStyle(gradient); - }else{ - context.setFillStyle(hexToRgb(eachSeries.color, areaOption.opacity)); - } - context.setLineWidth(areaOption.width * opts.pixelRatio); - if (points.length > 1) { - let firstPoint = points[0]; - let lastPoint = points[points.length - 1]; - context.moveTo(firstPoint.x, firstPoint.y); - let startPoint=0; - if (areaOption.type === 'curve') { - for(let j=0;j leftSpace){ - context.moveTo(item.x, item.y); - startPoint=1; - } - if (j > 0 && item.x > leftSpace && item.x < rightSpace) { - let ctrlPoint = createCurveControlPoints(points, j - 1); - context.bezierCurveTo(ctrlPoint.ctrA.x, ctrlPoint.ctrA.y, ctrlPoint.ctrB.x, ctrlPoint.ctrB.y,item.x, item.y); - } - }; - } else { - for(let j=0;j leftSpace){ - context.moveTo(item.x, item.y); - startPoint=1; - } - if (j > 0 && item.x > leftSpace && item.x < rightSpace) { - context.lineTo(item.x, item.y); - } - }; - } - - context.lineTo(lastPoint.x, endY); - context.lineTo(firstPoint.x, endY); - context.lineTo(firstPoint.x, firstPoint.y); - } else { - let item = points[0]; - context.moveTo(item.x - eachSpacing / 2, item.y); - context.lineTo(item.x + eachSpacing / 2, item.y); - context.lineTo(item.x + eachSpacing / 2, endY); - context.lineTo(item.x - eachSpacing / 2, endY); - context.moveTo(item.x - eachSpacing / 2, item.y); - } - context.closePath(); - context.fill(); - - //画连线 - if (areaOption.addLine) { - if (eachSeries.lineType == 'dash') { - let dashLength = eachSeries.dashLength?eachSeries.dashLength:8; - dashLength *= opts.pixelRatio; - context.setLineDash([dashLength, dashLength]); - } - context.beginPath(); - context.setStrokeStyle(eachSeries.color); - context.setLineWidth(areaOption.width * opts.pixelRatio); - if (points.length === 1) { - context.moveTo(points[0].x, points[0].y); - context.arc(points[0].x, points[0].y, 1, 0, 2 * Math.PI); - } else { - context.moveTo(points[0].x, points[0].y); - let startPoint=0; - if (areaOption.type === 'curve') { - for(let j=0;j leftSpace){ - context.moveTo(item.x, item.y); - startPoint=1; - } - if (j > 0 && item.x > leftSpace && item.x < rightSpace) { - let ctrlPoint = createCurveControlPoints(points, j - 1); - context.bezierCurveTo(ctrlPoint.ctrA.x, ctrlPoint.ctrA.y, ctrlPoint.ctrB.x, ctrlPoint.ctrB.y,item.x,item.y); - } - }; - } else { - for(let j=0;j leftSpace){ - context.moveTo(item.x, item.y); - startPoint=1; - } - if (j > 0 && item.x > leftSpace && item.x < rightSpace) { - context.lineTo(item.x, item.y); - } - }; - } - context.moveTo(points[0].x, points[0].y); - } - context.stroke(); - context.setLineDash([]); - } - } - - //画点 - if (opts.dataPointShape !== false) { - drawPointShape(points, eachSeries.color, eachSeries.pointShape, context, opts); - } - - }); - - if (opts.dataLabel !== false && process === 1) { - series.forEach(function(eachSeries, seriesIndex) { - let ranges,minRange,maxRange; - ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]); - minRange = ranges.pop(); - maxRange = ranges.shift(); - var data = eachSeries.data; - var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process); - drawPointText(points, eachSeries, config, context); - }); - } - - context.restore(); - - return { - xAxisPoints: xAxisPoints, - calPoints: calPoints, - eachSpacing: eachSpacing - }; -} - -function drawLineDataPoints(series, opts, config, context) { - var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1; - var lineOption = assign({},{ - type: 'straight', - width: 2 - },opts.extra.line); - lineOption.width *=opts.pixelRatio; - - let xAxisData = opts.chartData.xAxisData, - xAxisPoints = xAxisData.xAxisPoints, - eachSpacing = xAxisData.eachSpacing; - var calPoints = []; - - context.save(); - let leftSpace=0; - let rightSpace=opts.width+eachSpacing; - if (opts._scrollDistance_ && opts._scrollDistance_ !== 0 && opts.enableScroll === true) { - context.translate(opts._scrollDistance_, 0); - leftSpace=-opts._scrollDistance_-eachSpacing+opts.area[3]; - rightSpace=leftSpace+(opts.xAxis.itemCount+4)*eachSpacing; - } - - series.forEach(function(eachSeries, seriesIndex) { - let ranges,minRange,maxRange; - ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]); - minRange = ranges.pop(); - maxRange = ranges.shift(); - var data = eachSeries.data; - var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process); - calPoints.push(points); - var splitPointList = splitPoints(points); - - if (eachSeries.lineType == 'dash') { - let dashLength = eachSeries.dashLength?eachSeries.dashLength:8; - dashLength *= opts.pixelRatio; - context.setLineDash([dashLength, dashLength]); - } - context.beginPath(); - context.setStrokeStyle(eachSeries.color); - context.setLineWidth(lineOption.width); - - splitPointList.forEach(function(points, index) { - - if (points.length === 1) { - context.moveTo(points[0].x, points[0].y); - context.arc(points[0].x, points[0].y, 1, 0, 2 * Math.PI); - } else { - context.moveTo(points[0].x, points[0].y); - let startPoint=0; - if (lineOption.type === 'curve') { - for(let j=0;j leftSpace){ - context.moveTo(item.x, item.y); - startPoint=1; - } - if (j > 0 && item.x > leftSpace && item.x < rightSpace) { - var ctrlPoint = createCurveControlPoints(points, j - 1); - context.bezierCurveTo(ctrlPoint.ctrA.x, ctrlPoint.ctrA.y, ctrlPoint.ctrB.x, ctrlPoint.ctrB.y,item.x, item.y); - } - }; - } else { - for(let j=0;j leftSpace){ - context.moveTo(item.x, item.y); - startPoint=1; - } - if (j > 0 && item.x > leftSpace && item.x < rightSpace) { - context.lineTo(item.x, item.y); - } - }; - } - context.moveTo(points[0].x, points[0].y); - } - - }); - - context.stroke(); - context.setLineDash([]); - - if (opts.dataPointShape !== false) { - drawPointShape(points, eachSeries.color, eachSeries.pointShape, context, opts); - } - }); - - if (opts.dataLabel !== false && process === 1) { - series.forEach(function(eachSeries, seriesIndex) { - let ranges,minRange,maxRange; - ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]); - minRange = ranges.pop(); - maxRange = ranges.shift(); - var data = eachSeries.data; - var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process); - drawPointText(points, eachSeries, config, context); - }); - } - - context.restore(); - - return { - xAxisPoints: xAxisPoints, - calPoints: calPoints, - eachSpacing: eachSpacing - }; -} - -function drawMixDataPoints(series, opts, config, context) { - let process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1; - - let xAxisData = opts.chartData.xAxisData, - xAxisPoints = xAxisData.xAxisPoints, - eachSpacing = xAxisData.eachSpacing; - - let endY = opts.height - opts.area[2]; - let calPoints = []; - - var columnIndex = 0; - var columnLength = 0; - series.forEach(function(eachSeries, seriesIndex) { - if (eachSeries.type == 'column') { - columnLength += 1; - } - }); - context.save(); - let leftNum=-2; - let rightNum=xAxisPoints.length+2; - let leftSpace=0; - let rightSpace=opts.width+eachSpacing; - if (opts._scrollDistance_ && opts._scrollDistance_ !== 0 && opts.enableScroll === true) { - context.translate(opts._scrollDistance_, 0); - leftNum=Math.floor(-opts._scrollDistance_/eachSpacing)-2; - rightNum=leftNum+opts.xAxis.itemCount+4; - leftSpace=-opts._scrollDistance_-eachSpacing+opts.area[3]; - rightSpace=leftSpace+(opts.xAxis.itemCount+4)*eachSpacing; - } - - series.forEach(function(eachSeries, seriesIndex) { - let ranges,minRange,maxRange; - - ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]); - minRange = ranges.pop(); - maxRange = ranges.shift(); - - var data = eachSeries.data; - var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process); - calPoints.push(points); - - // 绘制柱状数据图 - if (eachSeries.type == 'column') { - points = fixColumeData(points, eachSpacing, columnLength, columnIndex, config, opts); - for(let i=0;ileftNum && i 1) { - var firstPoint = points[0]; - let lastPoint = points[points.length - 1]; - context.moveTo(firstPoint.x, firstPoint.y); - let startPoint=0; - if (eachSeries.style === 'curve') { - for(let j=0;j leftSpace){ - context.moveTo(item.x, item.y); - startPoint=1; - } - if (j > 0 && item.x > leftSpace && item.x < rightSpace) { - var ctrlPoint = createCurveControlPoints(points, j - 1); - context.bezierCurveTo(ctrlPoint.ctrA.x, ctrlPoint.ctrA.y, ctrlPoint.ctrB.x, ctrlPoint.ctrB.y, item.x, item.y); - } - }; - } else { - for(let j=0;j leftSpace){ - context.moveTo(item.x, item.y); - startPoint=1; - } - if (j > 0 && item.x > leftSpace && item.x < rightSpace) { - context.lineTo(item.x, item.y); - } - }; - } - context.lineTo(lastPoint.x, endY); - context.lineTo(firstPoint.x, endY); - context.lineTo(firstPoint.x, firstPoint.y); - } else { - let item = points[0]; - context.moveTo(item.x - eachSpacing / 2, item.y); - context.lineTo(item.x + eachSpacing / 2, item.y); - context.lineTo(item.x + eachSpacing / 2, endY); - context.lineTo(item.x - eachSpacing / 2, endY); - context.moveTo(item.x - eachSpacing / 2, item.y); - } - context.closePath(); - context.fill(); - } - } - - // 绘制折线数据图 - if (eachSeries.type == 'line') { - var splitPointList = splitPoints(points); - splitPointList.forEach(function(points, index) { - if (eachSeries.lineType == 'dash') { - let dashLength = eachSeries.dashLength?eachSeries.dashLength:8; - dashLength *= opts.pixelRatio; - context.setLineDash([dashLength, dashLength]); - } - context.beginPath(); - context.setStrokeStyle(eachSeries.color); - context.setLineWidth(2 * opts.pixelRatio); - if (points.length === 1) { - context.moveTo(points[0].x, points[0].y); - context.arc(points[0].x, points[0].y, 1, 0, 2 * Math.PI); - } else { - context.moveTo(points[0].x, points[0].y); - let startPoint=0; - if (eachSeries.style == 'curve') { - for(let j=0;j leftSpace){ - context.moveTo(item.x, item.y); - startPoint=1; - } - if (j > 0 && item.x > leftSpace && item.x < rightSpace) { - var ctrlPoint = createCurveControlPoints(points, j - 1); - context.bezierCurveTo(ctrlPoint.ctrA.x, ctrlPoint.ctrA.y, ctrlPoint.ctrB.x, ctrlPoint.ctrB.y,item.x,item.y); - } - } - } else { - for(let j=0;j leftSpace){ - context.moveTo(item.x, item.y); - startPoint=1; - } - if (j > 0 && item.x > leftSpace && item.x < rightSpace) { - context.lineTo(item.x, item.y); - } - } - } - context.moveTo(points[0].x, points[0].y); - } - context.stroke(); - context.setLineDash([]); - }); - } - - // 绘制点数据图 - if (eachSeries.type == 'point') { - eachSeries.addPoint = true; - } - - if (eachSeries.addPoint == true && eachSeries.type !== 'column' ) { - drawPointShape(points, eachSeries.color, eachSeries.pointShape, context, opts); - } - }); - if (opts.dataLabel !== false && process === 1) { - var columnIndex = 0; - series.forEach(function(eachSeries, seriesIndex) { - let ranges,minRange,maxRange; - - ranges = [].concat(opts.chartData.yAxisData.ranges[eachSeries.index]); - minRange = ranges.pop(); - maxRange = ranges.shift(); - - var data = eachSeries.data; - var points = getDataPoints(data, minRange, maxRange, xAxisPoints, eachSpacing, opts, config, process); - if (eachSeries.type !== 'column') { - drawPointText(points, eachSeries, config, context); - } else { - points = fixColumeData(points, eachSpacing, columnLength, columnIndex, config, opts); - drawPointText(points, eachSeries, config, context); - columnIndex += 1; - } - - }); - } - - context.restore(); - - return { - xAxisPoints: xAxisPoints, - calPoints: calPoints, - eachSpacing: eachSpacing, - } -} - -function drawToolTipBridge(opts, config, context, process, eachSpacing, xAxisPoints) { - var toolTipOption = opts.extra.tooltip || {}; - if (toolTipOption.horizentalLine && opts.tooltip && process === 1 && (opts.type == 'line' || opts.type == 'area' || opts.type == 'column' || opts.type == 'candle' || opts.type == 'mix')) { - drawToolTipHorizentalLine(opts, config, context, eachSpacing, xAxisPoints) - } - context.save(); - if (opts._scrollDistance_ && opts._scrollDistance_ !== 0 && opts.enableScroll === true) { - context.translate(opts._scrollDistance_, 0); - } - if (opts.tooltip && opts.tooltip.textList && opts.tooltip.textList.length && process === 1) { - drawToolTip(opts.tooltip.textList, opts.tooltip.offset, opts, config, context, eachSpacing, xAxisPoints); - } - context.restore(); - -} - -function drawXAxis(categories, opts, config, context) { - - let xAxisData = opts.chartData.xAxisData, - xAxisPoints = xAxisData.xAxisPoints, - startX = xAxisData.startX, - endX = xAxisData.endX, - eachSpacing = xAxisData.eachSpacing; - var boundaryGap='center'; - if (opts.type == 'line'||opts.type == 'area'){ - boundaryGap=opts.xAxis.boundaryGap; - } - var startY = opts.height - opts.area[2]; - var endY = opts.area[0]; - - //绘制滚动条 - if (opts.enableScroll && opts.xAxis.scrollShow) { - var scrollY = opts.height - opts.area[2] + config.xAxisHeight; - var scrollScreenWidth = endX - startX; - var scrollTotalWidth = eachSpacing * (xAxisPoints.length - 1); - var scrollWidth = scrollScreenWidth * scrollScreenWidth / scrollTotalWidth; - var scrollLeft = 0; - if (opts._scrollDistance_) { - scrollLeft = -opts._scrollDistance_ * (scrollScreenWidth) / scrollTotalWidth; - } - context.beginPath(); - context.setLineCap('round'); - context.setLineWidth(6 * opts.pixelRatio); - context.setStrokeStyle(opts.xAxis.scrollBackgroundColor || "#EFEBEF"); - context.moveTo(startX, scrollY); - context.lineTo(endX, scrollY); - context.stroke(); - context.closePath(); - context.beginPath(); - context.setLineCap('round'); - context.setLineWidth(6 * opts.pixelRatio); - context.setStrokeStyle(opts.xAxis.scrollColor || "#A6A6A6"); - context.moveTo(startX + scrollLeft, scrollY); - context.lineTo(startX + scrollLeft + scrollWidth, scrollY); - context.stroke(); - context.closePath(); - context.setLineCap('butt'); - } - - context.save(); - - if (opts._scrollDistance_ && opts._scrollDistance_ !== 0) { - context.translate(opts._scrollDistance_, 0); - } - - //绘制X轴刻度线 - if (opts.xAxis.calibration === true) { - context.setStrokeStyle(opts.xAxis.gridColor || "#cccccc"); - context.setLineCap('butt'); - context.setLineWidth(1 * opts.pixelRatio); - xAxisPoints.forEach(function(item, index) { - if (index > 0) { - context.beginPath(); - context.moveTo(item - eachSpacing / 2, startY); - context.lineTo(item - eachSpacing / 2, startY + 3 * opts.pixelRatio); - context.closePath(); - context.stroke(); - } - }); - } - //绘制X轴网格 - if (opts.xAxis.disableGrid !== true) { - context.setStrokeStyle(opts.xAxis.gridColor || "#cccccc"); - context.setLineCap('butt'); - context.setLineWidth(1 * opts.pixelRatio); - if (opts.xAxis.gridType == 'dash') { - context.setLineDash([opts.xAxis.dashLength, opts.xAxis.dashLength]); - } - opts.xAxis.gridEval = opts.xAxis.gridEval || 1; - xAxisPoints.forEach(function(item, index) { - if (index % opts.xAxis.gridEval == 0) { - context.beginPath(); - context.moveTo(item, startY); - context.lineTo(item, endY); - context.stroke(); - } - }); - context.setLineDash([]); - } - - - //绘制X轴文案 - if (opts.xAxis.disabled !== true) { - // 对X轴列表做抽稀处理 - //默认全部显示X轴标签 - let maxXAxisListLength = categories.length; - //如果设置了X轴单屏数量 - if (opts.xAxis.labelCount) { - //如果设置X轴密度 - if (opts.xAxis.itemCount) { - maxXAxisListLength = Math.ceil(categories.length / opts.xAxis.itemCount * opts.xAxis.labelCount); - } else { - maxXAxisListLength = opts.xAxis.labelCount; - } - maxXAxisListLength -= 1; - } - - let ratio = Math.ceil(categories.length / maxXAxisListLength); - - let newCategories = []; - let cgLength = categories.length; - for (let i = 0; i < cgLength; i++) { - if (i % ratio !== 0) { - newCategories.push(""); - } else { - newCategories.push(categories[i]); - } - } - newCategories[cgLength - 1] = categories[cgLength - 1]; - - var xAxisFontSize = opts.xAxis.fontSize || config.fontSize; - if (config._xAxisTextAngle_ === 0) { - newCategories.forEach(function(item, index) { - var offset = - measureText(String(item), xAxisFontSize) / 2; - if(boundaryGap == 'center'){ - offset+=eachSpacing / 2; - } - var scrollHeight=0; - if(opts.xAxis.scrollShow){ - scrollHeight=6*opts.pixelRatio; - } - context.beginPath(); - context.setFontSize(xAxisFontSize); - context.setFillStyle(opts.xAxis.fontColor || '#666666'); - context.fillText(String(item), xAxisPoints[index] + offset, startY + xAxisFontSize + (config.xAxisHeight - scrollHeight - xAxisFontSize) / 2); - context.closePath(); - context.stroke(); - }); - - } else { - newCategories.forEach(function(item, index) { - context.save(); - context.beginPath(); - context.setFontSize(xAxisFontSize); - context.setFillStyle(opts.xAxis.fontColor || '#666666'); - var textWidth = measureText(String(item),xAxisFontSize); - var offset = - textWidth; - if(boundaryGap == 'center'){ - offset+=eachSpacing / 2; - } - var _calRotateTranslate = calRotateTranslate(xAxisPoints[index] + eachSpacing / 2, startY + xAxisFontSize / 2 + 5, opts.height), - transX = _calRotateTranslate.transX, - transY = _calRotateTranslate.transY; - - context.rotate(-1 * config._xAxisTextAngle_); - context.translate(transX, transY); - context.fillText(String(item), xAxisPoints[index] + offset, startY + xAxisFontSize + 5); - context.closePath(); - context.stroke(); - context.restore(); - }); - } - } - context.restore(); - - //绘制X轴轴线 - if(opts.xAxis.axisLine){ - context.beginPath(); - context.setStrokeStyle(opts.xAxis.axisLineColor); - context.setLineWidth(1 * opts.pixelRatio); - context.moveTo(startX,opts.height-opts.area[2]); - context.lineTo(endX,opts.height-opts.area[2]); - context.stroke(); - } -} - -function drawYAxisGrid(categories, opts, config, context) { - if (opts.yAxis.disableGrid === true) { - return; - } - let spacingValid = opts.height - opts.area[0] - opts.area[2]; - let eachSpacing = spacingValid / opts.yAxis.splitNumber; - let startX = opts.area[3]; - let xAxisPoints = opts.chartData.xAxisData.xAxisPoints, - xAxiseachSpacing = opts.chartData.xAxisData.eachSpacing; - let TotalWidth = xAxiseachSpacing * (xAxisPoints.length - 1); - let endX = startX + TotalWidth; - - let points = []; - for (let i = 0; i < opts.yAxis.splitNumber + 1; i++) { - points.push(opts.height - opts.area[2] - eachSpacing * i); - } - - context.save(); - if (opts._scrollDistance_ && opts._scrollDistance_ !== 0) { - context.translate(opts._scrollDistance_, 0); - } - - if (opts.yAxis.gridType == 'dash') { - context.setLineDash([opts.yAxis.dashLength, opts.yAxis.dashLength]); - } - context.setStrokeStyle(opts.yAxis.gridColor); - context.setLineWidth(1 * opts.pixelRatio); - points.forEach(function(item, index) { - context.beginPath(); - context.moveTo(startX, item); - context.lineTo(endX, item); - context.stroke(); - }); - context.setLineDash([]); - - context.restore(); -} - -function drawYAxis(series, opts, config, context) { - if (opts.yAxis.disabled === true) { - return; - } - var spacingValid = opts.height - opts.area[0] - opts.area[2]; - var eachSpacing = spacingValid / opts.yAxis.splitNumber; - var startX = opts.area[3]; - var endX = opts.width - opts.area[1]; - var endY = opts.height - opts.area[2]; - var fillEndY = endY + config.xAxisHeight; - if (opts.xAxis.scrollShow) { - fillEndY -= 3 * opts.pixelRatio; - } - if (opts.xAxis.rotateLabel){ - fillEndY = opts.height - opts.area[2]+3; - } - // set YAxis background - context.beginPath(); - context.setFillStyle(opts.background || '#ffffff'); - if (opts._scrollDistance_ < 0) { - context.fillRect(0, 0, startX, fillEndY); - } - if(opts.enableScroll == true){ - context.fillRect(endX, 0, opts.width, fillEndY); - } - context.closePath(); - context.stroke(); - - var points = []; - for (let i = 0; i <= opts.yAxis.splitNumber; i++) { - points.push(opts.area[0] + eachSpacing * i); - } - - let tStartLeft=opts.area[3]; - let tStartRight=opts.width-opts.area[1]; - - for (let i = 0; i < opts.yAxis.data.length; i++) { - let yData = opts.yAxis.data[i]; - if(yData.disabled !== true){ - let rangesFormat = opts.chartData.yAxisData.rangesFormat[i]; - let yAxisFontSize = yData.fontSize || config.fontSize; - let yAxisWidth = opts.chartData.yAxisData.yAxisWidth[i]; - //画Y轴刻度及文案 - rangesFormat.forEach(function(item, index) { - var pos = points[index] ? points[index] : endY; - context.beginPath(); - context.setFontSize(yAxisFontSize); - context.setLineWidth(1*opts.pixelRatio); - context.setStrokeStyle(yData.axisLineColor||'#cccccc'); - context.setFillStyle(yData.fontColor|| '#666666'); - if(yAxisWidth.position=='left'){ - context.fillText(String(item), tStartLeft - yAxisWidth.width , pos + yAxisFontSize / 2); - //画刻度线 - if(yData.calibration==true){ - context.moveTo(tStartLeft,pos); - context.lineTo(tStartLeft - 3*opts.pixelRatio,pos); - } - }else{ - context.fillText(String(item), tStartRight + 4*opts.pixelRatio, pos + yAxisFontSize / 2); - //画刻度线 - if(yData.calibration==true){ - context.moveTo(tStartRight,pos); - context.lineTo(tStartRight + 3*opts.pixelRatio,pos); - } - } - context.closePath(); - context.stroke(); - }); - //画Y轴轴线 - if (yData.axisLine!==false) { - context.beginPath(); - context.setStrokeStyle(yData.axisLineColor||'#cccccc'); - context.setLineWidth(1 * opts.pixelRatio); - if(yAxisWidth.position=='left'){ - context.moveTo(tStartLeft,opts.height-opts.area[2]); - context.lineTo(tStartLeft,opts.area[0]); - }else{ - context.moveTo(tStartRight,opts.height-opts.area[2]); - context.lineTo(tStartRight,opts.area[0]); - } - context.stroke(); - } - - //画Y轴标题 - if (opts.yAxis.showTitle) { - - let titleFontSize = yData.titleFontSize || config.fontSize; - let title = yData.title; - context.beginPath(); - context.setFontSize(titleFontSize); - context.setFillStyle(yData.titleFontColor || '#666666'); - if(yAxisWidth.position=='left'){ - context.fillText(title, tStartLeft - measureText(title,titleFontSize)/2, opts.area[0]-10*opts.pixelRatio); - }else{ - context.fillText(title,tStartRight - measureText(title,titleFontSize)/2, opts.area[0]-10*opts.pixelRatio); - } - context.closePath(); - context.stroke(); - } - if(yAxisWidth.position=='left'){ - tStartLeft -=(yAxisWidth.width + opts.yAxis.padding); - }else{ - tStartRight +=yAxisWidth.width+ opts.yAxis.padding; - } - } - } -} - -function drawLegend(series, opts, config, context, chartData) { - if (opts.legend.show === false) { - return; - } - let legendData = chartData.legendData; - let legendList = legendData.points; - let legendArea = legendData.area; - let padding = opts.legend.padding; - let fontSize = opts.legend.fontSize; - let shapeWidth = 15 * opts.pixelRatio; - let shapeRight = 5 * opts.pixelRatio; - let itemGap = opts.legend.itemGap; - let lineHeight = Math.max(opts.legend.lineHeight * opts.pixelRatio, fontSize); - - //画背景及边框 - context.beginPath(); - context.setLineWidth(opts.legend.borderWidth); - context.setStrokeStyle(opts.legend.borderColor); - context.setFillStyle(opts.legend.backgroundColor); - context.moveTo(legendArea.start.x, legendArea.start.y); - context.rect(legendArea.start.x, legendArea.start.y, legendArea.width, legendArea.height); - context.closePath(); - context.fill(); - context.stroke(); - - legendList.forEach(function(itemList, listIndex) { - let width = 0; - let height = 0; - width = legendData.widthArr[listIndex]; - height = legendData.heightArr[listIndex]; - let startX = 0; - let startY = 0; - if (opts.legend.position == 'top' || opts.legend.position == 'bottom') { - startX = legendArea.start.x + (legendArea.width - width) / 2; - startY = legendArea.start.y + padding + listIndex * lineHeight; - } else { - if (listIndex == 0) { - width = 0; - } else { - width = legendData.widthArr[listIndex - 1]; - } - startX = legendArea.start.x + padding + width; - startY = legendArea.start.y + padding + (legendArea.height - height) / 2; - } - - context.setFontSize(config.fontSize); - for (let i = 0; i < itemList.length; i++) { - let item = itemList[i]; - item.area = [0, 0, 0, 0]; - item.area[0] = startX; - item.area[1] = startY; - item.area[3] = startY + lineHeight; - context.beginPath(); - context.setLineWidth(1 * opts.pixelRatio); - context.setStrokeStyle(item.show ? item.color : opts.legend.hiddenColor); - context.setFillStyle(item.show ? item.color : opts.legend.hiddenColor); - switch (item.legendShape) { - case 'line': - context.moveTo(startX, startY + 0.5 * lineHeight - 2 * opts.pixelRatio); - context.fillRect(startX, startY + 0.5 * lineHeight - 2 * opts.pixelRatio, 15 * opts.pixelRatio, 4 * opts.pixelRatio); - break; - case 'triangle': - context.moveTo(startX + 7.5 * opts.pixelRatio, startY + 0.5 * lineHeight - 5 * opts.pixelRatio); - context.lineTo(startX + 2.5 * opts.pixelRatio, startY + 0.5 * lineHeight + 5 * opts.pixelRatio); - context.lineTo(startX + 12.5 * opts.pixelRatio, startY + 0.5 * lineHeight + 5 * opts.pixelRatio); - context.lineTo(startX + 7.5 * opts.pixelRatio, startY + 0.5 * lineHeight - 5 * opts.pixelRatio); - break; - case 'diamond': - context.moveTo(startX + 7.5 * opts.pixelRatio, startY + 0.5 * lineHeight - 5 * opts.pixelRatio); - context.lineTo(startX + 2.5 * opts.pixelRatio, startY + 0.5 * lineHeight); - context.lineTo(startX + 7.5 * opts.pixelRatio, startY + 0.5 * lineHeight + 5 * opts.pixelRatio); - context.lineTo(startX + 12.5 * opts.pixelRatio, startY + 0.5 * lineHeight); - context.lineTo(startX + 7.5 * opts.pixelRatio, startY + 0.5 * lineHeight - 5 * opts.pixelRatio); - break; - case 'circle': - context.moveTo(startX + 7.5 * opts.pixelRatio, startY + 0.5 * lineHeight); - context.arc(startX + 7.5 * opts.pixelRatio, startY + 0.5 * lineHeight, 5 * opts.pixelRatio, 0, 2 * Math.PI); - break; - case 'rect': - context.moveTo(startX, startY + 0.5 * lineHeight - 5 * opts.pixelRatio); - context.fillRect(startX, startY + 0.5 * lineHeight - 5 * opts.pixelRatio, 15 * opts.pixelRatio, 10 * opts.pixelRatio); - break; - default: - context.moveTo(startX, startY + 0.5 * lineHeight - 5 * opts.pixelRatio); - context.fillRect(startX, startY + 0.5 * lineHeight - 5 * opts.pixelRatio, 15 * opts.pixelRatio, 10 * opts.pixelRatio); - } - context.closePath(); - context.fill(); - context.stroke(); - - startX += shapeWidth + shapeRight; - let fontTrans = 0.5 * lineHeight + 0.5 * fontSize - 2; - context.beginPath(); - context.setFontSize(fontSize); - context.setFillStyle(item.show ? opts.legend.fontColor : opts.legend.hiddenColor); - context.fillText(item.name, startX, startY + fontTrans); - context.closePath(); - context.stroke(); - if (opts.legend.position == 'top' || opts.legend.position == 'bottom') { - startX += measureText(item.name, fontSize) + itemGap; - item.area[2] = startX; - } else { - item.area[2] = startX + measureText(item.name, fontSize) + itemGap;; - startX -= shapeWidth + shapeRight; - startY += lineHeight; - } - } - }); -} - -function drawPieDataPoints(series, opts, config, context) { - var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1; - var pieOption = assign({}, { - activeOpacity: 0.5, - activeRadius: 10 * opts.pixelRatio, - offsetAngle: 0, - labelWidth: 15 * opts.pixelRatio, - ringWidth: 0, - border:false, - borderWidth:2, - borderColor:'#FFFFFF' - }, opts.extra.pie); - var centerPosition = { - x: opts.area[3] + (opts.width - opts.area[1] - opts.area[3]) / 2, - y: opts.area[0] + (opts.height - opts.area[0] - opts.area[2]) / 2 - }; - if (config.pieChartLinePadding == 0) { - config.pieChartLinePadding = pieOption.activeRadius; - } - - var radius = Math.min((opts.width - opts.area[1] - opts.area[3]) / 2 - config.pieChartLinePadding - config.pieChartTextPadding - config._pieTextMaxLength_, (opts.height - opts.area[0] - opts.area[2]) / 2 - config.pieChartLinePadding - config.pieChartTextPadding); - - series = getPieDataPoints(series, radius, process); - - var activeRadius = pieOption.activeRadius; - - series = series.map(function(eachSeries) { - eachSeries._start_ += (pieOption.offsetAngle) * Math.PI / 180; - return eachSeries; - }); - series.forEach(function(eachSeries, seriesIndex) { - if (opts.tooltip) { - if (opts.tooltip.index == seriesIndex) { - context.beginPath(); - context.setFillStyle(hexToRgb(eachSeries.color, opts.extra.pie.activeOpacity || 0.5)); - context.moveTo(centerPosition.x, centerPosition.y); - context.arc(centerPosition.x, centerPosition.y, eachSeries._radius_ + activeRadius, eachSeries._start_, - eachSeries._start_ + 2 * - eachSeries._proportion_ * Math.PI); - context.closePath(); - context.fill(); - } - } - context.beginPath(); - context.setLineWidth(pieOption.borderWidth * opts.pixelRatio); - context.lineJoin = "round"; - context.setStrokeStyle(pieOption.borderColor); - context.setFillStyle(eachSeries.color); - context.moveTo(centerPosition.x, centerPosition.y); - context.arc(centerPosition.x, centerPosition.y, eachSeries._radius_, eachSeries._start_, eachSeries._start_ + 2 * eachSeries._proportion_ * Math.PI); - context.closePath(); - context.fill(); - if (pieOption.border == true) { - context.stroke(); - } - }); - - if (opts.type === 'ring') { - var innerPieWidth = radius * 0.6; - if (typeof opts.extra.pie.ringWidth === 'number' && opts.extra.pie.ringWidth > 0) { - innerPieWidth = Math.max(0, radius - opts.extra.pie.ringWidth); - } - context.beginPath(); - context.setFillStyle(opts.background || '#ffffff'); - context.moveTo(centerPosition.x, centerPosition.y); - context.arc(centerPosition.x, centerPosition.y, innerPieWidth, 0, 2 * Math.PI); - context.closePath(); - context.fill(); - } - - if (opts.dataLabel !== false && process === 1) { - var valid = false; - for (var i = 0, len = series.length; i < len; i++) { - if (series[i].data > 0) { - valid = true; - break; - } - } - - if (valid) { - drawPieText(series, opts, config, context, radius, centerPosition); - } - } - - if (process === 1 && opts.type === 'ring') { - drawRingTitle(opts, config, context, centerPosition); - } - - return { - center: centerPosition, - radius: radius, - series: series - }; -} - -function drawRoseDataPoints(series, opts, config, context) { - var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1; - var roseOption = assign({}, { - type: 'area', - activeOpacity: 0.5, - activeRadius: 10 * opts.pixelRatio, - offsetAngle: 0, - labelWidth: 15 * opts.pixelRatio, - border:false, - borderWidth:2, - borderColor:'#FFFFFF' - }, opts.extra.rose); - if (config.pieChartLinePadding == 0) { - config.pieChartLinePadding = roseOption.activeRadius; - } - var centerPosition = { - x: opts.area[3] + (opts.width - opts.area[1] - opts.area[3]) / 2, - y: opts.area[0] + (opts.height - opts.area[0] - opts.area[2]) / 2 - }; - var radius = Math.min((opts.width - opts.area[1] - opts.area[3]) / 2 - config.pieChartLinePadding - config.pieChartTextPadding - config._pieTextMaxLength_, (opts.height - opts.area[0] - opts.area[2]) / 2 - config.pieChartLinePadding - config.pieChartTextPadding); - var minRadius = roseOption.minRadius || radius * 0.5; - - series = getRoseDataPoints(series, roseOption.type, minRadius, radius, process); - - var activeRadius = roseOption.activeRadius; - - series = series.map(function(eachSeries) { - eachSeries._start_ += (roseOption.offsetAngle || 0) * Math.PI / 180; - return eachSeries; - }); - - series.forEach(function(eachSeries, seriesIndex) { - if (opts.tooltip) { - if (opts.tooltip.index == seriesIndex) { - context.beginPath(); - context.setFillStyle(hexToRgb(eachSeries.color, roseOption.activeOpacity || 0.5)); - context.moveTo(centerPosition.x, centerPosition.y); - context.arc(centerPosition.x, centerPosition.y, activeRadius + eachSeries._radius_, eachSeries._start_, - eachSeries._start_ + 2 * eachSeries._rose_proportion_ * Math.PI); - context.closePath(); - context.fill(); - } - } - context.beginPath(); - context.setLineWidth(roseOption.borderWidth * opts.pixelRatio); - context.lineJoin = "round"; - context.setStrokeStyle(roseOption.borderColor); - context.setFillStyle(eachSeries.color); - context.moveTo(centerPosition.x, centerPosition.y); - context.arc(centerPosition.x, centerPosition.y, eachSeries._radius_, eachSeries._start_, eachSeries._start_ + 2 * - eachSeries._rose_proportion_ * Math.PI); - context.closePath(); - context.fill(); - if (roseOption.border == true) { - context.stroke(); - } - }); - - if (opts.dataLabel !== false && process === 1) { - var valid = false; - for (var i = 0, len = series.length; i < len; i++) { - if (series[i].data > 0) { - valid = true; - break; - } - } - - if (valid) { - drawPieText(series, opts, config, context, radius, centerPosition); - } - } - - return { - center: centerPosition, - radius: radius, - series: series - }; -} - -function drawArcbarDataPoints(series, opts, config, context) { - var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1; - var arcbarOption = assign({}, { - startAngle: 0.75, - endAngle: 0.25, - type: 'default', - width: 12 * opts.pixelRatio, - gap:2 * opts.pixelRatio - }, opts.extra.arcbar); - - series = getArcbarDataPoints(series, arcbarOption, process); - - var centerPosition; - if(arcbarOption.center){ - centerPosition=arcbarOption.center; - }else{ - centerPosition= { - x: opts.width / 2, - y: opts.height / 2 - }; - } - - var radius; - if(arcbarOption.radius){ - radius=arcbarOption.radius; - }else{ - radius = Math.min(centerPosition.x, centerPosition.y); - radius -= 5 * opts.pixelRatio; - radius -= arcbarOption.width / 2; - } - - for (let i = 0; i < series.length; i++) { - let eachSeries = series[i]; - //背景颜色 - context.setLineWidth(arcbarOption.width); - context.setStrokeStyle(arcbarOption.backgroundColor || '#E9E9E9'); - context.setLineCap('round'); - context.beginPath(); - if (arcbarOption.type == 'default') { - context.arc(centerPosition.x, centerPosition.y, radius-(arcbarOption.width+arcbarOption.gap)*i, arcbarOption.startAngle * Math.PI, arcbarOption.endAngle * Math.PI, false); - } else { - context.arc(centerPosition.x, centerPosition.y, radius-(arcbarOption.width+arcbarOption.gap)*i, 0, 2 * Math.PI, false); - } - context.stroke(); - //进度条 - context.setLineWidth(arcbarOption.width); - context.setStrokeStyle(eachSeries.color); - context.setLineCap('round'); - context.beginPath(); - context.arc(centerPosition.x, centerPosition.y, radius-(arcbarOption.width+arcbarOption.gap)*i, arcbarOption.startAngle * Math.PI, eachSeries._proportion_ * Math.PI, false); - context.stroke(); - } - - drawRingTitle(opts, config, context, centerPosition); - - return { - center: centerPosition, - radius: radius, - series: series - }; -} - -function drawGaugeDataPoints(categories, series, opts, config, context) { - var process = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 1; - var gaugeOption = assign({}, { - type:'default', - startAngle: 0.75, - endAngle: 0.25, - width: 15, - splitLine: { - fixRadius: 0, - splitNumber: 10, - width: 15, - color: '#FFFFFF', - childNumber: 5, - childWidth: 5 - }, - pointer: { - width: 15, - color: 'auto' - } - }, opts.extra.gauge); - - if (gaugeOption.oldAngle == undefined) { - gaugeOption.oldAngle = gaugeOption.startAngle; - } - if (gaugeOption.oldData == undefined) { - gaugeOption.oldData = 0; - } - categories = getGaugeAxisPoints(categories, gaugeOption.startAngle, gaugeOption.endAngle); - - var centerPosition = { - x: opts.width / 2, - y: opts.height / 2 - }; - var radius = Math.min(centerPosition.x, centerPosition.y); - radius -= 5 * opts.pixelRatio; - radius -= gaugeOption.width / 2; - var innerRadius = radius - gaugeOption.width; - var totalAngle=0; - - //判断仪表盘的样式:default百度样式,progress新样式 - if(gaugeOption.type == 'progress'){ - - //## 第一步画中心圆形背景和进度条背景 - //中心圆形背景 - var pieRadius = radius - gaugeOption.width*3; - context.beginPath(); - let gradient = context.createLinearGradient(centerPosition.x, centerPosition.y-pieRadius, centerPosition.x , centerPosition.y+pieRadius); - //配置渐变填充(起点:中心点向上减半径;结束点中心点向下加半径) - gradient.addColorStop('0', hexToRgb(series[0].color, 0.3)); - gradient.addColorStop('1.0',hexToRgb("#FFFFFF", 0.1)); - context.setFillStyle(gradient); - context.arc(centerPosition.x, centerPosition.y, pieRadius, 0, 2*Math.PI, false); - context.fill(); - //画进度条背景 - context.setLineWidth(gaugeOption.width); - context.setStrokeStyle(hexToRgb(series[0].color, 0.3)); - context.setLineCap('round'); - context.beginPath(); - context.arc(centerPosition.x, centerPosition.y, innerRadius , gaugeOption.startAngle * Math.PI, gaugeOption.endAngle *Math.PI, false); - context.stroke(); - - //## 第二步画刻度线 - totalAngle = gaugeOption.startAngle - gaugeOption.endAngle + 1; - let splitAngle = totalAngle / gaugeOption.splitLine.splitNumber; - let childAngle = totalAngle / gaugeOption.splitLine.splitNumber / gaugeOption.splitLine.childNumber; - let startX = -radius - gaugeOption.width * 0.5 - gaugeOption.splitLine.fixRadius; - let endX = -radius - gaugeOption.width - gaugeOption.splitLine.fixRadius + gaugeOption.splitLine.width; - context.save(); - context.translate(centerPosition.x, centerPosition.y); - context.rotate((gaugeOption.startAngle - 1) * Math.PI); - let len = gaugeOption.splitLine.splitNumber * gaugeOption.splitLine.childNumber + 1; - let proc = series[0].data * process; - for (let i = 0; i < len; i++) { - context.beginPath(); - //刻度线随进度变色 - if(proc>(i/len)){ - context.setStrokeStyle(hexToRgb(series[0].color, 1)); - }else{ - context.setStrokeStyle(hexToRgb(series[0].color, 0.3)); - } - context.setLineWidth(3 * opts.pixelRatio); - context.moveTo(startX, 0); - context.lineTo(endX, 0); - context.stroke(); - context.rotate(childAngle * Math.PI); - } - context.restore(); - - //## 第三步画进度条 - series = getArcbarDataPoints(series, gaugeOption, process); - context.setLineWidth(gaugeOption.width); - context.setStrokeStyle(series[0].color); - context.setLineCap('round'); - context.beginPath(); - context.arc(centerPosition.x, centerPosition.y, innerRadius , gaugeOption.startAngle * Math.PI, series[0]._proportion_ *Math.PI, false); - context.stroke(); - - //## 第四步画指针 - let pointerRadius = radius - gaugeOption.width*2.5; - context.save(); - context.translate(centerPosition.x, centerPosition.y); - context.rotate((series[0]._proportion_ - 1) * Math.PI); - context.beginPath(); - context.setLineWidth(gaugeOption.width/3); - let gradient3 = context.createLinearGradient(0, -pointerRadius*0.6, 0 , pointerRadius*0.6); - gradient3.addColorStop('0', hexToRgb('#FFFFFF', 0)); - gradient3.addColorStop('0.5', hexToRgb(series[0].color, 1)); - gradient3.addColorStop('1.0', hexToRgb('#FFFFFF', 0)); - context.setStrokeStyle(gradient3); - context.arc(0, 0, pointerRadius , 0.85* Math.PI, 1.15 * Math.PI, false); - context.stroke(); - context.beginPath(); - context.setLineWidth(1); - context.setStrokeStyle(series[0].color); - context.setFillStyle(series[0].color); - context.moveTo(-pointerRadius-gaugeOption.width/3/2,-4); - context.lineTo(-pointerRadius-gaugeOption.width/3/2-4,0); - context.lineTo(-pointerRadius-gaugeOption.width/3/2,4); - context.lineTo(-pointerRadius-gaugeOption.width/3/2,-4); - context.stroke(); - context.fill(); - context.restore(); - - //default百度样式 - }else{ - //画背景 - context.setLineWidth(gaugeOption.width); - context.setLineCap('butt'); - for (let i = 0; i < categories.length; i++) { - let eachCategories = categories[i]; - context.beginPath(); - context.setStrokeStyle(eachCategories.color); - context.arc(centerPosition.x, centerPosition.y, radius, eachCategories._startAngle_ * Math.PI, eachCategories._endAngle_ *Math.PI, false); - context.stroke(); - } - context.save(); - - //画刻度线 - totalAngle = gaugeOption.startAngle - gaugeOption.endAngle + 1; - let splitAngle = totalAngle / gaugeOption.splitLine.splitNumber; - let childAngle = totalAngle / gaugeOption.splitLine.splitNumber / gaugeOption.splitLine.childNumber; - let startX = -radius - gaugeOption.width * 0.5 - gaugeOption.splitLine.fixRadius; - let endX = -radius - gaugeOption.width * 0.5 - gaugeOption.splitLine.fixRadius + gaugeOption.splitLine.width; - let childendX = -radius - gaugeOption.width * 0.5 - gaugeOption.splitLine.fixRadius + gaugeOption.splitLine.childWidth; - - context.translate(centerPosition.x, centerPosition.y); - context.rotate((gaugeOption.startAngle - 1) * Math.PI); - - for (let i = 0; i < gaugeOption.splitLine.splitNumber + 1; i++) { - context.beginPath(); - context.setStrokeStyle(gaugeOption.splitLine.color); - context.setLineWidth(2 * opts.pixelRatio); - context.moveTo(startX, 0); - context.lineTo(endX, 0); - context.stroke(); - context.rotate(splitAngle * Math.PI); - } - context.restore(); - - context.save(); - context.translate(centerPosition.x, centerPosition.y); - context.rotate((gaugeOption.startAngle - 1) * Math.PI); - - for (let i = 0; i < gaugeOption.splitLine.splitNumber * gaugeOption.splitLine.childNumber + 1; i++) { - context.beginPath(); - context.setStrokeStyle(gaugeOption.splitLine.color); - context.setLineWidth(1 * opts.pixelRatio); - context.moveTo(startX, 0); - context.lineTo(childendX, 0); - context.stroke(); - context.rotate(childAngle * Math.PI); - } - context.restore(); - - //画指针 - series = getGaugeDataPoints(series, categories, gaugeOption, process); - - for (let i = 0; i < series.length; i++) { - let eachSeries = series[i]; - context.save(); - context.translate(centerPosition.x, centerPosition.y); - context.rotate((eachSeries._proportion_ - 1) * Math.PI); - context.beginPath(); - context.setFillStyle(eachSeries.color); - context.moveTo(gaugeOption.pointer.width, 0); - context.lineTo(0, -gaugeOption.pointer.width / 2); - context.lineTo(-innerRadius, 0); - context.lineTo(0, gaugeOption.pointer.width / 2); - context.lineTo(gaugeOption.pointer.width, 0); - context.closePath(); - context.fill(); - context.beginPath(); - context.setFillStyle('#FFFFFF'); - context.arc(0, 0, gaugeOption.pointer.width / 6, 0, 2 * Math.PI, false); - context.fill(); - context.restore(); - } - - if (opts.dataLabel !== false) { - drawGaugeLabel(gaugeOption, radius, centerPosition, opts, config, context); - } - } - - //画仪表盘标题,副标题 - drawRingTitle(opts, config, context, centerPosition); - - if (process === 1 && opts.type === 'gauge') { - opts.extra.gauge.oldAngle = series[0]._proportion_; - opts.extra.gauge.oldData = series[0].data; - } - return { - center: centerPosition, - radius: radius, - innerRadius: innerRadius, - categories: categories, - totalAngle: totalAngle - }; -} - -function drawRadarDataPoints(series, opts, config, context) { - var process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1; - var radarOption = assign({},{ - gridColor: '#cccccc', - labelColor: '#666666', - opacity: 0.2, - gridCount:3 - },opts.extra.radar); - - var coordinateAngle = getRadarCoordinateSeries(opts.categories.length); - - var centerPosition = { - x: opts.area[3] + (opts.width - opts.area[1] - opts.area[3]) / 2, - y: opts.area[0] + (opts.height - opts.area[0] - opts.area[2]) / 2 - }; - - var radius = Math.min(centerPosition.x - (getMaxTextListLength(opts.categories) + config.radarLabelTextMargin), - centerPosition.y - config.radarLabelTextMargin); - //TODO逻辑不对 - radius -= opts.padding[1]; - - // draw grid - context.beginPath(); - context.setLineWidth(1 * opts.pixelRatio); - context.setStrokeStyle(radarOption.gridColor); - coordinateAngle.forEach(function(angle) { - var pos = convertCoordinateOrigin(radius * Math.cos(angle), radius * Math.sin(angle), centerPosition); - context.moveTo(centerPosition.x, centerPosition.y); - context.lineTo(pos.x, pos.y); - }); - context.stroke(); - context.closePath(); - // draw split line grid - - var _loop = function _loop(i) { - var startPos = {}; - context.beginPath(); - context.setLineWidth(1 * opts.pixelRatio); - context.setStrokeStyle(radarOption.gridColor); - coordinateAngle.forEach(function(angle, index) { - var pos = convertCoordinateOrigin(radius / radarOption.gridCount * i * Math.cos(angle), radius / radarOption.gridCount * i * Math.sin(angle), centerPosition); - if (index === 0) { - startPos = pos; - context.moveTo(pos.x, pos.y); - } else { - context.lineTo(pos.x, pos.y); - } - }); - context.lineTo(startPos.x, startPos.y); - context.stroke(); - context.closePath(); - }; - - for (var i = 1; i <= radarOption.gridCount; i++) { - _loop(i); - } - - var radarDataPoints = getRadarDataPoints(coordinateAngle, centerPosition, radius, series, opts, process); - - radarDataPoints.forEach(function(eachSeries, seriesIndex) { - // 绘制区域数据 - context.beginPath(); - context.setFillStyle(hexToRgb(eachSeries.color, radarOption.opacity)); - eachSeries.data.forEach(function(item, index) { - if (index === 0) { - context.moveTo(item.position.x, item.position.y); - } else { - context.lineTo(item.position.x, item.position.y); - } - }); - context.closePath(); - context.fill(); - - if (opts.dataPointShape !== false) { - var points = eachSeries.data.map(function(item) { - return item.position; - }); - drawPointShape(points, eachSeries.color, eachSeries.pointShape, context, opts); - } - }); - // draw label text - drawRadarLabel(coordinateAngle, radius, centerPosition, opts, config, context); - - return { - center: centerPosition, - radius: radius, - angleList: coordinateAngle - }; -} - -function normalInt(min, max, iter) { - iter = iter==0?1:iter; - var arr = []; - for (var i = 0; i < iter; i++) { - arr[i] = Math.random(); - }; - return Math.floor(arr.reduce(function(i,j){return i+j})/iter*(max-min))+min; -}; - -function collisionNew(area,points,width,height){ - var isIn=false; - for(let i=0;ipoints[i].area[2]||area[1]>points[i].area[3]||area[2]width || area[3]>height){ - isIn=true; - break; - }else{ - isIn=false; - } - }else{ - isIn=true; - break; - } - } - } - return isIn; -}; - -function getBoundingBox(data) { - var bounds = {}, coords; - bounds.xMin = 180; - bounds.xMax = 0; - bounds.yMin = 90; - bounds.yMax = 0 - for (var i = 0; i < data.length; i++) { - var coorda = data[i].geometry.coordinates - for (var k = 0; k < coorda.length; k++) { - coords = coorda[k]; - if (coords.length == 1) { - coords = coords[0] - } - for (var j = 0; j < coords.length; j++) { - var longitude = coords[j][0]; - var latitude = coords[j][1]; - var point = { - x: longitude, - y: latitude - } - bounds.xMin = bounds.xMin < point.x ? bounds.xMin : point.x; - bounds.xMax = bounds.xMax > point.x ? bounds.xMax : point.x; - bounds.yMin = bounds.yMin < point.y ? bounds.yMin : point.y; - bounds.yMax = bounds.yMax > point.y ? bounds.yMax : point.y; - } - } - } - return bounds; -} - -function coordinateToPoint(latitude, longitude,bounds,scale,xoffset,yoffset) { - return { - x: (longitude - bounds.xMin) * scale+xoffset, - y: (bounds.yMax - latitude) * scale+yoffset - }; -} - -function pointToCoordinate(pointY, pointX,bounds,scale,xoffset,yoffset) { - return { - x: (pointX-xoffset)/scale+bounds.xMin, - y: bounds.yMax - (pointY-yoffset)/scale - }; -} - -function isRayIntersectsSegment(poi,s_poi,e_poi){ - if (s_poi[1]==e_poi[1]){return false;} - if (s_poi[1]>poi[1] && e_poi[1]>poi[1]){return false;} - if (s_poi[1]poi[1]){return false;} - if (e_poi[1]==poi[1] && s_poi[1]>poi[1]){return false;} - if (s_poi[0]0.7) { - return true; - }else {return false}; - }; - for (let i = 0; i < points.length; i++) { - let text = points[i].name; - let tHeight = points[i].textSize; - let tWidth = measureText(text,tHeight); - let isSpin = Spin(); - let x,y,area,areav; - let breaknum=0; - while(true) { - breaknum++; - let isCollision; - if (isSpin) { - x = normalInt(-opts.width/2, opts.width/2,5) - tWidth/2; - y = normalInt(-opts.height/2, opts.height/2,5)+tHeight/2; - area=[y-5-tWidth+opts.width/2,(-x-5+opts.height/2),y+5+opts.width/2,(-x+tHeight+5+opts.height/2)]; - areav=[opts.width-(opts.width/2-opts.height/2)-(-x+tHeight+5+opts.height/2)-5,(opts.height/2-opts.width/2)+(y-5-tWidth+opts.width/2)-5,opts.width-(opts.width/2-opts.height/2)-(-x+tHeight+5+opts.height/2)+tHeight,(opts.height/2-opts.width/2)+(y-5-tWidth+opts.width/2)+tWidth+5]; - isCollision = collisionNew(areav,points,opts.height,opts.width); - }else{ - x = normalInt(-opts.width/2, opts.width/2,5) - tWidth/2; - y = normalInt(-opts.height/2, opts.height/2,5)+tHeight/2; - area=[x-5+opts.width/2,y-5-tHeight+opts.height/2,x+tWidth+5+opts.width/2,y+5+opts.height/2]; - isCollision = collisionNew(area,points,opts.width,opts.height); - } - if (!isCollision) break; - if (breaknum==1000){ - area=[-1000,-1000,-1000,-1000]; - break; - } - }; - if (isSpin) { - points[i].area=areav; - points[i].areav=area; - }else{ - points[i].area=area; - } - points[i].rotate=isSpin; - }; - break; - } - return points; -} - - -function drawWordCloudDataPoints(series, opts, config, context) { - let process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1; - let wordOption = assign({},{ - type: 'normal', - autoColors: true - },opts.extra.word); - - context.beginPath(); - context.setFillStyle(opts.background||'#FFFFFF'); - context.rect(0,0,opts.width,opts.height); - context.fill(); - context.save(); - let points = opts.chartData.wordCloudData; - context.translate(opts.width/2,opts.height/2); - - for(let i=0;i0){ - if (opts.tooltip) { - if (opts.tooltip.index == i) { - context.strokeText(text,(points[i].areav[0]+5-opts.width/2)*process-tWidth*(1-process)/2,(points[i].areav[1]+5+tHeight-opts.height/2)*process); - }else{ - context.fillText(text,(points[i].areav[0]+5-opts.width/2)*process-tWidth*(1-process)/2,(points[i].areav[1]+5+tHeight-opts.height/2)*process); - } - }else{ - context.fillText(text,(points[i].areav[0]+5-opts.width/2)*process-tWidth*(1-process)/2,(points[i].areav[1]+5+tHeight-opts.height/2)*process); - } - } - }else{ - if(points[i].area[0]>0){ - if (opts.tooltip) { - if (opts.tooltip.index == i) { - context.strokeText(text,(points[i].area[0]+5-opts.width/2)*process-tWidth*(1-process)/2,(points[i].area[1]+5+tHeight-opts.height/2)*process); - }else{ - context.fillText(text,(points[i].area[0]+5-opts.width/2)*process-tWidth*(1-process)/2,(points[i].area[1]+5+tHeight-opts.height/2)*process); - } - }else{ - context.fillText(text,(points[i].area[0]+5-opts.width/2)*process-tWidth*(1-process)/2,(points[i].area[1]+5+tHeight-opts.height/2)*process); - } - - } - } - - context.stroke(); - context.restore(); - } - context.restore(); -} - -function drawFunnelDataPoints(series, opts, config, context) { - let process = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1; - let funnelOption = assign({},{ - activeWidth:10, - activeOpacity:0.3, - border:false, - borderWidth:2, - borderColor:'#FFFFFF', - fillOpacity:1, - labelAlign:'right' - },opts.extra.funnel); - let eachSpacing = (opts.height - opts.area[0] - opts.area[2])/series.length; - let centerPosition = { - x: opts.area[3] + (opts.width - opts.area[1] - opts.area[3]) / 2, - y: opts.height-opts.area[2] - }; - let activeWidth = funnelOption.activeWidth; - let radius = Math.min((opts.width - opts.area[1] - opts.area[3]) / 2 - activeWidth, (opts.height - opts.area[0] - opts.area[2]) / 2 - activeWidth); - series = getFunnelDataPoints(series, radius, process); - context.save(); - context.translate(centerPosition.x,centerPosition.y); - for(let i=0;i0){ - opts.area[3] += yAxisWidth[i].width + opts.yAxis.padding; - }else{ - opts.area[3] += yAxisWidth[i].width; - } - leftIndex +=1; - }else{ - if(rightIndex>0){ - opts.area[1] += yAxisWidth[i].width + opts.yAxis.padding; - }else{ - opts.area[1] += yAxisWidth[i].width; - } - rightIndex +=1; - } - } - }else{ - config.yAxisWidth = yAxisWidth; - } - opts.chartData.yAxisData = _calYAxisData; - - if (opts.categories && opts.categories.length) { - opts.chartData.xAxisData = getXAxisPoints(opts.categories, opts, config); - let _calCategoriesData = calCategoriesData(opts.categories, opts, config, opts.chartData.xAxisData.eachSpacing), - xAxisHeight = _calCategoriesData.xAxisHeight, - angle = _calCategoriesData.angle; - config.xAxisHeight = xAxisHeight; - config._xAxisTextAngle_ = angle; - opts.area[2] += xAxisHeight; - opts.chartData.categoriesData = _calCategoriesData; - }else{ - if (opts.type === 'line' || opts.type === 'area' || opts.type === 'points') { - opts.chartData.xAxisData = calXAxisData(series, opts, config); - categories=opts.chartData.xAxisData.rangesFormat; - let _calCategoriesData = calCategoriesData(categories, opts, config, opts.chartData.xAxisData.eachSpacing), - xAxisHeight = _calCategoriesData.xAxisHeight, - angle = _calCategoriesData.angle; - config.xAxisHeight = xAxisHeight; - config._xAxisTextAngle_ = angle; - opts.area[2] += xAxisHeight; - opts.chartData.categoriesData = _calCategoriesData; - }else{ - opts.chartData.xAxisData={ - xAxisPoints: [] - }; - } - } - //计算右对齐偏移距离 - if (opts.enableScroll && opts.xAxis.scrollAlign == 'right' && opts._scrollDistance_ === undefined) { - let offsetLeft = 0, - xAxisPoints = opts.chartData.xAxisData.xAxisPoints, - startX = opts.chartData.xAxisData.startX, - endX = opts.chartData.xAxisData.endX, - eachSpacing = opts.chartData.xAxisData.eachSpacing; - let totalWidth = eachSpacing * (xAxisPoints.length - 1); - let screenWidth = endX - startX; - offsetLeft = screenWidth - totalWidth; - _this.scrollOption = { - currentOffset: offsetLeft, - startTouchX: offsetLeft, - distance: 0, - lastMoveTime: 0 - }; - opts._scrollDistance_ = offsetLeft; - } - - if (type === 'pie' || type === 'ring' || type === 'rose') { - config._pieTextMaxLength_ = opts.dataLabel === false ? 0 : getPieTextMaxLength(seriesMA); - } - - switch (type) { - case 'word': - let wordOption = assign({},{ - type: 'normal', - autoColors: true - },opts.extra.word); - if(opts.updateData==true || opts.updateData==undefined){ - opts.chartData.wordCloudData=getWordCloudPoint(opts,wordOption.type); - } - this.animationInstance = new Animation({ - timing: 'easeInOut', - duration: duration, - onProcess: function(process) { - context.clearRect(0, 0, opts.width, opts.height); - if (opts.rotate) { - contextRotate(context, opts); - } - drawWordCloudDataPoints(series, opts, config, context,process); - drawCanvas(opts, context); - }, - onAnimationFinish: function onAnimationFinish() { - _this.event.trigger('renderComplete'); - } - }); - break; - case 'map': - context.clearRect(0, 0, opts.width, opts.height); - drawMapDataPoints(series, opts, config, context); - break; - case 'funnel': - this.animationInstance = new Animation({ - timing: 'easeInOut', - duration: duration, - onProcess: function(process) { - context.clearRect(0, 0, opts.width, opts.height); - if (opts.rotate) { - contextRotate(context, opts); - } - opts.chartData.funnelData = drawFunnelDataPoints(series, opts, config, context, process); - drawLegend(opts.series, opts, config, context, opts.chartData); - drawToolTipBridge(opts, config, context, process); - drawCanvas(opts, context); - }, - onAnimationFinish: function onAnimationFinish() { - _this.event.trigger('renderComplete'); - } - }); - break; - case 'line': - this.animationInstance = new Animation({ - timing: 'easeIn', - duration: duration, - onProcess: function onProcess(process) { - context.clearRect(0, 0, opts.width, opts.height); - if (opts.rotate) { - contextRotate(context, opts); - } - drawYAxisGrid(categories, opts, config, context); - drawXAxis(categories, opts, config, context); - var _drawLineDataPoints = drawLineDataPoints(series, opts, config, context, process), - xAxisPoints = _drawLineDataPoints.xAxisPoints, - calPoints = _drawLineDataPoints.calPoints, - eachSpacing = _drawLineDataPoints.eachSpacing; - opts.chartData.xAxisPoints = xAxisPoints; - opts.chartData.calPoints = calPoints; - opts.chartData.eachSpacing = eachSpacing; - drawYAxis(series, opts, config, context); - if (opts.enableMarkLine !== false && process === 1) { - drawMarkLine(opts, config, context); - } - drawLegend(opts.series, opts, config, context, opts.chartData); - drawToolTipBridge(opts, config, context, process, eachSpacing, xAxisPoints); - drawCanvas(opts, context); - - }, - onAnimationFinish: function onAnimationFinish() { - _this.event.trigger('renderComplete'); - } - }); - break; - case 'mix': - this.animationInstance = new Animation({ - timing: 'easeIn', - duration: duration, - onProcess: function onProcess(process) { - context.clearRect(0, 0, opts.width, opts.height); - if (opts.rotate) { - contextRotate(context, opts); - } - drawYAxisGrid(categories, opts, config, context); - drawXAxis(categories, opts, config, context); - var _drawMixDataPoints = drawMixDataPoints(series, opts, config, context, process), - xAxisPoints = _drawMixDataPoints.xAxisPoints, - calPoints = _drawMixDataPoints.calPoints, - eachSpacing = _drawMixDataPoints.eachSpacing; - opts.chartData.xAxisPoints = xAxisPoints; - opts.chartData.calPoints = calPoints; - opts.chartData.eachSpacing = eachSpacing; - drawYAxis(series, opts, config, context); - if (opts.enableMarkLine !== false && process === 1) { - drawMarkLine(opts, config, context); - } - drawLegend(opts.series, opts, config, context, opts.chartData); - drawToolTipBridge(opts, config, context, process, eachSpacing, xAxisPoints); - drawCanvas(opts, context); - }, - onAnimationFinish: function onAnimationFinish() { - _this.event.trigger('renderComplete'); - } - }); - break; - case 'column': - this.animationInstance = new Animation({ - timing: 'easeIn', - duration: duration, - onProcess: function onProcess(process) { - context.clearRect(0, 0, opts.width, opts.height); - if (opts.rotate) { - contextRotate(context, opts); - } - drawYAxisGrid(categories, opts, config, context); - drawXAxis(categories, opts, config, context); - var _drawColumnDataPoints = drawColumnDataPoints(series, opts, config, context, process), - xAxisPoints = _drawColumnDataPoints.xAxisPoints, - calPoints = _drawColumnDataPoints.calPoints, - eachSpacing = _drawColumnDataPoints.eachSpacing; - opts.chartData.xAxisPoints = xAxisPoints; - opts.chartData.calPoints = calPoints; - opts.chartData.eachSpacing = eachSpacing; - drawYAxis(series, opts, config, context); - if (opts.enableMarkLine !== false && process === 1) { - drawMarkLine(opts, config, context); - } - drawLegend(opts.series, opts, config, context, opts.chartData); - drawToolTipBridge(opts, config, context, process, eachSpacing, xAxisPoints); - drawCanvas(opts, context); - }, - onAnimationFinish: function onAnimationFinish() { - _this.event.trigger('renderComplete'); - } - }); - break; - case 'area': - this.animationInstance = new Animation({ - timing: 'easeIn', - duration: duration, - onProcess: function onProcess(process) { - context.clearRect(0, 0, opts.width, opts.height); - if (opts.rotate) { - contextRotate(context, opts); - } - drawYAxisGrid(categories, opts, config, context); - drawXAxis(categories, opts, config, context); - var _drawAreaDataPoints = drawAreaDataPoints(series, opts, config, context, process), - xAxisPoints = _drawAreaDataPoints.xAxisPoints, - calPoints = _drawAreaDataPoints.calPoints, - eachSpacing = _drawAreaDataPoints.eachSpacing; - opts.chartData.xAxisPoints = xAxisPoints; - opts.chartData.calPoints = calPoints; - opts.chartData.eachSpacing = eachSpacing; - drawYAxis(series, opts, config, context); - if (opts.enableMarkLine !== false && process === 1) { - drawMarkLine(opts, config, context); - } - drawLegend(opts.series, opts, config, context, opts.chartData); - drawToolTipBridge(opts, config, context, process, eachSpacing, xAxisPoints); - drawCanvas(opts, context); - }, - onAnimationFinish: function onAnimationFinish() { - _this.event.trigger('renderComplete'); - } - }); - break; - case 'ring': - case 'pie': - this.animationInstance = new Animation({ - timing: 'easeInOut', - duration: duration, - onProcess: function onProcess(process) { - context.clearRect(0, 0, opts.width, opts.height); - if (opts.rotate) { - contextRotate(context, opts); - } - opts.chartData.pieData = drawPieDataPoints(series, opts, config, context, process); - drawLegend(opts.series, opts, config, context, opts.chartData); - drawToolTipBridge(opts, config, context, process); - drawCanvas(opts, context); - }, - onAnimationFinish: function onAnimationFinish() { - _this.event.trigger('renderComplete'); - } - }); - break; - case 'rose': - this.animationInstance = new Animation({ - timing: 'easeInOut', - duration: duration, - onProcess: function onProcess(process) { - context.clearRect(0, 0, opts.width, opts.height); - if (opts.rotate) { - contextRotate(context, opts); - } - opts.chartData.pieData = drawRoseDataPoints(series, opts, config, context, process); - drawLegend(opts.series, opts, config, context, opts.chartData); - drawToolTipBridge(opts, config, context, process); - drawCanvas(opts, context); - }, - onAnimationFinish: function onAnimationFinish() { - _this.event.trigger('renderComplete'); - } - }); - break; - case 'radar': - this.animationInstance = new Animation({ - timing: 'easeInOut', - duration: duration, - onProcess: function onProcess(process) { - context.clearRect(0, 0, opts.width, opts.height); - if (opts.rotate) { - contextRotate(context, opts); - } - opts.chartData.radarData = drawRadarDataPoints(series, opts, config, context, process); - drawLegend(opts.series, opts, config, context, opts.chartData); - drawToolTipBridge(opts, config, context, process); - drawCanvas(opts, context); - }, - onAnimationFinish: function onAnimationFinish() { - _this.event.trigger('renderComplete'); - } - }); - break; - case 'arcbar': - this.animationInstance = new Animation({ - timing: 'easeInOut', - duration: duration, - onProcess: function onProcess(process) { - context.clearRect(0, 0, opts.width, opts.height); - if (opts.rotate) { - contextRotate(context, opts); - } - opts.chartData.arcbarData = drawArcbarDataPoints(series, opts, config, context, process); - drawCanvas(opts, context); - }, - onAnimationFinish: function onAnimationFinish() { - _this.event.trigger('renderComplete'); - } - }); - break; - case 'gauge': - this.animationInstance = new Animation({ - timing: 'easeInOut', - duration: duration, - onProcess: function onProcess(process) { - context.clearRect(0, 0, opts.width, opts.height); - if (opts.rotate) { - contextRotate(context, opts); - } - opts.chartData.gaugeData = drawGaugeDataPoints(categories, series, opts, config, context, process); - drawCanvas(opts, context); - }, - onAnimationFinish: function onAnimationFinish() { - _this.event.trigger('renderComplete'); - } - }); - break; - case 'candle': - this.animationInstance = new Animation({ - timing: 'easeIn', - duration: duration, - onProcess: function onProcess(process) { - context.clearRect(0, 0, opts.width, opts.height); - if (opts.rotate) { - contextRotate(context, opts); - } - drawYAxisGrid(categories, opts, config, context); - drawXAxis(categories, opts, config, context); - var _drawCandleDataPoints = drawCandleDataPoints(series, seriesMA, opts, config, context, process), - xAxisPoints = _drawCandleDataPoints.xAxisPoints, - calPoints = _drawCandleDataPoints.calPoints, - eachSpacing = _drawCandleDataPoints.eachSpacing; - opts.chartData.xAxisPoints = xAxisPoints; - opts.chartData.calPoints = calPoints; - opts.chartData.eachSpacing = eachSpacing; - drawYAxis(series, opts, config, context); - if (opts.enableMarkLine !== false && process === 1) { - drawMarkLine(opts, config, context); - } - if (seriesMA) { - drawLegend(seriesMA, opts, config, context, opts.chartData); - } else { - drawLegend(opts.series, opts, config, context, opts.chartData); - } - drawToolTipBridge(opts, config, context, process, eachSpacing, xAxisPoints); - drawCanvas(opts, context); - }, - onAnimationFinish: function onAnimationFinish() { - _this.event.trigger('renderComplete'); - } - }); - break; - } -} - -// simple event implement - -function Event() { - this.events = {}; -} - -Event.prototype.addEventListener = function(type, listener) { - this.events[type] = this.events[type] || []; - this.events[type].push(listener); -}; - -Event.prototype.trigger = function() { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - var type = args[0]; - var params = args.slice(1); - if (!!this.events[type]) { - this.events[type].forEach(function(listener) { - try { - listener.apply(null, params); - } catch (e) { - console.error(e); - } - }); - } -}; - -var Charts = function Charts(opts) { - opts.pixelRatio = opts.pixelRatio ? opts.pixelRatio : 1; - opts.fontSize = opts.fontSize ? opts.fontSize * opts.pixelRatio : 13 * opts.pixelRatio; - opts.title = assign({}, opts.title); - opts.subtitle = assign({}, opts.subtitle); - opts.duration = opts.duration ? opts.duration : 1000; - opts.yAxis = assign({}, { - data:[], - showTitle:false, - disabled:false, - disableGrid:false, - splitNumber:5, - gridType: 'solid', - dashLength: 4 * opts.pixelRatio, - gridColor:'#cccccc', - padding:10, - fontColor:'#666666' - }, opts.yAxis); - opts.yAxis.dashLength *= opts.pixelRatio; - opts.yAxis.padding *= opts.pixelRatio; - opts.xAxis = assign({}, { - rotateLabel: false, - type: 'calibration', - gridType: 'solid', - dashLength: 4, - scrollAlign: 'left', - boundaryGap:'center', - axisLine:true, - axisLineColor:'#cccccc' - }, opts.xAxis); - opts.xAxis.dashLength *= opts.pixelRatio; - opts.legend = assign({}, { - show: true, - position: 'bottom', - float: 'center', - backgroundColor: 'rgba(0,0,0,0)', - borderColor: 'rgba(0,0,0,0)', - borderWidth: 0, - padding: 5, - margin: 5, - itemGap: 10, - fontSize: opts.fontSize, - lineHeight: opts.fontSize, - fontColor: '#333333', - format: {}, - hiddenColor: '#CECECE' - }, opts.legend); - opts.legend.borderWidth = opts.legend.borderWidth * opts.pixelRatio; - opts.legend.itemGap = opts.legend.itemGap * opts.pixelRatio; - opts.legend.padding = opts.legend.padding * opts.pixelRatio; - opts.legend.margin = opts.legend.margin * opts.pixelRatio; - opts.extra = assign({}, opts.extra); - opts.rotate = opts.rotate ? true : false; - opts.animation = opts.animation ? true : false; - opts.rotate = opts.rotate ? true : false; - - let config$$1 = JSON.parse(JSON.stringify(config)); - config$$1.colors = opts.colors ? opts.colors : config$$1.colors; - config$$1.yAxisTitleWidth = opts.yAxis.disabled !== true && opts.yAxis.title ? config$$1.yAxisTitleWidth : 0; - if (opts.type == 'pie' || opts.type == 'ring') { - config$$1.pieChartLinePadding = opts.dataLabel === false ? 0 : opts.extra.pie.labelWidth * opts.pixelRatio || config$$1.pieChartLinePadding * opts.pixelRatio; - } - if (opts.type == 'rose') { - config$$1.pieChartLinePadding = opts.dataLabel === false ? 0 : opts.extra.rose.labelWidth * opts.pixelRatio || config$$1.pieChartLinePadding * opts.pixelRatio; - } - config$$1.pieChartTextPadding = opts.dataLabel === false ? 0 : config$$1.pieChartTextPadding * opts.pixelRatio; - config$$1.yAxisSplit = opts.yAxis.splitNumber ? opts.yAxis.splitNumber : config.yAxisSplit; - - //屏幕旋转 - config$$1.rotate = opts.rotate; - if (opts.rotate) { - let tempWidth = opts.width; - let tempHeight = opts.height; - opts.width = tempHeight; - opts.height = tempWidth; - } - - //适配高分屏 - opts.padding = opts.padding ? opts.padding : config$$1.padding; - for (let i = 0; i < 4; i++) { - opts.padding[i] *= opts.pixelRatio; - } - config$$1.yAxisWidth = config.yAxisWidth * opts.pixelRatio; - config$$1.xAxisHeight = config.xAxisHeight * opts.pixelRatio; - if (opts.enableScroll && opts.xAxis.scrollShow) { - config$$1.xAxisHeight += 6 * opts.pixelRatio; - } - config$$1.xAxisLineHeight = config.xAxisLineHeight * opts.pixelRatio; - config$$1.fontSize = opts.fontSize; - config$$1.titleFontSize = config.titleFontSize * opts.pixelRatio; - config$$1.subtitleFontSize = config.subtitleFontSize * opts.pixelRatio; - config$$1.toolTipPadding = config.toolTipPadding * opts.pixelRatio; - config$$1.toolTipLineHeight = config.toolTipLineHeight * opts.pixelRatio; - config$$1.columePadding = config.columePadding * opts.pixelRatio; - opts.$this = opts.$this ? opts.$this : this; - - this.context = uni.createCanvasContext(opts.canvasId, opts.$this); - /* 兼容原生H5 - this.context = document.getElementById(opts.canvasId).getContext("2d"); - this.context.setStrokeStyle = function(e){ return this.strokeStyle=e; } - this.context.setLineWidth = function(e){ return this.lineWidth=e; } - this.context.setLineCap = function(e){ return this.lineCap=e; } - this.context.setFontSize = function(e){ return this.font=e+"px sans-serif"; } - this.context.setFillStyle = function(e){ return this.fillStyle=e; } - this.context.draw = function(){ } - */ - - opts.chartData = {}; - this.event = new Event(); - this.scrollOption = { - currentOffset: 0, - startTouchX: 0, - distance: 0, - lastMoveTime: 0 - }; - - this.opts = opts; - this.config = config$$1; - - drawCharts.call(this, opts.type, opts, config$$1, this.context); -}; - -Charts.prototype.updateData = function() { - let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - this.opts = assign({}, this.opts, data); - this.opts.updateData = true; - let scrollPosition = data.scrollPosition || 'current'; - switch (scrollPosition) { - case 'current': - this.opts._scrollDistance_ = this.scrollOption.currentOffset; - break; - case 'left': - this.opts._scrollDistance_ = 0; - this.scrollOption = { - currentOffset: 0, - startTouchX: 0, - distance: 0, - lastMoveTime: 0 - }; - break; - case 'right': - let _calYAxisData = calYAxisData(this.opts.series, this.opts, this.config), - yAxisWidth = _calYAxisData.yAxisWidth; - this.config.yAxisWidth = yAxisWidth; - let offsetLeft = 0; - let _getXAxisPoints0 = getXAxisPoints(this.opts.categories, this.opts, this.config), - xAxisPoints = _getXAxisPoints0.xAxisPoints, - startX = _getXAxisPoints0.startX, - endX = _getXAxisPoints0.endX, - eachSpacing = _getXAxisPoints0.eachSpacing; - let totalWidth = eachSpacing * (xAxisPoints.length - 1); - let screenWidth = endX - startX; - offsetLeft = screenWidth - totalWidth; - this.scrollOption = { - currentOffset: offsetLeft, - startTouchX: offsetLeft, - distance: 0, - lastMoveTime: 0 - }; - this.opts._scrollDistance_ = offsetLeft; - break; - } - drawCharts.call(this, this.opts.type, this.opts, this.config, this.context); -}; - -Charts.prototype.zoom = function() { - var val = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.opts.xAxis.itemCount; - if (this.opts.enableScroll !== true) { - console.log('请启用滚动条后使用!') - return; - } - //当前屏幕中间点 - let centerPoint = Math.round(Math.abs(this.scrollOption.currentOffset) / this.opts.chartData.eachSpacing) + Math.round( - this.opts.xAxis.itemCount / 2); - this.opts.animation = false; - this.opts.xAxis.itemCount = val.itemCount; - //重新计算x轴偏移距离 - let _calYAxisData = calYAxisData(this.opts.series, this.opts, this.config), - yAxisWidth = _calYAxisData.yAxisWidth; - this.config.yAxisWidth = yAxisWidth; - let offsetLeft = 0; - let _getXAxisPoints0 = getXAxisPoints(this.opts.categories, this.opts, this.config), - xAxisPoints = _getXAxisPoints0.xAxisPoints, - startX = _getXAxisPoints0.startX, - endX = _getXAxisPoints0.endX, - eachSpacing = _getXAxisPoints0.eachSpacing; - let centerLeft = eachSpacing * centerPoint; - let screenWidth = endX - startX; - let MaxLeft = screenWidth - eachSpacing * (xAxisPoints.length - 1); - offsetLeft = screenWidth / 2 - centerLeft; - if (offsetLeft > 0) { - offsetLeft = 0; - } - if (offsetLeft < MaxLeft) { - offsetLeft = MaxLeft; - } - this.scrollOption = { - currentOffset: offsetLeft, - startTouchX: offsetLeft, - distance: 0, - lastMoveTime: 0 - }; - this.opts._scrollDistance_ = offsetLeft; - drawCharts.call(this, this.opts.type, this.opts, this.config, this.context); -}; - -Charts.prototype.stopAnimation = function() { - this.animationInstance && this.animationInstance.stop(); -}; - -Charts.prototype.addEventListener = function(type, listener) { - this.event.addEventListener(type, listener); -}; - -Charts.prototype.getCurrentDataIndex = function(e) { - var touches = null; - if (e.changedTouches) { - touches = e.changedTouches[0]; - } else { - touches = e.mp.changedTouches[0]; - } - if (touches) { - let _touches$ = getTouches(touches, this.opts, e); - if (this.opts.type === 'pie' || this.opts.type === 'ring' || this.opts.type === 'rose') { - return findPieChartCurrentIndex({ - x: _touches$.x, - y: _touches$.y - }, this.opts.chartData.pieData); - } else if (this.opts.type === 'radar') { - return findRadarChartCurrentIndex({ - x: _touches$.x, - y: _touches$.y - }, this.opts.chartData.radarData, this.opts.categories.length); - } else if (this.opts.type === 'funnel') { - return findFunnelChartCurrentIndex({ - x: _touches$.x, - y: _touches$.y - }, this.opts.chartData.funnelData); - } else if (this.opts.type === 'map') { - return findMapChartCurrentIndex({ - x: _touches$.x, - y: _touches$.y - }, this.opts); - }else if (this.opts.type === 'word') { - return findWordChartCurrentIndex({ - x: _touches$.x, - y: _touches$.y - }, this.opts.chartData.wordCloudData); - } else { - return findCurrentIndex({ - x: _touches$.x, - y: _touches$.y - }, this.opts.chartData.calPoints, this.opts, this.config, Math.abs(this.scrollOption.currentOffset)); - } - } - return -1; -}; - -Charts.prototype.getLegendDataIndex = function(e) { - var touches = null; - if (e.changedTouches) { - touches = e.changedTouches[0]; - } else { - touches = e.mp.changedTouches[0]; - } - if (touches) { - let _touches$ = getTouches(touches, this.opts, e); - return findLegendIndex({ - x: _touches$.x, - y: _touches$.y - }, this.opts.chartData.legendData); - } - return -1; -}; - -Charts.prototype.touchLegend = function(e) { - var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var touches = null; - if (e.changedTouches) { - touches = e.changedTouches[0]; - } else { - touches = e.mp.changedTouches[0]; - } - if (touches) { - var _touches$ = getTouches(touches, this.opts, e); - var index = this.getLegendDataIndex(e); - if (index >= 0) { - this.opts.series[index].show = !this.opts.series[index].show; - this.opts.animation = option.animation ? true : false; - this.opts._scrollDistance_= this.scrollOption.currentOffset; - drawCharts.call(this, this.opts.type, this.opts, this.config, this.context); - } - } - -}; - -Charts.prototype.showToolTip = function(e) { - var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var touches = null; - if (e.changedTouches) { - touches = e.changedTouches[0]; - } else { - touches = e.mp.changedTouches[0]; - } - if (!touches) { - console.log("touchError"); - } - var _touches$ = getTouches(touches, this.opts, e); - var currentOffset = this.scrollOption.currentOffset; - var opts = assign({}, this.opts, { - _scrollDistance_: currentOffset, - animation: false - }); - if (this.opts.type === 'line' || this.opts.type === 'area' || this.opts.type === 'column') { - var index = option.index==undefined? this.getCurrentDataIndex(e):option.index ; - if (index > -1) { - var seriesData = getSeriesDataItem(this.opts.series, index); - if (seriesData.length !== 0) { - var _getToolTipData = getToolTipData(seriesData, this.opts.chartData.calPoints, index, this.opts.categories,option), - textList = _getToolTipData.textList, - offset = _getToolTipData.offset; - offset.y = _touches$.y; - opts.tooltip = { - textList: option.textList?option.textList:textList, - offset: offset, - option: option, - index: index - }; - } - } - drawCharts.call(this, opts.type, opts, this.config, this.context); - } - if (this.opts.type === 'mix') { - var index = option.index==undefined? this.getCurrentDataIndex(e):option.index ; - if (index > -1) { - var currentOffset = this.scrollOption.currentOffset; - var opts = assign({}, this.opts, { - _scrollDistance_: currentOffset, - animation: false - }); - var seriesData = getSeriesDataItem(this.opts.series, index); - if (seriesData.length !== 0) { - var _getMixToolTipData = getMixToolTipData(seriesData, this.opts.chartData.calPoints, index, this.opts.categories,option), - textList = _getMixToolTipData.textList, - offset = _getMixToolTipData.offset; - offset.y = _touches$.y; - opts.tooltip = { - textList: option.textList?option.textList:textList, - offset: offset, - option: option, - index: index - }; - } - } - drawCharts.call(this, opts.type, opts, this.config, this.context); - } - if (this.opts.type === 'candle') { - var index = option.index==undefined? this.getCurrentDataIndex(e):option.index ; - if (index > -1) { - var currentOffset = this.scrollOption.currentOffset; - var opts = assign({}, this.opts, { - _scrollDistance_: currentOffset, - animation: false - }); - var seriesData = getSeriesDataItem(this.opts.series, index); - if (seriesData.length !== 0) { - var _getToolTipData = getCandleToolTipData(this.opts.series[0].data, seriesData, this.opts.chartData.calPoints, - index, this.opts.categories, this.opts.extra.candle, option), - textList = _getToolTipData.textList, - offset = _getToolTipData.offset; - offset.y = _touches$.y; - opts.tooltip = { - textList: option.textList?option.textList:textList, - offset: offset, - option: option, - index: index - }; - } - } - drawCharts.call(this, opts.type, opts, this.config, this.context); - } - if (this.opts.type === 'pie' || this.opts.type === 'ring' || this.opts.type === 'rose'||this.opts.type === 'funnel' ) { - var index = option.index==undefined? this.getCurrentDataIndex(e):option.index ; - if (index > -1) { - var currentOffset = this.scrollOption.currentOffset; - var opts = assign({}, this.opts, { - _scrollDistance_: currentOffset, - animation: false - }); - var seriesData = this.opts._series_[index]; - var textList = [{ - text: option.format ? option.format(seriesData) : seriesData.name + ': ' + seriesData.data, - color: seriesData.color - }]; - var offset = { - x: _touches$.x, - y: _touches$.y - }; - opts.tooltip = { - textList: option.textList?option.textList:textList, - offset: offset, - option: option, - index: index - }; - } - drawCharts.call(this, opts.type, opts, this.config, this.context); - } - if (this.opts.type === 'map'||this.opts.type === 'word') { - var index = option.index==undefined? this.getCurrentDataIndex(e):option.index ; - if (index > -1) { - var currentOffset = this.scrollOption.currentOffset; - var opts = assign({}, this.opts, { - _scrollDistance_: currentOffset, - animation: false - }); - var seriesData = this.opts._series_[index]; - var textList = [{ - text: option.format ? option.format(seriesData) : seriesData.properties.name , - color: seriesData.color - }]; - var offset = { - x: _touches$.x, - y: _touches$.y - }; - opts.tooltip = { - textList: option.textList?option.textList:textList, - offset: offset, - option: option, - index: index - }; - } - opts.updateData = false; - drawCharts.call(this, opts.type, opts, this.config, this.context); - } - if (this.opts.type === 'radar') { - var index = option.index==undefined? this.getCurrentDataIndex(e):option.index ; - if (index > -1) { - var currentOffset = this.scrollOption.currentOffset; - var opts = assign({}, this.opts, { - _scrollDistance_: currentOffset, - animation: false - }); - var seriesData = getSeriesDataItem(this.opts.series, index); - if (seriesData.length !== 0) { - var textList = seriesData.map(function(item) { - return { - text: option.format ? option.format(item) : item.name + ': ' + item.data, - color: item.color - }; - }); - var offset = { - x: _touches$.x, - y: _touches$.y - }; - opts.tooltip = { - textList: option.textList?option.textList:textList, - offset: offset, - option: option, - index: index - }; - } - } - drawCharts.call(this, opts.type, opts, this.config, this.context); - } -}; - -Charts.prototype.translate = function(distance) { - this.scrollOption = { - currentOffset: distance, - startTouchX: distance, - distance: 0, - lastMoveTime: 0 - }; - let opts = assign({}, this.opts, { - _scrollDistance_: distance, - animation: false - }); - drawCharts.call(this, this.opts.type, opts, this.config, this.context); -}; - -Charts.prototype.scrollStart = function(e) { - var touches = null; - if (e.changedTouches) { - touches = e.changedTouches[0]; - } else { - touches = e.mp.changedTouches[0]; - } - var _touches$ = getTouches(touches, this.opts, e); - if (touches && this.opts.enableScroll === true) { - this.scrollOption.startTouchX = _touches$.x; - } -}; - -Charts.prototype.scroll = function(e) { - if (this.scrollOption.lastMoveTime === 0) { - this.scrollOption.lastMoveTime = Date.now(); - } - let Limit = this.opts.extra.touchMoveLimit || 20; - let currMoveTime = Date.now(); - let duration = currMoveTime - this.scrollOption.lastMoveTime; - if (duration < Math.floor(1000 / Limit)) return; - this.scrollOption.lastMoveTime = currMoveTime; - var touches = null; - if (e.changedTouches) { - touches = e.changedTouches[0]; - } else { - touches = e.mp.changedTouches[0]; - } - if (touches && this.opts.enableScroll === true) { - var _touches$ = getTouches(touches, this.opts, e); - var _distance; - _distance = _touches$.x - this.scrollOption.startTouchX; - var currentOffset = this.scrollOption.currentOffset; - var validDistance = calValidDistance(this,currentOffset + _distance, this.opts.chartData, this.config, this.opts); - this.scrollOption.distance = _distance = validDistance - currentOffset; - var opts = assign({}, this.opts, { - _scrollDistance_: currentOffset + _distance, - animation: false - }); - drawCharts.call(this, opts.type, opts, this.config, this.context); - return currentOffset + _distance; - } -}; - -Charts.prototype.scrollEnd = function(e) { - if (this.opts.enableScroll === true) { - var _scrollOption = this.scrollOption, - currentOffset = _scrollOption.currentOffset, - distance = _scrollOption.distance; - this.scrollOption.currentOffset = currentOffset + distance; - this.scrollOption.distance = 0; - } -}; -if (typeof module === "object" && typeof module.exports === "object") { - module.exports = Charts; - //export default Charts;//建议使用nodejs的module导出方式,如报错请使用export方式导出 -} diff --git a/components/u-charts/u-charts.min.js b/components/u-charts/u-charts.min.js deleted file mode 100644 index 0b429f3..0000000 --- a/components/u-charts/u-charts.min.js +++ /dev/null @@ -1 +0,0 @@ -'use strict';var config={yAxisWidth:15,yAxisSplit:5,xAxisHeight:15,xAxisLineHeight:15,legendHeight:15,yAxisTitleWidth:15,padding:[10,10,10,10],pixelRatio:1,rotate:!1,columePadding:3,fontSize:13,dataPointShape:["circle","circle","circle","circle"],colors:["#1890ff","#2fc25b","#facc14","#f04864","#8543e0","#90ed7d"],pieChartLinePadding:15,pieChartTextPadding:5,xAxisTextPadding:3,titleColor:"#333333",titleFontSize:20,subtitleColor:"#999999",subtitleFontSize:15,toolTipPadding:3,toolTipBackground:"#000000",toolTipOpacity:.7,toolTipLineHeight:20,radarLabelTextMargin:15,gaugeLabelTextMargin:15};let assign=function(e,...t){function i(e,t){for(let a in t)e[a]=e[a]&&"[object Object]"===e[a].toString()?i(e[a],t[a]):e[a]=t[a];return e}if(null==e)throw new TypeError("Cannot convert undefined or null to object");return!t||0>=t.length?e:(t.forEach(t=>{e=i(e,t)}),e)};var util={toFixed:function(e,t){return t=t||2,this.isFloat(e)&&(e=e.toFixed(t)),e},isFloat:function(e){return 0!=e%1},approximatelyEqual:function(e,t){return 1e-10>Math.abs(e-t)},isSameSign:function(e,t){var i=Math.abs;return i(e)===e&&i(t)===t||i(e)!==e&&i(t)!==t},isSameXCoordinateArea:function(e,t){return this.isSameSign(e.x,t.x)},isCollision:function(e,t){e.end={},e.end.x=e.start.x+e.width,e.end.y=e.start.y-e.height,t.end={},t.end.x=t.start.x+t.width,t.end.y=t.start.y-t.height;var i=t.start.x>e.end.x||t.end.xe.start.y||t.start.yi;)i*=10,a*=10;for(e="upper"===t?Math.ceil(e*a):Math.floor(e*a);0!=e%i;)"upper"===t?e++:e--;return e/a}function calCandleMA(e,t,i,a){let o=[];for(let n,l=0;l=l-n&&(r=n-l,e.event.trigger("scrollRight")),r}function isInAngleRange(e,t,i){function a(e){for(;0>e;)e+=2*o;for(;e>2*o;)e-=2*o;return e}var o=Math.PI;return e=a(e),t=a(t),i=a(i),t>i&&(i+=2*o,e=t&&e<=i}function calRotateTranslate(e,t,i){var a=e,o=i-t,n=a+(i-o-a)/1.4142135623730951;n*=-1;return{transX:n,transY:(i-o)*(1.4142135623730951-1)-(i-o-a)/1.4142135623730951}}function createCurveControlPoints(e,t){function i(e,t){return!!(e[t-1]&&e[t+1])&&(e[t].y>=l(e[t-1].y,e[t+1].y)||e[t].y<=n(e[t-1].y,e[t+1].y))}function o(e,t){return!!(e[t-1]&&e[t+1])&&(e[t].x>=l(e[t-1].x,e[t+1].x)||e[t].x<=n(e[t-1].x,e[t+1].x))}var n=Math.min,l=Math.max,r=.2,a=.2,s=null,d=null,h=null,x=null;if(1>t?(s=e[0].x+(e[1].x-e[0].x)*r,d=e[0].y+(e[1].y-e[0].y)*r):(s=e[t].x+(e[t+1].x-e[t-1].x)*r,d=e[t].y+(e[t+1].y-e[t-1].y)*r),t>e.length-3){var c=e.length-1;h=e[c].x-(e[c].x-e[c-1].x)*a,x=e[c].y-(e[c].y-e[c-1].y)*a}else h=e[t+1].x-(e[t+2].x-e[t].x)*a,x=e[t+1].y-(e[t+2].y-e[t].y)*a;return i(e,t+1)&&(x=e[t+1].y),i(e,t)&&(d=e[t].y),o(e,t+1)&&(h=e[t+1].x),o(e,t)&&(s=e[t].x),(d>=l(e[t].y,e[t+1].y)||d<=n(e[t].y,e[t+1].y))&&(d=e[t].y),(x>=l(e[t].y,e[t+1].y)||x<=n(e[t].y,e[t+1].y))&&(x=e[t+1].y),(s>=l(e[t].x,e[t+1].x)||s<=n(e[t].x,e[t+1].x))&&(s=e[t].x),(h>=l(e[t].x,e[t+1].x)||h<=n(e[t].x,e[t+1].x))&&(h=e[t+1].x),{ctrA:{x:s,y:d},ctrB:{x:h,y:x}}}function convertCoordinateOrigin(e,t,i){return{x:i.x+e,y:i.y-t}}function avoidCollision(e,t){if(t)for(;util.isCollision(e,t);)0e.start.x?e.start.y++:0t.data[1]-t.data[0]?s[1]=r:s[1]=l:(t.data[0]e[o-1][1]&&(s[2]=l),t.data[3]t&&(n=i)})}return n}function findLegendIndex(e,t){let i=-1;if(isInExactLegendArea(e,t.area)){let a=t.points,o=-1;for(let t,n=0,l=a.length;nn[0]&&e.xn[1]&&e.yt.start.x&&e.xt.start.y&&e.y=t.area[3]-10&&e.y>=t.area[0]&&e.y<=t.height-t.area[2]}function findRadarChartCurrentIndex(e,t,i){var a=Math.PI,o=2*a/i,n=-1;if(isInExactPieChartArea(e,t.center,t.radius)){var l=function(e){return 0>e&&(e+=2*a),e>2*a&&(e-=2*a),e},r=Math.atan2(t.center.y-e.y,e.x-t.center.x);r=-1*r,0>r&&(r+=2*a);var s=t.angleList.map(function(e){return e=l(-1*e),e});s.forEach(function(e,t){var i=l(e-o/2),s=l(e+o/2);s=i&&r<=s||r+2*a>=i&&r+2*a<=s)&&(n=t)})}return n}function findFunnelChartCurrentIndex(e,t){for(var a,o=-1,n=0,l=t.series.length;na.funnelArea[0]&&e.xa.funnelArea[1]&&e.ya.area[0]&&e.xa.area[1]&&e.yt.width-t.padding[1]-t.padding[3]?(a.push(g),p.push(n-t.legend.itemGap),n=l,g=[i]):(n+=l,g.push(i))}if(g.length){a.push(g),p.push(n-t.legend.itemGap),l.widthArr=p;let e=o.apply(null,p);switch(t.legend.float){case"left":l.area.start.x=t.padding[3],l.area.end.x=t.padding[3]+2*r;break;case"right":l.area.start.x=t.width-t.padding[1]-e-2*r,l.area.end.x=t.width-t.padding[1];break;default:l.area.start.x=(t.width-e)/2-r,l.area.end.x=(t.width+e)/2+r;}l.area.width=e+2*r,l.area.wholeWidth=e+2*r,l.area.height=a.length*c+2*r,l.area.wholeHeight=a.length*c+2*r+2*s,l.points=a}}else{let i=e.length,a=t.height-t.padding[0]-t.padding[2]-2*s-2*r,o=Math.min(n(a/c),i);switch(l.area.height=o*c+2*r,l.area.wholeHeight=o*c+2*r,t.legend.float){case"top":l.area.start.y=t.padding[0]+s,l.area.end.y=t.padding[0]+s+l.area.height;break;case"bottom":l.area.start.y=t.height-t.padding[2]-s-l.area.height,l.area.end.y=t.height-t.padding[2]-s;break;default:l.area.start.y=(t.height-l.area.height)/2,l.area.end.y=(t.height+l.area.height)/2;}let p=0==i%o?i/o:n(i/o+1),g=[];for(let t,a=0;aa&&(a=e);l.widthArr.push(a),l.heightArr.push(i.length*c+2*r)}let e=0;for(let t=0;ta&&(o.angle=45*Math.PI/180,o.xAxisHeight=2*i.xAxisTextPadding+l*Math.sin(o.angle)),o}function getXAxisTextList(e,t){var a=Math.min,o=Math.max,n=4n&&(a.angle=45*Math.PI/180,a.xAxisHeight=2*i.xAxisTextPadding+r*Math.sin(a.angle)),!0===t.xAxis.disabled&&(a.xAxisHeight=0),a}function getRadarDataPoints(e,t,i,a,o){var n=Math.max,l=5=a.oldData?(n._endAngle_-n._oldAngle_)*o+a.oldAngle:n._oldAngle_-(n._oldAngle_-n._endAngle_)*o,2<=n._proportion_&&(n._proportion_%=2)}return e}function getPieTextMaxLength(e){e=getPieDataPoints(e);let t=0;for(let a=0;a=e.width&&(e.width=1),e.x+=(a+.5-i/2)*e.width,e)})}function fixColumeMeterData(e,t,i,a,o,n,l){return e.map(function(e){return null===e?null:(e.width=Math.ceil((t-2*o.columePadding)/2),n.extra.column&&n.extra.column.width&&0<+n.extra.column.width&&(e.width=Math.min(e.width,+n.extra.column.width)),0s.x&&(h-=measureText(a.categories[r]||"")),n.beginPath(),n.setFontSize(o.fontSize),n.setFillStyle(l.labelColor||"#666666"),n.fillText(a.categories[r]||"",h,x+o.fontSize/2),n.closePath(),n.stroke()})}function drawPieText(e,t,a,o,i,n){var l=Math.cos,r=Math.sin,s=Math.min,d=Math.max,h=Math.PI,x=a.pieChartLinePadding,c=[],p=null,g=e.map(function(e){var t=e.format?e.format(+e._proportion_.toFixed(2)):util.toFixed(100*e._proportion_.toFixed(4))+"%";e._rose_proportion_&&(e._proportion_=e._rose_proportion_);var i=2*h-(e._start_+2*h*e._proportion_/2),a=e.color,o=e._radius_;return{arc:i,text:t,color:a,radius:o,textColor:e.textColor,textSize:e.textSize}});for(let h=0;ht?m=d(f,p.start.y):0y&&(y-=u);let S={lineStart:{x:o,y:n},lineEnd:{x:t,y:i},start:{x:y,y:m},width:u,height:a.fontSize,text:e.text,color:e.color,textColor:e.textColor,textSize:e.textSize};p=avoidCollision(S,p),c.push(p)}for(let l=0;le.start.x?s.x+e.width:s.x,x=0>e.start.x?s.x-5:s.x+5;o.quadraticCurveTo(r.x,r.y,d,s.y),o.moveTo(i.x,i.y),o.stroke(),o.closePath(),o.beginPath(),o.moveTo(s.x+e.width,s.y),o.arc(d,s.y,2,0,2*h),o.closePath(),o.fill(),o.beginPath(),o.setFontSize(e.textSize||a.fontSize),o.setFillStyle(e.textColor||"#666666"),o.fillText(e.text,x,s.y+3),o.closePath(),o.stroke(),o.closePath()}}function drawToolTipSplitLine(e,t,i,a){var o=t.extra.tooltip||{};o.gridType=null==o.gridType?"solid":o.gridType,o.dashLength=null==o.dashLength?4:o.dashLength;var n=t.area[0],l=t.height-t.area[2];if("dash"==o.gridType&&a.setLineDash([o.dashLength,o.dashLength]),a.setStrokeStyle(o.gridColor||"#cccccc"),a.setLineWidth(1*t.pixelRatio),a.beginPath(),a.moveTo(e,n),a.lineTo(e,l),a.stroke(),a.setLineDash([]),o.xAxisLabel){let n=t.categories[t.tooltip.index];a.setFontSize(i.fontSize);let r=measureText(n,i.fontSize),s=e-.5*r,d=l;a.beginPath(),a.setFillStyle(hexToRgb(o.labelBgColor||i.toolTipBackground,o.labelBgOpacity||i.toolTipOpacity)),a.setStrokeStyle(o.labelBgColor||i.toolTipBackground),a.setLineWidth(1*t.pixelRatio),a.rect(s-i.toolTipPadding,d,r+2*i.toolTipPadding,i.fontSize+2*i.toolTipPadding),a.closePath(),a.stroke(),a.fill(),a.beginPath(),a.setFontSize(i.fontSize),a.setFillStyle(o.labelFontColor||i.fontColor),a.fillText(n+"",s,d+i.toolTipPadding+i.fontSize),a.closePath(),a.stroke()}}function drawMarkLine(e,t,a){let o=assign({},{type:"solid",dashLength:4,data:[]},e.extra.markLine),n=e.area[3],l=e.width-e.area[1],r=calMarkLineData(o.data,e);for(let s,d=0;di.width&&(h=!0),p+t.y>i.height&&(t.y=i.height-p),o.beginPath(),o.setFillStyle(hexToRgb(l.bgColor||a.toolTipBackground,l.bgOpacity||a.toolTipOpacity)),h?(o.moveTo(t.x,t.y+10*i.pixelRatio),o.lineTo(t.x-d,t.y+10*i.pixelRatio-5*i.pixelRatio),o.lineTo(t.x-d,t.y),o.lineTo(t.x-d-n(c),t.y),o.lineTo(t.x-d-n(c),t.y+p),o.lineTo(t.x-d,t.y+p),o.lineTo(t.x-d,t.y+10*i.pixelRatio+5*i.pixelRatio),o.lineTo(t.x,t.y+10*i.pixelRatio)):(o.moveTo(t.x,t.y+10*i.pixelRatio),o.lineTo(t.x+d,t.y+10*i.pixelRatio-5*i.pixelRatio),o.lineTo(t.x+d,t.y),o.lineTo(t.x+d+n(c),t.y),o.lineTo(t.x+d+n(c),t.y+p),o.lineTo(t.x+d,t.y+p),o.lineTo(t.x+d,t.y+10*i.pixelRatio+5*i.pixelRatio),o.lineTo(t.x,t.y+10*i.pixelRatio)),o.closePath(),o.fill(),e.forEach(function(e,i){if(null!==e.color){o.beginPath(),o.setFillStyle(e.color);var n=t.x+d+2*a.toolTipPadding,l=t.y+(a.toolTipLineHeight-a.fontSize)/2+a.toolTipLineHeight*i+a.toolTipPadding+1;h&&(n=t.x-c-d+2*a.toolTipPadding),o.fillRect(n,l,r,a.fontSize),o.closePath()}}),e.forEach(function(e,i){var n=t.x+d+2*a.toolTipPadding+r+s;h&&(n=t.x-c-d+2*a.toolTipPadding+ +r+s);var x=t.y+(a.toolTipLineHeight-a.fontSize)/2+a.toolTipLineHeight*i+a.toolTipPadding;o.beginPath(),o.setFontSize(a.fontSize),o.setFillStyle(l.fontColor),o.fillText(e.text,n,x+a.fontSize),o.closePath(),o.stroke()}))}function drawYAxisTitle(e,t,i,a){var o=i.xAxisHeight+(t.height-i.xAxisHeight-measureText(e))/2;a.save(),a.beginPath(),a.setFontSize(i.fontSize),a.setFillStyle(t.yAxis.titleFontColor||"#333333"),a.translate(0,t.height),a.rotate(-90*Math.PI/180),a.fillText(e,o,t.padding[3]+.5*i.fontSize),a.closePath(),a.stroke(),a.restore()}function drawColumnDataPoints(e,t,i,a){let o=4h&&oh&&oh&&oh&&op&&(o.moveTo(i.x,i.y),e=1),0p&&i.xx&&tx&&(a.moveTo(e.x,e.y),i=1),0x&&e.xx&&(a.moveTo(e.x,e.y),i=1),0x&&e.xx&&(a.moveTo(t.x,t.y),e=1),0x&&t.xx&&(a.moveTo(t.x,t.y),e=1),0x&&t.xh&&(a.moveTo(o.x,o.y),i=1),0h&&o.xh&&(a.moveTo(t.x,t.y),i=1),0h&&t.xc&&ng&&(a.moveTo(e.x,e.y),i=1),0g&&e.xg&&(a.moveTo(e.x,e.y),i=1),0g&&e.xg&&(a.moveTo(e.x,e.y),t=1),0g&&e.xg&&(a.moveTo(e.x,e.y),t=1),0g&&e.xt._scrollDistance_&&o.fillRect(0,0,l,d),!0==t.enableScroll&&o.fillRect(r,0,t.width,d),o.closePath(),o.stroke();var h=[];for(let l=0;l<=t.yAxis.splitNumber;l++)h.push(t.area[0]+n*l);let x=t.area[3],c=t.width-t.area[1];for(let n,l=0;le/f?o.setStrokeStyle(hexToRgb(t[0].color,1)):o.setStrokeStyle(hexToRgb(t[0].color,.3)),o.setLineWidth(3*a.pixelRatio),o.moveTo(g,0),o.lineTo(y,0),o.stroke(),o.rotate(p*n);o.restore(),t=getArcbarDataPoints(t,r,l),o.setLineWidth(r.width),o.setStrokeStyle(t[0].color),o.setLineCap("round"),o.beginPath(),o.arc(s.x,s.y,h,r.startAngle*n,t[0]._proportion_*n,!1),o.stroke();let m=d-2.5*r.width;o.save(),o.translate(s.x,s.y),o.rotate((t[0]._proportion_-1)*n),o.beginPath(),o.setLineWidth(r.width/3);let S=o.createLinearGradient(0,.6*-m,0,.6*m);S.addColorStop("0",hexToRgb("#FFFFFF",0)),S.addColorStop("0.5",hexToRgb(t[0].color,1)),S.addColorStop("1.0",hexToRgb("#FFFFFF",0)),o.setStrokeStyle(S),o.arc(0,0,m,.85*n,1.15*n,!1),o.stroke(),o.beginPath(),o.setLineWidth(1),o.setStrokeStyle(t[0].color),o.setFillStyle(t[0].color),o.moveTo(-m-r.width/3/2,-4),o.lineTo(-m-r.width/3/2-4,0),o.lineTo(-m-r.width/3/2,4),o.lineTo(-m-r.width/3/2,-4),o.stroke(),o.fill(),o.restore()}else{o.setLineWidth(r.width),o.setLineCap("butt");for(let t,a=0;at[l].area[2]||e[1]>t[l].area[3]||e[2]e[0]||0>e[1]||e[2]>a||e[3]>o){n=!0;break}else n=!1;return n}function getBoundingBox(e){var t,a={};a.xMin=180,a.xMax=0,a.yMin=90,a.yMax=0;for(var o,n=0;nh.x?a.xMax:h.x,a.yMin=a.yMinh.y?a.yMax:h.y}}}return a}function coordinateToPoint(e,t,i,a,o,n){return{x:(t-i.xMin)*a+o,y:(i.yMax-e)*a+n}}function pointToCoordinate(e,t,i,a,o,n){return{x:(t-o)/a+i.xMin,y:i.yMax-(e-n)/a}}function isRayIntersectsSegment(e,t,i){if(t[1]==i[1])return!1;if(t[1]>e[1]&&i[1]>e[1])return!1;if(t[1]e[1])return!1;if(i[1]==e[1]&&t[1]>e[1])return!1;if(t[0](e/=.5)?.5*t(e,3):.5*(t(e-2,3)+2)},linear:function(e){return e}};function Animation(e){this.isStop=!1,e.duration="undefined"==typeof e.duration?1e3:e.duration,e.timing=e.timing||"linear";var t=function(){return"undefined"==typeof setTimeout?"undefined"==typeof requestAnimationFrame?function(e){e(null)}:requestAnimationFrame:function(e,t){setTimeout(function(){var t=+new Date;e(t)},t)}}(),i=null,a=function(o){if(null===o||!0===this.isStop)return e.onProcess&&e.onProcess(1),void(e.onAnimationFinish&&e.onAnimationFinish());if(null===i&&(i=o),o-io;o++)t.area[o]=t.padding[o];var d=calLegendData(s,t,a,t.chartData),h=d.area.wholeHeight,x=d.area.wholeWidth;switch(t.legend.position){case"top":t.area[0]+=h;break;case"bottom":t.area[2]+=h;break;case"left":t.area[3]+=x;break;case"right":t.area[1]+=x;}let c={},p=0;if("line"===t.type||"column"===t.type||"area"===t.type||"mix"===t.type||"candle"===t.type){if(c=calYAxisData(n,t,a),p=c.yAxisWidth,t.yAxis.showTitle){let e=0;for(let o=0;ot;t++)e.padding[t]*=e.pixelRatio;t.yAxisWidth=config.yAxisWidth*e.pixelRatio,t.xAxisHeight=config.xAxisHeight*e.pixelRatio,e.enableScroll&&e.xAxis.scrollShow&&(t.xAxisHeight+=6*e.pixelRatio),t.xAxisLineHeight=config.xAxisLineHeight*e.pixelRatio,t.fontSize=e.fontSize,t.titleFontSize=config.titleFontSize*e.pixelRatio,t.subtitleFontSize=config.subtitleFontSize*e.pixelRatio,t.toolTipPadding=config.toolTipPadding*e.pixelRatio,t.toolTipLineHeight=config.toolTipLineHeight*e.pixelRatio,t.columePadding=config.columePadding*e.pixelRatio,e.$this=e.$this?e.$this:this,this.context=uni.createCanvasContext(e.canvasId,e.$this),e.chartData={},this.event=new Event,this.scrollOption={currentOffset:0,startTouchX:0,distance:0,lastMoveTime:0},this.opts=e,this.config=t,drawCharts.call(this,e.type,e,t,this.context)};Charts.prototype.updateData=function(){let e=0 - .canvas{ - width: 100%; - } - - - diff --git a/components/uchartComponents/area-scroll.vue b/components/uchartComponents/area-scroll.vue deleted file mode 100644 index 4e6bd94..0000000 --- a/components/uchartComponents/area-scroll.vue +++ /dev/null @@ -1,143 +0,0 @@ - - - diff --git a/components/uchartComponents/column-scroll.vue b/components/uchartComponents/column-scroll.vue deleted file mode 100644 index 1e46ffd..0000000 --- a/components/uchartComponents/column-scroll.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - diff --git a/components/uchartComponents/line-scroll.vue b/components/uchartComponents/line-scroll.vue deleted file mode 100644 index 496c63a..0000000 --- a/components/uchartComponents/line-scroll.vue +++ /dev/null @@ -1,175 +0,0 @@ - - - diff --git a/components/uchartComponents/ring.vue b/components/uchartComponents/ring.vue deleted file mode 100644 index 0fbf178..0000000 --- a/components/uchartComponents/ring.vue +++ /dev/null @@ -1,123 +0,0 @@ - - - diff --git a/components/uchartComponents/rotate-scroll.vue b/components/uchartComponents/rotate-scroll.vue deleted file mode 100644 index 8b59b05..0000000 --- a/components/uchartComponents/rotate-scroll.vue +++ /dev/null @@ -1,131 +0,0 @@ - - - diff --git a/components/uni-ui/signal/signal.vue b/components/uni-ui/signal/signal.vue deleted file mode 100644 index 7f459bd..0000000 --- a/components/uni-ui/signal/signal.vue +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - diff --git a/components/uni-ui/uni-icons/icons.js b/components/uni-ui/uni-icons/icons.js deleted file mode 100644 index 1f5a778..0000000 --- a/components/uni-ui/uni-icons/icons.js +++ /dev/null @@ -1,96 +0,0 @@ -export default { - 'contact': '\ue100', - 'person': '\ue101', - 'personadd': '\ue102', - 'contact-filled': '\ue130', - 'person-filled': '\ue131', - 'personadd-filled': '\ue132', - 'phone': '\ue200', - 'email': '\ue201', - 'chatbubble': '\ue202', - 'chatboxes': '\ue203', - 'phone-filled': '\ue230', - 'email-filled': '\ue231', - 'chatbubble-filled': '\ue232', - 'chatboxes-filled': '\ue233', - 'weibo': '\ue260', - 'weixin': '\ue261', - 'pengyouquan': '\ue262', - 'chat': '\ue263', - 'qq': '\ue264', - 'videocam': '\ue300', - 'camera': '\ue301', - 'mic': '\ue302', - 'location': '\ue303', - 'mic-filled': '\ue332', - 'speech': '\ue332', - 'location-filled': '\ue333', - 'micoff': '\ue360', - 'image': '\ue363', - 'map': '\ue364', - 'compose': '\ue400', - 'trash': '\ue401', - 'upload': '\ue402', - 'download': '\ue403', - 'close': '\ue404', - 'redo': '\ue405', - 'undo': '\ue406', - 'refresh': '\ue407', - 'star': '\ue408', - 'plus': '\ue409', - 'minus': '\ue410', - 'circle': '\ue411', - 'checkbox': '\ue411', - 'close-filled': '\ue434', - 'clear': '\ue434', - 'refresh-filled': '\ue437', - 'star-filled': '\ue438', - 'plus-filled': '\ue439', - 'minus-filled': '\ue440', - 'circle-filled': '\ue441', - 'checkbox-filled': '\ue442', - 'closeempty': '\ue460', - 'refreshempty': '\ue461', - 'reload': '\ue462', - 'starhalf': '\ue463', - 'spinner': '\ue464', - 'spinner-cycle': '\ue465', - 'search': '\ue466', - 'plusempty': '\ue468', - 'forward': '\ue470', - 'back': '\ue471', - 'left-nav': '\ue471', - 'checkmarkempty': '\ue472', - 'home': '\ue500', - 'navigate': '\ue501', - 'gear': '\ue502', - 'paperplane': '\ue503', - 'info': '\ue504', - 'help': '\ue505', - 'locked': '\ue506', - 'more': '\ue507', - 'flag': '\ue508', - 'home-filled': '\ue530', - 'gear-filled': '\ue532', - 'info-filled': '\ue534', - 'help-filled': '\ue535', - 'more-filled': '\ue537', - 'settings': '\ue560', - 'list': '\ue562', - 'bars': '\ue563', - 'loop': '\ue565', - 'paperclip': '\ue567', - 'eye': '\ue568', - 'arrowup': '\ue580', - 'arrowdown': '\ue581', - 'arrowleft': '\ue582', - 'arrowright': '\ue583', - 'arrowthinup': '\ue584', - 'arrowthindown': '\ue585', - 'arrowthinleft': '\ue586', - 'arrowthinright': '\ue587', - 'pulldown': '\ue588', - 'closefill': '\ue589', - 'sound': '\ue590', - 'scan': '\ue612' -} diff --git a/components/uni-ui/uni-icons/uni-icons.vue b/components/uni-ui/uni-icons/uni-icons.vue deleted file mode 100644 index 85b4180..0000000 --- a/components/uni-ui/uni-icons/uni-icons.vue +++ /dev/null @@ -1,57 +0,0 @@ - - - - - diff --git a/main.js b/main.js index 9e7ee17..60f5fa0 100644 --- a/main.js +++ b/main.js @@ -4,19 +4,15 @@ import api from '@/common/api/api.js' import {post,get,DELETE,put} from "@/common/api/request.js" import config from "@/common/api/config.js" import store from "@/store/index" -import utils from './utils/utils.js' Vue.config.productionTip = false App.mpType = 'app' // main.js import uView from 'uview-ui'; -import tuiIcon from "@/components/icon/icon.vue"; import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue"; import MescrollUni from "@/components/mescroll-uni/mescroll-uni.vue"; Vue.use(uView); -Vue.component('tuiIcon', tuiIcon); Vue.component('mescroll-body', MescrollBody); Vue.component('mescroll-uni', MescrollUni); -import tools from '@/utils/tools' const tui = { toast: function(text, duration, success) { uni.showToast({ @@ -26,16 +22,12 @@ const tui = { }) } } -import { throttle } from './utils/publicMethods'; Vue.prototype.$api = api; Vue.prototype.$post = post; Vue.prototype.$get = get; Vue.prototype.$DELETE = DELETE; Vue.prototype.$put = put; Vue.prototype.$config = config; -Vue.prototype.$tools = tools; -Vue.prototype.$utils = utils; -Vue.prototype.$throttle = throttle; Vue.prototype.$tui = tui; Vue.prototype.$store = store; const app = new Vue({ diff --git a/pages.json b/pages.json index 17fa7bb..6ea0085 100644 --- a/pages.json +++ b/pages.json @@ -17,13 +17,6 @@ "navigationBarBackgroundColor": "#1890ff" } }, - { - "path": "pages/auth/login", - "style": { - "navigationBarTitleText": "登录", - "navigationBarBackgroundColor": "#1890ff" - } - }, { "path": "pages/tabBar/new", "style": { @@ -46,22 +39,6 @@ } }, { - "path": "pages/tabBar/home", - "style": { - "navigationBarTitleText": "首页" - // "navigationStyle": "custom" - } - }, { - "path": "pages/tabBar/project", - "style": { - "navigationBarTitleText": "项目" - } - }, { - "path": "pages/tabBar/alarm", - "style": { - "navigationBarTitleText": "实时报警" - } - }, { "path": "pages/tabBar/my", "style": { "navigationBarTitleText": "我的" @@ -71,556 +48,15 @@ ], "subPackages": [ - // { - // "root": "pages/auth/", - // "pages": [ - // // { - // // "path": "login", - // // "style": { - // // "navigationBarTitleText": "登入" - // // } - // // }, - // { - // "path": "registerGuide", - // "style": { - // "navigationBarTitleText": "选择用户" - // } - // }, { - // "path": "userRegister", - // "style": { - // "navigationBarTitleText": "用户注册" - // } - // }, { - // "path": "companyRegister", - // "style": { - // "navigationBarTitleText": "企业注册" - // } - // }, { - // "path": "forgotPassword", - // "style": { - // "navigationBarTitleText": "忘记密码" - // } - // }, { - // "path": "registerLoading", - // "style": { - // "navigationBarTitleText": "用户注册" - // } - // }] - // }, - { - "root": "pages/home/more/", - "pages": [{ - "path": "moreNavBar", - "style": { - "navigationBarTitleText": "全部应用" - // "navigationStyle": "custom" - } - }] - }, - { - "root": "pages/battery/", - "pages": [{ - "path": "battery-info", - "style": { - "navigationBarTitleText": "电池详情" - // "navigationStyle": "custom" - } - }] - }, - { - "root": "pages/tabBar/my/", - "pages": [{ - "path": "setup", - "style": { - "navigationBarTitleText": "设置" - // "navigationStyle": "custom" - } - }, { - "path": "maintenanceRecord", - "style": { - "navigationBarTitleText": "维保记录", - "navigationBarBackgroundColor": "#fff" - } - }, { - "path": "help", - "style": { - "navigationBarTitleText": "帮助" - } - }, { - "path": "about", - "style": { - "navigationBarTitleText": "关于" - } - }, { - "path": "newAlarmRemind", - "style": { - "navigationBarTitleText": "新警报提醒" - } - }, { - "path": "projectServe", - "style": { - "navigationBarTitleText": "工程服务", - "navigationBarBackgroundColor": "#fff" - } - }, { - "path": "addMaintenancePeople", - "style": { - "navigationBarTitleText": "添加维保人员" - } - }, { - "path": "onlineServe", - "style": { - "navigationBarTitleText": "联系我们", - "navigationBarBackgroundColor": "#0066cc" - } - }, { - "path": "aboutUs", - "style": { - "navigationBarTitleText": "关注我们" - } - }, { - "path": "privacyPolicy", - "style": { - "navigationBarTitleText": "隐私政策" - } - }, { - "path": "userPolicy", - "style": { - "navigationBarTitleText": "用户协议" - } - }] - }, { - "root": "pages/home/smoke/", - "pages": [{ - "path": "index", - "style": { - "navigationBarTitleText": "烟雾" - // "navigationStyle": "custom" - } - }] - }, { - "root": "pages/home/temperature/", - "pages": [{ - "path": "index", - "style": { - "navigationBarTitleText": "温湿度", - "navigationBarBackgroundColor": "#1c9aff" - // "navigationStyle": "custom" - } - }, { - "path": "device", - "style": { - "navigationBarTitleText": "设备", - "navigationBarBackgroundColor": "#fff" - } - }, { - "path": "deviceDetail", - "style": { - "navigationBarTitleText": "设备详情" - } - }, { - "path": "alarmCenter", - "style": { - "navigationBarTitleText": "告警中心", - "navigationBarBackgroundColor": "#fff" - } - }, { - "path": "placeManage", - "style": { - "navigationBarTitleText": "场所管理", - "navigationBarBackgroundColor": "#fff" - } - }, { - "path": "placeDetail", - "style": { - "navigationBarTitleText": "场所详情" - } - }] - }, { - "root": "pages/home/waterLevel/", - "pages": [{ - "path": "index", - "style": { - "navigationBarTitleText": "水位水压", - "navigationBarBackgroundColor": "#1c9aff" - } - }, { - "path": "realTime", - "style": { - "navigationBarTitleText": "实时数据", - "navigationBarBackgroundColor": "#1c9aff" - } - }, { - "path": "device", - "style": { - "navigationBarTitleText": "设备", - "navigationBarBackgroundColor": "#fff" - } - }, { - "path": "deviceDetail", - "style": { - "navigationBarTitleText": "设备详情" - } - }, { - "path": "alarmCenter", - "style": { - "navigationBarTitleText": "告警中心", - "navigationBarBackgroundColor": "#fff" - } - }, { - "path": "placeManage", - "style": { - "navigationBarTitleText": "场所管理", - "navigationBarBackgroundColor": "#fff" - } - }, { - "path": "placeDetail", - "style": { - "navigationBarTitleText": "场所详情" - } - }] - }, - { - "root": "pages/home/wisdomElectricity/", - "pages": [{ - "path": "index", - "style": { - "navigationBarTitleText": "全部", - "navigationBarBackgroundColor": "#ffffff" - } - }, { - "path": "lineRoadList", - "style": { - "navigationBarTitleText": "线路列表" - } - }, { - "path": "timerSetting/index", - "style": { - "navigationBarTitleText": "定时设置" - } - }, { - "path": "timerSetting/edit", - "style": { - "navigationBarTitleText": "编辑定时" - } - }, { - "path": "electricityDetail", - "style": { - "navigationBarTitleText": "设备详情" - } - }, { - "path": "switchWarn", - "style": { - "navigationBarTitleText": "分合闸警示", - "navigationBarBackgroundColor": "#fff" - } - }, { - "path": "alarmRecord", - "style": { - "navigationBarTitleText": "报警记录", - "navigationBarBackgroundColor": "#fff" - } - }, { - "path": "energyAnalysis/index", - "style": { - "navigationBarTitleText": "用能分析", - "navigationBarBackgroundColor": "#1c9aff" - } - }, { - "path": "energyAnalysis/monthDetail", - "style": { - "navigationBarTitleText": "月度分析" - } - }, { - "path": "wbjl/maintenanceRecord", - "style": { - "navigationBarTitleText": "维保信息列表", - "navigationBarBackgroundColor": "#fff" - } - }, { - "path": "wbjl/maintenanceDetail", - "style": { - "navigationBarTitleText": "维保信息" - } - }, { - "path": "wbjl/addRecord", - "style": { - "navigationBarTitleText": " 添加维保信息" - } - }, { - "path": "realTime/index", - "style": { - "navigationBarTitleText": "实时状态" - } - }, { - "path": "realTime/parameterSetup", - "style": { - "navigationBarTitleText": "设备参数调整" - } - }, { - "path": "realTime/alarmConfig", - "style": { - "navigationBarTitleText": "告警配置" - } - }, { - "path": "historyCurve/index", - "style": { - "navigationBarTitleText": "历史状态", - "navigationBarBackgroundColor": "#fff" - } - }] - }, - { - "root": "pages/home/electricalFire/", - "pages": [{ - "path": "index", - "style": { - "navigationBarTitleText": "电气火灾" - } - }, { - "path": "device", - "style": { - "navigationBarTitleText": "设备" - } - }, { - "path": "smokeDetail", - "style": { - "navigationBarTitleText": "烟感设备详情" - } - }, { - "path": "cameraDetail", - "style": { - "navigationBarTitleText": "摄像头设备详情" - } - }, { - "path": "runingRecord", - "style": { - "navigationBarTitleText": "运行记录" - } - }, { - "path": "alarmCenter", - "style": { - "navigationBarTitleText": "告警中心" - } - }, { - "path": "alarmDetail", - "style": { - "navigationBarTitleText": "记录详情" - } - }, { - "path": "placeManage", - "style": { - "navigationBarTitleText": "场所管理" - } - }, { - "path": "placeDetail", - "style": { - "navigationBarTitleText": "场所详情" - } - }] - }, - { - "root": "pages/home/warnAnalysis/", - "pages": [{ - "path": "index", - "style": { - "navigationBarTitleText": "警告分析" - } - }] - }, - { - "root": "pages/project/", - "pages": [{ - "path": "index", - "style": { - "navigationBarTitleText": "项目详情" - } - }, { - "path": "projectUser", - "style": { - "navigationBarTitleText": "项目成员列表", - "navigationBarBackgroundColor": "#fff" - } - }, { - "path": "deviceGroup/index", - "style": { - "navigationBarTitleText": "设备分组", - "navigationBarBackgroundColor": "#fff" - } - }, { - "path": "deviceGroup/deviceList", - "style": { - "navigationBarTitleText": "分组设备列表", - "navigationBarBackgroundColor": "#fff" - } - }, { - "path": "space/index", - "style": { - "navigationBarTitleText": "空间管理", - "navigationBarBackgroundColor": "#fff" - } - }, { - "path": "space/deviceList", - "style": { - "navigationBarTitleText": "空间设备管理", - "navigationBarBackgroundColor": "#fff" - } - }, { - "path": "space/addDeviceList", - "style": { - "navigationBarTitleText": "空间设备添加", - "navigationBarBackgroundColor": "#fff" - } - }, { - "path": "equipmentStatus/status", - "style": { - "navigationBarTitleText": "设备列表", - "navigationBarBackgroundColor": "#fff" - } - }, { - "path": "projectMap", - "style": { - "navigationBarTitleText": "项目分布" - } - }, { - "path": "electricalSafeMange/index", - "style": { - "navigationBarTitleText": "电气安全监管" - } - }, { - "path": "electricalSafeMange/allAlarm", - "style": { - "navigationBarTitleText": "全部报警", - "navigationBarBackgroundColor": "#fff" - } - }, { - "path": "electricalSafeMange/temperature", - "style": { - "navigationBarTitleText": "温度", - "navigationBarBackgroundColor": "#fff" - } - }, { - "path": "electricalSafeMange/temperatureAlarm", - "style": { - "navigationBarTitleText": "温度报警" - } - }, { - "path": "electricalSafeMange/leakageCurrent", - "style": { - "navigationBarTitleText": "漏电流", - "navigationBarBackgroundColor": "#fff" - } - }, { - "path": "electricalSafeMange/temperature-detail", - "style": { - "navigationBarTitleText": "温度历史趋势" - } - }, { - "path": "electricalSafeMange/leakage-detail", - "style": { - "navigationBarTitleText": "电流历史趋势" - } - }, { - "path": "electricalSafeMange/overload", - "style": { - "navigationBarTitleText": "过流过载" - } - }, { - "path": "electricalSafeMange/leakageAlarm", - "style": { - "navigationBarTitleText": "漏电报警" - } - }, { - "path": "electricalSafeMange/leakageSelfChecking", - "style": { - "navigationBarTitleText": "漏电自检" - } - }, { - "path": "electricalSafeMange/otherAlarm", - "style": { - "navigationBarTitleText": "", - "navigationBarBackgroundColor": "#fff" - } - }, { - "path": "smartEnergy/index", - "style": { - "navigationBarTitleText": "智慧能源管理" - } - }, { - "path": "smartEnergy/electricity", - "style": { - "navigationBarTitleText": "电量", - "navigationBarBackgroundColor": "#fff" - } - }, { - "path": "smartEnergy/electricity-detail", - "style": { - "navigationBarTitleText": "电量明细" - } - }, { - "path": "smartEnergy/load", - "style": { - "navigationBarTitleText": "负载", - "navigationBarBackgroundColor": "#fff" - } - }, { - "path": "smartEnergy/control", - "style": { - "navigationBarTitleText": "控制管理" - } - }, { - "path": "smartEnergy/iotBreaker", - "style": { - "navigationBarTitleText": "物联网断路器", - "navigationBarBackgroundColor": "#fff" - } - }, { - "path": "smartEnergy/lineRoadNaming", - "style": { - "navigationBarTitleText": "线路取名和功率限定" - } - }] - }, - { - "root": "pages/user/", - "pages": [{ - "path": "renew", - "style": { - "navigationBarTitleText": "续费充值" - } - }, { - "path": "equipmentManage", - "style": { - // "navigationBarTitleText":"设备管理", - "navigationStyle": "custom" - } - }, { - "path": "equipmentSetting", - "style": { - "navigationBarTitleText": "设置" - // "navigationStyle": "custom" - } - }, { - "path": "instructRecord", - "style": { - "navigationBarTitleText": "记录" - } - }] - }, { "root": "pages/my/", "pages": [{ - "path": "helpCenter", - "style": { - "navigationBarTitleText": "帮助中心", - "navigationBarBackgroundColor": "#fff" + "path": "passwordModify", + "style": { + "navigationBarTitleText": "修改密码" + } } - }, { - "path": "passwordModify", - "style": { - "navigationBarTitleText": "修改密码" - } - }] + ] }, { "root": "pages/new/", @@ -650,13 +86,13 @@ "navigationBarTitleText": "素材上传", "navigationBarBackgroundColor": "#fff" } - },{ + }, { "path": "videoView", "style": { "navigationBarTitleText": "视频预览", "navigationBarBackgroundColor": "#fff" } - },{ + }, { "path": "AiDrama", "style": { "navigationBarTitleText": "AI 剧本助手", @@ -728,127 +164,21 @@ }, { "path": "pages/product/detail", - "name": "商品详情" ,//模式名称 + "name": "商品详情", //模式名称 "query": "id=1888110308906405890" }, { "path": "pages/tabBar/order", "name": "订单" //模式名称 }, - { - "path": "pages/my/helpCenter", - "name": "帮助中心" //模式名称 - }, { "path": "pages/auth/passwordLogin", "name": "密码登录", //模式名称 "query": "mode=1&user=17859911022&pwd=888888" }, - { - "path": "pages/home/wisdomElectricity/realTime/parameterSetup", - "name": "设备参数调整", //模式名称 - "query": "deviceId=ed41e7462f5041aa98780ce3062765d0&deviceKey=1267240812100022" - }, - { - "path": "pages/project/space/index", - "name": "标签管理", //模式名称 - // "query": "projectId=62&projectRole=root&typeName=设备组" - "query": "projectId=62&projectRole=root&typeName=空间" - }, - { - "path": "pages/project/space/deviceList", - "name": "空间设备管理", //模式名称 - "query": "labelCode=16&projectId=63&projectRole=root&tagType=57135cfcdfa74d39b05aa04237893121&isDefault=Y" - }, - { - "path": "pages/project/deviceGroup/index", - "name": "设备分组", //模式名称 - "query": "projectId=62" - }, - { - "path": "pages/project/space/addDeviceList", - "name": "空间设备添加", //模式名称 - "query": "labelCode=16" - }, - { - "path": "pages/home/wisdomElectricity/realTime/alarmConfig", - "name": "告警配置", //模式名称 - "query": "deviceKey=1267240812100027" - }, - { - "path": "pages/tabBar/scan", - "name": "扫码" //模式名称 - }, { - "path": "pages/tabBar/home", - "name": "首页" //模式名称 - }, - { - "path": "pages/tabBar/project", - "name": "项目" //模式名称 - }, - { - "path": "pages/project/index", - "name": "项目详情", //模式名称 - "query": "projectId=62&projectCode=bd80a3c80c394dae8a2d8138713f2bcf" - }, { "path": "pages/tabBar/my", "name": "我的" //模式名称 - }, - { - "path": "pages/tabBar/my/onlineServe", - "name": "联系我们" //模式名称 - }, - { - "path": "pages/project/equipmentStatus/status", - "name": "设备列表", //模式名称 - "query": "projectId=62&adminFlag=true&projectRole=root" - }, - { - "path": "pages/project/projectUser", - "name": "用户列表", //模式名称 - "query": "projectId=56" - }, - { - "path": "pages/tabBar/alarm", - "name": "报警" //模式名称 - }, - { - "path": "pages/home/wisdomElectricity/timerSetting/index", - "name": "定时设置" //模式名称 - }, - { - "path": "pages/home/wisdomElectricity/index", - "name": "智慧用电" //模式名称 - }, - { - "path": "pages/home/warnAnalysis/index", - "name": "警告分析" - }, - { - "path": "pages/home/wisdomElectricity/electricityDetail", - "name": "设备详情", - "query": "deviceId=d137ad68c6204a3c9d58fc032aea4805" - }, - { - "path": "pages/home/wisdomElectricity/energyAnalysis/index", - "name": "用能分析", - "query": "deviceId=26162221dc3340c59099c77cff0a170b&prodKey=B7L-NET-G1(4G+485+LAN)&deviceKey=12502012410109101875&projectName=18046102872的项目&deviceName=内部总闸(勿操作)" - }, - { - "path": "pages/project/electricalSafeMange/index", - "name": "电气", - "query": "projectId=16" - }, - { - "path": "pages/home/wisdomElectricity/realTime/index", - "name": "设备实时状态", - "query": "deviceId=1ca512016cc749a7a12fe0116c9429bb&prodKey=B7L-NET-G1(4G+485+LAN)&deviceKey=12502012410109105377&projectName=成套柜样品&deviceName=配电柜演示箱0001" - }, - { - "path": "pages/home/wisdomElectricity/energyAnalysis/monthDetail", - "name": "用能分析月份详情", - "query": "deviceId=e36f0cb0bc5f442e939747d1f070d2a0&month=2022-07" } ] } diff --git a/pages/auth/companyRegister.vue b/pages/auth/companyRegister.vue deleted file mode 100644 index 3711f00..0000000 --- a/pages/auth/companyRegister.vue +++ /dev/null @@ -1,184 +0,0 @@ - - - diff --git a/pages/auth/defalut.vue b/pages/auth/defalut.vue deleted file mode 100644 index 4c74806..0000000 --- a/pages/auth/defalut.vue +++ /dev/null @@ -1,666 +0,0 @@ - - - - - - - diff --git a/pages/auth/forgotPassword.vue b/pages/auth/forgotPassword.vue deleted file mode 100644 index b7c2a5a..0000000 --- a/pages/auth/forgotPassword.vue +++ /dev/null @@ -1,270 +0,0 @@ - - - - - - - diff --git a/pages/auth/login.vue b/pages/auth/login.vue deleted file mode 100644 index 4f11118..0000000 --- a/pages/auth/login.vue +++ /dev/null @@ -1,431 +0,0 @@ - - - - - diff --git a/pages/auth/registerGuide.vue b/pages/auth/registerGuide.vue deleted file mode 100644 index d513876..0000000 --- a/pages/auth/registerGuide.vue +++ /dev/null @@ -1,73 +0,0 @@ - - - diff --git a/pages/auth/registerLoading.vue b/pages/auth/registerLoading.vue deleted file mode 100644 index a8add21..0000000 --- a/pages/auth/registerLoading.vue +++ /dev/null @@ -1,63 +0,0 @@ - - - diff --git a/pages/auth/userRegister.vue b/pages/auth/userRegister.vue deleted file mode 100644 index 2c1172b..0000000 --- a/pages/auth/userRegister.vue +++ /dev/null @@ -1,234 +0,0 @@ - - - - - - - diff --git a/pages/battery/battery-info.vue b/pages/battery/battery-info.vue deleted file mode 100644 index 68d6759..0000000 --- a/pages/battery/battery-info.vue +++ /dev/null @@ -1,393 +0,0 @@ - - - - - - diff --git a/pages/home/electricalFire/alarmCenter.vue b/pages/home/electricalFire/alarmCenter.vue deleted file mode 100644 index bf46ab0..0000000 --- a/pages/home/electricalFire/alarmCenter.vue +++ /dev/null @@ -1,170 +0,0 @@ - - - diff --git a/pages/home/electricalFire/alarmDetail.vue b/pages/home/electricalFire/alarmDetail.vue deleted file mode 100644 index 956195d..0000000 --- a/pages/home/electricalFire/alarmDetail.vue +++ /dev/null @@ -1,142 +0,0 @@ - - - diff --git a/pages/home/electricalFire/cameraDetail.vue b/pages/home/electricalFire/cameraDetail.vue deleted file mode 100644 index c2c9d17..0000000 --- a/pages/home/electricalFire/cameraDetail.vue +++ /dev/null @@ -1,48 +0,0 @@ - - - diff --git a/pages/home/electricalFire/device.vue b/pages/home/electricalFire/device.vue deleted file mode 100644 index cc0a5a9..0000000 --- a/pages/home/electricalFire/device.vue +++ /dev/null @@ -1,165 +0,0 @@ - - - diff --git a/pages/home/electricalFire/index.vue b/pages/home/electricalFire/index.vue deleted file mode 100644 index df041a0..0000000 --- a/pages/home/electricalFire/index.vue +++ /dev/null @@ -1,173 +0,0 @@ - - - diff --git a/pages/home/electricalFire/placeDetail.vue b/pages/home/electricalFire/placeDetail.vue deleted file mode 100644 index f44c53d..0000000 --- a/pages/home/electricalFire/placeDetail.vue +++ /dev/null @@ -1,118 +0,0 @@ - - - diff --git a/pages/home/electricalFire/placeManage.vue b/pages/home/electricalFire/placeManage.vue deleted file mode 100644 index 3087add..0000000 --- a/pages/home/electricalFire/placeManage.vue +++ /dev/null @@ -1,107 +0,0 @@ - - - diff --git a/pages/home/electricalFire/runingRecord.vue b/pages/home/electricalFire/runingRecord.vue deleted file mode 100644 index 3e5cedf..0000000 --- a/pages/home/electricalFire/runingRecord.vue +++ /dev/null @@ -1,91 +0,0 @@ - - - diff --git a/pages/home/electricalFire/smokeDetail.vue b/pages/home/electricalFire/smokeDetail.vue deleted file mode 100644 index 3e4efd3..0000000 --- a/pages/home/electricalFire/smokeDetail.vue +++ /dev/null @@ -1,220 +0,0 @@ - - - diff --git a/pages/home/more/moreNavBar.vue b/pages/home/more/moreNavBar.vue deleted file mode 100644 index 752c143..0000000 --- a/pages/home/more/moreNavBar.vue +++ /dev/null @@ -1,74 +0,0 @@ - - - diff --git a/pages/home/smoke/index.vue b/pages/home/smoke/index.vue deleted file mode 100644 index 1aad3e4..0000000 --- a/pages/home/smoke/index.vue +++ /dev/null @@ -1,172 +0,0 @@ - - - diff --git a/pages/home/temperature/alarmCenter.vue b/pages/home/temperature/alarmCenter.vue deleted file mode 100644 index 988353d..0000000 --- a/pages/home/temperature/alarmCenter.vue +++ /dev/null @@ -1,170 +0,0 @@ - - - diff --git a/pages/home/temperature/device.vue b/pages/home/temperature/device.vue deleted file mode 100644 index 7cff527..0000000 --- a/pages/home/temperature/device.vue +++ /dev/null @@ -1,119 +0,0 @@ - - - diff --git a/pages/home/temperature/deviceDetail.vue b/pages/home/temperature/deviceDetail.vue deleted file mode 100644 index d590b06..0000000 --- a/pages/home/temperature/deviceDetail.vue +++ /dev/null @@ -1,53 +0,0 @@ - - - diff --git a/pages/home/temperature/index.vue b/pages/home/temperature/index.vue deleted file mode 100644 index e01fc32..0000000 --- a/pages/home/temperature/index.vue +++ /dev/null @@ -1,146 +0,0 @@ - - - diff --git a/pages/home/temperature/placeDetail.vue b/pages/home/temperature/placeDetail.vue deleted file mode 100644 index 7b57715..0000000 --- a/pages/home/temperature/placeDetail.vue +++ /dev/null @@ -1,118 +0,0 @@ - - - diff --git a/pages/home/temperature/placeManage.vue b/pages/home/temperature/placeManage.vue deleted file mode 100644 index 3087add..0000000 --- a/pages/home/temperature/placeManage.vue +++ /dev/null @@ -1,107 +0,0 @@ - - - diff --git a/pages/home/warnAnalysis/index.vue b/pages/home/warnAnalysis/index.vue deleted file mode 100644 index 52c363b..0000000 --- a/pages/home/warnAnalysis/index.vue +++ /dev/null @@ -1,573 +0,0 @@ - - - diff --git a/pages/home/waterLevel/alarmCenter.vue b/pages/home/waterLevel/alarmCenter.vue deleted file mode 100644 index eb28df3..0000000 --- a/pages/home/waterLevel/alarmCenter.vue +++ /dev/null @@ -1,170 +0,0 @@ - - - diff --git a/pages/home/waterLevel/device.vue b/pages/home/waterLevel/device.vue deleted file mode 100644 index f529e7e..0000000 --- a/pages/home/waterLevel/device.vue +++ /dev/null @@ -1,119 +0,0 @@ - - - diff --git a/pages/home/waterLevel/deviceDetail.vue b/pages/home/waterLevel/deviceDetail.vue deleted file mode 100644 index 9ee29d6..0000000 --- a/pages/home/waterLevel/deviceDetail.vue +++ /dev/null @@ -1,53 +0,0 @@ - - - diff --git a/pages/home/waterLevel/index.vue b/pages/home/waterLevel/index.vue deleted file mode 100644 index 6967573..0000000 --- a/pages/home/waterLevel/index.vue +++ /dev/null @@ -1,148 +0,0 @@ - - - diff --git a/pages/home/waterLevel/placeDetail.vue b/pages/home/waterLevel/placeDetail.vue deleted file mode 100644 index f44c53d..0000000 --- a/pages/home/waterLevel/placeDetail.vue +++ /dev/null @@ -1,118 +0,0 @@ - - - diff --git a/pages/home/waterLevel/placeManage.vue b/pages/home/waterLevel/placeManage.vue deleted file mode 100644 index 3087add..0000000 --- a/pages/home/waterLevel/placeManage.vue +++ /dev/null @@ -1,107 +0,0 @@ - - - diff --git a/pages/home/waterLevel/realTime.vue b/pages/home/waterLevel/realTime.vue deleted file mode 100644 index 0e3c6f1..0000000 --- a/pages/home/waterLevel/realTime.vue +++ /dev/null @@ -1,458 +0,0 @@ - - - diff --git a/pages/home/wisdomElectricity/alarmRecord.vue b/pages/home/wisdomElectricity/alarmRecord.vue deleted file mode 100644 index de29a98..0000000 --- a/pages/home/wisdomElectricity/alarmRecord.vue +++ /dev/null @@ -1,433 +0,0 @@ - - - - - diff --git a/pages/home/wisdomElectricity/electricityDetail.vue b/pages/home/wisdomElectricity/electricityDetail.vue deleted file mode 100644 index fdea6f3..0000000 --- a/pages/home/wisdomElectricity/electricityDetail.vue +++ /dev/null @@ -1,732 +0,0 @@ - - - \ No newline at end of file diff --git a/pages/home/wisdomElectricity/energyAnalysis/index.vue b/pages/home/wisdomElectricity/energyAnalysis/index.vue deleted file mode 100644 index 3e7f0d3..0000000 --- a/pages/home/wisdomElectricity/energyAnalysis/index.vue +++ /dev/null @@ -1,657 +0,0 @@ - - - \ No newline at end of file diff --git a/pages/home/wisdomElectricity/energyAnalysis/monthDetail.vue b/pages/home/wisdomElectricity/energyAnalysis/monthDetail.vue deleted file mode 100644 index da14281..0000000 --- a/pages/home/wisdomElectricity/energyAnalysis/monthDetail.vue +++ /dev/null @@ -1,154 +0,0 @@ - - - diff --git a/pages/home/wisdomElectricity/historyCurve--.vue b/pages/home/wisdomElectricity/historyCurve--.vue deleted file mode 100644 index 92f49c1..0000000 --- a/pages/home/wisdomElectricity/historyCurve--.vue +++ /dev/null @@ -1,645 +0,0 @@ - - - diff --git a/pages/home/wisdomElectricity/historyCurve/common/common.scss b/pages/home/wisdomElectricity/historyCurve/common/common.scss deleted file mode 100644 index c18ade2..0000000 --- a/pages/home/wisdomElectricity/historyCurve/common/common.scss +++ /dev/null @@ -1,48 +0,0 @@ -.historyCurve-leakage{ - margin-top: 20rpx; - &-title{ - padding: 20rpx 30rpx; - font-weight: bold; - } - &-content{ - background-color: #fff; - padding: 30rpx 0; - } - &-switch{ - display: flex; - border: 1px solid #FF6600; - width: 600rpx; - margin: 0 auto; - &-box{ - width: 200rpx; - text-align: center; - padding: 16rpx 0; - border-right: 1px solid #ff6600; - &:last-child{ - border-right: none; - } - } - /* .middle-box{ - border-left: 1px solid #ff6600; - border-right: 1px solid #ff6600; - } */ - .leakageAction{ - background-color: #ff6600; - color: #fff; - } - } - &-chart{ - width: 100%; - height: 550rpx; - margin-top: 30rpx; - padding: 0 30rpx; - &-table{ - width: 100%; - height: 100%; - &-list{ - height: 480rpx; - overflow: auto; - } - } - } -} \ No newline at end of file diff --git a/pages/home/wisdomElectricity/historyCurve/common/mixins.js b/pages/home/wisdomElectricity/historyCurve/common/mixins.js deleted file mode 100644 index 95e3420..0000000 --- a/pages/home/wisdomElectricity/historyCurve/common/mixins.js +++ /dev/null @@ -1,45 +0,0 @@ -export default { - props: { - chartData: { - type: Object, - default() { - return {} - } - } - }, - data() { - return { - switchList: ["柱状图","折线图","数据视图"], - pickIndex: 0, - barChart: false, - polyLineChart: false, - tableChart: false, - dataSource: {} - } - }, - created() { - this.dataSource = this.chartData; - }, - watch: { - chartData(newVal) { - this.dataSource = newVal; - } - }, - methods: { - switchFn(item,index){ - this.pickIndex = index; - this.barChart = false; - this.polyLineChart = false; - this.tableChart = false; - }, - onRenderFinshBar() { - this.barChart = true; - }, - onRenderComplete() { - this.polyLineChart = true; - }, - onRenderFinshTable() { - this.tableChart = true; - } - } -} \ No newline at end of file diff --git a/pages/home/wisdomElectricity/historyCurve/components/electric.vue b/pages/home/wisdomElectricity/historyCurve/components/electric.vue deleted file mode 100644 index ec4f041..0000000 --- a/pages/home/wisdomElectricity/historyCurve/components/electric.vue +++ /dev/null @@ -1,37 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/home/wisdomElectricity/historyCurve/components/leakage.vue b/pages/home/wisdomElectricity/historyCurve/components/leakage.vue deleted file mode 100644 index 25307a3..0000000 --- a/pages/home/wisdomElectricity/historyCurve/components/leakage.vue +++ /dev/null @@ -1,37 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/home/wisdomElectricity/historyCurve/components/temperature.vue b/pages/home/wisdomElectricity/historyCurve/components/temperature.vue deleted file mode 100644 index c538204..0000000 --- a/pages/home/wisdomElectricity/historyCurve/components/temperature.vue +++ /dev/null @@ -1,262 +0,0 @@ - - - - - diff --git a/pages/home/wisdomElectricity/historyCurve/components/voltage.vue b/pages/home/wisdomElectricity/historyCurve/components/voltage.vue deleted file mode 100644 index d7a2a1e..0000000 --- a/pages/home/wisdomElectricity/historyCurve/components/voltage.vue +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - diff --git a/pages/home/wisdomElectricity/historyCurve/index.vue b/pages/home/wisdomElectricity/historyCurve/index.vue deleted file mode 100644 index 8c17ed3..0000000 --- a/pages/home/wisdomElectricity/historyCurve/index.vue +++ /dev/null @@ -1,351 +0,0 @@ - - - - - diff --git a/pages/home/wisdomElectricity/index.vue b/pages/home/wisdomElectricity/index.vue deleted file mode 100644 index cabdb8e..0000000 --- a/pages/home/wisdomElectricity/index.vue +++ /dev/null @@ -1,267 +0,0 @@ - - - - - diff --git a/pages/home/wisdomElectricity/lineRoadList.vue b/pages/home/wisdomElectricity/lineRoadList.vue deleted file mode 100644 index 322019e..0000000 --- a/pages/home/wisdomElectricity/lineRoadList.vue +++ /dev/null @@ -1,275 +0,0 @@ - - - - diff --git a/pages/home/wisdomElectricity/realTime/alarmConfig.vue b/pages/home/wisdomElectricity/realTime/alarmConfig.vue deleted file mode 100644 index 1749147..0000000 --- a/pages/home/wisdomElectricity/realTime/alarmConfig.vue +++ /dev/null @@ -1,211 +0,0 @@ - - - - - diff --git a/pages/home/wisdomElectricity/realTime/deviceDataKey.js b/pages/home/wisdomElectricity/realTime/deviceDataKey.js deleted file mode 100644 index 65c9eb3..0000000 --- a/pages/home/wisdomElectricity/realTime/deviceDataKey.js +++ /dev/null @@ -1,129 +0,0 @@ - -const keyArr = [ - {key:"i",name:"总电流",unit:"A"}, - {key:"u",name:"总电压",unit:"V"}, - {key:"in", name:"漏电流",unit:"mA"}, - {key:"ps", name:"功率",unit:"KW"}, - {key:"pw", name:"电能",unit:"kWh"}, - {key:"switch", name:"开关状态",unit:"",type:"enum",enumData:{ - "0":"关", - "1":"开", - "2": "异常" - }}, - {key:"t1", name:"in1温度",unit:"°C"}, - {key:"t2", name:"out1温度",unit:"°C"}, - {key:"t3", name:"in2温度",unit:"°C"}, - {key:"t4", name:"out2温度",unit:"°C"}, - {key:"t5", name:"in3温度",unit:"°C"}, - {key:"t6", name:"out3温度",unit:"°C"}, - {key:"t7", name:"in4温度",unit:"°C"}, - {key:"t8", name:"out4温度",unit:"°C"}, - - {key:"q", name:"无功功率",unit:"kvar"}, - {key:"s", name:"视在功率",unit:"kVA"}, - {key:"pf", name:"功率因数",unit:""}, - {key:"eq", name:"无功电能",unit:"kvarh"}, - {key:"freq", name:"电网频率",unit:"Hz"}, -] -// const obj = { -// i:{name:"总电流",unit:"A"}, -// u:{name:"总电压",unit:"V"}, -// in:{name:"漏电流",unit:"mA"}, -// ps:{name:"总有功功率",unit:"W"}, -// pw:{name:"总有功电能",unit:"kWh"}, -// switch:{name:"开关状态",unit:"",type:"enum",enumData:{ -// "1":"开", -// "0":"关" -// }}, -// t1:{name:"进线口1温度",unit:"°C"}, -// t2:{name:"出线口1温度",unit:"°C"}, -// t3:{name:"进线口2温度",unit:"°C"}, -// t4:{name:"出线口2温度",unit:"°C"}, -// t5:{name:"进线口3温度",unit:"°C"}, -// t6:{name:"出线口3温度",unit:"°C"}, -// t7:{name:"进线口4温度",unit:"°C"}, -// t8:{name:"出线口4温度",unit:"°C"} - - // // 4p空开 _____start - // // cin:"C相漏电流", - // // bin:"B相漏电流", - // // ain:"A相漏电流", - - // tout4:{name:"出线口4温度",unit:"°C"}, - // tout3:{name:"出线口3温度",unit:"°C"}, - // tout2:{name:"出线口2温度",unit:"°C"}, - // tout1:{name:"出线口1温度",unit:"°C"}, - - // tin4:{name:"进线口4温度",unit:"°C"}, - // tin3:{name:"进线口3温度",unit:"°C"}, - // tin2:{name:"进线口2温度",unit:"°C"}, - // tin1:{name:"进线口1温度",unit:"°C"}, - - // // alarm:"报警类型", - // "switch":{name:"开关状态",unit:""}, - // qwabc:{name:"总无功电能",unit:"kWh"}, - // // qwc:"C相无功电能", - // // qwb:"B相无功电能", - // // qwa:"A相无功电能", - // // pwc:"C相有功电能", - // // pwb:"B相有功电能", - // // pwa:"A相有功电能", - // // fabc:"频率", - // // pfc:"C相功率因数", - // // pfb:"B相功率因数", - // // pfa:"A相功率因数", - // // pfabc:"总功率因数", - // // qsc:"C相无功功率", - // // qsb:"B相无功功率", - // // qsa:"A相无功功率", - // // qsabc:"总无功功率", - // // psc:"C相有功功率", - // // psb:"B相有功功率", - // // psa:"A相有功功率", - // psabc:{name:"总有功功率",unit:"W"}, - // ic:{name:"C相电流",unit:"A"}, - // ib:{name:"B相电流",unit:"A"}, - // ia:{name:"A相电流",unit:"A"}, - // uc:{name:"C相电压",unit:"V"}, - // ub:{name:"B相电压",unit:"V"}, - // ua:{name:"A相电压",unit:"V"}, - - // // qwabcf:"总反相无功电能", - // // qwabcz:"总正向无功电能", - // // pwabcf:"总反相有功电能", - // // pwabcz:"总正向有功电能", - // // qwcf:"C相反向无功电能", - // // qwcz:"C相正向无功电能", - // // qwbz:"B相正向无功电能", - // // qwbf:"B相反向无功电能", - // // qwaf:"A相反向无功电能", - // // qwaz:"A相正向无功电能", - // // pwcf:"C相反向有功电能", - // // pwcz:"C相正向有功电能", - // // pwbz:"B相正向有功电能", - // // pwbf:"B相反向有功电能", - // // pwaz:"A相正向有功电能", - // // pwaf:"A相反向有功电能", - // // izero:"零序电流", - // // uca:"CA线电压", - // // ubc:"BC线电压", - // // uab:"AB线电压", - // pwabc:{name:"总有功电能",unit:"kWh"}, - // // 4p空开 _____end - - // // 1p空开 _____start - // // qwf:"单相反向无功电能", - // // qwz:"单相正向无功电能", - // // pwf:"单相反向有功电能", - // // pwz:"单相正向有功电能", - // // qw:"单相无功电能", - // pw:{name:"单相有功电能",unit:"kWh"}, - // // f:"单相频率", - // // pf:"单相功率因数", - // // qs:"单相无功功率", - // ps:{name:"单相有功功率",unit:"W"}, - // i:{name:"单相电流",unit:"A"}, - // u:{name:"单相电压",unit:"V"} - // // 1p空开 _____end -// } -export default keyArr; \ No newline at end of file diff --git a/pages/home/wisdomElectricity/realTime/index.vue b/pages/home/wisdomElectricity/realTime/index.vue deleted file mode 100644 index b607a31..0000000 --- a/pages/home/wisdomElectricity/realTime/index.vue +++ /dev/null @@ -1,1045 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/pages/home/wisdomElectricity/realTime/parameterField.js b/pages/home/wisdomElectricity/realTime/parameterField.js deleted file mode 100644 index a1a650f..0000000 --- a/pages/home/wisdomElectricity/realTime/parameterField.js +++ /dev/null @@ -1,12 +0,0 @@ -const obj ={ - deviceName:"设备别名", - lineRoad:"线路别名", - rename:"重命名", - wiringSetup:"接线设置", - powerLimit:"功率限额", - voltageLimit:"电压限额", - currentLimit:"电流限额", - leakageCurrentLimit:"漏电流限额", - temperatureLimit:"温度限额" -} -export default obj; \ No newline at end of file diff --git a/pages/home/wisdomElectricity/realTime/parameterSetup.vue b/pages/home/wisdomElectricity/realTime/parameterSetup.vue deleted file mode 100644 index 2e55b07..0000000 --- a/pages/home/wisdomElectricity/realTime/parameterSetup.vue +++ /dev/null @@ -1,455 +0,0 @@ - - - - \ No newline at end of file diff --git a/pages/home/wisdomElectricity/switchWarn.vue b/pages/home/wisdomElectricity/switchWarn.vue deleted file mode 100644 index 2e5a7a7..0000000 --- a/pages/home/wisdomElectricity/switchWarn.vue +++ /dev/null @@ -1,390 +0,0 @@ - - - - - diff --git a/pages/home/wisdomElectricity/timerSetting/edit.vue b/pages/home/wisdomElectricity/timerSetting/edit.vue deleted file mode 100644 index 3641855..0000000 --- a/pages/home/wisdomElectricity/timerSetting/edit.vue +++ /dev/null @@ -1,19 +0,0 @@ - - - - - diff --git a/pages/home/wisdomElectricity/timerSetting/index.vue b/pages/home/wisdomElectricity/timerSetting/index.vue deleted file mode 100644 index c90d833..0000000 --- a/pages/home/wisdomElectricity/timerSetting/index.vue +++ /dev/null @@ -1,64 +0,0 @@ - - - - - diff --git a/pages/home/wisdomElectricity/wbjl/addRecord.vue b/pages/home/wisdomElectricity/wbjl/addRecord.vue deleted file mode 100644 index 53d398d..0000000 --- a/pages/home/wisdomElectricity/wbjl/addRecord.vue +++ /dev/null @@ -1,165 +0,0 @@ - - - diff --git a/pages/home/wisdomElectricity/wbjl/maintenanceDetail.vue b/pages/home/wisdomElectricity/wbjl/maintenanceDetail.vue deleted file mode 100644 index 4c531e1..0000000 --- a/pages/home/wisdomElectricity/wbjl/maintenanceDetail.vue +++ /dev/null @@ -1,153 +0,0 @@ - - - diff --git a/pages/home/wisdomElectricity/wbjl/maintenanceRecord.vue b/pages/home/wisdomElectricity/wbjl/maintenanceRecord.vue deleted file mode 100644 index 290bbb6..0000000 --- a/pages/home/wisdomElectricity/wbjl/maintenanceRecord.vue +++ /dev/null @@ -1,276 +0,0 @@ - - - - diff --git a/pages/index/enter.vue b/pages/index/enter.vue deleted file mode 100644 index 37cdcc4..0000000 --- a/pages/index/enter.vue +++ /dev/null @@ -1,78 +0,0 @@ - - - diff --git a/pages/index/guidePage.vue b/pages/index/guidePage.vue deleted file mode 100644 index a6ffb00..0000000 --- a/pages/index/guidePage.vue +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - diff --git a/pages/my/helpCenter.vue b/pages/my/helpCenter.vue deleted file mode 100644 index 33750ec..0000000 --- a/pages/my/helpCenter.vue +++ /dev/null @@ -1,11 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/oneselfUser/alarm.vue b/pages/oneselfUser/alarm.vue deleted file mode 100644 index b06c84d..0000000 --- a/pages/oneselfUser/alarm.vue +++ /dev/null @@ -1,445 +0,0 @@ - - - - - diff --git a/pages/oneselfUser/home.vue b/pages/oneselfUser/home.vue deleted file mode 100644 index df4998d..0000000 --- a/pages/oneselfUser/home.vue +++ /dev/null @@ -1,440 +0,0 @@ - - - - diff --git a/pages/oneselfUser/home.vueBF b/pages/oneselfUser/home.vueBF deleted file mode 100644 index 8257830..0000000 --- a/pages/oneselfUser/home.vueBF +++ /dev/null @@ -1,27 +0,0 @@ - - - diff --git a/pages/oneselfUser/index.vue b/pages/oneselfUser/index.vue deleted file mode 100644 index 246ffbc..0000000 --- a/pages/oneselfUser/index.vue +++ /dev/null @@ -1,80 +0,0 @@ - - - diff --git a/pages/oneselfUser/myCenter.vue b/pages/oneselfUser/myCenter.vue deleted file mode 100644 index 79f7372..0000000 --- a/pages/oneselfUser/myCenter.vue +++ /dev/null @@ -1,203 +0,0 @@ - - - - - - diff --git a/pages/oneselfUser/relationDevice/index.vue b/pages/oneselfUser/relationDevice/index.vue deleted file mode 100644 index 78dccbf..0000000 --- a/pages/oneselfUser/relationDevice/index.vue +++ /dev/null @@ -1,150 +0,0 @@ - - - - diff --git a/pages/oneselfUser/wisdomElectricity.vue b/pages/oneselfUser/wisdomElectricity.vue deleted file mode 100644 index 5ef720c..0000000 --- a/pages/oneselfUser/wisdomElectricity.vue +++ /dev/null @@ -1,260 +0,0 @@ - - - - - diff --git a/pages/oneselfUser/workOrder/index.vue b/pages/oneselfUser/workOrder/index.vue deleted file mode 100644 index 4dc185b..0000000 --- a/pages/oneselfUser/workOrder/index.vue +++ /dev/null @@ -1,15 +0,0 @@ - - - diff --git a/pages/project/alarmTrend.vue b/pages/project/alarmTrend.vue deleted file mode 100644 index 5171079..0000000 --- a/pages/project/alarmTrend.vue +++ /dev/null @@ -1,155 +0,0 @@ - - - diff --git a/pages/project/deviceGroup/deviceList.vue b/pages/project/deviceGroup/deviceList.vue deleted file mode 100644 index 4cc1950..0000000 --- a/pages/project/deviceGroup/deviceList.vue +++ /dev/null @@ -1,369 +0,0 @@ - - - \ No newline at end of file diff --git a/pages/project/deviceGroup/index.vue b/pages/project/deviceGroup/index.vue deleted file mode 100644 index 8336670..0000000 --- a/pages/project/deviceGroup/index.vue +++ /dev/null @@ -1,318 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/pages/project/electricalSafeMange/allAlarm.vue b/pages/project/electricalSafeMange/allAlarm.vue deleted file mode 100644 index 09ea4e9..0000000 --- a/pages/project/electricalSafeMange/allAlarm.vue +++ /dev/null @@ -1,629 +0,0 @@ - - - diff --git a/pages/project/electricalSafeMange/allAlarmMixins.js b/pages/project/electricalSafeMange/allAlarmMixins.js deleted file mode 100644 index 29e2da0..0000000 --- a/pages/project/electricalSafeMange/allAlarmMixins.js +++ /dev/null @@ -1,50 +0,0 @@ -import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js"; -export default { - data(){ - return{ - - } - }, - mixins:[MescrollMixin], - methods:{ - /*上拉加载的回调*/ - upCallback(page) { - console.log(page,"page"); - let pageNum = page.num; // 页码, 默认从1开始 - let pageSize = page.size; // 页长, 默认每页10条 - let obj = { - pageSize:pageSize, - pageNum:pageNum, - createDate:this.dateVal, - alarmDivide:this.alarmSelectValue==1?"ALARM":"WARNING", - processState:this.stateSelectValue, - projectId: this.projectId - // deviceState:this.screeningValue, - // deviceName:this.searchValue - } - this.$get("/app/alarm/table",obj).then((res)=>{ - console.log(res,"ressssssssssss"); - if (res.rows && res.rows.length>0) { - // 接口返回的当前页数据列表 (数组) - let curPageData = res.rows; - // 接口返回的当前页数据长度 (如列表有26个数据,当前页返回8个,则curPageLen=8) - let curPageLen = curPageData.length; - //设置列表数据 - if(pageNum == 1) this.allAlarmList = []; //如果是第一页需手动置空列表 - this.allAlarmList = this.allAlarmList.concat(curPageData); //追加新数据 - this.mescroll.endBySize(curPageLen, res.total); // 推荐 - // this.mescroll.endByPage(curPageLen, res.data.total) - // this.mescroll.endSuccess(curPageData.length); - } else{ - this.allAlarmList = []; - this.mescroll.endErr(); - this.mescroll.showEmpty(); - // this.mescroll.endUpScroll(true); - } - }).catch(()=>{ - //联网失败, 结束加载 - this.mescroll.endErr(); - }) - }, - } -} \ No newline at end of file diff --git a/pages/project/electricalSafeMange/index.vue b/pages/project/electricalSafeMange/index.vue deleted file mode 100644 index 52a20b6..0000000 --- a/pages/project/electricalSafeMange/index.vue +++ /dev/null @@ -1,152 +0,0 @@ - - - diff --git a/pages/project/electricalSafeMange/leakage-detail.vue b/pages/project/electricalSafeMange/leakage-detail.vue deleted file mode 100644 index 50f13d6..0000000 --- a/pages/project/electricalSafeMange/leakage-detail.vue +++ /dev/null @@ -1,303 +0,0 @@ - - - diff --git a/pages/project/electricalSafeMange/leakageAlarm.vue b/pages/project/electricalSafeMange/leakageAlarm.vue deleted file mode 100644 index 5d0d0a3..0000000 --- a/pages/project/electricalSafeMange/leakageAlarm.vue +++ /dev/null @@ -1,253 +0,0 @@ - - - diff --git a/pages/project/electricalSafeMange/leakageCurrent.vue b/pages/project/electricalSafeMange/leakageCurrent.vue deleted file mode 100644 index 4abcbed..0000000 --- a/pages/project/electricalSafeMange/leakageCurrent.vue +++ /dev/null @@ -1,141 +0,0 @@ - - - diff --git a/pages/project/electricalSafeMange/leakageSelfChecking.vue b/pages/project/electricalSafeMange/leakageSelfChecking.vue deleted file mode 100644 index 3916507..0000000 --- a/pages/project/electricalSafeMange/leakageSelfChecking.vue +++ /dev/null @@ -1,253 +0,0 @@ - - - diff --git a/pages/project/electricalSafeMange/otherAlarm.vue b/pages/project/electricalSafeMange/otherAlarm.vue deleted file mode 100644 index 1627a9e..0000000 --- a/pages/project/electricalSafeMange/otherAlarm.vue +++ /dev/null @@ -1,440 +0,0 @@ - - - diff --git a/pages/project/electricalSafeMange/overload.vue b/pages/project/electricalSafeMange/overload.vue deleted file mode 100644 index 6b46106..0000000 --- a/pages/project/electricalSafeMange/overload.vue +++ /dev/null @@ -1,266 +0,0 @@ - - - diff --git a/pages/project/electricalSafeMange/temperature-detail.vue b/pages/project/electricalSafeMange/temperature-detail.vue deleted file mode 100644 index b3ba7da..0000000 --- a/pages/project/electricalSafeMange/temperature-detail.vue +++ /dev/null @@ -1,303 +0,0 @@ - - - diff --git a/pages/project/electricalSafeMange/temperature.vue b/pages/project/electricalSafeMange/temperature.vue deleted file mode 100644 index ba37004..0000000 --- a/pages/project/electricalSafeMange/temperature.vue +++ /dev/null @@ -1,338 +0,0 @@ - - - diff --git a/pages/project/electricalSafeMange/temperatureAlarm.vue b/pages/project/electricalSafeMange/temperatureAlarm.vue deleted file mode 100644 index 7a5a8ad..0000000 --- a/pages/project/electricalSafeMange/temperatureAlarm.vue +++ /dev/null @@ -1,251 +0,0 @@ - - - diff --git a/pages/project/equipmentStatus/status.vue b/pages/project/equipmentStatus/status.vue deleted file mode 100644 index 0822560..0000000 --- a/pages/project/equipmentStatus/status.vue +++ /dev/null @@ -1,695 +0,0 @@ - - - \ No newline at end of file diff --git a/pages/project/index.vue b/pages/project/index.vue deleted file mode 100644 index 99244ca..0000000 --- a/pages/project/index.vue +++ /dev/null @@ -1,748 +0,0 @@ - - - - \ No newline at end of file diff --git a/pages/project/projectCmp.vue b/pages/project/projectCmp.vue deleted file mode 100644 index 9cb71ef..0000000 --- a/pages/project/projectCmp.vue +++ /dev/null @@ -1,276 +0,0 @@ - - - diff --git a/pages/project/projectMap.nvue b/pages/project/projectMap.nvue deleted file mode 100644 index 7891479..0000000 --- a/pages/project/projectMap.nvue +++ /dev/null @@ -1,291 +0,0 @@ - - - diff --git a/pages/project/projectMap.vue b/pages/project/projectMap.vue deleted file mode 100644 index f62d38f..0000000 --- a/pages/project/projectMap.vue +++ /dev/null @@ -1,277 +0,0 @@ - - - diff --git a/pages/project/projectUser.vue b/pages/project/projectUser.vue deleted file mode 100644 index b6e5cc4..0000000 --- a/pages/project/projectUser.vue +++ /dev/null @@ -1,365 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/pages/project/smartEnergy/control.vue b/pages/project/smartEnergy/control.vue deleted file mode 100644 index e20b162..0000000 --- a/pages/project/smartEnergy/control.vue +++ /dev/null @@ -1,94 +0,0 @@ - - - diff --git a/pages/project/smartEnergy/electricity-detail.vue b/pages/project/smartEnergy/electricity-detail.vue deleted file mode 100644 index 76037bf..0000000 --- a/pages/project/smartEnergy/electricity-detail.vue +++ /dev/null @@ -1,151 +0,0 @@ - - - diff --git a/pages/project/smartEnergy/electricity.vue b/pages/project/smartEnergy/electricity.vue deleted file mode 100644 index 0cc908d..0000000 --- a/pages/project/smartEnergy/electricity.vue +++ /dev/null @@ -1,510 +0,0 @@ - - - diff --git a/pages/project/smartEnergy/index.vue b/pages/project/smartEnergy/index.vue deleted file mode 100644 index a839990..0000000 --- a/pages/project/smartEnergy/index.vue +++ /dev/null @@ -1,75 +0,0 @@ - - - diff --git a/pages/project/smartEnergy/iotBreaker.vue b/pages/project/smartEnergy/iotBreaker.vue deleted file mode 100644 index 4641164..0000000 --- a/pages/project/smartEnergy/iotBreaker.vue +++ /dev/null @@ -1,326 +0,0 @@ - - - diff --git a/pages/project/smartEnergy/lineRoadNaming.vue b/pages/project/smartEnergy/lineRoadNaming.vue deleted file mode 100644 index 01f1205..0000000 --- a/pages/project/smartEnergy/lineRoadNaming.vue +++ /dev/null @@ -1,253 +0,0 @@ - - - diff --git a/pages/project/smartEnergy/load.vue b/pages/project/smartEnergy/load.vue deleted file mode 100644 index 2d68ca6..0000000 --- a/pages/project/smartEnergy/load.vue +++ /dev/null @@ -1,189 +0,0 @@ - - - diff --git a/pages/project/space/addDeviceList.vue b/pages/project/space/addDeviceList.vue deleted file mode 100644 index 45f9e59..0000000 --- a/pages/project/space/addDeviceList.vue +++ /dev/null @@ -1,247 +0,0 @@ - - - diff --git a/pages/project/space/deviceList.vue b/pages/project/space/deviceList.vue deleted file mode 100644 index f2c1d90..0000000 --- a/pages/project/space/deviceList.vue +++ /dev/null @@ -1,304 +0,0 @@ - - - diff --git a/pages/project/space/index.vue b/pages/project/space/index.vue deleted file mode 100644 index b2e397c..0000000 --- a/pages/project/space/index.vue +++ /dev/null @@ -1,460 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/tabBar/alarm.vue b/pages/tabBar/alarm.vue deleted file mode 100644 index 7215c89..0000000 --- a/pages/tabBar/alarm.vue +++ /dev/null @@ -1,706 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/tabBar/home.vue b/pages/tabBar/home.vue deleted file mode 100644 index de47f34..0000000 --- a/pages/tabBar/home.vue +++ /dev/null @@ -1,461 +0,0 @@ - - - - \ No newline at end of file diff --git a/pages/tabBar/my.vue b/pages/tabBar/my.vue index fe2dc31..25e432b 100644 --- a/pages/tabBar/my.vue +++ b/pages/tabBar/my.vue @@ -43,7 +43,6 @@ diff --git a/pages/tabBar/my/aboutUs.vue b/pages/tabBar/my/aboutUs.vue deleted file mode 100644 index 1dd7c6c..0000000 --- a/pages/tabBar/my/aboutUs.vue +++ /dev/null @@ -1,32 +0,0 @@ - - - diff --git a/pages/tabBar/my/addMaintenancePeople.vue b/pages/tabBar/my/addMaintenancePeople.vue deleted file mode 100644 index 8f89f75..0000000 --- a/pages/tabBar/my/addMaintenancePeople.vue +++ /dev/null @@ -1,68 +0,0 @@ - - - diff --git a/pages/tabBar/my/help.vue b/pages/tabBar/my/help.vue deleted file mode 100644 index bdbb2b4..0000000 --- a/pages/tabBar/my/help.vue +++ /dev/null @@ -1,50 +0,0 @@ - - - diff --git a/pages/tabBar/my/maintenanceRecord.vue b/pages/tabBar/my/maintenanceRecord.vue deleted file mode 100644 index 39b62e6..0000000 --- a/pages/tabBar/my/maintenanceRecord.vue +++ /dev/null @@ -1,170 +0,0 @@ - - - diff --git a/pages/tabBar/my/newAlarmRemind.vue b/pages/tabBar/my/newAlarmRemind.vue deleted file mode 100644 index d66f160..0000000 --- a/pages/tabBar/my/newAlarmRemind.vue +++ /dev/null @@ -1,168 +0,0 @@ - - - diff --git a/pages/tabBar/my/onlineServe.vue b/pages/tabBar/my/onlineServe.vue deleted file mode 100644 index 4651124..0000000 --- a/pages/tabBar/my/onlineServe.vue +++ /dev/null @@ -1,168 +0,0 @@ - - - diff --git a/pages/tabBar/my/passwordModify.vue b/pages/tabBar/my/passwordModify.vue deleted file mode 100644 index e06f799..0000000 --- a/pages/tabBar/my/passwordModify.vue +++ /dev/null @@ -1,166 +0,0 @@ - - - - - diff --git a/pages/tabBar/my/privacyPolicy.vue b/pages/tabBar/my/privacyPolicy.vue deleted file mode 100644 index d5dc7e9..0000000 --- a/pages/tabBar/my/privacyPolicy.vue +++ /dev/null @@ -1,113 +0,0 @@ - - - diff --git a/pages/tabBar/my/projectServe.vue b/pages/tabBar/my/projectServe.vue deleted file mode 100644 index c8259bc..0000000 --- a/pages/tabBar/my/projectServe.vue +++ /dev/null @@ -1,203 +0,0 @@ - - - diff --git a/pages/tabBar/my/setup.vue b/pages/tabBar/my/setup.vue deleted file mode 100644 index 4f8c143..0000000 --- a/pages/tabBar/my/setup.vue +++ /dev/null @@ -1,59 +0,0 @@ - - - diff --git a/pages/tabBar/my/userPolicy.vue b/pages/tabBar/my/userPolicy.vue deleted file mode 100644 index af8d354..0000000 --- a/pages/tabBar/my/userPolicy.vue +++ /dev/null @@ -1,217 +0,0 @@ - - - diff --git a/pages/tabBar/project.vue b/pages/tabBar/project.vue deleted file mode 100644 index e2e42a4..0000000 --- a/pages/tabBar/project.vue +++ /dev/null @@ -1,774 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/tabBar/scan.vue b/pages/tabBar/scan.vue deleted file mode 100644 index bdb6898..0000000 --- a/pages/tabBar/scan.vue +++ /dev/null @@ -1,300 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/user/equipmentManage.vue b/pages/user/equipmentManage.vue deleted file mode 100644 index 0faf191..0000000 --- a/pages/user/equipmentManage.vue +++ /dev/null @@ -1,323 +0,0 @@ - - - - - - diff --git a/pages/user/equipmentSetting.vue b/pages/user/equipmentSetting.vue deleted file mode 100644 index 9fd9d73..0000000 --- a/pages/user/equipmentSetting.vue +++ /dev/null @@ -1,182 +0,0 @@ - - - - - - - diff --git a/pages/user/instructRecord.vue b/pages/user/instructRecord.vue deleted file mode 100644 index 6960924..0000000 --- a/pages/user/instructRecord.vue +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - diff --git a/pages/user/renew.vue b/pages/user/renew.vue deleted file mode 100644 index 9b36dc7..0000000 --- a/pages/user/renew.vue +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - diff --git a/static/images/toolbar/alarm-active.png b/static/images/toolbar/alarm-active.png deleted file mode 100644 index 34e03153739ed24c5d2310e2f002b11788d23ebd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1018 zcmeAS@N?(olHy`uVBq!ia0vp^0U*r53?z4+XPOVBx&nMcT!A!0+L^(C>Ym@s06Ipu zB*-tAVZs521sfWEO=tbu8GV08=}8W2Z8-^{l?Lw%LtUQCHRHavCs6g$(bQMf-sd)1 zcZCD>F@5rMaSVw#{C39esz(X}4aY-NpGy??dD^2ZbTfmPDmcE~i&TeB#`WV*1EVPf+#;k8CD z67S8M)h){5)txmnws@14U;J&$FGA*ZMSpFSw($S{b>T>UQbk9eyXrwZp0y2L*EnrX z?%DOP?3dc3&gYlEmR8u!|6IFkx}pPTl-Q!iAO1(xYpi|uot|l6Cz!1M>$T;rXNzBy z{#>Dd@1ua2y^2bNt%gitJo8?i*k3NKIzRtJA22uhGw-LfQ}=UzfnBBlpDz@Aw*Aq^ z3)2t1Wj>@IbLfl8n#;fE*GhgC{h(~N+mLbU(HDm*WwOfRJKeT^b2F7{>{~9y?ecK? z);mFyYdKsxEmlO{(PS!Ed8Bp51ED$Xn{3Z~4D%>fVNeKhO6aTJGwbfvYZCc^^F0(M zX>a(MtUcxTZfg}CVN)Rni;GX3o;0)v&FD}+pVsmyk#{B&=a%Tq#_L~Im`|u#xXd;^ z_+2DpK5xXc8_lxQ&W3HPd@*NXYpdZT=b~tJu{Wn*{acb~tL~#;Ir*ngZ;NHI$)dE6 zo#`qqUHp^Iyl0=m(c0p+iAAjKkXuguJaw~w#{xK{OG21}6Mq%H&JIpiR9X9lm2(ES zqP+0K>hlL(G){iY`R~EV)B5A+bJZHocqfMR>~^u$x@%h#!tFm?ZIIMxtoH%wU&{`57!u0>;B)hJM6RYmj7l9^XDIWZJqcm$oUSBeu?w49Y!r_`z|o% rZ1Jtx#;mnec7mdj&<)i;&VN|-d$k;Q?pbgGl!-lE{an^LB{Ts5cS6iZ diff --git a/static/images/toolbar/alarm.png b/static/images/toolbar/alarm.png deleted file mode 100644 index f8276089fd19ec4bb6afa99b67a889d3214713c4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 970 zcmeAS@N?(olHy`uVBq!ia0vp^0U*r53?z4+XPOVBN&|dCT!HjVx&venZpc*5Q~Ue#+snV9i`E}Lz`$D1`mXZN z+$KW9AN*zwvu>r-;JN8?#DJc!{3(Cw&lK_sB9>o{-cWT>DT-E)Vr@=t*!XB z{^vLQefjK5cV6RFnJFBfdZK*u#be@0Il+n#_ig;SruweW*Hm>;r!OjsCFX%U0_@n` zI&D85;<~xwr}$s1443e~A~93#9cH}xXL3}0^`}qjd(CDk{F!%cW=z?y4|l>n;(7fO zKe+{Sx^>Iv$?iDuTWU%hcRY*6i?F3q++PmeU;Ff(!Av86pe1O>v|U#w+Tuf zTO>WHuF>_=>31KOJoFPFFRtAxP;~3_(**sNBG)bNSF?C8TxN0NZ!&j+<`MfE zyF+eP`>3* zv~JplAoe3E7W$XO(k?DL99bIh{OQaO5BZrYH&~q)o%eO2khsUxv!7G1eppZusQ%)} zOvgoj55->uR~!;rf1ow*q||zzg>&`4FiOwt?f+@8Byq}_iGru3e)RufKhXF`f5LRv Rd|=*S@O1TaS?83{1OU^)*PZ|X diff --git a/static/images/toolbar/home-active.png b/static/images/toolbar/home-active.png deleted file mode 100644 index 0b6140d3b93f1065d127ad06c7e382c5a29ba847..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 600 zcmeAS@N?(olHy`uVBq!ia0vp^0U*r53?z4+XPOVB(gJ)!T!A!0+8J6S8*|fdK#LSh zg8YIRHdK5xFL;pfXW<&wHy5{ccul8caD?6 z5&wrJ_xSp!30F<-ia)UAk&r^*mxwESuYTR76!_7u=chv8XAcouA=iGFi^_ptBSLJ& zLi=5>CKF)ZOb+}Wam7}wwBPlc$wXU675-}DRkm|pRCgS2G@Q5S`9dl7u!_!e#d8lm z&0SFz-KK7GROtQF?}~S9k5@0fc_3Sw-(s)s9qAy3KB>T1}-)>z7PBAQK|T zozOZ>i;?H{fdGcPwdvvgYj*3WZYWqTCa!ei``tj6pOtL?xo7N|C(Kmwp3Qt_VX8D! z<$Jb`yx01hbZa&wFIUQ$>9azuWGK7}wDVEWZx_NkC@&D{v Y=3k2z>g!Eb;shlTPgg&ebxsLQ05byw3;+NC diff --git a/static/images/toolbar/home.png b/static/images/toolbar/home.png deleted file mode 100644 index 4b899b9c3430777c85af3af50145674a23014cd6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 583 zcmeAS@N?(olHy`uVBq!ia0vp^0U*r53?z4+XPOVBVgr0aT!HjVnt=}SsTDvAq~7sF(QvcZ1DE^GR{TC61#J1>+H5!)Tr%&qO#Y;k?{{~e zf6>Jow>mF)M|A6Tsm<--)BG&<^2AjqKin?O|L#G$FXR3S8;Qf~4K6H826&rT9FUb0weDdO=$+l|EzvEvEZ+trGW#i-c Rf4~T1@O1TaS?83{1OUCT7wiB4 diff --git a/static/images/toolbar/project-active.png b/static/images/toolbar/project-active.png deleted file mode 100644 index a2ecbf2bc4cca75070d51f00560c20fa7ba6408c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 795 zcmeAS@N?(olHy`uVBq!ia0vp^0U*r53?z4+XPOVB8UuVnT!A!0+L-}F6ZcfL1Kpri z666=mU{K(2V8NvalRgCe$gxu9zTNnBqle_ScSn6w&dw-HiZFS;dUC^u=A%<63hQW9`23*0n2tlzSK)nz{AVuEYC{*Ur%R`euI|A77iY=%jfcR?J^{ zBh@CuukcL8g*h4dmK{nPWsa=LYC2?`s9Yp)S?z^&n~rK}jF?H1)7-_C6Y?)zNGk9) zKA3c2`2}UR?Sks-%l!_oJGcHznDmzm3(x6kt=@f3S|+FWzG)7tWA&CpcMm2%GE;G9 zu&!!gaJk(P-K^YhxF|Ix?9Q4z9yUJZAAEj0XWBK}vn4B(OIQlj&vL#dcC*o^enOws zYJ1%<2C;ZGAzdY-T?uAx?S;$Cer0ZUX-}Phv44F;lj7sL#q--kb(+`&!?QkHt9?sm zxm^1&#SrOQ14f0zVnPm!%x*o9Hh8@MFi*v6 z<6n%wUm3(P`X}p}P7iiN3Ji}}6g=W251yj*bI)LedAS0VFTzUgLh$M4ks zniYTL&b7jK6XHUuHV92|{Q7j210Vmqm~-s*IyEsbFCX5=q}I2zzW>dvqdlhQT;3?1 z=qT?rX578XNb#)Z<_FU=%Y(UYRvrDZq3yh$%GsM6-lp{(*DLMioP2KUX2!|@EB~C2 Y{LTHL=grI$H-l2Sr>mdKI;Vst0GUNsZvX%Q diff --git a/static/images/toolbar/project.png b/static/images/toolbar/project.png deleted file mode 100644 index af6e2e222a51437050d2ed3e2ef26c7f08c80337..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 779 zcmeAS@N?(olHy`uVBq!ia0vp^0U*r53?z4+XPOVBN&|dCT!HjVx&vcf0c*@|5m^4jyoTA?$FI2whkJK3H@aoA}VwrcYfkxP_Jo7K7U^L zZl_ z{?A>Kc8Hf~m#_HnAW!ihVRBAzEs=QdOPbZ*X{zRtfghgRM6 zF`25mk^8Y2M{bU%&Y|M9Z)=}hcgCJ@Y@RK=dxMO1!+D9_i%rzU6wPwn_P6syUz>A- z{Y|w?1$%^~(D}}_>igY(xShVY;mn*HtwxHvs*HU*Uc5Yc_;k=*--PlbH!7kwRs7CU zUc$TeT<;+D+EQzF Vfzj-Z0x)qgc)I$ztaD0e0szT5aQXlM diff --git a/static/images/toolbar/scan-active.png b/static/images/toolbar/scan-active.png deleted file mode 100644 index e30d3593f6eb8ea830aff316cfebacda456cb436..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1020 zcmVPx&wn;=mRCr$PoK1GxFc5%8<{%|U=qp(VP7+uo%`F1ANXdfqBq3|)>k;aM6su46 zGf4L6#|*B6G+rhei}^hI8_kRWen_?vh}ZK@NrZfKidd z%k9>svmIaw?yvy?(gomH<6e1eu!HuH0O)+CJWV@+og}~ieBxrX^3MN_Uwxhhem>O)`$Y_ph#m=VQvo&npaf)=H}}ToMw(*-Lo6qUOfK5d zS#jQTgaGN@20aUNXm2=36d;H9h66<71C_X*6B7Qqv|2VI^?4gZ{QL}X5P;=^6XAm- z()hGI&jQ(<#qKQBve=#F8*rZgUj!h#^wF$L8+u!+mo+=Fd{Jt1V0E=wB_Rpeg621L zU2EF2lu`rO(l<2G#+E0N5p|j;Okkt1?M%0P9OAd3c86O4GiC z{3vVTxC)H*3XnMET!lCTBz`6a$N-51h~jL4M1Y=>SSNp=r^FHQXI!s11`rP}LaVo> zU3^S^cI?<{%~V1IEE6t3W{a8B&djz{ujY`eQomGH+Y}yEfKk=L!3yv;PAyylw5vfh zF51GXRCMhm+V;L8w6)?fISMZJG4Zv43vv4a8&Ubq=Kk=uI_x)-cUS9m@k26OC@+nA qe4ZL3W4&u9+`c5>w?GEvB=8U2oe6%tRIH)^0000Px&(n&-?RCr$PoLzpRFc82=JjmLU)ShJP3&<&2Pl5Pi_awC^SuSF-jz3@nOg=DD zN-{obVwgXZNivxkme9wG0Q2fiof9j-qA1p@)oLT9TrKf^Zaa* zSqrcRcalL7ZyqgLOA&dq!6!4sLu=~H0Bv~UeRaurjHQ%=Yi=xL!f5e0ZS z98QceAg+D}Ml%#Ru5xG=)s~B@fdl);7~7_4`r$fQi0!bM$rQ6@1gNTNh;UqFB7iQG z3~dM?0rVu`*?m$CZ1ze^_0lw67t=yH89>dx(er)J)?K?@n*^Zl)H0j+j~N(+I0-<_ zru#8s%=a(oscRB|Wm$s920LiaC;kIQ&a!Oa-Xnk`zzQLr`krS3NB~C=@N7yNNB}(v zcy=cZB!Hd-JiB8Wh#eZPK?WbY-EIrR8D09=z6d&nx)0O5x3je0rIdS{{qM_kmj*5k%#_bd06pnq;cfl!4$mRN>3$7;srq~4 z&PJMI1D#$r#0YMi*y$Evp!Xb3M8-Bk&%zYi>y8lxNa4Ni0MYnB=&t63xc^;TEsa6u zaiMsOw6qWO#`fBr*gmk@FI;(y|)3v5HODQ&hh`erzHo82Km;h>`aa-lOE767kCIk>$ z6kJ0)l7s-Fiz)$}U>`^}a0FD+z!9)!wSk7(3Z5d&+x^=#FjRn8Jme%cFs4+mNdVU8 z;b5v8sVV$@BQhDl<`RlA_QpA1WZIXM@(XI=mX})W>eZie zx707FYP;CEIO4&f03+1G!HQA#Pc2jebOcyv+P`RXs!}m>jF6j~i_kWbQ@Agx1L#^n zg}CkWr4yCkZ*C25Yr=ko5YJ2Xy4V?YTY#6Qws%HP4YaWW96NYy?Fpdg8~+Er4!w - -## 1.0.1(2021-09-24) -修正说明实例文件中标签名称 m-tree - -## 1.0.0(2021-09-24) -基于leo-tree插件 更新编辑功能,多参数控制,更多功能持续更新。感谢原作者leo9012 diff --git a/uni_modules/m-tree/components/m-tree/m-tree.vue b/uni_modules/m-tree/components/m-tree/m-tree.vue deleted file mode 100644 index ce524e4..0000000 --- a/uni_modules/m-tree/components/m-tree/m-tree.vue +++ /dev/null @@ -1,270 +0,0 @@ - - - \ No newline at end of file diff --git a/uni_modules/m-tree/components/m-tree/tree-node/neil-modal.vue b/uni_modules/m-tree/components/m-tree/tree-node/neil-modal.vue deleted file mode 100644 index d84f9c8..0000000 --- a/uni_modules/m-tree/components/m-tree/tree-node/neil-modal.vue +++ /dev/null @@ -1,260 +0,0 @@ - - - - - diff --git a/uni_modules/m-tree/components/m-tree/tree-node/tree-node.vue b/uni_modules/m-tree/components/m-tree/tree-node/tree-node.vue deleted file mode 100644 index 4470398..0000000 --- a/uni_modules/m-tree/components/m-tree/tree-node/tree-node.vue +++ /dev/null @@ -1,353 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/uni_modules/m-tree/package.json b/uni_modules/m-tree/package.json deleted file mode 100644 index dd8e9c6..0000000 --- a/uni_modules/m-tree/package.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "id": "m-tree", - "displayName": "无限级树形控件tree,可新增,删除,点击,长按事件及数据处理", - "version": "1.0.8", - "description": "无限级树形控件tree[可新增,删除,点击,长按事件及数据处理]", - "keywords": [ - "树形", - "多层", - "tree", - "树形控件", - "无限级" -], - "repository": "", -"engines": { - }, - "dcloudext": { - "category": [ - "前端组件", - "通用组件" - ], - "sale": { - "regular": { - "price": "0.00" - }, - "sourcecode": { - "price": "0.00" - } - }, - "contact": { - "qq": "" - }, - "declaration": { - "ads": "无s", - "data": "插件不采集任何数据", - "permissions": "无" - }, - "npmurl": "" - }, - "uni_modules": { - "dependencies": [], - "encrypt": [], - "platforms": { - "cloud": { - "tcb": "y", - "aliyun": "y" - }, - "client": { - "Vue": { - "vue2": "y", - "vue3": "u" - }, - "App": { - "app-vue": "y", - "app-nvue": "y" - }, - "H5-mobile": { - "Safari": "y", - "Android Browser": "y", - "微信浏览器(Android)": "y", - "QQ浏览器(Android)": "y" - }, - "H5-pc": { - "Chrome": "y", - "IE": "y", - "Edge": "y", - "Firefox": "y", - "Safari": "y" - }, - "小程序": { - "微信": "y", - "阿里": "y", - "百度": "y", - "字节跳动": "y", - "QQ": "y" - }, - "快应用": { - "华为": "y", - "联盟": "y" - } - } - } - } -} \ No newline at end of file diff --git a/uni_modules/m-tree/readme.md b/uni_modules/m-tree/readme.md deleted file mode 100644 index c3ba475..0000000 --- a/uni_modules/m-tree/readme.md +++ /dev/null @@ -1,242 +0,0 @@ -# m-tree -#### 本组件为 leo-tree 增强版 -#### 本插件基于 作者: leo9012 发行的leo-tree v1.0.1 -#### email:121959858@qq.com -#### props -#### data 数据源 -#### defaultProps 配置选项,return { id: 'id', label: 'label', children: 'children' } -#### emit -#### 参数: - :data tree数据原{id:1, - label:'', - children:[]} 每个节点必须有children,无子节点设置为[]; - :divider 开启节点间分割线, true or false; 不设置为false; - :edit 开启编辑功能,数据true or false; 不设置为false; - :unfold 控制默认展开状态, true 为默认展开状态 or false为默认收缩状态; 不设置为false; - 开启后在节点右边增加 + - ↑ ↓按钮,可以绑定up-item down-item add-item,delete-item,long-press事件; - -#### 方法: - @node-click 监听节点点击事件 返回节点数据 {id: id, label: label, pid: pid,* 节点所有数据}; - @up-item 监听节点up上移事件 返回节点数据{item: this.item, items: this.items, index: this.index}; - @down-item 监听节点down下移事件 返回节点数据 {item: this.item, items: this.items, index: this.index}; - @add-item 监听节点新增事件 返回节点数据 {id: id, label: label, pid: pid,* 节点所有数据}; id:0时根节点新增,id:x, 为对应x节点建立子节点; - @edit-item 监听节点编辑事件 返回节点ID {id: id, label: label, pid: pid,* 节点所有数据}; - @delete-item 监听节点删除事件 返回节点ID {id: id}; - @finger-action 监听节点滑动事件 返回节点数据 {item:选择节点数据, items: 选择节点同级列表,action:number}; action:1上滑, 2下滑,3左滑,4右滑 - @long-press 监听节点长按事件 返回节点数据 {id: id, label: label, pid: pid,* 节点所有数据}; - -### 使用 -#### 本组件符合easycom规范,HBuilderX 2.5.5起,只需将本组件导入项目,在页面template中即可直接使用,无需在页面中import和注册components。 - - - - - diff --git a/uni_modules/m-tree/static/add.png b/uni_modules/m-tree/static/add.png deleted file mode 100644 index e5b47b7d999ea6798017adf66de51963ec6dfddd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1476 zcmV;#1v~nQP)D%@zO~0OtbxKyN?uH}GKK_fGK%TQ<}NU{T;a;8b9N%F6x~tl{jM7Eu#` zjl-APXoiFT5bpSU!25u|)nV=MvktHou+$7Z^bKCAXKDak3xFel>j5nwB@e0zKOLOg zA1#V61Z)lL6t2)(1J-K|M+3L?1)&B2n&bro6!|9n{YIee(8JELFmM!bKCsMyMasUY z4+wn$xDYsNfCAS6=Kwx!HOMP*Y53|XKXp)6C+Y*hNx)T!)L(&vfCoBh)4s_k^-f@s zWa-Jk)$QBoUC|YQZGh(!PyZ#bBk*PyMGE#9Og#at6z$O`Y!AFxz~|qkT>vnmdly(O z66TlR5_qdrfsX41;f2KMeh#b;{8YlT3jn_J201b92|QdP7%;$zsZ^J}!s`T0ukC0w#WF+fKbM`@kCZ-pz+oKYRFj1FufwQTMaTmpbk(0!30!SL(?DlyF^S4eUHx(GGt9H0A#N&$3=1syLZmfEf)YYyYGRf zcp>i{fah|Ai~s<2c{Y;cv#hSIA$TqTn}h;IBSWXR9N>NHN;NIOLd&;_f7&)DFvI2gEl%m7fQ`02BldSDy6 zxd8b78wWHr(>t5q?KT}s|36G;b-E*BRuzDok|e_-$i-u30qSINq{vU@T7VAav{L3R zpSJcZkUBxjbZOQ)k4m`!91h$X?VcZ=K@+0*>F(tO4JxbvHDpw{{Fnzqn_nW7`2Qm7?Dj0OgzlT#*R$N%VTOhM=X2hV_oz zn3|`}Q5!S*qGIX;fWj<5Scpi;Dy_ZyTJ7;AgRHpn+sORS+T)D^!v-Y24ucI=W?HMW zLq44Y5>B7!*vvgraxNfFfk$oujX;&OY&K{x$`P4|LMZM0UmF<}g9+R^N z;Y5mNuLV@0+5j|4Z5XOCns8qkrnF9(=?BJsP%`~0eMe=zQWj+AyHVLe=IKy{(V{<& z(==^%6RFRDPs5L$-q-&x!_rmm>1;CTdp~DWw~_Fk0x%Mo$5_bJ0>=2`j6}7m1&jpd eF%~lM7Vr;bUjk74?9C4V0000JJP)H zt-JT*%sJ=zpWk`TbDr};Eb@@L5PnNNT_s5 zfGP#A3-K(4`&~2hmP)-&%A6Ab%kxLp^i^PZAAL^u&^VNwL zz(dZmR01OaHj~ie6e|Lsl>HEGTbv#d8vy<1&Q;Jb2H>MDJ1#f@;x!SJ2p;x{5(sKO z(gI177=&Ogh=F8IS~iKq5D% zJ>hQG%xv$}PR9UrtN1NY9tay2!34ptxn}0cP6f?ZFJ(C!L3xbe`(~9B-s_r~pLAlg zBLJz<;-}%u%d;ZA;FzCCTwlI3{pU`EsMZ;}&5e-6Y4YITAY0?7^{4}Q{K!T6>B_NLSy~s-Hx2;PUQoOjlplw@ zpz1BFrc{?;WdOkvMB+eb^pCkcnJX~Fv#PYi<>CT>>4AAOyejyR+se7@<0`t;0oaA- z2!4JB0Qb6P=9?-;nw5zSz?2sh_JZ6L@`4w=obfpoZE65UMAI*E#=+X*1>h6cm4}U& zRE(T!079e`lMJD%xRNx_u>B(1{7H1hRu@N+N8=vdF{LI8jvYlTM_(JVBpSZm|Y&_OZqY?mp)Y$=< zI_Q}C1hBlEaaX&>=leg-7!cS=S&kLnEQ#QL&osW*PNNcllW z1MI?94cr|yPN{i-?c7h`J5d`ypFt47E;nb)+O;;*qXa;=ir)a`7Z=hpD1w_k)2J`q zT?WC!*Ams2LjcCTm6?kdaw6mtpC}I-Gs#;E0!ki$=?jnX@CnR9PK63k25H8|?5Pq*g!9L`b)t2LaSKW&(NM%VlRaZu3x32B6!{9RMB<0r;oe z*RvX5Uwx(>WtG(;>XBHz&FSs%5fC4&Pf^ABACy-HF!0D*dSdd-JK-B%fo%42+4^Bb z6cBNFK*}m?Ci%nAz?^WaxD=a=2^Brc0D{I+wsVlcP2pgOgm$GjG&rteELz#g`<=|rEL!qEEAsW`Ith*|r+LZ|o zXbApc&c#TTY1O%3vk@IY5DQvejcHhSt|6?ji=Rx0JU{1ZOyg&~;mq&b!E5}#BLLF@ zvG8qzKWb?3j0o;fNkO9u4a)0Qaf8r*V(#TA?r}{c$OR&Q9RrwxU={X|+%m_iaIbq& zWt-~Rd|TCz{&l&2M%xoU`JGwz&eQdHO+d>B5|DQx+D`BI;69bp*`^Tk(wnN3h5&zr z0ISAkEDo_@1q2b)F5dA(gZSXA4!S4F$sL>l$m{_ z+s+5|V*@Z16Y`~1tW5 zP%?P^K^d!{XJp|&lx!H57@o>LL*aoqA4bNO2Sj$k{L#J@XaBR7T6Haj*MzRIf{oNa z0K6^2w;}$U<=*~3{a-wmjtuEMRERYQo(KJ1n_L3WHNp$Lfh7;Pzz48v`AZ(qHNp$L dfkp2D{{=NeLv9q4;4c6G002ovPDHLkV1k4Oz7+rf diff --git a/uni_modules/m-tree/static/down-rect.png b/uni_modules/m-tree/static/down-rect.png deleted file mode 100644 index 5b323cfdb0934b9e393b48c52c7e7f96715c79d1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 611 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=jKx9jP7LeL$-HD>V3PH8aSW-5 zdpljx|A>P~OM3PXMi%~s>+KoXxr9WRn%Mp^c<^ZOu`+SjGstj>G_?djn4ofY8K;zx zkjgVJJxxx_!nYSIb!YF}eD~bBTI=OP^%*MTUy^_ZiL@_)N`wQu%M9%E^+OyR@!rGVJ+&nn7+=jz`R9C8fW+szex^ zh41|qaR|B|F!lG`;`N0x=R+f-x3zITU^w7;vu(-icBP_I7m}D}Fn!=iXiUuMIcD6T zD)=+$jWcsV&q1>W@3xJGQr1dEM{hNAEodlUPMDio;PO1o#cakcDFzei#!pZF^G@Jf z;BnBhA@-Rk;|_s|wwu(xhyFM|=X;&p0pX8FU&tO<)RE%Ipb>Onjce4~UZxPqMka>U zVk@^^mtaWJ4a#00$j}nCcPwd%sDs2P_r~&04R^F!|b|sJC009`J8n5muec zv?8i|)z<4$4V+nlTfarI1}qf2n*H9MK_a~S)z<4)4GSAhe7`T&u#z^se52X_Z}E;( z;?dJmvzrel2p?Ep{LZfL@ouf}8?UdZ<=NPq^-_{SchkZbQA|#jn!59+k;18CUY$G1 Vu{vq_Q(&rL@O1TaS?83{1ON`%{Ote$ diff --git a/uni_modules/m-tree/static/edit.png b/uni_modules/m-tree/static/edit.png deleted file mode 100644 index 717b8b95afe3249a9b902249c229d01d483308d2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 879 zcmV-#1CacQP)VK%;kCKJEz{>#mtTue*;fz-X;tFWzODcp@(_vuC>nA>7ws!Bu_#g{7vm~EJ^V1R zKigLkfM3wr@c0E#A=5QfwL!(JzlZrWu?E031$@K{z$0Lmj{`me_p3q@uw6seRp2b} zv!Wkg@#@w)1#SXM0|eG}Xo&c0z}oyM?*hwRBA+_Lngc?`uK+$(+1_dm zXkEOe6zD{}6#yaP?*U5&wY{Yj2o=8!(1Ti8+Y4+><`_-^2lG>7T^7Nn#cu=7r8dXGy7^rm0}CB(pFP%`1B$A06%UEmIRB<<$Aax<0L)0%=```V6FBK8CPcic z6j%=&0Cdyh3gIcRz%%kGUo#HS-IoApT0MoZD}O_hafQTdoPXu$l(OB-0Lb2uR6(dq zyr~p;4ouI4DGOmAa46aK0+?4r8q>O)R&n~+-U3sy!mNET(KPhS$@{{8&r|lvjNaVVynLV96JQOX|NjEeMuE}y zH>2z_#57(fA4~irp-*3pdBrCJ@WR%kgQ5d^6ihEEe*oMBEKnp636uZ;002ovPDHLk FV1kO2k7@t_ diff --git a/uni_modules/m-tree/static/editBlue1.png b/uni_modules/m-tree/static/editBlue1.png deleted file mode 100644 index d82b558e3d7b82cef10ee4cf0ebea4ced57398be..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1109 zcmV-b1giUqP)a$PBrCZ{GL*zwf>G z?PecggFm#v^`ih#WWWX|P?W$1Pk^Ec7A26j1dPdBFH^kqDS*vs-)&|eIo6IW{1|?? zoq!L)_&4qmUo9LMzM-L_Cq0aO1D%mB<n@~`%hUcN&rkR{DBC27(5<1_9rr@onCJy zegy*aROH$RRAW#AFz5x-AbOjb#v-?LQq_4U>{^Kj^ZhzwWU*{F%2nlAR{*jWp8#4n z06HOl-2fQy!gmGX$EKe@){yqAOGEn%SQdYtfSzY+x=r!gXFyBwz=L|sJJU40W=&Ds z43LRu7P}&M_^L{$Z)Kw;fV{+OSps>A*A775;a@HDbr9dR63|6_ zR{-cFK6e1RiO(ItpdVZUXyoaplyv*78lK??V*>O!n5S#5{f?}G=5h;|Q#S{&6i-C6 zrG4h6>LmhJehkS{d?Hp$0EQPF5=3Xf{7Y@l+VcbggCE5t-pKN*(-Od-7ybi+-AKn3 z2;l`{ajxc;F3Qq0&AN5~`p*Shdj(xvErP)lkz*fBBTUs+I{=0sel39g$?tUp{&k6I zYGJN)0mrGXDk_bgUI4zm^MZMA@ozx<#4P;z^3d%xV%B1-7XWXz4|6a6*QwKP21qXe zYdOL;-zfm-_(7=6LrwL1kpV>pX!ue;$DI`q3NP9*?|6VngBAmIP`K*o(2_$`Y;Nm+m@>oL$L zfbAeOM))|zq?j@QFq7d|$BA$_%TZYsfvPr*uiVVv)L?uJcazc-t2%(?D9lRrCB*zD zfNdc3s|MF`JH}lGpHdl)Tpdel038>S^9BWgoPle%U6BFW9ZAjs6&a8-aP77$GC;c{ b$vL3MmvkL&tOGX`00000NkvXXu0mjfj?@7; diff --git a/uni_modules/m-tree/static/editblue.png b/uni_modules/m-tree/static/editblue.png deleted file mode 100644 index f2628f8ae9fb4ad9c08954c9ed1c58e421c78775..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1134 zcmV-!1d;oRP)QjBM{K@T20Bt6Wo z2#OaG^it3syi`OHJh>p$l8Gh(53<#nt!*{kX7iOzjn3{)c4lX0XCK?y>wE9_-sk)K z{(f(FmJ!_IAGyW(kqMAFV3-uJs-t7LygP0%-Hg8b;RN72>D}#?vqe0T;w4?s$C`$ENGO?s*fw{*4Hxw^{p{ zQ!PA;IazNX?+`$@?Ds|RQm=?HT@Nzza^%Xekr5 z1OP&nKtyXjEHyc635+LxkTQp`O z117XE7Ci8!v#)-n{gw$;0xAd)6aKujJO4P2Ppk!BgFa1g&;s-ezA1+C4(KPm@&d$x zC;6>=+s;S*Y#-$oNWBThhR=^ah7))E71V!~EP=G(l`Mfc@F2f;@}m!j$^4cxlyX39 zcxaEny!~pB?Un2SgMe421O^4KgaC2i3H;!4@1b68uS^NVg~yKEVfVyj^M{)6M=LG9 zF2He6_K2YDoGi?>KN=fY6YM*D*?vApe9)o{@tR{A^8kT<{^^|cbXlnboG6HDj z<$JJ(T5WcsrkCxLLX<+m#DG_-1hmr9lfsSDtnWM=Rs<4DHySt)CG%V2D&v4L%btVa zG|9@A2wKU0H3zhOA=x^36TXi8!E5HkZ=syB%_L<6@O~i)5+NygrAk1z>=hB*{eOl% zPOui=$cenw93!z>NB;h}nOCm_N_NNp@?IzCmi-QZXQY9LoKwcHacr;LHK>*CnH=$z zA5=>@%r9%r2ALGRG9|EGvuoNNf)zp*YQ@6YB*B#`fiY`ofx`U)u53Um5LB?1uOyvq zKLM4w1^SWQFflU$RQx#{CUZ&6$sCY5K*1+MN!dG0oU8=0639wGt%ssv>Nd$aSr16G z2N0_Qe3WE{Qi$~e1b2G(VbniHQaEfXTVw)+bbup(o=Qqm-h|{It~s^OyRB+3O!QR} z5}&)KaipsN%~xh*Wc{1~2l{%Nw1X3iH<)|k$}5wLT?N=2Bt?Jk=V^j1c1iopN$r;t zRGpWN3x4s2=B=@)Vr2qERc=_;WeymYOh)DS2Xzm~Zafx)YybcN07*qoM6N<$f&l6f Au>b%7 diff --git a/uni_modules/m-tree/static/falling.png b/uni_modules/m-tree/static/falling.png deleted file mode 100644 index 749603307c7e6d63f2e5b5b5ae1aeb7c2ee4ffc9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 746 zcmVR0>6_+4zIf`hy}`6;ZK>N-q(MC|U~Y6KUcj+~x`F$cblb zHg}io?rkEO`|~b)v)|8tXJ#h|J^x_O^#cQ72lSi(r$EmQz(tT#fK#C71ULnHZUF8A zoC0m7fH(TK4S3@I-}rR+K*lGxUGJwg2QUD30H*-g04{>u1-K3JJ%BGlQv!Sw1rTGRB?SMuFw*g=<`hFG>4*+3LM!}j6 z1Z@C=G{1~QZ*=>(DS$zeokxIAN1|y*ituJr2wDKVBs&EFs_hy$!34lC$yW&IgCe#; z{OMXP0F%Y05Oe`}X|@Uk?-cQf_hjTha^iq#5EBSG0K7E61VnGkB9ZX!IQAbm6+d}i z+X1E!ngSRkKdvAgriyrgt+5E6=!mxhKsOzl02n4&OaQxOkpyt35WzED@zwz7K&T5~ znC91s=#?s-ZWSVYZX(_)fTj@Y0Pxam9SB}jh}@7OsQSJ!591n8j##%aE&||<@=ZXh zI^lIGf|rez&RAd_KwT%y129Ok+X(PfDR_uC#*zQpmU!zaaC~EnoG=T(Fv+$EKxt`6 zcx@c}N+C3bu@nc?X_3F5DZLd2z@LElP$_r>aS;cJso1LZO9ikf9TWh^f&AGm0Y!xf zk7f?b6qXKPE`&v55Z7en?=5=F*^%lyRWm`AyVTtaS#U83bCDB7ARIYvtcL z1yBb960VG6|Dy}>OKpSm1k7rY1aP4c!M-c;tpTWV0s);XM0ns*e5(Ndfk1dh#{Os5 z;#&tWg&;-nwGHu|0MM53X;TuqyB3cf(6tkBy&rafYvNst c*Lw&20(O(WP(@aCod5s;07*qoM6N<$f+Lwipa1{> diff --git a/uni_modules/m-tree/static/reeor.png b/uni_modules/m-tree/static/reeor.png deleted file mode 100644 index 8e7017db80c0f450bd47b902006cf0a73ed72d72..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1649 zcmV-%29EiOP)hv=ZU7S}I5`4i zJOXnA>j29F%K%GOzw=Z&`~bWPybQbq{4@^TMr{EubXQu7^bH=Vr~3f7F8~ezt^l-vlw7DL{AA_aes58H zHeh{Vv+4*fS2JE~I2gFDD+ql6ph=!tqsZ6Q|E~tx7TvUt*@1(AGk^tZ1}XdOE+BLT z;4I+e8U-!~P6Z5YeUL}uylU4|e(IpCp{NT0M*|lpQhx#V1nwP5oAybD)SH1hlA*@{ zm$XlxdBm^)Yydo$c=|7ZO@TLtQKVpw$<$-OV$mFZ!p6W01$_P)It&12bngI5MZ(qKL3LF{nGix*p)k3qV6aYQ(2@z)#o23DNo9N0auh)5%km1jy>aYQm z<_A7X5~sU>-Esw$05BJzql>e&Ht!p91b1fN%7f?Vwl{E7HPA47&VWhka8dN#LTbU> z5L^O)A?VIXkYKp`zcna#DB$h~5`^6WcW4kP#|kjkZGYf~hDmPB2T4>Az*};VE&;&M zvqi+z)c1%1LiPY|O%@^uI|2_h%+r~gHphB7XD{IP0kYKP@aVf~_vU>9U}g6m5SkbA z-UN8IMMxb8nyAIhqsd$se^1gg$XR^Q<(Y_|VOd>UQ}A31Sfg@eL55CmA;877Q5^^> zwk7aXHF+!Gp&=J93mYxpB>ri`oWv*>fL)Ta>+Wscw({tE9SFZx6`yIX$IB`(_7}?3 zB68^wKp+F{ljC%A0Wk3~0Sa^#ppz@1oq@ZP^Zj#`PRF^uR%I9~S-g6vlO=MX^MMoF z6wC#{lGeB!=p^9WHs&?o>p+Nyxp*@?dx52-PH|~`ZK886zgz(Hz=p6udga?nHLS)9 zg5fl6kak(Ttko$FeTGtx-ayI)K!uIZfwJRljr47R`$qskoIEMER{*X_ij21GtO@m| z-4EltSb;j(90`==r*bVohjM%=^8|&u^KZPC;$C83PS7@8TD8u!F}VQj2V5V`E)9cq zi#H60P&$e*Xe4P%yR#c2CKYyo0+|&q+;bviKVjHhpe_+wD@opJk7cd}XreAUHr2jU z;V#*ry2PolT_H z{7{$gX;ajTQ``05<}xig0)eM~Kz|UEaeh>{K}~C^Ym0k_7+0;WI1B@Tofg~9OGMl~ zZ(eKrs$(2vgXWc*ixH1Z*4YnA4g-L5o36&Z(jGMkYXgS4^lEG);Kfq(hXp`6I;RU0 zfrdnnM{5dNs%SOdCpVVn>E);wGy0-p>H>hmY(N;MQnE{H2<+>6eBMe{-1!YM|F!G! zpg_|DiLa`M4R&T)yR!{j=K~2}pXk`EJyP;rKwJWk-2#F@m9%YE_b|#QGB!X=rG5X` z21fiu#ybQZTS``vhX6MguQ-{|^$5i5d>deEJH9wg^@|@#`9LatB(-A3BdNE5?Err} zQ=b5+j1MD?#TG(+Ka;aj;)@i`UJK}j`UW5VgXZlbH<|D!~(_w^Ar{`?JeMM@HIwI6A;jP00000NkvXXu0mjf`x^Fj diff --git a/uni_modules/m-tree/static/reeorblue.png b/uni_modules/m-tree/static/reeorblue.png deleted file mode 100644 index 7ece52fc3252d0d09242a867f6ae662d72dc8ae9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2248 zcmV;(2sihMP)YG+u`E=uEUQxb1v5RHpkT@n?4C_x%x-r2SUtNl+cP_}b9<&Y zA@26qzW3a7e)rsS&pr1NQ~cu;w;$60rafSa6PR8CQ``ZjgW&WMIB!cJdu&#;_@C<` zyasd^5WEtQ1psG{=pd&=@F!v9^?}IyUc=fe&zuk4Ce;IC+5QD6x+^GHD#S+#L{y9t zph&?XAzq+xuWcmWQt8)9n@IsMCwp{JNAcWNfXj&X;*0pE!Y18{9a!v!Znye@)%f=67U9|ScQ zodW43(FMU`5OXJhcLu~#JEi|R48WlPh?%*y0C$m?S*w&ljzHKaBCizQ)n7vohbL6L zM>?YOtxu3#0?0Cw3&+V6xPYV`BbjX%LfZhMW^S`aZXd6t{980^FC5o1O^t43MOJ1+ zT`NVG+ek!fo4Jt9g>-UfI}q9e5YOax0NhkZfgjs5i(7ElqEqcCSMD2s#F{G+e3wLe zoIK$U+emC_b)1#~#LfISKzYbNum}bTe#tfx&$g=2MEzo>wE~nU30_jwPI#YfB!1Y+ zm@NT__2xebS6;1(^n&AVByw}%?#{ooqKImrxn}?M9dHkVcz?N%w?hEhryZl~_o{Nr z?Sccy9-9>}p3VWh%BR2}7`eeocm6e~0VK-{!? zKy397Ql#8EkV-xuWZ-t&#xvG!UV>D;1SRVj$-9Hd4g_FM_VD}}MeXkZW>p3eJZu~K zy+H;It8Lu0egxv4iYEdx>}rcnt?SCEju8kz%(T2n{4JmHCsD-J_ImwfqXA>4^{8k# zR7mMhsw(BRi}hM5xVY9a^shCPo$a5;VfP>Y#7PAE9YbHKI+i+sr;c74KQny1Dobk; zeakt5m(L5aMioM|*Sb>^JmDE3!cC5mc%YF%aWj7(C_nIdLD896jHzzH$^g7Ah{QhM z>>sx~5?5m_&(%{dX6DzC@~GcEA-Kaa^!*df&d64Wy;X-O;a6=V@mSq{BNOwce^+oJ zcNWsgr&PQ^9Y7{`kl<&>0C1OWB);Bgkf@noMas|ohIpRf3c3dj{TKE6%`>fAHKMP! zj|f*6jKrSCUXa@ba=j1sD^6PfOn3l#M2lZ;4S?n11>h1l6;k?dCmN&ygrWdT3u*mD zf8SB#pYhiWN=v7S@t%yRnZHS+{H6jxFzB2}%vMRkl{_G7=02j4hy20MzB~~}H;c_E z*M%T5OlY68jl{1?24t*T2pnj|_|o`&5{aM4+ttBPyHO=EQUVam?eWYb&Hw z=qP;xm`++>r>dOSF4mjB9U@QHREW+BMDyqNUO5cp${@y<GOnrwFOdd=36y>BoO9SYh-2X6JW2C)>k#tQ4N4;?IW>b41oGR zTdP2{H~$5SJQq3uU-C4%OhW{a$@dacIb<};&Kgl4T>|4~-?y|{_JU|8w@Cwc1dUT_ z9+0sfB=F6k!u=rXt$(k8;4W;K%i}~uJMo| zidNc6Cu18F!OCW7cL{#8AW;fjnIkt6#aDd*2Auhc%R)_rM4oRs7pRj6xx~i`DSa$? zYhb7n0E}FC4ES9&>{Pg&Y_K*JhRA9Aggy^Fbem1E8i0})ST7S;;@h+*EQFlb!%)V0 z7(nGnRPZl*R>wkodEwc5^6SJ6nZ)DpQ4k-fEK$Yv zuN(ushI1c(D;^m-`%d+NMK(C;WThA}ZqFaRG$~zhD%1kX{i_Nhz=T<6%*<^d`8}U! zp0ta&0_*kC4%6&Y_JEOKXzeGk+#d`P(XMgUb`3P#``amriF7*YpEq&xN`kFDuaSfdu4Th_=l+(Y0HpI$IY)R%XP8`_}?)56R1F+qfcI z3P!SW1a1nlPJ^~Qpe%3niA<*6!>G~|8SpuA<>kOnWGLMPJ8Sh8?<5Htc3OYD6{G!q zLIF@(pS{-25FDtwI32I~*dr;T-*wRsjnp8W0(25cG<_r`^2QMG#nVRejdqRq`iBOf z6ce)j3piZdCg7^jpUHXEV&EZX{?Hb5UpEwn@u34KD>d89eRu}xRb#r_ekkd^{-E>? zqoe1&|4_1KT0(d#dw{}yVLpruEe{Cng4tuU=AHZRVrs?36yD&w#_|qQ{{-;12;YXd zZx&|E{`3FEW9h(Y*t W(Fc81`y$Q&0000Q diff --git a/uni_modules/m-tree/static/rising.png b/uni_modules/m-tree/static/rising.png deleted file mode 100644 index eac2cafa6a0d4f999e2f9026996176ef4699288c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 853 zcmV-b1FHOqP)RxqJoHs zAR>r%BO-!`G@A$_f@Y6w(-6%fF~$2xa^&9@hKze+2~#2AcV9cYbqm*Yl(#Br0GW{2yTE z_mpF&RVhA8LPBB!LctG+KLBvNs`WH(35f`Z2;XP^2qwp?%|3}!LhJ%Y!n3~u$}J5_ zU-;fjg-@K%+wH?MkK>XMtAMfa0g)&G)CJK=0rs;GIGw8XC=Lm+2^a_O)r!l7wYSTn zfZ+G(x_g3wQv&Rl9FwzIn|+{LLM#IQ2OmI;5)k}1RdIB@Qr=8+Y7}zsuHvahzcJ?z?Ou%TVr5Vfc?(IcDpinTSbDh02%nG z0(!ytu1xS7L$HJ&KEv)*ty{7Zlmy7a%LwRYLh}%qFADAOlaMR5sCLhO_{kyfQ&UAb97{Yj(wz80VCcA=zxl{ zMtTAouE~IGhhXMgzzF#FOVKC+remxLK^+!l)+l8DDPS_dWPmvcW%?kr item.key === key); - - if (item) { - return item.value; - } else { - return ''; - } -} - -export default getDictionary; diff --git a/utils/mapCalculate.js b/utils/mapCalculate.js deleted file mode 100644 index 59b21f6..0000000 --- a/utils/mapCalculate.js +++ /dev/null @@ -1,8 +0,0 @@ -// 处理多次点击 -function getLenPx(str, fontSize) { - const str_leng = str.replace(/[^\x00-\xff]/gi, 'aa').length; - return str_leng * fontSize / 2 -} -export { - getLenPx -} \ No newline at end of file diff --git a/utils/publicMethods.js b/utils/publicMethods.js deleted file mode 100644 index c058d8d..0000000 --- a/utils/publicMethods.js +++ /dev/null @@ -1,32 +0,0 @@ -// 处理多次点击 -function throttle(fn, params) { - // console.log(fn) - let that = this; - if (that.onoff === undefined) { - that.onoff = true; - } - if (that.onoff && fn) { - that.onoff = false; - if (params) { - fn(params); - } else { - fn() - } - this.timer = setTimeout(function () { - that.onoff = true; - }, 3000) - } else { - !this.timer || clearTimeout(this.timer) - this.timer = setTimeout(function () { - that.onoff = true; - }, 3000); - uni.showToast({ - title: '请稍后点击', - icon: 'none', - duration: 1500 - }) - } -} -export { - throttle -} \ No newline at end of file diff --git a/utils/qqmap-wx-jssdk.min.js b/utils/qqmap-wx-jssdk.min.js deleted file mode 100644 index b8fbad4..0000000 --- a/utils/qqmap-wx-jssdk.min.js +++ /dev/null @@ -1,3 +0,0 @@ -var ERROR_CONF={KEY_ERR:311,KEY_ERR_MSG:'key格式错误',PARAM_ERR:310,PARAM_ERR_MSG:'请求参数信息有误',SYSTEM_ERR:600,SYSTEM_ERR_MSG:'系统错误',WX_ERR_CODE:1000,WX_OK_CODE:200};var BASE_URL='https://apis.map.qq.com/ws/';var URL_SEARCH=BASE_URL+'place/v1/search';var URL_SUGGESTION=BASE_URL+'place/v1/suggestion';var URL_GET_GEOCODER=BASE_URL+'geocoder/v1/';var URL_CITY_LIST=BASE_URL+'district/v1/list';var URL_AREA_LIST=BASE_URL+'district/v1/getchildren';var URL_DISTANCE=BASE_URL+'distance/v1/';var EARTH_RADIUS=6378136.49;var Utils={location2query(data){if(typeof data=='string'){return data}var query='';for(var i=0;i { - let time = new Date(timestamp); - let year = time.getFullYear(); - const month = (time.getMonth() + 1).toString().padStart(2, '0'); - const date = (time.getDate()).toString().padStart(2, '0'); - const hours = (time.getHours()).toString().padStart(2, '0'); - const minute = (time.getMinutes()).toString().padStart(2, '0'); - const second = (time.getSeconds()).toString().padStart(2, '0'); - return `${year}-${month}-${date} ${hours}:${hours}:${second}`; - } -} \ No newline at end of file