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
5c9c28db
Commit
5c9c28db
authored
Mar 30, 2023
by
leon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: table header click
parent
85a8d99c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
10 deletions
+23
-10
NormalTable.vue
components/NormalTable/NormalTable.vue
+22
-6
NormalTabs.vue
components/NormalTabs/NormalTabs.vue
+0
-2
details.vue
pages/details/details.vue
+0
-1
index.vue
pages/index/index.vue
+1
-1
No files found.
components/NormalTable/NormalTable.vue
View file @
5c9c28db
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<view
class=
'tr'
:class=
"[sticky ? 'table_header_sticky' : 'table_header']"
<view
class=
'tr'
:class=
"[sticky ? 'table_header_sticky' : 'table_header']"
v-if=
"elementInfo.table.tableHeader.showHeader"
>
v-if=
"elementInfo.table.tableHeader.showHeader"
>
<template
v-for=
"(item, index) in elementInfo.table.column"
>
<template
v-for=
"(item, index) in elementInfo.table.column"
>
<view
class=
"th th_style"
:class=
"[index == 0 && !sticky ? 'row_fixed': '']"
:key=
"index"
>
<view
class=
"th th_style"
:class=
"[index == 0 && !sticky ? 'row_fixed': '']"
:key=
"index"
@
tap=
"headerClick(item)"
>
{{
item
.
title
}}
{{
item
.
title
}}
</view>
</view>
</
template
>
</
template
>
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
:style=
"[tableCellStyle(index, cellIndex)]"
:data-column=
"index"
:data-row=
"cellIndex"
>
:style=
"[tableCellStyle(index, cellIndex)]"
:data-column=
"index"
:data-row=
"cellIndex"
>
<
template
v-if=
"item.slots.customRender == 'rank'"
>
{{
index
+
1
}}
</
template
>
<
template
v-if=
"item.slots.customRender == 'rank'"
>
{{
index
+
1
}}
</
template
>
<
template
v-else-if=
"item.slots.customRender == 'picture'"
>
<
template
v-else-if=
"item.slots.customRender == 'picture'"
>
<u-image
:height=
"100"
mode=
"aspectFit"
<u-image
:height=
"
elementInfo.table.imageHeight ||
100"
mode=
"aspectFit"
:src=
"`$
{cell[item.dataIndex]}?${new Date().getTime()}`" crossOrigin="anonymous"
:src=
"`$
{cell[item.dataIndex]}?${new Date().getTime()}`" crossOrigin="anonymous"
style="width:100%" @click="imageClick(cellIndex, item.dataIndex)">
</u-image>
style="width:100%" @click="imageClick(cellIndex, item.dataIndex)">
</u-image>
</
template
>
</
template
>
...
@@ -72,7 +72,8 @@
...
@@ -72,7 +72,8 @@
titlePostion
:
cellTitlePostion
,
titlePostion
:
cellTitlePostion
,
titleFontSize
:
cellTitleFontSize
,
titleFontSize
:
cellTitleFontSize
,
cellRowHeight
,
cellRowHeight
,
titleColor
:
cellTitleColor
titleColor
:
cellTitleColor
,
cellPadding
}
=
this
.
elementInfo
.
table
.
tableCell
}
=
this
.
elementInfo
.
table
.
tableCell
const
{
const
{
headerRowHeight
,
headerRowHeight
,
...
@@ -99,7 +100,8 @@
...
@@ -99,7 +100,8 @@
'--cell-justify-content'
:
this
.
align
[
cellTitlePostion
],
'--cell-justify-content'
:
this
.
align
[
cellTitlePostion
],
'--cell-font-size'
:
`${cellTitleFontSize || 14
}
px`
,
'--cell-font-size'
:
`${cellTitleFontSize || 14
}
px`
,
'--cell-row-height'
:
`${cellRowHeight || 30
}
px`
,
'--cell-row-height'
:
`${cellRowHeight || 30
}
px`
,
'--cell-color'
:
cellTitleColor
'--cell-color'
:
cellTitleColor
,
'--cell-padding'
:
`${cellPadding || 10
}
px`
}
}
}
,
}
,
}
,
}
,
...
@@ -224,6 +226,20 @@
...
@@ -224,6 +226,20 @@
}
)
}
)
}
,
}
,
headerClick
(
e
)
{
const
{
index
,
data
}
=
this
.
elementInfo
.
child
const
paramName
=
this
.
elementInfo
.
table
.
tableHeader
.
headerParams
const
value
=
e
.
dataIndex
uni
.
$emit
(
'handleLinkParams'
,
{
index
,
paramName
,
value
:
value
}
)
}
,
// 图片增加点击事件,查看全部图片
// 图片增加点击事件,查看全部图片
imageClick
(
index
,
key
)
{
imageClick
(
index
,
key
)
{
const
images
=
[]
const
images
=
[]
...
@@ -317,14 +333,14 @@
...
@@ -317,14 +333,14 @@
flex
:
var
(
--
cell
-
width
);
flex
:
var
(
--
cell
-
width
);
font
-
size
:
28
rpx
;
font
-
size
:
28
rpx
;
color
:
$u
-
main
-
color
;
color
:
$u
-
main
-
color
;
padding
:
10
px
0
px
;
padding
:
var
(
--
cell
-
padding
)
0
px
;
background
-
color
:
rgb
(
245
,
246
,
248
);
background
-
color
:
rgb
(
245
,
246
,
248
);
}
}
.
td
{
.
td
{
flex
:
var
(
--
cell
-
width
);
flex
:
var
(
--
cell
-
width
);
align
-
self
:
stretch
;
align
-
self
:
stretch
;
padding
:
10
px
0
px
;
padding
:
var
(
--
cell
-
padding
)
0
px
;
font
-
size
:
28
rpx
;
font
-
size
:
28
rpx
;
color
:
$u
-
content
-
color
;
color
:
$u
-
content
-
color
;
display
:
flex
;
display
:
flex
;
...
...
components/NormalTabs/NormalTabs.vue
View file @
5c9c28db
...
@@ -177,7 +177,6 @@
...
@@ -177,7 +177,6 @@
paramName
,
paramName
,
data
data
}
=
this
.
elementInfo
.
child
}
=
this
.
elementInfo
.
child
console
.
log
(
this
.
tabsValue
)
if
(
this
.
elementInfo
.
child
.
type
===
'param'
)
{
if
(
this
.
elementInfo
.
child
.
type
===
'param'
)
{
uni
.
$emit
(
'handleLinkParams'
,
{
uni
.
$emit
(
'handleLinkParams'
,
{
index
,
index
,
...
@@ -201,7 +200,6 @@
...
@@ -201,7 +200,6 @@
var
label
=
value
var
label
=
value
this
.
elementData
.
dataList
.
series
.
forEach
(
item
=>
{
this
.
elementData
.
dataList
.
series
.
forEach
(
item
=>
{
if
(
item
.
value
===
value
)
{
if
(
item
.
value
===
value
)
{
console
.
log
(
item
)
label
=
item
.
name
label
=
item
.
name
}
}
})
})
...
...
pages/details/details.vue
View file @
5c9c28db
...
@@ -309,7 +309,6 @@
...
@@ -309,7 +309,6 @@
handlePage
()
{
handlePage
()
{
var
idstr
=
this
.
idList
[
this
.
indexs
]
var
idstr
=
this
.
idList
[
this
.
indexs
]
const
url
=
"/pages/details/details?id="
+
idstr
+
"&idList="
+
this
.
idList
const
url
=
"/pages/details/details?id="
+
idstr
+
"&idList="
+
this
.
idList
console
.
log
(
url
)
uni
.
redirectTo
({
uni
.
redirectTo
({
url
:
url
url
:
url
})
})
...
...
pages/index/index.vue
View file @
5c9c28db
...
@@ -274,7 +274,7 @@
...
@@ -274,7 +274,7 @@
async
getGlobalData
(
info
)
{
async
getGlobalData
(
info
)
{
const
that
=
this
const
that
=
this
const
dataUrl
=
info
.
dataUrl
.
replace
(
/^
(\/(
dashboardCharts|dashboardAPI
))?
/
,
''
)
const
dataUrl
=
info
.
dataUrl
.
replace
(
/^
(\/(
dashboardCharts|dashboardAPI
))?
/
,
''
)
const
dataFormatter
=
th
is
.
$u
.
common
.
filterRequestParams
({...
info
.
dataFormatter
})
const
dataFormatter
=
th
at
.
$u
.
common
.
filterRequestParams
({...
info
.
dataFormatter
})
let
res
=
await
that
.
$u
.
api
[
`
${
info
.
dataMethod
.
toLowerCase
()}
Http`
](
dataUrl
,
dataFormatter
,
{
let
res
=
await
that
.
$u
.
api
[
`
${
info
.
dataMethod
.
toLowerCase
()}
Http`
](
dataUrl
,
dataFormatter
,
{
custom
:
{
loading
:
false
}
custom
:
{
loading
:
false
}
})
})
...
...
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