review:【antd/ele】【bpm】流程模型的迁移
This commit is contained in:
@@ -92,11 +92,8 @@ async function onSubmit() {
|
|||||||
? updateLeave(submitData)
|
? updateLeave(submitData)
|
||||||
: createLeave(submitData));
|
: createLeave(submitData));
|
||||||
// 关闭并提示
|
// 关闭并提示
|
||||||
message.success({
|
message.success($t('ui.actionMessage.operationSuccess'));
|
||||||
content: $t('ui.actionMessage.operationSuccess'),
|
await closeCurrentTab();
|
||||||
key: 'action_process_msg',
|
|
||||||
});
|
|
||||||
closeCurrentTab();
|
|
||||||
await router.push({
|
await router.push({
|
||||||
name: 'BpmOALeave',
|
name: 'BpmOALeave',
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||||
import type { BpmOALeaveApi } from '#/api/bpm/oa/leave';
|
import type { BpmOALeaveApi } from '#/api/bpm/oa/leave';
|
||||||
|
|
||||||
import { h } from 'vue';
|
import { h, onActivated } from 'vue';
|
||||||
|
|
||||||
import { DocAlert, Page, prompt } from '@vben/common-ui';
|
import { DocAlert, Page, prompt } from '@vben/common-ui';
|
||||||
import { BpmProcessInstanceStatus } from '@vben/constants';
|
import { BpmProcessInstanceStatus } from '@vben/constants';
|
||||||
@@ -17,7 +17,6 @@ import { router } from '#/router';
|
|||||||
|
|
||||||
import { useGridColumns, useGridFormSchema } from './data';
|
import { useGridColumns, useGridFormSchema } from './data';
|
||||||
|
|
||||||
// TODO @jason:这里是不是要迁移下?
|
|
||||||
/** 刷新表格 */
|
/** 刷新表格 */
|
||||||
function handleRefresh() {
|
function handleRefresh() {
|
||||||
gridApi.query();
|
gridApi.query();
|
||||||
@@ -127,6 +126,11 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||||||
},
|
},
|
||||||
} as VxeTableGridOptions<BpmOALeaveApi.Leave>,
|
} as VxeTableGridOptions<BpmOALeaveApi.Leave>,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/** 激活时 */
|
||||||
|
onActivated(() => {
|
||||||
|
handleRefresh();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -60,7 +60,6 @@ function deleteHttpRequestParam(arr: HttpRequestParam[], index: number) {
|
|||||||
:key="index"
|
:key="index"
|
||||||
class="mb-2 flex items-center gap-2"
|
class="mb-2 flex items-center gap-2"
|
||||||
>
|
>
|
||||||
<!-- 参数名 -->
|
|
||||||
<div class="w-[26%] min-w-32 shrink-0">
|
<div class="w-[26%] min-w-32 shrink-0">
|
||||||
<ElFormItem
|
<ElFormItem
|
||||||
:prop="`${bind}.header.${index}.key`"
|
:prop="`${bind}.header.${index}.key`"
|
||||||
@@ -73,8 +72,6 @@ function deleteHttpRequestParam(arr: HttpRequestParam[], index: number) {
|
|||||||
<ElInput placeholder="参数名不能为空" v-model="item.key" />
|
<ElInput placeholder="参数名不能为空" v-model="item.key" />
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 类型选择 -->
|
|
||||||
<div class="w-[24%] min-w-11 shrink-0">
|
<div class="w-[24%] min-w-11 shrink-0">
|
||||||
<ElFormItem class="w-full">
|
<ElFormItem class="w-full">
|
||||||
<ElSelect v-model="item.type">
|
<ElSelect v-model="item.type">
|
||||||
@@ -87,8 +84,6 @@ function deleteHttpRequestParam(arr: HttpRequestParam[], index: number) {
|
|||||||
</ElSelect>
|
</ElSelect>
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 参数值 -->
|
|
||||||
<div class="w-[42%] flex-1">
|
<div class="w-[42%] flex-1">
|
||||||
<ElFormItem
|
<ElFormItem
|
||||||
:prop="`${bind}.header.${index}.value`"
|
:prop="`${bind}.header.${index}.value`"
|
||||||
@@ -125,8 +120,6 @@ function deleteHttpRequestParam(arr: HttpRequestParam[], index: number) {
|
|||||||
</ElSelect>
|
</ElSelect>
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 删除按钮 -->
|
|
||||||
<div class="flex w-[8%] shrink-0 items-center">
|
<div class="flex w-[8%] shrink-0 items-center">
|
||||||
<IconifyIcon
|
<IconifyIcon
|
||||||
class="size-4 cursor-pointer text-red-500"
|
class="size-4 cursor-pointer text-red-500"
|
||||||
@@ -150,7 +143,6 @@ function deleteHttpRequestParam(arr: HttpRequestParam[], index: number) {
|
|||||||
:key="index"
|
:key="index"
|
||||||
class="mb-2 flex items-center gap-2"
|
class="mb-2 flex items-center gap-2"
|
||||||
>
|
>
|
||||||
<!-- 参数名 -->
|
|
||||||
<div class="w-[26%] min-w-32 shrink-0">
|
<div class="w-[26%] min-w-32 shrink-0">
|
||||||
<ElFormItem
|
<ElFormItem
|
||||||
:prop="`${bind}.body.${index}.key`"
|
:prop="`${bind}.body.${index}.key`"
|
||||||
@@ -163,8 +155,6 @@ function deleteHttpRequestParam(arr: HttpRequestParam[], index: number) {
|
|||||||
<ElInput placeholder="参数名" v-model="item.key" />
|
<ElInput placeholder="参数名" v-model="item.key" />
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 类型选择 -->
|
|
||||||
<div class="w-[24%] min-w-11 shrink-0">
|
<div class="w-[24%] min-w-11 shrink-0">
|
||||||
<ElFormItem>
|
<ElFormItem>
|
||||||
<ElSelect v-model="item.type">
|
<ElSelect v-model="item.type">
|
||||||
@@ -177,8 +167,6 @@ function deleteHttpRequestParam(arr: HttpRequestParam[], index: number) {
|
|||||||
</ElSelect>
|
</ElSelect>
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 参数值 -->
|
|
||||||
<div class="w-[42%] flex-1">
|
<div class="w-[42%] flex-1">
|
||||||
<ElFormItem
|
<ElFormItem
|
||||||
:prop="`${bind}.body.${index}.value`"
|
:prop="`${bind}.body.${index}.value`"
|
||||||
@@ -215,8 +203,6 @@ function deleteHttpRequestParam(arr: HttpRequestParam[], index: number) {
|
|||||||
</ElSelect>
|
</ElSelect>
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 删除按钮 -->
|
|
||||||
<div class="flex w-[8%] shrink-0 items-center">
|
<div class="flex w-[8%] shrink-0 items-center">
|
||||||
<IconifyIcon
|
<IconifyIcon
|
||||||
class="size-4 cursor-pointer text-red-500"
|
class="size-4 cursor-pointer text-red-500"
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { FormRules } from 'element-plus';
|
import type { FormRules } from 'element-plus';
|
||||||
// SelectValue type removed - use string | number | boolean directly
|
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
FormTriggerSetting,
|
FormTriggerSetting,
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ async function onSubmit() {
|
|||||||
: createLeave(submitData));
|
: createLeave(submitData));
|
||||||
// 关闭并提示
|
// 关闭并提示
|
||||||
ElMessage.success($t('ui.actionMessage.operationSuccess'));
|
ElMessage.success($t('ui.actionMessage.operationSuccess'));
|
||||||
closeCurrentTab();
|
await closeCurrentTab();
|
||||||
await router.push({
|
await router.push({
|
||||||
name: 'BpmOALeave',
|
name: 'BpmOALeave',
|
||||||
});
|
});
|
||||||
@@ -172,8 +172,8 @@ function selectUserConfirm(id: string, userList: any[]) {
|
|||||||
|
|
||||||
/** 获取请假数据,用于重新发起时自动填充 */
|
/** 获取请假数据,用于重新发起时自动填充 */
|
||||||
async function getDetail(id: number) {
|
async function getDetail(id: number) {
|
||||||
formLoading.value = true;
|
|
||||||
try {
|
try {
|
||||||
|
formLoading.value = true;
|
||||||
const data = await getLeave(id);
|
const data = await getLeave(id);
|
||||||
if (!data) {
|
if (!data) {
|
||||||
ElMessage.error('重新发起请假失败,原因:请假数据不存在');
|
ElMessage.error('重新发起请假失败,原因:请假数据不存在');
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||||
import type { BpmOALeaveApi } from '#/api/bpm/oa/leave';
|
import type { BpmOALeaveApi } from '#/api/bpm/oa/leave';
|
||||||
|
|
||||||
import { onActivated } from 'vue';
|
import { onActivated } from 'vue';
|
||||||
@@ -106,10 +107,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||||||
keepSource: true,
|
keepSource: true,
|
||||||
proxyConfig: {
|
proxyConfig: {
|
||||||
ajax: {
|
ajax: {
|
||||||
query: async (
|
query: async ({ page }, formValues) => {
|
||||||
{ page }: { page: { currentPage: number; pageSize: number } },
|
|
||||||
formValues: Record<string, any>,
|
|
||||||
) => {
|
|
||||||
return await getLeavePage({
|
return await getLeavePage({
|
||||||
pageNo: page.currentPage,
|
pageNo: page.currentPage,
|
||||||
pageSize: page.pageSize,
|
pageSize: page.pageSize,
|
||||||
@@ -126,7 +124,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||||||
refresh: true,
|
refresh: true,
|
||||||
search: true,
|
search: true,
|
||||||
},
|
},
|
||||||
},
|
} as VxeTableGridOptions<BpmOALeaveApi.Leave>,
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 激活时 */
|
/** 激活时 */
|
||||||
|
|||||||
Reference in New Issue
Block a user