Perfect sheet page.

pull/25/head
ruibaby 2019-05-25 14:09:00 +08:00
parent 21aecc8abc
commit 8e6f984497
2 changed files with 31 additions and 23 deletions

View File

@ -11,6 +11,13 @@ sheetApi.list = () => {
}) })
} }
sheetApi.listInternal = () => {
return service({
url: `${baseUrl}/internal`,
method: 'get'
})
}
sheetApi.get = sheetId => { sheetApi.get = sheetId => {
return service({ return service({
url: `${baseUrl}/${sheetId}`, url: `${baseUrl}/${sheetId}`,

View File

@ -35,6 +35,20 @@
:pagination="false" :pagination="false"
:rowKey="page => page.id" :rowKey="page => page.id"
> >
<template
slot="status"
slot-scope="status"
>
<span v-if="status"></span>
<span v-else>
<a-tooltip
slot="action"
title="当前主题没有对应模板"
>
<a-icon type="info-circle-o" />
</a-tooltip>
</span>
</template>
<span <span
slot="action" slot="action"
slot-scope="text, record" slot-scope="text, record"
@ -147,7 +161,7 @@ import optionApi from '@/api/option'
const internalColumns = [ const internalColumns = [
{ {
title: '页面名称', title: '页面名称',
dataIndex: 'name' dataIndex: 'title'
}, },
{ {
title: '访问路径', title: '访问路径',
@ -155,7 +169,8 @@ const internalColumns = [
}, },
{ {
title: '状态', title: '状态',
dataIndex: 'status' dataIndex: 'status',
scopedSlots: { customRender: 'status' }
}, },
{ {
title: '操作', title: '操作',
@ -194,26 +209,6 @@ const customColumns = [
scopedSlots: { customRender: 'action' } scopedSlots: { customRender: 'action' }
} }
] ]
const internalSheets = [
{
id: '1',
name: '友情链接',
url: '/links',
status: '可用'
},
{
id: '2',
name: '图库页面',
url: '/photos',
status: '可用'
},
{
id: '3',
name: '日志页面',
url: '/journals',
status: '实验性'
}
]
export default { export default {
mixins: [mixin, mixinDevice], mixins: [mixin, mixinDevice],
data() { data() {
@ -221,7 +216,7 @@ export default {
sheetStatus: sheetApi.sheetStatus, sheetStatus: sheetApi.sheetStatus,
internalColumns, internalColumns,
customColumns, customColumns,
internalSheets, internalSheets: [],
sheets: [], sheets: [],
options: [], options: [],
keys: ['blog_url'] keys: ['blog_url']
@ -237,6 +232,7 @@ export default {
}, },
created() { created() {
this.loadSheets() this.loadSheets()
this.loadInternalSheets()
this.loadOptions() this.loadOptions()
}, },
methods: { methods: {
@ -245,6 +241,11 @@ export default {
this.sheets = response.data.data.content this.sheets = response.data.data.content
}) })
}, },
loadInternalSheets() {
sheetApi.listInternal().then(response => {
this.internalSheets = response.data.data
})
},
loadOptions() { loadOptions() {
optionApi.listAll(this.keys).then(response => { optionApi.listAll(this.keys).then(response => {
this.options = response.data.data this.options = response.data.data