瀏覽代碼

Merge branch 'apiupdate' of http://39.106.8.246:3003/web/ibms into apiupdate

LXXXY 5 年之前
父節點
當前提交
1aeb126f90

+ 7 - 0
package.json

@@ -25,10 +25,17 @@
         "vue-router": "^3.0.1",
         "vuex": "^3.1.0",
         "cad-engine": "2.0.250",
+<<<<<<< HEAD
         "@saga-web/base": "2.1.9",
         "@saga-web/draw": "2.1.58",
         "@saga-web/graphy": "2.1.30",
         "@saga-web/cad-engine": "2.0.366"
+=======
+        "@saga-web/base": "2.1.8",
+        "@saga-web/draw": "2.1.56",
+        "@saga-web/graphy": "2.1.28",
+        "@saga-web/cad-engine": "2.0.275"
+>>>>>>> 2098857d48253e551fdc444edf39d3fa5a9fd69c
     },
     "devDependencies": {
         "ajv": "^6.9.1",

+ 36 - 0
src/api/scan/request.js

@@ -1474,6 +1474,7 @@ export function groupCreRelaZoneAndISp(param, success) {
     let url = `${baseUrl}/datacenter/si-in-sp-base/link-list?type=${param.type}`;
     http.postJson(url, param.data, success)
 }
+<<<<<<< HEAD
 //关系-----业务空间所属建筑楼层修改
 export function updateRelateInSpAndBuild(param, success) {
     let url = `${baseUrl}/datacenter/update-relationship/update-sp`;
@@ -1535,4 +1536,39 @@ export function getEquipByEqID(param, success) {
 export function getFloorMsgByFloorID(param, success) {
     let url = `${baseUrl}/datacenter/floor/query`
     http.postJson(url, param, success)
+=======
+//扫楼作业-扫楼日志查看
+export function queryUserLog(param, success) {
+    let url = `${baseUrl}/scanbuilding-2/user-log/query`;
+    http.postJson(url, param, success)
+}
+
+//扫楼作业-信息点整理-查询点位标签
+export function queryLocationPoint(param, success) {
+    let url = `${baseUrl}/datacenter/location-point/query`;
+    http.postJson(url, param, success)
+}
+
+//扫楼作业-信息点整理-更新点位标签
+export function updateLocationPoint(param, success) {
+    let url = `${baseUrl}/datacenter/location-point/update`;
+    http.postJson(url, param, success)
+}
+
+//扫楼作业-位置标签-删除图片
+export function deleteLocationImg(param, success) {
+    let url = `${baseUrl}/datacenter/location-point/delete-image`;
+    http.postJson(url, param, success)
+}
+
+//扫楼作业-信息点整理-资产族及个数
+export function queryPropertyTypeCount(param, success) {
+    let url = `${baseUrl}/equip-component/property/property-family`;
+    http.getJson(url, param, success)
+}
+//扫楼作业-信息点整理-位置标签及对应资产数量
+export function queryPropertyPoint(param, success) {
+    let url = `${baseUrl}/equip-component/point/point-property`;
+    http.getJson(url, param, success)
+>>>>>>> 2098857d48253e551fdc444edf39d3fa5a9fd69c
 }

+ 649 - 0
src/components/data_admin/buildData/recommend-2.vue

@@ -0,0 +1,649 @@
+<template>
+    <div class="saga-recommend">
+        <div v-if="hasData">
+            <h4>当前资产:{{fm.FmName}}</h4>
+            <div class="saga-change-name" v-if="!isChangeFor">
+                <h3 class="saga-gray saga-explain">您可能需要快捷改值操作</h3>
+                <!-- 智能推荐按钮 -->
+                <div v-if="isChangeId">
+                    <template v-if="changeList.length" v-for="item in changeList">
+                <saga-button @click="getList(item)">修正 "{{getName(key)}}" 为 {{item.value}}</saga-button>
+</template>
+<template v-if="!changeList.length">
+    <p>
+        {{changeMsg}}</p>
+</template>
+        </div>
+        <!-- 修正按钮 -->
+        <div v-else>
+          <saga-button @click="changeToNull">修正 "{{getName(key)}}" 为 {{noIdChangeVal}}</saga-button>
+        </div>
+      </div>
+      <div class="saga-change-name" v-if="!isSameForCreate">
+        <h3 class="saga-gray saga-explain">您可能需要快捷维护厂商库</h3>
+<template>
+    <saga-button v-if="!isChangeVender" @click="create">
+        增加 {{obj.name}} “ {{val ? val : fm.Infos[key]}} ”</saga-button>
+    <saga-button v-if="isChangeVender" @click="changeVender">更新厂商库中此{{obj.name}}对应值</saga-button>
+</template>
+        <!--<template v-else>
+    <p>
+        {{ !!message ? message : "请确定该信息点内有值"}}</p>
+</template>-->
+      </div>
+      <div class="saga-change-name" v-if="elseBtnsShow">
+        <h3 class="saga-gray saga-explain">您可能需要其他快捷操作</h3>
+        <!-- <saga-button @click="checkVenders">先维护 xxx 信息点</saga-button> -->
+        <saga-button @click="checkVenders" v-if="showBtn">批量维护 {{!!obj ? obj.name : ""}} 相关信息点</saga-button>
+        <saga-button v-if="!showBtn">先维护 {{objMsg}}</saga-button>
+        <!-- <saga-button @click="checkVenders"></saga-button> -->
+      </div>
+    </div>
+    <div v-else class="saga-message">
+      <p>{{!!dataMessage ? dataMessage : "请确定该信息点是支持推荐的信息点"}}</p>
+    </div>
+    <venders-change
+      :create="isCreate"
+      v-if="dialog.visible"
+      ref="venders"
+      :dialog="dialog"
+      :infosKey="infosKey"
+      :types="types"
+      :fmData="fm"
+      @change="loadFm"
+      :title="isCreate ? '添加' + obj.name : '修改' + obj.name"
+    ></venders-change>
+  </div>
+</template>
+<script>
+    import sagaButton from "./sagaButton"
+    import vendersChange from "./vendersChange"
+    import getVenderRecommend from "./findId"
+    import tools from "@/utils/scan/tools"
+    import getJson from "@/utils/buildData/vendersUtils"
+    import buildJson from "@/utils/buildData/buildJson"
+    import cutHeader from "@/utils/scan/cutHeader"
+    import { upDateTableMain, getBasicMatch } from "@/api/scan/request"
+    import {mapGetters, mapActions} from "vuex"
+    export default {
+        components: {
+            sagaButton,
+            vendersChange
+        },
+        data() {
+            return {
+                hasData: false,
+                fm: {},
+                infosKey: null,
+                dialog: {
+                    visible: false
+                },
+                createList: [],
+                changeList: [],
+                types: {},
+                headers: [],
+                message: "",
+                obj: {},
+                key: "",
+                isCreate: false,
+                showBtn: false,
+                createShow: false,
+                changeMsg: "", //修改的提示
+                dataMessage: "⬅请点击资产信息点",
+                falg: false, //上级页面传入的数值,用于实时请求
+                val: null, //上级传入的val
+                isSameForCreate: false,
+                isChangeFor: false,
+                isChangeVender: false,
+                isChangeId: true, //是否为修改id
+                noIdChangeVal: "",
+                elseBtnsShow: true, //是否显示修改按钮
+                msgTable: true,
+                content: {}, //厂商库信息点
+                objMsg: "相关信息点"
+            }
+        },
+        created() {},
+        mounted() {},
+        computed: {
+            ...mapGetters("layout", [
+                "projectId",
+                "secret",
+                "userId"
+            ])
+        },
+        methods: {
+            //主页面重新加载
+            loadFm() {
+                this.$emit("loadData")
+            },
+            //根据id获得信息点名称
+            getName(code) {
+                if (!!code) {
+                    let name = ""
+                    this.headers.map(item => {
+                        if (item.InfoPointCode == code) {
+                            name = item.InfoPointName
+                        }
+                    })
+                    return name
+                } else {
+                    return ""
+                }
+            },
+            //修改
+            checkVenders() {
+                this.isCreate = false
+                this.dialog.visible = true
+                this.$nextTick(_ => {
+                    this.$refs.venders.getData()
+                })
+            },
+            //获取表头
+            changeObj() {
+                buildJson.map(item => {
+                    if (item.name == "型号") {
+                        item.options = []
+                        item.infosArr = []
+                        this.headers.map(child => {
+                            if (child.FirstTag == "技术参数" ||
+                                child.InfoPointCode == "Specification" ||
+                                child.InfoPointCode == "MaintainPeriod" ||
+                                child.InfoPointCode == "ServiceLife") {
+                                item.infosArr.push(child.InfoPointCode)
+                                let option = {
+                                    key: "contact.infos." + child.InfoPointCode,
+                                    label: child.InfoPointName,
+                                    optLabel: child.InfoPointCode,
+                                    type: child.DataType,
+                                    dataSource: child.DataSource,
+                                    FirstTag: child.FirstTag,
+                                    SecondTag: child.SecondTag
+                                }
+                                if (child.InfoPointCode == "Specification") {
+                                    option.key = "content.specificationName"
+                                }
+                                item.options.push(option)
+                            }
+                        })
+                        item.options = cutHeader(item.options)
+                    }
+                })
+            },
+            changeToNull() {
+                //   let param = {
+                //     FmId: this.fm.FmId,
+                //     Infos: {
+                //       [this.key]: null
+                //     }
+                //   }
+                //   this.updateMain(param)
+                console.log(this.noIdChangeVal, "this.noIdChangeVal")
+                this.fm.Infos[this.key] = this.noIdChangeVal
+            },
+            //上级页面传输的数据
+            randerData(idData, infosKey, headers, falg = false, val = null) {
+                this.isChangeVender = false
+                console.log(idData, infosKey, headers, falg, "falg")
+                this.falg = falg
+                this.val = val
+                this.fm = tools.deepCopyObj(idData)
+                this.headers = headers
+                this.changeObj()
+                this.infosKey = infosKey
+                this.message = ""
+                let tempArr = infosKey.split('.')
+                this.key = tempArr[tempArr.length-1]
+                this.obj = getJson(tempArr[tempArr.length-1])
+                console.log("数据请求", this.obj)
+                if (!!this.obj) {
+                    console.log("有data")
+                    this.hasData = true
+                    this.getDataForm()
+                } else {
+                    this.hasData = false
+                }
+            },
+            changeVender() {
+                // 修改厂商库中对应的值
+                console.log("修改厂商库中的值", this.obj, this.key)
+                let webArr = ["SupplierWeb", "InsurerWeb", "MaintainerWeb"],
+                    //三大厂商的key
+                    keysArr = ["DPInsurerID", "DPSupplierID", "DPMaintainerID"]
+                //如果是三大厂商的网址
+                if (webArr.indexOf(this.key) > -1) {
+                    let param = {
+                        venderId: this.fm.Infos[this.obj.infosKey],
+                        website: this.fm.Infos[this.key]
+                    }
+                    this.obj.updateVender(param, res => {
+                        this.updateKey(this.key, this.fm)
+                    })
+                    return false
+                } else if (keysArr.indexOf(this.obj.infosKey) > -1) {
+                    let param = {
+                        venderId: this.fm.Infos[this.obj.infosKey],
+                        projectId: this.projectId
+                    }
+                    //如果存在content的联系人
+                    console.log(this.content, "content")
+                    if (this.content.hasOwnProperty("contact")) {
+                        let contents = this.content.contact
+                        for (let k in contents) {
+                            param[k] = contents[k]
+                        }
+                    }
+                    param[[this.getKey(this.obj.options, this.key)]] = this.fm.Infos[this.key]
+                    this.obj.update(param, res => {
+                        this.updateKey(this.key, this.fm)
+                    })
+                    return false
+                } else {
+                    let param = {
+                        specificationId: this.fm.Infos.DPSpecificationID,
+                        infos: {
+                            [this.key]: this.fm.Infos[this.key]
+                        }
+                    }
+                    this.obj.updateVender(param, res => {
+                        this.updateKey(this.key, this.fm)
+                    })
+                    return false
+                }
+            },
+            updateKey(key, obj) {
+                let param = {
+                    FmId: obj.FmId,
+                    Infos: {
+                        [key]: null
+                    }
+                }
+                this.updateMain(param)
+            },
+            /**
+             * @param arr 传入的数组
+             * @param key 传入的key
+             * 
+             * @return key 对应的key
+             */
+            getKey(arr, key) {
+                let returnKey = ""
+                arr.map(item => {
+                    if (item.optLabel == key) {
+                        returnKey = item.key.split(".")[1]
+                        console.log(returnKey, item, "item")
+                    }
+                })
+                return returnKey
+            },
+            //有obj的信息时
+            getDataForm() {
+                let idArr = ["DPManufacturerID", "DPSupplierID", "DPInsurerID", "DPMaintainerID", "DPSpecificationID", "DPBrandID", "DPSpecificationID"]
+                //点击以下按钮触发按钮事件
+                let vendersArr = ["Manufacturer", "Supplier", "Maintainer", "Insurer", "Brand", "Specification"]
+                if (!!this.fm[this.obj.infosKey]) {
+                    this.falgChange(true)
+                } else {
+                    this.falgChange(false)
+                }
+            },
+            //falg为是否存在id
+            falgChange(falg) {
+                let vendersArr = ["Manufacturer", "Supplier", "Maintainer", "Insurer", "Brand", "Specification"]
+                if (this.val || !!this.fm[this.key]) {
+                    //存在id且单元格存在值
+                    if (falg) {
+                        if (this.falg && vendersArr.indexOf(this.key) > -1) {
+                            this.noIdDo()
+                        } else {
+                            this.getVendersList()
+                        }
+                    } else {
+                        // 没有id
+                        this.noIdDo()
+                    }
+                } else {
+                    //不存在值
+                    // this.isChangeFor = false
+                    // this.isSameForCreate = true
+                    // this.changeList = []
+                    this.noIdDo()
+                    // this.changeMsg = "请确定该单元格内存在值"
+                }
+            },
+            //没有id执行
+            noIdDo() {
+                console.log("没有id")
+                let param = {
+                        infoCode: this.key,
+                        infoValue: this.val || this.fm[this.key]
+                    },
+                    falg = true
+                this.createShow = true
+                this.showBtn = false
+                this.elseBtnsShow = true
+                if (this.key == "Brand") {
+                    param.manufacturerID = this.fm.DPManufacturerID
+                }
+                if (this.key == "Specification") {
+                    param.manufacturerID = this.fm.DPManufacturerID
+                    param.brandID = this.fm.DPBrandID
+                    param.eqFamily = this.fm.Family
+                }
+                for (let k in param) {
+                    if (!param[k]) {
+                        falg = false
+                    }
+                }
+                console.log(falg, "falg")
+                //如果传参中某个值为空不发生请求
+                if (!falg) {
+                    this.noShowTop12()
+                    return false
+                } else {
+                    this.elseBtnsShow = false
+                }
+                console.log(this.obj.infosArr[0], this.infosKey, "this.infosKey")
+                if (this.obj.infosArr[0] != this.key) {
+                    console.log("其他信息点")
+                    this.noShowTop12()
+                    return false
+                }
+                getVenderRecommend(param, res => {
+                    this.changeList = res.content || []
+                    this.isChangeId = true
+                    this.isSameForCreate = false
+                    this.isChangeFor = false
+                    console.log(this.changeList, "changeList")
+                    if (!!this.changeList && this.changeList.length == 1) {
+                        if (this.changeList[0].value == this.fm[this.key] &&
+                            this.changeList[0].id == this.fm["DP" + this.key + "ID"]) {
+                            this.isSameForCreate = true
+                            this.isChangeFor = true
+                            if (!!this.val && this.val != this.fm[this.key]) {
+                                this.isChangeFor = false
+                                this.isSameForCreate = false
+                            }
+                        }
+                    }
+                    if (res.content[0] && res.content[0].similarity == 100) {
+                        this.changeList = []
+                        this.isSameForCreate = true
+                        this.isChangeFor = false
+                    }
+                    if (this.changeList.length <= 0) {
+                        //   this.changeMsg = "不存在符合条件的推荐"
+                    }
+                })
+            },
+            //第一栏第二栏不显示
+            noShowTop12() {
+                if (!this.val && !this.fm[this.key]) {
+                    this.elseBtnsShow = false
+                }
+                console.log(this.obj.infosKey, this.fm)
+                //型号
+                if (this.obj.infosKey == "DPSpecificationID") {
+                    if (!this.fm.DPManufacturerID) {
+                        this.elseBtnsShow = true
+                        this.objMsg = "生产厂家"
+                    } else if (!this.fm.DPBrandID) {
+                        this.elseBtnsShow = true
+                        this.objMsg = "品牌"
+                    } else if (!this.fm.DPSpecificationID) {
+                        console.log("设备型号")
+                        this.elseBtnsShow = true
+                        this.objMsg = "设备型号"
+                    }
+                }
+                //品牌
+                if (this.obj.infosKey == "DPBrandID") {
+                    if (!this.fm.DPManufacturerID) {
+                        this.objMsg = "生产厂家"
+                    }
+                }
+                //生产厂家
+                if (this.obj.infosKey == "DPManufacturerID") {
+                    this.elseBtnsShow = false
+                }
+                //供应商
+                if (this.obj.infosKey == "DPSupplierID") {
+                    if (!this.fm.DPSupplierID) {
+                        console.log("没有供应商id")
+                        this.elseBtnsShow = false
+                        if (this.key != "Supplier") {
+                            this.elseBtnsShow = true
+                        }
+                        this.objMsg = "供应商单位名称"
+                    }
+                }
+                //维修商
+                if (this.obj.infosKey == "DPMaintainerID") {
+                    if (!this.fm.DPMaintainerID) {
+                        console.log("没有维修商id")
+                        this.elseBtnsShow = false
+                        if (this.key != "Maintainer") {
+                            this.elseBtnsShow = true
+                        }
+                        this.objMsg = "维修商单位名称"
+                    }
+                }
+                //保险公司
+                if (this.obj.infosKey == "DPInsurerID") {
+                    if (!this.fm.DPInsurerID) {
+                        console.log("没有保险id")
+                        this.elseBtnsShow = false
+                        if (this.key != "Insurer") {
+                            this.elseBtnsShow = true
+                        }
+                        this.objMsg = "保险公司名称"
+                    }
+                }
+                this.isSameForCreate = true
+                this.isChangeFor = true
+            },
+            //当前单元格内存在id且单元格存在值
+            getVendersList() {
+                //四大厂商名称
+                this.isChangeId = true
+                let venderIdArr = ["DPManufacturerID", "DPSupplierID", "DPInsurerID", "DPMaintainerID", "DPBrandID"],
+                    vendersArr = ["Manufacturer", "Supplier", "Maintainer", "Insurer", "Brand"],
+                    infosKey = this.obj.infosKey
+                this.showBtn = true
+                this.elseBtnsShow = true
+                //获取label
+                let ownLabel = ""
+                this.obj.options.map(item => {
+                    if (item.optLabel == this.key) {
+                        ownLabel = item.key
+                    }
+                })
+                if (venderIdArr.indexOf(infosKey) > -1) {
+                    let param = {
+                        venderId: this.fm[infosKey],
+                        projectId: this.projectId
+                    }
+                    if (infosKey == "DPBrandID") {
+                        param = {
+                            brandId: this.fm[infosKey]
+                        }
+                    }
+                    this.obj.getList(param, res => {
+                        console.log(this.key, this.obj.options, res, ownLabel, "ownLabel")
+                        let optArr = ownLabel.split("."),
+                            optContent = ""
+                        if (this.obj.infosKey == "DPBrandID") {
+                            optContent = res[optArr[0]][optArr[1]]
+                        } else {
+                            optContent = res.content[optArr[0]][optArr[1]]
+                        }
+                        if (optContent == (this.val || this.fm[this.key])) {
+                            //厂商库中的值与现有的值相等
+                            this.isChangeFor = true
+                            this.isSameForCreate = true
+                            let keysBtns = ["DPBrandID", "DPManufacturerID"]
+                            if (keysBtns.indexOf(this.obj.infosKey) > -1) {
+                                this.elseBtnsShow = false
+                            }
+                        } else {
+                            if (!optContent) {
+                                //如果厂商库中没有值
+                                console.log("没有该信息点")
+                                this.isChangeFor = true
+                                this.isChangeVender = true
+                                this.isSameForCreate = false
+                            } else {
+                                //有值
+                                console.log("有值,且值不同")
+                                this.isChangeId = false
+                                this.hasData = true
+                                this.content = res.content
+                                //修改的值(其实做置空操作)
+                                this.noIdChangeVal = optContent
+                                this.isChangeFor = false
+                                this.isSameForCreate = false
+                                this.isChangeVender = true
+                            }
+                        }
+                    })
+                }
+                if (infosKey == "DPSpecificationID") {
+                    let paramData = {
+                        specificationId: this.fm[infosKey]
+                    }
+                    this.obj.getList(paramData, res => {
+                        let optContent = res.content.infos[this.key]
+                        console.log(optContent, this.val, this.fm[this.key], "optContent")
+                        if (optContent == (this.val || this.fm[this.key])) {
+                            console.log("有值,且值相同")
+                            this.isChangeFor = true
+                            this.isSameForCreate = true
+                            if (this.key == "Specification") {
+                                this.elseBtnsShow = false
+                            } else {
+                                this.elseBtnsShow = true
+                            }
+                        } else {
+                            if (!optContent) {
+                                //如果厂商库中没有值
+                                console.log("没有该信息点")
+                                this.isChangeFor = true
+                                this.isChangeVender = true
+                                this.isSameForCreate = false
+                            } else {
+                                //有值
+                                console.log("有值,且值不同")
+                                this.isChangeId = false
+                                this.hasData = true
+                                //修改的值(其实做置空操作)
+                                this.noIdChangeVal = optContent
+                                this.isChangeFor = false
+                                this.isSameForCreate = false
+                                this.isChangeVender = true
+                            }
+                        }
+                    })
+                }
+                if (vendersArr.indexOf(this.key) > -1) {
+                    this.showBtn = true
+                }
+            },
+            //创建函数
+            create(item) {
+                // console.log(this.obj.infosKey)
+                // let param;
+                // if(this.obj.infosKey == "DPBrandID" || this.obj.infosKey == "DPManufacturerID"){
+                //     if(this.obj.infosKey == "DPBrandID"){
+                //         param = {
+                //             "venderId": this.fm.Infos.DPManufacturerID,     //String,必填,生产商id
+                //             "name": this.fm.Infos.Brand,              //String,必填,品牌名称   
+                //         }
+                //     }else{
+                //         param = {
+                //             "name": this.fm.Infos.Manufacturer,          
+                //         }
+                //     }
+                //     this.obj.createFunc(param,res=>{
+                //     })
+                // }
+                this.isCreate = true
+                this.dialog.visible = true
+                this.$nextTick(_ => {
+                    this.$refs.venders.getCreateData()
+                })
+            },
+            updateMain(param) {
+                upDateTableMain({
+                    ProjId: this.projectId,
+                    UserId: this.userId
+                }, [param]).then(res => {
+                    if (res.data.Result == "success") {
+                        this.loadFm()
+                    } else {
+                        this.$message.error("保存出错")
+                    }
+                })
+            },
+            //点击按钮,对表格操作
+            getList(data) {
+                //   this.fm.Infos[this.key] = data.value
+                let infos = tools.deepCopyObj(this.fm)
+                infos[this.key] = data.value
+                let param = {
+                    "projectId": this.projectId,
+                    "criterias": [{
+                        id: this.fm.FmId,
+                        family: this.fm.Family,
+                        infos: infos
+                    }]
+                }
+                console.log(param, "paramparam")
+                this.getIdForVender(param)
+            },
+            //判断文案是否相同
+            getIdForVender(param) {
+                getBasicMatch(param).then(res => {
+                    if (res.data.result == "success") {
+                        let myParam = res.data.content.map(item => {
+                            return {
+                                Family: item.family,
+                                FmId: item.id,
+                                Infos: item.infos
+                            }
+                        })
+                        this.updateMain(myParam[0])
+                    } else {
+                        this.$message.error("请求错误" + res.data.resultMsg)
+                    }
+                }).catch(error => {
+                    this.$message.error(error)
+                })
+            },
+        }
+    }
+</script>
+<style lang="less" scoped>
+    .saga-recommend {
+        height: 100%;
+        overflow-y: auto; //   background-color: red;
+        .saga-gray {
+            color: #b7c3c8;
+        }
+        .saga-change-name {
+            padding: 8px;
+            min-height: 100px; // background-color: yellow;
+            border-bottom: 1px solid #ccc;
+            .saga-explain {
+                font-size: 17px;
+                font-weight: 600;
+            }
+        }
+    }
+    .saga-message {
+        height: 100vh;
+        line-height: 100vh;
+        font-size: 20px;
+        color: #b7c3c8;
+        background:#fff;
+    }
+</style>

+ 24 - 48
src/views/data_admin/buildAssets/Station.vue

@@ -13,9 +13,9 @@
 
 <script>
 import {
-    createPost, //新建岗位
-    upDateTableMain, //关联资产
-    createComponent //新建岗位(部件)
+    createEquip, //数据中心创建设备
+    createPart, //数据中心创建部件
+    updateProperty, //数据中心更新资产
 } from '@/api/scan/request'
 import { mapGetters } from 'vuex'
 export default {
@@ -43,35 +43,22 @@ export default {
         },
         save() {
             if (this.value) {
-                let param = {
-                    BuildId: this.itemObj.BuildId,
-                    category: this.value,
-                    secret: this.secret,
-                    perjectId: this.projectId,
-                    BIMID: this.itemObj.FloorId,
-                    BIMLocation: (this.itemObj.X || 0) + ',' + (this.itemObj.Y || 0) + ',' + (this.itemObj.Z || 0)
+                let pa = {
+                    Content:[{
+                        BuildingId: this.itemObj.BuildingId,
+                        Category: this.value,
+                        BIMID: this.itemObj.BIMID || '',
+                        BIMLocation: this.itemObj.BIMLocation || '',
+                        FloorId: this.itemObj.FloorId || ''
+                    }]
                 }
-                if (param.category.length == 6) {
-                    createComponent(param).then(res => {
-                        if (res.data.Result == 'success') {
-                            this.upDateTableMain(res.data.id)
-                        } else {
-                            this.$message({
-                                message: res.data.ResultMsg,
-                                type: 'warning'
-                            })
-                        }
+                if (pa.Content[0].Category.length == 6) {
+                    createPart(pa, res => {
+                        this.upDateTableMain(res.EntityList[0].EquipID)
                     })
                 } else {
-                    createPost(param).then(res => {
-                        if (res.data.Result == 'success') {
-                            this.upDateTableMain(res.data.id)
-                        } else {
-                            this.$message({
-                                message: res.data.ResultMsg,
-                                type: 'warning'
-                            })
-                        }
+                    createEquip(pa, res => {
+                        this.upDateTableMain(res.EntityList[0].EquipID)
                     })
                 }
             } else {
@@ -83,25 +70,14 @@ export default {
         },
         //关联资产
         upDateTableMain(id) {
-            let param = {
-                    ProjId: this.projectId,
-                    UserId: this.userId
-                },
-                paramList = {}
-            paramList.EquipmentId = id
-            paramList.FmId = this.itemObj.FmId
-            paramList.Family = this.itemObj.Family
-            upDateTableMain(param, [paramList]).then(res => {
-                if (res.data.Result == 'success') {
-                    this.$message({
-                        message: '保存成功',
-                        type: 'success'
-                    })
-                    this.dialogVisible = false
-                    this.$emit('refresh')
-                } else {
-                    this.$message.error('请求失败')
-                }
+            let pa = {
+                Content:[this.itemObj]
+            };
+            let that = this
+            pa.Content[0].EquipmentId = id
+            updateProperty(pa, res => {
+                that.dialogVisible = false;
+                that.$emit('refresh')
             })
         }
     },

+ 268 - 0
src/views/data_admin/buildAssets/assetsList.vue

@@ -0,0 +1,268 @@
+<template>
+  <div class='page-table-template' style='display: flex;flex-direction: column;flex-grow: 1;flex-shrink: 1;'>
+    <div class="btn-box">
+      <el-button type='danger' @click='groupDel' :disabled="!selection.length">批量删除</el-button>
+    </div>
+    <div class="has-button-table">
+      <el-table :data='tableData' style='width: 100%' border v-loading='loading' height="100%" ref="assetTable"
+        :header-cell-style="{background:'#e1e4e5',color:'#2b2b2b'}" @selection-change='handleSelectionChange'>
+        <el-table-column type='selection' width='55' align='center'></el-table-column>
+        <el-table-column header-align='center' align='center' label='建筑' width='150'>
+          <template slot-scope='scope'>
+            {{getbuildName(scope.row.BuildingId)}}
+          </template>
+        </el-table-column>、
+        <el-table-column header-align='center' align='center' label='楼层' width='80'>
+          <template slot-scope='scope'>
+            {{getfloorName(scope.row.FloorId)}}
+          </template>
+        </el-table-column>
+        <el-table-column header-align='center' align='center' prop='Family' label='设备族'>
+          <template slot-scope='scope'>
+            {{getFamilyName(scope.row.Family)}}
+          </template>
+        </el-table-column>
+        <el-table-column header-align='center' align='center' prop='point' label='点位标签名称' v-if="active!='fourth'" show-overflow-tooltip>
+        </el-table-column>
+        <el-table-column header-align='center' align='center' prop='EquipID' label='本地编码' width='250' show-overflow-tooltip></el-table-column>
+        <el-table-column header-align='center' align='center' prop='EquipName' label='本地名称' show-overflow-tooltip>
+          <template slot-scope='scope'>
+            {{scope.row.EquipLocalName||scope.row.EquipName}}
+          </template>
+        </el-table-column>
+        <div v-if="active=='fourth'">
+          <el-table-column header-align='center' align='center' prop='SpaceId' label='所在元空间'></el-table-column>
+          <el-table-column header-align='center' align='center' prop='eq' label='设备类'></el-table-column>
+          <el-table-column header-align='center' align='center' prop='BIMLocation' label='BIM模型中坐标'></el-table-column>
+          <el-table-column header-align='center' align='center' prop='EquipmentId' label='对应的岗位' width='120'>
+            <template slot-scope='scope'>
+              <el-button v-if="scope.row.EquipmentId" type='primary' plain size='mini' @click='detail(scope.row)'>查看岗位详情</el-button>
+            </template>
+          </el-table-column>
+        </div>
+        <el-table-column header-align='center' align='center' prop='EquipID' label='操作' width='250'>
+          <template slot-scope='scope'>
+            <el-button type='primary' plain size='mini' @click='detail(scope.row)'>查看</el-button>
+            <el-button type='primary' plain size='mini' @click='add(scope.row)' v-if="active=='third'">添加岗位</el-button>
+            <el-button type='danger' plain size='mini' @click='dele(scope.row)'>删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+    <el-pagination class="right" 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>
+    <saga-station ref='station' :options='options' :itemObj='itemObj' @refresh='refresh'></saga-station>
+  </div>
+</template>
+
+<script>
+import { mapGetters } from 'vuex'
+import SagaStation from './Station'
+//api
+import {
+  floorQuery, //查询楼层信息
+  queryProperty, //查询资产
+  deleteProperty, //删除资产
+  getEquipBelongs, //获取设备族
+} from '@/api/scan/request'
+export default {
+  name: 'assetslist',
+  data() {
+    return {
+      loading: false,
+      tableData: [],
+      iframeSrc: '',
+      allChecked: [],
+      page: {
+        pageSize: 50,
+        pageSizes: [10, 20, 50, 100],
+        pageNumber: 1,
+        total: 0
+      },
+      building: {},//建筑id->名称
+      floorsObj: {},//楼层id->名称
+      allFamilyObj: {},
+      allEquipObj: {},
+      filter: {
+        first: 'CodeType=-4',
+        second: 'BIMID isNull',
+        third: 'EquipmentId isNull',
+        fourth: 'CodeType=1',
+      },
+      selection: [],
+      options: [],
+      itemObj: {}
+    }
+  },
+  props: {
+    buildingId: {
+      default: ''
+    },
+    active: {
+      default: 'first'
+    },
+    buildingData: {
+      default: {}
+    }
+  },
+  components: {
+    SagaStation
+  },
+  methods: {
+    //获取所有楼层
+    getFloors() {
+      floorQuery({}, res => {
+        res.Content.map(item => {
+          this.floorsObj[item.FloorID] = item.FloorLocalName
+        })
+      })
+    },
+    //获取设备族
+    getDeviceType() {
+      let param = {
+        data: {
+          Orders: "EquipName asc",
+          PageNumber: 1,
+          PageSize: 500
+        }
+      }
+      getEquipBelongs(param, res => {
+        let obj = {}
+        res.Content.map(t => {
+          this.allFamilyObj[t.Family] = t.FamilyName;
+          if (!obj[t.Family]) {
+            obj[t.Family] = []
+          }
+          obj[t.Family].push({ code: t.EquipCode, name: t.EquipName })
+        })
+        this.alloptions = obj
+      })
+    },
+    //获取列表
+    getTableData() {
+      if (this.buildingId) {
+        this.loading = true
+        this.tableData = []
+        let param = {
+          Filters: `BuildingId='${this.buildingId}';${this.filter[this.active]}`,
+          Orders: "CreateTime desc,EquipID desc",
+          PageNumber: this.page.pageNumber,
+          PageSize: this.page.pageSize
+        }
+        queryProperty(param, res => {
+          this.tableData = res.Content
+          this.page.total = res.Total
+          this.loading = false
+        })
+      }
+    },
+    //页码
+    handleCurrentChange(val) {
+      this.page.pageNumber = val;
+      this.getTableData()
+    },
+    //分页大小
+    handleSizeChange(val) {
+      this.page.pageSize = val;
+      this.page.pageNumber = 1;
+      this.getTableData()
+    },
+    //查看
+    detail(row) {
+      this.$message('开发中...')
+    },
+    //单个删除资产
+    dele(row) {
+      let param = [{ EquipID: row.EquipID }]
+      this.delProperty(param)
+    },
+    //批量删除
+    groupDel() {
+      let param = this.selection.map(t => {
+        return { EquipID: t.EquipID }
+      })
+      this.delProperty(param)
+    },
+    //删除接口
+    delProperty(param) {
+      deleteProperty(param, res => {
+        this.selection = []
+        this.$message.success('删除成功')
+        this.getTableData()
+      })
+    },
+    //选择项改变时
+    handleSelectionChange(selection) {
+      this.selection = selection;
+    },
+    //根据建筑id获取建筑名称
+    getbuildName(buildId) {
+      if (JSON.stringify(this.building)) {
+        this.buildingData.map(t => {
+          this.building[t.BuildID] = t.BuildLocalName
+        })
+      }
+      return this.building[buildId]
+    },
+    //根据楼层id获取楼层名称
+    getfloorName(floorId) {
+      return this.floorsObj[floorId]
+    },
+    //根据族三位编码对应族名称
+    getFamilyName(family) {
+      return this.allFamilyObj[family]
+    },
+    //刷新
+    refresh() {
+      this.page.pageNumber = 1;
+      this.getTableData()
+     },
+    //添加岗位
+    add(row) {
+      this.options = this.alloptions[row.Family]
+      this.itemObj = row
+      this.$refs.station.show()
+    }
+  },
+  watch: {
+    buildingId() {
+      this.$refs.assetTable.doLayout()
+      this.getTableData()
+      this.selection = []
+    },
+    active(n, o) {
+      this.$refs.assetTable.doLayout()
+      this.getTableData()
+      this.selection = []
+    }
+  },
+  created() {
+    this.getFloors()
+    this.getDeviceType()
+  }
+}
+</script>
+
+<style scoped lang='less'>
+.page-table-template {
+  background-color: #fff;
+  padding: 10px;
+  .no-button-table {
+    height: calc(100% - 48px);
+  }
+  .has-button-table {
+    height: calc(100% - 94px);
+  }
+  .btn-box {
+    padding: 10px;
+    padding-top: 0;
+    display: flex;
+    justify-content: flex-end;
+  }
+  .right {
+    padding: 10px;
+  }
+}
+</style>

+ 54 - 125
src/views/data_admin/buildAssets/index.vue

@@ -1,138 +1,67 @@
 <template>
-    <div class='box'>
-        <div class='condition'>
-            <p>
-                <span style="margin-right: 12px">建筑名称</span>
-                <el-select v-model='buildVlaue' placeholder='请选择'>
-                    <el-option
-                        v-for='item in options'
-                        :key='item.BuildId'
-                        :label='item.BuildLocalName'
-                        :value='item.BuildId'
-                    ></el-option>
-                </el-select>
-            </p>
-        </div>
-        <el-tabs v-model='activeName' @tab-click='handleClick' style="background:#fff">
-            <el-tab-pane label='现场无法找到的资产' name='first'>
-                <saga-nofind :buildVlaue='buildVlaue' :floorsObj='floorsObj'></saga-nofind>
-            </el-tab-pane>
-            <el-tab-pane label='未画入模型的资产' name='second'>
-                <saga-nopaint :buildVlaue='buildVlaue' :floorsObj='floorsObj'></saga-nopaint>
-            </el-tab-pane>
-            <el-tab-pane label='无对应岗位的资产' name='third'>
-                <saga-nomap :buildVlaue='buildVlaue' :floorsObj='floorsObj' :allFamilyObj='allFamilyObj'></saga-nomap>
-            </el-tab-pane>
-            <el-tab-pane label='未扫楼验证的资产' name='fourth'>
-                <saga-verify :buildVlaue='buildVlaue' :floorsObj='floorsObj' :allEquipObj='allEquipObj'></saga-verify>
-            </el-tab-pane>
-        </el-tabs>
+  <div class='box'>
+    <div class='condition'>
+      <p>
+        <span style="margin-right: 12px">建筑名称</span>
+        <el-select v-model='buildValue' placeholder='请选择'>
+          <el-option v-for='item in options' :key='item.BuildID' :label='item.BuildLocalName' :value='item.BuildID'></el-option>
+        </el-select>
+      </p>
     </div>
+    <el-tabs v-model='activeName' @tab-click='tabChange' style="background:#fff">
+      <el-tab-pane v-for="item in tabList" :label='item.label' :name='item.name' :key="item.label"></el-tab-pane>
+    </el-tabs>
+    <assets-list :buildingData="options" :buildingId="buildValue" :active="activeName" ref="assetlist"></assets-list>
+  </div>
 </template>
 
 <script>
-import SagaNofind from './Nofind'
-import SagaNopaint from './Nopaint'
-import SagaNomap from './Nomap'
-import SagaVerify from './Noverify'
+import assetsList from './assetsList'
 import { mapGetters } from 'vuex'
 //api
-import {
-    getBuildSelect, //根据项目ID获得建筑列表
-    getAllbusiness,
-    getAllFamily
-} from '@/api/scan/request'
+import { buildingQuery } from '@/api/scan/request'
 export default {
-    name: 'build-assets',
-    data() {
-        return {
-            activeName: 'first',
-            buildVlaue: '',
-            options: [],
-            floorsObj: {},
-            allFamilyObj: {}, 
-            allEquipObj: {}
-        }
-    },
-    computed: {
-        ...mapGetters('layout', ['projectId', 'userId', 'secret'])
-    },
-    components: {
-        SagaNofind,
-        SagaNopaint,
-        SagaNomap,
-        SagaVerify
-    },
-    methods: {
-        handleClick() {},
-        //获取建筑列表
-        getBuilding() {
-            let param = {
-                ProjId: this.projectId,
-                UserId: this.userId
-            }
-            getBuildSelect(param).then(res => {
-                if (res.data.Result == 'success') {
-                    let data = res.data.BuildList
-                    this.options = data
-                    this.buildVlaue = data.length ? data[0].BuildId : ''
-                }
-            })
-        },
-        //获取所有楼层
-        getFloors() {
-            let param = {
-                ProjId: this.projectId,
-                secret: this.secret,
-                id: this.projectId,
-                type: ['Fl']
-            }
-            getAllbusiness(param).then(res => {
-                if (res.data.Result == 'success') {
-                    res.data.Content.forEach(item => {                        
-                        this.floorsObj[item.infos.FloorID] = item.infos.FloorLocalName
-                    })
-
-                }
-            })
-        },
-        //获取设备组
-        getAllFamily() {
-            getAllFamily().then(result => {
-                    if (result.data.Result == "success") {
-                        console.log(result.data.Content)
-                        let list = result.data.Content;
-                        list.forEach(ele => {
-                            this.allFamilyObj[ele.code] = ele
-                        })  
-                        this.allEquipObj = {}
-                        this.getEquip(list)              
-                    }
-                });
-        },
-        getEquip(list) {
-            list.forEach(ele => {
-                if(ele.content) {
-                    ele.content.forEach(keng => {
-                        this.allEquipObj[keng.code] = keng.name
-                    })
-                }
-            })
-        },
-        async init() {
-            await this.getAllFamily();
-            await this.getFloors();
-            await this.getBuilding()
-        }
-    },
-    created() {
-        this.init()
+  name: 'build-assets',
+  data() {
+    return {
+      activeName: 'first',
+      buildValue: '',
+      options: [],
+      floorsObj: {},
+      allFamilyObj: {},
+      allEquipObj: {},
+      tabList: [
+        { label: '现场无法找到的资产', name: "first" },
+        { label: '未画入模型的资产', name: "second" },
+        { label: '无对应岗位的资产', name: "third" },
+        { label: '未扫楼验证的资产', name: "fourth" }
+      ],
+    }
+  },
+  computed: {
+    ...mapGetters('layout', ['projectId', 'userId', 'secret'])
+  },
+  components: {
+    assetsList
+  },
+  methods: {
+    //获取建筑列表
+    getBuilding() {
+      buildingQuery({}, res => {
+        this.options = res.Content
+        this.buildValue = res.Content ? res.Content[0].BuildID : ''
+      })
     },
-    watch: {
-        projectId(){
-            this.init()
-        }
+    tabChange(tab) { }
+  },
+  created() {
+    this.getBuilding()
+  },
+  watch: {
+    projectId() {
+      this.getBuilding()
     }
+  }
 }
 </script>
 

File diff suppressed because it is too large
+ 1679 - 0
src/views/data_admin/buildData/index-2.vue


+ 55 - 130
src/views/data_admin/buildData/index.vue

@@ -7,12 +7,12 @@
             <!-- 建筑选择 -->
             <span style="padding-right:12px;color:#999;vertical-align: middle;">建筑名称</span>
             <el-select v-model="buildId" style="margin-right:10px;" placeholder="请选择" @change="changeBuild">
-                <el-option v-for="item in buildList" :key="item.BuildId" :label="item.BuildLocalName" :value="item.BuildId"></el-option>
+                <el-option v-for="item in buildList" :key="item.BuildID" :label="item.BuildLocalName" :value="item.BuildID"></el-option>
             </el-select>
             <!-- 楼层选择 -->
             <span style="padding-right:12px;color:#999;">楼层</span>
             <el-select v-model="floorId" placeholder="请选择" @change="changeFloor">
-                <el-option v-for="item in floorList" :key="item.FloorId" :label="item.FloorLocalName" :value="item.FloorId"></el-option>
+                <el-option v-for="item in floorList" :key="item.FloorID" :label="item.FloorLocalName" :value="item.FloorID"></el-option>
             </el-select>
             <!-- 选择时间插件 -->
             <build-time :timeArr="timeArr" @checkTime="checkTime"></build-time>
@@ -53,32 +53,6 @@
                                     </div>
                                 </div>
                             </el-scrollbar>
-                            <!-- <div class="swiper-container" id="swiper"> -->
-                                <!-- <div class="swiper-wrapper" ref="swiperPoint">
-                                    <div class="swiper-slide" :class="checkPointClass == 'all' ? 'active_swiper' : ''" @click="checkPoint('all','all','all')">
-                                        <div class="all_view">
-                                            <h3>全部</h3>
-                                        </div>
-                                    </div>
-                                    <div class="swiper-slide" v-for="(item,index) in PTArr" :key="index" :class="checkPointClass == index ? 'active_swiper' : ''" @click="checkPoint(index,item.Id,item.Name)">
-                                        <div class="img_view">
-                                            <div :class="index == 0 ? 'msg_view' : 'title_view'">
-                                                <h3>{{item.Name}}</h3>
-                                                <p>
-                                                    附近的资产:
-                                                    <span>{{item.Total}}</span> 个(
-                                                    <em>{{item.Nocheck}}</em> 个未完成修订)
-                                                </p>
-                                            </div>
-                                            <img v-if="index != 0" v-load @error="setErrorImg" :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.Image +'&width=200'" :alt="item.Name">
-                                            <p v-if="index != 0" class="btn" @click.stop="getTable(item.Id,index)">查看详情</p>
-                                            <i v-if="index != 0" class="iconfont icon-shuaxin icon" @click.stop="refreshImg(index)"></i>
-                                        </div>
-                                    </div>
-                                </div> -->
-                                <!-- Add Pagination -->
-                                <!--  -->
-                            <!-- </div> -->
                         </div>
                         <!-- 右按钮 -->
                         <div class="turn_right">
@@ -88,10 +62,6 @@
                     <!-- 控制点位标签显示 -->
                     <div class="label_show">
                         <el-button plain @click="labelShowBtn">{{labelChecked}}</el-button>
-                        <!-- <div class="label_btn" @click="labelShowBtn">
-                            <span>{{labelChecked}}</span>
-                            <i class="iconfont" :class="!labelShow ? 'icon-unfold' : 'icon-packup'"></i>
-                        </div> -->
                     </div>
                 </div>
                 <!-- 全部与未完成 -->
@@ -100,21 +70,13 @@
                         <el-radio-button label="" >全部</el-radio-button>
                         <el-radio-button label="0">未完成修订</el-radio-button>
                     </el-radio-group>
-                    <!-- <span @click="changeChecked('')" :class="checked === '' ? 'Blue' : ''">全部</span>
-                    <span @click="changeChecked(0)" :class="checked === 0 ? 'Blue' : ''">未完成修订</span> -->
                     <div class="undo_btn" @click="undo">
-                        <!-- <i class="iconfont icon-undo"></i>
-                        <i>撤回</i> -->
                         <el-button plain>撤回</el-button>
                     </div>
                     <div class="undo_btn" @click="refresh">
-                        <!-- <i class="iconfont icon-shuaxin"></i>
-                        <i>刷新</i> -->
                         <el-button plain>刷新</el-button>
                     </div>
                     <div class="undo_btn" @click="download">
-                        <!-- <i class="iconfont icon-xiazai"></i>
-                        <i>下载</i> -->
                         <el-button plain>下载</el-button>
                     </div>
                     <p class="build_msg" v-show="buildMsgShow" :class="buildMsg ? 'blink' : ''">其他设备族的资产只能在对应页签内维护,设备族变更的资产刷新后不匹配的信息点值将丢失,将会在对应的页签内显示</p>
@@ -318,8 +280,6 @@
     import zhCN from 'handsontable-pro/languages/zh-CN';
     //接口
     import {
-        getBuildSelect, //根据项目ID获得建筑列表
-        getFloor, //根据建筑id获取楼层id
         getPT, //根据时间、建筑名称、楼层查询点位标签
         getPoint, //获取点位标签详情
         updatePoint, //修改点位标签
@@ -328,16 +288,19 @@
         getTableMain, //获取表格主体内容
         upDateTableMain, //提交修改设备资产
         delErrAssets, //删除设备资产
-        getAllFamily, //获取所有设备族
-        defaultFloor, //获取默认楼层
         getdelMain, //获取过滤掉后的表格主体
         getBasicMatch, //获取完全匹配的厂商库id
+        buildingQuery, //数据中心-建筑查询
+        floorQuery, //数据中心-楼层查询
+        queryLocationPoint, //数据中心-点位标签查询
+        updateLocationPoint, //数据中心-更新点位标签
+        getEquipBelongs, //获取设备族
     } from "@/api/scan/request";
     import { mapGetters, mapActions } from "vuex"
     export default {
         components: {
-            "build-time": buildTime,
-            "drag": drag,
+            buildTime,
+            drag,
             recommend
         },
         data() {
@@ -360,8 +323,6 @@
                 picShow: false, //最底层图片窗
                 pointList: "", //点位标签详情数组
                 pointId: "", //点位标签详情查询需求的id
-                // ProjId: this.$route.query.projId, //项目id
-                // UserId: this.$route.query.userId, //用户id
                 checkPointClass: "all", //点击点位标签的当前标签
                 pointCheck: "", //当前点击到的点位标签
                 checked: 0, //审核标志
@@ -393,7 +354,6 @@
                 rowArr: "", //鼠标单击表格时的位置
                 nameShow: false, //点位标签名的勾号是否显示
                 noShow: false, //点位标签no是否显示
-                defaultFloorData: "", //默认楼层
                 imgList: [], //点位标签的图片数组
                 floorName: "", //被选中的楼层名
                 buildMsgShow: false, //提示显示与否
@@ -425,15 +385,17 @@
         methods: {
             //获取所有设备族
             getAllFamily() {
-                getAllFamily().then(result => {
-                    if (result.data.Result == "success") {
-                        this.AllFamily = this.changeArr(result.data.Content);
-                    } else {
-                        // this.dialogVisible = true;
-                        // this.ajaxMsg = "请求出错";
-                        this.$message.error("请求出错")
-                    }
-                });
+                let pa = {
+                    data:{ Orders:'Family asc', PageSize: 500 }
+                }
+                getEquipBelongs(pa, res => {
+                    this.AllFamily = res.Content.map(t => {
+                        return {
+                            Code: t.Family,
+                            Name: t.FamilyName
+                        }
+                    })
+                })
             },
             //重新获取数据loadhot
             loadData() {
@@ -596,20 +558,8 @@
             },
             //获取建筑列表
             getBuilding() {
-                let param = {
-                    ProjId: this.projectId,
-                    UserId: this.userId
-                };
-                getBuildSelect(param).then(result => {
-                    if (result.data.Result == "success" && result.data.BuildList) {
-                        this.buildList = result.data.BuildList;
-                        //获取建筑下列数据后请求默认楼层建筑数据
-                        this.getDefaultFloor();
-                    } else {
-                        // this.dialogVisible = true;
-                        // this.ajaxMsg = "请求出错";
-                        this.$message.error("请求出错")
-                    }
+                buildingQuery({}, res => {
+                    this.buildList = res.Content;
                 });
             },
             //获取点位标签详情
@@ -630,6 +580,14 @@
                         this.$message.error("请求出错")
                     }
                 });
+                // let pa = {
+                //     Filters: `Id='${this.pointId}'`
+                // }
+                // queryLocationPoint(pa, res => {
+                //     this.pointList = res.Content[0];
+                //     this.imgList = this.delImage(res.Content[0].ImageList);
+                //     this.dialogTableVisible = true;
+                // })
             },
             delImage(imageList) {
                 let list = {
@@ -684,23 +642,6 @@
                 }
                 return list;
             },
-            //获取默认楼层
-            getDefaultFloor() {
-                let param = {
-                    ProjId: this.projectId,
-                    UserId: this.userId
-                };
-                defaultFloor(param).then(result => {
-                    //将默认建筑id赋予标签绑定
-                    // this.buildId = result.data.BuildId;
-                    //存储默认楼层,等待楼层下拉列表出现后赋予
-                    // this.defaultFloorData = result.data.FloorId;
-                    //请求楼层下拉数据
-                    if (this.buildId) {
-                        this.getFloorData();
-                    }
-                });
-            },
             //保存点位标签详情的修改
             savePoint() {
                 let param = {
@@ -743,40 +684,36 @@
                         this.$message.error("请求出错")
                     }
                 });
+                // let pa = {
+                //     Filters: `LastUpdate>='${this.checkTimeArr[0]}';LastUpdate<='${this.checkTimeArr[1]}';Build='${this.buildId}'`,
+                //     PageSize: 100
+                // }
+                // if(this.floorId == 'noKnow'){
+                //     pa.Filters += `;FloorId isNull`
+                // }else if(this.floorId!='all'){
+                //     pa.Filters += `;FloorId='${this.floorId}'`
+                // }
+                // queryLocationPoint(pa, res => {
+                //     this.PTArr = result.data.PointList;
+                // })
             },
             //获取楼层列表
             getFloorData() {
                 let param = {
-                    BuildId: this.buildId,
-                    ProjId: this.projectId,
-                    UserId: this.userId
+                    Filters: `BuildID='${this.buildId}'`,
+                    Orders: 'FloorSequenceID desc'
                 };
-                getFloor(param).then(res => {
-                    if (res.data.Result == "success") {
-                        this.floorList = tools.sortArr(res.data.FloorList, "FloorSequenceId", false);
-                        // this.floorId = this.defaultFloorData;
-                        for (let i = 0; i < this.floorList.length; i++) {
-                            if (this.floorId == this.floorList[i].FloorId) {
-                                this.floorName = this.floorList[i].FloorLocalName;
-                            }
-                        }
-                        this.floorList.unshift({
-                            FloorName: "全部",
-                            FloorLocalName: "全部",
-                            FloorId: "all"
-                        },{
-                            FloorName: "未明确楼层",
-                            FloorLocalName: "未明确楼层",
-                            FloorId: "noKnow"
-                        })
-                        if (this.defaultFloorData) {
-                            this.getPT();
-                        }
-                    } else {
-                        // this.dialogVisible = true;
-                        // this.ajaxMsg = "请求出错";
-                        this.$message.error("请求出错")
-                    }
+                floorQuery(param, res => {
+                    this.floorList = res.Content
+                    this.floorList.unshift({
+                        FloorName: "全部",
+                        FloorLocalName: "全部",
+                        FloorID: "all"
+                    },{
+                        FloorName: "未明确楼层",
+                        FloorLocalName: "未明确楼层",
+                        FloorID: "noKnow"
+                    })
                 });
             },
             //保存设备资产的更新
@@ -1729,18 +1666,6 @@
                 console.log(data)
                 return data;
             },
-            changeArr(arr) {
-                if (arr.length) {
-                    return arr.map(item => {
-                        return {
-                            Code: item.code,
-                            Name: item.name
-                        };
-                    });
-                } else {
-                    return "";
-                }
-            },
             //工具函数浅复制深拷贝,防止共用存储空间
             deepCopy(obj) {
                 var out = [],

File diff suppressed because it is too large
+ 337 - 0
src/views/data_admin/buildGraphy/graphyCanvas-copy.vue


+ 409 - 458
src/views/data_admin/buildGraphy/graphyTabs.vue

@@ -3,49 +3,33 @@ setFalg 插旗事件
 getLocation 定位
 -->
 <template>
-    <div id="graphy-tabs">
-        <el-tabs style="height:100%;" v-model="activeName2" type="card" @tab-click="handleClick">
-            <el-tab-pane label="本层的点位标签" name="point">
-                <div v-if="pointData.length" v-loading="isLoading" style="max-height: 600px;overflow-y:auto;">
-                    <div v-for="(item,index) in pointData" :key="index">
-                        <div class="point">
-                            <span>{{item.Name}}</span>
-                            <el-button size="mini" @click="getDetails(item)">编辑点位标签</el-button>
-                            <el-button :disabled="!map" size="mini" @click="btnClick(item)">{{ item.X == 0 && item.Y == 0 ? '插旗' : '定位'}}</el-button>
-                        </div>
-                    </div>
-                </div>
-                <div v-if="!pointData.length" class="center" style="height: 400px;padding-top: 260px; box-sizing:border-box;">
-                    <i class="icon-wushuju iconfont"></i>
-                    {{pointParam.FloorId ? "数据为空" : "请选择楼层"}}
-                </div>
-      </el-tab-pane>
-      <el-tab-pane label="无法定位到楼层的点位标签" name="noPoint">
-            <div v-if="pointNoData.length" v-loading="isLoading" style="max-height: 600px;">
-                <div v-for="(item,index) in pointNoData" :key="index">
-                    <div class="point">
-                    <span>{{item.Name}}</span>
-                    <el-button @click="getDetails(item)">编辑点位标签</el-button>
-                    <el-button
-                        :disabled="!(item.X == 0 && item.Y == 0)"
-                        @click="btnClick(item)"
-                    >{{ item.X == 0 && item.Y == 0 ? '插旗' : '定位'}}</el-button>
-                </div>
-            </div>
-            </div>
-            <div v-if="!pointNoData.length" class="center" style="height: 400px;padding-top: 260px; box-sizing:border-box;">
-                <i class="icon-wushuju iconfont"></i>
-                {{pointParam.FloorId ? "数据为空" : "请选择楼层"}}
-            </div>
-        </el-tab-pane>
+  <div id="graphy-tabs">
+    <el-tabs v-model="activeName2" type="card" @tab-click="handleClick">
+      <el-tab-pane label="本层的点位标签" name="point"></el-tab-pane>
+      <el-tab-pane label="无法定位到楼层的点位标签" name="noPoint"></el-tab-pane>
     </el-tabs>
+    <div v-if="pointData.length" v-loading="isLoading" style="padding:0 0 10px;overflow-y:auto;">
+      <div v-for="(item,index) in pointData" :key="index">
+        <div class="point">
+          <span>{{item.Name}}</span>
+          <el-button size="mini" @click="getDetails(item)">编辑点位标签</el-button>
+          <el-button v-if="activeName2=='point'" :disabled="!map" size="mini" @click="btnClick(item)">
+            {{ item.X == 0 && item.Y == 0 ? '插旗' : '定位'}}
+          </el-button>
+          <el-button v-if="activeName2=='noPoint'" :disabled="!(item.X == 0 && item.Y == 0)" @click="btnClick(item)">
+            {{ item.X == 0 && item.Y == 0 ? '插旗' : '定位'}}
+          </el-button>
+        </div>
+      </div>
+    </div>
+    <div v-else class="center" style="height: 400px;padding-top: 260px; box-sizing:border-box;">
+      <i class="icon-wushuju iconfont"></i>
+      {{pointParam.FloorId ? "数据为空" : "请选择楼层"}}
+    </div>
     <el-dialog title="详情" :visible.sync="pointShow" width="500px">
       <div class="qrcode">
         <div class="qrcode-view">
-          <img
-            :src="'/ScanBuilding/service/qrcode/point?projectId=' + projectId + '&pointId=' + pointDetails.PointId + '&FloorId=' + pointDetails.FloorId + '&width=200&height=200'"
-            alt="点位标签二维码"
-          >
+          <img :src="'/api/scanbuilding-2/service/qrcode/zxing?Id=' + pointDetails.Id + '&width=200&height=200'" alt="点位标签二维码">
         </div>
         <div class="point-edit">
           <p>
@@ -54,23 +38,10 @@ getLocation 定位
             -({{pointDetails.X}},{{pointDetails.Y}})
           </p>
           <div>
-            <form-input
-              :width="100"
-              @change="changeInput"
-              :value="pointDetails.PointName"
-              :keys="'PointName'"
-              :label="'点位标签'"
-              :isRule="false"
-            ></form-input>
-            <form-input
-              :width="100"
-              @change="changeInput"
-              :value="pointDetails.PointLocalId"
-              :keys="'PointLocalId'"
-              :label="'点位本地编码'"
-              :isRule="false"
-            ></form-input>
-            <!-- <form-input></form-input> -->
+            <form-input :width="100" @change="changeInput" :value="pointDetails.Name" :keys="'Name'" :label="'点位标签'" :isRule="false">
+            </form-input>
+            <form-input :width="100" @change="changeInput" :value="pointDetails.LocalId" :keys="'LocalId'" :label="'点位本地编码'" :isRule="false">
+            </form-input>
           </div>
         </div>
       </div>
@@ -79,7 +50,7 @@ getLocation 定位
         <ul>
           <li>
             <span>点位标签ID</span>
-            <span>{{pointDetails.PointId}}</span>
+            <span>{{pointDetails.Id}}</span>
           </li>
           <li>
             <span>模型ID</span>
@@ -97,66 +68,59 @@ getLocation 定位
           <li>
             <span>备注</span>
             <span>
-              <form-input
-                :width="0"
-                @change="changeInput"
-                :value="pointDetails.Note"
-                :keys="'Note'"
-                :label="''"
-                :isRule="false"
-              ></form-input>
+              <form-input :width="0" @change="changeInput" :value="pointDetails.Note" :keys="'Note'" :label="''" :isRule="false"></form-input>
             </span>
           </li>
         </ul>
       </div>
       <div class="point-pic">
-            <p>点位安装位置效果照片</p>
-            <template v-for="(item,index) in installPic">
-                <div class="point-image" :key="index">
-                    <i class="el-icon-delete" @click="delImage(index,installPic)"></i>
-                    <img :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200&height=200'" alt>
-                </div>
-            </template>
-            <load-img keyName="安装位置" @getKey="getKey"></load-img>
-        </div>
-        <div class="point-pic">
-            <p>全景照片</p>
-            <template v-for="(item,index) in panorama">
-                <div class="point-image" :key="index">
-                    <i class="el-icon-delete" @click="delImage(index,panorama)"></i>
-                    <img :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200&height=200'" alt>
-                </div>
-            </template>
-            <load-img keyName="全景照片" @getKey="getKey"></load-img>
-        </div>
-        <div class="point-pic">
-            <p>周边照片</p>
-            <template v-for="(item,index) in rimPic">
-                <div class="point-image" :key="index">
-                    <i class="el-icon-delete" @click="delImage(index,rimPic)"></i>
-                    <img :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200&height=200'" alt>
-                </div>
-            </template>
-            <load-img keyName="周边照片" @getKey="getKey"></load-img>
-        </div>
-        <div class="point-pic">
-            <p>视频资料</p>
-            <template v-for="(item,index) in videoPic">
-                <div class="point-image" :key="index">
-                    <i class="el-icon-delete" @click="delImage(index,videoPic)"></i>
-                    <img :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200&height=200'" alt>
-                </div>
-            </template>
-            <load-img keyName="视频" @getKey="getKey"></load-img>
-        </div>
-        <div class="point-pic">
-            <p>其他照片</p>
-            <template v-for="(item,index) in elsePic">
-                <div class="point-image" :key="index">
-                    <i class="el-icon-delete" @click="delImage(index,elsePic)"></i>
-                    <img :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200&height=200'" alt>
-                </div>
-            </template>
+        <p>点位安装位置效果照片</p>
+        <template v-for="(item,index) in installPic">
+          <div class="point-image" :key="index">
+            <i class="el-icon-delete" @click="delImage(index,installPic)"></i>
+            <img :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.Key +'&width=200&height=200'" alt>
+          </div>
+        </template>
+        <load-img keyName="安装位置" @getKey="getKey"></load-img>
+      </div>
+      <div class="point-pic">
+        <p>全景照片</p>
+        <template v-for="(item,index) in panorama">
+          <div class="point-image" :key="index">
+            <i class="el-icon-delete" @click="delImage(index,panorama)"></i>
+            <img :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.Key +'&width=200&height=200'" alt>
+          </div>
+        </template>
+        <load-img keyName="全景照片" @getKey="getKey"></load-img>
+      </div>
+      <div class="point-pic">
+        <p>周边照片</p>
+        <template v-for="(item,index) in rimPic">
+          <div class="point-image" :key="index">
+            <i class="el-icon-delete" @click="delImage(index,rimPic)"></i>
+            <img :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.Key +'&width=200&height=200'" alt>
+          </div>
+        </template>
+        <load-img keyName="周边照片" @getKey="getKey"></load-img>
+      </div>
+      <div class="point-pic">
+        <p>视频资料</p>
+        <template v-for="(item,index) in videoPic">
+          <div class="point-image" :key="index">
+            <i class="el-icon-delete" @click="delImage(index,videoPic)"></i>
+            <img :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.Key +'&width=200&height=200'" alt>
+          </div>
+        </template>
+        <load-img keyName="视频" @getKey="getKey"></load-img>
+      </div>
+      <div class="point-pic">
+        <p>其他照片</p>
+        <template v-for="(item,index) in elsePic">
+          <div class="point-image" :key="index">
+            <i class="el-icon-delete" @click="delImage(index,elsePic)"></i>
+            <img :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.Key +'&width=200&height=200'" alt>
+          </div>
+        </template>
         <load-img keyName="其他照片" @getKey="getKey"></load-img>
       </div>
     </el-dialog>
@@ -164,360 +128,347 @@ getLocation 定位
 </template>
 
 <script>
-    import {
-        getPT, //获取点位列表
-        getPoint, //获取点位详情
-        updatePoint //修改点位
-    } from "@/api/scan/request";
-    import formInput from "./lib/formInput";
-    import loadImg from "./lib/uploadImg";
-    import {
-        mapGetters,
-        mapActions
-    } from 'vuex';
-    export default {
-        props: {
-            pointParam: {
-                type: Object
-            }
-        },
-        components: {
-            formInput,
-            loadImg
-        },
-        data() {
-            return {
-                activeName2: "point",
-                pointData: [], //tab为本层的点位标签
-                pointNoData: [], //tab为无法定位的点位标签
-                pointShow: false, //标签详情的弹窗
-                pointDetails: {}, //标签详情信息对象
-                // projId: this.$route.query.projId,
-                index: "",
-                installPic: [], //安装位置
-                panorama: [], //全景照片
-                rimPic: [], //周边照片
-                videoPic: [], //视频资料
-                elsePic: [], //其他照片
-                map: true
-            };
-        },
-        computed: {
-            ...mapGetters('layout', ['projectId', 'secret', 'userId'])
-        },
-        methods: {
-            //tabs被点击
-            handleClick(tab, event) {
-                this.index = tab.index;
-                this.getPointList();
-            },
-            //修改input
-            changeInput(val, key) {
-                this.pointDetails[key] = val;
-                this.updatePoint();
-            },
-            //删除图片
-            delImage(index, arr) {
-                arr.splice(index, 1);
-                this.updatePoint();
-            },
-            //获取key的值
-            getKey(val, name) {
-                switch (name) {
-                    case "安装位置":
-                        this.installPic.push({
-                            key: val,
-                            name: name,
-                            type: "image_wz"
-                        });
-                        break;
-                    case "全景照片":
-                        this.panorama.push({
-                            key: val,
-                            name: name,
-                            type: "panorama"
-                        });
-                        break;
-                    case "周边照片":
-                        this.rimPic.push({
-                            key: val,
-                            name: name,
-                            type: "image_zb"
-                        });
-                        break;
-                    case "视频":
-                        this.videoPic.push({
-                            key: val,
-                            name: name,
-                            type: "video"
-                        });
-                        break;
-                    default:
-                        this.elsePic.push({
-                            key: val,
-                            name: name,
-                            type: "image_else"
-                        });
-                }
-                this.updatePoint();
-            },
-            btnClick(item) {
-                if (item.X == 0 && item.Y == 0) {
-                    this.$emit("setFalg", item);
-                } else {
-                    this.$emit("getLocation", item);
-                }
-            },
-            mapPush(detailsArr, pic) {
-                pic.map(item => {
-                    detailsArr.push(item);
-                });
-            },
-            //修改详情
-            updatePoint() {
-                this.pointDetails.ImageList = [];
-                this.mapPush(this.pointDetails.ImageList, this.installPic);
-                this.mapPush(this.pointDetails.ImageList, this.panorama);
-                this.mapPush(this.pointDetails.ImageList, this.rimPic);
-                this.mapPush(this.pointDetails.ImageList, this.videoPic);
-                this.mapPush(this.pointDetails.ImageList, this.elsePic);
-                let param = {
-                    ProjId: this.pointParam.ProjId,
-                    UserId: this.pointParam.UserId,
-                    PointList: this.pointDetails
-                };
-                updatePoint(param).then(res => {
-                    this.$message.success("修改成功");
-                });
-            },
-            getDetails(item) {
-                let params = {
-                    ProjId: this.projectId,
-                    UserId: this.userId,
-                    PointId: item.Id
-                };
-                getPoint(params).then(res => {
-                    let data = res.data;
-                    if (data.Result == "success") {
-                        this.pointShow = true;
-                        this.pointDetails = data.PointList[0];
-                        this.getPic(data.PointList[0].ImageList);
-                    } else {
-                        this.$message.error("请求出错");
-                    }
-                });
-            },
-            getPic(imgArr) {
-                this.installPic = [];
-                this.panorama = [];
-                this.rimPic = [];
-                this.videoPic = [];
-                this.elsePic = [];
-                imgArr.map((item, index) => {
-                    switch (item.name) {
-                        case "安装位置":
-                            this.installPic.push(item);
-                            break;
-                        case "全景照片":
-                            this.panorama.push(item);
-                            break;
-                        case "周边照片":
-                            this.rimPic.push(item);
-                            break;
-                        case "视频":
-                            this.videoPic.push(item);
-                            break;
-                        default:
-                            this.elsePic.push(item);
-                    }
-                });
-            },
-            //获取point
-            getPointList() {
-                this.isLoading = true;
-                if (this.pointParam.FloorId) {
-                    let param = {
-                        FloorId: this.pointParam.FloorId,
-                        ProjId: this.pointParam.ProjId,
-                        UserId: this.pointParam.UserId
-                    };
-                    console.log(param)
-                    //当index为1时FloorId为空
-                    if (this.index == "1") {
-                        param.FloorId = "";
-                    }
-                    getPT(param).then(res => {
-                        res.data.PointList.splice(0, 1);
-                        if (this.index == "1") {
-                            this.pointNoData = res.data.PointList;
-                        } else {
-                            this.$emit("getPointList", res.data.PointList);
-                            this.pointData = res.data.PointList;
-                        }
-                        this.isLoading = false;
-                    });
-                }
-            },
-            //初始化
-            reset(data, map) {
-                this.map = map
-                this.pointParam.FloorId = data.FloorId;
-                this.pointParam.fllorName = data.fllorName;
-                this.activeName2 = "point";
-                this.getPointList();
-            }
-        },
-        watch: {
-            pointShow: {
-                deep: true,
-                handler: function(old, val) {
-                    if (old == false && val == true) {
-                        this.getPointList();
-                    }
-                }
-            },
-            projectId(){
-                this.pointData= []
-                this.pointNoData= []
-                this.activeName2 = "point"
-            }
-        }
+import {
+  updatePoint, //修改点位
+  queryLocationPoint, //数据中心-查询点位标签
+  updateLocationPoint, //数据中心更新点位
+  deleteLocationImg, //数据中心-删除图片
+} from "@/api/scan/request";
+import formInput from "./lib/formInput";
+import loadImg from "./lib/uploadImg";
+import {
+  mapGetters,
+  mapActions
+} from 'vuex';
+export default {
+  props: {
+    pointParam: {
+      type: Object
+    }
+  },
+  components: {
+    formInput,
+    loadImg
+  },
+  data() {
+    return {
+      activeName2: "point",
+      pointData: [], //tab为本层的点位标签
+      pointShow: false, //标签详情的弹窗
+      pointDetails: {}, //标签详情信息对象
+      installPic: [], //安装位置
+      panorama: [], //全景照片
+      rimPic: [], //周边照片
+      videoPic: [], //视频资料
+      elsePic: [], //其他照片
+      map: true
     };
-</script>
-
-<style lang="scss" scoped>
-    #graphy-tabs {
-        height: 100%;
-        border-left: 1px solid #E4E7ED;
-        .el-tabs__content {
-            height: calc(100% - 60px) !important;
-            background: red;
+  },
+  computed: {
+    ...mapGetters('layout', ['projectId', 'secret', 'userId'])
+  },
+  methods: {
+    //tabs被点击
+    handleClick(tab, event) {
+      this.pointData = [];
+      this.getPointList();
+    },
+    //修改input
+    changeInput(val, key) {
+      this.pointDetails[key] = val;
+      this.updatePoint();
+    },
+    //删除图片
+    delImage(index, arr) {
+      let delArr = arr.splice(index, 1);
+      deleteLocationImg(delArr, res => {
+        this.$message.success("修改成功");
+      })
+    },
+    //获取key的值
+    getKey(val, name) {
+      switch (name) {
+        case "安装位置":
+          this.installPic.push({
+            Key: val,
+            Name: name,
+            Type: "image_wz"
+          });
+          break;
+        case "全景照片":
+          this.panorama.push({
+            Key: val,
+            Name: name,
+            Type: "panorama"
+          });
+          break;
+        case "周边照片":
+          this.rimPic.push({
+            Key: val,
+            Name: name,
+            Type: "image_zb"
+          });
+          break;
+        case "视频":
+          this.videoPic.push({
+            Key: val,
+            Name: name,
+            Type: "video"
+          });
+          break;
+        default:
+          this.elsePic.push({
+            Key: val,
+            Name: name,
+            Type: "image_else"
+          });
+      }
+      this.updatePoint();
+    },
+    btnClick(item) {
+      if (item.X == 0 && item.Y == 0) {
+        this.$emit("setFalg", item);
+      } else {
+        this.$emit("getLocation", item);
+      }
+    },
+    mapPush(detailsArr, pic) {
+      pic.map(item => {
+        detailsArr.push(item);
+      });
+    },
+    //修改详情
+    updatePoint() {
+      this.pointDetails.ImageList = [];
+      this.mapPush(this.pointDetails.ImageList, this.installPic);
+      this.mapPush(this.pointDetails.ImageList, this.panorama);
+      this.mapPush(this.pointDetails.ImageList, this.rimPic);
+      this.mapPush(this.pointDetails.ImageList, this.videoPic);
+      this.mapPush(this.pointDetails.ImageList, this.elsePic);
+      let pa = {
+        Content: [this.pointDetails]
+      }
+      updateLocationPoint(pa, res => {
+        this.$message.success("修改成功");
+      })
+    },
+    //获取详情
+    getDetails(item) {
+      let pa = {
+        Cascade: [{ Name: 'imageList' }],
+        Filters: `Id='${item.Id}'`
+      }
+      queryLocationPoint(pa, res => {
+        this.pointShow = true;
+        this.pointDetails = res.Content[0];
+        this.getPic(res.Content[0].ImageList || []);
+      })
+    },
+    getPic(imgArr) {
+      this.installPic = [];
+      this.panorama = [];
+      this.rimPic = [];
+      this.videoPic = [];
+      this.elsePic = [];
+      imgArr.map((item, index) => {
+        switch (item.Name) {
+          case "安装位置":
+            this.installPic.push(item);
+            break;
+          case "全景照片":
+            this.panorama.push(item);
+            break;
+          case "周边照片":
+            this.rimPic.push(item);
+            break;
+          case "视频":
+            this.videoPic.push(item);
+            break;
+          default:
+            this.elsePic.push(item);
         }
-        .el-dialog__body{
-            max-height: 400px;
+      });
+    },
+    //获取point
+    getPointList() {
+      this.isLoading = true;
+      if (this.pointParam.FloorId) {
+        let pa = {
+          Cascade: [{ Name: 'imageList' }],
+          PageSize: 500,
+          Filters: ''
         }
-        .saga-message {
-            height: calc(100vh - 220px);
-            line-height: 400px;
-            color: #ccc;
-            font-size: 24px;
-            text-align: center;
+        if (this.activeName2 == "point") {
+          pa.Filters = `FloorId='${this.pointParam.FloorId}'`
+        } else {
+          pa.Filters = 'FloorId isNull'
         }
-        .point {
-            padding-left: 20px;
-            height: 30px;
-            span {
-                font-size: 12px;
-                width: 180px;
-                display: inline-block;
-                white-space: nowrap;
-                text-overflow: ellipsis;
-                overflow: hidden;
-            }
-            button {
-                margin-bottom: 5px;
-            }
-        }
-        .point:hover {
-            background-color: #f2f6fc;
-        }
-        .qrcode {
-            width: 100%;
-            height: 180px;
-            overflow: hidden;
-            .qrcode-view {
-                width: 180px;
-                height: 180px;
-                overflow: hidden;
-                float: left;
-                img {
-                    width: 100%;
-                    height: 100%;
-                }
-            }
-            .point-edit {
-                height: 180px;
-                display: inline-block;
-                padding-top: 10px;
-                overflow-x: hidden;
-                width: calc(100% - 180px);
-            }
+        queryLocationPoint(pa, res => {
+          this.pointData = res.Content;
+          if (this.activeName2 == "point") {
+            this.$emit("getPointList", res.Content);
+          }
+          this.isLoading = false;
+        })
+      }
+    },
+    //初始化
+    reset(data, map) {
+      this.map = map
+      this.pointParam.FloorId = data.FloorId;
+      this.pointParam.fllorName = data.fllorName;
+      this.activeName2 = "point";
+      this.getPointList();
+    }
+  },
+  watch: {
+    pointShow: {
+      deep: true,
+      handler: function (old, val) {
+        if (old == false && val == true) {
+          this.getPointList();
         }
-        .point-coding {
-            width: 100%;
-            height: 120px;
-            margin-top: 5px;
-            overflow: hidden;
-            p {
-                height: 30px;
-                line-height: 30px;
-                padding-left: 10px;
-                font-weight: 500;
-                font-size: 16px;
-                text-align: left;
-            }
-            ul {
-                width: 100%;
-                border: 1px solid #ccc;
-                border-bottom: none;
-                box-sizing: border-box;
-                li {
-                    line-height: 40px;
-                    height: 40px;
-                    span {
-                        display: block;
-                        float: left;
-                        padding-left: 10px;
-                        box-sizing: border-box;
-                        border-right: 1px solid #ccc;
-                        border-bottom: 1px solid #ccc;
-                        border-left: 1px solid #ccc;
-                        height: 40px;
-                        overflow: hidden;
-                    }
-                    span:first-child {
-                        width: 30%;
-                    }
-                    span:last-child {
-                        width: 70%;
-                    }
-                }
-            }
+      }
+    },
+    projectId() {
+      this.pointData = []
+      this.activeName2 = "point"
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+#graphy-tabs {
+  height: 100%;
+  border-left: 1px solid #e4e7ed;
+  .el-tabs__content {
+    height: calc(100% - 60px) !important;
+    background: red;
+  }
+  .el-dialog__body {
+    max-height: 400px;
+  }
+  .saga-message {
+    height: calc(100vh - 220px);
+    line-height: 400px;
+    color: #ccc;
+    font-size: 24px;
+    text-align: center;
+  }
+  .point {
+    padding: 5px 0 5px 20px;
+    line-height: 30px;
+    span {
+      float: left;
+      width: 180px;
+      display: block;
+      white-space: nowrap;
+      text-overflow: ellipsis;
+      overflow: hidden;
+      font-size: 12px;
+    }
+  }
+  .point:hover {
+    background-color: #f2f6fc;
+  }
+  .qrcode {
+    width: 100%;
+    height: 180px;
+    overflow: hidden;
+    .qrcode-view {
+      width: 180px;
+      height: 180px;
+      overflow: hidden;
+      float: left;
+      img {
+        width: 100%;
+        height: 100%;
+      }
+    }
+    .point-edit {
+      height: 180px;
+      display: inline-block;
+      padding-top: 10px;
+      overflow-x: hidden;
+      width: calc(100% - 180px);
+    }
+  }
+  .point-coding {
+    width: 100%;
+    height: 120px;
+    margin-top: 5px;
+    overflow: hidden;
+    p {
+      height: 30px;
+      line-height: 30px;
+      padding-left: 10px;
+      font-weight: 500;
+      font-size: 16px;
+      text-align: left;
+    }
+    ul {
+      width: 100%;
+      border: 1px solid #ccc;
+      border-bottom: none;
+      box-sizing: border-box;
+      li {
+        line-height: 40px;
+        height: 40px;
+        span {
+          display: block;
+          float: left;
+          padding-left: 10px;
+          box-sizing: border-box;
+          border-right: 1px solid #ccc;
+          border-bottom: 1px solid #ccc;
+          border-left: 1px solid #ccc;
+          height: 40px;
+          overflow: hidden;
         }
-        .point-pic {
-            width: 100%;
-            overflow: hidden;
-            p {
-                height: 25px;
-                line-height: 25px;
-                padding-left: 10px;
-                font-weight: 500;
-                font-size: 16px;
-                margin-top: 5px;
-                margin-bottom: 5px;
-            }
+        span:first-child {
+          width: 30%;
         }
-        .point-image {
-            width: 180px;
-            height: 180px;
-            float: left;
-            position: relative;
-            margin-right: 10px;
-            margin-bottom: 10px;
-            border: 1px solid #ccc;
-            img {
-                width: 100%;
-                height: 100%;
-            }
-            i {
-                position: absolute;
-                bottom: 10px;
-                right: 10px;
-                background-color: #fff;
-                padding: 5px;
-                cursor: pointer;
-            }
+        span:last-child {
+          width: 70%;
         }
+      }
+    }
+  }
+  .point-pic {
+    width: 100%;
+    overflow: hidden;
+    p {
+      height: 25px;
+      line-height: 25px;
+      padding-left: 10px;
+      font-weight: 500;
+      font-size: 16px;
+      margin-top: 5px;
+      margin-bottom: 5px;
+    }
+  }
+  .point-image {
+    width: 180px;
+    height: 180px;
+    float: left;
+    position: relative;
+    margin-right: 10px;
+    margin-bottom: 10px;
+    border: 1px solid #ccc;
+    img {
+      width: 100%;
+      height: 100%;
+    }
+    i {
+      position: absolute;
+      bottom: 10px;
+      right: 10px;
+      background-color: #fff;
+      padding: 5px;
+      cursor: pointer;
     }
+  }
+}
 </style>
 

+ 233 - 227
src/views/data_admin/buildGraphy/index.vue

@@ -2,242 +2,248 @@
   revit空间管理
  -->
 <template>
-    <div id="graphy">
-        <!-- <div class="graphy-left">
+  <div id="graphy">
+    <!-- <div class="graphy-left">
           <graphy-tree v-if="show" :param="param" @change="getPoint"></graphy-tree>
         </div> -->
-        <div class='search-title'>
-            <span class="p12">建筑楼层</span>
-            <el-cascader placeholder='请选择' :options="options" @active-item-change="handleItemChange" @change="changeFloor" filterable></el-cascader>
-        </div>
-        <div class="graphy-view">
-            <div class="graphy-main">
-                <graphy-canvas v-if="show" :param="param" @getDetails="getDetails" @resetPoint="resetPoint" ref="canvas"></graphy-canvas>
-            </div>
-            <div class="graphy-right">
-                <graphy-tabs v-show="show" ref="tabs" :pointParam="pointParam" @setFalg="setFalg" @getLocation="getLocation" @getPointList="sendPointList"></graphy-tabs>
-            </div>
-        </div>
+    <div class='search-title'>
+      <span class="p12">建筑楼层</span>
+      <el-cascader placeholder='请选择' :options="options" @change="changeFloor" filterable :props="props" ref="buildfloor"></el-cascader>
     </div>
+    <div class="graphy-view">
+      <div class="graphy-main">
+        <graphy-canvas v-if="show" @getDetails="getDetails" @resetPoint="resetPoint" ref="canvas"></graphy-canvas>
+      </div>
+      <div class="graphy-right">
+        <graphy-tabs v-show="show" ref="tabs" :pointParam="pointParam" @setFalg="setFalg" @getLocation="getLocation" @getPointList="sendPointList">
+        </graphy-tabs>
+      </div>
+    </div>
+  </div>
 </template>
 
 <script>
-    //接口
-    import graphyTree from "./graphyTree";
-    import graphyTabs from "./graphyTabs";
-    import graphyCanvas from "./graphyCanvas";
-    import {
-        mapGetters,
-        mapActions
-    } from 'vuex';
-    import {
-        getPT,
-        getBuildSelect,
-        getFloor
-    } from "@/api/scan/request"; //获取点位坐标
-    import tools from "@/utils/scan/tools"
-    import Handsontable from "handsontable-pro"
-    import 'handsontable-pro/dist/handsontable.full.css'
-    import zhCN from 'handsontable-pro/languages/zh-CN';
-    export default {
-        components: {
-            graphyTree,
-            graphyTabs,
-            graphyCanvas
-        },
-        data() {
-            return {
-                param: {
-                    ProjId: this.projectId, //项目id
-                    UserId: this.userId //用户id
-                },
-                pointParam: {
-                    //point请求参数
-                    ProjId: this.projectId, //项目id
-                    UserId: this.userId, //用户id
-                    fllorName: ""
-                },
-                options: [],
-                map: null,
-                pointId: null,
-                show: false,
-                buildVlaue: []
-            };
-        },
-        mounted() {
-            this.changeValue()
-            this.getList()
-        },
-        computed: {
-            ...mapGetters('layout', ['projectId', 'secret', 'userId'])
-        },
-        methods: {
-            //修改楼层
-            changeFloor(val) {
-                console.log(val)
-                let floorMap = "",
-                    name = ""
-                this.options.map(item => {
-                    if (!!item.children && item.children.length) {
-                        if (item.value == val[0]) {
-                            item.children.map(child => {
-                                if (child.value == val[1]) {
-                                    console.log(child, 'child')
-                                    floorMap = child.map
-                                    name = child.label
-                                }
-                            })
-                        }
-                    }
-                })
-                let obj = {
-                    code: val[1],
-                    map: floorMap,
-                    name: name
-                }
-                this.getPoint(obj)
-                console.log(floorMap)
-            },
-            //获取建筑列表
-            getList() {
-                getBuildSelect(this.param).then(res => {
-                    console.log(res)
-                    this.options = res.data.BuildList.map(item => {
-                        return {
-                            value: item.BuildId,
-                            label: item.BuildLocalName,
-                            children: []
-                        }
-                    })
-                })
-            },
-            //点击事件
-            handleItemChange(val) {
-                if (val.length == 1) {
-                    let obj = Object.assign({
-                        BuildId: val[0]
-                    }, this.param)
-                    getFloor(obj).then(res => {
-                        console.log(res)
-                        this.options = this.options.map(item => {
-                            if (item.value == val[0]) {
-                                let FloorList = tools.sortArr(res.data.FloorList, "FloorSequenceId" , false)
-                                item.children = FloorList.map(child => {
-                                    return {
-                                        value: child.FloorId,
-                                        label: child.FloorLocalName + (child.FloorMap ? '' : '(需初始化数据)'),
-                                        map: child.FloorMap
-                                    }
-                                })
-                            }
-                            return item
-                        })
-                        console.log(this.options)
-                    })
-                } else if (val.length == 2) {
-                }
-            },
-            changeValue() {
-                this.$set(this.param, 'ProjId', this.projectId)
-                this.$set(this.param, 'UserId', this.userId)
-                this.$set(this.pointParam, 'ProjId', this.projectId)
-                this.$set(this.pointParam, 'UserId', this.userId)
-                this.show = true
-            },
-            //渲染
-            getPoint(data) {
-                this.pointParam.FloorId = data.code;
-                this.pointParam.fllorName = data.name;
-                this.$refs.tabs.reset(this.pointParam, data.map);
-                if (this.map != data.map) {
-                    this.map = data.map;
-                    this.$refs.canvas.getData(data);
-                } else {
-                    return;
-                }
-            },
-            //获取到点位标签坐标
-            sendPointList(list) {
-                if (list && list.length && list[0].Id == this.pointId) {
-                    this.$refs.canvas.doPoint(list);
-                } else {
-                    if (list.length) {
-                        this.pointId = list[0].Id;
-                        this.$refs.canvas.doPoint(list);
-                    } else {
-                        this.$refs.canvas.doPoint([]);
-                    }
-                }
-            },
-            //插旗setFalg
-            setFalg(item) {
-                this.$refs.canvas.addPoint(item);
-            },
-            //定位getLocation
-            getLocation(item) {
-                this.$refs.canvas.locationGraphy({
-                    X: item.X,
-                    Y: item.Y * -1
-                });
-            },
-            //重新获取点位信息resetPoint
-            resetPoint() {
-                this.$refs.tabs.reset(this.pointParam, true);
-            },
-            //查看详情
-            getDetails(item) {
-                this.$refs.tabs.getDetails(item);
-            }
-        },
-        watch: {
-            projectId(){
-                this. map = null
-                this.show = false
-                this.options = []
-                this.buildVlaue = []
-                this.changeValue()
-                this.getList()
-            }
-        }
+//接口
+import graphyTree from "./graphyTree";
+import graphyTabs from "./graphyTabs";
+// import graphyCanvas from "./graphyCanvas-copy";
+import graphyCanvas from "./graphyCanvas";
+import {
+  mapGetters,
+  mapActions
+} from 'vuex';
+import {
+  getPT,
+  buildingQuery,
+  getFloor
+} from "@/api/scan/request"; //获取点位坐标
+import tools from "@/utils/scan/tools"
+import Handsontable from "handsontable-pro"
+import 'handsontable-pro/dist/handsontable.full.css'
+import zhCN from 'handsontable-pro/languages/zh-CN';
+export default {
+  components: {
+    graphyTree,
+    graphyTabs,
+    graphyCanvas
+  },
+  data() {
+    return {
+      props: {
+        value: 'BuildID',
+        label: 'BuildLocalName',
+        children: 'Floor'
+      },
+      param: {
+        ProjId: this.projectId, //项目id
+        UserId: this.userId //用户id
+      },
+      pointParam: {
+        ProjId: this.projectId, //项目id
+        UserId: this.userId, //用户id
+        fllorName: ""
+      },
+      options: [],
+      map: null,
+      pointId: null,
+      show: false,
+      buildVlaue: []
     };
+  },
+  mounted() {
+    this.changeValue()
+    this.getList()
+  },
+  computed: {
+    ...mapGetters('layout', ['projectId', 'secret', 'userId'])
+  },
+  methods: {
+    //修改楼层
+    changeFloor(val) {
+      let floorMap = "",
+        name = ""
+      this.options.map(item => {
+        if (!!item.Floor && item.Floor.length) {
+          if (item.BuildID == val[0]) {
+            item.Floor.map(child => {
+              if (child.BuildID == val[1]) {
+                floorMap = child.StructureInfo ? child.StructureInfo.FloorMap : ''
+                name = child.FloorLocalName
+              }
+            })
+          }
+        }
+      })
+      let obj = {
+        code: val[1],
+        map: floorMap,
+        name: name
+      }
+      this.getPoint(obj)
+    },
+    //获取建筑列表
+    getList() {
+      let param = {
+        Cascade: [
+          { Name: "floor", Orders: 'FloorSequenceID desc' }
+        ],
+        PageNumber: 1,
+        PageSize: 50
+      }
+      buildingQuery(this.param, res => {
+        res.Content.map(t => {
+          if (t.Floor && t.Floor.length) {
+            t.Floor = t.Floor.map(item => {
+              if (item.FloorID == this.FloorID) return
+              item.BuildID = item.FloorID
+              item.BuildLocalName = item.FloorLocalName || item.FloorName
+              return item
+            }).filter(it => it)
+          }
+        })
+        this.options = res.Content
+      })
+    },
+    //获取建筑列表
+    getList() {
+      let param = {
+        Cascade: [
+          { Name: "floor", Orders: "FloorSequenceID desc", }
+        ],
+        PageNumber: 1,
+        PageSize: 50
+      }
+      buildingQuery(param, res => {
+        res.Content.map(t => {
+          if (t.Floor && t.Floor.length) {
+            t.Floor = t.Floor.map(item => {
+              if (item.FloorID == this.FloorID) return
+              item.BuildID = item.FloorID
+              item.BuildLocalName = item.FloorLocalName || item.FloorName
+              return item
+            }).filter(it => it)
+          }
+        })
+        this.options = res.Content
+      })
+    },
+    changeValue() {
+      this.$set(this.param, 'ProjId', this.projectId)
+      this.$set(this.param, 'UserId', this.userId)
+      this.$set(this.pointParam, 'ProjId', this.projectId)
+      this.$set(this.pointParam, 'UserId', this.userId)
+      this.show = true
+    },
+    //渲染
+    getPoint(data) {
+      this.pointParam.FloorId = data.code;
+      this.pointParam.fllorName = data.name;
+      this.$refs.tabs.reset(this.pointParam, data.map);
+      if (this.map != data.map) {
+        this.map = data.map;
+        this.$refs.canvas.getData(data);
+      } else {
+        return;
+      }
+    },
+    //获取到点位标签坐标
+    sendPointList(list) {
+      if (list && list.length) {
+        this.pointId = list[0].Id;
+        this.$refs.canvas.doPoint(list);
+      } else {
+        this.$refs.canvas.doPoint([]);
+      }
+    },
+    //插旗setFalg
+    setFalg(item) {
+      this.$refs.canvas.addPoint(item);
+    },
+    //定位getLocation
+    getLocation(item) {
+      this.$refs.canvas.locationGraphy({
+        X: item.X,
+        Y: item.Y * -1
+      });
+    },
+    //重新获取点位信息resetPoint
+    resetPoint() {
+      this.$refs.tabs.reset(this.pointParam, true);
+    },
+    //查看详情
+    getDetails(item) {
+      this.$refs.tabs.getDetails(item);
+    }
+  },
+  watch: {
+    projectId() {
+      this.map = null
+      this.show = false
+      this.options = []
+      this.buildVlaue = []
+      this.changeValue()
+      this.getList()
+    }
+  }
+};
 </script>
 
 <style lang="less" scoped>
-    #graphy {
-        // position: relative;
-        display: flex;
-        flex-direction: column;
-        .graphy-view {
-            display: flex;
-            background-color: #fff;
-            flex: 1; 
-            .graphy-main {
-                flex: 1;
-                // position: absolute;
-                // left: 200px;
-                // top: 0;
-                // right: 400px;
-                // bottom: 0;
-                // overflow: auto;
-            }
-            .graphy-right {
-                // position: absolute;
-                // right: 0;
-                width: 400px; // top: 0;
-                // bottom: 0;
-                // border-left: 1px solid #ccc;
-                // overflow: hidden;
-            }
-        }
-        .graphy-left {
-            // width: 200px;
-            // height: 100%;
-            // position: absolute;
-            // overflow-y: auto;
-            // left: 0;
-            // top: 0;
-            // bottom: 0;
-            // border-right: 1px solid #ccc;
-        }
+#graphy {
+  // position: relative;
+  display: flex;
+  flex-direction: column;
+  .graphy-view {
+    display: flex;
+    background-color: #fff;
+    flex: 1;
+    .graphy-main {
+      flex: 1;
+      // position: absolute;
+      // left: 200px;
+      // top: 0;
+      // right: 400px;
+      // bottom: 0;
+      // overflow: auto;
+    }
+    .graphy-right {
+      // position: absolute;
+      // right: 0;
+      width: 400px; // top: 0;
+      // bottom: 0;
+      // border-left: 1px solid #ccc;
+      // overflow: hidden;
     }
+  }
+  .graphy-left {
+    // width: 200px;
+    // height: 100%;
+    // position: absolute;
+    // overflow-y: auto;
+    // left: 0;
+    // top: 0;
+    // bottom: 0;
+    // border-right: 1px solid #ccc;
+  }
+}
 </style>

+ 13 - 1
src/views/data_admin/buildGraphy/lib/formInput.vue

@@ -282,6 +282,7 @@ export default {
     if (typeof (this.typeArr) == Object) {
       this.typeArr = this.toMyNeed(this.typeArr)
     }
+    console.log(this.value)
     if (this.type == 'cascader' || this.type == 'D1') {
       if (this.value == '' || this.value == undefined) {
         this.formLabelAlign.name = []
@@ -295,7 +296,18 @@ export default {
   },
 
   watch: {
-    label() { }
+    label() { },
+    value(n,o) {
+      if (this.type == 'cascader' || this.type == 'D1') {
+        if (n == '' || n == undefined) {
+          this.formLabelAlign.name = []
+        } else {
+          this.formLabelAlign.name = this.getMyVal(n, this.typeArr, 'code');
+        }
+      } else {
+        this.formLabelAlign.name = n;
+      }
+    }
   }
 };
 </script>

+ 59 - 0
src/views/data_admin/buildGraphy/utils/LocationPointScene.js

@@ -0,0 +1,59 @@
+var __extends = (this && this.__extends) || (function () {
+    var extendStatics = function (d, b) {
+        extendStatics = Object.setPrototypeOf ||
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+        return extendStatics(d, b);
+    };
+    return function (d, b) {
+        extendStatics(d, b);
+        function __() { this.constructor = d; }
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+    };
+})();
+import { mainScene } from "@/assets/graphy";
+import { MarkerItem } from './MarkerItem.js';
+/**
+ * 位置标签绘制旗子
+ *
+ * @author haojianlong
+ */
+var LocationPointScene = /** @class */ (function (_super) {
+    __extends(LocationPointScene, _super);
+    /**
+     * 构造函数
+     *
+     * @param data
+     */
+    function LocationPointScene(data) {
+        return _super.call(this, data) || this;
+    }
+    /**
+     * 将旗子添加到列表中
+     *
+     * @param flagList 旗子list
+     */
+    LocationPointScene.prototype.addFlagList = function (flagList) {
+        var _this = this;
+        if (flagList && flagList.length) {
+            flagList.map(function (t) {
+                var flag = new MarkerItem(null, t.id, t.name);
+                flag.moveTo(t.X, t.Y);
+                flag.zOrder = 9999999;
+                flag.connect('click', _this, _this.flagClick);
+                _this.addItem(flag);
+            });
+        }
+    };
+    /**
+     * @param item  点击的旗子item
+     * @param event 点击的事件
+     */
+    LocationPointScene.prototype.flagClick = function (item, event) {
+        console.log(this.data);
+        console.log(arguments);
+        alert(1);
+    };
+    return LocationPointScene;
+}(mainScene));
+export { LocationPointScene };

+ 49 - 0
src/views/data_admin/buildGraphy/utils/LocationPointScene.ts

@@ -0,0 +1,49 @@
+import { mainScene } from "@/assets/graphy";
+import { MarkerItem } from './MarkerItem.js'
+import { SGraphyScene, SMouseEvent } from "@sybotan-web/graphy";
+import { dataItemPath, dataItem, dataSpaceItem, dataInterface, PolygonItemInterface, ImgItemInterface } from '@/assets/graphy/SGraphy/dataType.js'   //传入参数的参数接口类型
+
+/**
+ * 位置标签绘制旗子
+ * 
+ * @author haojianlong
+ */
+export class LocationPointScene extends mainScene {
+  /** 
+   * 构造函数 
+   * 
+   * @param data
+   */
+  constructor(data: dataInterface | null) {
+    super(data)
+  }
+
+  /**
+   * 将旗子添加到列表中
+   * 
+   * @param flagList 旗子list
+   */
+  addFlagList(flagList: ImgItemInterface[]): void {
+    if (flagList && flagList.length) {
+      flagList.map(t => {
+        let flag = new MarkerItem(null, t.id, t.name);
+        flag.moveTo(t.X, t.Y);
+        flag.zOrder = 9999999;
+        flag.connect('click', this, this.flagClick)
+        this.addItem(flag);
+      })
+    }
+  }
+
+  /**
+   * @param item  点击的旗子item
+   * @param event 点击的事件
+   */
+  flagClick(item: MarkerItem, event: SMouseEvent) {
+    console.log(this.data)
+    console.log(arguments)
+    alert(1)
+  }
+
+
+}

File diff suppressed because it is too large
+ 71 - 0
src/views/data_admin/buildGraphy/utils/MarkerItem.js


File diff suppressed because it is too large
+ 73 - 0
src/views/data_admin/buildGraphy/utils/MarkerItem.ts


+ 88 - 71
src/views/data_admin/buildLog/index.vue

@@ -2,33 +2,24 @@
   <div style="display: flex; flex-direction: column;flex-grow: 1; flex-shrink: 1;">
     <div class="log-main">
       <div class='condition'>
-        <el-input v-model.trim='searchValue' class='margin-right' style='width: 300px;'
-          placeholder='请输入操作人、动作、对象id等关键字搜索' @change='searchChange'></el-input>
-        <el-date-picker class='margin-right' v-model='dateValue' type='daterange' align='center' :clearable='false'
-          unlink-panels range-separator='至' start-placeholder='开始日期' end-placeholder='结束日期'
-          :picker-options='pickerOptions' @change='dateChange' value-format='yyyy-MM-dd'></el-date-picker>
+        <el-input v-model.trim='searchValue' class='margin-right' style='width: 300px;' placeholder='请输入操作人、动作、对象id等关键字搜索'
+          @keyup.enter.native="searchChange">
+        </el-input>
+        <el-date-picker class='margin-right' v-model='dateValue' type='daterange' align='center' :clearable='false' unlink-panels range-separator='至'
+          start-placeholder='开始日期' end-placeholder='结束日期' :picker-options='pickerOptions' @change='dateChange' value-format='yyyy-MM-dd'>
+        </el-date-picker>
       </div>
       <div class="log-table">
         <p style="text-align: right; padding: 10px">
           <el-button style="width: 96px" @click='action'>动作说明</el-button>
           <el-button style="width: 96px" @click='refresh'>刷新</el-button>
-          <el-button style="width: 96px" @click='downExcel'>导出到Excel</el-button>
+          <el-button style="width: 96px" @click='downExcel(1)'>导出到Excel</el-button>
         </p>
         <div style="height: calc(100% - 52px)">
-          <el-table :data='tableData' tooltip-effect='dark' style='width: 100%;' v-loading='loading' height="100%">
-            <el-table-column prop='CreateTime' label='时间' width='150' align='center' header-align='center'>
-            </el-table-column>
-            <el-table-column prop='Comming' label='来源' width='120' header-align='center' align="center"></el-table-column>
-            <el-table-column prop='UserName' label='操作人' width='120' header-align='center' align='center'>
-            </el-table-column>
-            <el-table-column prop='Phone' label='手机' width='150' header-align='center' align='center'></el-table-column>
-            <el-table-column prop='Action' label='动作' width='200' header-align='center' align='center'></el-table-column>
-            <el-table-column prop='UserId' label='对象id' width='300' header-align='center' align='center'></el-table-column>
-            <el-table-column label='操作说明' header-align='left' align="left">
-              <template slot-scope='scope'>
-                <div class='ellipsis' :title='scope.row.Note'>{{scope.row.Note}}</div>
-              </template>
-            </el-table-column>
+          <el-table :data='tableData' tooltip-effect='dark' style='width: 100%;' v-loading='loading' height="100%"
+            :header-cell-style="{background:'#e1e4e5',color:'#2b2b2b'}">
+            <el-table-column v-for="item in tableHeader" :prop='item.fieldName' :label='item.headerName' :width='item.width' :key="item.fieldName"
+             show-overflow-tooltip></el-table-column>
           </el-table>
         </div>
       </div>
@@ -42,11 +33,12 @@
 </template>
 
 <script>
-import { getBuildLog, dowmloadLog } from '@/api/scan/request' //获取日志/下载日志
+import { queryUserLog } from '@/api/scan/request' //获取日志/下载日志
 import { mapGetters, mapActions } from 'vuex'
 import axios from 'axios'
 //component
 import SagaAction from './Action'
+import jsontoExcel from "@/utils/JOSNToExcel"
 
 var date = new Date()
 const nowDate = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate()
@@ -112,7 +104,17 @@ export default {
         pageSizes: [10, 20, 50, 100],
         pageNumber: 1,
         total: 0
-      }
+      },
+      tableHeader: [
+        { fieldName: 'CreateTime', headerName: '时间', width: 150 },
+        { fieldName: 'Comming', headerName: '来源', width: 120 },
+        { fieldName: 'Name', headerName: '操作人', width: 120 },
+        { fieldName: 'Phone', headerName: '手机', width: 150 },
+        { fieldName: 'Action', headerName: '动作', width: 200 },
+        { fieldName: 'UserId', headerName: '对象id', width: 300 },
+        { fieldName: 'Note', headerName: '操作说明', width: 'auto' },
+      ],
+      exportData: []
     }
   },
   components: {
@@ -133,45 +135,62 @@ export default {
       this.$refs['action'].show()
     },
     // 导出
-    downExcel() {
+    downExcel(pageNum) {
+      // let param = {
+      //   startTime: this.dateValue[0] + ' 00:00:00',
+      //   endTime: this.dateValue[1] + ' 23:59:59',
+      //   filter: this.searchValue,
+      //   ProjId: this.projectId,
+      //   UserId: this.userId,
+      //   Comming: 'revit'
+      // }
+      // axios({
+      //   method: 'post',
+      //   url: '/ScanBuilding/service/user_log/export',
+      //   data: param,
+      //   responseType: 'blob'
+      // })
+      //   .then(function (res) {
+      //     var blob = new Blob([res.data], {
+      //       type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
+      //     })
+      //     var fileName = res.headers['content-disposition']
+      //     if (fileName) fileName = fileName.substring(fileName.indexOf('=') + 1)
+      //     if ('download' in document.createElement('a')) {
+      //       // 非IE下载
+      //       const elink = document.createElement('a')
+      //       elink.download = fileName
+      //       elink.style.display = 'none'
+      //       elink.href = URL.createObjectURL(blob)
+      //       document.body.appendChild(elink)
+      //       elink.click()
+      //       URL.revokeObjectURL(elink.href) // 释放URL 对象
+      //       document.body.removeChild(elink)
+      //     } else {
+      //       // IE10+下载
+      //       navigator.msSaveBlob(blob, fileName)
+      //     }
+      //   })
+      //   .catch(function (err) {
+      //     console.dirxml(err)
+      //   })
       let param = {
-        startTime: this.dateValue[0] + ' 00:00:00',
-        endTime: this.dateValue[1] + ' 23:59:59',
-        filter: this.searchValue,
-        ProjId: this.projectId,
-        UserId: this.userId,
-        Comming: 'revit'
+        Filters: `CreateTime>='${this.dateValue[0]} 00:00:00';CreateTime<='${this.dateValue[1]} 23:59:59'`,
+        PageNumber: pageNum,
+        PageSize: 1000
+      }
+      if (this.searchValue) {
+        param.Filters += `;Name contain '${this.searchValue}' or Phone contain '${this.searchValue}' or Action contain '${this.searchValue}' or Note contain '${this.searchValue}' or UserId contain '${this.searchValue}'`
       }
-      axios({
-        method: 'post',
-        url: '/ScanBuilding/service/user_log/export',
-        data: param,
-        responseType: 'blob'
+      queryUserLog(param, res => {
+        this.exportData = this.exportData.concat(res.Content);
+        if (res.Total / (res.PageSize * res.PageNumber) > 1) {
+          this.downExcel(pageNum++)
+        } else {
+          let time = +new Date()
+          jsontoExcel.downloadExl(this.tableHeader, this.exportData, `UserLog-${time}`)
+        }
       })
-        .then(function (res) {
-          var blob = new Blob([res.data], {
-            type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
-          })
-          var fileName = res.headers['content-disposition']
-          if (fileName) fileName = fileName.substring(fileName.indexOf('=') + 1)
-          if ('download' in document.createElement('a')) {
-            // 非IE下载
-            const elink = document.createElement('a')
-            elink.download = fileName
-            elink.style.display = 'none'
-            elink.href = URL.createObjectURL(blob)
-            document.body.appendChild(elink)
-            elink.click()
-            URL.revokeObjectURL(elink.href) // 释放URL 对象
-            document.body.removeChild(elink)
-          } else {
-            // IE10+下载
-            navigator.msSaveBlob(blob, fileName)
-          }
-        })
-        .catch(function (err) {
-          console.dirxml(err)
-        })
     },
     //切换每页显示多少条数据
     handleSizeChange(val) {
@@ -188,20 +207,18 @@ export default {
       this.getLogData()
     },
     getLogData() {
-      this.loading = true
       let param = {
-        startTime: this.dateValue[0] + ' 00:00:00',
-        endTime: this.dateValue[1] + ' 23:59:59',
-        filter: this.searchValue,
-        pageNum: this.page.pageNumber,
-        pageSize: this.page.pageSize,
-        ProjId: this.projectId,
-        UserId: this.userId
+        Filters: `CreateTime>='${this.dateValue[0]} 00:00:00';CreateTime<='${this.dateValue[1]} 23:59:59'`,
+        PageNumber: this.page.pageNumber,
+        PageSize: this.page.pageSize
+      }
+      if (this.searchValue) {
+        param.Filters += `;Name contain '${this.searchValue}' or Phone contain '${this.searchValue}' or Action contain '${this.searchValue}' or Note contain '${this.searchValue}' or UserId contain '${this.searchValue}'`
       }
-      getBuildLog(param).then(res => {
+      queryUserLog(param, res => {
         this.loading = false
-        this.page.total = res.data.Count
-        this.tableData = res.data.LogList
+        this.page.total = res.Total
+        this.tableData = res.Content
       })
     },
     init() {
@@ -221,7 +238,7 @@ export default {
 </script>
 
 <style lang='less' scoped>
-.log-main{
+.log-main {
   height: 100%;
   background: #fff;
   .condition {
@@ -231,7 +248,7 @@ export default {
       margin-right: 10px;
     }
   }
-  .log-table{
+  .log-table {
     border-top: 2px solid #dfe6ec;
     height: calc(100% - 100px);
     .ellipsis {