From 09f1af9a0a1dffa5ed643e715b7d406bcd1aa872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Wed, 9 Sep 2026 10:31:22 +0800 Subject: [PATCH] =?UTF-8?q?fix(styles):=20=E8=B0=83=E6=95=B4=E5=BF=85?= =?UTF-8?q?=E5=A1=AB=E6=98=9F=E5=8F=B7=E4=B8=8E=E6=A0=87=E7=AD=BE=E9=A6=96?= =?UTF-8?q?=E8=A1=8C=E5=AF=B9=E9=BD=90=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改 .el-form-item__label 的对齐方式使必填星号与首行文字齐平 - 设置多标签布局下星号对齐,兼容单行和多行标签显示 - 调整 ::before 伪元素行高和外边距,确保星号基线一致 fix(project-apply): 更新表单字段“资金需求”为“履约保证金” - 修改项目申请页面中“资金需求”标签为“履约保证金” - 更新对应验证规则标签名称,保持校验一致性 chore(config): 更新开发服务器端口及代理设置 - 注释旧服务器配置,启用新端口 2889 - 更新 /api 代理目标地址为 172.16.203.228:8000 - 保持代理跨域设置不变 --- .workbuddy/memory/2026-09-09.md | 5 +++++ src/styles/element-ui.scss | 22 ++++++++++++++-------- src/views/business/project-apply.vue | 4 ++-- vite.config.mjs | 26 +++++++++++++------------- 4 files changed, 34 insertions(+), 23 deletions(-) create mode 100644 .workbuddy/memory/2026-09-09.md diff --git a/.workbuddy/memory/2026-09-09.md b/.workbuddy/memory/2026-09-09.md new file mode 100644 index 0000000..7a11bee --- /dev/null +++ b/.workbuddy/memory/2026-09-09.md @@ -0,0 +1,5 @@ + +## 必填星号与 label 首行齐平(全局) +- 根因:`element-ui.scss` 中 `.el-form-item--label-right .el-form-item__label { align-items:center }` 使 inline-flex label 的星号 `::before`(独立 flex 子项)在多行折行时被垂直居中。 +- 修复:label 改 `align-self:center`(整体仍随行垂直居中)+ `align-items:flex-start`(星号/文字首行齐平),覆盖 label-right/left/top 三种位置;旧 inline-block 注释已修正。 +- 影响页面:project-apply 独立表单页等所有多行 label 场景(弹窗内 `white-space:nowrap` 不受影响)。 diff --git a/src/styles/element-ui.scss b/src/styles/element-ui.scss index e5439c6..e826a61 100644 --- a/src/styles/element-ui.scss +++ b/src/styles/element-ui.scss @@ -1047,23 +1047,29 @@ .el-form-item--default .el-form-item__label { line-height: 14px; } -.el-form-item--label-right .el-form-item__label { - align-items: center; +// ============ 必填星号 * 与 label 首行齐平(全局) ============ +// label 为 inline-flex,星号 ::before 与文字是两个独立 flex 子项; +// 多行折行 label 若 align-items: center,星号会被垂直居中到第二行位置。 +// align-items: flex-start 让星号与文字首行齐平; +// align-self: center 让 label 整体不随表单行(32px)拉伸,单行 label 仍与输入框垂直居中,视觉不变。 +.el-form-item--label-right .el-form-item__label, +.el-form-item--label-left .el-form-item__label, +.el-form-item--label-top .el-form-item__label { + align-self: center; + align-items: flex-start; } .el-form-item--default { margin-bottom: 14px; } -// ============ 必填星号 * 与首行文字垂直居中 ============ -// Element Plus 默认 .el-form-item__label 为 inline-flex + align-items: flex-start, -// 星号 :before 高度(1em) 与文字行盒(line-height) 不一致时,多行/折行 label 会偏上。 -// 让 :before 跟随 label 行高、以 inline-block 参与行内对齐即可修复, -// 兼容单行(默认 32px)与多行(auto + 18px)两种 label 高度场景。 -// 注:客商档案(customer-archive)的 label 为 auto 高度 + padding 下沉方案,scoped 特异性更高会覆盖本规则。 +// 辅助:星号跟随 label 行高,保证与首行文字基线一致(单行/多行通用)。 +// 注:真正的首行对齐由上方 .el-form-item__label 的 align-items: flex-start 完成; +// 客商档案(customer-archive)的 label 为 auto 高度 + padding 下沉方案,scoped 特异性更高会覆盖本规则。 .el-form-item.is-required .el-form-item__label::before { display: inline-block; line-height: inherit; margin-right: 4px; + margin-top: 2px !important; } //.el-form-item { // margin-bottom: 15px !important; diff --git a/src/views/business/project-apply.vue b/src/views/business/project-apply.vue index 42ced0b..4ab860c 100644 --- a/src/views/business/project-apply.vue +++ b/src/views/business/project-apply.vue @@ -376,7 +376,7 @@ - + { __VUE_I18N_LEGACY_API__: true, __INTLIFY_PROD_DEVTOOLS__: false, }, - server: { - port: 2888, - proxy: { - '/api': { - target: 'http://localhost', - //target: 'https://saber3.bladex.cn/api', - changeOrigin: true, - rewrite: path => path.replace(/^\/api/, ''), - }, - }, - }, // server: { - // port: 2889, + // port: 2888, // proxy: { // '/api': { - // target: 'http://172.16.203.228:8000', + // target: 'http://localhost', + // //target: 'https://saber3.bladex.cn/api', // changeOrigin: true, + // rewrite: path => path.replace(/^\/api/, ''), // }, // }, // }, + server: { + port: 2889, + proxy: { + '/api': { + target: 'http://172.16.203.228:8000', + changeOrigin: true, + }, + }, + }, resolve: { alias: { '~': resolve(__dirname, './'),