From ac2422ab8ffab81e18e49958c123e728d95fce20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=96=87=E6=98=8A?= Date: Thu, 4 Jun 2026 18:47:27 +0800 Subject: [PATCH] =?UTF-8?q?style,feat,fix:=20=E5=A4=9A=E5=A4=84=E4=B8=9A?= =?UTF-8?q?=E5=8A=A1=E4=B8=8E=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 调整供应商名称样式提升可读性 2. 简化接口id路径匹配规则 3. 修复数据源配置换行格式 4. 新增物料基础信息与性能参数展示 5. 优化报价对比布局与加载逻辑 --- .../controller/bid/BizMaterialController.java | 2 +- .../src/main/resources/application-druid.yml | 120 +++++++++--------- .../material/components/CompareSection.vue | 86 +++++++++++-- .../material/components/SupplierQuoteTab.vue | 4 +- 4 files changed, 137 insertions(+), 75 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/bid/BizMaterialController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/bid/BizMaterialController.java index b6c43fb0..50a1e49e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/bid/BizMaterialController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/bid/BizMaterialController.java @@ -27,7 +27,7 @@ public class BizMaterialController extends BaseController { } @PreAuthorize("@ss.hasPermi('bid:material:query')") - @GetMapping("/{id:\\\\d+}") + @GetMapping("/{id}") public AjaxResult getInfo(@PathVariable Long id) { return success(service.selectBizMaterialById(id)); } diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index 379fa7c8..5bb07dbe 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -1,61 +1,61 @@ -# 数据源配置 -spring: - datasource: - type: com.alibaba.druid.pool.DruidDataSource - driverClassName: com.mysql.cj.jdbc.Driver - druid: - # 主库数据源 - master: - url: jdbc:mysql://49.232.154.205:13306/ryvue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8 - username: root - password: Root@12345 - # 从库数据源 - slave: - # 从数据源开关/默认关闭 - enabled: false - url: - username: - password: - # 初始连接数 - initialSize: 5 - # 最小连接池数量 - minIdle: 10 - # 最大连接池数量 - maxActive: 20 - # 配置获取连接等待超时的时间 - maxWait: 60000 - # 配置连接超时时间 - connectTimeout: 30000 - # 配置网络超时时间 - socketTimeout: 60000 - # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 - timeBetweenEvictionRunsMillis: 60000 - # 配置一个连接在池中最小生存的时间,单位是毫秒 - minEvictableIdleTimeMillis: 300000 - # 配置一个连接在池中最大生存的时间,单位是毫秒 - maxEvictableIdleTimeMillis: 900000 - # 配置检测连接是否有效 - validationQuery: SELECT 1 FROM DUAL - testWhileIdle: true - testOnBorrow: false - testOnReturn: false - webStatFilter: - enabled: true - statViewServlet: - enabled: true - # 设置白名单,不填则允许所有访问 - allow: - url-pattern: /druid/* - # 控制台管理用户名和密码 - login-username: ruoyi - login-password: 123456 - filter: - stat: - enabled: true - # 慢SQL记录 - log-slow-sql: true - slow-sql-millis: 1000 - merge-sql: true - wall: - config: +# 数据源配置 +spring: + datasource: + type: com.alibaba.druid.pool.DruidDataSource + driverClassName: com.mysql.cj.jdbc.Driver + druid: + # 主库数据源 + master: + url: jdbc:mysql://49.232.154.205:13306/ryvue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8 + username: root + password: Root@12345 + # 从库数据源 + slave: + # 从数据源开关/默认关闭 + enabled: false + url: + username: + password: + # 初始连接数 + initialSize: 5 + # 最小连接池数量 + minIdle: 10 + # 最大连接池数量 + maxActive: 20 + # 配置获取连接等待超时的时间 + maxWait: 60000 + # 配置连接超时时间 + connectTimeout: 30000 + # 配置网络超时时间 + socketTimeout: 60000 + # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 + timeBetweenEvictionRunsMillis: 60000 + # 配置一个连接在池中最小生存的时间,单位是毫秒 + minEvictableIdleTimeMillis: 300000 + # 配置一个连接在池中最大生存的时间,单位是毫秒 + maxEvictableIdleTimeMillis: 900000 + # 配置检测连接是否有效 + validationQuery: SELECT 1 FROM DUAL + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + webStatFilter: + enabled: true + statViewServlet: + enabled: true + # 设置白名单,不填则允许所有访问 + allow: + url-pattern: /druid/* + # 控制台管理用户名和密码 + login-username: ruoyi + login-password: 123456 + filter: + stat: + enabled: true + # 慢SQL记录 + log-slow-sql: true + slow-sql-millis: 1000 + merge-sql: true + wall: + config: multi-statement-allow: true \ No newline at end of file diff --git a/ruoyi-ui/src/views/bid/material/components/CompareSection.vue b/ruoyi-ui/src/views/bid/material/components/CompareSection.vue index 0bd9a8f5..c3edf443 100644 --- a/ruoyi-ui/src/views/bid/material/components/CompareSection.vue +++ b/ruoyi-ui/src/views/bid/material/components/CompareSection.vue @@ -65,6 +65,10 @@
+
+ 物料编码 + {{ mat.materialCode || '—' }} +
规格型号 {{ mat.spec || '—' }} @@ -81,6 +85,30 @@ 单位 {{ mat.unit || '—' }}
+
+ 所属分类 + {{ mat.categoryName || '—' }} +
+
+ 用途 + {{ mat.purpose || '—' }} +
+
+
+ + +
+
+ + 性能参数 + +
+
+
+ {{ p.name }} + {{ p.value }} + {{ p.unit }} +
@@ -212,11 +240,9 @@ export default { async initLoad() { this.loadError = null; await this.loadSameNameMaterials(); - const allIds = this.sameNameMaterials.map(m => m.materialId); - this._loadingLock = true; - await this.loadQuoteComparison(allIds); - this.targetIds = allIds; - this._loadingLock = false; + // 仅加载当前物料的报价数据,不自动选择其他物料进行对比 + await this.loadQuoteComparison([]); + this.targetIds = []; }, async loadSameNameMaterials() { @@ -235,11 +261,8 @@ export default { async handleSelectionChange(selectedIds) { if (this._loadingLock) return; this.loadError = null; - if (selectedIds.length) { - await this.loadQuoteComparison(selectedIds); - } else { - this.quoteMap = {}; - } + // 无论是否还有选中物料,都重新加载(空数组时仅加载当前物料报价) + await this.loadQuoteComparison(selectedIds || []); }, async loadQuoteComparison(materialIds) { @@ -284,6 +307,14 @@ export default { }); }, + parsePerfParams(jsonStr) { + if (!jsonStr) return []; + try { + const parsed = JSON.parse(jsonStr); + return Array.isArray(parsed) ? parsed : []; + } catch { return []; } + }, + formatDate(val) { if (!val) return '—'; const d = new Date(val); @@ -441,7 +472,7 @@ export default { /* ========== 卡片网格 ========== */ .quote-comparison-grid { display: grid; - grid-template-columns: repeat(auto-fill, minmax(480px, 1fr)); + grid-template-columns: repeat(auto-fit, minmax(480px, 1fr)); gap: 16px; } @@ -492,7 +523,7 @@ export default { } .basic-info-grid { display: grid; - grid-template-columns: 1fr 1fr; + grid-template-columns: 1fr 1fr 1fr; gap: 8px 20px; } .basic-info-item { @@ -690,6 +721,37 @@ export default { } .quote-empty i { font-size: 32px; } +/* ========== 性能参数 ========== */ +.perf-params-section { + padding: 0 8px 8px; +} +.perf-params-grid { + display: flex; + flex-wrap: wrap; + gap: 8px; + padding: 8px 10px; +} +.perf-item { + display: flex; + align-items: center; + gap: 4px; + background: #f5f7fa; + padding: 4px 10px; + border-radius: 4px; + font-size: 12px; +} +.perf-name { + color: #909399; +} +.perf-value { + color: #303133; + font-weight: 600; +} +.perf-unit { + color: #909399; + font-size: 11px; +} + /* ========== 响应式适配 ========== */ @media screen and (max-width: 1200px) { .quote-comparison-grid { diff --git a/ruoyi-ui/src/views/bid/material/components/SupplierQuoteTab.vue b/ruoyi-ui/src/views/bid/material/components/SupplierQuoteTab.vue index 2c789775..31dff717 100644 --- a/ruoyi-ui/src/views/bid/material/components/SupplierQuoteTab.vue +++ b/ruoyi-ui/src/views/bid/material/components/SupplierQuoteTab.vue @@ -168,8 +168,8 @@ export default { } .supplier-name { - font-size: 8px; - font-weight: 200; + font-size: 14px; + font-weight: 600; color: #303133; margin-bottom: 4px; line-height: 1.4;