|
@@ -266,15 +266,23 @@ export default {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
request.queryFloorList(data, res => {
|
|
|
res.Content.map(item => {
|
|
|
- // 显示进度条:Status == 0 || null 正在上传 ;:Status == 1: 等待检查;Status == 10 正在检查中 ;Status == 2 已通过检查(展示按钮,不可以替换模型); Status == 3 || Status == 4 (可以替换模型文件)
|
|
|
- if (item.Status == 3) {
|
|
|
+ /**
|
|
|
+ * @info: 状态显示说明
|
|
|
+ * 0: 上传中(上传的用户可操作:中止)
|
|
|
+ * 1: 等待检查
|
|
|
+ * 10: 模型检查中
|
|
|
+ * 11: 未通过检查
|
|
|
+ * 2、20、21: 正常(所有用户可操作:下载、查看历史)
|
|
|
+ * 3、31、4: 正常(所有用户可操作:下载、替换、查看历史)
|
|
|
+ */
|
|
|
+ if (item.Status == 2 || item.Status == 20 || item.Status == 21 || item.Status == 3 || item.Status == 31 || item.Status == 4) {
|
|
|
Object.assign(item, { isDown: false, precent: 0 });
|
|
|
} else {
|
|
|
Object.assign(item, { isDown: true, precent: 100 });
|
|
|
if (this.persentList.length != 0) {
|
|
|
this.persentList.forEach(pItem => {
|
|
|
if (item.Id == pItem.Id) {
|
|
|
- Object.assign(item, { isDown: true, precent: 0 });
|
|
|
+ Object.assign(item, { isDown: true, precent: pItem.precent?pItem.precent:0 });
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -363,32 +371,29 @@ export default {
|
|
|
val => {
|
|
|
if (val.data.Result === "success") {
|
|
|
if (that.persentList.length != 0) {
|
|
|
- that.persentList.forEach((item, index) => {
|
|
|
+ //深拷贝
|
|
|
+ let persentListCopy = JSON.parse(JSON.stringify(that.persentList))
|
|
|
+ persentListCopy.forEach((item, index) => {
|
|
|
if (item.Id == data.FloorModelId) {
|
|
|
- item.precent = 101;
|
|
|
- setTimeout(() => {
|
|
|
- that.persentList.splice(index, 1);
|
|
|
- that.uploadClassList.splice(index, 1);
|
|
|
- }, 100);
|
|
|
+ // item.precent = 101;
|
|
|
+ that.persentList.splice(index, 1);
|
|
|
+ that.uploadClassList.splice(index, 1);
|
|
|
return;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
- that.$message({
|
|
|
- message: "文件上传成功",
|
|
|
- type: "success"
|
|
|
- });
|
|
|
+ that.$message({ message: "文件上传成功", type: "success" });
|
|
|
// 刷新list列表
|
|
|
that.queryFloorFile(that.currentFolderId);
|
|
|
} else {
|
|
|
if (that.persentList.length != 0) {
|
|
|
- that.persentList.forEach((item, index) => {
|
|
|
+ //深拷贝
|
|
|
+ let persentListCopy = JSON.parse(JSON.stringify(that.persentList))
|
|
|
+ persentListCopy.forEach((item, index) => {
|
|
|
if (item.Id == data.FloorModelId) {
|
|
|
- item.precent = 101;
|
|
|
- setTimeout(() => {
|
|
|
- that.persentList.splice(index, 1);
|
|
|
- that.uploadClassList.splice(index, 1);
|
|
|
- }, 100);
|
|
|
+ // item.precent = 101;
|
|
|
+ that.persentList.splice(index, 1);
|
|
|
+ that.uploadClassList.splice(index, 1);
|
|
|
return;
|
|
|
}
|
|
|
});
|
|
@@ -457,13 +462,13 @@ export default {
|
|
|
val => {
|
|
|
if (val.data.Result === "success") {
|
|
|
if (that.persentList.length != 0) {
|
|
|
- that.persentList.forEach((item, index) => {
|
|
|
+ //深拷贝
|
|
|
+ let persentListCopy = JSON.parse(JSON.stringify(that.persentList))
|
|
|
+ persentListCopy.forEach((item, index) => {
|
|
|
if (item.Id == data.replaceModelItem.Id) {
|
|
|
- item.precent = 101;
|
|
|
- setTimeout(() => {
|
|
|
- that.persentList.splice(index, 1);
|
|
|
- that.uploadClassList.splice(index, 1);
|
|
|
- }, 100);
|
|
|
+ // item.precent = 101;
|
|
|
+ that.persentList.splice(index, 1);
|
|
|
+ that.uploadClassList.splice(index, 1);
|
|
|
return;
|
|
|
}
|
|
|
});
|
|
@@ -476,13 +481,13 @@ export default {
|
|
|
that.queryFloorFile(that.currentFolderId);
|
|
|
} else {
|
|
|
if (that.persentList.length != 0) {
|
|
|
- that.persentList.forEach((item, index) => {
|
|
|
+ //深拷贝
|
|
|
+ let persentListCopy = JSON.parse(JSON.stringify(that.persentList))
|
|
|
+ persentListCopy.forEach((item, index) => {
|
|
|
if (item.Id == data.FloorModelId) {
|
|
|
- item.precent = 101;
|
|
|
- setTimeout(() => {
|
|
|
- that.persentList.splice(index, 1);
|
|
|
- that.uploadClassList.splice(index, 1);
|
|
|
- }, 100);
|
|
|
+ // item.precent = 101;
|
|
|
+ that.persentList.splice(index, 1);
|
|
|
+ that.uploadClassList.splice(index, 1);
|
|
|
return;
|
|
|
}
|
|
|
});
|