diff --git a/src/router/index.js b/src/router/index.js index 9b087f1..e6a1437 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -125,6 +125,7 @@ export const constantRoutes = [ component: (resolve) => require(['@/views/wmsManagement/WmPolishInventory/PolishFQC.vue'], resolve), hidden: true, }, + // 看板 { path: '/kanbanManagement/FqcQualityDataBoard', component: (resolve) => require(['@/views/kanbanManagement/FqcQualityDataBoard/index.vue'], resolve), @@ -145,6 +146,13 @@ export const constantRoutes = [ component: (resolve) => require(['@/views/qualityManagement/backend/touchScreen/main/index.vue'], resolve), hidden: true, }, + // 车间生产看板 + { + path: '/kanbanManagement/mainProductionBoard', + component: (resolve) => require(['@/views/kanbanManagement/mainProductionBoard.vue'], resolve), + hidden: true, + }, + // { // path: '/qualityManagement/FQC/qualityStatistics', // component: (resolve) => require(['@/views/qualityManagement/FQC/qualityStatistics.vue'], resolve), diff --git a/src/views/kanbanManagement/digitalFlop.vue b/src/views/kanbanManagement/digitalFlop.vue index 493646b..be84fde 100644 --- a/src/views/kanbanManagement/digitalFlop.vue +++ b/src/views/kanbanManagement/digitalFlop.vue @@ -1,13 +1,18 @@ @@ -22,82 +27,113 @@ export default { }, methods: { createData() { - const { randomExtend } = this + // 故障固定为0 + const fault = 0; + + // 未连接在0与1之间变动,频率慢一点 + const disconnected = 0; + + // 空闲在0与1之间变动,频率慢一点 + const idle = Math.floor(Math.random() * 2); // 0 or 1 + + // 所有保持10台 + const total = 10; + + // 工作 = 所有 - 空闲 - 故障 - 未连接 + const working = total - idle - fault - disconnected; - this.digitalFlopData = [ + // 添加数字变化动画效果 + const newData = [ { title: '所有', number: { - number: [randomExtend(1, 20)], + number: [total], content: '{nt}', - textAlign: 'right', + textAlign: 'center', style: { - fill: '#4d99fc', + fill: '#ffffff', fontWeight: 'bold', + fontSize: 40, }, + toFixed: 0, }, unit: '台', }, { title: '工作', number: { - number: [randomExtend(1, 20)], + number: [working], content: '{nt}', - textAlign: 'right', + textAlign: 'center', style: { - fill: '#4d99fc', + fill: '#ffffff', fontWeight: 'bold', + fontSize: 40, }, + toFixed: 0, }, unit: '台', }, { title: '空闲', number: { - number: [randomExtend(1, 20)], + number: [idle], content: '{nt}', - textAlign: 'right', + textAlign: 'center', style: { - fill: '#4d99fc', + fill: '#ffffff', fontWeight: 'bold', + fontSize: 40, }, + toFixed: 0, }, unit: '台', }, { title: '故障', number: { - number: [randomExtend(1, 20)], + number: [fault], content: '{nt}', - textAlign: 'right', + textAlign: 'center', style: { - fill: '#4d99fc', + fill: '#ffffff', fontWeight: 'bold', + fontSize: 40, }, + toFixed: 0, }, unit: '台', }, { title: '未连接', number: { - number: [randomExtend(1, 20)], + number: [disconnected], content: '{nt}', - textAlign: 'right', + textAlign: 'center', style: { - fill: '#4d99fc', + fill: '#ffffff', fontWeight: 'bold', + fontSize: 40, }, + toFixed: 0, }, unit: '台', }, - ] - }, - randomExtend(minNum, maxNum) { - if (arguments.length === 1) { - return parseInt(Math.random() * minNum + 1, 10) - } else { - return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10) + ]; + + // 添加数字变化动画效果 + if (this.digitalFlopData.length > 0) { + // 为每个数字添加动画类 + const numberElements = document.querySelectorAll('.number-digit'); + numberElements.forEach(el => { + el.classList.add('changing'); + setTimeout(() => { + el.classList.remove('changing'); + }, 500); + }); } + + this.digitalFlopData = newData; }, }, mounted() { @@ -105,7 +141,8 @@ export default { createData() - setInterval(createData, 30000) + // 更新频率改为2分钟 + setInterval(createData, 120000) }, } @@ -118,8 +155,7 @@ export default { display: flex; justify-content: center; align-items: center; - background-color: rgba(6, 30, 93, 0.5); - + .dv-decoration-10 { position: absolute; width: 95%; @@ -127,35 +163,163 @@ export default { height: 5px; bottom: 0px; } - + + .digital-flop-wrapper { + display: flex; + justify-content: center; + align-items: center; + width: 100%; + height: 100%; + background: linear-gradient(145deg, #2c3e50, #34495e); + border-radius: 15px; + padding: 15px; + border: 2px solid #3a506b; + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); + } + .digital-flop-item { - width: 11%; - height: 80%; + width: 20%; + height: 100%; + display: flex; + justify-content: center; + align-items: center; + padding: 0 15px; + transition: transform 0.3s ease; + } + + .digital-flop-item:hover { + transform: translateY(-5px); + } + + .digital-flop-card { + width: 100%; + height: 90%; display: flex; flex-direction: column; justify-content: center; align-items: center; - border-left: 3px solid rgb(6, 30, 93); - border-right: 3px solid rgb(6, 30, 93); + background: rgba(44, 62, 80, 0.8); + border-radius: 12px; + padding: 15px 10px; + border: 1px solid #3a506b; + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2); + transition: all 0.3s ease; } - + + .digital-flop-card:hover { + background: rgba(52, 73, 94, 0.9); + box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3); + } + .digital-flop-title { + width: 100%; font-size: 20px; - margin-bottom: 20px; - color: white; + margin-bottom: 12px; + color: #ffffff; + font-weight: 600; + text-align: center; + text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); } - - .digital-flop { + + .digital-flop-content { display: flex; + justify-content: center; + align-items: center; + width: 100%; } - + + .idle-label { + margin-right: 10px; + color: #ffffff; + font-size: 40px; + font-weight: 600; + } + + .digital-flop-number { + width: 100%; + height: 60px; + display: flex; + justify-content: center; + align-items: center; + font-size: 40px; + font-weight: 600; + color: #ffffff; + transition: all 0.5s ease; + } + + .number-digit { + display: inline-block; + width: 25px; + text-align: center; + transition: all 0.5s cubic-bezier(0.37, 0.08, 0.34, 1.21); + margin: 0 3px; + transform: perspective(300px) rotateX(0deg); + } + + .number-digit.changing { + transform: perspective(300px) rotateX(360deg); + } + .unit { margin-left: 10px; display: flex; - color: white; - align-items: flex-end; - box-sizing: border-box; - padding-bottom: 13px; + justify-content: center; + align-items: center; + color: #ecf0f1; + font-size: 20px; + font-weight: 500; + text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); + } + + @media (max-width: 1200px) { + .digital-flop-item { + padding: 0 10px; + } + + .digital-flop-title { + font-size: 18px; + margin-bottom: 10px; + } + + .digital-flop-number { + font-size: 36px; + height: 50px; + } + + .number-digit { + width: 22px; + } + + .unit { + font-size: 18px; + margin-left: 8px; + } + } + + @media (max-width: 768px) { + .digital-flop-item { + padding: 0 5px; + } + + .digital-flop-title { + font-size: 16px; + margin-bottom: 8px; + } + + .digital-flop-number { + font-size: 32px; + height: 45px; + } + + .number-digit { + width: 20px; + margin: 0 2px; + } + + .unit { + font-size: 16px; + margin-left: 6px; + } } } diff --git a/src/views/kanbanManagement/mainProductionBoard.vue b/src/views/kanbanManagement/mainProductionBoard.vue new file mode 100644 index 0000000..25881f5 --- /dev/null +++ b/src/views/kanbanManagement/mainProductionBoard.vue @@ -0,0 +1,684 @@ + + + + + diff --git a/src/views/kanbanManagement/tuzhuangworkshop.vue b/src/views/kanbanManagement/tuzhuangworkshop.vue index 0914449..a934bb1 100644 --- a/src/views/kanbanManagement/tuzhuangworkshop.vue +++ b/src/views/kanbanManagement/tuzhuangworkshop.vue @@ -3,7 +3,7 @@

涂装车间生产实时看板

车间生产看板