| | |
| | | <!-- |
| | | * @Date: 2024-01-13 20:46:33 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-03-11 19:20:55 |
| | | * @LastEditTime: 2024-03-12 21:38:38 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/workshop/device.vue |
| | | --> |
| | | <template> |
| | | <div class="device-item"> |
| | | <div class="device-item" > |
| | | <el-checkbox v-show="canconcern" class="care" v-model="concern" @change="change"></el-checkbox> |
| | | <p>{{ machineName }}</p> |
| | | <p class="device-item-title">{{ machineName }}</p> |
| | | <div class="device-item-box" @click="toDetail"> |
| | | <div class="img"> |
| | | <span class="img-status" v-if="item.status === 'STOP'">停机</span> |
| | |
| | | <script> |
| | | import { getRequest, getUrl } from '@/api/Api' |
| | | import devicePng from './img/machine.png' |
| | | // import { transform } from 'babel-core' |
| | | export default { |
| | | props: { |
| | | canconcern: { |
| | |
| | | data() { |
| | | return { |
| | | devicePng, |
| | | scale: 1, |
| | | scale: 'scale(1)', |
| | | concern: false, |
| | | item: {} |
| | | } |
| | |
| | | }, |
| | | mounted () { |
| | | this.concern = !!this.info.concern |
| | | console.log(this.$el.getBoundingClientRect().width,'/////',this.$el.getBoundingClientRect().width / 200) |
| | | // console.log(this.$el.getBoundingClientRect(),'>>>>>>>') |
| | | // this.scale = `scale(${Math.min(this.$el.getBoundingClientRect().width,this.$el.getBoundingClientRect().height) / 394})` |
| | | // console.log(this.$el.parent().getBoundingClientRect().width,this.$el.parent().getBoundingClientRect().heightm,'/////',`transform:scale(${Math.min(this.$el.getBoundingClientRect().width,this.$el.getBoundingClientRect().height) / 394})`) |
| | | this.$nextTick(() => { |
| | | //if (this.$el.getBoundingClientRect().width < 400) { |
| | | //this.$el.querySelector('.device-item-box').style = `transform:scale(${this.$el.getBoundingClientRect().width / 360})` |
| | | //} |
| | | if (this.$el) { |
| | | |
| | | // console.log('????',this.scale) |
| | | } |
| | | }) |
| | | |
| | | |
| | |
| | | .device-item { |
| | | width: 100%; |
| | | height: 100%; |
| | | max-width: 394px; |
| | | max-height: 394px; |
| | | // max-width: 394px; |
| | | // max-height: 394px; |
| | | border-radius: 10px; |
| | | border: 1px solid #3C4249; |
| | | padding: 20px; |
| | | padding: 10px; |
| | | display: flex; |
| | | flex-direction: column; |
| | | position: relative; |
| | | p { |
| | | p { |
| | | white-space: nowrap; |
| | | text-overflow: ellipsis; |
| | | } |
| | | &-title { |
| | | font-size: 20px; |
| | | white-space: nowrap; |
| | | text-overflow: ellipsis; |
| | | } |
| | |
| | | } |
| | | |
| | | &>div.device-item-box { |
| | | min-width: 100px; |
| | | width: 100%; |
| | | // min-width: 100px; |
| | | flex: 1 1 auto; |
| | | margin-top: 20px; |
| | | // margin-top: 20px; |
| | | display: flex; |
| | | align-items: center; |
| | | margin-bottom: 20px; |
| | | // margin-bottom: 20px; |
| | | overflow: hidden; |
| | | .img { |
| | | // min-width: 100px; |
| | | width: 60%; |
| | | width: 50%; |
| | | height: 150px; |
| | | border: 1px solid #444C55; |
| | | // border: 1px solid #444C55; |
| | | border-radius: 10px; |
| | | position: relative; |
| | | flex: 0 0 auto; |
| | |
| | | flex-direction: column; |
| | | align-items: center; |
| | | justify-content: space-around; |
| | | overflow: hidden; |
| | | |
| | | li { |
| | | width: 100%; |
| | |
| | | align-items: center; |
| | | |
| | | &>div { |
| | | margin-left: 10px; |
| | | ; |
| | | padding-left: 10px; |
| | | flex: 1 1 auto; |
| | | } |
| | | |
| | | p { |
| | | width: 100%; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | white-space: nowrap; |
| | | color: #E9FFFF; |
| | | text-shadow: 0px 1px 11px #549BD4; |
| | | } |