@@ -14,25 +14,18 @@ import { computed, ref } from 'vue'
14
14
import { getRealSqlOfArr , getStartAndEndTime , getUndefined } from ' ./utils'
15
15
import dayjs from ' dayjs'
16
16
import TableBanner from ' ../TableBanner.vue'
17
-
18
- type ChangeValue = {
19
- database? : string ,
20
- table? : string ,
21
- time? : string | number ,
22
- queryKind? : string ,
23
- user? : string ,
24
- type? : string
25
- }
17
+ import { ChangeValue } from ' ../types'
26
18
27
19
const queryFunc = (sql : string ) => {
28
20
return query (sql )
29
21
}
30
22
const databaseReal = ref <string | undefined >(undefined )
31
23
const tableReal = ref <string | undefined >(undefined )
32
24
const timeReal = ref <string | number >(dayjs .duration (24 , ' hours' ).asMilliseconds ())
25
+ const timeDuration = ref <string >(' 1 MINUTE' )
33
26
34
27
const selectChangeData = (data : ChangeValue ) => {
35
- const { database, table, time } = data
28
+ const { database, table, time, option } = data
36
29
if (database ) {
37
30
databaseReal .value = getRealSqlOfArr (getUndefined (database ))
38
31
}
@@ -41,6 +34,7 @@ const selectChangeData = (data: ChangeValue) => {
41
34
}
42
35
if (time ) {
43
36
timeReal .value = time
37
+ timeDuration .value = option ?.duration || ' 1 MINUTE'
44
38
}
45
39
}
46
40
@@ -101,6 +95,20 @@ const queryFunction = (
101
95
></count >
102
96
</el-col >
103
97
</el-row >
98
+ <el-row :gutter =" 10" >
99
+ <el-col :span =" 24" >
100
+ <ChartsVue
101
+ index =" 3"
102
+ title =" Write Rows"
103
+ sql-func-name =" queryWriteRowDataAnalysis"
104
+ :time-range =" timeRange"
105
+ :time-duration =" timeDuration"
106
+ :query-func =" queryFunction"
107
+ type =" line"
108
+ :height =" 470"
109
+ ></ChartsVue >
110
+ </el-col >
111
+ </el-row >
104
112
<el-row :gutter =" 10" >
105
113
<el-col :span =" 12" >
106
114
<Progress
0 commit comments