<template>
  <div class="handleExamine">
    <myView style="height: 100%;width: 100%;" position="row">
      <div slot="left" style="height: 100%;width:100%;padding: 20px 10px 0 10px;">
        <div>任务详情：</div>
        <el-divider></el-divider>
        <el-descriptions title="" :column="2" size="" border style="margin-bottom: 20px;">
          <el-descriptions-item>
            <template slot="label">
              <i class="el-icon-user"></i> 任务名称
            </template>
            {{ row.name }}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">
              <i class="el-icon-mobile-phone"></i> 所属项目
            </template>
            {{ row.name }}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">
              <i class="el-icon-location-outline"></i> 所属流程
            </template>
            {{ row.taskPath }}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">
              <i class="el-icon-tickets"></i> 截止时间
            </template>
            {{ row.endTime }}
          </el-descriptions-item>
        </el-descriptions>

        <el-table :data="tableData" border>
          <el-table-column prop="name" label="文件名称" align="center"></el-table-column>
          <el-table-column prop="time" label="文件上传时间" align="center"> </el-table-column>
          <el-table-column prop="type" label="文件类型" align="center"> </el-table-column>
          <el-table-column label="操作" align="center">
            <template slot-scope="scope">
              <div>
                <el-dropdown split-button type="primary" size="small" @command="handleCommand($event, scope.row)"
                  @click="handleQuote(scope.row)">
                  <p>引 用</p>
                  <el-dropdown-menu slot="dropdown">
                    <el-dropdown-item command="1">预览</el-dropdown-item>
                    <el-dropdown-item command="2">下载</el-dropdown-item>
                  </el-dropdown-menu>
                </el-dropdown>
              </div>
            </template>
          </el-table-column>
        </el-table>
        <div class="div_margin">说明：</div>
        <el-input type="textarea" :rows="3" readonly v-model="row.textarea"></el-input>
      </div>
      <div slot="right" style="height: 100%;width:100%;padding: 20px 10px 0 10px;">
        <div>审核：</div>
        <el-divider></el-divider>
        <el-upload class="upload_demo" ref="upload" action="#" :auto-upload="false" :show-file-list="false"
          :on-change="onChange" multiple :on-preview="handlePreview" :on-remove="handleRemove" :file-list="fileList">
          <el-button size="small" type="primary">上传文件</el-button>
        </el-upload>
        <el-table :data="examineData" border style="width: 100%" header-row-class-name="custom-table-header">
          <el-table-column prop="name" label="文件名称" align="center"></el-table-column>
          <el-table-column prop="time" label="文件上传时间" align="center"> </el-table-column>
          <el-table-column prop="type" label="文件类型" align="center"> </el-table-column>
          <el-table-column label="操作" align="center">
            <el-button @click="deleteFile" size="small" type="text" style="color: red;">删除</el-button>
          </el-table-column>
        </el-table>
        <div class="div_margin">下一个审核人：</div>
        <el-select v-model="nextPersonId" placeholder="请选择下一个审核人" style="width: 100%;">
          <el-option v-for="item in personOptions" :key="item.value" :label="item.label" :value="item.value">
          </el-option>
        </el-select>
        <div class="div_margin">审核意见：</div>
        <el-input type="textarea" :rows="3" v-model="reviewComments" style="margin-bottom: 20px;"></el-input>
        <el-button type="primary" size="small" @click="sure" style="float: right;">确 认</el-button>
      </div>
    </myView>
  </div>
</template>

<script>
export default {
  props: ['row'],
  data() {
    return {
      tableData: [
        {
          name: '创新文件',
          time: '2023-10-8',
          type: 'excel',
        }
      ],//任务详情文件
      examineData: [
        {
          name: '创新文件2',
          time: '2023-10-10',
          type: 'excel',
        }
      ],//审核文件
      reviewComments: '',//评审意见
      nextPersonId: '',//下一个审核人
      personOptions: '',//下一个审核人数组
      fileList: [],//文件数组
    }
  },
  mounted() {

  },
  methods: {
    // 审核确认
    sure() { },
    // 删除文件
    deleteFile(row) { },
    // 上传文件
    onChange(file, fileList) { },
    handlePreview(file, fileList) { },
    handleRemove(file, fileList) { },
    // 引用
    handleQuote(row) { },
    // 引用下拉菜单胡处理
    handleCommand(ev, row) {
      switch (ev) {
        case '1'://预览

          break;
        case '2'://下载

          break;

        default:
          break;
      }
    },
  },
}
</script>

<style lang="scss">
.handleExamine {
  .el-divider--horizontal {
    margin: 10px 0;
  }
}
</style>
<style lang="scss" scoped>
.handleExamine {
  .upload_demo {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
  }

  .div_margin {
    margin: 20px 0 10px 0;
  }
}
</style>