opentiny / tiny-vue

TinyVue is an enterprise-class UI component library of OpenTiny community, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.
https://opentiny.design/tiny-vue
MIT License
1.53k stars 251 forks source link

🐛 [Bug]: grid 组件,树形表格新增或者插入数据data-rowid没有按顺序排列 #1524

Open David-TechNomad opened 5 months ago

David-TechNomad commented 5 months ago

Version

v3.14.0

Vue Version

v 3.4

Link to minimal reproduction

data-rowid

Step to reproduce

grid 组件,新增或者插入数据data-rowid没有按顺序排列 image

What is expected

grid 组件,树形表格新增或者插入数据data-rowid希望按顺序排列,或者可以增加通过seq获取数据的方法。需要实现的功能是shift功能,如果id乱了,shift获取到的中间数据就乱了,看seq是按 顺序排的 ,所以增加一个通过seq获取数据的方法也可以

What is actually happening

No response

What is your project name

bom树表组件

Any additional comments (optional)

No response

Issues-translate-bot commented 5 months ago

Bot detected the issue body's language is not English, translate it automatically.


Title: 🐛 [Bug]: grid component, new or inserted data data-rowid is not arranged in order

gimmyhehe commented 4 months ago

您好~,目前可以通过 this.$refs.grid.getData(0) 这样的方式来获取第一条数据。

Issues-translate-bot commented 4 months ago

Bot detected the issue body's language is not English, translate it automatically.


Hello~, currently you can get the first piece of data through this.$refs.grid.getData(0).

David-TechNomad commented 4 months ago

getData

此方法在平铺的数据可以,树形数据失效,获取不到子集的数据

Issues-translate-bot commented 4 months ago

Bot detected the issue body's language is not English, translate it automatically.


getData

This method works for tiled data, but fails for tree-shaped data, and no subset of data can be obtained.

gimmyhehe commented 1 month ago

@David-TechNomad 经过评估,id按照顺序排序的方案是不可取的,这意味着unshift后,原本所有表格行id都将改变,针对你说的这种情况,建议可以通过row-id自定ID的方式实现。然后通过方法getRowById获取对应的数据

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


@David-TechNomad After evaluation, the solution of sorting IDs in order is not advisable. This means that after unshift, all table row IDs will be changed. For this situation you mentioned, it is recommended to use row-id to automatically Implemented by specifying ID. Then get the corresponding data through the method getRowById