Commit 69dcc0d0 by linjinhong

修改物流分区单元格hover文字说明

parent ecb98fd8
...@@ -263,7 +263,7 @@ async function getList(data?: { ...@@ -263,7 +263,7 @@ async function getList(data?: {
editParams.value = { editParams.value = {
zoneName: row.zoneName, zoneName: row.zoneName,
logistics: key, logistics: key,
codePrefix: e || '', codePrefix: formatString(e) || '',
logisticsId: row[key].logisticsId, logisticsId: row[key].logisticsId,
} }
}} }}
...@@ -315,7 +315,7 @@ function setCellStyle() { ...@@ -315,7 +315,7 @@ function setCellStyle() {
const [cell, primaryCell] = ['.tableCell', '.primaryCell'].map((selector) => const [cell, primaryCell] = ['.tableCell', '.primaryCell'].map((selector) =>
document.querySelectorAll(selector), document.querySelectorAll(selector),
) )
const getAncestor = (element: Element, level = 2) => { const getAncestor = (element: Element, level = 3) => {
let current = element let current = element
while (level-- > 0 && current) { while (level-- > 0 && current) {
current = current.parentElement as Element current = current.parentElement as Element
...@@ -434,6 +434,18 @@ async function editClosed() { ...@@ -434,6 +434,18 @@ async function editClosed() {
editParams.value = {} editParams.value = {}
} }
} }
function formatString(input: string) {
// 1. 替换所有中文逗号为英文逗号
// 2. 移除所有空格
// 3. 将连续逗号替换为单个逗号
// 4. 去除首尾可能的逗号
return input
.replace(/,/g, ',') // 中文逗号转英文逗号
.replace(/\s+/g, '') // 移除所有空格
.replace(/,+/g, ',') // 连续逗号替换为单个逗号
.replace(/^,|,$/g, '') // 去除首尾逗号
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -451,4 +463,37 @@ async function editClosed() { ...@@ -451,4 +463,37 @@ async function editClosed() {
.dialog-footer { .dialog-footer {
text-align: center; 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> </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