Commit cffce88f authored by Kimber's avatar Kimber

'up'

parent 5d5c7818
This diff is collapsed.
......@@ -778,24 +778,11 @@
<select style="margin:0 20px;">
<option value="1">淄博市</option>
</select>
<select style="margin:0 20px;">
<option value="370305">临淄区</option>
<option value="370306">周村区</option>
<option value="370302">淄川区</option>
<option value="370303">张店区</option>
<option value="370304">博山区</option>
<option value="370321">桓台县</option>
<option value="370322">高青县</option>
<option value="370323">沂源县</option>
<select style="margin:0 20px;" id="selectArea">
<option v-for="(item, i) in selectArea" :value="item.id">{{item.name}}</option>
</select>
<select style="margin:0 20px;width:120px;" id="selectCompany">
<option value="1">请选择矿山企业</option>
<option value="2">淄博卓正新材料科技有限公司</option>
<option value="3">淄博凯运达运贸有限公司石厂</option>
<option value="4">淄博博望矿业有限责任公司</option>
<option value="5">淄博洪泉石料厂</option>
<option value="6">淄博市淄川区岭子镇杨家村石料厂</option>
<option value="7">山东宝山科技有限公司水泥用灰岩矿</option>
<option v-for="(item, i) in selectUnit" :value="item.id">{{item.name}}</option>
</select>
</div>
</header>
......@@ -1024,6 +1011,9 @@
dm1:{},
dm3:{},
dm4:{},
selectArea:[],
selectUnit:[],
}
},
watch: {
......@@ -1054,14 +1044,23 @@
m.alarmTrend(value);
};
// 加载数据
self.loadData = function(enterpriseId){
enterpriseId = enterpriseId || this.enterpriseId;
// 位移监测
m.requst('get', '/data/mp/countStatistics', {}).then(function(res){
self.dm1 = res
});
var param = {
enterpriseId:enterpriseId,
};
(m.wyjc = function(){
m.requst('get', '/data/mp/countStatistics', param).then(function(res){
self.dm1 = res;
})
})();
// 位移报警趋势
(m.alarmTrend = function(dateRange){
m.requst('get', '/data/mp/alarmTrend', {'dateRange':dateRange}).then(function(res){
m.requst('get', '/data/mp/alarmTrend', {'dateRange':dateRange, enterpriseId:enterpriseId}).then(function(res){
var seriesDataFormat = function(data, opts){
var names = data.names || [], list = data.list || data.lists, series = [], categories = [],
maxVal = 0;
......@@ -1220,7 +1219,7 @@
// 温度监测
(m.wendu = function(dateRange){
m.requst('get', '/data/sz/countStatistics/wen', {}).then(function(res){
m.requst('get', '/data/sz/countStatistics/wen', param).then(function(res){
self.dm3 = res;
});
})();
......@@ -1228,75 +1227,48 @@
// 风速监测
(m.fengsu = function(dateRange){
m.requst('get', '/data/sz/countStatistics/feng', {}).then(function(res){
m.requst('get', '/data/sz/countStatistics/feng', param).then(function(res){
self.dm4 = res;
});
})();
};
// 区域列表
this.reqSelectArea();
var selectArea = document.getElementById("selectArea");
selectArea.onchange = function(e){
var value = this.selectedOptions[0].value;
self.reqEnterprise(value);
};
// 企业选择列表
var selectCompany = document.getElementById("selectCompany");
selectCompany.onchange = function(e){
var tag = e.target || e.srcElement;
window.location.reload()
}
return ;
if (!token) {
window.open(host + '/#/login', '_self')
return
}
// 当前矿山
const selectedMineJson = window.localStorage.getItem('kd.selected.mine')
let noMine = false
if (!selectedMineJson) {
noMine = true
} else {
const selectedMine = JSON.parse(selectedMineJson)
// if (!selectedMine || selectedMine.enterpriseId !== this.user.enterpriseId) {
// noMine = true
// } else {
this.selectedMine = selectedMine
// }
}
if (noMine) {
alert('您当前还未选择矿山,请先选择矿山再查看此大屏')
window.history.go(-1)
return
}
if (this.selectedMine.mineType != 2) {
alert('您当前选择的不是露天矿山,请先选择露天矿山,再查看此大屏')
window.history.go(-1)
return
}
this.getData()
// 视频列表
axios.get('/api/video/link-mine', {
var value = this.selectedOptions[0].value;
self.loadData(self.enterpriseId = value);
};
},
methods: {
reqSelectArea(){
axios.get(LOCAL_API + '/api/yingji/deptandenterprise/dept').then(res => {
this.selectArea = res.body;
this.reqEnterprise(res.body[0].id);
});
},
reqEnterprise(value){
var req = {
params: {
mineType: this.selectedMine.mineType,
mineId: this.selectedMine.id,
deptId:value
}
}).then(resopnse => {
this.videos = []
let firstVideo = null
resopnse.data.results.forEach(vm => {
let video = {
'id': vm.id,
'videoUrl': null,
'name': vm.name,
'videoId': vm.videoId,
'deviceId': vm.deviceId
}
firstVideo = firstVideo || video
this.videos.push(video)
})
if (firstVideo) {
this.chickVideo(firstVideo, 0)
}
})
};
axios.get(LOCAL_API + '/api/yingji/deptandenterprise/enterprise', req).then(res => {
var body = res.body || [];
this.selectUnit = body;
body[0] && (this.enterpriseId = body[0].id);
this.loadData();
});
},
methods: {
// video
updatePlayerDomSize() {
let dom = this.$refs.container;
......
......@@ -805,24 +805,11 @@
<select style="margin:0 20px;">
<option value="1">淄博市</option>
</select>
<select style="margin:0 20px;">
<option value="370305">临淄区</option>
<option value="370306">周村区</option>
<option value="370302">淄川区</option>
<option value="370303">张店区</option>
<option value="370304">博山区</option>
<option value="370321">桓台县</option>
<option value="370322">高青县</option>
<option value="370323">沂源县</option>
<select style="margin:0 20px;" id="selectArea">
<option v-for="(item, i) in selectArea" :value="item.id">{{item.name}}</option>
</select>
<select style="margin:0 20px;width:120px;" id="selectCompany">
<option value="1">请选择矿山企业</option>
<option value="2">淄博卓正新材料科技有限公司</option>
<option value="3">淄博凯运达运贸有限公司石厂</option>
<option value="4">淄博博望矿业有限责任公司</option>
<option value="5">淄博洪泉石料厂</option>
<option value="6">淄博市淄川区岭子镇杨家村石料厂</option>
<option value="7">山东宝山科技有限公司水泥用灰岩矿</option>
<option v-for="(item, i) in selectUnit" :value="item.id">{{item.name}}</option>
</select>
</div>
</header>
......@@ -996,6 +983,9 @@
return {
dm1:{},
dm3:{},
selectArea:[],
selectUnit:[],
}
},
watch: {
......@@ -1016,19 +1006,27 @@
return res
})
};
var amd33 = self.$el.querySelector("#amd33");
var wrap33 = amd33.querySelector(".wrap");
// 加载数据
self.loadData = function(enterpriseId){
enterpriseId = enterpriseId || this.enterpriseId;
// 位移监测
var param = {
enterpriseId:enterpriseId,
};
// 年度降水总量
m.requst('get', '/data/rg/rainfall-year', {}).then(function(res){
m.requst('get', '/data/rg/rainfall-year', param).then(function(res){
self.dm1 = res
});
// 24小时各监测点降水量
(m.alarmTrend = function(){
m.requst('get', '/data/rg/rainfallDay', {}).then(function(res){
m.requst('get', '/data/rg/rainfallDay', param).then(function(res){
var seriesDataFormat = function(data, opts){
var names = data.names || [], list = data.list || data.lists, series = [], categories = [], maxVal = 0;
if(names[0] && list){
......@@ -1177,75 +1175,50 @@
// 降水监测
(m.jiangshui = function(dateRange){
m.requst('get', '/data/rg/countStatistics', {}).then(function(res){
m.requst('get', '/data/rg/countStatistics', param).then(function(res){
self.dm3 = res;
});
})();
};
// 区域列表
this.reqSelectArea();
var selectArea = document.getElementById("selectArea");
selectArea.onchange = function(e){
var value = this.selectedOptions[0].value;
self.reqEnterprise(value);
};
// 企业选择列表
var selectCompany = document.getElementById("selectCompany");
selectCompany.onchange = function(e){
var tag = e.target || e.srcElement;
window.location.reload()
var value = this.selectedOptions[0].value;
self.loadData(self.enterpriseId = value);
};
},
methods: {
reqSelectArea(){
axios.get(LOCAL_API + '/api/yingji/deptandenterprise/dept').then(res => {
this.selectArea = res.body;
this.reqEnterprise(res.body[0].id);
});
},
reqEnterprise(value){
var req = {
params: {
deptId:value
}
};
axios.get(LOCAL_API + '/api/yingji/deptandenterprise/enterprise', req).then(res => {
var body = res.body || [];
this.selectUnit = body;
body[0] && this.loadData(this.enterpriseId = body[0].id);
});
},
return ;
if (!token) {
window.open(host + '/#/login', '_self')
return
}
// 当前矿山
const selectedMineJson = window.localStorage.getItem('kd.selected.mine')
let noMine = false
if (!selectedMineJson) {
noMine = true
} else {
const selectedMine = JSON.parse(selectedMineJson)
// if (!selectedMine || selectedMine.enterpriseId !== this.user.enterpriseId) {
// noMine = true
// } else {
this.selectedMine = selectedMine
// }
}
if (noMine) {
alert('您当前还未选择矿山,请先选择矿山再查看此大屏')
window.history.go(-1)
return
}
if (this.selectedMine.mineType != 2) {
alert('您当前选择的不是露天矿山,请先选择露天矿山,再查看此大屏')
window.history.go(-1)
return
}
this.getData()
// ------------------------------------------
// 视频列表
axios.get('/api/video/link-mine', {
params: {
mineType: this.selectedMine.mineType,
mineId: this.selectedMine.id,
}
}).then(resopnse => {
this.videos = []
let firstVideo = null
resopnse.data.results.forEach(vm => {
let video = {
'id': vm.id,
'videoUrl': null,
'name': vm.name,
'videoId': vm.videoId,
'deviceId': vm.deviceId
}
firstVideo = firstVideo || video
this.videos.push(video)
})
if (firstVideo) {
this.chickVideo(firstVideo, 0)
}
})
},
methods: {
// video
updatePlayerDomSize() {
let dom = this.$refs.container;
......
......@@ -64,12 +64,13 @@ module.exports = {
},
plugins: [
// https://www.ydyno.com/archives/1260.html 使用gzip解压缩静态文件
new CompressionPlugin({
/* new CompressionPlugin({
test: /\.(js|css|html)?$/i, // 压缩文件格式
filename: '[path].gz[query]', // 压缩后的文件名
algorithm: 'gzip', // 使用gzip压缩
minRatio: 0.8 // 压缩率小于1才会压缩
})
}) */
]
},
chainWebpack(config) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment