From 7ebe2e3f10bed3d5e3c0015a1ac3a7b39788b55f Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期五, 30 一月 2026 14:31:56 +0800
Subject: [PATCH] fix: 绑定关系中操作栏点击删除按钮,删除不了(未调接口)
---
src/views/reportAnalysis/productionAnalysis/components/center-bottom.vue | 2
src/views/qualityManagement/metricBinding/index.vue | 76 ++++++++++++++++++++++++++++----------
2 files changed, 57 insertions(+), 21 deletions(-)
diff --git a/src/views/qualityManagement/metricBinding/index.vue b/src/views/qualityManagement/metricBinding/index.vue
index ac67474..2a78e1d 100644
--- a/src/views/qualityManagement/metricBinding/index.vue
+++ b/src/views/qualityManagement/metricBinding/index.vue
@@ -1,7 +1,9 @@
<template>
<div class="app-container metric-binding">
- <!-- 宸︿晶锛氭娴嬫爣鍑嗗垪琛紙鍙锛� -->
- <div class="left-panel">
+ <el-row :gutter="16" class="metric-binding-row">
+ <!-- 宸︿晶锛氭娴嬫爣鍑嗗垪琛� -->
+ <el-col :xs="24" :sm="24" :md="12" :lg="14" :xl="14" class="left-col">
+ <div class="panel left-panel">
<PIMTable
rowKey="id"
:column="standardColumns"
@@ -72,10 +74,12 @@
</el-select>
</template>
</PIMTable>
- </div>
+ </div>
+ </el-col>
- <!-- 鍙充晶锛氱粦瀹氬垪琛� -->
- <div class="right-panel">
+ <!-- 鍙充晶锛氱粦瀹氬垪琛� -->
+ <el-col :xs="24" :sm="24" :md="12" :lg="10" :xl="10" class="right-col">
+ <div class="panel right-panel">
<div class="right-header">
<div class="title">缁戝畾鍏崇郴</div>
<div class="desc" v-if="currentStandard">
@@ -108,7 +112,9 @@
</template>
</el-table-column>
</el-table>
- </div>
+ </div>
+ </el-col>
+ </el-row>
<!-- 娣诲姞缁戝畾寮规 -->
<el-dialog
@@ -375,15 +381,21 @@
}
const handleUnbind = async (row) => {
- if (!row?.id) return
+ const id = row?.id ?? row?.qualityTestStandardBindingId
+ if (id == null || id === '') return
try {
await ElMessageBox.confirm('纭鍒犻櫎璇ョ粦瀹氾紵', '鎻愮ず', { type: 'warning' })
} catch {
return
}
- await qualityTestStandardBindingDel([row.qualityTestStandardBindingId])
- proxy.$message.success('鍒犻櫎鎴愬姛')
- loadBindingList()
+ try {
+ await qualityTestStandardBindingDel([id])
+ proxy.$message.success('鍒犻櫎鎴愬姛')
+ loadBindingList()
+ } catch (err) {
+ console.error('鍒犻櫎缁戝畾澶辫触:', err)
+ proxy.$message?.error(err?.message || '鍒犻櫎澶辫触')
+ }
}
const handleBatchUnbind = async () => {
@@ -391,15 +403,26 @@
proxy.$message.warning('璇烽�夋嫨鏁版嵁')
return
}
- const ids = bindingSelectedRows.value.map((i) => i.qualityTestStandardBindingId)
+ const ids = bindingSelectedRows.value
+ .map((i) => i?.id ?? i?.qualityTestStandardBindingId)
+ .filter((id) => id != null && id !== '')
+ if (!ids.length) {
+ proxy.$message.warning('閫変腑鏁版嵁缂哄皯鏈夋晥 id')
+ return
+ }
try {
await ElMessageBox.confirm('閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�', '鍒犻櫎鎻愮ず', { type: 'warning' })
} catch {
return
}
- await qualityTestStandardBindingDel(ids)
- proxy.$message.success('鍒犻櫎鎴愬姛')
- loadBindingList()
+ try {
+ await qualityTestStandardBindingDel(ids)
+ proxy.$message.success('鍒犻櫎鎴愬姛')
+ loadBindingList()
+ } catch (err) {
+ console.error('鎵归噺鍒犻櫎缁戝畾澶辫触:', err)
+ proxy.$message?.error(err?.message || '鍒犻櫎澶辫触')
+ }
}
onMounted(() => {
@@ -410,16 +433,29 @@
<style scoped>
.metric-binding {
- display: flex;
- gap: 16px;
+ padding: 0;
+}
+
+.metric-binding-row {
+ width: 100%;
+}
+
+.metric-binding-row .left-col,
+.metric-binding-row .right-col {
+ margin-bottom: 16px;
+}
+
+.metric-binding-row .panel {
+ background: #ffffff;
+ padding: 16px;
+ box-sizing: border-box;
+ height: 100%;
+ min-height: 400px;
}
.left-panel,
.right-panel {
- flex: 1;
- background: #ffffff;
- padding: 16px;
- box-sizing: border-box;
+ height: 100%;
}
.toolbar {
diff --git a/src/views/reportAnalysis/productionAnalysis/components/center-bottom.vue b/src/views/reportAnalysis/productionAnalysis/components/center-bottom.vue
index 43eb7d8..46a870a 100644
--- a/src/views/reportAnalysis/productionAnalysis/components/center-bottom.vue
+++ b/src/views/reportAnalysis/productionAnalysis/components/center-bottom.vue
@@ -255,7 +255,7 @@
}
.progress-table-container {
- height: 280px;
+ height: 320px;
overflow-y: auto;
overflow-x: hidden;
margin-top: 10px;
--
Gitblit v1.9.3