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