保存进度!
This commit is contained in:
		@@ -9,7 +9,40 @@
 | 
				
			|||||||
-->
 | 
					-->
 | 
				
			||||||
<template>
 | 
					<template>
 | 
				
			||||||
    <div class="rankinglist-wrapper">
 | 
					    <div class="rankinglist-wrapper">
 | 
				
			||||||
        排行榜组件
 | 
					        <el-table
 | 
				
			||||||
 | 
					            :data="topFive"
 | 
				
			||||||
 | 
					            stripe
 | 
				
			||||||
 | 
					            style="width:100%;"
 | 
				
			||||||
 | 
					            :header-cell-style="{background:'#fecb96'}"
 | 
				
			||||||
 | 
					        >
 | 
				
			||||||
 | 
					            <el-table-column
 | 
				
			||||||
 | 
					                label="名次"
 | 
				
			||||||
 | 
					                width="60"
 | 
				
			||||||
 | 
					                align="center"
 | 
				
			||||||
 | 
					            >
 | 
				
			||||||
 | 
					                <template #default="ranking">
 | 
				
			||||||
 | 
					                    <span class="rankinglist-index">{{ ranking.row.index }}</span>
 | 
				
			||||||
 | 
					                </template>
 | 
				
			||||||
 | 
					            </el-table-column>
 | 
				
			||||||
 | 
					            <el-table-column
 | 
				
			||||||
 | 
					                label="名次"
 | 
				
			||||||
 | 
					                width="160"
 | 
				
			||||||
 | 
					                align="center"
 | 
				
			||||||
 | 
					            >
 | 
				
			||||||
 | 
					                <template #default="ranking">
 | 
				
			||||||
 | 
					                    <span class="rankinglist-index">{{ ranking.row.callerName }}</span>
 | 
				
			||||||
 | 
					                </template>
 | 
				
			||||||
 | 
					            </el-table-column>
 | 
				
			||||||
 | 
					            <el-table-column
 | 
				
			||||||
 | 
					                label="指标"
 | 
				
			||||||
 | 
					                width="80"
 | 
				
			||||||
 | 
					                align="center"
 | 
				
			||||||
 | 
					            >
 | 
				
			||||||
 | 
					                <template #default="ranking">
 | 
				
			||||||
 | 
					                    <span class="rankinglist-index">{{ ranking.row.appraiseValue }}</span>
 | 
				
			||||||
 | 
					                </template>
 | 
				
			||||||
 | 
					            </el-table-column>
 | 
				
			||||||
 | 
					        </el-table>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -42,7 +75,7 @@ export default {
 | 
				
			|||||||
     * setup函数
 | 
					     * setup函数
 | 
				
			||||||
     * @param props 组件的props属性。
 | 
					     * @param props 组件的props属性。
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    setup( props )
 | 
					    setup(props)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        /**
 | 
					        /**
 | 
				
			||||||
         * 计算对象,用于获取top5.
 | 
					         * 计算对象,用于获取top5.
 | 
				
			||||||
@@ -51,13 +84,13 @@ export default {
 | 
				
			|||||||
        {
 | 
					        {
 | 
				
			||||||
            const rankingList = props.rankingList; // eslint-disable-line
 | 
					            const rankingList = props.rankingList; // eslint-disable-line
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            rankingList.sort(( a, b ) =>
 | 
					            rankingList.sort((a, b) =>
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                // @ts-ignore
 | 
					                // @ts-ignore
 | 
				
			||||||
                return a.index - b.index;
 | 
					                return a.index - b.index;
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return rankingList.slice(0,5);
 | 
					            return rankingList.slice(0, 5);
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return { props, topFive, };
 | 
					        return { props, topFive, };
 | 
				
			||||||
@@ -66,13 +99,34 @@ export default {
 | 
				
			|||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<style lang="scss" scoped>
 | 
					<style lang="scss" scoped>
 | 
				
			||||||
.rankinglist-wrapper
 | 
					.rankinglist-wrapper {
 | 
				
			||||||
{
 | 
					    // border: 1px solid red;
 | 
				
			||||||
    border: 1px solid red;
 | 
					    border-radius: 5px;
 | 
				
			||||||
 | 
					 | 
				
			||||||
    width: 300px;
 | 
					    width: 300px;
 | 
				
			||||||
    height: 250px;
 | 
					    height: 250px;
 | 
				
			||||||
 | 
					 | 
				
			||||||
    font-size: 12px;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.rankinglist-index {
 | 
				
			||||||
 | 
					    display: block;
 | 
				
			||||||
 | 
					    text-align: center;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					:deep(.el-table)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    border-radius: 5px;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					:deep(.el-table__header-wrapper) {
 | 
				
			||||||
 | 
					  thead {
 | 
				
			||||||
 | 
					    th{
 | 
				
			||||||
 | 
					      div{
 | 
				
			||||||
 | 
					        // font-family: "FZ-ZHUOHEI";
 | 
				
			||||||
 | 
					        font-weight: 500;
 | 
				
			||||||
 | 
					        font-size: 15px;
 | 
				
			||||||
 | 
					        color: #da3703;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
</style>
 | 
					</style>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -28,8 +28,8 @@ interface RankingListResponse
 | 
				
			|||||||
    departmentCode: string;
 | 
					    departmentCode: string;
 | 
				
			||||||
    year: string;
 | 
					    year: string;
 | 
				
			||||||
    month: string;
 | 
					    month: string;
 | 
				
			||||||
    attachingRankingList: RankingListItem[];
 | 
					    attachingRateRankingList: RankingListItem[];
 | 
				
			||||||
    renewalRankintList: RankingListItem[];
 | 
					    renewalRateRankingList: RankingListItem[];
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
@@ -49,8 +49,8 @@ function requestRankingList( reqParam: RankingListRequest, rander: any ): void /
 | 
				
			|||||||
        departmentCode: reqParam.departmentCode,
 | 
					        departmentCode: reqParam.departmentCode,
 | 
				
			||||||
        year: reqParam.year,
 | 
					        year: reqParam.year,
 | 
				
			||||||
        month: reqParam.month,
 | 
					        month: reqParam.month,
 | 
				
			||||||
        attachingRankingList: [],
 | 
					        attachingRateRankingList: [],
 | 
				
			||||||
        renewalRankintList: [],
 | 
					        renewalRateRankingList: [],
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    instance.request(
 | 
					    instance.request(
 | 
				
			||||||
@@ -70,7 +70,7 @@ function requestRankingList( reqParam: RankingListRequest, rander: any ): void /
 | 
				
			|||||||
            rankingListResponse.month = data.month ?? "";
 | 
					            rankingListResponse.month = data.month ?? "";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            // 遍历排行榜元素
 | 
					            // 遍历排行榜元素
 | 
				
			||||||
            for ( const item of ( data.attachingRankingList ?? [] )) // eslint-disable-line
 | 
					            for ( const item of ( data.attachingRateRankingList ?? [] )) // eslint-disable-line
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                const index: number = item.index ?? -1;
 | 
					                const index: number = item.index ?? -1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -79,10 +79,10 @@ function requestRankingList( reqParam: RankingListRequest, rander: any ): void /
 | 
				
			|||||||
                    continue;
 | 
					                    continue;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                rankingListResponse.attachingRankingList.push( item );
 | 
					                rankingListResponse.attachingRateRankingList.push( item );
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            for ( const item of ( data.renewalRankintList ?? [] )) // eslint-disable-line
 | 
					            for ( const item of ( data.renewalRateRankingList ?? [] )) // eslint-disable-line
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                const index: number = item.index ?? -1;
 | 
					                const index: number = item.index ?? -1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -91,13 +91,11 @@ function requestRankingList( reqParam: RankingListRequest, rander: any ): void /
 | 
				
			|||||||
                    continue;
 | 
					                    continue;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                rankingListResponse.renewalRankintList.push( item );
 | 
					                rankingListResponse.renewalRateRankingList.push( item );
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            // 调用回调函数保存数据
 | 
					            // 调用回调函数保存数据
 | 
				
			||||||
            rander( rankingListResponse );
 | 
					            rander( rankingListResponse );
 | 
				
			||||||
 | 
					 | 
				
			||||||
            console.log( data );
 | 
					 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
        .catch(( error ) =>
 | 
					        .catch(( error ) =>
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -31,12 +31,8 @@
 | 
				
			|||||||
                        :percentage="ui.attaching_rate"
 | 
					                        :percentage="ui.attaching_rate"
 | 
				
			||||||
                    />
 | 
					                    />
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                <div
 | 
					                <div class="total-archievement-charts-wrapper">
 | 
				
			||||||
                    class="total-archievement-charts-wrapper"
 | 
					                    <ArchievementChart :chart-data="ui.chartData" />
 | 
				
			||||||
                >
 | 
					 | 
				
			||||||
                    <ArchievementChart
 | 
					 | 
				
			||||||
                        :chart-data="ui.chartData"
 | 
					 | 
				
			||||||
                    />
 | 
					 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
            <div class="reward-wrapper">
 | 
					            <div class="reward-wrapper">
 | 
				
			||||||
@@ -52,8 +48,35 @@
 | 
				
			|||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        <div class="right-wrapper">
 | 
					        <div class="right-wrapper">
 | 
				
			||||||
            <RankingListComponent />
 | 
					            <h1>本大爷</h1>
 | 
				
			||||||
            <RankingListComponent />
 | 
					            <div class="carousel-item">
 | 
				
			||||||
 | 
					                <el-carousel
 | 
				
			||||||
 | 
					                    arrow="never"
 | 
				
			||||||
 | 
					                    indicator-position="none"
 | 
				
			||||||
 | 
					                >
 | 
				
			||||||
 | 
					                    <el-carousel-item
 | 
				
			||||||
 | 
					                        :key="1"
 | 
				
			||||||
 | 
					                    >
 | 
				
			||||||
 | 
					                        <RankingListComponent :ranking-list="ui.attachingRankingList" />
 | 
				
			||||||
 | 
					                    </el-carousel-item>
 | 
				
			||||||
 | 
					                    <el-carousel-item :key="2">
 | 
				
			||||||
 | 
					                        <RankingListComponent :ranking-list="ui.renewalRankingList" />
 | 
				
			||||||
 | 
					                    </el-carousel-item>
 | 
				
			||||||
 | 
					                </el-carousel>
 | 
				
			||||||
 | 
					            </div>
 | 
				
			||||||
 | 
					            <div class="carousel-item">
 | 
				
			||||||
 | 
					                <el-carousel
 | 
				
			||||||
 | 
					                    arrow="never"
 | 
				
			||||||
 | 
					                    indicator-position="none"
 | 
				
			||||||
 | 
					                >
 | 
				
			||||||
 | 
					                    <el-carousel-item :key="1">
 | 
				
			||||||
 | 
					                        <RankingListComponent :ranking-list="ui.attachingRankingList" />
 | 
				
			||||||
 | 
					                    </el-carousel-item>
 | 
				
			||||||
 | 
					                    <el-carousel-item :key="2">
 | 
				
			||||||
 | 
					                        <RankingListComponent :ranking-list="ui.renewalRankingList" />
 | 
				
			||||||
 | 
					                    </el-carousel-item>
 | 
				
			||||||
 | 
					                </el-carousel>
 | 
				
			||||||
 | 
					            </div>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
@@ -134,7 +157,7 @@ export default {
 | 
				
			|||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // 保存业绩数据
 | 
					        // 保存业绩数据
 | 
				
			||||||
        const applyArchievementData = ( data:Archievement ) =>
 | 
					        const applyArchievementData = ( data: Archievement ) =>
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            console.log( "部门业绩数据", data );
 | 
					            console.log( "部门业绩数据", data );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -155,13 +178,15 @@ export default {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        const applyRankingListData = ( data: RankingListResponse ): void =>
 | 
					        const applyRankingListData = ( data: RankingListResponse ): void =>
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            ui.attachingRankingList = data.attachingRankingList;
 | 
					            ui.attachingRankingList = data.attachingRateRankingList;
 | 
				
			||||||
            ui.renewalRankingList = data.renewalRankintList;
 | 
					            ui.renewalRankingList = data.renewalRateRankingList;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            // 更新UI
 | 
					            // 更新UI
 | 
				
			||||||
            // 先不显示界面,往队列中加入显示队列的回调,让vue刷新组件。
 | 
					            // 先不显示界面,往队列中加入显示队列的回调,让vue刷新组件。
 | 
				
			||||||
            ui.showUI = false;
 | 
					            ui.showUI = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            console.log( "获取排行榜后的ui:", data );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            setTimeout(() => { ui.showUI = true; }, 0 );
 | 
					            setTimeout(() => { ui.showUI = true; }, 0 );
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -191,7 +216,7 @@ export default {
 | 
				
			|||||||
         */
 | 
					         */
 | 
				
			||||||
        const refresh = () =>
 | 
					        const refresh = () =>
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            const deparmentInfo:Department =
 | 
					            const deparmentInfo: Department =
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                departmentCode: callerInfo.departmentCode,
 | 
					                departmentCode: callerInfo.departmentCode,
 | 
				
			||||||
                departmentName: callerInfo.departmentName,
 | 
					                departmentName: callerInfo.departmentName,
 | 
				
			||||||
@@ -214,7 +239,7 @@ export default {
 | 
				
			|||||||
        onBeforeMount(() =>
 | 
					        onBeforeMount(() =>
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            // 设置每10分钟刷新一次
 | 
					            // 设置每10分钟刷新一次
 | 
				
			||||||
            timerHandler = setInterval( refresh, 5000 );
 | 
					            timerHandler = setInterval( refresh, 600 * 1000 );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            refresh();
 | 
					            refresh();
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
@@ -222,7 +247,7 @@ export default {
 | 
				
			|||||||
        /**
 | 
					        /**
 | 
				
			||||||
         * 页面卸载前
 | 
					         * 页面卸载前
 | 
				
			||||||
         */
 | 
					         */
 | 
				
			||||||
        onUnmounted(():void =>
 | 
					        onUnmounted((): void =>
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            // 退出页面前关掉定时器
 | 
					            // 退出页面前关掉定时器
 | 
				
			||||||
            clearInterval( timerHandler );
 | 
					            clearInterval( timerHandler );
 | 
				
			||||||
@@ -358,8 +383,26 @@ export default {
 | 
				
			|||||||
    justify-content: center;
 | 
					    justify-content: center;
 | 
				
			||||||
    align-items: flex-start;
 | 
					    align-items: flex-start;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    >*+* {
 | 
					    // >*+* {
 | 
				
			||||||
        margin-top: 15px;
 | 
					    //     margin-top: 15px;
 | 
				
			||||||
 | 
					    // }
 | 
				
			||||||
 | 
					    > h1 {
 | 
				
			||||||
 | 
					        font: {
 | 
				
			||||||
 | 
					            family: "FZ-ZHUOHEI";
 | 
				
			||||||
 | 
					            weight: 100;
 | 
				
			||||||
 | 
					            size: 30px;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        color: $color-bg-04;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        text-align: center;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        width: 300px;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    > div {
 | 
				
			||||||
 | 
					        display: block;
 | 
				
			||||||
 | 
					        height: 260px;
 | 
				
			||||||
 | 
					        width: 300px;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
</style>
 | 
					</style>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user