YaolongHan 5 rokov pred
rodič
commit
887344509e

+ 3 - 0
package.json

@@ -10,6 +10,9 @@
         "build": "node build/build.js"
     },
     "dependencies": {
+        "@sybotan-web/base": "2.0.51",
+        "@sybotan-web/draw": "2.0.94",
+        "@sybotan-web/graphy": "2.0.77",
         "axios": "^0.18.0",
         "echarts": "^4.1.0",
         "element-ui": "^2.11.0",

+ 84 - 0
src/views/ready/buildfloor/drawGraphy/checkGraphy.vue

@@ -0,0 +1,84 @@
+<template>
+  <el-dialog
+    id="checkGraphy"
+    title="添加平面图"
+    :visible.sync="checkGraphyVisible"
+    width="40%"
+    :before-close="handleClose"
+  >
+    <div class="bodys">
+      <el-select v-model="value" placeholder="请选择" size="mini">
+        <el-option
+          v-for="item in options"
+          :key="item.value"
+          :label="item.label"
+          :value="item.value"
+        ></el-option>
+      </el-select>
+      <div>
+        或<el-button type="text">上传图片</el-button>
+      </div>
+      <!-- 展示框 -->
+      <div class="showBox"></div>
+    </div>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="handleClose">取 消</el-button>
+      <el-button type="primary" @click="bindGraphy">确 定</el-button>
+    </span>
+  </el-dialog>
+</template>
+<script>
+export default {
+  props:{
+      checkGraphyVisible:Boolean
+  },
+  data() {
+    return {
+      options: [
+        {
+          value: "选项1",
+          label: "黄金糕"
+        },
+        {
+          value: "选项2",
+          label: "双皮奶"
+        },
+        {
+          value: "选项3",
+          label: "蚵仔煎"
+        },
+        {
+          value: "选项4",
+          label: "龙须面"
+        },
+        {
+          value: "选项5",
+          label: "北京烤鸭"
+        }
+      ],
+      value: "",
+      dialogVisible:false
+    };
+  },
+  methods: {
+      handleClose(){
+        this.$emit('handleCloseCGraphy')
+      },
+      // 绑定图片
+      bindGraphy(){
+ 
+      }
+  }
+};
+</script>
+<style lang="less">
+#checkGraphy {
+  .bodys {
+      .showBox{
+          width: 100%;
+          height: 300px;
+          border:1px #ccc solid
+      }
+  }
+}
+</style>

+ 21 - 0
src/views/ready/buildfloor/drawGraphy/noGraphy.vue

@@ -0,0 +1,21 @@
+<template>
+  <el-dialog
+    id="checkdrawimg"
+    title="添加平面图"
+    :visible.sync="dialogVisible"
+    width="40%"
+    :before-close="handleClose"
+  >
+    <div class="bodys">
+    </div>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="dialogVisible = false">取 消</el-button>
+      <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
+    </span>
+  </el-dialog>
+</template>
+<style lang="less">
+    #checkdrawimg{
+        
+    }
+</style>

+ 49 - 0
src/views/ready/buildfloor/drawGraphy/repetitionGraphy.vue

@@ -0,0 +1,49 @@
+<template>
+  <el-dialog
+    id="checkdrawimg"
+    title="前期准备/建筑楼层管理/平面图维护"
+    :visible.sync="repetitionGraphyVisible"
+    width="60%"
+    :before-close="handleClose"
+  >
+    <div class="bodys">
+      <div class="buttons">
+        <el-button icon="el-icon-back" size="mini"></el-button>
+        <el-button size="mini">替换平面图</el-button>
+        <el-button size="mini">编辑平面图</el-button>
+      </div>
+      <!-- 展示图片 -->
+      <div class="drawImg"></div>
+    </div>
+    <span slot="footer" class="dialog-footer">
+      <el-button @click="dialogVisible = false">取 消</el-button>
+      <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
+    </span>
+  </el-dialog>
+</template>
+<script>
+export default {
+  props: {
+    repetitionGraphyVisible: Boolean
+  },
+  data() {
+    return {
+      dialogVisible: true
+    };
+  },
+  methods: {
+      handleClose(){
+        this.$emit('closeRepeatVisible')
+      }
+  },
+};
+</script>
+<style lang="less">
+#checkdrawimg {
+  .drawImg {
+    width: 100%;
+    height: 300px;
+    border: 1px solid #ccc;
+  }
+}
+</style>

