diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..ea6e20f --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +# http://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +insert_final_newline = false +trim_trailing_whitespace = false diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..8a41aa8 --- /dev/null +++ b/.env.development @@ -0,0 +1,12 @@ +# just a flag +ENV = 'development' + +# base api +VUE_APP_BASE_API = '/api' + +## 配置测试和本地开发时的 接口地址 +# VUE_APP_URL = "http://jianguan.yyundong.com/shgfapi" + + +VUE_APP_URL = "http://127.0.0.1:7102" +##VUE_APP_URL = "http://8.130.39.13:8112" diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..f9657ef --- /dev/null +++ b/.env.production @@ -0,0 +1,8 @@ +# just a flag +ENV = 'production' + +# base api +VUE_APP_BASE_API = '/api' + +## 配置 正式接口地址 +VUE_APP_URL = "http://120.46.131.15:8111" diff --git a/.env.staging b/.env.staging new file mode 100644 index 0000000..a8793a0 --- /dev/null +++ b/.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/.eslintignore b/.eslintignore new file mode 100644 index 0000000..e6529fc --- /dev/null +++ b/.eslintignore @@ -0,0 +1,4 @@ +build/*.js +src/assets +public +dist diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..bb624b1 --- /dev/null +++ b/.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/.gitignore b/.gitignore index a2a1041..eb35fb3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,120 +1,31 @@ -# ---> Node -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* -.pnpm-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -*.lcov - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories +**/.DS_Store +**/*.log node_modules/ -jspm_packages/ - -# Snowpack dependency directory (https://snowpack.dev/) -web_modules/ - -# TypeScript cache -*.tsbuildinfo - -# Optional npm cache directory -.npm -# Optional eslint cache -.eslintcache +# local env files +.env.local +.env.*.local -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env -.env.test -.env.production - -# parcel-bundler cache (https://parceljs.org/) -.cache -.parcel-cache - -# Next.js build output -.next -out - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and not Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ +# Log files +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* -# TernJS port file -.tern-port +tests/**/coverage/ +tests/e2e/reports +selenium-debug.log -# Stores VSCode versions used for testing VSCode extensions -.vscode-test +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.local -# yarn v2 -.yarn/cache -.yarn/unplugged -.yarn/build-state.yml -.yarn/install-state.gz -.pnp.* +package-lock.json +yarn.lock +yyth-ui/ diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..f4be7a0 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: 10 +script: npm run test +notifications: + email: false diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..6151575 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017-present PanJiaChen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000..c934913 --- /dev/null +++ b/babel.config.js @@ -0,0 +1,15 @@ +module.exports = { + presets: [ + // https://github.com/vuejs/vue-cli/tree/master/packages/@vue/babel-preset-app + // '@vue/cli-plugin-babel/preset', + ['@vue/app', { useBuiltIns: 'entry' }] + ], + '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/jest.config.js b/jest.config.js new file mode 100644 index 0000000..143cdc8 --- /dev/null +++ b/jest.config.js @@ -0,0 +1,24 @@ +module.exports = { + moduleFileExtensions: ['js', 'jsx', 'json', 'vue'], + transform: { + '^.+\\.vue$': 'vue-jest', + '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': + 'jest-transform-stub', + '^.+\\.jsx?$': 'babel-jest' + }, + moduleNameMapper: { + '^@/(.*)$': '/src/$1' + }, + snapshotSerializers: ['jest-serializer-vue'], + testMatch: [ + '**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)' + ], + collectCoverageFrom: ['src/utils/**/*.{js,vue}', '!src/utils/auth.js', '!src/utils/request.js', 'src/components/**/*.{js,vue}'], + coverageDirectory: '/tests/unit/coverage', + // 'collectCoverage': true, + 'coverageReporters': [ + 'lcov', + 'text-summary' + ], + testURL: 'http://localhost/' +} diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 0000000..ed079e2 --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "baseUrl": "./", + "paths": { + "@/*": ["src/*"] + } + }, + "exclude": ["node_modules", "dist"] +} diff --git a/mock/index.js b/mock/index.js new file mode 100644 index 0000000..c514c13 --- /dev/null +++ b/mock/index.js @@ -0,0 +1,57 @@ +const Mock = require('mockjs') +const { param2Obj } = require('./utils') + +const user = require('./user') +const table = require('./table') + +const mocks = [ + ...user, + ...table +] + +// for front mock +// please use it cautiously, it will redefine XMLHttpRequest, +// which will cause many of your third-party libraries to be invalidated(like progress event). +function mockXHR() { + // mock patch + // https://github.com/nuysoft/Mock/issues/300 + Mock.XHR.prototype.proxy_send = Mock.XHR.prototype.send + Mock.XHR.prototype.send = function() { + if (this.custom.xhr) { + this.custom.xhr.withCredentials = this.withCredentials || false + + if (this.responseType) { + this.custom.xhr.responseType = this.responseType + } + } + this.proxy_send(...arguments) + } + + function XHR2ExpressReqWrap(respond) { + return function(options) { + let result = null + if (respond instanceof Function) { + const { body, type, url } = options + // https://expressjs.com/en/4x/api.html#req + result = respond({ + method: type, + body: JSON.parse(body), + query: param2Obj(url) + }) + } else { + result = respond + } + return Mock.mock(result) + } + } + + for (const i of mocks) { + Mock.mock(new RegExp(i.url), i.type || 'get', XHR2ExpressReqWrap(i.response)) + } +} + +module.exports = { + mocks, + mockXHR +} + diff --git a/mock/mock-server.js b/mock/mock-server.js new file mode 100644 index 0000000..8941ec0 --- /dev/null +++ b/mock/mock-server.js @@ -0,0 +1,81 @@ +const chokidar = require('chokidar') +const bodyParser = require('body-parser') +const chalk = require('chalk') +const path = require('path') +const Mock = require('mockjs') + +const mockDir = path.join(process.cwd(), 'mock') + +function registerRoutes(app) { + let mockLastIndex + const { mocks } = require('./index.js') + const mocksForServer = mocks.map(route => { + return responseFake(route.url, route.type, route.response) + }) + for (const mock of mocksForServer) { + app[mock.type](mock.url, mock.response) + mockLastIndex = app._router.stack.length + } + const mockRoutesLength = Object.keys(mocksForServer).length + return { + mockRoutesLength: mockRoutesLength, + mockStartIndex: mockLastIndex - mockRoutesLength + } +} + +function unregisterRoutes() { + Object.keys(require.cache).forEach(i => { + if (i.includes(mockDir)) { + delete require.cache[require.resolve(i)] + } + }) +} + +// for mock server +const responseFake = (url, type, respond) => { + return { + url: new RegExp(`${process.env.VUE_APP_BASE_API}${url}`), + type: type || 'get', + response(req, res) { + console.log('request invoke:' + req.path) + res.json(Mock.mock(respond instanceof Function ? respond(req, res) : respond)) + } + } +} + +module.exports = app => { + // parse app.body + // https://expressjs.com/en/4x/api.html#req.body + app.use(bodyParser.json()) + app.use(bodyParser.urlencoded({ + extended: true + })) + + const mockRoutes = registerRoutes(app) + var mockRoutesLength = mockRoutes.mockRoutesLength + var mockStartIndex = mockRoutes.mockStartIndex + + // watch files, hot reload mock server + chokidar.watch(mockDir, { + ignored: /mock-server/, + ignoreInitial: true + }).on('all', (event, path) => { + if (event === 'change' || event === 'add') { + try { + // remove mock routes stack + app._router.stack.splice(mockStartIndex, mockRoutesLength) + + // clear routes cache + unregisterRoutes() + + const mockRoutes = registerRoutes(app) + mockRoutesLength = mockRoutes.mockRoutesLength + mockStartIndex = mockRoutes.mockStartIndex + + console.log(chalk.magentaBright(`\n > Mock Server hot reload success! changed ${path}`)) + } catch (error) { + console.log(chalk.redBright(error)) + } + } + }) +} diff --git a/mock/table.js b/mock/table.js new file mode 100644 index 0000000..bd0e013 --- /dev/null +++ b/mock/table.js @@ -0,0 +1,29 @@ +const Mock = require('mockjs') + +const data = Mock.mock({ + 'items|30': [{ + id: '@id', + title: '@sentence(10, 20)', + 'status|1': ['published', 'draft', 'deleted'], + author: 'name', + display_time: '@datetime', + pageviews: '@integer(300, 5000)' + }] +}) + +module.exports = [ + { + url: '/vue-admin-template/table/list', + type: 'get', + response: config => { + const items = data.items + return { + code: 20000, + data: { + total: items.length, + items: items + } + } + } + } +] diff --git a/mock/user.js b/mock/user.js new file mode 100644 index 0000000..7555338 --- /dev/null +++ b/mock/user.js @@ -0,0 +1,84 @@ + +const tokens = { + admin: { + token: 'admin-token' + }, + editor: { + token: 'editor-token' + } +} + +const users = { + 'admin-token': { + roles: ['admin'], + introduction: 'I am a super administrator', + avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif', + name: 'Super Admin' + }, + 'editor-token': { + roles: ['editor'], + introduction: 'I am an editor', + avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif', + name: 'Normal Editor' + } +} + +module.exports = [ + // user login + { + url: '/vue-admin-template/user/login', + type: 'post', + response: config => { + const { username } = config.body + const token = tokens[username] + + // mock error + if (!token) { + return { + code: 60204, + message: 'Account and password are incorrect.' + } + } + + return { + code: 20000, + data: token + } + } + }, + + // get user info + { + url: '/vue-admin-template/user/info\.*', + type: 'get', + response: config => { + const { token } = config.query + const info = users[token] + + // mock error + if (!info) { + return { + code: 50008, + message: 'Login failed, unable to get user details.' + } + } + + return { + code: 20000, + data: info + } + } + }, + + // user logout + { + url: '/vue-admin-template/user/logout', + type: 'post', + response: _ => { + return { + code: 20000, + data: 'success' + } + } + } +] diff --git a/mock/utils.js b/mock/utils.js new file mode 100644 index 0000000..95cc27d --- /dev/null +++ b/mock/utils.js @@ -0,0 +1,25 @@ +/** + * @param {string} url + * @returns {Object} + */ +function param2Obj(url) { + const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ') + if (!search) { + return {} + } + const obj = {} + const searchArr = search.split('&') + searchArr.forEach(v => { + const index = v.indexOf('=') + if (index !== -1) { + const name = v.substring(0, index) + const val = v.substring(index + 1, v.length) + obj[name] = val + } + }) + return obj +} + +module.exports = { + param2Obj +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..b49e755 --- /dev/null +++ b/package.json @@ -0,0 +1,74 @@ +{ + "name": "yxt-yyth-ui-admin", + "version": "1.1.0", + "description": "", + "author": "", + "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": { + "echarts": "^5.4.3", + "axios": "^0.24.0", + "bpmn-js": "^9.2.2", + "core-js": "^3.8.3", + "ejs": "^2.7.4", + "element-ui": "^2.15.14", + "js-cookie": "2.2.0", + "moment": "^2.29.1", + "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.14", + "vue-amap": "^0.5.10", + "vue-router": "^3.5.1", + "vuex": "3.6.0", + "vuex-persistedstate": "^4.0.0", + "xcrud": "^0.4.19" + }, + "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/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..10473ef --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,8 @@ +// https://github.com/michael-ciniawsky/postcss-load-config + +module.exports = { + 'plugins': { + // to edit target browsers: use "browserslist" field in package.json + 'autoprefixer': {} + } +} diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..79c7c9b Binary files /dev/null and b/public/favicon.ico differ diff --git a/public/image/liuchengtu.jpg b/public/image/liuchengtu.jpg new file mode 100644 index 0000000..8d891be Binary files /dev/null and b/public/image/liuchengtu.jpg differ diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..fa2be91 --- /dev/null +++ b/public/index.html @@ -0,0 +1,17 @@ + + + + + + + + <%= webpackConfig.name %> + + + +
+ + + diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..b587fd5 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,17 @@ + + + diff --git a/src/api/Common/Upload.js b/src/api/Common/Upload.js new file mode 100644 index 0000000..c3be171 --- /dev/null +++ b/src/api/Common/Upload.js @@ -0,0 +1,13 @@ +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 const uploadFile = '/api/base/v1/basemanufactorsubscription/pictureUpload' + +export const uploadimg_tuiku = '/api/base/v1/basemanufacturerretwareveh/pictureUpload' diff --git a/src/api/Common/areaPicker.js b/src/api/Common/areaPicker.js new file mode 100644 index 0000000..f43d0a3 --- /dev/null +++ b/src/api/Common/areaPicker.js @@ -0,0 +1,25 @@ +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 + }) +} diff --git a/src/api/Common/dictcommons.js b/src/api/Common/dictcommons.js new file mode 100644 index 0000000..d0654c2 --- /dev/null +++ b/src/api/Common/dictcommons.js @@ -0,0 +1,100 @@ +import request from '@/utils/request' + +// 根据登陆人sid查询分公司sid(常用接口) +export function getPathSidByUserSid(data) { + return request({ + url: '/portal/v1/sysstafforg/getPathSidByUserSid', + method: 'get', + params: data + }) +} + +// 根据当前登录人orgSidPath(全路径sid)查询分公司 +export function getOrgSidByPath(data) { + return request({ + url: '/portal/v1/sysstafforg/getOrgSidByPath', + method: 'get', + params: data + }) +} + +// 当前用户创建申请时判断该用户是否有该菜单的操作权限 +export function selectHaveMessage(data) { + return request({ + url: '/portal/v1/sysuser/selectHaveMessage ', + method: 'post', + data: data, + headers: { 'Content-Type': 'application/json' } + }) +} + +// 根据分公司sid查询分公司名称 +export function fetchBySid(sid) { + return request({ + url: 'portal/v1/sysorganization/fetchBySid/' + sid, + method: 'get' + }) +} + +// 根据分公司Sid获取分公司下部门对应的采购系统 +export function fetchDetailsByUseOrgSid(data) { + return request({ + url: '/base/v1/basepurchasesystem/fetchDetailsByUseOrgSid/' + data, + method: 'GET' + }) +} + +// 获取下拉框 +export function typeValues(data) { + return request({ + url: '/portal/v1/dictcommon/typeValues', + method: 'get', + params: data + }) +} + +// 根据用户sid获取本分公司下的银行账号 +export function selAccountByOrgSid(data) { + return request({ + url: '/fin/v1/finmanufacturerbank/selAccountByOrgSid', + method: 'get', + params: data + }) +} + +// 品牌下拉 +export function brandDown(data) { + return request({ + url: '/base/v1/basevehiclebrand/namesDown', + method: 'get', + params: data + }) +} + +// 根据当前用户orgSidPath的管理层级获取相应的信息(集团获取所有分公司信息、事业部获取旗下的分公司信息、分公司获取该分公司的信息) +export function selectOrgByLevel(data) { + return request({ + url: '/base/v1/basevehicleout/selectOrgByLevel', + method: 'post', + params: data + }) +} + +// 查询角色列表 +export function roleList(data) { + return request({ + url: '/portal/v1/sysrole/listAll', + method: 'post', + data: data, + headers: { 'Content-Type': 'application/json' } + }) +} + +// 根据当前登录用户分公司sid获取本分公司下存放地点 +export function fetchByUseOrgSid(data) { + return request({ + url: 'scm/v1/scmwarehouse/fetchByUseOrgSid', + method: 'get', + params: data + }) +} diff --git a/src/api/Common/permission.js b/src/api/Common/permission.js new file mode 100644 index 0000000..5c3b562 --- /dev/null +++ b/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/src/api/User/login.js b/src/api/User/login.js new file mode 100644 index 0000000..399fda6 --- /dev/null +++ b/src/api/User/login.js @@ -0,0 +1,35 @@ +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() diff --git a/src/api/brank/brank.js b/src/api/brank/brank.js new file mode 100644 index 0000000..8524e8a --- /dev/null +++ b/src/api/brank/brank.js @@ -0,0 +1,50 @@ +import request from '@/utils/request' + +export default { + + addInfo: function(data) { + return request({ + baseURL: "/api/crm", + url: '/v1/loanbankinformation/save', + method: 'post', + data: data + }); + }, + + fetchBySid: function(sid) { + return request({ + baseURL: '/api/crm', + url: '/v1/loanbankinformation/getBankInfBySid/' + sid + }) + }, + + updateData: function(data) { + return request({ + baseURL: "/api/crm", + url: '/v1/loanbankinformation/update', + method: 'post', + data: data + }); + }, + + delBySids: function(sid) { + return request({ + baseURL: '/api/crm', + url: 'v1/loanbankinformation/delete/' + sid, + method: 'delete' + }) + }, + + // 查询分页列表 + listPage: function(params) { + return request({ + baseURL: '/api/crm', + url: '/v1/loanbankinformation/listPage', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json' + } + }) + }, +} diff --git a/src/api/customermanagement/customermanagement.js b/src/api/customermanagement/customermanagement.js new file mode 100644 index 0000000..592a738 --- /dev/null +++ b/src/api/customermanagement/customermanagement.js @@ -0,0 +1,187 @@ +import request from '@/utils/request' + +// 接口文档名称:潜在客户信息 +// Pc端客户基础信息条件分页查询数据的列表 +export function pagerList(data) { + return request({ + url: '/crm/v1/crmcustomertemp/listPage', + method: 'post', + data: data, + headers: { + 'Content-Type': 'application/json' + } + }) +} + +// 客户查询 +export function listPageByOrgPathSid(data) { + return request({ + url: '/crm/v1/crmcustomertemp/listPageByOrgPathSid', + method: 'post', + data: data, + headers: { + 'Content-Type': 'application/json' + } + }) +} + +// 添加 已改 +export function savePcCustomerInfo(data) { + return request({ + url: '/crm/v1/crmcustomertemp/save', + data: data, + method: 'post', + headers: { + 'Content-Type': 'application/json' + } + }) +} + +// -- 修改 已改 +export function updatePcCustomerInfo(data) { + return request({ + url: '/crm/v1/crmcustomertemp/update/' + data.sid, + method: 'post', + data: data, + headers: { + 'Content-Type': 'application/json' + } + }) +} + +// 详情、编辑回显 已改 +export function getPcCustomerInfoBySid(data) { + return request({ + url: '/crm/v1/crmcustomertemp/fetchSid/' + data, + method: 'get' + }) +} + +// 删除 已改 +export function deleteBySids(data) { + return request({ + url: '/crm/v1/crmcustomertemp/del/', + method: 'delete', + data: data, + headers: { + 'Content-Type': 'application/json' + } + }) +} + +// 推送财务数据--是否确定车架号选择否 +export function sendFinCustomer(data, orgCode) { + return request({ + url: '/crm/v1/crmcustomertemp/sendFinCustomer/' + orgCode, + method: 'post', + data: data, + headers: { + 'Content-Type': 'application/json' + } + }) +} + +// 推送财务数据--是否确定车架号选择是 +export function sendFinCustomerTrue(data) { + return request({ + url: '/crm/v1/crmcustomertemp/sendFinCustomerTrue', + method: 'post', + data: data, + headers: { + 'Content-Type': 'application/json' + } + }) +} + + + + +// 推送财务数据--是否确定车架号选择是,选择车辆 +export function vehicleCrmList(data) { + return request({ + url: '/base/v1/basevehicle/vehicleCrmList', + method: 'post', + data: data, + headers: { + 'Content-Type': 'application/json' + } + }) +} + +// Pc端分页查询中介单位(经销商) +export function getPcDistributorList(data) { + return request({ + url: '/base/v1/basedistributor/getPcDistributorList', + method: 'get' + }) +} + +// 挂靠公司模糊查询下拉框 +export function namesDown(data) { + return request({ + url: '/base/v1/baseaffiliatcompany/namesDown', + method: 'get', + params: data + }) +} + +// 据客户名称模糊搜索客户名称下拉框 +export function KeHuNamesDown(data) { + return request({ + url: '/crm/v1/crmcustomer/namesDown', + method: 'get', + params: data + }) +} + +// Pc端保存登记单信息 +export function saveCustomersAll(data) { + return request({ + url: '/crm/v1/crmcustomer/saveCustomersAll', data, + method: 'post', + // data: data, + headers: { + 'Content-Type': 'application/json' + } + }) +} + +// Pc端修改登记单信息 +export function updateCustomersAll(data) { + return request({ + url: '/crm/v1/crmcustomer/updateCustomersAll/' + data, + method: 'post', + // data: data, + headers: { + 'Content-Type': 'application/json' + } + }) +} + +// Pc端登记单修改回显及详情信息 +export function selectCustomersAll(data) { + return request({ + url: '/crm/v1/crmcustomer/selectCustomersAll?sid=' + data, + method: 'get' + }) +} + +// +export function listPage(data) { + return request({ + url: '/crm/v1/crmcustomer/listPage', + method: 'post', + data: data, + headers: { + 'Content-Type': 'application/json' + } + }) +} + +// Pc端根据sid查询客户基础信息是否存在 +export function getPcCustomerMobileAndName(mobile, name) { + return request({ + url: '/crm/v1/crmcustomer/getPcCustomerMobileAndName?mobile=' + mobile + '&name=' + name, + method: 'get' + }) +} diff --git a/src/api/dataDict/datadict.js b/src/api/dataDict/datadict.js new file mode 100644 index 0000000..95fe6a1 --- /dev/null +++ b/src/api/dataDict/datadict.js @@ -0,0 +1,114 @@ +import request from '@/utils/request' + +export default { + // 11111111111111111111111 + + // 行业品类 分类列表 + industryListPage: function(params) { + return request({ + baseURL: '/api/crm', + url: '/v1/industrydictionary/listPage', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json' + } + }) + }, + // 行业品类 通过sid删除一条或多条记录 + industryDelBySids: function(sid) { + return request({ + baseURL: '/api/crm', + url: '/v1/industrydictionary/delete/' + sid, + method: 'delete' + }) + }, + // 行业品类 保存行业品类 + saveindustry: function(params) { + return request({ + baseURL: '/api/crm', + url: '/v1/industrydictionary/save', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json' + } + }) + }, + + // 行业品类 修改行业品类 + updateindustry: function(params) { + return request({ + baseURL: '/api/crm', + url: '/v1/industrydictionary/update', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json' + } + }) + }, + + // 行业品类 通过sid查询一条记录 + industryFetchBySid: function(sid) { + return request({ + baseURL: '/api/crm', + url: '/v1/industrydictionary/getIndustryBySid/' + sid + }) + }, + + + + // 类别维护 类别列表 + classListPage: function(params) { + return request({ + baseURL: '/api/crm', + url: '/v1/projtypedictionary/listPage', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json' + } + }) + }, + // 类别维护 通过sid删除一条或多条记录 + classDelBySids: function(sid) { + return request({ + baseURL: '/api/crm', + url: '/v1/projtypedictionary/delete/' + sid, + method: 'delete' + }) + }, + // 类别维护 保存行业品类 + saveClass: function(params) { + return request({ + baseURL: '/api/crm', + url: '/v1/projtypedictionary/save', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json' + } + }) + }, + // 类别维护 修改行业品类 + updateClass: function(params) { + return request({ + baseURL: '/api/crm', + url: '/v1/projtypedictionary/update', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json' + } + }) + }, + // 类别维护 通过sid查询一条记录 + classFetchBySid: function(sid) { + return request({ + baseURL: '/api/crm', + url: '/v1/projtypedictionary/getProjTypeBySid/' + sid + }) + }, + +} diff --git a/src/api/enterprise/enterprise.js b/src/api/enterprise/enterprise.js new file mode 100644 index 0000000..73b8edf --- /dev/null +++ b/src/api/enterprise/enterprise.js @@ -0,0 +1,50 @@ +import request from '@/utils/request' + +export default { + + addInfo: function(data) { + return request({ + baseURL: "/api/crm", + url: '/v1/enterpriseinformation/save', + method: 'post', + data: data + }); + }, + + fetchBySid: function(sid) { + return request({ + baseURL: '/api/crm', + url: '/v1/enterpriseinformation/getEnterpriseBySid/' + sid + }) + }, + + updateData: function(data) { + return request({ + baseURL: "/api/crm", + url: '/v1/enterpriseinformation/update', + method: 'post', + data: data + }); + }, + + delBySids: function(sid) { + return request({ + baseURL: '/api/crm', + url: '/v1/enterpriseinformation/delete/' + sid, + method: 'delete' + }) + }, + + // 查询分页列表 + listPage: function(params) { + return request({ + baseURL: '/api/crm', + url: '/v1/enterpriseinformation/listPage', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json' + } + }) + }, +} diff --git a/src/api/flowInstrument/flowInstrument.js b/src/api/flowInstrument/flowInstrument.js new file mode 100644 index 0000000..72a187c --- /dev/null +++ b/src/api/flowInstrument/flowInstrument.js @@ -0,0 +1,58 @@ +import request from '@/utils/request' +let tokens = window.sessionStorage.getItem('tokenValue') +export default { + + // 查询分页列表 + listPage: function(params) { + return request({ + url: '/cyf/flowmeter/listPage', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json', + 'token': tokens + } + }) + }, + + addInfo: function(data) { + return request({ + url: '/cyf/flowmeter/save', + method: 'post', + data: data + }); + }, + + fetchBySid: function(sid) { + return request({ + url: '/cyf/flowmeter/getTankBySid/' + sid + }) + }, + + updateData: function(data) { + return request({ + url: '/cyf/flowmeter/update', + method: 'post', + data: data + }); + }, + + delBySids: function(sid) { + return request({ + url: '/cyf/flowmeter/delete/' + sid, + method: 'delete' + }) + }, + + flowmeterList: function(params) { + return request({ + url: '/cyf/flowmeter/flowmeterList', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json', + 'token': tokens + } + }) + }, +} diff --git a/src/api/gfApi/index.js b/src/api/gfApi/index.js new file mode 100644 index 0000000..add5aed --- /dev/null +++ b/src/api/gfApi/index.js @@ -0,0 +1,197 @@ +import request from '@/utils/request' +let tokens = window.sessionStorage.getItem('tokenValue') +export default { + // 获取供应商信息 + getSupplierList: function(params) { + return request({ + url: '/gf/supplier/getSupplierList', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json', + 'token': tokens + } + }) + }, + // 查询合同 + getContract: function(params) { + return request({ + url: '/gf/supplier/getContract', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json', + 'token': tokens + } + }) + }, + // 物料管理列表 + getMaterielList: function(params) { + return request({ + url: '/gf/materiel/getMaterielList', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json', + 'token': tokens + } + }) + }, + // 获取仓库列表 + getWarehouse: function(params) { + return request({ + url: '/gf/warehouse/getWarehouse', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json', + 'token': tokens + } + }) + }, + // 获取物料品牌列表 + getMaterialBrandList: function(params) { + return request({ + url: '/gf/materialBrand/getMaterialBrandList', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json', + 'token': tokens + } + }) + }, + // 获取物料组 + getMaterialGroup: function() { + return request({ + url: '/gf/materialBrand/getMaterialGroup', + method: 'get' + }) + }, + // 获取出库申请 + getOutStock: function(params) { + return request({ + url: '/gf/outStock/getOutStock ', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json', + 'token': tokens + } + }) + }, + // 查看出库申请详细信息 + getOutStockInfo: function(id) { + return request({ + url: '/gf/outStock/getOutStockInfo/' + id, + method: 'get', + }) + }, + // 获取出库记录列表 + getOutStockMaterielList: function(params) { + return request({ + url: '/gf/outStock/getOutStockMaterielList', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json', + 'token': tokens + } + }) + }, + // 获取入库申请 + getInStockList: function(params) { + return request({ + url: '/gf/inStock/getInStockList', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json', + 'token': tokens + } + }) + }, + // 获取入库记录列表 + getInStockMaterielList: function(params) { + return request({ + url: '/gf/inStock/getInStockMaterielList', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json', + 'token': tokens + } + }) + }, + // 查看出库申请详细信息 + getInStockInfo: function(id) { + return request({ + url: '/gf/inStock/getInStockInfo/' + id, + method: 'get', + }) + }, + // 获取出入库记录 + getStockRecordList: function(params) { + return request({ + url: '/gf/stockRecord/getStockRecordList', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json', + 'token': tokens + } + }) + }, + // 获取库存管理 + getInventoryList: function(params) { + return request({ + url: '/gf/inventory/getInventoryList', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json', + 'token': tokens + } + }) + }, + // 获取出入库合同管理 + getPurchaseContractList: function(params) { + return request({ + url: '/gf/purchaseContract/getPurchaseContractList', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json', + 'token': tokens + } + }) + }, + // 获取出库类型 + getOutType: function() { + return request({ + url: '/gf/outStock/getOutType', + method: 'get' + }) + }, + // 获取入库类型 + getInType: function() { + return request({ + url: '/gf/inStock/getInType', + method: 'get' + }) + }, + // 获取代理商 + getAgentList: function() { + return request({ + url: '/gf/stockRecord/getAgentList ', + method: 'get' + }) + }, + // 获取审核状态 + getStatus: function() { + return request({ + url: '/gf/stockRecord/getStatus', + method: 'get' + }) + }, +} diff --git a/src/api/oilTank/oilTank.js b/src/api/oilTank/oilTank.js new file mode 100644 index 0000000..f15cd23 --- /dev/null +++ b/src/api/oilTank/oilTank.js @@ -0,0 +1,100 @@ +import request from '@/utils/request' +let tokens = window.sessionStorage.getItem('tokenValue') +export default { + + // 查询分页列表 + listPage: function(params) { + return request({ + url: '/cyf/tankinfo/listPage', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json', + 'token': tokens + } + }) + }, + selectTankInformation: function(params) { + return request({ + url: '/cyf/tankinfo/selectTankInformation', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json', + 'token': tokens + } + }) + }, + + addInfo: function(data) { + return request({ + url: '/cyf/tankinfo/save', + method: 'post', + data: data + }); + }, + + crudeinfoList: function(params) { + return request({ + url: '/cyf/crudeinfo/list', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json', + 'token': tokens + } + }) + }, + + selectRecordBySid: function(sid) { + return request({ + url: '/cyf/crudeinventory/selectRecordBySid/' + sid, + method: 'get' + }) + }, + + + fetchBySid: function(sid) { + return request({ + url: '/cyf/crudeinfo/getCrudeBySid/' + sid + }) + }, + + updateData: function(data) { + return request({ + url: '/cyf/crudeinfo/update', + method: 'post', + data: data + }); + }, + + delBySids: function(sid) { + return request({ + url: '/cyf/crudeinfo/delete/' + sid, + method: 'delete' + }) + }, + + // 保存每次读取库存 + saveInfo: function(data) { + return request({ + url: '/cyf/crudeinventory/save', + method: 'post', + data: data + }); + }, + + // 登记库存列表 + crudeinventoryList: function(data) { + return request({ + url: '/cyf/crudeinventory/listPage', + method: 'post', + data: data, + headers: { + 'Content-Type': 'application/json', + 'token': tokens + } + }); + }, + +} diff --git a/src/api/oilType/oilType.js b/src/api/oilType/oilType.js new file mode 100644 index 0000000..58ab53c --- /dev/null +++ b/src/api/oilType/oilType.js @@ -0,0 +1,47 @@ +import request from '@/utils/request' +let tokens = window.sessionStorage.getItem('tokenValue') +export default { + + // 查询分页列表 + listPage: function(params) { + return request({ + url: '/cyf/crudeinfo/listPage', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json', + 'token': tokens + } + }) + }, + + addInfo: function(data) { + return request({ + url: '/cyf/crudeinfo/save', + method: 'post', + data: data + }); + }, + + fetchBySid: function(sid) { + return request({ + url: '/cyf/crudeinfo/getCrudeBySid/' + sid + }) + }, + + updateData: function(data) { + return request({ + url: '/cyf/crudeinfo/update', + method: 'post', + data: data + }); + }, + + delBySids: function(sid) { + return request({ + url: '/cyf/crudeinfo/delete/' + sid, + method: 'delete' + }) + }, + +} diff --git a/src/api/oilTypeInAndOutBound/oilTypeInAndOutBound.js b/src/api/oilTypeInAndOutBound/oilTypeInAndOutBound.js new file mode 100644 index 0000000..210ebce --- /dev/null +++ b/src/api/oilTypeInAndOutBound/oilTypeInAndOutBound.js @@ -0,0 +1,117 @@ +import request from '@/utils/request' +let tokens = window.sessionStorage.getItem('tokenValue') +export default { + // 获取油罐 + tankList: function(params) { + return request({ + url: '/cyf/tankinfo/tankList', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json', + 'token': tokens + } + }) + }, + // 获取油罐by Sid + tankLisBySid: function(sid) { + return request({ + url: '/cyf/tankinfo/listByType/' + sid + }) + }, + // 获取入库信息 Sid + selectStorageBySid: function(sid) { + return request({ + url: 'cyf/crudestorage/selectStorageBySid/' + sid, + method: 'get', + }) + }, + // 获取出库信息 Sid + getCrudeBySid: function(sid) { + return request({ + url: 'cyf/crudeoutbound/getCrudeBySid/' + sid, + method: 'get', + }) + }, + + + // 入库 + + logPagerList: function(params) { + return request({ + url: '/cyf/crudestorage/listPage', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json', + 'token': tokens + } + }) + }, + + intAddInfo: function(data) { + return request({ + url: '/cyf/crudestorage/save', + method: 'post', + data: data + }); + }, + + + // 出库 + // 查询分页列表 + in112PagerList: function(params) { + return request({ + url: '/cyf/crudeoutbound/listPage', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json', + 'token': tokens + } + }) + }, + + outAddInfo: function(data) { + return request({ + url: '/cyf/crudeoutbound/save', + method: 'post', + data: data + }); + }, + + crudeinfoList: function(params) { + return request({ + url: '/cyf/crudeinfo/list', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json', + 'token': tokens + } + }) + }, + + + fetchBySid: function(sid) { + return request({ + url: '/cyf/crudeinfo/getCrudeBySid/' + sid + }) + }, + + updateData: function(data) { + return request({ + url: '/cyf/crudeinfo/update', + method: 'post', + data: data + }); + }, + + delBySids: function(sid) { + return request({ + url: '/cyf/crudeinfo/delete/' + sid, + method: 'delete' + }) + }, + +} diff --git a/src/api/portal/Upload.js b/src/api/portal/Upload.js new file mode 100644 index 0000000..76bd232 --- /dev/null +++ b/src/api/portal/Upload.js @@ -0,0 +1,30 @@ +import request from '@/utils/request' +import qs from 'qs' +// 统一请求路径前缀 +const base = process.env.VUE_APP_URL + +// 文件上传接口 +export const uploadFile = '/api/file/upload' +// export const uploadFile = process.env.VUE_APP_BASE_API + '/customer/file/upload' + + + +// 上传图片 +// export function imageUpload(data) { +// return request({ +// url: '/portal/file/upload', +// method: 'post', +// data, +// headers: { 'Content-Type': 'multipart/form-data' } +// }) +// } + +// 移除图片 +export function deleteFilesOss(data) { + return request({ + url: '/base/v1/baseVehicleAppendixs/deleteFilesOss', + method: 'post', + data: qs.stringify(data), + // headers: { 'Content-Type': 'multipart/form-data' } + }) +} diff --git a/src/api/portal/areaPicker.js b/src/api/portal/areaPicker.js new file mode 100644 index 0000000..8a2eee3 --- /dev/null +++ b/src/api/portal/areaPicker.js @@ -0,0 +1,34 @@ +import request from '@/utils/request' + +// 获取省/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, + }) +} +// // 区域列表(省市县均可用) +// export function selectsList(data) { +// return request({ +// url: '/portal/v1/regions/selectsList', data, +// method: 'post', +// headers: { 'Content-Type': 'application/json' } +// }) +// } diff --git a/src/api/rawMaterialInAndOutBound/rawMaterialInAndOutBound.js b/src/api/rawMaterialInAndOutBound/rawMaterialInAndOutBound.js new file mode 100644 index 0000000..feffb8a --- /dev/null +++ b/src/api/rawMaterialInAndOutBound/rawMaterialInAndOutBound.js @@ -0,0 +1,97 @@ +import request from '@/utils/request' +let tokens = window.sessionStorage.getItem('tokenValue') +export default { + // 获取原料 + inventoryList: function(params) { + return request({ + url: '/cyf/rawinventory/inventoryList', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json', + 'token': tokens + } + }) + }, + + // 入库 + + logPagerList: function(params) { + return request({ + url: '/cyf/rawstorage/listPage', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json', + 'token': tokens + } + }) + }, + + intAddInfo: function(data) { + return request({ + url: '/cyf/rawstorage/save', + method: 'post', + data: data + }); + }, + + + // 出库 + // 查询分页列表 + + in112PagerList: function(params) { + return request({ + url: '/cyf/rawoutbound/listPage', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json', + 'token': tokens + } + }) + }, + + outAddInfo: function(data) { + return request({ + url: '/cyf/rawoutbound/save', + method: 'post', + data: data + }); + }, + + crudeinfoList: function(params) { + return request({ + url: '/cyf/crudeinfo/list', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json', + 'token': tokens + } + }) + }, + + + fetchBySid: function(sid) { + return request({ + url: '/cyf/crudeinfo/getCrudeBySid/' + sid + }) + }, + + updateData: function(data) { + return request({ + url: '/cyf/crudeinfo/update', + method: 'post', + data: data + }); + }, + + delBySids: function(sid) { + return request({ + url: '/cyf/crudeinfo/delete/' + sid, + method: 'delete' + }) + }, + +} diff --git a/src/api/rawMaterialInfo/rawMaterialInfo.js b/src/api/rawMaterialInfo/rawMaterialInfo.js new file mode 100644 index 0000000..ab4a0ea --- /dev/null +++ b/src/api/rawMaterialInfo/rawMaterialInfo.js @@ -0,0 +1,69 @@ +import request from '@/utils/request' +let tokens = window.sessionStorage.getItem('tokenValue') +export default { + + // 查询分页列表 + listPage: function(params) { + return request({ + url: '/cyf/rawinventory/listPage', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json', + 'token': tokens + } + }) + }, + + addInfo: function(data) { + return request({ + url: '/cyf/rawinventory/save', + method: 'post', + data: data + }); + }, + + rawMaterialType: function(params) { + return request({ + url: '/cyf/rawtype/typeList', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json', + 'token': tokens + } + }) + }, + + + fetchBySid: function(sid) { + return request({ + url: '/cyf/crudeinfo/getCrudeBySid/' + sid + }) + }, + + updateData: function(data) { + return request({ + url: '/cyf/crudeinfo/update', + method: 'post', + data: data + }); + }, + + delBySids: function(sid) { + return request({ + url: '/cyf/crudeinfo/delete/' + sid, + method: 'delete' + }) + }, + + // 保存每次读取库存 + saveInfo: function(data) { + return request({ + url: '/cyf/crudeinventory/save', + method: 'post', + data: data + }); + }, + +} diff --git a/src/api/rawMaterialType/rawMaterialType.js b/src/api/rawMaterialType/rawMaterialType.js new file mode 100644 index 0000000..1003730 --- /dev/null +++ b/src/api/rawMaterialType/rawMaterialType.js @@ -0,0 +1,48 @@ +import request from '@/utils/request' + +let tokens = window.sessionStorage.getItem('tokenValue') +export default { + + // 查询分页列表 + listPage: function(params) { + return request({ + url: '/cyf/rawtype/listPage', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json', + 'token': tokens + } + }) + }, + + addInfo: function(data) { + return request({ + url: '/cyf/rawtype/save', + method: 'post', + data: data + }); + }, + + fetchBySid: function(sid) { + return request({ + url: '/cyf/rawtype/getTypeBySid/' + sid + }) + }, + + updateData: function(data) { + return request({ + url: '/cyf/rawtype/update', + method: 'post', + data: data + }); + }, + + delBySids: function(sid) { + return request({ + url: '/cyf/rawtype/delete/' + sid, + method: 'delete' + }) + }, + +} diff --git a/src/api/storehouse/storehouse.js b/src/api/storehouse/storehouse.js new file mode 100644 index 0000000..1441026 --- /dev/null +++ b/src/api/storehouse/storehouse.js @@ -0,0 +1,50 @@ +import request from '@/utils/request' + +export default { + + addInfo: function(data) { + return request({ + baseURL: "/api/crm", + url: '/v1/warehouselocation/save', + method: 'post', + data: data + }); + }, + + fetchBySid: function(sid) { + return request({ + baseURL: '/api/crm', + url: '/v1/warehouselocation/getWarehouseBySid//' + sid + }) + }, + + updateData: function(data) { + return request({ + baseURL: "/api/crm", + url: '/v1/warehouselocation/update', + method: 'post', + data: data + }); + }, + + delBySids: function(sid) { + return request({ + baseURL: '/api/crm', + url: '/v1/warehouselocation/delete/' + sid, + method: 'delete' + }) + }, + + // 查询分页列表 + listPage: function(params) { + return request({ + baseURL: '/api/crm', + url: '/v1/warehouselocation/listPage', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json' + } + }) + }, +} diff --git a/src/api/supplier/supplier.js b/src/api/supplier/supplier.js new file mode 100644 index 0000000..c9ac328 --- /dev/null +++ b/src/api/supplier/supplier.js @@ -0,0 +1,62 @@ +import request from '@/utils/request' + +let tokens = window.sessionStorage.getItem('tokenValue') +export default { + + // 查询分页列表 + listPage: function(params) { + return request({ + url: '/cyf/supplier/listPage', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json', + 'token': tokens + } + }) + }, + + addInfo: function(data) { + return request({ + url: '/cyf/supplier/save', + method: 'post', + data: data + }); + }, + + + fetchBySid: function(sid) { + return request({ + url: '/cyf/supplier/getSupplierBySid/' + sid + }) + }, + + updateData: function(data) { + return request({ + url: '/cyf/supplier/update', + method: 'post', + data: data + }); + }, + + delBySids: function(sid) { + return request({ + url: '/cyf/supplier/delete/' + sid, + method: 'delete' + }) + }, + + // 供应商 数据字典 + supplierList: function(params) { + return request({ + url: '/cyf/supplier/supplierList', + method: 'post', + data: params, + headers: { + 'Content-Type': 'application/json', + 'token': tokens + } + }) + }, + +} diff --git a/src/api/system/Role/role.js b/src/api/system/Role/role.js new file mode 100644 index 0000000..7eb16f3 --- /dev/null +++ b/src/api/system/Role/role.js @@ -0,0 +1,47 @@ +import request from '@/utils/request' +import qs from 'qs' +const 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({ + baseURL: '/api', + url: '/portal/v1/sysmenu/sourcemenutree', + method: 'POST', + async: false, +// data: {userSid: data.userSid, sourceSid: '000011'}, + data: data, + headers: { 'Content-Type': 'application/json', + 'token': tokens } + }) +} + +// 获取角色的主页菜单 +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({ + baseURL: '/api', + url: '/portal/v1/sysuser/loginDetails', + method: 'post', + data: data, + headers: { + 'Content-Type': 'application/json' + } + }) +} diff --git a/src/api/system/user/login.js b/src/api/system/user/login.js new file mode 100644 index 0000000..5f3aa3b --- /dev/null +++ b/src/api/system/user/login.js @@ -0,0 +1,38 @@ +import request from '@/utils/request' +import qs from 'qs' + + +//获取菜单 分页列表 +export function login1(data) { + return request({ + url: '/portal/v1/sysuser/login', + method: 'POST', + data: data, + headers: {'Content-Type': 'application/json', +// 'token':tokens + } + }) +} + +class user { + login(data) { // 登录 + return request({ + url: '/portal/v1/sysuser/login', + method: 'post', + data + }) + } + logout() { // 退出 + return request({ + url: '/vue-admin-template/user/logout', + method: 'post' + }) + } + updatePassword(data) { // 退出修改密码 + return request({ + url: '/system/user/updatePassword', + method: 'post', + data: qs.stringify(data) + }) + } +} diff --git a/src/api/user.js b/src/api/user.js new file mode 100644 index 0000000..3a36b7c --- /dev/null +++ b/src/api/user.js @@ -0,0 +1,72 @@ +import request from '@/utils/request' +// eslint-disable-next-line no-unused-vars +import qs from 'qs' + +// 登录 +export function doLogin(data) { + return request({ + url: '/gf/sys/doLogin', + method: 'post', + data: data, + headers: { 'Content-Type': 'application/json' } + }) +} +// 获取登录人员信息 + export function getUserById(sid) { + return request({ + url: '/cyf/sys/getUserById/' + sid + }) + + } +// 登录 +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' + }) +} + +export function logout(data) { // 退出 + return request({ + url: '/portal/v1/sysuser/signOut', + method: 'post', + data: qs.stringify(data) + }) +} diff --git a/src/assets/404_images/404.png b/src/assets/404_images/404.png new file mode 100644 index 0000000..3d8e230 Binary files /dev/null and b/src/assets/404_images/404.png differ diff --git a/src/assets/404_images/404_cloud.png b/src/assets/404_images/404_cloud.png new file mode 100644 index 0000000..c6281d0 Binary files /dev/null and b/src/assets/404_images/404_cloud.png differ diff --git a/src/assets/home/anrui.png b/src/assets/home/anrui.png new file mode 100644 index 0000000..31de90a Binary files /dev/null and b/src/assets/home/anrui.png differ diff --git a/src/assets/home/bIcon1.png b/src/assets/home/bIcon1.png new file mode 100644 index 0000000..f2c1381 Binary files /dev/null and b/src/assets/home/bIcon1.png differ diff --git a/src/assets/home/bIcon2.png b/src/assets/home/bIcon2.png new file mode 100644 index 0000000..4076e7e Binary files /dev/null and b/src/assets/home/bIcon2.png differ diff --git a/src/assets/home/bIcon3.png b/src/assets/home/bIcon3.png new file mode 100644 index 0000000..bbc6c51 Binary files /dev/null and b/src/assets/home/bIcon3.png differ diff --git a/src/assets/home/bIcon4.png b/src/assets/home/bIcon4.png new file mode 100644 index 0000000..a7ef26f Binary files /dev/null and b/src/assets/home/bIcon4.png differ diff --git a/src/assets/home/bIcon5.png b/src/assets/home/bIcon5.png new file mode 100644 index 0000000..6840128 Binary files /dev/null and b/src/assets/home/bIcon5.png differ diff --git a/src/assets/home/bIcon6.png b/src/assets/home/bIcon6.png new file mode 100644 index 0000000..61c88a8 Binary files /dev/null and b/src/assets/home/bIcon6.png differ diff --git a/src/assets/home/bIcon7.png b/src/assets/home/bIcon7.png new file mode 100644 index 0000000..209f1a5 Binary files /dev/null and b/src/assets/home/bIcon7.png differ diff --git a/src/assets/home/bIcon8.png b/src/assets/home/bIcon8.png new file mode 100644 index 0000000..f2c2e33 Binary files /dev/null and b/src/assets/home/bIcon8.png differ diff --git a/src/assets/home/bj.jpg b/src/assets/home/bj.jpg new file mode 100644 index 0000000..209287a Binary files /dev/null and b/src/assets/home/bj.jpg differ diff --git a/src/assets/home/bottomBg.png b/src/assets/home/bottomBg.png new file mode 100644 index 0000000..334f614 Binary files /dev/null and b/src/assets/home/bottomBg.png differ diff --git a/src/assets/home/line.png b/src/assets/home/line.png new file mode 100644 index 0000000..b828cc3 Binary files /dev/null and b/src/assets/home/line.png differ diff --git a/src/assets/home/ltBg.png b/src/assets/home/ltBg.png new file mode 100644 index 0000000..7c487f7 Binary files /dev/null and b/src/assets/home/ltBg.png differ diff --git a/src/assets/home/ltIcon1.png b/src/assets/home/ltIcon1.png new file mode 100644 index 0000000..0c17623 Binary files /dev/null and b/src/assets/home/ltIcon1.png differ diff --git a/src/assets/home/ltIcon2.png b/src/assets/home/ltIcon2.png new file mode 100644 index 0000000..f4f2531 Binary files /dev/null and b/src/assets/home/ltIcon2.png differ diff --git a/src/assets/home/ltIcon3.png b/src/assets/home/ltIcon3.png new file mode 100644 index 0000000..a69ef7c Binary files /dev/null and b/src/assets/home/ltIcon3.png differ diff --git a/src/assets/home/ltIcon4.png b/src/assets/home/ltIcon4.png new file mode 100644 index 0000000..740cfb3 Binary files /dev/null and b/src/assets/home/ltIcon4.png differ diff --git a/src/assets/home/notice.png b/src/assets/home/notice.png new file mode 100644 index 0000000..f964245 Binary files /dev/null and b/src/assets/home/notice.png differ diff --git a/src/assets/home/rtBg.png b/src/assets/home/rtBg.png new file mode 100644 index 0000000..987b9cb Binary files /dev/null and b/src/assets/home/rtBg.png differ diff --git a/src/assets/images/arrow.png b/src/assets/images/arrow.png new file mode 100644 index 0000000..9e4c33b Binary files /dev/null and b/src/assets/images/arrow.png differ diff --git a/src/assets/images/bdrysh.png b/src/assets/images/bdrysh.png new file mode 100644 index 0000000..c0acee9 Binary files /dev/null and b/src/assets/images/bdrysh.png differ diff --git a/src/assets/images/btn.png b/src/assets/images/btn.png new file mode 100644 index 0000000..4aaf9f0 Binary files /dev/null and b/src/assets/images/btn.png differ diff --git a/src/assets/images/cdgl.png b/src/assets/images/cdgl.png new file mode 100644 index 0000000..d3e20f9 Binary files /dev/null and b/src/assets/images/cdgl.png differ diff --git a/src/assets/images/cxjl.png b/src/assets/images/cxjl.png new file mode 100644 index 0000000..9928500 Binary files /dev/null and b/src/assets/images/cxjl.png differ diff --git a/src/assets/images/czsc.png b/src/assets/images/czsc.png new file mode 100644 index 0000000..00a8f4f Binary files /dev/null and b/src/assets/images/czsc.png differ diff --git a/src/assets/images/dwrysh.png b/src/assets/images/dwrysh.png new file mode 100644 index 0000000..f9804b7 Binary files /dev/null and b/src/assets/images/dwrysh.png differ diff --git a/src/assets/images/dwxxgl.png b/src/assets/images/dwxxgl.png new file mode 100644 index 0000000..c1d9769 Binary files /dev/null and b/src/assets/images/dwxxgl.png differ diff --git a/src/assets/images/dy.png b/src/assets/images/dy.png new file mode 100644 index 0000000..de8157e Binary files /dev/null and b/src/assets/images/dy.png differ diff --git a/src/assets/images/head.png b/src/assets/images/head.png new file mode 100644 index 0000000..abd7101 Binary files /dev/null and b/src/assets/images/head.png differ diff --git a/src/assets/images/info.png b/src/assets/images/info.png new file mode 100644 index 0000000..b681da3 Binary files /dev/null and b/src/assets/images/info.png differ diff --git a/src/assets/images/jcxx.png b/src/assets/images/jcxx.png new file mode 100644 index 0000000..d9c4067 Binary files /dev/null and b/src/assets/images/jcxx.png differ diff --git a/src/assets/images/jggl.png b/src/assets/images/jggl.png new file mode 100644 index 0000000..ab4c742 Binary files /dev/null and b/src/assets/images/jggl.png differ diff --git a/src/assets/images/jlsc.png b/src/assets/images/jlsc.png new file mode 100644 index 0000000..6061b81 Binary files /dev/null and b/src/assets/images/jlsc.png differ diff --git a/src/assets/images/jsgl.png b/src/assets/images/jsgl.png new file mode 100644 index 0000000..2da71f4 Binary files /dev/null and b/src/assets/images/jsgl.png differ diff --git a/src/assets/images/jsxd.png b/src/assets/images/jsxd.png new file mode 100644 index 0000000..e5b3ed0 Binary files /dev/null and b/src/assets/images/jsxd.png differ diff --git a/src/assets/images/login/OAKQ.png b/src/assets/images/login/OAKQ.png new file mode 100644 index 0000000..d237cfb Binary files /dev/null and b/src/assets/images/login/OAKQ.png differ diff --git a/src/assets/images/login/bg2-img.png b/src/assets/images/login/bg2-img.png new file mode 100644 index 0000000..b53bf40 Binary files /dev/null and b/src/assets/images/login/bg2-img.png differ diff --git a/src/assets/images/login/bgimg.jpg b/src/assets/images/login/bgimg.jpg new file mode 100644 index 0000000..1bd964a Binary files /dev/null and b/src/assets/images/login/bgimg.jpg differ diff --git a/src/assets/images/login/nose.png b/src/assets/images/login/nose.png new file mode 100644 index 0000000..b6c8086 Binary files /dev/null and b/src/assets/images/login/nose.png differ diff --git a/src/assets/images/login/pasw.png b/src/assets/images/login/pasw.png new file mode 100644 index 0000000..5244bc4 Binary files /dev/null and b/src/assets/images/login/pasw.png differ diff --git a/src/assets/images/login/user.png b/src/assets/images/login/user.png new file mode 100644 index 0000000..e370214 Binary files /dev/null and b/src/assets/images/login/user.png differ diff --git a/src/assets/images/lzrysh.png b/src/assets/images/lzrysh.png new file mode 100644 index 0000000..03125a1 Binary files /dev/null and b/src/assets/images/lzrysh.png differ diff --git a/src/assets/images/org/headerimg.png b/src/assets/images/org/headerimg.png new file mode 100644 index 0000000..661f06b Binary files /dev/null and b/src/assets/images/org/headerimg.png differ diff --git a/src/assets/images/org/jian.png b/src/assets/images/org/jian.png new file mode 100644 index 0000000..1e528b0 Binary files /dev/null and b/src/assets/images/org/jian.png differ diff --git a/src/assets/images/org/sfz.png b/src/assets/images/org/sfz.png new file mode 100644 index 0000000..7f79b47 Binary files /dev/null and b/src/assets/images/org/sfz.png differ diff --git a/src/assets/images/org/sqs.png b/src/assets/images/org/sqs.png new file mode 100644 index 0000000..8071e21 Binary files /dev/null and b/src/assets/images/org/sqs.png differ diff --git a/src/assets/images/org/success.png b/src/assets/images/org/success.png new file mode 100644 index 0000000..6a54c31 Binary files /dev/null and b/src/assets/images/org/success.png differ diff --git a/src/assets/images/org/yyzz.png b/src/assets/images/org/yyzz.png new file mode 100644 index 0000000..2a11019 Binary files /dev/null and b/src/assets/images/org/yyzz.png differ diff --git a/src/assets/images/place.png b/src/assets/images/place.png new file mode 100644 index 0000000..5e36be9 Binary files /dev/null and b/src/assets/images/place.png differ diff --git a/src/assets/images/qjsh.png b/src/assets/images/qjsh.png new file mode 100644 index 0000000..85c2ce8 Binary files /dev/null and b/src/assets/images/qjsh.png differ diff --git a/src/assets/images/ryda.png b/src/assets/images/ryda.png new file mode 100644 index 0000000..4cddf39 Binary files /dev/null and b/src/assets/images/ryda.png differ diff --git a/src/assets/images/rzgl.png b/src/assets/images/rzgl.png new file mode 100644 index 0000000..068ae3b Binary files /dev/null and b/src/assets/images/rzgl.png differ diff --git a/src/assets/images/select.png b/src/assets/images/select.png new file mode 100644 index 0000000..0a70ffa Binary files /dev/null and b/src/assets/images/select.png differ diff --git a/src/assets/images/sjcc.png b/src/assets/images/sjcc.png new file mode 100644 index 0000000..6f01ae0 Binary files /dev/null and b/src/assets/images/sjcc.png differ diff --git a/src/assets/images/sjzd.png b/src/assets/images/sjzd.png new file mode 100644 index 0000000..06af6b9 Binary files /dev/null and b/src/assets/images/sjzd.png differ diff --git a/src/assets/images/tjfx.png b/src/assets/images/tjfx.png new file mode 100644 index 0000000..e097e3d Binary files /dev/null and b/src/assets/images/tjfx.png differ diff --git a/src/assets/images/tjfx2.png b/src/assets/images/tjfx2.png new file mode 100644 index 0000000..681993c Binary files /dev/null and b/src/assets/images/tjfx2.png differ diff --git a/src/assets/images/wenjian.png b/src/assets/images/wenjian.png new file mode 100644 index 0000000..163e441 Binary files /dev/null and b/src/assets/images/wenjian.png differ diff --git a/src/assets/images/xgmm.png b/src/assets/images/xgmm.png new file mode 100644 index 0000000..46b8d5c Binary files /dev/null and b/src/assets/images/xgmm.png differ diff --git a/src/assets/images/xtbg.png b/src/assets/images/xtbg.png new file mode 100644 index 0000000..8ac2bfc Binary files /dev/null and b/src/assets/images/xtbg.png differ diff --git a/src/assets/images/xtgl.png b/src/assets/images/xtgl.png new file mode 100644 index 0000000..2eeed54 Binary files /dev/null and b/src/assets/images/xtgl.png differ diff --git a/src/assets/images/xxzx.png b/src/assets/images/xxzx.png new file mode 100644 index 0000000..0e3c150 Binary files /dev/null and b/src/assets/images/xxzx.png differ diff --git a/src/assets/images/zwsm.png b/src/assets/images/zwsm.png new file mode 100644 index 0000000..9489169 Binary files /dev/null and b/src/assets/images/zwsm.png differ diff --git a/src/assets/loginImg/account.png b/src/assets/loginImg/account.png new file mode 100644 index 0000000..0531b4a Binary files /dev/null and b/src/assets/loginImg/account.png differ diff --git a/src/assets/loginImg/bgImg.png b/src/assets/loginImg/bgImg.png new file mode 100644 index 0000000..94dba71 Binary files /dev/null and b/src/assets/loginImg/bgImg.png differ diff --git a/src/assets/loginImg/cyf_logo.jpg b/src/assets/loginImg/cyf_logo.jpg new file mode 100644 index 0000000..126f209 Binary files /dev/null and b/src/assets/loginImg/cyf_logo.jpg differ diff --git a/src/assets/loginImg/logo.png b/src/assets/loginImg/logo.png new file mode 100644 index 0000000..346b6ae Binary files /dev/null and b/src/assets/loginImg/logo.png differ diff --git a/src/assets/loginImg/password.png b/src/assets/loginImg/password.png new file mode 100644 index 0000000..9426a01 Binary files /dev/null and b/src/assets/loginImg/password.png differ diff --git a/src/assets/loginImg/shgf.png b/src/assets/loginImg/shgf.png new file mode 100644 index 0000000..ab7daf4 Binary files /dev/null and b/src/assets/loginImg/shgf.png differ diff --git a/src/components/AreaPicker/index.vue b/src/components/AreaPicker/index.vue new file mode 100644 index 0000000..105c647 --- /dev/null +++ b/src/components/AreaPicker/index.vue @@ -0,0 +1,151 @@ + + + + + + diff --git a/src/components/Breadcrumb/index.vue b/src/components/Breadcrumb/index.vue new file mode 100644 index 0000000..29f9a04 --- /dev/null +++ b/src/components/Breadcrumb/index.vue @@ -0,0 +1,78 @@ + + + + + diff --git a/src/components/ButtonBar/index.vue b/src/components/ButtonBar/index.vue new file mode 100644 index 0000000..2024ee7 --- /dev/null +++ b/src/components/ButtonBar/index.vue @@ -0,0 +1,122 @@ + + + + + diff --git a/src/components/E-image/index.vue b/src/components/E-image/index.vue new file mode 100644 index 0000000..9401ce4 --- /dev/null +++ b/src/components/E-image/index.vue @@ -0,0 +1,45 @@ + + + + + diff --git a/src/components/ErrorLog/index.vue b/src/components/ErrorLog/index.vue new file mode 100644 index 0000000..6119c03 --- /dev/null +++ b/src/components/ErrorLog/index.vue @@ -0,0 +1,78 @@ + + + + + diff --git a/src/components/Hamburger/index.vue b/src/components/Hamburger/index.vue new file mode 100644 index 0000000..368b002 --- /dev/null +++ b/src/components/Hamburger/index.vue @@ -0,0 +1,44 @@ + + + + + diff --git a/src/components/Screenfull/index.vue b/src/components/Screenfull/index.vue new file mode 100644 index 0000000..4735604 --- /dev/null +++ b/src/components/Screenfull/index.vue @@ -0,0 +1,59 @@ + + + + + diff --git a/src/components/SizeSelect/index.vue b/src/components/SizeSelect/index.vue new file mode 100644 index 0000000..e88065b --- /dev/null +++ b/src/components/SizeSelect/index.vue @@ -0,0 +1,57 @@ + + + diff --git a/src/components/SvgIcon/index.vue b/src/components/SvgIcon/index.vue new file mode 100644 index 0000000..b07ded2 --- /dev/null +++ b/src/components/SvgIcon/index.vue @@ -0,0 +1,62 @@ + + + + + diff --git a/src/components/ThemePicker/index.vue b/src/components/ThemePicker/index.vue new file mode 100644 index 0000000..3879c5a --- /dev/null +++ b/src/components/ThemePicker/index.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/src/components/VehicleConfigurationSub/vehicleconfiguration.vue b/src/components/VehicleConfigurationSub/vehicleconfiguration.vue new file mode 100644 index 0000000..c24ec4b --- /dev/null +++ b/src/components/VehicleConfigurationSub/vehicleconfiguration.vue @@ -0,0 +1,368 @@ + + + + diff --git a/src/components/amap/amap.vue b/src/components/amap/amap.vue new file mode 100644 index 0000000..c7d643c --- /dev/null +++ b/src/components/amap/amap.vue @@ -0,0 +1,224 @@ + + + + + diff --git a/src/components/imgCodeRole/index.vue b/src/components/imgCodeRole/index.vue new file mode 100644 index 0000000..852d9f3 --- /dev/null +++ b/src/components/imgCodeRole/index.vue @@ -0,0 +1,149 @@ + + + + + diff --git a/src/components/pagination/index.vue b/src/components/pagination/index.vue new file mode 100644 index 0000000..29d8bc8 --- /dev/null +++ b/src/components/pagination/index.vue @@ -0,0 +1,136 @@ + + + + + diff --git a/src/components/pagination/pageye.vue b/src/components/pagination/pageye.vue new file mode 100644 index 0000000..c69dca4 --- /dev/null +++ b/src/components/pagination/pageye.vue @@ -0,0 +1,142 @@ + + + + + diff --git a/src/components/passwordSafe/index.vue b/src/components/passwordSafe/index.vue new file mode 100644 index 0000000..847af1b --- /dev/null +++ b/src/components/passwordSafe/index.vue @@ -0,0 +1,70 @@ + + + + + diff --git a/src/components/tab-search/index.vue b/src/components/tab-search/index.vue new file mode 100644 index 0000000..d0f1bfe --- /dev/null +++ b/src/components/tab-search/index.vue @@ -0,0 +1,82 @@ + + + + + diff --git a/src/components/uploadFile/FaImages.vue b/src/components/uploadFile/FaImages.vue new file mode 100644 index 0000000..492f4dd --- /dev/null +++ b/src/components/uploadFile/FaImages.vue @@ -0,0 +1,166 @@ + + + + + diff --git a/src/components/uploadFile/FileUpload.vue b/src/components/uploadFile/FileUpload.vue new file mode 100644 index 0000000..7f5fba3 --- /dev/null +++ b/src/components/uploadFile/FileUpload.vue @@ -0,0 +1,165 @@ + + + + + diff --git a/src/components/uploadFile/ImageUpload.vue b/src/components/uploadFile/ImageUpload.vue new file mode 100644 index 0000000..cadd39d --- /dev/null +++ b/src/components/uploadFile/ImageUpload.vue @@ -0,0 +1,131 @@ + + + + + diff --git a/src/components/uploadFile/ImageUploadChe.vue b/src/components/uploadFile/ImageUploadChe.vue new file mode 100644 index 0000000..7ef250b --- /dev/null +++ b/src/components/uploadFile/ImageUploadChe.vue @@ -0,0 +1,159 @@ + + + + + diff --git a/src/components/uploadFile/ManyImageUpload.vue b/src/components/uploadFile/ManyImageUpload.vue new file mode 100644 index 0000000..db0daf1 --- /dev/null +++ b/src/components/uploadFile/ManyImageUpload.vue @@ -0,0 +1,214 @@ + + + + + diff --git a/src/components/uploadFile/index.vue b/src/components/uploadFile/index.vue new file mode 100644 index 0000000..1b2b36b --- /dev/null +++ b/src/components/uploadFile/index.vue @@ -0,0 +1,116 @@ + + + + + diff --git a/src/components/uploadFile/upload.vue b/src/components/uploadFile/upload.vue new file mode 100644 index 0000000..a554e94 --- /dev/null +++ b/src/components/uploadFile/upload.vue @@ -0,0 +1,252 @@ + + + + + diff --git a/src/components/uploadFile/uploadImg.vue b/src/components/uploadFile/uploadImg.vue new file mode 100644 index 0000000..bbca827 --- /dev/null +++ b/src/components/uploadFile/uploadImg.vue @@ -0,0 +1,244 @@ + + + + + diff --git a/src/components/uploadFile/upload_changjiatuku.vue b/src/components/uploadFile/upload_changjiatuku.vue new file mode 100644 index 0000000..2c438ba --- /dev/null +++ b/src/components/uploadFile/upload_changjiatuku.vue @@ -0,0 +1,229 @@ + + + + + diff --git a/src/components/uploadFile/upload_chexing.vue b/src/components/uploadFile/upload_chexing.vue new file mode 100644 index 0000000..30a8108 --- /dev/null +++ b/src/components/uploadFile/upload_chexing.vue @@ -0,0 +1,242 @@ + + + + + diff --git a/src/components/uploadFile/upload_cunfang.vue b/src/components/uploadFile/upload_cunfang.vue new file mode 100644 index 0000000..dc7999d --- /dev/null +++ b/src/components/uploadFile/upload_cunfang.vue @@ -0,0 +1,234 @@ + + + + + diff --git a/src/components/uploadFile/upload_diaoche.vue b/src/components/uploadFile/upload_diaoche.vue new file mode 100644 index 0000000..15794cd --- /dev/null +++ b/src/components/uploadFile/upload_diaoche.vue @@ -0,0 +1,242 @@ + + + + + diff --git a/src/components/uploadFile/upload_jianchabiao.vue b/src/components/uploadFile/upload_jianchabiao.vue new file mode 100644 index 0000000..3958a50 --- /dev/null +++ b/src/components/uploadFile/upload_jianchabiao.vue @@ -0,0 +1,237 @@ + + + + + diff --git a/src/components/uploadFile/upload_maiduan.vue b/src/components/uploadFile/upload_maiduan.vue new file mode 100644 index 0000000..f96cae3 --- /dev/null +++ b/src/components/uploadFile/upload_maiduan.vue @@ -0,0 +1,243 @@ + + + + + diff --git a/src/components/uploadFile/upload_morebypicture.vue b/src/components/uploadFile/upload_morebypicture.vue new file mode 100644 index 0000000..e62b85e --- /dev/null +++ b/src/components/uploadFile/upload_morebypicture.vue @@ -0,0 +1,165 @@ + + + + + diff --git a/src/components/uploadFile/upload_picture.vue b/src/components/uploadFile/upload_picture.vue new file mode 100644 index 0000000..fbdfe60 --- /dev/null +++ b/src/components/uploadFile/upload_picture.vue @@ -0,0 +1,245 @@ + + + + + diff --git a/src/components/uploadFile/upload_yanchejiancha.vue b/src/components/uploadFile/upload_yanchejiancha.vue new file mode 100644 index 0000000..0e4c37c --- /dev/null +++ b/src/components/uploadFile/upload_yanchejiancha.vue @@ -0,0 +1,230 @@ + + + + + diff --git a/src/components/uploadFile/upload_yanchejianchaTuBiao.vue b/src/components/uploadFile/upload_yanchejianchaTuBiao.vue new file mode 100644 index 0000000..a3b9a45 --- /dev/null +++ b/src/components/uploadFile/upload_yanchejianchaTuBiao.vue @@ -0,0 +1,226 @@ + + + + + diff --git a/src/components/uploadFileimg/index.vue b/src/components/uploadFileimg/index.vue new file mode 100644 index 0000000..25c53d7 --- /dev/null +++ b/src/components/uploadFileimg/index.vue @@ -0,0 +1,104 @@ + + + + + diff --git a/src/components/uploadFileimg/upload.vue b/src/components/uploadFileimg/upload.vue new file mode 100644 index 0000000..e65f30c --- /dev/null +++ b/src/components/uploadFileimg/upload.vue @@ -0,0 +1,242 @@ + + + + + diff --git a/src/components/viewerjs/index.vue b/src/components/viewerjs/index.vue new file mode 100644 index 0000000..3d6f841 --- /dev/null +++ b/src/components/viewerjs/index.vue @@ -0,0 +1,55 @@ + + + + + diff --git a/src/icons/index.js b/src/icons/index.js new file mode 100644 index 0000000..2c6b309 --- /dev/null +++ b/src/icons/index.js @@ -0,0 +1,9 @@ +import Vue from 'vue' +import SvgIcon from '@/components/SvgIcon'// svg component + +// register globally +Vue.component('svg-icon', SvgIcon) + +const req = require.context('./svg', false, /\.svg$/) +const requireAll = requireContext => requireContext.keys().map(requireContext) +requireAll(req) diff --git a/src/icons/svg/404.svg b/src/icons/svg/404.svg new file mode 100644 index 0000000..6df5019 --- /dev/null +++ b/src/icons/svg/404.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/Import.svg b/src/icons/svg/Import.svg new file mode 100644 index 0000000..184327c --- /dev/null +++ b/src/icons/svg/Import.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/icons/svg/RMB.svg b/src/icons/svg/RMB.svg new file mode 100644 index 0000000..d12196a --- /dev/null +++ b/src/icons/svg/RMB.svg @@ -0,0 +1,2 @@ + diff --git a/src/icons/svg/bug.svg b/src/icons/svg/bug.svg new file mode 100644 index 0000000..05a150d --- /dev/null +++ b/src/icons/svg/bug.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/build.svg b/src/icons/svg/build.svg new file mode 100644 index 0000000..97c4688 --- /dev/null +++ b/src/icons/svg/build.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/button.svg b/src/icons/svg/button.svg new file mode 100644 index 0000000..904fddc --- /dev/null +++ b/src/icons/svg/button.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/cascader.svg b/src/icons/svg/cascader.svg new file mode 100644 index 0000000..e256024 --- /dev/null +++ b/src/icons/svg/cascader.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/chart.svg b/src/icons/svg/chart.svg new file mode 100644 index 0000000..27728fb --- /dev/null +++ b/src/icons/svg/chart.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/checkbox.svg b/src/icons/svg/checkbox.svg new file mode 100644 index 0000000..013fd3a --- /dev/null +++ b/src/icons/svg/checkbox.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/clipboard.svg b/src/icons/svg/clipboard.svg new file mode 100644 index 0000000..90923ff --- /dev/null +++ b/src/icons/svg/clipboard.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/code.svg b/src/icons/svg/code.svg new file mode 100644 index 0000000..ed4d23c --- /dev/null +++ b/src/icons/svg/code.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/color.svg b/src/icons/svg/color.svg new file mode 100644 index 0000000..44a81aa --- /dev/null +++ b/src/icons/svg/color.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/component.svg b/src/icons/svg/component.svg new file mode 100644 index 0000000..207ada3 --- /dev/null +++ b/src/icons/svg/component.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/cross.svg b/src/icons/svg/cross.svg new file mode 100644 index 0000000..277d865 --- /dev/null +++ b/src/icons/svg/cross.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/icons/svg/dashboard.svg b/src/icons/svg/dashboard.svg new file mode 100644 index 0000000..5317d37 --- /dev/null +++ b/src/icons/svg/dashboard.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/date-range.svg b/src/icons/svg/date-range.svg new file mode 100644 index 0000000..fda571e --- /dev/null +++ b/src/icons/svg/date-range.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/date.svg b/src/icons/svg/date.svg new file mode 100644 index 0000000..52dc73e --- /dev/null +++ b/src/icons/svg/date.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/del.svg b/src/icons/svg/del.svg new file mode 100644 index 0000000..7c5e8e2 --- /dev/null +++ b/src/icons/svg/del.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/icons/svg/dict.svg b/src/icons/svg/dict.svg new file mode 100644 index 0000000..4849377 --- /dev/null +++ b/src/icons/svg/dict.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/documentation.svg b/src/icons/svg/documentation.svg new file mode 100644 index 0000000..7043122 --- /dev/null +++ b/src/icons/svg/documentation.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/download.svg b/src/icons/svg/download.svg new file mode 100644 index 0000000..c896951 --- /dev/null +++ b/src/icons/svg/download.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/drag.svg b/src/icons/svg/drag.svg new file mode 100644 index 0000000..4185d3c --- /dev/null +++ b/src/icons/svg/drag.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/druid.svg b/src/icons/svg/druid.svg new file mode 100644 index 0000000..a2b4b4e --- /dev/null +++ b/src/icons/svg/druid.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/edit.svg b/src/icons/svg/edit.svg new file mode 100644 index 0000000..3a753f9 --- /dev/null +++ b/src/icons/svg/edit.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/icons/svg/education.svg b/src/icons/svg/education.svg new file mode 100644 index 0000000..7bfb01d --- /dev/null +++ b/src/icons/svg/education.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/email.svg b/src/icons/svg/email.svg new file mode 100644 index 0000000..74d25e2 --- /dev/null +++ b/src/icons/svg/email.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/example.svg b/src/icons/svg/example.svg new file mode 100644 index 0000000..46f42b5 --- /dev/null +++ b/src/icons/svg/example.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/excel.svg b/src/icons/svg/excel.svg new file mode 100644 index 0000000..74d97b8 --- /dev/null +++ b/src/icons/svg/excel.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/exit-fullscreen.svg b/src/icons/svg/exit-fullscreen.svg new file mode 100644 index 0000000..485c128 --- /dev/null +++ b/src/icons/svg/exit-fullscreen.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/export.svg b/src/icons/svg/export.svg new file mode 100644 index 0000000..5354b7d --- /dev/null +++ b/src/icons/svg/export.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/icons/svg/exwarehouse.svg b/src/icons/svg/exwarehouse.svg new file mode 100644 index 0000000..2b6092c --- /dev/null +++ b/src/icons/svg/exwarehouse.svg @@ -0,0 +1,2 @@ + diff --git a/src/icons/svg/eye-open.svg b/src/icons/svg/eye-open.svg new file mode 100644 index 0000000..88dcc98 --- /dev/null +++ b/src/icons/svg/eye-open.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/eye.svg b/src/icons/svg/eye.svg new file mode 100644 index 0000000..16ed2d8 --- /dev/null +++ b/src/icons/svg/eye.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/form.svg b/src/icons/svg/form.svg new file mode 100644 index 0000000..dcbaa18 --- /dev/null +++ b/src/icons/svg/form.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/fullscreen.svg b/src/icons/svg/fullscreen.svg new file mode 100644 index 0000000..0e86b6f --- /dev/null +++ b/src/icons/svg/fullscreen.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/github.svg b/src/icons/svg/github.svg new file mode 100644 index 0000000..db0a0d4 --- /dev/null +++ b/src/icons/svg/github.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/guide.svg b/src/icons/svg/guide.svg new file mode 100644 index 0000000..b271001 --- /dev/null +++ b/src/icons/svg/guide.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/icon.svg b/src/icons/svg/icon.svg new file mode 100644 index 0000000..82be8ee --- /dev/null +++ b/src/icons/svg/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/input.svg b/src/icons/svg/input.svg new file mode 100644 index 0000000..ab91381 --- /dev/null +++ b/src/icons/svg/input.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/international.svg b/src/icons/svg/international.svg new file mode 100644 index 0000000..e9b56ee --- /dev/null +++ b/src/icons/svg/international.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/job.svg b/src/icons/svg/job.svg new file mode 100644 index 0000000..2a93a25 --- /dev/null +++ b/src/icons/svg/job.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/language.svg b/src/icons/svg/language.svg new file mode 100644 index 0000000..0082b57 --- /dev/null +++ b/src/icons/svg/language.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/link.svg b/src/icons/svg/link.svg new file mode 100644 index 0000000..48197ba --- /dev/null +++ b/src/icons/svg/link.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/list.svg b/src/icons/svg/list.svg new file mode 100644 index 0000000..20259ed --- /dev/null +++ b/src/icons/svg/list.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/lock.svg b/src/icons/svg/lock.svg new file mode 100644 index 0000000..74fee54 --- /dev/null +++ b/src/icons/svg/lock.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/log.svg b/src/icons/svg/log.svg new file mode 100644 index 0000000..d879d33 --- /dev/null +++ b/src/icons/svg/log.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/logininfor.svg b/src/icons/svg/logininfor.svg new file mode 100644 index 0000000..267f844 --- /dev/null +++ b/src/icons/svg/logininfor.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/message.svg b/src/icons/svg/message.svg new file mode 100644 index 0000000..14ca817 --- /dev/null +++ b/src/icons/svg/message.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/money.svg b/src/icons/svg/money.svg new file mode 100644 index 0000000..c1580de --- /dev/null +++ b/src/icons/svg/money.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/monitor.svg b/src/icons/svg/monitor.svg new file mode 100644 index 0000000..bc308cb --- /dev/null +++ b/src/icons/svg/monitor.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/icons/svg/nested.svg b/src/icons/svg/nested.svg new file mode 100644 index 0000000..06713a8 --- /dev/null +++ b/src/icons/svg/nested.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/number.svg b/src/icons/svg/number.svg new file mode 100644 index 0000000..ad5ce9a --- /dev/null +++ b/src/icons/svg/number.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/online.svg b/src/icons/svg/online.svg new file mode 100644 index 0000000..330a202 --- /dev/null +++ b/src/icons/svg/online.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/password.svg b/src/icons/svg/password.svg new file mode 100644 index 0000000..e291d85 --- /dev/null +++ b/src/icons/svg/password.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/pdf.svg b/src/icons/svg/pdf.svg new file mode 100644 index 0000000..957aa0c --- /dev/null +++ b/src/icons/svg/pdf.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/people.svg b/src/icons/svg/people.svg new file mode 100644 index 0000000..2bd54ae --- /dev/null +++ b/src/icons/svg/people.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/peoples.svg b/src/icons/svg/peoples.svg new file mode 100644 index 0000000..aab852e --- /dev/null +++ b/src/icons/svg/peoples.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/phone.svg b/src/icons/svg/phone.svg new file mode 100644 index 0000000..ab8e8c4 --- /dev/null +++ b/src/icons/svg/phone.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/plus.svg b/src/icons/svg/plus.svg new file mode 100644 index 0000000..ab7b62f --- /dev/null +++ b/src/icons/svg/plus.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/icons/svg/post.svg b/src/icons/svg/post.svg new file mode 100644 index 0000000..2922c61 --- /dev/null +++ b/src/icons/svg/post.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/qq.svg b/src/icons/svg/qq.svg new file mode 100644 index 0000000..ee13d4e --- /dev/null +++ b/src/icons/svg/qq.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/question.svg b/src/icons/svg/question.svg new file mode 100644 index 0000000..cf75bd4 --- /dev/null +++ b/src/icons/svg/question.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/radio.svg b/src/icons/svg/radio.svg new file mode 100644 index 0000000..0cde345 --- /dev/null +++ b/src/icons/svg/radio.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/rate.svg b/src/icons/svg/rate.svg new file mode 100644 index 0000000..aa3b14d --- /dev/null +++ b/src/icons/svg/rate.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/redis.svg b/src/icons/svg/redis.svg new file mode 100644 index 0000000..2f1d62d --- /dev/null +++ b/src/icons/svg/redis.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/row.svg b/src/icons/svg/row.svg new file mode 100644 index 0000000..0780992 --- /dev/null +++ b/src/icons/svg/row.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/search.svg b/src/icons/svg/search.svg new file mode 100644 index 0000000..84233dd --- /dev/null +++ b/src/icons/svg/search.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/select.svg b/src/icons/svg/select.svg new file mode 100644 index 0000000..d628382 --- /dev/null +++ b/src/icons/svg/select.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/server.svg b/src/icons/svg/server.svg new file mode 100644 index 0000000..ca37b00 --- /dev/null +++ b/src/icons/svg/server.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/shopping.svg b/src/icons/svg/shopping.svg new file mode 100644 index 0000000..87513e7 --- /dev/null +++ b/src/icons/svg/shopping.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/size.svg b/src/icons/svg/size.svg new file mode 100644 index 0000000..ddb25b8 --- /dev/null +++ b/src/icons/svg/size.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/skill.svg b/src/icons/svg/skill.svg new file mode 100644 index 0000000..a3b7312 --- /dev/null +++ b/src/icons/svg/skill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/slider.svg b/src/icons/svg/slider.svg new file mode 100644 index 0000000..fbe4f39 --- /dev/null +++ b/src/icons/svg/slider.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/star.svg b/src/icons/svg/star.svg new file mode 100644 index 0000000..6cf86e6 --- /dev/null +++ b/src/icons/svg/star.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/submit.svg b/src/icons/svg/submit.svg new file mode 100644 index 0000000..e2a2957 --- /dev/null +++ b/src/icons/svg/submit.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/icons/svg/swagger.svg b/src/icons/svg/swagger.svg new file mode 100644 index 0000000..05d4e7b --- /dev/null +++ b/src/icons/svg/swagger.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/switch.svg b/src/icons/svg/switch.svg new file mode 100644 index 0000000..0ba61e3 --- /dev/null +++ b/src/icons/svg/switch.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/system.svg b/src/icons/svg/system.svg new file mode 100644 index 0000000..dba28cf --- /dev/null +++ b/src/icons/svg/system.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/icons/svg/tab.svg b/src/icons/svg/tab.svg new file mode 100644 index 0000000..b4b48e4 --- /dev/null +++ b/src/icons/svg/tab.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/table.svg b/src/icons/svg/table.svg new file mode 100644 index 0000000..0e3dc9d --- /dev/null +++ b/src/icons/svg/table.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/textarea.svg b/src/icons/svg/textarea.svg new file mode 100644 index 0000000..2709f29 --- /dev/null +++ b/src/icons/svg/textarea.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/theme.svg b/src/icons/svg/theme.svg new file mode 100644 index 0000000..5982a2f --- /dev/null +++ b/src/icons/svg/theme.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/time-range.svg b/src/icons/svg/time-range.svg new file mode 100644 index 0000000..13c1202 --- /dev/null +++ b/src/icons/svg/time-range.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/time.svg b/src/icons/svg/time.svg new file mode 100644 index 0000000..b376e32 --- /dev/null +++ b/src/icons/svg/time.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/tool.svg b/src/icons/svg/tool.svg new file mode 100644 index 0000000..c813067 --- /dev/null +++ b/src/icons/svg/tool.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/tree-table.svg b/src/icons/svg/tree-table.svg new file mode 100644 index 0000000..8aafdb8 --- /dev/null +++ b/src/icons/svg/tree-table.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/tree.svg b/src/icons/svg/tree.svg new file mode 100644 index 0000000..dd4b7dd --- /dev/null +++ b/src/icons/svg/tree.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/upload.svg b/src/icons/svg/upload.svg new file mode 100644 index 0000000..bae49c0 --- /dev/null +++ b/src/icons/svg/upload.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/user.svg b/src/icons/svg/user.svg new file mode 100644 index 0000000..0ba0716 --- /dev/null +++ b/src/icons/svg/user.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/validCode.svg b/src/icons/svg/validCode.svg new file mode 100644 index 0000000..cfb1021 --- /dev/null +++ b/src/icons/svg/validCode.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/wechat.svg b/src/icons/svg/wechat.svg new file mode 100644 index 0000000..c586e55 --- /dev/null +++ b/src/icons/svg/wechat.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svg/zip.svg b/src/icons/svg/zip.svg new file mode 100644 index 0000000..f806fc4 --- /dev/null +++ b/src/icons/svg/zip.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/svgo.yml b/src/icons/svgo.yml new file mode 100644 index 0000000..d11906a --- /dev/null +++ b/src/icons/svgo.yml @@ -0,0 +1,22 @@ +# replace default config + +# multipass: true +# full: true + +plugins: + + # - name + # + # or: + # - name: false + # - name: true + # + # or: + # - name: + # param1: 1 + # param2: 2 + +- removeAttrs: + attrs: + - 'fill' + - 'fill-rule' diff --git a/src/layout/components/AppMain.vue b/src/layout/components/AppMain.vue new file mode 100644 index 0000000..966c6c4 --- /dev/null +++ b/src/layout/components/AppMain.vue @@ -0,0 +1,48 @@ + + + + + + + diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue new file mode 100644 index 0000000..c3c64a5 --- /dev/null +++ b/src/layout/components/Navbar.vue @@ -0,0 +1,168 @@ + + + + + diff --git a/src/layout/components/Sidebar/FixiOSBug.js b/src/layout/components/Sidebar/FixiOSBug.js new file mode 100644 index 0000000..bc14856 --- /dev/null +++ b/src/layout/components/Sidebar/FixiOSBug.js @@ -0,0 +1,26 @@ +export default { + computed: { + device() { + return this.$store.state.app.device + } + }, + mounted() { + // In order to fix the click on menu on the ios device will trigger the mouseleave bug + // https://github.com/PanJiaChen/vue-element-admin/issues/1135 + this.fixBugIniOS() + }, + methods: { + fixBugIniOS() { + const $subMenu = this.$refs.subMenu + if ($subMenu) { + const handleMouseleave = $subMenu.handleMouseleave + $subMenu.handleMouseleave = (e) => { + if (this.device === 'mobile') { + return + } + handleMouseleave(e) + } + } + } + } +} diff --git a/src/layout/components/Sidebar/Item.vue b/src/layout/components/Sidebar/Item.vue new file mode 100644 index 0000000..aa1f5da --- /dev/null +++ b/src/layout/components/Sidebar/Item.vue @@ -0,0 +1,41 @@ + + + diff --git a/src/layout/components/Sidebar/Link.vue b/src/layout/components/Sidebar/Link.vue new file mode 100644 index 0000000..530b3d5 --- /dev/null +++ b/src/layout/components/Sidebar/Link.vue @@ -0,0 +1,43 @@ + + + diff --git a/src/layout/components/Sidebar/Logo.vue b/src/layout/components/Sidebar/Logo.vue new file mode 100644 index 0000000..040fab6 --- /dev/null +++ b/src/layout/components/Sidebar/Logo.vue @@ -0,0 +1,82 @@ + + + + + diff --git a/src/layout/components/Sidebar/SidebarItem.vue b/src/layout/components/Sidebar/SidebarItem.vue new file mode 100644 index 0000000..ebfa553 --- /dev/null +++ b/src/layout/components/Sidebar/SidebarItem.vue @@ -0,0 +1,117 @@ + + + + diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue new file mode 100644 index 0000000..c2ff43f --- /dev/null +++ b/src/layout/components/Sidebar/index.vue @@ -0,0 +1,282 @@ + + + diff --git a/src/layout/components/TagsView/ScrollPane.vue b/src/layout/components/TagsView/ScrollPane.vue new file mode 100644 index 0000000..e8d682b --- /dev/null +++ b/src/layout/components/TagsView/ScrollPane.vue @@ -0,0 +1,87 @@ + + + + + \ No newline at end of file diff --git a/src/layout/components/TagsView/index.vue b/src/layout/components/TagsView/index.vue new file mode 100644 index 0000000..487d00a --- /dev/null +++ b/src/layout/components/TagsView/index.vue @@ -0,0 +1,333 @@ + + + + + + + diff --git a/src/layout/components/index.js b/src/layout/components/index.js new file mode 100644 index 0000000..686faf6 --- /dev/null +++ b/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/src/layout/index.vue b/src/layout/index.vue new file mode 100644 index 0000000..b42aaf5 --- /dev/null +++ b/src/layout/index.vue @@ -0,0 +1,114 @@ + + + + + diff --git a/src/layout/mixin/ResizeHandler.js b/src/layout/mixin/ResizeHandler.js new file mode 100644 index 0000000..e8d0df8 --- /dev/null +++ b/src/layout/mixin/ResizeHandler.js @@ -0,0 +1,45 @@ +import store from '@/store' + +const { body } = document +const WIDTH = 992 // refer to Bootstrap's responsive design + +export default { + watch: { + $route(route) { + if (this.device === 'mobile' && this.sidebar.opened) { + store.dispatch('app/closeSideBar', { withoutAnimation: false }) + } + } + }, + beforeMount() { + window.addEventListener('resize', this.$_resizeHandler) + }, + beforeDestroy() { + window.removeEventListener('resize', this.$_resizeHandler) + }, + mounted() { + const isMobile = this.$_isMobile() + if (isMobile) { + store.dispatch('app/toggleDevice', 'mobile') + store.dispatch('app/closeSideBar', { withoutAnimation: true }) + } + }, + methods: { + // use $_ for mixins properties + // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential + $_isMobile() { + const rect = body.getBoundingClientRect() + return rect.width - 1 < WIDTH + }, + $_resizeHandler() { + if (!document.hidden) { + const isMobile = this.$_isMobile() + store.dispatch('app/toggleDevice', isMobile ? 'mobile' : 'desktop') + + if (isMobile) { + store.dispatch('app/closeSideBar', { withoutAnimation: true }) + } + } + } + } +} diff --git a/src/main.js b/src/main.js new file mode 100644 index 0000000..597415c --- /dev/null +++ b/src/main.js @@ -0,0 +1,130 @@ +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' +import '@/styles/index.scss' // global css +import App from './App' +import store from './store' +import router from './router' + +import '@/icons' // 引入icon文件夹下所有的svg +// 全局自定义组件 +import Pagination from '@/components/pagination/index.vue' +import tabsearch from '@/components/tab-search/index.vue' +import eimage from '@/components/E-image/index.vue' +import moment from 'moment' +import Print from '@/utils/print' // 引入附件的js文件 +import request from '@/utils/request' +import { setDefaultOrgPath, setDefaultOrgPathName, setStorage } from './utils/auth.js' +import VueAMap from 'vue-amap' + +Vue.use(ElementUI) + +// import '@/permission' //权限控制 + +Vue.prototype.$userInfo = null // 用户信息 +Vue.component('Pagination', Pagination) +Vue.component('tab-search', tabsearch) +Vue.component('eimage', eimage) +Vue.prototype.moment = moment +Vue.filter('dateFormat', function(dateStr, pattern = 'YYYY-MM-DD') { + return moment(dateStr).format(pattern) +}) +Vue.use(Print) // 注册 + +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 + +// let token = null +// token = GetQueryString('token') +// if (token) { +// setStorage(token) +// const href = window.location.href +// // href = href.split(`token=${token}`)[0] +// // window.location.href = href.slice(0, href.length - 1) +// } + +var one = window.location.href.indexOf('&organizationData') + 18 +if (parseInt(one) > 18) { + const data = window.location.href.substr(one) // url解码unescape()已从web中移除,尽量不使用 + var data1 = decodeURIComponent(data) + if (data1 !== undefined) { + const obj = JSON.parse(data1) + setDefaultOrgPath(obj.defaultOrgPath) + setDefaultOrgPathName(obj.defaultOrgPathName) + } +} + +// // 获取登录用户信息 +function getUserInfo() { +// return request({ +// baseURL: '/api', +// url: '/portal/v1/sysuser/loginDetails', +// method: 'post', +// headers: { +// 'Content-Type': 'application/json' +// } +// }).then(rep => { +// const data = rep.data +// const 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 +// } +// // 结果存入缓存 +// 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) + 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 +// } diff --git a/src/permission.js b/src/permission.js new file mode 100644 index 0000000..d9ee6a5 --- /dev/null +++ b/src/permission.js @@ -0,0 +1,39 @@ +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 { getRoleRouter } from '@/router/modules/components.js' + +const whiteList = ['/login', '/registUser', '/registOrg'] // no redirect whitelist + +router.beforeEach(async(to, from, next) => { + // start progress bar + NProgress.start() + // set page title + document.title = getPageTitle(to.meta.title) + // determine whether the user has logged in +//const hasToken = getStorage() + 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(() => { + // finish progress bar + NProgress.done() +}) diff --git a/src/router/index.js b/src/router/index.js new file mode 100644 index 0000000..fbe4d80 --- /dev/null +++ b/src/router/index.js @@ -0,0 +1,198 @@ +import Vue from 'vue' +import Router from 'vue-router' + +Vue.use(Router) + +/* Layout */ +import Layout from '@/layout' +/* 所有角色可以访问/没有权限要求的基页 */ + +import codemenu from './modules/codemenu' + +export const constantRoutes = [{ + path: '/redirect', + component: Layout, + hidden: true, + children: [{ + path: '/redirect/:path(.*)', + component: () => import('@/views/redirect/index.vue') + }] + }, + { + path: '/', + redirect: 'login' + }, { + 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: '/supervise', + component: Layout, + redirect: null, + meta: { + title: '进销存管理' + }, + children: [{ + path: '/supervise/oilTypeInBound', + component: () => + import('@/views/supervise/oilTypeInBound/index.vue'), + name: 'index', + meta: { + title: '出库申请' + } + }, + { + path: '/supervise/oilTypeOutBound', + component: () => + import('@/views/supervise/oilTypeOutBound/index.vue'), + name: 'index', + meta: { + title: '出库记录列表' + } + }, + { + path: '/supervise/recordOilTank', + component: () => + import('@/views/supervise/recordOilTank/index.vue'), + name: 'index', + meta: { + title: '入库申请' + } + }, + { + path: '/supervise/rukujilu', + component: () => + import('@/views/supervise/rukujilu/index.vue'), + name: 'index', + meta: { + title: '入库记录列表' + } + }, + { + path: '/supervise/churuku', + component: () => + import('@/views/supervise/churuku/index.vue'), + name: 'index', + meta: { + title: '出入库记录' + } + }, + { + path: '/supervise/inventory', + component: () => + import('@/views/supervise/inventory/index.vue'), + name: 'index', + meta: { + title: '库存管理' + } + }, + { + path: '/supervise/churukuHT', + component: () => + import('@/views/supervise/churukuHT/index.vue'), + name: 'index', + meta: { + title: '出入库合同管理' + } + }, + ] + }, { + path: '/MaterialBrand', + component: Layout, + redirect: '/MaterialBrand/index', + children: [{ + path: '/MaterialBrand/index', + component: () => import('@/views/MaterialBrand/index.vue'), + name: 'MaterialBrand', + meta: { + title: '物料品牌', + noCache: true + } + }] + },{ + path: '/materialManagement', + component: Layout, + redirect: '/materialManagement/index', + children: [{ + path: '/materialManagement/index', + component: () => import('@/views/materialManagement/index'), + name: 'materialManagement', + meta: { + title: '物料管理', + noCache: true + } + }] + },{ + path: '/storeManagement', + component: Layout, + redirect: '/storeManagement/index', + children: [{ + path: '/storeManagement/index', + component: () => import('@/views/storeManagement/index.vue'), + name: 'storeManagement', + meta: { + title: '仓库管理', + noCache: true + } + }] + },{ + path: '/supplierManagement', + component: Layout, + redirect: '/supplierManagement/index', + children: [{ + path: '/supplierManagement/index', + component: () => import('@/views/supplierManagement/index.vue'), + name: 'supplierManagement', + meta: { + title: '供应商管理', + noCache: true + } + }] + }, + ...codemenu, + { + path: '/404', + component: () => + import('@/views/404'), + hidden: true + } + // 404 page must be placed at the end !!! + // { path: '*', redirect: '/404', hidden: true } +] + +const createRouter = () => new Router({ + // mode: 'history', // require service support + scrollBehavior: () => ({ + y: 0 + }), + routes: constantRoutes +}) + +const router = createRouter() + +// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465 +export function resetRouter() { + const newRouter = createRouter() + router.matcher = newRouter.matcher // reset router +} + +export default router diff --git a/src/router/modules/codemenu.js b/src/router/modules/codemenu.js new file mode 100644 index 0000000..756e0b7 --- /dev/null +++ b/src/router/modules/codemenu.js @@ -0,0 +1,4 @@ +import Layout from '@/layout' + +const codemenu = [] +export default codemenu diff --git a/src/settings.js b/src/settings.js new file mode 100644 index 0000000..db66fd5 --- /dev/null +++ b/src/settings.js @@ -0,0 +1,16 @@ +module.exports = { + + title: '监管平台-光伏', + + /** + * @type {boolean} true | false + * @description Whether fix the header + */ + fixedHeader: false, + + /** + * @type {boolean} true | false + * @description Whether show the logo in sidebar + */ + sidebarLogo: false +} diff --git a/src/store/getters.js b/src/store/getters.js new file mode 100644 index 0000000..eb3a120 --- /dev/null +++ b/src/store/getters.js @@ -0,0 +1,4 @@ +const getters = { + orgSid: state => state.user.orgSid +} +export default getters diff --git a/src/store/index.js b/src/store/index.js new file mode 100644 index 0000000..4a2159a --- /dev/null +++ b/src/store/index.js @@ -0,0 +1,36 @@ +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: '' + + }, + mutations: { + + }, + actions: { + + }, + modules, + getters, +}) + +export default store diff --git a/src/store/modules/app.js b/src/store/modules/app.js new file mode 100644 index 0000000..45d89bb --- /dev/null +++ b/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/src/store/modules/errorLog.js b/src/store/modules/errorLog.js new file mode 100644 index 0000000..6b01f95 --- /dev/null +++ b/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/src/store/modules/permission.js b/src/store/modules/permission.js new file mode 100644 index 0000000..d56d1ba --- /dev/null +++ b/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/src/store/modules/settings.js b/src/store/modules/settings.js new file mode 100644 index 0000000..110533f --- /dev/null +++ b/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/src/store/modules/tagsView.js b/src/store/modules/tagsView.js new file mode 100644 index 0000000..57e7242 --- /dev/null +++ b/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/src/store/modules/user.js b/src/store/modules/user.js new file mode 100644 index 0000000..265a757 --- /dev/null +++ b/src/store/modules/user.js @@ -0,0 +1,17 @@ +const user = { + state:{ + orgSid: '' + }, + mutations: { + setOrgSid: (state, orgSid) => { + state.orgSid = orgSid + } + }, + actions: { + commitOrgSid({commit}, orgSid) { + commit('setOrgSid', orgSid) + } + } +} + +export default user diff --git a/src/store/modules/user1.js b/src/store/modules/user1.js new file mode 100644 index 0000000..e00ca0a --- /dev/null +++ b/src/store/modules/user1.js @@ -0,0 +1,150 @@ +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 + } + 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); + 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) + }) + }) + }, + + // remove token + // resetToken({ commit }) { + // return new Promise(resolve => { + // commit('SET_TOKEN', '') + // commit('SET_ROLES', []) + // removeToken() + // resolve() + // }) + // }, + + // dynamically modify permissions + // async changeRoles({ commit, dispatch }, role) { + // const token = role + '-token' + + // commit('SET_TOKEN', token) + // setToken(token) + + // const { roles } = await dispatch('getInfo') + + // resetRouter() + + // // generate accessible routes map based on roles + // const accessRoutes = await dispatch('permission/generateRoutes', roles, { root: true }) + // // dynamically add accessible routes + // router.addRoutes(accessRoutes) + + // // reset visited views and cached views + // dispatch('tagsView/delAllViews', null, { root: true }) + // } +} + +export default { + namespaced: true, + state, + mutations, + actions +} diff --git a/src/styles/e-row.scss b/src/styles/e-row.scss new file mode 100644 index 0000000..899a4da --- /dev/null +++ b/src/styles/e-row.scss @@ -0,0 +1,291 @@ +//finginvoiceapply添加部分 +.invoiceform { + .topline { + margin-bottom: 16px; + display: flex; + flex-direction: row; + justify-content: center; + + .el-form-item { + margin-bottom: 0 !important; + + .el-form-item__content { + margin-left: 0 !important; + + .el-input { + width: 120% !important; + } + } + } + + .el-input__inner { + border-style: none; + text-align: center; + } + } + + //第一行 + .lineone { + border-bottom: 2px solid #e0e3eb; + } + + .invoiceadd { + margin: 22px 28px; + border-top: 2px solid #e0e3eb; + + .el-form-item__label { + width: auto !important; + } + + .el-row { + height: 40px; + border-left: 2px solid #e0e3eb; + + .addlabel { + height: 100%; + border-right: 2px solid #e0e3eb; + border-bottom: 2px solid #e0e3eb; + + .el-form-item { + height: 100%; + margin-bottom: 0; + display: flex; + flex-direction: row-reverse; + } + } + + .addinput { + height: 100%; + padding: 0 40px 0 10px; + border-right: 2px solid #e0e3eb !important; + border-bottom: 2px solid #e0e3eb !important; + + .el-form-item { + height: 100%; + margin-bottom: 0; + + .el-form-item__content { + width: 100%; + height: 100%; + line-height: 38px; + margin: 0 !important; + + .el-input { + width: 100%; + height: 100%; + + .el-input__inner { + height: 33px; + } + } + + .el-select { + width: 100% !important; + } + } + } + } + + .addlabelTwo { + height: 100%; + border-right: 2px solid #e0e3eb; + + .el-form-item { + height: 100%; + margin-bottom: 0; + display: flex; + flex-direction: row-reverse; + } + } + + .addlabelThree { + height: 100%; + border-right: 2px solid #e0e3eb; + border-bottom: 2px solid #e0e3eb; + text-align: center; + line-height: 40px; + + .el-form-item { + height: 100%; + margin-bottom: 0; + display: flex; + flex-direction: column; + align-items: center; + line-height: 40px; + text-align: center; + } + + .el-form-item__label { + padding: 0 !important; + } + } + + .addlabelFour { + height: 100%; + border-right: 2px solid #e0e3eb; + border-bottom: 2px solid #e0e3eb; + line-height: 40px; + padding: 0 10px; + + .el-form-item { + height: 100%; + margin-bottom: 0; + + .el-form-item__content { + margin-left: 5px !important; + } + } + } + + .addinputRadio { + height: 100%; + border-right: 2px solid #e0e3eb; + border-bottom: 2px solid #e0e3eb; + line-height: 40px; + padding: 0 10px; + } + + .lastchild { + border-bottom: 2px solid #e0e3eb; + } + + } + + } +} + +.tabletitle { + height: 40px; + width: 100%; + padding: 0 10px; + background: #018ad2; + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + color: white; + + .el-button--primary { + background: #0476aa; + } + +} + +//finreceipt添加部分 +.receiptadd { + + .topline { + margin-bottom: 16px; + display: flex; + flex-direction: row; + justify-content: center; + + .el-form-item { + margin-bottom: 0 !important; + + .el-form-item__content { + margin-left: 0 !important; + + .el-input { + width: 120% !important; + } + } + } + + .el-input__inner { + border-style: none; + text-align: center; + } + } + + //第一行 + .lineone { + border-bottom: 2px solid #e0e3eb; + } + + //中间的部分 + .linetwo, .linethree { + .el-col-24 { + border-bottom: 2px solid #e0e3eb; + } + + .grid-content { + display: flex; + flex-direction: row; + justify-content: center; + align-items: flex-start; + } + } + + .linetwo { + .el-col { + padding: 0 32px; + } + } +} + +.tabletitle .addbtn { + width: 84px; + background: #0476aa; + border: 0; + outline: none; + padding: 9px 12px; + color: #ffffff; + font-size: 14px; + border-radius: 3px; + cursor: pointer; +} + +.tabletitle .addbtn:hover { + border-color: #0476aa; + background-color: #34a1db; +} + +.tableTotal { + padding: 20px 0; + font-weight: bold; + font-size: 14px; +} + +.tableinput .el-input__inner { + border-style: none; + text-align: center; +} + +.inforow { + height: 120px !important; + + .el-form-item { + height: 100%; + margin-bottom: 0; + display: flex; + flex-direction: row-reverse; + align-items: center; + } + + .infocol { + height: 100%; + border-right: 2px solid #e0e3eb; + border-bottom: 2px solid #e0e3eb; + display: flex; + flex-direction: column; + justify-content: space-around; + + .collineone, .collinetwo { + margin-left: 10px; + } + + .collineone, .collinetwo { + display: flex; + flex-direction: row; + } + } +} + +.blockone, .blocktwo, .blockfour, .blockfive { + min-width: 142px; +} + +.blockthree, .blocksix { + min-width: 266px; +} diff --git a/src/styles/e-table.scss b/src/styles/e-table.scss new file mode 100644 index 0000000..dcd6375 --- /dev/null +++ b/src/styles/e-table.scss @@ -0,0 +1,40 @@ +.e-table { + width: 100%; + padding: 0 30px; + + tr:first-child th { + background-color: #c1f4cd; + } + + tr { + td { + border: 1px solid #e6e9f0; + border-right: 0; + border-bottom: 0; + 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; + } +} + +.tableinput .el-input__inner { + border-style: none; + text-align: center; +} diff --git a/src/styles/el-form.scss b/src/styles/el-form.scss new file mode 100644 index 0000000..73288e1 --- /dev/null +++ b/src/styles/el-form.scss @@ -0,0 +1,67 @@ +.listconadd .title { + text-align: center; + font-size: 28px; + //line-height: 90px; +} + +.listaddtop { + padding: 0 212px; + border-bottom: 2px solid #e0e3eb; + display: flex; + justify-content: space-between; + align-items: center; + line-height: 34px; + + span { + padding: 0 15px; + } +} + +.listconadd .demo-ruleForm { + padding: 22px 28px; +} + +.el-collapse-item__header { + .el-icon-arrow-right:before { + content: ""; + font-size: 20px; + } +} + +.demo-ruleForm table { + width: 100%; + border-collapse: collapse; + border: 2px solid #e0e3eb; + border-spacing: 0; + //text-align: right; + td { + border-right: 2px solid #e0e3eb; + border-bottom: 2px solid #e0e3eb; + border-top: 2px solid #e0e3eb; + } + + tr { + height: 40px; + } + + .el-form-item { + display: inline-block; + } + + .el-input { + display: inline-block; + } +} + +.tleftb { + text-align: right; + font-size: 14px; + color: #606266; + line-height: 40px !important; + font-weight: 600; +} + +.icon { + color: #e84026; + margin-right: 4px; +} diff --git a/src/styles/el-search.scss b/src/styles/el-search.scss new file mode 100644 index 0000000..e6a18fb --- /dev/null +++ b/src/styles/el-search.scss @@ -0,0 +1,20 @@ +//finginvoiceapply页面个别按钮 +.applyseaech { + padding: 0 34px !important; + margin-right: 0 !important; +} + +//finreceipt页面个别按钮 +.recpicker { + width: 154px !important; +} + +.recselect { + padding: 0 34px !important; +} + +// +.iteminput { + padding: 0 49px !important; +} + diff --git a/src/styles/element-table.scss b/src/styles/element-table.scss new file mode 100644 index 0000000..e79ae75 --- /dev/null +++ b/src/styles/element-table.scss @@ -0,0 +1,38 @@ +.el-table { + .el-table__header { + tr th { + background: #edf1f7; + color: #333333; + padding: 8px 0; + font-size: 16px; + } + } +} + +.el-table { + .el-table__row { + .cell { + line-height:15px; + } + } +} + +.el-table { + .el-table__body { + tr td { + padding: 6px 0 !important; + } + } +} + +.table-describe { + border: 1px solid #dfe4ed; + border-bottom: 0 solid #dfe4ed; + + h4 { + float: left; + margin: 0; + line-height: 34px; + padding: 0 15px; + } +} diff --git a/src/styles/element-tabs.scss b/src/styles/element-tabs.scss new file mode 100644 index 0000000..26321fb --- /dev/null +++ b/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/src/styles/element-ui.scss b/src/styles/element-ui.scss new file mode 100644 index 0000000..50c4dc3 --- /dev/null +++ b/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/src/styles/element-variables.scss b/src/styles/element-variables.scss new file mode 100644 index 0000000..ecd0728 --- /dev/null +++ b/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/src/styles/index.scss b/src/styles/index.scss new file mode 100644 index 0000000..ce38090 --- /dev/null +++ b/src/styles/index.scss @@ -0,0 +1,435 @@ +@import './variables.scss'; +@import './mixin.scss'; +@import './transition.scss'; +@import './element-ui.scss'; +@import './sidebar.scss'; +@import './table.scss'; +@import './el-form.scss'; +@import './el-search.scss'; +@import './e-row.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; +} + +// 页面上的button按钮 +.app-container { + .el-button--medium { + padding: 10px 14px; + font-size: 16px; + } + + .el-button--small { + padding: 8px 12px; + font-size: 14px; + } + + .el-button--mini { + padding: 7px 10px; + font-size: 12px; + } +} +// 添加样式 +.app-container { + margin: 5px 0 5px 0; + 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;} +.listconadd{ + .titwu { + font-size: 28px; + text-align: center; + padding: 30px 0 20px 0; + } +} +.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; + font-size: 20px; +} + +// 设置了页面头部的内边距和背景色 +.tab-header { + font-size: 20px; + font-weight: bold; +} +// 设置了搜索条件里的样式 +.search { + .tab-header { + .el-form-item { + margin-right: 16px; + .el-form-item__label { + font-size: 16px; + font-weight: 500; + } + } + } +} +.filter-item { + padding: 0 10px; + width: 220px; + 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: 0 0 15px 15px; +} +.pages .tit{font-weight: bold;} +.pages .pagination{margin: 0;} +// .formadd{padding: 20px ;} +// .listeltable{overflow-y: auto;height: calc(100vh - 420px);} + +.formadd { + padding: 10px 40px 0 40px; + font-size: 16px; + // height: calc(100vh - 200px);overflow-y: auto; + .title { + padding: 12px; + font-weight: bold; + font-size: 16px; + background-color: $header-bg; + text-align: left; + color: #ffffff; + } + .first_row{ + border-top: 1px solid $table-border-color; + } + .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: 0 15px; + min-height: 42px; + line-height: 1; + + .el-form-item { + margin-bottom: 0; + line-height: 42px; + // .addinputw{width: 400px;} + .addinputw { + width: 80%; + line-height: 42px; + } + .el-input__inner { + height: 36px; + } + } + } + } + .footer{margin: 20px;} +} + + +.formaddcopy02 { + padding: 10px 40px 0 40px; + .title { + padding: 12px; + font-weight: bold; + font-size: 16px; + background-color: #0294d7; + color: #ffffff; + text-align: left; + } + + .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; + min-height: 42px; + padding: 0 15px; + line-height: 42px; + position: relative; + .span-sty { + position: absolute; + top: 0; + bottom: 0; + left: 0; + line-height: 42px; + text-align: right; + font-size: 14px; + color: #606266; + font-weight: 600; + width: 70px; + padding-right: 5px; + border-right: 1px solid #e0e3eb; + } + + .el-form-item { + margin-bottom: 0; + line-height: 42px; + .addinputw { + //padding: 5px 0; + width: 65%; + margin-left: 80px; + line-height: 42px; + } + + .addinputInfo { + margin-left: 80px; + line-height: 42px; + } + + .el-input__inner { + height: 36px; + } + } + } + + } + + .footer { + margin: 20px; + } +} + +.forminfo { + padding: 10px 40px 0 40px; + font-size: 16px; + .title { + padding: 12px; + font-weight: bold; + font-size: 16px; + background-color: $header-bg; + text-align: left; + 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: 0 15px 0 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; cursor: pointer} +// 经销商添加样式 +.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;border: #2cab69 1px solid;color: #2cab69;} +// 隐藏显示按钮 +.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/src/styles/mixin.scss b/src/styles/mixin.scss new file mode 100644 index 0000000..36b74bb --- /dev/null +++ b/src/styles/mixin.scss @@ -0,0 +1,28 @@ +@mixin clearfix { + &:after { + content: ""; + display: table; + clear: both; + } +} + +@mixin scrollBar { + &::-webkit-scrollbar-track-piece { + background: #d3dce6; + } + + &::-webkit-scrollbar { + width: 6px; + } + + &::-webkit-scrollbar-thumb { + background: #99a9bf; + border-radius: 20px; + } +} + +@mixin relative { + position: relative; + width: 100%; + height: 100%; +} diff --git a/src/styles/sidebar.scss b/src/styles/sidebar.scss new file mode 100644 index 0000000..4d304e2 --- /dev/null +++ b/src/styles/sidebar.scss @@ -0,0 +1,262 @@ +#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 { + height: calc(100% - 40px) ; //此高度是100%减去页面底部的栏高 + 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/src/styles/table.scss b/src/styles/table.scss new file mode 100644 index 0000000..08e9142 --- /dev/null +++ b/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/src/styles/transition.scss b/src/styles/transition.scss new file mode 100644 index 0000000..4cb27cc --- /dev/null +++ b/src/styles/transition.scss @@ -0,0 +1,48 @@ +// global transition css + +/* fade */ +.fade-enter-active, +.fade-leave-active { + transition: opacity 0.28s; +} + +.fade-enter, +.fade-leave-active { + opacity: 0; +} + +/* fade-transform */ +.fade-transform-leave-active, +.fade-transform-enter-active { + transition: all .5s; +} + +.fade-transform-enter { + opacity: 0; + transform: translateX(-30px); +} + +.fade-transform-leave-to { + opacity: 0; + transform: translateX(30px); +} + +/* breadcrumb transition */ +.breadcrumb-enter-active, +.breadcrumb-leave-active { + transition: all .5s; +} + +.breadcrumb-enter, +.breadcrumb-leave-active { + opacity: 0; + transform: translateX(20px); +} + +.breadcrumb-move { + transition: all .5s; +} + +.breadcrumb-leave-active { + position: absolute; +} diff --git a/src/styles/variables.scss b/src/styles/variables.scss new file mode 100644 index 0000000..9ff78c5 --- /dev/null +++ b/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/src/utils/auth.js b/src/utils/auth.js new file mode 100644 index 0000000..3379594 --- /dev/null +++ b/src/utils/auth.js @@ -0,0 +1,37 @@ +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.eyJ1c2VyTm8iOiI0MjdhMmZiMC02MGM1LTQwOWYtYmVhNC00ZWI0NDEwNDFhZTYiLCJpc3MiOiJXQksiLCJleHAiOjE2NzQ2NzU5Mzl9.1P6VgCk3sXxWkl1364y7xhfc4ifdg6uGkzkF6uEmhIo' +} + +export function setStorage(session) { + return sessionStorage.setItem('token', session) +} + +export function setDefaultOrgPathName(data) { + return sessionStorage.setItem('defaultOrgPathName', data) +} + +export function setDefaultOrgPath(data) { + return sessionStorage.setItem('defaultOrgPath', data) +} + +export function removeStorage() { + return sessionStorage.removeItem('token') +} diff --git a/src/utils/axios.js b/src/utils/axios.js new file mode 100644 index 0000000..5357837 --- /dev/null +++ b/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 + '?accessToken=' + 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/src/utils/baocun.js b/src/utils/baocun.js new file mode 100644 index 0000000..3103840 --- /dev/null +++ b/src/utils/baocun.js @@ -0,0 +1,66 @@ +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/src/utils/get-page-title.js b/src/utils/get-page-title.js new file mode 100644 index 0000000..a6de99d --- /dev/null +++ b/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/src/utils/index.js b/src/utils/index.js new file mode 100644 index 0000000..4830c04 --- /dev/null +++ b/src/utils/index.js @@ -0,0 +1,117 @@ +/** + * Created by PanJiaChen on 16/11/18. + */ + +/** + * Parse the time to string + * @param {(Object|string|number)} time + * @param {string} cFormat + * @returns {string | null} + */ +export function parseTime(time, cFormat) { + if (arguments.length === 0 || !time) { + return null + } + const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}' + let date + if (typeof time === 'object') { + date = time + } else { + if ((typeof time === 'string')) { + if ((/^[0-9]+$/.test(time))) { + // support "1548221490638" + time = parseInt(time) + } else { + // support safari + // https://stackoverflow.com/questions/4310953/invalid-date-in-safari + time = time.replace(new RegExp(/-/gm), '/') + } + } + + if ((typeof time === 'number') && (time.toString().length === 10)) { + time = time * 1000 + } + date = new Date(time) + } + const formatObj = { + y: date.getFullYear(), + m: date.getMonth() + 1, + d: date.getDate(), + h: date.getHours(), + i: date.getMinutes(), + s: date.getSeconds(), + a: date.getDay() + } + const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => { + const value = formatObj[key] + // Note: getDay() returns 0 on Sunday + if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value ] } + return value.toString().padStart(2, '0') + }) + return time_str +} + +/** + * @param {number} time + * @param {string} option + * @returns {string} + */ +export function formatTime(time, option) { + if (('' + time).length === 10) { + time = parseInt(time) * 1000 + } else { + time = +time + } + const d = new Date(time) + const now = Date.now() + + const diff = (now - d) / 1000 + + if (diff < 30) { + return '刚刚' + } else if (diff < 3600) { + // less 1 hour + return Math.ceil(diff / 60) + '分钟前' + } else if (diff < 3600 * 24) { + return Math.ceil(diff / 3600) + '小时前' + } else if (diff < 3600 * 24 * 2) { + return '1天前' + } + if (option) { + return parseTime(time, option) + } else { + return ( + d.getMonth() + + 1 + + '月' + + d.getDate() + + '日' + + d.getHours() + + '时' + + d.getMinutes() + + '分' + ) + } +} + +/** + * @param {string} url + * @returns {Object} + */ +export function param2Obj(url) { + const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ') + if (!search) { + return {} + } + const obj = {} + const searchArr = search.split('&') + searchArr.forEach(v => { + const index = v.indexOf('=') + if (index !== -1) { + const name = v.substring(0, index) + const val = v.substring(index + 1, v.length) + obj[name] = val + } + }) + return obj +} diff --git a/src/utils/print.js b/src/utils/print.js new file mode 100644 index 0000000..799a333 --- /dev/null +++ b/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/src/utils/request.js b/src/utils/request.js new file mode 100644 index 0000000..194f41d --- /dev/null +++ b/src/utils/request.js @@ -0,0 +1,110 @@ +import axios from 'axios' +import { + MessageBox, + Message +} from 'element-ui' +import store from '@/store' +import { + getToken, + getStorage +} from '@/utils/auth' + +// create an axios instance +const service = axios.create({ + baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url + // withCredentials: true, // send cookies when cross-domain requests + timeout: 30000 // request timeout +}) + +// request interceptor +service.interceptors.request.use( + config => { + // do something before request is sent + + // if (store.getters.token) { + // // let each request carry token + // // ['X-Token'] is a custom headers key + // // please modify it according to the actual situation + // config.headers['X-Token'] = getToken() + // } + if (getStorage()) { + // let each request carry token + // ['X-Token'] is a custom headers key + // please modify it according to the actual situation + config.headers['token'] = getStorage() + } + return config + }, + error => { + // do something with request error + console.log(error) // for debug + return Promise.reject(error) + } +) + +// response interceptor +service.interceptors.response.use( + /** + * If you want to get http information such as headers or status + * Please return response => response + */ + + /** + * Determine the request status by custom code + * Here is just an example + * You can also judge the status by HTTP Status Code + */ + response => { + const res = response.data + const statusCode = response.status + console.log('statusCode>>>' + statusCode) + // if the custom code is not 20000, it is judged as an error. + if (statusCode !== 200) { + Message({ + message: res.msg || response.message || 'Error', + type: 'error', + showClose: true, + duration: 5 * 1000 + }) + + // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired; + if (statusCode === 401 || res.code === '5000' || res.code === 5000 || res.code === 50012 || res.code === + 50014) { + // to re-login + MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { + confirmButtonText: '重新登录', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + store.dispatch('logout').then(() => { + location.href = 'http://120.46.131.15/#/login' + // location.reload() + }) + }) + } + return Promise.reject(new Error(res.message || 'Error')) + } else { + if (!res.success && res.success !== null && res.success !== undefined) { + Message({ + message: res.msg || 'Error', + type: 'error', + showClose: true, + duration: 5 * 1000 + }) + } + return res + } + }, + error => { + console.log('err' + error) // for debug + Message({ + message: error.message, + type: 'error', + showClose: true, + duration: 5 * 1000 + }) + return Promise.reject(error) + } +) + +export default service diff --git a/src/utils/roles.js b/src/utils/roles.js new file mode 100644 index 0000000..07a6557 --- /dev/null +++ b/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/src/utils/validate.js b/src/utils/validate.js new file mode 100644 index 0000000..8d962ad --- /dev/null +++ b/src/utils/validate.js @@ -0,0 +1,20 @@ +/** + * Created by PanJiaChen on 16/11/18. + */ + +/** + * @param {string} path + * @returns {Boolean} + */ +export function isExternal(path) { + return /^(https?:|mailto:|tel:)/.test(path) +} + +/** + * @param {string} str + * @returns {Boolean} + */ +export function validUsername(str) { + const valid_map = ['admin', 'editor'] + return valid_map.indexOf(str.trim()) >= 0 +} diff --git a/src/views/404.vue b/src/views/404.vue new file mode 100644 index 0000000..3b3d95e --- /dev/null +++ b/src/views/404.vue @@ -0,0 +1,252 @@ + + + + + diff --git a/src/views/Home/Home.vue b/src/views/Home/Home.vue new file mode 100644 index 0000000..d1c0b2f --- /dev/null +++ b/src/views/Home/Home.vue @@ -0,0 +1,43 @@ + + + + + diff --git a/src/views/MaterialBrand/index.vue b/src/views/MaterialBrand/index.vue new file mode 100644 index 0000000..9b764ca --- /dev/null +++ b/src/views/MaterialBrand/index.vue @@ -0,0 +1,223 @@ + + + + + \ No newline at end of file diff --git a/src/views/Process/BpmData.js b/src/views/Process/BpmData.js new file mode 100644 index 0000000..672ca44 --- /dev/null +++ b/src/views/Process/BpmData.js @@ -0,0 +1,68 @@ +/** + * 存储流程设计相关参数 + */ +export default class BpmData { + constructor() { + this.controls = [] // 设计器控件 + this.init() + } + + init() { + this.controls = [ + { + action: 'create.start-event', + title: '开始' + }, + { + action: 'create.intermediate-event', + title: '中间' + }, + { + action: 'create.end-event', + title: '结束' + }, + { + action: 'create.exclusive-gateway', + title: '网关' + }, + { + action: 'create.task', + title: '任务' + }, + { + action: 'create.user-task', + title: '用户任务' + }, + { + action: 'create.user-sign-task', + title: '会签任务' + }, + { + action: 'create.subprocess-expanded', + title: '子流程' + }, + { + action: 'create.data-object', + title: '数据对象' + }, + { + action: 'create.data-store', + title: '数据存储' + }, + { + action: 'create.participant-expanded', + title: '扩展流程' + }, + { + action: 'create.group', + title: '分组' + } + ] + } + + // 获取控件配置信息 + getControl(action) { + const result = this.controls.filter(item => item.action === action) + return result[0] || {} + } +} diff --git a/src/views/Process/PropertyPanel.vue b/src/views/Process/PropertyPanel.vue new file mode 100644 index 0000000..970bd0f --- /dev/null +++ b/src/views/Process/PropertyPanel.vue @@ -0,0 +1,169 @@ + + + + + diff --git a/src/views/Process/common/customTranslate.js b/src/views/Process/common/customTranslate.js new file mode 100644 index 0000000..fa05f9d --- /dev/null +++ b/src/views/Process/common/customTranslate.js @@ -0,0 +1,20 @@ +import translations from '../lang/zh' + +export default function customTranslate(template, replacements) { + replacements = replacements || {} + + // Translate + template = translations[template] || template + + // Replace + return template.replace(/{([^}]+)}/g, function(_, key) { + var str = replacements[key] + if ( + translations[replacements[key]] !== null && + translations[replacements[key]] !== 'undefined' + ) { + str = translations[replacements[key]] + } + return str || '{' + key + '}' + }) +} diff --git a/src/views/Process/common/mixinExecutionListener.js b/src/views/Process/common/mixinExecutionListener.js new file mode 100644 index 0000000..23295b0 --- /dev/null +++ b/src/views/Process/common/mixinExecutionListener.js @@ -0,0 +1,24 @@ + +import executionListenerDialog from '../components/nodePanel/property/executionListener' +export default { + components: { + executionListenerDialog + }, + data() { + return { + executionListenerLength: 0, + dialogName: null + } + }, + methods: { + computedExecutionListenerLength() { + this.executionListenerLength = this.element.businessObject.extensionElements?.values?.length ?? 0 + }, + finishExecutionListener() { + if (this.dialogName === 'executionListenerDialog') { + this.computedExecutionListenerLength() + } + this.dialogName = '' + } + } +} diff --git a/src/views/Process/common/mixinPanel.js b/src/views/Process/common/mixinPanel.js new file mode 100644 index 0000000..8686b98 --- /dev/null +++ b/src/views/Process/common/mixinPanel.js @@ -0,0 +1,70 @@ +import xcrud from 'xcrud' +import golbalConfig from 'xcrud/package/common/config' +import showConfig from '../flowable/showConfig' +golbalConfig.set({ + input: { + // size: 'mini' + }, + select: { + // size: 'mini' + }, + colorPicker: { + showAlpha: true + }, + xform: { + form: { + labelWidth: 'auto' + // size: 'mini' + } + } +}) +export default { + components: { xForm: xcrud.xForm }, + props: { + modeler: { + type: Object, + required: true + }, + element: { + type: Object, + required: true + }, + categorys: { + type: Array, + default: () => [] + } + }, + watch: { + 'formData.id': function(val) { + this.updateProperties({ id: val }) + }, + 'formData.name': function(val) { + this.updateProperties({ name: val }) + }, + 'formData.documentation': function(val) { + if (!val) { + this.updateProperties({ documentation: [] }) + return + } + const documentationElement = this.modeler.get('moddle').create('bpmn:Documentation', { text: val }) + this.updateProperties({ documentation: [documentationElement] }) + } + }, + methods: { + updateProperties(properties) { + const modeling = this.modeler.get('modeling') + modeling.updateProperties(this.element, properties) + } + }, + computed: { + elementType() { + const bizObj = this.element.businessObject + return bizObj.eventDefinitions + ? bizObj.eventDefinitions[0].$type + : bizObj.$type + }, + showConfig() { + return showConfig[this.elementType] || {} + } + } +} diff --git a/src/views/Process/common/mixinXcrud.js b/src/views/Process/common/mixinXcrud.js new file mode 100644 index 0000000..1f7ee5b --- /dev/null +++ b/src/views/Process/common/mixinXcrud.js @@ -0,0 +1,22 @@ +import xcrud from 'xcrud' +import golbalConfig from 'xcrud/package/common/config' +golbalConfig.set({ + input: { + // size: 'mini' + }, + select: { + // size: 'mini' + }, + colorPicker: { + showAlpha: true + }, + xform: { + form: { + labelWidth: 'auto' + // size: 'mini' + } + } +}) +export default { + components: { xForm: xcrud.xForm } +} diff --git a/src/views/Process/common/parseElement.js b/src/views/Process/common/parseElement.js new file mode 100644 index 0000000..63cf336 --- /dev/null +++ b/src/views/Process/common/parseElement.js @@ -0,0 +1,53 @@ +export function commonParse(element) { + const result = { + ...element.businessObject, + ...element.businessObject.$attrs + } + return formatJsonKeyValue(result) +} + +export function formatJsonKeyValue(result) { + // 移除flowable前缀,格式化数组 + for (const key in result) { + if (key.indexOf('flowable:') === 0) { + const newKey = key.replace('flowable:', '') + result[newKey] = result[key] + delete result[key] + } + } + result = documentationParse(result) + return result +} + +export function documentationParse(obj) { + if ('documentation' in obj) { + let str = '' + obj.documentation.forEach(item => { + str += item.text + }) + obj.documentation = str + } + return obj +} + +export function conditionExpressionParse(obj) { + if ('conditionExpression' in obj) { + obj.conditionExpression = obj.conditionExpression.body + } + return obj +} + +export function userTaskParse(obj) { + for (const key in obj) { + if (key === 'candidateUsers') { + obj.userType = 'candidateUsers' + obj[key] = obj[key]?.split(',') || [] + } else if (key === 'candidateGroups') { + obj.userType = 'candidateGroups' + obj[key] = obj[key]?.split(',') || [] + } else if (key === 'assignee') { + obj.userType = 'assignee' + } + } + return obj +} diff --git a/src/views/Process/components/custom/customContextPad.vue b/src/views/Process/components/custom/customContextPad.vue new file mode 100644 index 0000000..89c2f68 --- /dev/null +++ b/src/views/Process/components/custom/customContextPad.vue @@ -0,0 +1,24 @@ +export default class CustomContextPad { + constructor(config, contextPad, create, elementFactory, injector, translate) { + this.create = create; + this.elementFactory = elementFactory; + this.translate = translate; + + if (config.autoPlace !== false) { + this.autoPlace = injector.get('autoPlace', false); + } + + contextPad.registerProvider(this); // 定义这是一个contextPad + } + + getContextPadEntries(element) {} +} + +CustomContextPad.$inject = [ + 'config', + 'contextPad', + 'create', + 'elementFactory', + 'injector', + 'translate' +]; diff --git a/src/views/Process/components/nodePanel/gateway.vue b/src/views/Process/components/nodePanel/gateway.vue new file mode 100644 index 0000000..db18153 --- /dev/null +++ b/src/views/Process/components/nodePanel/gateway.vue @@ -0,0 +1,81 @@ + + + + + diff --git a/src/views/Process/components/nodePanel/process.vue b/src/views/Process/components/nodePanel/process.vue new file mode 100644 index 0000000..6946f1e --- /dev/null +++ b/src/views/Process/components/nodePanel/process.vue @@ -0,0 +1,113 @@ + + + + + diff --git a/src/views/Process/components/nodePanel/property/executionListener.vue b/src/views/Process/components/nodePanel/property/executionListener.vue new file mode 100644 index 0000000..1a15b8a --- /dev/null +++ b/src/views/Process/components/nodePanel/property/executionListener.vue @@ -0,0 +1,194 @@ + + + + + diff --git a/src/views/Process/components/nodePanel/property/listenerParam.vue b/src/views/Process/components/nodePanel/property/listenerParam.vue new file mode 100644 index 0000000..dd8ace1 --- /dev/null +++ b/src/views/Process/components/nodePanel/property/listenerParam.vue @@ -0,0 +1,96 @@ + + + + + diff --git a/src/views/Process/components/nodePanel/property/multiInstance.vue b/src/views/Process/components/nodePanel/property/multiInstance.vue new file mode 100644 index 0000000..357b716 --- /dev/null +++ b/src/views/Process/components/nodePanel/property/multiInstance.vue @@ -0,0 +1,117 @@ + + + + + diff --git a/src/views/Process/components/nodePanel/property/signal.vue b/src/views/Process/components/nodePanel/property/signal.vue new file mode 100644 index 0000000..2c29d73 --- /dev/null +++ b/src/views/Process/components/nodePanel/property/signal.vue @@ -0,0 +1,124 @@ + + + + + diff --git a/src/views/Process/components/nodePanel/property/taskListener.vue b/src/views/Process/components/nodePanel/property/taskListener.vue new file mode 100644 index 0000000..0f72a89 --- /dev/null +++ b/src/views/Process/components/nodePanel/property/taskListener.vue @@ -0,0 +1,196 @@ + + + + + diff --git a/src/views/Process/components/nodePanel/sequenceFlow.vue b/src/views/Process/components/nodePanel/sequenceFlow.vue new file mode 100644 index 0000000..178cd7d --- /dev/null +++ b/src/views/Process/components/nodePanel/sequenceFlow.vue @@ -0,0 +1,92 @@ + + + + + diff --git a/src/views/Process/components/nodePanel/startEnd.vue b/src/views/Process/components/nodePanel/startEnd.vue new file mode 100644 index 0000000..2740bf6 --- /dev/null +++ b/src/views/Process/components/nodePanel/startEnd.vue @@ -0,0 +1,94 @@ + + + + + diff --git a/src/views/Process/components/nodePanel/task.vue b/src/views/Process/components/nodePanel/task.vue new file mode 100644 index 0000000..61a00d1 --- /dev/null +++ b/src/views/Process/components/nodePanel/task.vue @@ -0,0 +1,426 @@ + + + + + diff --git a/src/views/Process/flowable/flowable.json b/src/views/Process/flowable/flowable.json new file mode 100644 index 0000000..73ac308 --- /dev/null +++ b/src/views/Process/flowable/flowable.json @@ -0,0 +1,1194 @@ +{ + "name": "Flowable", + "uri": "http://flowable.org/bpmn", + "prefix": "flowable", + "xml": { + "tagAlias": "lowerCase" + }, + "associations": [], + "types": [ + { + "name": "InOutBinding", + "superClass": ["Element"], + "isAbstract": true, + "properties": [ + { + "name": "source", + "isAttr": true, + "type": "String" + }, + { + "name": "sourceExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "target", + "isAttr": true, + "type": "String" + }, + { + "name": "businessKey", + "isAttr": true, + "type": "String" + }, + { + "name": "local", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "variables", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "In", + "superClass": ["InOutBinding"], + "meta": { + "allowedIn": ["bpmn:CallActivity"] + } + }, + { + "name": "Out", + "superClass": ["InOutBinding"], + "meta": { + "allowedIn": ["bpmn:CallActivity"] + } + }, + { + "name": "AsyncCapable", + "isAbstract": true, + "extends": ["bpmn:Activity", "bpmn:Gateway", "bpmn:Event"], + "properties": [ + { + "name": "async", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "asyncBefore", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "asyncAfter", + "isAttr": true, + "type": "Boolean", + "default": false + }, + { + "name": "exclusive", + "isAttr": true, + "type": "Boolean", + "default": true + } + ] + }, + { + "name": "flowable:in", + "superClass": ["Element"], + "properties": [ + { + "name": "source", + "type": "string", + "isAttr": true + }, + { + "name": "target", + "type": "string", + "isAttr": true + } + ] + }, + { + "name": "flowable:out", + "superClass": ["Element"], + "properties": [ + { + "name": "source", + "type": "string", + "isAttr": true + }, + { + "name": "target", + "type": "string", + "isAttr": true + } + ] + }, + { + "name": "BoundaryEvent", + "superClass": ["CatchEvent"], + "properties": [ + { + "name": "cancelActivity", + "default": true, + "isAttr": true, + "type": "Boolean" + }, + { + "name": "attachedToRef", + "type": "Activity", + "isAttr": true, + "isReference": true + } + ] + }, + { + "name": "JobPriorized", + "isAbstract": true, + "extends": ["bpmn:Process", "flowable:AsyncCapable"], + "properties": [ + { + "name": "jobPriority", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "SignalEventDefinition", + "isAbstract": true, + "extends": ["bpmn:SignalEventDefinition"], + "properties": [ + { + "name": "async", + "isAttr": true, + "type": "Boolean", + "default": false + } + ] + }, + { + "name": "ErrorEventDefinition", + "isAbstract": true, + "extends": ["bpmn:ErrorEventDefinition"], + "properties": [ + { + "name": "errorCodeVariable", + "isAttr": true, + "type": "String" + }, + { + "name": "errorMessageVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Error", + "isAbstract": true, + "extends": ["bpmn:Error"], + "properties": [ + { + "name": "flowable:errorMessage", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "PotentialStarter", + "superClass": ["Element"], + "properties": [ + { + "name": "resourceAssignmentExpression", + "type": "bpmn:ResourceAssignmentExpression" + } + ] + }, + { + "name": "UserTask", + "isAbstract": true, + "extends": ["bpmn:UserTask"], + "properties": [ + { + "name": "timerEventDefinition", + "type": "Expression" + }, + { + "name": "multiInstanceLoopCharacteristics", + "type": "MultiInstanceLoopCharacteristics" + } + ] + }, + { + "name": "StartEvent", + "isAbstract": true, + "extends": ["bpmn:StartEvent"], + "properties": [ + { + "name": "timerEventDefinition", + "type": "Expression" + } + ] + }, + { + "name": "FormSupported", + "isAbstract": true, + "extends": ["bpmn:StartEvent", "bpmn:UserTask"], + "properties": [ + { + "name": "formHandlerClass", + "isAttr": true, + "type": "String" + }, + { + "name": "formKey", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "TemplateSupported", + "isAbstract": true, + "extends": ["bpmn:Process", "bpmn:FlowElement"], + "properties": [ + { + "name": "modelerTemplate", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Initiator", + "isAbstract": true, + "extends": ["bpmn:StartEvent"], + "properties": [ + { + "name": "initiator", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ScriptTask", + "isAbstract": true, + "extends": ["bpmn:ScriptTask"], + "properties": [ + { + "name": "resultVariable", + "isAttr": true, + "type": "String" + }, + { + "name": "resource", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Process", + "isAbstract": true, + "extends": ["bpmn:Process"], + "properties": [ + { + "name": "candidateStarterGroups", + "isAttr": true, + "type": "String" + }, + { + "name": "candidateStarterUsers", + "isAttr": true, + "type": "String" + }, + { + "name": "versionTag", + "isAttr": true, + "type": "String" + }, + { + "name": "historyTimeToLive", + "isAttr": true, + "type": "String" + }, + { + "name": "isStartableInTasklist", + "isAttr": true, + "type": "Boolean", + "default": true + } + ] + }, + { + "name": "EscalationEventDefinition", + "isAbstract": true, + "extends": ["bpmn:EscalationEventDefinition"], + "properties": [ + { + "name": "escalationCodeVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "FormalExpression", + "isAbstract": true, + "extends": ["bpmn:FormalExpression"], + "properties": [ + { + "name": "resource", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Assignable", + "extends": ["bpmn:UserTask"], + "properties": [ + { + "name": "candidateGroups", + "isAttr": true, + "type": "String" + }, + { + "name": "dueDate", + "isAttr": true, + "type": "String" + }, + { + "name": "followUpDate", + "isAttr": true, + "type": "String" + }, + { + "name": "priority", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "CallActivity", + "extends": ["bpmn:CallActivity"], + "properties": [ + { + "name": "calledElementBinding", + "isAttr": true, + "type": "String", + "default": "latest" + }, + { + "name": "calledElementVersion", + "isAttr": true, + "type": "String" + }, + { + "name": "calledElementVersionTag", + "isAttr": true, + "type": "String" + }, + { + "name": "calledElementTenantId", + "isAttr": true, + "type": "String" + }, + { + "name": "caseRef", + "isAttr": true, + "type": "String" + }, + { + "name": "caseBinding", + "isAttr": true, + "type": "String", + "default": "latest" + }, + { + "name": "caseVersion", + "isAttr": true, + "type": "String" + }, + { + "name": "caseTenantId", + "isAttr": true, + "type": "String" + }, + { + "name": "variableMappingClass", + "isAttr": true, + "type": "String" + }, + { + "name": "variableMappingDelegateExpression", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ServiceTaskLike", + "extends": [ + "bpmn:ServiceTask", + "bpmn:BusinessRuleTask", + "bpmn:SendTask", + "bpmn:MessageEventDefinition" + ], + "properties": [ + { + "name": "expression", + "isAttr": true, + "type": "String" + }, + { + "name": "class", + "isAttr": true, + "type": "String" + }, + { + "name": "delegateExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "resultVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ExclusiveGateway", + "isAbstract": true, + "extends": ["bpmn:ExclusiveGateway"], + "properties": [ + { + "name": "serviceClass", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "DmnCapable", + "extends": ["bpmn:BusinessRuleTask"], + "properties": [ + { + "name": "decisionRef", + "isAttr": true, + "type": "String" + }, + { + "name": "decisionRefBinding", + "isAttr": true, + "type": "String", + "default": "latest" + }, + { + "name": "decisionRefVersion", + "isAttr": true, + "type": "String" + }, + { + "name": "mapDecisionResult", + "isAttr": true, + "type": "String", + "default": "resultList" + }, + { + "name": "decisionRefTenantId", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "ExternalCapable", + "extends": ["flowable:ServiceTaskLike"], + "properties": [ + { + "name": "type", + "isAttr": true, + "type": "String" + }, + { + "name": "topic", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "TaskPriorized", + "extends": ["bpmn:Process", "flowable:ExternalCapable"], + "properties": [ + { + "name": "taskPriority", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "Properties", + "superClass": ["Element"], + "meta": { + "allowedIn": ["*"] + }, + "properties": [ + { + "name": "values", + "type": "Property", + "isMany": true + } + ] + }, + { + "name": "Property", + "superClass": ["Element"], + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "value", + "type": "String", + "isAttr": true + } + ] + }, + { + "name": "Connector", + "superClass": ["Element"], + "meta": { + "allowedIn": ["flowable:ServiceTaskLike"] + }, + "properties": [ + { + "name": "inputOutput", + "type": "InputOutput" + }, + { + "name": "connectorId", + "type": "String" + } + ] + }, + { + "name": "InputOutput", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:FlowNode", "flowable:Connector"] + }, + "properties": [ + { + "name": "inputOutput", + "type": "InputOutput" + }, + { + "name": "connectorId", + "type": "String" + }, + { + "name": "inputParameters", + "isMany": true, + "type": "InputParameter" + }, + { + "name": "outputParameters", + "isMany": true, + "type": "OutputParameter" + } + ] + }, + { + "name": "InputOutputParameter", + "properties": [ + { + "name": "name", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + }, + { + "name": "definition", + "type": "InputOutputParameterDefinition" + } + ] + }, + { + "name": "InputOutputParameterDefinition", + "isAbstract": true + }, + { + "name": "List", + "superClass": ["InputOutputParameterDefinition"], + "properties": [ + { + "name": "items", + "isMany": true, + "type": "InputOutputParameterDefinition" + } + ] + }, + { + "name": "Map", + "superClass": ["InputOutputParameterDefinition"], + "properties": [ + { + "name": "entries", + "isMany": true, + "type": "Entry" + } + ] + }, + { + "name": "Entry", + "properties": [ + { + "name": "key", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + }, + { + "name": "definition", + "type": "InputOutputParameterDefinition" + } + ] + }, + { + "name": "Value", + "superClass": ["InputOutputParameterDefinition"], + "properties": [ + { + "name": "id", + "isAttr": true, + "type": "String" + }, + { + "name": "name", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "Script", + "superClass": ["InputOutputParameterDefinition"], + "properties": [ + { + "name": "scriptFormat", + "isAttr": true, + "type": "String" + }, + { + "name": "resource", + "isAttr": true, + "type": "String" + }, + { + "name": "value", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "Field", + "superClass": ["Element"], + "meta": { + "allowedIn": [ + "flowable:ServiceTaskLike", + "flowable:ExecutionListener", + "flowable:TaskListener" + ] + }, + "properties": [ + { + "name": "name", + "isAttr": true, + "type": "String" + }, + { + "name": "expression", + "isAttr": true, + "type": "expression" + }, + { + "name": "string", + "type": "string" + }, + { + "name": "stringValue", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "string", + "superClass": ["Element"], + "meta": { + "allowedIn": [ + "flowable:Field" + ] + }, + "properties": [ + { + "name": "body", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "expression", + "superClass": ["Element"], + "meta": { + "allowedIn": [ + "flowable:Field" + ] + }, + "properties": [ + { + "name": "body", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "InputParameter", + "superClass": ["InputOutputParameter"] + }, + { + "name": "OutputParameter", + "superClass": ["InputOutputParameter"] + }, + { + "name": "Collectable", + "isAbstract": true, + "extends": ["bpmn:MultiInstanceLoopCharacteristics"], + "superClass": ["flowable:AsyncCapable"], + "properties": [ + { + "name": "collection", + "isAttr": true, + "type": "String" + }, + { + "name": "elementVariable", + "isAttr": true, + "type": "String" + } + ] + }, + { + "name": "SequenceFlow", + "superClass": ["FlowElement"], + "properties": [ + { + "name": "isImmediate", + "isAttr": true, + "type": "Boolean" + }, + { + "name": "conditionExpression", + "type": "Expression" + }, + { + "name": "sourceRef", + "type": "FlowNode", + "isAttr": true, + "isReference": true + }, + { + "name": "targetRef", + "type": "FlowNode", + "isAttr": true, + "isReference": true + } + ] + }, + { + "name": "MultiInstanceLoopCharacteristics", + "superClass": ["LoopCharacteristics"], + "properties": [ + { + "name": "isSequential", + "default": false, + "isAttr": true, + "type": "Boolean" + }, + { + "name": "behavior", + "type": "MultiInstanceBehavior", + "default": "All", + "isAttr": true + }, + { + "name": "loopCardinality", + "type": "Expression", + "xml": { + "serialize": "xsi:type" + } + }, + { + "name": "loopDataInputRef", + "type": "ItemAwareElement", + "isReference": true + }, + { + "name": "loopDataOutputRef", + "type": "ItemAwareElement", + "isReference": true + }, + { + "name": "inputDataItem", + "type": "DataInput", + "xml": { + "serialize": "property" + } + }, + { + "name": "outputDataItem", + "type": "DataOutput", + "xml": { + "serialize": "property" + } + }, + { + "name": "complexBehaviorDefinition", + "type": "ComplexBehaviorDefinition", + "isMany": true + }, + { + "name": "completionCondition", + "type": "Expression", + "xml": { + "serialize": "xsi:type" + } + }, + { + "name": "oneBehaviorEventRef", + "type": "EventDefinition", + "isAttr": true, + "isReference": true + }, + { + "name": "noneBehaviorEventRef", + "type": "EventDefinition", + "isAttr": true, + "isReference": true + } + ] + }, + { + "name": "FailedJobRetryTimeCycle", + "superClass": ["Element"], + "meta": { + "allowedIn": ["flowable:AsyncCapable", "bpmn:MultiInstanceLoopCharacteristics"] + }, + "properties": [ + { + "name": "body", + "isBody": true, + "type": "String" + } + ] + }, + { + "name": "ExecutionListener", + "superClass": ["Element"], + "meta": { + "allowedIn": [ + "bpmn:Task", + "bpmn:ServiceTask", + "bpmn:UserTask", + "bpmn:BusinessRuleTask", + "bpmn:ScriptTask", + "bpmn:ReceiveTask", + "bpmn:ManualTask", + "bpmn:ExclusiveGateway", + "bpmn:SequenceFlow", + "bpmn:ParallelGateway", + "bpmn:InclusiveGateway", + "bpmn:EventBasedGateway", + "bpmn:StartEvent", + "bpmn:IntermediateCatchEvent", + "bpmn:IntermediateThrowEvent", + "bpmn:EndEvent", + "bpmn:BoundaryEvent", + "bpmn:CallActivity", + "bpmn:SubProcess", + "bpmn:Process" + ] + }, + "properties": [ + { + "name": "expression", + "isAttr": true, + "type": "String" + }, + { + "name": "class", + "isAttr": true, + "type": "String" + }, + { + "name": "delegateExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "event", + "isAttr": true, + "type": "String" + }, + { + "name": "script", + "type": "Script" + }, + { + "name": "fields", + "type": "Field", + "isMany": true + } + ] + }, + { + "name": "TaskListener", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:UserTask"] + }, + "properties": [ + { + "name": "expression", + "isAttr": true, + "type": "String" + }, + { + "name": "class", + "isAttr": true, + "type": "String" + }, + { + "name": "delegateExpression", + "isAttr": true, + "type": "String" + }, + { + "name": "event", + "isAttr": true, + "type": "String" + }, + { + "name": "script", + "type": "Script" + }, + { + "name": "fields", + "type": "Field", + "isMany": true + } + ] + }, + { + "name": "FormProperty", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:StartEvent", "bpmn:UserTask"] + }, + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "type", + "type": "String", + "isAttr": true + }, + { + "name": "required", + "type": "String", + "isAttr": true + }, + { + "name": "readable", + "type": "String", + "isAttr": true + }, + { + "name": "writable", + "type": "String", + "isAttr": true + }, + { + "name": "variable", + "type": "String", + "isAttr": true + }, + { + "name": "expression", + "type": "String", + "isAttr": true + }, + { + "name": "datePattern", + "type": "String", + "isAttr": true + }, + { + "name": "default", + "type": "String", + "isAttr": true + }, + { + "name": "values", + "type": "Value", + "isMany": true + } + ] + }, + { + "name": "FormData", + "superClass": ["Element"], + "meta": { + "allowedIn": ["bpmn:StartEvent", "bpmn:UserTask"] + }, + "properties": [ + { + "name": "fields", + "type": "FormField", + "isMany": true + }, + { + "name": "businessKey", + "type": "String", + "isAttr": true + } + ] + }, + { + "name": "FormField", + "superClass": ["Element"], + "properties": [ + { + "name": "id", + "type": "String", + "isAttr": true + }, + { + "name": "label", + "type": "String", + "isAttr": true + }, + { + "name": "type", + "type": "String", + "isAttr": true + }, + { + "name": "datePattern", + "type": "String", + "isAttr": true + }, + { + "name": "defaultValue", + "type": "String", + "isAttr": true + }, + { + "name": "properties", + "type": "Properties" + }, + { + "name": "validation", + "type": "Validation" + }, + { + "name": "values", + "type": "Value", + "isMany": true + } + ] + }, + { + "name": "Validation", + "superClass": ["Element"], + "properties": [ + { + "name": "constraints", + "type": "Constraint", + "isMany": true + } + ] + }, + { + "name": "Constraint", + "superClass": ["Element"], + "properties": [ + { + "name": "name", + "type": "String", + "isAttr": true + }, + { + "name": "config", + "type": "String", + "isAttr": true + } + ] + }, + { + "name": "ConditionalEventDefinition", + "isAbstract": true, + "extends": ["bpmn:ConditionalEventDefinition"], + "properties": [ + { + "name": "variableName", + "isAttr": true, + "type": "String" + }, + { + "name": "variableEvent", + "isAttr": true, + "type": "String" + } + ] + } + ], + "emumerations": [] + } diff --git a/src/views/Process/flowable/init.js b/src/views/Process/flowable/init.js new file mode 100644 index 0000000..ec9e282 --- /dev/null +++ b/src/views/Process/flowable/init.js @@ -0,0 +1,24 @@ + +function randomStr() { + return Math.random().toString(36).slice(-8) +} + +export default function() { + return ` + + + + + + + + + + + + + + + + ` +} diff --git a/src/views/Process/flowable/showConfig.js b/src/views/Process/flowable/showConfig.js new file mode 100644 index 0000000..69ba83e --- /dev/null +++ b/src/views/Process/flowable/showConfig.js @@ -0,0 +1,55 @@ +export default { + 'bpmn:EndEvent': {}, + 'bpmn:StartEvent': { + initiator: true, + formKey: true + }, + 'bpmn:UserTask': { + userType: true, + dataType: true, + assignee: true, + candidateUsers: true, + candidateGroups: true, + // assigneeFixed: true, + // candidateUsersFixed: true, + // candidateGroupsFixed: true, + async: true, + priority: true, + formKey: true, + skipExpression: true, + dueDate: true, + taskListener: true + }, + 'bpmn:ServiceTask': { + async: true, + skipExpression: true, + isForCompensation: true, + triggerable: true, + class: true + }, + 'bpmn:ScriptTask': { + async: true, + isForCompensation: true, + autoStoreVariables: true + }, + 'bpmn:ManualTask': { + async: true, + isForCompensation: true + }, + 'bpmn:ReceiveTask': { + async: true, + isForCompensation: true + }, + 'bpmn:SendTask': { + async: true, + isForCompensation: true + }, + 'bpmn:BusinessRuleTask': { + async: true, + isForCompensation: true, + ruleVariablesInput: true, + rules: true, + resultVariable: true, + exclude: true + } +} diff --git a/src/views/Process/index.js b/src/views/Process/index.js new file mode 100644 index 0000000..f78489d --- /dev/null +++ b/src/views/Process/index.js @@ -0,0 +1,5 @@ +import workflowBpmnModeler from './index.vue' + +workflowBpmnModeler.install = Vue => Vue.component(workflowBpmnModeler.name, workflowBpmnModeler) // 给组件配置install方法 + +export default workflowBpmnModeler diff --git a/src/views/Process/index.vue b/src/views/Process/index.vue new file mode 100644 index 0000000..fd40e36 --- /dev/null +++ b/src/views/Process/index.vue @@ -0,0 +1,467 @@ + + + + + diff --git a/src/views/Process/lang/zh.js b/src/views/Process/lang/zh.js new file mode 100644 index 0000000..003c0cc --- /dev/null +++ b/src/views/Process/lang/zh.js @@ -0,0 +1,227 @@ +export default { + // Labels + 'Activate the global connect tool': '激活全局连接工具', + 'Append {type}': '添加 {type}', + 'Add Lane above': '在上面添加道', + 'Divide into two Lanes': '分割成两个道', + 'Divide into three Lanes': '分割成三个道', + 'Add Lane below': '在下面添加道', + 'Append compensation activity': '追加补偿活动', + 'Change type': '修改类型', + 'Connect using Association': '使用关联连接', + 'Connect using Sequence/MessageFlow or Association': '使用顺序/消息流或者关联连接', + 'Connect using DataInputAssociation': '使用数据输入关联连接', + 'Remove': '移除', + 'Activate the hand tool': '激活抓手工具', + 'Activate the lasso tool': '激活套索工具', + 'Activate the create/remove space tool': '激活创建/删除空间工具', + 'Create expanded SubProcess': '创建扩展子过程', + 'Create IntermediateThrowEvent/BoundaryEvent': '创建中间抛出事件/边界事件', + 'Create Pool/Participant': '创建池/参与者', + 'Parallel Multi Instance': '并行多重事件', + 'Sequential Multi Instance': '时序多重事件', + 'DataObjectReference': '数据对象参考', + 'DataStoreReference': '数据存储参考', + 'Loop': '循环', + 'Ad-hoc': '即席', + 'Create {type}': '创建 {type}', + 'Task': '任务', + 'Send Task': '发送任务', + 'Receive Task': '接收任务', + 'User Task': '用户任务', + 'Manual Task': '手工任务', + 'Business Rule Task': '业务规则任务', + 'Service Task': '服务任务', + 'Script Task': '脚本任务', + 'Call Activity': '调用活动', + 'Sub Process (collapsed)': '子流程(折叠的)', + 'Sub Process (expanded)': '子流程(展开的)', + 'Start Event': '开始事件', + 'StartEvent': '开始事件', + 'Intermediate Throw Event': '中间事件', + 'End Event': '结束事件', + 'EndEvent': '结束事件', + 'Create Gateway': '创建网关', + 'Create Intermediate/Boundary Event': '创建中间/边界事件', + 'Message Start Event': '消息开始事件', + 'Timer Start Event': '定时开始事件', + 'Conditional Start Event': '条件开始事件', + 'Signal Start Event': '信号开始事件', + 'Error Start Event': '错误开始事件', + 'Escalation Start Event': '升级开始事件', + 'Compensation Start Event': '补偿开始事件', + 'Message Start Event (non-interrupting)': '消息开始事件(非中断)', + 'Timer Start Event (non-interrupting)': '定时开始事件(非中断)', + 'Conditional Start Event (non-interrupting)': '条件开始事件(非中断)', + 'Signal Start Event (non-interrupting)': '信号开始事件(非中断)', + 'Escalation Start Event (non-interrupting)': '升级开始事件(非中断)', + 'Message Intermediate Catch Event': '消息中间捕获事件', + 'Message Intermediate Throw Event': '消息中间抛出事件', + 'Timer Intermediate Catch Event': '定时中间捕获事件', + 'Escalation Intermediate Throw Event': '升级中间抛出事件', + 'Conditional Intermediate Catch Event': '条件中间捕获事件', + 'Link Intermediate Catch Event': '链接中间捕获事件', + 'Link Intermediate Throw Event': '链接中间抛出事件', + 'Compensation Intermediate Throw Event': '补偿中间抛出事件', + 'Signal Intermediate Catch Event': '信号中间捕获事件', + 'Signal Intermediate Throw Event': '信号中间抛出事件', + 'Message End Event': '消息结束事件', + 'Escalation End Event': '定时结束事件', + 'Error End Event': '错误结束事件', + 'Cancel End Event': '取消结束事件', + 'Compensation End Event': '补偿结束事件', + 'Signal End Event': '信号结束事件', + 'Terminate End Event': '终止结束事件', + 'Message Boundary Event': '消息边界事件', + 'Message Boundary Event (non-interrupting)': '消息边界事件(非中断)', + 'Timer Boundary Event': '定时边界事件', + 'Timer Boundary Event (non-interrupting)': '定时边界事件(非中断)', + 'Escalation Boundary Event': '升级边界事件', + 'Escalation Boundary Event (non-interrupting)': '升级边界事件(非中断)', + 'Conditional Boundary Event': '条件边界事件', + 'Conditional Boundary Event (non-interrupting)': '条件边界事件(非中断)', + 'Error Boundary Event': '错误边界事件', + 'Cancel Boundary Event': '取消边界事件', + 'Signal Boundary Event': '信号边界事件', + 'Signal Boundary Event (non-interrupting)': '信号边界事件(非中断)', + 'Compensation Boundary Event': '补偿边界事件', + 'Exclusive Gateway': '互斥网关', + 'Parallel Gateway': '并行网关', + 'Inclusive Gateway': '相容网关', + 'Complex Gateway': '复杂网关', + 'Event based Gateway': '事件网关', + 'Transaction': '转运', + 'Sub Process': '子流程', + 'Event Sub Process': '事件子流程', + 'Collapsed Pool': '折叠池', + 'Expanded Pool': '展开池', + // Errors + 'no parent for {element} in {parent}': '在{parent}里,{element}没有父类', + 'no shape type specified': '没有指定的形状类型', + 'flow elements must be children of pools/participants': '流元素必须是池/参与者的子类', + 'out of bounds release': 'out of bounds release', + 'more than {count} child lanes': '子道大于{count} ', + 'element required': '元素不能为空', + 'diagram not part of bpmn:Definitions': '流程图不符合bpmn规范', + 'no diagram to display': '没有可展示的流程图', + 'no process or collaboration to display': '没有可展示的流程/协作', + 'element {element} referenced by {referenced}#{property} not yet drawn': '由{referenced}#{property}引用的{element}元素仍未绘制', + 'already rendered {element}': '{element} 已被渲染', + 'failed to import {element}': '导入{element}失败', + // 属性面板的参数 + 'Id': '标识', + 'Name': '名称', + 'General': '常规', + 'Details': '详情', + 'Message Name': '消息名称', + 'Message': '消息', + 'Initiator': '创建者', + 'Asynchronous Continuations': '持续异步', + 'Asynchronous Before': '异步前', + 'Asynchronous After': '异步后', + 'Job Configuration': '工作配置', + 'Exclusive': '排除', + 'Job Priority': '工作优先级', + 'Retry Time Cycle': '重试时间周期', + 'Documentation': '文档', + 'Element Documentation': '元素文档', + 'History Configuration': '历史配置', + 'History Time To Live': '历史的生存时间', + 'Forms': '表单', + 'Form Key': '表单key', + 'Form Fields': '表单字段', + 'Business Key': '业务key', + 'Form Field': '表单字段', + 'ID': '编号', + 'Type': '类型', + 'Label': '名称', + 'Default Value': '默认值', + 'Validation': '校验', + 'Add Constraint': '添加约束', + 'Config': '配置', + 'Properties': '属性', + 'Add Property': '添加属性', + 'Value': '值', + 'Listeners': '监听器', + 'Execution Listener': '执行监听', + 'Event Type': '事件类型', + 'Listener Type': '监听器类型', + 'Java Class': 'Java类', + 'Expression': '表达式', + 'Must provide a value': '必须提供一个值', + 'Delegate Expression': '代理表达式', + 'Script': '脚本', + 'Script Format': '脚本格式', + 'Script Type': '脚本类型', + 'Inline Script': '内联脚本', + 'External Script': '外部脚本', + 'Resource': '资源', + 'Field Injection': '字段注入', + 'Extensions': '扩展', + 'Input/Output': '输入/输出', + 'Input Parameters': '输入参数', + 'Output Parameters': '输出参数', + 'Parameters': '参数', + 'Output Parameter': '输出参数', + 'Timer Definition Type': '定时器定义类型', + 'Timer Definition': '定时器定义', + 'Date': '日期', + 'Duration': '持续', + 'Cycle': '循环', + 'Signal': '信号', + 'Signal Name': '信号名称', + 'Escalation': '升级', + 'Error': '错误', + 'Link Name': '链接名称', + 'Condition': '条件名称', + 'Variable Name': '变量名称', + 'Variable Event': '变量事件', + 'Specify more than one variable change event as a comma separated list.': '多个变量事件以逗号隔开', + 'Wait for Completion': '等待完成', + 'Activity Ref': '活动参考', + 'Version Tag': '版本标签', + 'Executable': '可执行文件', + 'External Task Configuration': '扩展任务配置', + 'Task Priority': '任务优先级', + 'External': '外部', + 'Connector': '连接器', + 'Must configure Connector': '必须配置连接器', + 'Connector Id': '连接器编号', + 'Implementation': '实现方式', + 'Field Injections': '字段注入', + 'Fields': '字段', + 'Result Variable': '结果变量', + 'Topic': '主题', + 'Configure Connector': '配置连接器', + 'Input Parameter': '输入参数', + 'Assignee': '代理人', + 'Candidate Users': '候选用户', + 'Candidate Groups': '候选组', + 'Due Date': '到期时间', + 'Follow Up Date': '跟踪日期', + 'Priority': '优先级', + 'The follow up date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)': '跟踪日期必须符合EL表达式,如: ${someDate} ,或者一个ISO标准日期,如:2015-06-26T09:54:00', + 'The due date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)': '跟踪日期必须符合EL表达式,如: ${someDate} ,或者一个ISO标准日期,如:2015-06-26T09:54:00', + 'Variables': '变量' +} + +export const NodeName = { + 'bpmn:Process': '流程', + 'bpmn:StartEvent': '开始事件', + 'bpmn:IntermediateThrowEvent': '中间事件', + 'bpmn:Task': '任务', + 'bpmn:SendTask': '发送任务', + 'bpmn:ReceiveTask': '接收任务', + 'bpmn:UserTask': '用户任务', + 'bpmn:ManualTask': '手工任务', + 'bpmn:BusinessRuleTask': '业务规则任务', + 'bpmn:ServiceTask': '服务任务', + 'bpmn:ScriptTask': '脚本任务', + 'bpmn:EndEvent': '结束事件', + 'bpmn:SequenceFlow': '流程线', + 'bpmn:ExclusiveGateway': '互斥网关', + 'bpmn:ParallelGateway': '并行网关', + 'bpmn:InclusiveGateway': '相容网关', + 'bpmn:ComplexGateway': '复杂网关', + 'bpmn:EventBasedGateway': '事件网关' +} diff --git a/src/views/index.vue b/src/views/index.vue new file mode 100644 index 0000000..52931c8 --- /dev/null +++ b/src/views/index.vue @@ -0,0 +1,51 @@ + + + + + diff --git a/src/views/login/login.vue b/src/views/login/login.vue new file mode 100644 index 0000000..7c12283 --- /dev/null +++ b/src/views/login/login.vue @@ -0,0 +1,279 @@ + + + + + + diff --git a/src/views/materialManagement/index.vue b/src/views/materialManagement/index.vue new file mode 100644 index 0000000..0113089 --- /dev/null +++ b/src/views/materialManagement/index.vue @@ -0,0 +1,221 @@ + + + + + \ No newline at end of file diff --git a/src/views/redirect/index.vue b/src/views/redirect/index.vue new file mode 100644 index 0000000..db4c1d6 --- /dev/null +++ b/src/views/redirect/index.vue @@ -0,0 +1,12 @@ + diff --git a/src/views/storeManagement/index.vue b/src/views/storeManagement/index.vue new file mode 100644 index 0000000..25a8977 --- /dev/null +++ b/src/views/storeManagement/index.vue @@ -0,0 +1,222 @@ + + + + + \ No newline at end of file diff --git a/src/views/supervise/churuku/index.vue b/src/views/supervise/churuku/index.vue new file mode 100644 index 0000000..faed658 --- /dev/null +++ b/src/views/supervise/churuku/index.vue @@ -0,0 +1,373 @@ + + + + + \ No newline at end of file diff --git a/src/views/supervise/churukuHT/index.vue b/src/views/supervise/churukuHT/index.vue new file mode 100644 index 0000000..2183f2f --- /dev/null +++ b/src/views/supervise/churukuHT/index.vue @@ -0,0 +1,223 @@ + + + + + \ No newline at end of file diff --git a/src/views/supervise/inventory/index.vue b/src/views/supervise/inventory/index.vue new file mode 100644 index 0000000..f617128 --- /dev/null +++ b/src/views/supervise/inventory/index.vue @@ -0,0 +1,270 @@ + + + + + \ No newline at end of file diff --git a/src/views/supervise/oilTypeInBound/LookId.vue b/src/views/supervise/oilTypeInBound/LookId.vue new file mode 100644 index 0000000..abeb691 --- /dev/null +++ b/src/views/supervise/oilTypeInBound/LookId.vue @@ -0,0 +1,293 @@ + + + + + \ No newline at end of file diff --git a/src/views/supervise/oilTypeInBound/index.vue b/src/views/supervise/oilTypeInBound/index.vue new file mode 100644 index 0000000..d304581 --- /dev/null +++ b/src/views/supervise/oilTypeInBound/index.vue @@ -0,0 +1,330 @@ + + + + + \ No newline at end of file diff --git a/src/views/supervise/oilTypeOutBound/index.vue b/src/views/supervise/oilTypeOutBound/index.vue new file mode 100644 index 0000000..304ee73 --- /dev/null +++ b/src/views/supervise/oilTypeOutBound/index.vue @@ -0,0 +1,319 @@ + + + + + \ No newline at end of file diff --git a/src/views/supervise/recordOilTank/LookId.vue b/src/views/supervise/recordOilTank/LookId.vue new file mode 100644 index 0000000..3e46e9b --- /dev/null +++ b/src/views/supervise/recordOilTank/LookId.vue @@ -0,0 +1,309 @@ + + + + + \ No newline at end of file diff --git a/src/views/supervise/recordOilTank/index.vue b/src/views/supervise/recordOilTank/index.vue new file mode 100644 index 0000000..ee6da97 --- /dev/null +++ b/src/views/supervise/recordOilTank/index.vue @@ -0,0 +1,336 @@ + + + + + \ No newline at end of file diff --git a/src/views/supervise/rukujilu/index.vue b/src/views/supervise/rukujilu/index.vue new file mode 100644 index 0000000..75eeb5f --- /dev/null +++ b/src/views/supervise/rukujilu/index.vue @@ -0,0 +1,320 @@ + + + + + \ No newline at end of file diff --git a/src/views/supplierManagement/index.vue b/src/views/supplierManagement/index.vue new file mode 100644 index 0000000..93b69d9 --- /dev/null +++ b/src/views/supplierManagement/index.vue @@ -0,0 +1,291 @@ + + + + + \ No newline at end of file diff --git a/tests/unit/.eslintrc.js b/tests/unit/.eslintrc.js new file mode 100644 index 0000000..958d51b --- /dev/null +++ b/tests/unit/.eslintrc.js @@ -0,0 +1,5 @@ +module.exports = { + env: { + jest: true + } +} diff --git a/tests/unit/components/Breadcrumb.spec.js b/tests/unit/components/Breadcrumb.spec.js new file mode 100644 index 0000000..1d94c8f --- /dev/null +++ b/tests/unit/components/Breadcrumb.spec.js @@ -0,0 +1,98 @@ +import { mount, createLocalVue } from '@vue/test-utils' +import VueRouter from 'vue-router' +import ElementUI from 'element-ui' +import Breadcrumb from '@/components/Breadcrumb/index.vue' + +const localVue = createLocalVue() +localVue.use(VueRouter) +localVue.use(ElementUI) + +const routes = [ + { + path: '/', + name: 'home', + children: [{ + path: 'dashboard', + name: 'dashboard' + }] + }, + { + path: '/menu', + name: 'menu', + children: [{ + path: 'menu1', + name: 'menu1', + meta: { title: 'menu1' }, + children: [{ + path: 'menu1-1', + name: 'menu1-1', + meta: { title: 'menu1-1' } + }, + { + path: 'menu1-2', + name: 'menu1-2', + redirect: 'noredirect', + meta: { title: 'menu1-2' }, + children: [{ + path: 'menu1-2-1', + name: 'menu1-2-1', + meta: { title: 'menu1-2-1' } + }, + { + path: 'menu1-2-2', + name: 'menu1-2-2' + }] + }] + }] + }] + +const router = new VueRouter({ + routes +}) + +describe('Breadcrumb.vue', () => { + const wrapper = mount(Breadcrumb, { + localVue, + router + }) + it('dashboard', () => { + router.push('/dashboard') + const len = wrapper.findAll('.el-breadcrumb__inner').length + expect(len).toBe(1) + }) + it('normal route', () => { + router.push('/menu/menu1') + const len = wrapper.findAll('.el-breadcrumb__inner').length + expect(len).toBe(2) + }) + it('nested route', () => { + router.push('/menu/menu1/menu1-2/menu1-2-1') + const len = wrapper.findAll('.el-breadcrumb__inner').length + expect(len).toBe(4) + }) + it('no meta.title', () => { + router.push('/menu/menu1/menu1-2/menu1-2-2') + const len = wrapper.findAll('.el-breadcrumb__inner').length + expect(len).toBe(3) + }) + // it('click link', () => { + // router.push('/menu/menu1/menu1-2/menu1-2-2') + // const breadcrumbArray = wrapper.findAll('.el-breadcrumb__inner') + // const second = breadcrumbArray.at(1) + // console.log(breadcrumbArray) + // const href = second.find('a').attributes().href + // expect(href).toBe('#/menu/menu1') + // }) + // it('noRedirect', () => { + // router.push('/menu/menu1/menu1-2/menu1-2-1') + // const breadcrumbArray = wrapper.findAll('.el-breadcrumb__inner') + // const redirectBreadcrumb = breadcrumbArray.at(2) + // expect(redirectBreadcrumb.contains('a')).toBe(false) + // }) + it('last breadcrumb', () => { + router.push('/menu/menu1/menu1-2/menu1-2-1') + const breadcrumbArray = wrapper.findAll('.el-breadcrumb__inner') + const redirectBreadcrumb = breadcrumbArray.at(3) + expect(redirectBreadcrumb.contains('a')).toBe(false) + }) +}) diff --git a/tests/unit/components/Hamburger.spec.js b/tests/unit/components/Hamburger.spec.js new file mode 100644 index 0000000..01ea303 --- /dev/null +++ b/tests/unit/components/Hamburger.spec.js @@ -0,0 +1,18 @@ +import { shallowMount } from '@vue/test-utils' +import Hamburger from '@/components/Hamburger/index.vue' +describe('Hamburger.vue', () => { + it('toggle click', () => { + const wrapper = shallowMount(Hamburger) + const mockFn = jest.fn() + wrapper.vm.$on('toggleClick', mockFn) + wrapper.find('.hamburger').trigger('click') + expect(mockFn).toBeCalled() + }) + it('prop isActive', () => { + const wrapper = shallowMount(Hamburger) + wrapper.setProps({ isActive: true }) + expect(wrapper.contains('.is-active')).toBe(true) + wrapper.setProps({ isActive: false }) + expect(wrapper.contains('.is-active')).toBe(false) + }) +}) diff --git a/tests/unit/components/SvgIcon.spec.js b/tests/unit/components/SvgIcon.spec.js new file mode 100644 index 0000000..31467a9 --- /dev/null +++ b/tests/unit/components/SvgIcon.spec.js @@ -0,0 +1,22 @@ +import { shallowMount } from '@vue/test-utils' +import SvgIcon from '@/components/SvgIcon/index.vue' +describe('SvgIcon.vue', () => { + it('iconClass', () => { + const wrapper = shallowMount(SvgIcon, { + propsData: { + iconClass: 'test' + } + }) + expect(wrapper.find('use').attributes().href).toBe('#icon-test') + }) + it('className', () => { + const wrapper = shallowMount(SvgIcon, { + propsData: { + iconClass: 'test' + } + }) + expect(wrapper.classes().length).toBe(1) + wrapper.setProps({ className: 'test' }) + expect(wrapper.classes().includes('test')).toBe(true) + }) +}) diff --git a/tests/unit/utils/formatTime.spec.js b/tests/unit/utils/formatTime.spec.js new file mode 100644 index 0000000..24e165b --- /dev/null +++ b/tests/unit/utils/formatTime.spec.js @@ -0,0 +1,30 @@ +import { formatTime } from '@/utils/index.js' + +describe('Utils:formatTime', () => { + const d = new Date('2018-07-13 17:54:01') // "2018-07-13 17:54:01" + const retrofit = 5 * 1000 + + it('ten digits timestamp', () => { + expect(formatTime((d / 1000).toFixed(0))).toBe('7月13日17时54分') + }) + it('test now', () => { + expect(formatTime(+new Date() - 1)).toBe('刚刚') + }) + it('less two minute', () => { + expect(formatTime(+new Date() - 60 * 2 * 1000 + retrofit)).toBe('2分钟前') + }) + it('less two hour', () => { + expect(formatTime(+new Date() - 60 * 60 * 2 * 1000 + retrofit)).toBe('2小时前') + }) + it('less one day', () => { + expect(formatTime(+new Date() - 60 * 60 * 24 * 1 * 1000)).toBe('1天前') + }) + it('more than one day', () => { + expect(formatTime(d)).toBe('7月13日17时54分') + }) + it('format', () => { + expect(formatTime(d, '{y}-{m}-{d} {h}:{i}')).toBe('2018-07-13 17:54') + expect(formatTime(d, '{y}-{m}-{d}')).toBe('2018-07-13') + expect(formatTime(d, '{y}/{m}/{d} {h}-{i}')).toBe('2018/07/13 17-54') + }) +}) diff --git a/tests/unit/utils/param2Obj.spec.js b/tests/unit/utils/param2Obj.spec.js new file mode 100644 index 0000000..e106ed8 --- /dev/null +++ b/tests/unit/utils/param2Obj.spec.js @@ -0,0 +1,14 @@ +import { param2Obj } from '@/utils/index.js' +describe('Utils:param2Obj', () => { + const url = 'https://github.com/PanJiaChen/vue-element-admin?name=bill&age=29&sex=1&field=dGVzdA==&key=%E6%B5%8B%E8%AF%95' + + it('param2Obj test', () => { + expect(param2Obj(url)).toEqual({ + name: 'bill', + age: '29', + sex: '1', + field: window.btoa('test'), + key: '测试' + }) + }) +}) diff --git a/tests/unit/utils/parseTime.spec.js b/tests/unit/utils/parseTime.spec.js new file mode 100644 index 0000000..56045af --- /dev/null +++ b/tests/unit/utils/parseTime.spec.js @@ -0,0 +1,35 @@ +import { parseTime } from '@/utils/index.js' + +describe('Utils:parseTime', () => { + const d = new Date('2018-07-13 17:54:01') // "2018-07-13 17:54:01" + it('timestamp', () => { + expect(parseTime(d)).toBe('2018-07-13 17:54:01') + }) + it('timestamp string', () => { + expect(parseTime((d + ''))).toBe('2018-07-13 17:54:01') + }) + it('ten digits timestamp', () => { + expect(parseTime((d / 1000).toFixed(0))).toBe('2018-07-13 17:54:01') + }) + it('new Date', () => { + expect(parseTime(new Date(d))).toBe('2018-07-13 17:54:01') + }) + it('format', () => { + expect(parseTime(d, '{y}-{m}-{d} {h}:{i}')).toBe('2018-07-13 17:54') + expect(parseTime(d, '{y}-{m}-{d}')).toBe('2018-07-13') + expect(parseTime(d, '{y}/{m}/{d} {h}-{i}')).toBe('2018/07/13 17-54') + }) + it('get the day of the week', () => { + expect(parseTime(d, '{a}')).toBe('五') // 星期五 + }) + it('get the day of the week', () => { + expect(parseTime(+d + 1000 * 60 * 60 * 24 * 2, '{a}')).toBe('日') // 星期日 + }) + it('empty argument', () => { + expect(parseTime()).toBeNull() + }) + + it('null', () => { + expect(parseTime(null)).toBeNull() + }) +}) diff --git a/tests/unit/utils/validate.spec.js b/tests/unit/utils/validate.spec.js new file mode 100644 index 0000000..f774905 --- /dev/null +++ b/tests/unit/utils/validate.spec.js @@ -0,0 +1,17 @@ +import { validUsername, isExternal } from '@/utils/validate.js' + +describe('Utils:validate', () => { + it('validUsername', () => { + expect(validUsername('admin')).toBe(true) + expect(validUsername('editor')).toBe(true) + expect(validUsername('xxxx')).toBe(false) + }) + it('isExternal', () => { + expect(isExternal('https://github.com/PanJiaChen/vue-element-admin')).toBe(true) + expect(isExternal('http://github.com/PanJiaChen/vue-element-admin')).toBe(true) + expect(isExternal('github.com/PanJiaChen/vue-element-admin')).toBe(false) + expect(isExternal('/dashboard')).toBe(false) + expect(isExternal('./dashboard')).toBe(false) + expect(isExternal('dashboard')).toBe(false) + }) +}) diff --git a/vue.config.js b/vue.config.js new file mode 100644 index 0000000..d920ba3 --- /dev/null +++ b/vue.config.js @@ -0,0 +1,143 @@ +'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' ? '/gf/' : '/', + outputDir: 'yyth-ui', + 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://192.168.1.109:8111', + target: process.env.VUE_APP_URL, // 代理目标的基础路径 + // target: 'http://jianguan.yyundong.com/shgfapi', // 代理目标的基础路径 + changeOrigin: true, // 支持跨域 + pathRewrite: { // 重写路径: 去掉路径中开头的'/api' + '^/api': '' + } + }, + '/upload': { // 匹配所有以 '/api'开头的请求路径 + // target: 'http://120.46.131.15:8111', + 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') + } + ) + } +}