浏览代码

Merge branch 'fileModelManage' into infoPoint

zhangyu 5 年之前
父节点
当前提交
fa5c8a2c21

+ 8 - 1
config/index.js

@@ -88,7 +88,14 @@ module.exports = {
                 ws: true,
                 ws: true,
                 // 将主机标头的原点更改为目标URL
                 // 将主机标头的原点更改为目标URL
                 changeOrigin: false
                 changeOrigin: false
-            }
+            },
+            '/modelapi': {
+                target: 'http://192.168.20.225:8082',
+                changeOrigin: true,
+                pathRewrite: {
+                    "^/modelapi": "/"
+                }
+            },
         },
         },
 
 
         // Various Dev Server settings
         // Various Dev Server settings

+ 261 - 0
src/api/model/file.js

@@ -0,0 +1,261 @@
+/**
+ * @author hanyaolong
+ * @date 2019/08/12
+ * @info 模型管理/模型文件管理
+ */
+import httputils from '@/api/scan/httpUtil'
+import { Message } from 'element-ui';
+const baseUrl = '/modelapi';
+import axios from 'axios'
+let api = {
+    // 新建模型文件夹
+    /**
+     * 
+     * @param {Name:string,ProjectId:string} params 
+     */
+    createModel(params, success) {
+        let Name = params.Name;
+        this.queryModel(Name, (res) => {
+            if (res.Total == 0) {
+                let data = {
+                    Content: [params]
+                };
+                // 查询是否有该模型文件夹
+                // 创建
+                httputils.postJson(`${baseUrl}/model-folder/create`, data, success)
+            } else {
+                Message.error({ message: '该文件夹已经存在!' });
+            }
+        })
+    },
+    //删除模型文件夹
+    /**
+     * 
+     * @param {Id:string} params 
+     */
+    deleteModel(params, success) {
+        let Content = [params];
+        httputils.postJson(`${baseUrl}/model-folder/delete`, Content, success)
+    },
+    //修改模型文件夹名称
+    /**
+    * 
+    * @param {Name:string,ProjectId:string} params 
+    */
+    updateModelName(params, success) {
+        let Name = params.Name;
+        this.queryModel(Name, (res) => {
+            if (res.Total == 0) {
+                let data = {
+                    Content: [params]
+                };
+                // 更改文件夹名称
+                httputils.postJson(`${baseUrl}/model-folder/update`, data, success)
+            } else {
+                Message.error({ message: '该文件夹已经存在!' });
+            }
+        })
+    },
+    //查询模型文件夹
+    /** 
+     * @param Name string  注:查询多个 Name = '' 
+    */
+    queryModel(Name, success) {
+        let data = null;
+        if (Name) {
+            // 单个查询
+            data = {
+                Filters: `Name='${Name}'`
+            }
+        } else {
+            // 多个查询
+            data = {}
+        }
+        return httputils.postJson(`${baseUrl}/model-folder/query`, data, success)
+    },
+
+
+
+    //以下是楼层文件接口
+
+    // 查询模型文件夹下的所有模型文件
+    queryFloorList(data, success) {
+
+        let Filters = `FolderId='${data.FolderId}'`;
+        if (data.FloorName) {
+            Filters = `FolderId='${data.FolderId}';FloorName='${data.FloorName}';ProjectId='${data.ProjectId}'`;
+        }
+        let params = {
+            Filters: Filters
+        }
+        return httputils.postJson(`${baseUrl}/model-floor/query-list`, params, success)
+    },
+    // 查询模型文件夹下的单个模型文件
+    queryFloorItem(data, success) {
+
+        let Filters = `FolderId='${data.FolderId}'`;
+        if (data.FloorName) {
+            Filters = `FolderId='${data.FolderId}';FloorName='${data.FloorName}';ProjectId='${data.ProjectId}'`;
+        }
+        let params = {
+            Filters: Filters
+        }
+        return httputils.postJson(`${baseUrl}/model-floor/query`, params, success)
+    },
+    // 创建楼层文件
+    createFloor(params) {
+        // 判断该楼层文件是否存在
+
+        let data = {
+            Content: [{
+                FolderId: params.FolderId,
+                FloorName: params.FloorName,
+                ProjectId: params.ProjectId,      //项目id
+            }]
+        };
+        return new Promise((resolve, preject) => {
+            this.queryFloorItem(params, (res) => {
+                if (res.Total == 0) {
+                    // 创建楼层文件
+                    httputils.postJson(`${baseUrl}/model-floor/create`, data, (res) => {
+                        let modelFile = {
+                            Content: [{
+                                // ProjectId: params.ProjectId,      //项目id
+                                FloorModelId: res.EntityList[0].Id, //模型id
+                                ModelName: params.Form.file.name,        //模型名字
+                                UserName: params.userName,
+                                Note: params.Form.desc,
+                                // ReplaceReason: 0
+                            }]
+                        }
+                        //创建模型文件
+                        this.createModelFile(modelFile, (createModelRes) => {
+                            // 与此楼文件进行绑定
+                            let upDateModelData = {
+                                Content: [{
+                                    Id: res.EntityList[0].Id, //楼层
+                                    CurrentModelId: createModelRes.EntityList[0].Id
+                                }]
+                            }
+                            this.updateFloorName(upDateModelData, (upDateModelSucess) => {
+                                if (upDateModelSucess.Result == "success") {
+                                    resolve({
+                                        Result: 'success',
+                                        FloorModelId: res.EntityList[0].Id,   //楼层模型文件
+                                        CurrentModelId: createModelRes.EntityList[0].Id //模型文件id
+                                    })
+                                }
+                            })
+                        })
+
+                    })
+
+
+                } else {
+                    Message.error({ message: '该楼层文件已经存在,请选择其他楼层!' });
+                }
+            })
+        })
+    },
+    // 删除楼层文件
+    deleteFloor(data) {
+        return httputils.postJson(`${baseUrl}/model-floor/delete`, data)
+    },
+    //编辑楼层文件得名字
+    updateFloorName(data, success) {
+        return httputils.postJson(`${baseUrl}/model-floor/update`, data, success)
+    },
+
+
+    //一下是楼层文件接口
+
+    // 创建楼层文件
+    createModelFile(data, success) {
+        return httputils.postJson(`${baseUrl}/model-file/create`, data, success)
+    },
+    //删除模型文件(只有记录,文件不动)
+    deleteModelFile(data, success) {
+        return httputils.postJson(`${baseUrl}/model-file/delete`, data, success)
+    },
+    /**
+     * 
+     * @param {*} params string 模型文件的id 
+     * @param {*} success  成功的回调函数
+     */
+    deleteModelFileList(params, success) {
+        let data = {
+            Id:params
+        } 
+        return httputils.postJson(`${baseUrl}/model-file/delete-file`, data, success)
+    },
+    //查询模型文件 
+    queryModelFile(FloorModelId, success) {
+        let params = {
+            Distince: true,
+            Filters: `FloorModelId='${FloorModelId}'`
+        }
+        return httputils.postJson(`${baseUrl}/model-file/query`, params, success)
+    },
+    // 上传模型文件
+    uploadModelFile(payload, ProjectId,callback1, callback2) {
+        axios({
+            url: baseUrl + '/model-file/upload',
+            method: 'post',
+            headers: {
+                ProjectId: ProjectId
+            },
+            onUploadProgress: function (progressEvent) { //原生获取上传进度的事件
+                if (progressEvent.lengthComputable) {
+                    //属性lengthComputable主要表明总共需要完成的工作量和已经完成的工作是否可以被测量
+                    //如果lengthComputable为false,就获取不到progressEvent.total和progressEvent.loaded
+                    callback1(progressEvent);
+                }
+            },
+            data: payload
+        }).then(res => {
+            callback2(res);
+        }).catch(error => {
+            console.log('this is a catch')
+            console.log(error)
+        })
+    },
+    // 更新模型文件
+    upDateModelFile(data, ProjectId,UserName, callback1, callback2) {
+        let modelFile = {
+            Content: [{
+                FloorModelId:data.replaceModelItem.Id, //模型id
+                ModelName: data.Form.file.name,        //模型名字
+                UserName: UserName,
+                Note: data.replaceModelItem.Note,
+                ReplaceReason: data.Form.ReplaceReason
+            }]
+        }
+        // //创建模型文件
+        this.createModelFile(modelFile, (createModelRes) => {
+            // 与此楼文件进行绑定
+            let upDateModelData = {
+                Content: [{
+                    Id:data.replaceModelItem.Id, //楼层
+                    CurrentModelId: createModelRes.EntityList[0].Id
+                }]
+            }
+            this.updateFloorName(upDateModelData, (upDateModelSucess) => {
+                if (upDateModelSucess.Result == "success") {
+                    // 处理数据
+                    let formData = new FormData();
+                    formData.append(
+                      "model",
+                      JSON.stringify({
+                        FloorModelId: data.replaceModelItem.Id,
+                        Id:createModelRes.EntityList[0].Id
+                      })
+                    );
+                    formData.append("file", data.Form.file.raw);
+                    this.uploadModelFile(formData,ProjectId,callback1,callback2)
+                }
+            })
+        })
+    }
+
+}
+export default api

