Browse Source

看板改变

master
ruanqi 4 years ago
parent
commit
2459f0253a
  1. 56
      public/echarts2/echarts.min.js
  2. 5
      src/router/index.js
  3. 25
      src/views/Home.vue
  4. 366
      src/views/newScheduledBoard.vue
  5. 2
      vue.config.js

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

5
src/router/index.js

@ -8,6 +8,11 @@ const routes = [
{ {
path: '/', path: '/',
name: 'Home', name: 'Home',
component: () => import('../views/newScheduledBoard.vue'),
},
{
path: '/111',
name: '111',
component: Home, component: Home,
}, },
{ {

25
src/views/Home.vue

@ -105,19 +105,22 @@ export default {
}, 5000 ); }, 5000 );
}, },
getIp(){ getIp(){
$.ajax({
url: "/board/getIpFirst",
type: "post",
data: {},
dataType: "json",
success: (data) => {
localStorage.setItem("tvIP",data.row)
console.log(localStorage.getItem("tvIP"))
if (localStorage.getItem("tvIP")==null||localStorage.getItem("tvIP")==""||localStorage.getItem("tvIP")=="1.1.1.1") {
$.ajax({
url: "/board/getIpFirst",
type: "post",
data: {},
dataType: "json",
success: (data) => {
localStorage.setItem("tvIP", data.row)
}
}).fail(() => {
localStorage.setItem("tvIP","1.1.1.1")
}
}).fail(() => {
localStorage.setItem("tvIP", "1.1.1.1")
})
})
}
}, },
jump() { jump() {
$.ajax({ $.ajax({

366
src/views/newScheduledBoard.vue

@ -0,0 +1,366 @@
<template>
<div class="container">
<div style="width:100%;height: 20%;text-align:center;">
<TimeC></TimeC>
<!-- <div style="font-size: 26px;float: right;color: #ffffff;height: 100%" v-html="clock"></div>-->
<div style="float: left;width: 25%;height: 100%;text-align:center;margin-left: 37% ">
<div style="height: 40%;width: 100%;text-align: center;margin-top: 3%;">
<label style="font-size: 30px;color: #ffffff">派工单完成状况</label>
</div>
</div>
</div>
<div style="width:100%;height: 79%;">
<div style="float: left;height: 100%;width: 35%; ">
<div style="height: 12%;width: 100%;margin-top: 1%">
<div
style="width: 12%;height: 40%;float: left;margin-left: 18%;border-radius: 10px; background-color: #ec6566;"></div>
<div style="width: 25%;height: 50%;float: left;margin-left: 3%;">
<label style="font-size: 16px;color:#ffffff; ">未完工</label>
</div>
<div
style="width: 12%;height: 40%;float: left;margin-left: 1%;border-radius: 10px; background-color: #90ca75;"></div>
<div style="width: 25%;height: 50%;float: left;margin-left: 3%;">
<label style="font-size: 16px;color:#ffffff; ">已完工</label>
</div>
</div>
<div style="height: 88%;width: 100%;">
<div id="pie" style="float:left;margin-left: 0px; margin-top: 0%; width: 100%; height:80%;"></div>
</div>
</div>
<div style="float: left;height: 45%;width: 58%;margin-left:3% ">
<table class="table table-bordered" style="width:100%;font-size:16px;color: #ffffff" id="table">
</table>
</div>
<div style="float: left;height: 49%;width: 65%; ">
<div id="main" style="width: 100%;height: 100%;margin-top: 0px"></div>
</div>
</div>
</div>
</template>
<script>
import TimeC from "./time"
export default {
name: "newScheduledBoard",
data() {
return {
myChart: null,
}
},
components: {
TimeC
},
methods: {
draw(){
// if (data_temp[i].percentage >= 100) {
if (true) {
var color = '#90ca75';
} else {
var color = '#fff300';
}
let option = ({
title: [{
text: '工序:' + "打磨",
// text: '' + data_temp[i + x].itemNo,
// x 'center' ¦ 'left' ¦ 'right' ¦ {number}xpx
x: 'center',
// y 'top' ¦ 'bottom' ¦ 'center' ¦ {number}ypx
y: 'bottom',
// itemGappx10
backgroundColor: '#EEE',
//
textStyle: {
fontSize: 20,
fontWeight: 'bolder',
color: '#fff300'
}
},
{
text: '20%',
// text: data_temp[i + x].percentage + '%',
// x 'center' ¦ 'left' ¦ 'right' ¦ {number}xpx
x: 'center',
// y 'top' ¦ 'bottom' ¦ 'center' ¦ {number}ypx
y: 'center',
// itemGappx10
backgroundColor: 'rgba(0,0,0,0)',
//
textStyle: {
fontSize: 20,
fontWeight: 'bolder',
color: color
},
}],
series: [
{
name: '完成数量统计',
type: 'pie', //
radius: ['45%', '75%'], // 55%
data: [ // name value
// {value: data_temp[i + x].approveQty, name: ''},
// {value: data_temp[i + x].unapproveQty, name: ''}
{value: 20, name: ''},
{value: 80, name: ''}
],
color: ['#90ca75', '#ec6566'],
labelLine: {
normal: {
show: false
}
},
label: {
normal: {
position: 'outer', // 'outer' ¦ 'inner'
// formatter: '{a} {b} : {c} ({d}%)' {b}
// {a}series.name {b}series.dataname
// {c}series.datavalue {d}%
formatter: '{b}'
}
}
}
]
});
this.myChart = echarts.init(document.getElementById('pie'));
this.myChart.setOption(option);
},
tableInit() {
$('#table').bootstrapTable({
striped: true, //
cache: false, //使true*
pagination: false, //*
sortable: false, //
sortOrder: "asc", //
queryParamsType: "undefined", //
queryParams: function queryParams(params) { //
},
sidePagination: "server", //clientserver*
pageNumber: 1, //
pageSize: 10, //*
pageList: [10, 25, 50, 100], //*
search: false, //
searchTimeOut: 1000,
// : true,
showColumns: false, //
showRefresh: false, //
minimumCountColumns: 2, //
clickToSelect: true, //
singleSelect: true,
// height: 300, //height
uniqueId: "id", //
// showToggle: true, //
cardView: false, //
detailView: false, //
columns: [{
field: 't1',
title: '派工单号',
halign:'left',
width: 100,
cellStyle: function () {
return {css: {"height": "30px", "color": "yellow"}}
}
}, {
field: 't1',
title: '操作员工号',
halign:'left',
width: 100,
cellStyle: function () {
return {css: {"height": "30px", "color": "yellow"}}
}
}, {
field: 't1',
title: '设备编码',
halign:'left',
width: 100,
cellStyle: function () {
return {css: {"height": "30px", "color": "yellow"}}
}
}, {
field: 't1',
title: '班次',
halign:'left',
width: 100,
cellStyle: function () {
return {css: {"height": "30px", "color": "yellow"}}
}
}, {
field: 't1',
title: '派工数量',
halign:'left',
width: 100,
cellStyle: function () {
return {css: {"height": "30px", "color": "yellow"}}
}
}, {
field: 't1',
title: '已完工数量',
halign:'left',
width: 100,
cellStyle: function () {
return {css: {"height": "30px", "color": "yellow"}}
}
}, {
field: 't1',
title: '未完工数量',
halign:'left',
width: 100,
cellStyle: function () {
return {css: {"height": "30px", "color": "yellow"}}
}
}
],
onLoadSuccess: function (data) {
}
});
},
data(){
let arr=[]
let indata={
t1:'测试'
}
arr.push(indata);
arr.push(indata);
arr.push(indata);
let data2 = {"total": arr.length, "rows": arr};
$('#table').bootstrapTable('load', data2);
},
draw2(){
let chartDom = document.getElementById('main');
let myChart = echarts.init(chartDom);
let option;
// document.getElementById('main').style.height="300px";
if(this.option!=null){
document.getElementById('main').removeAttribute('_echarts_instance_')
this.option = null
}
option = {
color:["#11e2b6", "#ff0000"],
legend: {
textStyle: { //
color: '#fff',
// fontSize: 12
},
},
tooltip: {},
xAxis:[
{
type: 'category',
// data: xAxisData
data: [
{
value: '周一',
textStyle: {
color: '#EEE'
}
},
{
value: '周二',
textStyle: {
color: '#EEE'
}
},
{
value: '周三',
textStyle: {
color: '#EEE'
}
},
{
value: '周四',
textStyle: {
color: '#EEE'
}
},
{
value: '周五',
textStyle: {
color: '#EEE'
}
},
{
value: '周六',
textStyle: {
color: '#EEE'
}
},
{
value: '周日',
textStyle: {
color: '#EEE'
}
},
],
axisLine:{
lineStyle: {
color:'#eee'
}
},
axisTick: {
lineStyle: {
color:'#eee'
}
},
},
],
yAxis:
{
type: 'value',
axisLine:{
lineStyle: {
color:'#eee'
}
},
axisTick: {
lineStyle: {
color:'#eee'
}
},
},
series: [
{
name: '白班',
type: 'bar',
emphasis: {
focus: 'series'
},
// data: seriesData1
data: [320, 332, 301, 334, 390, 330, 320]
},
{
name: '晚班',
type: 'bar',
emphasis: {
focus: 'series'
},
// data: seriesData2
data: [120, 132, 101, 134, 90, 230, 210]
}
]
};
option && myChart.setOption(option);
}
},
mounted() {
this.draw();
this.tableInit();
this.data();
this.draw2();
}
}
</script>
<<style scoped>
.container {
height: 109%;
}
</style>

2
vue.config.js

@ -2,7 +2,7 @@ module.exports = {
publicPath: "/kanban/", publicPath: "/kanban/",
lintOnSave: false, lintOnSave: false,
devServer: { devServer: {
// proxy: 'http://192.168.1.83:8089'
// proxy: 'http://192.168.1.83:8081'
proxy: 'http://localhost:8083' proxy: 'http://localhost:8083'
// proxy: 'http://172.26.68.16:8091' // proxy: 'http://172.26.68.16:8091'
} }

Loading…
Cancel
Save