update: 升级前端核心依赖并完成适配

- 升级 Vue、Vue Router、Element Plus、Vite、UnoCSS、Sass、vue-tsc、oxlint 等前端核心依赖
- 适配依赖升级后的类型检查、键盘事件和 Sass 命名空间写法
- 登录记住功能仅保存用户名和 rememberMe,不再保存密码
- 移除模板中的 scope.row 类型断言,改由处理函数使用 Partial<VO> 承接
This commit is contained in:
疯狂的狮子Li 2026-06-08 18:40:47 +08:00
parent 46fbc9db0b
commit 979bad0275
34 changed files with 1295 additions and 1178 deletions

View File

@ -618,7 +618,7 @@ const { resetQuery } = useSearchReset({
});
/** 新增按钮操作 */
const handleAdd = (row?: ${BusinessName}VO) => {
const handleAdd = (row?: Partial<${BusinessName}VO>) => {
openDialog('添加${functionName}');
getTreeselect();
if (row != null && row.${treeCode}) {
@ -629,7 +629,7 @@ const handleAdd = (row?: ${BusinessName}VO) => {
};
/** 修改按钮操作 */
const handleUpdate = async (row: ${BusinessName}VO) => {
const handleUpdate = async (row: Partial<${BusinessName}VO>) => {
reset();
await getTreeselect(row.${treeCode});
if (row != null) {
@ -668,7 +668,7 @@ const submitForm = () => {
};
/** 删除按钮操作 */
const handleDelete = async (row: ${BusinessName}VO) => {
const handleDelete = async (row: Partial<${BusinessName}VO>) => {
await modal.confirm('是否确认删除${functionName}编号为"' + row.${pkColumn.javaField} + '"的数据项?');
setLoading(true);
await del${BusinessName}(row.${pkColumn.javaField}).finally(() => setLoading(false));
@ -687,7 +687,7 @@ const filterTreeOptions = (options: ${BusinessName}Option[], excludeId: string |
#if($enableStatus)
/** 状态修改 */
const handleStatusChange = async (row: ${BusinessName}VO) => {
const handleStatusChange = async (row: Partial<${BusinessName}VO>) => {
const text = row.${statusField} === ${statusField}ActiveValue ? '启用' : '停用';
try {
await modal.confirm('确认要"' + text + '"吗?');
@ -701,7 +701,7 @@ const handleStatusChange = async (row: ${BusinessName}VO) => {
#if($enableSort)
/** 排序调整 */
const handleSortChange = async (row: ${BusinessName}VO) => {
const handleSortChange = async (row: Partial<${BusinessName}VO>) => {
try {
await update${BusinessName}Sort(row.${pkColumn.javaField}, row.${sortField});
modal.msgSuccess('排序更新成功');

View File

@ -561,7 +561,7 @@ const handleAdd = () => {
};
/** 修改按钮操作 */
const handleUpdate = async (row?: ${BusinessName}VO) => {
const handleUpdate = async (row?: Partial<${BusinessName}VO>) => {
reset();
const _${pkColumn.javaField} = row?.${pkColumn.javaField} || ids.value[0];
const res = await get${BusinessName}(_${pkColumn.javaField});
@ -597,7 +597,7 @@ const submitForm = () => {
};
/** 删除按钮操作 */
const handleDelete = async (row?: ${BusinessName}VO) => {
const handleDelete = async (row?: Partial<${BusinessName}VO>) => {
const _${pkColumn.javaField}s = row?.${pkColumn.javaField} || ids.value;
await modal.confirm('是否确认删除${functionName}编号为"' + _${pkColumn.javaField}s + '"的数据项?');
await del${BusinessName}(_${pkColumn.javaField}s);
@ -620,7 +620,7 @@ const handleExport = () => {
#if($enableStatus)
/** 状态修改 */
const handleStatusChange = async (row: ${BusinessName}VO) => {
const handleStatusChange = async (row: Partial<${BusinessName}VO>) => {
const text = row.${statusField} === ${statusField}ActiveValue ? '启用' : '停用';
try {
await modal.confirm('确认要"' + text + '"吗?');
@ -634,7 +634,7 @@ const handleStatusChange = async (row: ${BusinessName}VO) => {
#if($enableSort)
/** 排序调整 */
const handleSortChange = async (row: ${BusinessName}VO) => {
const handleSortChange = async (row: Partial<${BusinessName}VO>) => {
try {
await update${BusinessName}Sort(row.${pkColumn.javaField}, row.${sortField});
modal.msgSuccess('排序更新成功');

View File

@ -24,48 +24,48 @@
"@highlightjs/vue-plugin": "2.1.2",
"@iconify/vue": "^5.0.1",
"@vueuse/core": "14.3.0",
"@wangeditor-next/editor": "5.7.3",
"@wangeditor-next/editor": "5.7.10",
"@wangeditor-next/editor-for-vue": "5.1.14",
"animate.css": "4.1.1",
"await-to-js": "3.0.0",
"axios": "1.16.1",
"axios": "1.17.0",
"crypto-js": "4.2.0",
"echarts": "6.1.0",
"element-plus": "2.14.0",
"element-plus": "2.14.1",
"highlight.js": "11.11.1",
"image-conversion": "2.1.1",
"jsencrypt": "3.5.4",
"nprogress": "0.2.0",
"pinia": "3.0.4",
"vue": "3.5.34",
"vue": "3.5.35",
"vue-cropper": "1.1.4",
"vue-i18n": "11.4.4",
"vue-i18n": "11.4.5",
"vue-json-pretty": "2.6.0",
"vue-router": "5.0.7",
"vue-types": "6.0.0",
"vxe-table": "4.18.13"
"vue-router": "5.1.0",
"vue-types": "7.0.0",
"vxe-table": "4.19.10"
},
"devDependencies": {
"@types/crypto-js": "4.2.2",
"@types/node": "^25.9.1",
"@types/node": "^25.9.2",
"@types/nprogress": "0.2.3",
"@unocss/preset-attributify": "66.6.8",
"@unocss/preset-wind3": "66.6.8",
"@unocss/preset-attributify": "66.7.0",
"@unocss/preset-wind3": "66.7.0",
"@vitejs/plugin-vue": "^6.0.7",
"@vue/compiler-sfc": "3.5.34",
"@vue/compiler-sfc": "3.5.35",
"autoprefixer": "10.5.0",
"oxfmt": "^0.51.0",
"oxlint": "^1.66.0",
"sass": "1.99.0",
"oxfmt": "^0.53.0",
"oxlint": "^1.68.0",
"sass": "1.100.0",
"typescript": "^6.0.3",
"unocss": "66.6.8",
"unocss": "66.7.0",
"unplugin-auto-import": "21.0.0",
"unplugin-vue-components": "32.1.0",
"unplugin-vue-setup-extend-plus": "1.0.1",
"vite": "^8.0.13",
"vite": "^8.0.16",
"vite-plugin-svg-icons-ng": "^1.9.1",
"vitest": "4.1.6",
"vue-tsc": "^3.3.1"
"vitest": "4.1.8",
"vue-tsc": "^3.3.4"
},
"browserslist": [
"Chrome >= 87",

1962
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -16,9 +16,7 @@
clearable
placeholder="菜单搜索支持标题、URL模糊查询"
@input="querySearch"
@keydown.up.prevent="navigateResult('up')"
@keydown.down.prevent="navigateResult('down')"
@keydown.enter.prevent="selectActiveResult"
@keydown="handleSearchKeydown"
>
<template #prefix>
<svg-icon class-name="search-icon" icon-class="search" />
@ -215,6 +213,23 @@ const navigateResult = (direction: 'up' | 'down') => {
state.activeIndex = state.activeIndex >= state.options.length - 1 ? 0 : state.activeIndex + 1;
};
const handleSearchKeydown = (event: KeyboardEvent) => {
if (event.key === 'ArrowUp') {
event.preventDefault();
navigateResult('up');
return;
}
if (event.key === 'ArrowDown') {
event.preventDefault();
navigateResult('down');
return;
}
if (event.key === 'Enter') {
event.preventDefault();
selectActiveResult();
}
};
const selectActiveResult = () => {
if (state.options.length === 0) {
return;

View File

@ -1,35 +1,35 @@
import type * as ep from 'element-plus';
declare global {
declare type ElTagType = 'primary' | 'success' | 'info' | 'warning' | 'danger';
declare type ElFormInstance = ep.FormInstance;
declare type ElTableInstance = ep.TableInstance;
declare type ElUploadInstance = ep.UploadInstance;
declare type ElScrollbarInstance = ep.ScrollbarInstance;
declare type ElInputInstance = ep.InputInstance;
declare type ElInputNumberInstance = ep.InputNumberInstance;
declare type ElRadioInstance = ep.RadioInstance;
declare type ElRadioGroupInstance = ep.RadioGroupInstance;
declare type ElRadioButtonInstance = ep.RadioButtonInstance;
declare type ElCheckboxInstance = ep.CheckboxInstance;
declare type ElSwitchInstance = ep.SwitchInstance;
declare type ElCascaderInstance = ep.CascaderInstance;
declare type ElColorPickerInstance = ep.ColorPickerInstance;
declare type ElRateInstance = ep.RateInstance;
declare type ElSliderInstance = ep.SliderInstance;
type ElTagType = 'primary' | 'success' | 'info' | 'warning' | 'danger';
type ElFormInstance = ep.FormInstance;
type ElTableInstance = ep.TableInstance;
type ElUploadInstance = ep.UploadInstance;
type ElScrollbarInstance = ep.ScrollbarInstance;
type ElInputInstance = ep.InputInstance;
type ElInputNumberInstance = ep.InputNumberInstance;
type ElRadioInstance = ep.RadioInstance;
type ElRadioGroupInstance = ep.RadioGroupInstance;
type ElRadioButtonInstance = ep.RadioButtonInstance;
type ElCheckboxInstance = ep.CheckboxInstance;
type ElSwitchInstance = ep.SwitchInstance;
type ElCascaderInstance = ep.CascaderInstance;
type ElColorPickerInstance = ep.ColorPickerInstance;
type ElRateInstance = ep.RateInstance;
type ElSliderInstance = ep.SliderInstance;
declare type ElTreeInstance = InstanceType<typeof ep.ElTree>;
declare type ElTreeSelectInstance = InstanceType<typeof ep.ElTreeSelect>;
declare type ElSelectInstance = InstanceType<typeof ep.ElSelect>;
declare type ElCardInstance = InstanceType<typeof ep.ElCard>;
declare type ElDialogInstance = InstanceType<typeof ep.ElDialog>;
declare type ElCheckboxGroupInstance = InstanceType<typeof ep.ElCheckboxGroup>;
declare type ElDatePickerInstance = InstanceType<typeof ep.ElDatePicker>;
declare type ElTimePickerInstance = InstanceType<typeof ep.ElTimePicker>;
declare type ElTimeSelectInstance = InstanceType<typeof ep.ElTimeSelect>;
type ElTreeInstance = InstanceType<typeof ep.ElTree>;
type ElTreeSelectInstance = InstanceType<typeof ep.ElTreeSelect>;
type ElSelectInstance = InstanceType<typeof ep.ElSelect>;
type ElCardInstance = InstanceType<typeof ep.ElCard>;
type ElDialogInstance = InstanceType<typeof ep.ElDialog>;
type ElCheckboxGroupInstance = InstanceType<typeof ep.ElCheckboxGroup>;
type ElDatePickerInstance = InstanceType<typeof ep.ElDatePicker>;
type ElTimePickerInstance = InstanceType<typeof ep.ElTimePicker>;
type ElTimeSelectInstance = InstanceType<typeof ep.ElTimeSelect>;
declare type TransferKey = ep.TransferKey;
declare type CheckboxValueType = ep.CheckboxValueType;
declare type ElFormRules = ep.FormRules;
declare type DateModelType = ep.DateModelType;
declare type UploadFile = ep.UploadFile;
type TransferKey = ep.TransferKey;
type CheckboxValueType = ep.CheckboxValueType;
type ElFormRules = ep.FormRules;
type DateModelType = ep.DateModelType;
type UploadFile = ep.UploadFile;
}

22
src/types/global.d.ts vendored
View File

@ -4,12 +4,12 @@ import { NavTypeEnum } from '@/enums/NavTypeEnum';
declare global {
/** vue Instance */
declare type ComponentInternalInstance = ComponentInstance;
type ComponentInternalInstance = ComponentInstance;
/**
*
*/
declare interface FieldOption {
interface FieldOption {
key: number;
label: string;
visible: boolean;
@ -19,7 +19,7 @@ declare global {
/**
*
*/
declare interface DialogOption {
interface DialogOption {
/**
*
*/
@ -30,7 +30,7 @@ declare global {
visible: boolean;
}
declare interface UploadOption {
interface UploadOption {
/** 设置上传的请求头部 */
headers: { [key: string]: any };
@ -41,7 +41,7 @@ declare global {
/**
*
*/
declare interface ImportOption extends UploadOption {
interface ImportOption extends UploadOption {
/** 是否显示弹出层 */
open: boolean;
/** 弹出层标题 */
@ -57,14 +57,14 @@ declare global {
/**
*
*/
declare interface DictDataOption {
interface DictDataOption {
label: string;
value: string;
elTagType?: ElTagType;
elTagClass?: string;
}
declare interface BaseEntity {
interface BaseEntity {
createBy?: any;
createDept?: any;
createTime?: string;
@ -77,7 +77,7 @@ declare global {
* T : 表单数据
* D : 查询参数
*/
declare interface PageData<T, D> {
interface PageData<T, D> {
form: T;
queryParams: D;
rules: ElFormRules;
@ -85,11 +85,11 @@ declare global {
/**
*
*/
declare interface PageQuery {
interface PageQuery {
pageNum: number;
pageSize: number;
}
declare interface LayoutSetting {
interface LayoutSetting {
/**
*
*/
@ -133,7 +133,7 @@ declare global {
radiusBase: number;
}
declare interface DefaultSettings extends LayoutSetting {
interface DefaultSettings extends LayoutSetting {
/**
*
*/

View File

@ -186,7 +186,13 @@ const data = reactive<PageData<DemoForm, DemoQuery>>({
const { queryParams, form, rules } = toRefs(data);
const { ids, single, multiple, handleSelectionChange } = useTableSelection<DemoVO>(item => item.id);
const { dialog, resetForm: reset, openDialog, showDialog, closeDialog } = useFormDialog({
const {
dialog,
resetForm: reset,
openDialog,
showDialog,
closeDialog
} = useFormDialog({
form,
formRef: demoFormRef,
initialFormData: initFormData
@ -228,7 +234,7 @@ const handleAdd = () => {
};
/** 修改按钮操作 */
const handleUpdate = async (row?: DemoVO) => {
const handleUpdate = async (row?: Partial<DemoVO>) => {
reset();
const demoId = row?.id || ids.value[0];
const res = await getDemo(demoId);
@ -254,7 +260,7 @@ const submitForm = () => {
};
/** 删除按钮操作 */
const handleDelete = async (row?: DemoVO) => {
const handleDelete = async (row?: Partial<DemoVO>) => {
const demoIds = row?.id || ids.value;
await modal.confirm('是否确认删除测试单编号为"' + demoIds + '"的数据项?');
await delDemo(demoIds);

View File

@ -170,7 +170,13 @@ const data = reactive<PageData<TreeForm, TreeQuery>>({
});
const { queryParams, form, rules } = toRefs(data);
const { dialog, resetForm: reset, openDialog, showDialog, closeDialog } = useFormDialog({
const {
dialog,
resetForm: reset,
openDialog,
showDialog,
closeDialog
} = useFormDialog({
form,
formRef: treeFormRef,
initialFormData: initFormData
@ -216,7 +222,7 @@ const { resetQuery } = useSearchReset({
});
/** 新增按钮操作 */
const handleAdd = (row?: TreeVO) => {
const handleAdd = (row?: Partial<TreeVO>) => {
openDialog('添加测试树');
getTreeselect();
if (row && row.id) {
@ -227,7 +233,7 @@ const handleAdd = (row?: TreeVO) => {
};
/** 修改按钮操作 */
const handleUpdate = async (row: TreeVO) => {
const handleUpdate = async (row: Partial<TreeVO>) => {
reset();
await getTreeselect();
if (row) {
@ -256,7 +262,7 @@ const submitForm = () => {
};
/** 删除按钮操作 */
const handleDelete = async (row: TreeVO) => {
const handleDelete = async (row: Partial<TreeVO>) => {
await modal.confirm('是否确认删除测试树编号为"' + row.id + '"的数据项?');
setLoading(true);
await delTree(row.id).finally(() => setLoading(false));

View File

@ -228,7 +228,7 @@ const getLoginData = () => {
loginForm.value = {
username: username === null ? String(loginForm.value.username) : username,
password: '',
rememberMe: rememberMe === null ? false : Boolean(rememberMe)
rememberMe: rememberMe === 'true'
} as LoginData;
};

View File

@ -138,7 +138,7 @@ const resetQuery = () => {
handleQuery();
};
/** 强退按钮操作 */
const handleForceLogout = async (row: OnlineVO) => {
const handleForceLogout = async (row: Partial<OnlineVO>) => {
const [err] = await to(modal.confirm('是否确认强退名称为"' + row.userName + '"的用户?') as any);
if (!err) {
await forceLogout(row.tokenId);

View File

@ -282,7 +282,11 @@ const data = reactive<PageData<OperLogForm, OperLogQuery>>({
});
const { queryParams, form } = toRefs(data);
const { ids, multiple, handleSelectionChange: handleTableSelectionChange } = useTableSelection<OperLogVO>(item => item.operId);
const {
ids,
multiple,
handleSelectionChange: handleTableSelectionChange
} = useTableSelection<OperLogVO>(item => item.operId);
/** 查询登录日志 */
const getList = async () => {
@ -324,12 +328,12 @@ const handleSelectionChange = (selection: OperLogVO[]) => {
const operInfoDialogRef = ref<InstanceType<typeof OperInfoDialog>>();
/** 详细按钮操作 */
const handleView = (row: OperLogVO) => {
operInfoDialogRef.value.openDialog(row);
const handleView = (row: Partial<OperLogVO>) => {
operInfoDialogRef.value.openDialog(row as OperLogForm);
};
/** 删除按钮操作 */
const handleDelete = async (row?: OperLogVO) => {
const handleDelete = async (row?: Partial<OperLogVO>) => {
const operIds = row?.operId || ids.value;
await modal.confirm('是否确认删除日志编号为"' + operIds + '"的数据项?');
await delOperlog(operIds);

View File

@ -214,17 +214,15 @@
允许访问路径
</span>
</template>
<el-input
v-model="form.accessPath"
type="textarea"
:rows="4"
placeholder="示例:/app/**"
/>
<el-input v-model="form.accessPath" type="textarea" :rows="4" placeholder="示例:/app/**" />
</el-form-item>
<el-form-item prop="ipWhitelist" label-width="auto">
<template #label>
<span>
<el-tooltip content="支持精确IP、通配符和CIDR多个规则可按换行、逗号或分号分隔为空表示允许所有IP" placement="top">
<el-tooltip
content="支持精确IP、通配符和CIDR多个规则可按换行、逗号或分号分隔为空表示允许所有IP"
placement="top"
>
<el-icon><question-filled /></el-icon>
</el-tooltip>
IP白名单
@ -399,7 +397,7 @@ const handleAdd = () => {
};
/** 修改按钮操作 */
const handleUpdate = async (row?: ClientVO) => {
const handleUpdate = async (row?: Partial<ClientVO>) => {
resetForm();
const clientId = row?.id || ids.value[0];
const res = await getClient(clientId);
@ -426,7 +424,7 @@ const submitForm = () => {
};
/** 删除按钮操作 */
const handleDelete = async (row?: ClientVO) => {
const handleDelete = async (row?: Partial<ClientVO>) => {
const clientIds = row?.id || ids.value;
await modal.confirm('是否确认删除客户端管理编号为"' + clientIds + '"的数据项?');
await delClient(clientIds);
@ -446,7 +444,7 @@ const handleExport = () => {
};
/** 状态修改 */
const handleStatusChange = async (row: ClientVO) => {
const handleStatusChange = async (row: Partial<ClientVO>) => {
const text = row.status === '0' ? '启用' : '停用';
try {
await modal.confirm('确认要"' + text + '"吗?');

View File

@ -276,7 +276,7 @@ const handleAdd = () => {
openDialog('添加参数');
};
/** 修改按钮操作 */
const handleUpdate = async (row?: ConfigVO) => {
const handleUpdate = async (row?: Partial<ConfigVO>) => {
resetForm();
const configId = row?.configId || ids.value[0];
const res = await getConfig(configId);
@ -295,7 +295,7 @@ const submitForm = () => {
});
};
/** 删除按钮操作 */
const handleDelete = async (row?: ConfigVO) => {
const handleDelete = async (row?: Partial<ConfigVO>) => {
const configIds = row?.configId || ids.value;
await modal.confirm('是否确认删除参数编号为"' + configIds + '"的数据项?');
await delConfig(configIds);

View File

@ -313,7 +313,7 @@ const { resetQuery } = useSearchReset({
});
/** 新增按钮操作 */
const handleAdd = async (row?: DeptVO) => {
const handleAdd = async (row?: Partial<DeptVO>) => {
reset();
const res = await listDept();
const data = handleTree<DeptOptionsType>(res.data, 'deptId');
@ -328,7 +328,7 @@ const handleAdd = async (row?: DeptVO) => {
};
/** 修改按钮操作 */
const handleUpdate = async (row: DeptVO) => {
const handleUpdate = async (row: Partial<DeptVO>) => {
reset();
//
getDeptAllUser(row.deptId);
@ -362,7 +362,7 @@ const submitForm = () => {
});
};
/** 删除按钮操作 */
const handleDelete = async (row: DeptVO) => {
const handleDelete = async (row: Partial<DeptVO>) => {
await modal.confirm('是否确认删除名称为"' + row.deptName + '"的数据项?');
await delDept(row.deptId);
await getList();

View File

@ -1,4 +1,4 @@
<template>
<template>
<div class="p-2 app-container dict-page">
<el-row :gutter="16" class="dict-grid">
<!-- 字典类型 -->
@ -108,7 +108,9 @@
<el-table-column label="字典名称" align="center" prop="dictName" width="120" />
<el-table-column label="字典类型" align="center" prop="dictType" width="160">
<template #default="scope">
<span class="link-type" @click.stop="handleTypeRowClick(scope.row)">{{ scope.row.dictType }}</span>
<span class="link-type" @click.stop="handleTypeRowClick(scope.row)">
{{ scope.row.dictType }}
</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" width="160" />
@ -541,8 +543,8 @@ const setCurrentType = (row: DictTypeVO) => {
nextTick(() => typeTableRef.value?.setCurrentRow(row));
};
const handleTypeRowClick = (row: DictTypeVO) => {
setCurrentType(row);
const handleTypeRowClick = (row: Partial<DictTypeVO>) => {
setCurrentType(row as DictTypeVO);
};
const cancelType = () => {
@ -577,7 +579,7 @@ const handleTypeSelectionChange = (selection: DictTypeVO[]) => {
typeMultiple.value = !selection.length;
};
const handleTypeUpdate = async (row?: DictTypeVO) => {
const handleTypeUpdate = async (row?: Partial<DictTypeVO>) => {
resetTypeForm();
const dictId = row?.dictId || typeIds.value[0];
const res = await getType(dictId);
@ -597,7 +599,7 @@ const submitTypeForm = () => {
});
};
const handleTypeDelete = async (row?: DictTypeVO) => {
const handleTypeDelete = async (row?: Partial<DictTypeVO>) => {
const dictIds = row?.dictId || typeIds.value;
await modal.confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?');
await delType(dictIds);
@ -674,7 +676,7 @@ const handleDataSelectionChange = (selection: DictDataVO[]) => {
dataMultiple.value = !selection.length;
};
const handleDataUpdate = async (row?: DictDataVO) => {
const handleDataUpdate = async (row?: Partial<DictDataVO>) => {
if (!currentDict.value) {
modal.msgWarning('请先选择字典');
return;
@ -699,7 +701,7 @@ const submitDataForm = () => {
});
};
const handleDataDelete = async (row?: DictDataVO) => {
const handleDataDelete = async (row?: Partial<DictDataVO>) => {
if (!currentDict.value) {
modal.msgWarning('请先选择字典');
return;

View File

@ -431,7 +431,7 @@ const { dialog, openDialog, closeDialog, setTitle } = useDialogState();
type MenuTagType = 'warning' | 'primary' | 'success' | 'danger';
const getMenuTypeMeta = (menu: MenuVO): { label: string; type: MenuTagType } => {
const getMenuTypeMeta = (menu: Partial<MenuVO>): { label: string; type: MenuTagType } => {
if (menu.menuType === MenuTypeEnum.F) {
return { label: '按钮', type: 'warning' };
}
@ -543,7 +543,7 @@ const { resetQuery } = useSearchReset({
}
});
/** 新增按钮操作 */
const handleAdd = (row?: MenuVO) => {
const handleAdd = (row?: Partial<MenuVO>) => {
reset();
getTreeselect();
row && row.menuId ? (form.value.parentId = row.menuId) : (form.value.parentId = 0);
@ -551,7 +551,7 @@ const handleAdd = (row?: MenuVO) => {
openDialog();
};
/** 修改按钮操作 */
const handleUpdate = async (row: MenuVO) => {
const handleUpdate = async (row: Partial<MenuVO>) => {
reset();
await getTreeselect();
if (row.menuId) {
@ -573,7 +573,7 @@ const submitForm = () => {
});
};
/** 删除按钮操作 */
const handleDelete = async (row: MenuVO) => {
const handleDelete = async (row: Partial<MenuVO>) => {
await modal.confirm('是否确认删除名称为"' + row.menuName + '"的数据项?');
await delMenu(row.menuId);
await getList();
@ -583,7 +583,11 @@ const handleDelete = async (row: MenuVO) => {
const deleteLoading = ref<boolean>(false);
const menuTreeRef = ref<ElTreeInstance>();
const { dialog: deleteDialog, openDialog: openDeleteDialog, closeDialog: closeDeleteDialog } = useDialogState('级联删除菜单');
const {
dialog: deleteDialog,
openDialog: openDeleteDialog,
closeDialog: closeDeleteDialog
} = useDialogState('级联删除菜单');
/** 级联删除按钮操作 */
const handleCascadeDelete = () => {

View File

@ -285,12 +285,22 @@ const data = reactive<PageData<NoticeForm, NoticeQuery>>({
const { queryParams, form, rules } = toRefs(data);
const { ids, single, multiple, handleSelectionChange } = useTableSelection<NoticeVO>(item => item.noticeId);
const { dialog, resetForm: reset, openDialog, showDialog, closeDialog } = useFormDialog({
const {
dialog,
resetForm: reset,
openDialog,
showDialog,
closeDialog
} = useFormDialog({
form,
formRef: noticeFormRef,
initialFormData: initFormData
});
const { dialog: detailDialog, openDialog: openDetailDialog, closeDialog: closeDetailDialog } = useDialogState('公告详情');
const {
dialog: detailDialog,
openDialog: openDetailDialog,
closeDialog: closeDetailDialog
} = useDialogState('公告详情');
/** 查询公告列表 */
const getList = async () => {
@ -326,7 +336,7 @@ const handleAdd = () => {
openDialog('添加公告');
};
/**修改按钮操作 */
const handleUpdate = async (row?: NoticeVO) => {
const handleUpdate = async (row?: Partial<NoticeVO>) => {
reset();
const noticeId = row?.noticeId || ids.value[0];
const { data } = await getNotice(noticeId);
@ -334,7 +344,7 @@ const handleUpdate = async (row?: NoticeVO) => {
showDialog('修改公告');
};
/** 详情按钮操作 */
const handleDetail = async (row: NoticeVO) => {
const handleDetail = async (row: Partial<NoticeVO>) => {
await openDetail(row.noticeId);
};
/** 打开详情 */
@ -371,7 +381,7 @@ const submitForm = () => {
});
};
/** 删除按钮操作 */
const handleDelete = async (row?: NoticeVO) => {
const handleDelete = async (row?: Partial<NoticeVO>) => {
const noticeIds = row?.noticeId || ids.value;
await modal.confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?');
await delNotice(noticeIds);

View File

@ -24,12 +24,7 @@
</el-form-item>
<el-form-item label="是否默认" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
<el-option
v-for="dict in sys_yes_no"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
<el-option v-for="dict in sys_yes_no" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item>
@ -313,7 +308,13 @@ const data = reactive<PageData<OssConfigForm, OssConfigQuery>>({
const { queryParams, form, rules } = toRefs(data);
const protocol = computed(() => (form.value.isHttps === 'Y' ? 'https://' : 'http://'));
const { ids, single, multiple, handleSelectionChange } = useTableSelection<OssConfigVO>(item => item.ossConfigId);
const { dialog, resetForm: reset, openDialog, showDialog, closeDialog } = useFormDialog({
const {
dialog,
resetForm: reset,
openDialog,
showDialog,
closeDialog
} = useFormDialog({
form,
formRef: ossConfigFormRef,
initialFormData: initFormData
@ -350,7 +351,7 @@ const handleAdd = () => {
openDialog('添加对象存储配置');
};
/** 修改按钮操作 */
const handleUpdate = async (row?: OssConfigVO) => {
const handleUpdate = async (row?: Partial<OssConfigVO>) => {
reset();
const ossConfigId = row?.ossConfigId || ids.value[0];
const res = await getOssConfig(ossConfigId);
@ -374,7 +375,7 @@ const submitForm = () => {
});
};
/** 状态修改 */
const handleStatusChange = async (row: OssConfigVO) => {
const handleStatusChange = async (row: Partial<OssConfigVO>) => {
const text = row.status === 'Y' ? '启用' : '停用';
try {
await modal.confirm('确认要"' + text + '""' + row.configKey + '"配置吗?');
@ -386,7 +387,7 @@ const handleStatusChange = async (row: OssConfigVO) => {
}
};
/** 删除按钮操作 */
const handleDelete = async (row?: OssConfigVO) => {
const handleDelete = async (row?: Partial<OssConfigVO>) => {
const ossConfigIds = row?.ossConfigId || ids.value;
await modal.confirm('是否确认删除OSS配置编号为"' + ossConfigIds + '"的数据项?');
setLoading(true);

View File

@ -245,7 +245,12 @@ const data = reactive<PageData<OssForm, OssQuery>>({
const { queryParams, form, rules } = toRefs(data);
const { ids, single, multiple, handleSelectionChange } = useTableSelection<OssVO>(item => item.ossId);
const { dialog, resetForm: reset, openDialog, closeDialog } = useFormDialog({
const {
dialog,
resetForm: reset,
openDialog,
closeDialog
} = useFormDialog({
form,
formRef: ossFormRef,
initialFormData: initFormData
@ -356,7 +361,7 @@ const submitForm = () => {
getList();
};
/** 下载按钮操作 */
const handleDownload = (row: OssVO) => {
const handleDownload = (row: Partial<OssVO>) => {
download.oss(row.ossId);
};
/** 预览开关按钮 */
@ -370,7 +375,7 @@ const handlePreviewListResource = async (preview: boolean) => {
}
};
/** 删除按钮操作 */
const handleDelete = async (row?: OssVO) => {
const handleDelete = async (row?: Partial<OssVO>) => {
const ossIds = row?.ossId || ids.value;
await modal.confirm('是否确认删除OSS对象存储编号为"' + ossIds + '"的数据项?');
setLoading(true);

View File

@ -353,7 +353,7 @@ const handleAdd = () => {
};
/** 修改按钮操作 */
const handleUpdate = async (row?: PostVO) => {
const handleUpdate = async (row?: Partial<PostVO>) => {
resetForm();
const postId = row?.postId || ids.value[0];
const res = await getPost(postId);
@ -374,7 +374,7 @@ const submitForm = () => {
};
/** 删除按钮操作 */
const handleDelete = async (row?: PostVO) => {
const handleDelete = async (row?: Partial<PostVO>) => {
const postIds = row?.postId || ids.value;
await modal.confirm('是否确认删除岗位编号为"' + postIds + '"的数据项?');
await delPost(postIds);

View File

@ -178,7 +178,7 @@ const openSelectUser = () => {
selectRef.value?.show();
};
/** 取消授权按钮操作 */
const cancelAuthUser = async (row: UserVO) => {
const cancelAuthUser = async (row: Partial<UserVO>) => {
await modal.confirm('确认要取消该用户"' + row.userName + '"角色吗?');
await authUserCancel({ userId: row.userId, roleId: queryParams.roleId });
await getList();

View File

@ -87,7 +87,13 @@
</div>
</template>
<el-table border class="data-table" v-loading="loading" :data="roleList" @selection-change="handleSelectionChange">
<el-table
border
class="data-table"
v-loading="loading"
:data="roleList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column v-if="false" label="角色编号" prop="roleId" width="120" />
<el-table-column label="角色名称" prop="roleName" :show-overflow-tooltip="true" width="150" />
@ -236,7 +242,7 @@
node-key="id"
:check-strictly="!form.menuCheckStrictly"
empty-text="加载中,请稍候"
:props="{ label: 'label', children: 'children', disabled: 'disabled' } as any"
:props="{ label: 'label', children: 'children', disabled: 'disabled' }"
@check="handleMenuTreeCheck"
>
<template #default="{ data, node }">
@ -288,7 +294,9 @@
</el-select>
</el-form-item>
<el-form-item v-show="form.dataScope === '2'" label="数据权限">
<el-checkbox v-model="deptExpand" @change="handleCheckedTreeExpand($event, 'dept')">展开/折叠</el-checkbox>
<el-checkbox v-model="deptExpand" @change="handleCheckedTreeExpand($event, 'dept')">
展开/折叠
</el-checkbox>
<el-checkbox v-model="deptNodeAll" @change="handleCheckedTreeNodeAll($event, 'dept')">
全选/全不选
</el-checkbox>
@ -304,7 +312,7 @@
node-key="id"
:check-strictly="!form.deptCheckStrictly"
empty-text="加载中,请稍候"
:props="{ label: 'label', children: 'children' } as any"
:props="{ label: 'label', children: 'children' }"
></el-tree>
</el-form-item>
</el-tab-pane>
@ -323,7 +331,6 @@
<script setup name="Role" lang="ts">
import { useRouter } from 'vue-router';
import { roleMenuTreeselect } from '@/api/system/menu';
import { MenuTypeEnum } from '@/enums/MenuTypeEnum';
import { MenuTreeOption, RoleMenuButtonOption, RoleMenuTree } from '@/api/system/menu/types';
import {
addRole,
@ -336,6 +343,7 @@ import {
deptTreeSelect
} from '@/api/system/role';
import { RoleVO, RoleForm, RoleQuery, DeptTreeOption } from '@/api/system/role/types';
import { MenuTypeEnum } from '@/enums/MenuTypeEnum';
import { useLoading } from '@/hooks/async/useLoading';
import { useDialogState } from '@/hooks/dialog/useDialogState';
import { useDateRangeQuery } from '@/hooks/form/useDateRangeQuery';
@ -490,7 +498,13 @@ const buildRoleMenuPermissionOptions = (
};
}) ?? [];
const children = menu.children?.length
? buildRoleMenuPermissionOptions(menu.children, disabledButtonIds, buttonIds, buttonParentMap, nextDirectoryDisabled)
? buildRoleMenuPermissionOptions(
menu.children,
disabledButtonIds,
buttonIds,
buttonParentMap,
nextDirectoryDisabled
)
: [];
options.push({
...menu,
@ -822,7 +836,7 @@ const { resetQuery } = useSearchReset({
}
});
/**删除按钮操作 */
const handleDelete = async (row?: RoleVO) => {
const handleDelete = async (row?: Partial<RoleVO>) => {
const roleids = row?.roleId || ids.value;
await modal.confirm('是否确认删除角色编号为' + roleids + '数据项目');
await delRole(roleids);
@ -841,7 +855,7 @@ const handleExport = () => {
);
};
/** 角色状态修改 */
const handleStatusChange = async (row: RoleVO) => {
const handleStatusChange = async (row: Partial<RoleVO>) => {
const text = row.status === '0' ? '启用' : '停用';
try {
await modal.confirm('确认要"' + text + '""' + row.roleName + '"角色吗?');
@ -853,7 +867,7 @@ const handleStatusChange = async (row: RoleVO) => {
};
/** 分配用户 */
const handleAuthUser = (row: RoleVO) => {
const handleAuthUser = (row: Partial<RoleVO>) => {
router.push('/system/role-auth/user/' + row.roleId);
};
@ -891,7 +905,7 @@ const handleAdd = () => {
openDialog();
};
/** 修改角色 */
const handleUpdate = async (row?: RoleVO) => {
const handleUpdate = async (row?: Partial<RoleVO>) => {
reset();
const roleId = row?.roleId || ids.value[0];
const { data } = await getRole(roleId);
@ -983,7 +997,7 @@ const dataScopeSelectChange = (value: string) => {
}
};
/** 分配数据权限操作 */
const handleDataScope = async (row: RoleVO) => {
const handleDataScope = async (row: Partial<RoleVO>) => {
permissionTab.value = 'menu';
const response = await getRole(row.roleId);
Object.assign(form.value, response.data);

View File

@ -652,7 +652,7 @@ const { resetQuery } = useSearchReset({
});
/** 删除按钮操作 */
const handleDelete = async (row?: UserVO) => {
const handleDelete = async (row?: Partial<UserVO>) => {
const userIds = row?.userId || ids.value;
const [err] = await to(modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?') as any);
if (!err) {
@ -673,7 +673,7 @@ const handleUnlock = async () => {
};
/** 用户状态修改 */
const handleStatusChange = async (row: UserVO) => {
const handleStatusChange = async (row: Partial<UserVO>) => {
const text = row.status === '0' ? '启用' : '停用';
try {
await modal.confirm('确认要"' + text + '""' + row.userName + '"用户吗?');
@ -684,13 +684,13 @@ const handleStatusChange = async (row: UserVO) => {
}
};
/** 跳转角色分配 */
const handleAuthRole = (row: UserVO) => {
const handleAuthRole = (row: Partial<UserVO>) => {
const userId = row.userId;
router.push('/system/user-auth/role/' + userId);
};
/** 重置密码按钮操作 */
const handleResetPwd = async (row: UserVO) => {
const handleResetPwd = async (row: Partial<UserVO>) => {
const [err, res] = await to(
ElMessageBox.prompt('请输入"' + row.userName + '"的新密码', '提示', {
confirmButtonText: '确定',
@ -712,7 +712,7 @@ const handleResetPwd = async (row: UserVO) => {
};
/** 详情按钮操作 */
const handleViewDetail = (row: UserVO) => {
const handleViewDetail = (row: Partial<UserVO>) => {
userViewRef.value?.openDrawer(row.userId);
};
@ -787,7 +787,7 @@ const handleAdd = async () => {
};
/** 修改按钮操作 */
const handleUpdate = async (row?: UserForm) => {
const handleUpdate = async (row?: Partial<UserForm>) => {
reset();
const userId = row?.userId || ids.value[0];
const { data } = await api.getUser(userId);

View File

@ -156,7 +156,7 @@ const normalizeColumnDictType = (column: Partial<DbColumnVO>) => {
}
};
const handleHtmlTypeChange = (column: DbColumnVO) => {
const handleHtmlTypeChange = (column: Partial<DbColumnVO>) => {
normalizeColumnDictType(column);
};

View File

@ -234,7 +234,12 @@ const preview = ref<{
data: {},
activeName: 'domain.java'
});
const { ids, single, multiple, handleSelectionChange: updateSelection } = useTableSelection<TableVO>(item => item.tableId);
const {
ids,
single,
multiple,
handleSelectionChange: updateSelection
} = useTableSelection<TableVO>(item => item.tableId);
const { dialog, openDialog: openPreviewDialog } = useDialogState('代码预览');
const handleTableSelectionChange = (selection: TableVO[]) => {
@ -262,7 +267,7 @@ const handleQuery = () => {
getList();
};
/** 生成代码操作 */
const handleGenTable = async (row?: TableVO) => {
const handleGenTable = async (row?: Partial<TableVO>) => {
const currentRows = row ? [row] : selectedRows.value;
if (!currentRows.length) {
modal.msgError('请选择要生成的数据');
@ -273,7 +278,7 @@ const handleGenTable = async (row?: TableVO) => {
download.zip('/tool/gen/batchGenCode?tableIdStr=' + zipIds, 'ruoyi.zip');
};
/** 同步数据库操作 */
const handleSynchDb = async (row: TableVO) => {
const handleSynchDb = async (row: Partial<TableVO>) => {
const tableId = row.tableId;
await modal.confirm('确认要强制同步"' + row.tableName + '"表结构吗?');
await synchDb(tableId);
@ -295,7 +300,7 @@ const { resetQuery } = useSearchReset({
}
});
/** 预览按钮 */
const handlePreview = async (row: TableVO) => {
const handlePreview = async (row: Partial<TableVO>) => {
const res = await previewTable(row.tableId);
preview.value.data = res.data;
openPreviewDialog();
@ -306,7 +311,7 @@ const copyTextSuccess = () => {
modal.msgSuccess('复制成功');
};
/** 修改按钮操作 */
const handleEditTable = (row?: TableVO) => {
const handleEditTable = (row?: Partial<TableVO>) => {
const tableId = row?.tableId || ids.value[0];
router.push({
path: '/tool/gen-edit/index/' + tableId,
@ -314,7 +319,7 @@ const handleEditTable = (row?: TableVO) => {
});
};
/** 删除按钮操作 */
const handleDelete = async (row?: TableVO) => {
const handleDelete = async (row?: Partial<TableVO>) => {
const tableIds = row?.tableId || ids.value;
await modal.confirm('是否确认删除表编号为"' + tableIds + '"的数据项?');
await delTable(tableIds);

View File

@ -171,7 +171,13 @@ const data = reactive<PageData<CategoryForm, CategoryQuery>>({
});
const { queryParams, form, rules } = toRefs(data);
const { dialog, resetForm: reset, openDialog, showDialog, closeDialog } = useFormDialog({
const {
dialog,
resetForm: reset,
openDialog,
showDialog,
closeDialog
} = useFormDialog({
form,
formRef: categoryFormRef,
initialFormData: initFormData
@ -219,7 +225,7 @@ const { resetQuery } = useSearchReset({
});
/** 新增按钮操作 */
const handleAdd = (row?: CategoryVO) => {
const handleAdd = (row?: Partial<CategoryVO>) => {
openDialog('添加流程分类');
getTreeselect();
if (row?.categoryId) {
@ -230,7 +236,7 @@ const handleAdd = (row?: CategoryVO) => {
};
/** 修改按钮操作 */
const handleUpdate = async (row: CategoryVO) => {
const handleUpdate = async (row: Partial<CategoryVO>) => {
reset();
await getTreeselect();
if (row != null) {
@ -259,7 +265,7 @@ const submitForm = () => {
};
/** 删除按钮操作 */
const handleDelete = async (row: CategoryVO) => {
const handleDelete = async (row: Partial<CategoryVO>) => {
await modal.confirm('是否确认删除"' + row.categoryName + '"的分类?');
setLoading(true);
await delCategory(row.categoryId).finally(() => setLoading(false));

View File

@ -243,7 +243,7 @@ const handleAdd = () => {
};
/** 修改按钮操作 */
const handleUpdate = (row?: LeaveVO) => {
const handleUpdate = (row?: Partial<LeaveVO>) => {
tab.closePage(route);
router.push({
path: `/workflow/leaveEdit/index`,
@ -255,7 +255,7 @@ const handleUpdate = (row?: LeaveVO) => {
};
/** 查看按钮操作 */
const handleView = (row?: LeaveVO) => {
const handleView = (row?: Partial<LeaveVO>) => {
tab.closePage(route);
router.push({
path: `/workflow/leaveEdit/index`,
@ -267,7 +267,7 @@ const handleView = (row?: LeaveVO) => {
};
/** 删除按钮操作 */
const handleDelete = async (row?: LeaveVO) => {
const handleDelete = async (row?: Partial<LeaveVO>) => {
const leaveIds = row?.id || ids.value;
await modal.confirm('是否确认删除请假编号为"' + leaveIds + '"的数据项?');
await delLeave(leaveIds);

View File

@ -407,16 +407,21 @@ const form = ref<FlowDefinitionForm>({
formCustom: '',
modelValue: ''
});
const {
ids,
selectedRows,
single,
multiple,
handleSelectionChange
} = useTableSelection<FlowDefinitionVo, string>(item => String(item.id));
const { ids, selectedRows, single, multiple, handleSelectionChange } = useTableSelection<FlowDefinitionVo, string>(
item => String(item.id)
);
const flowCodeList = computed(() => selectedRows.value.map(item => item.flowCode));
const { dialog: uploadDialog, openDialog: openUploadDialog, closeDialog: closeUploadDialog } = useDialogState('部署流程文件');
const { dialog: modelDialog, resetForm: reset, showDialog: showModelDialog, closeDialog: closeModelDialog } = useFormDialog({
const {
dialog: uploadDialog,
openDialog: openUploadDialog,
closeDialog: closeUploadDialog
} = useDialogState('部署流程文件');
const {
dialog: modelDialog,
resetForm: reset,
showDialog: showModelDialog,
closeDialog: closeModelDialog
} = useFormDialog({
form,
formRef: defFormRef,
initialFormData: initFormData
@ -498,7 +503,7 @@ const getUnPublishList = async () => {
};
/** 删除按钮操作 */
const handleDelete = async (row?: FlowDefinitionVo) => {
const handleDelete = async (row?: Partial<FlowDefinitionVo>) => {
const id = row?.id || ids.value;
const defList = processDefinitionList.value.filter(x => id.indexOf(x.id) != -1).map(x => x.flowCode);
await modal.confirm('是否确认删除流程定义编码为【' + defList + '】的数据项?');
@ -509,7 +514,7 @@ const handleDelete = async (row?: FlowDefinitionVo) => {
};
/** 发布流程定义 */
const handlePublish = async (row?: FlowDefinitionVo) => {
const handlePublish = async (row?: Partial<FlowDefinitionVo>) => {
await modal.confirm(
'是否确认发布流程定义编码为【' +
row.flowCode +
@ -524,7 +529,7 @@ const handlePublish = async (row?: FlowDefinitionVo) => {
modal.msgSuccess('发布成功');
};
/** 挂起/激活 */
const handleProcessDefState = async (row: FlowDefinitionVo, status: number | string | boolean) => {
const handleProcessDefState = async (row: Partial<FlowDefinitionVo>, status: number | string | boolean) => {
let msg: string;
if (status === 0) {
msg = `暂停后,此流程下的所有任务都不允许往后流转,您确定挂起【${row.flowName || row.flowCode}】吗?`;
@ -578,7 +583,7 @@ const handlerImportDefinition = (data: UploadRequestOptions): XMLHttpRequest =>
* 设计流程
* @param row
*/
const design = async (row: FlowDefinitionVo) => {
const design = async (row: Partial<FlowDefinitionVo>) => {
router.push({
path: `/workflow/design/index`,
query: {
@ -593,7 +598,7 @@ const design = async (row: FlowDefinitionVo) => {
* 查看流程
* @param row
*/
const designView = async (row: FlowDefinitionVo) => {
const designView = async (row: Partial<FlowDefinitionVo>) => {
router.push({
path: `/workflow/design/index`,
query: {
@ -616,7 +621,7 @@ const handleAdd = async () => {
showModelDialog('新增流程');
};
/** 修改按钮操作 */
const handleUpdate = async (row?: FlowDefinitionVo) => {
const handleUpdate = async (row?: Partial<FlowDefinitionVo>) => {
reset();
const id = row?.id || ids.value[0];
const res = await getInfo(id);
@ -652,7 +657,7 @@ const handleSubmit = async () => {
});
};
//
const handleCopyDef = async (row: FlowDefinitionVo) => {
const handleCopyDef = async (row: Partial<FlowDefinitionVo>) => {
ElMessageBox.confirm(`是否确认复制【${row.flowCode}】版本为【${row.version}】的流程定义!`, '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',

View File

@ -347,7 +347,12 @@ const form = ref<Record<string, any>>({
const ruleFormRef = ref<FormInstance>();
const userSelectRef = ref<InstanceType<typeof UserSelect>>();
const { loading, setLoading, withLoading } = useLoading(true);
const { ids: instanceIds, single, multiple, handleSelectionChange } = useTableSelection<FlowInstanceVO>(item => item.id);
const {
ids: instanceIds,
single,
multiple,
handleSelectionChange
} = useTableSelection<FlowInstanceVO>(item => item.id);
const { showSearch } = useSearchToggle();
//
const total = ref(0);
@ -443,7 +448,7 @@ const getProcessInstanceFinishList = () => {
};
/** 删除按钮操作 */
const handleDelete = async (row?: FlowInstanceVO) => {
const handleDelete = async (row?: Partial<FlowInstanceVO>) => {
const instanceIdList = row?.id ?? instanceIds.value;
await modal.confirm('是否确认删除?');
setLoading(true);
@ -466,7 +471,7 @@ const changeTab = async (pane: TabsPaneContext) => {
}
};
/** 作废按钮操作 */
const handleInvalid = async (row: FlowInstanceVO) => {
const handleInvalid = async (row: Partial<FlowInstanceVO>) => {
await modal.confirm('是否确认作废?');
setLoading(true);
if ('running' === tab.value) {
@ -495,7 +500,7 @@ const handleView = row => {
};
//
const handleInstanceVariable = async (row: FlowInstanceVO) => {
const handleInstanceVariable = async (row: Partial<FlowInstanceVO>) => {
instanceId.value = row.id;
variableLoading.value = true;
variableVisible.value = true;

View File

@ -298,7 +298,7 @@ const handleAdd = () => {
};
/** 修改按钮操作 */
const handleUpdate = async (row?: SpelVO) => {
const handleUpdate = async (row?: Partial<SpelVO>) => {
resetForm();
const spelId = row?.id || ids.value[0];
const res = await getSpel(spelId);
@ -325,7 +325,7 @@ const submitForm = () => {
};
/** 删除按钮操作 */
const handleDelete = async (row?: SpelVO) => {
const handleDelete = async (row?: Partial<SpelVO>) => {
const spelIds = row?.id || ids.value;
await modal.confirm('是否确认删除流程spel表达式定义编号为"' + spelIds + '"的数据项?');
await delSpel(spelIds);

View File

@ -168,7 +168,12 @@ const { wf_business_status } = toRefs<any>(useDict('wf_business_status'));
const queryFormRef = ref<ElFormInstance>();
const { loading, setLoading, withLoading } = useLoading(true);
const { ids: instanceIds, single, multiple, handleSelectionChange } = useTableSelection<FlowInstanceVO>(item => item.id);
const {
ids: instanceIds,
single,
multiple,
handleSelectionChange
} = useTableSelection<FlowInstanceVO>(item => item.id);
const { showSearch } = useSearchToggle();
//
const total = ref(0);
@ -233,7 +238,7 @@ const getList = () => {
};
/** 删除按钮操作 */
const handleDelete = async (row: FlowInstanceVO) => {
const handleDelete = async (row: Partial<FlowInstanceVO>) => {
const instanceIdList = row.id || instanceIds.value;
await modal.confirm('是否确认删除?');
setLoading(true);

View File

@ -194,7 +194,7 @@ const getFinishList = () => {
});
};
/** 查看按钮操作 */
const handleView = (row: FlowTaskVO) => {
const handleView = (row: Partial<FlowTaskVO>) => {
const routerJumpVo = reactive<RouterJumpVo>({
businessId: row.businessId,
taskId: row.id,

View File

@ -179,7 +179,7 @@ const getWaitingList = () => {
});
};
//
const handleOpen = async (row: FlowTaskVO) => {
const handleOpen = async (row: Partial<FlowTaskVO>) => {
const routerJumpVo = reactive<RouterJumpVo>({
businessId: row.businessId,
taskId: row.id,