mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-22 23:31:52 +08:00
vue3:review 代码生成、文件配置、文件列表、配置管理、访问日志、错误日志、定时任务
This commit is contained in:
parent
c5f1cad033
commit
e1a05c1374
@ -6,6 +6,7 @@ import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
|
|||||||
const crudSchemas = reactive<VxeCrudSchema>({
|
const crudSchemas = reactive<VxeCrudSchema>({
|
||||||
primaryKey: 'id',
|
primaryKey: 'id',
|
||||||
primaryType: 'seq',
|
primaryType: 'seq',
|
||||||
|
primaryTitle: '日志编号',
|
||||||
action: true,
|
action: true,
|
||||||
actionWidth: '80px',
|
actionWidth: '80px',
|
||||||
columns: [
|
columns: [
|
||||||
|
@ -6,6 +6,7 @@ import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
|
|||||||
const crudSchemas = reactive<VxeCrudSchema>({
|
const crudSchemas = reactive<VxeCrudSchema>({
|
||||||
primaryKey: 'id',
|
primaryKey: 'id',
|
||||||
primaryType: 'seq',
|
primaryType: 'seq',
|
||||||
|
primaryTitle: '日志编号',
|
||||||
action: true,
|
action: true,
|
||||||
actionWidth: '300',
|
actionWidth: '300',
|
||||||
columns: [
|
columns: [
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
<XButton preIcon="ep:refresh-right" :title="t('common.reset')" @click="resetQuery()" />
|
<XButton preIcon="ep:refresh-right" :title="t('common.reset')" @click="resetQuery()" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
<!-- TODO 星语:【暗黑模式】选中后,样式有点不太好看 -->
|
||||||
<vxe-table
|
<vxe-table
|
||||||
ref="xTable"
|
ref="xTable"
|
||||||
:data="dbTableList"
|
:data="dbTableList"
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<vxe-grid ref="xGrid" v-bind="gridOptions" class="xtable-scrollbar">
|
<vxe-grid ref="xGrid" v-bind="gridOptions" class="xtable-scrollbar">
|
||||||
<template #toolbar_buttons>
|
<template #toolbar_buttons>
|
||||||
|
<!-- 操作:导入 -->
|
||||||
<XButton
|
<XButton
|
||||||
type="primary"
|
type="primary"
|
||||||
preIcon="ep:zoom-in"
|
preIcon="ep:zoom-in"
|
||||||
@ -12,30 +13,35 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #actionbtns_default="{ row }">
|
<template #actionbtns_default="{ row }">
|
||||||
|
<!-- 操作:预览 -->
|
||||||
<XTextButton
|
<XTextButton
|
||||||
preIcon="ep:view"
|
preIcon="ep:view"
|
||||||
:title="t('action.preview')"
|
:title="t('action.preview')"
|
||||||
v-hasPermi="['infra:codegen:query']"
|
v-hasPermi="['infra:codegen:query']"
|
||||||
@click="handlePreview(row.id)"
|
@click="handlePreview(row.id)"
|
||||||
/>
|
/>
|
||||||
|
<!-- 操作:编辑 -->
|
||||||
<XTextButton
|
<XTextButton
|
||||||
preIcon="ep:edit"
|
preIcon="ep:edit"
|
||||||
:title="t('action.edit')"
|
:title="t('action.edit')"
|
||||||
v-hasPermi="['infra:codegen:update']"
|
v-hasPermi="['infra:codegen:update']"
|
||||||
@click="handleUpdate(row.id)"
|
@click="handleUpdate(row.id)"
|
||||||
/>
|
/>
|
||||||
|
<!-- 操作:删除 -->
|
||||||
<XTextButton
|
<XTextButton
|
||||||
preIcon="ep:delete"
|
preIcon="ep:delete"
|
||||||
:title="t('action.del')"
|
:title="t('action.del')"
|
||||||
v-hasPermi="['infra:codegen:delete']"
|
v-hasPermi="['infra:codegen:delete']"
|
||||||
@click="handleDelete(row.id)"
|
@click="handleDelete(row.id)"
|
||||||
/>
|
/>
|
||||||
|
<!-- 操作:同步 -->
|
||||||
<XTextButton
|
<XTextButton
|
||||||
preIcon="ep:refresh"
|
preIcon="ep:refresh"
|
||||||
:title="t('action.sync')"
|
:title="t('action.sync')"
|
||||||
v-hasPermi="['infra:codegen:update']"
|
v-hasPermi="['infra:codegen:update']"
|
||||||
@click="handleSynchDb(row.id)"
|
@click="handleSynchDb(row.id)"
|
||||||
/>
|
/>
|
||||||
|
<!-- 操作:生成 -->
|
||||||
<XTextButton
|
<XTextButton
|
||||||
preIcon="ep:download"
|
preIcon="ep:download"
|
||||||
:title="t('action.generate')"
|
:title="t('action.generate')"
|
||||||
@ -45,7 +51,9 @@
|
|||||||
</template>
|
</template>
|
||||||
</vxe-grid>
|
</vxe-grid>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
|
<!-- 弹窗:导入表 -->
|
||||||
<ImportTable ref="importRef" @ok="handleQuery()" />
|
<ImportTable ref="importRef" @ok="handleQuery()" />
|
||||||
|
<!-- 弹窗:预览代码 -->
|
||||||
<Preview ref="previewRef" />
|
<Preview ref="previewRef" />
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts" name="Codegen">
|
<script setup lang="ts" name="Codegen">
|
||||||
@ -78,12 +86,15 @@ const openImportTable = () => {
|
|||||||
importRef.value.show()
|
importRef.value.show()
|
||||||
}
|
}
|
||||||
// 预览操作
|
// 预览操作
|
||||||
|
// TODO 星语:点击后报错
|
||||||
const previewRef = ref()
|
const previewRef = ref()
|
||||||
const handlePreview = (row: CodegenTableVO) => {
|
const handlePreview = (row: CodegenTableVO) => {
|
||||||
previewRef.value.show(row)
|
previewRef.value.show(row)
|
||||||
}
|
}
|
||||||
// 编辑操作
|
// 编辑操作
|
||||||
const handleUpdate = (rowId: number) => {
|
const handleUpdate = (rowId: number) => {
|
||||||
|
// TODO 星语:修改某个的时候,tab 要展示名字。例如说:"修改[" + tableName + "]生成配置"
|
||||||
|
// TODO 星语:【暗黑模式】编辑界面,周边有白色的边框,不太好看
|
||||||
push('/codegen/edit?id=' + rowId)
|
push('/codegen/edit?id=' + rowId)
|
||||||
}
|
}
|
||||||
// 同步操作
|
// 同步操作
|
||||||
|
@ -16,7 +16,7 @@ export const rules = reactive({
|
|||||||
// CrudSchema
|
// CrudSchema
|
||||||
const crudSchemas = reactive<VxeCrudSchema>({
|
const crudSchemas = reactive<VxeCrudSchema>({
|
||||||
primaryKey: 'id',
|
primaryKey: 'id',
|
||||||
primaryType: 'seq',
|
primaryType: null,
|
||||||
action: true,
|
action: true,
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
@ -91,4 +91,5 @@ const crudSchemas = reactive<VxeCrudSchema>({
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
// TODO 星语:“创建时间”的筛选,超过 table 的边框
|
||||||
export const { allSchemas } = useVxeCrudSchemas(crudSchemas)
|
export const { allSchemas } = useVxeCrudSchemas(crudSchemas)
|
||||||
|
@ -28,6 +28,7 @@ export const rules = reactive({
|
|||||||
const crudSchemas = reactive<VxeCrudSchema>({
|
const crudSchemas = reactive<VxeCrudSchema>({
|
||||||
primaryKey: 'id',
|
primaryKey: 'id',
|
||||||
primaryType: 'seq',
|
primaryType: 'seq',
|
||||||
|
primaryTitle: '配置编号',
|
||||||
action: true,
|
action: true,
|
||||||
actionWidth: '400px',
|
actionWidth: '400px',
|
||||||
columns: [
|
columns: [
|
||||||
@ -39,14 +40,14 @@ const crudSchemas = reactive<VxeCrudSchema>({
|
|||||||
{
|
{
|
||||||
title: '存储器',
|
title: '存储器',
|
||||||
field: 'storage',
|
field: 'storage',
|
||||||
dictType: DICT_TYPE.INFRA_FILE_STORAGE,
|
dictType: DICT_TYPE.INFRA_FILE_STORAGE, // TODO @星语:不同存储器,不同表单
|
||||||
dictClass: 'number',
|
dictClass: 'number',
|
||||||
isSearch: true
|
isSearch: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '主配置',
|
title: '主配置',
|
||||||
field: 'master',
|
field: 'master',
|
||||||
dictType: DICT_TYPE.INFRA_BOOLEAN_STRING,
|
dictType: DICT_TYPE.INFRA_BOOLEAN_STRING, // TODO @星语:新增时,不选择主配置
|
||||||
dictClass: 'boolean'
|
dictClass: 'boolean'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -13,30 +13,35 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #actionbtns_default="{ row }">
|
<template #actionbtns_default="{ row }">
|
||||||
|
<!-- 操作:编辑 -->
|
||||||
<XTextButton
|
<XTextButton
|
||||||
preIcon="ep:edit"
|
preIcon="ep:edit"
|
||||||
:title="t('action.edit')"
|
:title="t('action.edit')"
|
||||||
v-hasPermi="['infra:file-config:update']"
|
v-hasPermi="['infra:file-config:update']"
|
||||||
@click="handleUpdate(row.id)"
|
@click="handleUpdate(row.id)"
|
||||||
/>
|
/>
|
||||||
|
<!-- 操作:详情 -->
|
||||||
<XTextButton
|
<XTextButton
|
||||||
preIcon="ep:view"
|
preIcon="ep:view"
|
||||||
:title="t('action.detail')"
|
:title="t('action.detail')"
|
||||||
v-hasPermi="['infra:file-config:query']"
|
v-hasPermi="['infra:file-config:query']"
|
||||||
@click="handleDetail(row.id)"
|
@click="handleDetail(row.id)"
|
||||||
/>
|
/>
|
||||||
|
<!-- 操作:主配置 -->
|
||||||
<XTextButton
|
<XTextButton
|
||||||
preIcon="ep:flag"
|
preIcon="ep:flag"
|
||||||
title="主配置"
|
title="主配置"
|
||||||
v-hasPermi="['infra:file-config:update']"
|
v-hasPermi="['infra:file-config:update']"
|
||||||
@click="handleMaster(row)"
|
@click="handleMaster(row)"
|
||||||
/>
|
/>
|
||||||
|
<!-- 操作:测试 -->
|
||||||
<XTextButton
|
<XTextButton
|
||||||
preIcon="ep:share"
|
preIcon="ep:share"
|
||||||
:title="t('action.test')"
|
:title="t('action.test')"
|
||||||
v-hasPermi="['infra:file-config:update']"
|
v-hasPermi="['infra:file-config:update']"
|
||||||
@click="handleUpdate(row.id)"
|
@click="handleUpdate(row.id)"
|
||||||
/>
|
/>
|
||||||
|
<!-- 操作:删除 -->
|
||||||
<XTextButton
|
<XTextButton
|
||||||
preIcon="ep:delete"
|
preIcon="ep:delete"
|
||||||
:title="t('action.del')"
|
:title="t('action.del')"
|
||||||
|
@ -84,6 +84,8 @@ import { useMessage } from '@/hooks/web/useMessage'
|
|||||||
import { useVxeGrid } from '@/hooks/web/useVxeGrid'
|
import { useVxeGrid } from '@/hooks/web/useVxeGrid'
|
||||||
import { VxeGridInstance } from 'vxe-table'
|
import { VxeGridInstance } from 'vxe-table'
|
||||||
import { ElUpload, ElImage, UploadInstance, UploadRawFile } from 'element-plus'
|
import { ElUpload, ElImage, UploadInstance, UploadRawFile } from 'element-plus'
|
||||||
|
// 业务相关的 import
|
||||||
|
// TODO 星语:貌似这个界面打开 404
|
||||||
import { allSchemas } from './fileList.data'
|
import { allSchemas } from './fileList.data'
|
||||||
import * as FileApi from '@/api/infra/fileList'
|
import * as FileApi from '@/api/infra/fileList'
|
||||||
import { getAccessToken, getTenantId } from '@/utils/auth'
|
import { getAccessToken, getTenantId } from '@/utils/auth'
|
||||||
|
@ -58,18 +58,21 @@
|
|||||||
v-hasPermi="['infra:job:delete']"
|
v-hasPermi="['infra:job:delete']"
|
||||||
@click="handleDelete(row.id)"
|
@click="handleDelete(row.id)"
|
||||||
/>
|
/>
|
||||||
|
<!-- 操作:执行 -->
|
||||||
<XTextButton
|
<XTextButton
|
||||||
preIcon="ep:view"
|
preIcon="ep:view"
|
||||||
title="执行一次"
|
title="执行一次"
|
||||||
v-hasPermi="['infra:job:trigger']"
|
v-hasPermi="['infra:job:trigger']"
|
||||||
@click="handleRun(row)"
|
@click="handleRun(row)"
|
||||||
/>
|
/>
|
||||||
|
<!-- 操作:日志 -->
|
||||||
<XTextButton
|
<XTextButton
|
||||||
preIcon="ep:view"
|
preIcon="ep:view"
|
||||||
title="调度日志"
|
title="调度日志"
|
||||||
v-hasPermi="['infra:job:query']"
|
v-hasPermi="['infra:job:query']"
|
||||||
@click="handleJobLog(row.id)"
|
@click="handleJobLog(row.id)"
|
||||||
/>
|
/>
|
||||||
|
<!-- TODO @星语:执行一次、任务详情、调度日志,可以收成【更多】 -->
|
||||||
</template>
|
</template>
|
||||||
</vxe-grid>
|
</vxe-grid>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
@ -97,6 +100,7 @@
|
|||||||
<template #monitorTimeout="{ row }">
|
<template #monitorTimeout="{ row }">
|
||||||
<span>{{ row.monitorTimeout > 0 ? row.monitorTimeout + ' 毫秒' : '未开启' }}</span>
|
<span>{{ row.monitorTimeout > 0 ? row.monitorTimeout + ' 毫秒' : '未开启' }}</span>
|
||||||
</template>
|
</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>
|
</Descriptions>
|
||||||
<!-- 操作按钮 -->
|
<!-- 操作按钮 -->
|
||||||
<template #footer>
|
<template #footer>
|
||||||
|
@ -16,6 +16,7 @@ export const rules = reactive({
|
|||||||
const crudSchemas = reactive<VxeCrudSchema>({
|
const crudSchemas = reactive<VxeCrudSchema>({
|
||||||
primaryKey: 'id',
|
primaryKey: 'id',
|
||||||
primaryType: 'seq',
|
primaryType: 'seq',
|
||||||
|
primaryTitle: '任务编号',
|
||||||
action: true,
|
action: true,
|
||||||
actionWidth: '500px',
|
actionWidth: '500px',
|
||||||
columns: [
|
columns: [
|
||||||
|
@ -8,6 +8,7 @@ const { t } = useI18n()
|
|||||||
const crudSchemas = reactive<VxeCrudSchema>({
|
const crudSchemas = reactive<VxeCrudSchema>({
|
||||||
primaryKey: 'id',
|
primaryKey: 'id',
|
||||||
primaryType: 'seq',
|
primaryType: 'seq',
|
||||||
|
primaryTitle: '日志编号',
|
||||||
action: true,
|
action: true,
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user