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