mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-13 02:25:06 +08:00
perf: 优化代码
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
type="warning"
|
||||
preIcon="ep:download"
|
||||
:title="t('action.export')"
|
||||
@click="handleExport()"
|
||||
@click="exportList('错误数据.xls')"
|
||||
/>
|
||||
</template>
|
||||
<template #duration_default="{ row }">
|
||||
@ -81,10 +81,7 @@ const handleDetail = (row: ApiErrorLogApi.ApiErrorLogVO) => {
|
||||
dialogTitle.value = t('action.detail')
|
||||
dialogVisible.value = true
|
||||
}
|
||||
// 导出
|
||||
const handleExport = async () => {
|
||||
await exportList('错误数据.xls')
|
||||
}
|
||||
|
||||
// 异常处理操作
|
||||
const handleProcessClick = (
|
||||
row: ApiErrorLogApi.ApiErrorLogVO,
|
||||
|
@ -32,7 +32,7 @@
|
||||
preIcon="ep:delete"
|
||||
:title="t('action.del')"
|
||||
v-hasPermi="['infra:codegen:delete']"
|
||||
@click="handleDelete(row.id)"
|
||||
@click="deleteData(row.id)"
|
||||
/>
|
||||
<!-- 操作:同步 -->
|
||||
<XTextButton
|
||||
@ -52,7 +52,7 @@
|
||||
</XTable>
|
||||
</ContentWrap>
|
||||
<!-- 弹窗:导入表 -->
|
||||
<ImportTable ref="importRef" @ok="handleQuery()" />
|
||||
<ImportTable ref="importRef" @ok="reload()" />
|
||||
<!-- 弹窗:预览代码 -->
|
||||
<Preview ref="previewRef" />
|
||||
</template>
|
||||
@ -103,17 +103,10 @@ const handleSynchDb = (row: CodegenTableVO) => {
|
||||
message.success('同步成功')
|
||||
})
|
||||
}
|
||||
|
||||
// 生成代码操作
|
||||
const handleGenTable = async (row: CodegenTableVO) => {
|
||||
const res = await CodegenApi.downloadCodegenApi(row.id)
|
||||
download.zip(res, 'codegen-' + row.className + '.zip')
|
||||
}
|
||||
// 删除操作
|
||||
const handleDelete = async (rowId: number) => {
|
||||
await deleteData(rowId)
|
||||
}
|
||||
// 查询操作
|
||||
const handleQuery = async () => {
|
||||
await reload()
|
||||
}
|
||||
</script>
|
||||
|
@ -17,7 +17,7 @@
|
||||
preIcon="ep:download"
|
||||
:title="t('action.export')"
|
||||
v-hasPermi="['infra:config:export']"
|
||||
@click="handleExport()"
|
||||
@click="exportList('配置.xls')"
|
||||
/>
|
||||
</template>
|
||||
<template #visible_default="{ row }">
|
||||
@ -43,7 +43,7 @@
|
||||
preIcon="ep:delete"
|
||||
:title="t('action.del')"
|
||||
v-hasPermi="['infra:config:delete']"
|
||||
@click="handleDelete(row.id)"
|
||||
@click="deleteData(row.id)"
|
||||
/>
|
||||
</template>
|
||||
</XTable>
|
||||
@ -123,11 +123,6 @@ const handleCreate = () => {
|
||||
setDialogTile('create')
|
||||
}
|
||||
|
||||
// 导出操作
|
||||
const handleExport = async () => {
|
||||
await exportList('配置.xls')
|
||||
}
|
||||
|
||||
// 修改操作
|
||||
const handleUpdate = async (rowId: number) => {
|
||||
setDialogTile('update')
|
||||
@ -143,11 +138,6 @@ const handleDetail = async (rowId: number) => {
|
||||
detailData.value = res
|
||||
}
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (rowId: number) => {
|
||||
await deleteData(rowId)
|
||||
}
|
||||
|
||||
// 提交按钮
|
||||
const submitForm = async () => {
|
||||
const elForm = unref(formRef)?.getElFormRef()
|
||||
|
@ -31,7 +31,7 @@
|
||||
preIcon="ep:delete"
|
||||
:title="t('action.del')"
|
||||
v-hasPermi="['infra:data-source-config:delete']"
|
||||
@click="handleDelete(row.id)"
|
||||
@click="deleteData(row.id)"
|
||||
/>
|
||||
</template>
|
||||
</XTable>
|
||||
@ -121,11 +121,6 @@ const handleDetail = async (rowId: number) => {
|
||||
setDialogTile('detail')
|
||||
}
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (rowId: number) => {
|
||||
await deleteData(rowId)
|
||||
}
|
||||
|
||||
// 提交按钮
|
||||
const submitForm = async () => {
|
||||
const elForm = unref(formRef)?.getElFormRef()
|
||||
|
@ -41,7 +41,7 @@
|
||||
preIcon="ep:delete"
|
||||
:title="t('action.del')"
|
||||
v-hasPermi="['infra:file-config:delete']"
|
||||
@click="handleDelete(row.id)"
|
||||
@click="deleteData(row.id)"
|
||||
/>
|
||||
</template>
|
||||
</XTable>
|
||||
@ -283,11 +283,6 @@ const handleTest = async (rowId: number) => {
|
||||
message.alert('测试通过,上传文件成功!访问地址:' + res)
|
||||
}
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (rowId: number) => {
|
||||
await deleteData(rowId)
|
||||
}
|
||||
|
||||
// 提交按钮
|
||||
const submitForm = async (formEl: FormInstance | undefined) => {
|
||||
if (!formEl) return
|
||||
|
@ -21,7 +21,7 @@
|
||||
preIcon="ep:delete"
|
||||
:title="t('action.del')"
|
||||
v-hasPermi="['infra:file:delete']"
|
||||
@click="handleDelete(row.id)"
|
||||
@click="deleteData(row.id)"
|
||||
/>
|
||||
</template>
|
||||
</XTable>
|
||||
@ -162,11 +162,6 @@ const handleDetail = (row: FileApi.FileVO) => {
|
||||
dialogVisible.value = true
|
||||
}
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (rowId: number) => {
|
||||
await deleteData(rowId)
|
||||
}
|
||||
|
||||
// ========== 复制相关 ==========
|
||||
const handleCopy = async (text: string) => {
|
||||
const { copy, copied, isSupported } = useClipboard({ source: text })
|
||||
|
@ -8,7 +8,7 @@
|
||||
preIcon="ep:download"
|
||||
:title="t('action.export')"
|
||||
v-hasPermi="['infra:job:export']"
|
||||
@click="handleExport()"
|
||||
@click="exportList('定时任务详情.xls')"
|
||||
/>
|
||||
</template>
|
||||
<template #beginTime_default="{ row }">
|
||||
@ -77,8 +77,4 @@ const handleDetail = async (row: JobLogApi.JobLogVO) => {
|
||||
dialogTitle.value = t('action.detail')
|
||||
dialogVisible.value = true
|
||||
}
|
||||
// 导出操作
|
||||
const handleExport = async () => {
|
||||
await exportList('定时任务详情.xls')
|
||||
}
|
||||
</script>
|
||||
|
@ -17,14 +17,14 @@
|
||||
preIcon="ep:download"
|
||||
:title="t('action.export')"
|
||||
v-hasPermi="['infra:job:export']"
|
||||
@click="handleExport()"
|
||||
@click="exportList('定时任务.xls')"
|
||||
/>
|
||||
<XButton
|
||||
type="info"
|
||||
preIcon="ep:zoom-in"
|
||||
title="执行日志"
|
||||
v-hasPermi="['infra:job:query']"
|
||||
@click="handleJobLog"
|
||||
@click="handleJobLog()"
|
||||
/>
|
||||
</template>
|
||||
<template #actionbtns_default="{ row }">
|
||||
@ -46,7 +46,7 @@
|
||||
preIcon="ep:delete"
|
||||
:title="t('action.del')"
|
||||
v-hasPermi="['infra:job:delete']"
|
||||
@click="handleDelete(row.id)"
|
||||
@click="deleteData(row.id)"
|
||||
/>
|
||||
<el-dropdown class="p-0.5" v-hasPermi="['infra:job:trigger', 'infra:job:query']">
|
||||
<XTextButton :title="t('action.more')" postIcon="ep:arrow-down" />
|
||||
@ -179,11 +179,6 @@ const handleCreate = () => {
|
||||
setDialogTile('create')
|
||||
}
|
||||
|
||||
// 导出操作
|
||||
const handleExport = async () => {
|
||||
await exportList('定时任务.xls')
|
||||
}
|
||||
|
||||
// 修改操作
|
||||
const handleUpdate = async (rowId: number) => {
|
||||
setDialogTile('update')
|
||||
@ -248,10 +243,6 @@ const parseTime = (time) => {
|
||||
return time_str
|
||||
}
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (rowId: number) => {
|
||||
await deleteData(rowId)
|
||||
}
|
||||
const handleChangeStatus = async (row: JobApi.JobVO) => {
|
||||
const text = row.status === InfraJobStatusEnum.STOP ? '开启' : '关闭'
|
||||
const status =
|
||||
@ -275,7 +266,7 @@ const handleChangeStatus = async (row: JobApi.JobVO) => {
|
||||
})
|
||||
}
|
||||
// 执行日志
|
||||
const handleJobLog = (rowId: number) => {
|
||||
const handleJobLog = (rowId?: number) => {
|
||||
if (rowId) {
|
||||
push('/job/job-log?id=' + rowId)
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user