Commit afeca650aac8dd2e8200fb8ef69cd152967bb456
Committed by
Gitee
!235 vue3:新增部分BPM页面 重构代码生成
Merge pull request !235 from xingyu/master
Showing
28 changed files
with
1155 additions
and
643 deletions
yudao-ui-admin-vue3/src/api/bpm/model/index.ts
| ... | ... | @@ -2,20 +2,20 @@ import { useAxios } from '@/hooks/web/useAxios' |
| 2 | 2 | import { ModelVO } from './types' |
| 3 | 3 | const request = useAxios() |
| 4 | 4 | |
| 5 | -export const getModelPage = async (params) => { | |
| 5 | +export const getModelPageApi = async (params) => { | |
| 6 | 6 | return await request.get({ url: '/bpm/model/page', params }) |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -export const getModel = async (id: number) => { | |
| 9 | +export const getModelApi = async (id: number) => { | |
| 10 | 10 | return await request.get({ url: '/bpm/model/get?id=' + id }) |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | -export const updateModel = async (data: ModelVO) => { | |
| 13 | +export const updateModelApi = async (data: ModelVO) => { | |
| 14 | 14 | return await request.put({ url: '/bpm/model/update', data: data }) |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | // 任务状态修改 |
| 18 | -export const updateModelState = async (id: number, state: string) => { | |
| 18 | +export const updateModelStateApi = async (id: number, state: number) => { | |
| 19 | 19 | const data = { |
| 20 | 20 | id: id, |
| 21 | 21 | state: state |
| ... | ... | @@ -23,14 +23,14 @@ export const updateModelState = async (id: number, state: string) => { |
| 23 | 23 | return await request.put({ url: '/bpm/model/update-state', data: data }) |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | -export const createModel = async (data: ModelVO) => { | |
| 26 | +export const createModelApi = async (data: ModelVO) => { | |
| 27 | 27 | return await request.post({ url: '/bpm/model/create', data: data }) |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | -export const deleteModel = async (id: number) => { | |
| 30 | +export const deleteModelApi = async (id: number) => { | |
| 31 | 31 | return await request.delete({ url: '/bpm/model/delete?id=' + id }) |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | -export const deployModel = async (id: number) => { | |
| 34 | +export const deployModelApi = async (id: number) => { | |
| 35 | 35 | return await request.post({ url: '/bpm/model/deploy?id=' + id }) |
| 36 | 36 | } | ... | ... |
yudao-ui-admin-vue3/src/api/bpm/model/types.ts
| 1 | +export type ProcessDefinitionVO = { | |
| 2 | + id: string | |
| 3 | + version: number | |
| 4 | + deploymentTIme: string | |
| 5 | + suspensionState: number | |
| 6 | +} | |
| 7 | + | |
| 1 | 8 | export type ModelVO = { |
| 2 | 9 | id: number |
| 3 | 10 | formName: string |
| ... | ... | @@ -9,6 +16,7 @@ export type ModelVO = { |
| 9 | 16 | formId: number |
| 10 | 17 | formCustomCreatePath: string |
| 11 | 18 | formCustomViewPath: string |
| 19 | + processDefinition: ProcessDefinitionVO | |
| 12 | 20 | status: number |
| 13 | 21 | remark: string |
| 14 | 22 | createTime: string | ... | ... |
yudao-ui-admin-vue3/src/api/bpm/processInstance/index.ts
| ... | ... | @@ -2,15 +2,15 @@ import { useAxios } from '@/hooks/web/useAxios' |
| 2 | 2 | import { ProcessInstanceVO } from './types' |
| 3 | 3 | const request = useAxios() |
| 4 | 4 | |
| 5 | -export const getMyProcessInstancePage = async (params) => { | |
| 5 | +export const getMyProcessInstancePageApi = async (params) => { | |
| 6 | 6 | return await request.get({ url: '/bpm/process-instance/my-page', params }) |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -export const createProcessInstance = async (data: ProcessInstanceVO) => { | |
| 9 | +export const createProcessInstanceApi = async (data: ProcessInstanceVO) => { | |
| 10 | 10 | return await request.post({ url: '/bpm/process-instance/create', data: data }) |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | -export const cancelProcessInstance = async (id: number, reason: string) => { | |
| 13 | +export const cancelProcessInstanceApi = async (id: number, reason: string) => { | |
| 14 | 14 | const data = { |
| 15 | 15 | id: id, |
| 16 | 16 | reason: reason |
| ... | ... | @@ -18,6 +18,6 @@ export const cancelProcessInstance = async (id: number, reason: string) => { |
| 18 | 18 | return await request.delete({ url: '/bpm/process-instance/cancel', data: data }) |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | -export const getProcessInstance = async (id: number) => { | |
| 21 | +export const getProcessInstanceApi = async (id: number) => { | |
| 22 | 22 | return await request.get({ url: '/bpm/process-instance/get?id=' + id }) |
| 23 | 23 | } | ... | ... |
yudao-ui-admin-vue3/src/api/infra/codegen/index.ts
| 1 | 1 | import { useAxios } from '@/hooks/web/useAxios' |
| 2 | -import type { CodegenTableVO } from './types' | |
| 2 | +import type { CodegenUpdateReqVO, CodegenCreateListReqVO } from './types' | |
| 3 | 3 | |
| 4 | 4 | const request = useAxios() |
| 5 | 5 | |
| ... | ... | @@ -14,12 +14,12 @@ export const getCodegenTableApi = (id: number) => { |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | // 新增代码生成表定义 |
| 17 | -export const createCodegenTableApi = (data: CodegenTableVO) => { | |
| 17 | +export const createCodegenTableApi = (data: CodegenCreateListReqVO) => { | |
| 18 | 18 | return request.post({ url: '/infra/codegen/create', data }) |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | // 修改代码生成表定义 |
| 22 | -export const updateCodegenTableApi = (data: CodegenTableVO) => { | |
| 22 | +export const updateCodegenTableApi = (data: CodegenUpdateReqVO) => { | |
| 23 | 23 | return request.put({ url: '/infra/codegen/update', data }) |
| 24 | 24 | } |
| 25 | 25 | ... | ... |
yudao-ui-admin-vue3/src/api/infra/codegen/types.ts
| 1 | 1 | export type CodegenTableVO = { |
| 2 | - id: number | |
| 2 | + tableId: number | |
| 3 | + isParentMenuIdValid: boolean | |
| 3 | 4 | dataSourceConfigId: number |
| 4 | 5 | scene: number |
| 5 | 6 | tableName: string |
| ... | ... | @@ -49,3 +50,11 @@ export type CodegenPreviewVO = { |
| 49 | 50 | filePath: string |
| 50 | 51 | code: string |
| 51 | 52 | } |
| 53 | +export type CodegenUpdateReqVO = { | |
| 54 | + table: CodegenTableVO | |
| 55 | + columns: CodegenColumnVO[] | |
| 56 | +} | |
| 57 | +export type CodegenCreateListReqVO = { | |
| 58 | + dataSourceConfigId: number | |
| 59 | + tableNames: string[] | |
| 60 | +} | ... | ... |
yudao-ui-admin-vue3/src/components/Crontab/index.ts
0 → 100644
yudao-ui-admin-vue3/src/components/Crontab/day.vue renamed to yudao-ui-admin-vue3/src/components/Crontab/src/components/day.vue
| 1 | -<template> | |
| 2 | - <el-form size="small"> | |
| 3 | - <el-form-item> | |
| 4 | - <el-radio v-model="radioValue" :label="1"> 日,允许的通配符[, - * ? / L W] </el-radio> | |
| 5 | - </el-form-item> | |
| 6 | - | |
| 7 | - <el-form-item> | |
| 8 | - <el-radio v-model="radioValue" :label="2"> 不指定 </el-radio> | |
| 9 | - </el-form-item> | |
| 10 | - | |
| 11 | - <el-form-item> | |
| 12 | - <el-radio v-model="radioValue" :label="3"> | |
| 13 | - 周期从 | |
| 14 | - <el-input-number v-model="cycle01" :min="1" :max="30" /> - | |
| 15 | - <el-input-number v-model="cycle02" :min="cycle01 ? cycle01 + 1 : 2" :max="31" /> 日 | |
| 16 | - </el-radio> | |
| 17 | - </el-form-item> | |
| 18 | - | |
| 19 | - <el-form-item> | |
| 20 | - <el-radio v-model="radioValue" :label="4"> | |
| 21 | - 从 | |
| 22 | - <el-input-number v-model="average01" :min="1" :max="30" /> 号开始,每 | |
| 23 | - <el-input-number v-model="average02" :min="1" :max="31 - average01 || 1" /> 日执行一次 | |
| 24 | - </el-radio> | |
| 25 | - </el-form-item> | |
| 26 | - | |
| 27 | - <el-form-item> | |
| 28 | - <el-radio v-model="radioValue" :label="5"> | |
| 29 | - 每月 | |
| 30 | - <el-input-number v-model="workday" :min="1" :max="31" /> 号最近的那个工作日 | |
| 31 | - </el-radio> | |
| 32 | - </el-form-item> | |
| 33 | - | |
| 34 | - <el-form-item> | |
| 35 | - <el-radio v-model="radioValue" :label="6"> 本月最后一天 </el-radio> | |
| 36 | - </el-form-item> | |
| 37 | - | |
| 38 | - <el-form-item> | |
| 39 | - <el-radio v-model="radioValue" :label="7"> | |
| 40 | - 指定 | |
| 41 | - <el-select | |
| 42 | - clearable | |
| 43 | - v-model="checkboxList" | |
| 44 | - placeholder="可多选" | |
| 45 | - multiple | |
| 46 | - style="width: 100%" | |
| 47 | - > | |
| 48 | - <el-option v-for="item in 31" :key="item" :value="item">{{ item }}</el-option> | |
| 49 | - </el-select> | |
| 50 | - </el-radio> | |
| 51 | - </el-form-item> | |
| 52 | - </el-form> | |
| 53 | -</template> | |
| 54 | - | |
| 55 | -<script lang="ts" setup> | |
| 1 | +<script setup lang="ts"> | |
| 56 | 2 | import { computed, ref, watch } from 'vue' |
| 57 | - | |
| 3 | +import { ElForm, ElFormItem, ElRadio, ElSelect, ElOption, ElInputNumber } from 'element-plus' | |
| 58 | 4 | const props = defineProps({ |
| 59 | 5 | check: { |
| 60 | 6 | type: Function, |
| ... | ... | @@ -172,3 +118,56 @@ watch(checkboxString, () => { |
| 172 | 118 | } |
| 173 | 119 | }) |
| 174 | 120 | </script> |
| 121 | +<template> | |
| 122 | + <el-form> | |
| 123 | + <el-form-item> | |
| 124 | + <el-radio v-model="radioValue" :label="1"> 日,允许的通配符[, - * ? / L W] </el-radio> | |
| 125 | + </el-form-item> | |
| 126 | + | |
| 127 | + <el-form-item> | |
| 128 | + <el-radio v-model="radioValue" :label="2"> 不指定 </el-radio> | |
| 129 | + </el-form-item> | |
| 130 | + | |
| 131 | + <el-form-item> | |
| 132 | + <el-radio v-model="radioValue" :label="3"> | |
| 133 | + 周期从 | |
| 134 | + <el-input-number v-model="cycle01" :min="1" :max="30" /> - | |
| 135 | + <el-input-number v-model="cycle02" :min="cycle01 ? cycle01 + 1 : 2" :max="31" /> 日 | |
| 136 | + </el-radio> | |
| 137 | + </el-form-item> | |
| 138 | + | |
| 139 | + <el-form-item> | |
| 140 | + <el-radio v-model="radioValue" :label="4"> | |
| 141 | + 从 | |
| 142 | + <el-input-number v-model="average01" :min="1" :max="30" /> 号开始,每 | |
| 143 | + <el-input-number v-model="average02" :min="1" :max="31 - average01 || 1" /> 日执行一次 | |
| 144 | + </el-radio> | |
| 145 | + </el-form-item> | |
| 146 | + | |
| 147 | + <el-form-item> | |
| 148 | + <el-radio v-model="radioValue" :label="5"> | |
| 149 | + 每月 | |
| 150 | + <el-input-number v-model="workday" :min="1" :max="31" /> 号最近的那个工作日 | |
| 151 | + </el-radio> | |
| 152 | + </el-form-item> | |
| 153 | + | |
| 154 | + <el-form-item> | |
| 155 | + <el-radio v-model="radioValue" :label="6"> 本月最后一天 </el-radio> | |
| 156 | + </el-form-item> | |
| 157 | + | |
| 158 | + <el-form-item> | |
| 159 | + <el-radio v-model="radioValue" :label="7"> | |
| 160 | + 指定 | |
| 161 | + <el-select | |
| 162 | + clearable | |
| 163 | + v-model="checkboxList" | |
| 164 | + placeholder="可多选" | |
| 165 | + multiple | |
| 166 | + style="width: 100%" | |
| 167 | + > | |
| 168 | + <el-option v-for="item in 31" :key="item" :value="item">{{ item }}</el-option> | |
| 169 | + </el-select> | |
| 170 | + </el-radio> | |
| 171 | + </el-form-item> | |
| 172 | + </el-form> | |
| 173 | +</template> | ... | ... |
yudao-ui-admin-vue3/src/components/Crontab/hour.vue renamed to yudao-ui-admin-vue3/src/components/Crontab/src/components/hour.vue
| 1 | -<template> | |
| 2 | - <el-form size="small"> | |
| 3 | - <el-form-item> | |
| 4 | - <el-radio v-model="radioValue" :label="1"> 小时,允许的通配符[, - * /] </el-radio> | |
| 5 | - </el-form-item> | |
| 6 | - | |
| 7 | - <el-form-item> | |
| 8 | - <el-radio v-model="radioValue" :label="2"> | |
| 9 | - 周期从 | |
| 10 | - <el-input-number v-model="cycle01" :min="0" :max="22" /> - | |
| 11 | - <el-input-number v-model="cycle02" :min="cycle01 ? cycle01 + 1 : 1" :max="23" /> 小时 | |
| 12 | - </el-radio> | |
| 13 | - </el-form-item> | |
| 14 | - | |
| 15 | - <el-form-item> | |
| 16 | - <el-radio v-model="radioValue" :label="3"> | |
| 17 | - 从 | |
| 18 | - <el-input-number v-model="average01" :min="0" :max="22" /> 小时开始,每 | |
| 19 | - <el-input-number v-model="average02" :min="1" :max="23 - average01 || 0" /> 小时执行一次 | |
| 20 | - </el-radio> | |
| 21 | - </el-form-item> | |
| 22 | - | |
| 23 | - <el-form-item> | |
| 24 | - <el-radio v-model="radioValue" :label="4"> | |
| 25 | - 指定 | |
| 26 | - <el-select | |
| 27 | - clearable | |
| 28 | - v-model="checkboxList" | |
| 29 | - placeholder="可多选" | |
| 30 | - multiple | |
| 31 | - style="width: 100%" | |
| 32 | - > | |
| 33 | - <el-option v-for="item in 24" :key="item" :value="item - 1">{{ item - 1 }}</el-option> | |
| 34 | - </el-select> | |
| 35 | - </el-radio> | |
| 36 | - </el-form-item> | |
| 37 | - </el-form> | |
| 38 | -</template> | |
| 39 | - | |
| 40 | -<script lang="ts" setup> | |
| 1 | +<script setup lang="ts"> | |
| 41 | 2 | import { computed, ref, watch } from 'vue' |
| 42 | - | |
| 3 | +import { ElForm, ElFormItem, ElRadio, ElSelect, ElOption, ElInputNumber } from 'element-plus' | |
| 43 | 4 | const props = defineProps({ |
| 44 | 5 | check: { |
| 45 | 6 | type: Function, |
| ... | ... | @@ -119,3 +80,41 @@ watch(radioValue, () => { |
| 119 | 80 | } |
| 120 | 81 | }) |
| 121 | 82 | </script> |
| 83 | +<template> | |
| 84 | + <el-form> | |
| 85 | + <el-form-item> | |
| 86 | + <el-radio v-model="radioValue" :label="1"> 小时,允许的通配符[, - * /] </el-radio> | |
| 87 | + </el-form-item> | |
| 88 | + | |
| 89 | + <el-form-item> | |
| 90 | + <el-radio v-model="radioValue" :label="2"> | |
| 91 | + 周期从 | |
| 92 | + <el-input-number v-model="cycle01" :min="0" :max="22" /> - | |
| 93 | + <el-input-number v-model="cycle02" :min="cycle01 ? cycle01 + 1 : 1" :max="23" /> 小时 | |
| 94 | + </el-radio> | |
| 95 | + </el-form-item> | |
| 96 | + | |
| 97 | + <el-form-item> | |
| 98 | + <el-radio v-model="radioValue" :label="3"> | |
| 99 | + 从 | |
| 100 | + <el-input-number v-model="average01" :min="0" :max="22" /> 小时开始,每 | |
| 101 | + <el-input-number v-model="average02" :min="1" :max="23 - average01 || 0" /> 小时执行一次 | |
| 102 | + </el-radio> | |
| 103 | + </el-form-item> | |
| 104 | + | |
| 105 | + <el-form-item> | |
| 106 | + <el-radio v-model="radioValue" :label="4"> | |
| 107 | + 指定 | |
| 108 | + <el-select | |
| 109 | + clearable | |
| 110 | + v-model="checkboxList" | |
| 111 | + placeholder="可多选" | |
| 112 | + multiple | |
| 113 | + style="width: 100%" | |
| 114 | + > | |
| 115 | + <el-option v-for="item in 24" :key="item" :value="item - 1">{{ item - 1 }}</el-option> | |
| 116 | + </el-select> | |
| 117 | + </el-radio> | |
| 118 | + </el-form-item> | |
| 119 | + </el-form> | |
| 120 | +</template> | ... | ... |
yudao-ui-admin-vue3/src/components/Crontab/src/components/index.ts
0 → 100644
| 1 | +import CrontabSecond from './second.vue' | |
| 2 | +import CrontabMin from './min.vue' | |
| 3 | +import CrontabHour from './hour.vue' | |
| 4 | +import CrontabDay from './day.vue' | |
| 5 | +import CrontabMonth from './month.vue' | |
| 6 | +import CrontabWeek from './week.vue' | |
| 7 | +import CrontabYear from './year.vue' | |
| 8 | +import CrontabResult from './result.vue' | |
| 9 | + | |
| 10 | +export { | |
| 11 | + CrontabSecond, | |
| 12 | + CrontabMin, | |
| 13 | + CrontabHour, | |
| 14 | + CrontabDay, | |
| 15 | + CrontabMonth, | |
| 16 | + CrontabWeek, | |
| 17 | + CrontabYear, | |
| 18 | + CrontabResult | |
| 19 | +} | ... | ... |
yudao-ui-admin-vue3/src/components/Crontab/min.vue renamed to yudao-ui-admin-vue3/src/components/Crontab/src/components/min.vue
| 1 | -<template> | |
| 2 | - <el-form size="small"> | |
| 3 | - <el-form-item> | |
| 4 | - <el-radio v-model="radioValue" :label="1"> 分钟,允许的通配符[, - * /] </el-radio> | |
| 5 | - </el-form-item> | |
| 6 | - | |
| 7 | - <el-form-item> | |
| 8 | - <el-radio v-model="radioValue" :label="2"> | |
| 9 | - 周期从 | |
| 10 | - <el-input-number v-model="cycle01" :min="0" :max="58" /> - | |
| 11 | - <el-input-number v-model="cycle02" :min="cycle01 ? cycle01 + 1 : 1" :max="59" /> 分钟 | |
| 12 | - </el-radio> | |
| 13 | - </el-form-item> | |
| 14 | - | |
| 15 | - <el-form-item> | |
| 16 | - <el-radio v-model="radioValue" :label="3"> | |
| 17 | - 从 | |
| 18 | - <el-input-number v-model="average01" :min="0" :max="58" /> 分钟开始,每 | |
| 19 | - <el-input-number v-model="average02" :min="1" :max="59 - average01 || 0" /> 分钟执行一次 | |
| 20 | - </el-radio> | |
| 21 | - </el-form-item> | |
| 22 | - | |
| 23 | - <el-form-item> | |
| 24 | - <el-radio v-model="radioValue" :label="4"> | |
| 25 | - 指定 | |
| 26 | - <el-select | |
| 27 | - clearable | |
| 28 | - v-model="checkboxList" | |
| 29 | - placeholder="可多选" | |
| 30 | - multiple | |
| 31 | - style="width: 100%" | |
| 32 | - > | |
| 33 | - <el-option v-for="item in 60" :key="item" :value="item - 1">{{ item - 1 }}</el-option> | |
| 34 | - </el-select> | |
| 35 | - </el-radio> | |
| 36 | - </el-form-item> | |
| 37 | - </el-form> | |
| 38 | -</template> | |
| 39 | - | |
| 40 | -<script lang="ts" setup> | |
| 1 | +<script setup lang="ts"> | |
| 41 | 2 | import { computed, ref, watch } from 'vue' |
| 42 | - | |
| 3 | +import { ElForm, ElFormItem, ElRadio, ElSelect, ElOption, ElInputNumber } from 'element-plus' | |
| 43 | 4 | const props = defineProps({ |
| 44 | 5 | check: { |
| 45 | 6 | type: Function, |
| ... | ... | @@ -119,3 +80,41 @@ watch(radioValue, () => { |
| 119 | 80 | } |
| 120 | 81 | }) |
| 121 | 82 | </script> |
| 83 | +<template> | |
| 84 | + <el-form> | |
| 85 | + <el-form-item> | |
| 86 | + <el-radio v-model="radioValue" :label="1"> 分钟,允许的通配符[, - * /] </el-radio> | |
| 87 | + </el-form-item> | |
| 88 | + | |
| 89 | + <el-form-item> | |
| 90 | + <el-radio v-model="radioValue" :label="2"> | |
| 91 | + 周期从 | |
| 92 | + <el-input-number v-model="cycle01" :min="0" :max="58" /> - | |
| 93 | + <el-input-number v-model="cycle02" :min="cycle01 ? cycle01 + 1 : 1" :max="59" /> 分钟 | |
| 94 | + </el-radio> | |
| 95 | + </el-form-item> | |
| 96 | + | |
| 97 | + <el-form-item> | |
| 98 | + <el-radio v-model="radioValue" :label="3"> | |
| 99 | + 从 | |
| 100 | + <el-input-number v-model="average01" :min="0" :max="58" /> 分钟开始,每 | |
| 101 | + <el-input-number v-model="average02" :min="1" :max="59 - average01 || 0" /> 分钟执行一次 | |
| 102 | + </el-radio> | |
| 103 | + </el-form-item> | |
| 104 | + | |
| 105 | + <el-form-item> | |
| 106 | + <el-radio v-model="radioValue" :label="4"> | |
| 107 | + 指定 | |
| 108 | + <el-select | |
| 109 | + clearable | |
| 110 | + v-model="checkboxList" | |
| 111 | + placeholder="可多选" | |
| 112 | + multiple | |
| 113 | + style="width: 100%" | |
| 114 | + > | |
| 115 | + <el-option v-for="item in 60" :key="item" :value="item - 1">{{ item - 1 }}</el-option> | |
| 116 | + </el-select> | |
| 117 | + </el-radio> | |
| 118 | + </el-form-item> | |
| 119 | + </el-form> | |
| 120 | +</template> | ... | ... |
yudao-ui-admin-vue3/src/components/Crontab/month.vue renamed to yudao-ui-admin-vue3/src/components/Crontab/src/components/month.vue
| 1 | -<template> | |
| 2 | - <el-form size="small"> | |
| 3 | - <el-form-item> | |
| 4 | - <el-radio v-model="radioValue" :label="1"> 月,允许的通配符[, - * /] </el-radio> | |
| 5 | - </el-form-item> | |
| 6 | - | |
| 7 | - <el-form-item> | |
| 8 | - <el-radio v-model="radioValue" :label="2"> | |
| 9 | - 周期从 | |
| 10 | - <el-input-number v-model="cycle01" :min="1" :max="11" /> - | |
| 11 | - <el-input-number v-model="cycle02" :min="cycle01 ? cycle01 + 1 : 2" :max="12" /> 月 | |
| 12 | - </el-radio> | |
| 13 | - </el-form-item> | |
| 14 | - | |
| 15 | - <el-form-item> | |
| 16 | - <el-radio v-model="radioValue" :label="3"> | |
| 17 | - 从 | |
| 18 | - <el-input-number v-model="average01" :min="1" :max="11" /> 月开始,每 | |
| 19 | - <el-input-number v-model="average02" :min="1" :max="12 - average01 || 0" /> 月月执行一次 | |
| 20 | - </el-radio> | |
| 21 | - </el-form-item> | |
| 22 | - | |
| 23 | - <el-form-item> | |
| 24 | - <el-radio v-model="radioValue" :label="4"> | |
| 25 | - 指定 | |
| 26 | - <el-select | |
| 27 | - clearable | |
| 28 | - v-model="checkboxList" | |
| 29 | - placeholder="可多选" | |
| 30 | - multiple | |
| 31 | - style="width: 100%" | |
| 32 | - > | |
| 33 | - <el-option v-for="item in 12" :key="item" :value="item">{{ item }}</el-option> | |
| 34 | - </el-select> | |
| 35 | - </el-radio> | |
| 36 | - </el-form-item> | |
| 37 | - </el-form> | |
| 38 | -</template> | |
| 39 | - | |
| 40 | -<script lang="ts" setup> | |
| 1 | +<script setup lang="ts"> | |
| 41 | 2 | import { computed, ref, watch } from 'vue' |
| 42 | - | |
| 3 | +import { ElForm, ElFormItem, ElRadio, ElSelect, ElOption, ElInputNumber } from 'element-plus' | |
| 43 | 4 | const props = defineProps({ |
| 44 | 5 | check: { |
| 45 | 6 | type: Function, |
| ... | ... | @@ -119,3 +80,41 @@ watch(radioValue, () => { |
| 119 | 80 | } |
| 120 | 81 | }) |
| 121 | 82 | </script> |
| 83 | +<template> | |
| 84 | + <el-form> | |
| 85 | + <el-form-item> | |
| 86 | + <el-radio v-model="radioValue" :label="1"> 月,允许的通配符[, - * /] </el-radio> | |
| 87 | + </el-form-item> | |
| 88 | + | |
| 89 | + <el-form-item> | |
| 90 | + <el-radio v-model="radioValue" :label="2"> | |
| 91 | + 周期从 | |
| 92 | + <el-input-number v-model="cycle01" :min="1" :max="11" /> - | |
| 93 | + <el-input-number v-model="cycle02" :min="cycle01 ? cycle01 + 1 : 2" :max="12" /> 月 | |
| 94 | + </el-radio> | |
| 95 | + </el-form-item> | |
| 96 | + | |
| 97 | + <el-form-item> | |
| 98 | + <el-radio v-model="radioValue" :label="3"> | |
| 99 | + 从 | |
| 100 | + <el-input-number v-model="average01" :min="1" :max="11" /> 月开始,每 | |
| 101 | + <el-input-number v-model="average02" :min="1" :max="12 - average01 || 0" /> 月月执行一次 | |
| 102 | + </el-radio> | |
| 103 | + </el-form-item> | |
| 104 | + | |
| 105 | + <el-form-item> | |
| 106 | + <el-radio v-model="radioValue" :label="4"> | |
| 107 | + 指定 | |
| 108 | + <el-select | |
| 109 | + clearable | |
| 110 | + v-model="checkboxList" | |
| 111 | + placeholder="可多选" | |
| 112 | + multiple | |
| 113 | + style="width: 100%" | |
| 114 | + > | |
| 115 | + <el-option v-for="item in 12" :key="item" :value="item">{{ item }}</el-option> | |
| 116 | + </el-select> | |
| 117 | + </el-radio> | |
| 118 | + </el-form-item> | |
| 119 | + </el-form> | |
| 120 | +</template> | ... | ... |
yudao-ui-admin-vue3/src/components/Crontab/result.vue renamed to yudao-ui-admin-vue3/src/components/Crontab/src/components/result.vue
| 1 | -<template> | |
| 2 | - <div class="popup-result"> | |
| 3 | - <p class="title">最近5次运行时间</p> | |
| 4 | - <ul class="popup-result-scroll"> | |
| 5 | - <template v-if="isShow"> | |
| 6 | - <li v-for="item in resultList" :key="item">{{ item }}</li> | |
| 7 | - </template> | |
| 8 | - <li v-else>计算结果中...</li> | |
| 9 | - </ul> | |
| 10 | - </div> | |
| 11 | -</template> | |
| 12 | - | |
| 13 | -<script lang="ts" setup> | |
| 1 | +<script setup lang="ts"> | |
| 14 | 2 | import { onMounted, ref, watch } from 'vue' |
| 15 | 3 | |
| 16 | 4 | const props = defineProps({ |
| ... | ... | @@ -572,3 +560,14 @@ function checkDate(value) { |
| 572 | 560 | return value === format |
| 573 | 561 | } |
| 574 | 562 | </script> |
| 563 | +<template> | |
| 564 | + <div class="popup-result"> | |
| 565 | + <p class="title">最近5次运行时间</p> | |
| 566 | + <ul class="popup-result-scroll"> | |
| 567 | + <template v-if="isShow"> | |
| 568 | + <li v-for="item in resultList" :key="item">{{ item }}</li> | |
| 569 | + </template> | |
| 570 | + <li v-else>计算结果中...</li> | |
| 571 | + </ul> | |
| 572 | + </div> | |
| 573 | +</template> | ... | ... |
yudao-ui-admin-vue3/src/components/Crontab/second.vue renamed to yudao-ui-admin-vue3/src/components/Crontab/src/components/second.vue
| 1 | -<template> | |
| 2 | - <el-form size="small"> | |
| 3 | - <el-form-item> | |
| 4 | - <el-radio v-model="radioValue" :label="1"> 秒,允许的通配符[, - * /] </el-radio> | |
| 5 | - </el-form-item> | |
| 6 | - | |
| 7 | - <el-form-item> | |
| 8 | - <el-radio v-model="radioValue" :label="2"> | |
| 9 | - 周期从 | |
| 10 | - <el-input-number v-model="cycle01" :min="0" :max="58" /> - | |
| 11 | - <el-input-number v-model="cycle02" :min="cycle01 ? cycle01 + 1 : 1" :max="59" /> 秒 | |
| 12 | - </el-radio> | |
| 13 | - </el-form-item> | |
| 14 | - | |
| 15 | - <el-form-item> | |
| 16 | - <el-radio v-model="radioValue" :label="3"> | |
| 17 | - 从 | |
| 18 | - <el-input-number v-model="average01" :min="0" :max="58" /> 秒开始,每 | |
| 19 | - <el-input-number v-model="average02" :min="1" :max="59 - average01 || 0" /> 秒执行一次 | |
| 20 | - </el-radio> | |
| 21 | - </el-form-item> | |
| 22 | - | |
| 23 | - <el-form-item> | |
| 24 | - <el-radio v-model="radioValue" :label="4"> | |
| 25 | - 指定 | |
| 26 | - <el-select | |
| 27 | - clearable | |
| 28 | - v-model="checkboxList" | |
| 29 | - placeholder="可多选" | |
| 30 | - multiple | |
| 31 | - style="width: 100%" | |
| 32 | - > | |
| 33 | - <el-option v-for="item in 60" :key="item" :value="item - 1">{{ item - 1 }}</el-option> | |
| 34 | - </el-select> | |
| 35 | - </el-radio> | |
| 36 | - </el-form-item> | |
| 37 | - </el-form> | |
| 38 | -</template> | |
| 39 | - | |
| 40 | -<script lang="ts" setup> | |
| 1 | +<script setup lang="ts"> | |
| 41 | 2 | import { computed, ref, watch } from 'vue' |
| 42 | - | |
| 3 | +import { ElForm, ElFormItem, ElRadio, ElSelect, ElOption, ElInputNumber } from 'element-plus' | |
| 43 | 4 | const props = defineProps({ |
| 44 | 5 | check: { |
| 45 | 6 | type: Function, |
| ... | ... | @@ -119,3 +80,41 @@ watch(radioValue, () => { |
| 119 | 80 | } |
| 120 | 81 | }) |
| 121 | 82 | </script> |
| 83 | +<template> | |
| 84 | + <el-form> | |
| 85 | + <el-form-item> | |
| 86 | + <el-radio v-model="radioValue" :label="1"> 秒,允许的通配符[, - * /] </el-radio> | |
| 87 | + </el-form-item> | |
| 88 | + | |
| 89 | + <el-form-item> | |
| 90 | + <el-radio v-model="radioValue" :label="2"> | |
| 91 | + 周期从 | |
| 92 | + <el-input-number v-model="cycle01" :min="0" :max="58" /> - | |
| 93 | + <el-input-number v-model="cycle02" :min="cycle01 ? cycle01 + 1 : 1" :max="59" /> 秒 | |
| 94 | + </el-radio> | |
| 95 | + </el-form-item> | |
| 96 | + | |
| 97 | + <el-form-item> | |
| 98 | + <el-radio v-model="radioValue" :label="3"> | |
| 99 | + 从 | |
| 100 | + <el-input-number v-model="average01" :min="0" :max="58" /> 秒开始,每 | |
| 101 | + <el-input-number v-model="average02" :min="1" :max="59 - average01 || 0" /> 秒执行一次 | |
| 102 | + </el-radio> | |
| 103 | + </el-form-item> | |
| 104 | + | |
| 105 | + <el-form-item> | |
| 106 | + <el-radio v-model="radioValue" :label="4"> | |
| 107 | + 指定 | |
| 108 | + <el-select | |
| 109 | + clearable | |
| 110 | + v-model="checkboxList" | |
| 111 | + placeholder="可多选" | |
| 112 | + multiple | |
| 113 | + style="width: 100%" | |
| 114 | + > | |
| 115 | + <el-option v-for="item in 60" :key="item" :value="item - 1">{{ item - 1 }}</el-option> | |
| 116 | + </el-select> | |
| 117 | + </el-radio> | |
| 118 | + </el-form-item> | |
| 119 | + </el-form> | |
| 120 | +</template> | ... | ... |
yudao-ui-admin-vue3/src/components/Crontab/week.vue renamed to yudao-ui-admin-vue3/src/components/Crontab/src/components/week.vue
| 1 | -<template> | |
| 2 | - <el-form size="small"> | |
| 3 | - <el-form-item> | |
| 4 | - <el-radio v-model="radioValue" :label="1"> 周,允许的通配符[, - * ? / L #] </el-radio> | |
| 5 | - </el-form-item> | |
| 6 | - | |
| 7 | - <el-form-item> | |
| 8 | - <el-radio v-model="radioValue" :label="2"> 不指定 </el-radio> | |
| 9 | - </el-form-item> | |
| 10 | - | |
| 11 | - <el-form-item> | |
| 12 | - <el-radio v-model="radioValue" :label="3"> | |
| 13 | - 周期从星期 | |
| 14 | - <el-select clearable v-model="cycle01"> | |
| 15 | - <el-option | |
| 16 | - v-for="(item, index) of weekList" | |
| 17 | - :key="index" | |
| 18 | - :label="item.value" | |
| 19 | - :value="item.key" | |
| 20 | - :disabled="item.key === 1" | |
| 21 | - >{{ item.value }}</el-option | |
| 22 | - > | |
| 23 | - </el-select> | |
| 24 | - - | |
| 25 | - <el-select clearable v-model="cycle02"> | |
| 26 | - <el-option | |
| 27 | - v-for="(item, index) of weekList" | |
| 28 | - :key="index" | |
| 29 | - :label="item.value" | |
| 30 | - :value="item.key" | |
| 31 | - :disabled="item.key < cycle01 && item.key !== 1" | |
| 32 | - >{{ item.value }}</el-option | |
| 33 | - > | |
| 34 | - </el-select> | |
| 35 | - </el-radio> | |
| 36 | - </el-form-item> | |
| 37 | - | |
| 38 | - <el-form-item> | |
| 39 | - <el-radio v-model="radioValue" :label="4"> | |
| 40 | - 第 | |
| 41 | - <el-input-number v-model="average01" :min="1" :max="4" /> 周的星期 | |
| 42 | - <el-select clearable v-model="average02"> | |
| 43 | - <el-option | |
| 44 | - v-for="(item, index) of weekList" | |
| 45 | - :key="index" | |
| 46 | - :label="item.value" | |
| 47 | - :value="item.key" | |
| 48 | - >{{ item.value }}</el-option | |
| 49 | - > | |
| 50 | - </el-select> | |
| 51 | - </el-radio> | |
| 52 | - </el-form-item> | |
| 53 | - | |
| 54 | - <el-form-item> | |
| 55 | - <el-radio v-model="radioValue" :label="5"> | |
| 56 | - 本月最后一个星期 | |
| 57 | - <el-select clearable v-model="weekday"> | |
| 58 | - <el-option | |
| 59 | - v-for="(item, index) of weekList" | |
| 60 | - :key="index" | |
| 61 | - :label="item.value" | |
| 62 | - :value="item.key" | |
| 63 | - >{{ item.value }}</el-option | |
| 64 | - > | |
| 65 | - </el-select> | |
| 66 | - </el-radio> | |
| 67 | - </el-form-item> | |
| 68 | - | |
| 69 | - <el-form-item> | |
| 70 | - <el-radio v-model="radioValue" :label="6"> | |
| 71 | - 指定 | |
| 72 | - <el-select | |
| 73 | - clearable | |
| 74 | - v-model="checkboxList" | |
| 75 | - placeholder="可多选" | |
| 76 | - multiple | |
| 77 | - style="width: 100%" | |
| 78 | - > | |
| 79 | - <el-option | |
| 80 | - v-for="(item, index) of weekList" | |
| 81 | - :key="index" | |
| 82 | - :label="item.value" | |
| 83 | - :value="String(item.key)" | |
| 84 | - >{{ item.value }}</el-option | |
| 85 | - > | |
| 86 | - </el-select> | |
| 87 | - </el-radio> | |
| 88 | - </el-form-item> | |
| 89 | - </el-form> | |
| 90 | -</template> | |
| 91 | - | |
| 92 | -<script lang="ts" setup> | |
| 1 | +<script setup lang="ts"> | |
| 93 | 2 | import { computed, ref, watch } from 'vue' |
| 94 | - | |
| 3 | +import { ElForm, ElFormItem, ElRadio, ElSelect, ElOption, ElInputNumber } from 'element-plus' | |
| 95 | 4 | const props = defineProps({ |
| 96 | 5 | check: { |
| 97 | 6 | type: Function, |
| ... | ... | @@ -222,3 +131,93 @@ watch(radioValue, () => { |
| 222 | 131 | } |
| 223 | 132 | }) |
| 224 | 133 | </script> |
| 134 | +<template> | |
| 135 | + <el-form> | |
| 136 | + <el-form-item> | |
| 137 | + <el-radio v-model="radioValue" :label="1"> 周,允许的通配符[, - * ? / L #] </el-radio> | |
| 138 | + </el-form-item> | |
| 139 | + | |
| 140 | + <el-form-item> | |
| 141 | + <el-radio v-model="radioValue" :label="2"> 不指定 </el-radio> | |
| 142 | + </el-form-item> | |
| 143 | + | |
| 144 | + <el-form-item> | |
| 145 | + <el-radio v-model="radioValue" :label="3"> | |
| 146 | + 周期从星期 | |
| 147 | + <el-select clearable v-model="cycle01"> | |
| 148 | + <el-option | |
| 149 | + v-for="(item, index) of weekList" | |
| 150 | + :key="index" | |
| 151 | + :label="item.value" | |
| 152 | + :value="item.key" | |
| 153 | + :disabled="item.key === 1" | |
| 154 | + >{{ item.value }}</el-option | |
| 155 | + > | |
| 156 | + </el-select> | |
| 157 | + - | |
| 158 | + <el-select clearable v-model="cycle02"> | |
| 159 | + <el-option | |
| 160 | + v-for="(item, index) of weekList" | |
| 161 | + :key="index" | |
| 162 | + :label="item.value" | |
| 163 | + :value="item.key" | |
| 164 | + :disabled="item.key < cycle01 && item.key !== 1" | |
| 165 | + >{{ item.value }}</el-option | |
| 166 | + > | |
| 167 | + </el-select> | |
| 168 | + </el-radio> | |
| 169 | + </el-form-item> | |
| 170 | + | |
| 171 | + <el-form-item> | |
| 172 | + <el-radio v-model="radioValue" :label="4"> | |
| 173 | + 第 | |
| 174 | + <el-input-number v-model="average01" :min="1" :max="4" /> 周的星期 | |
| 175 | + <el-select clearable v-model="average02"> | |
| 176 | + <el-option | |
| 177 | + v-for="(item, index) of weekList" | |
| 178 | + :key="index" | |
| 179 | + :label="item.value" | |
| 180 | + :value="item.key" | |
| 181 | + >{{ item.value }}</el-option | |
| 182 | + > | |
| 183 | + </el-select> | |
| 184 | + </el-radio> | |
| 185 | + </el-form-item> | |
| 186 | + | |
| 187 | + <el-form-item> | |
| 188 | + <el-radio v-model="radioValue" :label="5"> | |
| 189 | + 本月最后一个星期 | |
| 190 | + <el-select clearable v-model="weekday"> | |
| 191 | + <el-option | |
| 192 | + v-for="(item, index) of weekList" | |
| 193 | + :key="index" | |
| 194 | + :label="item.value" | |
| 195 | + :value="item.key" | |
| 196 | + >{{ item.value }}</el-option | |
| 197 | + > | |
| 198 | + </el-select> | |
| 199 | + </el-radio> | |
| 200 | + </el-form-item> | |
| 201 | + | |
| 202 | + <el-form-item> | |
| 203 | + <el-radio v-model="radioValue" :label="6"> | |
| 204 | + 指定 | |
| 205 | + <el-select | |
| 206 | + clearable | |
| 207 | + v-model="checkboxList" | |
| 208 | + placeholder="可多选" | |
| 209 | + multiple | |
| 210 | + style="width: 100%" | |
| 211 | + > | |
| 212 | + <el-option | |
| 213 | + v-for="(item, index) of weekList" | |
| 214 | + :key="index" | |
| 215 | + :label="item.value" | |
| 216 | + :value="String(item.key)" | |
| 217 | + >{{ item.value }}</el-option | |
| 218 | + > | |
| 219 | + </el-select> | |
| 220 | + </el-radio> | |
| 221 | + </el-form-item> | |
| 222 | + </el-form> | |
| 223 | +</template> | ... | ... |
yudao-ui-admin-vue3/src/components/Crontab/year.vue renamed to yudao-ui-admin-vue3/src/components/Crontab/src/components/year.vue
| 1 | -<template> | |
| 2 | - <el-form size="small"> | |
| 3 | - <el-form-item> | |
| 4 | - <el-radio label="1" v-model="radioValue"> 不填,允许的通配符[, - * /] </el-radio> | |
| 5 | - </el-form-item> | |
| 6 | - | |
| 7 | - <el-form-item> | |
| 8 | - <el-radio label="2" v-model="radioValue"> 每年 </el-radio> | |
| 9 | - </el-form-item> | |
| 10 | - | |
| 11 | - <el-form-item> | |
| 12 | - <el-radio label="3" v-model="radioValue"> | |
| 13 | - 周期从 | |
| 14 | - <el-input-number v-model="cycle01" :min="fullYear" :max="2098" /> - | |
| 15 | - <el-input-number | |
| 16 | - v-model="cycle02" | |
| 17 | - :min="cycle01 ? cycle01 + 1 : fullYear + 1" | |
| 18 | - :max="2099" | |
| 19 | - /> | |
| 20 | - </el-radio> | |
| 21 | - </el-form-item> | |
| 22 | - | |
| 23 | - <el-form-item> | |
| 24 | - <el-radio label="4" v-model="radioValue"> | |
| 25 | - 从 | |
| 26 | - <el-input-number v-model="average01" :min="fullYear" :max="2098" /> 年开始,每 | |
| 27 | - <el-input-number v-model="average02" :min="1" :max="2099 - average01 || fullYear" /> | |
| 28 | - 年执行一次 | |
| 29 | - </el-radio> | |
| 30 | - </el-form-item> | |
| 31 | - | |
| 32 | - <el-form-item> | |
| 33 | - <el-radio label="5" v-model="radioValue"> | |
| 34 | - 指定 | |
| 35 | - <el-select clearable v-model="checkboxList" placeholder="可多选" multiple> | |
| 36 | - <el-option | |
| 37 | - v-for="item in 9" | |
| 38 | - :key="item" | |
| 39 | - :value="item - 1 + fullYear" | |
| 40 | - :label="item - 1 + fullYear" | |
| 41 | - /> | |
| 42 | - </el-select> | |
| 43 | - </el-radio> | |
| 44 | - </el-form-item> | |
| 45 | - </el-form> | |
| 46 | -</template> | |
| 47 | - | |
| 48 | -<script lang="ts" setup> | |
| 1 | +<script setup lang="ts"> | |
| 49 | 2 | import { computed, onMounted, ref, watch } from 'vue' |
| 50 | - | |
| 3 | +import { ElForm, ElFormItem, ElRadio, ElSelect, ElOption, ElInputNumber } from 'element-plus' | |
| 51 | 4 | const props = defineProps({ |
| 52 | 5 | check: { |
| 53 | 6 | type: Function, |
| ... | ... | @@ -138,3 +91,49 @@ onMounted(() => { |
| 138 | 91 | average01.value = fullYear.value |
| 139 | 92 | }) |
| 140 | 93 | </script> |
| 94 | +<template> | |
| 95 | + <el-form> | |
| 96 | + <el-form-item> | |
| 97 | + <el-radio label="1" v-model="radioValue"> 不填,允许的通配符[, - * /] </el-radio> | |
| 98 | + </el-form-item> | |
| 99 | + | |
| 100 | + <el-form-item> | |
| 101 | + <el-radio label="2" v-model="radioValue"> 每年 </el-radio> | |
| 102 | + </el-form-item> | |
| 103 | + | |
| 104 | + <el-form-item> | |
| 105 | + <el-radio label="3" v-model="radioValue"> | |
| 106 | + 周期从 | |
| 107 | + <el-input-number v-model="cycle01" :min="fullYear" :max="2098" /> - | |
| 108 | + <el-input-number | |
| 109 | + v-model="cycle02" | |
| 110 | + :min="cycle01 ? cycle01 + 1 : fullYear + 1" | |
| 111 | + :max="2099" | |
| 112 | + /> | |
| 113 | + </el-radio> | |
| 114 | + </el-form-item> | |
| 115 | + | |
| 116 | + <el-form-item> | |
| 117 | + <el-radio label="4" v-model="radioValue"> | |
| 118 | + 从 | |
| 119 | + <el-input-number v-model="average01" :min="fullYear" :max="2098" /> 年开始,每 | |
| 120 | + <el-input-number v-model="average02" :min="1" :max="2099 - average01 || fullYear" /> | |
| 121 | + 年执行一次 | |
| 122 | + </el-radio> | |
| 123 | + </el-form-item> | |
| 124 | + | |
| 125 | + <el-form-item> | |
| 126 | + <el-radio label="5" v-model="radioValue"> | |
| 127 | + 指定 | |
| 128 | + <el-select clearable v-model="checkboxList" placeholder="可多选" multiple> | |
| 129 | + <el-option | |
| 130 | + v-for="item in 9" | |
| 131 | + :key="item" | |
| 132 | + :value="item - 1 + fullYear" | |
| 133 | + :label="item - 1 + fullYear" | |
| 134 | + /> | |
| 135 | + </el-select> | |
| 136 | + </el-radio> | |
| 137 | + </el-form-item> | |
| 138 | + </el-form> | |
| 139 | +</template> | ... | ... |
yudao-ui-admin-vue3/src/components/Crontab/index.vue renamed to yudao-ui-admin-vue3/src/components/Crontab/src/index.vue
| 1 | -<template> | |
| 2 | - <div> | |
| 3 | - <el-tabs type="border-card"> | |
| 4 | - <el-tab-pane label="秒" v-if="shouldHide('second')"> | |
| 5 | - <CrontabSecond | |
| 6 | - @update="updateCrontabValue" | |
| 7 | - :check="checkNumber" | |
| 8 | - :cron="crontabValueObj" | |
| 9 | - ref="cronsecond" | |
| 10 | - /> | |
| 11 | - </el-tab-pane> | |
| 12 | - | |
| 13 | - <el-tab-pane label="分钟" v-if="shouldHide('min')"> | |
| 14 | - <CrontabMin | |
| 15 | - @update="updateCrontabValue" | |
| 16 | - :check="checkNumber" | |
| 17 | - :cron="crontabValueObj" | |
| 18 | - ref="cronmin" | |
| 19 | - /> | |
| 20 | - </el-tab-pane> | |
| 21 | - | |
| 22 | - <el-tab-pane label="小时" v-if="shouldHide('hour')"> | |
| 23 | - <CrontabHour | |
| 24 | - @update="updateCrontabValue" | |
| 25 | - :check="checkNumber" | |
| 26 | - :cron="crontabValueObj" | |
| 27 | - ref="cronhour" | |
| 28 | - /> | |
| 29 | - </el-tab-pane> | |
| 30 | - | |
| 31 | - <el-tab-pane label="日" v-if="shouldHide('day')"> | |
| 32 | - <CrontabDay | |
| 33 | - @update="updateCrontabValue" | |
| 34 | - :check="checkNumber" | |
| 35 | - :cron="crontabValueObj" | |
| 36 | - ref="cronday" | |
| 37 | - /> | |
| 38 | - </el-tab-pane> | |
| 39 | - | |
| 40 | - <el-tab-pane label="月" v-if="shouldHide('month')"> | |
| 41 | - <CrontabMonth | |
| 42 | - @update="updateCrontabValue" | |
| 43 | - :check="checkNumber" | |
| 44 | - :cron="crontabValueObj" | |
| 45 | - ref="cronmonth" | |
| 46 | - /> | |
| 47 | - </el-tab-pane> | |
| 48 | - | |
| 49 | - <el-tab-pane label="周" v-if="shouldHide('week')"> | |
| 50 | - <CrontabWeek | |
| 51 | - @update="updateCrontabValue" | |
| 52 | - :check="checkNumber" | |
| 53 | - :cron="crontabValueObj" | |
| 54 | - ref="cronweek" | |
| 55 | - /> | |
| 56 | - </el-tab-pane> | |
| 57 | - | |
| 58 | - <el-tab-pane label="年" v-if="shouldHide('year')"> | |
| 59 | - <CrontabYear | |
| 60 | - @update="updateCrontabValue" | |
| 61 | - :check="checkNumber" | |
| 62 | - :cron="crontabValueObj" | |
| 63 | - ref="cronyear" | |
| 64 | - /> | |
| 65 | - </el-tab-pane> | |
| 66 | - </el-tabs> | |
| 67 | - | |
| 68 | - <div class="popup-main"> | |
| 69 | - <div class="popup-result"> | |
| 70 | - <p class="title">时间表达式</p> | |
| 71 | - <table> | |
| 72 | - <thead> | |
| 73 | - <th v-for="item of tabTitles" width="40" :key="item">{{ item }}</th> | |
| 74 | - <th>Cron 表达式</th> | |
| 75 | - </thead> | |
| 76 | - <tbody> | |
| 77 | - <td> | |
| 78 | - <span>{{ crontabValueObj.second }}</span> | |
| 79 | - </td> | |
| 80 | - <td> | |
| 81 | - <span>{{ crontabValueObj.min }}</span> | |
| 82 | - </td> | |
| 83 | - <td> | |
| 84 | - <span>{{ crontabValueObj.hour }}</span> | |
| 85 | - </td> | |
| 86 | - <td> | |
| 87 | - <span>{{ crontabValueObj.day }}</span> | |
| 88 | - </td> | |
| 89 | - <td> | |
| 90 | - <span>{{ crontabValueObj.month }}</span> | |
| 91 | - </td> | |
| 92 | - <td> | |
| 93 | - <span>{{ crontabValueObj.week }}</span> | |
| 94 | - </td> | |
| 95 | - <td> | |
| 96 | - <span>{{ crontabValueObj.year }}</span> | |
| 97 | - </td> | |
| 98 | - <td> | |
| 99 | - <span>{{ crontabValueString }}</span> | |
| 100 | - </td> | |
| 101 | - </tbody> | |
| 102 | - </table> | |
| 103 | - </div> | |
| 104 | - <CrontabResult :ex="crontabValueString" /> | |
| 105 | - | |
| 106 | - <div class="pop_btn"> | |
| 107 | - <el-button size="small" type="primary" @click="submitFill">确定</el-button> | |
| 108 | - <el-button size="small" type="warning" @click="clearCron">重置</el-button> | |
| 109 | - <el-button size="small" @click="hidePopup">取消</el-button> | |
| 110 | - </div> | |
| 111 | - </div> | |
| 112 | - </div> | |
| 113 | -</template> | |
| 114 | - | |
| 115 | -<script lang="ts" setup> | |
| 116 | -import CrontabSecond from './second.vue' | |
| 117 | -import CrontabMin from './min.vue' | |
| 118 | -import CrontabHour from './hour.vue' | |
| 119 | -import CrontabDay from './day.vue' | |
| 120 | -import CrontabMonth from './month.vue' | |
| 121 | -import CrontabWeek from './week.vue' | |
| 122 | -import CrontabYear from './year.vue' | |
| 123 | -import CrontabResult from './result.vue' | |
| 1 | +<script setup lang="ts"> | |
| 2 | +import { | |
| 3 | + CrontabSecond, | |
| 4 | + CrontabMin, | |
| 5 | + CrontabHour, | |
| 6 | + CrontabDay, | |
| 7 | + CrontabMonth, | |
| 8 | + CrontabWeek, | |
| 9 | + CrontabYear, | |
| 10 | + CrontabResult | |
| 11 | +} from './components' | |
| 12 | +import { ElTabs, ElTabPane } from 'element-plus' | |
| 124 | 13 | import { computed, defineEmits, defineProps, onMounted, Ref, ref, watch } from 'vue' |
| 125 | 14 | |
| 126 | 15 | const cronsecond = ref(null) |
| ... | ... | @@ -208,7 +97,7 @@ function updateCrontabValue(name, value, from) { |
| 208 | 97 | changeRadio(name, value) |
| 209 | 98 | } |
| 210 | 99 | } |
| 211 | - | |
| 100 | +// 赋值到组件 | |
| 212 | 101 | function changeRadio(name, value) { |
| 213 | 102 | let arr = ['second', 'min', 'hour', 'month'], |
| 214 | 103 | refName = 'cron' + name, |
| ... | ... | @@ -373,7 +262,119 @@ function clearCron() { |
| 373 | 262 | |
| 374 | 263 | watch(() => props.expression, resolveExp) |
| 375 | 264 | </script> |
| 265 | +<template> | |
| 266 | + <div> | |
| 267 | + <el-tabs type="border-card"> | |
| 268 | + <el-tab-pane label="秒" v-if="shouldHide('second')"> | |
| 269 | + <CrontabSecond | |
| 270 | + @update="updateCrontabValue" | |
| 271 | + :check="checkNumber" | |
| 272 | + :cron="crontabValueObj" | |
| 273 | + ref="cronsecond" | |
| 274 | + /> | |
| 275 | + </el-tab-pane> | |
| 276 | + | |
| 277 | + <el-tab-pane label="分钟" v-if="shouldHide('min')"> | |
| 278 | + <CrontabMin | |
| 279 | + @update="updateCrontabValue" | |
| 280 | + :check="checkNumber" | |
| 281 | + :cron="crontabValueObj" | |
| 282 | + ref="cronmin" | |
| 283 | + /> | |
| 284 | + </el-tab-pane> | |
| 285 | + | |
| 286 | + <el-tab-pane label="小时" v-if="shouldHide('hour')"> | |
| 287 | + <CrontabHour | |
| 288 | + @update="updateCrontabValue" | |
| 289 | + :check="checkNumber" | |
| 290 | + :cron="crontabValueObj" | |
| 291 | + ref="cronhour" | |
| 292 | + /> | |
| 293 | + </el-tab-pane> | |
| 294 | + | |
| 295 | + <el-tab-pane label="日" v-if="shouldHide('day')"> | |
| 296 | + <CrontabDay | |
| 297 | + @update="updateCrontabValue" | |
| 298 | + :check="checkNumber" | |
| 299 | + :cron="crontabValueObj" | |
| 300 | + ref="cronday" | |
| 301 | + /> | |
| 302 | + </el-tab-pane> | |
| 303 | + | |
| 304 | + <el-tab-pane label="月" v-if="shouldHide('month')"> | |
| 305 | + <CrontabMonth | |
| 306 | + @update="updateCrontabValue" | |
| 307 | + :check="checkNumber" | |
| 308 | + :cron="crontabValueObj" | |
| 309 | + ref="cronmonth" | |
| 310 | + /> | |
| 311 | + </el-tab-pane> | |
| 312 | + | |
| 313 | + <el-tab-pane label="周" v-if="shouldHide('week')"> | |
| 314 | + <CrontabWeek | |
| 315 | + @update="updateCrontabValue" | |
| 316 | + :check="checkNumber" | |
| 317 | + :cron="crontabValueObj" | |
| 318 | + ref="cronweek" | |
| 319 | + /> | |
| 320 | + </el-tab-pane> | |
| 321 | + | |
| 322 | + <el-tab-pane label="年" v-if="shouldHide('year')"> | |
| 323 | + <CrontabYear | |
| 324 | + @update="updateCrontabValue" | |
| 325 | + :check="checkNumber" | |
| 326 | + :cron="crontabValueObj" | |
| 327 | + ref="cronyear" | |
| 328 | + /> | |
| 329 | + </el-tab-pane> | |
| 330 | + </el-tabs> | |
| 376 | 331 | |
| 332 | + <div class="popup-main"> | |
| 333 | + <div class="popup-result"> | |
| 334 | + <p class="title">时间表达式</p> | |
| 335 | + <table> | |
| 336 | + <thead> | |
| 337 | + <th v-for="item of tabTitles" width="40" :key="item">{{ item }}</th> | |
| 338 | + <th>Cron 表达式</th> | |
| 339 | + </thead> | |
| 340 | + <tbody> | |
| 341 | + <td> | |
| 342 | + <span>{{ crontabValueObj.second }}</span> | |
| 343 | + </td> | |
| 344 | + <td> | |
| 345 | + <span>{{ crontabValueObj.min }}</span> | |
| 346 | + </td> | |
| 347 | + <td> | |
| 348 | + <span>{{ crontabValueObj.hour }}</span> | |
| 349 | + </td> | |
| 350 | + <td> | |
| 351 | + <span>{{ crontabValueObj.day }}</span> | |
| 352 | + </td> | |
| 353 | + <td> | |
| 354 | + <span>{{ crontabValueObj.month }}</span> | |
| 355 | + </td> | |
| 356 | + <td> | |
| 357 | + <span>{{ crontabValueObj.week }}</span> | |
| 358 | + </td> | |
| 359 | + <td> | |
| 360 | + <span>{{ crontabValueObj.year }}</span> | |
| 361 | + </td> | |
| 362 | + <td> | |
| 363 | + <span>{{ crontabValueString }}</span> | |
| 364 | + </td> | |
| 365 | + </tbody> | |
| 366 | + </table> | |
| 367 | + </div> | |
| 368 | + <CrontabResult :ex="crontabValueString" /> | |
| 369 | + | |
| 370 | + <div class="pop_btn"> | |
| 371 | + <el-button type="primary" @click="submitFill">确定</el-button> | |
| 372 | + <el-button type="warning" @click="clearCron">重置</el-button> | |
| 373 | + <el-button @click="hidePopup">取消</el-button> | |
| 374 | + </div> | |
| 375 | + </div> | |
| 376 | + </div> | |
| 377 | +</template> | |
| 377 | 378 | <style scoped> |
| 378 | 379 | .pop_btn { |
| 379 | 380 | text-align: center; | ... | ... |
yudao-ui-admin-vue3/src/components/DictTag/src/DictTag.vue
| 1 | -<script lang="ts"> | |
| 2 | -import { defineComponent, onMounted, onUpdated, PropType, ref } from 'vue' | |
| 1 | +<script setup lang="ts"> | |
| 2 | +import { onMounted, onUpdated, PropType, ref } from 'vue' | |
| 3 | 3 | import { getDictOptions, DictDataType } from '@/utils/dict' |
| 4 | 4 | import { ElTag } from 'element-plus' |
| 5 | - | |
| 6 | -export default defineComponent({ | |
| 7 | - name: 'DictTag', | |
| 8 | - components: { | |
| 9 | - ElTag | |
| 10 | - }, | |
| 11 | - props: { | |
| 12 | - type: { | |
| 13 | - type: String as PropType<string>, | |
| 14 | - required: true | |
| 15 | - }, | |
| 16 | - value: { | |
| 17 | - type: [String, Number] as PropType<string | number>, | |
| 18 | - required: true | |
| 19 | - } | |
| 5 | +const props = defineProps({ | |
| 6 | + type: { | |
| 7 | + type: String as PropType<string>, | |
| 8 | + required: true | |
| 20 | 9 | }, |
| 21 | - setup(props) { | |
| 22 | - const dictData = ref<DictDataType>() | |
| 23 | - function getDictObj(dictType: string, value: string) { | |
| 24 | - const dictOptions = getDictOptions(dictType) | |
| 25 | - dictOptions.forEach((dict: DictDataType) => { | |
| 26 | - if (dict.value === value) { | |
| 27 | - dictData.value = dict | |
| 28 | - } | |
| 29 | - }) | |
| 10 | + value: { | |
| 11 | + type: [String, Number] as PropType<string | number>, | |
| 12 | + required: true | |
| 13 | + } | |
| 14 | +}) | |
| 15 | +const dictData = ref<DictDataType>() | |
| 16 | +const getDictObj = (dictType: string, value: string) => { | |
| 17 | + const dictOptions = getDictOptions(dictType) | |
| 18 | + dictOptions.forEach((dict: DictDataType) => { | |
| 19 | + if (dict.value === value) { | |
| 20 | + dictData.value = dict | |
| 30 | 21 | } |
| 22 | + }) | |
| 23 | +} | |
| 31 | 24 | |
| 32 | - onMounted(() => { | |
| 33 | - return getDictObj(props.type, props.value?.toString()) | |
| 34 | - }) | |
| 25 | +onMounted(() => { | |
| 26 | + return getDictObj(props.type, props.value?.toString()) | |
| 27 | +}) | |
| 35 | 28 | |
| 36 | - onUpdated(() => { | |
| 37 | - getDictObj(props.type, props.value?.toString()) | |
| 38 | - }) | |
| 39 | - return { | |
| 40 | - props, | |
| 41 | - dictData | |
| 42 | - } | |
| 43 | - } | |
| 29 | +onUpdated(() => { | |
| 30 | + getDictObj(props.type, props.value?.toString()) | |
| 44 | 31 | }) |
| 45 | 32 | </script> |
| 46 | 33 | <template> | ... | ... |
yudao-ui-admin-vue3/src/router/modules/remaining.ts
| ... | ... | @@ -72,7 +72,7 @@ const remainingRouter: AppRouteRecordRaw[] = [ |
| 72 | 72 | children: [ |
| 73 | 73 | { |
| 74 | 74 | path: 'edit', |
| 75 | - component: () => import('@/views/infra/codegen/components/EditTable.vue'), | |
| 75 | + component: () => import('@/views/infra/codegen/EditTable.vue'), | |
| 76 | 76 | name: 'EditTable', |
| 77 | 77 | meta: { |
| 78 | 78 | noCache: true, | ... | ... |
yudao-ui-admin-vue3/src/views/bpm/model/index.vue
| 1 | -<script setup lang="ts"></script> | |
| 1 | +<script setup lang="ts"> | |
| 2 | +import { ref, unref } from 'vue' | |
| 3 | +import dayjs from 'dayjs' | |
| 4 | +import { ElTableColumn, ElTag, ElSwitch } from 'element-plus' | |
| 5 | +import { DICT_TYPE } from '@/utils/dict' | |
| 6 | +import { useTable } from '@/hooks/web/useTable' | |
| 7 | +import { useI18n } from '@/hooks/web/useI18n' | |
| 8 | +import { FormExpose } from '@/components/Form' | |
| 9 | +import type { ModelVO } from '@/api/bpm/model/types' | |
| 10 | +import { rules, allSchemas } from './model.data' | |
| 11 | +import * as ModelApi from '@/api/bpm/model' | |
| 12 | +import { useMessage } from '@/hooks/web/useMessage' | |
| 13 | +const message = useMessage() | |
| 14 | +const { t } = useI18n() // 国际化 | |
| 15 | + | |
| 16 | +// ========== 列表相关 ========== | |
| 17 | +const { register, tableObject, methods } = useTable<ModelVO>({ | |
| 18 | + getListApi: ModelApi.getModelPageApi, | |
| 19 | + delListApi: ModelApi.deleteModelApi | |
| 20 | +}) | |
| 21 | +const { getList, setSearchParams, delList } = methods | |
| 22 | + | |
| 23 | +// ========== CRUD 相关 ========== | |
| 24 | +const actionLoading = ref(false) // 遮罩层 | |
| 25 | +const actionType = ref('') // 操作按钮的类型 | |
| 26 | +const dialogVisible = ref(false) // 是否显示弹出层 | |
| 27 | +const dialogTitle = ref('edit') // 弹出层标题 | |
| 28 | +const formRef = ref<FormExpose>() // 表单 Ref | |
| 29 | + | |
| 30 | +// 设置标题 | |
| 31 | +const setDialogTile = (type: string) => { | |
| 32 | + dialogTitle.value = t('action.' + type) | |
| 33 | + actionType.value = type | |
| 34 | + dialogVisible.value = true | |
| 35 | +} | |
| 36 | + | |
| 37 | +// 新增操作 | |
| 38 | +const handleCreate = () => { | |
| 39 | + setDialogTile('create') | |
| 40 | + // 重置表单 | |
| 41 | + unref(formRef)?.getElFormRef()?.resetFields() | |
| 42 | +} | |
| 43 | + | |
| 44 | +// 修改操作 | |
| 45 | +const handleUpdate = async (row: ModelVO) => { | |
| 46 | + setDialogTile('update') | |
| 47 | + // 设置数据 | |
| 48 | + const res = await ModelApi.getModelApi(row.id) | |
| 49 | + unref(formRef)?.setValues(res) | |
| 50 | +} | |
| 51 | + | |
| 52 | +// 提交按钮 | |
| 53 | +const submitForm = async () => { | |
| 54 | + actionLoading.value = true | |
| 55 | + // 提交请求 | |
| 56 | + try { | |
| 57 | + const data = unref(formRef)?.formModel as ModelVO | |
| 58 | + if (actionType.value === 'create') { | |
| 59 | + await ModelApi.createModelApi(data) | |
| 60 | + message.success(t('common.createSuccess')) | |
| 61 | + } else { | |
| 62 | + await ModelApi.updateModelApi(data) | |
| 63 | + message.success(t('common.updateSuccess')) | |
| 64 | + } | |
| 65 | + // 操作成功,重新加载列表 | |
| 66 | + dialogVisible.value = false | |
| 67 | + await getList() | |
| 68 | + } finally { | |
| 69 | + actionLoading.value = false | |
| 70 | + } | |
| 71 | +} | |
| 72 | + | |
| 73 | +/** 流程表单的详情按钮操作 */ | |
| 74 | +const handleChangeState = async (row: ModelVO) => { | |
| 75 | + const state = row.processDefinition.suspensionState | |
| 76 | + const statusState = state === 1 ? '激活' : '挂起' | |
| 77 | + message | |
| 78 | + .confirm( | |
| 79 | + '是否确认' + statusState + '流程名字为"' + row.name + '"的数据项?', | |
| 80 | + t('common.reminder') | |
| 81 | + ) | |
| 82 | + .then(async () => { | |
| 83 | + ModelApi.updateModelStateApi(row.id, state).then(() => { | |
| 84 | + message.success(t('common.updateSuccess')) | |
| 85 | + getList() | |
| 86 | + }) | |
| 87 | + }) | |
| 88 | + .catch(() => {}) | |
| 89 | +} | |
| 90 | +// ========== 详情相关 ========== | |
| 91 | +const detailRef = ref() // 详情 Ref | |
| 92 | + | |
| 93 | +// 详情操作 | |
| 94 | +const handleDetail = async (row: ModelVO) => { | |
| 95 | + // 设置数据 | |
| 96 | + detailRef.value = row | |
| 97 | + setDialogTile('detail') | |
| 98 | +} | |
| 99 | + | |
| 100 | +// ========== 初始化 ========== | |
| 101 | +getList() | |
| 102 | +</script> | |
| 2 | 103 | |
| 3 | 104 | <template> |
| 4 | - <div>index</div> | |
| 5 | -</template> | |
| 105 | + <!-- 搜索工作区 --> | |
| 106 | + <ContentWrap> | |
| 107 | + <Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> | |
| 108 | + </ContentWrap> | |
| 109 | + <ContentWrap> | |
| 110 | + <!-- 操作工具栏 --> | |
| 111 | + <div class="mb-10px"> | |
| 112 | + <el-button type="primary" v-hasPermi="['bpm:model:create']" @click="handleCreate"> | |
| 113 | + <Icon icon="ep:zoom-in" class="mr-5px" /> {{ t('action.add') }} | |
| 114 | + </el-button> | |
| 115 | + </div> | |
| 116 | + <!-- 列表 --> | |
| 117 | + <Table | |
| 118 | + :columns="allSchemas.tableColumns" | |
| 119 | + :selection="false" | |
| 120 | + :data="tableObject.tableList" | |
| 121 | + :loading="tableObject.loading" | |
| 122 | + :pagination="{ | |
| 123 | + total: tableObject.total | |
| 124 | + }" | |
| 125 | + v-model:pageSize="tableObject.pageSize" | |
| 126 | + v-model:currentPage="tableObject.currentPage" | |
| 127 | + @register="register" | |
| 128 | + > | |
| 129 | + <template #category="{ row }"> | |
| 130 | + <DictTag :type="DICT_TYPE.BPM_MODEL_CATEGORY" :value="row.category" /> | |
| 131 | + </template> | |
| 132 | + <template #formId="{ row }"> | |
| 133 | + <span>{{ row.formName }}</span> | |
| 134 | + </template> | |
| 135 | + <template #processDefinition> | |
| 136 | + <el-table-column label="流程版本" prop="processDefinition.version"> | |
| 137 | + <template #default="{ row }"> | |
| 138 | + <el-tag v-if="row.processDefinition"> | |
| 139 | + {{ 'v' + row.processDefinition.version }} | |
| 140 | + </el-tag> | |
| 141 | + <el-tag type="warning" v-else>未部署</el-tag> | |
| 142 | + </template> | |
| 143 | + </el-table-column> | |
| 144 | + <el-table-column label="激活状态" prop="processDefinition.suspensionState"> | |
| 145 | + <template #default="{ row }"> | |
| 146 | + <el-switch | |
| 147 | + v-if="row.processDefinition" | |
| 148 | + v-model="row.processDefinition.suspensionState" | |
| 149 | + :active-value="1" | |
| 150 | + :inactive-value="2" | |
| 151 | + @change="handleChangeState(row)" | |
| 152 | + /> | |
| 153 | + </template> | |
| 154 | + </el-table-column> | |
| 155 | + <el-table-column label="部署时间" prop="processDefinition.deploymentTime"> | |
| 156 | + <template #default="{ row }"> | |
| 157 | + <span> | |
| 158 | + {{ dayjs(row.processDefinition.deploymentTime).format('YYYY-MM-DD HH:mm:ss') }} | |
| 159 | + </span> | |
| 160 | + </template> | |
| 161 | + </el-table-column> | |
| 162 | + </template> | |
| 163 | + <template #createTime="{ row }"> | |
| 164 | + <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span> | |
| 165 | + </template> | |
| 166 | + <template #action="{ row }"> | |
| 167 | + <el-button link type="primary" v-hasPermi="['bpm:model:update']" @click="handleUpdate(row)"> | |
| 168 | + <Icon icon="ep:edit" class="mr-1px" /> {{ t('action.edit') }} | |
| 169 | + </el-button> | |
| 170 | + <el-button link type="primary" v-hasPermi="['bpm:model:update']" @click="handleDetail(row)"> | |
| 171 | + <Icon icon="ep:view" class="mr-1px" /> {{ t('action.detail') }} | |
| 172 | + </el-button> | |
| 173 | + <el-button | |
| 174 | + link | |
| 175 | + type="primary" | |
| 176 | + v-hasPermi="['bpm:model:delete']" | |
| 177 | + @click="delList(row.id, false)" | |
| 178 | + > | |
| 179 | + <Icon icon="ep:delete" class="mr-1px" /> {{ t('action.del') }} | |
| 180 | + </el-button> | |
| 181 | + </template> | |
| 182 | + </Table> | |
| 183 | + </ContentWrap> | |
| 6 | 184 | |
| 7 | -<style scoped></style> | |
| 185 | + <Dialog v-model="dialogVisible" :title="dialogTitle"> | |
| 186 | + <!-- 对话框(添加 / 修改) --> | |
| 187 | + <Form | |
| 188 | + v-if="['create', 'update'].includes(actionType)" | |
| 189 | + :schema="allSchemas.formSchema" | |
| 190 | + :rules="rules" | |
| 191 | + ref="formRef" | |
| 192 | + /> | |
| 193 | + <!-- 对话框(详情) --> | |
| 194 | + <Descriptions | |
| 195 | + v-if="actionType === 'detail'" | |
| 196 | + :schema="allSchemas.detailSchema" | |
| 197 | + :data="detailRef" | |
| 198 | + > | |
| 199 | + <template #createTime="{ row }"> | |
| 200 | + <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span> | |
| 201 | + </template> | |
| 202 | + </Descriptions> | |
| 203 | + <!-- 操作按钮 --> | |
| 204 | + <template #footer> | |
| 205 | + <el-button | |
| 206 | + v-if="['create', 'update'].includes(actionType)" | |
| 207 | + type="primary" | |
| 208 | + :loading="actionLoading" | |
| 209 | + @click="submitForm" | |
| 210 | + > | |
| 211 | + {{ t('action.save') }} | |
| 212 | + </el-button> | |
| 213 | + <el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button> | |
| 214 | + </template> | |
| 215 | + </Dialog> | |
| 216 | +</template> | ... | ... |
yudao-ui-admin-vue3/src/views/bpm/model/model.data.ts
0 → 100644
| 1 | +import { reactive } from 'vue' | |
| 2 | +import { useI18n } from '@/hooks/web/useI18n' | |
| 3 | +import { required } from '@/utils/formRules' | |
| 4 | +import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas' | |
| 5 | +import { DICT_TYPE } from '@/utils/dict' | |
| 6 | +const { t } = useI18n() // 国际化 | |
| 7 | + | |
| 8 | +// 表单校验 | |
| 9 | +export const rules = reactive({ | |
| 10 | + name: [required] | |
| 11 | +}) | |
| 12 | + | |
| 13 | +// CrudSchema | |
| 14 | +const crudSchemas = reactive<CrudSchema[]>([ | |
| 15 | + { | |
| 16 | + label: t('common.index'), | |
| 17 | + field: 'id', | |
| 18 | + type: 'index', | |
| 19 | + form: { | |
| 20 | + show: false | |
| 21 | + }, | |
| 22 | + detail: { | |
| 23 | + show: false | |
| 24 | + } | |
| 25 | + }, | |
| 26 | + { | |
| 27 | + label: '流程标识', | |
| 28 | + field: 'key', | |
| 29 | + search: { | |
| 30 | + show: true | |
| 31 | + } | |
| 32 | + }, | |
| 33 | + { | |
| 34 | + label: '流程名称', | |
| 35 | + field: 'name', | |
| 36 | + search: { | |
| 37 | + show: true | |
| 38 | + } | |
| 39 | + }, | |
| 40 | + { | |
| 41 | + label: '流程分类', | |
| 42 | + field: 'category', | |
| 43 | + dictType: DICT_TYPE.BPM_MODEL_CATEGORY, | |
| 44 | + search: { | |
| 45 | + show: true | |
| 46 | + } | |
| 47 | + }, | |
| 48 | + { | |
| 49 | + label: '表单信息', | |
| 50 | + field: 'formId' | |
| 51 | + }, | |
| 52 | + { | |
| 53 | + label: '最新部署的流程定义', | |
| 54 | + field: 'processDefinition', | |
| 55 | + form: { | |
| 56 | + show: false | |
| 57 | + }, | |
| 58 | + detail: { | |
| 59 | + show: false | |
| 60 | + } | |
| 61 | + }, | |
| 62 | + { | |
| 63 | + label: t('common.createTime'), | |
| 64 | + field: 'createTime', | |
| 65 | + form: { | |
| 66 | + show: false | |
| 67 | + } | |
| 68 | + }, | |
| 69 | + { | |
| 70 | + label: t('table.action'), | |
| 71 | + field: 'action', | |
| 72 | + width: '240px', | |
| 73 | + form: { | |
| 74 | + show: false | |
| 75 | + }, | |
| 76 | + detail: { | |
| 77 | + show: false | |
| 78 | + } | |
| 79 | + } | |
| 80 | +]) | |
| 81 | +export const { allSchemas } = useCrudSchemas(crudSchemas) | ... | ... |
yudao-ui-admin-vue3/src/views/bpm/processInstance/index.vue
| 1 | -<script setup lang="ts"></script> | |
| 1 | +<script setup lang="ts"> | |
| 2 | +import { ref } from 'vue' | |
| 3 | +import dayjs from 'dayjs' | |
| 4 | +import { DICT_TYPE } from '@/utils/dict' | |
| 5 | +import { useTable } from '@/hooks/web/useTable' | |
| 6 | +import { useI18n } from '@/hooks/web/useI18n' | |
| 7 | +import type { ProcessInstanceVO } from '@/api/bpm/processInstance/types' | |
| 8 | +import { allSchemas } from './process.data' | |
| 9 | +import * as ProcessInstanceApi from '@/api/bpm/processInstance' | |
| 10 | +import { ElMessage, ElMessageBox } from 'element-plus' | |
| 11 | +const { t } = useI18n() // 国际化 | |
| 12 | + | |
| 13 | +// ========== 列表相关 ========== | |
| 14 | +const { register, tableObject, methods } = useTable<ProcessInstanceVO>({ | |
| 15 | + getListApi: ProcessInstanceApi.getMyProcessInstancePageApi | |
| 16 | +}) | |
| 17 | +const { getList, setSearchParams } = methods | |
| 18 | + | |
| 19 | +// ========== CRUD 相关 ========== | |
| 20 | +const dialogVisible = ref(false) // 是否显示弹出层 | |
| 21 | +// 发起流程 | |
| 22 | +const handleAdd = () => { | |
| 23 | + console.info('add') | |
| 24 | +} | |
| 25 | +// 取消操作 | |
| 26 | +const handleCancel = (row: ProcessInstanceVO) => { | |
| 27 | + ElMessageBox.prompt('请输入取消原因?', '取消流程', { | |
| 28 | + confirmButtonText: t('common.ok'), | |
| 29 | + cancelButtonText: t('common.cancel'), | |
| 30 | + type: 'warning', | |
| 31 | + inputPattern: /^[\s\S]*.*[^\s][\s\S]*$/, // 判断非空,且非空格 | |
| 32 | + inputErrorMessage: '取消原因不能为空' | |
| 33 | + }).then(async ({ value }) => { | |
| 34 | + await ProcessInstanceApi.cancelProcessInstanceApi(row.id, value) | |
| 35 | + ElMessage.success('取消成功') | |
| 36 | + getList() | |
| 37 | + }) | |
| 38 | +} | |
| 39 | + | |
| 40 | +// ========== 详情相关 ========== | |
| 41 | +const detailRef = ref() // 详情 Ref | |
| 42 | + | |
| 43 | +// 详情操作 | |
| 44 | +const handleDetail = async (row: ProcessInstanceVO) => { | |
| 45 | + // 设置数据 | |
| 46 | + detailRef.value = row | |
| 47 | + dialogVisible.value = true | |
| 48 | +} | |
| 49 | + | |
| 50 | +// ========== 初始化 ========== | |
| 51 | +getList() | |
| 52 | +</script> | |
| 2 | 53 | |
| 3 | 54 | <template> |
| 4 | - <div>index</div> | |
| 5 | -</template> | |
| 55 | + <!-- 搜索工作区 --> | |
| 56 | + <ContentWrap> | |
| 57 | + <Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> | |
| 58 | + </ContentWrap> | |
| 59 | + <ContentWrap> | |
| 60 | + <!-- 操作工具栏 --> | |
| 61 | + <div class="mb-10px"> | |
| 62 | + <el-button type="primary" v-hasPermi="['bpm:process-instance:query']" @click="handleAdd"> | |
| 63 | + <Icon icon="ep:zoom-in" class="mr-5px" /> {{ t('action.add') }} | |
| 64 | + </el-button> | |
| 65 | + </div> | |
| 66 | + <!-- 列表 --> | |
| 67 | + <Table | |
| 68 | + :columns="allSchemas.tableColumns" | |
| 69 | + :selection="false" | |
| 70 | + :data="tableObject.tableList" | |
| 71 | + :loading="tableObject.loading" | |
| 72 | + :pagination="{ | |
| 73 | + total: tableObject.total | |
| 74 | + }" | |
| 75 | + v-model:pageSize="tableObject.pageSize" | |
| 76 | + v-model:currentPage="tableObject.currentPage" | |
| 77 | + @register="register" | |
| 78 | + > | |
| 79 | + <template #status="{ row }"> | |
| 80 | + <DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" /> | |
| 81 | + </template> | |
| 82 | + <template #createTime="{ row }"> | |
| 83 | + <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span> | |
| 84 | + </template> | |
| 85 | + <template #action="{ row }"> | |
| 86 | + <el-button | |
| 87 | + link | |
| 88 | + type="primary" | |
| 89 | + v-hasPermi="['bpm:process-instance:query']" | |
| 90 | + @click="handleDetail(row)" | |
| 91 | + > | |
| 92 | + <Icon icon="ep:view" class="mr-1px" /> {{ t('action.detail') }} | |
| 93 | + </el-button> | |
| 94 | + <el-button | |
| 95 | + link | |
| 96 | + type="primary" | |
| 97 | + v-hasPermi="['bpm:process-instance:cancel']" | |
| 98 | + @click="handleCancel(row)" | |
| 99 | + > | |
| 100 | + <Icon icon="ep:delete" class="mr-1px" /> {{ t('action.del') }} | |
| 101 | + </el-button> | |
| 102 | + </template> | |
| 103 | + </Table> | |
| 104 | + </ContentWrap> | |
| 6 | 105 | |
| 7 | -<style scoped></style> | |
| 106 | + <Dialog v-model="dialogVisible" :title="t('action.detail')"> | |
| 107 | + <!-- 对话框(详情) --> | |
| 108 | + <Descriptions :schema="allSchemas.detailSchema" :data="detailRef"> | |
| 109 | + <template #status="{ row }"> | |
| 110 | + <DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" /> | |
| 111 | + </template> | |
| 112 | + <template #createTime="{ row }"> | |
| 113 | + <span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span> | |
| 114 | + </template> | |
| 115 | + </Descriptions> | |
| 116 | + <!-- 操作按钮 --> | |
| 117 | + <template #footer> | |
| 118 | + <el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button> | |
| 119 | + </template> | |
| 120 | + </Dialog> | |
| 121 | +</template> | ... | ... |
yudao-ui-admin-vue3/src/views/bpm/processInstance/process.data.ts
0 → 100644
| 1 | +import { reactive } from 'vue' | |
| 2 | +import { useI18n } from '@/hooks/web/useI18n' | |
| 3 | +import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas' | |
| 4 | +import { DICT_TYPE } from '@/utils/dict' | |
| 5 | +const { t } = useI18n() // 国际化 | |
| 6 | + | |
| 7 | +// CrudSchema | |
| 8 | +const crudSchemas = reactive<CrudSchema[]>([ | |
| 9 | + { | |
| 10 | + label: t('common.index'), | |
| 11 | + field: 'id', | |
| 12 | + type: 'index', | |
| 13 | + form: { | |
| 14 | + show: false | |
| 15 | + }, | |
| 16 | + detail: { | |
| 17 | + show: false | |
| 18 | + } | |
| 19 | + }, | |
| 20 | + { | |
| 21 | + label: '流程名', | |
| 22 | + field: 'name', | |
| 23 | + search: { | |
| 24 | + show: true | |
| 25 | + } | |
| 26 | + }, | |
| 27 | + { | |
| 28 | + label: '流程分类', | |
| 29 | + field: 'category', | |
| 30 | + dictType: DICT_TYPE.BPM_MODEL_CATEGORY, | |
| 31 | + search: { | |
| 32 | + show: true | |
| 33 | + } | |
| 34 | + }, | |
| 35 | + { | |
| 36 | + label: '当前审批任务', | |
| 37 | + field: 'tasks' | |
| 38 | + }, | |
| 39 | + { | |
| 40 | + label: t('common.status'), | |
| 41 | + field: 'status', | |
| 42 | + dictType: DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS, | |
| 43 | + search: { | |
| 44 | + show: true | |
| 45 | + } | |
| 46 | + }, | |
| 47 | + { | |
| 48 | + label: '结果', | |
| 49 | + field: 'result', | |
| 50 | + dictType: DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT, | |
| 51 | + search: { | |
| 52 | + show: true | |
| 53 | + } | |
| 54 | + }, | |
| 55 | + { | |
| 56 | + label: '提交时间', | |
| 57 | + field: 'createTime', | |
| 58 | + form: { | |
| 59 | + show: false | |
| 60 | + }, | |
| 61 | + search: { | |
| 62 | + show: true | |
| 63 | + } | |
| 64 | + }, | |
| 65 | + { | |
| 66 | + label: '结束时间', | |
| 67 | + field: 'endTime', | |
| 68 | + form: { | |
| 69 | + show: false | |
| 70 | + } | |
| 71 | + }, | |
| 72 | + { | |
| 73 | + label: t('table.action'), | |
| 74 | + field: 'action', | |
| 75 | + width: '240px', | |
| 76 | + form: { | |
| 77 | + show: false | |
| 78 | + }, | |
| 79 | + detail: { | |
| 80 | + show: false | |
| 81 | + } | |
| 82 | + } | |
| 83 | +]) | |
| 84 | +export const { allSchemas } = useCrudSchemas(crudSchemas) | ... | ... |
yudao-ui-admin-vue3/src/views/infra/codegen/components/EditTable.vue renamed to yudao-ui-admin-vue3/src/views/infra/codegen/EditTable.vue
| 1 | 1 | <script setup lang="ts"> |
| 2 | 2 | import { ref, unref, onMounted } from 'vue' |
| 3 | 3 | import { ContentDetailWrap } from '@/components/ContentDetailWrap' |
| 4 | -import BasicInfoForm from './BasicInfoForm.vue' | |
| 5 | -import CloumInfoFormVue from './CloumInfoForm.vue' | |
| 6 | -import GenInfoFormVue from './GenInfoForm.vue' | |
| 7 | -import { ElTabs, ElTabPane, ElButton } from 'element-plus' | |
| 8 | -import { getCodegenTableApi } from '@/api/infra/codegen' | |
| 4 | +import { BasicInfoForm, CloumInfoForm, GenInfoForm } from './components' | |
| 5 | +import { ElTabs, ElTabPane, ElButton, ElMessage } from 'element-plus' | |
| 6 | +import { getCodegenTableApi, updateCodegenTableApi } from '@/api/infra/codegen' | |
| 9 | 7 | import { useRouter, useRoute } from 'vue-router' |
| 10 | 8 | import { useI18n } from '@/hooks/web/useI18n' |
| 11 | -import { CodegenColumnVO, CodegenTableVO } from '@/api/infra/codegen/types' | |
| 9 | +import { CodegenTableVO, CodegenColumnVO, CodegenUpdateReqVO } from '@/api/infra/codegen/types' | |
| 12 | 10 | const { t } = useI18n() |
| 13 | 11 | const { push } = useRouter() |
| 14 | 12 | const { query } = useRoute() |
| 15 | -const tableCurrentRow = ref<Nullable<CodegenTableVO>>(null) | |
| 13 | +const tableCurrentRow = ref<CodegenTableVO>() | |
| 16 | 14 | const cloumCurrentRow = ref<CodegenColumnVO[]>() |
| 17 | 15 | const getList = async () => { |
| 18 | 16 | const id = query.id as unknown as number |
| ... | ... | @@ -26,17 +24,23 @@ const getList = async () => { |
| 26 | 24 | const loading = ref(false) |
| 27 | 25 | const activeName = ref('cloum') |
| 28 | 26 | const basicInfoRef = ref<ComponentRef<typeof BasicInfoForm>>() |
| 29 | -const genInfoRef = ref<ComponentRef<typeof GenInfoFormVue>>() | |
| 27 | +const genInfoRef = ref<ComponentRef<typeof GenInfoForm>>() | |
| 28 | +const cloumInfoRef = ref(null) | |
| 30 | 29 | const submitForm = async () => { |
| 31 | 30 | const basicInfo = unref(basicInfoRef) |
| 32 | 31 | const genInfo = unref(genInfoRef) |
| 33 | - const basicValidate = await basicInfo?.elFormRef?.validate()?.catch(() => {}) | |
| 34 | - const genValidate = await genInfo?.elFormRef?.validate()?.catch(() => {}) | |
| 35 | - if (basicValidate && genValidate) { | |
| 32 | + const basicForm = await basicInfo?.elFormRef?.validate()?.catch(() => {}) | |
| 33 | + const genForm = await genInfo?.elFormRef?.validate()?.catch(() => {}) | |
| 34 | + if (basicForm && genForm) { | |
| 36 | 35 | const basicInfoData = (await basicInfo?.getFormData()) as CodegenTableVO |
| 37 | 36 | const genInfoData = (await genInfo?.getFormData()) as CodegenTableVO |
| 38 | - console.info(basicInfoData) | |
| 39 | - console.info(genInfoData) | |
| 37 | + const genTable: CodegenUpdateReqVO = { | |
| 38 | + table: Object.assign({}, basicInfoData, genInfoData), | |
| 39 | + columns: cloumCurrentRow.value | |
| 40 | + } | |
| 41 | + await updateCodegenTableApi(genTable) | |
| 42 | + ElMessage.success(t('common.updateSuccess')) | |
| 43 | + push('/infra/codegen') | |
| 40 | 44 | } |
| 41 | 45 | } |
| 42 | 46 | onMounted(() => { |
| ... | ... | @@ -46,14 +50,14 @@ onMounted(() => { |
| 46 | 50 | <template> |
| 47 | 51 | <ContentDetailWrap title="代码生成" @back="push('/infra/codegen')"> |
| 48 | 52 | <el-tabs v-model="activeName"> |
| 49 | - <el-tab-pane label="基本信息" name="basic"> | |
| 50 | - <BasicInfoForm ref="basicInfoRef" :current-row="tableCurrentRow" /> | |
| 53 | + <el-tab-pane label="基本信息" name="basicInfo"> | |
| 54 | + <BasicInfoForm ref="basicInfoRef" :basicInfo="tableCurrentRow" /> | |
| 51 | 55 | </el-tab-pane> |
| 52 | 56 | <el-tab-pane label="字段信息" name="cloum"> |
| 53 | - <CloumInfoFormVue ref="cloumInfoRef" :current-row="cloumCurrentRow" /> | |
| 57 | + <CloumInfoForm ref="cloumInfoRef" :info="cloumCurrentRow" /> | |
| 54 | 58 | </el-tab-pane> |
| 55 | 59 | <el-tab-pane label="生成信息" name="genInfo"> |
| 56 | - <GenInfoFormVue ref="basicInfoRef" :current-row="tableCurrentRow" /> | |
| 60 | + <GenInfoForm ref="genInfoRef" :genInfo="tableCurrentRow" /> | |
| 57 | 61 | </el-tab-pane> |
| 58 | 62 | </el-tabs> |
| 59 | 63 | <template #right> | ... | ... |
yudao-ui-admin-vue3/src/views/infra/codegen/components/BasicInfoForm.vue
| ... | ... | @@ -5,7 +5,7 @@ import { CodegenTableVO } from '@/api/infra/codegen/types' |
| 5 | 5 | import { Form } from '@/components/Form' |
| 6 | 6 | import { useForm } from '@/hooks/web/useForm' |
| 7 | 7 | const props = defineProps({ |
| 8 | - currentRow: { | |
| 8 | + basicInfo: { | |
| 9 | 9 | type: Object as PropType<Nullable<CodegenTableVO>>, |
| 10 | 10 | default: () => null |
| 11 | 11 | } |
| ... | ... | @@ -66,11 +66,11 @@ const { register, methods, elFormRef } = useForm({ |
| 66 | 66 | schema |
| 67 | 67 | }) |
| 68 | 68 | watch( |
| 69 | - () => props.currentRow, | |
| 70 | - (currentRow) => { | |
| 71 | - if (!currentRow) return | |
| 69 | + () => props.basicInfo, | |
| 70 | + (basicInfo) => { | |
| 71 | + if (!basicInfo) return | |
| 72 | 72 | const { setValues } = methods |
| 73 | - setValues(currentRow) | |
| 73 | + setValues(basicInfo) | |
| 74 | 74 | }, |
| 75 | 75 | { |
| 76 | 76 | deep: true, | ... | ... |
yudao-ui-admin-vue3/src/views/infra/codegen/components/CloumInfoForm.vue
| ... | ... | @@ -4,8 +4,8 @@ import { onMounted, PropType, ref } from 'vue' |
| 4 | 4 | import { CodegenColumnVO } from '@/api/infra/codegen/types' |
| 5 | 5 | import { listSimpleDictTypeApi } from '@/api/system/dict/dict.type' |
| 6 | 6 | import { DictTypeVO } from '@/api/system/dict/types' |
| 7 | -defineProps({ | |
| 8 | - currentRow: { | |
| 7 | +const props = defineProps({ | |
| 8 | + info: { | |
| 9 | 9 | type: Array as unknown as PropType<CodegenColumnVO[]>, |
| 10 | 10 | default: () => null |
| 11 | 11 | } |
| ... | ... | @@ -20,18 +20,21 @@ const tableHeight = document.documentElement.scrollHeight - 245 + 'px' |
| 20 | 20 | onMounted(async () => { |
| 21 | 21 | await getDictOptions() |
| 22 | 22 | }) |
| 23 | +defineExpose({ | |
| 24 | + info: props.info | |
| 25 | +}) | |
| 23 | 26 | </script> |
| 24 | 27 | <template> |
| 25 | - <el-table ref="dragTable" :data="currentRow" row-key="columnId" :max-height="tableHeight"> | |
| 28 | + <el-table ref="dragTable" :data="info" row-key="columnId" :max-height="tableHeight"> | |
| 26 | 29 | <el-table-column |
| 27 | 30 | label="字段列名" |
| 28 | 31 | prop="columnName" |
| 29 | 32 | min-width="10%" |
| 30 | 33 | :show-overflow-tooltip="true" |
| 31 | 34 | /> |
| 32 | - <el-table-column label="字段描述" min-width="10%"> | |
| 33 | - <template #default="scope"> | |
| 34 | - <el-input v-model="scope.row.columnComment" /> | |
| 35 | + <el-table-column label="字段描述" min-width="10%" prop="columnComment"> | |
| 36 | + <template #default="{ row }"> | |
| 37 | + <el-input v-model="row.columnComment" /> | |
| 35 | 38 | </template> |
| 36 | 39 | </el-table-column> |
| 37 | 40 | <el-table-column |
| ... | ... | @@ -40,9 +43,9 @@ onMounted(async () => { |
| 40 | 43 | min-width="10%" |
| 41 | 44 | :show-overflow-tooltip="true" |
| 42 | 45 | /> |
| 43 | - <el-table-column label="Java类型" min-width="11%"> | |
| 44 | - <template #default="scope"> | |
| 45 | - <el-select v-model="scope.row.javaType"> | |
| 46 | + <el-table-column label="Java类型" min-width="11%" prop="javaType"> | |
| 47 | + <template #default="{ row }"> | |
| 48 | + <el-select v-model="row.javaType"> | |
| 46 | 49 | <el-option label="Long" value="Long" /> |
| 47 | 50 | <el-option label="String" value="String" /> |
| 48 | 51 | <el-option label="Integer" value="Integer" /> |
| ... | ... | @@ -53,38 +56,34 @@ onMounted(async () => { |
| 53 | 56 | </el-select> |
| 54 | 57 | </template> |
| 55 | 58 | </el-table-column> |
| 56 | - <el-table-column label="java属性" min-width="10%"> | |
| 57 | - <template #default="scope"> | |
| 58 | - <el-input v-model="scope.row.javaField" /> | |
| 59 | + <el-table-column label="java属性" min-width="10%" prop="javaField"> | |
| 60 | + <template #default="{ row }"> | |
| 61 | + <el-input v-model="row.javaField" /> | |
| 59 | 62 | </template> |
| 60 | 63 | </el-table-column> |
| 61 | - <el-table-column label="插入" min-width="4%"> | |
| 62 | - <template #default="scope"> | |
| 63 | - <el-checkbox true-label="true" false-label="false" v-model="scope.row.createOperation" /> | |
| 64 | + <el-table-column label="插入" min-width="4%" prop="createOperation"> | |
| 65 | + <template #default="{ row }"> | |
| 66 | + <el-checkbox true-label="true" false-label="false" v-model="row.createOperation" /> | |
| 64 | 67 | </template> |
| 65 | 68 | </el-table-column> |
| 66 | - <el-table-column label="编辑" min-width="4%"> | |
| 67 | - <template #default="scope"> | |
| 68 | - <el-checkbox true-label="true" false-label="false" v-model="scope.row.updateOperation" /> | |
| 69 | + <el-table-column label="编辑" min-width="4%" prop="updateOperation"> | |
| 70 | + <template #default="{ row }"> | |
| 71 | + <el-checkbox true-label="true" false-label="false" v-model="row.updateOperation" /> | |
| 69 | 72 | </template> |
| 70 | 73 | </el-table-column> |
| 71 | - <el-table-column label="列表" min-width="4%"> | |
| 72 | - <template #default="scope"> | |
| 73 | - <el-checkbox | |
| 74 | - true-label="true" | |
| 75 | - false-label="false" | |
| 76 | - v-model="scope.row.listOperationResult" | |
| 77 | - /> | |
| 74 | + <el-table-column label="列表" min-width="4%" prop="listOperationResult"> | |
| 75 | + <template #default="{ row }"> | |
| 76 | + <el-checkbox true-label="true" false-label="false" v-model="row.listOperationResult" /> | |
| 78 | 77 | </template> |
| 79 | 78 | </el-table-column> |
| 80 | - <el-table-column label="查询" min-width="4%"> | |
| 81 | - <template #default="scope"> | |
| 82 | - <el-checkbox true-label="true" false-label="false" v-model="scope.row.listOperation" /> | |
| 79 | + <el-table-column label="查询" min-width="4%" prop="listOperation"> | |
| 80 | + <template #default="{ row }"> | |
| 81 | + <el-checkbox true-label="true" false-label="false" v-model="row.listOperation" /> | |
| 83 | 82 | </template> |
| 84 | 83 | </el-table-column> |
| 85 | - <el-table-column label="查询方式" min-width="10%"> | |
| 86 | - <template #default="scope"> | |
| 87 | - <el-select v-model="scope.row.listOperationCondition"> | |
| 84 | + <el-table-column label="查询方式" min-width="10%" prop="listOperationCondition"> | |
| 85 | + <template #default="{ row }"> | |
| 86 | + <el-select v-model="row.listOperationCondition"> | |
| 88 | 87 | <el-option label="=" value="=" /> |
| 89 | 88 | <el-option label="!=" value="!=" /> |
| 90 | 89 | <el-option label=">" value=">" /> |
| ... | ... | @@ -96,14 +95,14 @@ onMounted(async () => { |
| 96 | 95 | </el-select> |
| 97 | 96 | </template> |
| 98 | 97 | </el-table-column> |
| 99 | - <el-table-column label="允许空" min-width="5%"> | |
| 100 | - <template #default="scope"> | |
| 101 | - <el-checkbox true-label="true" false-label="false" v-model="scope.row.nullable" /> | |
| 98 | + <el-table-column label="允许空" min-width="5%" prop="nullable"> | |
| 99 | + <template #default="{ row }"> | |
| 100 | + <el-checkbox true-label="true" false-label="false" v-model="row.nullable" /> | |
| 102 | 101 | </template> |
| 103 | 102 | </el-table-column> |
| 104 | - <el-table-column label="显示类型" min-width="12%"> | |
| 105 | - <template #default="scope"> | |
| 106 | - <el-select v-model="scope.row.htmlType"> | |
| 103 | + <el-table-column label="显示类型" min-width="12%" prop="htmlType"> | |
| 104 | + <template #default="{ row }"> | |
| 105 | + <el-select v-model="row.htmlType"> | |
| 107 | 106 | <el-option label="文本框" value="input" /> |
| 108 | 107 | <el-option label="文本域" value="textarea" /> |
| 109 | 108 | <el-option label="下拉框" value="select" /> |
| ... | ... | @@ -116,9 +115,9 @@ onMounted(async () => { |
| 116 | 115 | </el-select> |
| 117 | 116 | </template> |
| 118 | 117 | </el-table-column> |
| 119 | - <el-table-column label="字典类型" min-width="12%"> | |
| 120 | - <template #default="scope"> | |
| 121 | - <el-select v-model="scope.row.dictType" clearable filterable placeholder="请选择"> | |
| 118 | + <el-table-column label="字典类型" min-width="12%" prop="dictType"> | |
| 119 | + <template #default="{ row }"> | |
| 120 | + <el-select v-model="row.dictType" clearable filterable placeholder="请选择"> | |
| 122 | 121 | <el-option |
| 123 | 122 | v-for="dict in dictOptions" |
| 124 | 123 | :key="dict.id" |
| ... | ... | @@ -128,9 +127,9 @@ onMounted(async () => { |
| 128 | 127 | </el-select> |
| 129 | 128 | </template> |
| 130 | 129 | </el-table-column> |
| 131 | - <el-table-column label="示例" min-width="10%"> | |
| 132 | - <template #default="scope"> | |
| 133 | - <el-input v-model="scope.row.example" /> | |
| 130 | + <el-table-column label="示例" min-width="10%" prop="example"> | |
| 131 | + <template #default="{ row }"> | |
| 132 | + <el-input v-model="row.example" /> | |
| 134 | 133 | </template> |
| 135 | 134 | </el-table-column> |
| 136 | 135 | </el-table> | ... | ... |
yudao-ui-admin-vue3/src/views/infra/codegen/components/GenInfoForm.vue
| ... | ... | @@ -4,9 +4,9 @@ import { required } from '@/utils/formRules' |
| 4 | 4 | import { CodegenTableVO } from '@/api/infra/codegen/types' |
| 5 | 5 | import { Form } from '@/components/Form' |
| 6 | 6 | import { useForm } from '@/hooks/web/useForm' |
| 7 | -import { DICT_TYPE, getDictOptions } from '@/utils/dict' | |
| 7 | +import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' | |
| 8 | 8 | const props = defineProps({ |
| 9 | - currentRow: { | |
| 9 | + genInfo: { | |
| 10 | 10 | type: Object as PropType<Nullable<CodegenTableVO>>, |
| 11 | 11 | default: () => null |
| 12 | 12 | } |
| ... | ... | @@ -20,13 +20,15 @@ const rules = reactive({ |
| 20 | 20 | className: [required], |
| 21 | 21 | classComment: [required] |
| 22 | 22 | }) |
| 23 | +const templateTypeOptions = getIntDictOptions(DICT_TYPE.INFRA_CODEGEN_TEMPLATE_TYPE) | |
| 24 | +const sceneOptions = getIntDictOptions(DICT_TYPE.INFRA_CODEGEN_SCENE) | |
| 23 | 25 | const schema = reactive<FormSchema[]>([ |
| 24 | 26 | { |
| 25 | 27 | label: '生成模板', |
| 26 | 28 | field: 'templateType', |
| 27 | 29 | component: 'Select', |
| 28 | 30 | componentProps: { |
| 29 | - options: getDictOptions(DICT_TYPE.INFRA_CODEGEN_TEMPLATE_TYPE) | |
| 31 | + options: templateTypeOptions | |
| 30 | 32 | }, |
| 31 | 33 | colProps: { |
| 32 | 34 | span: 12 |
| ... | ... | @@ -37,7 +39,7 @@ const schema = reactive<FormSchema[]>([ |
| 37 | 39 | field: 'scene', |
| 38 | 40 | component: 'Select', |
| 39 | 41 | componentProps: { |
| 40 | - options: getDictOptions(DICT_TYPE.INFRA_CODEGEN_SCENE) | |
| 42 | + options: sceneOptions | |
| 41 | 43 | }, |
| 42 | 44 | colProps: { |
| 43 | 45 | span: 12 |
| ... | ... | @@ -93,11 +95,11 @@ const { register, methods, elFormRef } = useForm({ |
| 93 | 95 | schema |
| 94 | 96 | }) |
| 95 | 97 | watch( |
| 96 | - () => props.currentRow, | |
| 97 | - (currentRow) => { | |
| 98 | - if (!currentRow) return | |
| 98 | + () => props.genInfo, | |
| 99 | + (genInfo) => { | |
| 100 | + if (!genInfo) return | |
| 99 | 101 | const { setValues } = methods |
| 100 | - setValues(currentRow) | |
| 102 | + setValues(genInfo) | |
| 101 | 103 | }, |
| 102 | 104 | { |
| 103 | 105 | deep: true, | ... | ... |
yudao-ui-admin-vue3/src/views/infra/codegen/components/ImportTable.vue
| ... | ... | @@ -21,8 +21,8 @@ const emit = defineEmits(['ok']) |
| 21 | 21 | const visible = ref(false) |
| 22 | 22 | const dbLoading = ref(true) |
| 23 | 23 | const queryParams = reactive({ |
| 24 | - tableName: undefined, | |
| 25 | - tableComment: undefined, | |
| 24 | + name: undefined, | |
| 25 | + comment: undefined, | |
| 26 | 26 | dataSourceConfigId: 0 |
| 27 | 27 | }) |
| 28 | 28 | const dataSourceConfigs = ref<DataSourceConfigVO[]>([]) |
| ... | ... | @@ -49,8 +49,9 @@ const handleQuery = async () => { |
| 49 | 49 | } |
| 50 | 50 | // 重置操作 |
| 51 | 51 | const resetQuery = async () => { |
| 52 | - queryParams.tableName = undefined | |
| 53 | - queryParams.tableComment = undefined | |
| 52 | + queryParams.name = undefined | |
| 53 | + queryParams.comment = undefined | |
| 54 | + queryParams.dataSourceConfigId = 0 | |
| 54 | 55 | await getList() |
| 55 | 56 | } |
| 56 | 57 | /** 多选框选中数据 */ |
| ... | ... | @@ -90,11 +91,11 @@ defineExpose({ |
| 90 | 91 | /> |
| 91 | 92 | </el-select> |
| 92 | 93 | </el-form-item> |
| 93 | - <el-form-item label="表名称" prop="tableName"> | |
| 94 | - <el-input v-model="queryParams.tableName" placeholder="请输入表名称" clearable /> | |
| 94 | + <el-form-item label="表名称" prop="name"> | |
| 95 | + <el-input v-model="queryParams.name" placeholder="请输入表名称" clearable /> | |
| 95 | 96 | </el-form-item> |
| 96 | - <el-form-item label="表描述" prop="tableComment"> | |
| 97 | - <el-input v-model="queryParams.tableComment" placeholder="请输入表描述" clearable /> | |
| 97 | + <el-form-item label="表描述" prop="comment"> | |
| 98 | + <el-input v-model="queryParams.comment" placeholder="请输入表描述" clearable /> | |
| 98 | 99 | </el-form-item> |
| 99 | 100 | <el-form-item> |
| 100 | 101 | <el-button type="primary" @click="handleQuery"> | ... | ... |
yudao-ui-admin-vue3/src/views/infra/codegen/components/index.ts
| 1 | 1 | import BasicInfoForm from './BasicInfoForm.vue' |
| 2 | 2 | import CloumInfoForm from './CloumInfoForm.vue' |
| 3 | -import EditTable from './EditTable.vue' | |
| 4 | 3 | import GenInfoForm from './GenInfoForm.vue' |
| 5 | 4 | import ImportTable from './ImportTable.vue' |
| 6 | 5 | import Preview from './Preview.vue' |
| 7 | -export { BasicInfoForm, CloumInfoForm, EditTable, GenInfoForm, ImportTable, Preview } | |
| 6 | +export { BasicInfoForm, CloumInfoForm, GenInfoForm, ImportTable, Preview } | ... | ... |