sensitiveIdentifyTaskExecLog.vue 3.39 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';
import { TableColumnWidth } from "@/utils/enum";


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: "序号", type: "index", width: TableColumnWidth.INDEX, align: "center" },
    { label: "执行人", field: "createUserName", width: TableColumnWidth.USERNAME },
    { label: "执行时间", field: "execTime", width: TableColumnWidth.DATETIME },
    { label: "执行状态", field: "sensitiveIdentifyTaskStatus", width: TableColumnWidth.STATE, align: 'center', type: "tag" },
    { label: "确认人", field: "confirmUserName", width: TableColumnWidth.USERNAME },
    { label: "确认时间", field: "confirmTime", width: TableColumnWidth.DATETIME },
    { label: "确认状态", field: "sensitiveIdentifyConfirmStatus", width: TableColumnWidth.STATE, align: 'center', type: "tag" },
  ],
  data: [],
  page: {
    type: "normal",
    rows: 0,
    ...page.value,
  },
  actionInfo: {
    label: "操作",
    type: "btn",
    width: 100,
    fixed: 'right',
    btns: (scope) => {
      return [{
        label: "查看", value: "report", disabled: scope.row['status'] != 'Y', click: (scope) => {
          router.push({
            name: 'sensitiveIdentifyConfig',
            query: {
              guid: route.query.guid,
              execGuid: scope.row.guid,
              taskName: route.query.name,
              isLook: '1',
            }
          });
        }
      }];
    }
  }
});

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?.map(d => {
        d.sensitiveIdentifyTaskStatus = d.status;
        d.sensitiveIdentifyConfirmStatus = d.confirmStatus;
        return d;
      }) || []
      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
      }
    });
  }
};

onActivated(() => {
  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>