fix 修复节点分发列表在部分场景出现错误数据行

This commit is contained in:
bwcx_jzy 2022-11-24 22:06:27 +08:00
parent 516ea3f876
commit d474bc0353
No known key found for this signature in database
GPG Key ID: 5E48E9372088B9E5
2 changed files with 17 additions and 8 deletions

View File

@ -7,6 +7,7 @@
1. 【server】优化节点转发超时时间计算方法 1. 【server】优化节点转发超时时间计算方法
2. 【server】优化构建项目上传文件、节点分发上传文件超时时间 2. 【server】优化构建项目上传文件、节点分发上传文件超时时间
3. 【server】修复 Docker 检查 URL 是否正确引起的 NPE (感谢@ 3. 【server】修复 Docker 检查 URL 是否正确引起的 NPE (感谢@
4. 【server】修复节点分发列表在部分场景出现错误数据行
------ ------

View File

@ -98,14 +98,14 @@
<!-- 嵌套表格 --> <!-- 嵌套表格 -->
<a-table <a-table
slot="expandedRowRender" slot="expandedRowRender"
slot-scope="text" slot-scope="record"
:loading="childLoading" :loading="childLoading"
:columns="childColumns" :columns="childColumns"
size="middle" size="middle"
:bordered="false" :bordered="false"
:data-source="text.children" :data-source="dispatchChildren[record.id]"
:pagination="false" :pagination="false"
:rowKey="(record, index) => record.nodeId + record.projectId + index" rowKey="id"
> >
<a-tooltip slot="nodeId" slot-scope="text" placement="topLeft" :title="text"> <a-tooltip slot="nodeId" slot-scope="text" placement="topLeft" :title="text">
<span>{{ nodeNameMap[text] || text }}</span> <span>{{ nodeNameMap[text] || text }}</span>
@ -575,6 +575,7 @@ export default {
fileList: [], fileList: [],
runModeList: runModeList, runModeList: runModeList,
list_expanded: {}, list_expanded: {},
dispatchChildren: {},
linkDispatchVisible: false, linkDispatchVisible: false,
editDispatchVisible: false, editDispatchVisible: false,
dispatchVisible: false, dispatchVisible: false,
@ -588,9 +589,9 @@ export default {
columns: [ columns: [
{ title: "分发 ID", dataIndex: "id", ellipsis: true, scopedSlots: { customRender: "id" } }, { title: "分发 ID", dataIndex: "id", ellipsis: true, scopedSlots: { customRender: "id" } },
{ title: "分发名称", dataIndex: "name", ellipsis: true, scopedSlots: { customRender: "name" } }, { title: "分发名称", dataIndex: "name", ellipsis: true, scopedSlots: { customRender: "name" } },
{ title: "类型", dataIndex: "outGivingProject", width: 90, ellipsis: true, scopedSlots: { customRender: "outGivingProject" } }, { title: "类型", dataIndex: "outGivingProject", width: "90px", ellipsis: true, scopedSlots: { customRender: "outGivingProject" } },
{ title: "分发后", dataIndex: "afterOpt", ellipsis: true, width: 100, scopedSlots: { customRender: "afterOpt" } }, { title: "分发后", dataIndex: "afterOpt", ellipsis: true, width: "150px", scopedSlots: { customRender: "afterOpt" } },
{ title: "清空发布", dataIndex: "clearOld", align: "center", ellipsis: true, width: 100, scopedSlots: { customRender: "clearOld" } }, { title: "清空发布", dataIndex: "clearOld", align: "center", ellipsis: true, width: "100px", scopedSlots: { customRender: "clearOld" } },
{ title: "间隔时间", dataIndex: "intervalTime", width: 90, ellipsis: true, scopedSlots: { customRender: "intervalTime" } }, { title: "间隔时间", dataIndex: "intervalTime", width: 90, ellipsis: true, scopedSlots: { customRender: "intervalTime" } },
{ title: "状态", dataIndex: "status", ellipsis: true, width: 110, scopedSlots: { customRender: "status" } }, { title: "状态", dataIndex: "status", ellipsis: true, width: 110, scopedSlots: { customRender: "status" } },
@ -976,8 +977,15 @@ export default {
handleReload(record) { handleReload(record) {
this.childLoading = true; this.childLoading = true;
getDispatchProject(record.id).then((res) => { getDispatchProject(record.id).then((res) => {
if (res.code === 200) { if (res.code === 200 && res.data) {
record.children = res.data; this.dispatchChildren = {
...this.dispatchChildren,
[record.id]: res.data.map((item) => {
return { ...item, id: `${item.id}-${item.nodeId}-${item.projectId}-${new Date().getTime()}` };
}),
// [{ ...res.data[0], }],
};
// record.children = res.data;
} }
this.childLoading = false; this.childLoading = false;
}); });