<template>
  <div class="detail">
    <p-modal
      title="任务试算"
      :visible="value"
      :dialogStyle="{ top: '40px' }"
      :draggable="true"
      :width="'85%'"
      :confirm-loading="confirmLoading"
      :destroyOnClose = 'true'
      :footer="null"
      @cancel="handleCancel"
    >
        <p-table
          v-if="value"
          ref="refData"
          size="small"
          rowKey="id"
          :scroll="{ x: 1200 }"
          :columns="columns"
          auto-width
          dragle
          :data-source.sync="dataList"
          :hasRowSelectCheck="true"
          :pagination="false"
          :rowSelectType="false"
          :has-row-count="true"
        >
        </p-table>
    </p-modal>
  </div>
</template>
<script>
import { trialColumns } from '../js/trial'

export default {
  component: {},

  props: {
    value: {
      type: Boolean,
      default: false,
    },
    trialData: {
      type: Array,
      default: [],
    },
  },
  data() {
    return {
      confirmLoading: false,
      columns: trialColumns,
      dataList: [],
    }
  },
  created() {},
  mounted() {},
  watch: {
    value(bool) {
      if (bool) {
       this.dataList = this.trialData  
      }
    },
  },
  methods: {
    handleCancel(e) {
      this.$emit('input', false)
    },
  },
}
</script>