style,feat,fix: 多处业务与样式优化
1. 调整供应商名称样式提升可读性 2. 简化接口id路径匹配规则 3. 修复数据源配置换行格式 4. 新增物料基础信息与性能参数展示 5. 优化报价对比布局与加载逻辑
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -65,6 +65,10 @@
|
||||
<!-- 基础信息区 -->
|
||||
<div class="mat-basic-body">
|
||||
<div class="basic-info-grid">
|
||||
<div class="basic-info-item">
|
||||
<span class="basic-label">物料编码</span>
|
||||
<span class="basic-value">{{ mat.materialCode || '—' }}</span>
|
||||
</div>
|
||||
<div class="basic-info-item">
|
||||
<span class="basic-label">规格型号</span>
|
||||
<span class="basic-value">{{ mat.spec || '—' }}</span>
|
||||
@@ -81,6 +85,30 @@
|
||||
<span class="basic-label">单位</span>
|
||||
<span class="basic-value">{{ mat.unit || '—' }}</span>
|
||||
</div>
|
||||
<div class="basic-info-item">
|
||||
<span class="basic-label">所属分类</span>
|
||||
<span class="basic-value">{{ mat.categoryName || '—' }}</span>
|
||||
</div>
|
||||
<div class="basic-info-item">
|
||||
<span class="basic-label">用途</span>
|
||||
<span class="basic-value">{{ mat.purpose || '—' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 性能参数 -->
|
||||
<div v-if="mat.performanceParams" class="perf-params-section">
|
||||
<div class="section-divider">
|
||||
<span class="divider-line"></span>
|
||||
<span class="divider-text"><i class="el-icon-setting"></i> 性能参数</span>
|
||||
<span class="divider-line"></span>
|
||||
</div>
|
||||
<div class="perf-params-grid">
|
||||
<div v-for="(p, pIdx) in parsePerfParams(mat.performanceParams)" :key="pIdx" class="perf-item">
|
||||
<span class="perf-name">{{ p.name }}</span>
|
||||
<span class="perf-value">{{ p.value }}</span>
|
||||
<span class="perf-unit" v-if="p.unit">{{ p.unit }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user