| | |
| | | <!-- |
| | | * @Date: 2024-01-05 23:47:53 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-01-20 21:04:26 |
| | | * @LastEditTime: 2024-01-21 22:36:40 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/mapPreview/Map.vue |
| | | --> |
| | | <template> |
| | | <div class="map"> |
| | | <div class="map-container"> |
| | | <div class="table" :class="$route.name ==='preview' ? 'active' : ''" > |
| | | <div @mouseenter="mouseenter" @mouseleave="mouseleave" :style="{width: (cols * height + 'px'),height: rows * height + 'px',marginLeft: -marginLeft + 'px'}"> |
| | | <div @mouseenter="mouseenter" @mouseleave="mouseleave" |
| | | :style="{ width: (cols * height + 'px'), height: rows * height + 'px', marginLeft: -marginLeft + 'px' }"> |
| | | <table > |
| | | <tr v-for="(item, index) in map" :key="index"> |
| | | <td v-if="v.rowspan !==0 && v.colspan!==0" |
| | | :class="{aisle: v.type === 1 }" |
| | | :width="v.colspan* height + 'px'" |
| | | :height="v.rowspan* height + 'px'" |
| | | v-for="v in item" |
| | | <td v-if="v.rowspan !== 0 && v.colspan !== 0" :class="{ aisle: v.type === 1 }" |
| | | :width="v.colspan * height + 'px'" :height="v.rowspan * height + 'px'" v-for="v in item" |
| | | :rowspan="v.rowspan" :colspan="v.colspan" :key="v.rowIndex + '-' + v.colIndex"> |
| | | <Device @click.native="toDetail(v)" v-if="v.id" :id="v.id" style="width: 100%;height: 100%;" :deviceList="deviceList" |
| | | :plantDeviceList="plantDeviceList" ::info="info"></Device> |
| | | <Device @click.native="toDetail(v)" v-if="v.id" :id="v.id" style="width: 100%;height: 100%;" |
| | | :deviceList="deviceList" :plantDeviceList="plantDeviceList" ::info="info"></Device> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </template> |
| | | <script> |
| | | let timer; |
| | |
| | | clearTimeout(timer) |
| | | }, |
| | | mouseleave () { |
| | | if (this.move){ |
| | | let {width} = document.querySelector('.table div').getBoundingClientRect() |
| | | let {width: tableW} = document.querySelector('.table').getBoundingClientRect() |
| | | if (width > tableW) { |
| | |
| | | this.moveFn() |
| | | } else { |
| | | this.leftMax = 0 |
| | | } |
| | | } |
| | | }, |
| | | toDetail (v) { |
| | |
| | | } |
| | | }) |
| | | }, |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | |
| | | @keyframes move { |
| | | 0% { |
| | | transform: translate(0,0); |
| | | } |
| | | |
| | | 100% { |
| | | transform: translate(-100%,0); |
| | | } |
| | | } |
| | | |
| | | .preview-container { |
| | | .table { |
| | | overflow: hidden; |
| | | overflow-y: auto; |
| | | // margin-left: 100%; |
| | | } |
| | | |
| | | .table div { |
| | | // animation: move 12s infinite alternate; |
| | | } |
| | | } |
| | | |
| | | .map { |
| | | width: 100%; |
| | | height: 100%; |
| | | position: relative; |
| | | |
| | | .map-container { |
| | | width: 100%; |
| | | height: 100%; |
| | |
| | | width: 80px; |
| | | margin-inline: 10px; |
| | | } |
| | | |
| | | .plant-name { |
| | | width: 120px; |
| | | margin-left: auto; |
| | |
| | | // left: 100%; |
| | | // animation: move 6s infinite alternate; |
| | | } |
| | | |
| | | .table { |
| | | // margin-top: 10px; |
| | | // display: flex; |
| | |
| | | height: 100%; |
| | | position: relative; |
| | | overflow-x: scroll; |
| | | & > div { |
| | | |
| | | } |
| | | &>div {} |
| | | |
| | | .table-action { |
| | | position: fixed; |
| | | z-index: 999; |
| | | color: #fff; |
| | | width: 100px; |
| | | |
| | | div { |
| | | margin-top: 4px; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | div:hover { |
| | | color: #68D9FF; |
| | | } |
| | |
| | | // word-wrap: break-word; |
| | | overflow: hidden; |
| | | border-radius: 10px; |
| | | |
| | | // box-sizing: border-box; |
| | | td { |
| | | // width: 50px; |
| | |
| | | border: 1px solid #1662DB; |
| | | vertical-align: middle; |
| | | text-align: center; |
| | | |
| | | & > img { |
| | | width: 20px; |
| | | height: 20px; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .machine { |
| | | width: 100%; |
| | | height: 100%; |
| | | display: flex; |
| | | flex-direction: column; |
| | | |
| | | & > p { |
| | | margin-top: 20px; |
| | | color: #E9FFFF; |
| | |
| | | -webkit-text-fill-color: transparent; |
| | | text-align: center; |
| | | } |
| | | |
| | | & > div { |
| | | flex: 1 1 auto; |
| | | margin-top: 20px; |
| | |
| | | margin-bottom: 20px; |
| | | |
| | | overflow: hidden; |
| | | |
| | | .img { |
| | | width: 50%; |
| | | height: 100%; |
| | |
| | | border: 1px solid #444C55; |
| | | border-radius: 10px; |
| | | position: relative; |
| | | |
| | | img { |
| | | position: absolute; |
| | | top: 50%; |
| | |
| | | width: 80%; |
| | | } |
| | | } |
| | | |
| | | ul { |
| | | flex: 1 1 auto; |
| | | height: 100%; |
| | |
| | | flex-direction: column; |
| | | align-items: center; |
| | | justify-content: space-around; |
| | | |
| | | li { |
| | | width: 100%; |
| | | display: flex; |
| | | font-size: 12px; |
| | | align-items: center; |
| | | |
| | | & > div { |
| | | margin-left: 20px;; |
| | | margin-left: 20px; |
| | | ; |
| | | } |
| | | |
| | | p { |
| | | color: #E9FFFF; |
| | | text-shadow: 0px 1px 11px #549BD4; |
| | | } |
| | | |
| | | img { |
| | | width: 40px; |
| | | height: 40px; |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | td.active { |
| | | background: #68D9FF!important; |
| | | } |
| | | |
| | | td.aisle { |
| | | // width: 20px; |
| | | // height: 20px; |
| | | background: #1662DB; |
| | | |
| | | div { |
| | | // width: 20px; |
| | | // height: 20px; |
| | | } |
| | | } |
| | | |
| | | td.device { |
| | | // width: 400px; |
| | | // height: 400px; |
| | | overflow: hidden; |
| | | |
| | | div { |
| | | // width: 400px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .grid { |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | div { |
| | | border: 1px solid red; |
| | | } |
| | | } |
| | | </style> |
| | | }</style> |