更新微工厂缝纫设备看板

This commit is contained in:
hzz 2024-07-31 09:04:08 +08:00
parent 419dce9bca
commit 87241457c8
7 changed files with 54 additions and 15 deletions

View File

@ -543,7 +543,7 @@ h1 {
}
.time {
position: absolute;
width: 350px;
width: 360px;
height: 2rem;
bottom: 30%;
left: 4.2rem;

View File

@ -298,7 +298,7 @@ export default {
'效益&效率':'Benefit&Efficiency',
'效益':'Benefit',
'效率':'Efficiency',
'微工厂缝纫设备看板':'微工厂缝纫设备看板',
'微工厂缝纫设备看板':'Micro factory sewing equipment signboard',
'工作时间':'工作时间',
'空闲时间':'空闲时间',
'智能货架物联管理系统':'智能货架物联管理系统',
@ -320,6 +320,38 @@ export default {
"富怡多功能绣花机": "Richpeace embroidery machine",
"JUKI高速直驱平缝机": "JUKI lockstitch sewing machine",
"Yamato包缝机": "Yamato overlock sewing machine",
"花样名称": "花样名称",
"花样总针数": "花样总针数",
"当前针数": "当前针数",
"断线提醒": "断线提醒",
"冲缝一体机": "冲缝一体机",
"再登机器物联管理系统": "再登机器物联管理系统",
"工业缝纫机": "工业缝纫机",
"剪线次数": "剪线次数",
"针数": "针数",
"压脚次数": "压脚次数",
"能耗": "能耗",
"次": "次",
"设备稼动率": "设备稼动率",
"产出进度": "产出进度",
"稼动率说明":"稼动率:实际工作时间/设备开机时间",
"已完成":"已完成",
"未完成":"未完成",
"工作速度":"工作速度",
"产品合格率":"产品合格率",
"维保信息":"维保信息",
'件':'件',
"日期":"日期",
"工作人员":"工作人员",
"操作员编号":"操作员编号",
"完成":"完成",
"合格率":"合格率",
"通知":"通知",
"轮播已开启":"轮播已开启",
"轮播已关闭":"轮播已关闭",
"加工时长":"加工时长",
"当日总针数":"Total Stitches Today",
"当日工作时长":"Working Time Today",
},
"default":{
'年': 'Year',

View File

@ -307,7 +307,7 @@ export default {
'效益&效率':'Benefit&Efficiency',
'效益':'Benefit',
'效率':'Efficiency',
'微工厂缝纫设备看板':'微工厂缝纫设备看板',
'微工厂缝纫设备看板':'Micro factory sewing equipment signboard',
'工作时间':'工作时间',
'空闲时间':'空闲时间',
'智能货架物联管理系统':'智能货架物联管理系统',
@ -360,6 +360,8 @@ export default {
"轮播已关闭":"Carousel has been turned off",
"加工时长":"Processing Time",
"合格率":"Qualified Rate",
"当日总针数":"Total Stitches Today",
"当日工作时长":"Working Time Today",
},
"default":{
'年': 'Year',

View File

@ -358,6 +358,8 @@ export default {
"轮播已开启":"轮播已开启",
"轮播已关闭":"轮播已关闭",
"加工时长":"加工时长",
"当日总针数":"当日总针数",
"当日工作时长":"当日工作时长",
},
"default":{
'年': '年',

View File

@ -1,7 +1,7 @@
//获取用户保存的语言首选项
export function getStoredLanguage(): string | null {
return localStorage.getItem("selectedLanguage");
return localStorage.getItem("selectedLanguage")||'简体中文';
}
//保存新的语言选择
export function saveStoredLanguage(language: string): void {

View File

@ -5,11 +5,11 @@
<div class="status" :class="statusClass">{{ prop.data.status }}</div>
<div class="right-top">
<div class="num">{{ prop.data.count }}</div>
<div class="name">当日总针数</div>
<div class="name">{{t('messages.当日总针数')}}</div>
</div>
<!-- <div class="chart" ref="chart"></div> -->
<div class="online-time">
<span style="font-size:20px; color: #fff;">当日工作时长</span>
<span style="font-size:20px; color: #fff;">{{t('messages.当日工作时长')}}</span>
<span>{{ timestampToTime(prop.data.todayRunTime) }}</span>
</div>
<div class="bottom">
@ -25,6 +25,8 @@
<script setup lang='ts'>
import { getCurrentInstance, ref, onMounted,watch, computed } from 'vue';
import {timestampToTime} from '@/utils/time'
import { useI18n } from 'vue-i18n'
let { t } = useI18n();
const { proxy } = getCurrentInstance()! as any;
const chart = ref(null);
let myChart: any = null;
@ -48,11 +50,11 @@ const prop = defineProps({
})
let statusClass = computed(() => {
return prop.data.status == '在线' ? 'online' : 'outline'
return prop.data.status == t('default.在线') ? 'online' : 'outline'
})
let borderBoxColor = computed(() => {
return prop.data.status == '在线' ? ['#FF8C00', '#FF8C00'] : ['#999999', '#999999']
return prop.data.status == t('default.在线') ? ['#FF8C00', '#FF8C00'] : ['#999999', '#999999']
})
@ -110,7 +112,7 @@ onMounted(() => {
.bottom {
width: 100%;
height: 50px;
height: 75px;
color: #fff;
font-weight: bold;
position: absolute;
@ -124,10 +126,10 @@ onMounted(() => {
align-items: center;
}
.bottom text {
font-size: 20px;
font-size: 18px;
}
.bottom small {
font-size: 16px;
font-size: 14px;
}
.chart {

View File

@ -23,8 +23,9 @@ import { ref,onMounted,onUnmounted } from 'vue'
import {getSewingBoard} from '@/http/device'
import { connectWebsocket, closeWebsocket } from "@/utils/websocket";
import { useI18n } from 'vue-i18n'
import { getStoredLanguage, saveStoredLanguage } from "@/utils/languageStorage";
let { t } = useI18n();
const storedLocale = getStoredLanguage()
document.title = t('messages.微工厂缝纫设备看板');
let titleTip = [
// {
@ -48,8 +49,8 @@ function reqSewingBoard() {
return {
id: item.id,
num: item.num,
status: item.status == 'true'? '在线':'离线',
name: item.name,
status: item.status == 'true'? t('default.在线'):t('messages.offline'),
name: !storedLocale ||storedLocale == "简体中文"?item.name:item.ename,
label: item.label,
count: item.in4TodayCount,
todayRunTime: item.todayRunTime,
@ -68,7 +69,7 @@ function getWebsocket(val) {
//
if (data.type == "mDeviceStatus"&&arr_num.value.includes(data.msg.num)) {
let msg = arr.value.find(item=>item.num == data.msg.num)
msg.status = data.msg.status === 0? '离线':'在线'
msg.status = data.msg.status === 0? t('messages.offline'):t('default.在线')
}