From 57973d2a25401a8137de116f4e200ab14610e7d6 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期四, 08 十月 2026 13:32:48 +0800
Subject: [PATCH] feat(order): 新增订单编辑功能并完善表单验证 - 实现订单表单验证规则,包括送样日期必填验证 - 修复送样日期字段映射问题 - 完善文件上传组件的动态宽度计算 - 添加检验依据搜索过滤功能
---
src/components/Table/lims-table.vue | 37 +++++++++++++++++++++++++------------
1 files changed, 25 insertions(+), 12 deletions(-)
diff --git a/src/components/Table/lims-table.vue b/src/components/Table/lims-table.vue
index 4915359..d8e09e0 100644
--- a/src/components/Table/lims-table.vue
+++ b/src/components/Table/lims-table.vue
@@ -13,7 +13,7 @@
:filter-method="item.filterHandler" :filter-multiple="item.filterMultiple" :filtered-value="item.filteredValue"
:filters="item.filters" :fixed="item.fixed" :label="item.label" :prop="item.prop"
:show-overflow-tooltip="item.dataType === 'action' || item.dataType === 'slot' ? false : true"
- :min-width="item.dataType == 'action' ? btnWidth : getTitleWidth(item)"
+ :min-width="item.dataType == 'action' ? btnWidth : item.width"
:sortable="item.sortable ? true : false" :type="item.type" :width="item.dataType == 'action' ? btnWidth : item.width" align="center">
<!-- <div class="123" v-if="item.type == ''"> -->
<template v-if="item.hasOwnProperty('colunmTemplate')" :slot="item.colunmTemplate" slot-scope="scope">
@@ -64,7 +64,7 @@
<!-- 鎸夐挳 -->
<div v-else-if="item.dataType == 'action'"
- :style="`width:${getWidth(item.operation, scope.row)}`">
+ :style="`min-width:${getWidth(item.operation, scope.row)}`">
<template v-for="(o, key) in item.operation">
<el-button v-show="o.type != 'upload'" size="mini" v-if="o.showHide ? o.showHide(scope.row) : true"
:disabled="o.disabled ? o.disabled(scope.row) : false" :icon="iconFn(o)" :plain="o.plain"
@@ -162,7 +162,7 @@
// plain锛氭寜elementUi 鏂囨。涓哄噯
// clickFun锛氭寜閽殑鍥炶皟鍑芥暟
export default {
- name: "ZTTable",
+ name: "LimsTable",
filters: {
typeFn(val, row) {
if (typeof val === "function") {
@@ -264,11 +264,21 @@
data() {
return {
spanList: [],
- btnWidth: "120px",
uploadRefs: [],
currentFiles: {}, // 鐢ㄤ簬瀛樺偍姣忚鐨勫綋鍓嶆枃浠�
uploadKeys: {} // 鐢ㄤ簬鍔ㄦ�侀噸缃粍浠�
};
+ },
+ computed: {
+ btnWidth() {
+ let width = 120;
+ this.column.filter(item => item.dataType === 'action').forEach(item => {
+ this.tableData.forEach(row => {
+ width = Math.max(width, parseInt(this.getWidth(item.operation, row), 10));
+ });
+ });
+ return `${width}px`;
+ }
},
mounted() {
this.calculateSpanInfo();
@@ -302,8 +312,7 @@
count += a.name.length;
}
});
- this.btnWidth = count * 15 + 50 + "px";
- return count * 15 + 50 + "px";
+ return count * 15 + 60 + "px";
},
getTitleWidth(row) {
if (row.label.includes('鏃堕棿') || row.label.includes('缂栧彿') || row.label.includes('鏍峰搧鍚嶇О') || row.label.includes('闆朵欢')) {
@@ -321,10 +330,11 @@
}
},
iconFn(row) {
+ if (Object.prototype.hasOwnProperty.call(row, 'icon')) {
+ return row.icon;
+ }
if (row.name === "缂栬緫" || row.name === "淇敼") {
return "el-icon-edit";
- } else if (row.name === "鍒犻櫎") {
- return "el-icon-delete";
} else if (row.name === "鏌ョ湅") {
return "el-icon-view";
} else {
@@ -492,19 +502,22 @@
padding-left: 10px !important;
}
-.lims-table .highlight-warning-row-border td:first-child {
+.lims-table >>> .highlight-warning-row-border td:first-child {
border-left: 4px solid #ffcd29;
}
-.lims-table .highlight-warning-row-border td:last-child {
+.lims-table >>> .highlight-warning-row-border td:last-child {
border-right: 4px solid #ffcd29;
}
-.lims-table .highlight-danger-row-border td:first-child {
+.lims-table >>> .highlight-danger-row-border td:first-child {
border-left: 4px solid #f56c6c;
}
-.lims-table .highlight-danger-row-border td:last-child {
+.lims-table >>> .highlight-danger-row-border td:last-child {
border-right: 4px solid #f56c6c;
}
+>>>.red-row td {
+ background: #FFCCCC !important;
+}
</style>
--
Gitblit v1.9.3