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
f7f5fc62
Commit
f7f5fc62
authored
Jul 03, 2023
by
leon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: fullscreen display and fix some bug
parent
1d287822
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
137 additions
and
40 deletions
+137
-40
HorizontalBar.vue
components/HorizontalBar/HorizontalBar.vue
+1
-1
NormalTable.vue
components/NormalTable/NormalTable.vue
+4
-2
NormalTabs.vue
components/NormalTabs/NormalTabs.vue
+2
-2
details.vue
pages/details/details.vue
+32
-0
fullscreen.vue
pages/fullscreen/fullscreen.vue
+41
-11
index.vue
pages/index/index.vue
+13
-5
u-subsection.vue
uview-ui/components/u-subsection/u-subsection.vue
+44
-19
No files found.
components/HorizontalBar/HorizontalBar.vue
View file @
f7f5fc62
...
...
@@ -169,7 +169,7 @@ export default {
}
]
)
if
(
chart
)
{
if
(
chart
&&
chart
.
getOption
())
{
const
option
=
chart
.
getOption
()
option
.
series
=
dealSeries
// 重新setOption,使得设置的formatter生效
...
...
components/NormalTable/NormalTable.vue
View file @
f7f5fc62
...
...
@@ -113,7 +113,9 @@
}
)
}
,
destroyed
()
{
if
(
elementInfo
&&
elementInfo
.
id
)
{
uni
.
$off
(
elementInfo
.
id
)
}
}
,
methods
:
{
initChart
()
{
...
...
components/NormalTabs/NormalTabs.vue
View file @
f7f5fc62
<
template
>
<view
class=
"normal-tabs"
>
<u-tabs
v-if=
"elementInfo.option.tabs.type === 'tabs'"
:list=
"elementData.dataList.series"
:is-scroll=
"true"
<u-tabs
v-if=
"elementInfo.option.tabs.type === 'tabs'"
:list=
"elementData.dataList.series"
:is-scroll=
'elementData.dataList.series.length > 4'
:current=
"currentTabs"
:active-color=
"elementInfo.option.tabs.activeColor"
:inactive-color=
"elementInfo.option.tabs.color"
:bg-color=
"elementInfo.option.tabs.backgroundColor"
:font-size=
"getFontSize()"
@
change=
"handleTabsChange"
>
{{
elementInfo
.
option
.
tabs
.
fontSize
}}
</u-tabs>
:font-size=
"getFontSize()"
@
change=
"handleTabsChange"
></u-tabs>
<u-subsection
v-if=
"elementInfo.option.tabs.type === 'radio'"
:list=
"elementData.dataList.series"
:current=
"currentTabs"
:active-color=
"elementInfo.option.tabs.activeColor"
:inactive-color=
"elementInfo.option.tabs.color"
:font-size=
"getFontSize()"
...
...
pages/details/details.vue
View file @
f7f5fc62
...
...
@@ -227,9 +227,41 @@
}
}
that
.
reportInfo
=
res
.
data
.
Result
// 暂不支持tabs带入,没有做数据缓存
// that.reportInfo = this.handleTabsLink(res.data.Result)
// 清除数据
if
(
uni
.
getStorageSync
(
'reportInfo'
))
{
let
info
=
JSON
.
parse
(
uni
.
getStorageSync
(
'reportInfo'
))
info
.
list
.
forEach
(
item
=>
{
// 如果本地缓存的数组在接口请求的数组中不存在,则删除
if
(
!
that
.
reportInfo
.
list
.
some
(
idx
=>
idx
.
id
==
item
.
id
))
{
uni
.
removeStorageSync
(
item
.
id
)
}
})
}
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
))
{
item
.
child
.
index
.
forEach
(
child
=>
{
const
index
=
data
.
list
.
findIndex
(
i
=>
i
.
id
===
child
)
data
.
list
[
index
].
linkTabsId
=
item
.
id
})
item
.
child
.
data
.
forEach
(
child
=>
{
const
index
=
data
.
list
.
findIndex
(
i
=>
i
.
id
===
child
.
comp
)
data
.
list
[
index
].
linkTabsId
=
item
.
id
})
}
})
return
data
},
/**
* 获取全局接口数据
*/
...
...
pages/fullscreen/fullscreen.vue
View file @
f7f5fc62
...
...
@@ -4,9 +4,8 @@
<NormalTabs
v-if=
"showTabs"
:elementInfo=
"tabsElement"
styleType=
"vertical"
style=
"width: 80px;"
:style=
"
{paddingLeft: `${theStyle.left}px`}"
style=
"height: 40px;margin-top: 5px;"
:style=
"
{width: `${theStyle.width - theStyle.left}px`}"
>
</NormalTabs>
<view
:style=
"
{height: `${theStyle.height}px`, width: `${theStyle.width - theStyle.left}px`}">
<!-- 普通柱状图 -->
...
...
@@ -39,8 +38,8 @@
const
{
windowWidth
,
windowHeight
,
screenHeight
,
safeArea
}
=
uni
.
getSystemInfoSync
()
const
reduceBottom
=
screenHeight
-
safeArea
.
bottom
return
{
height
:
windowHeight
-
reduceBottom
,
width
:
this
.
showTabs
?
windowWidth
-
80
:
windowWidth
,
height
:
this
.
showTabs
?
windowHeight
-
reduceBottom
-
50
:
windowHeight
-
reduceBottom
,
width
:
windowWidth
,
left
:
safeArea
.
left
}
},
...
...
@@ -52,7 +51,6 @@
let
info
=
JSON
.
parse
(
uni
.
getStorageSync
(
'reportInfo'
))
const
data
=
info
.
list
.
find
(
item
=>
item
.
id
===
this
.
linkTabsId
)
data
.
height
=
this
.
theStyle
.
height
data
.
option
.
tabs
.
defaultValue
=
data
.
child
.
data
.
find
(
item
=>
item
.
comp
===
this
.
element
.
id
).
name
this
.
tabsElement
=
data
}
// 去掉全屏的定制按钮
...
...
@@ -70,6 +68,37 @@
// 去掉全屏的定制按钮
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
}
})
}
}
...
...
@@ -94,6 +123,7 @@
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
flex-direction
:
column
;
}
</
style
>
pages/index/index.vue
View file @
f7f5fc62
...
...
@@ -273,12 +273,20 @@
*/
handleTabsLink
(
data
)
{
data
.
list
.
forEach
(
item
=>
{
if
(
item
.
type
===
'NormalTabs'
&&
item
.
child
.
data
.
length
)
{
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
)
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
)
data
.
list
[
index
].
linkTabsId
=
item
.
id
})
}
}
})
return
data
},
...
...
uview-ui/components/u-subsection/u-subsection.vue
View file @
f7f5fc62
...
...
@@ -116,24 +116,33 @@
this
.
currentIndex
=
nVal
;
this
.
changeSectionStatus
(
nVal
);
}
}
},
created
()
{
// 将list的数据,传入listInfo数组,因为不能修改props传递的list值
// 可以接受直接数组形式,或者数组元素为对象的形式,如:['简介', '评论'],或者[{name: '简介'}, {name: '评论'}]
this
.
listInfo
=
this
.
list
.
map
((
val
,
index
)
=>
{
if
(
typeof
val
!=
'object'
)
{
let
obj
=
{
width
:
0
,
name
:
val
};
return
obj
;
}
else
{
val
.
width
=
0
;
return
val
;
list
:
{
immediate
:
true
,
handler
(
nVal
)
{
this
.
getListInfo
()
setTimeout
(()
=>
{
this
.
getTabsInfo
();
},
10
);
}
}
});
},
// created() {
// // 将list的数据,传入listInfo数组,因为不能修改props传递的list值
// // 可以接受直接数组形式,或者数组元素为对象的形式,如:['简介', '评论'],或者[{name: '简介'}, {name: '评论'}]
// this.listInfo = this.list.map((val, index) => {
// if (typeof val != 'object') {
// let obj = {
// width: 0,
// name: val
// };
// return obj;
// } else {
// val.width = 0;
// return val;
// }
// });
// },
computed
:
{
// 设置mode=subsection时,滑块特有的样式
noBorderRight
()
{
...
...
@@ -213,11 +222,27 @@
}
},
mounted
()
{
setTimeout
(()
=>
{
this
.
getTabsInfo
();
},
10
);
//
setTimeout(() => {
//
this.getTabsInfo();
//
}, 10);
},
methods
:
{
getListInfo
()
{
// 将list的数据,传入listInfo数组,因为不能修改props传递的list值
// 可以接受直接数组形式,或者数组元素为对象的形式,如:['简介', '评论'],或者[{name: '简介'}, {name: '评论'}]
this
.
listInfo
=
this
.
list
.
map
((
val
,
index
)
=>
{
if
(
typeof
val
!=
'object'
)
{
let
obj
=
{
width
:
0
,
name
:
val
};
return
obj
;
}
else
{
val
.
width
=
0
;
return
val
;
}
});
},
// 改变滑块的样式
changeSectionStatus
(
nVal
)
{
if
(
this
.
mode
==
'subsection'
)
{
...
...
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