<template>
  <div>
    <div class="task_state">
      <div class="task_list_name" v-html="hightLight(searchValue,item.taskSubject)">
      </div>
    </div>
    <div class="task_list_word">
      <div class="task_list_flowname">
        <div class="task_list_flex">
          <div class="task_list_time">
            <i class="icon-time-circle"></i>
            {{ item.createTime }}
          </div>
          <div class="task_list_procDefName" style="margin-left: 20px">
            <i class="icon-dangqianjiedian"></i>
            {{ item.taskName }}
          </div>
        </div>
        <div>
          <i class="icon-liuchengbianhao"></i>
          <span v-html="hightLight(searchValue,item.procInstId)"></span>
          <i
            class="icon-fuzhi"
            style="color: #409eff"
            @click.stop="(event) => clipboard(item.procInstId, event)"
          ></i>
        </div>
      </div>
      <div class="task_list_user_box">
        <div class="task_list_user">
          <div :class="!item.imgSrc ? 'left-img-box' : 'left-img-box-image'">
            <img
              v-if="item.imgSrc"
              class="image"
              :src="item.imgSrc"
            />
            <span v-else class="text">
              {{ item.assigneeName.replace(/,/g, '/').substr(0, 1) }}
            </span>
          </div>
          <span>{{ item.assigneeName }}</span>
        </div>
        <div class="task_list_operation" v-if="!item.finishTime">
          <van-button
            type="info"
            size="small"
            :disabled="item.supportMobile != 1"
            @click.stop="$emit('delBpmTask', item)"
          >
            收回
          </van-button>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
  import clipboard from '@/utils/clipboard'
  import hightLight from '@/mixins/hightLight.js'
  export default {
    name: 'MyDelegate',
    mixins: [hightLight],
    props: ['item', 'currentActiveTab','searchValue'],
    data() {
      return {}
    },
    methods: {
      clipboard,
    },
  }
</script>
<style lang="scss" scoped>
  .task_state {
    display: flex;
    align-items: center;
    justify-self: start;
    white-space: nowrap;
    .task_list_name {
      word-break: break-all;
      white-space: nowrap;
      text-overflow: ellipsis;
      overflow: hidden;
      font-size: $base-font-size-big;
      font-weight: bold;
      color: $base-text-color;
    }
  }
  .task_list_word {
    font-size: $base-font-size-small;
    i {
      font-size: $base-font-size-big;
    }
    .task_list_flowname {
      padding: 7px 0;
      color: $base-gray-text-color;
      border-bottom: 1px solid $base-gray-line-color;
      .task_list_flex {
        display: flex;
        .icon-time-circle,.icon-dangqianjiedian{
          font-size: 16px
        }
      }
      .task_list_procDefName {
        word-break: break-all;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
        max-width: 140px;
      }
    }
    .task_list_user_box {
      display: flex;
      align-items: center;
      justify-content: space-between;
      white-space: nowrap;
      padding-top: 12px;

      .task_list_user {
        display: flex;
        align-items: center;
        .left-img-box {
          width: 30px;
          height: 30px;
          line-height: 30px;
          text-align: center;
          border-radius: 50%;
          margin-right: 4px;
          background: $--color-primary;
          .text {
            color: $base-white-color;
          }
          .span {
            color: $base-text-color;
          }
          .image {
            border-radius: 50%;
          }
        }

        .left-img-box-image {
          width: 30px;
          height: 30px;
          margin-right: 4px;
          .image {
            border-radius: 50%;
            width: 30px;
            height: 30px;
          }
        }
      }
    }
  }
  .task_list_operation {
    float: right;
    .van-button--small {
      width: 78px;
      border-radius: 8px;
    }
  }
</style>
