接口调试,首页数据渲染
This commit is contained in:
parent
d71f82eaf4
commit
35c2972e15
|
|
@ -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/
|
||||||
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
|
||||||
"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"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 获取首页数据
|
||||||
|
export function getHomePageListApi(data) {
|
||||||
|
return request({
|
||||||
|
url: '/bmw/homePage/getAppHomePageData',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -25,8 +25,8 @@
|
||||||
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',
|
||||||
|
|
@ -56,8 +56,8 @@ module.exports = {
|
||||||
// 应用信息
|
// 应用信息
|
||||||
appInfo: {
|
appInfo: {
|
||||||
// 应用名称
|
// 应用名称
|
||||||
name: "作业管控智慧平台",
|
name: '作业管控智慧平台',
|
||||||
// 应用版本
|
// 应用版本
|
||||||
version: "1.1.0",
|
version: '1.1.0'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue