【更新】bug修改
This commit is contained in:
parent
6fe7fc311a
commit
9419800806
@ -113,6 +113,9 @@ export default {
|
||||
Object.assign(this.localPagination, {
|
||||
showSizeChanger: val
|
||||
})
|
||||
},
|
||||
columns(v) {
|
||||
this.columnsSetting = v
|
||||
}
|
||||
},
|
||||
created () {
|
||||
@ -252,6 +255,13 @@ export default {
|
||||
this.updateSelect([], [])
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 刷新并清空已选
|
||||
*/
|
||||
clearRefreshSelected (bool = false) {
|
||||
this.refresh(bool)
|
||||
this.clearSelected()
|
||||
},
|
||||
/**
|
||||
* 处理交给 table 使用者去处理 clear 事件时,内部选中统计同时调用
|
||||
* @param callback
|
||||
@ -285,8 +295,7 @@ export default {
|
||||
|
||||
// 绘制 alert 组件
|
||||
// 统一先去除alert组件
|
||||
return ''
|
||||
/* return (
|
||||
return (
|
||||
<a-alert showIcon={true} style="margin-bottom: 16px">
|
||||
<template slot="message">
|
||||
<span style="margin-right: 12px">已选择: <a style="font-weight: 600">{this.selectedRows.length}</a></span>
|
||||
@ -294,7 +303,7 @@ export default {
|
||||
{clearItem}
|
||||
</template>
|
||||
</a-alert>
|
||||
) */
|
||||
)
|
||||
},
|
||||
columnChange(val) {
|
||||
this.columnsSetting = val
|
||||
@ -370,7 +379,8 @@ export default {
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
/* return (
|
||||
/*
|
||||
return (
|
||||
<a-alert showIcon={true} style="margin-bottom: 16px">
|
||||
<template slot="message">
|
||||
<span style="margin-right: 12px">已选择: <a style="font-weight: 600">{this.selectedRows.length}</a></span>
|
||||
@ -378,7 +388,8 @@ export default {
|
||||
{clearItem}
|
||||
</template>
|
||||
</a-alert>
|
||||
) */
|
||||
)
|
||||
*/
|
||||
}
|
||||
},
|
||||
|
||||
@ -435,4 +446,4 @@ export default {
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -74,7 +74,7 @@
|
||||
|
||||
<script>
|
||||
import { STable, XCard } from '@/components'
|
||||
import { getMenuList } from '@/api/modular/system/menuManage'
|
||||
import { getMenuList, sysMenuDelete } from '@/api/modular/system/menuManage'
|
||||
import addForm from './addForm'
|
||||
import editForm from './editForm'
|
||||
import { mapGetters } from 'vuex'
|
||||
@ -160,6 +160,16 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
handleDel (record) {
|
||||
sysMenuDelete(record).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message.success('删除成功')
|
||||
this.$refs.table.refresh()
|
||||
} else {
|
||||
this.$message.error('删除失败:' + res.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
handleOk () {
|
||||
this.$refs.table.refresh()
|
||||
}
|
||||
|
@ -40,9 +40,9 @@
|
||||
ref="table"
|
||||
:columns="columns"
|
||||
:data="loadData"
|
||||
:alert="true"
|
||||
:alert="options.alert"
|
||||
:rowKey="(record) => record.id"
|
||||
:rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
||||
:rowSelection="options.rowSelection"
|
||||
>
|
||||
<template slot="operator">
|
||||
<a-button @click="$refs.addForm.add()" icon="plus" type="primary" v-if="hasPerm('sysOrg:add')">新增机构</a-button>
|
||||
@ -122,6 +122,13 @@
|
||||
simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
|
||||
replaceFields: {
|
||||
key: 'id'
|
||||
},
|
||||
options: {
|
||||
alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
|
||||
rowSelection: {
|
||||
selectedRowKeys: this.selectedRowKeys,
|
||||
onChange: this.onSelectChange
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -41,6 +41,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import vip.xiaonuo.sys.modular.user.param.SysUserParam;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统组织机构控制器
|
||||
@ -107,8 +108,8 @@ public class SysOrgController {
|
||||
@DataScope
|
||||
@PostMapping("/sysOrg/delete")
|
||||
@BusinessLog(title = "系统组织机构_删除", opType = LogAnnotionOpTypeEnum.DELETE)
|
||||
public ResponseData delete(@RequestBody @Validated(BaseParam.delete.class) SysOrgParam sysOrgParam) {
|
||||
sysOrgService.delete(sysOrgParam);
|
||||
public ResponseData delete(@RequestBody @Validated(BaseParam.delete.class) List<SysOrgParam> sysOrgParamList) {
|
||||
sysOrgService.delete(sysOrgParamList);
|
||||
return new SuccessResponseData();
|
||||
}
|
||||
|
||||
|
@ -72,11 +72,11 @@ public interface SysOrgService extends IService<SysOrg> {
|
||||
/**
|
||||
* 删除系统组织机构
|
||||
*
|
||||
* @param sysOrgParam 删除参数
|
||||
* @param sysOrgParamList 删除参数集合
|
||||
* @author xuyuxiang
|
||||
* @date 2020/3/25 14:57
|
||||
*/
|
||||
void delete(SysOrgParam sysOrgParam);
|
||||
void delete(List<SysOrgParam> sysOrgParamList);
|
||||
|
||||
/**
|
||||
* 编辑系统组织机构
|
||||
|
@ -195,7 +195,8 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void delete(SysOrgParam sysOrgParam) {
|
||||
public void delete(List<SysOrgParam> sysOrgParamList) {
|
||||
sysOrgParamList.forEach(sysOrgParam -> {
|
||||
SysOrg sysOrg = this.querySysOrg(sysOrgParam);
|
||||
Long id = sysOrg.getId();
|
||||
boolean superAdmin = LoginContextHolder.me().isSuperAdmin();
|
||||
@ -234,7 +235,7 @@ public class SysOrgServiceImpl extends ServiceImpl<SysOrgMapper, SysOrg> impleme
|
||||
|
||||
// 级联删除该机构子机构对应的用户-数据范围关联信息
|
||||
sysUserDataScopeService.deleteUserDataScopeListByOrgIdList(childIdList);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
|
@ -38,6 +38,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统职位控制器
|
||||
@ -100,8 +101,8 @@ public class SysPosController {
|
||||
@Permission
|
||||
@PostMapping("/sysPos/delete")
|
||||
@BusinessLog(title = "系统职位_删除", opType = LogAnnotionOpTypeEnum.DELETE)
|
||||
public ResponseData delete(@RequestBody @Validated(SysPosParam.delete.class) SysPosParam sysPosParam) {
|
||||
sysPosService.delete(sysPosParam);
|
||||
public ResponseData delete(@RequestBody @Validated(SysPosParam.delete.class) List<SysPosParam> sysPosParamList) {
|
||||
sysPosService.delete(sysPosParamList);
|
||||
return new SuccessResponseData();
|
||||
}
|
||||
|
||||
|
@ -71,11 +71,11 @@ public interface SysPosService extends IService<SysPos> {
|
||||
/**
|
||||
* 删除系统职位
|
||||
*
|
||||
* @param sysPosParam 删除参数
|
||||
* @param sysPosParamList 删除参数集合
|
||||
* @author xuyuxiang
|
||||
* @date 2020/3/25 14:57
|
||||
*/
|
||||
void delete(SysPosParam sysPosParam);
|
||||
void delete(List<SysPosParam> sysPosParamList);
|
||||
|
||||
/**
|
||||
* 编辑系统职位
|
||||
|
@ -107,7 +107,8 @@ public class SysPosServiceImpl extends ServiceImpl<SysPosMapper, SysPos> impleme
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void delete(SysPosParam sysPosParam) {
|
||||
public void delete(List<SysPosParam> sysPosParamList) {
|
||||
sysPosParamList.forEach(sysPosParam -> {
|
||||
SysPos sysPos = this.querySysPos(sysPosParam);
|
||||
Long id = sysPos.getId();
|
||||
//该职位下是否有员工
|
||||
@ -124,6 +125,7 @@ public class SysPosServiceImpl extends ServiceImpl<SysPosMapper, SysPos> impleme
|
||||
}
|
||||
sysPos.setStatus(CommonStatusEnum.DELETED.getCode());
|
||||
this.updateById(sysPos);
|
||||
});
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
|
Loading…
x
Reference in New Issue
Block a user