eqDialog.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  1. <template>
  2. <!-- 设备设施的三级路由的tabs ,八大系统和7个二级菜单共用了一个全屏弹框-->
  3. <div class='dialog-container'>
  4. <el-dialog :visible.sync='visible' :fullscreen='true' @close='closeModal'>
  5. <!-- 除了清单和原理页面,别的都有记录事项detailDialog页面 -->
  6. <div slot='title' class='header-title' v-if='Object.keys(dialogInfo).length>0'>
  7. <span class='title-name'>{{systemName}}-{{dialogInfo.label}}</span>
  8. <!-- 2020-7-12 查看图纸时 隐藏图标(查看入口) -->
  9. <!-- v-if='dialogInfo.id.slice(2,4)!="QD" && dialogInfo.id.slice(2,4)!="YL" && dialogInfo.id.slice(0,4)!="GJSP"' -->
  10. <img
  11. v-if='dialogInfo.id.slice(2,4)!="QD" && dialogInfo.id.slice(2,4)!="YL" && dialogInfo.id.slice(0,4)!="GJSP" && dialogInfo.label !== "查看图纸"'
  12. src='../../assets/imgs/zy1.png'
  13. @click='visibalBox'
  14. style='margin-top:-4px;'
  15. alt
  16. />
  17. </div>
  18. <!-- 没有tab的页面 -->
  19. <div v-if='Object.keys(dialogInfo).length>0 && dialogInfo.children.length==0' style='margin:16px 0 0 24px;height:100%'>
  20. <!-- 原理图 -->
  21. <div v-if='dialogInfo.id.slice(2,4)=="YL"' style='width:100%;overflow:auto;height:100%;margin:0 auto'>
  22. <rotation type='3' :rotationImg='rotationImg'></rotation>
  23. </div>
  24. <!-- 土建装饰主要材料清单 -->
  25. <tj-table v-else-if='dialogInfo.id.slice(0,4)=="TJQD"' :param='param'></tj-table>
  26. <!-- 主要设备清单 标准设备表格 -->
  27. <!-- 内部设备清单 -->
  28. <standTable v-else-if='dialogInfo.id.slice(2,4)=="QD"' :param='param' :major='dialogInfo.id'></standTable>
  29. <!-- 电井商铺范围清单 -->
  30. <djsp-table v-else-if='dialogInfo.id.slice(0,4)=="GJSP"' :param='param'></djsp-table>
  31. <!-- 查看图纸 -->
  32. <look-page v-else-if='dialogInfo.id.slice(2,4)=="TZ"' param major></look-page>
  33. </div>
  34. <!-- 有tab的页面 -->
  35. <div v-else style='margin:16px 0 0 24px;height:100%;'>
  36. <el-tabs v-model='activeName' @tab-click='handleClick' v-if='Object.keys(dialogInfo).length>0 && dialogInfo.children.length>0'>
  37. <el-tab-pane
  38. v-for='(value,index) in dialogInfo.children'
  39. v-if='value.id.slice(2,4)!="YL"'
  40. :key='"u"+index'
  41. :label='`${value.label}`'
  42. :name='`${value.param.tab_code}`'
  43. >
  44. <!-- 主要设备清单 标准设备表格加tab -->
  45. <tableList v-if='value.id.slice(0,4)=="RDQD"' :param='param' ref='list1' major='弱电'></tableList>
  46. <tableList v-else-if='value.id.slice(0,4)=="NTQD"' :param='param' ref='list2' major='暖通'></tableList>
  47. <!-- 维保表格 -->
  48. <wb-table v-else-if='value.id.slice(2,4)=="WB"' :smsxt='smsxt' :tabLabel='tabLabel' :diff='diff' :major='dialogInfo.id'></wb-table>
  49. <!-- 维修的表格 -->
  50. <wx-table v-else-if='value.id.slice(2,4)=="WX"' :smsxt='smsxt' :tabLabel='tabLabel' :diff='diff' :major='dialogInfo.id'></wx-table>
  51. <!-- 专维 -->
  52. <zw-table v-else-if='value.id.slice(2,4)=="ZW"' :smsxt='smsxt' :tabLabel='tabLabel' :diff='diff' :major='dialogInfo.id'></zw-table>
  53. <!-- 其他 -->
  54. <other-table v-else-if='value.id.slice(2,4)=="QT"' ref='qtList' :tabLabel='tabLabel' :smsxt='smsxt' :major='dialogInfo.id'></other-table>
  55. </el-tab-pane>
  56. <template v-for='(value,index) in dialogInfo.children'>
  57. <template v-for='(eve,index1) in tabCount'>
  58. <template v-if='eve.typecode == value.param.type_code'>
  59. <!-- 原理图分出来写,因为要判断没有图片的时候不显示tab,如果都没有则都不显示系统原理图 -->
  60. <el-tab-pane
  61. :key='index1+index'
  62. :label='`${value.label}`'
  63. :name='`${value.param.type_code}`'
  64. v-if='value.id.slice(2,4)=="YL" && eve.count>0 && value.param.type_code.slice(0,3)!="FBT"'
  65. >
  66. <!-- 有tab的原理图 -->
  67. <div style='width:100%;height:600px;'>
  68. <rotation type='3' :rotationImg='rotationImg'></rotation>
  69. </div>
  70. </el-tab-pane>
  71. <!-- 发布之后的编辑器的分支图 -->
  72. <el-tab-pane
  73. :key='index1+index'
  74. :label='`${value.label}`'
  75. :name='`${value.param.type_code}`'
  76. v-if='value.id.slice(2,4)=="YL" && value.param.type_code.slice(0,3)=="FBT"'
  77. >
  78. <fenbuPic ref='fenbutu' :typecode='value.param.type_code'></fenbuPic>
  79. </el-tab-pane>
  80. </template>
  81. </template>
  82. </template>
  83. </el-tabs>
  84. </div>
  85. </el-dialog>
  86. <!--记录表格 -->
  87. <record-dialog ref='Dialog'></record-dialog>
  88. </div>
  89. </template>
  90. <script>
  91. import tableList from './table/eqListTable'
  92. import tjTable from './table/tjTable'
  93. import wbTable from './table/wbTable'
  94. import zwTable from './table/zwTable'
  95. import lookPage from './table/lookPageTable'
  96. import standTable from './table/standTable'
  97. import otherTable from './table/otherTable'
  98. import wxTable from './table/wxTable'
  99. import recordDialog from './table/recordDialog'
  100. import djspTable from './table/djspTable'
  101. import { queryPic, queryTab } from '@/api/public.js'
  102. import fenbuPic from './fenbuPic'
  103. export default {
  104. props: ['systemName', 'smsxt'],
  105. data() {
  106. return {
  107. activeName: '',
  108. visible: false,
  109. dialogInfo: {},
  110. param: '', //区分清单tab
  111. typecode: '', //区分原理图的tab
  112. diff: '', //区分给水排水
  113. rotationImg: [],
  114. tabLabel: '',
  115. tabCount: []
  116. }
  117. },
  118. mounted() {},
  119. components: { tableList, tjTable, wbTable, zwTable, lookPage, standTable, otherTable, wxTable, recordDialog, djspTable, fenbuPic },
  120. methods: {
  121. //打开弹窗
  122. showModal(item) {
  123. this.visible = true
  124. this.dialogInfo = item
  125. if (Object.keys(this.dialogInfo).length > 0 && this.dialogInfo.children.length > 0) {
  126. this.activeName = this.dialogInfo.children[0].param.tab_code
  127. this.diff = this.dialogInfo.children[0].param.diff
  128. if (this.dialogInfo.children[0].id.slice(2, 4) == 'YL') {
  129. this.typecode = this.dialogInfo.children[0].param.type_code
  130. this.activeName = this.typecode
  131. this.isShowTab()
  132. this.initImage(this.typecode)
  133. }
  134. } else {
  135. this.activeName = this.dialogInfo.param.tab_code
  136. if (this.dialogInfo.id.slice(2, 4) == 'YL') {
  137. this.typecode = this.dialogInfo.param.type_code
  138. this.activeName = this.typecode
  139. this.isShowTab()
  140. this.initImage(this.typecode)
  141. }
  142. }
  143. this.param = this.activeName
  144. },
  145. //点击tab函数
  146. handleClick(tab) {
  147. if (this.param) {
  148. this.param = tab.name
  149. } else if (this.smsxt) {
  150. this.smsxt = tab.name
  151. }
  152. this.activeName = tab.name
  153. //原理图的tab怎么传typecode
  154. if (this.dialogInfo.children.length > 0) {
  155. this.typecode = this.dialogInfo.children[`${tab.index}`].param.type_code
  156. this.diff = this.dialogInfo.children[`${tab.index}`].param.diff
  157. }
  158. if (this.dialogInfo.children[0].id.slice(2, 4) == 'YL' && this.typecode.slice(0, 3) != 'FBT') {
  159. this.initImage(this.typecode)
  160. }
  161. if (this.dialogInfo.children[0].id.slice(2, 4) == 'YL' && this.typecode.slice(0, 3) == 'FBT') {
  162. this.$nextTick(() => {
  163. this.$refs.fenbutu[0] && this.$refs.fenbutu[0].openFloorMap()
  164. })
  165. }
  166. this.tabLabel = tab.label
  167. },
  168. visibalBox() {
  169. this.$refs.Dialog.open(this.smsxt)
  170. },
  171. //系统原理图接口
  172. initImage(typecode) {
  173. let getParams = {
  174. plazaId: this.$store.state.plazaId,
  175. // system: this.systemName.slice(0, 2),
  176. // system: this.systemName,
  177. plazaId: this.$store.state.plazaId,
  178. module: '1002',
  179. neTypename: '位置布置图',
  180. typecode: typecode
  181. }
  182. switch (this.systemName) {
  183. case '暖通系统':
  184. getParams.system = '1002'
  185. break
  186. case '消防系统':
  187. getParams.system = '1003'
  188. break
  189. case '弱电系统':
  190. getParams.system = '1004'
  191. break
  192. case '电梯系统':
  193. getParams.system = '1006'
  194. break
  195. case '燃气系统':
  196. getParams.system = '1007'
  197. break
  198. case '土建装饰':
  199. getParams.system = '1008'
  200. break
  201. }
  202. if (this.systemName == '给排水系统') {
  203. getParams.system = '1005'
  204. }
  205. if (this.systemName == '供电系统') {
  206. getParams.system = '1001'
  207. }
  208. queryPic({ getParams }).then(res => {
  209. this.rotationImg = res.data || []
  210. })
  211. },
  212. //原理图没图片不显示tab 因为供电和燃气系统没有tab所以分开判断
  213. //这个方法是判断有tab的count>0的时候显示tab
  214. isShowTab() {
  215. let data = {
  216. plazaId: this.$store.state.plazaId,
  217. major: this.systemName.slice(0, 2)
  218. }
  219. let postParams = []
  220. if (this.dialogInfo.children.length == 0) {
  221. postParams.push({
  222. params: {
  223. typecode: this.dialogInfo.param.type_code,
  224. system: this.smsxt,
  225. module: '1002'
  226. },
  227. tableName: 'glsms_proimgup'
  228. })
  229. } else {
  230. this.dialogInfo.children.forEach(el => {
  231. postParams.push({
  232. params: {
  233. typecode: el.param.type_code,
  234. system: this.smsxt,
  235. module: '1002'
  236. },
  237. tableName: 'glsms_proimgup'
  238. })
  239. })
  240. }
  241. queryTab({ data, postParams }).then(res => {
  242. this.tabCount = []
  243. let data = res.data.data || []
  244. data.forEach(el => {
  245. this.tabCount.push({
  246. count: el.count,
  247. system: el.params.system,
  248. typecode: el.params.typecode
  249. })
  250. })
  251. this.$emit('emitCount', this.tabCount)
  252. })
  253. },
  254. /**
  255. * 关闭弹窗,传回父组件,在父组件内 处理逻辑(关闭弹窗)
  256. */
  257. closeModal() {
  258. this.$emit('closeModal', true)
  259. }
  260. }
  261. }
  262. </script>
  263. <style lang="less" scoped>
  264. .dialog-container {
  265. .title-name {
  266. font-size: 16px;
  267. padding-right: 6px;
  268. padding-left: 24px;
  269. color: #000;
  270. font-weight: bold;
  271. color: #646a73;
  272. font-weight: normal;
  273. }
  274. }
  275. .top {
  276. width: 1366px;
  277. height: 1px;
  278. background: rgba(0, 0, 0, 0.06);
  279. margin-bottom: 20px;
  280. }
  281. </style>
  282. <style lang="less" >
  283. .dialog-container {
  284. .el-dialog__header {
  285. padding: 16px 24px;
  286. }
  287. .el-dialog__title {
  288. font-size: 16px;
  289. font-family: PingFangSC-Medium, PingFang SC;
  290. font-weight: 500;
  291. color: rgba(0, 0, 0, 0.85);
  292. line-height: 24px;
  293. }
  294. .el-dialog__body {
  295. padding: 0 24px;
  296. height: 90%;
  297. }
  298. .el-tabs--bottom .el-tabs__item.is-bottom:nth-child(2),
  299. .el-tabs--bottom .el-tabs__item.is-top:nth-child(2),
  300. .el-tabs--top .el-tabs__item.is-bottom:nth-child(2),
  301. .el-tabs--top .el-tabs__item.is-top:nth-child(2) {
  302. padding-left: 16px;
  303. }
  304. .el-tabs--bottom .el-tabs__item.is-bottom:last-child,
  305. .el-tabs--bottom .el-tabs__item.is-top:last-child,
  306. .el-tabs--top .el-tabs__item.is-bottom:last-child,
  307. .el-tabs--top .el-tabs__item.is-top:last-child {
  308. padding-right: 16px;
  309. }
  310. .el-tabs__nav-wrap::after {
  311. height: 0;
  312. }
  313. .el-tabs,
  314. .el-tabs__content {
  315. height: calc(100% - 45px);
  316. /deep/ .el-tab-pane > div {
  317. height: 100% !important;
  318. }
  319. }
  320. .el-tabs__item {
  321. padding: 5px 16px;
  322. height: 30px;
  323. line-height: 22px;
  324. font-size: 14px;
  325. font-family: MicrosoftYaHei;
  326. color: rgba(31, 36, 41, 1);
  327. border: 1px solid rgba(195, 199, 203, 1);
  328. }
  329. /deep/ .el-tabs__item:last-child {
  330. border-radius: 0px 4px 4px 0px;
  331. }
  332. /deep/ .el-tabs__item:nth-child(2) {
  333. border-radius: 4px 0px 0px 4px;
  334. }
  335. .el-tab-pane {
  336. height: 100% !important;
  337. }
  338. .el-tabs__active-bar {
  339. background-color: transparent !important;
  340. }
  341. .is-active {
  342. color: #025baa;
  343. border-color: #025baa;
  344. }
  345. //动画
  346. .el-dialog__wrapper {
  347. transition-duration: 0.3s;
  348. }
  349. .dialog-fade-enter-active {
  350. animation: none !important;
  351. }
  352. .dialog-fade-leave-active {
  353. transition-duration: 0.15s !important;
  354. animation: none !important;
  355. }
  356. .dialog-fade-enter-active .el-dialog,
  357. .dialog-fade-leave-active .el-dialog {
  358. animation-fill-mode: forwards;
  359. }
  360. .dialog-fade-enter-active .el-dialog {
  361. animation-duration: 0.3s;
  362. animation-name: anim-open;
  363. animation-timing-function: cubic-bezier(0.6, 0, 0.4, 1);
  364. }
  365. .dialog-fade-leave-active .el-dialog {
  366. animation-duration: 0.3s;
  367. animation-name: anim-close;
  368. }
  369. @keyframes anim-open {
  370. 0% {
  371. opacity: 0;
  372. transform: scale3d(0, 0, 1);
  373. }
  374. 100% {
  375. opacity: 1;
  376. transform: scale3d(1, 1, 1);
  377. }
  378. }
  379. @keyframes anim-close {
  380. 0% {
  381. opacity: 1;
  382. }
  383. 100% {
  384. opacity: 0;
  385. transform: scale3d(0.5, 0.5, 1);
  386. }
  387. }
  388. }
  389. @media screen and (max-width: 1366px) {
  390. /*当屏幕尺寸小于1366px时,应用下面的CSS样式*/
  391. .el-tabs,
  392. .el-tabs__content {
  393. height: 700px;
  394. }
  395. }
  396. </style>