Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz-Vue-Mob-R7-Res
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7前端标准模板
iBiz-Vue-Mob-R7-Res
提交
af025c90
提交
af025c90
编写于
9月 24, 2020
作者:
zhujiamin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增侧滑菜单插件
上级
5703aee6
变更
4
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
371 行增加
和
0 行删除
+371
-0
app-register.ts
src/app-register.ts
+2
-0
app-mob-menu-sideslip-view.less
...pp-mob-menu-sideslip-view/app-mob-menu-sideslip-view.less
+66
-0
app-mob-menu-sideslip-view.vue
...app-mob-menu-sideslip-view/app-mob-menu-sideslip-view.vue
+297
-0
theme.less
src/styles/theme/theme.less
+6
-0
未找到文件。
src/app-register.ts
浏览文件 @
af025c90
...
...
@@ -126,5 +126,7 @@ export const AppComponents = {
v
.
component
(
'app-mob-select-changeTheme'
,()
=>
import
(
'@/ibiz-core/components/app-mob-select-changeTheme/app-mob-select-changeTheme.vue'
));
// 锚点列表插件
v
.
component
(
'app-anchor-list'
,()
=>
import
(
'@/components/app-anchor-list/app-anchor-list.vue'
));
// 新菜单组件
v
.
component
(
'app-mob-menu-sideslip-view'
,()
=>
import
(
'@/components/app-mob-menu-sideslip-view/app-mob-menu-sideslip-view.vue'
));
},
};
\ No newline at end of file
src/components/app-mob-menu-sideslip-view/app-mob-menu-sideslip-view.less
0 → 100644
浏览文件 @
af025c90
// this is lesss
.srf_empty_class {
width: 100%;
height: 100%;
}
.app-mob-menu-sideslip-view{
ion-button{
position: absolute;
top: 5px;
left: 0;
}
}
.app-menu-plugin{
.header{
padding: 15px;
img{
margin-top: 20px;
width: 30%;
margin-bottom: 20px;
}
.title{
color: #fff;
font-size: 20px;
margin-bottom: 10px;
}
.text{
display: inline-block;
padding: 3px 6px;
background-color: #fff;
color: #333;
font-size: 12px;
margin-bottom: 20px;
}
.notice{
ion-icon{
font-size: 12px;
}
color: rgb(255, 248, 248);
font-size: 10px;
}
}
.top{
.title{
color:#727272;
font-size: 18px;
}
padding: 15px 15px 0 15px;
border-bottom:1px solid #E8E8E8;
.list{
ion-icon{
font-size: 25px;
margin-right: 35px;
}
display: flex;
align-items: center;
font-size: 16px;
margin: 25px 0;
color: #333;
&:active{
background-color: #DBDBDB;
}
}
}
}
\ No newline at end of file
src/components/app-mob-menu-sideslip-view/app-mob-menu-sideslip-view.vue
0 → 100644
浏览文件 @
af025c90
<
template
>
<ion-tabs
ref=
"ionNav"
class=
"app-mob-menu-sideslip-view"
@
ionTabsDidChange=
"selectItem($event)"
>
<ion-button
@
click=
"openMenu"
size=
"small"
v-show=
"isShowSideSlipMenu"
style=
"z-index:999;"
>
<ion-icon
name=
"menu-outline"
></ion-icon>
</ion-button>
<van-popup
v-model=
"showPopup"
get-container=
"#app"
position=
"left"
:style=
"
{ height: '100%',width: '80%' }">
<div
class=
"app-menu-plugin"
>
<div
class=
"header"
>
<img
src=
"assets/images/logo.png"
class=
"ibizLogo"
/>
<div
class=
"title"
>
iBizPMS
</div>
<div
class=
"text"
>
登录·试用测试版
</div>
<div
class=
"notice"
><ion-icon
name=
"megaphone-outline"
></ion-icon>
#最新通知——更新/下载
</div>
</div>
<div
class=
"top"
>
<div
class=
"title"
>
Menu
</div>
<div
class=
"list"
v-for=
"item in items"
:key=
"item.index"
@
click=
"active(item)"
>
<ion-icon
:name=
" item.iconcls ? item.iconcls : 'home' "
></ion-icon>
<div
class=
"text"
>
<ion-label
v-if=
"item.appfunctag != 'settings'"
>
{{
$t
(
`app.menus.${menuName
}
.${item.name
}
`
)
}}
<
/ion-label
>
<
ion
-
label
v
-
else
>
{{
item
.
text
}}
<
/ion-label
>
<
ion
-
badge
color
=
"danger"
v
-
if
=
"counterServide && counterServide.counterData && counterServide.counterData[item.counterid]"
><
ion
-
label
>
{{
counterServide
.
counterData
[
item
.
counterid
]
}}
<
/ion-label></i
on
-
badge
>
<
/div
>
<
/div
>
<
/div
>
<
/div>
<
/van-popup
>
<
template
v
-
for
=
"item in items"
>
<
template
v
-
if
=
"!item.hidden"
>
<
component
:
key
=
"item.id"
v
-
if
=
"item.id == activeId"
:
is
=
"item.componentname"
viewDefaultUsage
=
"indexView"
><
/component
>
<
/template
>
<
/template
>
<
/ion-tabs
>
<
/template
>
<
script
lang
=
"ts"
>
import
{
Vue
,
Component
,
Prop
,
Emit
,
Model
}
from
'vue-property-decorator'
;
import
{
Environment
}
from
'@/environments/environment'
;
@
Component
({
components
:
{
}
}
)
export
default
class
AppMobMenuSideslipView
extends
Vue
{
/**
* 是否能显示侧滑菜单
*
* @type {*
}
* @memberof AppMobMenuSideslipView
*/
public
isShowSideSlipMenu
:
boolean
=
true
;
/**
* 是否显示侧滑菜单
*
* @type {*
}
* @memberof AppMobMenuSideslipView
*/
public
showPopup
:
boolean
=
false
;
/**
* 打开弹出层
*
* @type {*
}
* @memberof AppMobMenuSideslipView
*/
public
openMenu
(){
this
.
showPopup
=
true
;
}
/**
* 使用默认菜单
*
* @type {*
}
* @memberof AppMobMenuSideslipView
*/
public
useDefaultMenu
:
boolean
=
Environment
.
useDefaultMenu
;
/**
* 双向值绑定
*
* @type {*
}
* @memberof AppMobMenuSideslipView
*/
@
Model
(
"change"
)
readonly
itemValue
?:
any
;
/**
* 获取值
*
* @type {*
}
* @memberof AppMobMenuSideslipView
*/
get
defaultActive
():
any
{
this
.
items
.
some
((
item
:
any
)
=>
{
if
(
Object
.
is
(
item
.
name
,
this
.
itemValue
))
{
item
.
select
=
true
;
return
true
;
}
return
false
;
}
);
return
this
.
itemValue
;
}
/**
* 设置值
*
* @memberof AppMobMenuSideslipView
*/
set
defaultActive
(
val
)
{
this
.
$emit
(
"change"
,
val
);
}
/**
* 菜单名称
*
* @type {string
}
* @memberof AppMobMenuSideslipView
*/
@
Prop
()
public
menuName
!
:
string
;
/**
* 菜单数据项
*
* @type {Array<any>
}
* @memberof AppMobMenuSideslipView
*/
@
Prop
()
public
items
!
:
Array
<
any
>
;
/**
* 菜单模型
*
* @type {Array<any>
}
* @memberof AppMobMenuSideslipView
*/
@
Prop
()
public
menuModels
!
:
Array
<
any
>
;
/**
* 计数器名称
*
* @type {string
}
* @memberof AppMobMenuSideslipView
*/
@
Prop
()
public
counterName
!
:
string
;
/**
* 激活id
*
* @type {string
}
* @memberof AppMobMenuSideslipView
*/
public
activeId
=
""
;
public
defaultMenu
=
{
appfunctag
:
"settings"
,
componentname
:
"app-setting"
,
expanded
:
false
,
hidden
:
false
,
hidesidebar
:
false
,
icon
:
""
,
iconcls
:
"settings"
,
id
:
"setting"
,
name
:
"setting"
,
opendefault
:
false
,
resourcetag
:
""
,
separator
:
false
,
text
:
"设置"
,
textcls
:
""
,
tooltip
:
"设置"
,
type
:
"MENUITEM"
,
}
;
/**
* 生命周期
*
* @memberof AppMobMenuSideslipView
*/
public
created
()
{
if
(
this
.
useDefaultMenu
){
this
.
items
.
push
(
this
.
defaultMenu
);
}
let
count
=
0
;
this
.
items
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
if
(
item
.
hidden
==
false
){
count
++
;
}
if
(
count
==
1
){
this
.
activeId
=
item
.
id
;
}
let
model
=
this
.
menuModels
.
find
((
model
:
any
)
=>
Object
.
is
(
model
.
appfunctag
,
item
.
appfunctag
));
if
(
model
)
{
item
.
componentname
=
model
.
componentname
;
}
}
);
this
.
loadCounterData
();
}
/**
* 生命周期
*
* @memberof AppMobMenuSideslipView
*/
public
mounted
()
{
let
ionNav
:
any
=
this
.
$refs
.
ionNav
;
let
currPage
=
sessionStorage
.
getItem
(
"currId"
);
if
(
currPage
){
this
.
items
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
if
(
item
.
id
==
currPage
){
this
.
activeId
=
item
.
id
ionNav
.
select
(
item
.
name
);
}
}
)
}
}
/**
* 点击菜单事件
*
* @memberof AppMobMenuSideslipView
*/
public
active
(
val
:
any
)
{
const
index
:
number
=
this
.
items
.
findIndex
((
item
:
any
)
=>
Object
.
is
(
item
.
id
,
val
.
id
));
this
.
activeId
=
this
.
items
[
index
].
id
;
sessionStorage
.
setItem
(
"currId"
,
this
.
items
[
index
].
id
)
}
/**
* 计数器数据
*
* @type {*
}
* @memberof AppMobMenuSideslipView
*/
public
counterdata
:
any
=
{
}
;
/**
* vue 生命周期
*
* @memberof AppMobMenuSideslipView
*/
public
destroyed
()
{
this
.
counterServide
.
destroyCounter
();
}
/**
* 计数器
*
* @memberof AppMobMenuSideslipView
*/
public
counterServide
:
any
=
null
;
/**
* 加载计数器数据
*
* @returns {Promise<any>
}
* @memberof AppMobMenuSideslipView
*/
public
async
loadCounterData
():
Promise
<
any
>
{
const
counterServiceConstructor
=
window
.
counterServiceConstructor
;
this
.
counterServide
=
await
counterServiceConstructor
.
getService
(
this
.
counterName
);
}
/**
* 菜单选中事件
*
* @param {*
}
val
* @returns
* @memberof AppMobMenuSideslipView
*/
@
Emit
()
select
(
val
:
any
)
{
return
val
;
}
/**
* 选中菜单项
*
* @param {*
}
$event
* @returns {void
}
* @memberof AppMobMenuSideslipView
*/
public
selectItem
(
$event
:
any
):
void
{
if
(
!
$event
)
{
return
;
}
let
{
detail
}
=
$event
;
if
(
!
detail
)
{
return
;
}
let
{
tab
}
=
detail
;
if
(
!
tab
)
{
return
;
}
}
}
<
/script
>
<
style
lang
=
"less"
>
@
import
"./app-mob-menu-sideslip-view.less"
;
<
/style>
\ No newline at end of file
src/styles/theme/theme.less
浏览文件 @
af025c90
...
...
@@ -164,4 +164,10 @@
}
}
}
// 侧滑菜单插件
.app-menu-plugin{
.header{
background-color: @theme-color;
}
}
}
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录