diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..ea6e20f --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +# http://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +insert_final_newline = false +trim_trailing_whitespace = false diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..19f177b --- /dev/null +++ b/.env.development @@ -0,0 +1,7 @@ +# just a flag +ENV = 'development' + +# base api +VUE_APP_BASE_API = 'http://vue.admin.net/api' +VUE_APP_BASE_API1 = 'http://vue.admin.net/hrapi' +VUE_APP_BASE_API2 = 'http://vue.admin.net/fileapi' diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..385721d --- /dev/null +++ b/.env.production @@ -0,0 +1,7 @@ +# just a flag +ENV = 'production' + +# base api +VUE_APP_BASE_API = 'http://ginadmin.hxgk.group/api' +VUE_APP_BASE_API1 = 'http://ginadmin.hxgk.group/hrapi' +VUE_APP_BASE_API2 = 'http://ginadmin.hxgk.group/fileapi' diff --git a/.env.staging b/.env.staging new file mode 100644 index 0000000..f44b823 --- /dev/null +++ b/.env.staging @@ -0,0 +1,10 @@ +NODE_ENV = production + +# just a flag +ENV = 'staging' + +# base api +VUE_APP_BASE_API = 'http://kpi.hxgk.net/api' +VUE_APP_BASE_API1 = 'http://kpi.hxgk.net/hrapi' +VUE_APP_BASE_API2 = 'http://kpi.hxgk.net/fileapi' + diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..e6529fc --- /dev/null +++ b/.eslintignore @@ -0,0 +1,4 @@ +build/*.js +src/assets +public +dist diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..222bf49 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,199 @@ +module.exports = { + root: true, + parserOptions: { + parser: 'babel-eslint', + sourceType: 'module', + "requireConfigFile":false + }, + env: { + browser: true, + node: true, + es6: true, + }, + extends: ['plugin:vue/recommended', 'eslint:recommended'], + + // add your custom rules here + //it is base on https://github.com/vuejs/eslint-config-vue + rules: { + "vue/max-attributes-per-line": [2, { + "singleline": 10, + "multiline": { + "max": 1, + "allowFirstLine": false + } + }], + "vue/singleline-html-element-content-newline": "off", + "vue/multiline-html-element-content-newline":"off", + "vue/name-property-casing": ["error", "PascalCase"], + "vue/no-v-html": "off", + 'accessor-pairs': 2, + 'arrow-spacing': [2, { + 'before': true, + 'after': true + }], + 'block-spacing': [2, 'always'], + 'brace-style': [2, '1tbs', { + 'allowSingleLine': true + }], + 'camelcase': [0, { + 'properties': 'always' + }], + 'comma-dangle': [2, 'never'], + 'comma-spacing': [2, { + 'before': false, + 'after': true + }], + 'comma-style': [2, 'last'], + 'constructor-super': 2, + 'curly': [2, 'multi-line'], + 'dot-location': [2, 'property'], + 'eol-last': 2, + 'eqeqeq': ["error", "always", {"null": "ignore"}], + 'generator-star-spacing': [2, { + 'before': true, + 'after': true + }], + 'handle-callback-err': [2, '^(err|error)$'], + 'indent': [2, 2, { + 'SwitchCase': 1 + }], + 'jsx-quotes': [2, 'prefer-single'], + 'key-spacing': [2, { + 'beforeColon': false, + 'afterColon': true + }], + 'keyword-spacing': [2, { + 'before': true, + 'after': true + }], + 'new-cap': [2, { + 'newIsCap': true, + 'capIsNew': false + }], + 'new-parens': 2, + 'no-array-constructor': 2, + 'no-caller': 2, + 'no-console': 'off', + 'no-class-assign': 2, + 'no-cond-assign': 2, + 'no-const-assign': 2, + 'no-control-regex': 0, + 'no-delete-var': 2, + 'no-dupe-args': 2, + 'no-dupe-class-members': 2, + 'no-dupe-keys': 2, + 'no-duplicate-case': 2, + 'no-empty-character-class': 2, + 'no-empty-pattern': 2, + 'no-eval': 2, + 'no-ex-assign': 2, + 'no-extend-native': 2, + 'no-extra-bind': 2, + 'no-extra-boolean-cast': 2, + 'no-extra-parens': [2, 'functions'], + 'no-fallthrough': 2, + 'no-floating-decimal': 2, + 'no-func-assign': 2, + 'no-implied-eval': 2, + 'no-inner-declarations': [2, 'functions'], + 'no-invalid-regexp': 2, + 'no-irregular-whitespace': 2, + 'no-iterator': 2, + 'no-label-var': 2, + 'no-labels': [2, { + 'allowLoop': false, + 'allowSwitch': false + }], + 'no-lone-blocks': 2, + 'no-mixed-spaces-and-tabs': 2, + 'no-multi-spaces': 2, + 'no-multi-str': 2, + 'no-multiple-empty-lines': [2, { + 'max': 1 + }], + 'no-native-reassign': 2, + 'no-negated-in-lhs': 2, + 'no-new-object': 2, + 'no-new-require': 2, + 'no-new-symbol': 2, + 'no-new-wrappers': 2, + 'no-obj-calls': 2, + 'no-octal': 2, + 'no-octal-escape': 2, + 'no-path-concat': 2, + 'no-proto': 2, + 'no-redeclare': 2, + 'no-regex-spaces': 2, + 'no-return-assign': [2, 'except-parens'], + 'no-self-assign': 2, + 'no-self-compare': 2, + 'no-sequences': 2, + 'no-shadow-restricted-names': 2, + 'no-spaced-func': 2, + 'no-sparse-arrays': 2, + 'no-this-before-super': 2, + 'no-throw-literal': 2, + 'no-trailing-spaces': 2, + 'no-undef': 2, + 'no-undef-init': 2, + 'no-unexpected-multiline': 2, + 'no-unmodified-loop-condition': 2, + 'no-unneeded-ternary': [2, { + 'defaultAssignment': false + }], + 'no-unreachable': 2, + 'no-unsafe-finally': 2, + 'no-unused-vars': [2, { + 'vars': 'all', + 'args': 'none' + }], + 'no-useless-call': 2, + 'no-useless-computed-key': 2, + 'no-useless-constructor': 2, + 'no-useless-escape': 0, + 'no-whitespace-before-property': 2, + 'no-with': 2, + 'one-var': [2, { + 'initialized': 'never' + }], + 'operator-linebreak': [2, 'after', { + 'overrides': { + '?': 'before', + ':': 'before' + } + }], + 'padded-blocks': [2, 'never'], + 'quotes': [2, 'single', { + 'avoidEscape': true, + 'allowTemplateLiterals': true + }], + 'semi': [2, 'never'], + 'semi-spacing': [2, { + 'before': false, + 'after': true + }], + 'space-before-blocks': [2, 'always'], + 'space-before-function-paren': [2, 'never'], + 'space-in-parens': [2, 'never'], + 'space-infix-ops': 2, + 'space-unary-ops': [2, { + 'words': true, + 'nonwords': false + }], + 'spaced-comment': [2, 'always', { + 'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ','] + }], + 'template-curly-spacing': [2, 'never'], + 'use-isnan': 2, + 'valid-typeof': 2, + 'wrap-iife': [2, 'any'], + 'yield-star-spacing': [2, 'both'], + 'yoda': [2, 'never'], + 'prefer-const': 2, + 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, + 'object-curly-spacing': [2, 'always', { + objectsInObjects: false + }], + 'array-bracket-spacing': [2, 'never'] + } +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9ad28d2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,16 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json +tests/**/coverage/ + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..f4be7a0 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: 10 +script: npm run test +notifications: + email: false diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..6151575 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017-present PanJiaChen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README-zh.md b/README-zh.md new file mode 100644 index 0000000..1beec9b --- /dev/null +++ b/README-zh.md @@ -0,0 +1,111 @@ +# vue-admin-template + +> 这是一个极简的 vue admin 管理后台。它只包含了 Element UI & axios & iconfont & permission control & lint,这些搭建后台必要的东西。 + +[线上地址](http://panjiachen.github.io/vue-admin-template) + +[国内访问](https://panjiachen.gitee.io/vue-admin-template) + +目前版本为 `v4.0+` 基于 `vue-cli` 进行构建,若你想使用旧版本,可以切换分支到[tag/3.11.0](https://github.com/PanJiaChen/vue-admin-template/tree/tag/3.11.0),它不依赖 `vue-cli`。 + +

+ SPONSORED BY +

+

+ + + +

