feat(renderer): 更新图标字体并添加生产统计功能,升级1.0.10版本
- 更新图标字体文件版本 - 添加展开/收起图标 - 在校准页面添加生产总数/合格数/不合格次数统计 - 优化校准设备列表渲染逻辑 - 调整输入框样式
This commit is contained in:
parent
7c8b2477d5
commit
a929a7b47d
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "gy-calibration",
|
||||
"version": "1.0.9",
|
||||
"version": "1.0.10",
|
||||
"description": "谷云开发部开发的断路器标定软件",
|
||||
"main": "./out/main/index.js",
|
||||
"author": "example.com",
|
||||
|
|
Binary file not shown.
|
@ -1,8 +1,8 @@
|
|||
@font-face {
|
||||
font-family: "iconfont"; /* Project id 4622943 */
|
||||
src: url('iconfont.woff2?t=1752478848997') format('woff2'),
|
||||
url('iconfont.woff?t=1752478848997') format('woff'),
|
||||
url('iconfont.ttf?t=1752478848997') format('truetype');
|
||||
src: url('iconfont.woff2?t=1753694081375') format('woff2'),
|
||||
url('iconfont.woff?t=1753694081375') format('woff'),
|
||||
url('iconfont.ttf?t=1753694081375') format('truetype');
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
|
@ -13,6 +13,14 @@
|
|||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-zhakai:before {
|
||||
content: "\e797";
|
||||
}
|
||||
|
||||
.icon-zhahe:before {
|
||||
content: "\e798";
|
||||
}
|
||||
|
||||
.icon-kuaijiejian:before {
|
||||
content: "\e603";
|
||||
}
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -8,7 +8,10 @@
|
|||
<el-button icon="CaretRight" type="primary" :disabled="playState" @click="startExecution">开始执行</el-button>
|
||||
<el-button icon="RemoveFilled" type="danger" @click="stopExecution">停止</el-button>
|
||||
<span style="margin-left: 10px">操作员编号:</span>
|
||||
<el-input v-model="operatorCode" placeholder="请输入操作员编号" style="width: 150px; margin-left: 10px" />
|
||||
<el-input v-model="operatorCode" placeholder="输入操作员编号" style="width: 120px; margin-left: 10px" />
|
||||
<div class="statistics-box">
|
||||
生产总数/合格数/不合格次数: <span class="statistics-number">{{ equipmentStatistics.totalDevice }}/{{ equipmentStatistics.successDevice }}/{{ equipmentStatistics.failCount }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="header-right">
|
||||
<el-button icon="RefreshRight" type="primary" :disabled="playState" @click="generateDeviceList">刷新列表</el-button>
|
||||
|
@ -65,15 +68,14 @@
|
|||
v-if="device.connectStatus === 1"
|
||||
:class="[
|
||||
'iconfont',
|
||||
'icon-icon_duanluqi2',
|
||||
'circuit-breaker',
|
||||
device.switch === 0 ? 'upsideDown' : '',
|
||||
device.switch === 0 ? 'icon-zhahe' : 'icon-zhakai',
|
||||
device.result === 1 ? 'color-green' : device.result === -1 ? 'color-red' : device.result === 2 ? 'color-orange' : ''
|
||||
]"
|
||||
></div>
|
||||
<div
|
||||
v-else
|
||||
:class="['iconfont', 'icon-icon_duanluqi2', 'circuit-breaker', device.switch === 0 ? 'upsideDown' : '', device.result === 1 ? 'color-green' : device.result === -1 ? 'color-red' : '']"
|
||||
:class="['iconfont', 'icon-zhakai', 'circuit-breaker', device.switch === 0 ? 'icon-zhahe' : 'icon-zhakai', device.result === 1 ? 'color-green' : device.result === -1 ? 'color-red' : '']"
|
||||
></div>
|
||||
<p>
|
||||
芯片ID:
|
||||
|
@ -552,6 +554,12 @@ const schemeDetailVisible = ref(false);
|
|||
const schemeList = ref([]);
|
||||
const activeScheme = ref();
|
||||
|
||||
const equipmentStatistics = ref({
|
||||
totalDevice: 0,
|
||||
successDevice: 0,
|
||||
failCount: 0
|
||||
});
|
||||
|
||||
const accuracyType = ref({
|
||||
voltage: '电压',
|
||||
current: '电流',
|
||||
|
@ -837,6 +845,7 @@ const getSocketMeassage = message => {
|
|||
if (msg.msgType === 'calibrate_finish') {
|
||||
playState.value = false;
|
||||
ElMessage.success('标定完成');
|
||||
getQquipmentStatistics();
|
||||
}
|
||||
|
||||
// 批量更新日志数组
|
||||
|
@ -886,24 +895,6 @@ const socketStatus = computed(() => {
|
|||
return webSocketStore.socket_open;
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
logBoxRef.value = document.querySelector('#log-box-main');
|
||||
initSocket();
|
||||
if (window.electron && typeof window.electron.getAppVersion === 'function') {
|
||||
window.electron.getAppVersion().then(v => {
|
||||
version.value = v;
|
||||
});
|
||||
}
|
||||
|
||||
// generateMockDevices();
|
||||
getSchemeDefaultConf();
|
||||
getSchemeDefaultProp();
|
||||
generateDeviceList();
|
||||
loadSchemes();
|
||||
|
||||
// 添加键盘快捷键监听
|
||||
document.addEventListener('keydown', handleKeydown);
|
||||
});
|
||||
|
||||
// 键盘快捷键处理
|
||||
const handleKeydown = event => {
|
||||
|
@ -935,13 +926,6 @@ const handleKeydown = event => {
|
|||
}
|
||||
};
|
||||
|
||||
onUnmounted(() => {
|
||||
if (webSocketStore) {
|
||||
webSocketStore.close();
|
||||
}
|
||||
// 移除键盘快捷键监听
|
||||
document.removeEventListener('keydown', handleKeydown);
|
||||
});
|
||||
|
||||
const toggleIsScroll = () => {
|
||||
isScroll.value = !isScroll.value;
|
||||
|
@ -949,11 +933,11 @@ const toggleIsScroll = () => {
|
|||
|
||||
const startExecution = () => {
|
||||
if (selectedScheme.value === '') {
|
||||
ElMessage.error('请先选择方案');
|
||||
ElMessage.error({message:'请先选择方案'});
|
||||
return;
|
||||
}
|
||||
if (operatorCode.value.trim() === '') {
|
||||
ElMessage.error('请先输入操作员编号');
|
||||
ElMessage.error({message:'请先输入操作员编号',duration:1000,showClose: true});
|
||||
return;
|
||||
}
|
||||
// 开始标定之前重新连接socket
|
||||
|
@ -963,6 +947,7 @@ const startExecution = () => {
|
|||
ElMessage.success('开始执行方案: ' + scheme[0].schemeName);
|
||||
playState.value = true;
|
||||
playCalibration();
|
||||
getQquipmentStatistics();
|
||||
// Add actual start logic here
|
||||
};
|
||||
|
||||
|
@ -1067,7 +1052,7 @@ const loadSchemes = async () => {
|
|||
selectedScheme.value = '';
|
||||
activeScheme.value = {};
|
||||
}
|
||||
ElMessage.success('获取方案列表成功');
|
||||
ElMessage.success({message: '获取方案列表成功', duration: 1000});
|
||||
} else {
|
||||
ElMessage.error(response.data.message || '获取方案列表失败');
|
||||
}
|
||||
|
@ -1545,6 +1530,19 @@ const handleExportProd = async () => {
|
|||
showExportProdDialog.value = false;
|
||||
};
|
||||
|
||||
const getQquipmentStatistics = () => {
|
||||
axios.get(config.url + '/master/calibrate/stat').then(response => {
|
||||
if(response.data.code === 0 && response.data.data.state){
|
||||
equipmentStatistics.value = response.data.data.state;
|
||||
}else{
|
||||
ElMessage.error(response.data.message);
|
||||
}
|
||||
}).catch(error => {
|
||||
ElMessage.error(error);
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
// 监听日志变化滚到到底部
|
||||
watch(
|
||||
logs,
|
||||
|
@ -1559,6 +1557,35 @@ watch(
|
|||
deep: true
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
logBoxRef.value = document.querySelector('#log-box-main');
|
||||
initSocket();
|
||||
if (window.electron && typeof window.electron.getAppVersion === 'function') {
|
||||
window.electron.getAppVersion().then(v => {
|
||||
version.value = v;
|
||||
});
|
||||
}
|
||||
|
||||
// generateMockDevices();
|
||||
getSchemeDefaultConf();
|
||||
getSchemeDefaultProp();
|
||||
generateDeviceList();
|
||||
loadSchemes();
|
||||
getQquipmentStatistics();
|
||||
|
||||
// 添加键盘快捷键监听
|
||||
document.addEventListener('keydown', handleKeydown);
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
if (webSocketStore) {
|
||||
webSocketStore.close();
|
||||
}
|
||||
// 移除键盘快捷键监听
|
||||
document.removeEventListener('keydown', handleKeydown);
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
@ -1576,7 +1603,7 @@ watch(
|
|||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0 20px;
|
||||
padding: 0 10px;
|
||||
height: 60px;
|
||||
background-color: #404040; /* Dark grey similar to image */
|
||||
color: white;
|
||||
|
@ -1620,6 +1647,14 @@ watch(
|
|||
.header-center .el-button {
|
||||
margin-left: 10px;
|
||||
}
|
||||
.statistics-box{
|
||||
margin-left: 10px;
|
||||
font-size: 13px;
|
||||
.statistics-number{
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.calibration-main {
|
||||
flex-grow: 1;
|
||||
|
|
Loading…
Reference in New Issue