// 边界图，头部的按钮
const topologyTopBtns = [
    {label: "structural-analysis.top-btn.copy", icon: "iconfuzhi4", active: false, key: "copy"},
    {label: "structural-analysis.top-btn.cut", icon: "iconjianqiewenjian", active: false, key: "cut"},
    {label: "structural-analysis.top-btn.paste", icon: "iconjurassic_paste", active: false, key: "paste"},
    {label: "structural-analysis.top-btn.delete", icon: "iconshanchu", active: false, sepR: true, key: "delete"},
    {
        label: "structural-analysis.top-btn.single-level-collapse/expand",
        icon: "iconzhedie2",
        active: false,
        key: "collapseExpand"
    },
    {
        label: "structural-analysis.top-btn.same-level-collapse/expand",
        icon: "iconzhedie111",
        active: false,
        sepR: true,
        key: "collapseExpandAll"
    },
    {label: "structural-analysis.top-btn.move-up", icon: "iconmoveup", active: false, key: "moveUp"},
    {label: "structural-analysis.top-btn.move-down", icon: "iconmovedown", active: false, sepR: true, key: "moveDown"},
    {
        label: "structural-analysis.top-btn.background-color",
        icon: "iconbeijingse",
        active: false,
        key: "backgroundColor"
    },
    {
        label: "structural-analysis.top-btn.line-color",
        icon: "iconjurassic_border-linecolor",
        active: false,
        key: "lineColor"
    },
    {
        label: "structural-analysis.top-btn.line", icon: "iconline-style-svgrepo-com", active: false, key: "line",
        children: [
            {pKey: "line", key: "solid", icon: "iconline-solid-svgrepo-com", active: true},
            {pKey: "line", key: "dashed", icon: "iconline-dashed-svgrepo-com", active: true},
            {pKey: "line", key: "dotted", icon: "iconborder-style-dotted-svgrepo-com", active: true},
        ]
    },
    {
        label: "structural-analysis.top-btn.connect",
        icon: "icona-line-svgrepo-com1",
        active: false,
        sepR: true,
        key: "connectLine",
        children: [
            {pKey: "connectLine", key: "taxi", icon: "iconlink1", active: true},
            {pKey: "connectLine", key: "unbundled-bezier", icon: "iconlink2", active: true},
            {pKey: "connectLine", key: "straight", icon: "iconlink3", active: true},
        ]
    },
    {label: "structural-analysis.top-btn.full-screen", icon: "iconquanping", active: true, key: "overallCenter",},
    {label: "global-btn.export.picture", icon: "icondaochu", active: true, key: "exportImages",},
    {
        label: "structural-analysis.top-btn.configuration",
        icon: "iconpeizhiguanlianbao",
        active: true,
        key: "configuration",
        float: "right"
    },
    {
        label: "structural-analysis.top-btn.historical-boundary-map",
        icon: "iconmaterial",
        active: true,
        key: "historyChart",
        float: "right"
    },
    // {label: "structural-analysis.top-btn.p-chart", icon: "iconbiaoge", active: true, key: "parameter", float: "right"},
]

// 边界图，顶部zTree按钮
const topologyTopZTreeBtns = [
    'copy',
    'cut',
    'paste',
    'delete',
    'moveUp',
    'moveDown',
    'collapseExpand',
    'collapseExpandAll',
];

// 边界图，顶部X6按钮
const topologyTopX6Btns = [
    'backgroundColor',
    'lineColor',
    'line',
    'connectLine',
];

// 边界图，头部只读的按钮
const topologyReadOnlyTopBtns = [
    "collapseExpand",
    "collapseExpandAll",
]

const topologyRightBtns = [
    {label: "structural-analysis.top-btn.p-chart", icon: "iconbiaoge", active: true, action: "parameter"},
    {
        label: "structural-analysis.top-btn.historical-boundary-map",
        icon: "iconmaterial",
        active: true,
        action: "historyChart"
    }
]

const topologyZoomBtns = [
    {label: "structural-analysis.top-btn.full-screen", icon: "iconquanping", active: true, action: "overallCenter"},
    // {label: "structural-analysis.top-btn.cancel-zoom", icon: "iconshousuo", active: true, action: "resetCenter"},
    {label: "global-btn.export.picture", icon: "icondaochu", active: true, action: "exportImages"},
]

const topologyStruMenuList = [
    {icon: 'icongongneng', label: '添加结构', action: 'showAddStruModel'},
    {icon: "icongongneng", label: "添加外部零件", action: "showAddExterParts"},
    {icon: "iconniantie1", label: "粘贴(Ctrl+V)", action: "paste"},
    {icon: "iconfuzhi1", label: "复制(Ctrl+C)", action: "copy"},
    {icon: "iconjianqiewenjian", label: "剪切(Ctrl+X)", action: "cut"},
    {icon: 'iconmoveup', label: '上移', action: 'moveUp'},
    {icon: 'iconmovedown', label: '下移', action: 'moveDown'},
    {label: "单级折叠/展开", icon: "iconzhedie2", active: true, action: "collapseExpand"},
    {label: "同级折叠/展开", icon: "iconzhedie111", active: true, action: "collapseExpandAll"},
    {icon: 'iconshanchu', label: '删除(Delete)', action: 'del'}
]
const state = {
    topologyTopBtns: topologyTopBtns, // 边界图，头部的按钮
    topologyReadOnlyTopBtns: topologyReadOnlyTopBtns, // 边界图，头部只读的按钮
    topologyTopZTreeBtns: topologyTopZTreeBtns, // 边界图，顶部tzTree按钮
    topologyTopX6Btns: topologyTopX6Btns, // 边界图，顶部X6按钮
    topologyStruMenuList: topologyStruMenuList, //边界图左边树右击菜单
    topologyRightBtns: topologyRightBtns,
    topologyZoomBtns: topologyZoomBtns
}

const mutations = {
    SET: (state, {key, value}) => {
        if (state.hasOwnProperty(key)) {
            state[key] = value
        }
    }
}

const actions = {
    set({commit}, data) {
        commit('SET', data)
    }
}

export default {
    namespaced: true,
    state,
    mutations,
    actions
}
