删除示例页,关闭多语言,关闭错误日志收集
This commit is contained in:
zhigang.li@tendcloud.com 2018-11-02 10:25:59 +08:00
parent dca0c1343f
commit 1d06fb3a01
26 changed files with 8 additions and 1713 deletions

View File

@ -8,7 +8,7 @@ export default {
* 如果不使用则需要在路由中给需要在菜单中展示的路由设置meta: {title: 'xxx'}
* 用来在菜单中显示文字
*/
useI18n: true,
useI18n: false,
/**
* @description api请求基础路径
*/
@ -24,9 +24,9 @@ export default {
* @description 需要加载的插件
*/
plugin: {
'error-store': {
showInHeader: true, // 设为false后不会在顶部显示错误日志徽标
developmentOff: false // 设为true后在开发环境不会收集错误信息方便开发中排查错误
}
// 'error-store': {
// showInHeader: true, // 设为false后不会在顶部显示错误日志徽标
// developmentOff: false // 设为true后在开发环境不会收集错误信息方便开发中排查错误
// }
}
}

View File

@ -197,7 +197,6 @@ export const getNextRoute = (list, route) => {
res = getHomeRoute(list)
} else {
const index = list.findIndex(item => routeEqual(item, route))
console.log(route, index, list.length)
if (index === list.length - 1) res = list[list.length - 2]
else res = list[index + 1]
}

View File

@ -1,50 +0,0 @@
import Main from '@/view/main'
import parentView from '@/components/main/parent-view'
export default [
{
path: '/login',
name: 'login',
meta: {
title: 'Login - 登录'
},
component: () => import('@/view/login/login.vue')
},
{
path: '/',
name: 'index',
// redirect: '/home',
component: Main,
children: [
{
path: 'home',
name: 'home',
component: () => import('@/view/single-page/home')
},
{
path: 'multilevel',
name: 'multilevel',
component: parentView,
children: [
{
path: 'level_1',
name: 'level_1',
component: () => import('@/view/multilevel/level-1.vue')
},
{
path: 'level_2',
name: 'level_2',
component: parentView,
children: [
{
path: 'level_2_1',
name: 'level_2_1',
component: () => import('@/view/multilevel/level-2/level-2-1.vue')
}
]
}
]
}
]
}
]

View File

@ -36,7 +36,6 @@ router.beforeEach((to, from, next) => {
name: homeName // 跳转到homeName页
})
} else {
console.log(store.state.user.hasGetInfo)
if (store.state.user.hasGetInfo) {
turnTo(to, store.state.user.access, next)
} else {

View File

@ -58,251 +58,6 @@ export default [
icon: 'ios-book'
}
},
{
path: '/join',
name: 'join',
component: Main,
children: [
{
path: 'join_page',
name: 'join_page',
meta: {
icon: '_qq',
title: 'QQ群'
},
component: () => import('@/view/join-page.vue')
}
]
},
{
path: '/components',
name: 'components',
meta: {
icon: 'logo-buffer',
title: '组件'
},
component: Main,
children: [
{
path: 'count_to_page',
name: 'count_to_page',
meta: {
icon: 'md-trending-up',
title: '数字渐变'
},
component: () => import('@/view/components/count-to/count-to.vue')
},
{
path: 'drag_list_page',
name: 'drag_list_page',
meta: {
icon: 'ios-infinite',
title: '拖拽列表'
},
component: () => import('@/view/components/drag-list/drag-list.vue')
},
{
path: 'tables_page',
name: 'tables_page',
meta: {
icon: 'md-grid',
title: '多功能表格'
},
component: () => import('@/view/components/tables/tables.vue')
},
{
path: 'split_pane_page',
name: 'split_pane_page',
meta: {
icon: 'md-pause',
title: '分割窗口'
},
component: () => import('@/view/components/split-pane/split-pane.vue')
},
{
path: 'markdown_page',
name: 'markdown_page',
meta: {
icon: 'logo-markdown',
title: 'Markdown编辑器'
},
component: () => import('@/view/components/markdown/markdown.vue')
},
{
path: 'editor_page',
name: 'editor_page',
meta: {
icon: 'ios-create',
title: '富文本编辑器'
},
component: () => import('@/view/components/editor/editor.vue')
},
{
path: 'icons_page',
name: 'icons_page',
meta: {
icon: '_bear',
title: '自定义图标'
},
component: () => import('@/view/components/icons/icons.vue')
}
]
},
{
path: '/update',
name: 'update',
meta: {
icon: 'md-cloud-upload',
title: '数据上传'
},
component: Main,
children: [
{
path: 'update_table_page',
name: 'update_table_page',
meta: {
icon: 'ios-document',
title: '上传Csv'
},
component: () => import('@/view/update/update-table.vue')
},
{
path: 'update_paste_page',
name: 'update_paste_page',
meta: {
icon: 'md-clipboard',
title: '粘贴表格数据'
},
component: () => import('@/view/update/update-paste.vue')
}
]
},
{
path: '/excel',
name: 'excel',
meta: {
icon: 'ios-stats',
title: 'EXCEL导入导出'
},
component: Main,
children: [
{
path: 'upload-excel',
name: 'upload-excel',
meta: {
icon: 'md-add',
title: '导入EXCEL'
},
component: () => import('@/view/excel/upload-excel.vue')
},
{
path: 'export-excel',
name: 'export-excel',
meta: {
icon: 'md-download',
title: '导出EXCEL'
},
component: () => import('@/view/excel/export-excel.vue')
}
]
},
{
path: '/tools_methods',
name: 'tools_methods',
meta: {
hide: true
},
component: Main,
children: [
{
path: 'tools_methods_page',
name: 'tools_methods_page',
meta: {
icon: 'ios-hammer',
title: '工具方法',
beforeCloseName: 'before_close_normal'
},
component: () => import('@/view/tools-methods/tools-methods.vue')
}
]
},
{
path: '/i18n',
name: 'i18n',
meta: {
hide: true
},
component: Main,
children: [
{
path: 'i18n_page',
name: 'i18n_page',
meta: {
icon: 'md-planet',
title: 'i18n - {{ i18n_page }}'
},
component: () => import('@/view/i18n/i18n-page.vue')
}
]
},
{
path: '/error_store',
name: 'error_store',
meta: {
hide: true
},
component: Main,
children: [
{
path: 'error_store_page',
name: 'error_store_page',
meta: {
icon: 'ios-bug',
title: '错误收集'
},
component: () => import('@/view/error-store/error-store.vue')
}
]
},
{
path: '/error_logger',
name: 'error_logger',
meta: {
hide: true,
hideInMenu: true
},
component: Main,
children: [
{
path: 'error_logger_page',
name: 'error_logger_page',
meta: {
icon: 'ios-bug',
title: '错误收集'
},
component: () => import('@/view/single-page/error-logger.vue')
}
]
},
{
path: '/directive',
name: 'directive',
meta: {
hide: true
},
component: Main,
children: [
{
path: 'directive_page',
name: 'directive_page',
meta: {
icon: 'ios-navigate',
title: '指令'
},
component: () => import('@/view/directive/directive.vue')
}
]
},
{
path: '/multilevel',
name: 'multilevel',
@ -354,37 +109,6 @@ export default [
}
]
},
{
path: '/argu',
name: 'argu',
meta: {
hideInMenu: true
},
component: Main,
children: [
{
path: 'params/:id',
name: 'params',
meta: {
icon: 'md-flower',
title: route => `{{ params }}-${route.params.id}`,
notCache: true,
beforeCloseName: 'before_close_normal'
},
component: () => import('@/view/argu-page/params.vue')
},
{
path: 'query',
name: 'query',
meta: {
icon: 'md-flower',
title: route => `{{ query }}-${route.query.id}`,
notCache: true
},
component: () => import('@/view/argu-page/query.vue')
}
]
},
{
path: '/401',
name: 'error_401',

View File

@ -1,17 +0,0 @@
<template>
<div>
<Card>
<h2>ID: {{ $route.params.id }}</h2>
</Card>
</div>
</template>
<script>
export default {
name: 'argu_page'
}
</script>
<style>
</style>

View File

@ -1,17 +0,0 @@
<template>
<div>
<Card>
<h2>ID: {{ $route.query.id }}</h2>
</Card>
</div>
</template>
<script>
export default {
name: 'query'
}
</script>
<style>
</style>

View File

@ -1,193 +0,0 @@
<template>
<div>
<Row :gutter="14">
<i-col span="3">
<Card>
<p slot="title">
<Icon type="waterdrop"></Icon>
count-to组件基础用法
</p>
<Row type="flex" justify="center" align="middle" class="countto-page-row">
<div class="count-to-con">
<count-to :end="2534"/>
</div>
</Row>
</Card>
</i-col>
<i-col span="5" class="padding-left-10">
<Card>
<p slot="title">
<Icon type="code"></Icon>
可添加左右文字
</p>
<Row type="flex" justify="center" align="middle" class="countto-page-row">
<div class="count-to-con">
<count-to :end="2534">
<span slot="left">Total:&nbsp;</span>
<span slot="right">&nbsp;times</span>
</count-to>
</div>
</Row>
</Card>
</i-col>
<i-col span="8" class="padding-left-10">
<Card>
<p slot="title">
<Icon type="paintbucket"></Icon>
自定义样式
</p>
<Row type="flex" justify="center" align="middle" class="countto-page-row">
<div class="count-to-con">
<count-to :end="2534" count-class="count-text" unit-class="unit-class">
<span class="slot-text" slot="left">Total:&nbsp;</span>
<span class="slot-text" slot="right">&nbsp;times</span>
</count-to>
</div>
</Row>
</Card>
</i-col>
<i-col span="8" class="padding-left-10">
<Card>
<p slot="title">
<Icon type="settings"></Icon>
设置数据格式
</p>
<Row type="flex" justify="center" align="middle" class="countto-page-row">
<div class="count-to-con">
<count-to :end="2534" count-class="count-text" unit-class="unit-class" :decimals="2">
<span class="slot-text" slot="left">Total:&nbsp;</span>
<span class="slot-text" slot="right">&nbsp;times</span>
</count-to>
</div>
</Row>
</Card>
</i-col>
</Row>
<Row :gutter="14" style="margin-top: 14px;">
<i-col span="8">
<Card>
<p slot="title">
<Icon type="ios-color-wand"></Icon>
转换单位简化数据
</p>
<Row type="flex" justify="center" align="middle" class="countto-page-row">
<div class="count-to-con">
<count-to :simplify="true" :end="2534" count-class="count-text" unit-class="unit-class">
<span class="slot-text" slot="left">Total:&nbsp;</span>
<span class="slot-text" slot="right">&nbsp;times</span>
</count-to>
</div>
</Row>
</Card>
</i-col>
<i-col span="8" class="padding-left-10">
<Card>
<p slot="title">
<Icon type="ios-shuffle-strong"></Icon>
自定义单位
</p>
<Row type="flex" justify="center" align="middle" class="countto-page-row">
<div class="count-to-con">
<count-to :simplify="true" :unit="unit" :end="253" count-class="count-text" unit-class="unit-class">
<span class="slot-text" slot="left">原始数据253&nbsp;=>&nbsp;</span>
</count-to>
<count-to :simplify="true" :unit="unit" :end="2534" count-class="count-text" unit-class="unit-class">
<span class="slot-text" slot="left">原始数据2534&nbsp;=>&nbsp;</span>
</count-to>
<count-to :simplify="true" :unit="unit" :end="257678" count-class="count-text" unit-class="unit-class">
<span class="slot-text" slot="left">原始数据257678&nbsp;=>&nbsp;</span>
</count-to>
</div>
</Row>
</Card>
</i-col>
<i-col span="8" class="padding-left-10">
<Card>
<p slot="title">
<Icon type="android-stopwatch"></Icon>
可异步更新数据
</p>
<Row type="flex" justify="center" align="middle" class="countto-page-row">
<div class="count-to-con">
<count-to :end="asynEndVal" count-class="count-text" unit-class="unit-class">
<span class="slot-text" slot="left">Total:&nbsp;</span>
<span class="slot-text" slot="right">&nbsp;times</span>
</count-to>
</div>
</Row>
</Card>
</i-col>
</Row>
<Row :gutter="14" style="margin-top: 14px;">
<i-col>
<Card>
<p slot="title">
<Icon type="ios-analytics"></Icon>
综合实例
</p>
<Row type="flex" justify="center" align="middle" class="countto-page-row">
<div class="count-to-con">
<count-to :delay="500" :simplify="true" :unit="unit2" :end="integratedEndVal" count-class="count-text" unit-class="unit-class">
<span class="slot-text" slot="left">原始数据:&nbsp;{{ integratedEndVal }}&nbsp;=>&nbsp;</span>
<span class="slot-text" slot="right">&nbsp;times</span>
</count-to>
</div>
</Row>
</Card>
</i-col>
</Row>
</div>
</template>
<script>
import CountTo from '_c/count-to'
export default {
name: 'count_to_page',
components: {
CountTo
},
data () {
return {
end: 0,
unit: [[3, '千多'], [4, '万多'], [5, '十万多']],
unit2: [[1, '十多'], [2, '百多'], [3, '千多'], [4, '万多'], [5, '十万多'], [6, '百万多'], [7, '千万多'], [8, '亿多']],
asynEndVal: 487,
integratedEndVal: 3
}
},
methods: {
init () {
setInterval(() => {
this.asynEndVal += parseInt(Math.random() * 20)
this.integratedEndVal += parseInt(Math.random() * 30)
}, 2000)
}
},
mounted () {
this.init()
}
}
</script>
<style lang="less">
@baseColor: ~"#dc9387";
.countto-page-row{
height: 200px;
}
.count-to-con{
display: block;
width: 100%;
text-align: center;
}
.count-text{
font-size: 50px;
color: @baseColor;
}
.slot-text{
font-size: 22px;
}
.unit-class{
font-size: 30px;
color: @baseColor;
}
</style>

View File

@ -1,113 +0,0 @@
<template>
<div>
<Card>
<div class="drag-box-card">
<!-- 切记设置list1和list2属性时一定要添加.sync修饰符 -->
<drag-list :list1.sync="list1" :list2.sync="list2" :dropConClass="dropConClass" @on-change="handleChange">
<h3 slot="left-title">待办事项</h3>
<Card class="drag-item" slot="left" slot-scope="left">{{ left.itemLeft.name }}</Card>
<h3 slot="right-title">完成事项</h3>
<Card class="drag-item" slot="right" slot-scope="right">{{ right.itemRight.name }}</Card>
</drag-list>
</div>
<div class="handle-log-box">
<h3>操作记录</h3>
<div class="handle-inner-box">
<p v-for="(item, index) in handleList" :key="`handle_item_${index}`">{{ item }}</p>
</div>
</div>
<div class="res-show-box">
<pre>{{ list1 }}</pre>
</div>
<div class="res-show-box">
<pre>{{ list2 }}</pre>
</div>
</Card>
</div>
</template>
<script>
import DragList from '_c/drag-list'
import { getDragList } from '@/api/data'
export default {
name: 'drag_list_page',
components: {
DragList
},
data () {
return {
list1: [],
list2: [],
dropConClass: {
left: ['drop-box', 'left-drop-box'],
right: ['drop-box', 'right-drop-box']
},
handleList: []
}
},
methods: {
handleChange ({ src, target, oldIndex, newIndex }) {
this.handleList.push(`${src} => ${target}, ${oldIndex} => ${newIndex}`)
}
},
mounted () {
getDragList().then(res => {
this.list1 = res.data
this.list2 = [res.data[0]]
})
}
}
</script>
<style lang="less">
.drag-box-card{
display: inline-block;
width: 600px;
height: 560px;
.drag-item{
margin: 10px;
}
h3{
padding: 10px 15px;
}
.drop-box{
border: 1px solid #eeeeee;
height: 455px;
border-radius: 5px;
}
.left-drop-box{
margin-right: 10px;
}
.right-drop-box{
//
}
}
.handle-log-box{
display: inline-block;
margin-left: 20px;
border: 1px solid #eeeeee;
vertical-align: top;
width: 200px;
height: 500px;
h3{
padding: 10px 14px;
}
.handle-inner-box{
height: ~"calc(100% - 44px)";
overflow: auto;
p{
padding: 14px 0;
margin: 0 14px;
border-bottom: 1px dashed #eeeeee;
}
}
}
.res-show-box{
display: inline-block;
margin-left: 20px;
border: 1px solid #eeeeee;
vertical-align: top;
width: 350px;
height: 570px;
}
</style>

View File

@ -1,33 +0,0 @@
<template>
<div>
<editor ref="editor" :value="content" @on-change="handleChange"/>
<button @click="changeContent">修改编辑器内容</button>
</div>
</template>
<script>
import Editor from '_c/editor'
export default {
name: 'editor_page',
components: {
Editor
},
data () {
return {
content: '12312323'
}
},
methods: {
handleChange (html, text) {
console.log(html, text)
},
changeContent () {
this.$refs.editor.setHtml('<p>powered by wangeditor</p>')
}
}
}
</script>
<style>
</style>

View File

@ -1,63 +0,0 @@
<template>
<Row>
<i-col span="16">
<Row v-for="i in (customIconList.length / 3)" :key="`custom-icon-row-${i}`">
<i-col span="8" v-for="item in customIconList.slice((i - 1) * 3, i * 3)" :key="`custom-icon-${item}`">
<Card style="margin: 0 5px 5px; text-align: center;">
<icons :size="30" :type="item"/>
<p class="icon-code">&lt;Icons :size="30" type="{{ item }}"&gt;</p>
<p>&lt;CommonIcon :size="30" type="_{{ item }}"&gt;</p>
</Card>
</i-col>
</Row>
<Row>
<i-col>
<Card style="margin: 0 5px 5px; text-align: center;">
<common-icon :size="30" type="ionic"/>
<p class="icon-code">iView内置图标</p>
<p>&lt;CommonIcon :size="30" type="ionic"&gt;</p>
</Card>
</i-col>
</Row>
</i-col>
<i-col span="8">
<Card>
<p class="intro-p"><Icon style="margin-right: 10px;" :size="10" type="heart"/>Icons组件支持自定义图标的显示具体自定义图标字体文件的制作请参考文档</p>
<p class="intro-p"><Icon style="margin-right: 10px;" :size="10" type="heart"/>CommonIcon组件同时支持iView内置图标类型和自定义图标类型为了区别这两种类型需要在自定义图标名称前加下划线"_"</p>
</Card>
</i-col>
</Row>
</template>
<script>
import Icons from '_c/icons'
import CommonIcon from '_c/common-icon'
export default {
name: 'icons_pages',
components: {
Icons,
CommonIcon
},
data () {
return {
customIconList: [
'woman',
'man',
'smile',
'meh',
'frown',
'bear'
]
}
}
}
</script>
<style lang="less">
.icon-code{
margin: 20px 0 10px;
}
.intro-p{
margin-bottom: 10px;
}
</style>

View File

@ -1,24 +0,0 @@
<template>
<div>
<markdown-editor v-model="content"/>
</div>
</template>
<script>
import MarkdownEditor from '_c/markdown'
export default {
name: 'markdown_page',
components: {
MarkdownEditor
},
data () {
return {
content: ''
}
}
}
</script>
<style>
</style>

View File

@ -1,79 +0,0 @@
<template>
<div class="split-pane-page-wrapper">
<split-pane v-model="offset" @on-moving="handleMoving">
<div slot="left" class="pane left-pane">
<split-pane v-model="offsetVertical" mode="vertical" @on-moving="handleMoving">
<div slot="top" class="pane top-pane"></div>
<div slot="bottom" class="pane bottom-pane"></div>
<div slot="trigger" class="custom-trigger">
<icons class="trigger-icon" :size="22" type="resize-vertical" color="#fff"/>
</div>
</split-pane>
</div>
<div slot="right" class="pane right-pane"></div>
</split-pane>
</div>
</template>
<script>
import SplitPane from '_c/split-pane'
import Icons from '_c/icons'
export default {
name: 'split_pane_page',
components: {
SplitPane,
Icons
},
data () {
return {
offset: 0.6,
offsetVertical: '250px'
}
},
methods: {
handleMoving (e) {
console.log(e.atMin, e.atMax)
}
}
}
</script>
<style lang="less">
.center-middle{
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
.split-pane-page-wrapper{
height: 600px;
.pane{
width: 100%;
height: 100%;
&.left-pane{
background: sandybrown;
}
&.right-pane{
background: palevioletred;
}
&.top-pane{
background: sandybrown;
}
&.bottom-pane{
background: palevioletred;
}
}
.custom-trigger{
width: 20px;
height: 20px;
border-radius: 50%;
background: #000000;
position: absolute;
.center-middle;
box-shadow: 0 0 6px 0 rgba(28, 36, 56, 0.4);
i.trigger-icon{
.center-middle;
}
}
}
</style>

View File

@ -1,71 +0,0 @@
<template>
<div>
<Card>
<tables ref="tables" editable searchable search-place="top" v-model="tableData" :columns="columns" @on-delete="handleDelete"/>
<Button style="margin: 10px 0;" type="primary" @click="exportExcel">导出为Csv文件</Button>
</Card>
</div>
</template>
<script>
import Tables from '_c/tables'
import { getTableData } from '@/api/data'
export default {
name: 'tables_page',
components: {
Tables
},
data () {
return {
columns: [
{title: 'Name', key: 'name', sortable: true},
{title: 'Email', key: 'email', editable: true},
{title: 'Create-Time', key: 'createTime'},
{
title: 'Handle',
key: 'handle',
options: ['delete'],
button: [
(h, params, vm) => {
return h('Poptip', {
props: {
confirm: true,
title: '你确定要删除吗?'
},
on: {
'on-ok': () => {
vm.$emit('on-delete', params)
vm.$emit('input', params.tableData.filter((item, index) => index !== params.row.initRowIndex))
}
}
}, [
h('Button', '自定义删除')
])
}
]
}
],
tableData: []
}
},
methods: {
handleDelete (params) {
console.log(params)
},
exportExcel () {
this.$refs.tables.exportCsv({
filename: `table-${(new Date()).valueOf()}.csv`
})
}
},
mounted () {
getTableData().then(res => {
this.tableData = res.data
})
}
}
</script>
<style>
</style>

View File

@ -1,71 +0,0 @@
<template>
<div>
<Row>
<i-col>
<Card>
<Row>
<i-col span="5">
<Button type="primary" @click="showModal">显示可拖动弹窗</Button>
<br/>
<Button v-draggable="buttonOptions" class="draggable-btn">这个按钮也是可以拖动的</Button>
</i-col>
<i-col span="19">
<div class="intro-con">
&lt;Modal v-draggable="options" v-model="visible"&gt;标题&lt;/Modal&gt;
<pre class="code-con">
options = {
trigger: '.ivu-modal-body',
body: '.ivu-modal'
}
</pre>
</div>
</i-col>
</Row>
</Card>
</i-col>
<Modal v-draggable="options" v-model="modalVisible">
拖动这里即可拖动整个弹窗
</Modal>
</Row>
</div>
</template>
<script>
export default {
name: 'directive_page',
data () {
return {
modalVisible: false,
options: {
trigger: '.ivu-modal-body',
body: '.ivu-modal',
recover: true
},
buttonOptions: {
trigger: '.draggable-btn',
body: '.draggable-btn'
},
statu: 1
}
},
methods: {
showModal () {
this.modalVisible = true
}
}
}
</script>
<style>
.intro-con{
min-height: 140px;
}
.draggable-btn{
margin-top: 20px;
}
.code-con{
width: 400px;
background: #F9F9F9;
padding-top: 10px;
}
</style>

View File

@ -1,39 +0,0 @@
<template>
<div>
<Card>
iview-admin会自动将你程序中的错误收集起来你可以将错误日志发给后端保存起来如果你不需要这个功能'./src/config/index.js'里的plugin的'error-store'属性删掉即可
另外在开发环境下你程序中的错误都会被收集起来这样可能不利于你排查错误你可以将'./src/config/index.js''error-store''developmentOff'设为true
如果你只是想收集错误日志不希望登录用户看到错误日志你可以不提供查看日志的入口只需将'./src/config/index.js''error-store''showInHeader'设为false
</Card>
<Card style="margin-top: 20px;">
<Row>
<i-col span="8">
<Button @click="click" style="display: block">点击测试触发程序错误</Button>
<Button @click="ajaxClick" style="margin-top:10px;">点击测试触发ajax接口请求错误</Button>
</i-col>
<i-col span="16">
ajax接口请求是请求easy-mock的一个不存在接口所以服务端会报404错误错误收集机制会收集这个错误测试的时候有一定网络延迟所以点击按钮之后稍等一会才会收集到错误
</i-col>
</Row>
</Card>
</div>
</template>
<script>
import { errorReq } from '@/api/data'
export default {
name: 'error_store_page',
methods: {
click () {
console.log(admin)
},
ajaxClick () {
errorReq()
}
}
}
</script>
<style>
</style>

View File

@ -1,64 +0,0 @@
.margin-top-8{
margin-top: 8px;
}
.margin-top-10{
margin-top: 10px;
}
.margin-top-20{
margin-top: 20px;
}
.margin-left-10{
margin-left: 10px;
}
.margin-bottom-10{
margin-bottom: 10px;
}
.margin-bottom-100{
margin-bottom: 100px;
}
.margin-right-10{
margin-right: 10px;
}
.padding-left-6{
padding-left: 6px;
}
.padding-left-8{
padding-left: 5px;
}
.padding-left-10{
padding-left: 10px;
}
.padding-left-20{
padding-left: 20px;
}
.height-100{
height: 100%;
}
.height-120px{
height: 100px;
}
.height-200px{
height: 200px;
}
.height-492px{
height: 492px;
}
.height-460px{
height: 460px;
}
.line-gray{
height: 0;
border-bottom: 2px solid #dcdcdc;
}
.notwrap{
word-break:keep-all;
white-space:nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.padding-left-5{
padding-left: 10px;
}
[v-cloak]{
display: none;
}

View File

@ -1,81 +0,0 @@
<style lang="less">
@import "./common.less";
</style>
<template>
<div>
<Card title="导出EXCEL">
<Row>
<Button icon="md-download" :loading="exportLoading" @click="exportExcel">导出文件</Button>
</Row>
</Card>
<Row class="margin-top-10">
<Table :columns="tableTitle" :data="tableData"></Table>
</Row>
</div>
</template>
<script>
import excel from '@/libs/excel'
export default {
name: 'export-excel',
data () {
return {
exportLoading: false,
tableTitle: [
{
title: '一级分类',
key: 'category1'
},
{
title: '二级分类',
key: 'category2'
},
{
title: '三级分类',
key: 'category3'
}
],
tableData: [
{
category1: 1,
category2: 2,
category3: 3
},
{
category1: 4,
category2: 5,
category3: 6
},
{
category1: 7,
category2: 8,
category3: 9
}
]
}
},
methods: {
exportExcel () {
if (this.tableData.length) {
this.exportLoading = true
const params = {
title: ['一级分类', '二级分类', '三级分类'],
key: ['category1', 'category2', 'category3'],
data: this.tableData,
autoWidth: true,
filename: '分类列表'
}
excel.export_array_to_excel(params)
this.exportLoading = false
} else {
this.$Message.info('表格数据不能为空!')
}
}
},
created () {
},
mounted () {
}
}
</script>

View File

@ -1,114 +0,0 @@
<style lang="less">
@import "./common.less";
</style>
<template>
<div>
<Card title="导入EXCEL">
<Row>
<Upload action="" :before-upload="handleBeforeUpload" accept=".xls, .xlsx">
<Button icon="ios-cloud-upload-outline" :loading="uploadLoading" @click="handleUploadFile">上传文件</Button>
</Upload>
</Row>
<Row>
<div class="ivu-upload-list-file" v-if="file !== null">
<Icon type="ios-stats"></Icon>
{{ file.name }}
<Icon v-show="showRemoveFile" type="ios-close" class="ivu-upload-list-remove" @click.native="handleRemove()"></Icon>
</div>
</Row>
<Row>
<transition name="fade">
<Progress v-if="showProgress" :percent="progressPercent" :stroke-width="2">
<div v-if="progressPercent == 100">
<Icon type="ios-checkmark-circle"></Icon>
<span>成功</span>
</div>
</Progress>
</transition>
</Row>
</Card>
<Row class="margin-top-10">
<Table :columns="tableTitle" :data="tableData" :loading="tableLoading"></Table>
</Row>
</div>
</template>
<script>
import excel from '@/libs/excel'
export default {
name: 'upload-excel',
data () {
return {
uploadLoading: false,
progressPercent: 0,
showProgress: false,
showRemoveFile: false,
file: null,
tableData: [],
tableTitle: [],
tableLoading: false
}
},
methods: {
initUpload () {
this.file = null
this.showProgress = false
this.loadingProgress = 0
this.tableData = []
this.tableTitle = []
},
handleUploadFile () {
this.initUpload()
},
handleRemove () {
this.initUpload()
this.$Message.info('上传的文件已删除!')
},
handleBeforeUpload (file) {
const fileExt = file.name.split('.').pop().toLocaleLowerCase()
if (fileExt === 'xlsx' || fileExt === 'xls') {
this.readFile(file)
this.file = file
} else {
this.$Notice.warning({
title: '文件类型错误',
desc: '文件:' + file.name + '不是EXCEL文件请选择后缀为.xlsx或者.xls的EXCEL文件。'
})
}
return false
},
//
readFile (file) {
const reader = new FileReader()
reader.readAsArrayBuffer(file)
reader.onloadstart = e => {
this.uploadLoading = true
this.tableLoading = true
this.showProgress = true
}
reader.onprogress = e => {
this.progressPercent = Math.round(e.loaded / e.total * 100)
}
reader.onerror = e => {
this.$Message.error('文件读取出错')
}
reader.onload = e => {
this.$Message.info('文件读取成功')
const data = e.target.result
const { header, results } = excel.read(data, 'array')
const tableTitle = header.map(item => { return { title: item, key: item } })
this.tableData = results
this.tableTitle = tableTitle
this.uploadLoading = false
this.tableLoading = false
this.showRemoveFile = true
}
}
},
created () {
},
mounted () {
}
}
</script>

View File

@ -1,50 +0,0 @@
<template>
<div>
<Row :gutter="10">
<i-col span="6">
<Card>
<div class="i18n-card-box">
<DatePicker type="date" placeholder="Select date"></DatePicker>
<TimePicker type="timerange" placement="bottom-end" placeholder="Select time" style="display: block;margin-top: 10px;"></TimePicker>
<Button type="primary" @click="modalVisible = true" style="margin-top: 10px;">{{ $t('buttonText') }}</Button>
<Modal
v-model="modalVisible"
:title="$t('modalTitle')">
<p>{{ content }}</p>
<p>{{ content }}</p>
<p>{{ content }}</p>
</Modal>
<i class="tip">{{ $t('i18n-tip') }}</i>
</div>
</Card>
</i-col>
</Row>
</div>
</template>
<script>
export default {
name: 'i18n_page',
data () {
return {
modalVisible: false
}
},
computed: {
content () {
return this.$t('content')
}
}
}
</script>
<style lang="less">
.i18n-card-box{
height: 200px;
.tip{
color: gray;
display: block;
margin-top: 20px;
}
}
</style>

View File

@ -1,44 +0,0 @@
<template>
<div>
<Row :gutter="20">
<i-col span="12">
<Card title="iview-admin交流群(已满)" shadow>
<img class="qq-group-img" :src="qqFans" alt="">
<p class="qq-group-intro">本群为使用iview-admin或者对iview-admin感兴趣的开发者提供交流平台在这里解决你开发中的疑惑共同进步</p>
</Card>
</i-col>
<i-col span="12">
<Card title="iview-admin交流群2" shadow>
<img class="qq-group-img" :src="qqFans2" alt="">
<p class="qq-group-intro">本群为使用iview-admin或者对iview-admin感兴趣的开发者提供交流平台在这里解决你开发中的疑惑共同进步</p>
</Card>
</i-col>
</Row>
</div>
</template>
<script>
import qqFans from '@/assets/images/qq-fance.jpg'
import qqFans2 from '@/assets/images/qq-fance2.jpg'
export default {
name: 'join_page',
data () {
return {
qqFans,
qqFans2
}
}
}
</script>
<style>
.qq-group-img{
display: block;
margin: 0 auto;
width: 240px;
}
.qq-group-intro{
padding: 20px;
font-size: 16px;
}
</style>

View File

@ -1,91 +0,0 @@
<template>
<div>
<Button @click="exportData" type="primary" style="margin: 0 10px 10px 0;">导出日志记录</Button>
<b>这里只会显示成功保存到服务端的错误日志而且页面错误日志不会在浏览器持久化存储刷新页面即会丢失</b>
<Table ref="table" :columns="columns" :data="errorList"></Table>
</div>
</template>
<script>
import dayjs from 'dayjs'
import { mapMutations } from 'vuex'
export default {
name: 'error_logger_page',
data () {
return {
columns: [
{
type: 'index',
title: '序号',
width: 100
},
{
key: 'type',
title: '类型',
width: 100,
render: (h, { row }) => {
return (
<div>
<icon size={16} type={row.type === 'ajax' ? 'md-link' : 'md-code-working'}></icon>
</div>
)
}
},
{
key: 'code',
title: '编码',
render: (h, { row }) => {
return (
<span>{ row.code === 0 ? '-' : row.code }</span>
)
}
},
{
key: 'mes',
title: '信息'
},
{
key: 'url',
title: 'URL'
},
{
key: 'time',
title: '时间',
render: (h, { row }) => {
return (
<span>{ dayjs(row.time).format('YYYY-MM-DD HH:mm:ss') }</span>
)
},
sortable: true,
sortType: 'desc'
}
]
}
},
computed: {
errorList () {
return this.$store.state.app.errorList
}
},
methods: {
...mapMutations([
'setHasReadErrorLoggerStatus'
]),
exportData () {
this.$refs.table.exportCsv({
filename: '错误日志.csv'
})
}
},
activated () {
this.setHasReadErrorLoggerStatus()
},
mounted () {
this.setHasReadErrorLoggerStatus()
}
}
</script>
<style>
</style>

View File

@ -1,81 +0,0 @@
<template>
<div>
<Card shadow>
<Row>
<i-col span="4">
<Button @click="createTagParams">添加一个标签</Button>
</i-col>
<i-col span="20">
<p>动态路由添加params</p>
</i-col>
</Row>
</Card>
<Card shadow style="margin-top: 10px;">
<Row>
<i-col span="4">
<Button @click="createTagQuery">添加一个标签</Button>
</i-col>
<i-col span="20">
<p>动态路由添加query</p>
</i-col>
</Row>
</Card>
<Card shadow style="margin-top: 10px;">
<Row>
<i-col span="4">
<Button @click="handleCloseTag">关闭工具方法页</Button>
</i-col>
<i-col span="20">
<p>手动关闭页面</p>
</i-col>
</Row>
</Card>
</div>
</template>
<script>
import { mapMutations } from 'vuex'
export default {
name: 'tools_methods_page',
methods: {
...mapMutations([
'closeTag'
]),
createTagParams () {
const id = parseInt(Math.random() * 100000)
const route = {
name: 'params',
params: {
id
},
meta: {
title: `动态路由-${id}`
}
}
this.$router.push(route)
},
createTagQuery () {
const id = parseInt(Math.random() * 100000)
const route = {
name: 'query',
query: {
id
},
meta: {
title: `参数-${id}`
}
}
this.$router.push(route)
},
handleCloseTag () {
this.closeTag({
name: 'tools_methods_page'
})
}
}
}
</script>
<style>
</style>

View File

@ -1,77 +0,0 @@
<template>
<Row :gutter="10">
<i-col span="12">
<Card>
<div class="update-paste-con">
<paste-editor v-model="pasteDataArr" @on-success="handleSuccess" @on-error="handleError"/>
</div>
<div class="update-paste-btn-con">
<span class="paste-tip">使用Tab键换列使用回车键换行</span>
<Button type="primary" style="float: right;" @click="handleShow">显示表格数据</Button>
</div>
</Card>
</i-col>
<i-col span="12">
<Card>
<Table :height="400" :columns="columns" :data="tableData"/>
</Card>
</i-col>
</Row>
</template>
<script>
import PasteEditor from '_c/paste-editor'
import { getTableDataFromArray } from '@/libs/util'
export default {
name: 'update_paste_page',
components: {
PasteEditor
},
data () {
return {
pasteDataArr: [],
columns: [],
tableData: [],
validated: true,
errorIndex: 0
}
},
methods: {
handleSuccess () {
this.validated = true
},
handleError (index) {
this.validated = false
this.errorIndex = index
},
handleShow () {
if (!this.validated) {
this.$Notice.error({
title: '您的内容不规范',
desc: `您的第${this.errorIndex + 1}行数据不规范,请修改`
})
} else {
let { columns, tableData } = getTableDataFromArray(this.pasteDataArr)
this.columns = columns
this.tableData = tableData
}
}
}
}
</script>
<style lang="less">
.update-paste{
&-con{
height: 350px;
}
&-btn-con{
box-sizing: content-box;
height: 30px;
padding: 15px 0 5px;
}
}
.paste-tip{
color: #19be6b;
}
</style>

View File

@ -1,55 +0,0 @@
<template>
<Row :gutter="10">
<i-col span="6">
<Card>
<Upload action="" :before-upload="beforeUpload">
<Button icon="ios-cloud-upload-outline">上传Csv文件</Button>
&nbsp;&nbsp;&nbsp;&nbsp;点击上传Csv文件
</Upload>
<p>util.js提供两个方法用来实现这个功能</p>
<p class="update-table-intro"><Icon style="margin-right: 10px;" :size="10" type="md-heart"/><span class="code-high-line">getArrayFromFile</span>将Csv文件解析为二维数组</p>
<p class="update-table-intro"><Icon style="margin-right: 10px;" :size="10" type="md-heart"/><span class="code-high-line">getTableDataFromArray</span>将二维数组转为表格数据具体请看文档</p>
</Card>
</i-col>
<i-col span="18">
<Table :height="500" :columns="columns" :data="tableData"/>
</i-col>
</Row>
</template>
<script>
import { getArrayFromFile, getTableDataFromArray } from '@/libs/util'
export default {
name: 'update_table_page',
data () {
return {
columns: [],
tableData: []
}
},
methods: {
beforeUpload (file) {
getArrayFromFile(file).then(data => {
let {columns, tableData} = getTableDataFromArray(data)
this.columns = columns
this.tableData = tableData
}).catch(() => {
this.$Notice.warning({
title: '只能上传Csv文件',
desc: '只能上传Csv文件请重新上传'
})
})
return false
}
}
}
</script>
<style>
.update-table-intro{
margin-top: 10px;
}
.code-high-line{
color: #2d8cf0;
}
</style>

View File

@ -12,7 +12,7 @@ const resolve = dir => {
// 例如https://www.foobar.com/my-app/
// 需要将它改为'/my-app/'
const BASE_URL = process.env.NODE_ENV === 'production'
? '/iview-admin/'
? '/'
: '/'
module.exports = {
@ -27,14 +27,14 @@ module.exports = {
// tweak internal webpack configuration.
// see https://github.com/vuejs/vue-cli/blob/dev/docs/webpack.md
// 如果你不需要使用eslint把lintOnSave设为false即可
lintOnSave: true,
lintOnSave: false,
chainWebpack: config => {
config.resolve.alias
.set('@', resolve('src')) // key,value自行定义比如.set('@@', resolve('src/components'))
.set('_c', resolve('src/components'))
},
// 打包时不生成.map文件
productionSourceMap: true
productionSourceMap: false
// 这里写你调用接口的基础路径来解决跨域如果设置了代理那你本地开发环境的axios的baseUrl要写为 '' ,即空字符串
// devServer: {
// proxy: 'localhost:3000'