Browse Source

添加系统台账

qule 3 years ago
parent
commit
485604a206

+ 114 - 0
src/components/old-adm/ready/buildfloor/addFloor/index.vue

@@ -0,0 +1,114 @@
+<template>
+  <el-dialog :title="title" :visible.sync="dialogVisible" width="850px" @close="handleClose" id="messageDialog">
+    <el-row>
+      <formItems :type="'floor'" ref="formItems"></formItems>
+    </el-row>
+    <span slot="footer" class="dialog-footer">
+      <el-button size="small" @click="dialogVisible=false">取消</el-button>
+      <el-button size="small" type="primary" @click="confirm">确认</el-button>
+    </span>
+  </el-dialog>
+</template>
+<script>
+import FloorController from "@/controller/old-adm/floorController";
+import formItems from "@/components/old-adm/ready/components/formItems";
+import tools from "@/utils/old-adm/buildfloor/tools";
+
+export default {
+  props: {
+    title: {
+      default: '提示'
+    },
+    type: {
+      default: 'Floor'
+    },
+    curBuildId: {
+      default: ''
+    },
+    curFloorId: {
+      default: ''
+    }
+  },
+  components: {
+    formItems
+  },
+  data() {
+    return {
+      dialogVisible: false, //弹窗显示与隐藏
+      floorData: {},
+    };
+  },
+  methods: {
+    showDialog(data) {
+      this.floorData = data || {};
+      this.floorData = tools.desFormatData(this.floorData)
+      this.floorData.outline = this.floorData.outline ? JSON.stringify(this.floorData.outline) : undefined;
+      //===测试代码===
+      // this.floorData.DefaultQRCode = 'Eq1101080004a93a45ce15e948dda155e9683803cf46QR'
+      // this.floorData.QRCodePic = 'Eq1101080004a93a45ce15e948dda155e9683803cf46QR'
+      //=====
+      this.timeoutSetVal()
+      this.dialogVisible = true;
+    },
+    timeoutSetVal() {
+      setTimeout(() => {
+        if (this.$refs.formItems) {
+          this.$refs.formItems.form = this.floorData
+        } else {
+          this.timeoutSetVal()
+        }
+      }, 500)
+    },
+    handleClose() {
+    },
+    //创建
+    confirm() {
+      this.$refs.formItems.submitForm(this.save)
+    },
+    save() {
+      let form = this.$refs.formItems.form
+      if (form.outline) form.outline = JSON.parse(form.outline);
+      let newform = tools.formatData(form)
+      newform.buildingId = this.curBuildId
+      let Param = {
+        content: [newform]
+      }
+      if (newform.id) {
+        FloorController.manageUpdateFloor(Param).then(res => {
+          this.$message.success('更新成功')
+          this.$emit('refresh')
+          this.dialogVisible = false;
+        })
+      } else {
+        FloorController.manageCreateFloor(Param).then(res => {
+          this.$message.success('创建成功')
+          this.$emit('refresh')
+          this.dialogVisible = false;
+        })
+      }
+    }
+  },
+  mounted() {
+  },
+  created() {
+  }
+};
+</script>
+<style lang="less" scoped>
+#messageDialog {
+  /deep/ .el-dialog__body {
+    height: 420px;
+    overflow: auto;
+  }
+
+  .el-form-item {
+    /deep/ label.el-form-item__label {
+      font-size: 12px;
+    }
+  }
+
+  /deep/ .FloorTypeSelect .el-form-item__content {
+    width: 200px;
+  }
+}
+</style>

+ 467 - 0
src/components/old-adm/ready/buildfloor/index.vue