+ 139 - 61
src/views/ready/buildfloor/index.vue

@@ -12,7 +12,12 @@
         </div>
         <h4>建筑</h4>
         <div class="build-list">
-          <div v-for="(item,index) in buildList" :key="item.BuildID" :class="{'floor-item':true,active:item.active}" @click="changeBuild(index)">
+          <div
+            v-for="(item,index) in buildList"
+            :key="item.BuildID"
+            :class="{'floor-item':true,active:item.active}"
+            @click="changeBuild(index)"
+          >
             <span>
               {{item.BuildLocalName || item.BuildName}}
               <el-badge class="mark" :is-dot="false" />
@@ -25,28 +30,38 @@
           <el-button size="small" type="default" @click="addFloor">添加楼层</el-button>
         </div>
         <div class="table-box">
-          <el-table :data="tableData" style="width: 100%" height="100%" v-loading="loading" :header-cell-style="headerStyle">
+          <el-table
+            :data="tableData"
+            style="width: 100%"
+            height="100%"
+            v-loading="loading"
+            :header-cell-style="headerStyle"
+          >
             <el-table-column label="楼层本地名">
               <template slot-scope="scope">{{scope.row.FloorLocalName||scope.row.FloorName}}</template>
             </el-table-column>
             <el-table-column label="楼层信息">
               <template slot-scope="scope">
-                <el-button size="mini" @click="editFloorData(scope.row)" plain icon="el-icon-edit-outline"></el-button>
+                <el-button
+                  size="mini"
+                  @click="editFloorData(scope.row)"
+                  plain
+                  icon="el-icon-edit-outline"
+                ></el-button>
               </template>
             </el-table-column>
             <el-table-column prop="Datasource" label="平面图">
               <template slot-scope="scope">
-                <p v-if="scope.row.StructureInfo&&scope.row.StructureInfo.FloorMap">
+                <p v-if="scope.row.StructureInfo&&scope.row.StructureInfo.FloorMap" @click="checfDrawImg(scope.row,1)">
                   <i class="iconfont icon-floorplan"></i>
                   查看平面图
                 </p>
-                <p v-else-if="scope.row.type==2">
+                <p v-else-if="scope.row.type==2" @click="checfDrawImg(scope.row,2)">
                   <el-badge is-dot>
                     <i class="iconfont icon-floorplan"></i>
-                  </el-badge>
-                  平面图重复
+                  </el-badge>平面图重复
                 </p>
-                <p v-else>
+                <p v-else @click="checfDrawImg(scope.row,3)">
                   <i class="iconfont icon-nopicture"></i>
                   暂无平面图
                 </p>
@@ -54,29 +69,62 @@
             </el-table-column>
             <el-table-column prop="SubTypeName" label="楼层贯通关系">
               <template slot-scope="scope">
-                <span style="margin-right:20px">{{scope.row.FloorThroughList?scope.row.FloorThroughList.length:0}}</span>
-                <el-button size="mini" @click="changeConnection(scope.row)" plain icon="el-icon-edit-outline"></el-button>
+                <span
+                  style="margin-right:20px"
+                >{{scope.row.FloorThroughList?scope.row.FloorThroughList.length:0}}</span>
+                <el-button
+                  size="mini"
+                  @click="changeConnection(scope.row)"
+                  plain
+                  icon="el-icon-edit-outline"
+                ></el-button>
               </template>
             </el-table-column>
             <el-table-column prop="action" label="操作">
               <template slot-scope="scope">
-                <el-button size="mini" @click="handleDelete(scope.row)" type="danger" plain icon="el-icon-delete"></el-button>
+                <el-button
+                  size="mini"
+                  @click="handleDelete(scope.row)"
+                  type="danger"
+                  plain
+                  icon="el-icon-delete"
+                ></el-button>
               </template>
             </el-table-column>
           </el-table>
         </div>
         <!-- 分页 -->
