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 {
...
@@ -49,15 +49,26 @@ export default {
map
.
on
(
"click"
,
this
.
getAddress
);
map
.
on
(
"click"
,
this
.
getAddress
);
placeSearch
.
on
(
"markerClick"
,
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
)
{
getAddress
(
e
)
{
console
.
log
(
e
)
let
self
=
this
;
let
self
=
this
;
let
lnglat
;
let
lnglat
;
if
(
e
.
type
==
"click"
)
{
if
(
e
.
type
==
"click"
)
{
lnglat
=
e
.
lnglat
lnglat
=
e
.
lnglat
}
else
{
}
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
];
lnglat
=
[
lng
,
lat
];
}
}
self
.
addMarker
(
lnglat
)
AMap
.
plugin
(
"AMap.Geocoder"
,
()
=>
{
AMap
.
plugin
(
"AMap.Geocoder"
,
()
=>
{
const
geocoder
=
new
AMap
.
Geocoder
();
const
geocoder
=
new
AMap
.
Geocoder
();
geocoder
.
getAddress
(
lnglat
,
(
status
,
result
)
=>
{
geocoder
.
getAddress
(
lnglat
,
(
status
,
result
)
=>
{
...
...
src/views/employee/editEmployee.vue
View file @
63d9111
<!-- 编辑员工 -->
<
template
>
<
template
>
<div
class=
"config-employee"
>
<div
class=
"config-employee"
>
<div
class=
"container"
style=
"margin-top: 0;"
>
<div
class=
"container"
style=
"margin-top: 0;"
>
...
@@ -37,6 +36,12 @@ import selectPage from './components/selectPage'
...
@@ -37,6 +36,12 @@ import selectPage from './components/selectPage'
import
glsxCombiForm
from
'./glsx-combi-form'
import
glsxCombiForm
from
'./glsx-combi-form'
export
default
{
export
default
{
name
:
'editEmployee'
,
name
:
'editEmployee'
,
components
:
{
glsxCombiForm
,
selectPage
},
data
()
{
data
()
{
return
{
return
{
title
:
'新增员工'
,
title
:
'新增员工'
,
...
@@ -193,7 +198,7 @@ export default {
...
@@ -193,7 +198,7 @@ export default {
merchantTree
:
[],
merchantTree
:
[],
roleList
:
[]
roleList
:
[]
}
}
}
}
;
},
},
watch
:
{
watch
:
{
...
@@ -202,24 +207,6 @@ export default {
...
@@ -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
:
{
methods
:
{
handleImgDelete
(
targetItem
)
{
handleImgDelete
(
targetItem
)
{
this
.
$set
(
this
.
editForm
,
'merchantImg'
,
''
)
this
.
$set
(
this
.
editForm
,
'merchantImg'
,
''
)
...
@@ -318,7 +305,7 @@ export default {
...
@@ -318,7 +305,7 @@ export default {
this
.
editForm
.
password
=
''
this
.
editForm
.
password
=
''
},
},
handleJumpRole
()
{
handleJumpRole
()
{
this
.
$
router
.
push
(
'/role/create/'
+
0
)
this
.
$
history
.
push
(
'/role/create/'
+
0
)
},
},
handleRefresh
()
{
handleRefresh
()
{
this
.
editForm
.
merchantId
this
.
editForm
.
merchantId
...
@@ -365,9 +352,23 @@ export default {
...
@@ -365,9 +352,23 @@ export default {
path
:
'/employee/index'
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
>
<
style
>
.config-employee
{
.config-employee
{
margin-bottom
:
64px
;
margin-bottom
:
64px
;
...
@@ -441,4 +442,4 @@ export default {
...
@@ -441,4 +442,4 @@ export default {
.config-employee
.m-l-10
{
.config-employee
.m-l-10
{
margin-left
:
10px
;
margin-left
:
10px
;
}
}
</
style
>
</
style
>
\ No newline at end of file
\ No newline at end of file
src/views/role/components/selectProduct.vue
View file @
63d9111
<
template
>
<
template
>
<div
class=
"account-body scrm-box-f"
v-loading=
"loading"
v-if=
"tabMenu.length > 0"
>
<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-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-tab-pane
:label=
"item.accounttypeName"
:name=
"item.accounttypeId"
v-for=
"(item, index) in tabMenu"
:key=
"index"
></el-tab-pane>
</el-tabs>
</el-tabs>
...
@@ -118,15 +118,9 @@ export default {
...
@@ -118,15 +118,9 @@ export default {
return
this
.
tabMenu_r
return
this
.
tabMenu_r
},
},
// 获取当前的所有权限
// 获取当前的所有权限
async
accountTypeSearchRequest
(
params
,
status
)
{
async
accountTypeSearchRequest
(
params
,
arr
)
{
this
.
loading
=
true
let
account
=
''
let
account
=
''
if
(
status
)
{
let
tabMenu
=
await
this
.
$apis
.
store
.
findMenuFunTreeByMerId
(
params
)
account
=
'findMenuFunTreeByMerId'
}
else
{
account
=
'accountTypeSearchRequest'
}
let
tabMenu
=
await
this
.
$apis
.
store
[
account
](
params
)
this
.
accountList
=
tabMenu
.
map
(
item
=>
{
this
.
accountList
=
tabMenu
.
map
(
item
=>
{
return
{
return
{
productsArr
:
[],
productsArr
:
[],
...
@@ -149,29 +143,22 @@ export default {
...
@@ -149,29 +143,22 @@ export default {
})
})
this
.
tabMenu_s
=
util
.
deepClone
(
this
.
accountList
);
this
.
tabMenu_s
=
util
.
deepClone
(
this
.
accountList
);
// this.tabName = this.tabMenu[0].accounttypeId
// 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
return
this
.
accountList
},
},
// 获取已选择的权限
// 获取已选择的权限
findPermissionsByMerId
(
id
)
{
findPermissionsByMerId
(
arr
)
{
const
params
=
{
arr
.
forEach
(
item
=>
{
id
}
this
.
$apis
.
store
.
findPermissionsByMerId
(
params
).
then
(
res
=>
{
this
.
loading
=
false
this
.
tabMenu_x
=
util
.
deepClone
(
res
);
res
.
forEach
(
item
=>
{
console
.
log
(
item
)
this
.
accountList
.
forEach
(
itm
=>
{
this
.
accountList
.
forEach
(
itm
=>
{
console
.
log
(
itm
)
if
(
item
.
accounttypeId
==
itm
.
accounttypeId
)
{
if
(
item
.
accounttypeId
==
itm
.
accounttypeId
)
{
this
.
tabMenu
.
push
(
itm
)
this
.
tabMenu
.
push
(
itm
)
item
.
product
s
.
forEach
(
i
=>
{
item
.
product
List
.
forEach
(
i
=>
{
itm
.
products
.
forEach
(
j
=>
{
itm
.
products
.
forEach
(
j
=>
{
if
(
i
.
productId
==
j
.
productId
)
{
if
(
i
.
productId
==
j
.
productId
)
{
itm
.
productsArr
.
push
(
j
)
itm
.
productsArr
.
push
(
j
)
this
.
$nextTick
(()
=>
{
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 {
...
@@ -181,10 +168,6 @@ export default {
})
})
this
.
tabName
=
this
.
tabMenu
[
0
].
accounttypeId
this
.
tabName
=
this
.
tabMenu
[
0
].
accounttypeId
this
.
productTab
=
this
.
tabMenu
[
0
].
productsArr
[
0
].
productId
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
()
{
resetView
()
{
this
.
tabMenu
=
[];
this
.
tabMenu
=
[];
...
@@ -393,11 +376,26 @@ export default {
...
@@ -393,11 +376,26 @@ export default {
.account-body
{
.account-body
{
padding
:
20px
;
padding
:
20px
;
margin-bottom
:
50px
;
margin-bottom
:
50px
;
padding-top
:
20px
;
/deep/
{
/deep/
{
.
el-checkbox
:
last-of-type
{
.
el-checkbox
:
last-of-type
{
margin-right
:
8px
;
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
{
.account-title
{
font-size
:
20px
;
font-size
:
20px
;
...
@@ -415,6 +413,7 @@ export default {
...
@@ -415,6 +413,7 @@ export default {
line-height
:
20px
;
line-height
:
20px
;
display
:
flex
;
display
:
flex
;
flex-wrap
:
wrap
;
flex-wrap
:
wrap
;
margin-top
:
12px
;
label
{
label
{
margin-right
:
20px
;
margin-right
:
20px
;
}
}
...
@@ -427,6 +426,7 @@ export default {
...
@@ -427,6 +426,7 @@ export default {
margin-top
:
20px
;
margin-top
:
20px
;
}
}
.menu-box
{
.menu-box
{
position
:
relative
;
margin-top
:
10px
;
margin-top
:
10px
;
background
:
#f4f6fc
;
background
:
#f4f6fc
;
border-radius
:
4px
;
border-radius
:
4px
;
...
...
src/views/role/create.vue
View file @
63d9111
...
@@ -100,7 +100,7 @@ export default {
...
@@ -100,7 +100,7 @@ export default {
merchantId
:
res
.
merchantId
merchantId
:
res
.
merchantId
}
}
this
.
getMerchantTree
(
id
,
res
.
responseList
)
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