├── src
├── constants
│ ├── permission.js
│ └── status.js
├── components
│ ├── Button
│ │ ├── index.vue
│ │ └── Cancel.vue
│ ├── Dropdown
│ │ ├── index.js
│ │ ├── Language.vue
│ │ └── Status.vue
│ ├── ImageCropper
│ │ └── utils
│ │ │ ├── mimes.js
│ │ │ ├── data2blob.js
│ │ │ └── effectRipple.js
│ ├── Tinymce
│ │ ├── toolbar.js
│ │ ├── plugins.js
│ │ └── dynamicLoadScript.js
│ ├── MarkdownEditor
│ │ └── default-options.js
│ ├── Charts
│ │ └── mixins
│ │ │ └── resize.js
│ ├── LangSelect
│ │ └── index.vue
│ ├── Screenfull
│ │ └── index.vue
│ ├── Hamburger
│ │ └── index.vue
│ ├── SvgIcon
│ │ └── index.vue
│ ├── DragSelect
│ │ └── index.vue
│ ├── SizeSelect
│ │ └── index.vue
│ └── JsonEditor
│ │ └── index.vue
├── assets
│ ├── 401_images
│ │ └── 401.gif
│ ├── 404_images
│ │ ├── 404.png
│ │ └── 404_cloud.png
│ └── custom-theme
│ │ └── fonts
│ │ ├── element-icons.ttf
│ │ └── element-icons.woff
├── views
│ ├── nested
│ │ ├── menu2
│ │ │ └── index.vue
│ │ └── menu1
│ │ │ ├── menu1-3
│ │ │ └── index.vue
│ │ │ ├── index.vue
│ │ │ ├── menu1-2
│ │ │ ├── menu1-2-1
│ │ │ │ └── index.vue
│ │ │ ├── menu1-2-2
│ │ │ │ └── index.vue
│ │ │ └── index.vue
│ │ │ └── menu1-1
│ │ │ └── index.vue
│ ├── error-log
│ │ ├── components
│ │ │ ├── ErrorTestB.vue
│ │ │ └── ErrorTestA.vue
│ │ └── index.vue
│ ├── example
│ │ ├── components
│ │ │ ├── Dropdown
│ │ │ │ ├── index.js
│ │ │ │ ├── SourceUrl.vue
│ │ │ │ ├── Comment.vue
│ │ │ │ └── Platform.vue
│ │ │ └── Warning.vue
│ │ ├── edit.vue
│ │ └── create.vue
│ ├── role
│ │ ├── create.vue
│ │ └── edit.vue
│ ├── setting
│ │ └── edit.vue
│ ├── user
│ │ ├── create.vue
│ │ └── edit.vue
│ ├── article
│ │ ├── create.vue
│ │ └── edit.vue
│ ├── article-category
│ │ ├── create.vue
│ │ └── edit.vue
│ ├── redirect
│ │ └── index.vue
│ ├── dashboard
│ │ └── index.vue
│ ├── login
│ │ └── auth-redirect.vue
│ ├── charts
│ │ ├── line.vue
│ │ ├── mix-chart.vue
│ │ └── keyboard.vue
│ ├── table
│ │ └── dynamic-table
│ │ │ ├── index.vue
│ │ │ └── components
│ │ │ ├── UnfixedThead.vue
│ │ │ └── FixedThead.vue
│ ├── excel
│ │ ├── components
│ │ │ ├── FilenameOption.vue
│ │ │ ├── AutoWidthOption.vue
│ │ │ └── BookTypeOption.vue
│ │ └── upload-excel.vue
│ ├── profile
│ │ └── components
│ │ │ ├── Password.vue
│ │ │ ├── Account.vue
│ │ │ └── Session.vue
│ ├── components-demo
│ │ ├── dnd-list.vue
│ │ ├── dropzone.vue
│ │ ├── drag-select.vue
│ │ ├── json-editor.vue
│ │ ├── drag-kanban.vue
│ │ ├── tinymce.vue
│ │ ├── split-pane.vue
│ │ └── avatar-upload.vue
│ ├── guide
│ │ ├── index.vue
│ │ └── steps.js
│ ├── qiniu
│ │ └── upload.vue
│ ├── system-setting
│ │ ├── index.vue
│ │ └── components
│ │ │ ├── Mailer.vue
│ │ │ └── Upload.vue
│ ├── clipboard
│ │ └── index.vue
│ └── tab
│ │ └── index.vue
├── utils
│ ├── moment.js
│ ├── auth.js
│ ├── i18n.js
│ ├── get-page-title.js
│ ├── permission.js
│ ├── status.js
│ ├── clipboard.js
│ ├── error-log.js
│ ├── open-window.js
│ └── scroll-to.js
├── App.vue
├── icons
│ ├── svg
│ │ ├── chart.svg
│ │ ├── size.svg
│ │ ├── link.svg
│ │ ├── guide.svg
│ │ ├── component.svg
│ │ ├── money.svg
│ │ ├── email.svg
│ │ ├── drag.svg
│ │ ├── documentation.svg
│ │ ├── fullscreen.svg
│ │ ├── user.svg
│ │ ├── lock.svg
│ │ ├── excel.svg
│ │ ├── example.svg
│ │ ├── star.svg
│ │ ├── table.svg
│ │ ├── search.svg
│ │ ├── password.svg
│ │ ├── education.svg
│ │ ├── tab.svg
│ │ ├── message.svg
│ │ ├── theme.svg
│ │ ├── peoples.svg
│ │ ├── edit.svg
│ │ ├── nested.svg
│ │ ├── tree-table.svg
│ │ ├── article.svg
│ │ ├── eye.svg
│ │ ├── clipboard.svg
│ │ ├── list.svg
│ │ ├── icon.svg
│ │ ├── international.svg
│ │ ├── wechat.svg
│ │ ├── skill.svg
│ │ ├── people.svg
│ │ ├── language.svg
│ │ ├── eye-open.svg
│ │ ├── 404.svg
│ │ ├── zip.svg
│ │ ├── setting.svg
│ │ ├── bug.svg
│ │ ├── role.svg
│ │ ├── pdf.svg
│ │ ├── exit-fullscreen.svg
│ │ └── tree.svg
│ ├── index.js
│ └── svgo.yml
├── api
│ ├── qiniu.js
│ ├── upload.js
│ ├── permission.js
│ ├── session.js
│ ├── remote-search.js
│ ├── setting.js
│ ├── role.js
│ ├── article.js
│ ├── article-category.js
│ └── user.js
├── layout
│ ├── components
│ │ ├── index.js
│ │ ├── Sidebar
│ │ │ ├── Item.vue
│ │ │ ├── Link.vue
│ │ │ ├── FixiOSBug.js
│ │ │ └── index.vue
│ │ └── AppMain.vue
│ └── mixin
│ │ └── ResizeHandler.js
├── directive
│ ├── waves
│ │ ├── index.js
│ │ └── waves.css
│ ├── el-drag-dialog
│ │ └── index.js
│ ├── clipboard
│ │ ├── index.js
│ │ └── clipboard.js
│ ├── permission
│ │ ├── index.js
│ │ └── permission.js
│ └── el-table
│ │ ├── index.js
│ │ └── adaptive.js
├── store
│ ├── modules
│ │ ├── errorLog.js
│ │ ├── settings.js
│ │ ├── permission.js
│ │ └── app.js
│ ├── index.js
│ └── getters.js
├── vendor
│ └── Export2Zip.js
├── styles
│ ├── variables.scss
│ ├── element-variables.scss
│ ├── transition.scss
│ ├── element-ui.scss
│ ├── mixin.scss
│ └── btn.scss
├── router
│ └── modules
│ │ ├── user.js
│ │ ├── article.js
│ │ ├── article-category.js
│ │ └── system.js
├── settings.js
├── main.js
├── lang
│ └── index.js
└── filters
│ └── index.js
├── .dockerignore
├── .eslintignore
├── babel.config.js
├── tests
└── unit
│ ├── .eslintrc.js
│ ├── components
│ ├── Hamburger.spec.js
│ └── SvgIcon.spec.js
│ └── utils
│ ├── parseTime.spec.js
│ ├── formatTime.spec.js
│ └── validate.spec.js
├── postcss.config.js
├── public
├── favicon.ico
├── images
│ └── avatar.gif
└── index.html
├── dist
└── staging
│ ├── favicon.ico
│ ├── images
│ └── avatar.gif
│ ├── img
│ ├── 401.089007e7.gif
│ ├── 404.a57b6f31.png
│ └── 404_cloud.0f4bc32b.png
│ ├── fonts
│ ├── element-icons.2fad952a.woff
│ └── element-icons.6f0a7632.ttf
│ ├── css
│ ├── chunk-11a766c5.2ed191ab.css
│ ├── chunk-3b04e0f6.092ee651.css
│ ├── chunk-451a99b9.2ed191ab.css
│ ├── chunk-693977b8.092ee651.css
│ ├── chunk-71c02baa.659bdbf1.css
│ ├── chunk-ff6a408c.659bdbf1.css
│ ├── chunk-077d3d2f.1a93ca06.css
│ ├── chunk-45e73af7.13821f5e.css
│ ├── chunk-611c739c.68da349b.css
│ ├── chunk-bb9bbe2a.97ff5f9d.css
│ ├── chunk-cd657040.f475bc4b.css
│ ├── chunk-e79a2ce2.80ad2213.css
│ └── chunk-bde554f6.d70a19af.css
│ └── js
│ ├── chunk-2d20958b.2b3dce9a.js
│ ├── chunk-2d230fe7.8023f254.js
│ ├── chunk-2d2105d3.c38e1553.js
│ ├── chunk-2d237b52.bbd36145.js
│ ├── chunk-2d0e5357.8661c131.js
│ ├── chunk-556562e8.3e641055.js
│ └── chunk-45e73af7.6d1d4f45.js
├── .travis.yml
├── .env.production
├── .github
├── FUNDING.yml
├── ISSUE_TEMPLATE
│ ├── feature_request.md
│ ├── bug_report.md
│ └── question.md
└── workflows
│ └── tencent.yml
├── .env.staging
├── plop-templates
├── utils.js
├── view
│ ├── index.hbs
│ └── prompt.js
└── component
│ ├── index.hbs
│ └── prompt.js
├── conf
└── nginx.conf
├── plopfile.js
├── .editorconfig
├── .gitignore
├── .env.development
├── Dockerfile
├── jest.config.js
├── LICENSE
└── mock
├── remote-search.js
└── user.js
/src/constants/permission.js:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/.dockerignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | dist/
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | build/*.js
2 | src/assets
3 | public
4 | dist
5 |
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | '@vue/app'
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/src/components/Button/index.vue:
--------------------------------------------------------------------------------
1 | export { default as CancelButton } from './Cancel'
2 |
--------------------------------------------------------------------------------
/tests/unit/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: {
3 | jest: true
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | autoprefixer: {}
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/razonyang/yii2-vue-admin/HEAD/public/favicon.ico
--------------------------------------------------------------------------------
/src/constants/status.js:
--------------------------------------------------------------------------------
1 | export const STATUS_INACTIVE = 0
2 | export const STATUS_ACTIVE = 1
3 |
--------------------------------------------------------------------------------
/dist/staging/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/razonyang/yii2-vue-admin/HEAD/dist/staging/favicon.ico
--------------------------------------------------------------------------------
/public/images/avatar.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/razonyang/yii2-vue-admin/HEAD/public/images/avatar.gif
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js: 10
3 | script: npm run test
4 | notifications:
5 | email: false
6 |
--------------------------------------------------------------------------------
/src/assets/401_images/401.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/razonyang/yii2-vue-admin/HEAD/src/assets/401_images/401.gif
--------------------------------------------------------------------------------
/src/assets/404_images/404.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/razonyang/yii2-vue-admin/HEAD/src/assets/404_images/404.png
--------------------------------------------------------------------------------
/dist/staging/images/avatar.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/razonyang/yii2-vue-admin/HEAD/dist/staging/images/avatar.gif
--------------------------------------------------------------------------------
/dist/staging/img/401.089007e7.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/razonyang/yii2-vue-admin/HEAD/dist/staging/img/401.089007e7.gif
--------------------------------------------------------------------------------
/dist/staging/img/404.a57b6f31.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/razonyang/yii2-vue-admin/HEAD/dist/staging/img/404.a57b6f31.png
--------------------------------------------------------------------------------
/src/assets/404_images/404_cloud.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/razonyang/yii2-vue-admin/HEAD/src/assets/404_images/404_cloud.png
--------------------------------------------------------------------------------
/dist/staging/img/404_cloud.0f4bc32b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/razonyang/yii2-vue-admin/HEAD/dist/staging/img/404_cloud.0f4bc32b.png
--------------------------------------------------------------------------------
/.env.production:
--------------------------------------------------------------------------------
1 | # just a flag
2 | ENV = 'production'
3 |
4 | # base api
5 | VUE_APP_BASE_API = 'https://yii2.razonyang.com/api/backend/v1'
6 |
--------------------------------------------------------------------------------
/dist/staging/fonts/element-icons.2fad952a.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/razonyang/yii2-vue-admin/HEAD/dist/staging/fonts/element-icons.2fad952a.woff
--------------------------------------------------------------------------------
/dist/staging/fonts/element-icons.6f0a7632.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/razonyang/yii2-vue-admin/HEAD/dist/staging/fonts/element-icons.6f0a7632.ttf
--------------------------------------------------------------------------------
/src/components/Dropdown/index.js:
--------------------------------------------------------------------------------
1 | export { default as StatusDropdown } from './Status'
2 | export { default as LanguageDropdown } from './Language'
3 |
--------------------------------------------------------------------------------
/src/assets/custom-theme/fonts/element-icons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/razonyang/yii2-vue-admin/HEAD/src/assets/custom-theme/fonts/element-icons.ttf
--------------------------------------------------------------------------------
/src/assets/custom-theme/fonts/element-icons.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/razonyang/yii2-vue-admin/HEAD/src/assets/custom-theme/fonts/element-icons.woff
--------------------------------------------------------------------------------
/src/views/nested/menu2/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | patreon: panjiachen
4 | custom: https://panjiachen.github.io/vue-element-admin-site/donate
5 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature Request(新功能建议)
3 | about: Suggest an idea for this project
4 | ---
5 |
6 | ## Feature request(新功能建议)
7 |
8 |
--------------------------------------------------------------------------------
/dist/staging/css/chunk-11a766c5.2ed191ab.css:
--------------------------------------------------------------------------------
1 | .form-container[data-v-120e0a5e]{position:relative}.form-container .form-main-container[data-v-120e0a5e]{padding:40px 45px 20px 50px}
--------------------------------------------------------------------------------
/dist/staging/css/chunk-3b04e0f6.092ee651.css:
--------------------------------------------------------------------------------
1 | .form-container[data-v-4b3c8427]{position:relative}.form-container .form-main-container[data-v-4b3c8427]{padding:40px 45px 20px 50px}
--------------------------------------------------------------------------------
/dist/staging/css/chunk-451a99b9.2ed191ab.css:
--------------------------------------------------------------------------------
1 | .form-container[data-v-120e0a5e]{position:relative}.form-container .form-main-container[data-v-120e0a5e]{padding:40px 45px 20px 50px}
--------------------------------------------------------------------------------
/dist/staging/css/chunk-693977b8.092ee651.css:
--------------------------------------------------------------------------------
1 | .form-container[data-v-4b3c8427]{position:relative}.form-container .form-main-container[data-v-4b3c8427]{padding:40px 45px 20px 50px}
--------------------------------------------------------------------------------
/src/utils/moment.js:
--------------------------------------------------------------------------------
1 | var moment = require('moment')
2 |
3 | export function formatTimestamp(time, format = 'YYYY-MM-DD hh:mm:ss') {
4 | return moment.unix(time).format(format)
5 | }
6 |
--------------------------------------------------------------------------------
/.env.staging:
--------------------------------------------------------------------------------
1 | NODE_ENV = production
2 |
3 | # just a flag
4 | ENV = 'staging'
5 |
6 | # base api
7 | VUE_APP_BASE_API = 'http://129.204.189.159:23332/api/backend/v1'
8 |
9 |
10 |
--------------------------------------------------------------------------------
/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
--------------------------------------------------------------------------------
/src/icons/svg/chart.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/views/nested/menu1/menu1-3/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/api/qiniu.js:
--------------------------------------------------------------------------------
1 | import request from '@/utils/request'
2 |
3 | export function getToken() {
4 | return request({
5 | url: '/qiniu/upload/token', // 假地址 自行替换
6 | method: 'get'
7 | })
8 | }
9 |
--------------------------------------------------------------------------------
/src/views/nested/menu1/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/components/ImageCropper/utils/mimes.js:
--------------------------------------------------------------------------------
1 | export default {
2 | 'jpg': 'image/jpeg',
3 | 'png': 'image/png',
4 | 'gif': 'image/gif',
5 | 'svg': 'image/svg+xml',
6 | 'psd': 'image/photoshop'
7 | }
8 |
--------------------------------------------------------------------------------
/src/views/nested/menu1/menu1-2/menu1-2-1/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/views/nested/menu1/menu1-2/menu1-2-2/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/plop-templates/utils.js:
--------------------------------------------------------------------------------
1 | exports.notEmpty = name => {
2 | return v => {
3 | if (!v || v.trim === '') {
4 | return `${name} is required`
5 | } else {
6 | return true
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/api/upload.js:
--------------------------------------------------------------------------------
1 | import request from '@/utils/request'
2 |
3 | export function uploadImage(data) {
4 | return request({
5 | url: '/upload/images',
6 | method: 'post',
7 | data
8 | })
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/src/icons/svg/size.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/views/error-log/components/ErrorTestB.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
12 |
--------------------------------------------------------------------------------
/src/views/example/components/Dropdown/index.js:
--------------------------------------------------------------------------------
1 | export { default as CommentDropdown } from './Comment'
2 | export { default as PlatformDropdown } from './Platform'
3 | export { default as SourceUrlDropdown } from './SourceUrl'
4 |
--------------------------------------------------------------------------------
/src/views/nested/menu1/menu1-1/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/views/nested/menu1/menu1-2/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/views/role/create.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
13 |
14 |
--------------------------------------------------------------------------------
/src/views/setting/edit.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
13 |
14 |
--------------------------------------------------------------------------------
/src/views/user/create.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
13 |
14 |
--------------------------------------------------------------------------------
/src/api/permission.js:
--------------------------------------------------------------------------------
1 | import request from '@/utils/request'
2 | import qs from 'qs'
3 |
4 | export function findPermissions(params) {
5 | return request({
6 | url: '/permissions?' + qs.stringify(params),
7 | method: 'get'
8 | })
9 | }
10 |
--------------------------------------------------------------------------------
/src/views/article/create.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
13 |
14 |
--------------------------------------------------------------------------------
/src/views/article-category/create.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
13 |
14 |
--------------------------------------------------------------------------------
/src/views/error-log/components/ErrorTestA.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{ a.a }}
5 |
6 |
7 |
8 |
9 |
14 |
--------------------------------------------------------------------------------
/conf/nginx.conf:
--------------------------------------------------------------------------------
1 | server {
2 | server_name localhost;
3 | root /app;
4 | index index.html;
5 |
6 | location / {
7 | try_files $uri $uri/ @rewrites;
8 | }
9 |
10 | location @rewrites {
11 | rewrite ^(.+)$ /index.html last;
12 | }
13 | }
--------------------------------------------------------------------------------
/src/views/example/edit.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
13 |
14 |
--------------------------------------------------------------------------------
/plopfile.js:
--------------------------------------------------------------------------------
1 | const viewGenerator = require('./plop-templates/view/prompt')
2 | const componentGenerator = require('./plop-templates/component/prompt')
3 |
4 | module.exports = function(plop) {
5 | plop.setGenerator('view', viewGenerator)
6 | plop.setGenerator('component', componentGenerator)
7 | }
8 |
--------------------------------------------------------------------------------
/src/icons/svg/link.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/layout/components/index.js:
--------------------------------------------------------------------------------
1 | export { default as AppMain } from './AppMain'
2 | export { default as Navbar } from './Navbar'
3 | export { default as Settings } from './Settings'
4 | export { default as Sidebar } from './Sidebar/index.vue'
5 | export { default as TagsView } from './TagsView/index.vue'
6 |
--------------------------------------------------------------------------------
/src/views/example/create.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
13 |
14 |
--------------------------------------------------------------------------------
/src/directive/waves/index.js:
--------------------------------------------------------------------------------
1 | import waves from './waves'
2 |
3 | const install = function(Vue) {
4 | Vue.directive('waves', waves)
5 | }
6 |
7 | if (window.Vue) {
8 | window.waves = waves
9 | Vue.use(install); // eslint-disable-line
10 | }
11 |
12 | waves.install = install
13 | export default waves
14 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # https://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 2
8 | end_of_line = lf
9 | insert_final_newline = true
10 | trim_trailing_whitespace = true
11 |
12 | [*.md]
13 | insert_final_newline = false
14 | trim_trailing_whitespace = false
15 |
--------------------------------------------------------------------------------
/src/views/redirect/index.vue:
--------------------------------------------------------------------------------
1 |
13 |
--------------------------------------------------------------------------------
/src/icons/svg/guide.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/directive/el-drag-dialog/index.js:
--------------------------------------------------------------------------------
1 | import drag from './drag'
2 |
3 | const install = function(Vue) {
4 | Vue.directive('el-drag-dialog', drag)
5 | }
6 |
7 | if (window.Vue) {
8 | window['el-drag-dialog'] = drag
9 | Vue.use(install); // eslint-disable-line
10 | }
11 |
12 | drag.install = install
13 | export default drag
14 |
--------------------------------------------------------------------------------
/src/icons/svg/component.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/icons/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import SvgIcon from '@/components/SvgIcon'// svg component
3 |
4 | // register globally
5 | Vue.component('svg-icon', SvgIcon)
6 |
7 | const req = require.context('./svg', false, /\.svg$/)
8 | const requireAll = requireContext => requireContext.keys().map(requireContext)
9 | requireAll(req)
10 |
--------------------------------------------------------------------------------
/src/views/dashboard/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Hello World
4 |
5 |
6 |
7 |
21 |
--------------------------------------------------------------------------------
/src/directive/clipboard/index.js:
--------------------------------------------------------------------------------
1 | import Clipboard from './clipboard'
2 |
3 | const install = function(Vue) {
4 | Vue.directive('Clipboard', Clipboard)
5 | }
6 |
7 | if (window.Vue) {
8 | window.clipboard = Clipboard
9 | Vue.use(install); // eslint-disable-line
10 | }
11 |
12 | Clipboard.install = install
13 | export default Clipboard
14 |
--------------------------------------------------------------------------------
/src/icons/svg/money.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/utils/auth.js:
--------------------------------------------------------------------------------
1 | import Cookies from 'js-cookie'
2 |
3 | const TokenKey = 'Admin-Token'
4 |
5 | export function getToken() {
6 | return Cookies.get(TokenKey)
7 | }
8 |
9 | export function setToken(token) {
10 | return Cookies.set(TokenKey, token)
11 | }
12 |
13 | export function removeToken() {
14 | return Cookies.remove(TokenKey)
15 | }
16 |
--------------------------------------------------------------------------------
/src/directive/permission/index.js:
--------------------------------------------------------------------------------
1 | import permission from './permission'
2 |
3 | const install = function(Vue) {
4 | Vue.directive('permission', permission)
5 | }
6 |
7 | if (window.Vue) {
8 | window['permission'] = permission
9 | Vue.use(install); // eslint-disable-line
10 | }
11 |
12 | permission.install = install
13 | export default permission
14 |
--------------------------------------------------------------------------------
/src/icons/svg/email.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/views/user/edit.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
18 |
19 |
--------------------------------------------------------------------------------
/src/icons/svg/drag.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/icons/svgo.yml:
--------------------------------------------------------------------------------
1 | # replace default config
2 |
3 | # multipass: true
4 | # full: true
5 |
6 | plugins:
7 |
8 | # - name
9 | #
10 | # or:
11 | # - name: false
12 | # - name: true
13 | #
14 | # or:
15 | # - name:
16 | # param1: 1
17 | # param2: 2
18 |
19 | - removeAttrs:
20 | attrs:
21 | - 'fill'
22 | - 'fill-rule'
23 |
--------------------------------------------------------------------------------
/src/views/article/edit.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
18 |
19 |
--------------------------------------------------------------------------------
/src/views/role/edit.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
19 |
20 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules/
3 | dist/
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | **/*.log
8 |
9 | tests/**/coverage/
10 | tests/e2e/reports
11 | selenium-debug.log
12 |
13 | # Editor directories and files
14 | .idea
15 | .vscode
16 | *.suo
17 | *.ntvs*
18 | *.njsproj
19 | *.sln
20 | *.local
21 |
22 | # package-lock.json
23 | yarn.lock
24 |
--------------------------------------------------------------------------------
/src/directive/el-table/index.js:
--------------------------------------------------------------------------------
1 | import adaptive from './adaptive'
2 |
3 | const install = function(Vue) {
4 | Vue.directive('el-height-adaptive-table', adaptive)
5 | }
6 |
7 | if (window.Vue) {
8 | window['el-height-adaptive-table'] = adaptive
9 | Vue.use(install); // eslint-disable-line
10 | }
11 |
12 | adaptive.install = install
13 | export default adaptive
14 |
--------------------------------------------------------------------------------
/src/views/article-category/edit.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
18 |
19 |
--------------------------------------------------------------------------------
/dist/staging/js/chunk-2d20958b.2b3dce9a.js:
--------------------------------------------------------------------------------
1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d20958b"],{a952:function(e,n,t){"use strict";t.r(n);var a=function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("detail")},c=[],l=t("cb2d"),o={name:"CreateForm",components:{Detail:l["a"]}},r=o,u=t("2877"),s=Object(u["a"])(r,a,c,!1,null,null,null);n["default"]=s.exports}}]);
--------------------------------------------------------------------------------
/src/api/session.js:
--------------------------------------------------------------------------------
1 | import request from '@/utils/request'
2 | import qs from 'qs'
3 |
4 | export function findSessions(params) {
5 | return request({
6 | url: '/my/sessions?' + qs.stringify(params),
7 | method: 'get'
8 | })
9 | }
10 |
11 | export function deleteSession(id) {
12 | return request({
13 | url: '/my/sessions/' + id,
14 | method: 'delete'
15 | })
16 | }
17 |
--------------------------------------------------------------------------------
/dist/staging/js/chunk-2d230fe7.8023f254.js:
--------------------------------------------------------------------------------
1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d230fe7"],{ef3c:function(e,r,n){"use strict";n.r(r);n("a481");var t,u,a={created:function(){var e=this.$route,r=e.params,n=e.query,t=r.path;this.$router.replace({path:"/"+t,query:n})},render:function(e){return e()}},c=a,o=n("2877"),p=Object(o["a"])(c,t,u,!1,null,null,null);r["default"]=p.exports}}]);
--------------------------------------------------------------------------------
/src/api/remote-search.js:
--------------------------------------------------------------------------------
1 | import request from '@/utils/request'
2 |
3 | export function searchUser(name) {
4 | return request({
5 | url: '/search/user',
6 | method: 'get',
7 | params: { name }
8 | })
9 | }
10 |
11 | export function transactionList(query) {
12 | return request({
13 | url: '/transaction/list',
14 | method: 'get',
15 | params: query
16 | })
17 | }
18 |
--------------------------------------------------------------------------------
/src/utils/i18n.js:
--------------------------------------------------------------------------------
1 | // translate router.meta.title, be used in breadcrumb sidebar tagsview
2 | export function generateTitle(title) {
3 | const hasKey = this.$te('route.' + title)
4 | if (hasKey) {
5 | // $t :this method from vue-i18n, inject in @/lang/index.js
6 | const translatedTitle = this.$t('route.' + title)
7 |
8 | return translatedTitle
9 | }
10 | return title
11 | }
12 |
--------------------------------------------------------------------------------
/src/views/login/auth-redirect.vue:
--------------------------------------------------------------------------------
1 |
16 |
--------------------------------------------------------------------------------
/src/utils/get-page-title.js:
--------------------------------------------------------------------------------
1 | import defaultSettings from '@/settings'
2 | import i18n from '@/lang'
3 |
4 | const title = defaultSettings.title || 'Yii Vue Element Admin'
5 |
6 | export default function getPageTitle(key) {
7 | const hasKey = i18n.te(`route.${key}`)
8 | if (hasKey) {
9 | const pageName = i18n.t(`route.${key}`)
10 | return `${pageName} - ${title}`
11 | }
12 | return `${title}`
13 | }
14 |
--------------------------------------------------------------------------------
/src/icons/svg/documentation.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/icons/svg/fullscreen.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/plop-templates/view/index.hbs:
--------------------------------------------------------------------------------
1 | {{#if template}}
2 |
3 |
4 |
5 | {{/if}}
6 |
7 | {{#if script}}
8 |
20 | {{/if}}
21 |
22 | {{#if style}}
23 |
26 | {{/if}}
27 |
--------------------------------------------------------------------------------
/src/icons/svg/user.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/dist/staging/js/chunk-2d2105d3.c38e1553.js:
--------------------------------------------------------------------------------
1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d2105d3"],{b829:function(n,e,o){"use strict";o.r(e);o("386d");var t,c,a={name:"AuthRedirect",created:function(){var n=window.location.search.slice(1);window.localStorage&&(window.localStorage.setItem("x-admin-oauth-code",n),window.close())},render:function(n){return n()}},d=a,i=o("2877"),l=Object(i["a"])(d,t,c,!1,null,null,null);e["default"]=l.exports}}]);
--------------------------------------------------------------------------------
/plop-templates/component/index.hbs:
--------------------------------------------------------------------------------
1 | {{#if template}}
2 |
3 |
4 |
5 | {{/if}}
6 |
7 | {{#if script}}
8 |
20 | {{/if}}
21 |
22 | {{#if style}}
23 |
26 | {{/if}}
27 |
--------------------------------------------------------------------------------
/src/icons/svg/lock.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/dist/staging/js/chunk-2d237b52.bbd36145.js:
--------------------------------------------------------------------------------
1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d237b52"],{fbee:function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("detail",{attrs:{id:t.id}})},i=[],r=n("cb2d"),s={name:"EditForm",components:{Detail:r["a"]},data:function(){return{id:parseInt(this.$route.params.id)}}},u=s,c=n("2877"),d=Object(c["a"])(u,a,i,!1,null,null,null);e["default"]=d.exports}}]);
--------------------------------------------------------------------------------
/src/icons/svg/excel.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/views/charts/line.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
15 |
16 |
23 |
24 |
--------------------------------------------------------------------------------
/src/views/charts/mix-chart.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
15 |
16 |
23 |
24 |
--------------------------------------------------------------------------------
/src/views/charts/keyboard.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
15 |
16 |
23 |
24 |
--------------------------------------------------------------------------------
/src/components/Button/Cancel.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | {{ $t('common.cancel') }}
4 |
5 |
6 |
7 |
25 |
--------------------------------------------------------------------------------
/src/icons/svg/example.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/dist/staging/js/chunk-2d0e5357.8661c131.js:
--------------------------------------------------------------------------------
1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0e5357"],{9406:function(e,n,t){"use strict";t.r(n);var a=function(){var e=this,n=e.$createElement;e._self._c;return e._m(0)},c=[function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",{staticClass:"app-container"},[t("h1",[e._v("Hello World")])])}],r={name:"Dashboard",data:function(){return{}},computed:{},created:function(){}},u=r,l=t("2877"),o=Object(l["a"])(u,a,c,!1,null,null,null);n["default"]=o.exports}}]);
--------------------------------------------------------------------------------
/src/components/Tinymce/toolbar.js:
--------------------------------------------------------------------------------
1 | // Here is a list of the toolbar
2 | // Detail list see https://www.tinymce.com/docs/advanced/editor-control-identifiers/#toolbarcontrols
3 |
4 | const toolbar = ['searchreplace bold italic underline strikethrough alignleft aligncenter alignright outdent indent blockquote undo redo removeformat subscript superscript code codesample', 'hr bullist numlist link image charmap preview anchor pagebreak insertdatetime media table emoticons forecolor backcolor fullscreen']
5 |
6 | export default toolbar
7 |
--------------------------------------------------------------------------------
/src/api/setting.js:
--------------------------------------------------------------------------------
1 | import request from '@/utils/request'
2 | import qs from 'qs'
3 |
4 | export function findSettings(params) {
5 | return request({
6 | url: '/settings?' + qs.stringify(params),
7 | method: 'get'
8 | })
9 | }
10 |
11 | export function findSetting(id) {
12 | return request({
13 | url: '/settings/' + id,
14 | method: 'get'
15 | })
16 | }
17 |
18 | export function updateSetting(id, data) {
19 | return request({
20 | url: '/settings/' + id,
21 | method: 'put',
22 | data
23 | })
24 | }
25 |
--------------------------------------------------------------------------------
/src/store/modules/errorLog.js:
--------------------------------------------------------------------------------
1 | const state = {
2 | logs: []
3 | }
4 |
5 | const mutations = {
6 | ADD_ERROR_LOG: (state, log) => {
7 | state.logs.push(log)
8 | },
9 | CLEAR_ERROR_LOG: (state) => {
10 | state.logs.splice(0)
11 | }
12 | }
13 |
14 | const actions = {
15 | addErrorLog({ commit }, log) {
16 | commit('ADD_ERROR_LOG', log)
17 | },
18 | clearErrorLog({ commit }) {
19 | commit('CLEAR_ERROR_LOG')
20 | }
21 | }
22 |
23 | export default {
24 | namespaced: true,
25 | state,
26 | mutations,
27 | actions
28 | }
29 |
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | <%= webpackConfig.name %>
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/icons/svg/star.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/dist/staging/css/chunk-71c02baa.659bdbf1.css:
--------------------------------------------------------------------------------
1 | .form-container[data-v-3c090698]{position:relative}.form-container .form-main-container[data-v-3c090698]{padding:40px 45px 20px 50px}.form-container .form-main-container .postInfo-container[data-v-3c090698]{position:relative;margin-bottom:10px}.form-container .form-main-container .postInfo-container[data-v-3c090698]:after{content:"";display:table;clear:both}.form-container .form-main-container .postInfo-container .postInfo-container-item[data-v-3c090698]{float:left}.form-container .word-counter[data-v-3c090698]{width:40px;position:absolute;right:10px;top:0}
--------------------------------------------------------------------------------
/dist/staging/css/chunk-ff6a408c.659bdbf1.css:
--------------------------------------------------------------------------------
1 | .form-container[data-v-3c090698]{position:relative}.form-container .form-main-container[data-v-3c090698]{padding:40px 45px 20px 50px}.form-container .form-main-container .postInfo-container[data-v-3c090698]{position:relative;margin-bottom:10px}.form-container .form-main-container .postInfo-container[data-v-3c090698]:after{content:"";display:table;clear:both}.form-container .form-main-container .postInfo-container .postInfo-container-item[data-v-3c090698]{float:left}.form-container .word-counter[data-v-3c090698]{width:40px;position:absolute;right:10px;top:0}
--------------------------------------------------------------------------------
/src/icons/svg/table.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/icons/svg/search.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/components/Tinymce/plugins.js:
--------------------------------------------------------------------------------
1 | // Any plugins you want to use has to be imported
2 | // Detail plugins list see https://www.tinymce.com/docs/plugins/
3 | // Custom builds see https://www.tinymce.com/download/custom-builds/
4 |
5 | const plugins = ['advlist anchor autolink autosave code codesample colorpicker colorpicker contextmenu directionality emoticons fullscreen hr image imagetools insertdatetime link lists media nonbreaking noneditable pagebreak paste preview print save searchreplace spellchecker tabfocus table template textcolor textpattern visualblocks visualchars wordcount']
6 |
7 | export default plugins
8 |
--------------------------------------------------------------------------------
/src/utils/permission.js:
--------------------------------------------------------------------------------
1 | import store from '@/store'
2 |
3 | /**
4 | * @param {Array} value
5 | * @returns {Boolean}
6 | * @example see @/views/permission/directive.vue
7 | */
8 | export default function checkPermission(permissions) {
9 | if (permissions && permissions instanceof Array && permissions.length > 0) {
10 | const grantedPermissions = store.getters && store.getters.permissions
11 |
12 | const hasPermission = permissions.some(permisson => {
13 | return grantedPermissions.includes(permisson)
14 | })
15 |
16 | return !!hasPermission
17 | }
18 |
19 | return false
20 | }
21 |
--------------------------------------------------------------------------------
/.env.development:
--------------------------------------------------------------------------------
1 | # just a flag
2 | ENV = 'development'
3 |
4 | # base api
5 | VUE_APP_BASE_API = 'http://yii.test/api/backend/v1'
6 |
7 | # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
8 | # to control whether the babel-plugin-dynamic-import-node plugin is enabled.
9 | # It only does one thing by converting all import() to require().
10 | # This configuration can significantly increase the speed of hot updates,
11 | # when you have a large number of pages.
12 | # Detail: https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/babel-preset-app/index.js
13 |
14 | VUE_CLI_BABEL_TRANSPILE_MODULES = true
15 |
--------------------------------------------------------------------------------
/src/icons/svg/password.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/layout/components/Sidebar/Item.vue:
--------------------------------------------------------------------------------
1 |
30 |
--------------------------------------------------------------------------------
/src/components/ImageCropper/utils/data2blob.js:
--------------------------------------------------------------------------------
1 | /**
2 | * database64文件格式转换为2进制
3 | *
4 | * @param {[String]} data dataURL 的格式为 “data:image/png;base64,****”,逗号之前都是一些说明性的文字,我们只需要逗号之后的就行了
5 | * @param {[String]} mime [description]
6 | * @return {[blob]} [description]
7 | */
8 | export default function(data, mime) {
9 | data = data.split(',')[1]
10 | data = window.atob(data)
11 | var ia = new Uint8Array(data.length)
12 | for (var i = 0; i < data.length; i++) {
13 | ia[i] = data.charCodeAt(i)
14 | }
15 | // canvas.toDataURL 返回的默认格式就是 image/png
16 | return new Blob([ia], {
17 | type: mime
18 | })
19 | }
20 |
--------------------------------------------------------------------------------
/src/icons/svg/education.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/views/table/dynamic-table/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Fixed header, sorted by header order,
5 |
6 |
7 |
8 |
9 | Not fixed header, sorted by click order
10 |
11 |
12 |
13 |
14 |
15 |
24 |
25 |
--------------------------------------------------------------------------------
/src/icons/svg/tab.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/views/example/components/Warning.vue:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/icons/svg/message.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/utils/status.js:
--------------------------------------------------------------------------------
1 | import { STATUS_INACTIVE, STATUS_ACTIVE } from '@/constants/status'
2 | import i18n from '@/lang'
3 |
4 | export function getStatuses() {
5 | return [
6 | {
7 | value: STATUS_ACTIVE,
8 | label: i18n.t('common.active')
9 | },
10 | {
11 | value: STATUS_INACTIVE,
12 | label: i18n.t('common.inactive')
13 | }
14 | ]
15 | }
16 |
17 | export function getStatusName(status) {
18 | switch (status) {
19 | case STATUS_INACTIVE:
20 | return i18n.t('common.inactive')
21 | case STATUS_ACTIVE:
22 | return i18n.t('common.active')
23 | default:
24 | return i18n.t('common.unknown')
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/icons/svg/theme.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/directive/permission/permission.js:
--------------------------------------------------------------------------------
1 | import store from '@/store'
2 |
3 | export default {
4 | inserted(el, binding, vnode) {
5 | const { value } = binding
6 | const permissions = store.getters && store.getters.permissions
7 |
8 | if (value && value instanceof Array && value.length > 0) {
9 | const permissionRoles = value
10 |
11 | const hasPermission = permissions.some(role => {
12 | return permissionRoles.includes(role)
13 | })
14 |
15 | if (!hasPermission) {
16 | el.parentNode && el.parentNode.removeChild(el)
17 | }
18 | } else {
19 | throw new Error(`need permissions! Like v-permission="['userIndex']"`)
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/views/excel/components/FilenameOption.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
28 |
--------------------------------------------------------------------------------
/src/vendor/Export2Zip.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | require('script-loader!file-saver');
3 | import JSZip from 'jszip'
4 |
5 | export function export_txt_to_zip(th, jsonData, txtName, zipName) {
6 | const zip = new JSZip()
7 | const txt_name = txtName || 'file'
8 | const zip_name = zipName || 'file'
9 | const data = jsonData
10 | let txtData = `${th}\r\n`
11 | data.forEach((row) => {
12 | let tempStr = ''
13 | tempStr = row.toString()
14 | txtData += `${tempStr}\r\n`
15 | })
16 | zip.file(`${txt_name}.txt`, txtData)
17 | zip.generateAsync({
18 | type: "blob"
19 | }).then((blob) => {
20 | saveAs(blob, `${zip_name}.zip`)
21 | }, (err) => {
22 | alert('导出失败')
23 | })
24 | }
25 |
--------------------------------------------------------------------------------
/src/icons/svg/peoples.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/components/MarkdownEditor/default-options.js:
--------------------------------------------------------------------------------
1 | // doc: https://nhnent.github.io/tui.editor/api/latest/ToastUIEditor.html#ToastUIEditor
2 | export default {
3 | minHeight: '200px',
4 | previewStyle: 'vertical',
5 | useCommandShortcut: true,
6 | useDefaultHTMLSanitizer: true,
7 | usageStatistics: false,
8 | hideModeSwitch: false,
9 | toolbarItems: [
10 | 'heading',
11 | 'bold',
12 | 'italic',
13 | 'strike',
14 | 'divider',
15 | 'hr',
16 | 'quote',
17 | 'divider',
18 | 'ul',
19 | 'ol',
20 | 'task',
21 | 'indent',
22 | 'outdent',
23 | 'divider',
24 | 'table',
25 | 'image',
26 | 'link',
27 | 'divider',
28 | 'code',
29 | 'codeblock'
30 | ]
31 | }
32 |
--------------------------------------------------------------------------------
/tests/unit/components/Hamburger.spec.js:
--------------------------------------------------------------------------------
1 | import { shallowMount } from '@vue/test-utils'
2 | import Hamburger from '@/components/Hamburger/index.vue'
3 | describe('Hamburger.vue', () => {
4 | it('toggle click', () => {
5 | const wrapper = shallowMount(Hamburger)
6 | const mockFn = jest.fn()
7 | wrapper.vm.$on('toggleClick', mockFn)
8 | wrapper.find('.hamburger').trigger('click')
9 | expect(mockFn).toBeCalled()
10 | })
11 | it('prop isActive', () => {
12 | const wrapper = shallowMount(Hamburger)
13 | wrapper.setProps({ isActive: true })
14 | expect(wrapper.contains('.is-active')).toBe(true)
15 | wrapper.setProps({ isActive: false })
16 | expect(wrapper.contains('.is-active')).toBe(false)
17 | })
18 | })
19 |
--------------------------------------------------------------------------------
/tests/unit/components/SvgIcon.spec.js:
--------------------------------------------------------------------------------
1 | import { shallowMount } from '@vue/test-utils'
2 | import SvgIcon from '@/components/SvgIcon/index.vue'
3 | describe('SvgIcon.vue', () => {
4 | it('iconClass', () => {
5 | const wrapper = shallowMount(SvgIcon, {
6 | propsData: {
7 | iconClass: 'test'
8 | }
9 | })
10 | expect(wrapper.find('use').attributes().href).toBe('#icon-test')
11 | })
12 | it('className', () => {
13 | const wrapper = shallowMount(SvgIcon, {
14 | propsData: {
15 | iconClass: 'test'
16 | }
17 | })
18 | expect(wrapper.classes().length).toBe(1)
19 | wrapper.setProps({ className: 'test' })
20 | expect(wrapper.classes().includes('test')).toBe(true)
21 | })
22 | })
23 |
--------------------------------------------------------------------------------
/src/layout/components/Sidebar/Link.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
37 |
--------------------------------------------------------------------------------
/dist/staging/css/chunk-077d3d2f.1a93ca06.css:
--------------------------------------------------------------------------------
1 | .waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}.edit-input[data-v-2f0ffb2a]{padding-right:100px}.cancel-btn[data-v-2f0ffb2a]{position:absolute;right:15px;top:10px}
--------------------------------------------------------------------------------
/dist/staging/css/chunk-45e73af7.13821f5e.css:
--------------------------------------------------------------------------------
1 | .errPage-container[data-v-6fb1594e]{width:800px;max-width:100%;margin:100px auto}.errPage-container .pan-back-btn[data-v-6fb1594e]{background:#008489;color:#fff;border:none!important}.errPage-container .pan-gif[data-v-6fb1594e]{margin:0 auto;display:block}.errPage-container .pan-img[data-v-6fb1594e]{display:block;margin:0 auto;width:100%}.errPage-container .text-jumbo[data-v-6fb1594e]{font-size:60px;font-weight:700;color:#484848}.errPage-container .list-unstyled[data-v-6fb1594e]{font-size:14px}.errPage-container .list-unstyled li[data-v-6fb1594e]{padding-bottom:5px}.errPage-container .list-unstyled a[data-v-6fb1594e]{color:#008489;text-decoration:none}.errPage-container .list-unstyled a[data-v-6fb1594e]:hover{text-decoration:underline}
--------------------------------------------------------------------------------
/dist/staging/css/chunk-611c739c.68da349b.css:
--------------------------------------------------------------------------------
1 | .waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}.edit-input[data-v-4371b2b0]{padding-right:100px}.cancel-btn[data-v-4371b2b0]{position:absolute;right:15px;top:10px}
--------------------------------------------------------------------------------
/dist/staging/css/chunk-bb9bbe2a.97ff5f9d.css:
--------------------------------------------------------------------------------
1 | .waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}.edit-input[data-v-52ba1412]{padding-right:100px}.cancel-btn[data-v-52ba1412]{position:absolute;right:15px;top:10px}
--------------------------------------------------------------------------------
/dist/staging/css/chunk-cd657040.f475bc4b.css:
--------------------------------------------------------------------------------
1 | .waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}.edit-input[data-v-66146374]{padding-right:100px}.cancel-btn[data-v-66146374]{position:absolute;right:15px;top:10px}
--------------------------------------------------------------------------------
/dist/staging/css/chunk-e79a2ce2.80ad2213.css:
--------------------------------------------------------------------------------
1 | .waves-ripple{position:absolute;border-radius:100%;background-color:rgba(0,0,0,.15);background-clip:padding-box;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:scale(0);transform:scale(0);opacity:1}.waves-ripple.z-active{opacity:0;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,-webkit-transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out;transition:opacity 1.2s ease-out,transform .6s ease-out,-webkit-transform .6s ease-out}.edit-input[data-v-0e119b2c]{padding-right:100px}.cancel-btn[data-v-0e119b2c]{position:absolute;right:15px;top:10px}
--------------------------------------------------------------------------------
/src/layout/components/Sidebar/FixiOSBug.js:
--------------------------------------------------------------------------------
1 | export default {
2 | computed: {
3 | device() {
4 | return this.$store.state.app.device
5 | }
6 | },
7 | mounted() {
8 | // In order to fix the click on menu on the ios device will trigger the mouseleave bug
9 | // https://github.com/PanJiaChen/vue-element-admin/issues/1135
10 | this.fixBugIniOS()
11 | },
12 | methods: {
13 | fixBugIniOS() {
14 | const $subMenu = this.$refs.subMenu
15 | if ($subMenu) {
16 | const handleMouseleave = $subMenu.handleMouseleave
17 | $subMenu.handleMouseleave = (e) => {
18 | if (this.device === 'mobile') {
19 | return
20 | }
21 | handleMouseleave(e)
22 | }
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/views/excel/components/AutoWidthOption.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | True
7 |
8 |
9 | False
10 |
11 |
12 |
13 |
14 |
15 |
35 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | ARG app_mode=prod
2 |
3 | FROM node as builder
4 |
5 | # install simple http server for serving static content
6 | RUN npm install -g http-server
7 |
8 | # make the 'app' folder the current working directory
9 | WORKDIR /src
10 |
11 | # copy both 'package.json' and 'package-lock.json' (if available)
12 | COPY package*.json ./
13 |
14 | # install project dependencies
15 | RUN npm install
16 |
17 | # copy project files and folders to the current working directory (i.e. 'app' folder)
18 | COPY . .
19 |
20 | ARG app_mode
21 |
22 | # build app for production with minification
23 | RUN npm run build:${app_mode}
24 |
25 |
26 | FROM nginx
27 |
28 | COPY conf/nginx.conf /etc/nginx/conf.d/default.conf
29 |
30 | ARG app_mode
31 |
32 | COPY --from=builder /src/dist/${app_mode}/ /app
33 |
--------------------------------------------------------------------------------
/src/store/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import Vuex from 'vuex'
3 | import getters from './getters'
4 |
5 | Vue.use(Vuex)
6 |
7 | // https://webpack.js.org/guides/dependency-management/#requirecontext
8 | const modulesFiles = require.context('./modules', true, /\.js$/)
9 |
10 | // you do not need `import app from './modules/app'`
11 | // it will auto require all vuex module from modules file
12 | const modules = modulesFiles.keys().reduce((modules, modulePath) => {
13 | // set './app.js' => 'app'
14 | const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1')
15 | const value = modulesFiles(modulePath)
16 | modules[moduleName] = value.default
17 | return modules
18 | }, {})
19 |
20 | const store = new Vuex.Store({
21 | modules,
22 | getters
23 | })
24 |
25 | export default store
26 |
--------------------------------------------------------------------------------
/src/store/modules/settings.js:
--------------------------------------------------------------------------------
1 | import variables from '@/styles/element-variables.scss'
2 | import defaultSettings from '@/settings'
3 |
4 | const { showSettings, tagsView, fixedHeader, sidebarLogo } = defaultSettings
5 |
6 | const state = {
7 | theme: variables.theme,
8 | showSettings: showSettings,
9 | tagsView: tagsView,
10 | fixedHeader: fixedHeader,
11 | sidebarLogo: sidebarLogo
12 | }
13 |
14 | const mutations = {
15 | CHANGE_SETTING: (state, { key, value }) => {
16 | if (state.hasOwnProperty(key)) {
17 | state[key] = value
18 | }
19 | }
20 | }
21 |
22 | const actions = {
23 | changeSetting({ commit }, data) {
24 | commit('CHANGE_SETTING', data)
25 | }
26 | }
27 |
28 | export default {
29 | namespaced: true,
30 | state,
31 | mutations,
32 | actions
33 | }
34 |
35 |
--------------------------------------------------------------------------------
/src/icons/svg/edit.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/icons/svg/nested.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/api/role.js:
--------------------------------------------------------------------------------
1 | import request from '@/utils/request'
2 | import qs from 'qs'
3 |
4 | export function findRoles(params) {
5 | return request({
6 | url: '/roles?' + qs.stringify(params),
7 | method: 'get'
8 | })
9 | }
10 |
11 | export function createRole(data) {
12 | return request({
13 | url: '/roles',
14 | method: 'post',
15 | data
16 | })
17 | }
18 |
19 | export function updateRole(id, data) {
20 | return request({
21 | url: '/roles/' + id,
22 | method: 'put',
23 | data
24 | })
25 | }
26 |
27 | export function findRole(id, params) {
28 | return request({
29 | url: '/roles/' + id + '?' + qs.stringify(params),
30 | method: 'get'
31 | })
32 | }
33 |
34 | export function deleteRole(id) {
35 | return request({
36 | url: '/roles/' + id,
37 | method: 'delete'
38 | })
39 | }
40 |
--------------------------------------------------------------------------------
/src/store/getters.js:
--------------------------------------------------------------------------------
1 | const getters = {
2 | sidebar: state => state.app.sidebar,
3 | size: state => state.app.size,
4 | device: state => state.app.device,
5 | visitedViews: state => state.tagsView.visitedViews,
6 | cachedViews: state => state.tagsView.cachedViews,
7 | token: state => state.user.token,
8 | avatar: state => state.user.avatar,
9 | username: state => state.user.username,
10 | name: state => state.user.name,
11 | firstName: state => state.user.firstName,
12 | lastName: state => state.user.lastName,
13 | id: state => state.user.id,
14 | email: state => state.user.email,
15 | language: state => state.user.language,
16 | permissions: state => state.user.permissions,
17 | permission_routes: state => state.permission.routes,
18 | errorLogs: state => state.errorLog.logs
19 | }
20 | export default getters
21 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report(报告问题)
3 | about: Create a report to help us improve
4 | ---
5 |
10 |
11 |
12 | ## Bug report(问题描述)
13 |
14 | #### Steps to reproduce(问题复现步骤)
15 |
20 |
21 | #### Screenshot or Gif(截图或动态图)
22 |
23 |
24 | #### Link to minimal reproduction(最小可在线还原demo)
25 |
26 |
29 |
30 | #### Other relevant information(格外信息)
31 | - Your OS:
32 | - Node.js version:
33 | - vue-element-admin version:
34 |
--------------------------------------------------------------------------------
/src/views/excel/components/BookTypeOption.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
11 |
12 |
13 |
14 |
15 |
40 |
--------------------------------------------------------------------------------
/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | moduleFileExtensions: ['js', 'jsx', 'json', 'vue'],
3 | transform: {
4 | '^.+\\.vue$': 'vue-jest',
5 | '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$':
6 | 'jest-transform-stub',
7 | '^.+\\.jsx?$': 'babel-jest'
8 | },
9 | moduleNameMapper: {
10 | '^@/(.*)$': '/src/$1'
11 | },
12 | snapshotSerializers: ['jest-serializer-vue'],
13 | testMatch: [
14 | '**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)'
15 | ],
16 | collectCoverageFrom: ['src/utils/**/*.{js,vue}', '!src/utils/auth.js', '!src/utils/request.js', 'src/components/**/*.{js,vue}'],
17 | coverageDirectory: '/tests/unit/coverage',
18 | // 'collectCoverage': true,
19 | 'coverageReporters': [
20 | 'lcov',
21 | 'text-summary'
22 | ],
23 | testURL: 'http://localhost/'
24 | }
25 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/question.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Question(提问)
3 | about: Asking questions about use
4 | ---
5 |
6 | ## Question(提问)
7 |
8 |
15 |
16 | #### Steps to reproduce(问题复现步骤)
17 |
22 |
23 | #### Screenshot or Gif(截图或动态图)
24 |
25 |
26 | #### Link to minimal reproduction(最小可在线还原demo)
27 |
28 |
31 |
32 | #### Other relevant information(格外信息)
33 | - Your OS:
34 | - Node.js version:
35 | - vue-element-admin version:
36 |
--------------------------------------------------------------------------------
/src/api/article.js:
--------------------------------------------------------------------------------
1 | import request from '@/utils/request'
2 | import qs from 'qs'
3 |
4 | export function findArticles(params) {
5 | return request({
6 | url: '/articles?' + qs.stringify(params),
7 | method: 'get'
8 | })
9 | }
10 |
11 | export function findArticle(id, params) {
12 | params = params ? ('?' + qs.stringify(params)) : ''
13 | return request({
14 | url: `/articles/${id}${params}`,
15 | method: 'get'
16 | })
17 | }
18 |
19 | export function createArticle(data) {
20 | return request({
21 | url: '/articles',
22 | method: 'post',
23 | data
24 | })
25 | }
26 |
27 | export function updateArticle(id, data) {
28 | return request({
29 | url: '/articles/' + id,
30 | method: 'put',
31 | data
32 | })
33 | }
34 |
35 | export function deleteArticle(id) {
36 | return request({
37 | url: '/articles/' + id,
38 | method: 'delete'
39 | })
40 | }
41 |
--------------------------------------------------------------------------------
/src/icons/svg/tree-table.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/components/Dropdown/Language.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
38 |
--------------------------------------------------------------------------------
/src/utils/clipboard.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import Clipboard from 'clipboard'
3 |
4 | function clipboardSuccess() {
5 | Vue.prototype.$message({
6 | message: 'Copy successfully',
7 | type: 'success',
8 | duration: 1500
9 | })
10 | }
11 |
12 | function clipboardError() {
13 | Vue.prototype.$message({
14 | message: 'Copy failed',
15 | type: 'error'
16 | })
17 | }
18 |
19 | export default function handleClipboard(text, event) {
20 | const clipboard = new Clipboard(event.target, {
21 | text: () => text
22 | })
23 | clipboard.on('success', () => {
24 | clipboardSuccess()
25 | clipboard.off('error')
26 | clipboard.off('success')
27 | clipboard.destroy()
28 | })
29 | clipboard.on('error', () => {
30 | clipboardError()
31 | clipboard.off('error')
32 | clipboard.off('success')
33 | clipboard.destroy()
34 | })
35 | clipboard.onClick(event)
36 | }
37 |
--------------------------------------------------------------------------------
/src/icons/svg/article.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/icons/svg/eye.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/styles/variables.scss:
--------------------------------------------------------------------------------
1 | // base color
2 | $blue:#324157;
3 | $light-blue:#3A71A8;
4 | $red:#C03639;
5 | $pink: #E65D6E;
6 | $green: #30B08F;
7 | $tiffany: #4AB7BD;
8 | $yellow:#FEC171;
9 | $panGreen: #30B08F;
10 |
11 | // sidebar
12 | $menuText:#bfcbd9;
13 | $menuActiveText:#409EFF;
14 | $subMenuActiveText:#f4f4f5; // https://github.com/ElemeFE/element/issues/12951
15 |
16 | $menuBg:#304156;
17 | $menuHover:#263445;
18 |
19 | $subMenuBg:#1f2d3d;
20 | $subMenuHover:#001528;
21 |
22 | $sideBarWidth: 210px;
23 |
24 | // the :export directive is the magic sauce for webpack
25 | // https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass
26 | :export {
27 | menuText: $menuText;
28 | menuActiveText: $menuActiveText;
29 | subMenuActiveText: $subMenuActiveText;
30 | menuBg: $menuBg;
31 | menuHover: $menuHover;
32 | subMenuBg: $subMenuBg;
33 | subMenuHover: $subMenuHover;
34 | sideBarWidth: $sideBarWidth;
35 | }
36 |
--------------------------------------------------------------------------------
/src/styles/element-variables.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * I think element-ui's default theme color is too light for long-term use.
3 | * So I modified the default color and you can modify it to your liking.
4 | **/
5 |
6 | /* theme color */
7 | $--color-primary: #1890ff;
8 | $--color-success: #13ce66;
9 | $--color-warning: #FFBA00;
10 | $--color-danger: #ff4949;
11 | // $--color-info: #1E1E1E;
12 |
13 | $--button-font-weight: 400;
14 |
15 | // $--color-text-regular: #1f2d3d;
16 |
17 | $--border-color-light: #dfe4ed;
18 | $--border-color-lighter: #e6ebf5;
19 |
20 | $--table-border:1px solid#dfe6ec;
21 |
22 | /* icon font path, required */
23 | $--font-path: '~element-ui/lib/theme-chalk/fonts';
24 |
25 | @import "~element-ui/packages/theme-chalk/src/index";
26 |
27 | // the :export directive is the magic sauce for webpack
28 | // https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass
29 | :export {
30 | theme: $--color-primary;
31 | }
32 |
--------------------------------------------------------------------------------
/src/directive/waves/waves.css:
--------------------------------------------------------------------------------
1 | .waves-ripple {
2 | position: absolute;
3 | border-radius: 100%;
4 | background-color: rgba(0, 0, 0, 0.15);
5 | background-clip: padding-box;
6 | pointer-events: none;
7 | -webkit-user-select: none;
8 | -moz-user-select: none;
9 | -ms-user-select: none;
10 | user-select: none;
11 | -webkit-transform: scale(0);
12 | -ms-transform: scale(0);
13 | transform: scale(0);
14 | opacity: 1;
15 | }
16 |
17 | .waves-ripple.z-active {
18 | opacity: 0;
19 | -webkit-transform: scale(2);
20 | -ms-transform: scale(2);
21 | transform: scale(2);
22 | -webkit-transition: opacity 1.2s ease-out, -webkit-transform 0.6s ease-out;
23 | transition: opacity 1.2s ease-out, -webkit-transform 0.6s ease-out;
24 | transition: opacity 1.2s ease-out, transform 0.6s ease-out;
25 | transition: opacity 1.2s ease-out, transform 0.6s ease-out, -webkit-transform 0.6s ease-out;
26 | }
--------------------------------------------------------------------------------
/src/styles/transition.scss:
--------------------------------------------------------------------------------
1 | // global transition css
2 |
3 | /* fade */
4 | .fade-enter-active,
5 | .fade-leave-active {
6 | transition: opacity 0.28s;
7 | }
8 |
9 | .fade-enter,
10 | .fade-leave-active {
11 | opacity: 0;
12 | }
13 |
14 | /* fade-transform */
15 | .fade-transform-leave-active,
16 | .fade-transform-enter-active {
17 | transition: all .5s;
18 | }
19 |
20 | .fade-transform-enter {
21 | opacity: 0;
22 | transform: translateX(-30px);
23 | }
24 |
25 | .fade-transform-leave-to {
26 | opacity: 0;
27 | transform: translateX(30px);
28 | }
29 |
30 | /* breadcrumb transition */
31 | .breadcrumb-enter-active,
32 | .breadcrumb-leave-active {
33 | transition: all .5s;
34 | }
35 |
36 | .breadcrumb-enter,
37 | .breadcrumb-leave-active {
38 | opacity: 0;
39 | transform: translateX(20px);
40 | }
41 |
42 | .breadcrumb-move {
43 | transition: all .5s;
44 | }
45 |
46 | .breadcrumb-leave-active {
47 | position: absolute;
48 | }
49 |
--------------------------------------------------------------------------------
/src/router/modules/user.js:
--------------------------------------------------------------------------------
1 | import Layout from '@/layout'
2 |
3 | const userRouter = {
4 | path: '/user',
5 | component: Layout,
6 | children: [
7 | {
8 | path: '',
9 | component: () => import('@/views/user/list'),
10 | name: 'userList',
11 | meta: { title: 'user', icon: 'user', permissions: ['userIndex'] }
12 | },
13 | {
14 | path: 'create',
15 | component: () => import('@/views/user/create'),
16 | name: 'userCreate',
17 | hidden: true,
18 | breadcrumb: false,
19 | noCache: true,
20 | meta: { title: 'userCreate', permissions: ['userCreate'] }
21 | },
22 | {
23 | path: 'edit/:id',
24 | component: () => import('@/views/user/edit'),
25 | name: 'userEdit',
26 | hidden: true,
27 | breadcrumb: false,
28 | noCache: true,
29 | meta: { title: 'userEdit', permissions: ['userUpdate'] }
30 | }
31 | ]
32 | }
33 | export default userRouter
34 |
--------------------------------------------------------------------------------
/src/icons/svg/clipboard.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/api/article-category.js:
--------------------------------------------------------------------------------
1 | import request from '@/utils/request'
2 | import qs from 'qs'
3 |
4 | export function findCategories(params) {
5 | return request({
6 | url: '/article-categories?' + qs.stringify(params),
7 | method: 'get'
8 | })
9 | }
10 |
11 | export function findCategory(id, params) {
12 | params = params ? ('?' + qs.stringify(params)) : ''
13 | return request({
14 | url: `/article-categories/${id}${params}`,
15 | method: 'get'
16 | })
17 | }
18 |
19 | export function createCategory(data) {
20 | return request({
21 | url: '/article-categories',
22 | method: 'post',
23 | data
24 | })
25 | }
26 |
27 | export function updateCategory(id, data) {
28 | return request({
29 | url: '/article-categories/' + id,
30 | method: 'put',
31 | data
32 | })
33 | }
34 |
35 | export function deleteCategory(id) {
36 | return request({
37 | url: '/article-categories/' + id,
38 | method: 'delete'
39 | })
40 | }
41 |
--------------------------------------------------------------------------------
/src/settings.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | title: 'Yii Vue Element Admin',
3 |
4 | /**
5 | * @type {boolean} true | false
6 | * @description Whether show the settings right-panel
7 | */
8 | showSettings: true,
9 |
10 | /**
11 | * @type {boolean} true | false
12 | * @description Whether need tagsView
13 | */
14 | tagsView: true,
15 |
16 | /**
17 | * @type {boolean} true | false
18 | * @description Whether fix the header
19 | */
20 | fixedHeader: false,
21 |
22 | /**
23 | * @type {boolean} true | false
24 | * @description Whether show the logo in sidebar
25 | */
26 | sidebarLogo: true,
27 |
28 | /**
29 | * @type {string | array} 'production' | ['production', 'development']
30 | * @description Need show err logs component.
31 | * The default is only used in the production env
32 | * If you want to also use it in dev, you can pass ['production', 'development']
33 | */
34 | errorLog: 'production'
35 | }
36 |
--------------------------------------------------------------------------------
/src/router/modules/article.js:
--------------------------------------------------------------------------------
1 | import Layout from '@/layout'
2 |
3 | const userRouter = {
4 | path: '/article',
5 | component: Layout,
6 | children: [
7 | {
8 | path: '',
9 | component: () => import('@/views/article/list'),
10 | name: 'articleList',
11 | meta: { title: 'article', icon: 'article', permissions: ['articleIndex'] }
12 | },
13 | {
14 | path: 'create',
15 | component: () => import('@/views/article/create'),
16 | name: 'articleCreate',
17 | hidden: true,
18 | breadcrumb: false,
19 | noCache: true,
20 | meta: { title: 'articleCreate', permissions: ['articleCreate'] }
21 | },
22 | {
23 | path: 'edit/:id',
24 | component: () => import('@/views/article/edit'),
25 | name: 'articleEdit',
26 | hidden: true,
27 | breadcrumb: false,
28 | noCache: true,
29 | meta: { title: 'articleEdit', permissions: ['articleUpdate'] }
30 | }
31 | ]
32 | }
33 | export default userRouter
34 |
--------------------------------------------------------------------------------
/src/icons/svg/list.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/views/profile/components/Password.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | {{ $t('common.update') }}
11 |
12 |
13 |
14 |
15 |
37 |
--------------------------------------------------------------------------------
/src/views/components-demo/dnd-list.vue:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
12 |
39 |
40 |
--------------------------------------------------------------------------------
/src/views/guide/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 | Show Guide
10 |
11 |
12 |
13 |
14 |
37 |
--------------------------------------------------------------------------------
/src/views/example/components/Dropdown/SourceUrl.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Link
5 |
6 |
7 |
8 |
9 |
10 |
11 | URL
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
39 |
--------------------------------------------------------------------------------
/src/icons/svg/icon.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/utils/error-log.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import store from '@/store'
3 | import { isString, isArray } from '@/utils/validate'
4 | import settings from '@/settings'
5 |
6 | // you can set in settings.js
7 | // errorLog:'production' | ['production', 'development']
8 | const { errorLog: needErrorLog } = settings
9 |
10 | function checkNeed() {
11 | const env = process.env.NODE_ENV
12 | if (isString(needErrorLog)) {
13 | return env === needErrorLog
14 | }
15 | if (isArray(needErrorLog)) {
16 | return needErrorLog.includes(env)
17 | }
18 | return false
19 | }
20 |
21 | if (checkNeed()) {
22 | Vue.config.errorHandler = function(err, vm, info, a) {
23 | // Don't ask me why I use Vue.nextTick, it just a hack.
24 | // detail see https://forum.vuejs.org/t/dispatch-in-vue-config-errorhandler-has-some-problem/23500
25 | Vue.nextTick(() => {
26 | store.dispatch('errorLog/addErrorLog', {
27 | err,
28 | vm,
29 | info,
30 | url: window.location.href
31 | })
32 | console.error(err, info)
33 | })
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 |
3 | import Cookies from 'js-cookie'
4 |
5 | import 'normalize.css/normalize.css' // a modern alternative to CSS resets
6 |
7 | import Element from 'element-ui'
8 | import './styles/element-variables.scss'
9 |
10 | import '@/styles/index.scss' // global css
11 |
12 | import App from './App'
13 | import store from './store'
14 | import router from './router'
15 |
16 | import i18n from './lang' // internationalization
17 | import './icons' // icon
18 | import './permission' // permission control
19 | import './utils/error-log' // error log
20 |
21 | import * as filters from './filters' // global filters
22 |
23 | Vue.use(Element, {
24 | size: Cookies.get('size') || 'medium', // set element-ui default size
25 | i18n: (key, value) => i18n.t(key, value)
26 | })
27 |
28 | // register global utility filters
29 | Object.keys(filters).forEach(key => {
30 | Vue.filter(key, filters[key])
31 | })
32 |
33 | Vue.config.productionTip = false
34 |
35 | new Vue({
36 | el: '#app',
37 | router,
38 | store,
39 | i18n,
40 | render: h => h(App)
41 | })
42 |
--------------------------------------------------------------------------------
/tests/unit/utils/parseTime.spec.js:
--------------------------------------------------------------------------------
1 | import { parseTime } from '@/utils/index.js'
2 | describe('Utils:parseTime', () => {
3 | const d = new Date('2018-07-13 17:54:01') // "2018-07-13 17:54:01"
4 | it('timestamp', () => {
5 | expect(parseTime(d)).toBe('2018-07-13 17:54:01')
6 | })
7 | it('ten digits timestamp', () => {
8 | expect(parseTime((d / 1000).toFixed(0))).toBe('2018-07-13 17:54:01')
9 | })
10 | it('new Date', () => {
11 | expect(parseTime(new Date(d))).toBe('2018-07-13 17:54:01')
12 | })
13 | it('format', () => {
14 | expect(parseTime(d, '{y}-{m}-{d} {h}:{i}')).toBe('2018-07-13 17:54')
15 | expect(parseTime(d, '{y}-{m}-{d}')).toBe('2018-07-13')
16 | expect(parseTime(d, '{y}/{m}/{d} {h}-{i}')).toBe('2018/07/13 17-54')
17 | })
18 | it('get the day of the week', () => {
19 | expect(parseTime(d, '{a}')).toBe('五') // 星期五
20 | })
21 | it('get the day of the week', () => {
22 | expect(parseTime(+d + 1000 * 60 * 60 * 24 * 2, '{a}')).toBe('日') // 星期日
23 | })
24 | it('empty argument', () => {
25 | expect(parseTime()).toBeNull()
26 | })
27 | })
28 |
--------------------------------------------------------------------------------
/src/icons/svg/international.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/components/Charts/mixins/resize.js:
--------------------------------------------------------------------------------
1 | import { debounce } from '@/utils'
2 |
3 | export default {
4 | data() {
5 | return {
6 | $_sidebarElm: null
7 | }
8 | },
9 | mounted() {
10 | this.__resizeHandler = debounce(() => {
11 | if (this.chart) {
12 | this.chart.resize()
13 | }
14 | }, 100)
15 | window.addEventListener('resize', this.__resizeHandler)
16 |
17 | this.$_sidebarElm = document.getElementsByClassName('sidebar-container')[0]
18 | this.$_sidebarElm && this.$_sidebarElm.addEventListener('transitionend', this.$_sidebarResizeHandler)
19 | },
20 | beforeDestroy() {
21 | window.removeEventListener('resize', this.__resizeHandler)
22 |
23 | this.$_sidebarElm && this.$_sidebarElm.removeEventListener('transitionend', this.$_sidebarResizeHandler)
24 | },
25 | methods: {
26 | // use $_ for mixins properties
27 | // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential
28 | $_sidebarResizeHandler(e) {
29 | if (e.propertyName === 'width') {
30 | this.__resizeHandler()
31 | }
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/router/modules/article-category.js:
--------------------------------------------------------------------------------
1 | import Layout from '@/layout'
2 |
3 | const userRouter = {
4 | path: '/article-category',
5 | component: Layout,
6 | children: [
7 | {
8 | path: '',
9 | component: () => import('@/views/article-category/list'),
10 | name: 'articleCategoryList',
11 | meta: { title: 'articleCategory', icon: 'article', permissions: ['articleCategoryIndex'] }
12 | },
13 | {
14 | path: 'create',
15 | component: () => import('@/views/article-category/create'),
16 | name: 'articleCategoryCreate',
17 | hidden: true,
18 | breadcrumb: false,
19 | noCache: true,
20 | meta: { title: 'articleCategoryCreate', permissions: ['articleCategoryCreate'] }
21 | },
22 | {
23 | path: 'edit/:id',
24 | component: () => import('@/views/article-category/edit'),
25 | name: 'articleCategoryEdit',
26 | hidden: true,
27 | breadcrumb: false,
28 | noCache: true,
29 | meta: { title: 'articleCategoryEdit', permissions: ['articleCategoryUpdate'] }
30 | }
31 | ]
32 | }
33 | export default userRouter
34 |
--------------------------------------------------------------------------------
/src/components/Dropdown/Status.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{ status === 1 ? $t('common.active') : $t('common.inactive') }}
5 |
6 |
7 |
8 |
9 |
10 |
11 | {{ $t('common.active') }}
12 |
13 |
14 | {{ $t('common.inactive') }}
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
42 |
--------------------------------------------------------------------------------
/src/views/components-demo/dropzone.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
31 |
32 |
--------------------------------------------------------------------------------
/src/views/example/components/Dropdown/Comment.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{ !comment_disabled?'Comment: opened':'Comment: closed' }}
5 |
6 |
7 |
8 |
9 |
10 |
11 | Close comment
12 |
13 |
14 | Open comment
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
42 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017-present PanJiaChen
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/src/icons/svg/wechat.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/icons/svg/skill.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/tests/unit/utils/formatTime.spec.js:
--------------------------------------------------------------------------------
1 | import { formatTime } from '@/utils/index.js'
2 | describe('Utils:formatTime', () => {
3 | const d = new Date('2018-07-13 17:54:01') // "2018-07-13 17:54:01"
4 | const retrofit = 5 * 1000
5 |
6 | it('ten digits timestamp', () => {
7 | expect(formatTime((d / 1000).toFixed(0))).toBe('7月13日17时54分')
8 | })
9 | it('test now', () => {
10 | expect(formatTime(+new Date() - 1)).toBe('刚刚')
11 | })
12 | it('less two minute', () => {
13 | expect(formatTime(+new Date() - 60 * 2 * 1000 + retrofit)).toBe('2分钟前')
14 | })
15 | it('less two hour', () => {
16 | expect(formatTime(+new Date() - 60 * 60 * 2 * 1000 + retrofit)).toBe('2小时前')
17 | })
18 | it('less one day', () => {
19 | expect(formatTime(+new Date() - 60 * 60 * 24 * 1 * 1000)).toBe('1天前')
20 | })
21 | it('more than one day', () => {
22 | expect(formatTime(d)).toBe('7月13日17时54分')
23 | })
24 | it('format', () => {
25 | expect(formatTime(d, '{y}-{m}-{d} {h}:{i}')).toBe('2018-07-13 17:54')
26 | expect(formatTime(d, '{y}-{m}-{d}')).toBe('2018-07-13')
27 | expect(formatTime(d, '{y}/{m}/{d} {h}-{i}')).toBe('2018/07/13 17-54')
28 | })
29 | })
30 |
--------------------------------------------------------------------------------
/src/icons/svg/people.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/views/error-log/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
Please click the bug icon in the upper right corner
6 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
27 |
28 |
33 |
--------------------------------------------------------------------------------
/src/views/qiniu/upload.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 将文件拖到此处,或点击上传
6 |
7 |
8 |
9 |
10 |
42 |
--------------------------------------------------------------------------------
/src/views/excel/upload-excel.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
43 |
--------------------------------------------------------------------------------
/src/views/components-demo/drag-select.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | {{ item }}
10 |
11 |
12 |
13 |
14 |
15 |
44 |
--------------------------------------------------------------------------------
/src/icons/svg/language.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/layout/components/AppMain.vue:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
24 |
25 |
49 |
50 |
58 |
--------------------------------------------------------------------------------
/src/views/system-setting/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
54 |
--------------------------------------------------------------------------------
/tests/unit/utils/validate.spec.js:
--------------------------------------------------------------------------------
1 | import { validUsername, validURL, validLowerCase, validUpperCase, validAlphabets } from '@/utils/validate.js'
2 | describe('Utils:validate', () => {
3 | it('validUsername', () => {
4 | expect(validUsername('admin')).toBe(true)
5 | expect(validUsername('editor')).toBe(true)
6 | expect(validUsername('xxxx')).toBe(false)
7 | })
8 | it('validURL', () => {
9 | expect(validURL('https://github.com/PanJiaChen/vue-element-admin')).toBe(true)
10 | expect(validURL('http://github.com/PanJiaChen/vue-element-admin')).toBe(true)
11 | expect(validURL('github.com/PanJiaChen/vue-element-admin')).toBe(false)
12 | })
13 | it('validLowerCase', () => {
14 | expect(validLowerCase('abc')).toBe(true)
15 | expect(validLowerCase('Abc')).toBe(false)
16 | expect(validLowerCase('123abc')).toBe(false)
17 | })
18 | it('validUpperCase', () => {
19 | expect(validUpperCase('ABC')).toBe(true)
20 | expect(validUpperCase('Abc')).toBe(false)
21 | expect(validUpperCase('123ABC')).toBe(false)
22 | })
23 | it('validAlphabets', () => {
24 | expect(validAlphabets('ABC')).toBe(true)
25 | expect(validAlphabets('Abc')).toBe(true)
26 | expect(validAlphabets('123aBC')).toBe(false)
27 | })
28 | })
29 |
--------------------------------------------------------------------------------
/src/icons/svg/eye-open.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/utils/open-window.js:
--------------------------------------------------------------------------------
1 | /**
2 | *Created by PanJiaChen on 16/11/29.
3 | * @param {Sting} url
4 | * @param {Sting} title
5 | * @param {Number} w
6 | * @param {Number} h
7 | */
8 | export default function openWindow(url, title, w, h) {
9 | // Fixes dual-screen position Most browsers Firefox
10 | const dualScreenLeft = window.screenLeft !== undefined ? window.screenLeft : screen.left
11 | const dualScreenTop = window.screenTop !== undefined ? window.screenTop : screen.top
12 |
13 | const width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width
14 | const height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height
15 |
16 | const left = ((width / 2) - (w / 2)) + dualScreenLeft
17 | const top = ((height / 2) - (h / 2)) + dualScreenTop
18 | const newWindow = window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left)
19 |
20 | // Puts focus on the newWindow
21 | if (window.focus) {
22 | newWindow.focus()
23 | }
24 | }
25 |
26 |
--------------------------------------------------------------------------------
/src/views/guide/steps.js:
--------------------------------------------------------------------------------
1 | const steps = [
2 | {
3 | element: '#hamburger-container',
4 | popover: {
5 | title: 'Hamburger',
6 | description: 'Open && Close sidebar',
7 | position: 'bottom'
8 | }
9 | },
10 | {
11 | element: '#breadcrumb-container',
12 | popover: {
13 | title: 'Breadcrumb',
14 | description: 'Indicate the current page location',
15 | position: 'bottom'
16 | }
17 | },
18 | {
19 | element: '#header-search',
20 | popover: {
21 | title: 'Page Search',
22 | description: 'Page search, quick navigation',
23 | position: 'left'
24 | }
25 | },
26 | {
27 | element: '#screenfull',
28 | popover: {
29 | title: 'Screenfull',
30 | description: 'Set the page into fullscreen',
31 | position: 'left'
32 | }
33 | },
34 | {
35 | element: '#size-select',
36 | popover: {
37 | title: 'Switch Size',
38 | description: 'Switch the system size',
39 | position: 'left'
40 | }
41 | },
42 | {
43 | element: '#tags-view-container',
44 | popover: {
45 | title: 'Tags view',
46 | description: 'The history of the page you visited',
47 | position: 'bottom'
48 | },
49 | padding: 0
50 | }
51 | ]
52 |
53 | export default steps
54 |
--------------------------------------------------------------------------------
/mock/remote-search.js:
--------------------------------------------------------------------------------
1 | import Mock from 'mockjs'
2 |
3 | const NameList = []
4 | const count = 100
5 |
6 | for (let i = 0; i < count; i++) {
7 | NameList.push(Mock.mock({
8 | name: '@first'
9 | }))
10 | }
11 | NameList.push({ name: 'mock-Pan' })
12 |
13 | export default [
14 | // username search
15 | {
16 | url: '/search/user',
17 | type: 'get',
18 | response: config => {
19 | const { name } = config.query
20 | const mockNameList = NameList.filter(item => {
21 | const lowerCaseName = item.name.toLowerCase()
22 | return !(name && lowerCaseName.indexOf(name.toLowerCase()) < 0)
23 | })
24 | return {
25 | code: 20000,
26 | data: { items: mockNameList }
27 | }
28 | }
29 | },
30 |
31 | // transaction list
32 | {
33 | url: '/transaction/list',
34 | type: 'get',
35 | response: _ => {
36 | return {
37 | code: 20000,
38 | data: {
39 | total: 20,
40 | 'items|20': [{
41 | order_no: '@guid()',
42 | timestamp: +Mock.Random.date('T'),
43 | username: '@name()',
44 | price: '@float(1000, 15000, 0, 2)',
45 | 'status|1': ['success', 'pending']
46 | }]
47 | }
48 | }
49 | }
50 | }
51 | ]
52 |
--------------------------------------------------------------------------------
/src/views/example/components/Dropdown/Platform.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Platfroms({{ platforms.length }})
5 |
6 |
7 |
8 |
9 |
10 | {{ item.name }}
11 |
12 |
13 |
14 |
15 |
16 |
17 |
47 |
--------------------------------------------------------------------------------
/src/components/LangSelect/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | {{ lang.label }}
9 |
10 |
11 |
12 |
13 |
14 |
49 |
--------------------------------------------------------------------------------
/src/components/Screenfull/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
50 |
51 |
61 |
--------------------------------------------------------------------------------
/src/directive/el-table/adaptive.js:
--------------------------------------------------------------------------------
1 | import { addResizeListener, removeResizeListener } from 'element-ui/src/utils/resize-event'
2 |
3 | /**
4 | * How to use
5 | * ...
6 | * el-table height is must be set
7 | * bottomOffset: 30(default) // The height of the table from the bottom of the page.
8 | */
9 |
10 | const doResize = (el, binding, vnode) => {
11 | const { componentInstance: $table } = vnode
12 |
13 | const { value } = binding
14 |
15 | if (!$table.height) {
16 | throw new Error(`el-$table must set the height. Such as height='100px'`)
17 | }
18 | const bottomOffset = (value && value.bottomOffset) || 30
19 |
20 | if (!$table) return
21 |
22 | const height = window.innerHeight - el.getBoundingClientRect().top - bottomOffset
23 | $table.layout.setHeight(height)
24 | $table.doLayout()
25 | }
26 |
27 | export default {
28 | bind(el, binding, vnode) {
29 | el.resizeListener = () => {
30 | doResize(el, binding, vnode)
31 | }
32 | // parameter 1 is must be "Element" type
33 | addResizeListener(window.document.body, el.resizeListener)
34 | },
35 | inserted(el, binding, vnode) {
36 | doResize(el, binding, vnode)
37 | },
38 | unbind(el) {
39 | removeResizeListener(window.document.body, el.resizeListener)
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/components/Hamburger/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
14 |
15 |
16 |
32 |
33 |
45 |
--------------------------------------------------------------------------------
/src/lang/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import VueI18n from 'vue-i18n'
3 | import Cookies from 'js-cookie'
4 | import elementEnLocale from 'element-ui/lib/locale/lang/en' // element-ui lang
5 | import elementZhCNLocale from 'element-ui/lib/locale/lang/zh-CN'// element-ui lang
6 | import elementZhTWLocale from 'element-ui/lib/locale/lang/zh-TW'// element-ui lang
7 | import enLocale from './en'
8 | import zhCNLocale from './zh-CN'
9 | import zhTWLocale from './zh-TW'
10 |
11 | Vue.use(VueI18n)
12 |
13 | const messages = {
14 | 'en': {
15 | ...enLocale,
16 | ...elementEnLocale
17 | },
18 | 'zh-CN': {
19 | ...zhCNLocale,
20 | ...elementZhCNLocale
21 | },
22 | 'zh-TW': {
23 | ...zhTWLocale,
24 | ...elementZhTWLocale
25 | }
26 | }
27 | export function getLanguage() {
28 | const chooseLanguage = Cookies.get('language')
29 | if (chooseLanguage) return chooseLanguage
30 |
31 | // if has not choose language
32 | const language = (navigator.language || navigator.browserLanguage).toLowerCase()
33 | const locales = Object.keys(messages)
34 | for (const locale of locales) {
35 | if (language.indexOf(locale) > -1) {
36 | return locale
37 | }
38 | }
39 | return 'en'
40 | }
41 | const i18n = new VueI18n({
42 | // set locale
43 | // options: en | zh | es
44 | locale: getLanguage(),
45 | // set locale messages
46 | messages
47 | })
48 |
49 | export default i18n
50 |
--------------------------------------------------------------------------------
/plop-templates/view/prompt.js:
--------------------------------------------------------------------------------
1 | const { notEmpty } = require('../utils.js')
2 |
3 | module.exports = {
4 | description: 'generate a view',
5 | prompts: [{
6 | type: 'input',
7 | name: 'name',
8 | message: 'view name please',
9 | validate: notEmpty('name')
10 | },
11 | {
12 | type: 'checkbox',
13 | name: 'blocks',
14 | message: 'Blocks:',
15 | choices: [{
16 | name: '',
17 | value: 'template',
18 | checked: true
19 | },
20 | {
21 | name: '
51 |
--------------------------------------------------------------------------------
/src/icons/svg/setting.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/plop-templates/component/prompt.js:
--------------------------------------------------------------------------------
1 | const { notEmpty } = require('../utils.js')
2 |
3 | module.exports = {
4 | description: 'generate vue component',
5 | prompts: [{
6 | type: 'input',
7 | name: 'name',
8 | message: 'component name please',
9 | validate: notEmpty('name')
10 | },
11 | {
12 | type: 'checkbox',
13 | name: 'blocks',
14 | message: 'Blocks:',
15 | choices: [{
16 | name: '',
17 | value: 'template',
18 | checked: true
19 | },
20 | {
21 | name: '
54 |
--------------------------------------------------------------------------------
/src/icons/svg/bug.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/icons/svg/role.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/router/modules/system.js:
--------------------------------------------------------------------------------
1 | import Layout from '@/layout'
2 |
3 | const nestedRouter = {
4 | path: '/system',
5 | component: Layout,
6 | name: 'System',
7 | meta: {
8 | title: 'system',
9 | icon: 'system',
10 | permissions: ['roleIndex']
11 | },
12 | children: [
13 | {
14 | path: 'roles',
15 | component: () => import('@/views/role/list'),
16 | name: 'roleList',
17 | meta: { title: 'role', icon: 'role', permissions: ['roleIndex'] }
18 | },
19 | {
20 | path: 'role/create',
21 | name: 'roleCreate',
22 | component: () => import('@/views/role/create'),
23 | hidden: true,
24 | noCache: true,
25 | meta: { title: 'roleCreate', permissions: ['roleCreate'] }
26 | },
27 | {
28 | path: 'role/edit/:id',
29 | name: 'roleEdit',
30 | component: () => import('@/views/role/edit'),
31 | hidden: true,
32 | noCache: true,
33 | meta: { title: 'roleEdit', permissions: ['roleUpdate'] }
34 | },
35 | {
36 | path: '/setting',
37 | name: 'settingList',
38 | component: () => import('@/views/setting/list'),
39 | meta: { title: 'systemSettings', icon: 'setting', permissions: ['settingIndex'] }
40 | },
41 | {
42 | path: '/setting/edit/:id',
43 | name: 'settingEdit',
44 | hidden: true,
45 | noCache: true,
46 | component: () => import('@/views/setting/edit'),
47 | meta: { title: 'settingEdit', permissions: ['settingUpdate'] }
48 | }
49 | ]
50 | }
51 |
52 | export default nestedRouter
53 |
--------------------------------------------------------------------------------
/src/components/SvgIcon/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
47 |
48 |
63 |
--------------------------------------------------------------------------------
/src/styles/mixin.scss:
--------------------------------------------------------------------------------
1 | @mixin clearfix {
2 | &:after {
3 | content: "";
4 | display: table;
5 | clear: both;
6 | }
7 | }
8 |
9 | @mixin scrollBar {
10 | &::-webkit-scrollbar-track-piece {
11 | background: #d3dce6;
12 | }
13 |
14 | &::-webkit-scrollbar {
15 | width: 6px;
16 | }
17 |
18 | &::-webkit-scrollbar-thumb {
19 | background: #99a9bf;
20 | border-radius: 20px;
21 | }
22 | }
23 |
24 | @mixin relative {
25 | position: relative;
26 | width: 100%;
27 | height: 100%;
28 | }
29 |
30 | @mixin pct($pct) {
31 | width: #{$pct};
32 | position: relative;
33 | margin: 0 auto;
34 | }
35 |
36 | @mixin triangle($width, $height, $color, $direction) {
37 | $width: $width/2;
38 | $color-border-style: $height solid $color;
39 | $transparent-border-style: $width solid transparent;
40 | height: 0;
41 | width: 0;
42 |
43 | @if $direction==up {
44 | border-bottom: $color-border-style;
45 | border-left: $transparent-border-style;
46 | border-right: $transparent-border-style;
47 | }
48 |
49 | @else if $direction==right {
50 | border-left: $color-border-style;
51 | border-top: $transparent-border-style;
52 | border-bottom: $transparent-border-style;
53 | }
54 |
55 | @else if $direction==down {
56 | border-top: $color-border-style;
57 | border-left: $transparent-border-style;
58 | border-right: $transparent-border-style;
59 | }
60 |
61 | @else if $direction==left {
62 | border-right: $color-border-style;
63 | border-top: $transparent-border-style;
64 | border-bottom: $transparent-border-style;
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/src/views/clipboard/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | copy
8 |
9 |
10 |
11 |
12 |
13 | copy
14 |
15 |
16 |
17 |
18 |
19 |
20 |
49 |
50 |
--------------------------------------------------------------------------------
/src/components/DragSelect/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
50 |
51 |
62 |
--------------------------------------------------------------------------------
/src/views/system-setting/components/Mailer.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | {{ $t('common.update') }}
20 |
21 |
22 |
23 |
24 |
57 |
--------------------------------------------------------------------------------
/src/views/system-setting/components/Upload.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | {{ $t('common.update') }}
20 |
21 |
22 |
23 |
24 |
57 |
--------------------------------------------------------------------------------
/src/layout/components/Sidebar/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
55 |
--------------------------------------------------------------------------------
/src/views/profile/components/Session.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | {{ session.ip_address }} login at {{ formatTimestamp(session.create_time) }}
7 |
8 |
9 | {{ $t('common.delete') }}
10 |
11 |
12 |
13 | {{ session.user_agent }}
14 |
15 |
16 |
17 |
18 |
19 |
54 |
55 |
60 |
--------------------------------------------------------------------------------
/src/views/components-demo/json-editor.vue:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
14 |
29 |
30 |
36 |
37 |
--------------------------------------------------------------------------------
/src/components/SizeSelect/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | {{
9 | item.label }}
10 |
11 |
12 |
13 |
14 |
15 |
58 |
--------------------------------------------------------------------------------
/src/icons/svg/pdf.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/views/tab/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 | mounted times :{{ createdTimes }}
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
52 |
53 |
58 |
--------------------------------------------------------------------------------
/src/views/components-demo/drag-kanban.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
39 |
66 |
67 |
--------------------------------------------------------------------------------
/src/views/components-demo/tinymce.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
30 |
31 |
36 |
37 |
--------------------------------------------------------------------------------
/src/store/modules/permission.js:
--------------------------------------------------------------------------------
1 | import { asyncRoutes, constantRoutes } from '@/router'
2 |
3 | /**
4 | * Use meta.role to determine if the current user has permission
5 | * @param permissions
6 | * @param route
7 | */
8 | function hasPermission(permissions, route) {
9 | if (route.meta && route.meta.permissions) {
10 | return permissions.some(permission => route.meta.permissions.includes(permission))
11 | } else {
12 | return true
13 | }
14 | }
15 |
16 | /**
17 | * Filter asynchronous routing tables by recursion
18 | * @param routes asyncRoutes
19 | * @param permissions
20 | */
21 | export function filterAsyncRoutes(routes, permissions) {
22 | const res = []
23 |
24 | routes.forEach(route => {
25 | const tmp = { ...route }
26 | if (hasPermission(permissions, tmp)) {
27 | if (tmp.children) {
28 | tmp.children = filterAsyncRoutes(tmp.children, permissions)
29 | }
30 | res.push(tmp)
31 | }
32 | })
33 |
34 | return res
35 | }
36 |
37 | const state = {
38 | routes: [],
39 | addRoutes: []
40 | }
41 |
42 | const mutations = {
43 | SET_ROUTES: (state, routes) => {
44 | state.addRoutes = routes
45 | state.routes = constantRoutes.concat(routes)
46 | }
47 | }
48 |
49 | const actions = {
50 | generateRoutes({ commit }, roles) {
51 | return new Promise(resolve => {
52 | let accessedRoutes
53 | if (roles.includes('admin')) {
54 | accessedRoutes = asyncRoutes || []
55 | } else {
56 | accessedRoutes = filterAsyncRoutes(asyncRoutes, roles)
57 | }
58 | commit('SET_ROUTES', accessedRoutes)
59 | resolve(accessedRoutes)
60 | })
61 | }
62 | }
63 |
64 | export default {
65 | namespaced: true,
66 | state,
67 | mutations,
68 | actions
69 | }
70 |
--------------------------------------------------------------------------------
/src/directive/clipboard/clipboard.js:
--------------------------------------------------------------------------------
1 | // Inspired by https://github.com/Inndy/vue-clipboard2
2 | const Clipboard = require('clipboard')
3 | if (!Clipboard) {
4 | throw new Error('you should npm install `clipboard` --save at first ')
5 | }
6 |
7 | export default {
8 | bind(el, binding) {
9 | if (binding.arg === 'success') {
10 | el._v_clipboard_success = binding.value
11 | } else if (binding.arg === 'error') {
12 | el._v_clipboard_error = binding.value
13 | } else {
14 | const clipboard = new Clipboard(el, {
15 | text() { return binding.value },
16 | action() { return binding.arg === 'cut' ? 'cut' : 'copy' }
17 | })
18 | clipboard.on('success', e => {
19 | const callback = el._v_clipboard_success
20 | callback && callback(e) // eslint-disable-line
21 | })
22 | clipboard.on('error', e => {
23 | const callback = el._v_clipboard_error
24 | callback && callback(e) // eslint-disable-line
25 | })
26 | el._v_clipboard = clipboard
27 | }
28 | },
29 | update(el, binding) {
30 | if (binding.arg === 'success') {
31 | el._v_clipboard_success = binding.value
32 | } else if (binding.arg === 'error') {
33 | el._v_clipboard_error = binding.value
34 | } else {
35 | el._v_clipboard.text = function() { return binding.value }
36 | el._v_clipboard.action = function() { return binding.arg === 'cut' ? 'cut' : 'copy' }
37 | }
38 | },
39 | unbind(el, binding) {
40 | if (binding.arg === 'success') {
41 | delete el._v_clipboard_success
42 | } else if (binding.arg === 'error') {
43 | delete el._v_clipboard_error
44 | } else {
45 | el._v_clipboard.destroy()
46 | delete el._v_clipboard
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/icons/svg/exit-fullscreen.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/icons/svg/tree.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/store/modules/app.js:
--------------------------------------------------------------------------------
1 | import Cookies from 'js-cookie'
2 | import { getLanguage } from '@/lang/index'
3 |
4 | const state = {
5 | sidebar: {
6 | opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true,
7 | withoutAnimation: false
8 | },
9 | device: 'desktop',
10 | language: getLanguage(),
11 | size: Cookies.get('size') || 'medium'
12 | }
13 |
14 | const mutations = {
15 | TOGGLE_SIDEBAR: state => {
16 | state.sidebar.opened = !state.sidebar.opened
17 | state.sidebar.withoutAnimation = false
18 | if (state.sidebar.opened) {
19 | Cookies.set('sidebarStatus', 1)
20 | } else {
21 | Cookies.set('sidebarStatus', 0)
22 | }
23 | },
24 | CLOSE_SIDEBAR: (state, withoutAnimation) => {
25 | Cookies.set('sidebarStatus', 0)
26 | state.sidebar.opened = false
27 | state.sidebar.withoutAnimation = withoutAnimation
28 | },
29 | TOGGLE_DEVICE: (state, device) => {
30 | state.device = device
31 | },
32 | SET_LANGUAGE: (state, language) => {
33 | state.language = language
34 | Cookies.set('language', language)
35 | },
36 | SET_SIZE: (state, size) => {
37 | state.size = size
38 | Cookies.set('size', size)
39 | }
40 | }
41 |
42 | const actions = {
43 | toggleSideBar({ commit }) {
44 | commit('TOGGLE_SIDEBAR')
45 | },
46 | closeSideBar({ commit }, { withoutAnimation }) {
47 | commit('CLOSE_SIDEBAR', withoutAnimation)
48 | },
49 | toggleDevice({ commit }, device) {
50 | commit('TOGGLE_DEVICE', device)
51 | },
52 | setLanguage({ commit }, language) {
53 | commit('SET_LANGUAGE', language)
54 | },
55 | setSize({ commit }, size) {
56 | commit('SET_SIZE', size)
57 | }
58 | }
59 |
60 | export default {
61 | namespaced: true,
62 | state,
63 | mutations,
64 | actions
65 | }
66 |
--------------------------------------------------------------------------------
/src/views/components-demo/split-pane.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
39 |
40 |
68 |
--------------------------------------------------------------------------------
/dist/staging/css/chunk-bde554f6.d70a19af.css:
--------------------------------------------------------------------------------
1 | @supports (-webkit-mask:none) and (not (cater-color:#fff)){.login-container .el-input input{color:#fff}}.login-container .el-input{display:inline-block;height:47px;width:85%}.login-container .el-input input{background:transparent;border:0;-webkit-appearance:none;border-radius:0;padding:12px 5px 12px 15px;color:#fff;height:47px;caret-color:#fff}.login-container .el-input input:-webkit-autofill{-webkit-box-shadow:0 0 0 1000px #283443 inset!important;box-shadow:inset 0 0 0 1000px #283443!important;-webkit-text-fill-color:#fff!important}.login-container .el-form-item{border:1px solid hsla(0,0%,100%,.1);background:rgba(0,0,0,.1);border-radius:5px;color:#454545}.login-container[data-v-3609eb05]{min-height:100%;width:100%;background-color:#2d3a4b;overflow:hidden}.login-container .login-form[data-v-3609eb05]{position:relative;width:520px;max-width:100%;padding:160px 35px 0;margin:0 auto;overflow:hidden}.login-container .tips[data-v-3609eb05]{font-size:14px;color:#fff;margin-bottom:10px}.login-container .tips span[data-v-3609eb05]:first-of-type{margin-right:16px}.login-container .svg-container[data-v-3609eb05]{padding:6px 5px 6px 15px;color:#889aa4;vertical-align:middle;width:30px;display:inline-block}.login-container .title-container[data-v-3609eb05]{position:relative}.login-container .title-container .title[data-v-3609eb05]{font-size:26px;color:#eee;margin:0 auto 40px auto;text-align:center;font-weight:700}.login-container .show-pwd[data-v-3609eb05]{position:absolute;right:10px;top:7px;font-size:16px;color:#889aa4;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.login-container .thirdparty-button[data-v-3609eb05]{position:absolute;right:0;bottom:6px}@media only screen and (max-width:470px){.login-container .thirdparty-button[data-v-3609eb05]{display:none}}
--------------------------------------------------------------------------------
/dist/staging/js/chunk-556562e8.3e641055.js:
--------------------------------------------------------------------------------
1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-556562e8"],{"1db4":function(t,s,e){"use strict";e.r(s);var a=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"wscn-http404-container"},[e("div",{staticClass:"wscn-http404"},[t._m(0),t._v(" "),e("div",{staticClass:"bullshit"},[e("div",{staticClass:"bullshit__oops"},[t._v("OOPS!")]),t._v(" "),t._m(1),t._v(" "),e("div",{staticClass:"bullshit__headline"},[t._v(t._s(t.message))]),t._v(" "),e("div",{staticClass:"bullshit__info"},[t._v("Please check that the URL you entered is correct, or click the button below to return to the homepage.")]),t._v(" "),e("a",{staticClass:"bullshit__return-home",attrs:{href:""}},[t._v("Back to home")])])])])},c=[function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"pic-404"},[a("img",{staticClass:"pic-404__parent",attrs:{src:e("a36b"),alt:"404"}}),t._v(" "),a("img",{staticClass:"pic-404__child left",attrs:{src:e("26fc"),alt:"404"}}),t._v(" "),a("img",{staticClass:"pic-404__child mid",attrs:{src:e("26fc"),alt:"404"}}),t._v(" "),a("img",{staticClass:"pic-404__child right",attrs:{src:e("26fc"),alt:"404"}})])},function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"bullshit__info"},[t._v("All rights reserved\n "),e("a",{staticStyle:{color:"#20a0ff"},attrs:{href:"https://wallstreetcn.com",target:"_blank"}},[t._v("wallstreetcn")])])}],i={name:"Page404",computed:{message:function(){return"The webmaster said that you can not enter this page..."}}},l=i,n=(e("35e7"),e("2877")),r=Object(n["a"])(l,a,c,!1,null,"26fcd89f",null);s["default"]=r.exports},"26fc":function(t,s,e){t.exports=e.p+"img/404_cloud.0f4bc32b.png"},"35e7":function(t,s,e){"use strict";var a=e("c107"),c=e.n(a);c.a},a36b:function(t,s,e){t.exports=e.p+"img/404.a57b6f31.png"},c107:function(t,s,e){}}]);
--------------------------------------------------------------------------------
/mock/user.js:
--------------------------------------------------------------------------------
1 |
2 | const tokens = {
3 | admin: {
4 | token: 'admin-token'
5 | },
6 | editor: {
7 | token: 'editor-token'
8 | }
9 | }
10 |
11 | const users = {
12 | 'admin-token': {
13 | roles: ['admin'],
14 | introduction: 'I am a super administrator',
15 | avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif',
16 | name: 'Super Admin'
17 | },
18 | 'editor-token': {
19 | roles: ['editor'],
20 | introduction: 'I am an editor',
21 | avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif',
22 | name: 'Normal Editor'
23 | }
24 | }
25 |
26 | export default [
27 | // user login
28 | {
29 | url: '/user/login',
30 | type: 'post',
31 | response: config => {
32 | const { username } = config.body
33 | const token = tokens[username]
34 |
35 | // mock error
36 | if (!token) {
37 | return {
38 | code: 60204,
39 | message: 'Account and password are incorrect.'
40 | }
41 | }
42 |
43 | return {
44 | code: 20000,
45 | data: token
46 | }
47 | }
48 | },
49 |
50 | // get user info
51 | {
52 | url: '/user/info\.*',
53 | type: 'get',
54 | response: config => {
55 | const { token } = config.query
56 | const info = users[token]
57 |
58 | // mock error
59 | if (!info) {
60 | return {
61 | code: 50008,
62 | message: 'Login failed, unable to get user details.'
63 | }
64 | }
65 |
66 | return {
67 | code: 20000,
68 | data: info
69 | }
70 | }
71 | },
72 |
73 | // user logout
74 | {
75 | url: '/user/logout',
76 | type: 'post',
77 | response: _ => {
78 | return {
79 | code: 20000,
80 | data: 'success'
81 | }
82 | }
83 | }
84 | ]
85 |
--------------------------------------------------------------------------------
/src/views/components-demo/avatar-upload.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
10 |
11 | Change Avatar
12 |
13 |
14 |
24 |
25 |
26 |
27 |
53 |
54 |
61 |
62 |
--------------------------------------------------------------------------------
/src/components/Tinymce/dynamicLoadScript.js:
--------------------------------------------------------------------------------
1 | let callbacks = []
2 |
3 | function loadedTinymce() {
4 | // to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2144
5 | // check is successfully downloaded script
6 | return window.tinymce
7 | }
8 |
9 | const dynamicLoadScript = (src, callback) => {
10 | const existingScript = document.getElementById(src)
11 | const cb = callback || function() {}
12 |
13 | if (!existingScript) {
14 | const script = document.createElement('script')
15 | script.src = src // src url for the third-party library being loaded.
16 | script.id = src
17 | document.body.appendChild(script)
18 | callbacks.push(cb)
19 | const onEnd = 'onload' in script ? stdOnEnd : ieOnEnd
20 | onEnd(script)
21 | }
22 |
23 | if (existingScript && cb) {
24 | if (loadedTinymce()) {
25 | cb(null, existingScript)
26 | } else {
27 | callbacks.push(cb)
28 | }
29 | }
30 |
31 | function stdOnEnd(script) {
32 | script.onload = function() {
33 | // this.onload = null here is necessary
34 | // because even IE9 works not like others
35 | this.onerror = this.onload = null
36 | for (const cb of callbacks) {
37 | cb(null, script)
38 | }
39 | callbacks = null
40 | }
41 | script.onerror = function() {
42 | this.onerror = this.onload = null
43 | cb(new Error('Failed to load ' + src), script)
44 | }
45 | }
46 |
47 | function ieOnEnd(script) {
48 | script.onreadystatechange = function() {
49 | if (this.readyState !== 'complete' && this.readyState !== 'loaded') return
50 | this.onreadystatechange = null
51 | for (const cb of callbacks) {
52 | cb(null, script) // there is no way to catch loading errors in IE8
53 | }
54 | callbacks = null
55 | }
56 | }
57 | }
58 |
59 | export default dynamicLoadScript
60 |
--------------------------------------------------------------------------------
/src/filters/index.js:
--------------------------------------------------------------------------------
1 | // import parseTime, formatTime and set to filter
2 | export { parseTime, formatTime } from '@/utils'
3 |
4 | /**
5 | * Show plural label if time is plural number
6 | * @param {number} time
7 | * @param {string} label
8 | * @return {string}
9 | */
10 | function pluralize(time, label) {
11 | if (time === 1) {
12 | return time + label
13 | }
14 | return time + label + 's'
15 | }
16 |
17 | /**
18 | * @param {number} time
19 | */
20 | export function timeAgo(time) {
21 | const between = Date.now() / 1000 - Number(time)
22 | if (between < 3600) {
23 | return pluralize(~~(between / 60), ' minute')
24 | } else if (between < 86400) {
25 | return pluralize(~~(between / 3600), ' hour')
26 | } else {
27 | return pluralize(~~(between / 86400), ' day')
28 | }
29 | }
30 |
31 | /**
32 | * Number formatting
33 | * like 10000 => 10k
34 | * @param {number} num
35 | * @param {number} digits
36 | */
37 | export function numberFormatter(num, digits) {
38 | const si = [
39 | { value: 1E18, symbol: 'E' },
40 | { value: 1E15, symbol: 'P' },
41 | { value: 1E12, symbol: 'T' },
42 | { value: 1E9, symbol: 'G' },
43 | { value: 1E6, symbol: 'M' },
44 | { value: 1E3, symbol: 'k' }
45 | ]
46 | for (let i = 0; i < si.length; i++) {
47 | if (num >= si[i].value) {
48 | return (num / si[i].value + 0.1).toFixed(digits).replace(/\.0+$|(\.[0-9]*[1-9])0+$/, '$1') + si[i].symbol
49 | }
50 | }
51 | return num.toString()
52 | }
53 |
54 | /**
55 | * 10000 => "10,000"
56 | * @param {number} num
57 | */
58 | export function toThousandFilter(num) {
59 | return (+num || 0).toString().replace(/^-?\d+/g, m => m.replace(/(?=(?!\b)(\d{3})+$)/g, ','))
60 | }
61 |
62 | /**
63 | * Upper case first char
64 | * @param {String} string
65 | */
66 | export function uppercaseFirst(string) {
67 | return string.charAt(0).toUpperCase() + string.slice(1)
68 | }
69 |
--------------------------------------------------------------------------------
/src/styles/btn.scss:
--------------------------------------------------------------------------------
1 | @import './variables.scss';
2 |
3 | @mixin colorBtn($color) {
4 | background: $color;
5 |
6 | &:hover {
7 | color: $color;
8 |
9 | &:before,
10 | &:after {
11 | background: $color;
12 | }
13 | }
14 | }
15 |
16 | .blue-btn {
17 | @include colorBtn($blue)
18 | }
19 |
20 | .light-blue-btn {
21 | @include colorBtn($light-blue)
22 | }
23 |
24 | .red-btn {
25 | @include colorBtn($red)
26 | }
27 |
28 | .pink-btn {
29 | @include colorBtn($pink)
30 | }
31 |
32 | .green-btn {
33 | @include colorBtn($green)
34 | }
35 |
36 | .tiffany-btn {
37 | @include colorBtn($tiffany)
38 | }
39 |
40 | .yellow-btn {
41 | @include colorBtn($yellow)
42 | }
43 |
44 | .pan-btn {
45 | font-size: 14px;
46 | color: #fff;
47 | padding: 14px 36px;
48 | border-radius: 8px;
49 | border: none;
50 | outline: none;
51 | transition: 600ms ease all;
52 | position: relative;
53 | display: inline-block;
54 |
55 | &:hover {
56 | background: #fff;
57 |
58 | &:before,
59 | &:after {
60 | width: 100%;
61 | transition: 600ms ease all;
62 | }
63 | }
64 |
65 | &:before,
66 | &:after {
67 | content: '';
68 | position: absolute;
69 | top: 0;
70 | right: 0;
71 | height: 2px;
72 | width: 0;
73 | transition: 400ms ease all;
74 | }
75 |
76 | &::after {
77 | right: inherit;
78 | top: inherit;
79 | left: 0;
80 | bottom: 0;
81 | }
82 | }
83 |
84 | .custom-button {
85 | display: inline-block;
86 | line-height: 1;
87 | white-space: nowrap;
88 | cursor: pointer;
89 | background: #fff;
90 | color: #fff;
91 | -webkit-appearance: none;
92 | text-align: center;
93 | box-sizing: border-box;
94 | outline: 0;
95 | margin: 0;
96 | padding: 10px 15px;
97 | font-size: 14px;
98 | border-radius: 4px;
99 | }
100 |
--------------------------------------------------------------------------------
/src/components/JsonEditor/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
56 |
57 |
73 |
--------------------------------------------------------------------------------
/src/views/table/dynamic-table/components/FixedThead.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | apple
7 |
8 |
9 | banana
10 |
11 |
12 | orange
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | {{ scope.row[fruit] }}
22 |
23 |
24 |
25 |
26 |
27 |
28 |
62 |
63 |
--------------------------------------------------------------------------------
/src/utils/scroll-to.js:
--------------------------------------------------------------------------------
1 | Math.easeInOutQuad = function(t, b, c, d) {
2 | t /= d / 2
3 | if (t < 1) {
4 | return c / 2 * t * t + b
5 | }
6 | t--
7 | return -c / 2 * (t * (t - 2) - 1) + b
8 | }
9 |
10 | // requestAnimationFrame for Smart Animating http://goo.gl/sx5sts
11 | var requestAnimFrame = (function() {
12 | return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(callback) { window.setTimeout(callback, 1000 / 60) }
13 | })()
14 |
15 | /**
16 | * Because it's so fucking difficult to detect the scrolling element, just move them all
17 | * @param {number} amount
18 | */
19 | function move(amount) {
20 | document.documentElement.scrollTop = amount
21 | document.body.parentNode.scrollTop = amount
22 | document.body.scrollTop = amount
23 | }
24 |
25 | function position() {
26 | return document.documentElement.scrollTop || document.body.parentNode.scrollTop || document.body.scrollTop
27 | }
28 |
29 | /**
30 | * @param {number} to
31 | * @param {number} duration
32 | * @param {Function} callback
33 | */
34 | export function scrollTo(to, duration, callback) {
35 | const start = position()
36 | const change = to - start
37 | const increment = 20
38 | let currentTime = 0
39 | duration = (typeof (duration) === 'undefined') ? 500 : duration
40 | var animateScroll = function() {
41 | // increment the time
42 | currentTime += increment
43 | // find the value with the quadratic in-out easing function
44 | var val = Math.easeInOutQuad(currentTime, start, change, duration)
45 | // move the document.body
46 | move(val)
47 | // do the animation unless its over
48 | if (currentTime < duration) {
49 | requestAnimFrame(animateScroll)
50 | } else {
51 | if (callback && typeof (callback) === 'function') {
52 | // the animation is done so lets callback
53 | callback()
54 | }
55 | }
56 | }
57 | animateScroll()
58 | }
59 |
--------------------------------------------------------------------------------
/dist/staging/js/chunk-45e73af7.6d1d4f45.js:
--------------------------------------------------------------------------------
1 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-45e73af7"],{"064d":function(t,a,i){},"24e2":function(t,a,i){"use strict";i.r(a);var e=function(){var t=this,a=t.$createElement,i=t._self._c||a;return i("div",{staticClass:"errPage-container"},[i("el-button",{staticClass:"pan-back-btn",attrs:{icon:"arrow-left"},on:{click:t.back}},[t._v("\n 返回\n ")]),t._v(" "),i("el-row",[i("el-col",{attrs:{span:12}},[i("h1",{staticClass:"text-jumbo text-ginormous"},[t._v("\n Oops!\n ")]),t._v("\n gif来源"),i("a",{attrs:{href:"https://zh.airbnb.com/",target:"_blank"}},[t._v("airbnb")]),t._v(" 页面\n "),i("h2",[t._v("你没有权限去该页面")]),t._v(" "),i("h6",[t._v("如有不满请联系你领导")]),t._v(" "),i("ul",{staticClass:"list-unstyled"},[i("li",[t._v("或者你可以去:")]),t._v(" "),i("li",{staticClass:"link-type"},[i("router-link",{attrs:{to:"/dashboard"}},[t._v("\n 回首页\n ")])],1),t._v(" "),i("li",{staticClass:"link-type"},[i("a",{attrs:{href:"https://www.taobao.com/"}},[t._v("随便看看")])]),t._v(" "),i("li",[i("a",{attrs:{href:"#"},on:{click:function(a){a.preventDefault(),t.dialogVisible=!0}}},[t._v("点我看图")])])])]),t._v(" "),i("el-col",{attrs:{span:12}},[i("img",{attrs:{src:t.errGif,width:"313",height:"428",alt:"Girl has dropped her ice cream."}})])],1),t._v(" "),i("el-dialog",{attrs:{visible:t.dialogVisible,title:"随便看"},on:{"update:visible":function(a){t.dialogVisible=a}}},[i("img",{staticClass:"pan-img",attrs:{src:t.ewizardClap}})])],1)},s=[],n=i("cc6c"),r=i.n(n),l={name:"Page401",data:function(){return{errGif:r.a+"?"+ +new Date,ewizardClap:"https://wpimg.wallstcn.com/007ef517-bafd-4066-aae4-6883632d9646",dialogVisible:!1}},methods:{back:function(){this.$route.query.noGoBack?this.$router.push({path:"/dashboard"}):this.$router.go(-1)}}},o=l,c=(i("4f2e"),i("2877")),u=Object(c["a"])(o,e,s,!1,null,"6fb1594e",null);a["default"]=u.exports},"4f2e":function(t,a,i){"use strict";var e=i("064d"),s=i.n(e);s.a},cc6c:function(t,a,i){t.exports=i.p+"img/401.089007e7.gif"}}]);
--------------------------------------------------------------------------------