Browse Source

功能点完善

master
liaoxiping 4 years ago
parent
commit
1dd5924d42
  1. 28
      .editorconfig
  2. 38
      .env.boot
  3. 28
      .env.development
  4. 32
      .env.production
  5. 16
      .env.staging
  6. 8
      .eslintignore
  7. 30
      .eslintrc.js
  8. 52
      .gitignore
  9. 12
      .prettierrc
  10. 10
      .travis.yml
  11. 66
      admin-web/static/css/chunk-libs.b1ad2d16.css
  12. 32
      admin-web/static/js/chunk-3fbd7f8c.82f05a5a.js
  13. 12
      admin-web/static/js/chunk-454045ca.026f25c6.js
  14. 130
      admin-web/static/js/chunk-libs.e51f8593.js
  15. 10
      babel.config.js
  16. 48
      jest.config.js
  17. 4
      nodestatic.json
  18. 51606
      package-lock.json
  19. 254
      package.json
  20. 14
      plopfile.js
  21. 10
      postcss.config.js
  22. 30
      public/index.html
  23. 64
      src/App.vue
  24. 58
      src/api/ActivityTweets.js
  25. 44
      src/api/AfterSale.js
  26. 72
      src/api/Applet.js
  27. 156
      src/api/Application.js
  28. 74
      src/api/Apply.js
  29. 148
      src/api/Area.js
  30. 136
      src/api/Attachment.js
  31. 274
      src/api/AxiosApi.js
  32. 96
      src/api/Brand.js
  33. 108
      src/api/Classification.js
  34. 232
      src/api/Comment.js
  35. 38
      src/api/Common.js
  36. 74
      src/api/Custom.js
  37. 30
      src/api/Dashboard.js
  38. 94
      src/api/Dictionary.js
  39. 176
      src/api/DictionaryItem.js
  40. 132
      src/api/Finance.js
  41. 178
      src/api/GlobalUser.js
  42. 168
      src/api/Goods.js
  43. 192
      src/api/InformationApi.js
  44. 134
      src/api/Label.js
  45. 68
      src/api/Login.js
  46. 116
      src/api/LoginLog.js
  47. 72
      src/api/Management.js
  48. 230
      src/api/Marketing.js
  49. 190
      src/api/Member.js
  50. 78
      src/api/Menu.js
  51. 94
      src/api/Menus.js
  52. 170
      src/api/Msgs.js
  53. 136
      src/api/OptLog.js
  54. 156
      src/api/Org.js
  55. 158
      src/api/Parameter.js
  56. 94
      src/api/Resource.js
  57. 258
      src/api/Role.js
  58. 34
      src/api/SmsSendStatus.js
  59. 168
      src/api/SmsTask.js
  60. 178
      src/api/SmsTemplate.js
  61. 156
      src/api/Station.js
  62. 168
      src/api/SystemApi.js
  63. 114
      src/api/Tenant copy.js
  64. 210
      src/api/Tenant.js
  65. 270
      src/api/User.js
  66. 194
      src/api/creditGoods/CreditGoods.js
  67. 192
      src/api/creditGoods/CreditGoodsCategory.js
  68. 192
      src/api/creditGoods/CreditGoodsImg.js
  69. 194
      src/api/creditGoods/CreditOrder.js
  70. 192
      src/api/creditGoods/CreditOrderDelivery.js
  71. 192
      src/api/creditGoods/CreditOrderDetail.js
  72. 222
      src/components/BackToTop/index.vue
  73. 170
      src/components/Breadcrumb/index.vue
  74. 310
      src/components/Charts/Keyboard.vue
  75. 454
      src/components/Charts/LineMarker.vue
  76. 542
      src/components/Charts/MixChart.vue
  77. 68
      src/components/Charts/mixins/resize.js
  78. 332
      src/components/DndList/index.vue
  79. 122
      src/components/DragSelect/index.vue
  80. 594
      src/components/Dropzone/index.vue
  81. 88
      src/components/Hamburger/index.vue
  82. 380
      src/components/HeaderSearch/index.vue
  83. 2850
      src/components/ImageCropper/index.vue
  84. 38
      src/components/ImageCropper/utils/data2blob.js
  85. 78
      src/components/ImageCropper/utils/effectRipple.js
  86. 464
      src/components/ImageCropper/utils/language.js
  87. 14
      src/components/ImageCropper/utils/mimes.js
  88. 134
      src/components/ImageUpload/index.vue
  89. 144
      src/components/JsonEditor/index.vue
  90. 198
      src/components/Kanban/index.vue
  91. 70
      src/components/LangSelect/index.vue
  92. 720
      src/components/MDinput/index.vue
  93. 612
      src/components/Management/AddDialog.vue
  94. 420
      src/components/Management/Container.vue
  95. 164
      src/components/Management/SearchBar.vue
  96. 376
      src/components/Management/checkDialog.vue
  97. 62
      src/components/MarkdownEditor/default-options.js
  98. 236
      src/components/MarkdownEditor/index.vue
  99. 206
      src/components/Pagination/index.vue
  100. 280
      src/components/PanThumb/index.vue
  101. Some files were not shown because too many files have changed in this diff Show More

28
.editorconfig

@ -1,14 +1,14 @@
# https://editorconfig.org # https://editorconfig.org
root = true root = true
[*] [*]
charset = utf-8 charset = utf-8
indent_style = space indent_style = space
indent_size = 2 indent_size = 2
end_of_line = lf end_of_line = lf
insert_final_newline = true insert_final_newline = true
trim_trailing_whitespace = true trim_trailing_whitespace = true
[*.md] [*.md]
insert_final_newline = false insert_final_newline = false
trim_trailing_whitespace = false trim_trailing_whitespace = false

38
.env.boot

@ -1,19 +1,19 @@
NODE_ENV = production NODE_ENV = production
# just a flag # just a flag
ENV = 'boot' ENV = 'boot'
VUE_APP_PROJECT_NAME = 'cereshop' VUE_APP_PROJECT_NAME = 'cereshop'
# 是否启用验证码 # 是否启用验证码
VUE_APP_IS_CAPTCHA = true VUE_APP_IS_CAPTCHA = true
# 客户端秘钥 # 客户端秘钥
VUE_APP_CLIENT_ID=ceres_admin_web VUE_APP_CLIENT_ID=ceres_admin_web
VUE_APP_CLIENT_SECRET=ceres_admin_web VUE_APP_CLIENT_SECRET=ceres_admin_web
# base api # base api
VUE_APP_BASE_API = '/api' VUE_APP_BASE_API = '/api'

28
.env.development

@ -1,14 +1,14 @@
# just a flag # just a flag
ENV = 'development' ENV = 'development'
VUE_APP_PROJECT_NAME = 'cereshop-admin-web' VUE_APP_PROJECT_NAME = 'cereshop-admin-web'
# 请求服务配置 # 请求服务配置
VUE_APP_DEV_REQUEST_DOMAIN_PREFIX = 'http://192.168.10.236:8764' VUE_APP_DEV_REQUEST_DOMAIN_PREFIX = 'http://192.168.10.130:8764'
# 是否启用验证码 # 是否启用验证码
VUE_APP_IS_CAPTCHA = true VUE_APP_IS_CAPTCHA = true
# 客户端秘钥 # 客户端秘钥
VUE_APP_CLIENT_ID=ceres_admin_web VUE_APP_CLIENT_ID=ceres_admin_web
VUE_APP_CLIENT_SECRET=ceres_admin_web VUE_APP_CLIENT_SECRET=ceres_admin_web
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true

32
.env.production

@ -1,16 +1,16 @@
# just a flag # just a flag
ENV = 'production' ENV = 'production'
VUE_APP_PROJECT_NAME = 'admin-web' VUE_APP_PROJECT_NAME = 'admin-web'
# 请求域名前缀, 该变量仅仅生产环境需要设置 # 请求域名前缀, 该变量仅仅生产环境需要设置
VUE_APP_DEV_REQUEST_DOMAIN_PREFIX = 'https://pos.admin.api.lotus-wallet.com' VUE_APP_DEV_REQUEST_DOMAIN_PREFIX = 'https://pos.admin.api.lotus-wallet.com'
# base api # base api
VUE_APP_BASE_API = '/api' VUE_APP_BASE_API = '/api'
# 是否启用验证码 # 是否启用验证码
VUE_APP_IS_CAPTCHA = true VUE_APP_IS_CAPTCHA = true
# 客户端秘钥 # 客户端秘钥
VUE_APP_CLIENT_ID=ceres_admin_web VUE_APP_CLIENT_ID=ceres_admin_web
VUE_APP_CLIENT_SECRET=ceres_admin_web VUE_APP_CLIENT_SECRET=ceres_admin_web

16
.env.staging

@ -1,8 +1,8 @@
NODE_ENV = production NODE_ENV = production
# just a flag # just a flag
ENV = 'staging' ENV = 'staging'
# base api # base api
VUE_APP_BASE_API = '/stage-api' VUE_APP_BASE_API = '/stage-api'

8
.eslintignore

@ -1,4 +1,4 @@
build/*.js build/*.js
src/assets src/assets
public public
dist dist

30
.eslintrc.js

@ -1,15 +1,15 @@
module.exports = { module.exports = {
root: true, root: true,
env: { env: {
node: true node: true
}, },
// extends: ["plugin:vue/essential", "@vue/prettier"],//这里面的@vue/prettier去掉 // extends: ["plugin:vue/essential", "@vue/prettier"],//这里面的@vue/prettier去掉
extends: ["plugin:vue/essential"], extends: ["plugin:vue/essential"],
rules: { rules: {
"no-console": process.env.NODE_ENV === "production" ? "error" : "off", "no-console": process.env.NODE_ENV === "production" ? "error" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off" "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off"
}, },
parserOptions: { parserOptions: {
// parser: "babel-eslint" // parser: "babel-eslint"
} }
}; };

52
.gitignore vendored

@ -1,26 +1,26 @@
.DS_Store .DS_Store
node_modules/ node_modules/
dist/ dist/
npm-debug.log* npm-debug.log*
yarn-debug.log* yarn-debug.log*
yarn-error.log* yarn-error.log*
**/*.log **/*.log
.history/ .history/
tests/**/coverage/ tests/**/coverage/
tests/e2e/reports tests/e2e/reports
selenium-debug.log selenium-debug.log
# Editor directories and files # Editor directories and files
.idea .idea
*.iml *.iml
.vscode .vscode
*.suo *.suo
*.ntvs* *.ntvs*
*.njsproj *.njsproj
*.sln *.sln
*.local *.local
# admin-web # admin-web
build build

12
.prettierrc

@ -1,6 +1,6 @@
{ {
"eslintIntegration": true, "eslintIntegration": true,
"stylelintIntegration": true, "stylelintIntegration": true,
"singleQuote": true, "singleQuote": true,
"semi": false "semi": false
} }

10
.travis.yml

@ -1,5 +1,5 @@
language: node_js language: node_js
node_js: 10 node_js: 10
script: npm run test script: npm run test
notifications: notifications:
email: false email: false

66
admin-web/static/css/chunk-libs.b1ad2d16.css

File diff suppressed because one or more lines are too long

32
admin-web/static/js/chunk-3fbd7f8c.82f05a5a.js

File diff suppressed because one or more lines are too long

12
admin-web/static/js/chunk-454045ca.026f25c6.js

File diff suppressed because one or more lines are too long

130
admin-web/static/js/chunk-libs.e51f8593.js

File diff suppressed because one or more lines are too long

10
babel.config.js

@ -1,5 +1,5 @@
module.exports = { module.exports = {
presets: [ presets: [
'@vue/app' '@vue/app'
] ]
} }

48
jest.config.js

@ -1,24 +1,24 @@
module.exports = { module.exports = {
moduleFileExtensions: ['js', 'jsx', 'json', 'vue'], moduleFileExtensions: ['js', 'jsx', 'json', 'vue'],
transform: { transform: {
'^.+\\.vue$': 'vue-jest', '^.+\\.vue$': 'vue-jest',
'.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$':
'jest-transform-stub', 'jest-transform-stub',
'^.+\\.jsx?$': 'babel-jest' '^.+\\.jsx?$': 'babel-jest'
}, },
moduleNameMapper: { moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1' '^@/(.*)$': '<rootDir>/src/$1'
}, },
snapshotSerializers: ['jest-serializer-vue'], snapshotSerializers: ['jest-serializer-vue'],
testMatch: [ testMatch: [
'**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)' '**/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}'], collectCoverageFrom: ['src/utils/**/*.{js,vue}', '!src/utils/auth.js', '!src/utils/request.js', 'src/components/**/*.{js,vue}'],
coverageDirectory: '<rootDir>/tests/unit/coverage', coverageDirectory: '<rootDir>/tests/unit/coverage',
// 'collectCoverage': true, // 'collectCoverage': true,
'coverageReporters': [ 'coverageReporters': [
'lcov', 'lcov',
'text-summary' 'text-summary'
], ],
testURL: 'http://localhost/' testURL: 'http://localhost/'
} }

4
nodestatic.json

@ -1,3 +1,3 @@
{ {
"path": "admin-web" "path": "admin-web"
} }

51606
package-lock.json generated

File diff suppressed because it is too large Load Diff

254
package.json

@ -1,127 +1,127 @@
{ {
"name": "cereshop", "name": "cereshop",
"version": "1.0.0", "version": "1.0.0",
"description": "cereshop", "description": "cereshop",
"author": "cereshop", "author": "cereshop",
"license": "Apache 2.0", "license": "Apache 2.0",
"scripts": { "scripts": {
"dev": "vue-cli-service serve --open", "dev": "vue-cli-service serve --open",
"build": "vue-cli-service build", "build": "vue-cli-service build",
"build:prod": "vue-cli-service build", "build:prod": "vue-cli-service build",
"build:boot": "vue-cli-service build --mode boot", "build:boot": "vue-cli-service build --mode boot",
"build:docker": "vue-cli-service build --mode docker", "build:docker": "vue-cli-service build --mode docker",
"build:stage": "vue-cli-service build --mode staging", "build:stage": "vue-cli-service build --mode staging",
"preview": "node build/index.js --preview", "preview": "node build/index.js --preview",
"lint": "eslint --ext .js,.vue src", "lint": "eslint --ext .js,.vue src",
"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml", "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml",
"new": "plop" "new": "plop"
}, },
"husky": { "husky": {
"hooks": { "hooks": {
"pre-commit": "lint-staged" "pre-commit": "lint-staged"
} }
}, },
"lint-staged": { "lint-staged": {
"src/**/*.{js,vue}": [ "src/**/*.{js,vue}": [
"eslint --fix", "eslint --fix",
"git add" "git add"
] ]
}, },
"keywords": [ "keywords": [
"vue", "vue",
"admin", "admin",
"dashboard", "dashboard",
"element-ui", "element-ui",
"management-system" "management-system"
], ],
"repository": { "repository": {
"type": "git", "type": "git",
"url": "" "url": ""
}, },
"bugs": { "bugs": {
"url": "" "url": ""
}, },
"dependencies": { "dependencies": {
"@riophae/vue-treeselect": "^0.4.0", "@riophae/vue-treeselect": "^0.4.0",
"acorn": "^6.4.1", "acorn": "^6.4.1",
"axios": "^0.20.0", "axios": "^0.20.0",
"clipboard": "^2.0.6", "clipboard": "^2.0.6",
"codemirror": "^5.57.0", "codemirror": "^5.57.0",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"css-loader": "^4.2.2", "css-loader": "^4.2.2",
"dragula": "^3.7.2", "dragula": "^3.7.2",
"driver.js": "^0.9.8", "driver.js": "^0.9.8",
"dropzone": "^5.7.2", "dropzone": "^5.7.2",
"echarts": "^4.2.1", "echarts": "^4.2.1",
"element-ui": "^2.13.2", "element-ui": "^2.13.2",
"file-saver": "^2.0.2", "file-saver": "^2.0.2",
"fuse.js": "^6.4.1", "fuse.js": "^6.4.1",
"jsonlint": "1.6.3", "jsonlint": "1.6.3",
"jszip": "^3.5.0", "jszip": "^3.5.0",
"less": "^3.12.2", "less": "^3.12.2",
"less-loader": "^7.0.0", "less-loader": "^7.0.0",
"normalize.css": "^8.0.1", "normalize.css": "^8.0.1",
"nprogress": "0.2.0", "nprogress": "0.2.0",
"path-to-regexp": "^6.1.0", "path-to-regexp": "^6.1.0",
"screenfull": "^5.0.2", "screenfull": "^5.0.2",
"showdown": "^1.9.1", "showdown": "^1.9.1",
"sortablejs": "^1.10.2", "sortablejs": "^1.10.2",
"tui-editor": "^1.4.10", "tui-editor": "^1.4.10",
"v-viewer": "^1.5.1", "v-viewer": "^1.5.1",
"vue": "^2.6.12", "vue": "^2.6.12",
"vue-count-to": "^1.0.13", "vue-count-to": "^1.0.13",
"vue-i18n": "^8.21.0", "vue-i18n": "^8.21.0",
"vue-loader": "^15.9.2", "vue-loader": "^15.9.2",
"vue-photo-preview": "^1.1.3", "vue-photo-preview": "^1.1.3",
"vue-quill-editor": "^3.0.6", "vue-quill-editor": "^3.0.6",
"vue-router": "^3.4.6", "vue-router": "^3.4.6",
"vue-splitpane": "^1.0.6", "vue-splitpane": "^1.0.6",
"vuedraggable": "^2.24.1", "vuedraggable": "^2.24.1",
"vuex": "^3.5.1", "vuex": "^3.5.1",
"webpack": "^4.44.1", "webpack": "^4.44.1",
"xlsx": "^0.16.6" "xlsx": "^0.16.6"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.11.4", "@babel/core": "^7.11.4",
"@babel/register": "^7.10.5", "@babel/register": "^7.10.5",
"@vue/cli-plugin-babel": "^4.5.4", "@vue/cli-plugin-babel": "^4.5.4",
"@vue/cli-plugin-eslint": "^4.5.4", "@vue/cli-plugin-eslint": "^4.5.4",
"@vue/cli-plugin-unit-jest": "^4.5.4", "@vue/cli-plugin-unit-jest": "^4.5.4",
"@vue/cli-service": "^4.5.4", "@vue/cli-service": "^4.5.4",
"@vue/test-utils": "^1.0.4", "@vue/test-utils": "^1.0.4",
"autoprefixer": "^9.5.1", "autoprefixer": "^9.5.1",
"babel-cli": "^6.26.0", "babel-cli": "^6.26.0",
"babel-core": "^7.0.0-bridge.0", "babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.1.0", "babel-eslint": "^10.1.0",
"babel-jest": "^26.3.0", "babel-jest": "^26.3.0",
"babel-plugin-syntax-dynamic-import": "^6.18.0", "babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-preset-env": "^1.7.0", "babel-preset-env": "^1.7.0",
"chalk": "^4.1.0", "chalk": "^4.1.0",
"chokidar": "^3.4.2", "chokidar": "^3.4.2",
"connect": "^3.7.0", "connect": "^3.7.0",
"eslint": "^7.7.0", "eslint": "^7.7.0",
"eslint-plugin-vue": "^6.2.2", "eslint-plugin-vue": "^6.2.2",
"html-webpack-plugin": "^4.3.0", "html-webpack-plugin": "^4.3.0",
"husky": "^4.2.5", "husky": "^4.2.5",
"lint-staged": "^10.2.13", "lint-staged": "^10.2.13",
"mockjs": "^1.1.0", "mockjs": "^1.1.0",
"node-sass": "^4.13.1", "node-sass": "^4.13.1",
"plop": "^2.7.4", "plop": "^2.7.4",
"runjs": "^4.3.2", "runjs": "^4.3.2",
"sass-loader": "^10.0.1", "sass-loader": "^10.0.1",
"script-ext-html-webpack-plugin": "^2.1.4", "script-ext-html-webpack-plugin": "^2.1.4",
"script-loader": "0.7.2", "script-loader": "0.7.2",
"serve-static": "^1.13.2", "serve-static": "^1.13.2",
"svg-sprite-loader": "^5.0.0", "svg-sprite-loader": "^5.0.0",
"svgo": "^1.3.2", "svgo": "^1.3.2",
"vue-template-compiler": "^2.6.12" "vue-template-compiler": "^2.6.12"
}, },
"engines": { "engines": {
"node": ">=8.9", "node": ">=8.9",
"npm": ">= 3.0.0" "npm": ">= 3.0.0"
}, },
"browserslist": [ "browserslist": [
"> 1%", "> 1%",
"last 2 versions" "last 2 versions"
] ]
} }

14
plopfile.js

@ -1,7 +1,7 @@
const viewGenerator = require('./plop-templates/view/prompt') const viewGenerator = require('./plop-templates/view/prompt')
const componentGenerator = require('./plop-templates/component/prompt') const componentGenerator = require('./plop-templates/component/prompt')
module.exports = function(plop) { module.exports = function(plop) {
plop.setGenerator('view', viewGenerator) plop.setGenerator('view', viewGenerator)
plop.setGenerator('component', componentGenerator) plop.setGenerator('component', componentGenerator)
} }

10
postcss.config.js

@ -1,5 +1,5 @@
module.exports = { module.exports = {
plugins: { plugins: {
autoprefixer: {} autoprefixer: {}
} }
} }

30
public/index.html

@ -1,15 +1,15 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="renderer" content="webkit"> <meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="<%= BASE_URL %>logo.ico"> <link rel="icon" href="<%= BASE_URL %>logo.ico">
<title>回乡POS平台端</title> <title>回乡POS平台端</title>
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
</body> </body>
</html> </html>

64
src/App.vue

@ -1,32 +1,32 @@
<template> <template>
<div id="app"> <div id="app">
<router-view v-if="isRouterAlive" /> <router-view v-if="isRouterAlive" />
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'App', name: 'App',
provide() { provide() {
return { return {
reload: this.reload, reload: this.reload,
} }
}, },
data() { data() {
return { return {
isRouterAlive: true, isRouterAlive: true,
} }
}, },
methods: { methods: {
reload() { reload() {
this.isRouterAlive = false this.isRouterAlive = false
this.$nextTick(function () { this.$nextTick(function () {
this.isRouterAlive = true this.isRouterAlive = true
}) })
}, },
}, },
created() { created() {
// TODO Token // TODO Token
}, },
} }
</script> </script>

58
src/api/ActivityTweets.js

@ -0,0 +1,58 @@
import axiosApi from './AxiosApi.js'
const apiList = {
page: {
method: 'POST',
url: `/information/list`,
},
update: {
method: 'PUT',
url: `/information`
},
save: {
method: 'POST',
url: `/information`
},
delete: {
method: 'DELETE',
url: `/information`
},
}
export default {
page (data, custom = {}) {
return axiosApi({
...apiList.page,
data,
custom
})
},
// query (data, custom = {}) {
// return axiosApi({
// ...apiList.query,
// data,
// custom
// })
// },
save (data, custom = {}) {
return axiosApi({
...apiList.save,
data,
custom
})
},
update (data, custom = {}) {
return axiosApi({
...apiList.update,
data,
custom
})
},
delete (data, custom = {}) {
return axiosApi({
...apiList.delete,
data,
custom
})
},
}

44
src/api/AfterSale.js

@ -1,22 +1,22 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
getList: `/order/findReturnInterventionList`, getList: `/order/findReturnInterventionList`,
getInfo: `/order/getReturnInterventionDetail` getInfo: `/order/getReturnInterventionDetail`
} }
export default { export default {
// 售后平台介入列表 // 售后平台介入列表
getList(data) { getList(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.getList, url: apiList.getList,
data data
}) })
}, },
getInfo(id) { getInfo(id) {
return axiosApi({ return axiosApi({
method: 'GET', method: 'GET',
url: `${apiList.getInfo}/${id}` url: `${apiList.getInfo}/${id}`
}) })
} }
} }

72
src/api/Applet.js

@ -1,36 +1,36 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
getPlatformTemplate: `/cmsTemplate/getPlatformTemplate`, getPlatformTemplate: `/cmsTemplate/getPlatformTemplate`,
updateTemplate: '/cmsTemplate/updateTemplate', updateTemplate: '/cmsTemplate/updateTemplate',
getCmsTemplate: '/cmsTemplate/', getCmsTemplate: '/cmsTemplate/',
getStorePage: '/store/findStoreListForPlatform' getStorePage: '/store/findStoreListForPlatform'
} }
export default { export default {
getStorePage(data) { getStorePage(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.getStorePage, url: apiList.getStorePage,
data data
}) })
}, },
getCmsTemplate(id) { getCmsTemplate(id) {
return axiosApi({ return axiosApi({
method: 'GET', method: 'GET',
url: apiList.getCmsTemplate + id url: apiList.getCmsTemplate + id
}) })
}, },
getPlatformTemplate() { getPlatformTemplate() {
return axiosApi({ return axiosApi({
method: 'GET', method: 'GET',
url: apiList.getPlatformTemplate url: apiList.getPlatformTemplate
}) })
}, },
updateTemplate(data) { updateTemplate(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.updateTemplate, url: apiList.updateTemplate,
data data
}) })
} }
} }

156
src/api/Application.js

@ -1,78 +1,78 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
page: { page: {
method: 'POST', method: 'POST',
url: `/application/page` url: `/application/page`
}, },
update: { update: {
method: 'PUT', method: 'PUT',
url: `/application` url: `/application`
}, },
save: { save: {
method: 'POST', method: 'POST',
url: `/application` url: `/application`
}, },
delete: { delete: {
method: 'DELETE', method: 'DELETE',
url: `/application` url: `/application`
}, },
preview: { preview: {
method: 'POST', method: 'POST',
url: `/application/preview` url: `/application/preview`
}, },
export: { export: {
method: 'POST', method: 'POST',
url: `/application/export` url: `/application/export`
}, },
import: { import: {
method: 'POST', method: 'POST',
url: `/application/import` url: `/application/import`
} }
} }
export default { export default {
page (data) { page (data) {
return axiosApi({ return axiosApi({
...apiList.page, ...apiList.page,
data data
}) })
}, },
save (data) { save (data) {
return axiosApi({ return axiosApi({
...apiList.save, ...apiList.save,
data data
}) })
}, },
update (data) { update (data) {
return axiosApi({ return axiosApi({
...apiList.update, ...apiList.update,
data data
}) })
}, },
delete (data) { delete (data) {
return axiosApi({ return axiosApi({
...apiList.delete, ...apiList.delete,
data data
}) })
}, },
preview (data) { preview (data) {
return axiosApi({ return axiosApi({
...apiList.preview, ...apiList.preview,
data data
}) })
}, },
export (data) { export (data) {
return axiosApi({ return axiosApi({
...apiList.export, ...apiList.export,
responseType: "blob", responseType: "blob",
data data
}) })
}, },
import (data) { import (data) {
return axiosApi({ return axiosApi({
...apiList.import, ...apiList.import,
data data
}) })
} }
} }

74
src/api/Apply.js

@ -1,37 +1,37 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
getList: `/tenantApply/page`, getList: `/tenantApply/page`,
auditApply: `/tenantApply/audit`, auditApply: `/tenantApply/audit`,
deleteApply: `/tenantApply/remove`, deleteApply: `/tenantApply/remove`,
applyInfo: `/tenantApply` applyInfo: `/tenantApply`
} }
export default { export default {
getList(data) { getList(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.getList, url: apiList.getList,
data data
}) })
}, },
auditApply(data) { auditApply(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.auditApply, url: apiList.auditApply,
data data
}) })
}, },
deleteApply(data) { deleteApply(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.deleteApply, url: apiList.deleteApply,
data data
}) })
}, },
applyInfo(id) { applyInfo(id) {
return axiosApi({ return axiosApi({
method: 'GET', method: 'GET',
url: `${apiList.applyInfo}/${id}` url: `${apiList.applyInfo}/${id}`
}) })
} }
} }

148
src/api/Area.js

@ -1,74 +1,74 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
page: { page: {
method: 'POST', method: 'POST',
url: `/area/page` url: `/area/page`
}, },
update: { update: {
method: 'PUT', method: 'PUT',
url: `/area` url: `/area`
}, },
save: { save: {
method: 'POST', method: 'POST',
url: `/area` url: `/area`
}, },
delete: { delete: {
method: 'DELETE', method: 'DELETE',
url: `/area` url: `/area`
}, },
query: { query: {
method: 'POST', method: 'POST',
url: `/area/query` url: `/area/query`
}, },
tree: { tree: {
method: 'GET', method: 'GET',
url: `/area/tree` url: `/area/tree`
} }
} }
export default { export default {
page(data) { page(data) {
return axiosApi({ return axiosApi({
...apiList.page, ...apiList.page,
data data
}) })
}, },
tree(data) { tree(data) {
return axiosApi({ return axiosApi({
...apiList.tree, ...apiList.tree,
data data
}) })
}, },
query(data) { query(data) {
return axiosApi({ return axiosApi({
...apiList.query, ...apiList.query,
data data
}) })
}, },
save(data) { save(data) {
return axiosApi({ return axiosApi({
...apiList.save, ...apiList.save,
data data
}) })
}, },
update(data) { update(data) {
return axiosApi({ return axiosApi({
...apiList.update, ...apiList.update,
data data
}) })
}, },
delete(data) { delete(data) {
return axiosApi({ return axiosApi({
...apiList.delete, ...apiList.delete,
data data
}) })
}, },
check(code, id) { check(code, id) {
return axiosApi({ return axiosApi({
method: 'GET', method: 'GET',
url: `/area/check/` + code, url: `/area/check/` + code,
data: { id: id } data: { id: id }
}) })
} }
} }

136
src/api/Attachment.js

@ -1,68 +1,68 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
page: { page: {
method: 'POST', method: 'POST',
url: `/attachment/page` url: `/attachment/page`
}, },
upload: { upload: {
method: 'POST', method: 'POST',
url: `/attachment/upload` url: `/attachment/upload`
}, },
download: { download: {
method: 'GET', method: 'GET',
url: `/attachment/download` url: `/attachment/download`
}, },
downloadBiz: { downloadBiz: {
method: 'GET', method: 'GET',
url: `/attachment/download/biz` url: `/attachment/download/biz`
}, },
downloadUrl: { downloadUrl: {
method: 'GET', method: 'GET',
url: `/attachment/download/url` url: `/attachment/download/url`
}, },
delete: { delete: {
method: 'DELETE', method: 'DELETE',
url: `/attachment` url: `/attachment`
} }
} }
export default { export default {
page (data) { page (data) {
return axiosApi({ return axiosApi({
...apiList.page, ...apiList.page,
data data
}) })
}, },
upload (data) { upload (data) {
return axiosApi({ return axiosApi({
...apiList.upload, ...apiList.upload,
data data
}) })
}, },
download (data) { download (data) {
return axiosApi({ return axiosApi({
...apiList.download, ...apiList.download,
responseType: "blob", responseType: "blob",
data data
}) })
}, },
downloadBiz (data) { downloadBiz (data) {
return axiosApi({ return axiosApi({
...apiList.downloadBiz, ...apiList.downloadBiz,
data data
}) })
}, },
downloadUrl (data) { downloadUrl (data) {
return axiosApi({ return axiosApi({
...apiList.downloadUrl, ...apiList.downloadUrl,
data data
}) })
}, },
delete (data) { delete (data) {
return axiosApi({ return axiosApi({
...apiList.delete, ...apiList.delete,
data data
}) })
} }
} }

274
src/api/AxiosApi.js

