|
@@ -23,8 +23,17 @@
|
|
|
<div class="head">模型文件夹</div>
|
|
|
<ul class="lists">
|
|
|
<el-scrollbar style="height:100%;">
|
|
|
- <li @click="openFolder(index,item)" v-for="(item,index) in navigationModel" :key="index" :class="[choiceIndex == index + 1 ? 'li-active' : '']" >
|
|
|
- <i :class="[choiceIndex == index + 1 ? 'el-icon-folder-opened':'el-icon-folder','icon_font']" width="40" height="40" ></i>
|
|
|
+ <li
|
|
|
+ @click="openFolder(index,item)"
|
|
|
+ v-for="(item,index) in navigationModel"
|
|
|
+ :key="index"
|
|
|
+ :class="[choiceIndex == index + 1 ? 'li-active' : '']"
|
|
|
+ >
|
|
|
+ <i
|
|
|
+ :class="[choiceIndex == index + 1 ? 'el-icon-folder-opened':'el-icon-folder','icon_font']"
|
|
|
+ width="40"
|
|
|
+ height="40"
|
|
|
+ ></i>
|
|
|
<span>{{item.Name}}</span>
|
|
|
</li>
|
|
|
</el-scrollbar>
|
|
@@ -48,7 +57,7 @@
|
|
|
@openModelLog="queryModelLog"
|
|
|
@replaceModel="repliaceModel"
|
|
|
@closeUpdateFile="removePersentList"
|
|
|
- @percentFinish ="queryFloorFile(currentFolderId)"
|
|
|
+ @percentFinish="queryFloorFile(currentFolderId)"
|
|
|
:persentList="persentList"
|
|
|
></floorTable>
|
|
|
</el-card>
|
|
@@ -98,7 +107,6 @@
|
|
|
<script>
|
|
|
import { mapGetters } from "vuex";
|
|
|
import request from "@/api/model/file.js";
|
|
|
-
|
|
|
import dasBoard from "@/views/dasboard/index";
|
|
|
import modelLog from "@/components/model/file/modelLog"; //模型日志弹窗
|
|
|
import repliceModel from "@/components/model/file/replaceModelDialog"; //替换模型弹窗
|
|
@@ -107,6 +115,29 @@ import addFolder from "@/components/model/file/addFolder"; //新增文件夹
|
|
|
import changeFolderName from "@/components/model/file/changeFolderName"; //编辑名字
|
|
|
import floorTable from "@/components/model/file/floorTable"; //右侧list表
|
|
|
export default {
|
|
|
+ // 离开此页面前要判断是是否有下载
|
|
|
+ beforeRouteLeave: function(to, from, next) {
|
|
|
+ console.log(this.uploadClassList);
|
|
|
+ if (this.uploadClassList.length) {
|
|
|
+ this.$alert(
|
|
|
+ "当前页有下载内容,切换到其他页面下载将会失败。您确定要切换页面吗?",
|
|
|
+ "提示",
|
|
|
+ {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ callback: action => {
|
|
|
+ console.log(action);
|
|
|
+ if (action == "confirm") {
|
|
|
+ next();
|
|
|
+ } else {
|
|
|
+ next(false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ next();
|
|
|
+ }
|
|
|
+ },
|
|
|
computed: {
|
|
|
...mapGetters("layout", ["projectId", "userInfo", "userId", "secret"])
|
|
|
},
|
|
@@ -150,6 +181,7 @@ export default {
|
|
|
},
|
|
|
persentList: [], //请求进度列表
|
|
|
uploadClassList: [], //请求list 用与缓存多个请求问题
|
|
|
+ isJump: true //是否可以调整页面
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -231,7 +263,7 @@ export default {
|
|
|
if (item.Status == 3) {
|
|
|
Object.assign(item, { isDown: false, precent: 0 });
|
|
|
} else {
|
|
|
- Object.assign(item, { isDown: true, precent: 100 });
|
|
|
+ Object.assign(item, { isDown: true, precent: 100 });
|
|
|
if (this.persentList.length != 0) {
|
|
|
this.persentList.forEach(pItem => {
|
|
|
if (item.Id == pItem.Id) {
|
|
@@ -327,7 +359,10 @@ export default {
|
|
|
that.persentList.forEach((item, index) => {
|
|
|
if (item.Id == data.FloorModelId) {
|
|
|
item.precent = 101;
|
|
|
- that.persentList.splice(index, 0);
|
|
|
+ setTimeout(() => {
|
|
|
+ that.persentList.splice(index, 1);
|
|
|
+ that.uploadClassList.splice(index, 1);
|
|
|
+ }, 100);
|
|
|
return;
|
|
|
}
|
|
|
});
|
|
@@ -336,12 +371,17 @@ export default {
|
|
|
message: "文件上传成功",
|
|
|
type: "success"
|
|
|
});
|
|
|
+ // 刷新list列表
|
|
|
+ that.queryFloorFile(that.currentFolderId);
|
|
|
} else {
|
|
|
if (that.persentList.length != 0) {
|
|
|
that.persentList.forEach((item, index) => {
|
|
|
if (item.Id == data.FloorModelId) {
|
|
|
item.precent = 101;
|
|
|
- that.persentList.splice(index, 0);
|
|
|
+ setTimeout(() => {
|
|
|
+ that.persentList.splice(index, 1);
|
|
|
+ that.uploadClassList.splice(index, 1);
|
|
|
+ }, 100);
|
|
|
return;
|
|
|
}
|
|
|
});
|
|
@@ -350,6 +390,8 @@ export default {
|
|
|
message: val.data.Message,
|
|
|
type: "error"
|
|
|
});
|
|
|
+ // 刷新list列表
|
|
|
+ that.queryFloorFile(that.currentFolderId);
|
|
|
}
|
|
|
}
|
|
|
);
|
|
@@ -411,7 +453,10 @@ export default {
|
|
|
that.persentList.forEach((item, index) => {
|
|
|
if (item.Id == data.replaceModelItem.Id) {
|
|
|
item.precent = 101;
|
|
|
- that.persentList.splice(index, 0);
|
|
|
+ setTimeout(() => {
|
|
|
+ that.persentList.splice(index, 1);
|
|
|
+ that.uploadClassList.splice(index, 1);
|
|
|
+ }, 100);
|
|
|
return;
|
|
|
}
|
|
|
});
|
|
@@ -420,12 +465,17 @@ export default {
|
|
|
message: "文件上传成功",
|
|
|
type: "success"
|
|
|
});
|
|
|
+ // 刷新list列表
|
|
|
+ that.queryFloorFile(that.currentFolderId);
|
|
|
} else {
|
|
|
if (that.persentList.length != 0) {
|
|
|
that.persentList.forEach((item, index) => {
|
|
|
if (item.Id == data.FloorModelId) {
|
|
|
item.precent = 101;
|
|
|
- that.persentList.splice(index, 0);
|
|
|
+ setTimeout(() => {
|
|
|
+ that.persentList.splice(index, 1);
|
|
|
+ that.uploadClassList.splice(index, 1);
|
|
|
+ }, 100);
|
|
|
return;
|
|
|
}
|
|
|
});
|
|
@@ -434,6 +484,8 @@ export default {
|
|
|
message: val.data.Message,
|
|
|
type: "error"
|
|
|
});
|
|
|
+ // 刷新list列表
|
|
|
+ that.queryFloorFile(that.currentFolderId);
|
|
|
}
|
|
|
}
|
|
|
);
|
|
@@ -458,8 +510,8 @@ export default {
|
|
|
removePersentList(item) {
|
|
|
this.uploadClassList.forEach((i, index) => {
|
|
|
if (item.Id == i.Id) {
|
|
|
- this.$delete(this.uploadClassList, index);
|
|
|
- // this.uploadClassList.splice(index,0)
|
|
|
+ // this.$delete(this.uploadClassList, index);
|
|
|
+ this.uploadClassList.splice(index, 1);
|
|
|
return;
|
|
|
}
|
|
|
});
|
|
@@ -469,19 +521,28 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
});
|
|
|
- this.queryFloorFile(this.currentFolderId);
|
|
|
this.$message({
|
|
|
message: "中止上传!",
|
|
|
type: "success"
|
|
|
});
|
|
|
+ // 刷新list列表
|
|
|
+ that.queryFloorFile(that.currentFolderId);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ uploadClassList: {
|
|
|
+ deep: true,
|
|
|
+ handler: function(val) {
|
|
|
+ console.log(val);
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
this.queryModel();
|
|
|
// 十秒刷新次楼层列表
|
|
|
- setInterval(()=>{
|
|
|
- this.queryFloorFile(this.currentFolderId)
|
|
|
- },10000)
|
|
|
+ // setInterval(()=>{
|
|
|
+ // this.queryFloorFile(this.currentFolderId)
|
|
|
+ // },10000)
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
@@ -490,14 +551,14 @@ export default {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
overflow: hidden !important;
|
|
|
- .col_left{
|
|
|
- height: 100%;
|
|
|
+ .col_left {
|
|
|
+ height: 100%;
|
|
|
}
|
|
|
- .grid-content{
|
|
|
- height:100%;
|
|
|
+ .grid-content {
|
|
|
+ height: 100%;
|
|
|
}
|
|
|
.box-card {
|
|
|
- height:100%;
|
|
|
+ height: 100%;
|
|
|
}
|
|
|
.grid-left {
|
|
|
padding-right: 10px;
|