Browse Source

项目配置,mock引用,主页和监测预警首页结构构建

李文 4 years ago
parent
commit
8ffd500488
41 changed files with 2592 additions and 577 deletions
  1. 9 0
      .editorconfig
  2. 4 1
      .eslintignore
  3. 35 0
      .eslintrc.js
  4. 512 176
      package-lock.json
  5. 12 1
      package.json
  6. 28 0
      src/components/smp-card.vue
  7. 31 0
      src/components/smp-img-text.vue
  8. 30 0
      src/components/smp-list-time.vue
  9. 31 0
      src/components/smp-map/smp-map-func.vue
  10. 32 0
      src/components/smp-map/smp-map-search.vue
  11. 27 0
      src/components/smp-page-left.vue
  12. 27 0
      src/components/smp-page-right.vue
  13. 63 0
      src/components/smp-table.vue
  14. 5 0
      src/main.js
  15. 45 0
      src/mock/index.js
  16. 29 0
      src/mock/modules/common.js
  17. 129 0
      src/mock/modules/job-schedule.js
  18. 91 0
      src/mock/modules/oss.js
  19. 85 0
      src/mock/modules/sys-config.js
  20. 96 0
      src/mock/modules/sys-log.js
  21. 643 0
      src/mock/modules/sys-menu.js
  22. 101 0
      src/mock/modules/sys-role.js
  23. 102 0
      src/mock/modules/sys-user.js
  24. 112 112
      src/router/index.js
  25. 0 97
      src/views/main-navbar-update-password.vue
  26. 0 95
      src/views/main-navbar.vue
  27. 0 62
      src/views/main-theme-tools.vue
  28. 25 0
      src/views/main/main-content-crumb.vue
  29. 5 0
      src/views/main-content.vue
  30. 24 0
      src/views/main/main-navbar-menu.vue
  31. 25 0
      src/views/main/main-navbar-news.vue
  32. 25 0
      src/views/main/main-navbar-user.vue
  33. 73 0
      src/views/main/main-navbar.vue
  34. 0 0
      src/views/main/main-sidebar-sub-menu.vue
  35. 4 0
      src/views/main-sidebar.vue
  36. 13 15
      src/views/main.vue
  37. 27 0
      src/views/monitor-warn/index/monitorwarn-index-clue-hd.vue
  38. 25 0
      src/views/monitor-warn/index/monitorwarn-index-clue.vue
  39. 24 0
      src/views/monitor-warn/index/monitorwarn-index-statistic.vue
  40. 24 0
      src/views/monitor-warn/index/monitorwarn-index.vue
  41. 19 18
      src/views/pages/login.vue

+ 9 - 0
.editorconfig

@@ -0,0 +1,9 @@
+root = true
+
+[*]
+charset = utf-8
+indent_style = space
+indent_size = 2
+end_of_line = lf
+insert_final_newline = true
+trim_trailing_whitespace = true

+ 4 - 1
.eslintignore

@@ -1 +1,4 @@
-/src/icons/iconfont.js
+/src/icons/
+/src/i18n/
+/src/element-ui/
+/public/

+ 35 - 0
.eslintrc.js

@@ -0,0 +1,35 @@
+// https://eslint.org/docs/user-guide/configuring
+
+module.exports = {
+  root: true,
+  parserOptions: {
+    parser: 'babel-eslint'
+  },
+  env: {
+    browser: true,
+  },
+  extends: [
+    // https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
+    // consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
+    'plugin:vue/essential', 
+    // https://github.com/standard/standard/blob/master/docs/RULES-en.md
+    'standard'
+  ],
+  // required to lint *.vue files
+  plugins: [
+    'vue'
+  ],
+  globals: {
+    "ol": true,
+    "UsbPhone": true
+  },
+  // add your custom rules here
+  rules: {
+    // allow async-await
+    'generator-star-spacing': 'off',
+    // allow debugger during development
+    'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
+    // "no-eval": 1,
+    // "no-unused-vars": 1,
+  }
+}

File diff suppressed because it is too large
+ 512 - 176
package-lock.json


+ 12 - 1
package.json

@@ -45,9 +45,20 @@
     "@vue/eslint-config-standard": "^3.0.4",
     "less": "^3.9.0",
     "less-loader": "^5.0.0",
+    "mockjs": "^1.1.0",
     "node-sass": "^4.11.0",
     "sass-loader": "^7.1.0",
