Browse Source

看板改变

master
ruanqi 4 years ago
parent
commit
ea6b7bb49e
  1. 12
      public/echarts/echarts.min.js
  2. 3
      public/index.html
  3. 13
      src/router/index.js
  4. 6
      src/views/Home.vue
  5. 207
      src/views/newScheduledBoard.vue
  6. 102
      src/views/newTime.vue
  7. 4
      src/views/orderBoard.vue
  8. 4
      src/views/productOutBoard.vue
  9. 4
      src/views/reportAbnormal.vue
  10. 4
      src/views/scheduledBoard.vue

12
public/echarts/echarts.min.js
File diff suppressed because it is too large
View File

3
public/index.html

@ -10,7 +10,8 @@
href="https://lib.baomitu.com/animate.css/4.1.1/animate.min.css" rel="stylesheet">
<title>看板</title>
<script type="text/javascript" src="jquery/jquery-2.1.4.js"></script>
<script type="text/javascript" src="echarts2/echarts.js"></script>
<!-- <script type="text/javascript" src="echarts2/echarts.js"></script>-->
<script type="text/javascript" src="echarts/echarts.min.js"></script>
<script type="text/javascript" src="bootstrap-3.3.7/js/bootstrap.js"></script>
<script type="text/javascript" src="bootstrap-3.3.7/js/bootstrap-table.js"></script>
<script type="text/javascript" src="export/bootstrap-table-export.js"></script>

13
src/router/index.js

@ -7,14 +7,19 @@ Vue.use(VueRouter);
const routes = [
{
path: '/',
name: 'Home',
name: 'newBoard',
component: () => import('../views/newScheduledBoard.vue'),
},
{
path: '/111',
name: '111',
component: Home,
path: '/home',
name: 'home',
component:Home,
},
// {
// path: '/',
// name: 'home2',
// component: Home,
// },
{
path: '/orderBoard',
name: 'orderBoard',

6
src/views/Home.vue

@ -106,7 +106,7 @@ export default {
},
getIp(){
console.log(localStorage.getItem("tvIP"))
if (localStorage.getItem("tvIP")==null||localStorage.getItem("tvIP")==""||localStorage.getItem("tvIP")=="1.1.1.1") {
if (localStorage.getItem("tvIP")==null||localStorage.getItem("tvIP")==""||localStorage.getItem("tvIP")=="192.168.1.130") {
$.ajax({
url: "/board/getIpFirst",
type: "post",
@ -117,7 +117,7 @@ export default {
}
}).fail(() => {
localStorage.setItem("tvIP", "1.1.1.1")
localStorage.setItem("tvIP", "192.168.1.130")
})
}
@ -132,7 +132,7 @@ export default {
this.$router.push(this.nextPage);
}
}).fail(() => {
this.$router.push("/")
this.$router.push("/home")
})
},

207
src/views/newScheduledBoard.vue

@ -7,6 +7,9 @@
<div style="height: 40%;width: 100%;text-align: center;margin-top: 3%;">
<label style="font-size: 30px;color: #ffffff">派工单完成状况</label>
</div>
<div style="height: 40%;width: 100%;text-align: center;margin-top: 0%;">
<label id="resourceIdName" style="font-size: 24px;color: #fff300"></label>
</div>
</div>
</div>
<div style="width:100%;height: 79%;">
@ -39,7 +42,7 @@
</template>
<script>
import TimeC from "./time"
import TimeC from "./newTime"
export default {
name: "newScheduledBoard",
data() {
@ -54,7 +57,8 @@
pieList:null,
barList:null,
resourceId:'',
ip:'192.168.1.130'
ip:'',
refreshTime:3,
}
},
components: {
@ -63,6 +67,7 @@
methods: {
searchData(){
let that = this;
that.getRefresh();
$.ajax({
url: "/board/getNewScheduledData",
type: "post",
@ -70,7 +75,7 @@
},
dataType: "json",
success: (data) => {
if (data.number==-1) {
if (data.number==999) {
}else {
that.number1=data.number;
@ -83,13 +88,13 @@
$('#table').bootstrapTable('refresh');
window.setTimeout(() => {
$('#table').bootstrapTable('refresh');
}, 3000);
}, 1000* Number(that.refreshTime));
window.setTimeout(() => {
$('#table').bootstrapTable('refresh');
}, 6000);
}, 2000*Number(that.refreshTime));
window.setTimeout(() => {
$('#table').bootstrapTable('refresh');
}, 9000);
}, 3000*Number(that.refreshTime));
}
}
@ -105,6 +110,7 @@
if (this.myChart!=null) {
this.myChart.clear()
}
$("#resourceIdName").html("设备-"+this.pieList[0].resourceId);
this.option = ({
title: [{
text: '设备:' + this.pieList[0].resourceId,
@ -311,7 +317,7 @@
// this.option2 = null
// }
this.option2 = {
color:["#90ca75", "#ec6566"],
color:["#90ca75", "#00a7ff","#ec6566"],
legend: {
textStyle: { //
color: '#fff',
@ -380,10 +386,11 @@
},
],
yAxis:
yAxis:[
{
type: 'value',
axisLine:{
lineStyle: {
color:'#eee'
}
@ -393,27 +400,106 @@
color:'#eee'
}
},
splitLine:{
show:false,
}
},
{
type: 'value',
// min: 0,
// max: 100,
axisLabel: {
formatter: '{value} %'
},
axisLine:{
lineStyle: {
color:'#eee'
}
},
axisTick: {
lineStyle: {
color:'#eee'
}
},
// splitLine:{
// show:false,
// }
}
],
series: [
{
name: '白班',
type: 'bar',
emphasis: {
'name': '白班产量',
'type': 'bar',
'emphasis': {
focus: 'series'
},
// data: seriesData1
data: [this.barList[6].num1, this.barList[5].num1, this.barList[4].num1, this.barList[3].num1, this.barList[2].num1, this.barList[1].num1, this.barList[0].num1]
'data': [this.barList[6].num1, this.barList[5].num1, this.barList[4].num1, this.barList[3].num1, this.barList[2].num1, this.barList[1].num1, this.barList[0].num1],
'label':{
show:true,
position:'top',
textStyle: {
color: '#fff300',
fontSize: 11
}
},
},
{
name: '晚班',
type: 'bar',
emphasis: {
'name': '晚班产量',
'type': 'bar',
'emphasis': {
focus: 'series'
},
// data: seriesData2
data: [this.barList[6].num2, this.barList[5].num2, this.barList[4].num2, this.barList[3].num2, this.barList[2].num2, this.barList[1].num2, this.barList[0].num2]
}
'data': [this.barList[6].num2, this.barList[5].num2, this.barList[4].num2, this.barList[3].num2, this.barList[2].num2, this.barList[1].num2, this.barList[0].num2],
'label':{
show:true,
position:'top',
textStyle: {
color: '#fff300',
fontSize: 11
}
},
},
{
'name': '当日完成率',
'type': 'line',
yAxisIndex: 1,
'emphasis': {
focus: 'series'
},
// data: seriesData2
'data': [this.barList[6].num3, this.barList[5].num3, this.barList[4].num3, this.barList[3].num3, this.barList[2].num3, this.barList[1].num3, this.barList[0].num3],
// 'label':{
// show:true,
// position:'top',
// textStyle: {
// color: '#fff300',
// fontSize: 12
// }
// },
},
// {
// 'name': '',
// 'type': 'line',
// yAxisIndex: 1,
// 'emphasis': {
// focus: 'series'
// },
// // data: seriesData2
// 'data': [this.barList[6].num4, this.barList[5].num4, this.barList[4].num4, this.barList[3].num4, this.barList[2].num4, this.barList[1].num4, this.barList[0].num4],
// // 'label':{
// // show:true,
// // position:'top',
// // textStyle: {
// // color: '#fff300',
// // fontSize: 12
// // }
// // },
// },
]
};
@ -423,16 +509,87 @@
var date = value.substring(5, 10);
return date;
},
pie(){
window.setInterval(() => {
this.searchData();
}, 12000);
}
timeDo(){
let that=this;
$.ajax({
url: "/board/getRefreshTime",
type: "post",
data: {"boardName": 'newScheduledBoard'},
dataType: "json",
success: (data) => {
if (data.rows != "" && data.rows != null) {
that.refreshTime = Number(data.rows);
if(that.refreshTime ==0){
that.refreshTime =5;
}
}else {
that.refreshTime =5;
}
console.log(4000*Number(that.refreshTime))
window.setInterval(() => {
this.searchData();
}, 4000*Number(that.refreshTime));
},
})
},
getIp(){
console.log(localStorage.getItem("tvIP"))
let that=this;
if (localStorage.getItem("tvIP")==null||localStorage.getItem("tvIP")==""||localStorage.getItem("tvIP")=="192.168.1.130") {
$.ajax({
url: "/board/getIpFirst",
type: "post",
data: {},
dataType: "json",
success: (data) => {
localStorage.setItem("tvIP", data.row)
that.ip=localStorage.getItem("tvIP")
this.tableInit();
this.timeDo();
this.searchData();
}
}).fail(() => {
localStorage.setItem("tvIP", "192.168.1.130")
that.ip=localStorage.getItem("tvIP")
this.tableInit();
this.timeDo();
this.searchData();
})
}else {
that.ip=localStorage.getItem("tvIP")
this.tableInit();
this.timeDo();
this.searchData();
}
},
getRefresh(){
let that=this;
$.ajax({
url: "/board/getRefreshTime",
type: "post",
data: {"boardName": 'newScheduledBoard'},
dataType: "json",
success: (data) => {
if (data.rows != "" && data.rows != null) {
that.refreshTime = Number(data.rows);
if(that.refreshTime ==0){
that.refreshTime =5;
}
}else {
that.refreshTime =5;
}
},
})
},
},
created(){
this.getRefresh();
},
mounted() {
this.tableInit();
this.searchData();
this. pie();
this.getIp();
}
}
</script>

102
src/views/newTime.vue

@ -0,0 +1,102 @@
<template>
<div style="font-size: 26px;float: right;color: #ffffff;height: 100%" v-html="clock"></div>
</template>
<script>
export default {
name: 'newTime',
data() {
return {
clock: null,
status: 1
}
},
methods: {
getTime() {
let that = this;
$.ajax({
url: "/board/getTime",
type: "post",
dataType: "json",
data: {},
async: false,
success: (data) => {
that.stringdate = data.rows;
that.timer = window.setInterval(() => {
that.showRealTime()
}, 1000);
}
})
},
showRealTime() {
if (this.currentDate == null) {
this.currentDate = new Date(this.stringdate);
} else {
this.currentDate = new Date(this.currentDate.getTime() + 1000);
}
var c = this.currentDate;
var year = c.getFullYear();
var month = c.getMonth() + 1;
var date = c.getDate();
var days = new Array("日", "一", "二", "三", "四", "五", "六");
var day = c.getDay();
var hour = (c.getHours() < 10) ? ("0" + c.getHours()) : c.getHours();
var min = (c.getMinutes() < 10) ? ("0" + c.getMinutes()) : c.getMinutes();
var sec = (c.getSeconds() < 10) ? ("0" + c.getSeconds()) : c.getSeconds();
var now = year + "年" + month + "月" + date + "日<br>星期" + days[day] + "<br>" + hour + ":" + min + ":" + sec;
// if (hour>=10 && hour<12 && this.status==1){
if (localStorage.getItem("status")==null){
localStorage.setItem("status",1)
}
this.status = localStorage.getItem("status")
if (parseInt(hour) ==23 && this.status==1){
$.ajax({
url: "/board/kanKanYouMeiYouDiaoXian",
type: "post",
data: {},
dataType: "json",
success: (data) => {
localStorage.setItem("status",2)
location.reload();
}
}).fail(() => {
localStorage.setItem("status",3)
})
}
// if ( hour>=12 && this.status==2){
if ( parseInt(hour) ==1 && this.status==2){
localStorage.setItem("status",1)
}
if(this.status==3 && parseInt(sec) ==59){
$.ajax({
url: "/board/kanKanYouMeiYouDiaoXian",
type: "post",
data: {},
dataType: "json",
success: (data) => {
localStorage.setItem("status",2)
location.reload();
}
})
}
this.clock = now;
},
},
mounted() {
this.getTime();
},
beforeDestroy() {
},
};
</script>
<style scoped>
</style>

4
src/views/orderBoard.vue

@ -87,7 +87,7 @@ export default {
}
}
}).fail(() => {
this.$router.push("/")
this.$router.push("/home")
})
},
jump() {
@ -104,7 +104,7 @@ export default {
this.$router.push(this.nextPage);
}
}).fail(() => {
this.$router.push("/")
this.$router.push("/home")
})
},
getItemNoNumber() {

4
src/views/productOutBoard.vue

@ -64,7 +64,7 @@
}
}
}).fail(() => {
this.$router.push("/")
this.$router.push("/home")
})
},
jump() {
@ -81,7 +81,7 @@
this.$router.push(this.nextPage);
}
}).fail(() => {
this.$router.push("/")
this.$router.push("/home")
})
},

4
src/views/reportAbnormal.vue

@ -91,7 +91,7 @@ export default {
}
}
}).fail(() => {
this.$router.push("/")
this.$router.push("/home")
})
},
@ -109,7 +109,7 @@ export default {
this.$router.push(this.nextPage);
}
}).fail(() => {
this.$router.push("/")
this.$router.push("/home")
})
},

4
src/views/scheduledBoard.vue

@ -96,7 +96,7 @@ export default {
}
}
}).fail(() => {
this.$router.push("/")
this.$router.push("/home")
})
},
@ -114,7 +114,7 @@ export default {
this.$router.push(this.nextPage);
}
}).fail(() => {
this.$router.push("/")
this.$router.push("/home")
})
},

Loading…
Cancel
Save