deviceurationAdd1.vue 4.52 KB
Newer Older
全球's avatar
全球 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
<template>
    <div class="equipmentList-box">
        <div class="equipmentList">
            <el-input v-model="formadd1.sceneName" placeholder="请输入场景名称"></el-input>
            <button class="vpnButton primary " @click.prevent="init" >查询</button>
        </div>
        <div class="ceneSelection">
            <el-scrollbar>
                <div class="ceneSelection-box"  v-for="(item,index) in formadd1.ceneSelectionList" :key="index">
                    <div class="ceneSelection-box-name">
                        <p>{{item.sceneName}}</p>
                        <el-radio v-model="formadd1.sceneCode" :label="item.sceneCode" @change='sceneCodefun'></el-radio>
                    </div>
                    <el-tooltip class="item" effect="dark" :content='item.excelName' placement="top-start">
                        <h6>
                            <!-- <span>{{item.excelName}}</span> -->
                        </h6>
                    </el-tooltip>
                    <!-- <img :src="item.sceneImage" /> -->
                    <img v-if="item.sceneImage" :src="objurl+item.sceneImage" />
                    <img v-else :src="objurl+'scene00.jpg'" />
                </div>
            </el-scrollbar>
        </div>
    </div>

</template>

<script>
import deviceConfigOnline from '../../services/deviceConfigOnline.service';
let ConfigHttps = new deviceConfigOnline()
export default {
    name: "deviceurationAdd1",
    data(){
        return{
            objurl:'',
            formadd1:{
                sceneName:'',
                sceneCode:'', //新增 场景选择
                ceneSelectionList:[],
            }

        }
    },
    filters:{
        statusFilter:function(val){
            let text="";
            switch (val) {
                case "1":
                    text='完成'
                    break;
                case "2":
                    text='执行中'
                    break
                default:
                    text=""
            }
            return text
        },
    },
    components:{},
    mounted(){

    },
    methods:{
        init(){
            let requestObj = {}
            requestObj.page = 1;
            requestObj.sceneName = this.formadd1.sceneName;
            requestObj.sceneType = '00';
            ConfigHttps.getdeviceAutolistScene(requestObj).then((res)=>{
                if(res.code==0){
                    this.formadd1.ceneSelectionList=res.data.list
                    this.objurl=res.obj
                    // vm.listData = res.result.list;
                }else {
                    _toast(res.msg)
                }
            }).catch((err=>{
                console.log(err)
            }))
        },
        sceneCodefun(){
            this.$emit('deviceurationadd1', this.formadd1.sceneCode)
        }

    }
}
</script>

<style lang="scss">
    .equipmentList-box{
        height:calc(100%);
        .equipmentList{
            padding:20px 0 0 20px;
            .el-input{
                width: 280px;
                margin-right: 20px;
                .el-input__inner{
                    width: 280px;
                }

            }

        }
        .ceneSelection{
            height:calc(100% - 20px);
            padding: 10px;
            .ceneSelection-box{
                width: 280px;
                height: 220px;
                padding: 10px;
                border: 1px solid #c6c6c6;
                display: inline-block;
                margin: 10px;
                .ceneSelection-box-name{
                    height: 28px;
                    line-height: 28px;
                    p{
                        float: left;
                        font-size: 14px;
                        color: #333333;
                    }

                }
                h6{
                    height: 19px;
                    font-size: 12px;
                    color: #666666;
                    width: 250px;
                    white-space: nowrap;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    font-weight: 500;
                }
                img{
                    width: 100%;
                    height: 150px;
                }
                &:hover{
                    .ceneSelection-box-name{
                        p{
                            color: #0091ea;
                        }
                    }
                    // transform: translateY(-5px);transition:0.1s;
                    box-shadow:8px 8px 10px #cccccc;
                }
            }
        }
    }

</style>