Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dsk-operate-sys-cscec
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fulixin
dsk-operate-sys-cscec
Commits
a11f3d06
Commit
a11f3d06
authored
Nov 16, 2023
by
tianhongyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
企业管理新添账号前端增加验证规则
修复框架自带角色管理模块数据权限取值错误bug
parent
06818197
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
305 additions
and
339 deletions
+305
-339
index.js
dsk-operate-ui/src/utils/index.js
+18
-0
EnterpriseAddAccount.vue
.../enterpriseManagement/components/EnterpriseAddAccount.vue
+6
-4
index.vue
dsk-operate-ui/src/views/enterpriseManagement/index.vue
+5
-5
programme.vue
dsk-operate-ui/src/views/enterpriseManagement/programme.vue
+264
-318
index.vue
dsk-operate-ui/src/views/system/role/index.vue
+12
-12
No files found.
dsk-operate-ui/src/utils/index.js
View file @
a11f3d06
...
...
@@ -565,6 +565,24 @@ export async function elementMessageSingleton(type = "success", messgage = "") {
}
}
/**
* 检测数组对象中是否有重复数据
* @param {Array} arr
* @param {string | null} mapKey
* @returns
*/
export
function
hasDuplicates
(
arr
,
mapKey
=
null
)
{
const
map
=
new
Map
();
for
(
const
item
of
arr
)
{
const
key
=
mapKey
?
item
[
mapKey
]
:
JSON
.
stringify
(
item
);
if
(
map
.
has
(
key
))
{
return
{
hasRepeat
:
true
,
repeatKey
:
key
};
}
map
.
set
(
key
,
true
);
}
return
{
hasRepeat
:
false
,
repeatKey
:
key
};
}
// 甲方详情左侧菜单映射
export
const
detailSideBar
=
new
Map
([
// 企业速览
...
...
dsk-operate-ui/src/views/enterpriseManagement/components/EnterpriseAddAccount.vue
View file @
a11f3d06
...
...
@@ -30,7 +30,7 @@
<!-- 底部提交 取消按钮 -->
<div
class=
"add-account-footer"
>
<el-button
type=
"primary"
size=
"medium"
@
click=
"submitAdd"
>
确定
</el-button>
<el-button
size=
"medium"
@
click=
"dialog
Clo
se"
>
取消
</el-button>
<el-button
size=
"medium"
@
click=
"dialog
Status = fal
se"
>
取消
</el-button>
</div>
</
template
>
</el-dialog>
...
...
@@ -40,7 +40,7 @@
import
{
Loading
}
from
'element-ui'
;
import
{
enterpriseAddAccountApi
}
from
"@/api/enterpriseManagement/enterpriseManagement"
;
import
{
phoneNumberValidator
,
requiredStrLengthValidator
}
from
"@/utils/validate"
;
import
{
elementMessageSingleton
}
from
"@/utils/"
;
import
{
elementMessageSingleton
,
hasDuplicates
}
from
"@/utils/"
;
import
{
v4
}
from
'uuid'
;
export
default
{
name
:
"enterpriseAddAccount"
,
...
...
@@ -111,6 +111,7 @@ export default {
},
addAccount
()
{
if
(
this
.
comAddAccountCount
>=
6
)
return
elementMessageSingleton
(
"warning"
,
"该租户下已经添加了五个账号"
);
if
(
this
.
accountForm
.
accountList
?.
length
>=
5
)
return
elementMessageSingleton
(
"warning"
,
"最多添加五个账号"
);
const
remaining
=
6
-
this
.
comAddAccountCount
;
const
len
=
this
.
accountForm
?.
accountList
?.
length
;
if
(
len
>=
remaining
)
return
elementMessageSingleton
(
"warning"
,
`该租户下剩余可添加账号个数为
${
remaining
}
个,现已添加
${
len
}
个`
);
...
...
@@ -123,6 +124,8 @@ export default {
submitAdd
()
{
this
.
$refs
[
"accountForm"
].
validate
(
async
flag
=>
{
if
(
!
flag
)
return
;
const
{
hasRepeat
,
repeatKey
}
=
hasDuplicates
(
JSON
.
parse
(
JSON
.
stringify
(
this
.
accountForm
.
accountList
)),
"phonenumber"
);
if
(
hasRepeat
)
return
elementMessageSingleton
(
"warning"
,
`电话号码
${
repeatKey
}
不允许重复创建`
);
const
loadingService
=
Loading
.
service
({
target
:
".enterprise-add-account-dialog"
,
lock
:
true
,
...
...
@@ -130,7 +133,6 @@ export default {
});
let
successCount
=
0
;
try
{
// 验证通过提交信息
const
array
=
(
JSON
.
parse
(
JSON
.
stringify
(
this
.
accountForm
.
accountList
))).
map
(({
nickName
,
phonenumber
})
=>
({
nickName
,
phonenumber
}));
let
len
=
array
.
length
;
...
...
@@ -155,7 +157,7 @@ export default {
count
++
;
}
}
this
.
dialog
Close
()
;
this
.
dialog
Status
=
false
;
}
catch
(
error
)
{
console
.
log
(
error
);
}
finally
{
...
...
dsk-operate-ui/src/views/enterpriseManagement/index.vue
View file @
a11f3d06
...
...
@@ -68,7 +68,7 @@
<pagination
v-show=
"total>0"
:total=
"total"
:page
.
sync=
"queryParams.pageNum"
:limit
.
sync=
"queryParams.pageSize"
@
pagination=
"getList"
/>
<!-- 添加或修改对话框 -->
<el-dialog
:title=
"title"
:visible
.
sync=
"open"
width=
"800px"
append-to-body
>
<el-dialog
:title=
"title"
:visible
.
sync=
"open"
width=
"800px"
append-to-body
:close-on-click-modal=
"false"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"100px"
>
<el-row>
<el-col
:span=
"12"
>
...
...
@@ -85,7 +85,7 @@
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"续约时间"
prop=
"dateRange"
>
<el-date-picker
:disabled=
"disabled"
v-model=
"form.dateRange"
style=
"width:
240px
"
value-format=
"yyyy-MM-dd HH:mm:ss"
<el-date-picker
:disabled=
"disabled"
v-model=
"form.dateRange"
style=
"width:
100%
"
value-format=
"yyyy-MM-dd HH:mm:ss"
type=
"datetimerange"
range-separator=
"-"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
></el-date-picker>
</el-form-item>
</el-col>
...
...
@@ -98,7 +98,7 @@
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"企业方案"
prop=
"packageId"
>
<el-select
:disabled=
"disabled"
v-model=
"form.packageId"
placeholder=
"企业方案"
clearable
style=
"width:
240px
"
>
<el-select
:disabled=
"disabled"
v-model=
"form.packageId"
placeholder=
"企业方案"
clearable
style=
"width:
100%
"
>
<el-option
v-for=
"dict in packageList"
:key=
"dict.packageId"
:label=
"dict.packageName"
:value=
"dict.packageId"
/>
</el-select>
</el-form-item>
...
...
@@ -288,8 +288,8 @@ export default {
getList
()
{
this
.
loading
=
true
;
getTenantList
(
this
.
queryParams
).
then
(
response
=>
{
this
.
tenantList
=
response
.
rows
;
this
.
total
=
response
.
total
;
this
.
tenantList
=
response
.
rows
?
response
.
rows
:
[]
;
this
.
total
=
response
.
total
?
response
.
total
:
0
;
this
.
loading
=
false
;
}
);
...
...
dsk-operate-ui/src/views/enterpriseManagement/programme.vue
View file @
a11f3d06
This diff is collapsed.
Click to expand it.
dsk-operate-ui/src/views/system/role/index.vue
View file @
a11f3d06
...
...
@@ -297,7 +297,7 @@ export default {
/** 根据角色ID查询组织树结构 */
getDeptTree
(
roleId
)
{
return
deptTreeSelect
(
roleId
).
then
(
response
=>
{
this
.
deptOptions
=
response
.
d
epts
;
this
.
deptOptions
=
response
.
d
ata
?.
depts
?
response
.
data
?.
depts
:
[]
;
return
response
;
});
},
...
...
@@ -440,19 +440,19 @@ export default {
}
},
/** 分配数据权限操作 */
handleDataScope
(
row
)
{
async
handleDataScope
(
row
)
{
try
{
this
.
reset
();
const
deptTreeSelect
=
this
.
getDeptTree
(
row
.
roleId
);
getRole
(
row
.
roleId
).
then
(
response
=>
{
this
.
form
=
res
ponse
.
data
;
const
res
=
await
this
.
getDeptTree
(
row
.
roleId
);
const
result
=
await
getRole
(
row
.
roleId
);
this
.
form
=
res
ult
.
data
;
this
.
openDataScope
=
true
;
this
.
$nextTick
(()
=>
{
deptTreeSelect
.
then
(
res
=>
{
this
.
$refs
.
dept
.
setCheckedKeys
(
res
.
checkedKeys
);
});
});
this
.
title
=
"分配数据权限"
;
});
await
this
.
$nextTick
();
this
.
$refs
.
dept
.
setCheckedKeys
(
res
.
checkedKeys
?
res
.
checkedKeys
:
[]);
}
catch
(
error
)
{
console
.
log
(
error
);
}
},
/** 分配用户操作 */
handleAuthUser
:
function
(
row
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment