Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
杨明
/
scrm-micro-config
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 63d9111f
authored
Nov 04, 2021
by
ym
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
role
1 parent
6fedc741
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
53 deletions
src/components/mapView/index.vue
src/views/employee/editEmployee.vue
src/views/role/components/selectProduct.vue
src/views/role/create.vue
src/components/mapView/index.vue
View file @
63d9111
...
...
@@ -49,15 +49,26 @@ export default {
map
.
on
(
"click"
,
this
.
getAddress
);
placeSearch
.
on
(
"markerClick"
,
this
.
getAddress
);
},
// addMarker(lnglat) {
// let position = [lnglat.lng,lnglat.lat]
// const marker = new AMap.Marker({
// icon: "//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png",
// position,
// offset: new AMap.Pixel(-13, -30)
// });
// marker.setMap(map);
// },
getAddress
(
e
)
{
console
.
log
(
e
)
let
self
=
this
;
let
lnglat
;
if
(
e
.
type
==
"click"
)
{
lnglat
=
e
.
lnglat
}
else
{
let
{
lng
,
lat
}
=
e
.
data
.
entr_location
;
let
{
lng
,
lat
}
=
e
.
data
.
entr_location
?
e
.
data
.
entr_location
:
e
.
data
.
location
;
lnglat
=
[
lng
,
lat
];
}
self
.
addMarker
(
lnglat
)
AMap
.
plugin
(
"AMap.Geocoder"
,
()
=>
{
const
geocoder
=
new
AMap
.
Geocoder
();
geocoder
.
getAddress
(
lnglat
,
(
status
,
result
)
=>
{
...
...
src/views/employee/editEmployee.vue
View file @
63d9111
<!-- 编辑员工 -->
<
template
>
<div
class=
"config-employee"
>
<div
class=
"container"
style=
"margin-top: 0;"
>
...
...
@@ -37,6 +36,12 @@ import selectPage from './components/selectPage'
import
glsxCombiForm
from
'./glsx-combi-form'
export
default
{
name
:
'editEmployee'
,
components
:
{
glsxCombiForm
,
selectPage
},
data
()
{
return
{
title
:
'新增员工'
,
...
...
@@ -193,7 +198,7 @@ export default {
merchantTree
:
[],
roleList
:
[]
}
}
}
;
},
watch
:
{
...
...
@@ -202,24 +207,6 @@ export default {
}
},
components
:
{
glsxCombiForm
,
selectPage
},
created
()
{
this
.
userInfo
=
this
.
$globalState
.
session
},
mounted
()
{
this
.
footerLeft
=
document
.
querySelector
(
'.base-container-right'
).
offsetLeft
this
.
footerWidth
=
document
.
documentElement
.
clientWidth
-
this
.
footerLeft
this
.
routeInfo
=
this
.
$route
.
params
this
.
title
=
this
.
titleObj
[
this
.
routeInfo
.
addOrEdit
]
this
.
getAllMerchantList
()
this
.
routeInfo
.
addOrEdit
!=
1
?
this
.
getInfo
()
:
''
},
methods
:
{
handleImgDelete
(
targetItem
)
{
this
.
$set
(
this
.
editForm
,
'merchantImg'
,
''
)
...
...
@@ -318,7 +305,7 @@ export default {
this
.
editForm
.
password
=
''
},
handleJumpRole
()
{
this
.
$
router
.
push
(
'/role/create/'
+
0
)
this
.
$
history
.
push
(
'/role/create/'
+
0
)
},
handleRefresh
()
{
this
.
editForm
.
merchantId
...
...
@@ -365,9 +352,23 @@ export default {
path
:
'/employee/index'
})
}
},
created
()
{
this
.
userInfo
=
this
.
$globalState
.
session
},
mounted
()
{
this
.
footerLeft
=
document
.
querySelector
(
'.base-container-right'
).
offsetLeft
this
.
footerWidth
=
document
.
documentElement
.
clientWidth
-
this
.
footerLeft
this
.
routeInfo
=
this
.
$route
.
params
this
.
title
=
this
.
titleObj
[
this
.
routeInfo
.
addOrEdit
]
this
.
getAllMerchantList
()
this
.
routeInfo
.
addOrEdit
!=
1
?
this
.
getInfo
()
:
''
}
}
</
script
>
};
</
script
>
<
style
>
.config-employee
{
margin-bottom
:
64px
;
...
...
@@ -441,4 +442,4 @@ export default {
.config-employee
.m-l-10
{
margin-left
:
10px
;
}
</
style
>
</
style
>
\ No newline at end of file
src/views/role/components/selectProduct.vue
View file @
63d9111
<
template
>
<div
class=
"account-body scrm-box-f"
v-loading=
"loading"
v-if=
"tabMenu.length > 0"
>
<
!--
<div
class=
"account-title"
>
{{
title
}}
</div>
--
>
<
div
class=
"account-title"
>
{{
title
}}
</div
>
<el-tabs
v-if=
"tabMenu.length != 0"
v-model=
"tabName"
type=
"card"
@
tab-click=
"handleClik"
>
<el-tab-pane
:label=
"item.accounttypeName"
:name=
"item.accounttypeId"
v-for=
"(item, index) in tabMenu"
:key=
"index"
></el-tab-pane>
</el-tabs>
...
...
@@ -118,15 +118,9 @@ export default {
return
this
.
tabMenu_r
},
// 获取当前的所有权限
async
accountTypeSearchRequest
(
params
,
status
)
{
this
.
loading
=
true
async
accountTypeSearchRequest
(
params
,
arr
)
{
let
account
=
''
if
(
status
)
{
account
=
'findMenuFunTreeByMerId'
}
else
{
account
=
'accountTypeSearchRequest'
}
let
tabMenu
=
await
this
.
$apis
.
store
[
account
](
params
)
let
tabMenu
=
await
this
.
$apis
.
store
.
findMenuFunTreeByMerId
(
params
)
this
.
accountList
=
tabMenu
.
map
(
item
=>
{
return
{
productsArr
:
[],
...
...
@@ -149,29 +143,22 @@ export default {
})
this
.
tabMenu_s
=
util
.
deepClone
(
this
.
accountList
);
// this.tabName = this.tabMenu[0].accounttypeId
this
.
findPermissionsByMerId
(
params
.
merchantId
?
params
.
merchantId
:
params
.
id
)
this
.
findPermissionsByMerId
(
arr
)
this
.
tabMenu_r
=
util
.
deepClone
(
this
.
accountList
)
return
this
.
accountList
},
// 获取已选择的权限
findPermissionsByMerId
(
id
)
{
const
params
=
{
id
}
this
.
$apis
.
store
.
findPermissionsByMerId
(
params
).
then
(
res
=>
{
this
.
loading
=
false
this
.
tabMenu_x
=
util
.
deepClone
(
res
);
res
.
forEach
(
item
=>
{
console
.
log
(
item
)
findPermissionsByMerId
(
arr
)
{
arr
.
forEach
(
item
=>
{
this
.
accountList
.
forEach
(
itm
=>
{
console
.
log
(
itm
)
if
(
item
.
accounttypeId
==
itm
.
accounttypeId
)
{
this
.
tabMenu
.
push
(
itm
)
item
.
product
s
.
forEach
(
i
=>
{
item
.
product
List
.
forEach
(
i
=>
{
itm
.
products
.
forEach
(
j
=>
{
if
(
i
.
productId
==
j
.
productId
)
{
itm
.
productsArr
.
push
(
j
)
this
.
$nextTick
(()
=>
{
this
.
$refs
[
`tree_
${
itm
.
accounttypeId
}
_
${
j
.
productId
}
`
][
0
].
setCheckedKeys
(
i
.
menuIds
)
this
.
$refs
[
`tree_
${
itm
.
accounttypeId
}
_
${
j
.
productId
}
`
][
0
].
setCheckedKeys
(
i
.
idList
)
})
}
})
...
...
@@ -181,10 +168,6 @@ export default {
})
this
.
tabName
=
this
.
tabMenu
[
0
].
accounttypeId
this
.
productTab
=
this
.
tabMenu
[
0
].
productsArr
[
0
].
productId
// const arr = res.map(i => i.accounttypeId)
// this.tabMenu.map(i => arr.includes(i.accounttypeId))
// console.log(this.tabMenu, arr)
})
},
resetView
()
{
this
.
tabMenu
=
[];
...
...
@@ -393,11 +376,26 @@ export default {
.account-body
{
padding
:
20px
;
margin-bottom
:
50px
;
padding-top
:
20px
;
/deep/
{
.
el-checkbox
:
last-of-type
{
margin-right
:
8px
;
}
.el-tabs--card
>
.el-tabs__header
.el-tabs__nav
{
border
:
0
;
}
.el-tabs--card
>
.el-tabs__header
{
border
:
0
;
background-color
:
#f4f6fc
;
}
.el-tabs--card
>
.el-tabs__header
.el-tabs__item
{
border
:
none
;
width
:
180px
;
margin
:
2px
;
text-align
:
center
;
}
.el-tabs__item.is-active
{
background-color
:
#fff
;
}
}
.account-title
{
font-size
:
20px
;
...
...
@@ -415,6 +413,7 @@ export default {
line-height
:
20px
;
display
:
flex
;
flex-wrap
:
wrap
;
margin-top
:
12px
;
label
{
margin-right
:
20px
;
}
...
...
@@ -427,6 +426,7 @@ export default {
margin-top
:
20px
;
}
.menu-box
{
position
:
relative
;
margin-top
:
10px
;
background
:
#f4f6fc
;
border-radius
:
4px
;
...
...
src/views/role/create.vue
View file @
63d9111
...
...
@@ -100,7 +100,7 @@ export default {
merchantId
:
res
.
merchantId
}
this
.
getMerchantTree
(
id
,
res
.
responseList
)
this
.
$refs
.
productFrom
.
accountTypeSearchRequest
({
id
:
res
.
merchantId
},
'edit'
)
this
.
$refs
.
productFrom
.
accountTypeSearchRequest
({
id
:
res
.
merchantId
},
this
.
roleInfo
.
responseList
)
})
},
// 获取商户树
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment