Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] 合并单元格搜索高亮展示问题 #3320

Closed
Hi-lone opened this issue Jan 14, 2025 · 0 comments · Fixed by #3380
Closed

[Bug] 合并单元格搜索高亮展示问题 #3320

Hi-lone opened this issue Jan 14, 2025 · 0 comments · Fixed by #3380
Assignees
Labels
bug Something isn't working

Comments

@Hi-lone
Copy link

Hi-lone commented Jan 14, 2025

Version

1.12.0

Link to Minimal Reproduction

https://visactor.io/vtable/demo/table-type/pivot-analysis-table-indicator-row

Steps to Reproduce

样例地址:https://visactor.io/vtable/demo/table-type/pivot-analysis-table-indicator-row
样例代码:
`let tableInstance;
fetch('https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/North_American_Superstore_Pivot_data.json')
.then(res => res.json())
.then(data => {
const option = {
records: data,
rows: [
{
dimensionKey: 'City',
title: 'City',
headerStyle: {
textStick: true
}
}
],
columns: [
{
dimensionKey: 'Category',
title: 'Category',
headerStyle: {
textStick: true
},
width: 'auto'
}
],
indicators: [
{
indicatorKey: 'Quantity',
title: 'Quantity',
width: 'auto',
showSort: false,
headerStyle: {
fontWeight: 'normal',
color: 'purple'
},
style: {
padding: [16, 28, 16, 28],
color(args) {
if (args.dataValue >= 0) return 'black';
return 'red';
}
}
},
{
indicatorKey: 'Sales',
title: 'Sales',
width: 'auto',
showSort: false,
headerStyle: {
fontWeight: 'normal',
color: 'red'
},
format: rec => {
return '$' + Number(rec).toFixed(2);
},
style: {
padding: [16, 28, 16, 28],
color(args) {
if (args.dataValue >= 0) return 'black';
return 'red';
}
}
},
{
indicatorKey: 'Profit',
title: 'Profit',
width: 'auto',
showSort: false,
headerStyle: {
fontWeight: 'normal',
color: 'green'
},
format: rec => {
return '$' + Number(rec).toFixed(2);
},
style: {
padding: [16, 28, 16, 28],
color(args) {
if (args.dataValue >= 0) return 'black';
return 'red';
}
}
}
],
corner: {
titleOnDimension: 'row',
headerStyle: {
textStick: true
}
},
indicatorTitle: 'indicators title',
indicatorsAsCol: false,
dataConfig: {
sortRules: [
{
sortField: 'Category',
sortBy: ['Office Supplies', 'Technology', 'Furniture']
}
]
},
defaultHeaderColWidth: [120, 'auto'],
widthMode: 'standard'
};
tableInstance = new VTable.PivotTable(document.getElementById(CONTAINER_ID), option);
window['tableInstance'] = tableInstance;
const search = new SearchComponent({
table: tableInstance,
autoJump: true
});
window.search = search;
const dom = document.getElementById(CONTAINER_ID);

const searchContainer = document.createElement('div');
searchContainer.style.position = 'absolute';
searchContainer.style.top = '0';
searchContainer.style.right = '0';
searchContainer.style.backgroundColor = '#FFF';
const input = document.createElement('input');
searchContainer.appendChild(input);
const result = document.createElement('span');
result.innerText = '0/0';
searchContainer.appendChild(result);
const searchBtn = document.createElement('button');
searchBtn.innerText = 'search';
searchContainer.appendChild(searchBtn);
const nextBtn = document.createElement('button');
nextBtn.innerText = 'next';
searchContainer.appendChild(nextBtn);
const prevBtn = document.createElement('button');
prevBtn.innerText = 'prev';
searchContainer.appendChild(prevBtn);
searchBtn.addEventListener('click', () => {
  const searchResult = search.search(input.value);
  result.innerText =
    searchResult.results.length === 0 ? '0/0' : `${searchResult.index + 1}/${searchResult.results.length}`;
});
prevBtn.addEventListener('click', () => {
  const searchResult = search.prev();
  result.innerText =
    searchResult.results.length === 0 ? '0/0' : `${searchResult.index + 1}/${searchResult.results.length}`;
});
nextBtn.addEventListener('click', () => {
  const searchResult = search.next();
  result.innerText =
    searchResult.results.length === 0 ? '0/0' : `${searchResult.index + 1}/${searchResult.results.length}`;
});
dom.appendChild(searchContainer);

});`

Current Behavior

搜索后搜索到的合并单元格未高亮,且切换无高亮效果,直至切换至最后一个时候展示了部分格高亮,未展示整个合并单元后的高亮效果
image

Expected Behavior

对于合并后的单元能进行整体搜索且高亮展示

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

@Hi-lone Hi-lone added the bug Something isn't working label Jan 14, 2025
@Rui-Sun Rui-Sun linked a pull request Feb 7, 2025 that will close this issue
21 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants