|
@@ -46,7 +46,7 @@
|
|
|
<!-- 顶部操作栏 -->
|
|
|
<div class="top_hand right_top_hand">
|
|
|
<el-button @click="addFloorFile">添加楼层文件</el-button>
|
|
|
- <el-button>刷新</el-button>
|
|
|
+ <el-button @click="queryFloorFile(currentFolderId)">刷新</el-button>
|
|
|
</div>
|
|
|
<!-- 列表 -->
|
|
|
<floorTable
|
|
@@ -54,6 +54,7 @@
|
|
|
:tableData="tableData"
|
|
|
@openModelLog="queryModelLog"
|
|
|
@replaceModel="repliaceModel"
|
|
|
+ :ceshiList="ceshiList"
|
|
|
></floorTable>
|
|
|
</el-card>
|
|
|
</el-col>
|
|
@@ -62,6 +63,7 @@
|
|
|
<!-- 模型日志弹窗 -->
|
|
|
<modelLog
|
|
|
:modelLogVisible="modelLogVisible"
|
|
|
+ @deleteFinish="updataLog"
|
|
|
@CloseModelLogDia="modelLogVisible=false"
|
|
|
:logData="logData"
|
|
|
></modelLog>
|
|
@@ -111,7 +113,7 @@ import changeFolderName from "@/components/model/file/changeFolderName"; //编
|
|
|
import floorTable from "@/components/model/file/floorTable"; //右侧list表
|
|
|
export default {
|
|
|
computed: {
|
|
|
- ...mapGetters("layout", ["projectId", "userId", "secret"])
|
|
|
+ ...mapGetters("layout", ["projectId", "userInfo", "userId", "secret"])
|
|
|
},
|
|
|
components: {
|
|
|
dasBoard,
|
|
@@ -138,6 +140,7 @@ export default {
|
|
|
choiceIndex: 0, //当前文件夹index
|
|
|
currentFolderId: "", //当前选择的文件夹id
|
|
|
currentFolderName: "", //当前选择文件夹的Name
|
|
|
+ currentFloorModelId: "", //当前选择的楼层文件id
|
|
|
tableData: [],
|
|
|
loading: false, //加载loading
|
|
|
logData: [], //楼层文件对应的模型日志
|
|
@@ -149,7 +152,17 @@ export default {
|
|
|
},
|
|
|
updataData: {
|
|
|
model: {}
|
|
|
- }
|
|
|
+ },
|
|
|
+ ceshiList: [
|
|
|
+ {
|
|
|
+ Id: "239ce3d4c33811e993aceb3be9a05be5",
|
|
|
+ precent: 0
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Id: "7d30fd76c33b11e993ac11710b8cb126",
|
|
|
+ precent: 0
|
|
|
+ }
|
|
|
+ ]
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -227,14 +240,25 @@ export default {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
request.queryFloorList(data, res => {
|
|
|
res.Content.map(item => {
|
|
|
- Object.assign(item, { isDown: false,precent:0});
|
|
|
+ Object.assign(item, { isDown: false, precent: 0 });
|
|
|
});
|
|
|
this.tableData = res.Content;
|
|
|
this.loading = false;
|
|
|
resolve();
|
|
|
+ //测试代码
|
|
|
+ this.ceshi();
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
+ ceshi() {
|
|
|
+ // let a = setInterval(() => {
|
|
|
+ // this.ceshiList[0].precent += 5 ;
|
|
|
+ // this.ceshiList[1].precent += 8
|
|
|
+ // if (this.ceshiList[0] >= 100) {
|
|
|
+ // clearInterval(a);
|
|
|
+ // }
|
|
|
+ // }, 1000);
|
|
|
+ },
|
|
|
//添加楼层文件
|
|
|
addFloorFile() {
|
|
|
this.addFloorFileVisible = true;
|
|
@@ -249,18 +273,26 @@ export default {
|
|
|
},
|
|
|
// 上传模型文件
|
|
|
uploadModelFIle(data) {
|
|
|
+ // 在列表中添加
|
|
|
+ this.ceshiList.push({
|
|
|
+ Id: data.FloorModelId,
|
|
|
+ precent: 0
|
|
|
+ });
|
|
|
// 获取当前文件夹下所有模型文件
|
|
|
this.queryFloorFile(this.currentFolderId).then(() => {
|
|
|
// 开始上传文件
|
|
|
- // 处理数据
|
|
|
+ // 开始处理数据
|
|
|
let formData = new FormData();
|
|
|
formData.append(
|
|
|
"model",
|
|
|
JSON.stringify({
|
|
|
- FloorModelId: data.FloorModelId
|
|
|
+ FloorModelId: data.FloorModelId,
|
|
|
+ Id: data.CurrentModelId
|
|
|
})
|
|
|
);
|
|
|
formData.append("file", data.Form.file.raw);
|
|
|
+ // 处理数据结束
|
|
|
+
|
|
|
// 修改isdown得值
|
|
|
this.tableData.map(item => {
|
|
|
if (item.Id == data.FloorModelId) {
|
|
@@ -268,6 +300,7 @@ export default {
|
|
|
item.precent = 0;
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
// 开始上传
|
|
|
request.uploadModelFile(
|
|
|
formData,
|
|
@@ -276,9 +309,13 @@ export default {
|
|
|
let loaded = res.loaded, //加载量
|
|
|
total = res.total; //文件大小
|
|
|
this.$nextTick(() => {
|
|
|
- let precent =Math.round((loaded / total) * 100);
|
|
|
- this.$refs.floorTable.filterTag(data.FloorModelId,precent)
|
|
|
-
|
|
|
+ let precent = Math.round((loaded / total) * 100);
|
|
|
+ // this.$refs.floorTable.filterTag(data.FloorModelId, precent);
|
|
|
+ this.ceshiList.map(item => {
|
|
|
+ if (item.Id == data.FloorModelId) {
|
|
|
+ item.precent = precent
|
|
|
+ }
|
|
|
+ });
|
|
|
});
|
|
|
},
|
|
|
res => {
|
|
@@ -294,54 +331,49 @@ export default {
|
|
|
},
|
|
|
//更新模型文件;
|
|
|
updateModelFile(data) {
|
|
|
-
|
|
|
- // 开始上传文件
|
|
|
- // 处理数据
|
|
|
- let formData = new FormData();
|
|
|
- formData.append(
|
|
|
- "model",
|
|
|
- JSON.stringify({
|
|
|
- FloorModelId: data.FloorModelId
|
|
|
- })
|
|
|
- );
|
|
|
- formData.append("file", data.Form.file.raw);
|
|
|
- // 修改isdown得值
|
|
|
- this.tableData.map(item => {
|
|
|
- if (item.Id == data.FloorModelId) {
|
|
|
- item.isDown = true;
|
|
|
- item.precent = 0;
|
|
|
- }
|
|
|
- });
|
|
|
- // 开始上传
|
|
|
- request.upDateModelFile(
|
|
|
- formData,
|
|
|
- this.projectId,
|
|
|
- res => {
|
|
|
- let loaded = res.loaded, //加载量
|
|
|
- total = res.total; //文件大小
|
|
|
- this.$nextTick(() => {
|
|
|
- let precent =Math.round((loaded / total) * 100);
|
|
|
- this.$refs.floorTable.filterTag(data.FloorModelId,precent)
|
|
|
-
|
|
|
+ // 修改isdown得值
|
|
|
+ this.tableData.map(item => {
|
|
|
+ if (item.Id == data.FloorModelId) {
|
|
|
+ item.isDown = true;
|
|
|
+ item.precent = 0;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // 开始上传
|
|
|
+ request.upDateModelFile(
|
|
|
+ data,
|
|
|
+ this.projectId,
|
|
|
+ this.userInfo.username,
|
|
|
+ res => {
|
|
|
+ let loaded = res.loaded, //加载量
|
|
|
+ total = res.total; //文件大小
|
|
|
+ this.$nextTick(() => {
|
|
|
+ let precent = Math.round((loaded / total) * 100);
|
|
|
+ this.$refs.floorTable.filterTag(data.FloorModelId, precent);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ res => {
|
|
|
+ if (res.code === "200") {
|
|
|
+ this.$message({
|
|
|
+ message: "文件上传成功",
|
|
|
+ type: "success"
|
|
|
});
|
|
|
- },
|
|
|
- res => {
|
|
|
- if (res.code === "200") {
|
|
|
- this.$message({
|
|
|
- message: "文件上传成功",
|
|
|
- type: "success"
|
|
|
- });
|
|
|
- }
|
|
|
}
|
|
|
- );
|
|
|
+ }
|
|
|
+ );
|
|
|
},
|
|
|
//查看模型日志
|
|
|
queryModelLog(item) {
|
|
|
- let FloorModelId = item.Id; //楼层模型文件
|
|
|
- request.queryModelFile(FloorModelId, res => {
|
|
|
+ this.FloorModelId = item.Id; //楼层模型文件
|
|
|
+ request.queryModelFile(this.FloorModelId, res => {
|
|
|
this.logData = res.Content;
|
|
|
this.modelLogVisible = true;
|
|
|
});
|
|
|
+ },
|
|
|
+ // 刷新日志
|
|
|
+ updataLog() {
|
|
|
+ request.queryModelFile(this.FloorModelId, res => {
|
|
|
+ this.logData = res.Content;
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
@@ -353,7 +385,7 @@ export default {
|
|
|
#file_moddle_manage {
|
|
|
width: 100%;
|
|
|
.box-card {
|
|
|
- min-height: 800px;
|
|
|
+ min-height: 700px;
|
|
|
}
|
|
|
.grid-left {
|
|
|
padding-right: 10px;
|