Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
c540a04b
Commit
c540a04b
authored
Nov 23, 2019
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
49575265
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
40 additions
and
13 deletions
+40
-13
bigdata/app/base/controller/impl/auth/orgCtl.js
+7
-1
bigdata/app/base/db/metadata/bizs/wx76a324c5d201d1a4/comorgs.js
+3
-3
bigdata/app/base/db/metadata/bizs/wx76a324c5d201d1a4/comusers.js
+2
-0
bigdata/app/base/service/impl/auth/orgSve.js
+15
-5
bigdata/app/front/vues/pages/comorgs/comorgs.js
+12
-3
bigdata/app/front/vues/pages/companyinfo/companyinfo.js
+1
-1
No files found.
bigdata/app/base/controller/impl/auth/orgCtl.js
View file @
c540a04b
...
@@ -7,6 +7,7 @@ const logCtl = system.getObject("web.common.oplogCtl");
...
@@ -7,6 +7,7 @@ const logCtl = system.getObject("web.common.oplogCtl");
class
OrgCtl
extends
CtlBase
{
class
OrgCtl
extends
CtlBase
{
constructor
(){
constructor
(){
super
(
"auth"
,
CtlBase
.
getServiceName
(
OrgCtl
));
super
(
"auth"
,
CtlBase
.
getServiceName
(
OrgCtl
));
this
.
compSvr
=
system
.
getObject
(
"service.common.companySve"
);
}
}
//检查是否已经存在主要岗位
//检查是否已经存在主要岗位
async
checkMainPosition
(
p
,
q
,
req
){
async
checkMainPosition
(
p
,
q
,
req
){
...
@@ -19,6 +20,7 @@ class OrgCtl extends CtlBase{
...
@@ -19,6 +20,7 @@ class OrgCtl extends CtlBase{
return
system
.
getResult
(
rtn
);
return
system
.
getResult
(
rtn
);
}
}
async
create
(
p
,
q
,
req
){
async
create
(
p
,
q
,
req
){
return
super
.
create
(
p
,
q
,
req
);
return
super
.
create
(
p
,
q
,
req
);
}
}
async
delete
(
p
,
q
,
req
){
async
delete
(
p
,
q
,
req
){
...
@@ -28,7 +30,11 @@ class OrgCtl extends CtlBase{
...
@@ -28,7 +30,11 @@ class OrgCtl extends CtlBase{
return
super
.
update
(
p
,
q
,
req
);
return
super
.
update
(
p
,
q
,
req
);
}
}
async
initOrgs
(
p
,
q
,
req
){
async
initOrgs
(
p
,
q
,
req
){
var
tocompany
=
req
.
session
.
tocompany
;
var
tocompany
=
req
.
session
.
tocompany
;
var
cmkey
=
p
.
comkey
;
if
(
cmkey
){
tocompany
=
await
this
.
compSvr
.
findOne
({
companykey
:
cmkey
});
}
//按照公司名称查询,是否存在节点,不存在,就创建根节点
//按照公司名称查询,是否存在节点,不存在,就创建根节点
//如果存在就按照名称查询出当前和她的字节点
//如果存在就按照名称查询出当前和她的字节点
var
rtn
=
await
this
.
service
.
initOrgs
(
tocompany
,
req
.
appid
);
var
rtn
=
await
this
.
service
.
initOrgs
(
tocompany
,
req
.
appid
);
...
...
bigdata/app/base/db/metadata/bizs/wx76a324c5d201d1a4/comorgs.js
View file @
c540a04b
...
@@ -11,9 +11,9 @@ module.exports={
...
@@ -11,9 +11,9 @@ module.exports={
ctls
:[
ctls
:[
{
"type"
:
"input"
,
"label"
:
"编码"
,
"prop"
:
"code"
,
"placeHolder"
:
"输入组织编码"
,
"style"
:
""
,
rules
:[
{
"required"
:
true
,
"message"
:
' '
,
"trigger"
:
'blur'
},]},
{
"type"
:
"input"
,
"label"
:
"编码"
,
"prop"
:
"code"
,
"placeHolder"
:
"输入组织编码"
,
"style"
:
""
,
rules
:[
{
"required"
:
true
,
"message"
:
' '
,
"trigger"
:
'blur'
},]},
{
"type"
:
"input"
,
"label"
:
"名称"
,
"prop"
:
"name"
,
"placeHolder"
:
"输入组织名称"
,
"style"
:
""
,
rules
:[
{
"required"
:
true
,
"message"
:
' '
,
"trigger"
:
'blur'
},]},
{
"type"
:
"input"
,
"label"
:
"名称"
,
"prop"
:
"name"
,
"placeHolder"
:
"输入组织名称"
,
"style"
:
""
,
rules
:[
{
"required"
:
true
,
"message"
:
' '
,
"trigger"
:
'blur'
},]},
{
"type"
:
"switch"
,
"label"
:
"是否岗位"
,
"targetprop"
:
"Roles,isMain"
,
"prop"
:
"isPosition"
,
"acText"
:
"是"
,
"inactText"
:
"否"
,
"placeHolder"
:
""
,
"style"
:
""
},
//
{"type":"switch","label":"是否岗位","targetprop":"Roles,isMain","prop":"isPosition","acText":"是","inactText":"否","placeHolder":"","style":""},
{
"type"
:
"select"
,
"refModel"
:
"auth.role"
,
"defaultHide"
:
true
,
"isMulti"
:
true
,
"label"
:
"角色"
,
"prop"
:
"Roles"
,
"labelField"
:
"name"
,
"valueField"
:
"id"
,
"style"
:
""
},
//
{"type":"select","refModel":"auth.role","defaultHide":true,"isMulti":true,"label":"角色","prop":"Roles","labelField":"name","valueField":"id","style":""},
{
"type"
:
"switch"
,
"label"
:
"是否负责人岗"
,
"defaultHide"
:
true
,
"prop"
:
"isMain"
,
"acText"
:
"是"
,
"inactText"
:
"否"
,
"placeHolder"
:
""
,
"style"
:
""
},
//
{"type":"switch","label":"是否负责人岗","defaultHide":true,"prop":"isMain","acText":"是","inactText":"否","placeHolder":"","style":""},
{
"type"
:
"btn"
,
"label"
:
"保存"
,
"prop"
:
"btnLogin"
,
"placeHolder"
:
"保存"
,
"style"
:{
"width"
:
"150px"
,
"margin-left"
:
"100px"
,
"margin-top"
:
"20px"
},
"face"
:
"warning"
},
{
"type"
:
"btn"
,
"label"
:
"保存"
,
"prop"
:
"btnLogin"
,
"placeHolder"
:
"保存"
,
"style"
:{
"width"
:
"150px"
,
"margin-left"
:
"100px"
,
"margin-top"
:
"20px"
},
"face"
:
"warning"
},
]
]
}
}
...
...
bigdata/app/base/db/metadata/bizs/wx76a324c5d201d1a4/comusers.js
View file @
c540a04b
module
.
exports
=
{
module
.
exports
=
{
"list"
:{
"list"
:{
columnMetaData
:[
columnMetaData
:[
{
"width"
:
"100"
,
"label"
:
"应用"
,
"prop"
:
"app.name"
,
"isShowTip"
:
true
,
"isTmpl"
:
false
},
{
"width"
:
"100"
,
"label"
:
"昵称"
,
"prop"
:
"nickName"
,
"isShowTip"
:
true
,
"isTmpl"
:
false
},
{
"width"
:
"100"
,
"label"
:
"昵称"
,
"prop"
:
"nickName"
,
"isShowTip"
:
true
,
"isTmpl"
:
false
},
{
"width"
:
"100"
,
"label"
:
"登录账号"
,
"prop"
:
"userName"
,
"isShowTip"
:
true
,
"isTmpl"
:
false
},
{
"width"
:
"100"
,
"label"
:
"登录账号"
,
"prop"
:
"userName"
,
"isShowTip"
:
true
,
"isTmpl"
:
false
},
{
"width"
:
"100"
,
"label"
:
"角色"
,
"prop"
:
"Roles"
,
"isShowTip"
:
true
,
"isTmpl"
:
false
},
{
"width"
:
"100"
,
"label"
:
"角色"
,
"prop"
:
"Roles"
,
"isShowTip"
:
true
,
"isTmpl"
:
false
},
{
"width"
:
"100"
,
"label"
:
"管理员"
,
"prop"
:
"isAdmin"
,
"isShowTip"
:
true
,
"isTmpl"
:
false
},
{
"width"
:
"80"
,
"label"
:
"状态"
,
"prop"
:
"isEnabled"
,
"isShowTip"
:
true
,
"isTmpl"
:
false
},
{
"width"
:
"80"
,
"label"
:
"状态"
,
"prop"
:
"isEnabled"
,
"isShowTip"
:
true
,
"isTmpl"
:
false
},
{
"width"
:
"null"
,
"label"
:
"操作"
,
"name"
:
"null"
,
"isShowTip"
:
false
,
"isTmpl"
:
true
,
"isBtns"
:
true
},
{
"width"
:
"null"
,
"label"
:
"操作"
,
"name"
:
"null"
,
"isShowTip"
:
false
,
"isTmpl"
:
true
,
"isBtns"
:
true
},
]
]
...
...
bigdata/app/base/service/impl/auth/orgSve.js
View file @
c540a04b
...
@@ -34,6 +34,7 @@ class OrgService extends ServiceBase{
...
@@ -34,6 +34,7 @@ class OrgService extends ServiceBase{
}
}
async
update
(
p
,
q
,
req
){
async
update
(
p
,
q
,
req
){
var
self
=
this
;
var
self
=
this
;
var
cmkey
=
p
.
comkey
;
//如果是来自租户界面的修改
return
this
.
db
.
transaction
(
async
function
(
t
)
{
return
this
.
db
.
transaction
(
async
function
(
t
)
{
p
.
isLeaf
=
p
.
isPosition
;
p
.
isLeaf
=
p
.
isPosition
;
var
orgupdate
=
await
self
.
dao
.
model
.
findOne
({
where
:{
id
:
p
.
id
},
transaction
:
t
});
var
orgupdate
=
await
self
.
dao
.
model
.
findOne
({
where
:{
id
:
p
.
id
},
transaction
:
t
});
...
@@ -48,7 +49,7 @@ class OrgService extends ServiceBase{
...
@@ -48,7 +49,7 @@ class OrgService extends ServiceBase{
await
ud
.
save
({
transaction
:
t
});
await
ud
.
save
({
transaction
:
t
});
}
}
//}
//}
if
(
p
.
Roles
){
if
(
p
.
Roles
&&
!
cmkey
){
//如果不是来自租户界面的修改
var
roles
=
await
self
.
db
.
models
.
role
.
findAll
({
where
:{
id
:{[
self
.
db
.
Op
.
in
]:
p
.
Roles
}}});
var
roles
=
await
self
.
db
.
models
.
role
.
findAll
({
where
:{
id
:{[
self
.
db
.
Op
.
in
]:
p
.
Roles
}}});
await
orgupdate
.
setRoles
(
roles
,{
transaction
:
t
});
await
orgupdate
.
setRoles
(
roles
,{
transaction
:
t
});
//同时要给这个岗位下的user,更新角色 todo
//同时要给这个岗位下的user,更新角色 todo
...
@@ -110,12 +111,20 @@ class OrgService extends ServiceBase{
...
@@ -110,12 +111,20 @@ class OrgService extends ServiceBase{
}
}
async
create
(
p
,
q
,
req
){
async
create
(
p
,
q
,
req
){
var
self
=
this
;
var
self
=
this
;
var
cmkey
=
p
.
comkey
;
return
this
.
db
.
transaction
(
async
function
(
t
)
{
return
this
.
db
.
transaction
(
async
function
(
t
)
{
if
(
cmkey
){
var
tmpcompany
=
await
self
.
db
.
models
.
company
.
findOne
({
where
:{
companykey
:
cmkey
},
transaction
:
t
});
p
.
company_id
=
tmpcompany
.
id
;
}
var
roles
=
await
self
.
db
.
models
.
role
.
findAll
({
where
:{
id
:{[
self
.
db
.
Op
.
in
]:
p
.
Roles
}}});
var
roles
=
await
self
.
db
.
models
.
role
.
findAll
({
where
:{
id
:{[
self
.
db
.
Op
.
in
]:
p
.
Roles
}}});
p
.
isLeaf
=
p
.
isPosition
;
p
.
isLeaf
=
p
.
isPosition
;
p
.
app_id
=
req
.
appid
;
p
.
app_id
=
null
;
var
orgnew
=
await
self
.
dao
.
model
.
create
(
p
,{
transaction
:
t
});
var
orgnew
=
await
self
.
dao
.
model
.
create
(
p
,{
transaction
:
t
});
await
orgnew
.
setRoles
(
roles
,{
transaction
:
t
});
if
(
roles
&&
roles
.
length
>
0
){
await
orgnew
.
setRoles
(
roles
,{
transaction
:
t
});
}
var
orgparent
=
await
self
.
dao
.
model
.
findOne
({
var
orgparent
=
await
self
.
dao
.
model
.
findOne
({
order
:[[
"code"
,
"ASC"
]],
order
:[[
"code"
,
"ASC"
]],
where
:{
id
:
orgnew
.
org_id
},
transaction
:
t
,
where
:{
id
:
orgnew
.
org_id
},
transaction
:
t
,
...
@@ -152,7 +161,8 @@ class OrgService extends ServiceBase{
...
@@ -152,7 +161,8 @@ class OrgService extends ServiceBase{
return
this
.
db
.
transaction
(
async
function
(
t
)
{
return
this
.
db
.
transaction
(
async
function
(
t
)
{
var
org
=
await
self
.
dao
.
model
.
findOne
({
var
org
=
await
self
.
dao
.
model
.
findOne
({
order
:[[
"code"
,
"ASC"
]],
order
:[[
"code"
,
"ASC"
]],
where
:{
name
:
company
.
name
,
company_id
:
company
.
id
,
app_id
:
appid
},
transaction
:
t
,
//where:{name:company.name,company_id:company.id,app_id:appid},transaction:t,
where
:{
name
:
company
.
name
,
company_id
:
company
.
id
},
transaction
:
t
,
include
:[
include
:[
{
model
:
self
.
db
.
models
.
org
,
as
:
"orgs"
,
order
:[[
"code"
,
"ASC"
]],
include
:[
{
model
:
self
.
db
.
models
.
org
,
as
:
"orgs"
,
order
:[[
"code"
,
"ASC"
]],
include
:[
{
model
:
self
.
db
.
models
.
org
,
as
:
"orgs"
,
order
:[[
"code"
,
"ASC"
]],
include
:[
{
model
:
self
.
db
.
models
.
org
,
as
:
"orgs"
,
order
:[[
"code"
,
"ASC"
]],
include
:[
...
@@ -173,7 +183,7 @@ class OrgService extends ServiceBase{
...
@@ -173,7 +183,7 @@ class OrgService extends ServiceBase{
isMain
:
false
,
isMain
:
false
,
orgpath
:
"/"
,
orgpath
:
"/"
,
company_id
:
company
.
id
,
company_id
:
company
.
id
,
app_id
:
appid
app_id
:
null
,
},{
transaction
:
t
});
},{
transaction
:
t
});
return
root
;
return
root
;
}
}
...
...
bigdata/app/front/vues/pages/comorgs/comorgs.js
View file @
c540a04b
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
orgidchageto
:
null
,
orgidchageto
:
null
,
refwhereorg
:{
isPosition
:
true
},
refwhereorg
:{
isPosition
:
true
},
crow
:
null
,
crow
:
null
,
selCompany
id
:
''
,
selCompany
Key
:
null
,
}
}
},
},
mounted
:
function
(){
mounted
:
function
(){
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
},
},
created
:
function
(){
created
:
function
(){
var
cmpid
=
this
.
$router
.
history
.
current
.
query
.
compid
;
var
cmpid
=
this
.
$router
.
history
.
current
.
query
.
compid
;
this
.
selCompany
id
=
cmpid
;
this
.
selCompany
Key
=
cmpid
;
},
},
methods
:{
methods
:{
beforesave
(
model
){
beforesave
(
model
){
...
@@ -54,6 +54,7 @@
...
@@ -54,6 +54,7 @@
fm
.
orgpath
=
parentdata
.
orgpath
+
"/"
+
fm
.
name
;
fm
.
orgpath
=
parentdata
.
orgpath
+
"/"
+
fm
.
name
;
fm
.
org_id
=
parentdata
.
id
;
fm
.
org_id
=
parentdata
.
id
;
}
}
fm
.
comkey
=
self
.
selCompanyKey
;
var
porgs
=
await
self
.
$root
.
postReq
(
"/web/auth/orgCtl/update"
,
fm
);
var
porgs
=
await
self
.
$root
.
postReq
(
"/web/auth/orgCtl/update"
,
fm
);
if
(
porgs
.
status
==
0
&&
porgs
.
data
){
if
(
porgs
.
status
==
0
&&
porgs
.
data
){
self
.
formatroles
(
porgs
.
data
);
self
.
formatroles
(
porgs
.
data
);
...
@@ -68,6 +69,7 @@
...
@@ -68,6 +69,7 @@
fm
.
orgpath
=
currentData
.
orgpath
+
"/"
+
fm
.
name
;
fm
.
orgpath
=
currentData
.
orgpath
+
"/"
+
fm
.
name
;
}
}
fm
.
org_id
=
currentData
.
id
;
fm
.
org_id
=
currentData
.
id
;
fm
.
comkey
=
self
.
selCompanyKey
;
var
porgs
=
await
self
.
$root
.
postReq
(
"/web/auth/orgCtl/create"
,
fm
);
var
porgs
=
await
self
.
$root
.
postReq
(
"/web/auth/orgCtl/create"
,
fm
);
if
(
porgs
.
status
==
0
&&
porgs
.
data
){
if
(
porgs
.
status
==
0
&&
porgs
.
data
){
self
.
formatroles
(
porgs
.
data
);
self
.
formatroles
(
porgs
.
data
);
...
@@ -121,7 +123,7 @@
...
@@ -121,7 +123,7 @@
},
},
async
fetchtreedata
(
node
,
resolve
,
expandkeys
){
async
fetchtreedata
(
node
,
resolve
,
expandkeys
){
if
(
node
.
level
===
0
)
{
if
(
node
.
level
===
0
)
{
var
orgroot
=
await
this
.
$root
.
postReq
(
"/web/auth/orgCtl/initOrgs"
);
var
orgroot
=
await
this
.
$root
.
postReq
(
"/web/auth/orgCtl/initOrgs"
,{
comkey
:
this
.
selCompanyKey
}
);
this
.
formatroles
([
orgroot
.
data
]);
this
.
formatroles
([
orgroot
.
data
]);
expandkeys
.
push
(
orgroot
.
data
.
id
);
expandkeys
.
push
(
orgroot
.
data
.
id
);
this
.
$refs
.
userGrid
.
linkInInitQuery
(
"opath"
,
"/"
);
this
.
$refs
.
userGrid
.
linkInInitQuery
(
"opath"
,
"/"
);
...
@@ -246,6 +248,13 @@
...
@@ -246,6 +248,13 @@
return
"停用"
;
return
"停用"
;
}
}
}
}
if
(
column
.
property
==
"isAdmin"
){
if
(
row
[
"isAdmin"
]){
return
"是"
;
}
else
{
return
"否"
;
}
}
if
(
column
.
property
==
"Roles"
){
if
(
column
.
property
==
"Roles"
){
var
tmp
=
[];
var
tmp
=
[];
var
ids
=
[];
var
ids
=
[];
...
...
bigdata/app/front/vues/pages/companyinfo/companyinfo.js
View file @
c540a04b
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
this
.
$router
.
push
({
path
:
"/comapps"
,
query
:{
"compid"
:
row
.
companykey
}});
this
.
$router
.
push
({
path
:
"/comapps"
,
query
:{
"compid"
:
row
.
companykey
}});
}
}
if
(
key
==
"comorgs"
){
if
(
key
==
"comorgs"
){
this
.
$router
.
push
({
path
:
"/comorgs"
,
query
:{
"compid"
:
row
.
id
}});
this
.
$router
.
push
({
path
:
"/comorgs"
,
query
:{
"compid"
:
row
.
companykey
}});
}
}
},
},
onColFormater
(
row
,
column
,
cellvalue
,
index
){
onColFormater
(
row
,
column
,
cellvalue
,
index
){
...
...
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