Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit b2df2022
authored
Nov 12, 2023
by
xinla
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
--no commit message
1 parent
79e768df
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
12 deletions
vue3-lw-pc/src/components/RequestChartTable.vue
vue3-lw-pc/src/components/RequestChartTable.vue
View file @
b2df202
...
@@ -14,6 +14,11 @@ export default {
...
@@ -14,6 +14,11 @@ export default {
type
:
String
,
// lineChart, barChart, table
type
:
String
,
// lineChart, barChart, table
default
:
'table'
,
default
:
'table'
,
},
},
// 查询参数
params
:
{
type
:
Object
,
default
:
()
=>
({}),
},
// 接口请求
// 接口请求
request
:
{
request
:
{
type
:
Function
,
type
:
Function
,
...
@@ -23,7 +28,7 @@ export default {
...
@@ -23,7 +28,7 @@ export default {
type
:
Boolean
,
type
:
Boolean
,
default
:
true
,
default
:
true
,
},
},
// 是否显示时间查询
// 是否显示
快捷
时间查询
isTimeQuery
:
{
isTimeQuery
:
{
type
:
Boolean
,
type
:
Boolean
,
},
},
...
@@ -62,12 +67,7 @@ export default {
...
@@ -62,12 +67,7 @@ export default {
data
()
{
data
()
{
return
{
return
{
loading
:
false
,
loading
:
false
,
// 查询参数
query
:
{
pageNum
:
1
,
pageSize
:
10
},
query
:
{
pageNum
:
1
,
pageSize
:
10
,
},
// 表格列表数据,或图表的series数据
// 表格列表数据,或图表的series数据
data
:
[],
data
:
[],
xData
:
[],
xData
:
[],
...
@@ -80,7 +80,7 @@ export default {
...
@@ -80,7 +80,7 @@ export default {
computed
:
{},
computed
:
{},
watch
:
{},
watch
:
{},
created
()
{
created
()
{
this
.
isCreateRequest
&&
this
.
getList
()
this
.
isCreateRequest
&&
!
this
.
isTimeQuery
&&
this
.
getList
()
},
},
mounted
()
{},
mounted
()
{},
methods
:
{
methods
:
{
...
@@ -90,6 +90,8 @@ export default {
...
@@ -90,6 +90,8 @@ export default {
page
&&
(
this
.
query
.
pageNum
=
page
)
page
&&
(
this
.
query
.
pageNum
=
page
)
}
}
Object
.
assign
(
this
.
query
,
this
.
params
)
this
.
dealQueryFun
&&
this
.
dealQueryFun
(
this
.
query
)
this
.
dealQueryFun
&&
this
.
dealQueryFun
(
this
.
query
)
let
query
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
query
))
let
query
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
query
))
...
@@ -104,17 +106,17 @@ export default {
...
@@ -104,17 +106,17 @@ export default {
return
this
.
request
(
query
)
return
this
.
request
(
query
)
.
then
(({
rows
,
total
,
data
})
=>
{
.
then
(({
rows
,
total
,
data
})
=>
{
data
=
data
||
rows
let
res
=
data
||
rows
// if (!data) return
// if (!data) return
if
(
this
.
type
==
'table'
)
{
if
(
this
.
type
==
'table'
)
{
// 表格
// 表格
this
.
data
=
data
this
.
data
=
JSON
.
parse
(
JSON
.
stringify
(
res
))
this
.
total
=
+
total
this
.
total
=
+
total
this
.
dealDataFun
&&
this
.
dealDataFun
(
data
,
this
.
data
)
this
.
dealDataFun
&&
this
.
dealDataFun
(
res
,
this
.
data
)
}
else
{
}
else
{
// 自定义echarts图表数据处理
// 自定义echarts图表数据处理
// this.data = data
// this.data = data
this
.
dealDataFun
&&
this
.
dealDataFun
(
data
,
this
.
data
,
this
.
xData
)
this
.
dealDataFun
&&
this
.
dealDataFun
(
res
,
this
.
data
,
this
.
xData
)
}
}
})
})
.
catch
((
e
)
=>
{
.
catch
((
e
)
=>
{
...
@@ -163,6 +165,7 @@ export default {
...
@@ -163,6 +165,7 @@ export default {
<div
<div
class=
"RequestChartTable-operation"
class=
"RequestChartTable-operation"
v-if=
"requestExport || isTimeQuery || $slots.queryMiddle || $slots.operation"
>
v-if=
"requestExport || isTimeQuery || $slots.queryMiddle || $slots.operation"
>
<!-- 快捷时间查询 -->
<SearchTitle
<SearchTitle
style=
"display: inline-flex"
style=
"display: inline-flex"
v-if=
"isTimeQuery"
v-if=
"isTimeQuery"
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment