2022-09-20 19:12:48 +08:00
|
|
|
<template>
|
|
|
|
<div>
|
2023-01-31 23:28:37 +08:00
|
|
|
<RouterButton
|
|
|
|
:buttons="[
|
|
|
|
{
|
|
|
|
label: i18n.global.t('cronjob.cronTask'),
|
|
|
|
path: '/cronjobs',
|
|
|
|
},
|
|
|
|
]"
|
|
|
|
/>
|
2023-02-07 10:29:55 +08:00
|
|
|
<LayoutContent v-loading="loading" v-if="!isRecordShow" :title="$t('cronjob.cronTask')">
|
2023-01-31 23:28:37 +08:00
|
|
|
<template #toolbar>
|
2023-02-07 18:48:32 +08:00
|
|
|
<el-row>
|
2023-05-24 16:36:54 +08:00
|
|
|
<el-col :xs="24" :sm="16" :md="16" :lg="16" :xl="16">
|
2023-02-07 18:48:32 +08:00
|
|
|
<el-button type="primary" @click="onOpenDialog('create')">
|
|
|
|
{{ $t('commons.button.create') }}{{ $t('cronjob.cronTask') }}
|
|
|
|
</el-button>
|
2023-10-26 18:20:16 +08:00
|
|
|
<el-button-group class="ml-4">
|
|
|
|
<el-button plain :disabled="selects.length === 0" @click="onBatchChangeStatus('enable')">
|
|
|
|
{{ $t('commons.button.enable') }}
|
|
|
|
</el-button>
|
|
|
|
<el-button plain :disabled="selects.length === 0" @click="onBatchChangeStatus('disable')">
|
|
|
|
{{ $t('commons.button.disable') }}
|
|
|
|
</el-button>
|
|
|
|
<el-button plain :disabled="selects.length === 0" @click="onDelete(null)">
|
|
|
|
{{ $t('commons.button.delete') }}
|
|
|
|
</el-button>
|
|
|
|
</el-button-group>
|
2023-02-07 18:48:32 +08:00
|
|
|
</el-col>
|
2023-05-24 16:36:54 +08:00
|
|
|
<el-col :xs="24" :sm="8" :md="8" :lg="8" :xl="8">
|
2023-02-10 15:55:56 +08:00
|
|
|
<TableSetting @search="search()" />
|
2023-02-07 18:48:32 +08:00
|
|
|
<div class="search-button">
|
|
|
|
<el-input
|
2023-12-11 14:28:06 +08:00
|
|
|
clearable
|
2023-02-07 18:48:32 +08:00
|
|
|
v-model="searchName"
|
|
|
|
@clear="search()"
|
|
|
|
suffix-icon="Search"
|
|
|
|
@keyup.enter="search()"
|
2023-05-05 14:16:52 +08:00
|
|
|
@change="search()"
|
2023-02-07 18:48:32 +08:00
|
|
|
:placeholder="$t('commons.button.search')"
|
|
|
|
></el-input>
|
|
|
|
</div>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
2023-01-31 23:28:37 +08:00
|
|
|
</template>
|
|
|
|
<template #main>
|
2023-01-30 09:39:37 +08:00
|
|
|
<ComplexTable
|
|
|
|
:pagination-config="paginationConfig"
|
|
|
|
v-model:selects="selects"
|
2023-06-29 18:40:12 +08:00
|
|
|
@sort-change="search"
|
2023-01-30 09:39:37 +08:00
|
|
|
@search="search"
|
|
|
|
:data="data"
|
|
|
|
>
|
|
|
|
<el-table-column type="selection" fix />
|
2023-06-29 18:40:12 +08:00
|
|
|
<el-table-column :label="$t('cronjob.taskName')" :min-width="120" prop="name" sortable>
|
2023-02-07 15:33:47 +08:00
|
|
|
<template #default="{ row }">
|
2023-03-16 19:19:07 +08:00
|
|
|
<Tooltip @click="loadDetail(row)" :text="row.name" />
|
2023-02-07 15:33:47 +08:00
|
|
|
</template>
|
|
|
|
</el-table-column>
|
2023-06-29 18:40:12 +08:00
|
|
|
<el-table-column :label="$t('commons.table.status')" :min-width="80" prop="status" sortable>
|
2023-01-30 09:39:37 +08:00
|
|
|
<template #default="{ row }">
|
|
|
|
<el-button
|
|
|
|
v-if="row.status === 'Enable'"
|
|
|
|
@click="onChangeStatus(row.id, 'disable')"
|
|
|
|
link
|
2023-04-12 11:40:29 +08:00
|
|
|
icon="VideoPlay"
|
2023-01-30 09:39:37 +08:00
|
|
|
type="success"
|
|
|
|
>
|
|
|
|
{{ $t('commons.status.enabled') }}
|
|
|
|
</el-button>
|
2023-04-12 11:40:29 +08:00
|
|
|
<el-button
|
|
|
|
v-else
|
|
|
|
icon="VideoPause"
|
|
|
|
link
|
|
|
|
type="danger"
|
|
|
|
@click="onChangeStatus(row.id, 'enable')"
|
|
|
|
>
|
2023-01-30 09:39:37 +08:00
|
|
|
{{ $t('commons.status.disabled') }}
|
|
|
|
</el-button>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
2023-10-23 11:28:33 +08:00
|
|
|
<el-table-column :label="$t('cronjob.cronSpec')" show-overflow-tooltip :min-width="120">
|
2023-01-30 09:39:37 +08:00
|
|
|
<template #default="{ row }">
|
2024-01-26 15:08:36 +08:00
|
|
|
<div v-for="(item, index) of row.spec.split(',')" :key="index">
|
2024-01-22 22:29:19 +08:00
|
|
|
<div v-if="row.expand || (!row.expand && index < 3)">
|
2024-01-26 15:08:36 +08:00
|
|
|
<span>
|
2024-01-22 22:29:19 +08:00
|
|
|
{{ transSpecToStr(item) }}
|
2024-01-26 15:08:36 +08:00
|
|
|
</span>
|
2024-01-22 22:29:19 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div v-if="!row.expand && row.spec.split(',').length > 3">
|
|
|
|
<el-button type="primary" link @click="row.expand = true">
|
|
|
|
{{ $t('commons.button.expand') }}...
|
|
|
|
</el-button>
|
|
|
|
</div>
|
|
|
|
<div v-if="row.expand && row.spec.split(',').length > 3">
|
|
|
|
<el-button type="primary" link @click="row.expand = false">
|
|
|
|
{{ $t('commons.button.collapse') }}
|
|
|
|
</el-button>
|
|
|
|
</div>
|
2023-01-30 09:39:37 +08:00
|
|
|
</template>
|
|
|
|
</el-table-column>
|
2024-01-24 17:41:56 +08:00
|
|
|
<el-table-column :label="$t('cronjob.retainCopies')" :min-width="90" prop="retainCopies">
|
|
|
|
<template #default="{ row }">
|
2024-01-26 15:08:36 +08:00
|
|
|
<el-button v-if="hasBackup(row.type)" @click="loadBackups(row)" plain size="small">
|
|
|
|
{{ row.retainCopies }}{{ $t('cronjob.retainCopiesUnit') }}
|
2024-01-24 17:41:56 +08:00
|
|
|
</el-button>
|
|
|
|
<span v-else>{{ row.retainCopies }}</span>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
2023-05-30 15:30:57 +08:00
|
|
|
<el-table-column :label="$t('cronjob.lastRecordTime')" :min-width="120" prop="lastRecordTime">
|
2023-01-30 09:39:37 +08:00
|
|
|
<template #default="{ row }">
|
2023-05-30 15:30:57 +08:00
|
|
|
{{ row.lastRecordTime }}
|
2023-01-30 09:39:37 +08:00
|
|
|
</template>
|
|
|
|
</el-table-column>
|
2024-01-25 11:20:42 +08:00
|
|
|
<el-table-column :min-width="80" :label="$t('cronjob.target')" prop="defaultDownload">
|
2023-01-30 09:39:37 +08:00
|
|
|
<template #default="{ row }">
|
2024-01-26 15:08:36 +08:00
|
|
|
<div v-for="(item, index) of row.backupAccounts?.split(',')" :key="index">
|
2024-01-24 17:41:56 +08:00
|
|
|
<div v-if="row.accountExpand || (!row.accountExpand && index < 3)">
|
2024-01-26 15:08:36 +08:00
|
|
|
<span v-if="row.backupAccounts">
|
2024-01-25 11:20:42 +08:00
|
|
|
<span v-if="item === row.defaultDownload">
|
2024-01-24 17:41:56 +08:00
|
|
|
{{ $t('setting.' + item) }}
|
2024-01-26 15:08:36 +08:00
|
|
|
<el-icon><Star /></el-icon>
|
2024-01-24 17:41:56 +08:00
|
|
|
</span>
|
|
|
|
<span v-else>
|
|
|
|
{{ $t('setting.' + item) }}
|
|
|
|
</span>
|
2024-01-26 15:08:36 +08:00
|
|
|
</span>
|
2024-01-24 17:41:56 +08:00
|
|
|
<span v-else>-</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-01-25 17:24:09 +08:00
|
|
|
<div v-if="!row.accountExpand && row.backupAccounts?.split(',').length > 3">
|
2024-01-24 17:41:56 +08:00
|
|
|
<el-button type="primary" link @click="row.accountExpand = true">
|
|
|
|
{{ $t('commons.button.expand') }}...
|
|
|
|
</el-button>
|
|
|
|
</div>
|
2024-01-25 17:24:09 +08:00
|
|
|
<div v-if="row.accountExpand && row.backupAccounts?.split(',').length > 3">
|
2024-01-24 17:41:56 +08:00
|
|
|
<el-button type="primary" link @click="row.accountExpand = false">
|
|
|
|
{{ $t('commons.button.collapse') }}
|
|
|
|
</el-button>
|
|
|
|
</div>
|
2023-01-30 09:39:37 +08:00
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
<fu-table-operations
|
2023-07-14 15:18:11 +08:00
|
|
|
width="300px"
|
2023-01-30 09:39:37 +08:00
|
|
|
:buttons="buttons"
|
|
|
|
:ellipsis="10"
|
|
|
|
:label="$t('commons.table.operate')"
|
|
|
|
fix
|
|
|
|
/>
|
|
|
|
</ComplexTable>
|
2023-01-31 23:28:37 +08:00
|
|
|
</template>
|
|
|
|
</LayoutContent>
|
2022-09-20 19:12:48 +08:00
|
|
|
|
2023-11-03 18:23:41 +08:00
|
|
|
<OpDialog ref="opRef" @search="search" @submit="onSubmitDelete()">
|
2023-10-26 18:20:16 +08:00
|
|
|
<template #content>
|
|
|
|
<el-form class="mt-4 mb-1" v-if="showClean" ref="deleteForm" label-position="left">
|
|
|
|
<el-form-item>
|
|
|
|
<el-checkbox v-model="cleanData" :label="$t('cronjob.cleanData')" />
|
|
|
|
<span class="input-help">
|
|
|
|
{{ $t('cronjob.cleanDataHelper') }}
|
|
|
|
</span>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form>
|
2023-04-11 18:48:28 +08:00
|
|
|
</template>
|
2023-10-26 18:20:16 +08:00
|
|
|
</OpDialog>
|
2023-10-25 15:44:36 +08:00
|
|
|
<OperateDialog @search="search" ref="dialogRef" />
|
2023-06-29 18:40:12 +08:00
|
|
|
<Records @search="search" ref="dialogRecordRef" />
|
2024-01-24 17:41:56 +08:00
|
|
|
<Backups @search="search" ref="dialogBackupRef" />
|
2022-09-20 19:12:48 +08:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2023-10-26 18:20:16 +08:00
|
|
|
import OpDialog from '@/components/del-dialog/index.vue';
|
2023-02-10 15:55:56 +08:00
|
|
|
import TableSetting from '@/components/table-setting/index.vue';
|
2023-03-16 19:19:07 +08:00
|
|
|
import Tooltip from '@/components/tooltip/index.vue';
|
2023-10-25 15:44:36 +08:00
|
|
|
import OperateDialog from '@/views/cronjob/operate/index.vue';
|
2023-02-07 10:29:55 +08:00
|
|
|
import Records from '@/views/cronjob/record/index.vue';
|
2024-01-24 17:41:56 +08:00
|
|
|
import Backups from '@/views/cronjob/backup/index.vue';
|
2022-09-20 19:12:48 +08:00
|
|
|
import { onMounted, reactive, ref } from 'vue';
|
2022-09-29 11:13:05 +08:00
|
|
|
import { deleteCronjob, getCronjobPage, handleOnce, updateStatus } from '@/api/modules/cronjob';
|
2022-09-20 19:12:48 +08:00
|
|
|
import i18n from '@/lang';
|
2022-09-22 14:19:49 +08:00
|
|
|
import { Cronjob } from '@/api/interface/cronjob';
|
2023-02-14 17:14:03 +08:00
|
|
|
import { ElMessageBox } from 'element-plus';
|
|
|
|
import { MsgSuccess } from '@/utils/message';
|
2024-01-22 22:29:19 +08:00
|
|
|
import { transSpecToStr } from './helper';
|
2022-09-23 17:21:27 +08:00
|
|
|
|
2023-01-31 23:28:37 +08:00
|
|
|
const loading = ref();
|
2022-09-20 19:12:48 +08:00
|
|
|
const selects = ref<any>([]);
|
2023-02-07 10:29:55 +08:00
|
|
|
const isRecordShow = ref();
|
2023-11-03 18:23:41 +08:00
|
|
|
const operateIDs = ref();
|
2022-09-20 19:12:48 +08:00
|
|
|
|
2023-10-26 18:20:16 +08:00
|
|
|
const opRef = ref();
|
|
|
|
const showClean = ref();
|
|
|
|
const cleanData = ref();
|
|
|
|
|
2022-09-20 19:12:48 +08:00
|
|
|
const data = ref();
|
|
|
|
const paginationConfig = reactive({
|
2023-09-18 17:20:25 +08:00
|
|
|
cacheSizeKey: 'cronjob-page-size',
|
2022-09-20 19:12:48 +08:00
|
|
|
currentPage: 1,
|
2022-09-29 16:15:59 +08:00
|
|
|
pageSize: 10,
|
2022-09-20 19:12:48 +08:00
|
|
|
total: 0,
|
2023-08-03 16:21:27 +08:00
|
|
|
orderBy: 'created_at',
|
|
|
|
order: 'null',
|
2022-09-20 19:12:48 +08:00
|
|
|
});
|
2023-02-07 18:48:32 +08:00
|
|
|
const searchName = ref();
|
2022-09-20 19:12:48 +08:00
|
|
|
|
2023-06-29 18:40:12 +08:00
|
|
|
const search = async (column?: any) => {
|
2023-08-03 16:21:27 +08:00
|
|
|
paginationConfig.orderBy = column?.order ? column.prop : paginationConfig.orderBy;
|
|
|
|
paginationConfig.order = column?.order ? column.order : paginationConfig.order;
|
2022-10-20 16:15:11 +08:00
|
|
|
let params = {
|
2023-02-07 18:48:32 +08:00
|
|
|
info: searchName.value,
|
2022-10-20 16:15:11 +08:00
|
|
|
page: paginationConfig.currentPage,
|
|
|
|
pageSize: paginationConfig.pageSize,
|
2023-08-03 16:21:27 +08:00
|
|
|
orderBy: paginationConfig.orderBy,
|
|
|
|
order: paginationConfig.order,
|
2022-10-20 16:15:11 +08:00
|
|
|
};
|
2023-01-31 23:28:37 +08:00
|
|
|
loading.value = true;
|
|
|
|
await getCronjobPage(params)
|
|
|
|
.then((res) => {
|
|
|
|
loading.value = false;
|
|
|
|
data.value = res.data.items || [];
|
|
|
|
for (const item of data.value) {
|
2024-01-25 11:20:42 +08:00
|
|
|
let itemAccounts = item.backupAccounts.split(',') || [];
|
2024-01-24 17:41:56 +08:00
|
|
|
let accounts = [];
|
2024-01-25 11:20:42 +08:00
|
|
|
for (const account of itemAccounts) {
|
|
|
|
if (account == item.defaultDownload) {
|
2024-01-24 17:41:56 +08:00
|
|
|
accounts.unshift(account);
|
|
|
|
} else {
|
|
|
|
accounts.push(account);
|
|
|
|
}
|
2023-01-31 23:28:37 +08:00
|
|
|
}
|
2024-01-25 11:20:42 +08:00
|
|
|
item.itemAccounts = accounts.join(',');
|
2023-01-31 23:28:37 +08:00
|
|
|
}
|
|
|
|
paginationConfig.total = res.data.total;
|
|
|
|
})
|
|
|
|
.catch(() => {
|
|
|
|
loading.value = false;
|
|
|
|
});
|
2022-09-20 19:12:48 +08:00
|
|
|
};
|
|
|
|
|
2023-02-07 10:29:55 +08:00
|
|
|
const dialogRecordRef = ref();
|
2024-01-24 17:41:56 +08:00
|
|
|
const dialogBackupRef = ref();
|
2022-09-23 17:21:27 +08:00
|
|
|
|
2023-02-07 10:29:55 +08:00
|
|
|
const dialogRef = ref();
|
2022-09-22 14:19:49 +08:00
|
|
|
const onOpenDialog = async (
|
|
|
|
title: string,
|
|
|
|
rowData: Partial<Cronjob.CronjobInfo> = {
|
2024-01-22 22:29:19 +08:00
|
|
|
specObjs: [
|
|
|
|
{
|
|
|
|
specType: 'perMonth',
|
|
|
|
week: 1,
|
|
|
|
day: 3,
|
|
|
|
hour: 1,
|
|
|
|
minute: 30,
|
|
|
|
second: 30,
|
|
|
|
},
|
|
|
|
],
|
2023-02-23 17:31:46 +08:00
|
|
|
type: 'shell',
|
2022-09-29 16:15:59 +08:00
|
|
|
retainCopies: 7,
|
2022-09-22 14:19:49 +08:00
|
|
|
},
|
|
|
|
) => {
|
|
|
|
let params = {
|
|
|
|
title,
|
|
|
|
rowData: { ...rowData },
|
|
|
|
};
|
|
|
|
dialogRef.value!.acceptParams(params);
|
2022-09-20 19:12:48 +08:00
|
|
|
};
|
|
|
|
|
2023-04-11 18:48:28 +08:00
|
|
|
const onDelete = async (row: Cronjob.CronjobInfo | null) => {
|
2023-10-26 18:20:16 +08:00
|
|
|
let names = [];
|
|
|
|
let ids = [];
|
|
|
|
showClean.value = false;
|
|
|
|
cleanData.value = false;
|
2022-09-22 14:19:49 +08:00
|
|
|
if (row) {
|
2023-10-26 18:20:16 +08:00
|
|
|
ids = [row.id];
|
|
|
|
names = [row.name];
|
2023-11-03 18:23:41 +08:00
|
|
|
if (hasBackup(row.type)) {
|
2023-10-26 18:20:16 +08:00
|
|
|
showClean.value = true;
|
2023-05-25 10:48:10 +08:00
|
|
|
}
|
2023-04-11 18:48:28 +08:00
|
|
|
} else {
|
2023-05-25 10:48:10 +08:00
|
|
|
for (const item of selects.value) {
|
2023-10-26 18:20:16 +08:00
|
|
|
names.push(item.name);
|
|
|
|
ids.push(item.id);
|
2023-11-03 18:23:41 +08:00
|
|
|
if (hasBackup(item.type)) {
|
2023-10-26 18:20:16 +08:00
|
|
|
showClean.value = true;
|
2023-05-25 10:48:10 +08:00
|
|
|
}
|
|
|
|
}
|
2023-04-11 18:48:28 +08:00
|
|
|
}
|
2023-11-03 18:23:41 +08:00
|
|
|
operateIDs.value = ids;
|
2023-10-26 18:20:16 +08:00
|
|
|
opRef.value.acceptParams({
|
|
|
|
title: i18n.global.t('commons.button.delete'),
|
|
|
|
names: names,
|
|
|
|
msg: i18n.global.t('commons.msg.operatorHelper', [
|
|
|
|
i18n.global.t('cronjob.cronTask'),
|
|
|
|
i18n.global.t('commons.button.delete'),
|
|
|
|
]),
|
2023-11-03 18:23:41 +08:00
|
|
|
api: null,
|
|
|
|
params: null,
|
2023-05-25 10:48:10 +08:00
|
|
|
});
|
2023-04-11 18:48:28 +08:00
|
|
|
};
|
|
|
|
|
2023-11-03 18:23:41 +08:00
|
|
|
const onSubmitDelete = async () => {
|
|
|
|
await deleteCronjob({ ids: operateIDs.value, cleanData: cleanData.value });
|
|
|
|
MsgSuccess(i18n.global.t('commons.msg.deleteSuccess'));
|
|
|
|
search();
|
|
|
|
};
|
|
|
|
|
2022-12-14 19:34:42 +08:00
|
|
|
const onChangeStatus = async (id: number, status: string) => {
|
|
|
|
ElMessageBox.confirm(i18n.global.t('cronjob.' + status + 'Msg'), i18n.global.t('cronjob.changeStatus'), {
|
|
|
|
confirmButtonText: i18n.global.t('commons.button.confirm'),
|
|
|
|
cancelButtonText: i18n.global.t('commons.button.cancel'),
|
|
|
|
}).then(async () => {
|
|
|
|
let itemStatus = status === 'enable' ? 'Enable' : 'Disable';
|
|
|
|
await updateStatus({ id: id, status: itemStatus });
|
2023-02-14 17:14:03 +08:00
|
|
|
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
2022-09-20 19:12:48 +08:00
|
|
|
search();
|
2022-12-14 19:34:42 +08:00
|
|
|
});
|
2022-09-20 19:12:48 +08:00
|
|
|
};
|
2022-12-14 19:34:42 +08:00
|
|
|
|
2023-06-12 15:44:15 +08:00
|
|
|
const onBatchChangeStatus = async (status: string) => {
|
|
|
|
ElMessageBox.confirm(i18n.global.t('cronjob.' + status + 'Msg'), i18n.global.t('cronjob.changeStatus'), {
|
|
|
|
confirmButtonText: i18n.global.t('commons.button.confirm'),
|
|
|
|
cancelButtonText: i18n.global.t('commons.button.cancel'),
|
|
|
|
}).then(async () => {
|
|
|
|
let itemStatus = status === 'enable' ? 'Enable' : 'Disable';
|
|
|
|
for (const item of selects.value) {
|
|
|
|
await updateStatus({ id: item.id, status: itemStatus });
|
|
|
|
}
|
|
|
|
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
|
|
|
search();
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2024-01-24 17:41:56 +08:00
|
|
|
const loadBackups = async (row: any) => {
|
|
|
|
dialogBackupRef.value!.acceptParams({ cronjobID: row.id, cronjob: row.name });
|
|
|
|
};
|
|
|
|
|
2022-09-29 11:13:05 +08:00
|
|
|
const onHandle = async (row: Cronjob.CronjobInfo) => {
|
2023-02-07 10:29:55 +08:00
|
|
|
loading.value = true;
|
|
|
|
await handleOnce(row.id)
|
|
|
|
.then(() => {
|
|
|
|
loading.value = false;
|
2023-02-14 17:14:03 +08:00
|
|
|
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
2023-02-07 10:29:55 +08:00
|
|
|
search();
|
|
|
|
})
|
|
|
|
.catch(() => {
|
|
|
|
loading.value = false;
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2023-11-03 18:23:41 +08:00
|
|
|
const hasBackup = (type: string) => {
|
|
|
|
return (
|
|
|
|
type === 'app' ||
|
|
|
|
type === 'website' ||
|
|
|
|
type === 'database' ||
|
|
|
|
type === 'directory' ||
|
|
|
|
type === 'snapshot' ||
|
|
|
|
type === 'log'
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2023-02-07 15:33:47 +08:00
|
|
|
const loadDetail = (row: any) => {
|
|
|
|
isRecordShow.value = true;
|
|
|
|
let params = {
|
|
|
|
rowData: { ...row },
|
|
|
|
};
|
|
|
|
dialogRecordRef.value!.acceptParams(params);
|
|
|
|
};
|
|
|
|
|
2022-09-20 19:12:48 +08:00
|
|
|
const buttons = [
|
2022-09-29 11:13:05 +08:00
|
|
|
{
|
|
|
|
label: i18n.global.t('commons.button.handle'),
|
|
|
|
click: (row: Cronjob.CronjobInfo) => {
|
|
|
|
onHandle(row);
|
|
|
|
},
|
|
|
|
},
|
2022-09-20 19:12:48 +08:00
|
|
|
{
|
|
|
|
label: i18n.global.t('commons.button.edit'),
|
2022-09-22 14:19:49 +08:00
|
|
|
click: (row: Cronjob.CronjobInfo) => {
|
|
|
|
onOpenDialog('edit', row);
|
|
|
|
},
|
|
|
|
},
|
2023-02-13 16:34:02 +08:00
|
|
|
{
|
|
|
|
label: i18n.global.t('cronjob.record'),
|
|
|
|
click: (row: Cronjob.CronjobInfo) => {
|
|
|
|
loadDetail(row);
|
|
|
|
},
|
|
|
|
},
|
2022-09-22 14:19:49 +08:00
|
|
|
{
|
2022-09-23 17:21:27 +08:00
|
|
|
label: i18n.global.t('commons.button.delete'),
|
2022-09-22 14:19:49 +08:00
|
|
|
click: (row: Cronjob.CronjobInfo) => {
|
2023-04-11 18:48:28 +08:00
|
|
|
onDelete(row);
|
2022-09-22 14:19:49 +08:00
|
|
|
},
|
2022-09-20 19:12:48 +08:00
|
|
|
},
|
|
|
|
];
|
2024-01-22 22:29:19 +08:00
|
|
|
|
2022-09-20 19:12:48 +08:00
|
|
|
onMounted(() => {
|
|
|
|
search();
|
|
|
|
});
|
|
|
|
</script>
|