@@ -0,0 +1,467 @@
+<template>
+    <div id="bd-fl-manage">
+        <el-row>
+            <div class="l-list">
+                <div class="action-box">
+                    <div>
+                        <el-button @click="addBuild" icon="el-icon-plus" size="small" type="default" />
+                        <el-button @click="delBuild" icon="el-icon-minus" size="small" type="default" :disabled="!buildList.length" />
+                        <el-button @click="editBuild" icon="el-icon-edit-outline" size="small" type="default" :disabled="!buildList.length" />
+                    </div>
+                </div>
+                <h4>建筑</h4>
+                <div class="build-list">
+                    <div
+                        :class="{ 'floor-item': true, active: item.active }"
+                        :key="item.id"
+                        @click="changeBuild(index)"
+                        style="cursor: pointer"
+                        v-for="(item, index) in buildList"
+                    >
+                        <span>
+                            {{ item.localName || item.name }}
+                            <el-badge :value="item.count" class="mark" v-if="item.count > 0" />
+                        </span>
+                    </div>
+                </div>
+            </div>
+            <div class="r-table" v-if="buildList.length > 0">
+                <div class="action-box">
+                    <el-button @click="addFloor" size="small" type="default">添加楼层 </el-button>
+                </div>
+                <div class="table-box">
+                    <el-table :data="tableData" :header-cell-style="headerStyle" height="100%" style="width: 100%" v-loading="loading">
+                        <el-table-column label="楼层本地名">
+                            <template slot-scope="scope">{{ scope.row.localName }}</template>
+                        </el-table-column>
+                        <el-table-column label="楼层顺序号">
+                            <template slot-scope="scope">{{ scope.row.floorSequenceID }}</template>
+                        </el-table-column>
+                        <el-table-column label="楼层信息">
+                            <template slot-scope="scope">
+                                <el-button @click="editFloorData(scope.row)" icon="el-icon-edit-outline" plain size="mini"></el-button>
+                            </template>
+                        </el-table-column>
+                        <el-table-column label="平面图" prop="dataSource">
+                            <template slot-scope="scope">
+                                <p @click="checkDrawImg(scope.row, 2)" v-if="scope.row.sign > 0">
+                                    <el-badge is-dot>
+                                        <i class="iconfont icon-floorplan" />
+                                    </el-badge>
+                                    平面图重复
+                                </p>
+                                <p @click="checkDrawImg(scope.row, 1)" v-else-if="scope.row.infos ? scope.row.infos.floorMap : false">
+                                    <i class="iconfont icon-floorplan" />
+                                    查看平面图
+                                </p>
+                                <p @click="checkDrawImg(scope.row, 3)" v-else>
+                                    <i class="iconfont icon-nopicture" />
+                                    暂无平面图
+                                </p>
+                            </template>
+                        </el-table-column>
+                        <el-table-column label="楼层贯通关系" prop="SubTypeName">
+                            <template slot-scope="scope">
+                                <span style="margin-right: 20px">{{ scope.row.floorThroughList ? scope.row.floorThroughList.length : 0 }}</span>
+                                <el-button @click="changeConnection(scope.row)" icon="el-icon-edit-outline" plain size="mini" />
+                            </template>
+                        </el-table-column>
+                        <el-table-column label="操作" prop="action">
+                            <template slot-scope="scope">
+                                <el-button @click="handleDelete(scope.row)" icon="el-icon-delete" plain size="mini" type="danger" />
+                            </template>
+                        </el-table-column>
+                    </el-table>
+                </div>
+            </div>
+            <div v-else class="r-table">
+                <div class="center" style="margin-top: 300px"><i class="icon-wushuju iconfont"></i> 请先在左侧创建建筑</div>
+            </div>
+        </el-row>
+        <!-- 添加-修改楼层 -->
+        <addFloor :curBuildId="curBuildId" :curFloorId="curFloorId" :title="floorTitle" @refresh="refresh" ref="addFloorDialog" />
+        <!-- 添加-修改建筑 :currentType="currentType"-->
+        <addBuild :buildTitle="buildTitle" ref="addBuildDialog" :buildMessage="buildMessage" @handleBuild="handleBuild" />
+        <!-- 删除建筑-删除楼层 -->
+        <el-dialog :visible.sync="delDialogVis" @close="handleClose" id="messageDialog" title="提示" width="20%">
+            <div>确定要删除该{{ delText }}?</div>
+            <span class="dialog-footer" slot="footer">
+                <el-button @click="delDialogVis = false" size="small">取消</el-button>
+                <el-button @click="confirmDel" size="small" type="primary">确认</el-button>
+            </span>
+        </el-dialog>
+        <!-- 添加贯通关系弹窗 -->
+        <addConnectivity @refresh="refresh" ref="addConnectivity" />
+    </div>
+</template>
+
+<script>
+import addFloor from "@/components/old-adm/ready/buildfloor/addFloor/index";
+import addBuild from "@/components/old-adm/ready/components/addBuild";
+import { mapGetters } from "vuex";
+import addConnectivity from "@/components/old-adm/ready/components/addConnectivity";
+import tools from "@/utils/old-adm/buildfloor/tools";
+import DicController from "@/controller/old-adm/dicController";
+import ScanController from "@/controller/old-adm/ScanController";
+
+export default {
+    components: {
+        addFloor,
+        addBuild,
+        addConnectivity,
+    },
+    data() {
+        return {
+            repetitionGraphyVisible: false, // 替换平面图弹窗
+            floorTitle: "添加楼层",
+            buildTitle: "添加建筑",
+            delDialogVis: false,
+            delText: "建筑",
+            headerStyle: {
+                backgroundColor: "#d9d9d9",
+                color: "#2b2b2b",
+                lineHeight: "30px",
+            },
+            buildList: [],
+            tableData: [],
+            page: {
+                pageSize: 500,
+                pageSizes: [10, 20, 50, 100],
+                pageNumber: 1,
+                total: 0,
+            },
+            loading: false, //列表loading
+            curBuildId: "", //当前选中的建筑id
+            curBuildName: "", //当前选中建筑的名称
+            curFloorId: "", //当前选中的楼层id
+            modelId: "",
+            buildMessage: {},
+            selectedBuildIndex: 0,
+        };
+    },
+    computed: {
+        ...mapGetters("layout", ["projectId"]),
+    },
+    mounted() {},
+    created() {
+        this.init();
+        this.handleBuildQuery();
+        this.handleSearchBuildKey();
+    },
+    methods: {
+        init() {
+            let bdParam = {
+                orders: "localName asc",
+                pageNumber: 1,
+                pageSize: 500,
+            };
+            ScanController.buildingQueryAndCount(bdParam).then((res) => {
+                this.buildList = res.content;
+                if (this.buildList.length) {
+                    // 如果存在建筑id,则将当前选择建筑置为该建筑
+                    if (this.$route.query.buildingId) {
+                        this.selectedBuildIndex = this.buildList.findIndex((item) => item.id === this.$route.query.buildingId);
+                    }
+                    this.changeBuild(this.selectedBuildIndex > this.buildList.length - 1 ? 0 : this.selectedBuildIndex);
+                }
+            });
+        },
+        //change build
+        changeBuild(index) {
+            this.selectedBuildIndex = index;
+            this.buildList.map((item) => {
+                item.active = false;
+                return item;
+            });
+            this.buildList[index].active = true;
+            this.curBuildId = this.buildList[index].id;
+            this.curBuildName = this.buildList[index].localName || this.buildList[index].name;
+            this.getFloorTableData();
+            this.$forceUpdate();
+        },
+        //add build
+        addBuild() {
+            // this.$message.warning("开发中...");
+            // return;
+            this.buildTitle = "添加建筑";
+            this.$refs.addBuildDialog.showDialog();
+            this.handleSearchBuildKey();
+        },
+        handleSearchBuildKey() {
+            let params = {
+                type: "building",
+                pageNumber: 1,
+                pageSize: 1000,
+                orders: "sort asc, name desc",
+            };
+            DicController.getDataDictionary(params).then((res) => {
+                let first = {};
+                //一级循环出来一级标签
+                let list = res.content.filter((i) => i.firstName !== "工作历" && i.firstName !== "能耗信息" && i.firstName !== "人员信息");
+                list.map((item) => {
+                    // console.table(item.category, item.dataType)
+                    const category = ["ENUM", "MENUM", "BOOLEAN"];
+                    if (item.category == "STATIC" && item.dataType.includes(category) && item.dataSource) {
+                        item.options = item.dataSource;
+                        item.props = {
+                            value: "code",
+                            label: "name",
+                            children: "content",
+                            checkStrictly: true,
+                        };
+                    }
+                    if (first[item.firstName] && first[item.firstName].length) {
+                    } else {
+                        first[item.firstName] = [];
+                    }
+                    if (item.path !== "infos.areaTree") {
+                        //DefaultQRCode,BuildQRCode 不再维护
+                        first[item.firstName].push({
+                            InfoPointName: item.name,
+                            InfoPointCode: item.code,
+                            Visible: item.visible,
+                            UnDisabled: item.unDisabled,
+                            SecondName: item.secondName ? item.secondName : "",
+                            options: item.dataSource,
+                            props: item.props,
+                            Unit: item.unit,
+                            Path: item.path,
+                            dataType: item.dataType,
+                            category: item.category,
+                            editable: item.editable,
+                        });
+                    }
+                });
+                this.buildMessage = first;
+            });
+        },
+        //delete build ,根据id删除建筑信息
+        delBuild() {
+            this.delText = "建筑";
+            this.delDialogVis = true;
+        },
+        //edit build
+        editBuild() {
+            this.buildTitle = "编辑建筑";
+            this.handleSearchBuildKey();
+            let list = this.currentBuildList.filter((i) => i.id === this.curBuildId);
+            let obj = {};
+            for (let i = 0; i < list.length; i++) {
+                obj = list[i];
+            }
+            this.$refs.addBuildDialog.showDialog(obj);
+        },
+        handleFile(val, name) {},
+        // handleBuild 获取建筑信息
+        handleBuild(val) {
+            let newform = tools.formatData(val);
+            let Param = {
+                content: [newform],
+            };
+            if (newform.id) {
+                ScanController.objectUpdateBuild(Param).then((res) => {
+                    this.$message.success("更新成功");
+                    this.$refs.addBuildDialog.closeDialog();
+                });
+            } else {
+                ScanController.objectCreateBuild(Param).then((res) => {
+                    this.$message.success("创建成功");
+                    this.$refs.addBuildDialog.closeDialog();
+                });
+            }
+            setTimeout(() => {
+                this.handleBuildQuery();
+                this.init();
+            }, 500);
+        },
+        //delete floor
+        handleDelete(floor) {
+            this.delText = "楼层";
+            this.delDialogVis = true;
+            this.curFloorId = floor.id;
+        },
+        //确认删除弹窗关闭
+        handleClose() {},
+        addFloor() {
+            this.curFloorId = "";
+            this.floorTitle = "添加楼层";
+            this.$refs.addFloorDialog.showDialog();
+        },
+        // 获取列表
+        getFloorTableData() {
+            let floorParam = {
+                cascade: [{ name: "floorThroughList" }],
+                orders: "floorSequenceID desc",
+                pageNumber: this.page.pageNumber,
+                pageSize: this.page.pageSize,
+                filters: `buildingId='${this.curBuildId}'`,
+            };
+            ScanController.floorQueryAndSign(floorParam).then((res) => {
+                this.tableData = res.content;
+                this.page.total = res.total;
+            });
+        },
+        // 创建楼层成功-修改关系成功
+        refresh() {
+            this.getFloorTableData();
+        },
+        // 确认删除(删除建筑-楼层公用)
+        confirmDel() {
+            if (this.delText == "楼层") {
+                let delParam = [{ id: this.curFloorId }];
+                this.delDialogVis = false;
+                ScanController.deleteFloorInfo(delParam).then((res) => {
+                    this.$message.success("删除成功");
+                    this.init();
+                });
+            } else {
+                // 删除建筑
+                if (this.tableData && this.tableData.length) {
+                    this.$message.error("当前建筑中包含楼层,不可删除");
+                    this.delDialogVis = false;
+                } else {
+                    let param = [{ id: this.curBuildId }];
+                    this.delDialogVis = false;
+                    ScanController.deleteBuildInfo(param).then((res) => {
+                        this.$message.success("删除成功");
+                        this.handleBuildQuery();
+                        this.init();
+                    });
+                }
+            }
+        },
+        // 修改楼层信息
+        editFloorData(floor) {
+            this.floorTitle = "编辑楼层信息";
+            this.curFloorId = floor.id;
+            this.$refs.addFloorDialog.showDialog(floor);
+        },
+        // 修改楼层贯通关系
+        changeConnection(row) {
+            this.$refs.addConnectivity.showDialog();
+            this.$refs.addConnectivity.floor = row;
+        },
+        // 查看平面图
+        checkDrawImg(row, index) {
+            if (3 == index) {
+                this.modelId = "";
+            } else if (index == 1) {
+                this.modelId = row.infos.floorMap;
+            } else {
+                this.modelId = row.modelId;
+            }
+            const pa = { modelId: this.modelId, FloorID: row.id, BuildID: row.buildingId, BuildName: this.curBuildName, FloorName: row.localName };
+            this.$router.push({ name: "repetitionGraphy", query: pa });
+        },
+        //  查询建筑信息
+        handleBuildQuery() {
+            let param = {
+                projectId: this.projectId,
+                orders: "localName asc",
+                pageNumber: 1,
+                pageSize: 500,
+            };
+            ScanController.objectQueryBuild(param).then((res) => {
+                this.currentBuildList = res.content;
+            });
+        },
+    },
+    watch: {
+        projectId() {
+            this.init();
+        },
+    },
+};
+</script>
+<style lang="less" scoped>
+#bd-fl-manage {
+    overflow: hidden;
+    height: 100%;
+    position: relative;
+
+    .el-row {
+        height: 100%;
+
+        .el-col-4 {
+            width: 17%;
+        }
+
+        .el-col-20 {
+            width: 82%;
+        }
+
+        & > div {
+            float: left;
+            height: 100%;
+            overflow: hidden;
+            background-color: #fff;
+            box-sizing: border-box;
+            border: 1px solid #dfe6ec;
+
+            .action-box {
+                padding: 10px;
+
+                .el-button--small {
+                    padding: 10px 11px;
+                }
+            }
+        }
+
+        .l-list {
+            width: 17%;
+            overflow-y: auto;
+
+            h4 {
+                padding-left: 10px;
+                border-top: 1px solid #d9d9d9;
+                border-bottom: 1px solid #d9d9d9;
+                background: #d9d9d9;
+                color: #2b2b2b;
+                line-height: 44px;
+            }
+
+            .build-list {
+                line-height: 48px;
+
+                .floor-item {
+                    white-space: nowrap;
+                    overflow: hidden;
+                    text-overflow: ellipsis;
+
+                    span {
+                        margin-left: 10px;
+                    }
+                }
+
+                .floor-item.active,
+                .floor-item:hover {
+                    background-color: #f5f7fa;
+                    color: #000;
+                }
+            }
+        }
+
+        .r-table {
+            width: 82%;
+            margin-left: 1%;
+
+            .table-box {
+                height: calc(100% - 54px);
+                margin-bottom: 8px;
+
+                .iconfont {
+                    vertical-align: middle;
+                }
+
+                /deep/ .el-badge__content.is-fixed {
+                    transform: translateY(-6%) translateX(-100%);
+                }
+
+                p {
+                    cursor: pointer;
+                }
+            }
+        }
+    }
+}
+</style>

