<template>
  <div>
    <el-dialog
      title="澄清提问"
      :visible.sync="dialogVisible"
      width="70%"
      :before-close="dialogBeforeClose"
    >
      <div>
        <el-table
            :border="true"
            stripe
            fit
            size="mini"
            :max-height="tableHeight"
            v-loading="tableLoading"
            ref="multipleSelection"
            :data="tableData"
          >
            <el-table-column
              prop="projectApprovalType"
              show-overflow-tooltip
              min-width="10%"
              align="center"
              label="立项类型"
              resizable
            >
              <template slot-scope="scope">
                <div>
                  {{scope.row.projectApprovalType==1?'物资':'项目' }}
                </div>
              </template>
            </el-table-column>
            <el-table-column
              prop="describe"
              show-overflow-tooltip
              min-width="10%"
              align="center"
              label="问题描述"
              resizable
            >
            </el-table-column>
            <el-table-column
              prop="operateName"
              show-overflow-tooltip
              min-width="10%"
              align="center"
              label="操作人姓名"
              resizable
            >
            </el-table-column>
            <el-table-column
              prop="operateOrgName"
              show-overflow-tooltip
              min-width="10%"
              align="center"
              label="操作人企业名称"
              resizable
            >
            </el-table-column>
            <el-table-column
              prop="operateTime"
              show-overflow-tooltip
              min-width="10%"
              align="center"
              label="时间"
              resizable
            >
            </el-table-column>
            <el-table-column
              show-overflow-tooltip
              min-width="10%"
              align="center"
              label="附件"
              resizable
            >
            <template v-slot="{row}">
                <a v-if="row.accessoryList.length" :href="row.accessoryList[0].url" target="_blank">{{ row.accessoryList[0].name }}</a>
              </template>
            </el-table-column>
          </el-table>
      </div>
      <div slot="footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <!-- <el-button type="primary" @click="dialogVisible = false"
          >确 定</el-button
        > -->
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      dialogVisible: false,
      params: {
        pageBean: {
          page: -1,
          pageSize: -1,
        },
        querys: [],
        sorter: [
          {
            direction: 'DESC',
            property: 'create_time_',
          },
        ],
      },
      tableData: [],
      tableLoading:false,
      tableHeight: 1000,
    }
  },
  created() {},
  methods: {
    open(row) {
      this.getData(row)
    },
    getData(row) {
      this.params.querys = []
      this.params.querys.push({
        group: 'main',
        operation: 'EQUAL',
        parentGroup: '',
        property: 'projectApprovalId',
        relation: 'AND',
        value: row.id,
      })
      this.$http
        .post('${portal}/clarifyAnswer/v1/page', this.params)
        .then((res) => {
          this.dialogVisible = true
          this.tableData = res.data.value.rows
          console.log(res, 1111111111)
        })
    },
    dialogBeforeClose() {
      this.dialogVisible = false
    },
  },
}
</script>

<style lang="scss" scoped>
</style>