mirror of https://gitee.com/xiaonuobase/snowy
Merge branch 'dev' of https://gitee.com/xiaonuobase/snowy into dev
commit
6d85c7dae7
|
@ -5,9 +5,9 @@
|
||||||
@visibleChange="batchVisibleChange"
|
@visibleChange="batchVisibleChange"
|
||||||
@confirm="deleteBatch"
|
@confirm="deleteBatch"
|
||||||
>
|
>
|
||||||
<a-button :type="props.buttonType" :danger="props.buttonDanger">
|
<a-button :type="props.buttonType" :danger="props.buttonDanger" :size="props.size" :loading="buttonLoading">
|
||||||
<template #icon v-if="props.icon">
|
<template #icon v-if="props.icon">
|
||||||
<component :is="props.icon" />
|
<component :is="props.icon" :style="{ color: props.color }" />
|
||||||
</template>
|
</template>
|
||||||
{{ props.buttonName }}
|
{{ props.buttonName }}
|
||||||
</a-button>
|
</a-button>
|
||||||
|
@ -18,6 +18,7 @@
|
||||||
import { message } from 'ant-design-vue'
|
import { message } from 'ant-design-vue'
|
||||||
const batchVisible = ref(false)
|
const batchVisible = ref(false)
|
||||||
const emit = defineEmits({ batchCallBack: null })
|
const emit = defineEmits({ batchCallBack: null })
|
||||||
|
const buttonLoading = ref(false)
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
buttonName: {
|
buttonName: {
|
||||||
type: String,
|
type: String,
|
||||||
|
@ -35,9 +36,17 @@
|
||||||
type: String,
|
type: String,
|
||||||
default: () => ''
|
default: () => ''
|
||||||
},
|
},
|
||||||
|
size: {
|
||||||
|
type: String,
|
||||||
|
default: () => 'middle'
|
||||||
|
},
|
||||||
selectedRowKeys: {
|
selectedRowKeys: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => []
|
default: () => []
|
||||||
|
},
|
||||||
|
color: {
|
||||||
|
type: String,
|
||||||
|
default: () => ''
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// 参数校验
|
// 参数校验
|
||||||
|
@ -64,4 +73,12 @@
|
||||||
// 发起方法调用,谁的谁来实现
|
// 发起方法调用,谁的谁来实现
|
||||||
emit('batchCallBack', params)
|
emit('batchCallBack', params)
|
||||||
}
|
}
|
||||||
|
// 打开loading
|
||||||
|
const loading = () => {
|
||||||
|
buttonLoading.value = true
|
||||||
|
}
|
||||||
|
// 关闭loading
|
||||||
|
const closeLoading = () => {
|
||||||
|
buttonLoading.value = true
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -5,11 +5,11 @@
|
||||||
name="file"
|
name="file"
|
||||||
:action="action"
|
:action="action"
|
||||||
:headers="headers"
|
:headers="headers"
|
||||||
:maxCount="props.uploadMumber"
|
:maxCount="props.uploadNumber"
|
||||||
@change="handleChange"
|
@change="handleChange"
|
||||||
>
|
>
|
||||||
<a-button>
|
<a-button>
|
||||||
<upload-outlined></upload-outlined>
|
<upload-outlined />
|
||||||
上传
|
上传
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-upload>
|
</a-upload>
|
||||||
|
@ -21,11 +21,11 @@
|
||||||
:multiple="true"
|
:multiple="true"
|
||||||
:action="action"
|
:action="action"
|
||||||
:headers="headers"
|
:headers="headers"
|
||||||
:maxCount="props.uploadMumber"
|
:maxCount="props.uploadNumber"
|
||||||
@change="handleChange"
|
@change="handleChange"
|
||||||
>
|
>
|
||||||
<p class="ant-upload-drag-icon">
|
<p class="ant-upload-drag-icon">
|
||||||
<inbox-outlined></inbox-outlined>
|
<inbox-outlined />
|
||||||
</p>
|
</p>
|
||||||
<p class="ant-upload-text">单击或拖动文件到此区域上传</p>
|
<p class="ant-upload-text">单击或拖动文件到此区域上传</p>
|
||||||
<p class="ant-upload-hint"></p>
|
<p class="ant-upload-hint"></p>
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
required: false
|
required: false
|
||||||
},
|
},
|
||||||
// 上传数量
|
// 上传数量
|
||||||
uploadMumber: {
|
uploadNumber: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 1,
|
default: 1,
|
||||||
required: false
|
required: false
|
||||||
|
@ -61,11 +61,13 @@
|
||||||
})
|
})
|
||||||
const action = sysConfig.API_URL + props.action
|
const action = sysConfig.API_URL + props.action
|
||||||
|
|
||||||
|
// 上传时间,构造上传数组,主动推送至调用组件,单文件可以使用
|
||||||
const handleChange = () => {
|
const handleChange = () => {
|
||||||
|
// 单个文件可以使用回调方法,多个文件建议主动获取
|
||||||
let result = []
|
let result = []
|
||||||
for (let a = 0; a < props.uploadMumber; a++) {
|
for (let a = 0; a < props.uploadNumber; a++) {
|
||||||
const file = fileList.value[a]
|
const file = fileList.value[a]
|
||||||
if (file.status === 'done' && file.response && file.response.code === 200) {
|
if (file && file.status === 'done' && file.response && file.response.code === 200) {
|
||||||
const resultObj = {
|
const resultObj = {
|
||||||
name: file.name,
|
name: file.name,
|
||||||
url: file.response.data
|
url: file.response.data
|
||||||
|
@ -77,4 +79,27 @@
|
||||||
emit('uploadDone', result)
|
emit('uploadDone', result)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 通过DOM获取上传的文件
|
||||||
|
const uploadFileList = () => {
|
||||||
|
if (fileList.value) {
|
||||||
|
const result = []
|
||||||
|
// 只返回这些就够用了,其他基本用不到
|
||||||
|
fileList.value.forEach((item) => {
|
||||||
|
const obj = {
|
||||||
|
name: item.name,
|
||||||
|
type: item.type,
|
||||||
|
size: item.size,
|
||||||
|
url: item.response.data
|
||||||
|
}
|
||||||
|
result.push(obj)
|
||||||
|
})
|
||||||
|
return result
|
||||||
|
} else {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 抛出这个获取文件列表的方法
|
||||||
|
defineExpose({
|
||||||
|
uploadFileList
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -116,7 +116,6 @@ service.interceptors.response.use(
|
||||||
'update',
|
'update',
|
||||||
'grant',
|
'grant',
|
||||||
'reset',
|
'reset',
|
||||||
'start',
|
|
||||||
'stop',
|
'stop',
|
||||||
'pass',
|
'pass',
|
||||||
'disable',
|
'disable',
|
||||||
|
@ -126,7 +125,8 @@ service.interceptors.response.use(
|
||||||
'active',
|
'active',
|
||||||
'turn',
|
'turn',
|
||||||
'adjust',
|
'adjust',
|
||||||
'reject'
|
'reject',
|
||||||
|
'saveDraft'
|
||||||
]
|
]
|
||||||
apiNameArray.forEach((apiName) => {
|
apiNameArray.forEach((apiName) => {
|
||||||
if (responseUrl.includes(apiName)) {
|
if (responseUrl.includes(apiName)) {
|
||||||
|
|
|
@ -186,7 +186,7 @@ public class BizUserServiceImpl extends ServiceImpl<BizUserMapper, BizUser> impl
|
||||||
throw new CommonException("手机号码:{}格式错误", bizUserAddParam.getPhone());
|
throw new CommonException("手机号码:{}格式错误", bizUserAddParam.getPhone());
|
||||||
}
|
}
|
||||||
if (this.count(new LambdaQueryWrapper<BizUser>()
|
if (this.count(new LambdaQueryWrapper<BizUser>()
|
||||||
.eq(BizUser::getPhone, bizUserAddParam.getPhone())) > 0) {
|
.eq(BizUser::getPhone, CommonCryptogramUtil.doSm4CbcEncrypt(bizUserAddParam.getPhone()))) > 0) {
|
||||||
throw new CommonException("存在重复的手机号,手机号为:{}", bizUserAddParam.getPhone());
|
throw new CommonException("存在重复的手机号,手机号为:{}", bizUserAddParam.getPhone());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -240,7 +240,7 @@ public class BizUserServiceImpl extends ServiceImpl<BizUserMapper, BizUser> impl
|
||||||
throw new CommonException("手机号码:{}格式错误", bizUserEditParam.getPhone());
|
throw new CommonException("手机号码:{}格式错误", bizUserEditParam.getPhone());
|
||||||
}
|
}
|
||||||
if (this.count(new LambdaQueryWrapper<BizUser>()
|
if (this.count(new LambdaQueryWrapper<BizUser>()
|
||||||
.eq(BizUser::getPhone, bizUserEditParam.getPhone())
|
.eq(BizUser::getPhone, CommonCryptogramUtil.doSm4CbcEncrypt(bizUserEditParam.getPhone()))
|
||||||
.ne(BizUser::getId, bizUserEditParam.getId())) > 0) {
|
.ne(BizUser::getId, bizUserEditParam.getId())) > 0) {
|
||||||
throw new CommonException("存在重复的手机号,手机号为:{}", bizUserEditParam.getPhone());
|
throw new CommonException("存在重复的手机号,手机号为:{}", bizUserEditParam.getPhone());
|
||||||
}
|
}
|
||||||
|
|
|
@ -147,7 +147,7 @@ public class ClientUserServiceImpl extends ServiceImpl<ClientUserMapper, ClientU
|
||||||
throw new CommonException("手机号码:{}格式错误", clientUserAddParam.getPhone());
|
throw new CommonException("手机号码:{}格式错误", clientUserAddParam.getPhone());
|
||||||
}
|
}
|
||||||
if (this.count(new LambdaQueryWrapper<ClientUser>()
|
if (this.count(new LambdaQueryWrapper<ClientUser>()
|
||||||
.eq(ClientUser::getPhone, clientUserAddParam.getPhone())) > 0) {
|
.eq(ClientUser::getPhone, CommonCryptogramUtil.doSm4CbcEncrypt(clientUserAddParam.getPhone()))) > 0) {
|
||||||
throw new CommonException("存在重复的手机号,手机号为:{}", clientUserAddParam.getPhone());
|
throw new CommonException("存在重复的手机号,手机号为:{}", clientUserAddParam.getPhone());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -181,7 +181,7 @@ public class ClientUserServiceImpl extends ServiceImpl<ClientUserMapper, ClientU
|
||||||
throw new CommonException("手机号码:{}格式错误", clientUserEditParam.getPhone());
|
throw new CommonException("手机号码:{}格式错误", clientUserEditParam.getPhone());
|
||||||
}
|
}
|
||||||
if (this.count(new LambdaQueryWrapper<ClientUser>()
|
if (this.count(new LambdaQueryWrapper<ClientUser>()
|
||||||
.eq(ClientUser::getPhone, clientUserEditParam.getPhone())
|
.eq(ClientUser::getPhone, CommonCryptogramUtil.doSm4CbcEncrypt(clientUserEditParam.getPhone()))
|
||||||
.ne(ClientUser::getId, clientUserEditParam.getId())) > 0) {
|
.ne(ClientUser::getId, clientUserEditParam.getId())) > 0) {
|
||||||
throw new CommonException("存在重复的手机号,手机号为:{}", clientUserEditParam.getPhone());
|
throw new CommonException("存在重复的手机号,手机号为:{}", clientUserEditParam.getPhone());
|
||||||
}
|
}
|
||||||
|
|
|
@ -264,7 +264,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||||
throw new CommonException("手机号码:{}格式错误", sysUserAddParam.getPhone());
|
throw new CommonException("手机号码:{}格式错误", sysUserAddParam.getPhone());
|
||||||
}
|
}
|
||||||
if (this.count(new LambdaQueryWrapper<SysUser>()
|
if (this.count(new LambdaQueryWrapper<SysUser>()
|
||||||
.eq(SysUser::getPhone, sysUserAddParam.getPhone())) > 0) {
|
.eq(SysUser::getPhone, CommonCryptogramUtil.doSm4CbcEncrypt(sysUserAddParam.getPhone()))) > 0) {
|
||||||
throw new CommonException("存在重复的手机号,手机号为:{}", sysUserAddParam.getPhone());
|
throw new CommonException("存在重复的手机号,手机号为:{}", sysUserAddParam.getPhone());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -307,7 +307,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||||
throw new CommonException("手机号码:{}格式错误", sysUserEditParam.getPhone());
|
throw new CommonException("手机号码:{}格式错误", sysUserEditParam.getPhone());
|
||||||
}
|
}
|
||||||
if (this.count(new LambdaQueryWrapper<SysUser>()
|
if (this.count(new LambdaQueryWrapper<SysUser>()
|
||||||
.eq(SysUser::getPhone, sysUserEditParam.getPhone())
|
.eq(SysUser::getPhone, CommonCryptogramUtil.doSm4CbcEncrypt(sysUserEditParam.getPhone()))
|
||||||
.ne(SysUser::getId, sysUserEditParam.getId())) > 0) {
|
.ne(SysUser::getId, sysUserEditParam.getId())) > 0) {
|
||||||
throw new CommonException("存在重复的手机号,手机号为:{}", sysUserEditParam.getPhone());
|
throw new CommonException("存在重复的手机号,手机号为:{}", sysUserEditParam.getPhone());
|
||||||
}
|
}
|
||||||
|
@ -784,30 +784,30 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void grantResource(SysUserGrantResourceParam sysUserGrantResourceParam) {
|
public void grantResource(SysUserGrantResourceParam sysUserGrantResourceParam) {
|
||||||
String id = sysUserGrantResourceParam.getId();
|
|
||||||
SysUserIdParam sysUserIdParam = new SysUserIdParam();
|
|
||||||
List<String> roleIdList = this.ownRole(sysUserIdParam);
|
|
||||||
if(ObjectUtil.isEmpty(roleIdList)) {
|
|
||||||
throw new CommonException("非超管角色用户不可被授权系统模块菜单资源");
|
|
||||||
}
|
|
||||||
boolean hasSuperAdminRole = sysRoleService.listByIds(roleIdList).stream().map(SysRole::getCode).collect(Collectors.toSet())
|
|
||||||
.contains(SysBuildInEnum.BUILD_IN_ROLE_CODE.getValue());
|
|
||||||
List<String> menuIdList = sysUserGrantResourceParam.getGrantInfoList().stream()
|
List<String> menuIdList = sysUserGrantResourceParam.getGrantInfoList().stream()
|
||||||
.map(SysUserGrantResourceParam.SysUserGrantResource::getMenuId).collect(Collectors.toList());
|
.map(SysUserGrantResourceParam.SysUserGrantResource::getMenuId).collect(Collectors.toList());
|
||||||
if(!hasSuperAdminRole) {
|
if(ObjectUtil.isNotEmpty(menuIdList)) {
|
||||||
if(ObjectUtil.isNotEmpty(menuIdList)) {
|
SysUserIdParam sysUserIdParam = new SysUserIdParam();
|
||||||
Set<String> sysModuleIdList = sysMenuService.listByIds(menuIdList).stream().map(SysMenu::getModule).collect(Collectors.toSet());
|
sysUserIdParam.setId(sysUserGrantResourceParam.getId());
|
||||||
boolean containsSystemModule = sysModuleService.listByIds(sysModuleIdList).stream().map(SysModule::getCode)
|
List<String> roleIdList = this.ownRole(sysUserIdParam);
|
||||||
.collect(Collectors.toSet()).contains(SysBuildInEnum.BUILD_IN_MODULE_CODE.getValue());
|
Set<String> sysModuleIdList = sysMenuService.listByIds(menuIdList).stream().map(SysMenu::getModule).collect(Collectors.toSet());
|
||||||
if(containsSystemModule) {
|
boolean containsSystemModule = sysModuleService.listByIds(sysModuleIdList).stream().map(SysModule::getCode)
|
||||||
|
.collect(Collectors.toSet()).contains(SysBuildInEnum.BUILD_IN_MODULE_CODE.getValue());
|
||||||
|
if(containsSystemModule) {
|
||||||
|
if(ObjectUtil.isEmpty(roleIdList)) {
|
||||||
throw new CommonException("非超管角色用户不可被授权系统模块菜单资源");
|
throw new CommonException("非超管角色用户不可被授权系统模块菜单资源");
|
||||||
|
} else {
|
||||||
|
boolean hasSuperAdminRole = sysRoleService.listByIds(roleIdList).stream().map(SysRole::getCode).collect(Collectors.toSet())
|
||||||
|
.contains(SysBuildInEnum.BUILD_IN_ROLE_CODE.getValue());
|
||||||
|
if(!hasSuperAdminRole) {
|
||||||
|
throw new CommonException("非超管角色用户不可被授权系统模块菜单资源");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
List<String> extJsonList = sysUserGrantResourceParam.getGrantInfoList().stream()
|
||||||
|
.map(JSONUtil::toJsonStr).collect(Collectors.toList());
|
||||||
|
sysRelationService.saveRelationBatchWithClear(sysUserGrantResourceParam.getId(), menuIdList, SysRelationCategoryEnum.SYS_USER_HAS_RESOURCE.getValue(), extJsonList);
|
||||||
}
|
}
|
||||||
List<String> extJsonList = sysUserGrantResourceParam.getGrantInfoList().stream()
|
|
||||||
.map(JSONUtil::toJsonStr).collect(Collectors.toList());
|
|
||||||
sysRelationService.saveRelationBatchWithClear(id, menuIdList, SysRelationCategoryEnum.SYS_USER_HAS_RESOURCE.getValue(),
|
|
||||||
extJsonList);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -858,7 +858,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||||
throw new CommonException("手机号码:{}格式错误", sysUserUpdateInfoParam.getPhone());
|
throw new CommonException("手机号码:{}格式错误", sysUserUpdateInfoParam.getPhone());
|
||||||
}
|
}
|
||||||
if (this.count(new LambdaQueryWrapper<SysUser>().ne(SysUser::getId, sysUser.getId())
|
if (this.count(new LambdaQueryWrapper<SysUser>().ne(SysUser::getId, sysUser.getId())
|
||||||
.eq(SysUser::getPhone, sysUserUpdateInfoParam.getPhone())) > 0) {
|
.eq(SysUser::getPhone, CommonCryptogramUtil.doSm4CbcEncrypt(sysUserUpdateInfoParam.getPhone()))) > 0) {
|
||||||
throw new CommonException("存在重复的手机号,手机号为:{}", sysUserUpdateInfoParam.getPhone());
|
throw new CommonException("存在重复的手机号,手机号为:{}", sysUserUpdateInfoParam.getPhone());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue