From 404ac293cb06a53c1db8609842641257cb7caa4b Mon Sep 17 00:00:00 2001 From: xingyu Date: Thu, 21 Jul 2022 11:43:20 +0800 Subject: [PATCH 01/64] style: fix logo center --- yudao-ui-admin-vue3/src/components/Logo/src/Logo.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yudao-ui-admin-vue3/src/components/Logo/src/Logo.vue b/yudao-ui-admin-vue3/src/components/Logo/src/Logo.vue index f7dffe27b..c446184e1 100644 --- a/yudao-ui-admin-vue3/src/components/Logo/src/Logo.vue +++ b/yudao-ui-admin-vue3/src/components/Logo/src/Logo.vue @@ -59,7 +59,7 @@ watch( :class="[ prefixCls, layout !== 'classic' ? `${prefixCls}__Top` : '', - 'flex !h-[var(--logo-height)] items-center cursor-pointer pl-8px relative', + 'flex !h-[var(--logo-height)] items-center cursor-pointer justify-center relative', 'dark:bg-[var(--el-bg-color)]' ]" to="/" From 882bbb2187f112d817b245cc8d4cdaa57a787ac1 Mon Sep 17 00:00:00 2001 From: xingyu Date: Thu, 21 Jul 2022 11:43:35 +0800 Subject: [PATCH 02/64] fix: router --- yudao-ui-admin-vue3/src/components/UserInfo/src/UserInfo.vue | 2 +- yudao-ui-admin-vue3/src/router/modules/remaining.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/yudao-ui-admin-vue3/src/components/UserInfo/src/UserInfo.vue b/yudao-ui-admin-vue3/src/components/UserInfo/src/UserInfo.vue index 1801e7078..47c48213d 100644 --- a/yudao-ui-admin-vue3/src/components/UserInfo/src/UserInfo.vue +++ b/yudao-ui-admin-vue3/src/components/UserInfo/src/UserInfo.vue @@ -43,7 +43,7 @@ const loginOut = () => { .catch(() => {}) } const toProfile = async () => { - push('/user/profile') + push('/userinfo/profile') } const toDocument = () => { window.open('https://doc.iocoder.cn/') diff --git a/yudao-ui-admin-vue3/src/router/modules/remaining.ts b/yudao-ui-admin-vue3/src/router/modules/remaining.ts index 56536fcf3..92f3a367e 100644 --- a/yudao-ui-admin-vue3/src/router/modules/remaining.ts +++ b/yudao-ui-admin-vue3/src/router/modules/remaining.ts @@ -41,7 +41,7 @@ const remainingRouter: AppRouteRecordRaw[] = [ ] }, { - path: '/user', + path: '/userinfo', component: Layout, name: 'UserInfo', meta: { From cb091d18530703fad0b28f3826411cc0eab0eb79 Mon Sep 17 00:00:00 2001 From: xingyu Date: Thu, 21 Jul 2022 11:43:57 +0800 Subject: [PATCH 03/64] feat: redis api --- .../src/api/infra/redis/index.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/yudao-ui-admin-vue3/src/api/infra/redis/index.ts b/yudao-ui-admin-vue3/src/api/infra/redis/index.ts index 08f0016b6..e9265bd78 100644 --- a/yudao-ui-admin-vue3/src/api/infra/redis/index.ts +++ b/yudao-ui-admin-vue3/src/api/infra/redis/index.ts @@ -23,3 +23,21 @@ export const getKeyListApi = (keyTemplate: string) => { } }) } +// 获取缓存内容 +export const getKeyValue = (key: string) => { + return request.get({ url: '/infra/redis/get-key-value?key=' + key }) +} + +// 根据键名删除缓存 +export const deleteKey = (key: string) => { + return request.delete({ url: '/infra/redis/delete-key?key=' + key }) +} + +export const deleteKeys = (keyTemplate: string) => { + return request.delete({ + url: '/infra/redis/delete-keys?', + params: { + keyTemplate + } + }) +} From 22429140bdb72f522f85cdc17672fab472376392 Mon Sep 17 00:00:00 2001 From: xingyu Date: Thu, 21 Jul 2022 15:02:15 +0800 Subject: [PATCH 04/64] fix: components i18n --- .../src/components/Form/src/helper.ts | 17 ++++------- yudao-ui-admin-vue3/src/config/axios/index.ts | 28 +++++++++++-------- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/yudao-ui-admin-vue3/src/components/Form/src/helper.ts b/yudao-ui-admin-vue3/src/components/Form/src/helper.ts index 2f75322b0..b81409c7e 100644 --- a/yudao-ui-admin-vue3/src/components/Form/src/helper.ts +++ b/yudao-ui-admin-vue3/src/components/Form/src/helper.ts @@ -1,10 +1,8 @@ -// import { useI18n } from '@/hooks/web/useI18n' +import { useI18n } from '@/hooks/web/useI18n' import type { Slots } from 'vue' import { getSlot } from '@/utils/tsxHelper' import { PlaceholderMoel } from './types' -// const { t } = useI18n() - /** * * @param schema 对应组件数据 @@ -12,12 +10,12 @@ import { PlaceholderMoel } from './types' * @description 用于自动设置placeholder */ export const setTextPlaceholder = (schema: FormSchema): PlaceholderMoel => { + const { t } = useI18n() const textMap = ['Input', 'Autocomplete', 'InputNumber', 'InputPassword'] const selectMap = ['Select', 'TimePicker', 'DatePicker', 'TimeSelect', 'TimeSelect'] if (textMap.includes(schema?.component as string)) { return { - // placeholder: t('common.inputText') - placeholder: '请输入' + placeholder: t('common.inputText') } } if (selectMap.includes(schema?.component as string)) { @@ -29,16 +27,13 @@ export const setTextPlaceholder = (schema: FormSchema): PlaceholderMoel => { ) ) { return { - // startPlaceholder: t('common.startTimeText'), - // endPlaceholder: t('common.endTimeText'), - startPlaceholder: '开始时间', - endPlaceholder: '结束时间', + startPlaceholder: t('common.startTimeText'), + endPlaceholder: t('common.endTimeText'), rangeSeparator: '-' } } else { return { - // placeholder: t('common.selectText') - placeholder: '请选择' + placeholder: t('common.selectText') } } } diff --git a/yudao-ui-admin-vue3/src/config/axios/index.ts b/yudao-ui-admin-vue3/src/config/axios/index.ts index e7d1cebce..fe4b2a95a 100644 --- a/yudao-ui-admin-vue3/src/config/axios/index.ts +++ b/yudao-ui-admin-vue3/src/config/axios/index.ts @@ -5,7 +5,6 @@ import { config } from '@/config/axios/config' import { getAccessToken, getRefreshToken, getTenantId } from '@/utils/auth' import errorCode from './errorCode' import { useI18n } from '@/hooks/web/useI18n' -const { t } = useI18n() const tenantEnable = import.meta.env.VITE_APP_TENANT_ENABLE const BASE_URL = import.meta.env.VITE_BASE_URL @@ -46,25 +45,27 @@ service.interceptors.request.use( const tenantId = getTenantId() if (tenantId) (config as Recordable).headers.common['tenant-id'] = tenantId } + const params = config.params || {} + const data = config.data || false if ( - config.method === 'post' && + config.method?.toUpperCase() === 'POST' && config!.headers!['Content-Type'] === 'application/x-www-form-urlencoded' ) { - config.data = qs.stringify(config.data) + config.data = qs.stringify(data) } // get参数编码 - if (config.method === 'get' && config.params) { + if (config.method?.toUpperCase() === 'GET' && config.params) { let url = config.url as string - url += '?' - const keys = Object.keys(config.params) - for (const key of keys) { - if (config.params[key] !== void 0 && config.params[key] !== null) { - url += `${key}=${encodeURIComponent(config.params[key])}&` - } - } // 给 get 请求加上时间戳参数,避免从缓存中拿数据 // const now = new Date().getTime() - // url = url.substring(0, url.length - 1) + `?_t=${now}` + // params = params.substring(0, url.length - 1) + `?_t=${now}` + url += '?' + const keys = Object.keys(params) + for (const key of keys) { + if (params[key] !== void 0 && params[key] !== null) { + url += `${key}=${encodeURIComponent(params[key])}&` + } + } config.params = {} config.url = url } @@ -85,6 +86,7 @@ service.interceptors.response.use( // 返回“[HTTP]请求没有返回值”; throw new Error() } + const { t } = useI18n() // 未设置状态码则默认成功状态 const code = data.code || result_code // 获取错误信息 @@ -134,6 +136,7 @@ service.interceptors.response.use( (error: AxiosError) => { console.log('err' + error) // for debug let { message } = error + const { t } = useI18n() if (message === 'Network Error') { message = t('sys.api.errorMessage') } else if (message.includes('timeout')) { @@ -146,6 +149,7 @@ service.interceptors.response.use( } ) function handleAuthorized() { + const { t } = useI18n() if (!isRelogin.show) { isRelogin.show = true ElMessageBox.confirm(t('sys.api.timeoutMessage'), t('common.confirmTitle'), { From bc233df98035cee8e9791dc7825b797def02db47 Mon Sep 17 00:00:00 2001 From: xingyu Date: Thu, 21 Jul 2022 15:07:04 +0800 Subject: [PATCH 05/64] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=20vue3=20?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=8C=BA=E9=97=B4=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mybatis/core/query/LambdaQueryWrapperX.java | 13 +++++++++++++ .../admin/user/vo/user/UserPageReqVO.java | 4 ++++ .../system/dal/mysql/user/AdminUserMapper.java | 3 ++- .../src/views/system/user/user.data.ts | 4 ++-- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/query/LambdaQueryWrapperX.java b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/query/LambdaQueryWrapperX.java index 463db3038..d9ba7c4be 100644 --- a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/query/LambdaQueryWrapperX.java +++ b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/query/LambdaQueryWrapperX.java @@ -94,6 +94,19 @@ public class LambdaQueryWrapperX extends LambdaQueryWrapper { return this; } + public LambdaQueryWrapperX betweenIfPresent(SFunction column, Object[] values) { + if (values!= null && values.length >0 && values[0] != null && values[1] != null) { + return (LambdaQueryWrapperX) super.between(column, values[0], values[1]); + } + if (values != null && values[0] != null) { + return (LambdaQueryWrapperX) ge(column, values[0]); + } + if (values != null && values[1] != null) { + return (LambdaQueryWrapperX) le(column, values[2]); + } + return this; + } + // ========== 重写父类方法,方便链式调用 ========== @Override diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserPageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserPageReqVO.java index 00f20eb4d..ee539189e 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserPageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserPageReqVO.java @@ -37,6 +37,10 @@ public class UserPageReqVO extends PageParam { @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private Date endTime; + @ApiModelProperty(value = "开始时间", example = "2020-10-24") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private Date[] createTime; + @ApiModelProperty(value = "部门编号", example = "1024", notes = "同时筛选子部门") private Long deptId; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java index b7d5e3daa..353cffab5 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java @@ -33,7 +33,8 @@ public interface AdminUserMapper extends BaseMapperX { .likeIfPresent(AdminUserDO::getUsername, reqVO.getUsername()) .likeIfPresent(AdminUserDO::getMobile, reqVO.getMobile()) .eqIfPresent(AdminUserDO::getStatus, reqVO.getStatus()) - .betweenIfPresent(AdminUserDO::getCreateTime, reqVO.getBeginTime(), reqVO.getEndTime()) + .betweenIfPresent(AdminUserDO::getCreateTime, reqVO.getBeginTime(),reqVO.getEndTime()) + .betweenIfPresent(AdminUserDO::getCreateTime, reqVO.getCreateTime()) .inIfPresent(AdminUserDO::getDeptId, deptIds) .orderByDesc(AdminUserDO::getId)); diff --git a/yudao-ui-admin-vue3/src/views/system/user/user.data.ts b/yudao-ui-admin-vue3/src/views/system/user/user.data.ts index 49d65e267..2039bc9fe 100644 --- a/yudao-ui-admin-vue3/src/views/system/user/user.data.ts +++ b/yudao-ui-admin-vue3/src/views/system/user/user.data.ts @@ -101,7 +101,7 @@ const crudSchemas = reactive([ }, { label: t('common.createTime'), - field: 'daterange', + field: 'createTime', table: { show: false }, @@ -115,7 +115,7 @@ const crudSchemas = reactive([ show: true, component: 'DatePicker', componentProps: { - type: 'daterange', + type: 'datetimerange', valueFormat: 'YYYY-MM-DD HH:mm:ss' } } From 1b2c2b4257de303e32e24c397635a9e5f8d3b65f Mon Sep 17 00:00:00 2001 From: xingyu Date: Thu, 21 Jul 2022 16:51:58 +0800 Subject: [PATCH 06/64] fix: datetimerange type error --- .../src/views/system/dept/index.vue | 5 ++- .../views/system/errorCode/errorCode.data.ts | 17 +------- .../views/system/loginlog/loginLog.data.ts | 17 +------- .../src/views/system/menu/index.vue | 20 +++++---- .../src/views/system/oauth2/client/index.vue | 12 +++++- .../src/views/system/operatelog/index.vue | 2 +- .../system/operatelog/operatelog.data.ts | 42 +++++++++---------- .../src/views/system/role/role.data.ts | 7 +++- .../system/sms/smsChannel/sms.channel.data.ts | 17 +------- .../views/system/sms/smsLog/sms.log.data.ts | 14 +------ .../sms/smsTemplate/sms.template.data.ts | 17 +------- 11 files changed, 62 insertions(+), 108 deletions(-) diff --git a/yudao-ui-admin-vue3/src/views/system/dept/index.vue b/yudao-ui-admin-vue3/src/views/system/dept/index.vue index 1bef630bc..8f3c8fb93 100644 --- a/yudao-ui-admin-vue3/src/views/system/dept/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/dept/index.vue @@ -29,10 +29,10 @@ const formRef = ref() // ========== 创建部门树结构 ========== const filterText = ref('') -const deptOptions = ref([]) // 树形结构 +const deptOptions = ref() // 树形结构 const treeRef = ref>() const getTree = async () => { - const res = await DeptApi.listSimpleDeptApi() + const res = await DeptApi.getDeptPageApi(null) deptOptions.value = handleTree(res) } const filterNode = (value: string, data: Tree) => { @@ -118,6 +118,7 @@ onMounted(async () => { :highlight-current="true" default-expand-all :filter-node-method="filterNode" + :expand-on-click-node="false" > diff --git a/yudao-ui-admin-vue3/src/views/pay/refund/index.vue b/yudao-ui-admin-vue3/src/views/pay/refund/index.vue index 3047d936e..b9253e0fb 100644 --- a/yudao-ui-admin-vue3/src/views/pay/refund/index.vue +++ b/yudao-ui-admin-vue3/src/views/pay/refund/index.vue @@ -26,11 +26,6 @@ const handleExport = async () => { const dialogVisible = ref(false) // 是否显示弹出层 const dialogTitle = ref('edit') // 弹出层标题 -// 删除操作 -const handleDelete = (row: RefundVO) => { - delList(row.id, false) -} - // ========== 详情相关 ========== const detailRef = ref() // 详情 Ref @@ -95,7 +90,7 @@ getList() link type="primary" v-hasPermi="['system:post:delete']" - @click="handleDelete(row)" + @click="delList(row.id, false)" > {{ t('action.del') }} diff --git a/yudao-ui-admin-vue3/src/views/system/dict/index.vue b/yudao-ui-admin-vue3/src/views/system/dict/index.vue index 7c0ddc3ae..a49354591 100644 --- a/yudao-ui-admin-vue3/src/views/system/dict/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/dict/index.vue @@ -38,10 +38,6 @@ const handleTypeUpdate = async (row: DictTypeVO) => { const res = await DictTypeApi.getDictTypeApi(row.id) unref(typeFormRef)?.setValues(res) } -// 字典分类删除操作 -const handleTypeDelete = async (row: DictTypeVO) => { - await delTypeList(row.id, false) -} // ========== 字典数据列表相关 ========== const tableTypeSelect = ref(false) @@ -71,10 +67,6 @@ const handleDataUpdate = async (row: DictDataVO) => { const res = await DictDataApi.getDictDataApi(row.id) unref(dataFormRef)?.setValues(res) } -// 字典数据删除操作 -const handleDataDelete = async (row: DictTypeVO) => { - await delDataList(row.id, false) -} // 字典分类点击行事件 const parentType = ref('') const onClickType = async (data: { [key: string]: any }) => { @@ -195,7 +187,7 @@ onMounted(async () => { link type="primary" v-hasPermi="['system:dict:delete']" - @click="handleTypeDelete(row)" + @click="delTypeList(row.id, false)" > {{ t('action.del') }} @@ -252,7 +244,7 @@ onMounted(async () => { link type="primary" v-hasPermi="['system:dict:delete']" - @click="handleDataDelete(row)" + @click="delDataList(row.id, false)" > {{ t('action.del') }} diff --git a/yudao-ui-admin-vue3/src/views/system/errorCode/index.vue b/yudao-ui-admin-vue3/src/views/system/errorCode/index.vue index 3a04a5800..b35579fd1 100644 --- a/yudao-ui-admin-vue3/src/views/system/errorCode/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/errorCode/index.vue @@ -68,11 +68,6 @@ const submitForm = async () => { } } -// 删除操作 -const handleDelete = (row: ErrorCodeVO) => { - delList(row.id, false) -} - // ========== 详情相关 ========== const detailRef = ref() // 详情 Ref @@ -139,7 +134,7 @@ getList() link type="primary" v-hasPermi="['system:error-code:delete']" - @click="handleDelete(row)" + @click="delList(row.id, false)" > {{ t('action.del') }} diff --git a/yudao-ui-admin-vue3/src/views/system/notice/index.vue b/yudao-ui-admin-vue3/src/views/system/notice/index.vue index 7cd3d928f..44fe19091 100644 --- a/yudao-ui-admin-vue3/src/views/system/notice/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/notice/index.vue @@ -67,11 +67,6 @@ const submitForm = async () => { } } -// 删除操作 -const handleDelete = (row: NoticeVO) => { - delList(row.id, false) -} - // ========== 详情相关 ========== const detailRef = ref() // 详情 Ref @@ -141,7 +136,7 @@ getList() link type="primary" v-hasPermi="['system:notice:delete']" - @click="handleDelete(row)" + @click="delList(row.id, false)" > {{ t('action.del') }} diff --git a/yudao-ui-admin-vue3/src/views/system/oauth2/client/index.vue b/yudao-ui-admin-vue3/src/views/system/oauth2/client/index.vue index fadc430f7..eccb66b0f 100644 --- a/yudao-ui-admin-vue3/src/views/system/oauth2/client/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/oauth2/client/index.vue @@ -68,11 +68,6 @@ const submitForm = async () => { } } -// 删除操作 -const handleDelete = (row: OAuth2ClientVo) => { - delList(row.id, false) -} - // ========== 详情相关 ========== const detailRef = ref() // 详情 Ref @@ -152,7 +147,7 @@ getList() link type="primary" v-hasPermi="['system:oauth2-client:delete']" - @click="handleDelete(row)" + @click="delList(row.id, false)" > {{ t('action.del') }} diff --git a/yudao-ui-admin-vue3/src/views/system/post/index.vue b/yudao-ui-admin-vue3/src/views/system/post/index.vue index ce9e9c3c7..d9fc255a4 100644 --- a/yudao-ui-admin-vue3/src/views/system/post/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/post/index.vue @@ -74,11 +74,6 @@ const submitForm = async () => { } } -// 删除操作 -const handleDelete = (row: PostVO) => { - delList(row.id, false) -} - // ========== 详情相关 ========== const detailRef = ref() // 详情 Ref @@ -153,7 +148,7 @@ getList() link type="primary" v-hasPermi="['system:post:delete']" - @click="handleDelete(row)" + @click="delList(row.id, false)" > {{ t('action.del') }} diff --git a/yudao-ui-admin-vue3/src/views/system/role/index.vue b/yudao-ui-admin-vue3/src/views/system/role/index.vue index 6ec151db0..8606d21ec 100644 --- a/yudao-ui-admin-vue3/src/views/system/role/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/role/index.vue @@ -83,11 +83,6 @@ const submitForm = async () => { } } -// 删除操作 -const handleDelete = (row: RoleVO) => { - delList(row.id, false) -} - // ========== 详情相关 ========== const detailRef = ref() // 详情 Ref @@ -221,7 +216,7 @@ getList() link type="primary" v-hasPermi="['system:role:delete']" - @click="handleDelete(row)" + @click="delList(row.id, false)" > {{ t('action.del') }} diff --git a/yudao-ui-admin-vue3/src/views/system/sensitiveWord/index.vue b/yudao-ui-admin-vue3/src/views/system/sensitiveWord/index.vue index 2f27478f8..22340744f 100644 --- a/yudao-ui-admin-vue3/src/views/system/sensitiveWord/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/sensitiveWord/index.vue @@ -79,11 +79,6 @@ const submitForm = async () => { } } -// 删除操作 -const handleDelete = (row: SensitiveWordVO) => { - delList(row.id, false) -} - // ========== 详情相关 ========== const detailRef = ref() // 详情 Ref @@ -171,7 +166,7 @@ onMounted(async () => { link type="primary" v-hasPermi="['system:post:delete']" - @click="handleDelete(row)" + @click="delList(row.id, false)" > {{ t('action.del') }} diff --git a/yudao-ui-admin-vue3/src/views/system/sms/smsChannel/index.vue b/yudao-ui-admin-vue3/src/views/system/sms/smsChannel/index.vue index c040a92de..083e1cc3d 100644 --- a/yudao-ui-admin-vue3/src/views/system/sms/smsChannel/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/sms/smsChannel/index.vue @@ -68,11 +68,6 @@ const submitForm = async () => { } } -// 删除操作 -const handleDelete = (row: SmsChannelVO) => { - delList(row.id, false) -} - // ========== 详情相关 ========== const detailRef = ref() // 详情 Ref @@ -142,7 +137,7 @@ getList() link type="primary" v-hasPermi="['system:sms-channel:delete']" - @click="handleDelete(row)" + @click="delList(row.id, false)" > {{ t('action.del') }} diff --git a/yudao-ui-admin-vue3/src/views/system/sms/smsTemplate/index.vue b/yudao-ui-admin-vue3/src/views/system/sms/smsTemplate/index.vue index 0c7438fcd..71d455ec5 100644 --- a/yudao-ui-admin-vue3/src/views/system/sms/smsTemplate/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/sms/smsTemplate/index.vue @@ -68,11 +68,6 @@ const submitForm = async () => { } } -// 删除操作 -const handleDelete = (row: SmsTemplateVO) => { - delList(row.id, false) -} - // ========== 详情相关 ========== const detailRef = ref() // 详情 Ref @@ -190,7 +185,7 @@ getList() link type="primary" v-hasPermi="['system:sms-template:delete']" - @click="handleDelete(row)" + @click="delList(row.id, false)" > {{ t('action.del') }} diff --git a/yudao-ui-admin-vue3/src/views/system/tenant/index.vue b/yudao-ui-admin-vue3/src/views/system/tenant/index.vue index dc06064ca..80bf06dc1 100644 --- a/yudao-ui-admin-vue3/src/views/system/tenant/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/tenant/index.vue @@ -97,11 +97,6 @@ const submitForm = async () => { } } -// 删除操作 -const handleDelete = (row: TenantVO) => { - delList(row.id, false) -} - // ========== 详情相关 ========== const detailRef = ref() // 详情 Ref @@ -191,7 +186,7 @@ onMounted(async () => { link type="primary" v-hasPermi="['system:tenant:delete']" - @click="handleDelete(row)" + @click="delList(row.id, false)" > {{ t('action.del') }} diff --git a/yudao-ui-admin-vue3/src/views/system/tenantPackage/index.vue b/yudao-ui-admin-vue3/src/views/system/tenantPackage/index.vue index 8ba75af98..8277327a7 100644 --- a/yudao-ui-admin-vue3/src/views/system/tenantPackage/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/tenantPackage/index.vue @@ -101,11 +101,6 @@ const submitForm = async () => { } } -// 删除操作 -const handleDelete = (row: TenantPackageVO) => { - delList(row.id, false) -} - // ========== 初始化 ========== onMounted(async () => { await getList() @@ -149,7 +144,7 @@ onMounted(async () => { {{ t('action.edit') }} - + {{ t('action.del') }} diff --git a/yudao-ui-admin-vue3/src/views/system/user/index.vue b/yudao-ui-admin-vue3/src/views/system/user/index.vue index 21e7022d5..0d327dc0d 100644 --- a/yudao-ui-admin-vue3/src/views/system/user/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/user/index.vue @@ -164,10 +164,6 @@ const handleResetPwd = (row: UserVO) => { }) }) } -// 删除操作 -const handleDelete = (row: UserVO) => { - delList(row.id, false) -} // 导出操作 const handleExport = async () => { @@ -360,7 +356,7 @@ getList() link type="primary" v-hasPermi="['system:user:delete']" - @click="handleDelete(row)" + @click="delList(row.id, false)" > {{ t('action.del') }} From 4825e3a2e30ba95ab58acdb98ac75d7fd6ab3a59 Mon Sep 17 00:00:00 2001 From: xingyu Date: Thu, 28 Jul 2022 16:13:12 +0800 Subject: [PATCH 53/64] =?UTF-8?q?fix:=20vue-warn=20=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-ui-admin/src/views/bpm/model/index.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yudao-ui-admin/src/views/bpm/model/index.vue b/yudao-ui-admin/src/views/bpm/model/index.vue index a9ddce419..8bc24eccf 100644 --- a/yudao-ui-admin/src/views/bpm/model/index.vue +++ b/yudao-ui-admin/src/views/bpm/model/index.vue @@ -121,7 +121,7 @@ - + @@ -130,7 +130,7 @@ - + From e16f8abc3ae59c03c942b188fcc8e37b8ba01037 Mon Sep 17 00:00:00 2001 From: xingyu Date: Thu, 28 Jul 2022 18:23:09 +0800 Subject: [PATCH 54/64] =?UTF-8?q?refactor=EF=BC=9Avue3=20export=20function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/codegen/vue3/views/index.vue.vm | 7 +------ .../src/views/infra/apiErrorLog/index.vue | 6 +----- yudao-ui-admin-vue3/src/views/infra/config/index.vue | 7 +------ yudao-ui-admin-vue3/src/views/infra/job/JobLog.vue | 6 +----- yudao-ui-admin-vue3/src/views/infra/job/index.vue | 7 +------ yudao-ui-admin-vue3/src/views/pay/app/index.vue | 7 +------ yudao-ui-admin-vue3/src/views/pay/merchant/index.vue | 7 +------ yudao-ui-admin-vue3/src/views/pay/order/index.vue | 6 +----- yudao-ui-admin-vue3/src/views/pay/refund/index.vue | 7 +------ .../src/views/system/operatelog/index.vue | 6 +----- yudao-ui-admin-vue3/src/views/system/post/index.vue | 7 +------ .../src/views/system/sensitiveWord/index.vue | 6 +----- yudao-ui-admin-vue3/src/views/system/tenant/index.vue | 6 +----- yudao-ui-admin-vue3/src/views/system/user/index.vue | 11 +++++------ 14 files changed, 18 insertions(+), 78 deletions(-) diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/index.vue.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/index.vue.vm index 8ed527d0b..7d1b18b4f 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/index.vue.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/index.vue.vm @@ -19,11 +19,6 @@ }) const { getList, setSearchParams, delList, exportList } = methods - // 导出操作 - const handleExport = async () => { - await exportList('数据.xls') - } - // ========== CRUD 相关 ========== const actionLoading = ref(false) // 遮罩层 const actionType = ref('') // 操作按钮的类型 @@ -103,7 +98,7 @@ type="warning" v-hasPermi="['${permissionPrefix}:export']" :loading="tableObject.exportLoading" - @click="handleExport" + @click="exportList('数据.xls')" > {{ t('action.export') }} diff --git a/yudao-ui-admin-vue3/src/views/infra/apiErrorLog/index.vue b/yudao-ui-admin-vue3/src/views/infra/apiErrorLog/index.vue index 7d14768e8..f6d2e44ed 100644 --- a/yudao-ui-admin-vue3/src/views/infra/apiErrorLog/index.vue +++ b/yudao-ui-admin-vue3/src/views/infra/apiErrorLog/index.vue @@ -23,10 +23,6 @@ const { getList, setSearchParams, exportList } = methods const detailRef = ref() // 详情 Ref const dialogVisible = ref(false) // 是否显示弹出层 const dialogTitle = ref('') // 弹出层标题 -// 导出操作 -const handleExport = async () => { - await exportList('错误数据.xls') -} // 详情操作 const handleDetail = (row: ApiErrorLogVO) => { @@ -57,7 +53,7 @@ getList() - + {{ t('action.export') }} diff --git a/yudao-ui-admin-vue3/src/views/infra/config/index.vue b/yudao-ui-admin-vue3/src/views/infra/config/index.vue index e35ee258e..991c47a9b 100644 --- a/yudao-ui-admin-vue3/src/views/infra/config/index.vue +++ b/yudao-ui-admin-vue3/src/views/infra/config/index.vue @@ -19,11 +19,6 @@ const { register, tableObject, methods } = useTable({ }) const { getList, setSearchParams, delList, exportList } = methods -// 导出操作 -const handleExport = async () => { - await exportList('参数配置.xls') -} - // ========== CRUD 相关 ========== const actionLoading = ref(false) // 遮罩层 const actionType = ref('') // 操作按钮的类型 @@ -103,7 +98,7 @@ getList() type="warning" v-hasPermi="['infra:config:export']" :loading="tableObject.exportLoading" - @click="handleExport" + @click="exportList('参数配置.xls')" > {{ t('action.export') }} diff --git a/yudao-ui-admin-vue3/src/views/infra/job/JobLog.vue b/yudao-ui-admin-vue3/src/views/infra/job/JobLog.vue index 477d78a09..1648c8fc3 100644 --- a/yudao-ui-admin-vue3/src/views/infra/job/JobLog.vue +++ b/yudao-ui-admin-vue3/src/views/infra/job/JobLog.vue @@ -25,10 +25,6 @@ const getTableList = async () => { } await getList() } -// 导出操作 -const handleExport = async () => { - await exportList('定时任务日志.xls') -} // ========== CRUD 相关 ========== const dialogVisible = ref(false) // 是否显示弹出层 @@ -63,7 +59,7 @@ onMounted(() => { type="warning" v-hasPermi="['infra:job:export']" :loading="tableObject.exportLoading" - @click="handleExport" + @click="exportList('定时任务日志.xls')" > {{ t('action.export') }} diff --git a/yudao-ui-admin-vue3/src/views/infra/job/index.vue b/yudao-ui-admin-vue3/src/views/infra/job/index.vue index 2830cb69a..14742bbe2 100644 --- a/yudao-ui-admin-vue3/src/views/infra/job/index.vue +++ b/yudao-ui-admin-vue3/src/views/infra/job/index.vue @@ -22,11 +22,6 @@ const { register, tableObject, methods } = useTable({ }) const { getList, setSearchParams, delList, exportList } = methods -// 导出操作 -const handleExport = async () => { - await exportList('定时任务.xls') -} - // ========== CRUD 相关 ========== const actionLoading = ref(false) // 遮罩层 const actionType = ref('') // 操作按钮的类型 @@ -121,7 +116,7 @@ getList() type="warning" v-hasPermi="['infra:job:export']" :loading="tableObject.exportLoading" - @click="handleExport" + @click="exportList('定时任务.xls')" > {{ t('action.export') }} diff --git a/yudao-ui-admin-vue3/src/views/pay/app/index.vue b/yudao-ui-admin-vue3/src/views/pay/app/index.vue index 0d444a873..36ded7be7 100644 --- a/yudao-ui-admin-vue3/src/views/pay/app/index.vue +++ b/yudao-ui-admin-vue3/src/views/pay/app/index.vue @@ -19,11 +19,6 @@ const { register, tableObject, methods } = useTable({ }) const { getList, setSearchParams, delList, exportList } = methods -// 导出操作 -const handleExport = async () => { - await exportList('应用数据.xls') -} - // ========== CRUD 相关 ========== const actionLoading = ref(false) // 遮罩层 const actionType = ref('') // 操作按钮的类型 @@ -103,7 +98,7 @@ getList() type="warning" v-hasPermi="['system:post:export']" :loading="tableObject.exportLoading" - @click="handleExport" + @click="exportList('应用数据.xls')" > {{ t('action.export') }} diff --git a/yudao-ui-admin-vue3/src/views/pay/merchant/index.vue b/yudao-ui-admin-vue3/src/views/pay/merchant/index.vue index b33ed5386..e30cad5ef 100644 --- a/yudao-ui-admin-vue3/src/views/pay/merchant/index.vue +++ b/yudao-ui-admin-vue3/src/views/pay/merchant/index.vue @@ -19,11 +19,6 @@ const { register, tableObject, methods } = useTable({ }) const { getList, setSearchParams, delList, exportList } = methods -// 导出操作 -const handleExport = async () => { - await exportList('商户数据.xls') -} - // ========== CRUD 相关 ========== const actionLoading = ref(false) // 遮罩层 const actionType = ref('') // 操作按钮的类型 @@ -103,7 +98,7 @@ getList() type="warning" v-hasPermi="['system:post:export']" :loading="tableObject.exportLoading" - @click="handleExport" + @click="exportList('商户数据.xls')" > {{ t('action.export') }} diff --git a/yudao-ui-admin-vue3/src/views/pay/order/index.vue b/yudao-ui-admin-vue3/src/views/pay/order/index.vue index c1775bc9d..63a8da7d2 100644 --- a/yudao-ui-admin-vue3/src/views/pay/order/index.vue +++ b/yudao-ui-admin-vue3/src/views/pay/order/index.vue @@ -17,10 +17,6 @@ const { register, tableObject, methods } = useTable({ exportListApi: OrderApi.exportOrderApi }) const { getList, setSearchParams, delList, exportList } = methods -// 导出操作 -const handleExport = async () => { - await exportList('订单数据.xls') -} // ========== CRUD 相关 ========== const actionLoading = ref(false) // 遮罩层 const actionType = ref('') // 操作按钮的类型 @@ -100,7 +96,7 @@ getList() type="warning" v-hasPermi="['pay:order:export']" :loading="tableObject.exportLoading" - @click="handleExport" + @click="exportList('订单数据.xls')" > {{ t('action.export') }} diff --git a/yudao-ui-admin-vue3/src/views/pay/refund/index.vue b/yudao-ui-admin-vue3/src/views/pay/refund/index.vue index b9253e0fb..1f4315099 100644 --- a/yudao-ui-admin-vue3/src/views/pay/refund/index.vue +++ b/yudao-ui-admin-vue3/src/views/pay/refund/index.vue @@ -17,11 +17,6 @@ const { register, tableObject, methods } = useTable({ }) const { getList, setSearchParams, delList, exportList } = methods -// 导出操作 -const handleExport = async () => { - await exportList('退款订单.xls') -} - // ========== CRUD 相关 ========== const dialogVisible = ref(false) // 是否显示弹出层 const dialogTitle = ref('edit') // 弹出层标题 @@ -53,7 +48,7 @@ getList() type="warning" v-hasPermi="['system:post:export']" :loading="tableObject.exportLoading" - @click="handleExport" + @click="exportList('退款订单.xls')" > {{ t('action.export') }} diff --git a/yudao-ui-admin-vue3/src/views/system/operatelog/index.vue b/yudao-ui-admin-vue3/src/views/system/operatelog/index.vue index 2d863f2a8..b190674ba 100644 --- a/yudao-ui-admin-vue3/src/views/system/operatelog/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/operatelog/index.vue @@ -18,10 +18,6 @@ const detailRef = ref() // 详情 Ref const dialogVisible = ref(false) // 是否显示弹出层 const dialogTitle = ref(t('action.detail')) // 弹出层标题 const { getList, setSearchParams, exportList } = methods -// 导出操作 -const handleExport = async () => { - await exportList('操作日志.xls') -} // 详情 const handleDetail = (row: OperateLogVO) => { // 设置数据 @@ -41,7 +37,7 @@ getList() type="warning" v-hasPermi="['system:operate-log:export']" :loading="tableObject.exportLoading" - @click="handleExport" + @click="exportList('操作日志.xls')" > {{ t('action.export') }} diff --git a/yudao-ui-admin-vue3/src/views/system/post/index.vue b/yudao-ui-admin-vue3/src/views/system/post/index.vue index d9fc255a4..3995b6759 100644 --- a/yudao-ui-admin-vue3/src/views/system/post/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/post/index.vue @@ -19,11 +19,6 @@ const { register, tableObject, methods } = useTable({ }) const { getList, setSearchParams, delList, exportList } = methods -// 导出操作 -const handleExport = async () => { - await exportList('岗位数据.xls') -} - // ========== CRUD 相关 ========== const actionLoading = ref(false) // 遮罩层 const actionType = ref('') // 操作按钮的类型 @@ -103,7 +98,7 @@ getList() type="warning" v-hasPermi="['system:post:export']" :loading="tableObject.exportLoading" - @click="handleExport" + @click="exportList('岗位数据.xls')" > {{ t('action.export') }} diff --git a/yudao-ui-admin-vue3/src/views/system/sensitiveWord/index.vue b/yudao-ui-admin-vue3/src/views/system/sensitiveWord/index.vue index 22340744f..69f9f97c5 100644 --- a/yudao-ui-admin-vue3/src/views/system/sensitiveWord/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/sensitiveWord/index.vue @@ -19,10 +19,6 @@ const { register, tableObject, methods } = useTable({ }) const { getList, setSearchParams, delList, exportList } = methods -// 导出操作 -const handleExport = async () => { - await exportList('敏感词数据.xls') -} // 获取标签 const tagsOptions = ref() const getTags = async () => { @@ -111,7 +107,7 @@ onMounted(async () => { type="warning" v-hasPermi="['system:post:export']" :loading="tableObject.exportLoading" - @click="handleExport" + @click="exportList('敏感词数据.xls')" > {{ t('action.export') }} diff --git a/yudao-ui-admin-vue3/src/views/system/tenant/index.vue b/yudao-ui-admin-vue3/src/views/system/tenant/index.vue index 80bf06dc1..76bdf9b9f 100644 --- a/yudao-ui-admin-vue3/src/views/system/tenant/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/tenant/index.vue @@ -21,10 +21,6 @@ const { register, tableObject, methods } = useTable({ }) const { getList, setSearchParams, delList, exportList } = methods -// 导出操作 -const handleExport = async () => { - await exportList('租户数据.xls') -} // ========== 套餐 ========== const tenantPackageId = ref() // 套餐 const tenantPackageOptions = ref([]) //套餐列表 @@ -129,7 +125,7 @@ onMounted(async () => { type="warning" v-hasPermi="['system:tenant:export']" :loading="tableObject.exportLoading" - @click="handleExport" + @click="exportList('租户数据.xls')" > {{ t('action.export') }} diff --git a/yudao-ui-admin-vue3/src/views/system/user/index.vue b/yudao-ui-admin-vue3/src/views/system/user/index.vue index 0d327dc0d..5a9057a74 100644 --- a/yudao-ui-admin-vue3/src/views/system/user/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/user/index.vue @@ -165,11 +165,6 @@ const handleResetPwd = (row: UserVO) => { }) } -// 导出操作 -const handleExport = async () => { - await exportList('用户数据.xls') -} - // ========== 详情相关 ========== const detailRef = ref() @@ -296,7 +291,11 @@ getList() > {{ t('action.import') }} - + {{ t('action.export') }} From 607f6e4bb56e0d3f8602dfdd7e5ee145fb0ef8a6 Mon Sep 17 00:00:00 2001 From: xingyu Date: Thu, 28 Jul 2022 19:10:45 +0800 Subject: [PATCH 55/64] =?UTF-8?q?feat:=20=E9=83=A8=E5=88=86bpm=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/bpm/model/index.ts | 14 +- .../src/api/bpm/model/types.ts | 8 + .../src/api/bpm/processInstance/index.ts | 8 +- .../src/router/modules/remaining.ts | 2 +- .../src/views/bpm/model/index.vue | 217 +++++++++++++++++- .../src/views/bpm/model/model.data.ts | 81 +++++++ .../src/views/bpm/processInstance/index.vue | 122 +++++++++- .../views/bpm/processInstance/process.data.ts | 84 +++++++ 8 files changed, 516 insertions(+), 20 deletions(-) create mode 100644 yudao-ui-admin-vue3/src/views/bpm/model/model.data.ts create mode 100644 yudao-ui-admin-vue3/src/views/bpm/processInstance/process.data.ts diff --git a/yudao-ui-admin-vue3/src/api/bpm/model/index.ts b/yudao-ui-admin-vue3/src/api/bpm/model/index.ts index cc577a7fc..0d95727e4 100644 --- a/yudao-ui-admin-vue3/src/api/bpm/model/index.ts +++ b/yudao-ui-admin-vue3/src/api/bpm/model/index.ts @@ -2,20 +2,20 @@ import { useAxios } from '@/hooks/web/useAxios' import { ModelVO } from './types' const request = useAxios() -export const getModelPage = async (params) => { +export const getModelPageApi = async (params) => { return await request.get({ url: '/bpm/model/page', params }) } -export const getModel = async (id: number) => { +export const getModelApi = async (id: number) => { return await request.get({ url: '/bpm/model/get?id=' + id }) } -export const updateModel = async (data: ModelVO) => { +export const updateModelApi = async (data: ModelVO) => { return await request.put({ url: '/bpm/model/update', data: data }) } // 任务状态修改 -export const updateModelState = async (id: number, state: string) => { +export const updateModelStateApi = async (id: number, state: number) => { const data = { id: id, state: state @@ -23,14 +23,14 @@ export const updateModelState = async (id: number, state: string) => { return await request.put({ url: '/bpm/model/update-state', data: data }) } -export const createModel = async (data: ModelVO) => { +export const createModelApi = async (data: ModelVO) => { return await request.post({ url: '/bpm/model/create', data: data }) } -export const deleteModel = async (id: number) => { +export const deleteModelApi = async (id: number) => { return await request.delete({ url: '/bpm/model/delete?id=' + id }) } -export const deployModel = async (id: number) => { +export const deployModelApi = async (id: number) => { return await request.post({ url: '/bpm/model/deploy?id=' + id }) } diff --git a/yudao-ui-admin-vue3/src/api/bpm/model/types.ts b/yudao-ui-admin-vue3/src/api/bpm/model/types.ts index 96266fab3..36f4aab1b 100644 --- a/yudao-ui-admin-vue3/src/api/bpm/model/types.ts +++ b/yudao-ui-admin-vue3/src/api/bpm/model/types.ts @@ -1,3 +1,10 @@ +export type ProcessDefinitionVO = { + id: string + version: number + deploymentTIme: string + suspensionState: number +} + export type ModelVO = { id: number formName: string @@ -9,6 +16,7 @@ export type ModelVO = { formId: number formCustomCreatePath: string formCustomViewPath: string + processDefinition: ProcessDefinitionVO status: number remark: string createTime: string diff --git a/yudao-ui-admin-vue3/src/api/bpm/processInstance/index.ts b/yudao-ui-admin-vue3/src/api/bpm/processInstance/index.ts index b49dfa615..48715f853 100644 --- a/yudao-ui-admin-vue3/src/api/bpm/processInstance/index.ts +++ b/yudao-ui-admin-vue3/src/api/bpm/processInstance/index.ts @@ -2,15 +2,15 @@ import { useAxios } from '@/hooks/web/useAxios' import { ProcessInstanceVO } from './types' const request = useAxios() -export const getMyProcessInstancePage = async (params) => { +export const getMyProcessInstancePageApi = async (params) => { return await request.get({ url: '/bpm/process-instance/my-page', params }) } -export const createProcessInstance = async (data: ProcessInstanceVO) => { +export const createProcessInstanceApi = async (data: ProcessInstanceVO) => { return await request.post({ url: '/bpm/process-instance/create', data: data }) } -export const cancelProcessInstance = async (id: number, reason: string) => { +export const cancelProcessInstanceApi = async (id: number, reason: string) => { const data = { id: id, reason: reason @@ -18,6 +18,6 @@ export const cancelProcessInstance = async (id: number, reason: string) => { return await request.delete({ url: '/bpm/process-instance/cancel', data: data }) } -export const getProcessInstance = async (id: number) => { +export const getProcessInstanceApi = async (id: number) => { return await request.get({ url: '/bpm/process-instance/get?id=' + id }) } diff --git a/yudao-ui-admin-vue3/src/router/modules/remaining.ts b/yudao-ui-admin-vue3/src/router/modules/remaining.ts index 7c3c524e6..92f3a367e 100644 --- a/yudao-ui-admin-vue3/src/router/modules/remaining.ts +++ b/yudao-ui-admin-vue3/src/router/modules/remaining.ts @@ -72,7 +72,7 @@ const remainingRouter: AppRouteRecordRaw[] = [ children: [ { path: 'edit', - component: () => import('@/views/infra/codegen/components/EditTable.vue'), + component: () => import('@/views/infra/codegen/EditTable.vue'), name: 'EditTable', meta: { noCache: true, diff --git a/yudao-ui-admin-vue3/src/views/bpm/model/index.vue b/yudao-ui-admin-vue3/src/views/bpm/model/index.vue index b03cb75c8..bbf0199e4 100644 --- a/yudao-ui-admin-vue3/src/views/bpm/model/index.vue +++ b/yudao-ui-admin-vue3/src/views/bpm/model/index.vue @@ -1,7 +1,216 @@ - + + + + + + + +
+ + {{ t('action.add') }} + +
+ + + + + + + +
+
- + + +
+ + + + + + +
+ diff --git a/yudao-ui-admin-vue3/src/views/bpm/model/model.data.ts b/yudao-ui-admin-vue3/src/views/bpm/model/model.data.ts new file mode 100644 index 000000000..a1ffaadfc --- /dev/null +++ b/yudao-ui-admin-vue3/src/views/bpm/model/model.data.ts @@ -0,0 +1,81 @@ +import { reactive } from 'vue' +import { useI18n } from '@/hooks/web/useI18n' +import { required } from '@/utils/formRules' +import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas' +import { DICT_TYPE } from '@/utils/dict' +const { t } = useI18n() // 国际化 + +// 表单校验 +export const rules = reactive({ + name: [required] +}) + +// CrudSchema +const crudSchemas = reactive([ + { + label: t('common.index'), + field: 'id', + type: 'index', + form: { + show: false + }, + detail: { + show: false + } + }, + { + label: '流程标识', + field: 'key', + search: { + show: true + } + }, + { + label: '流程名称', + field: 'name', + search: { + show: true + } + }, + { + label: '流程分类', + field: 'category', + dictType: DICT_TYPE.BPM_MODEL_CATEGORY, + search: { + show: true + } + }, + { + label: '表单信息', + field: 'formId' + }, + { + label: '最新部署的流程定义', + field: 'processDefinition', + form: { + show: false + }, + detail: { + show: false + } + }, + { + label: t('common.createTime'), + field: 'createTime', + form: { + show: false + } + }, + { + label: t('table.action'), + field: 'action', + width: '240px', + form: { + show: false + }, + detail: { + show: false + } + } +]) +export const { allSchemas } = useCrudSchemas(crudSchemas) diff --git a/yudao-ui-admin-vue3/src/views/bpm/processInstance/index.vue b/yudao-ui-admin-vue3/src/views/bpm/processInstance/index.vue index b03cb75c8..a49d911f3 100644 --- a/yudao-ui-admin-vue3/src/views/bpm/processInstance/index.vue +++ b/yudao-ui-admin-vue3/src/views/bpm/processInstance/index.vue @@ -1,7 +1,121 @@ - + + + + + + + +
+ + {{ t('action.add') }} + +
+ + + + + +
+
- + + + + + + + + + + diff --git a/yudao-ui-admin-vue3/src/views/bpm/processInstance/process.data.ts b/yudao-ui-admin-vue3/src/views/bpm/processInstance/process.data.ts new file mode 100644 index 000000000..dff3dc076 --- /dev/null +++ b/yudao-ui-admin-vue3/src/views/bpm/processInstance/process.data.ts @@ -0,0 +1,84 @@ +import { reactive } from 'vue' +import { useI18n } from '@/hooks/web/useI18n' +import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas' +import { DICT_TYPE } from '@/utils/dict' +const { t } = useI18n() // 国际化 + +// CrudSchema +const crudSchemas = reactive([ + { + label: t('common.index'), + field: 'id', + type: 'index', + form: { + show: false + }, + detail: { + show: false + } + }, + { + label: '流程名', + field: 'name', + search: { + show: true + } + }, + { + label: '流程分类', + field: 'category', + dictType: DICT_TYPE.BPM_MODEL_CATEGORY, + search: { + show: true + } + }, + { + label: '当前审批任务', + field: 'tasks' + }, + { + label: t('common.status'), + field: 'status', + dictType: DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS, + search: { + show: true + } + }, + { + label: '结果', + field: 'result', + dictType: DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT, + search: { + show: true + } + }, + { + label: '提交时间', + field: 'createTime', + form: { + show: false + }, + search: { + show: true + } + }, + { + label: '结束时间', + field: 'endTime', + form: { + show: false + } + }, + { + label: t('table.action'), + field: 'action', + width: '240px', + form: { + show: false + }, + detail: { + show: false + } + } +]) +export const { allSchemas } = useCrudSchemas(crudSchemas) From 291f31be98f5586a7265413a3b084c18b241c2ac Mon Sep 17 00:00:00 2001 From: xingyu Date: Thu, 28 Jul 2022 21:40:15 +0800 Subject: [PATCH 56/64] refactor: codegen --- .../src/api/infra/codegen/index.ts | 6 +- .../src/api/infra/codegen/types.ts | 11 ++- .../src/components/DictTag/src/DictTag.vue | 65 ++++++-------- .../codegen/{components => }/EditTable.vue | 38 +++++---- .../codegen/components/BasicInfoForm.vue | 10 +-- .../codegen/components/CloumInfoForm.vue | 85 +++++++++---------- .../infra/codegen/components/GenInfoForm.vue | 18 ++-- .../infra/codegen/components/ImportTable.vue | 17 ++-- .../views/infra/codegen/components/index.ts | 3 +- 9 files changed, 127 insertions(+), 126 deletions(-) rename yudao-ui-admin-vue3/src/views/infra/codegen/{components => }/EditTable.vue (57%) diff --git a/yudao-ui-admin-vue3/src/api/infra/codegen/index.ts b/yudao-ui-admin-vue3/src/api/infra/codegen/index.ts index dbce9518b..8b4c30f97 100644 --- a/yudao-ui-admin-vue3/src/api/infra/codegen/index.ts +++ b/yudao-ui-admin-vue3/src/api/infra/codegen/index.ts @@ -1,5 +1,5 @@ import { useAxios } from '@/hooks/web/useAxios' -import type { CodegenTableVO } from './types' +import type { CodegenUpdateReqVO, CodegenCreateListReqVO } from './types' const request = useAxios() @@ -14,12 +14,12 @@ export const getCodegenTableApi = (id: number) => { } // 新增代码生成表定义 -export const createCodegenTableApi = (data: CodegenTableVO) => { +export const createCodegenTableApi = (data: CodegenCreateListReqVO) => { return request.post({ url: '/infra/codegen/create', data }) } // 修改代码生成表定义 -export const updateCodegenTableApi = (data: CodegenTableVO) => { +export const updateCodegenTableApi = (data: CodegenUpdateReqVO) => { return request.put({ url: '/infra/codegen/update', data }) } diff --git a/yudao-ui-admin-vue3/src/api/infra/codegen/types.ts b/yudao-ui-admin-vue3/src/api/infra/codegen/types.ts index 237be1488..d4f87f3a9 100644 --- a/yudao-ui-admin-vue3/src/api/infra/codegen/types.ts +++ b/yudao-ui-admin-vue3/src/api/infra/codegen/types.ts @@ -1,5 +1,6 @@ export type CodegenTableVO = { - id: number + tableId: number + isParentMenuIdValid: boolean dataSourceConfigId: number scene: number tableName: string @@ -49,3 +50,11 @@ export type CodegenPreviewVO = { filePath: string code: string } +export type CodegenUpdateReqVO = { + table: CodegenTableVO + columns: CodegenColumnVO[] +} +export type CodegenCreateListReqVO = { + dataSourceConfigId: number + tableNames: string[] +} diff --git a/yudao-ui-admin-vue3/src/components/DictTag/src/DictTag.vue b/yudao-ui-admin-vue3/src/components/DictTag/src/DictTag.vue index 05f123040..0ad3ec69a 100644 --- a/yudao-ui-admin-vue3/src/components/DictTag/src/DictTag.vue +++ b/yudao-ui-admin-vue3/src/components/DictTag/src/DictTag.vue @@ -1,47 +1,34 @@ -