From 3c116201cb760f29ed85501db3c3f5ec7a104b8b Mon Sep 17 00:00:00 2001 From: sheng <905537351@qq.com> Date: Thu, 25 Jun 2026 23:46:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=98=E7=9B=98=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E7=94=B5=E6=B1=A0=E5=8F=96=E6=B6=88=E6=BF=80=E6=B4=BB?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/page-table/index.vue | 15 +++++++++++++++ .../tray-registration/index.vue | 13 +++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/components/page-table/index.vue b/src/components/page-table/index.vue index 0d40e630..8b59aa26 100644 --- a/src/components/page-table/index.vue +++ b/src/components/page-table/index.vue @@ -84,6 +84,7 @@ :key="'sel-' + col.idx" type="selection" :width="col.width" + :selectable="selectionSelectable || undefined" /> ({}) }, + /** + * 选择列可选规则,透传给 el-table-column 的 selectable。 + * 例:row => row.active === 1 + */ + selectionSelectable: { type: Function, default: null }, + /** * 帮助文档的跳转 URL。传了才显示工具栏右侧的问号按钮,点击新窗口打开 * 例:'/docs/factory-area-help.html' @@ -426,6 +433,14 @@ export default { this.$emit('selection-change', val) }, + clearSelection () { + if (this.$refs.table && this.$refs.table.clearSelection) { + this.$refs.table.clearSelection() + } + this.tableSelected = [] + this.$emit('selection-change', []) + }, + /* ============ 帮助按钮 ============ */ openHelp () { diff --git a/src/views/planning-production/production-monitoring/tray-registration/index.vue b/src/views/planning-production/production-monitoring/tray-registration/index.vue index ffd6eb03..20d06425 100644 --- a/src/views/planning-production/production-monitoring/tray-registration/index.vue +++ b/src/views/planning-production/production-monitoring/tray-registration/index.vue @@ -102,12 +102,14 @@ { + const rows = [...this.selectedRows] await sendWorkerman({ sendData: { action: 'set_battery_inactivity', param: { - data: this.selectedRows.map(row => ({ + data: rows.map(row => ({ battery_id: row.Battery || row.battery_id, class: 'NG', classname: 'web_inactivity' @@ -660,16 +663,22 @@ export default { } } }) - this.selectedRows.forEach(row => { + rows.forEach(row => { const target = this.tableData.find(item => item.index === row.index) if (target) this.$set(target, 'active', 0) }) + this.tableData = [...this.tableData] + this.selectedRows = [] + if (this.$refs.batteryTable) this.$refs.batteryTable.clearSelection() this.$message.success(this.$t(this.key('batch_battery_deactivate_success'))) }).catch(() => {}) }, rowClassName ({ row }) { return Number(row.active) === 1 ? 'is-active-battery' : '' }, + isActiveBattery (row) { + return Number(row.active) === 1 + }, resetPage () { this.form.tray = '' this.batteryInputs = {}