Commit 119f0a98 authored by 秦海涛's avatar 秦海涛

update

parent e788f979
......@@ -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) => {
......
......@@ -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 + ',' : '' %><% } %>
taskMap: {
tasks: {
type: 'object',
required: false,
fields: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment