Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cdsf-static-bg
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
姜雷
cdsf-static-bg
Commits
2f07cf9c
Commit
2f07cf9c
authored
Sep 25, 2018
by
姜雷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加微信菜单授权
parent
fe76efb9
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
139 additions
and
19 deletions
+139
-19
App.vue
src/App.vue
+2
-1
base.js
src/api/base/base.js
+7
-1
publicCar.js
src/api/management/publicCar.js
+2
-2
wxAuth.js
src/api/system/wxAuth.js
+25
-0
user.vue
src/containers/management/user/user.vue
+2
-0
account.vue
src/containers/system/account/account.vue
+2
-3
wxAuth.js
src/containers/system/wxAuth/wxAuth.js
+1
-1
wxAuth.vue
src/containers/system/wxAuth/wxAuth.vue
+84
-10
base.js
src/store/modules/app/base/base.js
+12
-1
mutation-types.js
src/store/modules/app/base/mutation-types.js
+2
-0
No files found.
src/App.vue
View file @
2f07cf9c
...
...
@@ -83,7 +83,8 @@ input[type='number'] {
display
:
flex
;
flex-wrap
:
wrap
;
}
.col-line-1
{
.col-line-1
,
.el-form-item
{
width
:
100%
;
}
.col-line-2
{
...
...
src/api/base/base.js
View file @
2f07cf9c
import
fetch
from
'@/api/fetch'
;
// (获取基础数据【车牌,用车类型,报修区域,报修项目】)
export
const
getBaseData
=
entity
=>
fetch
({
url
:
'/baseData/getBaseData'
,
method
:
'get'
,
params
:
entity
,
});
// 为授权选择页面查询所有用户列表
export
const
getUserList
=
()
=>
fetch
({
url
:
'/baseData/getAppUser'
,
method
:
'get'
,
});
src/api/management/publicCar.js
View file @
2f07cf9c
...
...
@@ -2,14 +2,14 @@ import fetch from '@/api/fetch';
export
const
fetchApplyList
=
entity
=>
fetch
({
url
:
'/publicCar/teacherAppoCar4Page'
,
url
:
'/publicCar/
manager/
teacherAppoCar4Page'
,
method
:
'post'
,
data
:
entity
,
});
export
const
dealApply
=
entity
=>
fetch
({
url
:
'/publicCar/teacherAppoCar4Deal'
,
url
:
'/publicCar/
manager/
teacherAppoCar4Deal'
,
method
:
'post'
,
data
:
entity
,
});
src/api/system/wxAuth.js
0 → 100644
View file @
2f07cf9c
import
fetch
from
'@/api/fetch'
;
// 获取微信功能列表
export
const
fetchList
=
entity
=>
fetch
({
url
:
'/appFunction/appFunction4Page'
,
method
:
'post'
,
data
:
entity
,
});
// 获取菜单授权用户列表
export
const
fetchAuthUserList
=
entity
=>
fetch
({
url
:
'/appFunction/appFunction4AuthorList'
,
method
:
'post'
,
data
:
entity
,
});
// 更新授权用户
export
const
updateAuthList
=
entity
=>
fetch
({
url
:
'/appFunction/appFunction4Author'
,
method
:
'post'
,
data
:
entity
,
});
src/containers/management/user/user.vue
View file @
2f07cf9c
...
...
@@ -125,6 +125,7 @@ export default {
},
methods
:
{
...
mapActions
(
'management/user'
,
{
fetchList
:
'fetchUserList'
}),
...
mapActions
([
'fetchAllAuthUserList'
]),
initfilters
()
{
this
.
filters
=
{
name
:
''
,
...
...
@@ -239,6 +240,7 @@ export default {
addTeacher
(
entity
)
.
then
(
res
=>
{
this
.
fetchList
();
this
.
fetchAllAuthUserList
();
this
.
resetEditDialog
();
this
.
$message
.
success
(
res
.
msg
);
})
...
...
src/containers/system/account/account.vue
View file @
2f07cf9c
...
...
@@ -342,14 +342,13 @@ export default {
.system-account
{
.menuItem
{
padding
:
5px
24px
;
border-bottom
:
1px
solid
#
000
;
border-bottom
:
1px
solid
#
ccc
;
}
.menuName
{
margin
-bottom
:
5px
;
margin
:
20px
0
5px
;
font-size
:
18px
;
}
.subMenuList
{
height
:
40px
;
line-height
:
40px
;
}
}
...
...
src/containers/system/wxAuth/wxAuth.js
View file @
2f07cf9c
import
pagination
from
'../../../store/modules/pagination'
;
import
{
fetchList
}
from
'@/api/system/
account
'
;
import
{
fetchList
}
from
'@/api/system/
wxAuth
'
;
import
{
GET_AUTH_LIST
}
from
'./mutation-types'
;
const
state
=
{
...
...
src/containers/system/wxAuth/wxAuth.vue
View file @
2f07cf9c
...
...
@@ -10,17 +10,17 @@
<el-table
border
v-loading=
"loading"
:data=
"list"
style=
"width: 100%"
>
<el-table-column
type=
"index"
label=
"序号"
width=
"50"
>
</el-table-column>
<el-table-column
prop=
"name"
label=
"微信功能"
min-width=
"
12
0"
>
<el-table-column
prop=
"name"
label=
"微信功能"
min-width=
"
8
0"
>
</el-table-column>
<el-table-column
prop=
"
name"
label=
"功能编号"
min-width=
"12
0"
>
<el-table-column
prop=
"
code"
label=
"功能编号"
min-width=
"5
0"
>
</el-table-column>
<el-table-column
prop=
"
name"
:formatter=
"(c,r,val) => $formatDate(new Date(val),'yyyy-MM-dd')"
label=
"创建时间"
min-width=
"12
0"
>
<el-table-column
prop=
"
createDate"
:formatter=
"(c,r,val) => $formatDate(new Date(val),'yyyy-MM-dd')"
label=
"创建时间"
min-width=
"5
0"
>
</el-table-column>
<el-table-column
prop=
"
name"
label=
"用途"
min-width=
"12
0"
>
<el-table-column
prop=
"
purpose"
label=
"用途"
min-width=
"15
0"
>
</el-table-column>
<el-table-column
fixed=
"right"
label=
"操作"
min-width=
"
8
0"
align=
"center"
>
<el-table-column
fixed=
"right"
label=
"操作"
min-width=
"
5
0"
align=
"center"
>
<template
slot-scope=
"scope"
>
<el-button
v-if=
"scope.row.
auth
"
type=
"primary"
size=
"mini"
class=
"operationBtnWidth"
@
click=
"showUserAuth(scope)"
>
授权
</el-button>
<el-button
v-if=
"scope.row.
type == 2
"
type=
"primary"
size=
"mini"
class=
"operationBtnWidth"
@
click=
"showUserAuth(scope)"
>
授权
</el-button>
<span
v-else
>
所有用户开放
</span>
</
template
>
</el-table-column>
...
...
@@ -28,8 +28,14 @@
<el-pagination
layout=
"prev, pager, next"
:current-page=
"pagination.pageNum"
:page-size=
"pagination.pageSize"
:total=
"pagination.total"
@
current-change=
"changePage"
>
</el-pagination>
</div>
<drag-dialog
class=
"rateDialog"
:title=
"editType?'修改':'新增'"
:visible
.
sync=
"dialogEditVisible"
:before-close=
"resetEditDialog"
>
<drag-dialog
class=
"wxAuthDialog"
title=
"修改"
:visible
.
sync=
"dialogEditVisible"
:before-close=
"resetEditDialog"
width=
"70%"
>
<el-transfer
v-loading=
"loading"
v-model=
"selected.userId"
:props=
"{ key: 'userId', label: 'name'}"
:titles=
"['未被选中列', '已被选中列']"
:data=
"authUserList"
>
<div
slot-scope=
"{ option }"
>
<span
class=
"auth-name"
>
{{ option.name }}
</span>
<span
class=
"auth-department"
>
{{ option.department }}
</span>
<span
class=
"auth-cellphone"
>
{{ option.cellphone }}
</span>
</div>
</el-transfer>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"resetEditDialog"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"updateAuth"
>
确 定
</el-button>
...
...
@@ -39,9 +45,10 @@
</template>
<
script
>
import
listMixin
from
'
../../..
/mixin/listPage.js'
;
import
listMixin
from
'
@
/mixin/listPage.js'
;
import
store
from
'./store.js'
;
import
{
mapActions
,
mapGetters
}
from
'vuex'
;
import
{
fetchAuthUserList
,
updateAuthList
}
from
'@/api/system/wxAuth.js'
;
export
default
{
beforeRouteEnter
(
to
,
from
,
next
)
{
...
...
@@ -57,11 +64,78 @@ export default {
};
},
computed
:
{
...
mapGetters
([
'loading'
]),
...
mapGetters
([
'loading'
,
'authUserList'
]),
...
mapGetters
(
'system/wxAuth'
,
[
'list'
,
'pagination'
]),
allAuthList
()
{
return
this
.
authUserList
.
map
(
item
=>
({
key
:
item
.
userId
,
label
:
item
.
name
,
disabled
:
false
,
}));
},
},
created
()
{
this
.
fetchAllAuthUserList
();
},
methods
:
{
...
mapActions
([
'fetchAllAuthUserList'
]),
...
mapActions
(
'system/wxAuth'
,
[
'fetchList'
]),
initSelected
()
{
this
.
selected
=
{
id
:
''
,
userId
:
[],
};
},
showUserAuth
(
data
)
{
fetchAuthUserList
({
id
:
data
.
row
.
id
,
})
.
then
(
res
=>
{
let
list
=
res
.
data
.
map
(
item
=>
item
.
userId
);
this
.
selected
=
{
id
:
data
.
row
.
id
,
userId
:
list
,
};
this
.
dialogEditVisible
=
true
;
})
.
catch
(
err
=>
{
this
.
$message
.
error
(
err
.
msg
||
'查询失败!'
);
});
},
filterMethod
()
{},
updateAuth
()
{
const
entity
=
{
menuId
:
this
.
selected
.
id
,
userId
:
this
.
selected
.
userId
.
join
(
','
),
};
updateAuthList
(
entity
)
.
then
(
res
=>
{
this
.
$message
.
success
(
res
.
msg
);
this
.
resetEditDialog
();
})
.
catch
(
err
=>
{
this
.
$message
.
error
(
err
.
msg
||
'提交失败!'
);
});
},
},
};
</
script
>
<
style
lang=
"scss"
>
.wxAuthDialog
{
text-align
:
center
;
.el-transfer-panel
{
text-align
:
left
;
width
:
43%
;
}
.auth-name
,
.auth-department
,
.auth-cellphone
{
display
:
inline-block
;
width
:
100px
;
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
}
</
style
>
src/store/modules/app/base/base.js
View file @
2f07cf9c
...
...
@@ -3,14 +3,16 @@ import {
FETCH_CAR_CATEGORY
,
FETCH_REPAIR_AREA
,
FETCH_REPAIR_TERM
,
FETCH_ALL_AUTH_USER
,
}
from
'./mutation-types'
;
import
{
getBaseData
}
from
'@/api/base/base'
;
import
{
getBaseData
,
getUserList
}
from
'@/api/base/base'
;
const
state
=
()
=>
({
carPlate
:
[],
carCategory
:
[],
repairArea
:
[],
repairTerm
:
[],
authUserList
:
[],
});
const
getters
=
{
...
...
@@ -18,6 +20,7 @@ const getters = {
carCategoryOptions
:
state
=>
state
.
carCategory
,
repairAreaOptions
:
state
=>
state
.
repairArea
,
repairTermOptions
:
state
=>
state
.
repairTerm
,
authUserList
:
state
=>
state
.
authUserList
,
};
const
actions
=
{
...
...
@@ -49,6 +52,11 @@ const actions = {
commit
(
FETCH_REPAIR_TERM
,
res
.
data
);
});
},
fetchAllAuthUserList
({
commit
})
{
getUserList
().
then
(
res
=>
{
commit
(
FETCH_ALL_AUTH_USER
,
res
.
data
);
});
},
};
const
mutations
=
{
[
FETCH_CAR_PLATE
](
state
,
list
)
{
...
...
@@ -63,6 +71,9 @@ const mutations = {
[
FETCH_REPAIR_TERM
](
state
,
list
)
{
state
.
repairTerm
=
list
;
},
[
FETCH_ALL_AUTH_USER
](
state
,
list
)
{
state
.
authUserList
=
list
;
},
};
export
default
{
state
,
...
...
src/store/modules/app/base/mutation-types.js
View file @
2f07cf9c
...
...
@@ -2,3 +2,5 @@ export const FETCH_CAR_PLATE = 'FETCH_CAR_PLATE';
export
const
FETCH_CAR_CATEGORY
=
'FETCH_CAR_CATEGORY'
;
export
const
FETCH_REPAIR_AREA
=
'FETCH_REPAIR_AREA'
;
export
const
FETCH_REPAIR_TERM
=
'FETCH_REPAIR_TERM'
;
export
const
FETCH_ALL_AUTH_USER
=
'FETCH_ALL_AUTH_USER'
;
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