接口联调

This commit is contained in:
binbin_pan 2024-03-21 17:33:54 +08:00
parent 5cb95b07ed
commit 9e23127ce3
5 changed files with 62 additions and 44 deletions

View File

@ -6,19 +6,25 @@
</div>
<div class="sub_title">
<span class="title_text">{{detailsInfo.maName}}</span>
<span class="sub_status">({{detailsInfo.maStatus}})</span>
<!-- <span class="sub_status">({{detailsInfo.maStatus}})</span> -->
<span class="sub_status" v-if="detailsInfo.maStatus === '20'">(待租)</span>
<span class="sub_status" v-else-if="detailsInfo.maStatus === '110'">(租赁中)</span>
<span class="sub_status" v-else-if="detailsInfo.maStatus === '10'">(自有)</span>
</div>
<div class="more_info">
<!-- <span style="padding-left: 0;">操作重量7 </span> -->
<!-- <span>
铲斗容量2立方米
</span> -->
<span>
租赁方{{detailsInfo.needCompany}}
<span v-if="detailsInfo.maStatus === '110'">
租赁方{{detailsInfo.receiverName || '暂无'}}
</span>
<span>
租赁日期{{ detailsInfo.planStartTime }}&nbsp;{{ detailsInfo.duration }}
<span v-if="detailsInfo.maStatus === '110'">
租赁日期{{ detailsInfo.planStartTime || '暂无' }}
</span>
<span v-if="detailsInfo.maStatus === '110'">租赁时长{{ detailsInfo.duration }}{{
detailsInfo.leasingMethod === null ? '暂无' : detailsInfo.leasingMethod === 0 ? '天' : '月'
}}</span>
</div>
<div class="time_select">
<el-date-picker v-model="timeRange" size="default" type="datetimerange" :unlink-panels="true"
@ -47,8 +53,9 @@ const detailsInfo = reactive({
duration: '',
maName: '',
maStatus: '',
needCompany: '',
planStartTime: ''
receiverName: '',
planStartTime: '',
leasingMethod: null
})
// const shortcuts = [
// {
@ -87,7 +94,7 @@ const initApiBmaDevInfoList = async (maId:any) => {
detailsInfo.duration = res.duration
detailsInfo.maName = res.maName
detailsInfo.maStatus = res.maStatus
detailsInfo.needCompany = res.needCompany
detailsInfo.receiverName = res.receiverName
detailsInfo.planStartTime = res.planStartTime
} catch (error) {
@ -113,6 +120,8 @@ let startLonLat: any = reactive([
}
])
const open = (data:any) => {
// console.log("data",data)
if (!data) return
// data.value
startLonLat[0].lon = data.value[0]
startLonLat[0].lat = data.value[1]

View File

@ -5,9 +5,6 @@
</div>
<div class="e_content">
<div class="left_nav_list">
<!--
移入后的样式 小手
-->
<div class="nav_item" v-for="(item, index) in navInfo.list" :key="index"
:class="{ 'activeNav': mapProps.idType == item.navId }" @click="toNavItem(item)">
{{ item.text }}
@ -15,7 +12,8 @@
</div>
<!-- <h1>{{ mapProps.seriesData }}</h1> -->
<div class="right_map_container">
<mapEcharts v-if="mapProps.seriesData.length > 0" ref="mapEchartsRef" :jsonData="mapProps.jsonData"
<mapEcharts v-if="mapProps.seriesData.length > 0" ref="mapEchartsRef"
:idType="mapProps.idType" :jsonData="mapProps.jsonData"
:itemStyle="mapProps.itemStyle" :emphasisLabelStyle="mapProps.emphasisLabelStyle"
:emphasisItemStyle="mapProps.emphasisItemStyle" :labelInfo="mapProps.labelInfo"
:rippleEffect="mapProps.rippleEffect" :tooltipProps="mapProps.tooltipProps"
@ -80,44 +78,45 @@ const navInfo = reactive({
navId: "0",
jsonData: xnallJSON,
},
{
text: "广西电网",
navId: "1",
jsonData: gxJSON
},
{
text: "广东电网",
navId: "2",
jsonData: gdJSON
},
{
text: "贵州电网",
navId: "3",
jsonData: gzJSON
text: "广西电网",
navId: "1",
jsonData: gxJSON
},
{
text: "云南电网",
navId: "4",
jsonData: ynJSON
},
{
text: "贵州电网",
navId: "3",
jsonData: gzJSON
},
{
text: "海南电网",
navId: "5",
jsonData: hnJSON
},
{
text: "储能公司",
navId: "6",
},
// {
// text: "",
// navId: "6",
// },
{
text: "深圳供电局",
navId: "7",
jsonData: szJSON
},
{
text: "超高压公司",
navId: "8"
}
// {
// text: "",
// navId: "8"
// }
]
})