@ -1,137 +1,137 @@
import axios from 'axios' import axios from 'axios'
import { Message, MessageBox } from 'element-ui' import { Message, MessageBox } from 'element-ui'
import db from '@/utils/localstorage' import db from '@/utils/localstorage'
import { Base64 } from 'js-base64' import { Base64 } from 'js-base64'
// 请求添加条件,如token // 请求添加条件,如token
axios.interceptors.request.use( axios.interceptors.request.use(
config => { config => {
const isToken = const isToken =
config.headers['X-isToken'] === false ? config.headers['X-isToken'] : true config.headers['X-isToken'] === false ? config.headers['X-isToken'] : true
const token = db.get('TOKEN', '') const token = db.get('TOKEN', '')
if (token && isToken) { if (token && isToken) {
config.headers.token = 'Bearer ' + token config.headers.token = 'Bearer ' + token
} }
// config.headers.tenant = 1166; // config.headers.tenant = 1166;
// config.headers.tenant = db.get('TENANT', '') // config.headers.tenant = db.get('TENANT', '')
const clientId = process.env.VUE_APP_CLIENT_ID const clientId = process.env.VUE_APP_CLIENT_ID
const clientSecret = process.env.VUE_APP_CLIENT_SECRET const clientSecret = process.env.VUE_APP_CLIENT_SECRET
config.headers['Authorization'] = `Basic ${Base64.encode( config.headers['Authorization'] = `Basic ${Base64.encode(
`${clientId}:${clientSecret}` `${clientId}:${clientSecret}`
)}` )}`
return config return config
}, },
error => { error => {
return Promise.reject(error) return Promise.reject(error)
} }
) )
// 接口返回处理 // 接口返回处理
axios.interceptors.response.use( axios.interceptors.response.use(
response => { response => {
return response return response
}, },
error => { error => {
return Promise.reject(error) return Promise.reject(error)
} }
) )
function handleError(error, reject) { function handleError(error, reject) {
if (error.code === 'ECONNABORTED') { if (error.code === 'ECONNABORTED') {
Message({ Message({
message: '请求超时' message: '请求超时'
}) })
} else if (error.response && error.response.data) { } else if (error.response && error.response.data) {
Message({ Message({
message: error.response.data message: error.response.data
}) })
} else if (error.message) { } else if (error.message) {
Message({ Message({
message: error.message message: error.message
}) })
} }
reject(error) reject(error)
} }
function handleSuccess(res, resolve) { function handleSuccess(res, resolve) {
if (res.data.isError) { if (res.data.isError) {
// 未登录 // 未登录
if ( if (
res.data.code === 40000 || res.data.code === 40000 ||
res.data.code === 40001 || res.data.code === 40001 ||
res.data.code === 40002 || res.data.code === 40002 ||
res.data.code === 40003 || res.data.code === 40003 ||
res.data.code === 40005 || res.data.code === 40005 ||
res.data.code === 40006 || res.data.code === 40006 ||
res.data.code === 40008 res.data.code === 40008
) { ) {
MessageBox.alert(res.data.msg, '提醒', { MessageBox.alert(res.data.msg, '提醒', {
confirmButtonText: '确定', confirmButtonText: '确定',
callback: () => { callback: () => {
window.location.hash = '/login' window.location.hash = '/login'
} }
}) })
} else { } else {
Message.error(res.data.msg) Message.error(res.data.msg)
} }
} }
resolve(res) resolve(res)
} }
// http请求 // http请求
const httpServer = opts => { const httpServer = opts => {
// 公共参数 console.log(opts,"opts")
const publicParams = { // 公共参数
ts: Date.now() const publicParams = {
} ts: Date.now()
}
// http默认配置
const method = opts.method.toUpperCase() // http默认配置
// baseURL const method = opts.method.toUpperCase()
// 开发环境: /api // 开发环境在 vue.config.js 中有 devServer.proxy 代理 // baseURL
// 生产环境: http://IP:PORT/api // 生产环境中 代理失效, 故需要配置绝对路径 // 开发环境: /api // 开发环境在 vue.config.js 中有 devServer.proxy 代理
const httpDefaultOpts = { // 生产环境: http://IP:PORT/api // 生产环境中 代理失效, 故需要配置绝对路径
method, const httpDefaultOpts = {
url: `${process.env.VUE_APP_DEV_REQUEST_DOMAIN_PREFIX}${opts.url}`, method,
responseType: opts.responseType || '', url: `${process.env.VUE_APP_DEV_REQUEST_DOMAIN_PREFIX}${opts.url}`,
timeout: 20000 responseType: opts.responseType || '',
} timeout: 20000
const dataRequest = ['PUT', 'POST', 'PATCH'] }
if (dataRequest.includes(method)) { const dataRequest = ['PUT', 'POST', 'PATCH']
httpDefaultOpts.data = opts.data || {} if (dataRequest.includes(method)) {
} else { httpDefaultOpts.data = opts.data || {}
httpDefaultOpts.params = { } else {
...publicParams, httpDefaultOpts.params = {
...(opts.data || {}) ...publicParams,
} ...(opts.data || {})
} }
}
// formData转换
if (opts.formData) { // formData转换
httpDefaultOpts.transformRequest = [ if (opts.formData) {
data => { httpDefaultOpts.transformRequest = [
const formData = new FormData() data => {
if (data) { const formData = new FormData()
Object.entries(data).forEach(item => { if (data) {
formData.append(item[0], item[1]) Object.entries(data).forEach(item => {
}) formData.append(item[0], item[1])
} })
return formData }
} return formData
] }
} ]
}
const promise = new Promise((resolve, reject) => {
axios(httpDefaultOpts) const promise = new Promise((resolve, reject) => {
.then(response => { axios(httpDefaultOpts)
handleSuccess(response, resolve) .then(response => {
}) handleSuccess(response, resolve)
.catch(error => { })
handleError(error, reject) .catch(error => {
}) handleError(error, reject)
}) })
return promise })
} return promise
}
export default httpServer export default httpServer

96
src/api/Brand.js

@ -0,0 +1,96 @@
import axiosApi from './AxiosApi.js'
const apiList = {
page: {
method: 'POST',
url: `/brand/page`,
},
query: {
method: 'POST',
url: `/brand/query`,
},
update: {
method: 'PUT',
url: `/brand`
},
save: {
method: 'POST',
url: `/brand`
},
delete: {
method: 'DELETE',
url: `/brand`
},
export: {
method: 'POST',
url: `/brand/export`
},
preview: {
method: 'POST',
url: `/brand/preview`
},
import: {
method: 'POST',
url: `/brand/import`
}
}
export default {
page (data, custom = {}) {
return axiosApi({
...apiList.page,
data,
custom
})
},
query (data, custom = {}) {
return axiosApi({
...apiList.query,
data,
custom
})
},
save (data, custom = {}) {
return axiosApi({
...apiList.save,
data,
custom
})
},
update (data, custom = {}) {
return axiosApi({
...apiList.update,
data,
custom
})
},
delete (data, custom = {}) {
return axiosApi({
...apiList.delete,
data,
custom
})
},
export (data, custom = {}) {
return axiosApi({
...apiList.export,
responseType: "blob",
data,
custom
})
},
preview (data, custom = {}) {
return axiosApi({
...apiList.preview,
data,
custom
})
},
import (data, custom = {}) {
return axiosApi({
...apiList.import,
data,
custom
})
}
}

108
src/api/Classification.js

@ -1,54 +1,54 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
productCategory: `/productCategory/findPageCategory`, productCategory: `/productCategory/findPageCategory`,
addCategory: `/productCategory/addCategory`, addCategory: `/productCategory/addCategory`,
uploadCategory: `/productCategory/updateCategory`, uploadCategory: `/productCategory/updateCategory`,
deletCategory: '/productCategory/delCategory', deletCategory: '/productCategory/delCategory',
queryOneCategory: `/productCategory/queryOneCategory`, queryOneCategory: `/productCategory/queryOneCategory`,
queryChildCategory: '/productCategory/queryChildCategory' queryChildCategory: '/productCategory/queryChildCategory'
} }
export default { export default {
deletCategory(data) { deletCategory(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.deletCategory, url: apiList.deletCategory,
data data
}) })
}, },
queryChildCategory(data) { queryChildCategory(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.queryChildCategory, url: apiList.queryChildCategory,
data data
}) })
}, },
queryOneCategory(data) { queryOneCategory(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.queryOneCategory, url: apiList.queryOneCategory,
data data
}) })
}, },
getProductCategory(data) { getProductCategory(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.productCategory, url: apiList.productCategory,
data data
}) })
}, },
addCategory(data) { addCategory(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.addCategory, url: apiList.addCategory,
data data
}) })
}, },
uploadCategory(data) { uploadCategory(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.uploadCategory, url: apiList.uploadCategory,
data data
}) })
} }
} }

232
src/api/Comment.js

@ -1,116 +1,116 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
getList: `/comment/findCommentList`, getList: `/comment/findCommentList`,
handleComment: `/comment/handleComment`, handleComment: `/comment/handleComment`,
getSensitiveKeywordList: `/comment/findSensitiveKeywordList`, getSensitiveKeywordList: `/comment/findSensitiveKeywordList`,
setSensitiveKeyword: `/comment/updateSensitiveKeywordSetting`, setSensitiveKeyword: `/comment/updateSensitiveKeywordSetting`,
addSensitiveKeyword: `/comment/addSensitiveKeyword`, addSensitiveKeyword: `/comment/addSensitiveKeyword`,
editSensitiveKeyword: `/comment/updateSensitiveKeyword`, editSensitiveKeyword: `/comment/updateSensitiveKeyword`,
deleteSensitiveKeyword: `/comment/deleteSensitiveKeyword`, deleteSensitiveKeyword: `/comment/deleteSensitiveKeyword`,
getCommentKeywordList: `/comment/findCommentKeywordList`, getCommentKeywordList: `/comment/findCommentKeywordList`,
setCommentKeywordList: `/comment/updateCommentKeywordSetting`, setCommentKeywordList: `/comment/updateCommentKeywordSetting`,
addCommentKeyword: `/comment/addCommentKeyword`, addCommentKeyword: `/comment/addCommentKeyword`,
editCommentKeyword: `/comment/updateCommentKeyword`, editCommentKeyword: `/comment/updateCommentKeyword`,
deleteCommentKeyword: `/comment/deleteCommentKeyword` deleteCommentKeyword: `/comment/deleteCommentKeyword`
} }
export default { export default {
// 敏感词列表 // 敏感词列表
getList(data) { getList(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.getList, url: apiList.getList,
data data
}) })
}, },
// 操作评论 // 操作评论
handleComment(data) { handleComment(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.handleComment, url: apiList.handleComment,
data data
}) })
}, },
// 查询敏感词列表 // 查询敏感词列表
getSensitiveKeywordList(data) { getSensitiveKeywordList(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.getSensitiveKeywordList, url: apiList.getSensitiveKeywordList,
data data
}) })
}, },
// 敏感词配置 // 敏感词配置
setSensitiveKeyword(data) { setSensitiveKeyword(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.setSensitiveKeyword, url: apiList.setSensitiveKeyword,
data data
}) })
}, },
// 新增敏感词 // 新增敏感词
addSensitiveKeyword(data) { addSensitiveKeyword(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.addSensitiveKeyword, url: apiList.addSensitiveKeyword,
data data
}) })
}, },
// 修改敏感词 // 修改敏感词
editSensitiveKeyword(data) { editSensitiveKeyword(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.editSensitiveKeyword, url: apiList.editSensitiveKeyword,
data data
}) })
}, },
// 删除敏感词 // 删除敏感词
deleteSensitiveKeyword(data) { deleteSensitiveKeyword(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.deleteSensitiveKeyword, url: apiList.deleteSensitiveKeyword,
data data
}) })
}, },
// 查询关键词列表 // 查询关键词列表
getCommentKeywordList(data) { getCommentKeywordList(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.getCommentKeywordList, url: apiList.getCommentKeywordList,
data data
}) })
}, },
// 关键词配置 // 关键词配置
setCommentKeywordList(data) { setCommentKeywordList(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.setCommentKeywordList, url: apiList.setCommentKeywordList,
data data
}) })
}, },
// 新增关键词 // 新增关键词
addCommentKeyword(data) { addCommentKeyword(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.addCommentKeyword, url: apiList.addCommentKeyword,
data data
}) })
}, },
// 修改关键词 // 修改关键词
editCommentKeyword(data) { editCommentKeyword(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.editCommentKeyword, url: apiList.editCommentKeyword,
data data
}) })
}, },
// 删除关键词 // 删除关键词
deleteCommentKeyword(data) { deleteCommentKeyword(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.deleteCommentKeyword, url: apiList.deleteCommentKeyword,
data data
}) })
} }
} }

38
src/api/Common.js

@ -1,19 +1,19 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
// 获取当前系统的所有枚举 // 获取当前系统的所有枚举
enums: { enums: {
method: 'GET', method: 'GET',
url: `/enums` url: `/enums`
} }
} }
export default { export default {
uploadFile: `${process.env.VUE_APP_DEV_REQUEST_DOMAIN_PREFIX}/attachment/upload`, uploadFile: `${process.env.VUE_APP_DEV_REQUEST_DOMAIN_PREFIX}/attachment/upload`,
enums (data) { enums (data) {
return axiosApi({ return axiosApi({
...apiList.enums, ...apiList.enums,
data data
}) })
} }
} }

74
src/api/Custom.js

@ -1,37 +1,37 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
cmsTemplatePage: `/cmsTemplate/page`, cmsTemplatePage: `/cmsTemplate/page`,
addTemplate: '/cmsTemplate', addTemplate: '/cmsTemplate',
deleteTemplate: '/cmsTemplate' deleteTemplate: '/cmsTemplate'
} }
export default { export default {
cmsTemplatePage(data) { cmsTemplatePage(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.cmsTemplatePage, url: apiList.cmsTemplatePage,
data data
}) })
}, },
addTemplate(data) { addTemplate(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.addTemplate, url: apiList.addTemplate,
data data
}) })
}, },
deleteTemplate(data) { deleteTemplate(data) {
return axiosApi({ return axiosApi({
method: 'DELETE', method: 'DELETE',
url: apiList.deleteTemplate, url: apiList.deleteTemplate,
data data
}) })
}, },
updateTemplate(data) { updateTemplate(data) {
return axiosApi({ return axiosApi({
method: 'PUT', method: 'PUT',
url: apiList.deleteTemplate, url: apiList.deleteTemplate,
data data
}) })
} }
} }

30
src/api/Dashboard.js

@ -1,15 +1,15 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
getVisitList: `/dashboard/visit` getVisitList: `/dashboard/visit`
} }
export default { export default {
getVisitList (data) { getVisitList (data) {
return axiosApi({ return axiosApi({
method: 'GET', method: 'GET',
url: apiList.getVisitList, url: apiList.getVisitList,
data data
}) })
} }
} }

94
src/api/Dictionary.js

@ -1,47 +1,47 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
page: { page: {
method: 'POST', method: 'POST',
url: `/dictionary/page` url: `/dictionary/page`
}, },
update: { update: {
method: 'PUT', method: 'PUT',
url: `/dictionary` url: `/dictionary`
}, },
save: { save: {
method: 'POST', method: 'POST',
url: `/dictionary` url: `/dictionary`
}, },
delete: { delete: {
method: 'DELETE', method: 'DELETE',
url: `/dictionary` url: `/dictionary`
} }
} }
export default { export default {
page (data) { page (data) {
return axiosApi({ return axiosApi({
...apiList.page, ...apiList.page,
data data
}) })
}, },
save (data) { save (data) {
return axiosApi({ return axiosApi({
...apiList.save, ...apiList.save,
data data
}) })
}, },
update (data) { update (data) {
return axiosApi({ return axiosApi({
...apiList.update, ...apiList.update,
data data
}) })
}, },
delete (data) { delete (data) {
return axiosApi({ return axiosApi({
...apiList.delete, ...apiList.delete,
data data
}) })
} }
} }

176
src/api/DictionaryItem.js

@ -1,88 +1,88 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
page: { page: {
method: 'POST', method: 'POST',
url: `/dictionaryItem/page` url: `/dictionaryItem/page`
}, },
update: { update: {
method: 'PUT', method: 'PUT',
url: `/dictionaryItem` url: `/dictionaryItem`
}, },
save: { save: {
method: 'POST', method: 'POST',
url: `/dictionaryItem` url: `/dictionaryItem`
}, },
delete: { delete: {
method: 'DELETE', method: 'DELETE',
url: `/dictionaryItem` url: `/dictionaryItem`
}, },
list: { list: {
method: 'GET', method: 'GET',
url: `/dictionaryItem/codes` url: `/dictionaryItem/codes`
}, },
preview: { preview: {
method: 'POST', method: 'POST',
url: `/dictionaryItem/preview` url: `/dictionaryItem/preview`
}, },
export: { export: {
method: 'POST', method: 'POST',
url: `/dictionaryItem/export` url: `/dictionaryItem/export`
}, },
import: { import: {
method: 'POST', method: 'POST',
url: `/dictionaryItem/import` url: `/dictionaryItem/import`
} }
} }
export default { export default {
page (data) { page (data) {
return axiosApi({ return axiosApi({
...apiList.page, ...apiList.page,
data data
}) })
}, },
save (data) { save (data) {
return axiosApi({ return axiosApi({
...apiList.save, ...apiList.save,
data data
}) })
}, },
update (data) { update (data) {
return axiosApi({ return axiosApi({
...apiList.update, ...apiList.update,
data data
}) })
}, },
delete (data) { delete (data) {
return axiosApi({ return axiosApi({
...apiList.delete, ...apiList.delete,
data data
}) })
}, },
list (data) { list (data) {
return axiosApi({ return axiosApi({
...apiList.list, ...apiList.list,
data data
}) })
}, },
preview (data) { preview (data) {
return axiosApi({ return axiosApi({
...apiList.preview, ...apiList.preview,
data data
}) })
}, },
export (data) { export (data) {
return axiosApi({ return axiosApi({
...apiList.export, ...apiList.export,
responseType: "blob", responseType: "blob",
data data
}) })
}, },
import (data) { import (data) {
return axiosApi({ return axiosApi({
...apiList.import, ...apiList.import,
data data
}) })
} }
} }

132
src/api/Finance.js

@ -1,66 +1,66 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
getCashList: `/cashOutDetail/page/audit`, getCashList: `/cashOutDetail/page/audit`,
getDetail: '/cashOutDetail/audit/', getDetail: '/cashOutDetail/audit/',
audiCash: '/cashOutDetail/audit', audiCash: '/cashOutDetail/audit',
getDepositList: `/depositJournal/page`, // 保证金列表 getDepositList: `/depositJournal/page`, // 保证金列表
getDepositSum: `/depositJournal/summary`, // 保证金总金额 getDepositSum: `/depositJournal/summary`, // 保证金总金额
getDayList: `/journalDetail/platform-finance-page`, getDayList: `/journalDetail/platform-finance-page`,
getSummary: `/journalDetail/platform-finance-summary` getSummary: `/journalDetail/platform-finance-summary`
} }
export default { export default {
// 提现审核列表 // 提现审核列表
getCashList(data) { getCashList(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.getCashList, url: apiList.getCashList,
data data
}) })
}, },
// 查询提现审核 // 查询提现审核
getDetail(id) { getDetail(id) {
return axiosApi({ return axiosApi({
method: 'GET', method: 'GET',
url: apiList.getDetail + id url: apiList.getDetail + id
}) })
}, },
// 提现审核 // 提现审核
audiCash(data) { audiCash(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.audiCash, url: apiList.audiCash,
data data
}) })
}, },
// 保证金列表 // 保证金列表
getDepositList(data) { getDepositList(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.getDepositList, url: apiList.getDepositList,
data data
}) })
}, },
// 保证金总金额 // 保证金总金额
getDepositSum() { getDepositSum() {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.getDepositSum url: apiList.getDepositSum
}) })
}, },
// 平台流水列表 // 平台流水列表
getDayList(data) { getDayList(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.getDayList, url: apiList.getDayList,
data data
}) })
}, },
// 平台财务统计 // 平台财务统计
getSummary() { getSummary() {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.getSummary url: apiList.getSummary
}) })
} }
} }

178
src/api/GlobalUser.js

@ -1,89 +1,89 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
page: { page: {
url: `/globalUser/page`, url: `/globalUser/page`,
method: 'POST' method: 'POST'
}, },
save: { save: {
method: 'POST', method: 'POST',
url: `/globalUser` url: `/globalUser`
}, },
update: { update: {
method: 'PUT', method: 'PUT',
url: `/globalUser` url: `/globalUser`
}, },
remove: { remove: {
method: 'DELETE', method: 'DELETE',
url: `/globalUser/delete` url: `/globalUser/delete`
}, },
check: { check: {
method: 'GET', method: 'GET',
url: `/globalUser/check` url: `/globalUser/check`
}, },
preview: { preview: {
method: 'POST', method: 'POST',
url: `/globalUser/preview` url: `/globalUser/preview`
}, },
export: { export: {
method: 'POST', method: 'POST',
url: `/globalUser/export` url: `/globalUser/export`
}, },
import: { import: {
method: 'POST', method: 'POST',
url: `/globalUser/import` url: `/globalUser/import`
} }
} }
export default { export default {
page (data) { page (data) {
return axiosApi({ return axiosApi({
...apiList.page, ...apiList.page,
data data
}) })
}, },
save (data) { save (data) {
return axiosApi({ return axiosApi({
...apiList.save, ...apiList.save,
data: data || {} data: data || {}
}) })
}, },
update (data) { update (data) {
return axiosApi({ return axiosApi({
...apiList.update, ...apiList.update,
data: data || {} data: data || {}
}) })
}, },
remove (data) { remove (data) {
return axiosApi({ return axiosApi({
...apiList.remove, ...apiList.remove,
data: data || {} data: data || {}
}) })
}, },
check (data) { check (data) {
return axiosApi({ return axiosApi({
...apiList.check, ...apiList.check,
formData: true, formData: true,
data: data || {} data: data || {}
}) })
}, },
preview (data) { preview (data) {
return axiosApi({ return axiosApi({
...apiList.preview, ...apiList.preview,
data data
}) })
}, },
export (data) { export (data) {
return axiosApi({ return axiosApi({
...apiList.export, ...apiList.export,
responseType: "blob", responseType: "blob",
data data
}) })
}, },
import (data) { import (data) {
return axiosApi({ return axiosApi({
...apiList.import, ...apiList.import,
data data
}) })
} }
} }

168
src/api/Goods.js

@ -1,84 +1,84 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
getGroupList: `/productGroup/page`, getGroupList: `/productGroup/page`,
productGroup: `/productGroup`, productGroup: `/productGroup`,
deleteGroup: `/productGroup/delProductCategory`, deleteGroup: `/productGroup/delProductCategory`,
getProductList: `/product/findAdminProductList`, getProductList: `/product/findAdminProductList`,
findCategoryList: '/productCategory/findCategoryListByDepth/', findCategoryList: '/productCategory/findCategoryListByDepth/',
saveProduct: '/product/save', saveProduct: '/product/save',
findAdminProductList: '/platformProduct/findAdminProductList', findAdminProductList: '/platformProduct/findAdminProductList',
findGoods: '/platformProduct/findProductListByCategoryOrProductIdList', findGoods: '/platformProduct/findProductListByCategoryOrProductIdList',
queryAllCategory: '/productCategory/queryAllCategory' queryAllCategory: '/productCategory/queryAllCategory'
} }
export default { export default {
queryAllCategory() { queryAllCategory() {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.queryAllCategory url: apiList.queryAllCategory
}) })
}, },
findGoods(data) { findGoods(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.findGoods, url: apiList.findGoods,
data data
}) })
}, },
findAdminProductList(data) { findAdminProductList(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.findAdminProductList, url: apiList.findAdminProductList,
data data
}) })
}, },
saveProduct(data) { saveProduct(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.saveProduct, url: apiList.saveProduct,
data data
}) })
}, },
findCategoryList(depth) { findCategoryList(depth) {
return axiosApi({ return axiosApi({
method: 'GET', method: 'GET',
url: apiList.findCategoryList + depth url: apiList.findCategoryList + depth
}) })
}, },
getProductList(data) { getProductList(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.getProductList, url: apiList.getProductList,
data data
}) })
}, },
getGroupList(data) { getGroupList(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.getGroupList, url: apiList.getGroupList,
data data
}) })
}, },
addGroup(data) { addGroup(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.productGroup, url: apiList.productGroup,
data data
}) })
}, },
eidtGroup(data) { eidtGroup(data) {
return axiosApi({ return axiosApi({
method: 'PUT', method: 'PUT',
url: apiList.productGroup, url: apiList.productGroup,
data data
}) })
}, },
deleteGroup(data) { deleteGroup(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.deleteGroup, url: apiList.deleteGroup,
data data
}) })
} }
} }

192
src/api/InformationApi.js

@ -1,96 +1,96 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
page: { page: {
method: 'POST', method: 'POST',
url: `/store/information/page`, url: `/store/information/page`,
}, },
query: { query: {
method: 'POST', method: 'POST',
url: `/store/information/query`, url: `/store/information/query`,
}, },
update: { update: {
method: 'PUT', method: 'PUT',
url: `/store/information` url: `/store/information`
}, },
save: { save: {
method: 'POST', method: 'POST',
url: `/store/information` url: `/store/information`
}, },
delete: { delete: {
method: 'DELETE', method: 'DELETE',
url: `/store/information` url: `/store/information`
}, },
export: { export: {
method: 'POST', method: 'POST',
url: `/store/information/export` url: `/store/information/export`
}, },
preview: { preview: {
method: 'POST', method: 'POST',
url: `/store/information/preview` url: `/store/information/preview`
}, },
import: { import: {
method: 'POST', method: 'POST',
url: `/store/information/import` url: `/store/information/import`
} }
} }
export default { export default {
page (data, custom = {}) { page (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.page, ...apiList.page,
data, data,
custom custom
}) })
}, },
query (data, custom = {}) { query (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.query, ...apiList.query,
data, data,
custom custom
}) })
}, },
save (data, custom = {}) { save (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.save, ...apiList.save,
data, data,
custom custom
}) })
}, },
update (data, custom = {}) { update (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.update, ...apiList.update,
data, data,
custom custom
}) })
}, },
delete (data, custom = {}) { delete (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.delete, ...apiList.delete,
data, data,
custom custom
}) })
}, },
export (data, custom = {}) { export (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.export, ...apiList.export,
responseType: "blob", responseType: "blob",
data, data,
custom custom
}) })
}, },
preview (data, custom = {}) { preview (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.preview, ...apiList.preview,
data, data,
custom custom
}) })
}, },
import (data, custom = {}) { import (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.import, ...apiList.import,
data, data,
custom custom
}) })
} }
} }

134
src/api/Label.js

@ -1,67 +1,67 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
getLabelList: `/memberTag/page`, getLabelList: `/memberTag/page`,
addLabel: `/memberTag`, addLabel: `/memberTag`,
queryTag: `/memberTag/queryTag/`, queryTag: `/memberTag/queryTag/`,
deleteTag: `/memberTag`, deleteTag: `/memberTag`,
editTag: `/memberTag`, editTag: `/memberTag`,
exportTag: `/memberTag/export`, exportTag: `/memberTag/export`,
getTagInfo: `/memberTag/` getTagInfo: `/memberTag/`
} }
export default { export default {
// 标签列表 // 标签列表
getLabelList(data) { getLabelList(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.getLabelList, url: apiList.getLabelList,
data data
}) })
}, },
// 新建标签 // 新建标签
addLabel(data) { addLabel(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.addLabel, url: apiList.addLabel,
data data
}) })
}, },
// 查询客户标签 // 查询客户标签
queryTag(id) { queryTag(id) {
return axiosApi({ return axiosApi({
method: 'GET', method: 'GET',
url: `${apiList.queryTag}${id}` url: `${apiList.queryTag}${id}`
}) })
}, },
// 删除标签 // 删除标签
deleteTag(data) { deleteTag(data) {
return axiosApi({ return axiosApi({
method: 'DELETE', method: 'DELETE',
url: apiList.deleteTag, url: apiList.deleteTag,
data data
}) })
}, },
// 修改标签 // 修改标签
editTag(data) { editTag(data) {
return axiosApi({ return axiosApi({
method: 'PUT', method: 'PUT',
url: apiList.editTag, url: apiList.editTag,
data data
}) })
}, },
// 导出标签 // 导出标签
exportTag(data) { exportTag(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.exportTag, url: apiList.exportTag,
data data
}) })
}, },
// 查询标签详情 // 查询标签详情
getTagInfo(id) { getTagInfo(id) {
return axiosApi({ return axiosApi({
method: 'GET', method: 'GET',
url: `${apiList.getTagInfo}${id}` url: `${apiList.getTagInfo}${id}`
}) })
} }
} }

68
src/api/Login.js

@ -1,34 +1,34 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
captcha: `/anno/captcha`, captcha: `/anno/captcha`,
login: `/anno/admin/login`, login: `/anno/admin/login`,
router: `/menu/admin/router` router: `/menu/admin/router`
} }
export default { export default {
getCaptcha (randomId) { getCaptcha (randomId) {
return axiosApi({ return axiosApi({
method: 'GET', method: 'GET',
url: apiList.captcha + `?key=${randomId}`, url: apiList.captcha + `?key=${randomId}`,
responseType: 'arraybuffer', responseType: 'arraybuffer',
meta: { meta: {
"X-isToken": false "X-isToken": false
} }
}) })
}, },
login (data) { login (data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.login, url: apiList.login,
data data
}) })
}, },
getRouter (data) { getRouter (data) {
return axiosApi({ return axiosApi({
method: 'GET', method: 'GET',
url: apiList.router, url: apiList.router,
data: data || {} data: data || {}
}) })
} }
} }

116
src/api/LoginLog.js

@ -1,58 +1,58 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
page: { page: {
method: 'POST', method: 'POST',
url: `/loginLog/page` url: `/loginLog/page`
}, },
delete: { delete: {
method: 'DELETE', method: 'DELETE',
url: `/loginLog` url: `/loginLog`
}, },
clear: { clear: {
method: 'DELETE', method: 'DELETE',
url: `/loginLog/clear` url: `/loginLog/clear`
}, },
preview: { preview: {
method: 'POST', method: 'POST',
url: `/loginLog/preview` url: `/loginLog/preview`
}, },
export: { export: {
method: 'POST', method: 'POST',
url: `/loginLog/export` url: `/loginLog/export`
} }
} }
export default { export default {
page(data) { page(data) {
return axiosApi({ return axiosApi({
...apiList.page, ...apiList.page,
data data
}) })
}, },
delete(data) { delete(data) {
return axiosApi({ return axiosApi({
...apiList.delete, ...apiList.delete,
data data
}) })
}, },
clear(data) { clear(data) {
return axiosApi({ return axiosApi({
...apiList.clear, ...apiList.clear,
data data
}) })
}, },
preview(data) { preview(data) {
return axiosApi({ return axiosApi({
...apiList.preview, ...apiList.preview,
data data
}) })
}, },
export(data) { export(data) {
return axiosApi({ return axiosApi({
...apiList.export, ...apiList.export,
responseType: "blob", responseType: "blob",
data data
}) })
} }
} }

72
src/api/Management.js

@ -1,36 +1,36 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
getTenants: `/tenant/page`, getTenants: `/tenant/page`,
addTenant: `/tenant`, addTenant: `/tenant`,
editTenant: `/tenant` editTenant: `/tenant`
} }
export default { export default {
getAllTenant(data) { getAllTenant(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.getTenants, url: apiList.getTenants,
data data
}) })
}, },
addTenant(data) { addTenant(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.addTenant, url: apiList.addTenant,
data data
}) })
}, },
editTenant(data) { editTenant(data) {
return axiosApi({ return axiosApi({
method: 'PUT', method: 'PUT',
url: apiList.editTenant, url: apiList.editTenant,
data data
}) })
}, },
fixRole(tenantCode) { fixRole(tenantCode) {
return axiosApi({ return axiosApi({
method: 'GET', method: 'GET',
url: `/resource/fixRole/${tenantCode}` url: `/resource/fixRole/${tenantCode}`
}) })
} }
} }

230
src/api/Marketing.js

@ -1,115 +1,115 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
addPromotion: `/promotion/addPromotion`, addPromotion: `/promotion/addPromotion`,
getList: `/promotion/findAdminPromotionList`, getList: `/promotion/findAdminPromotionList`,
getDetails: `/promotion/query`, getDetails: `/promotion/query`,
delPromotion: `/promotion/delete`, delPromotion: `/promotion/delete`,
updatePromotion: `/promotion/updatePromotion`, updatePromotion: `/promotion/updatePromotion`,
finishPromotion: `/promotion/end`, finishPromotion: `/promotion/end`,
applyShop: `/promotionApplyInfo/page`, // 参入店铺 applyShop: `/promotionApplyInfo/page`, // 参入店铺
auditLog: `/promotionAuditLog/query`, auditLog: `/promotionAuditLog/query`,
getGoodList: `/product/findAdminProductListByIds`, getGoodList: `/product/findAdminProductListByIds`,
auditPromotion: `/promotionApplyInfo/auditPromotion`, auditPromotion: `/promotionApplyInfo/auditPromotion`,
closeApplyInfo: `/promotionApplyInfo/closeApplyInfo`, closeApplyInfo: `/promotionApplyInfo/closeApplyInfo`,
getDetail: `/promotionStat/detail`, getDetail: `/promotionStat/detail`,
findTenantStatDetail: `/promotionStat/findTenantStatDetail` findTenantStatDetail: `/promotionStat/findTenantStatDetail`
} }
export default { export default {
addPromotion(data) { addPromotion(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.addPromotion, url: apiList.addPromotion,
data data
}) })
}, },
getList(data) { getList(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.getList, url: apiList.getList,
data data
}) })
}, },
getDetails(id) { getDetails(id) {
return axiosApi({ return axiosApi({
method: 'GET', method: 'GET',
url: `${apiList.getDetails}/${id}` url: `${apiList.getDetails}/${id}`
}) })
}, },
delPromotion(data) { delPromotion(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.delPromotion, url: apiList.delPromotion,
data data
}) })
}, },
updatePromotion(data) { updatePromotion(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.updatePromotion, url: apiList.updatePromotion,
data data
}) })
}, },
finishPromotion(data) { finishPromotion(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.finishPromotion, url: apiList.finishPromotion,
data data
}) })
}, },
// 参与店铺 // 参与店铺
applyShop(data) { applyShop(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.applyShop, url: apiList.applyShop,
data data
}) })
}, },
// 审核记录 // 审核记录
auditLog(data) { auditLog(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.auditLog, url: apiList.auditLog,
data data
}) })
}, },
// 查看商品 // 查看商品
getGoodList(data) { getGoodList(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.getGoodList, url: apiList.getGoodList,
data data
}) })
}, },
// 报名审核 // 报名审核
auditPromotion(data) { auditPromotion(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.auditPromotion, url: apiList.auditPromotion,
data data
}) })
}, },
// 清退报名 // 清退报名
closeApplyInfo(data) { closeApplyInfo(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.closeApplyInfo, url: apiList.closeApplyInfo,
data data
}) })
}, },
/** 活动数据 */ /** 活动数据 */
getDetail(id) { getDetail(id) {
return axiosApi({ return axiosApi({
method: 'GET', method: 'GET',
url: `${apiList.getDetail}/${id}` url: `${apiList.getDetail}/${id}`
}) })
}, },
// 商家数据明细 // 商家数据明细
findTenantStatDetail(data) { findTenantStatDetail(data) {
return axiosApi({ return axiosApi({
method: 'GET', method: 'GET',
url: apiList.findTenantStatDetail, url: apiList.findTenantStatDetail,
data data
}) })
} }
} }

190
src/api/Member.js

@ -1,95 +1,95 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
getMemberList: `/member/adminPage`, getMemberList: `/member/adminPage`,
addTag: `/member/addTag`, addTag: `/member/addTag`,
forbiddenMember: `/member/forbidden`, forbiddenMember: `/member/forbidden`,
getMemberInfo: `/member/query/`, getMemberInfo: `/member/query/`,
getMemberAddress: `/memberAddress/page`, getMemberAddress: `/memberAddress/page`,
getOrderList: `/order/findAdminOrderList`, getOrderList: `/order/findAdminOrderList`,
getCustomData: `/order/getOrderStatisticsByMid/`, getCustomData: `/order/getOrderStatisticsByMid/`,
getCommentList: `/comment/findCommentList`, getCommentList: `/comment/findCommentList`,
getMemberBillDetials: `/member/getMemberBillDetials`, getMemberBillDetials: `/member/getMemberBillDetials`,
editMemberBill: `/member/editMemberBill` editMemberBill: `/member/editMemberBill`
} }
export default { export default {
// 平台会员余额修改 // 平台会员余额修改
editMemberBill(data) { editMemberBill(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.editMemberBill, url: apiList.editMemberBill,
data data
}) })
}, },
// 平台会员余额明细 // 平台会员余额明细
getMemberBillDetials(data) { getMemberBillDetials(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.getMemberBillDetials, url: apiList.getMemberBillDetials,
data data
}) })
}, },
// 客户管理列表 // 客户管理列表
getMemberList(data) { getMemberList(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.getMemberList, url: apiList.getMemberList,
data data
}) })
}, },
// 打标签 // 打标签
addTag(data) { addTag(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.addTag, url: apiList.addTag,
data data
}) })
}, },
// 加黑名单 // 加黑名单
forbiddenMember(data) { forbiddenMember(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.forbiddenMember, url: apiList.forbiddenMember,
data data
}) })
}, },
// 客户详情 // 客户详情
getMemberInfo(id) { getMemberInfo(id) {
return axiosApi({ return axiosApi({
method: 'GET', method: 'GET',
url: `${apiList.getMemberInfo}${id}` url: `${apiList.getMemberInfo}${id}`
}) })
}, },
// 客户消费数据 // 客户消费数据
getCustomData(id) { getCustomData(id) {
return axiosApi({ return axiosApi({
method: 'GET', method: 'GET',
url: `${apiList.getCustomData}${id}` url: `${apiList.getCustomData}${id}`
}) })
}, },
// 会员订单 // 会员订单
getOrderList(data) { getOrderList(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.getOrderList, url: apiList.getOrderList,
data data
}) })
}, },
// 客户评价列表 // 客户评价列表
getCommentList(data) { getCommentList(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.getCommentList, url: apiList.getCommentList,
data data
}) })
}, },
// 会员收货地址 // 会员收货地址
getMemberAddress(data) { getMemberAddress(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.getMemberAddress, url: apiList.getMemberAddress,
data data
}) })
} }
} }

78
src/api/Menu.js

@ -1,39 +1,39 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
getPlatformMenu: `/menu/tree`, getPlatformMenu: `/menu/tree`,
getAllMerchanMenu: `/menu/getAllTenantMenu`, getAllMerchanMenu: `/menu/getAllTenantMenu`,
getSpecialMerchantMenu: `/menu/getSpecifiedTenantMenu`, getSpecialMerchantMenu: `/menu/getSpecifiedTenantMenu`,
saveMenu: `/menu/syncMenu` saveMenu: `/menu/syncMenu`
} }
export default { export default {
// 平台所有菜单 // 平台所有菜单
getPlatformMenu() { getPlatformMenu() {
return axiosApi({ return axiosApi({
method: 'GET', method: 'GET',
url: apiList.getPlatformMenu url: apiList.getPlatformMenu
}) })
}, },
// 查询所有商家菜单 // 查询所有商家菜单
getAllMerchanMenu() { getAllMerchanMenu() {
return axiosApi({ return axiosApi({
method: 'GET', method: 'GET',
url: apiList.getAllMerchanMenu url: apiList.getAllMerchanMenu
}) })
}, },
// 查询指定商家菜单 // 查询指定商家菜单
getSpecialMerchantMenu(id) { getSpecialMerchantMenu(id) {
return axiosApi({ return axiosApi({
method: 'GET', method: 'GET',
url: `${apiList.getSpecialMerchantMenu}/${id}` url: `${apiList.getSpecialMerchantMenu}/${id}`
}) })
}, },
// 同步菜单 // 同步菜单
saveMenu(data) { saveMenu(data) {
return axiosApi({ return axiosApi({
method: 'POST', method: 'POST',
url: apiList.saveMenu, url: apiList.saveMenu,
data data
}) })
} }
} }

94
src/api/Menus.js

@ -1,47 +1,47 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
allTree: { allTree: {
method: 'GET', method: 'GET',
url: `/menu/tree` url: `/menu/tree`
}, },
save: { save: {
method: 'POST', method: 'POST',
url: `/menu` url: `/menu`
}, },
update: { update: {
method: 'PUT', method: 'PUT',
url: `/menu` url: `/menu`
}, },
delete: { delete: {
method: 'DELETE', method: 'DELETE',
url: `/menu` url: `/menu`
} }
} }
export default { export default {
allTree (data) { allTree (data) {
return axiosApi({ return axiosApi({
...apiList.allTree, ...apiList.allTree,
data data
}) })
}, },
save (data) { save (data) {
return axiosApi({ return axiosApi({
...apiList.save, ...apiList.save,
data data
}) })
}, },
update (data) { update (data) {
return axiosApi({ return axiosApi({
...apiList.update, ...apiList.update,
data data
}) })
}, },
delete (data) { delete (data) {
return axiosApi({ return axiosApi({
...apiList.delete, ...apiList.delete,
data data
}) })
} }
} }

170
src/api/Msgs.js

@ -1,85 +1,85 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
page: { page: {
url: `/msgsCenterInfo/page`, url: `/msgsCenterInfo/page`,
method: 'POST' method: 'POST'
}, },
mark: { mark: {
url: `/msgsCenterInfo/mark`, url: `/msgsCenterInfo/mark`,
method: 'GET' method: 'GET'
}, },
save: { save: {
url: `/msgsCenterInfo`, url: `/msgsCenterInfo`,
method: 'POST' method: 'POST'
}, },
delete: { delete: {
url: `/msgsCenterInfo`, url: `/msgsCenterInfo`,
method: 'DELETE' method: 'DELETE'
}, },
preview: { preview: {
method: 'POST', method: 'POST',
url: `/msgsCenterInfo/preview` url: `/msgsCenterInfo/preview`
}, },
export: { export: {
method: 'POST', method: 'POST',
url: `/msgsCenterInfo/export` url: `/msgsCenterInfo/export`
}, },
import: { import: {
method: 'POST', method: 'POST',
url: `/msgsCenterInfo/import` url: `/msgsCenterInfo/import`
} }
} }
export default { export default {
page (data, custom = {}) { page (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.page, ...apiList.page,
data, data,
custom custom
}) })
}, },
save (data) { save (data) {
return axiosApi({ return axiosApi({
...apiList.save, ...apiList.save,
data data
}) })
}, },
delete (data) { delete (data) {
return axiosApi({ return axiosApi({
...apiList.delete, ...apiList.delete,
data data
}) })
}, },
mark (data) { mark (data) {
return axiosApi({ return axiosApi({
...apiList.mark, ...apiList.mark,
data data
}) })
}, },
get (id) { get (id) {
return axiosApi({ return axiosApi({
url: `/msgsCenterInfo/${id}`, url: `/msgsCenterInfo/${id}`,
method: 'GET' method: 'GET'
}) })
}, },
preview (data) { preview (data) {
return axiosApi({ return axiosApi({
...apiList.preview, ...apiList.preview,
data data
}) })
}, },
export (data) { export (data) {
return axiosApi({ return axiosApi({
...apiList.export, ...apiList.export,
responseType: "blob", responseType: "blob",
data data
}) })
}, },
import (data) { import (data) {
return axiosApi({ return axiosApi({
...apiList.import, ...apiList.import,
data data
}) })
} }
} }

136
src/api/OptLog.js

@ -1,68 +1,68 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
page: { page: {
method: 'POST', method: 'POST',
url: `/optLog/page` url: `/optLog/page`
}, },
delete: { delete: {
method: 'DELETE', method: 'DELETE',
url: `/optLog` url: `/optLog`
}, },
clear: { clear: {
method: 'DELETE', method: 'DELETE',
url: `/optLog/clear` url: `/optLog/clear`
}, },
preview: { preview: {
method: 'POST', method: 'POST',
url: `/optLog/preview` url: `/optLog/preview`
}, },
export: { export: {
method: 'POST', method: 'POST',
url: `/optLog/export` url: `/optLog/export`
}, },
import: { import: {
method: 'POST', method: 'POST',
url: `/optLog/import` url: `/optLog/import`
} }
} }
export default { export default {
page (data) { page (data) {
return axiosApi({ return axiosApi({
...apiList.page, ...apiList.page,
data data
}) })
}, },
delete (data) { delete (data) {
return axiosApi({ return axiosApi({
...apiList.delete, ...apiList.delete,
data data
}) })
}, },
clear (data) { clear (data) {
return axiosApi({ return axiosApi({
...apiList.clear, ...apiList.clear,
data data
}) })
}, },
preview (data) { preview (data) {
return axiosApi({ return axiosApi({
...apiList.preview, ...apiList.preview,
data data
}) })
}, },
export (data) { export (data) {
return axiosApi({ return axiosApi({
...apiList.export, ...apiList.export,
responseType: "blob", responseType: "blob",
data data
}) })
}, },
import (data) { import (data) {
return axiosApi({ return axiosApi({
...apiList.import, ...apiList.import,
data data
}) })
} }
} }

156
src/api/Org.js

@ -1,78 +1,78 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
allTree: { allTree: {
method: 'GET', method: 'GET',
url: `/org/tree` url: `/org/tree`
}, },
save: { save: {
method: 'POST', method: 'POST',
url: `/org` url: `/org`
}, },
update: { update: {
method: 'PUT', method: 'PUT',
url: `/org` url: `/org`
}, },
delete: { delete: {
method: 'DELETE', method: 'DELETE',
url: `/org` url: `/org`
}, },
preview: { preview: {
method: 'POST', method: 'POST',
url: `/org/preview` url: `/org/preview`
}, },
export: { export: {
method: 'POST', method: 'POST',
url: `/org/export` url: `/org/export`
}, },
import: { import: {
method: 'POST', method: 'POST',
url: `/org/import` url: `/org/import`
} }
} }
export default { export default {
allTree (data) { allTree (data) {
return axiosApi({ return axiosApi({
...apiList.allTree, ...apiList.allTree,
data data
}) })
}, },
save (data) { save (data) {
return axiosApi({ return axiosApi({
...apiList.save, ...apiList.save,
data data
}) })
}, },
update (data) { update (data) {
return axiosApi({ return axiosApi({
...apiList.update, ...apiList.update,
data data
}) })
}, },
delete (data) { delete (data) {
return axiosApi({ return axiosApi({
...apiList.delete, ...apiList.delete,
data data
}) })
}, },
preview (data) { preview (data) {
return axiosApi({ return axiosApi({
...apiList.preview, ...apiList.preview,
data data
}) })
}, },
export (data) { export (data) {
return axiosApi({ return axiosApi({
...apiList.export, ...apiList.export,
responseType: "blob", responseType: "blob",
data data
}) })
}, },
import (data) { import (data) {
return axiosApi({ return axiosApi({
...apiList.import, ...apiList.import,
data data
}) })
} }
} }

158
src/api/Parameter.js

@ -1,79 +1,79 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
page: { page: {
method: 'POST', method: 'POST',
url: `/parameter/page` url: `/parameter/page`
}, },
update: { update: {
method: 'PUT', method: 'PUT',
url: `/parameter` url: `/parameter`
}, },
save: { save: {
method: 'POST', method: 'POST',
url: `/parameter` url: `/parameter`
}, },
delete: { delete: {
method: 'DELETE', method: 'DELETE',
url: `/parameter` url: `/parameter`
}, },
preview: { preview: {
method: 'POST', method: 'POST',
url: `/parameter/preview` url: `/parameter/preview`
}, },
export: { export: {
method: 'POST', method: 'POST',
url: `/parameter/export` url: `/parameter/export`
}, },
import: { import: {
method: 'POST', method: 'POST',
url: `/parameter/import` url: `/parameter/import`
} }
} }
export default { export default {
page (data, custom = {}) { page (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.page, ...apiList.page,
data, data,
custom custom
}) })
}, },
save (data) { save (data) {
return axiosApi({ return axiosApi({
...apiList.save, ...apiList.save,
data data
}) })
}, },
update (data) { update (data) {
return axiosApi({ return axiosApi({
...apiList.update, ...apiList.update,
data data
}) })
}, },
delete (data) { delete (data) {
return axiosApi({ return axiosApi({
...apiList.delete, ...apiList.delete,
data data
}) })
}, },
preview (data) { preview (data) {
return axiosApi({ return axiosApi({
...apiList.preview, ...apiList.preview,
data data
}) })
}, },
export (data) { export (data) {
return axiosApi({ return axiosApi({
...apiList.export, ...apiList.export,
responseType: "blob", responseType: "blob",
data data
}) })
}, },
import (data) { import (data) {
return axiosApi({ return axiosApi({
...apiList.import, ...apiList.import,
data data
}) })
} }
} }

94
src/api/Resource.js

@ -1,47 +1,47 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
page: { page: {
method: 'POST', method: 'POST',
url: `/resource/page` url: `/resource/page`
}, },
save: { save: {
method: 'POST', method: 'POST',
url: `/resource` url: `/resource`
}, },
update: { update: {
method: 'PUT', method: 'PUT',
url: `/resource` url: `/resource`
}, },
delete: { delete: {
method: 'DELETE', method: 'DELETE',
url: `/resource` url: `/resource`
} }
} }
export default { export default {
page (data) { page (data) {
return axiosApi({ return axiosApi({
...apiList.page, ...apiList.page,
data data
}) })
}, },
save (data) { save (data) {
return axiosApi({ return axiosApi({
...apiList.save, ...apiList.save,
data data
}) })
}, },
update (data) { update (data) {
return axiosApi({ return axiosApi({
...apiList.update, ...apiList.update,
data data
}) })
}, },
delete (data) { delete (data) {
return axiosApi({ return axiosApi({
...apiList.delete, ...apiList.delete,
data data
}) })
} }
} }

258
src/api/Role.js

@ -1,129 +1,129 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
page: { page: {
url: `/role/page`, url: `/role/page`,
method: 'POST' method: 'POST'
}, },
save: { save: {
url: `/role`, url: `/role`,
method: 'POST' method: 'POST'
}, },
update: { update: {
url: `/role`, url: `/role`,
method: 'PUT' method: 'PUT'
}, },
delete: { delete: {
url: `/role`, url: `/role`,
method: 'DELETE' method: 'DELETE'
}, },
saveUserRole: { saveUserRole: {
url: `/role/user`, url: `/role/user`,
method: 'POST' method: 'POST'
}, },
saveRoleAuthority: { saveRoleAuthority: {
url: `/role/authority`, url: `/role/authority`,
method: 'POST' method: 'POST'
}, },
preview: { preview: {
method: 'POST', method: 'POST',
url: `/user/preview` url: `/user/preview`
}, },
export: { export: {
method: 'POST', method: 'POST',
url: `/user/export` url: `/user/export`
}, },
import: { import: {
method: 'POST', method: 'POST',
url: `/role/import` url: `/role/import`
} }
} }
export default { export default {
page (data) { page (data) {
return axiosApi({ return axiosApi({
...apiList.page, ...apiList.page,
// formData: true, // formData: true,
data data
}) })
}, },
save (data) { save (data) {
return axiosApi({ return axiosApi({
...apiList.save, ...apiList.save,
data data
}) })
}, },
update (data) { update (data) {
return axiosApi({ return axiosApi({
...apiList.update, ...apiList.update,
data data
}) })
}, },
delete (data) { delete (data) {
return axiosApi({ return axiosApi({
...apiList.delete, ...apiList.delete,
data data
}) })
}, },
get (id) { get (id) {
return axiosApi({ return axiosApi({
url: `/role/${id}`, url: `/role/${id}`,
method: 'GET' method: 'GET'
}) })
}, },
getDetails (id) { getDetails (id) {
return axiosApi({ return axiosApi({
url: `/role/details/${id}`, url: `/role/details/${id}`,
method: 'GET' method: 'GET'
}) })
}, },
check (code) { check (code) {
return axiosApi({ return axiosApi({
url: `/role/check/${code}`, url: `/role/check/${code}`,
method: 'GET' method: 'GET'
}) })
}, },
saveUserRole (data) { saveUserRole (data) {
return axiosApi({ return axiosApi({
...apiList.saveUserRole, ...apiList.saveUserRole,
data data
}) })
}, },
findUserIdByRoleId (roleId) { findUserIdByRoleId (roleId) {
return axiosApi({ return axiosApi({
url: `/role/user/${roleId}`, url: `/role/user/${roleId}`,
method: 'GET' method: 'GET'
}) })
}, },
findAuthorityIdByRoleId (roleId) { findAuthorityIdByRoleId (roleId) {
return axiosApi({ return axiosApi({
url: `/role/authority/${roleId}`, url: `/role/authority/${roleId}`,
method: 'GET' method: 'GET'
}) })
}, },
saveRoleAuthority (data) { saveRoleAuthority (data) {
return axiosApi({ return axiosApi({
...apiList.saveRoleAuthority, ...apiList.saveRoleAuthority,
data data
}) })
}, },
preview (data) { preview (data) {
return axiosApi({ return axiosApi({
...apiList.preview, ...apiList.preview,
data data
}) })
}, },
export (data) { export (data) {
return axiosApi({ return axiosApi({
...apiList.export, ...apiList.export,
responseType: "blob", responseType: "blob",
data data
}) })
}, },
import (data) { import (data) {
return axiosApi({ return axiosApi({
...apiList.import, ...apiList.import,
data data
}) })
} }
} }

34
src/api/SmsSendStatus.js

@ -1,17 +1,17 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
page: { page: {
url: `/smsSendStatus/page`, url: `/smsSendStatus/page`,
method: 'POST' method: 'POST'
} }
} }
export default { export default {
page (data) { page (data) {
return axiosApi({ return axiosApi({
...apiList.page, ...apiList.page,
data data
}) })
} }
} }

168
src/api/SmsTask.js

@ -1,84 +1,84 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
page: { page: {
url: `/smsTask/page`, url: `/smsTask/page`,
method: 'POST' method: 'POST'
}, },
save: { save: {
url: `/smsTask`, url: `/smsTask`,
method: 'POST' method: 'POST'
}, },
update: { update: {
url: `/smsTask`, url: `/smsTask`,
method: 'PUT' method: 'PUT'
}, },
delete: { delete: {
url: `/smsTask`, url: `/smsTask`,
method: 'DELETE' method: 'DELETE'
}, },
preview: { preview: {
method: 'POST', method: 'POST',
url: `/smsTask/preview` url: `/smsTask/preview`
}, },
export: { export: {
method: 'POST', method: 'POST',
url: `/smsTask/export` url: `/smsTask/export`
}, },
import: { import: {
method: 'POST', method: 'POST',
url: `/smsTask/import` url: `/smsTask/import`
} }
} }
export default { export default {
page (data) { page (data) {
return axiosApi({ return axiosApi({
...apiList.page, ...apiList.page,
data data
}) })
}, },
save (data) { save (data) {
return axiosApi({ return axiosApi({
...apiList.save, ...apiList.save,
data data
}) })
}, },
update (data) { update (data) {
return axiosApi({ return axiosApi({
...apiList.update, ...apiList.update,
data data
}) })
}, },
delete (data) { delete (data) {
return axiosApi({ return axiosApi({
...apiList.delete, ...apiList.delete,
data data
}) })
}, },
get (id) { get (id) {
return axiosApi({ return axiosApi({
url: `/smsTask/${id}`, url: `/smsTask/${id}`,
method: 'GET' method: 'GET'
}) })
}, },
preview (data) { preview (data) {
return axiosApi({ return axiosApi({
...apiList.preview, ...apiList.preview,
data data
}) })
}, },
export (data) { export (data) {
return axiosApi({ return axiosApi({
...apiList.export, ...apiList.export,
responseType: "blob", responseType: "blob",
data data
}) })
}, },
import (data) { import (data) {
return axiosApi({ return axiosApi({
...apiList.import, ...apiList.import,
data data
}) })
} }
} }

178
src/api/SmsTemplate.js

@ -1,89 +1,89 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
page: { page: {
url: `/smsTemplate/page`, url: `/smsTemplate/page`,
method: 'POST' method: 'POST'
}, },
save: { save: {
url: `/smsTemplate`, url: `/smsTemplate`,
method: 'POST' method: 'POST'
}, },
update: { update: {
url: `/smsTemplate`, url: `/smsTemplate`,
method: 'PUT' method: 'PUT'
}, },
delete: { delete: {
url: `/smsTemplate`, url: `/smsTemplate`,
method: 'DELETE' method: 'DELETE'
}, },
check: { check: {
url: `/smsTemplate/check`, url: `/smsTemplate/check`,
method: 'GET' method: 'GET'
}, },
preview: { preview: {
method: 'POST', method: 'POST',
url: `/smsTemplate/preview` url: `/smsTemplate/preview`
}, },
export: { export: {
method: 'POST', method: 'POST',
url: `/smsTemplate/export` url: `/smsTemplate/export`
}, },
import: { import: {
method: 'POST', method: 'POST',
url: `/smsTemplate/import` url: `/smsTemplate/import`
} }
} }
export default { export default {
page (data) { page (data) {
return axiosApi({ return axiosApi({
...apiList.page, ...apiList.page,
data data
}) })
}, },
save (data) { save (data) {
return axiosApi({ return axiosApi({
...apiList.save, ...apiList.save,
data data
}) })
}, },
update (data) { update (data) {
return axiosApi({ return axiosApi({
...apiList.update, ...apiList.update,
data data
}) })
}, },
delete (data) { delete (data) {
return axiosApi({ return axiosApi({
...apiList.delete, ...apiList.delete,
data data
}) })
}, },
check (customCode) { check (customCode) {
const data = { customCode: customCode } const data = { customCode: customCode }
return axiosApi({ return axiosApi({
...apiList.check, ...apiList.check,
data data
}) })
}, },
preview (data) { preview (data) {
return axiosApi({ return axiosApi({
...apiList.preview, ...apiList.preview,
data data
}) })
}, },
export (data) { export (data) {
return axiosApi({ return axiosApi({
...apiList.export, ...apiList.export,
responseType: "blob", responseType: "blob",
data data
}) })
}, },
import (data) { import (data) {
return axiosApi({ return axiosApi({
...apiList.import, ...apiList.import,
data data
}) })
} }
} }

156
src/api/Station.js

@ -1,78 +1,78 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
page: { page: {
url: `/station/page`, url: `/station/page`,
method: 'POST' method: 'POST'
}, },
save: { save: {
url: `/station`, url: `/station`,
method: 'POST' method: 'POST'
}, },
update: { update: {
url: `/station`, url: `/station`,
method: 'PUT' method: 'PUT'
}, },
delete: { delete: {
url: `/station`, url: `/station`,
method: 'DELETE' method: 'DELETE'
}, },
preview: { preview: {
method: 'POST', method: 'POST',
url: `/station/preview` url: `/station/preview`
}, },
export: { export: {
method: 'POST', method: 'POST',
url: `/station/export` url: `/station/export`
}, },
import: { import: {
method: 'POST', method: 'POST',
url: `/station/import` url: `/station/import`
} }
} }
export default { export default {
page (data) { page (data) {
return axiosApi({ return axiosApi({
...apiList.page, ...apiList.page,
data data
}) })
}, },
save (data) { save (data) {
return axiosApi({ return axiosApi({
...apiList.save, ...apiList.save,
data data
}) })
}, },
update (data) { update (data) {
return axiosApi({ return axiosApi({
...apiList.update, ...apiList.update,
data data
}) })
}, },
delete (data) { delete (data) {
return axiosApi({ return axiosApi({
...apiList.delete, ...apiList.delete,
data data
}) })
}, },
preview (data) { preview (data) {
return axiosApi({ return axiosApi({
...apiList.preview, ...apiList.preview,
data data
}) })
}, },
export (data) { export (data) {
return axiosApi({ return axiosApi({
...apiList.export, ...apiList.export,
responseType: "blob", responseType: "blob",
data data
}) })
}, },
import (data) { import (data) {
return axiosApi({ return axiosApi({
...apiList.import, ...apiList.import,
data data
}) })
} }
} }

168
src/api/SystemApi.js

@ -1,84 +1,84 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
page: { page: {
method: 'POST', method: 'POST',
url: `/systemApi/page` url: `/systemApi/page`
}, },
update: { update: {
method: 'PUT', method: 'PUT',
url: `/systemApi` url: `/systemApi`
}, },
save: { save: {
method: 'POST', method: 'POST',
url: `/systemApi` url: `/systemApi`
}, },
delete: { delete: {
method: 'DELETE', method: 'DELETE',
url: `/systemApi` url: `/systemApi`
}, },
preview: { preview: {
method: 'POST', method: 'POST',
url: `/systemApi/preview` url: `/systemApi/preview`
}, },
export: { export: {
method: 'POST', method: 'POST',
url: `/systemApi/export` url: `/systemApi/export`
}, },
import: { import: {
method: 'POST', method: 'POST',
url: `/systemApi/import` url: `/systemApi/import`
} }
} }
export default { export default {
page(data) { page(data) {
return axiosApi({ return axiosApi({
...apiList.page, ...apiList.page,
data data
}) })
}, },
scan(serviceId) { scan(serviceId) {
return axiosApi({ return axiosApi({
method: 'GET', method: 'GET',
url: `/${serviceId}/systemApiScan` url: `/${serviceId}/systemApiScan`
}) })
}, },
save(data) { save(data) {
return axiosApi({ return axiosApi({
...apiList.save, ...apiList.save,
data data
}) })
}, },
update(data) { update(data) {
return axiosApi({ return axiosApi({
...apiList.update, ...apiList.update,
data data
}) })
}, },
delete(data) { delete(data) {
return axiosApi({ return axiosApi({
...apiList.delete, ...apiList.delete,
data data
}) })
}, },
preview(data) { preview(data) {
return axiosApi({ return axiosApi({
...apiList.preview, ...apiList.preview,
data data
}) })
}, },
export(data) { export(data) {
return axiosApi({ return axiosApi({
...apiList.export, ...apiList.export,
responseType: "blob", responseType: "blob",
data data
}) })
}, },
import(data) { import(data) {
return axiosApi({ return axiosApi({
...apiList.import, ...apiList.import,
data data
}) })
} }
} }

114
src/api/Tenant copy.js

@ -1,57 +1,57 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
page: { page: {
method: 'POST', method: 'POST',
url: `/tenant/page` url: `/tenant/page`
}, },
update: { update: {
method: 'PUT', method: 'PUT',
url: `/tenant` url: `/tenant`
}, },
save: { save: {
method: 'POST', method: 'POST',
url: `/tenant` url: `/tenant`
}, },
saveInit: { saveInit: {
method: 'POST', method: 'POST',
url: `/tenant/init` url: `/tenant/init`
}, },
remove: { remove: {
method: 'DELETE', method: 'DELETE',
url: `/tenant/remove` url: `/tenant/remove`
} }
} }
export default { export default {
page(data) { page(data) {
return axiosApi({ return axiosApi({
...apiList.page, ...apiList.page,
data data
}) })
}, },
save(data) { save(data) {
return axiosApi({ return axiosApi({
...apiList.save, ...apiList.save,
data data
}) })
}, },
saveInit(data) { saveInit(data) {
return axiosApi({ return axiosApi({
...apiList.saveInit, ...apiList.saveInit,
data data
}) })
}, },
update(data) { update(data) {
return axiosApi({ return axiosApi({
...apiList.update, ...apiList.update,
data data
}) })
}, },
remove(data) { remove(data) {
return axiosApi({ return axiosApi({
...apiList.remove, ...apiList.remove,
data data
}) })
} }
} }

210
src/api/Tenant.js

@ -1,105 +1,105 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
page: { page: {
method: 'POST', method: 'POST',
url: `/tenant/page` url: `/tenant/page`
}, },
update: { update: {
method: 'PUT', method: 'PUT',
url: `/tenant` url: `/tenant`
}, },
save: { save: {
method: 'POST', method: 'POST',
url: `/tenant` url: `/tenant`
}, },
saveInit: { saveInit: {
method: 'POST', method: 'POST',
url: `/tenant/init` url: `/tenant/init`
}, },
remove: { remove: {
method: 'DELETE', method: 'DELETE',
url: `/tenant` url: `/tenant`
}, },
list: { list: {
method: 'POST', method: 'POST',
url: `/tenant/query` url: `/tenant/query`
}, },
preview: { preview: {
method: 'POST', method: 'POST',
url: `/tenant/preview` url: `/tenant/preview`
}, },
export: { export: {
method: 'POST', method: 'POST',
url: `/tenant/export` url: `/tenant/export`
}, },
import: { import: {
method: 'POST', method: 'POST',
url: `/tenant/import` url: `/tenant/import`
} }
} }
export default { export default {
page (data) { page (data) {
return axiosApi({ return axiosApi({
...apiList.page, ...apiList.page,
data data
}) })
}, },
save (data) { save (data) {
return axiosApi({ return axiosApi({
...apiList.save, ...apiList.save,
data data
}) })
}, },
// 同步创建租户,防止在切换回默认数据源时,执行其他方法 // 同步创建租户,防止在切换回默认数据源时,执行其他方法
async saveInit (data) { async saveInit (data) {
return axiosApi({ return axiosApi({
...apiList.saveInit, ...apiList.saveInit,
data data
}) })
}, },
update (data) { update (data) {
return axiosApi({ return axiosApi({
...apiList.update, ...apiList.update,
data data
}) })
}, },
remove (data) { remove (data) {
return axiosApi({ return axiosApi({
...apiList.remove, ...apiList.remove,
data data
}) })
}, },
list (data) { list (data) {
return axiosApi({ return axiosApi({
...apiList.list, ...apiList.list,
data data
}) })
}, },
check (code) { check (code) {
return axiosApi({ return axiosApi({
method: 'GET', method: 'GET',
url: `/tenant/check/${code}` url: `/tenant/check/${code}`
}) })
}, },
preview (data) { preview (data) {
return axiosApi({ return axiosApi({
...apiList.preview, ...apiList.preview,
data data
}) })
}, },
export (data) { export (data) {
return axiosApi({ return axiosApi({
...apiList.export, ...apiList.export,
responseType: "blob", responseType: "blob",
data data
}) })
}, },
import (data) { import (data) {
return axiosApi({ return axiosApi({
...apiList.import, ...apiList.import,
data data
}) })
} }
} }

270
src/api/User.js