-        <el-pagination class="fr" v-show="tableData && tableData.length" @size-change="handleSizeChange" @current-change="handleCurrentChange"
-          :current-page="page.pageNumber" :page-sizes="page.pageSizes" :page-size="page.pageSize" layout="total, sizes, prev, pager, next, jumper"
-          :total="page.total"></el-pagination>
+        <el-pagination
+          class="fr"
+          v-show="tableData && tableData.length"
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :current-page="page.pageNumber"
+          :page-sizes="page.pageSizes"
+          :page-size="page.pageSize"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total="page.total"
+        ></el-pagination>
       </div>
     </el-row>
     <!-- 添加-修改楼层 -->
-    <addFloor :title="floorTitle" ref="addFloorDialog" :curBuildId="curBuildId" :curFloorId="curFloorId" @refresh="refresh"></addFloor>
+    <addFloor
+      :title="floorTitle"
+      ref="addFloorDialog"
+      :curBuildId="curBuildId"
+      :curFloorId="curFloorId"
+      @refresh="refresh"
+    ></addFloor>
     <!-- 添加-修改建筑 -->
     <addBuild :title="buildTitle" ref="addBuildDialog"></addBuild>
     <!-- 删除建筑-删除楼层 -->
-    <el-dialog title="提示" :visible.sync="delDialogVis" width="20%" @close="handleClose" id="messageDialog">
+    <el-dialog
+      title="提示"
+      :visible.sync="delDialogVis"
+      width="20%"
+      @close="handleClose"
+      id="messageDialog"
+    >
       <div>确定要删除该{{delText}}?</div>
       <span slot="footer" class="dialog-footer">
         <el-button size="small" @click="delDialogVis=false">取消</el-button>
@@ -85,6 +133,10 @@
     </el-dialog>
     <!-- 添加贯通关系弹窗 -->
     <addConnectivity ref="addConnectivity" @refresh="refresh"></addConnectivity>
+    <!-- 查看图片弹窗 -->
+    <checkGraphy :checkGraphyVisible="checkGraphyVisible"  @handleCloseCGraphy="checkGraphyVisible=false"></checkGraphy>
+    <!-- 替换楼层 -->
+    <repetitionGraphy :repetitionGraphyVisible="repetitionGraphyVisible" @closeRepeatVisible="repetitionGraphyVisible=false"></repetitionGraphy>
   </div>
 </template>
 
@@ -93,6 +145,10 @@ import addFloor from "@/views/ready/buildfloor/addFloor/index";
 import addBuild from "@/components/ready/buildfloor/addBuild";
 import { mapGetters, mapActions } from "vuex";
 import addConnectivity from "@/components/ready/buildfloor/addConnectivity";
+
+import checkGraphy from "./drawGraphy/checkGraphy"; //查看图片
+import noGraphy from "./drawGraphy/noGraphy"; //无图片
+import repetitionGraphy from "./drawGraphy/repetitionGraphy"; //重复图片
 import {
   buildingQuery,
   floorQuery,
@@ -102,18 +158,23 @@ export default {
   components: {
     addFloor,
     addBuild,
-    addConnectivity
+    addConnectivity,
+    checkGraphy,
+    noGraphy,
+    repetitionGraphy
   },
   data() {
     return {
-      floorTitle: '添加楼层',
-      buildTitle: '添加建筑',
+      checkGraphyVisible: false, //查看平面图弹窗
+      repetitionGraphyVisible: false, // 替换平面图弹窗
+      floorTitle: "添加楼层",
+      buildTitle: "添加建筑",
       delDialogVis: false,
-      delText: '建筑',
+      delText: "建筑",
       headerStyle: {
-        backgroundColor: '#d9d9d9',
-        color: '#2b2b2b',
-        lineHeight: '30px'
+        backgroundColor: "#d9d9d9",
+        color: "#2b2b2b",
+        lineHeight: "30px"
       },
       buildList: [],
       tableData: [
@@ -128,107 +189,124 @@ export default {
         total: 0
       },
       loading: false, //列表loading
-      curBuildId: '', //当前选中的建筑id
-      curFloorId: '', //当前选中的楼层id
-    }
+      curBuildId: "", //当前选中的建筑id
+      curFloorId: "" //当前选中的楼层id
+    };
   },
   computed: {
     ...mapGetters("layout", ["projectId"])
   },
-  mounted() { },
+  mounted() {},
   created() {
-    this.init()
+    this.init();
   },
   methods: {
     init() {
       let bdParam = {
         PageNumber: 1,
         PageSize: 500
-      }
+      };
       buildingQuery(bdParam, res => {
         this.buildList = res.Content;
         if (this.buildList.length) {
-          this.changeBuild(0)
+          this.changeBuild(0);
         }
-      })
+      });
     },
     //change build
     changeBuild(index) {
       this.buildList.map(item => {
-        item.active = false
-        return item
-      })
+        item.active = false;
+        return item;
+      });
       this.buildList[index].active = true;
       this.curBuildId = this.buildList[index].BuildID;
