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
e7765b84
Commit
e7765b84
authored
Oct 27, 2022
by
何小勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
组织管理
parent
bc64f5f2
Changes
13
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
878 additions
and
419 deletions
+878
-419
src/bg-ui/bg-info.vue
src/bg-ui/bg-info.vue
+37
-3
src/bg-ui/bg-upload.vue
src/bg-ui/bg-upload.vue
+1
-1
src/bg-ui/index.scss
src/bg-ui/index.scss
+9
-1
src/page/main/develop/account/add/index.vue
src/page/main/develop/account/add/index.vue
+2
-2
src/page/main/develop/account/detail/index.vue
src/page/main/develop/account/detail/index.vue
+77
-41
src/page/main/develop/account/index.vue
src/page/main/develop/account/index.vue
+43
-8
src/page/main/system/organization/directory-form.vue
src/page/main/system/organization/directory-form.vue
+81
-40
src/page/main/system/organization/index.vue
src/page/main/system/organization/index.vue
+297
-63
src/page/main/system/organization/org-form.vue
src/page/main/system/organization/org-form.vue
+91
-52
src/page/main/system/organization/platform-user/index.vue
src/page/main/system/organization/platform-user/index.vue
+68
-40
src/page/main/system/organization/platform-user/platform-account-form.vue
...stem/organization/platform-user/platform-account-form.vue
+54
-18
src/page/main/system/organization/platform-user/platform-person-form.vue
...ystem/organization/platform-user/platform-person-form.vue
+7
-7
src/page/main/system/organization/tree.vue
src/page/main/system/organization/tree.vue
+111
-143
No files found.
src/bg-ui/bg-info.vue
View file @
e7765b84
...
...
@@ -18,7 +18,11 @@
width: item.copy ? 'calc(100% - 36px)' : item.download || item.password ? 'calc(100% - 22px)': '100%',
color: item.download ? '#3759be' : '#404a62'
}"
>
{{
item
.
value
}}
</span>
>
<span
v-if=
"item.state"
:style=
"
{color: stateColor[item.state]}">
<span
class=
"state-dot"
:style=
"
{backgroundColor: stateColor[item.state]}">
</span>
{{
item
.
value
}}
</span>
<span
v-else-if=
"item.secret"
>
{{
secret
(
item
.
value
)
}}
</span>
<span
v-else
>
{{
item
.
value
}}
</span>
</span>
<a
class=
"copy-btn"
@
click=
"copyText(item.value, $event)"
...
...
@@ -26,6 +30,7 @@
>
复制
</a>
<bg-icon
v-if=
"item.copy_icon"
@
click=
"copyIcon(item.value)"
class=
"copy-btn"
style=
"font-size: 14px; color: #a9b1c7;cursor: pointer;"
icon=
"#bg-ic-copy"
></bg-icon>
<bg-icon
class=
"copy-btn"
style=
"font-size: 14px; color: #a9b1c7;cursor: pointer;"
...
...
@@ -61,9 +66,18 @@ export default {
default
:
2
,
},
},
model
:
{
prop
:
'
data
'
,
event
:
'
newValue
'
},
data
()
{
return
{
show
:
false
show
:
false
,
stateColor
:
{
success
:
'
#48ad97
'
,
danger
:
'
#d75138
'
,
default
:
'
#787878
'
}
}
},
methods
:
{
...
...
@@ -81,6 +95,8 @@ export default {
});
},
copyText
(
text
,
e
)
{
console
.
log
(
text
)
console
.
log
(
e
)
const
clipboard
=
new
Clipboard
(
e
.
target
,
{
text
:
()
=>
text
,
});
...
...
@@ -101,6 +117,15 @@ export default {
// 解决第一次点击不生效的问题,如果没有,第一次点击会不生效
clipboard
.
onClick
(
e
);
},
copyIcon
(
data
)
{
navigator
.
clipboard
.
writeText
(
data
).
then
(
function
()
{
},
function
()
{
}
);
},
download
(
url
)
{
const
a
=
document
.
createElement
(
"
a
"
);
// 创建a标签
a
.
setAttribute
(
"
download
"
,
""
);
// download属性
...
...
@@ -114,6 +139,15 @@ export default {
item
.
value
=
"
***************
"
}
this
.
show
=
!
this
.
show
},
secret
(
value
)
{
const
len
=
value
.
length
;
const
str1
=
value
.
substring
(
0
,
3
);
const
str2
=
value
.
substring
(
value
.
length
-
6
,
value
.
length
);
const
passwordStr
=
value
.
substring
(
3
,
value
.
length
-
6
).
split
(
''
).
map
(
item
=>
'
*
'
).
join
(
''
);
console
.
log
(
8888888
)
console
.
log
(
passwordStr
)
return
str1
+
passwordStr
+
str2
}
},
};
...
...
src/bg-ui/bg-upload.vue
View file @
e7765b84
...
...
@@ -4,7 +4,7 @@
:class=
"
{ 'is-disabled': actionDisabled, 'is-easy': isEasy }"
>
<el-upload
action=
"/apaas/
static
/file/upload"
action=
"/apaas/
common
/file/upload"
:data=
"
{
directory: 'file',
uniqueCode: false,
...
...
src/bg-ui/index.scss
View file @
e7765b84
...
...
@@ -1502,6 +1502,14 @@ a {
cursor
:
pointer
;
margin-left
:
8px
;
}
.state-dot
{
padding
:
4px
;
display
:
inline-block
;
height
:
5px
;
width
:
5px
;
border-radius
:
10px
;
margin-right
:
5px
;
}
}
}
...
...
src/page/main/develop/account/add/index.vue
View file @
e7765b84
...
...
@@ -157,7 +157,7 @@ const getContactFormData = (data) => {
}
else
{
let
params
=
{
organization_id
:
formData
.
value
.
organization_id
,
system_role_id
:
"
ab98a936-9046-455b-aba3-4c73671024d0
"
,
//
system_role_id: "ab98a936-9046-455b-aba3-4c73671024d0",
logo
:
formData
.
value
.
logo
&&
formData
.
value
.
logo
.
length
>
0
?
formData
.
value
.
logo
[
0
].
url
:
''
,
password
:
CryptoJS
.
AES
.
encrypt
(
formData
.
value
.
password
,
"
swuE9cmCZQwrkYRV
"
).
toString
(),
business_code
:
formData
.
value
.
business_code
,
...
...
@@ -197,7 +197,7 @@ const continueCreate = () => {
systemFormRef
.
value
.
clearForm
();
contactFormRef
.
value
.
clearForm
();
step
.
value
=
1
;
successFlag
=
false
;
successFlag
.
value
=
false
;
}
//取消
const
cancel
=
()
=>
{
...
...
src/page/main/develop/account/detail/index.vue
View file @
e7765b84
...
...
@@ -16,7 +16,8 @@
</div>
<div
class=
"info_content"
>
<div
class=
"img_box"
>
<img
src=
"/src/assets/imgs/home_ic_user.png"
style=
"height: 96px;width: 96px;border-radius: 99px"
alt=
""
>
<img
v-if=
"logo"
:src=
"logo"
style=
"height: 96px;width: 96px;border-radius: 99px"
alt=
""
>
<img
v-else
src=
"/src/assets/imgs/home_ic_user.png"
style=
"height: 96px;width: 96px;border-radius: 99px"
alt=
""
>
</div>
<div
class=
"info_box"
>
<bg-info
:data=
"baseInfo"
></bg-info>
...
...
@@ -44,71 +45,75 @@
import
{
reactive
,
toRefs
,
ref
,
}
from
'
@vue/reactivity
'
import
{
getCurrentInstance
}
from
'
vue
'
import
{
computed
,
onBeforeMount
}
from
'
@vue/runtime-core
'
import
{
useRouter
}
from
'
vue-router
'
;
import
{
useRoute
,
useRouter
}
from
'
vue-router
'
;
const
route
=
useRoute
();
const
{
proxy
}
=
getCurrentInstance
()
const
{
$axios
,
$message
}
=
proxy
const
baseInfo
=
reactive
(
[
{
[{
name
:
"
所属机构
"
,
value
:
"
某某省/某某市/大数据局
"
,
nameWidth
:
1
12
value
:
""
,
nameWidth
:
1
30
},
{
name
:
"
业务系统编码
"
,
value
:
"
00000001
"
,
nameWidth
:
1
12
value
:
""
,
nameWidth
:
1
30
},
{
name
:
"
业务系统名称
"
,
value
:
"
大数据处理系统
"
,
nameWidth
:
1
12
value
:
""
,
nameWidth
:
1
30
},
{
name
:
"
账号
"
,
value
:
"
admin001
"
,
nameWidth
:
1
12
value
:
""
,
nameWidth
:
1
30
},
{
name
:
"
AppID
"
,
value
:
"
dasjkjjk
"
,
nameWidth
:
1
12
value
:
""
,
nameWidth
:
1
30
},
{
name
:
"
AppSecret
"
,
value
:
"
asda*******************jhjh
"
,
nameWidth
:
112
value
:
""
,
copy_icon
:
true
,
secret
:
true
,
nameWidth
:
130
},
{
name
:
"
创建人
"
,
value
:
"
admin(机构管理员)
"
,
nameWidth
:
1
12
value
:
""
,
nameWidth
:
1
30
},
{
name
:
"
创建时间
"
,
value
:
"
2022-01-01 10:10:10
"
,
nameWidth
:
1
12
value
:
""
,
nameWidth
:
1
30
},
{
name
:
"
是否启用
"
,
value
:
"
是
"
,
nameWidth
:
112
value
:
""
,
state
:
""
,
nameWidth
:
130
},
{
name
:
"
开发厂商名
单
"
,
value
:
"
某某大数据开发商
"
,
nameWidth
:
1
12
name
:
"
开发厂商名
称
"
,
value
:
""
,
nameWidth
:
1
30
},
{
name
:
"
访问地址
"
,
value
:
"
http://www.bigdata.com
"
,
value
:
""
,
full
:
true
,
nameWidth
:
1
12
nameWidth
:
1
30
},
{
name
:
"
业务系统描述
"
,
value
:
"
系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述
"
,
value
:
""
,
full
:
true
,
nameWidth
:
1
12
nameWidth
:
1
30
},
]
)
...
...
@@ -116,31 +121,62 @@ const baseInfo = reactive(
const
contactInfo
=
reactive
(
[{
name
:
"
联系人姓名
"
,
value
:
"
xxx
"
,
nameWidth
:
1
12
value
:
""
,
nameWidth
:
1
30
},
{
name
:
"
联系人手机号
"
,
value
:
"
15627365265
"
,
nameWidth
:
1
12
value
:
""
,
nameWidth
:
1
30
},
{
name
:
"
联系人邮箱
"
,
value
:
"
http://www.bigdata@163.com
"
,
value
:
""
,
full
:
true
,
nameWidth
:
1
12
nameWidth
:
1
30
},
{
name
:
"
备注
"
,
value
:
"
系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述系统描述
"
,
value
:
""
,
full
:
true
,
nameWidth
:
1
12
nameWidth
:
1
30
},
]
)
]
)
const
logo
=
ref
(
''
)
onBeforeMount
(()
=>
{
const
getDetail
=
()
=>
{
$axios
.
get
(
`/apaas/system/v5/user/detail/
${
route
.
query
.
id
}
`
)
.
then
((
res
)
=>
{
if
(
res
.
data
.
code
==
200
)
{
const
detail
=
res
.
data
.
data
;
baseInfo
[
0
].
value
=
detail
.
organization_name
;
baseInfo
[
1
].
value
=
detail
.
business_code
;
baseInfo
[
2
].
value
=
detail
.
business_name
;
baseInfo
[
3
].
value
=
detail
.
system_account
;
baseInfo
[
4
].
value
=
detail
.
app_id
;
baseInfo
[
5
].
value
=
detail
.
app_secret
;
baseInfo
[
6
].
value
=
detail
.
created_by
;
baseInfo
[
7
].
value
=
detail
.
created_time
;
baseInfo
[
8
].
value
=
detail
.
state
===
1
?
'
是
'
:
'
否
'
;
baseInfo
[
8
].
state
=
detail
.
state
===
1
?
'
success
'
:
'
default
'
;
baseInfo
[
9
].
value
=
detail
.
develop_id
;
baseInfo
[
10
].
value
=
detail
.
access_address
;
baseInfo
[
11
].
value
=
detail
.
business_desc
;
contactInfo
[
0
].
value
=
detail
.
contact_name
;
contactInfo
[
1
].
value
=
detail
.
contact_phone
;
contactInfo
[
2
].
value
=
detail
.
contact_email
;
contactInfo
[
3
].
value
=
detail
.
remark
;
logo
.
value
=
detail
.
logo
;
}
else
{
$message
.
error
(
res
.
data
.
msg
)
}
})
}
onBeforeMount
(()
=>
{
getDetail
()
})
</
script
>
...
...
src/page/main/develop/account/index.vue
View file @
e7765b84
...
...
@@ -14,13 +14,13 @@
<div
class=
"tree_content"
>
<div
class=
"search"
>
<el-input
v-model=
"
search
"
v-model=
"
filterTree
"
placeholder=
"请输入组织名称搜索"
:prefix-icon=
"Search"
/>
</div>
<div
class=
"tree"
>
<el-tree
:data=
"orgData"
:props=
"defaultProps"
@
node-click=
"handleNodeClick
"
:default-expand-all=
"true"
>
<el-tree
ref=
"treeRef"
:data=
"orgData"
:props=
"defaultProps"
@
node-click=
"handleNodeClick"
:filter-node-method=
"filterNode
"
:default-expand-all=
"true"
>
<template
#default
="
{ node, data }">
<div
class=
"custom_tree_node"
>
<span
...
...
@@ -196,7 +196,7 @@
<
script
setup
>
import
{
Search
}
from
'
@element-plus/icons-vue
'
import
{
reactive
,
toRefs
,
ref
,
}
from
'
@vue/reactivity
'
import
{
getCurrentInstance
}
from
'
vue
'
import
{
getCurrentInstance
,
watch
}
from
'
vue
'
import
{
computed
,
onBeforeMount
}
from
'
@vue/runtime-core
'
import
{
useRouter
}
from
'
vue-router
'
;
import
{
edit
}
from
'
ace-builds
'
;
...
...
@@ -266,7 +266,9 @@ import CryptoJS from "crypto-js";
password
:
''
,
confirm_password
:
''
,
})
const
selectNode
=
ref
(
null
)
const
filterTree
=
ref
(
''
)
const
treeRef
=
ref
(
null
)
const
validatePass
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
!==
passwordForm
.
password
)
{
callback
(
new
Error
(
"
密码输入不一致
"
))
...
...
@@ -288,11 +290,11 @@ import CryptoJS from "crypto-js";
const
router
=
useRouter
();
const
getTableRows
=
()
=>
{
let
params
=
{...
filter
}
let
params
=
{...
filter
,
organization_id
:
selectNode
.
value
}
$axios
.
get
(
`/apaas/system/v5/user/list`
,
{
params
,
params
}
)
.
then
((
res
)
=>
{
...
...
@@ -312,7 +314,11 @@ import CryptoJS from "crypto-js";
}
const
handleNodeClick
=
(
data
)
=>
{
console
.
log
(
data
)
console
.
log
(
data
.
data_type
)
if
(
data
.
data_type
==
1
)
{
selectNode
.
value
=
data
.
id
;
}
console
.
log
(
selectNode
)
}
const
orgData
=
ref
([])
...
...
@@ -327,12 +333,41 @@ import CryptoJS from "crypto-js";
.
then
((
res
)
=>
{
if
(
res
.
data
.
code
==
200
)
{
orgData
.
value
=
res
.
data
.
data
||
[];
const
orgList
=
searchOrg
(
res
.
data
.
data
);
selectNode
.
value
=
orgList
.
length
>
1
?
orgList
[
1
].
id
:
''
;
getTableRows
()
}
else
{
$message
.
error
(
res
.
data
.
msg
)
}
})
}
const
searchOrg
=
(
data
)
=>
{
const
arr
=
[]
data
.
forEach
(
item
=>
{
if
(
item
.
data_type
===
1
)
{
arr
.
push
(
item
);
return
}
else
{
if
(
item
.
Child
){
searchOrg
(
item
.
Child
)
}
else
{
return
}
}
})
return
arr
;
}
watch
(
filterTree
,
(
val
)
=>
{
treeRef
.
value
.
filter
(
val
)
})
const
filterNode
=
(
value
,
data
)
=>
{
if
(
!
value
)
return
true
return
data
.
name
.
includes
(
value
)
}
const
stateChange
=
(
row
)
=>
{
const
state
=
row
.
state
.
toString
();
$axios
.
post
(
...
...
@@ -503,7 +538,7 @@ import CryptoJS from "crypto-js";
onBeforeMount
(()
=>
{
getOrgTree
()
getTableRows
()
//
getTableRows()
})
...
...
src/page/main/system/organization/directory-form.vue
View file @
e7765b84
...
...
@@ -7,10 +7,11 @@
ref=
"directoryRef"
style=
"max-width: 80%"
>
<el-form-item
label=
"上级目录"
prop=
"parent"
>
<el-input
v-model=
"directoryForm.parent"
style=
"width: 80%;"
/>
<el-form-item
label=
"上级目录"
prop=
"p_organization_id"
v-if=
"formType === 'create'"
>
<!--
<el-input
v-model=
"directoryForm.p_organization_id"
style=
"width: 80%;"
/>
-->
<el-tree-select
v-model=
"directoryForm.p_organization_id"
:data=
"orgData"
:props=
"treeProps"
:render-after-expand=
"false"
:filter-node-method=
"filterNode"
:disabled=
"directoryForm.level"
:check-strictly=
"true"
style=
"width: 80%;"
/>
<el-form-item
label=
""
style=
"padding-left: 16px"
>
<el-checkbox
v-model=
"directoryForm.level"
label=
"顶级"
/>
<el-checkbox
v-model=
"directoryForm.level"
@
change=
"isTop"
label=
"顶级"
/>
</el-form-item>
</el-form-item>
...
...
@@ -21,26 +22,34 @@
</
template
>
<
script
setup
>
import
{
reactive
,
ref
,
onMounted
}
from
'
vue
'
import
{
reactive
,
ref
,
onMounted
,
onBeforeMount
,
getCurrentInstance
,
nextTick
}
from
'
vue
'
const
props
=
defineProps
({
formType
:
{
type
:
String
,
default
:
'
create
'
,
//false 新建 true 编辑
},
});
const
{
proxy
}
=
getCurrentInstance
()
const
{
$axios
,
$message
}
=
proxy
const
directoryForm
=
reactive
({
parent
:
''
,
const
directoryForm
=
reactive
({
p_organization_id
:
''
,
name
:
''
,
level
:
''
})
level
:
false
})
const
directoryFormRules
=
reactive
({
parent
:
[
const
directoryFormRules
=
reactive
({
p_organization_id
:
[
{
required
:
true
,
message
:
'
请输入上级目录
'
,
trigger
:
'
blur
'
},
],
name
:
[
{
required
:
true
,
message
:
'
请输入名称
'
,
trigger
:
'
blur
'
},
],
})
const
directoryRef
=
ref
(
null
)
const
emit
=
defineEmits
([
'
action
'
])
})
const
directoryRef
=
ref
(
null
)
const
emit
=
defineEmits
([
'
action
'
])
const
submitForm
=
async
()
=>
{
const
submitForm
=
async
()
=>
{
if
(
!
directoryRef
)
return
await
directoryRef
.
value
.
validate
((
valid
,
fields
)
=>
{
if
(
valid
)
{
...
...
@@ -49,19 +58,51 @@ const submitForm = async () => {
emit
(
'
action
'
,
null
)
}
})
}
const
clearForm
=
()
=>
{
}
const
clearForm
=
()
=>
{
if
(
!
directoryRef
)
return
directoryRef
.
value
.
resetFields
()
}
}
const
setForm
=
(
data
)
=>
{
const
setForm
=
(
data
)
=>
{
directoryForm
.
value
=
Object
.
assign
(
directoryForm
,
data
);
}
}
onMounted
(()
=>
{
const
orgData
=
ref
([])
const
treeProps
=
{
label
:
'
name
'
,
children
:
'
Child
'
,
value
:
'
organization_id
'
}
const
getOrgTree
=
()
=>
{
$axios
.
get
(
`/apaas/system/v5/org/tree`
)
.
then
((
res
)
=>
{
if
(
res
.
data
.
code
==
200
)
{
orgData
.
value
=
res
.
data
.
data
||
[];
// nextTick(() => {
// filterNode();
// })
}
else
{
$message
.
error
(
res
.
data
.
msg
)
}
})
}
})
const
filterNode
=
(
value
,
data
)
=>
{
return
data
.
data_type
===
0
}
const
isTop
=
(
data
)
=>
{
directoryForm
.
p_organization_id
=
data
?
'
'
:
''
;
//空格绕过表单非空校验
}
onBeforeMount
(()
=>
{
getOrgTree
()
})
onMounted
(()
=>
{
})
defineExpose
({
submitForm
,
clearForm
,
setForm
})
defineExpose
({
submitForm
,
clearForm
,
setForm
})
</
script
>
\ No newline at end of file
src/page/main/system/organization/index.vue
View file @
e7765b84
This diff is collapsed.
Click to expand it.
src/page/main/system/organization/org-form.vue
View file @
e7765b84
...
...
@@ -7,23 +7,23 @@
ref=
"orgRef"
style=
"max-width: 80%"
>
<el-form-item
label=
"上级目录"
prop=
"p
arent
"
>
<el-
input
v-model=
"orgForm.parent"
style=
"width: 80%"
/>
<el-form-item
label=
"上级目录"
prop=
"p
_organization_id"
v-if=
"formType === 'create'
"
>
<el-
tree-select
v-model=
"orgForm.p_organization_id"
:data=
"orgData"
:props=
"treeProps"
:render-after-expand=
"false"
:filter-node-method=
"filterNode"
:disabled=
"orgForm.level"
:check-strictly=
"true"
style=
"width: 80%;"
/>
<el-form-item
label=
""
style=
"padding-left: 16px"
>
<el-checkbox
v-model=
"orgForm.level"
label=
"顶级"
/>
<el-checkbox
v-model=
"orgForm.level"
@
change=
"isTop"
label=
"顶级"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"政务机构名称"
prop=
"
orgN
ame"
>
<el-input
v-model=
"orgForm.
orgN
ame"
/>
<el-form-item
label=
"政务机构名称"
prop=
"
n
ame"
>
<el-input
v-model=
"orgForm.
n
ame"
/>
</el-form-item>
<el-form-item
label=
"组织机构代码"
prop=
"code"
>
<el-input
v-model=
"orgForm.code"
/>
<el-form-item
label=
"组织机构代码"
prop=
"
organization_
code"
>
<el-input
v-model=
"orgForm.
organization_
code"
/>
</el-form-item>
<el-form-item
label=
"组织介绍"
prop=
"desc"
>
<el-input
type=
"textarea"
:rows=
"3"
v-model=
"orgForm.desc"
/>
<el-form-item
label=
"组织介绍"
prop=
"desc
ription
"
>
<el-input
type=
"textarea"
:rows=
"3"
v-model=
"orgForm.desc
ription
"
/>
</el-form-item>
<el-form-item
label=
"组织附件"
prop=
"logo"
>
<bg-upload
v-model=
"orgForm.
file
"
customTips
>
<bg-upload
v-model=
"orgForm.
attachment
"
customTips
>
<span>
将文件拖到此处,或 点击上传
</span>
</bg-upload>
</el-form-item>
...
...
@@ -31,34 +31,40 @@
</
template
>
<
script
setup
>
import
{
reactive
,
ref
,
onMounted
}
from
'
vue
'
const
orgForm
=
reactive
({
parent
:
''
,
level
:
''
,
orgName
:
''
,
code
:
''
,
desc
:
''
,
desc
:
''
,
file
:
''
})
import
{
reactive
,
ref
,
onMounted
,
onBeforeMount
,
getCurrentInstance
}
from
'
vue
'
const
props
=
defineProps
({
formType
:
{
type
:
String
,
default
:
'
create
'
,
//false 新建 true 编辑
},
});
const
{
proxy
}
=
getCurrentInstance
()
const
{
$axios
,
$message
}
=
proxy
const
orgForm
=
reactive
({
p_organization_id
:
''
,
level
:
false
,
name
:
''
,
organization_code
:
''
,
description
:
''
,
attachment
:
[]
})
const
formRules
=
reactive
({
parent
:
[
const
formRules
=
reactive
({
p_organization_id
:
[
{
required
:
true
,
message
:
'
输入上级目录
'
,
trigger
:
'
blur
'
},
],
orgN
ame
:
[
n
ame
:
[
{
required
:
true
,
message
:
'
请输入机构名称
'
,
trigger
:
'
blur
'
},
],
code
:
[
organization_
code
:
[
{
required
:
true
,
message
:
'
请输入组织机构代码
'
,
trigger
:
'
blur
'
},
],
})
})
const
orgRef
=
ref
(
null
)
const
emit
=
defineEmits
([
'
action
'
])
const
orgRef
=
ref
(
null
)
const
emit
=
defineEmits
([
'
action
'
])
const
submitForm
=
async
()
=>
{
const
submitForm
=
async
()
=>
{
if
(
!
orgRef
)
return
await
orgRef
.
value
.
validate
((
valid
,
fields
)
=>
{
if
(
valid
)
{
...
...
@@ -67,20 +73,53 @@ const submitForm = async () => {
emit
(
'
action
'
,
null
)
}
})
}
}
const
clearForm
=
()
=>
{
const
clearForm
=
()
=>
{
if
(
!
orgRef
)
return
orgRef
.
value
.
resetFields
()
}
}
const
setForm
=
(
data
)
=>
{
const
setForm
=
(
data
)
=>
{
orgForm
.
value
=
Object
.
assign
(
orgForm
,
data
);
}
}
onMounted
(()
=>
{
const
orgData
=
ref
([])
const
treeProps
=
{
label
:
'
name
'
,
children
:
'
Child
'
,
value
:
'
organization_id
'
}
const
getOrgTree
=
()
=>
{
$axios
.
get
(
`/apaas/system/v5/org/tree`
)
.
then
((
res
)
=>
{
if
(
res
.
data
.
code
==
200
)
{
orgData
.
value
=
res
.
data
.
data
||
[];
// nextTick(() => {
// filterNode();
// })
}
else
{
$message
.
error
(
res
.
data
.
msg
)
}
})
}
})
const
filterNode
=
(
value
,
data
)
=>
{
return
data
.
data_type
===
0
}
const
isTop
=
(
data
)
=>
{
orgForm
.
p_organization_id
=
data
?
'
'
:
''
;
//空格绕过表单非空校验
}
onBeforeMount
(()
=>
{
getOrgTree
()
})
onMounted
(()
=>
{
})
defineExpose
({
submitForm
,
clearForm
,
setForm
})
</
script
>
\ No newline at end of file
src/page/main/system/organization/platform-user/index.vue
View file @
e7765b84
...
...
@@ -48,8 +48,11 @@
<platformPersonForm
v-show=
"step === 2"
ref=
"plplatformPersonFormRef"
@
action=
"getPlatformPersonFormData"
></platformPersonForm>
<div
class=
"process_end"
v-show=
"step === 3"
>
<div>
<div><img
src=
"@/assets/imgs/img_data-complete.png"
alt=
""
></div>
<div
class=
"font_bold"
>
平台用户新增成功
</div>
<div>
<img
v-if=
"successFlag"
src=
"@/assets/imgs/img_data-complete.png"
alt=
""
>
<img
v-else
src=
"@/assets/imgs/img_data-fail.png"
alt=
""
>
</div>
<div
class=
"font_bold"
>
{{route.query.id ? (successFlag ? '平台用户编辑成功' : '平台用户编辑失败') : (successFlag ? '平台用户新增成功' : '平台用户新增失败')}}
</div>
<el-button
@
click=
"cancel"
>
返回列表
</el-button>
<el-button
type=
"primary"
@
click=
"continueCreate"
>
继续创建
</el-button>
</div>
...
...
@@ -78,8 +81,10 @@
import
{
useRoute
,
useRouter
}
from
'
vue-router
'
;
import
platformAccountForm
from
'
./platform-account-form.vue
'
;
import
platformPersonForm
from
'
./platform-person-form.vue
'
;
import
{
reactive
,
ref
,
onBeforeMount
,
toRefs
,
computed
,
onBeforeUnmount
,
onMounted
}
from
'
vue
'
;
import
CryptoJS
from
"
crypto-js
"
;
import
{
reactive
,
ref
,
onBeforeMount
,
toRefs
,
computed
,
onMounted
,
getCurrentInstance
}
from
'
vue
'
;
const
{
proxy
}
=
getCurrentInstance
()
const
{
$axios
,
$message
}
=
proxy
const
route
=
useRoute
();
const
router
=
useRouter
();
const
step
=
ref
(
1
);
...
...
@@ -87,18 +92,21 @@ const platformAccountFormRef = ref(null);
const
plplatformPersonFormRef
=
ref
(
null
);
const
formData
=
reactive
({
logo
:
''
,
account
:
''
,
phone
:
''
,
system_
account
:
''
,
contact_
phone
:
''
,
password
:
''
,
confirm_password
:
''
,
role
:
''
,
is_use
:
1
,
select_
role
:
''
,
state
:
''
,
name
:
''
,
email
:
''
,
contact_
name
:
''
,
contact_
email
:
''
,
remark
:
''
,
});
//账号信息表单+个人信息表单
const
orgId
=
ref
(
null
);
const
successFlag
=
ref
(
false
)
// 下一步
const
nextStep
=
()
=>
{
...
...
@@ -107,7 +115,7 @@ const nextStep = () => {
//账号信息表单检验触发事件 data为null 校验失败
const
getPlatformAccountFormData
=
(
data
)
=>
{
if
(
data
)
{
formData
.
value
=
Object
.
assign
(
formData
,
data
);
Object
.
assign
(
formData
,
data
);
step
.
value
=
2
;
}
else
{
...
...
@@ -116,9 +124,39 @@ const getPlatformAccountFormData = (data) => {
//个人信息表单检验触发事件 data为null 校验失败
const
getPlatformPersonFormData
=
(
data
)
=>
{
if
(
data
)
{
formData
.
value
=
Object
.
assign
(
formData
,
data
);
console
.
log
(
formData
);
Object
.
assign
(
formData
,
data
);
if
(
route
.
query
.
id
)
{
console
.
log
(
formData
)
let
params
=
{
}
$axios
.
post
(
`/apaas/system/v5/user/update`
,
params
)
.
then
((
res
)
=>
{
if
(
res
.
data
.
code
==
200
)
{
successFlag
.
value
=
true
;
step
.
value
=
3
;
}
else
{
$message
.
error
(
res
.
data
.
msg
)
}
})
}
else
{
const
params
=
{...
formData
,
organization_id
:
orgId
.
value
,
logo
:
formData
.
logo
&&
formData
.
logo
.
length
>
0
?
formData
.
logo
[
0
].
url
:
''
,
is_admin
:
3
,
password
:
CryptoJS
.
AES
.
encrypt
(
formData
.
password
,
"
swuE9cmCZQwrkYRV
"
).
toString
()
};
$axios
.
post
(
`/apaas/system/v5/org/add/user`
,
params
)
.
then
((
res
)
=>
{
if
(
res
.
data
.
code
==
200
)
{
successFlag
.
value
=
true
;
step
.
value
=
3
;
}
else
{
$message
.
error
(
res
.
data
.
msg
)
}
})
}
}
}
//上一步
...
...
@@ -134,40 +172,30 @@ const continueCreate = () => {
platformAccountFormRef
.
value
.
clearForm
();
plplatformPersonFormRef
.
value
.
clearForm
();
step
.
value
=
1
;
successFlag
.
value
=
false
;
}
//取消
const
cancel
=
()
=>
{
router
.
go
(
-
1
);
}
onBeforeUnmount
(()
=>
{
const
getOrgTree
=
()
=>
{
$axios
.
get
(
`/apaas/system/v5/org/tree`
)
.
then
((
res
)
=>
{
if
(
res
.
data
.
code
==
200
)
{
orgId
.
value
=
res
.
data
.
data
[
0
].
organization_id
;
}
else
{
$message
.
error
(
res
.
data
.
msg
)
}
})
}
onBeforeMount
(()
=>
{
getOrgTree
()
})
onMounted
(()
=>
{
if
(
route
.
query
.
type
===
"
1
"
)
{
setTimeout
(()
=>
{
platformAccountFormRef
.
value
.
setForm
({
org
:
'
a
'
,
code
:
'
b
'
,
name
:
'
b
'
,
desc
:
'
b
'
,
logo
:
[
'
b
'
],
role
:
'
b
'
,
account
:
'
b
'
,
password
:
'
b
'
,
confirm_password
:
'
b
'
,
url
:
'
b
'
,
firm_name
:
'
b
'
,
is_use
:
'
b
'
,
})
plplatformPersonFormRef
.
value
.
setForm
({
contact_user
:
'
c
'
,
phone
:
'
c
'
,
email
:
'
c
'
,
remark
:
'
c
'
,
})
},
500
)
}
})
...
...
src/page/main/system/organization/platform-user/platform-account-form.vue
View file @
e7765b84
...
...
@@ -10,11 +10,11 @@
<el-form-item
label=
"头像"
prop=
"logo"
>
<bg-upload-image
v-model=
"platformAccountForm.logo"
:showTips=
"true"
:limit=
"1"
:fileSize=
"500"
:fileSizeUnit=
"'KB'"
listType=
"picture-card"
:accept=
"['.jpg','.jpeg','.png']"
customTips=
"请选择图片上传:大小120 * 120像素支持jpg、png等格式,图片需小于500KB"
></bg-upload-image>
</el-form-item>
<el-form-item
label=
"账号"
prop=
"account"
>
<el-input
v-model=
"platformAccountForm.account"
/>
<el-form-item
label=
"账号"
prop=
"
system_
account"
>
<el-input
v-model=
"platformAccountForm.
system_
account"
/>
</el-form-item>
<el-form-item
label=
"手机号"
prop=
"phone"
>
<el-input
v-model=
"platformAccountForm.phone"
/>
<el-form-item
label=
"手机号"
prop=
"
contact_
phone"
>
<el-input
v-model=
"platformAccountForm.
contact_
phone"
/>
</el-form-item>
<el-form-item
label=
"密码"
prop=
"password"
>
<el-input
type=
"password"
v-model=
"platformAccountForm.password"
/>
...
...
@@ -22,27 +22,35 @@
<el-form-item
label=
"确认密码"
prop=
"confirm_password"
>
<el-input
type=
"password"
v-model=
"platformAccountForm.confirm_password"
/>
</el-form-item>
<el-form-item
label=
"角色授权"
prop=
"role"
>
<el-input
v-model=
"platformAccountForm.role"
/>
<el-form-item
label=
"角色授权"
prop=
"select_role"
>
<el-select
v-model=
"platformAccountForm.select_role"
multiple
placeholder=
"请选择角色"
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-form-item>
<el-form-item
label=
"是否启用"
prop=
"
is_us
e"
>
<bg-switch
:labels=
"['否','是']"
:values=
"[0,1]"
v-model=
"platformAccountForm.
is_us
e"
></bg-switch>
<el-form-item
label=
"是否启用"
prop=
"
stat
e"
>
<bg-switch
:labels=
"['否','是']"
:values=
"[0,1]"
v-model=
"platformAccountForm.
stat
e"
></bg-switch>
</el-form-item>
</el-form>
</
template
>
<
script
setup
>
import
{
reactive
,
ref
,
onMounted
}
from
'
vue
'
import
{
reactive
,
ref
,
onMounted
,
onBeforeMount
,
getCurrentInstance
}
from
'
vue
'
const
{
proxy
}
=
getCurrentInstance
()
const
{
$axios
,
$message
}
=
proxy
const
platformAccountForm
=
reactive
({
logo
:
''
,
account
:
''
,
phone
:
''
,
logo
:
[]
,
system_
account
:
''
,
contact_
phone
:
''
,
password
:
''
,
confirm_password
:
''
,
role
:
''
,
is_us
e
:
1
,
select_
role
:
''
,
stat
e
:
1
,
})
...
...
@@ -53,15 +61,26 @@ const validatePass = (rule, value, callback) => {
callback
()
}
}
const
checkPhone
=
(
rule
,
value
,
callback
)
=>
{
var
phone_ruler
=
/^
(?:(?:\+
|00
)
86
)?
1
[
3-9
]\d{9}
$/
;
setTimeout
(()
=>
{
if
(
!
phone_ruler
.
test
(
value
)
&&
value
.
length
!==
0
)
{
callback
(
new
Error
(
"
请输入正确的手机号码
"
));
}
else
{
callback
();
}
});
};
const
platformAccountFormRules
=
reactive
({
account
:
[
system_
account
:
[
{
required
:
true
,
message
:
'
请输入账号
'
,
trigger
:
'
blur
'
},
],
phone
:
[
contact_
phone
:
[
{
required
:
true
,
message
:
'
请输入手机号
'
,
trigger
:
'
blur
'
},
// { validator: checkPhone, trigger: 'blur' }
],
role
:
[
select_
role
:
[
{
required
:
true
,
message
:
'
请选择角色
'
,
trigger
:
'
blur
'
},
],
password
:
[
...
...
@@ -73,6 +92,8 @@ const platformAccountFormRules = reactive({
],
})
const
roleList
=
ref
([])
const
platformAccountRef
=
ref
(
null
)
...
...
@@ -98,6 +119,21 @@ const setForm = (data) => {
platformAccountForm
.
value
=
Object
.
assign
(
platformAccountForm
,
data
);
}
const
getRoleList
=
()
=>
{
$axios
.
get
(
`/apaas/system/v5/org/select/role?is_admin=3`
)
.
then
((
res
)
=>
{
if
(
res
.
data
.
code
==
200
)
{
roleList
.
value
=
res
.
data
.
data
;
}
else
{
}
})
}
onBeforeMount
(()
=>
{
getRoleList
();
})
onMounted
(()
=>
{
})
...
...
src/page/main/system/organization/platform-user/platform-person-form.vue
View file @
e7765b84
...
...
@@ -7,13 +7,13 @@
ref=
"platformPersonFormRef"
style=
"max-width: 66%"
>
<el-form-item
label=
"姓名"
prop=
"name"
>
<el-input
v-model=
"platformPersonForm.name"
/>
<el-form-item
label=
"姓名"
prop=
"
contact_
name"
>
<el-input
v-model=
"platformPersonForm.
contact_
name"
/>
</el-form-item>
<el-form-item
label=
"邮箱"
>
<el-input
v-model=
"platformPersonForm.email"
/>
<el-form-item
label=
"邮箱"
prop=
"contact_email"
>
<el-input
v-model=
"platformPersonForm.
contact_
email"
/>
</el-form-item>
<el-form-item
label=
"备注"
>
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-input
type=
"textarea"
:rows=
"3"
v-model=
"platformPersonForm.remark"
/>
</el-form-item>
</el-form>
...
...
@@ -23,8 +23,8 @@
import
{
reactive
,
ref
,
onMounted
}
from
'
vue
'
const
platformPersonForm
=
reactive
({
name
:
''
,
email
:
''
,
contact_
name
:
''
,
contact_
email
:
''
,
remark
:
''
,
})
...
...
src/page/main/system/organization/tree.vue
View file @
e7765b84
This diff is collapsed.
Click to expand it.
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