<template>
  <!-- <div class="particulars-common"> -->
  <transition name="slide-fade">
    <el-card v-loading="loading"
             class="particulars-common"
             :style="{ 'z-index': zIndex }">
      <!-- 头部信息 -->
      <div class="clear-fix"
           slot="header"
           v-if="taskData">
        <div class="img-box-grop">
          <div>
            <el-popover placement="bottom-start"
                        width="200"
                        v-model="priorityVisible"
                        trigger="click">
              <div class="particulars-priority-box">
                <p v-for="(item, index) in particularsList"
                   :key="index"
                   @click="priorityBtn(item, taskData.priority)">
                  <span :style="{'border-color': item.color, 'background': item.id == taskData.priority ? item.color: 'transparent', 'color': item.id == taskData.priority ? '#fff': item.color}">{{item.label}}</span>
                </p>
              </div>
              <span slot="reference">
                <i class="wukong wukong-lightning"></i>
                <span>优先级</span>
              </span>
            </el-popover>
          </div>
          <div>
            <tag-index :placement="'bottom'"
                       :taskData="taskData">
              <div slot="editIndex">
                <i class="wukong wukong-label"></i>
                <span>标签</span>
              </div>
            </tag-index>
          </div>
          <div @click="addSubtasksBtn"
               v-if="taskData.pid == 0">
            <i class="wukong wukong-sub-task"></i>
            <span>子任务</span>
          </div>
          <div>
            <el-upload class="upload-demo"
                       action="https://jsonplaceholder.typicode.com/posts/"
                       multiple
                       :http-request="httpRequest"
                       list-type="picture">
              <i class="wukong wukong-file"></i>
              <span>附件</span>
            </el-upload>
          </div>
          <div>
            <el-popover placement="bottom"
                        width="80"
                        trigger="click">
              <div class="more-btn-group">
                <p @click="moreDelete">删 除</p>
              </div>
              <span slot="reference">
                <img src="@/assets/img/task_ellipsis.png">
              </span>
            </el-popover>
          </div>
          <div class="task-close-img">
            <img src="@/assets/img/task_close.png"
                 @click="closeBtn">
          </div>
        </div>
      </div>
      <div class="body-content"
           v-if="taskData">
        <slot name="extraContent"></slot>
        <div class="card-content-box">
          <el-checkbox v-model="taskData.checked"
                       @change="titleCheckbox"></el-checkbox>
          <div class="card-content">
            <div class="card-content-row margin-bottom-15">
              <div class="priority-data-name">
                <div class="title-text"
                     :style="{'text-decoration': taskData.checked ? 'line-through' : 'none'}"
                     v-show="!nameVinput">
                  {{taskData.name}}
                  <span class="el-icon-edit-outline"
                        @click="nameVinput = true, taskDataName = taskData.name"></span>
                </div>
                <div v-show="nameVinput"
                     class="show-input">
                  <el-input v-model="taskDataName"
                            :maxlength="50"
                            size="medium"></el-input>
                  <div class="btn-box">
                    <el-button type="primary"
                               size="mini"
                               @click="nameVShow(taskDataName)">保 存</el-button>
                    <el-button size="mini"
                               @click="nameVinput = false">取 消</el-button>
                  </div>
                </div>
              </div>
              <div class="card-row-right">
                <flexbox class="text-right">
                  <div class="color-label user-name-label"> 负责人： </div>
                  <div v-if="taskData.main_user_name"
                       class="bg-position">
                    <el-tooltip placement="bottom"
                                effect="light"
                                popper-class="tooltip-change-border">
                      <div slot="content">
                        <span>{{taskData.main_user_name}}</span>
                      </div>
                      <div v-photo="{thumb_img: taskData.main_user_img, realname: taskData.main_user_name}"
                           v-lazy:background-image="$options.filters.filterUserLazyImg(taskData.main_user_img)"
                           :key="taskData.main_user_img"
                           class="div-photo main-user-name"></div>
                    </el-tooltip>
                    <img src="@/assets/img/delete_task.png"
                         class="el-icon-close"
                         @click="editMainUser('')"
                         alt="">
                  </div>
                  <template v-else>
                    <el-popover placement="bottom"
                                width="280"
                                trigger="click">
                      <xh-user ref="xhuser"
                               radio
                               @changeCheckout="editMainUser">
                      </xh-user>
                      <i class="wukong wukong-addition-task"
                         slot="reference"></i>
                    </el-popover>
                  </template>
                </flexbox>
              </div>
            </div>
            <div class="card-content-row  margin-bottom-25"
                 v-if="taskData.lable_list">
              <div class="particulars-priority-copy">
                <template v-show="taskData.lable_list.length != 0">
                  <span class="item-color"
                        :style="{'background': item.color ? item.color : '#ccc'}"
                        v-for="(item, index) in taskData.lable_list"
                        :key="index">
                    {{item.name}}
                  </span>
                </template>
                <div class="add-tag">
                  <tag-index :placement="'right'"
                             :taskData="taskData">
                    <div slot="editIndex">
                      <span class="el-icon-plus"></span>
                      <span class="label">添加标签</span>
                    </div>
                  </tag-index>
                </div>
              </div>
              <div class="card-row-right">
                <div class="text-right">
                  <span class="color-label"> 截止日期： </span>
                  <div class="time-top">
                    <el-date-picker :class="{ 'no-time-top': !taskData.stop_time }"
                                    v-model="taskData.stop_time"
                                    type="date"
                                    ref="endTime"
                                    :clearable="false"
                                    @change="endTimeChange"
                                    format="yyyy-MM-dd"
                                    value-format="yyyy-MM-dd"
                                    placeholder="">
                    </el-date-picker>
                    <img src="@/assets/img/delete_task.png"
                         class="el-icon-close time-top-close"
                         v-if="taskData.stop_time"
                         @click.stop="deleteTimeTop(taskData.stop_time)"
                         alt="">
                  </div>
                </div>
              </div>
            </div>
            <div class="add-description">
              <div v-show="!addDescriptionShow">
                <div v-if="taskData.description"
                     @click="addDescriptionShow = true; addDescriptionTextarea = taskData.description">{{taskData.description}}</div>
                <div v-else
                     class="no-description">
                  <span class="color-label">暂无描述</span>
                  <el-button type="text"
                             icon="el-icon-plus"
                             @click="addDescriptionShow = true">添加描述</el-button>
                </div>
              </div>
              <div v-show="addDescriptionShow">
                <el-input type="textarea"
                          :autosize="{ minRows: 2}"
                          placeholder="请输入内容"
                          v-model="addDescriptionTextarea">
                </el-input>
                <div class="btn-box">
                  <el-button type="primary"
                             size="mini"
                             @click="addDescriptionSubmit">保 存</el-button>
                  <el-button type="text"
                             size="mini"
                             @click="addDescriptionShow = false">取 消</el-button>
                </div>
              </div>
            </div>
            <div class="card-content-row card-content-row-column">
              <flexbox>
                <div class="color-label participant">
                  <i class="wukong wukong-user"></i>
                  <span>参与人： </span>
                </div>
                <div class="participant-class"
                     v-if="taskData.owner_list">
                  <span v-for="(item, index) in taskData.owner_list"
                        :key="index"
                        class="owner-list">
                    <el-tooltip placement="bottom"
                                effect="light"
                                popper-class="tooltip-change-border">
                      <div slot="content">
                        <span>{{item.realname}}</span>
                      </div>
                      <div v-photo="item"
                           v-lazy:background-image="$options.filters.filterUserLazyImg(item.thumb_img)"
                           :key="item.thumb_img"
                           class="div-photo item-img"></div>
                    </el-tooltip>
                    <img src="@/assets/img/delete_task.png"
                         class="el-icon-close"
                         @click="deleteOwnerList(item, index)">
                  </span>
                </div>
                <members-dep :closeDep="true"
                             :contentBlock="false"
                             :userCheckedData="taskData.owner_list"
                             @popoverSubmit="editOwnerList">
                  <i slot="membersDep"
                     class="wukong wukong-addition-task"></i>
                </members-dep>
              </flexbox>
            </div>
            <div class="card-content-row card-content-row-column margin-bottom-30">
              <span class="color-label participant">
                <i class="wukong wukong-relevance"></i>
                <span>关联业务</span>
              </span>
              <!-- 关联业务 -->
              <related-business :marginLeft="'0'"
                                :isTask="true"
                                :allData="allData"
                                :taskID="taskData.task_id"
                                @checkRelatedDetail="checkRelatedDetail"
                                @checkInfos="checkInfos">
              </related-business>
            </div>
            <div class="card-content-row card-content-row-column"
                 v-if="taskData.pid == 0">
              <div class="display-flex sub-task margin-bottom-7">
                <span class="color-label participant">
                  <i class="wukong wukong-sub-task"></i>
                  <span>子任务</span>
                </span>
                <template v-if="taskData.subTaskList.length != 0">
                  <span class="color-label sub-task-progress"> ({{subTaskProgress}}/{{taskData.subTaskList.length}}) </span>
                  <el-progress :percentage="subTaskProgress/taskData.subTaskList.length*100"
                               :stroke-width="10"></el-progress>
                </template>
                <template v-else>
                  <span class="color-label sub-task-progress"> ({{subTaskProgress}}/{{taskData.subTaskList.length}}) </span>
                  <el-progress :percentage="0"></el-progress>
                </template>
              </div>
              <template v-if="taskData.subTaskList.length != 0">
                <div class="card-related-matters subtasks-box"
                     v-for="(item, index) in taskData.subTaskList"
                     :key="index">
                  <div v-if="!item.showEdit"
                       class="show-edit">
                    <div @click.stop
                         style="display: inline-block;">
                      <el-checkbox v-model="item.checked"
                                   @change="subtasksCheckbox(item, $event)"></el-checkbox>
                    </div>
                    <span :style="{'text-decoration': item.checked ? 'line-through' : 'none'}"
                          class="item-name">{{item.name}}</span>
                    <!-- 编辑和删除 -->
                    <div class="edit-del-box">
                      <i class="wukong wukong-edit-task"
                         @click="editSubTask(item)"></i>
                      <i class="wukong wukong-delete-task"
                         @click="deleteSubTask(item)"></i>
                    </div>
                    <div class="rt">
                      <flexbox class="rt-box">
                        <div class="bg-color task-bg-color"
                             v-if="item.stop_time">{{item.stop_time | moment("MM-DD")}} 截止</div>
                        <div v-if="item.main_user_id"
                             v-photo="item"
                             :key="item.thumb_img"
                             v-lazy:background-image="$options.filters.filterUserLazyImg(item.thumb_img)"
                             class="div-photo"></div>
                      </flexbox>
                    </div>
                  </div>
                  <sub-task v-else
                            :subTaskCom="'edit'"
                            :time="item.stop_time"
                            :subData="item"
                            :text="item.name"
                            :taskId="subTaskID"
                            :checkboxData="item.checked"
                            :taskData="taskData"
                            @on-handle="handleSubTasksBlock($event, item)">
                  </sub-task>
                </div>
              </template>
              <div class="add-subtasks"
                   v-if="addSubtasks"
                   @click="addSubtasks = false">
                <span class="el-icon-plus"></span>
                <span>添加子任务</span>
              </div>
              <sub-task v-else
                        :subTaskCom="'new'"
                        :taskData="taskData"
                        @on-handle="handleSubTasksBlock">
              </sub-task>
            </div>
            <div class="card-content-row card-content-row-column"
                 v-if="fileList.length != 0">
              <span class="color-label participant class-file">
                <i class="wukong wukong-file"></i>
                <span>附件</span>
              </span>
              <div class="accessory-box">
                <file-cell v-for="(file, fileIndex) in fileList"
                           :key="fileIndex"
                           :data="file"
                           :cellIndex="fileIndex"
                           :module_id="id"
                           :showDelete="true"
                           @delete="accessoryDeleteFun"></file-cell>
              </div>
            </div>
          </div>
        </div>
        <div class="border"></div>
        <!-- 底部内容 -->
        <div class="card-footers">
          <div class="footer-title">
            <span @click="footerTitle(0)">
              <i class="wukong wukong-comment-task"
                 style="color: #3E84E9;"
                 v-if="isComment"></i>
              <i class="wukong wukong-comment-task"
                 v-else></i>
              <span class="cursor-pointer"
                    :style="{'color': isComment ? '#3E84E9' : '#666'}">评论</span>
            </span>
            <span class="title-border"></span>
            <span @click="footerTitle(1)">
              <i class="wukong wukong-activity-task"
                 style="font-size: 18px;"
                 v-if="isComment"></i>
              <i class="wukong wukong-activity-task"
                 style="color: #3E84E9; font-size: 18px;"
                 v-else></i>
              <span class="cursor-pointer"
                    :style="{'color': isComment ? '#666' : '#3E84E9'}"
                    @click="footerTitle(isComment)">活动</span>
            </span>
          </div>
          <div class="footer-content-box"
               v-loading="commentsLoading">
            <div class="footer-content">
              <div v-if="commentsActivities"
                   class="add-comments">
                <div class="footer-img">
                  <div v-photo="userInfo"
                       v-lazy:background-image="$options.filters.filterUserLazyImg(userInfo.thumb_img)"
                       :key="userInfo.thumb_img"
                       class="div-photo"></div>
                </div>
                <div class="comments-con">
                  <div class="comments-box"
                       v-clickoutside="commentsSubmit"
                       v-if="addComments">
                    <el-input type="textarea"
                              @blur="blurFun"
                              :rows="4"
                              ref="commentsTextareaRef"
                              placeholder="添加评论"
                              v-model="commentsTextarea"> </el-input>
                    <div class="btn-group">
                      <el-popover placement="top"
                                  width="400"
                                  v-model="commentsPopover"
                                  trigger="click">
                        <!-- 表情 -->
                        <emoji @select="selectEmoji">
                        </emoji>
                        <img src="@/assets/img/smiling_face.png"
                             class="smiling-img"
                             slot="reference">
                      </el-popover>
                      <el-button type="primary"
                                 class="rt"
                                 @click="commentsSub">发布</el-button>
                    </div>
                  </div>
                  <div class="footer-bg"
                       v-else
                       @click="addComments = true">添加评论</div>

                  <!-- 评论 -->
                  <div class="discuss"
                       v-if="taskData.replyList && taskData.replyList.length != 0">
                    <div class="discuss-list"
                         v-for="(discussItem, k) in taskData.replyList"
                         :key="k">
                      <div v-photo="discussItem.userInfo"
                           v-lazy:background-image="$options.filters.filterUserLazyImg(discussItem.userInfo.thumb_img)"
                           :key="discussItem.userInfo.thumb_img"
                           class="div-photo head-img header-circle"></div>
                      <span class="name">{{discussItem.userInfo.realname}}</span>
                      <span class="time">{{discussItem.create_time | moment("YYYY-MM-DD HH:mm")}}</span>
                      <div class="rt">
                        <span @click="discussDelete(discussItem, taskData.replyList, k)">删除</span>
                        <span @click="discussBtn(discussItem, -1)">回复</span>
                      </div>

                      <p class="reply-title">
                        <span v-html="emoji(discussItem.content)"></span>
                      </p>

                      <p class="discuss-content"
                         v-html="emoji(discussItem.reply_content)"></p>

                      <div class="children-reply"
                           v-if="discussItem.replyList && discussItem.replyList.length > 0">
                        <div class="discuss-list"
                             v-for="(childDiscussItem, k) in discussItem.replyList"
                             :key="k">
                          <div v-photo="childDiscussItem.userInfo"
                               v-lazy:background-image="$options.filters.filterUserLazyImg(childDiscussItem.userInfo.thumb_img)"
                               :key="childDiscussItem.userInfo.thumb_img"
                               class="div-photo head-img header-circle"></div>
                          <span class="name">{{childDiscussItem.userInfo.realname}}</span>
                          <span class="time">{{childDiscussItem.create_time | moment("YYYY-MM-DD HH:mm")}}</span>
                          <div class="rt">
                            <span @click="discussDelete(childDiscussItem, discussItem.replyList, k)">删除</span>
                            <span @click="discussBtn(discussItem, k)">回复</span>
                          </div>
                          <p class="reply-title">
                            <template>
                              <span>回复</span>
                              <span class="reply">@{{childDiscussItem.replyuserInfo.realname}}：</span>
                            </template>
                            <span v-html="emoji(childDiscussItem.content)"></span>
                          </p>
                        </div>
                      </div>

                      <!-- 评论 -- 回复  -->
                      <div class="comment-box"
                           v-if="discussItem.show">
                        <el-input type="textarea"
                                  @blur="blurFun"
                                  :rows="2"
                                  placeholder="请输入内容"
                                  v-model="childCommentsTextarea"></el-input>
                        <div class="btn-group">
                          <el-popover placement="top"
                                      width="400"
                                      v-model="childCommentsPopover"
                                      trigger="click">
                            <!-- 表情 -->
                            <emoji @select="selectEmojiChild">
                            </emoji>
                            <img src="@/assets/img/smiling_face.png"
                                 class="smiling-img"
                                 slot="reference">
                          </el-popover>
                          <div class="btn-box">
                            <el-button type="primary"
                                       @click="childCommentSubmit()"
                                       :loading="contentLoading">回复</el-button>
                            <el-button @click="discussItem.show= false">取消</el-button>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              <div v-else
                   class="activity-box">
                <template v-if="activityList.length != 0">
                  <div v-for="(item, index) in activityList"
                       :key="index"
                       class="activity-list">
                    <div v-photo="item"
                         :key="item.thumb_img"
                         v-lazy:background-image="$options.filters.filterUserLazyImg(item.thumb_img)"
                         class="div-photo"></div>
                    <span class="activity-name">{{item.realname}}</span>
                    <span>{{item.content}}</span>
                    <span class="activity-time">{{item.create_time | moment("MM-DD HH:mm")}}</span>
                  </div>
                </template>
              </div>
            </div>
          </div>
        </div>
        <slot></slot>
      </div>
      <div class="tip"
           v-if="taskData && taskData.create_user_info">
        <span>{{taskData.create_user_info.realname}} 创建于 {{taskData.create_time | moment("YYYY-MM-DD HH:mm:ss")}}</span>
      </div>

      <c-r-m-full-screen-detail :visible.sync="showRelatedDetail"
                                :crmType="relatedCRMType"
                                :id="relatedID">
      </c-r-m-full-screen-detail>
    </el-card>
  </transition>
  <!-- </div> -->
</template>

<script type="text/javascript">
import xss from 'xss'
import {
  editTask,
  editTaskName,
  updateStoptime,
  updateOwner,
  deleteTask,
  updatePriority,
  taskOver,
  delOwnerById,
  comAdd,
  comDelete,
  detailsTask,
  readLoglist
} from '@/api/oamanagement/task'
import { usersList, depList, crmFileSave, crmFileIndex } from '@/api/common'

import membersDep from '@/components/selectEmployee/membersDep'
import tagIndex from './tag/tagIndex'
import subTask from './subTask'
// emoji
import emoji from '@/components/emoji'
// 关联业务 - 选中列表
import relatedBusiness from '@/components/relatedBusiness'
import XhUser from '@/components/CreateCom/XhUser'
import FileCell from '@/views/OAManagement/components/fileCell'
import CRMFullScreenDetail from '@/views/customermanagement/components/CRMFullScreenDetail'
import { mapGetters } from 'vuex'
import { getMaxIndex, timestampToFormatTime } from '@/utils'

export default {
  components: {
    membersDep,
    emoji,
    relatedBusiness,
    XhUser,
    tagIndex,
    CRMFullScreenDetail,
    subTask,
    FileCell
  },
  data() {
    return {
      zIndex: getMaxIndex(),
      // 评论 - 活动
      // 评论 - 活动显示的内容
      commentsActivities: true,
      // 评论框
      commentsTextarea: '',
      // 回复
      childCommentsTextarea: '',
      // 评论 - 是否弹出表情
      // 回复的一行用户数据
      replyChildComment: null, // 被评论对象
      replyChildIndex: -1, // -1 是主评论 0以上为子评论
      contentLoading: false, // 回复按钮loading
      commentsPopover: false,
      // 回复弹出框
      childCommentsPopover: false,
      // 紧急弹出框
      priorityVisible: false,
      // 优先级列表
      particularsList: [
        { id: 3, label: '高', color: '#ED6363' },
        { id: 2, label: '中', color: '#FF9668' },
        { id: 1, label: '低', color: '#8bb5f0' },
        { id: 0, label: '无', color: '#ccc' }
      ],
      // 是否显示子任务
      addSubtasks: true,
      // 任务名称和编辑切换
      nameVinput: false,
      // 任务名
      taskDataName: '',
      // 是否显示描述
      addDescriptionShow: false,
      // 描述内容
      addDescriptionTextarea: '',
      // 子任务进度
      subTaskProgress: 0,
      blurIndex: 0,
      // 是否显示评论框
      addComments: false,
      allData: {},
      isComment: true,
      commentsLoading: false,
      // 相关详情的查看
      relatedID: '',
      relatedCRMType: '',
      showRelatedDetail: false,
      // 子任务ID
      subTaskID: null,
      // 任务详情
      loading: false,
      taskData: null,
      activityList: [],
      fileList: []
    }
  },
  props: {
    id: [String, Number],
    detailIndex: Number,
    appendToBody: {
      type: Boolean,
      default: false
    }
  },
  computed: {
    ...mapGetters(['userInfo'])
  },
  watch: {
    id: function(val) {
      this.initInfo()
      this.getDetail()
      this.getFileList()
      this.getActivityList()
    }
  },
  mounted() {
    if (this.appendToBody) {
      document.body.appendChild(this.$el)
    }
    if (this.id) {
      this.getDetail()
      this.getFileList()
      this.getActivityList()
    }
  },
  methods: {
    initInfo() {
      this.taskData = null
      this.subTaskProgress = 0
      // 设置关联项列表
      this.allData = {
        business: [],
        contacts: [],
        contract: [],
        customer: []
      }

      this.taskData = null
      this.activityList = []
      this.fileList = []
    },
    // 基础详情
    getDetail() {
      this.loading = true
      detailsTask({ task_id: this.id })
        .then(res => {
          let taskData = res.data
          taskData.stop_time = timestampToFormatTime(
            taskData.stop_time,
            'YYYY-MM-DD'
          )
          taskData.checked = taskData.status == 5 ? true : false

          if (taskData.subTaskList) {
            for (let item of taskData.subTaskList) {
              if (item.status == 5) {
                item.checked = true
                this.subTaskProgress++
              } else {
                item.checked = false
              }
            }
          }

          this.allData = {
            business: taskData.businessList || [],
            contacts: taskData.contactsList || [],
            contract: taskData.contractList || [],
            customer: taskData.customerList || []
          }
          this.taskData = taskData
          this.loading = false
        })
        .catch(err => {
          this.loading = false
          this.closeBtn()
        })
    },
    // 获取活动信息
    getActivityList() {
      readLoglist({
        task_id: this.id
      })
        .then(res => {
          this.activityList = res.data
        })
        .catch(() => {})
    },
    getFileList() {
      crmFileIndex({
        module: 'work_task',
        module_id: this.id
      })
        .then(res => {
          this.fileList = res.data.list
        })
        .catch(() => {})
    },

    // 主题勾选
    titleCheckbox(val) {
      this.taskData.checked = val
      taskOver({
        task_id: this.id,
        type: this.taskData.checked ? 1 : 2
      })
        .then(res => {
          this.$emit('on-handle', {
            type: 'title-check',
            value: val,
            index: this.detailIndex
          })
          this.$store.dispatch('GetOAMessageNum', 'task')
        })
        .catch(err => {
          this.$emit('on-handle', {
            type: 'title-check',
            value: !this.taskData.checked,
            index: this.detailIndex
          })
          this.taskData.checked = !this.taskData.checked
        })
    },
    closeBtn() {
      this.$emit('close')
    },
    // 评论 - 活动 切换功能
    footerTitle(key) {
      switch (key) {
        case 0:
          this.commentsActivities = true
          this.isComment = true
          break
        case 1:
          this.commentsActivities = false
          this.isComment = false
          break
      }
    },
    // 紧急按钮
    priorityBtn(value, def) {
      this.taskData.priority = value.id
      updatePriority({
        task_id: this.id,
        priority_id: value.id
      })
        .then(res => {
          this.$emit('on-handle', {
            type: 'change-priority',
            value: value,
            index: this.detailIndex
          })
          this.priorityVisible = false
        })
        .catch(err => {
          this.$message.error('编辑失败')
          this.taskData.priority = def
        })
    },
    // 更多 ———— 删除和规定按钮
    moreDelete() {
      this.$confirm('此操作将永久删除该任务, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
        customClass: 'is-particulars'
      })
        .then(() => {
          deleteTask({
            task_id: this.id
          })
            .then(res => {
              this.$message.success('删除成功')
              this.$emit('on-handle', {
                type: 'delete',
                index: this.detailIndex
              })
              this.$emit('close')
            })
            .catch(() => {})
        })
        .catch(() => {
          this.$message({
            type: 'info',
            message: '已取消删除'
          })
        })
    },
    // 附件 -- 上传
    httpRequest(val) {
      crmFileSave({
        'file[]': val.file,
        module: 'work_task',
        module_id: this.id
      })
        .then(res => {
          // 更新附件数据
          this.getFileList()
          // this.$emit('httpRequest', this.taskData)
          this.$message.success('上传成功')
        })
        .catch(() => {})
    },
    // 附件删除
    accessoryDeleteFun(index, item) {
      this.fileList.splice(index, 1)
    },
    // 子任务添加
    addSubtasksBtn() {
      this.addSubtasks = this.addSubtasks ? false : true
    },
    // 子任务 -- 勾选
    subtasksCheckbox(val, e) {
      if (e) {
        this.$set(val, 'checked', true)
        this.subTaskProgress++
      } else {
        this.$set(val, 'checked', false)
        this.subTaskProgress--
      }
      this.$emit('on-handle', {
        type: 'change-sub-task',
        value: {
          subdonecount: this.subTaskProgress,
          allcount: this.taskData.subTaskList.length
        },
        index: this.detailIndex
      })
      taskOver({
        task_id: val.task_id,
        type: e ? 1 : 2
      })
        .then(res => {})
        .catch(err => {
          this.$message.error('子任务标记失败')
          if (e) {
            this.$set(val, 'checked', false)
            this.subTaskProgress--
          } else {
            this.$set(val, 'checked', true)
            this.subTaskProgress++
          }
          this.$emit('on-handle', {
            type: 'change-sub-task',
            value: {
              subdonecount: this.subTaskProgress,
              allcount: this.taskData.subTaskList.length
            },
            index: this.detailIndex
          })
          // this.$emit('', val, e)
        })
    },
    /**
     * 参与人操作
     */
    // 提交按钮
    editOwnerList(users, dep) {
      let list1 = []
      let list2 = []
      this.taskData.owner_list = []
      updateOwner({
        task_id: this.id,
        owner_userids: users.map(item => {
          return item.id
        })
      })
        .then(res => {
          this.taskData.owner_list = users
        })
        .catch(() => {})
    },
    // 参与人删除按钮
    deleteOwnerList(item, index) {
      delOwnerById({
        task_id: this.id,
        type: 'owner_userid_del',
        owner_userid_del: item.id
      })
        .then(res => {
          this.taskData.owner_list.splice(index, 1)
        })
        .catch(() => {})
    },
    // 编辑负责人
    editMainUser(val) {
      editTask({
        task_id: this.id,
        main_user_id: val ? val.data[0].id : '',
        type: 'main_user_id'
      })
        .then(res => {
          if (val) {
            this.$set(this.taskData, 'main_user_name', val.data[0].realname)
            this.$set(this.taskData, 'main_user_img', val.data[0].thumb_img)
          } else {
            this.$set(this.taskData, 'main_user_name', '')
            this.$set(this.taskData, 'main_user_img', '')
          }
        })
        .catch(() => {})
    },
    // 编辑任务名
    nameVShow(val) {
      editTaskName({
        name: val,
        type: 'name',
        task_id: this.id
      })
        .then(res => {
          this.nameVinput = false
          // this.$emit('saveName', val)
          this.$emit('on-handle', {
            type: 'change-name',
            value: val,
            index: this.detailIndex
          })
          this.taskData.name = val
        })
        .catch(() => {})
    },
    // 截至日期API
    endTimeChange(val) {
      updateStoptime({
        stop_time: new Date(val).getTime() / 1000,
        type: 'stop_time',
        task_id: this.id
      })
        .then(res => {
          // val.substring(5)
          this.$emit('on-handle', {
            type: 'change-stop-time',
            value: new Date(val).getTime() / 1000,
            index: this.detailIndex
          })
        })
        .catch(() => {})
    },
    // 描述提交按钮
    addDescriptionSubmit() {
      editTask({
        task_id: this.id,
        description: this.addDescriptionTextarea
      })
        .then(res => {
          this.addDescriptionShow = false
          this.$set(this.taskData, 'description', this.addDescriptionTextarea)
        })
        .catch(() => {})
    },
    // 评论选中功能
    selectEmoji(val) {
      let list = this.commentsTextarea.split('')
      list.splice(this.blurIndex, 0, val)
      this.commentsTextarea = list.join('')
      this.commentsPopover = false
    },
    // 评论回复 -- 选中功能
    selectEmojiChild(val) {
      let list = this.childCommentsTextarea.split('')
      list.splice(this.blurIndex, 0, val)
      this.childCommentsTextarea = list.join('')
      this.childCommentsPopover = false
    },
    // 评论发布
    commentsSub() {
      if (this.commentsTextarea) {
        this.commentsLoading = true
        comAdd({
          task_id: this.id,
          content: xss(this.commentsTextarea)
        })
          .then(res => {
            this.taskData.replyList.push({
              comment_id: res.data,
              type_id: this.id,
              userInfo: this.userInfo,
              create_time: parseInt(new Date().getTime() / 1000),
              content: xss(this.commentsTextarea),
              replyList: [],
              show: false
            })
            this.commentsTextarea = ''
            // this.$emit('commentsSet', 'add')
            this.$emit('on-handle', {
              type: 'change-comments',
              value: 'add',
              index: this.detailIndex
            })
            this.commentsLoading = false
          })
          .catch(err => {
            this.commentsLoading = false
          })
      }
    },
    // 回复评论
    childCommentSubmit() {
      if (this.replyChildComment && this.childCommentsTextarea) {
        var item =
          this.replyChildIndex == -1
            ? this.replyChildComment
            : this.replyChildComment.replyList[this.replyChildIndex]
        comAdd({
          reply_fid: this.replyChildComment.comment_id,
          task_id: item.type_id,
          content: xss(this.childCommentsTextarea),
          reply_content: item.content,
          reply_comment_id: item.comment_id,
          reply_user_id: item.userInfo.id,
          reply_name: item.userInfo.realname
        })
          .then(res => {
            this.childCommentsPopover = false
            this.replyChildComment.replyList.push({
              comment_id: res.data,
              type_id: item.type_id,
              userInfo: this.userInfo,
              create_time: parseInt(new Date().getTime() / 1000),
              content: xss(this.childCommentsTextarea),
              reply_content: item.content,
              replyuserInfo: item.userInfo
            })
            this.replyChildComment.show = false
            this.replyChildComment = null
            this.childCommentsTextarea = ''
            this.$emit('on-handle', {
              type: 'change-comments',
              value: 'add',
              index: this.detailIndex
            })
          })
          .catch(() => {})
      }
    },
    // 删除评论
    discussDelete(val, items, index) {
      this.$confirm('确定删除?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
        customClass: 'is-particulars'
      })
        .then(() => {
          comDelete({
            comment_id: val.comment_id,
            task_id: val.type_id
          })
            .then(res => {
              items.splice(index, 1)
              this.$emit('on-handle', {
                type: 'change-comments',
                value: 'delete',
                index: this.detailIndex
              })
              // this.$emit('commentsSet', 'delete')
            })
            .catch(() => {})
        })
        .catch(() => {
          this.$message({
            type: 'info',
            message: '已取消删除'
          })
        })
    },
    // 点击回复按钮
    discussBtn(item, index) {
      if (item.show) {
        this.$set(item, 'show', false)
        this.replyChildComment = null
      } else {
        this.$set(item, 'show', true)
        this.$set(item, 'showComment', false)
        this.replyChildComment = item
        this.replyChildIndex = index
      }
    },
    blurFun(eve) {
      this.blurIndex = eve.target.selectionEnd
    },
    // 关联业务提交按钮
    checkInfos(val) {
      editTask({
        task_id: this.id,
        customer_ids: val.customer_ids,
        contacts_ids: val.contacts_ids,
        business_ids: val.business_ids,
        contract_ids: val.contract_ids
      })
        .then(res => {
          this.$message.success('关联成功')
        })
        .catch(() => {})
    },
    commentsSubmit(event) {
      this.addComments = false
    },
    checkRelatedDetail(crmType, item) {
      this.relatedID = item.key
      this.relatedCRMType = crmType
      this.showRelatedDetail = true
    },
    deleteSubTask(val) {
      this.$confirm('此操作将永久删除该任务, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
        customClass: 'is-particulars'
      })
        .then(() => {
          deleteTask({
            task_id: val.task_id
          })
            .then(res => {
              let subData = this.taskData.subTaskList
              for (let i in subData) {
                if (subData[i].task_id == val.task_id) {
                  subData.splice(i, 1)
                  break
                }
              }
              if (val.checked) {
                this.subTaskProgress--
                this.$emit('on-handle', {
                  type: 'change-sub-task',
                  value: {
                    subdonecount: this.subTaskProgress,
                    allcount: this.taskData.subTaskList.length
                  },
                  index: this.detailIndex
                })
              }
              this.$message.success('子任务删除成功')
            })
            .catch(err => {
              this.$message.error('子任务删除失败')
            })
        })
        .catch(() => {
          this.$message({
            type: 'info',
            message: '已取消删除'
          })
        })
    },
    editSubTask(val) {
      this.subTaskID = val.task_id
      let dataList = this.taskData.subTaskList
      for (let i in dataList) {
        if (dataList[i].task_id == val.task_id) {
          this.$set(dataList[i], 'showEdit', true)
        } else {
          this.$set(dataList[i], 'showEdit', false)
        }
      }
    },
    handleSubTasksBlock(data, item) {
      if (data.type == 'edit') {
        this.$set(item, 'showEdit', false)
      } else if (data.type == 'add') {
        this.addSubtasks = true
        if (data.result == 'success') {
          this.$emit('on-handle', {
            type: 'change-sub-task',
            value: {
              subdonecount: this.subTaskProgress,
              allcount: this.taskData.subTaskList.length + 1
            },
            index: this.detailIndex
          })
        } else {
          this.$emit('on-handle', {
            type: 'change-sub-task',
            value: {
              subdonecount: this.subTaskProgress,
              allcount: this.taskData.subTaskList.length - 1
            },
            index: this.detailIndex
          })
        }
      } else if (data.type == 'cancel') {
        if (item) {
          this.$set(item, 'showEdit', false)
        } else {
          this.addSubtasks = true
        }
      }
    },
    // 删除截止时间
    deleteTimeTop() {
      editTask({
        task_id: this.id,
        stop_time: ''
      })
        .then(res => {
          this.$set(this.taskData, 'stop_time', '')
        })
        .catch(() => {})
    }
  },

  beforeDestroy() {
    if (this.appendToBody && this.$el && this.$el.parentNode) {
      this.$el.parentNode.removeChild(this.$el)
    }
  }
}
</script>
<style lang="scss" scoped>
.wukong {
  vertical-align: middle;
  color: #666;
}
.slide-fade-enter-active,
.slide-fade-leave-active {
  will-change: transform;
  transition: all 0.35s ease;
}
.slide-fade-enter,
.slide-fade-leave-to {
  transform: translateX(100%);
}
.display-flex {
  display: flex;
}
// 小手抓
.cursor-pointer {
  cursor: pointer;
}
// 时间背景
.bg-color {
  background: #f5f5f5;
  padding: 4px 8px;
  border-radius: 14px;
}
.task-bg-color {
  background: #e6e6e6;
}
.border {
  border-top: 1px solid #e6e6e6;
  margin: 0 -20px;
}

.particulars-priority-box {
  display: flex;
  p {
    flex: 1;
    cursor: pointer;
    display: inline-block;
    text-align: center;
    span {
      color: #aaa;
      font-size: 12px;
      padding: 7px 10px;
      text-align: center;
      display: inline-block;
      border-radius: 50%;
      border: 1px solid transparent;
    }
  }
}
// 更多按钮
.more-btn-group {
  line-height: 34px;
  font-size: 14px;
  margin: 0 -12px;
  p {
    padding-left: 22px;
    cursor: pointer;
  }
  p:hover {
    background: #f7f8fa;
    color: #3e84e9;
  }
}
// 负责人
.particulars-colleagues-list {
  margin: 0 -12px;
  p {
    height: 34px;
    line-height: 34px;
    padding-left: 22px;
    cursor: pointer;
  }
  p:hover {
    -webkit-box-shadow: 0 0 8px 2px #eee;
    box-shadow: 0 0 8px 2px #eee;
    background: 0 0;
  }
}
.particulars-common /deep/ .el-card__body {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  padding-bottom: 90px;
}
.tip {
  position: fixed;
  right: 0px;
  width: 926px;
  bottom: 0;
  overflow: hidden;
  margin-top: 50px;
  height: 40px;
  line-height: 40px;
  border-top: 1px solid #e6e6e6;
  background: #fff;
  color: #999;
  z-index: 9;
  span {
    margin-left: 55px;
  }
}
.particulars-common {
  position: fixed;
  top: 60px;
  right: 0px;
  width: 926px;
  bottom: 0;
  display: flex;
  flex-direction: column;
  .clear-fix {
    overflow: auto;
  }
  .img-box-grop {
    float: right;
    color: #999;
    .task-close-img {
      padding-left: 30px;
      img {
        width: 18px;
      }
    }

    .wukong {
      color: #999;
    }
  }
  .img-box-grop > div {
    display: inline-block;
    margin-right: 20px;
    cursor: pointer;
    img {
      vertical-align: middle;
    }
    .upload-demo /deep/ .el-upload-list--picture {
      display: none;
    }
  }
  .card-content-box {
    display: flex;
    img {
      vertical-align: middle;
    }
    .el-checkbox {
      height: 20px;
      margin-right: 0;
    }
    // 解决多选框样式
    .el-checkbox /deep/ .el-checkbox__inner {
      width: 20px;
      height: 20px;
    }
    .el-checkbox /deep/ .el-checkbox__inner::after {
      border-width: 2px;
      height: 12px;
      width: 5px;
      left: 5px;
    }
    .card-content {
      flex: 1;
      padding: 0 15px;
      .card-content-row {
        margin-bottom: 35px;
        display: flex;
        .priority-data-name {
          .title-text {
            font-size: 17px;
            color: #333;
            .el-icon-edit-outline {
              margin-left: 20px;
              color: #3e84e9;
              opacity: 0;
              cursor: pointer;
            }
          }
          .title-text:hover {
            .el-icon-edit-outline {
              opacity: 1;
            }
          }
          .show-input {
            width: 90%;
            .btn-box {
              margin-top: 10px;
            }
          }
        }
        .el-icon-circle-plus-outline {
          width: 30px;
          height: 30px;
          color: #ccc;
        }
        .card-row-right {
          width: 50%;
          .text-right {
            width: 60%;
            float: right;
            min-width: 200px;
            min-height: 28px;
            position: relative;
            .el-icon-close {
              opacity: 0;
              margin-left: 10px;
              color: #ccc;
              cursor: pointer;
            }
            .el-popover__reference {
              width: 20px;
            }
            .main-user-name {
              width: 25px;
              height: 25px;
              border-radius: 12.5px;
            }
            .user-name-label {
              width: 73px;
              display: inline-block;
            }

            .bg-position {
              position: relative;
              display: inline-block;
              .el-icon-close {
                opacity: 0;
                border-radius: 50%;
                cursor: pointer;
                position: absolute;
                z-index: 3;
                top: -7px;
                right: -5px;
              }
            }
            .wukong-addition-task {
              cursor: pointer;
            }

            .time-top {
              position: relative;
              display: inline-block;
              .time-top-close {
                opacity: 0;
                border-radius: 50%;
                cursor: pointer;
                position: absolute;
                z-index: 3;
                top: -7px;
                right: -5px;
              }
            }

            .time-top /deep/ .el-date-editor {
              width: 115px;
              input {
                background-color: #f5f5f5;
                border: none;
                border-radius: 15px;
                line-height: 30px;
                height: 30px;
                padding-right: 0;
              }
            }
            .time-top /deep/ .no-time-top.el-date-editor {
              width: 30px;
              .el-input__prefix {
                left: 2px;
              }
            }
          }

          .text-right:hover {
            .el-icon-close {
              opacity: 1;
            }
          }
          .color-label {
            margin-right: 10px;
            vertical-align: middle;
          }
        }
        .card-row-right:hover {
          .el-icon-close {
            opacity: 1;
          }
        }
        .particulars-priority-copy {
          .item-color {
            padding: 0 10px;
            color: #fff;
            font-size: 12px;
            margin-right: 5px;
            border-radius: 3px;
            display: inline-block;
            height: 22px;
            line-height: 22px;
            margin-bottom: 5px;
          }
          .el-icon-plus,
          .add-tag {
            color: #999;
          }
          .el-icon-plus {
            font-size: 13px;
            padding-left: 6px;
          }
          .add-tag {
            display: inline-block;
            width: 83px;
            height: 24px;
            line-height: 24px;
            background: rgba(245, 245, 245, 1);
            border-radius: 3px;
            cursor: pointer;
            text-align: center;
            font-size: 12px;
          }
          .label {
            padding-right: 10px;
          }
        }
        .class-file {
          img {
            margin: 0 5px;
          }
        }
      }
      .card-content-row-column {
        flex-direction: column;
        margin-right: 20px;
        .accessory-box {
          margin-top: 10px;
        }
        .participant {
          color: #666;
          img,
          span {
            vertical-align: middle;
          }
        }
        .participant-class {
          margin-left: 10px;
          min-height: 28px;
          .owner-list {
            position: relative;
            margin-right: 10px;
            display: inline-block;
            .item-img {
              width: 25px;
              height: 25px;
              border-radius: 12.5px;
            }
            .el-icon-close {
              opacity: 0;
              color: #fff;
              background: #ccc;
              border-radius: 50%;
              cursor: pointer;
              position: absolute;
              z-index: 3;
              top: -7px;
              right: -5px;
            }
          }
          .owner-list:hover {
            .el-icon-close {
              opacity: 1;
            }
          }
        }
        .task-add-png {
          display: inline-block;
        }
        .show-edit {
          background: #f5f7fa;
          height: 40px;
          line-height: 40px;
          // color: #3E84E9;
          padding: 0 10px;
          font-size: 13px;
          .card-related-matters-right {
            float: right;
            margin-top: 8px;
          }
          .rt {
            margin-right: 0;
            .bg-color {
              font-size: 12px;
              padding: 0 8px !important;
              vertical-align: middle;
              height: 30px;
              line-height: 30px;
            }
            .div-photo {
              margin-top: 0 !important;
            }
            .rt-box {
              height: 41.5px;
            }
          }
        }
        .display-flex {
          margin-bottom: 10px;
          span {
            margin-right: 10px;
          }
        }
        .el-progress {
          flex: 1;
          margin-left: 10px;
        }
        .el-progress /deep/ .el-progress-bar {
          padding-right: 0;
          .el-progress-bar__outer {
            background: #f5f5f5;
          }
        }
        .el-progress /deep/ .el-progress__text {
          display: none;
        }
        .subtasks-box {
          color: #333;
          border-radius: 3px;
          margin: 3px 0;
          height: 40px;
          // line-height: 40px;
          // cursor: pointer;
          // 解决多选框样式
          .el-checkbox /deep/ .el-checkbox__inner {
            width: 16px;
            height: 16px;
          }
          .el-checkbox /deep/ .el-checkbox__inner::after {
            border-width: 2px;
            height: 10px;
            width: 4px;
            left: 4px;
            top: 0;
          }
          .rt {
            .div-photo {
              margin-top: 7px;
              width: 25px;
              height: 25px;
              border-radius: 12.5px;
              margin-left: 10px;
            }
          }
          .edit-del-box {
            display: inline-block;
            padding-left: 10px;
            opacity: 0;
            .wukong {
              padding-left: 10px;
              cursor: pointer;
            }
            .wukong:hover {
              color: #3e84e9;
            }
          }
          .item-name {
            padding-left: 5px;
          }
        }
        .subtasks-box:hover {
          box-shadow: 0px 1px 4px 0px rgba(223, 227, 234, 1);
          .edit-del-box {
            opacity: 1;
          }
        }
      }
      .card-content-row > div {
        flex: 1;
      }
      .card-content-row /deep/ .related-business {
        margin: 10px 0;
        .list {
          margin: 0;
          .item-list {
            margin-bottom: 5px;
            background: #f5f7fa;
            border: 0;
          }
        }
        .add-file {
          display: inline-block;
          background: #f5f7fa;
          width: 100%;
          height: 40px;
          line-height: 40px;
          padding-left: 8px;
          margin: 0;
        }
      }
      .add-subtasks {
        color: #3e84e9;
        cursor: pointer;
        background: #f5f7fa;
        height: 40px;
        line-height: 40px;
        margin-top: 10px;
        padding-left: 12px;
        font-size: 13px;
      }
      .add-description /deep/ {
        margin-bottom: 20px;
        position: relative;
        cursor: pointer;
        white-space: pre-wrap;
        word-wrap: break-word;
        .no-description {
          color: #3e84e9;
          .color-label {
            color: #999;
          }
          button {
            margin-left: 5px;
          }
        }
        .btn-box {
          margin-top: 10px;
        }
        .el-textarea /deep/.el-textarea__inner {
          resize: none;
        }
      }
      .margin-bottom-15 {
        margin-bottom: 15px;
      }
      .margin-bottom-25 {
        margin-bottom: 25px;
      }
      .margin-bottom-30 {
        margin-bottom: 30px;
      }
      .margin-bottom-7 {
        margin-bottom: 7px;
      }
    }
    .color-label {
      color: #666;
    }
    .sub-task {
      .sub-task-progress {
        line-height: 22px;
      }
      .el-progress {
        line-height: 22px;
      }
    }
  }
  .card-footers {
    margin-top: 20px;
    .footer-title {
      margin-bottom: 40px;
      margin-left: 35px;
      img,
      span {
        vertical-align: middle;
        cursor: pointer;
      }
      .title-border {
        border-right: 2px solid #ccc;
        margin: 0 20px;
      }
    }
    .footer-content-box {
      display: flex;
      .footer-content {
        flex: 1;
        .activity-box {
          margin-left: 35px;
          margin-right: 35px;
          .activity-list {
            margin-bottom: 15px;
            color: #333;
            .activity-time {
              float: right;
              color: #999;
              font-size: 12px;
            }
            .activity-name {
              color: #666;
              margin: 0 5px;
            }
            .div-photo {
              width: 25px;
              height: 25px;
              border-radius: 12.5px;
              margin-right: 10px;
              vertical-align: middle;
            }
          }
        }
        .comments-con > .comments-box {
          margin-bottom: 10px;
        }
        .comments-box {
          border: 1px solid #e6e6e6;
          .el-textarea /deep/ .el-textarea__inner {
            border: 0;
            resize: none;
          }
          .btn-group {
            overflow: hidden;
            margin: 10px;
            .smiling-img {
              margin-top: 7px;
            }
            .rt {
              margin-right: 10px;
            }
          }
        }

        .add-comments {
          display: flex;
          .footer-img {
            margin-left: 35px;
            margin-right: 20px;
            .div-photo {
              width: 42px;
              height: 42px;
              border-radius: 21px;
              margin-top: 4px;
            }
          }
          .comments-con {
            flex: 1;
            margin-right: 35px;
            .footer-bg {
              background: #f5f5f5;
              height: 50px;
              line-height: 50px;
              padding-left: 24px;
              color: #666;
              cursor: pointer;
              margin-bottom: 5px;
            }
          }
        }
      }
    }
  }
  .title {
    color: #333333;
    font-size: 18px;
  }
  // 回到父任务
  .parent-task {
    margin-bottom: 15px;
    .p-name {
      margin-left: 10px;
    }
    .back {
      margin-left: 35px;
      color: #3e84e9;
      cursor: pointer;
    }
  }
}

