加入物联网卡日期
This commit is contained in:
parent
395a68e71b
commit
d79087f7ec
@ -575,6 +575,13 @@ cameraStop(cameraSerialNumber,cameraChannelNumber,num) {
|
||||
selUserbyid(data){
|
||||
return sendGetRequest(`/sel/userbyid/`+data, ``)
|
||||
},
|
||||
// 获取物联网卡号
|
||||
qibenGeticcid(data){
|
||||
return sendPostRequest(`/qiben/geticcid`, data)
|
||||
},
|
||||
popupwindow(data){
|
||||
return sendGetRequest(`/qiben/popupwindow`, data)
|
||||
},
|
||||
//根据设备ID获取设备状态值
|
||||
selControlPermissions(data){
|
||||
return sendGetRequest(`/getcontrol/selControlPermissions`, data)
|
||||
@ -881,4 +888,5 @@ getIccid(data){
|
||||
getInsectChartData(data){
|
||||
return sendPostParamsRequest(`/v1/getInsectChartData`, data)
|
||||
},
|
||||
|
||||
};
|
||||
|
@ -879,6 +879,14 @@ textarea {
|
||||
color: #859BB6;
|
||||
}
|
||||
|
||||
.el-notification__content p {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.color-red {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.outline {
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
@ -2070,12 +2078,18 @@ textarea {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.realTime .page-content .page-iccid {
|
||||
margin-top: -15px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.realTime .page-content .control-view {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: absolute;
|
||||
right: 30px;
|
||||
top: 10px;
|
||||
max-width: 50%;
|
||||
}
|
||||
|
||||
.realTime .page-content .control-view .title {
|
||||
@ -2086,7 +2100,7 @@ textarea {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
overflow: hidden;
|
||||
max-width: 806px;
|
||||
max-width: calc(100% - 62px);
|
||||
}
|
||||
|
||||
.realTime .page-content .control-view .control-list > div {
|
||||
|
@ -944,7 +944,14 @@ textarea {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.el-notification__content{
|
||||
p{
|
||||
word-break: break-all;
|
||||
}
|
||||
}
|
||||
.color-red{
|
||||
color: red;
|
||||
}
|
||||
.outline {
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
@ -2198,14 +2205,17 @@ textarea {
|
||||
&.control-page {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.page-iccid{
|
||||
margin-top: -15px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.control-view {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: absolute;
|
||||
right: 30px;
|
||||
top: 10px;
|
||||
|
||||
max-width: 50%;
|
||||
.title {
|
||||
margin-right: 10px;
|
||||
}
|
||||
@ -2215,7 +2225,7 @@ textarea {
|
||||
align-items: center;
|
||||
|
||||
overflow: hidden;
|
||||
max-width: 806px;
|
||||
max-width: calc(100% - 62px);
|
||||
|
||||
>div {
|
||||
// width: 100%!important;
|
||||
|
@ -208,6 +208,7 @@ export function realTimeLine(id, data,pageId) {
|
||||
|
||||
|
||||
})
|
||||
// 默认只显示第0个
|
||||
if(!selTure){
|
||||
dataList.forEach((el, index) => {
|
||||
selList[el.name]=(index==0?true:false)
|
||||
@ -376,25 +377,25 @@ export function realTimeLine1(id, data,pageId) {
|
||||
var Xdata = []
|
||||
|
||||
// var equipmentList=store.state.equipmentSelList
|
||||
var equipmentList=JSON.parse(localStorage.getItem('equipmentSelList'))
|
||||
var equipmentList=JSON.parse(localStorage.getItem('equipmentSelList')?localStorage.getItem('equipmentSelList'):'[]')
|
||||
|
||||
var list = []
|
||||
var selList={}
|
||||
var selTure=false
|
||||
var dataList = []
|
||||
// equipmentList.forEach(obj => {
|
||||
// if (obj.deviceId == pageId) {
|
||||
// // 在找到的对象中添加参数
|
||||
// if(obj.selList){
|
||||
// selList = obj.selList;
|
||||
// selTure=true
|
||||
// }else{
|
||||
// selList ={}
|
||||
// selTure=false
|
||||
// }
|
||||
equipmentList.forEach(obj => {
|
||||
if (obj.deviceId == pageId) {
|
||||
// 在找到的对象中添加参数
|
||||
if(obj.selList1){
|
||||
selList = obj.selList1;
|
||||
selTure=true
|
||||
}else{
|
||||
selList ={}
|
||||
selTure=false
|
||||
}
|
||||
|
||||
// }
|
||||
// });
|
||||
}
|
||||
});
|
||||
data.forEach((el, index) => {
|
||||
Xdata.push(el.time)
|
||||
|
||||
@ -411,11 +412,12 @@ export function realTimeLine1(id, data,pageId) {
|
||||
|
||||
|
||||
})
|
||||
// if(!selTure){
|
||||
// dataList.forEach((el, index) => {
|
||||
// selList[el.name]=(index==0?true:false)
|
||||
// })
|
||||
// }
|
||||
// 默认全部显示
|
||||
if(!selTure){
|
||||
dataList.forEach((el, index) => {
|
||||
selList[el.name]=true
|
||||
})
|
||||
}
|
||||
dataList.forEach((el, index) => {
|
||||
list.push({
|
||||
name: el.name,
|
||||
@ -557,16 +559,16 @@ export function realTimeLine1(id, data,pageId) {
|
||||
option && myChart.setOption(option);
|
||||
myChart.resize();
|
||||
|
||||
// myChart.on('legendselectchanged', function (params) {
|
||||
// equipmentList.forEach((obj,index) => {
|
||||
// if (obj.deviceId== pageId) {
|
||||
// // 在找到的对象中添加参数
|
||||
// obj.selList=params.selected
|
||||
myChart.on('legendselectchanged', function (params) {
|
||||
equipmentList.forEach((obj,index) => {
|
||||
if (obj.deviceId== pageId) {
|
||||
// 在找到的对象中添加参数
|
||||
obj.selList1=params.selected
|
||||
|
||||
// }
|
||||
// });
|
||||
// localStorage.setItem('equipmentSelList', JSON.stringify(equipmentList))
|
||||
// });
|
||||
}
|
||||
});
|
||||
localStorage.setItem('equipmentSelList', JSON.stringify(equipmentList))
|
||||
});
|
||||
window.addEventListener("resize", function () {
|
||||
myChart.resize();
|
||||
});
|
||||
@ -579,25 +581,25 @@ export function realTimeLine2(id, data,pageId) {
|
||||
var Xdata = []
|
||||
|
||||
// var equipmentList=store.state.equipmentSelList
|
||||
var equipmentList=JSON.parse(localStorage.getItem('equipmentSelList'))
|
||||
// var equipmentList=JSON.parse(localStorage.getItem('equipmentSelList'))
|
||||
|
||||
var list = []
|
||||
var selList={}
|
||||
var selTure=false
|
||||
var dataList = []
|
||||
equipmentList.forEach(obj => {
|
||||
if (obj.deviceId == pageId) {
|
||||
// 在找到的对象中添加参数
|
||||
if(obj.selList){
|
||||
selList = obj.selList;
|
||||
selTure=true
|
||||
}else{
|
||||
selList ={}
|
||||
selTure=false
|
||||
}
|
||||
// equipmentList.forEach(obj => {
|
||||
// if (obj.deviceId == pageId) {
|
||||
// // 在找到的对象中添加参数
|
||||
// if(obj.selList){
|
||||
// selList = obj.selList;
|
||||
// selTure=true
|
||||
// }else{
|
||||
// selList ={}
|
||||
// selTure=false
|
||||
// }
|
||||
|
||||
}
|
||||
});
|
||||
// }
|
||||
// });
|
||||
data.forEach((el, index) => {
|
||||
Xdata.push(el.time)
|
||||
|
||||
@ -736,16 +738,16 @@ export function realTimeLine2(id, data,pageId) {
|
||||
option && myChart.setOption(option);
|
||||
myChart.resize();
|
||||
|
||||
myChart.on('legendselectchanged', function (params) {
|
||||
equipmentList.forEach((obj,index) => {
|
||||
if (obj.deviceId== pageId) {
|
||||
// 在找到的对象中添加参数
|
||||
obj.selList=params.selected
|
||||
// myChart.on('legendselectchanged', function (params) {
|
||||
// equipmentList.forEach((obj,index) => {
|
||||
// if (obj.deviceId== pageId) {
|
||||
// // 在找到的对象中添加参数
|
||||
// obj.selList=params.selected
|
||||
|
||||
}
|
||||
});
|
||||
localStorage.setItem('equipmentSelList', JSON.stringify(equipmentList))
|
||||
});
|
||||
// }
|
||||
// });
|
||||
// localStorage.setItem('equipmentSelList', JSON.stringify(equipmentList))
|
||||
// });
|
||||
window.addEventListener("resize", function () {
|
||||
myChart.resize();
|
||||
});
|
||||
|
@ -12,6 +12,7 @@ export default new Vuex.Store({
|
||||
equipmentSelList:[],//存储当前echarts的sel数组
|
||||
equipmentIndex: 1,//当前在第几个设备
|
||||
equipmentName: null,//当前设备 小设备的各个名字
|
||||
iccidList:[],//各个设备iccid的数组
|
||||
nameList: ['One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Elven', 'Twelve', 'Thirteen', 'Fourteen', 'Fifteen', 'Sixteen'],
|
||||
formulaNum: [16, 48, 80, 112, 144, 176, 208, 240],
|
||||
ControlData:null,//控制器五方数据
|
||||
|
@ -317,6 +317,43 @@ export default {
|
||||
return 'formula'
|
||||
}
|
||||
},
|
||||
|
||||
getQibenGeticcid(){
|
||||
const store = this.$store.state
|
||||
var data=this.devicesList.map(device => ({
|
||||
deviceId: device.deviceId,
|
||||
iccid: device.iccidcode,
|
||||
deviceName: device.deviceTypeName
|
||||
}));
|
||||
var userInfo = localStorage.getItem('userInfo') ? JSON.parse(localStorage.getItem('userInfo')) : { userid: -1 }
|
||||
|
||||
this.api.qibenGeticcid(data).then(res=>{
|
||||
if(res.data.code==200){
|
||||
this.$store.state.iccidList=res.data.data
|
||||
|
||||
this.api.popupwindow({userId:userInfo.userid}).then(res1=>{
|
||||
if(res1.data.data){
|
||||
res.data.data.forEach((el,index)=>{
|
||||
if(el.expired){
|
||||
setTimeout(() => {
|
||||
this.$notify({
|
||||
title: '提示',
|
||||
dangerouslyUseHTMLString: true,
|
||||
message: `<div><span class="color-red">${el.deviceName}</span>卡号为${el.iccid},物联网卡即将到期,剩余时间<span class="color-red">${el.daysDifference}天</span>,请联系管理员。</div>`,
|
||||
duration:60000,//10s自动关闭
|
||||
});
|
||||
}, 10);
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}else if(res.data.code==500){
|
||||
this.$store.state.iccidList=res.data.data
|
||||
}
|
||||
})
|
||||
},
|
||||
//获取设备
|
||||
getEqbyid(selTrue) {
|
||||
const that = this
|
||||
@ -325,6 +362,11 @@ export default {
|
||||
this.api.selUserbyid(userInfo.userid).then((res) => {
|
||||
if (res.data.code == 200) {
|
||||
var data=res.data.data.devices
|
||||
this.devicesList=res.data.data.devices
|
||||
if(selTrue){
|
||||
this.getQibenGeticcid(data)
|
||||
}
|
||||
|
||||
this.$store.state.equipmentList =data.map((item, index) => {
|
||||
return {
|
||||
...item,
|
||||
|
@ -134,6 +134,7 @@ export default {
|
||||
pageSize: 999,
|
||||
isEquipment: store.equipmentList[index - 1].deviceName == 30 ? 1 : 0
|
||||
}
|
||||
var data1 = store.equipmentList[index - 1].deviceId
|
||||
this.api.selFsTime(data).then(res => {
|
||||
this.loading.close()
|
||||
if (res.data.code == 200) {
|
||||
@ -149,10 +150,11 @@ export default {
|
||||
})
|
||||
};
|
||||
});
|
||||
realTimeLine1('realTime-line', chartsData)
|
||||
|
||||
realTimeLine1('realTime-line', chartsData,data1)
|
||||
} else {
|
||||
var chartsData=[]
|
||||
realTimeLine1('realTime-line', chartsData)
|
||||
realTimeLine1('realTime-line', chartsData,data1)
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
})
|
||||
|
@ -36,7 +36,7 @@
|
||||
</div>
|
||||
<!-- 控制器/施肥机 -->
|
||||
<div class="page-content new-data" v-else :class="deviceName !=1 ? 'control-page' : ''">
|
||||
|
||||
<div class="page-iccid"><span>iccid:{{$store.state.equipmentList[indexs - 1].iccidcode}}</span> <span>到期时间: </span><span :class="getPackageTimeColor()?'color-red':''">{{getPackageTime()}}<span v-if="getPackageTimeColor()">(即将到期)</span></span> </div>
|
||||
<div class="control-view" v-if="deviceName !=1">
|
||||
<div class="title" @click='weatherModel = true'>气象站:</div>
|
||||
<vue-seamless class="control-list" :data="controlList" :class-option="defaultOption1">
|
||||
@ -758,8 +758,6 @@ export default {
|
||||
that.player = null
|
||||
}
|
||||
that.dataInit();
|
||||
|
||||
|
||||
}, 0);
|
||||
},
|
||||
},
|
||||
@ -771,6 +769,7 @@ export default {
|
||||
this.deviceState = store.equipmentList[this.indexs - 1].deviceState
|
||||
// this.getTime()
|
||||
|
||||
|
||||
|
||||
setTimeout(() => {
|
||||
that.dataInit();
|
||||
@ -795,6 +794,16 @@ export default {
|
||||
this.$bus.$off('refreshTime')
|
||||
},
|
||||
methods: {
|
||||
getPackageTime(){
|
||||
var item= this.$store.state.iccidList.find(item=>item.iccid==this.$store.state.equipmentList[this.indexs - 1].iccidcode)
|
||||
|
||||
return item? item.packageTime:'无数据'
|
||||
},
|
||||
getPackageTimeColor(){
|
||||
var item= this.$store.state.iccidList.find(item=>item.iccid==this.$store.state.equipmentList[this.indexs - 1].iccidcode)
|
||||
|
||||
return item? item.expired:false
|
||||
},
|
||||
openVolt(){
|
||||
this.voltModel=true
|
||||
},
|
||||
|
@ -44,9 +44,9 @@ module.exports = {
|
||||
},
|
||||
proxy: {
|
||||
"/api": {
|
||||
target: 'https://api.lihe-control.com', //地址
|
||||
// target: 'https://api.lihe-control.com', //地址
|
||||
// target: 'http://jiaxingtest.a1.luyouxia.net:21114', //地址
|
||||
// target: 'http://jiaxingtest.a1.luyouxia.net:25762', //地址
|
||||
target: 'http://jiaxingtest.a1.luyouxia.net:25762', //地址
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
"^/api": "",
|
||||
|
Loading…
x
Reference in New Issue
Block a user