深基坑(实时数据):echartsy轴变化 以及单位处理

This commit is contained in:
骆乐 2022-10-10 11:37:51 +08:00
parent 5f514a330b
commit ca076b2f81
2 changed files with 46 additions and 23 deletions

View File

@ -40,7 +40,6 @@ if (process.env.NODE_ENV == 'development') {
// axios.defaults.baseURL = 'http://124.71.178.44:100/' // 河南 // axios.defaults.baseURL = 'http://124.71.178.44:100/' // 河南
// tag: 本地 // tag: 本地
// axios.defaults.baseURL = 'http://192.168.34.174:6023/' // 老大本地 // axios.defaults.baseURL = 'http://192.168.34.174:6023/' // 老大本地
// axios.defaults.baseURL = 'http://192.168.34.125:6023/' //杨意本地 http/1.1
axios.defaults.baseURL = 'http://192.168.34.216:6023/' // 邱平毅本地 axios.defaults.baseURL = 'http://192.168.34.216:6023/' // 邱平毅本地
// axios.defaults.baseURL ='http://124.71.67.160:8088/' //中建四局线上 // axios.defaults.baseURL ='http://124.71.67.160:8088/' //中建四局线上
// axios.defaults.baseURL = 'http://192.168.34.125:6023/' //杨意本地 http/1.1 // axios.defaults.baseURL = 'http://192.168.34.125:6023/' //杨意本地 http/1.1

View File

@ -684,8 +684,8 @@ export default {
echartData7: { echartData7: {
xAxis: [], xAxis: [],
data: [], data: [],
unit: 'mm' },
} unit:'mm',//
}; };
}, },
created() { created() {
@ -716,8 +716,8 @@ export default {
pageNo:this.pageNo1, pageNo:this.pageNo1,
pageSize:this.pageSize1, pageSize:this.pageSize1,
}).then(res => { }).then(res => {
this.echartData7.unit = res.result.unit; this.unit = res.result.unit;
console.log("默认第一次进来的时候单位", res.result) console.log("默认第一次进来的时候单位", this.unit)
if (res.code == 200 && res.result) { if (res.code == 200 && res.result) {
this.total1 = res.result.data.total this.total1 = res.result.data.total
this.tableData2 = res.result.data.records; this.tableData2 = res.result.data.records;
@ -1598,8 +1598,19 @@ export default {
}, },
yAxis: { yAxis: {
type: "value", type: "value",
// name:'/mm', max:function(obj){//线
name:`${'单位/'} ${this.echartData7.unit }`, var ma=obj.max;
var mi=obj.min;
var val=Math.ceil((ma+(ma-mi)/2))
return val
},
min:function(obj){
var ma=obj.max;
var mi=obj.min;
var val=Math.ceil((mi-(ma-mi)/2))
return mi==0?0:val
},
name:`单位/${ this.unit }`,
boundaryGap: [0, '100%'], boundaryGap: [0, '100%'],
splitLine: { splitLine: {
lineStyle: { lineStyle: {
@ -1617,18 +1628,30 @@ export default {
color: "#7F8694" color: "#7F8694"
} }
}, },
dataZoom: [ dataZoom:[
{ {
type: 'inside', type: 'inside', //
start: 0, orient: 'vertical',
end: 20
}, },
{ // {
start: 0, // type: 'inside',
end: 20, // }
top:"90%",
}
], ],
// dataZoom: [
// // {
// // type: 'inside',
// // start: 0,
// // end: 20
// // },
// // {
// // start: 0,
// // end: 20,
// // top:"90%",
// // }
// // {
// // orient: 'vertical',
// // }
// ],
axisPointer: { axisPointer: {
lineStyle: { lineStyle: {
color: "#F4F5F8", color: "#F4F5F8",
@ -1721,6 +1744,7 @@ export default {
return timer; return timer;
}, },
showDetail(val) { showDetail(val) {
console.log('unit',this.unit)
// console.log('',val) // console.log('',val)
this.dateTime = [] this.dateTime = []
this.pageSize1= 10, this.pageSize1= 10,
@ -1728,11 +1752,11 @@ export default {
this.visibleDialog = true; this.visibleDialog = true;
this.relaId = val.id; this.relaId = val.id;
this.selectDeepExcavationAllMeasurePointList(); // this.selectDeepExcavationAllMeasurePointList(); //
// this.$nextTick(() => { this.$nextTick(() => {
// // this.createdEchart5() // this.createdEchart5()
// // this.createdEchart6() // this.createdEchart6()
// this.createdEchart7(); this.createdEchart7();
// }); });
}, },
checkDate(val) { checkDate(val) {
this.searchDate = val; this.searchDate = val;
@ -1830,8 +1854,8 @@ export default {
pageNo:this.pageNo1, pageNo:this.pageNo1,
pageSize:this.pageSize1, pageSize:this.pageSize1,
}).then(res => { }).then(res => {
this.echartData7.unit = res.result.unit this.unit = res.result.unit
console.log('第二个选择时的单位',res.result) // console.log('',this.unit)
if (res.code == 200 && res.result) { if (res.code == 200 && res.result) {
this.total1 = res.result.data.total this.total1 = res.result.data.total
this.tableData2 = res.result.data.records; this.tableData2 = res.result.data.records;