-      this.getFloorTableData()
-      this.$forceUpdate()
+      this.getFloorTableData();
+      this.$forceUpdate();
     },
     //add build
     addBuild() {
-      this.$refs.addBuildDialog.showDialog()
+      this.$refs.addBuildDialog.showDialog();
     },
     //delete build
     delBuild() {
-      this.delText = '建筑';
-      this.delDialogVis = true
+      this.delText = "建筑";
+      this.delDialogVis = true;
     },
     //edit build
-    editBuild() { },
+    editBuild() {},
     //delete floor
     handleDelete(floor) {
-      this.delText = '楼层';
+      this.delText = "楼层";
       this.delDialogVis = true;
       this.curFloorId = floor.FloorID;
     },
     //确认删除弹窗关闭
-    handleClose() { },
-    handleSizeChange(pageSize) { },
-    handleCurrentChange(pageNumber) { },
+    handleClose() {},
+    handleSizeChange(pageSize) {},
+    handleCurrentChange(pageNumber) {},
     addFloor() {
-      this.curFloorId = ''
-      this.$refs.addFloorDialog.showDialog()
+      this.curFloorId = "";
+      this.$refs.addFloorDialog.showDialog();
     },
     // 获取列表
     getFloorTableData() {
       let floorParam = {
-        Cascade: [{ Name: 'floorThroughList' }],
+        Cascade: [{ Name: "floorThroughList" }],
         Orders: "FloorSequenceID desc",
         PageNumber: this.page.pageNumber,
         PageSize: this.page.pageSize,
         Filters: `BuildID='${this.curBuildId}'`
-      }
+      };
       floorQuery(floorParam, res => {
         this.tableData = res.Content;
-        this.page.total = res.Total
-      })
+        this.page.total = res.Total;
+      });
     },
     // 创建楼层成功-修改关系成功
     refresh() {
-      this.getFloorTableData()
+      this.getFloorTableData();
     },
     // 确认删除(删除建筑-楼层公用)
     confirmDel() {
-      if (this.delText == '楼层') {
-        let delParam = [{ FloorID: this.curFloorId }]
+      if (this.delText == "楼层") {
+        let delParam = [{ FloorID: this.curFloorId }];
         manageDeleteFloor(delParam, res => {
-          this.$message.success('删除成功');
+          this.$message.success("删除成功");
           this.delDialogVis = false;
-          this.getFloorTableData()
-        })
+          this.getFloorTableData();
+        });
       } else {
         //todo
       }
     },
     // 修改楼层信息
     editFloorData(floor) {
-      this.floorTitle = '编辑楼层信息'
+      this.floorTitle = "编辑楼层信息";
       this.curFloorId = floor.FloorID;
-      this.$refs.addFloorDialog.showDialog(floor)
+      this.$refs.addFloorDialog.showDialog(floor);
     },
     // 修改楼层贯通关系
     changeConnection(row) {
-      this.$refs.addConnectivity.showDialog()
-      this.$refs.addConnectivity.floor = row
+      this.$refs.addConnectivity.showDialog();
+      this.$refs.addConnectivity.floor = row;
+    },
+    // 查看平面图
+    checfDrawImg(item,index) {
+      console.log(item)
+      if (1 == index) {
+        // 查看
+        this.checkGraphyVisible = true;
+        this.repetitionGraphyVisible = false;
+      } else if (2 == index) {
+        // 重复
+        this.checkGraphyVisible = false;
+        this.repetitionGraphyVisible = true;
+      } else {
+        //暂无
+        this.checkGraphyVisible = false;
+        this.repetitionGraphyVisible = true;
+      }
     }
   },
   watch: {
@@ -236,7 +314,7 @@ export default {
       this.init();
     }
   }
-}
+};
 </script>
 <style lang="less" scoped>
 #bd-fl-manage {