@ -1,135 +1,135 @@
import axiosApi from './AxiosApi.js' import axiosApi from './AxiosApi.js'
const apiList = { const apiList = {
page: { page: {
method: 'POST', method: 'POST',
url: `/user/page` url: `/user/page`
}, },
save: { save: {
method: 'POST', method: 'POST',
url: `/user` url: `/user`
}, },
update: { update: {
method: 'PUT', method: 'PUT',
url: `/user` url: `/user`
}, },
updateBaseInfo: { updateBaseInfo: {
method: 'PUT', method: 'PUT',
url: `/user/base` url: `/user/base`
}, },
avatar: { avatar: {
method: 'PUT', method: 'PUT',
url: `/user/avatar` url: `/user/avatar`
}, },
delete: { delete: {
method: 'DELETE', method: 'DELETE',
url: `/user` url: `/user`
}, },
reset: { reset: {
method: 'GET', method: 'GET',
url: `/user/reset` url: `/user/reset`
}, },
updatePassword: { updatePassword: {
method: 'PUT', method: 'PUT',
url: `/user/password` url: `/user/password`
}, },
reload: { reload: {
method: 'POST', method: 'POST',
url: `/user/reload` url: `/user/reload`
}, },
preview: { preview: {
method: 'POST', method: 'POST',
url: `/user/preview` url: `/user/preview`
}, },
export: { export: {
method: 'POST', method: 'POST',
url: `/user/export` url: `/user/export`
}, },
import: { import: {
method: 'POST', method: 'POST',
url: `/user/import` url: `/user/import`
} }
} }
export default { export default {
page (data) { page (data) {
return axiosApi({ return axiosApi({
...apiList.page, ...apiList.page,
data data
}) })
}, },
save (data) { save (data) {
return axiosApi({ return axiosApi({
...apiList.save, ...apiList.save,
data data
}) })
}, },
update (data) { update (data) {
return axiosApi({ return axiosApi({
...apiList.update, ...apiList.update,
data data
}) })
}, },
updateBaseInfo (data) { updateBaseInfo (data) {
return axiosApi({ return axiosApi({
...apiList.updateBaseInfo, ...apiList.updateBaseInfo,
data data
}) })
}, },
updatePassword (data) { updatePassword (data) {
return axiosApi({ return axiosApi({
...apiList.updatePassword, ...apiList.updatePassword,
data data
}) })
}, },
delete (data) { delete (data) {
return axiosApi({ return axiosApi({
...apiList.delete, ...apiList.delete,
data data
}) })
}, },
get (id) { get (id) {
return axiosApi({ return axiosApi({
method: 'GET', method: 'GET',
url: `/user/${id}` url: `/user/${id}`
}) })
}, },
reset (data) { reset (data) {
return axiosApi({ return axiosApi({
...apiList.reset, ...apiList.reset,
data data
}) })
}, },
avatar (data) { avatar (data) {
return axiosApi({ return axiosApi({
...apiList.avatar, ...apiList.avatar,
data data
}) })
}, },
reload (userId) { reload (userId) {
return axiosApi({ return axiosApi({
...apiList.reload, ...apiList.reload,
formData: true, formData: true,
data: { userId: userId } data: { userId: userId }
}) })
}, },
preview (data) { preview (data) {
return axiosApi({ return axiosApi({
...apiList.preview, ...apiList.preview,
data data
}) })
}, },
export (data) { export (data) {
return axiosApi({ return axiosApi({
...apiList.export, ...apiList.export,
responseType: "blob", responseType: "blob",
data data
}) })
}, },
import (data) { import (data) {
return axiosApi({ return axiosApi({
...apiList.import, ...apiList.import,
data data
}) })
} }
} }

194
src/api/creditGoods/CreditGoods.js

@ -1,97 +1,97 @@
import axiosApi from '../AxiosApi.js' import axiosApi from '../AxiosApi.js'
const apiList = { const apiList = {
page: { page: {
method: 'POST', method: 'POST',
url: `/creditGoods/list`, url: `/creditGoods/list`,
// url: `/creditGoods/page`, // url: `/creditGoods/page`,
}, },
query: { query: {
method: 'POST', method: 'POST',
url: `/creditGoods/query`, url: `/creditGoods/query`,
}, },
update: { update: {
method: 'PUT', method: 'PUT',
url: `/creditGoods` url: `/creditGoods`
}, },
save: { save: {
method: 'POST', method: 'POST',
url: `/creditGoods` url: `/creditGoods`
}, },
delete: { delete: {
method: 'DELETE', method: 'DELETE',
url: `/creditGoods` url: `/creditGoods`
}, },
export: { export: {
method: 'POST', method: 'POST',
url: `/creditGoods/export` url: `/creditGoods/export`
}, },
preview: { preview: {
method: 'POST', method: 'POST',
url: `/creditGoods/preview` url: `/creditGoods/preview`
}, },
import: { import: {
method: 'POST', method: 'POST',
url: `/creditGoods/import` url: `/creditGoods/import`
} }
} }
export default { export default {
page (data, custom = {}) { page (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.page, ...apiList.page,
data, data,
custom custom
}) })
}, },
query (data, custom = {}) { query (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.query, ...apiList.query,
data, data,
custom custom
}) })
}, },
save (data, custom = {}) { save (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.save, ...apiList.save,
data, data,
custom custom
}) })
}, },
update (data, custom = {}) { update (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.update, ...apiList.update,
data, data,
custom custom
}) })
}, },
delete (data, custom = {}) { delete (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.delete, ...apiList.delete,
data, data,
custom custom
}) })
}, },
export (data, custom = {}) { export (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.export, ...apiList.export,
responseType: "blob", responseType: "blob",
data, data,
custom custom
}) })
}, },
preview (data, custom = {}) { preview (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.preview, ...apiList.preview,
data, data,
custom custom
}) })
}, },
import (data, custom = {}) { import (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.import, ...apiList.import,
data, data,
custom custom
}) })
} }
} }

192
src/api/creditGoods/CreditGoodsCategory.js

@ -1,96 +1,96 @@
import axiosApi from '../AxiosApi.js' import axiosApi from '../AxiosApi.js'
const apiList = { const apiList = {
page: { page: {
method: 'POST', method: 'POST',
url: `/creditGoodsCategory/page`, url: `/creditGoodsCategory/page`,
}, },
query: { query: {
method: 'POST', method: 'POST',
url: `/creditGoodsCategory/query`, url: `/creditGoodsCategory/query`,
}, },
update: { update: {
method: 'PUT', method: 'PUT',
url: `/creditGoodsCategory` url: `/creditGoodsCategory`
}, },
save: { save: {
method: 'POST', method: 'POST',
url: `/creditGoodsCategory` url: `/creditGoodsCategory`
}, },
delete: { delete: {
method: 'DELETE', method: 'DELETE',
url: `/creditGoodsCategory` url: `/creditGoodsCategory`
}, },
export: { export: {
method: 'POST', method: 'POST',
url: `/creditGoodsCategory/export` url: `/creditGoodsCategory/export`
}, },
preview: { preview: {
method: 'POST', method: 'POST',
url: `/creditGoodsCategory/preview` url: `/creditGoodsCategory/preview`
}, },
import: { import: {
method: 'POST', method: 'POST',
url: `/creditGoodsCategory/import` url: `/creditGoodsCategory/import`
} }
} }
export default { export default {
page (data, custom = {}) { page (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.page, ...apiList.page,
data, data,
custom custom
}) })
}, },
query (data, custom = {}) { query (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.query, ...apiList.query,
data, data,
custom custom
}) })
}, },
save (data, custom = {}) { save (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.save, ...apiList.save,
data, data,
custom custom
}) })
}, },
update (data, custom = {}) { update (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.update, ...apiList.update,
data, data,
custom custom
}) })
}, },
delete (data, custom = {}) { delete (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.delete, ...apiList.delete,
data, data,
custom custom
}) })
}, },
export (data, custom = {}) { export (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.export, ...apiList.export,
responseType: "blob", responseType: "blob",
data, data,
custom custom
}) })
}, },
preview (data, custom = {}) { preview (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.preview, ...apiList.preview,
data, data,
custom custom
}) })
}, },
import (data, custom = {}) { import (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.import, ...apiList.import,
data, data,
custom custom
}) })
} }
} }

192
src/api/creditGoods/CreditGoodsImg.js

@ -1,96 +1,96 @@
import axiosApi from '../AxiosApi.js' import axiosApi from '../AxiosApi.js'
const apiList = { const apiList = {
page: { page: {
method: 'POST', method: 'POST',
url: `/store/creditGoodsImg/page`, url: `/creditGoodsImg/page`,
}, },
query: { query: {
method: 'POST', method: 'POST',
url: `/store/creditGoodsImg/query`, url: `/creditGoodsImg/query`,
}, },
update: { update: {
method: 'PUT', method: 'PUT',
url: `/store/creditGoodsImg` url: `/creditGoodsImg`
}, },
save: { save: {
method: 'POST', method: 'POST',
url: `/store/creditGoodsImg` url: `/creditGoodsImg`
}, },
delete: { delete: {
method: 'DELETE', method: 'DELETE',
url: `/store/creditGoodsImg` url: `/creditGoodsImg`
}, },
export: { export: {
method: 'POST', method: 'POST',
url: `/store/creditGoodsImg/export` url: `/creditGoodsImg/export`
}, },
preview: { preview: {
method: 'POST', method: 'POST',
url: `/store/creditGoodsImg/preview` url: `/creditGoodsImg/preview`
}, },
import: { import: {
method: 'POST', method: 'POST',
url: `/store/creditGoodsImg/import` url: `/creditGoodsImg/import`
} }
} }
export default { export default {
page (data, custom = {}) { page (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.page, ...apiList.page,
data, data,
custom custom
}) })
}, },
query (data, custom = {}) { query (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.query, ...apiList.query,
data, data,
custom custom
}) })
}, },
save (data, custom = {}) { save (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.save, ...apiList.save,
data, data,
custom custom
}) })
}, },
update (data, custom = {}) { update (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.update, ...apiList.update,
data, data,
custom custom
}) })
}, },
delete (data, custom = {}) { delete (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.delete, ...apiList.delete,
data, data,
custom custom
}) })
}, },
export (data, custom = {}) { export (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.export, ...apiList.export,
responseType: "blob", responseType: "blob",
data, data,
custom custom
}) })
}, },
preview (data, custom = {}) { preview (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.preview, ...apiList.preview,
data, data,
custom custom
}) })
}, },
import (data, custom = {}) { import (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.import, ...apiList.import,
data, data,
custom custom
}) })
} }
} }

194
src/api/creditGoods/CreditOrder.js

@ -1,97 +1,97 @@
import axiosApi from '../AxiosApi.js' import axiosApi from '../AxiosApi.js'
const apiList = { const apiList = {
page: { page: {
method: 'POST', method: 'POST',
url: `/creditOrder/list`, url: `/creditOrder/list`,
// url: `/creditOrder/page`, // url: `/creditOrder/page`,
}, },
query: { query: {
method: 'POST', method: 'POST',
url: `/creditOrder/query`, url: `/creditOrder/query`,
}, },
update: { update: {
method: 'PUT', method: 'PUT',
url: `/creditOrder` url: `/creditOrder`
}, },
save: { save: {
method: 'POST', method: 'POST',
url: `/creditOrder` url: `/creditOrder`
}, },
delete: { delete: {
method: 'DELETE', method: 'DELETE',
url: `/creditOrder` url: `/creditOrder`
}, },
export: { export: {
method: 'POST', method: 'POST',
url: `/creditOrder/export` url: `/creditOrder/export`
}, },
preview: { preview: {
method: 'POST', method: 'POST',
url: `/creditOrder/preview` url: `/creditOrder/preview`
}, },
import: { import: {
method: 'POST', method: 'POST',
url: `/creditOrder/import` url: `/creditOrder/import`
} }
} }
export default { export default {
page (data, custom = {}) { page (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.page, ...apiList.page,
data, data,
custom custom
}) })
}, },
query (data, custom = {}) { query (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.query, ...apiList.query,
data, data,
custom custom
}) })
}, },
save (data, custom = {}) { save (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.save, ...apiList.save,
data, data,
custom custom
}) })
}, },
update (data, custom = {}) { update (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.update, ...apiList.update,
data, data,
custom custom
}) })
}, },
delete (data, custom = {}) { delete (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.delete, ...apiList.delete,
data, data,
custom custom
}) })
}, },
export (data, custom = {}) { export (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.export, ...apiList.export,
responseType: "blob", responseType: "blob",
data, data,
custom custom
}) })
}, },
preview (data, custom = {}) { preview (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.preview, ...apiList.preview,
data, data,
custom custom
}) })
}, },
import (data, custom = {}) { import (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.import, ...apiList.import,
data, data,
custom custom
}) })
} }
} }

192
src/api/creditGoods/CreditOrderDelivery.js

@ -1,96 +1,96 @@
import axiosApi from '../AxiosApi.js' import axiosApi from '../AxiosApi.js'
const apiList = { const apiList = {
page: { page: {
method: 'POST', method: 'POST',
url: `/store/creditOrderDelivery/page`, url: `/store/creditOrderDelivery/page`,
}, },
query: { query: {
method: 'POST', method: 'POST',
url: `/store/creditOrderDelivery/query`, url: `/store/creditOrderDelivery/query`,
}, },
update: { update: {
method: 'PUT', method: 'PUT',
url: `/store/creditOrderDelivery` url: `/store/creditOrderDelivery`
}, },
save: { save: {
method: 'POST', method: 'POST',
url: `/store/creditOrderDelivery` url: `/store/creditOrderDelivery`
}, },
delete: { delete: {
method: 'DELETE', method: 'DELETE',
url: `/store/creditOrderDelivery` url: `/store/creditOrderDelivery`
}, },
export: { export: {
method: 'POST', method: 'POST',
url: `/store/creditOrderDelivery/export` url: `/store/creditOrderDelivery/export`
}, },
preview: { preview: {
method: 'POST', method: 'POST',
url: `/store/creditOrderDelivery/preview` url: `/store/creditOrderDelivery/preview`
}, },
import: { import: {
method: 'POST', method: 'POST',
url: `/store/creditOrderDelivery/import` url: `/store/creditOrderDelivery/import`
} }
} }
export default { export default {
page (data, custom = {}) { page (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.page, ...apiList.page,
data, data,
custom custom
}) })
}, },
query (data, custom = {}) { query (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.query, ...apiList.query,
data, data,
custom custom
}) })
}, },
save (data, custom = {}) { save (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.save, ...apiList.save,
data, data,
custom custom
}) })
}, },
update (data, custom = {}) { update (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.update, ...apiList.update,
data, data,
custom custom
}) })
}, },
delete (data, custom = {}) { delete (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.delete, ...apiList.delete,
data, data,
custom custom
}) })
}, },
export (data, custom = {}) { export (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.export, ...apiList.export,
responseType: "blob", responseType: "blob",
data, data,
custom custom
}) })
}, },
preview (data, custom = {}) { preview (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.preview, ...apiList.preview,
data, data,
custom custom
}) })
}, },
import (data, custom = {}) { import (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.import, ...apiList.import,
data, data,
custom custom
}) })
} }
} }

192
src/api/creditGoods/CreditOrderDetail.js

@ -1,96 +1,96 @@
import axiosApi from '../AxiosApi.js' import axiosApi from '../AxiosApi.js'
const apiList = { const apiList = {
page: { page: {
method: 'POST', method: 'POST',
url: `/store/creditOrderDetail/page`, url: `/store/creditOrderDetail/page`,
}, },
query: { query: {
method: 'POST', method: 'POST',
url: `/store/creditOrderDetail/query`, url: `/store/creditOrderDetail/query`,
}, },
update: { update: {
method: 'PUT', method: 'PUT',
url: `/store/creditOrderDetail` url: `/store/creditOrderDetail`
}, },
save: { save: {
method: 'POST', method: 'POST',
url: `/store/creditOrderDetail` url: `/store/creditOrderDetail`
}, },
delete: { delete: {
method: 'DELETE', method: 'DELETE',
url: `/store/creditOrderDetail` url: `/store/creditOrderDetail`
}, },
export: { export: {
method: 'POST', method: 'POST',
url: `/store/creditOrderDetail/export` url: `/store/creditOrderDetail/export`
}, },
preview: { preview: {
method: 'POST', method: 'POST',
url: `/store/creditOrderDetail/preview` url: `/store/creditOrderDetail/preview`
}, },
import: { import: {
method: 'POST', method: 'POST',
url: `/store/creditOrderDetail/import` url: `/store/creditOrderDetail/import`
} }
} }
export default { export default {
page (data, custom = {}) { page (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.page, ...apiList.page,
data, data,
custom custom
}) })
}, },
query (data, custom = {}) { query (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.query, ...apiList.query,
data, data,
custom custom
}) })
}, },
save (data, custom = {}) { save (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.save, ...apiList.save,
data, data,
custom custom
}) })
}, },
update (data, custom = {}) { update (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.update, ...apiList.update,
data, data,
custom custom
}) })
}, },
delete (data, custom = {}) { delete (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.delete, ...apiList.delete,
data, data,
custom custom
}) })
}, },
export (data, custom = {}) { export (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.export, ...apiList.export,
responseType: "blob", responseType: "blob",
data, data,
custom custom
}) })
}, },
preview (data, custom = {}) { preview (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.preview, ...apiList.preview,
data, data,
custom custom
}) })
}, },
import (data, custom = {}) { import (data, custom = {}) {
return axiosApi({ return axiosApi({
...apiList.import, ...apiList.import,
data, data,
custom custom
}) })
} }
} }

222
src/components/BackToTop/index.vue

@ -1,111 +1,111 @@
<template> <template>
<transition :name="transitionName"> <transition :name="transitionName">
<div v-show="visible" :style="customStyle" class="back-to-ceiling" @click="backToTop"> <div v-show="visible" :style="customStyle" class="back-to-ceiling" @click="backToTop">
<svg width="16" height="16" viewBox="0 0 17 17" xmlns="http://www.w3.org/2000/svg" class="Icon Icon--backToTopArrow" aria-hidden="true" style="height:16px;width:16px"><path d="M12.036 15.59a1 1 0 0 1-.997.995H5.032a.996.996 0 0 1-.997-.996V8.584H1.03c-1.1 0-1.36-.633-.578-1.416L7.33.29a1.003 1.003 0 0 1 1.412 0l6.878 6.88c.782.78.523 1.415-.58 1.415h-3.004v7.004z" /></svg> <svg width="16" height="16" viewBox="0 0 17 17" xmlns="http://www.w3.org/2000/svg" class="Icon Icon--backToTopArrow" aria-hidden="true" style="height:16px;width:16px"><path d="M12.036 15.59a1 1 0 0 1-.997.995H5.032a.996.996 0 0 1-.997-.996V8.584H1.03c-1.1 0-1.36-.633-.578-1.416L7.33.29a1.003 1.003 0 0 1 1.412 0l6.878 6.88c.782.78.523 1.415-.58 1.415h-3.004v7.004z" /></svg>
</div> </div>
</transition> </transition>
</template> </template>
<script> <script>
export default { export default {
name: 'BackToTop', name: 'BackToTop',
props: { props: {
visibilityHeight: { visibilityHeight: {
type: Number, type: Number,
default: 400 default: 400
}, },
backPosition: { backPosition: {
type: Number, type: Number,
default: 0 default: 0
}, },
customStyle: { customStyle: {
type: Object, type: Object,
default: function() { default: function() {
return { return {
right: '50px', right: '50px',
bottom: '50px', bottom: '50px',
width: '40px', width: '40px',
height: '40px', height: '40px',
'border-radius': '4px', 'border-radius': '4px',
'line-height': '45px', 'line-height': '45px',
background: '#e7eaf1' background: '#e7eaf1'
} }
} }
}, },
transitionName: { transitionName: {
type: String, type: String,
default: 'fade' default: 'fade'
} }
}, },
data() { data() {
return { return {
visible: false, visible: false,
interval: null, interval: null,
isMoving: false isMoving: false
} }
}, },
mounted() { mounted() {
window.addEventListener('scroll', this.handleScroll) window.addEventListener('scroll', this.handleScroll)
}, },
beforeDestroy() { beforeDestroy() {
window.removeEventListener('scroll', this.handleScroll) window.removeEventListener('scroll', this.handleScroll)
if (this.interval) { if (this.interval) {
clearInterval(this.interval) clearInterval(this.interval)
} }
}, },
methods: { methods: {
handleScroll() { handleScroll() {
this.visible = window.pageYOffset > this.visibilityHeight this.visible = window.pageYOffset > this.visibilityHeight
}, },
backToTop() { backToTop() {
if (this.isMoving) return if (this.isMoving) return
const start = window.pageYOffset const start = window.pageYOffset
let i = 0 let i = 0
this.isMoving = true this.isMoving = true
this.interval = setInterval(() => { this.interval = setInterval(() => {
const next = Math.floor(this.easeInOutQuad(10 * i, start, -start, 500)) const next = Math.floor(this.easeInOutQuad(10 * i, start, -start, 500))
if (next <= this.backPosition) { if (next <= this.backPosition) {
window.scrollTo(0, this.backPosition) window.scrollTo(0, this.backPosition)
clearInterval(this.interval) clearInterval(this.interval)
this.isMoving = false this.isMoving = false
} else { } else {
window.scrollTo(0, next) window.scrollTo(0, next)
} }
i++ i++
}, 16.7) }, 16.7)
}, },
easeInOutQuad(t, b, c, d) { easeInOutQuad(t, b, c, d) {
if ((t /= d / 2) < 1) return c / 2 * t * t + b if ((t /= d / 2) < 1) return c / 2 * t * t + b
return -c / 2 * (--t * (t - 2) - 1) + b return -c / 2 * (--t * (t - 2) - 1) + b
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
.back-to-ceiling { .back-to-ceiling {
position: fixed; position: fixed;
display: inline-block; display: inline-block;
text-align: center; text-align: center;
cursor: pointer; cursor: pointer;
} }
.back-to-ceiling:hover { .back-to-ceiling:hover {
background: #d5dbe7; background: #d5dbe7;
} }
.fade-enter-active, .fade-enter-active,
.fade-leave-active { .fade-leave-active {
transition: opacity .5s; transition: opacity .5s;
} }
.fade-enter, .fade-enter,
.fade-leave-to { .fade-leave-to {
opacity: 0 opacity: 0
} }
.back-to-ceiling .Icon { .back-to-ceiling .Icon {
fill: #9aaabf; fill: #9aaabf;
background: none; background: none;
} }
</style> </style>

170
src/components/Breadcrumb/index.vue

@ -1,85 +1,85 @@
<template> <template>
<el-breadcrumb class="app-breadcrumb" separator="/"> <el-breadcrumb class="app-breadcrumb" separator="/">
<transition-group name="breadcrumb"> <transition-group name="breadcrumb">
<el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path"> <el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path">
<span v-if="item.redirect==='noRedirect'||index==levelList.length-1" class="no-redirect">{{ <span v-if="item.redirect==='noRedirect'||index==levelList.length-1" class="no-redirect">{{
generateTitle(item.meta.title) }}</span> generateTitle(item.meta.title) }}</span>
<a v-else @click.prevent="handleLink(item)">{{ generateTitle(item.meta.title) }}</a> <a v-else @click.prevent="handleLink(item)">{{ generateTitle(item.meta.title) }}</a>
</el-breadcrumb-item> </el-breadcrumb-item>
</transition-group> </transition-group>
</el-breadcrumb> </el-breadcrumb>
</template> </template>
<script> <script>
import { generateTitle } from '@/utils/i18n' import { generateTitle } from '@/utils/i18n'
import pathToRegexp from 'path-to-regexp' import pathToRegexp from 'path-to-regexp'
export default { export default {
data() { data() {
return { return {
levelList: null levelList: null
} }
}, },
watch: { watch: {
$route(route) { $route(route) {
// if you go to the redirect page, do not update the breadcrumbs // if you go to the redirect page, do not update the breadcrumbs
if (route.path.startsWith('/redirect/')) { if (route.path.startsWith('/redirect/')) {
return return
} }
this.getBreadcrumb() this.getBreadcrumb()
} }
}, },
created() { created() {
this.getBreadcrumb() this.getBreadcrumb()
}, },
methods: { methods: {
generateTitle, generateTitle,
getBreadcrumb() { getBreadcrumb() {
// only show routes with meta.title // only show routes with meta.title
let matched = this.$route.matched.filter(item => item.meta && item.meta.title) let matched = this.$route.matched.filter(item => item.meta && item.meta.title)
const first = matched[0] const first = matched[0]
if (!this.isDashboard(first)) { if (!this.isDashboard(first)) {
matched = [{ path: '/dashboard', meta: { title: 'dashboard' }}].concat(matched) matched = [{ path: '/dashboard', meta: { title: 'dashboard' }}].concat(matched)
} }
this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false) this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)
}, },
isDashboard(route) { isDashboard(route) {
const name = route && route.name const name = route && route.name
if (!name) { if (!name) {
return false return false
} }
return name.trim().toLocaleLowerCase() === 'Dashboard'.toLocaleLowerCase() return name.trim().toLocaleLowerCase() === 'Dashboard'.toLocaleLowerCase()
}, },
pathCompile(path) { pathCompile(path) {
// To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561 // To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561
const { params } = this.$route const { params } = this.$route
var toPath = pathToRegexp.compile(path) var toPath = pathToRegexp.compile(path)
return toPath(params) return toPath(params)
}, },
handleLink(item) { handleLink(item) {
const { redirect, path } = item const { redirect, path } = item
if (redirect) { if (redirect) {
this.$router.push(redirect) this.$router.push(redirect)
return return
} }
this.$router.push(this.pathCompile(path)) this.$router.push(this.pathCompile(path))
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.app-breadcrumb.el-breadcrumb { .app-breadcrumb.el-breadcrumb {
display: inline-block; display: inline-block;
font-size: 14px; font-size: 14px;
line-height: 50px; line-height: 50px;
margin-left: 8px; margin-left: 8px;
.no-redirect { .no-redirect {
color: #97a8be; color: #97a8be;
cursor: text; cursor: text;
} }
} }
</style> </style>

310
src/components/Charts/Keyboard.vue

@ -1,155 +1,155 @@
<template> <template>
<div :id="id" :class="className" :style="{height:height,width:width}" /> <div :id="id" :class="className" :style="{height:height,width:width}" />
</template> </template>
<script> <script>
import echarts from 'echarts' import echarts from 'echarts'
import resize from './mixins/resize' import resize from './mixins/resize'
export default { export default {
mixins: [resize], mixins: [resize],
props: { props: {
className: { className: {
type: String, type: String,
default: 'chart' default: 'chart'
}, },
id: { id: {
type: String, type: String,
default: 'chart' default: 'chart'
}, },
width: { width: {
type: String, type: String,
default: '200px' default: '200px'
}, },
height: { height: {
type: String, type: String,
default: '200px' default: '200px'
} }
}, },
data() { data() {
return { return {
chart: null chart: null
} }
}, },
mounted() { mounted() {
this.initChart() this.initChart()
}, },
beforeDestroy() { beforeDestroy() {
if (!this.chart) { if (!this.chart) {
return return
} }
this.chart.dispose() this.chart.dispose()
this.chart = null this.chart = null
}, },
methods: { methods: {
initChart() { initChart() {
this.chart = echarts.init(document.getElementById(this.id)) this.chart = echarts.init(document.getElementById(this.id))
const xAxisData = [] const xAxisData = []
const data = [] const data = []
const data2 = [] const data2 = []
for (let i = 0; i < 50; i++) { for (let i = 0; i < 50; i++) {
xAxisData.push(i) xAxisData.push(i)
data.push((Math.sin(i / 5) * (i / 5 - 10) + i / 6) * 5) data.push((Math.sin(i / 5) * (i / 5 - 10) + i / 6) * 5)
data2.push((Math.sin(i / 5) * (i / 5 + 10) + i / 6) * 3) data2.push((Math.sin(i / 5) * (i / 5 + 10) + i / 6) * 3)
} }
this.chart.setOption({ this.chart.setOption({
backgroundColor: '#08263a', backgroundColor: '#08263a',
grid: { grid: {
left: '5%', left: '5%',
right: '5%' right: '5%'
}, },
xAxis: [{ xAxis: [{
show: false, show: false,
data: xAxisData data: xAxisData
}, { }, {
show: false, show: false,
data: xAxisData data: xAxisData
}], }],
visualMap: { visualMap: {
show: false, show: false,
min: 0, min: 0,
max: 50, max: 50,
dimension: 0, dimension: 0,
inRange: { inRange: {
color: ['#4a657a', '#308e92', '#b1cfa5', '#f5d69f', '#f5898b', '#ef5055'] color: ['#4a657a', '#308e92', '#b1cfa5', '#f5d69f', '#f5898b', '#ef5055']
} }
}, },
yAxis: { yAxis: {
axisLine: { axisLine: {
show: false show: false
}, },
axisLabel: { axisLabel: {
textStyle: { textStyle: {
color: '#4a657a' color: '#4a657a'
} }
}, },
splitLine: { splitLine: {
show: true, show: true,
lineStyle: { lineStyle: {
color: '#08263f' color: '#08263f'
} }
}, },
axisTick: { axisTick: {
show: false show: false
} }
}, },
series: [{ series: [{
name: 'back', name: 'back',
type: 'bar', type: 'bar',
data: data2, data: data2,
z: 1, z: 1,
itemStyle: { itemStyle: {
normal: { normal: {
opacity: 0.4, opacity: 0.4,
barBorderRadius: 5, barBorderRadius: 5,
shadowBlur: 3, shadowBlur: 3,
shadowColor: '#111' shadowColor: '#111'
} }
} }
}, { }, {
name: 'Simulate Shadow', name: 'Simulate Shadow',
type: 'line', type: 'line',
data, data,
z: 2, z: 2,
showSymbol: false, showSymbol: false,
animationDelay: 0, animationDelay: 0,
animationEasing: 'linear', animationEasing: 'linear',
animationDuration: 1200, animationDuration: 1200,
lineStyle: { lineStyle: {
normal: { normal: {
color: 'transparent' color: 'transparent'
} }
}, },
areaStyle: { areaStyle: {
normal: { normal: {
color: '#08263a', color: '#08263a',
shadowBlur: 50, shadowBlur: 50,
shadowColor: '#000' shadowColor: '#000'
} }
} }
}, { }, {
name: 'front', name: 'front',
type: 'bar', type: 'bar',
data, data,
xAxisIndex: 1, xAxisIndex: 1,
z: 3, z: 3,
itemStyle: { itemStyle: {
normal: { normal: {
barBorderRadius: 5 barBorderRadius: 5
} }
} }
}], }],
animationEasing: 'elasticOut', animationEasing: 'elasticOut',
animationEasingUpdate: 'elasticOut', animationEasingUpdate: 'elasticOut',
animationDelay(idx) { animationDelay(idx) {
return idx * 20 return idx * 20
}, },
animationDelayUpdate(idx) { animationDelayUpdate(idx) {
return idx * 20 return idx * 20
} }
}) })
} }
} }
} }
</script> </script>

454
src/components/Charts/LineMarker.vue

@ -1,227 +1,227 @@
<template> <template>
<div :id="id" :class="className" :style="{height:height,width:width}" /> <div :id="id" :class="className" :style="{height:height,width:width}" />
</template> </template>
<script> <script>
import echarts from 'echarts' import echarts from 'echarts'
import resize from './mixins/resize' import resize from './mixins/resize'
export default { export default {
mixins: [resize], mixins: [resize],
props: { props: {
className: { className: {
type: String, type: String,
default: 'chart' default: 'chart'
}, },
id: { id: {
type: String, type: String,
default: 'chart' default: 'chart'
}, },
width: { width: {
type: String, type: String,
default: '200px' default: '200px'
}, },
height: { height: {
type: String, type: String,
default: '200px' default: '200px'
} }
}, },
data() { data() {
return { return {
chart: null chart: null
} }
}, },
mounted() { mounted() {
this.initChart() this.initChart()
}, },
beforeDestroy() { beforeDestroy() {
if (!this.chart) { if (!this.chart) {
return return
} }
this.chart.dispose() this.chart.dispose()
this.chart = null this.chart = null
}, },
methods: { methods: {
initChart() { initChart() {
this.chart = echarts.init(document.getElementById(this.id)) this.chart = echarts.init(document.getElementById(this.id))
this.chart.setOption({ this.chart.setOption({
backgroundColor: '#394056', backgroundColor: '#394056',
title: { title: {
top: 20, top: 20,
text: 'Requests', text: 'Requests',
textStyle: { textStyle: {
fontWeight: 'normal', fontWeight: 'normal',
fontSize: 16, fontSize: 16,
color: '#F1F1F3' color: '#F1F1F3'
}, },
left: '1%' left: '1%'
}, },
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
axisPointer: { axisPointer: {
lineStyle: { lineStyle: {
color: '#57617B' color: '#57617B'
} }
} }
}, },
legend: { legend: {
top: 20, top: 20,
icon: 'rect', icon: 'rect',
itemWidth: 14, itemWidth: 14,
itemHeight: 5, itemHeight: 5,
itemGap: 13, itemGap: 13,
data: ['CMCC', 'CTCC', 'CUCC'], data: ['CMCC', 'CTCC', 'CUCC'],
right: '4%', right: '4%',
textStyle: { textStyle: {
fontSize: 12, fontSize: 12,
color: '#F1F1F3' color: '#F1F1F3'
} }
}, },
grid: { grid: {
top: 100, top: 100,
left: '2%', left: '2%',
right: '2%', right: '2%',
bottom: '2%', bottom: '2%',
containLabel: true containLabel: true
}, },
xAxis: [{ xAxis: [{
type: 'category', type: 'category',
boundaryGap: false, boundaryGap: false,
axisLine: { axisLine: {
lineStyle: { lineStyle: {
color: '#57617B' color: '#57617B'
} }
}, },
data: ['13:00', '13:05', '13:10', '13:15', '13:20', '13:25', '13:30', '13:35', '13:40', '13:45', '13:50', '13:55'] data: ['13:00', '13:05', '13:10', '13:15', '13:20', '13:25', '13:30', '13:35', '13:40', '13:45', '13:50', '13:55']
}], }],
yAxis: [{ yAxis: [{
type: 'value', type: 'value',
name: '(%)', name: '(%)',
axisTick: { axisTick: {
show: false show: false
}, },
axisLine: { axisLine: {
lineStyle: { lineStyle: {
color: '#57617B' color: '#57617B'
} }
}, },
axisLabel: { axisLabel: {
margin: 10, margin: 10,
textStyle: { textStyle: {
fontSize: 14 fontSize: 14
} }
}, },
splitLine: { splitLine: {
lineStyle: { lineStyle: {
color: '#57617B' color: '#57617B'
} }
} }
}], }],
series: [{ series: [{
name: 'CMCC', name: 'CMCC',
type: 'line', type: 'line',
smooth: true, smooth: true,
symbol: 'circle', symbol: 'circle',
symbolSize: 5, symbolSize: 5,
showSymbol: false, showSymbol: false,
lineStyle: { lineStyle: {
normal: { normal: {
width: 1 width: 1
} }
}, },
areaStyle: { areaStyle: {
normal: { normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0, offset: 0,
color: 'rgba(137, 189, 27, 0.3)' color: 'rgba(137, 189, 27, 0.3)'
}, { }, {
offset: 0.8, offset: 0.8,
color: 'rgba(137, 189, 27, 0)' color: 'rgba(137, 189, 27, 0)'
}], false), }], false),
shadowColor: 'rgba(0, 0, 0, 0.1)', shadowColor: 'rgba(0, 0, 0, 0.1)',
shadowBlur: 10 shadowBlur: 10
} }
}, },
itemStyle: { itemStyle: {
normal: { normal: {
color: 'rgb(137,189,27)', color: 'rgb(137,189,27)',
borderColor: 'rgba(137,189,2,0.27)', borderColor: 'rgba(137,189,2,0.27)',
borderWidth: 12 borderWidth: 12
} }
}, },
data: [220, 182, 191, 134, 150, 120, 110, 125, 145, 122, 165, 122] data: [220, 182, 191, 134, 150, 120, 110, 125, 145, 122, 165, 122]
}, { }, {
name: 'CTCC', name: 'CTCC',
type: 'line', type: 'line',
smooth: true, smooth: true,
symbol: 'circle', symbol: 'circle',
symbolSize: 5, symbolSize: 5,
showSymbol: false, showSymbol: false,
lineStyle: { lineStyle: {
normal: { normal: {
width: 1 width: 1
} }
}, },
areaStyle: { areaStyle: {
normal: { normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0, offset: 0,
color: 'rgba(0, 136, 212, 0.3)' color: 'rgba(0, 136, 212, 0.3)'
}, { }, {
offset: 0.8, offset: 0.8,
color: 'rgba(0, 136, 212, 0)' color: 'rgba(0, 136, 212, 0)'
}], false), }], false),
shadowColor: 'rgba(0, 0, 0, 0.1)', shadowColor: 'rgba(0, 0, 0, 0.1)',
shadowBlur: 10 shadowBlur: 10
} }
}, },
itemStyle: { itemStyle: {
normal: { normal: {
color: 'rgb(0,136,212)', color: 'rgb(0,136,212)',
borderColor: 'rgba(0,136,212,0.2)', borderColor: 'rgba(0,136,212,0.2)',
borderWidth: 12 borderWidth: 12
} }
}, },
data: [120, 110, 125, 145, 122, 165, 122, 220, 182, 191, 134, 150] data: [120, 110, 125, 145, 122, 165, 122, 220, 182, 191, 134, 150]
}, { }, {
name: 'CUCC', name: 'CUCC',
type: 'line', type: 'line',
smooth: true, smooth: true,
symbol: 'circle', symbol: 'circle',
symbolSize: 5, symbolSize: 5,
showSymbol: false, showSymbol: false,
lineStyle: { lineStyle: {
normal: { normal: {
width: 1 width: 1
} }
}, },
areaStyle: { areaStyle: {
normal: { normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0, offset: 0,
color: 'rgba(219, 50, 51, 0.3)' color: 'rgba(219, 50, 51, 0.3)'
}, { }, {
offset: 0.8, offset: 0.8,
color: 'rgba(219, 50, 51, 0)' color: 'rgba(219, 50, 51, 0)'
}], false), }], false),
shadowColor: 'rgba(0, 0, 0, 0.1)', shadowColor: 'rgba(0, 0, 0, 0.1)',
shadowBlur: 10 shadowBlur: 10
} }
}, },
itemStyle: { itemStyle: {
normal: { normal: {
color: 'rgb(219,50,51)', color: 'rgb(219,50,51)',
borderColor: 'rgba(219,50,51,0.2)', borderColor: 'rgba(219,50,51,0.2)',
borderWidth: 12 borderWidth: 12
} }
}, },
data: [220, 182, 125, 145, 122, 191, 134, 150, 120, 110, 165, 122] data: [220, 182, 125, 145, 122, 191, 134, 150, 120, 110, 165, 122]
}] }]
}) })
} }
} }
} }
</script> </script>