+ 242 - 0
src/components/old-adm/ready/components/addBuild.vue

@@ -0,0 +1,242 @@
+<template>
+  <el-dialog
+    :title="buildTitle"
+    :visible.sync="buildDialogVis"
+    id="messageDialog"
+    width="850px"
+  >
+    <el-form
+      :inline="true"
+      :model="form"
+      label-width="160px"
+      :label-position="'right'"
+      :rules="rules"
+      ref="ruleForm"
+    >
+      <template v-for="(val,key) in buildMessage">
+        <h4 v-text="key != 'undefined' ? key :'信息'"></h4>
+
+        <div
+          :key="item.InfoPointCode"
+          v-for="item in val"
+          :class="[{'upload-file':item.dataType == 'ATTACHMENT' ||  item.Path === 'infos.pic'}]"
+          style="width: 50%;display: inline-block">
+
+          <el-form-item
+            :class="{FloorTypeSelect:item.dataType == 'ENUM'||item.Unit}"
+            :label="item.InfoPointName"
+            :prop="item.InfoPointCode"
+            v-if="all||item.Visible">
+            <el-input
+              :disabled="!item.editable"
+              v-if="item.dataType == 'STRING'"
+              v-model.trim="form[item.Path]"/>
+
+            <el-input
+              v-else-if="item.dataType == 'INTEGER' || item.dataType == 'DOUBLE'"
+              type="number"
+              v-model.trim="form[item.Path]">
+              <template slot="append" v-if="item.Unit">{{ item.Unit }}</template>
+            </el-input>
+
+            <el-select
+              v-else-if="item.dataType == 'ENUM' || item.dataType == 'BOOLEAN'"
+              placeholder="请选择"
+              v-model="form[item.Path]">
+              <el-option :key="op.name" :label="op.name" :value="op.code" v-for="op in item.options"></el-option>
+            </el-select>
+
+            <el-select
+              v-else-if="item.dataType == 'MENUM'"
+              placeholder="请选择"
+              v-model="form[item.Path]"
+              multiple
+              collapse-tags>
+              <el-option :key="op.name" :label="op.name" :value="op.code" v-for="op in item.options"></el-option>
+            </el-select>
+            <el-date-picker
+              v-else-if="item.dataType == 'DATETIME'"
+              v-model="form[item.Path]"
+              placeholder="选择日期"
+              type="date">
+            </el-date-picker>
+
+            <uploadImgs
+              v-else-if="item.dataType == 'ATTACHMENT'&& item.Path === 'infos.Pic'"
+              :readOnly="false"
+              v-model="form[item.Path]"
+              :keysArr="Array.isArray(buildData[item.Path]) ? buildData[item.Path]:[]"
+              :context-key="item.Path"
+              :isShow="1"
+              @change="changeItem"/>
+
+            <upload-files
+              v-else-if="item.dataType == 'ATTACHMENT'"
+              v-model="form[item.Path]"
+              :readOnly="false"
+              :isShow="1"
+              :keys-arr="Array.isArray(buildData[item.Path]) ? buildData[item.Path]:[] "
+              :show-file-list="false"
+              :context-key="item.Path"
+              @change="changeItem"/>
+
+          </el-form-item>
+        </div>
+      </template>
+    </el-form>
+    <span
+      class="dialog-footer"
+      slot="footer">
+    <el-button @click="buildDialogVis = false">取 消</el-button>
+    <el-button @click="submitForm('ruleForm')" type="primary" :disabled="buildDisabled">确 定</el-button>
+  </span>
+    <el-dialog :visible.sync="dialogVisible">
+      <img width="100%" :src="dialogImageUrl" alt="">
+    </el-dialog>
+  </el-dialog>
+</template>
+<script>
+import uploadFiles from "@/components/old-adm/business_space/lib/uploadFiles";
+import uploadImgs from "@/components/old-adm/business_space/lib/uploadImgsName";
+
+function flattenKeys(obj) {
+  let res = {}
+
+  function isObject(val) {
+    return typeof val === 'object' && !Array.isArray(val)
+  }
+
+  function digKeys(prev, obj) {
+    Object.entries(obj).forEach(([key, value]) => {
+      const currentKey = prev ? `${prev}.${key}` : key
+      if (isObject(value)) {
+        digKeys(currentKey, value)
+      } else {
+        res[currentKey] = value
+      }
+    })
+  }
+
+  digKeys('', obj)
+
+  return res
+}
+
+export default {
+  data() {
+
+    return {
+      buildName: '',
+      keysArr: [], //保存临时的文件key
+      buildDialogVis: false,
+      form: {},
+      dialogImageUrl: '',
+      dialogVisible: false,
+      all: true,
+      rules: {
+        "localId": [
+          {"required": true, "message": "请输入建筑本地编码", "trigger": "blur"}
+        ],
+        "localName": [
+          {"required": true, "message": "请输入建筑本地名称", "trigger": "blur"}
+        ]
+      },
+      buildData: {},
+      buildDisabled: false,
+    }
+  },
+  components: {uploadFiles, uploadImgs},
+  props: ['buildTitle', 'buildMessage', 'currentBuild'],
+  computed: {},
+  mounted() {
+  },
+  watch: {},
+  methods: {
+    deepCopy(obj) {
+      return JSON.parse(JSON.stringify(obj))
+    },
+    showDialog(data) {
+      //获取信息
+      let buildData = data || {};  // string =>array key
+      buildData = flattenKeys(buildData);
+      // for (let key in this.buildMessage) {
+      //   let arr = this.buildMessage[key];
+      //   if (Array.isArray(arr)) {
+      //     let list = arr.filter(i => i.dataType == 'MENUM' || i.dataType == 'DATETIME');
+      //     list.forEach(j => {
+      //       if (buildData.hasOwnProperty(j.Path)) {
+      //         if (!Array.isArray(buildData[j.Path])) {
+      //           buildData[j.Path] = buildData[j.Path].split(',');
+      //         }
+      //       }
+      //
+      //     })
+      //   }
+      // }
+      this.buildData = buildData;
+      this.timeoutSetVal()
+      this.buildDialogVis = true
+    },
+
+    timeoutSetVal() {
+      let that = this
+      setTimeout(() => {
+        if (that.form) {
+          that.form = that.buildData
+        } else {
+          this.timeoutSetVal()
+        }
+      })
+    },
+    closeDialog() {
+      this.buildDialogVis = false
+    },
+    submitForm(formName) {
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          this.buildDisabled = true
+          this.$emit('handleBuild', this.form)
+          setTimeout(() => {
+            this.buildDisabled = false
+          }, 2500)
+        } else {
+          return false;
+        }
+      });
+    },
+    changeItem(val) {
+      console.log(val)
+      let _key = Object.keys(val)[0] + '';
+      this.form[_key] = val[_key];
+
+    },
+
+  }
+}
+</script>
+<style lang="less" scoped>
+
+#messageDialog {
+  /deep/ .el-date-editor.el-input, .el-date-editor.el-input__inner, /deep/ .el-select {
+    width: 200px;
+  }
+
+  /deep/ .FloorTypeSelect .el-form-item__content {
+    width: 200px;
+  }
+
+  /deep/ .el-dialog__body {
+    height: 420px;
+    overflow: auto;
+  }
+
+  .upload-file {
+    width: 100% !important;
+    display: block !important;
+  }
+
+  /deep/ .el-input--small {
+    width: 200px
+  }
+}
+</style>

