|
@@ -1,6 +1,5 @@
|
|
<template>
|
|
<template>
|
|
-
|
|
|
|
- <div id="file_moddle_manage">
|
|
|
|
|
|
+ <div id="file_moddle_manage" v-loading="loading">
|
|
<!-- 左边模型文件夹列表 -->
|
|
<!-- 左边模型文件夹列表 -->
|
|
<el-col :span="5">
|
|
<el-col :span="5">
|
|
<div class="grid-content grid-left">
|
|
<div class="grid-content grid-left">
|
|
@@ -25,7 +24,7 @@
|
|
<ul class="lists">
|
|
<ul class="lists">
|
|
<li
|
|
<li
|
|
@click="openFolder(index,item)"
|
|
@click="openFolder(index,item)"
|
|
- v-for="(item,index) in navigationBar"
|
|
|
|
|
|
+ v-for="(item,index) in navigationModel"
|
|
:key="index"
|
|
:key="index"
|
|
:class="[choiceIndex == index + 1 ? 'li-active' : '']"
|
|
:class="[choiceIndex == index + 1 ? 'li-active' : '']"
|
|
>
|
|
>
|
|
@@ -34,7 +33,7 @@
|
|
width="40"
|
|
width="40"
|
|
height="40"
|
|
height="40"
|
|
></i>
|
|
></i>
|
|
- <span>{{item.name}}</span>
|
|
|
|
|
|
+ <span>{{item.Name}}</span>
|
|
</li>
|
|
</li>
|
|
</ul>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
@@ -57,8 +56,8 @@
|
|
>
|
|
>
|
|
<el-table-column prop="date" label="模型文件" width="180">
|
|
<el-table-column prop="date" label="模型文件" width="180">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <i class="el-icon-document-checked icon_font"></i>
|
|
|
|
- <span style="margin-left: 10px">{{ scope.row.date }}</span>
|
|
|
|
|
|
+ <i class="el-icon-document-checked icon_font"></i>
|
|
|
|
+ <span style="margin-left: 10px">{{ scope.row.date }}</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column prop="name" label="备注" width="180"></el-table-column>
|
|
<el-table-column prop="name" label="备注" width="180"></el-table-column>
|
|
@@ -104,25 +103,40 @@
|
|
:addFolderVisible="addFolderVisible"
|
|
:addFolderVisible="addFolderVisible"
|
|
@closeAddFolderVisible="addFolderVisible=false;folderName=''"
|
|
@closeAddFolderVisible="addFolderVisible=false;folderName=''"
|
|
:folderName="folderName"
|
|
:folderName="folderName"
|
|
|
|
+ @getfolderModel="queryModel"
|
|
></addFolder>
|
|
></addFolder>
|
|
|
|
+ <!-- 编辑文件夹名字 -->
|
|
|
|
+ <changeFolderName
|
|
|
|
+ :currentFolderId="currentFolderId"
|
|
|
|
+ :changeFolderNameVisible="changeFolderNameVisible"
|
|
|
|
+ :folderName="folderName"
|
|
|
|
+ @finishChangeFolderName="queryModel"
|
|
|
|
+ @closeChangeFolderVisible="changeFolderNameVisible=false;folderName=''"
|
|
|
|
+ ></changeFolderName>
|
|
<!-- 弹窗 结束-->
|
|
<!-- 弹窗 结束-->
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
</template>
|
|
</template>
|
|
-
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import { mapGetters } from "vuex";
|
|
|
|
+import request from "@/api/model/file.js";
|
|
|
|
+
|
|
import dasBoard from "@/views/dasboard/index";
|
|
import dasBoard from "@/views/dasboard/index";
|
|
import modelLog from "@/components/model/file/modelLog"; //模型日志弹窗
|
|
import modelLog from "@/components/model/file/modelLog"; //模型日志弹窗
|
|
import repliceModel from "@/components/model/file/replaceModelDialog"; //替换模型弹窗
|
|
import repliceModel from "@/components/model/file/replaceModelDialog"; //替换模型弹窗
|
|
import addFloorDialog from "@/components/model/file/addFloorDialog"; //新增楼层弹窗
|
|
import addFloorDialog from "@/components/model/file/addFloorDialog"; //新增楼层弹窗
|
|
import addFolder from "@/components/model/file/addFolder"; //新增文件夹
|
|
import addFolder from "@/components/model/file/addFolder"; //新增文件夹
|
|
|
|
+import changeFolderName from "@/components/model/file/changeFolderName"; //编辑名字
|
|
export default {
|
|
export default {
|
|
|
|
+ computed: {
|
|
|
|
+ ...mapGetters("layout", ["projectId", "userId", "secret"])
|
|
|
|
+ },
|
|
components: {
|
|
components: {
|
|
dasBoard,
|
|
dasBoard,
|
|
modelLog,
|
|
modelLog,
|
|
repliceModel,
|
|
repliceModel,
|
|
addFloorDialog,
|
|
addFloorDialog,
|
|
- addFolder
|
|
|
|
|
|
+ addFolder,
|
|
|
|
+ changeFolderName
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -130,57 +144,26 @@ export default {
|
|
addFloorFileVisible: false, //是否显示增加楼层文件弹窗
|
|
addFloorFileVisible: false, //是否显示增加楼层文件弹窗
|
|
repliceModelVisible: false, //是否显示替换楼层模型弹窗
|
|
repliceModelVisible: false, //是否显示替换楼层模型弹窗
|
|
modelLogVisible: false, //是否显示模型日志弹窗
|
|
modelLogVisible: false, //是否显示模型日志弹窗
|
|
- folderName: "", //文件夹名称
|
|
|
|
- currentFolderName: "",
|
|
|
|
- navigationBar: [
|
|
|
|
|
|
+ changeFolderNameVisible: false, //是否显示编辑文件夹弹窗
|
|
|
|
+ folderName: "", //新建文件夹名称
|
|
|
|
+ navigationModel: [
|
|
{
|
|
{
|
|
- name: "文件夹1",
|
|
|
|
- tableData: [
|
|
|
|
- {
|
|
|
|
- date: "2016-05-02",
|
|
|
|
- name: "王小虎",
|
|
|
|
- address: "上海市普陀区金沙江路 1518 弄"
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- date: "2016-05-04",
|
|
|
|
- name: "王小虎",
|
|
|
|
- address: "上海市普陀区金沙江路 1517 弄"
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- date: "2016-05-04",
|
|
|
|
- name: "王小虎",
|
|
|
|
- address: "上海市普陀区金沙江路 1517 弄"
|
|
|
|
- }
|
|
|
|
- ],
|
|
|
|
- id: "1"
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- name: "文件夹2",
|
|
|
|
- tableData: [
|
|
|
|
- {
|
|
|
|
- date: "2016-05-02",
|
|
|
|
- name: "王小虎",
|
|
|
|
- address: "上海市普陀区金沙江路 1518 弄"
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- date: "2016-05-04",
|
|
|
|
- name: "王小虎",
|
|
|
|
- address: "上海市普陀区金沙江路 1517 弄"
|
|
|
|
- }
|
|
|
|
- ],
|
|
|
|
- id: "2"
|
|
|
|
|
|
+ Name: ""
|
|
}
|
|
}
|
|
- ],
|
|
|
|
- choiceIndex: 0,
|
|
|
|
- tableData: []
|
|
|
|
|
|
+ ], //文件夹模型list
|
|
|
|
+ choiceIndex: 0, //当前文件夹index
|
|
|
|
+ currentFolderId: "", //当前选择的文件夹id
|
|
|
|
+ currentFolderName: "", //当前选择文件夹的Name
|
|
|
|
+ tableData: [],
|
|
|
|
+ loading: false //加载loading
|
|
};
|
|
};
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
// 打开模型文件夹
|
|
// 打开模型文件夹
|
|
openFolder(index, item) {
|
|
openFolder(index, item) {
|
|
this.choiceIndex = index + 1;
|
|
this.choiceIndex = index + 1;
|
|
- this.tableData = item.tableData;
|
|
|
|
- this.folderName = item.name;
|
|
|
|
|
|
+ this.currentFolderId = item.Id;
|
|
|
|
+ this.currentFolderName = item.Name;
|
|
},
|
|
},
|
|
//新增模型文件夹
|
|
//新增模型文件夹
|
|
addFolder() {
|
|
addFolder() {
|
|
@@ -189,21 +172,42 @@ export default {
|
|
},
|
|
},
|
|
//删除模型文件夹
|
|
//删除模型文件夹
|
|
removeFolder() {
|
|
removeFolder() {
|
|
- this.$alert("确定要删除文件夹吗?", "提示", {
|
|
|
|
|
|
+ this.$alert(`确定要删除文件夹 <${this.currentFolderName}> 吗?`, "提示", {
|
|
confirmButtonText: "确定",
|
|
confirmButtonText: "确定",
|
|
callback: action => {
|
|
callback: action => {
|
|
- this.$message({
|
|
|
|
- type: "info",
|
|
|
|
- message: `action: ${action}`
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
|
|
+ if (action == "confirm") {
|
|
|
|
+ let params = { Id:this.currentFolderId,ProjectId:this.projectId};
|
|
|
|
+ request
|
|
|
|
+ .deleteModel(params)
|
|
|
|
+ .then(res => {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "删除成功!",
|
|
|
|
+ type: "success"
|
|
|
|
+ });
|
|
|
|
+ this.queryModel();
|
|
|
|
+ })
|
|
|
|
+ .catch(err => {
|
|
|
|
+ this.$message.error(err);
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: "info",
|
|
|
|
+ message: `取消操作`
|
|
|
|
+ });
|
|
|
|
+ }
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
//编辑文件夹
|
|
//编辑文件夹
|
|
editFolder() {
|
|
editFolder() {
|
|
this.folderName = this.currentFolderName;
|
|
this.folderName = this.currentFolderName;
|
|
- this.addFolderVisible = true;
|
|
|
|
|
|
+ this.changeFolderNameVisible = true;
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ ///一下是楼层文件
|
|
|
|
+ //获取楼层文件
|
|
|
|
+ queryFloorFile(){
|
|
|
|
+
|
|
},
|
|
},
|
|
//添加楼层文件
|
|
//添加楼层文件
|
|
addFloorFile() {
|
|
addFloorFile() {
|
|
@@ -216,12 +220,23 @@ export default {
|
|
//查看模型日志
|
|
//查看模型日志
|
|
queryModelLog() {
|
|
queryModelLog() {
|
|
this.modelLogVisible = true;
|
|
this.modelLogVisible = true;
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 查询所有文件夹模型
|
|
|
|
+ queryModel() {
|
|
|
|
+ this.loading = true;
|
|
|
|
+ request.queryModel("").then(res => {
|
|
|
|
+ this.navigationModel = res.Content;
|
|
|
|
+ //默认选择第一个文件夹
|
|
|
|
+ this.choiceIndex = 1;
|
|
|
|
+ this.currentFolderName = this.navigationModel[0].Name;
|
|
|
|
+ this.currentFolderId = this.navigationModel[0].Id;
|
|
|
|
+ this.loading = false;
|
|
|
|
+ });
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
- this.choiceIndex = 1;
|
|
|
|
- this.tableData = this.navigationBar[0].tableData;
|
|
|
|
- this.currentFolderName = this.navigationBar[0].name;
|
|
|
|
|
|
+ this.queryModel();
|
|
}
|
|
}
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|