diff --git a/anrui-riskcenter-ui/.editorconfig b/anrui-riskcenter-ui/.editorconfig new file mode 100644 index 0000000000..ea6e20f5b2 --- /dev/null +++ b/anrui-riskcenter-ui/.editorconfig @@ -0,0 +1,14 @@ +# http://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +insert_final_newline = false +trim_trailing_whitespace = false diff --git a/anrui-riskcenter-ui/.env.development b/anrui-riskcenter-ui/.env.development new file mode 100644 index 0000000000..284a65afb4 --- /dev/null +++ b/anrui-riskcenter-ui/.env.development @@ -0,0 +1,10 @@ +# just a flag +ENV = 'development' + +# base api +VUE_APP_BASE_API = '/api' + +## 配置测试和本地开发时的 接口地址 +##VUE_APP_URL = "http://26077a35f5.wicp.vip" +VUE_APP_URL = "http://anrui.yyundong.com" + diff --git a/anrui-riskcenter-ui/.env.production b/anrui-riskcenter-ui/.env.production new file mode 100644 index 0000000000..61b8a1dead --- /dev/null +++ b/anrui-riskcenter-ui/.env.production @@ -0,0 +1,9 @@ +# just a flag +ENV = 'production' + +# base api +VUE_APP_BASE_API = '/api' + +## 配置 正式接口地址 +VUE_APP_URL = "http://218.11.12.154:8111" + diff --git a/anrui-riskcenter-ui/.env.staging b/anrui-riskcenter-ui/.env.staging new file mode 100644 index 0000000000..a8793a0989 --- /dev/null +++ b/anrui-riskcenter-ui/.env.staging @@ -0,0 +1,8 @@ +NODE_ENV = production + +# just a flag +ENV = 'staging' + +# base api +VUE_APP_BASE_API = '/stage-api' + diff --git a/anrui-riskcenter-ui/.eslintignore b/anrui-riskcenter-ui/.eslintignore new file mode 100644 index 0000000000..e6529fc09c --- /dev/null +++ b/anrui-riskcenter-ui/.eslintignore @@ -0,0 +1,4 @@ +build/*.js +src/assets +public +dist diff --git a/anrui-riskcenter-ui/.eslintrc.js b/anrui-riskcenter-ui/.eslintrc.js new file mode 100644 index 0000000000..bb624b1ca3 --- /dev/null +++ b/anrui-riskcenter-ui/.eslintrc.js @@ -0,0 +1,199 @@ +module.exports = { + root: true, + parserOptions: { + parser: 'babel-eslint', + sourceType: 'module' + }, + 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 + // }], + 'indent': 'off', + 'jsx-quotes': [2, 'prefer-single'], + 'key-spacing': [2, { + 'beforeColon': false, + 'afterColon': true + }], + 'keyword-spacing': [2, { + 'before': true, + 'after': true + }], + 'new-cap': [2, { + 'newIsCap': true, + 'capIsNew': false + }], + 'new-parens': 2, + 'no-array-constructor': 2, + 'no-caller': 2, + 'no-console': 'off', + 'no-class-assign': 2, + 'no-cond-assign': 2, + 'no-const-assign': 2, + 'no-control-regex': 0, + 'no-delete-var': 2, + 'no-dupe-args': 2, + 'no-dupe-class-members': 2, + 'no-dupe-keys': 2, + 'no-duplicate-case': 2, + 'no-empty-character-class': 2, + 'no-empty-pattern': 2, + 'no-eval': 2, + 'no-ex-assign': 2, + 'no-extend-native': 2, + 'no-extra-bind': 2, + 'no-extra-boolean-cast': 2, + 'no-extra-parens': [2, 'functions'], + 'no-fallthrough': 2, + 'no-floating-decimal': 2, + 'no-func-assign': 2, + 'no-implied-eval': 2, + 'no-inner-declarations': [2, 'functions'], + 'no-invalid-regexp': 2, + 'no-irregular-whitespace': 2, + 'no-iterator': 2, + 'no-label-var': 2, + 'no-labels': [2, { + 'allowLoop': false, + 'allowSwitch': false + }], + 'no-lone-blocks': 2, + 'no-mixed-spaces-and-tabs': 2, + 'no-multi-spaces': 2, + 'no-multi-str': 2, + 'no-multiple-empty-lines': [2, { + 'max': 1 + }], + 'no-native-reassign': 2, + 'no-negated-in-lhs': 2, + 'no-new-object': 2, + 'no-new-require': 2, + 'no-new-symbol': 2, + 'no-new-wrappers': 2, + 'no-obj-calls': 2, + 'no-octal': 2, + 'no-octal-escape': 2, + 'no-path-concat': 2, + 'no-proto': 2, + 'no-redeclare': 2, + 'no-regex-spaces': 2, + 'no-return-assign': [2, 'except-parens'], + 'no-self-assign': 2, + 'no-self-compare': 2, + 'no-sequences': 2, + 'no-shadow-restricted-names': 2, + 'no-spaced-func': 2, + 'no-sparse-arrays': 2, + 'no-this-before-super': 2, + 'no-throw-literal': 2, + 'no-trailing-spaces': 2, + 'no-undef': 2, + 'no-undef-init': 2, + 'no-unexpected-multiline': 2, + 'no-unmodified-loop-condition': 2, + 'no-unneeded-ternary': [2, { + 'defaultAssignment': false + }], + 'no-unreachable': 2, + 'no-unsafe-finally': 2, + 'no-unused-vars': [2, { + 'vars': 'all', + 'args': 'none' + }], + 'no-useless-call': 2, + 'no-useless-computed-key': 2, + 'no-useless-constructor': 2, + 'no-useless-escape': 0, + 'no-whitespace-before-property': 2, + 'no-with': 2, + 'one-var': [2, { + 'initialized': 'never' + }], + 'operator-linebreak': [2, 'after', { + 'overrides': { + '?': 'before', + ':': 'before' + } + }], + 'padded-blocks': [2, 'never'], + 'quotes': [2, 'single', { + 'avoidEscape': true, + 'allowTemplateLiterals': true + }], + 'semi': [2, 'never'], + 'semi-spacing': [2, { + 'before': false, + 'after': true + }], + 'space-before-blocks': [2, 'always'], + 'space-before-function-paren': [2, 'never'], + 'space-in-parens': [2, 'never'], + 'space-infix-ops': 2, + 'space-unary-ops': [2, { + 'words': true, + 'nonwords': false + }], + 'spaced-comment': [2, 'always', { + 'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ','] + }], + 'template-curly-spacing': [2, 'never'], + 'use-isnan': 2, + 'valid-typeof': 2, + 'wrap-iife': [2, 'any'], + 'yield-star-spacing': [2, 'both'], + 'yoda': [2, 'never'], + 'prefer-const': 2, + 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, + 'object-curly-spacing': [2, 'always', { + objectsInObjects: false + }], + 'array-bracket-spacing': [2, 'never'] + } +} diff --git a/anrui-riskcenter-ui/.gitignore b/anrui-riskcenter-ui/.gitignore new file mode 100644 index 0000000000..9ad28d23dd --- /dev/null +++ b/anrui-riskcenter-ui/.gitignore @@ -0,0 +1,16 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json +tests/**/coverage/ + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/anrui-riskcenter-ui/.project b/anrui-riskcenter-ui/.project new file mode 100644 index 0000000000..a7648aaa62 --- /dev/null +++ b/anrui-riskcenter-ui/.project @@ -0,0 +1,28 @@ + + + anrui-system-ui + + + + + + com.aptana.ide.core.unifiedBuilder + + + + + + com.aptana.projects.webnature + + + + 1629107336958 + + 26 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-node_modules + + + + diff --git a/anrui-riskcenter-ui/.travis.yml b/anrui-riskcenter-ui/.travis.yml new file mode 100644 index 0000000000..f4be7a0855 --- /dev/null +++ b/anrui-riskcenter-ui/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: 10 +script: npm run test +notifications: + email: false diff --git a/anrui-riskcenter-ui/LICENSE b/anrui-riskcenter-ui/LICENSE new file mode 100644 index 0000000000..61515750df --- /dev/null +++ b/anrui-riskcenter-ui/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017-present PanJiaChen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/anrui-riskcenter-ui/README-zh.md b/anrui-riskcenter-ui/README-zh.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/anrui-riskcenter-ui/README.md b/anrui-riskcenter-ui/README.md new file mode 100644 index 0000000000..a2f3c71543 --- /dev/null +++ b/anrui-riskcenter-ui/README.md @@ -0,0 +1,90 @@ +# vue-admin-template + +English | [简体中文](./README-zh.md) + +> A minimal vue admin template with Element UI & axios & iconfont & permission control & lint + +**Live demo:** http://panjiachen.github.io/vue-admin-template + + +**The current version is `v4.0+` build on `vue-cli`. If you want to use the old version , you can switch branch to [tag/3.11.0](https://github.com/PanJiaChen/vue-admin-template/tree/tag/3.11.0), it does not rely on `vue-cli`** + +## Build Setup + +```bash +# clone the project +git clone https://github.com/PanJiaChen/vue-admin-template.git + +# enter the project directory +cd vue-admin-template + +# install dependency +npm install + +# develop +npm run dev +``` + +This will automatically open http://localhost:9528 + +## Build + +```bash +# build for test environment +npm run build:stage + +# build for production environment +npm run build:prod +``` + +## Advanced + +```bash +# preview the release environment effect +npm run preview + +# preview the release environment effect + static resource analysis +npm run preview -- --report + +# code format check +npm run lint + +# code format check and auto fix +npm run lint -- --fix +``` + +Refer to [Documentation](https://panjiachen.github.io/vue-element-admin-site/guide/essentials/deploy.html) for more information + +## Demo + + + +## Extra + +If you want router permission && generate menu by user roles , you can use this branch [permission-control](https://github.com/PanJiaChen/vue-admin-template/tree/permission-control) + +For `typescript` version, you can use [vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template) (Credits: [@Armour](https://github.com/Armour)) + +## Related Project + +- [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) + +## Browsers support + +Modern browsers and Internet Explorer 10+. + +| [](http://godban.github.io/browsers-support-badges/)IE / Edge | [](http://godban.github.io/browsers-support-badges/)Firefox | [](http://godban.github.io/browsers-support-badges/)Chrome | [](http://godban.github.io/browsers-support-badges/)Safari | +| --------- | --------- | --------- | --------- | +| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions + +## License + +[MIT](https://github.com/PanJiaChen/vue-admin-template/blob/master/LICENSE) license. + +Copyright (c) 2017-present PanJiaChen diff --git a/anrui-riskcenter-ui/babel.config.js b/anrui-riskcenter-ui/babel.config.js new file mode 100644 index 0000000000..fb82b2715f --- /dev/null +++ b/anrui-riskcenter-ui/babel.config.js @@ -0,0 +1,14 @@ +module.exports = { + presets: [ + // https://github.com/vuejs/vue-cli/tree/master/packages/@vue/babel-preset-app + '@vue/cli-plugin-babel/preset' + ], + 'env': { + 'development': { + // babel-plugin-dynamic-import-node plugin only does one thing by converting all import() to require(). + // This plugin can significantly increase the speed of hot updates, when you have a large number of pages. + // https://panjiachen.github.io/vue-element-admin-site/guide/advanced/lazy-loading.html + 'plugins': ['dynamic-import-node'] + } + } +} diff --git a/anrui-riskcenter-ui/build/index.js b/anrui-riskcenter-ui/build/index.js new file mode 100644 index 0000000000..0c57de2aad --- /dev/null +++ b/anrui-riskcenter-ui/build/index.js @@ -0,0 +1,35 @@ +const { run } = require('runjs') +const chalk = require('chalk') +const config = require('../vue.config.js') +const rawArgv = process.argv.slice(2) +const args = rawArgv.join(' ') + +if (process.env.npm_config_preview || rawArgv.includes('--preview')) { + const report = rawArgv.includes('--report') + + run(`vue-cli-service build ${args}`) + + const port = 9526 + const publicPath = config.publicPath + + var connect = require('connect') + var serveStatic = require('serve-static') + const app = connect() + + app.use( + publicPath, + serveStatic('./dist', { + index: ['index.html', '/'] + }) + ) + + app.listen(port, function () { + console.log(chalk.green(`> Preview at http://localhost:${port}${publicPath}`)) + if (report) { + console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`)) + } + + }) +} else { + run(`vue-cli-service build ${args}`) +} diff --git a/anrui-riskcenter-ui/jest.config.js b/anrui-riskcenter-ui/jest.config.js new file mode 100644 index 0000000000..143cdc868c --- /dev/null +++ b/anrui-riskcenter-ui/jest.config.js @@ -0,0 +1,24 @@ +module.exports = { + moduleFileExtensions: ['js', 'jsx', 'json', 'vue'], + transform: { + '^.+\\.vue$': 'vue-jest', + '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': + 'jest-transform-stub', + '^.+\\.jsx?$': 'babel-jest' + }, + moduleNameMapper: { + '^@/(.*)$': '/src/$1' + }, + snapshotSerializers: ['jest-serializer-vue'], + testMatch: [ + '**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)' + ], + collectCoverageFrom: ['src/utils/**/*.{js,vue}', '!src/utils/auth.js', '!src/utils/request.js', 'src/components/**/*.{js,vue}'], + coverageDirectory: '/tests/unit/coverage', + // 'collectCoverage': true, + 'coverageReporters': [ + 'lcov', + 'text-summary' + ], + testURL: 'http://localhost/' +} diff --git a/anrui-riskcenter-ui/jsconfig.json b/anrui-riskcenter-ui/jsconfig.json new file mode 100644 index 0000000000..ed079e2b9b --- /dev/null +++ b/anrui-riskcenter-ui/jsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "baseUrl": "./", + "paths": { + "@/*": ["src/*"] + } + }, + "exclude": ["node_modules", "dist"] +} diff --git a/anrui-riskcenter-ui/mock/index.js b/anrui-riskcenter-ui/mock/index.js new file mode 100644 index 0000000000..c514c13573 --- /dev/null +++ b/anrui-riskcenter-ui/mock/index.js @@ -0,0 +1,57 @@ +const Mock = require('mockjs') +const { param2Obj } = require('./utils') + +const user = require('./user') +const table = require('./table') + +const mocks = [ + ...user, + ...table +] + +// for front mock +// please use it cautiously, it will redefine XMLHttpRequest, +// which will cause many of your third-party libraries to be invalidated(like progress event). +function mockXHR() { + // mock patch + // https://github.com/nuysoft/Mock/issues/300 + Mock.XHR.prototype.proxy_send = Mock.XHR.prototype.send + Mock.XHR.prototype.send = function() { + if (this.custom.xhr) { + this.custom.xhr.withCredentials = this.withCredentials || false + + if (this.responseType) { + this.custom.xhr.responseType = this.responseType + } + } + this.proxy_send(...arguments) + } + + function XHR2ExpressReqWrap(respond) { + return function(options) { + let result = null + if (respond instanceof Function) { + const { body, type, url } = options + // https://expressjs.com/en/4x/api.html#req + result = respond({ + method: type, + body: JSON.parse(body), + query: param2Obj(url) + }) + } else { + result = respond + } + return Mock.mock(result) + } + } + + for (const i of mocks) { + Mock.mock(new RegExp(i.url), i.type || 'get', XHR2ExpressReqWrap(i.response)) + } +} + +module.exports = { + mocks, + mockXHR +} + diff --git a/anrui-riskcenter-ui/mock/mock-server.js b/anrui-riskcenter-ui/mock/mock-server.js new file mode 100644 index 0000000000..8941ec0f80 --- /dev/null +++ b/anrui-riskcenter-ui/mock/mock-server.js @@ -0,0 +1,81 @@ +const chokidar = require('chokidar') +const bodyParser = require('body-parser') +const chalk = require('chalk') +const path = require('path') +const Mock = require('mockjs') + +const mockDir = path.join(process.cwd(), 'mock') + +function registerRoutes(app) { + let mockLastIndex + const { mocks } = require('./index.js') + const mocksForServer = mocks.map(route => { + return responseFake(route.url, route.type, route.response) + }) + for (const mock of mocksForServer) { + app[mock.type](mock.url, mock.response) + mockLastIndex = app._router.stack.length + } + const mockRoutesLength = Object.keys(mocksForServer).length + return { + mockRoutesLength: mockRoutesLength, + mockStartIndex: mockLastIndex - mockRoutesLength + } +} + +function unregisterRoutes() { + Object.keys(require.cache).forEach(i => { + if (i.includes(mockDir)) { + delete require.cache[require.resolve(i)] + } + }) +} + +// for mock server +const responseFake = (url, type, respond) => { + return { + url: new RegExp(`${process.env.VUE_APP_BASE_API}${url}`), + type: type || 'get', + response(req, res) { + console.log('request invoke:' + req.path) + res.json(Mock.mock(respond instanceof Function ? respond(req, res) : respond)) + } + } +} + +module.exports = app => { + // parse app.body + // https://expressjs.com/en/4x/api.html#req.body + app.use(bodyParser.json()) + app.use(bodyParser.urlencoded({ + extended: true + })) + + const mockRoutes = registerRoutes(app) + var mockRoutesLength = mockRoutes.mockRoutesLength + var mockStartIndex = mockRoutes.mockStartIndex + + // watch files, hot reload mock server + chokidar.watch(mockDir, { + ignored: /mock-server/, + ignoreInitial: true + }).on('all', (event, path) => { + if (event === 'change' || event === 'add') { + try { + // remove mock routes stack + app._router.stack.splice(mockStartIndex, mockRoutesLength) + + // clear routes cache + unregisterRoutes() + + const mockRoutes = registerRoutes(app) + mockRoutesLength = mockRoutes.mockRoutesLength + mockStartIndex = mockRoutes.mockStartIndex + + console.log(chalk.magentaBright(`\n > Mock Server hot reload success! changed ${path}`)) + } catch (error) { + console.log(chalk.redBright(error)) + } + } + }) +} diff --git a/anrui-riskcenter-ui/mock/table.js b/anrui-riskcenter-ui/mock/table.js new file mode 100644 index 0000000000..bd0e0133e1 --- /dev/null +++ b/anrui-riskcenter-ui/mock/table.js @@ -0,0 +1,29 @@ +const Mock = require('mockjs') + +const data = Mock.mock({ + 'items|30': [{ + id: '@id', + title: '@sentence(10, 20)', + 'status|1': ['published', 'draft', 'deleted'], + author: 'name', + display_time: '@datetime', + pageviews: '@integer(300, 5000)' + }] +}) + +module.exports = [ + { + url: '/vue-admin-template/table/list', + type: 'get', + response: config => { + const items = data.items + return { + code: 20000, + data: { + total: items.length, + items: items + } + } + } + } +] diff --git a/anrui-riskcenter-ui/mock/user.js b/anrui-riskcenter-ui/mock/user.js new file mode 100644 index 0000000000..7555338562 --- /dev/null +++ b/anrui-riskcenter-ui/mock/user.js @@ -0,0 +1,84 @@ + +const tokens = { + admin: { + token: 'admin-token' + }, + editor: { + token: 'editor-token' + } +} + +const users = { + 'admin-token': { + roles: ['admin'], + introduction: 'I am a super administrator', + avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif', + name: 'Super Admin' + }, + 'editor-token': { + roles: ['editor'], + introduction: 'I am an editor', + avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif', + name: 'Normal Editor' + } +} + +module.exports = [ + // user login + { + url: '/vue-admin-template/user/login', + type: 'post', + response: config => { + const { username } = config.body + const token = tokens[username] + + // mock error + if (!token) { + return { + code: 60204, + message: 'Account and password are incorrect.' + } + } + + return { + code: 20000, + data: token + } + } + }, + + // get user info + { + url: '/vue-admin-template/user/info\.*', + type: 'get', + response: config => { + const { token } = config.query + const info = users[token] + + // mock error + if (!info) { + return { + code: 50008, + message: 'Login failed, unable to get user details.' + } + } + + return { + code: 20000, + data: info + } + } + }, + + // user logout + { + url: '/vue-admin-template/user/logout', + type: 'post', + response: _ => { + return { + code: 20000, + data: 'success' + } + } + } +] diff --git a/anrui-riskcenter-ui/mock/utils.js b/anrui-riskcenter-ui/mock/utils.js new file mode 100644 index 0000000000..95cc27d5fe --- /dev/null +++ b/anrui-riskcenter-ui/mock/utils.js @@ -0,0 +1,25 @@ +/** + * @param {string} url + * @returns {Object} + */ +function param2Obj(url) { + const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ') + if (!search) { + return {} + } + const obj = {} + const searchArr = search.split('&') + searchArr.forEach(v => { + const index = v.indexOf('=') + if (index !== -1) { + const name = v.substring(0, index) + const val = v.substring(index + 1, v.length) + obj[name] = val + } + }) + return obj +} + +module.exports = { + param2Obj +} diff --git a/anrui-riskcenter-ui/package.json b/anrui-riskcenter-ui/package.json new file mode 100644 index 0000000000..48c94f7525 --- /dev/null +++ b/anrui-riskcenter-ui/package.json @@ -0,0 +1,69 @@ +{ + "name": "admin-template", + "version": "4.4.0", + "description": "A vue admin template with Element UI & axios & iconfont & permission control & lint", + "author": "Pan ", + "scripts": { + "dev": "vue-cli-service serve", + "build:prod": "vue-cli-service build", + "build:stage": "vue-cli-service build --mode staging", + "preview": "node build/index.js --preview", + "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml", + "lint": "eslint --ext .js,.vue src", + "test:unit": "jest --clearCache && vue-cli-service test:unit", + "test:ci": "npm run lint && npm run test:unit" + }, + "dependencies": { + "axios": "0.18.1", + "core-js": "^3.22.5", + "element-ui": "2.13.2", + "js-cookie": "2.2.0", + "normalize.css": "7.0.0", + "nprogress": "0.2.0", + "path-to-regexp": "2.4.0", + "portfinder": "^1.0.21", + "qs": "^6.9.4", + "sass-resources-loader": "^2.1.1", + "viewerjs": "^1.9.0", + "vue": "2.6.10", + "vue-amap": "^0.5.10", + "vue-router": "3.0.6", + "vuex": "3.1.0", + "vuex-persistedstate": "^4.0.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", + "babel-polyfill": "^6.26.0", + "chalk": "2.4.2", + "connect": "3.6.6", + "eslint": "6.7.2", + "eslint-plugin-vue": "6.2.2", + "html-webpack-plugin": "3.2.0", + "mockjs": "1.0.1-beta3", + "runjs": "4.3.2", + "sass": "1.26.8", + "sass-loader": "8.0.2", + "script-ext-html-webpack-plugin": "2.1.3", + "serve-static": "1.13.2", + "svg-sprite-loader": "4.1.3", + "svgo": "1.2.2", + "vue-template-compiler": "2.6.10" + }, + "browserslist": [ + "> 1%", + "last 2 versions" + ], + "engines": { + "node": ">=8.9", + "npm": ">= 3.0.0" + }, + "license": "MIT" +} diff --git a/anrui-riskcenter-ui/postcss.config.js b/anrui-riskcenter-ui/postcss.config.js new file mode 100644 index 0000000000..10473efcf8 --- /dev/null +++ b/anrui-riskcenter-ui/postcss.config.js @@ -0,0 +1,8 @@ +// https://github.com/michael-ciniawsky/postcss-load-config + +module.exports = { + 'plugins': { + // to edit target browsers: use "browserslist" field in package.json + 'autoprefixer': {} + } +} diff --git a/anrui-riskcenter-ui/public/favicon.ico b/anrui-riskcenter-ui/public/favicon.ico new file mode 100644 index 0000000000..34b63ac63a Binary files /dev/null and b/anrui-riskcenter-ui/public/favicon.ico differ diff --git a/anrui-riskcenter-ui/public/image/liuchengtu.jpg b/anrui-riskcenter-ui/public/image/liuchengtu.jpg new file mode 100644 index 0000000000..8d891be497 Binary files /dev/null and b/anrui-riskcenter-ui/public/image/liuchengtu.jpg differ diff --git a/anrui-riskcenter-ui/public/index.html b/anrui-riskcenter-ui/public/index.html new file mode 100644 index 0000000000..fa2be9164a --- /dev/null +++ b/anrui-riskcenter-ui/public/index.html @@ -0,0 +1,17 @@ + + + + + + + + <%= webpackConfig.name %> + + + + We're sorry but <%= webpackConfig.name %> doesn't work properly without JavaScript enabled. Please enable it to continue. + + + + + diff --git a/anrui-riskcenter-ui/src/App.vue b/anrui-riskcenter-ui/src/App.vue new file mode 100644 index 0000000000..c65a59abd6 --- /dev/null +++ b/anrui-riskcenter-ui/src/App.vue @@ -0,0 +1,14 @@ + + + + + + + diff --git a/anrui-riskcenter-ui/src/api/Common/Upload.js b/anrui-riskcenter-ui/src/api/Common/Upload.js new file mode 100644 index 0000000000..7a22ad1aed --- /dev/null +++ b/anrui-riskcenter-ui/src/api/Common/Upload.js @@ -0,0 +1,20 @@ +import request from '@/utils/request' +// 上传图片 +export function imageUpload(data){ + return request({ + url: '/jlcyry/file/upload', + method: 'post', + data, + headers:{'Content-Type':'multipart/form-data'} + }) +} +// export function uploadFile(data){ +// return request({ +// url: '/portal/file/upload', +// method: 'post', +// data, +// headers:{'Content-Type':'multipart/form-data'} +// }) +// } +// +export const uploadFile = '/api/portal/file/upload' \ No newline at end of file diff --git a/anrui-riskcenter-ui/src/api/Common/areaPicker.js b/anrui-riskcenter-ui/src/api/Common/areaPicker.js new file mode 100644 index 0000000000..ed87a6bf8d --- /dev/null +++ b/anrui-riskcenter-ui/src/api/Common/areaPicker.js @@ -0,0 +1,49 @@ +import request from '@/utils/request' + +//区域获取省 +// export function getProvince(data) { +// return request({ +// url: '/system/region/getProvince', +// method: 'get' +// }) +// } +// //根据省sid获取该省的所有市 +// export function getCity(data) { +// return request({ +// url: '/system/region/getCity', +// method: 'get', +// params: data +// }) +// } +// //根据市sid获取该市的所有县区 +// export function getCounty(data) { +// return request({ +// url: '/system/region/getCounty', +// method: 'get', +// params: data +// }) +// } +// 获取省/portal/v1/regions/getProvince +export function getProvince(data) { + return request({ + url: '/portal/v1/regions/getProvince',data, + method: 'get', + params:data, + }) +} +// 根据省sid获取该省的所有市 +export function getCity(data) { + return request({ + url: '/portal/v1/regions/getCity', + params:data, + method: 'get', + }) +} +// 根据市sid获取该市的所有县区 +export function getCounty(data) { + return request({ + url: '/portal/v1/regions/getCounty', + method: 'get', + params:data, + }) +} diff --git a/anrui-riskcenter-ui/src/api/Common/permission.js b/anrui-riskcenter-ui/src/api/Common/permission.js new file mode 100644 index 0000000000..5c3b5622ca --- /dev/null +++ b/anrui-riskcenter-ui/src/api/Common/permission.js @@ -0,0 +1,13 @@ +import request from '@/utils/request' +// 请求按钮权限 +export default { + + // 查询分页列表,输入当前路径和userSid,返回 + buttonPermission: function(params) { + return request({ + url: '/demopackage/v1/demo/buttonPermission', + method: 'post', + data: params + }) + } +} diff --git a/anrui-riskcenter-ui/src/api/User/login.js b/anrui-riskcenter-ui/src/api/User/login.js new file mode 100644 index 0000000000..ef4554b83a --- /dev/null +++ b/anrui-riskcenter-ui/src/api/User/login.js @@ -0,0 +1,36 @@ +import request from '@/utils/request' +import qs from 'qs' + +class user { + login(data) { // 登录 + return request({ + url: '/system/user/login', + method: 'post', + data + }) + } + logout(data) { // 退出 + return request({ + url: '/portal/v1/sysuser/signOut', + method: 'post', + data: qs.stringify(data) + }) + } + updatePassword(data) { // 退出修改密码 + return request({ + url: '/portal/v1/sysuser/updatePassword', + method: 'post', + data: qs.stringify(data) + }) + } + reGetPwd(data){ + return request({ + url: `/system/user/reGetPwd/${data.userName}/${data.userPhone}`, + method: 'post', + data: qs.stringify(data) + }) + } + +} + +export default new user() \ No newline at end of file diff --git a/anrui-riskcenter-ui/src/api/management/yuangongguanli.js b/anrui-riskcenter-ui/src/api/management/yuangongguanli.js new file mode 100644 index 0000000000..d9c1d00a61 --- /dev/null +++ b/anrui-riskcenter-ui/src/api/management/yuangongguanli.js @@ -0,0 +1,116 @@ +import request from '@/utils/request' +// import qs from 'qs' +// 其他入库单 + +export default { + // 查询分页列表 + listPage: function(params) { + return request({ + url: '/portal/v1/sysstaffinfo/listPage', + method: 'post', + data: params, + headers: { 'Content-Type': 'application/json' } + }) + }, + // 保存新增记录 + saveAdd: function(params) { + return request({ + url: '/portal/v1/sysstaffinfo/save', + method: 'post', + data: params, + headers: { 'Content-Type': 'application/json' } + }) + }, + // 保存修改记录 + saveEdit: function(params,sid) { + console.log('bianjiebaocunjiekou',sid) + return request({ + url: '/portal/v1/sysstaffinfo/update/' + sid, + method: 'post', + data: params, + headers: { 'Content-Type': 'application/json' } + }) + }, + // 通过sid删除一条或多条记录 + delBySids: function(data) { + return request({ + url: '/base/v1/basedatalist/del_by_sids', + method: 'delete', + data, + headers: { 'Content-Type': 'application/json' } + }) + }, + + // 通过sid删除一条或多条记录 + del: function(data) { + return request({ + url: '/portal/v1/sysstaffinfo/del', + method: 'post', + data: data, + headers: { 'Content-Type': 'application/json' } + }) + }, + // 员工信息编辑初始化及详情 + fetchBySid: function(sid) { + return request({ + url: '/portal/v1/sysstaffinfo/fetchBySid/' + sid, + method: 'get' + }) + }, + + // 获取部门级联 + salesDepName: function(data) { + return request({ + url: '/portal/v1/sysorganization/selectListOrg', + method: 'get', + params: data, + data: data + }) + }, + + // 获取岗位级联 + postName: function(data) { + return request({ + // /portal/v1/syspost/selectByOrgSid/{orgSid} 岗位列表 + url: '/portal/v1/syspost/selectList', + method: 'get', + params: data, + }) + }, + + // 获取下拉列表 + pullDown: function(data) { + return request({ + url: '/portal/v1/dictcommons/typeValues', + method: 'get', + params: data + }) + }, + + // 提交 + doSubmit: function(params) { + return request({ + url: '/anruiscm/v1/scmotherinbound/doSubmit', + method: 'post', + data: params + }) + }, + + // 导入 + importExcel: function(params) { + return request({ + url: '/anruiscm/v1/scmotherinbound/importExcel', + method: 'post', + data: params + }) + }, + + // 导出 + exportExcel: function(params) { + return request({ + url: '/anruiscm/v1/scmotherinbound/exportExcel', + method: 'post', + data: params + }) + } +} diff --git a/anrui-riskcenter-ui/src/api/system/Role/role.js b/anrui-riskcenter-ui/src/api/system/Role/role.js new file mode 100644 index 0000000000..c7fe6d1736 --- /dev/null +++ b/anrui-riskcenter-ui/src/api/system/Role/role.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' +import qs from 'qs' +let tokens = window.sessionStorage.getItem('token'); +// +export function rolemenus(data) { + return request({ + url: '/system/v1/rolemenus/'+data.roleSid, + method: 'get', + params: data + }) +} + +// 获取左侧菜单 +export function getrolemenus(data) { + return request({ + url: '/portal/v1/sysmenu/sourcemenutree', + data: data, + method: 'POST', + async: false, + headers: {'Content-Type': 'application/json'} + }) +} + +// 获取角色的主页菜单 +export function sourcesofrole(data) { + return request({ + url: '/system/v1/rolemenus/sourcesofrole', + method: 'POST', + data: data, + headers: {'Content-Type': 'application/json'} + }) +} + +// 根据token值获取登录后的用户信息 +export function loginDetails(data) { + return request({ + url: '/portal/v1/sysuser/loginDetails', + method: 'post', + data: data, + headers: { + 'Content-Type': 'application/json' + } + }) +} diff --git a/anrui-riskcenter-ui/src/api/user.js b/anrui-riskcenter-ui/src/api/user.js new file mode 100644 index 0000000000..4e137c4512 --- /dev/null +++ b/anrui-riskcenter-ui/src/api/user.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' +import qs from 'qs' +//登录 +export function login(data) { + return request({ + url: '/portal/v1/sysuser/login', + method: 'post', + data: data, + headers: {'Content-Type': 'application/json'} + }) +} +// 用户注册 +export function registUser(data) { + return request({ + url: '/system/user/save', + method: 'post', + data, + headers:{'Content-Type':'application/x-www-form-urlencoded;'} + }) +} +// 获取手机验证码 +export function getVerificationCode(data) { + return request({ + url: '/system/user/getVerificationCode', + method: 'get', + params: data + }) +} + +// 获取登录验证码 +export function imgCode() { + return request({ + url: '/system/api/defaultBlendCode?temm=' + new Date().getTime(), + method: 'get' + }) +} + +// 获取用信息 +export function getInfo(token) { + return request({ + url: '/system/user/loginDetails', + method: 'post', + }) +} diff --git a/anrui-riskcenter-ui/src/assets/404_images/404.png b/anrui-riskcenter-ui/src/assets/404_images/404.png new file mode 100644 index 0000000000..3d8e2305cc Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/404_images/404.png differ diff --git a/anrui-riskcenter-ui/src/assets/404_images/404_cloud.png b/anrui-riskcenter-ui/src/assets/404_images/404_cloud.png new file mode 100644 index 0000000000..c6281d0901 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/404_images/404_cloud.png differ diff --git a/anrui-riskcenter-ui/src/assets/home/anrui.png b/anrui-riskcenter-ui/src/assets/home/anrui.png new file mode 100644 index 0000000000..31de90aed0 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/home/anrui.png differ diff --git a/anrui-riskcenter-ui/src/assets/home/bIcon1.png b/anrui-riskcenter-ui/src/assets/home/bIcon1.png new file mode 100644 index 0000000000..f2c1381a50 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/home/bIcon1.png differ diff --git a/anrui-riskcenter-ui/src/assets/home/bIcon2.png b/anrui-riskcenter-ui/src/assets/home/bIcon2.png new file mode 100644 index 0000000000..4076e7e9bf Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/home/bIcon2.png differ diff --git a/anrui-riskcenter-ui/src/assets/home/bIcon3.png b/anrui-riskcenter-ui/src/assets/home/bIcon3.png new file mode 100644 index 0000000000..bbc6c51bb4 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/home/bIcon3.png differ diff --git a/anrui-riskcenter-ui/src/assets/home/bIcon4.png b/anrui-riskcenter-ui/src/assets/home/bIcon4.png new file mode 100644 index 0000000000..a7ef26fec9 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/home/bIcon4.png differ diff --git a/anrui-riskcenter-ui/src/assets/home/bIcon5.png b/anrui-riskcenter-ui/src/assets/home/bIcon5.png new file mode 100644 index 0000000000..6840128871 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/home/bIcon5.png differ diff --git a/anrui-riskcenter-ui/src/assets/home/bIcon6.png b/anrui-riskcenter-ui/src/assets/home/bIcon6.png new file mode 100644 index 0000000000..61c88a8628 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/home/bIcon6.png differ diff --git a/anrui-riskcenter-ui/src/assets/home/bIcon7.png b/anrui-riskcenter-ui/src/assets/home/bIcon7.png new file mode 100644 index 0000000000..209f1a5dff Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/home/bIcon7.png differ diff --git a/anrui-riskcenter-ui/src/assets/home/bIcon8.png b/anrui-riskcenter-ui/src/assets/home/bIcon8.png new file mode 100644 index 0000000000..f2c2e33164 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/home/bIcon8.png differ diff --git a/anrui-riskcenter-ui/src/assets/home/bottomBg.png b/anrui-riskcenter-ui/src/assets/home/bottomBg.png new file mode 100644 index 0000000000..334f6146cc Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/home/bottomBg.png differ diff --git a/anrui-riskcenter-ui/src/assets/home/line.png b/anrui-riskcenter-ui/src/assets/home/line.png new file mode 100644 index 0000000000..b828cc3c60 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/home/line.png differ diff --git a/anrui-riskcenter-ui/src/assets/home/ltBg.png b/anrui-riskcenter-ui/src/assets/home/ltBg.png new file mode 100644 index 0000000000..7c487f7f63 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/home/ltBg.png differ diff --git a/anrui-riskcenter-ui/src/assets/home/ltIcon1.png b/anrui-riskcenter-ui/src/assets/home/ltIcon1.png new file mode 100644 index 0000000000..0c17623e86 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/home/ltIcon1.png differ diff --git a/anrui-riskcenter-ui/src/assets/home/ltIcon2.png b/anrui-riskcenter-ui/src/assets/home/ltIcon2.png new file mode 100644 index 0000000000..f4f2531580 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/home/ltIcon2.png differ diff --git a/anrui-riskcenter-ui/src/assets/home/ltIcon3.png b/anrui-riskcenter-ui/src/assets/home/ltIcon3.png new file mode 100644 index 0000000000..a69ef7ceef Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/home/ltIcon3.png differ diff --git a/anrui-riskcenter-ui/src/assets/home/ltIcon4.png b/anrui-riskcenter-ui/src/assets/home/ltIcon4.png new file mode 100644 index 0000000000..740cfb3ebe Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/home/ltIcon4.png differ diff --git a/anrui-riskcenter-ui/src/assets/home/notice.png b/anrui-riskcenter-ui/src/assets/home/notice.png new file mode 100644 index 0000000000..f964245d6b Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/home/notice.png differ diff --git a/anrui-riskcenter-ui/src/assets/home/rtBg.png b/anrui-riskcenter-ui/src/assets/home/rtBg.png new file mode 100644 index 0000000000..987b9cbed3 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/home/rtBg.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/arrow.png b/anrui-riskcenter-ui/src/assets/images/arrow.png new file mode 100644 index 0000000000..9e4c33b99f Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/arrow.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/bdrysh.png b/anrui-riskcenter-ui/src/assets/images/bdrysh.png new file mode 100644 index 0000000000..c0acee9aba Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/bdrysh.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/btn.png b/anrui-riskcenter-ui/src/assets/images/btn.png new file mode 100644 index 0000000000..4aaf9f01c7 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/btn.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/cdgl.png b/anrui-riskcenter-ui/src/assets/images/cdgl.png new file mode 100644 index 0000000000..d3e20f9f94 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/cdgl.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/cxjl.png b/anrui-riskcenter-ui/src/assets/images/cxjl.png new file mode 100644 index 0000000000..99285003e1 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/cxjl.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/czsc.png b/anrui-riskcenter-ui/src/assets/images/czsc.png new file mode 100644 index 0000000000..00a8f4f379 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/czsc.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/dwrysh.png b/anrui-riskcenter-ui/src/assets/images/dwrysh.png new file mode 100644 index 0000000000..f9804b7d53 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/dwrysh.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/dwxxgl.png b/anrui-riskcenter-ui/src/assets/images/dwxxgl.png new file mode 100644 index 0000000000..c1d9769c98 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/dwxxgl.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/dy.png b/anrui-riskcenter-ui/src/assets/images/dy.png new file mode 100644 index 0000000000..de8157ed79 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/dy.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/head.png b/anrui-riskcenter-ui/src/assets/images/head.png new file mode 100644 index 0000000000..abd71010e4 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/head.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/info.png b/anrui-riskcenter-ui/src/assets/images/info.png new file mode 100644 index 0000000000..b681da30da Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/info.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/jcxx.png b/anrui-riskcenter-ui/src/assets/images/jcxx.png new file mode 100644 index 0000000000..d9c40674a2 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/jcxx.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/jggl.png b/anrui-riskcenter-ui/src/assets/images/jggl.png new file mode 100644 index 0000000000..ab4c742f96 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/jggl.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/jlsc.png b/anrui-riskcenter-ui/src/assets/images/jlsc.png new file mode 100644 index 0000000000..6061b81ac0 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/jlsc.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/jsgl.png b/anrui-riskcenter-ui/src/assets/images/jsgl.png new file mode 100644 index 0000000000..2da71f4e4f Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/jsgl.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/jsxd.png b/anrui-riskcenter-ui/src/assets/images/jsxd.png new file mode 100644 index 0000000000..e5b3ed049b Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/jsxd.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/login/OAKQ.png b/anrui-riskcenter-ui/src/assets/images/login/OAKQ.png new file mode 100644 index 0000000000..d237cfb05a Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/login/OAKQ.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/login/bg2-img.png b/anrui-riskcenter-ui/src/assets/images/login/bg2-img.png new file mode 100644 index 0000000000..b53bf40c3f Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/login/bg2-img.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/login/bgimg.jpg b/anrui-riskcenter-ui/src/assets/images/login/bgimg.jpg new file mode 100644 index 0000000000..1bd964a85a Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/login/bgimg.jpg differ diff --git a/anrui-riskcenter-ui/src/assets/images/login/nose.png b/anrui-riskcenter-ui/src/assets/images/login/nose.png new file mode 100644 index 0000000000..b6c8086a96 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/login/nose.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/login/pasw.png b/anrui-riskcenter-ui/src/assets/images/login/pasw.png new file mode 100644 index 0000000000..5244bc45be Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/login/pasw.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/login/user.png b/anrui-riskcenter-ui/src/assets/images/login/user.png new file mode 100644 index 0000000000..e370214533 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/login/user.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/lzrysh.png b/anrui-riskcenter-ui/src/assets/images/lzrysh.png new file mode 100644 index 0000000000..03125a1180 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/lzrysh.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/org/headerimg.png b/anrui-riskcenter-ui/src/assets/images/org/headerimg.png new file mode 100644 index 0000000000..661f06b7e7 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/org/headerimg.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/org/jian.png b/anrui-riskcenter-ui/src/assets/images/org/jian.png new file mode 100644 index 0000000000..1e528b099f Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/org/jian.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/org/sfz.png b/anrui-riskcenter-ui/src/assets/images/org/sfz.png new file mode 100644 index 0000000000..7f79b47936 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/org/sfz.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/org/sqs.png b/anrui-riskcenter-ui/src/assets/images/org/sqs.png new file mode 100644 index 0000000000..8071e21033 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/org/sqs.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/org/success.png b/anrui-riskcenter-ui/src/assets/images/org/success.png new file mode 100644 index 0000000000..6a54c31950 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/org/success.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/org/yyzz.png b/anrui-riskcenter-ui/src/assets/images/org/yyzz.png new file mode 100644 index 0000000000..2a1101991a Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/org/yyzz.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/place.png b/anrui-riskcenter-ui/src/assets/images/place.png new file mode 100644 index 0000000000..5e36be9d35 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/place.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/qjsh.png b/anrui-riskcenter-ui/src/assets/images/qjsh.png new file mode 100644 index 0000000000..85c2ce8937 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/qjsh.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/ryda.png b/anrui-riskcenter-ui/src/assets/images/ryda.png new file mode 100644 index 0000000000..4cddf396a7 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/ryda.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/rzgl.png b/anrui-riskcenter-ui/src/assets/images/rzgl.png new file mode 100644 index 0000000000..068ae3bb90 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/rzgl.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/select.png b/anrui-riskcenter-ui/src/assets/images/select.png new file mode 100644 index 0000000000..0a70ffa2d9 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/select.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/sjcc.png b/anrui-riskcenter-ui/src/assets/images/sjcc.png new file mode 100644 index 0000000000..6f01ae0849 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/sjcc.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/sjzd.png b/anrui-riskcenter-ui/src/assets/images/sjzd.png new file mode 100644 index 0000000000..06af6b9810 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/sjzd.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/tjfx.png b/anrui-riskcenter-ui/src/assets/images/tjfx.png new file mode 100644 index 0000000000..e097e3d130 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/tjfx.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/tjfx2.png b/anrui-riskcenter-ui/src/assets/images/tjfx2.png new file mode 100644 index 0000000000..681993c9d8 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/tjfx2.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/wenjian.png b/anrui-riskcenter-ui/src/assets/images/wenjian.png new file mode 100644 index 0000000000..163e441dba Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/wenjian.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/xgmm.png b/anrui-riskcenter-ui/src/assets/images/xgmm.png new file mode 100644 index 0000000000..46b8d5c705 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/xgmm.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/xtbg.png b/anrui-riskcenter-ui/src/assets/images/xtbg.png new file mode 100644 index 0000000000..8ac2bfc3ad Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/xtbg.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/xtgl.png b/anrui-riskcenter-ui/src/assets/images/xtgl.png new file mode 100644 index 0000000000..2eeed54e4c Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/xtgl.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/xxzx.png b/anrui-riskcenter-ui/src/assets/images/xxzx.png new file mode 100644 index 0000000000..0e3c1501d2 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/xxzx.png differ diff --git a/anrui-riskcenter-ui/src/assets/images/zwsm.png b/anrui-riskcenter-ui/src/assets/images/zwsm.png new file mode 100644 index 0000000000..948916931f Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/images/zwsm.png differ diff --git a/anrui-riskcenter-ui/src/assets/loginImg/account.png b/anrui-riskcenter-ui/src/assets/loginImg/account.png new file mode 100644 index 0000000000..0531b4a147 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/loginImg/account.png differ diff --git a/anrui-riskcenter-ui/src/assets/loginImg/bgImg.png b/anrui-riskcenter-ui/src/assets/loginImg/bgImg.png new file mode 100644 index 0000000000..94dba71d8c Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/loginImg/bgImg.png differ diff --git a/anrui-riskcenter-ui/src/assets/loginImg/logo.png b/anrui-riskcenter-ui/src/assets/loginImg/logo.png new file mode 100644 index 0000000000..a56f153dc7 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/loginImg/logo.png differ diff --git a/anrui-riskcenter-ui/src/assets/loginImg/password.png b/anrui-riskcenter-ui/src/assets/loginImg/password.png new file mode 100644 index 0000000000..9426a01194 Binary files /dev/null and b/anrui-riskcenter-ui/src/assets/loginImg/password.png differ diff --git a/anrui-riskcenter-ui/src/components/AreaPicker/index.vue b/anrui-riskcenter-ui/src/components/AreaPicker/index.vue new file mode 100644 index 0000000000..105c64750f --- /dev/null +++ b/anrui-riskcenter-ui/src/components/AreaPicker/index.vue @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/anrui-riskcenter-ui/src/components/Breadcrumb/index.vue b/anrui-riskcenter-ui/src/components/Breadcrumb/index.vue new file mode 100644 index 0000000000..29f9a04c9d --- /dev/null +++ b/anrui-riskcenter-ui/src/components/Breadcrumb/index.vue @@ -0,0 +1,78 @@ + + + + + {{ item.meta.title }} + {{ item.meta.title }} + + + + + + + + diff --git a/anrui-riskcenter-ui/src/components/ButtonBar/index.vue b/anrui-riskcenter-ui/src/components/ButtonBar/index.vue new file mode 100644 index 0000000000..963a81e972 --- /dev/null +++ b/anrui-riskcenter-ui/src/components/ButtonBar/index.vue @@ -0,0 +1,107 @@ + + + + + {{ viewTitle }} + + + + {{ item.btnLabel }} + + + + + + + + + + diff --git a/anrui-riskcenter-ui/src/components/E-image/index.vue b/anrui-riskcenter-ui/src/components/E-image/index.vue new file mode 100644 index 0000000000..9401ce4561 --- /dev/null +++ b/anrui-riskcenter-ui/src/components/E-image/index.vue @@ -0,0 +1,45 @@ + + + + + + + diff --git a/anrui-riskcenter-ui/src/components/ErrorLog/index.vue b/anrui-riskcenter-ui/src/components/ErrorLog/index.vue new file mode 100644 index 0000000000..6119c0374f --- /dev/null +++ b/anrui-riskcenter-ui/src/components/ErrorLog/index.vue @@ -0,0 +1,78 @@ + + + + + + + + + + + Error Log + Clear All + + + + + + Msg: + + {{ row.err.message }} + + + + + Info: + + {{ row.vm.$vnode.tag }} error in {{ row.info }} + + + + + Url: + + {{ row.url }} + + + + + + + {{ scope.row.err.stack }} + + + + + + + + + + diff --git a/anrui-riskcenter-ui/src/components/Hamburger/index.vue b/anrui-riskcenter-ui/src/components/Hamburger/index.vue new file mode 100644 index 0000000000..368b002154 --- /dev/null +++ b/anrui-riskcenter-ui/src/components/Hamburger/index.vue @@ -0,0 +1,44 @@ + + + + + + + + + + + diff --git a/anrui-riskcenter-ui/src/components/Screenfull/index.vue b/anrui-riskcenter-ui/src/components/Screenfull/index.vue new file mode 100644 index 0000000000..4735604530 --- /dev/null +++ b/anrui-riskcenter-ui/src/components/Screenfull/index.vue @@ -0,0 +1,59 @@ + + + + + + + + + diff --git a/anrui-riskcenter-ui/src/components/SizeSelect/index.vue b/anrui-riskcenter-ui/src/components/SizeSelect/index.vue new file mode 100644 index 0000000000..e88065b49f --- /dev/null +++ b/anrui-riskcenter-ui/src/components/SizeSelect/index.vue @@ -0,0 +1,57 @@ + + + + + + + + {{ + item.label }} + + + + + + diff --git a/anrui-riskcenter-ui/src/components/SvgIcon/index.vue b/anrui-riskcenter-ui/src/components/SvgIcon/index.vue new file mode 100644 index 0000000000..b07ded2af3 --- /dev/null +++ b/anrui-riskcenter-ui/src/components/SvgIcon/index.vue @@ -0,0 +1,62 @@ + + + + + + + + + + diff --git a/anrui-riskcenter-ui/src/components/ThemePicker/index.vue b/anrui-riskcenter-ui/src/components/ThemePicker/index.vue new file mode 100644 index 0000000000..3879c5ad02 --- /dev/null +++ b/anrui-riskcenter-ui/src/components/ThemePicker/index.vue @@ -0,0 +1,175 @@ + + + + + + + diff --git a/anrui-riskcenter-ui/src/components/amap/amap.vue b/anrui-riskcenter-ui/src/components/amap/amap.vue new file mode 100644 index 0000000000..c7d643c478 --- /dev/null +++ b/anrui-riskcenter-ui/src/components/amap/amap.vue @@ -0,0 +1,224 @@ + + + + + + 当前坐标: {{ lng }}, {{ lat }} + 地址: {{ address }} + 确定 + + + + + + + + + + + + + + diff --git a/anrui-riskcenter-ui/src/components/imgCodeRole/index.vue b/anrui-riskcenter-ui/src/components/imgCodeRole/index.vue new file mode 100644 index 0000000000..852d9f324e --- /dev/null +++ b/anrui-riskcenter-ui/src/components/imgCodeRole/index.vue @@ -0,0 +1,149 @@ + + + + + + + + 请在上图依次点击: + {{ wordList[0] }} + {{ wordList[1] }} + {{ wordList[2] }} + 换一换 + + + + + + + diff --git a/anrui-riskcenter-ui/src/components/pagination/index.vue b/anrui-riskcenter-ui/src/components/pagination/index.vue new file mode 100644 index 0000000000..fae5a55f63 --- /dev/null +++ b/anrui-riskcenter-ui/src/components/pagination/index.vue @@ -0,0 +1,136 @@ + + + + + + + + + diff --git a/anrui-riskcenter-ui/src/components/pagination/pageye.vue b/anrui-riskcenter-ui/src/components/pagination/pageye.vue new file mode 100644 index 0000000000..c69dca4b4d --- /dev/null +++ b/anrui-riskcenter-ui/src/components/pagination/pageye.vue @@ -0,0 +1,142 @@ + + + + + + + + + + diff --git a/anrui-riskcenter-ui/src/components/passwordSafe/index.vue b/anrui-riskcenter-ui/src/components/passwordSafe/index.vue new file mode 100644 index 0000000000..847af1bcb9 --- /dev/null +++ b/anrui-riskcenter-ui/src/components/passwordSafe/index.vue @@ -0,0 +1,70 @@ + + + + + + 弱 中 强 + + + + + + + + diff --git a/anrui-riskcenter-ui/src/components/tab-search/index.vue b/anrui-riskcenter-ui/src/components/tab-search/index.vue new file mode 100644 index 0000000000..0ad9150257 --- /dev/null +++ b/anrui-riskcenter-ui/src/components/tab-search/index.vue @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + diff --git a/anrui-riskcenter-ui/src/components/uploadFile/FaImages.vue b/anrui-riskcenter-ui/src/components/uploadFile/FaImages.vue new file mode 100644 index 0000000000..e47d3a9c87 --- /dev/null +++ b/anrui-riskcenter-ui/src/components/uploadFile/FaImages.vue @@ -0,0 +1,178 @@ + + + + + + + + + + + + + + + + diff --git a/anrui-riskcenter-ui/src/components/uploadFile/FileUpload.vue b/anrui-riskcenter-ui/src/components/uploadFile/FileUpload.vue new file mode 100644 index 0000000000..80349528e6 --- /dev/null +++ b/anrui-riskcenter-ui/src/components/uploadFile/FileUpload.vue @@ -0,0 +1,155 @@ + + + + 点击上传 + 单个文件大小不允许超过100M,支持上传文件类型:{{ accept }} + + + + + + + diff --git a/anrui-riskcenter-ui/src/components/uploadFile/ImageUpload.vue b/anrui-riskcenter-ui/src/components/uploadFile/ImageUpload.vue new file mode 100644 index 0000000000..30011b8875 --- /dev/null +++ b/anrui-riskcenter-ui/src/components/uploadFile/ImageUpload.vue @@ -0,0 +1,132 @@ + + + + + + + {{ tip }} + + + + + + + diff --git a/anrui-riskcenter-ui/src/components/uploadFile/ImageUploadChe.vue b/anrui-riskcenter-ui/src/components/uploadFile/ImageUploadChe.vue new file mode 100644 index 0000000000..7ef250bbe7 --- /dev/null +++ b/anrui-riskcenter-ui/src/components/uploadFile/ImageUploadChe.vue @@ -0,0 +1,159 @@ + + + + + + + {{ tip }} + + + + + + + diff --git a/anrui-riskcenter-ui/src/components/uploadFile/ManyImageUpload.vue b/anrui-riskcenter-ui/src/components/uploadFile/ManyImageUpload.vue new file mode 100644 index 0000000000..5060ec457a --- /dev/null +++ b/anrui-riskcenter-ui/src/components/uploadFile/ManyImageUpload.vue @@ -0,0 +1,229 @@ + + + + + + + + + + + + + + + + + diff --git a/anrui-riskcenter-ui/src/components/uploadFile/index.vue b/anrui-riskcenter-ui/src/components/uploadFile/index.vue new file mode 100644 index 0000000000..1b2b36b3c4 --- /dev/null +++ b/anrui-riskcenter-ui/src/components/uploadFile/index.vue @@ -0,0 +1,116 @@ + + + + + + {{tip}} + + + + + + diff --git a/anrui-riskcenter-ui/src/components/uploadFile/upload.vue b/anrui-riskcenter-ui/src/components/uploadFile/upload.vue new file mode 100644 index 0000000000..d4418a8200 --- /dev/null +++ b/anrui-riskcenter-ui/src/components/uploadFile/upload.vue @@ -0,0 +1,194 @@ + + + + 点击上传 + 单个文件大小不允许超过100M,支持上传文件类型:{{ accept }} + + + + + + + diff --git a/anrui-riskcenter-ui/src/components/uploadFileimg/index.vue b/anrui-riskcenter-ui/src/components/uploadFileimg/index.vue new file mode 100644 index 0000000000..25c53d72a5 --- /dev/null +++ b/anrui-riskcenter-ui/src/components/uploadFileimg/index.vue @@ -0,0 +1,104 @@ + + + + + {{tip}} + + + + + + diff --git a/anrui-riskcenter-ui/src/components/uploadFileimg/upload.vue b/anrui-riskcenter-ui/src/components/uploadFileimg/upload.vue new file mode 100644 index 0000000000..c4242db4ee --- /dev/null +++ b/anrui-riskcenter-ui/src/components/uploadFileimg/upload.vue @@ -0,0 +1,223 @@ + + + + + + + + + + + + + + diff --git a/anrui-riskcenter-ui/src/components/uploadFileimg/upload_head.vue b/anrui-riskcenter-ui/src/components/uploadFileimg/upload_head.vue new file mode 100644 index 0000000000..a961a82d42 --- /dev/null +++ b/anrui-riskcenter-ui/src/components/uploadFileimg/upload_head.vue @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + diff --git a/anrui-riskcenter-ui/src/components/viewerjs/index.vue b/anrui-riskcenter-ui/src/components/viewerjs/index.vue new file mode 100644 index 0000000000..3d6f841569 --- /dev/null +++ b/anrui-riskcenter-ui/src/components/viewerjs/index.vue @@ -0,0 +1,55 @@ + + + + + + + + + + + diff --git a/anrui-riskcenter-ui/src/icons/index.js b/anrui-riskcenter-ui/src/icons/index.js new file mode 100644 index 0000000000..2c6b309c96 --- /dev/null +++ b/anrui-riskcenter-ui/src/icons/index.js @@ -0,0 +1,9 @@ +import Vue from 'vue' +import SvgIcon from '@/components/SvgIcon'// svg component + +// register globally +Vue.component('svg-icon', SvgIcon) + +const req = require.context('./svg', false, /\.svg$/) +const requireAll = requireContext => requireContext.keys().map(requireContext) +requireAll(req) diff --git a/anrui-riskcenter-ui/src/icons/svg/dashboard.svg b/anrui-riskcenter-ui/src/icons/svg/dashboard.svg new file mode 100644 index 0000000000..5317d37029 --- /dev/null +++ b/anrui-riskcenter-ui/src/icons/svg/dashboard.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/anrui-riskcenter-ui/src/icons/svg/example.svg b/anrui-riskcenter-ui/src/icons/svg/example.svg new file mode 100644 index 0000000000..46f42b5323 --- /dev/null +++ b/anrui-riskcenter-ui/src/icons/svg/example.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/anrui-riskcenter-ui/src/icons/svg/eye-open.svg b/anrui-riskcenter-ui/src/icons/svg/eye-open.svg new file mode 100644 index 0000000000..88dcc98e6c --- /dev/null +++ b/anrui-riskcenter-ui/src/icons/svg/eye-open.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/anrui-riskcenter-ui/src/icons/svg/eye.svg b/anrui-riskcenter-ui/src/icons/svg/eye.svg new file mode 100644 index 0000000000..16ed2d872d --- /dev/null +++ b/anrui-riskcenter-ui/src/icons/svg/eye.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/anrui-riskcenter-ui/src/icons/svg/form.svg b/anrui-riskcenter-ui/src/icons/svg/form.svg new file mode 100644 index 0000000000..dcbaa185a8 --- /dev/null +++ b/anrui-riskcenter-ui/src/icons/svg/form.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/anrui-riskcenter-ui/src/icons/svg/link.svg b/anrui-riskcenter-ui/src/icons/svg/link.svg new file mode 100644 index 0000000000..48197ba4da --- /dev/null +++ b/anrui-riskcenter-ui/src/icons/svg/link.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/anrui-riskcenter-ui/src/icons/svg/nested.svg b/anrui-riskcenter-ui/src/icons/svg/nested.svg new file mode 100644 index 0000000000..06713a86c6 --- /dev/null +++ b/anrui-riskcenter-ui/src/icons/svg/nested.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/anrui-riskcenter-ui/src/icons/svg/password.svg b/anrui-riskcenter-ui/src/icons/svg/password.svg new file mode 100644 index 0000000000..e291d85df2 --- /dev/null +++ b/anrui-riskcenter-ui/src/icons/svg/password.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/anrui-riskcenter-ui/src/icons/svg/table.svg b/anrui-riskcenter-ui/src/icons/svg/table.svg new file mode 100644 index 0000000000..0e3dc9dea5 --- /dev/null +++ b/anrui-riskcenter-ui/src/icons/svg/table.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/anrui-riskcenter-ui/src/icons/svg/tree.svg b/anrui-riskcenter-ui/src/icons/svg/tree.svg new file mode 100644 index 0000000000..dd4b7dd22f --- /dev/null +++ b/anrui-riskcenter-ui/src/icons/svg/tree.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/anrui-riskcenter-ui/src/icons/svg/user.svg b/anrui-riskcenter-ui/src/icons/svg/user.svg new file mode 100644 index 0000000000..0ba0716a62 --- /dev/null +++ b/anrui-riskcenter-ui/src/icons/svg/user.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/anrui-riskcenter-ui/src/icons/svgo.yml b/anrui-riskcenter-ui/src/icons/svgo.yml new file mode 100644 index 0000000000..d11906aec2 --- /dev/null +++ b/anrui-riskcenter-ui/src/icons/svgo.yml @@ -0,0 +1,22 @@ +# replace default config + +# multipass: true +# full: true + +plugins: + + # - name + # + # or: + # - name: false + # - name: true + # + # or: + # - name: + # param1: 1 + # param2: 2 + +- removeAttrs: + attrs: + - 'fill' + - 'fill-rule' diff --git a/anrui-riskcenter-ui/src/layout/components/AppMain.vue b/anrui-riskcenter-ui/src/layout/components/AppMain.vue new file mode 100644 index 0000000000..a8f3718274 --- /dev/null +++ b/anrui-riskcenter-ui/src/layout/components/AppMain.vue @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + diff --git a/anrui-riskcenter-ui/src/layout/components/Navbar.vue b/anrui-riskcenter-ui/src/layout/components/Navbar.vue new file mode 100644 index 0000000000..685479217d --- /dev/null +++ b/anrui-riskcenter-ui/src/layout/components/Navbar.vue @@ -0,0 +1,157 @@ + + + + 安瑞集团信息化平台 + + + 欢迎您,{{pNameAndDepartmentNameAndPostName}} {{name}} + + + 返回首页 + + + Copyright © {{ year }} 安瑞集团 All Rights Reserved + + + + + + diff --git a/anrui-riskcenter-ui/src/layout/components/Sidebar/FixiOSBug.js b/anrui-riskcenter-ui/src/layout/components/Sidebar/FixiOSBug.js new file mode 100644 index 0000000000..bc14856f07 --- /dev/null +++ b/anrui-riskcenter-ui/src/layout/components/Sidebar/FixiOSBug.js @@ -0,0 +1,26 @@ +export default { + computed: { + device() { + return this.$store.state.app.device + } + }, + mounted() { + // In order to fix the click on menu on the ios device will trigger the mouseleave bug + // https://github.com/PanJiaChen/vue-element-admin/issues/1135 + this.fixBugIniOS() + }, + methods: { + fixBugIniOS() { + const $subMenu = this.$refs.subMenu + if ($subMenu) { + const handleMouseleave = $subMenu.handleMouseleave + $subMenu.handleMouseleave = (e) => { + if (this.device === 'mobile') { + return + } + handleMouseleave(e) + } + } + } + } +} diff --git a/anrui-riskcenter-ui/src/layout/components/Sidebar/Item.vue b/anrui-riskcenter-ui/src/layout/components/Sidebar/Item.vue new file mode 100644 index 0000000000..aa1f5da4de --- /dev/null +++ b/anrui-riskcenter-ui/src/layout/components/Sidebar/Item.vue @@ -0,0 +1,41 @@ + + + diff --git a/anrui-riskcenter-ui/src/layout/components/Sidebar/Link.vue b/anrui-riskcenter-ui/src/layout/components/Sidebar/Link.vue new file mode 100644 index 0000000000..530b3d5b37 --- /dev/null +++ b/anrui-riskcenter-ui/src/layout/components/Sidebar/Link.vue @@ -0,0 +1,43 @@ + + + + + + + diff --git a/anrui-riskcenter-ui/src/layout/components/Sidebar/Logo.vue b/anrui-riskcenter-ui/src/layout/components/Sidebar/Logo.vue new file mode 100644 index 0000000000..040fab6469 --- /dev/null +++ b/anrui-riskcenter-ui/src/layout/components/Sidebar/Logo.vue @@ -0,0 +1,82 @@ + + + + + + {{ title }} + + + + {{ title }} + + + + + + + + diff --git a/anrui-riskcenter-ui/src/layout/components/Sidebar/SidebarItem.vue b/anrui-riskcenter-ui/src/layout/components/Sidebar/SidebarItem.vue new file mode 100644 index 0000000000..e955f1b933 --- /dev/null +++ b/anrui-riskcenter-ui/src/layout/components/Sidebar/SidebarItem.vue @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/anrui-riskcenter-ui/src/layout/components/Sidebar/index.vue b/anrui-riskcenter-ui/src/layout/components/Sidebar/index.vue new file mode 100644 index 0000000000..eaa757ccdd --- /dev/null +++ b/anrui-riskcenter-ui/src/layout/components/Sidebar/index.vue @@ -0,0 +1,123 @@ + + + + + + + + + + + + diff --git a/anrui-riskcenter-ui/src/layout/components/TagsView/ScrollPane.vue b/anrui-riskcenter-ui/src/layout/components/TagsView/ScrollPane.vue new file mode 100644 index 0000000000..e8d682bd9c --- /dev/null +++ b/anrui-riskcenter-ui/src/layout/components/TagsView/ScrollPane.vue @@ -0,0 +1,87 @@ + + + + + + + + + \ No newline at end of file diff --git a/anrui-riskcenter-ui/src/layout/components/TagsView/index.vue b/anrui-riskcenter-ui/src/layout/components/TagsView/index.vue new file mode 100644 index 0000000000..ff1f8da266 --- /dev/null +++ b/anrui-riskcenter-ui/src/layout/components/TagsView/index.vue @@ -0,0 +1,324 @@ + + + + + {{ tag.title }} + + + + + + 刷新 + 关闭 + 关闭其他 + 关闭所有 + + + + + + + + + + diff --git a/anrui-riskcenter-ui/src/layout/components/index.js b/anrui-riskcenter-ui/src/layout/components/index.js new file mode 100644 index 0000000000..686faf6f80 --- /dev/null +++ b/anrui-riskcenter-ui/src/layout/components/index.js @@ -0,0 +1,4 @@ +export { default as Navbar } from './Navbar' +export { default as Sidebar } from './Sidebar' +export { default as AppMain } from './AppMain' +export { default as TagsView } from './TagsView/index.vue' diff --git a/anrui-riskcenter-ui/src/layout/index.vue b/anrui-riskcenter-ui/src/layout/index.vue new file mode 100644 index 0000000000..077cd13264 --- /dev/null +++ b/anrui-riskcenter-ui/src/layout/index.vue @@ -0,0 +1,114 @@ + + + + + + + + + 平台首页 + 行政管理 + + + + + + + + + + + + + + + + diff --git a/anrui-riskcenter-ui/src/layout/mixin/ResizeHandler.js b/anrui-riskcenter-ui/src/layout/mixin/ResizeHandler.js new file mode 100644 index 0000000000..e8d0df8c23 --- /dev/null +++ b/anrui-riskcenter-ui/src/layout/mixin/ResizeHandler.js @@ -0,0 +1,45 @@ +import store from '@/store' + +const { body } = document +const WIDTH = 992 // refer to Bootstrap's responsive design + +export default { + watch: { + $route(route) { + if (this.device === 'mobile' && this.sidebar.opened) { + store.dispatch('app/closeSideBar', { withoutAnimation: false }) + } + } + }, + beforeMount() { + window.addEventListener('resize', this.$_resizeHandler) + }, + beforeDestroy() { + window.removeEventListener('resize', this.$_resizeHandler) + }, + mounted() { + const isMobile = this.$_isMobile() + if (isMobile) { + store.dispatch('app/toggleDevice', 'mobile') + store.dispatch('app/closeSideBar', { withoutAnimation: true }) + } + }, + methods: { + // use $_ for mixins properties + // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential + $_isMobile() { + const rect = body.getBoundingClientRect() + return rect.width - 1 < WIDTH + }, + $_resizeHandler() { + if (!document.hidden) { + const isMobile = this.$_isMobile() + store.dispatch('app/toggleDevice', isMobile ? 'mobile' : 'desktop') + + if (isMobile) { + store.dispatch('app/closeSideBar', { withoutAnimation: true }) + } + } + } + } +} diff --git a/anrui-riskcenter-ui/src/main.js b/anrui-riskcenter-ui/src/main.js new file mode 100644 index 0000000000..9d7101a5b7 --- /dev/null +++ b/anrui-riskcenter-ui/src/main.js @@ -0,0 +1,127 @@ +import 'babel-polyfill' +import Vue from 'vue' +import 'normalize.css/normalize.css' // A modern alternative to CSS resets + +import ElementUI from 'element-ui' +import 'element-ui/lib/theme-chalk/index.css' +Vue.use(ElementUI) + +import '@/styles/index.scss' // global css + +import App from './App' +import store from './store' +import router from './router' + +import '@/icons' // icon +import request from '@/utils/request' +// import '@/permission' //权限控制 + +Vue.prototype.$userInfo = null // 用户信息 +// 全局自定义组件 +import Pagination from '@/components/pagination/index.vue' +Vue.component('Pagination', Pagination) +import tabsearch from '@/components/tab-search/index.vue' +Vue.component('tab-search', tabsearch) +import eimage from '@/components/E-image/index.vue' +Vue.component('eimage', eimage) + +import Print from '@/utils/print' // 引入附件的js文件 +Vue.use(Print) // 注册 + +import { setStorage, getStorage } from './utils/auth.js' +let token = null +token = GetQueryString('token') + +if (token) { +setStorage(token) +let href = window.location.href +// href = href.split(`token=${token}`)[0] +// window.location.href = href.slice(0, href.length - 1) +} + +// 获取登录用户信息 +function getUserInfo() { + return request({ + url: '/portal/v1/sysuser/loginDetails', + method: 'post', + headers: { + 'Content-Type': 'application/json' + } + }).then(rep => { + const data = rep.data + let user = { + roleSid: data.roleSid, + name: data.name, + userName: data.userName, + departmentName: data.departmentName, // 部门名称 + departmentSid: data.departmentSid, // 部门sid + isAdmin: data.isAdmin, + staffSid: data.staffSid, // 业务员sid + userSid: data.sid, + orgSid: data.organizationSid, // 单位sid + Orgname: data.organizationName, + dwjb: data.dwjb, + orgNamePath: data.orgNamePath, // 使用组织全路径名称 + orgSidPath: data.orgSidPath, // 使用组织全路径Sid + pNameAndDepartmentNameAndPostName:data.pNameAndDepartmentNameAndPostName + } + // 结果存入缓存 + window.sessionStorage.setItem('staffSid', user.staffSid) + window.sessionStorage.setItem('userSid', user.userSid) + window.sessionStorage.setItem('Orgname', user.Orgname) + window.sessionStorage.setItem('orgSid', user.orgSid) + window.sessionStorage.setItem('departmentName', user.departmentName) + window.sessionStorage.setItem('name', user.name) + window.sessionStorage.setItem('user', user) + window.sessionStorage.setItem('departmentName', user.departmentName) + window.sessionStorage.setItem('departmentSid', user.departmentSid) + window.sessionStorage.setItem('orgNamePath', user.orgNamePath) + window.sessionStorage.setItem('orgSidPath', user.orgSidPath) + window.sessionStorage.setItem('pNameAndDepartmentNameAndPostName', user.pNameAndDepartmentNameAndPostName) + new Vue({ + el: '#app', + router, + store, + render: h => h(App) + }) + }) +} + +getUserInfo() + +function GetQueryString(name) { + var one = window.location.href.indexOf('?token=') + 7 + if(one<7) + return null; + var two = window.location.href.lastIndexOf('&') //+ 1 + var data = window.location.href.substr(one) + if (two > one) { + data = window.location.href.slice(one, two) + console.log('token', data) + } + if (data) { + return data + } + return null + // var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)') + // var r = window.location.search.substr(1).match(reg) + // if (r != null) return unescape(r[2]); return null +} + +import VueAMap from 'vue-amap' +Vue.use(VueAMap) +VueAMap.initAMapApiLoader({ + key: 'ccda12d8bffc72e9f1a32c599323a876', // 此处的key,在高德开放平台申请 + plugin: ['AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PlaceSearch', 'AMap.Geolocation', 'AMap.Geocoder'], // 此处的插件按需添加 + v: '1.4.4', + uiVersion: '1.0' +}) + +Vue.config.productionTip = false + +new Vue({ + el: '#app', + router, + store, + render: h => h(App) +}) diff --git a/anrui-riskcenter-ui/src/permission.js b/anrui-riskcenter-ui/src/permission.js new file mode 100644 index 0000000000..9f1976886a --- /dev/null +++ b/anrui-riskcenter-ui/src/permission.js @@ -0,0 +1,33 @@ +import router from './router' +import store from './store' +import NProgress from 'nprogress' // progress bar +import 'nprogress/nprogress.css' // progress bar style +import getPageTitle from '@/utils/get-page-title' +NProgress.configure({ showSpinner: false }) // NProgress Configuration +import { getStorage } from '@/utils/auth' // get token from cookie +import { getRoleRouter } from '@/router/modules/components.js' +const whiteList = ['/login', '/registUser', '/registOrg'] // no redirect whitelist +router.beforeEach(async(to, from, next) => { + NProgress.start() + document.title = getPageTitle(to.meta.title) + const hasToken = window.sessionStorage.getItem('token') + if (hasToken) { + const userInfo = store.getters.userInfo + if (userInfo) { + next() + NProgress.done() + } else { + await store.dispatch('user/getInfo') + let userRoles = await getRoleRouter(store.getters.userInfo.userSid) + router.options.routes = userRoles + router.addRoutes(userRoles) // 动态添加可访问路由表 + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: + } + } else { + window.location.href = process.env.VUE_APP_URL + } +}) + +router.afterEach(() => { + NProgress.done() +}) diff --git a/anrui-riskcenter-ui/src/router/index.js b/anrui-riskcenter-ui/src/router/index.js new file mode 100644 index 0000000000..e2bb93b113 --- /dev/null +++ b/anrui-riskcenter-ui/src/router/index.js @@ -0,0 +1,92 @@ +import Vue from 'vue' +import Router from 'vue-router' + +Vue.use(Router) + +/* Layout */ +import Layout from '@/layout' +/* 所有角色可以访问/没有权限要求的基页 */ + +export const constantRoutes = [ + { + path: '/redirect', + component: Layout, + hidden: true, + children: [{ + path: '/redirect/:path(.*)', + component: () => import('@/views/redirect/index.vue') + }] + }, + { + path: '/', + redirect: 'index' + }, + /*{ + path: '/login', + component: () => import('@/views/login/login.vue') + },*/ +/* { + path: '/home', + component: () => import('@/views/Home/Home.vue'), + name: 'home' + + },*/ + { + path: '/index', + component: Layout, + redirect: '/index', + children: [{ + path: '/index', + component: () => + import('@/views/index.vue'), + name: 'index', + meta: { + title: '主页', + noCache: true, + affix: true + } + }] + }, + { + path: '/sysstaffinfo', + component: Layout, + redirect: '/sysstaffinfo', + meta: { + title: '员工信息管理' + }, + children: [ + { + path: '/yuangongguanli', + component: () => import('@/views/sysstaffinfo/yuangongguanli.vue'), + name: 'yuangongguanli', + meta: { title: '员工信息管理',noCache:false } + }, + ] + }, + { + path: '/404', + component: () => + import('@/views/404'), + hidden: true + } + // 404 page must be placed at the end !!! + // { path: '*', redirect: '/404', hidden: true } +] + +import componentsRouter from '@/router/modules/components' + +const createRouter = () => new Router({ + // mode: 'history', // require service support + scrollBehavior: () => ({ y: 0 }), + routes: constantRoutes +}) + +const router = createRouter() + +// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465 +export function resetRouter() { + const newRouter = createRouter() + router.matcher = newRouter.matcher // reset router +} + +export default router diff --git a/anrui-riskcenter-ui/src/router/modules/components.js b/anrui-riskcenter-ui/src/router/modules/components.js new file mode 100644 index 0000000000..b0ee40be70 --- /dev/null +++ b/anrui-riskcenter-ui/src/router/modules/components.js @@ -0,0 +1,34 @@ +const Layout = () => import('@/layout') +/* 权限路由 */ +/* 获取权限路由列表 */ +import { getrolemenus } from '@/api/system/Role/role.js' +import { getSession } from '@/utils/auth.js' + +export async function getRoleRouter(userSid) { + const rolemenus = await getrolemenus({ userSid: userSid }) + const userRoles = resRouter(rolemenus.data) + userRoles.push({ path: '*', redirect: '/404', hidden: true }) + return userRoles +} + +function resRouter(menus) { // 递归,将后台传来数组 + for (var i = 0; i < menus.length; i++) { + if (menus[i].children && menus[i].children.length != 0) { + resRouter(menus[i].children) + } + if (menus[i].children.length == 0) { + delete menus[i].children + delete menus[i].redirect + } + if (menus[i].component != '') { + menus[i].component = eval(menus[i].path.substr(1)) + menus[i] = { + path: menus[i].path, + component: Layout, + redirect: menus[i].path, + children: [menus[i]] + } + } + } + return menus +} diff --git a/anrui-riskcenter-ui/src/settings.js b/anrui-riskcenter-ui/src/settings.js new file mode 100644 index 0000000000..647f65bb57 --- /dev/null +++ b/anrui-riskcenter-ui/src/settings.js @@ -0,0 +1,16 @@ +module.exports = { + + title: '安瑞集团信息化平台', + + /** + * @type {boolean} true | false + * @description Whether fix the header + */ + fixedHeader: false, + + /** + * @type {boolean} true | false + * @description Whether show the logo in sidebar + */ + sidebarLogo: false +} diff --git a/anrui-riskcenter-ui/src/store/getters.js b/anrui-riskcenter-ui/src/store/getters.js new file mode 100644 index 0000000000..33a426a94e --- /dev/null +++ b/anrui-riskcenter-ui/src/store/getters.js @@ -0,0 +1,17 @@ +const getters = { + sidebar: state => state.app.sidebar, + size: state => state.app.size, + device: state => state.app.device, + visitedViews: state => state.tagsView.visitedViews, + cachedViews: state => state.tagsView.cachedViews, + token: state => state.user.token, + avatar: state => state.user.avatar, + name: state => state.user.name, + userInfo: state => state.user.userInfo, + menus: state => state.user.menus, + introduction: state => state.user.introduction, + roles: state => state.user.roles, + permission_routes: state => state.permission.routes, + errorLogs: state => state.errorLog.logs +} +export default getters diff --git a/anrui-riskcenter-ui/src/store/index.js b/anrui-riskcenter-ui/src/store/index.js new file mode 100644 index 0000000000..d0cb3aa71b --- /dev/null +++ b/anrui-riskcenter-ui/src/store/index.js @@ -0,0 +1,39 @@ +import Vue from 'vue' +import Vuex from 'vuex' +import getters from './getters' + +Vue.use(Vuex) + +// https://webpack.js.org/guides/dependency-management/#requirecontext +const modulesFiles = require.context('./modules', true, /\.js$/) + +// you do not need `import app from './modules/app'` +// it will auto require all vuex module from modules file +const modules = modulesFiles.keys().reduce((modules, modulePath) => { + // set './app.js' => 'app' + const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1') + const value = modulesFiles(modulePath) + modules[moduleName] = value.default + return modules +}, {}) + +const store = new Vuex.Store({ + state: { + counter: 0, + distributionSid: '', + modelName:'' + }, + mutations: { + + }, + actions: { + + }, + getters: { + + }, + modules, + getters +}) + +export default store diff --git a/anrui-riskcenter-ui/src/store/modules/app.js b/anrui-riskcenter-ui/src/store/modules/app.js new file mode 100644 index 0000000000..45d89bb964 --- /dev/null +++ b/anrui-riskcenter-ui/src/store/modules/app.js @@ -0,0 +1,56 @@ +import Cookies from 'js-cookie' + +const state = { + sidebar: { + opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true, + withoutAnimation: false + }, + device: 'desktop', + size: Cookies.get('size') || 'medium' +} + +const mutations = { + TOGGLE_SIDEBAR: state => { + state.sidebar.opened = !state.sidebar.opened + state.sidebar.withoutAnimation = false + if (state.sidebar.opened) { + Cookies.set('sidebarStatus', 1) + } else { + Cookies.set('sidebarStatus', 0) + } + }, + CLOSE_SIDEBAR: (state, withoutAnimation) => { + Cookies.set('sidebarStatus', 0) + state.sidebar.opened = false + state.sidebar.withoutAnimation = withoutAnimation + }, + TOGGLE_DEVICE: (state, device) => { + state.device = device + }, + SET_SIZE: (state, size) => { + state.size = size + Cookies.set('size', size) + } +} + +const actions = { + toggleSideBar({ commit }) { + commit('TOGGLE_SIDEBAR') + }, + closeSideBar({ commit }, { withoutAnimation }) { + commit('CLOSE_SIDEBAR', withoutAnimation) + }, + toggleDevice({ commit }, device) { + commit('TOGGLE_DEVICE', device) + }, + setSize({ commit }, size) { + commit('SET_SIZE', size) + } +} + +export default { + namespaced: true, + state, + mutations, + actions +} diff --git a/anrui-riskcenter-ui/src/store/modules/errorLog.js b/anrui-riskcenter-ui/src/store/modules/errorLog.js new file mode 100644 index 0000000000..6b01f95754 --- /dev/null +++ b/anrui-riskcenter-ui/src/store/modules/errorLog.js @@ -0,0 +1,28 @@ +const state = { + logs: [] +} + +const mutations = { + ADD_ERROR_LOG: (state, log) => { + state.logs.push(log) + }, + CLEAR_ERROR_LOG: (state) => { + state.logs.splice(0) + } +} + +const actions = { + addErrorLog({ commit }, log) { + commit('ADD_ERROR_LOG', log) + }, + clearErrorLog({ commit }) { + commit('CLEAR_ERROR_LOG') + } +} + +export default { + namespaced: true, + state, + mutations, + actions +} diff --git a/anrui-riskcenter-ui/src/store/modules/permission.js b/anrui-riskcenter-ui/src/store/modules/permission.js new file mode 100644 index 0000000000..aeb5ee5397 --- /dev/null +++ b/anrui-riskcenter-ui/src/store/modules/permission.js @@ -0,0 +1,69 @@ +import { asyncRoutes, constantRoutes } from '@/router' + +/** + * Use meta.role to determine if the current user has permission + * @param roles + * @param route + */ +function hasPermission(roles, route) { + if (route.meta && route.meta.roles) { + return roles.some(role => route.meta.roles.includes(role)) + } else { + return true + } +} + +/** + * Filter asynchronous routing tables by recursion + * @param routes asyncRoutes + * @param roles + */ +export function filterAsyncRoutes(routes, roles) { + const res = [] + + routes.forEach(route => { + const tmp = { ...route } + if (hasPermission(roles, tmp)) { + if (tmp.children) { + tmp.children = filterAsyncRoutes(tmp.children, roles) + } + res.push(tmp) + } + }) + + return res +} + +const state = { + routes: [], + addRoutes: [] +} + +const mutations = { + SET_ROUTES: (state, routes) => { + state.addRoutes = routes + state.routes = constantRoutes.concat(routes) + } +} + +const actions = { + generateRoutes({ commit }, roles) { + return new Promise(resolve => { + let accessedRoutes + if (roles.includes('admin')) { + accessedRoutes = asyncRoutes || [] + } else { + accessedRoutes = filterAsyncRoutes(asyncRoutes, roles) + } + commit('SET_ROUTES', accessedRoutes) + resolve(accessedRoutes) + }) + } +} + +export default { + namespaced: true, + state, + mutations, + actions +} diff --git a/anrui-riskcenter-ui/src/store/modules/settings.js b/anrui-riskcenter-ui/src/store/modules/settings.js new file mode 100644 index 0000000000..110533f738 --- /dev/null +++ b/anrui-riskcenter-ui/src/store/modules/settings.js @@ -0,0 +1,35 @@ +import variables from '@/styles/element-variables.scss' +import defaultSettings from '@/settings' + +const { showSettings, tagsView, fixedHeader, sidebarLogo } = defaultSettings + +const state = { + theme: variables.theme, + showSettings: showSettings, + tagsView: tagsView, + fixedHeader: fixedHeader, + sidebarLogo: sidebarLogo +} + +const mutations = { + CHANGE_SETTING: (state, { key, value }) => { + // eslint-disable-next-line no-prototype-builtins + if (state.hasOwnProperty(key)) { + state[key] = value + } + } +} + +const actions = { + changeSetting({ commit }, data) { + commit('CHANGE_SETTING', data) + } +} + +export default { + namespaced: true, + state, + mutations, + actions +} + diff --git a/anrui-riskcenter-ui/src/store/modules/tagsView.js b/anrui-riskcenter-ui/src/store/modules/tagsView.js new file mode 100644 index 0000000000..57e72421e6 --- /dev/null +++ b/anrui-riskcenter-ui/src/store/modules/tagsView.js @@ -0,0 +1,160 @@ +const state = { + visitedViews: [], + cachedViews: [] +} + +const mutations = { + ADD_VISITED_VIEW: (state, view) => { + if (state.visitedViews.some(v => v.path === view.path)) return + state.visitedViews.push( + Object.assign({}, view, { + title: view.meta.title || 'no-name' + }) + ) + }, + ADD_CACHED_VIEW: (state, view) => { + if (state.cachedViews.includes(view.name)) return + if (!view.meta.noCache) { + state.cachedViews.push(view.name) + } + }, + + DEL_VISITED_VIEW: (state, view) => { + for (const [i, v] of state.visitedViews.entries()) { + if (v.path === view.path) { + state.visitedViews.splice(i, 1) + break + } + } + }, + DEL_CACHED_VIEW: (state, view) => { + const index = state.cachedViews.indexOf(view.name) + index > -1 && state.cachedViews.splice(index, 1) + }, + + DEL_OTHERS_VISITED_VIEWS: (state, view) => { + state.visitedViews = state.visitedViews.filter(v => { + return v.meta.affix || v.path === view.path + }) + }, + DEL_OTHERS_CACHED_VIEWS: (state, view) => { + const index = state.cachedViews.indexOf(view.name) + if (index > -1) { + state.cachedViews = state.cachedViews.slice(index, index + 1) + } else { + // if index = -1, there is no cached tags + state.cachedViews = [] + } + }, + + DEL_ALL_VISITED_VIEWS: state => { + // keep affix tags + const affixTags = state.visitedViews.filter(tag => tag.meta.affix) + state.visitedViews = affixTags + }, + DEL_ALL_CACHED_VIEWS: state => { + state.cachedViews = [] + }, + + UPDATE_VISITED_VIEW: (state, view) => { + for (let v of state.visitedViews) { + if (v.path === view.path) { + v = Object.assign(v, view) + break + } + } + } +} + +const actions = { + addView({ dispatch }, view) { + dispatch('addVisitedView', view) + dispatch('addCachedView', view) + }, + addVisitedView({ commit }, view) { + commit('ADD_VISITED_VIEW', view) + }, + addCachedView({ commit }, view) { + commit('ADD_CACHED_VIEW', view) + }, + + delView({ dispatch, state }, view) { + return new Promise(resolve => { + dispatch('delVisitedView', view) + dispatch('delCachedView', view) + resolve({ + visitedViews: [...state.visitedViews], + cachedViews: [...state.cachedViews] + }) + }) + }, + delVisitedView({ commit, state }, view) { + return new Promise(resolve => { + commit('DEL_VISITED_VIEW', view) + resolve([...state.visitedViews]) + }) + }, + delCachedView({ commit, state }, view) { + return new Promise(resolve => { + commit('DEL_CACHED_VIEW', view) + resolve([...state.cachedViews]) + }) + }, + + delOthersViews({ dispatch, state }, view) { + return new Promise(resolve => { + dispatch('delOthersVisitedViews', view) + dispatch('delOthersCachedViews', view) + resolve({ + visitedViews: [...state.visitedViews], + cachedViews: [...state.cachedViews] + }) + }) + }, + delOthersVisitedViews({ commit, state }, view) { + return new Promise(resolve => { + commit('DEL_OTHERS_VISITED_VIEWS', view) + resolve([...state.visitedViews]) + }) + }, + delOthersCachedViews({ commit, state }, view) { + return new Promise(resolve => { + commit('DEL_OTHERS_CACHED_VIEWS', view) + resolve([...state.cachedViews]) + }) + }, + + delAllViews({ dispatch, state }, view) { + return new Promise(resolve => { + dispatch('delAllVisitedViews', view) + dispatch('delAllCachedViews', view) + resolve({ + visitedViews: [...state.visitedViews], + cachedViews: [...state.cachedViews] + }) + }) + }, + delAllVisitedViews({ commit, state }) { + return new Promise(resolve => { + commit('DEL_ALL_VISITED_VIEWS') + resolve([...state.visitedViews]) + }) + }, + delAllCachedViews({ commit, state }) { + return new Promise(resolve => { + commit('DEL_ALL_CACHED_VIEWS') + resolve([...state.cachedViews]) + }) + }, + + updateVisitedView({ commit }, view) { + commit('UPDATE_VISITED_VIEW', view) + } +} + +export default { + namespaced: true, + state, + mutations, + actions +} diff --git a/anrui-riskcenter-ui/src/store/modules/user.js b/anrui-riskcenter-ui/src/store/modules/user.js new file mode 100644 index 0000000000..fa4dae6c85 --- /dev/null +++ b/anrui-riskcenter-ui/src/store/modules/user.js @@ -0,0 +1,122 @@ +import { login, logout, getInfo } from '@/api/user' +import { getStorage, setStorage, removeStorage } from '@/utils/auth' + +import router, { resetRouter } from '@/router' + +const state = { + token: getStorage(), + userInfo: '', + menus: '', +} + +const mutations = { + SET_TOKEN: (state, token) => { + state.token = token + }, + SET_UESRINFO: (state, userInfo) => { + state.userInfo = userInfo + }, + SET_MENUS: (state, menus) => { + state.menus = menus + } +} + +const actions = { + // user login + login({ commit }, userInfo) { + return new Promise((resolve, reject) => { + login(userInfo).then(response => { + const { data } = response + commit('SET_TOKEN', data.token) + setStorage(data.token) + let user = { + roleSid: data.roleSid, + name: data.name, + userName: data.userName, + departmentName: data.departmentName, + isAdmin: data.isAdmin, + staffSid: data.staffSid, + userSid: data.sid, + orgSid: data.organizationSid, + Orgname: data.organizationName, + dwjb: data.dwjb, + pNameAndDepartmentNameAndPostName:data.pNameAndDepartmentNameAndPostName + } + commit('SET_UESRINFO', user) + window.sessionStorage.setItem('userSid', user.userSid); + window.sessionStorage.setItem('Orgname', user.Orgname); + window.sessionStorage.setItem('departmentName', user.departmentName); + window.sessionStorage.setItem('name', user.name); + window.sessionStorage.setItem('pNameAndDepartmentNameAndPostName', user.pNameAndDepartmentNameAndPostName) + resolve(data) + }).catch(error => { + reject(error) + }) + }) + }, + + // get user info + getInfo({ commit, state }) { + return new Promise((resolve, reject) => { + getInfo().then(response => { + const { data } = response + if (!data) { + removeStorage() + reject('Verification failed, please Login again.') + } + let user = { + roleSid: data.roleSid, + name: data.name, + userName: data.userName, + orgRoleName: data.orgRoleName, + isAdmin: data.isAdmin, + staffSid: data.staffSid, + userSid: data.sid, + orgSid: data.organizationSid, + Orgname: data.organizationName, + dwjb: data.dwjb + } + commit('SET_UESRINFO', user) + resolve(data) + }).catch(error => { + removeStorage() + router.push({path: '/'}) + // reject(error) + }) + }) + }, + + getMenus({ commit, state }) { + return new Promise((resolve, reject) => { + getInfo().then(response => { + const { data } = response + commit('SET_UESRINFO', user) + resolve(data) + }).catch(error => { + reject(error) + }) + }) + }, + + // user logout + logout({ commit, state, dispatch }) { + return new Promise((resolve, reject) => { + logout(state.token).then(() => { + commit('SET_TOKEN', '') + commit('SET_UESRINFO', '') + removeStorage() + resetRouter() + resolve() + }).catch(error => { + reject(error) + }) + }) + } +} + +export default { + namespaced: true, + state, + mutations, + actions +} diff --git a/anrui-riskcenter-ui/src/styles/e-table.scss b/anrui-riskcenter-ui/src/styles/e-table.scss new file mode 100644 index 0000000000..95b9f9c03d --- /dev/null +++ b/anrui-riskcenter-ui/src/styles/e-table.scss @@ -0,0 +1,30 @@ +.e-table { + width: 100%; + padding: 0 30px; + tr:first-child th{ + background-color: #c1f4cd; + } + tr { + td { + border: 1px solid #e6e9f0; + border-right: 0px; + border-bottom: 0px; + padding: 10px 20px; + } + td:last-child { + border-right: 1px solid #e6e9f0; + } + } + tr:last-child { + td { + border-bottom: 1px solid #e6e9f0; + } + } + + td:nth-child(2n-1) { + text-align: right; + } + td:nth-child(2n) { + text-align: left; + } + } diff --git a/anrui-riskcenter-ui/src/styles/element-table.scss b/anrui-riskcenter-ui/src/styles/element-table.scss new file mode 100644 index 0000000000..727938ca3b --- /dev/null +++ b/anrui-riskcenter-ui/src/styles/element-table.scss @@ -0,0 +1,19 @@ +.el-table { + .el-table__header{ + tr th{ + background: #edf1f7; + color: #333333; + } + } +} + +.table-describe{ + border: 1px solid #dfe4ed; + border-bottom: 0px solid #dfe4ed; + h4{ + float: left; + margin: 0; + line-height: 34px; + padding:0 15px; + } +} diff --git a/anrui-riskcenter-ui/src/styles/element-tabs.scss b/anrui-riskcenter-ui/src/styles/element-tabs.scss new file mode 100644 index 0000000000..26321fb16c --- /dev/null +++ b/anrui-riskcenter-ui/src/styles/element-tabs.scss @@ -0,0 +1,25 @@ +.el-tabs--card{ + .el-tabs__header{ + .el-tabs__nav-scroll{ + padding-left: 3px; + padding-bottom: 10px; + border-bottom: 1px solid #018ad2; + .el-tabs__nav { + border: none; + } + .el-tabs__item { + border: 1px solid #dfe4ed; + margin-right: 12px; + margin-left: 2px; + } + .el-tabs__item:first-child { + border-left: 1px solid #dfe4ed; + } + .el-tabs__item.is-active{ + border-bottom-color: #018ad2; + background-color: #018ad2; + color: #fff; + } + } + } +} diff --git a/anrui-riskcenter-ui/src/styles/element-ui.scss b/anrui-riskcenter-ui/src/styles/element-ui.scss new file mode 100644 index 0000000000..50c4dc361c --- /dev/null +++ b/anrui-riskcenter-ui/src/styles/element-ui.scss @@ -0,0 +1,62 @@ +.el-image .el-image__inner--center{ + top: 0; + left: 0; + transform: none; +} + +.tablerow-click{ + color: #007FFF; + cursor: pointer; +} +// cover some element-ui styles + +.el-breadcrumb__inner, +.el-breadcrumb__inner a { + font-weight: 400 !important; +} + +.el-upload { + input[type="file"] { + display: none !important; + } +} + +.el-upload__input { + display: none; +} + + +// to fixed https://github.com/ElemeFE/element/issues/2461 +.el-dialog { + transform: none; + left: 0; + position: relative; + margin: 0 auto; +} + +// refine element ui upload +.upload-container { + .el-upload { + width: 100%; + + .el-upload-dragger { + width: 100%; + height: 200px; + } + } +} + +// dropdown +.el-dropdown-menu { + a { + display: block + } +} + +// to fix el-date-picker css style +.el-range-separator { + box-sizing: content-box; +} + + + diff --git a/anrui-riskcenter-ui/src/styles/element-variables.scss b/anrui-riskcenter-ui/src/styles/element-variables.scss new file mode 100644 index 0000000000..ecd0728841 --- /dev/null +++ b/anrui-riskcenter-ui/src/styles/element-variables.scss @@ -0,0 +1,35 @@ +/** +* I think element-ui's default theme color is too light for long-term use. +* So I modified the default color and you can modify it to your liking. +**/ + +/* theme color */ +// $--color-primary: #018ad2; +// $--color-success: #13ce66; +// $--color-warning: #ffba00; +// $--color-danger: #ff4949; +// $--color-info: #1E1E1E; +$--color-primary: #018ad2; +$--color-success: #2cab69; +$--color-warning: #ffba00; +$--color-danger: #e84026; +$--color-info: #cccccc; +$--button-font-weight: 400; + +// $--color-text-regular: #1f2d3d; + +$--border-color-light: #dfe4ed; +$--border-color-lighter: #e6ebf5; + +$--table-border: 1px solid #dfe6ec; + +/* icon font path, required */ +$--font-path: "~element-ui/lib/theme-chalk/fonts"; + +@import "~element-ui/packages/theme-chalk/src/index"; + +// the :export directive is the magic sauce for webpack +// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass +:export { + theme: $--color-primary; +} diff --git a/anrui-riskcenter-ui/src/styles/index.scss b/anrui-riskcenter-ui/src/styles/index.scss new file mode 100644 index 0000000000..2370ac7844 --- /dev/null +++ b/anrui-riskcenter-ui/src/styles/index.scss @@ -0,0 +1,275 @@ +@import './variables.scss'; +@import './mixin.scss'; +@import './transition.scss'; +@import './element-ui.scss'; +@import './sidebar.scss'; +@import './table.scss'; +@import './e-table.scss'; +@import './element-table.scss'; +@import './element-tabs.scss'; +body { + height: 100%; + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; + font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif; +} + +label { + font-weight: 700; +} + +html { + height: 100%; + box-sizing: border-box; +} + +#app { + height: 100%; +} + +*, +*:before, +*:after { + box-sizing: inherit; +} + +a:focus, +a:active { + outline: none; +} + +a, +a:focus, +a:hover { + cursor: pointer; + color: inherit; + text-decoration: none; +} + +div:focus { + outline: none; +} + +.clearfix { + &:after { + visibility: hidden; + display: block; + font-size: 0; + content: " "; + clear: both; + height: 0; + } +} +.bg-primary{ + background-color: $color-primary !important; +} +// main-container global css +.container{ + min-height: 100%; + height: 100%; + background-color: #FFFFFF; + box-sizing: border-box; + padding: 10px 0; +} + +.fl{ + float: left; +} +.fr{ + float: right; +} +.text-center{ + text-align: center; +} +.color-red{ + color: red !important; +} + +.pd-b10{ + padding-bottom: 10px; +} + +.pd-y40{ + padding: 40px 0; +} +.pd-y20{ + padding: 20px 0; +} + +.fs20{ + font-size: 20px; +} + +// 添加样式 +.app-container {margin: 5px; + background-color: #fff; +} +.main-content{ overflow-x: hidden;overflow-y: auto;height: calc(100vh - 200px);padding: 0 20px;} +.listcon{height: calc(100vh - 425px);overflow-y: auto;overflow-x: hidden;} +.listconadd{height: calc(100vh - 200px);overflow-y: auto;overflow-x: hidden;} +.listconsub{height: calc(100vh - 310px);overflow-y: auto;overflow-x: hidden;} +.listconsubjxs{height: calc(100vh - 300px);overflow-y: auto;overflow-x: hidden;} +// 搜索的 +.webtop { + // position: fixed;top: 110px;width: calc(100% - 240px);z-index: 6000; + background-color: #fff; + display: flex !important; + flex-direction: row; + justify-content: space-between !important; + align-items: center; margin-bottom: 0px !important; +} +.filter-item { + padding: 0 10px; + width: 168px; + display: inline-block; +} +.listtop { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + padding: 0 0 0 15px; + margin-top: 0; + border: 1px solid #dfe4ed; + height: 42px; + line-height: 42px; +} + +.listtop .tit { + font-weight: bold; + font-size: 16px +} + +.listtop .pagination { + margin: 0; + padding: 0; +} +.pages { + display: flex; + flex-direction: row; + justify-content: flex-end; + align-items: flex-end; + padding: 0px 0px 15px 15px; +} +.pages .tit{font-weight: bold;} +.pages .pagination{margin: 0;} +// .formadd{padding: 20px ;} +// .listeltable{overflow-y: auto;height: calc(100vh - 420px);} + +.formadd { + padding: 20px 0; + // height: calc(100vh - 200px);overflow-y: auto; + .title { + padding: 10px;font-weight: bold; + font-size: 20px; + background-color: $header-bg; + text-align: center; + color: #ffffff; + } + .el-row { + display:flex; + flex-wrap: wrap; + border-left: 1px solid $table-border-color; + .el-col{ + border-right: 1px solid $table-border-color; + border-bottom: 1px solid $table-border-color; + padding: 5px 15px 5px 15px !important; + min-height: 50px; + line-height: 1; + .el-form-item{ + margin-bottom: 0; + // .addinputw{width: 400px;} + .addinputw{width: 80%;} + } + } + + } + .footer{margin: 20px;} +} + + +.forminfo { + padding: 20px 0; + .title { + padding: 10px;font-weight: bold; + font-size: 20px; + background-color: $header-bg; + text-align: center; + color: #ffffff; + } + .el-row { + display:flex; + flex-wrap: wrap; + border-left: 1px solid $table-border-color; + .trightb{ text-align: right;font-weight: bold;color: #606266; } + .tleft{ text-align: left; } + .el-col{ + border-right: 1px solid $table-border-color; + border-bottom: 1px solid $table-border-color; + padding: 0px 15px 0px 15px !important; + min-height: 50px; + line-height: 50px; + font-size: 14px; + + } + + } + .footer{margin: 20px;} +} + +.el-form-item__error { + z-index: 100; +} +.bluezi{color: $header-bg;} +// 经销商添加样式 +.titcon{ + display: flex;flex-direction: row;justify-content: space-around; background-color: #0294d7;flex: 3; +} +.titcon .title{ + padding: 10px;font-weight: bold; + font-size: 20px; + text-align: center; + color: #ffffff; +} +.titcon .baocun{text-align: right;flex: 2;padding: 5px 20px;} +.addinputwda{width: 600px;} +//.searchcon{margin: 0px 0 10px 0;} +//.searchcon .searchbtn{margin: 10px 0;} +.main-content { + .searchcon { + .searchbtn { + margin: 5px 0; + border: #2cab69 1px solid; + color: #2cab69; + } + } +} + +.search .btn { + padding: 5px 0; + border: 1px solid #e0e3eb; + text-align: center; + margin-bottom: 5px; +} + +// 弹出窗口按钮 +.btnCancel{ + background: #e84026 !important;outline: none;border: none;color: #fff !important; +} +.btnCancel:hover{ + background: #ed6651 !important; +} +.btnFalses{ + background: #2cab69 !important;outline: none;border: none; +} +.btnFalses:hover{ + background: #3dc47e !important; +} +.btntopblueline{background-color: #066bc9 !important;} +.btntopblueline:hover{background-color: #34a1db !important;} +.btntophui{background-color: #cccccc !important;} +.btntophui:hover{background-color: #d6d6d6 !important;} +.bordertopline{ border-top: 1px solid $table-border-color;} +.lookimg img{width: 250px;margin: 10px;} +.listimg{width: 80px;} diff --git a/anrui-riskcenter-ui/src/styles/mixin.scss b/anrui-riskcenter-ui/src/styles/mixin.scss new file mode 100644 index 0000000000..36b74bbd99 --- /dev/null +++ b/anrui-riskcenter-ui/src/styles/mixin.scss @@ -0,0 +1,28 @@ +@mixin clearfix { + &:after { + content: ""; + display: table; + clear: both; + } +} + +@mixin scrollBar { + &::-webkit-scrollbar-track-piece { + background: #d3dce6; + } + + &::-webkit-scrollbar { + width: 6px; + } + + &::-webkit-scrollbar-thumb { + background: #99a9bf; + border-radius: 20px; + } +} + +@mixin relative { + position: relative; + width: 100%; + height: 100%; +} diff --git a/anrui-riskcenter-ui/src/styles/sidebar.scss b/anrui-riskcenter-ui/src/styles/sidebar.scss new file mode 100644 index 0000000000..ef66650a63 --- /dev/null +++ b/anrui-riskcenter-ui/src/styles/sidebar.scss @@ -0,0 +1,261 @@ +#app { + background-color: #f7f9fc; + + .main-container { + height: 100vh; + transition: margin-left .28s; + padding-left: $sideBarWidth; + padding-top: 60px; + position: relative; + overflow: hidden; + } + .TagsView{ + height: 50px; + } + .home-box{ + position: fixed; + top: 60px; + left: 0; + background-color: $menuBg; + border: 1px solid $menuHover; + line-height: 40px; + width: 210px; + z-index: 1000; + a{ + display: inline-block; + line-height: 40px; + box-sizing: border-box; + width: 50%; + text-align: center; + font-size: 16px; + font-weight: 500; + color: #FFFFFF; + } + a:last-child{ + border:0; + background-color: $menuHover; + } + } + .sidebar-container { + transition: width 0.28s; + width: $sideBarWidth !important; + background-color: $menuBg; + height: calc(100% - 60px) ; + position: absolute; + font-size: 0px; + top: 60px; + bottom: 0; + left: 0; + z-index: 8; + overflow: hidden; + padding-top: 40px; + + // reset element-ui css + .horizontal-collapse-transition { + transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out; + } + + .scrollbar-wrapper { + overflow-x: hidden !important; + } + + .el-scrollbar__bar.is-vertical { + right: 0px; + } + + .el-scrollbar { + height: 100%; + } + + &.has-logo { + .el-scrollbar { + height: calc(100% - 50px); + } + } + + .is-horizontal { + display: none; + } + + a { + display: inline-block; + width: 100%; + overflow: hidden; + } + + .svg-icon { + margin-right: 16px; + } + + .sub-el-icon { + margin-right: 12px; + margin-left: -2px; + } + + .el-menu { + border: none; + height: 100%; + width: 100% !important; + } + + // menu hover + .submenu-title-noDropdown, + .el-submenu__title { + &:hover { + background-color: $menuHover !important; + } + } + .el-submenu__title i{ + color: #FFFFFF; + } + .is-active>.el-submenu__title { + color: $subMenuActiveText !important; + } + + & .nest-menu .el-submenu>.el-submenu__title, + & .el-submenu .el-menu-item { + min-width: $sideBarWidth !important; + background-color: $subMenuBg !important; + + &:hover { + background-color: $subMenuHover !important; + } + } + & .el-menu-item.is-active { + background-color: $subMenuHover !important; + } + } + + // .hideSidebar { + // .sidebar-container { + // width: 54px !important; + // } + + // .main-container { + // margin-left: 54px; + // } + + // .submenu-title-noDropdown { + // padding: 0 !important; + // position: relative; + + // .el-tooltip { + // padding: 0 !important; + + // .svg-icon { + // margin-left: 20px; + // } + + // .sub-el-icon { + // margin-left: 19px; + // } + // } + // } + + // .el-submenu { + // overflow: hidden; + + // &>.el-submenu__title { + // padding: 0 !important; + + // .svg-icon { + // margin-left: 20px; + // } + + // .sub-el-icon { + // margin-left: 19px; + // } + + // .el-submenu__icon-arrow { + // display: none; + // } + // } + // } + + // .el-menu--collapse { + // .el-submenu { + // &>.el-submenu__title { + // &>span { + // height: 0; + // width: 0; + // overflow: hidden; + // visibility: hidden; + // display: inline-block; + // } + // } + // } + // } + // } + + .el-menu--collapse .el-menu .el-submenu { + min-width: $sideBarWidth !important; + } + + // mobile responsive + .mobile { + .main-container { + margin-left: 0px; + } + + .sidebar-container { + transition: transform .28s; + width: $sideBarWidth !important; + } + + &.hideSidebar { + .sidebar-container { + pointer-events: none; + transition-duration: 0.3s; + transform: translate3d(-$sideBarWidth, 0, 0); + } + } + } + + .withoutAnimation { + + .main-container, + .sidebar-container { + transition: none; + } + } +} + +// when menu collapsed +.el-menu--vertical { + &>.el-menu { + .svg-icon { + margin-right: 16px; + } + .sub-el-icon { + margin-right: 12px; + margin-left: -2px; + } + } + + .nest-menu .el-submenu>.el-submenu__title, + .el-menu-item { + &:hover { + // you can use $subMenuHover + background-color: $menuHover !important; + } + } + + // the scroll bar appears when the subMenu is too long + >.el-menu--popup { + max-height: 100vh; + overflow-y: auto; + + &::-webkit-scrollbar-track-piece { + background: #d3dce6; + } + + &::-webkit-scrollbar { + width: 6px; + } + + &::-webkit-scrollbar-thumb { + background: #99a9bf; + border-radius: 20px; + } + } +} diff --git a/anrui-riskcenter-ui/src/styles/table.scss b/anrui-riskcenter-ui/src/styles/table.scss new file mode 100644 index 0000000000..08e9142ddc --- /dev/null +++ b/anrui-riskcenter-ui/src/styles/table.scss @@ -0,0 +1,48 @@ +.container{ + /* 头 */ + .el-table thead{ + color: $text-color; + } + .el-table .cell{ + a{ + display: block; + color: $table-a-color; + } + .el-button--text{ + color: $table-a-color; + } + } + .el-table td, .el-table th{ + padding: 8px 0; + } + .el-table.is-group th{ + background-color: $table-bg-color; + } + .el-table--enable-row-hover .el-table__body tr:hover>td { + background-color: $table-bg-color !important; + } + .el-table--border td, .el-table--border th, .el-table__body-wrapper .el-table--border.is-scrolling-left~.el-table__fixed { + border-right: 1px solid $table-border-color; + } + .el-table td, .el-table th.is-leaf{ + border-bottom: 1px solid $table-border-color; + } + .table-fixed { + .el-table__fixed-right { + height: 100% !important; //设置高优先,以覆盖内联样式 + } + } +} + +.children-box { + padding: 10px; + .table-header { + padding: 0 20px 5px 20px; + border-bottom: 2px solid $border-color; + .el-page-header { + line-height: 40px; + font-weight: 500; + + } + } +} diff --git a/anrui-riskcenter-ui/src/styles/transition.scss b/anrui-riskcenter-ui/src/styles/transition.scss new file mode 100644 index 0000000000..4cb27cc811 --- /dev/null +++ b/anrui-riskcenter-ui/src/styles/transition.scss @@ -0,0 +1,48 @@ +// global transition css + +/* fade */ +.fade-enter-active, +.fade-leave-active { + transition: opacity 0.28s; +} + +.fade-enter, +.fade-leave-active { + opacity: 0; +} + +/* fade-transform */ +.fade-transform-leave-active, +.fade-transform-enter-active { + transition: all .5s; +} + +.fade-transform-enter { + opacity: 0; + transform: translateX(-30px); +} + +.fade-transform-leave-to { + opacity: 0; + transform: translateX(30px); +} + +/* breadcrumb transition */ +.breadcrumb-enter-active, +.breadcrumb-leave-active { + transition: all .5s; +} + +.breadcrumb-enter, +.breadcrumb-leave-active { + opacity: 0; + transform: translateX(20px); +} + +.breadcrumb-move { + transition: all .5s; +} + +.breadcrumb-leave-active { + position: absolute; +} diff --git a/anrui-riskcenter-ui/src/styles/upload.vue b/anrui-riskcenter-ui/src/styles/upload.vue new file mode 100644 index 0000000000..d4418a8200 --- /dev/null +++ b/anrui-riskcenter-ui/src/styles/upload.vue @@ -0,0 +1,194 @@ + + + + 点击上传 + 单个文件大小不允许超过100M,支持上传文件类型:{{ accept }} + + + + + + + diff --git a/anrui-riskcenter-ui/src/styles/variables.scss b/anrui-riskcenter-ui/src/styles/variables.scss new file mode 100644 index 0000000000..9ff78c5273 --- /dev/null +++ b/anrui-riskcenter-ui/src/styles/variables.scss @@ -0,0 +1,52 @@ +// 行为色 +$color-primary: #018ad2; +$color-success: #4cd964; +$color-warning: #f0ad4e; +$color-error: #dd524d; +// header +$header-bg:#0294d7; +// sidebar +$menuText: rgba($color: #FFFFFF, $alpha: 0.9); +$menuActiveText:#ffffff; +$subMenuActiveText:#ffffff; //https://github.com/ElemeFE/element/issues/12951 + +$menuBg:#0294d7; +$menuHover:#087dba; + +$subMenuBg:#0294d7; +$subMenuHover:#087dba; + +$sideBarWidth: 210px; + +/* 表格的相关样式 */ +$search-bg:#edf1f7; // 表格搜索景色 +$table-bg-color:#edf1f7; // 表格背景 +$table-border-color:#e0e3eb; // 表格边框色 +// 文字 +$table-a-color:#018ad2; +/* 表格的相关样式 */ + +/* 边框颜色 */ +$border-color:#018ad2; +/* 文字基本颜色 */ +$text-color:#333;//基本色 +$text-color-inverse:#fff;//反色 +$text-color-grey:#999;//辅助灰色,如加载更多的提示信息 +$text-color-placeholder: #808080; +$text-color-disable:#c0c0c0; +$text-red: #d00000; + +$a-color:#018ad2; + +// the :export directive is the magic sauce for webpack +// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass +:export { + menuText: $menuText; + menuActiveText: $menuActiveText; + subMenuActiveText: $subMenuActiveText; + menuBg: $menuBg; + menuHover: $menuHover; + subMenuBg: $subMenuBg; + subMenuHover: $subMenuHover; + sideBarWidth: $sideBarWidth; +} diff --git a/anrui-riskcenter-ui/src/utils/auth.js b/anrui-riskcenter-ui/src/utils/auth.js new file mode 100644 index 0000000000..81df9ea509 --- /dev/null +++ b/anrui-riskcenter-ui/src/utils/auth.js @@ -0,0 +1,29 @@ +import Cookies from 'js-cookie' + +const TokenKey = 'token' +const sessionKey = 'token' + +export function getToken() { + return Cookies.get(TokenKey) +} + +export function setToken(token) { + return Cookies.set(TokenKey, token, { expires: 7, path: '/' }) +} + +export function removeToken() { + return Cookies.remove(TokenKey) +} + +export function getStorage() { + return sessionStorage.getItem('token') + // return 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyTm8iOiI0MjdhMmZiMC02MGM1LTQwOWYtYmVhNC00ZWI0NDEwNDFhZTYiLCJpc3MiOiJXQksiLCJleHAiOjE2MzcxOTk1Mjl9.VkUkYAaHBjEaElFMPlUHAhUYO5zYf1aUQpX_3-w43UQ' +} + +export function setStorage(session) { + return sessionStorage.setItem('token', session) +} + +export function removeStorage() { + return sessionStorage.removeItem('token') +} diff --git a/anrui-riskcenter-ui/src/utils/axios.js b/anrui-riskcenter-ui/src/utils/axios.js new file mode 100644 index 0000000000..56ca72360e --- /dev/null +++ b/anrui-riskcenter-ui/src/utils/axios.js @@ -0,0 +1,248 @@ +import axios from 'axios' +import router from '@/router' +import { Message } from 'element-ui' +import { removeToken, getToken } from '@/utils/auth' +// 统一请求路径前缀 +const base = process.env.VUE_APP_BASE_API +// 超时设定 +axios.defaults.timeout = 120000 + +axios.interceptors.request.use( + config => { + // console.log('请求拦截器数据', config) + return config + }, + err => { + Message.error('请求超时') + return Promise.resolve(err) + } +) + +// http response 拦截器 +axios.interceptors.response.use( + response => { + const data = response.data + // console.log('响应拦截器数据', response) + // console.log('data.code:' + data.code) + // 根据返回的code值来做不同的处理(和后端约定) + switch (data.code) { + case 401: + // Message.error('登录失效,请重新登录!') + console.log('登录失效,请重新登录!') + // 未登录 + // removeToken().then(() => { // 清除已登录状态 + // router.push('/login') + // }) + // if (router.history.current.name !== 'login') { + // console.log(router.history.current.name) + // if (data.msg !== null) { + // Message.error(data.msg) + // } else { + // Message.error('未知错误,请重新登录') + // } + // } + break + case 403: + // 没有权限 + if (data.msg !== null) { + Message.error(data.msg) + } else { + Message.error('未知错误') + } + break + case 500: + // 错误 + if (data.msg !== null) { + Message.error(data.msg) + } else { + Message.error('未知错误') + } + break + case 99: + if (data.msg !== null) { + if (data.msg == '登录状态已过期') { + // 未登录 + // removeToken().then(() => { // 清除已登录状态 + // router.push('/login') + // }) + } else { + // Message.error(data.msg) + return data + } + } else { + Message.error('未知错误') + } + break + default: + return data + } + return Promise.reject(new Error(response.msg || 'Error')) + }, + error => { + // 返回状态码不为200时候的错误处理 + Message.error(error.toString()) + if (error.request.responseURL.indexOf('/sys/security/needLogin')) { + // removeToken().then(() => { // 清除已登录状态 + // router.push('/login') + // }) + } + // return err + return Promise.reject(error) + } +) + +export const getRequest = (url, params) => { + const accessToken = getToken() + console.log(`-------------------${base}${url}`) + return axios({ + method: 'get', + url: `${base}${url}`, + params: params, + headers: { + accessToken: accessToken + } + }) +} + +export const postRequest = (url, params) => { + const accessToken = getToken() + return axios({ + method: 'post', + url: `${base}${url}`, + data: params, + transformRequest: [ + function(data) { + let ret = '' + for (const it in data) { + ret += + encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&' + } + return ret + } + ], + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + accessToken: accessToken + } + }) +} + +export const post = (url, params) => { + const accessToken = getToken() + return axios({ + method: 'post', + url: `${base}${url}`, + data: params, + headers: { + 'Content-Type': 'application/json;charset=utf-8', + // 'Content-Type': 'multipart/form-data', + accessToken: accessToken + } + }) +} + +// export const postExport = (url, params) => { +// const accessToken = getToken() +// return axios({ +// method: 'post', +// url: `${base}${url}`, +// data: params, +// headers: { +// 'Content-Type': 'application/json;charset=utf-8', +// // 'Content-Type': 'multipart/form-data', +// accessToken: accessToken +// }, +// responseType: 'blob' // 表明返回服务器返回的数据类型 +// }) +// } + +export const putRequest = (url, params) => { + const accessToken = getToken() + return axios({ + method: 'put', + url: `${base}${url}`, + data: params, + transformRequest: [ + function(data) { + let ret = '' + for (const it in data) { + ret += + encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&' + } + return ret + } + ], + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + accessToken: accessToken + } + }) +} + +export const deleteRequest = (url, params) => { + const accessToken = getToken() + return axios({ + method: 'delete', + url: `${base}${url}`, + params: params, + headers: { + accessToken: accessToken + } + }) +} + +export const importRequest = (url, params) => { + const accessToken = getToken() + return axios({ + method: 'post', + url: `${base}${url}`, + data: params, + headers: { + accessToken: accessToken + } + }) +} + +export const uploadFileRequest = (url, params) => { + const accessToken = getToken() + return axios({ + method: 'post', + url: `${base}${url}`, + params: params, + headers: { + accessToken: accessToken + } + }) +} + +export const getDownLoadUrl = (url) => { + const accessToken = getToken() + return base + url + '?token=' + accessToken +} + +export const uploadFileRequestJianCai = (url, params) => { + const accessToken = getToken() + return axios({ + method: 'post', + url: `${base}${url}`, + data: params, + headers: { + 'Content-Type': 'multipart/form-data', + contentType: false, + processData: false, + accessToken: accessToken + } + }) +} + +export const postBodyRequest = (url, params) => { + const accessToken = getToken() + return axios({ + method: 'post', + url: `${base}${url}`, + data: params, + headers: { + accessToken: accessToken + } + }) +} diff --git a/anrui-riskcenter-ui/src/utils/baocun.js b/anrui-riskcenter-ui/src/utils/baocun.js new file mode 100644 index 0000000000..b80fb74fd2 --- /dev/null +++ b/anrui-riskcenter-ui/src/utils/baocun.js @@ -0,0 +1,52 @@ +const TokenKey = 'AdminWuJingToken' +const userInfo = 'wj_user' +// 保存基础信息 +export function getuser() { + return JSON.parse(localStorage.getItem(userInfo)) +} +export function setuser(obj) { + return localStorage.setItem(userInfo, JSON.stringify(obj)) +} + +// 保存修改基础信息 +export function getXiu() { + return JSON.parse(localStorage.getItem(userInfo)) +} +export function setXiu(obj) { + return localStorage.setItem(userInfo, JSON.stringify(obj)) +} +// 保存查看基础信息 +export function getLook() { + return JSON.parse(localStorage.getItem(userInfo)) +} +export function setLook(obj) { + return localStorage.setItem(userInfo, JSON.stringify(obj)) +} +// 信息 +export function getChe() { + return JSON.parse(localStorage.getItem(userInfo)) +} +export function setChe(obj) { + return localStorage.setItem(userInfo, JSON.stringify(obj)) +} +// 经销商保存 +export function getJing() { + return JSON.parse(localStorage.getItem(userInfo)) +} +export function setJing(obj) { + return localStorage.setItem(userInfo, JSON.stringify(obj)) +} +// 车型名称保存 +export function getCHeap() { + return JSON.parse(localStorage.getItem(userInfo)) +} +export function setCHeap(obj) { + return localStorage.setItem(userInfo, JSON.stringify(obj)) +} +// 车型sid保存 +export function getMIng() { + return JSON.parse(localStorage.getItem(userInfo)) +} +export function setMIng(obj) { + return localStorage.setItem(userInfo, JSON.stringify(obj)) +} diff --git a/anrui-riskcenter-ui/src/utils/get-page-title.js b/anrui-riskcenter-ui/src/utils/get-page-title.js new file mode 100644 index 0000000000..a6de99dde3 --- /dev/null +++ b/anrui-riskcenter-ui/src/utils/get-page-title.js @@ -0,0 +1,10 @@ +import defaultSettings from '@/settings' + +const title = defaultSettings.title || 'Vue Admin Template' + +export default function getPageTitle(pageTitle) { + if (pageTitle) { + return `${pageTitle} - ${title}` + } + return `${title}` +} diff --git a/anrui-riskcenter-ui/src/utils/index.js b/anrui-riskcenter-ui/src/utils/index.js new file mode 100644 index 0000000000..4830c04890 --- /dev/null +++ b/anrui-riskcenter-ui/src/utils/index.js @@ -0,0 +1,117 @@ +/** + * Created by PanJiaChen on 16/11/18. + */ + +/** + * Parse the time to string + * @param {(Object|string|number)} time + * @param {string} cFormat + * @returns {string | null} + */ +export function parseTime(time, cFormat) { + if (arguments.length === 0 || !time) { + return null + } + const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}' + let date + if (typeof time === 'object') { + date = time + } else { + if ((typeof time === 'string')) { + if ((/^[0-9]+$/.test(time))) { + // support "1548221490638" + time = parseInt(time) + } else { + // support safari + // https://stackoverflow.com/questions/4310953/invalid-date-in-safari + time = time.replace(new RegExp(/-/gm), '/') + } + } + + if ((typeof time === 'number') && (time.toString().length === 10)) { + time = time * 1000 + } + date = new Date(time) + } + const formatObj = { + y: date.getFullYear(), + m: date.getMonth() + 1, + d: date.getDate(), + h: date.getHours(), + i: date.getMinutes(), + s: date.getSeconds(), + a: date.getDay() + } + const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => { + const value = formatObj[key] + // Note: getDay() returns 0 on Sunday + if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value ] } + return value.toString().padStart(2, '0') + }) + return time_str +} + +/** + * @param {number} time + * @param {string} option + * @returns {string} + */ +export function formatTime(time, option) { + if (('' + time).length === 10) { + time = parseInt(time) * 1000 + } else { + time = +time + } + const d = new Date(time) + const now = Date.now() + + const diff = (now - d) / 1000 + + if (diff < 30) { + return '刚刚' + } else if (diff < 3600) { + // less 1 hour + return Math.ceil(diff / 60) + '分钟前' + } else if (diff < 3600 * 24) { + return Math.ceil(diff / 3600) + '小时前' + } else if (diff < 3600 * 24 * 2) { + return '1天前' + } + if (option) { + return parseTime(time, option) + } else { + return ( + d.getMonth() + + 1 + + '月' + + d.getDate() + + '日' + + d.getHours() + + '时' + + d.getMinutes() + + '分' + ) + } +} + +/** + * @param {string} url + * @returns {Object} + */ +export function param2Obj(url) { + const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ') + if (!search) { + return {} + } + const obj = {} + const searchArr = search.split('&') + searchArr.forEach(v => { + const index = v.indexOf('=') + if (index !== -1) { + const name = v.substring(0, index) + const val = v.substring(index + 1, v.length) + obj[name] = val + } + }) + return obj +} diff --git a/anrui-riskcenter-ui/src/utils/print.js b/anrui-riskcenter-ui/src/utils/print.js new file mode 100644 index 0000000000..799a333764 --- /dev/null +++ b/anrui-riskcenter-ui/src/utils/print.js @@ -0,0 +1,123 @@ +// 打印类属性、方法定义 +/* eslint-disable */ +const Print =function(dom, options) { + if (!(this instanceof Print)) return new Print(dom, options); + + this.options = this.extend({ + 'noPrint': '.no-print' + }, options); + + if ((typeof dom) === "string") { + this.dom = document.querySelector(dom); + } else { + this.dom = dom; + } + + this.init(); +}; +Print.prototype = { + init: function () { + var content = this.getStyle() + this.getHtml(); + this.writeIframe(content); + }, + extend: function (obj, obj2) { + for (var k in obj2) { + obj[k] = obj2[k]; + } + return obj; + }, + + getStyle: function () { + var str = "", + styles = document.querySelectorAll('style,link'); + for (var i = 0; i < styles.length; i++) { + str += styles[i].outerHTML; + } + str += ""; + + return str; + }, + + getHtml: function () { + var inputs = document.querySelectorAll('input'); + var textareas = document.querySelectorAll('textarea'); + var selects = document.querySelectorAll('select'); + + for (var k in inputs) { + if (inputs[k].type == "checkbox" || inputs[k].type == "radio") { + if (inputs[k].checked == true) { + inputs[k].setAttribute('checked', "checked") + } else { + inputs[k].removeAttribute('checked') + } + } else if (inputs[k].type == "text") { + inputs[k].setAttribute('value', inputs[k].value) + } + } + + for (var k2 in textareas) { + if (textareas[k2].type == 'textarea') { + textareas[k2].innerHTML = textareas[k2].value + } + } + + for (var k3 in selects) { + if (selects[k3].type == 'select-one') { + var child = selects[k3].children; + for (var i in child) { + if (child[i].tagName == 'OPTION') { + if (child[i].selected == true) { + child[i].setAttribute('selected', "selected") + } else { + child[i].removeAttribute('selected') + } + } + } + } + } + + return this.dom.outerHTML; + }, + + writeIframe: function (content) { + var w, doc, iframe = document.createElement('iframe'), + f = document.body.appendChild(iframe); + iframe.id = "myIframe"; + iframe.style = "position:absolute;width:0;height:0;top:-10px;left:-10px;"; + + w = f.contentWindow || f.contentDocument; + doc = f.contentDocument || f.contentWindow.document; + doc.open(); + doc.write(content); + doc.close(); + this.toPrint(w); + + setTimeout(function () { + document.body.removeChild(iframe) + }, 100) + }, + + toPrint: function (frameWindow) { + try { + setTimeout(function () { + frameWindow.focus(); + try { + if (!frameWindow.document.execCommand('print', false, null)) { + frameWindow.print(); + } + } catch (e) { + frameWindow.print(); + } + frameWindow.close(); + }, 10); + } catch (err) { + console.log('err', err); + } + } +}; +const MyPlugin = {} +MyPlugin.install = function (Vue, options) { + // 4. 添加实例方法 + Vue.prototype.$print = Print +} +export default MyPlugin \ No newline at end of file diff --git a/anrui-riskcenter-ui/src/utils/request.js b/anrui-riskcenter-ui/src/utils/request.js new file mode 100644 index 0000000000..c9d3f4eec7 --- /dev/null +++ b/anrui-riskcenter-ui/src/utils/request.js @@ -0,0 +1,69 @@ +import axios from 'axios' +import { MessageBox, Message } from 'element-ui' +import store from '@/store' +import { getToken, getStorage } from '@/utils/auth' + +// create an axios instance +console.log(process.env.VUE_APP_URL) +const service = axios.create({ + baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url + // timeout: 5000 // request timeout + headers:{'Content-Type':'application/x-www-form-urlencoded;'} +}) + +// request interceptor +service.interceptors.request.use( + config => { + config.params = { + ...config.params, + _t: Date.parse(new Date()) / 1000 + } + if (getStorage()) { + + config.headers['token'] = getStorage() + } + return config + }, + error => { + console.log(error) // for debug + return Promise.reject(error) + } +) + +// response interceptor +service.interceptors.response.use( + + response => { + const res = response.data + + if(res.type !=undefined){ + return res + } + // if the custom code is not 20000, it is judged as an error. + if (res.code != 200) { + if (res.msg == "请重新登录") { + // window.location.href = 'http://39.104.100.138:8082/' + } else { + Message({ + message: res.msg || 'Error', + type: 'error', + duration: 5 * 1000 + }) + } + return Promise.reject(new Error(res.message || 'Error')) + } else { + return res + } + }, + error => { + console.log('err' + error) // for debug + Message({ + message: error.message, + type: 'error', + duration: 5 * 1000 + }) + return Promise.reject(error) + } +) + +export default service diff --git a/anrui-riskcenter-ui/src/utils/roles.js b/anrui-riskcenter-ui/src/utils/roles.js new file mode 100644 index 0000000000..07a6557422 --- /dev/null +++ b/anrui-riskcenter-ui/src/utils/roles.js @@ -0,0 +1,98 @@ +/** + * 表单校验规则 + * 不符合规则时,返回错误文案 + * 符合规则时,返回false + */ + +var rules = {} + +// 是否必填 +rules.required = function (value) { + return (!!value || value === 0) ? false : "请输入内容" +}; + +// 最大字符长度 +rules.maxLength = function (value, size) { + var size = size || 256; + return String(value).length <= size ? false : ("最大不超过" + size + "个字符") +} + +// 只允许字母和数字 +rules.onlyAlphabetic = function (value) { + var reg = /^[0-9a-zA-Z]+$/; + return reg.test(value) ? false : "只能输入字母和数字" +} + +// 只允许字母数字和下划线 +rules.onlyAlphabeticUnderline = function (value) { + var reg = /^[0-9a-zA-Z_]+$/; + return reg.test(value) ? false : "只能输入字母、数字或下划线" +} + +// 只允许数字 +rules.onlyNumber = function (value) { + var reg = /^[0-9]+$/; + return reg.test(value) ? false : "只能输入数字" +} + +// 只允许字母 +rules.onlyLetter = function (value) { + var reg = /^[a-zA-Z]+$/; + return reg.test(value) ? false : "只能输入字母" +} + +// 特殊字符 +rules.noSpecial = function (value) { + var regEn = /[`~!@#$%^&*()_+<>?:"{},.\/;'[\]]/im, + regCn = /[·!#¥(——):;“”‘、,|《。》?、【】[\]]/im; + return regEn.test(value) || regCn.test(value) ? false : "不能输入特殊字符" +} + +// 邮箱 +rules.email = function (value) { + var reg = /^[a-zA-Z0-9_-]+@([a-zA-Z0-9]+\.)+(com|cn|net|org)$/; + return reg.test(value) ? false : "邮箱格式错误" +} + +// 手机号(以1开头的11位数字) +rules.phone = function (value) { + var reg = /^[1][3,4,5,7,8][0-9]{9}$/; + return reg.test(value) ? false : "手机格式错误" +} + +// 只允许汉字 +rules.chinese = function (value) { + var reg = /^[\u4e00-\u9fa5]+$/; + return reg.test(value) ? false : "只能输入汉字" +} + +// 密码格式校验 +rules.password = function (value) { + if (String(value).length < 6) { + return "密码长度不小于6位" + } + if (String(value).length > 18) { + return "密码长度不超过18位" + } + var level = 0; + if (value.search(/[a-z]/) > -1) { + level++; //密码中包含小写字母 + } + if (value.search(/[A-Z]/) > -1) { + level++; //密码中包含大写字母 + } + if (value.search(/[0-9]/) > -1) { + level++; //密码中包含数组 + } + if (value.search(/[`~!@#$%^&*()_+<>?:"{},.\/;'[\]]/im) > -1) { + level++; //密码中包含特殊符号 + } + if(level<2){ + return "密码至少包含大写字母、小写字母、数字、标点符号中的两种" + }else{ + return level; // 当前密码强度为level(2/3/4) + } +} + + +export default rules; \ No newline at end of file diff --git a/anrui-riskcenter-ui/src/utils/validate.js b/anrui-riskcenter-ui/src/utils/validate.js new file mode 100644 index 0000000000..8d962ad4a2 --- /dev/null +++ b/anrui-riskcenter-ui/src/utils/validate.js @@ -0,0 +1,20 @@ +/** + * Created by PanJiaChen on 16/11/18. + */ + +/** + * @param {string} path + * @returns {Boolean} + */ +export function isExternal(path) { + return /^(https?:|mailto:|tel:)/.test(path) +} + +/** + * @param {string} str + * @returns {Boolean} + */ +export function validUsername(str) { + const valid_map = ['admin', 'editor'] + return valid_map.indexOf(str.trim()) >= 0 +} diff --git a/anrui-riskcenter-ui/src/views/404.vue b/anrui-riskcenter-ui/src/views/404.vue new file mode 100644 index 0000000000..1791f55a34 --- /dev/null +++ b/anrui-riskcenter-ui/src/views/404.vue @@ -0,0 +1,228 @@ + + + + + + + + + + + OOPS! + All rights reserved + wallstreetcn + + {{ message }} + Please check that the URL you entered is correct, or click the button below to return to the homepage. + Back to home + + + + + + + + diff --git a/anrui-riskcenter-ui/src/views/index.vue b/anrui-riskcenter-ui/src/views/index.vue new file mode 100644 index 0000000000..289c8a9fbf --- /dev/null +++ b/anrui-riskcenter-ui/src/views/index.vue @@ -0,0 +1,27 @@ + + + + + + + + diff --git a/anrui-riskcenter-ui/src/views/redirect/index.vue b/anrui-riskcenter-ui/src/views/redirect/index.vue new file mode 100644 index 0000000000..db4c1d66d1 --- /dev/null +++ b/anrui-riskcenter-ui/src/views/redirect/index.vue @@ -0,0 +1,12 @@ + diff --git a/anrui-riskcenter-ui/src/views/sysstaffinfo/yuangongAdd.vue b/anrui-riskcenter-ui/src/views/sysstaffinfo/yuangongAdd.vue new file mode 100644 index 0000000000..1a8be37bc5 --- /dev/null +++ b/anrui-riskcenter-ui/src/views/sysstaffinfo/yuangongAdd.vue @@ -0,0 +1,1292 @@ + + + + {{ viewTitle }} + + 保存 + 提交 + 打印 + 关闭 + + + + + + 客户基础信息 + + + + + + *工号 + + + + + + + + *姓名 + + + + + + + + + + *性别 + + + + 男 + 女 + + + + *出生年月日 + + + + + + + + + + *身份证 + + + + + + + + *证件有效期 + + + + + + + + + + *民族 + + + + + + + + + + *手机号码 + + + + + + + + + + 政治面貌 + + + + + + + + + + 婚姻状况 + + + + + + + + + + + + + + + + + + 紧急联系人 + + + + + + + + 紧急联系电话 + + + + + + + + 邮箱 + + + + + + + + + + 住址 + + + + + + + + + + 籍贯 + + + + + + + + + + + + + + + + + + 更多信息 + + + + + *员工类型 + + + + + + + + + + + *所在部门 + + + + + + + + *岗位 + + + + + + + + + + + + + + *入职日期 + + + + + + + + + 试用期 + + + + + + + + + + 计划转正日期 + + + + + + + + + + + 实际转正日期 + + + + + + + + + 开户行 + + + + + + + + 银行账号 + + + + + + + + + + + + 身份证(人像面) + + + + + + + 身份证(国徽面) + + + + + + 前公司离职证明 + + + + + + + 学历/技能信息 + + + + 毕业院校 + + + + + + + + 学历/专业 + + + + + + + + + + 职称 + + + + + + + + + + 资格认证 + + + + + + + + 驾照类型 + + + + + + + + + + + + + 学历证书 + + + + + + 学位证书 + + + + + + + 社保信息 + + + + 意外险参保 + + + + 是 + 否 + + + + 意外险参保地 + + + + + + + + 意外险参保时间 + + + + + + + + 意外险终止时间 + + + + + + + + + + + 养老 + + + + 是 + 否 + + + + 医疗/生育 + + + + 是 + 否 + + + + 工伤 + + + + 是 + 否 + + + + 失业 + + + + 是 + 否 + + + + + + 社保参保地 + + + + + + + + 纸质档案保管地 + + + + + + + + + 合同信息 + + + + 合同起止日期 + + + + + + + + 合同结束日期 + + + + + + + + + + 离职信息 + + + + 离职日期 + + + + + + + + 离职理由 + + + + + + + + + + + + + + + + diff --git a/anrui-riskcenter-ui/src/views/sysstaffinfo/yuangongInfo.vue b/anrui-riskcenter-ui/src/views/sysstaffinfo/yuangongInfo.vue new file mode 100644 index 0000000000..9be2fe7653 --- /dev/null +++ b/anrui-riskcenter-ui/src/views/sysstaffinfo/yuangongInfo.vue @@ -0,0 +1,671 @@ + + + + {{ viewTitle }} + + 打印 + 关闭 + + + + + + 客户基础信息 + + + + + + + 工号 + + + + + {{ temp.jobNumber }} + + + + + 姓名 + + + + + {{ temp.name }} + + + + + + + 性别 + + + + + {{ temp.gender }} + + + + + 出生年月日 + + + + + {{ temp.birthday }} + + + + + + + 身份证 + + + + + {{ temp.idNo }} + + + + + 证件有效期 + + + + + {{ temp.idTerm }} + + + + + + + 民族 + + + + + {{ temp.national }} + + + + + 手机号码 + + + + + {{ temp.mobile }} + + + + + + + 婚姻状况 + + + + + {{ temp.maritalStatus }} + + + + + 政治面貌 + + + + + {{ temp.poliCode }} + + + + + + + + + + + + 紧急联系人 + + + + + {{ temp.emergencyContact }} + + + + + 紧急联系电话 + + + + + {{ temp.emergencyMobile }} + + + + + 邮箱 + + + + + {{ temp.email }} + + + + + + + 住址 + + + + + {{ temp.address }} + + + + + + + 籍贯 + + + + + {{ temp.province + temp.city + temp.county + temp.nativePlace}} + + + + + 更多信息 + + + + + *员工类型 + + + + + {{ temp.personType }} + + + + *所在部门 + + + + {{temp.sysStaffOrg.orgName}} + + + + *岗位 + + + + {{ temp.sysStaffPost.name }} + + + + + + + *入职日期 + + + + + {{ temp.joinCompnyDate }} + + + + 试用期 + + + + {{temp.probPeriod}} + + + + 计划转正日期 + + + + {{temp.plannedConfirmDate}} + + + + + + + 实际转正日期 + + + + + {{temp.confirmationDate}} + + + + 开户行 + + + + {{temp.openBank}} + + + + 银行账号 + + + + {{temp.bankCardNo}} + + + + + + + + 身份证(人像面) + + + + + + + + + + 身份证(国徽面) + + + + + + + + + + 前公司离职证明 + + + + + + + + + + 学历/技能信息 + + + + + 毕业院校 + + + + + {{ temp.graduate }} + + + + + 学历/专业 + + + + + {{ temp.education }} + + + + + 职称 + + + + + {{ temp.title }} + + + + + + + 资格认证 + + + + + {{ temp.qualification }} + + + + + 驾照类型 + + + + + {{ temp.licenseType }} + + + + + + + 学历证书 + + + + + + + + 学位证书 + + + + + + + + 社保信息 + + + + + 意外险参保 + + + + + {{ temp.isHaveInsuranceValue }} + + + + + 意外险参保地 + + + + + {{ temp.insuranceAddr }} + + + + + 意外险参保时间 + + + + + {{ temp.insuranceStartDate }} + + + + + 意外险终止时间 + + + + + {{ temp.insuranceEndDate }} + + + + + + + 养老 + + + + + {{ temp.isHaveAgedValue }} + + + + + 医疗/生育 + + + + + {{ temp.isHaveMedicalValue }} + + + + + 工伤 + + + + + {{ temp.isHaveInjuryValue }} + + + + + 失业 + + + + + {{ temp.isHaveUnemployValue }} + + + + + + + 社保参保地 + + + + + {{ temp.insuredPlace }} + + + + + 纸质档案保管地 + + + + + {{ temp.paperPlace }} + + + + + 合同信息 + + + + 合同起止日期 + + + + {{temp.contractStartDate}} + + + + 合同结束日期 + + + + {{temp.contractEndDate}} + + + + + + + 离职信息 + + + + + 离职日期 + + + + + {{ temp.quitDate }} + + + + + 离职理由 + + + + + {{ temp.quitReason }} + + + + + + + + + + + + + + + + diff --git a/anrui-riskcenter-ui/src/views/sysstaffinfo/yuangongguanli.vue b/anrui-riskcenter-ui/src/views/sysstaffinfo/yuangongguanli.vue new file mode 100644 index 0000000000..7d71323d5d --- /dev/null +++ b/anrui-riskcenter-ui/src/views/sysstaffinfo/yuangongguanli.vue @@ -0,0 +1,486 @@ + + + + + + + {{ isSearchShow ? "隐藏查询条件" : "显示藏查询条件" }} + + + + + + + + + + + + + + + + + + + + + + + + + 至 + + + + + + 查询 + 重置 + + + + + 员工信息列表 + + + + + + + + + {{ scope.row.jobNumber }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 确 定 + 取 消 + + + + + + + + diff --git a/anrui-riskcenter-ui/tests/unit/.eslintrc.js b/anrui-riskcenter-ui/tests/unit/.eslintrc.js new file mode 100644 index 0000000000..958d51ba27 --- /dev/null +++ b/anrui-riskcenter-ui/tests/unit/.eslintrc.js @@ -0,0 +1,5 @@ +module.exports = { + env: { + jest: true + } +} diff --git a/anrui-riskcenter-ui/tests/unit/components/Breadcrumb.spec.js b/anrui-riskcenter-ui/tests/unit/components/Breadcrumb.spec.js new file mode 100644 index 0000000000..1d94c8fc71 --- /dev/null +++ b/anrui-riskcenter-ui/tests/unit/components/Breadcrumb.spec.js @@ -0,0 +1,98 @@ +import { mount, createLocalVue } from '@vue/test-utils' +import VueRouter from 'vue-router' +import ElementUI from 'element-ui' +import Breadcrumb from '@/components/Breadcrumb/index.vue' + +const localVue = createLocalVue() +localVue.use(VueRouter) +localVue.use(ElementUI) + +const routes = [ + { + path: '/', + name: 'home', + children: [{ + path: 'dashboard', + name: 'dashboard' + }] + }, + { + path: '/menu', + name: 'menu', + children: [{ + path: 'menu1', + name: 'menu1', + meta: { title: 'menu1' }, + children: [{ + path: 'menu1-1', + name: 'menu1-1', + meta: { title: 'menu1-1' } + }, + { + path: 'menu1-2', + name: 'menu1-2', + redirect: 'noredirect', + meta: { title: 'menu1-2' }, + children: [{ + path: 'menu1-2-1', + name: 'menu1-2-1', + meta: { title: 'menu1-2-1' } + }, + { + path: 'menu1-2-2', + name: 'menu1-2-2' + }] + }] + }] + }] + +const router = new VueRouter({ + routes +}) + +describe('Breadcrumb.vue', () => { + const wrapper = mount(Breadcrumb, { + localVue, + router + }) + it('dashboard', () => { + router.push('/dashboard') + const len = wrapper.findAll('.el-breadcrumb__inner').length + expect(len).toBe(1) + }) + it('normal route', () => { + router.push('/menu/menu1') + const len = wrapper.findAll('.el-breadcrumb__inner').length + expect(len).toBe(2) + }) + it('nested route', () => { + router.push('/menu/menu1/menu1-2/menu1-2-1') + const len = wrapper.findAll('.el-breadcrumb__inner').length + expect(len).toBe(4) + }) + it('no meta.title', () => { + router.push('/menu/menu1/menu1-2/menu1-2-2') + const len = wrapper.findAll('.el-breadcrumb__inner').length + expect(len).toBe(3) + }) + // it('click link', () => { + // router.push('/menu/menu1/menu1-2/menu1-2-2') + // const breadcrumbArray = wrapper.findAll('.el-breadcrumb__inner') + // const second = breadcrumbArray.at(1) + // console.log(breadcrumbArray) + // const href = second.find('a').attributes().href + // expect(href).toBe('#/menu/menu1') + // }) + // it('noRedirect', () => { + // router.push('/menu/menu1/menu1-2/menu1-2-1') + // const breadcrumbArray = wrapper.findAll('.el-breadcrumb__inner') + // const redirectBreadcrumb = breadcrumbArray.at(2) + // expect(redirectBreadcrumb.contains('a')).toBe(false) + // }) + it('last breadcrumb', () => { + router.push('/menu/menu1/menu1-2/menu1-2-1') + const breadcrumbArray = wrapper.findAll('.el-breadcrumb__inner') + const redirectBreadcrumb = breadcrumbArray.at(3) + expect(redirectBreadcrumb.contains('a')).toBe(false) + }) +}) diff --git a/anrui-riskcenter-ui/tests/unit/components/Hamburger.spec.js b/anrui-riskcenter-ui/tests/unit/components/Hamburger.spec.js new file mode 100644 index 0000000000..01ea303a5e --- /dev/null +++ b/anrui-riskcenter-ui/tests/unit/components/Hamburger.spec.js @@ -0,0 +1,18 @@ +import { shallowMount } from '@vue/test-utils' +import Hamburger from '@/components/Hamburger/index.vue' +describe('Hamburger.vue', () => { + it('toggle click', () => { + const wrapper = shallowMount(Hamburger) + const mockFn = jest.fn() + wrapper.vm.$on('toggleClick', mockFn) + wrapper.find('.hamburger').trigger('click') + expect(mockFn).toBeCalled() + }) + it('prop isActive', () => { + const wrapper = shallowMount(Hamburger) + wrapper.setProps({ isActive: true }) + expect(wrapper.contains('.is-active')).toBe(true) + wrapper.setProps({ isActive: false }) + expect(wrapper.contains('.is-active')).toBe(false) + }) +}) diff --git a/anrui-riskcenter-ui/tests/unit/components/SvgIcon.spec.js b/anrui-riskcenter-ui/tests/unit/components/SvgIcon.spec.js new file mode 100644 index 0000000000..31467a9f6f --- /dev/null +++ b/anrui-riskcenter-ui/tests/unit/components/SvgIcon.spec.js @@ -0,0 +1,22 @@ +import { shallowMount } from '@vue/test-utils' +import SvgIcon from '@/components/SvgIcon/index.vue' +describe('SvgIcon.vue', () => { + it('iconClass', () => { + const wrapper = shallowMount(SvgIcon, { + propsData: { + iconClass: 'test' + } + }) + expect(wrapper.find('use').attributes().href).toBe('#icon-test') + }) + it('className', () => { + const wrapper = shallowMount(SvgIcon, { + propsData: { + iconClass: 'test' + } + }) + expect(wrapper.classes().length).toBe(1) + wrapper.setProps({ className: 'test' }) + expect(wrapper.classes().includes('test')).toBe(true) + }) +}) diff --git a/anrui-riskcenter-ui/tests/unit/utils/formatTime.spec.js b/anrui-riskcenter-ui/tests/unit/utils/formatTime.spec.js new file mode 100644 index 0000000000..24e165b42d --- /dev/null +++ b/anrui-riskcenter-ui/tests/unit/utils/formatTime.spec.js @@ -0,0 +1,30 @@ +import { formatTime } from '@/utils/index.js' + +describe('Utils:formatTime', () => { + const d = new Date('2018-07-13 17:54:01') // "2018-07-13 17:54:01" + const retrofit = 5 * 1000 + + it('ten digits timestamp', () => { + expect(formatTime((d / 1000).toFixed(0))).toBe('7月13日17时54分') + }) + it('test now', () => { + expect(formatTime(+new Date() - 1)).toBe('刚刚') + }) + it('less two minute', () => { + expect(formatTime(+new Date() - 60 * 2 * 1000 + retrofit)).toBe('2分钟前') + }) + it('less two hour', () => { + expect(formatTime(+new Date() - 60 * 60 * 2 * 1000 + retrofit)).toBe('2小时前') + }) + it('less one day', () => { + expect(formatTime(+new Date() - 60 * 60 * 24 * 1 * 1000)).toBe('1天前') + }) + it('more than one day', () => { + expect(formatTime(d)).toBe('7月13日17时54分') + }) + it('format', () => { + expect(formatTime(d, '{y}-{m}-{d} {h}:{i}')).toBe('2018-07-13 17:54') + expect(formatTime(d, '{y}-{m}-{d}')).toBe('2018-07-13') + expect(formatTime(d, '{y}/{m}/{d} {h}-{i}')).toBe('2018/07/13 17-54') + }) +}) diff --git a/anrui-riskcenter-ui/tests/unit/utils/param2Obj.spec.js b/anrui-riskcenter-ui/tests/unit/utils/param2Obj.spec.js new file mode 100644 index 0000000000..e106ed88b5 --- /dev/null +++ b/anrui-riskcenter-ui/tests/unit/utils/param2Obj.spec.js @@ -0,0 +1,14 @@ +import { param2Obj } from '@/utils/index.js' +describe('Utils:param2Obj', () => { + const url = 'https://github.com/PanJiaChen/vue-element-admin?name=bill&age=29&sex=1&field=dGVzdA==&key=%E6%B5%8B%E8%AF%95' + + it('param2Obj test', () => { + expect(param2Obj(url)).toEqual({ + name: 'bill', + age: '29', + sex: '1', + field: window.btoa('test'), + key: '测试' + }) + }) +}) diff --git a/anrui-riskcenter-ui/tests/unit/utils/parseTime.spec.js b/anrui-riskcenter-ui/tests/unit/utils/parseTime.spec.js new file mode 100644 index 0000000000..56045af4a8 --- /dev/null +++ b/anrui-riskcenter-ui/tests/unit/utils/parseTime.spec.js @@ -0,0 +1,35 @@ +import { parseTime } from '@/utils/index.js' + +describe('Utils:parseTime', () => { + const d = new Date('2018-07-13 17:54:01') // "2018-07-13 17:54:01" + it('timestamp', () => { + expect(parseTime(d)).toBe('2018-07-13 17:54:01') + }) + it('timestamp string', () => { + expect(parseTime((d + ''))).toBe('2018-07-13 17:54:01') + }) + it('ten digits timestamp', () => { + expect(parseTime((d / 1000).toFixed(0))).toBe('2018-07-13 17:54:01') + }) + it('new Date', () => { + expect(parseTime(new Date(d))).toBe('2018-07-13 17:54:01') + }) + it('format', () => { + expect(parseTime(d, '{y}-{m}-{d} {h}:{i}')).toBe('2018-07-13 17:54') + expect(parseTime(d, '{y}-{m}-{d}')).toBe('2018-07-13') + expect(parseTime(d, '{y}/{m}/{d} {h}-{i}')).toBe('2018/07/13 17-54') + }) + it('get the day of the week', () => { + expect(parseTime(d, '{a}')).toBe('五') // 星期五 + }) + it('get the day of the week', () => { + expect(parseTime(+d + 1000 * 60 * 60 * 24 * 2, '{a}')).toBe('日') // 星期日 + }) + it('empty argument', () => { + expect(parseTime()).toBeNull() + }) + + it('null', () => { + expect(parseTime(null)).toBeNull() + }) +}) diff --git a/anrui-riskcenter-ui/tests/unit/utils/validate.spec.js b/anrui-riskcenter-ui/tests/unit/utils/validate.spec.js new file mode 100644 index 0000000000..f774905b00 --- /dev/null +++ b/anrui-riskcenter-ui/tests/unit/utils/validate.spec.js @@ -0,0 +1,17 @@ +import { validUsername, isExternal } from '@/utils/validate.js' + +describe('Utils:validate', () => { + it('validUsername', () => { + expect(validUsername('admin')).toBe(true) + expect(validUsername('editor')).toBe(true) + expect(validUsername('xxxx')).toBe(false) + }) + it('isExternal', () => { + expect(isExternal('https://github.com/PanJiaChen/vue-element-admin')).toBe(true) + expect(isExternal('http://github.com/PanJiaChen/vue-element-admin')).toBe(true) + expect(isExternal('github.com/PanJiaChen/vue-element-admin')).toBe(false) + expect(isExternal('/dashboard')).toBe(false) + expect(isExternal('./dashboard')).toBe(false) + expect(isExternal('dashboard')).toBe(false) + }) +}) diff --git a/anrui-riskcenter-ui/vue.config.js b/anrui-riskcenter-ui/vue.config.js new file mode 100644 index 0000000000..4e79528680 --- /dev/null +++ b/anrui-riskcenter-ui/vue.config.js @@ -0,0 +1,142 @@ +'use strict' +const path = require('path') +const defaultSettings = require('./src/settings.js') + +function resolve(dir) { + return path.join(__dirname, dir) +} + +const name = defaultSettings.title || '安瑞集团信息化平台' // page title + +// 如果端口设置为80, +// 使用管理员权限执行命令行。 +// 例如,Mac:sudo npm run +// 可以通过以下方法更改端口: +// port=9528 npm run dev或npm run dev--port=9528 +const port = process.env.port || process.env.npm_config_port || 9531 // dev port + +// 所有配置项说明都可以在中找到https://cli.vuejs.org/config/ +module.exports = { + /** + *如果计划在子路径下部署站点,则需要设置publicPath, + *例如GitHub页面。如果您计划将站点部署到https://foo.github.io/bar/, + *然后publicPath应设置为“/bar/”。 + *在大多数情况下,请使用“/”!!! + *详细信息:https://cli.vuejs.org/config/#publicpath + */ + publicPath: process.env.NODE_ENV === 'production' ? '/risk/' : '/', + outputDir: 'System', + assetsDir: 'static', + lintOnSave: process.env.NODE_ENV === 'development', + productionSourceMap: false, + devServer: { + hot: true, // 自动保存 + host: '0.0.0.0', + port: port, + open: true, + overlay: { + warnings: false, + errors: true + }, + proxy: { + '/api': { // 匹配所有以 '/api'开头的请求路径 + // target: 'http://127.0.0.1:8111/', + target: process.env.VUE_APP_URL, // 代理目标的基础路径 + changeOrigin: true, // 支持跨域 + pathRewrite: { // 重写路径: 去掉路径中开头的'/api' + '^/api': '' + } + }, + '/upload': { // 匹配所有以 '/api'开头的请求路径 + // target: 'http://4424790b0u.qicp.vip/', + target: process.env.VUE_APP_URL, // 代理目标的基础路径 + changeOrigin: true, // 支持跨域 + pathRewrite: { // 重写路径: 去掉路径中开头的'/api' + '^/upload': '' + } + } + }, + disableHostCheck: true + }, + configureWebpack: { + // 在webpack的name字段中提供应用程序的标题,以便 + // 它可以在索引.html插入正确的标题。 + name: name, + resolve: { + alias: { + '@': resolve('src'), + '@C': resolve('src/components') + } + } + }, + chainWebpack(config) { + // 它可以提高第一屏的速度,建议打开预加载 + config.plugin('preload').tap(() => [{ + rel: 'preload', + // 忽略 runtime.js + // https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/cli-service/lib/config/app.js#L171 + fileBlacklist: [/\.map$/, /hot-update\.js$/, /runtime\..*\.js$/], + include: 'initial' + }]) + + // 当有很多页面时,会导致太多无意义的请求 + config.plugins.delete('prefetch') + + // set svg-sprite-loader 设置 svg精灵加载程序 + config.module + .rule('svg') + .exclude.add(resolve('src/icons')) + .end() + config.module + .rule('icons') + .test(/\.svg$/) + .include.add(resolve('src/icons')) + .end() + .use('svg-sprite-loader') + .loader('svg-sprite-loader') + .options({ + symbolId: 'icon-[name]' + }) + .end() + + config + .when(process.env.NODE_ENV !== 'development', + config => { + config + .plugin('ScriptExtHtmlWebpackPlugin') + .after('html') + .use('script-ext-html-webpack-plugin', [{ + // `runtime` must same as runtimeChunk name. default is `runtime` + inline: /runtime\..*\.js$/ + }]) + .end() + config + .optimization.splitChunks({ + chunks: 'all', + cacheGroups: { + libs: { + name: 'chunk-libs', + test: /[\\/]node_modules[\\/]/, + priority: 10, + chunks: 'initial' // only package third parties that are initially dependent + }, + elementUI: { + name: 'chunk-elementUI', // split elementUI into a single package + priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app + test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm + }, + commons: { + name: 'chunk-commons', + test: resolve('src/components'), // can customize your rules + minChunks: 3, // minimum common number + priority: 5, + reuseExistingChunk: true + } + } + }) + // https:// webpack.js.org/configuration/optimization/#optimizationruntimechunk + config.optimization.runtimeChunk('single') + } + ) + } +}
欢迎您,{{pNameAndDepartmentNameAndPostName}} {{name}}