Commit cffce88f authored by Kimber's avatar Kimber

'up'

parent 5d5c7818
This diff is collapsed.
...@@ -778,24 +778,11 @@ ...@@ -778,24 +778,11 @@
<select style="margin:0 20px;"> <select style="margin:0 20px;">
<option value="1">淄博市</option> <option value="1">淄博市</option>
</select> </select>
<select style="margin:0 20px;"> <select style="margin:0 20px;" id="selectArea">
<option value="370305">临淄区</option> <option v-for="(item, i) in selectArea" :value="item.id">{{item.name}}</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> </select>
<select style="margin:0 20px;width:120px;" id="selectCompany"> <select style="margin:0 20px;width:120px;" id="selectCompany">
<option value="1">请选择矿山企业</option> <option v-for="(item, i) in selectUnit" :value="item.id">{{item.name}}</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>
</select> </select>
</div> </div>
</header> </header>
...@@ -1024,6 +1011,9 @@ ...@@ -1024,6 +1011,9 @@
dm1:{}, dm1:{},
dm3:{}, dm3:{},
dm4:{}, dm4:{},
selectArea:[],
selectUnit:[],
} }
}, },
watch: { watch: {
...@@ -1054,14 +1044,23 @@ ...@@ -1054,14 +1044,23 @@
m.alarmTrend(value); m.alarmTrend(value);
}; };
// 加载数据
self.loadData = function(enterpriseId){
enterpriseId = enterpriseId || this.enterpriseId;
// 位移监测 // 位移监测
m.requst('get', '/data/mp/countStatistics', {}).then(function(res){ var param = {
self.dm1 = res enterpriseId:enterpriseId,
}); };
(m.wyjc = function(){
m.requst('get', '/data/mp/countStatistics', param).then(function(res){
self.dm1 = res;
})
})();
// 位移报警趋势 // 位移报警趋势
(m.alarmTrend = function(dateRange){ (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 seriesDataFormat = function(data, opts){
var names = data.names || [], list = data.list || data.lists, series = [], categories = [], var names = data.names || [], list = data.list || data.lists, series = [], categories = [],
maxVal = 0; maxVal = 0;
...@@ -1220,7 +1219,7 @@ ...@@ -1220,7 +1219,7 @@
// 温度监测 // 温度监测
(m.wendu = function(dateRange){ (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; self.dm3 = res;
}); });
})(); })();
...@@ -1228,75 +1227,48 @@ ...@@ -1228,75 +1227,48 @@
// 风速监测 // 风速监测
(m.fengsu = function(dateRange){ (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; 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"); var selectCompany = document.getElementById("selectCompany");
selectCompany.onchange = function(e){ selectCompany.onchange = function(e){
var tag = e.target || e.srcElement; var value = this.selectedOptions[0].value;
window.location.reload() self.loadData(self.enterpriseId = value);
} };
},
return ; methods: {
if (!token) { reqSelectArea(){
window.open(host + '/#/login', '_self') axios.get(LOCAL_API + '/api/yingji/deptandenterprise/dept').then(res => {
return this.selectArea = res.body;
} this.reqEnterprise(res.body[0].id);
// 当前矿山 });
const selectedMineJson = window.localStorage.getItem('kd.selected.mine') },
let noMine = false reqEnterprise(value){
if (!selectedMineJson) { var req = {
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: { params: {
mineType: this.selectedMine.mineType, deptId:value
mineId: this.selectedMine.id,
} }
}).then(resopnse => { };
this.videos = [] axios.get(LOCAL_API + '/api/yingji/deptandenterprise/enterprise', req).then(res => {
let firstVideo = null var body = res.body || [];
resopnse.data.results.forEach(vm => { this.selectUnit = body;
let video = { body[0] && (this.enterpriseId = body[0].id);
'id': vm.id, this.loadData();
'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 // video
updatePlayerDomSize() { updatePlayerDomSize() {
let dom = this.$refs.container; let dom = this.$refs.container;
......
...@@ -805,24 +805,11 @@ ...@@ -805,24 +805,11 @@
<select style="margin:0 20px;"> <select style="margin:0 20px;">
<option value="1">淄博市</option> <option value="1">淄博市</option>
</select> </select>
<select style="margin:0 20px;"> <select style="margin:0 20px;" id="selectArea">
<option value="370305">临淄区</option> <option v-for="(item, i) in selectArea" :value="item.id">{{item.name}}</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> </select>
<select style="margin:0 20px;width:120px;" id="selectCompany"> <select style="margin:0 20px;width:120px;" id="selectCompany">
<option value="1">请选择矿山企业</option> <option v-for="(item, i) in selectUnit" :value="item.id">{{item.name}}</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>
</select> </select>
</div> </div>
</header> </header>
...@@ -996,6 +983,9 @@ ...@@ -996,6 +983,9 @@
return { return {
dm1:{}, dm1:{},
dm3:{}, dm3:{},
selectArea:[],
selectUnit:[],
} }
}, },
watch: { watch: {
...@@ -1016,19 +1006,27 @@ ...@@ -1016,19 +1006,27 @@
return res return res
}) })
}; };
var amd33 = self.$el.querySelector("#amd33"); var amd33 = self.$el.querySelector("#amd33");
var wrap33 = amd33.querySelector(".wrap"); 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 self.dm1 = res
}); });
// 24小时各监测点降水量 // 24小时各监测点降水量
(m.alarmTrend = function(){ (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 seriesDataFormat = function(data, opts){
var names = data.names || [], list = data.list || data.lists, series = [], categories = [], maxVal = 0; var names = data.names || [], list = data.list || data.lists, series = [], categories = [], maxVal = 0;
if(names[0] && list){ if(names[0] && list){
...@@ -1177,75 +1175,50 @@ ...@@ -1177,75 +1175,50 @@
// 降水监测 // 降水监测
(m.jiangshui = function(dateRange){ (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; 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"); var selectCompany = document.getElementById("selectCompany");
selectCompany.onchange = function(e){ selectCompany.onchange = function(e){
var tag = e.target || e.srcElement; var value = this.selectedOptions[0].value;
window.location.reload() 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 // video
updatePlayerDomSize() { updatePlayerDomSize() {
let dom = this.$refs.container; let dom = this.$refs.container;
......
...@@ -64,12 +64,13 @@ module.exports = { ...@@ -64,12 +64,13 @@ module.exports = {
}, },
plugins: [ plugins: [
// https://www.ydyno.com/archives/1260.html 使用gzip解压缩静态文件 // https://www.ydyno.com/archives/1260.html 使用gzip解压缩静态文件
new CompressionPlugin({
/* new CompressionPlugin({
test: /\.(js|css|html)?$/i, // 压缩文件格式 test: /\.(js|css|html)?$/i, // 压缩文件格式
filename: '[path].gz[query]', // 压缩后的文件名 filename: '[path].gz[query]', // 压缩后的文件名
algorithm: 'gzip', // 使用gzip压缩 algorithm: 'gzip', // 使用gzip压缩
minRatio: 0.8 // 压缩率小于1才会压缩 minRatio: 0.8 // 压缩率小于1才会压缩
}) }) */
] ]
}, },
chainWebpack(config) { 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