@ -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 |
|||
@ -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' |
|||
@ -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' |
|||
@ -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' |
|||
|
|||
@ -0,0 +1,4 @@ |
|||
build/*.js |
|||
src/assets |
|||
public |
|||
dist |
|||
@ -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'] |
|||
} |
|||
} |
|||
@ -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 |
|||
@ -0,0 +1,5 @@ |
|||
language: node_js |
|||
node_js: 10 |
|||
script: npm run test |
|||
notifications: |
|||
email: false |
|||
@ -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. |
|||
@ -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`。 |
|||
|
|||
<p align="center"> |
|||
<b>SPONSORED BY</b> |
|||
</p> |
|||
<p align="center"> |
|||
<a href="https://finclip.com?from=vue_element" title="FinClip" target="_blank"> |
|||
<img height="200px" src="https://gitee.com/panjiachen/gitee-cdn/raw/master/vue%E8%B5%9E%E5%8A%A9.png" title="FinClip"> |
|||
</a> |
|||
</p> |
|||
|
|||
## 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 |
|||
|
|||
 |
|||
|
|||
## Browsers support |
|||
|
|||
Modern browsers and Internet Explorer 10+. |
|||
|
|||
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>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 |
|||
@ -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'] |
|||
} |
|||
} |
|||
} |
|||
@ -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}`) |
|||
} |
|||
@ -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: { |
|||
'^@/(.*)$': '<rootDir>/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: '<rootDir>/tests/unit/coverage', |
|||
// 'collectCoverage': true,
|
|||
'coverageReporters': [ |
|||
'lcov', |
|||
'text-summary' |
|||
], |
|||
testURL: 'http://gin.vueadmin.net/' |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
{ |
|||
"compilerOptions": { |
|||
"baseUrl": "./", |
|||
"paths": { |
|||
"@/*": ["src/*"] |
|||
} |
|||
}, |
|||
"exclude": ["node_modules", "dist"] |
|||
} |
|||
@ -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 |
|||
} |
|||
|
|||
@ -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)) |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
@ -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 |
|||
} |
|||
} |
|||
} |
|||
} |
|||
] |
|||
@ -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' |
|||
} |
|||
} |
|||
} |
|||
] |
|||
@ -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 |
|||
} |
|||
@ -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 <panfree23@gmail.com>", |
|||
"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" |
|||
} |
|||
@ -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': {} |
|||
} |
|||
} |
|||
|
After Width: | Height: | Size: 66 KiB |
|
After Width: | Height: | Size: 72 KiB |
@ -0,0 +1,19 @@ |
|||
<!DOCTYPE html> |
|||
<html> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> |
|||
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> |
|||
<title><%= webpackConfig.name %></title> |
|||
<script src="//res.wx.qq.com/open/js/jweixin-1.2.0.js"></script> |
|||
<script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js"></script> |
|||
</head> |
|||
<body> |
|||
<noscript> |
|||
<strong>We're sorry but <%= webpackConfig.name %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> |
|||
</noscript> |
|||
<div id="app"></div> |
|||
<!-- built files will be auto injected --> |
|||
</body> |
|||
</html> |
|||
@ -0,0 +1,61 @@ |
|||
<template> |
|||
<div id="app"> |
|||
<router-view /> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
name: 'App', |
|||
data () { |
|||
return { |
|||
sjUrl:'https://www.hxgk.group/jumpapiurl/webindex?url=http://new.hxgk.group/sj/index.html' |
|||
} |
|||
}, |
|||
beforeCreate(){ |
|||
if ( |
|||
navigator.userAgent.match( |
|||
/(Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i |
|||
) |
|||
) { |
|||
window.open('https://www.hxgk.group/jumpapiurl/webindex?url=http://new.hxgk.group/sj/index.html','_blank') |
|||
//return true; // 手机端 |
|||
} else { |
|||
console.log("PC端"); |
|||
|
|||
//return false; // alert('PC端') |
|||
} |
|||
if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) { //判断iPhone|iPad|iPod|iOS |
|||
window.location.href = 'https://www.hxgk.group/jumpapiurl/webindex?url=http://new.hxgk.group/sj/index.html'; |
|||
} |
|||
}, |
|||
created(){ |
|||
|
|||
// let flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i) |
|||
// if (flag) { |
|||
// // 手机端 |
|||
// window.open(this.sjUrl,'_blank') |
|||
// } else { |
|||
// // pc端 |
|||
|
|||
// } |
|||
|
|||
|
|||
}, |
|||
mounted(){ |
|||
|
|||
window.addEventListener('hashchange',()=>{ |
|||
var currentPath = window.location.hash.slice(1); // 获取输入的路由 |
|||
|
|||
if(this.$router.path !== currentPath){ |
|||
console.log('动态跳转') |
|||
// this.$router.push(currentPath); // 动态跳转 |
|||
|
|||
} |
|||
|
|||
},false); |
|||
|
|||
} |
|||
|
|||
} |
|||
</script> |
|||
@ -0,0 +1,44 @@ |
|||
<template> |
|||
<section class="app-main"> |
|||
<transition name="fade-transform" mode="out-in"> |
|||
<router-view :key="key" /> |
|||
</transition> |
|||
</section> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
name: 'AppMain', |
|||
computed: { |
|||
key() { |
|||
console.log("AppMain") |
|||
console.log("AppMain") |
|||
console.log(this.$route.path) |
|||
return this.$route.path |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.app-main { |
|||
/*50 = navbar */ |
|||
min-height: calc(100vh - 50px); |
|||
width: 100%; |
|||
position: relative; |
|||
overflow: hidden; |
|||
padding: 10px; |
|||
} |
|||
.fixed-header+.app-main { |
|||
padding-top: 50px; |
|||
} |
|||
</style> |
|||
|
|||
<style lang="scss"> |
|||
// fix css style bug in open el-dialog |
|||
.el-popup-parent--hidden { |
|||
.fixed-header { |
|||
padding-right: 15px; |
|||
} |
|||
} |
|||
</style> |
|||
@ -0,0 +1,155 @@ |
|||
<template> |
|||
<div class="navbar"> |
|||
<hamburger :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" /> |
|||
|
|||
<breadcrumb class="breadcrumb-container" /> |
|||
|
|||
<div class="right-menu"> |
|||
<el-dropdown class="avatar-container" trigger="click"> |
|||
<div class="avatar-wrapper"> |
|||
<!-- <img :src="avatar+'?imageView2/1/w/80/h/80'" class="user-avatar"> --> |
|||
<div> |
|||
{{userInfo.groupName}}{{userInfo.roleName}} |
|||
</div> |
|||
<i class="el-icon-caret-bottom" /> |
|||
</div> |
|||
<el-dropdown-menu slot="dropdown" class="user-dropdown"> |
|||
<router-link to="/"> |
|||
<el-dropdown-item> |
|||
个人信息 |
|||
</el-dropdown-item> |
|||
</router-link> |
|||
<!-- <a target="_blank" href="https://github.com/PanJiaChen/vue-admin-template/"> |
|||
<el-dropdown-item>Github</el-dropdown-item> |
|||
</a> |
|||
<a target="_blank" href="https://panjiachen.github.io/vue-element-admin-site/#/"> |
|||
<el-dropdown-item>Docs</el-dropdown-item> |
|||
</a> --> |
|||
<el-dropdown-item divided @click.native="logout"> |
|||
<span style="display:block;">退 出</span> |
|||
</el-dropdown-item> |
|||
</el-dropdown-menu> |
|||
</el-dropdown> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { mapGetters } from 'vuex' |
|||
import Breadcrumb from '@/components/Breadcrumb' |
|||
import Hamburger from '@/components/Hamburger' |
|||
|
|||
export default { |
|||
data () { |
|||
return { |
|||
userInfo:{} |
|||
} |
|||
}, |
|||
components: { |
|||
Breadcrumb, |
|||
Hamburger |
|||
}, |
|||
computed: { |
|||
...mapGetters([ |
|||
'sidebar', |
|||
'avatar' |
|||
]) |
|||
}, |
|||
created () { |
|||
if (JSON.parse(sessionStorage.getItem('userinfo'))==null) { |
|||
console.log('Navbarr Login') |
|||
this.$router.push('/login') |
|||
} |
|||
this.userInfo=JSON.parse(sessionStorage.getItem('userinfo')); |
|||
console.log(this.userInfo) |
|||
console.log("this.userInfo") |
|||
}, |
|||
methods: { |
|||
toggleSideBar() { |
|||
this.$store.dispatch('app/toggleSideBar') |
|||
}, |
|||
logout() { |
|||
this.$store.commit('user/loginOut') |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.navbar { |
|||
height: 50px; |
|||
overflow: hidden; |
|||
position: relative; |
|||
background: #fff; |
|||
box-shadow: 0 1px 4px rgba(0,21,41,.08); |
|||
|
|||
.hamburger-container { |
|||
line-height: 46px; |
|||
height: 100%; |
|||
float: left; |
|||
cursor: pointer; |
|||
transition: background .3s; |
|||
-webkit-tap-highlight-color:transparent; |
|||
|
|||
&:hover { |
|||
background: rgba(0, 0, 0, .025) |
|||
} |
|||
} |
|||
|
|||
.breadcrumb-container { |
|||
float: left; |
|||
} |
|||
|
|||
.right-menu { |
|||
float: right; |
|||
height: 100%; |
|||
line-height: 50px; |
|||
|
|||
&:focus { |
|||
outline: none; |
|||
} |
|||
|
|||
.right-menu-item { |
|||
display: inline-block; |
|||
padding: 0 8px; |
|||
height: 100%; |
|||
font-size: 18px; |
|||
color: #5a5e66; |
|||
vertical-align: text-bottom; |
|||
|
|||
&.hover-effect { |
|||
cursor: pointer; |
|||
transition: background .3s; |
|||
|
|||
&:hover { |
|||
background: rgba(0, 0, 0, .025) |
|||
} |
|||
} |
|||
} |
|||
|
|||
.avatar-container { |
|||
margin-right: 30px; |
|||
|
|||
.avatar-wrapper { |
|||
margin-top: 5px; |
|||
position: relative; |
|||
|
|||
.user-avatar { |
|||
cursor: pointer; |
|||
width: 40px; |
|||
height: 40px; |
|||
border-radius: 10px; |
|||
} |
|||
|
|||
.el-icon-caret-bottom { |
|||
cursor: pointer; |
|||
position: absolute; |
|||
right: -20px; |
|||
top: 25px; |
|||
font-size: 12px; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</style> |
|||
@ -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) |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,41 @@ |
|||
<script> |
|||
export default { |
|||
name: 'MenuItem', |
|||
functional: true, |
|||
props: { |
|||
icon: { |
|||
type: String, |
|||
default: '' |
|||
}, |
|||
title: { |
|||
type: String, |
|||
default: '' |
|||
} |
|||
}, |
|||
render(h, context) { |
|||
const { icon, title } = context.props |
|||
const vnodes = [] |
|||
|
|||
if (icon) { |
|||
if (icon.includes('el-icon')) { |
|||
vnodes.push(<i class={[icon, 'sub-el-icon']} />) |
|||
} else { |
|||
vnodes.push(<svg-icon icon-class={icon}/>) |
|||
} |
|||
} |
|||
|
|||
if (title) { |
|||
vnodes.push(<span slot='title'>{(title)}</span>) |
|||
} |
|||
return vnodes |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.sub-el-icon { |
|||
color: currentColor; |
|||
width: 1em; |
|||
height: 1em; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,54 @@ |
|||
<template> |
|||
<component :is="type" v-bind="linkProps(to)"> |
|||
<slot /> |
|||
</component> |
|||
</template> |
|||
|
|||
<script> |
|||
import { isExternal } from '@/utils/validate' |
|||
|
|||
export default { |
|||
props: { |
|||
to: { |
|||
type: String, |
|||
required: true |
|||
} |
|||
}, |
|||
created () { |
|||
console.log("tiaozhuan") |
|||
}, |
|||
|
|||
computed: { |
|||
isExternal() { |
|||
return isExternal(this.to) |
|||
}, |
|||
type() { |
|||
if (this.isExternal) { |
|||
return 'a' |
|||
} |
|||
return 'router-link' |
|||
} |
|||
}, |
|||
methods: { |
|||
linkProps(to) { |
|||
console.log("to") |
|||
console.log(to) |
|||
console.log("this.isExternal") |
|||
console.log(this.isExternal) |
|||
console.log("this.type") |
|||
console.log(this.type) |
|||
if (this.isExternal) { |
|||
console.log("isExternal") |
|||
return { |
|||
href: to, |
|||
target: '_blank', |
|||
rel: 'noopener' |
|||
} |
|||
} |
|||
return { |
|||
to: to |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
@ -0,0 +1,82 @@ |
|||
<template> |
|||
<div class="sidebar-logo-container" :class="{'collapse':collapse}"> |
|||
<transition name="sidebarLogoFade"> |
|||
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/"> |
|||
<img v-if="logo" :src="logo" class="sidebar-logo"> |
|||
<h1 v-else class="sidebar-title">{{ title }} </h1> |
|||
</router-link> |
|||
<router-link v-else key="expand" class="sidebar-logo-link" to="/"> |
|||
<img v-if="logo" :src="logo" class="sidebar-logo"> |
|||
<h1 class="sidebar-title">{{ title }} </h1> |
|||
</router-link> |
|||
</transition> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
name: 'SidebarLogo', |
|||
props: { |
|||
collapse: { |
|||
type: Boolean, |
|||
required: true |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
title: 'Vue Admin Template', |
|||
logo: 'https://wpimg.wallstcn.com/69a1c46c-eb1c-4b46-8bd4-e9e686ef5251.png' |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.sidebarLogoFade-enter-active { |
|||
transition: opacity 1.5s; |
|||
} |
|||
|
|||
.sidebarLogoFade-enter, |
|||
.sidebarLogoFade-leave-to { |
|||
opacity: 0; |
|||
} |
|||
|
|||
.sidebar-logo-container { |
|||
position: relative; |
|||
width: 100%; |
|||
height: 50px; |
|||
line-height: 50px; |
|||
background: #2b2f3a; |
|||
text-align: center; |
|||
overflow: hidden; |
|||
|
|||
& .sidebar-logo-link { |
|||
height: 100%; |
|||
width: 100%; |
|||
|
|||
& .sidebar-logo { |
|||
width: 32px; |
|||
height: 32px; |
|||
vertical-align: middle; |
|||
margin-right: 12px; |
|||
} |
|||
|
|||
& .sidebar-title { |
|||
display: inline-block; |
|||
margin: 0; |
|||
color: #fff; |
|||
font-weight: 600; |
|||
line-height: 50px; |
|||
font-size: 14px; |
|||
font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif; |
|||
vertical-align: middle; |
|||
} |
|||
} |
|||
|
|||
&.collapse { |
|||
.sidebar-logo { |
|||
margin-right: 0px; |
|||
} |
|||
} |
|||
} |
|||
</style> |
|||
@ -0,0 +1,95 @@ |
|||
<template> |
|||
<div v-if="!item.hidden"> |
|||
<template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow"> |
|||
<app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path)"> |
|||
<el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}"> |
|||
<item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" /> |
|||
</el-menu-item> |
|||
</app-link> |
|||
</template> |
|||
|
|||
<el-submenu v-else ref="subMenu" :index="resolvePath(item.path)" popper-append-to-body> |
|||
<template slot="title"> |
|||
<item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" /> |
|||
</template> |
|||
<sidebar-item |
|||
v-for="child in item.children" |
|||
:key="child.path" |
|||
:is-nest="true" |
|||
:item="child" |
|||
:base-path="resolvePath(child.path)" |
|||
class="nest-menu" |
|||
/> |
|||
</el-submenu> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import path from 'path' |
|||
import { isExternal } from '@/utils/validate' |
|||
import Item from './Item' |
|||
import AppLink from './Link' |
|||
import FixiOSBug from './FixiOSBug' |
|||
|
|||
export default { |
|||
name: 'SidebarItem', |
|||
components: { Item, AppLink }, |
|||
mixins: [FixiOSBug], |
|||
props: { |
|||
// route object |
|||
item: { |
|||
type: Object, |
|||
required: true |
|||
}, |
|||
isNest: { |
|||
type: Boolean, |
|||
default: false |
|||
}, |
|||
basePath: { |
|||
type: String, |
|||
default: '' |
|||
} |
|||
}, |
|||
data() { |
|||
// To fix https://github.com/PanJiaChen/vue-admin-template/issues/237 |
|||
// TODO: refactor with render function |
|||
this.onlyOneChild = null |
|||
return {} |
|||
}, |
|||
methods: { |
|||
hasOneShowingChild(children = [], parent) { |
|||
const showingChildren = children.filter(item => { |
|||
if (item.hidden) { |
|||
return false |
|||
} else { |
|||
// Temp set(will be used if only has one showing child) |
|||
this.onlyOneChild = item |
|||
return true |
|||
} |
|||
}) |
|||
|
|||
// When there is only one child router, the child router is displayed by default |
|||
if (showingChildren.length === 1) { |
|||
return true |
|||
} |
|||
|
|||
// Show parent if there are no child router to display |
|||
if (showingChildren.length === 0) { |
|||
this.onlyOneChild = { ... parent, path: '', noShowingChildren: true } |
|||
return true |
|||
} |
|||
|
|||
return false |
|||
}, |
|||
resolvePath(routePath) { |
|||
if (isExternal(routePath)) { |
|||
return routePath |
|||
} |
|||
if (isExternal(this.basePath)) { |
|||
return this.basePath |
|||
} |
|||
return path.resolve(this.basePath, routePath) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
@ -0,0 +1,56 @@ |
|||
<template> |
|||
<div :class="{'has-logo':showLogo}"> |
|||
<logo v-if="showLogo" :collapse="isCollapse" /> |
|||
<el-scrollbar wrap-class="scrollbar-wrapper"> |
|||
<el-menu |
|||
:default-active="activeMenu" |
|||
:collapse="isCollapse" |
|||
:background-color="variables.menuBg" |
|||
:text-color="variables.menuText" |
|||
:unique-opened="false" |
|||
:active-text-color="variables.menuActiveText" |
|||
:collapse-transition="false" |
|||
mode="vertical" |
|||
> |
|||
<sidebar-item v-for="route in routes" :key="route.path" :item="route" :base-path="route.path" /> |
|||
</el-menu> |
|||
</el-scrollbar> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { mapGetters } from 'vuex' |
|||
import Logo from './Logo' |
|||
import SidebarItem from './SidebarItem' |
|||
import variables from '@/styles/variables.scss' |
|||
|
|||
export default { |
|||
components: { SidebarItem, Logo }, |
|||
computed: { |
|||
...mapGetters([ |
|||
'sidebar' |
|||
]), |
|||
routes() { |
|||
return this.$router.options.routes |
|||
}, |
|||
activeMenu() { |
|||
const route = this.$route |
|||
const { meta, path } = route |
|||
// if set path, the sidebar will highlight the path you set |
|||
if (meta.activeMenu) { |
|||
return meta.activeMenu |
|||
} |
|||
return path |
|||
}, |
|||
showLogo() { |
|||
return this.$store.state.settings.sidebarLogo |
|||
}, |
|||
variables() { |
|||
return variables |
|||
}, |
|||
isCollapse() { |
|||
return !this.sidebar.opened |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
@ -0,0 +1,3 @@ |
|||
export { default as Navbar } from './Navbar' |
|||
export { default as Sidebar } from './Sidebar' |
|||
export { default as AppMain } from './AppMain' |
|||
@ -0,0 +1,93 @@ |
|||
<template> |
|||
<div :class="classObj" class="app-wrapper"> |
|||
<div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside" /> |
|||
<sidebar class="sidebar-container" /> |
|||
<div class="main-container"> |
|||
<div :class="{'fixed-header':fixedHeader}"> |
|||
<navbar /> |
|||
</div> |
|||
<app-main /> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { Navbar, Sidebar, AppMain } from './components' |
|||
import ResizeMixin from './mixin/ResizeHandler' |
|||
|
|||
export default { |
|||
name: 'Layout', |
|||
components: { |
|||
Navbar, |
|||
Sidebar, |
|||
AppMain |
|||
}, |
|||
mixins: [ResizeMixin], |
|||
computed: { |
|||
sidebar() { |
|||
return this.$store.state.app.sidebar |
|||
}, |
|||
device() { |
|||
return this.$store.state.app.device |
|||
}, |
|||
fixedHeader() { |
|||
return this.$store.state.settings.fixedHeader |
|||
}, |
|||
classObj() { |
|||
return { |
|||
hideSidebar: !this.sidebar.opened, |
|||
openSidebar: this.sidebar.opened, |
|||
withoutAnimation: this.sidebar.withoutAnimation, |
|||
mobile: this.device === 'mobile' |
|||
} |
|||
} |
|||
}, |
|||
methods: { |
|||
handleClickOutside() { |
|||
this.$store.dispatch('app/closeSideBar', { withoutAnimation: false }) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
@import "~@/styles/mixin.scss"; |
|||
@import "~@/styles/variables.scss"; |
|||
|
|||
.app-wrapper { |
|||
@include clearfix; |
|||
position: relative; |
|||
height: 100%; |
|||
width: 100%; |
|||
&.mobile.openSidebar{ |
|||
position: fixed; |
|||
top: 0; |
|||
} |
|||
} |
|||
.drawer-bg { |
|||
background: #000; |
|||
opacity: 0.3; |
|||
width: 100%; |
|||
top: 0; |
|||
height: 100%; |
|||
position: absolute; |
|||
z-index: 999; |
|||
} |
|||
|
|||
.fixed-header { |
|||
position: fixed; |
|||
top: 0; |
|||
right: 0; |
|||
z-index: 9; |
|||
width: calc(100% - #{$sideBarWidth}); |
|||
transition: width 0.28s; |
|||
} |
|||
|
|||
.hideSidebar .fixed-header { |
|||
width: calc(100% - 54px) |
|||
} |
|||
|
|||
.mobile .fixed-header { |
|||
width: 100%; |
|||
} |
|||
</style> |
|||
@ -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 }) |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -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 }) |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -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 |
|||
}) |
|||
} |
|||
|
|||
@ -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 |
|||
}) |
|||
} |
|||
@ -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' |
|||
}) |
|||
} |
|||
@ -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 |
|||
}) |
|||
} |
|||
|
|||
|
|||
@ -0,0 +1,9 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
export function getList(params) { |
|||
return request({ |
|||
url: '/vue-admin-template/table/list', |
|||
method: 'get', |
|||
params |
|||
}) |
|||
} |
|||
@ -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 |
|||
}) |
|||
} |
|||
@ -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 |
|||
}) |
|||
} |
|||
@ -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 |
|||
}) |
|||
} |
|||
@ -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 |
|||
}) |
|||
} |
|||
|
|||
@ -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 |
|||
}) |
|||
} |
|||
|
|||
@ -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 |
|||
}) |
|||
} |
|||
|
|||
|
|||
@ -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 |
|||
}) |
|||
} |
|||
@ -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 |
|||
}) |
|||
} |
|||
@ -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 |
|||
}) |
|||
} |
|||
@ -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 |
|||
}) |
|||
} |
|||
|
|||
|
|||
@ -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 |
|||
}) |
|||
} |
|||
@ -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 |
|||
}) |
|||
} |
|||
|
|||
@ -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 |
|||
}) |
|||
} |
|||
@ -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 |
|||
}) |
|||
} |
|||
@ -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 |
|||
}) |
|||
} |
|||
@ -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 |
|||
}) |
|||
} |
|||
@ -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 |
|||
}) |
|||
} |
|||
|
|||
|
|||
@ -0,0 +1,9 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
export function getList(params) { |
|||
return request({ |
|||
url: '/vue-admin-template/table/list', |
|||
method: 'get', |
|||
params |
|||
}) |
|||
} |
|||
@ -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 |
|||
}) |
|||
} |
|||
|
After Width: | Height: | Size: 96 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 70 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 7.9 KiB |
|
After Width: | Height: | Size: 25 KiB |
@ -0,0 +1,78 @@ |
|||
<template> |
|||
<el-breadcrumb class="app-breadcrumb" separator="/"> |
|||
<transition-group name="breadcrumb"> |
|||
<el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path"> |
|||
<span v-if="item.redirect==='noRedirect'||index==levelList.length-1" class="no-redirect">{{ item.meta.title }}</span> |
|||
<a v-else @click.prevent="handleLink(item)">{{ item.meta.title }}</a> |
|||
</el-breadcrumb-item> |
|||
</transition-group> |
|||
</el-breadcrumb> |
|||
</template> |
|||
|
|||
<script> |
|||
import pathToRegexp from 'path-to-regexp' |
|||
|
|||
export default { |
|||
data() { |
|||
return { |
|||
levelList: null |
|||
} |
|||
}, |
|||
watch: { |
|||
$route() { |
|||
this.getBreadcrumb() |
|||
} |
|||
}, |
|||
created() { |
|||
this.getBreadcrumb() |
|||
}, |
|||
methods: { |
|||
getBreadcrumb() { |
|||
// only show routes with meta.title |
|||
let matched = this.$route.matched.filter(item => item.meta && item.meta.title) |
|||
const first = matched[0] |
|||
|
|||
// if (!this.isDashboard(first)) { |
|||
// matched = [{ path: '/dashboard', meta: { title: 'Dashboard' }}].concat(matched) |
|||
// } |
|||
|
|||
this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false) |
|||
}, |
|||
isDashboard(route) { |
|||
const name = route && route.name |
|||
if (!name) { |
|||
return false |
|||
} |
|||
return name.trim().toLocaleLowerCase() === 'Dashboard'.toLocaleLowerCase() |
|||
}, |
|||
pathCompile(path) { |
|||
// To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561 |
|||
const { params } = this.$route |
|||
var toPath = pathToRegexp.compile(path) |
|||
return toPath(params) |
|||
}, |
|||
handleLink(item) { |
|||
const { redirect, path } = item |
|||
if (redirect) { |
|||
this.$router.push(redirect) |
|||
return |
|||
} |
|||
this.$router.push(this.pathCompile(path)) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.app-breadcrumb.el-breadcrumb { |
|||
display: inline-block; |
|||
font-size: 14px; |
|||
line-height: 50px; |
|||
margin-left: 8px; |
|||
|
|||
.no-redirect { |
|||
color: #97a8be; |
|||
cursor: text; |
|||
} |
|||
} |
|||
</style> |
|||
@ -0,0 +1,44 @@ |
|||
<template> |
|||
<div style="padding: 0 15px;" @click="toggleClick"> |
|||
<svg |
|||
:class="{'is-active':isActive}" |
|||
class="hamburger" |
|||
viewBox="0 0 1024 1024" |
|||
xmlns="http://www.w3.org/2000/svg" |
|||
width="64" |
|||
height="64" |
|||
> |
|||
<path d="M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 0 0 0-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0 0 14.4 7z" /> |
|||
</svg> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
name: 'Hamburger', |
|||
props: { |
|||
isActive: { |
|||
type: Boolean, |
|||
default: false |
|||
} |
|||
}, |
|||
methods: { |
|||
toggleClick() { |
|||
this.$emit('toggleClick') |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.hamburger { |
|||
display: inline-block; |
|||
vertical-align: middle; |
|||
width: 20px; |
|||
height: 20px; |
|||
} |
|||
|
|||
.hamburger.is-active { |
|||
transform: rotate(180deg); |
|||
} |
|||
</style> |
|||
@ -0,0 +1,62 @@ |
|||
<template> |
|||
<div v-if="isExternal" :style="styleExternalIcon" class="svg-external-icon svg-icon" v-on="$listeners" /> |
|||
<svg v-else :class="svgClass" aria-hidden="true" v-on="$listeners"> |
|||
<use :xlink:href="iconName" /> |
|||
</svg> |
|||
</template> |
|||
|
|||
<script> |
|||
// doc: https://panjiachen.github.io/vue-element-admin-site/feature/component/svg-icon.html#usage |
|||
import { isExternal } from '@/utils/validate' |
|||
|
|||
export default { |
|||
name: 'SvgIcon', |
|||
props: { |
|||
iconClass: { |
|||
type: String, |
|||
required: true |
|||
}, |
|||
className: { |
|||
type: String, |
|||
default: '' |
|||
} |
|||
}, |
|||
computed: { |
|||
isExternal() { |
|||
return isExternal(this.iconClass) |
|||
}, |
|||
iconName() { |
|||
return `#icon-${this.iconClass}` |
|||
}, |
|||
svgClass() { |
|||
if (this.className) { |
|||
return 'svg-icon ' + this.className |
|||
} else { |
|||
return 'svg-icon' |
|||
} |
|||
}, |
|||
styleExternalIcon() { |
|||
return { |
|||
mask: `url(${this.iconClass}) no-repeat 50% 50%`, |
|||
'-webkit-mask': `url(${this.iconClass}) no-repeat 50% 50%` |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.svg-icon { |
|||
width: 1em; |
|||
height: 1em; |
|||
vertical-align: -0.15em; |
|||
fill: currentColor; |
|||
overflow: hidden; |
|||
} |
|||
|
|||
.svg-external-icon { |
|||
background-color: currentColor; |
|||
mask-size: cover!important; |
|||
display: inline-block; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,151 @@ |
|||
<template> |
|||
<div> |
|||
<div> |
|||
<el-button size="small" @click="showDialog()">选择考核项目</el-button> |
|||
</div> |
|||
|
|||
<el-dialog title="提示" :visible.sync="dialogVisible" width="60%" :append-to-body="true"> |
|||
<div class="gva-search-box"> |
|||
<el-form ref="searchForm" :inline="true" :model="projectSearchInfo"> |
|||
<el-form-item label="考核项目名称"> |
|||
<el-input |
|||
placeholder="请输入名称" |
|||
v-model="projectSearchInfo.title" |
|||
clearable> |
|||
</el-input> |
|||
</el-form-item> |
|||
<!-- <el-form-item label="考核项目状态"> |
|||
<el-select v-model="projectSearchInfo.state" clearable placeholder="请选择状态"> |
|||
<el-option :value=1 label="正常">正常</el-option> |
|||
<el-option :value=2 label="禁止">禁止</el-option> |
|||
</el-select> |
|||
</el-form-item> --> |
|||
<el-form-item label="所属考核类别"> |
|||
<el-select v-model="projectSearchInfo.parentId" clearable placeholder="请选择状态"> |
|||
<el-option |
|||
v-for="item in dutyclasslist" |
|||
:key="item.outId" |
|||
:label="item.title" |
|||
:value="item.outId"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button> |
|||
<!-- <el-button size="mini" icon="el-icon-refresh" @click="onReset">重置</el-button> --> |
|||
</el-form-item> |
|||
</el-form> |
|||
</div> |
|||
<div class="gva-table-box"> |
|||
<el-table :data="assessList"> |
|||
<!-- <el-table-column |
|||
type="selection" |
|||
width="55" |
|||
/> --> |
|||
<el-table-column align="left" label="所属考核类别" prop="parentTitle"/> |
|||
<el-table-column align="left" label="考核项目名称" prop="title"/> |
|||
<el-table-column align="left" label="考核项目说明" prop="content"/> |
|||
<el-table-column align="left" fixed="right" label="操作" width="200"> |
|||
<template #default="scope"> |
|||
<el-button type="primary" round @click="checked(scope.row)">选中</el-button> |
|||
|
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<div class="gva-pagination"> |
|||
<el-pagination |
|||
:current-page="projectSearchInfo.page" |
|||
:page-size="projectSearchInfo.pageSize" |
|||
:page-sizes="[10, 30, 50, 100]" |
|||
:total="total" |
|||
layout="total, sizes, prev, pager, next, jumper" |
|||
@current-change="handleCurrentChange" |
|||
@size-change="handleSizeChange" |
|||
/> |
|||
</div> |
|||
</div> |
|||
<!-- <span slot="footer" class="dialog-footer"> |
|||
<el-button @click="dialogVisible = false">取 消</el-button> |
|||
<el-button type="primary" @click="dialogVisible = false">确 定</el-button> |
|||
</span> --> |
|||
</el-dialog> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
dutyclasslist |
|||
} from '@/api/duty/dimension' |
|||
import { |
|||
assessList, |
|||
} from '@/api/duty/project' |
|||
export default { |
|||
data() { |
|||
return { |
|||
projectTitle:'', |
|||
total:'', |
|||
searchList:{ |
|||
page:1, |
|||
pagesize:10000, |
|||
}, |
|||
dutyclasslist:{}, |
|||
projectSearchInfo:{ |
|||
page: 1, |
|||
pageSize: 10, |
|||
state:1, |
|||
}, |
|||
dialogVisible: false, |
|||
assessList:null, |
|||
} |
|||
}, |
|||
created () { |
|||
this.getProjectList(); |
|||
this.getDutyclasslist(); |
|||
}, |
|||
methods: { |
|||
// 条件搜索前端看此方法 |
|||
onSubmit() { |
|||
this.page = 1 |
|||
this.pageSize = 10 |
|||
|
|||
this.getProjectList() |
|||
}, |
|||
// pagesize改变 |
|||
handleSizeChange(val) { |
|||
this.projectSearchInfo.pageSize=val |
|||
}, |
|||
// 页码改变 |
|||
handleCurrentChange(val) { |
|||
this.projectSearchInfo.page=val |
|||
}, |
|||
// 获取考核类别列表 |
|||
async getDutyclasslist(){ |
|||
const res = await dutyclasslist(this.searchList) |
|||
this.dutyclasslist=res.data.list; |
|||
}, |
|||
// 点击按钮事件 |
|||
showDialog(){ |
|||
this.dialogVisible=true; |
|||
}, |
|||
// 获取考核项目列表 |
|||
async getProjectList(){ |
|||
const res = await assessList(this.projectSearchInfo) |
|||
this.assessList=res.data.list; |
|||
this.projectSearchInfo.page=res.data.page; |
|||
this.projectSearchInfo.pageSize=res.data.pageSize; |
|||
this.total=res.data.total; |
|||
}, |
|||
// 选中 |
|||
checked(row){ |
|||
this.projectTitle=row.title; |
|||
this.$emit('checkedInfo',row) |
|||
this.dialogVisible=false |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
|
|||
</style> |
|||
@ -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) |
|||
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 497 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 944 B |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 285 B |
|
After Width: | Height: | Size: 821 B |
|
After Width: | Height: | Size: 623 B |
|
After Width: | Height: | Size: 597 B |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 440 B |
@ -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' |
|||
@ -0,0 +1,48 @@ |
|||
<template> |
|||
<section class="app-main"> |
|||
<transition name="fade-transform" mode="out-in"> |
|||
<router-view :key="key" /> |
|||
</transition> |
|||
<!-- <router-view /> --> |
|||
<!-- <router-view :key="key" /> --> |
|||
</section> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
name: 'AppMain', |
|||
computed: { |
|||
key() { |
|||
console.log("AppMain") |
|||
console.log("AppMain") |
|||
console.log(this.$route.path) |
|||
console.log(this.$route.fullPath) |
|||
return this.$route.fullPath |
|||
|
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.app-main { |
|||
/*50 = navbar */ |
|||
min-height: calc(100vh - 50px); |
|||
width: 100%; |
|||
position: relative; |
|||
overflow: hidden; |
|||
padding: 10px; |
|||
} |
|||
.fixed-header+.app-main { |
|||
padding-top: 50px; |
|||
} |
|||
</style> |
|||
|
|||
<style lang="scss"> |
|||
// fix css style bug in open el-dialog |
|||
.el-popup-parent--hidden { |
|||
.fixed-header { |
|||
padding-right: 15px; |
|||
} |
|||
} |
|||
</style> |
|||
@ -0,0 +1,154 @@ |
|||
<template> |
|||
<div class="navbar"> |
|||
<hamburger :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" /> |
|||
|
|||
<breadcrumb class="breadcrumb-container" /> |
|||
|
|||
<div class="right-menu"> |
|||
<el-dropdown class="avatar-container" trigger="click"> |
|||
<div class="avatar-wrapper"> |
|||
<!-- <img :src="avatar+'?imageView2/1/w/80/h/80'" class="user-avatar"> --> |
|||
<div> |
|||
{{userInfo.name}}{{userInfo.number}} |
|||
</div> |
|||
<i class="el-icon-caret-bottom" /> |
|||
</div> |
|||
<el-dropdown-menu slot="dropdown" class="user-dropdown"> |
|||
<router-link to="/"> |
|||
<el-dropdown-item> |
|||
个人信息 |
|||
</el-dropdown-item> |
|||
</router-link> |
|||
<!-- <a target="_blank" href="https://github.com/PanJiaChen/vue-admin-template/"> |
|||
<el-dropdown-item>Github</el-dropdown-item> |
|||
</a> |
|||
<a target="_blank" href="https://panjiachen.github.io/vue-element-admin-site/#/"> |
|||
<el-dropdown-item>Docs</el-dropdown-item> |
|||
</a> --> |
|||
<el-dropdown-item divided @click.native="logout"> |
|||
<span style="display:block;">退 出</span> |
|||
</el-dropdown-item> |
|||
</el-dropdown-menu> |
|||
</el-dropdown> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { mapGetters } from 'vuex' |
|||
import Breadcrumb from '@/components/Breadcrumb' |
|||
import Hamburger from '@/components/Hamburger' |
|||
import { signout } from '@/api/user' |
|||
|
|||
export default { |
|||
data () { |
|||
return { |
|||
userInfo:{} |
|||
} |
|||
}, |
|||
components: { |
|||
Breadcrumb, |
|||
Hamburger |
|||
}, |
|||
computed: { |
|||
...mapGetters([ |
|||
'sidebar', |
|||
'avatar' |
|||
]) |
|||
}, |
|||
created () { |
|||
if (JSON.parse(sessionStorage.getItem('userinfo'))==null) { |
|||
this.$router.push('/login') |
|||
} |
|||
this.userInfo=JSON.parse(sessionStorage.getItem('userinfo')); |
|||
}, |
|||
methods: { |
|||
toggleSideBar() { |
|||
this.$store.dispatch('app/toggleSideBar') |
|||
}, |
|||
async logout() { |
|||
const res = await signout() |
|||
this.$store.commit('user/loginOut') |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.navbar { |
|||
height: 50px; |
|||
overflow: hidden; |
|||
position: relative; |
|||
background: #fff; |
|||
box-shadow: 0 1px 4px rgba(0,21,41,.08); |
|||
|
|||
.hamburger-container { |
|||
line-height: 46px; |
|||
height: 100%; |
|||
float: left; |
|||
cursor: pointer; |
|||
transition: background .3s; |
|||
-webkit-tap-highlight-color:transparent; |
|||
|
|||
&:hover { |
|||
background: rgba(0, 0, 0, .025) |
|||
} |
|||
} |
|||
|
|||
.breadcrumb-container { |
|||
float: left; |
|||
} |
|||
|
|||
.right-menu { |
|||
float: right; |
|||
height: 100%; |
|||
line-height: 50px; |
|||
|
|||
&:focus { |
|||
outline: none; |
|||
} |
|||
|
|||
.right-menu-item { |
|||
display: inline-block; |
|||
padding: 0 8px; |
|||
height: 100%; |
|||
font-size: 18px; |
|||
color: #5a5e66; |
|||
vertical-align: text-bottom; |
|||
|
|||
&.hover-effect { |
|||
cursor: pointer; |
|||
transition: background .3s; |
|||
|
|||
&:hover { |
|||
background: rgba(0, 0, 0, .025) |
|||
} |
|||
} |
|||
} |
|||
|
|||
.avatar-container { |
|||
margin-right: 30px; |
|||
|
|||
.avatar-wrapper { |
|||
margin-top: 5px; |
|||
position: relative; |
|||
|
|||
.user-avatar { |
|||
cursor: pointer; |
|||
width: 40px; |
|||
height: 40px; |
|||
border-radius: 10px; |
|||
} |
|||
|
|||
.el-icon-caret-bottom { |
|||
cursor: pointer; |
|||
position: absolute; |
|||
right: -20px; |
|||
top: 25px; |
|||
font-size: 12px; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</style> |
|||
@ -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) |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,41 @@ |
|||
<script> |
|||
export default { |
|||
name: 'MenuItem', |
|||
functional: true, |
|||
props: { |
|||
icon: { |
|||
type: String, |
|||
default: '' |
|||
}, |
|||
title: { |
|||
type: String, |
|||
default: '' |
|||
} |
|||
}, |
|||
render(h, context) { |
|||
const { icon, title } = context.props |
|||
const vnodes = [] |
|||
|
|||
if (icon) { |
|||
if (icon.includes('el-icon')) { |
|||
vnodes.push(<i class={[icon, 'sub-el-icon']} />) |
|||
} else { |
|||
vnodes.push(<svg-icon icon-class={icon}/>) |
|||
} |
|||
} |
|||
|
|||
if (title) { |
|||
vnodes.push(<span slot='title'>{(title)}</span>) |
|||
} |
|||
return vnodes |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.sub-el-icon { |
|||
color: currentColor; |
|||
width: 1em; |
|||
height: 1em; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,49 @@ |
|||
<template> |
|||
<component :is="type" v-bind="linkProps(to)"> |
|||
<slot /> |
|||
</component> |
|||
</template> |
|||
|
|||
<script> |
|||
import { isExternal } from '@/utils/validate' |
|||
|
|||
export default { |
|||
props: { |
|||
to: { |
|||
type: String, |
|||
required: true |
|||
} |
|||
}, |
|||
computed: { |
|||
isExternal() { |
|||
return isExternal(this.to) |
|||
}, |
|||
type() { |
|||
if (this.isExternal) { |
|||
return 'a' |
|||
} |
|||
return 'router-link' |
|||
} |
|||
}, |
|||
methods: { |
|||
linkProps(to) { |
|||
console.log("to") |
|||
console.log(to) |
|||
console.log("this.isExternal") |
|||
console.log(this.isExternal) |
|||
console.log("this.type") |
|||
console.log(this.type) |
|||
if (this.isExternal) { |
|||
return { |
|||
href: to, |
|||
target: '_blank', |
|||
rel: 'noopener' |
|||
} |
|||
} |
|||
return { |
|||
to: to |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
@ -0,0 +1,82 @@ |
|||
<template> |
|||
<div class="sidebar-logo-container" :class="{'collapse':collapse}"> |
|||
<transition name="sidebarLogoFade"> |
|||
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/"> |
|||
<img v-if="logo" :src="logo" class="sidebar-logo"> |
|||
<h1 v-else class="sidebar-title">{{ title }} </h1> |
|||
</router-link> |
|||
<router-link v-else key="expand" class="sidebar-logo-link" to="/"> |
|||
<img v-if="logo" :src="logo" class="sidebar-logo"> |
|||
<h1 class="sidebar-title">{{ title }} </h1> |
|||
</router-link> |
|||
</transition> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
name: 'SidebarLogo', |
|||
props: { |
|||
collapse: { |
|||
type: Boolean, |
|||
required: true |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
title: 'Vue Admin Template', |
|||
logo: 'https://wpimg.wallstcn.com/69a1c46c-eb1c-4b46-8bd4-e9e686ef5251.png' |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.sidebarLogoFade-enter-active { |
|||
transition: opacity 1.5s; |
|||
} |
|||
|
|||
.sidebarLogoFade-enter, |
|||
.sidebarLogoFade-leave-to { |
|||
opacity: 0; |
|||
} |
|||
|
|||
.sidebar-logo-container { |
|||
position: relative; |
|||
width: 100%; |
|||
height: 50px; |
|||
line-height: 50px; |
|||
background: #2b2f3a; |
|||
text-align: center; |
|||
overflow: hidden; |
|||
|
|||
& .sidebar-logo-link { |
|||
height: 100%; |
|||
width: 100%; |
|||
|
|||
& .sidebar-logo { |
|||
width: 32px; |
|||
height: 32px; |
|||
vertical-align: middle; |
|||
margin-right: 12px; |
|||
} |
|||
|
|||
& .sidebar-title { |
|||
display: inline-block; |
|||
margin: 0; |
|||
color: #fff; |
|||
font-weight: 600; |
|||
line-height: 50px; |
|||
font-size: 14px; |
|||
font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif; |
|||
vertical-align: middle; |
|||
} |
|||
} |
|||
|
|||
&.collapse { |
|||
.sidebar-logo { |
|||
margin-right: 0px; |
|||
} |
|||
} |
|||
} |
|||
</style> |
|||
@ -0,0 +1,95 @@ |
|||
<template> |
|||
<div v-if="!item.hidden"> |
|||
<template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow"> |
|||
<app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path)"> |
|||
<el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}"> |
|||
<item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" /> |
|||
</el-menu-item> |
|||
</app-link> |
|||
</template> |
|||
|
|||
<el-submenu v-else ref="subMenu" :index="resolvePath(item.path)" popper-append-to-body> |
|||
<template slot="title"> |
|||
<item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" /> |
|||
</template> |
|||
<sidebar-item |
|||
v-for="child in item.children" |
|||
:key="child.path" |
|||
:is-nest="true" |
|||
:item="child" |
|||
:base-path="resolvePath(child.path)" |
|||
class="nest-menu" |
|||
/> |
|||
</el-submenu> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import path from 'path' |
|||
import { isExternal } from '@/utils/validate' |
|||
import Item from './Item' |
|||
import AppLink from './Link' |
|||
import FixiOSBug from './FixiOSBug' |
|||
|
|||
export default { |
|||
name: 'SidebarItem', |
|||
components: { Item, AppLink }, |
|||
mixins: [FixiOSBug], |
|||
props: { |
|||
// route object |
|||
item: { |
|||
type: Object, |
|||
required: true |
|||
}, |
|||
isNest: { |
|||
type: Boolean, |
|||
default: false |
|||
}, |
|||
basePath: { |
|||
type: String, |
|||
default: '' |
|||
} |
|||
}, |
|||
data() { |
|||
// To fix https://github.com/PanJiaChen/vue-admin-template/issues/237 |
|||
// TODO: refactor with render function |
|||
this.onlyOneChild = null |
|||
return {} |
|||
}, |
|||
methods: { |
|||
hasOneShowingChild(children = [], parent) { |
|||
const showingChildren = children.filter(item => { |
|||
if (item.hidden) { |
|||
return false |
|||
} else { |
|||
// Temp set(will be used if only has one showing child) |
|||
this.onlyOneChild = item |
|||
return true |
|||
} |
|||
}) |
|||
|
|||
// When there is only one child router, the child router is displayed by default |
|||
if (showingChildren.length === 1) { |
|||
return true |
|||
} |
|||
|
|||
// Show parent if there are no child router to display |
|||
if (showingChildren.length === 0) { |
|||
this.onlyOneChild = { ... parent, path: '', noShowingChildren: true } |
|||
return true |
|||
} |
|||
|
|||
return false |
|||
}, |
|||
resolvePath(routePath) { |
|||
if (isExternal(routePath)) { |
|||
return routePath |
|||
} |
|||
if (isExternal(this.basePath)) { |
|||
return this.basePath |
|||
} |
|||
return path.resolve(this.basePath, routePath) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
@ -0,0 +1,95 @@ |
|||
<template> |
|||
<div> |
|||
<template v-if="hasOneShowingChild(item.child,item) && (!onlyOneChild.child||onlyOneChild.noShowingChildren)&&!item.alwaysShow"> |
|||
<app-link v-if="onlyOneChild.title" :to="resolvePath(onlyOneChild.apiUrl)"> |
|||
<el-menu-item :index="resolvePath(onlyOneChild.apiUrl)" :class="{'submenu-title-noDropdown':!isNest}"> |
|||
<item :title="onlyOneChild.title" /> |
|||
</el-menu-item> |
|||
</app-link> |
|||
</template> |
|||
|
|||
<el-submenu v-else ref="subMenu" :index="resolvePath(item.apiUrl)" popper-append-to-body> |
|||
<template slot="title"> |
|||
<item v-if="item.title" :title="item.title" /> |
|||
</template> |
|||
<sidebar-item |
|||
v-for="child in item.child" |
|||
:key="child.id" |
|||
:is-nest="true" |
|||
:item="child" |
|||
:base-path="resolvePath(child.apiUrl)" |
|||
class="nest-menu" |
|||
/> |
|||
</el-submenu> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import path from 'path' |
|||
import { isExternal } from '@/utils/validate' |
|||
import Item from './Item' |
|||
import AppLink from './Link' |
|||
import FixiOSBug from './FixiOSBug' |
|||
|
|||
export default { |
|||
name: 'SidebarItem', |
|||
components: { Item, AppLink }, |
|||
mixins: [FixiOSBug], |
|||
props: { |
|||
// route object |
|||
item: { |
|||
type: Object, |
|||
required: true |
|||
}, |
|||
isNest: { |
|||
type: Boolean, |
|||
default: false |
|||
}, |
|||
basePath: { |
|||
type: String, |
|||
default: '' |
|||
} |
|||
}, |
|||
data() { |
|||
// To fix https://github.com/PanJiaChen/vue-admin-template/issues/237 |
|||
// TODO: refactor with render function |
|||
this.onlyOneChild = null |
|||
return {} |
|||
}, |
|||
methods: { |
|||
hasOneShowingChild(children = [], parent) { |
|||
const showingChildren = children.filter(item => { |
|||
if (item.hidden) { |
|||
return false |
|||
} else { |
|||
// Temp set(will be used if only has one showing child) |
|||
this.onlyOneChild = item |
|||
return true |
|||
} |
|||
}) |
|||
|
|||
// When there is only one child router, the child router is displayed by default |
|||
if (showingChildren.length === 1) { |
|||
return true |
|||
} |
|||
|
|||
// Show parent if there are no child router to display |
|||
if (showingChildren.length === 0) { |
|||
this.onlyOneChild = { ... parent, path: '', noShowingChildren: true } |
|||
return true |
|||
} |
|||
|
|||
return false |
|||
}, |
|||
resolvePath(routePath) { |
|||
if (isExternal(routePath)) { |
|||
return routePath |
|||
} |
|||
if (isExternal(this.basePath)) { |
|||
return this.basePath |
|||
} |
|||
return path.resolve(this.basePath, routePath) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
@ -0,0 +1,95 @@ |
|||
<template> |
|||
<div :class="{'has-logo':showLogo}"> |
|||
<logo v-if="showLogo" :collapse="isCollapse" /> |
|||
<el-scrollbar wrap-class="scrollbar-wrapper"> |
|||
<!-- <el-menu |
|||
:default-active="activeMenu" |
|||
:collapse="isCollapse" |
|||
:background-color="variables.menuBg" |
|||
:text-color="variables.menuText" |
|||
:unique-opened="false" |
|||
:active-text-color="variables.menuActiveText" |
|||
:collapse-transition="false" |
|||
mode="vertical" |
|||
> |
|||
<sidebar-item v-for="route in menu" :key="route.path" :item="route" :base-path="route.path" /> |
|||
</el-menu> --> |
|||
<!-- <el-menu |
|||
:default-active="activeMenu" |
|||
:collapse="isCollapse" |
|||
:background-color="variables.menuBg" |
|||
:text-color="variables.menuText" |
|||
:unique-opened="false" |
|||
:active-text-color="variables.menuActiveText" |
|||
:collapse-transition="false" |
|||
mode="vertical" |
|||
> |
|||
<sidebar-item v-for="route in menu" :key="route.id" :item="route" :base-path="route.apiUrl" /> |
|||
</el-menu> --> |
|||
<el-menu |
|||
:background-color="variables.menuBg" |
|||
:text-color="variables.menuText" |
|||
:default-active="$route.meta.pageId" |
|||
> |
|||
<template v-for="item in menu"> |
|||
<router-link :to="item.apiUrl" :key="item.id" v-if="item.child.length===0"> |
|||
<el-menu-item :index="item.id.toString()"> |
|||
<i :class="item.icon"></i> |
|||
<span slot="title">{{item.title}}</span> |
|||
</el-menu-item> |
|||
</router-link> |
|||
<subMenu v-else :data="item" :key="item.id"></subMenu> |
|||
</template> |
|||
</el-menu> |
|||
</el-scrollbar> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import subMenu from "./subMenu"; |
|||
import { mapGetters } from 'vuex' |
|||
import Logo from './Logo' |
|||
import SidebarItem from './SidebarItem' |
|||
import variables from '@/styles/variables.scss' |
|||
import { getmenu } from '@/api/user' |
|||
export default { |
|||
components: { SidebarItem, Logo,subMenu }, |
|||
data () { |
|||
return { |
|||
menu:[], |
|||
} |
|||
}, |
|||
async created () { |
|||
console.log(this.$router.options.routes) |
|||
const res = await getmenu() |
|||
this.menu=res.data.list |
|||
}, |
|||
computed: { |
|||
...mapGetters([ |
|||
'sidebar' |
|||
]), |
|||
// routes() { |
|||
// return this.$router.options.routes |
|||
|
|||
// }, |
|||
activeMenu() { |
|||
const route = this.$route |
|||
const { meta, path } = route |
|||
// if set path, the sidebar will highlight the path you set |
|||
if (meta.activeMenu) { |
|||
return meta.activeMenu |
|||
} |
|||
return path |
|||
}, |
|||
showLogo() { |
|||
return this.$store.state.settings.sidebarLogo |
|||
}, |
|||
variables() { |
|||
return variables |
|||
}, |
|||
isCollapse() { |
|||
return !this.sidebar.opened |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
@ -0,0 +1,42 @@ |
|||
<template functional> |
|||
<el-submenu :index="props.data.id.toString()"> |
|||
<template slot="title"> |
|||
<i :class="props.data.icon"></i> |
|||
<span>{{props.data.title}}</span> |
|||
</template> |
|||
<template v-for="item in props.data.child"> |
|||
<app-link :to="item.apiUrl" v-if="item.child.length===0" :key="item.id"> |
|||
<el-menu-item class="subitem" :index="item.id.toString()"> |
|||
<i :class="item.icon"></i> |
|||
<span slot="title">{{item.title}}</span> |
|||
</el-menu-item> |
|||
</app-link> |
|||
<!-- <router-link :to="item.apiUrl" :key="item.id" v-if="item.child.length===0"> |
|||
<el-menu-item class="subitem" :index="item.id.toString()"> |
|||
<i :class="item.icon"></i> |
|||
<span slot="title">{{item.title}}</span> |
|||
</el-menu-item> |
|||
</router-link> --> |
|||
<sub-menu v-else :data="item" :key="item.id"></sub-menu> |
|||
</template> |
|||
</el-submenu> |
|||
</template> |
|||
|
|||
<script> |
|||
import AppLink from './Link' |
|||
export default { |
|||
name: "submenu", |
|||
components: { AppLink }, |
|||
props: { |
|||
data: [Array, Object] |
|||
} |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.el-submenu { |
|||
.el-menu-item { |
|||
padding: 0; |
|||
} |
|||
} |
|||
</style> |
|||
@ -0,0 +1,44 @@ |
|||
<template functional> |
|||
<el-submenu :index="props.data.id.toString()"> |
|||
<template slot="title"> |
|||
<i :class="props.data.icon"></i> |
|||
<span>{{props.data.title}}</span> |
|||
</template> |
|||
<template v-for="item in props.data.child"> |
|||
|
|||
<!-- <router-link :to="item.apiUrl" v-if="item.child.length===0" :key="item.id"> --> |
|||
<router-link :to="{ path: item.apiUrl }" v-if="item.child.length===0" :key="item.id"> |
|||
<el-menu-item class="subitem" :index="item.id.toString()"> |
|||
<i :class="item.icon"></i> |
|||
<span slot="title">{{item.title}}</span> |
|||
</el-menu-item> |
|||
</router-link> |
|||
<!-- <component :is="type" v-bind="linkProps(to)"> |
|||
<slot /> |
|||
</component> --> |
|||
<!-- <applink :to="item.apiUrl" v-if="item.child.length===0" :key="item.id"> |
|||
<el-menu-item class="subitem" :index="item.id.toString()"> |
|||
<i :class="item.icon"></i> |
|||
<span slot="title">{{item.title}}</span> |
|||
</el-menu-item> |
|||
</applink> --> |
|||
<!-- <sub-menu v-else :data="item" :key="item.id"></sub-menu> --> |
|||
<sub-menu v-else :data="item" ></sub-menu> |
|||
</template> |
|||
</el-submenu> |
|||
</template> |
|||
|
|||
<script> |
|||
import applink from '../Sidebar/Link.vue' |
|||
export default { |
|||
name: "submenu", |
|||
components: { applink }, |
|||
props: { |
|||
data: [Array, Object] |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
|
|||
</style> |
|||
@ -0,0 +1,94 @@ |
|||
<template> |
|||
<el-scrollbar ref="scrollContainer" :vertical="false" class="scroll-container" @wheel.native.prevent="handleScroll"> |
|||
<slot /> |
|||
</el-scrollbar> |
|||
</template> |
|||
|
|||
<script> |
|||
const tagAndTagSpacing = 4 // tagAndTagSpacing |
|||
|
|||
export default { |
|||
name: 'ScrollPane', |
|||
data() { |
|||
return { |
|||
left: 0 |
|||
} |
|||
}, |
|||
computed: { |
|||
scrollWrapper() { |
|||
return this.$refs.scrollContainer.$refs.wrap |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.scrollWrapper.addEventListener('scroll', this.emitScroll, true) |
|||
}, |
|||
beforeDestroy() { |
|||
this.scrollWrapper.removeEventListener('scroll', this.emitScroll) |
|||
}, |
|||
methods: { |
|||
handleScroll(e) { |
|||
const eventDelta = e.wheelDelta || -e.deltaY * 40 |
|||
const $scrollWrapper = this.scrollWrapper |
|||
$scrollWrapper.scrollLeft = $scrollWrapper.scrollLeft + eventDelta / 4 |
|||
}, |
|||
emitScroll() { |
|||
this.$emit('scroll') |
|||
}, |
|||
moveToTarget(currentTag) { |
|||
const $container = this.$refs.scrollContainer.$el |
|||
const $containerWidth = $container.offsetWidth |
|||
const $scrollWrapper = this.scrollWrapper |
|||
const tagList = this.$parent.$refs.tag |
|||
|
|||
let firstTag = null |
|||
let lastTag = null |
|||
|
|||
// find first tag and last tag |
|||
if (tagList.length > 0) { |
|||
firstTag = tagList[0] |
|||
lastTag = tagList[tagList.length - 1] |
|||
} |
|||
|
|||
if (firstTag === currentTag) { |
|||
$scrollWrapper.scrollLeft = 0 |
|||
} else if (lastTag === currentTag) { |
|||
$scrollWrapper.scrollLeft = $scrollWrapper.scrollWidth - $containerWidth |
|||
} else { |
|||
// find preTag and nextTag |
|||
const currentIndex = tagList.findIndex(item => item === currentTag) |
|||
const prevTag = tagList[currentIndex - 1] |
|||
const nextTag = tagList[currentIndex + 1] |
|||
|
|||
// the tag's offsetLeft after of nextTag |
|||
const afterNextTagOffsetLeft = nextTag.$el.offsetLeft + nextTag.$el.offsetWidth + tagAndTagSpacing |
|||
|
|||
// the tag's offsetLeft before of prevTag |
|||
const beforePrevTagOffsetLeft = prevTag.$el.offsetLeft - tagAndTagSpacing |
|||
|
|||
if (afterNextTagOffsetLeft > $scrollWrapper.scrollLeft + $containerWidth) { |
|||
$scrollWrapper.scrollLeft = afterNextTagOffsetLeft - $containerWidth |
|||
} else if (beforePrevTagOffsetLeft < $scrollWrapper.scrollLeft) { |
|||
$scrollWrapper.scrollLeft = beforePrevTagOffsetLeft |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.scroll-container { |
|||
white-space: nowrap; |
|||
position: relative; |
|||
overflow: hidden; |
|||
width: 100%; |
|||
::v-deep { |
|||
.el-scrollbar__bar { |
|||
bottom: 0px; |
|||
} |
|||
.el-scrollbar__wrap { |
|||
height: 49px; |
|||
} |
|||
} |
|||
} |
|||
</style> |
|||
@ -0,0 +1,294 @@ |
|||
<template> |
|||
<div id="tags-view-container" class="tags-view-container"> |
|||
<scroll-pane ref="scrollPane" class="tags-view-wrapper" @scroll="handleScroll"> |
|||
<router-link |
|||
v-for="tag in visitedViews" |
|||
ref="tag" |
|||
:key="tag.path" |
|||
:class="isActive(tag)?'active':''" |
|||
:to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }" |
|||
tag="span" |
|||
class="tags-view-item" |
|||
@click.middle.native="!isAffix(tag)?closeSelectedTag(tag):''" |
|||
@contextmenu.prevent.native="openMenu(tag,$event)" |
|||
> |
|||
{{ generateTitle(tag.title) }} |
|||
<span v-if="!isAffix(tag)" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)" /> |
|||
</router-link> |
|||
</scroll-pane> |
|||
<ul v-show="visible" :style="{left:left+'px',top:top+'px'}" class="contextmenu"> |
|||
<li @click="refreshSelectedTag(selectedTag)">{{ $t('tagsView.refresh') }}</li> |
|||
<li v-if="!isAffix(selectedTag)" @click="closeSelectedTag(selectedTag)">{{ $t('tagsView.close') }}</li> |
|||
<li @click="closeOthersTags">{{ $t('tagsView.closeOthers') }}</li> |
|||
<li @click="closeAllTags(selectedTag)">{{ $t('tagsView.closeAll') }}</li> |
|||
</ul> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import ScrollPane from './ScrollPane' |
|||
import { generateTitle } from '@/utils/i18n' |
|||
import path from 'path' |
|||
|
|||
export default { |
|||
components: { ScrollPane }, |
|||
data() { |
|||
return { |
|||
visible: false, |
|||
top: 0, |
|||
left: 0, |
|||
selectedTag: {}, |
|||
affixTags: [] |
|||
} |
|||
}, |
|||
computed: { |
|||
visitedViews() { |
|||
return this.$store.state.tagsView.visitedViews |
|||
}, |
|||
routes() { |
|||
return this.$store.state.permission.routes |
|||
} |
|||
}, |
|||
watch: { |
|||
$route() { |
|||
this.addTags() |
|||
this.moveToCurrentTag() |
|||
}, |
|||
visible(value) { |
|||
if (value) { |
|||
document.body.addEventListener('click', this.closeMenu) |
|||
} else { |
|||
document.body.removeEventListener('click', this.closeMenu) |
|||
} |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.initTags() |
|||
this.addTags() |
|||
}, |
|||
methods: { |
|||
generateTitle, // generateTitle by vue-i18n |
|||
isActive(route) { |
|||
return route.path === this.$route.path |
|||
}, |
|||
isAffix(tag) { |
|||
return tag.meta && tag.meta.affix |
|||
}, |
|||
filterAffixTags(routes, basePath = '/') { |
|||
let tags = [] |
|||
routes.forEach(route => { |
|||
if (route.meta && route.meta.affix) { |
|||
const tagPath = path.resolve(basePath, route.path) |
|||
tags.push({ |
|||
fullPath: tagPath, |
|||
path: tagPath, |
|||
name: route.name, |
|||
meta: { ...route.meta } |
|||
}) |
|||
} |
|||
if (route.children) { |
|||
const tempTags = this.filterAffixTags(route.children, route.path) |
|||
if (tempTags.length >= 1) { |
|||
tags = [...tags, ...tempTags] |
|||
} |
|||
} |
|||
}) |
|||
return tags |
|||
}, |
|||
initTags() { |
|||
const affixTags = this.affixTags = this.filterAffixTags(this.routes) |
|||
for (const tag of affixTags) { |
|||
// Must have tag name |
|||
if (tag.name) { |
|||
this.$store.dispatch('tagsView/addVisitedView', tag) |
|||
} |
|||
} |
|||
}, |
|||
addTags() { |
|||
const { name } = this.$route |
|||
if (name) { |
|||
this.$store.dispatch('tagsView/addView', this.$route) |
|||
} |
|||
return false |
|||
}, |
|||
moveToCurrentTag() { |
|||
const tags = this.$refs.tag |
|||
this.$nextTick(() => { |
|||
for (const tag of tags) { |
|||
if (tag.to.path === this.$route.path) { |
|||
this.$refs.scrollPane.moveToTarget(tag) |
|||
// when query is different then update |
|||
if (tag.to.fullPath !== this.$route.fullPath) { |
|||
this.$store.dispatch('tagsView/updateVisitedView', this.$route) |
|||
} |
|||
break |
|||
} |
|||
} |
|||
}) |
|||
}, |
|||
refreshSelectedTag(view) { |
|||
this.$store.dispatch('tagsView/delCachedView', view).then(() => { |
|||
const { fullPath } = view |
|||
this.$nextTick(() => { |
|||
this.$router.replace({ |
|||
path: '/redirect' + fullPath |
|||
}) |
|||
}) |
|||
}) |
|||
}, |
|||
closeSelectedTag(view) { |
|||
this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => { |
|||
if (this.isActive(view)) { |
|||
this.toLastView(visitedViews, view) |
|||
} |
|||
}) |
|||
}, |
|||
closeOthersTags() { |
|||
this.$router.push(this.selectedTag) |
|||
this.$store.dispatch('tagsView/delOthersViews', this.selectedTag).then(() => { |
|||
this.moveToCurrentTag() |
|||
}) |
|||
}, |
|||
closeAllTags(view) { |
|||
this.$store.dispatch('tagsView/delAllViews').then(({ visitedViews }) => { |
|||
if (this.affixTags.some(tag => tag.path === view.path)) { |
|||
return |
|||
} |
|||
this.toLastView(visitedViews, view) |
|||
}) |
|||
}, |
|||
toLastView(visitedViews, view) { |
|||
const latestView = visitedViews.slice(-1)[0] |
|||
if (latestView) { |
|||
this.$router.push(latestView.fullPath) |
|||
} else { |
|||
// now the default is to redirect to the home page if there is no tags-view, |
|||
// you can adjust it according to your needs. |
|||
if (view.name === 'Dashboard') { |
|||
// to reload home page |
|||
this.$router.replace({ path: '/redirect' + view.fullPath }) |
|||
} else { |
|||
this.$router.push('/') |
|||
} |
|||
} |
|||
}, |
|||
openMenu(tag, e) { |
|||
const menuMinWidth = 105 |
|||
const offsetLeft = this.$el.getBoundingClientRect().left // container margin left |
|||
const offsetWidth = this.$el.offsetWidth // container width |
|||
const maxLeft = offsetWidth - menuMinWidth // left boundary |
|||
const left = e.clientX - offsetLeft + 15 // 15: margin right |
|||
|
|||
if (left > maxLeft) { |
|||
this.left = maxLeft |
|||
} else { |
|||
this.left = left |
|||
} |
|||
|
|||
this.top = e.clientY |
|||
this.visible = true |
|||
this.selectedTag = tag |
|||
}, |
|||
closeMenu() { |
|||
this.visible = false |
|||
}, |
|||
handleScroll() { |
|||
this.closeMenu() |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.tags-view-container { |
|||
height: 34px; |
|||
width: 100%; |
|||
background: #fff; |
|||
border-bottom: 1px solid #d8dce5; |
|||
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .12), 0 0 3px 0 rgba(0, 0, 0, .04); |
|||
.tags-view-wrapper { |
|||
.tags-view-item { |
|||
display: inline-block; |
|||
position: relative; |
|||
cursor: pointer; |
|||
height: 26px; |
|||
line-height: 26px; |
|||
border: 1px solid #d8dce5; |
|||
color: #495060; |
|||
background: #fff; |
|||
padding: 0 8px; |
|||
font-size: 12px; |
|||
margin-left: 5px; |
|||
margin-top: 4px; |
|||
&:first-of-type { |
|||
margin-left: 15px; |
|||
} |
|||
&:last-of-type { |
|||
margin-right: 15px; |
|||
} |
|||
&.active { |
|||
background-color: #42b983; |
|||
color: #fff; |
|||
border-color: #42b983; |
|||
&::before { |
|||
content: ''; |
|||
background: #fff; |
|||
display: inline-block; |
|||
width: 8px; |
|||
height: 8px; |
|||
border-radius: 50%; |
|||
position: relative; |
|||
margin-right: 2px; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
.contextmenu { |
|||
margin: 0; |
|||
background: #fff; |
|||
z-index: 3000; |
|||
position: absolute; |
|||
list-style-type: none; |
|||
padding: 5px 0; |
|||
border-radius: 4px; |
|||
font-size: 12px; |
|||
font-weight: 400; |
|||
color: #333; |
|||
box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, .3); |
|||
li { |
|||
margin: 0; |
|||
padding: 7px 16px; |
|||
cursor: pointer; |
|||
&:hover { |
|||
background: #eee; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</style> |
|||
|
|||
<style lang="scss"> |
|||
//reset element css of el-icon-close |
|||
.tags-view-wrapper { |
|||
.tags-view-item { |
|||
.el-icon-close { |
|||
width: 16px; |
|||
height: 16px; |
|||
vertical-align: 2px; |
|||
border-radius: 50%; |
|||
text-align: center; |
|||
transition: all .3s cubic-bezier(.645, .045, .355, 1); |
|||
transform-origin: 100% 50%; |
|||
&:before { |
|||
transform: scale(.6); |
|||
display: inline-block; |
|||
vertical-align: -3px; |
|||
} |
|||
&:hover { |
|||
background-color: #b4bccc; |
|||
color: #fff; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</style> |
|||