<template>
<!--  <div class="app-container">-->
  <div>
    <el-card shadow="hover">
      <!-- 查询表单区域 -->
      <el-form :model="queryParams" ref="queryForm" inline>
        <el-form-item label="项目名称" prop="projectName">
          <el-input
            v-model.trim="queryParams.projectName"
            placeholder="请输入项目名称"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="终止原因" prop="reason">
          <el-input
            v-model.trim="queryParams.reason"
            placeholder="请输入终止原因"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <!-- 可继续扩展其他查询表单项目，比如项目编号、负责人等 -->
        <el-form-item>
          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
          <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
          <el-button type="warning" plain icon="el-icon-download" size="mini" @click="exportQuery">导出</el-button>
        </el-form-item>
      </el-form>
      <!-- Tab 切换区域 -->
      <el-tabs v-model="activeTab" type="card" @tab-click="handleTabClick">
        <el-tab-pane label="待办任务" name="list1">
          <!-- 列表一内容 -->
          <el-table
            ref="dataTable"
            @row-click="clickRow"
            class="tableWrapper"
            v-loading="loading"
            border
            :data="myTaskList"
          >
<!--            <el-table-column type="selection" width="40" align="center" />-->
            <el-table-column
              type="index"
              label="序号"
              width="50"
              align="center"
            ></el-table-column>
            <el-table-column label="项目名称" align="center" prop="projectName">
              <template slot-scope="scope">
                <div
                  :title="scope.row.projectName"
                  class="public-text-blue public-cursor"
                  @click.stop="handleInvestOppDetail(scope.row)"
                >
                  {{ scope.row.projectName }}
                </div>
              </template>
            </el-table-column>
            <el-table-column label="所属行业" align="center" prop="industry"
            ><template slot-scope="scope">
              <dict-tag
                :options="dict.type.CUSTOMER_TRADE"
                :value="scope.row.industry"
              />
            </template>
            </el-table-column>
            <el-table-column label="项目阶段" align="center" prop="projectStage">
              <template slot-scope="scope">
                <dict-tag
                  :options="dict.type.project_stage"
                  :value="scope.row.projectStage"
                />
              </template>
            </el-table-column>
<!--            <el-table-column
              label="项目状态"
              align="center"
              prop="projectState"
              width="120"
            >
              <template slot-scope="scope">
                <dict-tag
                  :options="dict.type.project_state"
                  :value="scope.row.projectState"
                />
              </template>
            </el-table-column>-->
            <el-table-column label="项目机会状态" align="center" prop="projectStatus">
              <template slot-scope="scope">
                <!-- 定义状态文本映射对象 -->
                <el-tag
                  :type="{
                    0: 'success',
                    1: 'danger',
                    2: 'warning'
                  }[scope.row.projectStatus] || 'info'"
                >
                  {{ {
                  0: '正常',
                  1: '终止',
                  2: '观望'
                }[scope.row.projectStatus] || '未知状态' }}
                </el-tag>
              </template>
            </el-table-column>
            <el-table-column label="项目负责人" align="center" prop="investHead">
              <template slot-scope="scope">
                <div :title="scope.row.investHead">
                  {{ scope.row.investHead }}
                </div>
              </template>
            </el-table-column>
            <el-table-column label="终止原因" align="center" prop="reason">
              <template slot-scope="scope">
                <div :title="scope.row.reason">
                  {{ scope.row.reason }}
                </div>
              </template>
            </el-table-column>
            <!-- delFlag -->
            <el-table-column label="状态" align="center" prop="delFlag">
              <template slot-scope="scope">
                <div :title="scope.row.delFlag === '1' ? '终止' : '正常'">
                  {{ scope.row.delFlag === "1" ? "终止" : "正常" }}
                </div>
              </template>
            </el-table-column>
            <el-table-column label="申请人" align="center" prop="startUserName">
              <template slot-scope="scope">
                <div :title="scope.row.startUserName">
                  {{ scope.row.startUserName }}
                </div>
              </template>
            </el-table-column>
            <el-table-column label="申请日期" align="center" prop="createTime">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span>
              </template>
            </el-table-column>
            <el-table-column label="当前节点" align="center" prop="taskName">
              <template slot-scope="scope">
                <div :title="scope.row.taskName"  class="public-text-blue public-cursor" @click="handleReadImage(scope.row)">
                  {{ scope.row.taskName}}
                </div>
              </template>
            </el-table-column>
            <el-table-column label="当前处理人" align="center" prop="assigneeName">
              <template slot-scope="scope">
                <div :title="scope.row.assigneeName">
                  {{ scope.row.assigneeName}}
                </div>
              </template>
            </el-table-column>
            <el-table-column label="流程状态" align="center" prop="status">
              <template slot-scope="scope">
                <div :title="scope.row.status">
                  <span v-if="scope.row.status === 0">暂存</span>
                  <span v-else-if="scope.row.status === 1">已提交</span>
                  <span v-else-if="scope.row.status === 2">审批中</span>
                  <span v-else-if="scope.row.status === 3">审批完成</span>
                  <span v-else-if="scope.row.status === 4">关闭</span>
                </div>
              </template>
            </el-table-column>
            <el-table-column label="操作" align="center" width="150" fixed="right" class-name="small-padding fixed-width">
              <template slot-scope="scope">

                <el-button v-if="scope.row.taskDefKey=='modifyApply'" type="text" @click="handleEdit(scope.row)">处理</el-button>
                <template v-else>
                <!-- 1. 签收按钮：无签收人时显示 -->
                  <el-button v-if="!scope.row.assignee" type="primary"  @click="handleSign(scope.row)">签收</el-button>
                  <!-- 2. 处理按钮：有签收人时显示 -->
                  <el-button v-else  type="text" @click="handleProcess(scope.row)">处理</el-button>
                <!-- 3. 撤回按钮：需补充逻辑（比如仅未签收可撤回，可结合 signPerson 判断） -->
