Ask a poll as well as the top requirements (Vue)?

the project written by Vue uses Element-ui "s Table

  1. background description
    the data in this table is polled (requests are sent by setInterval) and obtained in real time every other minute. The request parameters limit fix the number of tableList obtained for each request. Perhaps after a period of time, the original first data will become obsolete, and the original first data will not be returned by the backend, and then a new record will be added to return it, so the returned data is always limit .
    then the data in tableList is sorted by time;
    each row has the function of setting and unsetting the top: you can put the data of that row to the front;
    and the data of the whole table can be filtered by date;
  2. problem description
    my problem is mainly to set the top and unset the top. After
    is topped, how to ensure that the previously topped data will remain in the original topping order after the next request is completed? After uncapping, it is best to return to the original chronological order of the uncapped records.
    do you have any good ideas for implementation?
Nov.17,2021

Top function:
copy the data you want to top by splice first. Then unshift to the first
of the array to untop:
reorder by time


two variables solve
data
the location information before the top

I think this top order is best recorded in the background, otherwise it cannot be saved permanently, and storing it in the background is the safest and most accurate way.

Menu