graphyTabs.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551
  1. <!--
  2. setFalg 插旗事件
  3. getLocation 定位
  4. -->
  5. <template>
  6. <div id="graphy-tabs">
  7. <el-tabs style="height:100%;" v-model="activeName2" type="card" @tab-click="handleClick">
  8. <el-tab-pane label="本层的点位标签" name="point" style="height:100%">
  9. <el-scrollbar style="height:100%;width:calc(100% - 10px);" v-if="pointData.length" v-loading="isLoading">
  10. <div v-for="(item,index) in pointData" :key="index">
  11. <div class="point">
  12. <span style="line-height:30px;">{{item.Name}}</span>
  13. <div style="height:30px;float:right;font-size:14px;">
  14. <el-button size="mini" @click="getDetails(item)" icon="el-icon-edit-outline"></el-button>
  15. <el-button size="mini" @click="updateOrCreate(item)" icon="el-icon-link"></el-button>
  16. <el-button :disabled="!map" size="mini" @click="btnClick(item)"
  17. :icon="item.X == 0 && item.Y == 0 ? 'el-icon-s-flag' : 'el-icon-place'"></el-button>
  18. </div>
  19. </div>
  20. </div>
  21. </el-scrollbar>
  22. <div v-if="!pointData.length" class="center" style="height: 400px;padding-top: 260px; box-sizing:border-box;">
  23. <i class="icon-wushuju iconfont"></i>
  24. {{pointParam.FloorId ? "数据为空" : "请选择楼层"}}
  25. </div>
  26. </el-tab-pane>
  27. <el-tab-pane label="无法定位到楼层的点位标签" name="noPoint">
  28. <div v-if="pointNoData.length" v-loading="isLoading" style="max-height: 600px;">
  29. <div v-for="(item,index) in pointNoData" :key="index">
  30. <div class="point">
  31. <span>{{item.Name}}</span>
  32. <el-button size="mini" @click="getDetails(item)" icon="el-icon-edit-outline"></el-button>
  33. <el-button :disabled="!map" size="mini" @click="btnClick(item)"
  34. :icon="item.X == 0 && item.Y == 0 ? 'el-icon-s-flag' : 'el-icon-place'"></el-button>
  35. </div>
  36. </div>
  37. </div>
  38. <div v-if="!pointNoData.length" class="center" style="height: 400px;padding-top: 260px; box-sizing:border-box;">
  39. <i class="icon-wushuju iconfont"></i>
  40. {{pointParam.FloorId ? "数据为空" : "请选择楼层"}}
  41. </div>
  42. </el-tab-pane>
  43. </el-tabs>
  44. <el-dialog title="详情" :visible.sync="pointShow" width="500px">
  45. <div class="qrcode">
  46. <div class="qrcode-view">
  47. <img
  48. :src="'/ScanBuilding/service/qrcode/point?projectId=' + projectId + '&pointId=' + pointDetails.PointId + '&FloorId=' + pointDetails.FloorId + '&width=200&height=200'"
  49. alt="点位标签二维码">
  50. </div>
  51. <div class="point-edit">
  52. <p>
  53. 点位标签的现场位置:{{activeName2 != 'point' ? '无楼层' : pointParam.fllorName}}
  54. -{{pointDetails.spaceName || '未知原空间'}}
  55. -({{pointDetails.X}},{{pointDetails.Y}})
  56. </p>
  57. <div>
  58. <form-input :width="100" @change="changeInput" :value="pointDetails.PointName" :keys="'PointName'" :label="'点位标签'" :isRule="false">
  59. </form-input>
  60. <form-input :width="100" @change="changeInput" :value="pointDetails.PointLocalId" :keys="'PointLocalId'" :label="'点位本地编码'"
  61. :isRule="false"></form-input>
  62. <!-- <form-input></form-input> -->
  63. </div>
  64. </div>
  65. </div>
  66. <div class="point-coding">
  67. <p>编码及关系</p>
  68. <ul>
  69. <li>
  70. <span>点位标签ID</span>
  71. <span>{{pointDetails.PointId}}</span>
  72. </li>
  73. <li>
  74. <span>模型ID</span>
  75. <span>{{pointDetails.BimId || '暂无'}}</span>
  76. </li>
  77. </ul>
  78. </div>
  79. <div class="point-coding">
  80. <p>基本信息</p>
  81. <ul>
  82. <li>
  83. <span>信标类型</span>
  84. <span>二维码</span>
  85. </li>
  86. <li>
  87. <span>备注</span>
  88. <span>
  89. <form-input :width="0" @change="changeInput" :value="pointDetails.Note" :keys="'Note'" :label="''" :isRule="false"></form-input>
  90. </span>
  91. </li>
  92. </ul>
  93. </div>
  94. <div class="point-pic">
  95. <p>点位安装位置效果照片</p>
  96. <template v-for="(item,index) in installPic">
  97. <div class="point-image" :key="index">
  98. <i class="el-icon-delete" @click="delImage(index,installPic)"></i>
  99. <img :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200&height=200'" alt>
  100. </div>
  101. </template>
  102. <load-img keyName="安装位置" @getKey="getKey"></load-img>
  103. </div>
  104. <div class="point-pic">
  105. <p>全景照片</p>
  106. <template v-for="(item,index) in panorama">
  107. <div class="point-image" :key="index">
  108. <i class="el-icon-delete" @click="delImage(index,panorama)"></i>
  109. <img :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200&height=200'" alt>
  110. </div>
  111. </template>
  112. <load-img keyName="全景照片" @getKey="getKey"></load-img>
  113. </div>
  114. <div class="point-pic">
  115. <p>周边照片</p>
  116. <template v-for="(item,index) in rimPic">
  117. <div class="point-image" :key="index">
  118. <i class="el-icon-delete" @click="delImage(index,rimPic)"></i>
  119. <img :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200&height=200'" alt>
  120. </div>
  121. </template>
  122. <load-img keyName="周边照片" @getKey="getKey"></load-img>
  123. </div>
  124. <div class="point-pic">
  125. <p>视频资料</p>
  126. <template v-for="(item,index) in videoPic">
  127. <div class="point-image" :key="index">
  128. <i class="el-icon-delete" @click="delImage(index,videoPic)"></i>
  129. <img :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200&height=200'" alt>
  130. </div>
  131. </template>
  132. <load-img keyName="视频" @getKey="getKey"></load-img>
  133. </div>
  134. <div class="point-pic">
  135. <p>其他照片</p>
  136. <template v-for="(item,index) in elsePic">
  137. <div class="point-image" :key="index">
  138. <i class="el-icon-delete" @click="delImage(index,elsePic)"></i>
  139. <img :src="'/image-service/common/image_get?systemId=dataPlatform&key='+ item.key +'&width=200&height=200'" alt>
  140. </div>
  141. </template>
  142. <load-img keyName="其他照片" @getKey="getKey"></load-img>
  143. </div>
  144. </el-dialog>
  145. </div>
  146. </template>
  147. <script>
  148. import {
  149. locationPointQuery, //获取点位列表
  150. getPoint, //获取点位详情
  151. updateLocationPoint, //修改点位
  152. deleteLocationImg,//数据中心删除图片
  153. } from "@/api/scan/request";
  154. import formInput from "./lib/formInput";
  155. import loadImg from "./lib/uploadImg";
  156. import {
  157. mapGetters,
  158. mapActions
  159. } from 'vuex';
  160. export default {
  161. props: {
  162. pointParam: {
  163. type: Object
  164. },
  165. floorOption: {//建筑楼层
  166. Type: Array,
  167. default: () => []
  168. },
  169. },
  170. components: {
  171. formInput,
  172. loadImg
  173. },
  174. data() {
  175. return {
  176. activeName2: "point",
  177. pointData: [], //tab为本层的点位标签
  178. pointNoData: [], //tab为无法定位的点位标签
  179. pointShow: false, //标签详情的弹窗
  180. pointDetails: {}, //标签详情信息对象
  181. // projId: this.$route.query.projId,
  182. index: "",
  183. installPic: [], //安装位置
  184. panorama: [], //全景照片
  185. rimPic: [], //周边照片
  186. videoPic: [], //视频资料
  187. elsePic: [], //其他照片
  188. map: true,
  189. buildingData: [],//建筑楼层信息
  190. };
  191. },
  192. computed: {
  193. ...mapGetters('layout', ['projectId', 'secret', 'userId'])
  194. },
  195. methods: {
  196. //tabs被点击
  197. handleClick(tab, event) {
  198. this.index = tab.index;
  199. this.getPointList();
  200. },
  201. //修改input
  202. changeInput(val, key) {
  203. this.pointDetails[key] = val;
  204. this.updatePoint();
  205. },
  206. //删除图片
  207. delImage(index, arr) {
  208. let delArr = arr.splice(index, 1);
  209. deleteLocationImg(delArr, res => {
  210. this.$message.success("修改成功");
  211. })
  212. },
  213. //获取key的值
  214. getKey(val, name) {
  215. switch (name) {
  216. case "安装位置":
  217. this.installPic.push({
  218. key: val,
  219. name: name,
  220. type: "image_wz"
  221. });
  222. break;
  223. case "全景照片":
  224. this.panorama.push({
  225. key: val,
  226. name: name,
  227. type: "panorama"
  228. });
  229. break;
  230. case "周边照片":
  231. this.rimPic.push({
  232. key: val,
  233. name: name,
  234. type: "image_zb"
  235. });
  236. break;
  237. case "视频":
  238. this.videoPic.push({
  239. key: val,
  240. name: name,
  241. type: "video"
  242. });
  243. break;
  244. default:
  245. this.elsePic.push({
  246. key: val,
  247. name: name,
  248. type: "image_else"
  249. });
  250. }
  251. this.updatePoint();
  252. },
  253. //创建或更新
  254. updateOrCreate(item) {
  255. this.$confirm('更新:将位置标签图片填充到已有的业务空间中<br>创建:新建业务空间,并将位置标签图片和信息填充到新业务空间中', '创建/更新业务空间信息', {
  256. dangerouslyUseHTMLString: true,
  257. distinguishCancelAndClose: true,
  258. confirmButtonText: '更新',
  259. cancelButtonText: '创建'
  260. }).then(() => {
  261. this.$emit("closeCanvas")
  262. this.$router.push({
  263. name: 'updatePointZone',
  264. params: { item: item, floorData: this.floorOption, nowBuildFloor: this.buildingData }
  265. })
  266. }).catch(action => {
  267. if (action === 'cancel') {
  268. this.$router.push({
  269. name: 'createPointZone',
  270. params: { item: item, floorData: this.floorOption, nowBuildFloor: this.buildingData }
  271. })
  272. }
  273. })
  274. },
  275. btnClick(item) {
  276. if (item.X == 0 && item.Y == 0) {
  277. this.$emit("setFalg", item);
  278. } else {
  279. this.$emit("getLocation", item);
  280. }
  281. },
  282. mapPush(detailsArr, pic) {
  283. pic.map(item => {
  284. detailsArr.push(item);
  285. });
  286. },
  287. //修改详情
  288. updatePoint() {
  289. this.pointDetails.ImageList = [];
  290. this.mapPush(this.pointDetails.ImageList, this.installPic);
  291. this.mapPush(this.pointDetails.ImageList, this.panorama);
  292. this.mapPush(this.pointDetails.ImageList, this.rimPic);
  293. this.mapPush(this.pointDetails.ImageList, this.videoPic);
  294. this.mapPush(this.pointDetails.ImageList, this.elsePic);
  295. let pa = {
  296. Content: [this.pointDetails]
  297. }
  298. updateLocationPoint(pa, res => {
  299. this.$message.success("修改成功");
  300. })
  301. },
  302. getDetails(item) {
  303. this.pointShow = true;
  304. this.pointDetails = item;
  305. if (item.ImageList && item.ImageList.length) {
  306. this.getPic(item.ImageList);
  307. }
  308. },
  309. getPic(imgArr) {
  310. this.installPic = [];
  311. this.panorama = [];
  312. this.rimPic = [];
  313. this.videoPic = [];
  314. this.elsePic = [];
  315. imgArr.map((item, index) => {
  316. switch (item.name) {
  317. case "安装位置":
  318. this.installPic.push(item);
  319. break;
  320. case "全景照片":
  321. this.panorama.push(item);
  322. break;
  323. case "周边照片":
  324. this.rimPic.push(item);
  325. break;
  326. case "视频":
  327. this.videoPic.push(item);
  328. break;
  329. default:
  330. this.elsePic.push(item);
  331. }
  332. });
  333. },
  334. //获取point
  335. getPointList() {
  336. if (this.buildingData[0] && this.buildingData[1]) {
  337. let param = {
  338. Filters: `BuildId='${this.buildingData[0]}';floorId='${this.buildingData[1]}'`,
  339. "Cascade": [{ "Name": "imageList" }]
  340. };
  341. if (this.index == "1") {
  342. param.Filters = `BuildId='${this.buildingData[0]}';floorId isNull`
  343. }
  344. this.isLoading = true;
  345. locationPointQuery(param, res => {
  346. this.isLoading = false;
  347. if (this.index == "1") {
  348. this.pointNoData = res.Content;
  349. }
  350. else {
  351. this.pointData = res.Content;
  352. }
  353. this.$emit("getPointList", res.Content);
  354. })
  355. }
  356. },
  357. //初始化
  358. reset(data, map) {
  359. this.map = map
  360. this.pointParam.FloorId = data.FloorId;
  361. this.pointParam.fllorName = data.fllorName;
  362. this.buildingData = data.buildingData;
  363. this.activeName2 = "point";
  364. this.getPointList();
  365. }
  366. },
  367. watch: {
  368. pointShow: {
  369. deep: true,
  370. handler: function (old, val) {
  371. if (old == false && val == true) {
  372. this.getPointList();
  373. }
  374. }
  375. },
  376. projectId() {
  377. this.pointData = []
  378. this.pointNoData = []
  379. this.activeName2 = "point"
  380. }
  381. }
  382. };
  383. </script>
  384. <style lang="scss" scoped>
  385. #graphy-tabs {
  386. /deep/ .el-scrollbar__wrap {
  387. overflow-x: hidden;
  388. }
  389. /deep/ .el-tabs__content {
  390. height: calc(100% - 56px);
  391. }
  392. height: 100%;
  393. border-left: 1px solid #e4e7ed;
  394. .el-tabs__content {
  395. height: calc(100% - 60px) !important;
  396. background: red;
  397. }
  398. .el-dialog__body {
  399. max-height: 400px;
  400. }
  401. .saga-message {
  402. height: calc(100vh - 220px);
  403. line-height: 400px;
  404. color: #ccc;
  405. font-size: 24px;
  406. text-align: center;
  407. }
  408. .point {
  409. padding-left: 20px;
  410. height: 30px;
  411. span {
  412. font-size: 12px;
  413. width: 180px;
  414. display: inline-block;
  415. white-space: nowrap;
  416. text-overflow: ellipsis;
  417. overflow: hidden;
  418. }
  419. button {
  420. margin-bottom: 5px;
  421. }
  422. }
  423. .point:hover {
  424. background-color: #f2f6fc;
  425. }
  426. .qrcode {
  427. width: 100%;
  428. height: 180px;
  429. overflow: hidden;
  430. .qrcode-view {
  431. width: 180px;
  432. height: 180px;
  433. overflow: hidden;
  434. float: left;
  435. img {
  436. width: 100%;
  437. height: 100%;
  438. }
  439. }
  440. .point-edit {
  441. height: 180px;
  442. display: inline-block;
  443. padding-top: 10px;
  444. overflow-x: hidden;
  445. width: calc(100% - 180px);
  446. }
  447. }
  448. .point-coding {
  449. width: 100%;
  450. height: 120px;
  451. margin-top: 5px;
  452. overflow: hidden;
  453. p {
  454. height: 30px;
  455. line-height: 30px;
  456. padding-left: 10px;
  457. font-weight: 500;
  458. font-size: 16px;
  459. text-align: left;
  460. }
  461. ul {
  462. width: 100%;
  463. border: 1px solid #ccc;
  464. border-bottom: none;
  465. box-sizing: border-box;
  466. li {
  467. line-height: 40px;
  468. height: 40px;
  469. span {
  470. display: block;
  471. float: left;
  472. padding-left: 10px;
  473. box-sizing: border-box;
  474. border-right: 1px solid #ccc;
  475. border-bottom: 1px solid #ccc;
  476. border-left: 1px solid #ccc;
  477. height: 40px;
  478. overflow: hidden;
  479. }
  480. span:first-child {
  481. width: 30%;
  482. }
  483. span:last-child {
  484. width: 70%;
  485. }
  486. }
  487. }
  488. }
  489. .point-pic {
  490. width: 100%;
  491. overflow: hidden;
  492. p {
  493. height: 25px;
  494. line-height: 25px;
  495. padding-left: 10px;
  496. font-weight: 500;
  497. font-size: 16px;
  498. margin-top: 5px;
  499. margin-bottom: 5px;
  500. }
  501. }
  502. .point-image {
  503. width: 180px;
  504. height: 180px;
  505. float: left;
  506. position: relative;
  507. margin-right: 10px;
  508. margin-bottom: 10px;
  509. border: 1px solid #ccc;
  510. img {
  511. width: 100%;
  512. height: 100%;
  513. }
  514. i {
  515. position: absolute;
  516. bottom: 10px;
  517. right: 10px;
  518. background-color: #fff;
  519. padding: 5px;
  520. cursor: pointer;
  521. }
  522. }
  523. }
  524. </style>