Commit 4bd2f6ee by linjinhong

Merge remote-tracking branch 'origin/dev'

parents 59ca3500 daac1dc2
......@@ -263,7 +263,7 @@ async function getList(data?: {
editParams.value = {
zoneName: row.zoneName,
logistics: key,
codePrefix: e || '',
codePrefix: formatString(e) || '',
logisticsId: row[key].logisticsId,
}
}}
......@@ -315,7 +315,7 @@ function setCellStyle() {
const [cell, primaryCell] = ['.tableCell', '.primaryCell'].map((selector) =>
document.querySelectorAll(selector),
)
const getAncestor = (element: Element, level = 2) => {
const getAncestor = (element: Element, level = 3) => {
let current = element
while (level-- > 0 && current) {
current = current.parentElement as Element
......@@ -434,6 +434,18 @@ async function editClosed() {
editParams.value = {}
}
}
function formatString(input: string) {
// 1. 替换所有中文逗号为英文逗号
// 2. 移除所有空格
// 3. 将连续逗号替换为单个逗号
// 4. 去除首尾可能的逗号
return input
.replace(/,/g, ',') // 中文逗号转英文逗号
.replace(/\s+/g, '') // 移除所有空格
.replace(/,+/g, ',') // 连续逗号替换为单个逗号
.replace(/^,|,$/g, '') // 去除首尾逗号
}
</script>
<style lang="scss" scoped>
......@@ -451,4 +463,37 @@ async function editClosed() {
.dialog-footer {
text-align: center;
}
:deep() {
// .vxe-cell {
// padding: 15px 10px !important;
// }
.col--edit::after {
content: '双击修改';
display: none;
position: absolute;
top: 0;
z-index: 99;
left: 50%;
transform: translate(-50%);
// width: 85px;
// height: 20px;
font-size: 10px;
line-height: 1;
border-radius: 5px;
padding: 2px 5px;
opacity: 0.5;
background-color: black;
text-align: center; /* 使文本居中 */
color: white; /* 文本颜色 */
}
.col--edit:hover::after {
display: block;
}
.col--active:hover::after {
content: '单击其他单元格确认';
white-space: nowrap;
}
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment