IonicTest copy.vue 7.0 KB
<template>
<div class="IonicTest" style="overflow:auto;padding: 0 45px;">
    <el-row :gutter="20">
        <el-col :xs="24" :sm="12" >
            <div class="grid-content bg-purple" style="width:100%;height:220px;margin-top:20px;">
                <img :src="change" alt="" v-show="items.length!=0" :onerror="defaultImg" style="width: 100%;height: 220px;">
            </div>
        </el-col>
        <el-col :xs="24" :sm="12" >
            <div class="grid-content bg-purple-light" style="width:100%;height:220px;margin-top:20px;">
                <div style="width:220px;height:25px;margin-top:16ox;"></div>
                <div style="width:220px;height:25px;margin-top:16ox;"></div>
                <div style="width:220px;height:25px;margin-top:16ox;"></div>
            </div>
        </el-col>
    </el-row>
    <el-row :gutter="10">
        <el-col :xs="24">
            <div class="grid-content bg-purple"  style="margin-top:20px;width:100%;height:280px;" >
            </div>
        </el-col>
    </el-row>
    <el-row :gutter="10">
        <el-col :xs="24" style="margin:24px 0;" >
            <div class="grid-content bg-purple" style="display:flex;justify-content: flex-end;align-items:center;">
                <div style="width:90px;line-height:25px;border:1px solid red;margin-right:15px;font-size:14px;">增加</div>
                <div style="width:90px;line-height:25px;border:1px solid red;margin-right:15px;font-size:14px;">增加</div>
            </div>
        </el-col>
    </el-row>
</div>

</template>

<script>
import echarts from 'echarts'
export default {
  name: 'Kanban',
  data() {
    return {
        status:'0',
        defaultImg:'this.src="'+process.env.VUE_APP_IONICURL+'/api/photo/default.jpg"',
        // defaultImg:'this.src="' + require('../assets/img/face1.png') + '"',
        selectIndex:'0',
        selectInfo:{
            length:'',
            width:'',
            time:''
        },
        items:[
             {
                "_links": {
                    "frame": "/api/photo/20210428142902_32.jpg", 
                    "self": "/api/products/9"
                }, 
                "area": 1.0, 
                "id": 9, 
                "img": "20210428142902_32.jpg", 
                "ipc": 3.0, 
                "length": 99.0, 
                "name": "12399777777888", 
                "note": "666", 
                "testtime": "Wed, 28 Apr 2021 06:29:02 GMT", 
                "width": 22.0
            },
        ],
        value:'',
        tabs:[{name:''},{}],
        num:0,
        activeIndex: '1',
        timer:'',
        date:new Date()
    }
  },
  components: {
    
  },
   computed:{
        formData(){
            let date = this.items[this.selectIndex]["testtime"].replace(',','');
            let d =date.toString()
            let t=d.toLocaleString('zh-CN')
            let time= new Date().toLocaleString('zh-CN');
            let a = new Date();
            console.log(a)
            console.log('time=='+time);
             console.log('ttt=='+t);
            return t;
        },
      change(){
        if (this.items.length==0) return;
        let src  = process.env.VUE_APP_IONICURL+this.items[this.selectIndex]._links.frame;
          this.imgUrl = src;
          return src
      }
   
  },
  created(){
    this.$store.dispatch('showAside');
  },
  methods:{
    upload(){
        
    },
    toNext(){
        
    },
    selectItem(v,i){
        this.selectIndex = i;
    },
    getProduct(){
        this.$axios.get(this.$api.getProducts).then(res =>{
            if(res.status== 200){
                this.items= res.data.items;
            }
            console.log('getProducts');
            
        })
    },
    getChart(){
        let myChart = echarts.init(this.$refs.chart);
        var option = {
            legend: {
                x:'right',
                textStyle:{color:'#FFFF',}
            },
            dataset: {
                source: [
                    ['product', '未开机', '正常', '异常'],
                    ['5', 43.3, 85.8, 93.7],
                    ['10', 43.3, 85.8, 93.7],
                    ['15', 83.1, 73.4, 55.1],
                    ['20', 86.4, 65.2, 82.5],
                    ['25', 72.4, 53.9, 39.1],
                    ['30', 72.4, 53.9, 39.1],
                    ['35', 72.4, 53.9, 39.1],
                    ['40', 72.4, 53.9, 39.1],
                    ['45', 72.4, 53.9, 39.1],
                    ['50', 72.4, 53.9, 39.1],
                    ['55', 72.4, 53.9, 39.1],
                    ['60', 72.4, 53.9, 39.1]
                ]
            },
            xAxis: {
                type: 'category',
                axisLine:{
                    lineStyle:{
                        color: '#555556',
                    }
                }
                    
            },
            yAxis: {
                axisLine:{
                    lineStyle:{
                        color: '#555556',
                    }
                },
                splitLine: {
                    show: true,
                    lineStyle: {
                        color: ['#555556'],
                        width: 1,
                        type: 'solid',
                    },
                }
            },
            series: [
                {
                    type: 'bar',
                    itemStyle: {
                        color: '#676867',
                    },
                },
                {
                    type: 'bar',
                    itemStyle: {
                        color: '#30ab6f',
                    },
                },
                {
                    type: 'bar',
                    itemStyle: {
                        color: '#cc3d1a',
                    },
                }
            ]
        };
        // 使用刚指定的配置项和数据显示图表。
        // this.myChart.setOption(option);
        myChart.setOption(option);
        window.onresize = function () {
            console.log('reset')
            myChart.resize();
        }
        window.addEventListener("load", myChart.resize());
        
    }
  },
  mounted() {
      this.getProduct();
  //   this.getChart();

  }
}
</script>

<style scoped lang="less">
@import url('../styles/IonicTest.less');
.productList:hover{
   background-color: #008fe0 !important;
}
  .curActive{
    background-color: #008fe0 !important;
}
.radio_type {
    width: 20px;
    height: 20px;
    appearance: none;
    position: relative;
    outline: none;
}
.radio_type:before {
    content: "";
    width: 15px;
    height: 15px;
    border: 1px solid white;
    display: inline-block;
    border-radius: 50%;
    vertical-align: middle;
}
.radio_type:checked:before {
    content: "";
    width: 15px;
    height: 15px;
    border: 1px solid #1871b9;
    display: inline-block;
    border-radius: 50%;
    vertical-align: middle;
}
.radio_type:checked:after {
    content: "";
    width: 9px;
    height: 9px;
    text-align: center;
    background: #1871b9;
    border-radius: 50%;
    display: block;
    position: absolute;
    top: 4px;
    left: 4px;
}
.radio_type:checked + label {
    color: #edd19d;
}
</style>