修改岗位批量删除问题

This commit is contained in:
不做码农 2022-04-01 20:25:58 +08:00
parent 990c1996a3
commit 7377a3e167
4 changed files with 28 additions and 30 deletions

View File

@ -9,6 +9,7 @@ using Infrastructure.Attribute;
using Infrastructure.Enums; using Infrastructure.Enums;
using Infrastructure; using Infrastructure;
using ZR.Service.System.IService; using ZR.Service.System.IService;
using ZR.Common;
namespace ZR.Admin.WebApi.Controllers.System namespace ZR.Admin.WebApi.Controllers.System
{ {
@ -106,9 +107,10 @@ namespace ZR.Admin.WebApi.Controllers.System
[HttpDelete("{id}")] [HttpDelete("{id}")]
[ActionPermissionFilter(Permission = "system:post:remove")] [ActionPermissionFilter(Permission = "system:post:remove")]
[Log(Title = "岗位删除", BusinessType = BusinessType.DELETE)] [Log(Title = "岗位删除", BusinessType = BusinessType.DELETE)]
public IActionResult Delete(int id = 0) public IActionResult Delete(string id)
{ {
return ToResponse(ToJson(PostService.Delete(id))); int[] ids = Tools.SpitIntArrary(id);
return ToResponse(ToJson(PostService.Delete(ids)));
} }
/// <summary> /// <summary>

View File

@ -1,11 +1,12 @@
<template> <template>
<div :class="{'has-logo':showLogo}" :style="{ backgroundColor: settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }"> <div :class="{'has-logo':showLogo}"
:style="{ backgroundColor: settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
<logo v-if="showLogo" :collapse="isCollapse" /> <logo v-if="showLogo" :collapse="isCollapse" />
<el-scrollbar :class="settings.sideTheme" wrap-class="scrollbar-wrapper"> <el-scrollbar :class="settings.sideTheme" wrap-class="scrollbar-wrapper">
<el-menu :default-active="activeMenu" :collapse="isCollapse"
<el-menu :default-active="activeMenu" :collapse="isCollapse" :background-color="settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground" :text-color="settings.sideTheme === 'theme-dark' ? variables.menuColor : variables.menuLightColor" :unique-opened="true" :background-color="settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground"
:text-color="settings.sideTheme === 'theme-dark' ? variables.menuColor : variables.menuLightColor" :unique-opened="true"
:active-text-color="settings.theme" :collapse-transition="false" mode="vertical"> :active-text-color="settings.theme" :collapse-transition="false" mode="vertical">
<sidebar-item v-for="(route, index) in sidebarRouters" :key="route.path + index" :item="route" :base-path="route.path" /> <sidebar-item v-for="(route, index) in sidebarRouters" :key="route.path + index" :item="route" :base-path="route.path" />
</el-menu> </el-menu>
</el-scrollbar> </el-scrollbar>
@ -13,34 +14,34 @@
</template> </template>
<script> <script>
import { mapGetters, mapState } from "vuex"; import { mapGetters, mapState } from 'vuex'
import Logo from "./Logo"; import Logo from './Logo'
import SidebarItem from "./SidebarItem"; import SidebarItem from './SidebarItem'
import variables from "@/assets/styles/variables.scss"; import variables from '@/assets/styles/variables.scss'
export default { export default {
components: { SidebarItem, Logo }, components: { SidebarItem, Logo },
computed: { computed: {
...mapState(["settings"]), ...mapState(['settings']),
...mapGetters(["sidebarRouters", "sidebar"]), ...mapGetters(['sidebarRouters', 'sidebar']),
activeMenu() { activeMenu() {
const route = this.$route; const route = this.$route
const { meta, path } = route; const { meta, path } = route
// if set path, the sidebar will highlight the path you set // if set path, the sidebar will highlight the path you set
if (meta.activeMenu) { if (meta.activeMenu) {
return meta.activeMenu; return meta.activeMenu
} }
return path; return path
}, },
showLogo() { showLogo() {
return this.$store.state.settings.sidebarLogo; return this.$store.state.settings.sidebarLogo
}, },
variables() { variables() {
return variables; return variables
}, },
isCollapse() { isCollapse() {
return !this.sidebar.opened; return !this.sidebar.opened
}, }
}, }
}; }
</script> </script>

View File

@ -41,14 +41,10 @@
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:user:add']">新增</el-button> <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:user:add']">新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <!-- <el-col :span="1.5">
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
v-hasPermi="['system:user:edit']">修改</el-button> v-hasPermi="['system:user:edit']">修改</el-button>
</el-col> </el-col> -->
<el-col :span="1.5">
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
v-hasPermi="['system:user:remove']">删除</el-button>
</el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport" v-hasPermi="['system:user:import']">导入</el-button> <el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport" v-hasPermi="['system:user:import']">导入</el-button>
</el-col> </el-col>
@ -59,7 +55,6 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="编号" align="center" prop="userId" width="60" /> <el-table-column label="编号" align="center" prop="userId" width="60" />
<el-table-column label="登录名" align="center" prop="userName" :show-overflow-tooltip="true" /> <el-table-column label="登录名" align="center" prop="userName" :show-overflow-tooltip="true" />
<el-table-column label="昵称" align="center" prop="nickName" :show-overflow-tooltip="true" /> <el-table-column label="昵称" align="center" prop="nickName" :show-overflow-tooltip="true" />