sensitiveIdentifyTaskExecLog.vue 2.88 KB
<route lang="yaml">
  name: sensitiveIdentifyTaskExecLog
</route>

<script lang="ts" setup name="sensitiveIdentifyTaskExecLog">
import { ref } from "vue";
import { useRouter, useRoute } from "vue-router";
import Table from "@/components/Table/index.vue";
import { ElMessage } from "element-plus";
import { commonPageConfig } from '@/components/PageNav/index';
import {
 getSensitiveDataTaskExecLog,
} from '@/api/modules/dataAnonymization';


const { proxy } = getCurrentInstance() as any;

const router = useRouter();
const route = useRoute();
const guid = route.query.guid;
const wordName = route.query.name

const page = ref({
  ...commonPageConfig
});

const tableInfo = ref({
  id: "word-log-table",
  loading: false,
  fields: [
    { label: "报告名称", field: "analysisReportName", width: 230 },
    {
      label: "方案类型", field: "analysisReportType", width: 100, getName: (scope) => {
        let planType = scope.row.analysisReportType;
        return planType == 1 ? '表' : (planType == 2 ? '数据库' : (planType == 4 ? '数据同步' : '分组'));
      }
    },
    { label: "报告对象", field: "qualityModelName", width: 180, },
    { label: "质量评分", field: "qualityScore", width: 100, align: "right" },
    { label: "最后执行时间", field: "execTime", width: 180, },
    { label: "执行状态", field: "execResult", type: "tag", width: 120, align: "center" },
  ],
  data: [],
  page: {
    type: "normal",
    rows: 0,
    ...page.value,
  },
  actionInfo: {
    label: "操作",
    type: "btn",
    width: 100,
    fixed: 'right',
    btns: (scope) => {
      return [{ label: "查看报告", value: "reportView", disabled: scope.row['execResult'] != 'Y' }];
    }
  }
});

const getTableData = () => {
  tableInfo.value.loading = true;
  getSensitiveDataTaskExecLog({ pageIndex: page.value.curr, pageSize: page.value.limit, taskGuid: guid }).then((res: any) => {
    tableInfo.value.loading = false;
    if (res?.code == proxy.$passCode) {
      const data = res.data || {}
      tableInfo.value.data = data.records || []
      tableInfo.value.page.limit = data.pageSize
      tableInfo.value.page.curr = data.pageIndex
      tableInfo.value.page.rows = data.totalRows
    } else {
      ElMessage.error(res.msg);
    }
  })
};

const tableBtnClick = (scope, btn) => {
  const type = btn.value;
  const row = scope.row;
  if (type == 'reportView') {
    router.push({
      name: 'analysisReport',
      query: {
        planGuid: row.planGuid,
        reportExecGuid: row.guid,
        name: wordName
      }
    });
  }
};

onBeforeMount(() => {
  getTableData();
});

</script>

<template>
  <div class="container_wrap">
    <div class="table_panel_wrap">
      <Table :tableInfo="tableInfo" @tableBtnClick="tableBtnClick" />
    </div>
  </div>
</template>

<style lang="scss" scoped>
.container_wrap {
  padding: 0;

  .table_panel_wrap {
    height: 100%;
    padding: 16px 16px 0;
  }
}
</style>