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 6fedc741
authored
Nov 04, 2021
by
ym
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
role
1 parent
76eeab67
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
100 additions
and
79 deletions
public/index.html
src/components/mapView/index.vue
src/main.js
src/views/account/components/baseInfo.vue
src/views/role/components/selectProduct.vue
src/views/role/create.vue
src/views/role/index.vue
vue.config.js
public/index.html
View file @
6fedc74
...
...
@@ -16,7 +16,6 @@
<
% for (var i in htmlWebpackPlugin.options.cdn
&&
htmlWebpackPlugin.options.cdn.js) { %>
<link
href=
"<%= htmlWebpackPlugin.options.cdn.js[i] %>"
rel=
"preload"
as=
"script"
/>
<
% } %>
<!-- <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.8&key=bd290dc27d0945959280753215ddda71&plugin=AMap.Geocoder"></script> -->
<title>
微前端子应用:博客
</title>
</head>
...
...
src/components/mapView/index.vue
View file @
6fedc74
...
...
@@ -11,6 +11,7 @@
</
template
>
<
script
>
import
AMap
from
"AMap"
;
let
map
,
placeSearch
;
export
default
{
name
:
"map"
,
...
...
@@ -35,7 +36,7 @@ export default {
resizeEnable
:
true
,
zoom
:
10
,
});
AMap
.
service
([
"AMap.PlaceSearch"
],
function
()
{
AMap
.
plugin
([
"AMap.PlaceSearch"
],
function
()
{
//构造地点查询类
placeSearch
=
new
AMap
.
PlaceSearch
({
citylimit
:
false
,
//是否强制限制在设置的城市内搜索
...
...
@@ -45,8 +46,8 @@ export default {
});
});
// 添加列表点选监听事件
AMap
.
event
.
addListener
(
map
,
"click"
,
this
.
getAddress
);
AMap
.
event
.
addListener
(
placeSearch
,
"selectChanged
"
,
this
.
getAddress
);
map
.
on
(
"click"
,
this
.
getAddress
);
placeSearch
.
on
(
"markerClick
"
,
this
.
getAddress
);
},
getAddress
(
e
)
{
let
self
=
this
;
...
...
@@ -54,8 +55,7 @@ export default {
if
(
e
.
type
==
"click"
)
{
lnglat
=
e
.
lnglat
}
else
{
console
.
log
(
e
.
selected
.
data
.
location
)
let
{
lng
,
lat
}
=
e
.
selected
.
data
.
location
;
let
{
lng
,
lat
}
=
e
.
data
.
entr_location
;
lnglat
=
[
lng
,
lat
];
}
AMap
.
plugin
(
"AMap.Geocoder"
,
()
=>
{
...
...
@@ -89,11 +89,6 @@ export default {
.map-box
{
position
:
relative
;
width
:
100%
;
/deep/
{
.el-dialog__body
{
padding
:
20px
10px
;
}
}
}
#container
{
position
:
absolute
;
...
...
src/main.js
View file @
6fedc74
...
...
@@ -12,16 +12,16 @@ import apis from './api'
import
'./public-path'
// import 'glsx-components/dist/glsx-components.css'
import
{
start
}
from
'@/setup'
import
VueAMap
from
"vue-amap"
;
//
import VueAMap from "vue-amap";
import
filters
from
'./utils/filters'
//新增过滤器
Vue
.
use
(
VueAMap
);
// 初始化vue-amap
VueAMap
.
initAMapApiLoader
({
key
:
"bd290dc27d0945959280753215ddda71"
,
// 这里写你申请的高德地图的key
plugin
:
[
"AMap.Autocomplete"
,
"AMap.Geocoder"
,
"AMap.Geolocation"
],
v
:
"1.4.15"
,
uiVersion
:
"1.1"
});
//
Vue.use(VueAMap);
//
//
初始化vue-amap
//
VueAMap.initAMapApiLoader({
//
key: "bd290dc27d0945959280753215ddda71", // 这里写你申请的高德地图的key
//
plugin: ["AMap.Autocomplete", "AMap.Geocoder", "AMap.Geolocation"],
//
v: "1.4.15",
//
uiVersion: "1.1"
//
});
Vue
.
config
.
productionTip
=
false
Vue
.
prototype
.
$apis
=
apis
start
()
...
...
src/views/account/components/baseInfo.vue
View file @
6fedc74
...
...
@@ -361,6 +361,11 @@ export default {
<
style
scoped
lang=
"scss"
>
.base-info
{
/deep/
{
.el-dialog__body
{
padding
:
20px
10px
;
}
}
.account-body-form
{
width
:
80%
;
margin
:
20px
auto
;
...
...
src/views/role/components/selectProduct.vue
View file @
6fedc74
<
template
>
<div
class=
"account-body scrm-box-f"
v-loading=
"loading"
>
<div
class=
"account-body scrm-box-f"
v-loading=
"loading"
v-if=
"tabMenu.length > 0"
>
<!--
<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>
...
...
@@ -52,6 +52,7 @@ export default {
loading
:
false
,
treeHeight
:
450
,
tabMenu
:
[],
tabMenu_r
:
[],
tabMenu_x
:
[],
tabMenu_s
:
[],
accountList
:
[],
...
...
@@ -87,10 +88,14 @@ export default {
productClick
(
productId
)
{
this
.
productTab
=
productId
},
findMenuFunTree
(
arr
)
{
let
tabMenu
=
util
.
deepClone
(
this
.
tabMenu_r
)
this
.
tabMenu
=
tabMenu
.
filter
(
item
=>
arr
.
includes
(
item
.
accounttypeId
))
},
// 获取当前的所有权限
async
findMenuFunTreeByMerId
(
params
,
arr
)
{
async
findMenuFunTreeByMerId
(
params
)
{
let
tabMenu
=
await
this
.
$apis
.
store
.
findMenuFunTreeByMerId
(
params
)
t
his
.
t
abMenu
=
tabMenu
tabMenu
=
tabMenu
.
map
(
item
=>
{
return
{
productsArr
:
[],
...
...
@@ -99,19 +104,18 @@ export default {
accounttypeId
:
item
.
accounttypeId
}
})
.
filter
(
i
=>
arr
.
includes
(
i
.
accounttypeId
)
)
this
.
tabMenu_r
=
util
.
deepClone
(
tabMenu
)
this
.
$nextTick
(()
=>
{
this
.
addStyle
()
})
console
.
log
(
this
.
tabMenu
)
this
.
accountTypes
=
tabMenu
.
map
(
item
=>
{
return
{
products
:
null
,
accounttypeId
:
item
.
accounttypeId
}
})
this
.
tabName
=
this
.
tabMenu
[
0
].
accounttypeId
return
this
.
tabMenu
this
.
tabName
=
this
.
tabMenu
_r
[
0
].
accounttypeId
return
this
.
tabMenu
_r
},
// 获取当前的所有权限
async
accountTypeSearchRequest
(
params
,
status
)
{
...
...
src/views/role/create.vue
View file @
6fedc74
<
template
>
<div
class=
"role-create-page"
>
<div
class=
"role-panel"
>
<div
class=
"role-create-page scrm-box-f"
>
<div
class=
"top_title_widget"
>
<span
class=
"title"
>
{{
pageName
}}
</span>
</div>
...
...
@@ -14,10 +15,10 @@
<el-input
size=
"small"
disabled
style=
"width: 40%"
v-model=
"ruleForm.merchantName"
></el-input>
</el-form-item>
<el-form-item
label=
"角色名称"
prop=
"roleName"
>
<el-input
size=
"small"
style=
"width: 40%"
v-model=
"ruleForm.roleName"
></el-input>
<el-input
size=
"small"
style=
"width: 40%"
v-model=
"ruleForm.roleName"
placeholder=
"请输入角色名称"
></el-input>
</el-form-item>
<el-form-item
label=
"角色说明"
prop=
"roleDesc"
>
<el-input
size=
"small"
style=
"width: 40%"
v-model=
"ruleForm.roleDesc"
></el-input>
<el-input
size=
"small"
style=
"width: 40%"
v-model=
"ruleForm.roleDesc"
placeholder=
"请输入角色说明"
></el-input>
</el-form-item>
<el-form-item
label=
"角色权限"
prop=
"roleRoot"
>
<div
class=
"custom_element"
>
...
...
@@ -29,8 +30,10 @@
</div>
</el-form-item>
</el-form>
<
SelectProduct
ref=
"productFrom"
:roleType=
"true"
title=
""
></SelectProduct
>
<
/div
>
</div>
<div
class=
"scrm-box-f"
style=
"margin-top: 10px"
>
<SelectProduct
ref=
"productFrom"
:roleType=
"true"
title=
"角色权限"
></SelectProduct>
<div
style=
"height: 84px"
></div>
<div
class=
"fixed_bottom"
...
...
@@ -46,17 +49,20 @@
<el-button
type=
"primary"
@
click=
"toBack"
>
取消
</el-button>
</div>
</div>
</div>
</template>
<
script
>
import
AutoButton
from
'../../components/auto-button/index.vue'
import
SelectProduct
from
'.
./account
/components/selectProduct.vue'
import
SelectProduct
from
'./components/selectProduct.vue'
export
default
{
name
:
''
,
components
:
{
AutoButton
,
SelectProduct
},
data
()
{
return
{
ruleForm
:
{
...
...
@@ -66,8 +72,7 @@ export default {
},
rules
:
{
roleName
:
[{
required
:
true
,
message
:
'请输入角色名称'
,
trigger
:
'blur'
}],
merchantId
:
[{
required
:
true
,
message
:
'请选择所属商户'
,
trigger
:
'change'
}],
roleRoot
:
[{
required
:
true
,
message
:
'请选择角色权限'
,
trigger
:
'change'
}]
merchantId
:
[{
required
:
true
,
message
:
'请选择所属商户'
,
trigger
:
'change'
}]
},
rootList
:
[],
curRootIndex
:
0
,
...
...
@@ -82,25 +87,7 @@ export default {
accountLevel
:
1
}
},
created
()
{
let
id
=
Number
(
this
.
$route
.
params
.
id
)
if
(
!
id
)
{
this
.
pageName
=
'新增角色'
this
.
pageType
=
'create'
this
.
getMerchantName
()
}
else
{
this
.
pageName
=
'修改角色'
this
.
pageType
=
'edit'
this
.
getRoleData
(
id
)
this
.
editId
=
id
}
const
{
session
}
=
this
.
$globalState
this
.
accountLevel
=
session
.
accountLevel
},
mounted
()
{
this
.
footerLeft
=
document
.
querySelector
(
'.base-container-right'
).
offsetLeft
this
.
footerWidth
=
document
.
documentElement
.
clientWidth
-
this
.
footerLeft
},
methods
:
{
// 获取角色信息
getRoleData
(
id
)
{
...
...
@@ -149,9 +136,9 @@ export default {
},
// 选择商户----获取权限
async
selectMerchant
(
id
)
{
let
res
=
await
this
.
$refs
.
productFrom
.
accountTypeSearchRequest
({
id
},
'create'
)
let
res
=
await
this
.
$refs
.
productFrom
.
findMenuFunTreeByMerId
({
id
}
)
this
.
accountList
=
res
.
map
(
item
=>
{
item
.
select
=
tru
e
item
.
select
=
fals
e
return
item
})
},
...
...
@@ -167,6 +154,11 @@ export default {
})
this
.
rootList
=
arr
}
let
accounttypeId
=
[];
this
.
rootList
.
forEach
(
item
=>
{
accounttypeId
.
push
(
item
.
accounttypeId
)
})
this
.
$refs
.
productFrom
.
findMenuFunTree
(
accounttypeId
)
},
// 确定按钮---处理参数---提交数据---创建为0---草稿为1
...
...
@@ -233,9 +225,31 @@ export default {
toBack
()
{
this
.
$router
.
push
(
'/role/index'
)
}
},
created
()
{
let
id
=
Number
(
this
.
$route
.
params
.
id
)
if
(
!
id
)
{
this
.
pageName
=
'新增角色'
this
.
pageType
=
'create'
this
.
getMerchantName
()
}
else
{
this
.
pageName
=
'修改角色'
this
.
pageType
=
'edit'
this
.
getRoleData
(
id
)
this
.
editId
=
id
}
const
{
session
}
=
this
.
$globalState
this
.
accountLevel
=
session
.
accountLevel
},
mounted
()
{
this
.
footerLeft
=
document
.
querySelector
(
'.base-container-right'
).
offsetLeft
this
.
footerWidth
=
document
.
documentElement
.
clientWidth
-
this
.
footerLeft
}
}
</
script
>
};
</
script
>
<
style
lang=
"scss"
scoped
>
.role-create-page
{
height
:
100%
;
...
...
@@ -284,4 +298,4 @@ export default {
margin-right
:
15px
;
}
}
</
style
>
</
style
>
\ No newline at end of file
src/views/role/index.vue
View file @
6fedc74
...
...
@@ -39,6 +39,7 @@
<
script
>
export
default
{
name
:
''
,
data
()
{
return
{
searchForm
:
{
...
...
@@ -82,11 +83,13 @@ export default {
},
{
label
:
'创建时间'
,
prop
:
'createdTime'
prop
:
'createdTime'
,
width
:
'160px'
},
{
label
:
'更新时间'
,
prop
:
'updatedTime'
,
width
:
'160px'
,
formatter
:
val
=>
{
if
(
!
val
.
updatedTime
)
{
return
'--'
...
...
@@ -104,18 +107,7 @@ export default {
list
:
[]
}
},
created
()
{
const
{
session
}
=
this
.
$globalState
let
accountLevel
=
session
.
accountLevel
if
(
accountLevel
!=
4
)
{
this
.
tableParams
.
tableColumns
.
splice
(
2
,
0
,
{
label
:
'所属商户名'
,
prop
:
'merchantName'
})
this
.
getMerchantName
()
}
this
.
accountLevel
=
accountLevel
},
mounted
()
{
this
.
getTableData
()
},
methods
:
{
// 获取表格数据
getTableData
()
{
...
...
@@ -197,15 +189,26 @@ export default {
})
})
.
catch
(()
=>
{
this
.
$message
({
type
:
'info'
,
message
:
'已取消删除'
})
})
}
},
created
()
{
const
{
session
}
=
this
.
$globalState
let
accountLevel
=
session
.
accountLevel
if
(
accountLevel
!=
4
)
{
this
.
tableParams
.
tableColumns
.
splice
(
2
,
0
,
{
label
:
'所属商户名'
,
prop
:
'merchantName'
})
this
.
getMerchantName
()
}
this
.
accountLevel
=
accountLevel
},
mounted
()
{
this
.
getTableData
()
}
}
</
script
>
};
</
script
>
<
style
lang=
"scss"
scoped
>
.role-home-page
{
box-sizing
:
border-box
;
...
...
@@ -249,4 +252,4 @@ export default {
}
}
}
</
style
>
</
style
>
\ No newline at end of file
vue.config.js
View file @
6fedc74
...
...
@@ -13,7 +13,8 @@ const cdn = {
`
${
CDN_DOMAIN
}
ajax/libs/vue-router/3.2.0/vue-router.min.js`
,
`
${
CDN_DOMAIN
}
ajax/libs/element-ui/2.11.1/index.js`
,
`
${
CDN_DOMAIN
}
ajax/libs/vuex/3.6.2/vuex.min.js`
,
`
${
CDN_DOMAIN
}
ajax/libs/echarts/5.1.2/echarts.min.js`
`
${
CDN_DOMAIN
}
ajax/libs/echarts/5.1.2/echarts.min.js`
,
'https://webapi.amap.com/maps?v=2.0&key=bd290dc27d0945959280753215ddda71&plugin=AMap.Geocoder'
]
}
module
.
exports
=
{
...
...
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