Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
P
precision-effect
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
耿迪迪
precision-effect
Commits
341a4ad4
Commit
341a4ad4
authored
Jun 10, 2023
by
王晓倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
非admin账号:只能查看本部门账户,交易项目维护、账户维护里部门下拉框默认显示本部门且不可用
parent
12266064
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
2 deletions
+41
-2
TAccountController.java
...com/zehong/web/controller/account/TAccountController.java
+12
-0
TTransactionProjectController.java
...controller/transaction/TTransactionProjectController.java
+5
-0
getters.js
precision-effect-web/src/store/getters.js
+2
-0
user.js
precision-effect-web/src/store/modules/user.js
+5
-0
index.vue
precision-effect-web/src/views/account/index.vue
+8
-1
index.vue
precision-effect-web/src/views/transaction/index.vue
+9
-1
No files found.
precision-effect-admin/src/main/java/com/zehong/web/controller/account/TAccountController.java
View file @
341a4ad4
package
com
.
zehong
.
web
.
controller
.
account
;
import
java.util.List
;
import
com.zehong.common.core.domain.entity.SysUser
;
import
com.zehong.common.utils.ServletUtils
;
import
com.zehong.common.utils.StringUtils
;
import
com.zehong.framework.web.service.TokenService
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -32,6 +37,8 @@ public class TAccountController extends BaseController
{
@Autowired
private
ITAccountService
tAccountService
;
@Autowired
private
TokenService
tokenService
;
/**
* 查询账户列表
...
...
@@ -41,6 +48,11 @@ public class TAccountController extends BaseController
public
TableDataInfo
list
(
TAccount
tAccount
)
{
startPage
();
// 获取当前用户
SysUser
user
=
tokenService
.
getLoginUser
(
ServletUtils
.
getRequest
()).
getUser
();
if
(
StringUtils
.
isNotNull
(
user
)
&&
!
user
.
isAdmin
())
{
tAccount
.
setDeptId
(
user
.
getDeptId
());
}
List
<
TAccount
>
list
=
tAccountService
.
selectTAccountList
(
tAccount
);
return
getDataTable
(
list
);
}
...
...
precision-effect-admin/src/main/java/com/zehong/web/controller/transaction/TTransactionProjectController.java
View file @
341a4ad4
...
...
@@ -72,6 +72,11 @@ public class TTransactionProjectController extends BaseController
@GetMapping
(
"/export"
)
public
AjaxResult
export
(
TTransactionProject
tTransactionProject
)
{
// 获取当前用户
SysUser
user
=
tokenService
.
getLoginUser
(
ServletUtils
.
getRequest
()).
getUser
();
if
(
StringUtils
.
isNotNull
(
user
)
&&
!
user
.
isAdmin
())
{
tTransactionProject
.
setDeptId
(
user
.
getDeptId
());
}
List
<
TTransactionProject
>
list
=
tTransactionProjectService
.
selectTTransactionProjectList
(
tTransactionProject
);
ExcelUtil
<
TTransactionProject
>
util
=
new
ExcelUtil
<
TTransactionProject
>(
TTransactionProject
.
class
);
return
util
.
exportExcel
(
list
,
"交易项目数据"
);
...
...
precision-effect-web/src/store/getters.js
View file @
341a4ad4
...
...
@@ -8,6 +8,8 @@ const getters = {
avatar
:
state
=>
state
.
user
.
avatar
,
name
:
state
=>
state
.
user
.
name
,
deptName
:
state
=>
state
.
user
.
deptName
,
deptId
:
state
=>
state
.
user
.
deptId
,
userId
:
state
=>
state
.
user
.
userId
,
introduction
:
state
=>
state
.
user
.
introduction
,
roles
:
state
=>
state
.
user
.
roles
,
permissions
:
state
=>
state
.
user
.
permissions
,
...
...
precision-effect-web/src/store/modules/user.js
View file @
341a4ad4
...
...
@@ -10,6 +10,7 @@ const user = {
permissions
:
[],
systemSetting
:{},
deptName
:
''
,
userId
:
''
,
deptId
:
''
,
},
...
...
@@ -35,6 +36,9 @@ const user = {
SET_DEPTID
:
(
state
,
deptId
)
=>
{
state
.
deptId
=
deptId
;
},
SET_USERID
:
(
state
,
userId
)
=>
{
state
.
userId
=
userId
;
},
SET_DEPTNAME
:
(
state
,
deptName
)
=>
{
state
.
deptName
=
deptName
;
},
...
...
@@ -76,6 +80,7 @@ const user = {
// 默认配置
commit
(
'SET_SYSTEMSETTING'
,
res
.
systemSetting
)
commit
(
'SET_DEPTID'
,
user
.
deptId
);
commit
(
'SET_USERID'
,
user
.
userId
);
commit
(
'SET_DEPTNAME'
,
user
.
dept
.
deptName
);
console
.
log
(
res
.
systemSetting
)
resolve
(
res
)
...
...
precision-effect-web/src/views/account/index.vue
View file @
341a4ad4
...
...
@@ -3,7 +3,7 @@
<el-form
:model=
"queryParams"
ref=
"queryForm"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form-item
label=
"部门"
prop=
"deptId"
>
<div
style=
"width: 200px"
>
<treeselect
v-model=
"queryParams.deptId"
:options=
"deptOptions"
:show-count=
"true"
placeholder=
"请选择归属部门"
/>
<treeselect
v-model=
"queryParams.deptId"
:options=
"deptOptions"
:show-count=
"true"
placeholder=
"请选择归属部门"
:disabled=
"disabled"
/>
</div>
</el-form-item>
<el-form-item>
...
...
@@ -192,12 +192,19 @@ export default {
},
// 部门树选项
deptOptions
:
[],
disabled
:
false
,
operateOpen
:
false
,
cashOperateList
:
[],
operateListTotal
:
0
};
},
created
()
{
console
.
log
(
"userId==="
,
this
.
$store
.
state
.
user
.
userId
);
console
.
log
(
"deptId==="
,
this
.
$store
.
state
.
user
.
deptId
);
if
(
this
.
$store
.
state
.
user
.
userId
!=
1
){
this
.
queryParams
.
deptId
=
this
.
$store
.
state
.
user
.
deptId
;
this
.
disabled
=
true
;
}
this
.
getList
();
this
.
getTreeselect
();
},
...
...
precision-effect-web/src/views/transaction/index.vue
View file @
341a4ad4
...
...
@@ -13,7 +13,7 @@
<el-form-item
label=
"部门"
prop=
"deptId"
>
<div
style=
"width: 200px"
>
<treeselect
v-model=
"queryParams.deptId"
:options=
"deptOptions"
:show-count=
"true"
placeholder=
"请选择归属部门"
/>
<treeselect
v-model=
"queryParams.deptId"
:options=
"deptOptions"
:show-count=
"true"
placeholder=
"请选择归属部门"
:disabled=
"disabled"
/>
</div>
</el-form-item>
...
...
@@ -231,10 +231,18 @@ export default {
},
// 部门树选项
deptOptions
:
[],
disabled
:
false
,
priceShow
:
true
};
},
created
()
{
console
.
log
(
"userId==="
,
this
.
$store
.
state
.
user
.
userId
);
console
.
log
(
"deptId==="
,
this
.
$store
.
state
.
user
.
deptId
);
if
(
this
.
$store
.
state
.
user
.
userId
!=
1
){
this
.
queryParams
.
deptId
=
this
.
$store
.
state
.
user
.
deptId
;
this
.
disabled
=
true
;
}
this
.
getList
();
this
.
getTreeselect
();
},
...
...
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