542
src/components/Charts/MixChart.vue

@ -1,271 +1,271 @@
<template> <template>
<div :id="id" :class="className" :style="{height:height,width:width}" /> <div :id="id" :class="className" :style="{height:height,width:width}" />
</template> </template>
<script> <script>
import echarts from 'echarts' import echarts from 'echarts'
import resize from './mixins/resize' import resize from './mixins/resize'
export default { export default {
mixins: [resize], mixins: [resize],
props: { props: {
className: { className: {
type: String, type: String,
default: 'chart' default: 'chart'
}, },
id: { id: {
type: String, type: String,
default: 'chart' default: 'chart'
}, },
width: { width: {
type: String, type: String,
default: '200px' default: '200px'
}, },
height: { height: {
type: String, type: String,
default: '200px' default: '200px'
} }
}, },
data() { data() {
return { return {
chart: null chart: null
} }
}, },
mounted() { mounted() {
this.initChart() this.initChart()
}, },
beforeDestroy() { beforeDestroy() {
if (!this.chart) { if (!this.chart) {
return return
} }
this.chart.dispose() this.chart.dispose()
this.chart = null this.chart = null
}, },
methods: { methods: {
initChart() { initChart() {
this.chart = echarts.init(document.getElementById(this.id)) this.chart = echarts.init(document.getElementById(this.id))
const xData = (function() { const xData = (function() {
const data = [] const data = []
for (let i = 1; i < 13; i++) { for (let i = 1; i < 13; i++) {
data.push(i + 'month') data.push(i + 'month')
} }
return data return data
}()) }())
this.chart.setOption({ this.chart.setOption({
backgroundColor: '#344b58', backgroundColor: '#344b58',
title: { title: {
text: 'statistics', text: 'statistics',
x: '20', x: '20',
top: '20', top: '20',
textStyle: { textStyle: {
color: '#fff', color: '#fff',
fontSize: '22' fontSize: '22'
}, },
subtextStyle: { subtextStyle: {
color: '#90979c', color: '#90979c',
fontSize: '16' fontSize: '16'
} }
}, },
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
axisPointer: { axisPointer: {
textStyle: { textStyle: {
color: '#fff' color: '#fff'
} }
} }
}, },
grid: { grid: {
left: '5%', left: '5%',
right: '5%', right: '5%',
borderWidth: 0, borderWidth: 0,
top: 150, top: 150,
bottom: 95, bottom: 95,
textStyle: { textStyle: {
color: '#fff' color: '#fff'
} }
}, },
legend: { legend: {
x: '5%', x: '5%',
top: '10%', top: '10%',
textStyle: { textStyle: {
color: '#90979c' color: '#90979c'
}, },
data: ['female', 'male', 'average'] data: ['female', 'male', 'average']
}, },
calculable: true, calculable: true,
xAxis: [{ xAxis: [{
type: 'category', type: 'category',
axisLine: { axisLine: {
lineStyle: { lineStyle: {
color: '#90979c' color: '#90979c'
} }
}, },
splitLine: { splitLine: {
show: false show: false
}, },
axisTick: { axisTick: {
show: false show: false
}, },
splitArea: { splitArea: {
show: false show: false
}, },
axisLabel: { axisLabel: {
interval: 0 interval: 0
}, },
data: xData data: xData
}], }],
yAxis: [{ yAxis: [{
type: 'value', type: 'value',
splitLine: { splitLine: {
show: false show: false
}, },
axisLine: { axisLine: {
lineStyle: { lineStyle: {
color: '#90979c' color: '#90979c'
} }
}, },
axisTick: { axisTick: {
show: false show: false
}, },
axisLabel: { axisLabel: {
interval: 0 interval: 0
}, },
splitArea: { splitArea: {
show: false show: false
} }
}], }],
dataZoom: [{ dataZoom: [{
show: true, show: true,
height: 30, height: 30,
xAxisIndex: [ xAxisIndex: [
0 0
], ],
bottom: 30, bottom: 30,
start: 10, start: 10,
end: 80, end: 80,
handleIcon: 'path://M306.1,413c0,2.2-1.8,4-4,4h-59.8c-2.2,0-4-1.8-4-4V200.8c0-2.2,1.8-4,4-4h59.8c2.2,0,4,1.8,4,4V413z', handleIcon: 'path://M306.1,413c0,2.2-1.8,4-4,4h-59.8c-2.2,0-4-1.8-4-4V200.8c0-2.2,1.8-4,4-4h59.8c2.2,0,4,1.8,4,4V413z',
handleSize: '110%', handleSize: '110%',
handleStyle: { handleStyle: {
color: '#d3dee5' color: '#d3dee5'
}, },
textStyle: { textStyle: {
color: '#fff' }, color: '#fff' },
borderColor: '#90979c' borderColor: '#90979c'
}, { }, {
type: 'inside', type: 'inside',
show: true, show: true,
height: 15, height: 15,
start: 1, start: 1,
end: 35 end: 35
}], }],
series: [{ series: [{
name: 'female', name: 'female',
type: 'bar', type: 'bar',
stack: 'total', stack: 'total',
barMaxWidth: 35, barMaxWidth: 35,
barGap: '10%', barGap: '10%',
itemStyle: { itemStyle: {
normal: { normal: {
color: 'rgba(255,144,128,1)', color: 'rgba(255,144,128,1)',
label: { label: {
show: true, show: true,
textStyle: { textStyle: {
color: '#fff' color: '#fff'
}, },
position: 'insideTop', position: 'insideTop',
formatter(p) { formatter(p) {
return p.value > 0 ? p.value : '' return p.value > 0 ? p.value : ''
} }
} }
} }
}, },
data: [ data: [
709, 709,
1917, 1917,
2455, 2455,
2610, 2610,
1719, 1719,
1433, 1433,
1544, 1544,
3285, 3285,
5208, 5208,
3372, 3372,
2484, 2484,
4078 4078
] ]
}, },
{ {
name: 'male', name: 'male',
type: 'bar', type: 'bar',
stack: 'total', stack: 'total',
itemStyle: { itemStyle: {
normal: { normal: {
color: 'rgba(0,191,183,1)', color: 'rgba(0,191,183,1)',
barBorderRadius: 0, barBorderRadius: 0,
label: { label: {
show: true, show: true,
position: 'top', position: 'top',
formatter(p) { formatter(p) {
return p.value > 0 ? p.value : '' return p.value > 0 ? p.value : ''
} }
} }
} }
}, },
data: [ data: [
327, 327,
1776, 1776,
507, 507,
1200, 1200,
800, 800,
482, 482,
204, 204,
1390, 1390,
1001, 1001,
951, 951,
381, 381,
220 220
] ]
}, { }, {
name: 'average', name: 'average',
type: 'line', type: 'line',
stack: 'total', stack: 'total',
symbolSize: 10, symbolSize: 10,
symbol: 'circle', symbol: 'circle',
itemStyle: { itemStyle: {
normal: { normal: {
color: 'rgba(252,230,48,1)', color: 'rgba(252,230,48,1)',
barBorderRadius: 0, barBorderRadius: 0,
label: { label: {
show: true, show: true,
position: 'top', position: 'top',
formatter(p) { formatter(p) {
return p.value > 0 ? p.value : '' return p.value > 0 ? p.value : ''
} }
} }
} }
}, },
data: [ data: [
1036, 1036,
3693, 3693,
2962, 2962,
3810, 3810,
2519, 2519,
1915, 1915,
1748, 1748,
4675, 4675,
6209, 6209,
4323, 4323,
2865, 2865,
4298 4298
] ]
} }
] ]
}) })
} }
} }
} }
</script> </script>

68
src/components/Charts/mixins/resize.js

@ -1,34 +1,34 @@
import { debounce } from '@/utils' import { debounce } from '@/utils'
export default { export default {
data() { data() {
return { return {
$_sidebarElm: null $_sidebarElm: null
} }
}, },
mounted() { mounted() {
this.__resizeHandler = debounce(() => { this.__resizeHandler = debounce(() => {
if (this.chart) { if (this.chart) {
this.chart.resize() this.chart.resize()
} }
}, 100) }, 100)
window.addEventListener('resize', this.__resizeHandler) window.addEventListener('resize', this.__resizeHandler)
this.$_sidebarElm = document.getElementsByClassName('sidebar-container')[0] this.$_sidebarElm = document.getElementsByClassName('sidebar-container')[0]
this.$_sidebarElm && this.$_sidebarElm.addEventListener('transitionend', this.$_sidebarResizeHandler) this.$_sidebarElm && this.$_sidebarElm.addEventListener('transitionend', this.$_sidebarResizeHandler)
}, },
beforeDestroy() { beforeDestroy() {
window.removeEventListener('resize', this.__resizeHandler) window.removeEventListener('resize', this.__resizeHandler)
this.$_sidebarElm && this.$_sidebarElm.removeEventListener('transitionend', this.$_sidebarResizeHandler) this.$_sidebarElm && this.$_sidebarElm.removeEventListener('transitionend', this.$_sidebarResizeHandler)
}, },
methods: { methods: {
// use $_ for mixins properties // use $_ for mixins properties
// https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential
$_sidebarResizeHandler(e) { $_sidebarResizeHandler(e) {
if (e.propertyName === 'width') { if (e.propertyName === 'width') {
this.__resizeHandler() this.__resizeHandler()
} }
} }
} }
} }

332
src/components/DndList/index.vue

