Merge branch 'master' into deploy

This commit is contained in:
Pan 2018-09-07 17:58:59 +08:00
commit 0a65f69cef
42 changed files with 150 additions and 114 deletions

View File

@ -50,6 +50,7 @@ It is a magical vue admin based on the newest development stack of vue, built-in
- Base template recommends using: [vue-admin-template](https://github.com/PanJiaChen/vue-admin-template) - Base template recommends using: [vue-admin-template](https://github.com/PanJiaChen/vue-admin-template)
- Desktop: [electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin) - Desktop: [electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin)
- Typescript: [vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template) (Credits: [@Armour](https://github.com/Armour))
**This project does not support low version browsers (e.g. IE). Please add polyfill yourself if you need them.** **This project does not support low version browsers (e.g. IE). Please add polyfill yourself if you need them.**
@ -128,7 +129,7 @@ Understanding and learning this knowledge in advance will greatly help the use o
- Error Log - Error Log
- Dashboard - Dashboard
- Guide Page - Guide Page
- Echarts - ECharts
- Clipboard - Clipboard
- Markdown to html - Markdown to html
``` ```

View File

@ -50,6 +50,7 @@
- 模板建议使用: [vue-admin-template](https://github.com/PanJiaChen/vue-admin-template) - 模板建议使用: [vue-admin-template](https://github.com/PanJiaChen/vue-admin-template)
- 桌面端: [electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin) - 桌面端: [electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin)
- Typescript版: [vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template) (鸣谢: [@Armour](https://github.com/Armour))
群主 **[圈子](https://jianshiapp.com/circles/1209)** 楼主会经常分享一些技术相关的东西,或者加入[qq 群](https://github.com/PanJiaChen/vue-element-admin/issues/602) 群主 **[圈子](https://jianshiapp.com/circles/1209)** 楼主会经常分享一些技术相关的东西,或者加入[qq 群](https://github.com/PanJiaChen/vue-element-admin/issues/602)
@ -140,7 +141,7 @@
- 错误日志 - 错误日志
- Dashboard - Dashboard
- 引导页 - 引导页
- Echarts 图表 - ECharts 图表
- Clipboard(剪贴复制) - Clipboard(剪贴复制)
- Markdown2html - Markdown2html
``` ```
@ -154,7 +155,7 @@ git clone https://github.com/PanJiaChen/vue-element-admin.git
# 安装依赖 # 安装依赖
npm install npm install
# 建议不要用cnpm安装 会有各种诡异的bug 可以通过如下操作解决 npm 下载速度慢的问题 # 建议不要用 cnpm 安装 会有各种诡异的bug 可以通过如下操作解决 npm 下载速度慢的问题
npm install --registry=https://registry.npm.taobao.org npm install --registry=https://registry.npm.taobao.org
# 启动服务 # 启动服务

View File

@ -116,7 +116,7 @@ const webpackConfig = merge(baseWebpackConfig, {
test: /[\\/]node_modules[\\/]element-ui[\\/]/ test: /[\\/]node_modules[\\/]element-ui[\\/]/
}, },
commons: { commons: {
name: 'chunk-comomns', name: 'chunk-commons',
test: resolve('src/components'), // 可自定义拓展你的规则 test: resolve('src/components'), // 可自定义拓展你的规则
minChunks: 3, // 最小公用次数 minChunks: 3, // 最小公用次数
priority: 5, priority: 5,

View File

@ -50,7 +50,7 @@
"mockjs": "1.0.1-beta3", "mockjs": "1.0.1-beta3",
"normalize.css": "7.0.0", "normalize.css": "7.0.0",
"nprogress": "0.2.0", "nprogress": "0.2.0",
"screenfull": "3.3.2", "screenfull": "3.3.3",
"showdown": "1.8.6", "showdown": "1.8.6",
"simplemde": "1.11.2", "simplemde": "1.11.2",
"sortablejs": "1.7.0", "sortablejs": "1.7.0",
@ -86,7 +86,7 @@
"file-loader": "1.1.11", "file-loader": "1.1.11",
"friendly-errors-webpack-plugin": "1.7.0", "friendly-errors-webpack-plugin": "1.7.0",
"hash-sum": "1.0.2", "hash-sum": "1.0.2",
"html-webpack-plugin": "^4.0.0-alpha", "html-webpack-plugin": "4.0.0-alpha",
"husky": "0.14.3", "husky": "0.14.3",
"lint-staged": "7.2.2", "lint-staged": "7.2.2",
"mini-css-extract-plugin": "0.4.1", "mini-css-extract-plugin": "0.4.1",

View File

@ -56,6 +56,10 @@ export default {
this.chart.setOption( this.chart.setOption(
{ {
backgroundColor: '#08263a', backgroundColor: '#08263a',
grid: {
left: '5%',
right: '5%'
},
xAxis: [{ xAxis: [{
show: false, show: false,
data: xAxisData data: xAxisData

View File

@ -80,8 +80,8 @@ export default {
}, },
grid: { grid: {
top: 100, top: 100,
left: '3%', left: '2%',
right: '4%', right: '2%',
bottom: '2%', bottom: '2%',
containLabel: true containLabel: true
}, },

View File

@ -75,8 +75,10 @@ export default {
} }
}, },
grid: { grid: {
left: '5%',
right: '5%',
borderWidth: 0, borderWidth: 0,
top: 110, top: 150,
bottom: 95, bottom: 95,
textStyle: { textStyle: {
color: '#fff' color: '#fff'

View File

@ -2,14 +2,27 @@ import { debounce } from '@/utils'
export default { export default {
mounted() { mounted() {
this.__resizeHanlder = debounce(() => { this.__resizeHandler = debounce(() => {
if (this.chart) { if (this.chart) {
this.chart.resize() this.chart.resize()
} }
}, 100) }, 100)
window.addEventListener('resize', this.__resizeHanlder) window.addEventListener('resize', this.__resizeHandler)
const sidebarElm = document.getElementsByClassName('sidebar-container')[0]
sidebarElm.addEventListener('transitionend', this.sidebarResizeHandler)
}, },
beforeDestroy() { beforeDestroy() {
window.removeEventListener('resize', this.__resizeHanlder) window.removeEventListener('resize', this.__resizeHandler)
const sidebarElm = document.getElementsByClassName('sidebar-container')[0]
sidebarElm.removeEventListener('transitionend', this.sidebarResizeHandler)
},
methods: {
sidebarResizeHandler(e) {
if (e.propertyName === 'width') {
this.__resizeHandler()
}
}
} }
} }

View File

@ -49,7 +49,6 @@ export default {
this.$message('请等待所有图片上传成功 或 出现了网络问题,请刷新页面重新上传!') this.$message('请等待所有图片上传成功 或 出现了网络问题,请刷新页面重新上传!')
return return
} }
console.log(arr)
this.$emit('successCBK', arr) this.$emit('successCBK', arr)
this.listObj = {} this.listObj = {}
this.fileList = [] this.fileList = []

View File

@ -26,7 +26,7 @@ export default {
} }
}, },
methods: { methods: {
generateDate({ header, results }) { generateData({ header, results }) {
this.excelData.header = header this.excelData.header = header
this.excelData.results = results this.excelData.results = results
this.onSuccess && this.onSuccess(this.excelData) this.onSuccess && this.onSuccess(this.excelData)
@ -82,20 +82,20 @@ export default {
const reader = new FileReader() const reader = new FileReader()
reader.onload = e => { reader.onload = e => {
const data = e.target.result const data = e.target.result
const fixedData = this.fixdata(data) const fixedData = this.fixData(data)
const workbook = XLSX.read(btoa(fixedData), { type: 'base64' }) const workbook = XLSX.read(btoa(fixedData), { type: 'base64' })
const firstSheetName = workbook.SheetNames[0] const firstSheetName = workbook.SheetNames[0]
const worksheet = workbook.Sheets[firstSheetName] const worksheet = workbook.Sheets[firstSheetName]
const header = this.get_header_row(worksheet) const header = this.getHeaderRow(worksheet)
const results = XLSX.utils.sheet_to_json(worksheet) const results = XLSX.utils.sheet_to_json(worksheet)
this.generateDate({ header, results }) this.generateData({ header, results })
this.loading = false this.loading = false
resolve() resolve()
} }
reader.readAsArrayBuffer(rawFile) reader.readAsArrayBuffer(rawFile)
}) })
}, },
fixdata(data) { fixData(data) {
let o = '' let o = ''
let l = 0 let l = 0
const w = 10240 const w = 10240
@ -103,14 +103,16 @@ export default {
o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w))) o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w)))
return o return o
}, },
get_header_row(sheet) { getHeaderRow(sheet) {
const headers = [] const headers = []
const range = XLSX.utils.decode_range(sheet['!ref']) const range = XLSX.utils.decode_range(sheet['!ref'])
let C let C
const R = range.s.r /* start in the first row */ const R = range.s.r
/* start in the first row */
for (C = range.s.c; C <= range.e.c; ++C) { /* walk every column in the range */ for (C = range.s.c; C <= range.e.c; ++C) { /* walk every column in the range */
var cell = sheet[XLSX.utils.encode_cell({ c: C, r: R })] /* find the cell in the first row */ const cell = sheet[XLSX.utils.encode_cell({ c: C, r: R })]
var hdr = 'UNKNOWN ' + C // <-- replace with your desired default /* find the cell in the first row */
let hdr = 'UNKNOWN ' + C // <-- replace with your desired default
if (cell && cell.t) hdr = XLSX.utils.format_cell(cell) if (cell && cell.t) hdr = XLSX.utils.format_cell(cell)
headers.push(hdr) headers.push(hdr)
} }

View File

@ -1,7 +1,7 @@
// Inspired by https://github.com/Inndy/vue-clipboard2 // Inspired by https://github.com/Inndy/vue-clipboard2
const Clipboard = require('clipboard') const Clipboard = require('clipboard')
if (!Clipboard) { if (!Clipboard) {
throw new Error('you shold npm install `clipboard` --save at first ') throw new Error('you should npm install `clipboard` --save at first ')
} }
export default { export default {

View File

@ -20,7 +20,7 @@ export default{
const disY = e.clientY - dialogHeaderEl.offsetTop const disY = e.clientY - dialogHeaderEl.offsetTop
const dragDomWidth = dragDom.offsetWidth const dragDomWidth = dragDom.offsetWidth
const dragDomheight = dragDom.offsetHeight const dragDomHeight = dragDom.offsetHeight
const screenWidth = document.body.clientWidth const screenWidth = document.body.clientWidth
const screenHeight = document.body.clientHeight const screenHeight = document.body.clientHeight
@ -29,7 +29,7 @@ export default{
const maxDragDomLeft = screenWidth - dragDom.offsetLeft - dragDomWidth const maxDragDomLeft = screenWidth - dragDom.offsetLeft - dragDomWidth
const minDragDomTop = dragDom.offsetTop const minDragDomTop = dragDom.offsetTop
const maxDragDomTop = screenHeight - dragDom.offsetTop - dragDomheight const maxDragDomTop = screenHeight - dragDom.offsetTop - dragDomHeight
// 获取到的值带px 正则匹配替换 // 获取到的值带px 正则匹配替换
let styL = getStyle(dragDom, 'left') let styL = getStyle(dragDom, 'left')

View File

@ -6,7 +6,7 @@ export default{
const customOpts = Object.assign({}, binding.value) const customOpts = Object.assign({}, binding.value)
const opts = Object.assign({ const opts = Object.assign({
ele: el, // 波纹作用元素 ele: el, // 波纹作用元素
type: 'hit', // hit点击位置扩散center中心点扩展 type: 'hit', // hit 点击位置扩散 center中心点扩展
color: 'rgba(0, 0, 0, 0.15)' // 波纹颜色 color: 'rgba(0, 0, 0, 0.15)' // 波纹颜色
}, customOpts) }, customOpts)
const target = opts.ele const target = opts.ele

View File

@ -37,6 +37,6 @@ export function numberFormatter(num, digits) {
return num.toString() return num.toString()
} }
export function toThousandslsFilter(num) { export function toThousandFilter(num) {
return (+num || 0).toString().replace(/^-?\d+/g, m => m.replace(/(?=(?!\b)(\d{3})+$)/g, ',')) return (+num || 0).toString().replace(/^-?\d+/g, m => m.replace(/(?=(?!\b)(\d{3})+$)/g, ','))
} }

View File

@ -1,12 +1,9 @@
import Vue from 'vue' import Vue from 'vue'
import SvgIcon from '@/components/SvgIcon'// svg组件 import SvgIcon from '@/components/SvgIcon'// svg组件
import generateIconsView from '@/views/svg-icons/generateIconsView.js'// just for @/views/icons , you can delete it
// register globally // register globally
Vue.component('svg-icon', SvgIcon) Vue.component('svg-icon', SvgIcon)
const requireAll = requireContext => requireContext.keys().map(requireContext)
const req = require.context('./svg', false, /\.svg$/) const req = require.context('./svg', false, /\.svg$/)
const iconMap = requireAll(req) const requireAll = requireContext => requireContext.keys().map(requireContext)
requireAll(req)
generateIconsView.generate(iconMap) // just for @/views/icons , you can delete it

View File

@ -14,7 +14,7 @@ function hasPermission(roles, permissionRoles) {
return roles.some(role => permissionRoles.indexOf(role) >= 0) return roles.some(role => permissionRoles.indexOf(role) >= 0)
} }
const whiteList = ['/login', '/authredirect']// no redirect whitelist const whiteList = ['/login', '/auth-redirect']// no redirect whitelist
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
NProgress.start() // start progress bar NProgress.start() // start progress bar
@ -52,7 +52,7 @@ router.beforeEach((to, from, next) => {
if (whiteList.indexOf(to.path) !== -1) { // 在免登录白名单,直接进入 if (whiteList.indexOf(to.path) !== -1) { // 在免登录白名单,直接进入
next() next()
} else { } else {
next('/login') // 否则全部重定向到登录页 next(`/login?redirect=${to.path}`) // 否则全部重定向到登录页
NProgress.done() // if current page is login will not trigger afterEach hook, so manually handle it NProgress.done() // if current page is login will not trigger afterEach hook, so manually handle it
} }
} }

View File

@ -12,7 +12,7 @@ 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: submenu only apppear when children.length>=1 /** note: Submenu only appear when children.length>=1
* detail see https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html * detail see https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
**/ **/
@ -21,7 +21,7 @@ import nestedRouter from './modules/nested'
* alwaysShow: true if set true, will always show the root menu, whatever its child routes length * alwaysShow: true if set true, will always show the root menu, whatever its child routes length
* if not set alwaysShow, only more than one route under the children * if not set alwaysShow, only more than one route under the children
* it will becomes nested mode, otherwise not show the root menu * it will becomes nested mode, otherwise not show the root menu
* redirect: noredirect if `redirect:noredirect` will no redirct in the breadcrumb * redirect: noredirect if `redirect:noredirect` will no redirect in the breadcrumb
* name:'router-name' the name is used by <keep-alive> (must set!!!) * name:'router-name' the name is used by <keep-alive> (must set!!!)
* meta : { * meta : {
roles: ['admin','editor'] will control the page roles (you can set multiple roles) roles: ['admin','editor'] will control the page roles (you can set multiple roles)
@ -48,7 +48,7 @@ export const constantRouterMap = [
hidden: true hidden: true
}, },
{ {
path: '/authredirect', path: '/auth-redirect',
component: () => import('@/views/login/authredirect'), component: () => import('@/views/login/authredirect'),
hidden: true hidden: true
}, },

View File

@ -23,7 +23,6 @@ const tagsView = {
for (const [i, v] of state.visitedViews.entries()) { for (const [i, v] of state.visitedViews.entries()) {
if (v.path === view.path) { if (v.path === view.path) {
state.visitedViews.splice(i, 1) state.visitedViews.splice(i, 1)
console.log('1')
break break
} }
} }

View File

@ -28,6 +28,9 @@
height: 100%; height: 100%;
} }
} }
.el-scrollbar__bar.is-vertical{
right: 0px;
}
.is-horizontal { .is-horizontal {
display: none; display: none;
} }

View File

@ -169,7 +169,6 @@ export function scrollTo(element, to, duration) {
const difference = to - element.scrollTop const difference = to - element.scrollTop
const perTick = (difference / duration) * 10 const perTick = (difference / duration) * 10
setTimeout(() => { setTimeout(() => {
console.log(new Date())
element.scrollTop = element.scrollTop + perTick element.scrollTop = element.scrollTop + perTick
if (element.scrollTop === to) return if (element.scrollTop === to) return
scrollTo(element, to, duration - 10) scrollTo(element, to, duration - 10)

View File

@ -5,7 +5,7 @@ import { getToken } from '@/utils/auth'
// create an axios instance // create an axios instance
const service = axios.create({ const service = axios.create({
baseURL: process.env.BASE_API, // api的base_url baseURL: process.env.BASE_API, // api base_url
timeout: 5000 // request timeout timeout: 5000 // request timeout
}) })
@ -26,13 +26,13 @@ service.interceptors.request.use(
} }
) )
// respone interceptor // response interceptor
service.interceptors.response.use( service.interceptors.response.use(
response => response, response => response,
/** /**
* 下面的注释为通过在response里自定义code来标示请求状态 * 下面的注释为通过在response里自定义code来标示请求状态
* 当code返回如下情况则说明权限有问题登出并返回到登录页 * 当code返回如下情况则说明权限有问题登出并返回到登录页
* 如想通过xmlhttprequest来状态码标识 逻辑可写在下面error中 * 如想通过 xmlhttprequest 来状态码标识 逻辑可写在下面error中
* 以下代码均为样例请结合自生需求加以修改若不需要则可删除 * 以下代码均为样例请结合自生需求加以修改若不需要则可删除
*/ */
// response => { // response => {

View File

@ -16,9 +16,8 @@ export default {
<style scoped> <style scoped>
.chart-container{ .chart-container{
position: relative; position: relative;
padding: 20px;
width: 100%; width: 100%;
height: 85vh; height: calc(100vh - 84px);
} }
</style> </style>

View File

@ -16,9 +16,8 @@ export default {
<style scoped> <style scoped>
.chart-container{ .chart-container{
position: relative; position: relative;
padding:20px;
width: 100%; width: 100%;
height:85vh; height: calc(100vh - 84px);
} }
</style> </style>

View File

@ -16,9 +16,8 @@ export default {
<style scoped> <style scoped>
.chart-container{ .chart-container{
position: relative; position: relative;
padding: 20px;
width: 100%; width: 100%;
height:85vh; height: calc(100vh - 84px);
} }
</style> </style>

View File

@ -2,11 +2,11 @@
<div class="app-container"> <div class="app-container">
<el-tabs v-model="activeName"> <el-tabs v-model="activeName">
<el-tab-pane label="use clipboard directly" name="directly"> <el-tab-pane label="use clipboard directly" name="directly">
<el-input v-model="inputData" placeholder="Please input" style="width:400px;"/> <el-input v-model="inputData" placeholder="Please input" style="width:400px;max-width:100%;"/>
<el-button type="primary" icon="document" @click="handleCopy(inputData,$event)">copy</el-button> <el-button type="primary" icon="document" @click="handleCopy(inputData,$event)">copy</el-button>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="use clipboard by v-directive" name="v-directive"> <el-tab-pane label="use clipboard by v-directive" name="v-directive">
<el-input v-model="inputData" placeholder="Please input" style="width:400px;"/> <el-input v-model="inputData" placeholder="Please input" style="width:400px;max-width:100%;"/>
<el-button v-clipboard:copy="inputData" v-clipboard:success="clipboardSuccess" type="primary" icon="document">copy</el-button> <el-button v-clipboard:copy="inputData" v-clipboard:success="clipboardSuccess" type="primary" icon="document">copy</el-button>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>

View File

@ -31,18 +31,18 @@ export default {
}, },
mounted() { mounted() {
this.initChart() this.initChart()
this.__resizeHanlder = debounce(() => { this.__resizeHandler = debounce(() => {
if (this.chart) { if (this.chart) {
this.chart.resize() this.chart.resize()
} }
}, 100) }, 100)
window.addEventListener('resize', this.__resizeHanlder) window.addEventListener('resize', this.__resizeHandler)
}, },
beforeDestroy() { beforeDestroy() {
if (!this.chart) { if (!this.chart) {
return return
} }
window.removeEventListener('resize', this.__resizeHanlder) window.removeEventListener('resize', this.__resizeHandler)
this.chart.dispose() this.chart.dispose()
this.chart = null this.chart = null
}, },

View File

@ -46,33 +46,38 @@ export default {
mounted() { mounted() {
this.initChart() this.initChart()
if (this.autoResize) { if (this.autoResize) {
this.__resizeHanlder = debounce(() => { this.__resizeHandler = debounce(() => {
if (this.chart) { if (this.chart) {
this.chart.resize() this.chart.resize()
} }
}, 100) }, 100)
window.addEventListener('resize', this.__resizeHanlder) window.addEventListener('resize', this.__resizeHandler)
} }
// //
const sidebarElm = document.getElementsByClassName('sidebar-container')[0] const sidebarElm = document.getElementsByClassName('sidebar-container')[0]
sidebarElm.addEventListener('transitionend', this.__resizeHanlder) sidebarElm.addEventListener('transitionend', this.sidebarResizeHandler)
}, },
beforeDestroy() { beforeDestroy() {
if (!this.chart) { if (!this.chart) {
return return
} }
if (this.autoResize) { if (this.autoResize) {
window.removeEventListener('resize', this.__resizeHanlder) window.removeEventListener('resize', this.__resizeHandler)
} }
const sidebarElm = document.getElementsByClassName('sidebar-container')[0] const sidebarElm = document.getElementsByClassName('sidebar-container')[0]
sidebarElm.removeEventListener('transitionend', this.__resizeHanlder) sidebarElm.removeEventListener('transitionend', this.sidebarResizeHandler)
this.chart.dispose() this.chart.dispose()
this.chart = null this.chart = null
}, },
methods: { methods: {
sidebarResizeHandler(e) {
if (e.propertyName === 'width') {
this.__resizeHandler()
}
},
setOptions({ expectedData, actualData } = {}) { setOptions({ expectedData, actualData } = {}) {
this.chart.setOption({ this.chart.setOption({
xAxis: { xAxis: {

View File

@ -29,18 +29,18 @@ export default {
}, },
mounted() { mounted() {
this.initChart() this.initChart()
this.__resizeHanlder = debounce(() => { this.__resizeHandler = debounce(() => {
if (this.chart) { if (this.chart) {
this.chart.resize() this.chart.resize()
} }
}, 100) }, 100)
window.addEventListener('resize', this.__resizeHanlder) window.addEventListener('resize', this.__resizeHandler)
}, },
beforeDestroy() { beforeDestroy() {
if (!this.chart) { if (!this.chart) {
return return
} }
window.removeEventListener('resize', this.__resizeHanlder) window.removeEventListener('resize', this.__resizeHandler)
this.chart.dispose() this.chart.dispose()
this.chart = null this.chart = null
}, },

View File

@ -31,18 +31,18 @@ export default {
}, },
mounted() { mounted() {
this.initChart() this.initChart()
this.__resizeHanlder = debounce(() => { this.__resizeHandler = debounce(() => {
if (this.chart) { if (this.chart) {
this.chart.resize() this.chart.resize()
} }
}, 100) }, 100)
window.addEventListener('resize', this.__resizeHanlder) window.addEventListener('resize', this.__resizeHandler)
}, },
beforeDestroy() { beforeDestroy() {
if (!this.chart) { if (!this.chart) {
return return
} }
window.removeEventListener('resize', this.__resizeHanlder) window.removeEventListener('resize', this.__resizeHandler)
this.chart.dispose() this.chart.dispose()
this.chart = null this.chart = null
}, },

View File

@ -7,7 +7,7 @@
</el-table-column> </el-table-column>
<el-table-column label="Price" width="195" align="center"> <el-table-column label="Price" width="195" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
¥{{ scope.row.price | toThousandslsFilter }} ¥{{ scope.row.price | toThousandFilter }}
</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">

View File

@ -35,7 +35,6 @@ export default {
.document-btn { .document-btn {
float: left; float: left;
margin-left: 50px; margin-left: 50px;
vertical-align: middle;
display: block; display: block;
cursor: pointer; cursor: pointer;
background: black; background: black;

View File

@ -53,6 +53,7 @@ export default {
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
.errPage-container { .errPage-container {
width: 800px; width: 800px;
max-width: 100%;
margin: 100px auto; margin: 100px auto;
.pan-back-btn { .pan-back-btn {
background: #008489; background: #008489;

View File

@ -15,7 +15,7 @@
</el-card> </el-card>
<el-row :gutter="20" style="margin:100px 15px 50px;"> <el-row :gutter="20" style="margin:100px 15px 50px;">
<el-col :span="12"> <el-col :span="12" :xs="24">
<div class="block"> <div class="block">
<el-date-picker v-model="date" :placeholder="$t('i18nView.datePlaceholder')" type="date"/> <el-date-picker v-model="date" :placeholder="$t('i18nView.datePlaceholder')" type="date"/>
</div> </div>
@ -37,7 +37,7 @@
<el-button class="item-btn" size="small" type="danger">{{ $t('i18nView.danger') }}</el-button> <el-button class="item-btn" size="small" type="danger">{{ $t('i18nView.danger') }}</el-button>
</div> </div>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12" :xs="24">
<el-table :data="tableData" fit highlight-current-row border style="width: 100%"> <el-table :data="tableData" fit highlight-current-row border style="width: 100%">
<el-table-column :label="$t('i18nView.tableName')" prop="name" width="100" align="center"/> <el-table-column :label="$t('i18nView.tableName')" prop="name" width="100" align="center"/>
<el-table-column :label="$t('i18nView.tableDate')" prop="date" width="120" align="center"/> <el-table-column :label="$t('i18nView.tableDate')" prop="date" width="120" align="center"/>
@ -103,6 +103,7 @@ export default {
<style scoped> <style scoped>
.box-card { .box-card {
width: 600px; width: 600px;
max-width: 100%;
margin: 20px auto; margin: 20px auto;
} }
.item-btn{ .item-btn{

View File

@ -26,6 +26,7 @@ export default {
.app-main { .app-main {
/*84 = navbar + tags-view = 50 +34 */ /*84 = navbar + tags-view = 50 +34 */
min-height: calc(100vh - 84px); min-height: calc(100vh - 84px);
width: 100%;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
} }

View File

@ -1,10 +1,11 @@
<template> <template>
<el-menu class="navbar" mode="horizontal"> <div class="navbar">
<hamburger :toggle-click="toggleSideBar" :is-active="sidebar.opened" class="hamburger-container"/> <hamburger :toggle-click="toggleSideBar" :is-active="sidebar.opened" class="hamburger-container"/>
<breadcrumb class="breadcrumb-container"/> <breadcrumb class="breadcrumb-container"/>
<div class="right-menu"> <div class="right-menu">
<template v-if="device!=='mobile'">
<error-log class="errLog-container right-menu-item"/> <error-log class="errLog-container right-menu-item"/>
<el-tooltip :content="$t('navbar.screenfull')" effect="dark" placement="bottom"> <el-tooltip :content="$t('navbar.screenfull')" effect="dark" placement="bottom">
@ -20,6 +21,7 @@
<el-tooltip :content="$t('navbar.theme')" effect="dark" placement="bottom"> <el-tooltip :content="$t('navbar.theme')" effect="dark" placement="bottom">
<theme-picker class="theme-switch right-menu-item"/> <theme-picker class="theme-switch right-menu-item"/>
</el-tooltip> </el-tooltip>
</template>
<el-dropdown class="avatar-container right-menu-item" trigger="click"> <el-dropdown class="avatar-container right-menu-item" trigger="click">
<div class="avatar-wrapper"> <div class="avatar-wrapper">
@ -43,7 +45,7 @@
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</div> </div>
</el-menu> </div>
</template> </template>
<script> <script>
@ -70,7 +72,8 @@ export default {
...mapGetters([ ...mapGetters([
'sidebar', 'sidebar',
'name', 'name',
'avatar' 'avatar',
'device'
]) ])
}, },
methods: { methods: {

View File

@ -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)
window.opener.location.href = window.location.origin + '/login#' + hash window.opener.location.href = window.location.origin + '/login#' + hash

View File

@ -96,9 +96,19 @@ export default {
}, },
passwordType: 'password', passwordType: 'password',
loading: false, loading: false,
showDialog: false showDialog: false,
redirect: undefined
} }
}, },
watch: {
$route: {
handler: function(route) {
this.redirect = route.query && route.query.redirect
},
immediate: true
}
},
created() { created() {
// window.addEventListener('hashchange', this.afterQRScan) // window.addEventListener('hashchange', this.afterQRScan)
}, },
@ -119,7 +129,7 @@ export default {
this.loading = true this.loading = true
this.$store.dispatch('LoginByUsername', this.loginForm).then(() => { this.$store.dispatch('LoginByUsername', this.loginForm).then(() => {
this.loading = false this.loading = false
this.$router.push({ path: '/' }) this.$router.push({ path: this.redirect || '/' })
}).catch(() => { }).catch(() => {
this.loading = false this.loading = false
}) })
@ -213,6 +223,7 @@ $light_gray:#eee;
left: 0; left: 0;
right: 0; right: 0;
width: 520px; width: 520px;
max-width: 100%;
padding: 35px 35px 15px 35px; padding: 35px 35px 15px 35px;
margin: 120px auto; margin: 120px auto;
} }

View File

@ -10,24 +10,26 @@
</template> </template>
<script> <script>
import openWindow from '@/utils/openWindow' // import openWindow from '@/utils/openWindow'
export default { export default {
name: 'SocialSignin', name: 'SocialSignin',
methods: { methods: {
wechatHandleClick(thirdpart) { wechatHandleClick(thirdpart) {
this.$store.commit('SET_AUTH_TYPE', thirdpart) alert('ok')
const appid = 'xxxxx' // this.$store.commit('SET_AUTH_TYPE', thirdpart)
const redirect_uri = encodeURIComponent('xxx/redirect?redirect=' + window.location.origin + '/authredirect') // const appid = 'xxxxx'
const url = 'https://open.weixin.qq.com/connect/qrconnect?appid=' + appid + '&redirect_uri=' + redirect_uri + '&response_type=code&scope=snsapi_login#wechat_redirect' // const redirect_uri = encodeURIComponent('xxx/redirect?redirect=' + window.location.origin + '/auth-redirect')
openWindow(url, thirdpart, 540, 540) // const url = 'https://open.weixin.qq.com/connect/qrconnect?appid=' + appid + '&redirect_uri=' + redirect_uri + '&response_type=code&scope=snsapi_login#wechat_redirect'
// openWindow(url, thirdpart, 540, 540)
}, },
tencentHandleClick(thirdpart) { tencentHandleClick(thirdpart) {
this.$store.commit('SET_AUTH_TYPE', thirdpart) alert('ok')
const client_id = 'xxxxx' // this.$store.commit('SET_AUTH_TYPE', thirdpart)
const redirect_uri = encodeURIComponent('xxx/redirect?redirect=' + window.location.origin + '/authredirect') // const client_id = 'xxxxx'
const url = 'https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=' + client_id + '&redirect_uri=' + redirect_uri // const redirect_uri = encodeURIComponent('xxx/redirect?redirect=' + window.location.origin + '/auth-redirect')
openWindow(url, thirdpart, 540, 540) // const url = 'https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=' + client_id + '&redirect_uri=' + redirect_uri
// openWindow(url, thirdpart, 540, 540)
} }
} }
} }

View File

@ -1,10 +0,0 @@
const data = {
state: {
iconsMap: []
},
generate(iconsMap) {
this.state.iconsMap = iconsMap
}
}
export default data

View File

@ -21,22 +21,16 @@
</template> </template>
<script> <script>
import icons from './generateIconsView' import icons from './requireIcons'
import clipboard from '@/utils/clipboard' import clipboard from '@/utils/clipboard'
export default { export default {
name: 'Icons', name: 'Icons',
data() { data() {
return { return {
iconsMap: [] iconsMap: icons
} }
}, },
mounted() {
const iconsMap = icons.state.iconsMap.map((i) => {
return i.default.id.split('-')[1]
})
this.iconsMap = iconsMap
},
methods: { methods: {
generateIconCode(symbol) { generateIconCode(symbol) {
return `<svg-icon icon-class="${symbol}" />` return `<svg-icon icon-class="${symbol}" />`

View File

@ -0,0 +1,11 @@
const req = require.context('../../icons/svg', false, /\.svg$/)
const requireAll = requireContext => requireContext.keys()
const re = /\.\/(.*)\.svg/
const icons = requireAll(req).map(i => {
return i.match(re)[1]
})
export default icons

View File

@ -87,6 +87,7 @@ export default {
} }
.box-card { .box-card {
width: 400px; width: 400px;
max-width: 100%;
margin: 20px auto; margin: 20px auto;
} }