export default {
  state: {
    menuContent: [
        {
            name: "波浪线",
            method: "wave",
        },
        {
            name: "下划线",
            method: "underscore",
        },
        {
            name: "高亮",
            method: "highlight",
        },
        {
            name: "批注",
            method: "mark",
        }
    ], // 右键菜单内容
    mark:{
        color:'#ff0000',
        scratchType:2,
        permissionType:1,
        rangeType:true,
        content:'',
        remark:'',
    },//选中文本信息
    clientX: "", // left
    clientY: "",
    displayContextMenu: false, // 是否展示右键菜单
  },
  mutations: {
    SET_CONTEXT_MENU: (state, payload) => {
      state.displayContextMenu = payload.displayContextMenu;
      state.clientX = payload.clientX;
      state.clientY = payload.clientY;
      if(payload.menuContent && payload.menuContent.length>0)
      {
        var a = [
            {
                name: "波浪线",
                method: "wave",
            },
            {
                name: "下划线",
                method: "underscore",
            },
            {
                name: "高亮",
                method: "highlight",
            },
            {
                name: "批注",
                method: "mark",
            }
        ]
       state.menuContent =a.concat(payload.menuContent) ; 
      }
      
    },
    SET_PATENT_INDEX(state, index){
        state.mark = index
    }
  },
};
