husilu 5 年之前
父節點
當前提交
f3cfadad0f
共有 53 個文件被更改,包括 1221 次插入1162 次删除
  1. 1 1
      dist/index.html
  2. 1 1
      dist/static/css/app.decc2c0ed41767717bd8a0da16839868.css
  3. 1 0
      dist/static/css/app.06ba417bba00d4d4ae9262ccd569206a.css.map
  4. 0 2
      dist/static/css/app.851aef8adfded118e5d9626f8e74457c.css
  5. 0 1
      dist/static/css/app.851aef8adfded118e5d9626f8e74457c.css.map
  6. 0 1
      dist/static/css/app.decc2c0ed41767717bd8a0da16839868.css.map
  7. 0 2
      dist/static/js/0.b1ffe0342222d42d30df.js
  8. 0 1
      dist/static/js/0.b1ffe0342222d42d30df.js.map
  9. 2 0
      dist/static/js/0.f59512544ea5daaf0f26.js
  10. 1 0
      dist/static/js/0.f59512544ea5daaf0f26.js.map
  11. 0 2
      dist/static/js/1.7c4426ec63e0c6913d64.js
  12. 0 1
      dist/static/js/1.7c4426ec63e0c6913d64.js.map
  13. 2 2
      dist/static/js/0.1f7d5f249e3c0ba6050e.js
  14. 1 1
      dist/static/js/0.1f7d5f249e3c0ba6050e.js.map
  15. 0 2
      dist/static/js/1.bed00224467824b9d37f.js
  16. 0 1
      dist/static/js/1.bed00224467824b9d37f.js.map
  17. 0 2
      dist/static/js/2.ee4f118745a92e4499de.js
  18. 0 1
      dist/static/js/2.ee4f118745a92e4499de.js.map
  19. 2 0
      dist/static/js/app.2f0c076ac1e58a3f9b41.js
  20. 1 0
      dist/static/js/app.2f0c076ac1e58a3f9b41.js.map
  21. 0 2
      dist/static/js/app.93b28b51af4ba5a9f3c1.js
  22. 0 1
      dist/static/js/app.93b28b51af4ba5a9f3c1.js.map
  23. 0 2
      dist/static/js/app.f0cf86c175168ddd9266.js
  24. 0 1
      dist/static/js/app.f0cf86c175168ddd9266.js.map
  25. 0 2
      dist/static/js/manifest.38a039a674155bc97f38.js
  26. 0 2
      dist/static/js/manifest.6043e8febffc5fedf124.js
  27. 0 1
      dist/static/js/manifest.6043e8febffc5fedf124.js.map
  28. 2 0
      dist/static/js/manifest.f70b6a297299eb536d5e.js
  29. 1 1
      dist/static/js/manifest.38a039a674155bc97f38.js.map
  30. 26 3
      dist/static/js/vendor.8c259e863dd7ec222de8.js
  31. 1 1
      dist/static/js/vendor.8c259e863dd7ec222de8.js.map
  32. 0 66
      dist/static/js/vendor.67a2de3c2cb78ef4987e.js
  33. 0 1
      dist/static/js/vendor.67a2de3c2cb78ef4987e.js.map
  34. 24 0
      package-lock.json
  35. 1 0
      package.json
  36. 0 22
      src/App.vue
  37. 6 8
      src/components/TestCom.vue
  38. 8 1
      src/components/chaoge.vue
  39. 2 2
      src/components/chaogebrush.vue
  40. 8 5
      src/components/myList.vue
  41. 50 0
      src/components/mybrush.vue
  42. 0 0
      src/components/test.vue
  43. 3 2
      src/router/index.js
  44. 1 10
      src/router/modules/router.index.js
  45. 13 0
      src/router/modules/router.page.js
  46. 9 0
      src/store/index.js
  47. 11 5
      src/store/modules/chart.js
  48. 2 1
      src/store/mutation_types/index.js
  49. 889 889
      src/utils/BrushController.js
  50. 108 107
      src/utils/BrushView.js
  51. 5 3
      src/views/homepage/index.vue
  52. 28 2
      src/views/panel/index.vue
  53. 11 1
      src/views/trace/index.vue

File diff suppressed because it is too large
+ 1 - 1
dist/index.html


File diff suppressed because it is too large
+ 1 - 1
dist/static/css/app.decc2c0ed41767717bd8a0da16839868.css


