Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taobao-mini-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
qinhaitao
taobao-mini-template
Commits
8b548be0
Commit
8b548be0
authored
Apr 22, 2021
by
杨梦雅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
数据需求弹窗导出
parent
485fbd44
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
124 additions
and
27 deletions
+124
-27
statistic-dialog.acss
.../components/dialog/statistic-dialog/statistic-dialog.acss
+10
-0
statistic-dialog.axml
.../components/dialog/statistic-dialog/statistic-dialog.axml
+18
-0
statistic-dialog.js
...nt/components/dialog/statistic-dialog/statistic-dialog.js
+75
-0
statistic-dialog.json
.../components/dialog/statistic-dialog/statistic-dialog.json
+6
-0
list-table.axml
client/components/list/list-table/list-table.axml
+2
-1
list-table.js
client/components/list/list-table/list-table.js
+11
-25
list-table.json
client/components/list/list-table/list-table.json
+2
-1
No files found.
client/components/dialog/statistic-dialog/statistic-dialog.acss
0 → 100755
View file @
8b548be0
.statistic-dialog-wrap {
max-height: 400px;
overflow: scroll
}
.statistic-dialog-wrap .operator-btns {
margin-bottom: 10px;
}
.statistic-dialog-wrap .long-item .next-select {
width: 150px;
}
client/components/dialog/statistic-dialog/statistic-dialog.axml
0 → 100644
View file @
8b548be0
<dialog-wrap
title="导出数据需求"
visible="{{visible}}"
onClose="onCloseDialog"
width="500"
>
<view class="statistic-dialog-wrap">
<!-- 数据需求时间范围 -->
<form class="edit-content-form" data-name="form" inline="true" labelTextAlign="center" size="large">
<form-item class="edit-content-formItem" label="统计时间" labelTextAlign="center" asterisk="{{false}}">
<range-picker style="width: 400px" onChange="handleTimeRangeChange" hasClear="true" value="{{timeRange}}" class="block" data-time="{{timeRange}}"/>
</form-item>
<view class="operator-btns" style="textAlign:center">
<button style="margin-left:20px;height:32px" type="primary" onTap="handleExport" size="medium">导出</button>
</view>
</form>
</view>
</dialog-wrap>
\ No newline at end of file
client/components/dialog/statistic-dialog/statistic-dialog.js
0 → 100644
View file @
8b548be0
import
{
getStats
}
from
'/api'
;
Component
({
mixins
:
[],
data
:
{
// 数据统计开始结束时间
timeRange
:
[]
},
props
:
{
onClose
:
()
=>
{
},
onShowExportDialog
:
()
=>
{
},
selectedItem
:
{}
},
didMount
()
{
},
methods
:
{
// 关闭弹窗
onCloseDialog
()
{
this
.
setData
({
startDay
:
''
,
endDay
:
''
});
this
.
props
.
onClose
&&
this
.
props
.
onClose
();
},
// 监听时间变化
handleTimeRangeChange
(
e
)
{
console
.
log
(
e
.
detail
.
value
)
const
[
startTime
,
endTime
]
=
e
.
detail
.
value
;
this
.
setData
({
timeRange
:
[
startTime
,
endTime
]
});
},
// 导出
async
handleExport
(
evt
)
{
console
.
log
(
this
.
props
);
// 未选择任何条件搜索
if
(
!
this
.
data
.
timeRange
.
length
&&
!
this
.
data
.
timeRange
[
0
]
&&
!
this
.
data
.
timeRange
[
1
])
{
my
.
showToast
({
type
:
'fail'
,
content
:
'请选择统计时间范围'
});
return
;
}
const
{
activityId
}
=
this
.
props
.
selectedItem
;
let
params
=
{
activityId
,
startDay
:
this
.
data
.
timeRange
[
0
],
endDay
:
this
.
data
.
timeRange
[
1
]
};
my
.
showLoading
({
content
:
'生成文件中...'
});
try
{
let
{
success
,
data
,
message
}
=
(
await
getStats
(
params
))
||
{};
console
.
log
(
success
,
data
,
message
,
'复制链接'
);
if
(
success
)
{
this
.
props
.
onShowExportDialog
({
exportLinkUrl
:
data
.
url
.
replace
(
/amp;/g
,
''
)
});
console
.
log
(
data
,
'下载链接'
);
}
else
{
my
.
showToast
({
type
:
'fail'
,
content
:
message
});
}
my
.
hideLoading
();
}
catch
(
error
)
{
my
.
hideLoading
();
console
.
log
(
error
,
'exportStatistics-error'
);
}
}
}
});
client/components/dialog/statistic-dialog/statistic-dialog.json
0 → 100644
View file @
8b548be0
{
"component"
:
true
,
"usingComponents"
:
{
"dialog-wrap"
:
"../../basic/dialiog-wrap/dialiog-wrap"
}
}
client/components/list/list-table/list-table.axml
View file @
8b548be0
...
@@ -41,3 +41,4 @@
...
@@ -41,3 +41,4 @@
<rank-dialog a:if="{{winnerListDialogVisible}}" visible="{{winnerListDialogVisible}}" onClose="onCloseWinnerListDialog" onShowExportDialog="showExportDialog" selectedItem="{{selectedItem}}"/>
<rank-dialog a:if="{{winnerListDialogVisible}}" visible="{{winnerListDialogVisible}}" onClose="onCloseWinnerListDialog" onShowExportDialog="showExportDialog" selectedItem="{{selectedItem}}"/>
<statistic-dialog a:if="{{statisticDialogVisible}}" visible="{{statisticDialogVisible}}" onClose="onCloseStatisticDialog" onShowExportDialog="showExportDialog" selectedItem="{{selectedItem}}"/>
\ No newline at end of file
client/components/list/list-table/list-table.js
View file @
8b548be0
...
@@ -5,8 +5,7 @@ import {
...
@@ -5,8 +5,7 @@ import {
delActivity
,
delActivity
,
findWinnerInfoList
,
findWinnerInfoList
,
uploadDataCreateFile
,
uploadDataCreateFile
,
createCopyActivity
,
createCopyActivity
getStats
}
from
"/api"
;
}
from
"/api"
;
import
{
appId
}
from
"/config"
;
import
{
appId
}
from
"/config"
;
import
{
setClipboard
}
from
"/utils"
;
import
{
setClipboard
}
from
"/utils"
;
...
@@ -28,6 +27,7 @@ Component({
...
@@ -28,6 +27,7 @@ Component({
},
},
deleteId
:
""
,
deleteId
:
""
,
winnerListDialogVisible
:
false
,
winnerListDialogVisible
:
false
,
statisticDialogVisible
:
false
,
selectedItem
:
{}
selectedItem
:
{}
},
},
props
:
{
props
:
{
...
@@ -203,32 +203,18 @@ Component({
...
@@ -203,32 +203,18 @@ Component({
const
{
value
}
=
evt
.
detail
;
const
{
value
}
=
evt
.
detail
;
this
.
getList
(
value
);
this
.
getList
(
value
);
},
},
// 关闭数据需求弹窗
onCloseStatisticDialog
()
{
this
.
setData
({
statisticDialogVisible
:
false
});
},
// 导出数据需求
// 导出数据需求
async
onExportStatistics
(
evt
)
{
async
onExportStatistics
(
evt
)
{
const
{
activityId
,
startTime
,
endTime
}
=
evt
.
target
.
dataset
.
x
.
record
;
this
.
setData
({
my
.
showLoading
({
statisticDialogVisible
:
true
,
content
:
'生成文件中...'
selectedItem
:
evt
.
target
.
dataset
.
x
.
record
});
try
{
let
{
success
,
data
,
message
}
=
(
await
getStats
({
activityId
,
startDay
:
startTime
,
endDay
:
endTime
}))
||
{};
console
.
log
(
success
,
data
,
message
,
'复制链接'
);
if
(
success
)
{
this
.
showExportDialog
({
exportLinkUrl
:
data
.
url
.
replace
(
/amp;/g
,
''
)
});
console
.
log
(
data
,
'下载链接'
);
}
else
{
my
.
showToast
({
type
:
'fail'
,
content
:
message
});
});
}
my
.
hideLoading
();
}
catch
(
error
)
{
my
.
hideLoading
();
console
.
log
(
error
,
'exportStatistics-error'
);
}
},
},
},
},
});
});
client/components/list/list-table/list-table.json
View file @
8b548be0
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
"copy-link-dialog"
:
"/components/dialog/copy-link-dialog/copy-link-dialog"
,
"copy-link-dialog"
:
"/components/dialog/copy-link-dialog/copy-link-dialog"
,
"confirm-dialog"
:
"/components/dialog/confirm-dialog/confirm-dialog"
,
"confirm-dialog"
:
"/components/dialog/confirm-dialog/confirm-dialog"
,
"rank-dialog"
:
"/components/dialog/rank-dialog/rank-dialog"
,
"rank-dialog"
:
"/components/dialog/rank-dialog/rank-dialog"
,
"winner-list-dialog"
:
"/components/dialog/winner-list-dialog/winner-list-dialog"
"winner-list-dialog"
:
"/components/dialog/winner-list-dialog/winner-list-dialog"
,
"statistic-dialog"
:
"/components/dialog/statistic-dialog/statistic-dialog"
}
}
}
}
\ No newline at end of file
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