mirror of
https://github.com/iczer/vue-antd-admin
synced 2025-04-06 04:00:06 +08:00
新增TagSelect组件
This commit is contained in:
parent
6bc0f1f074
commit
9a4afee5c2
@ -2,7 +2,7 @@
|
|||||||
<div style="margin: -24px -24px 0px">
|
<div style="margin: -24px -24px 0px">
|
||||||
<page-header :breadcrumb="breadcrumb" :title="title" :logo="avatar">
|
<page-header :breadcrumb="breadcrumb" :title="title" :logo="avatar">
|
||||||
<slot slot="content" name="headerContent"></slot>
|
<slot slot="content" name="headerContent"></slot>
|
||||||
<div slot="content" v-if="!this.$slots.headerContent">
|
<div slot="content" v-if="!this.$slots.headerContent && desc">
|
||||||
<p style="font-size: 14px;line-height: 1.5;color: rgba(0,0,0,.65)">{{desc}}</p>
|
<p style="font-size: 14px;line-height: 1.5;color: rgba(0,0,0,.65)">{{desc}}</p>
|
||||||
<div class="link">
|
<div class="link">
|
||||||
<template v-for="(link, index) in linkList">
|
<template v-for="(link, index) in linkList">
|
||||||
|
@ -1,16 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<a-card style="" :bordered="false">
|
<search-form />
|
||||||
bbb
|
<a-card :bordered="false">
|
||||||
|
contentB
|
||||||
</a-card>
|
</a-card>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ACard from 'vue-antd-ui/es/card/Card'
|
import ACard from 'vue-antd-ui/es/card/Card'
|
||||||
|
import SearchForm from './SearchForm'
|
||||||
export default {
|
export default {
|
||||||
name: 'ApplicationList',
|
name: 'ApplicationList',
|
||||||
components: {ACard}
|
components: {SearchForm, ACard}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -1,16 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<a-card style="" :bordered="false">
|
<search-form />
|
||||||
aaaa
|
<a-card :bordered="false">
|
||||||
|
contentA
|
||||||
</a-card>
|
</a-card>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ACard from 'vue-antd-ui/es/card/Card'
|
import ACard from 'vue-antd-ui/es/card/Card'
|
||||||
|
import SearchForm from './SearchForm'
|
||||||
export default {
|
export default {
|
||||||
name: 'ArticleList',
|
name: 'ArticleList',
|
||||||
components: {ACard}
|
components: {SearchForm, ACard}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -1,16 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<a-card style="" :bordered="false">
|
<search-form />
|
||||||
ccc
|
<a-card :bordered="false">
|
||||||
|
contentC
|
||||||
</a-card>
|
</a-card>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ACard from 'vue-antd-ui/es/card/Card'
|
import ACard from 'vue-antd-ui/es/card/Card'
|
||||||
|
import SearchForm from './SearchForm'
|
||||||
export default {
|
export default {
|
||||||
name: 'ProjectList',
|
name: 'ProjectList',
|
||||||
components: {ACard}
|
components: {SearchForm, ACard}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
46
src/components/list/Search/SearchForm.vue
Normal file
46
src/components/list/Search/SearchForm.vue
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
<template>
|
||||||
|
<a-card :bordered="false" class="search-form">
|
||||||
|
<a-form>
|
||||||
|
<a-form-item
|
||||||
|
label="所属类目"
|
||||||
|
:labelCol="{span: 1}"
|
||||||
|
:wrapperCol="{span: 23}"
|
||||||
|
>
|
||||||
|
<tag-select>
|
||||||
|
<tag-select-option>科目一</tag-select-option>
|
||||||
|
<tag-select-option>科目一</tag-select-option>
|
||||||
|
<tag-select-option>科目一</tag-select-option>
|
||||||
|
<tag-select-option>科目一</tag-select-option>
|
||||||
|
<tag-select-option>科目一</tag-select-option>
|
||||||
|
<tag-select-option>科目一</tag-select-option>
|
||||||
|
<tag-select-option>科目一</tag-select-option>
|
||||||
|
<tag-select-option>科目一</tag-select-option>
|
||||||
|
<tag-select-option>科目一</tag-select-option>
|
||||||
|
<tag-select-option>科目一</tag-select-option>
|
||||||
|
<tag-select-option>科目一</tag-select-option>
|
||||||
|
</tag-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-form>
|
||||||
|
</a-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import ACard from 'vue-antd-ui/es/card/Card'
|
||||||
|
import AForm from 'vue-antd-ui/es/form/Form'
|
||||||
|
import AFormItem from 'vue-antd-ui/es/form/FormItem'
|
||||||
|
import AInput from 'vue-antd-ui/es/input/Input'
|
||||||
|
import TagSelect from '../../tool/TagSelect'
|
||||||
|
|
||||||
|
const TagSelectOption = TagSelect.Option
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'SearchForm',
|
||||||
|
components: {TagSelectOption, TagSelect, AInput, AFormItem, AForm, ACard}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.search-form{
|
||||||
|
margin-bottom: 24px;
|
||||||
|
}
|
||||||
|
</style>
|
@ -32,11 +32,11 @@ export default {
|
|||||||
components: {ATabPane, ATabs, AInputSearch, AButton, AInputGroup, AInput},
|
components: {ATabPane, ATabs, AInputSearch, AButton, AInputGroup, AInput},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
activeKey: ''
|
activeKey: '1'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'$route': (val) => {
|
'$route': function (val) {
|
||||||
switch (val.path) {
|
switch (val.path) {
|
||||||
case '/list/search/article':
|
case '/list/search/article':
|
||||||
this.activeKey = '1'
|
this.activeKey = '1'
|
||||||
@ -48,12 +48,13 @@ export default {
|
|||||||
this.activeKey = '3'
|
this.activeKey = '3'
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
this.activeKey = '1'
|
this.activeKey = '2'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
navigate (key) {
|
navigate (key) {
|
||||||
|
this.activeKey = key
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case '1':
|
case '1':
|
||||||
this.$router.push('/list/search/article')
|
this.$router.push('/list/search/article')
|
@ -14,8 +14,8 @@
|
|||||||
<div class="action"><slot name="action"></slot></div>
|
<div class="action"><slot name="action"></slot></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="content"><slot name="content"></slot></div>
|
<div v-if="this.$slots.content" class="content"><slot name="content"></slot></div>
|
||||||
<div class="extra"><slot name="extra"></slot></div>
|
<div v-if="this.$slots.extra" class="extra"><slot name="extra"></slot></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -80,6 +80,7 @@ export default {
|
|||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: rgba(0,0,0,.85);
|
color: rgba(0,0,0,.85);
|
||||||
|
margin-bottom: 16px;
|
||||||
}
|
}
|
||||||
.content{
|
.content{
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
|
36
src/components/tool/TagSelect.vue
Normal file
36
src/components/tool/TagSelect.vue
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
<template>
|
||||||
|
<div class="tag-select">
|
||||||
|
<tag-select-option>全部</tag-select-option>
|
||||||
|
<slot></slot>
|
||||||
|
<a class="trigger">展开<a-icon type="down"/></a>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import ASelect from 'vue-antd-ui/es/select/index'
|
||||||
|
import ACheckableTag from 'vue-antd-ui/es/tag/CheckableTag'
|
||||||
|
import TagSelectOption from './TagSelectOption'
|
||||||
|
import AIcon from 'vue-antd-ui/es/icon/icon'
|
||||||
|
export default {
|
||||||
|
name: 'TagSelect',
|
||||||
|
Option: TagSelectOption,
|
||||||
|
components: {AIcon, TagSelectOption, ACheckableTag, ASelect}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.tag-select{
|
||||||
|
user-select: none;
|
||||||
|
margin-left: -8px;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
max-height: 32px;
|
||||||
|
line-height: 32px;
|
||||||
|
padding-right: 50px;
|
||||||
|
}
|
||||||
|
.trigger{
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
</style>
|
34
src/components/tool/TagSelectOption.vue
Normal file
34
src/components/tool/TagSelectOption.vue
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
<template>
|
||||||
|
<a-checkable-tag class="tag-default" v-model="checked">
|
||||||
|
<slot></slot>
|
||||||
|
</a-checkable-tag>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import ACheckableTag from 'vue-antd-ui/es/tag/CheckableTag'
|
||||||
|
export default {
|
||||||
|
name: 'TagSelectOption',
|
||||||
|
components: {ACheckableTag},
|
||||||
|
options: {
|
||||||
|
size: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: 'default'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
checked: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.tag-default{
|
||||||
|
font-size: 14px;
|
||||||
|
padding: 0 8px;
|
||||||
|
height: auto;
|
||||||
|
margin-right: 24px;
|
||||||
|
}
|
||||||
|
</style>
|
@ -16,10 +16,10 @@ import Error from '@/components/result/Error'
|
|||||||
import QueryList from '@/components/list/QueryList'
|
import QueryList from '@/components/list/QueryList'
|
||||||
import StandardList from '@/components/list/StandardList'
|
import StandardList from '@/components/list/StandardList'
|
||||||
import CardList from '@/components/list/CardList'
|
import CardList from '@/components/list/CardList'
|
||||||
import SearchLayout from '@/components/list/SearchLayout'
|
import SearchLayout from '@/components/list/search/SearchLayout'
|
||||||
import ArticleList from '@/components/list/ArticleList'
|
import ArticleList from '@/components/list/search/ArticleList'
|
||||||
import ApplicationList from '@/components/list/ApplicationList'
|
import ApplicationList from '@/components/list/search/ApplicationList'
|
||||||
import ProjectList from '@/components/list/ProjectList'
|
import ProjectList from '@/components/list/search/ProjectList'
|
||||||
import WorkPlace from '@/components/dashboard/WorkPlace'
|
import WorkPlace from '@/components/dashboard/WorkPlace'
|
||||||
import Login from '@/components/login/Login'
|
import Login from '@/components/login/Login'
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user