+ 86 - 0
src/components/old-adm/ready/components/addConnectivity.vue

@@ -0,0 +1,86 @@
+<template>
+    <el-dialog title="楼层贯通关系维护" :visible.sync="connectDialogVis" width="730px" id="messageDialog">
+        <el-row style="height: 80px">
+            <div style="line-height: 32px">添加与{{ floor.FloorLocalName }}层有贯通关系的楼层 :</div>
+            <div style="width: 70%">
+                <bfCascader ref="bfCascader" :floorId="floor.id"></bfCascader>
+            </div>
+        </el-row>
+        <span slot="footer" class="dialog-footer">
+            <el-button size="small" @click="connectDialogVis = false">取消</el-button>
+            <el-button size="small" type="primary" @click="save">确认</el-button>
+        </span>
+    </el-dialog>
+</template>
+<script>
+import bfCascader from "@/components/old-adm/ready/components/buildfloorCascader";
+import ScanController from "@/controller/old-adm/ScanController";
+
+export default {
+    data() {
+        return {
+            buildName: "",
+            connectDialogVis: false,
+            floor: {},
+        };
+    },
+    components: {
+        bfCascader,
+    },
+    methods: {
+        showDialog() {
+            this.connectDialogVis = true;
+            this.$nextTick(() => {
+                this.$refs.bfCascader.getCascader();
+                let arr = this.floor.floorThroughList || [];
+                let value = [];
+                if (arr.length) {
+                    arr.map((t) => {
+                        value.push([t.buildingId, t.id]);
+                    });
+                }
+                this.$refs.bfCascader.value = value;
+            });
+        },
+        save() {
+            let arr = this.$refs.bfCascader.value;
+            let param = {
+                floorId: this.floor.id,
+                floorOtherIdList: [],
+            };
+            arr.map((t) => {
+                if (t[1]) {
+                    param.floorOtherIdList.push(t[1]);
+                }
+            });
+            ScanController.createRelationInFloor(param).then((res) => {
+                this.connectDialogVis = false;
+                this.$message.success("关联成功");
+                this.$emit("refresh");
+            });
+        },
+    },
+};
+</script>
+<style lang="less" scoped>
+#messageDialog {
+    .el-row {
+        height: 50px;
+        max-height: 200px;
+        overflow-y: auto;
+        overflow-x: hidden;
+    }
+
+    .el-row > div {
+        float: left;
+    }
+
+    .el-row > div + div {
+        margin-left: 10px;
+    }
+
+    /deep/ .el-input__inner {
+        vertical-align: baseline;
+    }
+}
+</style>

+ 44 - 0
src/components/old-adm/ready/components/buildfloorCascader.vue

@@ -0,0 +1,44 @@
+<template>
+    <el-cascader v-model="value" :options="options" :props="props" clearable></el-cascader>
+</template>
+<script>
+import BuildController from "@/controller/old-adm/buildController";
+
+export default {
+    data() {
+        return {
+            value: [],
+            props: {
+                multiple: true,
+                value: "id",
+                label: "localName",
+                children: "floor",
+            },
+            options: [],
+        };
+    },
+    props: {
+        floorId: {
+            default: "",
+        },
+    },
+    created() {},
+    methods: {
+        getCascader() {
+            let param = {
+                cascade: [{ name: "floor", orders: "floorSequenceID desc", filters: `id != '${this.floorId}'` }],
+                pageNumber: 1,
+                pageSize: 50,
+            };
+            BuildController.buildingQuery(param).then((res) => {
+                this.options = res.content.filter((build) => build.floor);
+            });
+        },
+    },
+};
+</script>
+<style lang="less" scoped>
+.el-cascader {
+    width: 100%;
+}
+</style>

+ 240 - 0
src/components/old-adm/ready/components/formItems.vue

@@ -0,0 +1,240 @@
+<template>
+  <div id="inforsPoint">
+    <el-form
+      ref="ruleForm"
+      :model="form"
+      label-width="150px"
+      :rules="rules"
+      :inline="true"
+      :label-position="'right'"
+    >
+      <div
+        v-for="item in InforsList"
+        :key="item.infoPointCode"
+        style="width: 50%; display: inline-block"
+      >
+        <el-form-item
+          :label="item.name"
+          :prop="item.code"
+          v-if="all || item.visible"
+          :class="{ FloorTypeSelect: item.dataType == 'ENUM' || item.unit }"
+        >
+          <el-input
+            v-model.trim="form[item.path]"
+            v-if="
+              item.infoPointCode == 'bimLocation' ||
+              item.infoPointCode == 'modelId'
+            "
+            disabled
+          />
+
+          <!--二维码相关-->
+          <span v-else-if="item.infoPointCode == 'DefaultQRCode'">
+            <el-input
+              v-if="!form[item.path]"
+              v-model.trim="form[item.path]"
+              disabled
+            />
+            <el-popover v-else placement="right" width="210" trigger="click">
+              <div style="overflow: hidden">
+                <img
+                  style="width: 200px; height: 200px"
+                  :src="
+                    '/image-service/common/file_get/' +
+                    form[item.path] +
+                    '?systemId=dataPlatform'
+                  "
+                  alt="二维码"
+                />
+              </div>
+              <el-button slot="reference" type="text">点击查看</el-button>
+            </el-popover>
+          </span>
+
+          <span v-else-if="item.infoPointCode == 'QRCodePic'">
+            <el-input
+              v-if="!form[item.path]"
+              v-model.trim="form[item.path]"
+              disabled
+            />
+            <el-popover v-else placement="right" width="210" trigger="click">
+              <div style="overflow: hidden">
+                <img
+                  style="width: 200px; height: 200px"
+                  :src="
+                    '/image-service/common/file_get/' +
+                    form[item.path] +
+                    '?systemId=dataPlatform'
+                  "
+                  alt="二维码"
+                />
+              </div>
+              <el-button slot="reference" type="text">点击查看</el-button>
+            </el-popover>
+          </span>
+
+          <!--/二维码相关-->
+          <span v-else-if="item.dataType == 'STRING'">
+            <el-input
+              v-model.trim="form[item.path]"
+              :disabled="!item.editable"
+              :placeholder="
+                item.dataType == 'STRING' && item.path === 'localId'
+                  ? '填写示例:F1、B1?'
+                  : ''
+              "
+            />
+            <div
+              v-if="
+                item.dataType == 'STRING' &&
+                item.path === 'localId' &&
+                isShowTitle
+              "
+              style="color: gray; font-size: 12px"
+            >
+              用于楼层平面图切换
+            </div>
+          </span>
+
+          <el-input-number
+            v-model.trim="form[item.path]"
+            :controls="false"
+            style="text-align: right;"
+            v-else-if="item.dataType == 'INTEGER' || item.dataType == 'DOUBLE'"
+          >
+            <template slot="append" v-if="item.unit">{{ item.unit }}</template>
+          </el-input-number>
+
+          <el-select
+            v-model="form[item.path]"
+            placeholder="请选择"
+            v-else-if="item.dataType == 'ENUM'"
+          >
+            <el-option
+              v-for="op in item.options"
+              :key="op.code"
+              :label="op.name"
+              :value="op.code"
+            ></el-option>
+          </el-select>
+          <el-input
+            v-model.trim="form[item.path]"
+            v-else
+            :disabled="!item.editable"
+            :placeholder="item.dataType ? '' : '字典无输入类型'"
+          ></el-input>
+        </el-form-item>
+      </div>
+    </el-form>
+  </div>
+</template>
+<script>
+import DicController from "@/controller/old-adm/dicController";
+
+export default {
+  props: {
+    type: {
+      default: "floor",
+    },
+  },
+  data() {
+    let validateId = (rule, value, callback) => {
+      if (!value) {
+        this.isShowTitle = false;
+        return callback(new Error("请输入楼层本地编码"));
+      } else {
+        this.isShowTitle = true;
+        callback();
+      }
+    };
+    return {
+      form: {},
+      isShowTitle: true,
+      InforsList: [],
+      all: true, // 默认显示全部
+      rules: {
+        localId: [{ validator: validateId, trigger: "blur", required: true }],
+        localName: [
+          { required: true, message: "请输入楼层本地名称", trigger: "blur" },
+        ],
+        floorSequenceID: [
+          { required: true, message: "请输入楼层顺序号",  trigger: "blur" },
+        ],
+      },
+    };
+  },
+
+  created() {
+    this.getInforsPoint();
+  },
+  methods: {
+    getInforsPoint() {
+      let params = {
+        type: this.type,
+        // orders: "sort asc,infoPointCode asc",
+        pageNumber: 1,
+        pageSize: 1000,
+        orders: "sort asc, name desc",
+      };
+      DicController.getDataDictionary(params).then(res => {
+        let arr = res.content.map(item => {
+          const category = ['ENUM', 'MENUM', 'BOOLEAN']
+          if (item.category == 'STATIC' && category.includes(item.dataType) && item.dataSource) {
+            item.options = item.dataSource
+            if (item.options[0]) {
+              item.props = {
+                value: "code",
+                label: "name",
+                children: "content",
+                checkStrictly: true,
+              };
+            }
+          }
+          switch (
+            item.code //过滤掉待删除的
+            ) {
+            case "floorIdentity":
+            case "relatedSchedule":
+            case "outPeopleFlow":
+            case "inPeopleFlow":
+            case "exsitPeopleNum":
+              break;
+            default:
+              return item;
+          }
+        }).filter(_c=>{return !!_c;});
+        this.InforsList = arr;
+      });
+    },
+    submitForm(call) {
+      this.$refs.ruleForm.validate((valid) => {
+        if (valid) {
+          call();
+        } else {
+          return false;
+        }
+      });
+    },
+  },
+};
+</script>
+<style lang="less" scoped>
+#inforsPoint {
+  .el-form-item {
+    /deep/ label.el-form-item__label {
+      font-size: 12px;
+    }
+  }
+  /deep/ .el-input-number .el-input__inner {
+    text-align: left;
+  }
+
+  /deep/ .FloorTypeSelect .el-form-item__content {
+    width: 200px;
+  }
+
+  /deep/ .el-input--small {
+    width: 200px;
+  }
+}
+</style>

