//权限按钮相关
import {useAuthBtnStore} from '@/store/modules/authBtn'
const authBtnStore = useAuthBtnStore()
/*
---------------------------研报管理----------------- 
*/
export const reportManageBtn = {
    reportManage_sendMsg:'reportManage:sendMsg',//推送消息/已推送消息
    reportManage_reportView:'reportManage:reportView',//研报预览：即是否能点击研报名称跳转预览页面
    reportManage_reportDel:'reportManage:reportDel',//删除研报
    reportManage_reportEdit:'reportManage:reportEdit',//编辑研报
    reportManage_cancelPublish:'reportManage:cancelPublish',//取消发布
    reportManage_exportPdf:'reportManage:exportPdf',//下载pdf
    reportManage_exportImg:'reportManage:exportImg',//下载长图
    reportManage_publish:'reportManage:publish',//发布研报
    reportManage_reportList:'reportManage:reportList',//研报列表的选项
    reportManage_reportList_uv:'reportManage:reportList:uv',//研报列表-PV/UV
    reportManage_reportList_sendTime:'reportManage:reportList:sendTime',//研报列表-报告推送时间
    reportManage_dayWeekReportAdd:'reportManage:dayWeekReportAdd',//添加晨报周报
    reportManage_reportAdd:'reportManage:reportAdd',//添加研报
}
export const enReportManageBtn = {
    enReport_reportView:'enReport:reportView',//研报预览：即是否能点击研报名称跳转预览页面
    enReport_sendEmail:'enReport:sendEmail',//群发邮件/群发日志
    enReport_reportDel:'enReport:reportDel',//删除研报
    enReport_reportEdit:'enReport:reportEdit',//编辑研报
    enReport_cancelPublish:'enReport:cancelPublish',//取消发布
    enReport_exportPdf:'enReport:exportPdf',//下载pdf
    enReport_exportImg:'enReport:exportImg',//下载长图
    enReport_publish:'enReport:publish',//发布研报
    enReport_reportAdd:'enReport:reportAdd',//添加研报
}

/*
--------------------------智能PPT-----------------
PS：由于移动端中英文PPT是一个页面，特地把按钮名称设置为一致的方便处理
与ETA后台不同，修改时请注意
*/
export const pptBtn={
    ppt_del:'ppt:del',
    ppt_copy:'ppt:copy',
    ppt_download:'ppt:download',
    ppt_show:'ppt:show',//演示
    ppt_publish:'ppt:publish',
    ppt_visible:'ppt:visible',//可见权限
    ppt_save:'ppt:save',//添加PPT按钮，同时也控制目录重命名权限
    ppt_setShare:'ppt:setShare',//设置共享
}
export const enPPTBtn={
    ppt_del:'pptEn:del',
    ppt_copy:'pptEn:copy',
    ppt_download:'pptEn:download',
    ppt_show:'pptEn:show',
    ppt_publish:'pptEn:publish',
    ppt_visible:'pptEn:visible',
    ppt_save:'pptEn:save',//添加PPT按钮，同时也控制目录重命名权限
    ppt_setShare:'pptEn:setShare',//设置共享
}

/*
--------------------------ETA指标库---------------
*/
export const edbDataBtn={
        /*-----------指标详情按钮--------- */
        edbData_refreshAll:'edbData:refreshAll',//全部刷新
        edbData_newestValue:'edbData:newestValue',//添加最新值
        edbData_enNameSetting:'edbData:enNameSetting',//设置英文名称
        edbData_edbSource:'edbData:edbSource',//指标溯源
        edbData_copyData:'edbData:copyData',//复制数据
        edbData_edit:'edbData:edit',//指标编辑，也包括列表项的编辑按钮
        edbData_update:'edbData:update',//更新指标
        edbData_saveEdb:'edbData:saveEdb',//保存
        edbData_deleteEdb:'edbData:deleteEdb',//删除
        edbData_showChartBasis:'edbData:showChartBasis',//展示/隐藏同比图
        edbData_switchSeason:'edbData:switchSeason',//切换季节性图
        edbData_editLimit:'edbData:editLimit',//编辑上下限
        edbData_calculateAgain:'edbData:calculateAgain',//重新计算
        /*------------页面按钮---------- */
        edbData_replaceEdb:'edbData:replaceEdb',//替换指标
        edbData_calcuEdb:'edbData:calcuEdb',//计算指标
        edbData_addEdb:'edbData:addEdb',//添加指标
        edbData_switchEn:'edbData:switchEn',//切换英文版
        edbData_classifyOpt_add:'edbData:classifyOpt:add',//添加/编辑分类
        edbData_classifyOpt_delete:'edbData:classifyOpt:delete',//删除分类
        edbData_classifyOpt_move:'edbData:classifyOpt:move',//移动分类
        edbData_checkRelatedChart:'edbData:checkRelatedChart',//查看关联图表
        edbData_checkRelatedEdb:'edbData:checkRelatedEdb',//查看关联指标
        edbData_checkCalcChart:'edbData:checkCalcChart',//查看计算指标
}

