fix: bug#10742、10828、10827、10657
This commit is contained in:
parent
0c4c93c386
commit
62f8061e3b
|
@ -8,12 +8,13 @@
|
|||
visible
|
||||
@cancel="emits('update:visible', false)"
|
||||
>
|
||||
<a-alert
|
||||
message="只能分配有'共享'权限的资产数据"
|
||||
type="warning"
|
||||
show-icon
|
||||
/>
|
||||
<div style="margin-top: 5px;">
|
||||
<div class="alert-info">
|
||||
<j-space>
|
||||
<AIcon type="ExclamationCircleOutlined" />
|
||||
<span>只能分配有'共享'权限的资产数据</span>
|
||||
</j-space>
|
||||
</div>
|
||||
<div style="margin-top: 5px">
|
||||
<span>资产权限:</span>
|
||||
<j-checkbox-group
|
||||
v-model:value="form.permission"
|
||||
|
@ -67,4 +68,11 @@ const options = computed(() => {
|
|||
});
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
<style scoped lang="less">
|
||||
.alert-info {
|
||||
background: #f3f3f3;
|
||||
border-radius: 2px;
|
||||
padding: 6px;
|
||||
color: rgba(0, 0, 0, 0.55);
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -83,7 +83,7 @@
|
|||
<div
|
||||
class="pager"
|
||||
v-if="
|
||||
requestBody.params.paramsTable.length &&
|
||||
requestBody.params.paramsTable.length > 10 &&
|
||||
requestBody.pageSize
|
||||
"
|
||||
>
|
||||
|
|
|
@ -83,10 +83,27 @@ const rowSelection = {
|
|||
selectedRowKeys: ref<string[]>([]),
|
||||
};
|
||||
const save = async () => {
|
||||
const keys = props.selectedRowKeys;
|
||||
// fix: #bug10828
|
||||
// 当前节点表格数据id
|
||||
const currenTableKeys = props.tableData.map((m: any) => m.id);
|
||||
// 当前表格选中的id
|
||||
const currentSelectedKeys = rowSelection.selectedRowKeys.value;
|
||||
// 当前表格, 原有选中的id
|
||||
const oldSelectedKeys = currenTableKeys.filter((key) =>
|
||||
props.sourceKeys.includes(key),
|
||||
);
|
||||
|
||||
const removeKeys = props.sourceKeys.filter((key) => !keys.includes(key));
|
||||
const addKeys = keys.filter((key) => !props.sourceKeys.includes(key));
|
||||
// const keys = props.selectedRowKeys;
|
||||
// const removeKeys = props.sourceKeys.filter((key) => !keys.includes(key));
|
||||
// const addKeys = keys.filter((key) => !props.sourceKeys.includes(key));
|
||||
// 取消选择的数据项
|
||||
const removeKeys = oldSelectedKeys.filter(
|
||||
(key) => !currentSelectedKeys.includes(key),
|
||||
);
|
||||
// 新增选择的项
|
||||
const addKeys = currentSelectedKeys.filter(
|
||||
(key) => !oldSelectedKeys.includes(key),
|
||||
);
|
||||
|
||||
if (props.mode === 'api') {
|
||||
// 此时是api配置
|
||||
|
|
|
@ -117,9 +117,12 @@
|
|||
show-search
|
||||
style="width: 100%"
|
||||
placeholder="请选择组织"
|
||||
multiple
|
||||
:tree-data="form.departmentOptions"
|
||||
:fieldNames="{ label: 'name', value: 'id' }"
|
||||
multiple
|
||||
:filterTreeNode="
|
||||
(v: string, node: any) => filterSelectNode(v, node, 'name')
|
||||
"
|
||||
>
|
||||
<template #title="{ name }">
|
||||
{{ name }}
|
||||
|
@ -195,6 +198,7 @@ import { Rule } from 'ant-design-vue/es/form';
|
|||
import { DefaultOptionType } from 'ant-design-vue/es/vc-tree-select/TreeSelect';
|
||||
import { AxiosResponse } from 'axios';
|
||||
import { passwordRegEx } from '@/utils/validate';
|
||||
import { filterSelectNode } from '@/utils/comm';
|
||||
|
||||
const deptPermission = 'system/Department';
|
||||
const rolePermission = 'system/Role';
|
||||
|
@ -250,7 +254,8 @@ const form = reactive({
|
|||
if (!value) return reject('请输入密码');
|
||||
else if (value.length > 64) return reject('最多可输入64个字符');
|
||||
else if (value.length < 8) return reject('密码不能少于8位');
|
||||
else if (!passwordRegEx(value)) return reject('密码必须包含大小写英文和数字');
|
||||
else if (!passwordRegEx(value))
|
||||
return reject('密码必须包含大小写英文和数字');
|
||||
validateField_api('password', value).then((resp: any) => {
|
||||
resp.result.passed
|
||||
? resolve('')
|
||||
|
|
Loading…
Reference in New Issue