index.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  1. /**
  2. *@author:Guoxiaohuan
  3. *@date:2020.05.26
  4. *@info 项目概况主页
  5. */
  6. <template>
  7. <div class='overview'>
  8. <div class='view-title'>
  9. <nav>
  10. <span></span>
  11. <span>项目基本信息</span>
  12. </nav>
  13. <!-- <el-button type='info' plain disabled> -->
  14. <div title='数字化移交系统上线后可用'>
  15. <div class='view-button' :disabled='true' @click='findxmzl'>
  16. <img src='../../assets/imgs/wd.png' alt />
  17. 项目资料
  18. </div>
  19. </div>
  20. <!-- </el-button> -->
  21. </div>
  22. <div class='view-box'>
  23. <div class='view-left'>
  24. <div class='lb-left'>
  25. <div v-if='pic2.length>0' style='height:100%'>
  26. <rotation :key='2' type='2' :rotationImg='pic2' @scan='scan'></rotation>
  27. <div class='lb-icon' @click='picClick("2")'></div>
  28. <img class='lb-img' @click='picClick("2")' src='../../assets/imgs/zk.png' alt />
  29. </div>
  30. <img v-else class='lb-left-noImg' src='@/assets/imgs/nkt.jpg' alt />
  31. </div>
  32. <div class='lb-bottom'>
  33. <nav>
  34. <span></span>
  35. <span>建筑综合信息</span>
  36. </nav>
  37. <!-- <p class='place-p1'>
  38. <span>
  39. <img src='@/assets/imgs/jz.png' alt />
  40. {{build.length>0?formatter('项目名称',build):'--'}}
  41. </span>
  42. </p>-->
  43. <p class='place-p2'>
  44. <span>
  45. <img src='@/assets/imgs/didian.png' alt />
  46. {{build.length>0?formatter('项目地址',build):'--'}}
  47. </span>
  48. </p>
  49. <div class='place-bottom'>
  50. <div class='place-box'>
  51. <div class='place-left'>
  52. <span>建筑面积</span>
  53. <span>建筑高度</span>
  54. <span>楼层分布</span>
  55. <span>车位信息</span>
  56. </div>
  57. <div class='place-right'>
  58. <span :title='`${build.length>0?formatter("建筑面积",build):"--"}`'>{{build.length>0?formatter('建筑面积',build):'--'}}</span>
  59. <span :title='`${build.length>0?formatter("建筑高度",build):"--"}`'>{{build.length>0?formatter('建筑高度',build):'--'}}</span>
  60. <span :title='`${build.length>0?formatter("楼层分布",build):"--"}`'>{{build.length>0?formatter('楼层分布',build):'--'}}</span>
  61. <span :title='`${build.length>0?formatter("车位信息",build):"--"}`'>{{build.length>0?formatter('车位信息',build):'--'}}</span>
  62. </div>
  63. </div>
  64. <div class='place-box'>
  65. <div class='place-left'>
  66. <span>租赁面积</span>
  67. <span>竣工日期</span>
  68. <span>开业日期</span>
  69. <span>移交日期</span>
  70. </div>
  71. <div class='place-right'>
  72. <span :title='`${build.length>0?formatter("租赁面积",build):"--"}`'>{{build.length>0?formatter('租赁面积',build):'--'}}</span>
  73. <span :title='`${build.length>0?formatter("竣工日期",build):"--"}`'>{{build.length>0?formatter('竣工日期',build):'--'}}</span>
  74. <span :title='`${build.length>0?formatter("开业日期",build):"--"}`'>{{build.length>0?formatter('开业日期',build):'--'}}</span>
  75. <span :title='`${build.length>0?formatter("移交日期",build):"--"}`'>{{build.length>0?formatter('移交日期',build):'--'}}</span>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. <div class='view-right'>
  82. <div class='view-right-box'>
  83. <div class='lb-right'>
  84. <div v-if='pic1.length>0' style='height:100%'>
  85. <rotation type='2' :rotationImg='pic1' :key='1' @scan='scan'></rotation>
  86. <div class='lb-icon' @click='picClick("1")'></div>
  87. <img class='lb-img' @click='picClick("1")' src='../../assets/imgs/zk.png' alt />
  88. </div>
  89. <img v-else class='lb-left-noImg' src='@/assets/imgs/qwt.jpg' alt />
  90. </div>
  91. <div class='lb-right-bottom'>
  92. <nav>
  93. <span></span>
  94. <span>施工单位信息</span>
  95. </nav>
  96. <div class='view-right-bottom'>
  97. <el-table
  98. :data='constructions'
  99. :height='350'
  100. :cell-class-name='addClass'
  101. :span-method='objectSpanMethod'
  102. border
  103. style='font-size:12px'
  104. :header-cell-style='{background:"rgba(245,246,247,1)",fontFamily:"MicrosoftYaHei",color:"rgba(100,108,115,1)",lineHeight:"16px",fontSize:"12px"}'
  105. v-loading='loading'
  106. >
  107. <el-table-column label='序号' width='50' type='index' align='left'></el-table-column>
  108. <el-table-column label='总包/分包' prop='type' width='80' align='center'>
  109. <template slot-scope='{row}'>{{row.type||'--'}}</template>
  110. </el-table-column>
  111. <el-table-column label='专业' width='70' prop='professional'>
  112. <template slot-scope='{row}'>{{row.professional||'--'}}</template>
  113. </el-table-column>
  114. <el-table-column prop='unit ' label='施工单位'>
  115. <template slot-scope='{row}'>{{row.unit ||'--'}}</template>
  116. </el-table-column>
  117. <el-table-column label='联系人' prop width='70' :show-overflow-tooltip='true'>
  118. <template slot-scope='{row}'>{{row.lxr||'--'}}</template>
  119. </el-table-column>
  120. <el-table-column prop='phone' label='联系电话' width='110'>
  121. <template slot-scope='{row}'>{{row.lxdh||'--'}}</template>
  122. </el-table-column>
  123. </el-table>
  124. </div>
  125. </div>
  126. </div>
  127. </div>
  128. </div>
  129. <PicModal ref='picModal'></PicModal>
  130. </div>
  131. <!-- <div class='view-right-bottom' v-for='(item,index) in rightA' :key='index'>
  132. <div class='view-right-bottom-l'>{{item.type}}</div>
  133. <div class='view-right-bottom-r'>{{item.company}}</div>
  134. </div>-->
  135. <!-- <div class='view-left-box'>
  136. <div class='view-left-top'>
  137. <div class='view-top-imgL'>
  138. <rotation :rotationImg='rotationImg'></rotation>
  139. </div>
  140. <div class='view-top-imgR'>
  141. <rotation :rotationImg='rotationImg'></rotation>
  142. </div>
  143. </div>
  144. <div class='view-left-bottom'>
  145. <nav>
  146. <span></span>
  147. <span>建筑综合信息</span>
  148. </nav>
  149. <p class='place-p'>
  150. <span>福建省三明市梅列区东乾二路1号15幢三明万达广场4楼201室福建省三明市梅列区东乾二路1号</span>
  151. </p>
  152. <span class='place-hr'></span>
  153. <div class='place-bottom'>
  154. <div class='place-bottom-row'>
  155. <div>
  156. <span>项目名称</span>
  157. <span>建筑高度</span>
  158. <span>楼层分布</span>
  159. <span>车位信息</span>
  160. </div>
  161. <div style='min-width:172px;'>
  162. <span>三明万达广场</span>
  163. <span>裙房31.22m</span>
  164. <span>地上5层/地下2层</span>
  165. <span>地上832个/地下0个</span>
  166. </div>
  167. </div>
  168. <div class='place-bottom-row'>
  169. <div>
  170. <span>竣工日期</span>
  171. <span>开业日期</span>
  172. <span>移交日期</span>
  173. </div>
  174. <div style='min-width:172px;'>
  175. <span>2016年11月21日</span>
  176. <span>2016年12月30日</span>
  177. <span>2017年04月30日</span>
  178. </div>
  179. </div>
  180. <div class='place-bottom-row'>
  181. <div>
  182. <span style='margin-bottom:32px'>建筑面积</span>
  183. <span>租赁面积</span>
  184. </div>
  185. <div>
  186. <span>
  187. 13.07万㎡
  188. 其中地上9.90万㎡、地下3.55万㎡
  189. </span>
  190. <span>
  191. 6.45㎡
  192. 其中地上5.82万㎡,地下0.63万㎡
  193. </span>
  194. </div>
  195. </div>
  196. </div>
  197. </div>
  198. </div>-->
  199. </template>
  200. <script>
  201. import PicModal from './picModal'
  202. import { queryFact } from '@/api/overview'
  203. import { mapGetters } from 'vuex'
  204. export default {
  205. data() {
  206. return {
  207. loading: true,
  208. pic1: [], //区位图
  209. pic2: [], //鸟瞰图
  210. build: {}, //左下信息
  211. constructions: [], //右下数组
  212. shuzihuayijiao: '',
  213. va: '',
  214. spanArr: [], //二维数组,用于存放单元格合并规则
  215. position: 0 //用于存储相同项的开始index
  216. }
  217. },
  218. methods: {
  219. addClass({ columnIndex }) {
  220. if (columnIndex === 4) {
  221. return 'contact'
  222. }
  223. },
  224. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  225. for (let i = 1; i <= 5; i++) {
  226. if (columnIndex === i) {
  227. const _row = this.spanArr[i][rowIndex]
  228. const _col = _row > 0 ? 1 : 0
  229. // console.log('第'+rowIndex+'行','第'+i+'列','rowspan:'+_row,'colspan:'+_col)
  230. return {
  231. rowspan: _row,
  232. colspan: _col
  233. }
  234. }
  235. }
  236. },
  237. /**
  238. * 返回的数据处理
  239. */
  240. handelTableData(data) {
  241. let dict = {
  242. 总包: 0,
  243. 分包: 1
  244. }
  245. data = data.sort((a, b) => {
  246. // 按总分包排序
  247. if (a.type !== b.type) {
  248. return dict[a.type] - dict[b.type]
  249. }
  250. // 按专业排序
  251. if (a.professional !== b.professional) {
  252. return b.professional.localeCompare(a.professional)
  253. }
  254. // 按施工单位排序
  255. if (a.unit !== b.unit) {
  256. return b.unit.localeCompare(a.unit)
  257. }
  258. // 按联系人排序
  259. if (a.lxr !== b.lxr) {
  260. return b.lxr.localeCompare(a.lxr)
  261. }
  262. })
  263. data.map(item => {
  264. console.log(item)
  265. // return
  266. if (item.lxr) {
  267. let lxr = item.lxr.split(',').join('\n\r')
  268. item.lxr = lxr
  269. }
  270. return item
  271. })
  272. return data
  273. },
  274. rowspan(idx, prop) {
  275. // 第一列 总包合并一格,分包按照 第二列专业的单元格规则进行合并
  276. if (idx === 1) {
  277. // 初始化数组
  278. this.spanArr[1] = new Array(this.constructions.length).fill(0)
  279. let totalTypeLen = this.constructions.filter(a => a.type === '总包').length
  280. this.spanArr[1][0] = totalTypeLen
  281. this.spanArr[1] = this.spanArr[1].map((item, index) => {
  282. if (index > totalTypeLen - 1) {
  283. item = this.spanArr[2][index]
  284. }
  285. return item
  286. })
  287. return true
  288. }
  289. // 其他列单元格合并规则
  290. this.spanArr[idx] = []
  291. this.position = 0
  292. this.constructions.forEach((item, index) => {
  293. if (index === 0) {
  294. this.spanArr[idx].push(1)
  295. this.position = 0
  296. } else {
  297. if (this.constructions[index][prop] === this.constructions[index - 1][prop]) {
  298. this.spanArr[idx][this.position] += 1 //有相同项
  299. this.spanArr[idx].push(0) // 名称相同后往数组里面加一项0
  300. } else {
  301. this.spanArr[idx].push(1) //同列的前后两行单元格不相同
  302. this.position = index
  303. }
  304. }
  305. })
  306. },
  307. scan(val) {
  308. this.va = val
  309. },
  310. picClick(type) {
  311. if (type === '1') {
  312. this.$refs.picModal.showModal(this.pic1)
  313. // if (this.pic1.length >= this.va) {
  314. // this.$refs.picModal.showModal([this.pic1[this.va - 1]])
  315. // } else {
  316. // this.$refs.picModal.showModal(this.pic1)
  317. // }
  318. } else {
  319. this.$refs.picModal.showModal(this.pic2)
  320. // if (this.pic2.length >= this.va) {
  321. // this.$refs.picModal.showModal([this.pic2[this.va - 1]])
  322. // } else {
  323. // this.$refs.picModal.showModal(this.pic2)
  324. // }
  325. }
  326. },
  327. findxmzl() {
  328. // if (this.shuzihuayijiao) {
  329. // window.open(`${this.shuzihuayijiao}`, true)
  330. // }
  331. },
  332. query() {
  333. let params = {
  334. getParams: {
  335. plazaId: this.$store.state.plazaId
  336. // plazaId: '1000303'//这个id有3条数据
  337. }
  338. }
  339. queryFact(params).then(res => {
  340. if (res.result == 'success') {
  341. this.loading = false
  342. this.pic1 = []
  343. this.pic2 = []
  344. this.build = {}
  345. this.constructions = []
  346. this.shuzihuayijiao = ''
  347. this.pic1 = res.pic1 ? res.pic1 : []
  348. this.pic2 = res.pic2 ? res.pic2 : []
  349. this.build = res.build ? res.build : {}
  350. let constructions = []
  351. constructions = res.constructions ? res.constructions : []
  352. if (constructions.length > 0) {
  353. // this.parseTableData(constructions)
  354. let handleData = this.handelTableData(constructions)
  355. this.constructions = handleData
  356. this.rowspan(2, 'professional')
  357. this.rowspan(3, 'unit')
  358. this.rowspan(4, 'lxr')
  359. this.rowspan(5, 'lxdh')
  360. this.rowspan(1, 'type')
  361. }
  362. console.log(this.constructions)
  363. this.shuzihuayijiao = res.shuzihuayijiao ? res.shuzihuayijiao : ''
  364. if (res.plazaName) {
  365. this.$store.commit('SETPLAZENAME', res.plazaName)
  366. }
  367. }
  368. })
  369. },
  370. getImages(_url) {
  371. if (_url !== undefined) {
  372. let _u = _url.substring(7)
  373. return 'https://images.weserv.nl/?url=' + _u
  374. }
  375. },
  376. formatter(str, arrv) {
  377. if (str && arrv) {
  378. const Objs = arrv.find(e => e && e.project == str)
  379. return Objs ? Objs.basic : '--'
  380. } else {
  381. return ''
  382. }
  383. },
  384. init() {
  385. //预览是否开启
  386. // let previewUrl = location.href.split('?')[1]
  387. // if (previewUrl) {
  388. // previewUrl = Boolean(previewUrl.split('=')[1])
  389. // this.$store.commit('SETISPREVIEW', previewUrl)
  390. // }
  391. let previewUrl = this.$route.query.isPreview,
  392. plazaId = this.$route.query.plazaId
  393. if (previewUrl != '') {
  394. console.log(previewUrl)
  395. this.$store.commit('SETISPREVIEW', previewUrl)
  396. }
  397. if (plazaId) {
  398. localStorage.setItem('PLAZAID', plazaId)
  399. this.$store.commit('STOREPLAZAID', plazaId)
  400. }
  401. // let previewUrl = location.href.split('=')[1] ? location.href.split('=')[1].split('&')[0] : false,
  402. // plazaId = location.href.split('=')[2] ? location.href.split('=')[2] : '1000423'
  403. }
  404. },
  405. mounted() {
  406. this.query()
  407. },
  408. created() {
  409. this.init()
  410. },
  411. computed: {
  412. ...mapGetters(['isPreview', 'pic', 'plazaId'])
  413. },
  414. components: {
  415. PicModal
  416. }
  417. }
  418. </script>
  419. <style lang="less" scoped>
  420. .contact {
  421. div {
  422. word-break: break-all !important;
  423. white-space: pre !important;
  424. }
  425. }
  426. @import '../../assets/css/rotation.less';
  427. .overview {
  428. .view-box .view-left {
  429. overflow: hidden;
  430. .lb-left {
  431. margin-bottom: 0;
  432. }
  433. }
  434. }
  435. @media screen and (max-width: 1366px) {
  436. /*当屏幕尺寸小于1366px时,应用下面的CSS样式*/
  437. .overview .view-box .view-left .lb-bottom .place-bottom .place-box .place-right span {
  438. width: 200px;
  439. }
  440. }
  441. </style>
  442. <style lang="less">
  443. .view-right-bottom {
  444. .el-table td,
  445. .el-table th {
  446. padding: 3px 0;
  447. }
  448. }
  449. </style>