Compare commits
27 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
aa9d48905f | ||
|
9cba45e971 | ||
|
dbee6ff707 | ||
|
b627d3d0ba | ||
|
8f45dbe328 | ||
|
342b7b428a | ||
|
c833cb6efa | ||
|
afb62edc58 | ||
|
0358667a73 | ||
|
e3b6602bbf | ||
|
79e2a604af | ||
|
083a4ada9d | ||
|
90b7c2fbde | ||
|
f11839c8a4 | ||
|
7492e2097f | ||
|
770753eff2 | ||
|
0d40222b64 | ||
|
e363c7a77b | ||
|
c923726464 | ||
|
43115e5538 | ||
|
184125bdd3 | ||
|
25414f1fd9 | ||
|
cba0b789d0 | ||
|
4ad51be2db | ||
|
a1708e9b68 | ||
|
55fa5acb85 | ||
|
a8c6e11ee6 |
33
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Executable file
33
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Executable file
@@ -0,0 +1,33 @@
|
|||||||
|
---
|
||||||
|
name: Bug report(报告问题)
|
||||||
|
about: Create a report to help us improve
|
||||||
|
---
|
||||||
|
<!--
|
||||||
|
注意:为更好的解决你的问题,请参考模板提供完整信息,准确描述问题,信息不全的 issue 将被关闭。
|
||||||
|
|
||||||
|
Note: In order to better solve your problem, please refer to the template to provide complete information, accurately describe the problem, and the incomplete information issue will be closed.
|
||||||
|
-->
|
||||||
|
|
||||||
|
|
||||||
|
## Bug report(问题描述)
|
||||||
|
|
||||||
|
#### Steps to reproduce(问题复现步骤)
|
||||||
|
<!--
|
||||||
|
1. [xxx]
|
||||||
|
2. [xxx]
|
||||||
|
3. [xxxx]
|
||||||
|
-->
|
||||||
|
|
||||||
|
#### Screenshot or Gif(截图或动态图)
|
||||||
|
|
||||||
|
|
||||||
|
#### Link to minimal reproduction(最小可在线还原demo)
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Please only use Codepen, JSFiddle, CodeSandbox or a github repo
|
||||||
|
-->
|
||||||
|
|
||||||
|
#### Other relevant information(格外信息)
|
||||||
|
- Your OS:
|
||||||
|
- Node.js version:
|
||||||
|
- vue-element-admin version:
|
7
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Executable file
7
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
name: Feature Request(新功能建议)
|
||||||
|
about: Suggest an idea for this project
|
||||||
|
---
|
||||||
|
|
||||||
|
## Feature request(新功能建议)
|
||||||
|
|
14
.github/ISSUE_TEMPLATE/question.md
vendored
Executable file
14
.github/ISSUE_TEMPLATE/question.md
vendored
Executable file
@@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
name: Question(提问)
|
||||||
|
about: Asking questions about use
|
||||||
|
---
|
||||||
|
|
||||||
|
## Question(提问)
|
||||||
|
|
||||||
|
<!--
|
||||||
|
提问之前,请确定你已经过自己的努力,尝试解决过这个问题。
|
||||||
|
若是代码相关问题,请不要只截图,请提供在线 demo,以便节约彼此的时间。
|
||||||
|
|
||||||
|
Before asking a question, please make sure that you have tried your best to solve this problem.
|
||||||
|
If it's a code-related issue, please don't just take screenshots. Please provide an online demo to save each other's time.
|
||||||
|
-->
|
@@ -26,7 +26,7 @@ if (process.env.npm_config_preview || rawArgv.includes('--preview')) {
|
|||||||
app.listen(port, function () {
|
app.listen(port, function () {
|
||||||
console.log(chalk.green(`> Preview at http://localhost:${port}${publicPath}`))
|
console.log(chalk.green(`> Preview at http://localhost:${port}${publicPath}`))
|
||||||
if (report) {
|
if (report) {
|
||||||
console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}/report.html`))
|
console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`))
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
@@ -1,11 +1,23 @@
|
|||||||
import Mock from 'mockjs'
|
import Mock from 'mockjs'
|
||||||
import mocks from './mocks'
|
|
||||||
import { param2Obj } from '../src/utils'
|
import { param2Obj } from '../src/utils'
|
||||||
|
|
||||||
const MOCK_API_BASE = '/mock'
|
import user from './user'
|
||||||
|
import role from './role'
|
||||||
|
import article from './article'
|
||||||
|
import search from './remoteSearch'
|
||||||
|
|
||||||
|
const mocks = [
|
||||||
|
...user,
|
||||||
|
...role,
|
||||||
|
...article,
|
||||||
|
...search
|
||||||
|
]
|
||||||
|
|
||||||
|
// for front mock
|
||||||
|
// please use it cautiously, it will redefine XMLHttpRequest,
|
||||||
|
// which will cause many of your third-party libraries to be invalidated(like progress event).
|
||||||
export function mockXHR() {
|
export function mockXHR() {
|
||||||
// 修复在使用 MockJS 情况下,设置 withCredentials = true,且未被拦截的跨域请求丢失 Cookies 的问题
|
// mock patch
|
||||||
// https://github.com/nuysoft/Mock/issues/300
|
// https://github.com/nuysoft/Mock/issues/300
|
||||||
Mock.XHR.prototype.proxy_send = Mock.XHR.prototype.send
|
Mock.XHR.prototype.proxy_send = Mock.XHR.prototype.send
|
||||||
Mock.XHR.prototype.send = function() {
|
Mock.XHR.prototype.send = function() {
|
||||||
@@ -42,9 +54,10 @@ export function mockXHR() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// for mock server
|
||||||
const responseFake = (url, type, respond) => {
|
const responseFake = (url, type, respond) => {
|
||||||
return {
|
return {
|
||||||
url: new RegExp(`${MOCK_API_BASE}${url}`),
|
url: new RegExp(`/mock${url}`),
|
||||||
type: type || 'get',
|
type: type || 'get',
|
||||||
response(req, res) {
|
response(req, res) {
|
||||||
res.json(Mock.mock(respond instanceof Function ? respond(req, res) : respond))
|
res.json(Mock.mock(respond instanceof Function ? respond(req, res) : respond))
|
||||||
|
62
mock/mock-server.js
Normal file
62
mock/mock-server.js
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
const chokidar = require('chokidar')
|
||||||
|
const bodyParser = require('body-parser')
|
||||||
|
const chalk = require('chalk')
|
||||||
|
|
||||||
|
function registerRoutes(app) {
|
||||||
|
let mockStartIndex
|
||||||
|
const { default: mocks } = require('./index.js')
|
||||||
|
for (const mock of mocks) {
|
||||||
|
app[mock.type](mock.url, mock.response)
|
||||||
|
mockStartIndex = app._router.stack.length
|
||||||
|
}
|
||||||
|
const mockRoutesLength = Object.keys(mocks).length
|
||||||
|
return {
|
||||||
|
mockRoutesLength: mockRoutesLength,
|
||||||
|
mockStartIndex: mockStartIndex - mockRoutesLength
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function unregisterRoutes() {
|
||||||
|
Object.keys(require.cache).forEach(i => {
|
||||||
|
if (i.includes('/mock')) {
|
||||||
|
delete require.cache[require.resolve(i)]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = app => {
|
||||||
|
// es6 polyfill
|
||||||
|
require('@babel/register')
|
||||||
|
|
||||||
|
// parse app.body
|
||||||
|
// http://expressjs.com/en/4x/api.html#req.body
|
||||||
|
app.use(bodyParser.json())
|
||||||
|
app.use(bodyParser.urlencoded({
|
||||||
|
extended: true
|
||||||
|
}))
|
||||||
|
|
||||||
|
const mockRoutes = registerRoutes(app)
|
||||||
|
var mockRoutesLength = mockRoutes.mockRoutesLength
|
||||||
|
var mockStartIndex = mockRoutes.mockStartIndex
|
||||||
|
|
||||||
|
// watch files, hot reload mock server
|
||||||
|
chokidar.watch(('./mock'), {
|
||||||
|
ignored: 'mock/mock-server.js',
|
||||||
|
persistent: true,
|
||||||
|
ignoreInitial: true
|
||||||
|
}).on('all', (event, path) => {
|
||||||
|
if (event === 'change' || event === 'add') {
|
||||||
|
// remove mock routes stack
|
||||||
|
app._router.stack.splice(mockStartIndex, mockRoutesLength)
|
||||||
|
|
||||||
|
// clear routes cache
|
||||||
|
unregisterRoutes()
|
||||||
|
|
||||||
|
const mockRoutes = registerRoutes(app)
|
||||||
|
mockRoutesLength = mockRoutes.mockRoutesLength
|
||||||
|
mockStartIndex = mockRoutes.mockStartIndex
|
||||||
|
|
||||||
|
console.log(chalk.magentaBright(`\n > Mock Server hot reload success! changed ${path}`))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
@@ -1,12 +0,0 @@
|
|||||||
import user from './user'
|
|
||||||
import role from './role'
|
|
||||||
import article from './article'
|
|
||||||
import search from './remoteSearch'
|
|
||||||
|
|
||||||
export default [
|
|
||||||
...user,
|
|
||||||
...role,
|
|
||||||
...article,
|
|
||||||
...search
|
|
||||||
]
|
|
||||||
|
|
@@ -19,7 +19,7 @@ export const constantRoutes = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/auth-redirect',
|
path: '/auth-redirect',
|
||||||
component: 'views/login/authredirect',
|
component: 'views/login/authRedirect',
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vue-element-admin",
|
"name": "vue-element-admin",
|
||||||
"version": "4.0.0",
|
"version": "4.0.1",
|
||||||
"description": "A magical vue admin. An out-of-box UI solution for enterprise applications. Newest development stack of vue. Lots of awesome features",
|
"description": "A magical vue admin. An out-of-box UI solution for enterprise applications. Newest development stack of vue. Lots of awesome features",
|
||||||
"author": "Pan <panfree23@gmail.com>",
|
"author": "Pan <panfree23@gmail.com>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -75,6 +75,7 @@
|
|||||||
"@babel/core": "7.0.0",
|
"@babel/core": "7.0.0",
|
||||||
"@babel/register": "7.0.0",
|
"@babel/register": "7.0.0",
|
||||||
"@vue/cli-plugin-babel": "3.5.3",
|
"@vue/cli-plugin-babel": "3.5.3",
|
||||||
|
"@vue/cli-plugin-eslint": "3.5.1",
|
||||||
"@vue/cli-plugin-unit-jest": "3.5.3",
|
"@vue/cli-plugin-unit-jest": "3.5.3",
|
||||||
"@vue/cli-service": "3.5.3",
|
"@vue/cli-service": "3.5.3",
|
||||||
"@vue/test-utils": "1.0.0-beta.29",
|
"@vue/test-utils": "1.0.0-beta.29",
|
||||||
@@ -82,6 +83,7 @@
|
|||||||
"babel-eslint": "10.0.1",
|
"babel-eslint": "10.0.1",
|
||||||
"babel-jest": "23.6.0",
|
"babel-jest": "23.6.0",
|
||||||
"chalk": "2.4.2",
|
"chalk": "2.4.2",
|
||||||
|
"chokidar": "2.1.5",
|
||||||
"connect": "3.6.6",
|
"connect": "3.6.6",
|
||||||
"eslint": "5.15.3",
|
"eslint": "5.15.3",
|
||||||
"eslint-plugin-vue": "5.2.2",
|
"eslint-plugin-vue": "5.2.2",
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
<div class="dndList">
|
<div class="dndList">
|
||||||
<div :style="{width:width1}" class="dndList-list">
|
<div :style="{width:width1}" class="dndList-list">
|
||||||
<h3>{{ list1Title }}</h3>
|
<h3>{{ list1Title }}</h3>
|
||||||
<draggable :list="list1" group="article" class="dragArea">
|
<draggable :set-data="setData" :list="list1" group="article" class="dragArea">
|
||||||
<div v-for="element in list1" :key="element.id" class="list-complete-item">
|
<div v-for="element in list1" :key="element.id" class="list-complete-item">
|
||||||
<div class="list-complete-item-handle">
|
<div class="list-complete-item-handle">
|
||||||
{{ element.id }}[{{ element.author }}] {{ element.title }}
|
{{ element.id }}[{{ element.author }}] {{ element.title }}
|
||||||
@@ -94,6 +94,11 @@ export default {
|
|||||||
if (this.isNotInList1(ele)) {
|
if (this.isNotInList1(ele)) {
|
||||||
this.list1.push(ele)
|
this.list1.push(ele)
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
setData(dataTransfer) {
|
||||||
|
// to avoid Firefox bug
|
||||||
|
// Detail see : https://github.com/RubaXa/Sortable/issues/1012
|
||||||
|
dataTransfer.setData('Text', '')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -6,28 +6,28 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</el-badge>
|
</el-badge>
|
||||||
|
|
||||||
<el-dialog :visible.sync="dialogTableVisible" title="Error Log" width="80%">
|
<el-dialog :visible.sync="dialogTableVisible" title="Error Log" width="80%" append-to-body>
|
||||||
<el-table :data="errorLogs" border>
|
<el-table :data="errorLogs" border>
|
||||||
<el-table-column label="Message">
|
<el-table-column label="Message">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="{row}">
|
||||||
<div>
|
<div>
|
||||||
<span class="message-title">Msg:</span>
|
<span class="message-title">Msg:</span>
|
||||||
<el-tag type="danger">
|
<el-tag type="danger">
|
||||||
{{ scope.row.err.message }}
|
{{ row.err.message }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
<div>
|
<div>
|
||||||
<span class="message-title" style="padding-right: 10px;">Info: </span>
|
<span class="message-title" style="padding-right: 10px;">Info: </span>
|
||||||
<el-tag type="warning">
|
<el-tag type="warning">
|
||||||
{{ scope.row.vm.$vnode.tag }} error in {{ scope.row.info }}
|
{{ row.vm.$vnode.tag }} error in {{ row.info }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
<div>
|
<div>
|
||||||
<span class="message-title" style="padding-right: 16px;">Url: </span>
|
<span class="message-title" style="padding-right: 16px;">Url: </span>
|
||||||
<el-tag type="success">
|
<el-tag type="success">
|
||||||
{{ scope.row.url }}
|
{{ row.url }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
:list="list"
|
:list="list"
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
class="board-column-content"
|
class="board-column-content"
|
||||||
|
:set-data="setData"
|
||||||
>
|
>
|
||||||
<div v-for="element in list" :key="element.id" class="board-item">
|
<div v-for="element in list" :key="element.id" class="board-item">
|
||||||
{{ element.name }} {{ element.id }}
|
{{ element.name }} {{ element.id }}
|
||||||
@@ -39,6 +40,13 @@ export default {
|
|||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
setData(dataTransfer) {
|
||||||
|
// to avoid Firefox bug
|
||||||
|
// Detail see : https://github.com/RubaXa/Sortable/issues/1012
|
||||||
|
dataTransfer.setData('Text', '')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
export default {
|
export default {
|
||||||
route: {
|
route: {
|
||||||
dashboard: 'Dashboard',
|
dashboard: 'Dashboard',
|
||||||
introduction: 'Introduction',
|
|
||||||
documentation: 'Documentation',
|
documentation: 'Documentation',
|
||||||
guide: 'Guide',
|
guide: 'Guide',
|
||||||
permission: 'Permission',
|
permission: 'Permission',
|
||||||
@@ -10,7 +9,6 @@ export default {
|
|||||||
directivePermission: 'Directive Permission',
|
directivePermission: 'Directive Permission',
|
||||||
icons: 'Icons',
|
icons: 'Icons',
|
||||||
components: 'Components',
|
components: 'Components',
|
||||||
componentIndex: 'Introduction',
|
|
||||||
tinymce: 'Tinymce',
|
tinymce: 'Tinymce',
|
||||||
markdown: 'Markdown',
|
markdown: 'Markdown',
|
||||||
jsonEditor: 'JSON Editor',
|
jsonEditor: 'JSON Editor',
|
||||||
@@ -19,9 +17,9 @@ export default {
|
|||||||
avatarUpload: 'Avatar Upload',
|
avatarUpload: 'Avatar Upload',
|
||||||
dropzone: 'Dropzone',
|
dropzone: 'Dropzone',
|
||||||
sticky: 'Sticky',
|
sticky: 'Sticky',
|
||||||
countTo: 'CountTo',
|
countTo: 'Count To',
|
||||||
componentMixin: 'Mixin',
|
componentMixin: 'Mixin',
|
||||||
backToTop: 'BackToTop',
|
backToTop: 'Back To Top',
|
||||||
dragDialog: 'Drag Dialog',
|
dragDialog: 'Drag Dialog',
|
||||||
dragSelect: 'Drag Select',
|
dragSelect: 'Drag Select',
|
||||||
dragKanban: 'Drag Kanban',
|
dragKanban: 'Drag Kanban',
|
||||||
@@ -74,7 +72,7 @@ export default {
|
|||||||
},
|
},
|
||||||
login: {
|
login: {
|
||||||
title: 'Login Form',
|
title: 'Login Form',
|
||||||
logIn: 'Log in',
|
logIn: 'Login',
|
||||||
username: 'Username',
|
username: 'Username',
|
||||||
password: 'Password',
|
password: 'Password',
|
||||||
any: 'any',
|
any: 'any',
|
||||||
@@ -87,10 +85,10 @@ export default {
|
|||||||
},
|
},
|
||||||
permission: {
|
permission: {
|
||||||
addRole: 'New Role',
|
addRole: 'New Role',
|
||||||
editPermission: 'Edit Permission',
|
editPermission: 'Edit',
|
||||||
roles: 'Your roles',
|
roles: 'Your roles',
|
||||||
switchRoles: 'Switch roles',
|
switchRoles: 'Switch roles',
|
||||||
tips: 'In some cases it is not suitable to use v-permission, such as element Tab component or el-table-column and other asynchronous rendering dom cases which can only be achieved by manually setting the v-if.',
|
tips: 'In some cases, using v-permission will have no effect. For example: Element-UI el-tab or el-table-column and other scenes that dynamically render dom. You can only do this with v-if.',
|
||||||
delete: 'Delete',
|
delete: 'Delete',
|
||||||
confirm: 'Confirm',
|
confirm: 'Confirm',
|
||||||
cancel: 'Cancel'
|
cancel: 'Cancel'
|
||||||
@@ -101,7 +99,7 @@ export default {
|
|||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
documentation: 'Documentation',
|
documentation: 'Documentation',
|
||||||
tinymceTips: 'Rich text editor is a core part of management system, but at the same time is a place with lots of problems. In the process of selecting rich texts, I also walked a lot of detours. The common rich text editors in the market are basically used, and the finally chose Tinymce. See documentation for more detailed rich text editor comparisons and introductions.',
|
tinymceTips: 'Rich text is a core feature of the management backend, but at the same time it is a place with lots of pits. In the process of selecting rich texts, I also took a lot of detours. The common rich texts on the market have been basically used, and I finally chose Tinymce. See the more detailed rich text comparison and introduction.',
|
||||||
dropzoneTips: 'Because my business has special needs, and has to upload images to qiniu, so instead of a third party, I chose encapsulate it by myself. It is very simple, you can see the detail code in @/components/Dropzone.',
|
dropzoneTips: 'Because my business has special needs, and has to upload images to qiniu, so instead of a third party, I chose encapsulate it by myself. It is very simple, you can see the detail code in @/components/Dropzone.',
|
||||||
stickyTips: 'when the page is scrolled to the preset position will be sticky on the top.',
|
stickyTips: 'when the page is scrolled to the preset position will be sticky on the top.',
|
||||||
backToTopTips1: 'When the page is scrolled to the specified position, the Back to Top button appears in the lower right corner',
|
backToTopTips1: 'When the page is scrolled to the specified position, the Back to Top button appears in the lower right corner',
|
||||||
@@ -142,14 +140,14 @@ export default {
|
|||||||
excel: {
|
excel: {
|
||||||
export: 'Export',
|
export: 'Export',
|
||||||
selectedExport: 'Export Selected Items',
|
selectedExport: 'Export Selected Items',
|
||||||
placeholder: 'Please enter the file name(default excel-list)'
|
placeholder: 'Please enter the file name (default excel-list)'
|
||||||
},
|
},
|
||||||
zip: {
|
zip: {
|
||||||
export: 'Export',
|
export: 'Export',
|
||||||
placeholder: 'Please enter the file name(default file)'
|
placeholder: 'Please enter the file name (default file)'
|
||||||
},
|
},
|
||||||
pdf: {
|
pdf: {
|
||||||
tips: 'Here we use window.print() to implement the feature of downloading pdf.'
|
tips: 'Here we use window.print() to implement the feature of downloading PDF.'
|
||||||
},
|
},
|
||||||
theme: {
|
theme: {
|
||||||
change: 'Change Theme',
|
change: 'Change Theme',
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
export default {
|
export default {
|
||||||
route: {
|
route: {
|
||||||
dashboard: 'Panel de control',
|
dashboard: 'Panel de control',
|
||||||
introduction: 'Introducción',
|
|
||||||
documentation: 'Documentación',
|
documentation: 'Documentación',
|
||||||
guide: 'Guía',
|
guide: 'Guía',
|
||||||
permission: 'Permisos',
|
permission: 'Permisos',
|
||||||
@@ -10,7 +9,6 @@ export default {
|
|||||||
directivePermission: 'Permisos de la directiva',
|
directivePermission: 'Permisos de la directiva',
|
||||||
icons: 'Iconos',
|
icons: 'Iconos',
|
||||||
components: 'Componentes',
|
components: 'Componentes',
|
||||||
componentIndex: 'Introducción',
|
|
||||||
tinymce: 'Tinymce',
|
tinymce: 'Tinymce',
|
||||||
markdown: 'Markdown',
|
markdown: 'Markdown',
|
||||||
jsonEditor: 'Editor JSON',
|
jsonEditor: 'Editor JSON',
|
||||||
|
@@ -24,11 +24,24 @@ const messages = {
|
|||||||
...elementEsLocale
|
...elementEsLocale
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
export function getLanguage() {
|
||||||
|
const chooseLanguage = Cookies.get('language')
|
||||||
|
if (chooseLanguage) return chooseLanguage
|
||||||
|
|
||||||
|
// if has not choose language
|
||||||
|
const language = (navigator.language || navigator.browserLanguage).toLowerCase()
|
||||||
|
const locales = Object.keys(messages)
|
||||||
|
for (const locale of locales) {
|
||||||
|
if (language.indexOf(locale) > -1) {
|
||||||
|
return locale
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 'en'
|
||||||
|
}
|
||||||
const i18n = new VueI18n({
|
const i18n = new VueI18n({
|
||||||
// set locale
|
// set locale
|
||||||
// options: en | zh | es
|
// options: en | zh | es
|
||||||
locale: Cookies.get('language') || 'en',
|
locale: getLanguage(),
|
||||||
// set locale messages
|
// set locale messages
|
||||||
messages
|
messages
|
||||||
})
|
})
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
export default {
|
export default {
|
||||||
route: {
|
route: {
|
||||||
dashboard: '首页',
|
dashboard: '首页',
|
||||||
introduction: '简述',
|
|
||||||
documentation: '文档',
|
documentation: '文档',
|
||||||
guide: '引导页',
|
guide: '引导页',
|
||||||
permission: '权限测试页',
|
permission: '权限测试页',
|
||||||
@@ -10,16 +9,15 @@ export default {
|
|||||||
directivePermission: '指令权限',
|
directivePermission: '指令权限',
|
||||||
icons: '图标',
|
icons: '图标',
|
||||||
components: '组件',
|
components: '组件',
|
||||||
componentIndex: '介绍',
|
|
||||||
tinymce: '富文本编辑器',
|
tinymce: '富文本编辑器',
|
||||||
markdown: 'Markdown',
|
markdown: 'Markdown',
|
||||||
jsonEditor: 'JSON编辑器',
|
jsonEditor: 'JSON 编辑器',
|
||||||
dndList: '列表拖拽',
|
dndList: '列表拖拽',
|
||||||
splitPane: 'Splitpane',
|
splitPane: 'Splitpane',
|
||||||
avatarUpload: '头像上传',
|
avatarUpload: '头像上传',
|
||||||
dropzone: 'Dropzone',
|
dropzone: 'Dropzone',
|
||||||
sticky: 'Sticky',
|
sticky: 'Sticky',
|
||||||
countTo: 'CountTo',
|
countTo: 'Count To',
|
||||||
componentMixin: '小组件',
|
componentMixin: '小组件',
|
||||||
backToTop: '返回顶部',
|
backToTop: '返回顶部',
|
||||||
dragDialog: '拖拽 Dialog',
|
dragDialog: '拖拽 Dialog',
|
||||||
@@ -32,17 +30,17 @@ export default {
|
|||||||
example: '综合实例',
|
example: '综合实例',
|
||||||
nested: '路由嵌套',
|
nested: '路由嵌套',
|
||||||
menu1: '菜单1',
|
menu1: '菜单1',
|
||||||
'menu1-1': '菜单1-1',
|
'menu1-1': '菜单 1-1',
|
||||||
'menu1-2': '菜单1-2',
|
'menu1-2': '菜单 1-2',
|
||||||
'menu1-2-1': '菜单1-2-1',
|
'menu1-2-1': '菜单 1-2-1',
|
||||||
'menu1-2-2': '菜单1-2-2',
|
'menu1-2-2': '菜单 1-2-2',
|
||||||
'menu1-3': '菜单1-3',
|
'menu1-3': '菜单 1-3',
|
||||||
menu2: '菜单2',
|
menu2: '菜单 2',
|
||||||
Table: 'Table',
|
Table: 'Table',
|
||||||
dynamicTable: '动态Table',
|
dynamicTable: '动态 Table',
|
||||||
dragTable: '拖拽Table',
|
dragTable: '拖拽 Table',
|
||||||
inlineEditTable: 'Table内编辑',
|
inlineEditTable: 'Table 内编辑',
|
||||||
complexTable: '综合Table',
|
complexTable: '综合 Table',
|
||||||
tab: 'Tab',
|
tab: 'Tab',
|
||||||
form: '表单',
|
form: '表单',
|
||||||
createArticle: '创建文章',
|
createArticle: '创建文章',
|
||||||
@@ -90,7 +88,7 @@ export default {
|
|||||||
editPermission: '编辑权限',
|
editPermission: '编辑权限',
|
||||||
roles: '你的权限',
|
roles: '你的权限',
|
||||||
switchRoles: '切换权限',
|
switchRoles: '切换权限',
|
||||||
tips: '在某些情况下,不适合使用 v-permission。例如:Element-UI 的 Tab 组件或 el-table-column 以及其它动态渲染 dom 的场景。你只能通过手动设置 v-if 来实现。',
|
tips: '在某些情况下,不适合使用 v-permission。例如:Element-UI 的 el-tab 或 el-table-column 以及其它动态渲染 dom 的场景。你只能通过手动设置 v-if 来实现。',
|
||||||
delete: '删除',
|
delete: '删除',
|
||||||
confirm: '确定',
|
confirm: '确定',
|
||||||
cancel: '取消'
|
cancel: '取消'
|
||||||
|
@@ -1,19 +1,19 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="navbar">
|
<div class="navbar">
|
||||||
<hamburger :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
|
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
|
||||||
|
|
||||||
<breadcrumb class="breadcrumb-container" />
|
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" />
|
||||||
|
|
||||||
<div class="right-menu">
|
<div class="right-menu">
|
||||||
<template v-if="device!=='mobile'">
|
<template v-if="device!=='mobile'">
|
||||||
<search class="right-menu-item" />
|
<search id="header-search" class="right-menu-item" />
|
||||||
|
|
||||||
<error-log class="errLog-container right-menu-item hover-effect" />
|
<error-log class="errLog-container right-menu-item hover-effect" />
|
||||||
|
|
||||||
<screenfull class="right-menu-item hover-effect" />
|
<screenfull id="screenfull" class="right-menu-item hover-effect" />
|
||||||
|
|
||||||
<el-tooltip :content="$t('navbar.size')" effect="dark" placement="bottom">
|
<el-tooltip :content="$t('navbar.size')" effect="dark" placement="bottom">
|
||||||
<size-select class="right-menu-item hover-effect" />
|
<size-select id="size-select" class="right-menu-item hover-effect" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
|
|
||||||
<lang-select class="right-menu-item hover-effect" />
|
<lang-select class="right-menu-item hover-effect" />
|
||||||
|
@@ -86,6 +86,9 @@ export default {
|
|||||||
if (isExternal(routePath)) {
|
if (isExternal(routePath)) {
|
||||||
return routePath
|
return routePath
|
||||||
}
|
}
|
||||||
|
if (isExternal(this.basePath)) {
|
||||||
|
return this.basePath
|
||||||
|
}
|
||||||
return path.resolve(this.basePath, routePath)
|
return path.resolve(this.basePath, routePath)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
<logo v-if="showLogo" :collapse="isCollapse" />
|
<logo v-if="showLogo" :collapse="isCollapse" />
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||||
<el-menu
|
<el-menu
|
||||||
:default-active="$route.path"
|
:default-active="activeMenu"
|
||||||
:collapse="isCollapse"
|
:collapse="isCollapse"
|
||||||
:background-color="variables.menuBg"
|
:background-color="variables.menuBg"
|
||||||
:text-color="variables.menuText"
|
:text-color="variables.menuText"
|
||||||
@@ -30,6 +30,15 @@ export default {
|
|||||||
'permission_routes',
|
'permission_routes',
|
||||||
'sidebar'
|
'sidebar'
|
||||||
]),
|
]),
|
||||||
|
activeMenu() {
|
||||||
|
const route = this.$route
|
||||||
|
const { meta, path } = route
|
||||||
|
// if set path, the sidebar will highlight the path you set
|
||||||
|
if (meta.activeMenu) {
|
||||||
|
return meta.activeMenu
|
||||||
|
}
|
||||||
|
return path
|
||||||
|
},
|
||||||
showLogo() {
|
showLogo() {
|
||||||
return this.$store.state.settings.sidebarLogo
|
return this.$store.state.settings.sidebarLogo
|
||||||
},
|
},
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="tags-view-container">
|
<div id="tags-view-container" class="tags-view-container">
|
||||||
<scroll-pane ref="scrollPane" class="tags-view-wrapper">
|
<scroll-pane ref="scrollPane" class="tags-view-wrapper">
|
||||||
<router-link
|
<router-link
|
||||||
v-for="tag in visitedViews"
|
v-for="tag in visitedViews"
|
||||||
@@ -145,7 +145,7 @@ export default {
|
|||||||
closeSelectedTag(view) {
|
closeSelectedTag(view) {
|
||||||
this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
|
this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
|
||||||
if (this.isActive(view)) {
|
if (this.isActive(view)) {
|
||||||
this.toLastView(visitedViews)
|
this.toLastView(visitedViews, view)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -160,17 +160,23 @@ export default {
|
|||||||
if (this.affixTags.some(tag => tag.path === view.path)) {
|
if (this.affixTags.some(tag => tag.path === view.path)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.toLastView(visitedViews)
|
this.toLastView(visitedViews, view)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
toLastView(visitedViews) {
|
toLastView(visitedViews, view) {
|
||||||
const latestView = visitedViews.slice(-1)[0]
|
const latestView = visitedViews.slice(-1)[0]
|
||||||
if (latestView) {
|
if (latestView) {
|
||||||
this.$router.push(latestView)
|
this.$router.push(latestView)
|
||||||
} else {
|
} else {
|
||||||
// You can set another route
|
// now the default is to redirect to the home page if there is no tags-view,
|
||||||
|
// you can adjust it according to your needs.
|
||||||
|
if (view.name === 'Dashboard') {
|
||||||
|
// to reload home page
|
||||||
|
this.$router.replace({ path: '/redirect' + view.fullPath })
|
||||||
|
} else {
|
||||||
this.$router.push('/')
|
this.$router.push('/')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
openMenu(tag, e) {
|
openMenu(tag, e) {
|
||||||
const menuMinWidth = 105
|
const menuMinWidth = 105
|
||||||
@@ -243,7 +249,7 @@ export default {
|
|||||||
.contextmenu {
|
.contextmenu {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
z-index: 100;
|
z-index: 3000;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
padding: 5px 0;
|
padding: 5px 0;
|
||||||
|
@@ -12,32 +12,32 @@ import chartsRouter from './modules/charts'
|
|||||||
import tableRouter from './modules/table'
|
import tableRouter from './modules/table'
|
||||||
import nestedRouter from './modules/nested'
|
import nestedRouter from './modules/nested'
|
||||||
|
|
||||||
/** note: sub-menu only appear when children.length>=1
|
|
||||||
* detail see https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
|
|
||||||
**/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* hidden: true if `hidden:true` will not show in the sidebar(default is false)
|
* Note: sub-menu only appear when route children.length >= 1
|
||||||
* alwaysShow: true if set true, will always show the root menu, whatever its child routes length
|
* Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
|
||||||
* if not set alwaysShow, only more than one route under the children
|
*
|
||||||
* it will becomes nested mode, otherwise not show the root menu
|
* hidden: true if set true, item will not show in the sidebar(default is false)
|
||||||
* redirect: noredirect if `redirect:noredirect` will no redirect in the breadcrumb
|
* alwaysShow: true if set true, will always show the root menu
|
||||||
* name:'router-name' the name is used by <keep-alive> (must set!!!)
|
* if not set alwaysShow, when item has more than one children route,
|
||||||
* meta : {
|
* it will becomes nested mode, otherwise not show the root menu
|
||||||
roles: ['admin','editor'] will control the page roles (you can set multiple roles)
|
* redirect: noredirect if `redirect:noredirect` will no redirect in the breadcrumb
|
||||||
title: 'title' the name show in sub-menu and breadcrumb (recommend set)
|
* name:'router-name' the name is used by <keep-alive> (must set!!!)
|
||||||
|
* meta : {
|
||||||
|
roles: ['admin','editor'] control the page roles (you can set multiple roles)
|
||||||
|
title: 'title' the name show in sidebar and breadcrumb (recommend set)
|
||||||
icon: 'svg-name' the icon show in the sidebar
|
icon: 'svg-name' the icon show in the sidebar
|
||||||
noCache: true if true, the page will no be cached(default is false)
|
noCache: true if set true, the page will no be cached(default is false)
|
||||||
breadcrumb: false if false, the item will hidden in breadcrumb(default is true)
|
affix: true if set true, the tag will affix in the tags-view
|
||||||
affix: true if true, the tag will affix in the tags-view
|
breadcrumb: false if set false, the item will hidden in breadcrumb(default is true)
|
||||||
|
activeMenu: '/example/list' if set path, the sidebar will highlight the path you set
|
||||||
}
|
}
|
||||||
**/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* constantRoutes
|
* constantRoutes
|
||||||
* a base page that does not have permission requirements
|
* a base page that does not have permission requirements
|
||||||
* all roles can be accessed
|
* all roles can be accessed
|
||||||
* */
|
*/
|
||||||
export const constantRoutes = [
|
export const constantRoutes = [
|
||||||
{
|
{
|
||||||
path: '/redirect',
|
path: '/redirect',
|
||||||
@@ -57,7 +57,7 @@ export const constantRoutes = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/auth-redirect',
|
path: '/auth-redirect',
|
||||||
component: () => import('@/views/login/authredirect'),
|
component: () => import('@/views/login/authRedirect'),
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -113,7 +113,7 @@ export const constantRoutes = [
|
|||||||
/**
|
/**
|
||||||
* asyncRoutes
|
* asyncRoutes
|
||||||
* the routes that need to be dynamically loaded based on user roles
|
* the routes that need to be dynamically loaded based on user roles
|
||||||
*/
|
*/
|
||||||
export const asyncRoutes = [
|
export const asyncRoutes = [
|
||||||
{
|
{
|
||||||
path: '/permission',
|
path: '/permission',
|
||||||
@@ -195,7 +195,7 @@ export const asyncRoutes = [
|
|||||||
path: 'edit/:id(\\d+)',
|
path: 'edit/:id(\\d+)',
|
||||||
component: () => import('@/views/example/edit'),
|
component: () => import('@/views/example/edit'),
|
||||||
name: 'EditArticle',
|
name: 'EditArticle',
|
||||||
meta: { title: 'editArticle', noCache: true },
|
meta: { title: 'editArticle', noCache: true, activeMenu: '/example/list' },
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@@ -28,10 +28,10 @@ export default {
|
|||||||
sidebarLogo: false,
|
sidebarLogo: false,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {string | array} 'production' | ['production','development']
|
* @type {string | array} 'production' | ['production', 'development']
|
||||||
* @description Need show err logs component.
|
* @description Need show err logs component.
|
||||||
* The default is only used in the production env
|
* The default is only used in the production env
|
||||||
* If you want to also use it in dev, you can pass ['production','development']
|
* If you want to also use it in dev, you can pass ['production', 'development']
|
||||||
*/
|
*/
|
||||||
errorLog: 'production'
|
errorLog: 'production'
|
||||||
}
|
}
|
||||||
|
@@ -1,24 +1,24 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import Vuex from 'vuex'
|
import Vuex from 'vuex'
|
||||||
import app from './modules/app'
|
|
||||||
import errorLog from './modules/errorLog'
|
|
||||||
import permission from './modules/permission'
|
|
||||||
import tagsView from './modules/tagsView'
|
|
||||||
import settings from './modules/settings'
|
|
||||||
import user from './modules/user'
|
|
||||||
import getters from './getters'
|
import getters from './getters'
|
||||||
|
|
||||||
Vue.use(Vuex)
|
Vue.use(Vuex)
|
||||||
|
|
||||||
|
// https://webpack.js.org/guides/dependency-management/#requirecontext
|
||||||
|
const modulesFiles = require.context('./modules', false, /\.js$/)
|
||||||
|
|
||||||
|
// you do not need `import app from './modules/app'`
|
||||||
|
// it will auto require all vuex module from modules file
|
||||||
|
const modules = modulesFiles.keys().reduce((modules, modulePath) => {
|
||||||
|
// set './app.js' => 'app'
|
||||||
|
const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1')
|
||||||
|
const value = modulesFiles(modulePath)
|
||||||
|
modules[moduleName] = value.default
|
||||||
|
return modules
|
||||||
|
}, {})
|
||||||
|
|
||||||
const store = new Vuex.Store({
|
const store = new Vuex.Store({
|
||||||
modules: {
|
modules,
|
||||||
app,
|
|
||||||
errorLog,
|
|
||||||
permission,
|
|
||||||
tagsView,
|
|
||||||
settings,
|
|
||||||
user
|
|
||||||
},
|
|
||||||
getters
|
getters
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
import Cookies from 'js-cookie'
|
import Cookies from 'js-cookie'
|
||||||
|
import { getLanguage } from '@/lang/index'
|
||||||
|
|
||||||
const state = {
|
const state = {
|
||||||
sidebar: {
|
sidebar: {
|
||||||
@@ -6,7 +7,7 @@ const state = {
|
|||||||
withoutAnimation: false
|
withoutAnimation: false
|
||||||
},
|
},
|
||||||
device: 'desktop',
|
device: 'desktop',
|
||||||
language: Cookies.get('language') || 'en',
|
language: getLanguage(),
|
||||||
size: Cookies.get('size') || 'medium'
|
size: Cookies.get('size') || 'medium'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
const state = {
|
const state = {
|
||||||
logs: []
|
logs: []
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
const state = {
|
const state = {
|
||||||
visitedViews: [],
|
visitedViews: [],
|
||||||
cachedViews: []
|
cachedViews: []
|
||||||
|
@@ -12,6 +12,7 @@
|
|||||||
.sidebar-container {
|
.sidebar-container {
|
||||||
transition: width 0.28s;
|
transition: width 0.28s;
|
||||||
width: $sideBarWidth !important;
|
width: $sideBarWidth !important;
|
||||||
|
background-color: $menuBg;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
font-size: 0px;
|
font-size: 0px;
|
||||||
@@ -28,10 +29,6 @@
|
|||||||
|
|
||||||
.scrollbar-wrapper {
|
.scrollbar-wrapper {
|
||||||
overflow-x: hidden !important;
|
overflow-x: hidden !important;
|
||||||
|
|
||||||
.el-scrollbar__view {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-scrollbar__bar.is-vertical {
|
.el-scrollbar__bar.is-vertical {
|
||||||
|
@@ -23,7 +23,7 @@ service.interceptors.request.use(
|
|||||||
error => {
|
error => {
|
||||||
// Do something with request error
|
// Do something with request error
|
||||||
console.log(error) // for debug
|
console.log(error) // for debug
|
||||||
Promise.reject(error)
|
return Promise.reject(error)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ service.interceptors.response.use(
|
|||||||
const res = response.data
|
const res = response.data
|
||||||
if (res.code !== 20000) {
|
if (res.code !== 20000) {
|
||||||
Message({
|
Message({
|
||||||
message: res.message,
|
message: res.message || 'error',
|
||||||
type: 'error',
|
type: 'error',
|
||||||
duration: 5 * 1000
|
duration: 5 * 1000
|
||||||
})
|
})
|
||||||
@@ -61,7 +61,7 @@ service.interceptors.response.use(
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return Promise.reject('error')
|
return Promise.reject(res.message || 'error')
|
||||||
} else {
|
} else {
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
@@ -11,9 +11,9 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="Status" width="100" align="center">
|
<el-table-column label="Status" width="100" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="{row}">
|
||||||
<el-tag :type="scope.row.status | statusFilter">
|
<el-tag :type="row.status | statusFilter">
|
||||||
{{ scope.row.status }}
|
{{ row.status }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="dashboard-editor-container">
|
<div class="dashboard-editor-container">
|
||||||
<github-corner style="position: absolute; top: 0px; border: 0; right: 0;" />
|
<github-corner class="github-corner" />
|
||||||
|
|
||||||
<panel-group @handleSetLineChartData="handleSetLineChartData" />
|
<panel-group @handleSetLineChartData="handleSetLineChartData" />
|
||||||
|
|
||||||
@@ -100,6 +100,15 @@ export default {
|
|||||||
.dashboard-editor-container {
|
.dashboard-editor-container {
|
||||||
padding: 32px;
|
padding: 32px;
|
||||||
background-color: rgb(240, 242, 245);
|
background-color: rgb(240, 242, 245);
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.github-corner {
|
||||||
|
position: absolute;
|
||||||
|
top: 0px;
|
||||||
|
border: 0;
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.chart-wrapper {
|
.chart-wrapper {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
padding: 16px 16px 0;
|
padding: 16px 16px 0;
|
||||||
|
@@ -28,7 +28,7 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label-width="45px" label="作者:" class="postInfo-container-item">
|
<el-form-item label-width="45px" label="作者:" class="postInfo-container-item">
|
||||||
<el-select v-model="postForm.author" :remote-method="getRemoteUserList" filterable remote placeholder="搜索用户">
|
<el-select v-model="postForm.author" :remote-method="getRemoteUserList" filterable default-first-option remote placeholder="搜索用户">
|
||||||
<el-option v-for="(item,index) in userListOptions" :key="item+index" :label="item" :value="item" />
|
<el-option v-for="(item,index) in userListOptions" :key="item+index" :label="item" :value="item" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@@ -26,17 +26,17 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column class-name="status-col" label="Status" width="110">
|
<el-table-column class-name="status-col" label="Status" width="110">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="{row}">
|
||||||
<el-tag :type="scope.row.status | statusFilter">
|
<el-tag :type="row.status | statusFilter">
|
||||||
{{ scope.row.status }}
|
{{ row.status }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column min-width="300px" label="Title">
|
<el-table-column min-width="300px" label="Title">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="{row}">
|
||||||
<router-link :to="'/example/edit/'+scope.row.id" class="link-type">
|
<router-link :to="'/example/edit/'+row.id" class="link-type">
|
||||||
<span>{{ scope.row.title }}</span>
|
<span>{{ row.title }}</span>
|
||||||
</router-link>
|
</router-link>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
<div style="display:inline-block;">
|
<div style="display:inline-block;">
|
||||||
<!-- $t is vue-i18n global function to translate lang -->
|
<!-- $t is vue-i18n global function to translate lang -->
|
||||||
<label class="radio-label" style="padding-left:0;">Filename: </label>
|
<label class="radio-label" style="padding-left:0;">Filename: </label>
|
||||||
<el-input v-model="filename" :placeholder="$t('excel.placeholder')" style="width:340px;" prefix-icon="el-icon-document" />
|
<el-input v-model="filename" :placeholder="$t('excel.placeholder')" style="width:350px;" prefix-icon="el-icon-document" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<!-- $t is vue-i18n global function to translate lang -->
|
<!-- $t is vue-i18n global function to translate lang -->
|
||||||
<el-input v-model="filename" :placeholder="$t('excel.placeholder')" style="width:340px;" prefix-icon="el-icon-document" />
|
<el-input v-model="filename" :placeholder="$t('excel.placeholder')" style="width:350px;" prefix-icon="el-icon-document" />
|
||||||
<el-button :loading="downloadLoading" style="margin-bottom:20px" type="primary" icon="document" @click="handleDownload">
|
<el-button :loading="downloadLoading" style="margin-bottom:20px" type="primary" icon="document" @click="handleDownload">
|
||||||
{{ $t('excel.selectedExport') }}
|
{{ $t('excel.selectedExport') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
const steps = [
|
const steps = [
|
||||||
{
|
{
|
||||||
element: '.hamburger-container',
|
element: '#hamburger-container',
|
||||||
popover: {
|
popover: {
|
||||||
title: 'Hamburger',
|
title: 'Hamburger',
|
||||||
description: 'Open && Close sidebar',
|
description: 'Open && Close sidebar',
|
||||||
@@ -8,7 +8,7 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
element: '.breadcrumb-container',
|
element: '#breadcrumb-container',
|
||||||
popover: {
|
popover: {
|
||||||
title: 'Breadcrumb',
|
title: 'Breadcrumb',
|
||||||
description: 'Indicate the current page location',
|
description: 'Indicate the current page location',
|
||||||
@@ -16,31 +16,31 @@ const steps = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
element: '.screenfull',
|
element: '#header-search',
|
||||||
|
popover: {
|
||||||
|
title: 'Page Search',
|
||||||
|
description: 'Page search, quick navigation',
|
||||||
|
position: 'left'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
element: '#screenfull',
|
||||||
popover: {
|
popover: {
|
||||||
title: 'Screenfull',
|
title: 'Screenfull',
|
||||||
description: 'Bring the page into fullscreen',
|
description: 'Set the page into fullscreen',
|
||||||
position: 'left'
|
position: 'left'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
element: '.international-icon',
|
element: '#size-select',
|
||||||
popover: {
|
popover: {
|
||||||
title: 'Switch language',
|
title: 'Switch Size',
|
||||||
description: 'Switch the system language',
|
description: 'Switch the system size',
|
||||||
position: 'left'
|
position: 'left'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
element: '.theme-switch',
|
element: '#tags-view-container',
|
||||||
popover: {
|
|
||||||
title: 'Theme Switch',
|
|
||||||
description: 'Custom switch system theme',
|
|
||||||
position: 'left'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
element: '.tags-view-container',
|
|
||||||
popover: {
|
popover: {
|
||||||
title: 'Tags view',
|
title: 'Tags view',
|
||||||
description: 'The history of the page you visited',
|
description: 'The history of the page you visited',
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'Authredirect',
|
name: 'AuthRedirect',
|
||||||
created() {
|
created() {
|
||||||
const hash = window.location.search.slice(1)
|
const hash = window.location.search.slice(1)
|
||||||
if (window.localStorage) {
|
if (window.localStorage) {
|
@@ -23,6 +23,7 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-tooltip v-model="capsTooltip" content="Caps lock is On" placement="right" manual>
|
||||||
<el-form-item prop="password">
|
<el-form-item prop="password">
|
||||||
<span class="svg-container">
|
<span class="svg-container">
|
||||||
<svg-icon icon-class="password" />
|
<svg-icon icon-class="password" />
|
||||||
@@ -35,12 +36,15 @@
|
|||||||
:placeholder="$t('login.password')"
|
:placeholder="$t('login.password')"
|
||||||
name="password"
|
name="password"
|
||||||
auto-complete="on"
|
auto-complete="on"
|
||||||
|
@keyup.native="checkCapslock"
|
||||||
|
@blur="capsTooltip = false"
|
||||||
@keyup.enter.native="handleLogin"
|
@keyup.enter.native="handleLogin"
|
||||||
/>
|
/>
|
||||||
<span class="show-pwd" @click="showPwd">
|
<span class="show-pwd" @click="showPwd">
|
||||||
<svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" />
|
<svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" />
|
||||||
</span>
|
</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-tooltip>
|
||||||
|
|
||||||
<el-button :loading="loading" type="primary" style="width:100%;margin-bottom:30px;" @click.native.prevent="handleLogin">
|
<el-button :loading="loading" type="primary" style="width:100%;margin-bottom:30px;" @click.native.prevent="handleLogin">
|
||||||
{{ $t('login.logIn') }}
|
{{ $t('login.logIn') }}
|
||||||
@@ -77,7 +81,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { validUsername } from '@/utils/validate'
|
import { validUsername } from '@/utils/validate'
|
||||||
import LangSelect from '@/components/LangSelect'
|
import LangSelect from '@/components/LangSelect'
|
||||||
import SocialSign from './socialsignin'
|
import SocialSign from './socialSignin'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Login',
|
name: 'Login',
|
||||||
@@ -107,6 +111,7 @@ export default {
|
|||||||
password: [{ required: true, trigger: 'blur', validator: validatePassword }]
|
password: [{ required: true, trigger: 'blur', validator: validatePassword }]
|
||||||
},
|
},
|
||||||
passwordType: 'password',
|
passwordType: 'password',
|
||||||
|
capsTooltip: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
showDialog: false,
|
showDialog: false,
|
||||||
redirect: undefined
|
redirect: undefined
|
||||||
@@ -134,6 +139,18 @@ export default {
|
|||||||
// window.removeEventListener('storage', this.afterQRScan)
|
// window.removeEventListener('storage', this.afterQRScan)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
checkCapslock({ shiftKey, key } = {}) {
|
||||||
|
if (key && key.length === 1) {
|
||||||
|
if (shiftKey && (key >= 'a' && key <= 'z') || !shiftKey && (key >= 'A' && key <= 'Z')) {
|
||||||
|
this.capsTooltip = true
|
||||||
|
} else {
|
||||||
|
this.capsTooltip = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (key === 'CapsLock' && this.capsTooltip === true) {
|
||||||
|
this.capsTooltip = false
|
||||||
|
}
|
||||||
|
},
|
||||||
showPwd() {
|
showPwd() {
|
||||||
if (this.passwordType === 'password') {
|
if (this.passwordType === 'password') {
|
||||||
this.passwordType = ''
|
this.passwordType = ''
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div style="margin-bottom:15px;">
|
<div style="margin-bottom:15px;">
|
||||||
{{ $t('permission.roles') }}: {{ roles }}
|
{{ $t('permission.roles') }}: {{ roles }}
|
||||||
</div>
|
</div>
|
||||||
{{ $t('permission.switchRoles') }}:
|
{{ $t('permission.switchRoles') }}:
|
||||||
<el-radio-group v-model="switchRoles">
|
<el-radio-group v-model="switchRoles">
|
||||||
<el-radio-button label="editor" />
|
<el-radio-button label="editor" />
|
||||||
<el-radio-button label="admin" />
|
<el-radio-button label="admin" />
|
||||||
|
1
src/views/svg-icons/element-icon.json
Normal file
1
src/views/svg-icons/element-icon.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
["info","error","success","warning","question","back","arrow-left","arrow-down","arrow-right","arrow-up","caret-left","caret-bottom","caret-top","caret-right","d-arrow-left","d-arrow-right","minus","plus","remove","circle-plus","remove-outline","circle-plus-outline","close","check","circle-close","circle-check","circle-close-outline","circle-check-outline","zoom-out","zoom-in","d-caret","sort","sort-down","sort-up","tickets","document","goods","sold-out","news","message","date","printer","time","bell","mobile-phone","service","view","menu","more","more-outline","star-on","star-off","location","location-outline","phone","phone-outline","picture","picture-outline","delete","search","edit","edit-outline","rank","refresh","share","setting","upload","upload2","download","loading"]
|
@@ -4,7 +4,8 @@
|
|||||||
<a href="https://panjiachen.github.io/vue-element-admin-site/guide/advanced/icon.html" target="_blank">Add and use
|
<a href="https://panjiachen.github.io/vue-element-admin-site/guide/advanced/icon.html" target="_blank">Add and use
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
<div class="icons-wrapper">
|
<el-tabs type="border-card">
|
||||||
|
<el-tab-pane label="Icons">
|
||||||
<div v-for="item of iconsMap" :key="item" @click="handleClipboard(generateIconCode(item),$event)">
|
<div v-for="item of iconsMap" :key="item" @click="handleClipboard(generateIconCode(item),$event)">
|
||||||
<el-tooltip placement="top">
|
<el-tooltip placement="top">
|
||||||
<div slot="content">
|
<div slot="content">
|
||||||
@@ -16,25 +17,44 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</div>
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="Element-UI Icons">
|
||||||
|
<div v-for="item of elementIcons" :key="item" @click="handleClipboard(generateElementIconCode(item),$event)">
|
||||||
|
<el-tooltip placement="top">
|
||||||
|
<div slot="content">
|
||||||
|
{{ generateElementIconCode(item) }}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="icon-item">
|
||||||
|
<i :class="'el-icon-' + item" />
|
||||||
|
<span>{{ item }}</span>
|
||||||
|
</div>
|
||||||
|
</el-tooltip>
|
||||||
|
</div>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import icons from './requireIcons'
|
|
||||||
import clipboard from '@/utils/clipboard'
|
import clipboard from '@/utils/clipboard'
|
||||||
|
import icons from './requireIcons'
|
||||||
|
import elementIcons from './element-icon.json'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Icons',
|
name: 'Icons',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
iconsMap: icons
|
iconsMap: icons,
|
||||||
|
elementIcons: elementIcons
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
generateIconCode(symbol) {
|
generateIconCode(symbol) {
|
||||||
return `<svg-icon icon-class="${symbol}" />`
|
return `<svg-icon icon-class="${symbol}" />`
|
||||||
},
|
},
|
||||||
|
generateElementIconCode(symbol) {
|
||||||
|
return `<i class="el-icon-${symbol}" />`
|
||||||
|
},
|
||||||
handleClipboard(text, event) {
|
handleClipboard(text, event) {
|
||||||
clipboard(text, event)
|
clipboard(text, event)
|
||||||
}
|
}
|
||||||
@@ -46,25 +66,25 @@ export default {
|
|||||||
.icons-container {
|
.icons-container {
|
||||||
margin: 10px 20px 0;
|
margin: 10px 20px 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
.icons-wrapper {
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
.icon-item {
|
.icon-item {
|
||||||
margin: 20px;
|
margin: 20px;
|
||||||
height: 110px;
|
height: 85px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
width: 110px;
|
width: 100px;
|
||||||
float: left;
|
float: left;
|
||||||
font-size: 30px;
|
font-size: 30px;
|
||||||
color: #24292e;
|
color: #24292e;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
span {
|
span {
|
||||||
display: block;
|
display: block;
|
||||||
font-size: 24px;
|
font-size: 16px;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
.disabled{
|
|
||||||
|
.disabled {
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
const req = require.context('../../icons/svg', false, /\.svg$/)
|
const req = require.context('../../icons/svg', false, /\.svg$/)
|
||||||
const requireAll = requireContext => requireContext.keys()
|
const requireAll = requireContext => requireContext.keys()
|
||||||
|
|
||||||
|
@@ -19,9 +19,9 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column min-width="300px" label="Title">
|
<el-table-column min-width="300px" label="Title">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="{row}">
|
||||||
<span>{{ scope.row.title }}</span>
|
<span>{{ row.title }}</span>
|
||||||
<el-tag>{{ scope.row.type }}</el-tag>
|
<el-tag>{{ row.type }}</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
@@ -44,9 +44,9 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column class-name="status-col" label="Status" width="110">
|
<el-table-column class-name="status-col" label="Status" width="110">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="{row}">
|
||||||
<el-tag :type="scope.row.status | statusFilter">
|
<el-tag :type="row.status | statusFilter">
|
||||||
{{ scope.row.status }}
|
{{ row.status }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@@ -46,9 +46,9 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :label="$t('table.title')" min-width="150px">
|
<el-table-column :label="$t('table.title')" min-width="150px">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="{row}">
|
||||||
<span class="link-type" @click="handleUpdate(scope.row)">{{ scope.row.title }}</span>
|
<span class="link-type" @click="handleUpdate(row)">{{ row.title }}</span>
|
||||||
<el-tag>{{ scope.row.type | typeFilter }}</el-tag>
|
<el-tag>{{ row.type | typeFilter }}</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :label="$t('table.author')" width="110px" align="center">
|
<el-table-column :label="$t('table.author')" width="110px" align="center">
|
||||||
@@ -67,30 +67,30 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :label="$t('table.readings')" align="center" width="95">
|
<el-table-column :label="$t('table.readings')" align="center" width="95">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="{row}">
|
||||||
<span v-if="scope.row.pageviews" class="link-type" @click="handleFetchPv(scope.row.pageviews)">{{ scope.row.pageviews }}</span>
|
<span v-if="row.pageviews" class="link-type" @click="handleFetchPv(row.pageviews)">{{ row.pageviews }}</span>
|
||||||
<span v-else>0</span>
|
<span v-else>0</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :label="$t('table.status')" class-name="status-col" width="100">
|
<el-table-column :label="$t('table.status')" class-name="status-col" width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="{row}">
|
||||||
<el-tag :type="scope.row.status | statusFilter">
|
<el-tag :type="row.status | statusFilter">
|
||||||
{{ scope.row.status }}
|
{{ row.status }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :label="$t('table.actions')" align="center" width="230" class-name="small-padding fixed-width">
|
<el-table-column :label="$t('table.actions')" align="center" width="230" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="{row}">
|
||||||
<el-button type="primary" size="mini" @click="handleUpdate(scope.row)">
|
<el-button type="primary" size="mini" @click="handleUpdate(row)">
|
||||||
{{ $t('table.edit') }}
|
{{ $t('table.edit') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-if="scope.row.status!='published'" size="mini" type="success" @click="handleModifyStatus(scope.row,'published')">
|
<el-button v-if="row.status!='published'" size="mini" type="success" @click="handleModifyStatus(row,'published')">
|
||||||
{{ $t('table.publish') }}
|
{{ $t('table.publish') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-if="scope.row.status!='draft'" size="mini" @click="handleModifyStatus(scope.row,'draft')">
|
<el-button v-if="row.status!='draft'" size="mini" @click="handleModifyStatus(row,'draft')">
|
||||||
{{ $t('table.draft') }}
|
{{ $t('table.draft') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-if="scope.row.status!='deleted'" size="mini" type="danger" @click="handleModifyStatus(scope.row,'deleted')">
|
<el-button v-if="row.status!='deleted'" size="mini" type="danger" @click="handleModifyStatus(row,'deleted')">
|
||||||
{{ $t('table.delete') }}
|
{{ $t('table.delete') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
@@ -39,9 +39,9 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column class-name="status-col" label="Status" width="110">
|
<el-table-column class-name="status-col" label="Status" width="110">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="{row}">
|
||||||
<el-tag :type="scope.row.status | statusFilter">
|
<el-tag :type="row.status | statusFilter">
|
||||||
{{ scope.row.status }}
|
{{ row.status }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -54,10 +54,10 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
<!-- $t is vue-i18n global function to translate lang (lang in @/lang) -->
|
<!-- $t is vue-i18n global function to translate lang (lang in @/lang) -->
|
||||||
<div class="show-d">
|
<div class="show-d">
|
||||||
{{ $t('table.dragTips1') }} : {{ oldList }}
|
<el-tag style="margin-right:12px;">{{ $t('table.dragTips1') }} :</el-tag> {{ oldList }}
|
||||||
</div>
|
</div>
|
||||||
<div class="show-d">
|
<div class="show-d">
|
||||||
{{ $t('table.dragTips2') }} : {{ newList }}
|
<el-tag>{{ $t('table.dragTips2') }} :</el-tag> {{ newList }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -113,9 +113,9 @@ export default {
|
|||||||
this.sortable = Sortable.create(el, {
|
this.sortable = Sortable.create(el, {
|
||||||
ghostClass: 'sortable-ghost', // Class name for the drop placeholder,
|
ghostClass: 'sortable-ghost', // Class name for the drop placeholder,
|
||||||
setData: function(dataTransfer) {
|
setData: function(dataTransfer) {
|
||||||
dataTransfer.setData('Text', '')
|
|
||||||
// to avoid Firefox bug
|
// to avoid Firefox bug
|
||||||
// Detail see : https://github.com/RubaXa/Sortable/issues/1012
|
// Detail see : https://github.com/RubaXa/Sortable/issues/1012
|
||||||
|
dataTransfer.setData('Text', '')
|
||||||
},
|
},
|
||||||
onEnd: evt => {
|
onEnd: evt => {
|
||||||
const targetRow = this.list.splice(evt.oldIndex, 1)[0]
|
const targetRow = this.list.splice(evt.oldIndex, 1)[0]
|
||||||
|
@@ -26,31 +26,31 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column class-name="status-col" label="Status" width="110">
|
<el-table-column class-name="status-col" label="Status" width="110">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="{row}">
|
||||||
<el-tag :type="scope.row.status | statusFilter">
|
<el-tag :type="row.status | statusFilter">
|
||||||
{{ scope.row.status }}
|
{{ row.status }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column min-width="300px" label="Title">
|
<el-table-column min-width="300px" label="Title">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="{row}">
|
||||||
<template v-if="scope.row.edit">
|
<template v-if="row.edit">
|
||||||
<el-input v-model="scope.row.title" class="edit-input" size="small" />
|
<el-input v-model="row.title" class="edit-input" size="small" />
|
||||||
<el-button class="cancel-btn" size="small" icon="el-icon-refresh" type="warning" @click="cancelEdit(scope.row)">
|
<el-button class="cancel-btn" size="small" icon="el-icon-refresh" type="warning" @click="cancelEdit(row)">
|
||||||
cancel
|
cancel
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
<span v-else>{{ scope.row.title }}</span>
|
<span v-else>{{ row.title }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column align="center" label="Actions" width="120">
|
<el-table-column align="center" label="Actions" width="120">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="{row}">
|
||||||
<el-button v-if="scope.row.edit" type="success" size="small" icon="el-icon-circle-check-outline" @click="confirmEdit(scope.row)">
|
<el-button v-if="row.edit" type="success" size="small" icon="el-icon-circle-check-outline" @click="confirmEdit(row)">
|
||||||
Ok
|
Ok
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-else type="primary" size="small" icon="el-icon-edit" @click="scope.row.edit=!scope.row.edit">
|
<el-button v-else type="primary" size="small" icon="el-icon-edit" @click="row.edit=!row.edit">
|
||||||
Edit
|
Edit
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
<!-- $t is vue-i18n global function to translate lang -->
|
<!-- $t is vue-i18n global function to translate lang -->
|
||||||
<el-input v-model="filename" :placeholder="$t('zip.placeholder')" style="width:300px;" prefix-icon="el-icon-document" />
|
<el-input v-model="filename" :placeholder="$t('zip.placeholder')" style="width:300px;" prefix-icon="el-icon-document" />
|
||||||
<el-button :loading="downloadLoading" style="margin-bottom:20px;" type="primary" icon="document" @click="handleDownload">
|
<el-button :loading="downloadLoading" style="margin-bottom:20px;" type="primary" icon="document" @click="handleDownload">
|
||||||
{{ $t('zip.export') }} zip
|
{{ $t('zip.export') }} Zip
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-table v-loading="listLoading" :data="list" element-loading-text="拼命加载中" border fit highlight-current-row>
|
<el-table v-loading="listLoading" :data="list" element-loading-text="拼命加载中" border fit highlight-current-row>
|
||||||
<el-table-column align="center" label="ID" width="95">
|
<el-table-column align="center" label="ID" width="95">
|
||||||
|
@@ -21,7 +21,7 @@ module.exports = {
|
|||||||
publicPath: '/',
|
publicPath: '/',
|
||||||
outputDir: 'dist',
|
outputDir: 'dist',
|
||||||
assetsDir: 'static',
|
assetsDir: 'static',
|
||||||
lintOnSave: process.env.NODE_ENV === 'development' ? 'error' : false,
|
lintOnSave: process.env.NODE_ENV === 'development',
|
||||||
productionSourceMap: false,
|
productionSourceMap: false,
|
||||||
devServer: {
|
devServer: {
|
||||||
port: port,
|
port: port,
|
||||||
@@ -41,22 +41,7 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
after(app) {
|
after: require('./mock/mock-server.js')
|
||||||
require('@babel/register')
|
|
||||||
const bodyParser = require('body-parser')
|
|
||||||
|
|
||||||
// parse app.body
|
|
||||||
// http://expressjs.com/en/4x/api.html#req.body
|
|
||||||
app.use(bodyParser.json())
|
|
||||||
app.use(bodyParser.urlencoded({
|
|
||||||
extended: true
|
|
||||||
}))
|
|
||||||
|
|
||||||
const { default: mocks } = require('./mock')
|
|
||||||
for (const mock of mocks) {
|
|
||||||
app[mock.type](mock.url, mock.response)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
configureWebpack: {
|
configureWebpack: {
|
||||||
// provide the app's title in webpack's name field, so that
|
// provide the app's title in webpack's name field, so that
|
||||||
@@ -129,7 +114,7 @@ module.exports = {
|
|||||||
elementUI: {
|
elementUI: {
|
||||||
name: 'chunk-elementUI', // split elementUI into a single package
|
name: 'chunk-elementUI', // split elementUI into a single package
|
||||||
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
|
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
|
||||||
test: /[\\/]node_modules[\\/]element-ui[\\/]/
|
test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
|
||||||
},
|
},
|
||||||
commons: {
|
commons: {
|
||||||
name: 'chunk-commons',
|
name: 'chunk-commons',
|
||||||
|
Reference in New Issue
Block a user