This commit is contained in:
bwcx_jzy 2023-03-19 17:04:58 +08:00
parent 16aa8f26da
commit c1447371e3
No known key found for this signature in database
GPG Key ID: 5E48E9372088B9E5
4 changed files with 30 additions and 25 deletions

View File

@ -177,7 +177,7 @@
</template>
<a-tooltip slot="projectPid" slot-scope="text, record" placement="topLeft" :title="`进程号:${record.projectPid} / 端口号:${record.projectPort}`">
<span v-if="record.projectPid">{{ record.projectPid }}/{{ record.projectPort }}</span>
<span>{{ record.projectPid }}/{{ record.projectPort }}</span>
</a-tooltip>
<template slot="child-operation" slot-scope="text, record">

View File

@ -92,7 +92,7 @@
</template>
<a-tooltip slot="port" slot-scope="text, record" placement="topLeft" :title="`进程号:${(record.pids || [record.pid || '-']).join(',')} / 端口号:${record.port}`">
<span v-if="record.pid">{{ record.port }}/{{ (record.pids || [record.pid || "-"]).join(",") }}</span>
<span>{{ record.port || "-" }}/{{ (record.pids || [record.pid || "-"]).join(",") }}</span>
</a-tooltip>
<template slot="expandedRowRender" slot-scope="record">
@ -650,6 +650,7 @@ export default {
if (res2.data[element.projectId]) {
element.port = res2.data[element.projectId].port;
element.pid = res2.data[element.projectId].pid;
element.pids = res2.data[element.projectId].pids;
element.status = element.pid > 0;
element.error = res2.data[element.projectId].error;
}
@ -1097,7 +1098,14 @@ export default {
// element.pid = res.data[element.id].pid;
// element.status = true;
return { ...copyItem, status: res.data[copyItem.id].pid > 0, pid: res.data[copyItem.id].pid, port: res.data[copyItem.id].port, error: res.data[copyItem.id].error };
return {
...copyItem,
status: res.data[copyItem.id].pid > 0,
pid: res.data[copyItem.id].pid,
pids: res.data[copyItem.id].pids,
port: res.data[copyItem.id].port,
error: res.data[copyItem.id].error,
};
}
return copyItem;
});

View File

@ -84,7 +84,7 @@
</template>
<a-tooltip slot="port" slot-scope="text, record" placement="topLeft" :title="`进程号:${(record.pids || [record.pid || '-']).join(',')} / 端口号:${record.port}`">
<span v-if="record.pid">{{ record.port }}/{{ (record.pids || [record.pid || "-"]).join(",") }}</span>
<span>{{ record.port || "-" }}/{{ (record.pids || [record.pid || "-"]).join(",") }}</span>
</a-tooltip>
<template slot="operation" slot-scope="text, record, index">
<a-space>
@ -371,6 +371,7 @@ export default {
if (res2.data[element.projectId] && element.nodeId === data.type) {
element.port = res2.data[element.projectId].port;
element.pid = res2.data[element.projectId].pid;
element.pids = res2.data[element.projectId].pids;
element.status = element.pid > 0;
element.error = res2.data[element.projectId].error;
}

View File

@ -65,38 +65,34 @@ export const uploadPieces = ({ file, uploadCallback, uploadBeforeAbrot, success,
// 判断是否需要继续
if (uploadBeforeAbrot) {
uploadBeforeAbrot(fileMd5).then(() => {
start();
startUpload();
});
} else {
start();
startUpload();
}
const start = () => {
for (let i = 0; i < chunkCount; i++) {
chunkList.push(Number(i));
}
//生成分片 id
generateShardingId().then((res) => {
if (res.code === 200) {
sliceId = res.data;
concurrentUpload();
} else {
error("文件上传id生成失败" + res.msg);
}
});
};
}
};
const startUpload = () => {
for (let i = 0; i < chunkCount; i++) {
chunkList.push(Number(i));
}
//生成分片 id
generateShardingId().then((res) => {
if (res.code === 200) {
sliceId = res.data;
concurrentUpload();
} else {
error("文件上传id生成失败" + res.msg);
}
});
};
reader.onload = function (event) {
try {
spark.append(event.target.result);
asyncUpdate();
} catch (e) {
Vue.prototype.$setLoading("closeAll");
this.$notification.error({
message: "解析文件失败:" + e,
});
error("解析文件失败:" + e);
}
};