File diff suppressed because it is too large
+ 1 - 0
dist/static/css/app.06ba417bba00d4d4ae9262ccd569206a.css.map


File diff suppressed because it is too large
+ 0 - 2
dist/static/css/app.851aef8adfded118e5d9626f8e74457c.css


File diff suppressed because it is too large
+ 0 - 1
dist/static/css/app.851aef8adfded118e5d9626f8e74457c.css.map


File diff suppressed because it is too large
+ 0 - 1
dist/static/css/app.decc2c0ed41767717bd8a0da16839868.css.map


File diff suppressed because it is too large
+ 0 - 2
dist/static/js/0.b1ffe0342222d42d30df.js


File diff suppressed because it is too large
+ 0 - 1
dist/static/js/0.b1ffe0342222d42d30df.js.map


File diff suppressed because it is too large
+ 2 - 0
dist/static/js/0.f59512544ea5daaf0f26.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/0.f59512544ea5daaf0f26.js.map


+ 0 - 2
dist/static/js/1.7c4426ec63e0c6913d64.js

@@ -1,2 +0,0 @@
1
-webpackJsonp([1],{"2yKw":function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={render:function(){var e=this.$createElement;return(this._self._c||e)("div",[this._v("homepage")])},staticRenderFns:[]};var a=t("VU/8")({name:"panel"},r,!1,function(e){t("JohG")},null,null);n.default=a.exports},JohG:function(e,n){}});
2
-//# sourceMappingURL=1.7c4426ec63e0c6913d64.js.map

File diff suppressed because it is too large
+ 0 - 1
dist/static/js/1.7c4426ec63e0c6913d64.js.map


+ 2 - 2
dist/static/js/0.1f7d5f249e3c0ba6050e.js

@@ -1,2 +1,2 @@
1
-webpackJsonp([0],{Myn3:function(e,n){},QvN8:function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={render:function(){var e=this.$createElement;return(this._self._c||e)("div",[this._v("trace")])},staticRenderFns:[]};var a=t("VU/8")({name:"trace",data:function(){return{}}},r,!1,function(e){t("Myn3")},null,null);n.default=a.exports}});
2
-//# sourceMappingURL=0.1f7d5f249e3c0ba6050e.js.map
1
+webpackJsonp([1],{Myn3:function(e,n){},QvN8:function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={render:function(){var e=this.$createElement;return(this._self._c||e)("div",[this._v("trace")])},staticRenderFns:[]};var a=t("VU/8")({name:"trace",data:function(){return{}}},r,!1,function(e){t("Myn3")},null,null);n.default=a.exports}});
2
+//# sourceMappingURL=1.a27636fb3d854e13d6ca.js.map

File diff suppressed because it is too large
+ 1 - 1
dist/static/js/0.1f7d5f249e3c0ba6050e.js.map


File diff suppressed because it is too large
+ 0 - 2
dist/static/js/1.bed00224467824b9d37f.js


File diff suppressed because it is too large
+ 0 - 1
dist/static/js/1.bed00224467824b9d37f.js.map


+ 0 - 2
dist/static/js/2.ee4f118745a92e4499de.js

@@ -1,2 +0,0 @@
1
-webpackJsonp([2],{QvN8:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={render:function(){var e=this.$createElement;return(this._self._c||e)("div",[this._v("trace")])},staticRenderFns:[]};var a=n("VU/8")({name:"trace",data:function(){return{}}},r,!1,function(e){n("TGxm")},null,null);t.default=a.exports},TGxm:function(e,t){}});
2
-//# sourceMappingURL=2.ee4f118745a92e4499de.js.map

File diff suppressed because it is too large
+ 0 - 1
dist/static/js/2.ee4f118745a92e4499de.js.map


File diff suppressed because it is too large
+ 2 - 0
dist/static/js/app.2f0c076ac1e58a3f9b41.js


File diff suppressed because it is too large
+ 1 - 0
dist/static/js/app.2f0c076ac1e58a3f9b41.js.map


File diff suppressed because it is too large
+ 0 - 2
dist/static/js/app.93b28b51af4ba5a9f3c1.js


File diff suppressed because it is too large
+ 0 - 1
dist/static/js/app.93b28b51af4ba5a9f3c1.js.map


File diff suppressed because it is too large
+ 0 - 2
dist/static/js/app.f0cf86c175168ddd9266.js


File diff suppressed because it is too large
+ 0 - 1
dist/static/js/app.f0cf86c175168ddd9266.js.map


