Commit 3b0f153a by CubeSky

AmibaLight v12 - Fix WeeklyReport_Viewall lag

1 parent c63d707e
......@@ -37,4 +37,4 @@
.其实 阿米巴·轻 是悄悄更新的~
>div.ui.divider
>p
.版本: Version 11
\ No newline at end of file
.版本: Version 12
\ No newline at end of file
......@@ -25,5 +25,7 @@
>div.row
-root
>div.row
+pagebtns
>div.row
>br
>br
\ No newline at end of file
......@@ -360,6 +360,12 @@ const viewall_yw_wk_tpl = ef.t`
+worklist
`
const viewall_page_btn_tpl = ef.t`
>button.tiny.ui.button.{{active}}
@click = switchPage:{{page}}
.{{page}}
`
const viewall_score_tpl = ef.t`
>div.accordion.ywlist
>div.active.title
......@@ -2813,9 +2819,12 @@ function setupMountPoint(url, eft) {
if (result.data.obj.result.length > 0) {
pages.efp.mountpoint.root = new viewall_root_tpl()
pages.efp.mountpoint.root.list.empty()
pages.efp.mountpoint.pagebtns.empty()
var va_pagelist = []
var va_pagelist_temp = []
for (index in result.data.obj.result) {
var data = result.data.obj.result[index]
var listIndex = pages.efp.mountpoint.root.list.push(new viewall_yw_tpl({
var listIndex = va_pagelist_temp.push(new viewall_yw_tpl({
$data: {
year: data.create_year,
week: data.create_week,
......@@ -2826,7 +2835,7 @@ function setupMountPoint(url, eft) {
})) - 1
for (index_project in data.work_info) {
var data_project = data.work_info[index_project]
var listIndex_ = pages.efp.mountpoint.root.list[listIndex].sumlist.push(new viewall_yw_wk_tpl({
var listIndex_ = va_pagelist_temp[listIndex].sumlist.push(new viewall_yw_wk_tpl({
$data: {
project: index_project
}
......@@ -2837,7 +2846,7 @@ function setupMountPoint(url, eft) {
if (data_work.task_type === 'longtime') {
progress_work = '长期'
}
pages.efp.mountpoint.root.list[listIndex].sumlist[listIndex_].worklist.push(new wk_work_info_tpl({
va_pagelist_temp[listIndex].sumlist[listIndex_].worklist.push(new wk_work_info_tpl({
$data: {
task: data_work.task_name,
want: data_work.task_demand_side,
......@@ -2853,42 +2862,71 @@ function setupMountPoint(url, eft) {
}
for (index_proj_plan in data.plan_info) {
var data_plan = data.plan_info[index_proj_plan]
var listIndex_ = pages.efp.mountpoint.root.list[listIndex].planlist.push(new viewall_yw_wk_tpl({
var listIndex_ = va_pagelist_temp[listIndex].planlist.push(new viewall_yw_wk_tpl({
$data: {
project: index_proj_plan
}
})) - 1
for (index_work in data_plan) {
var data_plan_detail = data_plan[index_work]
pages.efp.mountpoint.root.list[listIndex].planlist[listIndex_].worklist.push(new wk_plan_info_tpl({
va_pagelist_temp[listIndex].planlist[listIndex_].worklist.push(new wk_plan_info_tpl({
$data: {
task: data_plan_detail.task_name
}
}))
}
}
pages.efp.mountpoint.root.list[listIndex].scorelist.push(new viewall_score_tpl({
va_pagelist_temp[listIndex].scorelist.push(new viewall_score_tpl({
$data: {
which: '业务负责',
score: data.score.department.score,
note: data.score.department.remarks
}
}))
pages.efp.mountpoint.root.list[listIndex].scorelist.push(new viewall_score_tpl({
va_pagelist_temp[listIndex].scorelist.push(new viewall_score_tpl({
$data: {
which: '管理部门',
score: data.score.management.score,
note: data.score.management.remarks
}
}))
pages.efp.mountpoint.root.list[listIndex].scorelist.push(new viewall_score_tpl({
va_pagelist_temp[listIndex].scorelist.push(new viewall_score_tpl({
$data: {
which: '劳动总评',
score: data.score.boss.score,
note: data.score.boss.remarks
}
}))
if (index % 5 == 0) {
va_pagelist.push(va_pagelist_temp)
va_pagelist_temp = []
}
}
if (va_pagelist_temp.length > 0) {
va_pagelist.push(va_pagelist_temp)
va_pagelist_temp = []
}
for (var i = 0; i < va_pagelist.length; i++) {
var active = ''
if (i === 0) active = 'active'
pages.efp.mountpoint.pagebtns.push(new viewall_page_btn_tpl({
$data: {
page: i + 1,
active: active
},
$methods: {
switchPage ({state, value}) {
pages.efp.mountpoint.root.list = va_pagelist[parseInt(value)]
$('body,html').stop(false, false).animate({scrollTop: 0}, 150)
for (var ii = 0; ii < pages.efp.mountpoint.pagebtns.length; ii++) {
pages.efp.mountpoint.pagebtns[value].$data.active = ''
}
pages.efp.mountpoint.pagebtns[value].$data.active = 'active'
}
}
}))
}
pages.efp.mountpoint.root.list = va_pagelist[0]
} else {
pages.efp.mountpoint.root = new viewall_root_empty_tpl()
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!