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
8657f297
Commit
8657f297
authored
Jan 25, 2022
by
leon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: table add cell click
parent
ccbda6f0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
3 deletions
+22
-3
NormalTable.vue
components/NormalTable/NormalTable.vue
+22
-3
No files found.
components/NormalTable/NormalTable.vue
View file @
8657f297
...
@@ -4,10 +4,10 @@
...
@@ -4,10 +4,10 @@
<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>
<u-tr
v-if=
"elementInfo.table.tableHeader.showHeader"
:style=
"[headerStyle]"
>
<u-th
style=
"width: 150px;"
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"
>
<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
style=
"width: 150px;"
v-for=
"(item, index) in columns"
:key=
"index"
>
{{
cell
[
item
.
dataIndex
]
}}
{{
cell
[
item
.
dataIndex
]
}}
</u-td>
</u-td>
...
@@ -32,6 +32,19 @@
...
@@ -32,6 +32,19 @@
chartTables
:
[]
chartTables
:
[]
};
};
},
},
mounted
()
{
},
computed
:
{
headerStyle
()
{
return
{
'width'
:
'150rpx'
,
'height'
:
this
.
elementInfo
.
table
.
tableHeader
.
headerRowHeight
+
'px'
,
'color'
:
this
.
elementInfo
.
table
.
tableHeader
.
titleColor
,
'background-color'
:
this
.
elementInfo
.
table
.
tableHeader
.
backgroundColor
,
}
}
},
methods
:
{
methods
:
{
initChart
()
{
initChart
()
{
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
...
@@ -39,6 +52,12 @@
...
@@ -39,6 +52,12 @@
this
.
chartTables
=
this
.
elementData
.
dataList
.
chartTables
this
.
chartTables
=
this
.
elementData
.
dataList
.
chartTables
})
})
},
},
cellClick
(
e
)
{
const
{
index
,
data
}
=
this
.
elementInfo
.
child
const
paramName
=
this
.
elementInfo
.
table
.
primaryKey
const
value
=
e
[
paramName
]
uni
.
$emit
(
'handleLinkParams'
,
{
index
,
paramName
,
value
:
value
})
}
}
}
}
}
</
script
>
</
script
>
...
...
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