feat(calibration): 添加标定后检测步骤功能
- 新增标定后检测步骤表格和相关功能 - 优化标定步骤界面布局和交互 - 修复部分组件样式问题 - 版本号升级到 1.0.12
This commit is contained in:
parent
a929a7b47d
commit
7d53c34651
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "gy-calibration",
|
||||
"version": "1.0.10",
|
||||
"version": "1.0.12",
|
||||
"description": "谷云开发部开发的断路器标定软件",
|
||||
"main": "./out/main/index.js",
|
||||
"author": "example.com",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
server:
|
||||
serverMain:
|
||||
address: "8000"
|
||||
serverRoot: "resource/public"
|
||||
#serverRoot: "resource/public"
|
||||
|
||||
logger:
|
||||
path: "logs"
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -9,9 +9,9 @@
|
|||
<el-button icon="RemoveFilled" type="danger" @click="stopExecution">停止</el-button>
|
||||
<span style="margin-left: 10px">操作员编号:</span>
|
||||
<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 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>
|
||||
|
@ -317,7 +317,7 @@
|
|||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<el-divider>标定步骤</el-divider>
|
||||
<el-divider>标定中检测步骤</el-divider>
|
||||
<div class="calibration-steps">
|
||||
<div class="steps-header">
|
||||
<el-button type="primary" @click="addCalibrationStep">添加步骤</el-button>
|
||||
|
@ -335,18 +335,32 @@
|
|||
<el-input-number v-model="scope.row.step" :min="1" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="voltage" align="center" label="电压Un(%)">
|
||||
<el-table-column prop="voltage" align="center" label="电压U(%)">
|
||||
<template #default="scope">
|
||||
<el-input-number v-model="scope.row.voltage" :min="0" :precision="1" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="current" align="center" label="电流Ib(%)">
|
||||
<el-table-column prop="current" align="center" label="电流I(%)/漏电流(%)">
|
||||
<template #default="scope">
|
||||
<el-input-number v-if="!scope.row.isILeak" v-model="scope.row.current" :min="0" :precision="1" />
|
||||
<span v-else>{{ currentScheme.configParam.format[5].value + currentScheme.configParam.format[5].unit }}</span>
|
||||
<div v-if="!scope.row.isILeak" style="display: flex; align-items: center;">
|
||||
<!-- <el-tooltip class="box-item" effect="dark" content="电流I(%)" placement="left">
|
||||
<el-input-number v-model="scope.row.current" :min="0" :precision="1" />
|
||||
</el-tooltip> -->
|
||||
<p style="width:50px">电流: </p>
|
||||
<el-input-number v-model="scope.row.current" :min="0" :precision="1" />
|
||||
</div>
|
||||
<!-- <el-input-number v-model="scope.row.current" :min="0" :precision="1" /> -->
|
||||
<div v-else style="display: flex; align-items: center;">
|
||||
<!-- <el-tooltip class="box-item" effect="dark" content="漏电流(%)" placement="left">
|
||||
<el-input-number v-model="scope.row.current" :min="0" :precision="1" />
|
||||
</el-tooltip> -->
|
||||
<p style="width:50px">漏电流: </p>
|
||||
<el-input-number v-model="scope.row.current" :min="0" :precision="1" />
|
||||
</div>
|
||||
<!-- <span v-else>{{ currentScheme.configParam.format[5].value + currentScheme.configParam.format[5].unit }}</span> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="powerFactor" align="center" label="功率因数">
|
||||
<el-table-column prop="powerFactor" align="center" label="功率因数" width="120">
|
||||
<template #default="scope">
|
||||
<el-select v-model="scope.row.powerFactor">
|
||||
<el-option label="0.5L" value="0.5L" />
|
||||
|
@ -370,6 +384,78 @@
|
|||
</el-table>
|
||||
</div>
|
||||
|
||||
<el-divider>标定后检测步骤</el-divider>
|
||||
<div class="calibration-steps">
|
||||
<div class="steps-header">
|
||||
<!-- <el-button type="primary" @click="addCalibrationLaterStep">添加步骤</el-button> -->
|
||||
</div>
|
||||
<el-table :data="currentScheme.laterSteps" size="small" style="width: 100%">
|
||||
<!-- <el-table-column type="index" width="50" />-->
|
||||
<el-table-column prop="id" align="center" label="排序" width="80" />
|
||||
<!-- <el-table-column prop="id" align="center" label="步骤值">-->
|
||||
<!-- <template #default="scope">-->
|
||||
<!-- <el-input-number v-model="scope.row.id" :min="0" />-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column prop="step" align="center" label="步骤值">
|
||||
<template #default="scope">
|
||||
<el-input-number v-model="scope.row.step" :min="1" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="voltage" align="center" label="电压U(%)">
|
||||
<template #default="scope">
|
||||
<el-input-number v-model="scope.row.voltage" :min="0" :precision="1" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="current" align="center" label="电流I(%)/漏电流(%)">
|
||||
|
||||
<template #default="scope">
|
||||
<div v-if="!scope.row.isILeak" style="display: flex; align-items: center;">
|
||||
<!-- <el-tooltip class="box-item" effect="dark" content="电流I(%)" placement="left">
|
||||
<el-input-number v-model="scope.row.current" :min="0" :precision="1" />
|
||||
</el-tooltip> -->
|
||||
<p style="width:50px">电流: </p>
|
||||
<el-input-number v-model="scope.row.current" :min="0" :precision="1" />
|
||||
</div>
|
||||
<!-- <el-input-number v-model="scope.row.current" :min="0" :precision="1" /> -->
|
||||
<div v-else style="display: flex; align-items: center;">
|
||||
<!-- <el-tooltip class="box-item" effect="dark" content="漏电流(%)" placement="left">
|
||||
<el-input-number v-model="scope.row.current" :min="0" :precision="1" />
|
||||
</el-tooltip> -->
|
||||
<p style="width:50px">漏电流: </p>
|
||||
<el-input-number v-model="scope.row.current" :min="0" :precision="1" />
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="current" align="center" label="电流Ib(%)">
|
||||
<template #default="scope">
|
||||
<el-input-number v-model="scope.row.current" :min="0" :precision="1" />
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column prop="powerFactor" align="center" label="功率因数" width="120">
|
||||
<template #default="scope">
|
||||
<el-select v-model="scope.row.powerFactor">
|
||||
<el-option label="0.5L" value="0.5L" />
|
||||
<el-option label="0.8L" value="0.8L" />
|
||||
<el-option label="1" value="1" />
|
||||
<el-option label="0.5C" value="0.5C" />
|
||||
<el-option label="0.8C" value="0.8C" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="isILeak" align="center" label="检测漏电" width="120">
|
||||
<template #default="scope">
|
||||
<el-switch v-model="scope.row.isILeak" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="80">
|
||||
<template #default="scope">
|
||||
<!-- <el-button type="danger" link @click="deleteCalibrationLaterStep(scope.$index)">删除</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<!-- 新增:漏电检测设置分组 -->
|
||||
<el-divider>漏电检测设置</el-divider>
|
||||
<el-row :gutter="20">
|
||||
|
@ -425,7 +511,7 @@
|
|||
<el-table-column v-for="col in logParamColumns" :key="col.key" :prop="'paramMap.' + col.valueKey + '.actualError'" :label="col.valueKey" align="center">
|
||||
<template #header>
|
||||
<el-tooltip effect="dark" :content="(col.valueName || col.valueKey) + (col.valueUnit ? ' [' + col.valueUnit + ']' : '')" placement="top">
|
||||
<span>{{ col.valueKey }}</span>
|
||||
<span>{{ (col.valueName || col.valueKey) + (col.valueUnit ? ' [' + col.valueUnit + ']' : '') }}</span>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
|
@ -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);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
@ -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 */
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.custom-message-box.el-button--primary {
|
||||
background-color: #f56c6c !important;
|
||||
border-color: #f56c6c !important;
|
||||
}
|
||||
|
||||
.custom-message-box.el-button--primary:hover {
|
||||
background-color: #cc0000 !important;
|
||||
border-color: #cc0000 !important;
|
||||
}
|
||||
</style>
|
||||
|
|
Loading…
Reference in New Issue