🔨 数据清理时添加条数限制.
This commit is contained in:
@@ -48,6 +48,15 @@
|
||||
:options="toOptions(execStatusKey)"
|
||||
placeholder="请选择执行状态" />
|
||||
</a-form-item>
|
||||
<!-- 清理数量 -->
|
||||
<a-form-item field="clearLimit" label="清理数量">
|
||||
<a-input-number v-model="formModel.clearLimit"
|
||||
:min="1"
|
||||
:max="clearLimit"
|
||||
:placeholder="`请输入最大清理数量 最大: ${clearLimit}`"
|
||||
hide-button
|
||||
allow-clear />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
@@ -68,6 +77,7 @@
|
||||
import { getExecCommandLogCount, clearExecCommandLog } from '@/api/exec/exec-command-log';
|
||||
import { Message, Modal } from '@arco-design/web-vue';
|
||||
import { useDictStore } from '@/store';
|
||||
import { clearLimit } from '../types/const';
|
||||
import UserSelector from '@/components/user/user/selector/index.vue';
|
||||
|
||||
const emits = defineEmits(['clear']);
|
||||
@@ -86,7 +96,8 @@
|
||||
description: undefined,
|
||||
command: undefined,
|
||||
status: undefined,
|
||||
startTimeRange: undefined
|
||||
startTimeRange: undefined,
|
||||
clearLimit,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -105,6 +116,10 @@
|
||||
|
||||
// 确定
|
||||
const handlerOk = async () => {
|
||||
if (!formModel.value.clearLimit) {
|
||||
Message.error('请输入清理数量');
|
||||
return false;
|
||||
}
|
||||
setLoading(true);
|
||||
try {
|
||||
// 获取总数量
|
||||
@@ -127,7 +142,7 @@
|
||||
const doClear = (count: number) => {
|
||||
Modal.confirm({
|
||||
title: '删除清空',
|
||||
content: `确定要删除 ${count} 条数据吗? 确定后将立即删除且无法恢复!`,
|
||||
content: `确定要删除 ${Math.min(count, formModel.value.clearLimit || 0)} 条数据吗? 确定后将立即删除且无法恢复!`,
|
||||
onOk: async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
// 清理数量
|
||||
export const clearLimit = 1000;
|
||||
|
||||
@@ -49,6 +49,15 @@
|
||||
placeholder="请选择状态"
|
||||
allow-clear />
|
||||
</a-form-item>
|
||||
<!-- 清理数量 -->
|
||||
<a-form-item field="clearLimit" label="清理数量">
|
||||
<a-input-number v-model="formModel.clearLimit"
|
||||
:min="1"
|
||||
:max="clearLimit"
|
||||
:placeholder="`请输入最大清理数量 最大: ${clearLimit}`"
|
||||
hide-button
|
||||
allow-clear />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
@@ -65,7 +74,7 @@
|
||||
import { ref } from 'vue';
|
||||
import useLoading from '@/hooks/loading';
|
||||
import useVisible from '@/hooks/visible';
|
||||
import { uploadTaskStatusKey } from '../types/const';
|
||||
import { clearLimit, uploadTaskStatusKey } from '../types/const';
|
||||
import { getUploadTaskCount, clearUploadTask } from '@/api/exec/upload-task';
|
||||
import { Message, Modal } from '@arco-design/web-vue';
|
||||
import { useDictStore } from '@/store';
|
||||
@@ -105,6 +114,10 @@
|
||||
|
||||
// 确定
|
||||
const handlerOk = async () => {
|
||||
if (!formModel.value.clearLimit) {
|
||||
Message.error('请输入清理数量');
|
||||
return false;
|
||||
}
|
||||
setLoading(true);
|
||||
try {
|
||||
// 获取总数量
|
||||
@@ -127,7 +140,7 @@
|
||||
const doClear = (count: number) => {
|
||||
Modal.confirm({
|
||||
title: '删除清空',
|
||||
content: `确定要删除 ${count} 条数据吗? 确定后将立即删除且无法恢复!`,
|
||||
content: `确定要删除 ${Math.min(count, formModel.value.clearLimit || 0)} 条数据吗? 确定后将立即删除且无法恢复!`,
|
||||
onOk: async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
|
||||
@@ -26,6 +26,9 @@ export const UploadTaskFileStatus = {
|
||||
CANCELED: 'CANCELED',
|
||||
};
|
||||
|
||||
// 清理数量
|
||||
export const clearLimit = 2000;
|
||||
|
||||
// 上传任务状态 字典项
|
||||
export const uploadTaskStatusKey = 'uploadTaskStatus';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user