bug修复

This commit is contained in:
helen 2024-12-23 18:25:59 +08:00
parent d5467bb89c
commit 5ced818619
2 changed files with 29 additions and 13 deletions

View File

@ -242,9 +242,15 @@ const resetQuery = () => {
/** 多选框选中数据 */ /** 多选框选中数据 */
const handleSelectionChange = (selection: HotelVO[]) => { const handleSelectionChange = (selection: HotelVO[]) => {
console.log(selection, 'selection');
// multiple.value = !selection.length;
let result = selection.some((item: any) => {
return item.status === 1;
});
multiple.value = result;
console.log(result, multiple.value);
ids.value = selection.map((item) => item.id); ids.value = selection.map((item) => item.id);
single.value = selection.length != 1; single.value = selection.length != 1;
multiple.value = !selection.length;
}; };
/** 新增按钮操作 */ /** 新增按钮操作 */

View File

@ -63,18 +63,25 @@
<el-table-column label="发布状态" align="center" prop="status"> <el-table-column label="发布状态" align="center" prop="status">
<template #default="scope"> <template #default="scope">
<el-tag v-if="scope.row.status == 0" type="info">未发布</el-tag> <el-tag v-if="scope.row.status == 0" type="info">未发布</el-tag>
<el-tag v-if="scope.row.status == 1" type="success">审核中</el-tag> <el-tag v-if="scope.row.status == 1" type="warning">草稿</el-tag>
<el-tag v-if="scope.row.status == 2" type="primary">已发布</el-tag> <el-tag v-if="scope.row.status == 2" type="success">审核中</el-tag>
<el-tag v-if="scope.row.status == 3" type="primary">已发布</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="160px">
<template #default="scope"> <template #default="scope">
<el-tooltip content="编辑" placement="top"> <el-button v-if="scope.row.status != 3" v-hasPermi="['system:Route:edit']" link type="primary" @click="handleUpdate(scope.row)"
<el-button v-hasPermi="['system:Route:edit']" link type="primary" icon="Edit" @click="handleUpdate(scope.row)"></el-button> >编辑</el-button
</el-tooltip> >
<el-tooltip content="删除" placement="top"> <el-button v-if="scope.row.status != 3" v-hasPermi="['system:Route:remove']" link type="primary" @click="handleDelete(scope.row)"
<el-button v-hasPermi="['system:Route:remove']" link type="primary" icon="Delete" @click="handleDelete(scope.row)"></el-button> >删除</el-button
</el-tooltip> >
<el-button v-if="scope.row.status != 3" v-hasPermi="['system:Route:remove']" link type="primary" @click="handleDelete(scope.row)"
>发布</el-button
>
<el-button v-if="scope.row.status == 3" v-hasPermi="['system:Route:remove']" link type="primary" @click="handleDelete(scope.row)"
>撤销发布</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -155,8 +162,8 @@
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="yulanform"> </el-button> <el-button :loading="buttonLoading" type="primary" @click="yulanform"> </el-button>
<el-button :loading="buttonLoading" type="primary" @click="submitForm('0')"> 稿</el-button> <el-button :loading="buttonLoading" type="primary" @click="submitForm('1')"> 稿</el-button>
<el-button :loading="buttonLoading" type="primary" @click="submitForm('1')"> </el-button> <el-button :loading="buttonLoading" type="primary" @click="submitForm('0')"> </el-button>
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
</template> </template>
@ -543,7 +550,10 @@ const submitForm = (type) => {
await addRoute(form.value).finally(() => (buttonLoading.value = false)); await addRoute(form.value).finally(() => (buttonLoading.value = false));
} }
proxy?.$modal.msgSuccess('操作成功'); proxy?.$modal.msgSuccess('操作成功');
if (type == 1) {
} else {
dialog.visible = false; dialog.visible = false;
}
await getList(); await getList();
} }
}); });