<!--                <el-button v-if="!scope.row.assignee" size="mini" type="text" icon="el-icon-refresh-right" @click="handleWithdraw(scope.row)">撤回</el-button>-->
                <!-- 4. 详情按钮：一直显示 -->

                </template>
                <el-button type="text"  @click="handleDetail(scope.row)">详情</el-button>
              </template>
            </el-table-column>
          </el-table>

          <!-- 分页 -->
          <pagination
            v-show="myTaskTotal > 0"
            :total="myTaskTotal"
            :page.sync="queryParams.pageNum"
            :limit.sync="queryParams.pageSize"
            @pagination="getMyTaskList"
          />
        </el-tab-pane>

        <el-tab-pane label="已办任务" name="list2">
          <!-- 我的单据表格 -->
          <!-- 列表一内容 -->
          <el-table
            ref="dataTable"
            @row-click="clickRow"
            class="tableWrapper"
            v-loading="loading"
            border
            :data="myDoneTaskList"
          >
<!--            <el-table-column type="selection" width="40" align="center" />-->
            <el-table-column
              type="index"
              label="序号"
              width="50"
              align="center"
            ></el-table-column>
            <!-- <el-table-column label="主键id" align="center" prop="id" /> -->
            <el-table-column label="项目名称" align="center" prop="projectName">
              <template slot-scope="scope">
                <div
                  :title="scope.row.projectName"
                  class="public-text-blue public-cursor"
                  @click.stop="handleInvestOppDetail(scope.row)"
                >
                  {{ scope.row.projectName }}
                </div>
              </template>
            </el-table-column>
            <el-table-column label="所属行业" align="center" prop="industry"
            ><template slot-scope="scope">
              <dict-tag
                :options="dict.type.CUSTOMER_TRADE"
                :value="scope.row.industry"
              />
            </template>
            </el-table-column>
            <el-table-column label="项目阶段" align="center" prop="projectStage">
              <template slot-scope="scope">
                <dict-tag
                  :options="dict.type.project_stage"
                  :value="scope.row.projectStage"
                />
              </template>
            </el-table-column>
