Former-commit-id: e2bfcb0f40765724b17e13056e8293ec271efefb [formerly e2bfcb0f40765724b17e13056e8293ec271efefb [formerly e2bfcb0f40765724b17e13056e8293ec271efefb [formerly e2bfcb0f40765724b17e13056e8293ec271efefb [formerly 5793d72d458b7eeaf28a097d026168cebc9fc256 [formerly 9c8de3644bd40a55711e618742e29cce390e4c5f]]]]]
Former-commit-id: 05ca3c8da65f8583c142720628aa6ea71d2dbf45
Former-commit-id: 7a4d2fba696e901db86071ea2810e9c932c976ad
Former-commit-id: c18d3689200ca0e528fbf9bf171f6e1b50131bc3 [formerly 455e9952ca890cd8ad882250cfb9eabd944d44ee]
Former-commit-id: 021fa8191681fe4f22e9a9f40389831a847e9066
Former-commit-id: 1022b7792417ce366901b9d5284762a015dd6d26
Former-commit-id: bed799410be508713cac76b7c8cf02d4457fe996
Former-commit-id: f6787cfaac3404132ad1011e2707e08484708ca9
Former-commit-id: 7a8a3baca9ef30393744fd56def6d608b51dcddd
This commit is contained in:
liyang
2018-07-16 10:43:14 +08:00
parent c53973a35f
commit 1d310c9c7d
496 changed files with 3 additions and 23673 deletions

View File

@@ -1,32 +0,0 @@
<template>
<d2-container type="full" class="page">
<template slot="header">本地数据</template>
<tree-view :data="dbData" :options="options"></tree-view>
</d2-container>
</template>
<script>
// 插件
import db from '@/libs/db.js'
export default {
data () {
return {
dbData: {},
options: {
maxDepth: 10,
rootObjectKey: 'db.value()',
modifiable: false
}
}
},
mounted () {
this.load()
},
methods: {
load () {
this.dbData = db.value()
}
}
}
</script>

View File

@@ -1,24 +0,0 @@
<template>
<d2-container class="page-demo-playground-fullscreen">
<template slot="header">全屏</template>
<el-button type="primary" @click="d2adminFullScreenToggle">
d2adminFullScreenToggle 切换全屏
</el-button>
</d2-container>
</template>
<script>
import { mapState, mapMutations } from 'vuex'
export default {
computed: {
...mapState({
isFullScreen: state => state.d2admin.isFullScreen
})
},
methods: {
...mapMutations([
'd2adminFullScreenToggle'
])
}
}
</script>

View File

@@ -1,88 +0,0 @@
<template>
<d2-container class="page-demo-playground-gray">
<template slot="header">
<div class="colorful">{{isGrayMode ? 'GRAY' : 'COLORFUL'}}</div>
</template>
<el-button-group>
<el-button @click="d2adminGrayModeToggle">切换灰度模式</el-button>
<el-button @click="d2adminGrayModeSet(true)">打开灰度模式</el-button>
<el-button @click="d2adminGrayModeSet(false)">关闭灰度模式</el-button>
<el-button @click="dialogVisible = true">模拟报错提示框</el-button>
</el-button-group>
<el-dialog
title="错误"
:visible.sync="dialogVisible"
:append-to-body="true"
width="30%"
@open="handleDialogOpen"
@closed="handleDialogClosed">
<div
style="
text-align: center;
line-height: 100px;
color: #FFF;
font-size: 64px;
font-weight: bold;
border-radius: 4px;
background-color: #F56C6C;
margin: -20px 0px;
">
Error
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="dialogVisible = false" style="width: 100%;">
我看到后面的内容已经变为灰度模式
</el-button>
</span>
</el-dialog>
</d2-container>
</template>
<script>
import { mapState, mapMutations } from 'vuex'
export default {
data () {
return {
dialogVisible: false
}
},
computed: {
...mapState({
isGrayMode: state => state.d2admin.isGrayMode
})
},
methods: {
...mapMutations([
'd2adminGrayModeToggle',
'd2adminGrayModeSet'
]),
handleDialogOpen () {
this.d2adminGrayModeSet(true)
},
handleDialogClosed () {
this.d2adminGrayModeSet(false)
}
}
}
</script>
<style lang="scss" scoped>
@import '~@/assets/style/public.scss';
.page-demo-playground-gray {
.colorful {
@extend %unable-select;
line-height: 300px;
font-size: 100px;
font-weight: bold;
color: #FFF;
text-align: center;
border-radius: 4px;
border: 1px solid #333;
background-color: #ffff00;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25' viewBox='0 0 1200 800'%3E%3Cdefs%3E%3CradialGradient id='a' cx='0' cy='800' r='800' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%23ff8000'/%3E%3Cstop offset='1' stop-color='%23ff8000' stop-opacity='0'/%3E%3C/radialGradient%3E%3CradialGradient id='b' cx='1200' cy='800' r='800' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%2300ff19'/%3E%3Cstop offset='1' stop-color='%2300ff19' stop-opacity='0'/%3E%3C/radialGradient%3E%3CradialGradient id='c' cx='600' cy='0' r='600' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%239900ff'/%3E%3Cstop offset='1' stop-color='%239900ff' stop-opacity='0'/%3E%3C/radialGradient%3E%3CradialGradient id='d' cx='600' cy='800' r='600' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%23ffff00'/%3E%3Cstop offset='1' stop-color='%23ffff00' stop-opacity='0'/%3E%3C/radialGradient%3E%3CradialGradient id='e' cx='0' cy='0' r='800' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%23FF0000'/%3E%3Cstop offset='1' stop-color='%23FF0000' stop-opacity='0'/%3E%3C/radialGradient%3E%3CradialGradient id='f' cx='1200' cy='0' r='800' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%230CF'/%3E%3Cstop offset='1' stop-color='%230CF' stop-opacity='0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Crect fill='url(%23a)' width='1200' height='800'/%3E%3Crect fill='url(%23b)' width='1200' height='800'/%3E%3Crect fill='url(%23c)' width='1200' height='800'/%3E%3Crect fill='url(%23d)' width='1200' height='800'/%3E%3Crect fill='url(%23e)' width='1200' height='800'/%3E%3Crect fill='url(%23f)' width='1200' height='800'/%3E%3C/svg%3E");
background-attachment: fixed;
background-size: cover;
background-position: center;
}
}
</style>

