123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- let UserId = getlocation('userId')
- // 看板数据请求函数
- async function resfn() {
- let UserId = getlocation('userId')
- let res = await getRequest('api/v1/LargeDataScreen/AllMakerData?t='+Math.random(6),JSON.stringify({}));
- handle1(res)
- };
- async function res1fn() {
- let res_1 = await getRequest('api/v1/LargeDataScreen/ExhibitionData?t=' + Math.random(6), JSON.stringify({}));
- handle3(res_1)
- };
- async function res2fn() {
- let times = 0;
- let res_2 = await getRequest('api/v1/LargeDataScreen/MakerListCount?t=' + Math.random(6), JSON.stringify({
- PageSize: 30,
- PageNum: times++
- }));
- if (res_2.data.length < 30) {
- res_2 = await getRequest('api/v1/LargeDataScreen/MakerListCount?t=' + Math.random(6), JSON.stringify({
- PageSize: 30,
- PageNum: times
- }));
- }
- handle2(res_2)
- };
- async function res3fn() {
- let UserId = getlocation('userId')
- let res_3 = await getRequest('api/v1/LargeDataScreen/MakerSort?t=' + Math.random(6), JSON.stringify({UserId}));
- let res_4 = await getRequest('api/v1/LargeDataScreen/MakerFlowingWaterSort?t=' + Math.random(6), JSON.stringify({UserId}));
- let res_5 = await getRequest('api/v1/LargeDataScreen/MakerIncomeSort?t=' + Math.random(6), JSON.stringify({}));
- handle4(res_3,res_4,res_5)
- };
- async function res6fn() {
- let UserId = getlocation('userId')
- let res_6 = await getRequest('api/v1/LargeDataScreen/TeamPerformanceYear?t=' + Math.random(6), JSON.stringify({
- UserId
- }));
- let res_7 = await getRequest('api/v1/LargeDataScreen/TradeTwoWeeks?t=' + Math.random(6), JSON.stringify({
- UserId
- }));
- handle6(res_6,res_7)
- };
- async function res10fn() {
- let UserId = getlocation('userId')
- let res_10 = await getRequest('api/v1/LargeDataScreen/MonthTradePercentage?t=' + Math.random(6), JSON.stringify({
- UserId
- }));
- let res_11 = await getRequest('api/v1/LargeDataScreen/MonthMakerAddPercentages?t=' + Math.random(6), JSON.stringify({
- UserId
- }));
- handle5(res_10,res_11);
- handle7(res_10)
- handle8(res_11)
- };
- async function res12fn() {
- let UserId = getlocation('userId')
- let res_12 = await getRequest('api/v1/LargeDataScreen/ModelTypeCount?t=' + Math.random(6), JSON.stringify({
- UserId
- }));
- handle9(res_12)
- };
- async function res13fn() {
- let UserId = getlocation('userId')
- let res_13 = await getRequest('api/v1/LargeDataScreen/ModelTypeTradeCount?t=' + Math.random(6), JSON.stringify({
- UserId
- }));
- handle10(res_13)
- };
- function init() {
- // 创客总数,今日新增
- resfn()
- // 全国展业数据
- res1fn()
- // 列表数据
- res2fn()
- //排行榜数据
- res3fn()
- // 折线图
- res6fn()
- // 月度交易额环比
- res10fn()
- //机具统计
- res12fn()
- res13fn()
- };
- gettoken();
- showmap();
- init();
- // 固定周期进行数据请求
- // setInterval(init,1000);
- $("#nowtime").text('创业帮数据看板欢迎您!');
- setInterval(async () => {
- init();
- }, 20000);
- setInterval(async () => {
- const time = `${new Date().getFullYear()}年${fillZero(new Date().getMonth()+1)}月${fillZero(new Date().getDate())}日 ${fillZero(new Date().getHours())}:${fillZero(new Date().getMinutes())}:${fillZero(new Date().getSeconds())}`
- $("#nowtime").text(time);
- }, 1000);
- // 2022年10月20日 12:20:15
- fillZero = function (val) {
- if (val < 10) {
- return '0' + val
- } else {
- return val
- }
- }
|