Commit f4a9f21d authored by 毛线's avatar 毛线

save

parents
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint',
sourceType: 'module'
},
env: {
browser: true,
node: true,
es6: true,
},
extends: ['plugin:vue/recommended', 'eslint:recommended'],
// add your custom rules here
//it is base on https://github.com/vuejs/eslint-config-vue
rules: {
'vue/no-parsing-error': [2, { "x-invalid-end-tag": false }],
"vue/max-attributes-per-line": [2, {
"singleline": 10,
"multiline": {
"max": 1,
"allowFirstLine": false
}
}],
"vue/name-property-casing": ["error", "PascalCase"],
'accessor-pairs': 2,
'arrow-spacing': [2, {
'before': true,
'after': true
}],
'block-spacing': [2, 'always'],
'brace-style': [2, '1tbs', {
'allowSingleLine': true
}],
'camelcase': [0, {
'properties': 'always'
}],
"comma-dangle": ["error", {
"arrays": "ignore",
"objects": "ignore",
"imports": "ignore",
"exports": "ignore",
"functions": "ignore"
}],
'comma-spacing': [2, {
'before': false,
'after': true
}],
'comma-style': [2, 'last'],
'constructor-super': 2,
'curly': [2, 'multi-line'],
'dot-location': [2, 'property'],
'eol-last': 2,
'eqeqeq': [2, 'allow-null'],
'generator-star-spacing': [2, {
'before': true,
'after': true
}],
'handle-callback-err': [2, '^(err|error)$'],
'indent': [2, 2, {
'SwitchCase': 1
}],
'jsx-quotes': [2, 'prefer-single'],
'key-spacing': [2, {
'beforeColon': false,
'afterColon': true
}],
'keyword-spacing': [2, {
'before': true,
'after': true
}],
'new-cap': [2, {
'newIsCap': true,
'capIsNew': false
}],
'new-parens': 2,
'no-array-constructor': 2,
'no-caller': 2,
'no-console': 'off',
'no-class-assign': 2,
'no-cond-assign': 2,
'no-const-assign': 2,
'no-control-regex': 2,
'no-delete-var': 2,
'no-dupe-args': 2,
'no-dupe-class-members': 2,
'no-dupe-keys': 2,
'no-duplicate-case': 2,
'no-empty-character-class': 2,
'no-empty-pattern': 2,
'no-eval': 2,
'no-ex-assign': 2,
'no-extend-native': 2,
'no-extra-bind': 2,
'no-extra-boolean-cast': 2,
'no-extra-parens': [2, 'functions'],
'no-fallthrough': 2,
'no-floating-decimal': 2,
'no-func-assign': 2,
'no-implied-eval': 2,
'no-inner-declarations': [2, 'functions'],
'no-invalid-regexp': 2,
'no-irregular-whitespace': 2,
'no-iterator': 2,
'no-label-var': 2,
'no-labels': [2, {
'allowLoop': false,
'allowSwitch': false
}],
'no-lone-blocks': 2,
'no-mixed-spaces-and-tabs': 2,
'no-multi-spaces': 2,
'no-multi-str': 2,
'no-multiple-empty-lines': [2, {
'max': 1
}],
'no-native-reassign': 2,
'no-negated-in-lhs': 2,
'no-new-object': 2,
'no-new-require': 2,
'no-new-symbol': 2,
'no-new-wrappers': 2,
'no-obj-calls': 2,
'no-octal': 2,
'no-octal-escape': 2,
'no-path-concat': 2,
'no-proto': 2,
'no-redeclare': 2,
'no-regex-spaces': 2,
'no-return-assign': [2, 'except-parens'],
'no-self-assign': 2,
'no-self-compare': 2,
'no-sequences': 2,
'no-shadow-restricted-names': 2,
'no-spaced-func': 2,
'no-sparse-arrays': 2,
'no-this-before-super': 2,
'no-throw-literal': 2,
'no-trailing-spaces': 2,
'no-undef': 2,
'no-undef-init': 2,
'no-unexpected-multiline': 2,
'no-unmodified-loop-condition': 2,
'no-unneeded-ternary': [2, {
'defaultAssignment': false
}],
'no-unreachable': 2,
'no-unsafe-finally': 2,
// 'no-unused-vars': [2, {
// 'vars': 'local',
// 'args': 'none'
// }],
'no-unused-vars':'off',
'no-useless-call': 2,
'no-useless-computed-key': 2,
'no-useless-constructor': 2,
'no-useless-escape': 0,
'no-whitespace-before-property': 2,
'no-with': 2,
'one-var': [2, {
'initialized': 'never'
}],
'operator-linebreak': [2, 'after', {
'overrides': {
'?': 'before',
':': 'before'
}
}],
'padded-blocks': [2, 'never'],
'quotes': [2, 'single', {
'avoidEscape': true,
'allowTemplateLiterals': true
}],
'semi': [2, 'never'],
'semi-spacing': [2, {
'before': false,
'after': true
}],
'space-before-blocks': [2, 'always'],
'space-before-function-paren': [2, 'never'],
'space-in-parens': [2, 'never'],
'space-infix-ops': 2,
'space-unary-ops': [2, {
'words': true,
'nonwords': false
}],
'spaced-comment': [2, 'always', {
'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
}],
'template-curly-spacing': [2, 'never'],
'use-isnan': 2,
'valid-typeof': 2,
'wrap-iife': [2, 'any'],
'yield-star-spacing': [2, 'both'],
'yoda': [2, 'never'],
'prefer-const': 2,
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'object-curly-spacing': [2, 'always', {
objectsInObjects: false
}],
'array-bracket-spacing': [2, 'never']
}
}
# Created by .ignore support plugin (hsz.mobi)
### Node template
# Logs
/logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
# parcel-bundler cache (https://parceljs.org/)
.cache
# next.js build output
.next
# nuxt.js build output
.nuxt
# Nuxt generate
dist
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless
# IDE / Editor
.idea
# Service worker
sw.*
# macOS
.DS_Store
# Vim swap files
*.swp
# fresh
> fresh
## Build Setup
```bash
# install dependencies
$ npm install
# serve with hot reload at localhost:3000 首次运行需要将configs里的配置文件.env.example拷贝到.env.development作为开发环境配置文件
$ npm run dev
# build for production and launch server
$ npm run build
$ npm run start
# generate static project
$ npm run generate
```
For detailed explanation on how things work, check out [Nuxt.js docs](https://nuxtjs.org).
// 保存从库数据
import request from '@/plugins/axios'
export function getDicts() {
return request({
url: '/slave/redOrSave/saveSlaveData',
method: 'post',
timeout: 600000
})
}
# ASSETS
**This directory is not required, you can delete it if you don't want to use it.**
This directory contains your un-compiled assets such as LESS, SASS, or JavaScript.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#webpacked).
import Vue from 'vue'
import SvgIcon from '@/components/SvgIcon' // svg组件
// register globally
Vue.component('svg-icon', SvgIcon)
const requireAll = requireContext => requireContext.keys().map(requireContext)
const req = require.context('./svg', false, /\.svg$/)
requireAll(req)
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M563.2 512l243.712-243.712a34.304 34.304 0 1 0-51.2-51.2L512 460.8 268.288 219.648a34.304 34.304 0 0 0-51.2 51.2L460.8 512l-241.152 243.712a34.304 34.304 0 0 0 51.2 51.2L512 563.2l243.712 243.712a34.304 34.304 0 1 0 51.2-51.2z" /></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M962.4 312 736 538.4c-16 16-40.8 16-56.8 0L453.6 312c-16-16-16-40.8 0-56.8L680 29.6c16-16 40.8-16 56.8 0L962.4 256C978.4 271.2 978.4 296.8 962.4 312zM380 972l-320 0c-22.4 0-40-17.6-40-40l0-320c0-22.4 17.6-40 40-40l320 0c22.4 0 40 17.6 40 40l0 320C420 954.4 402.4 972 380 972zM380 492l-320 0c-22.4 0-40-17.6-40-40l0-320c0-22.4 17.6-40 40-40l320 0c22.4 0 40 17.6 40 40l0 320C420 474.4 402.4 492 380 492zM540 572l320 0c22.4 0 40 17.6 40 40l0 320c0 22.4-17.6 40-40 40l-320 0c-22.4 0-40-17.6-40-40l0-320C500 589.6 517.6 572 540 572z" /></svg>
\ No newline at end of file
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M96.258 57.462h31.421C124.794 27.323 100.426 2.956 70.287.07v31.422a32.856 32.856 0 0 1 25.971 25.97zm-38.796-25.97V.07C27.323 2.956 2.956 27.323.07 57.462h31.422a32.856 32.856 0 0 1 25.97-25.97zm12.825 64.766v31.421c30.46-2.885 54.507-27.253 57.713-57.712H96.579c-2.886 13.466-13.146 23.726-26.292 26.291zM31.492 70.287H.07c2.886 30.46 27.253 54.507 57.713 57.713V96.579c-13.466-2.886-23.726-13.146-26.291-26.292z"/></svg>
\ No newline at end of file
<svg class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="128" height="128"><defs><style/></defs><path d="M512 128q69.675 0 135.51 21.163t115.498 54.997 93.483 74.837 73.685 82.006 51.67 74.837 32.17 54.827L1024 512q-2.347 4.992-6.315 13.483T998.87 560.17t-31.658 51.669-44.331 59.99-56.832 64.34-69.504 60.16-82.347 51.5-94.848 34.687T512 896q-69.675 0-135.51-21.163t-115.498-54.826-93.483-74.326-73.685-81.493-51.67-74.496-32.17-54.997L0 513.707q2.347-4.992 6.315-13.483t18.816-34.816 31.658-51.84 44.331-60.33 56.832-64.683 69.504-60.331 82.347-51.84 94.848-34.816T512 128.085zm0 85.333q-46.677 0-91.648 12.331t-81.152 31.83-70.656 47.146-59.648 54.485-48.853 57.686-37.675 52.821-26.325 43.99q12.33 21.674 26.325 43.52t37.675 52.351 48.853 57.003 59.648 53.845T339.2 767.02t81.152 31.488T512 810.667t91.648-12.331 81.152-31.659 70.656-46.848 59.648-54.186 48.853-57.344 37.675-52.651T927.957 512q-12.33-21.675-26.325-43.648t-37.675-52.65-48.853-57.345-59.648-54.186-70.656-46.848-81.152-31.659T512 213.334zm0 128q70.656 0 120.661 50.006T682.667 512 632.66 632.661 512 682.667 391.339 632.66 341.333 512t50.006-120.661T512 341.333zm0 85.334q-35.328 0-60.33 25.002T426.666 512t25.002 60.33T512 597.334t60.33-25.002T597.334 512t-25.002-60.33T512 426.666z"/></svg>
<svg width="128" height="64" xmlns="http://www.w3.org/2000/svg"><path d="M127.072 7.994c1.37-2.208.914-5.152-.914-6.87-2.056-1.717-4.797-1.226-6.396.982-.229.245-25.586 32.382-55.74 32.382-29.24 0-55.74-32.382-55.968-32.627-1.6-1.963-4.57-2.208-6.397-.49C-.17 3.086-.399 6.275 1.2 8.238c.457.736 5.94 7.36 14.62 14.72L4.17 35.96c-1.828 1.963-1.6 5.152.228 6.87.457.98 1.6 1.471 2.742 1.471s2.284-.49 3.198-1.472l12.564-13.983c5.94 4.416 13.021 8.587 20.788 11.53l-4.797 17.418c-.685 2.699.686 5.397 3.198 6.133h1.37c2.057 0 3.884-1.472 4.341-3.68L52.6 42.83c3.655.736 7.538 1.227 11.422 1.227 3.883 0 7.767-.49 11.422-1.227l4.797 17.173c.457 2.208 2.513 3.68 4.34 3.68.457 0 .914 0 1.143-.246 2.513-.736 3.883-3.434 3.198-6.133l-4.797-17.172c7.767-2.944 14.848-7.114 20.788-11.53l12.336 13.738c.913.981 2.056 1.472 3.198 1.472s2.284-.49 3.198-1.472c1.828-1.963 1.828-4.906.228-6.87l-11.65-13.001c9.366-7.36 14.849-14.474 14.849-14.474z"/></svg>
\ No newline at end of file
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M84.068 23.784c-1.02 0-1.877-.32-2.572-.96a8.588 8.588 0 0 1-1.738-2.237 11.524 11.524 0 0 1-1.042-2.621c-.232-.895-.348-1.641-.348-2.238V0h.278c.834 0 1.622.085 2.363.256.742.17 1.645.575 2.711 1.214 1.066.64 2.363 1.535 3.892 2.686 1.53 1.15 3.453 2.664 5.77 4.54 2.502 2.045 4.494 3.771 5.977 5.178 1.483 1.406 2.618 2.6 3.406 3.58.787.98 1.274 1.812 1.46 2.494.185.682.277 1.278.277 1.79v2.046H84.068zM127.3 84.01c.278.682.464 1.535.556 2.558.093 1.023-.37 2.003-1.39 2.94-.463.427-.88.832-1.25 1.215-.372.384-.696.704-.974.96a6.69 6.69 0 0 1-.973.767l-11.816-10.741a44.331 44.331 0 0 0 1.877-1.535 31.028 31.028 0 0 1 1.737-1.406c1.112-.938 2.317-1.343 3.615-1.215 1.297.128 2.363.405 3.197.83.927.427 1.923 1.173 2.989 2.239 1.065 1.065 1.876 2.195 2.432 3.388zM78.23 95.902c2.038 0 3.752-.511 5.143-1.534l-26.969 25.83H18.037c-1.761 0-3.684-.47-5.77-1.407a24.549 24.549 0 0 1-5.838-3.709 21.373 21.373 0 0 1-4.518-5.306c-1.204-2.003-1.807-4.07-1.807-6.202V16.495c0-1.79.44-3.665 1.32-5.626A18.41 18.41 0 0 1 5.04 5.562a21.798 21.798 0 0 1 5.213-3.964C12.198.533 14.237 0 16.37 0h53.24v15.984c0 1.62.278 3.367.834 5.242a16.704 16.704 0 0 0 2.572 5.179c1.159 1.577 2.665 2.898 4.518 3.964 1.853 1.066 4.078 1.598 6.673 1.598h20.295v42.325L85.458 92.45c1.02-1.364 1.529-2.856 1.529-4.476 0-2.216-.857-4.113-2.572-5.69-1.714-1.577-3.776-2.366-6.186-2.366H26.1c-2.409 0-4.448.789-6.116 2.366-1.668 1.577-2.502 3.474-2.502 5.69 0 2.217.834 4.092 2.502 5.626 1.668 1.535 3.707 2.302 6.117 2.302h52.13zM26.1 47.951c-2.41 0-4.449.789-6.117 2.366-1.668 1.577-2.502 3.473-2.502 5.69 0 2.216.834 4.092 2.502 5.626 1.668 1.534 3.707 2.302 6.117 2.302h52.13c2.409 0 4.47-.768 6.185-2.302 1.715-1.534 2.572-3.41 2.572-5.626 0-2.217-.857-4.113-2.572-5.69-1.714-1.577-3.776-2.366-6.186-2.366H26.1zm52.407 64.063l1.807-1.663 3.476-3.196a479.75 479.75 0 0 0 4.587-4.284 500.757 500.757 0 0 1 5.004-4.667c3.985-3.666 8.48-7.758 13.485-12.276l11.677 10.741-13.485 12.404-5.004 4.603-4.587 4.22a179.46 179.46 0 0 0-3.267 3.068c-.88.853-1.367 1.322-1.46 1.407-.463.341-.973.703-1.529 1.087-.556.383-1.112.703-1.668.959-.556.256-1.413.575-2.572.959a83.5 83.5 0 0 1-3.545 1.087 72.2 72.2 0 0 1-3.475.895c-1.112.256-1.946.426-2.502.511-1.112.17-1.854.043-2.224-.383-.371-.426-.464-1.151-.278-2.174.092-.511.278-1.279.556-2.302.278-1.023.602-2.067.973-3.132l1.042-3.005c.325-.938.58-1.577.765-1.918a10.157 10.157 0 0 1 2.224-2.941z"/></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M871.424 61.44q18.432 0 34.816 6.656t28.672 18.944 19.456 28.672 7.168 35.84v720.896q0 38.912-25.088 64.512t-62.976 25.6h-721.92q-40.96 0-66.048-26.624t-25.088-66.56V150.528q0-35.84 24.576-62.464t65.536-26.624h720.896z m-237.568 768q18.432 0 26.624-8.704t8.192-23.04q0-13.312-8.192-22.528t-26.624-9.216h-62.464q1.024-2.048 1.024-6.144V251.904h63.488q18.432 0 25.6-9.216t7.168-22.528-7.168-22.528-25.6-9.216H386.048q-18.432 0-25.6 9.216t-7.168 22.528 7.168 22.528 25.6 9.216h57.344v507.904q0 2.048 0.512 3.072t0.512 3.072h-56.32q-18.432 0-26.624 9.216t-8.192 22.528q0 14.336 8.192 23.04t26.624 8.704h245.76z" /></svg>
\ No newline at end of file
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><g><path d="M115.625 127.937H.063V12.375h57.781v12.374H12.438v90.813h90.813V70.156h12.374z"/><path d="M116.426 2.821l8.753 8.753-56.734 56.734-8.753-8.745z"/><path d="M127.893 37.982h-12.375V12.375H88.706V0h39.187z"/></g></svg>
\ No newline at end of file
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M.002 9.2c0 5.044 3.58 9.133 7.998 9.133 4.417 0 7.997-4.089 7.997-9.133 0-5.043-3.58-9.132-7.997-9.132S.002 4.157.002 9.2zM31.997.066h95.981V18.33H31.997V.066zm0 45.669c0 5.044 3.58 9.132 7.998 9.132 4.417 0 7.997-4.088 7.997-9.132 0-3.263-1.524-6.278-3.998-7.91-2.475-1.63-5.524-1.63-7.998 0-2.475 1.632-4 4.647-4 7.91zM63.992 36.6h63.986v18.265H63.992V36.6zm-31.995 82.2c0 5.043 3.58 9.132 7.998 9.132 4.417 0 7.997-4.089 7.997-9.132 0-5.044-3.58-9.133-7.997-9.133s-7.998 4.089-7.998 9.133zm31.995-9.131h63.986v18.265H63.992V109.67zm0-27.404c0 5.044 3.58 9.133 7.998 9.133 4.417 0 7.997-4.089 7.997-9.133 0-3.263-1.524-6.277-3.998-7.909-2.475-1.631-5.524-1.631-7.998 0-2.475 1.632-4 4.646-4 7.91zm31.995-9.13h31.991V91.4H95.987V73.135z"/></svg>
\ No newline at end of file
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M108.8 44.322H89.6v-5.36c0-9.04-3.308-24.163-25.6-24.163-23.145 0-25.6 16.881-25.6 24.162v5.361H19.2v-5.36C19.2 15.281 36.798 0 64 0c27.202 0 44.8 15.281 44.8 38.961v5.361zm-32 39.356c0-5.44-5.763-9.832-12.8-9.832-7.037 0-12.8 4.392-12.8 9.832 0 3.682 2.567 6.808 6.407 8.477v11.205c0 2.718 2.875 4.962 6.4 4.962 3.524 0 6.4-2.244 6.4-4.962V92.155c3.833-1.669 6.393-4.795 6.393-8.477zM128 64v49.201c0 8.158-8.645 14.799-19.2 14.799H19.2C8.651 128 0 121.359 0 113.201V64c0-8.153 8.645-14.799 19.2-14.799h89.6c10.555 0 19.2 6.646 19.2 14.799z"/></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1552880036836" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="718" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M992.6 404.1l-94.7 0c-8.7-31.3-21-61-36.6-88.7l66.9-66.9c12.2-12.2 12.2-32.2 0-44.5L820 95.9c-6.1-6.1-14.2-9.2-22.2-9.2s-16.1 3.1-22.2 9.2l-66.9 66.9c-27.7-15.6-57.4-27.9-88.7-36.6L620 31.4c0-17.3-14.2-31.4-31.4-31.4L435.6 0c-17.3 0-31.4 14.2-31.4 31.4l0 94.7c-31.3 8.7-61 21-88.7 36.6l-66.9-66.9c-6.1-6.1-14.2-9.2-22.2-9.2s-16.1 3.1-22.2 9.2L95.9 204c-12.2 12.2-12.2 32.2 0 44.5l66.9 66.9c-15.6 27.7-27.9 57.4-36.6 88.7L31.4 404.1C14.2 404.1 0 418.3 0 435.6l0 152.9c0 17.3 14.2 31.4 31.4 31.4l94.7 0c8.7 31.3 21 61 36.6 88.7l-66.9 66.9c-12.2 12.2-12.2 32.2 0 44.5L204 928.1c6.1 6.1 14.2 9.2 22.2 9.2s16.1-3.1 22.2-9.2l66.9-66.9c27.7 15.6 57.4 27.9 88.7 36.6l0 94.7c0 17.3 14.2 31.4 31.4 31.4l152.9 0c17.3 0 31.4-14.2 31.4-31.4l0-94.7c31.3-8.7 61-21 88.7-36.6l66.9 66.9c6.1 6.1 14.2 9.2 22.2 9.2s16.1-3.1 22.2-9.2L928.1 820c12.2-12.2 12.2-32.2 0-44.5l-66.9-66.9c15.6-27.7 27.9-57.4 36.6-88.7l94.7 0c17.3 0 31.4-14.2 31.4-31.4L1023.9 435.6C1024 418.3 1009.9 404.1 992.6 404.1zM960 555.9l-62.2 0-48.6 0-13.1 46.8c-7.3 26.3-17.7 51.4-30.7 74.5l-23.9 42.3 34.4 34.4 43.9 43.9-62.1 62.1-43.9-43.9-34.4-34.4-42.3 23.9c-23.1 13-48.2 23.4-74.5 30.7l-46.8 13.1 0 48.6L555.8 960l-87.8 0 0-62.2 0-48.6-46.8-13.1c-26.3-7.3-51.4-17.7-74.5-30.7l-42.3-23.9-34.4 34.4-43.9 43.9-62.1-62.1 43.9-43.9 34.4-34.4-23.9-42.3c-13-23.1-23.4-48.2-30.7-74.5l-13.1-46.8-48.6 0L64 555.8l0-87.8 62.2 0 48.6 0 13.1-46.8c7.3-26.3 17.7-51.4 30.7-74.5l23.9-42.3-34.4-34.4-43.9-43.9 62.1-62.1 43.9 43.9 34.4 34.4 42.3-23.9c23.1-13 48.2-23.4 74.5-30.7l46.8-13.1 0-48.6L468.2 64l87.8 0 0 62.2 0 48.6 46.8 13.1c26.3 7.3 51.4 17.7 74.5 30.7l42.3 23.9 34.4-34.4 43.9-43.9 62.1 62.1-43.9 43.9-34.4 34.4 23.9 42.3c13 23.1 23.4 48.2 30.7 74.5l13.1 46.8 48.6 0L960 468.2 960 555.9z" p-id="719"></path><path d="M512 320c-106 0-192 86-192 192 0 106 86 192 192 192 106 0 192-86 192-192C704 406 618 320 512 320zM602.5 602.5C578.3 626.7 546.2 640 512 640c-34.2 0-66.3-13.3-90.5-37.5C397.3 578.3 384 546.2 384 512c0-34.2 13.3-66.3 37.5-90.5 24.2-24.2 56.3-37.5 90.5-37.5 34.2 0 66.3 13.3 90.5 37.5 24.2 24.2 37.5 56.3 37.5 90.5C640 546.2 626.7 578.3 602.5 602.5z" p-id="720"></path></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M934.140924 580.206428l-149.893892 0L784.247033 430.040337c0-14.993482-12.218276-27.191292-27.281343-27.191292-15.152095 0-27.28032 12.30935-27.28032 27.507494l0 149.850913L579.809897 580.207451c-15.21861 0-27.483958 12.218276-27.483958 27.303856 0 15.173584 12.174274 27.28339 27.191292 27.28339l150.166091 0 0 149.869333c0 15.243169 12.218276 27.484981 27.28032 27.484981 15.199167 0 27.281343-12.175297 27.281343-27.170826L784.244986 634.793674l150.211117 0c14.971993 0 27.14729-12.221346 27.14729-27.28339C961.604416 592.3367 949.316555 580.206428 934.140924 580.206428z" /><path d="M78.934259 252.775051l317.092915 0 317.104171 0c8.975419 0 16.551978-9.155521 16.551978-20.451798 0-11.386328-7.53051-20.472264-16.821107-20.472264L79.226924 211.850989c-9.334599 0-16.830317 9.152451-16.830317 20.472264C62.395584 243.686045 69.802274 252.775051 78.934259 252.775051z" /><path d="M79.216691 525.641695l227.840148 0 227.862661 0c9.242502 0 16.821107-9.153474 16.821107-20.47431 0-11.362792-7.529487-20.449751-16.842597-20.449751L79.238181 484.717633c-9.358135 0-16.842597 9.153474-16.842597 20.449751C62.395584 516.553713 69.926094 525.641695 79.216691 525.641695z" /><path d="M585.063551 757.584278 79.125617 757.584278c-9.108448 0-16.730033 9.155521-16.730033 20.451798 0 11.386328 7.462972 20.472264 16.661472 20.472264L332.083839 798.508339l253.025761 0c9.199523 0 16.685008-9.153474 16.685008-20.472264C601.794607 766.67226 594.309122 757.584278 585.063551 757.584278z" /></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1554256986814" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1401" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M832 384c106 0 192-86 192-192S938 0 832 0 640 86 640 192c0 22.2 3.8 43.5 10.7 63.4l-192.2 106C412.5 297.6 337.6 256 253 256 113.3 256 0 369.3 0 509s113.3 253 253 253c77.6 0 147.1-35 193.5-90.1l204.6 133.3c-7.2 18.2-11.1 38-11.1 58.8 0 88.4 71.6 160 160 160s160-71.6 160-160-71.6-160-160-160c-44.6 0-84.9 18.2-113.9 47.6L481.3 618.2C497.1 585.1 506 548.1 506 509c0-32.2-6-63-17-91.4l192.7-106.2C716.8 355.6 771.1 384 832 384zM800 768c52.9 0 96 43.1 96 96s-43.1 96-96 96-96-43.1-96-96S747.1 768 800 768zM253 698c-50.5 0-97.9-19.7-133.6-55.4S64 559.5 64 509s19.7-97.9 55.4-133.6S202.5 320 253 320s97.9 19.7 133.6 55.4S442 458.5 442 509s-19.7 97.9-55.4 133.6S303.5 698 253 698zM741.5 101.5C765.7 77.3 797.8 64 832 64s66.3 13.3 90.5 37.5c24.2 24.2 37.5 56.3 37.5 90.5s-13.3 66.3-37.5 90.5C898.3 306.7 866.2 320 832 320s-66.3-13.3-90.5-37.5C717.3 258.3 704 226.2 704 192S717.3 125.7 741.5 101.5z" p-id="1402"></path></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="146.39px" viewBox="0 0 1399 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M1189.542786 858.07708l-31.450341 0L1158.092445 400.980969c0-27.679906-22.433002-50.119124-50.122232-50.119124l-224.507193 0L883.463019 50.122232c0-27.679906-22.433002-50.122232-50.122232-50.122232L337.12913 0c-27.673689 0-50.119124 22.442327-50.119124 50.122232l0 807.954847-11.364148 0c-27.679906 0-50.122232 22.433002-50.122232 50.109799l0 65.688877c0 27.676798 22.442327 50.119124 50.122232 50.119124l913.896928 0c27.683015 0 50.116015-22.442327 50.116015-50.119124l0-65.688877C1239.658802 880.510081 1217.228909 858.07708 1189.542786 858.07708L1189.542786 858.07708zM739.785502 674.979398c0 27.689231-22.445435 50.122232-50.122232 50.122232l-208.84419 0c-27.683015 0-50.122232-22.433002-50.122232-50.122232l0-15.035116c0-27.679906 22.439219-50.116015 50.122232-50.116015l208.84419 0c27.676798 0 50.122232 22.43611 50.122232 50.116015L739.785502 674.979398 739.785502 674.979398zM739.785502 456.116978c0 27.679906-22.445435 50.122232-50.122232 50.122232l-208.84419 0c-27.683015 0-50.122232-22.442327-50.122232-50.122232l0-15.035116c0-27.679906 22.439219-50.122232 50.122232-50.122232l208.84419 0c27.676798 0 50.122232 22.442327 50.122232 50.122232L739.785502 456.116978 739.785502 456.116978zM739.785502 220.537823c0 27.683015-22.445435 50.122232-50.122232 50.122232l-208.84419 0c-27.683015 0-50.122232-22.439219-50.122232-50.122232l0-15.028899c0-27.689231 22.439219-50.125341 50.122232-50.125341l208.84419 0c27.676798 0 50.122232 22.439219 50.122232 50.125341L739.785502 220.537823 739.785502 220.537823zM1059.517166 764.372594l-133.659287 0c-23.063998 0-41.766973-18.702975-41.766973-41.77319 0-23.06089 18.702975-41.766973 41.766973-41.766973l133.659287 0c23.070215 0 41.770081 18.706083 41.770081 41.766973C1101.290357 745.66962 1082.587381 764.372594 1059.517166 764.372594L1059.517166 764.372594zM1059.517166 595.619974l-133.659287 0c-23.063998 0-41.766973-18.699867-41.766973-41.760756 0-23.07954 18.702975-41.776298 41.766973-41.776298l133.659287 0c23.070215 0 41.770081 18.699867 41.770081 41.776298C1101.290357 576.920107 1082.587381 595.619974 1059.517166 595.619974L1059.517166 595.619974zM1059.517166 595.619974" /></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M39.733 2.713c134.546 0 269.093 0 403.64 0 41.046 4.065 31.153 76.317 31.153 123.259 0 84.316 0 139.888 0 223.491 0 48.574 9.147 108.108-23.027 121.904-20.952 8.986-77.185 2.71-104.296 2.71-74.433 0-134.937 0-214.01 0-49.472 0-117.022 11.808-124.613-31.154 0-136.352 0-272.704 0-409.056C14.111 18.63 23.842 7.592 39.733 2.713zM95.268 94.818c0 97.073 0 194.144 0 291.216 97.073 0 194.143 0 291.215 0 0-98.427 0-196.853 0-295.28-96.62 0-193.241 0-289.861 0C95.044 90.982 95.151 92.896 95.268 94.818zM581.531 2.713c134.545 0 269.093 0 403.638 0 16.466 6.109 27.779 17.371 31.153 36.571 0 132.74 0 265.482 0 398.221-3.693 16.548-12.334 30.684-28.444 35.217-26.328 7.408-70.075 1.354-101.586 1.354-74.243 0-135.119 0-207.238 0-31.253 0-77.568 6.584-102.941-1.354-35.816-11.206-25.735-81.123-25.735-130.032 0-64.966 0-140.801 0-208.592C550.377 77.629 537.982 10.603 581.531 2.713zM637.064 94.818c0 97.073 0 194.144 0 291.216 97.072 0 194.144 0 291.216 0 0-98.427 0-196.853 0-295.28-96.619 0-193.24 0-289.86 0C636.841 90.982 636.948 92.896 637.064 94.818zM228.008 180.151c40.558-7.654 72.453 19.75 73.143 56.889 0.909 48.975-49.112 75.88-88.042 55.534C168.571 269.297 171.502 190.815 228.008 180.151zM769.806 180.151c95.534-17.848 93.701 133.448 0 117.841C710.174 288.062 708.249 191.652 769.806 180.151zM440.664 1024c-133.191 0-266.383 0-399.576 0-16.588-5.083-27.793-15.549-32.507-32.507 0-135.9 0-271.803 0-407.703 3.945-11.931 13.053-25.849 27.089-29.798 26.514-7.461 69.824-1.354 101.587-1.354 73.001 0 139.132 0 207.238 0 30.627 0 75.201-6.836 102.94 1.354 37.529 11.08 27.091 79.862 27.091 128.676 0 75.039 0 139.05 0 215.364C474.526 950.718 485.871 1019.297 440.664 1024zM95.268 644.743c0 97.073 0 194.144 0 291.215 97.073 0 194.143 0 291.215 0 0-98.427 0-196.852 0-295.279-96.62 0-193.241 0-289.861 0C95.044 640.907 95.151 642.82 95.268 644.743zM1016.322 589.209c0 37.925 0 75.852 0 113.777-3.16 38.378-0.452 82.622-1.354 123.258-96.168 0-192.337 0-288.507 0 0-22.122 0-44.247 0-66.37-27.09-3.157-60.047-0.451-89.396-1.354-3.16 85.785-0.451 177.438-1.354 265.48-17.608 0-35.217 0-52.826 0-45.421-9.103-32.508-77.259-32.508-131.387 0-75.5 0-137.62 0-209.945 0-31.567-6.389-78.892 1.355-104.295 9.238-30.309 49.304-25.735 89.396-25.735 67.778 0 128.163 0 196.4 0 0 60.048 0 120.099 0 180.147 30.25 0 60.501 0 90.751 0 0.902-59.599-1.806-122.808 1.355-180.147C973.306 550.053 1013.757 550.689 1016.322 589.209zM234.78 728.722c43.307-4.794 79.106 36.827 62.306 82.623C273.8 874.822 162.46 850.966 183.31 770.711 189.073 748.526 205.72 731.938 234.78 728.722zM823.985 1024c-32.508 0-65.017 0-97.524 0 0.903-34.766-1.805-73.141 1.355-105.651 32.056 0 64.112 0 96.169 0C823.985 953.566 823.985 988.783 823.985 1024zM1016.322 918.349c0 23.027 0 46.054 0 69.08-3.766 19.262-15.028 31.024-32.509 36.571-23.025 0-46.052 0-69.078 0 0.903-34.766-1.805-73.141 1.355-105.651C949.502 918.349 982.911 918.349 1016.322 918.349z" /></svg>
\ No newline at end of file
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><g><path d="M.006.064h127.988v31.104H.006V.064zm0 38.016h38.396v41.472H.006V38.08zm0 48.384h38.396v41.472H.006V86.464zM44.802 38.08h38.396v41.472H44.802V38.08zm0 48.384h38.396v41.472H44.802V86.464zM89.598 38.08h38.396v41.472H89.598zm0 48.384h38.396v41.472H89.598z"/><path d="M.006.064h127.988v31.104H.006V.064zm0 38.016h38.396v41.472H.006V38.08zm0 48.384h38.396v41.472H.006V86.464zM44.802 38.08h38.396v41.472H44.802V38.08zm0 48.384h38.396v41.472H44.802V86.464zM89.598 38.08h38.396v41.472H89.598zm0 48.384h38.396v41.472H89.598z"/></g></svg>
\ No newline at end of file
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M126.713 90.023c.858.985 1.287 2.134 1.287 3.447v29.553c0 1.423-.429 2.6-1.287 3.53-.858.93-1.907 1.395-3.146 1.395H97.824c-1.145 0-2.146-.465-3.004-1.395-.858-.93-1.287-2.107-1.287-3.53V93.47c0-.875.19-1.696.572-2.462.382-.766.906-1.368 1.573-1.806a3.84 3.84 0 0 1 2.146-.657h9.725V69.007a3.84 3.84 0 0 0-.43-1.806 3.569 3.569 0 0 0-1.143-1.313 2.714 2.714 0 0 0-1.573-.492h-36.47v23.149h9.725c1.144 0 2.145.492 3.004 1.478.858.985 1.287 2.134 1.287 3.447v29.553c0 .876-.191 1.696-.573 2.463-.38.766-.905 1.368-1.573 1.806a3.84 3.84 0 0 1-2.145.656H51.915a3.84 3.84 0 0 1-2.145-.656c-.668-.438-1.216-1.04-1.645-1.806a4.96 4.96 0 0 1-.644-2.463V93.47c0-1.313.43-2.462 1.288-3.447.858-.986 1.907-1.478 3.146-1.478h9.582v-23.15h-37.9c-.953 0-1.74.356-2.359 1.068-.62.711-.93 1.56-.93 2.544v19.538h9.726c1.239 0 2.264.492 3.074 1.478.81.985 1.216 2.134 1.216 3.447v29.553c0 1.423-.405 2.6-1.216 3.53-.81.93-1.835 1.395-3.074 1.395H4.29c-.476 0-.93-.082-1.358-.246a4.1 4.1 0 0 1-1.144-.657 4.658 4.658 0 0 1-.93-1.067 5.186 5.186 0 0 1-.643-1.395 5.566 5.566 0 0 1-.215-1.56V93.47c0-.437.048-.875.143-1.313a3.95 3.95 0 0 1 .429-1.15c.19-.328.429-.656.715-.984.286-.329.572-.602.858-.821.286-.22.62-.383 1.001-.493.382-.11.763-.164 1.144-.164h9.726V61.619c0-.985.31-1.833.93-2.544.619-.712 1.358-1.068 2.216-1.068h44.335V39.62h-9.582c-1.24 0-2.288-.492-3.146-1.477a5.09 5.09 0 0 1-1.287-3.448V5.14c0-1.423.429-2.627 1.287-3.612.858-.985 1.907-1.477 3.146-1.477h25.743c.763 0 1.478.246 2.145.739a5.17 5.17 0 0 1 1.573 1.888c.382.766.573 1.587.573 2.462v29.553c0 1.313-.43 2.463-1.287 3.448-.859.985-1.86 1.477-3.004 1.477h-9.725v18.389h42.762c.954 0 1.74.355 2.36 1.067.62.711.93 1.56.93 2.545v26.925h9.582c1.239 0 2.288.492 3.146 1.478z"/></svg>
\ No newline at end of file
<svg width="130" height="130" xmlns="http://www.w3.org/2000/svg"><path d="M63.444 64.996c20.633 0 37.359-14.308 37.359-31.953 0-17.649-16.726-31.952-37.359-31.952-20.631 0-37.36 14.303-37.358 31.952 0 17.645 16.727 31.953 37.359 31.953zM80.57 75.65H49.434c-26.652 0-48.26 18.477-48.26 41.27v2.664c0 9.316 21.608 9.325 48.26 9.325H80.57c26.649 0 48.256-.344 48.256-9.325v-2.663c0-22.794-21.605-41.271-48.256-41.271z" stroke="#979797"/></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="160px" height="160.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M919.561369 245.727541c-0.899486-28.28623-24.311709-55.009871-52.010561-59.8409 0 0-107.385752-16.977673-167.643138-38.420031-75.231425-26.770713-149.681044-85.617983-149.681044-85.617983-23.220864-16.58063-58.83806-15.552208-80.374562 2.372024 0 0-52.704362 53.179177-151.044088 84.22117-90.852194 36.510542-163.464979 40.248679-163.464979 40.248679-27.402093 3.571339-50.991348 28.867468-51.522444 57.147558 0 0-3.690042 145.387251 0.966001 272.985348 1.759063 228.268914 271.994788 453.937606 408.55193 453.937606 134.416386 0 366.709963-157.224858 403.249157-450.619024C925.617295 347.953783 919.561369 245.727541 919.561369 245.727541zM709.887976 445.981401 477.54835 681.152515c-9.899464 10.018168-26.696012 11.174504-38.07927 2.124384l-121.329323-96.414887c-22.289656-17.711384-24.614607-48.538483-4.89038-69.169359 19.587104-20.48966 53.223179-23.199375 75.962066-5.403057l56.322773 44.083008 193.563484-182.358281c20.162202-18.995633 52.216245-18.458397 71.897493 0.325411-0.281409-0.293689-0.35918-0.693802-0.649799-0.984421l1.64036 1.64343c-0.290619-0.290619-0.696872-0.3776-0.99056-0.659009C729.922265 394.23076 729.659275 425.969625 709.887976 445.981401z" /></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1573183001556" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3871" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M908 745.6h-44.6V276c0-11-9-20-20-20H563.3c-11 0-20 9-20 20v469.7h-64V118.2c0-11-9-20-20-20h-280c-11 0-20 9-20 20v627.5H118c-11 0-20 9-20 20v46.1c0 11 9 20 20 20h790c11 0 20-9 20-20v-46.1c0-11.1-9-20.1-20-20.1zM608.7 372.2c0-11 9-20 20-20h150.8c11 0 20 9 20 20v24.2c0 11-9 20-20 20H628.7c-11 0-20-9-20-20v-24.2z m0 127.8c0-11 9-20 20-20h150.8c11 0 20 9 20 20v24.2c0 11-9 20-20 20H628.7c-11 0-20-9-20-20V500zM224.6 211.8c0-11 9-20 20-20h150.8c11 0 20 9 20 20V236c0 11-9 20-20 20H244.6c-11 0-20-9-20-20v-24.2z m0 127.8c0-11 9-20 20-20h150.8c11 0 20 9 20 20v24.2c0 11-9 20-20 20H244.6c-11 0-20-9-20-20v-24.2z m0 128.6c0-11 9-20 20-20h150.8c11 0 20 9 20 20v24.2c0 11-9 20-20 20H244.6c-11 0-20-9-20-20v-24.2z" p-id="3872"></path></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="160px" height="160.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M349.6 145.6 676 472c6.4 6.4 9.6 14.4 9.6 22.4 0 8-3.2 16.8-9.6 22.4l-326.4 326.4c-12 12-32.8 14.4-45.6 2.4-13.6-12-13.6-33.6-0.8-46.4L608 495.2c0 0 0 0 0-0.8L302.4 189.6c-12.8-12.8-12.8-33.6 0.8-46.4C316.8 131.2 336.8 133.6 349.6 145.6z" fill="#bfbfbf" /></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="160px" height="160.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M258.407 492.516l450.066-450.066c10.233-10.342 27.098-10.342 37.462 0 10.342 10.364 10.342 27.207 0 37.506l-432.044 432.044 432.044 432.044c10.342 10.364 10.342 27.142 0 37.506-10.364 10.364-27.229 10.364-37.462 0l-450.066-450.022c-5.389-5.346-7.811-12.48-7.614-19.527-0.196-7.047 2.247-14.138 7.614-19.484z" fill="#bfbfbf" /></svg>
\ No newline at end of file
# replace default config
# multipass: true
# full: true
plugins:
# - name
#
# or:
# - name: false
# - name: true
#
# or:
# - name:
# param1: 1
# param2: 2
- removeAttrs:
attrs:
- 'fill'
- 'fill-rule'
This diff is collapsed.
@import './variables.scss';
@import './mixin.scss';
@import './transition.scss';
@import './element-ui.scss';
@import './sidebar.scss';
@import './element-variables.scss';
html,body{
margin: 0;
}
body {
height: 100%;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
}
label {
font-weight: 700;
}
html {
height: 100%;
box-sizing: border-box;
}
#app {
height: 100%;
}
// 空内容
.empty{
color: #ccc;
}
*,
*:before,
*:after {
}
a,
a:focus,
a:hover {
cursor: pointer;
color: inherit;
outline: none;
text-decoration: none;
}
div:focus {
outline: none;
}
a:focus,
a:active {
outline: none;
}
a,
a:focus,
a:hover {
cursor: pointer;
color: inherit;
text-decoration: none;
}
.clearfix {
&:after {
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
}
//main-container全局样式
.app-main {
min-height: 100%
}
.app-container {
padding: 10px;
box-sizing: border-box;
}
[v-cloak]{display: none !important;}
/*通用按钮属性*/
.btn{ -webkit-transition-duration: .2s; transition-duration: .2s; cursor: pointer;
-webkit-touch-callout:none; /*系统默认菜单被禁用*/
-webkit-user-select:none; /*webkit浏览器*/
-khtml-user-select:none; /*早期浏览器*/
-moz-user-select:none;/*火狐*/
-ms-user-select:none; /*IE10*/
user-select:none;
&.primary{ background-color: $primary-color; text-align: center; color: white;
&:active{ background-color: $primary-color-active; }
}
}
*{
// 滚动条样式
&::-webkit-scrollbar {
width : 6px; /*高宽分别对应横竖滚动条的尺寸*/
height: 8px;
}
&::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
border-radius: 20px;
box-shadow: inset 0 0 5px #ccc;
}
}
/*超出部分省略号*/
.inline{overflow:hidden !important;text-overflow:ellipsis;white-space:nowrap !important;}
.app_content{padding: 15px;}
// 头像上传样式
.avatar-uploader{
cursor: pointer;
.avatar-uploader-icon { border: 1px dashed #d9d9d9; border-radius: 6px; position: relative; overflow: hidden; cursor: pointer;
&:hover{ border-color: #409EFF;}
}
.avatar-uploader-icon { font-size: 28px; color: #8c939d; width: 78px; height: 78px; line-height: 78px; text-align: center;}
.avatar { width: 78px; height: 78px; display: block; position: relative;
img{ width: 100%; height: 100%;}
.del{ position: absolute; top: 2px; right: 2px; display: inline-block; width: 14px; height: 14px; color: white; padding: 1px; border-radius: 10px;
.icon{ display: block; font-size: 12px;}
}
&:hover{
.del{ background-color: red;}
}
}
}
.upload_images{
&.hidden{
.el-upload--picture-card{ display: none;}
}
}
// dialog内的表单样式
.dialog_form .el-dialog__body{ padding-bottom: 0;}
// 列表页头部筛选表单
.select-form{
.header-input-item:not(:first-child){ margin-left: 20px; }
.header-input-item { display: inline-block; color: #909399; font-size: 12px; margin-bottom: 5px;}
}
// 分页样式
.pagination{
float: right;
}
.table{
.el-button+.el-button {
margin-left: 0px !important;
}
}
.success-row{ color: #009a2c;}
.warning-row{ color: #ff9400;}
.error-row,.notice{ color: red;}
// 下拉框宽度
.form-select{
width: 100% !important;
}
// 开关
.switchStyle .el-switch__label {
position: absolute;
display: none;
color: #fff;
}
.switchStyle .el-switch__label--left {
z-index: 9;
left: 6px;
}
.switchStyle .el-switch__label--right {
z-index: 9;
left: -14px;
}
.switchStyle .el-switch__label.is-active {
display: block;
}
//to reset element-ui default css
.el-upload {
input[type="file"] {
display: none !important;
}
}
.el-upload__input {
display: none;
}
// textarea的字数限制文字
.el-input__count{
line-height: 14px;
}
//暂时性解决diolag 问题 https://github.com/ElemeFE/element/issues/2461
.el-dialog {
transform: none;
left: 0;
position: relative;
margin: 0 auto;
.el-dialog__body{
max-height: 500px;
padding-bottom: 10px;
padding-top: 10px;
overflow: auto;
}
// 默认底部按钮靠右
.dialog-footer{
text-align: right;
}
}
//element ui upload
.upload-container {
.el-upload {
width: 100%;
.el-upload-dragger {
width: 100%;
height: 200px;
}
}
}
// 表哥行内内容超出显示省略号
.el-table{
.cell{overflow:hidden !important;text-overflow:ellipsis;white-space:nowrap !important;}
}
.el-tooltip__popper{
max-width: 400px;
line-height: 18px !important;
}
// 按钮组内,icon按钮不对其问题
.el-button-group {
[class^="el-icon-"] {
display: block;
}
}
/* 改变主题色变量 */
// $--color-primary: teal;
/* 改变 icon 字体路径变量,必需 */
$--font-path: '~element-ui/lib/theme-chalk/fonts';
@import "~element-ui/packages/theme-chalk/src/index";
@mixin clearfix {
&:after {
content: "";
display: table;
clear: both;
}
}
@mixin scrollBar {
&::-webkit-scrollbar-track-piece {
background: #d3dce6;
}
&::-webkit-scrollbar {
width: 6px;
}
&::-webkit-scrollbar-thumb {
background: #99a9bf;
border-radius: 20px;
}
}
@mixin relative {
position: relative;
width: 100%;
height: 100%;
}
//globl transition css
/*fade*/
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.28s;
}
.fade-enter,
.fade-leave-active {
opacity: 0;
}
/*fade-transform*/
.fade-transform-leave-active,
.fade-transform-enter-active {
transition: all .5s;
}
.fade-transform-enter {
opacity: 0;
transform: translateX(-30px);
}
.fade-transform-leave-to {
opacity: 0;
transform: translateX(30px);
}
/*fade*/
.breadcrumb-enter-active,
.breadcrumb-leave-active {
transition: all .5s;
}
.breadcrumb-enter,
.breadcrumb-leave-active {
opacity: 0;
transform: translateX(20px);
}
.breadcrumb-move {
transition: all .5s;
}
.breadcrumb-leave-active {
position: absolute;
}
$primary-color: #218FFC;
$primary-color-active: #4ba0f5;
$line-color:rgba(240,243,245,1);
$border-color: rgb(240, 240, 240);
%transition { -webkit-transition-duration: .2s; transition-duration: .2s;}
\ No newline at end of file
@import 'vxe-table/styles/variable.scss';
@import 'element-variables.scss';
// 局部修改变量
$vxe-font-size: 16px;
$vxe-font-size-medium: 16px;
$vxe-font-color: #666;
$vxe-primary-color: $--color-primary;
$vxe-table-font-color: $vxe-font-color;
$vxe-table-border-color: #E8E9F0;
$vxe-table-border-radius: 4px;
// ...
$vxe-table-header-background-color: #f8f8f9;
$vxe-table-background-color: #ffffff; // table背景色
$vxe-table-row-checked-background-color: #d9e7ff;
$vxe-table-row-radio-background-color: #d9e7ff;
$vxe-table-row-hover-background-color: #fffce6; // 鼠标悬停行背景色
$vxe-table-row-hover-striped-background-color: #fffce6; // 鼠标悬停行背景色
$vxe-table-row-hover-radio-background-color: #d9e7ff; // 已选中的栏目鼠标悬停行背景色
$vxe-table-row-hover-checked-background-color: #d9e7ff; // 已选中的栏目鼠标悬停行背景色
$vxe-table-row-striped-background-color: #f6f8fc; // 斑马线颜色
/*checkbox*/
$vxe-checkbox-font-size-default: 16px;
$vxe-checkbox-font-size-medium: 16px;
$vxe-checkbox-font-size-small: 16px;
$vxe-checkbox-font-size-mini: 16px;
.vxe-table--tooltip-wrapper.theme--dark{
z-index: 10000 !important;
}
.vxe-table.size--mini{
font-size: 14px !important;
}
@import 'vxe-table/styles/modules.scss';
\ No newline at end of file
<template>
<svg class="NuxtLogo" width="245" height="180" viewBox="0 0 452 342" xmlns="http://www.w3.org/2000/svg">
<g fill="none" fill-rule="evenodd">
<path
d="M139 330l-1-2c-2-4-2-8-1-13H29L189 31l67 121 22-16-67-121c-1-2-9-14-22-14-6 0-15 2-22 15L5 303c-1 3-8 16-2 27 4 6 10 12 24 12h136c-14 0-21-6-24-12z"
fill="#00C58E"
/>
<path
d="M447 304L317 70c-2-2-9-15-22-15-6 0-15 3-22 15l-17 28v54l39-67 129 230h-49a23 23 0 0 1-2 14l-1 1c-6 11-21 12-23 12h76c3 0 17-1 24-12 3-5 5-14-2-26z"
fill="#108775"
/>
<path
d="M376 330v-1l1-2c1-4 2-8 1-12l-4-12-102-178-15-27h-1l-15 27-102 178-4 12a24 24 0 0 0 2 15c4 6 10 12 24 12h190c3 0 18-1 25-12zM256 152l93 163H163l93-163z"
fill="#2F495E"
fill-rule="nonzero"
/>
</g>
</svg>
</template>
<style>
.NuxtLogo {
animation: 1s appear;
margin: auto;
}
@keyframes appear {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
</style>
# COMPONENTS
**This directory is not required, you can delete it if you don't want to use it.**
The components directory contains your Vue.js Components.
_Nuxt.js doesn't supercharge these components._
<template>
<div v-if="isExternal" :style="styleExternalIcon" class="svg-external-icon svg-icon" v-on="$listeners" />
<svg v-else :class="svgClass" aria-hidden="true" v-on="$listeners">
<use :xlink:href="iconName" />
</svg>
</template>
<script>
// doc: https://panjiachen.github.io/vue-element-admin-site/feature/component/svg-icon.html#usage
import { isExternal } from '@/utils/validate'
export default {
name: 'SvgIcon',
props: {
iconClass: {
type: String,
required: true,
},
className: {
type: String,
default: '',
},
},
computed: {
isExternal() {
return isExternal(this.iconClass)
},
iconName() {
return `#icon-${this.iconClass}`
},
svgClass() {
if (this.className) {
return 'svg-icon ' + this.className
} else {
return 'svg-icon'
}
},
styleExternalIcon() {
return {
mask: `url(${this.iconClass}) no-repeat 50% 50%`,
'-webkit-mask': `url(${this.iconClass}) no-repeat 50% 50%`,
}
},
},
}
</script>
<style scoped>
.svg-icon {
width: 1em;
height: 1em;
vertical-align: -0.15em;
fill: currentColor;
overflow: hidden;
}
</style>
baseURL=
static_domain=/static/
project_name='——'
# 运行http端口
PORT=8090
HOST=localhost
.env.*
!.env.example
\ No newline at end of file
const { APP_ENV } = process.env
const isBuild = ['production', 'generate'].includes(APP_ENV)
const expandRouter = isBuild
? {
mode: 'hash',
base: './',
}
: {}
const buildConfig = { expandRouter }
module.exports = buildConfig
\ No newline at end of file
export const baseURL = process.env.baseURL // api域名
export const imgDomain = process.env.img_domain // 图片资源路径
export const qiniuDomain = process.env.qiniu_domain // 七牛资源路径
export const cosDomain = process.env.cos_domain // 腾讯云存储资源路径
export const staticDomain = process.env.static_domain // 静态资源路径
export const uploadDomain = process.env.upload_domain // 图片上传路径
export const projectName = process.env.project_name // 项目名称
export const router = process.env.router // 路由配置
export const ossAccessKey = process.env.oss_access_key // oss key
export const ossSecret = process.env.oss_secret // oss
export const ossBucket = process.env.oss_bucket // oss
export const ossRegion = process.env.oss_region // oss
const path = require('path')
const fs = require('fs')
const env = process.env.APP_ENV
console.log('env', env)
const envPath = path.resolve(process.cwd(), `configs/.env.${env}`)
console.log(envPath, 'env')
require('dotenv').config({
path: envPath,
})
console.log(env, 'process.env')
指令
\ No newline at end of file
import Vue from 'vue'
// 权限菜单
const authBtn = Vue.directive('authBtn', {
// 当被绑定的元素插入到 DOM 中时……
inserted: (el, binding, vnode) => {
const { id } = el
setTimeout(() => {
const authBtnIdList = vnode.context.$store.state.authBtnIdList
if (authBtnIdList.indexOf((Number)(id)) === -1) {
el.parentNode.removeChild(el)
}
}, 300)
}
})
export default { authBtn }
# LAYOUTS
**This directory is not required, you can delete it if you don't want to use it.**
This directory contains your Application Layouts.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/views#layouts).
<template>
<div class="root">
<nuxt />
</div>
</template>
<script>
import { mapActions } from 'vuex'
export default {
data() {
return {}
},
created() {
// this.GetConfig()
},
methods: {
...mapActions({
GetConfig: 'GetConfig',
}),
},
}
</script>
<style scoped>
.root{
left: 0;
top: 0;
width: 100%;
height: 100%;
min-width: 900px;
position: fixed;
}
</style>
<template>
<div class="page">
页面不存在...
</div>
</template>
<style lang="scss" scoped>
.page{
padding: 10px;
}
</style>
# MIDDLEWARE
**This directory is not required, you can delete it if you don't want to use it.**
This directory contains your application middleware.
Middleware let you define custom functions that can be run before rendering either a page or a group of pages.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing#middleware).
import { Message } from 'element-ui'
import { getToken } from '@/utils/auth' // 验权
const whiteList = ['/login', '/test'] // 不重定向白名单
export default ({ app, redirect, route }) => {
const { fullPath, path } = route
const { store } = app
const { relist } = store.state
const token = getToken()
if (fullPath === '/') { // 主页重定向到统计页面
// redirect(`/home/index`)
}
if (!token || relist) {
if (whiteList.indexOf(path) === -1) { // 如果当前路由需要鉴权
redirect(`/login?redirect=${route.path}`)
}
} else {
if (whiteList.indexOf(path) === -1) { // 如果当前路由需要鉴权
// store.dispatch('IsLogin').then(res => { // 判断是否登录
// }).catch(() => {
// redirect(`/login?redirect=${route.path}`)
// })
}
}
}
export default ({ store, route, redirect }) => {
route.matched.forEach((item, index) => {
item.meta.title = route.meta[index].title || ''
item.meta.redirect = route.meta[index].redirect || '' // 设置重定向
})
}
export default {
data() {
return {
}
},
methods: {
pagination: () => {
return {
sizeChange: (val) => {
const query = { ...this.$route.query }
query.page = 1
query.page_size = val
for (var i in query) {
if (query[i] === '') {
delete query[i]
}
}
this.$router.push({ ...this.$route, query })
},
currentChange: (val) => {
const query = { ...this.$route.query }
query.page = val
for (var i in query) {
if (query[i] === '') {
delete query[i]
}
}
this.$router.push({ ...this.$route, query })
},
}
},
},
}
const { resolve } = require('path')
require('./configs')
const { baseURL, static_domain } = process.env
const { expandRouter } = require('./configs/buildConfig')
export default {
mode: 'spa',
/*
** Headers of the page
*/
head: {
title: process.env.project_name || '',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: process.env.project_description || '' }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
],
script: [
],
},
env: process.env,
/*
** Customize the progress-bar color
*/
loading: { color: '#fff' },
/*
** Global CSS
*/
css: [
'element-ui/lib/theme-chalk/index.css',
'@/assets/styles/app.scss',
],
/*
** Plugins to load before mounting the App
*/
plugins: [
// '@/plugins/element-ui',
'@/plugins/plugins',
{ src: 'plugins/vuex-persistedstate.js', ssr: false },
{ src: '@/plugins/icons', ssr: true },
{ src: '@/plugins/axios', ssr: true },
{ src: '@/plugins/route', ssr: false },
{ src: './directive/permission', ssr: false }, // 按钮权限全局指令
// '@/plugins/icons',
],
/*
** Nuxt.js dev-modules
*/
buildModules: [
],
router: {
middleware: ['auth'],
...expandRouter
},
/*
** Nuxt.js modules
*/
modules: [
'@nuxtjs/axios',
// '@nuxtjs/proxy',
],
/*
** Build configuration
*/
build: {
transpile: [/^element-ui/],
/*
** You can extend webpack config here
*/
extend (config, ctx) {
// ...
if (ctx.isDev && ctx.isClient) {
config.module.rules.push({
enforce: "pre",
test: /\.(js|vue)$/,
loader: "eslint-loader",
exclude: /(node_modules)/
})
}
const svgRule = config.module.rules.find(rule => rule.test.test('.svg'))
svgRule.exclude = [resolve(__dirname, 'assets/icons/svg')]
// Includes /icons/svg for svg-sprite-loader
config.module.rules.push({
test: /\.svg$/,
include: [resolve(__dirname, 'assets/icons/svg')],
loader: 'svg-sprite-loader',
options: {
symbolId: 'icon-[name]',
},
})
}
},
axios: {
// baseURL,
proxy: true, // 表示开启代理
prefix: process.env.NODE_ENV === 'development' ? '/api' : baseURL, // 表示给请求url加个前缀 /api
credentials: true // 表示跨域请求时是否需要使用凭证
},
proxy: {
'/api': {
target: baseURL, // 目标接口域名
changeOrigin: true, // 表示是否跨域
pathRewrite: {
'^/api': '/', // 把 /api 替换成 /
}
},
'/static': {
target: baseURL, // 设置调用接口域名和端口号别忘了加http
changeOrigin: true,
pathRewrite: {
'^/api': '/', // 把 /api 替换成 /
}
}
},
}
This diff is collapsed.
{
"name": "demo",
"version": "1.0.0",
"description": "demo",
"author": "maoxian",
"private": true,
"scripts": {
"dev": "cross-env APP_ENV=development NODE_ENV=development nuxt",
"build": "nuxt build APP_ENV=production NODE_ENV=production build",
"start": "nuxt start",
"generate": "cross-env APP_ENV=generate NODE_ENV=generate nuxt generate"
},
"dependencies": {
"@xkeshi/vue-qrcode": "^1.0.0",
"ali-oss": "^6.17.1",
"ant-design-vue": "^1.7.8",
"clipboard": "^2.0.10",
"cos-js-sdk-v5": "^1.3.5",
"dayjs": "^1.10.7",
"echarts": "^4.9.0",
"element-ui": "^2.15.6",
"image-compressor.js": "^1.1.4",
"js-cookie": "^2.2.1",
"js-md5": "^0.7.3",
"node-sass": "^4.14.1",
"nprogress": "^0.2.0",
"nuxt": "^2.15.8",
"print-js": "^1.6.0",
"vod-js-sdk-v6": "^1.4.12",
"vue-baidu-map": "^0.21.22",
"vuex-persistedstate": "^3.2.1",
"vxe-table": "^3.4.15",
"xe-utils": "^3.5.4"
},
"devDependencies": {
"@nuxtjs/axios": "^5.13.6",
"@nuxtjs/proxy": "^1.3.3",
"babel-eslint": "^10.1.0",
"cross-env": "^7.0.3",
"dotenv": "^8.6.0",
"eslint": "^4.19.1",
"eslint-config-airbnb-base": "^13.0.0",
"eslint-import-resolver-webpack": "^0.10.1",
"eslint-loader": "^2.0.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-vue": "^4.4.0",
"file-saver": "^2.0.5",
"less": "^3.13.1",
"less-loader": "^6.2.0",
"sass-loader": "^8.0.2",
"script-loader": "^0.7.2",
"svg-sprite-loader": "^5.2.1",
"xlsx": "^0.16.9"
}
}
# PAGES
This directory contains your Application Views and Routes.
The framework reads all the `*.vue` files inside this directory and creates the router of your application.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing).
<template>
<div>
<nuxt-child
class="main-content"
/>
</div>
</template>
<template>
<div>
{{ id }}
</div>
</template>
<script>
export default {
data() {
return {}
},
computed: {
id() {
return this.$route.params.id
},
},
mounted() {
this.network().getData()
this.network().isSave()
},
methods: {
network() {
return {
getData: () => {
const { id } = this
const params = {
deviceId: id,
}
this.$request({
url: '/api/app/device/getDeviceButtonPanel',
method: 'get',
params,
}).then(({ data }) => {
console.log('getDeviceButtonPanel', data)
})
},
isSave: () => {
const { id } = this
const params = {
deviceId: id,
}
this.$request({
url: '/api/gaming/isSave',
method: 'get',
params,
}).then(({ data }) => {
console.log('isSave', data)
})
},
}
},
},
}
</script>
<template>
<div>
<div v-for="(item, index) in list" :key="index" class="box btn" @click="click().joinGasme(item)">
<div>
assetNumber: {{ item.assetNumber }}
</div>
<div>
id: {{ item.id }}
</div>
</div>
</div>
</template>
<script>
import { mapState, mapActions } from 'vuex'
export default {
data() {
return {
list: [],
}
},
watch: {
},
created() {
this.network().getData()
},
methods: {
click() {
return {
joinGasme: ({ id }) => {
const data = {
deviceId: id,
}
this.$request({
url: '/api/gaming',
method: 'post',
data,
}).then(({ data }) => {
this.$router.push(`/game/${id}`)
})
},
}
},
network() {
return {
getData: () => {
this.$request({
url: '/api/app/device/topDeviceList',
method: 'get',
}).then(({ data }) => {
this.list = data
})
},
}
},
},
}
</script>
<style lang="scss" scoped>
.box {
border: 1px solid #ccc;
padding: 10px;
margin: 10px;
}
</style>
<template>
<div>
<input v-model="form.username" type="text" >
<input v-model="form.password" type="text" >
<button @click="click().login()">登录</button>
</div>
</template>
<script>
import { mapState, mapActions } from 'vuex'
export default {
data() {
return {
form: {
username: process.env.NODE_ENV === 'development' ? 'W003' : '',
password: process.env.NODE_ENV === 'development' ? '123456' : '',
},
}
},
methods: {
...mapActions({
Login: 'Login',
GetBaseInfo: 'GetBaseInfo',
}),
click() {
return {
login: () => {
const data = this.form
// this.$request({
// url: '/api/player/login',
// method: 'post',
// data,
// }).then(({ data }) => {
// console.log('data', data)
// })
this.Login(data).then((res) => {
this.GetBaseInfo().then(({ data }) => {
this.$router.push({ path: '/' })
this.loading = false
}).catch(() => {
this.loading = false
})
}).catch((error) => {
console.log('error', error)
this.loading = false
})
},
}
},
},
}
</script>
<template>
<div class="icons-container">
<p class="warn-content">
<a href="https://panjiachen.github.io/vue-element-admin-site/guide/advanced/icon.html" target="_blank">Add and use
</a>
</p>
<div class="icons-wrapper">
<div v-for="item of iconsMap" :key="item" @click="handleClipboard(generateIconCode(item),$event)">
<el-tooltip placement="top">
<div slot="content">
{{ generateIconCode(item) }}
</div>
<div class="icon-item">
<svg-icon :icon-class="item" class-name="disabled" />
<span>{{ item }}</span>
</div>
</el-tooltip>
</div>
</div>
</div>
</template>
<script>
import icons from './requireIcons'
import clipboard from '@/utils/clipboard'
export default {
name: 'Icons',
data() {
return {
iconsMap: icons
}
},
methods: {
generateIconCode(symbol) {
return `<svg-icon icon-class="${symbol}" />`
},
handleClipboard(text, event) {
clipboard(text, event)
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.icons-container {
margin: 10px 20px 0;
overflow: hidden;
.icons-wrapper {
margin: 0 auto;
}
.icon-item {
margin: 20px;
height: 110px;
text-align: center;
width: 110px;
float: left;
font-size: 30px;
color: #24292e;
cursor: pointer;
}
span {
display: block;
font-size: 24px;
margin-top: 10px;
}
.disabled{
pointer-events: none;
}
}
</style>
const req = require.context('@/assets/icons/svg', false, /\.svg$/)
const requireAll = requireContext => requireContext.keys()
const re = /\.\/(.*)\.svg/
const icons = requireAll(req).map(i => {
return i.match(re)[1]
})
export default icons
<template>
<div>
test
</div>
</template>
<script>
export default {
components: {
},
data() {
return {
image: '',
imageList: '',
}
},
methods: {},
}
</script>
# PLUGINS
**This directory is not required, you can delete it if you don't want to use it.**
This directory contains Javascript plugins that you want to run before mounting the root Vue.js application.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/plugins).
export default function({ app, $axios, redirect }) {
const API = {}
API.login = (data) => {
return $axios({
url: '/admin/login',
method: 'post',
data,
})
}
app.api = API
}
export default function({ app, $axios, redirect }) {
const API = {}
API.login = (data) => {
return $axios({
url: '/admin/login',
method: 'post',
data,
})
}
app.api = API
}
import { Message, MessageBox } from 'element-ui'
import { getToken } from '@/utils/auth' // 验权
const service = ({ $axios, app }, inject) => {
$axios.interceptors.request.use(
(config) => {
config.headers['Authorization'] = getToken()
return config
},
error => Promise.reject(error),
)
$axios.interceptors.response.use(response => {
const { data } = response
const { code, msg, type } = data
// console.log('响应拦截器', response.config.url)
if (code !== 0) {
if (code === 10000) {
app.store.commit('Logout')
return Promise.reject(msg)
}
console.log('一般错误')
if (msg) {
Message({
message: msg,
type: type || 'error',
})
}
return Promise.reject(msg)
}
return data
}, error => {
const { status, data, response } = error.response
switch (status) {
// case 401:
// case 412:
// // 401或412说明token未传或失效,一般做重新登录操作
// // window.location.href = '/login'
// break
// case 500:
// // 后台服务器内部错误,一般向用户展示服务器错误信息
// console.log('服务器错误')
// break
default:
console.log('服务器错误')
return Promise.reject(error.response)
}
})
inject('request', $axios)
}
export default service
import Vue from 'vue'
import Element from 'element-ui'
import locale from 'element-ui/lib/locale/lang/zh-CN'
import '@/assets/styles/element-variables.scss'
Vue.use(Element, { locale })
import Vue from 'vue'
import SvgIcon from '@/components/svgIcon'// svg组件
// register globally
// Vue.component('svg-icon', SvgIcon)
// const requireAll = requireContext => requireContext.keys().map(requireContext)
// const req = require.context('./svg', false, /\.svg$/)
// requireAll(req)
Vue.component('svg-icon', SvgIcon)
const req = require.context('@/assets/icons/svg', false, /\.svg$/)
const requireAll = requireContext => requireContext.keys().map(requireContext)
requireAll(req)
import Vue from 'vue'
import print from 'print-js'
import 'xe-utils'
import { Message } from 'element-ui'
import { getToken } from '@/utils/auth' // 验权
import NProgress from 'nprogress' // Progress 进度条
const whiteList = ['/login']
export default ({ app }) => {
const { store } = app
app.router.beforeEach((to, from, next) => {
NProgress.start()
next()
// console.log('to', to)
// if (whiteList.indexOf(to.path) !== -1) {
// next()
// } else {
// if (getToken()) {
// store.dispatch('GetBaseInfo').then(res => { // 拉取用户信息
// // next()
// }).catch(() => {
// // store.dispatch('Logout').then(() => {
// // Message.error(err || '请重新登录')
// // next({ path: '/' })
// // })
// })
// }
// }
// next()
// next()
// setTimeout(() => {
// next()
// }, 5000)
// if (to.path === '/') {
// next('/index')
// }
// if (getToken()) {
// if (to.path === '/login') {
// // next('/')
// next()
// NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it
// } else {
// if (store.getters.roles_auth === '' || 1) {
// store.dispatch('GetBaseInfo').then(res => { // 拉取用户信息
// next()
// }).catch((err) => {
// store.dispatch('LogOut').then(() => {
// Message.error(err || '请重新登录')
// next({ path: '/' })
// })
// })
// } else {
// next()
// }
// }
// } else {
// if (whiteList.indexOf(to.path) !== -1) {
// next()
// } else {
// next(`/login?redirect=${to.path}`) // 否则全部重定向到登录页
// NProgress.done()
// }
// }
// if (to.name !== 'login') {
// // isLogin().then(() => {}).catch(() => {})
// app.$axios({
// url: '/admin/isLogin',
// }).then(() => {}).catch(() => {})
// }
// next()
})
app.router.afterEach(() => {
NProgress.done() // 结束Progress
})
}
import createPersistedState from 'vuex-persistedstate'
export default ({ store, req, isDev }) => {
createPersistedState({
key: 'vuex',
paths: ['base'],
storage: {
getItem: key => sessionStorage.getItem(key),
setItem: (key, value) => sessionStorage.setItem(key, value),
removeItem: key => sessionStorage.removeItem(key),
},
})(store)
}
# STATIC
**This directory is not required, you can delete it if you don't want to use it.**
This directory contains your static files.
Each file inside this directory is mapped to `/`.
Thus you'd want to delete this README.md before deploying to production.
Example: `/static/robots.txt` is mapped as `/robots.txt`.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#static).
[
{"name":"概况总览", "router":"/overview","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"用户管理", "router":"/user","id":"1","le":"1","path":"","pid":"330","visible":"",
"children":[
{"name":"用户列表", "router":"/user/user_list","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"用户课程", "router":"/user/user_courses","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"用户身份", "router":"/user/user_identity","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"身份设置", "router":"/user/identity_settings","id":"1","le":"1","path":"","pid":"330","visible":""}]
},
{"name":"课程管理", "router":"/course_management","id":"1","le":"1","path":"","pid":"330","visible":"",
"children":[
{"name":"课程目录", "router":"/course_management/course_catalogue","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"课程排期", "router":"/course_management/course_schedule","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"课程回收站", "router":"/course_management/course_recycle","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"助学管理", "router":"/course_management/student_management","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"课程问卷反馈", "router":"/course_management/course_questionnaire_feedback","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"模版管理", "router":"/course_management/template_management","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"子公司管理", "router":"/course_management/subsidiary_management","id":"1","le":"1","path":"","pid":"330","visible":""}]
},
{"name":"会员管理", "router":"/vip_management","id":"1","le":"1","path":"","pid":"330","visible":"",
"children":[
{"name":"会员列表", "router":"/vip_management/vip_list","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"会员缴费设置", "router":"/vip_management/vip_payment_settings","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"会员退费审核", "router":"/vip_management/vip_refund_audit","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"付费记录", "router":"/vip_management/vip_payment_records","id":"1","le":"1","path":"","pid":"330","visible":""}]
},
{"name":"智心馆管理", "router":"/zxg_management","id":"1","le":"1","path":"","pid":"330","visible":"",
"children":[
{"name":"智心馆列表", "router":"/zxg_management/zxg_list","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"沙龙讲师列表", "router":"/zxg_management/salon_lecturer","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"沙龙列表", "router":"/zxg_management/salon_list","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"沙龙数据", "router":"/zxg_management/salon_data","id":"1","le":"1","path":"","pid":"330","visible":""}]
},
{"name":"推广中心", "router":"/promotion_center","id":"1","le":"1","path":"","pid":"330","visible":"",
"children":[
{"name":"会员教练列表", "router":"/promotion_center/vip_coaches_list","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"宣导老师列表", "router":"/promotion_center/publicity_teacher_list","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"宣导课程列表", "router":"/promotion_center/publicity_curriculum_list","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"提现管理", "router":"/promotion_center/withdrawal_management","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"积分管理", "router":"/promotion_center/point_management","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"设置海报", "router":"/promotion_center/set_posters","id":"1","le":"1","path":"","pid":"330","visible":""}]
},
{"name":"圈子管理", "router":"/circle_management","id":"1","le":"1","path":"","pid":"330","visible":"",
"children":[
{"name":"圈子类型", "router":"/circle_management/circle_type","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"圈子列表", "router":"/circle_management/circle_list","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"成员列表", "router":"/circle_management/people_list","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"帖子列表", "router":"/circle_management/post_list","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"举报管理", "router":"/circle_management/report_management","id":"1","le":"1","path":"","pid":"330","visible":""}]
},
{"name":"线上课程管理", "router":"/online_course_management","id":"1","le":"1","path":"","pid":"330","visible":"",
"children":[
{"name":"音频管理", "router":"/online_course_management/overview_management","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"视频管理", "router":"/online_course_management/audio_management","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"直播管理", "router":"/online_course_management/live_management","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"专栏管理", "router":"/online_course_management/column_management","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"涵德设置", "router":"/online_course_management/hande_setting","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"兑换列表", "router":"/online_course_management/exchange_list","id":"1","le":"1","path":"","pid":"330","visible":""}]
},
{"name":"财务管理", "router":"/finance_management","ind":"1","le":"1","path":"","pid":"330","visible":"",
"children":[
{"name":"线上课程订单", "router":"/finance_management/online_course_order","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"发票管理", "router":"/finance_management/invoice_management","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"会员缴费", "router":"/finance_management/vip_pay","id":"1","le":"1","path":"","pid":"330","visible":""}]
},
{"name":"CMS", "router":"/cms","id":"1","le":"1","path":"","pid":"330","visible":"",
"children":[
{"name":"消息推送", "router":"/cms/message_push","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"资讯列表", "router":"/cms/information_list","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"轮播图列表", "router":"/cms/banner_list","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"活动列表", "router":"/cms/activity_list","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"作品列表", "router":"/cms/works_list","id":"1","le":"1","path":"","pid":"330","visible":""}]
},
{"name":"素材管理", "router":"/material_management","id":"1","le":"1","path":"","pid":"330","visible":"",
"children":[
{"name":"视频素材", "router":"/material_management/video_material","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"音频素材", "router":"/material_management/audio_material","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"图片素材", "router":"/material_management/picture_material","id":"1","le":"1","path":"","pid":"330","visible":""}]
},
{"name":"系统设置", "router":"/system_settings","id":"1","le":"1","path":"","pid":"330","visible":"",
"children":[
{"name":"权限管理", "router":"/system_settings/authority_management","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"弹窗列表", "router":"/system_settings/pop_list","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"首页热点图", "router":"/system_settings/hot_spot_map","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"操作日志", "router":"/system_settings/log","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"登陆页控制", "router":"/system_settings/login_control","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"版本控制", "router":"/system_settings/version_control","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"绑定验证码控制", "router":"/system_settings/code_control","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"常见问题列表", "router":"/system_settings/question_list","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"反馈列表", "router":"/system_settings/feedback_list","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"规则管理", "router":"/system_settings/rule_management","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"联系客服", "router":"/system_settings/contact_service","id":"1","le":"1","path":"","pid":"330","visible":""},
{"name":"关于我们", "router":"/system_settings/about_us","id":"1","le":"1","path":"","pid":"330","visible":""}]
}
]
\ No newline at end of file
This diff is collapsed.
# STORE
**This directory is not required, you can delete it if you don't want to use it.**
This directory contains your Vuex Store files.
Vuex Store option is implemented in the Nuxt.js framework.
Creating a file in this directory automatically activates the option in the framework.
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/vuex-store).
import md5 from 'js-md5'
import {
LOGIN,
GET_BASE_INFO,
LOGOUT,
IS_LOGIN,
SET_TOKEN,
SET_MENU_TREE,
SET_AUTH_BTN_LIST,
RELIST,
SET_USER_INFO,
SET_LOCALE,
SET_META,
SET_CACHE_NAV_LIST,
DELETE_CACHE_NAV_LIST,
CLOSE_ALL_CACHE_NAV_LIST,
CLOSE_OTHER_CACHE_NAV_LIST,
GET_CONFIG,
SET_CONFIG,
} from '@/store/mutation-types'
import { treeData } from '@/utils/tool'
import { setToken, removeToken, setUserData } from '@/utils/auth' // 验权
export const state = () => ({
relist: false, // 重新登录
userInfo: '', // 用户信息
cacheNavList: [], // 导航栏缓存的菜单
menuTree: [], // 菜单数据(树状结构)
menuList: [], // 菜单数据(列表结构)
authBtnList: [], // 权限按钮列表
authBtnIdList: [], // 权限按钮id列表
appConfig: {
project_name: '——', // 项目名称
img_domain: '', // 图片名称
}, // app配置
dictionary: {}, // 数据字典
ossConfig: {
access_key: '',
secret: '',
region_id: '',
bucket: '',
}, // 阿里云配置
})
export const getters = {
is_admin(state) { // 是否超级管理员
return state.userInfo?.role_id === 1
},
}
export const mutations = {
[SET_TOKEN]: (state, token) => {
state.token = token
},
// 重新登录
[RELIST](state, data) {
state.relist = data
},
// 退出登录
[LOGOUT](state, isLogout) {
state.menuTree = []
state.userInfo = ''
state.token = ''
removeToken()
if (!isLogout) {
// 这里修改登录状态, index页面通过监听relist的状态来判断是否需要重新登录
state.relist = true
}
},
// 设置用户信息
[SET_USER_INFO](state, data) {
state.userInfo = data
},
[SET_LOCALE](state, locale) {
state.locale = locale
},
[SET_META](state, meta) {
state.meta = meta
},
[SET_CACHE_NAV_LIST](state, menu) {
let isInclude = false
state.cacheNavList.forEach((value) => {
if (value.url === menu.url) isInclude = true
})
if (!isInclude) {
state.cacheNavList.push(menu)
}
},
// 缓存菜单数据
[SET_MENU_TREE](state, list) {
const menuList = JSON.parse(JSON.stringify(list))
const treeMenuTree = treeData(list, 0)
state.menuTree = treeMenuTree
state.menuList = menuList
state.authBtnList = menuList.filter(i => i.type === 'menu')
},
// 缓存菜单数据
[SET_AUTH_BTN_LIST](state, list) {
const menuList = JSON.parse(JSON.stringify(list))
const menu = menuList.filter(i => i.type === 'menu')
const authBtnIdList = []
menu.forEach(item => {
authBtnIdList.push(item.id)
})
state.authBtnIdList = authBtnIdList
},
[DELETE_CACHE_NAV_LIST](state, index) {
const newList = state.cacheNavList.splice(index, 1)
},
[CLOSE_ALL_CACHE_NAV_LIST](state) {
// 关闭所有,只保留第一个
// const menu = state.cacheNavList[0]
const newList = []
// newList.push(menu)
state.cacheNavList = newList
},
[CLOSE_OTHER_CACHE_NAV_LIST](state, index) {
// 关闭其他,只保留当前一个
const menu = state.cacheNavList[index]
const newList = []
newList.push(menu)
state.cacheNavList = newList
},
// 保存配置信息
[SET_CONFIG](state, data) {
const { app, oss, dictionary } = data
document.title = app.project_name
state.ossConfig = oss
state.appConfig = app
state.dictionary = dictionary
},
}
export const actions = {
[LOGIN]({ commit }, loginData) {
const data = {
...loginData,
}
// return this.$request.post('/admin/login', data)
return new Promise((resolve, reject) => {
this.$request.post('/api/player/login', data).then(res => {
const { data } = res
const { token, openImToken, userId } = data
commit(RELIST, false)
setUserData({ token, openImToken, userId })
resolve(res)
}).catch(error => {
reject(error)
})
})
},
[GET_BASE_INFO]({ commit }) {
return new Promise((resolve, reject) => {
this.$request.get('/api/player/user/getInfo').then(({ data }) => {
commit('set_user_info', data) // 同时进行缓存
resolve({ data })
}).catch(error => {
reject(error)
})
})
},
[GET_CONFIG]({ commit }) {
return new Promise((resolve, reject) => {
this.$request.get('/admin/getAdminConfig').then(({ data }) => {
commit(SET_CONFIG, data)
resolve({ data })
}).catch(error => {
reject(error)
})
})
},
[LOGOUT]({ commit }) {
return new Promise((resolve, reject) => {
this.$request.post('/admin/logout').then(res => {
commit(LOGOUT, '')
resolve(res)
}).catch(error => {
reject(error)
})
})
},
[IS_LOGIN]({ commit }) {
return new Promise((resolve, reject) => {
this.$request.get('/admin/isLogin').then(res => {
resolve(res)
}).catch(error => {
reject(error)
})
})
}
}
// base
export const ADD_NUM = 'add_num'
export const MINUS_NUM = 'minus_num'
export const SET_LOCALE = 'set_locale'
export const SET_META = 'set_meta'
export const SET_CACHE_NAV_LIST = 'set_cache_nav_list'
export const DELETE_CACHE_NAV_LIST = 'delete_cache_nav_list'
export const CLOSE_ALL_CACHE_NAV_LIST = 'close_all_cache_nav_list'
export const CLOSE_OTHER_CACHE_NAV_LIST = 'close_other_cache_nav_list'
export const SET_MENU_TREE = 'set_menu_tree'
export const SET_AUTH_BTN_LIST = 'set_auth_btn_list'
export const SET_MENU_LIST = 'set_menu_list'
export const GET_CONFIG = 'GetConfig' // 获取基础配置信息
export const SET_CONFIG = 'SetConfig' // 设置配置信息
// page
export const SET_PAGE_ID = 'set_page_id'
export const SET_PAGE_BTN_LIST = 'set_page_btn_list'
// user
export const RELIST = 'relist' // 重新登录
export const SET_USER_INFO = 'set_user_info'
export const LOGOUT = 'Logout'
export const LOGIN = 'Login'
export const IS_LOGIN = 'IsLogin' // 判断是否登录的方法
export const GET_BASE_INFO = 'GetBaseInfo'
export const SET_TOKEN = 'SetToken'
/* eslint-disable */
require('script-loader!file-saver');
import XLSX from 'xlsx'
function generateArray(table) {
let out = [];
let rows = table.querySelectorAll('tr');
let ranges = [];
for (let R = 0; R < rows.length; ++R) {
let outRow = [];
let row = rows[R];
let columns = row.querySelectorAll('td');
for (let C = 0; C < columns.length; ++C) {
let cell = columns[C];
let colspan = cell.getAttribute('colspan');
let rowspan = cell.getAttribute('rowspan');
let cellValue = cell.innerText;
if (cellValue !== "" && cellValue == +cellValue) cellValue = +cellValue;
//Skip ranges
ranges.forEach(function (range) {
if (R >= range.s.r && R <= range.e.r && outRow.length >= range.s.c && outRow.length <= range.e.c) {
for (let i = 0; i <= range.e.c - range.s.c; ++i) outRow.push(null);
}
});
//Handle Row Span
if (rowspan || colspan) {
rowspan = rowspan || 1;
colspan = colspan || 1;
ranges.push({
s: {
r: R,
c: outRow.length
},
e: {
r: R + rowspan - 1,
c: outRow.length + colspan - 1
}
});
};
//Handle Value
outRow.push(cellValue !== "" ? cellValue : null);
//Handle Colspan
if (colspan)
for (let k = 0; k < colspan - 1; ++k) outRow.push(null);
}
out.push(outRow);
}
return [out, ranges];
};
function datenum(v, date1904) {
if (date1904) v += 1462;
let epoch = Date.parse(v);
return (epoch - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000);
}
function sheet_from_array_of_arrays(data, opts) {
let ws = {};
let range = {
s: {
c: 10000000,
r: 10000000
},
e: {
c: 0,
r: 0
}
};
for (let R = 0; R !== data.length; ++R) {
for (let C = 0; C !== data[R].length; ++C) {
if (range.s.r > R) range.s.r = R;
if (range.s.c > C) range.s.c = C;
if (range.e.r < R) range.e.r = R;
if (range.e.c < C) range.e.c = C;
let cell = {
v: data[R][C]
};
if (cell.v === null) continue;
let cell_ref = XLSX.utils.encode_cell({
c: C,
r: R
});
if (typeof cell.v === 'number') cell.t = 'n';
else if (typeof cell.v === 'boolean') cell.t = 'b';
else if (cell.v instanceof Date) {
cell.t = 'n';
cell.z = XLSX.SSF._table[14];
cell.v = datenum(cell.v);
} else cell.t = 's';
ws[cell_ref] = cell;
}
}
if (range.s.c < 10000000) ws['!ref'] = XLSX.utils.encode_range(range);
return ws;
}
function Workbook() {
if (!(this instanceof Workbook)) return new Workbook();
this.SheetNames = [];
this.Sheets = {};
}
function s2ab(s) {
let buf = new ArrayBuffer(s.length);
let view = new Uint8Array(buf);
for (let i = 0; i !== s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
return buf;
}
export function export_table_to_excel(id) {
let theTable = document.getElementById(id);
let oo = generateArray(theTable);
let ranges = oo[1];
/* original data */
let data = oo[0];
let ws_name = "SheetJS";
let wb = new Workbook(),
ws = sheet_from_array_of_arrays(data);
/* add ranges to worksheet */
// ws['!cols'] = ['apple', 'banan'];
ws['!merges'] = ranges;
/* add worksheet to workbook */
wb.SheetNames.push(ws_name);
wb.Sheets[ws_name] = ws;
let wbout = XLSX.write(wb, {
bookType: 'xlsx',
bookSST: false,
type: 'binary'
});
saveAs(new Blob([s2ab(wbout)], {
type: "application/octet-stream"
}), "test.xlsx")
}
export function export_json_to_excel({
header,
data,
filename,
autoWidth = true,
bookType= 'xlsx'
} = {}) {
/* original data */
filename = filename || 'excel-list'
data = [...data]
data.unshift(header);
let ws_name = "SheetJS";
let wb = new Workbook(),
ws = sheet_from_array_of_arrays(data);
if (autoWidth) {
/*设置worksheet每列的最大宽度*/
const colWidth = data.map(row => row.map(val => {
/*先判断是否为null/undefined*/
if (val === null || val === undefined) {
return {
'wch': 10
};
}
/*再判断是否为中文*/
else if (val.toString().charCodeAt(0) > 255) {
return {
'wch': val.toString().length * 2
};
} else {
return {
'wch': val.toString().length
};
}
}))
/*以第一行为初始值*/
let result = colWidth[0];
for (let i = 1; i < colWidth.length; i++) {
for (let j = 0; j < colWidth[i].length; j++) {
if (result[j]['wch'] < colWidth[i][j]['wch']) {
result[j]['wch'] = colWidth[i][j]['wch'];
}
}
}
ws['!cols'] = result;
}
/* add worksheet to workbook */
wb.SheetNames.push(ws_name);
wb.Sheets[ws_name] = ws;
let wbout = XLSX.write(wb, {
bookType: bookType,
bookSST: false,
type: 'binary'
});
saveAs(new Blob([s2ab(wbout)], {
type: "application/octet-stream"
}), `${filename}.${bookType}`);
}
\ No newline at end of file
import XLSX from 'xlsx'
/**
* 导出Excel的处理函数--针对table
* @param {Array} headers: [{key: 'date', title: '日期'}, {key: 'name', title: '名称'}]
* @param {Array} data : [{date: '2019-05-31', name: 'megen.huang'}, {date: 'name', name: '小明'}]
* @param {String} fileName: '导出结果.xlsx'
* */
export default function ExportExcel(headers, data, fileName = '导出结果.xlsx') {
const _headers = headers
.map((item, i) => Object.assign({}, { key: item.key, title: item.title, position: String.fromCharCode(65 + i) + 1 }))
.reduce((prev, next) => Object.assign({}, prev, { [next.position]: { key: next.key, v: next.title }}), {})
const _data = data
.map((item, i) => headers.map((key, j) => Object.assign({}, { content: item[key.key], position: String.fromCharCode(65 + j) + (i + 2) })))
// 对刚才的结果进行降维处理(二维数组变成一维数组)
.reduce((prev, next) => prev.concat(next))
// 转换成 worksheet 需要的结构
.reduce((prev, next) => Object.assign({}, prev, { [next.position]: { v: next.content }}), {})
// 合并 headers 和 data
const output = Object.assign({}, _headers, _data)
// 获取所有单元格的位置
const outputPos = Object.keys(output)
// 计算出范围 ,["A1",..., "H2"]
const ref = `${outputPos[0]}:${outputPos[outputPos.length - 1]}`
// 构建 workbook 对象
const wb = {
SheetNames: ['mySheet'],
Sheets: {
mySheet: Object.assign(
{},
output,
{
'!ref': ref,
// eslint-disable-next-line
'!cols': headers.map(item => ({wpx: 100}))
}
)
}
}
// 导出 Excel
XLSX.writeFile(wb, fileName)
}
import Cookies from 'js-cookie'
const TokenKey = 'user-token'
const UserId = 'user-id'
const OpenImToken = 'open-im-token'
export function getToken() {
return Cookies.get(TokenKey)
}
export function setToken(token) {
return Cookies.set(TokenKey, token)
}
export function setUserData({ token, userId, openImToken }) {
Cookies.set(TokenKey, token)
Cookies.set(UserId, userId)
Cookies.set(OpenImToken, openImToken)
return true
}
export function removeToken() {
return Cookies.remove(TokenKey)
}
import Vue from 'vue'
import Clipboard from 'clipboard'
function clipboardSuccess() {
Vue.prototype.$message({
message: 'Copy successfully',
type: 'success',
duration: 1500
})
}
function clipboardError() {
Vue.prototype.$message({
message: 'Copy failed',
type: 'error'
})
}
export default function handleClipboard(text, event) {
const clipboard = new Clipboard(event.target, {
text: () => text
})
clipboard.on('success', () => {
clipboardSuccess()
clipboard.off('error')
clipboard.off('success')
clipboard.destroy()
})
clipboard.on('error', () => {
clipboardError()
clipboard.off('error')
clipboard.off('success')
clipboard.destroy()
})
clipboard.onClick(event)
}
document.addEventListener('input', function(e) {
if (e.target.type === 'text' && e.target.getAttribute('maxlength') === null) {
e.target.setAttribute('maxlength', '200') // 限制最长输入20个字符
}
if (e.target.type === 'textarea' && e.target.getAttribute('maxlength') === null) {
e.target.setAttribute('maxlength', '200') // 限制最长输入200个字符
}
})
export default function loadBMap(ak) {
return new Promise(function(resolve, reject) {
/* global BMapGL*/
if (typeof BMapGL !== 'undefined') {
resolve(BMapGL)
return
}
window.onBMapCallback = function() {
resolve(BMapGL)
}
const script = document.createElement('script')
script.type = 'text/javascript'
script.src = 'https://api.map.baidu.com/api?v=2.0&type=webgl&ak=' + ak + '&callback=onBMapCallback'
script.onerror = reject
document.head.appendChild(script)
})
}
export default {}.install = (Vue, options = {}) => {
Vue.directive('dbClick', {
inserted(el, binding) {
el.addEventListener('click', e => {
if (!el.disabled) {
el.disabled = true
el.style.cursor = 'not-allowed'
setTimeout(() => {
el.style.cursor = 'pointer'
el.disabled = false
}, 1500)
}
})
}
})
}
/* eslint-disable no-param-reassign,consistent-return */
/**
* Created by IvanCai on 2017/4/19.
*/
import axios from 'axios'
// import Router from 'vue-router'
import { Message, MessageBox } from 'element-ui'
// const router = new Router({
// mode: 'history'
// })
const apiDomain = process.env.api_domain
const service = axios.create({
withCredentials: true,
baseURL: apiDomain,
timeout: 20000, // 设置超时时间
})
service.interceptors.request.use(
(config) => {
// if (window.showLoading) {
// window.showLoading()
// }
config.headers['X-Access-Token'] = sessionStorage.getItem('X-Access-Token') || 'd08ece6807f3ee81ee5178ca637d9082'
return config
},
error => Promise.reject(error),
)
service.interceptors.response.use(
(response) => {
const data = response.data
if (response.data.code !== '0') {
if (data.code === 10000) {
MessageBox.alert('登录过期,请重新登录', '提示', {
confirmButtonText: '确定',
callback: action => {
window.location.replace('/login')
}
})
return Promise.reject(response.data.error)
}
if (data.msg) {
Message({
message: data.msg,
type: data.type || 'error',
})
}
return Promise.reject(response.data.error)
}
return response.data
},
(error) => {
// window.hideLoading()
const { status, data } = error.response
switch (status) {
case 401:
case 412:
// 401或412说明token未传或失效,一般做重新登录操作
// window.location.href = '/login'
break
case 500:
// 后台服务器内部错误,一般向用户展示服务器错误信息
window.showTips('服务器错误', 'error')
break
default:
window.showTips('服务器错误', 'error')
return Promise.reject(error)
}
},
)
export default service
/** 重置message,防止重复点击重复弹出message弹框 */
import {
Message,
} from 'element-ui'
let messageInstance = null
const resetMessage = (options) => {
if (messageInstance) {
messageInstance.close()
}
messageInstance = Message(options)
};
['error', 'success', 'info', 'warning'].forEach((type) => {
resetMessage[type] = (options) => {
if (typeof options === 'string') {
options = {
message: options,
}
}
options.type = type
return resetMessage(options)
}
})
export const message = resetMessage
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment