123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371 |
- <template>
-
- <div class="box">
- <div class="content-box" v-for="(item,index) in pageData" :key="index">
- <div class="content-top">
- <div class="details">
- <h4>{{index | numTransformation(4)}}<el-badge value="待删除" class="item"></el-badge>
- </h4>
- <h4>{{`${item.BuildingName}建筑模型`}}-{{`${item.FloorName}层`}}-{{`${item.EquipLocalName?item.EquipLocalName:item.EquipName}`}}</h4>
- <b>BIM ID:<span @dblclick="copyContent" id="copy">{{item.ScanTaskBase[0].BIMID | bimIdTransformation}}</span></b><span class="copy"
- @click="clickCopy">点击复制</span>
- <input id="copyContent" type="text" @dblclick="copyContent" style="border:none;opacity:0;position:absolute;top:0;left:0;">
- <p style="margin-top:30px;">Revit族:{{item.BIMFamilyName}}</p>
- <p>设计图纸中编码:{{item.CADID}}</p>
- <p><span>设备类型:{{item.Category}}</span><span>设备ID:{{item.EquipLocalID}}</span></p>
- <p><span v-if="item.Property && item.Property.FamilyName">资产族:{{item.Property.FamilyName.Name}}</span><span
- v-if="item.PropertyId">关联的资产ID:{{item.PropertyId}}</span></p>
- <p>现场任务ID:{{item.ScanTaskBase[0].TaskId}}</p>
- <p><span>执行人:{{item.ScanTaskBase[0].WorkerName}}</span><span>确认人:{{item.ScanTaskBase[0].ConfirmingPersonName}}</span></p>
- </div>
- <div class="plan">
- <p>平面图上的位置:<span>{{item.local | localTransformation}}</span></p>
- <div class="img-box">
- <canvas :id="'canvas'+index" :width="canvasWidth" :height="canvasHeight" ref="canvas" tabindex="0" :data-modelid="item.ModelId"
- :data-EquipID='item.EquipID' :data-x="item.local.X" :data-y="item.local.Y"></canvas>
- </div>
- </div>
- </div>
- <div class="content-bottom">
- <div class="explain" v-if="item.ScanTaskBase[0].Note">
- <p>现场问题说明:</p>
- <el-scrollbar>
- <p class="explain-content">
- <el-scrollbar>
- {{item.ScanTaskBase[0].Note}}
- </el-scrollbar>
- </p>
- </el-scrollbar>
- </div>
- <div class="photo" v-for="(it,ind) in item.ScanTaskBase[0].TaskPicList" :key='ind'>
- <div class="img-box">
- <p>{{it.Name}}<span>拍摄时间:{{it.CreateTime | timeTransformation}}</span></p>
- <div class="img-content">
- <img :src="`/image-service/common/image_get?systemId=dataPlatform&key=${it.key}`" alt="现场拍摄照片">
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script>
- import { mapGetters } from "vuex";
- import { toBeDelEquipPage } from "@/api/scan/request.js";
- import { LocationPointScene, FloorView } from "@saga-web/cad-engine/lib";
- export default {
- components: {
- },
- data() {
- return {
- pageData: [],
- count: 0,
- equipComDelList: null,
- page: {
- pageSize: 50,
- pageSizes: [10, 20, 50, 100],
- pageNumber: 1,
- total: 0
- },
- canvasWidth: 400,
- canvasHeight: 280,
- i: 0,
- scene: '',
- view: '',
- }
- },
- mounted() { },
- created() {
- this.equipComDelList = decodeURIComponent(this.$route.query.equipComDelList);
- this.queryToBelDelEquip();
- },
- computed: {
- ...mapGetters('layout', ['projectId'])
- },
- filters: {
- numTransformation(num, length) {
- num = Number(num + 1)
- return (Array(length).join('0') + num).slice(-length);
- },
- bimIdTransformation(bimId) {
- let ary = bimId.split(":");
- return ary[1];
- },
- localTransformation(local) {
- let str = "";
- for (let key in local) {
- if (key !== "Z") {
- str += key + ':' + local[key] + ',';
- } else {
- str += key + ':' + local[key];
- }
- }
- return str;
- },
- timeTransformation(time) {
- time = time.substring(0, 16)
- return time;
-
-
-
-
-
-
-
-
-
-
-
- }
- },
- methods: {
- copyContent(element) {
-
- let content = element.target.innerText;
- let inputObj = document.getElementById('copyContent');
- inputObj.value = content;
- inputObj.select();
- document.execCommand("Copy");
- this.$message({
- message: '复制成功',
- type: 'success',
- duration: 1000
- });
- },
- clickCopy() {
-
- let target = document.getElementById('copy');
- let content = target.innerText;
- let inputObj = document.getElementById('copyContent');
- inputObj.value = content;
- inputObj.select();
- document.execCommand("Copy");
- this.$message({
- message: '复制成功',
- type: 'success',
- duration: 1000
- });
- },
- queryToBelDelEquip() {
- let params = {
- ProjectId: this.projectId,
- Cascade: [
- {
- Name: "scanTaskBase",
- Filters: 'TaskState=0',
- Orders: "CreateTime desc",
- },
- {
- Name: "property",
- Cascade: [
- {
- Name: "familyName"
- }
- ]
- },
- {
- Name: "equipCategory"
- }
- ],
- Filters: `ModelId in ${this.equipComDelList}`,
- PageNumber: this.page.pageNumber,
- PageSize: this.page.pageSize
- }
- toBeDelEquipPage(params, res => {
- this.pageData = res.Content;
- this.pageData.forEach(item => {
- if (item.BIMLocation) {
- let local = {};
- let ary = item.BIMLocation.split(',');
- let localAry = ['X', 'Y', 'Z'];
- ary.forEach((item, index) => {
- local[localAry[index]] = ary[index];
- })
- item.local = local;
- }
- if (item.ScanTaskBase && item.ScanTaskBase.length > 1) {
- item.ScanTaskBase = item.ScanTaskBase.shift();
- }
- });
- this.$nextTick(() => {
- this.getGraphy();
- })
- })
- },
- getGraphy() {
- let can = this.$refs.canvas;
- let that = this;
- that.clearGraphy(this.i)
- that.scene = new LocationPointScene();
- this.canvasLoading = true;
- that.scene.getFloorData('/modelapi/base-graph/query', { ModelId: can[this.i].dataset.modelid }).then(res => {
- that.canvasLoading = false;
- if (res == 'error') {
- this.FloorMap = '';
- this.$message.warning('数据解析异常');
- return;
- }
- let modelID = can[this.i].dataset.modelid
- let EquipID = can[this.i].dataset.equipid;
- let X = Number(can[this.i].dataset.x);
- let Y = can[this.i].dataset.y * -1;
-
- that.view.scene = that.scene;
- this.scene.addMarker({
- Id: EquipID,
- X: X,
- Y: Y
- })
- that.view.fitSceneToView();
- this.scene.isSpaceSelectable = false;
- this.i++;
- })
- },
- clearGraphy(i) {
-
-
-
-
- this.view = new FloorView(`canvas${i}`)
- }
- },
- watch: {
- i() {
- if (this.i >= this.pageData.length) {
- return;
- }
- this.getGraphy();
- }
- }
- }
- </script>
- <style lang="less" scoped>
- // 取消打印功能默认的左右边距
- @media print {
- @page {
- margin-left: 0;
- margin-right: 0;
- }
- }
- .box {
- background: #f2f2f2;
- margin: 0 auto;
- height: 100%;
- overflow-y: auto;
- ul {
- .infinite-list-item {
- margin-bottom: 20px;
- }
- }
- .content-box {
- width: 1000px;
- margin: 0 auto;
- background: white;
- padding: 10px 4px 10px 20px;
- box-sizing: border-box;
- .content-top {
- display: flex;
- div {
- flex: 1;
- }
- .details {
- margin-right: 10px;
- .el-badge {
- margin: 10px 0 0 10px;
- }
- p {
- margin-top: 4px;
- span:nth-child(1) {
- display: inline-block;
- width: 200px;
- }
- }
- .copy {
- color: #409eff;
- margin-left: 20px;
- }
- }
- .plan {
- padding-left: 20px;
- box-sizing: border-box;
- p {
- width: 100%;
- margin: 10px 0 10px 0;
- span {
- float: right;
- padding-right: 20px;
- box-sizing: border-box;
- }
- }
- }
- }
- .content-bottom {
- width: 100%;
- margin-top: 20px;
- overflow: hidden;
- .photo,
- .explain {
- float: left;
- width: 50%;
- }
- .photo {
- box-sizing: border-box;
- margin-bottom: 24px;
- p {
- margin-bottom: 10px;
- }
- span {
- float: right;
- padding-right: 20px;
- box-sizing: border-box;
- }
- }
- .explain {
- padding-right: 20px;
- box-sizing: border-box;
- .el-scrollbar {
- background: #f2f2f2;
- }
- p {
- margin-bottom: 10px;
- }
- .explain-content {
- padding: 10px;
- width: 100%;
- height: 290px;
- box-sizing: border-box;
- }
- }
- }
- }
- }
- .img-box {
- width: 100%;
- .img-content {
- overflow: hidden;
- position: relative;
- width: calc(100%-20px);
- height: 300px;
- vertical-align: middle;
- text-align: center;
- background: #ebeef5;
- margin-right: 20px;
- img {
- position: absolute;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- width: 400px;
- height: 100%;
- vertical-align: middle;
- }
- }
- }
- canvas {
- position: static !important;
- }
- </style>
|