高支模接口调试

This commit is contained in:
BianLzhaoMin 2025-04-24 16:05:20 +08:00
parent fbcd295e18
commit 14fc0201c0
9 changed files with 262 additions and 104 deletions

View File

@ -15,6 +15,18 @@ export function getModeGroupAPI() {
method: 'post',
})
}
// 高支模监测 ---- 位移监测、沉降监测、重量监测接口
/**
*
* @data 参数中有个 type字段 123 对应位移监测沉降监测重量监测
*/
export function getAttrListAPI(data) {
return request({
url: '/smart-site/screen/devModel/getAttrList',
method: 'post',
data,
})
}
// 高支模监测 ---- 设备统计接口 右二
export function getDevStatisticsAPI(data) {
return request({

View File

@ -0,0 +1,46 @@
import request from '@/utils/request'
// 劳务实名制---- 单位人数统计接口 左一
export function getSgUserByUnitAPI(data) {
return request({
url: '/smart-site/screen/subContract/getSgUserByUnit',
method: 'post',
data,
})
}
// 高支模监测 ---- 获取高支模分组
// export function getModeGroupAPI() {
// return request({
// url: '/smart-site/screen/devModel/getModeGroup',
// method: 'post',
// })
// }
// // 高支模监测 ---- 位移监测、沉降监测、重量监测接口
// /**
// *
// * @data 参数中有个 type字段 1、2、3 对应位移监测、沉降监测、重量监测
// */
// export function getAttrListAPI(data) {
// return request({
// url: '/smart-site/screen/devModel/getAttrList',
// method: 'post',
// data,
// })
// }
// // 高支模监测 ---- 设备统计接口 右二
// export function getDevStatisticsAPI(data) {
// return request({
// url: '/smart-site/screen/devModel/getDevStatistics',
// method: 'post',
// data,
// })
// }
// // 高支模监测 ---- 报警信息接口 右三
// export function getWarnInfoAPI(data) {
// return request({
// url: '/smart-site/screen/devModel/getWarnInfo',
// method: 'post',
// data,
// })
// }
//

View File

@ -12,18 +12,23 @@ import ChartsBox from '@/components/ChartsBox/index'
import * as echarts from 'echarts'
// require('echarts/theme/macarons')
import 'echarts/theme/macarons'
import { getAttrListAPI } from '@/api/home-high-formwork.js'
export default {
components: { ChartsBox },
props: {
queryLineId: {
type: [String, Number],
default: () => '',
},
},
data() {
return {
chart: null,
xData: [],
yData: [],
}
},
mounted() {
this.$nextTick(() => {
this.initChart()
})
},
mounted() {},
beforeDestroy() {
if (!this.chart) {
return
@ -46,20 +51,10 @@ export default {
this.chart.setOption({
xAxis: {
type: 'category',
data: [
'00:00',
'03:00',
'06:00',
'09:00',
'12:00',
'15:00',
'18:00',
'21:00',
'24:00',
],
data: this.xData,
boundaryGap: false,
axisTick: { show: true },
axisLabel: { color: '#4494db' },
axisLabel: { color: '#fff' },
axisLine: {
lineStyle: { color: '#4494db' },
},
@ -70,6 +65,7 @@ export default {
axisLine: {
lineStyle: { color: '#4494db' },
},
axisLabel: { color: '#fff' },
// y线线
splitLine: {
lineStyle: {
@ -96,17 +92,7 @@ export default {
name: '数量',
type: 'line',
smooth: true, // 线
data: [
{ value: 12, name: '00:00' },
{ value: 25, name: '03:00' },
{ value: 30, name: '06:00' },
{ value: 18, name: '09:00' },
{ value: 12, name: '12:00' },
{ value: 16, name: '15:00' },
{ value: 19, name: '18:00' },
{ value: 23, name: '21:00' },
{ value: 13, name: '24:00' },
],
data: this.yData,
itemStyle: {
color: '#1AD8E6 ',
},
@ -190,6 +176,46 @@ export default {
this.chart.resize()
}
},
async getAttrListData(devId) {
const { data: res } = await getAttrListAPI({
type: 1,
devId,
})
console.log(
`%c🔍 高支模监测 ----> 位移监测(中一) 数据出参 %c`,
'background: linear-gradient(90deg, #FF6B6B, #4ECDC4); color: white; padding: 5px 10px; border-radius: 5px; font-weight: bold;',
'',
res,
)
if (res.length > 0) {
this.xData = res.map((e) => e.name)
this.yData = res
} else {
this.xData = ['暂无数据']
this.yData = [
{
name: '暂无数据',
value: 0,
},
]
}
this.$nextTick(() => {
this.initChart()
})
},
},
watch: {
queryLineId: {
handler(newValue) {
this.getAttrListData(newValue)
},
deep: true,
},
},
}
</script>

View File

@ -12,17 +12,26 @@ import ChartsBox from '@/components/ChartsBox/index'
import * as echarts from 'echarts'
// require('echarts/theme/macarons')
import 'echarts/theme/macarons'
import { getAttrListAPI } from '@/api/home-high-formwork.js'
export default {
components: { ChartsBox },
props: {
queryLineId: {
type: [String, Number],
default: () => '',
},
},
data() {
return {
chart: null,
xData: [],
yData: [],
}
},
mounted() {
this.$nextTick(() => {
this.initChart()
})
// this.$nextTick(() => {
// this.initChart()
// })
},
beforeDestroy() {
if (!this.chart) {
@ -46,20 +55,10 @@ export default {
this.chart.setOption({
xAxis: {
type: 'category',
data: [
'00:00',
'03:00',
'06:00',
'09:00',
'12:00',
'15:00',
'18:00',
'21:00',
'24:00',
],
data: this.xData,
boundaryGap: false,
axisTick: { show: true },
axisLabel: { color: '#4494db' },
axisLabel: { color: '#fff' },
axisLine: {
lineStyle: { color: '#4494db' },
},
@ -67,6 +66,7 @@ export default {
},
yAxis: {
axisTick: { show: false },
axisLabel: { color: '#fff' },
axisLine: {
lineStyle: { color: '#4494db' },
},
@ -96,17 +96,7 @@ export default {
name: '数量',
type: 'line',
smooth: true, // 线
data: [
{ value: 12, name: '00:00' },
{ value: 25, name: '03:00' },
{ value: 30, name: '06:00' },
{ value: 18, name: '09:00' },
{ value: 12, name: '12:00' },
{ value: 16, name: '15:00' },
{ value: 19, name: '18:00' },
{ value: 23, name: '21:00' },
{ value: 13, name: '24:00' },
],
data: this.yData,
itemStyle: {
color: '#F1FF2B',
},
@ -208,6 +198,44 @@ export default {
this.chart.resize()
}
},
async getAttrListData(devId) {
const { data: res } = await getAttrListAPI({
type: 3,
devId,
})
console.log(
`%c🔍 高支模监测 ----> 位移监测(中一) 数据出参 %c`,
'background: linear-gradient(90deg, #FF6B6B, #4ECDC4); color: white; padding: 5px 10px; border-radius: 5px; font-weight: bold;',
'',
res,
)
if (res.length > 0) {
this.xData = res.map((e) => e.name)
this.yData = res
} else {
this.xData = ['暂无数据']
this.yData = [
{
name: '暂无数据',
value: 0,
},
]
}
this.$nextTick(() => {
this.initChart()
})
},
},
watch: {
queryLineId: {
handler(newValue) {
this.getAttrListData(newValue)
},
deep: true,
},
},
}
</script>

View File

@ -12,17 +12,26 @@ import ChartsBox from '@/components/ChartsBox/index'
import * as echarts from 'echarts'
// require('echarts/theme/macarons')
import 'echarts/theme/macarons'
import { getAttrListAPI } from '@/api/home-high-formwork.js'
export default {
components: { ChartsBox },
props: {
queryLineId: {
type: [String, Number],
default: () => '',
},
},
data() {
return {
chart: null,
xData: [],
yData: [],
}
},
mounted() {
this.$nextTick(() => {
this.initChart()
})
// this.$nextTick(() => {
// this.initChart()
// })
},
beforeDestroy() {
if (!this.chart) {
@ -46,20 +55,10 @@ export default {
this.chart.setOption({
xAxis: {
type: 'category',
data: [
'00:00',
'03:00',
'06:00',
'09:00',
'12:00',
'15:00',
'18:00',
'21:00',
'24:00',
],
data: this.xData,
boundaryGap: false,
axisTick: { show: true },
axisLabel: { color: '#4494db' },
axisLabel: { color: '#fff' },
axisLine: {
lineStyle: { color: '#4494db' },
},
@ -67,6 +66,7 @@ export default {
},
yAxis: {
axisTick: { show: false },
axisLabel: { color: '#fff' },
axisLine: {
lineStyle: { color: '#4494db' },
},
@ -96,17 +96,7 @@ export default {
name: '数量',
type: 'line',
smooth: true, // 线
data: [
{ value: 12, name: '00:00' },
{ value: 25, name: '03:00' },
{ value: 30, name: '06:00' },
{ value: 18, name: '09:00' },
{ value: 12, name: '12:00' },
{ value: 16, name: '15:00' },
{ value: 19, name: '18:00' },
{ value: 23, name: '21:00' },
{ value: 13, name: '24:00' },
],
data: this.yData,
itemStyle: {
color: '#1A72E6',
},
@ -208,6 +198,44 @@ export default {
this.chart.resize()
}
},
async getAttrListData(devId) {
const { data: res } = await getAttrListAPI({
type: 2,
devId,
})
console.log(
`%c🔍 高支模监测 ----> 位移监测(中一) 数据出参 %c`,
'background: linear-gradient(90deg, #FF6B6B, #4ECDC4); color: white; padding: 5px 10px; border-radius: 5px; font-weight: bold;',
'',
res,
)
if (res.length > 0) {
this.xData = res.map((e) => e.name)
this.yData = res
} else {
this.xData = ['暂无数据']
this.yData = [
{
name: '暂无数据',
value: 0,
},
]
}
this.$nextTick(() => {
this.initChart()
})
},
},
watch: {
queryLineId: {
handler(newValue) {
this.getAttrListData(newValue)
},
deep: true,
},
},
}
</script>

View File

@ -8,6 +8,7 @@
class="device-item"
v-for="(item, index) in deviceList"
:key="index"
@click="onHandleDevice(index, item.id)"
>
<img
:src="
@ -18,12 +19,12 @@
alt=""
/>
<span
:style="item.isOnline == 1 ? 'color:#71C4FF' : ''"
:style="activeIndex === index ? 'color:#0ff' : ''"
>
{{ item.devName }}
</span>
<span
:style="item.isOnline == 1 ? 'color:#71C4FF' : ''"
:style="activeIndex === index ? 'color:#0ff' : ''"
>
{{ item.devCode }}
</span>
@ -60,6 +61,7 @@ export default {
data() {
return {
deviceList: [],
activeIndex: 0,
}
},
methods: {
@ -72,8 +74,17 @@ export default {
res,
)
if (res.length > 0) {
this.$emit('onQueryLineDataById', res[0].id)
}
this.deviceList = res
},
onHandleDevice(index, id) {
console.log(index, id, '996')
this.activeIndex = index
this.$emit('onQueryLineDataById', id)
},
},
watch: {
queryId: {
@ -94,19 +105,6 @@ export default {
align-items: center;
color: #fff;
font-size: 12px;
// transform: translateY(10px);
// .device-item {
// display: flex;
// flex-direction: column;
// align-items: center;
// justify-content: center;
// img {
// width: 30px;
// height: 30px;
// }
// }
.scroll-container {
flex: 1; //

View File

@ -2,10 +2,13 @@
<!-- 高支模监测-->
<div class="home-high-formwork">
<div class="env-1">
<LeftOneModel :queryId="queryId" />
<LeftOneModel
:queryId="queryId"
@onQueryLineDataById="onQueryLineDataById"
/>
</div>
<div class="env-2">
<CenterOneModel />
<CenterOneModel :queryLineId="queryLineId" />
</div>
<div class="env-3">
<RightThreeModel @handleQueryById="handleQueryById" />
@ -14,13 +17,13 @@
<LeftTwoModel />
</div>
<div class="env-5">
<CenterTwoModel />
<CenterTwoModel :queryLineId="queryLineId" />
</div>
<div class="env-6">
<RightOneModel :queryId="queryId" />
</div>
<div class="env-7">
<CenterThreeModel />
<CenterThreeModel :queryLineId="queryLineId" />
</div>
<div class="env-8">
<RightTwoModel :queryId="queryId" />
@ -53,12 +56,16 @@ export default {
data() {
return {
queryId: null,
queryLineId: '',
}
},
methods: {
handleQueryById(id) {
this.queryId = id
},
onQueryLineDataById(id) {
this.queryLineId = id
},
},
}
</script>

View File

@ -4,7 +4,7 @@
<ChartsBox :boxTitle="`单位人数统计`">
<div class="container">
<div v-for="item in personList" :key="item.name">
<span> {{ item.num }} </span>
<span> {{ item.value }} </span>
<span> {{ item.name }} </span>
</div>
</div>
@ -14,17 +14,29 @@
<script>
import ChartsBox from '@/components/ChartsBox/index'
import { getSgUserByUnitAPI } from '@/api/home-real-name-system.js'
export default {
components: { ChartsBox },
data() {
return {
personList: [
{ name: '建设单位人数', num: 99 },
{ name: '施工单位人数', num: 99 },
{ name: '监理单位人数', num: 99 },
// { name: '', num: 99 },
// { name: '', num: 99 },
// { name: '', num: 99 },
],
}
},
methods: {
async getSgUserByUnitData() {
const { data: res } = await getSgUserByUnitAPI()
this.personList = res
console.log('res', res)
},
},
created() {
this.getSgUserByUnitData()
},
}
</script>

View File

@ -24,7 +24,8 @@ module.exports = {
open: true,
proxy: {
[process.env.VUE_APP_BASE_API]: {
target: 'http://192.168.0.60:38080', // 赵福海
// target: 'http://192.168.0.60:38080', // 赵福海
target: 'http://192.168.0.38:38080', // 郝志权
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: '',