接口调试,首页数据渲染

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/ {
// launch.json configurations app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
// launchtypelocalremote, localremote // launchtypelocalremote, localremote
"version": "0.0", "version" : "0.0",
"configurations": [{ "configurations" : [
"app-plus" :
{ {
"app-plus" : {
"launchtype" : "local" "launchtype" : "local"
}, },
"default" : "default" : {
{
"launchtype" : "local" "launchtype" : "local"
}, },
"type" : "uniCloud" "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 = { module.exports = {
// baseUrl:'/prod-api', // baseUrl:'/prod-api',
// http://192.168.0.14:19999 // http://192.168.0.14:19999
// loginBaseUrl:'http://112.29.103.165:1616', loginBaseUrl: 'http://112.29.103.165:1616',
loginBaseUrl:'http://192.168.0.14:27018', // loginBaseUrl: 'http://192.168.0.14:27018',
// loginBaseUrl:'http://192.168.0.14:19999', // loginBaseUrl:'http://192.168.0.14:19999',
// baseUrl:'http://192.168.0.14:2900', // 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', // loginUrl: 'http://112.29.103.165:1616',
login: 'http://192.168.0.14:19200', 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', uploadUrl: 'http://192.168.0.14:19999/exam-file/file/uploadBase64',
bmwUrl: 'http://192.168.0.14:19999/exam-bmw', bmwUrl: 'http://192.168.0.14:19999/exam-bmw',
@ -43,21 +43,21 @@ module.exports = {
tjFile: 'http://192.168.0.14:18077/medicalDocumentation/statics/', 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: { appInfo: {
// 应用名称 // 应用名称
name: "作业管控智慧平台", name: '作业管控智慧平台',
// 应用版本 // 应用版本
version: "1.1.0", version: '1.1.0'
} }
} }

View File

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

View File

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

View File

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