vue3:review 代码生成、文件配置、文件列表、配置管理、访问日志、错误日志、定时任务

This commit is contained in:
YunaiV 2022-11-26 23:05:29 +08:00
parent c5f1cad033
commit e1a05c1374
11 changed files with 32 additions and 3 deletions

View File

@ -6,6 +6,7 @@ import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
const crudSchemas = reactive<VxeCrudSchema>({
primaryKey: 'id',
primaryType: 'seq',
primaryTitle: '日志编号',
action: true,
actionWidth: '80px',
columns: [

View File

@ -6,6 +6,7 @@ import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
const crudSchemas = reactive<VxeCrudSchema>({
primaryKey: 'id',
primaryType: 'seq',
primaryTitle: '日志编号',
action: true,
actionWidth: '300',
columns: [

View File

@ -28,6 +28,7 @@
<XButton preIcon="ep:refresh-right" :title="t('common.reset')" @click="resetQuery()" />
</el-form-item>
</el-form>
<!-- TODO 星语暗黑模式选中后样式有点不太好看 -->
<vxe-table
ref="xTable"
:data="dbTableList"

View File

@ -3,6 +3,7 @@
<!-- 列表 -->
<vxe-grid ref="xGrid" v-bind="gridOptions" class="xtable-scrollbar">
<template #toolbar_buttons>
<!-- 操作导入 -->
<XButton
type="primary"
preIcon="ep:zoom-in"
@ -12,30 +13,35 @@
/>
</template>
<template #actionbtns_default="{ row }">
<!-- 操作预览 -->
<XTextButton
preIcon="ep:view"
:title="t('action.preview')"
v-hasPermi="['infra:codegen:query']"
@click="handlePreview(row.id)"
/>
<!-- 操作编辑 -->
<XTextButton
preIcon="ep:edit"
:title="t('action.edit')"
v-hasPermi="['infra:codegen:update']"
@click="handleUpdate(row.id)"
/>
<!-- 操作删除 -->
<XTextButton
preIcon="ep:delete"
:title="t('action.del')"
v-hasPermi="['infra:codegen:delete']"
@click="handleDelete(row.id)"
/>
<!-- 操作同步 -->
<XTextButton
preIcon="ep:refresh"
:title="t('action.sync')"
v-hasPermi="['infra:codegen:update']"
@click="handleSynchDb(row.id)"
/>
<!-- 操作生成 -->
<XTextButton
preIcon="ep:download"
:title="t('action.generate')"
@ -45,7 +51,9 @@
</template>
</vxe-grid>
</ContentWrap>
<!-- 弹窗导入表 -->
<ImportTable ref="importRef" @ok="handleQuery()" />
<!-- 弹窗预览代码 -->
<Preview ref="previewRef" />
</template>
<script setup lang="ts" name="Codegen">
@ -78,12 +86,15 @@ const openImportTable = () => {
importRef.value.show()
}
//
// TODO
const previewRef = ref()
const handlePreview = (row: CodegenTableVO) => {
previewRef.value.show(row)
}
//
const handleUpdate = (rowId: number) => {
// TODO tab "[" + tableName + "]"
// TODO
push('/codegen/edit?id=' + rowId)
}
//

View File

@ -16,7 +16,7 @@ export const rules = reactive({
// CrudSchema
const crudSchemas = reactive<VxeCrudSchema>({
primaryKey: 'id',
primaryType: 'seq',
primaryType: null,
action: true,
columns: [
{
@ -91,4 +91,5 @@ const crudSchemas = reactive<VxeCrudSchema>({
}
]
})
// TODO 星语:“创建时间”的筛选,超过 table 的边框
export const { allSchemas } = useVxeCrudSchemas(crudSchemas)

View File

@ -28,6 +28,7 @@ export const rules = reactive({
const crudSchemas = reactive<VxeCrudSchema>({
primaryKey: 'id',
primaryType: 'seq',
primaryTitle: '配置编号',
action: true,
actionWidth: '400px',
columns: [
@ -39,14 +40,14 @@ const crudSchemas = reactive<VxeCrudSchema>({
{
title: '存储器',
field: 'storage',
dictType: DICT_TYPE.INFRA_FILE_STORAGE,
dictType: DICT_TYPE.INFRA_FILE_STORAGE, // TODO @星语:不同存储器,不同表单
dictClass: 'number',
isSearch: true
},
{
title: '主配置',
field: 'master',
dictType: DICT_TYPE.INFRA_BOOLEAN_STRING,
dictType: DICT_TYPE.INFRA_BOOLEAN_STRING, // TODO @星语:新增时,不选择主配置
dictClass: 'boolean'
},
{

View File

@ -13,30 +13,35 @@
/>
</template>
<template #actionbtns_default="{ row }">
<!-- 操作编辑 -->
<XTextButton
preIcon="ep:edit"
:title="t('action.edit')"
v-hasPermi="['infra:file-config:update']"
@click="handleUpdate(row.id)"
/>
<!-- 操作详情 -->
<XTextButton
preIcon="ep:view"
:title="t('action.detail')"
v-hasPermi="['infra:file-config:query']"
@click="handleDetail(row.id)"
/>
<!-- 操作主配置 -->
<XTextButton
preIcon="ep:flag"
title="主配置"
v-hasPermi="['infra:file-config:update']"
@click="handleMaster(row)"
/>
<!-- 操作测试 -->
<XTextButton
preIcon="ep:share"
:title="t('action.test')"
v-hasPermi="['infra:file-config:update']"
@click="handleUpdate(row.id)"
/>
<!-- 操作删除 -->
<XTextButton
preIcon="ep:delete"
:title="t('action.del')"

View File

@ -84,6 +84,8 @@ import { useMessage } from '@/hooks/web/useMessage'
import { useVxeGrid } from '@/hooks/web/useVxeGrid'
import { VxeGridInstance } from 'vxe-table'
import { ElUpload, ElImage, UploadInstance, UploadRawFile } from 'element-plus'
// import
// TODO 404
import { allSchemas } from './fileList.data'
import * as FileApi from '@/api/infra/fileList'
import { getAccessToken, getTenantId } from '@/utils/auth'

View File

@ -58,18 +58,21 @@
v-hasPermi="['infra:job:delete']"
@click="handleDelete(row.id)"
/>
<!-- 操作执行 -->
<XTextButton
preIcon="ep:view"
title="执行一次"
v-hasPermi="['infra:job:trigger']"
@click="handleRun(row)"
/>
<!-- 操作日志 -->
<XTextButton
preIcon="ep:view"
title="调度日志"
v-hasPermi="['infra:job:query']"
@click="handleJobLog(row.id)"
/>
<!-- TODO @星语执行一次任务详情调度日志可以收成更多 -->
</template>
</vxe-grid>
</ContentWrap>
@ -97,6 +100,7 @@
<template #monitorTimeout="{ row }">
<span>{{ row.monitorTimeout > 0 ? row.monitorTimeout + ' 毫秒' : '未开启' }}</span>
</template>
<!-- TODO @星语有个后续执行时间字段2022-11-26 23:03:16; 2022-11-26 23:03:17; 2022-11-26 23:03:18; 2022-11-26 23:03:19; 2022-11-26 23:03:20 -->
</Descriptions>
<!-- 操作按钮 -->
<template #footer>

View File

@ -16,6 +16,7 @@ export const rules = reactive({
const crudSchemas = reactive<VxeCrudSchema>({
primaryKey: 'id',
primaryType: 'seq',
primaryTitle: '任务编号',
action: true,
actionWidth: '500px',
columns: [

View File

@ -8,6 +8,7 @@ const { t } = useI18n()
const crudSchemas = reactive<VxeCrudSchema>({
primaryKey: 'id',
primaryType: 'seq',
primaryTitle: '日志编号',
action: true,
columns: [
{