Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
so-manage-ui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
smart-operation
so-manage-ui
Commits
ec327f7b
Commit
ec327f7b
authored
Jul 05, 2023
by
李鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
authority
parent
9de794c5
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
168 additions
and
367 deletions
+168
-367
src/page/main/authority/organization/index.vue
src/page/main/authority/organization/index.vue
+1
-1
src/page/main/authority/organization/user-detail/index.vue
src/page/main/authority/organization/user-detail/index.vue
+75
-99
src/page/main/authority/user/add/index.vue
src/page/main/authority/user/add/index.vue
+43
-39
src/page/main/authority/user/add/system-form.vue
src/page/main/authority/user/add/system-form.vue
+35
-208
src/page/main/authority/user/index.vue
src/page/main/authority/user/index.vue
+14
-20
No files found.
src/page/main/authority/organization/index.vue
View file @
ec327f7b
...
@@ -173,7 +173,7 @@ const headers = reactive([
...
@@ -173,7 +173,7 @@ const headers = reactive([
},
},
{
{
label
:
"
手机号
"
,
label
:
"
手机号
"
,
prop
:
"
contact_
phone
"
,
prop
:
"
phone
"
,
minWidth
:
150
,
minWidth
:
150
,
},
},
{
{
...
...
src/page/main/authority/organization/user-detail/index.vue
View file @
ec327f7b
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<div
class=
"page_content apaas_scroll"
>
<div
class=
"page_content apaas_scroll"
>
<div
class=
"info_row"
>
<div
class=
"info_row"
>
<div
class=
"title"
>
<div
class=
"title"
>
<div><span
class=
"icon_box"
></span>
账号
信息
</div>
<div><span
class=
"icon_box"
></span>
基础
信息
</div>
<div
class=
"dashed_line"
></div>
<div
class=
"dashed_line"
></div>
</div>
</div>
<div
class=
"info_content"
>
<div
class=
"info_content"
>
...
@@ -17,20 +17,14 @@
...
@@ -17,20 +17,14 @@
alt=
""
/>
alt=
""
/>
</div>
</div>
<div
class=
"info_box"
>
<div
class=
"info_box"
>
<bg-info
:data=
"accountInfo"
></bg-info>
<bg-detail-table2
class=
"detail_info"
:list=
"accountInfo"
>
</div>
<template
#state
="
{ data }">
</div>
<p
class=
"detail-module"
>
</div>
<span>
{{
data
.
label
}}
</span>
<div>
<span
:class=
"data.value ? 'active' : 'disabled'"
>
{{
data
.
value
?
"
启用
"
:
"
禁用
"
}}
</span>
<div
class=
"title"
>
</p>
<div><span
class=
"icon_box"
></span>
个人信息
</div>
</
template
>
<div
class=
"dashed_line"
></div>
</bg-detail-table2>
</div>
<div
class=
"info_content"
>
<div
class=
"img_box"
></div>
<div
class=
"info_box"
>
<bg-info
v-if=
"accountType === 2"
:data=
"personInfo"
></bg-info>
<bg-info
v-if=
"accountType === 3"
:data=
"personInfo2"
></bg-info>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -39,7 +33,7 @@
...
@@ -39,7 +33,7 @@
</template>
</template>
<
script
setup
>
<
script
setup
>
import
{
reactive
,
toRefs
,
ref
,
computed
,
onBeforeMount
}
from
"
vue
"
;
import
{
reactive
,
ref
,
onBeforeMount
}
from
"
vue
"
;
import
{
useRoute
}
from
"
vue-router
"
;
import
{
useRoute
}
from
"
vue-router
"
;
import
axios
from
"
@/request/http.js
"
;
import
axios
from
"
@/request/http.js
"
;
import
{
ElMessage
}
from
"
element-plus
"
;
import
{
ElMessage
}
from
"
element-plus
"
;
...
@@ -48,120 +42,64 @@ const route = useRoute();
...
@@ -48,120 +42,64 @@ const route = useRoute();
const
accountInfo
=
reactive
([
const
accountInfo
=
reactive
([
{
{
name
:
"
手机号
"
,
key
:
"
name
"
,
value
:
""
,
label
:
"
姓名
"
,
nameWidth
:
130
,
},
{
name
:
"
账号
"
,
value
:
""
,
nameWidth
:
130
,
},
{
name
:
"
角色
"
,
value
:
""
,
nameWidth
:
130
,
},
{
name
:
"
所属组织
"
,
value
:
""
,
nameWidth
:
130
,
},
{
name
:
"
创建人
"
,
value
:
""
,
value
:
""
,
nameWidth
:
130
,
},
},
{
{
name
:
"
创建账号
"
,
key
:
"
organization
"
,
label
:
"
所属组织
"
,
value
:
""
,
value
:
""
,
nameWidth
:
130
,
},
},
{
{
name
:
"
最后编辑时间
"
,
key
:
"
system_account
"
,
label
:
"
账号
"
,
value
:
""
,
value
:
""
,
nameWidth
:
130
,
},
},
{
{
name
:
"
创建时间
"
,
key
:
"
phone
"
,
label
:
"
手机号
"
,
value
:
""
,
value
:
""
,
nameWidth
:
130
,
},
},
]);
const
personInfo
=
reactive
([
{
name
:
"
姓名
"
,
value
:
""
,
nameWidth
:
130
,
},
{
{
name
:
"
邮箱
"
,
key
:
"
system_role
"
,
label
:
"
角色
"
,
value
:
""
,
value
:
""
,
nameWidth
:
130
,
},
},
{
{
name
:
"
证据类型
"
,
key
:
"
state
"
,
label
:
"
是否启用
"
,
value
:
""
,
value
:
""
,
nameWidth
:
130
,
slot
:
"
state
"
,
},
},
{
{
name
:
"
身份证号
"
,
key
:
"
created_name
"
,
label
:
"
创建人
"
,
value
:
""
,
value
:
""
,
idCard
:
true
,
nameWidth
:
130
,
},
},
{
{
name
:
"
备注
"
,
key
:
"
created_time
"
,
label
:
"
创建时间
"
,
value
:
""
,
value
:
""
,
full
:
true
,
nameWidth
:
130
,
},
]);
const
personInfo2
=
reactive
([
{
name
:
"
姓名
"
,
value
:
""
,
nameWidth
:
130
,
},
{
name
:
"
邮箱
"
,
value
:
""
,
nameWidth
:
130
,
},
{
name
:
"
备注
"
,
value
:
""
,
full
:
true
,
nameWidth
:
130
,
},
},
]);
]);
const
logo
=
ref
(
""
);
const
logo
=
ref
(
""
);
const
accountType
=
ref
(
2
);
//1.业务系统账号 2.组织管理员账号 3.平台用户账号
const
getDetail
=
()
=>
{
const
getDetail
=
()
=>
{
axios
.
get
(
`/
apaas/system/v5/org
/user/
${
route
.
query
.
id
}
`
).
then
((
res
)
=>
{
axios
.
get
(
`/
v1/api
/user/
${
route
.
query
.
id
}
`
).
then
((
res
)
=>
{
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
const
detail
=
res
.
data
.
data
;
const
detail
=
res
.
data
.
data
;
accountInfo
[
0
].
value
=
detail
.
contact_phone
;
accountInfo
[
0
].
value
=
detail
.
name
;
accountInfo
[
1
].
value
=
detail
.
system_account
;
accountInfo
[
1
].
value
=
detail
.
organization
;
accountInfo
[
2
].
value
=
detail
.
system_role
&&
detail
.
system_role
.
length
>
0
?
detail
.
system_role
.
join
(
"
、
"
)
:
""
;
accountInfo
[
2
].
value
=
detail
.
system_account
;
accountInfo
[
3
].
value
=
detail
.
organization
;
accountInfo
[
3
].
value
=
detail
.
phone
;
accountInfo
[
4
].
value
=
detail
.
created_by
;
accountInfo
[
4
].
value
=
accountInfo
[
5
].
value
=
detail
.
created_by_account
;
detail
.
system_role_name
&&
detail
.
system_role_name
.
length
>
0
?
detail
.
system_role_name
.
join
(
"
、
"
)
:
""
;
accountInfo
[
6
].
value
=
detail
.
updated_time
;
accountInfo
[
5
].
value
=
detail
.
state
;
accountInfo
[
6
].
value
=
detail
.
created_name
;
accountInfo
[
7
].
value
=
detail
.
created_time
;
accountInfo
[
7
].
value
=
detail
.
created_time
;
personInfo
[
0
].
value
=
detail
.
contact_name
;
personInfo
[
1
].
value
=
detail
.
contact_email
;
personInfo
[
2
].
value
=
detail
.
document_type
===
1
?
"
身份证
"
:
""
;
personInfo
[
3
].
value
=
detail
.
document_number
;
personInfo
[
4
].
value
=
detail
.
remark
;
personInfo2
[
0
].
value
=
detail
.
contact_name
;
personInfo2
[
1
].
value
=
detail
.
contact_email
;
personInfo2
[
2
].
value
=
detail
.
remark
;
logo
.
value
=
detail
.
logo
;
logo
.
value
=
detail
.
logo
;
accountType
.
value
=
detail
.
is_admin
;
}
else
{
}
else
{
ElMessage
.
error
(
res
.
data
.
data
);
ElMessage
.
error
(
res
.
data
.
data
);
}
}
...
@@ -175,7 +113,7 @@ onBeforeMount(() => {
...
@@ -175,7 +113,7 @@ onBeforeMount(() => {
});
});
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
lang=
"scss"
>
.page_content
{
.page_content
{
padding
:
15px
;
padding
:
15px
;
overflow
:
auto
;
overflow
:
auto
;
...
@@ -216,4 +154,42 @@ onBeforeMount(() => {
...
@@ -216,4 +154,42 @@ onBeforeMount(() => {
border-radius
:
2px
;
border-radius
:
2px
;
margin-right
:
5px
;
margin-right
:
5px
;
}
}
.detail-module
{
height
:
100%
;
display
:
flex
;
span
{
height
:
100%
;
display
:
inline-block
;
padding-left
:
15px
;
box-sizing
:
border-box
;
&
:nth-of-type
(
1
)
{
background-color
:
#f7f7f9
;
min-width
:
114px
;
border-right
:
solid
1px
#dadee7
;
}
&
:nth-of-type
(
2
)
{
flex-grow
:
1
;
&
:
:
before
{
display
:
inline-block
;
content
:
""
;
width
:
8px
;
height
:
8px
;
margin-right
:
4px
;
border-radius
:
4px
;
}
&
.active
{
color
:
#3759be
;
&
:
:
before
{
background-color
:
#3759be
;
}
}
&
.disabled
{
color
:
#ff9f51
;
&
:
:
before
{
background-color
:
#ff9f51
;
}
}
}
}
}
</
style
>
</
style
>
src/page/main/authority/user/add/index.vue
View file @
ec327f7b
...
@@ -26,6 +26,7 @@ import { useRoute, useRouter } from "vue-router";
...
@@ -26,6 +26,7 @@ import { useRoute, useRouter } from "vue-router";
import
systemForm
from
"
./system-form.vue
"
;
import
systemForm
from
"
./system-form.vue
"
;
import
{
reactive
,
ref
,
onBeforeUnmount
,
onMounted
}
from
"
vue
"
;
import
{
reactive
,
ref
,
onBeforeUnmount
,
onMounted
}
from
"
vue
"
;
import
axios
from
"
@/request/http.js
"
;
import
axios
from
"
@/request/http.js
"
;
import
CryptoJS
from
"
crypto-js
"
;
import
{
ElMessage
}
from
"
element-plus
"
;
import
{
ElMessage
}
from
"
element-plus
"
;
import
bgBreadcrumb
from
"
@/components/bg-breadcrumb.vue
"
;
import
bgBreadcrumb
from
"
@/components/bg-breadcrumb.vue
"
;
const
route
=
useRoute
();
const
route
=
useRoute
();
...
@@ -57,10 +58,15 @@ const getSystemFormData = (data) => {
...
@@ -57,10 +58,15 @@ const getSystemFormData = (data) => {
};
};
//提交表单
//提交表单
const
submit
=
()
=>
{
const
submit
=
()
=>
{
systemFormRef
.
value
.
validateForm
().
then
((
res
)
=>
{
if
(
!
res
)
return
;
if
(
route
.
query
.
id
)
{
if
(
route
.
query
.
id
)
{
let
params
=
{
let
params
=
{
...
formData
,
...
systemFormRef
.
value
.
systemForm
,
logo
:
formData
.
logo
&&
formData
.
logo
.
length
>
0
?
formData
.
logo
[
0
].
url
:
""
,
logo
:
systemFormRef
.
value
.
systemForm
.
logo
&&
systemFormRef
.
value
.
systemForm
.
logo
.
length
>
0
?
systemFormRef
.
value
.
systemForm
.
logo
[
0
].
url
:
""
,
};
};
axios
.
put
(
`/v1/api/user/
${
route
.
query
.
id
}
`
,
params
).
then
((
res
)
=>
{
axios
.
put
(
`/v1/api/user/
${
route
.
query
.
id
}
`
,
params
).
then
((
res
)
=>
{
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
...
@@ -72,11 +78,15 @@ const submit = () => {
...
@@ -72,11 +78,15 @@ const submit = () => {
});
});
}
else
{
}
else
{
let
params
=
{
let
params
=
{
...
formData
,
...
systemFormRef
.
value
.
systemForm
,
logo
:
formData
.
logo
&&
formData
.
logo
.
length
>
0
?
formData
.
logo
[
0
].
url
:
""
,
logo
:
password
:
CryptoJS
.
AES
.
encrypt
(
formData
.
password
,
"
swuE9cmCZQwrkYRV
"
).
toString
(),
systemFormRef
.
value
.
systemForm
.
logo
&&
systemFormRef
.
value
.
systemForm
.
logo
.
length
>
0
?
systemFormRef
.
value
.
systemForm
.
logo
[
0
].
url
:
""
,
password
:
CryptoJS
.
AES
.
encrypt
(
systemFormRef
.
value
.
systemForm
.
password
,
"
swuE9cmCZQwrkYRV
"
).
toString
(),
};
};
axios
.
put
(
`/v1/api/user/add`
,
params
).
then
((
res
)
=>
{
delete
params
.
confirm_password
;
axios
.
post
(
`/v1/api/user/add`
,
params
).
then
((
res
)
=>
{
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
ElMessage
.
success
(
res
.
data
.
msg
);
ElMessage
.
success
(
res
.
data
.
msg
);
cancel
();
cancel
();
...
@@ -85,14 +95,14 @@ const submit = () => {
...
@@ -85,14 +95,14 @@ const submit = () => {
}
}
});
});
}
}
});
};
};
//取消
//取消
const
cancel
=
()
=>
{
const
cancel
=
()
=>
{
// router.go(-1);
router
.
push
({
router
.
push
({
path
:
"
/authority/user
"
,
path
:
"
/authority/user
"
,
query
:
{
query
:
{
id
:
formData
.
organization_id
,
organization_id
:
systemFormRef
.
value
.
systemForm
.
organization_id
,
},
},
});
});
};
};
...
@@ -103,18 +113,12 @@ const getDetail = () => {
...
@@ -103,18 +113,12 @@ const getDetail = () => {
const
form
=
res
.
data
.
data
;
const
form
=
res
.
data
.
data
;
systemFormRef
.
value
.
setForm
({
systemFormRef
.
value
.
setForm
({
organization_id
:
form
.
organization_id
,
organization_id
:
form
.
organization_id
,
s
ystem_role_id
:
form
.
system_role_id
,
s
elect_role
:
form
.
system_role
,
logo
:
form
.
logo
?
[{
url
:
form
.
logo
}]
:
[],
logo
:
form
.
logo
?
[{
url
:
form
.
logo
}]
:
[],
business_code
:
form
.
business_code
,
name
:
form
.
name
,
business_name
:
form
.
business_name
,
business_desc
:
form
.
business_desc
,
system_account
:
form
.
system_account
,
system_account
:
form
.
system_account
,
system_phone
:
form
.
system_phone
,
phone
:
form
.
phone
,
access_address
:
form
.
access_address
,
develop_id
:
form
.
develop_id
,
state
:
form
.
state
,
state
:
form
.
state
,
appid
:
form
.
app_id
,
appsecret
:
form
.
app_secret
,
});
});
}
else
{
}
else
{
ElMessage
.
error
(
res
.
data
.
data
);
ElMessage
.
error
(
res
.
data
.
data
);
...
...
src/page/main/authority/user/add/system-form.vue
View file @
ec327f7b
...
@@ -15,37 +15,10 @@
...
@@ -15,37 +15,10 @@
:disabled=
"formType"
:disabled=
"formType"
style=
"width: 100%"
/>
style=
"width: 100%"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"
业务系统编码"
prop=
"business_code"
v-if=
"formTyp
e"
>
<el-form-item
label=
"
姓名"
prop=
"nam
e"
>
<el-input
v-model=
"systemForm.
business_code"
:disabled=
"formTyp
e"
/>
<el-input
v-model=
"systemForm.
nam
e"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"业务系统名称"
prop=
"business_name"
>
<el-form-item
label=
"头像"
prop=
"logo"
>
<el-input
v-model=
"systemForm.business_name"
/>
</el-form-item>
<el-form-item
label=
"AppId"
prop=
"appid"
v-if=
"formType"
>
<el-input
v-model=
"systemForm.appid"
:disabled=
"formType"
>
<template
#suffix
>
<bg-icon
icon=
"#bg-ic-copy"
style=
"cursor: pointer"
@
click=
"copyText(systemForm.appid)"
></bg-icon>
</
template
>
</el-input>
<!-- <span class="pl-1"><el-button type="primary" @click="copyText(systemForm.appid)">复制</el-button></span> -->
</el-form-item>
<el-form-item
label=
"AppSecret"
prop=
"appsecret"
v-if=
"formType"
>
<div
style=
"display: flex; width: 100%"
>
<el-input
v-model=
"systemForm.appsecret"
:disabled=
"formType"
>
<
template
#suffix
>
<bg-icon
icon=
"#bg-ic-copy"
style=
"cursor: pointer"
@
click=
"copyText(systemForm.appsecret)"
></bg-icon>
</
template
>
</el-input>
<span
class=
"pl-1"
><el-button
type=
"primary"
@
click=
"resetSecret"
>
重置
</el-button></span>
</div>
</el-form-item>
<el-form-item
label=
"系统LOGO"
prop=
"logo"
>
<bg-upload-image
<bg-upload-image
v-model=
"systemForm.logo"
v-model=
"systemForm.logo"
:showTips=
"true"
:showTips=
"true"
...
@@ -56,62 +29,31 @@
...
@@ -56,62 +29,31 @@
:accept=
"['.jpg', '.jpeg', '.png']"
:accept=
"['.jpg', '.jpeg', '.png']"
customTips=
"请选择图片上传:大小120 * 120像素支持jpg、png等格式,图片需小于500KB"
></bg-upload-image>
customTips=
"请选择图片上传:大小120 * 120像素支持jpg、png等格式,图片需小于500KB"
></bg-upload-image>
</el-form-item>
</el-form-item>
<el-form-item
label=
"业务系统概述"
prop=
"business_desc"
>
<el-form-item
label=
"角色"
prop=
"select_role"
>
<el-input
<el-select
v-model=
"systemForm.select_role"
multiple
placeholder=
"请选择角色"
style=
"width: 100%"
>
type=
"textarea"
<el-option
v-for=
"item in roleList"
:key=
"item.role_id"
:label=
"item.role_name"
:value=
"item.role_id"
/>
:rows=
"3"
v-model=
"systemForm.business_desc"
show-word-limit
maxlength=
"300"
/>
</el-form-item>
<el-form-item
label=
"角色"
prop=
"system_role_id"
v-if=
"!formType"
>
<el-select
v-model=
"systemForm.system_role_id"
placeholder=
"请选择角色"
:disabled=
"true"
style=
"width: 100%"
>
<el-option
v-for=
"item in roleList"
:key=
"item.role_id"
:label=
"item.role_name"
:value=
"item.role_id"
/>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"账号"
prop=
"system_account"
>
<el-form-item
label=
"账号"
prop=
"system_account"
>
<el-input
v-model=
"systemForm.system_account"
/>
<el-input
v-model=
"systemForm.system_account"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"手机号"
prop=
"
system_
phone"
>
<el-form-item
label=
"手机号"
prop=
"phone"
>
<el-input
v-model=
"systemForm.
system_
phone"
/>
<el-input
v-model=
"systemForm.phone"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"密码"
prop=
"password"
v-if=
"!formType
"
>
<el-form-item
v-if=
"!formType"
label=
"密码"
prop=
"password
"
>
<el-input
:type=
"password_eye ? 'text' : 'password'"
v-model=
"systemForm.password"
>
<el-input
:type=
"password_eye ? 'text' : 'password'"
v-model=
"systemForm.password"
>
<template
#suffix
>
<template
#suffix
>
<bg-icon
<bg-icon
@
click=
"password_eye = !password_eye"
class=
"icon_eye"
icon=
"#bg-ic-eye"
></bg-icon>
@
click=
"password_eye = !password_eye"
class=
"icon_eye"
icon=
"#bg-ic-eye"
></bg-icon>
</
template
>
</
template
>
</el-input>
</el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"确认密码"
prop=
"confirm_password"
v-if=
"!formType
"
>
<el-form-item
v-if=
"!formType"
label=
"确认密码"
prop=
"confirm_password
"
>
<el-input
:type=
"confirm_eye ? 'text' : 'password'"
v-model=
"systemForm.confirm_password"
>
<el-input
:type=
"confirm_eye ? 'text' : 'password'"
v-model=
"systemForm.confirm_password"
>
<
template
#suffix
>
<
template
#suffix
>
<bg-icon
@
click=
"confirm_eye = !confirm_eye"
class=
"icon_eye"
icon=
"#bg-ic-eye"
></bg-icon>
<bg-icon
@
click=
"confirm_eye = !confirm_eye"
class=
"icon_eye"
icon=
"#bg-ic-eye"
></bg-icon>
</
template
>
</
template
>
</el-input>
</el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"访问地址"
prop=
"access_address"
>
<el-input
v-model=
"systemForm.access_address"
/>
</el-form-item>
<el-form-item
label=
"开发厂商名称"
prop=
"develop_id"
>
<el-select
v-model=
"systemForm.develop_id"
placeholder=
"请选择开发厂商"
style=
"width: 100%"
>
<el-option
v-for=
"item in firmList"
:key=
"item.dict_id"
:label=
"item.dict_name"
:value=
"item.dict_id"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"是否启用"
prop=
"state"
>
<el-form-item
label=
"是否启用"
prop=
"state"
>
<bg-switch
:labels=
"['否', '是']"
:values=
"[0, 1]"
v-model=
"systemForm.state"
></bg-switch>
<bg-switch
:labels=
"['否', '是']"
:values=
"[0, 1]"
v-model=
"systemForm.state"
></bg-switch>
</el-form-item>
</el-form-item>
...
@@ -119,7 +61,7 @@
...
@@ -119,7 +61,7 @@
</template>
</template>
<
script
setup
>
<
script
setup
>
import
{
reactive
,
ref
,
onBeforeMount
,
onMounted
,
computed
}
from
"
vue
"
;
import
{
reactive
,
ref
,
onBeforeMount
,
onMounted
,
watch
}
from
"
vue
"
;
import
axios
from
"
@/request/http.js
"
;
import
axios
from
"
@/request/http.js
"
;
import
{
ElMessage
}
from
"
element-plus
"
;
import
{
ElMessage
}
from
"
element-plus
"
;
import
{
validatePhone
}
from
"
@/services/rules.js
"
;
import
{
validatePhone
}
from
"
@/services/rules.js
"
;
...
@@ -128,27 +70,17 @@ const props = defineProps({
...
@@ -128,27 +70,17 @@ const props = defineProps({
type
:
Boolean
,
type
:
Boolean
,
default
:
false
,
//false 新增 true 编辑
default
:
false
,
//false 新增 true 编辑
},
},
id
:
{
type
:
String
,
default
:
""
,
},
});
});
const
systemForm
=
reactive
({
const
systemForm
=
reactive
({
organization_id
:
""
,
organization_id
:
""
,
business_code
:
""
,
name
:
""
,
business_name
:
""
,
business_desc
:
""
,
logo
:
[],
logo
:
[],
s
ystem_role_id
:
""
,
s
elect_role
:
[]
,
system_account
:
""
,
system_account
:
""
,
system_
phone
:
""
,
phone
:
""
,
password
:
""
,
password
:
""
,
confirm_password
:
""
,
confirm_password
:
""
,
access_address
:
""
,
develop_id
:
""
,
state
:
1
,
state
:
1
,
appid
:
""
,
appsecret
:
""
,
});
});
const
password_eye
=
ref
(
false
);
const
password_eye
=
ref
(
false
);
const
confirm_eye
=
ref
(
false
);
const
confirm_eye
=
ref
(
false
);
...
@@ -160,88 +92,22 @@ const validatePass = (rule, value, callback) => {
...
@@ -160,88 +92,22 @@ const validatePass = (rule, value, callback) => {
callback
();
callback
();
}
}
};
};
const
validateBusinessName
=
(
rule
,
value
,
callback
)
=>
{
let
reg
=
/^
[
a-zA-Z0-9
\u
4e00-
\u
9fa5
]
+$/
;
if
(
!
reg
.
test
(
value
))
{
callback
(
new
Error
(
"
只能输入字母、数字和汉字
"
));
}
else
{
let
params
=
null
;
if
(
props
.
id
)
{
params
=
{
id
:
parseInt
(
props
.
id
),
business_name
:
value
,
organization_id
:
systemForm
.
organization_id
,
};
}
else
{
params
=
{
business_name
:
value
,
organization_id
:
systemForm
.
organization_id
};
}
axios
.
post
(
`/apaas/system/v5/user/check/business`
,
params
).
then
((
res
)
=>
{
if
(
res
.
data
.
code
==
200
)
{
callback
();
}
else
{
callback
(
new
Error
(
res
.
data
.
data
));
}
});
}
};
const
validateSystemAccount
=
(
rule
,
value
,
callback
)
=>
{
let
reg
=
/^
[
a-zA-Z0-9
]
+$/
;
if
(
!
reg
.
test
(
value
))
{
callback
(
new
Error
(
"
只能输入字母和数字
"
));
}
else
{
let
params
=
null
;
if
(
props
.
id
)
{
params
=
{
id
:
parseInt
(
props
.
id
),
system_account
:
value
};
}
else
{
params
=
{
system_account
:
value
};
}
axios
.
post
(
`/apaas/system/v5/user/check/account`
,
params
).
then
((
res
)
=>
{
if
(
res
.
data
.
code
==
200
)
{
callback
();
}
else
{
callback
(
new
Error
(
res
.
data
.
data
));
}
});
}
};
const
checkPhoneRepet
=
(
rule
,
value
,
callback
)
=>
{
let
params
=
null
;
if
(
props
.
id
)
{
params
=
{
id
:
parseInt
(
props
.
id
),
contact_phone
:
value
};
}
else
{
params
=
{
id
:
0
,
contact_phone
:
value
};
}
axios
.
post
(
`/apaas/system/v5/org/check`
,
params
).
then
((
res
)
=>
{
if
(
res
.
data
.
code
==
200
)
{
callback
();
}
else
{
callback
(
new
Error
(
res
.
data
.
data
));
}
});
};
const
formRules
=
reactive
({
const
formRules
=
reactive
({
organization_id
:
[{
required
:
true
,
message
:
"
请选择组织
"
,
trigger
:
"
change
"
}],
organization_id
:
[{
required
:
true
,
message
:
"
请选择组织
"
,
trigger
:
"
change
"
}],
business_name
:
[
name
:
[
{
required
:
true
,
message
:
"
请输入业务系统名称
"
,
trigger
:
"
blur
"
},
{
required
:
true
,
message
:
"
请输入姓名
"
,
trigger
:
"
blur
"
},
{
max
:
50
,
message
:
"
业务系统名称最大长度为50个字符
"
,
trigger
:
"
blur
"
},
{
max
:
50
,
message
:
"
姓名最大长度为50个字符
"
,
trigger
:
"
blur
"
},
{
validator
:
validateBusinessName
,
trigger
:
"
blur
"
},
],
],
s
ystem_role_id
:
[{
required
:
true
,
message
:
"
请选择角色
"
,
trigger
:
"
blur
"
}],
s
elect_role
:
[{
required
:
true
,
type
:
"
array
"
,
message
:
"
请选择角色
"
,
trigger
:
"
change
"
}],
system_account
:
[
system_account
:
[
{
required
:
true
,
message
:
"
请输入账号
"
,
trigger
:
"
blur
"
},
{
required
:
true
,
message
:
"
请输入账号
"
,
trigger
:
"
blur
"
},
{
min
:
4
,
message
:
"
帐号长度不得低于4个字符
"
,
trigger
:
"
blur
"
},
{
min
:
4
,
message
:
"
帐号长度不得低于4个字符
"
,
trigger
:
"
blur
"
},
{
max
:
20
,
message
:
"
帐号最大长度为20个字符
"
,
trigger
:
"
blur
"
},
{
max
:
20
,
message
:
"
帐号最大长度为20个字符
"
,
trigger
:
"
blur
"
},
{
validator
:
validateSystemAccount
,
trigger
:
"
blur
"
},
],
],
system_
phone
:
[
phone
:
[
{
required
:
true
,
message
:
"
请输入账号
"
,
trigger
:
"
blur
"
},
{
required
:
true
,
message
:
"
请输入账号
"
,
trigger
:
"
blur
"
},
{
validator
:
validatePhone
,
trigger
:
"
blur
"
},
{
validator
:
validatePhone
,
trigger
:
"
blur
"
},
{
validator
:
checkPhoneRepet
,
trigger
:
"
blur
"
},
],
],
password
:
[
password
:
[
{
required
:
true
,
message
:
"
请输入密码
"
,
trigger
:
"
blur
"
},
{
required
:
true
,
message
:
"
请输入密码
"
,
trigger
:
"
blur
"
},
...
@@ -251,34 +117,21 @@ const formRules = reactive({
...
@@ -251,34 +117,21 @@ const formRules = reactive({
{
required
:
true
,
message
:
"
请确认密码
"
,
trigger
:
"
blur
"
},
{
required
:
true
,
message
:
"
请确认密码
"
,
trigger
:
"
blur
"
},
{
validator
:
validatePass
,
trigger
:
"
blur
"
},
{
validator
:
validatePass
,
trigger
:
"
blur
"
},
],
],
access_address
:
[{
max
:
500
,
message
:
"
访问地址最大长度为500个字符
"
,
trigger
:
"
blur
"
}],
develop_id
:
[{
required
:
true
,
message
:
"
请选择开发厂商
"
,
trigger
:
"
change
"
}],
});
});
const
systemRef
=
ref
(
null
);
const
systemRef
=
ref
(
null
);
const
emit
=
defineEmits
([
"
action
"
]);
const
roleList
=
ref
([]);
const
roleList
=
ref
([]);
const
firmList
=
ref
([]);
const
submitForm
=
async
()
=>
{
watch
(
if
(
!
systemRef
)
return
;
()
=>
systemForm
.
organization_id
,
await
systemRef
.
value
.
validate
((
valid
,
fields
)
=>
{
(
val
)
=>
{
if
(
valid
)
{
getRoleList
(
val
);
emit
(
"
action
"
,
systemForm
);
}
else
{
emit
(
"
action
"
,
null
);
}
}
});
);
};
const
clearForm
=
()
=>
{
if
(
!
systemRef
)
return
;
systemRef
.
value
.
resetFields
();
systemForm
.
system_role_id
=
roleList
.
value
[
0
].
role_id
;
};
const
setForm
=
(
data
)
=>
{
const
setForm
=
(
data
)
=>
{
Object
.
assign
(
systemForm
,
data
);
Object
.
assign
(
systemForm
,
data
);
console
.
log
(
"
systemForm
"
,
systemForm
);
};
};
const
orgData
=
ref
([]);
const
orgData
=
ref
([]);
...
@@ -288,62 +141,36 @@ const treeProps = {
...
@@ -288,62 +141,36 @@ const treeProps = {
value
:
"
organization_id
"
,
value
:
"
organization_id
"
,
};
};
const
getOrgTree
=
()
=>
{
const
getOrgTree
=
()
=>
{
axios
.
get
(
`/
apaas/system/v5
/org/tree`
).
then
((
res
)
=>
{
axios
.
get
(
`/
v1/api
/org/tree`
).
then
((
res
)
=>
{
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
const
orgDataTemp
=
res
.
data
.
data
||
[];
const
orgDataTemp
=
res
.
data
.
data
||
[];
orgDataTemp
.
shift
();
orgData
.
value
=
orgDataTemp
;
orgData
.
value
=
orgDataTemp
;
}
else
{
}
else
{
ElMessage
.
error
(
res
.
data
.
data
);
ElMessage
.
error
(
res
.
data
.
data
);
}
}
});
});
};
};
const
getRoleList
=
(
oid
)
=>
{
const
copyText
=
(
data
)
=>
{
axios
.
get
(
`/v1/api/user/select/role`
,
{
params
:
{
oid
}
}).
then
((
res
)
=>
{
navigator
.
clipboard
.
writeText
(
data
).
then
(
function
()
{
ElMessage
.
success
(
"
复制成功
"
);
},
function
()
{}
);
};
const
resetSecret
=
()
=>
{
axios
.
get
(
`/apaas/system/v5/user/reset/secret/
${
props
.
id
}
`
).
then
((
res
)
=>
{
if
(
res
.
data
.
code
==
200
)
{
systemForm
.
appsecret
=
res
.
data
.
data
;
ElMessage
.
success
(
"
重置成功!
"
);
}
else
{
ElMessage
.
error
(
res
.
data
.
data
);
}
});
};
const
getRoleList
=
()
=>
{
axios
.
get
(
`/apaas/system/v5/org/select/role?is_admin=1`
).
then
((
res
)
=>
{
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
roleList
.
value
=
res
.
data
.
data
;
roleList
.
value
=
res
.
data
.
data
;
systemForm
.
system_role_id
=
roleList
.
value
[
0
].
role_id
;
}
else
{
}
else
{
ElMessage
.
error
(
res
.
data
.
data
);
}
}
});
});
};
};
const
getFirmList
=
()
=>
{
const
validateForm
=
()
=>
{
axios
.
get
(
`/apaas/system/v5/dictionary/developer/list`
).
then
((
res
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
res
.
data
.
code
==
200
)
{
systemRef
.
value
.
validate
((
res
)
=>
resolve
(
res
));
firmList
.
value
=
res
.
data
.
data
||
[];
}
else
{
ElMessage
.
error
(
res
.
data
.
data
);
}
});
});
};
};
onBeforeMount
(()
=>
{
onBeforeMount
(()
=>
{
getOrgTree
();
getOrgTree
();
getRoleList
();
getFirmList
();
});
});
onMounted
(()
=>
{});
onMounted
(()
=>
{});
defineExpose
({
s
ubmitForm
,
clearForm
,
set
Form
});
defineExpose
({
s
ystemForm
,
setForm
,
validate
Form
});
</
script
>
</
script
>
src/page/main/authority/user/index.vue
View file @
ec327f7b
...
@@ -55,11 +55,6 @@
...
@@ -55,11 +55,6 @@
:stripe=
"true"
:stripe=
"true"
:select=
"true"
:select=
"true"
@
selectAc=
"selectRows"
>
@
selectAc=
"selectRows"
>
<
template
v-slot:business_name=
"{ row }"
>
<span
@
click=
"goDetail(row)"
class=
"can_click_text"
>
{{
row
.
business_name
}}
</span>
</
template
>
<
template
v-slot:state=
"{ row }"
>
<
template
v-slot:state=
"{ row }"
>
<bg-switch
<bg-switch
@
click=
"stateChange(row)"
@
click=
"stateChange(row)"
...
@@ -106,7 +101,7 @@
...
@@ -106,7 +101,7 @@
<bg-icon
<bg-icon
style=
"font-size: 12px; color: #a9b1c7; margin-right: 8px; vertical-align: baseline"
style=
"font-size: 12px; color: #a9b1c7; margin-right: 8px; vertical-align: baseline"
icon=
"#bg-ic-circle-tips"
></bg-icon>
icon=
"#bg-ic-circle-tips"
></bg-icon>
您正在对
<span
class=
"danger_info"
>
{{ selectedRow.
business_name
}}
</span
您正在对
<span
class=
"danger_info"
>
{{ selectedRow.
system_account
}}
</span
>
做删除操作。
>
做删除操作。
</div>
</div>
<
template
#footer
>
<
template
#footer
>
...
@@ -137,7 +132,7 @@
...
@@ -137,7 +132,7 @@
<bg-icon
<bg-icon
style=
"font-size: 12px; color: #a9b1c7; margin-right: 8px; vertical-align: baseline"
style=
"font-size: 12px; color: #a9b1c7; margin-right: 8px; vertical-align: baseline"
icon=
"#bg-ic-circle-tips"
></bg-icon>
icon=
"#bg-ic-circle-tips"
></bg-icon>
您正在对
<span
class=
"danger_info"
>
{{ selectedRow.
business_name
}}
</span
您正在对
<span
class=
"danger_info"
>
{{ selectedRow.
system_account
}}
</span
>
做修改密码操作,修改后旧密码将无法登录。
>
做修改密码操作,修改后旧密码将无法登录。
</div>
</div>
<div>
<div>
...
@@ -192,13 +187,13 @@ import bgBreadcrumb from "@/components/bg-breadcrumb.vue";
...
@@ -192,13 +187,13 @@ import bgBreadcrumb from "@/components/bg-breadcrumb.vue";
const
dataTable
=
ref
(
null
);
const
dataTable
=
ref
(
null
);
const
headers
=
ref
([
const
headers
=
ref
([
{
{
label
:
"
业务系统编码
"
,
label
:
"
姓名
"
,
prop
:
"
business_cod
e
"
,
prop
:
"
nam
e
"
,
minWidth
:
160
,
minWidth
:
160
,
},
},
{
{
label
:
"
业务系统名称
"
,
label
:
"
手机号
"
,
prop
:
"
business_nam
e
"
,
prop
:
"
phon
e
"
,
minWidth
:
160
,
minWidth
:
160
,
},
},
{
{
...
@@ -207,7 +202,7 @@ const headers = ref([
...
@@ -207,7 +202,7 @@ const headers = ref([
},
},
{
{
label
:
"
所属组织
"
,
label
:
"
所属组织
"
,
prop
:
"
org
anization
_name
"
,
prop
:
"
org_name
"
,
minWidth
:
180
,
minWidth
:
180
,
},
},
{
{
...
@@ -227,7 +222,6 @@ const headers = ref([
...
@@ -227,7 +222,6 @@ const headers = ref([
},
},
]);
]);
const
tableRows
=
ref
([]);
const
tableRows
=
ref
([]);
const
search
=
ref
(
""
);
const
filter
=
reactive
({
const
filter
=
reactive
({
search
:
""
,
search
:
""
,
page
:
1
,
page
:
1
,
...
@@ -281,22 +275,22 @@ const getTableRows = () => {
...
@@ -281,22 +275,22 @@ const getTableRows = () => {
})
})
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
tableRows
.
value
=
res
.
data
.
data
||
[];
tableRows
.
value
=
res
.
data
.
data
?.
org_users
?.
data
||
[];
tableTotal
.
value
=
res
.
data
.
total
;
tableTotal
.
value
=
res
.
data
.
data
?.
org_users
?.
total
||
0
;
}
else
{
}
else
{
ElMessage
.
error
(
res
.
data
.
data
);
ElMessage
.
error
(
res
.
data
.
data
);
}
}
});
});
};
};
const
addAccount
=
(
params
)
=>
{
const
addAccount
=
()
=>
{
router
.
push
({
router
.
push
({
path
:
"
/authority/user/add
"
,
path
:
"
/authority/user/add
"
,
});
});
};
};
const
handleNodeClick
=
(
data
)
=>
{
const
handleNodeClick
=
(
data
)
=>
{
if
(
data
.
data_type
==
1
)
{
if
(
data
.
data_type
>
0
)
{
selectNode
.
value
=
data
.
organization_id
;
selectNode
.
value
=
data
.
organization_id
;
changePage
(
1
);
changePage
(
1
);
}
else
{
}
else
{
...
@@ -326,7 +320,6 @@ const getOrgTree = () => {
...
@@ -326,7 +320,6 @@ const getOrgTree = () => {
orgData
.
value
=
res
.
data
.
data
||
[];
orgData
.
value
=
res
.
data
.
data
||
[];
// orgData.value.shift();
// orgData.value.shift();
const
orgList
=
searchOrg
(
orgData
.
value
);
const
orgList
=
searchOrg
(
orgData
.
value
);
console
.
log
(
"
orgList
"
,
orgList
);
if
(
route
.
query
.
organization_id
)
{
if
(
route
.
query
.
organization_id
)
{
searchItem
(
orgData
.
value
,
route
.
query
.
organization_id
);
searchItem
(
orgData
.
value
,
route
.
query
.
organization_id
);
}
else
{
}
else
{
...
@@ -386,9 +379,10 @@ const filterNode = (value, data) => {
...
@@ -386,9 +379,10 @@ const filterNode = (value, data) => {
};
};
const
stateChange
=
(
row
)
=>
{
const
stateChange
=
(
row
)
=>
{
console
.
log
(
"
row
"
,
row
);
const
params
=
{
const
params
=
{
id
:
row
.
id
,
id
:
row
.
id
,
state
:
row
.
state
==
1
?
0
:
1
,
state
:
row
.
state
,
};
};
axios
.
post
(
`/v1/api/user/updateState`
,
params
).
then
((
res
)
=>
{
axios
.
post
(
`/v1/api/user/updateState`
,
params
).
then
((
res
)
=>
{
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
...
@@ -544,7 +538,7 @@ const editConfirm = () => {
...
@@ -544,7 +538,7 @@ const editConfirm = () => {
const
selectRows
=
(
data
)
=>
{
const
selectRows
=
(
data
)
=>
{
selected
.
value
=
data
.
selection
;
selected
.
value
=
data
.
selection
;
selectedName
.
value
=
data
.
selection
.
map
((
item
)
=>
item
.
business_name
);
selectedName
.
value
=
data
.
selection
.
map
((
item
)
=>
item
.
system_account
);
};
};
const
clearSelected
=
()
=>
{
const
clearSelected
=
()
=>
{
...
...
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