The fifth week of front-end internship

foreword

You still have to record what you do every day, otherwise you will find out after two days, and slowly forget what you have gained and what you have done.

What I did this week was the sample library part of the medical testing system. Because it is the company's code, I can't explain the details. Let's talk about what I did every day and some of my gains.

on Monday

After using treambition to get the task on Monday morning, I felt that the task was heavy. This week's tasks focus on the sample library table and some functions of the table, such as adding and modifying.

But the special thing about the table is that it is not an ordinary table, but a tree-shaped table. I can describe it a little bit. Each type of fungus has its own daughter fungus, and the daughter fungus has many generations. bacteria. Doing this requires the logic of the front end and the tacit cooperation with the back end.

In the afternoon of the first day, three interfaces were encapsulated, namely query, modification, and query sub-bacteria.

And also changed a bug, a strange bug that can run but shows that the data is undefined, the record blog is as follows:

The front end can run normally, but the console reports an error data of undefined onMounted, it is best not to use asynchronous writing

Tuesday

The task to do on Tuesday is to render the tree table. Because it is a tree data structure. Let me talk about the logic of the backend. There are more than 10,000 pieces of data, so much that it is unrealistic to render them all at once. So the backend hopes that the frontend can render step by step.

Let me talk about the logic given to me by the backend. First, a table with some types of bacteria. Some bacteria have child nodes, and some do not. Bacteria with child nodes have a field ID. At the beginning, the front end only needs to render the first layer of data. When rendering, judge the identifier. If there is an identifier, use an interface to query sub-nodes according to the identifier. After finding the data, put the data into the found data and render it in the table.

In element-ui, if one layer of data nests another layer, it can be rendered hierarchically. So use the code to make a conditional judgment after rendering the first time, and successfully make the second layer.

The simple thing is pagination. After getting a front-end pager, get the number and size of pages in the pager, and save it. It can be passed to the backend when needed.

Wednesday

The third day is button functions, such as storage, storage, and modification functions. In fact, it is to call an interface-update interface.

In addition, the function of adding bacteria of the same level and passing bacteria has been done. The logic is very simple, click on a line of the table, click the button to add a new sibling, then the front end will get the data, and modify its id to be empty (automatically generated by the back end), because it is the same level, the parent node directly inherits the obtained data That's it.

If there is a problem with the logic of the new passaging bacteria, do not do it first.

Thursday

Test the function and find that there is a problem with the data. If the problem is found, the record is as follows:

Front-end modification and new operations lead to data deletion - js precision loss

It is this problem that causes all my operations to be more or less problematic. Just solve it. The function of adding a new generation of bacteria is added, and the id of the father's node is used as the id of the parent node, and the child node is empty.

Today, the modify button was also modified. As long as it is the data that can be checked back at the back end, it cannot be easily modified, which is very important. Therefore, it is necessary to negotiate with the back end in advance, so that the efficiency of the front end will also be improved.

friday

Completed a small problem, and continued to solve the problem. The problems left over from before are still there, let's continue to work harder next week.

Guess you like

Origin blog.csdn.net/zxdznyy/article/details/132353655
Recommended