/*
-------------------------ETA图库------------------
*/
export const chartLibBtn={
    /*-----------图表详情按钮--------- */
    chartLib_del:'chartLib:del',//删除
    chartLib_enNameSetting:'chartLib:enNameSetting',//设置英文名称
    chartLib_copyWechat:'chartLib:copyWechat',//保存图片（两个按钮控制）
    chartLib_copyOffice:'chartLib:copyOffice',//保存图片（两个按钮控制）
    chartLib_otherSave:'chartLib:otherSave',//另存为
    chartLib_save:'chartLib:save',//保存
    chartLib_refresh:'chartLib:refresh',//刷新
    chartLib_addMy:'chartLib:addMy',//加入我的图库
    chartLib_share:'chartLib:share',//分享
    chartLib_editLimit:'chartLib:editLimit',//编辑上下限
    /*------------页面按钮---------- */
    chartLib_switchEn:'chartLib:switchEn',//切换中英文
    chartLib_isOnlyMine:'chartLib:isOnlyMine',//只看我的
    chartLib_classifyOpt_add:'chartLib:classifyOpt:add',//新增/编辑分类
	chartLib_classifyOpt_delete:'chartLib:classifyOpt:delete',//删除分类
}

/*
------------------------MyETA--------------------
*/
export const myETABtn={
    /*-----------图表详情弹窗按钮--------- */
    myChart_del:'myChart:del',
    myChart_enNameSetting:'myChart:enNameSetting',
    myChart_copyWechat:'myChart:copyWechat',
    myChart_copyOffice:'myChart:copyOffice',
    myChart_otherSave:'myChart:otherSave',
    myChart_save:'myChart:save',
    myChart_refresh:'myChart:refresh',
    myChart_copyTo:'myChart:copyTo',
    myChart_share:'myChart:share',
    myChart_move:'myChart:move',//移出，同时也控制列表项的移出
    myChart_copyData:'myChart:copyData',//复制数据
    myChart_checkData:'myChart:checkData',//查看数据
    myChart_editLimit:'myChart:editLimit',//编辑上下限
    /*-----------页面按钮--------- */
    myChart_selectChart:'myChart:selectChart',//选择图表
    myChart_classifyOpt_copy:'myChart:classifyOpt:copy',//复制
    myChart_classifyOpt_show:'myChart:classifyOpt:show',//可见权限
    myChart_classifyOpt_edit:'myChart:classifyOpt:edit',//添加我的分类
    myChart_classifyOpt_rename:'myChart:classifyOpt:rename',//重命名
    myChart_classifyOpt_delete:'myChart:classifyOpt:delete',//删除
}

/*
 * --------------------------------------------------------------------------ETA表格------------------------------------------------
*/
export const etaTablePermission = {
    /*-----------混合表格页面--------- */
    etaTable_customize_mix_classifyOpt_edit: 'etaTable:customize:mix:classifyOpt:edit',//混合表格分类操作
    etaTable_customize_mix_classifyOpt_delete: 'etaTable:customize:mix:classifyOpt:delete',//混合表格分类删除
    etaTable_customize_mix_refresh:'etaTable:customize:mix:refresh',//刷新
    etaTable_customize_mix_download:'etaTable:customize:mix:download',//下载
    etaTable_customize_mix_save:'etaTable:customize:mix:save',//保存
    etaTable_customize_mix_del:'etaTable:customize:mix:del',//删除

    /*-----------时间序列表格数据表格页面--------- */
    etaTable_customize_data_classifyOpt_edit: 'etaTable:customize:data:classifyOpt:edit',//数据表格分类操作
    etaTable_customize_data_classifyOpt_delete: 'etaTable:customize:data:classifyOpt:delete',//数据表格分类删除
    etaTable_customize_data_refresh:'etaTable:customize:data:refresh',//刷新
    etaTable_customize_data_download:'etaTable:customize:data:download',//下载
    etaTable_customize_data_del:'etaTable:customize:data:del',//删除
    etaTable_customize_data_save:'etaTable:customize:data:save',//保存

    /*-----------excel共享表格页面--------- */
    etaTable_excel_classifyOpt_edit:'etaTable:excel:classifyOpt:edit',//添加编辑表格
    etaTable_excel_classifyOpt_delete:'etaTable:excel:classifyOpt:delete',//删除表格
    etaTable_excel_del:'etaTable:excel:del',
    etaTable_excel_download:'etaTable:excel:download',
    etaTable_excel_save:'etaTable:excel:save',//保存
    etaTable_excel_edit:'etaTable:excel:edit',

    /*-----------excel平衡表页面--------- */
    etaTable_customize_balance_sheetAdd:'etaTable:customize:balance:sheetAdd',//添加
    etaTable_customize_balance_del:'etaTable:customize:balance:del',//删除
    etaTable_customize_balance_download:'etaTable:customize:balance:download',//下载
    etaTable_customize_balance_refresh:'etaTable:customize:balance:refresh',//刷新
    etaTable_customize_balance_edit:'etaTable:customize:balance:edit',//编辑
    etaTable_customize_balance_classifyOpt_delete:'etaTable:customize:balance:classifyOpt:delete',//删除分类
}

export function useAuthBtn(){
    const isShowBtn = ()=>{}
    const checkAuthBtn = (buttonCode)=>{
        const list = authBtnStore.authBtnList||[]
        return list.map(item=>item.ButtonCode).includes(buttonCode)
    }
    return {
        isShowBtn,
        checkAuthBtn
    }
}