gaosp
2024-03-11 1c8259d4a4eb1b485054361e99744d276a284024
src/container/workshop/device.vue
@@ -1,7 +1,7 @@
<!--
 * @Date: 2024-01-13 20:46:33
 * @LastEditors: Sneed
 * @LastEditTime: 2024-01-31 21:31:13
 * @LastEditTime: 2024-03-11 19:20:55
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/workshop/device.vue
-->
<template>
@@ -76,6 +76,7 @@
    data() {
        return {
            devicePng,
            scale: 1,
            concern: false,
            item: {}
        }
@@ -136,6 +137,18 @@
            return ''
        }
    },
    mounted () {
        this.concern = !!this.info.concern
        console.log(this.$el.getBoundingClientRect().width,'/////',this.$el.getBoundingClientRect().width / 200)
        this.$nextTick(() => {
            //if (this.$el.getBoundingClientRect().width <  400) {
                //this.$el.querySelector('.device-item-box').style = `transform:scale(${this.$el.getBoundingClientRect().width / 360})`
            //}
        })
    },
    methods: {
        toDetail () {
            this.$emit('toDetail')
@@ -154,8 +167,10 @@
</script>
<style lang="scss" scoped>
.device-item {
    width: 394px;
    height: 321px;
    width: 100%;
    height: 100%;
    max-width: 394px;
    max-height: 394px;
    border-radius: 10px;
    border: 1px solid #3C4249;
    padding: 20px;
@@ -207,21 +222,24 @@
    }
    &>div.device-item-box {
        min-width: 100px;
        flex: 1 1 auto;
        margin-top: 20px;
        display: flex;
        align-items: center;
        margin-bottom: 20px;
        overflow: hidden;
        .img {
            width: 50%;
            height: 100%;
            // min-width: 100px;
            width: 60%;
            height: 150px;
            border: 1px solid #444C55;
            border-radius: 10px;
            position: relative;
            flex: 0 0 auto;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            .img-status {
                position: absolute;
                font-size: 12px;
@@ -247,10 +265,11 @@
            }
            img {
                position: absolute;
                top: 50%;
                left: 50%;
                transform: translate(-50%, -50%);
                // position: absolute;
                // top: 50%;
                // left: 50%;
                // transform: translate(-50%, -50%);
                height: auto;
                width: 80%;
            }
        }
@@ -272,7 +291,7 @@
                align-items: center;
                &>div {
                    margin-left: 20px;
                    margin-left: 10px;
                    ;
                }
@@ -282,8 +301,8 @@
                }
                img {
                    width: 40px;
                    height: 40px;
                    width: 25px;
                    height: 25px;
                }
            }
        }