View File

@ -88,10 +88,15 @@ const propsVal: any = defineProps({
},
})
const initEcharts = () => {
echarts.registerMap('guangdong', propsVal.jsonData)
// console.log("propsval__>>>", propsVal.idType, propsVal)
const name = propsVal.jsonData.features[0].properties.name
echarts.registerMap(name, propsVal.jsonData)
nextTick(() => {
const domitem = document.getElementById("mapEcharts" + propsVal.idType)
const map = echarts.init(domitem, null, {
const domitem: any = document.getElementById("mapEcharts" + propsVal.idType)
if (echarts.getInstanceByDom(domitem)) {// echarts
echarts.dispose(domitem);
}
const map = echarts.init(domitem, null, {// echarts
renderer: 'canvas',
})
const option = {
@ -101,9 +106,14 @@ const initEcharts = () => {
trigger: 'item',//
},
geo: {
map: 'guangdong',
map: name,
zoom: 1,
roam: true,
//
scaleLimit: {
min: 0.5,
max: 99
},
label: propsVal.labelInfo,
//
itemStyle: propsVal.itemStyle,
@ -120,7 +130,7 @@ const initEcharts = () => {
},
series: [
{
name: 'Top 5',
name,
type: 'effectScatter',
colorBy: 'series',
effectType: 'ripple',
@ -164,8 +174,7 @@ const chartClickEventListener = (mychart: any) => {
const chagneJSON = (item: any) => {
console.log("propsval", propsVal)
propsVal.idType = item.navId
// propsVal.idType = item.navId
setTimeout(() => {
initEcharts()
})

View File

@ -35,13 +35,13 @@ const initMap = () => {
const startIcon = {
imgUrl: new URL('/src/assets/img/mapStart.png', import.meta.url).href,
position: [linePointList[0].lng, linePointList[0].lat],
size: [60, 60]
size: [50, 50]
}
const endIcon = {
imgUrl: new URL('/src/assets/img/mapEnd.png', import.meta.url).href,
position: [linePointList[linePointList.length - 1].lng, linePointList[linePointList.length - 1].lat],
size: [60, 60]
size: [50, 50]
}
initIcon(startIcon.imgUrl, startIcon.position, startIcon.size)
@ -108,8 +108,8 @@ const initPolylineAnimation = () => {
}
const initIcon = (imgUrl: any, position: any, size: any) => {
// var myIcon = new BMapGL.Icon("https://api.map.baidu.com/img/markers.png", new BMapGL.Size(60, 60));
var myIcon = new BMapGL.Icon(imgUrl, new BMapGL.Size(60, 60));
// var myIcon = new BMapGL.Icon("https://api.map.baidu.com/img/markers.png", new BMapGL.Size(50, 50));
var myIcon = new BMapGL.Icon(imgUrl, new BMapGL.Size(50, 50));
// Marker使
var pt = new BMapGL.Point(...position);
var marker = new BMapGL.Marker(pt, {

View File

@ -379,11 +379,11 @@ const barComPropsHorizontal = reactive({
const pie3DList = reactive({
list: [
//
{name: 'Chrome', y: 61.41},
{name: 'Internet Explorer', y: 11.84},
{name: 'Firefox', y: 10.85},
{name: 'Edge', y: 4.67},
{name: 'Safari', y: 4.18},
// ['Chrome', 1],
// ['Internet Explorer', 2],
// ['Firefox', 3],
// ['Edge', 4],
// ['Safari', 5]
]
})
onMounted(() => {
@ -440,6 +440,7 @@ const iniTapiMaDevInfoCompanyList = async () => {
resultList.push(item)
})
pie3DList.list = resultList
// console.log("pie3DList", pie3DList.list)
} catch (error) {
console.log(error)
}