<template>
    <div>
        <vxe-table border height="900" :scroll-y="{ enabled: false }" :span-method="rowspanMethod" :data="tableData">
            <vxe-column field="name1" title="功能模块">
            </vxe-column>
            <vxe-column field="name2" title="详细功能">
            </vxe-column>
            <vxe-column field="name3" title="权限类型">
            </vxe-column>
            <vxe-column field="subCount" title="权限列表">
            </vxe-column>
            <vxe-column field="devCount" title="权限列表">
            </vxe-column>
            <vxe-column field="lineCount" title="权限列表">
            </vxe-column>
        </vxe-table>
    </div>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import type { VxeTablePropTypes } from 'vxe-table'
import XEUtils from 'xe-utils'


const tableData = ref([])


const getList = () => {
    const list = [
    {
        "areaIndex": "db2ba5e64d77f8e94ea5e6bb267407a2",
        "areaName": "江苏",
        "parentId": 245.27872032628161,
        "id": 134.62256558742314
    },
    {
        "name": "标准电压等级",
        "parentId": 134.62256558742314,
        "id": 926.3176851075092
    },
    {
        "lineCount": 2,
        "devCount": 2,
        "subCount": 1,
        "dicIndex": "ce5c16f5c409638e2f5682db25e5396b",
        "dicName": "0.21",
        "voltage": 0.21,
        "parentId": 926.3176851075092,
        "id": 708.7824913453129
    },
    {
        "lineCount": 5,
        "devCount": 4,
        "subCount": 3,
        "dicIndex": "3d68ceef26a579efe2fe0cdc654911b7",
        "dicName": "0.38",
        "voltage": 0.38,
        "parentId": 926.3176851075092,
        "id": 342.6613881772982
    },
    {
        "lineCount": 135,
        "devCount": 128,
        "subCount": 124,
        "dicIndex": "e3da890104e3c4ae1f005021411a1fd7",
        "dicName": "10",
        "voltage": 10,
        "parentId": 926.3176851075092,
        "id": 916.7109766996158
    },
    {
        "lineCount": 13,
        "devCount": 12,
        "subCount": 12,
        "dicIndex": "87065e15765e5899114a6d6b9e4fb3cb",
        "dicName": "20",
        "voltage": 20,
        "parentId": 926.3176851075092,
        "id": 376.2789802980606
    },
    {
        "lineCount": 1,
        "devCount": 1,
        "subCount": 1,
        "dicIndex": "8529cfa11356a0666afd3f9fa4da09a4",
        "dicName": "35",
        "voltage": 35,
        "parentId": 926.3176851075092,
        "id": 102.99236357187102
    },
    {
        "lineCount": 5,
        "devCount": 5,
        "subCount": 4,
        "dicIndex": "e96d74b79bd50ad0bc00a405246f1e1f",
        "dicName": "110",
        "voltage": 110,
        "parentId": 926.3176851075092,
        "id": 874.4325217932585
    },
    {
        "lineCount": 1,
        "devCount": 1,
        "subCount": 1,
        "dicIndex": "1b7b58ed8fcc2992b95334eaa9010c41",
        "dicName": "220",
        "voltage": 220,
        "parentId": 926.3176851075092,
        "id": 195.37376962236007
    },
    {
        "name": "干扰源类型",
        "parentId": 134.62256558742314,
        "id": 515.2179859163743
    },
    {
        "lineCount": 13,
        "devCount": 13,
        "subCount": 13,
        "dicIndex": "02b791fee1eed8aa141129e2f9feb413",
        "dicName": "电加热负荷",
        "voltage": null,
        "parentId": 515.2179859163743,
        "id": 44.17072644588749
    },
    {
        "lineCount": 77,
        "devCount": 73,
        "subCount": 71,
        "dicIndex": "2185fb3c519edf9ff7c1e1e7450828c7",
        "dicName": "变频调速设备",
        "voltage": null,
        "parentId": 515.2179859163743,
        "id": 81.44052161261905
    },
    {
        "lineCount": 2,
        "devCount": 2,
        "subCount": 2,
        "dicIndex": "388275b68f82b1b33b112581298484fc",
        "dicName": "轧机",
        "voltage": null,
        "parentId": 515.2179859163743,
        "id": 225.62314864981238
    },
    {
        "lineCount": 6,
        "devCount": 6,
        "subCount": 6,
        "dicIndex": "4339d701719290d3bd7c8ef79539891b",
        "dicName": "中频炉",
        "voltage": null,
        "parentId": 515.2179859163743,
        "id": 478.179257106343
    },
    {
        "lineCount": 7,
        "devCount": 7,
        "subCount": 7,
        "dicIndex": "44884d33189cb3d50f4c21a6d37fe9ee",
        "dicName": "精密加工",
        "voltage": null,
        "parentId": 515.2179859163743,
        "id": 641.2426119274875
    },
    {
        "lineCount": 28,
        "devCount": 25,
        "subCount": 23,
        "dicIndex": "4dca0951e008f10fc398c8df0405122c",
        "dicName": "商业/市政",
        "voltage": null,
        "parentId": 515.2179859163743,
        "id": 665.0267189812844
    },
    {
        "lineCount": 2,
        "devCount": 2,
        "subCount": 2,
        "dicIndex": "5c3776c30c0f48ecd2dd7da7680ecdfe",
        "dicName": "交直流逆变器",
        "voltage": null,
        "parentId": 515.2179859163743,
        "id": 917.3798434461117
    },
    {
        "lineCount": 1,
        "devCount": 1,
        "subCount": 1,
        "dicIndex": "6e590e736c8a03dcab2556b3887ed65e",
        "dicName": "冲击性负荷",
        "voltage": null,
        "parentId": 515.2179859163743,
        "id": 196.77703954503679
    },
    {
        "lineCount": 5,
        "devCount": 5,
        "subCount": 4,
        "dicIndex": "7767b4a405fde0a73b16a3e5759c0ee2",
        "dicName": "电焊负荷",
        "voltage": null,
        "parentId": 515.2179859163743,
        "id": 524.3217194202134
    },
    {
        "lineCount": 14,
        "devCount": 13,
        "subCount": 12,
        "dicIndex": "ce4397cd6d37206897d6f978a6deedf0",
        "dicName": "整流装置",
        "voltage": null,
        "parentId": 515.2179859163743,
        "id": 774.8518522037291
    },
    {
        "lineCount": 2,
        "devCount": 1,
        "subCount": 1,
        "dicIndex": "d5c70634f031ad571f092bc51ed84117",
        "dicName": "医院",
        "voltage": null,
        "parentId": 515.2179859163743,
        "id": 620.5484712138647
    },
    {
        "lineCount": 3,
        "devCount": 3,
        "subCount": 2,
        "dicIndex": "f7eccadbe45877b7cf2c48f98c3c68f1",
        "dicName": "半导体制造",
        "voltage": null,
        "parentId": 515.2179859163743,
        "id": 512.1056864036613
    },
    {
        "lineCount": 1,
        "devCount": 1,
        "subCount": 1,
        "dicIndex": "1a29fd407c23c1683fec99d920c24b27",
        "dicName": "交通枢纽",
        "voltage": null,
        "parentId": 515.2179859163743,
        "id": 454.69539316397413
    },
    {
        "name": "制造厂商",
        "parentId": 134.62256558742314,
        "id": 630.2699251802181
    },
    {
        "lineCount": 162,
        "devCount": 153,
        "subCount": 145,
        "dicIndex": "8fa73802c9e1abab973adcbeb0d58567",
        "dicName": "南京灿能",
        "voltage": null,
        "parentId": 630.2699251802181,
        "id": 457.4269802072985
    },
    {
        "name": "上报类型",
        "parentId": 134.62256558742314,
        "id": 111.68238932427421
    },
    {
        "lineCount": 1,
        "devCount": 1,
        "subCount": 1,
        "dicIndex": null,
        "dicName": "灿能上报",
        "voltage": null,
        "parentId": 111.68238932427421,
        "id": 790.9938860402641
    },
    {
        "lineCount": 161,
        "devCount": 152,
        "subCount": 144,
        "dicIndex": null,
        "dicName": "非灿能上报",
        "voltage": null,
        "parentId": 111.68238932427421,
        "id": 652.586632361174
    },
    {
        "areaIndex": "e81ba9e784e1cbbd7f120bf570ac8ddd",
        "areaName": "浙江",
        "parentId": 245.27872032628161,
        "id": 883.4021758955981
    },
    {
        "name": "标准电压等级",
        "parentId": 883.4021758955981,
        "id": 234.13294500153125
    },
    {
        "lineCount": 11,
        "devCount": 10,
        "subCount": 10,
        "dicIndex": "3d68ceef26a579efe2fe0cdc654911b7",
        "dicName": "0.38",
        "voltage": 0.38,
        "parentId": 234.13294500153125,
        "id": 392.01423411919103
    },
    {
        "lineCount": 1,
        "devCount": 1,
        "subCount": 1,
        "dicIndex": "de3131cde4a9adec31c98af6037acd9a",
        "dicName": "0.48",
        "voltage": 0.48,
        "parentId": 234.13294500153125,
        "id": 383.3519506885934
    },
    {
        "lineCount": 2,
        "devCount": 2,
        "subCount": 1,
        "dicIndex": "e3da890104e3c4ae1f005021411a1fd7",
        "dicName": "10",
        "voltage": 10,
        "parentId": 234.13294500153125,
        "id": 2.350571977090654
    },
    {
        "lineCount": 21,
        "devCount": 16,
        "subCount": 16,
        "dicIndex": "87065e15765e5899114a6d6b9e4fb3cb",
        "dicName": "20",
        "voltage": 20,
        "parentId": 234.13294500153125,
        "id": 450.3010595208894
    },
    {
        "lineCount": 3,
        "devCount": 2,
        "subCount": 2,
        "dicIndex": "e96d74b79bd50ad0bc00a405246f1e1f",
        "dicName": "110",
        "voltage": 110,
        "parentId": 234.13294500153125,
        "id": 496.9428837857617
    },
    {
        "lineCount": 1,
        "devCount": 1,
        "subCount": 1,
        "dicIndex": "1b7b58ed8fcc2992b95334eaa9010c41",
        "dicName": "220",
        "voltage": 220,
        "parentId": 234.13294500153125,
        "id": 677.1817957824691
    },
    {
        "name": "干扰源类型",
        "parentId": 883.4021758955981,
        "id": 948.3235034446267
    },
    {
        "lineCount": 2,
        "devCount": 2,
        "subCount": 2,
        "dicIndex": "02b791fee1eed8aa141129e2f9feb413",
        "dicName": "电加热负荷",
        "voltage": null,
        "parentId": 948.3235034446267,
        "id": 821.3797276171413
    },
    {
        "lineCount": 6,
        "devCount": 6,
        "subCount": 6,
        "dicIndex": "2185fb3c519edf9ff7c1e1e7450828c7",
        "dicName": "变频调速设备",
        "voltage": null,
        "parentId": 948.3235034446267,
        "id": 584.8971257135265
    },
    {
        "lineCount": 8,
        "devCount": 8,
        "subCount": 8,
        "dicIndex": "4dca0951e008f10fc398c8df0405122c",
        "dicName": "商业/市政",
        "voltage": null,
        "parentId": 948.3235034446267,
        "id": 151.90438978100508
    },
    {
        "lineCount": 18,
        "devCount": 16,
        "subCount": 15,
        "dicIndex": "5c3776c30c0f48ecd2dd7da7680ecdfe",
        "dicName": "交直流逆变器",
        "voltage": null,
        "parentId": 948.3235034446267,
        "id": 851.6470684502824
    },
    {
        "lineCount": 2,
        "devCount": 2,
        "subCount": 2,
        "dicIndex": "6e590e736c8a03dcab2556b3887ed65e",
        "dicName": "冲击性负荷",
        "voltage": null,
        "parentId": 948.3235034446267,
        "id": 47.212951323485356
    },
    {
        "lineCount": 2,
        "devCount": 2,
        "subCount": 2,
        "dicIndex": "7767b4a405fde0a73b16a3e5759c0ee2",
        "dicName": "电焊负荷",
        "voltage": null,
        "parentId": 948.3235034446267,
        "id": 88.34633257010948
    },
    {
        "lineCount": 1,
        "devCount": 1,
        "subCount": 1,
        "dicIndex": "ce4397cd6d37206897d6f978a6deedf0",
        "dicName": "整流装置",
        "voltage": null,
        "parentId": 948.3235034446267,
        "id": 253.32228574972905
    },
    {
        "name": "制造厂商",
        "parentId": 883.4021758955981,
        "id": 115.48117354027853
    },
    {
        "lineCount": 39,
        "devCount": 30,
        "subCount": 28,
        "dicIndex": "8fa73802c9e1abab973adcbeb0d58567",
        "dicName": "南京灿能",
        "voltage": null,
        "parentId": 115.48117354027853,
        "id": 253.5697359713447
    },
    {
        "name": "上报类型",
        "parentId": 883.4021758955981,
        "id": 431.2689542390755
    },
    {
        "lineCount": 39,
        "devCount": 30,
        "subCount": 28,
        "dicIndex": null,
        "dicName": "非灿能上报",
        "voltage": null,
        "parentId": 431.2689542390755,
        "id": 743.4794385242905
    },
    {
        "areaIndex": "fc3af8c91df24f8a7d307e68223c21fe",
        "areaName": "江西",
        "parentId": 245.27872032628161,
        "id": 797.6236473813805
    },
    {
        "name": "标准电压等级",
        "parentId": 797.6236473813805,
        "id": 776.2524731769633
    },
    {
        "lineCount": 2,
        "devCount": 1,
        "subCount": 1,
        "dicIndex": "3d68ceef26a579efe2fe0cdc654911b7",
        "dicName": "0.38",
        "voltage": 0.38,
        "parentId": 776.2524731769633,
        "id": 151.20925579100563
    },
    {
        "lineCount": 2,
        "devCount": 1,
        "subCount": 1,
        "dicIndex": "37b81bf8aa0fd54098716da3fc0ee433",
        "dicName": "6",
        "voltage": 6,
        "parentId": 776.2524731769633,
        "id": 294.56182354950334
    },
    {
        "lineCount": 3,
        "devCount": 3,
        "subCount": 2,
        "dicIndex": "e3da890104e3c4ae1f005021411a1fd7",
        "dicName": "10",
        "voltage": 10,
        "parentId": 776.2524731769633,
        "id": 725.8723769613364
    },
    {
        "lineCount": 1,
        "devCount": 1,
        "subCount": 1,
        "dicIndex": "8529cfa11356a0666afd3f9fa4da09a4",
        "dicName": "35",
        "voltage": 35,
        "parentId": 776.2524731769633,
        "id": 805.4557128498625
    },
    {
        "lineCount": 1,
        "devCount": 1,
        "subCount": 1,
        "dicIndex": "e96d74b79bd50ad0bc00a405246f1e1f",
        "dicName": "110",
        "voltage": 110,
        "parentId": 776.2524731769633,
        "id": 453.83215127911615
    },
    {
        "name": "干扰源类型",
        "parentId": 797.6236473813805,
        "id": 786.1700595206964
    },
    {
        "lineCount": 7,
        "devCount": 2,
        "subCount": 1,
        "dicIndex": "2185fb3c519edf9ff7c1e1e7450828c7",
        "dicName": "变频调速设备",
        "voltage": null,
        "parentId": 786.1700595206964,
        "id": 905.516785866928
    },
    {
        "lineCount": 2,
        "devCount": 2,
        "subCount": 1,
        "dicIndex": "4dca0951e008f10fc398c8df0405122c",
        "dicName": "商业/市政",
        "voltage": null,
        "parentId": 786.1700595206964,
        "id": 650.2004307660359
    },
    {
        "name": "制造厂商",
        "parentId": 797.6236473813805,
        "id": 433.35571107352445
    },
    {
        "lineCount": 9,
        "devCount": 4,
        "subCount": 2,
        "dicIndex": "8fa73802c9e1abab973adcbeb0d58567",
        "dicName": "南京灿能",
        "voltage": null,
        "parentId": 433.35571107352445,
        "id": 109.51063993599574
    },
    {
        "name": "上报类型",
        "parentId": 797.6236473813805,
        "id": 299.17278812748503
    },
    {
        "lineCount": 9,
        "devCount": 4,
        "subCount": 2,
        "dicIndex": null,
        "dicName": "非灿能上报",
        "voltage": null,
        "parentId": 299.17278812748503,
        "id": 927.935569116833
    },
    {
        "areaIndex": "eea6cde334c5e105580c1998ee03120a",
        "areaName": "广东",
        "parentId": 245.27872032628161,
        "id": 511.22619387082534
    },
    {
        "name": "标准电压等级",
        "parentId": 511.22619387082534,
        "id": 727.3231546341285
    },
    {
        "lineCount": 2,
        "devCount": 2,
        "subCount": 2,
        "dicIndex": "e3da890104e3c4ae1f005021411a1fd7",
        "dicName": "10",
        "voltage": 10,
        "parentId": 727.3231546341285,
        "id": 574.5622720441963
    },
    {
        "name": "干扰源类型",
        "parentId": 511.22619387082534,
        "id": 550.8238841530683
    },
    {
        "lineCount": 2,
        "devCount": 2,
        "subCount": 2,
        "dicIndex": "2185fb3c519edf9ff7c1e1e7450828c7",
        "dicName": "变频调速设备",
        "voltage": null,
        "parentId": 550.8238841530683,
        "id": 102.75507175981046
    },
    {
        "name": "制造厂商",
        "parentId": 511.22619387082534,
        "id": 495.72752866395706
    },
    {
        "lineCount": 2,
        "devCount": 2,
        "subCount": 2,
        "dicIndex": "8fa73802c9e1abab973adcbeb0d58567",
        "dicName": "南京灿能",
        "voltage": null,
        "parentId": 495.72752866395706,
        "id": 259.29297822747685
    },
    {
        "name": "上报类型",
        "parentId": 511.22619387082534,
        "id": 423.75568346624993
    },
    {
        "lineCount": 2,
        "devCount": 2,
        "subCount": 2,
        "dicIndex": null,
        "dicName": "非灿能上报",
        "voltage": null,
        "parentId": 423.75568346624993,
        "id": 790.1689877377449
    },
    {
        "areaIndex": "a4ce53d14246cbd6eb2986edf7a3cd65",
        "areaName": "安徽",
        "parentId": 245.27872032628161,
        "id": 328.8825685198562
    },
    {
        "name": "标准电压等级",
        "parentId": 328.8825685198562,
        "id": 171.60006872395007
    },
    {
        "lineCount": 2,
        "devCount": 2,
        "subCount": 1,
        "dicIndex": "e96d74b79bd50ad0bc00a405246f1e1f",
        "dicName": "110",
        "voltage": 110,
        "parentId": 171.60006872395007,
        "id": 57.31277814492341
    },
    {
        "name": "干扰源类型",
        "parentId": 328.8825685198562,
        "id": 126.1820042070787
    },
    {
        "lineCount": 2,
        "devCount": 2,
        "subCount": 1,
        "dicIndex": "02b791fee1eed8aa141129e2f9feb413",
        "dicName": "电加热负荷",
        "voltage": null,
        "parentId": 126.1820042070787,
        "id": 522.3176085127526
    },
    {
        "name": "制造厂商",
        "parentId": 328.8825685198562,
        "id": 595.8856630318883
    },
    {
        "lineCount": 2,
        "devCount": 2,
        "subCount": 1,
        "dicIndex": "8fa73802c9e1abab973adcbeb0d58567",
        "dicName": "南京灿能",
        "voltage": null,
        "parentId": 595.8856630318883,
        "id": 663.7692101387883
    },
    {
        "name": "上报类型",
        "parentId": 328.8825685198562,
        "id": 59.98602427297284
    },
    {
        "lineCount": 2,
        "devCount": 2,
        "subCount": 1,
        "dicIndex": null,
        "dicName": "非灿能上报",
        "voltage": null,
        "parentId": 59.98602427297284,
        "id": 349.00176522120097
    },
    {
        "areaIndex": "02d1b4e1680413eb72f3fa63d46c496c",
        "areaName": "海南",
        "parentId": 245.27872032628161,
        "id": 422.0814975245792
    },
    {
        "name": "标准电压等级",
        "parentId": 422.0814975245792,
        "id": 773.2386517587375
    },
    {
        "lineCount": 2,
        "devCount": 2,
        "subCount": 2,
        "dicIndex": "e3da890104e3c4ae1f005021411a1fd7",
        "dicName": "10",
        "voltage": 10,
        "parentId": 773.2386517587375,
        "id": 66.32396253860517
    },
    {
        "name": "干扰源类型",
        "parentId": 422.0814975245792,
        "id": 491.9381928187878
    },
    {
        "lineCount": 1,
        "devCount": 1,
        "subCount": 1,
        "dicIndex": "0dc3526fad2c73d78275800edf6b8877",
        "dicName": "电解负荷",
        "voltage": null,
        "parentId": 491.9381928187878,
        "id": 816.9786614317316
    },
    {
        "lineCount": 1,
        "devCount": 1,
        "subCount": 1,
        "dicIndex": "ce4397cd6d37206897d6f978a6deedf0",
        "dicName": "整流装置",
        "voltage": null,
        "parentId": 491.9381928187878,
        "id": 978.3436463890696
    },
    {
        "name": "制造厂商",
        "parentId": 422.0814975245792,
        "id": 308.60392950403457
    },
    {
        "lineCount": 2,
        "devCount": 2,
        "subCount": 2,
        "dicIndex": "8fa73802c9e1abab973adcbeb0d58567",
        "dicName": "南京灿能",
        "voltage": null,
        "parentId": 308.60392950403457,
        "id": 842.0742018613938
    },
    {
        "name": "上报类型",
        "parentId": 422.0814975245792,
        "id": 65.7760539406338
    },
    {
        "lineCount": 2,
        "devCount": 2,
        "subCount": 2,
        "dicIndex": null,
        "dicName": "非灿能上报",
        "voltage": null,
        "parentId": 65.7760539406338,
        "id": 103.365524298779
    },
    {
        "areaIndex": "7cb84b9da4a31fbb2c68f5f70d923e05",
        "areaName": "福建",
        "parentId": 245.27872032628161,
        "id": 738.1978884115381
    },
    {
        "name": "标准电压等级",
        "parentId": 738.1978884115381,
        "id": 693.8942778797182
    },
    {
        "lineCount": 2,
        "devCount": 2,
        "subCount": 2,
        "dicIndex": "3d68ceef26a579efe2fe0cdc654911b7",
        "dicName": "0.38",
        "voltage": 0.38,
        "parentId": 693.8942778797182,
        "id": 774.4481317271999
    },
    {
        "lineCount": 15,
        "devCount": 15,
        "subCount": 8,
        "dicIndex": "e3da890104e3c4ae1f005021411a1fd7",
        "dicName": "10",
        "voltage": 10,
        "parentId": 693.8942778797182,
        "id": 246.16340217038803
    },
    {
        "lineCount": 4,
        "devCount": 4,
        "subCount": 1,
        "dicIndex": "87065e15765e5899114a6d6b9e4fb3cb",
        "dicName": "20",
        "voltage": 20,
        "parentId": 693.8942778797182,
        "id": 67.4788840126188
    },
    {
        "lineCount": 4,
        "devCount": 4,
        "subCount": 1,
        "dicIndex": "1b7b58ed8fcc2992b95334eaa9010c41",
        "dicName": "220",
        "voltage": 220,
        "parentId": 693.8942778797182,
        "id": 466.6957078653895
    },
    {
        "name": "干扰源类型",
        "parentId": 738.1978884115381,
        "id": 923.8907744788594
    },
    {
        "lineCount": 13,
        "devCount": 13,
        "subCount": 9,
        "dicIndex": "2185fb3c519edf9ff7c1e1e7450828c7",
        "dicName": "变频调速设备",
        "voltage": null,
        "parentId": 923.8907744788594,
        "id": 619.4875265568129
    },
    {
        "lineCount": 12,
        "devCount": 12,
        "subCount": 1,
        "dicIndex": "44884d33189cb3d50f4c21a6d37fe9ee",
        "dicName": "精密加工",
        "voltage": null,
        "parentId": 923.8907744788594,
        "id": 54.467022366358584
    },
    {
        "name": "制造厂商",
        "parentId": 738.1978884115381,
        "id": 90.77829325228693
    },
    {
        "lineCount": 25,
        "devCount": 25,
        "subCount": 10,
        "dicIndex": "8fa73802c9e1abab973adcbeb0d58567",
        "dicName": "南京灿能",
        "voltage": null,
        "parentId": 90.77829325228693,
        "id": 490.5915741616578
    },
    {
        "name": "上报类型",
        "parentId": 738.1978884115381,
        "id": 128.98997016439816
    },
    {
        "lineCount": 25,
        "devCount": 25,
        "subCount": 10,
        "dicIndex": null,
        "dicName": "非灿能上报",
        "voltage": null,
        "parentId": 128.98997016439816,
        "id": 686.2046659100682
    },
    {
        "areaIndex": "7b6dd786f92b0cd1e761a566d963f179",
        "areaName": "湖南",
        "parentId": 245.27872032628161,
        "id": 492.4735951874475
    },
    {
        "name": "标准电压等级",
        "parentId": 492.4735951874475,
        "id": 787.4844186614563
    },
    {
        "lineCount": 1,
        "devCount": 1,
        "subCount": 1,
        "dicIndex": "3d68ceef26a579efe2fe0cdc654911b7",
        "dicName": "0.38",
        "voltage": 0.38,
        "parentId": 787.4844186614563,
        "id": 653.4717161041215
    },
    {
        "lineCount": 1,
        "devCount": 1,
        "subCount": 1,
        "dicIndex": "e3da890104e3c4ae1f005021411a1fd7",
        "dicName": "10",
        "voltage": 10,
        "parentId": 787.4844186614563,
        "id": 419.9010160226446
    },
    {
        "name": "干扰源类型",
        "parentId": 492.4735951874475,
        "id": 145.11155014258725
    },
    {
        "lineCount": 1,
        "devCount": 1,
        "subCount": 1,
        "dicIndex": "4dca0951e008f10fc398c8df0405122c",
        "dicName": "商业/市政",
        "voltage": null,
        "parentId": 145.11155014258725,
        "id": 573.2459857112904
    },
    {
        "lineCount": 1,
        "devCount": 1,
        "subCount": 1,
        "dicIndex": "5c3776c30c0f48ecd2dd7da7680ecdfe",
        "dicName": "交直流逆变器",
        "voltage": null,
        "parentId": 145.11155014258725,
        "id": 367.5552504109476
    },
    {
        "name": "制造厂商",
        "parentId": 492.4735951874475,
        "id": 879.7493194852016
    },
    {
        "lineCount": 2,
        "devCount": 2,
        "subCount": 2,
        "dicIndex": "8fa73802c9e1abab973adcbeb0d58567",
        "dicName": "南京灿能",
        "voltage": null,
        "parentId": 879.7493194852016,
        "id": 273.6796108672182
    },
    {
        "name": "上报类型",
        "parentId": 492.4735951874475,
        "id": 167.1013301236799
    },
    {
        "lineCount": 2,
        "devCount": 2,
        "subCount": 2,
        "dicIndex": null,
        "dicName": "非灿能上报",
        "voltage": null,
        "parentId": 167.1013301236799,
        "id": 777.019222329669
    },
    {
        "areaIndex": "aae4021324c16b989d73709ee0c29d15",
        "areaName": "四川",
        "parentId": 245.27872032628161,
        "id": 22.76574540533516
    },
    {
        "name": "标准电压等级",
        "parentId": 22.76574540533516,
        "id": 674.0378661572616
    },
    {
        "lineCount": 103,
        "devCount": 103,
        "subCount": 1,
        "dicIndex": "3d68ceef26a579efe2fe0cdc654911b7",
        "dicName": "0.38",
        "voltage": 0.38,
        "parentId": 674.0378661572616,
        "id": 656.7311292776277
    },
    {
        "name": "干扰源类型",
        "parentId": 22.76574540533516,
        "id": 135.55790769505148
    },
    {
        "lineCount": 7,
        "devCount": 7,
        "subCount": 1,
        "dicIndex": "4dca0951e008f10fc398c8df0405122c",
        "dicName": "商业/市政",
        "voltage": null,
        "parentId": 135.55790769505148,
        "id": 459.17677838720937
    },
    {
        "lineCount": 96,
        "devCount": 96,
        "subCount": 1,
        "dicIndex": "d498a06543915dfa5d2d529526ebcf74",
        "dicName": "城市负荷",
        "voltage": null,
        "parentId": 135.55790769505148,
        "id": 902.4525509312107
    },
    {
        "name": "制造厂商",
        "parentId": 22.76574540533516,
        "id": 921.8698113479253
    },
    {
        "lineCount": 103,
        "devCount": 103,
        "subCount": 1,
        "dicIndex": "8fa73802c9e1abab973adcbeb0d58567",
        "dicName": "南京灿能",
        "voltage": null,
        "parentId": 921.8698113479253,
        "id": 804.2093222468787
    },
    {
        "name": "上报类型",
        "parentId": 22.76574540533516,
        "id": 743.8760513645908
    },
    {
        "lineCount": 103,
        "devCount": 103,
        "subCount": 1,
        "dicIndex": null,
        "dicName": "非灿能上报",
        "voltage": null,
        "parentId": 743.8760513645908,
        "id": 571.3028767183814
    }
]
    //     const list = [
    //     { id: '10000', parentId: null, name: '账号管理' },
    //     { id: '11000', parentId: '10000', name: '用户管理' },
    //     { id: '11100', parentId: '11000', name: '查看' },
    //     { id: '11110', parentId: '11100', name: '用户列表' },
    //     { id: '11200', parentId: '11000', name: '编辑' },
    //     { id: '11210', parentId: '11200', name: '用户列表' },
    //     { id: '11220', parentId: '11200', name: '新增用户' },
    //     { id: '11300', parentId: '11000', name: '操作' },
    //     { id: '11310', parentId: '11300', name: '新增' },
    //     { id: '11320', parentId: '11300', name: '删除' },
    //     { id: '11330', parentId: '11300', name: '修改' },
    //     { id: '12000', parentId: '10000', name: '角色管理' },
    //     { id: '12100', parentId: '12000', name: '查看' },
    //     { id: '12110', parentId: '12100', name: '角色列表' },
    //     { id: '12200', parentId: '12000', name: '编辑' },
    //     { id: '122100', parentId: '12200', name: '角色列表' },
    //     { id: '12220', parentId: '12200', name: '新增角色' },
    //     { id: '12300', parentId: '12000', name: '操作' },
    //     { id: '12310', parentId: '12300', name: '新增' },
    //     { id: '12320', parentId: '12300', name: '删除' },
    //     { id: '12330', parentId: '12300', name: '修改' },
    //     { id: '20000', parentId: null, name: '个人中心' },
    //     { id: '21000', parentId: '20000', name: '个性化设置' },
    //     { id: '21100', parentId: '21000', name: '查看' },
    //     { id: '21110', parentId: '21100', name: '信息列表' },
    //     { id: '21200', parentId: '21000', name: '操作' },
    //     { id: '21210', parentId: '21200', name: '重置信息' },
    //     { id: '22000', parentId: '20000', name: '账户管理' },
    //     { id: '22100', parentId: '22000', name: '查看' },
    //     { id: '22110', parentId: '22100', name: '账户余额' },
    //     { id: '22120', parentId: '22100', name: '帐变记录' }
    //   ]
    return list
}

