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
40b6cf9e
Commit
40b6cf9e
authored
Feb 15, 2022
by
Jenny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: table style
parent
5c8596fb
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
23 deletions
+41
-23
NormalTable.vue
components/NormalTable/NormalTable.vue
+25
-15
u-table.vue
uview-ui/components/u-table/u-table.vue
+11
-3
u-td.vue
uview-ui/components/u-td/u-td.vue
+2
-2
u-th.vue
uview-ui/components/u-th/u-th.vue
+3
-3
No files found.
components/NormalTable/NormalTable.vue
View file @
40b6cf9e
<
template
>
<
template
>
<view
>
<view
>
<!--
<BasicText
:elementInfo=
"elementInfo"
></BasicText>
-->
<NormalTitle
:elementInfo=
"elementInfo"
></NormalTitle>
<NormalTitle
:elementInfo=
"elementInfo"
></NormalTitle>
<scroll-view
scroll-x=
"true"
>
<scroll-view
scroll-x=
"true"
>
<view
class=
"scroll-view_H"
>
<view
class=
"scroll-view_H"
>
<u-table
>
<u-table
<u-tr
v-if=
"elementInfo.table.tableHeader.showHeader"
:style=
"[headerStyle]"
>
class=
"normal-table"
:border-width=
"elementInfo.table.frameWidth"
:border-color=
"elementInfo.table.frameColor"
:border-style=
"elementInfo.table.frameStyle"
:bg-color=
"elementInfo.table.tableCell.backgroundColor"
:color=
"elementInfo.table.tableCell.titleColor"
:font-size=
"$u.common.pxToRpx(elementInfo.table.tableCell.titleFontSize)"
:align=
"elementInfo.table.tableCell.titlePostion"
:th-style=
"headerStyle"
>
<u-tr
v-if=
"elementInfo.table.tableHeader.showHeader"
>
<u-th
v-for=
"(item, index) in columns"
:key=
"index"
>
{{
item
.
title
}}
</u-th>
<u-th
v-for=
"(item, index) in columns"
:key=
"index"
>
{{
item
.
title
}}
</u-th>
</u-tr>
</u-tr>
<u-tr
v-for=
"(cell, cellIndex) in chartTables"
:key=
"cellIndex"
@
tap=
"cellClick(cell)"
>
<u-tr
v-for=
"(cell, cellIndex) in chartTables"
:key=
"cellIndex"
@
tap=
"cellClick(cell)"
>
<u-td
style=
"width: 150px;"
v-for=
"(item, index) in columns"
:key=
"index"
>
<u-td
v-for=
"(item, index) in columns"
:key=
"index"
>
{{
cell
[
item
.
dataIndex
]
}}
{{
cell
[
item
.
dataIndex
]
}}
</u-td>
</u-td>
</u-tr>
</u-tr>
</u-table>
</u-table>
</view>
</view>
</scroll-view>
</scroll-view>
</view>
</view>
</
template
>
</
template
>
...
@@ -38,11 +45,13 @@
...
@@ -38,11 +45,13 @@
},
},
computed
:
{
computed
:
{
headerStyle
()
{
headerStyle
()
{
const
{
headerRowHeight
,
titleColor
,
backgroundColor
,
titlePostion
,
titleFontSize
}
=
this
.
elementInfo
.
table
.
tableHeader
return
{
return
{
'width'
:
'150rpx'
,
'height'
:
`
${
this
.
$u
.
common
.
pxToRpx
(
headerRowHeight
)}
rpx`
,
'height'
:
this
.
elementInfo
.
table
.
tableHeader
.
headerRowHeight
+
'px'
,
'color'
:
titleColor
,
'color'
:
this
.
elementInfo
.
table
.
tableHeader
.
titleColor
,
'background-color'
:
backgroundColor
,
'background-color'
:
this
.
elementInfo
.
table
.
tableHeader
.
backgroundColor
,
'text-align'
:
titlePostion
,
'font-size'
:
`
${
this
.
$u
.
common
.
pxToRpx
(
titleFontSize
)}
rpx`
}
}
}
}
},
},
...
@@ -64,11 +73,12 @@
...
@@ -64,11 +73,12 @@
</
script
>
</
script
>
<
style
scoped
lang=
"scss"
>
<
style
scoped
lang=
"scss"
>
.scroll-view_H
{
.scroll-view_H
{
width
:
100%
;
width
:
100%
;
display
:
flex
;
display
:
flex
;
flex-wrap
:
nowrap
;
flex-wrap
:
nowrap
;
}
}
.normal-table
{
width
:
100%
;
}
</
style
>
</
style
>
uview-ui/components/u-table/u-table.vue
View file @
40b6cf9e
...
@@ -27,6 +27,14 @@
...
@@ -27,6 +27,14 @@
type
:
String
,
type
:
String
,
default
:
'#e4e7ed'
default
:
'#e4e7ed'
},
},
borderWidth
:
{
type
:
Number
,
default
:
1
},
borderStyle
:
{
type
:
String
,
default
:
'solid'
},
align
:
{
align
:
{
type
:
String
,
type
:
String
,
default
:
'center'
default
:
'center'
...
@@ -65,9 +73,9 @@
...
@@ -65,9 +73,9 @@
computed
:
{
computed
:
{
tableStyle
()
{
tableStyle
()
{
let
style
=
{};
let
style
=
{};
style
.
borderLeft
=
`
solid 1
px
${
this
.
borderColor
}
`
;
style
.
borderLeft
=
`
${
this
.
borderStyle
}
${
this
.
borderWidth
}
px
${
this
.
borderColor
}
`
;
style
.
borderTop
=
`
solid 1
px
${
this
.
borderColor
}
`
;
style
.
borderTop
=
`
${
this
.
borderStyle
}
${
this
.
borderWidth
}
px
${
this
.
borderColor
}
`
;
style
.
backgroundColor
=
this
.
bgColor
;
;
style
.
backgroundColor
=
this
.
bgColor
;
return
style
;
return
style
;
}
}
}
}
...
...
uview-ui/components/u-td/u-td.vue
View file @
40b6cf9e
...
@@ -40,8 +40,8 @@
...
@@ -40,8 +40,8 @@
style
.
textAlign
=
this
.
parent
.
align
;
style
.
textAlign
=
this
.
parent
.
align
;
style
.
fontSize
=
this
.
parent
.
fontSize
+
'rpx'
;
style
.
fontSize
=
this
.
parent
.
fontSize
+
'rpx'
;
style
.
padding
=
this
.
parent
.
padding
;
style
.
padding
=
this
.
parent
.
padding
;
style
.
borderBottom
=
`
solid 1
px
${
this
.
parent
.
borderColor
}
`
;
style
.
borderBottom
=
`
${
this
.
parent
.
borderStyle
}
${
this
.
parent
.
borderWidth
}
px
${
this
.
parent
.
borderColor
}
`
;
style
.
borderRight
=
`
solid 1
px
${
this
.
parent
.
borderColor
}
`
;
style
.
borderRight
=
`
${
this
.
parent
.
borderStyle
}
${
this
.
parent
.
borderWidth
}
px
${
this
.
parent
.
borderColor
}
`
;
style
.
color
=
this
.
parent
.
color
;
style
.
color
=
this
.
parent
.
color
;
this
.
tdStyle
=
style
;
this
.
tdStyle
=
style
;
}
}
...
...
uview-ui/components/u-th/u-th.vue
View file @
40b6cf9e
...
@@ -37,9 +37,9 @@
...
@@ -37,9 +37,9 @@
if
(
this
.
width
)
style
.
flex
=
`0 0
${
this
.
width
}
`
;
if
(
this
.
width
)
style
.
flex
=
`0 0
${
this
.
width
}
`
;
style
.
textAlign
=
this
.
parent
.
align
;
style
.
textAlign
=
this
.
parent
.
align
;
style
.
padding
=
this
.
parent
.
padding
;
style
.
padding
=
this
.
parent
.
padding
;
style
.
borderBottom
=
`
solid 1
px
${
this
.
parent
.
borderColor
}
`
;
style
.
borderBottom
=
`
${
this
.
parent
.
borderStyle
}
${
this
.
parent
.
borderWidth
}
px
${
this
.
parent
.
borderColor
}
`
;
style
.
borderRight
=
`
solid 1
px
${
this
.
parent
.
borderColor
}
`
;
style
.
borderRight
=
`
${
this
.
parent
.
borderStyle
}
${
this
.
parent
.
borderWidth
}
px
${
this
.
parent
.
borderColor
}
`
;
Object
.
assign
(
style
,
this
.
parent
.
s
tyle
);
Object
.
assign
(
style
,
this
.
parent
.
thS
tyle
);
this
.
thStyle
=
style
;
this
.
thStyle
=
style
;
}
}
}
}
...
...
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