+ +## Extra + +如果你想要根据用户角色来动态生成侧边栏和 router,你可以使用该分支[permission-control](https://github.com/PanJiaChen/vue-admin-template/tree/permission-control) + +## 相关项目 + +- [vue-element-admin](https://github.com/PanJiaChen/vue-element-admin) + +- [electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin) + +- [vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template) + +- [awesome-project](https://github.com/PanJiaChen/vue-element-admin/issues/2312) + +写了一个系列的教程配套文章,如何从零构建后一个完整的后台项目: + +- [手摸手,带你用 vue 撸后台 系列一(基础篇)](https://juejin.im/post/59097cd7a22b9d0065fb61d2) +- [手摸手,带你用 vue 撸后台 系列二(登录权限篇)](https://juejin.im/post/591aa14f570c35006961acac) +- [手摸手,带你用 vue 撸后台 系列三 (实战篇)](https://juejin.im/post/593121aa0ce4630057f70d35) +- [手摸手,带你用 vue 撸后台 系列四(vueAdmin 一个极简的后台基础模板,专门针对本项目的文章,算作是一篇文档)](https://juejin.im/post/595b4d776fb9a06bbe7dba56) +- [手摸手,带你封装一个 vue component](https://segmentfault.com/a/1190000009090836) + +## Build Setup + +```bash +# 克隆项目 +git clone https://github.com/PanJiaChen/vue-admin-template.git + +# 进入项目目录 +cd vue-admin-template + +# 安装依赖 +npm install + +# 建议不要直接使用 cnpm 安装以来,会有各种诡异的 bug。可以通过如下操作解决 npm 下载速度慢的问题 +npm install --registry=https://registry.npm.taobao.org + +# 启动服务 +npm run dev +``` + +浏览器访问 [http://localhost:9528](http://localhost:9528) + +## 发布 + +```bash +# 构建测试环境 +npm run build:stage + +# 构建生产环境 +npm run build:prod +``` + +## 其它 + +```bash +# 预览发布环境效果 +npm run preview + +# 预览发布环境效果 + 静态资源分析 +npm run preview -- --report + +# 代码格式检查 +npm run lint + +# 代码格式检查并自动修复 +npm run lint -- --fix +``` + +更多信息请参考 [使用文档](https://panjiachen.github.io/vue-element-admin-site/zh/) + +## 购买贴纸 + +你也可以通过 购买[官方授权的贴纸](https://smallsticker.com/product/vue-element-admin) 的方式来支持 vue-element-admin - 每售出一张贴纸,我们将获得 2 元的捐赠。 + +## Demo + +![demo](https://github.com/PanJiaChen/PanJiaChen.github.io/blob/master/images/demo.gif) + +## Browsers support + +Modern browsers and Internet Explorer 10+. + +| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | +| --------- | --------- | --------- | --------- | +| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions + +## License + +[MIT](https://github.com/PanJiaChen/vue-admin-template/blob/master/LICENSE) license. + +Copyright (c) 2017-present PanJiaChen diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000..fb82b27 --- /dev/null +++ b/babel.config.js @@ -0,0 +1,14 @@ +module.exports = { + presets: [ + // https://github.com/vuejs/vue-cli/tree/master/packages/@vue/babel-preset-app + '@vue/cli-plugin-babel/preset' + ], + 'env': { + 'development': { + // babel-plugin-dynamic-import-node plugin only does one thing by converting all import() to require(). + // This plugin can significantly increase the speed of hot updates, when you have a large number of pages. + // https://panjiachen.github.io/vue-element-admin-site/guide/advanced/lazy-loading.html + 'plugins': ['dynamic-import-node'] + } + } +} diff --git a/build/index.js b/build/index.js new file mode 100644 index 0000000..0c57de2 --- /dev/null +++ b/build/index.js @@ -0,0 +1,35 @@ +const { run } = require('runjs') +const chalk = require('chalk') +const config = require('../vue.config.js') +const rawArgv = process.argv.slice(2) +const args = rawArgv.join(' ') + +if (process.env.npm_config_preview || rawArgv.includes('--preview')) { + const report = rawArgv.includes('--report') + + run(`vue-cli-service build ${args}`) + + const port = 9526 + const publicPath = config.publicPath + + var connect = require('connect') + var serveStatic = require('serve-static') + const app = connect() + + app.use( + publicPath, + serveStatic('./dist', { + index: ['index.html', '/'] + }) + ) + + app.listen(port, function () { + console.log(chalk.green(`> Preview at http://localhost:${port}${publicPath}`)) + if (report) { + console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`)) + } + + }) +} else { + run(`vue-cli-service build ${args}`) +} diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 0000000..b98bfb0 --- /dev/null +++ b/jest.config.js @@ -0,0 +1,24 @@ +module.exports = { + moduleFileExtensions: ['js', 'jsx', 'json', 'vue'], + transform: { + '^.+\\.vue$': 'vue-jest', + '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': + 'jest-transform-stub', + '^.+\\.jsx?$': 'babel-jest' + }, + moduleNameMapper: { + '^@/(.*)$': '/src/$1' + }, + snapshotSerializers: ['jest-serializer-vue'], + testMatch: [ + '**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)' + ], + collectCoverageFrom: ['src/utils/**/*.{js,vue}', '!src/utils/auth.js', '!src/utils/request.js', 'src/components/**/*.{js,vue}'], + coverageDirectory: '/tests/unit/coverage', + // 'collectCoverage': true, + 'coverageReporters': [ + 'lcov', + 'text-summary' + ], + testURL: 'http://gin.vueadmin.net/' +} diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 0000000..ed079e2 --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "baseUrl": "./", + "paths": { + "@/*": ["src/*"] + } + }, + "exclude": ["node_modules", "dist"] +} diff --git a/mock/index.js b/mock/index.js new file mode 100644 index 0000000..c514c13 --- /dev/null +++ b/mock/index.js @@ -0,0 +1,57 @@ +const Mock = require('mockjs') +const { param2Obj } = require('./utils') + +const user = require('./user') +const table = require('./table') + +const mocks = [ + ...user, + ...table +] + +// for front mock +// please use it cautiously, it will redefine XMLHttpRequest, +// which will cause many of your third-party libraries to be invalidated(like progress event). +function mockXHR() { + // mock patch + // https://github.com/nuysoft/Mock/issues/300 + Mock.XHR.prototype.proxy_send = Mock.XHR.prototype.send + Mock.XHR.prototype.send = function() { + if (this.custom.xhr) { + this.custom.xhr.withCredentials = this.withCredentials || false + + if (this.responseType) { + this.custom.xhr.responseType = this.responseType + } + } + this.proxy_send(...arguments) + } + + function XHR2ExpressReqWrap(respond) { + return function(options) { + let result = null + if (respond instanceof Function) { + const { body, type, url } = options + // https://expressjs.com/en/4x/api.html#req + result = respond({ + method: type, + body: JSON.parse(body), + query: param2Obj(url) + }) + } else { + result = respond + } + return Mock.mock(result) + } + } + + for (const i of mocks) { + Mock.mock(new RegExp(i.url), i.type || 'get', XHR2ExpressReqWrap(i.response)) + } +} + +module.exports = { + mocks, + mockXHR +} + diff --git a/mock/mock-server.js b/mock/mock-server.js new file mode 100644 index 0000000..8941ec0 --- /dev/null +++ b/mock/mock-server.js @@ -0,0 +1,81 @@ +const chokidar = require('chokidar') +const bodyParser = require('body-parser') +const chalk = require('chalk') +const path = require('path') +const Mock = require('mockjs') + +const mockDir = path.join(process.cwd(), 'mock') + +function registerRoutes(app) { + let mockLastIndex + const { mocks } = require('./index.js') + const mocksForServer = mocks.map(route => { + return responseFake(route.url, route.type, route.response) + }) + for (const mock of mocksForServer) { + app[mock.type](mock.url, mock.response) + mockLastIndex = app._router.stack.length + } + const mockRoutesLength = Object.keys(mocksForServer).length + return { + mockRoutesLength: mockRoutesLength, + mockStartIndex: mockLastIndex - mockRoutesLength + } +} + +function unregisterRoutes() { + Object.keys(require.cache).forEach(i => { + if (i.includes(mockDir)) { + delete require.cache[require.resolve(i)] + } + }) +} + +// for mock server +const responseFake = (url, type, respond) => { + return { + url: new RegExp(`${process.env.VUE_APP_BASE_API}${url}`), + type: type || 'get', + response(req, res) { + console.log('request invoke:' + req.path) + res.json(Mock.mock(respond instanceof Function ? respond(req, res) : respond)) + } + } +} + +module.exports = app => { + // parse app.body + // https://expressjs.com/en/4x/api.html#req.body + app.use(bodyParser.json()) + app.use(bodyParser.urlencoded({ + extended: true + })) + + const mockRoutes = registerRoutes(app) + var mockRoutesLength = mockRoutes.mockRoutesLength + var mockStartIndex = mockRoutes.mockStartIndex + + // watch files, hot reload mock server + chokidar.watch(mockDir, { + ignored: /mock-server/, + ignoreInitial: true + }).on('all', (event, path) => { + if (event === 'change' || event === 'add') { + try { + // remove mock routes stack + app._router.stack.splice(mockStartIndex, mockRoutesLength) + + // clear routes cache + unregisterRoutes() + + const mockRoutes = registerRoutes(app) + mockRoutesLength = mockRoutes.mockRoutesLength + mockStartIndex = mockRoutes.mockStartIndex + + console.log(chalk.magentaBright(`\n > Mock Server hot reload success! changed ${path}`)) + } catch (error) { + console.log(chalk.redBright(error)) + } + } + }) +} diff --git a/mock/table.js b/mock/table.js new file mode 100644 index 0000000..bd0e013 --- /dev/null +++ b/mock/table.js @@ -0,0 +1,29 @@ +const Mock = require('mockjs') + +const data = Mock.mock({ + 'items|30': [{ + id: '@id', + title: '@sentence(10, 20)', + 'status|1': ['published', 'draft', 'deleted'], + author: 'name', + display_time: '@datetime', + pageviews: '@integer(300, 5000)' + }] +}) + +module.exports = [ + { + url: '/vue-admin-template/table/list', + type: 'get', + response: config => { + const items = data.items + return { + code: 20000, + data: { + total: items.length, + items: items + } + } + } + } +] diff --git a/mock/user.js b/mock/user.js new file mode 100644 index 0000000..7555338 --- /dev/null +++ b/mock/user.js @@ -0,0 +1,84 @@ + +const tokens = { + admin: { + token: 'admin-token' + }, + editor: { + token: 'editor-token' + } +} + +const users = { + 'admin-token': { + roles: ['admin'], + introduction: 'I am a super administrator', + avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif', + name: 'Super Admin' + }, + 'editor-token': { + roles: ['editor'], + introduction: 'I am an editor', + avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif', + name: 'Normal Editor' + } +} + +module.exports = [ + // user login + { + url: '/vue-admin-template/user/login', + type: 'post', + response: config => { + const { username } = config.body + const token = tokens[username] + + // mock error + if (!token) { + return { + code: 60204, + message: 'Account and password are incorrect.' + } + } + + return { + code: 20000, + data: token + } + } + }, + + // get user info + { + url: '/vue-admin-template/user/info\.*', + type: 'get', + response: config => { + const { token } = config.query + const info = users[token] + + // mock error + if (!info) { + return { + code: 50008, + message: 'Login failed, unable to get user details.' + } + } + + return { + code: 20000, + data: info + } + } + }, + + // user logout + { + url: '/vue-admin-template/user/logout', + type: 'post', + response: _ => { + return { + code: 20000, + data: 'success' + } + } + } +] diff --git a/mock/utils.js b/mock/utils.js new file mode 100644 index 0000000..95cc27d --- /dev/null +++ b/mock/utils.js @@ -0,0 +1,25 @@ +/** + * @param {string} url + * @returns {Object} + */ +function param2Obj(url) { + const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ') + if (!search) { + return {} + } + const obj = {} + const searchArr = search.split('&') + searchArr.forEach(v => { + const index = v.indexOf('=') + if (index !== -1) { + const name = v.substring(0, index) + const val = v.substring(index + 1, v.length) + obj[name] = val + } + }) + return obj +} + +module.exports = { + param2Obj +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..9ae281c --- /dev/null +++ b/package.json @@ -0,0 +1,63 @@ +{ + "name": "vue-admin-template", + "version": "4.4.0", + "description": "A vue admin template with Element UI & axios & iconfont & permission control & lint", + "author": "Pan ", + "scripts": { + "dev": "vue-cli-service serve", + "build:prod": "vue-cli-service build", + "build:stage": "vue-cli-service build --mode staging", + "preview": "node build/index.js --preview", + "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml", + "lint": "eslint --ext .js,.vue src", + "test:unit": "jest --clearCache && vue-cli-service test:unit", + "test:ci": "npm run lint && npm run test:unit" + }, + "dependencies": { + "axios": "0.18.1", + "core-js": "^3.20.2", + "echarts": "^5.3.2", + "element-ui": "2.15.6", + "js-cookie": "2.2.0", + "normalize.css": "7.0.0", + "nprogress": "0.2.0", + "path-to-regexp": "2.4.0", + "vue": "2.6.10", + "vue-router": "3.0.6", + "vuex": "3.1.0" + }, + "devDependencies": { + "@vue/cli-plugin-babel": "4.4.4", + "@vue/cli-plugin-eslint": "4.4.4", + "@vue/cli-plugin-unit-jest": "4.4.4", + "@vue/cli-service": "4.4.4", + "@vue/test-utils": "1.0.0-beta.29", + "autoprefixer": "9.5.1", + "babel-eslint": "10.1.0", + "babel-jest": "23.6.0", + "babel-plugin-dynamic-import-node": "2.3.3", + "chalk": "2.4.2", + "connect": "3.6.6", + "eslint": "6.7.2", + "eslint-plugin-vue": "6.2.2", + "html-webpack-plugin": "3.2.0", + "mockjs": "1.0.1-beta3", + "runjs": "4.3.2", + "sass": "1.26.8", + "sass-loader": "8.0.2", + "script-ext-html-webpack-plugin": "2.1.3", + "serve-static": "1.13.2", + "svg-sprite-loader": "4.1.3", + "svgo": "1.2.2", + "vue-template-compiler": "2.6.10" + }, + "browserslist": [ + "> 1%", + "last 2 versions" + ], + "engines": { + "node": ">=8.9", + "npm": ">= 3.0.0" + }, + "license": "MIT" +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..10473ef --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,8 @@ +// https://github.com/michael-ciniawsky/postcss-load-config + +module.exports = { + 'plugins': { + // to edit target browsers: use "browserslist" field in package.json + 'autoprefixer': {} + } +} diff --git a/public/--favicon.ico b/public/--favicon.ico new file mode 100644 index 0000000..34b63ac Binary files /dev/null and b/public/--favicon.ico differ diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..4a366d3 Binary files /dev/null and b/public/favicon.ico differ diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..4393c66 --- /dev/null +++ b/public/index.html @@ -0,0 +1,19 @@ + + + + + + + + <%= webpackConfig.name %> + + + + + +
+ + + diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..1007cb1 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,61 @@ + + + diff --git a/src/__layout/components/AppMain.vue b/src/__layout/components/AppMain.vue new file mode 100644 index 0000000..a5454fb --- /dev/null +++ b/src/__layout/components/AppMain.vue @@ -0,0 +1,44 @@ + + + + + + + diff --git a/src/__layout/components/Navbar.vue b/src/__layout/components/Navbar.vue new file mode 100644 index 0000000..827a4ee --- /dev/null +++ b/src/__layout/components/Navbar.vue @@ -0,0 +1,155 @@ + + + + + diff --git a/src/__layout/components/Sidebar/FixiOSBug.js b/src/__layout/components/Sidebar/FixiOSBug.js new file mode 100644 index 0000000..bc14856 --- /dev/null +++ b/src/__layout/components/Sidebar/FixiOSBug.js @@ -0,0 +1,26 @@ +export default { + computed: { + device() { + return this.$store.state.app.device + } + }, + mounted() { + // In order to fix the click on menu on the ios device will trigger the mouseleave bug + // https://github.com/PanJiaChen/vue-element-admin/issues/1135 + this.fixBugIniOS() + }, + methods: { + fixBugIniOS() { + const $subMenu = this.$refs.subMenu + if ($subMenu) { + const handleMouseleave = $subMenu.handleMouseleave + $subMenu.handleMouseleave = (e) => { + if (this.device === 'mobile') { + return + } + handleMouseleave(e) + } + } + } + } +} diff --git a/src/__layout/components/Sidebar/Item.vue b/src/__layout/components/Sidebar/Item.vue new file mode 100644 index 0000000..aa1f5da --- /dev/null +++ b/src/__layout/components/Sidebar/Item.vue @@ -0,0 +1,41 @@ + + + diff --git a/src/__layout/components/Sidebar/Link.vue b/src/__layout/components/Sidebar/Link.vue new file mode 100644 index 0000000..cd46e19 --- /dev/null +++ b/src/__layout/components/Sidebar/Link.vue @@ -0,0 +1,54 @@ + + + diff --git a/src/__layout/components/Sidebar/Logo.vue b/src/__layout/components/Sidebar/Logo.vue new file mode 100644 index 0000000..040fab6 --- /dev/null +++ b/src/__layout/components/Sidebar/Logo.vue @@ -0,0 +1,82 @@ + + + + + diff --git a/src/__layout/components/Sidebar/SidebarItem.vue b/src/__layout/components/Sidebar/SidebarItem.vue new file mode 100644 index 0000000..a418c3d --- /dev/null +++ b/src/__layout/components/Sidebar/SidebarItem.vue @@ -0,0 +1,95 @@ + + + diff --git a/src/__layout/components/Sidebar/index.vue b/src/__layout/components/Sidebar/index.vue new file mode 100644 index 0000000..da39034 --- /dev/null +++ b/src/__layout/components/Sidebar/index.vue @@ -0,0 +1,56 @@ + + + diff --git a/src/__layout/components/index.js b/src/__layout/components/index.js new file mode 100644 index 0000000..97ee3cd --- /dev/null +++ b/src/__layout/components/index.js @@ -0,0 +1,3 @@ +export { default as Navbar } from './Navbar' +export { default as Sidebar } from './Sidebar' +export { default as AppMain } from './AppMain' diff --git a/src/__layout/index.vue b/src/__layout/index.vue new file mode 100644 index 0000000..db22a7b --- /dev/null +++ b/src/__layout/index.vue @@ -0,0 +1,93 @@ + + + + + diff --git a/src/__layout/mixin/ResizeHandler copy.js b/src/__layout/mixin/ResizeHandler copy.js new file mode 100644 index 0000000..e8d0df8 --- /dev/null +++ b/src/__layout/mixin/ResizeHandler copy.js @@ -0,0 +1,45 @@ +import store from '@/store' + +const { body } = document +const WIDTH = 992 // refer to Bootstrap's responsive design + +export default { + watch: { + $route(route) { + if (this.device === 'mobile' && this.sidebar.opened) { + store.dispatch('app/closeSideBar', { withoutAnimation: false }) + } + } + }, + beforeMount() { + window.addEventListener('resize', this.$_resizeHandler) + }, + beforeDestroy() { + window.removeEventListener('resize', this.$_resizeHandler) + }, + mounted() { + const isMobile = this.$_isMobile() + if (isMobile) { + store.dispatch('app/toggleDevice', 'mobile') + store.dispatch('app/closeSideBar', { withoutAnimation: true }) + } + }, + methods: { + // use $_ for mixins properties + // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential + $_isMobile() { + const rect = body.getBoundingClientRect() + return rect.width - 1 < WIDTH + }, + $_resizeHandler() { + if (!document.hidden) { + const isMobile = this.$_isMobile() + store.dispatch('app/toggleDevice', isMobile ? 'mobile' : 'desktop') + + if (isMobile) { + store.dispatch('app/closeSideBar', { withoutAnimation: true }) + } + } + } + } +} diff --git a/src/__layout/mixin/ResizeHandler.js b/src/__layout/mixin/ResizeHandler.js new file mode 100644 index 0000000..e8d0df8 --- /dev/null +++ b/src/__layout/mixin/ResizeHandler.js @@ -0,0 +1,45 @@ +import store from '@/store' + +const { body } = document +const WIDTH = 992 // refer to Bootstrap's responsive design + +export default { + watch: { + $route(route) { + if (this.device === 'mobile' && this.sidebar.opened) { + store.dispatch('app/closeSideBar', { withoutAnimation: false }) + } + } + }, + beforeMount() { + window.addEventListener('resize', this.$_resizeHandler) + }, + beforeDestroy() { + window.removeEventListener('resize', this.$_resizeHandler) + }, + mounted() { + const isMobile = this.$_isMobile() + if (isMobile) { + store.dispatch('app/toggleDevice', 'mobile') + store.dispatch('app/closeSideBar', { withoutAnimation: true }) + } + }, + methods: { + // use $_ for mixins properties + // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential + $_isMobile() { + const rect = body.getBoundingClientRect() + return rect.width - 1 < WIDTH + }, + $_resizeHandler() { + if (!document.hidden) { + const isMobile = this.$_isMobile() + store.dispatch('app/toggleDevice', isMobile ? 'mobile' : 'desktop') + + if (isMobile) { + store.dispatch('app/closeSideBar', { withoutAnimation: true }) + } + } + } + } +} diff --git a/src/api/api/dutys.js b/src/api/api/dutys.js new file mode 100644 index 0000000..b28e99f --- /dev/null +++ b/src/api/api/dutys.js @@ -0,0 +1,273 @@ +import request from '@/utils/request' +//个人需要填写的考核项目 +export function myassessmentlist(params) { + return request({ + url: '/dutys/myassessmentlist', + method: 'post', + params + }) +} +//根据具体考核项目获取被考核部门 +export const getDutydepartlist = (data) => { + return request({ + url: '/dutys/getDutydepartlist', + method: 'post', + data: data + }) +} +//根据具体考核项目获取被考核部门 +export const addassessmentscore = (data) => { + return request({ + url: '/dutys/addassessmentscore', + method: 'post', + data: data + }) +} +//个人考核评价记录 +export const myevaluatelist = (data) => { + return request({ + url: '/dutys/myevaluatelist', + method: 'post', + data: data + }) +} +//根据部门和时间获取考核详情 +export const getdeparttimeassess = (data) => { + return request({ + url: '/dutys/getdeparttimeassess', + method: 'post', + data: data + }) +} +//获取企业微信发起基础配置 +export const getconfig = (data) => { + return request({ + url: '/examine/getconfig', + method: 'post', + data: data + }) +} +//以部门维度考核内容列表 +export const departmentassess = (data) => { + return request({ + url: '/dutys/departmentassess', + method: 'post', + data: data + }) +} +//根据部门和时间写入全部考核项分值 +export const departmentassessdata = (data) => { + return request({ + url: '/dutys/departmentassessdata', + method: 'post', + data: data + }) +} +//查看审批详细内容 +export const lookdepartmentassessinfo = (data) => { + return request({ + url: '/noverify/lookdepartmentassessinfo', + method: 'post', + data: data + }) +} +//查看本部门提交的和个人提交的审批 +export const lookpersonalordepartment = (data) => { + return request({ + url: '/dutys/lookpersonalordepartment', + method: 'post', + data: data + }) +} +//定性考核列表 +export const qualevalulist = (data) => { + return request({ + url: '/eval/qualevalulist', + method: 'post', + data: data + }) +} +//添加加分或减分 +export const additionandsubtractionscore = (data) => { + return request({ + url: '/eval/plusorminuspoints', + method: 'post', + data: data + }) +} +//流程列表 +export const seeflowlog = (data) => { + return request({ + url: '/eval/seeflowlog', + method: 'post', + data: data + }) +} +//文档上传 +export const upordown = (data) => { + return request({ + url: '/upordown', + method: 'post', + data: data + }) +} +// @Tags Api +// @Summary 获取集团架构人员信息对照表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body dbModel.Api true "获取集团架构" +// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /group/grouplist [get] +export const getgroupuser = (data) => { + return request({ + url: '/group/getgroupuser', + method: 'post', + data + }) +} +//划分责任人 +export const adddivisionresponsibility = (data) => { + return request({ + url: '/eval/rersonincharge', + method: 'post', + data: data + }) +} +//添加整改措施 +export const addcorrectivemeasures = (data) => { + return request({ + url: '/eval/rectificationmeasures', + method: 'post', + data: data + }) +} +//定量考核列表 +export const qualitativeevalration = (data) => { + return request({ + url: '/eval/qualitativeevalration', + method: 'post', + data: data + }) +} +//获取集团架构(集团+分厂) +export const getgroupdepartmap = (data) => { + return request({ + url: '/group/getgroupdepartmap', + method: 'post', + data: data + }) +} +//获取分厂 +export const departmentlist = (data) => { + return request({ + url: '/group/departmentlist', + method: 'post', + data: data + }) +} +//定量考核打分 +export const addflowrationlog = (data) => { + return request({ + url: '/eval/addflowrationlog', + method: 'post', + data: data + }) +} +//提交定量审核 +export const quanOperation = (data) => { + return request({ + url: '/quan/operation', + method: 'post', + data: data + }) +} +//查看定性考核审批列表 +export const lookdutkscoreflow = (data) => { + return request({ + url: '/eval/lookdutkscoreflow', + method: 'post', + data: data + }) +} +//查看定量考核 +export const lookrationkscoreflow = (data) => { + return request({ + url: '/eval/lookrationkscoreflow', + method: 'post', + data: data + }) +} +//获取班组 +export const getteamlist = (data) => { + return request({ + url: '/noverify/getteamlist', + method: 'post', + data: data + }) +} +//获取人员 +export const stafflist = (data) => { + return request({ + url: '/staff/stafflist', + method: 'post', + data: data + }) +} +//新定性考核列表 +export const newqualitative = (data) => { + return request({ + url: '/eval/newqualitative', + method: 'post', + data: data + }) +} +//获取新定性考核详细指标 +export const newgetqualdetailedtarget = (data) => { + return request({ + url: '/eval/newgetqualdetailedtarget', + method: 'post', + data: data + }) +} +//加减分NEW +export const plusorminuspoints = (data) => { + return request({ + url: '/eval/plusorminuspointsnew', + method: 'post', + data: data + }) +} +//流程图 1是整改2是不整改 +export const examineflow = (data) => { + return request({ + url: '/eval/examineflow', + method: 'post', + data: data + }) +} +//定性审批 +export const operation = (data) => { + return request({ + url: '/qual/operation', + method: 'post', + data: data + }) +} +//定量审批 +export const sanction = (data) => { + return request({ + url: '/quan/sanction', + method: 'post', + data: data + }) +} +//汇总详情 +export const summarydetails = (data) => { + return request({ + url: '/quan/summarydetails', + method: 'post', + data: data + }) +} + diff --git a/src/api/api/group.js b/src/api/api/group.js new file mode 100644 index 0000000..633ce2c --- /dev/null +++ b/src/api/api/group.js @@ -0,0 +1,24 @@ +import request from '@/utils/request' +// @Tags Api +// @Summary 获取集团架构(集团+分厂) +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body dbModel.Api true "获取集团架构" +// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /group/grouplist [get] +export const getgroupdepartmap = (data) => { + return request({ + url: '/group/getgroupdepartmap', + method: 'post', + data: data + }) + } + //以部门维度考核内容列表 +export const departmentassess = (data) => { + return request({ + url: '/dutys/departmentassess', + method: 'post', + data: data + }) + } \ No newline at end of file diff --git a/src/api/api/login/login.js b/src/api/api/login/login.js new file mode 100644 index 0000000..6015f22 --- /dev/null +++ b/src/api/api/login/login.js @@ -0,0 +1,26 @@ +import request from '@/utils/request' +//个人需要填写的考核项目 +export const oauth2 = (data) => { + return request({ + url: '/base/oauth2', + method: 'post', + data: data + }) + } +// @Summary 用户端登录 +// @Produce application/json +// @Param data body {username:"string",password:"string"} +// @Router /base/login [post] +export const mylogin = (data) => { + return request({ + url: '/base/mylogin', + method: 'post', + data: data + }) +} +export function logout() { + return request({ + url: '/vue-admin-template/user/logout', + method: 'post' + }) +} diff --git a/src/api/api/renwu.js b/src/api/api/renwu.js new file mode 100644 index 0000000..97ea0c8 --- /dev/null +++ b/src/api/api/renwu.js @@ -0,0 +1,75 @@ +import request from '@/utils/request' +//注销接口 +export function logout(params) { + return request({ + url: '/logout.do', + method: 'get', + params + }) +} +//登录接口 +export const login = (data) => { + return request({ + url: '/login.do', + method: 'post', + data: data + }) +} +//注册 +export const register = (data) => { + return request({ + url: '/login/register', + method: 'post', + data: data + }) +} +//绑定提现账户 +export const accountBinding = (data) => { + return request({ + url: '/user/accountBinding', + method: 'post', + data: data + }) +} +//申请提现 +export const withdraw = (data) => { + return request({ + url: '/user/withdraw', + method: 'post', + data: data + }) +} +//激活码激活 +export const cdkActivation = (data) => { + return request({ + url: '/user/cdkActivation', + method: 'post', + data: data + }) +} +//主页 +export const index = (data) => { + return request({ + url: '/user/index', + method: 'post', + data: data + }) +} +//开始任务按钮 +export const start = (data) => { + return request({ + url: '/user/start', + method: 'post', + data: data + }) +} +//校验是否到期并且上传收益接口 +export const checkAndAdd = (data) => { + return request({ + url: '/user/checkAndAdd', + method: 'post', + data: data + }) +} + + diff --git a/src/api/api/table.js b/src/api/api/table.js new file mode 100644 index 0000000..2752f52 --- /dev/null +++ b/src/api/api/table.js @@ -0,0 +1,9 @@ +import request from '@/utils/request' + +export function getList(params) { + return request({ + url: '/vue-admin-template/table/list', + method: 'get', + params + }) +} diff --git a/src/api/api/user.js b/src/api/api/user.js new file mode 100644 index 0000000..1bda9a4 --- /dev/null +++ b/src/api/api/user.js @@ -0,0 +1,73 @@ +import request from '@/utils/request' + +export function login(data) { + return request({ + url: '/vue-admin-template/user/login', + method: 'post', + data + }) +} + +export function getInfo(token) { + return request({ + url: '/vue-admin-template/user/info', + method: 'get', + params: { token } + }) +} +// @Summary 获取验证码 +// @Produce application/json +// @Param data body {username:"string",password:"string"} +// @Router /base/captcha [post] +// export const captcha = (data) => { +// return service({ +// url: '/base/captcha', +// method: 'post', +// data: data +// }) +// } +export function captcha() { + return request({ + url: '/base/captcha', + method: 'post' + }) +} +// @Summary 用户端登录 +// @Produce application/json +// @Param data body {username:"string",password:"string"} +// @Router /base/login [post] +export const mylogin = (data) => { + return request({ + url: '/base/mylogin', + method: 'post', + data: data + }) +} +// @Summary 超级登录 +// @Produce application/json +// @Param data body {username:"string",password:"string"} +// @Router /base/login [post] +export const scancodelogin = (data) => { + return request({ + url: '/base/scancodelogin', + method: 'post', + data: data + }) +} +export function logout() { + return request({ + url: '/vue-admin-template/user/logout', + method: 'post' + }) +} +// @Summary 查询个人信息 +// @Produce application/json +// @Param data body {username:"string",password:"string"} +// @Router /base/login [post] +export const scancode = (data) => { + return request({ + url: '/noverify/scancode', + method: 'post', + data: data + }) +} diff --git a/src/api/duty/dimension.js b/src/api/duty/dimension.js new file mode 100644 index 0000000..ce7a228 --- /dev/null +++ b/src/api/duty/dimension.js @@ -0,0 +1,42 @@ +// 考核纬度api +import request from '@/utils/request' +//考核维度 +export const dutyclasslist = (data) => { + return request({ + url: '/duty/dutyclasslist', + method: 'post', + data: data + }) +} +//添加考核类别 +export const adddutyclass = (data) => { + return request({ + url: '/duty/adddutyclass', + method: 'post', + data: data + }) +} +//查询考核维度详情 +export const getdutyclassinfo = (data) => { + return request({ + url: '/duty/getdutyclassinfo', + method: 'post', + data: data + }) +} +//编辑考核维度内容 +export const eitedutyclassinfo = (data) => { + return request({ + url: '/duty/eitedutyclassinfo', + method: 'post', + data: data + }) +} +//删除或改变考核维度状态 +export const statedutyclass = (data) => { + return request({ + url: '/duty/statedutyclass', + method: 'post', + data: data + }) +} diff --git a/src/api/duty/duty.js b/src/api/duty/duty.js new file mode 100644 index 0000000..efa3457 --- /dev/null +++ b/src/api/duty/duty.js @@ -0,0 +1,418 @@ +// 定性考核api +import request from '@/utils/request' +//定性考核列表 +export const getqualevallist = (data) => { + return request({ + url: '/duty/getqualevallist', + method: 'post', + data: data + }) +} +//获取正在激活的考核方案 +export const getactivationplanversion = (data) => { + return request({ + url: '/admin/getactivationplanversion', + method: 'post', + data: data + }) +} +//添加定性考核 +export const addqualeval = (data) => { + return request({ + url: '/duty/addqualeval', + method: 'post', + data: data + }) + } +//根据条件获取组合指标 +export const gettasktarget = (data) => { + return request({ + url: '/duty/gettasktarget', + method: 'post', + data: data + }) + } +//根据条件获取组合指标子栏目 +export const gettasktargetsun = (data) => { + return request({ + url: '/duty/gettasktargetsun', + method: 'post', + data: data + }) + } +//根据条件获取考核详情 +export const gettasktargetcontary = (data) => { + return request({ + url: '/duty/gettasktargetcontary', + method: 'post', + data: data + }) + } + //添加定量考核 +export const addration = (data) => { + return request({ + url: '/duty/addration', + method: 'post', + data: data + }) +} +//考核表列表 +export const departmenttasklist = (data) => { + return request({ + url: '/duty/departmenttasklist', + method: 'post', + data: data + }) +} +//删除考核 +export const delrationlist = (data) => { + return request({ + url: '/duty/delrationlist', + method: 'post', + data: data + }) +} +//删除定性考核内容 +export const delqualevalcont = (data) => { + return request({ + url: '/duty/delqualevalcont', + method: 'post', + data: data + }) +} +//删除考核细则方案内容 +export const deldepartmenttasklist = (data) => { + return request({ + url: '/duty/deldepartmenttasklist', + method: 'post', + data: data + }) +} +//获取定量考核详情 +export const getrationlist = (data) => { + return request({ + url: '/duty/getrationlist', + method: 'post', + data: data + }) +} +//修改定量考核 +export const eiterationlist = (data) => { + return request({ + url: '/duty/eiterationlist', + method: 'post', + data: data + }) +} +//获取部门考核指标详情 +export const getqualeval = (data) => { + return request({ + url: '/duty/getqualeval', + method: 'post', + data: data + }) +} +//修改定性考核内容 +export const eitequalevalcont = (data) => { + return request({ + url: '/duty/eitequalevalcont', + method: 'post', + data: data + }) +} +//添加指标权重(批量 +export const addqubatch = (data) => { + return request({ + url: '/duty/addqubatch', + method: 'post', + data: data + }) +} +//部门考核列表 +export const bumenList = (data) => { + return request({ + url: '/duty/departmentlist', + method: 'post', + data: data + }) +} +//部门考核列表新 +export const departmentlistnew = (data) => { + return request({ + url: '/duty/departmentlistnew', + method: 'post', + data: data + }) +} +//部门新增考核列表 +export const adddepartmentdutyinfo = (data) => { + return request({ + url: '/duty/adddepartmentdutyinfo', + method: 'post', + data: data + }) +} +//查看定量考核目标设定 +export const lookquantitativeconfig = (data) => { + return request({ + url: '/admin/lookquantitativeconfig', + method: 'post', + data: data + }) +} +//结算周期 +export const setevaluationobjectives = (data) => { + return request({ + url: '/duty/setevaluationobjectives', + method: 'post', + data: data + }) +} +//获取定性考核列表用于列表展示 +export const dutydepartmentlist = (data) => { + return request({ + url: '/admin/dutydepartmentlist', + method: 'post', + data: data + }) +} +//获取定性考核列表用于下拉列表 +export const selectdutylist = (data) => { + return request({ + url: '/admin/selectdutylist', + method: 'post', + data: data + }) +} +//根据指标ID获取列表信息 +export const idtotargetsunlist = (data) => { + return request({ + url: '/admin/idtotargetsunlist', + method: 'post', + data: data + }) +} +//修改子栏目名称 +export const eitesuntargetname = (data) => { + return request({ + url: '/admin/eitesuntargetname', + method: 'post', + data: data + }) +} +////获取定性指标->指标细则修改回显 +export const getdetailedtargetcallback = (data) => { + return request({ + url: '/admin/getdetailedtargetcallback', + method: 'post', + data: data + }) +} +////获取定性指标->指标细则修改回显与新增 +export const eitedetailedtargetcallback = (data) => { + return request({ + url: '/admin/eitedetailedtargetcallback', + method: 'post', + data: data + }) +} +////删除定性考核指标 +export const deldutytarget = (data) => { + return request({ + url: '/admin/deldutytarget', + method: 'post', + data: data + }) +} +////删除定性考核指标子栏目 +export const delsuntardimeat = (data) => { + return request({ + url: '/admin/delsuntardimeat', + method: 'post', + data: data + }) +} +//获取定性考核指标关系指定列表 +export const getdutyrelationlist = (data) => { + return request({ + url: '/admin/getdutyrelationlist', + method: 'post', + data: data + }) +} +//获取定性考核子栏目 +export const lookdutytargetinfo = (data) => { + return request({ + url: '/admin/lookdutytargetinfo', + method: 'post', + data: data + }) +} +//添加 定性考核指标关系指定 +export const adddutyrelation = (data) => { + return request({ + url: '/admin/adddutyrelation', + method: 'post', + data: data + }) +} +//删除定性考核指标(NEW) +export const newdeltarget = (data) => { + return request({ + url: '/admin/newdeltarget', + method: 'post', + data: data + }) +} +//获取被修改指标细则的详情(NEW) +export const getneweitedetailedtarget = (data) => { + return request({ + url: '/admin/getneweitedetailedtarget', + method: 'post', + data: data + }) +} +//删除指标细则内容(NEW) +export const newdeldetailedtarget = (data) => { + return request({ + url: '/admin/newdeldetailedtarget', + method: 'post', + data: data + }) +} +//删除指标子栏目内容(NEW) +export const newdelsuntarget = (data) => { + return request({ + url: '/admin/newdelsuntarget', + method: 'post', + data: data + }) +} +//修改或添加定性考核指标细则内容(NEW) +export const neweitedetailedtarget = (data) => { + return request({ + url: '/admin/neweitedetailedtarget', + method: 'post', + data: data + }) +} +//部门考核添加。NEW +export const newadddepartduty = (data) => { + return request({ + url: '/admin/newadddepartduty', + method: 'post', + data: data + }) +} +//新的部门考核指标获取列表 +export const newgerderpattarlist = (data) => { + return request({ + url: '/admin/newgerderpattarlist', + method: 'post', + data: data + }) +} +//删除部门考核(New) +export const deldepartduty = (data) => { + return request({ + url: '/admin/deldepartduty', + method: 'post', + data: data + }) +} +//删除部门考核指标(New) +export const deldepartdutytarger = (data) => { + return request({ + url: '/admin/deldepartdutytarger', + method: 'post', + data: data + }) +} +//获取定性考核相关部门 +export const getdepartforduty = (data) => { + return request({ + url: '/admin/getdepartforduty', + method: 'post', + data: data + }) +} +//修改已知定性考核指标关联部门 +export const eitedepartforduty = (data) => { + return request({ + url: '/admin/eitedepartforduty', + method: 'post', + data: data + }) +} +//部门考核方案版本列表 +export const departdutyplanversion = (data) => { + return request({ + url: '/admin/departdutyplanversion', + method: 'post', + data: data + }) +} +//添加部门考核方案(待版本号的版本) +export const adddepartdutyversio = (data) => { + return request({ + url: '/admin/adddepartdutyversio', + method: 'post', + data: data + }) +} +//查看考核方案(待版本号的版本) +export const lookdepartdutyversio = (data) => { + return request({ + url: '/admin/lookdepartdutyversio', + method: 'post', + data: data + }) +} +//启用禁用删除(待版本号的版本) +export const onoffdepartdutyversio = (data) => { + return request({ + url: '/admin/onoffdepartdutyversio', + method: 'post', + data: data + }) +} +//修改部门考核方案内的说明(待版本号的版本) +export const eitedepartexplain = (data) => { + return request({ + url: '/admin/eitedepartexplain', + method: 'post', + data: data + }) +} +//获取考核方法要修改的数据 +export const geteitesuntarterinfo = (data) => { + return request({ + url: '/admin/geteitesuntarterinfo', + method: 'post', + data: data + }) +} +//复制部门考核版本 +export const copydepartdutyversio = (data) => { + return request({ + url: '/admin/copydepartdutyversio', + method: 'post', + data: data + }) +} +//删除定量考核目标设定 +export const delquantitativeconfig = (data) => { + return request({ + url: '/admin/delquantitativeconfig', + method: 'post', + data: data + }) +} +//编辑定量考核目标设定 +export const eitequantitativeconfig = (data) => { + return request({ + url: '/admin/eitequantitativeconfig', + method: 'post', + data: data + }) +} diff --git a/src/api/duty/group.js b/src/api/duty/group.js new file mode 100644 index 0000000..5108c5f --- /dev/null +++ b/src/api/duty/group.js @@ -0,0 +1,162 @@ +// 集团api +import service from '@/utils/request' +// @Tags api +// @Summary 获取集团详情 不分页 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body modelInterface.PageInfo true "分页获取用户列表" +// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /api/getApiList [post] +// { +// page int +// pageSize int +// } +export const getgroupinfo = (data) => { + return service({ + url: '/group/getgroupinfo', + method: 'post', + data + }) +} + +// @Tags Api +// @Summary 获取子公司详情 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body api.CreateApiParams true "创建api" +// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /api/createApi [post] +export const getsubsidiaryinfo = (data) => { + return service({ + url: '/group/getsubsidiaryinfo', + method: 'post', + data + }) +} + +// @Tags menu +// @Summary 添加集团信息 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body api.GetById true "添加集团信息" +// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /menu/getApiById [post] +export const addgroupinfo = (data) => { + return service({ + url: '/group/addgroupinfo', + method: 'post', + data + }) +} + +// @Tags Api +// @Summary 获取工段详情 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body api.CreateApiParams true "获取工段详情" +// @Success 200 {string} json "{"success":true,"data":{},"msg":"更新成功"}" +// @Router /api/updateApi [post] +export const getgrouppositioninfo = (data) => { + return service({ + url: '/group/getgrouppositioninfo', + method: 'post', + data + }) +} + +// @Tags Api +// @Summary 修改集团信息 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body api.CreateApiParams true "修改集团信息" +// @Success 200 {string} json "{"success":true,"data":{},"msg":"更新成功"}" +// @Router /group/eitegroupinfo [post] +export const eitegroupinfo = (data) => { + return service({ + url: '/group/eitegroupinfo', + method: 'post', + data + }) +} + +// @Tags Api +// @Summary 删除集团框架相应信息 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /group/delgroupinfo [post] +export const delgroupinfo = (data) => { + return service({ + url: '/group/delgroupinfo', + method: 'post', + data + }) +} + +// @Tags Api +// @Summary 获取集团架构 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body dbModel.Api true "获取集团架构" +// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /group/grouplist [get] +export const grouplist = (data) => { + return service({ + url: '/group/grouplist', + method: 'post', + data + }) +} +// @Tags Api +// @Summary 获取集团架构(集团+分厂) +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body dbModel.Api true "获取集团架构" +// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /group/grouplist [get] +export const getgroupdepartmap = (data) => { + return service({ + url: '/group/getgroupdepartmap', + method: 'post', + data + }) +} +// @Tags Api +// @Summary 获取集团架构人员信息对照表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body dbModel.Api true "获取集团架构" +// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /group/grouplist [get] +export const getgroupuser = (data) => { + return service({ + url: '/group/getgroupuser', + method: 'post', + data + }) +} +// @Tags Api +// @Summary 获取分厂部室列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body dbModel.Api true "获取集团架构" +// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /group/grouplist [get] +export const departmentlist = (data) => { + return service({ + url: '/group/departmentlist', + method: 'post', + data + }) +} + diff --git a/src/api/duty/gwDingXing.js b/src/api/duty/gwDingXing.js new file mode 100644 index 0000000..4b21247 --- /dev/null +++ b/src/api/duty/gwDingXing.js @@ -0,0 +1,146 @@ +import request from '@/utils/requestFile' +// 获取岗位方案内容列表 +export function get_post_scheme(data) { + return request({ + url: '/postpc/get_post_scheme', + method: 'post', + data + }) +} +// 获取复制岗位考核方案 +export function get_copy_sheme_infor(data) { + return request({ + url: '/postpc/get_copy_sheme_infor', + method: 'post', + data + }) + } +// 引用指标部门指标 +export function quote_department_target(data) { + return request({ + url: '/postpc/quote_department_target', + method: 'post', + data + }) + } +// 提交岗位考核方案 +export function submit_post_scheme(data) { + return request({ + url: '/postpc/submit_post_scheme', + method: 'post', + data + }) + } +// 获取岗位相关指标 +export function getpostabouttarget(data) { + return request({ + url: '/postpc/getpostabouttarget', + method: 'post', + data + }) + } +// 添加岗位指标 +export function add_post_target(data) { + return request({ + url: '/postpc/add_post_target', + method: 'post', + data + }) +} +// 编辑岗位指标 +export function dit_post_target(data) { + return request({ + url: '/postpc/dit_post_target', + method: 'post', + data + }) +} +// 获取岗位指标关联部门相关岗位及提报人 +export function get_target_about_depart_to_post_man(data) { + return request({ + url: '/postpc/get_target_about_depart_to_post_man', + method: 'post', + data + }) +} +// 根据指标添加岗位细则 +export function add_post_target_cont(data) { + return request({ + url: '/postpc/add_post_target_cont', + method: 'post', + data + }) +} +// 根据指标获取岗位定性指标细则列表 +export function posttargetsunlist(data) { + return request({ + url: '/postpc/posttargetsunlist', + method: 'post', + data + }) +} +// 获取指标细则内容 +export function getdetailscont(data) { + return request({ + url: '/postpc/getdetailscont', + method: 'post', + data + }) +} +// 编辑定性指标细则内容 +export function editdeatilscont(data) { + return request({ + url: '/postpc/editdeatilscont', + method: 'post', + data + }) +} +// 编辑岗位子栏目内容 +export function edit_son_target_cont(data) { + return request({ + url: '/postpc/edit_son_target_cont', + method: 'post', + data + }) +} +// 岗位定量考核目标列表 +export function post_config_list(data) { + return request({ + url: '/postpc/post_config_list', + method: 'post', + data + }) +} +// 提交定量考核数据 +export function set_evaluation_objectives(data) { + return request({ + url: '/postpc/set_evaluation_objectives', + method: 'post', + data + }) +} +// 修改考核目标设置 +export function eite_quantitative_config(data) { + return request({ + url: '/postpc/eite_quantitative_config', + method: 'post', + data + }) +} +// 删除考核目标设置 +export function del_quantitative_config(data) { + return request({ + url: '/postpc/del_quantitative_config', + method: 'post', + data + }) +} +// 查看定量考核目标设定 +export function lookposttiveconfig(data) { + return request({ + url: '/postpc/lookposttiveconfig', + method: 'post', + data + }) +} + diff --git a/src/api/duty/gwFangan.js b/src/api/duty/gwFangan.js new file mode 100644 index 0000000..e9b9338 --- /dev/null +++ b/src/api/duty/gwFangan.js @@ -0,0 +1,59 @@ +import request from '@/utils/requestFile' +// 获取岗位方案内容列表 +export function get_post_scheme(data) { + return request({ + url: '/postpc/get_post_scheme', + method: 'post', + data + }) +} +// 获取岗位考核方案列表 +export function get_scheme_list(data) { + return request({ + url: '/postpc/get_scheme_list', + method: 'post', + data + }) + } +// 获取岗位考核方案列表 +export function getpostabouttarget(data) { + return request({ + url: '/postpc/getpostabouttarget', + method: 'post', + data + }) + } +// 引用指标部门指标 +export function quote_department_target(data) { + return request({ + url: '/postpc/quote_department_target', + method: 'post', + data + }) + } +// 提交岗位考核方案 +export function submit_post_scheme(data) { + return request({ + url: '/postpc/submit_post_scheme', + method: 'post', + data + }) + } +// 编辑方案版本状态或删除 +export function edit_scheme_state_of_del(data) { + return request({ + url: '/postpc/edit_scheme_state_of_del', + method: 'post', + data + }) + } +// 获取复制岗位考核方案 +export function get_copy_sheme_infor(data) { + return request({ + url: '/postpc/get_copy_sheme_infor', + method: 'post', + data + }) + } + + diff --git a/src/api/duty/oldGwDingXing.js b/src/api/duty/oldGwDingXing.js new file mode 100644 index 0000000..7a30346 --- /dev/null +++ b/src/api/duty/oldGwDingXing.js @@ -0,0 +1,91 @@ +// 定性考核api +import request from '@/utils/request' +//岗位定性考核列表 +export const posttargetsunlist = (data) => { + return request({ + url: '/postkpi/posttargetsunlist', + method: 'post', + data: data + }) +} +//添加岗位细则 +export const addposttargetcont = (data) => { + return request({ + url: '/postkpi/addposttargetcont', + method: 'post', + data: data + }) + } +//修改定性指标关联岗位 +export const editposttargetaual = (data) => { + return request({ + url: '/postkpi/editposttargetaual', + method: 'post', + data: data + }) + } + +//获取指标关联的岗位 +export const targetorglist = (data) => { + return request({ + url: '/postkpi/targetorglist', + method: 'post', + data: data + }) + } +//获取岗位考核子栏目内容 +export const getsuntargetinfo = (data) => { + return request({ + url: '/postkpi/getsuntargetinfo', + method: 'post', + data: data + }) +} +//编辑定性考核子栏目 +export const eidtsuntargetpost = (data) => { + return request({ + url: '/postkpi/eidtsuntargetpost', + method: 'post', + data: data + }) +} +//删除定性考核指标子栏目 +export const delsuntarget = (data) => { + return request({ + url: '/postkpi/delsuntarget', + method: 'post', + data: data + }) +} +//添加单条定性指标细则 +export const addpostdetacont = (data) => { + return request({ + url: '/postkpi/addpostdetacont', + method: 'post', + data: data + }) +} +//获取指标细则内容 +export const getdetailscont = (data) => { + return request({ + url: '/postkpi/getdetailscont', + method: 'post', + data: data + }) +} +//修改定性考核指标细则 +export const editdeatilscont = (data) => { + return request({ + url: '/postkpi/editdeatilscont', + method: 'post', + data: data + }) +} +//删除定性考核指标细则 +export const eidtposttardetailsstrte = (data) => { + return request({ + url: '/postkpi/eidtposttardetailsstrte', + method: 'post', + data: data + }) +} \ No newline at end of file diff --git a/src/api/duty/project.js b/src/api/duty/project.js new file mode 100644 index 0000000..1ec8463 --- /dev/null +++ b/src/api/duty/project.js @@ -0,0 +1,154 @@ +// 考核项目api +import request from '@/utils/request' +//考核项目列表 +export const assessList = (data) => { + return request({ + url: '/duty/assessList', + method: 'post', + data: data + }) +} +//添加考核项目 +export const addassessinfo = (data) => { + return request({ + url: '/duty/addassessinfo', + method: 'post', + data: data + }) +} +//查询考核项目详情 +export const getassessinfo = (data) => { + return request({ + url: '/duty/getassessinfo', + method: 'post', + data: data + }) +} +//编辑考核项目内容 +export const eiteassessinfo = (data) => { + return request({ + url: '/duty/eiteassessinfo', + method: 'post', + data: data + }) +} +//删除或改变考核项目状态 +export const eiteassessstate = (data) => { + return request({ + url: '/duty/eiteassessstate', + method: 'post', + data: data + }) +} +//获取考核指标列表 +export const gettarget = (data) => { + return request({ + url: '/duty/gettarget', + method: 'post', + data: data + }) +} +//添加考核指标 +export const addtarget = (data) => { + return request({ + url: '/duty/addtarget', + method: 'post', + data: data + }) +} +//获取考核指标详细内容 +export const gettargetinfo = (data) => { + return request({ + url: '/duty/gettargetinfo', + method: 'post', + data: data + }) +} +//删除指标/更改考核指标状态 +export const deltarget = (data) => { + return request({ + url: '/duty/deltarget', + method: 'post', + data: data + }) +} +//编辑指标内容 +export const eitetarget = (data) => { + return request({ + url: '/duty/eitetarget', + method: 'post', + data: data + }) +} +//汇总详情 +export const summarydetails = (data) => { + return request({ + url: '/quant/summarydetails', + method: 'post', + data: data + }) +} +//岗位考核指标列表 +export const posttargetlist = (data) => { + return request({ + url: '/postkpi/posttargetlist', + method: 'post', + data: data + }) +} +//编辑岗位指标 +export const editposttarget = (data) => { + return request({ + url: '/postkpi/editposttarget', + method: 'post', + data: data + }) +} +//编辑岗位指标状态 +export const editstate = (data) => { + return request({ + url: '/postkpi/editstate', + method: 'post', + data: data + }) +} +//添加岗位考核指标 +export const addposttarget = (data) => { + return request({ + url: '/postkpi/addposttarget', + method: 'post', + data: data + }) +} +//修改定性指标关联岗位 +export const editposttargetaual = (data) => { + return request({ + url: '/postkpi/editposttargetaual', + method: 'post', + data: data + }) +} +//添加岗位细则 +export const addposttargetcont = (data) => { + return request({ + url: '/postkpi/addposttargetcont', + method: 'post', + data: data + }) +} +//岗位定性考核列表 +export const posttargetsunlist = (data) => { + return request({ + url: '/postkpi/posttargetsunlist', + method: 'post', + data: data + }) +} +//获取指标关联的岗位 +export const targetorglist = (data) => { + return request({ + url: '/postkpi/targetorglist', + method: 'post', + data: data + }) +} diff --git a/src/api/duty/projectNew.js b/src/api/duty/projectNew.js new file mode 100644 index 0000000..9fef262 --- /dev/null +++ b/src/api/duty/projectNew.js @@ -0,0 +1,196 @@ +import request from '@/utils/requestFile' +// 部门指标列表 +export function departmenttargetlist(data) { + return request({ + url: '/department_pc/departmenttargetlist', + method: 'post', + data + }) +} +// 获取部门定性考核部门关联列表 +export function getdepartabouttarget(data) { + return request({ + url: '/department_pc/getdepartabouttarget', + method: 'post', + data + }) + } + // 获取部门指标相关执行人 +export function gettargetreport(data) { + return request({ + url: '/department_pc/gettargetreport', + method: 'post', + data + }) + } + // 修改子栏目标题名称级考核关联部门及提报人 + export function editsontargetdepartmentreport(data) { + return request({ + url: '/department_pc/editsontargetdepartmentreport', + method: 'post', + data + }) + } + // 根据指标和部门获取相关岗位 + export function basistargetdearpetmentgetpost(data) { + return request({ + url: '/department_pc/basistargetdearpetmentgetpost', + method: 'post', + data + }) + } + // 根据指标和部门获取相关岗位 + export function delsontarget(data) { + return request({ + url: '/department_pc/delsontarget', + method: 'post', + data + }) + } + // 删除指标 + export function deltarget(data) { + return request({ + url: '/department_pc/deltarget', + method: 'post', + data + }) + } + // 实验 + export function shiyan(data) { + return request({ + url: '/department_pc/shiyan', + method: 'post', + data + }) + } + // 获取定性考核指标列表内容 + export function getdepartmenttragetcontlist(data) { + return request({ + url: '/department_pc/getdepartmenttragetcontlist', + method: 'post', + data + }) + } + // 子栏目关联部门岗位 + export function depar_son_target_about_post(data) { + return request({ + url: '/department_pc/depar_son_target_about_post', + method: 'post', + data + }) + } + // 获取单一指标细则内容 + export function getonedetailedtarget(data) { + return request({ + url: '/department_pc/getonedetailedtarget', + method: 'post', + data + }) + } + // 获取部门指标岗位提交人 + export function basistaegetdeparmentreport(data) { + return request({ + url: '/department_pc/basistaegetdeparmentreport', + method: 'post', + data + }) + } + // 根据指标栏目新增指标细则 + export function basissontargetadddetailed(data) { + return request({ + url: '/department_pc/basissontargetadddetailed', + method: 'post', + data + }) + } + // 编辑单一部门指标 + export function edit_one_target(data) { + return request({ + url: '/department_pc/edit_one_target', + method: 'post', + data + }) + } + + // 指标细则关联部门岗位 + export function depar_detaile_about_post(data) { + return request({ + url: '/department_pc/depar_detaile_about_post', + method: 'post', + data + }) + } + + // 添加部门指标 + export function add_department_target(data) { + return request({ + url: '/department_pc/add_department_target', + method: 'post', + data + }) + } + // 添加定性考核子栏目及细则 + export function addsuntargetdetailed(data) { + return request({ + url: '/department_pc/addsuntargetdetailed', + method: 'post', + data + }) + } + + // 获取单一指标详细内容 + export function get_one_terget_info(data) { + return request({ + url: '/department_pc/get_one_terget_info', + method: 'post', + data + }) + } + // 指标关联岗位 + export function deparment_target_about_post(data) { + return request({ + url: '/department_pc/deparment_target_about_post', + method: 'post', + data + }) + } + // 编辑单一指标细则内容 + export function edit_one_detailed_target(data) { + return request({ + url: '/department_pc/edit_one_detailed_target', + method: 'post', + data + }) + } + // 获取子栏目基础信息 + export function getsontargetcont(data) { + return request({ + url: '/department_pc/getsontargetcont', + method: 'post', + data + }) + } + // 删除单一指标细则 + export function del_one_detailed_target(data) { + return request({ + url: '/department_pc/del_one_detailed_target', + method: 'post', + data + }) + } +// 获取岗位指标详情 +export function get_post_target(data) { + return request({ + url: '/postpc/get_post_target', + method: 'post', + data + }) +} +// 获取岗位子栏目详情 +export function get_sun_target_info(data) { + return request({ + url: '/postpc/get_sun_target_info', + method: 'post', + data + }) +} \ No newline at end of file diff --git a/src/api/duty/quanXian.js b/src/api/duty/quanXian.js new file mode 100644 index 0000000..9235f3a --- /dev/null +++ b/src/api/duty/quanXian.js @@ -0,0 +1,59 @@ +import request from '@/utils/requestFile' +// 添加应用系统 +export function add_system(data) { + return request({ + url: '/powerpc/add_system', + method: 'post', + data + }) +} +// 系统列表 +export function system_list(data) { + return request({ + url: '/powerpc/system_list', + method: 'post', + data + }) + } +// 编辑应用系统信息 +export function edit_system(data) { + return request({ + url: '/powerpc/edit_system', + method: 'post', + data + }) + } +// 更改状态或删除 +export function edit_state_of_del(data) { + return request({ + url: '/powerpc/edit_state_of_del', + method: 'post', + data + }) + } +// 系统菜单 +export function system_about_menu(data) { + return request({ + url: '/powerpc/system_about_menu', + method: 'post', + data + }) + } +// 系统授权-权限列表 +export function obtain_authorization(data) { + return request({ + url: '/system_authorizing/obtain_authorization', + method: 'post', + data + }) + } +// 编辑权限 +export function edit_power(data) { + return request({ + url: 'powerpc/edit_power', + method: 'post', + data + }) + } + + diff --git a/src/api/duty/quantitativeIndicators.js b/src/api/duty/quantitativeIndicators.js new file mode 100644 index 0000000..3caf5d1 --- /dev/null +++ b/src/api/duty/quantitativeIndicators.js @@ -0,0 +1,42 @@ +// 定量/定性指标api +import request from '@/utils/request' +//定量/定性指标列表 +export const dutylist = (data) => { + return request({ + url: '/duty/dutylist', + method: 'post', + data: data + }) +} +//添加定量/定性指标 +export const adddutyinfo = (data) => { + return request({ + url: '/duty/adddutyinfo', + method: 'post', + data: data + }) +} +//查询定量/定性指标详情 +export const getdutyinfo = (data) => { + return request({ + url: '/duty/getdutyinfo', + method: 'post', + data: data + }) +} +//编辑定量/定性指标内容 +export const eitedutyinfo = (data) => { + return request({ + url: '/duty/eitedutyinfo', + method: 'post', + data: data + }) +} +//删除或改变定量/定性指标状态 +export const eitedutystate = (data) => { + return request({ + url: '/duty/eitedutystate', + method: 'post', + data: data + }) +} diff --git a/src/api/duty/rules.js b/src/api/duty/rules.js new file mode 100644 index 0000000..dad043c --- /dev/null +++ b/src/api/duty/rules.js @@ -0,0 +1,83 @@ +// 考核细则api +import request from '@/utils/request' +//考核细则列表 +export const getqualitativetargetlist = (data) => { + return request({ + url: '/duty/getqualitativetargetlist', + method: 'post', + data: data + }) +} +//添加定性指标子栏目 +export const addqualitativetarget = (data) => { + return request({ + url: '/duty/addqualitativetarget', + method: 'post', + data: data + }) + } + //获取定性指标子栏目详细内容 +export const getqualitativetargetinfo = (data) => { + return request({ + url: '/duty/getqualitativetargetinfo', + method: 'post', + data: data + }) + } + //修改定性指标子栏目详细内容 +export const eitequalitativetargetinfo = (data) => { + return request({ + url: '/duty/eitequalitativetargetinfo', + method: 'post', + data: data + }) + } + //修改定性指标子栏目状态或删除 + export const delqualitativetargetinfo = (data) => { + return request({ + url: '/duty/delqualitativetargetinfo', + method: 'post', + data: data + }) + } + //添加考核细则 + export const adddetailedtarget = (data) => { + return request({ + url: '/duty/adddetailedtarget', + method: 'post', + data: data + }) + } + //获取考核细则内容 + export const getdetailedtarget = (data) => { + return request({ + url: '/duty/getdetailedtarget', + method: 'post', + data: data + }) + } + //获取考核细则列表 + export const getdetailedtargetlist = (data) => { + return request({ + url: '/duty/getdetailedtargetlist', + method: 'post', + data: data + }) + } + //编辑考核细则内容 + export const eitedetailedtarget = (data) => { + return request({ + url: '/duty/eitedetailedtarget', + method: 'post', + data: data + }) + } + //编辑考核细则内容 + export const deldetailedtarget = (data) => { + return request({ + url: '/duty/deldetailedtarget', + method: 'post', + data: data + }) + } + diff --git a/src/api/dutys.js b/src/api/dutys.js new file mode 100644 index 0000000..8b6f046 --- /dev/null +++ b/src/api/dutys.js @@ -0,0 +1,89 @@ +import request from '@/utils/request' +//个人需要填写的考核项目 +export function myassessmentlist(params) { + return request({ + url: '/dutys/myassessmentlist', + method: 'post', + params + }) +} +//根据具体考核项目获取被考核部门 +export const getDutydepartlist = (data) => { + return request({ + url: '/dutys/getDutydepartlist', + method: 'post', + data: data + }) +} +//根据具体考核项目获取被考核部门 +export const addassessmentscore = (data) => { + return request({ + url: '/dutys/addassessmentscore', + method: 'post', + data: data + }) +} +//个人考核评价记录 +export const myevaluatelist = (data) => { + return request({ + url: '/dutys/myevaluatelist', + method: 'post', + data: data + }) +} +//根据部门和时间获取考核详情 +export const getdeparttimeassess = (data) => { + return request({ + url: '/dutys/getdeparttimeassess', + method: 'post', + data: data + }) +} +//获取企业微信发起基础配置 +export const getconfig = (data) => { + return request({ + url: '/examine/getconfig', + method: 'post', + data: data + }) +} +//以部门维度考核内容列表 +export const departmentassess = (data) => { + return request({ + url: '/dutys/departmentassess', + method: 'post', + data: data + }) +} +//根据部门和时间写入全部考核项分值 +export const departmentassessdata = (data) => { + return request({ + url: '/dutys/departmentassessdata', + method: 'post', + data: data + }) +} +//查看审批详细内容 +export const lookdepartmentassessinfo = (data) => { + return request({ + url: '/noverify/lookdepartmentassessinfo', + method: 'post', + data: data + }) +} +//查看本部门提交的和个人提交的审批 +export const lookpersonalordepartment = (data) => { + return request({ + url: '/dutys/lookpersonalordepartment', + method: 'post', + data: data + }) +} +//获取正在激活的考核方案 +export const getactivationplanversion = (data) => { + return request({ + url: '/admin/getactivationplanversion', + method: 'post', + data: data + }) +} diff --git a/src/api/echarts/echarts.js b/src/api/echarts/echarts.js new file mode 100644 index 0000000..c4a4d72 --- /dev/null +++ b/src/api/echarts/echarts.js @@ -0,0 +1,49 @@ +import request from '@/utils/request' +//计算定量考核组织范围,及起止年份 +export const getquantechartorgandyear = (data) => { + return request({ + url: '/quant/getquantechartorgandyear', + method: 'post', + data: data + }) + } +//表格数据 +export const getplanversionvalid = (data) => { + return request({ + url: '/ststic/getplanversionvalid', + method: 'post', + data: data + }) +} +//计算定量考核数据 +export const quantechart = (data) => { + return request({ + url: '/quant/quantechart', + method: 'post', + data: data + }) +} +//成绩表查询 +export const departmenttranscript = (data) => { + return request({ + url: '/ststic/departmenttranscript', + method: 'post', + data: data + }) +} +//汇总详情定性历史记录 +export const summarydetailsxinglog = (data) => { + return request({ + url: '/quant/summarydetailsxinglog', + method: 'post', + data: data + }) +} +//汇总详情定量历史记录 +export const summarydetailslianglog = (data) => { + return request({ + url: '/quant/summarydetailslianglog', + method: 'post', + data: data + }) +} \ No newline at end of file diff --git a/src/api/group.js b/src/api/group.js new file mode 100644 index 0000000..0cf2821 --- /dev/null +++ b/src/api/group.js @@ -0,0 +1,32 @@ +import request from '@/utils/request' +// @Tags Api +// @Summary 获取集团架构(集团+分厂) +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body dbModel.Api true "获取集团架构" +// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /group/grouplist [get] +export const getgroupdepartmap = (data) => { + return request({ + url: '/group/getgroupdepartmap', + method: 'post', + data: data + }) + } + //以部门维度考核内容列表 +export const departmentassess = (data) => { + return request({ + url: '/dutys/departmentassess', + method: 'post', + data: data + }) + } + //定量考核打分 + export const addflowrationlog = (data) => { + return request({ + url: '/eval/addflowrationlog', + method: 'post', + data: data + }) + } \ No newline at end of file diff --git a/src/api/honer.js b/src/api/honer.js new file mode 100644 index 0000000..b8cd280 --- /dev/null +++ b/src/api/honer.js @@ -0,0 +1,81 @@ +import request from '@/utils/requestFile' +// 载体类型列表 +export function carrierlist(data) { + return request({ + url: '/honors/carrierlist', + method: 'post', + data + }) +} +// 添加载体类型 +export function addcarrier(data) { + return request({ + url: '/honors/addcarrier', + method: 'post', + data + }) + } + // 编辑载体类型 +export function eidycarrier(data) { + return request({ + url: '/honors/eidycarrier', + method: 'post', + data + }) + } + // 编辑载体类型状态 +export function eidycarrierstate(data) { + return request({ + url: '/honors/eidycarrierstate', + method: 'post', + data + }) + } + // 荣誉列表 + export function honorlist(data) { + return request({ + url: '/honors/honorlist', + method: 'post', + data + }) + } + // 添加荣誉 + export function addhonorcont(data) { + return request({ + url: '/honors/addhonorcont', + method: 'post', + data + }) + } + // 编辑荣誉 + export function eidyhonorcont(data) { + return request({ + url: '/honors/eidyhonorcont', + method: 'post', + data + }) + } + // 编辑荣誉状态 + export function eidyhonorcontstate(data) { + return request({ + url: '/honors/eidyhonorcontstate', + method: 'post', + data + }) + } + // 荣誉查看图片 + export function reviewimage(data) { + return request({ + url: '/honors/reviewimage', + method: 'post', + data + }) + } + // 查询荣誉详情 + export function gethonorscont(data) { + return request({ + url: '/honors/gethonorscont', + method: 'post', + data + }) + } \ No newline at end of file diff --git a/src/api/personnel/post.js b/src/api/personnel/post.js new file mode 100644 index 0000000..e5299f9 --- /dev/null +++ b/src/api/personnel/post.js @@ -0,0 +1,292 @@ +import request from '@/utils/request1' +//添加职位(岗位) +export const addpositioncont = (data) => { + return request({ + url: '/org/addpositioncont', + method: 'post', + data: data + }) + } +//获取职位(岗位)详情 +export const getpositioncont = (data) => { + return request({ + url: '/org/getpositioncont', + method: 'post', + data: data + }) + } +//编辑职位(岗位)状态或删除 +export const eitepositionstateordel = (data) => { + return request({ + url: '/org/eitepositionstateordel', + method: 'post', + data: data + }) +} +//职位(岗位)列表 +export const positionlist = (data) => { + return request({ + url: '/org/positionlist', + method: 'post', + data: data + }) +} +//编辑职位(岗位) +export const eitepositioncont = (data) => { + return request({ + url: '/org/eitepositioncont', + method: 'post', + data: data + }) +} +//职务列表 +export const dutieslist = (data) => { + return request({ + url: '/org/dutieslist', + method: 'post', + data: data + }) +} +//行政组织列表 +export const govlist = (data) => { + return request({ + url: '/org/govlist', + method: 'post', + data: data + }) +} +//行政组织树 +export const govthree = (data) => { + return request({ + url: '/org/govthree', + method: 'post', + data: data + }) +} +//岗位(职位)配权 +export const getpositionrole = (data) => { + return request({ + url: '/org/getpositionrole', + method: 'post', + data: data + }) +} +//岗位(职位)配权 +export const positionallotment = (data) => { + return request({ + url: '/permit/positionallotment', + method: 'post', + data: data + }) +} +//人员列表 +export const stafflist = (data) => { + return request({ + url: '/staff/stafflist', + method: 'post', + data: data + }) +} +//职务分类列表 +export const utiesclasslist = (data) => { + return request({ + url: '/org/utiesclasslist', + method: 'post', + data: data + }) +} +//添加职务分类 +export const adddutiesclass = (data) => { + return request({ + url: '/org/adddutiesclass', + method: 'post', + data: data + }) +} +//删除职务分类 +export const delutiesclassinfo = (data) => { + return request({ + url: '/org/delutiesclassinfo', + method: 'post', + data: data + }) +} +//修改职务分类详情 +export const eiteutiesclassinfo = (data) => { + return request({ + url: '/org/eiteutiesclassinfo', + method: 'post', + data: data + }) +} +//获取职务分类详情 +export const getutiesclassinfo = (data) => { + return request({ + url: '/org/getutiesclassinfo', + method: 'post', + data: data + }) +} +//编辑职务 +export const eitedutiescont = (data) => { + return request({ + url: '/org/eitedutiescont', + method: 'post', + data: data + }) +} +//编辑职务状态或删除 +export const eitedutiesstatordel = (data) => { + return request({ + url: '/org/eitedutiesstatordel', + method: 'post', + data: data + }) +} + +//获取职务详情 +export const getdutiescont = (data) => { + return request({ + url: '/org/getdutiescont', + method: 'post', + data: data + }) +} +//添加职务 +export const adddutiescont = (data) => { + return request({ + url: '/org/adddutiescont', + method: 'post', + data: data + }) +} +//行政组织类型列表 +export const govclasslist = (data) => { + return request({ + url: '/org/govclasslist', + method: 'post', + data: data + }) +} +//添加行政组织类型 +export const addgovclass = (data) => { + return request({ + url: '/org/addgovclass', + method: 'post', + data: data + }) +} +//编辑行政组织类型 +export const eitegovclasscont = (data) => { + return request({ + url: '/org/eitegovclasscont', + method: 'post', + data: data + }) +} +//获取行政组织类型 +export const getgovclasscont = (data) => { + return request({ + url: '/org/getgovclasscont', + method: 'post', + data: data + }) +} +//编辑行政组织类型状态或删除 +export const eitegovclassstateordel = (data) => { + return request({ + url: '/org/eitegovclassstateordel', + method: 'post', + data: data + }) +} +//编辑行政组织状态或删除 +export const eitegovstateordel = (data) => { + return request({ + url: '/org/eitegovstateordel', + method: 'post', + data: data + }) +} +//添加行政组织 +export const addgovcont = (data) => { + return request({ + url: '/org/addgovcont', + method: 'post', + data: data + }) +} +//编辑行政组织 +export const eitegovcont = (data) => { + return request({ + url: '/org/eitegovcont', + method: 'post', + data: data + }) +} +//获取行政组织详情 +export const getgovcont = (data) => { + return request({ + url: '/org/getgovcont', + method: 'post', + data: data + }) +} +//人员列表(新) +export const archiveslist = (data) => { + return request({ + url: '/staff/archiveslist', + method: 'post', + data: data + }) +} +//个人档案 +export const archivescont = (data) => { + return request({ + url: '/staff/archivescont', + method: 'post', + data: data + }) +} +//获取班组 +export const getteamcont = (data) => { + return request({ + url: '/org/getteamcont', + method: 'post', + data: data + }) +} +//编辑班组状态或删除 +export const eidtdelteamcont = (data) => { + return request({ + url: '/org/eidtdelteamcont', + method: 'post', + data: data + }) +} +//班组列表 +export const teamcontlist = (data) => { + return request({ + url: '/org/teamcontlist', + method: 'post', + data: data + }) +} +//添加班组 +export const addteamcont = (data) => { + return request({ + url: '/org/addteamcont', + method: 'post', + data: data + }) +} +//编辑班组 +export const eiteteamcont = (data) => { + return request({ + url: '/org/eiteteamcont', + method: 'post', + data: data + }) +} + + diff --git a/src/api/table.js b/src/api/table.js new file mode 100644 index 0000000..2752f52 --- /dev/null +++ b/src/api/table.js @@ -0,0 +1,9 @@ +import request from '@/utils/request' + +export function getList(params) { + return request({ + url: '/vue-admin-template/table/list', + method: 'get', + params + }) +} diff --git a/src/api/user.js b/src/api/user.js new file mode 100644 index 0000000..f294bf1 --- /dev/null +++ b/src/api/user.js @@ -0,0 +1,172 @@ +import request from '@/utils/request' + +export function login(data) { + return request({ + url: '/vue-admin-template/user/login', + method: 'post', + data + }) +} + +export function getInfo(token) { + return request({ + url: '/vue-admin-template/user/info', + method: 'get', + params: { token } + }) +} +// @Summary 获取验证码 +// @Produce application/json +// @Param data body {username:"string",password:"string"} +// @Router /base/captcha [post] +// export const captcha = (data) => { +// return service({ +// url: '/base/captcha', +// method: 'post', +// data: data +// }) +// } +export function captcha() { + return request({ + url: '/base/captcha', + method: 'post' + }) +} +// @Summary 后端登录 +// @Produce application/json +// @Param data body {username:"string",password:"string"} +// @Router /base/login [post] +export const mysystemlogin = (data) => { + return request({ + url: '/base/mysystemlogin?id=1', + method: 'post', + data: data + }) +} +// @Summary 用户端登录 +// @Produce application/json +// @Param data body {username:"string",password:"string"} +// @Router /base/login [post] +export const mylogin = (data) => { + return request({ + url: '/base/mylogin', + method: 'post', + data: data + }) +} +// @Summary 获取系统左侧菜单 +// @Produce application/json +// @Param data body {username:"string",password:"string"} +// @Router /base/login [post] +export const getmenu = (data) => { + return request({ + url: '/systemmenu/getmenu', + method: 'post', + data: data + }) +} +export function logout() { + return request({ + url: '/vue-admin-template/user/logout', + method: 'post' + }) +} +// @Summary 系统菜单列表 +// @Produce application/json +// @Param data body {username:"string",password:"string"} +// @Router /base/login [post] +export const systemmenulist = (data) => { + return request({ + url: '/systemmenu/systemmenulist', + method: 'post', + data: data + }) +} +// @Summary 添加菜单 +// @Produce application/json +// @Param data body {username:"string",password:"string"} +// @Router /base/login [post] +export const addmenu = (data) => { + return request({ + url: '/systemmenu/addmenu', + method: 'post', + data: data + }) +} +// @Summary 修改菜单 +// @Produce application/json +// @Param data body {username:"string",password:"string"} +// @Router /base/login [post] +export const eitemenu = (data) => { + return request({ + url: '/systemmenu/eitemenu', + method: 'post', + data: data + }) +} +// @Summary 删除菜单 +// @Produce application/json +// @Param data body {username:"string",password:"string"} +// @Router /base/login [post] +export const delmenu = (data) => { + return request({ + url: '/systemmenu/delmenu', + method: 'post', + data: data + }) +} +// @Summary 添加菜单功能 +// @Produce application/json +// @Param data body {username:"string",password:"string"} +// @Router /base/login [post] +export const addmenuoperation = (data) => { + return request({ + url: '/systemmenu/addmenuoperation', + method: 'post', + data: data + }) +} +// @Summary 删除菜单功能 +// @Produce application/json +// @Param data body {username:"string",password:"string"} +// @Router /base/login [post] +export const delmenuperation = (data) => { + return request({ + url: '/systemmenu/delmenuperation', + method: 'post', + data: data + }) +} +// @Summary 查询个人信息 +// @Produce application/json +// @Param data body {username:"string",password:"string"} +// @Router /base/login [post] +export const scancode = (data) => { + return request({ + url: '/noverify/scancode', + method: 'post', + data: data + }) +} +// @Summary 超级登录 +// @Produce application/json +// @Param data body {username:"string",password:"string"} +// @Router /base/login [post] +export const scancodelogin = (data) => { + return request({ + url: '/base/scancodelogin', + method: 'post', + data: data + }) +} +// @Summary 登出 +// @Produce application/json +// @Param data body {username:"string",password:"string"} +// @Router /base/login [post] +export const signout = (data) => { + return request({ + url: '/base/signout', + method: 'post', + data: data + }) +} diff --git a/src/assets/404_images/404.png b/src/assets/404_images/404.png new file mode 100644 index 0000000..3d8e230 Binary files /dev/null and b/src/assets/404_images/404.png differ diff --git a/src/assets/404_images/404_cloud.png b/src/assets/404_images/404_cloud.png new file mode 100644 index 0000000..c6281d0 Binary files /dev/null and b/src/assets/404_images/404_cloud.png differ diff --git a/src/assets/404_images/dashbord.png b/src/assets/404_images/dashbord.png new file mode 100644 index 0000000..64981d0 Binary files /dev/null and b/src/assets/404_images/dashbord.png differ diff --git a/src/assets/404_images/login_background.jpg b/src/assets/404_images/login_background.jpg new file mode 100644 index 0000000..e601f24 Binary files /dev/null and b/src/assets/404_images/login_background.jpg differ diff --git a/src/assets/404_images/login_background.svg b/src/assets/404_images/login_background.svg new file mode 100644 index 0000000..0a9514b --- /dev/null +++ b/src/assets/404_images/login_background.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/assets/404_images/login_left.svg b/src/assets/404_images/login_left.svg new file mode 100644 index 0000000..9c48b0b --- /dev/null +++ b/src/assets/404_images/login_left.svg @@ -0,0 +1,123 @@ + + + 搭建网站 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/assets/404_images/logo.jpg b/src/assets/404_images/logo.jpg new file mode 100644 index 0000000..09502d5 Binary files /dev/null and b/src/assets/404_images/logo.jpg differ diff --git a/src/assets/404_images/logo.png b/src/assets/404_images/logo.png new file mode 100644 index 0000000..b497ee0 Binary files /dev/null and b/src/assets/404_images/logo.png differ diff --git a/src/assets/404_images/logo_login.png b/src/assets/404_images/logo_login.png new file mode 100644 index 0000000..e330458 Binary files /dev/null and b/src/assets/404_images/logo_login.png differ diff --git a/src/components/Breadcrumb/index.vue b/src/components/Breadcrumb/index.vue new file mode 100644 index 0000000..bb9234c --- /dev/null +++ b/src/components/Breadcrumb/index.vue @@ -0,0 +1,78 @@ + + + + + diff --git a/src/components/Hamburger/index.vue b/src/components/Hamburger/index.vue new file mode 100644 index 0000000..368b002 --- /dev/null +++ b/src/components/Hamburger/index.vue @@ -0,0 +1,44 @@ + + + + + diff --git a/src/components/SvgIcon/index.vue b/src/components/SvgIcon/index.vue new file mode 100644 index 0000000..b07ded2 --- /dev/null +++ b/src/components/SvgIcon/index.vue @@ -0,0 +1,62 @@ + + + + + diff --git a/src/components/projectDialog/index.vue b/src/components/projectDialog/index.vue new file mode 100644 index 0000000..11b0c81 --- /dev/null +++ b/src/components/projectDialog/index.vue @@ -0,0 +1,151 @@ + + + + + \ No newline at end of file diff --git a/src/icons/index.js b/src/icons/index.js new file mode 100644 index 0000000..2c6b309 --- /dev/null +++ b/src/icons/index.js @@ -0,0 +1,9 @@ +import Vue from 'vue' +import SvgIcon from '@/components/SvgIcon'// svg component + +// register globally +Vue.component('svg-icon', SvgIcon) + +const req = require.context('./svg', false, /\.svg$/) +const requireAll = requireContext => requireContext.keys().map(requireContext) +requireAll(req) diff --git a/src/icons/svg/dashboard.svg b/src/icons/svg/dashboard.svg new file mode 100644 index 0000000..5317d37 --- /dev/null +++ b/src/icons/svg/dashboard.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/example.svg b/src/icons/svg/example.svg new file mode 100644 index 0000000..46f42b5 --- /dev/null +++ b/src/icons/svg/example.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/eye-open.svg b/src/icons/svg/eye-open.svg new file mode 100644 index 0000000..88dcc98 --- /dev/null +++ b/src/icons/svg/eye-open.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/eye.svg b/src/icons/svg/eye.svg new file mode 100644 index 0000000..16ed2d8 --- /dev/null +++ b/src/icons/svg/eye.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/form.svg b/src/icons/svg/form.svg new file mode 100644 index 0000000..dcbaa18 --- /dev/null +++ b/src/icons/svg/form.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/link.svg b/src/icons/svg/link.svg new file mode 100644 index 0000000..48197ba --- /dev/null +++ b/src/icons/svg/link.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/nested.svg b/src/icons/svg/nested.svg new file mode 100644 index 0000000..06713a8 --- /dev/null +++ b/src/icons/svg/nested.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/password.svg b/src/icons/svg/password.svg new file mode 100644 index 0000000..e291d85 --- /dev/null +++ b/src/icons/svg/password.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/table.svg b/src/icons/svg/table.svg new file mode 100644 index 0000000..0e3dc9d --- /dev/null +++ b/src/icons/svg/table.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/tree.svg b/src/icons/svg/tree.svg new file mode 100644 index 0000000..dd4b7dd --- /dev/null +++ b/src/icons/svg/tree.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/user.svg b/src/icons/svg/user.svg new file mode 100644 index 0000000..0ba0716 --- /dev/null +++ b/src/icons/svg/user.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svgo.yml b/src/icons/svgo.yml new file mode 100644 index 0000000..d11906a --- /dev/null +++ b/src/icons/svgo.yml @@ -0,0 +1,22 @@ +# replace default config + +# multipass: true +# full: true + +plugins: + + # - name + # + # or: + # - name: false + # - name: true + # + # or: + # - name: + # param1: 1 + # param2: 2 + +- removeAttrs: + attrs: + - 'fill' + - 'fill-rule' diff --git a/src/layout/components/AppMain.vue b/src/layout/components/AppMain.vue new file mode 100644 index 0000000..63783eb --- /dev/null +++ b/src/layout/components/AppMain.vue @@ -0,0 +1,48 @@ + + + + + + + diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue new file mode 100644 index 0000000..b2c3ef8 --- /dev/null +++ b/src/layout/components/Navbar.vue @@ -0,0 +1,154 @@ + + + + + diff --git a/src/layout/components/Sidebar/FixiOSBug.js b/src/layout/components/Sidebar/FixiOSBug.js new file mode 100644 index 0000000..bc14856 --- /dev/null +++ b/src/layout/components/Sidebar/FixiOSBug.js @@ -0,0 +1,26 @@ +export default { + computed: { + device() { + return this.$store.state.app.device + } + }, + mounted() { + // In order to fix the click on menu on the ios device will trigger the mouseleave bug + // https://github.com/PanJiaChen/vue-element-admin/issues/1135 + this.fixBugIniOS() + }, + methods: { + fixBugIniOS() { + const $subMenu = this.$refs.subMenu + if ($subMenu) { + const handleMouseleave = $subMenu.handleMouseleave + $subMenu.handleMouseleave = (e) => { + if (this.device === 'mobile') { + return + } + handleMouseleave(e) + } + } + } + } +} diff --git a/src/layout/components/Sidebar/Item.vue b/src/layout/components/Sidebar/Item.vue new file mode 100644 index 0000000..aa1f5da --- /dev/null +++ b/src/layout/components/Sidebar/Item.vue @@ -0,0 +1,41 @@ + + + diff --git a/src/layout/components/Sidebar/Link.vue b/src/layout/components/Sidebar/Link.vue new file mode 100644 index 0000000..09075ed --- /dev/null +++ b/src/layout/components/Sidebar/Link.vue @@ -0,0 +1,49 @@ + + + diff --git a/src/layout/components/Sidebar/Logo.vue b/src/layout/components/Sidebar/Logo.vue new file mode 100644 index 0000000..040fab6 --- /dev/null +++ b/src/layout/components/Sidebar/Logo.vue @@ -0,0 +1,82 @@ + + + + + diff --git a/src/layout/components/Sidebar/SidebarItem copy.vue b/src/layout/components/Sidebar/SidebarItem copy.vue new file mode 100644 index 0000000..a418c3d --- /dev/null +++ b/src/layout/components/Sidebar/SidebarItem copy.vue @@ -0,0 +1,95 @@ + + + diff --git a/src/layout/components/Sidebar/SidebarItem.vue b/src/layout/components/Sidebar/SidebarItem.vue new file mode 100644 index 0000000..9c308f2 --- /dev/null +++ b/src/layout/components/Sidebar/SidebarItem.vue @@ -0,0 +1,95 @@ + + + diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue new file mode 100644 index 0000000..b1fef16 --- /dev/null +++ b/src/layout/components/Sidebar/index.vue @@ -0,0 +1,95 @@ + + + diff --git a/src/layout/components/Sidebar/subMenu copy.vue b/src/layout/components/Sidebar/subMenu copy.vue new file mode 100644 index 0000000..7163210 --- /dev/null +++ b/src/layout/components/Sidebar/subMenu copy.vue @@ -0,0 +1,42 @@ + + + + + \ No newline at end of file diff --git a/src/layout/components/Sidebar/subMenu.vue b/src/layout/components/Sidebar/subMenu.vue new file mode 100644 index 0000000..bf4eac9 --- /dev/null +++ b/src/layout/components/Sidebar/subMenu.vue @@ -0,0 +1,44 @@ + + + + + \ No newline at end of file diff --git a/src/layout/components/TagsView/ScrollPane.vue b/src/layout/components/TagsView/ScrollPane.vue new file mode 100644 index 0000000..bb753a1 --- /dev/null +++ b/src/layout/components/TagsView/ScrollPane.vue @@ -0,0 +1,94 @@ + + + + + diff --git a/src/layout/components/TagsView/index.vue b/src/layout/components/TagsView/index.vue new file mode 100644 index 0000000..3929722 --- /dev/null +++ b/src/layout/components/TagsView/index.vue @@ -0,0 +1,294 @@ + + + + + + + diff --git a/src/layout/components/historyComponent/history.vue b/src/layout/components/historyComponent/history.vue new file mode 100644 index 0000000..8dffcc6 --- /dev/null +++ b/src/layout/components/historyComponent/history.vue @@ -0,0 +1,326 @@ + + + + + diff --git a/src/layout/components/index.js b/src/layout/components/index.js new file mode 100644 index 0000000..97ee3cd --- /dev/null +++ b/src/layout/components/index.js @@ -0,0 +1,3 @@ +export { default as Navbar } from './Navbar' +export { default as Sidebar } from './Sidebar' +export { default as AppMain } from './AppMain' diff --git a/src/layout/index.vue b/src/layout/index.vue new file mode 100644 index 0000000..ed63580 --- /dev/null +++ b/src/layout/index.vue @@ -0,0 +1,107 @@ + + + + + diff --git a/src/layout/mixin/ResizeHandler copy.js b/src/layout/mixin/ResizeHandler copy.js new file mode 100644 index 0000000..e8d0df8 --- /dev/null +++ b/src/layout/mixin/ResizeHandler copy.js @@ -0,0 +1,45 @@ +import store from '@/store' + +const { body } = document +const WIDTH = 992 // refer to Bootstrap's responsive design + +export default { + watch: { + $route(route) { + if (this.device === 'mobile' && this.sidebar.opened) { + store.dispatch('app/closeSideBar', { withoutAnimation: false }) + } + } + }, + beforeMount() { + window.addEventListener('resize', this.$_resizeHandler) + }, + beforeDestroy() { + window.removeEventListener('resize', this.$_resizeHandler) + }, + mounted() { + const isMobile = this.$_isMobile() + if (isMobile) { + store.dispatch('app/toggleDevice', 'mobile') + store.dispatch('app/closeSideBar', { withoutAnimation: true }) + } + }, + methods: { + // use $_ for mixins properties + // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential + $_isMobile() { + const rect = body.getBoundingClientRect() + return rect.width - 1 < WIDTH + }, + $_resizeHandler() { + if (!document.hidden) { + const isMobile = this.$_isMobile() + store.dispatch('app/toggleDevice', isMobile ? 'mobile' : 'desktop') + + if (isMobile) { + store.dispatch('app/closeSideBar', { withoutAnimation: true }) + } + } + } + } +} diff --git a/src/layout/mixin/ResizeHandler.js b/src/layout/mixin/ResizeHandler.js new file mode 100644 index 0000000..e8d0df8 --- /dev/null +++ b/src/layout/mixin/ResizeHandler.js @@ -0,0 +1,45 @@ +import store from '@/store' + +const { body } = document +const WIDTH = 992 // refer to Bootstrap's responsive design + +export default { + watch: { + $route(route) { + if (this.device === 'mobile' && this.sidebar.opened) { + store.dispatch('app/closeSideBar', { withoutAnimation: false }) + } + } + }, + beforeMount() { + window.addEventListener('resize', this.$_resizeHandler) + }, + beforeDestroy() { + window.removeEventListener('resize', this.$_resizeHandler) + }, + mounted() { + const isMobile = this.$_isMobile() + if (isMobile) { + store.dispatch('app/toggleDevice', 'mobile') + store.dispatch('app/closeSideBar', { withoutAnimation: true }) + } + }, + methods: { + // use $_ for mixins properties + // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential + $_isMobile() { + const rect = body.getBoundingClientRect() + return rect.width - 1 < WIDTH + }, + $_resizeHandler() { + if (!document.hidden) { + const isMobile = this.$_isMobile() + store.dispatch('app/toggleDevice', isMobile ? 'mobile' : 'desktop') + + if (isMobile) { + store.dispatch('app/closeSideBar', { withoutAnimation: true }) + } + } + } + } +} diff --git a/src/main.js b/src/main.js new file mode 100644 index 0000000..5654222 --- /dev/null +++ b/src/main.js @@ -0,0 +1,60 @@ +import Vue from 'vue' + +import 'normalize.css/normalize.css' // A modern alternative to CSS resets + +import ElementUI from 'element-ui' +import * as echarts from 'echarts'; +import 'element-ui/lib/theme-chalk/index.css' +// import locale from 'element-ui/lib/locale/lang/en' // lang i18n + +import '@/styles/index.scss' // global css +import { Loading } from 'element-ui'; +import App from './App' +import store from './store' +import router from './router' + +// import 'handsontable/dist/handsontable.full.css'; +import '@/icons' // icon +// import '@/permission' // permission control + +/** + * If you don't want to use mock-server + * you want to use MockJs for mock api + * you can execute: mockXHR() + * + * Currently MockJs will be used in the production environment, + * please remove it before going online ! ! ! + */ +if (process.env.NODE_ENV === 'production') { + const { mockXHR } = require('../mock') + mockXHR() +} + +// set ElementUI lang to EN +// Vue.use(ElementUI, { locale }) +// 如果想要中文版 element-ui,按如下方式声明 +Vue.use(ElementUI) +Vue.prototype.$echarts = echarts +Vue.config.productionTip = false +Vue.prototype.openLoading = function() { + const loading = this.$loading({ // 声明一个loading对象 + lock: true, // 是否锁屏 + text: '加载中', // 加载动画的文字 + spinner: 'el-icon-loading', // 引入的loading图标 + background: 'rgba(0, 0, 0, 0.8)', // 背景颜色 + target: '.el-table, .table-flex, .region', // **需要遮罩的区域,这里写要添加loading的选择器** + fullscreen: false, + customClass: 'loadingclass' // **遮罩层新增类名,如果需要修改loading的样式** + }) + setTimeout(function () { // 设定定时器,超时5S后自动关闭遮罩层,避免请求失败时,遮罩层一直存在的问题 + loading.close(); // 关闭遮罩层 + },5000) + return loading; +} + +new Vue({ + el: '#app', + router, + store, + render: h => h(App) +}) diff --git a/src/mixins/infoList.js b/src/mixins/infoList.js new file mode 100644 index 0000000..8541ed5 --- /dev/null +++ b/src/mixins/infoList.js @@ -0,0 +1,75 @@ + +import { formatTimeToStr } from '@/utils/date' + +export default { + data() { + return { + page: 1, + total: 10, + pageSize: 10, + tableData: [], + tabledata:[], + searchInfo: {} + } + }, + methods: { + formatBoolean: function(bool) { + if (bool !== null) { + return bool ? '是' : '否' + } else { + return '' + } + }, + formatDate: function(time) { + if (time !== null && time !== '') { + var date = new Date(time) + return formatTimeToStr(date, 'yyyy-MM-dd hh:mm:ss') + } else { + return '' + } + }, + filterDict(value, type) { + const rowLabel = this[type + 'Options'] && this[type + 'Options'].filter(item => item.value === value) + return rowLabel && rowLabel[0] && rowLabel[0].label + }, + async getDict(type) { + const dicts = await getDict(type) + this[type + 'Options'] = dicts + return dicts + }, + handleSizeChange(val) { + this.pageSize = val + this.getTableData() + }, + handleCurrentChange(val) { + this.page = val + this.getTableData() + }, + // @params beforeFunc function 请求发起前执行的函数 默认为空函数 + // @params afterFunc function 请求完成后执行的函数 默认为空函数 + async getTableData(beforeFunc = () => {}, afterFunc = () => {}) { + beforeFunc() + const table = await this.listApi({ page: this.page, pageSize: this.pageSize, ...this.searchInfo }) + // console.log(table.code) + // console.log("datalist") + // console.log(table.data) + if (table.code === 0) { + this.tableData = table.data.list + this.total = table.data.total + this.count = table.data.count + this.page = table.data.page + this.pageSize = table.data.pageSize + this.pagesize = table.data.pagesize + this.tabledata = table.data.data + // if (table.data.data!='') { + // this.tableData = table.data.data + // } + } + if (table.code === 200) { + this.tableData = table.data + } + + afterFunc() + } + } +} diff --git a/src/permission.js b/src/permission.js new file mode 100644 index 0000000..fc999e9 --- /dev/null +++ b/src/permission.js @@ -0,0 +1,80 @@ +import router from './router' +import store from './store' +import { Message } from 'element-ui' +import NProgress from 'nprogress' // progress bar +import 'nprogress/nprogress.css' // progress bar style +import { getToken } from '@/utils/auth' // get token from cookie +import getPageTitle from '@/utils/get-page-title' + +NProgress.configure({ showSpinner: false }) // NProgress Configuration + +const whiteList = ['/login'] // no redirect whitelist + +router.beforeEach(async(to, from, next) => { + // start progress bar + NProgress.start() + + // set page title + document.title = getPageTitle(to.meta.title) + + // determine whether the user has logged in + const hasToken = getToken() + if (hasToken!='') { + next({path:'/index'}) + } else { + console.log("permission login") + next({path:'/login'}) + } + if (hasToken) { + console.log("hasToken") + console.log(hasToken) + // if (to.path === '/login') { + // console.log("111") + // // if is logged in, redirect to the home page + // next({ path: '/' }) + // NProgress.done() + // } else { + // console.log("222") + // const hasGetUserInfo = store.getters.name + // if (hasGetUserInfo) { + // console.log("333") + // next() + + // } else { + // try { + // console.log("444") + // // get user info + // await store.dispatch('user/getInfo') + + // next() + // } catch (error) { + // console.log("555") + // // remove token and go to login page to re-login + // await store.dispatch('user/resetToken') + // Message.error(error || 'Has Error') + // next(`/login?redirect=${to.path}`) + // NProgress.done() + // } + // } + // } + } else { + console.log("666") + /* has no token*/ + + if (whiteList.indexOf(to.path) !== -1) { + console.log("777") + // in the free login whitelist, go directly + next() + } else { + console.log("888") + // other pages that do not have permission to access are redirected to the login page. + next(`/login?redirect=${to.path}`) + NProgress.done() + } + } +}) + +router.afterEach(() => { + // finish progress bar + NProgress.done() +}) diff --git a/src/router/__index.js b/src/router/__index.js new file mode 100644 index 0000000..6ceee58 --- /dev/null +++ b/src/router/__index.js @@ -0,0 +1,164 @@ +import Vue from 'vue' +import Router from 'vue-router' +import {getmenu} from '../api/user.js' + +Vue.use(Router) + + +/* Layout */ +import Layout from '@/layout' + +export const constantRoutes = [ + { + path: '/login', + component: () => import('@/views/login/wxLogin'), + hidden: true + }, + { + path: '/approval', + component: () => import('@/views/approval/index'), + hidden: true + }, + { + path: '/index', + component: () => import('@/views/index'), + hidden: true + }, + { + path: '/404', + component: () => import('@/views/404'), + hidden: true + }, + { + path: '/', + component: Layout, + redirect: '/frontPage', + children: [{ + path: 'frontPage', + name: 'frontPage', + component: () => import('@/views/frontPage/index'), + meta: { title: '首页'} + }] + }, + + { + path: '/assessmentProgram', + component: Layout, + redirect: '/assessmentProgram/departmentalAssessment', + name: 'Example', + meta: { title: '考核方案', icon: 'el-icon-s-help' }, + children: [ + { + path: 'departmentalAssessment', + name: 'departmentalAssessment', + component: () => import('@/views/assessmentProgram/departmentalAssessment'), + meta: { title: '部门考核', icon: 'table' } + }, + + { + path: 'qualitativeIndicators', + name: 'qualitativeIndicators', + component: () => import('@/views/assessmentProgram/qualitativeIndicators'), + meta: { title: '定性考核', icon: 'tree' } + }, + + ] + }, + { + path: '/basicInfo', + component: Layout, + redirect: '/basicInfo/assessmentDimension', + name: 'Example', + meta: { title: '基础信息', icon: 'el-icon-s-help' }, + children: [ + { + path: 'assessmentDimension', + name: 'assessmentDimension', + component: () => import('@/views/basicInfo/assessmentDimension.vue'), + meta: { title: '考核维度', icon: 'table' } + }, + + { + path: 'project', + name: 'project', + component: () => import('@/views/basicInfo/project'), + meta: { title: '考核指标', icon: 'tree' } + }, + { + path: 'Target', + name: 'Target', + component: () => import('@/views/basicInfo/target'), + meta: { title: '指标目标', icon: 'tree' } + }, + + ] + }, + + { + path: '/details', + component: Layout, + redirect: '/details', + children: [{ + path: 'details', + name: 'Details', + component: () => import('@/views/record/details'), + + }] + }, + + // 404 page must be placed at the end !!! + { path: '*', redirect: '/404', hidden: true } +] + +const routert = new Router({ + linkActiveClass:"selected", + constantRoutes +}) + +const createRouter = () => new Router({ + // mode: 'history', // require service support + scrollBehavior: () => ({ y: 0 }), + routes: constantRoutes +}) +// 路由拦截 +routert.beforeEach((to,from,next)=>{ + + addRouters(); + console.log("123456") + next(); +}); +// 获取后台给的路由 +async function addRouters(){ + const res = await getmenu() + var data = routersData(res.data) + // 动态添加 + router.addRoute(data) + console.log("luyou") +} +// 拼接数据(路由) +function routersData(result){ + + router.push({ + path: '/aaa', + component: Layout, + redirect: '/aaa', + children: [{ + path: 'aaa', + name: 'aaa', + component: () => import('@/views/frontPage/index'), + meta: { title: '首页1'} + }] + + }) + +} + +const router = createRouter() + +// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465 +export function resetRouter() { + const newRouter = createRouter() + router.matcher = newRouter.matcher // reset router +} + +export default router diff --git a/src/router/index.js b/src/router/index.js new file mode 100644 index 0000000..ba1c224 --- /dev/null +++ b/src/router/index.js @@ -0,0 +1,446 @@ +import Vue from 'vue' +import Router from 'vue-router' + +Vue.use(Router) + +/* Layout */ +import Layout from '@/layout' +/** + * Note: sub-menu only appear when route children.length >= 1 + * Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html + * + * hidden: true if set true, item will not show in the sidebar(default is false) + * alwaysShow: true if set true, will always show the root menu + * if not set alwaysShow, when item has more than one children route, + * it will becomes nested mode, otherwise not show the root menu + * redirect: noRedirect if set noRedirect will no redirect in the breadcrumb + * name:'router-name' the name is used by (must set!!!) + * meta : { + roles: ['admin','editor'] control the page roles (you can set multiple roles) + title: 'title' the name show in sidebar and breadcrumb (recommend set) + icon: 'svg-name'/'el-icon-x' the icon show in the sidebar + breadcrumb: false if set false, the item will hidden in breadcrumb(default is true) + activeMenu: '/example/list' if set path, the sidebar will highlight the path you set + } + */ + +/** + * constantRoutes + * a base page that does not have permission requirements + * all roles can be accessed + */ +export const constantRoutes = [ + { + path: '/', + component: Layout, + redirect: '/frontPage', + children: [{ + path: 'frontPage', + name: 'frontPage', + component: () => import('@/views/frontPage/index'), + meta: { title: '首页'} + }] + }, + { + path: '/login', + component: () => import('@/views/login/wxLogin'), + hidden: true + }, + // 扫码登录中间件 + { + path: '/ceshi', + component: () => import('@/views/ce/index'), + // hidden: true + }, + { + path: '/lunbo', + component: () => import('@/views/lunbo/index'), + // hidden: true + }, + + { + path: '/approval', + component: () => import('@/views/approval/index'), + hidden: true + }, + // { + // path: '/details', + // component: () => import('@/views/record/details'), + // hidden: true + // }, + { + path: '/index', + component: () => import('@/views/index'), + hidden: true + }, + { + path: '/404', + component: () => import('@/views/404'), + hidden: true + }, + + { + path: '/permissionSetting', + component: Layout, + redirect: '/permissionSetting', + children: [{ + path: 'permissionSetting', + component: () => import('@/views/permission/permissionSetting'), + meta: { title: '权限配置'} + }] + }, + // /setsystem/systemmenulist + { + path: '/setsystem', + component: Layout, + children: [ + // 当 /user/:id 匹配成功 + // UserHome 将被渲染到 User 的 内部 + { + path: 'systemmenulist', + component: () => import('@/views/menuSettings/index'), + meta: { title: '菜单管理'} + }, + ], + }, + // 考核数据 + { + path: '/echarts', + component: Layout, + children: [ + // 当 /user/:id 匹配成功 + // UserHome 将被渲染到 User 的 内部 + { + path: 'table', + component: () => import('@/views/echarts/table'), + meta: { title: '明细表'} + }, + { + path: 'echarts', + component: () => import('@/views/echarts/echarts'), + meta: { title: '图表信息'} + }, + { + path: 'total', + component: () => import('@/views/echarts/total'), + meta: { title: '成绩表'} + }, + ], + }, + // hr设置 + { + path: '/personnel', + component: Layout, + children: [ + // 当 /user/:id 匹配成功 + // UserHome 将被渲染到 User 的 内部 + { + path: 'post', + component: () => import('@/views/personnel/post/index'), + meta: { title: '岗位管理'} + }, + + ], + }, + // hr设置 + { + path: '/hr', + component: Layout, + children: [ + // 当 /user/:id 匹配成功 + // UserHome 将被渲染到 User 的 内部 + { + path: 'personnel', + component: () => import('@/views/hr/personnel.vue'), + meta: { title: '人员管理'} + }, + { + path: 'position', + component: () => import('@/views/hr/position.vue'), + meta: { title: '职务分类'} + }, + { + path: 'jobTitle', + component: () => import('@/views/hr/jobTitle.vue'), + }, + { + path: 'organizeType', + component: () => import('@/views/hr/organizeType.vue'), + }, + { + path: 'organization', + component: () => import('@/views/hr/organization.vue'), + }, + { + path: 'team', + component: () => import('@/views/hr/team.vue'), + meta: { title: '班组管理'} + }, + ], + }, + // 数据提报 + { + path: '/qualitative', + component: Layout, + children: [ + // 当 /user/:id 匹配成功 + // UserHome 将被渲染到 User 的 内部 + { + path: 'qualitative', + component: () => import('@/views/qualitative/index'), + meta: { title: '定性考核'} + }, + { + path: 'mete', + component: () => import('@/views/mete/index'), + meta: { title: '定量考核'} + }, + ], + }, + // 荣誉档案 + { + path: '/honer', + component: Layout, + children: [ + // 当 /user/:id 匹配成功 + // UserHome 将被渲染到 User 的 内部 + { + path: 'index', + component: () => import('@/views/honor/index'), + meta: { title: '荣誉档案'} + }, + { + path: 'type', + component: () => import('@/views/honor/type'), + meta: { title: '载体类型'} + }, + ], + }, + // 审核记录 + { + path: '/approvalData', + component: Layout, + children: [ + // 当 /user/:id 匹配成功 + // UserHome 将被渲染到 User 的 内部 + { + path: 'approvalData', + component: () => import('@/views/approvalData/index'), + meta: { title: '审核记录'} + }, + ], + }, + + // 基础信息 + { + path: '/basicInfo', + component: Layout, + children: [ + // 当 /user/:id 匹配成功 + // UserHome 将被渲染到 User 的 内部 + { + path: 'assessmentDimension', + component: () => import('@/views/basicInfo/assessmentDimension.vue'), + meta: { title: '考核维度'} + }, + { + path: 'project', + component: () => import('@/views/basicInfo/project'), + meta: { title: '考核指标'} + }, + { + path: 'gwproject', + component: () => import('@/views/basicInfo/projectBase'), + meta: { title: '岗位指标'} + }, + { + path: 'Target', + component: () => import('@/views/basicInfo/targetBase'), + meta: { title: '考核目标'} + }, + ], + }, + // { + // path: '/', + // component: Layout, + // redirect: '/dashboard', + // children: [{ + // path: 'dashboard', + // name: 'Dashboard', + // component: () => import('@/views/approval/index'), + // meta: { title: '测试'} + // }] + // }, + // { + // path: '/aaa', + // component: Layout, + // redirect: '/aaa', + // children: [{ + // path: 'aaa', + // name: 'aaa', + // component: () => import('@/views/approval/aaa'), + // meta: { title: '测试1'} + // }] + // }, + // { + // path: '/bbb', + // component: Layout, + // redirect: '/bbb', + // children: [{ + // path: 'bbb', + // name: 'bbb', + // component: () => import('@/views/approval/bbb'), + // meta: { title: 'table编辑测试'} + // }] + // }, + // { + // path: '/bbb', + // component: Layout, + // redirect: '/bbb', + // children: [{ + // path: 'bbb', + // name: 'bbb', + // component: () => import('@/views/basicInfo/assessmentDimension'), + // meta: { title: '测试b'} + // }] + // }, + // { + // path: '/dataReporting', + // component: Layout, + // redirect: '/dataReporting/departmentKpi', + // name: 'Example', + // meta: { title: '数据提报', icon: 'el-icon-s-help' }, + // children: [ + // { + // path: 'departmentKpi', + // name: 'departmentKpi', + // component: () => import('@/views/dataReporting/departmentKpi'), + // meta: { title: '部门KPI', icon: 'table' } + // }, + // { + // path: 'personalKpi', + // name: 'personalKpi', + // component: () => import('@/views/dataReporting/personalKpi'), + // meta: { title: '个人KPI', icon: 'tree' } + // }, + // { + // path: 'operationalEvaluation', + // name: 'operationalEvaluation', + // component: () => import('@/views/dataReporting/operationalEvaluation'), + // meta: { title: '运营评价', icon: 'tree' } + // } + // ] + // }, + // 考核方案 + { + path: '/assessmentProgram', + component: Layout, + children: [ + // 当 /user/:id 匹配成功 + // UserHome 将被渲染到 User 的 内部 + { + path: 'departmentalAssessment', + component: () => import('@/views/assessmentProgram/departmentBase'), + meta: { title: '部门考核'} + }, + { + path: 'gwQualitativeIndicators', + component: () => import('@/views/assessmentProgram/qualitativeIndicatorsBase'), + meta: { title: '定性考核'} + }, + { + path: 'qualitativeIndicators', + component: () => import('@/views/assessmentProgram/qualitativeIndicators'), + meta: { title: '定性考核'} + }, + + ], + }, + + { + path: '/basicInfo', + component: Layout, + redirect: '/basicInfo/assessmentDimension', + name: 'Example', + meta: { title: '基础信息', icon: 'el-icon-s-help' }, + children: [ + { + path: 'assessmentDimension', + name: 'assessmentDimension', + component: () => import('@/views/basicInfo/assessmentDimension.vue'), + meta: { title: '考核维度', icon: 'table' } + }, + // { + // path: 'quantitativeIndicators', + // name: 'quantitativeIndicators', + // component: () => import('@/views/basicInfo/quantitativeIndicators'), + // meta: { title: '定量指标', icon: 'tree' } + // }, + // { + // path: 'qualitativeIndicators', + // name: 'qualitativeIndicators', + // component: () => import('@/views/basicInfo/qualitativeIndicators'), + // meta: { title: '定性指标', icon: 'tree' } + // }, + { + path: 'project', + name: 'project', + component: () => import('@/views/basicInfo/project'), + meta: { title: '考核指标', icon: 'tree' } + }, + { + path: 'Target', + name: 'Target', + component: () => import('@/views/basicInfo/targetBase'), + meta: { title: '考核目标', icon: 'tree' } + }, + // { + // path: 'jobEntry', + // name: 'jobEntry', + // component: () => import('@/views/basicInfo/jobEntry'), + // meta: { title: '岗位录入', icon: 'tree' } + // } + ] + }, + // { + // path: '/record', + // component: Layout, + // redirect: '/record', + // children: [{ + // path: 'record', + // name: 'Record', + // component: () => import('@/views/record/index'), + // meta: { title: '考核记录'} + // }] + // }, + { + path: '/details', + component: Layout, + redirect: '/details', + children: [{ + path: 'details', + name: 'Details', + component: () => import('@/views/record/details'), + // meta: { title: '考核记录详情'} + }] + }, + + // 404 page must be placed at the end !!! + { path: '*', redirect: '/404', hidden: true } +] + +const createRouter = () => new Router({ + // mode: 'history', // require service support + scrollBehavior: () => ({ y: 0 }), + routes: constantRoutes +}) + +const router = createRouter() + +// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465 +export function resetRouter() { + const newRouter = createRouter() + router.matcher = newRouter.matcher // reset router +} + +export default router diff --git a/src/settings.js b/src/settings.js new file mode 100644 index 0000000..83299fc --- /dev/null +++ b/src/settings.js @@ -0,0 +1,16 @@ +module.exports = { + + title: '绩效考核', + + /** + * @type {boolean} true | false + * @description Whether fix the header + */ + fixedHeader: false, + + /** + * @type {boolean} true | false + * @description Whether show the logo in sidebar + */ + sidebarLogo: false +} diff --git a/src/store/getters.js b/src/store/getters.js new file mode 100644 index 0000000..5ab7b4c --- /dev/null +++ b/src/store/getters.js @@ -0,0 +1,8 @@ +const getters = { + sidebar: state => state.app.sidebar, + device: state => state.app.device, + token: state => state.user.token, + avatar: state => state.user.avatar, + name: state => state.user.name +} +export default getters diff --git a/src/store/index.js b/src/store/index.js new file mode 100644 index 0000000..6be466a --- /dev/null +++ b/src/store/index.js @@ -0,0 +1,19 @@ +import Vue from 'vue' +import Vuex from 'vuex' +import getters from './getters' +import app from './modules/app' +import settings from './modules/settings' +import user from './modules/user' + +Vue.use(Vuex) + +const store = new Vuex.Store({ + modules: { + app, + settings, + user + }, + getters +}) + +export default store diff --git a/src/store/modules/app.js b/src/store/modules/app.js new file mode 100644 index 0000000..7ea7e33 --- /dev/null +++ b/src/store/modules/app.js @@ -0,0 +1,48 @@ +import Cookies from 'js-cookie' + +const state = { + sidebar: { + opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true, + withoutAnimation: false + }, + device: 'desktop' +} + +const mutations = { + TOGGLE_SIDEBAR: state => { + state.sidebar.opened = !state.sidebar.opened + state.sidebar.withoutAnimation = false + if (state.sidebar.opened) { + Cookies.set('sidebarStatus', 1) + } else { + Cookies.set('sidebarStatus', 0) + } + }, + CLOSE_SIDEBAR: (state, withoutAnimation) => { + Cookies.set('sidebarStatus', 0) + state.sidebar.opened = false + state.sidebar.withoutAnimation = withoutAnimation + }, + TOGGLE_DEVICE: (state, device) => { + state.device = device + } +} + +const actions = { + toggleSideBar({ commit }) { + commit('TOGGLE_SIDEBAR') + }, + closeSideBar({ commit }, { withoutAnimation }) { + commit('CLOSE_SIDEBAR', withoutAnimation) + }, + toggleDevice({ commit }, device) { + commit('TOGGLE_DEVICE', device) + } +} + +export default { + namespaced: true, + state, + mutations, + actions +} diff --git a/src/store/modules/settings.js b/src/store/modules/settings.js new file mode 100644 index 0000000..b3f33f8 --- /dev/null +++ b/src/store/modules/settings.js @@ -0,0 +1,32 @@ +import defaultSettings from '@/settings' + +const { showSettings, fixedHeader, sidebarLogo } = defaultSettings + +const state = { + showSettings: showSettings, + fixedHeader: fixedHeader, + sidebarLogo: sidebarLogo +} + +const mutations = { + CHANGE_SETTING: (state, { key, value }) => { + // eslint-disable-next-line no-prototype-builtins + if (state.hasOwnProperty(key)) { + state[key] = value + } + } +} + +const actions = { + changeSetting({ commit }, data) { + commit('CHANGE_SETTING', data) + } +} + +export default { + namespaced: true, + state, + mutations, + actions +} + diff --git a/src/store/modules/user.js b/src/store/modules/user.js new file mode 100644 index 0000000..141a956 --- /dev/null +++ b/src/store/modules/user.js @@ -0,0 +1,120 @@ +import { login, logout, getInfo } from '@/api/user' +import { getToken, setToken, removeToken } from '@/utils/auth' +import { resetRouter } from '@/router' +import router from '@/router/index' + +const getDefaultState = () => { + return { + userInfo:{}, + key:'', + token: getToken(), + //token: getToken(), + name: '', + avatar: '' + } +} + +const state = getDefaultState() + +const mutations = { + loginOut(state) { + console.log('user.js loginOut') + state.userInfo = {} + state.token = '' + state.key = '' + router.push('/login') + }, + setUserInfo(state, userInfo) { + // 这里的 `state` 对象是模块的局部状态 + state.userInfo = userInfo + }, + setKey(state, key) { + // 这里的 `state` 对象是模块的局部状态 + state.key = key + }, + setToken(state, token) { + // 这里的 `state` 对象是模块的局部状态 + state.token = token + }, + RESET_STATE: (state) => { + Object.assign(state, getDefaultState()) + }, + SET_TOKEN: (state, token) => { + state.token = token + }, + SET_NAME: (state, name) => { + state.name = name + }, + SET_AVATAR: (state, avatar) => { + state.avatar = avatar + } +} + +const actions = { + // user login + login({ commit }, userInfo) { + const { username, password } = userInfo + return new Promise((resolve, reject) => { + login({ username: username.trim(), password: password }).then(response => { + const { data } = response + commit('SET_TOKEN', data.token) + setToken(data.token) + resolve() + }).catch(error => { + reject(error) + }) + }) + }, + + // get user info + getInfo({ commit, state }) { + return new Promise((resolve, reject) => { + getInfo(state.token).then(response => { + const { data } = response + + if (!data) { + return reject('Verification failed, please Login again.') + } + + const { name, avatar } = data + + commit('SET_NAME', name) + commit('SET_AVATAR', avatar) + resolve(data) + }).catch(error => { + reject(error) + }) + }) + }, + + // user logout + logout({ commit, state }) { + return new Promise((resolve, reject) => { + logout(state.token).then(() => { + removeToken() // must remove token first + resetRouter() + commit('RESET_STATE') + resolve() + }).catch(error => { + reject(error) + }) + }) + }, + + // remove token + resetToken({ commit }) { + return new Promise(resolve => { + removeToken() // must remove token first + commit('RESET_STATE') + resolve() + }) + } +} + +export default { + namespaced: true, + state, + mutations, + actions +} + diff --git a/src/styles/element-ui.scss b/src/styles/element-ui.scss new file mode 100644 index 0000000..0062411 --- /dev/null +++ b/src/styles/element-ui.scss @@ -0,0 +1,49 @@ +// cover some element-ui styles + +.el-breadcrumb__inner, +.el-breadcrumb__inner a { + font-weight: 400 !important; +} + +.el-upload { + input[type="file"] { + display: none !important; + } +} + +.el-upload__input { + display: none; +} + + +// to fixed https://github.com/ElemeFE/element/issues/2461 +.el-dialog { + transform: none; + left: 0; + position: relative; + margin: 0 auto; +} + +// refine element ui upload +.upload-container { + .el-upload { + width: 100%; + + .el-upload-dragger { + width: 100%; + height: 200px; + } + } +} + +// dropdown +.el-dropdown-menu { + a { + display: block + } +} + +// to fix el-date-picker css style +.el-range-separator { + box-sizing: content-box; +} diff --git a/src/styles/index.scss b/src/styles/index.scss new file mode 100644 index 0000000..3b4da51 --- /dev/null +++ b/src/styles/index.scss @@ -0,0 +1,65 @@ +@import './variables.scss'; +@import './mixin.scss'; +@import './transition.scss'; +@import './element-ui.scss'; +@import './sidebar.scss'; + +body { + height: 100%; + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; + font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif; +} + +label { + font-weight: 700; +} + +html { + height: 100%; + box-sizing: border-box; +} + +#app { + height: 100%; +} + +*, +*:before, +*:after { + box-sizing: inherit; +} + +a:focus, +a:active { + outline: none; +} + +a, +a:focus, +a:hover { + cursor: pointer; + color: inherit; + text-decoration: none; +} + +div:focus { + outline: none; +} + +.clearfix { + &:after { + visibility: hidden; + display: block; + font-size: 0; + content: " "; + clear: both; + height: 0; + } +} + +// main-container global css +.app-container { + padding: 20px; +} diff --git a/src/styles/mixin.scss b/src/styles/mixin.scss new file mode 100644 index 0000000..36b74bb --- /dev/null +++ b/src/styles/mixin.scss @@ -0,0 +1,28 @@ +@mixin clearfix { + &:after { + content: ""; + display: table; + clear: both; + } +} + +@mixin scrollBar { + &::-webkit-scrollbar-track-piece { + background: #d3dce6; + } + + &::-webkit-scrollbar { + width: 6px; + } + + &::-webkit-scrollbar-thumb { + background: #99a9bf; + border-radius: 20px; + } +} + +@mixin relative { + position: relative; + width: 100%; + height: 100%; +} diff --git a/src/styles/sidebar.scss b/src/styles/sidebar.scss new file mode 100644 index 0000000..94760cc --- /dev/null +++ b/src/styles/sidebar.scss @@ -0,0 +1,226 @@ +#app { + + .main-container { + min-height: 100%; + transition: margin-left .28s; + margin-left: $sideBarWidth; + position: relative; + } + + .sidebar-container { + transition: width 0.28s; + width: $sideBarWidth !important; + background-color: $menuBg; + height: 100%; + position: fixed; + font-size: 0px; + top: 0; + bottom: 0; + left: 0; + z-index: 1001; + overflow: hidden; + + // reset element-ui css + .horizontal-collapse-transition { + transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out; + } + + .scrollbar-wrapper { + overflow-x: hidden !important; + } + + .el-scrollbar__bar.is-vertical { + right: 0px; + } + + .el-scrollbar { + height: 100%; + } + + &.has-logo { + .el-scrollbar { + height: calc(100% - 50px); + } + } + + .is-horizontal { + display: none; + } + + a { + display: inline-block; + width: 100%; + overflow: hidden; + } + + .svg-icon { + margin-right: 16px; + } + + .sub-el-icon { + margin-right: 12px; + margin-left: -2px; + } + + .el-menu { + border: none; + height: 100%; + width: 100% !important; + } + + // menu hover + .submenu-title-noDropdown, + .el-submenu__title { + &:hover { + background-color: $menuHover !important; + } + } + + .is-active>.el-submenu__title { + color: $subMenuActiveText !important; + } + + & .nest-menu .el-submenu>.el-submenu__title, + & .el-submenu .el-menu-item { + min-width: $sideBarWidth !important; + background-color: $subMenuBg !important; + + &:hover { + background-color: $subMenuHover !important; + } + } + } + + .hideSidebar { + .sidebar-container { + width: 54px !important; + } + + .main-container { + margin-left: 54px; + } + + .submenu-title-noDropdown { + padding: 0 !important; + position: relative; + + .el-tooltip { + padding: 0 !important; + + .svg-icon { + margin-left: 20px; + } + + .sub-el-icon { + margin-left: 19px; + } + } + } + + .el-submenu { + overflow: hidden; + + &>.el-submenu__title { + padding: 0 !important; + + .svg-icon { + margin-left: 20px; + } + + .sub-el-icon { + margin-left: 19px; + } + + .el-submenu__icon-arrow { + display: none; + } + } + } + + .el-menu--collapse { + .el-submenu { + &>.el-submenu__title { + &>span { + height: 0; + width: 0; + overflow: hidden; + visibility: hidden; + display: inline-block; + } + } + } + } + } + + .el-menu--collapse .el-menu .el-submenu { + min-width: $sideBarWidth !important; + } + + // mobile responsive + .mobile { + .main-container { + margin-left: 0px; + } + + .sidebar-container { + transition: transform .28s; + width: $sideBarWidth !important; + } + + &.hideSidebar { + .sidebar-container { + pointer-events: none; + transition-duration: 0.3s; + transform: translate3d(-$sideBarWidth, 0, 0); + } + } + } + + .withoutAnimation { + + .main-container, + .sidebar-container { + transition: none; + } + } +} + +// when menu collapsed +.el-menu--vertical { + &>.el-menu { + .svg-icon { + margin-right: 16px; + } + .sub-el-icon { + margin-right: 12px; + margin-left: -2px; + } + } + + .nest-menu .el-submenu>.el-submenu__title, + .el-menu-item { + &:hover { + // you can use $subMenuHover + background-color: $menuHover !important; + } + } + + // the scroll bar appears when the subMenu is too long + >.el-menu--popup { + max-height: 100vh; + overflow-y: auto; + + &::-webkit-scrollbar-track-piece { + background: #d3dce6; + } + + &::-webkit-scrollbar { + width: 6px; + } + + &::-webkit-scrollbar-thumb { + background: #99a9bf; + border-radius: 20px; + } + } +} diff --git a/src/styles/transition.scss b/src/styles/transition.scss new file mode 100644 index 0000000..4cb27cc --- /dev/null +++ b/src/styles/transition.scss @@ -0,0 +1,48 @@ +// global transition css + +/* fade */ +.fade-enter-active, +.fade-leave-active { + transition: opacity 0.28s; +} + +.fade-enter, +.fade-leave-active { + opacity: 0; +} + +/* fade-transform */ +.fade-transform-leave-active, +.fade-transform-enter-active { + transition: all .5s; +} + +.fade-transform-enter { + opacity: 0; + transform: translateX(-30px); +} + +.fade-transform-leave-to { + opacity: 0; + transform: translateX(30px); +} + +/* breadcrumb transition */ +.breadcrumb-enter-active, +.breadcrumb-leave-active { + transition: all .5s; +} + +.breadcrumb-enter, +.breadcrumb-leave-active { + opacity: 0; + transform: translateX(20px); +} + +.breadcrumb-move { + transition: all .5s; +} + +.breadcrumb-leave-active { + position: absolute; +} diff --git a/src/styles/variables.scss b/src/styles/variables.scss new file mode 100644 index 0000000..be55772 --- /dev/null +++ b/src/styles/variables.scss @@ -0,0 +1,25 @@ +// sidebar +$menuText:#bfcbd9; +$menuActiveText:#409EFF; +$subMenuActiveText:#f4f4f5; //https://github.com/ElemeFE/element/issues/12951 + +$menuBg:#304156; +$menuHover:#263445; + +$subMenuBg:#1f2d3d; +$subMenuHover:#001528; + +$sideBarWidth: 210px; + +// the :export directive is the magic sauce for webpack +// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass +:export { + menuText: $menuText; + menuActiveText: $menuActiveText; + subMenuActiveText: $subMenuActiveText; + menuBg: $menuBg; + menuHover: $menuHover; + subMenuBg: $subMenuBg; + subMenuHover: $subMenuHover; + sideBarWidth: $sideBarWidth; +} diff --git a/src/utils/auth.js b/src/utils/auth.js new file mode 100644 index 0000000..dee6fe4 --- /dev/null +++ b/src/utils/auth.js @@ -0,0 +1,27 @@ +import Cookies from 'js-cookie' + +const TokenKey = 'vue_admin_template_token' +const KeyKey = 'vue_admin_template_key' + +export function getToken() { + return Cookies.get(TokenKey) +} + +export function setToken(token) { + return Cookies.set(TokenKey, token) +} + +export function removeToken() { + return Cookies.remove(TokenKey) +} +export function getKey() { + return Cookies.get(KeyKey) +} + +export function setKey(Key) { + return Cookies.set(KeyKey, Key) +} + +export function removeKey() { + return Cookies.remove(KeyKey) +} diff --git a/src/utils/bus.js b/src/utils/bus.js new file mode 100644 index 0000000..4b673fa --- /dev/null +++ b/src/utils/bus.js @@ -0,0 +1,6 @@ + +// using ES6 modules +import mitt from 'mitt' + +export const emitter = mitt() + diff --git a/src/utils/date.js b/src/utils/date.js new file mode 100644 index 0000000..6bb8570 --- /dev/null +++ b/src/utils/date.js @@ -0,0 +1,30 @@ +// 对Date的扩展,将 Date 转化为指定格式的String +// 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符, +// 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字) +// (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423 +// (new Date()).Format("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18 +// eslint-disable-next-line no-extend-native +Date.prototype.Format = function(fmt) { + var o = { + 'M+': this.getMonth() + 1, // 月份 + 'd+': this.getDate(), // 日 + 'h+': this.getHours(), // 小时 + 'm+': this.getMinutes(), // 分 + 's+': this.getSeconds(), // 秒 + 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度 + 'S': this.getMilliseconds() // 毫秒 + } + if (/(y+)/.test(fmt)) { fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length)) } + for (var k in o) { + if (new RegExp('(' + k + ')').test(fmt)) { fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length))) } + } + return fmt +} + +export function formatTimeToStr(times, pattern) { + var d = new Date(times).Format('yyyy-MM-dd hh:mm:ss') + if (pattern) { + d = new Date(times).Format(pattern) + } + return d.toLocaleString() +} diff --git a/src/utils/get-page-title.js b/src/utils/get-page-title.js new file mode 100644 index 0000000..de84a07 --- /dev/null +++ b/src/utils/get-page-title.js @@ -0,0 +1,10 @@ +import defaultSettings from '@/settings' + +const title = defaultSettings.title || '绩效考核' + +export default function getPageTitle(pageTitle) { + if (pageTitle) { + return `${pageTitle} - ${title}` + } + return `${title}` +} diff --git a/src/utils/i18n.js b/src/utils/i18n.js new file mode 100644 index 0000000..76be5a4 --- /dev/null +++ b/src/utils/i18n.js @@ -0,0 +1,12 @@ +// translate router.meta.title, be used in breadcrumb sidebar tagsview +export function generateTitle(title) { + const hasKey = this.$te('route.' + title) + + if (hasKey) { + // $t :this method from vue-i18n, inject in @/lang/index.js + const translatedTitle = this.$t('route.' + title) + + return translatedTitle + } + return title +} diff --git a/src/utils/index.js b/src/utils/index.js new file mode 100644 index 0000000..4830c04 --- /dev/null +++ b/src/utils/index.js @@ -0,0 +1,117 @@ +/** + * Created by PanJiaChen on 16/11/18. + */ + +/** + * Parse the time to string + * @param {(Object|string|number)} time + * @param {string} cFormat + * @returns {string | null} + */ +export function parseTime(time, cFormat) { + if (arguments.length === 0 || !time) { + return null + } + const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}' + let date + if (typeof time === 'object') { + date = time + } else { + if ((typeof time === 'string')) { + if ((/^[0-9]+$/.test(time))) { + // support "1548221490638" + time = parseInt(time) + } else { + // support safari + // https://stackoverflow.com/questions/4310953/invalid-date-in-safari + time = time.replace(new RegExp(/-/gm), '/') + } + } + + if ((typeof time === 'number') && (time.toString().length === 10)) { + time = time * 1000 + } + date = new Date(time) + } + const formatObj = { + y: date.getFullYear(), + m: date.getMonth() + 1, + d: date.getDate(), + h: date.getHours(), + i: date.getMinutes(), + s: date.getSeconds(), + a: date.getDay() + } + const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => { + const value = formatObj[key] + // Note: getDay() returns 0 on Sunday + if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value ] } + return value.toString().padStart(2, '0') + }) + return time_str +} + +/** + * @param {number} time + * @param {string} option + * @returns {string} + */ +export function formatTime(time, option) { + if (('' + time).length === 10) { + time = parseInt(time) * 1000 + } else { + time = +time + } + const d = new Date(time) + const now = Date.now() + + const diff = (now - d) / 1000 + + if (diff < 30) { + return '刚刚' + } else if (diff < 3600) { + // less 1 hour + return Math.ceil(diff / 60) + '分钟前' + } else if (diff < 3600 * 24) { + return Math.ceil(diff / 3600) + '小时前' + } else if (diff < 3600 * 24 * 2) { + return '1天前' + } + if (option) { + return parseTime(time, option) + } else { + return ( + d.getMonth() + + 1 + + '月' + + d.getDate() + + '日' + + d.getHours() + + '时' + + d.getMinutes() + + '分' + ) + } +} + +/** + * @param {string} url + * @returns {Object} + */ +export function param2Obj(url) { + const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ') + if (!search) { + return {} + } + const obj = {} + const searchArr = search.split('&') + searchArr.forEach(v => { + const index = v.indexOf('=') + if (index !== -1) { + const name = v.substring(0, index) + const val = v.substring(index + 1, v.length) + obj[name] = val + } + }) + return obj +} diff --git a/src/utils/request.js b/src/utils/request.js new file mode 100644 index 0000000..a3369d0 --- /dev/null +++ b/src/utils/request.js @@ -0,0 +1,108 @@ +import axios from 'axios' +import { MessageBox, Message } from 'element-ui' +import store from '@/store' +import { Loading } from 'element-ui'; +import { getToken,getKey } from '@/utils/auth' +import Vue from 'vue' +function showloading() { + //因为是全局导入ui,所以直接使用Vue.prototype,如果是局部导入可以命名为对应名称 + Vue.prototype.$loading({ + lock: true, + text: 'Loading', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }); +} +function endLoading() { //使用Element loading-close 方法 + Vue.prototype.$loading().close() +} +// create an axios instance +const service = axios.create({ + baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url + // withCredentials: true, // send cookies when cross-domain requests + timeout: 180000 // request timeout +}) + +// request interceptor +service.interceptors.request.use( + config => { + // do something before request is sent + + if (store.getters.token) { + // let each request carry token + // ['X-Token'] is a custom headers key + // please modify it according to the actual situation + config.headers['user-token'] = getToken() + config.headers['user-key'] = getKey() + } + return config + }, + error => { + // do something with request error + console.log(error) // for debug + return Promise.reject(error) + } +) + +// response interceptor +service.interceptors.response.use( + /** + * If you want to get http information such as headers or status + * Please return response => response + */ + + /** + * Determine the request status by custom code + * Here is just an example + * You can also judge the status by HTTP Status Code + */ + response => { + const res = response.data + console.log("res.code") + console.log(res.code) + // if the custom code is not 20000, it is judged as an error. + if (res.code !== 0) { + endLoading() + if(res.code === 7){ + console.log('res.code === 7') + store.commit('user/loginOut') + } + Message({ + message: res.msg || 'Error', + type: 'error', + duration: 5 * 1000 + }) + + // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired; + if (res.code === 50008 || res.code === 50012 || res.code === 50014) { + // to re-login + MessageBox.confirm('You have been logged out, you can cancel to stay on this page, or log in again', 'Confirm logout', { + confirmButtonText: 'Re-Login', + cancelButtonText: 'Cancel', + type: 'warning' + }).then(() => { + store.dispatch('user/resetToken').then(() => { + location.reload() + }) + }) + } + return res + // return Promise.reject(Error).catch(Error=>{console.log(Error)}) + // return Promise.reject(new Error(res.msg || 'Error')) + } else { + console.log("成功") + return res + } + }, + error => { + console.log('err' + error) // for debug + Message({ + message: error.msg, + type: 'error', + duration: 5 * 1000 + }) + return Promise.reject(error) + } +) + +export default service diff --git a/src/utils/request1.js b/src/utils/request1.js new file mode 100644 index 0000000..c498707 --- /dev/null +++ b/src/utils/request1.js @@ -0,0 +1,89 @@ +import axios from 'axios' +import { MessageBox, Message } from 'element-ui' +import store from '@/store' +import { getToken,getKey } from '@/utils/auth' + +// create an axios instance +const service = axios.create({ + baseURL: process.env.VUE_APP_BASE_API1, // url = base url + request url + // withCredentials: true, // send cookies when cross-domain requests + timeout: 180000 // request timeout +}) + +// request interceptor +service.interceptors.request.use( + config => { + // do something before request is sent + + if (store.getters.token) { + // let each request carry token + // ['X-Token'] is a custom headers key + // please modify it according to the actual situation + config.headers['user-token'] = getToken() + config.headers['user-key'] = getKey() + } + return config + }, + error => { + // do something with request error + console.log(error) // for debug + return Promise.reject(error) + } +) + +// response interceptor +service.interceptors.response.use( + /** + * If you want to get http information such as headers or status + * Please return response => response + */ + + /** + * Determine the request status by custom code + * Here is just an example + * You can also judge the status by HTTP Status Code + */ + response => { + const res = response.data + + // if the custom code is not 20000, it is judged as an error. + if (res.code !== 0) { + if(res.code === 7){ + store.commit('user/loginOut') + } + Message({ + message: res.msg || 'Error', + type: 'error', + duration: 5 * 1000 + }) + + // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired; + if (res.code === 50008 || res.code === 50012 || res.code === 50014) { + // to re-login + MessageBox.confirm('You have been logged out, you can cancel to stay on this page, or log in again', 'Confirm logout', { + confirmButtonText: 'Re-Login', + cancelButtonText: 'Cancel', + type: 'warning' + }).then(() => { + store.dispatch('user/resetToken').then(() => { + location.reload() + }) + }) + } + return Promise.reject(new Error(res.msg || 'Error')) + } else { + return res + } + }, + error => { + console.log('err' + error) // for debug + Message({ + message: error.msg, + type: 'error', + duration: 5 * 1000 + }) + return Promise.reject(error) + } +) + +export default service diff --git a/src/utils/requestFile.js b/src/utils/requestFile.js new file mode 100644 index 0000000..6cce14c --- /dev/null +++ b/src/utils/requestFile.js @@ -0,0 +1,89 @@ +import axios from 'axios' +import { MessageBox, Message } from 'element-ui' +import store from '@/store' +import { getToken,getKey } from '@/utils/auth' + +// create an axios instance +const service = axios.create({ + baseURL: process.env.VUE_APP_BASE_API2, // url = base url + request url + // withCredentials: true, // send cookies when cross-domain requests + timeout: 180000 // request timeout +}) + +// request interceptor +service.interceptors.request.use( + config => { + // do something before request is sent + + if (store.getters.token) { + // let each request carry token + // ['X-Token'] is a custom headers key + // please modify it according to the actual situation + config.headers['user-token'] = getToken() + config.headers['user-key'] = getKey() + } + return config + }, + error => { + // do something with request error + console.log(error) // for debug + return Promise.reject(error) + } +) + +// response interceptor +service.interceptors.response.use( + /** + * If you want to get http information such as headers or status + * Please return response => response + */ + + /** + * Determine the request status by custom code + * Here is just an example + * You can also judge the status by HTTP Status Code + */ + response => { + const res = response.data + + // if the custom code is not 20000, it is judged as an error. + if (res.code !== 0) { + if(res.code === 7){ + store.commit('user/loginOut') + } + Message({ + message: res.msg || 'Error', + type: 'error', + duration: 5 * 1000 + }) + + // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired; + if (res.code === 50008 || res.code === 50012 || res.code === 50014) { + // to re-login + MessageBox.confirm('You have been logged out, you can cancel to stay on this page, or log in again', 'Confirm logout', { + confirmButtonText: 'Re-Login', + cancelButtonText: 'Cancel', + type: 'warning' + }).then(() => { + store.dispatch('user/resetToken').then(() => { + location.reload() + }) + }) + } + return Promise.reject(new Error(res.msg || 'Error')) + } else { + return res + } + }, + error => { + console.log('err' + error) // for debug + Message({ + message: error.msg, + type: 'error', + duration: 5 * 1000 + }) + return Promise.reject(error) + } +) + +export default service diff --git a/src/utils/validate.js b/src/utils/validate.js new file mode 100644 index 0000000..8d962ad --- /dev/null +++ b/src/utils/validate.js @@ -0,0 +1,20 @@ +/** + * Created by PanJiaChen on 16/11/18. + */ + +/** + * @param {string} path + * @returns {Boolean} + */ +export function isExternal(path) { + return /^(https?:|mailto:|tel:)/.test(path) +} + +/** + * @param {string} str + * @returns {Boolean} + */ +export function validUsername(str) { + const valid_map = ['admin', 'editor'] + return valid_map.indexOf(str.trim()) >= 0 +} diff --git a/src/views/404.vue b/src/views/404.vue new file mode 100644 index 0000000..1791f55 --- /dev/null +++ b/src/views/404.vue @@ -0,0 +1,228 @@ + + + + + diff --git a/src/views/approval/aaa.vue b/src/views/approval/aaa.vue new file mode 100644 index 0000000..5ca5bbe --- /dev/null +++ b/src/views/approval/aaa.vue @@ -0,0 +1,129 @@ + + + + + \ No newline at end of file diff --git a/src/views/approval/bbb.vue b/src/views/approval/bbb.vue new file mode 100644 index 0000000..52498e0 --- /dev/null +++ b/src/views/approval/bbb.vue @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file diff --git a/src/views/approval/index.vue b/src/views/approval/index.vue new file mode 100644 index 0000000..a3fc0b4 --- /dev/null +++ b/src/views/approval/index.vue @@ -0,0 +1,220 @@ + + + + + \ No newline at end of file diff --git a/src/views/approvalData/index.vue b/src/views/approvalData/index.vue new file mode 100644 index 0000000..a95fc65 --- /dev/null +++ b/src/views/approvalData/index.vue @@ -0,0 +1,743 @@ + + + + + diff --git a/src/views/assessmentProgram/assessmentDimension.vue b/src/views/assessmentProgram/assessmentDimension.vue new file mode 100644 index 0000000..2f1bb73 --- /dev/null +++ b/src/views/assessmentProgram/assessmentDimension.vue @@ -0,0 +1,326 @@ + + + + + diff --git a/src/views/assessmentProgram/departmentBase.vue b/src/views/assessmentProgram/departmentBase.vue new file mode 100644 index 0000000..40abd21 --- /dev/null +++ b/src/views/assessmentProgram/departmentBase.vue @@ -0,0 +1,465 @@ + + + + + + \ No newline at end of file diff --git a/src/views/assessmentProgram/departmentalAssessment copy.vue b/src/views/assessmentProgram/departmentalAssessment copy.vue new file mode 100644 index 0000000..838bcc9 --- /dev/null +++ b/src/views/assessmentProgram/departmentalAssessment copy.vue @@ -0,0 +1,1204 @@ + + + + + diff --git a/src/views/assessmentProgram/departmentalAssessment.vue b/src/views/assessmentProgram/departmentalAssessment.vue new file mode 100644 index 0000000..215d3b1 --- /dev/null +++ b/src/views/assessmentProgram/departmentalAssessment.vue @@ -0,0 +1,1829 @@ + + + + + diff --git a/src/views/assessmentProgram/gwDepartmentalAssessment.vue b/src/views/assessmentProgram/gwDepartmentalAssessment.vue new file mode 100644 index 0000000..32944ab --- /dev/null +++ b/src/views/assessmentProgram/gwDepartmentalAssessment.vue @@ -0,0 +1,2105 @@ + + + + + + \ No newline at end of file diff --git a/src/views/assessmentProgram/gwQualitativeIndicators.vue b/src/views/assessmentProgram/gwQualitativeIndicators.vue new file mode 100644 index 0000000..e471c81 --- /dev/null +++ b/src/views/assessmentProgram/gwQualitativeIndicators.vue @@ -0,0 +1,2523 @@ + + + + + diff --git a/src/views/assessmentProgram/jobEntry.vue b/src/views/assessmentProgram/jobEntry.vue new file mode 100644 index 0000000..61b2b20 --- /dev/null +++ b/src/views/assessmentProgram/jobEntry.vue @@ -0,0 +1,326 @@ + + + + + diff --git a/src/views/assessmentProgram/project.vue b/src/views/assessmentProgram/project.vue new file mode 100644 index 0000000..49e0ab0 --- /dev/null +++ b/src/views/assessmentProgram/project.vue @@ -0,0 +1,481 @@ + + + + + diff --git a/src/views/assessmentProgram/qualitativeIndicators copy 2.vue b/src/views/assessmentProgram/qualitativeIndicators copy 2.vue new file mode 100644 index 0000000..db4a71e --- /dev/null +++ b/src/views/assessmentProgram/qualitativeIndicators copy 2.vue @@ -0,0 +1,725 @@ + + + + + diff --git a/src/views/assessmentProgram/qualitativeIndicators copy.vue b/src/views/assessmentProgram/qualitativeIndicators copy.vue new file mode 100644 index 0000000..971b1cd --- /dev/null +++ b/src/views/assessmentProgram/qualitativeIndicators copy.vue @@ -0,0 +1,679 @@ + + + + + diff --git a/src/views/assessmentProgram/qualitativeIndicators.vue b/src/views/assessmentProgram/qualitativeIndicators.vue new file mode 100644 index 0000000..7e1ceaf --- /dev/null +++ b/src/views/assessmentProgram/qualitativeIndicators.vue @@ -0,0 +1,2216 @@ + + + + + diff --git a/src/views/assessmentProgram/qualitativeIndicatorsBase.vue b/src/views/assessmentProgram/qualitativeIndicatorsBase.vue new file mode 100644 index 0000000..fed4e7e --- /dev/null +++ b/src/views/assessmentProgram/qualitativeIndicatorsBase.vue @@ -0,0 +1,464 @@ + + + + + diff --git a/src/views/assessmentProgram/quantitativeIndicators.vue b/src/views/assessmentProgram/quantitativeIndicators.vue new file mode 100644 index 0000000..71219cd --- /dev/null +++ b/src/views/assessmentProgram/quantitativeIndicators.vue @@ -0,0 +1,901 @@ + + + + + diff --git a/src/views/assessmentProgram/rules.vue b/src/views/assessmentProgram/rules.vue new file mode 100644 index 0000000..aa11e28 --- /dev/null +++ b/src/views/assessmentProgram/rules.vue @@ -0,0 +1,409 @@ + + + + + diff --git a/src/views/assessmentProgram/subSection.vue b/src/views/assessmentProgram/subSection.vue new file mode 100644 index 0000000..598bc22 --- /dev/null +++ b/src/views/assessmentProgram/subSection.vue @@ -0,0 +1,373 @@ + + + + + diff --git a/src/views/basicInfo copy/assessmentDimension.vue b/src/views/basicInfo copy/assessmentDimension.vue new file mode 100644 index 0000000..71aa535 --- /dev/null +++ b/src/views/basicInfo copy/assessmentDimension.vue @@ -0,0 +1,326 @@ + + + + + diff --git a/src/views/basicInfo copy/jobEntry.vue b/src/views/basicInfo copy/jobEntry.vue new file mode 100644 index 0000000..61b2b20 --- /dev/null +++ b/src/views/basicInfo copy/jobEntry.vue @@ -0,0 +1,326 @@ + + + + + diff --git a/src/views/basicInfo copy/project.vue b/src/views/basicInfo copy/project.vue new file mode 100644 index 0000000..8dfd883 --- /dev/null +++ b/src/views/basicInfo copy/project.vue @@ -0,0 +1,472 @@ + + + + + diff --git a/src/views/basicInfo copy/qualitativeIndicators.vue b/src/views/basicInfo copy/qualitativeIndicators.vue new file mode 100644 index 0000000..e5a347f --- /dev/null +++ b/src/views/basicInfo copy/qualitativeIndicators.vue @@ -0,0 +1,431 @@ + + + + + diff --git a/src/views/basicInfo copy/quantitativeIndicators.vue b/src/views/basicInfo copy/quantitativeIndicators.vue new file mode 100644 index 0000000..cfd288b --- /dev/null +++ b/src/views/basicInfo copy/quantitativeIndicators.vue @@ -0,0 +1,432 @@ + + + + + + diff --git a/src/views/basicInfo/assessmentDimension.vue b/src/views/basicInfo/assessmentDimension.vue new file mode 100644 index 0000000..1dd8bbb --- /dev/null +++ b/src/views/basicInfo/assessmentDimension.vue @@ -0,0 +1,334 @@ + + + + + diff --git a/src/views/basicInfo/assessmentIndicators.vue b/src/views/basicInfo/assessmentIndicators.vue new file mode 100644 index 0000000..2a19a7e --- /dev/null +++ b/src/views/basicInfo/assessmentIndicators.vue @@ -0,0 +1,334 @@ + + + + + diff --git a/src/views/basicInfo/gwProject copy.vue b/src/views/basicInfo/gwProject copy.vue new file mode 100644 index 0000000..f13661f --- /dev/null +++ b/src/views/basicInfo/gwProject copy.vue @@ -0,0 +1,899 @@ + + + + + diff --git a/src/views/basicInfo/gwProject.vue b/src/views/basicInfo/gwProject.vue new file mode 100644 index 0000000..d76975f --- /dev/null +++ b/src/views/basicInfo/gwProject.vue @@ -0,0 +1,1009 @@ + + + + + diff --git a/src/views/basicInfo/gwTarget.vue b/src/views/basicInfo/gwTarget.vue new file mode 100644 index 0000000..726d91b --- /dev/null +++ b/src/views/basicInfo/gwTarget.vue @@ -0,0 +1,1247 @@ + + + + + diff --git a/src/views/basicInfo/jobEntry.vue b/src/views/basicInfo/jobEntry.vue new file mode 100644 index 0000000..61b2b20 --- /dev/null +++ b/src/views/basicInfo/jobEntry.vue @@ -0,0 +1,326 @@ + + + + + diff --git a/src/views/basicInfo/project.vue b/src/views/basicInfo/project.vue new file mode 100644 index 0000000..285666c --- /dev/null +++ b/src/views/basicInfo/project.vue @@ -0,0 +1,887 @@ + + + + + diff --git a/src/views/basicInfo/projectBase.vue b/src/views/basicInfo/projectBase.vue new file mode 100644 index 0000000..8e47ae4 --- /dev/null +++ b/src/views/basicInfo/projectBase.vue @@ -0,0 +1,464 @@ + + + + + diff --git a/src/views/basicInfo/qualitativeIndicators.vue b/src/views/basicInfo/qualitativeIndicators.vue new file mode 100644 index 0000000..7ebecc6 --- /dev/null +++ b/src/views/basicInfo/qualitativeIndicators.vue @@ -0,0 +1,437 @@ + + + + + diff --git a/src/views/basicInfo/quantitativeIndicators.vue b/src/views/basicInfo/quantitativeIndicators.vue new file mode 100644 index 0000000..cfd288b --- /dev/null +++ b/src/views/basicInfo/quantitativeIndicators.vue @@ -0,0 +1,432 @@ + + + + + + diff --git a/src/views/basicInfo/target.vue b/src/views/basicInfo/target.vue new file mode 100644 index 0000000..d21fa43 --- /dev/null +++ b/src/views/basicInfo/target.vue @@ -0,0 +1,1246 @@ + + + + + diff --git a/src/views/basicInfo/targetBase.vue b/src/views/basicInfo/targetBase.vue new file mode 100644 index 0000000..75a3190 --- /dev/null +++ b/src/views/basicInfo/targetBase.vue @@ -0,0 +1,465 @@ + + + + + diff --git a/src/views/basicInfo/workspace.code-workspace b/src/views/basicInfo/workspace.code-workspace new file mode 100644 index 0000000..c04eaf5 --- /dev/null +++ b/src/views/basicInfo/workspace.code-workspace @@ -0,0 +1,7 @@ +{ + "folders": [ + { + "path": "..\\..\\.." + } + ] +} \ No newline at end of file diff --git a/src/views/ce/index.vue b/src/views/ce/index.vue new file mode 100644 index 0000000..7581618 --- /dev/null +++ b/src/views/ce/index.vue @@ -0,0 +1,49 @@ + + + + + \ No newline at end of file diff --git a/src/views/course/courseware.vue b/src/views/course/courseware.vue new file mode 100644 index 0000000..6e950e0 --- /dev/null +++ b/src/views/course/courseware.vue @@ -0,0 +1,363 @@ + + + + + diff --git a/src/views/dashboard/index copy 2.vue b/src/views/dashboard/index copy 2.vue new file mode 100644 index 0000000..3836b07 --- /dev/null +++ b/src/views/dashboard/index copy 2.vue @@ -0,0 +1,502 @@ + + + + + diff --git a/src/views/dashboard/index copy.vue b/src/views/dashboard/index copy.vue new file mode 100644 index 0000000..0d0f2a4 --- /dev/null +++ b/src/views/dashboard/index copy.vue @@ -0,0 +1,87 @@ + + + + + diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue new file mode 100644 index 0000000..3767107 --- /dev/null +++ b/src/views/dashboard/index.vue @@ -0,0 +1,517 @@ + + + + + diff --git a/src/views/dataReporting/departmentKpi.vue b/src/views/dataReporting/departmentKpi.vue new file mode 100644 index 0000000..e69de29 diff --git a/src/views/dataReporting/operationalEvaluation.vue b/src/views/dataReporting/operationalEvaluation.vue new file mode 100644 index 0000000..e69de29 diff --git a/src/views/dataReporting/personalKpi.vue b/src/views/dataReporting/personalKpi.vue new file mode 100644 index 0000000..e69de29 diff --git a/src/views/echarts/echarts.vue b/src/views/echarts/echarts.vue new file mode 100644 index 0000000..517948e --- /dev/null +++ b/src/views/echarts/echarts.vue @@ -0,0 +1,679 @@ + + + + + + \ No newline at end of file diff --git a/src/views/echarts/echarts1.vue b/src/views/echarts/echarts1.vue new file mode 100644 index 0000000..416ce51 --- /dev/null +++ b/src/views/echarts/echarts1.vue @@ -0,0 +1,824 @@ + + + + + + \ No newline at end of file diff --git a/src/views/echarts/table.vue b/src/views/echarts/table.vue new file mode 100644 index 0000000..543f584 --- /dev/null +++ b/src/views/echarts/table.vue @@ -0,0 +1,1479 @@ + + + + + + \ No newline at end of file diff --git a/src/views/echarts/total.vue b/src/views/echarts/total.vue new file mode 100644 index 0000000..1652ae1 --- /dev/null +++ b/src/views/echarts/total.vue @@ -0,0 +1,883 @@ + + + + + + \ No newline at end of file diff --git a/src/views/form/index.vue b/src/views/form/index.vue new file mode 100644 index 0000000..f4d66d3 --- /dev/null +++ b/src/views/form/index.vue @@ -0,0 +1,85 @@ + + + + + + diff --git a/src/views/frontPage/index.vue b/src/views/frontPage/index.vue new file mode 100644 index 0000000..abd8e9f --- /dev/null +++ b/src/views/frontPage/index.vue @@ -0,0 +1,1976 @@ + + + + diff --git a/src/views/honor/index.vue b/src/views/honor/index.vue new file mode 100644 index 0000000..47bacf6 --- /dev/null +++ b/src/views/honor/index.vue @@ -0,0 +1,680 @@ + + + + + diff --git a/src/views/honor/type.vue b/src/views/honor/type.vue new file mode 100644 index 0000000..548c31f --- /dev/null +++ b/src/views/honor/type.vue @@ -0,0 +1,333 @@ + + + + + diff --git a/src/views/hr/jobTitle.vue b/src/views/hr/jobTitle.vue new file mode 100644 index 0000000..2a957da --- /dev/null +++ b/src/views/hr/jobTitle.vue @@ -0,0 +1,386 @@ + + + + + diff --git a/src/views/hr/organization.vue b/src/views/hr/organization.vue new file mode 100644 index 0000000..5642c8e --- /dev/null +++ b/src/views/hr/organization.vue @@ -0,0 +1,484 @@ + + + + + diff --git a/src/views/hr/organizeType.vue b/src/views/hr/organizeType.vue new file mode 100644 index 0000000..e8f3815 --- /dev/null +++ b/src/views/hr/organizeType.vue @@ -0,0 +1,360 @@ + + + + + diff --git a/src/views/hr/personnel.vue b/src/views/hr/personnel.vue new file mode 100644 index 0000000..9672e36 --- /dev/null +++ b/src/views/hr/personnel.vue @@ -0,0 +1,2542 @@ + + + + + diff --git a/src/views/hr/position.vue b/src/views/hr/position.vue new file mode 100644 index 0000000..cc1e687 --- /dev/null +++ b/src/views/hr/position.vue @@ -0,0 +1,330 @@ + + + + + diff --git a/src/views/hr/team.vue b/src/views/hr/team.vue new file mode 100644 index 0000000..c68c0c8 --- /dev/null +++ b/src/views/hr/team.vue @@ -0,0 +1,323 @@ + + + + + diff --git a/src/views/index.vue b/src/views/index.vue new file mode 100644 index 0000000..1f7b032 --- /dev/null +++ b/src/views/index.vue @@ -0,0 +1,145 @@ + + + + + diff --git a/src/views/login/index copy.vue b/src/views/login/index copy.vue new file mode 100644 index 0000000..1db2464 --- /dev/null +++ b/src/views/login/index copy.vue @@ -0,0 +1,237 @@ + + + + + + + diff --git a/src/views/login/index.vue b/src/views/login/index.vue new file mode 100644 index 0000000..abac955 --- /dev/null +++ b/src/views/login/index.vue @@ -0,0 +1,318 @@ + + + + + + + diff --git a/src/views/login/wxLogin.vue b/src/views/login/wxLogin.vue new file mode 100644 index 0000000..0211821 --- /dev/null +++ b/src/views/login/wxLogin.vue @@ -0,0 +1,382 @@ + + + + + + + diff --git a/src/views/lunbo/index.vue b/src/views/lunbo/index.vue new file mode 100644 index 0000000..a9cad59 --- /dev/null +++ b/src/views/lunbo/index.vue @@ -0,0 +1,61 @@ + + + + \ No newline at end of file diff --git a/src/views/menuSettings/index.vue b/src/views/menuSettings/index.vue new file mode 100644 index 0000000..2cd67ca --- /dev/null +++ b/src/views/menuSettings/index.vue @@ -0,0 +1,417 @@ + + + + + diff --git a/src/views/mete/index.vue b/src/views/mete/index.vue new file mode 100644 index 0000000..6929cff --- /dev/null +++ b/src/views/mete/index.vue @@ -0,0 +1,581 @@ + + + + + diff --git a/src/views/nested/menu1/index.vue b/src/views/nested/menu1/index.vue new file mode 100644 index 0000000..30cb670 --- /dev/null +++ b/src/views/nested/menu1/index.vue @@ -0,0 +1,7 @@ + diff --git a/src/views/nested/menu1/menu1-1/index.vue b/src/views/nested/menu1/menu1-1/index.vue new file mode 100644 index 0000000..27e173a --- /dev/null +++ b/src/views/nested/menu1/menu1-1/index.vue @@ -0,0 +1,7 @@ + diff --git a/src/views/nested/menu1/menu1-2/index.vue b/src/views/nested/menu1/menu1-2/index.vue new file mode 100644 index 0000000..0c86276 --- /dev/null +++ b/src/views/nested/menu1/menu1-2/index.vue @@ -0,0 +1,7 @@ + diff --git a/src/views/nested/menu1/menu1-2/menu1-2-1/index.vue b/src/views/nested/menu1/menu1-2/menu1-2-1/index.vue new file mode 100644 index 0000000..f87d88f --- /dev/null +++ b/src/views/nested/menu1/menu1-2/menu1-2-1/index.vue @@ -0,0 +1,5 @@ + diff --git a/src/views/nested/menu1/menu1-2/menu1-2-2/index.vue b/src/views/nested/menu1/menu1-2/menu1-2-2/index.vue new file mode 100644 index 0000000..d88789f --- /dev/null +++ b/src/views/nested/menu1/menu1-2/menu1-2-2/index.vue @@ -0,0 +1,5 @@ + diff --git a/src/views/nested/menu1/menu1-3/index.vue b/src/views/nested/menu1/menu1-3/index.vue new file mode 100644 index 0000000..f7cd073 --- /dev/null +++ b/src/views/nested/menu1/menu1-3/index.vue @@ -0,0 +1,5 @@ + diff --git a/src/views/nested/menu2/index.vue b/src/views/nested/menu2/index.vue new file mode 100644 index 0000000..19dd48f --- /dev/null +++ b/src/views/nested/menu2/index.vue @@ -0,0 +1,5 @@ + diff --git a/src/views/permission/permissionSetting.vue b/src/views/permission/permissionSetting.vue new file mode 100644 index 0000000..a5004d9 --- /dev/null +++ b/src/views/permission/permissionSetting.vue @@ -0,0 +1,332 @@ + + + + + diff --git a/src/views/permission/xiTong.vue b/src/views/permission/xiTong.vue new file mode 100644 index 0000000..11c8fa7 --- /dev/null +++ b/src/views/permission/xiTong.vue @@ -0,0 +1,335 @@ + + + + + + \ No newline at end of file diff --git a/src/views/personnel/post/index.vue b/src/views/personnel/post/index.vue new file mode 100644 index 0000000..6f22607 --- /dev/null +++ b/src/views/personnel/post/index.vue @@ -0,0 +1,688 @@ + + + + + diff --git a/src/views/qualitative/index copy.vue b/src/views/qualitative/index copy.vue new file mode 100644 index 0000000..accf023 --- /dev/null +++ b/src/views/qualitative/index copy.vue @@ -0,0 +1,518 @@ + + + + + diff --git a/src/views/qualitative/index.vue b/src/views/qualitative/index.vue new file mode 100644 index 0000000..425833c --- /dev/null +++ b/src/views/qualitative/index.vue @@ -0,0 +1,1306 @@ + + + + + diff --git a/src/views/record/details.vue b/src/views/record/details.vue new file mode 100644 index 0000000..0fd1550 --- /dev/null +++ b/src/views/record/details.vue @@ -0,0 +1,218 @@ + + + + + diff --git a/src/views/record/index.vue b/src/views/record/index.vue new file mode 100644 index 0000000..c15ca71 --- /dev/null +++ b/src/views/record/index.vue @@ -0,0 +1,172 @@ + + + + + diff --git a/src/views/roleSetting/index.vue b/src/views/roleSetting/index.vue new file mode 100644 index 0000000..3ff4348 --- /dev/null +++ b/src/views/roleSetting/index.vue @@ -0,0 +1,416 @@ + + + + + diff --git a/src/views/table/index.vue b/src/views/table/index.vue new file mode 100644 index 0000000..a1ed847 --- /dev/null +++ b/src/views/table/index.vue @@ -0,0 +1,79 @@ + + + diff --git a/src/views/tree/index.vue b/src/views/tree/index.vue new file mode 100644 index 0000000..89c6b01 --- /dev/null +++ b/src/views/tree/index.vue @@ -0,0 +1,78 @@ + + + + diff --git a/src/workspace.code-workspace b/src/workspace.code-workspace new file mode 100644 index 0000000..638df53 --- /dev/null +++ b/src/workspace.code-workspace @@ -0,0 +1,10 @@ +{ + "folders": [ + { + "path": ".." + } + ], + "settings": { + "thiefBook.filePath": "H:\\BaiduNetdiskDownload\\二号首长1--2部.txt" + } +} \ No newline at end of file diff --git a/tests/unit/.eslintrc.js b/tests/unit/.eslintrc.js new file mode 100644 index 0000000..958d51b --- /dev/null +++ b/tests/unit/.eslintrc.js @@ -0,0 +1,5 @@ +module.exports = { + env: { + jest: true + } +} diff --git a/tests/unit/components/Breadcrumb.spec.js b/tests/unit/components/Breadcrumb.spec.js new file mode 100644 index 0000000..1d94c8f --- /dev/null +++ b/tests/unit/components/Breadcrumb.spec.js @@ -0,0 +1,98 @@ +import { mount, createLocalVue } from '@vue/test-utils' +import VueRouter from 'vue-router' +import ElementUI from 'element-ui' +import Breadcrumb from '@/components/Breadcrumb/index.vue' + +const localVue = createLocalVue() +localVue.use(VueRouter) +localVue.use(ElementUI) + +const routes = [ + { + path: '/', + name: 'home', + children: [{ + path: 'dashboard', + name: 'dashboard' + }] + }, + { + path: '/menu', + name: 'menu', + children: [{ + path: 'menu1', + name: 'menu1', + meta: { title: 'menu1' }, + children: [{ + path: 'menu1-1', + name: 'menu1-1', + meta: { title: 'menu1-1' } + }, + { + path: 'menu1-2', + name: 'menu1-2', + redirect: 'noredirect', + meta: { title: 'menu1-2' }, + children: [{ + path: 'menu1-2-1', + name: 'menu1-2-1', + meta: { title: 'menu1-2-1' } + }, + { + path: 'menu1-2-2', + name: 'menu1-2-2' + }] + }] + }] + }] + +const router = new VueRouter({ + routes +}) + +describe('Breadcrumb.vue', () => { + const wrapper = mount(Breadcrumb, { + localVue, + router + }) + it('dashboard', () => { + router.push('/dashboard') + const len = wrapper.findAll('.el-breadcrumb__inner').length + expect(len).toBe(1) + }) + it('normal route', () => { + router.push('/menu/menu1') + const len = wrapper.findAll('.el-breadcrumb__inner').length + expect(len).toBe(2) + }) + it('nested route', () => { + router.push('/menu/menu1/menu1-2/menu1-2-1') + const len = wrapper.findAll('.el-breadcrumb__inner').length + expect(len).toBe(4) + }) + it('no meta.title', () => { + router.push('/menu/menu1/menu1-2/menu1-2-2') + const len = wrapper.findAll('.el-breadcrumb__inner').length + expect(len).toBe(3) + }) + // it('click link', () => { + // router.push('/menu/menu1/menu1-2/menu1-2-2') + // const breadcrumbArray = wrapper.findAll('.el-breadcrumb__inner') + // const second = breadcrumbArray.at(1) + // console.log(breadcrumbArray) + // const href = second.find('a').attributes().href + // expect(href).toBe('#/menu/menu1') + // }) + // it('noRedirect', () => { + // router.push('/menu/menu1/menu1-2/menu1-2-1') + // const breadcrumbArray = wrapper.findAll('.el-breadcrumb__inner') + // const redirectBreadcrumb = breadcrumbArray.at(2) + // expect(redirectBreadcrumb.contains('a')).toBe(false) + // }) + it('last breadcrumb', () => { + router.push('/menu/menu1/menu1-2/menu1-2-1') + const breadcrumbArray = wrapper.findAll('.el-breadcrumb__inner') + const redirectBreadcrumb = breadcrumbArray.at(3) + expect(redirectBreadcrumb.contains('a')).toBe(false) + }) +}) diff --git a/tests/unit/components/Hamburger.spec.js b/tests/unit/components/Hamburger.spec.js new file mode 100644 index 0000000..01ea303 --- /dev/null +++ b/tests/unit/components/Hamburger.spec.js @@ -0,0 +1,18 @@ +import { shallowMount } from '@vue/test-utils' +import Hamburger from '@/components/Hamburger/index.vue' +describe('Hamburger.vue', () => { + it('toggle click', () => { + const wrapper = shallowMount(Hamburger) + const mockFn = jest.fn() + wrapper.vm.$on('toggleClick', mockFn) + wrapper.find('.hamburger').trigger('click') + expect(mockFn).toBeCalled() + }) + it('prop isActive', () => { + const wrapper = shallowMount(Hamburger) + wrapper.setProps({ isActive: true }) + expect(wrapper.contains('.is-active')).toBe(true) + wrapper.setProps({ isActive: false }) + expect(wrapper.contains('.is-active')).toBe(false) + }) +}) diff --git a/tests/unit/components/SvgIcon.spec.js b/tests/unit/components/SvgIcon.spec.js new file mode 100644 index 0000000..31467a9 --- /dev/null +++ b/tests/unit/components/SvgIcon.spec.js @@ -0,0 +1,22 @@ +import { shallowMount } from '@vue/test-utils' +import SvgIcon from '@/components/SvgIcon/index.vue' +describe('SvgIcon.vue', () => { + it('iconClass', () => { + const wrapper = shallowMount(SvgIcon, { + propsData: { + iconClass: 'test' + } + }) + expect(wrapper.find('use').attributes().href).toBe('#icon-test') + }) + it('className', () => { + const wrapper = shallowMount(SvgIcon, { + propsData: { + iconClass: 'test' + } + }) + expect(wrapper.classes().length).toBe(1) + wrapper.setProps({ className: 'test' }) + expect(wrapper.classes().includes('test')).toBe(true) + }) +}) diff --git a/tests/unit/utils/formatTime.spec.js b/tests/unit/utils/formatTime.spec.js new file mode 100644 index 0000000..24e165b --- /dev/null +++ b/tests/unit/utils/formatTime.spec.js @@ -0,0 +1,30 @@ +import { formatTime } from '@/utils/index.js' + +describe('Utils:formatTime', () => { + const d = new Date('2018-07-13 17:54:01') // "2018-07-13 17:54:01" + const retrofit = 5 * 1000 + + it('ten digits timestamp', () => { + expect(formatTime((d / 1000).toFixed(0))).toBe('7月13日17时54分') + }) + it('test now', () => { + expect(formatTime(+new Date() - 1)).toBe('刚刚') + }) + it('less two minute', () => { + expect(formatTime(+new Date() - 60 * 2 * 1000 + retrofit)).toBe('2分钟前') + }) + it('less two hour', () => { + expect(formatTime(+new Date() - 60 * 60 * 2 * 1000 + retrofit)).toBe('2小时前') + }) + it('less one day', () => { + expect(formatTime(+new Date() - 60 * 60 * 24 * 1 * 1000)).toBe('1天前') + }) + it('more than one day', () => { + expect(formatTime(d)).toBe('7月13日17时54分') + }) + it('format', () => { + expect(formatTime(d, '{y}-{m}-{d} {h}:{i}')).toBe('2018-07-13 17:54') + expect(formatTime(d, '{y}-{m}-{d}')).toBe('2018-07-13') + expect(formatTime(d, '{y}/{m}/{d} {h}-{i}')).toBe('2018/07/13 17-54') + }) +}) diff --git a/tests/unit/utils/param2Obj.spec.js b/tests/unit/utils/param2Obj.spec.js new file mode 100644 index 0000000..e106ed8 --- /dev/null +++ b/tests/unit/utils/param2Obj.spec.js @@ -0,0 +1,14 @@ +import { param2Obj } from '@/utils/index.js' +describe('Utils:param2Obj', () => { + const url = 'https://github.com/PanJiaChen/vue-element-admin?name=bill&age=29&sex=1&field=dGVzdA==&key=%E6%B5%8B%E8%AF%95' + + it('param2Obj test', () => { + expect(param2Obj(url)).toEqual({ + name: 'bill', + age: '29', + sex: '1', + field: window.btoa('test'), + key: '测试' + }) + }) +}) diff --git a/tests/unit/utils/parseTime.spec.js b/tests/unit/utils/parseTime.spec.js new file mode 100644 index 0000000..56045af --- /dev/null +++ b/tests/unit/utils/parseTime.spec.js @@ -0,0 +1,35 @@ +import { parseTime } from '@/utils/index.js' + +describe('Utils:parseTime', () => { + const d = new Date('2018-07-13 17:54:01') // "2018-07-13 17:54:01" + it('timestamp', () => { + expect(parseTime(d)).toBe('2018-07-13 17:54:01') + }) + it('timestamp string', () => { + expect(parseTime((d + ''))).toBe('2018-07-13 17:54:01') + }) + it('ten digits timestamp', () => { + expect(parseTime((d / 1000).toFixed(0))).toBe('2018-07-13 17:54:01') + }) + it('new Date', () => { + expect(parseTime(new Date(d))).toBe('2018-07-13 17:54:01') + }) + it('format', () => { + expect(parseTime(d, '{y}-{m}-{d} {h}:{i}')).toBe('2018-07-13 17:54') + expect(parseTime(d, '{y}-{m}-{d}')).toBe('2018-07-13') + expect(parseTime(d, '{y}/{m}/{d} {h}-{i}')).toBe('2018/07/13 17-54') + }) + it('get the day of the week', () => { + expect(parseTime(d, '{a}')).toBe('五') // 星期五 + }) + it('get the day of the week', () => { + expect(parseTime(+d + 1000 * 60 * 60 * 24 * 2, '{a}')).toBe('日') // 星期日 + }) + it('empty argument', () => { + expect(parseTime()).toBeNull() + }) + + it('null', () => { + expect(parseTime(null)).toBeNull() + }) +}) diff --git a/tests/unit/utils/validate.spec.js b/tests/unit/utils/validate.spec.js new file mode 100644 index 0000000..f774905 --- /dev/null +++ b/tests/unit/utils/validate.spec.js @@ -0,0 +1,17 @@ +import { validUsername, isExternal } from '@/utils/validate.js' + +describe('Utils:validate', () => { + it('validUsername', () => { + expect(validUsername('admin')).toBe(true) + expect(validUsername('editor')).toBe(true) + expect(validUsername('xxxx')).toBe(false) + }) + it('isExternal', () => { + expect(isExternal('https://github.com/PanJiaChen/vue-element-admin')).toBe(true) + expect(isExternal('http://github.com/PanJiaChen/vue-element-admin')).toBe(true) + expect(isExternal('github.com/PanJiaChen/vue-element-admin')).toBe(false) + expect(isExternal('/dashboard')).toBe(false) + expect(isExternal('./dashboard')).toBe(false) + expect(isExternal('dashboard')).toBe(false) + }) +}) diff --git a/vue.config.js b/vue.config.js new file mode 100644 index 0000000..fd79dc7 --- /dev/null +++ b/vue.config.js @@ -0,0 +1,125 @@ +'use strict' +const path = require('path') +const defaultSettings = require('./src/settings.js') + +function resolve(dir) { + return path.join(__dirname, dir) +} + +const name = defaultSettings.title || 'vue Admin Template' // page title + +// If your port is set to 80, +// use administrator privileges to execute the command line. +// For example, Mac: sudo npm run +// You can change the port by the following methods: +// port = 9528 npm run dev OR npm run dev --port = 9528 +const port = process.env.port || process.env.npm_config_port || 9528 // dev port + +// All configuration item explanations can be find in https://cli.vuejs.org/config/ +module.exports = { + /** + * You will need to set publicPath if you plan to deploy your site under a sub path, + * for example GitHub Pages. If you plan to deploy your site to https://foo.github.io/bar/, + * then publicPath should be set to "/bar/". + * In most cases please use '/' !!! + * Detail: https://cli.vuejs.org/config/#publicpath + */ + publicPath: '/', + outputDir: 'dist', + assetsDir: 'static', + lintOnSave: false, + // lintOnSave: process.env.NODE_ENV === 'development', + productionSourceMap: false, + devServer: { + disableHostCheck: true, + port: port, + open: true, + overlay: { + warnings: false, + errors: true + }, + before: require('./mock/mock-server.js') + }, + configureWebpack: { + // provide the app's title in webpack's name field, so that + // it can be accessed in index.html to inject the correct title. + name: name, + resolve: { + alias: { + '@': resolve('src') + } + } + }, + chainWebpack(config) { + // it can improve the speed of the first screen, it is recommended to turn on preload + config.plugin('preload').tap(() => [ + { + rel: 'preload', + // to ignore runtime.js + // https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/cli-service/lib/config/app.js#L171 + fileBlacklist: [/\.map$/, /hot-update\.js$/, /runtime\..*\.js$/], + include: 'initial' + } + ]) + + // when there are many pages, it will cause too many meaningless requests + config.plugins.delete('prefetch') + + // set svg-sprite-loader + config.module + .rule('svg') + .exclude.add(resolve('src/icons')) + .end() + config.module + .rule('icons') + .test(/\.svg$/) + .include.add(resolve('src/icons')) + .end() + .use('svg-sprite-loader') + .loader('svg-sprite-loader') + .options({ + symbolId: 'icon-[name]' + }) + .end() + + config + .when(process.env.NODE_ENV !== 'development', + config => { + config + .plugin('ScriptExtHtmlWebpackPlugin') + .after('html') + .use('script-ext-html-webpack-plugin', [{ + // `runtime` must same as runtimeChunk name. default is `runtime` + inline: /runtime\..*\.js$/ + }]) + .end() + config + .optimization.splitChunks({ + chunks: 'all', + cacheGroups: { + libs: { + name: 'chunk-libs', + test: /[\\/]node_modules[\\/]/, + priority: 10, + chunks: 'initial' // only package third parties that are initially dependent + }, + elementUI: { + name: 'chunk-elementUI', // split elementUI into a single package + priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app + test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm + }, + commons: { + name: 'chunk-commons', + test: resolve('src/components'), // can customize your rules + minChunks: 3, // minimum common number + priority: 5, + reuseExistingChunk: true + } + } + }) + // https:// webpack.js.org/configuration/optimization/#optimizationruntimechunk + config.optimization.runtimeChunk('single') + } + ) + } +} diff --git a/workspace.code-workspace b/workspace.code-workspace new file mode 100644 index 0000000..5f5f8e8 --- /dev/null +++ b/workspace.code-workspace @@ -0,0 +1,10 @@ +{ + "folders": [ + { + "path": "." + } + ], + "settings": { + "thiefBook.filePath": "H:\\BaiduNetdiskDownload\\二号首长1--2部.txt" + } +} \ No newline at end of file