// import {svgData} from "./data/svgset.js"
import tyData from "@/json/ty.json"
import jcData from "@/json/jc.json"

const tools = tyData.glyphs
export function assembleSvg() {
    let newTools = []
    // let params={}
    // let children=[]
    // let group =""
    // let s=0;
    // for(let i of svgData){
    //     if(i.subClassName!=group&&group!=""){
    //         params.group=group;
    //         params.children=children;
    //         newTools.push(params);
    //         params={};
    //         children=[]
    //     }
    //     group=i.subClassName
    //     children.push(i)
    //     if(s==svgData.length-1){
    //         params.group=group;
    //         params.children=children;
    //         newTools.push(params);
    //     }
    //     s++;
    //     group=i.subClassName
    // }
    return newTools
}
export function assemble() {
    let newTools = []
    let params = {}
    let children = []
    let group = ""
    let s = 0;
    // for(let i of tools){
    //     if(i.subClassName!=group&&group!=""){
    //         params.group=group;
    //         params.children=children;
    //         newTools.push(params);
    //         group=i.subClassName
    //         params={};
    //         children=[]
    //     }
    //     children.push(i)
    //     if(s==tools.length-1){
    //         params.group=group;
    //         params.children=children;
    //         newTools.push(params);
    //     }
    //     s++;
    //     group=i.subClassName
    // }
    for (let i of tools) {
        let data = {
            class:"icon-size ticon ticon-"+i.font_class,
            unicode:i.unicode,
            unicode_decimal: i.unicode_decimal,
            icon_id:i.icon_id,
            name: i.name,
            data: {
                name: i.font_class, // name 为上面表格中name
                text: i.name,
                x: 100,
                y: 100,
                width: 100,
                height: 100,
            }
        }
        newTools.push(data)
    }

    for(let i of jcData.glyphs){
        let data = {
            class:"icon-size t-icon t-"+i.font_class,
            unicode:i.unicode,
            name: i.name,
            data: {
                name: i.font_class, // name 为上面表格中name
                text: i.name,
                x: 100,
                y: 100,
                width: 100,
                height: 100,
            }
        }
        newTools.push(data)
    }
    return newTools
}