<!--            <el-table-column
              label="项目状态"
              align="center"
              prop="projectState"
              width="120"
            >
              <template slot-scope="scope">
                <dict-tag
                  :options="dict.type.project_state"
                  :value="scope.row.projectState"
                />
              </template>
            </el-table-column>-->
            <el-table-column label="项目机会状态" align="center" prop="projectStatus">
              <template slot-scope="scope">
                <!-- 定义状态文本映射对象 -->
                <el-tag
                  :type="{
                    0: 'success',
                    1: 'danger',
                    2: 'warning'
                  }[scope.row.projectStatus] || 'info'"
                >
                  {{ {
                  0: '正常',
                  1: '终止',
                  2: '观望'
                }[scope.row.projectStatus] || '未知状态' }}
                </el-tag>
              </template>
            </el-table-column>
            <el-table-column label="项目负责人" align="center" prop="investHead">
              <template slot-scope="scope">
                <div :title="scope.row.investHead">
                  {{ scope.row.investHead }}
                </div>
              </template>
            </el-table-column>
            <el-table-column label="终止原因" align="center" prop="reason">
              <template slot-scope="scope">
                <div :title="scope.row.reason">
                  {{ scope.row.reason }}
                </div>
              </template>
            </el-table-column>
            <!-- delFlag -->
            <el-table-column label="状态" align="center" prop="delFlag">
              <template slot-scope="scope">
                <div :title="scope.row.delFlag === '1' ? '终止' : '正常'">
                  {{ scope.row.delFlag === "1" ? "终止" : "正常" }}
                </div>
              </template>
            </el-table-column>
            <el-table-column label="申请人" align="center" prop="startUserName">
              <template slot-scope="scope">
                <div :title="scope.row.startUserName">
                  {{ scope.row.startUserName }}
                </div>
              </template>
            </el-table-column>
            <el-table-column label="申请日期" align="center" prop="createTime">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span>
              </template>
            </el-table-column>
            <el-table-column label="当前节点" align="center" prop="taskName">
              <template slot-scope="scope">
                <div  v-if="scope.row.deployId !== null && scope.row.deployId !== undefined && scope.row.deployId !== ''"  :title="scope.row.taskName" class="public-text-blue public-cursor" @click="handleReadImage(scope.row)">
                  {{ scope.row.taskName}}
                </div>
                <div v-else :title="scope.row.taskName">
                  {{ scope.row.taskName}}
                </div>
              </template>
            </el-table-column>
            <el-table-column label="当前处理人" align="center" prop="assigneeName">
              <template slot-scope="scope">
                <div :title="scope.row.assigneeName">
                  {{ scope.row.assigneeName}}
                </div>
              </template>
            </el-table-column>
            <el-table-column label="流程状态" align="center" prop="status">
              <template slot-scope="scope">
                <div :title="scope.row.status">
                  <span v-if="scope.row.status === 0">暂存</span>
                  <span v-else-if="scope.row.status === 1">已提交</span>
                  <span v-else-if="scope.row.status === 2">审批中</span>
                  <span v-else-if="scope.row.status === 3">审批完成</span>
                  <span v-else-if="scope.row.status === 4">关闭</span>
                </div>
              </template>
            </el-table-column>
            <el-table-column label="操作" align="center" width="150" fixed="right" class-name="small-padding fixed-width">
              <template slot-scope="scope">
                <el-button type="text" size="small" @click="handleDetail(scope.row)">详情</el-button>
              </template>
            </el-table-column>
          </el-table>
          <!-- 分页 -->
          <pagination
            v-show="myDoneTaskTotal > 0"
            :total="myDoneTaskTotal"
            :page.sync="queryParams.pageNum"
            :limit.sync="queryParams.pageSize"
            @pagination="getMyDoneTaskList"
          />
        </el-tab-pane>
        <el-tab-pane label="我的单据" name="list3">
          <!-- 我的单据表格 -->
          <!-- 列表一内容 -->
          <el-table
            ref="dataTable"
            @row-click="clickRow"
            class="tableWrapper"
            v-loading="loading"
            border
            :data="myList"
          >
<!--            <el-table-column type="selection" width="40" align="center" />-->
            <el-table-column
              type="index"
              label="序号"
              width="50"
              align="center"
            ></el-table-column>
            <!-- <el-table-column label="主键id" align="center" prop="id" /> -->
            <el-table-column label="项目名称" align="center" prop="projectName">
              <template slot-scope="scope">
                <div
                  :title="scope.row.projectName"
                  class="public-text-blue public-cursor"
                  @click.stop="handleInvestOppDetail(scope.row)"
                >
                  {{ scope.row.projectName }}
                </div>
              </template>
            </el-table-column>
            <el-table-column label="所属行业" align="center" prop="industry"
            ><template slot-scope="scope">
              <dict-tag
                :options="dict.type.CUSTOMER_TRADE"
                :value="scope.row.industry"
              />
            </template>
            </el-table-column>
            <el-table-column label="项目阶段" align="center" prop="projectStage">
              <template slot-scope="scope">
                <dict-tag
                  :options="dict.type.project_stage"
                  :value="scope.row.projectStage"
                />
              </template>
            </el-table-column>
<!--            <el-table-column
              label="项目状态"
              align="center"
              prop="projectState"
              width="120"
            >
              <template slot-scope="scope">
                <dict-tag
                  :options="dict.type.project_state"
                  :value="scope.row.projectState"
                />
              </template>
            </el-table-column>-->
            <el-table-column label="项目机会状态" align="center" prop="projectStatus">
              <template slot-scope="scope">
                <!-- 定义状态文本映射对象 -->
                <el-tag
                  :type="{
                    0: 'success',
                    1: 'danger',
                    2: 'warning'
                  }[scope.row.projectStatus] || 'info'"
                >
                  {{ {
                  0: '正常',
                  1: '终止',
                  2: '观望'
                }[scope.row.projectStatus] || '未知状态' }}
                </el-tag>
              </template>
            </el-table-column>
            <el-table-column label="项目负责人" align="center" prop="investHead">
              <template slot-scope="scope">
                <div :title="scope.row.investHead">
                  {{ scope.row.investHead }}
                </div>
              </template>
            </el-table-column>
            <el-table-column label="终止原因" align="center" prop="reason">
              <template slot-scope="scope">
                <div :title="scope.row.reason">
                  {{ scope.row.reason }}
                </div>
              </template>
            </el-table-column>
            <!-- delFlag -->
            <el-table-column label="状态" align="center" prop="delFlag">
              <template slot-scope="scope">
                <div :title="scope.row.delFlag === '1' ? '终止' : '正常'">
                  {{ scope.row.delFlag === "1" ? "终止" : "正常" }}
                </div>
              </template>
            </el-table-column>
            <el-table-column label="申请人" align="center" prop="startUserName">
              <template slot-scope="scope">
                <div :title="scope.row.startUserName">
                  {{ scope.row.startUserName }}
                </div>
              </template>
            </el-table-column>
            <el-table-column label="申请日期" align="center" prop="createTime">
              <template slot-scope="scope">
                <span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span>
              </template>
            </el-table-column>
            <el-table-column label="当前节点" align="center" prop="taskName">
              <template slot-scope="scope">
                <div :title="scope.row.taskName" class="public-text-blue public-cursor" @click="handleReadImage(scope.row)">
                  {{ scope.row.taskName}}
                </div>
              </template>
            </el-table-column>
            <el-table-column label="当前处理人" align="center" prop="assigneeName">
              <template slot-scope="scope">
                <div :title="scope.row.assigneeName">
                  {{ scope.row.assigneeName}}
                </div>
              </template>
            </el-table-column>
            <el-table-column label="流程状态" align="center" prop="status">
              <template slot-scope="scope">
                <div :title="scope.row.status">
                  <span v-if="scope.row.status === 0">暂存</span>
                  <span v-else-if="scope.row.status === 1">已提交</span>
                  <span v-else-if="scope.row.status === 2">审批中</span>
                  <span v-else-if="scope.row.status === 3">审批完成</span>
                  <span v-else-if="scope.row.status === 4">关闭</span>
                </div>
              </template>
            </el-table-column>
            <el-table-column label="操作" align="center" width="150" fixed="right" class-name="small-padding fixed-width">
              <template slot-scope="scope">
                <el-button type="text" size="small" @click="handleDetail(scope.row)">详情</el-button>
              </template>
            </el-table-column>
          </el-table>
          <!-- 分页 -->
          <pagination
            v-show="myTotal > 0"
            :total="myTotal"
            :page.sync="queryParams.pageNum"
            :limit.sync="queryParams.pageSize"
            @pagination="getMyList"
          />
        </el-tab-pane>
      </el-tabs>
    </el-card>
  <!-- Flowable 流程图弹窗 -->
  <!-- 流程图 -->

  <el-dialog :title="readImage.title" :visible.sync="readImage.open" width="70%"  append-to-body>
    <!-- <el-image :src="readImage.src"></el-image> -->
    <flow :flowData="flowData"/>
  </el-dialog>

  </div>
</template>

<script>
import { getMyTaskList,getMyDoneTaskList,getMyList } from "@/api/project/termination/pool";
import { selectByFlowKey,flowXmlAndNode } from "@/api/flowable/definition";
import { listChannel } from "@/api/invest/channel";
import dueDiligenceList from "../../invest/components/dueDiligenceList.vue";
import followList from "../../invest/components/followList.vue";
import meetingList from "../../invest/components/meetingList.vue";
import businessUpdate from "../../invest/components/businessUpdate.vue";
import flow from '@/views/flowable/task/todo/detail/flow';
import {
  getPool
} from "@/api/invest/pool";

