import {defineStore} from "pinia";
import router from "../router";
export const useRootStore = defineStore('root',{
    state() {
        return {
            userInfo:{},
            leftMenuList:[
                {
                    "children":[
                        {
                            "path":"policy-regulation-information",
                            "name":"政策法规信息"
                        },
                        {
                            "path":"memorandum-manage",
                            "name":"备忘录管理"
                        }
                    ],
                    "O_LCON":"iconfont icon-wenjianguanli iconColor",
                    "path":"/",
                    "name":"政策法规管理"
                },
                {
                    "children":[
                        {
                            "path":"city-credit-information-platform-search",
                            "name":"市信用信息平台查询"
                        },
                        {
                            "children":[
                                {
                                    "path":"relative-person-search",
                                    "name":"按相对人查询"
                                },
                                {
                                    "path":"matter-search",
                                    "name":"按事项查询"
                                }
                            ],
                            "path":"/66",
                            "name":"委信用信息库查询"
                        },
                        {
                            "path":"commission-three-inventory-information-manage",
                            "name":"委三清单信息管理"
                        },
                        {
                            "path":"commission-credit-information-manage",
                            "name":"委信用信息管理"
                        }
                    ],
                    "O_LCON":"iconfont icon-xinyong iconColor",
                    "path":"/99",
                    "name":"信用信息"
                },
                {
                    "children":[
                        {
                            "path":"memorandum-manage",
                            "name":"备忘录管理"
                        },
                        {
                            "path":"rewards-and-punishments-measure-manage",
                            "name":"奖惩措施管理"
                        },
                        {
                            "path":"combined-reward-and-punishments-measure-manage",
                            "name":"联合奖惩案例信息"
                        },
                    ],
                    "O_LCON":"iconfont icon-medal iconColor",
                    "path":"/15",
                    "name":"联合奖惩"
                },
                {
                    "children":[
                        {
                            "path":"data-imputation-push",
                            "name":"数据归集推送"
                        },
                        {
                            "path":"/17",
                            "name":"应用情况"
                        },
                        {
                            "path":"credit-repair",
                            "name":"信用修复"
                        },
                        {
                            "path":"/19",
                            "name":"联合奖惩"
                        },
                        {
                            "path":"data-log",
                            "name":"数据日志"
                        },
                    ],
                    "O_LCON":"iconfont icon-zhuzhuangtu iconColor",
                    "path":"/21",
                    "name":"信用数据"
                },
                {
                    "children":[
                        {
                            "path":"user-manage",
                            "name":"用户管理"
                        },
                        {
                            "path":"/23",
                            "name":"单位管理"
                        },
                        {
                            "path":"/24",
                            "name":"用户日志"
                        },
                        {
                            "path":"/25",
                            "name":"系统说明"
                        },
                    ],
                    "O_LCON":"iconfont icon-shezhi-xianxing iconColor",
                    "path":"/26",
                    "name":"系统管理"
                },
            ],
            toHomeCounter:0,
        }
    },
    actions:{
        async userMenu() {
            const userInfo = localStorage.getItem('dataWatchLoginUserInfo')
            if (userInfo){
                this.userInfo = JSON.parse(userInfo)
            }
        },
    }
})