|
| 1 | +<template> |
| 2 | + <div> |
| 3 | + <a-card :bordered="false" class="ant-pro-components-tag-select"> |
| 4 | + <a-form :form="form" layout="inline"> |
| 5 | + <standard-form-row title="所属类目" block style="padding-bottom: 11px;"> |
| 6 | + <a-form-item> |
| 7 | + <tag-select> |
| 8 | + <tag-select-option value="Category1">类目一</tag-select-option> |
| 9 | + <tag-select-option value="Category2">类目二</tag-select-option> |
| 10 | + <tag-select-option value="Category3">类目三</tag-select-option> |
| 11 | + <tag-select-option value="Category4">类目四</tag-select-option> |
| 12 | + <tag-select-option value="Category5">类目五</tag-select-option> |
| 13 | + <tag-select-option value="Category6">类目六</tag-select-option> |
| 14 | + <tag-select-option value="Category7">类目七</tag-select-option> |
| 15 | + <tag-select-option value="Category8">类目八</tag-select-option> |
| 16 | + <tag-select-option value="Category9">类目九</tag-select-option> |
| 17 | + <tag-select-option value="Category10">类目十</tag-select-option> |
| 18 | + </tag-select> |
| 19 | + </a-form-item> |
| 20 | + </standard-form-row> |
| 21 | + |
| 22 | + <standard-form-row title="其它选项" grid last> |
| 23 | + <a-row> |
| 24 | + <a-col :lg="8" :md="10" :sm="10" :xs="24"> |
| 25 | + <a-form-item :wrapper-col="{ sm: { span: 16 }, xs: { span: 24 } }" label="作者"> |
| 26 | + <a-select |
| 27 | + style="max-width: 200px; width: 100%;" |
| 28 | + mode="multiple" |
| 29 | + placeholder="不限" |
| 30 | + v-decorator="['author']" |
| 31 | + @change="handleChange" |
| 32 | + > |
| 33 | + <a-select-option value="lisa">王昭君</a-select-option> |
| 34 | + </a-select> |
| 35 | + </a-form-item> |
| 36 | + </a-col> |
| 37 | + <a-col :lg="8" :md="10" :sm="10" :xs="24"> |
| 38 | + <a-form-item :wrapper-col="{ sm: { span: 16 }, xs: { span: 24 } }" label="好评度"> |
| 39 | + <a-select |
| 40 | + style="max-width: 200px; width: 100%;" |
| 41 | + placeholder="不限" |
| 42 | + v-decorator="['rate']" |
| 43 | + > |
| 44 | + <a-select-option value="good">优秀</a-select-option> |
| 45 | + <a-select-option value="normal">普通</a-select-option> |
| 46 | + </a-select> |
| 47 | + </a-form-item> |
| 48 | + </a-col> |
| 49 | + </a-row> |
| 50 | + </standard-form-row> |
| 51 | + </a-form> |
| 52 | + </a-card> |
| 53 | + |
| 54 | + <div class="ant-pro-pages-list-applications-filterCardList"> |
| 55 | + <a-list :loading="loading" :data-source="data" :grid="{ gutter: 24, xl: 4, lg: 3, md: 3, sm: 2, xs: 1 }" style="margin-top: 24px;"> |
| 56 | + <a-list-item slot="renderItem" slot-scope="item"> |
| 57 | + <a-card :body-style="{ paddingBottom: 20 }" hoverable> |
| 58 | + <a-card-meta :title="item.title"> |
| 59 | + <template slot="avatar"> |
| 60 | + <a-avatar size="small" :src="item.avatar"/> |
| 61 | + </template> |
| 62 | + </a-card-meta> |
| 63 | + <template slot="actions"> |
| 64 | + <a-tooltip title="下载"> |
| 65 | + <a-icon type="download" /> |
| 66 | + </a-tooltip> |
| 67 | + <a-tooltip title="编辑"> |
| 68 | + <a-icon type="edit" /> |
| 69 | + </a-tooltip> |
| 70 | + <a-tooltip title="分享"> |
| 71 | + <a-icon type="share-alt" /> |
| 72 | + </a-tooltip> |
| 73 | + <a-dropdown> |
| 74 | + <a class="ant-dropdown-link"> |
| 75 | + <a-icon type="ellipsis" /> |
| 76 | + </a> |
| 77 | + <a-menu slot="overlay"> |
| 78 | + <a-menu-item> |
| 79 | + <a href="javascript:;">1st menu item</a> |
| 80 | + </a-menu-item> |
| 81 | + <a-menu-item> |
| 82 | + <a href="javascript:;">2nd menu item</a> |
| 83 | + </a-menu-item> |
| 84 | + <a-menu-item> |
| 85 | + <a href="javascript:;">3rd menu item</a> |
| 86 | + </a-menu-item> |
| 87 | + </a-menu> |
| 88 | + </a-dropdown> |
| 89 | + </template> |
| 90 | + <div class=""> |
| 91 | + <card-info active-user="100" new-user="999"></card-info> |
| 92 | + </div> |
| 93 | + </a-card> |
| 94 | + </a-list-item> |
| 95 | + </a-list> |
| 96 | + </div> |
| 97 | + </div> |
| 98 | +</template> |
| 99 | + |
| 100 | +<script> |
| 101 | +import moment from 'moment' |
| 102 | +import { TagSelect, StandardFormRow, Ellipsis, AvatarList } from '@/components' |
| 103 | +import CardInfo from './components/CardInfo' |
| 104 | +const TagSelectOption = TagSelect.Option |
| 105 | +const AvatarListItem = AvatarList.AvatarItem |
| 106 | +
|
| 107 | +export default { |
| 108 | + components: { |
| 109 | + AvatarList, |
| 110 | + AvatarListItem, |
| 111 | + Ellipsis, |
| 112 | + TagSelect, |
| 113 | + TagSelectOption, |
| 114 | + StandardFormRow, |
| 115 | + CardInfo |
| 116 | + }, |
| 117 | + data () { |
| 118 | + return { |
| 119 | + data: [], |
| 120 | + form: this.$form.createForm(this), |
| 121 | + loading: true |
| 122 | + } |
| 123 | + }, |
| 124 | + filters: { |
| 125 | + fromNow (date) { |
| 126 | + return moment(date).fromNow() |
| 127 | + } |
| 128 | + }, |
| 129 | + mounted () { |
| 130 | + this.getList() |
| 131 | + }, |
| 132 | + methods: { |
| 133 | + handleChange (value) { |
| 134 | + console.log(`selected ${value}`) |
| 135 | + }, |
| 136 | + getList () { |
| 137 | + this.$http.get('/list/article', { params: { count: 8 } }).then(res => { |
| 138 | + console.log('res', res) |
| 139 | + this.data = res.result |
| 140 | + this.loading = false |
| 141 | + }) |
| 142 | + } |
| 143 | + } |
| 144 | +} |
| 145 | +</script> |
| 146 | + |
| 147 | +<style lang="less" scoped> |
| 148 | +.ant-pro-components-tag-select { |
| 149 | + /deep/ .ant-pro-tag-select .ant-tag { |
| 150 | + margin-right: 24px; |
| 151 | + padding: 0 8px; |
| 152 | + font-size: 14px; |
| 153 | + } |
| 154 | +} |
| 155 | +.ant-pro-pages-list-projects-cardList { |
| 156 | + margin-top: 24px; |
| 157 | +
|
| 158 | + /deep/ .ant-card-meta-title { |
| 159 | + margin-bottom: 4px; |
| 160 | + } |
| 161 | +
|
| 162 | + /deep/ .ant-card-meta-description { |
| 163 | + height: 44px; |
| 164 | + overflow: hidden; |
| 165 | + line-height: 22px; |
| 166 | + } |
| 167 | +
|
| 168 | + .cardItemContent { |
| 169 | + display: flex; |
| 170 | + height: 20px; |
| 171 | + margin-top: 16px; |
| 172 | + margin-bottom: -4px; |
| 173 | + line-height: 20px; |
| 174 | +
|
| 175 | + > span { |
| 176 | + flex: 1 1; |
| 177 | + color: rgba(0,0,0,.45); |
| 178 | + font-size: 12px; |
| 179 | + } |
| 180 | +
|
| 181 | + /deep/ .ant-pro-avatar-list { |
| 182 | + flex: 0 1 auto; |
| 183 | + } |
| 184 | + } |
| 185 | +} |
| 186 | +</style> |
0 commit comments