import { mapGetters } from "vuex";
import pool from "../../invest/pool/index.vue";
export default {
  dicts: ["project_group", "project_stage", "project_state", "CUSTOMER_TRADE"],
  components: {
    dueDiligenceList,
    followList,
    meetingList,
    businessUpdate,
    flow
  },
  data() {
    return {
      // 当前激活的 Tab
      activeTab:"list1",
      // 遮罩层
      loading: false,
      // 查询参数
      queryParams: {
        id: null,
        pageNum: 1,
        pageSize: 10,
        projectName: null,
        projectGroup: "",
        projectCode: null,
        channel: null,
        contactDate: null,
        projectDate: null,
        decisionDate: null,
        industry: null,
        company: null,
        projectContacts: null,
        investHead: null,
        previousFinancing: null,
        financingStage: null,
        financingMoney: null,
        financingDate: null,
        investValuation: null,
        investMoney: null,
        investType: null,
        investPloy: null,
        investWorth: null,
        projectStage: null,
        projectState: null,
        orderByColumn: "createTime",
        isAsc: "desc",
        createTime: null,
      },
      // 数据列表（分开存储不同Tab的数据）
      myTaskList: [],       // 待办任务数据
      // 待办任务总条数，用于分页
      myTaskTotal: 0,
      myDoneTaskList: [],   // 已办任务数据
      // 已办任务总条数，用于分页
      myDoneTaskTotal: 0,
      myList: [],   // 我的单据数据
      // 我的单据总条数，用于分页
      myTotal: 0,
      channelList: [], //渠道
      //流程图信息
      readImage:{
        open: false,
        src: "",
      },
      // xml
      flowData: {},
    };
  },
  computed: {
    ...mapGetters(["user"]),
  },
  created() {
    // 页面初始化时，加载当前激活Tab的数据
    this.initTabData();
  },
  mounted() {
    // 渠道
    listChannel({
      pageNum: 1,
      pageSize: 100,
    }).then((response) => {
      this.channelList = response.rows;
    });
  },
  methods: {
    // Tab切换事件处理
    handleTabClick(tab) {
      // tab为当前点击的Tab对象，tab.name即标识（list1/list2）
      this.activeTab = tab.name;
      // 根据Tab标识加载对应数据
      this.initTabData();
    },
    // 初始化当前Tab数据（支持传入Tab名，默认用activeTab）
    initTabData() {
      switch (this.activeTab) {
        case "list1":
          // 待办任务：调用待办查询方法
          this.getMyTaskList();
          break;
        case "list2":
          // 已办任务：调用已办查询方法
          this.getMyDoneTaskList();
          break;
        case "list3":
          // 我的单据：调用单据查询方法
          this.getMyList();
          break;
        default:
          break;
      }
    },

    // 1. 查询“我的待办任务”数据
    getMyTaskList() {
      this.loading = true;
      // 调用待办任务接口（示例）
      getMyTaskList(this.queryParams).then((response) => {
        this.myTaskList = response.rows; // 表格数据
        this.myTaskTotal = response.total; // 分页总条数
        this.loading = false;
      }).catch(() => {
        this.loading = false;
      });
    },
    // 2. 查询“我的已办任务”数据
    getMyDoneTaskList() {
      this.loading = true;
      // 调用待办任务接口（示例）
      getMyDoneTaskList(this.queryParams).then((response) => {
        this.myDoneTaskList = response.rows; // 表格数据
        this.myDoneTaskTotal = response.total; // 分页总条数
        this.loading = false;
      }).catch(() => {
        this.loading = false;
      });
    },

    // 3. 查询“我的单据”数据
    getMyList() {
      this.loading = true;
      // 调用我的单据接口（示例）
      getMyList(this.queryParams).then((response) => {
        this.myList = response.rows;
        this.myTotal = response.total;
        this.loading = false;
      }).catch(() => {
        this.loading = false;
      });
    },

    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.initTabData();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.queryParams.orderByColumn = "createTime";
      this.queryParams.isAsc = "desc";
      this.queryParams.pageNum = 1;
      this.queryParams.pageSize = 10;
      this.handleQuery();
    },
    /*导出*/
    exportQuery() {
      switch (this.activeTab) {
        case "list1":
          // 待办任务：调用待办导出方法
          this.handleExportMyTask();
          break;
        case "list2":
          // 已办任务：调用已办导出方法
          this.handleExportMyDoneTask();
          break;
        case "list3":
          // 我的单据：调用单据导出方法
          this.handleExportMy();
          break;
        default:
          break;
      }
    },
    /** 导出按钮操作 */
    handleExportMyTask() {
      this.download(
        "project/termination/exportMyTask",
        {
          ...this.queryParams,
        },
        `MyTask_${new Date().getTime()}.xlsx`
      );
    },
    handleExportMyDoneTask() {
      this.download(
        "project/termination/exportMyDoneTask",
        {
          ...this.queryParams,
        },
        `MyDoneTask_${new Date().getTime()}.xlsx`
      );
    },
    handleExportMy() {
      this.download(
        "project/termination/exportMy",
        {
          ...this.queryParams,
        },
        `My_${new Date().getTime()}.xlsx`
      );
    },
    clickRow(row) {
      this.$refs.dataTable.toggleRowSelection(row);
    },
    /*项目机会详情*/
    handleInvestOppDetail(row) {
      const projectPoolId = row.projectPoolId;
      getPool(projectPoolId).then((response) => {
        const pInstId=response.data.procInstId;
        this.$router.push({ path: "/project/investOpp/detail", query: { id:
            projectPoolId , pInstId: pInstId } });
      });
    },
    // 跳转到处理页面(暂存节点页面）
    handleEdit(row){
      const id = row.id || this.ids;
      const poolId=row.projectPoolId;
      const pInstId=row.procInstId; ``
      const taskId=row.taskId;
      this.$router.push({ path: "/project/termination/edit", query: { id: poolId , pInstId: pInstId , taskId:taskId} });
    },
    // 签收操作
    handleSign(row) {
      // 标记签收人、更新状态等逻辑
      row.signPerson = '当前用户';
      this.$message.success('签收成功');
    },
    // 跳转到处理页面
    handleProcess(row){
      /*this.$router.push({ path: '/flowable/task/todo/detail/index',
        query: {
          procInsId: row.procInsId,
          executionId: row.executionId,
          deployId: row.deployId,
          taskId: row.taskId,
          taskName: row.taskName,
          startUser: row.startUserName + '-' + row.startDeptName,
        }})*/
      const id = row.id || this.ids;
      const poolId=row.projectPoolId;
      const pInstId=row.procInstId;
      const taskId=row.taskId;
      this.$store.commit("SET_PROJECTITEMMESSAGE", row);
      this.$router.push({ path: "/project/termination/audit", query: { id:poolId , pInstId: pInstId ,taskId:taskId} });

    },
    // 撤回操作
    handleWithdraw(row) {
      // 撤回逻辑（比如清空签收人）
      row.signPerson = '';
      this.$message.success('已撤回');
    },
    // 详情操作
    /*handleFlowRecord(row) {
      // 查看流程详情逻辑
      console.log('流程详情：', row);
    }*/
    /*详情*/
    handleDetail(row) {
      const id = row.id || this.ids;
      const poolId=row.projectPoolId;
      const pInstId=row.procInstId;
      this.$router.push({ path: "/project/termination/detail", query: { id: poolId , pInstId: pInstId } });
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      const id = row.id;
      this.$router.push({ path: "/invest/pool/add", query: { id: id } });
    },
    /**终止按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      const idsName = row.projectName ? row.projectName : this.idsName;
      this.$modal
        .confirm('是否终止"' + idsName + '"项目？')
        .then(function () {
          return delPool(ids);
        })
        .then(() => {
          this.getList();
          this.$modal.msgSuccess("已终止");
        })
        .catch(() => {});
    },
    /** 流程图查看 */
    handleReadImage(row){
      this.readImage.title = "流程图";
      this.readImage.open = true;
      // this.readImage.src = process.env.VUE_APP_BASE_API + "/flowable/definition/readImage/" + deploymentId;
      flowXmlAndNode({procInsId: row.procInstId,deployId:row.deployId}).then(res => {
        this.flowData = res.data;
      })
    },

  },
};
</script>
<style lang="scss" scoped>
.tableWrapper {
  font-size: 12px;
  color: #000;
  ::v-deep .el-table__header-wrapper th {
    font-size: 12px;
    font-weight: bolder;
    color: #000;
  }

  ::v-deep td.el-table__cell:not(:last-child) div {
    text-overflow: -o-ellipsis-lastline;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
  }
}
/**找到表头那一行，然后把里面的复选框隐藏掉**/
.hideHeaderCheckBox
::v-deep
.el-table__header-wrapper
.el-table__header
.el-checkbox {
  display: none;
}
</style>
