StandardList.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <template>
  2. <div>
  3. <a-card :bordered="false">
  4. <a-row>
  5. <a-col :sm="8" :xs="24">
  6. <head-info title="我的待办" content="8个任务" :bordered="true"/>
  7. </a-col>
  8. <a-col :sm="8" :xs="24">
  9. <head-info title="本周任务平均处理时间" content="32分钟" :bordered="true"/>
  10. </a-col>
  11. <a-col :sm="8" :xs="24">
  12. <head-info title="本周完成任务数" content="24个"/>
  13. </a-col>
  14. </a-row>
  15. </a-card>
  16. <a-card
  17. style="margin-top: 24px"
  18. :bordered="false"
  19. title="标准列表">
  20. <div slot="extra">
  21. <a-radio-group v-model="status">
  22. <a-radio-button value="all">全部</a-radio-button>
  23. <a-radio-button value="processing">进行中</a-radio-button>
  24. <a-radio-button value="waiting">等待中</a-radio-button>
  25. </a-radio-group>
  26. <a-input-search style="margin-left: 16px; width: 272px;" />
  27. </div>
  28. <div class="operate">
  29. <a-button type="dashed" style="width: 100%" icon="plus" @click="$refs.taskForm.add()">添加</a-button>
  30. </div>
  31. <a-list size="large" :pagination="{showSizeChanger: true, showQuickJumper: true, pageSize: 5, total: 50}">
  32. <a-list-item :key="index" v-for="(item, index) in data">
  33. <a-list-item-meta :description="item.description">
  34. <a-avatar slot="avatar" size="large" shape="square" :src="item.avatar"/>
  35. <a slot="title">{{ item.title }}</a>
  36. </a-list-item-meta>
  37. <div slot="actions">
  38. <a @click="edit(item)">编辑</a>
  39. </div>
  40. <div slot="actions">
  41. <a-dropdown>
  42. <a-menu slot="overlay">
  43. <a-menu-item><a>编辑</a></a-menu-item>
  44. <a-menu-item><a>删除</a></a-menu-item>
  45. </a-menu>
  46. <a>更多<a-icon type="down"/></a>
  47. </a-dropdown>
  48. </div>
  49. <div class="list-content">
  50. <div class="list-content-item">
  51. <span>Owner</span>
  52. <p>{{ item.owner }}</p>
  53. </div>
  54. <div class="list-content-item">
  55. <span>开始时间</span>
  56. <p>{{ item.startAt }}</p>
  57. </div>
  58. <div class="list-content-item">
  59. <a-progress :percent="item.progress.value" :status="!item.progress.status ? null : item.progress.status" style="width: 180px" />
  60. </div>
  61. </div>
  62. </a-list-item>
  63. </a-list>
  64. </a-card>
  65. </div>
  66. </template>
  67. <script>
  68. import HeadInfo from '@/components/tools/HeadInfo'
  69. import TaskForm from './modules/TaskForm'
  70. const data = []
  71. data.push({
  72. title: 'Alipay',
  73. avatar: 'https://gw.alipayobjects.com/zos/rmsportal/WdGqmHpayyMjiEhcKoVE.png',
  74. description: '那是一种内在的东西, 他们到达不了,也无法触及的',
  75. owner: '付晓晓',
  76. startAt: '2018-07-26 22:44',
  77. progress: {
  78. value: 90
  79. }
  80. })
  81. data.push({
  82. title: 'Angular',
  83. avatar: 'https://gw.alipayobjects.com/zos/rmsportal/zOsKZmFRdUtvpqCImOVY.png',
  84. description: '希望是一个好东西,也许是最好的,好东西是不会消亡的',
  85. owner: '曲丽丽',
  86. startAt: '2018-07-26 22:44',
  87. progress: {
  88. value: 54
  89. }
  90. })
  91. data.push({
  92. title: 'Ant Design',
  93. avatar: 'https://gw.alipayobjects.com/zos/rmsportal/dURIMkkrRFpPgTuzkwnB.png',
  94. description: '生命就像一盒巧克力,结果往往出人意料',
  95. owner: '林东东',
  96. startAt: '2018-07-26 22:44',
  97. progress: {
  98. value: 66
  99. }
  100. })
  101. data.push({
  102. title: 'Guns',
  103. avatar: 'https://gw.alipayobjects.com/zos/rmsportal/sfjbOqnsXXJgNCjCzDBL.png',
  104. description: '城镇中有那么多的酒馆,她却偏偏走进了我的酒馆',
  105. owner: '周星星',
  106. startAt: '2018-07-26 22:44',
  107. progress: {
  108. value: 30
  109. }
  110. })
  111. data.push({
  112. title: 'Bootstrap',
  113. avatar: 'https://gw.alipayobjects.com/zos/rmsportal/siCrBXXhmvTQGWPNLBow.png',
  114. description: '那时候我只会想自己想要什么,从不想自己拥有什么',
  115. owner: '吴加好',
  116. startAt: '2018-07-26 22:44',
  117. progress: {
  118. status: 'exception',
  119. value: 100
  120. }
  121. })
  122. export default {
  123. name: 'StandardList',
  124. components: {
  125. HeadInfo,
  126. //TaskForm
  127. },
  128. data () {
  129. return {
  130. data,
  131. status: 'all'
  132. }
  133. },
  134. methods: {
  135. edit (record) {
  136. console.log('record', record)
  137. // mockdata
  138. record.taskName = '测试'
  139. // mockend
  140. this.$dialog(TaskForm,
  141. // component props
  142. {
  143. record
  144. },
  145. // modal props
  146. {
  147. title: '操作',
  148. width: 700,
  149. centered: true,
  150. maskClosable: false
  151. })
  152. }
  153. }
  154. }
  155. </script>
  156. <style lang="less" scoped>
  157. .ant-avatar-lg {
  158. width: 48px;
  159. height: 48px;
  160. line-height: 48px;
  161. }
  162. .list-content-item {
  163. color: rgba(0, 0, 0, .45);
  164. display: inline-block;
  165. vertical-align: middle;
  166. font-size: 14px;
  167. margin-left: 40px;
  168. span {
  169. line-height: 20px;
  170. }
  171. p {
  172. margin-top: 4px;
  173. margin-bottom: 0;
  174. line-height: 22px;
  175. }
  176. }
  177. </style>