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
119f0a98
Commit
119f0a98
authored
Jul 24, 2020
by
秦海涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
e788f979
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
28 deletions
+5
-28
add.js
client/pages/activity/add/add.js
+4
-27
validate.js
client/pages/activity/add/validate.js
+1
-1
No files found.
client/pages/activity/add/add.js
View file @
119f0a98
...
...
@@ -82,8 +82,7 @@ Component({
endTime
:
''
,
<%
for
(
var
i
=
0
;
i
<
configList
.
length
;
++
i
)
{
%>
<%-
!
taskKeys
.
includes
(
configList
[
i
].
key
)
&&
configList
[
i
].
key
!==
'label'
?
`
${
configList
[
i
].
key
}
:
${
configList
[
i
].
defaultValue
||
"''"
}
,`
:
''
%><%
}
%>
taskList
:
[],
taskMap
:
{
tasks
:
{
attentionStore
:
{
value
:
''
,
},
...
...
@@ -159,8 +158,7 @@ Component({
originalStartTime
:
+
data
.
startTime
,
isStart
:
+
data
.
startTime
<
Date
.
now
(),
isEnd
:
+
data
.
endTime
<
Date
.
now
(),
taskList
:
data
.
taskList
,
taskMap
:
this
.
formatTaskListToMap
(
data
.
taskList
)
tasks
})
}
catch
(
error
)
{
...
...
@@ -240,8 +238,7 @@ Component({
activityId
=
''
,
startTime
,
endTime
,
taskList
,
taskMap
,
tasks
,
<%
for
(
var
i
=
0
;
i
<
configList
.
length
;
++
i
)
{
%>
<%-
!
taskKeys
.
includes
(
configList
[
i
].
key
)
&&
configList
[
i
].
key
!==
'label'
?
configList
[
i
].
key
+
','
:
''
%><%
}
%>
}
=
params
;
...
...
@@ -252,32 +249,12 @@ Component({
activityId
,
startTime
:
new
Date
(
startTime
).
getTime
(),
endTime
:
new
Date
(
endTime
).
getTime
(),
tasks
,
// prizeInfoList: this.formatPrizeList(prizeInfoList),
taskList
:
this
.
formatTaskMapToList
(
taskMap
),
<%
for
(
var
i
=
0
;
i
<
configList
.
length
;
++
i
)
{
%>
<%-
!
taskKeys
.
includes
(
configList
[
i
].
key
)
&&
configList
[
i
].
key
!==
'label'
?
configList
[
i
].
key
+
','
:
''
%><%
}
%>
}
},
// taskMap转化taskList
formatTaskMapToList
(
taskMap
)
{
let
list
=
[];
Object
.
keys
(
taskMap
).
forEach
(
type
=>
{
let
task
=
{
...
taskMap
[
type
],
type
}
list
.
push
(
task
)
});
return
list
;
},
// taskList转化taskMap
formatTaskListToMap
(
taskList
=
[])
{
let
taskMap
=
{};
taskList
.
forEach
(
task
=>
{
taskMap
[
task
[
'type'
]]
=
task
;
});
return
taskMap
},
// 补足谢谢参与类型
formatPrizeList
(
prizeInfoList
=
[])
{
let
totalPercent
=
prizeInfoList
.
reduce
((
total
,
next
)
=>
{
...
...
client/pages/activity/add/validate.js
View file @
119f0a98
...
...
@@ -6,7 +6,7 @@ import { rankTableValidator, validateRangeNumber } from "../../../utils/validate
export
const
descriptor
=
{
<%
for
(
var
i
=
0
;
i
<
configList
.
length
;
++
i
)
{
%>
<%-
!
taskKeys
.
includes
(
configList
[
i
].
key
)
&&
configList
[
i
].
validator
?
configList
[
i
].
validator
+
','
:
''
%><%
}
%>
task
Map
:
{
task
s
:
{
type
:
'object'
,
required
:
false
,
fields
:
{
...
...
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