mirror of https://github.com/halo-dev/halo-admin
Refactor component registration
parent
95fcc2e49e
commit
94700624dd
|
@ -0,0 +1,12 @@
|
||||||
|
<template>
|
||||||
|
<div>upload</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'Upload'
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
</style>
|
|
@ -1,3 +1,5 @@
|
||||||
|
import Vue from 'vue'
|
||||||
|
|
||||||
// pro components
|
// pro components
|
||||||
import AvatarList from '@/components/AvatarList'
|
import AvatarList from '@/components/AvatarList'
|
||||||
import Ellipsis from '@/components/Ellipsis'
|
import Ellipsis from '@/components/Ellipsis'
|
||||||
|
@ -9,17 +11,26 @@ import Trend from '@/components/Trend'
|
||||||
import MultiTab from '@/components/MultiTab'
|
import MultiTab from '@/components/MultiTab'
|
||||||
import Result from '@/components/Result'
|
import Result from '@/components/Result'
|
||||||
import ExceptionPage from '@/components/Exception'
|
import ExceptionPage from '@/components/Exception'
|
||||||
|
import Upload from '@/components/Upload/Upload'
|
||||||
|
|
||||||
export {
|
const _components = {
|
||||||
AvatarList,
|
AvatarList,
|
||||||
Trend,
|
Trend,
|
||||||
Ellipsis,
|
Ellipsis,
|
||||||
FooterToolbar,
|
FooterToolbar,
|
||||||
NumberInfo,
|
NumberInfo,
|
||||||
DescriptionList,
|
DescriptionList,
|
||||||
DescriptionList as DetailList,
|
|
||||||
Tree,
|
Tree,
|
||||||
MultiTab,
|
MultiTab,
|
||||||
Result,
|
Result,
|
||||||
ExceptionPage
|
ExceptionPage,
|
||||||
|
Upload
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const components = {}
|
||||||
|
|
||||||
|
Object.keys(_components).forEach(key => {
|
||||||
|
components[key] = Vue.component(key, _components[key])
|
||||||
|
})
|
||||||
|
|
||||||
|
export default components
|
||||||
|
|
|
@ -8,6 +8,7 @@ import './logger'
|
||||||
import './core/lazy_use'
|
import './core/lazy_use'
|
||||||
import bootstrap from './core/bootstrap'
|
import bootstrap from './core/bootstrap'
|
||||||
import '@/utils/filter' // global filter
|
import '@/utils/filter' // global filter
|
||||||
|
import './components'
|
||||||
import animated from 'animate.css'
|
import animated from 'animate.css'
|
||||||
|
|
||||||
Vue.config.productionTip = false
|
Vue.config.productionTip = false
|
||||||
|
|
|
@ -111,7 +111,6 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Ellipsis } from '@/components'
|
|
||||||
import menuApi from '@/api/menu'
|
import menuApi from '@/api/menu'
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
|
@ -138,9 +137,6 @@ const columns = [
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
export default {
|
export default {
|
||||||
components: {
|
|
||||||
Ellipsis
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
data: [],
|
data: [],
|
||||||
|
|
|
@ -150,6 +150,7 @@
|
||||||
>
|
>
|
||||||
<a-tabs defaultActiveKey="1">
|
<a-tabs defaultActiveKey="1">
|
||||||
<a-tab-pane tab="本地上传" key="1">
|
<a-tab-pane tab="本地上传" key="1">
|
||||||
|
<upload />
|
||||||
<a-upload-dragger
|
<a-upload-dragger
|
||||||
name="file"
|
name="file"
|
||||||
:multiple="true"
|
:multiple="true"
|
||||||
|
|
|
@ -7,29 +7,51 @@
|
||||||
:md="10"
|
:md="10"
|
||||||
:sm="24"
|
:sm="24"
|
||||||
:xs="24"
|
:xs="24"
|
||||||
:style="{ 'padding-bottom': '12px' }">
|
:style="{ 'padding-bottom': '12px' }"
|
||||||
|
>
|
||||||
<a-card :title="title">
|
<a-card :title="title">
|
||||||
<a-form layout="horizontal">
|
<a-form layout="horizontal">
|
||||||
<a-form-item label="网站名称:">
|
<a-form-item label="网站名称:">
|
||||||
<a-input v-model="link.name"/>
|
<a-input v-model="link.name" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="网站地址:" help="* 需要加上 http://">
|
<a-form-item
|
||||||
<a-input v-model="link.url"/>
|
label="网站地址:"
|
||||||
|
help="* 需要加上 http://"
|
||||||
|
>
|
||||||
|
<a-input v-model="link.url" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="Logo:">
|
<a-form-item label="Logo:">
|
||||||
<a-input v-model="link.logo"/>
|
<a-input v-model="link.logo" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="分组:" help="* 非必填">
|
<a-form-item
|
||||||
<a-input v-model="link.team"/>
|
label="分组:"
|
||||||
|
help="* 非必填"
|
||||||
|
>
|
||||||
|
<a-input v-model="link.team" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="描述:">
|
<a-form-item label="描述:">
|
||||||
<a-input type="textarea" :autosize="{ minRows: 5 }" v-model="link.description"/>
|
<a-input
|
||||||
|
type="textarea"
|
||||||
|
:autosize="{ minRows: 5 }"
|
||||||
|
v-model="link.description"
|
||||||
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item>
|
<a-form-item>
|
||||||
<a-button type="primary" @click="handleSaveClick" v-if="formType==='create'">保存</a-button>
|
<a-button
|
||||||
|
type="primary"
|
||||||
|
@click="handleSaveClick"
|
||||||
|
v-if="formType==='create'"
|
||||||
|
>保存</a-button>
|
||||||
<a-button-group v-else>
|
<a-button-group v-else>
|
||||||
<a-button type="primary" @click="handleSaveClick">更新</a-button>
|
<a-button
|
||||||
<a-button type="dashed" @click="addLink" v-if="formType==='update'">返回添加</a-button>
|
type="primary"
|
||||||
|
@click="handleSaveClick"
|
||||||
|
>更新</a-button>
|
||||||
|
<a-button
|
||||||
|
type="dashed"
|
||||||
|
@click="addLink"
|
||||||
|
v-if="formType==='update'"
|
||||||
|
>返回添加</a-button>
|
||||||
</a-button-group>
|
</a-button-group>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-form>
|
</a-form>
|
||||||
|
@ -41,7 +63,8 @@
|
||||||
:md="14"
|
:md="14"
|
||||||
:sm="24"
|
:sm="24"
|
||||||
:xs="24"
|
:xs="24"
|
||||||
:style="{ 'padding-bottom': '12px' }">
|
:style="{ 'padding-bottom': '12px' }"
|
||||||
|
>
|
||||||
<a-card title="所有友情链接">
|
<a-card title="所有友情链接">
|
||||||
<a-table
|
<a-table
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
|
@ -49,13 +72,30 @@
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:rowKey="link => link.id"
|
:rowKey="link => link.id"
|
||||||
>
|
>
|
||||||
<template slot="url" slot-scope="text">
|
<template
|
||||||
<a target="_blank" :href="text">{{ text }}</a>
|
slot="url"
|
||||||
|
slot-scope="text"
|
||||||
|
>
|
||||||
|
<a
|
||||||
|
target="_blank"
|
||||||
|
:href="text"
|
||||||
|
>{{ text }}</a>
|
||||||
</template>
|
</template>
|
||||||
<ellipsis :length="15" tooltip slot="name" slot-scope="text">{{ text }}</ellipsis>
|
<ellipsis
|
||||||
<span slot="action" slot-scope="text, record">
|
:length="15"
|
||||||
<a href="javascript:;" @click="editLink(record.id)">编辑</a>
|
tooltip
|
||||||
<a-divider type="vertical"/>
|
slot="name"
|
||||||
|
slot-scope="text"
|
||||||
|
>{{ text }}</ellipsis>
|
||||||
|
<span
|
||||||
|
slot="action"
|
||||||
|
slot-scope="text, record"
|
||||||
|
>
|
||||||
|
<a
|
||||||
|
href="javascript:;"
|
||||||
|
@click="editLink(record.id)"
|
||||||
|
>编辑</a>
|
||||||
|
<a-divider type="vertical" />
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
:title="'你确定要删除【' + record.name + '】链接?'"
|
:title="'你确定要删除【' + record.name + '】链接?'"
|
||||||
@confirm="deleteLink(record.id)"
|
@confirm="deleteLink(record.id)"
|
||||||
|
@ -73,7 +113,6 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Ellipsis } from '@/components'
|
|
||||||
import linkApi from '@/api/link'
|
import linkApi from '@/api/link'
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
|
@ -97,9 +136,6 @@ const columns = [
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
export default {
|
export default {
|
||||||
components: {
|
|
||||||
Ellipsis
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
title: '添加友情链接',
|
title: '添加友情链接',
|
||||||
|
|
Loading…
Reference in New Issue