View File

@@ -1,9 +0,0 @@
<template>
<d2-container type="full">
<d2-demo-page-cover
title="试验台"
sub-title="在这里可以测试一些 D2Admin 的系统功能">
<img :src="`${$assetsPublicPath}static/image/icon/500/playground.png`">
</d2-demo-page-cover>
</d2-container>
</template>

View File

@@ -1,16 +0,0 @@
<template>
<d2-container type="full">
<h1 class="d2-mt-0">$route.params.username: {{$route.params.username}}</h1>
<h1>$route.query.userid: {{$route.query.userid}}</h1>
<p>你可以尝试返回发送数据页面修改数据重新发送或者切换到其它页面后刷新浏览器再返回本业观察参数保留</p>
<el-button type="primary" @click="$router.push({ name: 'demo-playground-page-argu-send' })">返回发送数据的页面</el-button>
</d2-container>
</template>
<script>
export default {
data () {
return {}
}
}
</script>

View File

@@ -1,55 +0,0 @@
<template>
<d2-container type="full">
<el-form :model="sendForm" :rules="rules" label-position="top" ref="sendForm">
<el-form-item label="username 通过动态路由匹配发送" prop="username">
<el-input v-model="sendForm.username"></el-input>
</el-form-item>
<el-form-item label="userid 通过参数发送" prop="userid">
<el-input v-model="sendForm.userid"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleSubmit('sendForm')">跳转到接收页面</el-button>
</el-form-item>
</el-form>
</d2-container>
</template>
<script>
export default {
data () {
return {
sendForm: {
username: 'FairyEver',
userid: '001'
},
rules: {
username: [
{ required: true, message: '请输入要发送的用户名', trigger: 'blur' }
],
userid: [
{ required: true, message: '请输入要发送的用户ID', trigger: 'blur' }
]
}
}
},
methods: {
handleSubmit (formName) {
this.$refs[formName].validate(valid => {
if (valid) {
this.$router.push({
name: 'demo-playground-page-argu-get',
params: {
username: this.sendForm.username
},
query: {
userid: this.sendForm.userid
}
})
} else {
return false
}
})
}
}
}
</script>

View File

@@ -1,17 +0,0 @@
<template>
<d2-container type="full">
<template slot="header">这个页面不会被 keep-alive</template>
<p class="d2-mt-0">在下面的输入框输入任意字符后切换到其它页面再回到此页时输入框文字消失证明没有被缓存</p>
<el-input v-model="value" placeholder="input here"></el-input>
</d2-container>
</template>
<script>
export default {
data () {
return {
value: ''
}
}
}
</script>

View File

@@ -1,18 +0,0 @@
<template>
<d2-container type="full">
<template slot="header">这个页面会被 keep-alive</template>
<p class="d2-mt-0">在下面的输入框输入任意字符后切换到其它页面再回到此页时输入框文字保留证明被缓存</p>
<el-input v-model="value" placeholder="input here"></el-input>
</d2-container>
</template>
<script>
export default {
name: 'demo-playground-page-cache-on',
data () {
return {
value: ''
}
}
}
</script>

View File

@@ -1,72 +0,0 @@
<template>
<d2-container type="full" class="page">
<template slot="header">主题</template>
<el-table :data="themeList" v-bind="table">
<el-table-column prop="name" align="center" width="260"/>
<el-table-column label="预览" width="120">
<div
slot-scope="scope"
class="theme-preview"
:style="{'backgroundImage': `url(${$assetsPublicPath}${scope.row.preview})`}">
</div>
</el-table-column>
<el-table-column prop="address" align="center">
<template slot-scope="scope">
<el-button v-if="themeActiveName === scope.row.name" type="success" icon="el-icon-check" round>已激活</el-button>
<el-button v-else round @click="handleSelectTheme(scope.row.name)">使用</el-button>
</template>
</el-table-column>
</el-table>
<div>
<p>尝试激活一个不存在的主题主题不存在 <d2-icon name="arrow-right"/> 默认主题</p>
<el-button type="danger" @click="handleSelectTheme('err-theme')">
<d2-icon name="hand-o-right" class="d2-mr-10"/>
尝试激活主题 'err-theme'
</el-button>
</div>
<template slot="footer">
<el-button type="primary" size="small">当前激活主题 {{themeActiveName}}</el-button>
</template>
</d2-container>
</template>
<script>
import { mapState, mapMutations } from 'vuex'
export default {
data () {
return {
table: {
showHeader: false,
border: true
}
}
},
computed: {
...mapState({
themeList: state => state.d2admin.themeList,
themeActiveName: state => state.d2admin.themeActiveName
})
},
methods: {
...mapMutations([
'd2adminThemeSet'
]),
handleSelectTheme (name) {
this.d2adminThemeSet(name)
}
}
}
</script>
<style lang="scss" scoped>
@import '~@/assets/style/public.scss';
.page {
.theme-preview {
height: 50px;
width: 100px;
border-radius: 4px;
background-size: cover;
border: 1px solid $color-border-1;
}
}
</style>