index.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <template>
  2. <el-dialog v-model="visible" title="任务详情" width="80%" @closed="$emit('closed')">
  3. <!-- <scTable :apiObj="formConfig.data.deviceCode && $API.passqrcode.online" min-height="108" max-height="600" framework="zeroLite" :formConfig="formConfig" :paramsColums="paramsColums" :columns="columns"></scTable> -->
  4. <scTable :maxHeight="600" :options="options">
  5. <template #expand_content="{ row }">
  6. <table-expand :rowData="row.monos"></table-expand>
  7. </template>
  8. <template #progress_content="{ row }">
  9. <el-progress text-inside :stroke-width="16" :status="row.status == '已完成' ? 'success' : row.status == '执行失败' ? 'exception' : ''" :percentage="row.progress" />
  10. </template>
  11. </scTable>
  12. </el-dialog>
  13. </template>
  14. <script setup>
  15. import XEUtils from "xe-utils";
  16. import TOOL from "@/utils/tool";
  17. import { defaultGroups } from "../../main";
  18. import tableExpand from "./tableExpand";
  19. const visible = ref(false);
  20. const open = data => {
  21. visible.value = true;
  22. options.data = data ? [XEUtils.first(XEUtils.get(defaultGroups, "groups.000.monos"))] : XEUtils.get(defaultGroups, "groups.000.monos")
  23. }
  24. const options = reactive({
  25. minHeight: 108,
  26. data: [],
  27. formConfig: { enabled: false },
  28. pagerConfig: { enabled: false },
  29. columns: [
  30. { type: "expand", fixed: "left", width: 50, align: "center", slots: { content: "expand_content" } },
  31. { field: "option", title: "任务类型", minWidth: 100 },
  32. { field: "createTime", title: "触发时间", minWidth: 160, formatter: ({ cellValue }) => TOOL.dateFormat(cellValue) },
  33. { field: "status", title: "任务状态", minWidth: 100 },
  34. { field: "executeTimes", title: "执行次数", minWidth: 80 },
  35. { field: "progress", title: "执行进度", minWidth: 250, slots: { default: 'progress_content' } },
  36. { field: "reason", title: "失败原因", minWidth: 160 }
  37. ]
  38. })
  39. defineExpose({
  40. open
  41. })
  42. </script>