-    "vue-template-compiler": "^2.5.17"
+    "vue-template-compiler": "^2.5.17",
+    "eslint": "^4.15.0",
+    "eslint-config-standard": "^10.2.1",
+    "eslint-friendly-formatter": "^3.0.0",
+    "eslint-loader": "^1.7.1",
+    "eslint-plugin-import": "^2.7.0",
+    "eslint-plugin-node": "^5.2.0",
+    "eslint-plugin-promise": "^3.4.0",
+    "eslint-plugin-standard": "^3.0.1",
+    "eslint-plugin-vue": "^4.0.0",
+    "babel-eslint": "8.0.1"
   },
   "eslintConfig": {
     "root": true,

+ 28 - 0
src/components/smp-card.vue

@@ -0,0 +1,28 @@
+<template>
+  <el-card class="smp-card">
+    <div slot="header" class="clearfix">
+      <span>卡片名称</span>
+      <el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button>
+    </div>
+    <slot></slot>
+  </el-card>
+</template>
+
+<script>
+export default {
+  data () {
+    return {
+
+    }
+  },
+  methods: {
+
+  }
+}
+</script>
+
+<style lang="scss">
+.smp-card{
+  padding: 0!important;
+}
+</style>

+ 31 - 0
src/components/smp-img-text.vue

@@ -0,0 +1,31 @@
+<template>
+  <div class="smp-img-text">
+    图文摘要
+  </div>
+</template>
+
+<script>
+// props:
+// list_data{
+//   type
+//   title
+//   time
+// }
+// titleName:['type','title','time']
+export default {
+  data () {
+    return {
+
+    }
+  },
+  methods: {
+
+  }
+}
+</script>
+
+<style lang="scss">
+.smp-img-text{
+  padding: 0!important;
+}
+</style>

+ 30 - 0
src/components/smp-list-time.vue

@@ -0,0 +1,30 @@
+<template>
+  <ul class="smp-list-time">
+    <li>我是标题</li>
+  </ul>
+</template>
+
+<script>
+// props
+// list_data{
+//   type
+//   title
+//   time
+// }
+export default {
+  data () {
+    return {
+
+    }
+  },
+  methods: {
+
+  }
+}
+</script>
+
+<style lang="scss">
+.smp-list-time{
+  padding: 0!important;
+}
+</style>

+ 31 - 0
src/components/smp-map/smp-map-func.vue

@@ -0,0 +1,31 @@
+<template>
+  <div class="smp-map-func">
+    <div class="smf-item">地图工具</div>
+  </div>
+</template>
+
+<script>
+// props:
+// list_data{
+//   type
+//   title
+//   time
+// }
+// titleName:['type','title','time']
+export default {
+  data () {
+    return {
+
+    }
+  },
+  methods: {
+
+  }
+}
+</script>
+
+<style lang="scss">
+.smp-map-func{
+  padding: 0!important;
+}
+</style>

+ 32 - 0
src/components/smp-map/smp-map-search.vue

@@ -0,0 +1,32 @@
+<template>
+  <div class="smp-map-search">
+    <div class="sms-left">城市选择</div>
+    <div class="sms-right">人员选择和搜索</div>
+  </div>
+</template>
+
+<script>
+// props:
+// list_data{
+//   type
+//   title
+//   time
+// }
+// titleName:['type','title','time']
+export default {
+  data () {
+    return {
+
+    }
+  },
+  methods: {
+
+  }
+}
+</script>
+
+<style lang="scss">
+.smp-map-search{
+  padding: 0!important;
+}
+</style>

+ 27 - 0
src/components/smp-page-left.vue

@@ -0,0 +1,27 @@
+<template>
+  <div class="smp-page-left">
+    <div class="smp-pl-box">盒子
+      <slot></slot>
+    </div>
+    <div class="smp-pl-controler">开</div>
+  </div>
+</template>
+
+<script>
+export default {
+  data () {
+    return {
+
+    }
+  },
+  methods: {
+
+  }
+}
+</script>
+
+<style lang="scss">
+.smp-page-left{
+  padding: 0!important;
+}
+</style>

+ 27 - 0
src/components/smp-page-right.vue

@@ -0,0 +1,27 @@
+<template>
+  <div class="smp-page-right">
+    <div class="smp-pl-box">盒子
+      <slot></slot>
+    </div>
+    <div class="smp-pl-controler">开</div>
+  </div>
+</template>
+
+<script>
+export default {
+  data () {
+    return {
+
+    }
+  },
+  methods: {
+
+  }
+}
+</script>
+
+<style lang="scss">
+.smp-page-right{
+  padding: 0!important;
+}
+</style>

+ 63 - 0
src/components/smp-table.vue

@@ -0,0 +1,63 @@
+<template>
+  <el-table
+    :data="tableData"
+    style="width: 100%"
+    class="smp-table">
+    <el-table-column
+      prop="date"
+      label="日期"
+      width="180">
+    </el-table-column>
+    <el-table-column
+      prop="name"
+      label="姓名"
+      width="180">
+    </el-table-column>
+    <el-table-column
+      prop="address"
+      label="地址">
+    </el-table-column>
+  </el-table>
+</template>
+
+<script>
+// props:
+// list_data{
+//   type
+//   title
+//   time
+// }
+// titleName:['type','title','time']
+export default {
+  data () {
+    return {
+      tableData: [{
+        date: '2016-05-02',
+        name: '王小虎',
+        address: '上海市普陀区金沙江路 1518 弄'
+      }, {
+        date: '2016-05-04',
+        name: '王小虎',
+        address: '上海市普陀区金沙江路 1517 弄'
+      }, {
+        date: '2016-05-01',
+        name: '王小虎',
+        address: '上海市普陀区金沙江路 1519 弄'
+      }, {
+        date: '2016-05-03',
+        name: '王小虎',
+        address: '上海市普陀区金沙江路 1516 弄'
+      }]
+    }
+  },
+  methods: {
+
+  }
+}
+</script>
+
+<style lang="scss">
+.smp-table{
+  padding: 0!important;
+}
+</style>

+ 5 - 0
src/main.js

@@ -18,6 +18,11 @@ Vue.use(Element, {
   i18n: (key, value) => i18n.t(key, value)
 })
 
+// 非生产环境, 适配mockjs模拟数据                 // api: https://github.com/nuysoft/Mock
+if (process.env.NODE_ENV !== 'production') {
+  require('@/mock')
+}
+
 // 挂载全局
 Vue.prototype.$http = http
 Vue.prototype.$postReq = postReq

+ 45 - 0
src/mock/index.js

@@ -0,0 +1,45 @@
+import Mock from 'mockjs'
+import * as common from './modules/common'
+import * as jobSchedule from './modules/job-schedule'
+import * as oss from './modules/oss'
+import * as sysConfig from './modules/sys-config'
+import * as sysLog from './modules/sys-log'
+import * as sysMenu from './modules/sys-menu'
+import * as sysRole from './modules/sys-role'
+import * as sysUser from './modules/sys-user'
+
+// tips
+// 1. 开启/关闭[业务模块]拦截, 通过调用fnCreate方法[isOpen参数]设置.
+// 2. 开启/关闭[业务模块中某个请求]拦截, 通过函数返回对象中的[isOpen属性]设置.
+fnCreate(common, true)
+fnCreate(jobSchedule, true)
+fnCreate(oss, true)
+fnCreate(sysConfig, true)
+fnCreate(sysLog, true)
+fnCreate(sysMenu, true)
+fnCreate(sysRole, true)
+fnCreate(sysUser, true)
+
+/**
+ * 创建mock模拟数据
+ * @param {*} mod 模块
+ * @param {*} isOpen 是否开启?
+ */
+function fnCreate (mod, isOpen = true) {
+  if (isOpen) {
+    for (var key in mod) {
+      ((res) => {
+        if (res.isOpen !== false) {
+          Mock.mock(new RegExp(res.url), res.type, (opts) => {
+            opts['data'] = opts.body ? JSON.parse(opts.body) : null
+            delete opts.body
+            console.log('\n')
+            console.log('%cmock拦截, 请求: ', 'color:blue', opts)
+            console.log('%cmock拦截, 响应: ', 'color:blue', res.data)
+            return res.data
+          })
+        }
+      })(mod[key]() || {})
+    }
+  }
+}

+ 29 - 0
src/mock/modules/common.js

@@ -0,0 +1,29 @@
+import Mock from 'mockjs'
+
+// 登录
+export function login () {
+  return {
+    // isOpen: false,
+    url: '/sys/login',
+    type: 'post',
+    data: {
+      'msg': 'success',
+      'code': 0,
+      'expire': Mock.Random.natural(60 * 60 * 1, 60 * 60 * 12),
+      'token': Mock.Random.string('abcdefghijklmnopqrstuvwxyz0123456789', 32)
+    }
+  }
+}
+
+// 退出
+export function logout () {
+  return {
+    // isOpen: false,
+    url: '/sys/logout',
+    type: 'post',
+    data: {
+      'msg': 'success',
+      'code': 0
+    }
+  }
+}

+ 129 - 0
src/mock/modules/job-schedule.js

@@ -0,0 +1,129 @@
+import Mock from 'mockjs'
+
+// 生成数据列表
+var dataList = []
+for (let i = 0; i < Math.floor(Math.random() * 10 + 1); i++) {
+  let name = Mock.Random.name()
+  dataList.push(Mock.mock({
+    'jobId': '@increment',
+    'beanName': name,
+    'methodName': name,
+    'params': '-',
+    'cronExpression': '0 0/30 * * * ?',
+    'status': 1,
+    'remark': '@csentence',
+    'createTime': '@datetime'
+  }))
+}
+
+// 获取定时任务列表
+export function list () {
+  return {
+    // isOpen: false,
+    url: '/sys/schedule/list',
+    type: 'get',
+    data: {
+      'msg': 'success',
+      'code': 0,
+      'page': {
+        'totalCount': dataList.length,
+        'pageSize': 10,
+        'totalPage': 1,
+        'currPage': 1,
+        'list': dataList
+      }
+    }
+  }
+}
+
+// 获取定时任务信息
+export function info () {
+  return {
+    // isOpen: false,
+    url: '/sys/schedule/info',
+    type: 'get',
+    data: {
+      'msg': 'success',
+      'code': 0,
+      'user': dataList[0]
+    }
+  }
+}
+
+// 添加定时任务
+export function add () {
+  return {
+    // isOpen: false,
+    url: '/sys/schedule/save',
+    type: 'post',
+    data: {
+      'msg': 'success',
+      'code': 0
+    }
+  }
+}
+
+// 修改定时任务
+export function update () {
+  return {
+    // isOpen: false,
+    url: '/sys/schedule/update',
+    type: 'post',
+    data: {
+      'msg': 'success',
+      'code': 0
+    }
+  }
+}
+
+// 删除定时任务
+export function del () {
+  return {
+    // isOpen: false,
+    url: '/sys/schedule/delete',
+    type: 'post',
+    data: {
+      'msg': 'success',
+      'code': 0
+    }
+  }
+}
+
+// 运行定时任务
+export function run () {
+  return {
+    // isOpen: false,
+    url: '/sys/schedule/run',
+    type: 'post',
+    data: {
+      'msg': 'success',
+      'code': 0
+    }
+  }
+}
+
+// 暂停定时任务
+export function pause () {
+  return {
+    // isOpen: false,
+    url: '/sys/schedule/pause',
+    type: 'post',
+    data: {
+      'msg': 'success',
+      'code': 0
+    }
+  }
+}
+
+// 恢复定时任务
+export function resume () {
+  return {
+    // isOpen: false,
+    url: '/sys/schedule/resume',
+    type: 'post',
+    data: {
+      'msg': 'success',
+      'code': 0
+    }
+  }
+}

+ 91 - 0
src/mock/modules/oss.js

@@ -0,0 +1,91 @@
+import Mock from 'mockjs'
+
+// 生成数据列表
+var dataList = []
+for (let i = 0; i < Math.floor(Math.random() * 10 + 1); i++) {
+  dataList.push(Mock.mock({
+    'id': '@increment',
+    'url': 'http://oapk0ekso.bkt.clouddn.com/upload/@date("yyyyMMdd")/@guid().png',
+    'createDate': '@datetime'
+  }))
+}
+
+// 获取文件列表
+export function list () {
+  return {
+    // isOpen: false,
+    url: '/sys/oss/list',
+    type: 'get',
+    data: {
+      'msg': 'success',
+      'code': 0,
+      'page': {
+        'totalCount': dataList.length,
+        'pageSize': 10,
+        'totalPage': 1,
+        'currPage': 1,
+        'list': dataList
+      }
+    }
+  }
+}
+
+// 获取云存储配置信息
+export function config () {
+  return {
+    // isOpen: false,
+    url: '/sys/oss/config',
+    type: 'get',
+    data: {
+      'msg': 'success',
+      'code': 0,
+      'config': {
+        'type': 1,
+        'qiniuDomain': 'http:// oapk0ekso.bkt.clouddn.com',
+        'qiniuPrefix': 'upload',
+        'qiniuAccessKey': '2fIEkyYuNXatF4HIXlMbUY6dA-rDQpuADPxtnAHZ',
+        'qiniuSecretKey': 'G4F9gqYRJd5K56pDGaWQrGIzV8me4rT7mQQUKfmk',
+        'qiniuBucketName': 'xiaolu-vido',
+        'aliyunDomain': '',
+        'aliyunPrefix': '',
+        'aliyunEndPoint': '',
+        'aliyunAccessKeyId': '',
+        'aliyunAccessKeySecret': '',
+        'aliyunBucketName': '',
+        'qcloudDomain': '',
+        'qcloudPrefix': '',
+        'qcloudAppId': null,
+        'qcloudSecretId': '',
+        'qcloudSecretKey': '',
+        'qcloudBucketName': '',
+        'qcloudRegion': null
+      }
+    }
+  }
+}
+
+// 保存云存储配置信息
+export function addConfig () {
+  return {
+    // isOpen: false,
+    url: '/sys/oss/saveConfig',
+    type: 'post',
+    data: {
+      'msg': 'success',
+      'code': 0
+    }
+  }
+}
+
+// 删除文件
+export function del () {
+  return {
+    // isOpen: false,
+    url: '/sys/oss/delete',
+    type: 'post',
+    data: {
+      'msg': 'success',
+      'code': 0
+    }
+  }
+}

+ 85 - 0
src/mock/modules/sys-config.js

@@ -0,0 +1,85 @@
+import Mock from 'mockjs'
+
+// 生成数据列表
+var dataList = []
+for (let i = 0; i < Math.floor(Math.random() * 10 + 1); i++) {
+  dataList.push(Mock.mock({
+    'id': '@increment',
+    'paramKey': '@first',
+    'paramValue': '@last',
+    'remark': '@csentence'
+  }))
+}
+
+// 获取参数列表
+export function list () {
+  return {
+    // isOpen: false,
+    url: '/sys/config/list',
+    type: 'get',
+    data: {
+      'msg': 'success',
+      'code': 0,
+      'page': {
+        'totalCount': dataList.length,
+        'pageSize': 10,
+        'totalPage': 1,
+        'currPage': 1,
+        'list': dataList
+      }
+    }
+  }
+}
+
+// 获取参数信息
+export function info () {
+  return {
+    // isOpen: false,
+    url: '/sys/config/info',
+    type: 'get',
+    data: {
+      'msg': 'success',
+      'code': 0,
+      'config': dataList[0]
+    }
+  }
+}
+
+// 添加参数
+export function add () {
+  return {
+    // isOpen: false,
+    url: '/sys/config/save',
+    type: 'post',
+    data: {
+      'msg': 'success',
+      'code': 0
+    }
+  }
+}
+
+// 修改参数
+export function update () {
+  return {
+    // isOpen: false,
+    url: '/sys/config/update',
+    type: 'post',
+    data: {
+      'msg': 'success',
+      'code': 0
+    }
+  }
+}
+
+// 删除参数
+export function del () {
+  return {
+    // isOpen: false,
+    url: '/sys/config/delete',
+    type: 'post',
+    data: {
+      'msg': 'success',
+      'code': 0
+    }
+  }
+}

+ 96 - 0
src/mock/modules/sys-log.js

@@ -0,0 +1,96 @@
+import Mock from 'mockjs'
+
+// 生成数据列表
+var dataList = []
+for (let i = 0; i < Math.floor(Math.random() * 10 + 1); i++) {
+  dataList.push(Mock.mock({
+    'id': '@increment',
+    'username': '@name',
+    'operation': '保存角色',
+    'method': 'io.renren.modules.sys.controller.SysRoleController.save()',
+    'params': '{\'roleId\':1,\'roleName\':\'aaa\',\'remark\':\'111\',\'createUserId\':1,\'menuIdList\':[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,29,30],\'createTime\':\'Mar 8,2018 2:29:31 PM\'}',
+    'time|1-100': 100,
+    'ip': '@ip',
+    'createDate': '@datetime'
+  }))
+}
+var scheduleDataList = []
+for (let i = 0; i < Math.floor(Math.random() * 10 + 1); i++) {
+  let name = Mock.Random.name()
+  scheduleDataList.push(Mock.mock({
+    'logId': '@increment',
+    'jobId': '@increment(1000)',
+    'beanName': name,
+    'methodName': name,
+    'params': '-',
+    'status|0-1': 1,
+    'error': null,
+    'times|1-1000': 1000,
+    'createTime': '@datetime'
+  }))
+}
+
+// 获取日志列表
+export function list () {
+  return {
+    // isOpen: false,
+    url: '/sys/log/list',
+    type: 'get',
+    data: {
+      'msg': 'success',
+      'code': 0,
+      'page': {
+        'totalCount': dataList.length,
+        'pageSize': 10,
+        'totalPage': 1,
+        'currPage': 1,
+        'list': dataList
+      }
+    }
+  }
+}
+
+// 获取定时任务日志列表
+export function scheduleList () {
+  return {
+    // isOpen: false,
+    url: '/sys/scheduleLog/list',
+    type: 'get',
+    data: {
+      'msg': 'success',
+      'code': 0,
+      'page': {
+        'totalCount': scheduleDataList.length,
+        'pageSize': 10,
+        'totalPage': 1,
+        'currPage': 1,
+        'list': scheduleDataList
+      }
+    }
+  }
+}
+
+// 获取定时任务日志信息
+export function scheduleInfo () {
+  let name = Mock.Random.name()
+  return {
+    // isOpen: false,
+    url: '/sys/scheduleLog/info',
+    type: 'get',
+    data: {
+      'msg': 'success',
+      'code': 0,
+      'log': {
+        'logId': 1225,
+        'jobId': 3,
+        'beanName': name,
+        'methodName': name,
+        'params': null,
+        'status': 1,
+        'error': `org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named '${name}' available`,
+        'times': Mock.Random.integer(1, 1000),
+        'createTime': Mock.Random.datetime
+      }
+    }
+  }
+}

+ 643 - 0
src/mock/modules/sys-menu.js

@@ -0,0 +1,643 @@
+// 生成数据列表
+var dataList = [
+  {
+    'menuId': 1,
+    'parentId': 0,
+    'parentName': null,
+    'name': '系统管理',
+    'url': null,
+    'perms': null,
+    'type': 0,
+    'icon': 'system',
+    'orderNum': 0,
+    'open': null,
+    'list': null
+  },
+  {
+    'menuId': 2,
+    'parentId': 1,
+    'parentName': '系统管理',
+    'name': '管理员列表',
+    'url': 'sys/user',
+    'perms': null,
+    'type': 1,
+    'icon': 'admin',
+    'orderNum': 1,
+    'open': null,
+    'list': null
+  },
+  {
+    'menuId': 3,
+    'parentId': 1,
+    'parentName': '系统管理',
+    'name': '角色管理',
+    'url': 'sys/role',
+    'perms': null,
+    'type': 1,
+    'icon': 'role',
+    'orderNum': 2,
+    'open': null,
+    'list': null
+  },
+  {
+    'menuId': 4,
+    'parentId': 1,
+    'parentName': '系统管理',
+    'name': '菜单管理',
+    'url': 'sys/menu',
+    'perms': null,
+    'type': 1,
+    'icon': 'menu',
+    'orderNum': 3,
+    'open': null,
+    'list': null
+  },
+  {
+    'menuId': 5,
+    'parentId': 1,
+    'parentName': '系统管理',
+    'name': 'SQL监控',
+    'url': 'http://localhost:8080/druid/sql.html',
+    'perms': null,
+    'type': 1,
+    'icon': 'sql',
+    'orderNum': 4,
+    'open': null,
+    'list': null
+  },
+  {
+    'menuId': 6,
+    'parentId': 1,
+    'parentName': '系统管理',
+    'name': '定时任务',
+    'url': 'job/schedule',
+    'perms': null,
+    'type': 1,
+    'icon': 'job',
+    'orderNum': 5,
+    'open': null,
+    'list': null
+  },
+  {
+    'menuId': 7,
+    'parentId': 6,
+    'parentName': '定时任务',
+    'name': '查看',
+    'url': null,
+    'perms': 'sys:schedule:list,sys:schedule:info',
+    'type': 2,
+    'icon': null,
+    'orderNum': 0,
+    'open': null,
+    'list': null
+  },
+  {
+    'menuId': 8,
+    'parentId': 6,
+    'parentName': '定时任务',
+    'name': '新增',
+    'url': null,
+    'perms': 'sys:schedule:save',
+    'type': 2,
+    'icon': null,
+    'orderNum': 0,
+    'open': null,
+    'list': null
+  },
+  {
+    'menuId': 9,
+    'parentId': 6,
+    'parentName': '定时任务',
+    'name': '修改',
+    'url': null,
+    'perms': 'sys:schedule:update',
+    'type': 2,
+    'icon': null,
+    'orderNum': 0,
+    'open': null,
+    'list': null
+  },
+  {
+    'menuId': 10,
+    'parentId': 6,
+    'parentName': '定时任务',
+    'name': '删除',
+    'url': null,
+    'perms': 'sys:schedule:delete',
+    'type': 2,
+    'icon': null,
+    'orderNum': 0,
+    'open': null,
+    'list': null
+  },
+  {
+    'menuId': 11,
+    'parentId': 6,
+    'parentName': '定时任务',
+    'name': '暂停',
+    'url': null,
+    'perms': 'sys:schedule:pause',
+    'type': 2,
+    'icon': null,
+    'orderNum': 0,
+    'open': null,
+    'list': null
+  },
+  {
+    'menuId': 12,
+    'parentId': 6,
+    'parentName': '定时任务',
+    'name': '恢复',
+    'url': null,
+    'perms': 'sys:schedule:resume',
+    'type': 2,
+    'icon': null,
+    'orderNum': 0,
+    'open': null,
+    'list': null
+  },
+  {
+    'menuId': 13,
+    'parentId': 6,
+    'parentName': '定时任务',
+    'name': '立即执行',
+    'url': null,
+    'perms': 'sys:schedule:run',
+    'type': 2,
+    'icon': null,
+    'orderNum': 0,
+    'open': null,
+    'list': null
+  },
+  {
+    'menuId': 14,
+    'parentId': 6,
+    'parentName': '定时任务',
+    'name': '日志列表',
+    'url': null,
+    'perms': 'sys:schedule:log',
+    'type': 2,
+    'icon': null,
+    'orderNum': 0,
+    'open': null,
+    'list': null
+  },
+  {
+    'menuId': 15,
+    'parentId': 2,
+    'parentName': '管理员列表',
+    'name': '查看',
+    'url': null,
+    'perms': 'sys:user:list,sys:user:info',
+    'type': 2,
+    'icon': null,
+    'orderNum': 0,
+    'open': null,
+    'list': null
+  },
+  {
+    'menuId': 16,
+    'parentId': 2,
+    'parentName': '管理员列表',
+    'name': '新增',
+    'url': null,
+    'perms': 'sys:user:save,sys:role:select',
+    'type': 2,
+    'icon': null,
+    'orderNum': 0,
+    'open': null,
+    'list': null
+  },
+  {
+    'menuId': 17,
+    'parentId': 2,
+    'parentName': '管理员列表',
+    'name': '修改',
+    'url': null,
+    'perms': 'sys:user:update,sys:role:select',
+    'type': 2,
+    'icon': null,
+    'orderNum': 0,
+    'open': null,
+    'list': null
+  },
+  {
+    'menuId': 18,
+    'parentId': 2,
+    'parentName': '管理员列表',
+    'name': '删除',
+    'url': null,
+    'perms': 'sys:user:delete',
+    'type': 2,
+    'icon': null,
+    'orderNum': 0,
+    'open': null,
+    'list': null
+  },
+  {
+    'menuId': 19,
+    'parentId': 3,
+    'parentName': '角色管理',
+    'name': '查看',
+    'url': null,
+    'perms': 'sys:role:list,sys:role:info',
+    'type': 2,
+    'icon': null,
+    'orderNum': 0,
+    'open': null,
+    'list': null
+  },
+  {
+    'menuId': 20,
+    'parentId': 3,
+    'parentName': '角色管理',
+    'name': '新增',
+    'url': null,
+    'perms': 'sys:role:save,sys:menu:list',
+    'type': 2,
+    'icon': null,
+    'orderNum': 0,
+    'open': null,
+    'list': null
+  },
+  {
+    'menuId': 21,
+    'parentId': 3,
+    'parentName': '角色管理',
+    'name': '修改',
+    'url': null,
+    'perms': 'sys:role:update,sys:menu:list',
+    'type': 2,
+    'icon': null,
+    'orderNum': 0,
+    'open': null,
+    'list': null
+  },
+  {
+    'menuId': 22,
+    'parentId': 3,
+    'parentName': '角色管理',
+    'name': '删除',
+    'url': null,
+    'perms': 'sys:role:delete',
+    'type': 2,
+    'icon': null,
+    'orderNum': 0,
+    'open': null,
+    'list': null
+  },
+  {
+    'menuId': 23,
+    'parentId': 4,
+    'parentName': '菜单管理',
+    'name': '查看',
+    'url': null,
+    'perms': 'sys:menu:list,sys:menu:info',
+    'type': 2,
+    'icon': null,
+    'orderNum': 0,
+    'open': null,
+    'list': null
+  },
+  {
+    'menuId': 24,
+    'parentId': 4,
+    'parentName': '菜单管理',
+    'name': '新增',
+    'url': null,
+    'perms': 'sys:menu:save,sys:menu:select',
+    'type': 2,
+    'icon': null,
+    'orderNum': 0,
+    'open': null,
+    'list': null
+  },
+  {
+    'menuId': 25,
+    'parentId': 4,
+    'parentName': '菜单管理',
+    'name': '修改',
+    'url': null,
+    'perms': 'sys:menu:update,sys:menu:select',
+    'type': 2,
+    'icon': null,
+    'orderNum': 0,
+    'open': null,
+    'list': null
+  },
+  {
+    'menuId': 26,
+    'parentId': 4,
+    'parentName': '菜单管理',
+    'name': '删除',
+    'url': null,
+    'perms': 'sys:menu:delete',
+    'type': 2,
+    'icon': null,
+    'orderNum': 0,
+    'open': null,
+    'list': null
+  },
+  {
+    'menuId': 27,
+    'parentId': 1,
+    'parentName': '系统管理',
+    'name': '参数管理',
+    'url': 'sys/config',
+    'perms': 'sys:config:list,sys:config:info,sys:config:save,sys:config:update,sys:config:delete',
+    'type': 1,
+    'icon': 'config',
+    'orderNum': 6,
+    'open': null,
+    'list': null
+  },
+  {
+    'menuId': 29,
+    'parentId': 1,
+    'parentName': '系统管理',
+    'name': '系统日志',
+    'url': 'sys/log',
+    'perms': 'sys:log:list',
+    'type': 1,
+    'icon': 'log',
+    'orderNum': 7,
+    'open': null,
+    'list': null
+  },
+  {
+    'menuId': 30,
+    'parentId': 1,
+    'parentName': '系统管理',
+    'name': '文件上传',
+    'url': 'oss/oss',
+    'perms': 'sys:oss:all',
+    'type': 1,
+    'icon': 'oss',
+    'orderNum': 6,
+    'open': null,
+    'list': null
+  }
+]
+var navDataList = [
+  {
+    'menuId': 1,
+    'parentId': 0,
+    'parentName': null,
+    'name': '系统管理',
+    'url': null,
+    'perms': null,
+    'type': 0,
+    'icon': 'system',
+    'orderNum': 0,
+    'open': null,
+    'list': [
+      {
+        'menuId': 2,
+        'parentId': 1,
+        'parentName': null,
+        'name': '管理员列表',
+        'url': 'sys/user',
+        'perms': null,
+        'type': 1,
+        'icon': 'admin',
+        'orderNum': 1,
+        'open': null,
+        'list': null
+      },
+      {
+        'menuId': 3,
+        'parentId': 1,
+        'parentName': null,
+        'name': '角色管理',
+        'url': 'sys/role',
+        'perms': null,
+        'type': 1,
+        'icon': 'role',
+        'orderNum': 2,
+        'open': null,
+        'list': null
+      },
+      {
+        'menuId': 4,
+        'parentId': 1,
+        'parentName': null,
+        'name': '菜单管理',
+        'url': 'sys/menu',
+        'perms': null,
+        'type': 1,
+        'icon': 'menu',
+        'orderNum': 3,
+        'open': null,
+        'list': null
+      },
+      {
+        'menuId': 5,
+        'parentId': 1,
+        'parentName': null,
+        'name': 'SQL监控',
+        'url': 'http://localhost:8080/druid/sql.html',
+        'perms': null,
+        'type': 1,
+        'icon': 'sql',
+        'orderNum': 4,
+        'open': null,
+        'list': null
+      },
+      {
+        'menuId': 6,
+        'parentId': 1,
+        'parentName': null,
+        'name': '定时任务',
+        'url': 'job/schedule',
+        'perms': null,
+        'type': 1,
+        'icon': 'job',
+        'orderNum': 5,
+        'open': null,
+        'list': null
+      },
+      {
+        'menuId': 27,
+        'parentId': 1,
+        'parentName': null,
+        'name': '参数管理',
+        'url': 'sys/config',
+        'perms': 'sys:config:list,sys:config:info,sys:config:save,sys:config:update,sys:config:delete',
+        'type': 1,
+        'icon': 'config',
+        'orderNum': 6,
+        'open': null,
+        'list': null
+      },
+      {
+        'menuId': 30,
+        'parentId': 1,
+        'parentName': null,
+        'name': '文件上传',
+        'url': 'oss/oss',
+        'perms': 'sys:oss:all',
+        'type': 1,
+        'icon': 'oss',
+        'orderNum': 6,
+        'open': null,
+        'list': null
+      },
+      {
+        'menuId': 29,
+        'parentId': 1,
+        'parentName': null,
+        'name': '系统日志',
+        'url': 'sys/log',
+        'perms': 'sys:log:list',
+        'type': 1,
+        'icon': 'log',
+        'orderNum': 7,
+        'open': null,
+        'list': null
+      }
+    ]
+  }
+]
+var navDataList2 = [
+  {
+    'menuId': 2,
+    'parentId': 1,
+    'parentName': null,
+    'name': '管理员列表',
+    'url': 'sys/user',
+    'perms': null,
+    'type': 1,
+    'icon': 'admin',
+    'orderNum': 1,
+    'open': null,
+    'list': null
+  }
+]
+
+// 获取导航菜单列表 / 权限
+export function nav () {
+  return {
+    // isOpen: false,
+    url: '/sys/menu/nav',
+    type: 'get',
+    data: {
+      'msg': 'success',
+      'code': 0,
+      'data': navDataList2,
+      'permissions': [
+        'sys:schedule:info',
+        'sys:menu:update',
+        'sys:menu:delete',
+        'sys:config:info',
+        'sys:menu:list',
+        'sys:config:save',
+        'sys:config:update',
+        'sys:schedule:resume',
+        'sys:user:delete',
+        'sys:config:list',
+        'sys:user:update',
+        'sys:role:list',
+        'sys:menu:info',
+        'sys:menu:select',
+        'sys:schedule:update',
+        'sys:schedule:save',
+        'sys:role:select',
+        'sys:user:list',
+        'sys:menu:save',
+        'sys:role:save',
+        'sys:schedule:log',
+        'sys:role:info',
+        'sys:schedule:delete',
+        'sys:role:update',
+        'sys:schedule:list',
+        'sys:user:info',
+        'sys:schedule:run',
+        'sys:config:delete',
+        'sys:role:delete',
+        'sys:user:save',
+        'sys:schedule:pause',
+        'sys:log:list',
+        'sys:oss:all'
+      ]
+    }
+  }
+}
+
+// 获取菜单列表
+export function list () {
+  return {
+    // isOpen: false,
+    url: '/sys/menu/list',
+    type: 'get',
+    data: dataList
+  }
+}
+
+// 获取上级菜单
+export function select () {
+  let dataList = JSON.parse(JSON.stringify(navDataList))
+  dataList = dataList.concat(dataList[0].list)
+  return {
+    // isOpen: false,
+    url: '/sys/menu/select',
+    type: 'get',
+    data: {
+      'msg': 'success',
+      'code': 0,
+      'menuList': dataList
+    }
+  }
+}
+
+// 获取菜单信息
+export function info () {
+  return {
+    // isOpen: false,
+    url: '/sys/menu/info',
+    type: 'get',
+    data: {
+      'msg': 'success',
+      'code': 0,
+      'menu': dataList[0]
+    }
+  }
+}
+
+// 添加菜单
+export function add () {
+  return {
+    // isOpen: false,
+    url: '/sys/menu/save',
+    type: 'post',
+    data: {
+      'msg': 'success',
+      'code': 0
+    }
+  }
+}
+
+// 修改菜单
+export function update () {
+  return {
+    // isOpen: false,
+    url: '/sys/menu/update',
+    type: 'post',
+    data: {
+      'msg': 'success',
+      'code': 0
+    }
+  }
+}
+
+// 删除菜单
+export function del () {
+  return {
+    // isOpen: false,
+    url: '/sys/menu/delete',
+    type: 'post',
+    data: {
+      'msg': 'success',
+      'code': 0
+    }
+  }
+}

+ 101 - 0
src/mock/modules/sys-role.js

@@ -0,0 +1,101 @@
+import Mock from 'mockjs'
+
+// 生成数据列表
+var dataList = []
+for (let i = 0; i < Math.floor(Math.random() * 10 + 1); i++) {
+  dataList.push(Mock.mock({
+    'roleId': '@increment',
+    'roleName': '@name',
+    'remark': '@csentence',
+    'createUserId': 1,
+    'menuIdList': '@range(1, 10, 2)',
+    'createTime': '@datetime'
+  }))
+}
+
+// 获取角色列表
+export function list () {
+  return {
+    // isOpen: false,
+    url: '/sys/role/list',
+    type: 'get',
+    data: {
+      'msg': 'success',
+      'code': 0,
+      'page': {
+        'totalCount': dataList.length,
+        'pageSize': 10,
+        'totalPage': 1,
+        'currPage': 1,
+        'list': dataList
+      }
+    }
+  }
+}
+
+// 获取角色列表, 根据当前用户
+export function select () {
+  return {
+    // isOpen: false,
+    url: '/sys/role/select',
+    type: 'get',
+    data: {
+      'msg': 'success',
+      'code': 0,
+      'list': dataList
+    }
+  }
+}
+
+// 获取角色信息
+export function info () {
+  return {
+    // isOpen: false,
+    url: '/sys/role/info',
+    type: 'get',
+    data: {
+      'msg': 'success',
+      'code': 0,
+      'role': dataList[0]
+    }
+  }
+}
+
+// 添加角色
+export function add () {
+  return {
+    // isOpen: false,
+    url: '/sys/role/save',
+    type: 'post',
+    data: {
+      'msg': 'success',
+      'code': 0
+    }
+  }
+}
+
+// 修改角色
+export function update () {
+  return {
+    // isOpen: false,
+    url: '/sys/role/update',
+    type: 'post',
+    data: {
+      'msg': 'success',
+      'code': 0
+    }
+  }
+}
+
+// 删除角色
+export function del () {
+  return {
+    // isOpen: false,
+    url: '/sys/role/delete',
+    type: 'post',
+    data: {
+      'msg': 'success',
+      'code': 0
+    }
+  }
+}

+ 102 - 0
src/mock/modules/sys-user.js

@@ -0,0 +1,102 @@
+import Mock from 'mockjs'
+
+// 生成数据列表
+var dataList = []
+for (let i = 0; i < Math.floor(Math.random() * 10 + 1); i++) {
+  dataList.push(Mock.mock({
+    'userId': '@increment',
+    'username': '@name',
+    'email': '@email',
+    'mobile': /^1[0-9]{10}$/,
+    'status': 1,
+    'roleIdList': null,
+    'createUserId': 1,
+    'createTime': 'datetime'
+  }))
+}
+
+// 获取用户列表
+export function list () {
+  return {
+    // isOpen: false,
+    url: '/sys/user/list',
+    type: 'get',
+    data: {
+      'msg': 'success',
+      'code': 0,
+      'page': {
+        'totalCount': dataList.length,
+        'pageSize': 10,
+        'totalPage': 1,
+        'currPage': 1,
+        'list': dataList
+      }
+    }
+  }
+}
+
+// 获取用户信息
+export function info () {
+  return {
+    // isOpen: false,
+    url: '/sys/user/info',
+    type: 'get',
+    data: {
+      'msg': 'success',
+      'code': 0,
+      'user': dataList[0]
+    }
+  }
+}
+
+// 修改密码
+export function updatePassword () {
+  return {
+    // isOpen: false,
+    url: '/sys/user/password',
+    type: 'post',
+    data: {
+      'msg': 'success',
+      'code': 0
+    }
+  }
+}
+
+// 添加用户
+export function add () {
+  return {
+    // isOpen: false,
+    url: '/sys/user/save',
+    type: 'post',
+    data: {
+      'msg': 'success',
+      'code': 0
+    }
+  }
+}
+
+// 修改用户
+export function update () {
+  return {
+    // isOpen: false,
+    url: '/sys/user/update',
+    type: 'post',
+    data: {
+      'msg': 'success',
+      'code': 0
+    }
+  }
+}
+
+// 删除用户
+export function del () {
+  return {
+    // isOpen: false,
+    url: '/sys/user/delete',
+    type: 'post',
+    data: {
+      'msg': 'success',
+      'code': 0
+    }
+  }
+}

+ 112 - 112
src/router/index.js

@@ -2,76 +2,76 @@ import Vue from 'vue'
 import Router from 'vue-router'
 import http from '@/utils/request'
 import {isURL} from '@/utils/validate'
-import Cookies from "js-cookie";
+import Cookies from 'js-cookie'
 
 Vue.use(Router)
 
 // 页面路由(独立页面)
 export const pageRoutes = [
-    {
-        path: '/404',
-        component: () => import('@/views/pages/404'),
-        name: '404',
-        meta: {title: '404未找到'},
-        beforeEnter(to, from, next) {
-            // 拦截处理特殊业务场景
-            // 如果, 重定向路由包含__双下划线, 为临时添加路由
-            if (/__.*/.test(to.redirectedFrom)) {
-                return next(to.redirectedFrom.replace(/__.*/, ''))
-            }
-            next()
-        }
-    },
-    {path: '/login', component: () => import('@/views/pages/login'), name: 'login', meta: {title: '登录'}}
+  {
+    path: '/404',
+    component: () => import('@/views/pages/404'),
+    name: '404',
+    meta: {title: '404未找到'},
+    beforeEnter (to, from, next) {
+      // 拦截处理特殊业务场景
+      // 如果, 重定向路由包含__双下划线, 为临时添加路由
+      if (/__.*/.test(to.redirectedFrom)) {
+        return next(to.redirectedFrom.replace(/__.*/, ''))
+      }
+      next()
+    }
+  },
+  {path: '/login', component: () => import('@/views/pages/login'), name: 'login', meta: {title: '登录'}}
 ]
 
 // 模块路由(基于主入口布局页面)
 export const moduleRoutes = {
-    path: '/',
-    component: () => import('@/views/main'),
-    name: 'main',
-    redirect: {name: 'home'},
-    meta: {title: '主入口布局'},
-    children: [
-        {path: '/home', component: () => import('@/views/modules/home'), name: 'home', meta: {title: '首页', isTab: true}}
-    ]
+  path: '/',
+  component: () => import('@/views/main/main'),
+  name: 'main',
+  redirect: {name: 'home'},
+  meta: {title: '主入口布局'},
+  children: [
+    {path: '/home', component: () => import('@/views/modules/home'), name: 'home', meta: {title: '首页', isTab: false}}
+  ]
 }
 
 const router = new Router({
-    mode: 'hash',
-    scrollBehavior: () => ({y: 0}),
-    routes: pageRoutes.concat(moduleRoutes)
+  mode: 'hash',
+  scrollBehavior: () => ({y: 0}),
+  routes: pageRoutes.concat(moduleRoutes)
 })
 
 router.beforeEach((to, from, next) => {
-    //截取路由中token进行处理
-    filterToken(to, from, next)
-    // console.log(from)
-    // 添加动态(菜单)路由
-    // 已添加或者当前路由为页面路由, 可直接访问
-    if (window.SITE_CONFIG['dynamicMenuRoutesHasAdded'] || fnCurrentRouteIsPageRoute(to, pageRoutes)) {
-        if(undefined != to.meta.isNavbar){
-            window.SITE_CONFIG['isNavbar'] = to.meta.isNavbar
-        }
-        if(undefined != to.meta.isSidebar){
-            window.SITE_CONFIG['isSidebar'] = to.meta.isSidebar
-        }
-        return next()
+  // 截取路由中token进行处理
+  filterToken(to, from, next)
+  // console.log(from)
+  // 添加动态(菜单)路由
+  // 已添加或者当前路由为页面路由, 可直接访问
+  if (window.SITE_CONFIG['dynamicMenuRoutesHasAdded'] || fnCurrentRouteIsPageRoute(to, pageRoutes)) {
+    if (undefined != to.meta.isNavbar) {
+      window.SITE_CONFIG['isNavbar'] = to.meta.isNavbar
+    }
+    if (undefined != to.meta.isSidebar) {
+      window.SITE_CONFIG['isSidebar'] = to.meta.isSidebar
+    }
+    return next()
+  }
+  // 获取菜单列表, 添加并全局变量保存
+  http.get('/sys/menu/nav').then(({data: res}) => {
+    if (res.code !== 0) {
+      Vue.prototype.$message.error(res.msg)
+      return next({name: 'login'})
     }
-    // 获取菜单列表, 添加并全局变量保存
-    http.get('/sys/menu/nav').then(({data: res}) => {
-        if (res.code !== 0) {
-            Vue.prototype.$message.error(res.msg)
-            return next({name: 'login'})
-        }
 
-        window.SITE_CONFIG['menuList'] = res.data;
+    window.SITE_CONFIG['menuList'] = res.data
 
-        fnAddDynamicMenuRoutes(window.SITE_CONFIG['menuList'])
-        next({...to, replace: true})
-    }).catch(() => {
-        next({name: 'login'})
-    })
+    fnAddDynamicMenuRoutes(window.SITE_CONFIG['menuList'])
+    next({...to, replace: true})
+  }).catch(() => {
+    next({name: 'login'})
+  })
 })
 
 /**
@@ -79,17 +79,17 @@ router.beforeEach((to, from, next) => {
  * @param {*} route 当前路由
  * @param {*} pageRoutes 页面路由
  */
-function fnCurrentRouteIsPageRoute(route, pageRoutes = []) {
-    var temp = [];
-    for (var i = 0; i < pageRoutes.length; i++) {
-        if (route.path === pageRoutes[i].path) {
-            return true
-        }
-        if (pageRoutes[i].children && pageRoutes[i].children.length >= 1) {
-            temp = temp.concat(pageRoutes[i].children)
-        }
+function fnCurrentRouteIsPageRoute (route, pageRoutes = []) {
+  var temp = []
+  for (var i = 0; i < pageRoutes.length; i++) {
+    if (route.path === pageRoutes[i].path) {
+      return true
+    }
+    if (pageRoutes[i].children && pageRoutes[i].children.length >= 1) {
+      temp = temp.concat(pageRoutes[i].children)
     }
-    return temp.length >= 1 ? fnCurrentRouteIsPageRoute(route, temp) : false
+  }
+  return temp.length >= 1 ? fnCurrentRouteIsPageRoute(route, temp) : false
 }
 
 /**
@@ -97,64 +97,64 @@ function fnCurrentRouteIsPageRoute(route, pageRoutes = []) {
  * @param {*} menuList 菜单列表
  * @param {*} routes 递归创建的动态(菜单)路由
  */
-function fnAddDynamicMenuRoutes(menuList = [], routes = []) {
-    var temp = []
-    for (var i = 0; i < menuList.length; i++) {
-        if (menuList[i].children && menuList[i].children.length >= 1) {
-            temp = temp.concat(menuList[i].children)
-            continue
-        }
-        // 组装路由
-        var route = {
-            path: '',
-            component: null,
-            name: '',
-            meta: {
-                ...window.SITE_CONFIG['contentTabDefault'],
-                menuId: menuList[i].id,
-                title: menuList[i].name
-            }
-        }
-        // eslint-disable-next-line
-        let URL = (menuList[i].url || '').replace(/{{([^}}]+)?}}/g, (s1, s2) => eval(s2)) // URL支持{{ window.xxx }}占位符变量
-        if (isURL(URL)) {
-            route['path'] = route['name'] = `i-${menuList[i].id}`
-            route['meta']['iframeURL'] = URL
-        } else {
-            URL = URL.replace(/^\//, '').replace(/_/g, '-')
-            route['path'] = route['name'] = URL.replace(/\//g, '-')
-            route['component'] = () => import(`@/views/modules/${URL}`)
-        }
-        routes.push(route)
+function fnAddDynamicMenuRoutes (menuList = [], routes = []) {
+  var temp = []
+  for (var i = 0; i < menuList.length; i++) {
+    if (menuList[i].children && menuList[i].children.length >= 1) {
+      temp = temp.concat(menuList[i].children)
+      continue
+    }
+    // 组装路由
+    var route = {
+      path: '',
+      component: null,
+      name: '',
+      meta: {
+        ...window.SITE_CONFIG['contentTabDefault'],
+        menuId: menuList[i].id,
+        title: menuList[i].name
+      }
     }
-    if (temp.length >= 1) {
-        return fnAddDynamicMenuRoutes(temp, routes)
+    // eslint-disable-next-line
+        let URL = (menuList[i].url || '').replace(/{{([^}}]+)?}}/g, (s1, s2) => eval(s2)) // URL支持{{ window.xxx }}占位符变量
+    if (isURL(URL)) {
+      route['path'] = route['name'] = `i-${menuList[i].id}`
+      route['meta']['iframeURL'] = URL
+    } else {
+      URL = URL.replace(/^\//, '').replace(/_/g, '-')
+      route['path'] = route['name'] = URL.replace(/\//g, '-')
+      route['component'] = () => import(`@/views/modules/${URL}`)
     }
-    // 添加路由
-    router.addRoutes([
-        {
-            ...moduleRoutes,
-            name: 'main-dynamic-menu',
-            children: routes
-        },
-        {path: '*', redirect: {name: '404'}}
-    ])
-    window.SITE_CONFIG['dynamicMenuRoutes'] = routes
-    window.SITE_CONFIG['dynamicMenuRoutesHasAdded'] = true
+    routes.push(route)
+  }
+  if (temp.length >= 1) {
+    return fnAddDynamicMenuRoutes(temp, routes)
+  }
+  // 添加路由
+  router.addRoutes([
+    {
+      ...moduleRoutes,
+      name: 'main-dynamic-menu',
+      children: routes
+    },
+    {path: '*', redirect: {name: '404'}}
+  ])
+  window.SITE_CONFIG['dynamicMenuRoutes'] = routes
+  window.SITE_CONFIG['dynamicMenuRoutesHasAdded'] = true
 }
 
 /**
  * 截取路由中的token并进行处理
  *
  */
-function filterToken(route, to, from, next){
-    //console.log("token: "+to.fullPath)
-    // var tokens = route.query.token;
-    // console.log(tokens)
-    // if(undefined != tokens){
-    //     Cookies.set('token', tokens)
-    // }
+function filterToken (route, to, from, next) {
+  // console.log("token: "+to.fullPath)
+  // var tokens = route.query.token;
+  // console.log(tokens)
+  // if(undefined != tokens){
+  //     Cookies.set('token', tokens)
+  // }
 
-    // Cookies.set('token', "8dcbf9730cec72cf8435e4f7e67e27fc")
+  // Cookies.set('token', "8dcbf9730cec72cf8435e4f7e67e27fc")
 }
 export default router

+ 0 - 97
src/views/main-navbar-update-password.vue

@@ -1,97 +0,0 @@
-<template>
-  <el-dialog
-    :visible.sync="visible"
-    :title="$t('updatePassword.title')"
-    :close-on-click-modal="false"
-    :close-on-press-escape="false"
-    :append-to-body="true">
-    <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
-      <el-form-item :label="$t('updatePassword.username')">
-        <span>{{ $store.state.user.name }}</span>
-      </el-form-item>
-      <el-form-item prop="password" :label="$t('updatePassword.password')">
-        <el-input v-model="dataForm.password" type="password" :placeholder="$t('updatePassword.password')"></el-input>
-      </el-form-item>
-      <el-form-item prop="newPassword" :label="$t('updatePassword.newPassword')">
-        <el-input v-model="dataForm.newPassword" type="password" :placeholder="$t('updatePassword.newPassword')"></el-input>
-      </el-form-item>
-      <el-form-item prop="comfirmPassword" :label="$t('updatePassword.comfirmPassword')">
-        <el-input v-model="dataForm.comfirmPassword" type="password" :placeholder="$t('updatePassword.comfirmPassword')"></el-input>
-      </el-form-item>
-    </el-form>
-    <template slot="footer">
-      <el-button @click="visible = false">{{ $t('cancel') }}</el-button>
-      <el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
-    </template>
-  </el-dialog>
-</template>
-
-<script>
-import debounce from 'lodash/debounce'
-import { clearLoginInfo } from '@/utils'
-export default {
-  data () {
-    return {
-      visible: false,
-      dataForm: {
-        password: '',
-        newPassword: '',
-        comfirmPassword: ''
-      }
-    }
-  },
-  computed: {
-    dataRule () {
-      var validateComfirmPassword = (rule, value, callback) => {
-        if (this.dataForm.newPassword !== value) {
-          return callback(new Error(this.$t('updatePassword.validate.comfirmPassword')))
-        }
-        callback()
-      }
-      return {
-        password: [
-          { required: true, message: this.$t('validate.required'), trigger: 'blur' }
-        ],
-        newPassword: [
-          { required: true, message: this.$t('validate.required'), trigger: 'blur' }
-        ],
-        comfirmPassword: [
-          { required: true, message: this.$t('validate.required'), trigger: 'blur' },
-          { validator: validateComfirmPassword, trigger: 'blur' }
-        ]
-      }
-    }
-  },
-  methods: {
-    init () {
-      this.visible = true
-      this.$nextTick(() => {
-        this.$refs['dataForm'].resetFields()
-      })
-    },
-    // 表单提交
-    dataFormSubmitHandle: debounce(function () {
-      this.$refs['dataForm'].validate((valid) => {
-        if (!valid) {
-          return false
-        }
-        this.$http.put('/sys/user/password', this.dataForm).then(({ data: res }) => {
-          if (res.code !== 0) {
-            return this.$message.error(res.msg)
-          }
-          this.$message({
-            message: this.$t('prompt.success'),
-            type: 'success',
-            duration: 500,
-            onClose: () => {
-              this.visible = false
-              clearLoginInfo()
-              this.$router.replace({ name: 'login' })
-            }
-          })
-        }).catch(() => {})
-      })
-    }, 1000, { 'leading': true, 'trailing': false })
-  }
-}
-</script>

+ 0 - 95
src/views/main-navbar.vue

@@ -1,95 +0,0 @@
-<template>
-  <nav class="aui-navbar" :class="`aui-navbar--${$store.state.navbarLayoutType}`">
-    <div class="aui-navbar__header">
-      <h1 class="aui-navbar__brand" @click="$router.push({ name: 'home' })">
-        <a class="aui-navbar__brand-lg" href="javascript:;">{{ $t('brand.lg') }}</a>
-        <a class="aui-navbar__brand-mini" href="javascript:;">{{ $t('brand.mini') }}</a>
-      </h1>
-    </div>
-    <div class="aui-navbar__body">
-      <el-menu class="aui-navbar__menu mr-auto" mode="horizontal">
-        <el-menu-item index="1" @click="$store.state.sidebarFold = !$store.state.sidebarFold">
-          <svg class="icon-svg aui-navbar__icon-menu aui-navbar__icon-menu--switch" aria-hidden="true"><use xlink:href="#icon-outdent"></use></svg>
-        </el-menu-item>
-        <el-menu-item index="2" @click="refresh()">
-          <svg class="icon-svg aui-navbar__icon-menu aui-navbar__icon-menu--refresh" aria-hidden="true"><use xlink:href="#icon-sync"></use></svg>
-        </el-menu-item>
-      </el-menu>
-      <el-menu class="aui-navbar__menu" mode="horizontal">
-        <el-menu-item index="1" @click="fullscreenHandle()">
-          <svg class="icon-svg aui-navbar__icon-menu" aria-hidden="true"><use xlink:href="#icon-fullscreen"></use></svg>
-        </el-menu-item>
-        <el-menu-item index="2" class="aui-navbar__avatar">
-          <el-dropdown placement="bottom" :show-timeout="0">
-            <span class="el-dropdown-link">
-              <img src="~@/assets/img/avatar.png">
-              <span>{{ $store.state.user.name }}</span>
-              <i class="el-icon-arrow-down"></i>
-            </span>
-            <el-dropdown-menu slot="dropdown">
-              <el-dropdown-item @click.native="updatePasswordHandle()">{{ $t('updatePassword.title') }}</el-dropdown-item>
-              <el-dropdown-item @click.native="logoutHandle()">{{ $t('logout') }}</el-dropdown-item>
-            </el-dropdown-menu>
-          </el-dropdown>
-        </el-menu-item>
-      </el-menu>
-    </div>
-    <!-- 弹窗, 修改密码 -->
-    <update-password v-if="updatePassowrdVisible" ref="updatePassowrd"></update-password>
-  </nav>
-</template>
-
-<script>
-import { messages } from '@/i18n'
-import screenfull from 'screenfull'
-import UpdatePassword from './main-navbar-update-password'
-import { clearLoginInfo } from '@/utils'
-export default {
-  inject: ['refresh'],
-  data () {
-    return {
-      i18nMessages: messages,
-      updatePassowrdVisible: false
-    }
-  },
-  components: {
-    UpdatePassword
-  },
-  methods: {
-    // 全屏
-    fullscreenHandle () {
-      if (!screenfull.enabled) {
-        return this.$message({
-          message: this.$t('fullscreen.prompt'),
-          type: 'warning',
-          duration: 500
-        })
-      }
-      screenfull.toggle()
-    },
-    // 修改密码
-    updatePasswordHandle () {
-      this.updatePassowrdVisible = true
-      this.$nextTick(() => {
-        this.$refs.updatePassowrd.init()
-      })
-    },
-    // 退出
-    logoutHandle () {
-      this.$confirm(this.$t('prompt.info', { 'handle': this.$t('logout') }), this.$t('prompt.title'), {
-        confirmButtonText: this.$t('confirm'),
-        cancelButtonText: this.$t('cancel'),
-        type: 'warning'
-      }).then(() => {
-        this.$http.post('/logout').then(({ data: res }) => {
-          if (res.code !== 0) {
-            return this.$message.error(res.msg)
-          }
-          clearLoginInfo()
-          this.$router.push({ name: 'login' })
-        }).catch(() => {})
-      }).catch(() => {})
-    }
-  }
-}
-</script>

+ 0 - 62
src/views/main-theme-tools.vue

@@ -1,62 +0,0 @@
-<template>
-  <div class="aui-theme-tools" :class="{ 'aui-theme-tools--open': isOpen }">
-    <div class="aui-theme-tools__toggle" @click="isOpen = !isOpen">
-      <svg class="icon-svg" aria-hidden="true"><use xlink:href="#icon-setting"></use></svg>
-    </div>
-    <div class="aui-theme-tools__content">
-      <div class="aui-theme-tools__item">
-        <h3>Navbar</h3>
-        <el-checkbox v-model="$store.state.navbarLayoutType" true-label="colorful">colorful 鲜艳</el-checkbox>
-      </div>
-      <div class="aui-theme-tools__item">
-        <h3>Sidebar</h3>
-        <el-checkbox v-model="$store.state.sidebarLayoutSkin" true-label="dark">dark 黑色</el-checkbox>
-      </div>
-      <div class="aui-theme-tools__item">
-        <h3>Theme</h3>
-        <el-radio-group v-model="themeColor" @change="themeColorChangeHandle">
-          <el-radio v-for="item in themeList" :key="item.name" :label="item.name">{{ `${item.name} ${item.desc}` }}</el-radio>
-        </el-radio-group>
-      </div>
-    </div>
-  </div>
-</template>
-
-<script>
-export default {
-  data () {
-    return {
-      isOpen: false,
-      themeList: require('@/element-ui/config.js'),
-      themeColor: 'turquoise'
-    }
-  },
-  methods: {
-    themeColorChangeHandle (val) {
-      console.log(JSON.stringify(val))
-      var styleList = [
-        {
-          id: 'J_elementTheme',
-          url: `${process.env.BASE_URL}element-theme/${val}/index.css?t=${new Date().getTime()}`
-        },
-        {
-          id: 'J_auiTheme',
-          url: `${process.env.BASE_URL}element-theme/${val}/aui.css?t=${new Date().getTime()}`
-        }
-      ]
-      for (var i = 0; i < styleList.length; i++) {
-        var el = document.querySelector(`#${styleList[i].id}`)
-        if (el) {
-          el.href = styleList[i].url
-          continue
-        }
-        el = document.createElement('link')
-        el.id = styleList[i].id
-        el.href = styleList[i].url
-        el.rel = 'stylesheet'
-        document.querySelector('head').appendChild(el)
-      }
-    }
-  }
-}
-</script>

+ 25 - 0
src/views/main/main-content-crumb.vue

@@ -0,0 +1,25 @@
+<template>
+  <div class="content-crumb">
+    面包屑导航
+  </div>
+</template>
+
+<script>
+export default {
+  data () {
+    return {
+      isOpen: false
+
+    }
+  },
+  methods: {
+
+  }
+}
+</script>
+
+<style lang="scss">
+.content-crumb{
+  padding: 0!important;
+}
+</style>

+ 5 - 0
src/views/main-content.vue

@@ -30,6 +30,7 @@
     </template>
     <!-- 其他方式, 展示内容 -->
     <template v-else>
+      <content-crumb></content-crumb>
       <keep-alive>
         <router-view />
       </keep-alive>
@@ -39,11 +40,15 @@
 
 <script>
 import { isURL } from '@/utils/validate'
+import ContentCrumb from './main-content-crumb'
 export default {
   data () {
     return {
     }
   },
+  components: {
+    ContentCrumb
+  },
   methods: {
     // tabs, 是否通过iframe展示
     tabIsIframe (url) {

+ 24 - 0
src/views/main/main-navbar-menu.vue

@@ -0,0 +1,24 @@
+<template>
+  <div class="navbar-menu">
+    顶导航
+  </div>
+</template>
+
+<script>
+export default {
+  data () {
+    return {
+
+    }
+  },
+  methods: {
+
+  }
+}
+</script>
+
+<style lang="scss">
+.navbar-menu{
+  padding: 0!important;
+}
+</style>

+ 25 - 0
src/views/main/main-navbar-news.vue

@@ -0,0 +1,25 @@
+<template>
+  <div class="navbar-news">
+    消息
+  </div>
+</template>
+
+<script>
+export default {
+  data () {
+    return {
+      isOpen: false
+
+    }
+  },
+  methods: {
+
+  }
+}
+</script>
+
+<style lang="scss">
+.navbar-news{
+  padding: 0!important;
+}
+</style>

+ 25 - 0
src/views/main/main-navbar-user.vue

@@ -0,0 +1,25 @@
+<template>
+  <div class="navbar-user">
+    用户
+  </div>
+</template>
+
+<script>
+export default {
+  data () {
+    return {
+      isOpen: false
+
+    }
+  },
+  methods: {
+
+  }
+}
+</script>
+
+<style lang="scss">
+.navbar-user{
+  padding: 0!important;
+}
+</style>

+ 73 - 0
src/views/main/main-navbar.vue

@@ -0,0 +1,73 @@
+<template>
+  <nav class="aui-navbar" :class="`aui-navbar--${$store.state.navbarLayoutType}`">
+    <div class="aui-navbar__hd">
+      <h1 class="aui-navbar__brand" @click="$router.push({ name: 'home' })">
+        <a class="aui-navbar__brand-lg" href="javascript:;"><img src="" /></a>
+      </h1>
+    </div>
+    <div class="aui-navbar__bd">
+      <navbar-menu></navbar-menu>
+      <navbar-news></navbar-news>
+      <navbar-user></navbar-user>
+    </div>
+  </nav>
+</template>
+
+<script>
+import { messages } from '@/i18n'
+import screenfull from 'screenfull'
+import { clearLoginInfo } from '@/utils'
+import NavbarMenu from './main-navbar-menu'
+import NavbarNews from './main-navbar-news'
+import NavbarUser from './main-navbar-user'
+export default {
+  inject: ['refresh'],
+  data () {
+    return {
+      i18nMessages: messages,
+      updatePassowrdVisible: false
+    }
+  },
+  components: {
+    NavbarMenu,
+    NavbarNews,
+    NavbarUser
+  },
+  methods: {
+    // 全屏
+    fullscreenHandle () {
+      if (!screenfull.enabled) {
+        return this.$message({
+          message: this.$t('fullscreen.prompt'),
+          type: 'warning',
+          duration: 500
+        })
+      }
+      screenfull.toggle()
+    },
+    // 修改密码
+    updatePasswordHandle () {
+      this.updatePassowrdVisible = true
+      this.$nextTick(() => {
+        this.$refs.updatePassowrd.init()
+      })
+    },
+    // 退出
+    logoutHandle () {
+      this.$confirm(this.$t('prompt.info', { 'handle': this.$t('logout') }), this.$t('prompt.title'), {
+        confirmButtonText: this.$t('confirm'),
+        cancelButtonText: this.$t('cancel'),
+        type: 'warning'
+      }).then(() => {
+        this.$http.post('/logout').then(({ data: res }) => {
+          if (res.code !== 0) {
+            return this.$message.error(res.msg)
+          }
+          clearLoginInfo()
+          this.$router.push({ name: 'login' })
+        }).catch(() => {})
+      }).catch(() => {})
+    }
+  }
+}
+</script>

src/views/main-sidebar-sub-menu.vue → src/views/main/main-sidebar-sub-menu.vue


+ 4 - 0
src/views/main-sidebar.vue

@@ -1,5 +1,9 @@
 <template>
   <aside :class="['aui-sidebar', `aui-sidebar--${$store.state.sidebarLayoutSkin}`]">
+    <div class="aui-sidebar__hd">
+      <div class="aui-sidebar__hd-title">监测预警</div>
+      <div class="aui-sidebar__switch">开</div>
+    </div>
     <div class="aui-sidebar__inner">
       <el-menu
         :default-active="$store.state.sidebarMenuActiveName"

+ 13 - 15
src/views/main.vue

@@ -14,7 +14,7 @@
 import MainNavbar from './main-navbar'
 import MainSidebar from './main-sidebar'
 import MainContent from './main-content'
-import MainThemeTools from './main-theme-tools'
+// import MainThemeTools from './main-theme-tools'
 import debounce from 'lodash/debounce'
 export default {
   provide () {
@@ -31,17 +31,17 @@ export default {
   data () {
     return {
       loading: true,
-      navbarFlag:false,
-      sidebarFlag:false,
-      mainContent:"aui-content__wrapper",
-      auiWrapper:''
+      navbarFlag: false,
+      sidebarFlag: false,
+      mainContent: 'aui-content__wrapper',
+      auiWrapper: ''
     }
   },
   components: {
     MainNavbar,
     MainSidebar,
-    MainContent,
-    MainThemeTools
+    MainContent
+    // MainThemeTools
   },
   watch: {
     $route: 'routeHandle'
@@ -57,16 +57,14 @@ export default {
       this.loading = false
     })
 
-
-    this.navbarFlag = window.SITE_CONFIG['isNavbar'];
-    this.sidebarFlag = window.SITE_CONFIG['isSidebar'];
-    if(!this.sidebarFlag){
-      this.mainContent = "";
+    this.navbarFlag = window.SITE_CONFIG['isNavbar']
+    this.sidebarFlag = window.SITE_CONFIG['isSidebar']
+    if (!this.sidebarFlag) {
+      this.mainContent = ''
     }
-    if(!this.navbarFlag){
-      this.auiWrapper = "padding-top:0px;";
+    if (!this.navbarFlag) {
+      this.auiWrapper = 'padding-top:0px;'
     }
-
   },
   methods: {
     // 窗口改变大小

+ 27 - 0
src/views/monitor-warn/index/monitorwarn-index-clue-hd.vue

@@ -0,0 +1,27 @@
+<template>
+  <div class="monitorwarn-index-clue-hd">
+    <div class="mich-item">
+      <div class="mich-num">6</div>
+      <div class="mich-text">市县数据</div>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  data () {
+    return {
+
+    }
+  },
+  methods: {
+
+  }
+}
+</script>
+
+<style lang="scss">
+.monitorwarn-index-clue-hd{
+  padding: 0!important;
+}
+</style>

+ 25 - 0
src/views/monitor-warn/index/monitorwarn-index-clue.vue

@@ -0,0 +1,25 @@
+<template>
+  <div class="monitorwarn-index-clue">
+    <div class="mic-hd"></div>
+    <div class="mic-bd"></div>
+  </div>
+</template>
+
+<script>
+export default {
+  data () {
+    return {
+
+    }
+  },
+  methods: {
+
+  }
+}
+</script>
+
+<style lang="scss">
+.monitorwarn-index-clue{
+  padding: 0!important;
+}
+</style>

+ 24 - 0
src/views/monitor-warn/index/monitorwarn-index-statistic.vue

@@ -0,0 +1,24 @@
+<template>
+  <div class="monitorwarn-index-statistic">
+    预警统计展示
+  </div>
+</template>
+
+<script>
+export default {
+  data () {
+    return {
+
+    }
+  },
+  methods: {
+
+  }
+}
+</script>
+
+<style lang="scss">
+.monitorwarn-index-statistic{
+  padding: 0!important;
+}
+</style>

+ 24 - 0
src/views/monitor-warn/index/monitorwarn-index.vue

@@ -0,0 +1,24 @@
+<template>
+  <div class="monitorwarn-index">
+    监测预警首页
+  </div>
+</template>
+
+<script>
+export default {
+  data () {
+    return {
+
+    }
+  },
+  methods: {
+
+  }
+}
+</script>
+
+<style lang="scss">
+.monitorwarn-index{
+  padding: 0!important;
+}
+</style>

+ 19 - 18
src/views/pages/login.vue

@@ -75,8 +75,7 @@ export default {
         ],
         password: [
           { required: true, message: this.$t('validate.required'), trigger: 'blur' }
-        ]
-        ,
+        ],
         captcha: [
           { required: true, message: this.$t('validate.required'), trigger: 'blur' }
         ]
@@ -94,25 +93,27 @@ export default {
     },
     // 表单提交
     dataFormSubmitHandle: debounce(function () {
-      this.$refs['dataForm'].validate((valid) => {
-        if (!valid) {
-          return false
-        }
-        this.$http.post('/login', this.dataForm).then(({ data: res }) => {
-          if (res.code !== 0) {
-            this.getCaptcha()
-            return this.$message.error(res.msg)
-          }
-          Cookies.set('token', res.data.token)
-          this.$router.replace({ name: 'home' })
-        }).catch(() => {})
-      })
+      this.$router.replace({ name: 'home' })
+
+      // this.$refs['dataForm'].validate((valid) => {
+      //   if (!valid) {
+      //     return false
+      //   }
+      //   this.$http.post('/login', this.dataForm).then(({ data: res }) => {
+      //     if (res.code !== 0) {
+      //       this.getCaptcha()
+      //       return this.$message.error(res.msg)
+      //     }
+      //     Cookies.set('token', res.data.token)
+      //     this.$router.replace({ name: 'home' })
+      //   }).catch(() => {})
+      // })
     }, 1000, { 'leading': true, 'trailing': false })
   }
 }
 </script>
 <style scoped>
-  .aui-page__login .aui-content{
-    padding: 0!important;
-  }
+.aui-page__login .aui-content{
+  padding: 0!important;
+}
 </style>