Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
TC
Overview
Overview
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
qlintonger xeno
TC
Commits
972c414c
Commit
972c414c
authored
May 20, 2025
by
qlintonger xeno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加其事件监听
parent
0f71878b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
7 deletions
+27
-7
src/layout.conf.ts
+18
-6
src/lib/Table2Chart/ScreenChart.vue
+2
-1
src/lib/Table2Chart/types/ScreenChart.typing.ts
+7
-0
No files found.
src/layout.conf.ts
View file @
972c414c
...
@@ -10,12 +10,12 @@ const sampleForLineCharts = {
...
@@ -10,12 +10,12 @@ const sampleForLineCharts = {
const
sampleForRadarCharts
=
{
const
sampleForRadarCharts
=
{
type
:
ChartCompType
.
SimpleRadar
,
type
:
ChartCompType
.
SimpleRadar
,
indicators
:
[
indicators
:
[
{
name
:
'Sales'
,
max
:
6500
},
{
name
:
'Sales'
,
max
:
6500
,
min
:
0
},
{
name
:
'Administration'
,
max
:
16000
},
{
name
:
'Administration'
,
max
:
16000
,
min
:
0
},
{
name
:
'Information Technology'
,
max
:
30000
},
{
name
:
'Information Technology'
,
max
:
30000
,
min
:
0
},
{
name
:
'Customer Support'
,
max
:
38000
},
{
name
:
'Customer Support'
,
max
:
38000
,
min
:
0
},
{
name
:
'Development'
,
max
:
52000
},
{
name
:
'Development'
,
max
:
52000
,
min
:
0
},
{
name
:
'Marketing'
,
max
:
25000
}
{
name
:
'Marketing'
,
max
:
25000
,
min
:
0
}
],
],
data
:
[
data
:
[
{
{
...
@@ -70,6 +70,10 @@ const sampleKLine = {
...
@@ -70,6 +70,10 @@ const sampleKLine = {
]
]
}
}
]
]
},
onClickGraph
(
item
:
any
,
index
:
number
)
{
alert
(
'click-kline'
)
console
.
log
(
'item-here'
,
{
item
,
index
})
}
}
}
}
...
@@ -122,6 +126,10 @@ const sampleScatter = {
...
@@ -122,6 +126,10 @@ const sampleScatter = {
type
:
'scatter'
type
:
'scatter'
}
}
]
]
},
onClickGraph
(
item
:
any
,
index
:
number
)
{
alert
(
'click-scatter!'
)
console
.
log
(
'item-here'
,
{
item
,
index
})
}
}
}
}
...
@@ -215,6 +223,10 @@ const indexMapper: Record<string, any> = {
...
@@ -215,6 +223,10 @@ const indexMapper: Record<string, any> = {
1
:
{
1
:
{
title
:
"随意设置图"
,
title
:
"随意设置图"
,
chartData
:
[
sampleKLine
,
sampleScatter
],
chartData
:
[
sampleKLine
,
sampleScatter
],
onClickTitle
(
item
:
any
)
{
alert
(
'click-random'
)
console
.
log
(
'item-here'
,
{
item
})
}
},
},
6
:
{
6
:
{
title
:
"简单混排图"
,
title
:
"简单混排图"
,
...
...
src/lib/Table2Chart/ScreenChart.vue
View file @
972c414c
...
@@ -47,7 +47,7 @@ import { singleContainerClass } from "./const/staticConsts.ts";
...
@@ -47,7 +47,7 @@ import { singleContainerClass } from "./const/staticConsts.ts";
:style=
"gridItemStyle(item, props, gridConfig)"
:style=
"gridItemStyle(item, props, gridConfig)"
class=
"flex flex-col"
class=
"flex flex-col"
>
>
<div
v-if=
"!item.renderTitle"
class=
"w-full"
>
{{
item
.
title
}}
</div>
<div
@
click=
"item.onClickTitle ? item.onClickTitle(item) : () =>
{}"
v-if="!item.renderTitle" class="w-full">
{{
item
.
title
}}
</div>
<component
:is=
"item.renderTitle(item, props.layout)"
v-else
/>
<component
:is=
"item.renderTitle(item, props.layout)"
v-else
/>
<div
<div
v-if=
"isAllMounted"
v-if=
"isAllMounted"
...
@@ -68,6 +68,7 @@ import { singleContainerClass } from "./const/staticConsts.ts";
...
@@ -68,6 +68,7 @@ import { singleContainerClass } from "./const/staticConsts.ts";
v-for=
"(z, x) in item.chartData"
v-for=
"(z, x) in item.chartData"
:key=
"x"
:key=
"x"
:options=
"mapToEchartsOptions(z)"
:options=
"mapToEchartsOptions(z)"
@
click=
"z.onClickGraph && z.onClickGraph(z, x)"
/>
/>
</div>
</div>
</div>
</div>
...
...
src/lib/Table2Chart/types/ScreenChart.typing.ts
View file @
972c414c
...
@@ -8,6 +8,7 @@ export type BarChartOptions = {
...
@@ -8,6 +8,7 @@ export type BarChartOptions = {
chartWidth
?:
number
|
string
;
chartWidth
?:
number
|
string
;
chartHeight
?:
number
|
string
;
chartHeight
?:
number
|
string
;
options
?:
any
options
?:
any
onClickGraph
?:
Function
;
};
};
export
type
LineChartOptions
=
BarChartOptions
;
export
type
LineChartOptions
=
BarChartOptions
;
...
@@ -20,6 +21,7 @@ export type PieChartOptionsBase = {
...
@@ -20,6 +21,7 @@ export type PieChartOptionsBase = {
chartHeight
?:
number
|
string
;
chartHeight
?:
number
|
string
;
legend
?:
any
;
legend
?:
any
;
options
?:
any
options
?:
any
onClickGraph
?:
Function
;
};
};
export
type
PieCharOptions
=
PieChartOptionsBase
&
{
export
type
PieCharOptions
=
PieChartOptionsBase
&
{
...
@@ -34,6 +36,7 @@ export type ButtonCenterText = {
...
@@ -34,6 +36,7 @@ export type ButtonCenterText = {
title
:
string
;
title
:
string
;
bottomTex
:
string
;
bottomTex
:
string
;
type
:
ChartCompType
;
type
:
ChartCompType
;
onClickGraph
?:
Function
;
};
};
export
type
SimpleTableChart
=
{
export
type
SimpleTableChart
=
{
...
@@ -41,6 +44,7 @@ export type SimpleTableChart = {
...
@@ -41,6 +44,7 @@ export type SimpleTableChart = {
columns
:
Array
<
{
title
:
string
;
key
:
string
}
>
;
columns
:
Array
<
{
title
:
string
;
key
:
string
}
>
;
data
:
Array
<
Record
<
string
,
any
>>
;
data
:
Array
<
Record
<
string
,
any
>>
;
options
?:
any
options
?:
any
onClickGraph
?:
Function
;
};
};
export
type
SimpleRadarChart
=
{
export
type
SimpleRadarChart
=
{
...
@@ -52,6 +56,7 @@ export type SimpleRadarChart = {
...
@@ -52,6 +56,7 @@ export type SimpleRadarChart = {
legend
?:
any
;
legend
?:
any
;
indicators
:
Array
<
{
name
:
string
;
max
:
number
}
>
;
indicators
:
Array
<
{
name
:
string
;
max
:
number
}
>
;
options
?:
any
options
?:
any
onClickGraph
?:
Function
;
};
};
export
type
DIYChart
=
{
export
type
DIYChart
=
{
...
@@ -59,6 +64,7 @@ export type DIYChart = {
...
@@ -59,6 +64,7 @@ export type DIYChart = {
options
:
any
,
options
:
any
,
chartWidth
?:
number
|
string
;
chartWidth
?:
number
|
string
;
chartHeight
?:
number
|
string
;
chartHeight
?:
number
|
string
;
onClickGraph
?:
Function
;
}
}
export
type
GeneralChartOptions
=
export
type
GeneralChartOptions
=
...
@@ -82,6 +88,7 @@ export type SingleLayoutConf = {
...
@@ -82,6 +88,7 @@ export type SingleLayoutConf = {
wrapperClass
?:
string
|
Array
<
string
>
|
Record
<
string
,
any
>
;
wrapperClass
?:
string
|
Array
<
string
>
|
Record
<
string
,
any
>
;
wrapperStyle
?:
Record
<
string
,
any
>
|
Function
;
wrapperStyle
?:
Record
<
string
,
any
>
|
Function
;
columns
?:
number
;
columns
?:
number
;
onClickTitle
?:
Function
;
};
};
export
type
LayoutConfig
=
Array
<
SingleLayoutConf
>
;
export
type
LayoutConfig
=
Array
<
SingleLayoutConf
>
;
...
...
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