diff --git a/package.json b/package.json
index fe073c3..e524e39 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "gy-calibration",
- "version": "1.0.10",
+ "version": "1.0.12",
"description": "谷云开发部开发的断路器标定软件",
"main": "./out/main/index.js",
"author": "example.com",
diff --git a/resources/service/config/config.yaml b/resources/service/config/config.yaml
index 62f1190..35ff83b 100644
--- a/resources/service/config/config.yaml
+++ b/resources/service/config/config.yaml
@@ -1,7 +1,7 @@
server:
serverMain:
address: "8000"
- serverRoot: "resource/public"
+ #serverRoot: "resource/public"
logger:
path: "logs"
@@ -18,4 +18,4 @@ fluctuateRatioU: 90
#测试源电压波动比例
fluctuateRatioI: 90
#配置密钥
-secretKey: "1dd53c82958d1de56df4035d3ed9fd82"
\ No newline at end of file
+secretKey: "1dd53c82958d1de56df4035d3ed9fd82"
diff --git a/resources/service/data.db b/resources/service/data.db
index d821840..dbd8de0 100644
Binary files a/resources/service/data.db and b/resources/service/data.db differ
diff --git a/src/renderer/src/assets/iconfont/iconfont.ttf b/src/renderer/src/assets/iconfont/iconfont.ttf
new file mode 100644
index 0000000..24e782c
Binary files /dev/null and b/src/renderer/src/assets/iconfont/iconfont.ttf differ
diff --git a/src/renderer/src/views/calibration/index.vue b/src/renderer/src/views/calibration/index.vue
index dd42a7b..acc0524 100644
--- a/src/renderer/src/views/calibration/index.vue
+++ b/src/renderer/src/views/calibration/index.vue
@@ -9,9 +9,9 @@
停止
操作员编号:
-
- 生产总数/合格数/不合格次数: {{ equipmentStatistics.totalDevice }}/{{ equipmentStatistics.successDevice }}/{{ equipmentStatistics.failCount }}
-
+
+ 生产总数/合格数/不合格次数: {{ equipmentStatistics.totalDevice }}/{{ equipmentStatistics.successDevice }}/{{ equipmentStatistics.failCount }}
+
- 标定步骤
+ 标定中检测步骤
+
标定后检测步骤
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
漏电检测设置
@@ -425,7 +511,7 @@
- {{ col.valueKey }}
+ {{ (col.valueName || col.valueKey) + (col.valueUnit ? ' [' + col.valueUnit + ']' : '') }}
@@ -555,9 +641,9 @@ const schemeList = ref([]);
const activeScheme = ref();
const equipmentStatistics = ref({
- totalDevice: 0,
- successDevice: 0,
- failCount: 0
+ totalDevice: 0,
+ successDevice: 0,
+ failCount: 0
});
const accuracyType = ref({
@@ -633,10 +719,10 @@ const shortcutKeyList = ref([
label: '↓',
action: '下一个日志(查询时)'
},
- {
- label: 'Enter',
- action: '下一个日志(查询时)'
- },
+ {
+ label: 'Enter',
+ action: '下一个日志(查询时)'
+ },
{
label: 'Esc',
action: '退出查询'
@@ -671,6 +757,32 @@ const currentScheme = ref({
}
},
steps: [],
+ laterSteps: [
+ {
+ id: 1,
+ step: 1,
+ voltage: 110,
+ current: 110,
+ powerFactor: '0.5L',
+ isILeak: false
+ },
+ {
+ id: 2,
+ step: 2,
+ voltage: 80,
+ current: 80,
+ powerFactor: '0.5L',
+ isILeak: false
+ },
+ {
+ id: 3,
+ step: 3,
+ voltage: 100,
+ current: 2,
+ powerFactor: '0.5L',
+ isILeak: true
+ }
+ ],
iLeakDetectObj: defaultiLeakDetectObj
});
@@ -725,8 +837,8 @@ const processLogData = apiData => {
apiData.forEach(item => {
let valueName = item.valueName || item.valueKey;
let valueUnit = item.valueUnit || '';
- if (activeScheme.value && Array.isArray(activeScheme.value.propertyParam)) {
- const found = activeScheme.value.propertyParam.find(param => param.key === item.valueKey);
+ if (activeScheme.value && Array.isArray(defaultPropList.value)) {
+ const found = defaultPropList.value.find(param => param.key === item.valueKey);
if (found) {
valueName = found.name || valueName;
valueUnit = found.unit || valueUnit;
@@ -845,7 +957,7 @@ const getSocketMeassage = message => {
if (msg.msgType === 'calibrate_finish') {
playState.value = false;
ElMessage.success('标定完成');
- getQquipmentStatistics();
+ getQquipmentStatistics();
}
// 批量更新日志数组
@@ -895,7 +1007,6 @@ const socketStatus = computed(() => {
return webSocketStore.socket_open;
});
-
// 键盘快捷键处理
const handleKeydown = event => {
// Ctrl+F: 打开搜索
@@ -926,18 +1037,17 @@ const handleKeydown = event => {
}
};
-
const toggleIsScroll = () => {
isScroll.value = !isScroll.value;
};
const startExecution = () => {
if (selectedScheme.value === '') {
- ElMessage.error({message:'请先选择方案'});
+ ElMessage.error({ message: '请先选择方案' });
return;
}
if (operatorCode.value.trim() === '') {
- ElMessage.error({message:'请先输入操作员编号',duration:1000,showClose: true});
+ ElMessage.error({ message: '请先输入操作员编号', duration: 1000, showClose: true });
return;
}
// 开始标定之前重新连接socket
@@ -947,7 +1057,7 @@ const startExecution = () => {
ElMessage.success('开始执行方案: ' + scheme[0].schemeName);
playState.value = true;
playCalibration();
- getQquipmentStatistics();
+ getQquipmentStatistics();
// Add actual start logic here
};
@@ -1045,14 +1155,16 @@ const loadSchemes = async () => {
}
if (found) {
activeScheme.value = found;
- } else if (schemeList.value.length > 0) {
- selectedScheme.value = schemeList.value[0].id;
- activeScheme.value = schemeList.value[0];
- } else {
+ }
+ // else if (schemeList.value.length > 0) {
+ // selectedScheme.value = schemeList.value[0].id;
+ // activeScheme.value = schemeList.value[0];
+ // }
+ else {
selectedScheme.value = '';
activeScheme.value = {};
}
- ElMessage.success({message: '获取方案列表成功', duration: 1000});
+ ElMessage.success({ message: '获取方案列表成功', duration: 1000 });
} else {
ElMessage.error(response.data.message || '获取方案列表失败');
}
@@ -1166,6 +1278,32 @@ const addScheme = () => {
}
},
steps: [],
+ laterSteps: [
+ {
+ id: 1,
+ step: 1,
+ voltage: 110,
+ current: 110,
+ powerFactor: '0.5L',
+ isILeak: false
+ },
+ {
+ id: 2,
+ step: 2,
+ voltage: 80,
+ current: 80,
+ powerFactor: '0.5L',
+ isILeak: false
+ },
+ {
+ id: 3,
+ step: 3,
+ voltage: 100,
+ current: 2,
+ powerFactor: '0.5L',
+ isILeak: true
+ }
+ ],
iLeakDetectObj: defaultiLeakDetectObj
};
isEditMode.value = false;
@@ -1195,6 +1333,19 @@ const addCalibrationStep = () => {
isILeak: false
});
};
+
+// 添加标定步骤
+const addCalibrationLaterStep = () => {
+ currentScheme.value.laterSteps.push({
+ id: currentScheme.value.laterSteps.length + 1,
+ step: currentScheme.value.laterSteps.length + 1,
+ voltage: 100,
+ current: 100,
+ powerFactor: '0.5L',
+ isILeak: false
+ });
+};
+
const toggleOpenLog = () => {
isOpenLog.value = !isOpenLog.value;
};
@@ -1314,6 +1465,14 @@ const deleteCalibrationStep = index => {
});
};
+// 删除标定步骤
+const deleteCalibrationLaterStep = index => {
+ currentScheme.value.laterSteps.splice(index, 1);
+ // 重新编号
+ currentScheme.value.laterSteps.forEach((step, idx) => {
+ step.id = idx + 1;
+ });
+};
const generateDeviceList = async () => {
try {
const response = await axios.get(config.url + '/master/device/list');
@@ -1336,10 +1495,20 @@ const playCalibration = async () => {
if (response.data.code === 0) {
// devices.value = response.data.data.result || [];
} else {
+ ElMessageBox.alert(response.data.message, '告警', {
+ // if you want to disable its autofocus
+ // autofocus: false,
+ dangerouslyUseHTMLString: true,
+ confirmButtonText: '确定',
+ confirmButtonClass: 'custom-message-box',
+ callback: action => {}
+ });
+ playState.value = false;
// ElMessage.error(response.data.message || '开始执行失败');
}
} catch (error) {
console.error('获取设备列表失败:', error);
+
// ElMessage.error('开始执行失败');
}
};
@@ -1531,16 +1700,18 @@ const handleExportProd = async () => {
};
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);
- });
-
+ 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);
+ });
};
// 监听日志变化滚到到底部
@@ -1558,33 +1729,32 @@ watch(
}
);
-
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;
- });
- }
+ 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();
+ // generateMockDevices();
+ getSchemeDefaultConf();
+ getSchemeDefaultProp();
+ generateDeviceList();
+ loadSchemes();
+ getQquipmentStatistics();
- // 添加键盘快捷键监听
- document.addEventListener('keydown', handleKeydown);
+ // 添加键盘快捷键监听
+ document.addEventListener('keydown', handleKeydown);
});
onUnmounted(() => {
- if (webSocketStore) {
- webSocketStore.close();
- }
- // 移除键盘快捷键监听
- document.removeEventListener('keydown', handleKeydown);
+ if (webSocketStore) {
+ webSocketStore.close();
+ }
+ // 移除键盘快捷键监听
+ document.removeEventListener('keydown', handleKeydown);
});
@@ -1647,13 +1817,13 @@ onUnmounted(() => {
.header-center .el-button {
margin-left: 10px;
}
-.statistics-box{
- margin-left: 10px;
- font-size: 13px;
- .statistics-number{
- font-size: 16px;
- font-weight: bold;
- }
+.statistics-box {
+ margin-left: 10px;
+ font-size: 13px;
+ .statistics-number {
+ font-size: 16px;
+ font-weight: bold;
+ }
}
.calibration-main {
@@ -2095,3 +2265,14 @@ onUnmounted(() => {
/* Red for disconnected */
}
+