File diff suppressed because it is too large
+ 0 - 2
dist/static/js/manifest.38a039a674155bc97f38.js


File diff suppressed because it is too large
+ 0 - 2
dist/static/js/manifest.6043e8febffc5fedf124.js


File diff suppressed because it is too large
+ 0 - 1
dist/static/js/manifest.6043e8febffc5fedf124.js.map


File diff suppressed because it is too large
+ 2 - 0
dist/static/js/manifest.f70b6a297299eb536d5e.js


File diff suppressed because it is too large
+ 1 - 1
dist/static/js/manifest.38a039a674155bc97f38.js.map


File diff suppressed because it is too large
+ 26 - 3
dist/static/js/vendor.8c259e863dd7ec222de8.js


File diff suppressed because it is too large
+ 1 - 1
dist/static/js/vendor.8c259e863dd7ec222de8.js.map


File diff suppressed because it is too large
+ 0 - 66
dist/static/js/vendor.67a2de3c2cb78ef4987e.js


File diff suppressed because it is too large
+ 0 - 1
dist/static/js/vendor.67a2de3c2cb78ef4987e.js.map


+ 24 - 0
package-lock.json

@@ -14570,6 +14570,12 @@
14570 14570
       "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==",
14571 14571
       "dev": true
14572 14572
     },
14573
+    "shvl": {
14574
+      "version": "1.3.1",
14575
+      "resolved": "https://registry.npmjs.org/shvl/-/shvl-1.3.1.tgz",
14576
+      "integrity": "sha512-+rRPP46hloYUAEImJcqprUgXu+05Ikqr4h4V+w5i2zJy37nAqtkQKufs3+3S2fDq6JNRrHMIQhB/Vaex+jgAAw==",
14577
+      "dev": true
14578
+    },
14573 14579
     "signal-exit": {
14574 14580
       "version": "3.0.2",
14575 14581
       "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
@@ -15900,6 +15906,24 @@
15900 15906
       "integrity": "sha512-wLoqz0B7DSZtgbWL1ShIBBCjv22GV5U+vcBFox658g6V0s4wZV9P4YjCNyoHSyIBpj1f29JBoNQIqD82cR4O3w==",
15901 15907
       "dev": true
15902 15908
     },