@ -1,166 +1,166 @@
<template> <template>
<div class="dndList"> <div class="dndList">
<div :style="{width:width1}" class="dndList-list"> <div :style="{width:width1}" class="dndList-list">
<h3>{{ list1Title }}</h3> <h3>{{ list1Title }}</h3>
<draggable :set-data="setData" :list="list1" group="article" class="dragArea"> <draggable :set-data="setData" :list="list1" group="article" class="dragArea">
<div v-for="element in list1" :key="element.id" class="list-complete-item"> <div v-for="element in list1" :key="element.id" class="list-complete-item">
<div class="list-complete-item-handle"> <div class="list-complete-item-handle">
{{ element.id }}[{{ element.author }}] {{ element.title }} {{ element.id }}[{{ element.author }}] {{ element.title }}
</div> </div>
<div style="position:absolute;right:0px;"> <div style="position:absolute;right:0px;">
<span style="float: right ;margin-top: -20px;margin-right:5px;" @click="deleteEle(element)"> <span style="float: right ;margin-top: -20px;margin-right:5px;" @click="deleteEle(element)">
<i style="color:#ff4949" class="el-icon-delete" /> <i style="color:#ff4949" class="el-icon-delete" />
</span> </span>
</div> </div>
</div> </div>
</draggable> </draggable>
</div> </div>
<div :style="{width:width2}" class="dndList-list"> <div :style="{width:width2}" class="dndList-list">
<h3>{{ list2Title }}</h3> <h3>{{ list2Title }}</h3>
<draggable :list="list2" group="article" class="dragArea"> <draggable :list="list2" group="article" class="dragArea">
<div v-for="element in list2" :key="element.id" class="list-complete-item"> <div v-for="element in list2" :key="element.id" class="list-complete-item">
<div class="list-complete-item-handle2" @click="pushEle(element)"> <div class="list-complete-item-handle2" @click="pushEle(element)">
{{ element.id }} [{{ element.author }}] {{ element.title }} {{ element.id }} [{{ element.author }}] {{ element.title }}
</div> </div>
</div> </div>
</draggable> </draggable>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import draggable from 'vuedraggable' import draggable from 'vuedraggable'
export default { export default {
name: 'DndList', name: 'DndList',
components: { draggable }, components: { draggable },
props: { props: {
list1: { list1: {
type: Array, type: Array,
default() { default() {
return [] return []
} }
}, },
list2: { list2: {
type: Array, type: Array,
default() { default() {
return [] return []
} }
}, },
list1Title: { list1Title: {
type: String, type: String,
default: 'list1' default: 'list1'
}, },
list2Title: { list2Title: {
type: String, type: String,
default: 'list2' default: 'list2'
}, },
width1: { width1: {
type: String, type: String,
default: '48%' default: '48%'
}, },
width2: { width2: {
type: String, type: String,
default: '48%' default: '48%'
} }
}, },
methods: { methods: {
isNotInList1(v) { isNotInList1(v) {
return this.list1.every(k => v.id !== k.id) return this.list1.every(k => v.id !== k.id)
}, },
isNotInList2(v) { isNotInList2(v) {
return this.list2.every(k => v.id !== k.id) return this.list2.every(k => v.id !== k.id)
}, },
deleteEle(ele) { deleteEle(ele) {
for (const item of this.list1) { for (const item of this.list1) {
if (item.id === ele.id) { if (item.id === ele.id) {
const index = this.list1.indexOf(item) const index = this.list1.indexOf(item)
this.list1.splice(index, 1) this.list1.splice(index, 1)
break break
} }
} }
if (this.isNotInList2(ele)) { if (this.isNotInList2(ele)) {
this.list2.unshift(ele) this.list2.unshift(ele)
} }
}, },
pushEle(ele) { pushEle(ele) {
for (const item of this.list2) { for (const item of this.list2) {
if (item.id === ele.id) { if (item.id === ele.id) {
const index = this.list2.indexOf(item) const index = this.list2.indexOf(item)
this.list2.splice(index, 1) this.list2.splice(index, 1)
break break
} }
} }
if (this.isNotInList1(ele)) { if (this.isNotInList1(ele)) {
this.list1.push(ele) this.list1.push(ele)
} }
}, },
setData(dataTransfer) { setData(dataTransfer) {
// to avoid Firefox bug // to avoid Firefox bug
// Detail see : https://github.com/RubaXa/Sortable/issues/1012 // Detail see : https://github.com/RubaXa/Sortable/issues/1012
dataTransfer.setData('Text', '') dataTransfer.setData('Text', '')
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.dndList { .dndList {
background: #fff; background: #fff;
padding-bottom: 40px; padding-bottom: 40px;
&:after { &:after {
content: ""; content: "";
display: table; display: table;
clear: both; clear: both;
} }
.dndList-list { .dndList-list {
float: left; float: left;
padding-bottom: 30px; padding-bottom: 30px;
&:first-of-type { &:first-of-type {
margin-right: 2%; margin-right: 2%;
} }
.dragArea { .dragArea {
margin-top: 15px; margin-top: 15px;
min-height: 50px; min-height: 50px;
padding-bottom: 30px; padding-bottom: 30px;
} }
} }
} }
.list-complete-item { .list-complete-item {
cursor: pointer; cursor: pointer;
position: relative; position: relative;
font-size: 14px; font-size: 14px;
padding: 5px 12px; padding: 5px 12px;
margin-top: 4px; margin-top: 4px;
border: 1px solid #bfcbd9; border: 1px solid #bfcbd9;
transition: all 1s; transition: all 1s;
} }
.list-complete-item-handle { .list-complete-item-handle {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
margin-right: 50px; margin-right: 50px;
} }
.list-complete-item-handle2 { .list-complete-item-handle2 {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
margin-right: 20px; margin-right: 20px;
} }
.list-complete-item.sortable-chosen { .list-complete-item.sortable-chosen {
background: #4AB7BD; background: #4AB7BD;
} }
.list-complete-item.sortable-ghost { .list-complete-item.sortable-ghost {
background: #30B08F; background: #30B08F;
} }
.list-complete-enter, .list-complete-enter,
.list-complete-leave-active { .list-complete-leave-active {
opacity: 0; opacity: 0;
} }
</style> </style>

122
src/components/DragSelect/index.vue

@ -1,61 +1,61 @@
<template> <template>
<el-select ref="dragSelect" v-model="selectVal" v-bind="$attrs" class="drag-select" multiple v-on="$listeners"> <el-select ref="dragSelect" v-model="selectVal" v-bind="$attrs" class="drag-select" multiple v-on="$listeners">
<slot /> <slot />
</el-select> </el-select>
</template> </template>
<script> <script>
import Sortable from 'sortablejs' import Sortable from 'sortablejs'
export default { export default {
name: 'DragSelect', name: 'DragSelect',
props: { props: {
value: { value: {
type: Array, type: Array,
required: true required: true
} }
}, },
computed: { computed: {
selectVal: { selectVal: {
get() { get() {
return [...this.value] return [...this.value]
}, },
set(val) { set(val) {
this.$emit('input', [...val]) this.$emit('input', [...val])
} }
} }
}, },
mounted() { mounted() {
this.setSort() this.setSort()
}, },
methods: { methods: {
setSort() { setSort() {
const el = this.$refs.dragSelect.$el.querySelectorAll('.el-select__tags > span')[0] const el = this.$refs.dragSelect.$el.querySelectorAll('.el-select__tags > span')[0]
this.sortable = Sortable.create(el, { this.sortable = Sortable.create(el, {
ghostClass: 'sortable-ghost', // Class name for the drop placeholder, ghostClass: 'sortable-ghost', // Class name for the drop placeholder,
setData: function(dataTransfer) { setData: function(dataTransfer) {
dataTransfer.setData('Text', '') dataTransfer.setData('Text', '')
// to avoid Firefox bug // to avoid Firefox bug
// Detail see : https://github.com/RubaXa/Sortable/issues/1012 // Detail see : https://github.com/RubaXa/Sortable/issues/1012
}, },
onEnd: evt => { onEnd: evt => {
const targetRow = this.value.splice(evt.oldIndex, 1)[0] const targetRow = this.value.splice(evt.oldIndex, 1)[0]
this.value.splice(evt.newIndex, 0, targetRow) this.value.splice(evt.newIndex, 0, targetRow)
} }
}) })
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
.drag-select >>> .sortable-ghost { .drag-select >>> .sortable-ghost {
opacity: .8; opacity: .8;
color: #fff!important; color: #fff!important;
background: #42b983!important; background: #42b983!important;
} }
.drag-select >>> .el-tag { .drag-select >>> .el-tag {
cursor: pointer; cursor: pointer;
} }
</style> </style>

594
src/components/Dropzone/index.vue

@ -1,297 +1,297 @@
<template> <template>
<div :id="id" :ref="id" :action="url" class="dropzone"> <div :id="id" :ref="id" :action="url" class="dropzone">
<input type="file" name="file"> <input type="file" name="file">
</div> </div>
</template> </template>
<script> <script>
import Dropzone from 'dropzone' import Dropzone from 'dropzone'
import 'dropzone/dist/dropzone.css' import 'dropzone/dist/dropzone.css'
// import { getToken } from 'api/qiniu'; // import { getToken } from 'api/qiniu';
Dropzone.autoDiscover = false Dropzone.autoDiscover = false
export default { export default {
props: { props: {
id: { id: {
type: String, type: String,
required: true required: true
}, },
url: { url: {
type: String, type: String,
required: true required: true
}, },
clickable: { clickable: {
type: Boolean, type: Boolean,
default: true default: true
}, },
defaultMsg: { defaultMsg: {
type: String, type: String,
default: '上传图片' default: '上传图片'
}, },
acceptedFiles: { acceptedFiles: {
type: String, type: String,
default: '' default: ''
}, },
thumbnailHeight: { thumbnailHeight: {
type: Number, type: Number,
default: 200 default: 200
}, },
thumbnailWidth: { thumbnailWidth: {
type: Number, type: Number,
default: 200 default: 200
}, },
showRemoveLink: { showRemoveLink: {
type: Boolean, type: Boolean,
default: true default: true
}, },
maxFilesize: { maxFilesize: {
type: Number, type: Number,
default: 2 default: 2
}, },
maxFiles: { maxFiles: {
type: Number, type: Number,
default: 3 default: 3
}, },
autoProcessQueue: { autoProcessQueue: {
type: Boolean, type: Boolean,
default: true default: true
}, },
useCustomDropzoneOptions: { useCustomDropzoneOptions: {
type: Boolean, type: Boolean,
default: false default: false
}, },
defaultImg: { defaultImg: {
default: '', default: '',
type: [String, Array] type: [String, Array]
}, },
couldPaste: { couldPaste: {
type: Boolean, type: Boolean,
default: false default: false
} }
}, },
data() { data() {
return { return {
dropzone: '', dropzone: '',
initOnce: true initOnce: true
} }
}, },
watch: { watch: {
defaultImg(val) { defaultImg(val) {
if (val.length === 0) { if (val.length === 0) {
this.initOnce = false this.initOnce = false
return return
} }
if (!this.initOnce) return if (!this.initOnce) return
this.initImages(val) this.initImages(val)
this.initOnce = false this.initOnce = false
} }
}, },
mounted() { mounted() {
const element = document.getElementById(this.id) const element = document.getElementById(this.id)
const vm = this const vm = this
this.dropzone = new Dropzone(element, { this.dropzone = new Dropzone(element, {
clickable: this.clickable, clickable: this.clickable,
thumbnailWidth: this.thumbnailWidth, thumbnailWidth: this.thumbnailWidth,
thumbnailHeight: this.thumbnailHeight, thumbnailHeight: this.thumbnailHeight,
maxFiles: this.maxFiles, maxFiles: this.maxFiles,
maxFilesize: this.maxFilesize, maxFilesize: this.maxFilesize,
dictRemoveFile: 'Remove', dictRemoveFile: 'Remove',
addRemoveLinks: this.showRemoveLink, addRemoveLinks: this.showRemoveLink,
acceptedFiles: this.acceptedFiles, acceptedFiles: this.acceptedFiles,
autoProcessQueue: this.autoProcessQueue, autoProcessQueue: this.autoProcessQueue,
dictDefaultMessage: '<i style="margin-top: 3em;display: inline-block" class="material-icons">' + this.defaultMsg + '</i><br>Drop files here to upload', dictDefaultMessage: '<i style="margin-top: 3em;display: inline-block" class="material-icons">' + this.defaultMsg + '</i><br>Drop files here to upload',
dictMaxFilesExceeded: '只能一个图', dictMaxFilesExceeded: '只能一个图',
previewTemplate: '<div class="dz-preview dz-file-preview"> <div class="dz-image" style="width:' + this.thumbnailWidth + 'px;height:' + this.thumbnailHeight + 'px" ><img style="width:' + this.thumbnailWidth + 'px;height:' + this.thumbnailHeight + 'px" data-dz-thumbnail /></div> <div class="dz-details"><div class="dz-size"><span data-dz-size></span></div> <div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div> <div class="dz-error-message"><span data-dz-errormessage></span></div> <div class="dz-success-mark"> <i class="material-icons">done</i> </div> <div class="dz-error-mark"><i class="material-icons">error</i></div></div>', previewTemplate: '<div class="dz-preview dz-file-preview"> <div class="dz-image" style="width:' + this.thumbnailWidth + 'px;height:' + this.thumbnailHeight + 'px" ><img style="width:' + this.thumbnailWidth + 'px;height:' + this.thumbnailHeight + 'px" data-dz-thumbnail /></div> <div class="dz-details"><div class="dz-size"><span data-dz-size></span></div> <div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div> <div class="dz-error-message"><span data-dz-errormessage></span></div> <div class="dz-success-mark"> <i class="material-icons">done</i> </div> <div class="dz-error-mark"><i class="material-icons">error</i></div></div>',
init() { init() {
const val = vm.defaultImg const val = vm.defaultImg
if (!val) return if (!val) return
if (Array.isArray(val)) { if (Array.isArray(val)) {
if (val.length === 0) return if (val.length === 0) return
val.map((v, i) => { val.map((v, i) => {
const mockFile = { name: 'name' + i, size: 12345, url: v } const mockFile = { name: 'name' + i, size: 12345, url: v }
this.options.addedfile.call(this, mockFile) this.options.addedfile.call(this, mockFile)
this.options.thumbnail.call(this, mockFile, v) this.options.thumbnail.call(this, mockFile, v)
mockFile.previewElement.classList.add('dz-success') mockFile.previewElement.classList.add('dz-success')
mockFile.previewElement.classList.add('dz-complete') mockFile.previewElement.classList.add('dz-complete')
vm.initOnce = false vm.initOnce = false
return true return true
}) })
} else { } else {
const mockFile = { name: 'name', size: 12345, url: val } const mockFile = { name: 'name', size: 12345, url: val }
this.options.addedfile.call(this, mockFile) this.options.addedfile.call(this, mockFile)
this.options.thumbnail.call(this, mockFile, val) this.options.thumbnail.call(this, mockFile, val)
mockFile.previewElement.classList.add('dz-success') mockFile.previewElement.classList.add('dz-success')
mockFile.previewElement.classList.add('dz-complete') mockFile.previewElement.classList.add('dz-complete')
vm.initOnce = false vm.initOnce = false
} }
}, },
accept: (file, done) => { accept: (file, done) => {
/* 七牛*/ /* 七牛*/
// const token = this.$store.getters.token; // const token = this.$store.getters.token;
// getToken(token).then(response => { // getToken(token).then(response => {
// file.token = response.data.qiniu_token; // file.token = response.data.qiniu_token;
// file.key = response.data.qiniu_key; // file.key = response.data.qiniu_key;
// file.url = response.data.qiniu_url; // file.url = response.data.qiniu_url;
// done(); // done();
// }) // })
done() done()
}, },
sending: (file, xhr, formData) => { sending: (file, xhr, formData) => {
// formData.append('token', file.token); // formData.append('token', file.token);
// formData.append('key', file.key); // formData.append('key', file.key);
vm.initOnce = false vm.initOnce = false
} }
}) })
if (this.couldPaste) { if (this.couldPaste) {
document.addEventListener('paste', this.pasteImg) document.addEventListener('paste', this.pasteImg)
} }
this.dropzone.on('success', file => { this.dropzone.on('success', file => {
vm.$emit('dropzone-success', file, vm.dropzone.element) vm.$emit('dropzone-success', file, vm.dropzone.element)
}) })
this.dropzone.on('addedfile', file => { this.dropzone.on('addedfile', file => {
vm.$emit('dropzone-fileAdded', file) vm.$emit('dropzone-fileAdded', file)
}) })
this.dropzone.on('removedfile', file => { this.dropzone.on('removedfile', file => {
vm.$emit('dropzone-removedFile', file) vm.$emit('dropzone-removedFile', file)
}) })
this.dropzone.on('error', (file, error, xhr) => { this.dropzone.on('error', (file, error, xhr) => {
vm.$emit('dropzone-error', file, error, xhr) vm.$emit('dropzone-error', file, error, xhr)
}) })
this.dropzone.on('successmultiple', (file, error, xhr) => { this.dropzone.on('successmultiple', (file, error, xhr) => {
vm.$emit('dropzone-successmultiple', file, error, xhr) vm.$emit('dropzone-successmultiple', file, error, xhr)
}) })
}, },
destroyed() { destroyed() {
document.removeEventListener('paste', this.pasteImg) document.removeEventListener('paste', this.pasteImg)
this.dropzone.destroy() this.dropzone.destroy()
}, },
methods: { methods: {
removeAllFiles() { removeAllFiles() {
this.dropzone.removeAllFiles(true) this.dropzone.removeAllFiles(true)
}, },
processQueue() { processQueue() {
this.dropzone.processQueue() this.dropzone.processQueue()
}, },
pasteImg(event) { pasteImg(event) {
const items = (event.clipboardData || event.originalEvent.clipboardData).items const items = (event.clipboardData || event.originalEvent.clipboardData).items
if (items[0].kind === 'file') { if (items[0].kind === 'file') {
this.dropzone.addFile(items[0].getAsFile()) this.dropzone.addFile(items[0].getAsFile())
} }
}, },
initImages(val) { initImages(val) {
if (!val) return if (!val) return
if (Array.isArray(val)) { if (Array.isArray(val)) {
val.map((v, i) => { val.map((v, i) => {
const mockFile = { name: 'name' + i, size: 12345, url: v } const mockFile = { name: 'name' + i, size: 12345, url: v }
this.dropzone.options.addedfile.call(this.dropzone, mockFile) this.dropzone.options.addedfile.call(this.dropzone, mockFile)
this.dropzone.options.thumbnail.call(this.dropzone, mockFile, v) this.dropzone.options.thumbnail.call(this.dropzone, mockFile, v)
mockFile.previewElement.classList.add('dz-success') mockFile.previewElement.classList.add('dz-success')
mockFile.previewElement.classList.add('dz-complete') mockFile.previewElement.classList.add('dz-complete')
return true return true
}) })
} else { } else {
const mockFile = { name: 'name', size: 12345, url: val } const mockFile = { name: 'name', size: 12345, url: val }
this.dropzone.options.addedfile.call(this.dropzone, mockFile) this.dropzone.options.addedfile.call(this.dropzone, mockFile)
this.dropzone.options.thumbnail.call(this.dropzone, mockFile, val) this.dropzone.options.thumbnail.call(this.dropzone, mockFile, val)
mockFile.previewElement.classList.add('dz-success') mockFile.previewElement.classList.add('dz-success')
mockFile.previewElement.classList.add('dz-complete') mockFile.previewElement.classList.add('dz-complete')
} }
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
.dropzone { .dropzone {
border: 2px solid #E5E5E5; border: 2px solid #E5E5E5;
font-family: 'Roboto', sans-serif; font-family: 'Roboto', sans-serif;
color: #777; color: #777;
transition: background-color .2s linear; transition: background-color .2s linear;
padding: 5px; padding: 5px;
} }
.dropzone:hover { .dropzone:hover {
background-color: #F6F6F6; background-color: #F6F6F6;
} }
i { i {
color: #CCC; color: #CCC;
} }
.dropzone .dz-image img { .dropzone .dz-image img {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.dropzone input[name='file'] { .dropzone input[name='file'] {
display: none; display: none;
} }
.dropzone .dz-preview .dz-image { .dropzone .dz-preview .dz-image {
border-radius: 0px; border-radius: 0px;
} }
.dropzone .dz-preview:hover .dz-image img { .dropzone .dz-preview:hover .dz-image img {
transform: none; transform: none;
filter: none; filter: none;
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.dropzone .dz-preview .dz-details { .dropzone .dz-preview .dz-details {
bottom: 0px; bottom: 0px;
top: 0px; top: 0px;
color: white; color: white;
background-color: rgba(33, 150, 243, 0.8); background-color: rgba(33, 150, 243, 0.8);
transition: opacity .2s linear; transition: opacity .2s linear;
text-align: left; text-align: left;
} }
.dropzone .dz-preview .dz-details .dz-filename span, .dropzone .dz-preview .dz-details .dz-size span { .dropzone .dz-preview .dz-details .dz-filename span, .dropzone .dz-preview .dz-details .dz-size span {
background-color: transparent; background-color: transparent;
} }
.dropzone .dz-preview .dz-details .dz-filename:not(:hover) span { .dropzone .dz-preview .dz-details .dz-filename:not(:hover) span {
border: none; border: none;
} }
.dropzone .dz-preview .dz-details .dz-filename:hover span { .dropzone .dz-preview .dz-details .dz-filename:hover span {
background-color: transparent; background-color: transparent;
border: none; border: none;
} }
.dropzone .dz-preview .dz-remove { .dropzone .dz-preview .dz-remove {
position: absolute; position: absolute;
z-index: 30; z-index: 30;
color: white; color: white;
margin-left: 15px; margin-left: 15px;
padding: 10px; padding: 10px;
top: inherit; top: inherit;
bottom: 15px; bottom: 15px;
border: 2px white solid; border: 2px white solid;
text-decoration: none; text-decoration: none;
text-transform: uppercase; text-transform: uppercase;
font-size: 0.8rem; font-size: 0.8rem;
font-weight: 800; font-weight: 800;
letter-spacing: 1.1px; letter-spacing: 1.1px;
opacity: 0; opacity: 0;
} }
.dropzone .dz-preview:hover .dz-remove { .dropzone .dz-preview:hover .dz-remove {
opacity: 1; opacity: 1;
} }
.dropzone .dz-preview .dz-success-mark, .dropzone .dz-preview .dz-error-mark { .dropzone .dz-preview .dz-success-mark, .dropzone .dz-preview .dz-error-mark {
margin-left: -40px; margin-left: -40px;
margin-top: -50px; margin-top: -50px;
} }
.dropzone .dz-preview .dz-success-mark i, .dropzone .dz-preview .dz-error-mark i { .dropzone .dz-preview .dz-success-mark i, .dropzone .dz-preview .dz-error-mark i {
color: white; color: white;
font-size: 5rem; font-size: 5rem;
} }
</style> </style>

88
src/components/Hamburger/index.vue

@ -1,44 +1,44 @@
<template> <template>
<div style="padding: 0 15px;" @click="toggleClick"> <div style="padding: 0 15px;" @click="toggleClick">
<svg <svg
:class="{'is-active':isActive}" :class="{'is-active':isActive}"
class="hamburger" class="hamburger"
viewBox="0 0 1024 1024" viewBox="0 0 1024 1024"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
width="64" width="64"
height="64" height="64"
> >
<path d="M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 0 0 0-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0 0 14.4 7z" /> <path d="M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 0 0 0-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0 0 14.4 7z" />
</svg> </svg>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'Hamburger', name: 'Hamburger',
props: { props: {
// eslint-disable-next-line vue/require-prop-types // eslint-disable-next-line vue/require-prop-types
isActive: { isActive: {
default: false default: false
} }
}, },
methods: { methods: {
toggleClick() { toggleClick() {
this.$emit('toggleClick') this.$emit('toggleClick')
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
.hamburger { .hamburger {
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
width: 20px; width: 20px;
height: 20px; height: 20px;
} }
.hamburger.is-active { .hamburger.is-active {
transform: rotate(180deg); transform: rotate(180deg);
} }
</style> </style>

380
src/components/HeaderSearch/index.vue

@ -1,190 +1,190 @@
<template> <template>
<div :class="{'show':show}" class="header-search"> <div :class="{'show':show}" class="header-search">
<svg-icon class-name="search-icon" icon-class="magnifying-glass" style="margin-top: 3px" @click.stop="click" /> <svg-icon class-name="search-icon" icon-class="magnifying-glass" style="margin-top: 3px" @click.stop="click" />
<el-select <el-select
ref="headerSearchSelect" ref="headerSearchSelect"
v-model="search" v-model="search"
:remote-method="querySearch" :remote-method="querySearch"
filterable filterable
default-first-option default-first-option
remote remote
:placeholder="$t('table.search')" :placeholder="$t('table.search')"
class="header-search-select" class="header-search-select"
@change="change" @change="change"
> >
<el-option v-for="item in options" :key="item.path" :value="item" :label="item.title.join(' > ')" /> <el-option v-for="item in options" :key="item.path" :value="item" :label="item.title.join(' > ')" />
</el-select> </el-select>
</div> </div>
</template> </template>
<script> <script>
// fuse is a lightweight fuzzy-search module // fuse is a lightweight fuzzy-search module
// make search results more in line with expectations // make search results more in line with expectations
import Fuse from 'fuse.js' import Fuse from 'fuse.js'
import path from 'path' import path from 'path'
import i18n from '@/lang' import i18n from '@/lang'
export default { export default {
name: 'HeaderSearch', name: 'HeaderSearch',
data() { data() {
return { return {
search: '', search: '',
options: [], options: [],
searchPool: [], searchPool: [],
show: false, show: false,
fuse: undefined fuse: undefined
} }
}, },
computed: { computed: {
routes() { routes() {
return this.$store.state.account.routes return this.$store.state.account.routes
}, },
lang() { lang() {
return this.$store.state.setting.language return this.$store.state.setting.language
} }
}, },
watch: { watch: {
lang() { lang() {
this.searchPool = this.generateRoutes(this.routes) this.searchPool = this.generateRoutes(this.routes)
}, },
routes() { routes() {
this.searchPool = this.generateRoutes(this.routes) this.searchPool = this.generateRoutes(this.routes)
}, },
searchPool(list) { searchPool(list) {
this.initFuse(list) this.initFuse(list)
}, },
show(value) { show(value) {
if (value) { if (value) {
document.body.addEventListener('click', this.close) document.body.addEventListener('click', this.close)
} else { } else {
document.body.removeEventListener('click', this.close) document.body.removeEventListener('click', this.close)
} }
} }
}, },
mounted() { mounted() {
this.searchPool = this.generateRoutes(this.routes) this.searchPool = this.generateRoutes(this.routes)
}, },
methods: { methods: {
click() { click() {
this.show = !this.show this.show = !this.show
if (this.show) { if (this.show) {
this.$refs.headerSearchSelect && this.$refs.headerSearchSelect.focus() this.$refs.headerSearchSelect && this.$refs.headerSearchSelect.focus()
} }
}, },
close() { close() {
this.$refs.headerSearchSelect && this.$refs.headerSearchSelect.blur() this.$refs.headerSearchSelect && this.$refs.headerSearchSelect.blur()
this.options = [] this.options = []
this.show = false this.show = false
}, },
change(val) { change(val) {
this.$router.push(val.path) this.$router.push(val.path)
this.search = '' this.search = ''
this.options = [] this.options = []
this.$nextTick(() => { this.$nextTick(() => {
this.show = false this.show = false
}) })
}, },
initFuse(list) { initFuse(list) {
this.fuse = new Fuse(list, { this.fuse = new Fuse(list, {
shouldSort: true, shouldSort: true,
threshold: 0.4, threshold: 0.4,
location: 0, location: 0,
distance: 100, distance: 100,
maxPatternLength: 32, maxPatternLength: 32,
minMatchCharLength: 1, minMatchCharLength: 1,
keys: [{ keys: [{
name: 'title', name: 'title',
weight: 0.7 weight: 0.7
}, { }, {
name: 'path', name: 'path',
weight: 0.3 weight: 0.3
}] }]
}) })
}, },
// Filter out the routes that can be displayed in the sidebar // Filter out the routes that can be displayed in the sidebar
// And generate the internationalized title // And generate the internationalized title
generateRoutes(routes, basePath = '/', prefixTitle = []) { generateRoutes(routes, basePath = '/', prefixTitle = []) {
let res = [] let res = []
for (const router of routes) { for (const router of routes) {
// skip hidden router // skip hidden router
if (router.hidden) { continue } if (router.hidden) { continue }
const data = { const data = {
path: path.resolve(basePath, router.path), path: path.resolve(basePath, router.path),
title: [...prefixTitle] title: [...prefixTitle]
} }
if (router.meta && router.meta.title) { if (router.meta && router.meta.title) {
// generate internationalized title // generate internationalized title
const i18ntitle = i18n.t(`${router.meta.title}`) const i18ntitle = i18n.t(`${router.meta.title}`)
data.title = [...data.title, i18ntitle] data.title = [...data.title, i18ntitle]
if (router.redirect !== 'noRedirect') { if (router.redirect !== 'noRedirect') {
// only push the routes with title // only push the routes with title
// special case: need to exclude parent router without redirect // special case: need to exclude parent router without redirect
res.push(data) res.push(data)
} }
} }
// recursive child routes // recursive child routes
if (router.children) { if (router.children) {
const tempRoutes = this.generateRoutes(router.children, data.path, data.title) const tempRoutes = this.generateRoutes(router.children, data.path, data.title)
if (tempRoutes.length >= 1) { if (tempRoutes.length >= 1) {
res = [...res, ...tempRoutes] res = [...res, ...tempRoutes]
} }
} }
} }
return res return res
}, },
querySearch(query) { querySearch(query) {
if (query !== '') { if (query !== '') {
this.options = this.fuse.search(query) this.options = this.fuse.search(query)
} else { } else {
this.options = [] this.options = []
} }
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.header-search { .header-search {
font-size: 0 !important; font-size: 0 !important;
.search-icon { .search-icon {
cursor: pointer; cursor: pointer;
font-size: 18px; font-size: 18px;
vertical-align: middle; vertical-align: middle;
} }
.header-search-select { .header-search-select {
font-size: 18px; font-size: 18px;
transition: width 0.2s; transition: width 0.2s;
width: 0; width: 0;
overflow: hidden; overflow: hidden;
background: transparent; background: transparent;
border-radius: 0; border-radius: 0;
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
/deep/ .el-input__inner { /deep/ .el-input__inner {
border-radius: 0; border-radius: 0;
border: 0; border: 0;
padding-left: 0; padding-left: 0;
padding-right: 0; padding-right: 0;
box-shadow: none !important; box-shadow: none !important;
border-bottom: 1px solid #d9d9d9; border-bottom: 1px solid #d9d9d9;
vertical-align: middle; vertical-align: middle;
} }
} }
&.show { &.show {
.header-search-select { .header-search-select {
width: 210px; width: 210px;
margin-left: 10px; margin-left: 10px;
} }
} }
} }
</style> </style>

2850
src/components/ImageCropper/index.vue

File diff suppressed because it is too large Load Diff

38
src/components/ImageCropper/utils/data2blob.js

@ -1,19 +1,19 @@
/** /**
* database64文件格式转换为2进制 * database64文件格式转换为2进制
* *
* @param {[String]} data dataURL 的格式为 data:image/png;base64,****,逗号之前都是一些说明性的文字我们只需要逗号之后的就行了 * @param {[String]} data dataURL 的格式为 data:image/png;base64,****,逗号之前都是一些说明性的文字我们只需要逗号之后的就行了
* @param {[String]} mime [description] * @param {[String]} mime [description]
* @return {[blob]} [description] * @return {[blob]} [description]
*/ */
export default function(data, mime) { export default function(data, mime) {
data = data.split(',')[1] data = data.split(',')[1]
data = window.atob(data) data = window.atob(data)
var ia = new Uint8Array(data.length) var ia = new Uint8Array(data.length)
for (var i = 0; i < data.length; i++) { for (var i = 0; i < data.length; i++) {
ia[i] = data.charCodeAt(i) ia[i] = data.charCodeAt(i)
} }
// canvas.toDataURL 返回的默认格式就是 image/png // canvas.toDataURL 返回的默认格式就是 image/png
return new Blob([ia], { return new Blob([ia], {
type: mime type: mime
}) })
} }

78
src/components/ImageCropper/utils/effectRipple.js

@ -1,39 +1,39 @@
/** /**
* 点击波纹效果 * 点击波纹效果
* *
* @param {[event]} e [description] * @param {[event]} e [description]
* @param {[Object]} arg_opts [description] * @param {[Object]} arg_opts [description]
* @return {[bollean]} [description] * @return {[bollean]} [description]
*/ */
export default function(e, arg_opts) { export default function(e, arg_opts) {
var opts = Object.assign({ var opts = Object.assign({
ele: e.target, // 波纹作用元素 ele: e.target, // 波纹作用元素
type: 'hit', // hit点击位置扩散center中心点扩展 type: 'hit', // hit点击位置扩散center中心点扩展
bgc: 'rgba(0, 0, 0, 0.15)' // 波纹颜色 bgc: 'rgba(0, 0, 0, 0.15)' // 波纹颜色
}, arg_opts) }, arg_opts)
var target = opts.ele var target = opts.ele
if (target) { if (target) {
var rect = target.getBoundingClientRect() var rect = target.getBoundingClientRect()
var ripple = target.querySelector('.e-ripple') var ripple = target.querySelector('.e-ripple')
if (!ripple) { if (!ripple) {
ripple = document.createElement('span') ripple = document.createElement('span')
ripple.className = 'e-ripple' ripple.className = 'e-ripple'
ripple.style.height = ripple.style.width = Math.max(rect.width, rect.height) + 'px' ripple.style.height = ripple.style.width = Math.max(rect.width, rect.height) + 'px'
target.appendChild(ripple) target.appendChild(ripple)
} else { } else {
ripple.className = 'e-ripple' ripple.className = 'e-ripple'
} }
switch (opts.type) { switch (opts.type) {
case 'center': case 'center':
ripple.style.top = (rect.height / 2 - ripple.offsetHeight / 2) + 'px' ripple.style.top = (rect.height / 2 - ripple.offsetHeight / 2) + 'px'
ripple.style.left = (rect.width / 2 - ripple.offsetWidth / 2) + 'px' ripple.style.left = (rect.width / 2 - ripple.offsetWidth / 2) + 'px'
break break
default: default:
ripple.style.top = (e.pageY - rect.top - ripple.offsetHeight / 2 - document.body.scrollTop) + 'px' ripple.style.top = (e.pageY - rect.top - ripple.offsetHeight / 2 - document.body.scrollTop) + 'px'
ripple.style.left = (e.pageX - rect.left - ripple.offsetWidth / 2 - document.body.scrollLeft) + 'px' ripple.style.left = (e.pageX - rect.left - ripple.offsetWidth / 2 - document.body.scrollLeft) + 'px'
} }
ripple.style.backgroundColor = opts.bgc ripple.style.backgroundColor = opts.bgc
ripple.className = 'e-ripple z-active' ripple.className = 'e-ripple z-active'
return false return false
} }
} }

464
src/components/ImageCropper/utils/language.js

@ -1,232 +1,232 @@
export default { export default {
zh: { zh: {
hint: '点击,或拖动图片至此处', hint: '点击,或拖动图片至此处',
loading: '正在上传……', loading: '正在上传……',
noSupported: '浏览器不支持该功能,请使用IE10以上或其他现在浏览器!', noSupported: '浏览器不支持该功能,请使用IE10以上或其他现在浏览器!',
success: '上传成功', success: '上传成功',
fail: '图片上传失败', fail: '图片上传失败',
preview: '头像预览', preview: '头像预览',
btn: { btn: {
off: '取消', off: '取消',
close: '关闭', close: '关闭',
back: '上一步', back: '上一步',
save: '保存' save: '保存'
}, },
error: { error: {
onlyImg: '仅限图片格式', onlyImg: '仅限图片格式',
outOfSize: '单文件大小不能超过 ', outOfSize: '单文件大小不能超过 ',
lowestPx: '图片最低像素为(宽*高):' lowestPx: '图片最低像素为(宽*高):'
} }
}, },
'zh-tw': { 'zh-tw': {
hint: '點擊,或拖動圖片至此處', hint: '點擊,或拖動圖片至此處',
loading: '正在上傳……', loading: '正在上傳……',
noSupported: '瀏覽器不支持該功能,請使用IE10以上或其他現代瀏覽器!', noSupported: '瀏覽器不支持該功能,請使用IE10以上或其他現代瀏覽器!',
success: '上傳成功', success: '上傳成功',
fail: '圖片上傳失敗', fail: '圖片上傳失敗',
preview: '頭像預覽', preview: '頭像預覽',
btn: { btn: {
off: '取消', off: '取消',
close: '關閉', close: '關閉',
back: '上一步', back: '上一步',
save: '保存' save: '保存'
}, },
error: { error: {
onlyImg: '僅限圖片格式', onlyImg: '僅限圖片格式',
outOfSize: '單文件大小不能超過 ', outOfSize: '單文件大小不能超過 ',
lowestPx: '圖片最低像素為(寬*高):' lowestPx: '圖片最低像素為(寬*高):'
} }
}, },
en: { en: {
hint: 'Click or drag the file here to upload', hint: 'Click or drag the file here to upload',
loading: 'Uploading…', loading: 'Uploading…',
noSupported: 'Browser is not supported, please use IE10+ or other browsers', noSupported: 'Browser is not supported, please use IE10+ or other browsers',
success: 'Upload success', success: 'Upload success',
fail: 'Upload failed', fail: 'Upload failed',
preview: 'Preview', preview: 'Preview',
btn: { btn: {
off: 'Cancel', off: 'Cancel',
close: 'Close', close: 'Close',
back: 'Back', back: 'Back',
save: 'Save' save: 'Save'
}, },
error: { error: {
onlyImg: 'Image only', onlyImg: 'Image only',
outOfSize: 'Image exceeds size limit: ', outOfSize: 'Image exceeds size limit: ',
lowestPx: 'Image\'s size is too low. Expected at least: ' lowestPx: 'Image\'s size is too low. Expected at least: '
} }
}, },
ro: { ro: {
hint: 'Atinge sau trage fișierul aici', hint: 'Atinge sau trage fișierul aici',
loading: 'Se încarcă', loading: 'Se încarcă',
noSupported: 'Browser-ul tău nu suportă acest feature. Te rugăm încearcă cu alt browser.', noSupported: 'Browser-ul tău nu suportă acest feature. Te rugăm încearcă cu alt browser.',
success: 'S-a încărcat cu succes', success: 'S-a încărcat cu succes',
fail: 'A apărut o problemă la încărcare', fail: 'A apărut o problemă la încărcare',
preview: 'Previzualizează', preview: 'Previzualizează',
btn: { btn: {
off: 'Anulează', off: 'Anulează',
close: 'Închide', close: 'Închide',
back: 'Înapoi', back: 'Înapoi',
save: 'Salvează' save: 'Salvează'
}, },
error: { error: {
onlyImg: 'Doar imagini', onlyImg: 'Doar imagini',
outOfSize: 'Imaginea depășește limita de: ', outOfSize: 'Imaginea depășește limita de: ',
loewstPx: 'Imaginea este prea mică; Minim: ' loewstPx: 'Imaginea este prea mică; Minim: '
} }
}, },
ru: { ru: {
hint: 'Нажмите, или перетащите файл в это окно', hint: 'Нажмите, или перетащите файл в это окно',
loading: 'Загружаю……', loading: 'Загружаю……',
noSupported: 'Ваш браузер не поддерживается, пожалуйста, используйте IE10 + или другие браузеры', noSupported: 'Ваш браузер не поддерживается, пожалуйста, используйте IE10 + или другие браузеры',
success: 'Загрузка выполнена успешно', success: 'Загрузка выполнена успешно',
fail: 'Ошибка загрузки', fail: 'Ошибка загрузки',
preview: 'Предпросмотр', preview: 'Предпросмотр',
btn: { btn: {
off: 'Отменить', off: 'Отменить',
close: 'Закрыть', close: 'Закрыть',
back: 'Назад', back: 'Назад',
save: 'Сохранить' save: 'Сохранить'
}, },
error: { error: {
onlyImg: 'Только изображения', onlyImg: 'Только изображения',
outOfSize: 'Изображение превышает предельный размер: ', outOfSize: 'Изображение превышает предельный размер: ',
lowestPx: 'Минимальный размер изображения: ' lowestPx: 'Минимальный размер изображения: '
} }
}, },
'pt-br': { 'pt-br': {
hint: 'Clique ou arraste o arquivo aqui para carregar', hint: 'Clique ou arraste o arquivo aqui para carregar',
loading: 'Carregando…', loading: 'Carregando…',
noSupported: 'Browser não suportado, use o IE10+ ou outro browser', noSupported: 'Browser não suportado, use o IE10+ ou outro browser',
success: 'Sucesso ao carregar imagem', success: 'Sucesso ao carregar imagem',
fail: 'Falha ao carregar imagem', fail: 'Falha ao carregar imagem',
preview: 'Pré-visualizar', preview: 'Pré-visualizar',
btn: { btn: {
off: 'Cancelar', off: 'Cancelar',
close: 'Fechar', close: 'Fechar',
back: 'Voltar', back: 'Voltar',
save: 'Salvar' save: 'Salvar'
}, },
error: { error: {
onlyImg: 'Apenas imagens', onlyImg: 'Apenas imagens',
outOfSize: 'A imagem excede o limite de tamanho: ', outOfSize: 'A imagem excede o limite de tamanho: ',
lowestPx: 'O tamanho da imagem é muito pequeno. Tamanho mínimo: ' lowestPx: 'O tamanho da imagem é muito pequeno. Tamanho mínimo: '
} }
}, },
fr: { fr: {
hint: 'Cliquez ou glissez le fichier ici.', hint: 'Cliquez ou glissez le fichier ici.',
loading: 'Téléchargement…', loading: 'Téléchargement…',
noSupported: 'Votre navigateur n\'est pas supporté. Utilisez IE10 + ou un autre navigateur s\'il vous plaît.', noSupported: 'Votre navigateur n\'est pas supporté. Utilisez IE10 + ou un autre navigateur s\'il vous plaît.',
success: 'Téléchargement réussit', success: 'Téléchargement réussit',
fail: 'Téléchargement echoué', fail: 'Téléchargement echoué',
preview: 'Aperçu', preview: 'Aperçu',
btn: { btn: {
off: 'Annuler', off: 'Annuler',
close: 'Fermer', close: 'Fermer',
back: 'Retour', back: 'Retour',
save: 'Enregistrer' save: 'Enregistrer'
}, },
error: { error: {
onlyImg: 'Image uniquement', onlyImg: 'Image uniquement',
outOfSize: 'L\'image sélectionnée dépasse la taille maximum: ', outOfSize: 'L\'image sélectionnée dépasse la taille maximum: ',
lowestPx: 'L\'image sélectionnée est trop petite. Dimensions attendues: ' lowestPx: 'L\'image sélectionnée est trop petite. Dimensions attendues: '
} }
}, },
nl: { nl: {
hint: 'Klik hier of sleep een afbeelding in dit vlak', hint: 'Klik hier of sleep een afbeelding in dit vlak',
loading: 'Uploaden…', loading: 'Uploaden…',
noSupported: 'Je browser wordt helaas niet ondersteund. Gebruik IE10+ of een andere browser.', noSupported: 'Je browser wordt helaas niet ondersteund. Gebruik IE10+ of een andere browser.',
success: 'Upload succesvol', success: 'Upload succesvol',
fail: 'Upload mislukt', fail: 'Upload mislukt',
preview: 'Voorbeeld', preview: 'Voorbeeld',
btn: { btn: {
off: 'Annuleren', off: 'Annuleren',
close: 'Sluiten', close: 'Sluiten',
back: 'Terug', back: 'Terug',
save: 'Opslaan' save: 'Opslaan'
}, },
error: { error: {
onlyImg: 'Alleen afbeeldingen', onlyImg: 'Alleen afbeeldingen',
outOfSize: 'De afbeelding is groter dan: ', outOfSize: 'De afbeelding is groter dan: ',
lowestPx: 'De afbeelding is te klein! Minimale afmetingen: ' lowestPx: 'De afbeelding is te klein! Minimale afmetingen: '
} }
}, },
tr: { tr: {
hint: 'Tıkla veya yüklemek istediğini buraya sürükle', hint: 'Tıkla veya yüklemek istediğini buraya sürükle',
loading: 'Yükleniyor…', loading: 'Yükleniyor…',
noSupported: 'Tarayıcı desteklenmiyor, lütfen IE10+ veya farklı tarayıcı kullanın', noSupported: 'Tarayıcı desteklenmiyor, lütfen IE10+ veya farklı tarayıcı kullanın',
success: 'Yükleme başarılı', success: 'Yükleme başarılı',
fail: 'Yüklemede hata oluştu', fail: 'Yüklemede hata oluştu',
preview: 'Önizle', preview: 'Önizle',
btn: { btn: {
off: 'İptal', off: 'İptal',
close: 'Kapat', close: 'Kapat',
back: 'Geri', back: 'Geri',
save: 'Kaydet' save: 'Kaydet'
}, },
error: { error: {
onlyImg: 'Sadece resim', onlyImg: 'Sadece resim',
outOfSize: 'Resim yükleme limitini aşıyor: ', outOfSize: 'Resim yükleme limitini aşıyor: ',
lowestPx: 'Resmin boyutu çok küçük. En az olması gereken: ' lowestPx: 'Resmin boyutu çok küçük. En az olması gereken: '
} }
}, },
'es-MX': { 'es-MX': {
hint: 'Selecciona o arrastra una imagen', hint: 'Selecciona o arrastra una imagen',
loading: 'Subiendo...', loading: 'Subiendo...',
noSupported: 'Tu navegador no es soportado, porfavor usa IE10+ u otros navegadores mas recientes', noSupported: 'Tu navegador no es soportado, porfavor usa IE10+ u otros navegadores mas recientes',
success: 'Subido exitosamente', success: 'Subido exitosamente',
fail: 'Sucedió un error', fail: 'Sucedió un error',
preview: 'Vista previa', preview: 'Vista previa',
btn: { btn: {
off: 'Cancelar', off: 'Cancelar',
close: 'Cerrar', close: 'Cerrar',
back: 'Atras', back: 'Atras',
save: 'Guardar' save: 'Guardar'
}, },
error: { error: {
onlyImg: 'Unicamente imagenes', onlyImg: 'Unicamente imagenes',
outOfSize: 'La imagen excede el tamaño maximo:', outOfSize: 'La imagen excede el tamaño maximo:',
lowestPx: 'La imagen es demasiado pequeño. Se espera por lo menos:' lowestPx: 'La imagen es demasiado pequeño. Se espera por lo menos:'
} }
}, },
de: { de: {
hint: 'Klick hier oder zieh eine Datei hier rein zum Hochladen', hint: 'Klick hier oder zieh eine Datei hier rein zum Hochladen',
loading: 'Hochladen…', loading: 'Hochladen…',
noSupported: 'Browser wird nicht unterstützt, bitte verwende IE10+ oder andere Browser', noSupported: 'Browser wird nicht unterstützt, bitte verwende IE10+ oder andere Browser',
success: 'Upload erfolgreich', success: 'Upload erfolgreich',
fail: 'Upload fehlgeschlagen', fail: 'Upload fehlgeschlagen',
preview: 'Vorschau', preview: 'Vorschau',
btn: { btn: {
off: 'Abbrechen', off: 'Abbrechen',
close: 'Schließen', close: 'Schließen',
back: 'Zurück', back: 'Zurück',
save: 'Speichern' save: 'Speichern'
}, },
error: { error: {
onlyImg: 'Nur Bilder', onlyImg: 'Nur Bilder',
outOfSize: 'Das Bild ist zu groß: ', outOfSize: 'Das Bild ist zu groß: ',
lowestPx: 'Das Bild ist zu klein. Mindestens: ' lowestPx: 'Das Bild ist zu klein. Mindestens: '
} }
}, },
ja: { ja: {
hint: 'クリック・ドラッグしてファイルをアップロード', hint: 'クリック・ドラッグしてファイルをアップロード',
loading: 'アップロード中...', loading: 'アップロード中...',
noSupported: 'このブラウザは対応されていません。IE10+かその他の主要ブラウザをお使いください。', noSupported: 'このブラウザは対応されていません。IE10+かその他の主要ブラウザをお使いください。',
success: 'アップロード成功', success: 'アップロード成功',
fail: 'アップロード失敗', fail: 'アップロード失敗',
preview: 'プレビュー', preview: 'プレビュー',
btn: { btn: {
off: 'キャンセル', off: 'キャンセル',
close: '閉じる', close: '閉じる',
back: '戻る', back: '戻る',
save: '保存' save: '保存'
}, },
error: { error: {
onlyImg: '画像のみ', onlyImg: '画像のみ',
outOfSize: '画像サイズが上限を超えています。上限: ', outOfSize: '画像サイズが上限を超えています。上限: ',
lowestPx: '画像が小さすぎます。最小サイズ: ' lowestPx: '画像が小さすぎます。最小サイズ: '
} }
} }
} }

14
src/components/ImageCropper/utils/mimes.js

@ -1,7 +1,7 @@
export default { export default {
'jpg': 'image/jpeg', 'jpg': 'image/jpeg',
'png': 'image/png', 'png': 'image/png',
'gif': 'image/gif', 'gif': 'image/gif',
'svg': 'image/svg+xml', 'svg': 'image/svg+xml',
'psd': 'image/photoshop' 'psd': 'image/photoshop'
} }

134
src/components/ImageUpload/index.vue

@ -1,67 +1,67 @@
<template> <template>
<div class="upload-widget"> <div class="upload-widget">
<el-upload <el-upload
:headers="headers" :headers="headers"
:data="dataObj" :data="dataObj"
:multiple="false" :multiple="false"
:show-file-list="false" :show-file-list="false"
:file-list="item" :file-list="item"
:on-success="handleImageSuccess" :on-success="handleImageSuccess"
class="upload-uploader" class="upload-uploader"
:action="action" :action="action"
> >
<img v-if="src" class="upload-images" :src="src" /> <img v-if="src" class="upload-images" :src="src" />
<div <div
v-else v-else
slot="trigger" slot="trigger"
class="upload-btn" class="upload-btn"
> >
<i class="el-icon-upload"></i> <i class="el-icon-upload"></i>
<span class="upload-title">选择图片</span> <span class="upload-title">选择图片</span>
</div> </div>
</el-upload> </el-upload>
</div> </div>
</template> </template>
<script> <script>
import db from '@/utils/localstorage' import db from '@/utils/localstorage'
import { Upload } from 'element-ui' import { Upload } from 'element-ui'
export default { export default {
components: { components: {
'el-upload': Upload 'el-upload': Upload
}, },
props: { props: {
item: { item: {
type: Array, type: Array,
default() { default() {
return [] return []
} }
}, },
src: { src: {
type: String, type: String,
default: '' default: ''
} }
}, },
data() { data() {
return { return {
headers: { headers: {
Authorization: '' Authorization: ''
}, },
action: `${process.env.VUE_APP_DEV_REQUEST_DOMAIN_PREFIX}/file/upload`, action: `${process.env.VUE_APP_DEV_REQUEST_DOMAIN_PREFIX}/file/upload`,
dataObj: { dataObj: {
folderId: 1 folderId: 1
} }
} }
}, },
created() { created() {
this.headers.token = 'Bearer ' + db.get('TOKEN', '') this.headers.token = 'Bearer ' + db.get('TOKEN', '')
this.headers.tenant = 'MDAwMA==' this.headers.tenant = 'MDAwMA=='
}, },
methods: { methods: {
handleImageSuccess(response, file, fileList) { handleImageSuccess(response, file, fileList) {
((response, file, fileList) => { ((response, file, fileList) => {
this.$emit('success', response, file, fileList ) this.$emit('success', response, file, fileList )
})(response, file, fileList ) })(response, file, fileList )
} }
} }
} }
</script> </script>

144
src/components/JsonEditor/index.vue

@ -1,72 +1,72 @@
<template> <template>
<div class="json-editor"> <div class="json-editor">
<textarea ref="textarea" /> <textarea ref="textarea" />
</div> </div>
</template> </template>
<script> <script>
import CodeMirror from 'codemirror' import CodeMirror from 'codemirror'
import 'codemirror/addon/lint/lint.css' import 'codemirror/addon/lint/lint.css'
import 'codemirror/lib/codemirror.css' import 'codemirror/lib/codemirror.css'
import 'codemirror/theme/rubyblue.css' import 'codemirror/theme/rubyblue.css'
require('script-loader!jsonlint') require('script-loader!jsonlint')
import 'codemirror/mode/javascript/javascript' import 'codemirror/mode/javascript/javascript'
import 'codemirror/addon/lint/lint' import 'codemirror/addon/lint/lint'
import 'codemirror/addon/lint/json-lint' import 'codemirror/addon/lint/json-lint'
export default { export default {
name: 'JsonEditor', name: 'JsonEditor',
/* eslint-disable vue/require-prop-types */ /* eslint-disable vue/require-prop-types */
props: ['value'], props: ['value'],
data() { data() {
return { return {
jsonEditor: false jsonEditor: false
} }
}, },
watch: { watch: {
value(value) { value(value) {
const editorValue = this.jsonEditor.getValue() const editorValue = this.jsonEditor.getValue()
if (value !== editorValue) { if (value !== editorValue) {
this.jsonEditor.setValue(JSON.stringify(this.value, null, 2)) this.jsonEditor.setValue(JSON.stringify(this.value, null, 2))
} }
} }
}, },
mounted() { mounted() {
this.jsonEditor = CodeMirror.fromTextArea(this.$refs.textarea, { this.jsonEditor = CodeMirror.fromTextArea(this.$refs.textarea, {
lineNumbers: true, lineNumbers: true,
mode: 'application/json', mode: 'application/json',
gutters: ['CodeMirror-lint-markers'], gutters: ['CodeMirror-lint-markers'],
theme: 'rubyblue', theme: 'rubyblue',
lint: true lint: true
}) })
this.jsonEditor.setValue(JSON.stringify(this.value, null, 2)) this.jsonEditor.setValue(JSON.stringify(this.value, null, 2))
this.jsonEditor.on('change', cm => { this.jsonEditor.on('change', cm => {
this.$emit('changed', cm.getValue()) this.$emit('changed', cm.getValue())
this.$emit('input', cm.getValue()) this.$emit('input', cm.getValue())
}) })
}, },
methods: { methods: {
getValue() { getValue() {
return this.jsonEditor.getValue() return this.jsonEditor.getValue()
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
.json-editor{ .json-editor{
height: 100%; height: 100%;
position: relative; position: relative;
} }
.json-editor >>> .CodeMirror { .json-editor >>> .CodeMirror {
height: auto; height: auto;
min-height: 300px; min-height: 300px;
} }
.json-editor >>> .CodeMirror-scroll{ .json-editor >>> .CodeMirror-scroll{
min-height: 300px; min-height: 300px;
} }
.json-editor >>> .cm-s-rubyblue span.cm-string { .json-editor >>> .cm-s-rubyblue span.cm-string {
color: #F08047; color: #F08047;
} }
</style> </style>

198
src/components/Kanban/index.vue

@ -1,99 +1,99 @@
<template> <template>
<div class="board-column"> <div class="board-column">
<div class="board-column-header"> <div class="board-column-header">
{{ headerText }} {{ headerText }}
</div> </div>
<draggable <draggable
:list="list" :list="list"
v-bind="$attrs" v-bind="$attrs"
class="board-column-content" class="board-column-content"
:set-data="setData" :set-data="setData"
> >
<div v-for="element in list" :key="element.id" class="board-item"> <div v-for="element in list" :key="element.id" class="board-item">
{{ element.name }} {{ element.id }} {{ element.name }} {{ element.id }}
</div> </div>
</draggable> </draggable>
</div> </div>
</template> </template>
<script> <script>
import draggable from 'vuedraggable' import draggable from 'vuedraggable'
export default { export default {
name: 'DragKanbanDemo', name: 'DragKanbanDemo',
components: { components: {
draggable draggable
}, },
props: { props: {
headerText: { headerText: {
type: String, type: String,
default: 'Header' default: 'Header'
}, },
options: { options: {
type: Object, type: Object,
default() { default() {
return {} return {}
} }
}, },
list: { list: {
type: Array, type: Array,
default() { default() {
return [] return []
} }
} }
}, },
methods: { methods: {
setData(dataTransfer) { setData(dataTransfer) {
// to avoid Firefox bug // to avoid Firefox bug
// Detail see : https://github.com/RubaXa/Sortable/issues/1012 // Detail see : https://github.com/RubaXa/Sortable/issues/1012
dataTransfer.setData('Text', '') dataTransfer.setData('Text', '')
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.board-column { .board-column {
min-width: 300px; min-width: 300px;
min-height: 100px; min-height: 100px;
height: auto; height: auto;
overflow: hidden; overflow: hidden;
background: #f0f0f0; background: #f0f0f0;
border-radius: 3px; border-radius: 3px;
.board-column-header { .board-column-header {
height: 50px; height: 50px;
line-height: 50px; line-height: 50px;
overflow: hidden; overflow: hidden;
padding: 0 20px; padding: 0 20px;
text-align: center; text-align: center;
background: #333; background: #333;
color: #fff; color: #fff;
border-radius: 3px 3px 0 0; border-radius: 3px 3px 0 0;
} }
.board-column-content { .board-column-content {
height: auto; height: auto;
overflow: hidden; overflow: hidden;
border: 10px solid transparent; border: 10px solid transparent;
min-height: 60px; min-height: 60px;
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
.board-item { .board-item {
cursor: pointer; cursor: pointer;
width: 100%; width: 100%;
height: 64px; height: 64px;
margin: 5px 0; margin: 5px 0;
background-color: #fff; background-color: #fff;
text-align: left; text-align: left;
line-height: 54px; line-height: 54px;
padding: 5px 10px; padding: 5px 10px;
box-sizing: border-box; box-sizing: border-box;
box-shadow: 0px 1px 3px 0 rgba(0, 0, 0, 0.2); box-shadow: 0px 1px 3px 0 rgba(0, 0, 0, 0.2);
} }
} }
} }
</style> </style>

70
src/components/LangSelect/index.vue

@ -1,35 +1,35 @@
<template> <template>
<el-dropdown trigger="click" class="international" @command="handleSetLanguage"> <el-dropdown trigger="click" class="international" @command="handleSetLanguage">
<div> <div>
<svg-icon class-name="international-icon" icon-class="language" style="color: #a8a9a9;" /> <svg-icon class-name="international-icon" icon-class="language" style="color: #a8a9a9;" />
</div> </div>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item :disabled="language==='zh'" command="zh"> <el-dropdown-item :disabled="language==='zh'" command="zh">
中文 中文
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item :disabled="language==='en'" command="en"> <el-dropdown-item :disabled="language==='en'" command="en">
English English
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</template> </template>
<script> <script>
export default { export default {
computed: { computed: {
language() { language() {
return this.$store.state.setting.language return this.$store.state.setting.language
} }
}, },
methods: { methods: {
handleSetLanguage(lang) { handleSetLanguage(lang) {
this.$i18n.locale = lang this.$i18n.locale = lang
this.$store.commit('setting/setLanguage', lang) this.$store.commit('setting/setLanguage', lang)
this.$message({ this.$message({
message: this.$t('tips.switchLanguageSuccess'), message: this.$t('tips.switchLanguageSuccess'),
type: 'success' type: 'success'
}) })
} }
} }
} }
</script> </script>

720
src/components/MDinput/index.vue

@ -1,360 +1,360 @@
<template> <template>
<div :class="computedClasses" class="material-input__component"> <div :class="computedClasses" class="material-input__component">
<div :class="{iconClass:icon}"> <div :class="{iconClass:icon}">
<i v-if="icon" :class="['el-icon-' + icon]" class="el-input__icon material-input__icon" /> <i v-if="icon" :class="['el-icon-' + icon]" class="el-input__icon material-input__icon" />
<input <input
v-if="type === 'email'" v-if="type === 'email'"
v-model="currentValue" v-model="currentValue"
:name="name" :name="name"
:placeholder="fillPlaceHolder" :placeholder="fillPlaceHolder"
:readonly="readonly" :readonly="readonly"
:disabled="disabled" :disabled="disabled"
:autocomplete="autoComplete" :autocomplete="autoComplete"
:required="required" :required="required"
type="email" type="email"
class="material-input" class="material-input"
@focus="handleMdFocus" @focus="handleMdFocus"
@blur="handleMdBlur" @blur="handleMdBlur"
@input="handleModelInput" @input="handleModelInput"
> >
<input <input
v-if="type === 'url'" v-if="type === 'url'"
v-model="currentValue" v-model="currentValue"
:name="name" :name="name"
:placeholder="fillPlaceHolder" :placeholder="fillPlaceHolder"
:readonly="readonly" :readonly="readonly"
:disabled="disabled" :disabled="disabled"
:autocomplete="autoComplete" :autocomplete="autoComplete"
:required="required" :required="required"
type="url" type="url"
class="material-input" class="material-input"
@focus="handleMdFocus" @focus="handleMdFocus"
@blur="handleMdBlur" @blur="handleMdBlur"
@input="handleModelInput" @input="handleModelInput"
> >
<input <input
v-if="type === 'number'" v-if="type === 'number'"
v-model="currentValue" v-model="currentValue"
:name="name" :name="name"
:placeholder="fillPlaceHolder" :placeholder="fillPlaceHolder"
:step="step" :step="step"
:readonly="readonly" :readonly="readonly"
:disabled="disabled" :disabled="disabled"
:autocomplete="autoComplete" :autocomplete="autoComplete"
:max="max" :max="max"
:min="min" :min="min"
:minlength="minlength" :minlength="minlength"
:maxlength="maxlength" :maxlength="maxlength"
:required="required" :required="required"
type="number" type="number"
class="material-input" class="material-input"
@focus="handleMdFocus" @focus="handleMdFocus"
@blur="handleMdBlur" @blur="handleMdBlur"
@input="handleModelInput" @input="handleModelInput"
> >
<input <input
v-if="type === 'password'" v-if="type === 'password'"
v-model="currentValue" v-model="currentValue"
:name="name" :name="name"
:placeholder="fillPlaceHolder" :placeholder="fillPlaceHolder"
:readonly="readonly" :readonly="readonly"
:disabled="disabled" :disabled="disabled"
:autocomplete="autoComplete" :autocomplete="autoComplete"
:max="max" :max="max"
:min="min" :min="min"
:required="required" :required="required"
type="password" type="password"
class="material-input" class="material-input"
@focus="handleMdFocus" @focus="handleMdFocus"
@blur="handleMdBlur" @blur="handleMdBlur"
@input="handleModelInput" @input="handleModelInput"
> >
<input <input
v-if="type === 'tel'" v-if="type === 'tel'"
v-model="currentValue" v-model="currentValue"
:name="name" :name="name"
:placeholder="fillPlaceHolder" :placeholder="fillPlaceHolder"
:readonly="readonly" :readonly="readonly"
:disabled="disabled" :disabled="disabled"
:autocomplete="autoComplete" :autocomplete="autoComplete"
:required="required" :required="required"
type="tel" type="tel"
class="material-input" class="material-input"
@focus="handleMdFocus" @focus="handleMdFocus"
@blur="handleMdBlur" @blur="handleMdBlur"
@input="handleModelInput" @input="handleModelInput"
> >
<input <input
v-if="type === 'text'" v-if="type === 'text'"
v-model="currentValue" v-model="currentValue"
:name="name" :name="name"
:placeholder="fillPlaceHolder" :placeholder="fillPlaceHolder"
:readonly="readonly" :readonly="readonly"
:disabled="disabled" :disabled="disabled"
:autocomplete="autoComplete" :autocomplete="autoComplete"
:minlength="minlength" :minlength="minlength"
:maxlength="maxlength" :maxlength="maxlength"
:required="required" :required="required"
type="text" type="text"
class="material-input" class="material-input"
@focus="handleMdFocus" @focus="handleMdFocus"
@blur="handleMdBlur" @blur="handleMdBlur"
@input="handleModelInput" @input="handleModelInput"
> >
<span class="material-input-bar" /> <span class="material-input-bar" />
<label class="material-label"> <label class="material-label">
<slot /> <slot />
</label> </label>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
// source:https://github.com/wemake-services/vue-material-input/blob/master/src/components/MaterialInput.vue // source:https://github.com/wemake-services/vue-material-input/blob/master/src/components/MaterialInput.vue
export default { export default {
name: 'MdInput', name: 'MdInput',
props: { props: {
/* eslint-disable */ /* eslint-disable */
icon: String, icon: String,
name: String, name: String,
type: { type: {
type: String, type: String,
default: 'text' default: 'text'
}, },
value: [String, Number], value: [String, Number],
placeholder: String, placeholder: String,
readonly: Boolean, readonly: Boolean,
disabled: Boolean, disabled: Boolean,
min: String, min: String,
max: String, max: String,
step: String, step: String,
minlength: Number, minlength: Number,
maxlength: Number, maxlength: Number,
required: { required: {
type: Boolean, type: Boolean,
default: true default: true
}, },
autoComplete: { autoComplete: {
type: String, type: String,
default: 'off' default: 'off'
}, },
validateEvent: { validateEvent: {
type: Boolean, type: Boolean,
default: true default: true
} }
}, },
data() { data() {
return { return {
currentValue: this.value, currentValue: this.value,
focus: false, focus: false,
fillPlaceHolder: null fillPlaceHolder: null
} }
}, },
computed: { computed: {
computedClasses() { computedClasses() {
return { return {
'material--active': this.focus, 'material--active': this.focus,
'material--disabled': this.disabled, 'material--disabled': this.disabled,
'material--raised': Boolean(this.focus || this.currentValue) // has value 'material--raised': Boolean(this.focus || this.currentValue) // has value
} }
} }
}, },
watch: { watch: {
value(newValue) { value(newValue) {
this.currentValue = newValue this.currentValue = newValue
} }
}, },
methods: { methods: {
handleModelInput(event) { handleModelInput(event) {
const value = event.target.value const value = event.target.value
this.$emit('input', value) this.$emit('input', value)
if (this.$parent.$options.componentName === 'ElFormItem') { if (this.$parent.$options.componentName === 'ElFormItem') {
if (this.validateEvent) { if (this.validateEvent) {
this.$parent.$emit('el.form.change', [value]) this.$parent.$emit('el.form.change', [value])
} }
} }
this.$emit('change', value) this.$emit('change', value)
}, },
handleMdFocus(event) { handleMdFocus(event) {
this.focus = true this.focus = true
this.$emit('focus', event) this.$emit('focus', event)
if (this.placeholder && this.placeholder !== '') { if (this.placeholder && this.placeholder !== '') {
this.fillPlaceHolder = this.placeholder this.fillPlaceHolder = this.placeholder
} }
}, },
handleMdBlur(event) { handleMdBlur(event) {
this.focus = false this.focus = false
this.$emit('blur', event) this.$emit('blur', event)
this.fillPlaceHolder = null this.fillPlaceHolder = null
if (this.$parent.$options.componentName === 'ElFormItem') { if (this.$parent.$options.componentName === 'ElFormItem') {
if (this.validateEvent) { if (this.validateEvent) {
this.$parent.$emit('el.form.blur', [this.currentValue]) this.$parent.$emit('el.form.blur', [this.currentValue])
} }
} }
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
// Fonts: // Fonts:
$font-size-base: 16px; $font-size-base: 16px;
$font-size-small: 18px; $font-size-small: 18px;
$font-size-smallest: 12px; $font-size-smallest: 12px;
$font-weight-normal: normal; $font-weight-normal: normal;
$font-weight-bold: bold; $font-weight-bold: bold;
$apixel: 1px; $apixel: 1px;
// Utils // Utils
$spacer: 12px; $spacer: 12px;
$transition: 0.2s ease all; $transition: 0.2s ease all;
$index: 0px; $index: 0px;
$index-has-icon: 30px; $index-has-icon: 30px;
// Theme: // Theme:
$color-white: white; $color-white: white;
$color-grey: #9E9E9E; $color-grey: #9E9E9E;
$color-grey-light: #E0E0E0; $color-grey-light: #E0E0E0;
$color-blue: #2196F3; $color-blue: #2196F3;
$color-red: #F44336; $color-red: #F44336;
$color-black: black; $color-black: black;
// Base clases: // Base clases:
%base-bar-pseudo { %base-bar-pseudo {
content: ''; content: '';
height: 1px; height: 1px;
width: 0; width: 0;
bottom: 0; bottom: 0;
position: absolute; position: absolute;
transition: $transition; transition: $transition;
} }
// Mixins: // Mixins:
@mixin slided-top() { @mixin slided-top() {
top: - ($font-size-base + $spacer); top: - ($font-size-base + $spacer);
left: 0; left: 0;
font-size: $font-size-base; font-size: $font-size-base;
font-weight: $font-weight-bold; font-weight: $font-weight-bold;
} }
// Component: // Component:
.material-input__component { .material-input__component {
margin-top: 36px; margin-top: 36px;
position: relative; position: relative;
* { * {
box-sizing: border-box; box-sizing: border-box;
} }
.iconClass { .iconClass {
.material-input__icon { .material-input__icon {
position: absolute; position: absolute;
left: 0; left: 0;
line-height: $font-size-base; line-height: $font-size-base;
color: $color-blue; color: $color-blue;
top: $spacer; top: $spacer;
width: $index-has-icon; width: $index-has-icon;
height: $font-size-base; height: $font-size-base;
font-size: $font-size-base; font-size: $font-size-base;
font-weight: $font-weight-normal; font-weight: $font-weight-normal;
pointer-events: none; pointer-events: none;
} }
.material-label { .material-label {
left: $index-has-icon; left: $index-has-icon;
} }
.material-input { .material-input {
text-indent: $index-has-icon; text-indent: $index-has-icon;
} }
} }
.material-input { .material-input {
font-size: $font-size-base; font-size: $font-size-base;
padding: $spacer $spacer $spacer - $apixel * 10 $spacer / 2; padding: $spacer $spacer $spacer - $apixel * 10 $spacer / 2;
display: block; display: block;
width: 100%; width: 100%;
border: none; border: none;
line-height: 1; line-height: 1;
border-radius: 0; border-radius: 0;
&:focus { &:focus {
outline: none; outline: none;
border: none; border: none;
border-bottom: 1px solid transparent; // fixes the height issue border-bottom: 1px solid transparent; // fixes the height issue
} }
} }
.material-label { .material-label {
font-weight: $font-weight-normal; font-weight: $font-weight-normal;
position: absolute; position: absolute;
pointer-events: none; pointer-events: none;
left: $index; left: $index;
top: 0; top: 0;
transition: $transition; transition: $transition;
font-size: $font-size-small; font-size: $font-size-small;
} }
.material-input-bar { .material-input-bar {
position: relative; position: relative;
display: block; display: block;
width: 100%; width: 100%;
&:before { &:before {
@extend %base-bar-pseudo; @extend %base-bar-pseudo;
left: 50%; left: 50%;
} }
&:after { &:after {
@extend %base-bar-pseudo; @extend %base-bar-pseudo;
right: 50%; right: 50%;
} }
} }
// Disabled state: // Disabled state:
&.material--disabled { &.material--disabled {
.material-input { .material-input {
border-bottom-style: dashed; border-bottom-style: dashed;
} }
} }
// Raised state: // Raised state:
&.material--raised { &.material--raised {
.material-label { .material-label {
@include slided-top(); @include slided-top();
} }
} }
// Active state: // Active state:
&.material--active { &.material--active {
.material-input-bar { .material-input-bar {
&:before, &:before,
&:after { &:after {
width: 50%; width: 50%;
} }
} }
} }
} }
.material-input__component { .material-input__component {
background: $color-white; background: $color-white;
.material-input { .material-input {
background: none; background: none;
color: $color-black; color: $color-black;
text-indent: $index; text-indent: $index;
border-bottom: 1px solid $color-grey-light; border-bottom: 1px solid $color-grey-light;
} }
.material-label { .material-label {
color: $color-grey; color: $color-grey;
} }
.material-input-bar { .material-input-bar {
&:before, &:before,
&:after { &:after {
background: $color-blue; background: $color-blue;
} }
} }
// Active state: // Active state:
&.material--active { &.material--active {
.material-label { .material-label {
color: $color-blue; color: $color-blue;
} }
} }
// Errors: // Errors:
&.material--has-errors { &.material--has-errors {
&.material--active .material-label { &.material--active .material-label {
color: $color-red; color: $color-red;
} }
.material-input-bar { .material-input-bar {
&:before, &:before,
&:after { &:after {
background: transparent; background: transparent;
} }
} }
} }
} }
</style> </style>

612
src/components/Management/AddDialog.vue

@ -1,306 +1,306 @@
<template> <template>
<div class="add-dialog-component"> <div class="add-dialog-component">
<Form ref="addForm" label-width="150px" :rules="rules" :model="formParams"> <Form ref="addForm" label-width="150px" :rules="rules" :model="formParams">
<Tabs v-model="activeName"> <Tabs v-model="activeName">
<tab-pane label="授权信息" name="authorize"> <tab-pane label="授权信息" name="authorize">
<form-item label="店铺名称" prop="name"> <form-item label="店铺名称" prop="name">
<Input <Input
v-model="formParams.name" v-model="formParams.name"
size="medium" size="medium"
placeholder="请输入店铺名称" placeholder="请输入店铺名称"
maxlength="30" maxlength="30"
show-word-limit show-word-limit
clearable clearable
/> />
</form-item> </form-item>
<form-item label="店铺负责人" prop="duty"> <form-item label="店铺负责人" prop="duty">
<Input <Input
v-model="formParams.duty" v-model="formParams.duty"
size="medium" size="medium"
placeholder="请输入店铺负责人" placeholder="请输入店铺负责人"
maxlength="50" maxlength="50"
show-word-limit show-word-limit
clearable clearable
/> />
</form-item> </form-item>
<form-item label="联系电话"> <form-item label="联系电话">
<Input <Input
v-model="formParams.contactTel" v-model="formParams.contactTel"
size="medium" size="medium"
placeholder="请输入联系电话" placeholder="请输入联系电话"
maxlength="50" maxlength="50"
show-word-limit show-word-limit
clearable clearable
/> />
</form-item> </form-item>
<form-item label="联系地址"> <form-item label="联系地址">
<Input <Input
v-model="formParams.address" v-model="formParams.address"
size="medium" size="medium"
placeholder="请输入联系地址" placeholder="请输入联系地址"
maxlength="50" maxlength="50"
show-word-limit show-word-limit
clearable clearable
/> />
</form-item> </form-item>
<form-item label="生效日期" prop="startTime"> <form-item label="生效日期" prop="startTime">
<date-picker <date-picker
v-model="formParams.startTime" v-model="formParams.startTime"
size="medium" size="medium"
type="date" type="date"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请输入生效日期" placeholder="请输入生效日期"
/> />
</form-item> </form-item>
<form-item label="生效时限(年)" prop="expireLimitYear"> <form-item label="生效时限(年)" prop="expireLimitYear">
<Input <Input
v-model="formParams.expireLimitYear" v-model="formParams.expireLimitYear"
size="medium" size="medium"
placeholder="请输入生效时限" placeholder="请输入生效时限"
maxlength="4" maxlength="4"
show-word-limit show-word-limit
clearable clearable
/> />
</form-item> </form-item>
<form-item label="合同状态"> <form-item label="合同状态">
<Select v-model="formParams.status.code" size="mini"> <Select v-model="formParams.status.code" size="mini">
<Option label="有效" value="NORMAL" /> <Option label="有效" value="NORMAL" />
<Option label="无效" value="FORBIDDEN" /> <Option label="无效" value="FORBIDDEN" />
</Select> </Select>
</form-item> </form-item>
<form-item label="收单类型"> <form-item label="收单类型">
<Select v-model="formParams.posType.code" size="mini"> <Select v-model="formParams.posType.code" size="mini">
<Option label="普通餐饮" value="NORMALSTORE" /> <Option label="普通餐饮" value="NORMALSTORE" />
<Option label="快消奶茶" value="FASTSTORE" /> <Option label="快消奶茶" value="FASTSTORE" />
<Option label="零售店" value="RETAILSTORE" /> <Option label="零售店" value="RETAILSTORE" />
</Select> </Select>
</form-item> </form-item>
<form-item size="large"> <form-item size="large">
<Button type="primary" @click="next">下一步</Button> <Button type="primary" @click="next">下一步</Button>
<Button @click="close">取消</Button> <Button @click="close">取消</Button>
</form-item> </form-item>
</tab-pane> </tab-pane>
<tab-pane label="账户信息" name="account"> <tab-pane label="账户信息" name="account">
<form-item label="账号" prop="mobile"> <form-item label="账号" prop="mobile">
<Input <Input
v-model="formParams.mobile" v-model="formParams.mobile"
size="medium" size="medium"
placeholder="账号" placeholder="账号"
maxlength="11" maxlength="11"
show-word-limit show-word-limit
clearable clearable
/> />
</form-item> </form-item>
<form-item label="密码" prop="password"> <form-item label="密码" prop="password">
<Input <Input
v-model="formParams.password" v-model="formParams.password"
size="medium" size="medium"
type="password" type="password"
placeholder="请输入密码" placeholder="请输入密码"
show-word-limit show-word-limit
clearable clearable
/> />
</form-item> </form-item>
<form-item label="确认密码" prop="confirmPassword"> <form-item label="确认密码" prop="confirmPassword">
<Input <Input
v-model="formParams.confirmPassword" v-model="formParams.confirmPassword"
size="medium" size="medium"
type="password" type="password"
placeholder="请再次输入密码" placeholder="请再次输入密码"
show-word-limit show-word-limit
clearable clearable
/> />
</form-item> </form-item>
<form-item size="large"> <form-item size="large">
<Button type="primary" :loading="addLoading" @click="onSubmit">保存</Button> <Button type="primary" :loading="addLoading" @click="onSubmit">保存</Button>
<Button @click="close">取消</Button> <Button @click="close">取消</Button>
</form-item> </form-item>
</tab-pane> </tab-pane>
</Tabs> </Tabs>
</Form> </Form>
</div> </div>
</template> </template>
<script> <script>
import Management from '@/api/Management.js' import Management from '@/api/Management.js'
import { Tabs, TabPane, Form, FormItem, Input, Button, Select, Option, DatePicker } from 'element-ui' import { Tabs, TabPane, Form, FormItem, Input, Button, Select, Option, DatePicker } from 'element-ui'
export default { export default {
components: { components: {
Tabs, Tabs,
TabPane, TabPane,
Form, Form,
FormItem, FormItem,
Input, Input,
Button, Button,
Select, Select,
Option, Option,
DatePicker DatePicker
}, },
props: { props: {
dialogVisible: { dialogVisible: {
type: Boolean, type: Boolean,
default: false default: false
} }
}, },
data() { data() {
const checkPhone = (rule, value, callback) => { const checkPhone = (rule, value, callback) => {
if (!value) { if (!value) {
return callback(new Error('手机号不能为空')) return callback(new Error('手机号不能为空'))
} else { } else {
const reg = /^1[3|4|5|7|8][0-9]\d{8}$/ const reg = /^1[3|4|5|7|8][0-9]\d{8}$/
console.log(reg.test(value)) console.log(reg.test(value))
if (reg.test(value)) { if (reg.test(value)) {
callback() callback()
} else { } else {
return callback(new Error('请输入正确的手机号')) return callback(new Error('请输入正确的手机号'))
} }
} }
} }
const checkPassword = (rule, value, callback) => { const checkPassword = (rule, value, callback) => {
if (!value) { if (!value) {
return callback(new Error('密码不能为空')) return callback(new Error('密码不能为空'))
} else { } else {
const reg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$/ const reg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$/
console.log(reg.test(value)) console.log(reg.test(value))
if (reg.test(value)) { if (reg.test(value)) {
callback() callback()
} else { } else {
return callback(new Error('中英文混合6-20位,区分大小写')) return callback(new Error('中英文混合6-20位,区分大小写'))
} }
} }
} }
const checkConfirmPassword = (rule, value, callback) => { const checkConfirmPassword = (rule, value, callback) => {
if (!value) { if (!value) {
return callback(new Error('确认密码不能为空')) return callback(new Error('确认密码不能为空'))
} else if (value !== this.formParams.password) { } else if (value !== this.formParams.password) {
callback(new Error('两次输入密码不一致!')) callback(new Error('两次输入密码不一致!'))
} }
callback() callback()
} }
const isEmpty = (rule, value, callback) => { const isEmpty = (rule, value, callback) => {
if (!value) { if (!value) {
this.activeName = 'authorize' this.activeName = 'authorize'
return callback(new Error('手机号不能为空')) return callback(new Error('手机号不能为空'))
} }
callback() callback()
} }
return { return {
activeName: 'authorize', activeName: 'authorize',
formParams: { formParams: {
posType: { posType: {
code: 'NORMALSTORE' code: 'NORMALSTORE'
}, },
status: { status: {
code: 'NORMAL' code: 'NORMAL'
} }
}, },
addLoading: false, addLoading: false,
rules: { rules: {
name: [ name: [
{ required: true, validator: isEmpty, message: '请输入店铺名称', trigger: ['blur', 'change'] } { required: true, validator: isEmpty, message: '请输入店铺名称', trigger: ['blur', 'change'] }
], ],
startTime: [ startTime: [
{ type: 'date', required: true, validator: isEmpty, message: '请输入生效日期', trigger: ['blur', 'change'] } { type: 'date', required: true, validator: isEmpty, message: '请输入生效日期', trigger: ['blur', 'change'] }
], ],
expireLimitYear: [ expireLimitYear: [
{ required: true, validator: isEmpty, message: '请输入生效日期', trigger: ['blur', 'change'] } { required: true, validator: isEmpty, message: '请输入生效日期', trigger: ['blur', 'change'] }
], ],
mobile: [ mobile: [
{ required: true, validator: checkPhone, message: '请输入11位数手机号', trigger: ['blur', 'change'] } { required: true, validator: checkPhone, message: '请输入11位数手机号', trigger: ['blur', 'change'] }
], ],
password: [ password: [
{ required: true, validator: checkPassword, message: '中英文混合6-20位,区分大小写', trigger: ['blur', 'change'] }, { required: true, validator: checkPassword, message: '中英文混合6-20位,区分大小写', trigger: ['blur', 'change'] },
{ min: 6, max: 20, message: '长度在 6 到 20 个字符', trigger: 'blur' } { min: 6, max: 20, message: '长度在 6 到 20 个字符', trigger: 'blur' }
], ],
confirmPassword: [ confirmPassword: [
{ required: true, message: '确认密码不能为空', trigger: ['blur', 'change'] }, { required: true, message: '确认密码不能为空', trigger: ['blur', 'change'] },
{ required: true, validator: checkConfirmPassword, trigger: ['blur'] } { required: true, validator: checkConfirmPassword, trigger: ['blur'] }
] ]
} }
} }
}, },
methods: { methods: {
open() { open() {
this.resetForm() this.resetForm()
}, },
close() { close() {
this.$emit('close') this.$emit('close')
}, },
next() { next() {
this.activeName = 'account' this.activeName = 'account'
}, },
onSubmit() { onSubmit() {
console.log(this.formParams) console.log(this.formParams)
const addForm = this.$refs.addForm const addForm = this.$refs.addForm
addForm.validate((valid) => { addForm.validate((valid) => {
if (valid) { if (valid) {
this.addManagement() this.addManagement()
} else { } else {
return false return false
} }
}) })
}, },
resetForm() { resetForm() {
this.$emit('close') this.$emit('close')
this.activeName = 'authorize' this.activeName = 'authorize'
this.$refs.addForm && this.$refs.addForm.resetFields() this.$refs.addForm && this.$refs.addForm.resetFields()
}, },
async addManagement() { async addManagement() {
const vm = this const vm = this
vm.addLoading = true vm.addLoading = true
Management.addTenant(vm.formParams).then((res) => { Management.addTenant(vm.formParams).then((res) => {
vm.addLoading = false vm.addLoading = false
// const resData = res.data // const resData = res.data
vm.addLoading = false vm.addLoading = false
// if (resData.code === 0) { // if (resData.code === 0) {
vm.resetForm() vm.resetForm()
vm.$message({ vm.$message({
message: '创建成功!', message: '创建成功!',
type: 'success' type: 'success'
}) })
// } // }
}) })
} }
} }
} }
</script> </script>
<style lang="less"> <style lang="less">
.add-dialog-component { .add-dialog-component {
.tree-box { .tree-box {
.el-tree-node__content { .el-tree-node__content {
margin-bottom: 15px; margin-bottom: 15px;
height: auto; height: auto;
} }
} }
} }
</style> </style>
<style lang="less" scoped> <style lang="less" scoped>
.add-dialog-component { .add-dialog-component {
padding: 15px 20px; padding: 15px 20px;
max-height: 80vh; max-height: 80vh;
overflow: auto; overflow: auto;
.tree-box { .tree-box {
margin: 15px 0; margin: 15px 0;
.custom-tree-node { .custom-tree-node {
display: flex; display: flex;
width: 100%; width: 100%;
text-align: left; text-align: left;
.content { .content {
flex: 1; flex: 1;
} }
.setting-box { .setting-box {
} }
} }
} }
.add-btn-wrap { .add-btn-wrap {
text-align: center; text-align: center;
} }
} }
</style> </style>

420
src/components/Management/Container.vue

@ -1,208 +1,212 @@
<template> <template>
<div class="management-container-component"> <div class="management-container-component">
<Table :data="dataList.records" style="width: 100%" border> <Table :data="dataList.records" style="width: 100%" border>
<table-column prop="name" label="店铺名称" /> <table-column prop="name" label="店铺名称" />
<table-column prop="code" label="店铺编码" /> <table-column prop="code" label="店铺编码" />
<table-column prop="posType.desc" label="店铺类型" width="180" /> <!-- <table-column prop="posType.desc" label="店铺类型" width="180" /> -->
<table-column prop="duty" label="负责人" width="180" /> <table-column prop="duty" label="负责人" width="180" />
<table-column prop="contactTel" label="联系电话" width="180" /> <table-column prop="contactTel" label="联系电话" width="180" />
<table-column label="合同状态" width="180"> <table-column label="合同状态" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.status.code | state }} {{ scope.row.status.code | state }}
</template> </template>
</table-column> </table-column>
<table-column prop="createTime" label="创建时间" width="180" /> <table-column prop="createTime" label="创建时间" width="180" />
<table-column label="操作"> <table-column label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="text" type="text"
size="small" size="small"
@click.native.prevent="checkRow(scope.row, true)" @click.native.prevent="checkRow(scope.row, true)"
> >
查看 查看
</el-button> </el-button>
<el-button <el-button
type="text" type="text"
size="small" size="small"
@click.native.prevent="checkRow(scope.row, false)" @click.native.prevent="checkRow(scope.row, false)"
> >
编辑 编辑
</el-button> </el-button>
<el-button <el-button
type="text" type="text"
size="small" size="small"
@click.native.prevent="prohibit(scope.row)" @click.native.prevent="prohibit(scope.row)"
> >
{{ scope.row.status.code | prohibitTips }} {{ scope.row.status.code | prohibitTips }}
</el-button> </el-button>
<el-button <el-button
type="text" type="text"
size="small" size="small"
@click.native.prevent="fixRole(scope.row)" @click.native.prevent="fixRole(scope.row)"
> >
权限恢复 权限恢复
</el-button> </el-button>
</template> </template>
</table-column> </table-column>
</Table> </Table>
<pagination <pagination
v-show="dataList.total > 0" v-show="dataList.total > 0"
:limit.sync="form.size" :limit.sync="form.size"
:page.sync="form.current" :page.sync="form.current"
:total="Number(dataList.total)" :total="Number(dataList.total)"
@pagination="fetch" @pagination="fetch"
/> />
<Dialog <Dialog
:center="true" :center="true"
:title="checkData.check ?'查看商家': '修改商家'" :title="checkData.check ?'查看商家': '修改商家'"
:visible.sync="checkVisible" :visible.sync="checkVisible"
:fullscreen="!true" :fullscreen="!true"
:before-close="closeCheckDialog" :before-close="closeCheckDialog"
class="check-dialog" class="check-dialog"
width="55%" width="55%"
> >
<checkDialog v-if="checkVisible" :data-map="checkData" @close="closeCheckDialog" /> <checkDialog ref="checkDialog" v-if="checkVisible" :dataMap="list" @close="closeCheckDialog" />
</Dialog> </Dialog>
</div> </div>
</template> </template>
<script> <script>
import Management from '@/api/Management.js' import Management from '@/api/Management.js'
import { Table, TableColumn, Dialog } from 'element-ui' import { Table, TableColumn, Dialog } from 'element-ui'
import Pagination from '@/components/Pagination' import Pagination from '@/components/Pagination'
import checkDialog from '@/components/Management/checkDialog' import checkDialog from '@/components/Management/checkDialog'
export default { export default {
components: { Table, TableColumn, Dialog, checkDialog, Pagination }, components: { Table, TableColumn, Dialog, checkDialog, Pagination },
filters: { filters: {
state(code) { state(code) {
const stateMap = { const stateMap = {
NORMAL: '有效', NORMAL: '有效',
FORBIDDEN: '无效' FORBIDDEN: '无效'
} }
return stateMap[code] return stateMap[code]
}, },
prohibitTips(code) { prohibitTips(code) {
const stateMap = { const stateMap = {
NORMAL: '禁用', NORMAL: '禁用',
FORBIDDEN: '启用' FORBIDDEN: '启用'
} }
return stateMap[code] return stateMap[code]
} }
}, },
props: { props: {
dataList: { dataList: {
type: Object, type: Object,
default() { default() {
return {} return {}
} }
} }
}, },
data() { data() {
return { return {
checkVisible: false, checkVisible: false,
checkData: { checkData: {
status: {} status: {},
}, defaultPay: false
form: { },
current: 1, form: {
size: 10 current: 1,
} size: 10
} },
}, list: {}
methods: { }
fetch() { },
this.$emit('fetch', this.form) methods: {
}, fetch() {
checkRow(item, v) { this.$emit('fetch', this.form)
item.check = v },
this.checkVisible = true checkRow(item, v) {
this.checkData = item item.check = v
console.log(this.checkData, 11) this.checkVisible = true
}, this.checkData = item
closeCheckDialog() { this.list = item
this.checkVisible = false console.log(this.checkData, 11)
this.checkData = {} },
}, closeCheckDialog() {
prohibit(item) { this.checkVisible = false
const code = item.status.code this.checkData = {}
const stateMap = { console.log(this.$refs.checkDialog.dataMap,"dataMap")
NORMAL: '禁用', },
FORBIDDEN: '启用' prohibit(item) {
} const code = item.status.code
console.log((item)) const stateMap = {
this.$confirm(`是否${stateMap[code]}?`, '提示', { NORMAL: '禁用',
confirmButtonText: '确定', FORBIDDEN: '启用'
cancelButtonText: '取消', }
type: 'warning' console.log((item))
}).then(() => { this.$confirm(`是否${stateMap[code]}?`, '提示', {
this.prohibitPut(item) confirmButtonText: '确定',
}) cancelButtonText: '取消',
}, type: 'warning'
fixRole(item) { }).then(() => {
Management.fixRole(item.code).then(res => { this.prohibitPut(item)
this.$message({ })
message: '权限修复完成', },
type: 'success', fixRole(item) {
center: true Management.fixRole(item.code).then(res => {
}); this.$message({
}); message: '权限修复完成',
}, type: 'success',
async prohibitPut(item) { center: true
const code = item.status.code });
const id = item.id });
const stateMap = { },
NORMAL: '禁用', async prohibitPut(item) {
FORBIDDEN: '启用' const code = item.status.code
} const id = item.id
const prohibitMap = { const stateMap = {
NORMAL: 'FORBIDDEN', NORMAL: '禁用',
FORBIDDEN: 'NORMAL' FORBIDDEN: '启用'
} }
const res = await Management.editTenant({ const prohibitMap = {
id, NORMAL: 'FORBIDDEN',
status: { FORBIDDEN: 'NORMAL'
code: prohibitMap[code] }
} const res = await Management.editTenant({
}) id,
const resData = res.data status: {
if (resData.code === 0) { code: prohibitMap[code]
item.status.code = prohibitMap[code] }
this.$message({ })
type: 'success', const resData = res.data
message: `${stateMap[code]}成功!` if (resData.code === 0) {
}) item.status.code = prohibitMap[code]
} else { this.$message({
this.$message({ type: 'success',
type: 'error', message: `${stateMap[code]}成功!`
message: `${stateMap[code]}失败!` })
}) } else {
} this.$message({
} type: 'error',
} message: `${stateMap[code]}失败!`
} })
</script> }
<style lang="less" scoped> }
.management-container-component { }
padding: 0 20px; }
} </script>
<style lang="less" scoped>
/deep/ .el-table { .management-container-component {
th { padding: 0 20px;
background: #EEF3FF; }
color:#333333;
font-size:16px; /deep/ .el-table {
font-weight: 400; th {
border-color: #E0E5EB; background: #EEF3FF;
text-align: center; color:#333333;
} font-size:16px;
td { font-weight: 400;
font-size: 14px; border-color: #E0E5EB;
text-align: center; text-align: center;
color: #666666; }
} td {
font-size: 14px;
.cell { text-align: center;
text-align: center; color: #666666;
white-space: pre-line;/*保留换行符*/ }
}
} .cell {
</style> text-align: center;
white-space: pre-line;/*保留换行符*/
}
}
</style>

164
src/components/Management/SearchBar.vue

@ -1,82 +1,82 @@
<template> <template>
<div class="search-bar-component"> <div class="search-bar-component">
<Form :inline="true" :model="formParams"> <Form :inline="true" :model="formParams">
<form-item label="店铺名称"> <form-item label="店铺名称">
<Input v-model="formParams.name" size="mini" placeholder="店铺名称" /> <Input v-model="formParams.name" size="mini" placeholder="店铺名称" />
</form-item> </form-item>
<form-item label="店铺编码"> <form-item label="店铺编码">
<Input v-model="formParams.code" size="mini" placeholder="店铺编码" /> <Input v-model="formParams.code" size="mini" placeholder="店铺编码" />
</form-item> </form-item>
<form-item label="负责人"> <form-item label="负责人">
<Input v-model="formParams.duty" size="mini" placeholder="负责人" /> <Input v-model="formParams.duty" size="mini" placeholder="负责人" />
</form-item> </form-item>
<form-item label="合同状态"> <form-item label="合同状态">
<Select v-model="formParams.status.code" size="mini"> <Select v-model="formParams.status.code" size="mini">
<Option label="全部" value="NORMAL" /> <Option label="全部" value="NORMAL" />
<Option label="有效" value="NORMAL" /> <Option label="有效" value="NORMAL" />
<Option label="无效" value="FORBIDDEN" /> <Option label="无效" value="FORBIDDEN" />
</Select> </Select>
</form-item> </form-item>
<form-item> <form-item>
<Button type="primary" size="mini" @click="query">查询</Button> <Button type="primary" size="mini" @click="query">查询</Button>
<Button plain size="mini" @click="reset">重置</Button> <Button plain size="mini" @click="reset">重置</Button>
<Button type="success" size="mini" @click="addManagement">新建商家</Button> <Button type="success" size="mini" @click="addManagement">新建商家</Button>
</form-item> </form-item>
</Form> </Form>
</div> </div>
</template> </template>
<script> <script>
import { Form, FormItem, Input, Select, Option, Button } from 'element-ui' import { Form, FormItem, Input, Select, Option, Button } from 'element-ui'
export default { export default {
components: { components: {
Form, Form,
FormItem, FormItem,
Input, Input,
Select, Select,
Option, Option,
Button Button
}, },
data() { data() {
return { return {
formParams: { formParams: {
name: '', name: '',
code: '', code: '',
duty: '', duty: '',
status: { status: {
code: '' code: ''
} }
} }
} }
}, },
methods: { methods: {
query() { query() {
this.$emit('query', this.formParams) this.$emit('query', this.formParams)
}, },
addManagement() { addManagement() {
this.$emit('addManagement') this.$emit('addManagement')
}, },
reset() { reset() {
this.formParams = { this.formParams = {
name: '', name: '',
code: '', code: '',
duty: '', duty: '',
status: { status: {
code: '' code: ''
} }
} }
} }
} }
} }
</script> </script>
<style lang="less"> <style lang="less">
.search-bar-component { .search-bar-component {
.el-form-item { .el-form-item {
margin-bottom: 8px; margin-bottom: 8px;
} }
} }
</style> </style>
<style lang="less" scoped> <style lang="less" scoped>
.search-bar-component { .search-bar-component {
padding: 15px 20px; padding: 15px 20px;
} }
</style> </style>

376
src/components/Management/checkDialog.vue

@ -1,185 +1,191 @@
<template> <template>
<div class="add-dialog-component"> <div class="add-dialog-component">
<Form ref="addForm" label-width="150px" :model="dataMap"> <Form ref="addForm" label-width="150px" :model="dataMap">
<Tabs v-model="activeName"> <Tabs v-model="activeName">
<tab-pane label="授权信息" name="authorize"> <tab-pane label="授权信息" name="authorize">
<form-item label="店铺名称" prop="name"> <form-item label="店铺名称" prop="name">
<Input <Input
v-model="dataMap.name" v-model="dataMap.name"
:disabled="dataMap.check" :disabled="dataMap.check"
size="medium" size="medium"
maxlength="30" maxlength="30"
show-word-limit show-word-limit
clearable clearable
/> />
</form-item> </form-item>
<form-item label="店铺负责人" prop="duty"> <form-item label="店铺负责人" prop="duty">
<Input <Input
v-model="dataMap.duty" v-model="dataMap.duty"
:disabled="dataMap.check" :disabled="dataMap.check"
size="medium" size="medium"
maxlength="50" maxlength="50"
show-word-limit show-word-limit
clearable clearable
/> />
</form-item> </form-item>
<form-item label="联系电话"> <form-item label="联系电话">
<Input <Input
v-model="dataMap.contactTel" v-model="dataMap.contactTel"
:disabled="dataMap.check" :disabled="dataMap.check"
size="medium" size="medium"
maxlength="50" maxlength="50"
show-word-limit show-word-limit
clearable clearable
/> />
</form-item> </form-item>
<form-item label="联系地址"> <form-item label="联系地址">
<Input <Input
v-model="dataMap.address" v-model="dataMap.address"
:disabled="dataMap.check" :disabled="dataMap.check"
size="medium" size="medium"
maxlength="50" maxlength="50"
show-word-limit show-word-limit
clearable clearable
/> />
</form-item> </form-item>
<form-item label="生效日期" prop="startTime"> <form-item label="生效日期" prop="startTime">
<date-picker <date-picker
v-model="dataMap.startTime" v-model="dataMap.startTime"
:disabled="dataMap.check" :disabled="dataMap.check"
size="medium" size="medium"
type="date" type="date"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
/> />
</form-item> </form-item>
<form-item label="生效时限(年)" prop="expireLimitYear"> <form-item label="生效时限(年)" prop="expireLimitYear">
<Input <Input
v-model="dataMap.expireLimitYear" v-model="dataMap.expireLimitYear"
:disabled="dataMap.check" :disabled="dataMap.check"
size="medium" size="medium"
maxlength="4" maxlength="4"
show-word-limit show-word-limit
clearable clearable
/> />
</form-item> </form-item>
<form-item label="合同状态"> <!-- <form-item label="合同状态">
<Select v-model="dataMap.status.code" disabled size="mini"> <Select v-model="dataMap.status.code" disabled size="mini">
<Option label="有效" value="NORMAL" /> <Option label="有效" value="NORMAL" />
<Option label="无效" value="FORBIDDEN" /> <Option label="无效" value="FORBIDDEN" />
</Select> </Select>
</form-item> </form-item> -->
<form-item label="账号" prop="mobile"> <form-item label="是否使用平台收款" prop="mobile">
<Input <el-radio-group size="small" v-model="dataMap.defaultPay">
v-model="dataMap.account" <el-radio-button :label="true">{{ $t('common.yes') }}</el-radio-button>
:disabled="dataMap.check" <el-radio-button :label="false">{{ $t('common.no') }}</el-radio-button>
size="medium" </el-radio-group>
maxlength="11" </form-item>
show-word-limit <form-item label="账号" prop="mobile">
clearable <Input
/> v-model="dataMap.account"
</form-item> :disabled="dataMap.check"
size="medium"
<form-item label="收单类型"> maxlength="11"
<Select v-model="dataMap.posType.code" size="mini"> show-word-limit
<Option label="普通餐饮" value="NORMALSTORE" /> clearable
<Option label="快消餐饮" value="FASTSTORE" /> />
<Option label="零售店" value="RETAILSTORE" /> </form-item>
</Select>
</form-item> <!-- <form-item label="收单类型">
<Select v-model="dataMap.posType.code" size="mini">
<form-item size="large"> <Option label="普通餐饮" value="NORMALSTORE" />
<Button v-if="!dataMap.check" type="primary" @click="sumbit">确定</Button> <Option label="快消餐饮" value="FASTSTORE" />
</form-item> <Option label="零售店" value="RETAILSTORE" />
</tab-pane> </Select>
</Tabs> </form-item> -->
</Form>
</div> <form-item size="large">
</template> <Button v-if="!dataMap.check" type="primary" @click="sumbit">确定</Button>
<script> </form-item>
import { Tabs, TabPane, Form, FormItem, Input, Button, Select, Option, DatePicker } from 'element-ui' </tab-pane>
import Management from '@/api/Management' </Tabs>
export default { </Form>
components: { </div>
Tabs, </template>
TabPane, <script>
Form, import { Tabs, TabPane, Form, FormItem, Input, Button, Select, Option, DatePicker } from 'element-ui'
FormItem, import Management from '@/api/Management'
Input, export default {
Button, components: {
Select, Tabs,
Option, TabPane,
DatePicker Form,
}, FormItem,
props: { Input,
dialogVisible: { Button,
type: Boolean, // Select,
default: false // Option,
}, DatePicker
dataMap: { },
type: Object, props: {
default() { dialogVisible: {
return {} type: Boolean,
} default: false
} },
}, dataMap: {
data() { type: Object,
return { default() {
activeName: 'authorize' return {}
} }
}, }
created() {}, },
methods: { data() {
close() { return {
this.$emit('close') activeName: 'authorize'
}, }
sumbit() { },
const _ = this created() {},
Management.editTenant(this.dataMap).then(res => { methods: {
if (res.data.code === 0) { close() {
_.$message.success('修改成功') this.$emit('close')
_.close() },
} sumbit() {
}) const _ = this
} Management.editTenant(this.dataMap).then(res => {
} if (res.data.code === 0) {
} _.$message.success('修改成功')
</script> _.close()
<style lang="less"> }
.add-dialog-component { })
.tree-box { }
.el-tree-node__content { }
margin-bottom: 15px; }
height: auto; </script>
} <style lang="less">
} .add-dialog-component {
} .tree-box {
</style> .el-tree-node__content {
<style lang="less" scoped> margin-bottom: 15px;
.add-dialog-component { height: auto;
padding: 15px 20px; }
max-height: 80vh; }
overflow: auto; }
</style>
.tree-box { <style lang="less" scoped>
margin: 15px 0; .add-dialog-component {
padding: 15px 20px;
.custom-tree-node { max-height: 80vh;
display: flex; overflow: auto;
width: 100%;
text-align: left; .tree-box {
margin: 15px 0;
.content {
flex: 1; .custom-tree-node {
display: flex;
} width: 100%;
text-align: left;
.setting-box {
} .content {
} flex: 1;
}
}
.add-btn-wrap {
text-align: center; .setting-box {
} }
} }
</style> }
.add-btn-wrap {
text-align: center;
}
}
</style>

62
src/components/MarkdownEditor/default-options.js

@ -1,31 +1,31 @@
// doc: https://nhnent.github.io/tui.editor/api/latest/ToastUIEditor.html#ToastUIEditor // doc: https://nhnent.github.io/tui.editor/api/latest/ToastUIEditor.html#ToastUIEditor
export default { export default {
minHeight: '200px', minHeight: '200px',
previewStyle: 'vertical', previewStyle: 'vertical',
useCommandShortcut: true, useCommandShortcut: true,
useDefaultHTMLSanitizer: true, useDefaultHTMLSanitizer: true,
usageStatistics: false, usageStatistics: false,
hideModeSwitch: false, hideModeSwitch: false,
toolbarItems: [ toolbarItems: [
'heading', 'heading',
'bold', 'bold',
'italic', 'italic',
'strike', 'strike',
'divider', 'divider',
'hr', 'hr',
'quote', 'quote',
'divider', 'divider',
'ul', 'ul',
'ol', 'ol',
'task', 'task',
'indent', 'indent',
'outdent', 'outdent',
'divider', 'divider',
'table', 'table',
'image', 'image',
'link', 'link',
'divider', 'divider',
'code', 'code',
'codeblock' 'codeblock'
] ]
} }

236
src/components/MarkdownEditor/index.vue

@ -1,118 +1,118 @@
<template> <template>
<div :id="id" /> <div :id="id" />
</template> </template>
<script> <script>
// deps for editor // deps for editor
import 'codemirror/lib/codemirror.css' // codemirror import 'codemirror/lib/codemirror.css' // codemirror
import 'tui-editor/dist/tui-editor.css' // editor ui import 'tui-editor/dist/tui-editor.css' // editor ui
import 'tui-editor/dist/tui-editor-contents.css' // editor content import 'tui-editor/dist/tui-editor-contents.css' // editor content
import Editor from 'tui-editor' import Editor from 'tui-editor'
import defaultOptions from './default-options' import defaultOptions from './default-options'
export default { export default {
name: 'MarddownEditor', name: 'MarddownEditor',
props: { props: {
value: { value: {
type: String, type: String,
default: '' default: ''
}, },
id: { id: {
type: String, type: String,
required: false, required: false,
default() { default() {
return 'markdown-editor-' + +new Date() + ((Math.random() * 1000).toFixed(0) + '') return 'markdown-editor-' + +new Date() + ((Math.random() * 1000).toFixed(0) + '')
} }
}, },
options: { options: {
type: Object, type: Object,
default() { default() {
return defaultOptions return defaultOptions
} }
}, },
mode: { mode: {
type: String, type: String,
default: 'markdown' default: 'markdown'
}, },
height: { height: {
type: String, type: String,
required: false, required: false,
default: '300px' default: '300px'
}, },
language: { language: {
type: String, type: String,
required: false, required: false,
default: 'en_US' // https://github.com/nhnent/tui.editor/tree/master/src/js/langs default: 'en_US' // https://github.com/nhnent/tui.editor/tree/master/src/js/langs
} }
}, },
data() { data() {
return { return {
editor: null editor: null
} }
}, },
computed: { computed: {
editorOptions() { editorOptions() {
const options = Object.assign({}, defaultOptions, this.options) const options = Object.assign({}, defaultOptions, this.options)
options.initialEditType = this.mode options.initialEditType = this.mode
options.height = this.height options.height = this.height
options.language = this.language options.language = this.language
return options return options
} }
}, },
watch: { watch: {
value(newValue, preValue) { value(newValue, preValue) {
if (newValue !== preValue && newValue !== this.editor.getValue()) { if (newValue !== preValue && newValue !== this.editor.getValue()) {
this.editor.setValue(newValue) this.editor.setValue(newValue)
} }
}, },
language(val) { language(val) {
this.destroyEditor() this.destroyEditor()
this.initEditor() this.initEditor()
}, },
height(newValue) { height(newValue) {
this.editor.height(newValue) this.editor.height(newValue)
}, },
mode(newValue) { mode(newValue) {
this.editor.changeMode(newValue) this.editor.changeMode(newValue)
} }
}, },
mounted() { mounted() {
this.initEditor() this.initEditor()
}, },
destroyed() { destroyed() {
this.destroyEditor() this.destroyEditor()
}, },
methods: { methods: {
initEditor() { initEditor() {
this.editor = new Editor({ this.editor = new Editor({
el: document.getElementById(this.id), el: document.getElementById(this.id),
...this.editorOptions ...this.editorOptions
}) })
if (this.value) { if (this.value) {
this.editor.setValue(this.value) this.editor.setValue(this.value)
} }
this.editor.on('change', () => { this.editor.on('change', () => {
this.$emit('input', this.editor.getValue()) this.$emit('input', this.editor.getValue())
}) })
}, },
destroyEditor() { destroyEditor() {
if (!this.editor) return if (!this.editor) return
this.editor.off('change') this.editor.off('change')
this.editor.remove() this.editor.remove()
}, },
setValue(value) { setValue(value) {
this.editor.setValue(value) this.editor.setValue(value)
}, },
getValue() { getValue() {
return this.editor.getValue() return this.editor.getValue()
}, },
setHtml(value) { setHtml(value) {
this.editor.setHtml(value) this.editor.setHtml(value)
}, },
getHtml() { getHtml() {
return this.editor.getHtml() return this.editor.getHtml()
} }
} }
} }
</script> </script>

206
src/components/Pagination/index.vue

@ -1,103 +1,103 @@
<template> <template>
<div style="display:block" :class="{'hidden':hidden}" class="pagination-container"> <div style="display:block" :class="{'hidden':hidden}" class="pagination-container">
<el-pagination <el-pagination
:background="background" :background="background"
:current-page.sync="currentPage" :current-page.sync="currentPage"
:page-size.sync="pageSize" :page-size.sync="pageSize"
:layout="layout" :layout="layout"
:page-sizes="pageSizes" :page-sizes="pageSizes"
:total="total" :total="total"
v-bind="$attrs" v-bind="$attrs"
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
style="display:block" style="display:block"
/> />
</div> </div>
</template> </template>
<script> <script>
import { scrollTo } from '@/utils/scroll-to' import { scrollTo } from '@/utils/scroll-to'
export default { export default {
name: 'Pagination', name: 'Pagination',
props: { props: {
total: { total: {
required: true, required: true,
type: Number type: Number
}, },
page: { page: {
type: Number, type: Number,
default: 1 default: 1
}, },
limit: { limit: {
type: Number, type: Number,
default: 20 default: 20
}, },
pageSizes: { pageSizes: {
type: Array, type: Array,
default() { default() {
return [5, 10, 20, 30, 50] return [5, 10, 20, 30, 50]
} }
}, },
layout: { layout: {
type: String, type: String,
default: 'total, sizes, prev, pager, next, jumper' default: 'total, sizes, prev, pager, next, jumper'
}, },
background: { background: {
type: Boolean, type: Boolean,
default: true default: true
}, },
autoScroll: { autoScroll: {
type: Boolean, type: Boolean,
default: true default: true
}, },
hidden: { hidden: {
type: Boolean, type: Boolean,
default: false default: false
} }
}, },
computed: { computed: {
currentPage: { currentPage: {
get() { get() {
return this.page return this.page
}, },
set(val) { set(val) {
this.$emit('update:page', val) this.$emit('update:page', val)
} }
}, },
pageSize: { pageSize: {
get() { get() {
return this.limit return this.limit
}, },
set(val) { set(val) {
this.$emit('update:limit', val) this.$emit('update:limit', val)
} }
} }
}, },
methods: { methods: {
handleSizeChange(val) { handleSizeChange(val) {
this.$emit('pagination', { page: this.currentPage, limit: val }) this.$emit('pagination', { page: this.currentPage, limit: val })
if (this.autoScroll) { if (this.autoScroll) {
scrollTo(0, 800) scrollTo(0, 800)
} }
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.$emit('pagination', { page: val, limit: this.pageSize }) this.$emit('pagination', { page: val, limit: this.pageSize })
if (this.autoScroll) { if (this.autoScroll) {
scrollTo(0, 800) scrollTo(0, 800)
} }
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
.pagination-container { .pagination-container {
background: #fff; background: #fff;
padding: 32px 16px 16px 0; padding: 32px 16px 16px 0;
margin-top: 0; margin-top: 0;
} }
.pagination-container.hidden { .pagination-container.hidden {
display: none; display: none;
} }
</style> </style>

280
src/components/PanThumb/index.vue

@ -1,140 +1,140 @@
<template> <template>
<div :style="{zIndex:zIndex,height:height,width:width}" class="pan-item"> <div :style="{zIndex:zIndex,height:height,width:width}" class="pan-item">
<div class="pan-info"> <div class="pan-info">
<div class="pan-info-roles-container"> <div class="pan-info-roles-container">
<slot /> <slot />
</div> </div>
</div> </div>
<img :src="image" class="pan-thumb"> <img :src="image" class="pan-thumb">
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'PanThumb', name: 'PanThumb',
props: { props: {
image: { image: {
type: String, type: String,
required: true required: true
}, },
zIndex: { zIndex: {
type: Number, type: Number,
default: 1 default: 1
}, },
width: { width: {
type: String, type: String,
default: '150px' default: '150px'
}, },
height: { height: {
type: String, type: String,
default: '150px' default: '150px'
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
.pan-item { .pan-item {
width: 200px; width: 200px;
height: 200px; height: 200px;
border-radius: 50%; border-radius: 50%;
display: inline-block; display: inline-block;
position: relative; position: relative;
cursor: default; cursor: default;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
} }
.pan-info-roles-container { .pan-info-roles-container {
padding: 20px; padding: 20px;
text-align: center; text-align: center;
} }
.pan-thumb { .pan-thumb {
width: 100%; width: 100%;
height: 100%; height: 100%;
background-size: 100%; background-size: 100%;
border-radius: 50%; border-radius: 50%;
overflow: hidden; overflow: hidden;
position: absolute; position: absolute;
transform-origin: 95% 40%; transform-origin: 95% 40%;
transition: all 0.3s ease-in-out; transition: all 0.3s ease-in-out;
} }
.pan-thumb:after { .pan-thumb:after {
content: ''; content: '';
width: 8px; width: 8px;
height: 8px; height: 8px;
position: absolute; position: absolute;
border-radius: 50%; border-radius: 50%;
top: 40%; top: 40%;
left: 95%; left: 95%;
margin: -4px 0 0 -4px; margin: -4px 0 0 -4px;
background: radial-gradient(ellipse at center, rgba(14, 14, 14, 1) 0%, rgba(125, 126, 125, 1) 100%); background: radial-gradient(ellipse at center, rgba(14, 14, 14, 1) 0%, rgba(125, 126, 125, 1) 100%);
box-shadow: 0 0 1px rgba(255, 255, 255, 0.9); box-shadow: 0 0 1px rgba(255, 255, 255, 0.9);
} }
.pan-info { .pan-info {
position: absolute; position: absolute;
width: inherit; width: inherit;
height: inherit; height: inherit;
border-radius: 50%; border-radius: 50%;
overflow: hidden; overflow: hidden;
box-shadow: inset 0 0 0 5px rgba(0, 0, 0, 0.05); box-shadow: inset 0 0 0 5px rgba(0, 0, 0, 0.05);
} }
.pan-info h3 { .pan-info h3 {
color: #fff; color: #fff;
text-transform: uppercase; text-transform: uppercase;
position: relative; position: relative;
letter-spacing: 2px; letter-spacing: 2px;
font-size: 18px; font-size: 18px;
margin: 0 60px; margin: 0 60px;
padding: 22px 0 0 0; padding: 22px 0 0 0;
height: 85px; height: 85px;
font-family: 'Open Sans', Arial, sans-serif; font-family: 'Open Sans', Arial, sans-serif;
text-shadow: 0 0 1px #fff, 0 1px 2px rgba(0, 0, 0, 0.3); text-shadow: 0 0 1px #fff, 0 1px 2px rgba(0, 0, 0, 0.3);
} }
.pan-info p { .pan-info p {
color: #fff; color: #fff;
padding: 10px 5px; padding: 10px 5px;
font-style: italic; font-style: italic;
margin: 0 30px; margin: 0 30px;
font-size: 12px; font-size: 12px;
border-top: 1px solid rgba(255, 255, 255, 0.5); border-top: 1px solid rgba(255, 255, 255, 0.5);
} }
.pan-info p a { .pan-info p a {
display: block; display: block;
color: #333; color: #333;
width: 80px; width: 80px;
height: 80px; height: 80px;
background: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.3);
border-radius: 50%; border-radius: 50%;
color: #fff; color: #fff;
font-style: normal; font-style: normal;
font-weight: 700; font-weight: 700;
text-transform: uppercase; text-transform: uppercase;
font-size: 9px; font-size: 9px;
letter-spacing: 1px; letter-spacing: 1px;
padding-top: 24px; padding-top: 24px;
margin: 7px auto 0; margin: 7px auto 0;
font-family: 'Open Sans', Arial, sans-serif; font-family: 'Open Sans', Arial, sans-serif;
opacity: 0; opacity: 0;
transition: transform 0.3s ease-in-out 0.2s, opacity 0.3s ease-in-out 0.2s, background 0.2s linear 0s; transition: transform 0.3s ease-in-out 0.2s, opacity 0.3s ease-in-out 0.2s, background 0.2s linear 0s;
transform: translateX(60px) rotate(90deg); transform: translateX(60px) rotate(90deg);
} }
.pan-info p a:hover { .pan-info p a:hover {
background: rgba(255, 255, 255, 0.5); background: rgba(255, 255, 255, 0.5);
} }
.pan-item:hover .pan-thumb { .pan-item:hover .pan-thumb {
transform: rotate(-110deg); transform: rotate(-110deg);
} }
.pan-item:hover .pan-info p a { .pan-item:hover .pan-info p a {
opacity: 1; opacity: 1;
transform: translateX(0px) rotate(0deg); transform: translateX(0px) rotate(0deg);
} }
</style> </style>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save