+ 142 - 20
src/controller/old-adm/ScanController.ts

@@ -1,18 +1,25 @@
 import { baseHttpUtils } from "@/utils/http/baseHttpUtils";
+import {
+  datacenter_pre,
+  dict_pre,
+  equipcomponent_pre,
+  equipquery_pre,
+  floor_pre,
+  graphhic_pre,
+  object_pre,
+  rwd_pre,
+} from "./preTypes";
 class ScanController {
   static http = new baseHttpUtils();
-  
+  /**
+   * 查询不在当前系统下的设备
+   */
   static async getEquipNotInSys(params, fn) {
-    const res = await ScanController.http.postRequest(`/equip-component/equip-query/equip-sys?sysId=${params.sysId}`, params)
-    return fn ? fn(res) : res
-  }
-  static async getEquipInSys(params, fn) {
-    const res = await ScanController.http.postRequest(`/equip-component/equip-query/sys-equip`, params)
-    return fn ? fn(res) : res
-  }
-  static async sysLinkEquip(params, fn) {
-    const res = await ScanController.http.postRequest(`/datacenter/rel/sy-in-eq/link-sy-eq`, params)
-    return fn ? fn(res) : res
+    const res = await this.http.postRequest(
+      equipquery_pre + `/equip-sys?sysId=${params.sysId}`,
+      params
+    );
+    return fn ? fn(res) : res;
   }
   /**
     *@description: 获取设定参数和动态参数
@@ -197,15 +204,130 @@ class ScanController {
     const res = await ScanController.http.postRequest('/datacenter/rel/sy-in-fl/link-fl', params);
     return fn ? fn(res) : res
   }
-/**
- * @description: 设备清单 - 根据对象删除系统和设备的关系
- * @param {*}
- * @return {*}
- */  
- static async sysUnlinkEquip(params, fn) {
-  const res = await ScanController.http.postRequest('/datacenter/sy-in-eq/unlinks-sy-eq', params);
-  return fn ? fn(res) : res
+  static async getEquipInSys(params, fn) {
+    const res = await ScanController.http.postRequest(`/equip-component/equip-query/sys-equip`, params)
+    return fn ? fn(res) : res
+  }
+  static async sysLinkEquip(params, fn) {
+    const res = await ScanController.http.postRequest(`/datacenter/rel/sy-in-eq/link-sy-eq`, params)
+    return fn ? fn(res) : res
+  }
+  /**
+   * 设备清单 - 更新设备
+   * @param params
+   */
+  static async updateEquip(params) {
+    return await this.http.postRequest(object_pre + "/equip/update", params);
+  }
+  /**
+   * 设备清单 - 根据对象删除系统和设备的关系
+   * @param params
+   */
+  static async sysUnlinkEquip(params, fn) {
+    const res = await this.http.postRequest(
+      datacenter_pre + "/sy-in-eq/unlinks-sy-eq",
+      params
+    );
+    return fn ? fn(res) : res
+  }
+  static async zoneQuery() {}
+  static async TypePartsDie() {}
+  /**
+   * 下载报告-查询key值
+   * @param params
+   * @returns
+   */
+  static async queryDownloadsKey(params) {
+    return await this.http.postRequest(
+      graphhic_pre + "/downloads/point/key",
+      params
+    );
+  }
+  /**
+   * 下载模板-设备静态信息维护模板
+   * @param params
+   * @returns
+   */
+  static async equipTemplate(params) {
+    window.location.href =
+      (window as any).__systemConf.baseServiceUrl +
+      graphhic_pre +
+      "/downloads/equip/template";
+    // return await this.http.getRequest(
+    //   graphhic_pre + "/downloads/equip/template",
+    //   params
+    // );
+  }
+  /**
+   * 修改设备的附件功能
+   * @param params
+   * @returns
+   */
+  static async queryUpdate(params) {
+    return await this.http.postRequest(equipquery_pre + "/update", params);
+  }
+  static async equipLinkSys() {}
+  /**
+   * 查询建筑信息+count
+   */
+  static async buildingQueryAndCount(params) {
+    return await this.http.postRequest(
+      equipcomponent_pre + "/building/query",
+      params
+    );
+  }
+  /**
+   * 查询楼层信息+sign
+   */
+  static async floorQueryAndSign(params) {
+    return await this.http.postRequest(
+      equipcomponent_pre + "/floor/query",
+      params
+    );
+  }
+  /**
+   * 建筑楼层管理-删除楼层(该接口有删除失败的原因)
+   */
+  static async deleteFloorInfo(params) {
+    return await this.http.postRequest(floor_pre + "/single/delete", params);
+  }
+  /**
+   * 根据id删除建筑信息(该接口有删除失败的原因)
+   */
+  static async deleteBuildInfo(params) {
+    return await this.http.postRequest(
+      floor_pre + "/building/single/delete",
+      params
+    );
+  }
+  /**
+   * 创建建筑信息
+   */
+  static async objectCreateBuild(params) {
+    return await this.http.postRequest(object_pre + "/building/create", params);
+  }
+  /**
+   * 查询建筑信息
+   */
+  static async objectQueryBuild(params) {
+    return await this.http.postRequest(object_pre + "/building/query", params);
+  }
+  /**
+   * 查询建筑信息
+   */
+  static async objectUpdateBuild(params) {
+    return await this.http.postRequest(object_pre + "/building/update", params);
+  }
+  /**
+   * 建筑楼层管理-创建楼层关联关系
+   */
+  static async createRelationInFloor(params) {
+    return await this.http.postRequest(
+      datacenter_pre + "/rel/fl-through-fl/link-or",
+      params
+    );
+  }
 }
 
-}
+
 export default ScanController;

+ 1 - 1
src/controller/old-adm/dicController.ts

@@ -8,7 +8,7 @@ class Dic {
    * @return {*}
    */  
   static async getDataDictionary(params, fn) {
-    const res = await Dic.http.postRequest(`/datacenter/dict/query`, params)
+    const res = await Dic.http.postRequest(`/datacenter/dict/query`, params);
     return fn ? fn(res) : res
   }
 

+ 18 - 2
src/controller/old-adm/floorController.ts

@@ -1,4 +1,5 @@
 import { baseHttpUtils } from "@/utils/http/baseHttpUtils";
+import { object_pre } from "./preTypes";
 export interface QueryReq {
   orders: string;
   pageNumber: number;
@@ -6,14 +7,29 @@ export interface QueryReq {
 }
 class FloorController {
   static http = new baseHttpUtils();
-  static pre = "/datacenter/object";
   /**
    * 获取建筑楼层
    * @param {QueryReq} params
    * @returns
    */
   static async floorQuery(params: QueryReq) {
-    return this.http.postRequest(this.pre + "/floor/query", params);
+    return this.http.postRequest(object_pre + "/floor/query", params);
+  }
+  /**
+   * 建筑楼层管理-创建楼层
+   * @param params
+   * @returns
+   */
+  static async manageCreateFloor(params) {
+    return this.http.postRequest(object_pre + "/floor/create", params);
+  }
+  /**
+   * 建筑楼层管理-修改楼层
+   * @param params
+   * @returns
+   */
+  static async manageUpdateFloor(params) {
+    return this.http.postRequest(object_pre + "/floor/update", params);
   }
 }
 export default FloorController;

+ 2 - 0
src/controller/old-adm/preTypes.ts

@@ -8,3 +8,5 @@ export const equipquery_pre = `${equipcomponent_pre}/equip-query`;
 export const equipcomponentdic_pre = `${equipcomponent_pre}/dict`;
 
 export const graphhic_pre = `${datacenter_pre}/graphic`;
+
+export const floor_pre = `${object_pre}/floor`;

+ 7 - 1
src/router/system.js

@@ -11,7 +11,7 @@ import facilityLedger from "@/components/old-adm/ledger/facility/index";
 // 系统台账
 import systemLedger from '@/components/old-adm/ledger/system/index';
 import batchPointAssets from '@/components/old-adm/ledger/facility/batchPoint' //批量维护设备位置
-
+import buildFloor from '@/components/old-adm/ready/buildfloor/index'
 
 export default [
   {
@@ -34,6 +34,12 @@ export default [
         component: systemGraph,
       },
       {
+        path: '/ready/buildfloor',
+        name: 'buildFloor',
+        component: buildFloor,
+        meta: {keepAlive: false, breadcrumbs: [{label: '建筑楼层管理'}]}
+      },
+      {
         path: "/ledger/facility",
         name: "facilityLedger",
         component: facilityLedger,

+ 74 - 0
src/utils/old-adm/buildfloor/tools.js

@@ -0,0 +1,74 @@
+const tools = {}
+
+/**
+ * @param arr [a,b,c]
+ *
+ * val value
+ */
+function returnNewObj(data, arr, val) {
+  if (arr.length > 1) {
+    let k = arr.shift()
+    if (!data[k]) {
+      data[k] = {}
+    }
+    returnNewObj(data[k], arr, val)
+  } else {
+    let curk = arr[0]
+    data[curk] = val;
+  }
+}
+
+/**
+ * @param key a
+ * @param val {b:{c:''}}|''|1
+ * @return a.b.c
+ */
+function rKeyStrVal(key, val) {
+  let nk = key, arr = []
+  if (val instanceof Object && !(val instanceof Array)) {
+    // for(let k in )
+    return nk + '.' + rKeyStrVal()
+  }
+  return nk
+}
+
+/**
+ * @param data Object
+ * @returns 将对象中 key 为a.b.c 转换为a:{b:{c:''}}
+ */
+tools.formatData = (data) => {
+  let newData = JSON.parse(JSON.stringify(data))
+  for (let key in newData) {
+    if (key.indexOf('.') > -1) {
+      let arr = key.split('.')
+      returnNewObj(newData, arr, newData[key])
+      delete newData[key]
+    }
+  }
+  return newData
+}
+
+
+
+/**
+ * @param data {a:{b:{c:{}}}}
+ *
+ * @returns a.b.c
+ *
+ */
+tools.desFormatData = (data) => {
+  let newData = {}
+  for (let key in data) {
+    if (data[key] instanceof Object && !(data[key] instanceof Array)) {
+      for (let childK in data[key]) {
+        let nk = `${key}.${childK}`
+        newData[nk] = data[key][childK]
+      }
+    } else {
+      newData[key] = data[key]
+    }
+  }
+  return newData
+}
+
+export default tools