Commit cffce88f authored by Kimber's avatar Kimber

'up'

parent 5d5c7818
...@@ -215,7 +215,7 @@ ...@@ -215,7 +215,7 @@
<div class="f20 color-theme ml10">后台管理</div> <div class="f20 color-theme ml10">后台管理</div>
</div> --> </div> -->
<div class="fixed flex-text maxIndex pointer" style="left: 30px;top: 45px;" <div class="fixed flex-text maxIndex pointer" style="left: 30px;top:3px;"
@click="gotoManagement1()" @click="gotoManagement1()"
:class="isFullScreen?'tr-top':'tr-top-re'"> :class="isFullScreen?'tr-top':'tr-top-re'">
<img style="width: 24px;height: 24px;" src="static/backstage.png" alt=""> <img style="width: 24px;height: 24px;" src="static/backstage.png" alt="">
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
<!-- <div class="fixed wp100 hv100" style="z-index: 199;" @click="showMask = aiShowMask = false" <!-- <div class="fixed wp100 hv100" style="z-index: 199;" @click="showMask = aiShowMask = false"
v-show="showMask || aiShowMask"></div> --> v-show="showMask || aiShowMask"></div> -->
<div class="flex-text" style="margin-top: -20px;"> <div class="flex-text" style="margin-top:70px;">
<div :class="isFullScreen?'tr-left':'tr-left-re'" <div :class="isFullScreen?'tr-left':'tr-left-re'"
class="flex flex-column space-between relative" :style="{ height: 980 / heightScale + 'px', width: 514 * heightScale + 'px' }"> class="flex flex-column space-between relative" :style="{ height: 980 / heightScale + 'px', width: 514 * heightScale + 'px' }">
<!-- 物联网主机 --> <!-- 物联网主机 -->
...@@ -617,12 +617,13 @@ ...@@ -617,12 +617,13 @@
<div class="ml20 mr20 ellipsis">{{ item.mineName }}</div> <div class="ml20 mr20 ellipsis">{{ item.mineName }}</div>
</div> </div>
<div class="flex-1 ovh"> <div class="flex-1 ovh">
<div class="ml20 mr20 ellipsis">{{ item.name }}</div> <div class="ml20 mr20 ellipsis">{{ item.dangerWorkName }}</div>
</div> </div>
<div class="" style="width: 200px;">{{ item.workDate }}</div> <div class="" style="width: 200px;">{{ item.dangerWorkTime }}</div>
<div class="" style="width: 150px;" <div class="" style="width: 150px;"
:class="item.auditState == 1?'color-yellow':item.auditState == 3?'color-red':'color-blue'">{{ :class="item.auditState == 1?'color-yellow':item.auditState == 3?'color-red':'color-blue'">
item.auditState == 1?'审核中':item.auditState == 3?'未通过':'已通过' }}</div> {{['未通过', '审批中;', '已通过'][~~item.state]}}
</div>
<div class="flex-text" style="width: 220px;"> <div class="flex-text" style="width: 220px;">
<!-- <div class="color-white pointer flex-text" <!-- <div class="color-white pointer flex-text"
style="border-bottom: 1px solid #ffffff;height: 28px;box-sizing: border-box;">查看</div> --> style="border-bottom: 1px solid #ffffff;height: 28px;box-sizing: border-box;">查看</div> -->
...@@ -943,7 +944,7 @@ ...@@ -943,7 +944,7 @@
// 在线监测实时报警 list // 在线监测实时报警 list
alarm: [], alarm: [],
// 在线监测报警统计 // 在线监测报警统计
tabs: ['地下矿山人员定位', '地下矿山环境监测', '尾矿库在线监测'], tabs: ['尾矿库在线监测', '地下矿山环境监测', '地下矿山人员定位'],
TabCur: 0, TabCur: 0,
timeSelect: ['近一月', '近半年', '近一年'], timeSelect: ['近一月', '近半年', '近一年'],
active: 0, active: 0,
...@@ -957,7 +958,7 @@ ...@@ -957,7 +958,7 @@
aiAlarm: [], aiAlarm: [],
// 重点在线监测总览 // 重点在线监测总览
overviewTabs: ['地下矿山人员定位', '地下矿山环境监测', '尾矿库在线监测'], overviewTabs: ['尾矿库在线监测', '地下矿山环境监测', '地下矿山人员定位'],
overviewTabCur: 0, overviewTabCur: 0,
overview: [], overview: [],
...@@ -970,7 +971,7 @@ ...@@ -970,7 +971,7 @@
// 饼图弹窗 // 饼图弹窗
isMaskShow: false, isMaskShow: false,
maskTabs: ['全部', '审核中', '已通过', '未通过'], maskTabs: ['全部'/* , '审核中', '已通过', '未通过' */],
maskActive: 0, maskActive: 0,
pieList: [], pieList: [],
...@@ -1068,10 +1069,6 @@ ...@@ -1068,10 +1069,6 @@
var selectCompany = document.getElementById("selectCompany"); var selectCompany = document.getElementById("selectCompany");
selectCompany.onchange = function(e){ selectCompany.onchange = function(e){
var value = this.selectedOptions[0].value; var value = this.selectedOptions[0].value;
//window.location.reload()
self.reqMines(this.enterpriseId = value); self.reqMines(this.enterpriseId = value);
}; };
}, },
...@@ -1083,7 +1080,6 @@ ...@@ -1083,7 +1080,6 @@
this.reqEnterprise(res.body[0].id); this.reqEnterprise(res.body[0].id);
}); });
}, },
reqEnterprise(value){ reqEnterprise(value){
var req = { var req = {
params: { params: {
...@@ -1093,7 +1089,6 @@ ...@@ -1093,7 +1089,6 @@
axios.get(host + '/api/yingji/deptandenterprise/enterprise', req).then(res => { axios.get(host + '/api/yingji/deptandenterprise/enterprise', req).then(res => {
res = res.data; res = res.data;
var body = res.body || []; var body = res.body || [];
console.log('enterprise ________________ ', body);
this.selectUnit = body; this.selectUnit = body;
body[0] && this.reqMines(this.enterpriseId = body[0].id); body[0] && this.reqMines(this.enterpriseId = body[0].id);
...@@ -1445,18 +1440,38 @@ ...@@ -1445,18 +1440,38 @@
dat.addLayer(pulseLink); dat.addLayer(pulseLink);
}, },
left3() { left3(type) {
var req = {
params: {
enterpriseId:this.enterpriseId,
type:(this.active+1) || 1,
}
};
axios.get(host + '/api/yingji/keynoteadmin/opencast-alert', req).then(res => {
res = res.data;
this.left3Charts(res.body)
});
},
left3Charts(body){
var list = body.list;
// 基于准备好的dom,初始化echarts实例 // 基于准备好的dom,初始化echarts实例
var myChart = echarts.init(document.getElementById("main")); var myChart = echarts.init(document.getElementById("main"));
myChart.clear() // 定时刷新 实际不刷新 演示用 myChart.clear() // 定时刷新 实际不刷新 演示用
let xData = [] let xData = []
let yData1 = [] let yData1 = []
let yData2 = [] let yData2 = []
if (this.active === 0) { if(this.TabCur === 0){
xData = ['3/27', '3/28', '3/29', '3/30', '3/31', '4/1', '4/2', '4/3', '4/4', '4/5', '4/6', '4/7', '4/8', '4/9', '4/10', '4/11', '4/12', '4/13', '4/14', '4/15', '4/16', '4/17', '4/18', '4/19', '4/20', '4/21', '4/22', '4/23', '4/24', '4/25'] for(var item of list){
xData.push(item.date);
yData1.push(item.values.alarmCount);
};
};
/* if (this.active === 0) {
xData = ['5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月', '1月', '2月', '3月', '4月']
for (const i in xData) { for (const i in xData) {
yData1.push(Math.round(Math.random() * 10)) yData1.push(Math.round(Math.random() * 40))
yData2.push(Math.round(Math.random() * 10)) yData2.push(Math.round(Math.random() * 40))
} }
} }
if (this.active === 1) { if (this.active === 1) {
...@@ -1467,12 +1482,12 @@ ...@@ -1467,12 +1482,12 @@
} }
} }
if (this.active === 2) { if (this.active === 2) {
xData = ['5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月', '1月', '2月', '3月', '4月'] xData = ['3/27', '3/28', '3/29', '3/30', '3/31', '4/1', '4/2', '4/3', '4/4', '4/5', '4/6', '4/7', '4/8', '4/9', '4/10', '4/11', '4/12', '4/13', '4/14', '4/15', '4/16', '4/17', '4/18', '4/19', '4/20', '4/21', '4/22', '4/23', '4/24', '4/25']
for (const i in xData) { for (const i in xData) {
yData1.push(Math.round(Math.random() * 40)) yData1.push(Math.round(Math.random() * 10))
yData2.push(Math.round(Math.random() * 40)) yData2.push(Math.round(Math.random() * 10))
}
} }
} */
// 绘制图表 // 绘制图表
const bars = [{ const bars = [{
name: this.TabCur === 0 ? '区域报警' : this.TabCur === 1 ? '环境监测报警' : this.TabCur === 2 ? '在线监测报警' : '', name: this.TabCur === 0 ? '区域报警' : this.TabCur === 1 ? '环境监测报警' : this.TabCur === 2 ? '在线监测报警' : '',
...@@ -1497,7 +1512,7 @@ ...@@ -1497,7 +1512,7 @@
}]; }];
const lines = []; const lines = [];
if (this.TabCur === 0) { if (this.TabCur === 0) {
lines.push({ /* lines.push({
name: '人员报警', name: '人员报警',
type: 'line', type: 'line',
smooth: true, smooth: true,
...@@ -1505,7 +1520,7 @@ ...@@ -1505,7 +1520,7 @@
itemStyle: { itemStyle: {
color: '#ffa900' color: '#ffa900'
} }
}); }); */
} }
myChart.setOption({ myChart.setOption({
xAxis: { xAxis: {
...@@ -1568,11 +1583,17 @@ ...@@ -1568,11 +1583,17 @@
}); });
}, },
right2() { right2() {
const pie = (body, data) => {
var list = body.state, workList = body.dangerWorkList;
var seriesData = [];
for(var item of list){
seriesData.push({
value: item.value,
name: item.name + item.value,
label: { color: '#ffffff' }
})
};
const pie = (data) => {
// 基于准备好的dom,初始化echarts实例 // 基于准备好的dom,初始化echarts实例
pieChart = echarts.init(document.getElementById("pie")); pieChart = echarts.init(document.getElementById("pie"));
pieChart.clear() // 定时刷新 实际不刷新 演示用 pieChart.clear() // 定时刷新 实际不刷新 演示用
...@@ -1584,11 +1605,7 @@ ...@@ -1584,11 +1605,7 @@
startAngle: 0, startAngle: 0,
center: ['35%', '50%'], center: ['35%', '50%'],
radius: '70%', radius: '70%',
data: [ data: seriesData,
{ value: data.pass, name: '已通过:' + data.pass, label: { color: '#ffffff' } },
{ value: data.unpass, name: '未通过:' + data.unpass, label: { color: '#ffffff' } },
{ value: data.none, name: '审核中:' + data.none, label: { color: '#ffffff' } }
],
itemStyle: { itemStyle: {
// normal: { // normal: {
// borderWidth: 2, // borderWidth: 2,
...@@ -1601,68 +1618,44 @@ ...@@ -1601,68 +1618,44 @@
// 饼图点击事件 // 饼图点击事件
pieChart.on("click", () => { pieChart.on("click", () => {
this.maskActive = 0 this.maskActive = 0
this.getPieList() this.getPieList(workList)
this.isMaskShow = true this.isMaskShow = true
}); });
} }
console.log('right2 ________________ ', this.enterpriseId);
var req = { var req = {
params: { params: {
enterpriseId:this.enterpriseId, enterpriseId:this.enterpriseId,
auditStatus:'0',
} }
}; };
axios.get(host + '/api/yingji/dangerousworkaudit/dangerwork-list', req).then(res => { axios.get(host + '/api/yingji/dangerousworkaudit/dangerwork-list', req).then(res => {
res = res.data;
return ; if (res && res.body) {
if (res && res.data) { pie(res.body)
pie(res.data)
}
});
return ;
axios.get(host + '/api/datav/dangerous-work/audit-state').then(res => {
if (res && res.data) {
pie(res.data)
} }
}); });
}, },
right3() { right3() {
if (this.overviewTabCur === 0) { if (this.overviewTabCur === 0) {
console.log('right3 ________________ ', this.overviewTabCur); var req = {
params: {
enterpriseId:this.enterpriseId,
}
};
axios.get(host + '/api/yingji/keynoteadmin/opencast-admin', req).then(res => {
const rn1 = Math.round(Math.random() * 60) res = res.data;
const rn2 = Math.round(Math.random() * rn1) var body = res.body || {}, list = body.list || [];
const rn3 = Math.round(Math.random() * 10)
const rn4 = Math.round(Math.random() * 10)
const rn5 = Math.round(Math.random() * 100)
const rn6 = Math.round(Math.random() * 100)
this.overview = [ this.overview = [
{ text: '井下作业人数', percent: rn1, legend: rn1 + '' }, { text: list[0].name, percent: list[0].num, legend: list[0].num + '' },
{ text: '带班领导下井数', percent: rn2, legend: rn2 + '' }, { text: list[1].name, percent: list[1].num, legend: list[1].num + '' },
{ text: '人员报警数量', percent: rn3, legend: rn3 + '' }, { text: list[2].name, percent: list[2].num, legend: list[2].num + '' },
{ text: '区域报警数量', percent: rn4, legend: rn4 + '' }, { text: list[3].name, percent: list[3].num, legend: list[3].num + '' },
{ text: '人员报警处置率', percent: rn5, legend: rn5 + '%' }, { text: list[4].name, percent: list[4].num, legend: list[4].num + '%' },
{ text: '区域报警处置率', percent: rn6, legend: rn6 + '%' } { text: list[5].name, percent: list[5].num, legend: list[5].num + '%' }
] ]
} });
if(this.overviewTabCur === 1){
const rn1 = Math.round(Math.random() * 20) /* const rn1 = Math.round(Math.random() * 20)
const rn2 = Math.round(Math.random() * rn1) const rn2 = Math.round(Math.random() * rn1)
const rn3 = rn1 - rn2 const rn3 = rn1 - rn2
const rn4 = Math.floor(rn3 * 100 / rn1) const rn4 = Math.floor(rn3 * 100 / rn1)
...@@ -1675,9 +1668,9 @@ ...@@ -1675,9 +1668,9 @@
{ text: '设备在线率', percent: rn4, legend: rn4 + '%' }, { text: '设备在线率', percent: rn4, legend: rn4 + '%' },
{ text: '当月报警数量', percent: rn5, legend: rn5 + '个' }, { text: '当月报警数量', percent: rn5, legend: rn5 + '个' },
{ text: '报警处理率', percent: rn6, legend: rn6 + '%' } { text: '报警处理率', percent: rn6, legend: rn6 + '%' }
] ] */
} }
if(this.overviewTabCur === 2){ if(this.overviewTabCur === 1){
const rn1 = Math.round(Math.random() * 20) const rn1 = Math.round(Math.random() * 20)
const rn2 = Math.round(Math.random() * rn1) const rn2 = Math.round(Math.random() * rn1)
const rn3 = rn1 - rn2 const rn3 = rn1 - rn2
...@@ -1693,6 +1686,22 @@ ...@@ -1693,6 +1686,22 @@
{ text: '报警处理率', percent: rn6, legend: rn6 + '%' } { text: '报警处理率', percent: rn6, legend: rn6 + '%' }
] ]
} }
if(this.overviewTabCur === 2){
const rn1 = Math.round(Math.random() * 60)
const rn2 = Math.round(Math.random() * rn1)
const rn3 = Math.round(Math.random() * 10)
const rn4 = Math.round(Math.random() * 10)
const rn5 = Math.round(Math.random() * 100)
const rn6 = Math.round(Math.random() * 100)
this.overview = [
{ text: '井下作业人数', percent: rn1, legend: rn1 + '' },
{ text: '带班领导下井数', percent: rn2, legend: rn2 + '' },
{ text: '人员报警数量', percent: rn3, legend: rn3 + '' },
{ text: '区域报警数量', percent: rn4, legend: rn4 + '' },
{ text: '人员报警处置率', percent: rn5, legend: rn5 + '%' },
{ text: '区域报警处置率', percent: rn6, legend: rn6 + '%' }
]
}
}, },
async getData(refesh) { async getData(refesh) {
...@@ -1724,7 +1733,7 @@ ...@@ -1724,7 +1733,7 @@
this.right2(); this.right2();
this.right3(); this.right3();
if(this.marker[0]){ if(this.marker && this.marker[0]){
// 在线实时报警 // 在线实时报警
this.alarm = [ this.alarm = [
{ id: 1, name: this.marker[1].name, equipment: '氧气浓度', day: '2023-05-25', time: '00:49:48', statusTxt: '已处理', status: 1 }, { id: 1, name: this.marker[1].name, equipment: '氧气浓度', day: '2023-05-25', time: '00:49:48', statusTxt: '已处理', status: 1 },
...@@ -1746,12 +1755,16 @@ ...@@ -1746,12 +1755,16 @@
_5minus(); _5minus();
setTimeout(() => this.getData('refesh'), 15 * 1000);// 10秒一个刷新周期 setTimeout(() => this.getData('refesh'), 60 * 1000);// 10秒一个刷新周期
}, },
// 危险作业列表 // 危险作业列表
getPieList() { getPieList(workList) {
this.pieList = [] this.pieList = workList;
console.log('workList ________________ ', workList);
return ;
this.pieList = [];
// 0~3 '全部', '审批中', '已通过', '未通过' // 0~3 '全部', '审批中', '已通过', '未通过'
const state = this.maskActive const state = this.maskActive
axios.get(host + '/api/datav/dangerous-work', { axios.get(host + '/api/datav/dangerous-work', {
...@@ -1761,8 +1774,7 @@ ...@@ -1761,8 +1774,7 @@
count: 6 count: 6
} }
}).then(res => { }).then(res => {
this.pieList = res && res.data && res.data.results this.pieList = res && res.data && res.data.results;
console.log(this.pieList)
}) })
}, },
...@@ -1790,7 +1802,7 @@ ...@@ -1790,7 +1802,7 @@
clickActive(index){ clickActive(index){
this.active = index; this.active = index;
this.showMask = false; this.showMask = false;
this.left3() this.left3(index)
}, },
// 切换重点在线监测总览 // 切换重点在线监测总览
......
...@@ -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