<template>
  <page-header-wrapper>
    <Grid>
      <a-card class="my-card">
        <AntQueryTable
          height="100%"
          ref="xd-table"
          :queryConfig="yxjlTable.queryConfig"
          :tableConfig="yxjlTable.tableConfig"
          :pageConfig="yxjlTable.pageConfig"
          :showTool="yxjlTable.showTool"
        >
        </AntQueryTable>
      </a-card>
    </Grid>
  </page-header-wrapper>
</template>

<script>
export default {
  name: 'Yxjlsjk',
  data() {
    return {
      yxjlTable: {
        queryConfig: {
          items: [{ label: '想定名称', prop: 'name' }],
        },
        tableConfig: {
          query: (params) =>
            this.$http({
              url: '/scenarioHistory/list',
              method: 'get',
              params: params,
            }),
          columns: [
            { dataIndex: 'serial' },
            { title: '#', align: 'center', dataIndex: 'id', width: 80 },
            { title: '想定名称', align: 'left', dataIndex: 'name', ellipsis: true, width: 'auto' },
            { title: '作者', dataIndex: 'author', align: 'left', width: 'auto' },
            {
              title: '运行状态',
              dataIndex: 'finalStatus',
              customRender: (t) => ({ 1: '中止', 2: '推演结束' }[t]),
              align: 'center',
            },
            {
              title: '开始时间',
              dataIndex: 'scenarioStartRunTime',
              customRender: (t) => t?.replace('T', ' '),
              align: 'center',
            },
            {
              title: '结束时间',
              dataIndex: 'scenarioEndRunTime',
              customRender: (t) => t?.replace('T', ' '),
              align: 'center',
            },
          ],
        },
        pageConfig: true,
        showTool: false,
      },
    }
  },
}
</script>

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