Browse Source

feat: 一些调整

main
betaqi 4 weeks ago
parent
commit
1801049fcf
  1. 24
      src/components/Edfs-table/index.vue
  2. 5
      src/views/taskList/index.vue
  3. 25
      src/views/taskList/infoDrawer.vue
  4. 4
      src/views/taskList/utils.ts

24
src/components/Edfs-table/index.vue

@ -1,16 +1,22 @@ @@ -1,16 +1,22 @@
<template>
<div class="edfs-table-components">
<el-table :data="data" :fit="fit" :stripe="stripe" :border="border" v-loading="loading" :show-header="showHeader"
:max-height="maxHeight" :highlight-current-row="highlightCurrentRow" :row-class-name="rowClassName"
@current-change="onCurrentChange" ref="ELTableRef" @row-click="onRowClick" @row-dblclick="onRowDblclick"
@selection-change="handleSelectionChange" @expand-change="expandChange" class="edfs-table"
:span-method="spanMethod">
<el-table :data="data" :fit="fit" :stripe="stripe" :border="border" v-loading="loading"
:show-header="showHeader"
:max-height="maxHeight" :highlight-current-row="highlightCurrentRow"
:row-class-name="rowClassName"
@current-change="onCurrentChange" ref="ELTableRef" @row-click="onRowClick"
@row-dblclick="onRowDblclick"
@selection-change="handleSelectionChange" @expand-change="expandChange"
class="edfs-table"
:span-method="spanMethod">
<slot></slot>
</el-table>
<template v-if="usePaging">
<div class="pagination-block">
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :width-type="1"
layout="prev, pager, next, jumper" :total="pageTotal" background @current-change="onPageCurrentChange" />
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize"
:width-type="1"
layout="prev, pager, next,total, jumper" :total="pageTotal" background
@current-change="onPageCurrentChange"/>
<!-- @size-change="onPageSizeChange" -->
</div>
@ -45,9 +51,11 @@ const emit = defineEmits<{ @@ -45,9 +51,11 @@ const emit = defineEmits<{
function onCurrentChange(currentRow: any, oldCurrentRow: any) {
emit('current-change', currentRow, oldCurrentRow)
}
function onRowClick(row: any, column: any, event: Event) {
emit('row-click', row, column, event)
}
function onRowDblclick(row: any, column: any, event: Event) {
emit('row-dblclick', row, column, event)
}
@ -55,6 +63,7 @@ function onRowDblclick(row: any, column: any, event: Event) { @@ -55,6 +63,7 @@ function onRowDblclick(row: any, column: any, event: Event) {
function handleSelectionChange(selection: any[]) {
emit('selection-change', selection)
}
function expandChange(row: any, expandedRows: any[]) {
emit('expand-change', row, expandedRows)
}
@ -92,6 +101,7 @@ function getSize() { @@ -92,6 +101,7 @@ function getSize() {
}
const ELTableRef = ref<InstanceType<typeof ElTable>>()
function clearSelection() {
ELTableRef.value?.clearSelection()
}

5
src/views/taskList/index.vue

@ -6,6 +6,11 @@ @@ -6,6 +6,11 @@
:page-total="total" :current-page="queryParams.page" :page-size="queryParams.size"
row-class-name="row"
@pageCurrentChange="handleJump">
<el-table-column label="序号" min-width="5%" align="center">
<template #default="scope">
{{ scope.$index + 1 }}
</template>
</el-table-column>
<template v-for="(col, idx) in tableCol" :key="idx">
<el-table-column v-if="col.prop.endsWith('Time')" :label="col.label"
:min-width="col.minWidth">

25
src/views/taskList/infoDrawer.vue

@ -1,9 +1,25 @@ @@ -1,9 +1,25 @@
<template>
<div class="fault-rule-drawer">
<el-drawer v-model="isShowDrawer" title="任务详情" direction="rtl" size="50%"
modal-class="model-dev-opn"
:before-close="handleBeforeClose">
<el-drawer
v-model="isShowDrawer"
:title="`${taskMode.find(r => r.value === currentTask?.mode)?.label}任务详情`"
direction="rtl"
size="50%"
modal-class="model-dev-opn"
:before-close="handleBeforeClose">
<main class="wh-full" v-loading="loading">
<div v-if="currentTask?.startTime && currentTask.mode === 'export'">
{{
taskMode.find(r => r.value === currentTask?.mode)?.label
}}数据范围{{ dayjs(currentTask?.startTime).format('YYYY-MM-DD HH:mm:ss') }} ~ {{
dayjs(currentTask?.endTime).format('YYYY-MM-DD HH:mm:ss')
}}
</div>
<div v-if="currentTask?.mode === 'update'">
{{ currentTask.info }}
</div>
<template v-for="detail in detailList">
<el-descriptions border :title="`${detail.sn}任务详情`" style="margin-top: 20px">
<el-descriptions-item :label-width="60" label="状态">
@ -44,7 +60,8 @@ import { getSubTopic, type SubMsgData } from '@/utils/zmq' @@ -44,7 +60,8 @@ import { getSubTopic, type SubMsgData } from '@/utils/zmq'
import ZMQWorker from '@/composables/useZMQJsonWorker'
import { getTaskInfo, type TaskInfo, type TaskList } from '@/api/module/taks'
import { useMessage } from '@/composables/useMessage'
import { statusList, statusTypeMap } from "./utils";
import { statusList, statusTypeMap, taskMode } from "./utils";
import dayjs from "dayjs";
const message = useMessage()
const worker = ZMQWorker.getInstance()

4
src/views/taskList/utils.ts

@ -38,10 +38,10 @@ export const taskMode = [{ @@ -38,10 +38,10 @@ export const taskMode = [{
}]
export const tableCol = [
{ label: '任务ID', prop: 'id', minWidth: '10%' },
// { label: '任务ID', prop: 'id', minWidth: '10%' },
{ label: '站点', prop: 'site', minWidth: '10%' },
{ label: '任务类型', prop: 'mode', minWidth: '8%' },
{ label: '任务状态', prop: 'status', minWidth: '10%' },
{ label: '创建时间', prop: 'startTime', minWidth: '12%' },
{ label: '任务详情', prop: 'info', minWidth: '20%' },
// { label: '任务详情', prop: 'info', minWidth: '20%' },
]
Loading…
Cancel
Save