ソースを参照

Merge branch 'hcb' of SH-Arbitrate/Arbitrate-Frontend into master

hanchaobo 2 年 前
コミット
a4644c8b37
共有93 個のファイルを変更した20380 個の追加2 個の削除を含む
  1. 12
    0
      .babelrc
  2. 9
    0
      .editorconfig
  3. 14
    0
      .gitignore
  4. 10
    0
      .postcssrc.js
  5. 21
    0
      LICENSE
  6. 208
    2
      README.md
  7. 41
    0
      build/build.js
  8. 54
    0
      build/check-versions.js
  9. 102
    0
      build/utils.js
  10. 22
    0
      build/vue-loader.conf.js
  11. 82
    0
      build/webpack.base.conf.js
  12. 91
    0
      build/webpack.dev.conf.js
  13. 145
    0
      build/webpack.prod.conf.js
  14. 7
    0
      config/dev.env.js
  15. 77
    0
      config/index.js
  16. 4
    0
      config/prod.env.js
  17. 48
    0
      eslintrc.js
  18. バイナリ
      favicon.ico
  19. 17
    0
      index.html
  20. 12135
    0
      package-lock.json
  21. 68
    0
      package.json
  22. 1
    0
      project/index.html
  23. 2
    0
      project/static/css/app.f7de60d9ec9c07c112d0b94c59208a0e.css
  24. 1
    0
      project/static/css/app.f7de60d9ec9c07c112d0b94c59208a0e.css.map
  25. バイナリ
      project/static/fonts/element-icons.6f0a763.ttf
  26. バイナリ
      project/static/fonts/iconfont.4f4ba31.eot
  27. バイナリ
      project/static/fonts/iconfont.9a8d1b2.ttf
  28. バイナリ
      project/static/gif.gif
  29. 96
    0
      project/static/img/iconfont.df0dca9.svg
  30. 2
    0
      project/static/js/app.656e0752769862c0c376.js
  31. 1
    0
      project/static/js/app.656e0752769862c0c376.js.map
  32. 2
    0
      project/static/js/manifest.3ad1d5771e9b13dbdad2.js
  33. 1
    0
      project/static/js/manifest.3ad1d5771e9b13dbdad2.js.map
  34. 58
    0
      project/static/js/vendor.e37fbe972401a2962be8.js
  35. 1
    0
      project/static/js/vendor.e37fbe972401a2962be8.js.map
  36. バイナリ
      project/static/交易订单.png
  37. バイナリ
      project/static/商品管理.png
  38. バイナリ
      project/static/展开与压缩.png
  39. バイナリ
      project/static/支付配置.png
  40. バイナリ
      project/static/用户管理.png
  41. バイナリ
      project/static/登录.png
  42. バイナリ
      project/static/编辑.png
  43. バイナリ
      project/static/角色管理.png
  44. 30
    0
      src/App.vue
  45. 58
    0
      src/api/axiosFun.js
  46. 32
    0
      src/api/basisMG.js
  47. 32
    0
      src/api/payMG.js
  48. 97
    0
      src/api/userMG.js
  49. 101
    0
      src/assets/icon/iconfont.css
  50. バイナリ
      src/assets/icon/iconfont.eot
  51. 96
    0
      src/assets/icon/iconfont.svg
  52. バイナリ
      src/assets/icon/iconfont.ttf
  53. バイナリ
      src/assets/icon/iconfont.woff
  54. バイナリ
      src/assets/img/bg.png
  55. バイナリ
      src/assets/img/logo.png
  56. バイナリ
      src/assets/img/show.png
  57. バイナリ
      src/assets/img/sq.png
  58. 48
    0
      src/components/Pagination.vue
  59. 26
    0
      src/components/error.vue
  60. 226
    0
      src/components/leftnav.vue
  61. 113
    0
      src/components/navcon.vue
  62. 58
    0
      src/components/template.vue
  63. 82
    0
      src/main.js
  64. 179
    0
      src/router/index.js
  65. 90
    0
      src/utils/util.js
  66. 565
    0
      src/views/charts/statistics.vue
  67. 18
    0
      src/views/druid/login.vue
  68. 332
    0
      src/views/goods/Goods.vue
  69. 97
    0
      src/views/index.vue
  70. 166
    0
      src/views/login.vue
  71. 18
    0
      src/views/machine/Machine.vue
  72. 18
    0
      src/views/machine/MachineAisle.vue
  73. 401
    0
      src/views/machine/MachineConfig.vue
  74. 610
    0
      src/views/pay/Config.vue
  75. 631
    0
      src/views/pay/Order.vue
  76. 332
    0
      src/views/system/Dept.vue
  77. 331
    0
      src/views/system/Module.vue
  78. 465
    0
      src/views/system/Permission.vue
  79. 500
    0
      src/views/system/Role.vue
  80. 367
    0
      src/views/system/Variable.vue
  81. 907
    0
      src/views/system/user.vue
  82. 22
    0
      src/vuex/store.js
  83. 0
    0
      static/.gitkeep
  84. バイナリ
      static/gif.gif
  85. バイナリ
      static/wx.jpg
  86. バイナリ
      static/交易订单.png
  87. バイナリ
      static/商品管理.png
  88. バイナリ
      static/展开与压缩.png
  89. バイナリ
      static/支付配置.png
  90. バイナリ
      static/用户管理.png
  91. バイナリ
      static/登录.png
  92. バイナリ
      static/编辑.png
  93. バイナリ
      static/角色管理.png

+ 12
- 0
.babelrc ファイルの表示

@@ -0,0 +1,12 @@
1
+{
2
+  "presets": [
3
+    ["env", {
4
+      "modules": false,
5
+      "targets": {
6
+        "browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
7
+      }
8
+    }],
9
+    "stage-2"
10
+  ],
11
+  "plugins": ["transform-vue-jsx", "transform-runtime"]
12
+}

+ 9
- 0
.editorconfig ファイルの表示

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

+ 14
- 0
.gitignore ファイルの表示

@@ -0,0 +1,14 @@
1
+.DS_Store
2
+node_modules/
3
+/dist/
4
+npm-debug.log*
5
+yarn-debug.log*
6
+yarn-error.log*
7
+
8
+# Editor directories and files
9
+.idea
10
+.vscode
11
+*.suo
12
+*.ntvs*
13
+*.njsproj
14
+*.sln

+ 10
- 0
.postcssrc.js ファイルの表示

@@ -0,0 +1,10 @@
1
+// https://github.com/michael-ciniawsky/postcss-load-config
2
+
3
+module.exports = {
4
+  "plugins": {
5
+    "postcss-import": {},
6
+    "postcss-url": {},
7
+    // to edit target browsers: use "browserslist" field in package.json
8
+    "autoprefixer": {}
9
+  }
10
+}

+ 21
- 0
LICENSE ファイルの表示

@@ -0,0 +1,21 @@
1
+MIT License
2
+
3
+Copyright (c) 2018 lidonghui
4
+
5
+Permission is hereby granted, free of charge, to any person obtaining a copy
6
+of this software and associated documentation files (the "Software"), to deal
7
+in the Software without restriction, including without limitation the rights
8
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+copies of the Software, and to permit persons to whom the Software is
10
+furnished to do so, subject to the following conditions:
11
+
12
+The above copyright notice and this permission notice shall be included in all
13
+copies or substantial portions of the Software.
14
+
15
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+SOFTWARE.

+ 208
- 2
README.md ファイルの表示

@@ -1,3 +1,209 @@
1
-# Arbitrate-Frontend
1
+# vue搭建后台管理界面模版(PC端)
2
+------------------------
3
+
4
+<img src="./static/gif.gif" width="100%" height="519px"/>  
5
+
6
+
7
+#### 技术栈
8
+vue2 + vuex + vue-router + webpack + ES6/7 + axios + elementUI + 阿里图标iconfont
9
+
10
+#### 项目预览
11
+[http://nmgwap.gitee.io/vueproject/#/login](http://nmgwap.gitee.io/vueproject/#/login)
12
+
13
+
14
+#### 说明
15
+
16
+>  本项目主要用于熟悉如何用 vue2 架构一个后端管理平台项目
17
+
18
+>  为了方便后期修改使用,模拟数据在页面中,具体修改看下面【强调】
19
+
20
+>  如果对您有帮助,您可以点右上角 "Star" 支持一下 谢谢! ^_^
21
+
22
+>  或者您可以 "follow" 一下,我会不断开源更多的有趣的项目
23
+
24
+>  开发环境 w7  Chrome 61
25
+
26
+>  如有问题请直接在 Issues 中提,或者您发现问题并有非常好的解决方案,欢迎 PR 👍
27
+
28
+
29
+#### 目录结构
30
+------------------------
31
+
32
+```bash
33
+├── /build/          # 项目构建(webpack)相关配置
34
+├── /config/         # 项目开发环境配置
35
+├── /src/            # 源码目录
36
+│ ├── /api/          # 请求
37
+│ ├── /assets/       # 组件静态资源(图片)
38
+│ ├── /components/   # 公共组件
39
+| ├── /api/          # 请求接口
40
+│ ├── /router/       # 路由配置
41
+│ ├── /vuex/         # vuex状态管理
42
+│ ├── /views/        # 路由组件(页面维度)
43
+│ ├── /config/       # 接口配置文件(请求地址)
44
+│ ├── App.vue        # 组件入口
45
+│ └── main.js        # 程序入口
46
+├── /static/         # 非组件静态资源
47
+├── .babelrc         # ES6语法编译配置
48
+├── .editorconfig    # 定义代码格式
49
+├── .eslintignore    # ES6规范忽略文件
50
+├── .eslintrc.js     # ES6语法规范配置
51
+├── .gitignore       # git忽略文件
52
+├── index.html       # 页面入口
53
+├── package.json     # 项目依赖
54
+└── README.md        # 项目文档
55
+```
56
+
57
+#### 强调
58
+
59
+项目请求已经改为假数据,例如:
60
+``` bash
61
+// 模拟数据开始
62
+      let res = {
63
+        code: 0,
64
+        msg: null,
65
+        count: 12,
66
+        data: [
67
+          {
68
+            addUser: '1',
69
+            editUser: '1',
70
+            addTime: null,
71
+            editTime: 1527411068000,
72
+            userId: 1,
73
+            systemNo: 'pmd',
74
+            userName: 'root',
75
+            userPassword: 'e10adc3949ba59abbe56e057f20f883e',
76
+            userRealName: '超级管理员',
77
+            userSex: '女',
78
+            userMobile: '138123456789',
79
+            userEmail: '111@qq.com',
80
+            isLock: 'N',
81
+            deptId: 1,
82
+            deptName: 'xxxx',
83
+            roleId: 1
84
+          }
85
+        ]
86
+      }
87
+      this.loading = false
88
+      this.userData = res.data
89
+      // 分页赋值
90
+      this.pageparm.currentPage = this.formInline.page
91
+      this.pageparm.pageSize = this.formInline.limit
92
+      this.pageparm.total = res.count
93
+      // 模拟数据结束
94
+
95
+      /***
96
+       * 调用接口,注释上面模拟数据 取消下面注释
97
+       */
98
+      // 获取用户列表
99
+      // userList(parameter).then(res => {
100
+      //   this.loading = false
101
+      //   if (res.success == false) {
102
+      //     this.$message({
103
+      //       type: 'info',
104
+      //       message: res.msg
105
+      //     })
106
+      //   } else {
107
+      //     this.userData = res.data
108
+      //     // 分页赋值
109
+      //     this.pageparm.currentPage = this.formInline.page
110
+      //     this.pageparm.pageSize = this.formInline.limit
111
+      //     this.pageparm.total = res.count
112
+      //   }
113
+      // })
114
+```
115
+把模拟数据开始到结束注释掉,下面解除注释即可,
116
+接口地址需要修改config/index.js文件 dev
117
+``` bash
118
+proxyTable: {
119
+    '/api': {
120
+        target: 'http://xxx.xxx.xxx.xxx:xxx', // 你请求的第三方接口
121
+        changeOrigin: true, // 在本地会创建一个虚拟服务端,然后发送请求的数据,并同时接收请求的数据,这样服务端和服务端进行数据的交互就不会有跨域问题
122
+        pathRewrite: { // 路径重写,
123
+            '^/api': '/api' // 替换target中的请求地址,也就是说以后你在请求http://api.jisuapi.com/XXXXX这个地址的时候直接写成/api即可。
124
+        }
125
+    }
126
+},
127
+
128
+```
129
+#### 完成功能
130
+- [x] 登录 -- 完成
131
+- [x] 路由拦截 -- 完成
132
+- [x] 商品管理(增加、编辑、搜索、删除) -- 完成
133
+- [x] 角色管理(增加、编辑、搜索、删除、权限管理) -- 完成
134
+- [x] 交易订单(增加、编辑、搜索、删除) -- 完成
135
+- [x] 用户管理(增加、编辑、搜索、删除、数据权限、刷新缓存) -- 完成
136
+- [x] 支付配置(增加、编辑、搜索、删除) -- 完成
137
+- [x] 系统环境变量(增加、编辑、搜索、删除) -- 完成
138
+- [x] 权限管理(增加、编辑、搜索、删除、配置权限) -- 完成
139
+- [x] 菜单管理(增加、编辑、搜索、删除) -- 完成
140
+- [x] 公司管理(增加、编辑、搜索、删除) -- 完成
141
+
142
+
143
+#### 部分截图
144
+------------------------
145
+
146
+商品管理
147
+![商品管理](./static/商品管理.png "商品管理")
148
+
149
+角色管理
150
+![角色管理](./static/角色管理.png "角色管理")
151
+
152
+交易订单
153
+![交易订单](./static/交易订单.png "交易订单")
154
+
155
+编辑
156
+![编辑](./static/编辑.png "编辑")
157
+
158
+用户管理
159
+![用户管理](./static/用户管理.png "用户管理")
160
+
161
+支付配置
162
+![支付配置](./static/支付配置.png "支付配置")
163
+
164
+展开与压缩
165
+![展开与压缩](./static/展开与压缩.png "展开与压缩")
166
+
167
+
168
+#### 运行项目
169
+------------------------
170
+
171
+``` bash
172
+# install dependencies
173
+npm install
174
+
175
+# serve with hot reload at localhost:8080
176
+npm run dev
177
+
178
+# build for production with minification
179
+npm run build
180
+
181
+# build for production and view the bundle analyzer report
182
+npm run build --report
183
+
184
+# run unit tests
185
+npm run unit
186
+
187
+# run e2e tests
188
+npm run e2e
189
+
190
+# run all tests
191
+npm test
192
+
193
+
194
+```
195
+
196
+#### 项目源码地址:
197
+------------------------
198
+
199
+码云地址:https://gitee.com/ldhblog/vue-element.git  
200
+github地址:https://github.com/nmgwap/vue-ManagementPlatform.git  
201
+
202
+
203
+#### 微信公众号
204
+------------------------  
205
+
206
+<img src="/static/wx.jpg"  width = "270" height = "270"/>
207
+
208
+
2 209
 
3
-应用层PC端前端服务

+ 41
- 0
build/build.js ファイルの表示

@@ -0,0 +1,41 @@
1
+'use strict'
2
+require('./check-versions')()
3
+
4
+process.env.NODE_ENV = 'production'
5
+
6
+const ora = require('ora')
7
+const rm = require('rimraf')
8
+const path = require('path')
9
+const chalk = require('chalk')
10
+const webpack = require('webpack')
11
+const config = require('../config')
12
+const webpackConfig = require('./webpack.prod.conf')
13
+
14
+const spinner = ora('building for production...')
15
+spinner.start()
16
+
17
+rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
18
+  if (err) throw err
19
+  webpack(webpackConfig, (err, stats) => {
20
+    spinner.stop()
21
+    if (err) throw err
22
+    process.stdout.write(stats.toString({
23
+      colors: true,
24
+      modules: false,
25
+      children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
26
+      chunks: false,
27
+      chunkModules: false
28
+    }) + '\n\n')
29
+
30
+    if (stats.hasErrors()) {
31
+      console.log(chalk.red('  Build failed with errors.\n'))
32
+      process.exit(1)
33
+    }
34
+
35
+    console.log(chalk.cyan('  Build complete.\n'))
36
+    console.log(chalk.yellow(
37
+      '  Tip: built files are meant to be served over an HTTP server.\n' +
38
+      '  Opening index.html over file:// won\'t work.\n'
39
+    ))
40
+  })
41
+})

+ 54
- 0
build/check-versions.js ファイルの表示

@@ -0,0 +1,54 @@
1
+'use strict'
2
+const chalk = require('chalk')
3
+const semver = require('semver')
4
+const packageConfig = require('../package.json')
5
+const shell = require('shelljs')
6
+
7
+function exec (cmd) {
8
+  return require('child_process').execSync(cmd).toString().trim()
9
+}
10
+
11
+const versionRequirements = [
12
+  {
13
+    name: 'node',
14
+    currentVersion: semver.clean(process.version),
15
+    versionRequirement: packageConfig.engines.node
16
+  }
17
+]
18
+
19
+if (shell.which('npm')) {
20
+  versionRequirements.push({
21
+    name: 'npm',
22
+    currentVersion: exec('npm --version'),
23
+    versionRequirement: packageConfig.engines.npm
24
+  })
25
+}
26
+
27
+module.exports = function () {
28
+  const warnings = []
29
+
30
+  for (let i = 0; i < versionRequirements.length; i++) {
31
+    const mod = versionRequirements[i]
32
+
33
+    if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
34
+      warnings.push(mod.name + ': ' +
35
+        chalk.red(mod.currentVersion) + ' should be ' +
36
+        chalk.green(mod.versionRequirement)
37
+      )
38
+    }
39
+  }
40
+
41
+  if (warnings.length) {
42
+    console.log('')
43
+    console.log(chalk.yellow('To use this template, you must update following to modules:'))
44
+    console.log()
45
+
46
+    for (let i = 0; i < warnings.length; i++) {
47
+      const warning = warnings[i]
48
+      console.log('  ' + warning)
49
+    }
50
+
51
+    console.log()
52
+    process.exit(1)
53
+  }
54
+}

+ 102
- 0
build/utils.js ファイルの表示

@@ -0,0 +1,102 @@
1
+'use strict'
2
+const path = require('path')
3
+const config = require('../config')
4
+const ExtractTextPlugin = require('extract-text-webpack-plugin')
5
+const packageConfig = require('../package.json')
6
+
7
+exports.assetsPath = function(_path) {
8
+    const assetsSubDirectory = process.env.NODE_ENV === 'production' ?
9
+        config.build.assetsSubDirectory :
10
+        config.dev.assetsSubDirectory
11
+
12
+    return path.posix.join(assetsSubDirectory, _path)
13
+}
14
+
15
+exports.cssLoaders = function(options) {
16
+    options = options || {}
17
+
18
+    const cssLoader = {
19
+        loader: 'css-loader',
20
+        options: {
21
+            sourceMap: options.sourceMap
22
+        }
23
+    }
24
+
25
+    const postcssLoader = {
26
+        loader: 'postcss-loader',
27
+        options: {
28
+            sourceMap: options.sourceMap
29
+        }
30
+    }
31
+
32
+    // generate loader string to be used with extract text plugin
33
+    function generateLoaders(loader, loaderOptions) {
34
+        const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader]
35
+
36
+        if (loader) {
37
+            loaders.push({
38
+                loader: loader + '-loader',
39
+                options: Object.assign({}, loaderOptions, {
40
+                    sourceMap: options.sourceMap
41
+                })
42
+            })
43
+        }
44
+
45
+        // Extract CSS when that option is specified
46
+        // (which is the case during production build)
47
+        if (options.extract) {
48
+            return ExtractTextPlugin.extract({
49
+                use: loaders,
50
+                publicPath: '../../',
51
+                fallback: 'vue-style-loader'
52
+            })
53
+        } else {
54
+            return ['vue-style-loader'].concat(loaders)
55
+        }
56
+    }
57
+
58
+    // https://vue-loader.vuejs.org/en/configurations/extract-css.html
59
+    return {
60
+        css: generateLoaders(),
61
+        postcss: generateLoaders(),
62
+        less: generateLoaders('less'),
63
+        sass: generateLoaders('sass', { indentedSyntax: true }),
64
+        scss: generateLoaders('sass'),
65
+        stylus: generateLoaders('stylus'),
66
+        styl: generateLoaders('stylus')
67
+    }
68
+}
69
+
70
+// Generate loaders for standalone style files (outside of .vue)
71
+exports.styleLoaders = function(options) {
72
+    const output = []
73
+    const loaders = exports.cssLoaders(options)
74
+
75
+    for (const extension in loaders) {
76
+        const loader = loaders[extension]
77
+        output.push({
78
+            test: new RegExp('\\.' + extension + '$'),
79
+            use: loader
80
+        })
81
+    }
82
+
83
+    return output
84
+}
85
+
86
+exports.createNotifierCallback = () => {
87
+    const notifier = require('node-notifier')
88
+
89
+    return (severity, errors) => {
90
+        if (severity !== 'error') return
91
+
92
+        const error = errors[0]
93
+        const filename = error.file && error.file.split('!').pop()
94
+
95
+        notifier.notify({
96
+            title: packageConfig.name,
97
+            message: severity + ': ' + error.name,
98
+            subtitle: filename || '',
99
+            icon: path.join(__dirname, 'logo.png')
100
+        })
101
+    }
102
+}

+ 22
- 0
build/vue-loader.conf.js ファイルの表示

@@ -0,0 +1,22 @@
1
+'use strict'
2
+const utils = require('./utils')
3
+const config = require('../config')
4
+const isProduction = process.env.NODE_ENV === 'production'
5
+const sourceMapEnabled = isProduction
6
+  ? config.build.productionSourceMap
7
+  : config.dev.cssSourceMap
8
+
9
+module.exports = {
10
+  loaders: utils.cssLoaders({
11
+    sourceMap: sourceMapEnabled,
12
+    extract: isProduction
13
+  }),
14
+  cssSourceMap: sourceMapEnabled,
15
+  cacheBusting: config.dev.cacheBusting,
16
+  transformToRequire: {
17
+    video: ['src', 'poster'],
18
+    source: 'src',
19
+    img: 'src',
20
+    image: 'xlink:href'
21
+  }
22
+}

+ 82
- 0
build/webpack.base.conf.js ファイルの表示

@@ -0,0 +1,82 @@
1
+'use strict'
2
+const path = require('path')
3
+const utils = require('./utils')
4
+const config = require('../config')
5
+const vueLoaderConfig = require('./vue-loader.conf')
6
+
7
+function resolve (dir) {
8
+  return path.join(__dirname, '..', dir)
9
+}
10
+
11
+
12
+
13
+module.exports = {
14
+  context: path.resolve(__dirname, '../'),
15
+  entry: {
16
+    app: './src/main.js'
17
+  },
18
+  output: {
19
+    path: config.build.assetsRoot,
20
+    filename: '[name].js',
21
+    publicPath: process.env.NODE_ENV === 'production'
22
+      ? config.build.assetsPublicPath
23
+      : config.dev.assetsPublicPath
24
+  },
25
+  resolve: {
26
+    extensions: ['.js', '.vue', '.json'],
27
+    alias: {
28
+      'vue$': 'vue/dist/vue.esm.js',
29
+      '@': resolve('src'),
30
+    }
31
+  },
32
+  module: {
33
+    rules: [
34
+      {
35
+        test: /\.vue$/,
36
+        loader: 'vue-loader',
37
+        options: vueLoaderConfig
38
+      },
39
+      {
40
+        test: /\.js$/,
41
+        loader: 'babel-loader',
42
+        include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
43
+      },
44
+      {
45
+        test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
46
+        loader: 'url-loader',
47
+        options: {
48
+          limit: 10000,
49
+          name: utils.assetsPath('img/[name].[hash:7].[ext]')
50
+        }
51
+      },
52
+      {
53
+        test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
54
+        loader: 'url-loader',
55
+        options: {
56
+          limit: 10000,
57
+          name: utils.assetsPath('media/[name].[hash:7].[ext]')
58
+        }
59
+      },
60
+      {
61
+        test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
62
+        loader: 'url-loader',
63
+        options: {
64
+          limit: 10000,
65
+          name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
66
+        }
67
+      }
68
+    ]
69
+  },
70
+  node: {
71
+    // prevent webpack from injecting useless setImmediate polyfill because Vue
72
+    // source contains it (although only uses it if it's native).
73
+    setImmediate: false,
74
+    // prevent webpack from injecting mocks to Node native modules
75
+    // that does not make sense for the client
76
+    dgram: 'empty',
77
+    fs: 'empty',
78
+    net: 'empty',
79
+    tls: 'empty',
80
+    child_process: 'empty'
81
+  }
82
+}

+ 91
- 0
build/webpack.dev.conf.js ファイルの表示

@@ -0,0 +1,91 @@
1
+'use strict'
2
+const utils = require('./utils')
3
+const webpack = require('webpack')
4
+const config = require('../config')
5
+const merge = require('webpack-merge')
6
+const path = require('path')
7
+const baseWebpackConfig = require('./webpack.base.conf')
8
+const CopyWebpackPlugin = require('copy-webpack-plugin')
9
+const HtmlWebpackPlugin = require('html-webpack-plugin')
10
+const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
11
+const portfinder = require('portfinder')
12
+
13
+const HOST = process.env.HOST
14
+const PORT = process.env.PORT && Number(process.env.PORT)
15
+
16
+const devWebpackConfig = merge(baseWebpackConfig, {
17
+    module: {
18
+        rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
19
+    },
20
+    // cheap-module-eval-source-map is faster for development
21
+    devtool: config.dev.devtool,
22
+
23
+    // these devServer options should be customized in /config/index.js
24
+    devServer: {
25
+        clientLogLevel: 'warning',
26
+        historyApiFallback: {
27
+            rewrites: [
28
+                { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
29
+            ],
30
+        },
31
+        hot: true,
32
+        contentBase: false, // since we use CopyWebpackPlugin.
33
+        compress: true,
34
+        host: HOST || config.dev.host,
35
+        port: PORT || config.dev.port,
36
+        open: config.dev.autoOpenBrowser,
37
+        overlay: config.dev.errorOverlay ? { warnings: false, errors: true } : false,
38
+        publicPath: config.dev.assetsPublicPath,
39
+        proxy: config.dev.proxyTable,
40
+        quiet: true, // necessary for FriendlyErrorsPlugin
41
+        watchOptions: {
42
+            poll: config.dev.poll,
43
+        }
44
+    },
45
+    plugins: [
46
+        new webpack.DefinePlugin({
47
+            'process.env': require('../config/dev.env')
48
+        }),
49
+        new webpack.HotModuleReplacementPlugin(),
50
+        new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
51
+        new webpack.NoEmitOnErrorsPlugin(),
52
+        // https://github.com/ampedandwired/html-webpack-plugin
53
+        new HtmlWebpackPlugin({
54
+            filename: 'index.html',
55
+            template: 'index.html',
56
+            inject: true,
57
+            favicon: './favicon.ico'
58
+        }),
59
+        // copy custom static assets
60
+        new CopyWebpackPlugin([{
61
+            from: path.resolve(__dirname, '../static'),
62
+            to: config.dev.assetsSubDirectory,
63
+            ignore: ['.*']
64
+        }])
65
+    ]
66
+})
67
+
68
+module.exports = new Promise((resolve, reject) => {
69
+    portfinder.basePort = process.env.PORT || config.dev.port
70
+    portfinder.getPort((err, port) => {
71
+        if (err) {
72
+            reject(err)
73
+        } else {
74
+            // publish the new Port, necessary for e2e tests
75
+            process.env.PORT = port
76
+                // add port to devServer config
77
+            devWebpackConfig.devServer.port = port
78
+
79
+            // Add FriendlyErrorsPlugin
80
+            devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
81
+                compilationSuccessInfo: {
82
+                    messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
83
+                },
84
+                onErrors: config.dev.notifyOnErrors ?
85
+                    utils.createNotifierCallback() : undefined
86
+            }))
87
+
88
+            resolve(devWebpackConfig)
89
+        }
90
+    })
91
+})

+ 145
- 0
build/webpack.prod.conf.js ファイルの表示

@@ -0,0 +1,145 @@
1
+'use strict'
2
+const path = require('path')
3
+const utils = require('./utils')
4
+const webpack = require('webpack')
5
+const config = require('../config')
6
+const merge = require('webpack-merge')
7
+const baseWebpackConfig = require('./webpack.base.conf')
8
+const CopyWebpackPlugin = require('copy-webpack-plugin')
9
+const HtmlWebpackPlugin = require('html-webpack-plugin')
10
+const ExtractTextPlugin = require('extract-text-webpack-plugin')
11
+const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
12
+const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
13
+
14
+const env = require('../config/prod.env')
15
+
16
+const webpackConfig = merge(baseWebpackConfig, {
17
+  module: {
18
+    rules: utils.styleLoaders({
19
+      sourceMap: config.build.productionSourceMap,
20
+      extract: true,
21
+      usePostCSS: true
22
+    })
23
+  },
24
+  devtool: config.build.productionSourceMap ? config.build.devtool : false,
25
+  output: {
26
+    path: config.build.assetsRoot,
27
+    filename: utils.assetsPath('js/[name].[chunkhash].js'),
28
+    chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
29
+  },
30
+  plugins: [
31
+    // http://vuejs.github.io/vue-loader/en/workflow/production.html
32
+    new webpack.DefinePlugin({
33
+      'process.env': env
34
+    }),
35
+    new UglifyJsPlugin({
36
+      uglifyOptions: {
37
+        compress: {
38
+          warnings: false
39
+        }
40
+      },
41
+      sourceMap: config.build.productionSourceMap,
42
+      parallel: true
43
+    }),
44
+    // extract css into its own file
45
+    new ExtractTextPlugin({
46
+      filename: utils.assetsPath('css/[name].[contenthash].css'),
47
+      // Setting the following option to `false` will not extract CSS from codesplit chunks.
48
+      // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
49
+      // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, 
50
+      // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
51
+      allChunks: true,
52
+    }),
53
+    // Compress extracted CSS. We are using this plugin so that possible
54
+    // duplicated CSS from different components can be deduped.
55
+    new OptimizeCSSPlugin({
56
+      cssProcessorOptions: config.build.productionSourceMap
57
+        ? { safe: true, map: { inline: false } }
58
+        : { safe: true }
59
+    }),
60
+    // generate dist index.html with correct asset hash for caching.
61
+    // you can customize output by editing /index.html
62
+    // see https://github.com/ampedandwired/html-webpack-plugin
63
+    new HtmlWebpackPlugin({
64
+      filename: config.build.index,
65
+      template: 'index.html',
66
+      inject: true,
67
+      minify: {
68
+        removeComments: true,
69
+        collapseWhitespace: true,
70
+        removeAttributeQuotes: true
71
+        // more options:
72
+        // https://github.com/kangax/html-minifier#options-quick-reference
73
+      },
74
+      // necessary to consistently work with multiple chunks via CommonsChunkPlugin
75
+      chunksSortMode: 'dependency'
76
+    }),
77
+    // keep module.id stable when vendor modules does not change
78
+    new webpack.HashedModuleIdsPlugin(),
79
+    // enable scope hoisting
80
+    new webpack.optimize.ModuleConcatenationPlugin(),
81
+    // split vendor js into its own file
82
+    new webpack.optimize.CommonsChunkPlugin({
83
+      name: 'vendor',
84
+      minChunks (module) {
85
+        // any required modules inside node_modules are extracted to vendor
86
+        return (
87
+          module.resource &&
88
+          /\.js$/.test(module.resource) &&
89
+          module.resource.indexOf(
90
+            path.join(__dirname, '../node_modules')
91
+          ) === 0
92
+        )
93
+      }
94
+    }),
95
+    // extract webpack runtime and module manifest to its own file in order to
96
+    // prevent vendor hash from being updated whenever app bundle is updated
97
+    new webpack.optimize.CommonsChunkPlugin({
98
+      name: 'manifest',
99
+      minChunks: Infinity
100
+    }),
101
+    // This instance extracts shared chunks from code splitted chunks and bundles them
102
+    // in a separate chunk, similar to the vendor chunk
103
+    // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
104
+    new webpack.optimize.CommonsChunkPlugin({
105
+      name: 'app',
106
+      async: 'vendor-async',
107
+      children: true,
108
+      minChunks: 3
109
+    }),
110
+
111
+    // copy custom static assets
112
+    new CopyWebpackPlugin([
113
+      {
114
+        from: path.resolve(__dirname, '../static'),
115
+        to: config.build.assetsSubDirectory,
116
+        ignore: ['.*']
117
+      }
118
+    ])
119
+  ]
120
+})
121
+
122
+if (config.build.productionGzip) {
123
+  const CompressionWebpackPlugin = require('compression-webpack-plugin')
124
+
125
+  webpackConfig.plugins.push(
126
+    new CompressionWebpackPlugin({
127
+      asset: '[path].gz[query]',
128
+      algorithm: 'gzip',
129
+      test: new RegExp(
130
+        '\\.(' +
131
+        config.build.productionGzipExtensions.join('|') +
132
+        ')$'
133
+      ),
134
+      threshold: 10240,
135
+      minRatio: 0.8
136
+    })
137
+  )
138
+}
139
+
140
+if (config.build.bundleAnalyzerReport) {
141
+  const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
142
+  webpackConfig.plugins.push(new BundleAnalyzerPlugin())
143
+}
144
+
145
+module.exports = webpackConfig

+ 7
- 0
config/dev.env.js ファイルの表示

@@ -0,0 +1,7 @@
1
+'use strict'
2
+const merge = require('webpack-merge')
3
+const prodEnv = require('./prod.env')
4
+
5
+module.exports = merge(prodEnv, {
6
+  NODE_ENV: '"development"'
7
+})

+ 77
- 0
config/index.js ファイルの表示