+ 9 - 9
src/api/scan/request.js

@@ -4,7 +4,7 @@ import http from './httpUtil'
 let arithmetic = '/arithmetic'
 let arithmetic = '/arithmetic'
 
 
 var Comming = 'revit'
 var Comming = 'revit'
-    //获取打印标签模板test
+//获取打印标签模板test
 export function getTest() {
 export function getTest() {
     return fetch({ method: 'GET', url: `${api}/service/template/note_template` })
     return fetch({ method: 'GET', url: `${api}/service/template/note_template` })
 }
 }
@@ -393,11 +393,11 @@ export function setHeader(param) {
 //获取头部接口
 //获取头部接口
 export function getHeader(param) {
 export function getHeader(param) {
     let data = {
     let data = {
-            "AppType": Comming,
-            "Code": param.code,
-            "ProjId": param.perjectId
-        }
-        // return fetch({ method: 'POST', url: `${api}/service/dict/equipment_family_info_header`, data })
+        "AppType": Comming,
+        "Code": param.code,
+        "ProjId": param.perjectId
+    }
+    // return fetch({ method: 'POST', url: `${api}/service/dict/equipment_family_info_header`, data })
     return fetch({ method: 'POST', url: `${api}/service/dict/infocode_query_header`, data })
     return fetch({ method: 'POST', url: `${api}/service/dict/infocode_query_header`, data })
 }
 }
 
 
@@ -446,7 +446,7 @@ export function getSpaceFloor(param) {
 export function createBusiness(param) {
 export function createBusiness(param) {
     let data = param.data
     let data = param.data
     return fetch({ method: "POST", url: `${physics}/space/create?projectId=${param.ProjId}&secret=${param.secret}`, data })
     return fetch({ method: "POST", url: `${physics}/space/create?projectId=${param.ProjId}&secret=${param.secret}`, data })
-        // return fetch({ method: "POST", url: `/test/space/create?projectId=${param.ProjId}&secret=${param.secret}`, data })
+    // return fetch({ method: "POST", url: `/test/space/create?projectId=${param.ProjId}&secret=${param.secret}`, data })
 }
 }
 
 
 //批量创建业务空间
 //批量创建业务空间
@@ -496,7 +496,7 @@ export function getGraphyId(param) {
 export function getBussines(param) {
 export function getBussines(param) {
     let data = param.data
     let data = param.data
     return fetch({ method: "POST", url: `${physics}/object/outside_query?projectId=${param.ProjId}&secret=${param.secret}`, data })
     return fetch({ method: "POST", url: `${physics}/object/outside_query?projectId=${param.ProjId}&secret=${param.secret}`, data })
-        // return fetch({ method: "POST", url: `/test/object/outside_query?projectId=${param.ProjId}&secret=${param.secret}`, data })
+    // return fetch({ method: "POST", url: `/test/object/outside_query?projectId=${param.ProjId}&secret=${param.secret}`, data })
 }
 }
 
 
 //替代前一个接口
 //替代前一个接口
@@ -923,7 +923,7 @@ export function equipLinkSys(param, success) {
 export function sysLinkEquip(param, success) {
 export function sysLinkEquip(param, success) {
     let url = `${baseUrl}/datacenter/sy-in-eq/link-eq`;
     let url = `${baseUrl}/datacenter/sy-in-eq/link-eq`;
     http.postJson(url, param, success)
     http.postJson(url, param, success)
-} 
+}
 
 
 //设备清单 - 统计项目下所有设备数量
 //设备清单 - 统计项目下所有设备数量
 export function countEquip(param, success) {
 export function countEquip(param, success) {

+ 230 - 0
src/components/model/file/addFloorDialog.vue

@@ -0,0 +1,230 @@
+<template>
+  <!-- 新增楼层文件 -->
+  <div id="addFloorDialog">
+    <el-dialog
+      title="新增楼层"
+      :visible.sync="addFloorFileVisible"
+      width="40%"
+      :before-close="handleClose"
+    >
+      <el-form ref="addfloorform" :model="form" label-width="120px">
+        <el-form-item label="模型文件:">
+          <el-upload
+            class="upload-demo"
+            ref="upload"
+            :headers="headers"
+            :data="updataData"
+            action="/modelapi/model-file/upload"
+            :on-preview="handlePreview"
+            :on-remove="handleRemove"
+            :file-list="fileList"
+            :auto-upload="false"
+            :on-change="onChangeUpLoad"
+            :limit="1"
+          >
+            <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
+          </el-upload>
+        </el-form-item>
+        <el-form-item label="模型所属楼层:">
+          <div class="floorModle">
+            <el-select v-model="form.floorTypeVal" placeholder="请选择">
+              <el-option
+                v-for="item in floorType"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              ></el-option>
+            </el-select>
+            <!-- 计数 -->
+            <el-input-number
+              style="margin-left:10px"
+              v-model="form.floorNum"
+              :min="1"
+              :disabled="form.floorTypeVal == 'RF'"
+              @change="handleChange"
+            ></el-input-number>
+            <!-- 是否夹层 -->
+            <el-checkbox style="margin-left:10px" v-model="form.haveInterlayer">是否夹层</el-checkbox>
+            <!-- 夹层选择 -->
+            <el-select
+              v-model="form.interlayerTypeVal"
+              :disabled="!form.haveInterlayer"
+              placeholder="请选择"
+            >
+              <el-option
+                v-for="item in interlayerType"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              ></el-option>
+            </el-select>
+          </div>
+        </el-form-item>
+        <el-form-item label="备注信息:">
+          <el-input type="textarea" v-model="form.desc"></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" @click="onSubmit">确认</el-button>
+          <el-button @click="handleClose">取消</el-button>
+        </el-form-item>
+      </el-form>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import request from "@/api/model/file.js";
+import { mapGetters } from "vuex";
+export default {
+  props: {
+    addFloorFileVisible: Boolean,
+    FolderName: String,
+    FolderId: String
+  },
+  computed: {
+    ...mapGetters("layout", ["projectId", "userInfo","userId", "secret"])
+  },
+  data() {
+    return {
+      form: {
+        desc: "", //描述
+        floorTypeVal: "F", //楼层类型得值
+        interlayerTypeVal: "M1", //夹层类型得值
+        haveInterlayer: false, //是否有夹层
+        file: null, //上传文件
+        floorNum: 1 //楼层
+      },
+      fileList: [], //上传楼层列表
+      floorType: [
+        {
+          value: "F",
+          label: "正常层(F)"
+        },
+        {
+          value: "RF",
+          label: "屋顶(RF)"
+        },
+        {
+          value: "B",
+          label: "地下(B)"
+        }
+      ],
+      interlayerType: [
+        {
+          value: "M1",
+          label: "夹层M1"
+        },
+        {
+          value: "M2",
+          label: "夹层M2"
+        },
+        {
+          value: "M3",
+          label: "夹层M3"
+        }
+      ],
+      //请求头
+      headers: {
+        ProjectId: ""
+      },
+      updataData: {
+        model: {}
+      }
+    };
+  },
+  methods: {
+    onSubmit() {
+      if (this.form.file == null) {
+        this.$message.error("模型文件不能为空!");
+      } else {
+        let FloorName = null;
+        // 根据是否有夹层拼接楼层名
+        if (this.haveInterlayer) {
+          if (this.form.floorTypeVal == "RF") {
+            FloorName = this.form.floorTypeVal + interlayerType;
+          } else {
+            FloorName =
+              this.form.floorTypeVal + this.form.floorNum + interlayerType;
+          }
+        } else {
+          if (this.form.floorTypeVal == "RF") {
+            FloorName = this.form.floorTypeVal;
+          } else {
+            FloorName = this.form.floorTypeVal + this.form.floorNum;
+          }
+        }
+        let data = {
+          ProjectId: this.projectId,
+          FolderId: this.FolderId,
+          FloorName: FloorName,
+          Form: this.form,
+          userName:this.userInfo.username
+        };
+        request.createFloor(data).then(res => {
+          if (res.Result == "success") {
+            //  创建成功
+            this.$emit("finishCreateFloor", {
+              FloorModelId: res.FloorModelId,
+              CurrentModelId:res.CurrentModelId,
+              Form: this.form
+            });
+            this.handleClose();
+            // this.submitUpload(res.FloorModelId);
+          }
+        });
+      }
+    },
+    // /上传到服务器/
+    submitUpload(FloorModelId) {
+      this.$refs.upload.submit();
+    },
+    handleClose() {
+      this.$emit("closeAddFloorDia");
+    },
+    // 删除上传文件
+    handleRemove(file, fileList) {
+      this.fileList = []
+      this.form.file = null;
+    },
+    handlePreview(file, fileList) {
+      console.log(file, fileList);
+    },
+    handleChange(file, fileList) {
+      console.log(file, fileList);
+    },
+    // 获取上传文件
+    onChangeUpLoad(file, fileList) {
+      console.log(file, fileList);
+      if (fileList.length) {
+        this.form.file = file;
+      }
+    }
+  },
+  watch: {
+    addFloorFileVisible(val) {
+      if (val) {
+        this.handleRemove();
+        this.form = {
+          desc: "", //描述
+          floorTypeVal: "F", //楼层类型得值
+          interlayerTypeVal: "M1", //夹层类型得值
+          haveInterlayer: false, //是否有夹层
+          file: null, //上传文件
+          floorNum: 1 //楼层
+        };
+      }
+    }
+  },
+  mounted() {
+    this.fileList = [];
+    this.form.file = null;
+  }
+};
+</script>
+<style lang="less">
+#addFloorDialog {
+  .floorModle {
+    display: flex;
+    justify-content: left;
+  }
+}
+</style>

+ 83 - 0
src/components/model/file/addFolder.vue

@@ -0,0 +1,83 @@
+<template>
+  <div id="addFolder">
+    <el-dialog title="提示" :visible.sync="addFolderVisible" width="30%" :before-close="closeDiaLog">
+      <div>
+        <el-form
+          :model="ruleForm"
+          :rules="rules"
+          ref="addFolderModel"
+          label-width="100px"
+          class="demo-ruleForm"
+        >
+          <el-form-item label="文件夹名称" prop="name">
+            <el-input v-model="ruleForm.name" focus></el-input>
+          </el-form-item>
+        </el-form>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="closeDiaLog">取 消</el-button>
+        <el-button type="primary" @click="addFolder">确 定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import request from "@/api/model/file.js";
+import { mapGetters } from "vuex";
+export default {
+  computed: {
+    ...mapGetters("layout", ["projectId", "userId", "secret"])
+  },
+  props: {
+    addFolderVisible: Boolean,
+    folderName: String
+  },
+  data() {
+    return {
+      ruleForm: {
+        name: ""
+      },
+      rules: {
+        name: [
+          { required: true, message: "文件夹名称不能为空!", trigger: "blur" }
+        ]
+      }
+    };
+  },
+  methods: {
+    closeDiaLog() {
+      this.resetForm();
+      this.$emit("closeAddFolderVisible");
+    },
+    addFolder() {
+      this.$refs["addFolderModel"].validate(valid => {
+        if (valid) {
+          request.createModel({ ProjectId: this.projectId, Name:this.ruleForm.name },res => {
+              this.$message({
+                message: "模型文件夹创建成功",
+                type: "success"
+
+              });
+              // 重新获取文件夹列表
+              this.$emit('getfolderModel')
+              this.closeDiaLog();
+            })
+        } else {
+          return false;
+        }
+      });
+    },
+    resetForm() {
+      this.$refs["addFolderModel"].resetFields();
+    },
+    createModel(Name) {
+      return request.createModel({ ProjectId: this.projectId, Name });
+    }
+  },
+  watch: {
+    folderName: function(val, oldVal) {
+      this.ruleForm.name = val;
+    }
+  }
+};
+</script>

+ 97 - 0
src/components/model/file/changeFolderName.vue

@@ -0,0 +1,97 @@
+<template>
+  <div id="changeFolderName">
+    <el-dialog
+      title="提示"
+      :visible.sync="changeFolderNameVisible"
+      width="30%"
+      :before-close="closeDiaLog"
+    >
+      <div>
+        <el-form
+          :model="ruleForm"
+          :rules="rules"
+          ref="changeFolderModelName"
+          label-width="100px"
+          class="demo-ruleForm"
+        >
+          <el-form-item label="文件夹名称" prop="name">
+            <el-input v-model="ruleForm.name" focus></el-input>
+          </el-form-item>
+        </el-form>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="closeDiaLog">取 消</el-button>
+        <el-button type="primary" @click="changeFolder">确 定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import request from "@/api/model/file.js";
+import { mapGetters } from "vuex";
+export default {
+  computed: {
+    ...mapGetters("layout", ["projectId", "userId", "secret"])
+  },
+  props: {
+    changeFolderNameVisible: Boolean,
+    folderName: String,
+    currentFolderId: String
+  },
+  data() {
+    return {
+      ruleForm: {
+        name: ""
+      },
+      rules: {
+        name: [
+          { required: true, message: "文件夹名称不能为空!", trigger: "blur" }
+        ]
+      }
+    };
+  },
+  methods: {
+    closeDiaLog() {
+      this.resetForm();
+      this.$emit("closeChangeFolderVisible");
+    },
+    changeFolder() {
+      this.$refs["changeFolderModelName"].validate(valid => {
+        if (valid) {
+          if (this.folderName == this.ruleForm.name) {
+            this.$message({ message: "文件夹名字不可与原来相同!",type:'error' });
+          } else {
+            request.updateModelName(
+              { Name: this.ruleForm.name, Id: this.currentFolderId },
+              () => {
+                this.$message({
+                  message: "模型文件夹创建成功",
+                  type: "success"
+                });
+                // 重新获取文件夹列表
+                this.$emit("finishChangeFolderName");
+                this.closeDiaLog();
+              }
+            );
+          }
+        } else {
+          return false;
+        }
+      });
+    },
+    resetForm() {
+      this.$refs["changeFolderModelName"].resetFields();
+    },
+  },
+  watch: {
+    folderName: function(val, oldVal) {
+      this.ruleForm.name = val;
+    }
+  }
+};
+</script>
+<style scoped >
+.dialog-footer {
+  
+}
+</style>

+ 199 - 0
src/components/model/file/floorTable.vue

@@ -0,0 +1,199 @@
+<template>
+  <el-table
+    ref="filterTable"
+    :data="tableData"
+    style="width: 100%"
+    :height="maxHeight"
+    :header-cell-style="{background:'#ccc',color:'#000'}"
+  >
+    <el-table-column prop="FloorName" label="模型文件" width="180">
+      <template slot-scope="scope">
+        <i class="el-icon-document-checked icon_font"></i>
+        <span style="margin-left: 10px">{{ scope.row.FloorName }}</span>
+      </template>
+    </el-table-column>
+    <el-table-column prop="Note" label="备注" width="180"></el-table-column>
+    <el-table-column prop="Version" label="版本号"></el-table-column>
+    <el-table-column prop="AcceptTime" label="上传时间"></el-table-column>
+    <el-table-column prop="UserName" label="上传人"></el-table-column>
+    <el-table-column prop="address" align="center" label="操作">
+      <template slot-scope="scope">
+        <div class="operate" v-show="!scope.row.isDown">
+          <el-button type="primary" size="mini" class="iconfont icon-download" @click="downloadModel(scope.row)" ></el-button>
+          <el-button type="primary" size="mini" class="iconfont icon-replace" @click="repliaceModel(scope.row)" ></el-button>
+          <el-button type="primary" size="mini" class="iconfont icon-Log" @click="queryModelLog(scope.row)" ></el-button>
+        </div>
+        <div :class="[scope.row.Status == 1 ||scope.row.Status == 2 ? 'upLoad-loading':'','upLoad']" v-show="scope.row.isDown" >
+          <div class="progress">
+            <el-progress
+              :text-inside="scope.row.Status == 1 || scope.row.Status == 2 ?false:true"
+              :stroke-width="20"
+              :percentage="scope.row.precent"
+              :color="scope.row.Status == 1 || scope.row.Status == 2 ?'#909399':'#67C23A'"
+            ></el-progress>
+          </div>
+          <div class="progress-right">
+            <el-button
+              v-show="!scope.row.Status"
+              type="danger"
+              class="iconfont icon-termination"
+              @click="closeUpdate(scope.row)"
+              circle
+            ></el-button>
+            <span v-show="scope.row.Status == 1">等待检查...</span>
+            <span v-show="scope.row.Status == 2">模型检查中</span>
+          </div>
+        </div>
+      </template>
+    </el-table-column>
+  </el-table>
+</template>
+<script>
+import { mapGetters } from "vuex";
+export default {
+  props: {
+    tableData: Array,
+    persentList: Array
+  },
+  data() {
+    return {
+      maxHeight: 0
+    };
+  },
+  computed: {
+    ...mapGetters("layout", ["projectId", "userInfo", "userId", "secret"])
+  },
+  methods: {
+    // 查看日志
+    queryModelLog(item) {
+      this.$emit("openModelLog", item);
+    },
+    // 替换日志
+    repliaceModel(item) {
+      this.$emit("replaceModel", item);
+    },
+    filterTag(Id, precent) {
+      this.$refs.filterTable.data.map(item => {
+        if (item.Id == Id) {
+          if (precent >= 100) {
+            // 如过precent == 100 不能关闭进度条,
+            if (precent == 100) {
+              item.precent = 99;
+            } else if (precent == 101) {
+              // 如过precent == 101 则返回结果为suceess 不能关闭进度条,
+              item.precent = 100;
+              item.isDown = false;
+              this.$emit("percentFinish");
+            }
+            return;
+          } else {
+            item.precent = precent;
+          }
+        }
+      });
+    },
+    // 下载模型文件
+    downloadModel(item) {
+      if (item.Url) {
+        window.open(item.Url);
+      } else {
+        this.$message({
+          message: "该文件夹下没有资源",
+          type: "error"
+        });
+      }
+    },
+    // 停止上传
+    closeUpdate(item) {
+      if (this.userInfo.username ==item.UserName ) {
+        this.$emit("closeUpdateFile", item);
+      } else {
+        this.$message({
+          message:"您不是该文件的上传者,不能停止该文件上传!",
+          type: "error"
+        });
+      }
+    }
+  },
+  watch: {
+    persentList: {
+      immediate: true,
+      deep: true,
+      handler: function(val, oldVal) {
+        if (val.length != 0) {
+          val.map(item => {
+            if (item.precent != 0) {
+              this.filterTag(item.Id, item.precent);
+            }
+          });
+        }
+      }
+    }
+  },
+  mounted() {
+    this.$nextTick(function() {
+      this.maxHeight = $("#file_moddle_manage").height() - 60; // 获取最外层的高度
+    });
+  }
+};
+</script>
+<style scoped lang="less">
+.box-card {
+  height: 100%;
+  .operate {
+    .iconfont {
+      font-size: 12px;
+      padding: 7px 12px;
+    }
+  }
+  .icon-termination {
+    color: #F56C6C;
+    background: #fff;
+    padding: 0;
+    border: 0;
+    font-size: 20px;
+    margin-left: 5px;
+  }
+  .upLoad {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    padding: 4px 0;
+    .progress {
+      width: 150px;
+      height: 20px;
+    }
+    .progress-right {
+      height: 20px;
+      line-height: 20px;
+    }
+
+  }
+  .upLoad-loading {
+    position: relative;
+    justify-content: center;
+    .progress {
+      width: 220px;
+      height: 20px;
+    }
+    .progress-right {
+      position: absolute;
+      left: 50%;
+      top: 50%;
+      transform: translate(-50%, -50%);
+      color: #fff;
+    }
+  }
+}
+/deep/ .el-icon-warning {
+  display: none;
+  // color: transparent;
+}
+/deep/ .el-progress__text {
+  display: none;
+}
+/deep/ .upLoad-loading .el-progress-bar {
+    padding-right: 44px;
+    margin-right: -44px;
+}
+</style>

+ 123 - 0
src/components/model/file/modelLog.vue

@@ -0,0 +1,123 @@
+<template>
+  <!-- 模型日志弹窗 -->
+  <div id="modelLog">
+    <el-dialog title="模型日志" :visible.sync="modelLogVisible" width="40%" :before-close="handleClose">
+      <div class="bodys">
+        <el-tabs v-model="activeName" type="card" @tab-click="changeModel">
+          <el-tab-pane label="上传日志" name="first">
+            <el-table :data="filterlogData" stripe height="300px" style="width: 100%">
+              <el-table-column prop="Version" label="版本"></el-table-column>
+              <el-table-column prop="CreateTime" label="上传时间"></el-table-column>
+              <el-table-column prop="UserName" label="上传人"></el-table-column>
+              <el-table-column prop="address" label="操作">
+                <template slot-scope="scope">
+                  <el-button @click="handleClick(scope.row)" v-if="!scope.row.Removed" type='primary' size="mini" class="iconfont icon-download"></el-button>
+                  <!-- 需求:先不支持删除 -->
+                  <!-- <el-button @click="deleteModel(scope.row)" v-if="!scope.row.Removed" type='danger' plain size="mini">删除</el-button> -->
+                </template>
+              </el-table-column>
+            </el-table>
+          </el-tab-pane>
+          <el-tab-pane label="工程改造" name="second"></el-tab-pane>
+        </el-tabs>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import request from "@/api/model/file.js";
+export default {
+  props: {
+    modelLogVisible: Boolean,
+    logData: Array
+  },
+  data() {
+    return {
+      dialogVisible: false, //是否显示该弹窗
+      activeName: "first", //默认选择上传日志
+      tableData: [] //列表数据
+    };
+  },
+  computed: {
+    filterlogData: function() {
+      let newLogData = [];
+      if (this.logData.length) {
+        this.logData.forEach(item => {
+          newLogData.push(item);
+        });
+      }
+      return newLogData
+    }
+  },
+  methods: {
+    handleClose(done) {
+      this.$emit("CloseModelLogDia");
+    },
+    handleClick(item) {
+      console.log(item);
+      if (item.Url) {
+        window.open(item.Url);
+      } else {
+        this.$message({
+          message: "该文件夹下没有资源",
+          type: "error"
+        });
+      }
+    },
+    changeModel() {},
+    /**
+     * 删除模型
+     *
+     */
+    deleteModel(item) {
+      this.$confirm(
+        "此操作只可删除楼层模型文件,已经识别的对象及关系等,暂不可删除。确定删除?",
+        "提示",
+        {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }
+      )
+        .then(() => {
+          request.deleteModelFileList(item.Id, res => {
+            if (res.Result == "success") {
+              //  刷新页面
+              this.$emit("deleteFinish");
+              this.$message({
+                type: "success",
+                message: "删除成功!"
+              });
+            } else {
+              this.$message({
+                type: "error",
+                message: res.Result
+              });
+            }
+          });
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "已取消删除"
+          });
+        });
+    }
+  }
+};
+</script>
+<style lang="less" scoped>
+#modelLog {
+  .bodys {
+    position: relative;
+    padding-bottom: 30px;
+    .delete-model {
+      position: absolute;
+      right: 0;
+      top: 0;
+      z-index: 10;
+    }
+  }
+}
+</style>
+

+ 119 - 0
src/components/model/file/replaceModelDialog.vue

@@ -0,0 +1,119 @@
+ <!-- 替换模型弹窗 -->
+
+<template>
+  <!-- 新增楼层 -->
+  <div id="replaceModel">
+    <el-dialog
+      title="替换模型"
+      :visible.sync="repliceModelVisible"
+      width="30%"
+      :before-close="handleClose"
+    >
+      <el-form ref="form" :model="form" label-width="100px">
+        <el-form-item label="模型文件:">
+          <el-upload
+            class="upload-demo"
+            ref="upload"
+            action="https://jsonplaceholder.typicode.com/posts/"
+            :on-preview="handlePreview"
+            :on-remove="handleRemove"
+            :file-list="fileList"
+            :auto-upload="false"
+            :on-change="onChangeUpLoad"
+            :limit="1"
+          >
+            <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
+          </el-upload>
+        </el-form-item>
+        <el-form-item label="选择模型文件替换原因:">
+          <ul>
+            <li>
+              <el-radio :disabled="isChioce" v-model="form.ReplaceReason" label="0">之前模型画错要修改</el-radio>
+            </li>
+            <li>
+              <el-radio :disabled="isChioce" v-model="form.ReplaceReason" label="1">因工程改造,更新模型文件</el-radio>
+            </li>
+          </ul>
+        </el-form-item>
+        <el-form-item>
+          <div class="dateTime" v-show="form.ReplaceReason == '1'">
+            <p>工程改造竣工时间:</p>
+            <el-date-picker v-model="form.finishTime" type="date" placeholder="选择日期"></el-date-picker>
+          </div>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" @click="onSubmit">确认</el-button>
+          <el-button @click="handleClose">取消</el-button>
+        </el-form-item>
+      </el-form>
+    </el-dialog>
+  </div>
+</template>
+<script>
+export default {
+  props: {
+    repliceModelVisible: Boolean,
+    replaceModelItem: Object
+  },
+  data() {
+    return {
+      form: {
+        file: null, //上传文件
+        ReplaceReason: "0",
+        finishTime: ""
+      },
+      isChioce: true, //是否可以选择替换原因
+      fileList: []
+    };
+  },
+  methods: {
+    onSubmit() {
+      if (this.form.file == null) {
+        this.$message.error("模型文件不能为空!");
+      } else {
+        this.$emit("updataModel", {
+          Form: this.form,
+          replaceModelItem: this.replaceModelItem
+        });
+        this.handleClose();
+      }
+    },
+    // /上传到服务器/
+    submitUpload() {
+      this.$refs.upload.submit();
+    },
+    handleClose() {
+      this.$emit("closeReplaceModelDia");
+    },
+    handleRemove(file, fileList) {
+      this.form.file = null;
+      this.fileList = []
+    },
+    handlePreview(file) {
+      console.log(file);
+    },
+    handleChange() {},
+    // 获取上传文件
+    onChangeUpLoad(file, fileList) {
+      if (fileList.length) {
+        this.form.file = file;
+      }
+    }
+  },
+  watch: {
+    repliceModelVisible(val) {
+      if (val) {
+        this.handleRemove();
+      }
+    }
+  }
+};
+</script>
+<style lang="less">
+#addFloorDialog {
+  .floorModle {
+    display: flex;
+    justify-content: left;
+  }
+}
+</style>

+ 573 - 27
src/views/model/file/index.vue

@@ -1,36 +1,582 @@
 <template>
 <template>
-    <div>
-      <das-board>
-        <template v-slot:plan>
-          <span>{{plan?plan:"yyyy-mm-dd"}}</span>
-        </template>
-        <template v-slot:finish>
-          <span>{{finish?finish:"yyyy-mm-dd"}}</span>
-        </template>
-        <template v-slot:onLine>
-          <span>{{onLine?onLine:"yyyy-mm-dd"}}</span>
-        </template>
-        <template v-slot:explain>
-          <span>{{explain?explain:"yyyy-mm-dd"}}</span>
-        </template>
-      </das-board>
-    </div>
-</template>
+  <div id="file_moddle_manage" v-loading="loading">
+    <!-- 左边模型文件夹列表 -->
+    <el-col class="col_left" :span="5">
+      <div class="grid-content grid-left">
+        <el-card class="box-card" :body-style="{ padding: '0px', height: '100%' }">
+          <div class="top_hand left_top_hand">
+            <div class="folder-box">
+              <el-tooltip class="item" effect="dark" content="新建文件夹" placement="top-start">
+                <el-button icon="el-icon-folder-add" @click="addFolder" class="icon_font"></el-button>
+              </el-tooltip>
+              <el-tooltip class="item" effect="dark" content="删除文件夹" placement="top-start">
+                <el-button icon="el-icon-folder-remove" class="icon_font" @click="removeFolder"></el-button>
+              </el-tooltip>
+            </div>
+            <div class="file-box">
+              <el-tooltip class="item" effect="dark" content="编辑文件夹" placement="top-start">
+                <el-button @click="editFolder" icon="el-icon-edit" class="icon_font"></el-button>
+              </el-tooltip>
+            </div>
+          </div>
+          <div class="folder-list">
+            <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>
+                  <span>{{item.Name}}</span>
+                </li>
+              </el-scrollbar>
+            </ul>
+          </div>
+        </el-card>
+      </div>
+    </el-col>
+    <!-- 右边文件表格 -->
+    <el-col class="col_left" :span="19">
+      <el-card class="box-card" :body-style="{ padding: '0px' }">
+        <!-- 顶部操作栏 -->
+        <div class="top_hand right_top_hand">
+          <el-button @click="addFloorFile">添加楼层文件</el-button>
+          <el-button @click="queryFloorFile(currentFolderId)">刷新</el-button>
+        </div>
+        <!-- 列表 -->
+        <floorTable
+          ref="floorTable"
+          :tableData="tableData"
+          @openModelLog="queryModelLog"
+          @replaceModel="repliaceModel"
+          @closeUpdateFile="removePersentList"
+          @percentFinish ="queryFloorFile(currentFolderId)"
+          :persentList="persentList"
+        ></floorTable>
+      </el-card>
+    </el-col>
+    <!-- 弹窗 开始-->
 
 
+    <!-- 模型日志弹窗 -->
+    <modelLog
+      :modelLogVisible="modelLogVisible"
+      @deleteFinish="updataLog"
+      @CloseModelLogDia="modelLogVisible=false"
+      :logData="logData"
+    ></modelLog>
+    <!-- 替换模型弹窗 -->
+    <repliceModel
+      :repliceModelVisible="repliceModelVisible"
+      @closeReplaceModelDia="repliceModelVisible=false"
+      :replaceModelItem="replaceModelItem"
+      @updataModel="updateModelFile"
+    ></repliceModel>
+    <!-- 新增楼层 -->
+    <addFloorDialog
+      :addFloorFileVisible="addFloorFileVisible"
+      :FolderName="currentFolderName"
+      :FolderId="currentFolderId"
+      @closeAddFloorDia="addFloorFileVisible=false"
+      @finishCreateFloor="uploadModelFIle"
+    ></addFloorDialog>
+    <!-- 新增文件夹名称 -->
+    <addFolder
+      :addFolderVisible="addFolderVisible"
+      @closeAddFolderVisible="addFolderVisible=false;folderName=''"
+      :folderName="folderName"
+      @getfolderModel="queryModel"
+    ></addFolder>
+    <!-- 编辑文件夹名字 -->
+    <changeFolderName
+      :currentFolderId="currentFolderId"
+      :changeFolderNameVisible="changeFolderNameVisible"
+      :folderName="folderName"
+      @finishChangeFolderName="queryModel"
+      @closeChangeFolderVisible="changeFolderNameVisible=false;folderName=''"
+    ></changeFolderName>
+    <!-- 弹窗 结束-->
+  </div>
+</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 repliceModel from "@/components/model/file/replaceModelDialog"; //替换模型弹窗
+import addFloorDialog from "@/components/model/file/addFloorDialog"; //新增楼层弹窗
+import addFolder from "@/components/model/file/addFolder"; //新增文件夹
+import changeFolderName from "@/components/model/file/changeFolderName"; //编辑名字
+import floorTable from "@/components/model/file/floorTable"; //右侧list表
 export default {
 export default {
-    components: {
-      dasBoard
+  computed: {
+    ...mapGetters("layout", ["projectId", "userInfo", "userId", "secret"])
+  },
+  components: {
+    dasBoard,
+    modelLog,
+    repliceModel,
+    addFloorDialog,
+    addFolder,
+    changeFolderName,
+    floorTable
+  },
+  data() {
+    return {
+      addFolderVisible: false, //是否显示新增文件夹弹窗
+      addFloorFileVisible: false, //是否显示增加楼层文件弹窗
+      repliceModelVisible: false, //是否显示替换楼层模型弹窗
+      modelLogVisible: false, //是否显示模型日志弹窗
+      changeFolderNameVisible: false, //是否显示编辑文件夹弹窗
+      folderName: "", //新建文件夹名称
+      navigationModel: [
+        {
+          Name: ""
+        }
+      ], //文件夹模型list
+      choiceIndex: 0, //当前文件夹index
+      currentFolderId: "", //当前选择的文件夹id
+      currentFolderName: "", //当前选择文件夹的Name
+      currentFloorModelId: "", //当前选择的楼层文件id
+      tableData: [],
+      loading: false, //加载loading
+      logData: [], //楼层文件对应的模型日志
+      replaceModelItem: null, //替换文件的item
+      uploadFloorModelIdList: [], //上传楼层文件得数组,上传完成则为空
+      //请求头
+      headers: {
+        ProjectId: ""
+      },
+      updataData: {
+        model: {}
+      },
+      persentList: [], //请求进度列表
+      uploadClassList: [], //请求list 用与缓存多个请求问题
+    };
+  },
+  methods: {
+    // 以下是模型文件夹
+
+    // 打开模型文件夹
+    openFolder(index, item) {
+      this.choiceIndex = index + 1;
+      this.currentFolderId = item.Id;
+      this.currentFolderName = item.Name;
+      // 获取模型文件夹对应得楼层文件
+      this.queryFloorFile(this.currentFolderId);
+    },
+    //新增模型文件夹
+    addFolder() {
+      this.folderName = "";
+      this.addFolderVisible = true;
+    },
+    //删除模型文件夹
+    removeFolder() {
+      this.$alert(`确定要删除文件夹 <${this.currentFolderName}> 吗?`, "提示", {
+        confirmButtonText: "确定",
+        callback: action => {
+          if (action == "confirm") {
+            let params = {
+              Id: this.currentFolderId,
+              ProjectId: this.projectId
+            };
+            request.deleteModel(params, res => {
+              this.$message({
+                message: "删除成功!",
+                type: "success"
+              });
+              this.queryModel();
+            });
+          } else {
+            this.$message({
+              type: "info",
+              message: `取消操作`
+            });
+          }
+        }
+      });
+    },
+    //编辑文件夹
+    editFolder() {
+      this.folderName = this.currentFolderName;
+      this.changeFolderNameVisible = true;
+    },
+    // 查询所有文件夹模型
+    queryModel() {
+      this.loading = true;
+      request.queryModel("", res => {
+        this.navigationModel = res.Content;
+        //默认选择第一个文件夹
+        this.choiceIndex = 1;
+        this.currentFolderName = this.navigationModel[0].Name;
+        this.currentFolderId = this.navigationModel[0].Id;
+        this.loading = false;
+        this.queryFloorFile(this.currentFolderId);
+      });
+    },
+
+    ///一下是楼层文件
+
+    //获取楼层文件
+    /**
+     * @param currentFolderId 当前选择得楼层id
+     */
+    queryFloorFile(currentFolderId) {
+      let data = {
+        FolderId: currentFolderId,
+        ProjectId: this.projectId
+      };
+      return new Promise((resolve, reject) => {
+        request.queryFloorList(data, res => {
+          res.Content.map(item => {
+            // 显示进度条:Status == 0 || null 正在上传 ;:Status == 1:等待检查;Status == 2:模型检查中; Status == 3 文件上传完成
+            if (item.Status == 3) {
+              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 });
+                  }
+                });
+              }
+            }
+          });
+          this.tableData = res.Content;
+          this.loading = false;
+          resolve();
+        });
+      });
+    },
+    //添加楼层文件
+    addFloorFile() {
+      this.addFloorFileVisible = true;
+    },
+
+    //以下是文件模型
+
+    //打开替换文件模型
+    repliaceModel(item) {
+      this.replaceModelItem = item;
+      this.repliceModelVisible = true;
+    },
+    // 上传模型文件
+    uploadModelFIle(data) {
+      // 在列表中添加
+      this.persentList.push({
+        Id: data.FloorModelId,
+        precent: 0
+      });
+      let uploadClass = this.uploadClass();
+      this.uploadClassList.push({
+        obj: new uploadClass(data),
+        Id: data.FloorModelId
+      });
+    },
+    // 上传文件的类
+    uploadClass() {
+      let that = this;
+      return class {
+        constructor(data) {
+          this.upload(data);
+        }
+        upload(data) {
+          that.queryFloorFile(that.currentFolderId).then(() => {
+            // 开始上传文件
+            // 开始处理数据
+            let formData = new FormData();
+            formData.append(
+              "model",
+              JSON.stringify({
+                FloorModelId: data.FloorModelId,
+                Id: data.CurrentModelId
+              })
+            );
+            formData.append("file", data.Form.file.raw);
+            // 处理数据结束
+
+            // 修改isdown得值
+            that.tableData.map(item => {
+              if (item.Id == data.FloorModelId) {
+                item.isDown = true;
+                item.precent = 0;
+              }
+            });
+
+            // 开始上传
+            request.uploadModelFile(
+              formData,
+              that.projectId,
+              res => {
+                let loaded = res.loaded, //加载量
+                  total = res.total; //文件大小
+                that.$nextTick(() => {
+                  let precent = Math.round((loaded / total) * 100);
+                  // this.$refs.floorTable.filterTag(data.FloorModelId, precent);
+                  if (that.persentList.length != 0) {
+                    that.persentList.map(item => {
+                      if (item.Id == data.FloorModelId) {
+                        item.precent = precent;
+                      }
+                    });
+                  }
+                });
+              },
+              val => {
+                if (val.data.Result === "success") {
+                  if (that.persentList.length != 0) {
+                    that.persentList.forEach((item, index) => {
+                      if (item.Id == data.FloorModelId) {
+                        item.precent = 101;
+                        that.persentList.splice(index, 0);
+                        return;
+                      }
+                    });
+                  }
+                  that.$message({
+                    message: "文件上传成功",
+                    type: "success"
+                  });
+                } else {
+                  if (that.persentList.length != 0) {
+                    that.persentList.forEach((item, index) => {
+                      if (item.Id == data.FloorModelId) {
+                        item.precent = 101;
+                        that.persentList.splice(index, 0);
+                        return;
+                      }
+                    });
+                  }
+                  that.$message({
+                    message: val.data.Message,
+                    type: "error"
+                  });
+                }
+              }
+            );
+          });
+        }
+      };
+    },
+    //更新模型文件;
+    updateModelFile(data) {
+      this.persentList.push({
+        Id: data.replaceModelItem.Id,
+        precent: 0
+      });
+      // 修改isdown得值
+      this.tableData.map(item => {
+        if (item.Id == data.replaceModelItem.Id) {
+          item.isDown = true;
+          item.precent = 0;
+        }
+      });
+      // 开始上传
+      let updataclass = this.updateModelClass();
+      this.uploadClassList.push({
+        obj: new updataclass(data),
+        Id: data.replaceModelItem.Id
+      });
     },
     },
