xjc 2 years ago
parent
commit
1440a244ba
4 changed files with 73 additions and 15 deletions
  1. 5 1
      package.json
  2. 8 5
      public/index.html
  3. 8 8
      src/main.js
  4. 52 1
      src/views/company/Grid.vue

+ 5 - 1
package.json

@@ -19,6 +19,7 @@
     "vue": "^2.6.6",
     "vue-baidu-map": "^0.21.22",
     "vue-router": "^3.0.1",
+    "vue2-org-tree": "^1.3.6",
     "vuex": "^3.0.1",
     "wangeditor": "^3.1.1"
   },
@@ -37,10 +38,13 @@
     "es6-promise": "^4.2.8",
     "eslint": "^5.8.0",
     "eslint-plugin-vue": "^5.0.0",
+    "less": "^4.1.2",
+    "less-loader": "^10.2.0",
     "node-sass": "^4.11.0",
     "sass-loader": "^7.1.0",
     "vue-cropper": "^0.4.9",
-    "vue-template-compiler": "^2.5.21"
+    "vue-template-compiler": "^2.5.21",
+    "vue2-org-tree": "^1.3.6"
   },
   "eslintConfig": {
     "root": true,

+ 8 - 5
public/index.html

@@ -1,17 +1,20 @@
 <!DOCTYPE html>
 <html lang="en">
-  <head>
+
+<head>
     <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
     <title>百安兮安全管控</title>
-  </head>
-  <body>
+</head>
+
+<body>
     <noscript>
       <strong>We're sorry but admin doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
     </noscript>
     <div id="app"></div>
     <!-- built files will be auto injected -->
-  </body>
-</html>
+</body>
+
+</html>

+ 8 - 8
src/main.js

@@ -7,11 +7,13 @@ import 'element-ui/lib/theme-chalk/index.css';
 import 'font-awesome/css/font-awesome.css'
 import api from './api';
 import echarts from 'echarts';
-import  'echarts/theme/dark.js'
+import 'echarts/theme/dark.js'
 import BaiduMap from 'vue-baidu-map'
 Vue.use(BaiduMap, {
-  ak: '1hqg34NFaCw9jcv0xG82cI7uINFaXGGM'
+    ak: '1hqg34NFaCw9jcv0xG82cI7uINFaXGGM'
 })
+import Vue2OrgTree from 'vue2-org-tree'
+Vue.use(Vue2OrgTree)
 
 Vue.use(ElementUI);
 Vue.prototype.$echarts = echarts
@@ -20,9 +22,7 @@ Vue.prototype.store = store;
 Vue.config.productionTip = false
 
 new Vue({
-  router,
-  store,
-  render: h => h(App)
-}).$mount('#app')
-
-
+    router,
+    store,
+    render: h => h(App)
+}).$mount('#app')

+ 52 - 1
src/views/company/Grid.vue

@@ -336,7 +336,8 @@
             <el-col :span="12">
                 <div class="grid-item grid_chart">
                     <h3 align="center">安全生产网格化管理责任图</h3>
-                    <img src="../../images/grid.png" alt="" style="margin-top:50px;text-align:center;margin-left:50px;">
+                    <!-- <img src="../../images/grid.png" alt="" style="margin-top:50px;text-align:center;margin-left:50px;"> -->
+                    <vue2-org-tree :data="treeData" :horizontal="true"/>
                 </div>
             </el-col>
         </el-row>
@@ -395,6 +396,56 @@ export default {
         },
       ],
       utype: 2,
+      treeData: {
+        id: 0,
+        label: "XXX科技有限公司",
+        children: [
+          {
+            id: 2,
+            label: "产品研发部",
+            children: [
+              {
+                id: 5,
+                label: "研发-前端"
+              },
+              {
+                id: 6,
+                label: "研发-后端"
+              },
+              {
+                id: 9,
+                label: "UI设计"
+              },
+              {
+                id: 10,
+                label: "产品经理"
+              }
+            ]
+          },
+          {
+            id: 3,
+            label: "销售部",
+            children: [
+              {
+                id: 7,
+                label: "销售一部"
+              },
+              {
+                id: 8,
+                label: "销售二部"
+              }
+            ]
+          },
+          {
+            id: 4,
+            label: "财务部"
+          },
+          {
+            id: 9,
+            label: "HR人事"
+          }
+        ]
+      }
     };
   },
   methods: {