Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
E
ec-report-refactor
Project
Project
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
lihuizhen
ec-report-refactor
Commits
d8bfcee2
Commit
d8bfcee2
authored
Jul 17, 2023
by
leon
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: fullscreen page remove tabs
parent
baaa07e4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
148 deletions
+7
-148
details.vue
pages/details/details.vue
+1
-27
fullscreen.vue
pages/fullscreen/fullscreen.vue
+5
-93
index.vue
pages/index/index.vue
+1
-28
No files found.
pages/details/details.vue
View file @
d8bfcee2
...
...
@@ -239,37 +239,11 @@
}
})
}
that
.
reportInfo
=
this
.
handleTabsLink
(
res
.
data
.
Result
)
that
.
reportInfo
=
res
.
data
.
Result
uni
.
setStorageSync
(
'reportInfo'
,
JSON
.
stringify
(
res
.
data
.
Result
))
that
.
getStickyTables
()
}
},
/**
* tabs 组件处理关联关系
*/
handleTabsLink
(
data
)
{
data
.
list
.
forEach
(
item
=>
{
if
(
item
.
type
===
'NormalTabs'
&&
(
item
.
child
.
index
.
length
||
item
.
child
.
data
.
length
))
{
if
(
item
.
child
.
index
.
length
)
{
item
.
child
.
index
.
forEach
(
child
=>
{
const
index
=
data
.
list
.
findIndex
(
i
=>
i
.
id
===
child
)
if
(
index
!=
-
1
)
{
data
.
list
[
index
].
linkTabsId
=
item
.
id
}
})
}
if
(
item
.
child
.
data
.
length
)
{
item
.
child
.
data
.
forEach
(
child
=>
{
const
index
=
data
.
list
.
findIndex
(
i
=>
i
.
id
===
child
.
comp
)
if
(
index
!=
-
1
)
{
data
.
list
[
index
].
linkTabsId
=
item
.
id
}
})
}
}
})
return
data
},
/**
* 获取全局接口数据
*/
...
...
pages/fullscreen/fullscreen.vue
View file @
d8bfcee2
<
template
>
<view
class=
"wrapper"
:class=
"
{'tabs-layout': showTabs}" :style="{width: `${theStyle.width - theStyle.left}px`, left:`${theStyle.left}px`}">
<!-- 普通选项卡 -->
<view
v-if=
"showTabs"
style=
"position: fixed;top: 0;"
:style=
"
{
width: `${parseInt(tabsElement.width * scale)}px`,
height: `${parseInt(tabsElement.height * (scale > 1 ? 1 : scale))}px`,
left: `${parseInt(tabsElement.left * scale)}px`,
zIndex: 10
}"
>
<NormalTabs
:elementInfo=
"tabsElement"
></NormalTabs>
</view>
<view
:style=
"
{'margin-top': `${tabsElement.height * (scale > 1 ? 1 : scale)}px`, height: `${theStyle.height}px`, width: `${theStyle.width - theStyle.left}px`, zIndex: 9}">
<view
class=
"wrapper"
:style=
"
{width: `${theStyle.width - theStyle.left}px`, left:`${theStyle.left}px`}">
<view
:style=
"
{ height: `${theStyle.height}px`, width: `${theStyle.width - theStyle.left}px`, zIndex: 9}">
<!-- 普通柱状图 -->
<NormalBar
v-if=
"element.type == 'NormalBar'"
:elementInfo=
"element"
></NormalBar>
<!-- 普通折线图 -->
...
...
@@ -32,15 +19,10 @@
export
default
{
data
()
{
return
{
element
:
{},
linkTabsId
:
''
,
tabsElement
:
{}
element
:
{}
}
},
computed
:
{
showTabs
()
{
return
this
.
linkTabsId
&&
Object
.
keys
(
this
.
tabsElement
).
length
},
theStyle
()
{
const
{
windowWidth
,
windowHeight
,
screenHeight
,
safeArea
}
=
uni
.
getSystemInfoSync
()
const
reduceBottom
=
screenHeight
-
safeArea
.
bottom
...
...
@@ -50,76 +32,12 @@
left
:
safeArea
.
left
}
},
scale
()
{
let
info
=
JSON
.
parse
(
uni
.
getStorageSync
(
'reportInfo'
))
if
(
JSON
.
stringify
(
info
)
==
"{}"
)
{
return
}
const
{
windowWidth
}
=
uni
.
getSystemInfoSync
()
const
{
width
,
height
}
=
info
.
info
return
windowWidth
/
width
}
},
onLoad
(
option
)
{
this
.
element
=
JSON
.
parse
(
decodeURIComponent
(
option
.
element
))
this
.
linkTabsId
=
option
.
linkTabsId
if
(
this
.
linkTabsId
&&
uni
.
getStorageSync
(
'reportInfo'
))
{
let
info
=
JSON
.
parse
(
uni
.
getStorageSync
(
'reportInfo'
))
const
data
=
info
.
list
.
find
(
item
=>
item
.
id
===
this
.
linkTabsId
)
this
.
tabsElement
=
data
}
// 去掉全屏的定制按钮
const
toolbox
=
{
show
:
false
}
this
.
element
.
option
.
toolbox
=
toolbox
},
onUnload
()
{
// 移除监听事件
uni
.
$off
(
'handleLinkParams'
)
uni
.
$off
(
'handleLinkComp'
)
},
onShow
()
{
/**
* 组件交互 - 组件
*/
uni
.
$on
(
'handleLinkComp'
,
({
showData
,
hideData
})
=>
{
let
info
=
JSON
.
parse
(
uni
.
getStorageSync
(
'reportInfo'
))
const
data
=
info
.
list
.
find
(
item
=>
showData
[
0
]
===
item
.
id
)
data
.
hide
=
false
// 去掉全屏的定制按钮
data
.
option
.
toolbox
=
{
show
:
false
}
this
.
element
=
data
}),
/**
* 组件交互 - 参数
*/
uni
.
$on
(
'handleLinkParams'
,
({
index
,
paramName
,
value
})
=>
{
let
reportInfo
=
JSON
.
parse
(
uni
.
getStorageSync
(
'reportInfo'
))
if
(
index
.
length
&&
paramName
)
{
const
that
=
this
reportInfo
.
list
=
reportInfo
.
list
.
map
(
item
=>
{
const
flag
=
index
.
includes
(
item
.
id
)
if
(
flag
&&
item
.
type
===
'BasicText'
&&
item
.
data
.
dataType
===
'static'
)
{
that
.
$set
(
item
.
data
.
dataList
,
'text'
,
value
)
}
if
(
flag
&&
item
.
data
.
dataType
===
'dynamic'
)
{
if
(
!
item
.
data
.
queryFormatter
)
item
.
data
.
queryFormatter
=
{}
that
.
$set
(
item
.
data
.
queryFormatter
,
paramName
,
value
)
}
if
(
flag
&&
item
.
data
.
dataType
===
'dataSet'
)
{
if
(
!
item
.
data
.
dataSetInfo
.
queryFormatter
)
item
.
data
.
dataSetInfo
.
queryFormatter
=
{}
that
.
$set
(
item
.
data
.
dataSetInfo
.
queryFormatter
,
paramName
,
value
)
}
if
(
flag
&&
item
.
data
.
dataType
===
'public'
)
{
if
(
!
item
.
data
.
queryFormatter
)
item
.
data
.
queryFormatter
=
{}
that
.
$set
(
item
.
data
.
queryFormatter
,
paramName
,
value
)
}
return
item
})
}
this
.
element
=
reportInfo
.
list
.
find
(
item
=>
index
[
0
]
===
item
.
id
)
// 去掉全屏的定制按钮
this
.
element
.
option
.
toolbox
=
{
show
:
false
}
})
}
}
</
script
>
...
...
@@ -138,12 +56,6 @@
padding-bottom
:
constant
(
safe-area-inset-bottom
);
/*兼容
IOS
<
11
.2
*/
padding-bottom
:
env
(
safe-area-inset-bottom
);
/*兼容 IOS>11.2*/
}
.tabs-layout
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
flex-direction
:
column
;
}
</
style
>
pages/index/index.vue
View file @
d8bfcee2
...
...
@@ -265,38 +265,11 @@
}
})
}
that
.
reportInfo
=
this
.
handleTabsLink
(
res
.
data
.
Result
)
that
.
reportInfo
=
res
.
data
.
Result
uni
.
setStorageSync
(
'reportInfo'
,
JSON
.
stringify
(
that
.
reportInfo
))
that
.
getStickyTables
()
}
},
/**
* tabs 组件处理关联关系
*/
handleTabsLink
(
data
)
{
data
.
list
.
forEach
(
item
=>
{
if
(
item
.
type
===
'NormalTabs'
&&
(
item
.
child
.
index
.
length
||
item
.
child
.
data
.
length
))
{
if
(
item
.
child
.
index
.
length
)
{
item
.
child
.
index
.
forEach
(
child
=>
{
const
index
=
data
.
list
.
findIndex
(
i
=>
i
.
id
===
child
)
if
(
index
!=
-
1
)
{
data
.
list
[
index
].
linkTabsId
=
item
.
id
}
})
}
if
(
item
.
child
.
data
.
length
)
{
item
.
child
.
data
.
forEach
(
child
=>
{
const
index
=
data
.
list
.
findIndex
(
i
=>
i
.
id
===
child
.
comp
)
if
(
index
!=
-
1
)
{
data
.
list
[
index
].
linkTabsId
=
item
.
id
}
})
}
}
})
return
data
},
/**
* 获取全局接口数据
*/
...
...
leon
@leon
mentioned in commit
300bb332
·
Jul 18, 2023
mentioned in commit
300bb332
mentioned in commit 300bb332eed7c854b0d14586e7c0facec826d895
Toggle commit list
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