// 将普通树结构转换为横向树列表
const toColTreeData = (treeData: any[]) => {
    const options = { children: 'children' }
    const list: any[] = []
    const keyMap: any = {}
    XEUtils.eachTree(treeData, (item, index, result, paths, parent) => {
        keyMap[item.id] = item
        item.keys = parent ? parent.keys.concat([item.id]) : [item.id]
        if (!item.children || !item.children.length) {
            const row: any = {}
            console.log("🚀 ~ item.keys.forEach ~ item:", item)

            item.keys.forEach((key: any, index: number) => {
                const level = index + 1
                const obj = keyMap[key]

                row[`id${level}`] = obj.id
                row[`name${level}`] = obj.areaName || obj.name || obj.dicName
                row[`subCount`] = obj.subCount
                row[`devCount`] = obj.devCount
                row[`lineCount`] = obj.lineCount
            })
            list.push(row)
        }
    }, options)
    console.log("🚀 ~ toColTreeData ~ list:", list)

    tableData.value = list
}

// 通用行合并函数（将相同多列数据合并为一行）
const rowspanMethod: VxeTablePropTypes.SpanMethod = ({ row, _rowIndex, column, visibleData }) => {
    // console.log("🚀 ~ row:", row)
    const fields = ['name1', 'name2', 'name3', 'name4', 'name5', 'name6']
    const cellValue = row[column.field]
    // console.log("🚀 ~ cellValue:", cellValue)
    if (cellValue && fields.includes(column.field)) {
        const prevRow = visibleData[_rowIndex - 1]
        let nextRow = visibleData[_rowIndex + 1]
        if (prevRow && prevRow[column.field] === cellValue) {
            return { rowspan: 0, colspan: 0 }
        } else {
            let countRowspan = 1
            while (nextRow && nextRow[column.field] === cellValue) {
                nextRow = visibleData[++countRowspan + _rowIndex]
            }
            if (countRowspan > 1) {
                return { rowspan: countRowspan, colspan: 1 }
            }
        }
    }
}

const treeData = XEUtils.toArrayTree(getList())
toColTreeData(treeData)
</script>