parent
							
								
									12d2ff8e80
								
							
						
					
					
						commit
						2cef87a631
					
				
				 4 changed files with 88 additions and 43 deletions
			
			
		@ -1,38 +1,80 @@ | 
				
			||||
<template> | 
				
			||||
    <a-card class="task-card" size="large" :title="title" :bordered="false" :bodyStyle="{backgroundColor: '#e1e4e8'}"> | 
				
			||||
      <div slot="extra"> | 
				
			||||
  <div class="task-card"> | 
				
			||||
    <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="more" style="margin-left: 8px" type="ellipsis" /> | 
				
			||||
      </div> | 
				
			||||
    </div> | 
				
			||||
    <div class="task-content"> | 
				
			||||
      <draggable :options="dragOptions"> | 
				
			||||
        <slot></slot> | 
				
			||||
    </a-card> | 
				
			||||
      </draggable> | 
				
			||||
    </div> | 
				
			||||
  </div> | 
				
			||||
</template> | 
				
			||||
 | 
				
			||||
<script> | 
				
			||||
import ACard from 'ant-design-vue/es/card/Card' | 
				
			||||
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 { | 
				
			||||
  name: 'TaskCard', | 
				
			||||
  components: {AIcon, ACard}, | 
				
			||||
  props: ['title'], | 
				
			||||
  components: {AIcon, Draggable}, | 
				
			||||
  props: ['title', 'group'], | 
				
			||||
  data () { | 
				
			||||
    return { | 
				
			||||
      dragOptions: {...dragOptions, group: this.group} | 
				
			||||
    } | 
				
			||||
  }, | 
				
			||||
  computed: { | 
				
			||||
    count () { | 
				
			||||
      return this.$slots.default.length | 
				
			||||
    } | 
				
			||||
  } | 
				
			||||
} | 
				
			||||
</script> | 
				
			||||
 | 
				
			||||
<style lang="less" scoped> | 
				
			||||
<style lang="less"> | 
				
			||||
  .task-card{ | 
				
			||||
    width: 33.33%; | 
				
			||||
    font-size: 24px; | 
				
			||||
    font-weight: bolder; | 
				
			||||
    padding: 8px 8px; | 
				
			||||
    background-color: #e1e4e8; | 
				
			||||
    .add{ | 
				
			||||
      cursor: pointer; | 
				
			||||
    border-radius: 6px; | 
				
			||||
    border: 1px solid #d1d4d8; | 
				
			||||
    .task-head{ | 
				
			||||
      margin-bottom: 8px; | 
				
			||||
      .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); | 
				
			||||
        } | 
				
			||||
      } | 
				
			||||
    .more{ | 
				
			||||
      .actions{ | 
				
			||||
        display: inline-block; | 
				
			||||
        float: right; | 
				
			||||
        font-size: 18px; | 
				
			||||
        font-weight: bold; | 
				
			||||
        i{ | 
				
			||||
          cursor: pointer; | 
				
			||||
        } | 
				
			||||
      } | 
				
			||||
    } | 
				
			||||
  } | 
				
			||||
</style> | 
				
			||||
 | 
				
			||||
					Loading…
					
					
				
		Reference in new issue