@@ -0,0 +1,77 @@
1
+'use strict'
2
+// Template version: 1.3.1
3
+// see http://vuejs-templates.github.io/webpack for documentation.
4
+
5
+const path = require('path')
6
+
7
+module.exports = {
8
+    dev: {
9
+
10
+        // Paths
11
+        assetsSubDirectory: 'static',
12
+        assetsPublicPath: '/',
13
+        proxyTable: {
14
+            '/api': {
15
+                target: 'http://xxx.xxx.xxx.xxx:xxx', // 你请求的第三方接口
16
+                changeOrigin: true, // 在本地会创建一个虚拟服务端,然后发送请求的数据,并同时接收请求的数据,这样服务端和服务端进行数据的交互就不会有跨域问题
17
+                pathRewrite: { // 路径重写,
18
+                    '^/api': '/api' // 替换target中的请求地址,也就是说以后你在请求http://api.jisuapi.com/XXXXX这个地址的时候直接写成/api即可。
19
+                }
20
+            }
21
+        },
22
+
23
+        // Various Dev Server settings
24
+        host: 'localhost', // can be overwritten by process.env.HOST
25
+        port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
26
+        autoOpenBrowser: true,
27
+        errorOverlay: true,
28
+        notifyOnErrors: true,
29
+        poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
30
+
31
+
32
+        /**
33
+         * Source Maps
34
+         */
35
+
36
+        // https://webpack.js.org/configuration/devtool/#development
37
+        devtool: 'cheap-module-eval-source-map',
38
+
39
+        // If you have problems debugging vue-files in devtools,
40
+        // set this to false - it *may* help
41
+        // https://vue-loader.vuejs.org/en/options.html#cachebusting
42
+        cacheBusting: true,
43
+
44
+        cssSourceMap: true
45
+    },
46
+
47
+    build: {
48
+        // Template for index.html
49
+        index: path.resolve(__dirname, '../dist/index.html'),
50
+
51
+        // Paths
52
+        assetsRoot: path.resolve(__dirname, '../dist'),
53
+        assetsSubDirectory: 'static',
54
+        assetsPublicPath: './',
55
+
56
+        /**
57
+         * Source Maps
58
+         */
59
+
60
+        productionSourceMap: true,
61
+        // https://webpack.js.org/configuration/devtool/#production
62
+        devtool: '#source-map',
63
+
64
+        // Gzip off by default as many popular static hosts such as
65
+        // Surge or Netlify already gzip all static assets for you.
66
+        // Before setting to `true`, make sure to:
67
+        // npm install --save-dev compression-webpack-plugin
68
+        productionGzip: false,
69
+        productionGzipExtensions: ['js', 'css'],
70
+
71
+        // Run the build command with an extra argument to
72
+        // View the bundle analyzer report after build finishes:
73
+        // `npm run build --report`
74
+        // Set to `true` or `false` to always turn it on or off
75
+        bundleAnalyzerReport: process.env.npm_config_report
76
+    }
77
+}

+ 4
- 0
config/prod.env.js ファイルの表示

@@ -0,0 +1,4 @@
1
+'use strict'
2
+module.exports = {
3
+  NODE_ENV: '"production"'
4
+}

+ 48
- 0
eslintrc.js ファイルの表示

@@ -0,0 +1,48 @@
1
+{
2
+    "editor.tabSize": 2,
3
+    "files.associations": {
4
+        "*.vue": "vue"
5
+    },
6
+    "eslint.autoFixOnSave": true,
7
+    "eslint.options": {
8
+        "extensions": [
9
+            ".js",
10
+            ".vue"
11
+        ]
12
+    },
13
+    "eslint.validate": [
14
+        "javascript",
15
+        "javascriptreact",
16
+        "vue",
17
+        "vue-html"
18
+    ],
19
+    "search.exclude": {
20
+        "**/node_modules": true,
21
+        "**/bower_components": true,
22
+        "**/dist": true
23
+    },
24
+    "emmet.syntaxProfiles": {
25
+        "javascript": "jsx",
26
+        "vue": "html",
27
+        "vue-html": "html"
28
+    },
29
+    "git.confirmSync": false,
30
+    "window.zoomLevel": 0,
31
+    "vsicons.projectDetection.autoReload": true,
32
+    "typescript.check.tscVersion": false,
33
+    "editor.renderWhitespace": "boundary",
34
+    "editor.cursorBlinking": "smooth",
35
+    "workbench.colorTheme": "Solarized Light",
36
+    "workbench.iconTheme": "vscode-great-icons",
37
+    "editor.minimap.enabled": true,
38
+    "editor.minimap.renderCharacters": false,
39
+    "tslint.autoFixOnSave": true,
40
+    "editor.fontFamily": "'Droid Sans Mono', 'Courier New', monospace, 'Droid Sans Fallback'",
41
+    "beautify.tabSize": 2,
42
+    "window.title": "${dirty}${activeEditorMedium}${separator}${rootName}",
43
+    "typescript.extension.sortImports.maxNamedImportsInSingleLine": 5,
44
+    "typescript.extension.sortImports.omitSemicolon": true,
45
+    "editor.codeLens": true,
46
+    "editor.snippetSuggestions": "top",
47
+    "react-native-storybooks.port": 6006
48
+}

バイナリ
favicon.ico ファイルの表示


+ 17
- 0
index.html ファイルの表示

@@ -0,0 +1,17 @@
1
+<!DOCTYPE html>
2
+<html>
3
+
4
+<head>
5
+    <meta charset="utf-8">
6
+    <meta name="viewport" content="width=device-width,initial-scale=1.0">
7
+    <!-- 页面增加icon图标 -->
8
+    <link rel="shortcut icon" type="image/x-icon" href="./favicon.ico" rel="external nofollow" />
9
+    <title>后端管理平台</title>
10
+</head>
11
+
12
+<body>
13
+    <!-- built files will be auto injected -->
14
+    <div id="app"></div>
15
+</body>
16
+
17
+</html>

+ 12135
- 0
package-lock.json
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 68
- 0
package.json ファイルの表示

@@ -0,0 +1,68 @@
1
+{
2
+  "name": "vue-ele-project",
3
+  "version": "1.0.0",
4
+  "description": "vue-ele-project",
5
+  "author": "lidonghui",
6
+  "private": true,
7
+  "scripts": {
8
+    "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
9
+    "start": "npm run dev",
10
+    "build": "node build/build.js"
11
+  },
12
+  "dependencies": {
13
+    "echarts": "^4.2.0-rc.2",
14
+    "element-ui": "^2.3.2",
15
+    "http-proxy-middleware": "^0.18.0",
16
+    "js-md5": "^0.7.3",
17
+    "vue": "^2.5.2",
18
+    "vue-router": "^3.0.1",
19
+    "vuex": "^3.0.1"
20
+  },
21
+  "devDependencies": {
22
+    "autoprefixer": "^7.1.2",
23
+    "axios": "^0.18.0",
24
+    "babel-core": "^6.22.1",
25
+    "babel-helper-vue-jsx-merge-props": "^2.0.3",
26
+    "babel-loader": "^7.1.1",
27
+    "babel-plugin-syntax-jsx": "^6.18.0",
28
+    "babel-plugin-transform-runtime": "^6.22.0",
29
+    "babel-plugin-transform-vue-jsx": "^3.5.0",
30
+    "babel-preset-env": "^1.3.2",
31
+    "babel-preset-stage-2": "^6.22.0",
32
+    "chalk": "^2.0.1",
33
+    "copy-webpack-plugin": "^4.0.1",
34
+    "css-loader": "^0.28.0",
35
+    "extract-text-webpack-plugin": "^3.0.0",
36
+    "file-loader": "^1.1.4",
37
+    "friendly-errors-webpack-plugin": "^1.6.1",
38
+    "html-webpack-plugin": "^2.30.1",
39
+    "node-notifier": "^5.1.2",
40
+    "optimize-css-assets-webpack-plugin": "^3.2.0",
41
+    "ora": "^1.2.0",
42
+    "portfinder": "^1.0.13",
43
+    "postcss-import": "^11.0.0",
44
+    "postcss-loader": "^2.0.8",
45
+    "postcss-url": "^7.2.1",
46
+    "rimraf": "^2.6.0",
47
+    "semver": "^5.3.0",
48
+    "shelljs": "^0.7.6",
49
+    "uglifyjs-webpack-plugin": "^1.1.1",
50
+    "url-loader": "^0.5.8",
51
+    "vue-loader": "^13.3.0",
52
+    "vue-style-loader": "^3.0.1",
53
+    "vue-template-compiler": "^2.5.2",
54
+    "webpack": "^3.6.0",
55
+    "webpack-bundle-analyzer": "^2.9.0",
56
+    "webpack-dev-server": "^2.9.1",
57
+    "webpack-merge": "^4.1.0"
58
+  },
59
+  "engines": {
60
+    "node": ">= 6.0.0",
61
+    "npm": ">= 3.0.0"
62
+  },
63
+  "browserslist": [
64
+    "> 1%",
65
+    "last 2 versions",
66
+    "not ie <= 8"
67
+  ]
68
+}

+ 1
- 0
project/index.html ファイルの表示

@@ -0,0 +1 @@
1
+<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel="shortcut icon" type=image/x-icon href=./favicon.ico rel="external nofollow"><title>后端管理平台</title><link href=./static/css/app.f7de60d9ec9c07c112d0b94c59208a0e.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.e37fbe972401a2962be8.js></script><script type=text/javascript src=./static/js/app.656e0752769862c0c376.js></script></body></html>

+ 2
- 0
project/static/css/app.f7de60d9ec9c07c112d0b94c59208a0e.css
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 1
- 0
project/static/css/app.f7de60d9ec9c07c112d0b94c59208a0e.css.map
ファイル差分が大きすぎるため省略します
ファイルの表示


バイナリ
project/static/fonts/element-icons.6f0a763.ttf ファイルの表示


バイナリ
project/static/fonts/iconfont.4f4ba31.eot ファイルの表示


バイナリ
project/static/fonts/iconfont.9a8d1b2.ttf ファイルの表示


バイナリ
project/static/gif.gif ファイルの表示


+ 96
- 0
project/static/img/iconfont.df0dca9.svg
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 2
- 0
project/static/js/app.656e0752769862c0c376.js
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 1
- 0
project/static/js/app.656e0752769862c0c376.js.map
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 2
- 0
project/static/js/manifest.3ad1d5771e9b13dbdad2.js ファイルの表示

@@ -0,0 +1,2 @@
1
+!function(r){var n=window.webpackJsonp;window.webpackJsonp=function(e,u,c){for(var f,i,p,a=0,l=[];a<e.length;a++)i=e[a],o[i]&&l.push(o[i][0]),o[i]=0;for(f in u)Object.prototype.hasOwnProperty.call(u,f)&&(r[f]=u[f]);for(n&&n(e,u,c);l.length;)l.shift()();if(c)for(a=0;a<c.length;a++)p=t(t.s=c[a]);return p};var e={},o={2:0};function t(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return r[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=r,t.c=e,t.d=function(r,n,e){t.o(r,n)||Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:e})},t.n=function(r){var n=r&&r.__esModule?function(){return r.default}:function(){return r};return t.d(n,"a",n),n},t.o=function(r,n){return Object.prototype.hasOwnProperty.call(r,n)},t.p="./",t.oe=function(r){throw console.error(r),r}}([]);
2
+//# sourceMappingURL=manifest.3ad1d5771e9b13dbdad2.js.map

+ 1
- 0
project/static/js/manifest.3ad1d5771e9b13dbdad2.js.map ファイルの表示

@@ -0,0 +1 @@
1
+{"version":3,"sources":["webpack:///webpack/bootstrap 2339051ff345deb5e9a9"],"names":["parentJsonpFunction","window","chunkIds","moreModules","executeModules","moduleId","chunkId","result","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","shift","__webpack_require__","s","installedModules","2","exports","module","l","m","c","d","name","getter","o","defineProperty","configurable","enumerable","get","n","__esModule","object","property","p","oe","err","console","error"],"mappings":"aACA,IAAAA,EAAAC,OAAA,aACAA,OAAA,sBAAAC,EAAAC,EAAAC,GAIA,IADA,IAAAC,EAAAC,EAAAC,EAAAC,EAAA,EAAAC,KACQD,EAAAN,EAAAQ,OAAoBF,IAC5BF,EAAAJ,EAAAM,GACAG,EAAAL,IACAG,EAAAG,KAAAD,EAAAL,GAAA,IAEAK,EAAAL,GAAA,EAEA,IAAAD,KAAAF,EACAU,OAAAC,UAAAC,eAAAC,KAAAb,EAAAE,KACAY,EAAAZ,GAAAF,EAAAE,IAIA,IADAL,KAAAE,EAAAC,EAAAC,GACAK,EAAAC,QACAD,EAAAS,OAAAT,GAEA,GAAAL,EACA,IAAAI,EAAA,EAAYA,EAAAJ,EAAAM,OAA2BF,IACvCD,EAAAY,IAAAC,EAAAhB,EAAAI,IAGA,OAAAD,GAIA,IAAAc,KAGAV,GACAW,EAAA,GAIA,SAAAH,EAAAd,GAGA,GAAAgB,EAAAhB,GACA,OAAAgB,EAAAhB,GAAAkB,QAGA,IAAAC,EAAAH,EAAAhB,IACAG,EAAAH,EACAoB,GAAA,EACAF,YAUA,OANAN,EAAAZ,GAAAW,KAAAQ,EAAAD,QAAAC,IAAAD,QAAAJ,GAGAK,EAAAC,GAAA,EAGAD,EAAAD,QAKAJ,EAAAO,EAAAT,EAGAE,EAAAQ,EAAAN,EAGAF,EAAAS,EAAA,SAAAL,EAAAM,EAAAC,GACAX,EAAAY,EAAAR,EAAAM,IACAhB,OAAAmB,eAAAT,EAAAM,GACAI,cAAA,EACAC,YAAA,EACAC,IAAAL,KAMAX,EAAAiB,EAAA,SAAAZ,GACA,IAAAM,EAAAN,KAAAa,WACA,WAA2B,OAAAb,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAL,EAAAS,EAAAE,EAAA,IAAAA,GACAA,GAIAX,EAAAY,EAAA,SAAAO,EAAAC,GAAsD,OAAA1B,OAAAC,UAAAC,eAAAC,KAAAsB,EAAAC,IAGtDpB,EAAAqB,EAAA,KAGArB,EAAAsB,GAAA,SAAAC,GAA8D,MAApBC,QAAAC,MAAAF,GAAoBA","file":"static/js/manifest.3ad1d5771e9b13dbdad2.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t2: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"./\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 2339051ff345deb5e9a9"],"sourceRoot":""}

+ 58
- 0
project/static/js/vendor.e37fbe972401a2962be8.js
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 1
- 0
project/static/js/vendor.e37fbe972401a2962be8.js.map
ファイル差分が大きすぎるため省略します
ファイルの表示


バイナリ
project/static/交易订单.png ファイルの表示


バイナリ
project/static/商品管理.png ファイルの表示


バイナリ
project/static/展开与压缩.png ファイルの表示


バイナリ
project/static/支付配置.png ファイルの表示


バイナリ
project/static/用户管理.png ファイルの表示


バイナリ
project/static/登录.png ファイルの表示


バイナリ
project/static/编辑.png ファイルの表示


バイナリ
project/static/角色管理.png ファイルの表示


+ 30
- 0
src/App.vue ファイルの表示

@@ -0,0 +1,30 @@
1
+<template>
2
+  <div id="app">
3
+    <router-view/>
4
+  </div>
5
+</template>
6
+
7
+<script>
8
+export default {
9
+    name: "App"
10
+};
11
+</script>
12
+
13
+<style> 
14
+html,
15
+body {
16
+    width: 100%;
17
+    height: 100%;
18
+    box-sizing: border-box;
19
+    padding: 0px;
20
+    margin: 0px;
21
+}
22
+#app {
23
+    font-family: "Avenir", Helvetica, Arial, sans-serif;
24
+    -webkit-font-smoothing: antialiased;
25
+    -moz-osx-font-smoothing: grayscale;
26
+    color: #2c3e50;
27
+    widows: 100%;
28
+    height: 100%;
29
+}
30
+</style>

+ 58
- 0
src/api/axiosFun.js ファイルの表示

@@ -0,0 +1,58 @@
1
+import axios from 'axios';
2
+
3
+// 登录请求方法
4
+const loginreq = (method, url, params) => {
5
+    return axios({
6
+        method: method,
7
+        url: url,
8
+        headers: {
9
+            'Content-Type': 'application/x-www-form-urlencoded',
10
+        },
11
+        data: params,
12
+        traditional: true,
13
+        transformRequest: [
14
+            function(data) {
15
+                let ret = ''
16
+                for (let it in data) {
17
+                    ret +=
18
+                        encodeURIComponent(it) +
19
+                        '=' +
20
+                        encodeURIComponent(data[it]) +
21
+                        '&'
22
+                }
23
+                return ret
24
+            }
25
+        ]
26
+    }).then(res => res.data);
27
+};
28
+// 通用公用方法
29
+const req = (method, url, params) => {
30
+    return axios({
31
+        method: method,
32
+        url: url,
33
+        headers: {
34
+            'Content-Type': 'application/x-www-form-urlencoded',
35
+            token: localStorage.getItem('logintoken')
36
+        },
37
+        data: params,
38
+        traditional: true,
39
+        transformRequest: [
40
+            function(data) {
41
+                let ret = ''
42
+                for (let it in data) {
43
+                    ret +=
44
+                        encodeURIComponent(it) +
45
+                        '=' +
46
+                        encodeURIComponent(data[it]) +
47
+                        '&'
48
+                }
49
+                return ret
50
+            }
51
+        ]
52
+    }).then(res => res.data);
53
+};
54
+
55
+export {
56
+    loginreq,
57
+    req
58
+}

+ 32
- 0
src/api/basisMG.js ファイルの表示

