接口调试,首页数据渲染

This commit is contained in:
BianLzhaoMin 2024-10-11 18:01:58 +08:00
parent d71f82eaf4
commit 35c2972e15
6 changed files with 183 additions and 122 deletions

View File

@ -1,16 +1,20 @@
{ // launch.json configurations app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
// launchtypelocalremote, localremote
"version": "0.0",
"configurations": [{
"app-plus" :
{
"launchtype" : "local"
},
"default" :
{
"launchtype" : "local"
},
"type" : "uniCloud"
}
{
// launch.json configurations app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
// launchtypelocalremote, localremote
"version" : "0.0",
"configurations" : [
{
"app-plus" : {
"launchtype" : "local"
},
"default" : {
"launchtype" : "local"
},
"type" : "uniCloud"
},
{
"playground" : "custom",
"type" : "uni-app:app-android"
}
]
}

10
api/phaseTwo/homePage.js Normal file
View File

@ -0,0 +1,10 @@
import request from '@/utils/request'
// 获取首页数据
export function getHomePageListApi(data) {
return request({
url: '/bmw/homePage/getAppHomePageData',
method: 'post',
data: data
})
}

View File

@ -25,15 +25,15 @@
module.exports = {
// baseUrl:'/prod-api',
// http://192.168.0.14:19999
// loginBaseUrl:'http://112.29.103.165:1616',
loginBaseUrl:'http://192.168.0.14:27018',
loginBaseUrl: 'http://112.29.103.165:1616',
// loginBaseUrl: 'http://192.168.0.14:27018',
// loginBaseUrl:'http://192.168.0.14:19999',
// baseUrl:'http://192.168.0.14:2900',
baseUrl:'http://192.168.0.14:19999',
baseUrl: 'http://192.168.0.14:19999',
// loginUrl: 'http://112.29.103.165:1616',
login: 'http://192.168.0.14:19200',
// 图片展示基础地址
fileUrl:'http://192.168.0.14:19999/exam-file/',
fileUrl: 'http://192.168.0.14:19999/exam-file/',
// 上传文件地址
uploadUrl: 'http://192.168.0.14:19999/exam-file/file/uploadBase64',
bmwUrl: 'http://192.168.0.14:19999/exam-bmw',
@ -43,21 +43,21 @@ module.exports = {
tjFile: 'http://192.168.0.14:18077/medicalDocumentation/statics/',
//实名制移动端-登录接口
realLoginUrl:'http://192.168.0.14:9200/',
realLoginUrl: 'http://192.168.0.14:9200/',
//实名制移动端-移动
realAppUrl:'http://192.168.0.14:1913/app',
realAppUrl: 'http://192.168.0.14:1913/app',
//实名制移动端-安培
realExamUrl:'http://192.168.0.14:1910',
realExamUrl: 'http://192.168.0.14:1910',
//实名制移动端-文件
realFileUrl:'http://192.168.0.14:1909/file/',
realFileUrl: 'http://192.168.0.14:1909/file/',
//实名制移动端
realBmwUrl:'http://192.168.0.14:1911/bmw',
realBmwUrl: 'http://192.168.0.14:1911/bmw',
// 应用信息
// 应用信息
appInfo: {
// 应用名称
name: "作业管控智慧平台",
name: '作业管控智慧平台',
// 应用版本
version: "1.1.0",
version: '1.1.0'
}
}

View File

@ -5,6 +5,7 @@
</template>
<script>
import { getHomePageListApi } from '@/api/phaseTwo/homePage'
export default {
data() {
return {
@ -143,19 +144,24 @@ export default {
methods: {
getServerData() {
//
setTimeout(() => {
//
let res = {
categories: ['基建线路', '基建变电', '生产线路', '生成变电', '配网', '其他'],
series: [
{
name: '目标值',
data: [35, 36, 31, 33, 13, 34]
}
]
}
this.chartData = JSON.parse(JSON.stringify(res))
}, 500)
getHomePageListApi().then(res => {
const { constructionLine, infrastructureSubstation, productionLine, productionSubstation, network, other } =
res.data.proMsgBean
setTimeout(() => {
//
let data = {
categories: ['基建线路', '基建变电', '生产线路', '生成变电', '配网', '其他'],
series: [
{
name: '目标值',
data: [constructionLine, infrastructureSubstation, productionLine, productionSubstation, network, other]
}
]
}
this.chartData = JSON.parse(JSON.stringify(data))
}, 500)
})
}
}
}

View File

@ -1,10 +1,11 @@
<template>
<view class="charts-box">
<view class="charts-container">
<qiun-data-charts type="rose" :opts="opts" :chartData="chartData" />
</view>
</template>
<script>
import { getHomePageListApi } from '@/api/phaseTwo/homePage'
export default {
data() {
return {
@ -30,8 +31,8 @@ export default {
position: 'right',
lineHeight: 25,
float: 'right',
padding: 5,
margin: 15,
padding: 25,
margin: 5,
backgroundColor: 'rgba(0,0,0,0)',
borderColor: 'rgba(0,0,0,0)',
borderWidth: 0,
@ -90,24 +91,52 @@ export default {
methods: {
getServerData() {
//
setTimeout(() => {
//
let res = {
series: [
{
data: [
{ name: '110kv', value: 8, legendText: `110kv ${31}` },
{ name: '220kv', value: 10, legendText: `110kv ${31}` },
{ name: '500kv', value: 20, legendText: `110kv ${31}` },
{ name: '800kv', value: 18, legendText: `110kv ${31}` },
{ name: '1000kv及以上', value: 6, legendText: `110kv ${31}` },
{ name: '其他', value: 6, legendText: `110kv ${31}` }
]
}
]
}
this.chartData = JSON.parse(JSON.stringify(res))
}, 500)
getHomePageListApi().then(res => {
setTimeout(() => {
const { level110, level220, level500, level800, level1000, levelOther } = res.data.proMsgBean
//
let data = {
series: [
{
data: [
{
name: '110kv',
value: level110,
legendText: `110kv ${level110}`
},
{
name: '220kv',
value: level220,
legendText: `220kv ${level220}`
},
{
name: '500kv',
value: level500,
legendText: `500kv ${level500}`
},
{
name: '800kv',
value: level800,
legendText: `800kv ${level800}`
},
{
name: '1000kv及以上',
value: level1000,
legendText: `1000kv及以上 ${level1000}`
},
{
name: '其他',
value: levelOther,
legendText: `其他 ${levelOther}`
}
]
}
]
}
this.chartData = JSON.parse(JSON.stringify(data))
}, 500)
})
}
}
}

View File

@ -22,8 +22,8 @@
mode=""
></image>
<text>今日考勤6</text>
<text>今日考勤6</text>
<text>今日考勤6</text>
<text>固定人员6</text>
<text>临时人员0</text>
</view>
<view>
<image
@ -31,8 +31,8 @@
src="../../../static/images/img-phase-two/index_img_one_att.png"
mode=""
></image>
<text>在场考勤率20%</text>
<text>计划考勤率20%</text>
<text>在场考勤率80.6%</text>
<text>计划考勤率89.4%</text>
<text class="none-box">计划考勤率20%</text>
</view>
</swiper-item>
@ -47,10 +47,10 @@
<text>今日风险</text>
</view>
<view>
<text>高风险0</text>
<text>中风险0</text>
<text>低风险0</text>
<text>计划作业人数0</text>
<text>高风险{{ einPersonNum }}</text>
<text>中风险{{ mediumRiskNum }}</text>
<text>低风险{{ lowRiskNum }}</text>
<text>计划作业人数{{ planProNum }}</text>
</view>
</swiper-item>
<!-- 轮播图 3 -->
@ -61,9 +61,9 @@
src="../../../static/images/img-phase-two/index_img_three_ein.png"
mode=""
></image>
<text>在场人数6</text>
<text>固定人数6</text>
<text>临时人数6</text>
<text>在场人数{{ einPersonNum }}</text>
<text>固定人数{{ attPersonNum }}</text>
<text>临时人数{{ planPersonNum }}</text>
</view>
<view>
<image
@ -71,9 +71,9 @@
src="../../../static/images/img-phase-two/index_img_three_light.png"
mode=""
></image>
<text>绿灯人数20%</text>
<text>黄灯人数20%</text>
<text>红灯灯人数20%</text>
<text>绿灯人数{{ greenPersonNum }}</text>
<text>黄灯人数{{ yellowPersonNum }}</text>
<text>红灯灯人数{{ redPersonNum }}</text>
</view>
</swiper-item>
<swiper-item class="item_4 swiper-item-container">
@ -86,10 +86,10 @@
<text>项目信息</text>
</view>
<view>
<text>在建工程0</text>
<text>投入分包0</text>
<text>在用班组0</text>
<text>在场人员0</text>
<text>在建工程{{ buildProNum }}</text>
<text>投入分包{{ subNum }}</text>
<text>在用班组{{ teamNum }}</text>
<text>在场人员{{ formalPersonNum }}</text>
</view>
</swiper-item>
</swiper>
@ -98,11 +98,15 @@
<view class="today-warning">
<image class="warning-img" src="../../../static/images/img-phase-two/index_news.png" mode=""></image>
<text>今日风险</text>
<swiper class="swiper-warning" circular>
<swiper-item>高风险0</swiper-item>
<swiper-item>中风险0</swiper-item>
<swiper-item>低风险0</swiper-item>
</swiper>
<view class="uni-notice-bar">
<uni-notice-bar
style="height: 100%"
:speed="30"
background-color="#fff"
scrollable
text="高风险0 中风险0 低风险0 作业计划人数0"
></uni-notice-bar>
</view>
</view>
<!-- 数据概览 -->
@ -247,15 +251,12 @@
<script>
import TabbarConfig from '../util/tabbar.js'
// import face from '../../../uni_modules/mcc-face/index'
import { getStudentStudyWorkList } from '@/api/eduApp'
import config from '@/config'
import AES from '@/utils/realNameAes.js'
import * as echarts from 'echarts'
import PieChartsModel from './components/pie-charts-model'
import BarChartsModel from './components/bar-charts-model'
import PieChartsModelRing from './components/pie-charts-model-ring'
import { getHomePageListApi } from '@/api/phaseTwo/homePage'
export default {
components: {
PieChartsModel,
@ -385,35 +386,32 @@ export default {
project_num: 160,
textColor: '#25c294'
}
]
],
/* 轮播图数据源 */
einPersonNum: 0,
mediumRiskNum: 0,
lowRiskNum: 0,
planProNum: 0,
redPersonNum: 0,
yellowPersonNum: 0,
greenPersonNum: 0,
einPersonNum: 0,
attPersonNum: 0,
planPersonNum: 0,
buildProNum: 0,
subNum: 0,
teamNum: 0,
subNum: 0,
formalPersonNum: 0
}
},
onLoad() {
console.log('?? ~ mounted ~ mounted-index:')
this.getLogin()
// this.getMsgList()
this.getHomePageListData()
},
onLoad() {
setTimeout(() => {
//
let res = {
series: [
{
data: [
{ name: '110kv', value: 8, labelShow: false },
{ name: '220kv', value: 10, labelShow: false },
{ name: '500kv', value: 20, labelShow: false },
{ name: '800kv', value: 18, labelShow: false },
{ name: '1000kv及以上', value: 6, labelShow: false },
{ name: '其他', value: 6, labelShow: false }
]
}
]
}
this.chartData = JSON.parse(JSON.stringify(res))
}, 500)
},
methods: {
getLogin() {
const realParams = {
@ -593,18 +591,32 @@ export default {
//
this.pieChart.setOption(option)
},
/* 获取首页数据 */
async getHomePageListData() {
const { data: res } = await getHomePageListApi({})
// console.log('', res)
// this.swiperInfo = res
this.einPersonNum = res.personAtt.highRiskNum
this.mediumRiskNum = res.personAtt.mediumRiskNum
this.lowRiskNum = res.personAtt.lowRiskNum
this.planProNum = res.personAtt.planProNum
this.redPersonNum = res.personAtt.redPersonNum
this.yellowPersonNum = res.personAtt.yellowPersonNum
this.greenPersonNum = res.personAtt.greenPersonNum
this.einPersonNum = res.personAtt.einPersonNum
this.attPersonNum = res.personAtt.attPersonNum
this.planPersonNum = res.personAtt.planPersonNum
this.buildProNum = res.personAtt.buildProNum
this.teamNum = res.personAtt.teamNum
this.subNum = res.personAtt.subNum
this.formalPersonNum = res.personAtt.formalPersonNum
}
},
onShow() {
// this.initChart()
/*uni.showModal({
title: '人脸识别',
content: '开启人脸识别?',
success:(res) => {
if(res.confirm) this.openFaceScan()
}
})*/
}
onShow() {}
}
</script>
@ -812,10 +824,10 @@ export default {
height: 46rpx;
}
.swiper-warning {
.uni-notice-bar {
flex: 1;
height: 50rpx;
line-height: 50rpx;
// line-height: 50rpx;
// background-color: orange;
}
}