-    data() {
-        return {
-          plan: "",
-          finish: "",
-          onLine: "",
-          explain: "模型文件管理"
+    // 更新文件的类
+    updateModelClass() {
+      let that = this;
+      // 开始上传
+      return class {
+        constructor(data) {
+          this.upDateModel(data);
+        }
+        upDateModel(data) {
+          request.upDateModelFile(
+            data,
+            that.projectId,
+            that.userInfo.username,
+            res => {
+              let loaded = res.loaded, //加载量
+                total = res.total; //文件大小
+              that.$nextTick(() => {
+                let precent = Math.round((loaded / total) * 100);
+                // this.$refs.floorTable.filterTag(data.FloorModelId, precent);
+                if (that.persentList.length != 0) {
+                  that.persentList.map(item => {
+                    if (item.Id == data.replaceModelItem.Id) {
+                      item.precent = precent;
+                    }
+                  });
+                }
+              });
+            },
+            val => {
+              if (val.data.Result === "success") {
+                if (that.persentList.length != 0) {
+                  that.persentList.forEach((item, index) => {
+                    if (item.Id == data.replaceModelItem.Id) {
+                      item.precent = 101;
+                      that.persentList.splice(index, 0);
+                      return;
+                    }
+                  });
+                }
+                that.$message({
+                  message: "文件上传成功",
+                  type: "success"
+                });
+              } else {
+                if (that.persentList.length != 0) {
+                  that.persentList.forEach((item, index) => {
+                    if (item.Id == data.FloorModelId) {
+                      item.precent = 101;
+                      that.persentList.splice(index, 0);
+                      return;
+                    }
+                  });
+                }
+                that.$message({
+                  message: val.data.Message,
+                  type: "error"
+                });
+              }
+            }
+          );
         }
         }
+      };
+    },
+    //查看模型日志
+    queryModelLog(item) {
+      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() {}
+    // 删除上传列表item
+    removePersentList(item) {
+      this.uploadClassList.forEach((i, index) => {
+        if (item.Id == i.Id) {
+          this.$delete(this.uploadClassList, index);
+          //  this.uploadClassList.splice(index,0)
+          return;
+        }
+      });
+      this.persentList.forEach((i, index) => {
+        if (item.Id == i.Id) {
+          this.$delete(this.persentList, index);
+          return;
+        }
+      });
+      this.queryFloorFile(this.currentFolderId);
+      this.$message({
+        message: "中止上传!",
+        type: "success"
+      });
+    }
+  },
+  mounted() {
+    this.queryModel();
+    // 十秒刷新次楼层列表
+    setInterval(()=>{
+       this.queryFloorFile(this.currentFolderId) 
+    },10000)
+  }
+};
+</script>
+<style lang="less" scoped>
+#file_moddle_manage {
+  width: 100%;
+  height: 100%;
+  overflow: hidden !important;
+  .col_left{
+    height:  100%;
+  }
+  .grid-content{
+    height:100%;
+  }
+  .box-card {
+    height:100%;
+  }
+  .grid-left {
+    padding-right: 10px;
+    box-sizing: border-box;
+  }
+  // 顶部
+  .top_hand {
+    height: 60px;
+    width: 100%;
+    padding: 10px;
+    box-sizing: border-box;
+    display: flex;
+  }
+  .left_top_hand {
+    align-items: center;
+    justify-content: space-between;
+    .folder-box {
+      display: flex;
+      height: 40px;
+      flex-direction: row;
+    }
+    .box-icon {
+      width: 40px;
+      height: 40px;
+      font-size: 30px;
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      float: left;
+    }
+  }
+  // 左侧文件夹列表
+  .folder-list {
+    width: 100%;
+    height: calc(100% - 60px);
+    .head {
+      height: 42px;
+      width: 100%;
+      padding-left: 10px;
+      box-sizing: border-box;
+      background: #ccc;
+      color: #000;
+      display: flex;
+      justify-content: left;
+      align-items: center;
+      font-weight: bold;
+    }
+    .lists {
+      width: 100%;
+      margin-top: 10px;
+      height: calc(100% - 52px);
+      overflow-y: auto;
+      li {
+        height: 42px;
+        display: flex;
+        justify-content: left;
+        align-items: center;
+        padding-left: 20px;
+        box-sizing: border-box;
+        cursor: pointer;
+        span {
+          padding-left: 6px;
+        }
+      }
+      li:hover {
+        background: rgb(240, 238, 238);
+        font-weight: bold;
+      }
+      .li-active {
+        background: rgb(240, 238, 238);
+        font-weight: bold;
+      }
+    }
+  }
+  .icon_font {
+    font-size: 18px;
+  }
+}
+/deep/ .el-scrollbar__wrap {
+  overflow-x: hidden;
 }
 }
-</script>
+</style>