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
8bbc3827
Commit
8bbc3827
authored
May 18, 2021
by
王波
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'b-template-component-addDataBoard' into 'b-template-component'
feat: 增加了数据看板模块 See merge request
!15
parents
3381da65
c292ffa4
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
155 additions
and
3 deletions
+155
-3
data-board-dialog.acss
...omponents/dialog/data-board-dialog/data-board-dialog.acss
+29
-0
data-board-dialog.axml
...omponents/dialog/data-board-dialog/data-board-dialog.axml
+17
-0
data-board-dialog.js
.../components/dialog/data-board-dialog/data-board-dialog.js
+82
-0
data-board-dialog.json
...omponents/dialog/data-board-dialog/data-board-dialog.json
+7
-0
list-table.axml
client/components/list/list-table/list-table.axml
+4
-1
list-table.js
client/components/list/list-table/list-table.js
+14
-1
list-table.json
client/components/list/list-table/list-table.json
+2
-1
No files found.
client/components/dialog/data-board-dialog/data-board-dialog.acss
0 → 100755
View file @
8bbc3827
.rank-dialog-wrap {
max-height: 400px;
overflow: scroll
}
.other-winner-list {
display: flex;
justify-content: flex-end;
margin: 0 0 20px 0;
}
.now-winner-list {
display: flex;
justify-content: flex-end;
margin: 20px 0;
}
.rank-pagination {
display: flex;
justify-content: flex-end;
margin: 10px 0 0 0;
}
.rank-pagination-text {
display: flex;
align-items: center;
}
.rank-dialog-wrap .operator-btns {
margin-bottom: 10px;
}
.rank-dialog-wrap .long-item .next-select {
width: 150px;
}
client/components/dialog/data-board-dialog/data-board-dialog.axml
0 → 100644
View file @
8bbc3827
<dialog-wrap title="数据看板" visible="{{visible}}" onClose="onCloseDialog" width="1000">
<form class="edit-content-form" data-name="form" inline="true" labelTextAlign="right" size="large">
<form-item class="edit-content-formItem" label="选择时间" labelTextAlign="right" asterisk="{{false}}">
<range-picker style="width: 300px" onChange="handleTimeRangeChange" hasClear="true" value="{{searchInfo.timeRange}}" class="block" data-time="{{searchInfo.timeRange}}"/>
</form-item>
<button onTap="searchList" style="height:32px;" type="primary" size="medium">搜索</button>
</form>
<view class="rank-dialog-wrap">
<table dataSource="{{list}}" loading="{{isLoading}}" isZebra>
<table-column a:for="{{titleList}}" title="{{item}}" dataIndex="{{item}}" width="{{index === 0 ? 120 : 'auto'}}"/>
</table>
<view class="rank-pagination">
<text class="rank-pagination-text">共 {{total}} 条</text>
<pagination showJump="{{false}}" defaultCurrent="{{1}}" current="{{searchInfo.pageNo}}" data-type="all" pageSize="{{searchInfo.pageSize}}" onChange="handleChangePage" pageShowCount="{{10}}" total="{{total}}" a:if="{{total > 0}}" shape="arrow-only" />
</view>
</view>
</dialog-wrap>
\ No newline at end of file
client/components/dialog/data-board-dialog/data-board-dialog.js
0 → 100644
View file @
8bbc3827
import
{
getStats
}
from
"/api"
;
import
moment
from
"moment"
;
Component
({
mixins
:
[],
data
:
{
// 搜索条件
searchInfo
:
{
timeRange
:
[]
// 发奖时间
},
titleList
:
[],
list
:
[],
total
:
0
,
isLoading
:
false
,
winactivityId
:
""
},
props
:
{
onClose
:
()
=>
{},
selectedItem
:
{}
},
didMount
()
{
const
now
=
new
Date
();
const
today
=
moment
(
now
).
format
(
"YYYY/MM/DD"
);
const
startTime
=
today
.
slice
(
0
,
8
)
+
"01"
;
this
.
setData
({
"searchInfo.timeRange"
:
[
startTime
,
today
]
});
this
.
searchList
();
},
didUpdate
()
{},
didUnmount
()
{},
methods
:
{
async
searchList
()
{
this
.
setData
({
isLoading
:
true
,
list
:
[],
total
:
0
});
const
startDay
=
this
.
data
.
searchInfo
.
timeRange
[
0
].
replace
(
/-/g
,
'/'
)
const
endDay
=
this
.
data
.
searchInfo
.
timeRange
[
1
].
replace
(
/-/g
,
'/'
)
const
params
=
{
activityId
:
this
.
props
.
selectedItem
.
activityId
,
startDay
,
endDay
};
const
{
data
}
=
(
await
getStats
(
params
))
||
{};
// console.log("data::::::::", data);
const
{
xlsxData
}
=
data
;
const
titleList
=
xlsxData
[
0
];
const
dataList
=
xlsxData
.
slice
(
1
);
let
tableData
=
[];
dataList
.
forEach
((
item
,
idx
)
=>
{
let
itemObj
=
{};
titleList
.
forEach
((
it
,
i
)
=>
{
itemObj
[
it
]
=
item
[
i
];
});
tableData
.
push
(
itemObj
);
});
console
.
log
(
"tableData::::::::"
,
tableData
);
if
(
tableData
&&
tableData
.
length
>
0
)
{
this
.
setData
({
isLoading
:
false
,
titleList
,
list
:
tableData
,
total
:
tableData
.
length
});
}
},
// 监听发奖时间变化
handleTimeRangeChange
(
e
)
{
const
[
startTime
,
endTime
]
=
e
.
detail
.
value
;
this
.
setData
({
"searchInfo.timeRange"
:
[
startTime
,
endTime
]
});
},
onCloseDialog
()
{
this
.
props
.
onClose
&&
this
.
props
.
onClose
();
}
}
});
client/components/dialog/data-board-dialog/data-board-dialog.json
0 → 100644
View file @
8bbc3827
{
"component"
:
true
,
"usingComponents"
:
{
"dialog-wrap"
:
"../../basic/dialiog-wrap/dialiog-wrap"
,
"ship-dialog"
:
"../../dialog/ship-dialog/ship-dialog"
}
}
client/components/list/list-table/list-table.axml
View file @
8bbc3827
...
...
@@ -19,6 +19,7 @@
<button a:if="{{buttons.includes('copyLink')}}" class="tb-list-edit" type="primary" text="true" data-x="{{x}}" onTap="onCopyLink">复制活动链接</button>
<button a:if="{{buttons.includes('copyNewActivity')}}" class="tb-list-edit" type="primary" text="true" data-x="{{x}}" onTap="onCreateNewActivity">复制新活动</button>
<button a:if="{{buttons.includes('exportStatistics')}}" class="tb-list-edit" type="primary" text="true" data-x="{{x}}" onTap="onExportStatistics">导出数据需求</button>
<button a:if="{{isTestEnv}}" class="tb-list-edit" type="primary" text="true" data-x="{{x}}" onTap="onShowDataBoard">数据看板</button>
</view>
</table-column>
</table>
...
...
@@ -41,4 +42,6 @@
<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
<statistic-dialog a:if="{{statisticDialogVisible}}" visible="{{statisticDialogVisible}}" onClose="onCloseStatisticDialog" onShowExportDialog="showExportDialog" selectedItem="{{selectedItem}}"/>
<data-board-dialog a:if="{{dataBoardDialogVisible}}" visible="{{dataBoardDialogVisible}}" onClose="onCloseDataBoardDialog" selectedItem="{{selectedItem}}"/>
\ No newline at end of file
client/components/list/list-table/list-table.js
View file @
8bbc3827
...
...
@@ -7,11 +7,12 @@ import {
uploadDataCreateFile
,
createCopyActivity
}
from
"/api"
;
import
{
appId
}
from
"/config"
;
import
{
appId
,
env
}
from
"/config"
;
import
{
setClipboard
}
from
"/utils"
;
Component
({
data
:
{
isTestEnv
:
env
===
'test'
?
true
:
false
,
isLoadingList
:
false
,
exportDialogVisible
:
false
,
exportLinkUrl
:
''
,
...
...
@@ -216,5 +217,17 @@ Component({
selectedItem
:
evt
.
target
.
dataset
.
x
.
record
});
},
// 数据看板
onShowDataBoard
(
evt
)
{
this
.
setData
({
dataBoardDialogVisible
:
true
,
selectedItem
:
evt
.
target
.
dataset
.
x
.
record
});
},
onCloseDataBoardDialog
()
{
this
.
setData
({
dataBoardDialogVisible
:
false
});
},
},
});
client/components/list/list-table/list-table.json
View file @
8bbc3827
...
...
@@ -5,6 +5,7 @@
"confirm-dialog"
:
"/components/dialog/confirm-dialog/confirm-dialog"
,
"rank-dialog"
:
"/components/dialog/rank-dialog/rank-dialog"
,
"winner-list-dialog"
:
"/components/dialog/winner-list-dialog/winner-list-dialog"
,
"statistic-dialog"
:
"/components/dialog/statistic-dialog/statistic-dialog"
"statistic-dialog"
:
"/components/dialog/statistic-dialog/statistic-dialog"
,
"data-board-dialog"
:
"/components/dialog/data-board-dialog/data-board-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