deleted.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. <template>
  2. <!-- 待删除页面 -->
  3. <div class="box">
  4. <ul class="infinite-list" v-infinite-scroll="load" style="overflow:auto">
  5. <li class="infinite-list-item" v-for="(item,index) in pageData" :key="index">
  6. <div class="content-box">
  7. <div class="content-top">
  8. <div class="details">
  9. <h4>{{index | numTransformation(4)}}<el-badge value="待删除" class="item"></el-badge>
  10. </h4>
  11. <h4>{{`${item.BuildingName}建筑模型`}}-{{`${item.FloorName}层`}}-{{`${item.EquipLocalName?item.EquipLocalName:item.EquipName}`}}</h4>
  12. <b>BIM ID:<span @dblclick="copyContent" id="copy">{{item.ScanTaskBase[0].BIMID | bimIdTransformation}}</span></b><span class="copy"
  13. @click="clickCopy">点击复制</span>
  14. <input id="copyContent" type="text" @dblclick="copyContent" style="border:none;opacity:0;position:absolute;top:0;left:0;">
  15. <p style="margin-top:30px;">Revit族:{{item.BIMFamilyName}}</p>
  16. <p>设计图纸中编码:{{item.CADID}}</p>
  17. <p><span>设备类型:{{item.Category}}</span><span>设备ID:{{item.EquipLocalID}}</span></p>
  18. <p><span v-if="item.Property && item.Property.FamilyName">资产族:{{item.Property.FamilyName.Name}}</span><span
  19. v-if="item.PropertyId">关联的资产ID:{{item.PropertyId}}</span></p>
  20. <p>现场任务ID:{{item.ScanTaskBase[0].TaskId}}</p>
  21. <p><span>执行人:{{item.ScanTaskBase[0].WorkerName}}</span><span>确认人:{{item.ScanTaskBase[0].ConfirmingPersonName}}</span></p>
  22. </div>
  23. <div class="plan">
  24. <p>平面图上的位置:<span>{{item.local | localTransformation}}</span></p>
  25. <div class="img-box">
  26. <canvas id="floorCanvas" :width="canvasWidth" :height="canvasHeight" ref="canvas" tabindex="0"></canvas>
  27. </div>
  28. </div>
  29. </div>
  30. <div class="content-bottom">
  31. <div class="explain">
  32. <p>现场问题说明:</p>
  33. <el-scrollbar>
  34. <p class="explain-content">
  35. <el-scrollbar>
  36. {{item.ScanTaskBase[0].Note?item.ScanTaskBase[0].Note:'暂无说明'}}
  37. </el-scrollbar>
  38. </p>
  39. </el-scrollbar>
  40. </div>
  41. <div class="photo" v-for="(it,ind) in item.ScanTaskBase[0].TaskPicList" :key='ind'>
  42. <p>{{it.Name}}<span>拍摄时间:{{it.CreateTime | timeTransformation}}</span></p>
  43. <div class="img-box">
  44. {{it.Key}}
  45. <img :src="`/image-service/common/image_get?systemId=dataPlatform&key=${it.Key}`" alt="现场拍摄照片">
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. </li>
  51. </ul>
  52. </div>
  53. </template>
  54. <script>
  55. import { mapGetters } from "vuex";
  56. import { toBeDelEquipPage } from "@/api/scan/request.js";
  57. export default {
  58. components: {
  59. },
  60. data() {
  61. return {
  62. pageData: [],
  63. count: 0,
  64. equipComDelList: null,
  65. page: {
  66. pageSize: 50,
  67. pageSizes: [10, 20, 50, 100],
  68. pageNumber: 1,
  69. total: 0
  70. },
  71. canvasWidth: 400,
  72. canvasHeight: 300,
  73. }
  74. },
  75. mounted() { },
  76. created() {
  77. this.PageSetup();
  78. this.equipComDelList = decodeURIComponent(this.$route.query.equipComDelList);
  79. this.queryToBelDelEquip();
  80. },
  81. computed: {
  82. ...mapGetters('layout', ['projectId'])
  83. },
  84. filters: {
  85. numTransformation(num, length) {// 序列号转换为4位
  86. num = Number(num + 1)
  87. return (Array(length).join('0') + num).slice(-length);
  88. },
  89. bimIdTransformation(bimId) {// bimID转换
  90. let ary = bimId.split(":");
  91. return ary[1];
  92. },
  93. localTransformation(local) {// 转换坐标
  94. let str = "";
  95. for (let key in local) {
  96. if (key !== "Z") {
  97. str += key + ':' + local[key] + ',';
  98. } else {
  99. str += key + ':' + local[key];
  100. }
  101. }
  102. return str;
  103. },
  104. timeTransformation(time) {
  105. time = time.replace(/(\d+)\-(\d+)\-(\d+)\ (\d+)\:(\d+)\:(\d+)/, function () {
  106. let str = '';
  107. let ary = ['年', '月', '日', '时', '分'];
  108. let time = Array.prototype.concat.apply([], arguments);
  109. time = time.splice(1, 5);
  110. time.forEach((item, index) => {
  111. str += item + ary[index];
  112. })
  113. return str;
  114. })
  115. return time;
  116. }
  117. },
  118. methods: {
  119. load() {
  120. this.count += 2
  121. },
  122. copyContent(element) {
  123. // 双击复制
  124. let content = element.target.innerText;
  125. let inputObj = document.getElementById('copyContent');
  126. inputObj.value = content;
  127. inputObj.select();
  128. document.execCommand("Copy");
  129. this.$message({
  130. message: '复制成功',
  131. type: 'success',
  132. duration: 1000
  133. });
  134. },
  135. clickCopy() {
  136. // 点击复制
  137. let target = document.getElementById('copy');
  138. let content = target.innerText;
  139. let inputObj = document.getElementById('copyContent');
  140. inputObj.value = content;
  141. inputObj.select();
  142. document.execCommand("Copy");
  143. this.$message({
  144. message: '复制成功',
  145. type: 'success',
  146. duration: 1000
  147. });
  148. },
  149. queryToBelDelEquip() {// 请求待删除数据
  150. let params = {
  151. ProjectId: this.projectId,
  152. Cascade: [
  153. {
  154. Name: "scanTaskBase",// 级联-任务
  155. Filters: 'TaskState=0',
  156. Orders: "CreateTime desc",
  157. },
  158. {
  159. Name: "property",// 级联-资产
  160. Cascade: [
  161. {
  162. Name: "familyName"
  163. }
  164. ]
  165. },
  166. {
  167. Name: "equipCategory"// 级联-设备类型
  168. }
  169. ],
  170. Filters: `ModelId in ${this.equipComDelList}`,
  171. PageNumber: this.page.pageNumber,
  172. PageSize: this.page.pageSize
  173. }
  174. toBeDelEquipPage(params, res => {
  175. this.pageData = res.Content;
  176. console.log(this.pageData, 121)
  177. this.pageData.forEach(item => {
  178. if (item.BIMLocation) {
  179. let local = {};
  180. let ary = item.BIMLocation.split(',');
  181. let localAry = ['X', 'Y', 'Z'];
  182. ary.forEach((item, index) => {
  183. local[localAry[index]] = ary[index];
  184. })
  185. item.local = local;
  186. }
  187. if (item.ScanTaskBase && item.ScanTaskBase.length > 1) {
  188. item.ScanTaskBase = item.ScanTaskBase.shift();
  189. }
  190. });
  191. })
  192. },
  193. getGraphy() {// 绘制空间位置图片
  194. let that = this;
  195. that.clearGraphy()
  196. that.scene = new DivideFloorScene();
  197. this.canvasLoading = true;
  198. that.scene.loadUrl(`/image-service/common/file_get?systemId=revit&key=${this.FloorMap}`).then(res => {
  199. that.canvasLoading = false;
  200. if (res == 'error') {
  201. this.FloorMap = '';
  202. this.$message.warning('数据解析异常');
  203. return;
  204. }
  205. that.view.scene = that.scene;
  206. that.view.fitSceneToView();
  207. let tempArr = {
  208. RoomLocalName: this.spaceDetails.RoomLocalName,
  209. OutLine: this.spaceDetails.Outline,
  210. RoomID: this.spaceDetails.RoomID,
  211. Color: "#a384fc",
  212. }
  213. that.scene.addZoneList([tempArr]);
  214. this.scene.isSpaceSelectable = false;
  215. })
  216. },
  217. clearGraphy() {
  218. if (this.view && this.view.scene) {
  219. this.view.scene = null;
  220. return
  221. }
  222. this.view = new FloorView('floorCanvas')
  223. },
  224. PageSetup() {
  225. }
  226. }
  227. }
  228. </script>
  229. <style lang="less" scoped>
  230. // 取消打印功能默认的左右边距
  231. @media print {
  232. @page {
  233. margin-left: 0;
  234. margin-right: 0;
  235. }
  236. }
  237. .box {
  238. background: #f2f2f2;
  239. margin: 0 auto;
  240. ul {
  241. .infinite-list-item {
  242. margin-bottom: 20px;
  243. }
  244. }
  245. .content-box {
  246. width: 1000px;
  247. margin: 0 auto;
  248. background: white;
  249. padding: 10px 4px 10px 20px;
  250. box-sizing: border-box;
  251. .content-top {
  252. display: flex;
  253. div {
  254. flex: 1;
  255. }
  256. .details {
  257. margin-right: 10px;
  258. .el-badge {
  259. margin: 10px 0 0 10px;
  260. }
  261. p {
  262. margin-top: 4px;
  263. span:nth-child(1) {
  264. display: inline-block;
  265. width: 200px;
  266. }
  267. }
  268. .copy {
  269. color: #409eff;
  270. margin-left: 20px;
  271. }
  272. }
  273. .plan {
  274. padding-left: 20px;
  275. box-sizing: border-box;
  276. p {
  277. width: 100%;
  278. margin: 10px 0 10px 0;
  279. span {
  280. float: right;
  281. padding-right: 20px;
  282. box-sizing: border-box;
  283. }
  284. }
  285. }
  286. }
  287. .content-bottom {
  288. width: 100%;
  289. margin-top: 20px;
  290. overflow: hidden;
  291. .photo,
  292. .explain {
  293. float: left;
  294. width: 50%;
  295. }
  296. .photo {
  297. box-sizing: border-box;
  298. margin-bottom: 24px;
  299. p {
  300. margin-bottom: 10px;
  301. }
  302. span {
  303. float: right;
  304. padding-right: 20px;
  305. box-sizing: border-box;
  306. }
  307. }
  308. .explain {
  309. padding-right: 20px;
  310. box-sizing: border-box;
  311. .el-scrollbar {
  312. background: #f2f2f2;
  313. }
  314. p {
  315. margin-bottom: 10px;
  316. }
  317. .explain-content {
  318. padding: 10px;
  319. width: 100%;
  320. height: 290px;
  321. box-sizing: border-box;
  322. }
  323. }
  324. }
  325. }
  326. }
  327. .img-box {
  328. width: 100%;
  329. // text-align: center;
  330. img {
  331. vertical-align: middle;
  332. width: 400px;
  333. height: 300px;
  334. }
  335. }
  336. </style>