fix: 性能任务激活停止放出,编辑删除放到更多

This commit is contained in:
TsMask
2024-04-10 18:40:56 +08:00
parent b8bff2a159
commit cd0633d519

View File

@@ -5,7 +5,6 @@ import { Form, message, Modal } from 'ant-design-vue/lib';
import { SizeType } from 'ant-design-vue/lib/config-provider';
import { MenuInfo } from 'ant-design-vue/lib/menu/src/interface';
import { ColumnsType } from 'ant-design-vue/lib/table';
import { parseDateToStr } from '@/utils/date-utils';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import useI18n from '@/hooks/useI18n';
import useDictStore from '@/store/modules/dict';
@@ -196,7 +195,11 @@ function fnGetList(pageNum?: number) {
}
tablePagination.total = res.total;
tableState.data = res.rows;
if (tablePagination.total <=(queryParams.pageNum - 1) * tablePagination.pageSize &&queryParams.pageNum !== 1) {
if (
tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize &&
queryParams.pageNum !== 1
) {
tableState.loading = false;
fnGetList(queryParams.pageNum - 1);
}
@@ -311,7 +314,7 @@ function fnModalVisibleByEdit(id?: string) {
modalState.confirmLoading = false;
hide();
if (res.code === RESULT_CODE_SUCCESS && res.data) {
fnSelectPerformanceInit(res.data.neType)
fnSelectPerformanceInit(res.data.neType);
modalState.from = Object.assign(modalState.from, res.data);
modalState.title = t('views.perfManage.perfThreshold.editThre');
modalState.visibleByEdit = true;
@@ -468,6 +471,14 @@ function fnTaskModalVisible(type: string | number, row: Record<string, any>) {
}
fnRecordStop(row);
}
if (type === 'edit') {
fnModalVisibleByEdit(row.id);
}
if (type === 'delete') {
fnRecordDelete(row);
}
}
onMounted(() => {
@@ -600,23 +611,25 @@ onMounted(() => {
<template v-if="column.key === 'id'">
<a-space :size="8" align="center">
<a-tooltip>
<template #title>{{ t('common.editText') }}</template>
<template #title>
{{ t('views.configManage.softwareManage.runBtn') }}
</template>
<a-button
type="link"
@click.prevent="fnModalVisibleByEdit(record.id)"
:disabled="record.status !== 'Inactive'"
@click.prevent="fnTaskModalVisible('run', record)"
>
<template #icon><FormOutlined /></template>
<template #icon><ThunderboltOutlined /></template>
</a-button>
</a-tooltip>
<a-tooltip>
<template #title>{{ t('common.deleteText') }}</template>
<template #title>
{{ t('views.perfManage.taskManage.stopTask') }}
</template>
<a-button
type="link"
@click.prevent="fnRecordDelete(record)"
:disabled="record.status !== 'Inactive'"
@click.prevent="fnTaskModalVisible('stop', record)"
>
<template #icon><DeleteOutlined /></template>
<template #icon><StopOutlined /> </template>
</a-button>
</a-tooltip>
<a-tooltip>
@@ -632,13 +645,19 @@ onMounted(() => {
<a-menu
@click="({ key }:any) => fnTaskModalVisible(key, record)"
>
<a-menu-item key="run">
<ThunderboltOutlined />
{{ t('views.configManage.softwareManage.runBtn') }}
<a-menu-item
key="edit"
:disabled="record.status !== 'Inactive'"
>
<FormOutlined />
{{ t('common.editText') }}
</a-menu-item>
<a-menu-item key="stop">
<UndoOutlined />
{{ t('views.perfManage.taskManage.stopTask') }}
<a-menu-item
key="delete"
:disabled="record.status !== 'Inactive'"
>
<DeleteOutlined />
{{ t('common.deleteText') }}
</a-menu-item>
</a-menu>
</template>