@@ -0,0 +1,32 @@
1
+import axios from 'axios';
2
+import { req } from './axiosFun';
3
+
4
+/**
5
+ * 商品管理
6
+ **/
7
+// 商品管理-获取商品管理列表
8
+export const GoodsList = (params) => { return req("post", "/api/Goods/list", params) };
9
+// 商品管理-保存商品管理
10
+export const GoodsSave = (params) => { return req("post", "/api/Goods/save", params) };
11
+// 商品管理-删除商品管理
12
+export const GoodsDelete = (params) => { return axios.delete("/api/Goods/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
13
+
14
+/**
15
+ * 机器信息管理 
16
+ **/
17
+// 机器信息管理-获取机器信息管理列表
18
+export const MachineList = (params) => { return req("post", "/api/Machine/list", params) };
19
+// 机器信息管理-保存机器信息管理
20
+export const MachineSave = (params) => { return req("post", "/api/Machine/save", params) };
21
+// 机器信息管理-删除机器信息管理
22
+export const MachineDelete = (params) => { return axios.delete("/api/Machine/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
23
+
24
+/**
25
+ * 货道信息管理
26
+ **/
27
+// 货道信息管理-获取获取货道信息管理列表
28
+export const MachineAisleList = (params) => { return req("post", "/api/MachineAisle/list", params) };
29
+// 货道信息管理-删除货道信息管理
30
+export const MachineAisleDelete = (params) => { return axios.delete("/api/MachineAisle/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
31
+// 货道信息管理-保存货道信息管理
32
+export const MachineAisleRsave = (params) => { return req("post", "/api/MachineAisle/save", params) };

+ 32
- 0
src/api/payMG.js ファイルの表示

@@ -0,0 +1,32 @@
1
+import axios from 'axios';
2
+import { req } from './axiosFun';
3
+
4
+/**
5
+ * 支付配置信息
6
+ **/
7
+// 支付配置信息-获取支付配置信息列表
8
+export const MachineConfigList = (params) => { return req("post", "/api/MachineConfig/list", params) };
9
+// 支付配置信息-保存支付配置信息
10
+export const MachineConfigSave = (params) => { return req("post", "/api/MachineConfig/save", params) };
11
+// 支付配置信息-删除支付配置信息
12
+export const MachineConfigDelete = (params) => { return axios.delete("/api/MachineConfig/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
13
+
14
+/**
15
+ * 支付配置 
16
+ **/
17
+// 支付配置-获取支付配置列表
18
+export const ConfigList = (params) => { return req("post", "/api/Config/list", params) };
19
+// 支付配置-保存支付配置
20
+export const ConfigSave = (params) => { return req("post", "/api/Config/save", params) };
21
+// 支付配置-删除支付配置
22
+export const ConfigDelete = (params) => { return axios.delete("/api/Config/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
23
+
24
+/**
25
+ * 订单管理-交易订单 
26
+ **/
27
+// 交易订单-获取交易订单列表
28
+export const OrderList = (params) => { return req("post", "/api/Order/list", params) };
29
+// 交易订单-s删除交易订单
30
+export const OrderDelete = (params) => { return axios.delete("/api/Order/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
31
+// 交易订单-交易订单退款
32
+export const OrderRefund = (params) => { return req("post", "/api/Order/refund", params) };

+ 97
- 0
src/api/userMG.js ファイルの表示

@@ -0,0 +1,97 @@
1
+import axios from 'axios';
2
+import { loginreq, req } from './axiosFun';
3
+
4
+// 登录接口 
5
+export const login = (params) => { return loginreq("post", "/api/login", params) };
6
+// 获取用户菜单
7
+export const menu = (params) => { return axios.get("/api/menu?&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
8
+// 退出接口
9
+export const loginout = () => { return axios.delete("/api/login?&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
10
+
11
+/**
12
+ * 用户管理 
13
+ **/
14
+// 用户管理-获取用户列表
15
+export const userList = (params) => { return req("post", "/api/User/list", params) };
16
+// 用户管理-保存(添加编辑)
17
+export const userSave = (params) => { return req("post", "/api/User/save", params) };
18
+// 用户管理-删除用户
19
+export const userDelete = (params) => { return axios.delete("/api/User/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
20
+// 用户管理-重置密码
21
+export const userPwd = (params) => { return req("post", "/api/User/pwd", params) };
22
+// 用户管理-修改状态
23
+export const userLock = (params) => { return axios.get("/api/User/lock?userId=" + params.userId + "&lock=" + params.lock + "&token=" + localStorage.getItem('logintoken')) };
24
+// 用户管理-数据权限
25
+export const UserDeptTree = (params) => { return axios.get("/api/UserDept/tree/" + params + "?token=" + localStorage.getItem('logintoken')) };
26
+// 用户管理-数据权限保存
27
+export const UserDeptSave = (params) => { return req("post", "/api/UserDept/save", params) };
28
+// 用户管理-获取部门设置
29
+export const UserDeptdeptTree = (params) => { return axios.get("/api/UserDept/deptTree/" + params + "?token=" + localStorage.getItem('logintoken')) };
30
+// 用户管理-保存部门设置
31
+export const UserChangeDept = (params) => { return req("post", "/api/User/change/dept", params) };
32
+// 用户管理-用户下线
33
+export const userExpireToken = (params) => { return req("get", "/api/User/expireToken/" + params, {}) };
34
+// 用户管理-刷新缓存
35
+export const userFlashCache = (params) => { return req("get", "/api/User/flashCache/" + params, {}) };
36
+
37
+/**
38
+ * 菜单管理
39
+ **/
40
+// 菜单管理-获取菜单Module/list
41
+export const ModuleList = () => { return req("post", "/api/Module/list") };
42
+// 菜单管理-根据菜单获取数据
43
+export const ModuleGet = (params) => { return axios.get("/api/Module/get/" + params + "?token=" + localStorage.getItem('logintoken')) };
44
+// 菜单管理-获取父级菜单Module/nodes
45
+export const ModuleNodes = (params) => { return req("post", "/api/Module/nodes", params) };
46
+// 菜单管理-修改菜单
47
+export const ModuleSave = (params) => { return req("post", "/api/Module/save", params) };
48
+// 菜单管理-删除菜单
49
+export const ModuleDelete = (params) => { return axios.delete("/api/Module/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
50
+
51
+/**
52
+ * 角色管理 
53
+ **/
54
+// 角色管理-获取角色列表
55
+export const roleList = (params) => { return req("post", "/api/Role/list", params) };
56
+// 角色管理-保存(添加编辑)
57
+export const roleSave = (params) => { return req("post", "/api/Role/save", params) };
58
+// 角色管理-删除角色
59
+export const roleDelete = (params) => { return axios.delete("/api/Role/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
60
+// 角色管理-菜单权限(获取)
61
+export const RoleRightTree = (params) => { return axios.get("/api/RoleRight/tree/" + params + "?token=" + localStorage.getItem('logintoken')) };
62
+// 角色管理-菜单权限(保存)
63
+export const RoleRightSave = (params) => { return req("post", "/api/RoleRight/save", params) };
64
+
65
+/**
66
+ * 公司管理 
67
+ **/
68
+// 公司管理-获取公司列表
69
+export const deptList = (params) => { return req("post", "/api/Dept/list", params) };
70
+// 公司管理-保存(添加编辑)
71
+export const deptSave = (params) => { return req("post", "/api/Dept/save", params) };
72
+// 公司管理-删除公司
73
+export const deptDelete = (params) => { return axios.get("/api/Dept/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
74
+
75
+/**
76
+ * 系统环境变量 
77
+ **/
78
+// 系统环境变量-获取系统环境变量列表
79
+export const variableList = (params) => { return req("post", "/api/Variable/list", params) };
80
+// 系统环境变量-保存(添加编辑)
81
+export const variableSave = (params) => { return req("post", "/api/Variable/save", params) };
82
+// 系统环境变量-删除系统环境变量
83
+export const variableDelete = (params) => { return axios.delete("/api/Variable/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
84
+
85
+/**
86
+ * 权限管理 
87
+ **/
88
+// 权限管理-获取权限列表
89
+export const permissionList = (params) => { return req("post", "/api/Permission/list", params) };
90
+// 权限管理-保存权限
91
+export const ermissionSave = (params) => { return req("post", "/api/Permission/save", params) };
92
+// 权限管理-删除权限
93
+export const ermissionDelete = (params) => { return axios.delete("/api/Permission/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
94
+// 权限管理-获取权限
95
+export const roleDropDown = () => { return axios.get("/api/Role/dropDown/all?&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
96
+// 权限管理-配置权限
97
+export const RolePermission = (params) => { return req("post", "/api/RolePermission/save", params) };

+ 101
- 0
src/assets/icon/iconfont.css
ファイル差分が大きすぎるため省略します
ファイルの表示


バイナリ
src/assets/icon/iconfont.eot ファイルの表示


+ 96
- 0
src/assets/icon/iconfont.svg
ファイル差分が大きすぎるため省略します
ファイルの表示


バイナリ
src/assets/icon/iconfont.ttf ファイルの表示


バイナリ
src/assets/icon/iconfont.woff ファイルの表示


バイナリ
src/assets/img/bg.png ファイルの表示


バイナリ
src/assets/img/logo.png ファイルの表示


バイナリ
src/assets/img/show.png ファイルの表示


バイナリ
src/assets/img/sq.png ファイルの表示


+ 48
- 0
src/components/Pagination.vue ファイルの表示

@@ -0,0 +1,48 @@
1
+/**
2
+* 分页组件
3
+*/ 
4
+<template>
5
+  <el-pagination class="page-box" @size-change="handleSizeChange" @current-change="handleCurrentChange" background :current-page="childMsg.currentPage" :page-sizes="[10, 20, 30, 40]" :page-size="childMsg.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="childMsg.total">
6
+  </el-pagination>
7
+</template>
8
+<script>
9
+export default {
10
+  name: 'Pagination',
11
+  props: ['childMsg'],
12
+  data() {
13
+    return {
14
+      pageparm: {
15
+        currentPage: this.childMsg.currentPage,
16
+        pageSize: this.childMsg.pageSize
17
+      }
18
+    }
19
+  },
20
+  created() {},
21
+  methods: {
22
+    handleSizeChange(val) {
23
+      /**
24
+       * 子传父
25
+       * 参数1 父元素方法
26
+       * 参数2 数据
27
+       */
28
+      this.pageparm.pageSize = val
29
+      this.$emit('callFather', this.pageparm)
30
+    },
31
+    handleCurrentChange(val) {
32
+      /**
33
+       * 子传父
34
+       * 参数1 父元素方法
35
+       * 参数2 数据
36
+       */
37
+      this.pageparm.currentPage = val
38
+      this.$emit('callFather', this.pageparm)
39
+    }
40
+  }
41
+}
42
+</script>
43
+
44
+<style>
45
+.page-box {
46
+  margin: 10px auto;
47
+}
48
+</style>

+ 26
- 0
src/components/error.vue ファイルの表示

@@ -0,0 +1,26 @@
1
+/**
2
+* 404
3
+*/ 
4
+<template>
5
+  <div class="page-404">
6
+    <h1>404!</h1>
7
+    <h2>Sorry, page not found</h2>
8
+  </div>
9
+</template>
10
+
11
+<style scoped>
12
+.page-404 {
13
+  text-align: center;
14
+}
15
+.page-404 h1 {
16
+  font-size: 98px;
17
+  font-weight: 700;
18
+  line-height: 150px;
19
+  text-shadow: rgba(61, 61, 61, 0.3) 1px 1px, rgba(61, 61, 61, 0.2) 2px 2px,
20
+    rgba(61, 61, 61, 0.3) 3px 3px;
21
+}
22
+.page-404 h2 {
23
+  line-height: 30px;
24
+  font-size: 30px;
25
+}
26
+</style>

+ 226
- 0
src/components/leftnav.vue ファイルの表示

@@ -0,0 +1,226 @@
1
+/**
2
+* 左边菜单
3
+*/ 
4
+<template>
5
+  <el-menu default-active="2" :collapse="collapsed" collapse-transition router :default-active="$route.path" unique-opened class="el-menu-vertical-demo" background-color="#334157" text-color="#fff" active-text-color="#ffd04b">
6
+    <div class="logobox">
7
+      <img class="logoimg" src="../assets/img/logo.png" alt="">
8
+    </div>
9
+    <el-submenu v-for="menu in allmenu" :key="menu.menuid" :index="menu.menuname">
10
+      <template slot="title">
11
+        <i class="iconfont" :class="menu.icon"></i>
12
+        <span>{{menu.menuname}}</span>
13
+      </template>
14
+      <el-menu-item-group>
15
+        <el-menu-item v-for="chmenu in menu.menus" :index="'/'+chmenu.url" :key="chmenu.menuid">
16
+          <i class="iconfont" :class="chmenu.icon"></i>
17
+          <span>{{chmenu.menuname}}</span>
18
+        </el-menu-item>
19
+      </el-menu-item-group>
20
+    </el-submenu>
21
+  </el-menu>
22
+</template>
23
+<script>
24
+import { menu } from '../api/userMG'
25
+export default {
26
+  name: 'leftnav',
27
+  data() {
28
+    return {
29
+      collapsed: false,
30
+      allmenu: []
31
+    }
32
+  },
33
+  // 创建完毕状态(里面是操作)
34
+  created() {
35
+    // 获取图形验证码
36
+    let res = {
37
+      success: true,
38
+      data: [
39
+        {
40
+          menuid: 1,
41
+          icon: 'li-icon-xiangmuguanli',
42
+          menuname: '基础管理',
43
+          hasThird: null,
44
+          url: null,
45
+          menus: [
46
+            {
47
+              menuid: 2,
48
+              icon: 'icon-cat-skuQuery',
49
+              menuname: '商品管理',
50
+              hasThird: 'N',
51
+              url: 'goods/Goods',
52
+              menus: null
53
+            }
54
+          ]
55
+        },
56
+        {
57
+          menuid: 33,
58
+          icon: 'li-icon-dingdanguanli',
59
+          menuname: '订单管理',
60
+          hasThird: null,
61
+          url: null,
62
+          menus: [
63
+            {
64
+              menuid: 34,
65
+              icon: 'icon-order-manage',
66
+              menuname: '交易订单',
67
+              hasThird: 'N',
68
+              url: 'pay/Order',
69
+              menus: null
70
+            }
71
+          ]
72
+        },
73
+        {
74
+          menuid: 71,
75
+          icon: 'li-icon-xitongguanli',
76
+          menuname: '系统管理',
77
+          hasThird: null,
78
+          url: null,
79
+          menus: [
80
+            {
81
+              menuid: 72,
82
+              icon: 'icon-cus-manage',
83
+              menuname: '用户管理',
84
+              hasThird: 'N',
85
+              url: 'system/user',
86
+              menus: null
87
+            },
88
+            {
89
+              menuid: 174,
90
+              icon: 'icon-cms-manage',
91
+              menuname: '菜单管理',
92
+              hasThird: 'N',
93
+              url: 'system/Module',
94
+              menus: null
95
+            },
96
+            {
97
+              menuid: 73,
98
+              icon: 'icon-news-manage',
99
+              menuname: '角色管理',
100
+              hasThird: 'N',
101
+              url: 'system/Role',
102
+              menus: null
103
+            },
104
+            {
105
+              menuid: 74,
106
+              icon: 'icon-cs-manage',
107
+              menuname: '公司管理',
108
+              hasThird: 'N',
109
+              url: 'system/Dept',
110
+              menus: null
111
+            },
112
+            {
113
+              menuid: 75,
114
+              icon: 'icon-promotion-manage',
115
+              menuname: '系统环境变量',
116
+              hasThird: 'N',
117
+              url: 'system/Variable',
118
+              menus: null
119
+            },
120
+            {
121
+              menuid: 76,
122
+              icon: 'icon-cms-manage',
123
+              menuname: '权限管理',
124
+              hasThird: 'N',
125
+              url: 'system/Permission',
126
+              menus: null
127
+            }
128
+          ]
129
+        },
130
+        {
131
+          menuid: 128,
132
+          icon: 'li-icon-shangchengxitongtubiaozitihuayuanwenjian91',
133
+          menuname: '支付管理',
134
+          hasThird: null,
135
+          url: null,
136
+          menus: [
137
+            {
138
+              menuid: 129,
139
+              icon: 'icon-provider-manage',
140
+              menuname: '支付配置信息',
141
+              hasThird: 'N',
142
+              url: 'machine/MachineConfig',
143
+              menus: null
144
+            },
145
+            {
146
+              menuid: 175,
147
+              icon: 'icon-provider-manage',
148
+              menuname: '支付配置',
149
+              hasThird: 'N',
150
+              url: 'pay/Config',
151
+              menus: null
152
+            }
153
+          ]
154
+        },
155
+        {
156
+          menuid: 150,
157
+          icon: 'li-icon-shangchengxitongtubiaozitihuayuanwenjian91',
158
+          menuname: '图表',
159
+          hasThird: null,
160
+          url: null,
161
+          menus: [
162
+            {
163
+              menuid: 159,
164
+              icon: 'icon-provider-manage',
165
+              menuname: '数据可视化',
166
+              hasThird: 'N',
167
+              url: 'charts/statistics',
168
+              menus: null
169
+            }
170
+          ]
171
+        }
172
+      ],
173
+      msg: 'success'
174
+    }
175
+          this.allmenu = res.data
176
+    
177
+    // menu(localStorage.getItem('logintoken'))
178
+    //   .then(res => {
179
+    //     console.log(JSON.stringify(res))
180
+    //     if (res.success) {
181
+    //       this.allmenu = res.data
182
+    //     } else {
183
+    //       this.$message.error(res.msg)
184
+    //       return false
185
+    //     }
186
+    //   })
187
+    //   .catch(err => {
188
+    //     this.$message.error('菜单加载失败,请稍后再试!')
189
+    //   })
190
+    // 监听
191
+    this.$root.Bus.$on('toggle', value => {
192
+      this.collapsed = !value
193
+    })
194
+  }
195
+}
196
+</script>
197
+<style>
198
+.el-menu-vertical-demo:not(.el-menu--collapse) {
199
+  width: 240px;
200
+  min-height: 400px;
201
+}
202
+.el-menu-vertical-demo:not(.el-menu--collapse) {
203
+  border: none;
204
+  text-align: left;
205
+}
206
+.el-menu-item-group__title {
207
+  padding: 0px;
208
+}
209
+.el-menu-bg {
210
+  background-color: #1f2d3d !important;
211
+}
212
+.el-menu {
213
+  border: none;
214
+}
215
+.logobox {
216
+  height: 40px;
217
+  line-height: 40px;
218
+  color: #9d9d9d;
219
+  font-size: 20px;
220
+  text-align: center;
221
+  padding: 20px 0px;
222
+}
223
+.logoimg {
224
+  height: 40px;
225
+}
226
+</style>

+ 113
- 0
src/components/navcon.vue ファイルの表示

@@ -0,0 +1,113 @@
1
+/**
2
+* 头部菜单
3
+*/ 
4
+<template>
5
+  <el-menu class="el-menu-demo" mode="horizontal" background-color="#334157" text-color="#fff" active-text-color="#fff">
6
+    <el-button class="buttonimg">
7
+      <img class="showimg" :src="collapsed?imgsq:imgshow" @click="toggle(collapsed)">
8
+    </el-button>
9
+    <el-submenu index="2" class="submenu">
10
+      <!-- <template slot="title">{{user.userRealName}}</template> -->
11
+      <template slot="title">超级管理员</template>
12
+      <el-menu-item index="2-1">设置</el-menu-item>
13
+      <el-menu-item @click="content()" index="2-2">个人中心</el-menu-item>
14
+      <el-menu-item @click="exit()" index="2-3">退出</el-menu-item>
15
+    </el-submenu>
16
+  </el-menu>
17
+</template>
18
+<script>
19
+import { loginout } from '../api/userMG'
20
+export default {
21
+  name: 'navcon',
22
+  data() {
23
+    return {
24
+      collapsed: true,
25
+      imgshow: require('../assets/img/show.png'),
26
+      imgsq: require('../assets/img/sq.png'),
27
+      user: {}
28
+    }
29
+  },
30
+  // 创建完毕状态(里面是操作)
31
+  created() {
32
+    this.user = JSON.parse(localStorage.getItem('userdata'))
33
+  },
34
+  methods: {
35
+    // 退出登录
36
+    exit() {
37
+      this.$confirm('退出登录, 是否继续?', '提示', {
38
+        confirmButtonText: '确定',
39
+        cancelButtonText: '取消',
40
+        type: 'warning'
41
+      })
42
+        .then(() => {
43
+          setTimeout(() => {
44
+            this.$store.commit('logout', 'false')
45
+            this.$router.push({ path: '/login' })
46
+            this.$message({
47
+              type: 'success',
48
+              message: '已退出登录!'
49
+            })
50
+          }, 1000)
51
+          // loginout()
52
+          //   .then(res => {
53
+          //     if (res.success) {
54
+          //       //如果请求成功就让他2秒跳转路由
55
+          //       setTimeout(() => {
56
+          //         this.$store.commit('logout', 'false')
57
+          //         this.$router.push({ path: '/login' })
58
+          //         this.$message({
59
+          //           type: 'success',
60
+          //           message: '已退出登录!'
61
+          //         })
62
+          //       }, 1000)
63
+          //     } else {
64
+          //       this.$message.error(res.msg)
65
+          //       this.logining = false
66
+          //       return false
67
+          //     }
68
+          //   })
69
+          //   .catch(err => {
70
+          //     // 获取图形验证码
71
+          //     this.getcode()
72
+          //     this.logining = false
73
+          //     this.$message.error('退出失败,请稍后再试!')
74
+          //   })
75
+        })
76
+        .catch(() => {
77
+          this.$message({
78
+            type: 'info',
79
+            message: '已取消'
80
+          })
81
+        })
82
+    },
83
+    // 切换显示
84
+    toggle(showtype) {
85
+      this.collapsed = !showtype
86
+      this.$root.Bus.$emit('toggle', this.collapsed)
87
+    }
88
+  }
89
+}
90
+</script>
91
+<style scoped>
92
+.el-menu-vertical-demo:not(.el-menu--collapse) {
93
+  border: none;
94
+}
95
+.submenu {
96
+  float: right;
97
+}
98
+.buttonimg {
99
+  height: 60px;
100
+  background-color: transparent;
101
+  border: none;
102
+}
103
+.showimg {
104
+  width: 26px;
105
+  height: 26px;
106
+  position: absolute;
107
+  top: 17px;
108
+  left: 17px;
109
+}
110
+.showimg:active {
111
+  border: none;
112
+}
113
+</style>

+ 58
- 0
src/components/template.vue ファイルの表示

@@ -0,0 +1,58 @@
1
+/**
2
+* 模版
3
+**/ 
4
+
5
+<template>
6
+    <div>
7
+        
8
+    </div>
9
+</template>
10
+
11
+<script>
12
+// 导入组件
13
+import headerComponent from "./head.vue";
14
+// 导出模块
15
+export default {
16
+  // 模块名字
17
+  name: "template",
18
+  // 模块数据
19
+  data() {
20
+    //数据  
21
+    return {};
22
+  },
23
+  // 注册组件
24
+  components: {
25
+    headerComponent
26
+  },
27
+  // 监听指定值,只有指定值变化,才会触发
28
+  watch: {},
29
+  // 里面的函数只有调用才会执行(实时计算)里面是定义的方法
30
+  methods: {
31
+    addFun() {},
32
+    submitFun() {}
33
+  },
34
+  // 创建前状态(里面是操作)
35
+  beforeCreate() {},
36
+  // 创建完毕状态(里面是操作)
37
+  created() {},
38
+  // 挂载前状态(里面是操作)
39
+  beforeMount() {},
40
+  // 挂载结束状态(里面是操作)
41
+  mounted() {},
42
+  // 更新前状态(里面是操作)
43
+  beforeUpdate() {},
44
+  // 更新完成状态(里面是操作)
45
+  updated() {},
46
+  // 销毁前状态(里面是操作)
47
+  beforeDestroy() {},
48
+  // 销毁完成状态(里面是操作)
49
+  destroyed() {}
50
+};
51
+</script>
52
+// scoped 样式只在本组件使用
53
+<style scoped>
54
+/**
55
+ * 导入css样式组件
56
+ * @import "../assets/css/components/index.css";
57
+ */
58
+</style>

+ 82
- 0
src/main.js ファイルの表示

@@ -0,0 +1,82 @@
1
+// The Vue build version to load with the `import` command
2
+// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
3
+import Vue from 'vue';
4
+// 引入element UI
5
+import ElementUI from 'element-ui';
6
+import 'element-ui/lib/theme-chalk/index.css';
7
+import App from './App';
8
+// 引入路由
9
+import router from './router';
10
+// 引入状态管理
11
+import store from './vuex/store';
12
+// 引入icon
13
+import './assets/icon/iconfont.css'
14
+// 
15
+
16
+// 引入echarts
17
+import echarts from 'echarts'
18
+Vue.prototype.$echarts = echarts
19
+
20
+import axios from 'axios';
21
+Vue.prototype.$axios = axios;
22
+
23
+Vue.config.productionTip = false;
24
+
25
+// 使用element UI
26
+Vue.use(ElementUI);
27
+// 过滤器
28
+import * as custom from './utils/util'
29
+
30
+Object.keys(custom).forEach(key => {
31
+    Vue.filter(key, custom[key])
32
+})
33
+
34
+// 路由拦截器
35
+router.beforeEach((to, from, next) => {
36
+    if (to.matched.length != 0) {
37
+        if (to.meta.requireAuth) { // 判断该路由是否需要登录权限
38
+            if (Boolean(localStorage.getItem("userInfo"))) { // 通过vuex state获取当前的user是否存在
39
+                next();
40
+            } else {
41
+                next({
42
+                    path: '/login',
43
+                    query: { redirect: to.fullPath } // 将跳转的路由path作为参数,登录成功后跳转到该路由
44
+                })
45
+            }
46
+        } else {
47
+            if (Boolean(localStorage.getItem("userInfo"))) { // 判断是否登录
48
+                if (to.path != "/" && to.path != "/login") { //判断是否要跳到登录界面
49
+                    next();
50
+                } else {
51
+                    /**
52
+                     * 防刷新,如果登录,修改路由跳转到登录页面,修改路由为登录后的首页 
53
+                     */
54
+                    next({
55
+                        path: '/goods/Goods'
56
+                    })
57
+                }
58
+            } else {
59
+                next();
60
+            }
61
+        }
62
+    } else {
63
+        next({
64
+            path: '/login',
65
+            query: { redirect: to.fullPath } // 将跳转的路由path作为参数,登录成功后跳转到该路由
66
+        })
67
+    }
68
+})
69
+
70
+/* eslint-disable no-new */
71
+new Vue({
72
+    el: '#app',
73
+    router,
74
+    store, //使用store vuex状态管理
75
+    components: { App },
76
+    template: '<App/>',
77
+    data: {
78
+        // 空的实例放到根组件下,所有的子组件都能调用
79
+        Bus: new Vue()
80
+    }
81
+
82
+})

+ 179
- 0
src/router/index.js ファイルの表示

@@ -0,0 +1,179 @@
1
+// 导入组件
2
+import Vue from 'vue';
3
+import Router from 'vue-router';
4
+// 登录
5
+import login from '@/views/login';
6
+// 首页
7
+import index from '@/views/index';
8
+/**
9
+ * 基础菜单
10
+ */
11
+// 商品管理
12
+import Goods from '@/views/goods/Goods';
13
+// 机器信息管理
14
+import Machine from '@/views/machine/Machine';
15
+// 货道信息管理
16
+import MachineAisle from '@/views/machine/MachineAisle';
17
+/**
18
+ * 订单管理
19
+ */
20
+// 交易订单
21
+import Order from '@/views/pay/Order';
22
+/**
23
+ * 系统管理
24
+ */
25
+// 用户管理
26
+import user from '@/views/system/user';
27
+// 菜单管理
28
+import Module from '@/views/system/Module';
29
+// 角色管理
30
+import Role from '@/views/system/Role';
31
+// 公司管理
32
+import Dept from '@/views/system/Dept';
33
+// 系统环境变量
34
+import Variable from '@/views/system/Variable';
35
+// 权限管理
36
+import Permission from '@/views/system/Permission';
37
+/**
38
+ * 支付管理
39
+ */
40
+// 支付配置信息
41
+import MachineConfig from '@/views/machine/MachineConfig';
42
+// 支付配置
43
+import Config from '@/views/pay/Config';
44
+/**
45
+ * 数据监控
46
+ */
47
+// 监控查询
48
+import druidLogin from '@/views/druid/login';
49
+
50
+// 图表界面
51
+import statistics from '@/views/charts/statistics';
52
+
53
+// 启用路由
54
+Vue.use(Router);
55
+
56
+// 导出路由 
57
+export default new Router({
58
+    routes: [{
59
+        path: '/',
60
+        name: '',
61
+        component: login,
62
+        hidden: true,
63
+        meta: {
64
+            requireAuth: false
65
+        }
66
+    }, {
67
+        path: '/login',
68
+        name: '登录',
69
+        component: login,
70
+        hidden: true,
71
+        meta: {
72
+            requireAuth: false
73
+        }
74
+    }, {
75
+        path: '/index',
76
+        name: '首页',
77
+        component: index,
78
+        iconCls: 'el-icon-tickets',
79
+        children: [{
80
+            path: '/goods/Goods',
81
+            name: '商品管理',
82
+            component: Goods,
83
+            meta: {
84
+                requireAuth: true
85
+            }
86
+        }, {
87
+            path: '/machine/Machine',
88
+            name: '机器信息管理',
89
+            component: Machine,
90
+            meta: {
91
+                requireAuth: true
92
+            }
93
+        }, {
94
+            path: '/machine/MachineAisle',
95
+            name: '货道信息管理',
96
+            component: MachineAisle,
97
+            meta: {
98
+                requireAuth: true
99
+            }
100
+        }, {
101
+            path: '/pay/Order',
102
+            name: '交易订单',
103
+            component: Order,
104
+            meta: {
105
+                requireAuth: true
106
+            }
107
+        }, {
108
+            path: '/system/user',
109
+            name: '用户管理',
110
+            component: user,
111
+            meta: {
112
+                requireAuth: true
113
+            }
114
+        }, {
115
+            path: '/system/Module',
116
+            name: '菜单管理',
117
+            component: Module,
118
+            meta: {
119
+                requireAuth: true
120
+            }
121
+        }, {
122
+            path: '/system/Role',
123
+            name: '角色管理',
124
+            component: Role,
125
+            meta: {
126
+                requireAuth: true
127
+            }
128
+        }, {
129
+            path: '/system/Dept',
130
+            name: '公司管理',
131
+            component: Dept,
132
+            meta: {
133
+                requireAuth: true
134
+            }
135
+        }, {
136
+            path: '/system/Variable',
137
+            name: '系统环境变量',
138
+            component: Variable,
139
+            meta: {
140
+                requireAuth: true
141
+            }
142
+        }, {
143
+            path: '/system/Permission',
144
+            name: '权限管理',
145
+            component: Permission,
146
+            meta: {
147
+                requireAuth: true
148
+            }
149
+        }, {
150
+            path: '/machine/MachineConfig',
151
+            name: '支付配置信息',
152
+            component: MachineConfig,
153
+            meta: {
154
+                requireAuth: true
155
+            }
156
+        }, {
157
+            path: '/pay/Config',
158
+            name: '支付配置',
159
+            component: Config,
160
+            meta: {
161
+                requireAuth: true
162
+            }
163
+        }, {
164
+            path: '/druid/login',
165
+            name: '监控查询',
166
+            component: druidLogin,
167
+            meta: {
168
+                requireAuth: true
169
+            }
170
+        }, {
171
+            path: '/charts/statistics',
172
+            name: '数据可视化',
173
+            component: statistics,
174
+            meta: {
175
+                requireAuth: true
176
+            }
177
+        }]
178
+    }]
179
+})

+ 90
- 0
src/utils/util.js ファイルの表示

@@ -0,0 +1,90 @@
1
+/**
2
+ * 时间戳
3
+ * @param {*} timestamp  时间戳
4
+ */
5
+const timestampToTime = (timestamp) => {
6
+    let date = new Date(timestamp) //时间戳为10位需*1000,时间戳为13位的话不需乘1000
7
+    let Y = date.getFullYear() + '-'
8
+    let M =
9
+        (date.getMonth() + 1 < 10 ?
10
+            '0' + (date.getMonth() + 1) :
11
+            date.getMonth() + 1) + '-'
12
+    let D =
13
+        (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + ' '
14
+    let h =
15
+        (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':'
16
+    let m =
17
+        (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) +
18
+        ':'
19
+    let s =
20
+        date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
21
+    return Y + M + D + h + m + s
22
+};
23
+/**
24
+ * 存储localStorage
25
+ */
26
+const setStore = (name, content) => {
27
+    if (!name) return;
28
+    if (typeof content !== 'string') {
29
+        content = JSON.stringify(content);
30
+    }
31
+    window.localStorage.setItem(name, content);
32
+}
33
+
34
+/**
35
+ * 获取localStorage
36
+ */
37
+const getStore = name => {
38
+    if (!name) return;
39
+    return window.localStorage.getItem(name);
40
+}
41
+
42
+/**
43
+ * 删除localStorage
44
+ */
45
+const removeStore = name => {
46
+    if (!name) return;
47
+    window.localStorage.removeItem(name);
48
+}
49
+
50
+/**
51
+ * 设置cookie
52
+ **/
53
+function setCookie(name, value, day) {
54
+    let date = new Date();
55
+    date.setDate(date.getDate() + day);
56
+    document.cookie = name + '=' + value + ';expires=' + date;
57
+};
58
+
59
+/**
60
+ * 获取cookie
61
+ **/
62
+function getCookie(name) {
63
+    let reg = RegExp(name + '=([^;]+)');
64
+    let arr = document.cookie.match(reg);
65
+    if (arr) {
66
+        return arr[1];
67
+    } else {
68
+        return '';
69
+    }
70
+};
71
+
72
+/**
73
+ * 删除cookie
74
+ **/
75
+function delCookie(name) {
76
+    setCookie(name, null, -1);
77
+};
78
+
79
+/**
80
+ * 导出 
81
+ **/
82
+export {
83
+    timestampToTime,
84
+    setStore,
85
+    getStore,
86
+    removeStore,
87
+    setCookie,
88
+    getCookie,
89
+    delCookie
90
+}

+ 565
- 0
src/views/charts/statistics.vue ファイルの表示

@@ -0,0 +1,565 @@
1
+/**
2
+* 图表界面
3
+*/ 
4
+<template>
5
+  <!-- 组件主盒子 -->
6
+  <div class="stbox">
7
+    <!-- 面包屑导航 -->
8
+    <el-breadcrumb separator-class="el-icon-arrow-right">
9
+      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
10
+      <el-breadcrumb-item>数据可视化</el-breadcrumb-item>
11
+    </el-breadcrumb>
12
+    <!-- 搜索,切换 -->
13
+    <el-row :gutter="23">
14
+      <el-col :span="18">
15
+        <div class="stbgc">
16
+          <el-row :gutter="23">
17
+            <el-col :span="7">
18
+              <el-input size="small" v-model="machineNo" placeholder="请输入所属公司"></el-input>
19
+            </el-col>
20
+            <el-col :span="7">
21
+              <el-input size="small" v-model="machineNo" placeholder="请输入资产编号"></el-input>
22
+            </el-col>
23
+            <el-col :span="7">
24
+              <el-input size="small" v-model="machineNo" placeholder="请输入"></el-input>
25
+            </el-col>
26
+            <el-col :span="3" class="stsearch">
27
+              <el-button size="small" type="primary">搜索</el-button>
28
+            </el-col>
29
+          </el-row>
30
+        </div>
31
+      </el-col>
32
+      <el-col :span="6">
33
+        <div class="stbgc">
34
+          <el-row>
35
+            <el-col :span="8" class="text-c">
36
+              <el-radio v-model="type" label="day">日</el-radio>
37
+            </el-col>
38
+            <el-col :span="8" class="text-c">
39
+              <el-radio v-model="type" label="month">月</el-radio>
40
+            </el-col>
41
+            <el-col :span="8" class="text-c">
42
+              <el-radio v-model="type" label="years">年</el-radio>
43
+            </el-col>
44
+          </el-row>
45
+        </div>
46
+      </el-col>
47
+    </el-row>
48
+    <!-- 统计图 -->
49
+    <el-row :gutter="23">
50
+      <el-col :span="8" class="text-c">
51
+        <div class="st-gbox">
52
+          <div class="cavasbox" ref="SCEchart"></div>
53
+        </div>
54
+      </el-col>
55
+      <el-col :span="8" class="text-c">
56
+        <div class="st-gbox">
57
+          <div class="cavasbox" ref="SUMEchart"></div>
58
+        </div>
59
+      </el-col>
60
+      <el-col :span="8" class="text-c">
61
+        <div class="st-gbox">
62
+          <div class="cavasbox" ref="ClickEchart"></div>
63
+        </div>
64
+      </el-col>
65
+    </el-row>
66
+    <!-- 统计图 -->
67
+    <div>
68
+      <el-row :gutter="23">
69
+        <el-col :span="12" class="text-c">
70
+          <div class="paybox">
71
+            <div class="cavasbox" ref="payEchart"></div>
72
+          </div>
73
+        </el-col>
74
+        <el-col :span="12" class="text-c">
75
+          <div class="paybox">
76
+            <div class="cavasbox" ref="payNumEchart"></div>
77
+          </div>
78
+        </el-col>
79
+      </el-row>
80
+    </div>
81
+  </div>
82
+</template>
83
+<script type="text/ecmascript-6">
84
+import Chart from 'echarts'
85
+export default {
86
+  name: "welcome",
87
+  data() {
88
+    return {
89
+      machineNo: '',
90
+      type: 'day',
91
+      //  销售总笔数 
92
+      SCEoption: {
93
+        tooltip: {
94
+          trigger: 'item',
95
+          formatter: "{a} <br/>{b}月 : {c}"
96
+        },
97
+        legend: {
98
+          data: [{
99
+            name: '销售总笔数',
100
+            icon: 'rect'
101
+          }],
102
+          top: 1,
103
+          left: 1,
104
+          itemGap: 10,
105
+          itemWidth: 12,
106
+          itemHeight: 12,
107
+          textStyle: {
108
+            fontSize: 12,
109
+            color: "#323232"
110
+          }
111
+        },
112
+        grid: {
113
+          left: 50,
114
+          right: 10,
115
+          top: 30,
116
+          bottom: 30,
117
+          borderWidth: 1
118
+        },
119
+        xAxis: {
120
+          type: 'category',
121
+          data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
122
+          axisLine: {
123
+            lineStyle: {
124
+              color: "#999999",
125
+              width: 1
126
+            }
127
+          },
128
+          axisLabel: {
129
+            margin: 14,
130
+            height: 70,
131
+            interval: 0,
132
+            textStyle: {
133
+              fontSize: 10,
134
+              color: "#999999"
135
+            }
136
+          }
137
+        },
138
+        yAxis: {
139
+          type: 'value',
140
+          axisLine: {
141
+            lineStyle: {
142
+              color: "#999999",
143
+              width: 1
144
+            }
145
+          },
146
+          axisLabel: {
147
+            margin: 14,
148
+            textStyle: {
149
+              fontSize: 10,
150
+              color: "#999999"
151
+            }
152
+          }
153
+        },
154
+        series: [{
155
+          name: '销售总笔数',
156
+          type: 'bar',
157
+          barGap: 0,
158
+          data: [50000, 70000, 80000, 40000, 50000, 30000, 40000, 60000, 50000, 40000, 60000, 40000],
159
+          barWidth: 10,
160
+          itemStyle: {
161
+            normal: {
162
+              color: new Chart.graphic.LinearGradient(
163
+                0, 0, 0, 1,
164
+                [
165
+                  { offset: 0, color: '#83bff6' },
166
+                  { offset: 0.5, color: '#188df0' },
167
+                  { offset: 1, color: '#188df0' }
168
+                ]
169
+              )
170
+            },
171
+            emphasis: {
172
+              color: new Chart.graphic.LinearGradient(
173
+                0, 0, 0, 1,
174
+                [
175
+                  { offset: 0, color: '#2378f7' },
176
+                  { offset: 0.7, color: '#2378f7' },
177
+                  { offset: 1, color: '#83bff6' }
178
+                ]
179
+              )
180
+            }
181
+          }
182
+        }]
183
+      },
184
+      //  销售总金额 
185
+      SUMoption: {
186
+        tooltip: {
187
+          trigger: 'item',
188
+          formatter: "{a} <br/>{b}月 : {c}"
189
+        },
190
+        legend: {
191
+          data: [{
192
+            name: '销售总金额',
193
+            icon: 'rect'
194
+          }],
195
+          top: 1,
196
+          left: 1,
197
+          itemGap: 10,
198
+          itemWidth: 12,
199
+          itemHeight: 12,
200
+          textStyle: {
201
+            fontSize: 12,
202
+            color: "#323232"
203
+          }
204
+        },
205
+        grid: {
206
+          left: 50,
207
+          right: 10,
208
+          top: 30,
209
+          bottom: 30,
210
+          borderWidth: 1
211
+        },
212
+        xAxis: {
213
+          type: 'category',
214
+          data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
215
+          axisLine: {
216
+            lineStyle: {
217
+              color: "#999999",
218
+              width: 1
219
+            }
220
+          },
221
+          axisLabel: {
222
+            margin: 14,
223
+            height: 70,
224
+            interval: 0,
225
+            textStyle: {
226
+              fontSize: 10,
227
+              color: "#999999"
228
+            }
229
+          }
230
+        },
231
+        yAxis: {
232
+          type: 'value',
233
+          axisLine: {
234
+            lineStyle: {
235
+              color: "#999999",
236
+              width: 1
237
+            }
238
+          },
239
+          axisLabel: {
240
+            margin: 14,
241
+            textStyle: {
242
+              fontSize: 10,
243
+              color: "#999999"
244
+            }
245
+          }
246
+        },
247
+        series: [{
248
+          name: '销售总金额',
249
+          //   type: 'bar',
250
+          type: 'line',
251
+          barGap: 0,
252
+          data: [50000, 70000, 80000, 40000, 50000, 30000, 40000, 60000, 50000, 40000, 60000, 40000],
253
+          barWidth: 10,
254
+          itemStyle: {
255
+            color: "#108ff9"
256
+          }
257
+        }]
258
+      },
259
+      //  总点击量
260
+      Clickoption: {
261
+        tooltip: {
262
+          trigger: 'item',
263
+          formatter: "{a} <br/>{b}月 : {c}"
264
+        },
265
+        legend: {
266
+          data: [{
267
+            name: '总点击量',
268
+            icon: 'rect'
269
+          }],
270
+          top: 1,
271
+          left: 1,
272
+          itemGap: 10,
273
+          itemWidth: 12,
274
+          itemHeight: 12,
275
+          textStyle: {
276
+            fontSize: 12,
277
+            color: "#323232"
278
+          }
279
+        },
280
+        grid: {
281
+          left: 50,
282
+          right: 10,
283
+          top: 30,
284
+          bottom: 30,
285
+          borderWidth: 1
286
+        },
287
+        xAxis: {
288
+          type: 'category',
289
+          data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
290
+          axisLine: {
291
+            lineStyle: {
292
+              color: "#999999",
293
+              width: 1
294
+            }
295
+          },
296
+          axisLabel: {
297
+            margin: 14,
298
+            height: 70,
299
+            interval: 0,
300
+            textStyle: {
301
+              fontSize: 10,
302
+              color: "#999999"
303
+            }
304
+          }
305
+        },
306
+        yAxis: {
307
+          type: 'value',
308
+          axisLine: {
309
+            lineStyle: {
310
+              color: "#999999",
311
+              width: 1
312
+            }
313
+          },
314
+          axisLabel: {
315
+            margin: 14,
316
+            textStyle: {
317
+              fontSize: 10,
318
+              color: "#999999"
319
+            }
320
+          }
321
+        },
322
+        series: [{
323
+          name: '总点击量',
324
+          type: 'bar',
325
+          barGap: 0,
326
+          data: [50000, 10000, 80000, 30000, 50000, 60000, 40000, 80000, 50000, 20000, 60000, 40000],
327
+          barWidth: 10,
328
+          itemStyle: {
329
+            color: "#48cefd"
330
+          }
331
+        }]
332
+      },
333
+      //  支付方式统计
334
+      payoption: {
335
+        backgroundColor: '#2c343c',
336
+        title: {
337
+          text: '支付方式统计(金额)',
338
+          left: 10,
339
+          top: 5,
340
+          textStyle: {
341
+            fontSize: 12,
342
+            color: '#ccc'
343
+          }
344
+        },
345
+
346
+        tooltip: {
347
+          trigger: 'item',
348
+          formatter: "{a} <br/>{b} : {c} ({d}%)"
349
+        },
350
+
351
+        visualMap: {
352
+          show: false,
353
+          min: 80,
354
+          max: 600,
355
+          inRange: {
356
+            colorLightness: [0, 1]
357
+          }
358
+        },
359
+        series: [
360
+          {
361
+            name: '支付方式统计(金额)',
362
+            type: 'pie',
363
+            radius: '55%',
364
+            center: ['50%', '50%'],
365
+            data: [
366
+              { value: 335, name: '支付宝' },
367
+              { value: 310, name: '银商二维码' },
368
+              { value: 274, name: '会员' },
369
+              { value: 235, name: '微信支付' },
370
+              { value: 100, name: 'Pos通' }
371
+            ].sort(function (a, b) { return a.value - b.value; }),
372
+            roseType: 'radius',
373
+            label: {
374
+              normal: {
375
+                textStyle: {
376
+                  color: 'rgba(255, 255, 255, 0.3)'
377
+                }
378
+              }
379
+            },
380
+            labelLine: {
381
+              normal: {
382
+                lineStyle: {
383
+                  color: 'rgba(255, 255, 255, 0.3)'
384
+                },
385
+                smooth: 0.2,
386
+                length: 10,
387
+                length2: 20
388
+              }
389
+            },
390
+            itemStyle: {
391
+              normal: {
392
+                color: '#c23531',
393
+                shadowBlur: 200,
394
+                shadowColor: 'rgba(0, 0, 0, 0.5)'
395
+              }
396
+            },
397
+
398
+            animationType: 'scale',
399
+            animationEasing: 'elasticOut',
400
+            animationDelay: function (idx) {
401
+              return Math.random() * 200;
402
+            }
403
+          }
404
+        ]
405
+      },
406
+      payNumoption: {
407
+        backgroundColor: '#2c343c',
408
+        title: {
409
+          text: '支付方式统计(笔数)',
410
+          left: 10,
411
+          top: 5,
412
+          textStyle: {
413
+            fontSize: 12,
414
+            color: '#ccc'
415
+          }
416
+        },
417
+
418
+        tooltip: {
419
+          trigger: 'item',
420
+          formatter: "{a} <br/>{b} : {c} ({d}%)"
421
+        },
422
+
423
+        visualMap: {
424
+          show: false,
425
+          min: 80,
426
+          max: 600,
427
+          inRange: {
428
+            colorLightness: [0, 1]
429
+          }
430
+        },
431
+        series: [
432
+          {
433
+            name: '支付方式统计(笔数)',
434
+            type: 'pie',
435
+            radius: '55%',
436
+            center: ['50%', '50%'],
437
+            data: [
438
+              { value: 335, name: '支付宝' },
439
+              { value: 310, name: '银商二维码' },
440
+              { value: 274, name: '会员' },
441
+              { value: 235, name: '微信支付' },
442
+              { value: 100, name: 'Pos通' }
443
+            ].sort(function (a, b) { return a.value - b.value; }),
444
+            roseType: 'radius',
445
+            label: {
446
+              normal: {
447
+                textStyle: {
448
+                  color: 'rgba(255, 255, 255, 0.3)'
449
+                }
450
+              }
451
+            },
452
+            labelLine: {
453
+              normal: {
454
+                lineStyle: {
455
+                  color: 'rgba(255, 255, 255, 0.3)'
456
+                },
457
+                smooth: 0.2,
458
+                length: 10,
459
+                length2: 20
460
+              }
461
+            },
462
+            itemStyle: {
463
+              normal: {
464
+                color: '#c23531',
465
+                shadowBlur: 200,
466
+                shadowColor: 'rgba(0, 0, 0, 0.5)'
467
+              }
468
+            },
469
+
470
+            animationType: 'scale',
471
+            animationEasing: 'elasticOut',
472
+            animationDelay: function (idx) {
473
+              return Math.random() * 200;
474
+            }
475
+          }
476
+        ]
477
+      },
478
+    }
479
+  },
480
+  // 导入组件
481
+  components: {
482
+    // 点聚合组件
483
+  },
484
+  // 创建完毕状态(里面是操作)
485
+  created() { },
486
+  // 挂载结束状态(里面是操作)
487
+  mounted() {
488
+    this.getSCE()
489
+    this.getSUM()
490
+    this.getClick()
491
+    this.getpay()
492
+    this.getpayNum()
493
+  },
494
+  // 里面的函数只有调用才会执行
495
+  methods: {
496
+    // 交易总笔数
497
+    getSCE() {
498
+      this.chart = Chart.init(this.$refs.SCEchart)
499
+      this.chart.setOption(this.SCEoption)
500
+    },
501
+    // 交易总金额
502
+    getSUM() {
503
+      this.chart = Chart.init(this.$refs.SUMEchart)
504
+      this.chart.setOption(this.SUMoption)
505
+    },
506
+    // 总点击量
507
+    getClick() {
508
+      this.chart = Chart.init(this.$refs.ClickEchart)
509
+      this.chart.setOption(this.Clickoption)
510
+    },
511
+    // 支付方式统计
512
+    getpay() {
513
+      this.chart = Chart.init(this.$refs.payEchart)
514
+      this.chart.setOption(this.payoption)
515
+    },
516
+    // 支付方式统计
517
+    getpayNum() {
518
+      this.chart = Chart.init(this.$refs.payNumEchart)
519
+      this.chart.setOption(this.payNumoption)
520
+    }
521
+
522
+  }
523
+};
524
+</script>
525
+<style>
526
+.stbox {
527
+  width: 100%;
528
+  height: 100%;
529
+  box-sizing: border-box;
530
+}
531
+.stbgc {
532
+  background-color: #fff;
533
+  height: 60px;
534
+  line-height: 60px;
535
+  border-radius: 5px;
536
+  padding: 0px 16px;
537
+}
538
+.stsearch {
539
+  text-align: center;
540
+}
541
+.text-c {
542
+  text-align: center;
543
+}
544
+.st-gbox {
545
+  background-color: #fff;
546
+  margin-top: 20px;
547
+  border-radius: 5px;
548
+  height: 30vh;
549
+  box-sizing: border-box;
550
+  padding: 10px;
551
+}
552
+.cavasbox {
553
+  box-sizing: border-box;
554
+  width: 100%;
555
+  height: 100%;
556
+}
557
+.paybox {
558
+  width: 100%;
559
+  background-color: #fff;
560
+  box-sizing: border-box;
561
+  border-radius: 5px;
562
+  margin-top: 20px;
563
+  height: 32vh;
564
+}
565
+</style>

+ 18
- 0
src/views/druid/login.vue ファイルの表示

@@ -0,0 +1,18 @@
1
+/**
2
+ * 数据监控 监控查询
3
+ */
4
+<template>
5
+  <div>数据监控 监控查询</div>
6
+</template>
7
+
8
+<script>
9
+export default {
10
+
11
+}
12
+</script>
13
+
14
+<style>
15
+
16
+</style>
17
+
18
+ 

+ 332
- 0
src/views/goods/Goods.vue ファイルの表示

@@ -0,0 +1,332 @@
1
+/**
2
+ * 基础菜单 商品管理
3
+ */
4
+<template>
5
+  <div>
6
+    <!-- 面包屑导航 -->
7
+    <el-breadcrumb separator-class="el-icon-arrow-right">
8
+      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
9
+      <el-breadcrumb-item>商品管理</el-breadcrumb-item>
10
+    </el-breadcrumb>
11
+    <!-- 搜索筛选 -->
12
+    <el-form :inline="true" :model="formInline" class="user-search">
13
+      <el-form-item label="搜索:">
14
+        <el-input size="small" v-model="formInline.deptName" placeholder="输入部门名称"></el-input>
15
+      </el-form-item>
16
+      <el-form-item label="">
17
+        <el-input size="small" v-model="formInline.deptNo" placeholder="输入部门代码"></el-input>
18
+      </el-form-item>
19
+      <el-form-item>
20
+        <el-button size="small" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
21
+        <el-button size="small" type="primary" icon="el-icon-plus" @click="handleEdit()">添加</el-button>
22
+      </el-form-item>
23
+    </el-form>
24
+    <!--列表-->
25
+    <el-table size="small" :data="listData" highlight-current-row v-loading="loading" border element-loading-text="拼命加载中" style="width: 100%;">
26
+      <el-table-column align="center" type="selection" width="60">
27
+      </el-table-column>
28
+      <el-table-column sortable prop="deptName" label="部门名称" width="300">
29
+      </el-table-column>
30
+      <el-table-column sortable prop="deptNo" label="部门代码" width="300">
31
+      </el-table-column>
32
+      <el-table-column sortable prop="editTime" label="修改时间" width="300">
33
+        <template slot-scope="scope">
34
+          <div>{{scope.row.editTime|timestampToTime}}</div>
35
+        </template>
36
+      </el-table-column>
37
+      <el-table-column sortable prop="editUser" label="修改人" width="300">
38
+      </el-table-column>
39
+      <el-table-column align="center" label="操作" min-width="300">
40
+        <template slot-scope="scope">
41
+          <el-button size="mini" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
42
+          <el-button size="mini" type="danger" @click="deleteUser(scope.$index, scope.row)">删除</el-button>
43
+        </template>
44
+      </el-table-column>
45
+    </el-table>
46
+    <!-- 分页组件 -->
47
+    <Pagination v-bind:child-msg="pageparm" @callFather="callFather"></Pagination>
48
+    <!-- 编辑界面 -->
49
+    <el-dialog :title="title" :visible.sync="editFormVisible" width="30%" @click="closeDialog">
50
+      <el-form label-width="120px" :model="editForm" :rules="rules" ref="editForm">
51
+        <el-form-item label="部门名称" prop="deptName">
52
+          <el-input size="small" v-model="editForm.deptName" auto-complete="off" placeholder="请输入部门名称"></el-input>
53
+        </el-form-item>
54
+        <el-form-item label="部门代码" prop="deptNo">
55
+          <el-input size="small" v-model="editForm.deptNo" auto-complete="off" placeholder="请输入部门代码"></el-input>
56
+        </el-form-item>
57
+      </el-form>
58
+      <div slot="footer" class="dialog-footer">
59
+        <el-button size="small" @click="closeDialog">取消</el-button>
60
+        <el-button size="small" type="primary" :loading="loading" class="title" @click="submitForm('editForm')">保存</el-button>
61
+      </div>
62
+    </el-dialog>
63
+  </div>
64
+</template>
65
+
66
+<script>
67
+import { deptList, deptSave, deptDelete } from '../../api/userMG'
68
+import Pagination from '../../components/Pagination'
69
+export default {
70
+  data() {
71
+    return {
72
+      nshow: true, //switch开启
73
+      fshow: false, //switch关闭
74
+      loading: false, //是显示加载
75
+      editFormVisible: false, //控制编辑页面显示与隐藏
76
+      title: '添加',
77
+      editForm: {
78
+        deptId: '',
79
+        deptName: '',
80
+        deptNo: '',
81
+        token: localStorage.getItem('logintoken')
82
+      },
83
+      // rules表单验证
84
+      rules: {
85
+        deptName: [
86
+          { required: true, message: '请输入部门名称', trigger: 'blur' }
87
+        ],
88
+        deptNo: [{ required: true, message: '请输入部门代码', trigger: 'blur' }]
89
+      },
90
+      formInline: {
91
+        page: 1,
92
+        limit: 10,
93
+        varLable: '',
94
+        varName: '',
95
+        token: localStorage.getItem('logintoken')
96
+      },
97
+      // 删除部门
98
+      seletedata: {
99
+        ids: '',
100
+        token: localStorage.getItem('logintoken')
101
+      },
102
+      userparm: [], //搜索权限
103
+      listData: [], //用户数据
104
+      // 分页参数
105
+      pageparm: {
106
+        currentPage: 1,
107
+        pageSize: 10,
108
+        total: 10
109
+      }
110
+    }
111
+  },
112
+  // 注册组件
113
+  components: {
114
+    Pagination
115
+  },
116
+  /**
117
+   * 数据发生改变
118
+   */
119
+
120
+  /**
121
+   * 创建完毕
122
+   */
123
+  created() {
124
+    this.getdata(this.formInline)
125
+  },
126
+
127
+  /**
128
+   * 里面的方法只有被调用才会执行
129
+   */
130
+  methods: {
131
+    // 获取公司列表
132
+    getdata(parameter) {
133
+      this.loading = true
134
+      // 模拟数据开始
135
+      let res = {
136
+        code: 0,
137
+        msg: null,
138
+        count: 5,
139
+        data: [
140
+          {
141
+            addUser: null,
142
+            editUser: null,
143
+            addTime: 1521062371000,
144
+            editTime: 1526700200000,
145
+            deptId: 2,
146
+            deptName: 'XX分公司',
147
+            deptNo: '1',
148
+            parentId: 1
149
+          },
150
+          {
151
+            addUser: null,
152
+            editUser: null,
153
+            addTime: 1521063247000,
154
+            editTime: 1526652291000,
155
+            deptId: 3,
156
+            deptName: '上海测试',
157
+            deptNo: '02',
158
+            parentId: 1
159
+          },
160
+          {
161
+            addUser: null,
162
+            editUser: null,
163
+            addTime: 1526349555000,
164
+            editTime: 1526349565000,
165
+            deptId: 12,
166
+            deptName: '1',
167
+            deptNo: '11',
168
+            parentId: 1
169
+          },
170
+          {
171
+            addUser: null,
172
+            editUser: null,
173
+            addTime: 1526373178000,
174
+            editTime: 1526373178000,
175
+            deptId: 13,
176
+            deptName: '5',
177
+            deptNo: '5',
178
+            parentId: 1
179
+          },
180
+          {
181
+            addUser: null,
182
+            editUser: null,
183
+            addTime: 1526453107000,
184
+            editTime: 1526453107000,
185
+            deptId: 17,
186
+            deptName: 'v',
187
+            deptNo: 'v',
188
+            parentId: 1
189
+          }
190
+        ]
191
+      }
192
+      this.loading = false
193
+      this.listData = res.data
194
+      this.pageparm.currentPage = this.formInline.page
195
+      this.pageparm.pageSize = this.formInline.limit
196
+      this.pageparm.total = res.count
197
+      // 模拟数据结束
198
+
199
+      /***
200
+       * 调用接口,注释上面模拟数据 取消下面注释
201
+       */
202
+      // deptList(parameter)
203
+      //   .then(res => {
204
+      //     this.loading = false
205
+      //     if (res.success == false) {
206
+      //       this.$message({
207
+      //         type: 'info',
208
+      //         message: res.msg
209
+      //       })
210
+      //     } else {
211
+      //       this.listData = res.data
212
+      //       // 分页赋值
213
+      //       this.pageparm.currentPage = this.formInline.page
214
+      //       this.pageparm.pageSize = this.formInline.limit
215
+      //       this.pageparm.total = res.count
216
+      //     }
217
+      //   })
218
+      //   .catch(err => {
219
+      //     this.loading = false
220
+      //     this.$message.error('菜单加载失败,请稍后再试!')
221
+      //   })
222
+    },
223
+    // 分页插件事件
224
+    callFather(parm) {
225
+      this.formInline.page = parm.currentPage
226
+      this.formInline.limit = parm.pageSize
227
+      this.getdata(this.formInline)
228
+    },
229
+    // 搜索事件
230
+    search() {
231
+      this.getdata(this.formInline)
232
+    },
233
+    //显示编辑界面
234
+    handleEdit: function(index, row) {
235
+      this.editFormVisible = true
236
+      if (row != undefined && row != 'undefined') {
237
+        this.title = '修改'
238
+        this.editForm.deptId = row.deptId
239
+        this.editForm.deptName = row.deptName
240
+        this.editForm.deptNo = row.deptNo
241
+      } else {
242
+        this.title = '添加'
243
+        this.editForm.deptId = ''
244
+        this.editForm.deptName = ''
245
+        this.editForm.deptNo = ''
246
+      }
247
+    },
248
+    // 编辑、增加页面保存方法
249
+    submitForm(editData) {
250
+      this.$refs[editData].validate(valid => {
251
+        if (valid) {
252
+          deptSave(this.editForm)
253
+            .then(res => {
254
+              this.editFormVisible = false
255
+              this.loading = false
256
+              if (res.success) {
257
+                this.getdata(this.formInline)
258
+                this.$message({
259
+                  type: 'success',
260
+                  message: '公司保存成功!'
261
+                })
262
+              } else {
263
+                this.$message({
264
+                  type: 'info',
265
+                  message: res.msg
266
+                })
267
+              }
268
+            })
269
+            .catch(err => {
270
+              this.editFormVisible = false
271
+              this.loading = false
272
+              this.$message.error('公司保存失败,请稍后再试!')
273
+            })
274
+        } else {
275
+          return false
276
+        }
277
+      })
278
+    },
279
+    // 删除公司
280
+    deleteUser(index, row) {
281
+      this.$confirm('确定要删除吗?', '信息', {
282
+        confirmButtonText: '确定',
283
+        cancelButtonText: '取消',
284
+        type: 'warning'
285
+      })
286
+        .then(() => {
287
+          deptDelete(row.deptId)
288
+            .then(res => {
289
+              if (res.success) {
290
+                this.$message({
291
+                  type: 'success',
292
+                  message: '公司已删除!'
293
+                })
294
+                this.getdata(this.formInline)
295
+              } else {
296
+                this.$message({
297
+                  type: 'info',
298
+                  message: res.msg
299
+                })
300
+              }
301
+            })
302
+            .catch(err => {
303
+              this.loading = false
304
+              this.$message.error('公司删除失败,请稍后再试!')
305
+            })
306
+        })
307
+        .catch(() => {
308
+          this.$message({
309
+            type: 'info',
310
+            message: '已取消删除'
311
+          })
312
+        })
313
+    },
314
+    // 关闭编辑、增加弹出框
315
+    closeDialog() {
316
+      this.editFormVisible = false
317
+    }
318
+  }
319
+}
320
+</script>
321
+
322
+<style scoped>
323
+.user-search {
324
+  margin-top: 20px;
325
+}
326
+.userRole {
327
+  width: 100%;
328
+}
329
+</style>
330
+
331
+ 
332
+ 

+ 97
- 0
src/views/index.vue ファイルの表示

@@ -0,0 +1,97 @@
1
+<template>
2
+  <!-- <el-container class="index-con">
3
+    <el-header class="index-header">
4
+      <navcon></navcon>
5
+    </el-header>
6
+    <el-container class="index-con">
7
+      <el-aside :class="showclass">
8
+        <leftnav></leftnav>
9
+      </el-aside>
10
+      <el-container class="main-con">
11
+        <el-main clss="index-main">
12
+          <router-view></router-view>
13
+        </el-main>
14
+      </el-container>
15
+    </el-container>
16
+  </el-container> -->
17
+
18
+  <el-container class="index-con">
19
+    <el-aside :class="showclass">
20
+      <leftnav></leftnav>
21
+    </el-aside>
22
+    <el-container class="main-con">
23
+      <el-header class="index-header">
24
+        <navcon></navcon>
25
+      </el-header>
26
+      <el-main clss="index-main">
27
+        <router-view></router-view>
28
+      </el-main>
29
+    </el-container>
30
+  </el-container>
31
+</template>
32
+<script>
33
+// 导入组件
34
+import navcon from '../components/navcon.vue'
35
+import leftnav from '../components/leftnav.vue'
36
+export default {
37
+  name: 'index',
38
+  data() {
39
+    return {
40
+      showclass: 'asideshow',
41
+      showtype: false
42
+    }
43
+  },
44
+  // 注册组件
45
+  components: {
46
+    navcon,
47
+    leftnav
48
+  },
49
+  methods: {},
50
+  created() {
51
+    // 监听
52
+    this.$root.Bus.$on('toggle', value => {
53
+      if (value) {
54
+        this.showclass = 'asideshow'
55
+      } else {
56
+        setTimeout(() => {
57
+          this.showclass = 'aside'
58
+        }, 300)
59
+      }
60
+    })
61
+  },
62
+  beforeUpdate() {},
63
+  // 挂载前状态(里面是操作)
64
+  beforeMount() {
65
+    // 弹出登录成功
66
+    this.$message({
67
+      message: '登录成功',
68
+      type: 'success'
69
+    })
70
+  }
71
+}
72
+</script>
73
+<style >
74
+.index-con {
75
+  height: 100%;
76
+  width: 100%;
77
+  box-sizing: border-box;
78
+}
79
+
80
+.aside {
81
+  width: 64px !important;
82
+  height: 100%;
83
+  background-color: #334157;
84
+  margin: 0px;
85
+}
86
+.asideshow {
87
+  width: 240px !important;
88
+  height: 100%;
89
+  background-color: #334157;
90
+  margin: 0px;
91
+}
92
+.index-header,
93
+.index-main {
94
+  padding: 0px;
95
+  border-left: 2px solid #333;
96
+}
97
+</style>

+ 166
- 0
src/views/login.vue
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 18
- 0
src/views/machine/Machine.vue ファイルの表示

@@ -0,0 +1,18 @@
1
+/**
2
+ * 基础菜单 机器信息管理
3
+ */
4
+<template>
5
+  <div>基础菜单 机器信息管理</div>
6
+</template>
7
+
8
+<script>
9
+export default {
10
+
11
+}
12
+</script>
13
+
14
+<style>
15
+
16
+</style>
17
+
18
+ 

+ 18
- 0
src/views/machine/MachineAisle.vue ファイルの表示

@@ -0,0 +1,18 @@
1
+/**
2
+ * 基础菜单 货道信息管理
3
+ */
4
+<template>
5
+  <div>基础菜单 货道信息管理</div>
6
+</template>
7
+
8
+<script>
9
+export default {
10
+
11
+}
12
+</script>
13
+
14
+<style>
15
+
16
+</style>
17
+
18
+ 

+ 401
- 0
src/views/machine/MachineConfig.vue ファイルの表示

@@ -0,0 +1,401 @@
1
+/**
2
+ * 支付管理 支付配置信息
3
+ */
4
+<template>
5
+  <div>
6
+    <!-- 面包屑导航 -->
7
+    <el-breadcrumb separator-class="el-icon-arrow-right">
8
+      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
9
+      <el-breadcrumb-item>支付配置信息</el-breadcrumb-item>
10
+    </el-breadcrumb>
11
+    <!-- 搜索筛选 -->
12
+    <el-form :inline="true" :model="formInline" class="user-search">
13
+      <el-form-item label="搜索:">
14
+        <el-input size="small" v-model="formInline.machineNo" placeholder="输入终端号"></el-input>
15
+      </el-form-item>
16
+      <el-form-item>
17
+        <el-button size="small" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
18
+        <el-button size="small" type="primary" icon="el-icon-plus" @click="handleEdit()">添加</el-button>
19
+      </el-form-item>
20
+    </el-form>
21
+    <!--列表-->
22
+    <el-table size="small" :data="listData" highlight-current-row v-loading="loading" border element-loading-text="拼命加载中" style="width: 100%;">
23
+      <el-table-column align="center" type="selection" width="60">
24
+      </el-table-column>
25
+      <el-table-column sortable prop="machineNo" label="终端号" width="200">
26
+      </el-table-column>
27
+      <el-table-column sortable prop="payType" label="支付方式" width="200">
28
+      </el-table-column>
29
+      <el-table-column sortable prop="configName" label="显示名称" width="200">
30
+      </el-table-column>
31
+      <el-table-column sortable prop="payOpen" label="状态" width="200">
32
+      </el-table-column>
33
+      <el-table-column sortable prop="editTime" label="修改时间" width="200">
34
+        <template slot-scope="scope">
35
+          <div>{{scope.row.editTime|timestampToTime}}</div>
36
+          </el-switch>
37
+        </template>
38
+      </el-table-column>
39
+      <el-table-column sortable prop="editUser" label="修改人" width="150">
40
+      </el-table-column>
41
+      <el-table-column align="center" label="操作" min-width="300">
42
+        <template slot-scope="scope">
43
+          <el-button size="mini" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
44
+          <el-button size="mini" type="danger" @click="deleteUser(scope.$index, scope.row)">删除</el-button>
45
+        </template>
46
+      </el-table-column>
47
+    </el-table>
48
+    <!-- 分页组件 -->
49
+    <Pagination v-bind:child-msg="pageparm" @callFather="callFather"></Pagination>
50
+    <!-- 编辑界面 -->
51
+    <el-dialog :title="title" :visible.sync="editFormVisible" width="30%" @click="closeDialog">
52
+      <el-form label-width="120px" :model="editForm" :rules="rules" ref="editForm">
53
+        <el-form-item label="终端号" prop="machineNo">
54
+          <el-input size="small" v-model="editForm.machineNo" auto-complete="off" placeholder="请输入终端号"></el-input>
55
+        </el-form-item>
56
+        <el-form-item label="支付方式" prop="payType">
57
+          <el-select size="small" v-model="editForm.payType" placeholder="请选择" class="userRole">
58
+            <el-option v-for="type in payType" :label="type.key" :value="type.value" :key="type.value"></el-option>
59
+          </el-select>
60
+        </el-form-item>
61
+        <el-form-item label="配置序号" prop="configId">
62
+          <el-input size="small" v-model="editForm.configId" auto-complete="off" placeholder="请输入配置序号"></el-input>
63
+        </el-form-item>
64
+        <el-form-item label="显示名称" prop="configName">
65
+          <el-input size="small" v-model="editForm.configName" auto-complete="off" placeholder="请输入显示名称"></el-input>
66
+        </el-form-item>
67
+        <el-form-item label="状态" prop="payOpen">
68
+          <el-select size="small" v-model="editForm.payOpen" placeholder="请选择" class="userRole">
69
+            <el-option label="正常" value="T"></el-option>
70
+            <el-option label="禁用" value="N"></el-option>
71
+          </el-select>
72
+        </el-form-item>
73
+      </el-form>
74
+      <div slot="footer" class="dialog-footer">
75
+        <el-button size="small" @click="closeDialog">取消</el-button>
76
+        <el-button size="small" type="primary" :loading="loading" class="title" @click="submitForm('editForm')">保存</el-button>
77
+      </div>
78
+    </el-dialog>
79
+  </div>
80
+</template>
81
+
82
+<script>
83
+import {
84
+  MachineConfigList,
85
+  MachineConfigSave,
86
+  MachineConfigDelete
87
+} from '../../api/payMG'
88
+import Pagination from '../../components/Pagination'
89
+export default {
90
+  data() {
91
+    return {
92
+      nshow: true, //switch开启
93
+      fshow: false, //switch关闭
94
+      loading: false, //是显示加载
95
+      editFormVisible: false, //控制编辑页面显示与隐藏
96
+      title: '添加',
97
+      payType: [
98
+        { key: '现金', value: 1 },
99
+        { key: '支付宝', value: 2 },
100
+        { key: '微信', value: 3 },
101
+        { key: 'POS通', value: 4 },
102
+        { key: '闪付', value: 5 },
103
+        { key: 'POS通C扫B', value: 6 },
104
+        { key: '银联二维码', value: 8 },
105
+        { key: '会员余额支付', value: 9 }
106
+      ],
107
+      editForm: {
108
+        tcId: '',
109
+        machineNo: '',
110
+        payType: '',
111
+        configId: '',
112
+        configName: '',
113
+        payOpen: '',
114
+        token: localStorage.getItem('logintoken')
115
+      },
116
+      // rules表单验证
117
+      rules: {
118
+        machineNo: [
119
+          { required: true, message: '请输入终端号', trigger: 'blur' }
120
+        ],
121
+        payType: [
122
+          { required: true, message: '请选择支付方式', trigger: 'blur' }
123
+        ],
124
+        configId: [
125
+          { required: true, message: '请输入配置序号', trigger: 'blur' }
126
+        ],
127
+        configName: [
128
+          { required: true, message: '请输入显示名称', trigger: 'blur' }
129
+        ],
130
+        payOpen: [{ required: true, message: '请选择状态', trigger: 'blur' }]
131
+      },
132
+      formInline: {
133
+        page: 1,
134
+        limit: 10,
135
+        varLable: '',
136
+        varName: '',
137
+        token: localStorage.getItem('logintoken')
138
+      },
139
+      // 删除部门
140
+      seletedata: {
141
+        ids: '',
142
+        token: localStorage.getItem('logintoken')
143
+      },
144
+      userparm: [], //搜索权限
145
+      listData: [], //用户数据
146
+      // 分页参数
147
+      pageparm: {
148
+        currentPage: 1,
149
+        pageSize: 10,
150
+        total: 10
151
+      }
152
+    }
153
+  },
154
+  // 注册组件
155
+  components: {
156
+    Pagination
157
+  },
158
+  /**
159
+   * 数据发生改变
160
+   */
161
+
162
+  /**
163
+   * 创建完毕
164
+   */
165
+  created() {
166
+    this.getdata(this.formInline)
167
+  },
168
+
169
+  /**
170
+   * 里面的方法只有被调用才会执行
171
+   */
172
+  methods: {
173
+    // 获取公司列表
174
+    getdata(parameter) {
175
+      this.loading = true
176
+      // 模拟数据
177
+      let res = {
178
+        code: 0,
179
+        msg: null,
180
+        count: 5,
181
+        data: [
182
+          {
183
+            addUser: null,
184
+            editUser: null,
185
+            addTime: null,
186
+            editTime: 1524046759000,
187
+            tcId: 1,
188
+            deptId: 1,
189
+            machineNo: '564565656666',
190
+            payType: 3,
191
+            payOpen: 'T',
192
+            configId: 63,
193
+            configName: '微信',
194
+            posNo: '098'
195
+          },
196
+          {
197
+            addUser: null,
198
+            editUser: null,
199
+            addTime: null,
200
+            editTime: null,
201
+            tcId: 2,
202
+            deptId: 1,
203
+            machineNo: '66666666',
204
+            payType: 2,
205
+            payOpen: 'T',
206
+            configId: 64,
207
+            configName: '支付宝',
208
+            posNo: null
209
+          },
210
+          {
211
+            addUser: null,
212
+            editUser: null,
213
+            addTime: null,
214
+            editTime: null,
215
+            tcId: 3,
216
+            deptId: 1,
217
+            machineNo: '93066545645546500791',
218
+            payType: 6,
219
+            payOpen: 'T',
220
+            configId: 67,
221
+            configName: '银商微信、支付宝',
222
+            posNo: null
223
+          },
224
+          {
225
+            addUser: null,
226
+            editUser: null,
227
+            addTime: null,
228
+            editTime: null,
229
+            tcId: 4,
230
+            deptId: 1,
231
+            machineNo: '65545656565',
232
+            payType: 6,
233
+            payOpen: 'T',
234
+            configId: 67,
235
+            configName: '银商微信、支付宝',
236
+            posNo: null
237
+          },
238
+          {
239
+            addUser: null,
240
+            editUser: null,
241
+            addTime: 1527409037000,
242
+            editTime: 1527409037000,
243
+            tcId: 6,
244
+            deptId: 1,
245
+            machineNo: '565654545454545',
246
+            payType: 6,
247
+            payOpen: 'T',
248
+            configId: 96,
249
+            configName: '微信',
250
+            posNo: null
251
+          }
252
+        ]
253
+      }
254
+      this.loading = false
255
+      this.listData = res.data
256
+      // 分页赋值
257
+      this.pageparm.currentPage = this.formInline.page
258
+      this.pageparm.pageSize = this.formInline.limit
259
+      this.pageparm.total = res.count
260
+      // 模拟数据结束
261
+
262
+      /***
263
+       * 调用接口,注释上面模拟数据 取消下面注释
264
+       */
265
+      // MachineConfigList(parameter)
266
+      //   .then(res => {
267
+      //     this.loading = false
268
+      //     if (res.success == false) {
269
+      //       this.$message({
270
+      //         type: 'info',
271
+      //         message: res.msg
272
+      //       })
273
+      //     } else {
274
+      //       this.listData = res.data
275
+      //       // 分页赋值
276
+      //       this.pageparm.currentPage = this.formInline.page
277
+      //       this.pageparm.pageSize = this.formInline.limit
278
+      //       this.pageparm.total = res.count
279
+      //     }
280
+      //   })
281
+      //   .catch(err => {
282
+      //     this.loading = false
283
+      //     this.$message.error('菜单加载失败,请稍后再试!')
284
+      //   })
285
+    },
286
+    // 分页插件事件
287
+    callFather(parm) {
288
+      this.formInline.page = parm.currentPage
289
+      this.formInline.limit = parm.pageSize
290
+      this.getdata(this.formInline)
291
+    },
292
+    // 搜索事件
293
+    search() {
294
+      this.getdata(this.formInline)
295
+    },
296
+    //显示编辑界面
297
+    handleEdit: function(index, row) {
298
+      this.editFormVisible = true
299
+      if (row != undefined && row != 'undefined') {
300
+        this.title = '修改'
301
+        this.editForm.tcId = row.tcId
302
+        this.editForm.machineNo = row.machineNo
303
+        this.editForm.configId = row.configId
304
+        this.editForm.payType = row.payType
305
+        this.editForm.configName = row.configName
306
+        this.editForm.payOpen = row.payOpen
307
+      } else {
308
+        this.title = '添加'
309
+        this.editForm.tcId = ''
310
+        this.editForm.machineNo = ''
311
+        this.editForm.payType = ''
312
+        this.editForm.configId = ''
313
+        this.editForm.configName = ''
314
+        this.editForm.payOpen = ''
315
+      }
316
+    },
317
+    // 编辑、增加页面保存方法
318
+    submitForm(editData) {
319
+      this.$refs[editData].validate(valid => {
320
+        if (valid) {
321
+          MachineConfigSave(this.editForm)
322
+            .then(res => {
323
+              this.editFormVisible = false
324
+              this.loading = false
325
+              if (res.success) {
326
+                this.getdata(this.formInline)
327
+                this.$message({
328
+                  type: 'success',
329
+                  message: '公司保存成功!'
330
+                })
331
+              } else {
332
+                this.$message({
333
+                  type: 'info',
334
+                  message: res.msg
335
+                })
336
+              }
337
+            })
338
+            .catch(err => {
339
+              this.editFormVisible = false
340
+              this.loading = false
341
+              this.$message.error('支付配置信息保存失败,请稍后再试!')
342
+            })
343
+        } else {
344
+          return false
345
+        }
346
+      })
347
+    },
348
+    // 删除公司
349
+    deleteUser(index, row) {
350
+      this.$confirm('确定要删除吗?', '信息', {
351
+        confirmButtonText: '确定',
352
+        cancelButtonText: '取消',
353
+        type: 'warning'
354
+      })
355
+        .then(() => {
356
+          MachineConfigDelete(row.deptId)
357
+            .then(res => {
358
+              if (res.success) {
359
+                this.$message({
360
+                  type: 'success',
361
+                  message: '公司已删除!'
362
+                })
363
+                this.getdata(this.formInline)
364
+              } else {
365
+                this.$message({
366
+                  type: 'info',
367
+                  message: res.msg
368
+                })
369
+              }
370
+            })
371
+            .catch(err => {
372
+              this.loading = false
373
+              this.$message.error('支付配置信息删除失败,请稍后再试!')
374
+            })
375
+        })
376
+        .catch(() => {
377
+          this.$message({
378
+            type: 'info',
379
+            message: '已取消删除'
380
+          })
381
+        })
382
+    },
383
+    // 关闭编辑、增加弹出框
384
+    closeDialog() {
385
+      this.editFormVisible = false
386
+    }
387
+  }
388
+}
389
+</script>
390
+
391
+<style scoped>
392
+.user-search {
393
+  margin-top: 20px;
394
+}
395
+.userRole {
396
+  width: 100%;
397
+}
398
+</style>
399
+
400
+ 
401
+ 

+ 610
- 0
src/views/pay/Config.vue ファイルの表示

@@ -0,0 +1,610 @@
1
+/**
2
+ * 支付管理 支付配置
3
+ */
4
+<template>
5
+  <div>
6
+    <!-- 面包屑导航 -->
7
+    <el-breadcrumb separator-class="el-icon-arrow-right">
8
+      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
9
+      <el-breadcrumb-item>支付配置</el-breadcrumb-item>
10
+    </el-breadcrumb>
11
+    <!-- 搜索筛选 -->
12
+    <el-form :inline="true" :model="formInline" class="user-search">
13
+      <el-form-item label="搜索:">
14
+        <el-input size="small" v-model="formInline.name" placeholder="输入名称"></el-input>
15
+      </el-form-item>
16
+      <el-form-item>
17
+        <el-select size="small" v-model="formInline.payType" placeholder="请选择">
18
+          <el-option v-for="type in payType" :label="type.key" :value="type.value" :key="type.value"></el-option>
19
+        </el-select>
20
+      </el-form-item>
21
+      <el-form-item label="">
22
+        <el-input size="small" v-model="formInline.partner" placeholder="输入商户号"></el-input>
23
+      </el-form-item>
24
+      <el-form-item>
25
+        <el-button size="small" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
26
+        <el-button size="small" type="primary" icon="el-icon-plus" @click="handleEdit()">添加</el-button>
27
+      </el-form-item>
28
+    </el-form>
29
+    <!--列表-->
30
+    <el-table size="small" :data="listData" highlight-current-row v-loading="loading" border element-loading-text="拼命加载中" style="width: 100%;">
31
+      <el-table-column align="center" type="index" width="60">
32
+      </el-table-column>
33
+      <el-table-column sortable prop="name" label="名称" width="200" show-overflow-tooltip>
34
+      </el-table-column>
35
+      <el-table-column sortable prop="payType" label="支付类型" width="120" show-overflow-tooltip>
36
+      </el-table-column>
37
+      <el-table-column sortable prop="partner" label="商户号" width="100" show-overflow-tooltip>
38
+      </el-table-column>
39
+      <el-table-column sortable prop="subMchId" label="微信子商户" width="140" show-overflow-tooltip>
40
+      </el-table-column>
41
+      <el-table-column sortable prop="appid" label="应用ID" width="100" show-overflow-tooltip>
42
+      </el-table-column>
43
+      <el-table-column sortable prop="signType" label="加密类型" width="120" show-overflow-tooltip>
44
+      </el-table-column>
45
+      <el-table-column sortable prop="partnerKey" label="商户签名密钥" width="180" show-overflow-tooltip>
46
+      </el-table-column>
47
+      <el-table-column sortable prop="notifyUrl" label="通知回调" width="140" show-overflow-tooltip>
48
+      </el-table-column>
49
+      <el-table-column sortable prop="sellerUserId" label="支付宝卖家" width="150" show-overflow-tooltip>
50
+      </el-table-column>
51
+      <el-table-column sortable prop="certPath" label="微信证书路径" width="150" show-overflow-tooltip>
52
+      </el-table-column>
53
+      <el-table-column align="center" label="操作" min-width="150">
54
+        <template slot-scope="scope">
55
+          <el-button size="mini" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
56
+          <el-button size="mini" type="danger" @click="deleteUser(scope.$index, scope.row)">删除</el-button>
57
+        </template>
58
+      </el-table-column>
59
+    </el-table>
60
+    <!-- 分页组件 -->
61
+    <Pagination v-bind:child-msg="pageparm" @callFather="callFather"></Pagination>
62
+    <!-- 编辑界面 -->
63
+    <el-dialog :title="title" :visible.sync="editFormVisible" width="30%" @click="closeDialog('editForm')">
64
+      <el-form label-width="120px" :model="editForm" :rules="rules" ref="editForm">
65
+        <el-form-item label="名称" prop="name">
66
+          <el-input size="small" v-model="editForm.name" auto-complete="off" placeholder="请输入名称"></el-input>
67
+        </el-form-item>
68
+        <el-form-item label="支付类型" prop="payType">
69
+          <el-select size="small" v-model="editForm.payType" placeholder="请选择" class="userRole">
70
+            <el-option v-for="type in payType" :label="type.key" :value="type.value" :key="type.value"></el-option>
71
+          </el-select>
72
+        </el-form-item>
73
+        <el-form-item label="商户号" prop="partner">
74
+          <el-input size="small" v-model="editForm.partner" auto-complete="off" placeholder="请输入商户号"></el-input>
75
+        </el-form-item>
76
+        <el-form-item label="微信子商户" prop="subMchId">
77
+          <el-input size="small" v-model="editForm.subMchId" auto-complete="off" placeholder="请输入微信子商户"></el-input>
78
+        </el-form-item>
79
+        <el-form-item label="应用ID" prop="appid">
80
+          <el-input size="small" v-model="editForm.appid" auto-complete="off" placeholder="请输入应用ID"></el-input>
81
+        </el-form-item>
82
+        <el-form-item label="通知回调" prop="notifyUrl">
83
+          <el-input size="small" v-model="editForm.notifyUrl" auto-complete="off" placeholder="请输入通知回调"></el-input>
84
+        </el-form-item>
85
+        <el-form-item label="加密类型" prop="signType">
86
+          <el-input size="small" v-model="editForm.signType" auto-complete="off" placeholder="请输入加密类型"></el-input>
87
+        </el-form-item>
88
+        <el-form-item label="商户签名密钥" prop="partnerKey">
89
+          <el-input size="small" v-model="editForm.partnerKey" auto-complete="off" placeholder="请输入商户签名密钥"></el-input>
90
+        </el-form-item>
91
+        <el-form-item label="支付宝卖家" prop="sellerUserId">
92
+          <el-input size="small" v-model="editForm.sellerUserId" auto-complete="off" placeholder="请输入支付宝卖家"></el-input>
93
+        </el-form-item>
94
+        <el-form-item label="微信证书路径" prop="certPath">
95
+          <el-input size="small" v-model="editForm.certPath" auto-complete="off" placeholder="请输入微信证书路径"></el-input>
96
+        </el-form-item>
97
+        <el-form-item label="微信证书密码" prop="certPassword">
98
+          <el-input size="small" v-model="editForm.certPassword" auto-complete="off" placeholder="请输入微信证书密码"></el-input>
99
+        </el-form-item>
100
+        <el-form-item label="支付宝私钥" prop="rsaKey">
101
+          <el-input size="small" v-model="editForm.rsaKey" auto-complete="off" placeholder="请输入支付宝私钥"></el-input>
102
+        </el-form-item>
103
+      </el-form>
104
+      <div slot="footer" class="dialog-footer">
105
+        <el-button size="small" @click="closeDialog('editForm')">取消</el-button>
106
+        <el-button size="small" type="primary" :loading="loading" class="title" @click="submitForm('editForm')">保存</el-button>
107
+      </div>
108
+    </el-dialog>
109
+  </div>
110
+</template>
111
+
112
+<script>
113
+import { ConfigList, ConfigSave, ConfigDelete } from '../../api/payMG'
114
+import Pagination from '../../components/Pagination'
115
+export default {
116
+  data() {
117
+    return {
118
+      loading: false, //是显示加载
119
+      editFormVisible: false, //控制编辑页面显示与隐藏
120
+      title: '添加',
121
+      payType: [
122
+        { key: '请选择', value: 0 },
123
+        { key: '现金', value: 1 },
124
+        { key: '支付宝', value: 2 },
125
+        { key: '微信', value: 3 },
126
+        { key: 'POS通', value: 4 },
127
+        { key: '闪付', value: 5 },
128
+        { key: 'POS通C扫B', value: 6 },
129
+        { key: '银联二维码', value: 8 },
130
+        { key: '会员余额支付', value: 9 }
131
+      ],
132
+      editForm: {
133
+        id: '',
134
+        name: '',
135
+        payType: 1,
136
+        partner: '',
137
+        subMchId: '',
138
+        appid: '',
139
+        notifyUrl: '',
140
+        signType: '',
141
+        partnerKey: '',
142
+        sellerUserId: '',
143
+        certPath: '',
144
+        certPassword: '',
145
+        rsaKey: '',
146
+        token: localStorage.getItem('logintoken')
147
+      },
148
+      // rules表单验证
149
+      rules: {
150
+        name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
151
+        payType: [
152
+          { required: true, message: '请选择支付方式', trigger: 'blur' }
153
+        ],
154
+        partner: [{ required: true, message: '请输入商户号', trigger: 'blur' }],
155
+        subMchId: [
156
+          { required: true, message: '请输入微信子商户号', trigger: 'blur' }
157
+        ],
158
+        appid: [{ required: true, message: '请输入应用ID', trigger: 'blur' }],
159
+        notifyUrl: [
160
+          { required: true, message: '请输入通知回调', trigger: 'blur' }
161
+        ],
162
+        signType: [
163
+          { required: true, message: '请输入加密类型', trigger: 'blur' }
164
+        ],
165
+        partnerKey: [
166
+          { required: true, message: '请输入商户签名密钥', trigger: 'blur' }
167
+        ],
168
+        sellerUserId: [
169
+          { required: true, message: '请输入支付宝卖家', trigger: 'blur' }
170
+        ],
171
+        certPath: [
172
+          { required: true, message: '请输入微信证书路径', trigger: 'blur' }
173
+        ],
174
+        certPassword: [
175
+          { required: true, message: '请输入微信证书密码', trigger: 'blur' }
176
+        ],
177
+        rsaKey: [
178
+          { required: true, message: '请输入支付宝私钥', trigger: 'blur' }
179
+        ]
180
+      },
181
+      formInline: {
182
+        page: 1,
183
+        limit: 10,
184
+        name: '',
185
+        payType: 0,
186
+        partner: '',
187
+        token: localStorage.getItem('logintoken')
188
+      },
189
+      // 删除部门
190
+      seletedata: {
191
+        ids: '',
192
+        token: localStorage.getItem('logintoken')
193
+      },
194
+      userparm: [], //搜索权限
195
+      listData: [], //用户数据
196
+      // 分页参数
197
+      pageparm: {
198
+        currentPage: 1,
199
+        pageSize: 10,
200
+        total: 10
201
+      }
202
+    }
203
+  },
204
+  // 注册组件
205
+  components: {
206
+    Pagination
207
+  },
208
+  /**
209
+   * 数据发生改变
210
+   */
211
+
212
+  /**
213
+   * 创建完毕
214
+   */
215
+  created() {
216
+    this.getdata(this.formInline)
217
+  },
218
+
219
+  /**
220
+   * 里面的方法只有被调用才会执行
221
+   */
222
+  methods: {
223
+    // 获取公司列表
224
+    getdata(parameter) {
225
+      this.loading = true
226
+      // 模拟数据
227
+      let res = {
228
+        code: 0,
229
+        msg: null,
230
+        count: 207,
231
+        data: [
232
+          {
233
+            addUser: null,
234
+            editUser: null,
235
+            addTime: null,
236
+            editTime: null,
237
+            id: 1,
238
+            name: '支付宝2.0',
239
+            payType: 1,
240
+            partner: '2015122801047567',
241
+            subMchId: '',
242
+            appid: '2015122801047567',
243
+            notifyUrl: 'r/pay/alipay/notify',
244
+            signType: 'RSA',
245
+            partnerKey: '==',
246
+            sellerUserId: '2088121360144859',
247
+            certPath: '',
248
+            certPassword: '',
249
+            rsaKey: '',
250
+            deptId: null
251
+          },
252
+          {
253
+            addUser: null,
254
+            editUser: null,
255
+            addTime: null,
256
+            editTime: null,
257
+            id: 2,
258
+            name: 'zzzzzz',
259
+            payType: 2,
260
+            partner: '1250856201',
261
+            subMchId: null,
262
+            appid: 'wx3ef7713adf0a97b8',
263
+            notifyUrl: null,
264
+            signType: 'NATIVE',
265
+            partnerKey: '2e3cdaf5aa051c16563c0b8916184d5d',
266
+            sellerUserId: null,
267
+            certPath:
268
+              '/usr/local/tomcat_provider/webapps/machine-service-provider-0.0.1-SNAPSHOT/conf/apiclient_cert_1250856201.p12',
269
+            certPassword: '1250856201',
270
+            rsaKey: null,
271
+            deptId: null
272
+          },
273
+          {
274
+            addUser: null,
275
+            editUser: null,
276
+            addTime: null,
277
+            editTime: null,
278
+            id: 3,
279
+            name: ' 待删除',
280
+            payType: 2,
281
+            partner: '1271942301',
282
+            subMchId: '1273729701',
283
+            appid: 'wx3ef7713adf0a97b8',
284
+            notifyUrl: '/pay/wx/notify',
285
+            signType: 'NATIVE',
286
+            partnerKey: '2e3cdaf5aa051c16563c0b8916184d5d',
287
+            sellerUserId: '',
288
+            certPath:
289
+              '/usr/local/tomcat_provider/webapps/machine-service-provider-0.0.1-SNAPSHOT/conf/apiclient_cert_1271942301.p12',
290
+            certPassword: '1271942301',
291
+            rsaKey: null,
292
+            deptId: null
293
+          },
294
+          {
295
+            addUser: null,
296
+            editUser: null,
297
+            addTime: null,
298
+            editTime: null,
299
+            id: 5,
300
+            name: '微信301',
301
+            payType: 2,
302
+            partner: '1271942301',
303
+            subMchId: '1341564201',
304
+            appid: 'wx3ef7713adf0a97b8',
305
+            notifyUrl: 'er/pay/wx/notify',
306
+            signType: 'NATIVE',
307
+            partnerKey: '2e3cdaf5aa051c16563c0b8916184d5d',
308
+            sellerUserId: null,
309
+            certPath:
310
+              '/usr/local/tomcat_provider/webapps/---0.0.1-SNAPSHOT/conf/apiclient_cert_1271942301.p12',
311
+            certPassword: '1271942301',
312
+            rsaKey: null,
313
+            deptId: null
314
+          },
315
+          {
316
+            addUser: null,
317
+            editUser: null,
318
+            addTime: null,
319
+            editTime: null,
320
+            id: 6,
321
+            name: '微信301',
322
+            payType: 2,
323
+            partner: '1271942301',
324
+            subMchId: '1284797101',
325
+            appid: 'wx3ef7713adf0a97b8',
326
+            notifyUrl:
327
+              'http://180.166.211.210:8114/machine-pay-consumer/pay/wx/notify',
328
+            signType: 'NATIVE',
329
+            partnerKey: '2e3cdaf5aa051c16563c0b8916184d5d',
330
+            sellerUserId: null,
331
+            certPath:
332
+              '/usr/local/tomcat_provider/webapps/--provider-0.0.1-SNAPSHOT/conf/apiclient_cert_1271942301.p12',
333
+            certPassword: '1271942301',
334
+            rsaKey: null,
335
+            deptId: null
336
+          },
337
+          {
338
+            addUser: null,
339
+            editUser: null,
340
+            addTime: null,
341
+            editTime: null,
342
+            id: 7,
343
+            name: '微信301',
344
+            payType: 2,
345
+            partner: '1271942301',
346
+            subMchId: '1277531101',
347
+            appid: 'wx3ef7713adf0a97b8',
348
+            notifyUrl:
349
+              'http://180.166.211.210:8114/machine-pay-consumer/pay/wx/notify',
350
+            signType: 'NATIVE',
351
+            partnerKey: '2e3cdaf5aa051c16563c0b8916184d5d',
352
+            sellerUserId: null,
353
+            certPath:
354
+              '/usr/local/tomcat_provider/webapps/machine-service-provider-0.0.1-SNAPSHOT/conf/apiclient_cert_1271942301.p12',
355
+            certPassword: '1271942301',
356
+            rsaKey: null,
357
+            deptId: null
358
+          },
359
+          {
360
+            addUser: null,
361
+            editUser: null,
362
+            addTime: null,
363
+            editTime: null,
364
+            id: 8,
365
+            name: '微信301',
366
+            payType: 2,
367
+            partner: '1271942301',
368
+            subMchId: '1276485301',
369
+            appid: 'wx3ef7713adf0a97b8',
370
+            notifyUrl:
371
+              'http://180.166.211.210:8114/machine-pay-consumer/pay/wx/notify',
372
+            signType: 'NATIVE',
373
+            partnerKey: '2e3cdaf5aa051c16563c0b8916184d5d',
374
+            sellerUserId: null,
375
+            certPath:
376
+              '/usr/local/tomcat_provider/webapps/machine-service-provider-0.0.1-SNAPSHOT/conf/apiclient_cert_1271942301.p12',
377
+            certPassword: '1271942301',
378
+            rsaKey: null,
379
+            deptId: null
380
+          },
381
+          {
382
+            addUser: null,
383
+            editUser: null,
384
+            addTime: null,
385
+            editTime: null,
386
+            id: 9,
387
+            name: '微信',
388
+            payType: 2,
389
+            partner: '1347158201',
390
+            subMchId: '1351034701',
391
+            appid: 'wx83a7489c10c9c952',
392
+            notifyUrl: '',
393
+            signType: 'NATIVE',
394
+            partnerKey: 'f174607ba704632b6cad2df8b04650d6',
395
+            sellerUserId: null,
396
+            certPath:
397
+              '/usr/local/tomcat_provider/webapps/machine-service-provider-0.0.1-SNAPSHOT/conf/apiclient_cert_1347158201.p12',
398
+            certPassword: '1347158201',
399
+            rsaKey: null,
400
+            deptId: null
401
+          },
402
+          {
403
+            addUser: null,
404
+            editUser: null,
405
+            addTime: null,
406
+            editTime: null,
407
+            id: 10,
408
+            name: '-微信301',
409
+            payType: 2,
410
+            partner: '1271942301',
411
+            subMchId: '1357984702',
412
+            appid: 'wx3ef7713adf0a97b8',
413
+            notifyUrl:
414
+              'http://180.166.211.210:8114/machine-pay-consumer/pay/wx/notify',
415
+            signType: 'NATIVE',
416
+            partnerKey: '2e3cdaf5aa051c16563c0b8916184d5d',
417
+            sellerUserId: null,
418
+            certPath:
419
+              '/usr/local/tomcat_provider/webapps/machine-service-provider-0.0.1-SNAPSHOT/conf/apiclient_cert_1271942301.p12',
420
+            certPassword: '1271942301',
421
+            rsaKey: null,
422
+            deptId: null
423
+          },
424
+          {
425
+            addUser: null,
426
+            editUser: null,
427
+            addTime: null,
428
+            editTime: null,
429
+            id: 11,
430
+            name: '-微信301',
431
+            payType: 2,
432
+            partner: '1271942301',
433
+            subMchId: '1357972202',
434
+            appid: 'wx3ef7713adf0a97b8',
435
+            notifyUrl:
436
+              'http://180.166.211.210:8114/machine-pay-consumer/pay/wx/notify',
437
+            signType: 'NATIVE',
438
+            partnerKey: '2e3cdaf5aa051c16563c0b8916184d5d',
439
+            sellerUserId: null,
440
+            certPath:
441
+              '/usr/local/tomcat_provider/webapps/machine-service-provider-0.0.1-SNAPSHOT/conf/apiclient_cert_1271942301.p12',
442
+            certPassword: '1271942301',
443
+            rsaKey: null,
444
+            deptId: null
445
+          }
446
+        ]
447
+      }
448
+      this.loading = false
449
+      this.listData = res.data
450
+      // 分页赋值
451
+      this.pageparm.currentPage = this.formInline.page
452
+      this.pageparm.pageSize = this.formInline.limit
453
+      this.pageparm.total = res.count
454
+      // 模拟数据结束
455
+
456
+      /***
457
+       * 调用接口,注释上面模拟数据 取消下面注释
458
+       */
459
+      // ConfigList(parameter)
460
+      //   .then(res => {
461
+      //     this.loading = false
462
+      //     if (res.success == false) {
463
+      //       this.$message({
464
+      //         type: 'info',
465
+      //         message: res.msg
466
+      //       })
467
+      //     } else {
468
+      //       this.listData = res.data
469
+      //       // 分页赋值
470
+      //       this.pageparm.currentPage = this.formInline.page
471
+      //       this.pageparm.pageSize = this.formInline.limit
472
+      //       this.pageparm.total = res.count
473
+      //     }
474
+      //   })
475
+      //   .catch(err => {
476
+      //     this.loading = false
477
+      //     this.$message.error('菜单加载失败,请稍后再试!')
478
+      //   })
479
+    },
480
+    // 分页插件事件
481
+    callFather(parm) {
482
+      this.formInline.page = parm.currentPage
483
+      this.formInline.limit = parm.pageSize
484
+      this.getdata(this.formInline)
485
+    },
486
+    // 搜索事件
487
+    search() {
488
+      this.getdata(this.formInline)
489
+    },
490
+    //显示编辑界面
491
+    handleEdit: function(index, row) {
492
+      this.editFormVisible = true
493
+      if (row != undefined && row != 'undefined') {
494
+        this.title = '修改'
495
+        this.editForm.id = row.id
496
+        this.editForm.name = row.name
497
+        this.editForm.payType = row.payType
498
+        this.editForm.partner = row.partner
499
+        this.editForm.subMchId = row.subMchId
500
+        this.editForm.appid = row.appid
501
+        this.editForm.notifyUrl = row.notifyUrl
502
+        this.editForm.signType = row.signType
503
+        this.editForm.partnerKey = row.partnerKey
504
+        this.editForm.sellerUserId = row.sellerUserId
505
+        this.editForm.certPath = row.certPath
506
+        this.editForm.certPassword = row.certPassword
507
+        this.editForm.rsaKey = row.rsaKey
508
+      } else {
509
+        this.title = '添加'
510
+        this.editForm.id = ''
511
+        this.editForm.name = ''
512
+        this.editForm.payType = ''
513
+        this.editForm.partner = ''
514
+        this.editForm.subMchId = ''
515
+        this.editForm.appid = ''
516
+        this.editForm.notifyUrl = ''
517
+        this.editForm.signType = ''
518
+        this.editForm.partnerKey = ''
519
+        this.editForm.sellerUserId = ''
520
+        this.editForm.certPath = ''
521
+        this.editForm.certPassword = ''
522
+        this.editForm.rsaKey = ''
523
+      }
524
+    },
525
+    // 编辑、增加页面保存方法
526
+    submitForm(editData) {
527
+      this.$refs[editData].validate(valid => {
528
+        if (valid) {
529
+          ConfigSave(this.editForm)
530
+            .then(res => {
531
+              this.editFormVisible = false
532
+              this.loading = false
533
+              if (res.success) {
534
+                this.getdata(this.formInline)
535
+                this.$message({
536
+                  type: 'success',
537
+                  message: '公司保存成功!'
538
+                })
539
+              } else {
540
+                this.$message({
541
+                  type: 'info',
542
+                  message: res.msg
543
+                })
544
+              }
545
+            })
546
+            .catch(err => {
547
+              this.editFormVisible = false
548
+              this.loading = false
549
+              this.$message.error('支付配置信息保存失败,请稍后再试!')
550
+            })
551
+        } else {
552
+          return false
553
+        }
554
+      })
555
+    },
556
+    // 删除公司
557
+    deleteUser(index, row) {
558
+      this.$confirm('确定要删除吗?', '信息', {
559
+        confirmButtonText: '确定',
560
+        cancelButtonText: '取消',
561
+        type: 'warning'
562
+      })
563
+        .then(() => {
564
+          ConfigDelete(row.deptId)
565
+            .then(res => {
566
+              if (res.success) {
567
+                this.$message({
568
+                  type: 'success',
569
+                  message: '公司已删除!'
570
+                })
571
+                this.getdata(this.formInline)
572
+              } else {
573
+                this.$message({
574
+                  type: 'info',
575
+                  message: res.msg
576
+                })
577
+              }
578
+            })
579
+            .catch(err => {
580
+              this.loading = false
581
+              this.$message.error('支付配置信息删除失败,请稍后再试!')
582
+            })
583
+        })
584
+        .catch(() => {
585
+          this.$message({
586
+            type: 'info',
587
+            message: '已取消删除'
588
+          })
589
+        })
590
+    },
591
+    // 关闭编辑、增加弹出框
592
+    closeDialog(formName) {
593
+      this.editFormVisible = false
594
+      this.$refs[formName].resetFields()
595
+    }
596
+  }
597
+}
598
+</script>
599
+
600
+<style scoped>
601
+.user-search {
602
+  margin-top: 20px;
603
+}
604
+.userRole {
605
+  width: 100%;
606
+}
607
+</style>
608
+
609
+ 
610
+ 

+ 631
- 0
src/views/pay/Order.vue ファイルの表示

@@ -0,0 +1,631 @@
1
+/**
2
+ * 订单管理 交易订单
3
+ */
4
+<template>
5
+  <div>
6
+    <!-- 面包屑导航 -->
7
+    <el-breadcrumb separator-class="el-icon-arrow-right">
8
+      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
9
+      <el-breadcrumb-item>交易订单</el-breadcrumb-item>
10
+    </el-breadcrumb>
11
+    <!-- 搜索筛选 -->
12
+    <el-form :inline="true" :model="formInline" class="user-search">
13
+      <el-form-item label="搜索:">
14
+        <el-input size="small" v-model="formInline.machineNo" placeholder="输入终端编号"></el-input>
15
+      </el-form-item>
16
+      <el-form-item>
17
+        <el-input size="small" v-model="formInline.orderNo" placeholder="输入订单号"></el-input>
18
+      </el-form-item>
19
+      <el-form-item>
20
+        <el-input size="small" v-model="formInline.transId" placeholder="输入交易单号"></el-input>
21
+      </el-form-item>
22
+      <el-form-item>
23
+        <el-select size="small" v-model="formInline.payType" placeholder="请选择">
24
+          <el-option v-for="type in payType" :label="type.key" :value="type.value" :key="type.value"></el-option>
25
+        </el-select>
26
+      </el-form-item>
27
+      <el-form-item>
28
+        <el-select size="small" v-model="formInline.orderStatus" placeholder="请选择">
29
+          <el-option v-for="type in payway" :label="type.key" :value="type.value" :key="type.value"></el-option>
30
+        </el-select>
31
+      </el-form-item>
32
+      <el-form-item>
33
+        <el-button size="small" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
34
+      </el-form-item>
35
+    </el-form>
36
+    <!--列表-->
37
+    <el-table size="small" :data="listData" highlight-current-row v-loading="loading" border element-loading-text="拼命加载中" style="width: 100%;">
38
+      <el-table-column align="center" type="index" width="60">
39
+      </el-table-column>
40
+      <el-table-column sortable prop="machineNo" label="终端编号" width="120" show-overflow-tooltip>
41
+      </el-table-column>
42
+      <el-table-column sortable prop="orderNo" label="订单号" width="120" show-overflow-tooltip>
43
+      </el-table-column>
44
+      <el-table-column sortable prop="transId" label="交易单号" width="120" show-overflow-tooltip>
45
+      </el-table-column>
46
+      <el-table-column sortable prop="payType" label="支付方式" width="140" show-overflow-tooltip>
47
+      </el-table-column>
48
+      <el-table-column sortable prop="transType" label="交易类型" width="120" show-overflow-tooltip>
49
+      </el-table-column>
50
+      <el-table-column sortable prop="goodsPrice" label="商品价格" width="120" show-overflow-tooltip>
51
+      </el-table-column>
52
+      <el-table-column sortable prop="payAmount" label="支付金额" width="180" show-overflow-tooltip>
53
+      </el-table-column>
54
+      <el-table-column sortable prop="goodsName" label="商品名称" width="140" show-overflow-tooltip>
55
+      </el-table-column>
56
+      <el-table-column sortable prop="orderStatus" label="订单状态" width="120" show-overflow-tooltip>
57
+      </el-table-column>
58
+      <el-table-column sortable prop="addTime" label="创建时间" width="180" show-overflow-tooltip>
59
+        <template slot-scope="scope">
60
+          <div>{{scope.row.addTime|timestampToTime}}</div>
61
+        </template>
62
+      </el-table-column>
63
+      <el-table-column align="center" label="操作" min-width="150">
64
+        <template slot-scope="scope">
65
+          <el-button size="mini" @click="handleEdit(scope.$index, scope.row)">预览</el-button>
66
+          <el-button size="mini" type="danger" @click="deleteUser(scope.$index, scope.row)">退款</el-button>
67
+        </template>
68
+      </el-table-column>
69
+    </el-table>
70
+    <!-- 分页组件 -->
71
+    <Pagination v-bind:child-msg="pageparm" @callFather="callFather"></Pagination>
72
+    <!-- 编辑界面 -->
73
+    <el-dialog :title="title" :visible.sync="editFormVisible" width="50%" @click="closeDialog('editForm')">
74
+      <el-form label-width="120px" :model="editForm" ref="editForm">
75
+        <el-row>
76
+          <el-col :span="12">
77
+            <el-form-item label="公司编号">
78
+              <el-input size="small" v-model="editForm.deptId" auto-complete="off" placeholder="请输入名称" disabled></el-input>
79
+            </el-form-item>
80
+            <el-form-item label="订单号">
81
+              <el-input size="small" v-model="editForm.orderNo" auto-complete="off" placeholder="请输入商户号" disabled></el-input>
82
+            </el-form-item>
83
+            <el-form-item label="支付方式">
84
+              <el-input size="small" v-model="editForm.payType" auto-complete="off" placeholder="请输入商户号" disabled></el-input>
85
+            </el-form-item>
86
+            <el-form-item label="交易类型">
87
+              <el-input size="small" v-model="editForm.transType" auto-complete="off" placeholder="请输入微信子商户" disabled></el-input>
88
+            </el-form-item>
89
+            <el-form-item label="商品编号">
90
+              <el-input size="small" v-model="editForm.goodsNo" auto-complete="off" placeholder="请输入应用ID" disabled></el-input>
91
+            </el-form-item>
92
+            <el-form-item label="支付金额">
93
+              <el-input size="small" v-model="editForm.payAmount" auto-complete="off" placeholder="请输入通知回调" disabled></el-input>
94
+            </el-form-item>
95
+            <el-form-item label="货道号">
96
+              <el-input size="small" v-model="editForm.aisleNo" auto-complete="off" placeholder="请输入加密类型" disabled></el-input>
97
+            </el-form-item>
98
+            <el-form-item label="买家标识">
99
+              <el-input size="small" v-model="editForm.openId" auto-complete="off" placeholder="请输入商户签名密钥" disabled></el-input>
100
+            </el-form-item>
101
+            <el-form-item label="子商户号">
102
+              <el-input size="small" v-model="editForm.subMchId" auto-complete="off" placeholder="请输入支付宝卖家" disabled></el-input>
103
+            </el-form-item>
104
+          </el-col>
105
+          <el-col :span="12">
106
+            <el-form-item label="公司名称">
107
+              <el-input size="small" v-model="editForm.deptName" auto-complete="off" placeholder="请输入名称" disabled></el-input>
108
+            </el-form-item>
109
+            <el-form-item label="交易单号">
110
+              <el-input size="small" v-model="editForm.transId" auto-complete="off" placeholder="请输入商户号" disabled></el-input>
111
+            </el-form-item>
112
+            <el-form-item label="子支付方式">
113
+              <el-input size="small" v-model="editForm.subPayType" auto-complete="off" placeholder="请输入商户号" disabled></el-input>
114
+            </el-form-item>
115
+            <el-form-item label="终端编号">
116
+              <el-input size="small" v-model="editForm.machineNo" auto-complete="off" placeholder="请输入微信子商户" disabled></el-input>
117
+            </el-form-item>
118
+            <el-form-item label="商品价格">
119
+              <el-input size="small" v-model="editForm.goodsPrice" auto-complete="off" placeholder="请输入应用ID" disabled></el-input>
120
+            </el-form-item>
121
+            <el-form-item label="商品名称">
122
+              <el-input size="small" v-model="editForm.goodsName" auto-complete="off" placeholder="请输入通知回调" disabled></el-input>
123
+            </el-form-item>
124
+            <el-form-item label="订单状态">
125
+              <el-input size="small" v-model="editForm.orderStatus" auto-complete="off" placeholder="请输入加密类型" disabled></el-input>
126
+            </el-form-item>
127
+            <el-form-item label="商户号">
128
+              <el-input size="small" v-model="editForm.mchId" auto-complete="off" placeholder="请输入商户签名密钥" disabled></el-input>
129
+            </el-form-item>
130
+            <el-form-item label="编辑用户">
131
+              <el-input size="small" v-model="editForm.editUser" auto-complete="off" placeholder="请输入支付宝卖家" disabled></el-input>
132
+            </el-form-item>
133
+          </el-col>
134
+        </el-row>
135
+        <el-form-item label="备注">
136
+          <el-input size="small" v-model="editForm.remark" auto-complete="off" placeholder="请输入微信证书路径" disabled></el-input>
137
+        </el-form-item>
138
+      </el-form>
139
+    </el-dialog>
140
+  </div>
141
+</template>
142
+
143
+<script>
144
+import { OrderList, OrderRefund, OrderDelete } from '../../api/payMG'
145
+import Pagination from '../../components/Pagination'
146
+export default {
147
+  data() {
148
+    return {
149
+      loading: false, //是显示加载
150
+      editFormVisible: false, //控制编辑页面显示与隐藏
151
+      title: '预览',
152
+      payType: [
153
+        { key: '请选择', value: 0 },
154
+        { key: '现金', value: 1 },
155
+        { key: '支付宝', value: 2 },
156
+        { key: '微信', value: 3 },
157
+        { key: 'POS通', value: 4 },
158
+        { key: '闪付', value: 5 },
159
+        { key: 'POS通C扫B', value: 6 },
160
+        { key: '银联二维码', value: 8 },
161
+        { key: '会员余额支付', value: 9 }
162
+      ],
163
+      payway: [
164
+        { key: '请选择', value: 0 },
165
+        { key: '初始化', value: 1 },
166
+        { key: '已支付', value: 2 },
167
+        { key: '出货成功', value: 3 },
168
+        { key: '出货失败', value: 4 },
169
+        { key: '订单超时', value: 5 },
170
+        { key: '退款初始化', value: 11 },
171
+        { key: '退款进行中', value: 12 },
172
+        { key: '退款成功', value: 13 },
173
+        { key: '退款失败', value: 14 },
174
+        { key: '订单处理中', value: 10 }
175
+      ],
176
+      editForm: {
177
+        id: '',
178
+        name: '',
179
+        payType: 1,
180
+        partner: '',
181
+        subMchId: '',
182
+        appid: '',
183
+        notifyUrl: '',
184
+        signType: '',
185
+        partnerKey: '',
186
+        sellerUserId: '',
187
+        certPath: '',
188
+        certPassword: '',
189
+        rsaKey: '',
190
+        token: localStorage.getItem('logintoken')
191
+      },
192
+      formInline: {
193
+        page: 1,
194
+        limit: 10,
195
+        machineNo: '',
196
+        orderNo: '',
197
+        transId: '',
198
+        payType: 0,
199
+        orderStatus: 0,
200
+        token: localStorage.getItem('logintoken')
201
+      },
202
+      // 删除部门
203
+      seletedata: {
204
+        ids: '',
205
+        token: localStorage.getItem('logintoken')
206
+      },
207
+      userparm: [], //搜索权限
208
+      listData: [], //用户数据
209
+      // 分页参数
210
+      pageparm: {
211
+        currentPage: 1,
212
+        pageSize: 10,
213
+        total: 10
214
+      }
215
+    }
216
+  },
217
+  // 注册组件
218
+  components: {
219
+    Pagination
220
+  },
221
+  /**
222
+   * 数据发生改变
223
+   */
224
+
225
+  /**
226
+   * 创建完毕
227
+   */
228
+  created() {
229
+    this.getdata(this.formInline)
230
+  },
231
+
232
+  /**
233
+   * 里面的方法只有被调用才会执行
234
+   */
235
+  methods: {
236
+    // 获取公司列表
237
+    getdata(parameter) {
238
+      this.loading = true
239
+      // 模拟数据开始
240
+      let res = {
241
+        code: 0,
242
+        msg: null,
243
+        count: 23,
244
+        data: [
245
+          {
246
+            addUser: null,
247
+            editUser: null,
248
+            addTime: 1526380193000,
249
+            editTime: 1526380193000,
250
+            orderId: 109,
251
+            deptId: 1,
252
+            deptName: 'xxxx',
253
+            orderNo: 'xxxx',
254
+            transId: 'xxxx',
255
+            payType: 6,
256
+            subPayType: 'WXPay',
257
+            transType: '退款',
258
+            machineNo: '111111',
259
+            goodsNo: '123456',
260
+            goodsPrice: 0.01,
261
+            payAmount: -0.01,
262
+            goodsName: '可乐',
263
+            aisleNo: null,
264
+            orderStatus: 14,
265
+            openId: null,
266
+            mchId: '111111111111111',
267
+            subMchId: null,
268
+            remark: '不允许从此IP发起交易: 101.81.251.226'
269
+          },
270
+          {
271
+            addUser: null,
272
+            editUser: null,
273
+            addTime: 1526380176000,
274
+            editTime: 1526380176000,
275
+            orderId: 108,
276
+            deptId: 1,
277
+            deptName: 'xxxxxx',
278
+            orderNo: 'xxxx',
279
+            transId: 'xxxxx',
280
+            payType: 6,
281
+            subPayType: 'WXPay',
282
+            transType: '退款',
283
+            machineNo: 'J1AX904002',
284
+            goodsNo: '123456',
285
+            goodsPrice: 0.01,
286
+            payAmount: -0.01,
287
+            goodsName: '可乐',
288
+            aisleNo: null,
289
+            orderStatus: 14,
290
+            openId: null,
291
+            mchId: '898310154990338',
292
+            subMchId: null,
293
+            remark: '不允许从此IP发起交易: 101.81.251.226'
294
+          },
295
+          {
296
+            addUser: null,
297
+            editUser: null,
298
+            addTime: 1524921444000,
299
+            editTime: 1524894094000,
300
+            orderId: 107,
301
+            deptId: 1,
302
+            deptName: 'xxxxxx',
303
+            orderNo: 'J1AX90400220180428101723945',
304
+            transId: '4200000137201804287543647891',
305
+            payType: 6,
306
+            subPayType: 'WXPay',
307
+            transType: '消费',
308
+            machineNo: 'J1AX904002',
309
+            goodsNo: '123456',
310
+            goodsPrice: 0.01,
311
+            payAmount: 0.01,
312
+            goodsName: '可乐',
313
+            aisleNo: null,
314
+            orderStatus: 7,
315
+            openId: null,
316
+            mchId: '898310154990338',
317
+            subMchId: null,
318
+            remark: '无法找到指定的账单'
319
+          },
320
+          {
321
+            addUser: null,
322
+            editUser: null,
323
+            addTime: 1521307596000,
324
+            editTime: 1524641207000,
325
+            orderId: 20,
326
+            deptId: 1,
327
+            deptName: 'xxxx',
328
+            orderNo: '9300079120180318142634440',
329
+            transId: null,
330
+            payType: 0,
331
+            subPayType: '0',
332
+            transType: '消费',
333
+            machineNo: '111111111111111',
334
+            goodsNo: '123456',
335
+            goodsPrice: 0.01,
336
+            payAmount: 0.01,
337
+            goodsName: '可乐',
338
+            aisleNo: null,
339
+            orderStatus: 7,
340
+            openId: null,
341
+            mchId: null,
342
+            subMchId: null,
343
+            remark: '1111111111111111111111'
344
+          },
345
+          {
346
+            addUser: null,
347
+            editUser: null,
348
+            addTime: 1520195909000,
349
+            editTime: 1520195909000,
350
+            orderId: 19,
351
+            deptId: 1,
352
+            deptName: 'xxxx',
353
+            orderNo: '9300079120180305183828606',
354
+            transId: null,
355
+            payType: 0,
356
+            subPayType: '0',
357
+            transType: '消费',
358
+            machineNo: '93000791',
359
+            goodsNo: '123456',
360
+            goodsPrice: 0.01,
361
+            payAmount: 0.01,
362
+            goodsName: '可乐',
363
+            aisleNo: null,
364
+            orderStatus: 1,
365
+            openId: null,
366
+            mchId: null,
367
+            subMchId: null,
368
+            remark: null
369
+          },
370
+          {
371
+            addUser: null,
372
+            editUser: null,
373
+            addTime: 1520035180000,
374
+            editTime: 1520035180000,
375
+            orderId: 18,
376
+            deptId: 1,
377
+            deptName: 'xxxx',
378
+            orderNo: '4200000056201803031934477774',
379
+            transId: '9300079120180303170851281',
380
+            payType: 6,
381
+            subPayType: 'WXPay',
382
+            transType: '退款',
383
+            machineNo: '222222222222222222',
384
+            goodsNo: '123456',
385
+            goodsPrice: 0.01,
386
+            payAmount: 0.01,
387
+            goodsName: '可乐',
388
+            aisleNo: null,
389
+            orderStatus: 8,
390
+            openId: null,
391
+            mchId: '898310154990338',
392
+            subMchId: null,
393
+            remark: null
394
+          },
395
+          {
396
+            addUser: null,
397
+            editUser: null,
398
+            addTime: 1520020261000,
399
+            editTime: 1520185478000,
400
+            orderId: 17,
401
+            deptId: 1,
402
+            deptName: 'xxxx',
403
+            orderNo: '9300079120180303175059985',
404
+            transId: '4200000072201803031887274444',
405
+            payType: 6,
406
+            subPayType: 'WXPay',
407
+            transType: '消费',
408
+            machineNo: '93000791',
409
+            goodsNo: '123456',
410
+            goodsPrice: 0.01,
411
+            payAmount: 0.01,
412
+            goodsName: '可乐',
413
+            aisleNo: null,
414
+            orderStatus: 7,
415
+            openId: null,
416
+            mchId: '898310154990338',
417
+            subMchId: null,
418
+            remark: '不允许从此IP发起交易: 116.247.119.165'
419
+          },
420
+          {
421
+            addUser: null,
422
+            editUser: null,
423
+            addTime: 1520019911000,
424
+            editTime: 1520020075000,
425
+            orderId: 16,
426
+            deptId: 1,
427
+            deptName: 'xxxx',
428
+            orderNo: '9300079120180303174511778',
429
+            transId: '4200000055201803031949877221',
430
+            payType: 6,
431
+            subPayType: 'WXPay',
432
+            transType: '消费',
433
+            machineNo: '93000791',
434
+            goodsNo: '123456',
435
+            goodsPrice: 0.01,
436
+            payAmount: 0.01,
437
+            goodsName: '可乐',
438
+            aisleNo: null,
439
+            orderStatus: 1,
440
+            openId: null,
441
+            mchId: '898310154990338',
442
+            subMchId: null,
443
+            remark: null
444
+          },
445
+          {
446
+            addUser: null,
447
+            editUser: null,
448
+            addTime: 1520019776000,
449
+            editTime: 1520019776000,
450
+            orderId: 15,
451
+            deptId: 1,
452
+            deptName: 'xxxx',
453
+            orderNo: '9300079120180303174256156',
454
+            transId: null,
455
+            payType: 0,
456
+            subPayType: '0',
457
+            transType: '消费',
458
+            machineNo: '93000791',
459
+            goodsNo: '123456',
460
+            goodsPrice: 0.01,
461
+            payAmount: 0.01,
462
+            goodsName: '可乐',
463
+            aisleNo: null,
464
+            orderStatus: 1,
465
+            openId: null,
466
+            mchId: null,
467
+            subMchId: null,
468
+            remark: null
469
+          },
470
+          {
471
+            addUser: null,
472
+            editUser: null,
473
+            addTime: 1520019729000,
474
+            editTime: 1520019729000,
475
+            orderId: 14,
476
+            deptId: 1,
477
+            deptName: '上海XX',
478
+            orderNo: '9300079120180303174208429',
479
+            transId: null,
480
+            payType: 0,
481
+            subPayType: '0',
482
+            transType: '消费',
483
+            machineNo: '93000791',
484
+            goodsNo: '123456',
485
+            goodsPrice: 0.01,
486
+            payAmount: 0.01,
487
+            goodsName: '可乐',
488
+            aisleNo: null,
489
+            orderStatus: 1,
490
+            openId: null,
491
+            mchId: null,
492
+            subMchId: null,
493
+            remark: null
494
+          }
495
+        ]
496
+      }
497
+      this.loading = false
498
+      this.listData = res.data
499
+      this.pageparm.currentPage = this.formInline.page
500
+      this.pageparm.pageSize = this.formInline.limit
501
+      this.pageparm.total = res.count
502
+      // 模拟数据结束
503
+
504
+      /***
505
+       * 调用接口,注释上面模拟数据 取消下面注释
506
+       */
507
+
508
+      // OrderList(parameter)
509
+      //   .then(res => {
510
+      //     this.loading = false
511
+      //     if (res.success == false) {
512
+      //       this.$message({
513
+      //         type: 'info',
514
+      //         message: res.msg
515
+      //       })
516
+      //     } else {
517
+      //       this.listData = res.data
518
+      //       // 分页赋值
519
+      //       this.pageparm.currentPage = this.formInline.page
520
+      //       this.pageparm.pageSize = this.formInline.limit
521
+      //       this.pageparm.total = res.count
522
+      //     }
523
+      //   })
524
+      //   .catch(err => {
525
+      //     this.loading = false
526
+      //     this.$message.error('菜单加载失败,请稍后再试!')
527
+      //   })
528
+    },
529
+    // 分页插件事件
530
+    callFather(parm) {
531
+      this.formInline.page = parm.currentPage
532
+      this.formInline.limit = parm.pageSize
533
+      this.getdata(this.formInline)
534
+    },
535
+    // 搜索事件
536
+    search() {
537
+      this.getdata(this.formInline)
538
+    },
539
+    //显示编辑界面
540
+    handleEdit: function(index, row) {
541
+      this.editFormVisible = true
542
+      this.editForm = row
543
+    },
544
+    // 编辑、增加页面保存方法
545
+    submitForm(editData) {
546
+      this.$refs[editData].validate(valid => {
547
+        if (valid) {
548
+          ConfigSave(this.editForm)
549
+            .then(res => {
550
+              this.editFormVisible = false
551
+              this.loading = false
552
+              if (res.success) {
553
+                this.getdata(this.formInline)
554
+                this.$message({
555
+                  type: 'success',
556
+                  message: '公司保存成功!'
557
+                })
558
+              } else {
559
+                this.$message({
560
+                  type: 'info',
561
+                  message: res.msg
562
+                })
563
+              }
564
+            })
565
+            .catch(err => {
566
+              this.editFormVisible = false
567
+              this.loading = false
568
+              this.$message.error('支付配置信息保存失败,请稍后再试!')
569
+            })
570
+        } else {
571
+          return false
572
+        }
573
+      })
574
+    },
575
+    // 删除公司
576
+    deleteUser(index, row) {
577
+      this.$confirm('确定要删除吗?', '信息', {
578
+        confirmButtonText: '确定',
579
+        cancelButtonText: '取消',
580
+        type: 'warning'
581
+      })
582
+        .then(() => {
583
+          ConfigDelete(row.deptId)
584
+            .then(res => {
585
+              if (res.success) {
586
+                this.$message({
587
+                  type: 'success',
588
+                  message: '公司已删除!'
589
+                })
590
+                this.getdata(this.formInline)
591
+              } else {
592
+                this.$message({
593
+                  type: 'info',
594
+                  message: res.msg
595
+                })
596
+              }
597
+            })
598
+            .catch(err => {
599
+              this.loading = false
600
+              this.$message.error('支付配置信息删除失败,请稍后再试!')
601
+            })
602
+        })
603
+        .catch(() => {
604
+          this.$message({
605
+            type: 'info',
606
+            message: '已取消删除'
607
+          })
608
+        })
609
+    },
610
+    // 关闭编辑、增加弹出框
611
+    closeDialog(formName) {
612
+      this.editFormVisible = false
613
+      this.$refs[formName].resetFields()
614
+    }
615
+  }
616
+}
617
+</script>
618
+
619
+<style scoped>
620
+.user-search {
621
+  margin-top: 20px;
622
+}
623
+.userRole {
624
+  width: 100%;
625
+}
626
+</style>
627
+
628
+ 
629
+ 
630
+
631
+ 

+ 332
- 0
src/views/system/Dept.vue ファイルの表示

@@ -0,0 +1,332 @@
1
+/**
2
+ * 系统管理  公司管理
3
+ */
4
+<template>
5
+  <div>
6
+    <!-- 面包屑导航 -->
7
+    <el-breadcrumb separator-class="el-icon-arrow-right">
8
+      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
9
+      <el-breadcrumb-item>公司管理</el-breadcrumb-item>
10
+    </el-breadcrumb>
11
+    <!-- 搜索筛选 -->
12
+    <el-form :inline="true" :model="formInline" class="user-search">
13
+      <el-form-item label="搜索:">
14
+        <el-input size="small" v-model="formInline.deptName" placeholder="输入部门名称"></el-input>
15
+      </el-form-item>
16
+      <el-form-item label="">
17
+        <el-input size="small" v-model="formInline.deptNo" placeholder="输入部门代码"></el-input>
18
+      </el-form-item>
19
+      <el-form-item>
20
+        <el-button size="small" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
21
+        <el-button size="small" type="primary" icon="el-icon-plus" @click="handleEdit()">添加</el-button>
22
+      </el-form-item>
23
+    </el-form>
24
+    <!--列表-->
25
+    <el-table size="small" :data="listData" highlight-current-row v-loading="loading" border element-loading-text="拼命加载中" style="width: 100%;">
26
+      <el-table-column align="center" type="selection" width="60">
27
+      </el-table-column>
28
+      <el-table-column sortable prop="deptName" label="部门名称" width="300">
29
+      </el-table-column>
30
+      <el-table-column sortable prop="deptNo" label="部门代码" width="300">
31
+      </el-table-column>
32
+      <el-table-column sortable prop="editTime" label="修改时间" width="300">
33
+        <template slot-scope="scope">
34
+          <div>{{scope.row.editTime|timestampToTime}}</div>
35
+        </template>
36
+      </el-table-column>
37
+      <el-table-column sortable prop="editUser" label="修改人" width="300">
38
+      </el-table-column>
39
+      <el-table-column align="center" label="操作" min-width="300">
40
+        <template slot-scope="scope">
41
+          <el-button size="mini" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
42
+          <el-button size="mini" type="danger" @click="deleteUser(scope.$index, scope.row)">删除</el-button>
43
+        </template>
44
+      </el-table-column>
45
+    </el-table>
46
+    <!-- 分页组件 -->
47
+    <Pagination v-bind:child-msg="pageparm" @callFather="callFather"></Pagination>
48
+    <!-- 编辑界面 -->
49
+    <el-dialog :title="title" :visible.sync="editFormVisible" width="30%" @click="closeDialog">
50
+      <el-form label-width="120px" :model="editForm" :rules="rules" ref="editForm">
51
+        <el-form-item label="部门名称" prop="deptName">
52
+          <el-input size="small" v-model="editForm.deptName" auto-complete="off" placeholder="请输入部门名称"></el-input>
53
+        </el-form-item>
54
+        <el-form-item label="部门代码" prop="deptNo">
55
+          <el-input size="small" v-model="editForm.deptNo" auto-complete="off" placeholder="请输入部门代码"></el-input>
56
+        </el-form-item>
57
+      </el-form>
58
+      <div slot="footer" class="dialog-footer">
59
+        <el-button size="small" @click="closeDialog">取消</el-button>
60
+        <el-button size="small" type="primary" :loading="loading" class="title" @click="submitForm('editForm')">保存</el-button>
61
+      </div>
62
+    </el-dialog>
63
+  </div>
64
+</template>
65
+
66
+<script>
67
+import { deptList, deptSave, deptDelete } from '../../api/userMG'
68
+import Pagination from '../../components/Pagination'
69
+export default {
70
+  data() {
71
+    return {
72
+      nshow: true, //switch开启
73
+      fshow: false, //switch关闭
74
+      loading: false, //是显示加载
75
+      editFormVisible: false, //控制编辑页面显示与隐藏
76
+      title: '添加',
77
+      editForm: {
78
+        deptId: '',
79
+        deptName: '',
80
+        deptNo: '',
81
+        token: localStorage.getItem('logintoken')
82
+      },
83
+      // rules表单验证
84
+      rules: {
85
+        deptName: [
86
+          { required: true, message: '请输入部门名称', trigger: 'blur' }
87
+        ],
88
+        deptNo: [{ required: true, message: '请输入部门代码', trigger: 'blur' }]
89
+      },
90
+      formInline: {
91
+        page: 1,
92
+        limit: 10,
93
+        varLable: '',
94
+        varName: '',
95
+        token: localStorage.getItem('logintoken')
96
+      },
97
+      // 删除部门
98
+      seletedata: {
99
+        ids: '',
100
+        token: localStorage.getItem('logintoken')
101
+      },
102
+      userparm: [], //搜索权限
103
+      listData: [], //用户数据
104
+      // 分页参数
105
+      pageparm: {
106
+        currentPage: 1,
107
+        pageSize: 10,
108
+        total: 10
109
+      }
110
+    }
111
+  },
112
+  // 注册组件
113
+  components: {
114
+    Pagination
115
+  },
116
+  /**
117
+   * 数据发生改变
118
+   */
119
+
120
+  /**
121
+   * 创建完毕
122
+   */
123
+  created() {
124
+    this.getdata(this.formInline)
125
+  },
126
+
127
+  /**
128
+   * 里面的方法只有被调用才会执行
129
+   */
130
+  methods: {
131
+    // 获取公司列表
132
+    getdata(parameter) {
133
+      this.loading = true
134
+      // 模拟数据
135
+      let res = {
136
+        code: 0,
137
+        msg: null,
138
+        count: 5,
139
+        data: [
140
+          {
141
+            addUser: null,
142
+            editUser: null,
143
+            addTime: 1521062371000,
144
+            editTime: 1526700200000,
145
+            deptId: 2,
146
+            deptName: '上海分公司',
147
+            deptNo: '1',
148
+            parentId: 1
149
+          },
150
+          {
151
+            addUser: null,
152
+            editUser: null,
153
+            addTime: 1521063247000,
154
+            editTime: 1526652291000,
155
+            deptId: 3,
156
+            deptName: '上海测试',
157
+            deptNo: '02',
158
+            parentId: 1
159
+          },
160
+          {
161
+            addUser: null,
162
+            editUser: null,
163
+            addTime: 1526349555000,
164
+            editTime: 1526349565000,
165
+            deptId: 12,
166
+            deptName: '1',
167
+            deptNo: '11',
168
+            parentId: 1
169
+          },
170
+          {
171
+            addUser: null,
172
+            editUser: null,
173
+            addTime: 1526373178000,
174
+            editTime: 1526373178000,
175
+            deptId: 13,
176
+            deptName: '5',
177
+            deptNo: '5',
178
+            parentId: 1
179
+          },
180
+          {
181
+            addUser: null,
182
+            editUser: null,
183
+            addTime: 1526453107000,
184
+            editTime: 1526453107000,
185
+            deptId: 17,
186
+            deptName: 'v',
187
+            deptNo: 'v',
188
+            parentId: 1
189
+          }
190
+        ]
191
+      }
192
+      this.loading = false
193
+      this.listData = res.data
194
+      // 分页赋值
195
+      this.pageparm.currentPage = this.formInline.page
196
+      this.pageparm.pageSize = this.formInline.limit
197
+      this.pageparm.total = res.count
198
+      // 模拟数据结束
199
+
200
+      /***
201
+       * 调用接口,注释上面模拟数据 取消下面注释
202
+       */
203
+      // deptList(parameter)
204
+      //   .then(res => {
205
+      //     this.loading = false
206
+      //     if (res.success == false) {
207
+      //       this.$message({
208
+      //         type: 'info',
209
+      //         message: res.msg
210
+      //       })
211
+      //     } else {
212
+      //       this.listData = res.data
213
+      //       // 分页赋值
214
+      //       this.pageparm.currentPage = this.formInline.page
215
+      //       this.pageparm.pageSize = this.formInline.limit
216
+      //       this.pageparm.total = res.count
217
+      //     }
218
+      //   })
219
+      //   .catch(err => {
220
+      //     this.loading = false
221
+      //     this.$message.error('菜单加载失败,请稍后再试!')
222
+      //   })
223
+    },
224
+    // 分页插件事件
225
+    callFather(parm) {
226
+      this.formInline.page = parm.currentPage
227
+      this.formInline.limit = parm.pageSize
228
+      this.getdata(this.formInline)
229
+    },
230
+    // 搜索事件
231
+    search() {
232
+      this.getdata(this.formInline)
233
+    },
234
+    //显示编辑界面
235
+    handleEdit: function(index, row) {
236
+      this.editFormVisible = true
237
+      if (row != undefined && row != 'undefined') {
238
+        this.title = '修改'
239
+        this.editForm.deptId = row.deptId
240
+        this.editForm.deptName = row.deptName
241
+        this.editForm.deptNo = row.deptNo
242
+      } else {
243
+        this.title = '添加'
244
+        this.editForm.deptId = ''
245
+        this.editForm.deptName = ''
246
+        this.editForm.deptNo = ''
247
+      }
248
+    },
249
+    // 编辑、增加页面保存方法
250
+    submitForm(editData) {
251
+      this.$refs[editData].validate(valid => {
252
+        if (valid) {
253
+          deptSave(this.editForm)
254
+            .then(res => {
255
+              this.editFormVisible = false
256
+              this.loading = false
257
+              if (res.success) {
258
+                this.getdata(this.formInline)
259
+                this.$message({
260
+                  type: 'success',
261
+                  message: '公司保存成功!'
262
+                })
263
+              } else {
264
+                this.$message({
265
+                  type: 'info',
266
+                  message: res.msg
267
+                })
268
+              }
269
+            })
270
+            .catch(err => {
271
+              this.editFormVisible = false
272
+              this.loading = false
273
+              this.$message.error('公司保存失败,请稍后再试!')
274
+            })
275
+        } else {
276
+          return false
277
+        }
278
+      })
279
+    },
280
+    // 删除公司
281
+    deleteUser(index, row) {
282
+      this.$confirm('确定要删除吗?', '信息', {
283
+        confirmButtonText: '确定',
284
+        cancelButtonText: '取消',
285
+        type: 'warning'
286
+      })
287
+        .then(() => {
288
+          deptDelete(row.deptId)
289
+            .then(res => {
290
+              if (res.success) {
291
+                this.$message({
292
+                  type: 'success',
293
+                  message: '公司已删除!'
294
+                })
295
+                this.getdata(this.formInline)
296
+              } else {
297
+                this.$message({
298
+                  type: 'info',
299
+                  message: res.msg
300
+                })
301
+              }
302
+            })
303
+            .catch(err => {
304
+              this.loading = false
305
+              this.$message.error('公司删除失败,请稍后再试!')
306
+            })
307
+        })
308
+        .catch(() => {
309
+          this.$message({
310
+            type: 'info',
311
+            message: '已取消删除'
312
+          })
313
+        })
314
+    },
315
+    // 关闭编辑、增加弹出框
316
+    closeDialog() {
317
+      this.editFormVisible = false
318
+    }
319
+  }
320
+}
321
+</script>
322
+
323
+<style scoped>
324
+.user-search {
325
+  margin-top: 20px;
326
+}
327
+.userRole {
328
+  width: 100%;
329
+}
330
+</style>
331
+
332
+ 

+ 331
- 0
src/views/system/Module.vue ファイルの表示

@@ -0,0 +1,331 @@
1
+/**
2
+ * 系统管理 菜单管理
3
+ */
4
+<template>
5
+  <div>
6
+    <!-- 面包屑导航 -->
7
+    <el-breadcrumb separator-class="el-icon-arrow-right">
8
+      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
9
+      <el-breadcrumb-item>菜单管理</el-breadcrumb-item>
10
+    </el-breadcrumb>
11
+    <!-- 主体内容 -->
12
+    <el-row>
13
+      <!-- title -->
14
+      <div class="modt-box">用户管理</div>
15
+      <el-col :span="4"> </el-col>
16
+      <el-col :span="6">
17
+        <div class="mod-btnbox">
18
+          <el-button size="small" type="primary">全部展开</el-button>
19
+          <el-button size="small" type="primary">全部压缩</el-button>
20
+        </div>
21
+        <el-tree class="treeclass" ref="tree" :data="treeData" default-expand-all="" :props="defaultProps" @node-click="nodeclick" @check-change="handleClick" check-strictly node-key="id" show-checkbox></el-tree>
22
+      </el-col>
23
+      <el-col :span="18">
24
+        <div class="mod-btnbox">
25
+          <el-button size="small" type="primary" icon="el-icon-plus" @click="addModule">添加</el-button>
26
+        </div>
27
+        <el-form ref="form" :model="form" label-width="80px" :rules="rules">
28
+          <el-form-item label="父级菜单" prop="parentId">
29
+            <el-select size="small" v-model="form.parentId" placeholder="请选择" class="selectw">
30
+              <el-option v-for="parm in fmenu" :key="parm.id" :label="parm.name" :value="parm.id"></el-option>
31
+            </el-select>
32
+          </el-form-item>
33
+          <el-form-item label="菜单名称" prop="moduleName">
34
+            <el-input size="small" v-model="form.moduleName"></el-input>
35
+          </el-form-item>
36
+          <el-form-item label="图标" prop="moduleIcon">
37
+            <el-input size="small" v-model="form.moduleIcon"></el-input>
38
+          </el-form-item>
39
+          <el-form-item label="URL" prop="moduleUrl">
40
+            <el-input size="small" v-model="form.moduleUrl"></el-input>
41
+          </el-form-item>
42
+          <el-form-item label="顺序" prop="moduleOrder">
43
+            <el-input size="small" v-model="form.moduleOrder"></el-input>
44
+          </el-form-item>
45
+          <el-form-item>
46
+            <el-button size="small" type="primary" @click="saveModule('form')">保存</el-button>
47
+            <el-button size="small" type="primary" v-show="showdelete" @click="deleteModule">删除</el-button>
48
+          </el-form-item>
49
+        </el-form>
50
+      </el-col>
51
+    </el-row>
52
+  </div>
53
+</template>
54
+
55
+<script>
56
+import {
57
+  ModuleList,
58
+  ModuleGet,
59
+  ModuleNodes,
60
+  ModuleSave,
61
+  ModuleDelete
62
+} from '../../api/userMG'
63
+export default {
64
+  data() {
65
+    return {
66
+      showdelete: false,
67
+      treeData: [],
68
+      defaultProps: {
69
+        children: 'children',
70
+        label: 'name'
71
+      },
72
+      form: {
73
+        addUser: '',
74
+        editUser: '',
75
+        addTime: '',
76
+        editTime: '',
77
+        moduleId: '',
78
+        parentId: '',
79
+        moduleLevel: '',
80
+        systemNo: '',
81
+        isLeaf: '',
82
+        fullIndex: '',
83
+        moduleIcon: '',
84
+        moduleOrder: '',
85
+        moduleName: '',
86
+        moduleNotes: '',
87
+        moduleUrl: ''
88
+      },
89
+      // rules表单验证
90
+      rules: {
91
+        parentId: [
92
+          { required: true, message: '请选择父级菜单', trigger: 'blur' }
93
+        ],
94
+        moduleName: [
95
+          { required: true, message: '请输入菜单名称', trigger: 'blur' }
96
+        ],
97
+        moduleIcon: [
98
+          { required: true, message: '请输入菜单图标', trigger: 'blur' }
99
+        ],
100
+        moduleUrl: [{ required: true, message: '请输入URL', trigger: 'blur' }],
101
+        moduleOrder: [
102
+          { required: true, message: '请输入菜单顺序', trigger: 'blur' }
103
+        ]
104
+      },
105
+      fmenu: []
106
+    }
107
+  },
108
+  /**
109
+   * 创建完毕
110
+   */
111
+
112
+  created() {
113
+    this.getdata()
114
+    this.getmenu()
115
+  },
116
+
117
+  /**
118
+   * 里面的方法只有被调用才会执行
119
+   */
120
+  methods: {
121
+    // 获取数据
122
+    getdata() {
123
+      ModuleList()
124
+        .then(res => {
125
+          this.treeData = [
126
+            {
127
+              id: 1,
128
+              pId: 0,
129
+              name: '平台顶级',
130
+              open: true,
131
+              checked: false
132
+            },
133
+            {
134
+              id: 2,
135
+              pId: 1,
136
+              name: '一层',
137
+              open: true,
138
+              checked: false
139
+            },
140
+            {
141
+              id: 3,
142
+              pId: 1,
143
+              name: '一层',
144
+              open: true,
145
+              checked: false
146
+            },
147
+            {
148
+              id: 12,
149
+              pId: 1,
150
+              name: '一层',
151
+              open: true,
152
+              checked: false
153
+            },
154
+            {
155
+              id: 13,
156
+              pId: 1,
157
+              name: '一层',
158
+              open: true,
159
+              checked: false
160
+            },
161
+            {
162
+              id: 17,
163
+              pId: 1,
164
+              name: '一层',
165
+              open: true,
166
+              checked: false
167
+            },
168
+            {
169
+              id: 4,
170
+              pId: 2,
171
+              name: '一层',
172
+              open: true,
173
+              checked: false
174
+            },
175
+            {
176
+              id: 5,
177
+              pId: 2,
178
+              name: '一层',
179
+              open: true,
180
+              checked: false
181
+            },
182
+            {
183
+              id: 6,
184
+              pId: 2,
185
+              name: '一层',
186
+              open: true,
187
+              checked: false
188
+            },
189
+            {
190
+              id: 7,
191
+              pId: 2,
192
+              name: '一层',
193
+              open: true,
194
+              checked: false
195
+            }
196
+          ]
197
+        })
198
+        .catch(err => {
199
+          this.loading = false
200
+          this.$message.error('菜单管理列表失败,请稍后再试!')
201
+        })
202
+    },
203
+    // 添加
204
+    addModule() {
205
+      this.showdelete = false
206
+      this.form.addUser = ''
207
+      this.form.editUser = ''
208
+      this.form.addTime = ''
209
+      this.form.editTime = ''
210
+      this.form.moduleId = ''
211
+      this.form.parentId = ''
212
+      this.form.moduleLevel = ''
213
+      this.form.systemNo = ''
214
+      this.form.isLeaf = ''
215
+      this.form.fullIndex = ''
216
+      this.form.moduleIcon = ''
217
+      this.form.moduleOrder = ''
218
+      this.form.moduleName = ''
219
+      this.form.moduleNotes = ''
220
+      this.form.moduleUrl = ''
221
+    },
222
+    // 获取父级菜单
223
+    getmenu() {
224
+      let parm = {
225
+        page: '1',
226
+        limit: '10'
227
+      }
228
+      ModuleNodes(parm)
229
+        .then(res => {
230
+          this.fmenu = res.data
231
+        })
232
+        .catch(err => {
233
+          this.loading = false
234
+          this.$message.error('父级菜单列表获取失败,请稍后再试!')
235
+        })
236
+    },
237
+    // 复选变单选
238
+    handleClick(data, checked, node) {
239
+      if (checked) {
240
+        this.$refs.tree.setCheckedNodes([])
241
+        this.$refs.tree.setCheckedNodes([data])
242
+        this.showdelete = true
243
+      } else {
244
+      }
245
+    },
246
+    // 点击节点
247
+    nodeclick(arr, node, self) {
248
+      ModuleGet(arr.id)
249
+        .then(res => {
250
+          console.log(JSON.stringify(res))
251
+          this.form = res.data.data
252
+          this.$refs.tree.setCheckedNodes([])
253
+          this.$refs.tree.setCheckedNodes([arr])
254
+        })
255
+        .catch(err => {
256
+          this.loading = false
257
+          this.$message.error('用户管理获取失败,请稍后再试!')
258
+        })
259
+    },
260
+    // 保存菜单
261
+    saveModule(editData) {
262
+      this.$refs[editData].validate(valid => {
263
+        if (valid) {
264
+          ModuleSave(this.form)
265
+            .then(res => {
266
+              this.getdata()
267
+              this.getmenu()
268
+            })
269
+            .catch(err => {
270
+              this.$message.error('菜单管理列表保存失败,请稍后再试!')
271
+            })
272
+        } else {
273
+          return false
274
+        }
275
+      })
276
+    },
277
+    // 删除菜单
278
+    deleteModule() {
279
+      ModuleDelete(this.form.moduleId)
280
+        .then(res => {
281
+          this.getdata()
282
+          this.getmenu()
283
+          this.$message.error('菜单管理列表删除成功!')
284
+        })
285
+        .catch(err => {
286
+          this.$message.error('菜单管理列表删除失败,请稍后再试!')
287
+        })
288
+    }
289
+  }
290
+}
291
+</script>
292
+
293
+<style>
294
+.user-search {
295
+  margin-top: 20px !important;
296
+}
297
+.user-search td {
298
+  margin-top: 20px !important;
299
+}
300
+.userRole {
301
+  width: 100%;
302
+}
303
+.el-table__expanded-cell {
304
+  padding: 0px !important;
305
+  margin: 0px !important;
306
+}
307
+.modt-box {
308
+  width: 100%;
309
+  height: 60px;
310
+  line-height: 60px;
311
+  background-color: #f0f2f5;
312
+  text-align: center;
313
+  color: #334157;
314
+  margin-top: 20px;
315
+  margin-bottom: 20px;
316
+  font-size: 24px;
317
+}
318
+.mod-btnbox {
319
+  margin-bottom: 20px;
320
+}
321
+.treeclass {
322
+  border: 1px solid #f3f3f3;
323
+  padding-top: 20px;
324
+  padding-bottom: 20px;
325
+}
326
+.selectw {
327
+  width: 100%;
328
+}
329
+</style>
330
+ 
331
+ 

+ 465
- 0
src/views/system/Permission.vue ファイルの表示

@@ -0,0 +1,465 @@
1
+/**
2
+ * 系统管理  权限管理
3
+ */
4
+<template>
5
+  <div>
6
+    <!-- 面包屑导航 -->
7
+    <el-breadcrumb separator-class="el-icon-arrow-right">
8
+      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
9
+      <el-breadcrumb-item>权限管理</el-breadcrumb-item>
10
+    </el-breadcrumb>
11
+    <!-- 搜索筛选 -->
12
+    <el-form :inline="true" :model="formInline" class="user-search">
13
+      <el-form-item label="搜索:">
14
+        <el-input size="small" v-model="formInline.permissionName" placeholder="输入权限名称"></el-input>
15
+      </el-form-item>
16
+      <el-form-item label="">
17
+        <el-input size="small" v-model="formInline.permission" placeholder="输入权限CODE"></el-input>
18
+      </el-form-item>
19
+      <el-form-item label="角色:">
20
+        <el-select size="small" v-model="formInline.roleId" placeholder="请选择">
21
+          <el-option selected label="请选择" value="0"></el-option>
22
+          <el-option v-for="parm in userparm" :key="parm.roleId" :label="parm.roleName" :value="parm.roleId"></el-option>
23
+        </el-select>
24
+      </el-form-item>
25
+      <el-form-item>
26
+        <el-button size="small" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
27
+        <el-button size="small" type="primary" icon="el-icon-plus" @click="handleEdit()">添加</el-button>
28
+        <el-button size="small" type="primary" icon="el-icon-plus" @click="RolePermission()">配置权限</el-button>
29
+      </el-form-item>
30
+    </el-form>
31
+    <!--列表-->
32
+    <el-table size="small" @selection-change="selectChange" :data="listData" highlight-current-row v-loading="loading" border element-loading-text="拼命加载中" style="width: 100%;">
33
+      <el-table-column align="center" type="selection" width="60">
34
+      </el-table-column>
35
+      <el-table-column sortable prop="permissionName" label="权限名称" width="300">
36
+      </el-table-column>
37
+      <el-table-column sortable prop="permission" label="权限CODE" width="300">
38
+      </el-table-column>
39
+      <el-table-column sortable prop="editTime" label="修改时间" width="300">
40
+        <template slot-scope="scope">
41
+          <div>{{scope.row.editTime|timestampToTime}}</div>
42
+        </template>
43
+      </el-table-column>
44
+      <el-table-column sortable prop="editUser" label="修改人" width="300">
45
+      </el-table-column>
46
+      <el-table-column align="center" label="操作" min-width="300">
47
+        <template slot-scope="scope">
48
+          <el-button size="mini" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
49
+          <el-button size="mini" type="danger" @click="deleteUser(scope.$index, scope.row)">删除</el-button>
50
+        </template>
51
+      </el-table-column>
52
+    </el-table>
53
+    <!-- 分页组件 -->
54
+    <Pagination v-bind:child-msg="pageparm" @callFather="callFather"></Pagination>
55
+    <!-- 编辑界面 -->
56
+    <el-dialog :title="title" :visible.sync="editFormVisible" width="30%" @click="closeDialog">
57
+      <el-form label-width="120px" :model="editForm" :rules="rules" ref="editForm">
58
+        <el-form-item label="权限名称" prop="permissionName">
59
+          <el-input size="small" v-model="editForm.permissionName" auto-complete="off" placeholder="权限名称"></el-input>
60
+        </el-form-item>
61
+        <el-form-item label="权限CODE" prop="permission">
62
+          <el-input size="small" v-model="editForm.permission" auto-complete="off" placeholder="权限CODE"></el-input>
63
+        </el-form-item>
64
+      </el-form>
65
+      <div slot="footer" class="dialog-footer">
66
+        <el-button size="small" @click="closeDialog">取消</el-button>
67
+        <el-button size="small" type="primary" :loading="loading" class="title" @click="submitForm('editForm')">保存</el-button>
68
+      </div>
69
+    </el-dialog>
70
+  </div>
71
+</template>
72
+
73
+<script>
74
+import {
75
+  permissionList,
76
+  ermissionSave,
77
+  ermissionDelete,
78
+  roleDropDown,
79
+  RolePermission
80
+} from '../../api/userMG'
81
+import Pagination from '../../components/Pagination'
82
+export default {
83
+  data() {
84
+    return {
85
+      nshow: true, //switch开启
86
+      fshow: false, //switch关闭
87
+      loading: false, //是显示加载
88
+      editFormVisible: false, //控制编辑页面显示与隐藏
89
+      title: '添加',
90
+      editForm: {
91
+        permissionId: '',
92
+        permissionName: '',
93
+        permission: '',
94
+        token: localStorage.getItem('logintoken')
95
+      },
96
+      // rules表单验证
97
+      rules: {
98
+        permissionName: [
99
+          { required: true, message: '请输入权限名称', trigger: 'blur' }
100
+        ],
101
+        permission: [
102
+          { required: true, message: '请输入权限CODE', trigger: 'blur' }
103
+        ]
104
+      },
105
+      formInline: {
106
+        page: 1,
107
+        limit: 10,
108
+        permissionName: '',
109
+        permission: '',
110
+        roleId: '0',
111
+        token: localStorage.getItem('logintoken')
112
+      },
113
+      // 选择数据
114
+      selectdata: [],
115
+      userparm: [], //搜索权限
116
+      listData: [], //用户数据
117
+      // 分页参数
118
+      pageparm: {
119
+        currentPage: 1,
120
+        pageSize: 10,
121
+        total: 10
122
+      }
123
+    }
124
+  },
125
+  // 注册组件
126
+  components: {
127
+    Pagination
128
+  },
129
+  /**
130
+   * 数据发生改变
131
+   */
132
+
133
+  watch: {},
134
+
135
+  /**
136
+   * 创建完毕
137
+   */
138
+
139
+  created() {
140
+    this.getdata(this.formInline)
141
+    this.getAccsee()
142
+  },
143
+
144
+  /**
145
+   * 里面的方法只有被调用才会执行
146
+   */
147
+
148
+  methods: {
149
+    // 获取数据方法
150
+    getdata(parameter) {
151
+      this.loading = true
152
+      // 模拟数据
153
+      let res = {
154
+        code: 0,
155
+        msg: null,
156
+        count: 0,
157
+        data: [
158
+          {
159
+            addUser: null,
160
+            editUser: null,
161
+            addTime: 1519728609000,
162
+            editTime: 1522585700000,
163
+            permissionId: 1,
164
+            permissionName: '用户-列表',
165
+            permission: 'system:User:list',
166
+            lay_CHECKED: false,
167
+            LAY_CHECKED: false
168
+          },
169
+          {
170
+            addUser: null,
171
+            editUser: null,
172
+            addTime: 1519728667000,
173
+            editTime: 1522585706000,
174
+            permissionId: 3,
175
+            permissionName: '用户-修改',
176
+            permission: 'system:User:save',
177
+            lay_CHECKED: false,
178
+            LAY_CHECKED: false
179
+          },
180
+          {
181
+            addUser: null,
182
+            editUser: null,
183
+            addTime: 1519728669000,
184
+            editTime: 1522256096000,
185
+            permissionId: 4,
186
+            permissionName: '用户-删除',
187
+            permission: 'system:User:delete',
188
+            lay_CHECKED: false,
189
+            LAY_CHECKED: false
190
+          },
191
+          {
192
+            addUser: 'root',
193
+            editUser: 'root',
194
+            addTime: 1520249365000,
195
+            editTime: 1522256085000,
196
+            permissionId: 5,
197
+            permissionName: '系统管理:角色:列表',
198
+            permission: 'system:Role:list',
199
+            lay_CHECKED: false,
200
+            LAY_CHECKED: false
201
+          },
202
+          {
203
+            addUser: 'root',
204
+            editUser: 'root',
205
+            addTime: 1520249588000,
206
+            editTime: 1520249588000,
207
+            permissionId: 7,
208
+            permissionName: 'system:Role:save',
209
+            permission: 'system:Role:save',
210
+            lay_CHECKED: false,
211
+            LAY_CHECKED: false
212
+          },
213
+          {
214
+            addUser: 'root',
215
+            editUser: 'root',
216
+            addTime: 1520249588000,
217
+            editTime: 1520249588000,
218
+            permissionId: 8,
219
+            permissionName: 'system:Role:delete',
220
+            permission: 'system:Role:delete',
221
+            lay_CHECKED: false,
222
+            LAY_CHECKED: false
223
+          },
224
+          {
225
+            addUser: 'root',
226
+            editUser: 'root',
227
+            addTime: 1520251014000,
228
+            editTime: 1520251014000,
229
+            permissionId: 9,
230
+            permissionName: 'system:Variable:列表',
231
+            permission: 'system:Variable:list',
232
+            lay_CHECKED: false,
233
+            LAY_CHECKED: false
234
+          },
235
+          {
236
+            addUser: 'root',
237
+            editUser: 'root',
238
+            addTime: 1520251014000,
239
+            editTime: 1520251014000,
240
+            permissionId: 11,
241
+            permissionName: 'system:Variable:修改',
242
+            permission: 'system:Variable:save',
243
+            lay_CHECKED: false,
244
+            LAY_CHECKED: false
245
+          },
246
+          {
247
+            addUser: 'root',
248
+            editUser: 'root',
249
+            addTime: 1520251014000,
250
+            editTime: 1520251014000,
251
+            permissionId: 12,
252
+            permissionName: 'system:Variable:删除',
253
+            permission: 'system:Variable:delete',
254
+            lay_CHECKED: false,
255
+            LAY_CHECKED: false
256
+          }
257
+        ]
258
+      }
259
+      this.loading = false
260
+      this.listData = res.data
261
+      // 分页赋值
262
+      this.pageparm.currentPage = this.formInline.page
263
+      this.pageparm.pageSize = this.formInline.limit
264
+      this.pageparm.total = res.count
265
+      // 模拟数据结束
266
+
267
+      /***
268
+       * 调用接口,注释上面模拟数据 取消下面注释
269
+       */
270
+      // 获取权限列表
271
+      // permissionList(parameter)
272
+      //   .then(res => {
273
+      //     this.loading = false
274
+      //     if (res.success == false) {
275
+      //       this.$message({
276
+      //         type: 'info',
277
+      //         message: res.msg
278
+      //       })
279
+      //     } else {
280
+      //       this.listData = res.data
281
+      //       // 分页赋值
282
+      //       this.pageparm.currentPage = this.formInline.page
283
+      //       this.pageparm.pageSize = this.formInline.limit
284
+      //       this.pageparm.total = res.count
285
+      //     }
286
+      //   })
287
+      //   .catch(err => {
288
+      //     this.loading = false
289
+      //     this.$message.error('权限管理列表获取失败,请稍后再试!')
290
+      //   })
291
+    },
292
+    // 获取权限
293
+    getAccsee() {
294
+      roleDropDown()
295
+        .then(res => {
296
+          if (res.success == false) {
297
+            this.$message({
298
+              type: 'info',
299
+              message: res.msg
300
+            })
301
+          } else {
302
+            this.userparm = res.data
303
+          }
304
+        })
305
+        .catch(err => {
306
+          this.$message.error('权限获取失败,请稍后再试!')
307
+        })
308
+    },
309
+    // 分页插件事件
310
+    callFather(parm) {
311
+      this.formInline.page = parm.currentPage
312
+      this.formInline.limit = parm.pageSize
313
+      this.getdata(this.formInline)
314
+    },
315
+    // 搜索事件
316
+    search() {
317
+      this.getdata(this.formInline)
318
+    },
319
+    //显示编辑界面
320
+    handleEdit: function(index, row) {
321
+      this.editFormVisible = true
322
+      // 深拷贝并赋值
323
+      //this.editForm = Object.assign({}, row)
324
+      if (row != undefined && row != 'undefined') {
325
+        this.title = '修改'
326
+        this.editForm.permissionId = row.permissionId
327
+        this.editForm.permissionName = row.permissionName
328
+        this.editForm.permission = row.permission
329
+      } else {
330
+        this.title = '添加'
331
+        this.editForm.permissionId = ''
332
+        this.editForm.permissionName = ''
333
+        this.editForm.permission = ''
334
+      }
335
+    },
336
+    // 编辑、增加页面保存方法
337
+    submitForm(editData) {
338
+      this.$refs[editData].validate(valid => {
339
+        if (valid) {
340
+          ermissionSave(this.editForm)
341
+            .then(res => {
342
+              this.editFormVisible = false
343
+              this.loading = false
344
+              if (res.success) {
345
+                this.getdata(this.formInline)
346
+                this.$message({
347
+                  type: 'success',
348
+                  message: '权限管理保存成功!'
349
+                })
350
+              } else {
351
+                this.$message({
352
+                  type: 'info',
353
+                  message: res.msg
354
+                })
355
+              }
356
+            })
357
+            .catch(err => {
358
+              this.editFormVisible = false
359
+              this.loading = false
360
+              this.$message.error('权限管理保存失败,请稍后再试!')
361
+            })
362
+        } else {
363
+          return false
364
+        }
365
+      })
366
+    },
367
+    // 删除权限
368
+    deleteUser(index, row) {
369
+      this.$confirm('确定要删除吗?', '信息', {
370
+        confirmButtonText: '确定',
371
+        cancelButtonText: '取消',
372
+        type: 'warning'
373
+      })
374
+        .then(() => {
375
+          ermissionDelete(row.permissionId)
376
+            .then(res => {
377
+              if (res.success) {
378
+                this.$message({
379
+                  type: 'success',
380
+                  message: '权限管理已删除!'
381
+                })
382
+                this.getdata(this.formInline)
383
+              } else {
384
+                this.$message({
385
+                  type: 'info',
386
+                  message: res.msg
387
+                })
388
+              }
389
+            })
390
+            .catch(err => {
391
+              this.loading = false
392
+              this.$message.error('权限管理删除失败,请稍后再试!')
393
+            })
394
+        })
395
+        .catch(() => {
396
+          this.$message({
397
+            type: 'info',
398
+            message: '已取消删除'
399
+          })
400
+        })
401
+    },
402
+    // 选择复选框事件
403
+    selectChange(val) {
404
+      this.selectdata = val
405
+    },
406
+    // 配置权限
407
+    RolePermission() {
408
+      let parms = {
409
+        roleId: '',
410
+        permissionIds: ''
411
+      }
412
+      if (this.formInline.roleId == '0') {
413
+        this.$message({
414
+          type: 'info',
415
+          message: '请选择角色'
416
+        })
417
+        return false
418
+      }
419
+      parms.roleId = this.formInline.roleId
420
+      let len = this.selectdata
421
+      let ids = []
422
+      if (len != 0) {
423
+        for (let i = 0; i < len.length; i++) {
424
+          ids.push(len[i].permissionId)
425
+        }
426
+      }
427
+      parms.permissionIds = ids.join(',')
428
+      RolePermission(parms)
429
+        .then(res => {
430
+          if (res.success) {
431
+            this.$message({
432
+              type: 'success',
433
+              message: '配置权限成功!'
434
+            })
435
+            this.getdata(this.formInline)
436
+          } else {
437
+            this.$message({
438
+              type: 'info',
439
+              message: res.msg
440
+            })
441
+          }
442
+        })
443
+        .catch(err => {
444
+          this.loading = false
445
+          this.$message.error('配置权限失败,请稍后再试!')
446
+        })
447
+    },
448
+    // 关闭编辑、增加弹出框
449
+    closeDialog() {
450
+      this.editFormVisible = false
451
+    }
452
+  }
453
+}
454
+</script>
455
+
456
+<style scoped>
457
+.user-search {
458
+  margin-top: 20px;
459
+}
460
+.userRole {
461
+  width: 100%;
462
+}
463
+</style>
464
+
465
+ 

+ 500
- 0
src/views/system/Role.vue ファイルの表示

@@ -0,0 +1,500 @@
1
+/**
2
+ * 系统管理  角色管理
3
+ */
4
+<template>
5
+  <div>
6
+    <!-- 面包屑导航 -->
7
+    <el-breadcrumb separator-class="el-icon-arrow-right">
8
+      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
9
+      <el-breadcrumb-item>角色管理</el-breadcrumb-item>
10
+    </el-breadcrumb>
11
+    <!-- 搜索筛选 -->
12
+    <el-form :inline="true" :model="formInline" class="user-search">
13
+
14
+      <el-form-item label="搜索:">
15
+        <el-input size="small" v-model="formInline.roleName" placeholder="输入角色名称"></el-input>
16
+      </el-form-item>
17
+      <el-form-item label="">
18
+        <el-input size="small" v-model="formInline.roleNo" placeholder="输入角色代码"></el-input>
19
+      </el-form-item>
20
+      <el-form-item>
21
+        <el-button size="small" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
22
+        <el-button size="small" type="primary" icon="el-icon-plus" @click="handleEdit()">添加</el-button>
23
+      </el-form-item>
24
+    </el-form>
25
+    <!--列表-->
26
+    <el-table size="small" :data="listData" highlight-current-row v-loading="loading" border element-loading-text="拼命加载中" style="width: 100%;">
27
+      <el-table-column align="center" type="selection" width="60">
28
+      </el-table-column>
29
+      <el-table-column sortable prop="roleName" label="角色名称" width="300">
30
+      </el-table-column>
31
+      <el-table-column sortable prop="roleNo" label="角色代码" width="300">
32
+      </el-table-column>
33
+      <el-table-column sortable prop="editTime" label="修改时间" width="300">
34
+        <template slot-scope="scope">
35
+          <div>{{scope.row.editTime|timestampToTime}}</div>
36
+        </template>
37
+      </el-table-column>
38
+      <el-table-column sortable prop="editUser" label="修改人" width="300">
39
+      </el-table-column>
40
+      <el-table-column align="center" label="操作" min-width="300">
41
+        <template slot-scope="scope">
42
+          <el-button size="mini" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
43
+          <el-button size="mini" type="danger" @click="deleteUser(scope.$index, scope.row)">删除</el-button>
44
+          <el-button size="mini" type="success" @click="menuAccess(scope.$index, scope.row)">菜单权限</el-button>
45
+        </template>
46
+      </el-table-column>
47
+    </el-table>
48
+    <!-- 分页组件 -->
49
+    <Pagination v-bind:child-msg="pageparm" @callFather="callFather"></Pagination>
50
+    <!-- 编辑界面 -->
51
+    <el-dialog :title="title" :visible.sync="editFormVisible" width="30%" @click='closeDialog("edit")'>
52
+      <el-form label-width="120px" :model="editForm" ref="editForm" :rules="rules">
53
+        <el-form-item label="系统编码" prop="systemNo">
54
+          <el-input size="small" v-model="editForm.systemNo" auto-complete="off" placeholder="请输入系统编码"></el-input>
55
+        </el-form-item>
56
+        <el-form-item label="角色名称" prop="roleName">
57
+          <el-input size="small" v-model="editForm.roleName" auto-complete="off" placeholder="请输入角色名称"></el-input>
58
+        </el-form-item>
59
+        <el-form-item label="角色代码" prop="roleNo">
60
+          <el-input size="small" v-model="editForm.roleNo" auto-complete="off" placeholder="请输入角色代码"></el-input>
61
+        </el-form-item>
62
+      </el-form>
63
+      <div slot="footer" class="dialog-footer">
64
+        <el-button size="small" @click='closeDialog("edit")'>取消</el-button>
65
+        <el-button size="small" type="primary" :loading="loading" class="title" @click="submitForm('editForm')">保存</el-button>
66
+      </div>
67
+    </el-dialog>
68
+    <!-- 菜单权限 -->
69
+    <el-dialog title="菜单权限" :visible.sync="menuAccessshow" width="30%" @click='closeDialog("perm")'>
70
+      <el-tree ref="tree" default-expand-all="" :data="RoleRight" :props="RoleRightProps" :default-checked-keys="checkmenu" node-key="id" show-checkbox>
71
+      </el-tree>
72
+      <div slot="footer" class="dialog-footer">
73
+        <el-button size="small" @click='closeDialog("perm")'>取消</el-button>
74
+        <el-button size="small" type="primary" :loading="loading" class="title" @click="menuPermSave">保存</el-button>
75
+      </div>
76
+    </el-dialog>
77
+  </div>
78
+</template>
79
+
80
+<script>
81
+import {
82
+  roleList,
83
+  roleSave,
84
+  roleDelete,
85
+  rolePwd,
86
+  RoleRightTree,
87
+  RoleRightSave
88
+} from '../../api/userMG'
89
+import Pagination from '../../components/Pagination'
90
+export default {
91
+  data() {
92
+    return {
93
+      nshow: true, //switch开启
94
+      fshow: false, //switch关闭
95
+      loading: false, //是显示加载
96
+      editFormVisible: false, //控制编辑页面显示与隐藏
97
+      menuAccessshow: false, //控制数据权限显示与隐藏
98
+      title: '添加',
99
+      editForm: {
100
+        roleId: '',
101
+        systemNo: '',
102
+        roleNo: '',
103
+        roleName: '',
104
+        token: localStorage.getItem('logintoken')
105
+      },
106
+      // rules 表单验证
107
+      rules: {
108
+        systemNo: [
109
+          { required: true, message: '请输入系统编码', trigger: 'blur' }
110
+        ],
111
+        roleNo: [
112
+          { required: true, message: '请输入角色代码', trigger: 'blur' }
113
+        ],
114
+        roleName: [
115
+          { required: true, message: '请输入角色名称', trigger: 'blur' }
116
+        ]
117
+      },
118
+      formInline: {
119
+        page: 1,
120
+        limit: 10,
121
+        varLable: '',
122
+        varName: '',
123
+        token: localStorage.getItem('logintoken')
124
+      },
125
+      // 删除
126
+      seletedata: {
127
+        ids: '',
128
+        token: localStorage.getItem('logintoken')
129
+      },
130
+      userparm: [], //搜索权限
131
+      listData: [], //用户数据
132
+      // 数据权限
133
+      RoleRight: [],
134
+      RoleRightProps: {
135
+        children: 'children',
136
+        label: 'name'
137
+      },
138
+      // 选中
139
+      checkmenu: [],
140
+      //参数role
141
+      saveroleId: '',
142
+      // 分页参数
143
+      pageparm: {
144
+        currentPage: 1,
145
+        pageSize: 10,
146
+        total: 10
147
+      }
148
+    }
149
+  },
150
+  // 注册组件
151
+  components: {
152
+    Pagination
153
+  },
154
+  /**
155
+   * 数据发生改变
156
+   */
157
+
158
+  watch: {},
159
+
160
+  /**
161
+   * 创建完毕
162
+   */
163
+
164
+  created() {
165
+    this.getdata(this.formInline)
166
+  },
167
+
168
+  /**
169
+   * 里面的方法只有被调用才会执行
170
+   */
171
+
172
+  methods: {
173
+    // 获取角色列表
174
+    getdata(parameter) {
175
+      // 模拟数据
176
+      let res = {
177
+        code: 0,
178
+        msg: null,
179
+        count: 6,
180
+        data: [
181
+          {
182
+            addUser: 'root',
183
+            editUser: 'root',
184
+            addTime: 1519182004000,
185
+            editTime: 1520288426000,
186
+            roleId: 1,
187
+            systemNo: 'pmd',
188
+            roleNo: 'Administrator',
189
+            roleName: '超级管理员'
190
+          },
191
+          {
192
+            addUser: null,
193
+            editUser: null,
194
+            addTime: 1521111376000,
195
+            editTime: 1520678191000,
196
+            roleId: 2,
197
+            systemNo: 'order',
198
+            roleNo: 'admin',
199
+            roleName: '公司管理员'
200
+          },
201
+          {
202
+            addUser: null,
203
+            editUser: null,
204
+            addTime: 1520678221000,
205
+            editTime: 1520678221000,
206
+            roleId: 95,
207
+            systemNo: 'pm',
208
+            roleNo: 'common',
209
+            roleName: '普通用户'
210
+          },
211
+          {
212
+            addUser: null,
213
+            editUser: null,
214
+            addTime: 1526349853000,
215
+            editTime: 1526349853000,
216
+            roleId: 96,
217
+            systemNo: '1',
218
+            roleNo: '1',
219
+            roleName: '1'
220
+          },
221
+          {
222
+            addUser: null,
223
+            editUser: null,
224
+            addTime: 1526349942000,
225
+            editTime: 1526437443000,
226
+            roleId: 97,
227
+            systemNo: '2',
228
+            roleNo: '2',
229
+            roleName: '2'
230
+          },
231
+          {
232
+            addUser: null,
233
+            editUser: null,
234
+            addTime: 1526652148000,
235
+            editTime: 1526652148000,
236
+            roleId: 101,
237
+            systemNo: 'test',
238
+            roleNo: 'demo',
239
+            roleName: '演示角色'
240
+          }
241
+        ]
242
+      }
243
+      this.loading = false
244
+      this.listData = res.data
245
+      // 分页赋值
246
+      this.pageparm.currentPage = this.formInline.page
247
+      this.pageparm.pageSize = this.formInline.limit
248
+      this.pageparm.total = res.count
249
+      // 模拟数据结束
250
+
251
+      /***
252
+       * 调用接口,注释上面模拟数据 取消下面注释
253
+       */
254
+      // roleList(parameter)
255
+      //   .then(res => {
256
+      //     this.loading = false
257
+      //     if (res.success == false) {
258
+      //       this.$message({
259
+      //         type: 'info',
260
+      //         message: res.msg
261
+      //       })
262
+      //     } else {
263
+      //       this.listData = res.data
264
+      //       // 分页赋值
265
+      //       this.pageparm.currentPage = this.formInline.page
266
+      //       this.pageparm.pageSize = this.formInline.limit
267
+      //       this.pageparm.total = res.count
268
+      //     }
269
+      //   })
270
+      //   .catch(err => {
271
+      //     this.loading = false
272
+      //     this.$message.error('获取角色列表失败,请稍后再试!')
273
+      //   })
274
+    },
275
+    // 分页插件事件
276
+    callFather(parm) {
277
+      this.formInline.page = parm.currentPage
278
+      this.formInline.limit = parm.pageSize
279
+      this.getdata(this.formInline)
280
+    },
281
+    // 搜索事件
282
+    search() {
283
+      this.getdata(this.formInline)
284
+    },
285
+    //显示编辑界面
286
+    handleEdit: function(index, row) {
287
+      this.editFormVisible = true
288
+      if (row != undefined && row != 'undefined') {
289
+        this.title = '修改'
290
+        this.editForm.roleId = row.roleId
291
+        this.editForm.systemNo = row.systemNo
292
+        this.editForm.roleNo = row.roleNo
293
+        this.editForm.roleName = row.roleName
294
+      } else {
295
+        this.title = '添加'
296
+        this.editForm.roleId = ''
297
+        this.editForm.systemNo = ''
298
+        this.editForm.roleNo = ''
299
+        this.editForm.roleName = ''
300
+      }
301
+    },
302
+    // 编辑、增加页面保存方法
303
+    submitForm(editData) {
304
+      this.$refs[editData].validate(valid => {
305
+        if (valid) {
306
+          roleSave(this.editForm)
307
+            .then(res => {
308
+              this.editFormVisible = false
309
+              this.loading = false
310
+              if (res.success) {
311
+                this.getdata(this.formInline)
312
+                this.$message({
313
+                  type: 'success',
314
+                  message: '角色保存成功!'
315
+                })
316
+              } else {
317
+                this.$message({
318
+                  type: 'info',
319
+                  message: res.msg
320
+                })
321
+              }
322
+            })
323
+            .catch(err => {
324
+              this.editFormVisible = false
325
+              this.loading = false
326
+              this.$message.error('角色保存失败,请稍后再试!')
327
+            })
328
+        } else {
329
+          return false
330
+        }
331
+      })
332
+    },
333
+    // 删除角色
334
+    deleteUser(index, row) {
335
+      this.$confirm('确定要删除吗?', '信息', {
336
+        confirmButtonText: '确定',
337
+        cancelButtonText: '取消',
338
+        type: 'warning'
339
+      })
340
+        .then(() => {
341
+          roleDelete(row.roleId)
342
+            .then(res => {
343
+              if (res.success) {
344
+                this.$message({
345
+                  type: 'success',
346
+                  message: '角色已删除!'
347
+                })
348
+                this.getdata(this.formInline)
349
+              } else {
350
+                this.$message({
351
+                  type: 'info',
352
+                  message: res.msg
353
+                })
354
+              }
355
+            })
356
+            .catch(err => {
357
+              this.loading = false
358
+              this.$message.error('角色删除失败,请稍后再试!')
359
+            })
360
+        })
361
+        .catch(() => {
362
+          this.$message({
363
+            type: 'info',
364
+            message: '已取消删除'
365
+          })
366
+        })
367
+    },
368
+    // 数据权限
369
+    menuAccess: function(index, row) {
370
+      this.menuAccessshow = true
371
+      this.saveroleId = row.roleId
372
+      RoleRightTree(row.roleId)
373
+        .then(res => {
374
+          if (res.data.success) {
375
+            this.$message({
376
+              type: 'success',
377
+              message: '获取权限成功'
378
+            })
379
+            this.changemenu(res.data.data)
380
+            this.RoleRight = this.changeArr(res.data.data)
381
+          } else {
382
+            this.$message({
383
+              type: 'info',
384
+              message: res.data.msg
385
+            })
386
+          }
387
+        })
388
+        .catch(err => {
389
+          this.loading = false
390
+          this.$message.error('获取权限失败,请稍后再试!')
391
+        })
392
+    },
393
+    // 选中菜单
394
+    changemenu(arr) {
395
+      let change = []
396
+      for (let i = 0; i < arr.length; i++) {
397
+        if (arr[i].checked) {
398
+          change.push(arr[i].id)
399
+        }
400
+      }
401
+      this.checkmenu = change
402
+    },
403
+    // tree 递归
404
+    changeArr(list) {
405
+      var temptree = [],
406
+        tree = [],
407
+        items = []
408
+      for (var i in list) {
409
+        if (!temptree[list[i].id]) {
410
+          var trow = {
411
+            id: list[i].id,
412
+            pId: list[i].pId,
413
+            name: list[i].name,
414
+            open: list[i].open,
415
+            checked: list[i].checked,
416
+            children: []
417
+          }
418
+          temptree[list[i].id] = trow
419
+          items.push(trow)
420
+        }
421
+        if (list[i].uid > 0) {
422
+          temptree[list[i].id]['children'].push({
423
+            id: list[i].id,
424
+            pId: list[i].pId,
425
+            name: list[i].name,
426
+            open: list[i].open,
427
+            checked: list[i].checked,
428
+            children: []
429
+          })
430
+        }
431
+      }
432
+
433
+      for (var j in items) {
434
+        if (temptree[items[j].pId]) {
435
+          temptree[items[j].pId]['children'].push(temptree[items[j].id])
436
+        } else {
437
+          tree.push(temptree[items[j].id])
438
+        }
439
+      }
440
+      temptree = null
441
+      items = null
442
+      return tree
443
+    },
444
+    // 菜单权限-保存
445
+    menuPermSave() {
446
+      let parm = {
447
+        roleId: this.saveroleId,
448
+        moduleIds: ''
449
+      }
450
+      let node = this.$refs.tree.getCheckedNodes()
451
+      let moduleIds = []
452
+      if (node.length != 0) {
453
+        for (let i = 0; i < node.length; i++) {
454
+          moduleIds.push(node[i].id)
455
+        }
456
+        parm.moduleIds = JSON.stringify(moduleIds)
457
+      }
458
+      RoleRightSave(parm)
459
+        .then(res => {
460
+          if (res.success) {
461
+            this.$message({
462
+              type: 'success',
463
+              message: '权限保存成功'
464
+            })
465
+            this.menuAccessshow = false
466
+            this.getdata(this.formInline)
467
+          } else {
468
+            this.$message({
469
+              type: 'info',
470
+              message: res.msg
471
+            })
472
+          }
473
+        })
474
+        .catch(err => {
475
+          this.loading = false
476
+          this.$message.error('权限保存失败,请稍后再试!')
477
+        })
478
+    },
479
+    // 关闭编辑、增加弹出框
480
+    closeDialog(dialog) {
481
+      if (dialog == 'edit') {
482
+        this.editFormVisible = false
483
+      } else if (dialog == 'perm') {
484
+        this.menuAccessshow = false
485
+      }
486
+    }
487
+  }
488
+}
489
+</script>
490
+
491
+<style scoped>
492
+.user-search {
493
+  margin-top: 20px;
494
+}
495
+.userRole {
496
+  width: 100%;
497
+}
498
+</style>
499
+
500
+ 

+ 367
- 0
src/views/system/Variable.vue ファイルの表示

@@ -0,0 +1,367 @@
1
+/**
2
+ * 系统管理  系统环境变量
3
+ */
4
+<template>
5
+  <div>
6
+    <!-- 面包屑导航 -->
7
+    <el-breadcrumb separator-class="el-icon-arrow-right">
8
+      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
9
+      <el-breadcrumb-item>系统环境变量</el-breadcrumb-item>
10
+    </el-breadcrumb>
11
+    <!-- 搜索筛选 -->
12
+    <el-form :inline="true" :model="formInline" class="user-search">
13
+
14
+      <el-form-item label="搜索:">
15
+        <el-input size="small" v-model="formInline.varLable" placeholder="输入变量描述"></el-input>
16
+      </el-form-item>
17
+      <el-form-item label="">
18
+        <el-input size="small" v-model="formInline.varName" placeholder="输入变量名称"></el-input>
19
+      </el-form-item>
20
+      <el-form-item>
21
+        <el-button size="small" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
22
+        <el-button size="small" type="primary" icon="el-icon-plus" @click="handleEdit()">添加</el-button>
23
+      </el-form-item>
24
+    </el-form>
25
+    <!--列表-->
26
+    <el-table size="small" :data="listData" highlight-current-row v-loading="loading" border element-loading-text="拼命加载中" style="width: 100%;">
27
+      <el-table-column align="center" type="selection" width="60">
28
+      </el-table-column>
29
+      <el-table-column sortable prop="varLable" label="变量描述" width="200">
30
+      </el-table-column>
31
+      <el-table-column sortable prop="varName" label="变量名称" width="200">
32
+      </el-table-column>
33
+      <el-table-column sortable prop="varValue" label="变量名称" width="300">
34
+      </el-table-column>
35
+      <el-table-column sortable prop="editTime" label="修改时间" width="200">
36
+        <template slot-scope="scope">
37
+          <div>{{scope.row.editTime|timestampToTime}}</div>
38
+        </template>
39
+      </el-table-column>
40
+      <el-table-column sortable prop="editUser" label="修改人" width="200">
41
+      </el-table-column>
42
+      <el-table-column align="center" label="操作" min-width="300">
43
+        <template slot-scope="scope">
44
+          <el-button size="mini" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
45
+          <el-button size="mini" type="danger" @click="deleteUser(scope.$index, scope.row)">删除</el-button>
46
+        </template>
47
+      </el-table-column>
48
+    </el-table>
49
+    <!-- 分页组件 -->
50
+    <Pagination v-bind:child-msg="pageparm" @callFather="callFather"></Pagination>
51
+    <!-- 编辑界面 -->
52
+    <el-dialog title="修改" :visible.sync="editFormVisible" width="30%" @click="closeDialog">
53
+      <el-form label-width="120px" :model="editForm" :rules="rules" ref="editForm">
54
+        <el-form-item label="变量描述" prop="varLable">
55
+          <el-input size="small" v-model="editForm.varLable" auto-complete="off" placeholder="变量描述"></el-input>
56
+        </el-form-item>
57
+        <el-form-item label="变量名称" prop="varName">
58
+          <el-input size="small" v-model="editForm.varName" auto-complete="off" placeholder="变量名称"></el-input>
59
+        </el-form-item>
60
+        <el-form-item label="变量名称" prop="varValue">
61
+          <el-input size="small" v-model="editForm.varValue" auto-complete="off" placeholder="变量名称"></el-input>
62
+        </el-form-item>
63
+      </el-form>
64
+      <div slot="footer" class="dialog-footer">
65
+        <el-button size="small" @click="closeDialog">取消</el-button>
66
+        <el-button size="small" type="primary" :loading="loading" class="title" @click="submitForm('editForm')">保存</el-button>
67
+      </div>
68
+    </el-dialog>
69
+  </div>
70
+</template>
71
+
72
+<script>
73
+import { variableList, variableSave, variableDelete } from '../../api/userMG'
74
+import Pagination from '../../components/Pagination'
75
+export default {
76
+  data() {
77
+    return {
78
+      nshow: true, //switch开启
79
+      fshow: false, //switch关闭
80
+      loading: false, //是显示加载
81
+      editFormVisible: false, //控制编辑页面显示与隐藏
82
+      title: '添加',
83
+      editForm: {
84
+        varId: '',
85
+        varLable: '',
86
+        varName: '',
87
+        varValue: '',
88
+        token: localStorage.getItem('logintoken')
89
+      },
90
+      // rules表单验证
91
+      rules: {
92
+        varLable: [
93
+          { required: true, message: '请输入变量描述', trigger: 'blur' }
94
+        ],
95
+        varName: [
96
+          { required: true, message: '请输入变量名称', trigger: 'blur' }
97
+        ],
98
+        varValue: [
99
+          { required: true, message: '请输入变量名称', trigger: 'blur' }
100
+        ]
101
+      },
102
+      formInline: {
103
+        page: 1,
104
+        limit: 10,
105
+        varLable: '',
106
+        varName: '',
107
+        token: localStorage.getItem('logintoken')
108
+      },
109
+      // 删除
110
+      seletedata: {
111
+        ids: '',
112
+        token: localStorage.getItem('logintoken')
113
+      },
114
+      userparm: [], //搜索权限
115
+      listData: [], //用户数据
116
+      // 分页参数
117
+      pageparm: {
118
+        currentPage: 1,
119
+        pageSize: 10,
120
+        total: 10
121
+      }
122
+    }
123
+  },
124
+  // 注册组件
125
+  components: {
126
+    Pagination
127
+  },
128
+  /**
129
+   * 数据发生改变
130
+   */
131
+
132
+  watch: {},
133
+
134
+  /**
135
+   * 创建完毕
136
+   */
137
+
138
+  created() {
139
+    this.getdata(this.formInline)
140
+  },
141
+
142
+  /**
143
+   * 里面的方法只有被调用才会执行
144
+   */
145
+
146
+  methods: {
147
+    // 获取数据方法
148
+    getdata(parameter) {
149
+      this.loading = true
150
+      // 模拟数据
151
+      let res = {
152
+        code: 0,
153
+        msg: null,
154
+        count: 6,
155
+        data: [
156
+          {
157
+            addUser: 'root',
158
+            editUser: 'root',
159
+            addTime: 1519385529000,
160
+            editTime: 1520619747000,
161
+            varId: 190,
162
+            deptId: 1,
163
+            varLable: '支付访问域名',
164
+            varName: 'domainName',
165
+            varValue: 'http://127.0.0.1:8080/iot-service-pay'
166
+          },
167
+          {
168
+            addUser: 'root',
169
+            editUser: 'root',
170
+            addTime: 1519451541000,
171
+            editTime: 1519451547000,
172
+            varId: 191,
173
+            deptId: 1,
174
+            varLable: '商品图片地址',
175
+            varName: 'productImgURL',
176
+            varValue: 'http://ymwlw.com/pic'
177
+          },
178
+          {
179
+            addUser: 'root',
180
+            editUser: 'root',
181
+            addTime: 1519452658000,
182
+            editTime: 1519452661000,
183
+            varId: 192,
184
+            deptId: 1,
185
+            varLable: '手机支付广告地址',
186
+            varName: 'groupDomain',
187
+            varValue: 'http://ymwlwl.com'
188
+          },
189
+          {
190
+            addUser: null,
191
+            editUser: null,
192
+            addTime: 1519879624000,
193
+            editTime: 1519879628000,
194
+            varId: 193,
195
+            deptId: 1,
196
+            varLable: '下单接口测试模式',
197
+            varName: 'envType',
198
+            varValue: 'false'
199
+          },
200
+          {
201
+            addUser: null,
202
+            editUser: null,
203
+            addTime: 1526374014000,
204
+            editTime: 1526374031000,
205
+            varId: 198,
206
+            deptId: null,
207
+            varLable: 'sgh',
208
+            varName: 'jhjj',
209
+            varValue: 'jhjhgs'
210
+          },
211
+          {
212
+            addUser: null,
213
+            editUser: null,
214
+            addTime: 1526453243000,
215
+            editTime: 1526453243000,
216
+            varId: 199,
217
+            deptId: null,
218
+            varLable: 'v',
219
+            varName: 'v',
220
+            varValue: 'v'
221
+          }
222
+        ]
223
+      }
224
+      this.loading = false
225
+      this.listData = res.data
226
+      // 分页赋值
227
+      this.pageparm.currentPage = this.formInline.page
228
+      this.pageparm.pageSize = this.formInline.limit
229
+      this.pageparm.total = res.count
230
+      // 模拟数据结束
231
+
232
+      /***
233
+       * 调用接口,注释上面模拟数据 取消下面注释
234
+       */
235
+      // variableList(parameter)
236
+      //   .then(res => {
237
+      //     console.log(JSON.stringify(res))
238
+      //     this.loading = false
239
+      //     if (res.success == false) {
240
+      //       this.$message({
241
+      //         type: 'info',
242
+      //         message: res.msg
243
+      //       })
244
+      //     } else {
245
+      //       this.listData = res.data
246
+      //       // 分页赋值
247
+      //       this.pageparm.currentPage = this.formInline.page
248
+      //       this.pageparm.pageSize = this.formInline.limit
249
+      //       this.pageparm.total = res.count
250
+      //     }
251
+      //   })
252
+      //   .catch(err => {
253
+      //     this.loading = false
254
+      //     this.$message.error('菜单加载失败,请稍后再试!')
255
+      //   })
256
+    },
257
+    // 分页插件事件
258
+    callFather(parm) {
259
+      this.formInline.page = parm.currentPage
260
+      this.formInline.limit = parm.pageSize
261
+      this.getdata(this.formInline)
262
+    },
263
+    // 搜索事件
264
+    search() {
265
+      this.getdata(this.formInline)
266
+    },
267
+    //显示编辑界面
268
+    handleEdit: function(index, row) {
269
+      this.editFormVisible = true
270
+      if (row != undefined && row != 'undefined') {
271
+        this.title = '修改'
272
+        this.editForm.varId = row.varId
273
+        this.editForm.varLable = row.varLable
274
+        this.editForm.varName = row.varName
275
+        this.editForm.varValue = row.varValue
276
+      } else {
277
+        this.title = '添加'
278
+        this.editForm.varId = ''
279
+        this.editForm.varLable = ''
280
+        this.editForm.varName = ''
281
+        this.editForm.varValue = ''
282
+      }
283
+    },
284
+    // 编辑、增加页面保存方法
285
+    submitForm(editData) {
286
+      this.$refs[editData].validate(valid => {
287
+        if (valid) {
288
+          variableSave(this.editForm)
289
+            .then(res => {
290
+              this.editFormVisible = false
291
+              this.loading = false
292
+              if (res.success) {
293
+                this.getdata(this.formInline)
294
+                this.$message({
295
+                  type: 'success',
296
+                  message: '系统环境变量保存成功!'
297
+                })
298
+              } else {
299
+                this.$message({
300
+                  type: 'info',
301
+                  message: res.msg
302
+                })
303
+              }
304
+            })
305
+            .catch(err => {
306
+              this.editFormVisible = false
307
+              this.loading = false
308
+              this.$message.error('系统环境变量保存失败,请稍后再试!')
309
+            })
310
+        } else {
311
+          return false
312
+        }
313
+      })
314
+    },
315
+    // 删除权限
316
+    deleteUser(index, row) {
317
+      this.$confirm('确定要删除吗?', '信息', {
318
+        confirmButtonText: '确定',
319
+        cancelButtonText: '取消',
320
+        type: 'warning'
321
+      })
322
+        .then(() => {
323
+          variableDelete(row.varId)
324
+            .then(res => {
325
+              if (res.success) {
326
+                this.$message({
327
+                  type: 'success',
328
+                  message: '系统环境变量已删除'
329
+                })
330
+                this.getdata(this.formInline)
331
+              } else {
332
+                this.$message({
333
+                  type: 'info',
334
+                  message: res.msg
335
+                })
336
+              }
337
+            })
338
+            .catch(err => {
339
+              this.loading = false
340
+              this.$message.error('系统环境变量删除失败,请稍后再试!')
341
+            })
342
+        })
343
+        .catch(() => {
344
+          this.$message({
345
+            type: 'info',
346
+            message: '已取消删除'
347
+          })
348
+        })
349
+    },
350
+    // 关闭编辑、增加弹出框
351
+    closeDialog() {
352
+      this.editFormVisible = false
353
+    }
354
+  }
355
+}
356
+</script>
357
+
358
+<style scoped>
359
+.user-search {
360
+  margin-top: 20px;
361
+}
362
+.userRole {
363
+  width: 100%;
364
+}
365
+</style>
366
+
367
+ 

+ 907
- 0
src/views/system/user.vue ファイルの表示

@@ -0,0 +1,907 @@
1
+/**
2
+ * 系统管理 用户管理
3
+ */
4
+<template>
5
+  <div>
6
+    <!-- 面包屑导航 -->
7
+    <el-breadcrumb separator-class="el-icon-arrow-right">
8
+      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
9
+      <el-breadcrumb-item>用户管理</el-breadcrumb-item>
10
+    </el-breadcrumb>
11
+    <!-- 搜索筛选 -->
12
+    <el-form :inline="true" :model="formInline" class="user-search">
13
+      <el-form-item label="搜索:">
14
+        <el-select size="small" v-model="formInline.isLock" placeholder="请选择">
15
+          <el-option label="全部" value=""></el-option>
16
+          <el-option label="正常" value="N"></el-option>
17
+          <el-option label="已锁定" value="Y"></el-option>
18
+        </el-select>
19
+      </el-form-item>
20
+      <el-form-item label="">
21
+        <el-input size="small" v-model="formInline.userName" placeholder="输入用户名"></el-input>
22
+      </el-form-item>
23
+      <el-form-item label="">
24
+        <el-input size="small" v-model="formInline.userMobile" placeholder="输入手机号"></el-input>
25
+      </el-form-item>
26
+      <el-form-item>
27
+        <el-button size="small" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
28
+        <el-button size="small" type="primary" icon="el-icon-plus" @click="handleEdit()">添加</el-button>
29
+        <el-button size="small" type="primary" @click="handleunit()">部门设置</el-button>
30
+      </el-form-item>
31
+    </el-form>
32
+    <!--列表-->
33
+    <el-table size="small" @selection-change="selectChange" :data="userData" highlight-current-row v-loading="loading" border element-loading-text="拼命加载中" style="width: 100%;">
34
+      <el-table-column align="center" type="selection" width="50">
35
+      </el-table-column>
36
+      <el-table-column align="center" sortable prop="deptName" label="公司" width="120">
37
+      </el-table-column>
38
+      <el-table-column align="center" sortable prop="userName" label="用户名" width="120">
39
+      </el-table-column>
40
+      <el-table-column align="center" sortable prop="userRealName" label="姓名" width="120">
41
+      </el-table-column>
42
+      <el-table-column align="center" sortable prop="userMobile" label="手机号" width="120">
43
+      </el-table-column>
44
+      <el-table-column align="center" sortable prop="userSex" label="性别" min-width="50">
45
+      </el-table-column>
46
+      <el-table-column align="center" sortable prop="userEmail" label="邮件" min-width="120">
47
+      </el-table-column>
48
+      <el-table-column align="center" sortable prop="editTime" label="修改时间" min-width="120">
49
+        <template slot-scope="scope">
50
+          <div>{{scope.row.editTime|timestampToTime}}</div>
51
+        </template>
52
+      </el-table-column>
53
+      <el-table-column align="center" sortable prop="isLock" label="状态" min-width="50">
54
+        <template slot-scope="scope">
55
+          <el-switch v-model="scope.row.isLock=='N'?nshow:fshow" active-color="#13ce66" inactive-color="#ff4949" @change="editType(scope.$index, scope.row)">
56
+          </el-switch>
57
+        </template>
58
+      </el-table-column>
59
+      <el-table-column label="操作" min-width="300">
60
+        <template slot-scope="scope">
61
+          <el-button size="mini" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
62
+          <el-button size="mini" type="danger" @click="deleteUser(scope.$index, scope.row)">删除</el-button>
63
+          <el-button size="mini" type="success" @click="resetpwd(scope.$index, scope.row)">重置密码</el-button>
64
+          <el-button size="mini" type="success" @click="dataAccess(scope.$index, scope.row)">数据权限</el-button>
65
+          <el-button size="mini" type="success" @click="offlineUser(scope.$index, scope.row)">下线</el-button>
66
+          <el-button size="mini" type="success" @click="refreshCache(scope.$index, scope.row)">刷新缓存</el-button>
67
+        </template>
68
+      </el-table-column>
69
+    </el-table>
70
+    <!-- 分页组件 -->
71
+    <Pagination v-bind:child-msg="pageparm" @callFather="callFather"></Pagination>
72
+    <!-- 编辑界面 -->
73
+    <el-dialog :title="title" :visible.sync="editFormVisible" width="30%" @click='closeDialog("edit")'>
74
+      <el-form label-width="80px" ref="editForm" :model="editForm" :rules="rules">
75
+        <el-form-item label="用户名" prop="userName">
76
+          <el-input size="small" v-model="editForm.userName" auto-complete="off" placeholder="请输入用户名"></el-input>
77
+        </el-form-item>
78
+        <el-form-item label="姓名" prop="userRealName">
79
+          <el-input size="small" v-model="editForm.userRealName" auto-complete="off" placeholder="请输入姓名"></el-input>
80
+        </el-form-item>
81
+        <el-form-item label="角色" prop="roleId">
82
+          <el-select size="small" v-model="editForm.roleId" placeholder="请选择" class="userRole">
83
+            <el-option label="公司管理员" value="1"></el-option>
84
+            <el-option label="普通用户" value="2"></el-option>
85
+          </el-select>
86
+        </el-form-item>
87
+        <el-form-item label="手机号" prop="userMobile">
88
+          <el-input size="small" v-model="editForm.userMobile" placeholder="请输入手机号"></el-input>
89
+        </el-form-item>
90
+        <el-form-item label="邮件" prop="userEmail">
91
+          <el-input size="small" v-model="editForm.userEmail" placeholder="请输入邮箱地址"></el-input>
92
+        </el-form-item>
93
+        <el-form-item label="性别" prop="userSex">
94
+          <el-radio v-model="editForm.userSex" label="男">男</el-radio>
95
+          <el-radio v-model="editForm.userSex" label="女">女</el-radio>
96
+        </el-form-item>
97
+      </el-form>
98
+      <div slot="footer" class="dialog-footer">
99
+        <el-button size="small" @click='closeDialog("edit")'>取消</el-button>
100
+        <el-button size="small" type="primary" :loading="loading" class="title" @click="submitForm('editForm')">保存</el-button>
101
+      </div>
102
+    </el-dialog>
103
+    <!-- 数据权限 -->
104
+    <el-dialog title="数据权限" :visible.sync="dataAccessshow" width="30%" @click='closeDialog("perm")'>
105
+      <el-tree ref="tree" default-expand-all="" :data="UserDept" :props="defaultProps" :default-checked-keys="checkmenu" node-key="id" show-checkbox>
106
+      </el-tree>
107
+      <div slot="footer" class="dialog-footer">
108
+        <el-button size="small" @click='closeDialog("perm")'>取消</el-button>
109
+        <el-button size="small" type="primary" :loading="loading" class="title" @click="menuPermSave">保存</el-button>
110
+      </div>
111
+    </el-dialog>
112
+    <!-- 所属单位 -->
113
+    <el-dialog title="所属单位" :visible.sync="unitAccessshow" width="30%" @click='closeDialog("unit")'>
114
+      <el-tree ref="tree" default-expand-all="" :data="UserDept" :props="defaultProps" @check-change="handleClick" :default-checked-keys="checkmenu" node-key="id" show-checkbox check-strictly>
115
+      </el-tree>
116
+      <div slot="footer" class="dialog-footer">
117
+        <el-button size="small" @click='closeDialog("unit")'>取消</el-button>
118
+        <el-button size="small" type="primary" :loading="loading" class="title" @click="unitPermSave">保存</el-button>
119
+      </div>
120
+    </el-dialog>
121
+  </div>
122
+</template>
123
+
124
+<script>
125
+// 导入请求方法
126
+import {
127
+  userList,
128
+  userSave,
129
+  userDelete,
130
+  userPwd,
131
+  userExpireToken,
132
+  userFlashCache,
133
+  userLock,
134
+  UserDeptTree,
135
+  UserDeptSave,
136
+  UserDeptdeptTree,
137
+  UserChangeDept
138
+} from '../../api/userMG'
139
+import Pagination from '../../components/Pagination'
140
+export default {
141
+  data() {
142
+    return {
143
+      nshow: true, //switch开启
144
+      fshow: false, //switch关闭
145
+      loading: false, //是显示加载
146
+      title: '添加用户',
147
+      editFormVisible: false, //控制编辑页面显示与隐藏
148
+      dataAccessshow: false, //控制数据权限显示与隐藏
149
+      unitAccessshow: false, //控制所属单位隐藏与显示
150
+      // 编辑与添加
151
+      editForm: {
152
+        userId: '',
153
+        userName: '',
154
+        userRealName: '',
155
+        roleId: '',
156
+        userMobile: '',
157
+        userEmail: '',
158
+        userSex: '',
159
+        token: localStorage.getItem('logintoken')
160
+      },
161
+      // 部门参数
162
+      unitparm: {
163
+        userIds: '',
164
+        deptId: '',
165
+        deptName: ''
166
+      },
167
+      // 选择数据
168
+      selectdata: [],
169
+      // rules表单验证
170
+      rules: {
171
+        userName: [
172
+          { required: true, message: '请输入用户名', trigger: 'blur' }
173
+        ],
174
+        userRealName: [
175
+          { required: true, message: '请输入姓名', trigger: 'blur' }
176
+        ],
177
+        roleId: [{ required: true, message: '请选择角色', trigger: 'blur' }],
178
+        userMobile: [
179
+          { required: true, message: '请输入手机号', trigger: 'blur' },
180
+          {
181
+            pattern: /^1(3\d|47|5((?!4)\d)|7(0|1|[6-8])|8\d)\d{8,8}$/,
182
+            required: true,
183
+            message: '请输入正确的手机号',
184
+            trigger: 'blur'
185
+          }
186
+        ],
187
+        userEmail: [
188
+          { required: true, message: '请输入邮箱', trigger: 'blur' },
189
+          {
190
+            pattern: /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/,
191
+            required: true,
192
+            message: '请输入正确的邮箱',
193
+            trigger: 'blur'
194
+          }
195
+        ],
196
+        userSex: [{ required: true, message: '请选择性别', trigger: 'blur' }]
197
+      },
198
+      // 删除用户
199
+      seletedata: {
200
+        ids: '',
201
+        token: localStorage.getItem('logintoken')
202
+      },
203
+      // 重置密码
204
+      resetpsd: {
205
+        userId: '',
206
+        token: localStorage.getItem('logintoken')
207
+      },
208
+      // 用户下线
209
+      offline: {
210
+        token: localStorage.getItem('logintoken')
211
+      },
212
+      // 请求数据参数
213
+      formInline: {
214
+        page: 1,
215
+        limit: 10,
216
+        deptId: '',
217
+        userName: '',
218
+        userMobile: '',
219
+        isLock: ''
220
+      },
221
+      //用户数据
222
+      userData: [],
223
+      // 数据权限
224
+      UserDept: [],
225
+      defaultProps: {
226
+        children: 'children',
227
+        label: 'name'
228
+      },
229
+      // 选中
230
+      checkmenu: [],
231
+      //参数role
232
+      saveroleId: '',
233
+      // 分页参数
234
+      pageparm: {
235
+        currentPage: 1,
236
+        pageSize: 10,
237
+        total: 10
238
+      }
239
+    }
240
+  },
241
+  // 注册组件
242
+  components: {
243
+    Pagination
244
+  },
245
+
246
+  /**
247
+   * 数据发生改变
248
+   */
249
+  watch: {},
250
+
251
+  /**
252
+   * 创建完毕
253
+   */
254
+  created() {
255
+    this.getdata(this.formInline)
256
+  },
257
+
258
+  /**
259
+   * 里面的方法只有被调用才会执行
260
+   */
261
+  methods: {
262
+    // 获取数据方法
263
+    getdata(parameter) {
264
+      this.loading = true
265
+      // 模拟数据开始
266
+      let res = {
267
+        code: 0,
268
+        msg: null,
269
+        count: 12,
270
+        data: [
271
+          {
272
+            addUser: '1',
273
+            editUser: '1',
274
+            addTime: null,
275
+            editTime: 1527411068000,
276
+            userId: 1,
277
+            systemNo: 'pmd',
278
+            userName: 'root',
279
+            userPassword: 'e10adc3949ba59abbe56e057f20f883e',
280
+            userRealName: '超级管理员',
281
+            userSex: '女',
282
+            userMobile: '138123456789',
283
+            userEmail: '111@qq.com',
284
+            isLock: 'N',
285
+            deptId: 1,
286
+            deptName: 'xxxx',
287
+            roleId: 1
288
+          },
289
+          {
290
+            addUser: '1',
291
+            editUser: '1',
292
+            addTime: null,
293
+            editTime: 1527410579000,
294
+            userId: 3,
295
+            systemNo: 'mc',
296
+            userName: 'zengzhuo',
297
+            userPassword: 'e10adc3949ba59abbe56e057f20f883e',
298
+            userRealName: '系统管理员',
299
+            userSex: 'M',
300
+            userMobile: '18616988966',
301
+            userEmail: '222@qq.com',
302
+            isLock: 'N',
303
+            deptId: 2,
304
+            deptName: 'xxxx',
305
+            roleId: 101
306
+          },
307
+          {
308
+            addUser: '1',
309
+            editUser: '4',
310
+            addTime: null,
311
+            editTime: 1527411586000,
312
+            userId: 4,
313
+            systemNo: 'ec',
314
+            userName: 'admin',
315
+            userPassword: '59ba8b7dda9ff79186311a5a9fa155ca',
316
+            userRealName: '超级管理员',
317
+            userSex: '女',
318
+            userMobile: '138123456789',
319
+            userEmail: 'huangxuekun@founder.com',
320
+            isLock: 'N',
321
+            deptId: 2,
322
+            deptName: 'xxxx',
323
+            roleId: 3
324
+          },
325
+          {
326
+            addUser: null,
327
+            editUser: null,
328
+            addTime: 1526275128000,
329
+            editTime: 1526284402000,
330
+            userId: 28,
331
+            systemNo: null,
332
+            userName: 'eee111',
333
+            userPassword: 'e10adc3949ba59abbe56e057f20f883e',
334
+            userRealName: '123111',
335
+            userSex: '男',
336
+            userMobile: '12354342345',
337
+            userEmail: '111232@qq.com',
338
+            isLock: 'N',
339
+            deptId: 4,
340
+            deptName: 'zxxxxx',
341
+            roleId: 1
342
+          },
343
+          {
344
+            addUser: null,
345
+            editUser: null,
346
+            addTime: 1526284533000,
347
+            editTime: 1526284533000,
348
+            userId: 37,
349
+            systemNo: null,
350
+            userName: 'ces',
351
+            userPassword: 'e10adc3949ba59abbe56e057f20f883e',
352
+            userRealName: 'sesfg',
353
+            userSex: '男',
354
+            userMobile: '12312312312',
355
+            userEmail: '122111111',
356
+            isLock: 'N',
357
+            deptId: 1,
358
+            deptName: 'xxxx',
359
+            roleId: 1
360
+          },
361
+          {
362
+            addUser: null,
363
+            editUser: null,
364
+            addTime: 1526285228000,
365
+            editTime: 1526285228000,
366
+            userId: 43,
367
+            systemNo: null,
368
+            userName: '22',
369
+            userPassword: 'e10adc3949ba59abbe56e057f20f883e',
370
+            userRealName: '22',
371
+            userSex: '男',
372
+            userMobile: '222',
373
+            userEmail: '222',
374
+            isLock: 'N',
375
+            deptId: 1,
376
+            deptName: 'xxxx',
377
+            roleId: 1
378
+          },
379
+          {
380
+            addUser: null,
381
+            editUser: null,
382
+            addTime: 1526448593000,
383
+            editTime: 1526448593000,
384
+            userId: 58,
385
+            systemNo: null,
386
+            userName: '1',
387
+            userPassword: 'e10adc3949ba59abbe56e057f20f883e',
388
+            userRealName: '1',
389
+            userSex: '女',
390
+            userMobile: '13607118810',
391
+            userEmail: '1@qq.com',
392
+            isLock: 'N',
393
+            deptId: 1,
394
+            deptName: 'xxxx',
395
+            roleId: 1
396
+          },
397
+          {
398
+            addUser: null,
399
+            editUser: null,
400
+            addTime: 1526452698000,
401
+            editTime: 1526520341000,
402
+            userId: 60,
403
+            systemNo: null,
404
+            userName: '222222222',
405
+            userPassword: 'e10adc3949ba59abbe56e057f20f883e',
406
+            userRealName: '222222222222',
407
+            userSex: '男',
408
+            userMobile: '13607118810',
409
+            userEmail: '111@qq.com',
410
+            isLock: 'N',
411
+            deptId: 1,
412
+            deptName: 'xxxx',
413
+            roleId: 1
414
+          },
415
+          {
416
+            addUser: null,
417
+            editUser: null,
418
+            addTime: 1526452731000,
419
+            editTime: 1526452731000,
420
+            userId: 61,
421
+            systemNo: null,
422
+            userName: '33333333333333',
423
+            userPassword: 'e10adc3949ba59abbe56e057f20f883e',
424
+            userRealName: '4444444444444444444',
425
+            userSex: '女',
426
+            userMobile: '13607118810',
427
+            userEmail: 'qqq@qq.com',
428
+            isLock: 'N',
429
+            deptId: 1,
430
+            deptName: 'xxxx',
431
+            roleId: 2
432
+          },
433
+          {
434
+            addUser: null,
435
+            editUser: null,
436
+            addTime: 1526452756000,
437
+            editTime: 1527128981000,
438
+            userId: 62,
439
+            systemNo: null,
440
+            userName: '211111111',
441
+            userPassword: 'e10adc3949ba59abbe56e057f20f883e',
442
+            userRealName: '21111111111',
443
+            userSex: '男',
444
+            userMobile: '13601478451',
445
+            userEmail: '222222@qq.com',
446
+            isLock: 'N',
447
+            deptId: 17,
448
+            deptName: 'v',
449
+            roleId: 2
450
+          }
451
+        ]
452
+      }
453
+      this.loading = false
454
+      this.userData = res.data
455
+      // 分页赋值
456
+      this.pageparm.currentPage = this.formInline.page
457
+      this.pageparm.pageSize = this.formInline.limit
458
+      this.pageparm.total = res.count
459
+      // 模拟数据结束
460
+
461
+      /***
462
+       * 调用接口,注释上面模拟数据 取消下面注释
463
+       */
464
+      // 获取用户列表
465
+      // userList(parameter).then(res => {
466
+      //   this.loading = false
467
+      //   if (res.success == false) {
468
+      //     this.$message({
469
+      //       type: 'info',
470
+      //       message: res.msg
471
+      //     })
472
+      //   } else {
473
+      //     this.userData = res.data
474
+      //     // 分页赋值
475
+      //     this.pageparm.currentPage = this.formInline.page
476
+      //     this.pageparm.pageSize = this.formInline.limit
477
+      //     this.pageparm.total = res.count
478
+      //   }
479
+      // })
480
+    },
481
+    // 分页插件事件
482
+    callFather(parm) {
483
+      this.formInline.page = parm.currentPage
484
+      this.formInline.limit = parm.pageSize
485
+      this.getdata(this.formInline)
486
+    },
487
+    //搜索事件
488
+    search() {
489
+      this.getdata(this.formInline)
490
+    },
491
+    // 修改type
492
+    editType: function(index, row) {
493
+      this.loading = true
494
+      let parm = {
495
+        lock: '',
496
+        userId: '',
497
+        token: localStorage.getItem('logintoken')
498
+      }
499
+      parm.userId = row.userId
500
+      let lock = row.isLock
501
+      if (lock == 'N') {
502
+        parm.lock = 'Y'
503
+      } else {
504
+        parm.lock = 'N'
505
+      }
506
+      // 修改状态
507
+      userLock(parm).then(res => {
508
+        this.loading = false
509
+        if (res.success == false) {
510
+          this.$message({
511
+            type: 'info',
512
+            message: res.msg
513
+          })
514
+        } else {
515
+          this.$message({
516
+            type: 'success',
517
+            message: '状态修改成功'
518
+          })
519
+          this.getdata(this.formInline)
520
+        }
521
+      })
522
+    },
523
+    //显示编辑界面
524
+    handleEdit: function(index, row) {
525
+      this.editFormVisible = true
526
+      if (row != undefined && row != 'undefined') {
527
+        this.title = '修改用户'
528
+        this.editForm.userId = row.userId
529
+        this.editForm.userName = row.userName
530
+        this.editForm.userRealName = row.userRealName
531
+        this.editForm.roleId = row.roleId
532
+        this.editForm.userMobile = row.userMobile
533
+        this.editForm.userEmail = row.userEmail
534
+        this.editForm.userSex = row.userSex
535
+      } else {
536
+        this.title = '添加用户'
537
+        this.editForm.userId = ''
538
+        this.editForm.userName = ''
539
+        this.editForm.userRealName = ''
540
+        this.editForm.roleId = ''
541
+        this.editForm.userMobile = ''
542
+        this.editForm.userEmail = ''
543
+        this.editForm.userSex = ''
544
+      }
545
+    },
546
+    // 编辑、添加提交方法
547
+    submitForm(editData) {
548
+      this.$refs[editData].validate(valid => {
549
+        if (valid) {
550
+          // 请求方法
551
+          userSave(this.editForm)
552
+            .then(res => {
553
+              this.editFormVisible = false
554
+              this.loading = false
555
+              if (res.success) {
556
+                this.getdata(this.formInline)
557
+                this.$message({
558
+                  type: 'success',
559
+                  message: '数据保存成功!'
560
+                })
561
+              } else {
562
+                this.$message({
563
+                  type: 'info',
564
+                  message: res.msg
565
+                })
566
+              }
567
+            })
568
+            .catch(err => {
569
+              this.editFormVisible = false
570
+              this.loading = false
571
+              this.$message.error('保存失败,请稍后再试!')
572
+            })
573
+        } else {
574
+          return false
575
+        }
576
+      })
577
+    },
578
+    // 显示部门设置
579
+    handleunit: function(index, row) {
580
+      this.unitAccessshow = true
581
+      let parms = 0
582
+      UserDeptdeptTree(parms)
583
+        .then(res => {
584
+          if (res.data.success) {
585
+            this.UserDept = this.changeArr(res.data.data)
586
+          } else {
587
+            this.$message({
588
+              type: 'info',
589
+              message: res.msg
590
+            })
591
+          }
592
+        })
593
+        .catch(err => {
594
+          this.loading = false
595
+          this.$message.error('配置权限失败,请稍后再试!')
596
+        })
597
+    },
598
+    handleClick(data, checked, node) {
599
+      if (checked) {
600
+        this.$refs.tree.setCheckedNodes([])
601
+        this.$refs.tree.setCheckedNodes([data])
602
+        this.unitparm.deptId = data.id
603
+        this.unitparm.deptName = data.name
604
+        //交叉点击节点
605
+      } else {
606
+      }
607
+    },
608
+    // 保存部门
609
+    unitPermSave() {
610
+      let len = this.selectdata
611
+      let ids = []
612
+      if (len != 0) {
613
+        for (let i = 0; i < len.length; i++) {
614
+          ids.push(len[i].userId)
615
+        }
616
+      }
617
+      this.unitparm.userIds = ids.join(',')
618
+      UserChangeDept(this.unitparm)
619
+        .then(res => {
620
+          this.unitAccessshow = false
621
+          if (res.success) {
622
+            this.$message({
623
+              type: 'success',
624
+              message: '部门设置成功!'
625
+            })
626
+            this.getdata(this.formInline)
627
+          } else {
628
+            this.$message({
629
+              type: 'info',
630
+              message: res.msg
631
+            })
632
+          }
633
+        })
634
+        .catch(err => {
635
+          this.loading = false
636
+          this.$message.error('部门设置失败,请稍后再试!')
637
+        })
638
+    },
639
+    // 选择复选框事件
640
+    selectChange(val) {
641
+      this.selectdata = val
642
+    },
643
+    // 关闭编辑、增加弹出框
644
+    closeDialog(dialog) {
645
+      if (dialog == 'edit') {
646
+        this.editFormVisible = false
647
+      } else if (dialog == 'perm') {
648
+        this.dataAccessshow = false
649
+      } else if (dialog == 'unit') {
650
+        this.unitAccessshow = false
651
+      }
652
+    },
653
+    // 删除用户
654
+    deleteUser(index, row) {
655
+      this.$confirm('确定要删除吗?', '信息', {
656
+        confirmButtonText: '确定',
657
+        cancelButtonText: '取消',
658
+        type: 'warning'
659
+      })
660
+        .then(() => {
661
+          // 删除
662
+          userDelete(row.id)
663
+            .then(res => {
664
+              if (res.success) {
665
+                this.$message({
666
+                  type: 'success',
667
+                  message: '数据已删除!'
668
+                })
669
+                this.getdata(this.formInline)
670
+              } else {
671
+                this.$message({
672
+                  type: 'info',
673
+                  message: res.msg
674
+                })
675
+              }
676
+            })
677
+            .catch(err => {
678
+              this.loading = false
679
+              this.$message.error('数据删除失败,请稍后再试!')
680
+            })
681
+        })
682
+        .catch(() => {
683
+          this.$message({
684
+            type: 'info',
685
+            message: '已取消删除!'
686
+          })
687
+        })
688
+    },
689
+    // 重置密码
690
+    resetpwd(index, row) {
691
+      this.resetpsd.userId = row.userId
692
+      this.$confirm('确定要重置密码吗?', '信息', {
693
+        confirmButtonText: '确定',
694
+        cancelButtonText: '取消',
695
+        type: 'warning'
696
+      })
697
+        .then(() => {
698
+          userPwd(this.resetpsd)
699
+            .then(res => {
700
+              if (res.success) {
701
+                this.$message({
702
+                  type: 'success',
703
+                  message: '重置密码成功!'
704
+                })
705
+                this.getdata(this.formInline)
706
+              } else {
707
+                this.$message({
708
+                  type: 'info',
709
+                  message: res.msg
710
+                })
711
+              }
712
+            })
713
+            .catch(err => {
714
+              this.loading = false
715
+              this.$message.error('重置密码失败,请稍后再试!')
716
+            })
717
+        })
718
+        .catch(() => {
719
+          this.$message({
720
+            type: 'info',
721
+            message: '取消重置密码!'
722
+          })
723
+        })
724
+    },
725
+    // 数据权限
726
+    dataAccess: function(index, row) {
727
+      this.dataAccessshow = true
728
+      this.saveroleId = row.userId
729
+      UserDeptTree(row.userId)
730
+        .then(res => {
731
+          if (res.data.success) {
732
+            this.checkmenu = this.changemenu(res.data.data)
733
+            this.UserDept = this.changeArr(res.data.data)
734
+          } else {
735
+            this.$message({
736
+              type: 'info',
737
+              message: res.data.msg
738
+            })
739
+          }
740
+        })
741
+        .catch(err => {
742
+          this.loading = false
743
+          this.$message.error('获取权限失败,请稍后再试!')
744
+        })
745
+    },
746
+    //数据格式化
747
+    changeArr(data) {
748
+      var pos = {}
749
+      var tree = []
750
+      var i = 0
751
+      while (data.length != 0) {
752
+        if (data[i].pId == 0) {
753
+          tree.push({
754
+            id: data[i].id,
755
+            name: data[i].name,
756
+            pId: data[i].pId,
757
+            open: data[i].open,
758
+            checked: data[i].checked,
759
+            children: []
760
+          })
761
+          pos[data[i].id] = [tree.length - 1]
762
+          data.splice(i, 1)
763
+          i--
764
+        } else {
765
+          var posArr = pos[data[i].pId]
766
+          if (posArr != undefined) {
767
+            var obj = tree[posArr[0]]
768
+            for (var j = 1; j < posArr.length; j++) {
769
+              obj = obj.children[posArr[j]]
770
+            }
771
+
772
+            obj.children.push({
773
+              id: data[i].id,
774
+              name: data[i].name,
775
+              pId: data[i].pId,
776
+              open: data[i].open,
777
+              checked: data[i].checked,
778
+              children: []
779
+            })
780
+            pos[data[i].id] = posArr.concat([obj.children.length - 1])
781
+            data.splice(i, 1)
782
+            i--
783
+          }
784
+        }
785
+        i++
786
+        if (i > data.length - 1) {
787
+          i = 0
788
+        }
789
+      }
790
+      return tree
791
+    },
792
+    // 选中菜单
793
+    changemenu(arr) {
794
+      let change = []
795
+      for (let i = 0; i < arr.length; i++) {
796
+        if (arr[i].checked) {
797
+          change.push(arr[i].id)
798
+        }
799
+      }
800
+      return change
801
+    },
802
+    // 菜单权限-保存
803
+    menuPermSave() {
804
+      let parm = {
805
+        userId: this.saveroleId,
806
+        deptIds: ''
807
+      }
808
+      let node = this.$refs.tree.getCheckedNodes()
809
+      let moduleIds = []
810
+      if (node.length != 0) {
811
+        for (let i = 0; i < node.length; i++) {
812
+          moduleIds.push(node[i].id)
813
+        }
814
+        parm.deptIds = JSON.stringify(moduleIds)
815
+      }
816
+      UserDeptSave(parm)
817
+        .then(res => {
818
+          if (res.success) {
819
+            this.$message({
820
+              type: 'success',
821
+              message: '权限保存成功'
822
+            })
823
+            this.dataAccessshow = false
824
+            this.getdata(this.formInline)
825
+          } else {
826
+            this.$message({
827
+              type: 'info',
828
+              message: res.msg
829
+            })
830
+          }
831
+        })
832
+        .catch(err => {
833
+          this.loading = false
834
+          this.$message.error('权限保存失败,请稍后再试!')
835
+        })
836
+    },
837
+    // 下线用户
838
+    offlineUser(index, row) {
839
+      this.$confirm('确定要让' + row.userName + '用户下线吗?', '信息', {
840
+        confirmButtonText: '确定',
841
+        cancelButtonText: '取消',
842
+        type: 'warning'
843
+      })
844
+        .then(() => {
845
+          userExpireToken(row.userName)
846
+            .then(res => {
847
+              if (res.success) {
848
+                this.$message({
849
+                  type: 'success',
850
+                  message: '用户' + row.userName + '强制下线成功!'
851
+                })
852
+                this.getdata(this.formInline)
853
+              } else {
854
+                this.$message({
855
+                  type: 'info',
856
+                  message: res.msg
857
+                })
858
+              }
859
+            })
860
+            .catch(err => {
861
+              this.loading = false
862
+              this.$message.error('用户下线失败,请稍后再试!')
863
+            })
864
+        })
865
+        .catch(() => {
866
+          this.$message({
867
+            type: 'info',
868
+            message: '已取消'
869
+          })
870
+        })
871
+    },
872
+    // 刷新缓存
873
+    refreshCache(index, row) {
874
+      userFlashCache(row.userName)
875
+        .then(res => {
876
+          if (res.success) {
877
+            this.$message({
878
+              type: 'success',
879
+              message: '刷新成功!'
880
+            })
881
+            this.getdata(this.formInline)
882
+          } else {
883
+            this.$message({
884
+              type: 'info',
885
+              message: res.msg
886
+            })
887
+          }
888
+        })
889
+        .catch(err => {
890
+          this.loading = false
891
+          this.$message.error('刷新失败,请稍后再试!')
892
+        })
893
+    }
894
+  }
895
+}
896
+</script>
897
+
898
+<style scoped>
899
+.user-search {
900
+  margin-top: 20px;
901
+}
902
+.userRole {
903
+  width: 100%;
904
+}
905
+</style>
906
+
907
+ 

+ 22
- 0
src/vuex/store.js ファイルの表示

@@ -0,0 +1,22 @@
1
+import Vue from 'vue';
2
+import Vuex from 'vuex';
3
+
4
+Vue.use(Vuex);
5
+// 登录验证
6
+export default new Vuex.Store({
7
+    state: {
8
+        user: false
9
+    },
10
+    mutations: {
11
+        // 登录
12
+        login(state, user) {
13
+            state.user = user;
14
+            localStorage.setItem("userInfo", user);
15
+        },
16
+        // 退出
17
+        logout(state, user) {
18
+            state.user = "";
19
+            localStorage.setItem("userInfo", "");
20
+        }
21
+    }
22
+})

+ 0
- 0
static/.gitkeep ファイルの表示


バイナリ
static/gif.gif ファイルの表示


バイナリ
static/wx.jpg ファイルの表示


バイナリ
static/交易订单.png ファイルの表示


バイナリ
static/商品管理.png ファイルの表示


バイナリ
static/展开与压缩.png ファイルの表示


バイナリ
static/支付配置.png ファイルの表示


バイナリ
static/用户管理.png ファイルの表示


バイナリ
static/登录.png ファイルの表示


バイナリ
static/编辑.png ファイルの表示


バイナリ
static/角色管理.png ファイルの表示