Commit e1a05c137475cf6d746e0152db6b87e645edec44

Authored by YunaiV
1 parent c5f1cad0

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

yudao-ui-admin-vue3/src/views/infra/apiAccessLog/apiAccessLog.data.ts
@@ -6,6 +6,7 @@ import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas' @@ -6,6 +6,7 @@ import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
6 const crudSchemas = reactive<VxeCrudSchema>({ 6 const crudSchemas = reactive<VxeCrudSchema>({
7 primaryKey: 'id', 7 primaryKey: 'id',
8 primaryType: 'seq', 8 primaryType: 'seq',
  9 + primaryTitle: '日志编号',
9 action: true, 10 action: true,
10 actionWidth: '80px', 11 actionWidth: '80px',
11 columns: [ 12 columns: [
yudao-ui-admin-vue3/src/views/infra/apiErrorLog/apiErrorLog.data.ts
@@ -6,6 +6,7 @@ import { VxeCrudSchema, useVxeCrudSchemas } from &#39;@/hooks/web/useVxeCrudSchemas&#39; @@ -6,6 +6,7 @@ import { VxeCrudSchema, useVxeCrudSchemas } from &#39;@/hooks/web/useVxeCrudSchemas&#39;
6 const crudSchemas = reactive<VxeCrudSchema>({ 6 const crudSchemas = reactive<VxeCrudSchema>({
7 primaryKey: 'id', 7 primaryKey: 'id',
8 primaryType: 'seq', 8 primaryType: 'seq',
  9 + primaryTitle: '日志编号',
9 action: true, 10 action: true,
10 actionWidth: '300', 11 actionWidth: '300',
11 columns: [ 12 columns: [
yudao-ui-admin-vue3/src/views/infra/codegen/components/ImportTable.vue
@@ -28,6 +28,7 @@ @@ -28,6 +28,7 @@
28 <XButton preIcon="ep:refresh-right" :title="t('common.reset')" @click="resetQuery()" /> 28 <XButton preIcon="ep:refresh-right" :title="t('common.reset')" @click="resetQuery()" />
29 </el-form-item> 29 </el-form-item>
30 </el-form> 30 </el-form>
  31 + <!-- TODO 星语:【暗黑模式】选中后,样式有点不太好看 -->
31 <vxe-table 32 <vxe-table
32 ref="xTable" 33 ref="xTable"
33 :data="dbTableList" 34 :data="dbTableList"
yudao-ui-admin-vue3/src/views/infra/codegen/index.vue
@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 <!-- 列表 --> 3 <!-- 列表 -->
4 <vxe-grid ref="xGrid" v-bind="gridOptions" class="xtable-scrollbar"> 4 <vxe-grid ref="xGrid" v-bind="gridOptions" class="xtable-scrollbar">
5 <template #toolbar_buttons> 5 <template #toolbar_buttons>
  6 + <!-- 操作:导入 -->
6 <XButton 7 <XButton
7 type="primary" 8 type="primary"
8 preIcon="ep:zoom-in" 9 preIcon="ep:zoom-in"
@@ -12,30 +13,35 @@ @@ -12,30 +13,35 @@
12 /> 13 />
13 </template> 14 </template>
14 <template #actionbtns_default="{ row }"> 15 <template #actionbtns_default="{ row }">
  16 + <!-- 操作:预览 -->
15 <XTextButton 17 <XTextButton
16 preIcon="ep:view" 18 preIcon="ep:view"
17 :title="t('action.preview')" 19 :title="t('action.preview')"
18 v-hasPermi="['infra:codegen:query']" 20 v-hasPermi="['infra:codegen:query']"
19 @click="handlePreview(row.id)" 21 @click="handlePreview(row.id)"
20 /> 22 />
  23 + <!-- 操作:编辑 -->
21 <XTextButton 24 <XTextButton
22 preIcon="ep:edit" 25 preIcon="ep:edit"
23 :title="t('action.edit')" 26 :title="t('action.edit')"
24 v-hasPermi="['infra:codegen:update']" 27 v-hasPermi="['infra:codegen:update']"
25 @click="handleUpdate(row.id)" 28 @click="handleUpdate(row.id)"
26 /> 29 />
  30 + <!-- 操作:删除 -->
27 <XTextButton 31 <XTextButton
28 preIcon="ep:delete" 32 preIcon="ep:delete"
29 :title="t('action.del')" 33 :title="t('action.del')"
30 v-hasPermi="['infra:codegen:delete']" 34 v-hasPermi="['infra:codegen:delete']"
31 @click="handleDelete(row.id)" 35 @click="handleDelete(row.id)"
32 /> 36 />
  37 + <!-- 操作:同步 -->
33 <XTextButton 38 <XTextButton
34 preIcon="ep:refresh" 39 preIcon="ep:refresh"
35 :title="t('action.sync')" 40 :title="t('action.sync')"
36 v-hasPermi="['infra:codegen:update']" 41 v-hasPermi="['infra:codegen:update']"
37 @click="handleSynchDb(row.id)" 42 @click="handleSynchDb(row.id)"
38 /> 43 />
  44 + <!-- 操作:生成 -->
39 <XTextButton 45 <XTextButton
40 preIcon="ep:download" 46 preIcon="ep:download"
41 :title="t('action.generate')" 47 :title="t('action.generate')"
@@ -45,7 +51,9 @@ @@ -45,7 +51,9 @@
45 </template> 51 </template>
46 </vxe-grid> 52 </vxe-grid>
47 </ContentWrap> 53 </ContentWrap>
  54 + <!-- 弹窗:导入表 -->
48 <ImportTable ref="importRef" @ok="handleQuery()" /> 55 <ImportTable ref="importRef" @ok="handleQuery()" />
  56 + <!-- 弹窗:预览代码 -->
49 <Preview ref="previewRef" /> 57 <Preview ref="previewRef" />
50 </template> 58 </template>
51 <script setup lang="ts" name="Codegen"> 59 <script setup lang="ts" name="Codegen">
@@ -78,12 +86,15 @@ const openImportTable = () =&gt; { @@ -78,12 +86,15 @@ const openImportTable = () =&gt; {
78 importRef.value.show() 86 importRef.value.show()
79 } 87 }
80 // 预览操作 88 // 预览操作
  89 +// TODO 星语:点击后报错
81 const previewRef = ref() 90 const previewRef = ref()
82 const handlePreview = (row: CodegenTableVO) => { 91 const handlePreview = (row: CodegenTableVO) => {
83 previewRef.value.show(row) 92 previewRef.value.show(row)
84 } 93 }
85 // 编辑操作 94 // 编辑操作
86 const handleUpdate = (rowId: number) => { 95 const handleUpdate = (rowId: number) => {
  96 + // TODO 星语:修改某个的时候,tab 要展示名字。例如说:"修改[" + tableName + "]生成配置"
  97 + // TODO 星语:【暗黑模式】编辑界面,周边有白色的边框,不太好看
87 push('/codegen/edit?id=' + rowId) 98 push('/codegen/edit?id=' + rowId)
88 } 99 }
89 // 同步操作 100 // 同步操作
yudao-ui-admin-vue3/src/views/infra/config/config.data.ts
@@ -16,7 +16,7 @@ export const rules = reactive({ @@ -16,7 +16,7 @@ export const rules = reactive({
16 // CrudSchema 16 // CrudSchema
17 const crudSchemas = reactive<VxeCrudSchema>({ 17 const crudSchemas = reactive<VxeCrudSchema>({
18 primaryKey: 'id', 18 primaryKey: 'id',
19 - primaryType: 'seq', 19 + primaryType: null,
20 action: true, 20 action: true,
21 columns: [ 21 columns: [
22 { 22 {
@@ -91,4 +91,5 @@ const crudSchemas = reactive&lt;VxeCrudSchema&gt;({ @@ -91,4 +91,5 @@ const crudSchemas = reactive&lt;VxeCrudSchema&gt;({
91 } 91 }
92 ] 92 ]
93 }) 93 })
  94 +// TODO 星语:“创建时间”的筛选,超过 table 的边框
94 export const { allSchemas } = useVxeCrudSchemas(crudSchemas) 95 export const { allSchemas } = useVxeCrudSchemas(crudSchemas)
yudao-ui-admin-vue3/src/views/infra/fileConfig/fileConfig.data.ts
@@ -28,6 +28,7 @@ export const rules = reactive({ @@ -28,6 +28,7 @@ export const rules = reactive({
28 const crudSchemas = reactive<VxeCrudSchema>({ 28 const crudSchemas = reactive<VxeCrudSchema>({
29 primaryKey: 'id', 29 primaryKey: 'id',
30 primaryType: 'seq', 30 primaryType: 'seq',
  31 + primaryTitle: '配置编号',
31 action: true, 32 action: true,
32 actionWidth: '400px', 33 actionWidth: '400px',
33 columns: [ 34 columns: [
@@ -39,14 +40,14 @@ const crudSchemas = reactive&lt;VxeCrudSchema&gt;({ @@ -39,14 +40,14 @@ const crudSchemas = reactive&lt;VxeCrudSchema&gt;({
39 { 40 {
40 title: '存储器', 41 title: '存储器',
41 field: 'storage', 42 field: 'storage',
42 - dictType: DICT_TYPE.INFRA_FILE_STORAGE, 43 + dictType: DICT_TYPE.INFRA_FILE_STORAGE, // TODO @星语:不同存储器,不同表单
43 dictClass: 'number', 44 dictClass: 'number',
44 isSearch: true 45 isSearch: true
45 }, 46 },
46 { 47 {
47 title: '主配置', 48 title: '主配置',
48 field: 'master', 49 field: 'master',
49 - dictType: DICT_TYPE.INFRA_BOOLEAN_STRING, 50 + dictType: DICT_TYPE.INFRA_BOOLEAN_STRING, // TODO @星语:新增时,不选择主配置
50 dictClass: 'boolean' 51 dictClass: 'boolean'
51 }, 52 },
52 { 53 {
yudao-ui-admin-vue3/src/views/infra/fileConfig/index.vue
@@ -13,30 +13,35 @@ @@ -13,30 +13,35 @@
13 /> 13 />
14 </template> 14 </template>
15 <template #actionbtns_default="{ row }"> 15 <template #actionbtns_default="{ row }">
  16 + <!-- 操作:编辑 -->
16 <XTextButton 17 <XTextButton
17 preIcon="ep:edit" 18 preIcon="ep:edit"
18 :title="t('action.edit')" 19 :title="t('action.edit')"
19 v-hasPermi="['infra:file-config:update']" 20 v-hasPermi="['infra:file-config:update']"
20 @click="handleUpdate(row.id)" 21 @click="handleUpdate(row.id)"
21 /> 22 />
  23 + <!-- 操作:详情 -->
22 <XTextButton 24 <XTextButton
23 preIcon="ep:view" 25 preIcon="ep:view"
24 :title="t('action.detail')" 26 :title="t('action.detail')"
25 v-hasPermi="['infra:file-config:query']" 27 v-hasPermi="['infra:file-config:query']"
26 @click="handleDetail(row.id)" 28 @click="handleDetail(row.id)"
27 /> 29 />
  30 + <!-- 操作:主配置 -->
28 <XTextButton 31 <XTextButton
29 preIcon="ep:flag" 32 preIcon="ep:flag"
30 title="主配置" 33 title="主配置"
31 v-hasPermi="['infra:file-config:update']" 34 v-hasPermi="['infra:file-config:update']"
32 @click="handleMaster(row)" 35 @click="handleMaster(row)"
33 /> 36 />
  37 + <!-- 操作:测试 -->
34 <XTextButton 38 <XTextButton
35 preIcon="ep:share" 39 preIcon="ep:share"
36 :title="t('action.test')" 40 :title="t('action.test')"
37 v-hasPermi="['infra:file-config:update']" 41 v-hasPermi="['infra:file-config:update']"
38 @click="handleUpdate(row.id)" 42 @click="handleUpdate(row.id)"
39 /> 43 />
  44 + <!-- 操作:删除 -->
40 <XTextButton 45 <XTextButton
41 preIcon="ep:delete" 46 preIcon="ep:delete"
42 :title="t('action.del')" 47 :title="t('action.del')"
yudao-ui-admin-vue3/src/views/infra/fileList/index.vue
@@ -84,6 +84,8 @@ import { useMessage } from &#39;@/hooks/web/useMessage&#39; @@ -84,6 +84,8 @@ import { useMessage } from &#39;@/hooks/web/useMessage&#39;
84 import { useVxeGrid } from '@/hooks/web/useVxeGrid' 84 import { useVxeGrid } from '@/hooks/web/useVxeGrid'
85 import { VxeGridInstance } from 'vxe-table' 85 import { VxeGridInstance } from 'vxe-table'
86 import { ElUpload, ElImage, UploadInstance, UploadRawFile } from 'element-plus' 86 import { ElUpload, ElImage, UploadInstance, UploadRawFile } from 'element-plus'
  87 +// 业务相关的 import
  88 +// TODO 星语:貌似这个界面打开 404
87 import { allSchemas } from './fileList.data' 89 import { allSchemas } from './fileList.data'
88 import * as FileApi from '@/api/infra/fileList' 90 import * as FileApi from '@/api/infra/fileList'
89 import { getAccessToken, getTenantId } from '@/utils/auth' 91 import { getAccessToken, getTenantId } from '@/utils/auth'
yudao-ui-admin-vue3/src/views/infra/job/index.vue
@@ -58,18 +58,21 @@ @@ -58,18 +58,21 @@
58 v-hasPermi="['infra:job:delete']" 58 v-hasPermi="['infra:job:delete']"
59 @click="handleDelete(row.id)" 59 @click="handleDelete(row.id)"
60 /> 60 />
  61 + <!-- 操作:执行 -->
61 <XTextButton 62 <XTextButton
62 preIcon="ep:view" 63 preIcon="ep:view"
63 title="执行一次" 64 title="执行一次"
64 v-hasPermi="['infra:job:trigger']" 65 v-hasPermi="['infra:job:trigger']"
65 @click="handleRun(row)" 66 @click="handleRun(row)"
66 /> 67 />
  68 + <!-- 操作:日志 -->
67 <XTextButton 69 <XTextButton
68 preIcon="ep:view" 70 preIcon="ep:view"
69 title="调度日志" 71 title="调度日志"
70 v-hasPermi="['infra:job:query']" 72 v-hasPermi="['infra:job:query']"
71 @click="handleJobLog(row.id)" 73 @click="handleJobLog(row.id)"
72 /> 74 />
  75 + <!-- TODO @星语:执行一次、任务详情、调度日志,可以收成【更多】 -->
73 </template> 76 </template>
74 </vxe-grid> 77 </vxe-grid>
75 </ContentWrap> 78 </ContentWrap>
@@ -97,6 +100,7 @@ @@ -97,6 +100,7 @@
97 <template #monitorTimeout="{ row }"> 100 <template #monitorTimeout="{ row }">
98 <span>{{ row.monitorTimeout > 0 ? row.monitorTimeout + ' 毫秒' : '未开启' }}</span> 101 <span>{{ row.monitorTimeout > 0 ? row.monitorTimeout + ' 毫秒' : '未开启' }}</span>
99 </template> 102 </template>
  103 + <!-- 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 -->
100 </Descriptions> 104 </Descriptions>
101 <!-- 操作按钮 --> 105 <!-- 操作按钮 -->
102 <template #footer> 106 <template #footer>
yudao-ui-admin-vue3/src/views/infra/job/job.data.ts
@@ -16,6 +16,7 @@ export const rules = reactive({ @@ -16,6 +16,7 @@ export const rules = reactive({
16 const crudSchemas = reactive<VxeCrudSchema>({ 16 const crudSchemas = reactive<VxeCrudSchema>({
17 primaryKey: 'id', 17 primaryKey: 'id',
18 primaryType: 'seq', 18 primaryType: 'seq',
  19 + primaryTitle: '任务编号',
19 action: true, 20 action: true,
20 actionWidth: '500px', 21 actionWidth: '500px',
21 columns: [ 22 columns: [
yudao-ui-admin-vue3/src/views/infra/job/jobLog.data.ts
@@ -8,6 +8,7 @@ const { t } = useI18n() @@ -8,6 +8,7 @@ const { t } = useI18n()
8 const crudSchemas = reactive<VxeCrudSchema>({ 8 const crudSchemas = reactive<VxeCrudSchema>({
9 primaryKey: 'id', 9 primaryKey: 'id',
10 primaryType: 'seq', 10 primaryType: 'seq',
  11 + primaryTitle: '日志编号',
11 action: true, 12 action: true,
12 columns: [ 13 columns: [
13 { 14 {