mirror of https://github.com/halo-dev/halo-admin
refactor: independent sheet. (#110)
parent
febf008624
commit
bbdda761df
|
@ -12,9 +12,9 @@ sheetApi.list = params => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
sheetApi.listInternal = () => {
|
sheetApi.listIndependent = () => {
|
||||||
return service({
|
return service({
|
||||||
url: `${baseUrl}/internal`,
|
url: `${baseUrl}/independent`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,21 +76,21 @@ export const asyncRouterMap = [
|
||||||
path: '/sheets/links',
|
path: '/sheets/links',
|
||||||
name: 'LinkList',
|
name: 'LinkList',
|
||||||
hidden: true,
|
hidden: true,
|
||||||
component: () => import('@/views/sheet/internal/LinkList'),
|
component: () => import('@/views/sheet/independent/LinkList'),
|
||||||
meta: { title: '友情链接', hiddenHeaderContent: false }
|
meta: { title: '友情链接', hiddenHeaderContent: false }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/sheets/photos',
|
path: '/sheets/photos',
|
||||||
name: 'PhotoList',
|
name: 'PhotoList',
|
||||||
hidden: true,
|
hidden: true,
|
||||||
component: () => import('@/views/sheet/internal/PhotoList'),
|
component: () => import('@/views/sheet/independent/PhotoList'),
|
||||||
meta: { title: '图库', hiddenHeaderContent: false }
|
meta: { title: '图库', hiddenHeaderContent: false }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/sheets/journals',
|
path: '/sheets/journals',
|
||||||
name: 'JournalList',
|
name: 'JournalList',
|
||||||
hidden: true,
|
hidden: true,
|
||||||
component: () => import('@/views/sheet/internal/JournalList'),
|
component: () => import('@/views/sheet/independent/JournalList'),
|
||||||
meta: { title: '日志', hiddenHeaderContent: false }
|
meta: { title: '日志', hiddenHeaderContent: false }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
@ -4,11 +4,11 @@
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<div class="card-container">
|
<div class="card-container">
|
||||||
<a-tabs type="card">
|
<a-tabs type="card">
|
||||||
<a-tab-pane key="internal">
|
<a-tab-pane key="independent">
|
||||||
<span slot="tab">
|
<span slot="tab">
|
||||||
<a-icon type="paper-clip" />内置页面
|
<a-icon type="paper-clip" />独立页面
|
||||||
</span>
|
</span>
|
||||||
<InternalSheetList />
|
<IndependentSheetList />
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
<a-tab-pane key="custom">
|
<a-tab-pane key="custom">
|
||||||
<span slot="tab">
|
<span slot="tab">
|
||||||
|
@ -24,12 +24,12 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import InternalSheetList from './components/InternalSheetList'
|
import IndependentSheetList from './components/IndependentSheetList'
|
||||||
import CustomSheetList from './components/CustomSheetList'
|
import CustomSheetList from './components/CustomSheetList'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
InternalSheetList,
|
IndependentSheetList,
|
||||||
CustomSheetList
|
CustomSheetList
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -408,7 +408,6 @@ export default {
|
||||||
selectedMetas: [],
|
selectedMetas: [],
|
||||||
sheetSettingVisible: false,
|
sheetSettingVisible: false,
|
||||||
sheetCommentVisible: false,
|
sheetCommentVisible: false,
|
||||||
internalSheets: [],
|
|
||||||
sheets: [],
|
sheets: [],
|
||||||
menu: {}
|
menu: {}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
itemLayout="vertical"
|
itemLayout="vertical"
|
||||||
size="large"
|
size="large"
|
||||||
:pagination="false"
|
:pagination="false"
|
||||||
:dataSource="internalSheets"
|
:dataSource="independentSheets"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
>
|
>
|
||||||
<a-list-item
|
<a-list-item
|
||||||
|
@ -17,27 +17,14 @@
|
||||||
<template slot="actions">
|
<template slot="actions">
|
||||||
<span>
|
<span>
|
||||||
<router-link
|
<router-link
|
||||||
:to="{name:'LinkList'}"
|
:to="{name:item.routeName}"
|
||||||
v-if="item.id==1"
|
|
||||||
>
|
|
||||||
<a-icon type="edit" />
|
|
||||||
</router-link>
|
|
||||||
<router-link
|
|
||||||
:to="{name:'PhotoList'}"
|
|
||||||
v-if="item.id==2"
|
|
||||||
>
|
|
||||||
<a-icon type="edit" />
|
|
||||||
</router-link>
|
|
||||||
<router-link
|
|
||||||
:to="{name:'JournalList'}"
|
|
||||||
v-if="item.id==3"
|
|
||||||
>
|
>
|
||||||
<a-icon type="edit" />
|
<a-icon type="edit" />
|
||||||
</router-link>
|
</router-link>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<template slot="extra">
|
<template slot="extra">
|
||||||
<span v-if="item.status">可用</span>
|
<span v-if="item.available">可用</span>
|
||||||
<span v-else>不可用
|
<span v-else>不可用
|
||||||
<a-tooltip
|
<a-tooltip
|
||||||
slot="action"
|
slot="action"
|
||||||
|
@ -53,12 +40,12 @@
|
||||||
style="max-width: 300px;display: block;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"
|
style="max-width: 300px;display: block;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"
|
||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
:href="item.url"
|
:href="item.fullPath"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
v-if="item.status"
|
v-if="item.available"
|
||||||
>{{ item.title }}</a>
|
>{{ item.title }}</a>
|
||||||
<a
|
<a
|
||||||
:href="item.url"
|
:href="item.fullPath"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
disabled
|
disabled
|
||||||
v-else
|
v-else
|
||||||
|
@ -72,17 +59,17 @@
|
||||||
<!-- Desktop -->
|
<!-- Desktop -->
|
||||||
<a-table
|
<a-table
|
||||||
v-else
|
v-else
|
||||||
:columns="internalColumns"
|
:columns="independentColumns"
|
||||||
:dataSource="internalSheets"
|
:dataSource="independentSheets"
|
||||||
:pagination="false"
|
:pagination="false"
|
||||||
:rowKey="page => page.id"
|
:rowKey="sheet => sheet.id"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
>
|
>
|
||||||
<template
|
<template
|
||||||
slot="status"
|
slot="available"
|
||||||
slot-scope="status"
|
slot-scope="available"
|
||||||
>
|
>
|
||||||
<span v-if="status">可用</span>
|
<span v-if="available">可用</span>
|
||||||
<span v-else>不可用
|
<span v-else>不可用
|
||||||
<a-tooltip
|
<a-tooltip
|
||||||
slot="action"
|
slot="action"
|
||||||
|
@ -97,31 +84,18 @@
|
||||||
slot-scope="text, record"
|
slot-scope="text, record"
|
||||||
>
|
>
|
||||||
<router-link
|
<router-link
|
||||||
:to="{name:'LinkList'}"
|
:to="{name:record.routeName}"
|
||||||
v-if="record.id==1"
|
|
||||||
>
|
|
||||||
<a href="javascript:void(0);">管理</a>
|
|
||||||
</router-link>
|
|
||||||
<router-link
|
|
||||||
:to="{name:'PhotoList'}"
|
|
||||||
v-if="record.id==2"
|
|
||||||
>
|
|
||||||
<a href="javascript:void(0);">管理</a>
|
|
||||||
</router-link>
|
|
||||||
<router-link
|
|
||||||
:to="{name:'JournalList'}"
|
|
||||||
v-if="record.id==3"
|
|
||||||
>
|
>
|
||||||
<a href="javascript:void(0);">管理</a>
|
<a href="javascript:void(0);">管理</a>
|
||||||
</router-link>
|
</router-link>
|
||||||
<a-divider type="vertical" />
|
<a-divider type="vertical" />
|
||||||
<a
|
<a
|
||||||
:href="record.url"
|
:href="record.fullPath"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
v-if="record.status"
|
v-if="record.available"
|
||||||
>访问</a>
|
>访问</a>
|
||||||
<a
|
<a
|
||||||
:href="record.url"
|
:href="record.fullPath"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
disabled
|
disabled
|
||||||
v-else
|
v-else
|
||||||
|
@ -133,19 +107,19 @@
|
||||||
<script>
|
<script>
|
||||||
import { mixin, mixinDevice } from '@/utils/mixin.js'
|
import { mixin, mixinDevice } from '@/utils/mixin.js'
|
||||||
import sheetApi from '@/api/sheet'
|
import sheetApi from '@/api/sheet'
|
||||||
const internalColumns = [
|
const independentColumns = [
|
||||||
{
|
{
|
||||||
title: '页面名称',
|
title: '页面名称',
|
||||||
dataIndex: 'title'
|
dataIndex: 'title'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '访问地址',
|
title: '访问地址',
|
||||||
dataIndex: 'url'
|
dataIndex: 'fullPath'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '状态',
|
||||||
dataIndex: 'status',
|
dataIndex: 'available',
|
||||||
scopedSlots: { customRender: 'status' }
|
scopedSlots: { customRender: 'available' }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
|
@ -155,23 +129,23 @@ const internalColumns = [
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
export default {
|
export default {
|
||||||
name: 'InternalSheetList',
|
name: 'IndependentSheetList',
|
||||||
mixins: [mixin, mixinDevice],
|
mixins: [mixin, mixinDevice],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
internalColumns,
|
independentColumns,
|
||||||
internalSheets: [],
|
independentSheets: [],
|
||||||
loading: false
|
loading: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.loadInternalSheets()
|
this.loadIndependentSheets()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
loadInternalSheets() {
|
loadIndependentSheets() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
sheetApi.listInternal().then(response => {
|
sheetApi.listIndependent().then(response => {
|
||||||
this.internalSheets = response.data.data
|
this.independentSheets = response.data.data
|
||||||
this.loading = false
|
this.loading = false
|
||||||
})
|
})
|
||||||
}
|
}
|
Loading…
Reference in New Issue