<template>
    <div id="leftChart2">
        <div class="lc2-header">
            李四收费站
        </div>
        <div class="lc2-details">
            设备运行总数<span>245</span>
        </div>
        <!-- <dv-charts class="lc2-chart" :option="state.option" /> -->
        <dv-scroll-board ref="scrollBoard" :config="config" class="right" @click="clickHandler" />
        <dv-decoration2 style="height:10px;" />
    </div>
</template>
  
<script setup name="LeftChart2" lang="ts">
import { reactive } from 'vue'
// const state = reactive({
//     option: {
//         series: [
//             {
//                 type: 'pie',
//                 data: [
//                     { name: '收费系统', value: 93 },
//                     { name: '通信系统', value: 32 },
//                     { name: '监控系统', value: 65 },
//                     { name: '供配电系统', value: 44 },
//                     { name: '其他', value: 52 },
//                 ],
//                 radius: ['45%', '65%'],
//                 insideLabel: {
//                     show: false,
//                 },
//                 outsideLabel: {
//                     labelLineEndLength: 10,
//                     formatter: '{percent}%\n{name}',
//                     style: {
//                         fontSize: 14,
//                         fill: '#fff',
//                     },
//                 },
//             },
//         ],
//         color: ['#00baff', '#3de7c9', '#fff', '#ffc530', '#469f4b'],
//     },
// })

const config = reactive({
    header: ['列1', '列2', '列3'],
    data: [
        ['<span style="color:#37a2da;">行1列1</span>', '行1列2', '行1列3'],
        ['行2列1', '<span style="color:#32c5e9;">行2列2</span>', '行2列3'],
        ['行3列1', '行3列2', '<span style="color:#67e0e3;">行3列3</span>'],
        ['行4列1', '<span style="color:#9fe6b8;">行4列2</span>', '行4列3'],
        ['<span style="color:#ffdb5c;">行5列1</span>', '行5列2', '行5列3'],
        ['行6列1', '<span style="color:#ff9f7f;">行6列2</span>', '行6列3'],
        ['行7列1', '行7列2', '<span style="color:#fb7293;">行7列3</span>'],
        ['行8列1', '<span style="color:#e062ae;">行8列2</span>', '行8列3'],
        ['<span style="color:#e690d1;">行9列1</span>', '行9列2', '行9列3'],
        ['行10列1', '<span style="color:#e7bcf3;">行10列2</span>', '行10列3'],
    ],
    index: true,
    columnWidth: [50],
    align: ['center'],
    carousel: 'page'
})

const clickHandler = (e: any) => {
    console.log(e)
}

</script>
  
<style lang="scss" scoped>
#leftChart2 {
  width: 100%;
  height: 30%;
  display: flex;
  flex-direction: column;

  .lc2-header {
    height: 20px;
    line-height: 20px;
    font-size: 16px;
    text-indent: 20px;
    margin-top: 10px;
  }

  .lc2-details {
    height: 40px;
    font-size: 16px;
    display: flex;
    align-items: center;
    text-indent: 20px;

    span {
      color: #096dd9;
      font-weight: bold;
      font-size: 35px;
      margin-left: 20px;
    }
  }

  .lc2-chart {
    height: calc(100% - 80px);
  }
}
</style>