15909
+    "vuex-persistedstate": {
15910
+      "version": "2.5.4",
15911
+      "resolved": "https://registry.npmjs.org/vuex-persistedstate/-/vuex-persistedstate-2.5.4.tgz",
15912
+      "integrity": "sha512-XYJhKIwO+ZVlTaXyxKxnplrJ88Fnvk5aDw753bxzRw5/yMKLQ6lq9CDCBex2fwZaQcLibhtgJOxGCHjy9GLSlQ==",
15913
+      "dev": true,
15914
+      "requires": {
15915
+        "deepmerge": "2.2.1",
15916
+        "shvl": "1.3.1"
15917
+      },
15918
+      "dependencies": {
15919
+        "deepmerge": {
15920
+          "version": "2.2.1",
15921
+          "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-2.2.1.tgz",
15922
+          "integrity": "sha512-R9hc1Xa/NOBi9WRVUWg19rl1UB7Tt4kuPd+thNJgFZoxXsTz7ncaPaeIm+40oSGuP33DfMb4sZt1QIGiJzC4EA==",
15923
+          "dev": true
15924
+        }
15925
+      }
15926
+    },
15903 15927
     "watchpack": {
15904 15928
       "version": "1.6.0",
15905 15929
       "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz",

+ 1 - 0
package.json

@@ -74,6 +74,7 @@
74 74
     "vue-style-loader": "^3.0.1",
75 75
     "vue-template-compiler": "^2.5.2",
76 76
     "vuex": "^3.0.1",
77
+    "vuex-persistedstate": "^2.5.4",
77 78
     "webpack": "^3.6.0",
78 79
     "webpack-bundle-analyzer": "^2.9.0",
79 80
     "webpack-dev-server": "^2.9.1",

+ 0 - 22
src/App.vue

@@ -1,30 +1,9 @@
1 1
 <template>
2 2
   <el-row id='app'>
3
-    <!-- <chaoge-brush></chaoge-brush> -->
4 3
     <el-col :span="24" class='main-container'>
5
-    <chao-ge></chao-ge>
6 4
     <router-view></router-view>
7 5
     </el-col>
8 6
   </el-row>
9
-  <!-- <div id="app" class='el-row'> -->
10
-    <!-- <my-chart></my-chart> -->
11
-     <!-- <hello-world></hello-world> -->
12
-     <!-- <my-table></my-table> -->
13
-    <!-- <test-com></test-com> -->
14
-   <!-- <ant></ant> -->
15
-   <!-- <my-list></my-list> -->
16
-   <!-- <my-can></my-can> -->
17
-   <!-- <my-car></my-car> -->
18
-    <!-- <bar></bar> -->
19
-  <!-- <el-select v-model="opt" placeholder="请选择" >
20
-    <el-option
21
-      v-for="item in options"
22
-      :key="item.value"
23
-      :label="item.label"
24
-      :value="item.value">
25
-    </el-option>
26
-  </el-select> -->
27
-  <!-- </div> -->
28 7
 </template>
29 8
 
30 9
 <script>
@@ -37,7 +16,6 @@ import chaogeBrush from './components/chaogebrush'
37 16
 import myTable from './components/mytable'
38 17
 import myList from './components/myList'
39 18
 import myCar from './components/mycar'
40
-// import myCan from './components/mycan'
41 19
 import myChart from './components/brushchart'
42 20
 export default {
43 21
   name: 'App',

+ 6 - 8
src/components/TestCom.vue

@@ -5,7 +5,7 @@
5 5
 </template>
6 6
 <script>
7 7
 import Mock from 'mockjs'
8
-import _ from 'lodash'
8
+// import _ from 'lodash'
9 9
 let MockName = Mock.mock({
10 10
   'array|4': [
11 11
     {
@@ -18,13 +18,11 @@ let MockName = Mock.mock({
18 18
     }
19 19
   ]
20 20
 })
21
-let arr = [1, 2, 3, 4, 5, 6]
22
-let darr = [4, 5, 6]
23
-let farr = _.difference(arr, darr)
24
-let arr2 = _.chunk(arr, 2)
25
-console.log(arr2)
26
-console.log(farr)
27
-// console.log(MockName)
21
+// let arr = [1, 2, 3, 4, 5, 6]
22
+// let darr = [4, 5, 6]
23
+// let farr = _.difference(arr, darr)
24
+// let arr2 = _.chunk(arr, 2)
25
+
28 26
 let colorMap = new Map([['红色', 'red'], ['黄色', 'yellow'], ['绿色', 'green'], ['蓝色', 'blue']])
29 27
 // console.log(colorMap)
30 28
 export default {

+ 8 - 1
src/components/chaoge.vue

@@ -10,7 +10,7 @@ import echarts from 'echarts'
10 10
 import Mock from 'mockjs'
11 11
 import moment from 'moment'
12 12
 let startTimes = (new Date()).getTime() - 60 * 60 * 1000
13
-
13
+// const JSON = require('circular-json')
14 14
 let MockData = Mock.mock({
15 15
   'defaultData|60': [
16 16
     [function () {
@@ -178,6 +178,13 @@ export default {
178 178
     }
179 179
   },
180 180
   mounted () {
181
+    var a = {'name': 'zzz'}
182
+    var b = {'name': 'vvv'}
183
+    a.child = b
184
+    b.parent = a
185
+    console.log(a)
186
+    // localStorage.myobj = JSON.stringify(a)
187
+    // localStorage.monitorRouter = JSON.stringify(this.$route)
181 188
     this.drawChart('first')
182 189
     console.log('组件生成')
183 190
     // this.refresh()

+ 2 - 2
src/components/chaogebrush.vue

@@ -31,7 +31,7 @@ import moment from 'moment'
31 31
 // import chartConfig from '@/utils/chart/baseConf.js'
32 32
 // import BrushView from '../utils/BrushView'
33 33
 
34
-// require('../utils/BrushView')
34
+require('../utils/BrushView')
35 35
 let startTimes = (new Date()).getTime() - 60 * 60 * 1000
36 36
 
37 37
 let MockData = Mock.mock({
@@ -43,7 +43,7 @@ let MockData = Mock.mock({
43 43
   ]
44 44
 })
45 45
 
46
-console.log(MockData)
46
+// console.log(MockData)
47 47
 export default {
48 48
   name: 'chaogebrush',
49 49
   data () {

+ 8 - 5
src/components/myList.vue

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <div>
3 3
     <ul>
4
-      <li></li>
4
+      <li v-for='item in list' :key='item'></li>
5 5
     </ul>
6 6
   </div>
7 7
 </template>
@@ -18,13 +18,16 @@ export default {
18 18
   computed: {
19 19
     ...mapGetters(['list'])
20 20
   },
21
+  watch: {
22
+    list (newVal, oldVal) {
23
+      console.log('myList组件里')
24
+      console.log(newVal)
25
+    }
26
+  },
21 27
   methods: {
22 28
     getList () {
23 29
       this.$store.dispatch({
24
-        type: 'getList',
25
-        params: {
26
-          val: this
27
-        }
30
+        type: 'getList'
28 31
       })
29 32
     }
30 33
   },

+ 50 - 0
src/components/mybrush.vue

@@ -0,0 +1,50 @@
1
+/* eslint-disable */
2
+<template>
3
+    <div>
4
+
5
+    </div>
6
+</template>
7
+<script>
8
+export default {
9
+    name:'mybrush',
10
+    data () {
11
+        return {}
12
+    },
13
+    methods: {
14
+        splitData(rawData) {
15
+        var categoryData = [];
16
+        var values = [];
17
+        var volumes = [];
18
+        for (var i = 0; i < rawData.length; i++) {
19
+            categoryData.push(rawData[i].splice(0, 1)[0]);
20
+            values.push(rawData[i]);
21
+            volumes.push([i, rawData[i][4], rawData[i][0] > rawData[i][1] ? 1 : -1]);
22
+        }
23
+        return {
24
+            categoryData: categoryData,
25
+            values: values,
26
+            volumes: volumes
27
+        }
28
+      },
29
+      calculateMA(dayCount, data) {
30
+        var result = [];
31
+        for (var i = 0, len = data.values.length; i < len; i++) {
32
+            if (i < dayCount) {
33
+                result.push('-');
34
+                continue;
35
+            }
36
+            var sum = 0;
37
+            for (var j = 0; j < dayCount; j++) {
38
+                sum += data.values[i - j][1];
39
+            }
40
+            result.push(+(sum / dayCount).toFixed(3));
41
+        }
42
+        return result;
43
+     },
44
+     
45
+    }
46
+}
47
+</script>
48
+<style>
49
+
50
+</style>

dist/static/test/index.js → src/components/test.vue


+ 3 - 2
src/router/index.js

@@ -5,9 +5,10 @@ import Router from 'vue-router'
5 5
 import chaogeBrush from '@/components/chaogebrush'
6 6
 import TestCom from '@/components/TestCom'
7 7
 // import Homepage from '@/views/homepage'
8
-import routerPage from './modules/router.index'
8
+import routerIndex from './modules/router.index'
9
+import routerPage from './modules/router.page'
9 10
 
10
-const childRouters = [...routerPage]
11
+const childRouters = [...routerIndex, ...routerPage]
11 12
 
12 13
 Vue.use(Router)
13 14
 

+ 1 - 10
src/router/modules/router.index.js

@@ -5,15 +5,6 @@ export default [
5 5
     name: 'panel',
6 6
     component (resolve) {
7 7
       require(['@/views/panel/index.vue'], resolve)
8
-    },
9
-    children: [
10
-      {
11
-        path: 'trace',
12
-        name: 'Trace',
13
-        component (resolve) {
14
-          require(['@/views/trace/index.vue'], resolve)
15
-        }
16
-      }
17
-    ]
8
+    }
18 9
   }
19 10
 ]

+ 13 - 0
src/router/modules/router.page.js

@@ -0,0 +1,13 @@
1
+export default [
2
+  {
3
+    path: '/trace',
4
+    name: 'trace',
5
+    component (resolve) {
6
+      require(['@/views/trace/index.vue'], resolve)
7
+    },
8
+    meta: {
9
+      keepAlive: true, // 需要被缓存
10
+      isBack: false
11
+    }
12
+  }
13
+]

+ 9 - 0
src/store/index.js

@@ -1,10 +1,19 @@
1 1
 import Vue from 'vue'
2 2
 import Vuex from 'vuex'
3
+import createPersistedState from 'vuex-persistedstate'
3 4
 
4 5
 import Chart from './modules/chart'
5 6
 
6 7
 Vue.use(Vuex)
7 8
 export default new Vuex.Store({
9
+  plugins: [createPersistedState({
10
+    storage: window.sessionStorage,
11
+    reducer (val) {
12
+      return {
13
+        monitorRouter: val.monitorRouter
14
+      }
15
+    }
16
+  })],
8 17
   modules: {
9 18
     Chart
10 19
   }

+ 11 - 5
src/store/modules/chart.js

@@ -1,10 +1,12 @@
1 1
 import TYPES from '../mutation_types'
2 2
 import API from '../../api'
3
+import axios from 'axios'
3 4
 const chart = {
4 5
   state: {
5 6
     time: {},
6 7
     list: [],
7
-    carlist: []
8
+    carlist: [],
9
+    monitorRouter: {}
8 10
   },
9 11
   mutations: {
10 12
     [TYPES.TIME] (state, val) {
@@ -15,6 +17,9 @@ const chart = {
15 17
     },
16 18
     [TYPES.CARLIST] (state, val) {
17 19
       state.list = val.list
20
+    },
21
+    [TYPES.MYNAME] (state, val) {
22
+      state.monitorRouter = val.monitorRouter
18 23
     }
19 24
   },
20 25
   actions: {
@@ -26,11 +31,11 @@ const chart = {
26 31
       })
27 32
     },
28 33
     async getList (context, val) {
29
-      console.log(val)
30
-      val.params.val.$http.get(API.getList, {
34
+      // console.log(this)
35
+      axios.get(API.getList, {
31 36
       })
32 37
         .then(function (response) {
33
-          console.log(response)
38
+          // console.log(response)
34 39
         })
35 40
         .catch(function (error) {
36 41
           console.log(error)
@@ -59,7 +64,8 @@ const chart = {
59 64
   getters: {
60 65
     time: state => { return state.time },
61 66
     list: state => { return state.list },
62
-    carlist: state => { return state.carlist }
67
+    carlist: state => { return state.carlist },
68
+    monitorRouter: state => { return state.monitorRouter }
63 69
   }
64 70
 }
65 71
 

+ 2 - 1
src/store/mutation_types/index.js

@@ -1,7 +1,8 @@
1 1
 const TYPES = {
2 2
   TIME: 'TIME',
3 3
   LIST: 'LIST',
4
-  CARLIST: 'CARLIST'
4
+  CARLIST: 'CARLIST',
5
+  MYNAME: 'MYNAME'
5 6
 }
6 7
 // console.log(TYPES)
7 8
 export default TYPES

File diff suppressed because it is too large
+ 889 - 889
src/utils/BrushController.js


+ 108 - 107
src/utils/BrushView.js

@@ -1,107 +1,108 @@
1
-/* eslint-disable */
2
-// import * as echarts from '../../node_modules/echarts'
3
-var echarts = require('../../node_modules/echarts')
4
-// import * as zrUtil from '../../node_modules/zrender/src/core/util'
5
-var zrUtil = require('../../node_modules/zrender/src/core/util')
6
-var BrushController = require('./BrushController')
7
-
8
-/*
9
-* Licensed to the Apache Software Foundation (ASF) under one
10
-* or more contributor license agreements.  See the NOTICE file
11
-* distributed with this work for additional information
12
-* regarding copyright ownership.  The ASF licenses this file
13
-* to you under the Apache License, Version 2.0 (the
14
-* "License"); you may not use this file except in compliance
15
-* with the License.  You may obtain a copy of the License at
16
-*
17
-*   http://www.apache.org/licenses/LICENSE-2.0
18
-*
19
-* Unless required by applicable law or agreed to in writing,
20
-* software distributed under the License is distributed on an
21
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
22
-* KIND, either express or implied.  See the License for the
23
-* specific language governing permissions and limitations
24
-* under the License.
25
-*/
26
-var _default = echarts.extendComponentView({
27
-  type: 'brush',
28
-  init: function (ecModel, api) {
29
-    /**
30
-     * @readOnly
31
-     * @type {module:echarts/model/Global}
32
-     */
33
-    this.ecModel = ecModel
34
-    /**
35
-     * @readOnly
36
-     * @type {module:echarts/ExtensionAPI}
37
-     */
38
-    this.api = api
39
-    /**
40
-     * @readOnly
41
-     * @type {module:echarts/component/brush/BrushModel}
42
-     */
43
-    this.model
44
-    /**
45
-     * @private
46
-     * @type {module:echarts/component/helper/BrushController}
47
-     */
48
-    (this._brushController = new BrushController(api.getZr())).on('brush', zrUtil.bind(this._onBrush, this)).mount()
49
-  },
50
-
51
-  /**
52
-   * @override
53
-   */
54
-  render: function (brushModel) {
55
-    this.model = brushModel
56
-    return updateController.apply(this, arguments)
57
-  },
58
-
59
-  /**
60
-   * @override
61
-   */
62
-  updateTransform: updateController,
63
-
64
-  /**
65
-   * @override
66
-   */
67
-  updateView: updateController,
68
-  // /**
69
-  //  * @override
70
-  //  */
71
-  // updateLayout: updateController,
72
-  // /**
73
-  //  * @override
74
-  //  */
75
-  // updateVisual: updateController,
76
-
77
-  /**
78
-   * @override
79
-   */
80
-  dispose: function () {
81
-    this._brushController.dispose()
82
-  },
83
-
84
-  /**
85
-   * @private
86
-   */
87
-  _onBrush: function (areas, opt) {
88
-    var modelId = this.model.id
89
-    this.model.brushTargetManager.setOutputRanges(areas, this.ecModel) // Action is not dispatched on drag end, because the drag end
90
-    // emits the same params with the last drag move event, and
91
-    // may have some delay when using touch pad, which makes
92
-    // animation not smooth (when using debounce).
93
-    (!opt.isEnd || opt.removeOnClick) && this.api.dispatchAction({
94
-      type: 'brush',
95
-      brushId: modelId,
96
-      areas: zrUtil.clone(areas),
97
-      $from: modelId
98
-    })
99
-  }
100
-})
101
-
102
-function updateController (brushModel, ecModel, api, payload) {
103
-  // Do not update controller when drawing.
104
-  // (!payload || payload.$from !== brushModel.id) && this._brushController.setPanels(brushModel.brushTargetManager.makePanelOpts(api)).enableBrush(brushModel.brushOption).updateCovers(brushModel.areas.slice())
105
-}
106
-
107
-module.exports = _default
1
+/* eslint-disable */
2
+// import * as echarts from '../../node_modules/echarts'
3
+var echarts = require('../../node_modules/echarts/lib/echarts')
4
+// import * as zrUtil from '../../node_modules/zrender/src/core/util'
5
+var zrUtil = require('zrender/src/core/util')
6
+var BrushController = require('./BrushController')
7
+
8
+/*
9
+* Licensed to the Apache Software Foundation (ASF) under one
10
+* or more contributor license agreements.  See the NOTICE file
11
+* distributed with this work for additional information
12
+* regarding copyright ownership.  The ASF licenses this file
13
+* to you under the Apache License, Version 2.0 (the
14
+* "License"); you may not use this file except in compliance
15
+* with the License.  You may obtain a copy of the License at
16
+*
17
+*   http://www.apache.org/licenses/LICENSE-2.0
18
+*
19
+* Unless required by applicable law or agreed to in writing,
20
+* software distributed under the License is distributed on an
21
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
22
+* KIND, either express or implied.  See the License for the
23
+* specific language governing permissions and limitations
24
+* under the License.
25
+*/
26
+var _default = echarts.extendComponentView({
27
+  type: 'brush',
28
+  init: function (ecModel, api) {
29
+    /**
30
+     * @readOnly
31
+     * @type {module:echarts/model/Global}
32
+     */
33
+    this.ecModel = ecModel
34
+    /**
35
+     * @readOnly
36
+     * @type {module:echarts/ExtensionAPI}
37
+     */
38
+    this.api = api
39
+    /**
40
+     * @readOnly
41
+     * @type {module:echarts/component/brush/BrushModel}
42
+     */
43
+    this.model;
44
+    /**
45
+     * @private
46
+     * @type {module:echarts/component/helper/BrushController}
47
+     */
48
+    (this._brushController = new BrushController(api.getZr())).on('brush', zrUtil.bind(this._onBrush, this)).mount()
49
+  },
50
+
51
+  /**
52
+   * @override
53
+   */
54
+  render: function (brushModel) {
55
+    // console.log(brushModel)
56
+    this.model = brushModel
57
+    return updateController.apply(this, arguments)
58
+  },
59
+
60
+  /**
61
+   * @override
62
+   */
63
+  updateTransform: updateController,
64
+
65
+  /**
66
+   * @override
67
+   */
68
+  updateView: updateController,
69
+  // /**
70
+  //  * @override
71
+  //  */
72
+  // updateLayout: updateController,
73
+  // /**
74
+  //  * @override
75
+  //  */
76
+  // updateVisual: updateController,
77
+
78
+  /**
79
+   * @override
80
+   */
81
+  dispose: function () {
82
+    this._brushController.dispose()
83
+  },
84
+
85
+  /**
86
+   * @private
87
+   */
88
+  _onBrush: function (areas, opt) {
89
+    var modelId = this.model.id
90
+    this.model.brushTargetManager.setOutputRanges(areas, this.ecModel); // Action is not dispatched on drag end, because the drag end
91
+    // emits the same params with the last drag move event, and
92
+    // may have some delay when using touch pad, which makes
93
+    // animation not smooth (when using debounce).
94
+    (!opt.isEnd || opt.removeOnClick) && this.api.dispatchAction({
95
+      type: 'brush',
96
+      brushId: modelId,
97
+      areas: zrUtil.clone(areas),
98
+      $from: modelId
99
+    })
100
+  }
101
+})
102
+
103
+function updateController (brushModel, ecModel, api, payload) {
104
+  // Do not update controller when drawing.
105
+  (!payload || payload.$from !== brushModel.id) && this._brushController.setPanels(brushModel.brushTargetManager.makePanelOpts(api)).enableBrush(brushModel.brushOption).updateCovers(brushModel.areas.slice())
106
+}
107
+
108
+module.exports = _default

+ 5 - 3
src/views/homepage/index.vue

@@ -4,11 +4,13 @@
4 4
       <el-aside :width="isCollapse ? '65px' : '200px'">
5 5
       <div class='index-logo' :class='{"tosmall":isCollapse}'><h1>Ant Design Pro</h1></div>
6 6
       <el-menu
7
-      default-active="1"
7
+      default-active="/panel"
8 8
       class="el-menu-vertical-demo"
9 9
       @open="handleOpen"
10 10
       @close="handleClose"
11
-      :collapse="isCollapse">
11
+      :collapse="isCollapse"
12
+      unique-opened
13
+      router>
12 14
       <el-submenu index="1">
13 15
         <template slot="title">
14 16
           <i class="el-icon-mobile-phone"></i>
@@ -17,7 +19,7 @@
17 19
         <el-menu-item-group>
18 20
           <!-- <template slot="title">分组一</template> -->
19 21
           <el-menu-item index="/panel">分析页</el-menu-item>
20
-          <el-menu-item index="1-2">监控页</el-menu-item>
22
+          <el-menu-item index="/trace">监控页</el-menu-item>
21 23
           <el-menu-item index="1-2">工作台</el-menu-item>
22 24
         </el-menu-item-group>
23 25
       </el-submenu>

+ 28 - 2
src/views/panel/index.vue

@@ -1,9 +1,35 @@
1 1
 <template>
2
-    <div>homepage</div>
2
+    <div>panel
3
+      <div>{{list}}</div>
4
+      <my-list></my-list>
5
+    </div>
3 6
 </template>
4 7
 <script>
8
+import { mapGetters } from 'vuex'
9
+import myList from '../../components/myList'
5 10
 export default {
6
-  name: 'panel'
11
+  name: 'panel',
12
+  computed: {
13
+    ...mapGetters(['list'])
14
+  },
15
+  components: {myList},
16
+  watch: {
17
+    list (newVal, oldVal) {
18
+      console.log('父组件')
19
+      console.log(newVal)
20
+    }
21
+  },
22
+  methods: {
23
+    getList () {
24
+      this.$store.dispatch({
25
+        type: 'getList'
26
+      })
27
+    }
28
+  },
29
+  mounted () {
30
+    this.getList()
31
+    console.log(this.list)
32
+  }
7 33
 }
8 34
 </script>
9 35
 <style lang = 'scss'>

+ 11 - 1
src/views/trace/index.vue

@@ -1,12 +1,22 @@
1 1
 <template>
2
-   <div>trace</div>
2
+   <div>trace {{monitorRouter}}</div>
3 3
 </template>
4 4
 <script>
5
+import { mapGetters } from 'vuex'
5 6
 export default {
6 7
   name: 'trace',
7 8
   data () {
8 9
     return {
9 10
     }
11
+  },
12
+  computed: {
13
+    ...mapGetters(['monitorRouter'])
14
+  },
15
+  mounted () {
16
+    this.$store.commit({
17
+      type: 'MYNAME',
18
+      monitorRouter: this.$route
19
+    })
10 20
   }
11 21
 }
12 22
 </script>