parent
							
								
									12d2ff8e80
								
							
						
					
					
						commit
						2cef87a631
					
				
				 4 changed files with 88 additions and 43 deletions
			
			
		| @ -1,38 +1,80 @@ | |||||||
| <template> | <template> | ||||||
|     <a-card class="task-card" size="large" :title="title" :bordered="false" :bodyStyle="{backgroundColor: '#e1e4e8'}"> |   <div class="task-card"> | ||||||
|       <div slot="extra"> |     <div class="task-head"> | ||||||
|  |       <h3 class="title"><span v-if="count">{{count}}</span>{{title}}</h3> | ||||||
|  |       <div class="actions" style="float: right"> | ||||||
|         <a-icon class="add" type="plus" draggable="true"/> |         <a-icon class="add" type="plus" draggable="true"/> | ||||||
|         <a-icon class="more" style="margin-left: 8px" type="ellipsis" /> |         <a-icon class="more" style="margin-left: 8px" type="ellipsis" /> | ||||||
|       </div> |       </div> | ||||||
|       <slot></slot> |     </div> | ||||||
|     </a-card> |     <div class="task-content"> | ||||||
|  |       <draggable :options="dragOptions"> | ||||||
|  |         <slot></slot> | ||||||
|  |       </draggable> | ||||||
|  |     </div> | ||||||
|  |   </div> | ||||||
| </template> | </template> | ||||||
| 
 | 
 | ||||||
| <script> | <script> | ||||||
| import ACard from 'ant-design-vue/es/card/Card' |  | ||||||
| import AIcon from 'ant-design-vue/es/icon/icon' | import AIcon from 'ant-design-vue/es/icon/icon' | ||||||
|  | import Draggable from 'vuedraggable' | ||||||
|  | 
 | ||||||
|  | const dragOptions = { | ||||||
|  |   sort: true, | ||||||
|  |   scroll: true, | ||||||
|  |   scrollSpeed: 2, | ||||||
|  |   animation: 150, | ||||||
|  |   ghostClass: 'dragable-ghost', | ||||||
|  |   chosenClass: 'dragable-chose', | ||||||
|  |   dragClass: 'dragable-drag' | ||||||
|  | } | ||||||
|  | 
 | ||||||
| export default { | export default { | ||||||
|   name: 'TaskCard', |   name: 'TaskCard', | ||||||
|   components: {AIcon, ACard}, |   components: {AIcon, Draggable}, | ||||||
|   props: ['title'], |   props: ['title', 'group'], | ||||||
|   data () { |   data () { | ||||||
|     return { |     return { | ||||||
|  |       dragOptions: {...dragOptions, group: this.group} | ||||||
|  |     } | ||||||
|  |   }, | ||||||
|  |   computed: { | ||||||
|  |     count () { | ||||||
|  |       return this.$slots.default.length | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| } | } | ||||||
| </script> | </script> | ||||||
| 
 | 
 | ||||||
| <style lang="less" scoped> | <style lang="less"> | ||||||
|   .task-card{ |   .task-card{ | ||||||
|     width: 33.33%; |     width: 33.33%; | ||||||
|     font-size: 24px; |     padding: 8px 8px; | ||||||
|     font-weight: bolder; |  | ||||||
|     background-color: #e1e4e8; |     background-color: #e1e4e8; | ||||||
|     .add{ |     border-radius: 6px; | ||||||
|       cursor: pointer; |     border: 1px solid #d1d4d8; | ||||||
|     } |     .task-head{ | ||||||
|     .more{ |       margin-bottom: 8px; | ||||||
|       cursor: pointer; |       .title{ | ||||||
|  |         display: inline-block; | ||||||
|  |         span{ | ||||||
|  |           display: inline-block; | ||||||
|  |           border-radius: 10px; | ||||||
|  |           margin: 0 8px; | ||||||
|  |           font-size: 12px; | ||||||
|  |           padding: 2px 6px; | ||||||
|  |           background-color: rgba(27,31,35,0.15); | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |       .actions{ | ||||||
|  |         display: inline-block; | ||||||
|  |         float: right; | ||||||
|  |         font-size: 18px; | ||||||
|  |         font-weight: bold; | ||||||
|  |         i{ | ||||||
|  |           cursor: pointer; | ||||||
|  |         } | ||||||
|  |       } | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| </style> | </style> | ||||||
|  | |||||||
					Loading…
					
					
				
		Reference in new issue