// 评论列表
.discuss {
  padding: 10px 0;
  .discuss-list {
    .name,
    .time,
    .head-img {
      vertical-align: middle;
    }
    .head-img {
      width: 25px;
      height: 25px;
      display: inline-block;
      border-radius: 12.5px;
    }
    .name {
      margin: 0 10px;
      font-size: 15px;
    }
    .time {
      color: #999;
      font-size: 12px;
      display: inline-block;
      margin-top: 3px;
    }

    .reply-title {
      color: #333;
      font-size: 13px;
      margin: 10px 0 10px 40px;
      .reply {
        color: #3e84e9;
      }
    }
    .reply-title /deep/ img {
      vertical-align: text-bottom;
      margin: 0 2px;
    }

    .children-reply {
      margin: 10px 0 10px 40px;
    }

    .rt {
      margin-top: 4px;
      color: #999;
      margin-right: 0;
      span {
        margin-left: 10px;
        cursor: pointer;
      }
    }
    .discuss-content {
      background: #f5f7fa;
      color: #777;
      line-height: 36px;
      margin-left: 40px;
      padding-left: 15px;
    }
    .discuss-content /deep/ img {
      vertical-align: middle;
      margin: 0 3px;
    }
    .border {
      margin: 15px 0 15px 40px;
    }
    .comment-box {
      margin-left: 40px;
      padding: 0;
      background: transparent;
      margin-top: 15px;
    }
  }
}

// 评论框
.comment-box {
  margin: 20px;
  border: 1px solid #e6e6e6;
  .btn-group {
    padding: 0 20px 10px 10px;
    overflow: hidden;
    .btn-box {
      float: right;
    }
  }
  .btn-group /deep/ img {
    cursor: pointer;
  }
  .el-textarea /deep/ .el-textarea__inner {
    resize: none;
    border: 0;
  }
}
</style>

